code: def test_requirements():
      """Test that each required package is available."""
      packages_all = []
      packages_dist = []
      packages_version = []
      packages_unkn = []
  
      requirements, reqs_http = get_all_requirements()
  
      for requirement in requirements:
          try:
              requirement = str(requirement)
              pkg_resources.require(requirement)
          except DistributionNotFound:
              packages_all.append(requirement)
              packages_dist.append(requirement)
          except VersionConflict:
              packages_all.append(requirement)
              packages_version.append(requirement)
          except (
              pkg_resources.extern.packaging.requirements.InvalidRequirement
          ):
              packages_all.append(requirement)
              packages_unkn.append(requirement)
  
      packages_all.extend(reqs_http)
      if packages_dist or packages_version:
          print("Missing packages: %s" % packages_dist, flush=True)
          print(
              "Wrong version of packages: %s" % packages_version,
              flush=True,
          )
          print(
              "Can't determine (e.g. http) packages: %s"
              % packages_unkn,
              flush=True,
          )
          print("\n\nRUN THIS:\n\n", flush=True)
          print(
              "pip uninstall peft transformers accelerate -y ; CUDA_HOME=/usr/local/cuda-11.7 pip install %s --upgrade"
              % str(" ".join(packages_all)),
              flush=True,
          )
          print("\n\n", flush=True)
  
          raise ValueError(packages_all)
  
file_path: h2ogpt/tests/test_requirements.py
imports: import pkg_resources
  from pkg_resources import DistributionNotFound, VersionConflict
  from src.utils import remove
  from tests.utils import wrap_test_forked
  import requests
  import json
label_desc: Use image node_id 3 for calling a global function with example usage: test_requirements() without return types