from typing import OrderedDict


def _as_odict_copy(results):
    """Transform input into a OrderedDict, if needed. Returns a copy.
    """
    iterator = enumerate(results)
    if isinstance(results, dict):
        iterator = results.items()
    return OrderedDict((k, v) for k, v in iterator)