def _index_list(key_or_list, direction=None):
    if direction is not None:
        return [(key_or_list, direction)]
    else:
        if isinstance(key_or_list, basestring):
            return [(key_or_list, ASCENDING)]
        elif not isinstance(key_or_list, (list, tuple)):
            raise TypeError("if no direction is specified, "
                            "key_or_list must be an instance of list")
    return key_or_list
Test that annotations can make the round trip from a simple dictionary
dataset/ETHPy150Open vmalloc/mongomock/mongomock/helpers.py/_index_list--crossover with--dataset/ETHPy150Open Sage-Bionetworks/synapsePythonClient/tests/unit/unit_test_annotations.py/test_round_trip_annotations