def exclude_path(path, patterns):
    for pattern in (patterns or []):
        if pattern.match(path):
            return isinstance(pattern, ExcludePattern)
    return False


# For both IncludePattern and ExcludePattern, we require that
# the pattern either match the whole path or an initial segment
# of the path up to but not including a path separator.  To
# unify the two cases, we add a path separator to the end of
# the path before matching.
Used by create and extract sub-commands to determine
dataset/ETHPy150Open jborg/attic/attic/helpers.py/exclude_path