nodes: 0, module; 1, function_definition; 2, function_name:_add_new; 3, parameters; 4, block; 5, identifier:self; 6, identifier:host_object; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, expression_statement; 11, comment:"""Add a new host to the collection.
  
          Before a new hostname can be added, all its subdomains already
          present in the collection must be removed. Since the collection
          is sorted, we can limit our search for them to a slice of
          the collection starting from insertion point and ending with
          the last detected subdomain.
  
          :param host_obj: an object representing value to be added.
          It is assumed that, during execution of this method,
          the value to be added is not currently listed.
          """; 12, assignment; 13, identifier:listed; 14, subscript; 15, block; 16, call; 17, identifier:i; 18, call; 19, identifier:self; 20, slice; 21, if_statement; 22, expression_statement; 23, attribute; 24, argument_list; 25, attribute; 26, argument_list; 27, identifier:i; 28, not_operator; 29, block; 30, call; 31, attribute; 32, identifier:insert; 33, identifier:i; 34, call; 35, identifier:self; 36, identifier:_get_insertion_point; 37, identifier:host_object; 38, call; 39, break_statement; 40, attribute; 41, argument_list; 42, identifier:self; 43, identifier:hosts; 44, attribute; 45, argument_list; 46, attribute; 47, argument_list; 48, attribute; 49, identifier:pop; 50, identifier:i; 51, identifier:host_object; 52, identifier:to_unicode; 53, identifier:listed; 54, identifier:is_subdomain; 55, identifier:host_object; 56, identifier:self; 57, identifier:hosts
code: def _add_new(self, host_object):
          """Add a new host to the collection.
  
          Before a new hostname can be added, all its subdomains already
          present in the collection must be removed. Since the collection
          is sorted, we can limit our search for them to a slice of
          the collection starting from insertion point and ending with
          the last detected subdomain.
  
          :param host_obj: an object representing value to be added.
          It is assumed that, during execution of this method,
          the value to be added is not currently listed.
          """
          i = self._get_insertion_point(host_object)
  
          for listed in self[i:]:
              if not listed.is_subdomain(host_object):
                  break
              self.hosts.pop(i)
  
          self.hosts.insert(i, host_object.to_unicode())