from pathlib import Path
import glob


def filter_paths(paths, excluded_paths):
    """Filter out path matching one of excluded_paths glob

    Args:
        paths: path to filter.
        excluded_paths: List for glob of modules to exclude.

    Returns: An iterable of paths Python modules (i.e. *py files).
    """
    excluded = set(Path(f) for excluded_path in excluded_paths
                   for f in glob.glob(excluded_path, recursive=True))
    return set(paths) - excluded