class_docstr: Base class for resources that have been acquired.
  
  Acquired resources can be associated to Ray objects, which can then be
  scheduled using these resources.
  
  Internally this can point e.g. to a placement group, a placement
  group bundle index, or just raw resources.
  
  The main API is the `annotate_remote_entities` method. This will associate
  remote Ray objects (tasks and actors) with the acquired resources by setting
  the Ray remote options to use the acquired resources.
class_docstr_tok: ["Base","class","for","resources","that","have","been","acquired",".","Acquired","resources","can","be","associated","to","Ray","objects",",","which","can","then","be","scheduled","using","these","resources",".","Internally","this","can","point","e.g",".","to","a","placement","group",",","a","placement","group","bundle","index",",","or","just","raw","resources",".","The","main","API","is","the","`","annotate_remote_entities","`","method",".","This","will","associate","remote","Ray","objects","(","tasks","and","actors",")","with","the","acquired","resources","by","setting","the","Ray","remote","options","to","use","the","acquired","resources","."]
docstr: Return remote ray entities (tasks/actors) to use the acquired resources.
  
  The first entity will be associated with the first bundle, the second
  entity will be associated with the second bundle, etc.
  
  Args:
      entities: Remote Ray entities to annotate with the acquired resources.
docstr_tok: ["Return","remote","ray","entities","(","tasks\/actors",")","to","use","the","acquired","resources",".","The","first","entity","will","be","associated","with","the","first","bundle",",","the","second","entity","will","be","associated","with","the","second","bundle",",","etc",".","Args",":","entities",":","Remote","Ray","entities","to","annotate","with","the","acquired","resources","."]
code: def annotate_remote_entities(
      self, entities: List[RemoteRayEntity]
  ) -> List[Union[RemoteRayEntity]]:
      """Return remote ray entities (tasks/actors) to use the acquired resources.
  
      The first entity will be associated with the first bundle, the second
      entity will be associated with the second bundle, etc.
  
      Args:
          entities: Remote Ray entities to annotate with the acquired resources.
      """
      bundles = self.resource_request.bundles
  
      # Also count the empty head bundle as a bundle
      num_bundles = len(bundles) + int(
          self.resource_request.head_bundle_is_empty
      )
  
      if len(entities) > num_bundles:
          raise RuntimeError(
              f"The number of callables to annotate ({len(entities)}) cannot "
              f"exceed the number of available bundles ({num_bundles})."
          )
  
      annotated = []
  
      if self.resource_request.head_bundle_is_empty:
          # The empty head bundle is place on the first bundle index with empty
          # resources.
          annotated.append(
              self._annotate_remote_entity(
                  entities[0], {}, bundle_index=0
              )
          )
  
          # Shift the remaining entities
          entities = entities[1:]
  
      for i, (entity, bundle) in enumerate(zip(entities, bundles)):
          annotated.append(
              self._annotate_remote_entity(
                  entity, bundle, bundle_index=i
              )
          )
  
      return annotated
  
imports: import abc
  import json
  from copy import deepcopy
  from inspect import signature
  from typing import Dict, List, Union
  from dataclasses import dataclass
  import ray
  from ray.util import placement_group
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 1 for calling the AcquiredResources obj's underlying member method code with example usage: obj.annotate_remote_entities(entities) and returns: annotated