code: def test_to_done_step_api(
      is_vector_env,
      done_returns,
      expected_terminated,
      expected_truncated,
  ):
      (
          _,
          _,
          terminated,
          truncated,
          info,
      ) = convert_to_terminated_truncated_step_api(
          done_returns, is_vector_env=is_vector_env
      )
      assert np.all(terminated == expected_terminated)
      assert np.all(truncated == expected_truncated)
  
      if is_vector_env is False:
          assert "TimeLimit.truncated" not in info
      elif isinstance(info, list):
          assert all(
              "TimeLimit.truncated" not in sub_info for sub_info in info
          )
      else:  # isinstance(info, dict)
          assert "TimeLimit.truncated" not in info
  
      roundtripped_returns = convert_to_done_step_api(
          (0, 0, terminated, truncated, info),
          is_vector_env=is_vector_env,
      )
      assert data_equivalence(done_returns, roundtripped_returns)
  
imports: import numpy
  import pytest
  from gym.utils.env_checker import data_equivalence
  from gym.utils.step_api_compatibility import convert_to_done_step_api, convert_to_terminated_truncated_step_api
label_desc: Use image node_id 1 for calling a global function with example usage: test_to_done_step_api(is_vector_env, done_returns, expected_terminated, expected_truncated) without return types