Check if the timeseries is consistent
550876
def isconsistent(self):
        ''''''
        for dt1, dt0 in laggeddates(self):
            if dt1 <= dt0:
                return False
        return True
1043960
def _check_data(self, X):
        '''
        
        '''

        if len(X) > 1:
            sval = np.unique(X[0][:, 1])
            if np.all([np.all(np.unique(X[i][:, 1]) == sval) for i in range(1, len(X))]):
                pass
            else:
                raise ValueError("Unique identifier var_types not consistent between time series")
926458
def timeinfo(self):
        
        if self.istep not in self.sdat.tseries.index:
            return None
        return self.sdat.tseries.loc[self.istep]
74162
def _validate_freq(self):
        
        from pandas.tseries.frequencies import to_offset
        try:
            return to_offset(self.window)
        except (TypeError, ValueError):
            raise ValueError("passed window {0} is not "
                             "compatible with a datetimelike "
                             "index".format(self.window))
694926
def input_is_consistent(self, task_input, default_allowed_extension, default_max_size):
        
        for problem in self._problems:
            if not problem.input_is_consistent(task_input, default_allowed_extension, default_max_size):
                return False
        return True
723077
def unique(series: pd.Series) -> pd.Series:
    """"""
    return ~series.duplicated(keep=False)
1176905
def is_after(self, ts):
        '''  '''
        if self.timestamp >= int(calendar.timegm(ts.timetuple())):
            return True
        return False
1308849
def verify(self):
        
        if self.firstdate >= self.lastdate:
            raise ValueError(
                f'Unplausible timegrid. The first given date '
                f'{self.firstdate}, the second given date is {self.lastdate}.')
        if (self.lastdate-self.firstdate) % self.stepsize:
            raise ValueError(
                f'Unplausible timegrid. The period span between the given '
                f'dates {self.firstdate} and {self.lastdate} is not '
                f'a multiple of the given step size {self.stepsize}.')
716819
function compareDates(a, b) {
    var aTimestamp = convertToTimestamp(a);
    var bTimestamp = convertToTimestamp(b);

    if (isNaN(aTimestamp) || isNaN(bTimestamp)) {
      return NaN;
    } else {
      return aTimestamp - bTimestamp;
    }
  }
1181560
def is_timeseries(nc, variable):
    '''
    
    '''

    # x, y, z, t(o)
    # X(o)
    dims = nc.variables[variable].dimensions

    cmatrix = coordinate_dimension_matrix(nc)
    for req in ('x', 'y', 't'):
        if req not in cmatrix:
            return False
    if len(cmatrix['x']) != 0:
        return False
    if len(cmatrix['y']) != 0:
        return False
    if 'z' in cmatrix and len(cmatrix['z']) != 0:
        return False
    timevar = get_time_variable(nc)

    # time has to be a coordinate variable in this case
    if cmatrix['t'] != (timevar,):
        return False
    if dims == cmatrix['t']:
        return True
    return False
1089891
def in_zstack(self, s, c, t):
        
        if (self.series == s
            and self.channel == c
            and self.timepoint == t):
            return True
        return False
250023
def consistent(self,lab):
        
        for const in self.constraints:
            if not const.consistent(lab):
                return False
        return True
921769
def isCalibrationInProgress(self):
        
        today = DateTime()
        down_from = self.getDownFrom()
        down_to = self.getDownTo()

        return down_from <= today <= down_to
476776
def check(self):
        

        status = True
        synced = True

        xbin = self.xbin.value()
        ybin = self.ybin.value()
        nwin = self.nwin.value()

        # individual window checks
        g = get_root(self).globals
        for xsw, ysw, nxw, nyw in \
                zip(self.xs[:nwin], self.ys[:nwin],
                    self.nx[:nwin], self.ny[:nwin]):

            xsw.config(bg=g.COL['main'])
            ysw.config(bg=g.COL['main'])
            nxw.config(bg=g.COL['main'])
            nyw.config(bg=g.COL['main'])
            status = status if xsw.ok() else False
            status = status if ysw.ok() else False
            status = status if nxw.ok() else False
            status = status if nyw.ok() else False
            xs = xsw.value()
            ys = ysw.value()
            nx = nxw.value()
            ny = nyw.value()

            # Are unbinned dimensions consistent with binning factors?
            if nx is None or nx % xbin != 0:
                nxw.config(bg=g.COL['error'])
                status = False
            elif (nx // xbin) % 4 != 0:
                """
                The NGC collects pixel data in chunks before transmission.
                As a result, to avoid loss of data from frames, the binned
                x-size must be a multiple of 4.
                """
                nxw.config(bg=g.COL['error'])
                status = False

            if ny is None or ny % ybin != 0:
                nyw.config(bg=g.COL['error'])
                status = False

            # Are the windows synchronised? This means that they
            # would be consistent with the pixels generated were
            # the whole CCD to be binned by the same factors
            # If relevant values are not set, we count that as
            # "synced" because the purpose of this is to enable
            # / disable the sync button and we don't want it to be
            # enabled just because xs or ys are not set.
            if (xs is not None and ys is not None and nx is not None and
                ny is not None):
                    if (xs < 1025 and ((xs - 1) % xbin != 0 or (ys - 1) % ybin != 0)
                        or ((xs-1025) % xbin != 0 or (ys - 1) % ybin != 0)):
                        synced = False

            # Range checks
            if xs is None or nx is None or xs + nx - 1 > xsw.imax:
                xsw.config(bg=g.COL['error'])
                status = False

            if ys is None or ny is None or ys + ny - 1 > ysw.imax:
                ysw.config(bg=g.COL['error'])
                status = False

        # Overlap checks. Compare each window with the next one, requiring
        # no y overlap and that the second is higher than the first
        if status:
            n1 = 0
            for ysw1, nyw1 in zip(self.ys[:nwin-1], self.ny[:nwin-1]):

                ys1 = ysw1.value()
                ny1 = nyw1.value()

                n1 += 1
                ysw2 = self.ys[n1]

                ys2 = ysw2.value()

                if ys2 < ys1 + ny1:
                    ysw2.config(bg=g.COL['error'])
                    status = False

        if synced:
            self.sbutt.config(bg=g.COL['main'])
            self.sbutt.disable()
        else:
            if not self.frozen:
                self.sbutt.enable()
            self.sbutt.config(bg=g.COL['warn'])

        return status
289822
public static boolean isChartInRuntime(Chart cm) {
    if (cm instanceof ChartWithAxes) {
      Axis bAxis = ((ChartWithAxes) cm).getAxes().get(0);
      EList<Axis> oAxes = bAxis.getAssociatedAxes();
      for (int i = 0; i < oAxes.size(); i++) {
        Axis oAxis = oAxes.get(i);
        EList<SeriesDefinition> oSeries = oAxis.getSeriesDefinitions();
        for (int j = 0; j < oSeries.size(); j++) {
          SeriesDefinition sd = oSeries.get(j);
          if (sd.getRunTimeSeries().size() > 0) {
            return true;
          }
        }
      }
    } else if (cm instanceof ChartWithoutAxes) {
      SeriesDefinition bsd = ((ChartWithoutAxes) cm).getSeriesDefinitions().get(0);
      EList<SeriesDefinition> osds = bsd.getSeriesDefinitions();
      for (int i = 0; i < osds.size(); i++) {
        SeriesDefinition osd = osds.get(i);
        if (osd.getRunTimeSeries().size() > 0) {
          return true;
        }
      }
    }
    return false;
  }
1126927
def has_reset(self):
        """"""
        currentTime = self._read_as_int(Addr.Uptime, 4)
        if currentTime <= self._ticks:
            self._ticks = currentTime
            return True
        self._ticks = currentTime
        return False
1113120
def date_matches(self, timestamp):
        """"""
        if self.date is None:
            return False

        timestamp = datetime.fromtimestamp(float(timestamp), self.timezone)
        if self.date.date() == timestamp.date():
            return True

        return False