code: def create_default_connections(session: Session = NEW_SESSION):
      """Create default Airflow connections."""
      from airflow.models.connection import Connection
  
      merge_conn(
          Connection(
              conn_id="airflow_db",
              conn_type="mysql",
              host="mysql",
              login="root",
              password="",
              schema="airflow",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="aws_default",
              conn_type="aws",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="azure_batch_default",
              conn_type="azure_batch",
              login="<ACCOUNT_NAME>",
              password="",
              extra="""{"account_url": "<ACCOUNT_URL>"}""",
          )
      )
      merge_conn(
          Connection(
              conn_id="azure_cosmos_default",
              conn_type="azure_cosmos",
              extra='{"database_name": "<DATABASE_NAME>", "collection_name": "<COLLECTION_NAME>" }',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="azure_data_explorer_default",
              conn_type="azure_data_explorer",
              host="https://<CLUSTER>.kusto.windows.net",
              extra="""{"auth_method": "<AAD_APP | AAD_APP_CERT | AAD_CREDS | AAD_DEVICE>",
                      "tenant": "<TENANT ID>", "certificate": "<APPLICATION PEM CERTIFICATE>",
                      "thumbprint": "<APPLICATION CERTIFICATE THUMBPRINT>"}""",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="azure_data_lake_default",
              conn_type="azure_data_lake",
              extra='{"tenant": "<TENANT>", "account_name": "<ACCOUNTNAME>" }',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="azure_default",
              conn_type="azure",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="cassandra_default",
              conn_type="cassandra",
              host="cassandra",
              port=9042,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="databricks_default",
              conn_type="databricks",
              host="localhost",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="dingding_default",
              conn_type="http",
              host="",
              password="",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="drill_default",
              conn_type="drill",
              host="localhost",
              port=8047,
              extra='{"dialect_driver": "drill+sadrill", "storage_plugin": "dfs"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="druid_broker_default",
              conn_type="druid",
              host="druid-broker",
              port=8082,
              extra='{"endpoint": "druid/v2/sql"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="druid_ingest_default",
              conn_type="druid",
              host="druid-overlord",
              port=8081,
              extra='{"endpoint": "druid/indexer/v1/task"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="elasticsearch_default",
              conn_type="elasticsearch",
              host="localhost",
              schema="http",
              port=9200,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="emr_default",
              conn_type="emr",
              extra="""
                  {   "Name": "default_job_flow_name",
                      "LogUri": "s3://my-emr-log-bucket/default_job_flow_location",
                      "ReleaseLabel": "emr-4.6.0",
                      "Instances": {
                          "Ec2KeyName": "mykey",
                          "Ec2SubnetId": "somesubnet",
                          "InstanceGroups": [
                              {
                                  "Name": "Master nodes",
                                  "Market": "ON_DEMAND",
                                  "InstanceRole": "MASTER",
                                  "InstanceType": "r3.2xlarge",
                                  "InstanceCount": 1
                              },
                              {
                                  "Name": "Core nodes",
                                  "Market": "ON_DEMAND",
                                  "InstanceRole": "CORE",
                                  "InstanceType": "r3.2xlarge",
                                  "InstanceCount": 1
                              }
                          ],
                          "TerminationProtected": false,
                          "KeepJobFlowAliveWhenNoSteps": false
                      },
                      "Applications":[
                          { "Name": "Spark" }
                      ],
                      "VisibleToAllUsers": true,
                      "JobFlowRole": "EMR_EC2_DefaultRole",
                      "ServiceRole": "EMR_DefaultRole",
                      "Tags": [
                          {
                              "Key": "app",
                              "Value": "analytics"
                          },
                          {
                              "Key": "environment",
                              "Value": "development"
                          }
                      ]
                  }
              """,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="facebook_default",
              conn_type="facebook_social",
              extra="""
                  {   "account_id": "<AD_ACCOUNT_ID>",
                      "app_id": "<FACEBOOK_APP_ID>",
                      "app_secret": "<FACEBOOK_APP_SECRET>",
                      "access_token": "<FACEBOOK_AD_ACCESS_TOKEN>"
                  }
              """,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="fs_default",
              conn_type="fs",
              extra='{"path": "/"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="ftp_default",
              conn_type="ftp",
              host="localhost",
              port=21,
              login="airflow",
              password="airflow",
              extra='{"key_file": "~/.ssh/id_rsa", "no_host_key_check": true}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="google_cloud_default",
              conn_type="google_cloud_platform",
              schema="default",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="hive_cli_default",
              conn_type="hive_cli",
              port=10000,
              host="localhost",
              extra='{"use_beeline": true, "auth": ""}',
              schema="default",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="hiveserver2_default",
              conn_type="hiveserver2",
              host="localhost",
              schema="default",
              port=10000,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="http_default",
              conn_type="http",
              host="https://www.httpbin.org/",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="impala_default",
              conn_type="impala",
              host="localhost",
              port=21050,
          )
      )
      merge_conn(
          Connection(
              conn_id="kafka_default",
              conn_type="kafka",
              extra=json.dumps({"bootstrap.servers": "broker:29092"}),
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="kubernetes_default",
              conn_type="kubernetes",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="kylin_default",
              conn_type="kylin",
              host="localhost",
              port=7070,
              login="ADMIN",
              password="KYLIN",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="leveldb_default",
              conn_type="leveldb",
              host="localhost",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="livy_default",
              conn_type="livy",
              host="livy",
              port=8998,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="local_mysql",
              conn_type="mysql",
              host="localhost",
              login="airflow",
              password="airflow",
              schema="airflow",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="metastore_default",
              conn_type="hive_metastore",
              host="localhost",
              extra='{"authMechanism": "PLAIN"}',
              port=9083,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="mongo_default",
              conn_type="mongo",
              host="mongo",
              port=27017,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="mssql_default",
              conn_type="mssql",
              host="localhost",
              port=1433,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="mysql_default",
              conn_type="mysql",
              login="root",
              schema="airflow",
              host="mysql",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="opsgenie_default",
              conn_type="http",
              host="",
              password="",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="oracle_default",
              conn_type="oracle",
              host="localhost",
              login="root",
              password="password",
              schema="schema",
              port=1521,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="oss_default",
              conn_type="oss",
              extra="""{
                  "auth_type": "AK",
                  "access_key_id": "<ACCESS_KEY_ID>",
                  "access_key_secret": "<ACCESS_KEY_SECRET>",
                  "region": "<YOUR_OSS_REGION>"}
                  """,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="pig_cli_default",
              conn_type="pig_cli",
              schema="default",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="pinot_admin_default",
              conn_type="pinot",
              host="localhost",
              port=9000,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="pinot_broker_default",
              conn_type="pinot",
              host="localhost",
              port=9000,
              extra='{"endpoint": "/query", "schema": "http"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="postgres_default",
              conn_type="postgres",
              login="postgres",
              password="airflow",
              schema="airflow",
              host="postgres",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="presto_default",
              conn_type="presto",
              host="localhost",
              schema="hive",
              port=3400,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="redis_default",
              conn_type="redis",
              host="redis",
              port=6379,
              extra='{"db": 0}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="redshift_default",
              conn_type="redshift",
              extra="""{
      "iam": true,
      "cluster_identifier": "<REDSHIFT_CLUSTER_IDENTIFIER>",
      "port": 5439,
      "profile": "default",
      "db_user": "awsuser",
      "database": "dev",
      "region": ""
  }""",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="salesforce_default",
              conn_type="salesforce",
              login="username",
              password="password",
              extra='{"security_token": "security_token"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="segment_default",
              conn_type="segment",
              extra='{"write_key": "my-segment-write-key"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="sftp_default",
              conn_type="sftp",
              host="localhost",
              port=22,
              login="airflow",
              extra='{"key_file": "~/.ssh/id_rsa", "no_host_key_check": true}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="spark_default",
              conn_type="spark",
              host="yarn",
              extra='{"queue": "root.default"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="sqlite_default",
              conn_type="sqlite",
              host=os.path.join(gettempdir(), "sqlite_default.db"),
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="ssh_default",
              conn_type="ssh",
              host="localhost",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="tableau_default",
              conn_type="tableau",
              host="https://tableau.server.url",
              login="user",
              password="password",
              extra='{"site_id": "my_site"}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="tabular_default",
              conn_type="tabular",
              host="https://api.tabulardata.io/ws/v1",
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="trino_default",
              conn_type="trino",
              host="localhost",
              schema="hive",
              port=3400,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="vertica_default",
              conn_type="vertica",
              host="localhost",
              port=5433,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="wasb_default",
              conn_type="wasb",
              extra='{"sas_token": null}',
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="webhdfs_default",
              conn_type="hdfs",
              host="localhost",
              port=50070,
          ),
          session,
      )
      merge_conn(
          Connection(
              conn_id="yandexcloud_default",
              conn_type="yandexcloud",
              schema="default",
          ),
          session,
      )
  
imports: from __future__ import annotations
  import contextlib
  import enum
  import json
  import logging
  import os
  import sys
  import time
  import warnings
  from dataclasses import dataclass
  from tempfile import gettempdir
  from typing import TYPE_CHECKING, Callable, Generator, Iterable
  from sqlalchemy import Table, and_, column, delete, exc, func, inspect, literal, or_, select, table, text, tuple_
  import airflow
  from airflow import settings
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.models import import_all_models
  from airflow.utils import helpers
  from airflow.utils.session import NEW_SESSION, create_session, provide_session
label_desc: Use image node_id 4 for calling a global function with example usage: create_default_connections(session) without return types