code: def _match_one_or_many(self, models, results, relation, type_):
          
          dictionary = self._build_dictionary(results)
  
          for model in models:
              key = model.get_attribute(self._local_key)
  
              if key in dictionary:
                  value = Result(
                      self._get_relation_value(dictionary, key, type_), self, model
                  )
              else:
                  if type_ == "one":
                      value = Result(None, self, model)
                  else:
                      value = Result(self._related.new_collection(), self, model)
  
              model.set_relation(relation, value)
  
          return models
docs: Match the eargerly loaded resuls to their single parents.
  
          :param models: The parents
          :type models: list
  
          :param results: The results collection
          :type results: Collection
  
          :param relation: The relation
          :type relation: str
  
          :param type_: The match type
          :type type_: str
  
          :rtype: list