code: def test_update(env):
      policy = ConstantPolicy(env.action_space.sample())
      exp_policy = AddGaussianNoise(
          env, policy, total_timesteps=10, max_sigma=1.0, min_sigma=0.0
      )
      exp_policy.get_action(None)
      exp_policy.get_action(None)
  
      DummyBatch = collections.namedtuple("EpisodeBatch", ["lengths"])
      batch = DummyBatch(np.array([1, 2]))
  
      # new sigma will be 1 - 0.1 * (1 + 2) = 0.7
      exp_policy.update(batch)
      assert np.isclose(exp_policy._sigma(), 0.7)
  
      exp_policy.get_action(None)
  
      batch = DummyBatch(np.array([1, 1, 2]))
      # new sigma will be 0.7 - 0.1 * (1 + 1 + 2) = 0.3
      exp_policy.update(batch)
      assert np.isclose(exp_policy._sigma(), 0.3)
  
file_path: garage/tests/garage/np/exploration_strategies/test_add_gaussian_noise.py
imports: import collections
  import numpy
  import pytest
  from garage.np.exploration_policies import AddGaussianNoise
  from tests.fixtures.envs.dummy import DummyBoxEnv
label_desc: Use image node_id 4 for calling a global function with example usage: test_update(env) without return types