df38756fb9220bd605acc3e8d5fd42f7f43c3a1e,tests/test_ops.py,OpsTestCase,random,#OpsTestCase#,56

Before Change


    def random(self, *shapes):
        if all(isinstance(i, int) for i in shapes):
            shapes = [shapes]
        arrays = tuple(np.random.rand(*shape) for shape in shapes)
        return arrays[0] if len(shapes) == 1 else arrays

    def test_Identity(self):
        t = tf.identity(self.random(3, 4))

After Change


    def random(self, *shapes, **kwargs):
        if all(isinstance(i, int) for i in shapes):
            if kwargs.get("complex", False):
                return self.random(*shapes) + 1j * self.random(*shapes)
            else:
                return np.random.rand(*shapes)
        else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: riga/tfdeploy
Commit Name: df38756fb9220bd605acc3e8d5fd42f7f43c3a1e
Time: 2016-03-10
Author: marcelrieger@me.com
File Name: tests/test_ops.py
Class Name: OpsTestCase
Method Name: random


Project Name: tensorflow/models
Commit Name: 252e2d2ee1b372e4379a992580a24bcaf254b775
Time: 2018-10-16
Author: shallue@google.com
File Name: research/astronet/astronet/ops/testing.py
Class Name:
Method Name: fake_features


Project Name: biolab/orange3
Commit Name: ac892eddd865681c9746efeda9f1f094f26cc32f
Time: 2012-11-29
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/data/filter.py
Class Name: Filter_IsDefined
Method Name: __call__


Project Name: cmu-db/ottertune
Commit Name: ab17aafac49003ca324a432fd75c8f9ae19cf846
Time: 2019-10-15
Author: dongshen@andrew.cmu.edu
File Name: server/analysis/tests/test_ddpg.py
Class Name: TestDDPG
Method Name: setUpClass