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

Before Change


        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))
        self.check(t)

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: 3

Non-data size: 3

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: Coder-Yu/RecQ
Commit Name: 2787cdbf536af7e08376c1a93daa0946dec34077
Time: 2018-04-19
Author: coderyy@outlook.com
File Name: dataset/FilmTrust/divide.py
Class Name:
Method Name:


Project Name: UFAL-DSG/tgen
Commit Name: a886baab6b48d976f0b30addde5e588282de072f
Time: 2016-05-17
Author: odusek@ufal.mff.cuni.cz
File Name: util/select_pairs_for_ab.py
Class Name:
Method Name: main