code: def test_mujoco_action_dimensions(env_spec: EnvSpec):
      """Test that for all mujoco environment, mis-dimensioned actions, an error is raised.
  
      Types of mis-dimensioned actions:
       * Too few actions
       * Too many actions
       * Too few dimensions
       * Too many dimensions
       * Incorrect shape
      """
      env = env_spec.make(disable_env_checker=True)
      env.reset()
  
      # Too few actions
      with pytest.raises(ValueError, match="Action dimension mismatch"):
          env.step(env.action_space.sample()[1:])
  
      # Too many actions
      with pytest.raises(ValueError, match="Action dimension mismatch"):
          env.step(np.append(env.action_space.sample(), 0))
  
      # Too few dimensions
      with pytest.raises(ValueError, match="Action dimension mismatch"):
          env.step(0.1)
  
      # Too many dimensions
      with pytest.raises(ValueError, match="Action dimension mismatch"):
          env.step(np.expand_dims(env.action_space.sample(), 0))
  
      # Incorrect shape
      with pytest.raises(ValueError, match="Action dimension mismatch"):
          env.step(np.expand_dims(env.action_space.sample(), 1))
  
      env.close()
  
file_path: gym/tests/envs/test_action_dim_check.py
imports: import numpy
  import pytest
  import gym
  from gym import spaces
  from gym.envs.registration import EnvSpec
  from tests.envs.utils import all_testing_initialised_envs, mujoco_testing_env_specs
label_desc: Use image node_id 1 for calling a global function with example usage: test_mujoco_action_dimensions(env_spec) without return types