code: def test_observations_are_invariant_to_the_player_trained():
      p_row_act = [0, 1, 1, 0]
      p_col_act = [0, 1, 0, 1]
      max_steps = 4
      env_all = [init_env(max_steps, env_class) for env_class in ENVS]
      n_steps = 4
  
      for env in env_all:
          _, _ = env.reset()
          step_i = 0
          for _ in range(n_steps):
              step_i += 1
              actions = {
                  "player_row": p_row_act[step_i - 1],
                  "player_col": p_col_act[step_i - 1],
              }
              obs, reward, done, truncated, info = env.step(actions)
              # assert observations are symmetrical respective to the actions
              if step_i == 1:
                  assert (
                      obs[env.players_ids[0]] == obs[env.players_ids[1]]
                  )
              elif step_i == 2:
                  assert (
                      obs[env.players_ids[0]] == obs[env.players_ids[1]]
                  )
              elif step_i == 3:
                  obs_step_3 = obs
              elif step_i == 4:
                  assert (
                      obs[env.players_ids[0]]
                      == obs_step_3[env.players_ids[1]]
                  )
                  assert (
                      obs[env.players_ids[1]]
                      == obs_step_3[env.players_ids[0]]
                  )
  
file_path: ray/rllib/examples/env/tests/test_matrix_sequential_social_dilemma.py
imports: import random
  from ray.rllib.examples.env.matrix_sequential_social_dilemma import IteratedPrisonersDilemma, IteratedChicken, IteratedStagHunt, IteratedBoS
label_desc: Use image node_id 15 for calling a global function with example usage: test_observations_are_invariant_to_the_player_trained() without return types