def iterator(self):
        results = super(SearchableQuerySet, self).iterator()
        if self._search_terms and not self._search_ordered:
            results = list(results)
            for i, result in enumerate(results):
                count = 0
                related_weights = []
                for (field, weight) in self._search_fields.items():
                    if "__" in field:
                        related_weights.append(weight)
                    for term in self._search_terms:
                        field_value = getattr(result, field, None)
                        if field_value:
                            count += field_value.lower().count(term) * weight
                if not count and related_weights:
                    count = int(sum(related_weights) / len(related_weights))
                results[i].result_count = count
            return iter(results)
        return results
Execute a command and read the output as YAML
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/core/managers.py/SearchableQuerySet.iterator--crossover with--dataset/ETHPy150Open saltstack/salt/salt/pillar/svn_pillar.py/ext_pillar