b42b39742cf6dffe0d3d555e056d276c960b8ac3,reframe/core/fields.py,TimerField,__set__,#TimerField#Any#Any#,108
Before Change
def __set__(self, obj, value):
self._check_type(value)
if value is not None:
// Check also the values for minutes and seconds
h, m, s = value
if h < 0 or m < 0 or s < 0:
raise ValueError("timer field must have "
"non-negative values")
if m > 59 or s > 59:
raise ValueError("minutes and seconds in a timer "
"field must not exceed 59")
// Call Field"s __set__() method, type checking is already performed
Field.__set__(self, obj, value)
class AbsolutePathField(TypedField):
After Change
def __set__(self, obj, value):
self._check_type(value)
if value and type(value) is not datetime.timedelta:
try:
time_dict = re.match(r"^((?P<days>\d+)d)*"
r"((?P<hours>\d+)h)*"
r"((?P<minutes>\d+)m)*"
r"((?P<seconds>\d+)s)*$",
value).groupdict()
except AttributeError:
raise Exception("invalid format")
value = datetime.timedelta(**{k:int(v) for k, v in time_dict.items() if v})
// Call Field"s __set__() method, type checking is already performed
Field.__set__(self, obj, value)
class AbsolutePathField(TypedField):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: eth-cscs/reframe
Commit Name: b42b39742cf6dffe0d3d555e056d276c960b8ac3
Time: 2020-01-27
Author: rafael.sarmiento@cscs.ch
File Name: reframe/core/fields.py
Class Name: TimerField
Method Name: __set__
Project Name: snipsco/snips-nlu
Commit Name: 346705a7703d6beebaa3e033520865943440e259
Time: 2017-02-24
Author: clement.doumouro@snips.ai
File Name: custom_intent_parser/entity_extractor/regex_entity_extractor.py
Class Name: RegexEntityExtractor
Method Name: get_entities
Project Name: ilastik/ilastik
Commit Name: ce000e5223ab68d8cd089a17c43356b6ddf952fd
Time: 2013-12-11
Author: bergs@janelia.hhmi.org
File Name: lazyflow/operators/ioOperators/opInputDataReader.py
Class Name: OpInputDataReader
Method Name: _attemptOpenAsDvidVolume