nodes: 0, module; 1, function_definition; 2, function_name:add; 3, parameters; 4, block; 5, identifier:self; 6, identifier:interval; 7, identifier:offset; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, comment:"""
          The added interval must be overlapping or beyond the last stored interval ie. added in sorted order.
  
          :param interval: interval to add
          :param offset: full virtual offset to add
          :return:
          """; 12, assignment; 13, comparison_operator:len(self.starts) > 0; 14, block; 15, else_clause; 16, pattern_list; 17, call; 18, call; 19, integer:0; 20, if_statement; 21, expression_statement; 22, expression_statement; 23, block; 24, identifier:start; 25, identifier:stop; 26, attribute; 27, argument_list; 28, identifier:len; 29, argument_list; 30, boolean_operator; 31, block; 32, assignment; 33, augmented_assignment; 34, expression_statement; 35, expression_statement; 36, expression_statement; 37, identifier:self; 38, identifier:get_start_stop; 39, identifier:interval; 40, attribute; 41, comparison_operator:start < self.starts[-1]; 42, comparison_operator:offset <= self.offsets[-1][1]; 43, raise_statement; 44, subscript; 45, identifier:offset; 46, subscript; 47, integer:1; 48, call; 49, call; 50, call; 51, identifier:self; 52, identifier:starts; 53, identifier:start; 54, subscript; 55, identifier:offset; 56, subscript; 57, call; 58, subscript; 59, integer:1; 60, subscript; 61, integer:2; 62, attribute; 63, argument_list; 64, attribute; 65, argument_list; 66, attribute; 67, argument_list; 68, attribute; 69, unary_operator; 70, subscript; 71, integer:1; 72, identifier:ValueError; 73, argument_list; 74, attribute; 75, unary_operator; 76, attribute; 77, unary_operator; 78, attribute; 79, identifier:append; 80, identifier:start; 81, attribute; 82, identifier:append; 83, identifier:stop; 84, attribute; 85, identifier:append; 86, list; 87, identifier:self; 88, identifier:starts; 89, integer:1; 90, attribute; 91, unary_operator; 92, string; 93, identifier:self; 94, identifier:offsets; 95, integer:1; 96, identifier:self; 97, identifier:offsets; 98, integer:1; 99, identifier:self; 100, identifier:starts; 101, identifier:self; 102, identifier:stops; 103, identifier:self; 104, identifier:offsets; 105, identifier:offset; 106, identifier:offset; 107, integer:1; 108, identifier:self; 109, identifier:offsets; 110, integer:1; 111, string_content:intervals and offsets must be added in-order
code: def add(self, interval, offset):
          """
          The added interval must be overlapping or beyond the last stored interval ie. added in sorted order.
  
          :param interval: interval to add
          :param offset: full virtual offset to add
          :return:
          """
          start, stop = self.get_start_stop(interval)
  
          if len(self.starts) > 0:
              if start < self.starts[-1] or offset <= self.offsets[-1][1]:
                  raise ValueError('intervals and offsets must be added in-order')
              self.offsets[-1][1] = offset
              self.offsets[-1][2] += 1
          else:
              self.starts.append(start)
              self.stops.append(stop)
              self.offsets.append([offset, offset, 1])