import importlib


def _json_convert_from_dict(obj_dict: dict) -> object:
    """
    Takes in a dict and returns an object associated with the dict.
    The function uses the "__module__" and "__class__" metadata in the dictionary to know which object to create.

    Parameters
    ----------
    obj_dict : dict
        The object dictionary to convert to an object

    Returns
    -------
    obj : object
        The object
    """
    if "__class__" in obj_dict and "__module__" in obj_dict:
        class_name = obj_dict.pop("__class__")

        module_name = obj_dict.pop("__module__")

        module = importlib.import_module(module_name)
        obj_class = getattr(module, class_name)

        obj = obj_class(**obj_dict)
    else:
        obj = obj_dict

    return obj