from typing import Dict
from typing import Type


def filter_classes_from_module(
    classes: Dict[str, Type], module_name: str
) -> Dict[str, Type]:
    """Restrict the given classes to the one found in the given module.

    Parameters
    ----------
    classes : Dict[str, Type]
        A dict of classes from which to extract the ones to return. Full python path as keys, and
        the classes as values.
    module_name : str
        The python path of the module for which we want the classes

    Returns
    -------
    Dict[str, Type]
        The filtered `classes` (same format as the given `classes` argument)

    """
    prefix = f"{module_name}."
    return {
        class_name: klass
        for class_name, klass in classes.items()
        if class_name.startswith(prefix)
    }