code: def _find_relations(self):
          
          # Get all extractions
          extractions = \
              list(self.tree.execute("$.extractions[(@.@type is 'Extraction')]"))
  
          # Get relations from extractions
          relations = []
          for e in extractions:
              label_set = set(e.get('labels', []))
              # If this is a DirectedRelation
              if 'DirectedRelation' in label_set:
                  self.relation_dict[e['@id']] = e
                  subtype = e.get('subtype')
                  if any(t in subtype for t in polarities.keys()):
                      relations.append((subtype, e))
              # If this is an Event or an Entity
              if {'Event', 'Entity'} & label_set:
                  self.concept_dict[e['@id']] = e
  
          if not relations and not self.relation_dict:
              logger.info("No relations found.")
          else:
              logger.info('%d relations of types %s found'
                          % (len(relations), ', '.join(polarities.keys())))
              logger.info('%d relations in dict.' % len(self.relation_dict))
              logger.info('%d concepts found.' % len(self.concept_dict))
          return relations
docs: Find all relevant relation elements and return them in a list.