def METHOD_NAME(
        antlir2: str | bool | None,
        *,
        flavor: _FLAVOR_T = None,
        disabled_packages: list[str] = _DEFAULT_DISABLED_PACKAGES,
        enabled_packages: list[str] = _DEFAULT_ENABLED_PACKAGES) -> bool:
    if types.is_bool(antlir2):
        antlir2 = antlir2_setting("yes" if antlir2 else "no")
    else:
        antlir2 = antlir2_setting(antlir2) if antlir2 else None
    # TODO(vmagro): make True the default
    result = False
    # Find the "closest" match so that _DEFAULT_{ENABLED,DISABLED}_PACKAGES can
    # peacefully co-exist
    distance = 999999999
    for pkg in enabled_packages:
        if native.package_name() == pkg or native.package_name().startswith(pkg + "/"):
            this_distance = len(native.package_name()[len(pkg):].split("/"))
            if this_distance < distance:
                result = _antlir2_or_default(antlir2, True)
                distance = this_distance
    for pkg in disabled_packages:
        if native.package_name() == pkg or native.package_name().startswith(pkg + "/"):
            this_distance = len(native.package_name()[len(pkg):].split("/"))
            if this_distance < distance:
                result = _antlir2_or_default(antlir2, False)
                distance = this_distance
    return result