hunk.code_window:         self.count = 0  # increment this manually
       def total(self):
           """Returns summed number of steps across all agent buffers."""
           return sum(p.count for p in self.policy_builders.values())
  
hunk.labels: keep keep keep keep keep replace keep
hunk.after_edit:         return sum(a.count for a in self.agent_builders.values())
  
hunk.file_path: rllib/evaluation/sample_batch_builder.py
hunk.type: replace
file: import kubernetes
  from kubernetes.config.config_exception import ConfigException
  
  _configured = False
  _core_api = None
  _auth_api = None
  
  
  def _load_config():
      global _configured
      if _configured:
          return
      try:
          kubernetes.config.load_incluster_config()
      except ConfigException:
          kubernetes.config.load_kube_config()
      _configured = True
  
  
  def core_api():
      global _core_api
      if _core_api is None:
          _load_config()
          _core_api = kubernetes.client.CoreV1Api()
  
      return _core_api
  
  
  def auth_api():
      global _auth_api
      if _auth_api is None:
          _load_config()
          _auth_api = kubernetes.client.RbacAuthorizationV1Api()
  
      return _auth_api
  
  
  log_prefix = "KubernetesNodeProvider: "
  