92a8dd394bbc16f996ae36e1c1beadd8b38916de,reframe/core/fields.py,TimerField,__set__,#TimerField#Any#Any#,110

Before Change


        self._check_type(value)
        if value is not None 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 ValueError("invalid format for timer field")

            value = datetime.timedelta(**{k: int(v)

After Change


                                  r"((?P<minutes>\d+)m)?"
                                  r"((?P<seconds>\d+)s)?$",
                                  value)
            if not time_match:
                raise ValueError("invalid format for timer field")

            value = datetime.timedelta(
                **{k: int(v) for k, v in time_match.groupdict().items() if v})

        // Call Field"s __set__() method, type checking is already performed
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: eth-cscs/reframe
Commit Name: 92a8dd394bbc16f996ae36e1c1beadd8b38916de
Time: 2020-02-14
Author: rafael.sarmiento@cscs.ch
File Name: reframe/core/fields.py
Class Name: TimerField
Method Name: __set__


Project Name: snipsco/snips-nlu
Commit Name: f83dd115acb0d119fa466fad51b473a30749f684
Time: 2017-05-11
Author: clement.doumouro@snips.ai
File Name: snips_nlu/intent_parser/regex_intent_parser.py
Class Name: RegexIntentParser
Method Name: get_slots


Project Name: CellProfiler/CellProfiler
Commit Name: a0f1f391dfe4448067ce7f0f795142a5f5c41661
Time: 2010-05-12
Author: thouis@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/measurements.py
Class Name:
Method Name: find_metadata_tokens