code: def _validate_resource_quantity(name, quantity):
      if quantity < 0:
          return f"The quantity of resource {name} cannot be negative"
      if (
          isinstance(quantity, float)
          and quantity != 0.0
          and int(quantity * ray._raylet.RESOURCE_UNIT_SCALING) == 0
      ):
          return (
              f"The precision of the fractional quantity of resource {name}"
              " cannot go beyond 0.0001"
          )
      resource_name = "GPU" if name == "num_gpus" else name
      if (
          resource_name
          in ray._private.accelerators.get_all_accelerator_resource_names()
      ):
          (
              valid,
              error_message,
          ) = ray._private.accelerators.get_accelerator_manager_for_resource(
              resource_name
          ).validate_resource_request_quantity(
              quantity
          )
          if not valid:
              return error_message
      return None
  
file_path: ray/python/ray/_private/ray_option_utils.py
imports: import warnings
  from dataclasses import dataclass
  from typing import Any, Callable, Dict, Optional, Tuple, Union
  import ray
  from ray._private import ray_constants
  from ray._private.utils import get_ray_doc_version
  from ray.util.placement_group import PlacementGroup
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy, PlacementGroupSchedulingStrategy, NodeLabelSchedulingStrategy
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_resource_quantity(name, quantity) and returns: None, str, name, str, str, name, str, error_message