code: def install_airflow_and_providers(
      airflow_constraints_mode: str,
      airflow_constraints_location: str,
      airflow_constraints_reference: str,
      airflow_extras: str,
      airflow_skip_constraints: bool,
      default_constraints_branch: str,
      github_actions: bool,
      github_repository: str,
      install_selected_providers: str,
      package_format: str,
      providers_constraints_mode: str,
      providers_constraints_location: str,
      providers_constraints_reference: str,
      providers_skip_constraints: bool,
      python_version: str,
      use_airflow_version: str,
      use_packages_from_dist: bool,
  ):
      console.print("[bright_blue]Installing Airflow and Providers")
      installation_spec = find_installation_spec(
          airflow_constraints_mode=airflow_constraints_mode,
          airflow_constraints_location=airflow_constraints_location,
          airflow_constraints_reference=airflow_constraints_reference,
          airflow_extras=airflow_extras,
          airflow_skip_constraints=airflow_skip_constraints,
          default_constraints_branch=default_constraints_branch,
          github_repository=github_repository,
          install_selected_providers=install_selected_providers,
          package_format=package_format,
          providers_constraints_mode=providers_constraints_mode,
          providers_constraints_location=providers_constraints_location,
          providers_constraints_reference=providers_constraints_reference,
          providers_skip_constraints=providers_skip_constraints,
          python_version=python_version,
          use_airflow_version=use_airflow_version,
          use_packages_from_dist=use_packages_from_dist,
      )
      if installation_spec.airflow_package:
          install_airflow_cmd = [
              "pip",
              "install",
              "--root-user-action",
              "ignore",
              installation_spec.airflow_package,
          ]
          console.print(
              f"\n[bright_blue]Installing airflow package: {installation_spec.airflow_package}"
          )
          if installation_spec.airflow_constraints_location:
              console.print(
                  f"[bright_blue]Use constraints: {installation_spec.airflow_constraints_location}"
              )
              install_airflow_cmd.extend(
                  [
                      "--constraint",
                      installation_spec.airflow_constraints_location,
                  ]
              )
          console.print()
          run_command(
              install_airflow_cmd,
              github_actions=github_actions,
              check=True,
          )
      if installation_spec.provider_packages:
          install_providers_cmd = [
              "pip",
              "install",
              "--root-user-action",
              "ignore",
          ]
          console.print("\n[bright_blue]Installing provider packages:")
          for provider_package in sorted(
              installation_spec.provider_packages
          ):
              console.print(f"  {provider_package}")
          console.print()
          for provider_package in installation_spec.provider_packages:
              install_providers_cmd.append(provider_package)
          if installation_spec.provider_constraints_location:
              console.print(
                  f"[bright_blue]with constraints: {installation_spec.provider_constraints_location}\n"
              )
              install_providers_cmd.extend(
                  [
                      "--constraint",
                      installation_spec.provider_constraints_location,
                  ]
              )
          console.print()
          run_command(
              install_providers_cmd,
              github_actions=github_actions,
              check=True,
          )
      console.print("[green]Done!")
  
file_path: airflow/scripts/in_container/install_airflow_and_providers.py
imports: from __future__ import annotations
  import re
  import sys
  from pathlib import Path
  from typing import NamedTuple
  from in_container_utils import click, console, run_command
label_desc: Use image node_id 9 for calling a global function with example usage: install_airflow_and_providers(airflow_constraints_mode, airflow_constraints_location, airflow_constraints_reference, airflow_extras, airflow_skip_constraints, default_constraints_branch, github_actions, github_repository, install_selected_providers, package_format, providers_constraints_mode, providers_constraints_location, providers_constraints_reference, providers_skip_constraints, python_version, use_airflow_version, use_packages_from_dist) without return types