code: def finddefaultreference(self):
          
  
          depth = 0
          e = self
          while True:
              if e.parent:
                  e = e.parent #pylint: disable=redefined-variable-type
              else:
                  #no parent, breaking
                  return False
  
              if isinstance(e,AbstractStructureElement) or isinstance(e,AbstractSubtokenAnnotation):
                  depth += 1
                  if depth == 2:
                      return e
  
  
          return False
docs: Find the default reference for text offsets:
            The parent of the current textcontent's parent (counting only Structure Elements and Subtoken Annotation Elements)
  
            Note: This returns not a TextContent element, but its parent. Whether the textcontent actually exists is checked later/elsewhere