has_metadata()
isdefined()
length()
Link to code
Checks if a given trait has a metadata (and optionally if it is set to particular value)