3faa7a095c740b227f16483c4d17721bfb2bb17a,dm_control/suite/tests/domains_test.py,DomainTest,test_visualize_reward,#DomainTest#Any#Any#,188

Before Change


    env.task.visualise_reward = True
    env.reset()
    action = np.zeros(env.action_spec().shape)
    for _ in range(2):
      env.step(action)

  @parameterized.parameters(*suite.ALL_TASKS)
  def test_task_supports_environment_kwargs(self, domain, task):
    env = suite.load(domain, task,
                     environment_kwargs=dict(flat_observation=True))

After Change



      mock_get_reward.reset_mock()
      mock_get_reward.return_value = 2.0  // Rewards > 1 should be clipped.
      env.step(action)
      mock_get_reward.assert_called_with(env.physics)
      self.assertCorrectColors(env.physics, reward=1.0)

      mock_get_reward.reset_mock()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deepmind/dm_control
Commit Name: 3faa7a095c740b227f16483c4d17721bfb2bb17a
Time: 2019-04-12
Author: alimuldal@google.com
File Name: dm_control/suite/tests/domains_test.py
Class Name: DomainTest
Method Name: test_visualize_reward


Project Name: ray-project/ray
Commit Name: de1787e5e5d6871c8f09a7bbc56dbf7c155f8594
Time: 2020-04-16
Author: rliaw@berkeley.edu
File Name: python/ray/tune/tests/test_cluster.py
Class Name:
Method Name: test_remove_node_before_result


Project Name: allenai/allennlp
Commit Name: 5ad7a33a04d8829ad3439b5f9390bd136105f986
Time: 2020-05-28
Author: tobiasr@allenai.org
File Name: allennlp/nn/beam_search.py
Class Name: BeamSearch
Method Name: search