code: def get_concurrency_group(test: Test) -> Tuple[str, int]:
      if test.get("env", None) == "gce":
          concurrent_group = gce_gpu_cpu_to_concurrent_groups
      else:
          concurrent_group = aws_gpu_cpu_to_concurrency_groups
      default_concurrent = concurrent_group[-1]
      try:
          test_cpus, test_gpus = get_test_resources(test)
      except Exception as e:
          logger.warning(
              f"Couldn't get test resources for test {test['name']}: {e}"
          )
          return default_concurrent.group, default_concurrent.limit
  
      for condition in concurrent_group:
          min_gpu = parse_condition(condition.min_gpu, float("-inf"))
          max_gpu = parse_condition(condition.max_gpu, float("inf"))
          min_cpu = parse_condition(condition.min_cpu, float("-inf"))
          max_cpu = parse_condition(condition.max_cpu, float("inf"))
  
          if (
              min_cpu <= test_cpus <= max_cpu
              and min_gpu <= test_gpus <= max_gpu
          ):
              return condition.group, condition.limit
  
      # Return default
      logger.warning(
          f"Could not find concurrency group for test {test['name']} "
          f"based on used resources."
      )
      return default_concurrent.group, default_concurrent.limit
  
file_path: ray/release/ray_release/buildkite/concurrency.py
imports: import csv
  from collections import namedtuple
  from typing import Tuple, Optional, Dict
  from ray_release.bazel import bazel_runfile
  from ray_release.test import Test
  from ray_release.template import load_test_cluster_compute
  from ray_release.logger import logger
label_desc: Use image node_id 4 for calling a global function with example usage: get_concurrency_group(test) and returns: default_concurrent,  default_concurrent, default_concurrent,  default_concurrent, condition,  condition