class_docstr: REST client to interact with an RLlib policy server.
code: def _send(self, data):
      payload = pickle.dumps(data)
  
      if self.session is None:
          response = requests.post(self.address, data=payload)
      else:
          response = self.session.post(self.address, data=payload)
  
      if response.status_code != 200:
          logger.error(
              "Request failed {}: {}".format(response.text, data)
          )
      response.raise_for_status()
      parsed = pickle.loads(response.content)
      return parsed
  
imports: import logging
  import threading
  import time
  from typing import Union, Optional
  from enum import Enum
  import ray.cloudpickle
  from ray.rllib.env.external_env import ExternalEnv
  from ray.rllib.env.external_multi_agent_env import ExternalMultiAgentEnv
  from ray.rllib.env.multi_agent_env import MultiAgentEnv
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.utils.annotations import PublicAPI
  from ray.rllib.utils.typing import MultiAgentDict, EnvInfoDict, EnvObsType, EnvActionType
label_desc: Use image node_id 8 for calling the PolicyClient obj's underlying member method code with example usage: obj._send(data) and returns: parsed