def METHOD_NAME():
    dependencies = TypeMapItem._get_dependencies()
    ordered = dict()
    while dependencies:
        found_next = False
        for type_name, unloaded in dependencies.items():
            if not unloaded:
                ordered[type_name] = len(ordered)
                found_next = True
                break
        if found_next is False:
            raise Exception('recursive loading dependency')
        dependencies.pop(type_name)
        for unloaded in dependencies.values():
            unloaded.discard(type_name)
    return ordered