26c5b2cbda0b5f027ce58acbfd39d3dfc929fd59,descarteslabs/workflows/types/array/scalar.py,Scalar,__init__,#Scalar#Any#,24
Before Change
def __init__(self, obj):
raise ProxyTypeError(
"Cannot instantiate a Scalar directly. Use the Int, Float, or Bool classes instead."
)
def __neg__(self):
return _delayed_numpy_ufuncs().negative(self)
After Change
def __init__(self, obj):
if isinstance(obj, type(self)):
self.graft = obj.graft
elif isinstance(obj, (np.int64, np.float64, np.bool, np.bool_)):
cast = PY_TYPE[type(obj)](obj)
self.graft = client.apply_graft("scalar.create", cast)
else:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: descarteslabs/descarteslabs-python
Commit Name: 26c5b2cbda0b5f027ce58acbfd39d3dfc929fd59
Time: 2020-04-17
Author: 51922948+sdelany2@users.noreply.github.com
File Name: descarteslabs/workflows/types/array/scalar.py
Class Name: Scalar
Method Name: __init__
Project Name: descarteslabs/descarteslabs-python
Commit Name: 68828f650886dad698320814f98ce520b31cb5a1
Time: 2020-02-06
Author: 51922948+sdelany2@users.noreply.github.com
File Name: descarteslabs/workflows/types/containers/list_.py
Class Name: List
Method Name: __getitem__
Project Name: descarteslabs/descarteslabs-python
Commit Name: 68828f650886dad698320814f98ce520b31cb5a1
Time: 2020-02-06
Author: 51922948+sdelany2@users.noreply.github.com
File Name: descarteslabs/workflows/types/containers/tuple_.py
Class Name: Tuple
Method Name: __getitem__