Get a score for this factory based on the given data. The higher the
score the more arguments were found.

@param data
@return
438283
public int getScore(Map<String, Object> data)
	{
		if(! hasSerializedFields)
		{
			return 0;
		}

		int score = 0;

		for(Argument arg : arguments)
		{
			if(arg instanceof FactoryDefinition.SerializedArgument)
			{
				if(data.containsKey(((SerializedArgument) arg).name))
				{
					score++;
				}
			}
		}

		return score;
	}
435908
public static <T> T get(List<T> data, int position) {
        return position < 0 || position >= Utils.sizeOf(data) ? null : data.get(position);
    }
815887
public static Date getYearlyAbsoluteAsDate(RecurringData data)
   {
      Date result;
      Integer yearlyAbsoluteDay = data.getDayNumber();
      Integer yearlyAbsoluteMonth = data.getMonthNumber();
      Date startDate = data.getStartDate();

      if (yearlyAbsoluteDay == null || yearlyAbsoluteMonth == null || startDate == null)
      {
         result = null;
      }
      else
      {
         Calendar cal = DateHelper.popCalendar(startDate);
         cal.set(Calendar.MONTH, yearlyAbsoluteMonth.intValue() - 1);
         cal.set(Calendar.DAY_OF_MONTH, yearlyAbsoluteDay.intValue());
         result = cal.getTime();
         DateHelper.pushCalendar(cal);
      }
      return result;
   }
676913
public Object getResult(AverageData data) {
        return data.count == 0 ? BigDecimal.ZERO : data.total.divide(BigDecimal.valueOf( data.count ), RoundingMode.HALF_EVEN );
    }
1081323
public static <T> BaseDTO<T> buildSuccess(T data) {
        BaseDTO<T> dto = new BaseDTO<>();
        dto.setData(data);
        return dto;
    }
1368632
public <T extends RegressionEvaluation> T evaluateRegressionMDS(JavaRDD<MultiDataSet> data) {
        return evaluateRegressionMDS(data, DEFAULT_EVAL_SCORE_BATCH_SIZE);
    }
748677
function(data){
			var rows = this.calculateRowsNumber();
			var datas = [];
			for(var i = 0; i < data.length; i += rows){
				datas.push(data.slice(i, i+rows));
			}
			return datas;
		}
1047203
public double score_interpreter(final HashMap<String, Comparable> row ) {
    double score = _initialScore;
    for( int i=0; i<_rules.length; i++ )
      score += _rules[i].score(row.get(_colNames[i]));
    return score;
  }
455644
@javax.annotation.Nonnull
  public static com.simiacryptus.util.data.ScalarStatistics stats(@javax.annotation.Nonnull final double[] data) {
    @javax.annotation.Nonnull final com.simiacryptus.util.data.ScalarStatistics statistics = new PercentileStatistics();
    Arrays.stream(data).forEach(statistics::add);
    return statistics;
  }
234591
public static int count(final byte[] data) {
		int count = 0;
		for (int i = data.length; --i >= 0;) {
			count += count(data[i]);
		}
		return count;
	}
62174
public static byte[] calculate(final Data[] data) throws IOException {
        int bitSize = 0;
        for (final Data target : data) {
            bitSize += target.numOfBits;
        }
        int pos = 0;
        final FastBitSet bitSet = new FastBitSet(bitSize);
        for (final Data target : data) {
            int count = 0;
            final byte[] bytes = calculate(target);
            for (final byte b : bytes) {
                byte bits = b;
                for (int j = 0; j < 8; j++) {
                    bitSet.set(pos, (bits & 0x1) == 0x1);
                    pos++;
                    count++;
                    if (count >= target.numOfBits) {
                        break;
                    }
                    bits >>= 1;
                }
            }
        }
        return bitSet.toByteArray();
    }
233650
@Override
  public Map<String, Double> scoreMap(String[] text) {
    Map<String, Double> probDist = new HashMap<>();

    double[] categorize = classifyProb(text);
    int catSize = getNumberOfLabels();
    for (int i = 0; i < catSize; i++) {
      String category = getLabel(i);
      probDist.put(category, categorize[getIndex(category)]);
    }
    return probDist;
  }
965987
@Override
    protected double scoreImpl(List<Word> words1, List<Word> words2) {
        if(words1.isEmpty() && words2.isEmpty()){
            return 1.0;
        }
        //HashSet的contains性能要大于ArrayList的contains
        Set<Word> words2Set = new HashSet<>();
        words2Set.addAll(words2);
        //求交集
        Set<String> intersectionSet = new ConcurrentSkipListSet<>();
        words1.parallelStream().forEach(word -> {
            if (words2Set.contains(word)) {
                intersectionSet.add(word.getText());
            }
        });
        //交集的大小
        int intersectionSize = intersectionSet.size();
        //求并集
        Set<String> unionSet = new HashSet<>();
        words1.forEach(word -> unionSet.add(word.getText()));
        words2.forEach(word -> unionSet.add(word.getText()));
        //并集的大小
        int unionSize = unionSet.size();
        //相似度分值
        double score = intersectionSize/(double)unionSize;
        if(LOGGER.isDebugEnabled()) {
            LOGGER.debug("交集的大小：" + intersectionSize);
            LOGGER.debug("并集的大小：" + unionSize);
            LOGGER.debug("相似度分值=" + intersectionSize + "/(double)" + unionSize + "=" + score);
        }
        return score;
    }
382166
@Override
    protected double scoreImpl(List<Word> words1, List<Word> words2){
        //文本1
        StringBuilder text1 = new StringBuilder();
        words1.forEach(word -> text1.append(word.getText()));
        //文本2
        StringBuilder text2 = new StringBuilder();
        words2.forEach(word -> text2.append(word.getText()));
        //计算文本1和文本2的Jaro距离
        //Jaro距离也就是相似度分值
        double score = jaroDistance(text1.toString(), text2.toString());
        if(LOGGER.isDebugEnabled()){
            LOGGER.debug("文本1："+text1.toString());
            LOGGER.debug("文本2："+text2.toString());
            LOGGER.debug("文本1和文本2的相似度分值："+score);
        }
        return score;
    }
1175732
public JavaDoubleRDD scoreExamples(JavaRDD<DataSet> data, boolean includeRegularizationTerms) {
        return scoreExamplesMultiDataSet(data.map(new DataSetToMultiDataSetFn()), includeRegularizationTerms);
    }
1136009
protected Float score(Row row) {
        ColumnFamily cf = row.cf;
        CellName cellName = rowMapper.makeCellName(cf);
        Cell cell = cf.getColumn(cellName);
        String value = UTF8Type.instance.compose(cell.value());
        return Float.parseFloat(value);
    }
906835
protected static <A> double[] computeNormalizedRanks(final NumberArrayAdapter<?, A> adapter, final A data, int len) {
    // Sort the objects:
    int[] s1 = sortedIndex(adapter, data, len);
    final double norm = .5 / (len - 1);
    double[] ret = new double[len];
    for(int i = 0; i < len;) {
      final int start = i++;
      final double val = adapter.getDouble(data, s1[start]);
      while(i < len && adapter.getDouble(data, s1[i]) <= val) {
        i++;
      }
      final double score = (start + i - 1) * norm;
      for(int j = start; j < i; j++) {
        ret[s1[j]] = score;
      }
    }
    return ret;
  }