Check if there are enough data points.
433226
def _sanity_check(self):
        
        windows = self.lag_window_size + self.future_window_size
        if (not self.lag_window_size or not self.future_window_size or self.time_series_length < windows or windows < DEFAULT_BITMAP_MINIMAL_POINTS_IN_WINDOWS):
            raise exceptions.NotEnoughDataPoints

        # If window size is too big, too many data points will be assigned a score of 0 in the first lag window
        # and the last future window.
        if self.lag_window_size > DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS:
            self.lag_window_size = DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS
        if self.future_window_size > DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS:
            self.future_window_size = DEFAULT_BITMAP_MAXIMAL_POINTS_IN_WINDOWS
580441
def run_checks(number_samples, k_choices):
        
        assert isinstance(k_choices, int), \
            "Number of optimal trajectories should be an integer"

        if k_choices < 2:
            raise ValueError(
                "The number of optimal trajectories must be set to 2 or more.")
        if k_choices >= number_samples:
            msg = "The number of optimal trajectories should be less than the \
                    number of samples"
            raise ValueError(msg)
599741
def compare_data(self, data):
        '''
        
        '''
        if self.old_data != data:
            self.old_data = data
            return True
        return False
1236314
def _check(sample, data):
    """"""
    if dd.get_chip_method(sample).lower() == "atac":
        return [sample]
    if dd.get_phenotype(sample) == "input":
        return None
    for origin in data:
        if dd.get_batch(sample) in (dd.get_batches(origin[0]) or []) and dd.get_phenotype(origin[0]) == "input":
            sample["work_bam_input"] = origin[0].get("work_bam")
            return [sample]
    return [sample]
845324
protected static function checkRequirements()
    {
        if (self::$enabledPharData === null || self::$enabledPearTar === null) {
            self::$enabledPearTar = class_exists('\Archive_Tar');
            self::$enabledPharData = class_exists('\PharData');
        }
    }
115758
def _desc_has_data(desc):
    """"""
    if desc is None:
        return False
    # Checking most properties since we don't know what's present, since a custom build may have
    # stripped just one of them (e.g. liteBuild strips exampleNumber). We don't bother checking the
    # possibleLengthsLocalOnly, since if this is the only thing that's present we don't really
    # support the type at all: no type-specific methods will work with only this data.
    return ((desc.example_number is not None) or
            _desc_has_possible_number_data(desc) or
            (desc.national_number_pattern is not None))
78609
def _check_values(self, values):
        """"""
        assert isinstance(values, Iterable) and not \
            isinstance(values, (str, dict, bytes, bytearray)), \
            'values should be a list or tuple. Got {}'.format(type(values))
        assert len(values) == len(self.datetimes), \
            'Length of values list must match length of datetimes list. {} != {}'.format(
                len(values), len(self.datetimes))
        assert len(values) > 0, 'Data Collection must include at least one value'
982114
private static Data checkData(final Data data) {
		if (Data.EMPTY.equals(data)) {
			throw new IllegalStateOfArgumentException("Argument 'data' must not be empty.");
		}
		return data;
	}
858220
def mean(data):
    """"""
    #: http://stackoverflow.com/a/27758326
    n = len(data)
    if n < 1:
        raise ValueError('mean requires at least one data point')
    return sum(data)/n
809736
def check_param_ranges(num_bins, num_groups, num_values, trim_outliers, trim_percentile):
    """"""

    if num_bins < minimum_num_bins:
        raise ValueError('Too few bins! The number of bins must be >= 5')

    if num_values < num_groups:
        raise ValueError('Insufficient number of values in features (< number of nodes), or invalid membership!')

    if trim_outliers:
        if trim_percentile < 0 or trim_percentile >= 100:
            raise ValueError('percentile of tail values to trim must be in the semi-open interval [0,1).')
    elif num_values < 2:
        raise ValueError('too few features to compute minimum and maximum')

    return
1351640
private void checkForBlips() {
        blips.clear();
        for (Poi poi : pois.values()) {
            if (poi.distanceTo(MY_LOCATION) < this.range) {
                if (!blips.keySet().contains(poi.getName())) {
                    blips.put(poi.getName(), poi);
                }
            }
        }
    }
887590
public boolean hasData() {
        int apos = token.length - 1;
        int rpos = pos - 1;
        for (; rpos > -1 && apos > -1; rpos--, apos--) {
            if (buffer2[rpos] != -1) {
                return true;
            }
        }
        for (rpos = buffer2.length - 1; apos > -1; rpos--, apos--) {
            if (buffer2[rpos] != -1) {
                return true;
            }
        }
        return false;
    }
1272748
private void sanityCheck(
      String seriesName,
      double[] openData,
      double[] highData,
      double[] lowData,
      double[] closeData) {

    checkData(seriesName, "Open", openData);
    checkData(seriesName, "High", highData);
    checkData(seriesName, "Low", lowData);
    checkData(seriesName, "Close", closeData);

    checkDataLengths(seriesName, "Open", "Close", openData, closeData);
    checkDataLengths(seriesName, "High", "Close", highData, closeData);
    checkDataLengths(seriesName, "Low", "Close", lowData, closeData);
  }
958264
def _is_ready(self, unit_data):
        
        return set(unit_data.keys()).issuperset(set(self.required_keys))
627973
private static Data checkData(final Data data) {
		if (Data.EMPTY.equals(data)) {
			throw new IllegalStateException("Argument 'data' must not be empty.");
		}
		return data;
	}
483628
def _check_valid_data(self, data):
        
        if data.dtype.type is not np.float32 and \
           data.dtype.type is not np.float64:
            raise ValueError(
                'Illegal data type. RGB-D images only support float arrays')

        if len(data.shape) != 3 and data.shape[2] != 4:
            raise ValueError(
                'Illegal data type. RGB-D images only support four channel')

        color_data = data[:, :, :3]
        if np.any((color_data < 0) | (color_data > BINARY_IM_MAX_VAL)):
            raise ValueError(
                'Color channels must be in the range (0, BINARY_IM_MAX_VAL)')
369511
def _check_quota(self):
        
        self._request_remaining_quota_if_unset()
        if self.quota_estimate < self.quota_limit:
            raise BitQuotaExceeded(self.quota_estimate)