docstr: Called whenever a deployment replica is being stopped.
docstr_tok: ["Called","whenever","a","deployment","replica","is","being","stopped","."]
code: def on_replica_stopping(
      self, deployment_id: DeploymentID, replica_name: str
  ) -> None:
      """Called whenever a deployment replica is being stopped."""
      self._pending_replicas[deployment_id].pop(replica_name, None)
      self._launching_replicas[deployment_id].pop(replica_name, None)
      self._recovering_replicas[deployment_id].discard(replica_name)
      self._running_replicas[deployment_id].pop(replica_name, None)
  
imports: import copy
  import sys
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from dataclasses import dataclass
  from typing import Callable, Dict, List, Optional, Set, Tuple
  import ray
  from ray.serve._private.cluster_node_info_cache import ClusterNodeInfoCache
  from ray.serve._private.common import DeploymentID
  from ray.serve._private.utils import get_head_node_id
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
label_desc: Use image node_id 4 for calling the DefaultDeploymentScheduler obj's underlying member method code with example usage: obj.on_replica_stopping(deployment_id, replica_name) without return types