class_docstr: Resource manager using placement groups as the resource backend.
  
  This manager will use placement groups to fulfill resource requests. Requesting
  a resource will schedule the placement group. Acquiring a resource will
  return a ``PlacementGroupAcquiredResources`` that can be used to schedule
  Ray tasks and actors on the placement group. Freeing an acquired resource
  will destroy the associated placement group.
  
  Ray core does not emit events when resources are available. Instead, the
  scheduling state has to be periodically updated.
  
  Per default, placement group scheduling state is refreshed every time when
  resource state is inquired, but not more often than once every ``update_interval_s``
  seconds. Alternatively, staging futures can be retrieved (and awaited) with
  ``get_resource_futures()`` and state update can be force with ``update_state()``.
  
  Args:
      update_interval_s: Minimum interval in seconds between updating scheduling
          state of placement groups.
class_docstr_tok: ["Resource","manager","using","placement","groups","as","the","resource","backend",".","This","manager","will","use","placement","groups","to","fulfill","resource","requests",".","Requesting","a","resource","will","schedule","the","placement","group",".","Acquiring","a","resource","will","return","a","``","PlacementGroupAcquiredResources","``","that","can","be","used","to","schedule","Ray","tasks","and","actors","on","the","placement","group",".","Freeing","an","acquired","resource","will","destroy","the","associated","placement","group",".","Ray","core","does","not","emit","events","when","resources","are","available",".","Instead",",","the","scheduling","state","has","to","be","periodically","updated",".","Per","default",",","placement","group","scheduling","state","is","refreshed","every","time","when","resource","state","is","inquired",",","but","not","more","often","than","once","every","``","update_interval_s","``","seconds",".","Alternatively",",","staging","futures","can","be","retrieved","(","and","awaited",")","with","``","get_resource_futures","(",")","``","and","state","update","can","be","force","with","``","update_state","(",")","``",".","Args",":","update_interval_s",":","Minimum","interval","in","seconds","between","updating","scheduling","state","of","placement","groups","."]
code: def cancel_resource_request(self, resource_request: ResourceRequest):
      if self._request_to_staged_pgs[resource_request]:
          pg = self._request_to_staged_pgs[resource_request].pop()
  
          # PG was staging
          future = self._pg_to_staging_future.pop(pg)
          self._staging_future_to_pg.pop(future)
  
          # Cancel the pg.ready task.
          # Otherwise, it will be pending node assignment forever.
          ray.cancel(future)
      else:
          # PG might be ready
          pg = self._request_to_ready_pgs[resource_request].pop()
          if not pg:
              raise RuntimeError(
                  "Cannot cancel resource request: No placement group was "
                  f"staged or is ready. Make sure to not cancel more resource "
                  f"requests than you've created. Request: {resource_request}"
              )
  
      self._pg_to_request.pop(pg)
      ray.util.remove_placement_group(pg)
  
imports: import time
  from collections import defaultdict
  from typing import Dict, List, Optional, Set
  from dataclasses import dataclass
  import ray
  from ray.air.execution.resources.request import ResourceRequest, AcquiredResources, RemoteRayEntity
  from ray.air.execution.resources.resource_manager import ResourceManager
  from ray.util.annotations import DeveloperAPI
  from ray.util.placement_group import PlacementGroup, remove_placement_group
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 6 for calling the PlacementGroupResourceManager obj's underlying member method code with example usage: obj.cancel_resource_request(resource_request) without return types