import re def is_path_match(path: str, *, match: list[str] | None) -> bool: """Return True if path is in match, False otherwise.""" if match is None: return False return path in match def is_path_match_re(path: str, *, match: list[str] | None) -> bool: """Return True if path matches any of the regexes in match, False otherwise.""" if match is None: return False for p in match: if re.compile(p).match(path): return True return False