def _build_dictionary(self, results):
        foreign = self._foreign_key

        dictionary = {}

        for result in results:
            key = getattr(result.pivot, foreign)
            if key not in dictionary:
                dictionary[key] = []

            dictionary[key].append(result)

        return dictionary
Get a test runner for the tests.  Uses nose if available.
dataset/ETHPy150Open sdispater/orator/orator/orm/relations/belongs_to_many.py/BelongsToMany._build_dictionary--crossover with--dataset/ETHPy150Open enthought/mayavi/mayavi/tests/runtests.py/get_test_runner