code: def test_get_action():
      env_spec = GymEnv(DummyBoxEnv()).spec
      obs_dim = env_spec.observation_space.flat_dim
      obs = torch.ones(
          [
              obs_dim,
          ],
          dtype=torch.float32,
      )
      qf = DiscreteMLPQFunction(
          env_spec=env_spec,
          hidden_nonlinearity=None,
          hidden_sizes=(2, 2),
      )
      qvals = qf(obs.unsqueeze(0))
      policy = DiscreteQFArgmaxPolicy(qf, env_spec)
      action, _ = policy.get_action(obs.numpy())
      assert action == torch.argmax(qvals, dim=1).numpy()
      assert action.shape == ()
  
file_path: garage/tests/garage/torch/policies/test_discrete_qf_argmax_policy.py
imports: import pickle
  import numpy
  import pytest
  import torch
  from garage.envs import GymEnv
  from garage.torch.policies import DiscreteQFArgmaxPolicy
  from garage.torch.q_functions import DiscreteMLPQFunction
  from tests.fixtures.envs.dummy import DummyBoxEnv
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_action() without return types