code: def test_epsilon_greedy_policy(self):
      obs, _, _, _ = self.env.step(1)
  
      action, _ = self.epsilon_greedy_policy.get_action(obs)
      assert self.env.action_space.contains(action)
  
      # epsilon decay by 1 step, new epsilon = 1 - 0.098 = 0.902
      random_rate = (
          np.random.random(100000)
          < self.epsilon_greedy_policy._epsilon()
      )
      assert np.isclose([0.902], [sum(random_rate) / 100000], atol=0.01)
  
      actions, _ = self.epsilon_greedy_policy.get_actions([obs] * 5)
  
      # epsilon decay by 6 steps in total
      # new epsilon = 1 - 6 * 0.098 = 0.412
      random_rate = (
          np.random.random(100000)
          < self.epsilon_greedy_policy._epsilon()
      )
      assert np.isclose([0.412], [sum(random_rate) / 100000], atol=0.01)
  
      for action in actions:
          assert self.env.action_space.contains(action)
  
file_path: garage/tests/garage/np/exploration_strategies/test_epsilon_greedy_policy.py
imports: import collections
  import pickle
  import numpy
  from garage.np.exploration_policies import EpsilonGreedyPolicy
  from tests.fixtures.envs.dummy import DummyDiscreteEnv
label_desc: Use image node_id 2 for calling the TestEpsilonGreedyPolicy obj's underlying member method code with example usage: obj.test_epsilon_greedy_policy() without return types