True if weights have been applied to the measure(s) for this cube.

        Unweighted counts are available for all cubes. Weighting applies to
        any other measures provided by the cube.
165687
def is_weighted(self):
        
        cube_dict = self._cube_dict
        if cube_dict.get("query", {}).get("weight") is not None:
            return True
        if cube_dict.get("weight_var") is not None:
            return True
        if cube_dict.get("weight_url") is not None:
            return True
        unweighted_counts = cube_dict["result"]["counts"]
        count_data = cube_dict["result"]["measures"].get("count", {}).get("data")
        if unweighted_counts != count_data:
            return True
        return False
622692
def total_weight(self):
        
        weights = self._raw_weights()
        if weights.shape[1] == 0:
            return 0.0
        elif weights.shape[1] < self._ntaps:
            return np.sum(np.mean(weights, axis=1))
        else:
            return self._filter_coeffs.dot(np.sum(weights, axis=0))
1217325
public int getNumWeights() {
    if (weights == null) return 0;
    int numWeights = 0;
    for (double[] wts : weights) {
      numWeights += wts.length;
    }
    return numWeights;
  }
461286
public boolean hasInDoubtItems()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "hasInDoubtItems");
      SibTr.exit(tc, "hasInDoubtItems", new Boolean(_inDoubt));	
    }
    return _inDoubt;
  }
696773
def AllBalancesZeroOrLess(self):
        
        for key, fixed8 in self.Balances.items():
            if fixed8.value > 0:
                return False
        return True
900730
def is_sharable(self):
        
        return bool(
            self.sharable and
            all(x.is_sharable() for x in self.elements)
        )
951446
private boolean sortActivitiesIfNeeded() {
        if (mActivitySorter != null && mIntent != null
                && !mActivities.isEmpty() && !mHistoricalRecords.isEmpty()) {
            mActivitySorter.sort(mIntent, mActivities,
                    Collections.unmodifiableList(mHistoricalRecords));
            return true;
        }
        return false;
    }
1001620
def should_send(measure)
      op = op_for_measurement(measure)
      return measure.value > 0 if op == ADD_OP
      return !measure.value.nan? if op == MAX_OP

      false
    end
893461
@Override
  public UnionWeight<W> times(UnionWeight<W> a, UnionWeight<W> b) {
    if (isZero(a) || isZero(b)) {
      return zero();
    }
    UnionWeight<W> result = zero();
    for (int i = 0; i < a.size(); i++) {
      UnionWeight<W> row = zero(); // empty set
      for (int j = 0; j < b.size(); j++) {
        row = withAppended(row, this.weightSemiring.times(a.get(i), b.get(j)));
      }
      result = this.plus(result, row);
    }
    return result;
  }
65330
def calculate_weights(self, measure='tfidf'):
        
        from math import log

        # TODO replace with spipy matrices (and calculate with scikit)

        if measure == 'tfidf':
            self.calculate_idf()

        for doc_idx, document in enumerate(self.resulting_documents):
            train_word_count = defaultdict(int)
            self.tf_idfs[doc_idx] = {}
            for word in document:
                train_word_count[word] += 1

            for word in document:
                if measure == "binary":
                    tf = 1
                    idf = 1
                else:
                    tf = train_word_count[word]
                    idf = 1 if measure == "tf" else (self.idf[word] if word in self.idf else None)

                if idf != None:
                    self.tf_idfs[doc_idx][word] = tf * idf
537232
def is_sorted(self, ranks=None):
        
        ranks = ranks or self.ranks

        return check_sorted(self, ranks)
928633
function canResultsBeSummed(item) {
  var result = true;
  if (defined(item.cannotSum)) {
    if (typeof item.cannotSum === "object") {
      var conceptItems = item._concepts[0].items;
      conceptItems.forEach(concept => {
        var valuesThatCannotDisplayPercent = item.cannotSum[concept.id];
        if (defined(valuesThatCannotDisplayPercent)) {
          var activeValueIds = concept.activeItems.map(
            activeConcept => activeConcept.id
          );
          if (
            valuesThatCannotDisplayPercent.some(
              cannotValue => activeValueIds.indexOf(cannotValue) >= 0
            )
          ) {
            result = false;
          }
        }
      });
    } else {
      result = !item.cannotSum; // ie. if it is true or false.
    }
  }
  return result;
}
646975
public static boolean hasUncountable( ZMatrixD1 m )
    {
        int length = m.getDataLength();

        for( int i = 0; i < length; i++ ) {
            double a = m.data[i];
            if( Double.isNaN(a) || Double.isInfinite(a))
                return true;
        }
        return false;
    }
948984
def is_uniformly_weighted(self):
        """"""
        try:
            is_uniformly_weighted = self.__is_uniformly_weighted
        except AttributeError:
            bdry_fracs = self.partition.boundary_cell_fractions
            is_uniformly_weighted = (
                np.allclose(bdry_fracs, 1.0) or
                self.exponent == float('inf') or
                not getattr(self.tspace, 'is_weighted', False))

            self.__is_uniformly_weighted = is_uniformly_weighted

        return is_uniformly_weighted
274209
public static boolean recoverWeight(ProviderInfo providerInfo, int weight) {
        providerInfo.setStatus(ProviderStatus.RECOVERING);
        providerInfo.setWeight(weight);
        return true;
    }
1105094
def apply_to_submeasures(subs, type, values, unpaired_type=nil, unpaired_keys=[])
      new_subs = []
      subs.each do |sub|
        # this unless prevents us from forcing an exclusion or excepion onto a measure that has a submeasure without
        # an exclusion or exception, but other populations with an exclusion or excepion.
        unless unpaired_keys.include? sub[unpaired_type]
          # duplicate each new value if it is set, otherwise set this key on each submeasure.
          values.each do |value|
            if (sub[type] and sub[type] != value.id)
              tmp = {}
              HQMF::PopulationCriteria::ALL_POPULATION_CODES.each do |key|
                tmp[key] = sub[key] if sub[key]
              end
              sub = tmp
              new_subs << sub
            end
            sub[type] = value.id
          end
        end
      end
      subs.concat(new_subs)
    end
144677
public boolean notifyMeasurementEnding(Iterable<Measurement> measurements) throws IOException {
    println(controlLogMessageRenderer.render(new StopMeasurementLogMessage(measurements)));
    for (Measurement measurement : measurements) {
      println(String.format("I got a result! %s: %f%s%n", measurement.description(),
          measurement.value().magnitude() / measurement.weight(), measurement.value().unit()));
    }
    writer.flush();
    return shouldKeepMeasuring();
  }