def METHOD_NAME(
    self, exclude: bool, pattern: str, prefix: str = "", prefix2: str = ""
) -> None:
    assert not prefix or prefix[-1] == "/"
    assert not prefix2 or prefix2[-1] == "/"
    if "/" not in pattern.rstrip("/"):
        pattern = "**/" + pattern
    else:
        pattern = pattern.lstrip("/")
    re_pattern = translate(pattern)
    matcher = cast(
        Callable[[str], Any], re.compile(re_pattern, re.DOTALL).fullmatch
    )
    self.filters.METHOD_NAME((exclude, prefix, prefix2, matcher))