import collections


def deep_convert_to_plain_dict(an_odict):
    """
    Recursively convert `an_odict` and any of its dictionary subelements from
    `collections.OrderedDict`:py:class: to plain `dict`:py:class:

    .. note:: This is naive, in that it will not properly handle dictionaries
        with recursive object references.

    :Args:
        an_odict
            a (presumably) `collections.OrderedDict`:py:class: to convert

    :Returns:
        an "unordered" (i.e., plain) `dict`:py:class: with all ordered
        dictionaries converted to `dict`:py:class:
    """
    a_dict = {}
    for (key, value) in an_odict.items():
        if type(value) is collections.OrderedDict:
            a_dict[key] = deep_convert_to_plain_dict(value)
        else:
            a_dict[key] = value
    return a_dict