def METHOD_NAME(module_name):  # type: (str) -> bool
    """
    select if module_name should be patch from the longuest prefix that match in allow or deny list.
    if a prefix is in both list, deny is selected.
    """
    max_allow = max((len(prefix) for prefix in IAST_ALLOWLIST if module_name.startswith(prefix)), default=-1)
    max_deny = max((len(prefix) for prefix in IAST_DENYLIST if module_name.startswith(prefix)), default=-1)
    diff = max_allow - max_deny
    return diff > 0 or (diff == 0 and not _in_python_stdlib_or_third_party(module_name))