//! This file is generated by `scripts/generate_builtin_modules.py`

/// Return `true` if `module` is a [builtin module] on the given
/// Python 3 version.
///
/// "Builtin modules" are modules that are compiled directly into the
/// Python interpreter. These can never be shadowed by first-party
/// modules; the normal rules of module resolution do not apply to these
/// modules.
///
/// [builtin module]: https://docs.python.org/3/library/sys.html#sys.builtin_module_names
#[allow(clippy::unnested_or_patterns)]
pub fn is_builtin_module(minor_version: u8, module: &str) -> bool {
    matches!(
        (minor_version, module),
        (
            _,
            "_abc"
                | "_ast"
                | "_asyncio"
                | "_bisect"
                | "_blake2"
                | "_bz2"
                | "_codecs"
                | "_codecs_cn"
                | "_codecs_hk"
                | "_codecs_iso2022"
                | "_codecs_jp"
                | "_codecs_kr"
                | "_codecs_tw"
                | "_collections"
                | "_contextvars"
                | "_csv"
                | "_ctypes"
                | "_curses"
                | "_curses_panel"
                | "_datetime"
                | "_decimal"
                | "_elementtree"
                | "_functools"
                | "_hashlib"
                | "_heapq"
                | "_imp"
                | "_io"
                | "_json"
                | "_locale"
                | "_lsprof"
                | "_lzma"
                | "_md5"
                | "_multibytecodec"
                | "_multiprocessing"
                | "_opcode"
                | "_operator"
                | "_pickle"
                | "_posixshmem"
                | "_posixsubprocess"
                | "_queue"
                | "_random"
                | "_scproxy"
                | "_sha1"
                | "_sha3"
                | "_signal"
                | "_socket"
                | "_sqlite3"
                | "_sre"
                | "_ssl"
                | "_stat"
                | "_statistics"
                | "_string"
                | "_struct"
                | "_symtable"
                | "_testinternalcapi"
                | "_thread"
                | "_tracemalloc"
                | "_uuid"
                | "_warnings"
                | "_weakref"
                | "array"
                | "atexit"
                | "binascii"
                | "builtins"
                | "cmath"
                | "errno"
                | "faulthandler"
                | "fcntl"
                | "gc"
                | "grp"
                | "itertools"
                | "marshal"
                | "math"
                | "mmap"
                | "posix"
                | "pwd"
                | "pyexpat"
                | "readline"
                | "resource"
                | "select"
                | "sys"
                | "syslog"
                | "termios"
                | "time"
                | "unicodedata"
                | "xxsubtype"
                | "zlib"
        ) | (
            8,
            "_ctypes_test" | "_dbm" | "_sha256" | "_sha512" | "_tkinter" | "audioop" | "parser"
        ) | (
            9,
            "_peg_parser"
                | "_sha256"
                | "_sha512"
                | "_testbuffer"
                | "_testimportmultiple"
                | "_testmultiphase"
                | "_xxsubinterpreters"
                | "_xxtestfuzz"
                | "_zoneinfo"
                | "audioop"
                | "parser"
        ) | (
            10,
            "_sha256" | "_sha512" | "_xxsubinterpreters" | "_xxtestfuzz" | "_zoneinfo" | "audioop"
        ) | (
            11,
            "_sha256"
                | "_sha512"
                | "_tokenize"
                | "_typing"
                | "_xxsubinterpreters"
                | "_xxtestfuzz"
                | "_zoneinfo"
                | "audioop"
        ) | (
            12,
            "_sha2"
                | "_tokenize"
                | "_typing"
                | "_xxinterpchannels"
                | "_xxsubinterpreters"
                | "_xxtestfuzz"
                | "_zoneinfo"
                | "audioop"
        ) | (
            13,
            "_interpchannels"
                | "_interpqueues"
                | "_interpreters"
                | "_sha2"
                | "_suggestions"
                | "_sysconfig"
                | "_tokenize"
                | "_typing"
                | "_xxtestfuzz"
                | "_zoneinfo"
        ) | (
            14,
            "_hmac"
                | "_interpchannels"
                | "_interpqueues"
                | "_interpreters"
                | "_remote_debugging"
                | "_sha2"
                | "_suggestions"
                | "_sysconfig"
                | "_tokenize"
                | "_types"
                | "_typing"
                | "_xxtestfuzz"
                | "_zoneinfo"
                | "_zstd"
        ) | (
            15,
            "_hmac"
                | "_interpchannels"
                | "_interpqueues"
                | "_interpreters"
                | "_math_integer"
                | "_remote_debugging"
                | "_sha2"
                | "_suggestions"
                | "_sysconfig"
                | "_tokenize"
                | "_types"
                | "_typing"
                | "_xxtestfuzz"
                | "_zoneinfo"
                | "_zstd"
        )
    )
}
