code: def test_register(
      env_id: str,
      namespace: Optional[str],
      name: str,
      version: Optional[int],
  ):
      gym.register(env_id, "no-entry-point")
      assert gym.spec(env_id).id == env_id
  
      full_name = f"{name}"
      if namespace:
          full_name = f"{namespace}/{full_name}"
      if version is not None:
          full_name = f"{full_name}-v{version}"
  
      assert full_name in gym.envs.registry.keys()
  
      del gym.envs.registry[env_id]
  
file_path: gym/tests/envs/test_register.py
imports: import re
  from typing import Optional
  import pytest
  import gym
label_desc: Use image node_id 2 for calling a global function with example usage: test_register(env_id, namespace, name, version) without return types