code: def attributes(self, source=None, relation=None, target=None):
          
          attrmatch = lambda a: (
              (source is None or source == a.source) and
              (relation is None or relation == a.relation) and
              (target is None or target == a.target)
          )
          variables = self.variables()
          attrs = [t for t in self.triples() if t.target not in variables]
          return list(filter(attrmatch, attrs))
docs: Return attributes filtered by their *source*, *relation*, or *target*.
  
          Attributes don't include triples where the target is a nonterminal.