code: def testActionSelectionWithEpsilonDecay(self):
      policy = py_epsilon_greedy_policy.EpsilonGreedyPolicy(
          self.greedy_policy,
          0.9,
          random_policy=self.random_policy,
          epsilon_decay_end_count=10,
          epsilon_decay_end_value=0.4,
      )
      time_step = mock.MagicMock()
      # Replace the random generator with fixed behaviour
      random = mock.MagicMock()
      policy._rng = random
  
      # 0.8 < 0.9 and 0.8 < 0.85, so random policy should be used.
      policy._rng.rand.return_value = 0.8
      for _ in range(2):
          policy.action(time_step)
          self.random_policy.action.assert_called_with(time_step)
      self.assertEqual(2, self.random_policy.action.call_count)
      self.assertEqual(0, self.greedy_policy.action.call_count)
  
      # epislon will change from [0.8 to 0.4], and greedy policy should be used
      for _ in range(8):
          policy.action(time_step)
          self.greedy_policy.action.assert_called_with(
              time_step, policy_state=()
          )
      self.assertEqual(2, self.random_policy.action.call_count)
      self.assertEqual(8, self.greedy_policy.action.call_count)
  
      # 0.399 < 0.4, random policy should be used.
      policy._rng.rand.return_value = 0.399
      self.random_policy.reset_mock()
      for _ in range(5):
          policy.action(time_step)
          self.random_policy.action.assert_called_with(time_step)
      self.assertEqual(5, self.random_policy.action.call_count)
      # greedy policy should not be called any more
      self.assertEqual(8, self.greedy_policy.action.call_count)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing.absltest import mock
  from tf_agents.policies import py_epsilon_greedy_policy
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.utils import test_utils
label_desc: Use image node_id 10 for calling the EpsilonGreedyPolicyTest obj's underlying member method code with example usage: obj.testActionSelectionWithEpsilonDecay() without return types