<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def search_normalize(self, results):
 """Normalize search results so they can be used to create new entities. See :meth:`search` for an example of how to use this method. Here's a simplified example:: results = self.search_json() results = self.search_normalize(results) entity = SomeEntity(some_cfg, **results[0]) At this time, it is possible to parse all search results without knowing what search query was sent to the server. However, it is possible that certain responses can only be parsed if the search query is known. If that is the case, this method will be given a new ``payload`` argument, where ``payload`` is the query sent to the server. As a precaution, the following is higly recommended: * :meth:`search` may alter ``fields`` and ``query`` at will. * :meth:`search_payload` may alter ``fields`` and ``query`` in an idempotent manner. * No other method should alter ``fields`` or ``query``. :param results: A list of dicts, where each dict is a set of attributes for one entity. The contents of these dicts are as is returned from the server. :returns: A list of dicts, where each dict is a set of attributes for one entity. The contents of these dicts have been normalized and can be used to instantiate entities. """

        fields = self.get_fields()
        normalized = []
        for result in results:
            # For each field that we know about, copy the corresponding field
            # from the server's search result. If any extra attributes are
            # copied over, Entity.__init__ will raise a NoSuchFieldError.
            # Examples of problematic results from server:
            #
            # * organization_id (denormalized OneToOne. see above)
            # * organizations, organization_ids (denormalized OneToMany. above)
            # * updated_at, created_at (these may be handled in the future)
            # * sp_subnet (Host.sp_subnet is an undocumented field)
            #
            attrs = {}
            for field_name, field in fields.items():
                if isinstance(field, OneToOneField):
                    try:
                        attrs[field_name] = _get_entity_id(field_name, result)
                    except MissingValueError:
                        pass
                elif isinstance(field, OneToManyField):
                    try:
                        attrs[field_name] = _get_entity_ids(field_name, result)
                    except MissingValueError:
                        pass
                else:
                    try:
                        attrs[field_name] = result[field_name]
                    except KeyError:
                        pass
            normalized.append(attrs)
        return normalized