import inspect


def list_modules(root):
    """List submodules of a module.

    This function does not scan the whole hierarchical structure, just the modules
    imported by the provided root. See `list_all_modules`.

    Args:
        root (module): The module for which you want a list of submodules.

    Returns:
        list: submodules of root.

    """
    return inspect.getmembers(root, lambda x: inspect.ismodule(x))