References:
        http://stackoverflow.com/questions/22663966/changing-order-of-ordered-dictionary-in-python

    CommandLine:
        python -m utool.util_dict --exec-move_odict_item

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_dict import *  # NOQA
        >>> import utool as ut
        >>> odict = OrderedDict()
        >>> odict['a'] = 1
        >>> odict['b'] = 2
        >>> odict['c'] = 3
        >>> odict['e'] = 5
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'c', 1)
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'a', 3)
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'a', 0)
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'b', 2)
        >>> result = ut.repr4(odict, nl=False)
        >>> print(result)
        {'a': 1, 'c': 3, 'b': 2, 'e': 5}

def move_odict_item(odict, key, newpos):
    """
    References:
        http://stackoverflow.com/questions/22663966/changing-order-of-ordered-dictionary-in-python

    CommandLine:
        python -m utool.util_dict --exec-move_odict_item

    Example:
        >>> # ENABLE_DOCTEST
        >>> from utool.util_dict import *  # NOQA
        >>> import utool as ut
        >>> odict = OrderedDict()
        >>> odict['a'] = 1
        >>> odict['b'] = 2
        >>> odict['c'] = 3
        >>> odict['e'] = 5
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'c', 1)
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'a', 3)
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'a', 0)
        >>> print(ut.repr4(odict, nl=False))
        >>> move_odict_item(odict, 'b', 2)
        >>> result = ut.repr4(odict, nl=False)
        >>> print(result)
        {'a': 1, 'c': 3, 'b': 2, 'e': 5}
    """
    odict[key] = odict.pop(key)
    for i, otherkey in enumerate(list(odict.keys())):
        if otherkey != key and i >= newpos:
            odict[otherkey] = odict.pop(otherkey)
    return odict