def METHOD_NAME(
    select: str,
    tag: 'bs4.Tag',
    namespaces: dict[str, str] | None = None,
    flags: int = 0,
    *,
    custom: dict[str, str] | None = None,
    **kwargs: Any
) -> 'bs4.Tag':
    """Match closest ancestor."""
    return compile(select, namespaces, flags, **kwargs).METHOD_NAME(tag)