code: def uninstall_all_packages(config_params: ConfigParams):
      console.print("[bright_blue]Uninstall All PIP packages")
      result = run_command(
          ["pip", "freeze"],
          github_actions=config_params.github_actions,
          cwd=AIRFLOW_SOURCES,
          text=True,
          check=True,
          capture_output=True,
      )
      all_installed_packages = [
          dep.split("==")[0]
          for dep in result.stdout.strip().split("\n")
          if not dep.startswith(
              (
                  "apache-airflow",
                  "apache-airflow==",
                  "/opt/airflow",
                  "#",
                  "-e",
              )
          )
      ]
      run_command(
          [
              "pip",
              "uninstall",
              "--root-user-action",
              "ignore",
              "-y",
              *all_installed_packages,
          ],
          github_actions=config_params.github_actions,
          cwd=AIRFLOW_SOURCES,
          text=True,
          check=True,
      )
  
imports: from __future__ import annotations
  import json
  import os
  import sys
  from dataclasses import dataclass
  from datetime import datetime
  from functools import cached_property
  from pathlib import Path
  from typing import TextIO
  import requests
  from click import Choice
  from in_container_utils import click, console, run_command
label_desc: Use image node_id 5 for calling a global function with example usage: uninstall_all_packages(config_params) without return types