Return True if there are no intensity measure levels
779117
def no_imls(self):
        
        return all(numpy.isnan(ls).any() for ls in self.imtls.values())
842191
def _any_source_silent(sources):
    """"""
    return np.any(np.all(np.sum(
        sources, axis=tuple(range(2, sources.ndim))) == 0, axis=1))
817257
def keep_absolute_impute__r2(X, y, model_generator, method_name, num_fcounts=11):
    
    return __run_measure(measures.keep_impute, X, y, model_generator, method_name, 0, num_fcounts, sklearn.metrics.r2_score)
1092680
def check_nocycles(Adj, verbosity=2):
    
    dim = Adj.shape[0]
    for g in range(dim):
        v = np.zeros(dim)
        v[g] = 1
        for i in range(dim):
            v = Adj.dot(v)
            if v[g] > 1e-10:
                if verbosity > 2:
                    settings.m(0,Adj)
                    settings.m(0,'contains a cycle of length',i+1,
                          'starting from node',g,
                          '-> reject')
                return False
    return True
1258819
def check_metric_can_be_zero(metric_name, metric_value, json_attributes):
    
    if "last" in metric_name.lower():
        return True
    if not metric_value:
        return False
    try:
        if metric_value == 0 or metric_value == "0" or metric_value == "0.000000" or float(metric_value) == 0.0:
            if not json_attributes or not json_attributes.get('cnt'):
                return False
            if json_attributes.get('cnt') == "0" or json_attributes.get('cnt') == 0:
                return False
    except ValueError:
        return False
    return True
1329903
function shouldMetric(ctx) {
	if (ctx.broker.options.metrics) {
		sampleCounter++;
		if (sampleCounter * ctx.broker.options.metricsRate >= 1.0) {
			sampleCounter = 0;
			return true;
		}
	}

	return false;
}
341486
def is_empty(self):
        
        if self.bounds[1] < self.bounds[0]:
            return True
        if self.bounds[1] == self.bounds[0]:
            return not (self.included[0] and self.included[1])
898822
def _check_neg(self, level, *tokens):
        """"""
        for record in self.records:
            if level is not None and record.levelno != level:
                continue
            if all(token in record.message for token in tokens):
                break
        else:
            return

        # didn't exit, all tokens found in the same record
        msg = "Tokens {} found in the following record:  {}  {!r}".format(
            tokens, record.levelname, record.message)
        self.test_instance.fail(msg)
325782
def _has_match(self, assembled_summary):
        ''''''
        if assembled_summary.startswith('yes'):
            if self.data[0]['var_only'] == '0' or self._to_cluster_summary_has_known_nonsynonymous(assembled_summary) == 'yes':
                return 'yes'
            else:
                return 'no'
        else:
            return 'no'
174549
def is_empty(value, msg=None, except_=None, inc_zeros=True):
    '''
    
    '''
    if hasattr(value, 'empty'):
        # dataframes must check for .empty
        # since they don't define truth value attr
        # take the negative, since below we're
        # checking for cases where value 'is_null'
        value = not bool(value.empty)
    elif inc_zeros and value in ZEROS:
        # also consider 0, 0.0, 0L as 'empty'
        # will check for the negative below
        value = True
    else:
        pass
    _is_null = is_null(value, except_=False)
    result = bool(_is_null or not value)
    if except_:
        return is_true(result, msg=msg, except_=except_)
    else:
        return bool(result)
50737
def measure(level, message, params = {}, &block)
      index = Sapience.config.level_to_index(level)
      if level_index <= index
        measure_internal(level, index, message, params, &block)
      else
        yield params if block
      end
    end
722393
private function getMeteredDefault()
  {
    foreach( self::METERED_HEADERS as $header )
    {
      if( array_key_exists( $header, $_SERVER ) )
      {
        return true;
      }
    }

    return false;
  }
288307
def check_hit(self, x, y):
        """"""
        extents = self.get_extents()

        if not extents:
            return False

        if extents.x <= x <= extents.x + extents.width and extents.y <= y <= extents.y + extents.height:
            return self._stroke_context is None or self._stroke_context.in_fill(x, y)
        else:
            return False
1008199
def mask_nan(self):
        """"""
        self.mask = np.logical_and(self.mask, ~(np.isnan(self.intensity)))
654120
function checkThresholds(metrics, thresholds) {
  if (!elv(thresholds)) return;

  const target = metrics[thresholds.target];

  for (let i = 0; i < metrics.length; i++) {
    if (i === thresholds.target) continue;

    const other = metrics[i];
    assertThreshold(target.avg, other.avg, thresholds.avg);
    assertThreshold(target.max, other.max, thresholds.max);
    assertThreshold(target.min, other.min, thresholds.min);
  }
}
676339
def are_in_interval(s, l, r, border = 'included'):
        
        return numpy.all([IntensityRangeStandardization.is_in_interval(x, l, r, border) for x in s])
785962
def isEmpty(self):
        
        if self.isRectangular:
            return False
        eps = 1e-5
        ul = Point()
        ur = (self.ur - self.ul).abs_unit
        lr = (self.lr - self.ul).abs_unit
        ll = (self.ll - self.ul).abs_unit
        if max(ur.y, lr.y, ll.y) - min(ur.y, lr.y, ll.y) < eps:
            return True
        return False