58401db97ece7f585f6aac9725fb0ca6168dcd2a,gym/vector/utils/numpy_utils.py,,create_empty_array,#Any#Any#Any#,60

Before Change


    elif isinstance(space, Dict):
        return create_empty_array_dict(space, n=n, fn=fn)
    else:
        raise NotImplementedError()

def create_empty_array_base(space, n=1, fn=np.zeros):
    shape = space.shape if (n is None) else (n,) + space.shape
    return fn(shape, dtype=space.dtype)

After Change


        return create_empty_array_tuple(space, n=n, fn=fn)
    elif isinstance(space, Dict):
        return create_empty_array_dict(space, n=n, fn=fn)
    elif isinstance(space, Space):
        return create_empty_array_custom(space, n=n, fn=fn)
    else:
        raise ValueError("Space of type `{0}` is not a valid `gym.Space` "
                         "instance.".format(type(space)))

def create_empty_array_base(space, n=1, fn=np.zeros):
    shape = space.shape if (n is None) else (n,) + space.shape
    return fn(shape, dtype=space.dtype)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: openai/gym
Commit Name: 58401db97ece7f585f6aac9725fb0ca6168dcd2a
Time: 2020-09-21
Author: tristandeleu@users.noreply.github.com
File Name: gym/vector/utils/numpy_utils.py
Class Name:
Method Name: create_empty_array


Project Name: openai/gym
Commit Name: 58401db97ece7f585f6aac9725fb0ca6168dcd2a
Time: 2020-09-21
Author: tristandeleu@users.noreply.github.com
File Name: gym/vector/utils/spaces.py
Class Name:
Method Name: batch_space


Project Name: openai/gym
Commit Name: 58401db97ece7f585f6aac9725fb0ca6168dcd2a
Time: 2020-09-21
Author: tristandeleu@users.noreply.github.com
File Name: gym/vector/utils/numpy_utils.py
Class Name:
Method Name: concatenate