src/flask/scaffold.py
def _matching_loader_thinks_module_is_package(loader, mod_name):
    """Attempt to figure out if the given name is a package or a module.

    :param: loader: The loader that handled the name.
    :param mod_name: The name of the package or module.
    """
    # Use loader.is_package if it's available.
    if hasattr(loader, "is_package"):
        return loader.is_package(mod_name)

    cls = type(loader)

    # NamespaceLoader doesn't implement is_package, but all names it
    # loads must be packages.
    if cls.__module__ == "_frozen_importlib" and cls.__name__ == "NamespaceLoader":
        return True

    # Otherwise we need to fail with an error that explains what went
    # wrong.
    raise AttributeError(
        f"'{cls.__name__}.is_package()' must be implemented for PEP 302"
        f" import hooks."
    )
Attempt to figure out if the given name is a package or a module.

    :param: loader: The loader that handled the name.
    :param mod_name: The name of the package or module.
    
Attempt to figure out if the given name is a package or a module.
:param: loader: The loader that handled the name.
:param mod_name: The name of the package or module.
Attempt to figure out if the given name is a package or a module . : param : loader : The loader that handled the name . : param mod_name : The name of the package or module .
def _matching_loader_thinks_module_is_package(loader, mod_name):
    if hasattr(loader, "is_package"):
        return loader.is_package(mod_name)
    cls = type(loader)
    if cls.__module__ == "_frozen_importlib" and cls.__name__ == "NamespaceLoader":
        return True
    raise AttributeError(
        f"'{cls.__name__}.is_package()' must be implemented for PEP 302"
        f" import hooks."
    )
def _matching_loader_thinks_module_is_package ( loader , mod_name ) : if hasattr ( loader , "is_package" ) : return loader . is_package ( mod_name ) cls = type ( loader ) if cls . __module__ == "_frozen_importlib" and cls . __name__ == "NamespaceLoader" : return True raise AttributeError ( f"'{cls.__name__}.is_package()' must be implemented for PEP 302" f" import hooks." )
Attempt to figure out if the given name is a package or a module.
Attempt to figure out if the given name is a package or a module .
"""Attempt to figure out if the given name is a package or a module.

    :param: loader: The loader that handled the name.
    :param mod_name: The name of the package or module.
    """ # Use loader.is_package if it's available. # NamespaceLoader doesn't implement is_package, but all names it # loads must be packages. # Otherwise we need to fail with an error that explains what went # wrong.
loader
mod_name