parameters: (self, other)
return_statement: return True
docstring: Does this Ref overlap ``other`` Ref?
  
          :param other: Ref
          :return bool:
docstring_summary: Does this Ref overlap ``other`` Ref?
docstring_tokens: Does this Ref overlap other Ref?
function: def overlaps(self, other):
          """
          Does this Ref overlap ``other`` Ref?
  
          :param other: Ref
          :return bool:
          """
          assert isinstance(other, Ref)
          if not self.index_node == other.index_node:
              return self.index_node.is_ancestor_of(other.index_node)
  
          smallest_section_len = min([len(self.sections), len(other.sections)])
  
          # at each level of shared specificity
          for i in range(smallest_section_len):
              # If I start after your end, we don't overlap
              if self.sections[i] > other.toSections[i]:
                  return False
              # If I start before your end, we don't need to keep checking
              if self.sections[i] < other.toSections[i]:
                  break
  
          # at each level of shared specificity
          for i in range(smallest_section_len):
              # If I end before your start, we don't overlap
              if self.toSections[i] < other.sections[i]:
                  return False
  
              # If I end after your start, we don't need to keep checking
              if self.toSections[i] > other.sections[i]:
                  break
  
          return True
function_tokens: def overlaps ( self , other ) : assert isinstance ( other , Ref ) if not self . index_node == other . index_node : return self . index_node . is_ancestor_of ( other . index_node ) smallest_section_len = min ( [ len ( self . sections ) , len ( other . sections ) ] ) # at each level of shared specificity for i in range ( smallest_section_len ) : # If I start after your end, we don't overlap if self . sections [ i ] > other . toSections [ i ] : return False # If I start before your end, we don't need to keep checking if self . sections [ i ] < other . toSections [ i ] : break # at each level of shared specificity for i in range ( smallest_section_len ) : # If I end before your start, we don't overlap if self . toSections [ i ] < other . sections [ i ] : return False # If I end after your start, we don't need to keep checking if self . toSections [ i ] > other . sections [ i ] : break return True