94f092ae5dc64ad0c4e196ab17e7b5d84b219899,theano/gof/type.py,EnumType,__init__,#EnumType#,844
Before Change
def __init__(self, **kwargs):
for k in kwargs:
if re.match("^[A-Z][A-Z0-9_]*$", k) is None:
raise AttributeError("EnumType: invalid enum name: "%s". "
"Only capital letters, underscores and digits "
"are allowed." % k)
if isinstance(kwargs[k], bool):
kwargs[k] = int(kwargs[k])
elif not isinstance(kwargs[k], (int, float)):
raise ValueError("EnumType: enum "%s": expected integer or floating value, got "%s"."
After Change
self.check_ctype()
for k in kwargs:
if re.match("^[A-Z][A-Z0-9_]*$", k) is None:
raise AttributeError("%s: invalid enum name: "%s". "
"Only capital letters, underscores and digits "
"are allowed." % (type(self).__name__, k))
if isinstance(kwargs[k], bool):
kwargs[k] = int(kwargs[k])
elif not isinstance(kwargs[k], (int, float)):
raise ValueError("%s: constant "%s": expected integer or floating value, got "%s"."
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: Theano/Theano
Commit Name: 94f092ae5dc64ad0c4e196ab17e7b5d84b219899
Time: 2017-04-05
Author: stevenbocco@gmail.com
File Name: theano/gof/type.py
Class Name: EnumType
Method Name: __init__
Project Name: analysiscenter/batchflow
Commit Name: d3ef826de307c20f289cccc29a211669612fb380
Time: 2019-10-01
Author: rhudor@gmail.com
File Name: batchflow/dataset.py
Class Name: Dataset
Method Name: __getattr__
Project Name: lingpy/lingpy
Commit Name: d26ef4be642ac38d7bb8a85f899dcff0c8a8cd14
Time: 2013-03-29
Author: mattis.list@posteo.de
File Name: lingpy/basic/wordlist.py
Class Name: Wordlist
Method Name: __getattr__