Returns a loader object for a given path, with
    the correct finder class (``ModuleFinder`` for
    directories and ``FileFinder`` for single file
    modules).

    :param path: The path to the module(s).

def loader(path):
    """
    Returns a loader object for a given path, with
    the correct finder class (``ModuleFinder`` for
    directories and ``FileFinder`` for single file
    modules).

    :param path: The path to the module(s).
    """
    finder = ModuleFinder if _isdir(path) else FileFinder
    return Loader(finder(path))