code: def get_providers_constraints_location(
      default_constraints_branch: str,
      github_repository: str,
      providers_constraints_location: str | None,
      providers_constraints_mode: str,
      providers_constraints_reference: str | None,
      providers_skip_constraints: bool,
      python_version: str,
  ) -> str | None:
      """For providers we determine constraints in this order of preference:
      * PROVIDERS_SKIP_CONSTRAINTS=true - no constraints
      * PROVIDERS_CONSTRAINTS_LOCATION -  constraints from this location (url)
      * PROVIDERS_CONSTRAINTS_REFERENCE + constraints mode if specified
      * DEFAULT_CONSTRAINT_BRANCH + constraints mode
      * constraints-main + constraints mode - as fallback
      """
      if providers_skip_constraints:
          return None
      if providers_constraints_location:
          console.print(
              f"[info]Using constraints from location: {providers_constraints_location}"
          )
          return providers_constraints_location
      if not providers_constraints_reference:
          providers_constraints_reference = default_constraints_branch
      return calculate_constraints_location(
          constraints_mode=providers_constraints_mode,
          constraints_reference=providers_constraints_reference,
          python_version=python_version,
          github_repository=github_repository,
          providers=True,
      )
  
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 7 for calling a global function with example usage: get_providers_constraints_location(default_constraints_branch, github_repository, providers_constraints_location, providers_constraints_mode, providers_constraints_reference, providers_skip_constraints, python_version) and returns: calculate_constraints_location, None, providers_constraints_location