A greater-than filter chain.

        >>> request_time = EventExpression('request', 'elapsed_ms')
        >>> filtered = request_time.gt('elapsed_ms', 500)
        >>> print(filtered)
        request(elapsed_ms).gt(elapsed_ms, 500)
189981
def gt(self, event_property, value):
        
        c = self.copy()
        c.filters.append(filters.GT(event_property, value))
        return c
739594
def request_time(self) -> float:
        """"""
        if self._finish_time is None:
            return time.time() - self._start_time
        else:
            return self._finish_time - self._start_time
1306295
def elapsed(func):
    """"""

    @functools.wraps(func)
    def wrapper(*args, **kw):
        start = time.time()
        print('Running `%s()` ...' % func.__name__)
        res = func(*args, **kw)
        end = time.time()
        print('Function `%s()` running elapsed %.2f s' %
              (func.__name__, end - start))
        return res

    return wrapper
388698
def get_total_time(cls):
        
        cur = cls.get_cursor()
        q = "SELECT SUM(elapsed) FROM {}"
        cur.execute(q.format(cls.meta['table']))
        result = cur.fetchone()['SUM(elapsed)']
        return result if result else 0.0
397304
def filter_t(func):
    
    return Transformation('filter({0})'.format(name(func)),
                          partial(filter, func),
                          {ExecutionStrategies.PARALLEL})
410813
def get_filter(self):
        
        return self.filter_form_cls(self.request.GET,
                                    runtime_context=self.get_runtime_context(),
                                    use_filter_chaining=self.use_filter_chaining)
851877
def make_event_filter(self):
        """"""
        event_filter = EventFilter(
            self.event_name,
            self.event,
            self.filters,
            from_block=self.from_block,
            to_block=self.to_block
        )
        event_filter.set_poll_interval(0.5)
        return event_filter
1246532
def get_waveform_filter_length_in_time(approximant, template=None, **kwargs):
    
    kwargs = props(template, **kwargs)

    if approximant in _filter_time_lengths:
        return _filter_time_lengths[approximant](**kwargs)
    else:
        return None
332881
def with_time(self):
        
        self.header["X-Authorization-Timestamp"] = str(int(time.time()))
        self.header["Date"] = str(int(time.time()))
        return self
398245
def timeit (func, log, limit):
    """"""

    def newfunc (*args, **kwargs):
        """Execute function and print execution time."""
        t = time.time()
        res = func(*args, **kwargs)
        duration = time.time() - t
        if duration > limit:
            print(func.__name__, "took %0.2f seconds" % duration, file=log)
            print(args, file=log)
            print(kwargs, file=log)
        return res
    return update_func_meta(newfunc, func)
435639
def ulocalized_time(self, time, context, request):
        
        value = ut(time, long_format=self.show_time, time_only=False,
                   context=context, request=request)
        return value or ""
90556
def _elapsed_time(begin_time, end_time):
    

    bt = _str2datetime(begin_time)
    et = _str2datetime(end_time)

    return float((et - bt).seconds)
515756
def filter_not_t(func):
    
    return Transformation('filter_not({0})'.format(name(func)),
                          partial(six.moves.filterfalse, func),
                          {ExecutionStrategies.PARALLEL})
511750
def filter_counter(self, counter, min=2, max=100000000):
        
        records_filterd = {}
        counter_all_records = 0
        for item in counter:
            counter_all_records += 1
            if max > counter[item] >= min:
                records_filterd[item] = counter[item]

        self.stat['user_record_events'] = counter_all_records
        self.stat['records_filtered'] = len(records_filterd)
        return records_filterd
632968
def elapsed_ms(self):
        
        dt = datetime.datetime.now() - self.start_time
        return ((dt.days * 24 * 3600) + dt.seconds) * 1000  \
            + dt.microseconds / 1000.0
1005368
def _graphql_query_waittime(self, query_hash: str, current_time: float, untracked_queries: bool = False) -> int:
        """"""
        sliding_window = 660
        if query_hash not in self._graphql_query_timestamps:
            self._graphql_query_timestamps[query_hash] = []
        self._graphql_query_timestamps[query_hash] = list(filter(lambda t: t > current_time - 60 * 60,
                                                                 self._graphql_query_timestamps[query_hash]))
        reqs_in_sliding_window = list(filter(lambda t: t > current_time - sliding_window,
                                             self._graphql_query_timestamps[query_hash]))
        count_per_sliding_window = self._graphql_request_count_per_sliding_window(query_hash)
        if len(reqs_in_sliding_window) < count_per_sliding_window and not untracked_queries:
            return max(0, self._graphql_earliest_next_request_time - current_time)
        next_request_time = min(reqs_in_sliding_window) + sliding_window + 6
        if untracked_queries:
            self._graphql_earliest_next_request_time = next_request_time
        return round(max(next_request_time, self._graphql_earliest_next_request_time) - current_time)
1027106
def _filter_by_moys_slow(self, moys):
        """"""
        _filt_values = []
        _filt_datetimes = []
        for i, d in enumerate(self.datetimes):
            if d.moy in moys:
                _filt_datetimes.append(d)
                _filt_values.append(self._values[i])
        return _filt_values, _filt_datetimes