class_docstr: Ray resources required to schedule a trial.
  
  Parameters:
      cpu: Number of CPUs to allocate to the trial.
      gpu: Number of GPUs to allocate to the trial.
      memory: Memory to reserve for the trial.
      object_store_memory: Object store memory to reserve.
      extra_cpu: Extra CPUs to reserve in case the trial needs to
          launch additional Ray actors that use CPUs.
      extra_gpu: Extra GPUs to reserve in case the trial needs to
          launch additional Ray actors that use GPUs.
      extra_memory: Memory to reserve for the trial launching
          additional Ray actors that use memory.
      extra_object_store_memory: Object store memory to reserve for
          the trial launching additional Ray actors that use object store
          memory.
      custom_resources: Mapping of resource to quantity to allocate
          to the trial.
      extra_custom_resources: Extra custom resources to reserve in
          case the trial needs to launch additional Ray actors that use
          any of these custom resources.
      has_placement_group: Bool indicating if the trial also
          has an associated placement group.
code: def __new__(
      cls,
      cpu: float,
      gpu: float,
      memory: float = 0,
      object_store_memory: float = 0.0,
      extra_cpu: float = 0.0,
      extra_gpu: float = 0.0,
      extra_memory: float = 0.0,
      extra_object_store_memory: float = 0.0,
      custom_resources: Optional[dict] = None,
      extra_custom_resources: Optional[dict] = None,
      has_placement_group: bool = False,
  ):
      custom_resources = custom_resources or {}
      extra_custom_resources = extra_custom_resources or {}
      leftovers = set(custom_resources) ^ set(extra_custom_resources)
  
      for value in leftovers:
          custom_resources.setdefault(value, 0)
          extra_custom_resources.setdefault(value, 0)
  
      cpu = round(cpu, 2)
      gpu = round(gpu, 2)
      memory = round(memory, 2)
      object_store_memory = round(object_store_memory, 2)
      extra_cpu = round(extra_cpu, 2)
      extra_gpu = round(extra_gpu, 2)
      extra_memory = round(extra_memory, 2)
      extra_object_store_memory = round(extra_object_store_memory, 2)
      custom_resources = {
          resource: round(value, 2)
          for resource, value in custom_resources.items()
      }
      extra_custom_resources = {
          resource: round(value, 2)
          for resource, value in extra_custom_resources.items()
      }
  
      all_values = [
          cpu,
          gpu,
          memory,
          object_store_memory,
          extra_cpu,
          extra_gpu,
          extra_memory,
          extra_object_store_memory,
      ]
      all_values += list(custom_resources.values())
      all_values += list(extra_custom_resources.values())
      assert len(custom_resources) == len(extra_custom_resources)
      for entry in all_values:
          assert isinstance(entry, Number), (
              "Improper resource value.",
              entry,
          )
      return super(_Resources, cls).__new__(
          cls,
          cpu,
          gpu,
          memory,
          object_store_memory,
          extra_cpu,
          extra_gpu,
          extra_memory,
          extra_object_store_memory,
          custom_resources,
          extra_custom_resources,
          has_placement_group,
      )
  
imports: import logging
  import os
  import time
  from collections import namedtuple
  from numbers import Number
  from typing import Any, Dict, Optional
  import ray
  from ray._private.resource_spec import NODE_ID_PREFIX
label_desc: Use image node_id 1 for calling the _Resources obj's underlying member method code with example usage: obj.__new__(cls, cpu, gpu, memory, object_store_memory, extra_cpu, extra_gpu, extra_memory, extra_object_store_memory, custom_resources, extra_custom_resources, has_placement_group) and returns: super