code: def test_legacy_state_pickling():
      legacy_state = {
          "dtype": np.dtype("float32"),
          "_shape": (5,),
          "low": np.array([0.0, 0.0, 0.0, 0.0, 0.0], dtype=np.float32),
          "high": np.array([1.0, 1.0, 1.0, 1.0, 1.0], dtype=np.float32),
          "bounded_below": np.array([True, True, True, True, True]),
          "bounded_above": np.array([True, True, True, True, True]),
          "_np_random": None,
      }
  
      b = Box(-1, 1, ())
      assert "low_repr" in b.__dict__ and "high_repr" in b.__dict__
      del b.__dict__["low_repr"]
      del b.__dict__["high_repr"]
      assert (
          "low_repr" not in b.__dict__ and "high_repr" not in b.__dict__
      )
  
      b.__setstate__(legacy_state)
      assert b.low_repr == "0.0"
      assert b.high_repr == "1.0"
  
file_path: gym/tests/spaces/test_box.py
imports: import re
  import warnings
  import numpy
  import pytest
  import gym.error
  from gym.spaces import Box
  from gym.spaces.box import get_inf
label_desc: Use image node_id 6 for calling a global function with example usage: test_legacy_state_pickling() without return types