b42b39742cf6dffe0d3d555e056d276c960b8ac3,reframe/core/fields.py,TimerField,__set__,#TimerField#Any#Any#,108

Before Change


        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")

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):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: streamlit/streamlit
Commit Name: e44204dcffff1053cc43142b9e9315a30d590c46
Time: 2019-03-12
Author: 44782696+aaj-st@users.noreply.github.com
File Name: lib/streamlit/process_runner.py
Class Name:
Method Name: run_handling_errors_in_this_process


Project Name: RaRe-Technologies/gensim
Commit Name: 11eb5df876a007566dfc98c0132ef5ef04675959
Time: 2019-07-07
Author: witiko@gmail.com
File Name: gensim/models/tfidfmodel.py
Class Name:
Method Name: resolve_weights