code: def __get_segment_types(self, element):
          
          if not 'parent' in element.attrib:
              if element.tag == 'segment':
                  segment_type = 'isolated'
                  parent_segment_type = None
              else:  # element.tag == 'group'
                  segment_type = 'span'
                  parent_segment_type = None
              return segment_type, parent_segment_type
  
          # ``relname`` either contains the name of an RST relation or
          # the string ``span`` (iff the segment is dominated by a span
          # node -- a horizontal line spanning one or more segments/groups
          # in an RST diagram). ``relname`` is '', if the segment is
          # unconnected.
          relname = element.attrib.get('relname', '')
          # we look up, if ``relname`` represents a regular, binary RST
          # relation or a multinucular relation. ``reltype`` is '',
          # if ``relname`` is ``span`` (i.e. a span isn't an RST relation).
          reltype = self.relations.get(relname, '')
  
          if reltype == 'rst':
              segment_type = 'satellite'
              parent_segment_type = 'nucleus'
          elif reltype == 'multinuc':
              segment_type = 'nucleus'
              parent_segment_type = None # we don't know it's type, yet
          else:  # reltype == ''
              # the segment is of unknown type, it is dominated by
              # a span group node
              segment_type = 'span'
              parent_segment_type = 'span'
          return segment_type, parent_segment_type
docs: given a <segment> or <group> element, returns its segment type and the
          segment type of its parent (i.e. its dominating node)
  
          Parameters
          ----------
          element : ??? etree Element
  
          Returns
          -------
          segment_type : str
              'nucleus', 'satellite' or 'isolated' (unconnected segment, e.g. a
              news headline) or 'span' (iff the segment type is currently
              unknown -- i.e. ``relname`` is ``span``)
          parent_segment_type : str or None
              'nucleus', 'satellite' or None (e.g. for the root group node)