code: def test_spec_versioned_lookups():
      gym.register("test/Test2-v5", "no-entry-point")
  
      with pytest.raises(
          gym.error.VersionNotFound,
          match=re.escape(
              "Environment version `v9` for environment `test/Test2` doesn't exist. It provides versioned environments: [ `v5` ]."
          ),
      ):
          gym.spec("test/Test2-v9")
  
      with pytest.raises(
          gym.error.DeprecatedEnv,
          match=re.escape(
              "Environment version v4 for `test/Test2` is deprecated. Please use `test/Test2-v5` instead."
          ),
      ):
          gym.spec("test/Test2-v4")
  
      assert gym.spec("test/Test2-v5") is not None
  
file_path: gym/tests/envs/test_spec.py
imports: import re
  import pytest
  import gym
label_desc: Use image node_id 5 for calling a global function with example usage: test_spec_versioned_lookups() without return types