Read and return the next time frame
199827
def _read_frame(self):
        """"""
        pos = np.zeros((self.num_atoms, 3), float)
        vel = np.zeros((self.num_atoms, 3), float)
        for i in range(self.num_atoms):
            line = next(self._f)
            words = line.split()
            pos[i, 0] = float(words[1])
            pos[i, 1] = float(words[2])
            pos[i, 2] = float(words[3])
            vel[i, 0] = float(words[4])
            vel[i, 1] = float(words[5])
            vel[i, 2] = float(words[6])
        return pos, vel
749062
def grab_following(self, timeout: float=None) -> typing.List[DataAndMetadata.DataAndMetadata]:
        """"""
        self.grab_next(timeout)
        return self.grab_next(timeout)
104020
def GetTimeRange(cls):
    """"""
    first = getattr(cls, '_lower', 0)
    last = getattr(cls, '_upper', cls.MAX_INT64)

    if first < last:
      return first, last

    return last, first
1089464
def get_timerange(self, start, end, code=None):
        
        try:
            return self.data.loc[(slice(pd.Timestamp(start), pd.Timestamp(end)), slice(code)), :]
        except:
            return ValueError('CANNOT FOUND THIS TIME RANGE')
564671
def timespan(start_time):
    """"""

    timespan = datetime.datetime.now() - start_time
    timespan_ms = timespan.total_seconds() * 1000
    return timespan_ms
875372
def next_time(time, start_time, closing_time)
      @time = time
      unless @start_time
        @start_time = realign(time, start_time)
        @time = @start_time if @time < @start_time
      end

      return nil unless find_acceptable_time_before(closing_time)

      @uses += 1 if @time
      @time
    end
1074295
def next(time, base)
      current = time
      until match?(current, base) && current > time
        pot_next = align(potential_next(current, base), base)
        pot_next += min_step if pot_next == current

        current = pot_next
      end

      current
    end
990823
def next(self):
        """"""
        row = self.reader.next()
        return [s.decode("utf-8") for s in row]
190414
def time_afterwards_preceding(
            self, when: datetime.datetime) -> Optional[datetime.timedelta]:
        
        if self.is_empty():
            return None
        end_time = self.end_datetime()
        if when <= end_time:
            return datetime.timedelta()
        else:
            return when - end_time
317166
def get_recent_mtime(t):
    '''
    '''
    if isinstance(t, int):
        # ignore micro seconds
        if len(str(t)) == 13:
            t = t // 1000
        t = datetime.datetime.fromtimestamp(t)
    now = datetime.datetime.now()
    delta = now - t
    if delta.days == 0:
        return datetime.datetime.strftime(t, '%H:%M:%S')
    elif now.year == t.year:
        return datetime.datetime.strftime(t, '%b %d')
    else:
        return datetime.datetime.strftime(t, '%b %d %Y')
284833
private function nextTime() {
        $time = microtime(true);
        $difference = $time - $this->getLastTime();
        $this->setLastTime($time);
        if(!is_null($difference)) {
            return number_format(round($difference, 3), 3, '.', '');
        }
        return null;
    }
665745
def time2seconds(t):
    """"""
    return t.hour * 3600 + t.minute * 60 + t.second + float(t.microsecond) / 1e6
1062888
def _read_next_timestep(self, ts=None):
    """"""

    if self.ts.frame >= self.n_frames-1:
        raise IOError(errno.EIO, 'trying to go over trajectory limit')
    if ts is None:
        ts = self.ts
    ts.frame += 1

    self.zdock_inst._set_pose_num(ts.frame+1)
    ts._pos = self.zdock_inst.static_mobile_copy_uni.trajectory.ts._pos

    return ts
1318713
def next(self):
        '''
        
        '''
        if self.started is False:

            self.started = True
            now_ = datetime.now()
            if self.hour:
                # Fixed hour in a day
                # Next run will be the next day
                scheduled = now_.replace(hour=self.hour, minute=self.minute, second=self.second, microsecond=0)
                if scheduled == now_:
                    return timedelta(seconds=0)
                elif scheduled < now_:
                    # Scheduled time is passed
                    return scheduled.replace(day=now_.day + 1) - now_
            else:
                # Every hour in a day
                # Next run will be the next hour
                scheduled = now_.replace(minute=self.minute, second=self.second, microsecond=0)
                if scheduled == now_:
                    return timedelta(seconds=0)
                elif scheduled < now_:
                    # Scheduled time is passed
                    return scheduled.replace(hour=now_.hour + 1) - now_
            return scheduled - now_
        else:
            if self.hour:
                return timedelta(days=1)  # next day
            return timedelta(hours=1)
466503
def next(self):
        """"""
        # use readline here because next() iterator uses internal readahead
        # buffer so seek position is wrong
        line = self.filehandle.readline()
        line = line.decode('utf-8', 'replace')
        if line == '':
            raise StopIteration
        line = line.rstrip('\n')
        le = LogEvent(line)

        # hint format and nextpos from previous line
        if self._datetime_format and self._datetime_nextpos is not None:
            ret = le.set_datetime_hint(self._datetime_format,
                                       self._datetime_nextpos,
                                       self.year_rollover)
            if not ret:
                # logevent indicates timestamp format has changed,
                # invalidate hint info
                self._datetime_format = None
                self._datetime_nextpos = None
        elif le.datetime:
            # gather new hint info from another logevent
            self._datetime_format = le.datetime_format
            self._datetime_nextpos = le._datetime_nextpos

        return le
164133
def next(self, now=None, increments=_increments, delta=True, default_utc=WARN_CHANGE):
        '''
        
        '''
        if default_utc is WARN_CHANGE and (isinstance(now, _number_types) or (now and not now.tzinfo) or now is None):
            warnings.warn(WARNING_CHANGE_MESSAGE, FutureWarning, 2)
            default_utc = False

        now = now or (datetime.utcnow() if default_utc and default_utc is not WARN_CHANGE else datetime.now())
        if isinstance(now, _number_types):
            now = datetime.utcfromtimestamp(now) if default_utc else datetime.fromtimestamp(now)

        # handle timezones if the datetime object has a timezone and get a
        # reasonable future/past start time
        onow, now = now, now.replace(tzinfo=None)
        tz = onow.tzinfo
        future = now.replace(microsecond=0) + increments[0]()
        if future < now:
            # we are going backwards...
            _test = lambda: future.year < self.matchers.year
            if now.microsecond:
                future = now.replace(microsecond=0)
        else:
            # we are going forwards
            _test = lambda: self.matchers.year < future.year

        # Start from the year and work our way down. Any time we increment a
        # higher-magnitude value, we reset all lower-magnitude values. This
        # gets us performance without sacrificing correctness. Still more
        # complicated than a brute-force approach, but also orders of
        # magnitude faster in basically all cases.
        to_test = ENTRIES - 1
        while to_test >= 0:
            if not self._test_match(to_test, future):
                inc = increments[to_test](future, self.matchers)
                future += inc
                for i in xrange(0, to_test):
                    future = increments[ENTRIES+i](future, inc)
                try:
                    if _test():
                        return None
                except:
                    print(future, type(future), type(inc))
                    raise
                to_test = ENTRIES-1
                continue
            to_test -= 1

        # verify the match
        match = [self._test_match(i, future) for i in xrange(ENTRIES)]
        _assert(all(match),
            "\nYou have discovered a bug with crontab, please notify the\n" \
            "author with the following information:\n" \
            "crontab: %r\n" \
            "now: %r", ' '.join(m.input for m in self.matchers), now)

        if not delta:
            onow = now = datetime(1970, 1, 1)

        delay = future - now
        if tz:
            delay += _fix_none(onow.utcoffset())
            if hasattr(tz, 'localize'):
                delay -= _fix_none(tz.localize(future).utcoffset())
            else:
                delay -= _fix_none(future.replace(tzinfo=tz).utcoffset())

        return delay.days * 86400 + delay.seconds + delay.microseconds / 1000000.
518737
def try_again_later(self, seconds):
        """"""
        if not self.failed:
            self.fails += 1
            self.retry_at = (dt.datetime.now() + timedelta(seconds=seconds))