code: def expand(self, other):
          
          if not isinstance(other, Result):
              raise ValueError("Provided argument has to be instance of overpy:Result()")
  
          other_collection_map = {Node: other.nodes, Way: other.ways, Relation: other.relations, Area: other.areas}
          for element_type, own_collection in self._class_collection_map.items():
              for element in other_collection_map[element_type]:
                  if is_valid_type(element, element_type) and element.id not in own_collection:
                      own_collection[element.id] = element
docs: Add all elements from an other result to the list of elements of this result object.
  
          It is used by the auto resolve feature.
  
          :param other: Expand the result with the elements from this result.
          :type other: overpy.Result
          :raises ValueError: If provided parameter is not instance of :class:`overpy.Result`