code: def _get_trial_cpu_and_gpu(trial: Trial) -> Tuple[int, int]:
      cpu = trial.placement_group_factory.required_resources.get(
          "CPU", 0
      )
      gpu = trial.placement_group_factory.required_resources.get(
          "GPU", 0
      )
      return cpu, gpu
  
file_path: ray/python/ray/tune/execution/insufficient_resources_manager.py
imports: import logging
  from functools import lru_cache
  import os
  import ray
  import time
  from typing import Dict, Optional, Tuple
  from ray.tune.execution.cluster_info import _is_ray_cluster
  from ray.tune.experiment import Trial
label_desc: Use image node_id 2 for calling a global function with example usage: _get_trial_cpu_and_gpu(trial) and returns: cpu,  gpu