code: def test_get_return(self):
      # Generate an empty episode and ensure that the return is zero.
      episode = MultiAgentEpisode()
      # Ensure that the return of an empty episode cannopt be determined.
      with self.assertRaises(AssertionError):
          episode.get_return()
  
      # Now sample 100 timesteps.
      episode, env = self._mock_multi_agent_records_from_env()
      # Ensure that the return is now at least zero.
      self.assertGreaterEqual(episode.get_return(), 0.0)
      # Assert that the return is indeed the sum of all agent returns.
      agent_returns = sum(
          agent_eps.get_return()
          for agent_eps in episode.agent_episodes.values()
      )
      self.assertTrue(episode.get_return(), agent_returns)
      # Assert that adding the buffered rewards to the agent returns
      # gives the expected result when considering the buffer in
      # `get_return()`.
      buffered_rewards = sum(
          agent_buffer["rewards"].queue[0]
          for agent_buffer in episode.agent_buffers.values()
          if agent_buffer["rewards"].full()
      )
      self.assertTrue(
          episode.get_return(consider_buffer=True),
          agent_returns + buffered_rewards,
      )
  
imports: import gymnasium
  import numpy
  import unittest
  from typing import List, Optional, Tuple
  import ray
  from ray.rllib.env.multi_agent_env import MultiAgentEnv
  from ray.rllib.env.multi_agent_episode import MultiAgentEpisode
  from ray.rllib.utils.typing import MultiAgentDict
label_desc: Use image node_id 9 for calling the TestMultiAgentEpisode obj's underlying member method code with example usage: obj.test_get_return() without return types