class_docstr: Represents the resource configuration passed to a raylet.
  
  All fields can be None. Before starting services, resolve() should be
  called to return a ResourceSpec with unknown values filled in with
  defaults based on the local machine specifications.
  
  Attributes:
      num_cpus: The CPUs allocated for this raylet.
      num_gpus: The GPUs allocated for this raylet.
      memory: The memory allocated for this raylet.
      object_store_memory: The object store memory allocated for this raylet.
          Note that when calling to_resource_dict(), this will be scaled down
          by 30% to account for the global plasma LRU reserve.
      resources: The custom resources allocated for this raylet.
      redis_max_memory: The max amount of memory (in bytes) to allow each
          redis shard to use. Once the limit is exceeded, redis will start
          LRU eviction of entries. This only applies to the sharded redis
          tables (task, object, and profile tables). By default, this is
          capped at 10GB but can be set higher.
docstr: Returns a dict suitable to pass to raylet initialization.
  
  This renames num_cpus / num_gpus to "CPU" / "GPU",
  translates memory from bytes into 100MB memory units, and checks types.
code: def to_resource_dict(self):
      """Returns a dict suitable to pass to raylet initialization.
  
      This renames num_cpus / num_gpus to "CPU" / "GPU",
      translates memory from bytes into 100MB memory units, and checks types.
      """
      assert self.resolved()
  
      resources = dict(
          self.resources,
          CPU=self.num_cpus,
          GPU=self.num_gpus,
          memory=int(self.memory),
          object_store_memory=int(self.object_store_memory),
      )
  
      resources = {
          resource_label: resource_quantity
          for resource_label, resource_quantity in resources.items()
          if resource_quantity != 0
      }
  
      # Check types.
      for resource_label, resource_quantity in resources.items():
          assert isinstance(resource_quantity, int) or isinstance(
              resource_quantity, float
          ), (
              f"{resource_label} ({type(resource_quantity)}): "
              f"{resource_quantity}"
          )
          if (
              isinstance(resource_quantity, float)
              and not resource_quantity.is_integer()
          ):
              raise ValueError(
                  "Resource quantities must all be whole numbers. "
                  "Violated by resource '{}' in {}.".format(
                      resource_label, resources
                  )
              )
          if resource_quantity < 0:
              raise ValueError(
                  "Resource quantities must be nonnegative. "
                  "Violated by resource '{}' in {}.".format(
                      resource_label, resources
                  )
              )
          if resource_quantity > ray_constants.MAX_RESOURCE_QUANTITY:
              raise ValueError(
                  "Resource quantities must be at most {}. "
                  "Violated by resource '{}' in {}.".format(
                      ray_constants.MAX_RESOURCE_QUANTITY,
                      resource_label,
                      resources,
                  )
              )
  
      return resources
  
file_path: ray/python/ray/_private/resource_spec.py
imports: import logging
  import sys
  from collections import namedtuple
  from typing import Optional
  import ray
  import ray._private.ray_constants
label_desc: Use image node_id 3 for calling the ResourceSpec obj's underlying member method code with example usage: obj.to_resource_dict() and returns: resources