# List of all modules (standard library) available in Python 2.
STDLIB_PY2 = (
    "AL",
    "BaseHTTPServer",
    "Bastion",
    "CGIHTTPServer",
    "Carbon",
    "ColorPicker",
    "ConfigParser",
    "Cookie",
    "DEVICE",
    "DocXMLRPCServer",
    "EasyDialogs",
    "FL",
    "FrameWork",
    "GL",
    "HTMLParser",
    "MacOS",
    "MimeWriter",
    "MiniAEFrame",
    "Queue",
    "SUNAUDIODEV",
    "ScrolledText",
    "SimpleHTTPServer",
    "SimpleXMLRPCServer",
    "SocketServer",
    "StringIO",
    "Tix",
    "Tkinter",
    "UserDict",
    "UserList",
    "UserString",
    "__builtin__",
    "__future__",
    "__main__",
    "_winreg",
    "abc",
    "aepack",
    "aetools",
    "aetypes",
    "aifc",
    "al",
    "anydbm",
    "argparse",
    "array",
    "ast",
    "asynchat",
    "asyncore",
    "atexit",
    "audioop",
    "autoGIL",
    "base64",
    "bdb",
    "binascii",
    "binhex",
    "bisect",
    "bsddb",
    "bz2",
    "cPickle",
    "cProfile",
    "cStringIO",
    "calendar",
    "cd",
    "cgi",
    "cgitb",
    "chunk",
    "cmath",
    "cmd",
    "code",
    "codecs",
    "codeop",
    "collections",
    "colorsys",
    "commands",
    "compileall",
    "compiler",
    "contextlib",
    "cookielib",
    "copy",
    "copy_reg",
    "crypt",
    "csv",
    "ctypes",
    "curses",
    "datetime",
    "dbhash",
    "dbm",
    "decimal",
    "difflib",
    "dircache",
    "dis",
    "distutils",
    "dl",
    "doctest",
    "dumbdbm",
    "dummy_thread",
    "dummy_threading",
    "email",
    "ensurepip",
    "errno",
    "fcntl",
    "filecmp",
    "fileinput",
    "findertools",
    "fl",
    "flp",
    "fm",
    "fnmatch",
    "formatter",
    "fpectl",
    "fpformat",
    "fractions",
    "ftplib",
    "functools",
    "future_builtins",
    "gc",
    "gdbm",
    "gensuitemodule",
    "getopt",
    "getpass",
    "gettext",
    "gl",
    "glob",
    "grp",
    "gzip",
    "hashlib",
    "heapq",
    "hmac",
    "hotshot",
    "htmlentitydefs",
    "htmllib",
    "httplib",
    "ic",
    "imageop",
    "imaplib",
    "imgfile",
    "imghdr",
    "imp",
    "importlib",
    "imputil",
    "inspect",
    "io",
    "itertools",
    "jpeg",
    "json",
    "keyword",
    "linecache",
    "locale",
    "logging",
    "macostools",
    "macpath",
    "mailbox",
    "mailcap",
    "marshal",
    "math",
    "md5",
    "mhlib",
    "mimetools",
    "mimetypes",
    "mimify",
    "mmap",
    "modulefinder",
    "msilib",
    "msvcrt",
    "multifile",
    "multiprocessing",
    "mutex",
    "netrc",
    "new",
    "nis",
    "nntplib",
    "ntpath",
    "numbers",
    "operator",
    "optparse",
    "os",
    "os2emxpath",
    "ossaudiodev",
    "parser",
    "pdb",
    "pickle",
    "pickletools",
    "pipes",
    "pkgutil",
    "platform",
    "plistlib",
    "popen2",
    "poplib",
    "posix",
    "posixfile",
    "posixpath",
    "pprint",
    "profile",
    "pstats",
    "pty",
    "pwd",
    "py_compile",
    "pyclbr",
    "pydoc",
    "quopri",
    "random",
    "re",
    "readline",
    "repr",
    "resource",
    "rexec",
    "rfc822",
    "rlcompleter",
    "robotparser",
    "runpy",
    "sched",
    "select",
    "sets",
    "sgmllib",
    "sha",
    "shelve",
    "shlex",
    "shutil",
    "signal",
    "site",
    "smtpd",
    "smtplib",
    "sndhdr",
    "socket",
    "spwd",
    "sqlite3",
    "ssl",
    "stat",
    "statvfs",
    "string",
    "stringprep",
    "struct",
    "subprocess",
    "sunau",
    "sunaudiodev",
    "symbol",
    "symtable",
    "sys",
    "sysconfig",
    "syslog",
    "tabnanny",
    "tarfile",
    "telnetlib",
    "tempfile",
    "termios",
    "test",
    "textwrap",
    "thread",
    "threading",
    "time",
    "timeit",
    "token",
    "tokenize",
    "trace",
    "traceback",
    "ttk",
    "tty",
    "turtle",
    "types",
    "unicodedata",
    "unittest",
    "urllib",
    "urllib2",
    "urlparse",
    "user",
    "uu",
    "uuid",
    "warnings",
    "wave",
    "weakref",
    "webbrowser",
    "whichdb",
    "winsound",
    "wsgiref",
    "xdrlib",
    "xml",
    "xmlrpclib",
    "zipfile",
    "zipimport",
    "zlib",
)

# List of all modules (standard library) available in Python 3.
STDLIB_PY3 = (
    "__future__",
    "__main__",
    "_dummy_thread",
    "_thread",
    "abc",
    "aifc",
    "argparse",
    "array",
    "ast",
    "asynchat",
    "asyncio",
    "asyncore",
    "atexit",
    "audioop",
    "base64",
    "bdb",
    "binascii",
    "binhex",
    "bisect",
    "builtins",
    "bz2",
    "cProfile",
    "calendar",
    "cgi",
    "cgitb",
    "chunk",
    "cmath",
    "cmd",
    "code",
    "codecs",
    "codeop",
    "collection",
    "collections",
    "colorsys",
    "compileall",
    "concurrent",
    "configparser",
    "contextlib",
    "copy",
    "copyreg",
    "crypt",
    "csv",
    "ctypes",
    "curses",
    "datetime",
    "dbm",
    "decimal",
    "difflib",
    "dis",
    "distutils",
    "doctest",
    "dummy_threading",
    "email",
    "ensurepip",
    "enum",
    "errno",
    "faulthandler",
    "fcntl",
    "filecmp",
    "fileinput",
    "fnmatch",
    "formatter",
    "fpectl",
    "fractions",
    "ftplib",
    "functools",
    "gc",
    "getopt",
    "getpass",
    "gettext",
    "glob",
    "grp",
    "gzip",
    "hashlib",
    "heapq",
    "hmac",
    "html",
    "http",
    "imaplib",
    "imghdr",
    "imp",
    "importlib",
    "inspect",
    "io",
    "ipaddress",
    "itertools",
    "json",
    "keyword",
    "lib2to3",
    "linecache",
    "locale",
    "logging",
    "lzma",
    "macpath",
    "mailbox",
    "mailcap",
    "marshal",
    "math",
    "mimetypes",
    "mmap",
    "modulefinder",
    "msilib",
    "msvcrt",
    "multiprocessing",
    "netrc",
    "nis",
    "nntplib",
    "ntpath",
    "numbers",
    "operator",
    "optparse",
    "os",
    "ossaudiodev",
    "parser",
    "pathlib",
    "pdb",
    "pickle",
    "pickletools",
    "pipes",
    "pkgutil",
    "platform",
    "plistlib",
    "poplib",
    "posix",
    "posixpath",
    "pprint",
    "profile",
    "pstats",
    "pty",
    "pwd",
    "py_compile",
    "pyclbr",
    "pydoc",
    "queue",
    "quopri",
    "random",
    "re",
    "readline",
    "reprlib",
    "resource",
    "rlcompleter",
    "runpy",
    "sched",
    "select",
    "selectors",
    "shelve",
    "shlex",
    "shutil",
    "signal",
    "site",
    "smtpd",
    "smtplib",
    "sndhdr",
    "socket",
    "socketserver",
    "spwd",
    "sqlite3",
    "ssl",
    "stat",
    "statistics",
    "string",
    "stringprep",
    "struct",
    "subprocess",
    "sunau",
    "symbol",
    "symtable",
    "sys",
    "sysconfig",
    "syslog",
    "tabnanny",
    "tarfile",
    "telnetlib",
    "tempfile",
    "termios",
    "test",
    "textwrap",
    "threading",
    "time",
    "timeit",
    "tkinter",
    "token",
    "tokenize",
    "trace",
    "traceback",
    "tracemalloc",
    "tty",
    "turtle",
    "turtledemo",
    "types",
    "unicodedata",
    "unittest",
    "urllib",
    "uu",
    "uuid",
    "venv",
    "warnings",
    "wave",
    "weakref",
    "webbrowser",
    "winreg",
    "winsound",
    "wsgiref",
    "xdrlib",
    "xml",
    "xmlrpc",
    "zipfile",
    "zipimport",
    "zlib",
    # Modules since Python 3.5
    "typing",
    "zipapp",
    # Modules since Python 3.6
    "secrets",
    # Modules since Python 3.7
    "contextvars",
    "dataclasses",
    # Modules since Python 3.9
    "graphlib",
    "zoneinfo",
    # Modules since Python 3.11
    "tomllib",
)

# Mapping for known 3rd party projects, which provide more than one module
# or the name of the module is different than the project name itself.
KNOWN_3RD_PARTIES = {
    "absl-py": ["absl"],
    # NOTE: The allure-pytest package does not provide allure module directly
    #       but it depends on allure-python-commons which provides it. User
    #       will most likely specify allure-pytest as a dependency, though.
    "allure-pytest": ["allure"],
    "ansicolors": ["colors"],
    "apache-airflow": ["airflow"],
    "attrs": ["attr", "attrs"],
    "awesome-slugify": ["slugify"],
    "azure-common": ["azure.common"],
    "azure-core": ["azure.core"],
    "azure-graphrbac": ["azure.graphrbac"],
    "azure-identity": ["azure.identity"],
    "azure-keyvault": ["azure.keyvault"],
    "azure-keyvault-certificates": ["azure.keyvault.certificates"],
    "azure-keyvault-keys": ["azure.keyvault.keys"],
    "azure-keyvault-secrets": ["azure.keyvault.secrets"],
    "azure-mgmt-apimanagement": ["azure.mgmt.apimanagement"],
    "azure-mgmt-authorization": ["azure.mgmt.authorization"],
    "azure-mgmt-automation": ["azure.mgmt.automation"],
    "azure-mgmt-batch": ["azure.mgmt.batch"],
    "azure-mgmt-compute": ["azure.mgmt.compute"],
    "azure-mgmt-containerinstance": ["azure.mgmt.containerinstance"],
    "azure-mgmt-containerregistry": ["azure.mgmt.containerregistry"],
    "azure-mgmt-containerservice": ["azure.mgmt.containerservice"],
    "azure-mgmt-core": ["azure.mgmt.core"],
    "azure-mgmt-cosmosdb": ["azure.mgmt.cosmosdb"],
    "azure-mgmt-frontdoor": ["azure.mgmt.frontdoor"],
    "azure-mgmt-hybridkubernetes": ["azure.mgmt.hybridkubernetes"],
    "azure-mgmt-keyvault": ["azure.mgmt.keyvault"],
    "azure-mgmt-logic": ["azure.mgmt.logic"],
    "azure-mgmt-managementgroups": ["azure.mgmt.managementgroups"],
    "azure-mgmt-monitor": ["azure.mgmt.monitor"],
    "azure-mgmt-msi": ["azure.mgmt.msi"],
    "azure-mgmt-network": ["azure.mgmt.network"],
    "azure-mgmt-rdbms": ["azure.mgmt.rdbms"],
    "azure-mgmt-resource": ["azure.mgmt.resource"],
    "azure-mgmt-security": ["azure.mgmt.security"],
    "azure-mgmt-servicefabric": ["azure.mgmt.servicefabric"],
    "azure-mgmt-sql": ["azure.mgmt.sql"],
    "azure-mgmt-storage": ["azure.mgmt.storage"],
    "azure-mgmt-subscription": ["azure.mgmt.subscription"],
    "azure-mgmt-web": ["azure.mgmt.web"],
    "azure-storage-blob": ["azure.storage.blob"],
    "azure-storage-queue": ["azure.storage.queue"],
    "beautifulsoup4": ["bs4"],
    "bitvector": ["BitVector"],
    "cattrs": ["cattr", "cattrs"],
    "cx-oracle": ["cx_Oracle"],
    "databricks-connect": ["pyspark"],
    "django-ajax-selects": ["ajax_select"],
    "django-cors-headers": ["corsheaders"],
    "django-csp": ["csp"],
    "django-debug-toolbar": ["debug_toolbar"],
    "django-dotenv": ["dotenv"],
    "django-filter": ["django_filters"],
    "django-haystack": ["haystack"],
    "django-safedelete": ["safedelete"],
    "django-simple-history": ["simple_history"],
    "djangorestframework": ["rest_framework"],
    "enum34": ["enum"],
    "factory-boy": ["factory"],
    "ffmpeg-python": ["ffmpeg"],
    "fluent-logger": ["fluent"],
    "gitpython": ["git"],
    "google-api-python-client": ["apiclient", "googleapiclient"],
    "google-cloud-aiplatform": ["google.cloud.aiplatform"],
    "google-cloud-bigquery": ["google.cloud.bigquery"],
    "google-cloud-bigtable": ["google.cloud.bigtable"],
    "google-cloud-datastore": ["google.cloud.datastore"],
    "google-cloud-firestore": ["google.cloud.firestore"],
    "google-cloud-functions": [
        "google.cloud.functions_v1",
        "google.cloud.functions",
    ],
    "google-cloud-iam": ["google.cloud.iam_credentials_v1"],
    "google-cloud-iot": ["google.cloud.iot_v1"],
    "google-cloud-logging": [
        "google.cloud.logging_v2",
        "google.cloud.logging",
    ],
    "google-cloud-pubsub": ["google.cloud.pubsub_v1", "google.cloud.pubsub"],
    "google-cloud-secret-manager": ["google.cloud.secretmanager"],
    "google-cloud-storage": ["google.cloud.storage"],
    "grpcio": ["grpc"],
    "grpcio-channelz": ["grpc_channelz"],
    "grpcio-gcp": ["grpc_gcp"],
    "grpcio-health-checking": ["grpc_health"],
    "grpcio-opentracing": ["grpc_opentracing"],
    "grpcio-reflection": ["grpc_reflection"],
    "grpcio-status": ["grpc_status"],
    "grpcio-testing": ["grpc_testing"],
    "grpcio-tools": ["grpc_tools"],
    "hydra-core": ["hydra"],
    "ipython": ["IPython"],
    "jack-client": ["jack"],
    "kafka-python": ["kafka"],
    "lark-parser": ["lark"],
    "mysql-python": ["MySQLdb"],
    "mysqlclient": ["_mysql", "MySQLdb"],
    "opencv-contrib-python": ["cv2"],
    "opencv-contrib-python-headless": ["cv2"],
    "opencv-python": ["cv2"],
    "opencv-python-headless": ["cv2"],
    "opensearch-py": ["opensearchpy"],
    "opentelemetry-api": ["opentelemetry"],
    "opentelemetry-exporter-otlp-proto-grpc": [
        "opentelemetry.exporter.otlp.proto.grpc"
    ],
    "opentelemetry-exporter-otlp-proto-http": [
        "opentelemetry.exporter.otlp.proto.http"
    ],
    "opentelemetry-instrumentation-aiohttp-client": [
        "opentelemetry.instrumentation.aiohttp_client"
    ],
    "opentelemetry-instrumentation-botocore": [
        "opentelemetry.instrumentation.botocore"
    ],
    "opentelemetry-instrumentation-django": [
        "opentelemetry.instrumentation.django"
    ],
    "opentelemetry-instrumentation-elasticsearch": [
        "opentelemetry.instrumentation.elasticsearch"
    ],
    "opentelemetry-instrumentation-grpc": [
        "opentelemetry.instrumentation.grpc"
    ],
    "opentelemetry-instrumentation-httpx": [
        "opentelemetry.instrumentation.httpx"
    ],
    "opentelemetry-instrumentation-jinja2": [
        "opentelemetry.instrumentation.jinja2"
    ],
    "opentelemetry-instrumentation-psycopg2": [
        "opentelemetry.instrumentation.psycopg2"
    ],
    "opentelemetry-instrumentation-pymongo": [
        "opentelemetry.instrumentation.pymongo"
    ],
    "opentelemetry-instrumentation-requests": [
        "opentelemetry.instrumentation.requests"
    ],
    "opentelemetry-sdk": ["opentelemetry.sdk"],
    "opentelemetry-test-utils": ["opentelemetry.test"],
    "paho-mqtt": ["paho"],
    "pillow": ["PIL"],
    "pillow-simd": ["PIL"],
    "pip-tools": ["piptools"],
    "progressbar2": ["progressbar"],
    "protobuf": ["google.protobuf"],
    "psycopg2-binary": ["psycopg2"],
    "py-lru-cache": ["lru"],
    "pycrypto": ["Crypto"],
    "pygithub": ["github"],
    "pygobject": ["gi", "pygtkcompat"],
    "pyhamcrest": ["hamcrest"],
    "pyicu": ["icu"],
    "pyjwt": ["jwt"],
    "pymongo": ["bson", "gridfs", "pymongo"],
    "pymupdf": ["fitz"],
    "pyopenssl": ["OpenSSL"],
    "pypdf2": ["PyPDF2"],
    "pypi-kenlm": ["kenlm"],
    "pyside": ["PySide", "pysideuic"],
    "pyside2": ["PySide2"],
    "pyside6": ["PySide6"],
    "pytest": ["pytest", "_pytest"],
    "pytest-runner": ["ptr"],
    "python-dateutil": ["dateutil"],
    "python-docx": ["docx"],
    "python-dotenv": ["dotenv"],
    "python-hcl2": ["hcl2"],
    "python-jose": ["jose"],
    "python-levenshtein": ["Levenshtein"],
    "python-lsp-jsonrpc": ["pylsp_jsonrpc"],
    "python-magic": ["magic"],
    "python-pptx": ["pptx"],
    "python-socketio": ["socketio"],
    "pyturbojpeg": ["turbojpeg"],
    "pyyaml": ["yaml"],
    "scikit-fda": ["skfda"],
    "scikit-image": ["skimage"],
    "scikit-learn": ["sklearn"],
    "setuptools": ["pkg_resources", "setuptools"],
    "sorl-thumbnail": ["sorl"],
    "splunk-sdk": ["splunklib"],
    "streamlit-aggrid": ["st_aggrid"],
    "tensorboardx": ["tensorboardX"],
    "umap-learn": ["umap"],
    "xlwt-future": ["xlwt"],
}