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 subtract(cls, original, to_remove):
      cpu = original.cpu - to_remove.cpu
      gpu = original.gpu - to_remove.gpu
      memory = original.memory - to_remove.memory
      object_store_memory = (
          original.object_store_memory - to_remove.object_store_memory
      )
      extra_cpu = original.extra_cpu - to_remove.extra_cpu
      extra_gpu = original.extra_gpu - to_remove.extra_gpu
      extra_memory = original.extra_memory - to_remove.extra_memory
      extra_object_store_memory = (
          original.extra_object_store_memory
          - to_remove.extra_object_store_memory
      )
      all_resources = set(original.custom_resources).union(
          set(to_remove.custom_resources)
      )
      new_custom_res = {
          k: original.custom_resources.get(k, 0)
          - to_remove.custom_resources.get(k, 0)
          for k in all_resources
      }
      extra_custom_res = {
          k: original.extra_custom_resources.get(k, 0)
          - to_remove.extra_custom_resources.get(k, 0)
          for k in all_resources
      }
      return _Resources(
          cpu,
          gpu,
          memory,
          object_store_memory,
          extra_cpu,
          extra_gpu,
          extra_memory,
          extra_object_store_memory,
          new_custom_res,
          extra_custom_res,
      )
  
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 10 for calling the _Resources obj's underlying member method code with example usage: obj.subtract(cls, original, to_remove) and returns: _Resources