code: def calculate_constraints_location(
      constraints_mode: str,
      constraints_reference: str | None,
      github_repository: str,
      python_version: str,
      providers: bool,
  ):
      constraints_base = f"https://raw.githubusercontent.com/{github_repository}/{constraints_reference}"
      location = (
          f"{constraints_base}/{constraints_mode}-{python_version}.txt"
      )
      console.print(
          f"[info]Determined {'providers' if providers else 'airflow'} constraints as: {location}"
      )
      return location
  
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 5 for calling a global function with example usage: calculate_constraints_location(constraints_mode, constraints_reference, github_repository, python_version, providers) and returns: location