"""核心邏輯：把一堆沒用的東西全部 import 進來。"""

from __future__ import annotations

import importlib
import logging
import sys
import time
from types import SimpleNamespace

logger = logging.getLogger(__name__)

# PyPI 下載量前 1000 大的 packages
# 格式: (import_name, alias)
_PACKAGES = [
    ('boto3', 'boto3'),
    ('packaging', 'packaging'),
    ('urllib3', 'urllib3'),
    ('setuptools', 'setuptools'),
    ('certifi', 'certifi'),
    ('requests', 'requests'),
    ('typing_extensions', 'typing_extensions'),
    ('botocore', 'botocore'),
    ('idna', 'idna'),
    ('charset_normalizer', 'charset_normalizer'),
    ('aiobotocore', 'aiobotocore'),
    ('dateutil', 'dateutil'),
    ('six', 'six'),
    ('cryptography', 'cryptography'),
    ('grpc_status', 'grpc_status'),
    ('cffi', 'cffi'),
    ('numpy', 'np'),
    ('yaml', 'yaml'),
    ('s3transfer', 's3transfer'),
    ('pycparser', 'pycparser'),
    ('pluggy', 'pluggy'),
    ('pydantic', 'pydantic'),
    ('pygments', 'pygments'),
    ('s3fs', 's3fs'),
    ('fsspec', 'fsspec'),
    ('click', 'click'),
    ('google.protobuf', 'protobuf'),
    ('pandas', 'pd'),
    ('attrs', 'attrs'),
    ('pydantic_core', 'pydantic_core'),
    ('pytest', 'pytest'),
    ('anyio', 'anyio'),
    ('markupsafe', 'markupsafe'),
    ('h11', 'h11'),
    ('iniconfig', 'iniconfig'),
    ('platformdirs', 'platformdirs'),
    ('jmespath', 'jmespath'),
    ('annotated_types', 'annotated_types'),
    ('filelock', 'filelock'),
    ('jinja2', 'jinja2'),
    ('importlib_metadata', 'importlib_metadata'),
    ('pathspec', 'pathspec'),
    ('jwt', 'jwt'),
    ('rsa', 'rsa'),
    ('httpx', 'httpx'),
    ('zipp', 'zipp'),
    ('pytz', 'pytz'),
    ('httpcore', 'httpcore'),
    ('typing_inspection', 'typing_inspection'),
    ('pyasn1', 'pyasn1'),
    ('aiohttp', 'aiohttp'),
    ('dotenv', 'dotenv'),
    ('rich', 'rich'),
    ('multidict', 'multidict'),
    ('jsonschema', 'jsonschema'),
    ('google.auth', 'google_auth'),
    ('tzdata', 'tzdata'),
    ('yarl', 'yarl'),
    ('colorama', 'colorama'),
    ('tqdm', 'tqdm'),
    ('google.api_core', 'google_api_core'),
    ('grpc', 'grpc'),
    ('tomli', 'tomli'),
    ('frozenlist', 'frozenlist'),
    ('propcache', 'propcache'),
    ('googleapis_common_protos', 'googleapis_common_protos'),
    ('requests_oauthlib', 'requests_oauthlib'),
    ('rpds_py', 'rpds_py'),
    ('markdown_it', 'markdown_it'),
    ('referencing', 'referencing'),
    ('aiosignal', 'aiosignal'),
    ('wrapt', 'wrapt'),
    ('greenlet', 'greenlet'),
    ('PIL', 'pil'),
    ('pyasn1_modules', 'pyasn1_modules'),
    ('sqlalchemy', 'sa'),
    ('mdurl', 'mdurl'),
    ('scipy', 'scipy'),
    ('jsonschema_specifications', 'jsonschema_specifications'),
    ('pyarrow', 'pa'),
    ('trove_classifiers', 'trove_classifiers'),
    ('uvicorn', 'uvicorn'),
    ('aiohappyeyeballs', 'aiohappyeyeballs'),
    ('starlette', 'starlette'),
    ('oauthlib', 'oauthlib'),
    ('psutil', 'psutil'),
    ('pyparsing', 'pyparsing'),
    ('fastapi', 'fastapi'),
    ('google.genai', 'google_genai'),
    ('cachetools', 'cachetools'),
    ('opentelemetry_proto', 'opentelemetry_proto'),
    ('tenacity', 'tenacity'),
    ('et_xmlfile', 'et_xmlfile'),
    ('openpyxl', 'openpyxl'),
    ('grpc_tools', 'grpc_tools'),
    ('opentelemetry_semantic_conventions', 'opentelemetry_semantic_conventions'),
    ('tomlkit', 'tomlkit'),
    ('regex', 'regex'),
    ('opentelemetry_sdk', 'opentelemetry_sdk'),
    ('sniffio', 'sniffio'),
    ('websocket_client', 'websocket_client'),
    ('yandexcloud', 'yandexcloud'),
    ('soupsieve', 'soupsieve'),
    ('bs4', 'bs4'),
    ('distlib', 'distlib'),
    ('lxml', 'lxml'),
    ('opentelemetry_api', 'opentelemetry_api'),
    ('shellingham', 'shellingham'),
    ('more_itertools', 'more_itertools'),
    ('langchain', 'langchain'),
    ('hatchling', 'hatchling'),
    ('requests_toolbelt', 'requests_toolbelt'),
    ('exceptiongroup', 'exceptiongroup'),
    ('docutils', 'docutils'),
    ('opentelemetry_exporter_otlp_proto_grpc', 'opentelemetry_exporter_otlp_proto_grpc'),
    ('mypy_extensions', 'mypy_extensions'),
    ('annotated_doc', 'annotated_doc'),
    ('proto_plus', 'proto_plus'),
    ('websockets', 'websockets'),
    ('pyopenssl', 'pyopenssl'),
    ('google.cloud.storage', 'gcs'),
    ('werkzeug', 'werkzeug'),
    ('coverage', 'coverage'),
    ('opentelemetry_exporter_otlp_proto_http', 'opentelemetry_exporter_otlp_proto_http'),
    ('flask', 'flask'),
    ('pynacl', 'pynacl'),
    ('sortedcontainers', 'sortedcontainers'),
    ('psycopg2', 'psycopg2'),
    ('msgpack', 'msgpack'),
    ('typer', 'typer'),
    ('isodate', 'isodate'),
    ('pydantic_settings', 'pydantic_settings'),
    ('decorator', 'decorator'),
    ('openai', 'openai'),
    ('wcwidth', 'wcwidth'),
    ('networkx', 'nx'),
    ('poetry_core', 'poetry_core'),
    ('dnspython', 'dnspython'),
    ('huggingface_hub', 'hf_hub'),
    ('multipart', 'multipart'),
    ('opentelemetry_exporter_otlp_proto_common', 'opentelemetry_exporter_otlp_proto_common'),
    ('distro', 'distro'),
    ('azure_core', 'azure_core'),
    ('sklearn', 'sklearn'),
    ('redis', 'redis_'),
    ('joblib', 'joblib'),
    ('msal', 'msal'),
    ('ptyprocess', 'ptyprocess'),
    ('pexpect', 'pexpect'),
    ('azure.identity', 'azure_identity'),
    ('bcrypt', 'bcrypt'),
    ('snowflake.connector', 'snowflake_connector'),
    ('matplotlib', 'mpl'),
    ('gitpython', 'gitpython'),
    ('opentelemetry_exporter_otlp', 'opentelemetry_exporter_otlp'),
    ('keyring', 'keyring'),
    ('fonttools', 'fonttools'),
    ('google_cloud_core', 'google_cloud_core'),
    ('jiter', 'jiter'),
    ('ruamel.yaml', 'ruamel_yaml'),
    ('async_timeout', 'async_timeout'),
    ('threadpoolctl', 'threadpoolctl'),
    ('itsdangerous', 'itsdangerous'),
    ('tabulate', 'tabulate'),
    ('kiwisolver', 'kiwisolver'),
    ('textual', 'textual'),
    ('jaraco_classes', 'jaraco_classes'),
    ('secretstorage', 'secretstorage'),
    ('alembic', 'alembic'),
    ('asn1crypto', 'asn1crypto'),
    ('prompt_toolkit', 'prompt_toolkit'),
    ('jeepney', 'jeepney'),
    ('deprecated', 'deprecated'),
    ('smmap', 'smmap'),
    ('kubernetes', 'kubernetes'),
    ('google_crc32c', 'google_crc32c'),
    ('zstandard', 'zstandard'),
    ('chardet', 'chardet'),
    ('google_resumable_media', 'google_resumable_media'),
    ('gitdb', 'gitdb'),
    ('orjson', 'orjson'),
    ('pytest_cov', 'pytest_cov'),
    ('defusedxml', 'defusedxml'),
    ('opentelemetry_instrumentation', 'opentelemetry_instrumentation'),
    ('prometheus_client', 'prometheus_client'),
    ('blinker', 'blinker'),
    ('tzlocal', 'tzlocal'),
    ('editables', 'editables'),
    ('pyproject_hooks', 'pyproject_hooks'),
    ('rapidfuzz', 'rapidfuzz'),
    ('jaraco_context', 'jaraco_context'),
    ('jaraco_functools', 'jaraco_functools'),
    ('contourpy', 'contourpy'),
    ('paramiko', 'paramiko'),
    ('backoff', 'backoff'),
    ('googleapiclient', 'googleapiclient'),
    ('build', 'build'),
    ('jsonpointer', 'jsonpointer'),
    ('pytest_asyncio', 'pytest_asyncio'),
    ('dill', 'dill'),
    ('google.cloud.bigquery', 'bq'),
    ('docker', 'docker'),
    ('cycler', 'cycler'),
    ('setuptools_scm', 'setuptools_scm'),
    ('google_cloud_aiplatform', 'google_cloud_aiplatform'),
    ('watchfiles', 'watchfiles'),
    ('fastjsonschema', 'fastjsonschema'),
    ('email_validator', 'email_validator'),
    ('cloudpickle', 'cloudpickle'),
    ('mako', 'mako'),
    ('msal_extensions', 'msal_extensions'),
    ('uritemplate', 'uritemplate'),
    ('google_auth_oauthlib', 'google_auth_oauthlib'),
    ('azure.storage.blob', 'azure_blob'),
    ('httplib2', 'httplib2'),
    ('google_auth_httplib2', 'google_auth_httplib2'),
    ('marshmallow', 'marshmallow'),
    ('transformers', 'transformers'),
    ('nodeenv', 'nodeenv'),
    ('tokenizers', 'tokenizers'),
    ('babel', 'babel'),
    ('sqlparse', 'sqlparse'),
    ('hf_xet', 'hf_xet'),
    ('sympy', 'sympy'),
    ('ipython', 'ipython'),
    ('docstring_parser', 'docstring_parser'),
    ('gcsfs', 'gcsfs'),
    ('aiofiles', 'aiofiles'),
    ('xmltodict', 'xmltodict'),
    ('uvloop', 'uvloop'),
    ('jsonpatch', 'jsonpatch'),
    ('toml', 'toml'),
    ('durationpy', 'durationpy'),
    ('identify', 'identify'),
    ('mpmath', 'mpmath'),
    ('traitlets', 'traitlets'),
    ('tornado', 'tornado'),
    ('parso', 'parso'),
    ('cfgv', 'cfgv'),
    ('cython', 'cython'),
    ('jedi', 'jedi'),
    ('gunicorn', 'gunicorn'),
    ('py4j', 'py4j'),
    ('google_cloud_secret_manager', 'google_cloud_secret_manager'),
    ('opentelemetry_util_http', 'opentelemetry_util_http'),
    ('importlib_resources', 'importlib_resources'),
    ('pythonjsonlogger', 'pythonjsonlogger'),
    ('opensearch_py', 'opensearch_py'),
    ('executing', 'executing'),
    ('opentelemetry_instrumentation_requests', 'opentelemetry_instrumentation_requests'),
    ('tiktoken', 'tiktoken'),
    ('matplotlib_inline', 'matplotlib_inline'),
    ('httptools', 'httptools'),
    ('asttokens', 'asttokens'),
    ('asgiref', 'asgiref'),
    ('mcp', 'mcp'),
    ('nest_asyncio', 'nest_asyncio'),
    ('langchain_core', 'langchain_core'),
    ('sentry_sdk', 'sentry_sdk'),
    ('grpc_google_iam_v1', 'grpc_google_iam_v1'),
    ('requests_aws4auth', 'requests_aws4auth'),
    ('markdown', 'markdown'),
    ('webencodings', 'webencodings'),
    ('httpx_sse', 'httpx_sse'),
    ('dbt_core', 'dbt_core'),
    ('stack_data', 'stack_data'),
    ('sse_starlette', 'sse_starlette'),
    ('pure_eval', 'pure_eval'),
    ('cachecontrol', 'cachecontrol'),
    ('grpcio_health_checking', 'grpcio_health_checking'),
    ('opentelemetry_exporter_prometheus', 'opentelemetry_exporter_prometheus'),
    ('google_cloud_batch', 'google_cloud_batch'),
    ('pytest_xdist', 'pytest_xdist'),
    ('aliyun_python_sdk_core', 'aliyun_python_sdk_core'),
    ('pymongo', 'pymongo'),
    ('execnet', 'execnet'),
    ('awswrangler', 'awswrangler'),
    ('ply', 'ply'),
    ('typing_inspect', 'typing_inspect'),
    ('databricks.sdk', 'databricks_sdk'),
    ('authlib', 'authlib'),
    ('debugpy', 'debugpy'),
    ('litellm', 'litellm'),
    ('google_analytics_admin', 'google_analytics_admin'),
    ('watchdog', 'watchdog'),
    ('termcolor', 'termcolor'),
    ('pymysql', 'pymysql'),
    ('aioitertools', 'aioitertools'),
    ('typedload', 'typedload'),
    ('pkginfo', 'pkginfo'),
    ('xxhash', 'xxhash'),
    ('dulwich', 'dulwich'),
    ('pyzmq', 'pyzmq'),
    ('mccabe', 'mccabe'),
    ('installer', 'installer'),
    ('dbt_adapters', 'dbt_adapters'),
    ('ruamel_yaml_clib', 'ruamel_yaml_clib'),
    ('typer_slim', 'typer_slim'),
    ('h2', 'h2'),
    ('hyperframe', 'hyperframe'),
    ('pytest_mock', 'pytest_mock'),
    ('hpack', 'hpack'),
    ('events', 'events'),
    ('torch', 'torch'),
    ('msrest', 'msrest'),
    ('pycryptodome', 'pycryptodome'),
    ('pandas_stubs', 'pandas_stubs'),
    ('jsonpath_ng', 'jsonpath_ng'),
    ('poetry', 'poetry'),
    ('dbt_common', 'dbt_common'),
    ('lz4', 'lz4'),
    ('dataclasses_json', 'dataclasses_json'),
    ('pycodestyle', 'pycodestyle'),
    ('slack_sdk', 'slack_sdk'),
    ('requests_file', 'requests_file'),
    ('langsmith', 'langsmith'),
    ('cattrs', 'cattrs'),
    ('crashtest', 'crashtest'),
    ('pendulum', 'pendulum'),
    ('croniter', 'croniter'),
    ('notebook', 'notebook'),
    ('jupyter_core', 'jupyter_core'),
    ('arrow', 'arrow_'),
    ('rfc3339_validator', 'rfc3339_validator'),
    ('argcomplete', 'argcomplete'),
    ('snowflake_sqlalchemy', 'snowflake_sqlalchemy'),
    ('deepdiff', 'deepdiff'),
    ('datadog', 'datadog'),
    ('multiprocess', 'multiprocess'),
    ('pygithub', 'pygithub'),
    ('cleo', 'cleo'),
    ('invoke', 'invoke'),
    ('ipykernel', 'ipykernel'),
    ('future', 'future'),
    ('semver', 'semver'),
    ('shapely', 'shapely'),
    ('wsproto', 'wsproto'),
    ('azure_common', 'azure_common'),
    ('tree_sitter', 'tree_sitter'),
    ('smart_open', 'smart_open'),
    ('tinycss2', 'tinycss2'),
    ('poetry_plugin_export', 'poetry_plugin_export'),
    ('jupyter_client', 'jupyter_client'),
    ('safetensors', 'safetensors'),
    ('databricks_sql_connector', 'databricks_sql_connector'),
    ('portalocker', 'portalocker'),
    ('comm', 'comm'),
    ('loguru', 'loguru'),
    ('mistune', 'mistune'),
    ('xlsxwriter', 'xlsxwriter'),
    ('sphinx', 'sphinx'),
    ('text_unidecode', 'text_unidecode'),
    ('py', 'py'),
    ('narwhals', 'narwhals'),
    ('pysocks', 'pysocks'),
    ('simplejson', 'simplejson'),
    ('bleach', 'bleach'),
    ('structlog', 'structlog'),
    ('backports_tarfile', 'backports_tarfile'),
    ('scramp', 'scramp'),
    ('lark', 'lark'),
    ('jsonschema_path', 'jsonschema_path'),
    ('slugify', 'slugify'),
    ('datasets', 'datasets'),
    ('google_cloud_monitoring', 'google_cloud_monitoring'),
    ('numba', 'numba'),
    ('graphql_core', 'graphql_core'),
    ('anthropic', 'anthropic'),
    ('librt', 'librt'),
    ('rich_toolkit', 'rich_toolkit'),
    ('google_cloud_vision', 'google_cloud_vision'),
    ('typeguard', 'typeguard'),
    ('opensearch_protobufs', 'opensearch_protobufs'),
    ('google_cloud_speech', 'google_cloud_speech'),
    ('google_cloud_kms', 'google_cloud_kms'),
    ('faker', 'faker'),
    ('google_cloud_resource_manager', 'google_cloud_resource_manager'),
    ('nbformat', 'nbformat'),
    ('toolz', 'toolz'),
    ('google_cloud_compute', 'google_cloud_compute'),
    ('ray', 'ray'),
    ('google_cloud_tasks', 'google_cloud_tasks'),
    ('pytokens', 'pytokens'),
    ('google_cloud_dlp', 'google_cloud_dlp'),
    ('google_cloud_bigtable', 'google_cloud_bigtable'),
    ('pbs_installer', 'pbs_installer'),
    ('pyflakes', 'pyflakes'),
    ('google_cloud_logging', 'google_cloud_logging'),
    ('brotli', 'brotli'),
    ('nbconvert', 'nbconvert'),
    ('zope_interface', 'zope_interface'),
    ('google_cloud_videointelligence', 'google_cloud_videointelligence'),
    ('google_cloud_language', 'google_cloud_language'),
    ('argon2_cffi', 'argon2_cffi'),
    ('argon2_cffi_bindings', 'argon2_cffi_bindings'),
    ('xlrd', 'xlrd'),
    ('redshift_connector', 'redshift_connector'),
    ('google_cloud_workflows', 'google_cloud_workflows'),
    ('nltk', 'nltk'),
    ('deprecation', 'deprecation'),
    ('google_cloud_os_login', 'google_cloud_os_login'),
    ('elasticsearch', 'elasticsearch'),
    ('google_cloud_dataform', 'google_cloud_dataform'),
    ('sqlalchemy_bigquery', 'sqlalchemy_bigquery'),
    ('pyspark', 'pyspark'),
    ('selenium', 'selenium'),
    ('colorlog', 'colorlog'),
    ('inflection', 'inflection'),
    ('responses', 'responses'),
    ('pathable', 'pathable'),
    ('google_cloud_redis', 'google_cloud_redis'),
    ('llvmlite', 'llvmlite'),
    ('ipython_pygments_lexers', 'ipython_pygments_lexers'),
    ('langchain_openai', 'langchain_openai'),
    ('nbclient', 'nbclient'),
    ('tree_sitter_languages', 'tree_sitter_languages'),
    ('pycryptodomex', 'pycryptodomex'),
    ('confluent_kafka', 'confluent_kafka'),
    ('asyncpg', 'asyncpg'),
    ('pyperclip', 'pyperclip'),
    ('plotly', 'plotly'),
    ('json5', 'json5'),
    ('google_cloud_memcache', 'google_cloud_memcache'),
    ('flatbuffers', 'flatbuffers'),
    ('findpython', 'findpython'),
    ('astroid', 'astroid'),
    ('humanfriendly', 'humanfriendly'),
    ('async_lru', 'async_lru'),
    ('jupyterlab', 'jupyterlab'),
    ('google_ads', 'google_ads'),
    ('trio', 'trio'),
    ('jupyter_server', 'jupyter_server'),
    ('humanize', 'humanize'),
    ('beartype', 'beartype'),
    ('mypy_boto3_s3', 'mypy_boto3_s3'),
    ('mysql.connector', 'mysql_connector'),
    ('pandocfilters', 'pandocfilters'),
    ('jupyterlab_pygments', 'jupyterlab_pygments'),
    ('altair', 'altair'),
    ('google.cloud.pubsub_v1', 'pubsub'),
    ('overrides', 'overrides'),
    ('aenum', 'aenum'),
    ('opentelemetry_instrumentation_fastapi', 'opentelemetry_instrumentation_fastapi'),
    ('google_cloud_appengine_logging', 'google_cloud_appengine_logging'),
    ('kombu', 'kombu'),
    ('outcome', 'outcome'),
    ('psycopg2', 'psycopg2_'),
    ('azure_keyvault_secrets', 'azure_keyvault_secrets'),
    ('pg8000', 'pg8000'),
    ('jsonref', 'jsonref'),
    ('cv2', 'cv2'),
    ('pyee', 'pyee'),
    ('webcolors', 'webcolors'),
    ('click_plugins', 'click_plugins'),
    ('psycopg', 'psycopg'),
    ('ecdsa', 'ecdsa'),
    ('orderly_set', 'orderly_set'),
    ('flask_cors', 'flask_cors'),
    ('polars', 'pl'),
    ('celery', 'celery'),
    ('absl_py', 'absl_py'),
    ('jupyterlab_server', 'jupyterlab_server'),
    ('send2trash', 'send2trash'),
    ('cyclopts', 'cyclopts'),
    ('opentelemetry_instrumentation_asgi', 'opentelemetry_instrumentation_asgi'),
    ('semgrep', 'semgrep'),
    ('uuid_utils', 'uuid_utils'),
    ('fqdn', 'fqdn'),
    ('aws_sam_translator', 'aws_sam_translator'),
    ('isoduration', 'isoduration'),
    ('uri_template', 'uri_template'),
    ('pymssql', 'pymssql'),
    ('pyrsistent', 'pyrsistent'),
    ('apache_beam', 'apache_beam'),
    ('pytest_timeout', 'pytest_timeout'),
    ('mmh3', 'mmh3'),
    ('sqlglot', 'sqlglot'),
    ('seaborn', 'sns'),
    ('prettytable', 'prettytable'),
    ('fastmcp', 'fastmcp'),
    ('diskcache', 'diskcache'),
    ('db_dtypes', 'db_dtypes'),
    ('rfc3986_validator', 'rfc3986_validator'),
    ('antlr4_python3_runtime', 'antlr4_python3_runtime'),
    ('widgetsnbextension', 'widgetsnbextension'),
    ('langchain_community', 'langchain_community'),
    ('pymupdf', 'pymupdf'),
    ('jupyterlab_widgets', 'jupyterlab_widgets'),
    ('freezegun', 'freezegun'),
    ('ipywidgets', 'ipywidgets'),
    ('xgboost', 'xgb'),
    ('langgraph', 'langgraph'),
    ('langchain_text_splitters', 'langchain_text_splitters'),
    ('cfn_lint', 'cfn_lint'),
    ('click_didyoumean', 'click_didyoumean'),
    ('billiard', 'billiard'),
    ('gevent', 'gevent'),
    ('appdirs', 'appdirs'),
    ('ijson', 'ijson'),
    ('terminado', 'terminado'),
    ('django', 'django'),
    ('azure_storage_file_datalake', 'azure_storage_file_datalake'),
    ('playwright', 'playwright'),
    ('adal', 'adal'),
    ('jupyter_server_terminals', 'jupyter_server_terminals'),
    ('amqp', 'amqp'),
    ('vine', 'vine'),
    ('thrift', 'thrift'),
    ('lazy_object_proxy', 'lazy_object_proxy'),
    ('oauth2client', 'oauth2client'),
    ('mdit_py_plugins', 'mdit_py_plugins'),
    ('azure_mgmt_core', 'azure_mgmt_core'),
    ('jupyter_events', 'jupyter_events'),
    ('trio_websocket', 'trio_websocket'),
    ('google_cloud_audit_log', 'google_cloud_audit_log'),
    ('psycopg_binary', 'psycopg_binary'),
    ('zeep', 'zeep'),
    ('click_repl', 'click_repl'),
    ('aiosqlite', 'aiosqlite'),
    ('fastavro', 'fastavro'),
    ('notebook_shim', 'notebook_shim'),
    ('onnxruntime', 'onnxruntime'),
    ('pypdf', 'pypdf'),
    ('setproctitle', 'setproctitle'),
    ('retry', 'retry'),
    ('pyodbc', 'pyodbc'),
    ('rich_rst', 'rich_rst'),
    ('coloredlogs', 'coloredlogs'),
    ('ordered_set', 'ordered_set'),
    ('fakeredis', 'fakeredis'),
    ('delta_spark', 'delta_spark'),
    ('mlflow', 'mlflow'),
    ('gspread', 'gspread'),
    ('apache_airflow_providers_common_sql', 'apache_airflow_providers_common_sql'),
    ('google_cloud_run', 'google_cloud_run'),
    ('mashumaro', 'mashumaro'),
    ('google_cloud_texttospeech', 'google_cloud_texttospeech'),
    ('google_cloud_bigquery_datatransfer', 'google_cloud_bigquery_datatransfer'),
    ('semantic_version', 'semantic_version'),
    ('jupyter_lsp', 'jupyter_lsp'),
    ('google_cloud_orchestration_airflow', 'google_cloud_orchestration_airflow'),
    ('python_jose', 'python_jose'),
    ('google_cloud_dataproc_metastore', 'google_cloud_dataproc_metastore'),
    ('imageio', 'imageio'),
    ('dateparser', 'dateparser'),
    ('tldextract', 'tldextract'),
    ('purecloudplatformclientv2', 'purecloudplatformclientv2'),
    ('azure_storage_queue', 'azure_storage_queue'),
    ('langgraph_prebuilt', 'langgraph_prebuilt'),
    ('ddtrace', 'ddtrace'),
    ('rich_click', 'rich_click'),
    ('h5py', 'h5py'),
    ('inspect_ai', 'inspect_ai'),
    ('snowflake_snowpark_python', 'snowflake_snowpark_python'),
    ('python_docx', 'python_docx'),
    ('google_cloud_bigquery_storage', 'google_cloud_bigquery_storage'),
    ('google_cloud_automl', 'google_cloud_automl'),
    ('mlflow_skinny', 'mlflow_skinny'),
    ('rfc3986', 'rfc3986'),
    ('py_key_value_aio', 'py_key_value_aio'),
    ('universal_pathlib', 'universal_pathlib'),
    ('llama_parse', 'llama_parse'),
    ('ormsgpack', 'ormsgpack'),
    ('omegaconf', 'omegaconf'),
    ('sshtunnel', 'sshtunnel'),
    ('dbt_protos', 'dbt_protos'),
    ('moto', 'moto'),
    ('google_cloud_dataflow_client', 'google_cloud_dataflow_client'),
    ('oss2', 'oss2'),
    ('pandas_gbq', 'pandas_gbq'),
    ('nh3', 'nh3'),
    ('junitparser', 'junitparser'),
    ('streamlit', 'st'),
    ('aioboto3', 'aioboto3'),
    ('cv2', 'cv2_headless'),
    ('gcloud_aio_storage', 'gcloud_aio_storage'),
    ('dask', 'dask'),
    ('rfc3987_syntax', 'rfc3987_syntax'),
    ('sendgrid', 'sendgrid'),
    ('langgraph_sdk', 'langgraph_sdk'),
    ('retrying', 'retrying'),
    ('sentencepiece', 'sentencepiece'),
    ('checkov', 'checkov'),
    ('graphql_relay', 'graphql_relay'),
    ('mergedeep', 'mergedeep'),
    ('langgraph_checkpoint', 'langgraph_checkpoint'),
    ('graphviz', 'graphviz'),
    ('pycountry', 'pycountry'),
    ('llama_cloud_services', 'llama_cloud_services'),
    ('google_pasta', 'google_pasta'),
    ('linkify_it_py', 'linkify_it_py'),
    ('libcst', 'libcst'),
    ('ujson', 'ujson'),
    ('fastapi_cli', 'fastapi_cli'),
    ('graphene', 'graphene'),
    ('snowballstemmer', 'snowballstemmer'),
    ('statsmodels', 'statsmodels'),
    ('tomli_w', 'tomli_w'),
    ('uc_micro_py', 'uc_micro_py'),
    ('bytecode', 'bytecode'),
    ('html5lib', 'html5lib'),
    ('msgspec', 'msgspec'),
    ('pdfminer_six', 'pdfminer_six'),
    ('torchvision', 'torchvision'),
    ('tensorboard', 'tensorboard'),
    ('mock', 'mock'),
    ('duckdb', 'duckdb'),
    ('entrypoints', 'entrypoints'),
    ('envier', 'envier'),
    ('tox', 'tox'),
    ('opentelemetry_instrumentation_threading', 'opentelemetry_instrumentation_threading'),
    ('elastic_transport', 'elastic_transport'),
    ('zope_event', 'zope_event'),
    ('pytest_runner', 'pytest_runner'),
    ('tableauserverclient', 'tableauserverclient'),
    ('agate', 'agate'),
    ('pytest_rerunfailures', 'pytest_rerunfailures'),
    ('unidecode', 'unidecode'),
    ('patsy', 'patsy'),
    ('ml_dtypes', 'ml_dtypes'),
    ('pbr', 'pbr'),
    ('simple_salesforce', 'simple_salesforce'),
    ('pytimeparse', 'pytimeparse'),
    ('openapi_spec_validator', 'openapi_spec_validator'),
    ('google_cloud_dataproc', 'google_cloud_dataproc'),
    ('great_expectations', 'great_expectations'),
    ('pydantic_extra_types', 'pydantic_extra_types'),
    ('tooth_python', 'tooth_python'),
    ('opentelemetry_instrumentation_urllib3', 'opentelemetry_instrumentation_urllib3'),
    ('pytest_metadata', 'pytest_metadata'),
    ('openapi_pydantic', 'openapi_pydantic'),
    ('fastuuid', 'fastuuid'),
    ('telegram', 'telegram'),
    ('tblib', 'tblib'),
    ('pydata_google_auth', 'pydata_google_auth'),
    ('readme_renderer', 'readme_renderer'),
    ('cramjam', 'cramjam'),
    ('griffe', 'griffe'),
    ('google_cloud_firestore', 'google_cloud_firestore'),
    ('parsedatetime', 'parsedatetime'),
    ('passlib', 'passlib'),
    ('backports_zstd', 'backports_zstd'),
    ('opentelemetry_instrumentation_wsgi', 'opentelemetry_instrumentation_wsgi'),
    ('inflect', 'inflect'),
    ('cuda_bindings', 'cuda_bindings'),
    ('validators', 'validators'),
    ('pydocket', 'pydocket'),
    ('lockfile', 'lockfile'),
    ('pyright', 'pyright'),
    ('schema', 'schema'),
    ('mypy_boto3_sts', 'mypy_boto3_sts'),
    ('ninja', 'ninja'),
    ('frozendict', 'frozendict'),
    ('google_cloud_spanner', 'google_cloud_spanner'),
    ('azure_cosmos', 'azure_cosmos'),
    ('apache_airflow_providers_fab', 'apache_airflow_providers_fab'),
    ('pathvalidate', 'pathvalidate'),
    ('opentelemetry_instrumentation_dbapi', 'opentelemetry_instrumentation_dbapi'),
    ('yamllint', 'yamllint'),
    ('pytest_json_ctrf', 'pytest_json_ctrf'),
    ('hvac', 'hvac'),
    ('phonenumbers', 'phonenumbers'),
    ('cuda_pathfinder', 'cuda_pathfinder'),
    ('imagesize', 'imagesize'),
    ('opentelemetry_instrumentation_urllib', 'opentelemetry_instrumentation_urllib'),
    ('msrestazure', 'msrestazure'),
    ('sphinxcontrib_serializinghtml', 'sphinxcontrib_serializinghtml'),
    ('langchain_google_vertexai', 'langchain_google_vertexai'),
    ('pipenv', 'pipenv'),
    ('peewee', 'peewee'),
    ('opentelemetry_instrumentation_django', 'opentelemetry_instrumentation_django'),
    ('alabaster', 'alabaster'),
    ('apscheduler', 'apscheduler'),
    ('holidays', 'holidays'),
    ('lupa', 'lupa'),
    ('weaviate_client', 'weaviate_client'),
    ('twine', 'twine'),
    ('pypdf2', 'pypdf2'),
    ('pytzdata', 'pytzdata'),
    ('reportlab', 'reportlab'),
    ('azure_datalake_store', 'azure_datalake_store'),
    ('progressbar2', 'progressbar2'),
    ('opentelemetry_instrumentation_flask', 'opentelemetry_instrumentation_flask'),
    ('databricks_sqlalchemy', 'databricks_sqlalchemy'),
    ('mysqlclient', 'mysqlclient'),
    ('pyiceberg', 'pyiceberg'),
    ('dbt_semantic_interfaces', 'dbt_semantic_interfaces'),
    ('bracex', 'bracex'),
    ('sqlalchemy_utils', 'sqlalchemy_utils'),
    ('bs4', 'bs4_'),
    ('asyncio', 'asyncio'),
    ('python_http_client', 'python_http_client'),
    ('pybind11', 'pybind11'),
    ('opentelemetry_instrumentation_psycopg2', 'opentelemetry_instrumentation_psycopg2'),
    ('scikit_image', 'scikit_image'),
    ('posthog', 'posthog'),
    ('azure_monitor_opentelemetry_exporter', 'azure_monitor_opentelemetry_exporter'),
    ('python_magic', 'python_magic'),
    ('leather', 'leather'),
    ('dacite', 'dacite'),
    ('opentelemetry_instrumentation_httpx', 'opentelemetry_instrumentation_httpx'),
    ('openapi_schema_validator', 'openapi_schema_validator'),
    ('uv_build', 'uv_build'),
    ('flask_sqlalchemy', 'flask_sqlalchemy'),
    ('limits', 'limits'),
    ('aws_requests_auth', 'aws_requests_auth'),
    ('cssselect', 'cssselect'),
    ('hypothesis', 'hypothesis'),
    ('filetype', 'filetype'),
    ('mypy_boto3_iam', 'mypy_boto3_iam'),
    ('sphinxcontrib_htmlhelp', 'sphinxcontrib_htmlhelp'),
    ('sphinxcontrib_qthelp', 'sphinxcontrib_qthelp'),
    ('pip_tools', 'pip_tools'),
    ('sphinxcontrib_applehelp', 'sphinxcontrib_applehelp'),
    ('dbt_extractor', 'dbt_extractor'),
    ('sphinxcontrib_devhelp', 'sphinxcontrib_devhelp'),
    ('sagemaker', 'sagemaker'),
    ('azure_batch', 'azure_batch'),
    ('pyroaring', 'pyroaring'),
    ('ua_parser', 'ua_parser'),
    ('python_utils', 'python_utils'),
    ('pypdfium2', 'pypdfium2'),
    ('sphinxcontrib_jsmath', 'sphinxcontrib_jsmath'),
    ('wcmatch', 'wcmatch'),
    ('stevedore', 'stevedore'),
    ('gremlinpython', 'gremlinpython'),
    ('pkgutil_resolve_name', 'pkgutil_resolve_name'),
    ('gcloud_aio_auth', 'gcloud_aio_auth'),
    ('id', 'id'),
    ('cbor2', 'cbor2'),
    ('astronomer_cosmos', 'astronomer_cosmos'),
    ('stripe', 'stripe'),
    ('cssselect2', 'cssselect2'),
    ('jira', 'jira'),
    ('oscrypto', 'oscrypto'),
    ('texttable', 'texttable'),
    ('tensorflow', 'tf'),
    ('bitarray', 'bitarray'),
    ('lazy_loader', 'lazy_loader'),
    ('requests_mock', 'requests_mock'),
    ('azure_mgmt_resource', 'azure_mgmt_resource'),
    ('grpc_interceptor', 'grpc_interceptor'),
    ('gcloud_aio_bigquery', 'gcloud_aio_bigquery'),
    ('apache_airflow_providers_cncf_kubernetes', 'apache_airflow_providers_cncf_kubernetes'),
    ('wandb', 'wandb'),
    ('sagemaker_studio', 'sagemaker_studio'),
    ('mypy_boto3_batch', 'mypy_boto3_batch'),
    ('flit_core', 'flit_core'),
    ('aiohttp_retry', 'aiohttp_retry'),
    ('pymdown_extensions', 'pymdown_extensions'),
    ('kafka', 'kafka'),
    ('hyperlink', 'hyperlink'),
    ('flask_limiter', 'flask_limiter'),
    ('pymilvus', 'pymilvus'),
    ('opt_einsum', 'opt_einsum'),
    ('click_option_group', 'click_option_group'),
    ('apache_airflow_providers_databricks', 'apache_airflow_providers_databricks'),
    ('flask_login', 'flask_login'),
    ('pyproj', 'pyproj'),
    ('opencensus', 'opencensus'),
    ('accelerate', 'accelerate'),
    ('kubernetes_asyncio', 'kubernetes_asyncio'),
    ('tensorboard_data_server', 'tensorboard_data_server'),
    ('py_cpuinfo', 'py_cpuinfo'),
    ('datadog_api_client', 'datadog_api_client'),
    ('jsonpickle', 'jsonpickle'),
    ('djangorestframework', 'djangorestframework'),
    ('cached_property', 'cached_property'),
    ('markdownify', 'markdownify'),
    ('pathlib_abc', 'pathlib_abc'),
    ('youtube_transcript_api', 'youtube_transcript_api'),
    ('argparse', 'argparse'),
    ('opencensus_context', 'opencensus_context'),
    ('oracledb', 'oracledb'),
    ('userpath', 'userpath'),
    ('sentence_transformers', 'sentence_transformers'),
    ('apache_airflow_providers_snowflake', 'apache_airflow_providers_snowflake'),
    ('pydeck', 'pydeck'),
    ('google_cloud_translate', 'google_cloud_translate'),
    ('levenshtein', 'levenshtein'),
    ('snowplow_tracker', 'snowplow_tracker'),
    ('gast', 'gast'),
    ('pathos', 'pathos'),
    ('daff', 'daff'),
    ('temporalio', 'temporalio'),
    ('aws_lambda_powertools', 'aws_lambda_powertools'),
    ('pytest_html', 'pytest_html'),
    ('azure_servicebus', 'azure_servicebus'),
    ('joserfc', 'joserfc'),
    ('aws_xray_sdk', 'aws_xray_sdk'),
    ('einops', 'einops'),
    ('jpype1', 'jpype1'),
    ('looker_sdk', 'looker_sdk'),
    ('bidict', 'bidict'),
    ('time_machine', 'time_machine'),
    ('py_key_value_shared', 'py_key_value_shared'),
    ('pyexasol', 'pyexasol'),
    ('singer_sdk', 'singer_sdk'),
    ('spacy', 'spacy'),
    ('pdfplumber', 'pdfplumber'),
    ('fasteners', 'fasteners'),
    ('deltalake', 'deltalake'),
    ('murmurhash', 'murmurhash'),
    ('smdebug_rulesconfig', 'smdebug_rulesconfig'),
    ('statsd', 'statsd'),
    ('partd', 'partd'),
    ('databricks_labs_blueprint', 'databricks_labs_blueprint'),
    ('strictyaml', 'strictyaml'),
    ('locket', 'locket'),
    ('google_cloud_container', 'google_cloud_container'),
    ('cron_descriptor', 'cron_descriptor'),
    ('natsort', 'natsort'),
    ('pox', 'pox'),
    ('google_cloud_datacatalog', 'google_cloud_datacatalog'),
    ('opentelemetry_instrumentation_logging', 'opentelemetry_instrumentation_logging'),
    ('ppft', 'ppft'),
    ('jax', 'jax'),
    ('apache_airflow', 'apache_airflow'),
    ('pinecone', 'pinecone'),
    ('eval_type_backport', 'eval_type_backport'),
    ('python_pptx', 'python_pptx'),
    ('grpclib', 'grpclib'),
    ('pyotp', 'pyotp'),
    ('google_cloud_build', 'google_cloud_build'),
    ('python_gitlab', 'python_gitlab'),
    ('parse', 'parse'),
    ('cymbal', 'cymbal'),
    ('ua_parser_builtins', 'ua_parser_builtins'),
    ('blis', 'blis'),
    ('emoji', 'emoji_'),
    ('jwcrypto', 'jwcrypto'),
    ('tifffile', 'tifffile'),
    ('catalogue', 'catalogue'),
    ('cloudpathlib', 'cloudpathlib'),
    ('google_cloud_dataplex', 'google_cloud_dataplex'),
    ('azure_mgmt_storage', 'azure_mgmt_storage'),
    ('preshed', 'preshed'),
    ('curl_cffi', 'curl_cffi'),
    ('sqlalchemy_spanner', 'sqlalchemy_spanner'),
    ('keyrings_google_artifactregistry_auth', 'keyrings_google_artifactregistry_auth'),
    ('gql', 'gql'),
    ('google_cloud_storage_transfer', 'google_cloud_storage_transfer'),
    ('pytest_env', 'pytest_env'),
    ('ydb', 'ydb'),
    ('maxminddb', 'maxminddb'),
    ('srsly', 'srsly'),
    ('thinc', 'thinc'),
    ('sh', 'sh'),
    ('pyspnego', 'pyspnego'),
    ('simpleeval', 'simpleeval'),
    ('opentelemetry_distro', 'opentelemetry_distro'),
    ('strenum', 'strenum'),
    ('pydantic_ai_slim', 'pydantic_ai_slim'),
    ('wasabi', 'wasabi'),
    ('watchtower', 'watchtower'),
    ('keras', 'keras'),
    ('fastapi_cloud_cli', 'fastapi_cloud_cli'),
    ('python_daemon', 'python_daemon'),
    ('pybase64', 'pybase64'),
    ('azure_storage_file_share', 'azure_storage_file_share'),
    ('pyathena', 'pyathena'),
    ('makefun', 'makefun'),
    ('pickleshare', 'pickleshare'),
    ('factory_boy', 'factory_boy'),
    ('azure_mgmt_containerservice', 'azure_mgmt_containerservice'),
    ('pydub', 'pydub'),
    ('pyproject_api', 'pyproject_api'),
    ('spacy_legacy', 'spacy_legacy'),
    ('torchaudio', 'torchaudio'),
    ('tritonclient', 'tritonclient'),
    ('python_socketio', 'python_socketio'),
    ('google_generativeai', 'google_generativeai'),
    ('python_engineio', 'python_engineio'),
    ('spacy_loggers', 'spacy_loggers'),
    ('fastparquet', 'fastparquet'),
    ('docopt', 'docopt'),
    ('backcall', 'backcall'),
    ('parameterized', 'parameterized'),
    ('ty', 'ty'),
    ('amazon_ion', 'amazon_ion'),
    ('clickhouse_connect', 'clickhouse_connect'),
    ('rich_argparse', 'rich_argparse'),
    ('pydot', 'pydot'),
    ('fuzzywuzzy', 'fuzzywuzzy'),
    ('python_gnupg', 'python_gnupg'),
    ('fire', 'fire'),
    ('immutabledict', 'immutabledict'),
    ('apache_airflow_providers_common_compat', 'apache_airflow_providers_common_compat'),
    ('hiredis', 'hiredis'),
    ('grpcio_gcp', 'grpcio_gcp'),
    ('simple_websocket', 'simple_websocket'),
    ('geopandas', 'geopandas'),
    ('xarray', 'xarray'),
    ('azure_keyvault_keys', 'azure_keyvault_keys'),
    ('bandit', 'bandit'),
    ('python_discovery', 'python_discovery'),
    ('unidiff', 'unidiff'),
    ('cmake', 'cmake'),
    ('apache_airflow_providers_mysql', 'apache_airflow_providers_mysql'),
    ('rignore', 'rignore'),
    ('jupyter_console', 'jupyter_console'),
    ('jupyter', 'jupyter'),
    ('apache_airflow_providers_ssh', 'apache_airflow_providers_ssh'),
    ('soundfile', 'soundfile'),
    ('mkdocs_material', 'mkdocs_material'),
    ('confection', 'confection'),
    ('boltons', 'boltons'),
    ('django_cors_headers', 'django_cors_headers'),
    ('geoip2', 'geoip2'),
    ('resolvelib', 'resolvelib'),
    ('wtforms', 'wtforms'),
    ('pinecone_plugin_assistant', 'pinecone_plugin_assistant'),
    ('pgvector', 'pgvector'),
    ('pydeequ', 'pydeequ'),
    ('py_spy', 'py_spy'),
    ('cohere', 'cohere'),
    ('apache_airflow_providers_http', 'apache_airflow_providers_http'),
    ('twilio', 'twilio'),
    ('mkdocs', 'mkdocs'),
    ('segment_analytics_python', 'segment_analytics_python'),
    ('databricks_cli', 'databricks_cli'),
    ('apache_airflow_providers_google', 'apache_airflow_providers_google'),
    ('google_ai_generativelanguage', 'google_ai_generativelanguage'),
    ('jaydebeapi', 'jaydebeapi'),
    ('av', 'av'),
    ('async_generator', 'async_generator'),
    ('onnx', 'onnx'),
    ('flask_wtf', 'flask_wtf'),
    ('pynvml', 'pynvml'),
    ('astunparse', 'astunparse'),
    ('ghp_import', 'ghp_import'),
    ('pydantic_graph', 'pydantic_graph'),
    ('diff_cover', 'diff_cover'),
    ('pyyaml_env_tag', 'pyyaml_env_tag'),
    ('avro', 'avro'),
    ('caio', 'caio'),
    ('azure_kusto_data', 'azure_kusto_data'),
    ('aiofile', 'aiofile'),
    ('configargparse', 'configargparse'),
    ('psycopg_pool', 'psycopg_pool'),
    ('pinotdb', 'pinotdb'),
    ('nexus_rpc', 'nexus_rpc'),
    ('pyphen', 'pyphen'),
    ('realtime', 'realtime'),
    ('apispec', 'apispec'),
    ('azure_keyvault_certificates', 'azure_keyvault_certificates'),
    ('thrift_sasl', 'thrift_sasl'),
    ('geographiclib', 'geographiclib'),
    ('trino', 'trino'),
    ('questionary', 'questionary'),
    ('azure_mgmt_msi', 'azure_mgmt_msi'),
    ('crc32c', 'crc32c'),
    ('prek', 'prek'),
]


def import_everything(
    verbose: bool = True,
    yolo: bool = False,
) -> SimpleNamespace:
    '''把所有 dependency 都 import 進來，回傳一個 namespace。

    Args:
        verbose: 是否印出每個 import 的狀態（預設開啟，讓你看看你浪費了多少時間）
        yolo: 如果為 True，會直接把所有東西塞進 caller 的 global namespace

    Returns:
        一個 SimpleNamespace，裡面塞滿了你根本用不到的 module。
    '''
    ns = SimpleNamespace()
    success = 0
    failed = 0
    start = time.time()

    if verbose:
        print('\U0001f6bd 開始載入一堆沒用的東西...\n')

    for pkg_name, alias in _PACKAGES:
        try:
            mod = importlib.import_module(pkg_name)
            setattr(ns, alias, mod)
            success += 1
            if verbose:
                print(f'  \u2705 {pkg_name} -> {alias}')
        except ImportError:
            failed += 1
            if verbose:
                print(f'  \U0001f4a9 {pkg_name} -> 裝了但還是爛掉')
        except Exception as e:
            failed += 1
            if verbose:
                print(f'  \U0001f525 {pkg_name} -> {e}')

    elapsed = time.time() - start

    if verbose:
        print(f'\n{"=" * 50}')
        print(f'\U0001f389 成功 import 了 {success} 個沒用的 package')
        print(f'\U0001f480 有 {failed} 個爛掉了')
        print(f'\u23f1\ufe0f  總共浪費了你 {elapsed:.2f} 秒的生命')
        print(f'\U0001f4be 目前 sys.modules 裡有 {len(sys.modules)} 個 module')
        print(f'{"=" * 50}')
        print('\n用法: env.np, env.pd, env.plt, env.torch ...')
        print('恭喜你，你的記憶體已經被塞滿了。\n')

    if yolo:
        # 直接污染 caller 的 namespace，真正的 YOLO
        import inspect

        frame = inspect.stack()[1]
        caller_globals = frame[0].f_globals
        for attr in dir(ns):
            if not attr.startswith('_'):
                caller_globals[attr] = getattr(ns, attr)
        if verbose:
            print('\U0001f525 YOLO 模式：已污染你的 global namespace，祝你好運。')

    return ns
