code: def matches(self, *specs):
          
          for spec in specs:
              if ':' in spec:
                  app_name, endpoint_name = spec.split(':')
              else:
                  app_name, endpoint_name = spec, None
              for endpoint in self.endpoints:
                  if app_name == endpoint.application.name and \
                     endpoint_name in (endpoint.name, None):
                      # found a match for this spec, so move to next one
                      break
              else:
                  # no match for this spec
                  return False
          return True
docs: Check if this relation matches relationship specs.
  
          Relation specs are strings that would be given to Juju to establish a
          relation, and should be in the form ``<application>[:<endpoint_name>]``
          where the ``:<endpoint_name>`` suffix is optional.  If the suffix is
          omitted, this relation will match on any endpoint as long as the given
          application is involved.
  
          In other words, this relation will match a spec if that spec could have
          created this relation.
  
          :return: True if all specs match.