from typing import OrderedDict


def nested_OrderedDict(dictionary):
    """Create a nested OrderedDict from a nested dict.
    Parameters
    ----------
    dictionary : dict
        Nested dict.
    Returns
    -------
    dictionary : collections.OrderedDict
        Nested OrderedDict.
    """
    dictionary = OrderedDict(dictionary)
    for key, value in dictionary.items():
        if isinstance(value, dict):
            dictionary[key] = nested_OrderedDict(value)

    return dictionary