/* get the prediction distances for all classes
494632
function predict(face) {
      return getNet().computeFaceDescriptorAsync(face)
        .then(inputDescriptor =>
          getDescriptorsByClass().map(ds => ({
            className: ds.className,
            distance: computeMeanDistance(ds.faceDescriptors, inputDescriptor)
          }))
        )
    }
401999
public static List<ASTNodePredicate> matchByClass(Class<ASTNode>... classes) {
        ArrayList<ASTNodePredicate> result = new ArrayList<ASTNodePredicate>(classes.length);
        for (final Class<ASTNode> astNodeClass : classes) {
            result.add(new MatchByClass(astNodeClass));
        }
        return result;
    }
1240767
public String[] getSuperclasses(String cls) {
    List<String>	result;

    result = new ArrayList<>();

    for (String superclass: m_CacheNames.keySet()) {
      if (m_CacheNames.get(superclass).contains(cls))
        result.add(superclass);
    }

    if (result.size() > 1)
      Collections.sort(result);

    return result.toArray(new String[result.size()]);
  }
1129203
@Override
    public int predict(T x) {
        List<Neighbor<T,T>> neighbors = new ArrayList<>();
        nns.range(x, radius, neighbors);
        
        if (neighbors.size() < minPts) {
            return OUTLIER;
        }
        
        int[] label = new int[k + 1];
        for (Neighbor<T,T> neighbor : neighbors) {
            int yi = y[neighbor.index];
            if (yi == OUTLIER) yi = k;
            label[yi]++;
        }
        
        int c = Math.whichMax(label);
        if (c == k) c = OUTLIER;
        return c;
    }
413505
public synchronized int getPredictedTotal(T predicted) {
        int total = 0;
        for (T actual : classes) {
            total += getCount(actual, predicted);
        }
        return total;
    }
24660
public List<JavaClass> getAllClasses() {
        ClassDumpSegment classDumpBounds;

        if (heapDumpSegment == null) {
            return Collections.emptyList();
        }

        classDumpBounds = getClassDumpSegment();

        if (classDumpBounds == null) {
            return Collections.emptyList();
        }

        return classDumpBounds.createClassCollection();
    }
1256493
private static List<Object> componentClasses() {
    return Arrays.asList(
      PostProjectAnalysisTasksExecutor.class,
      ComputationStepExecutor.class,

      // messages/warnings
      CeTaskMessagesImpl.class,
      FileSourceDataWarnings.class,

      // File System
      new ComputationTempFolderProvider(),

      DbMigrationModule.class,
      ReportModulesPath.class,
      MetricModule.class,

      // holders
      AnalysisMetadataHolderImpl.class,
      CrossProjectDuplicationStatusHolderImpl.class,
      BatchReportDirectoryHolderImpl.class,
      TreeRootHolderImpl.class,
      PeriodHolderImpl.class,
      QualityGateHolderImpl.class,
      QualityGateStatusHolderImpl.class,
      RatingSettings.class,
      ActiveRulesHolderImpl.class,
      MeasureComputersHolderImpl.class,
      MutableTaskResultHolderImpl.class,
      BatchReportReaderImpl.class,
      MergeAndTargetBranchComponentUuids.class,
      SiblingComponentsWithOpenIssues.class,

      // repositories
      LanguageRepositoryImpl.class,
      MeasureRepositoryImpl.class,
      EventRepositoryImpl.class,
      ConfigurationRepositoryImpl.class,
      DbIdsRepositoryImpl.class,
      DisabledComponentsHolderImpl.class,
      QualityGateServiceImpl.class,
      EvaluationResultTextConverterImpl.class,
      SourceLinesRepositoryImpl.class,
      SourceHashRepositoryImpl.class,
      SourceLinesDiffImpl.class,
      ScmInfoRepositoryImpl.class,
      ScmInfoDbLoader.class,
      DuplicationRepositoryImpl.class,
      SourceLinesHashRepositoryImpl.class,
      DbLineHashVersion.class,
      SignificantCodeRepository.class,
      SourceLinesHashCache.class,
      NewLinesRepository.class,
      FileSourceDataComputer.class,
      SourceLineReadersFactory.class,
      QProfileStatusRepositoryImpl.class,

      // issues
      RuleRepositoryImpl.class,
      ScmAccountToUserLoader.class,
      ScmAccountToUser.class,
      IssueCache.class,
      DefaultAssignee.class,
      IssueVisitors.class,
      IssueLifecycle.class,
      ComponentsWithUnprocessedIssues.class,
      ComponentIssuesRepositoryImpl.class,
      IssueFilter.class,

      // common rules
      CommonRuleEngineImpl.class,
      BranchCoverageRule.class,
      LineCoverageRule.class,
      CommentDensityRule.class,
      DuplicatedBlockRule.class,
      TestErrorRule.class,
      SkippedTestRule.class,

      // order is important: RuleTypeCopier must be the first one. And DebtAggregator must be before NewDebtAggregator (new debt requires
      // debt)
      RuleTagsCopier.class,
      IssueCreationDateCalculator.class,
      DebtCalculator.class,
      EffortAggregator.class,
      NewEffortAggregator.class,
      IssueAssigner.class,
      IssueCounter.class,
      MovedIssueVisitor.class,
      IssuesRepositoryVisitor.class,
      RemoveProcessedComponentsVisitor.class,

      // visitors : order is important, measure computers must be executed at the end in order to access to every measures / issues
      LoadComponentUuidsHavingOpenIssuesVisitor.class,
      IntegrateIssuesVisitor.class,
      CloseIssuesOnRemovedComponentsVisitor.class,
      MaintainabilityMeasuresVisitor.class,
      NewMaintainabilityMeasuresVisitor.class,
      ReliabilityAndSecurityRatingMeasuresVisitor.class,
      NewReliabilityAndSecurityRatingMeasuresVisitor.class,
      LastCommitVisitor.class,
      MeasureComputersVisitor.class,

      UpdateConflictResolver.class,
      TrackerBaseInputFactory.class,
      TrackerRawInputFactory.class,
      TrackerMergeOrTargetBranchInputFactory.class,
      ClosedIssuesInputFactory.class,
      Tracker.class,
      TrackerExecution.class,
      ShortBranchOrPullRequestTrackerExecution.class,
      MergeBranchTrackerExecution.class,
      ComponentIssuesLoader.class,
      BaseIssuesLoader.class,
      IssueTrackingDelegator.class,
      BranchPersisterImpl.class,
      SiblingsIssuesLoader.class,
      SiblingsIssueMerger.class,

      // filemove
      ScoreMatrixDumperImpl.class,
      SourceSimilarityImpl.class,
      FileSimilarityImpl.class,
      MutableMovedFilesRepositoryImpl.class,
      AddedFileRepositoryImpl.class,

      // duplication
      IntegrateCrossProjectDuplications.class,
      DuplicationMeasures.class,

      // views
      ViewIndex.class,

      BranchLoader.class,
      MeasureToMeasureDto.class,
      SmallChangesetQualityGateSpecialCase.class,

      // webhooks
      WebhookPostTask.class,

      // notifications
      NotificationFactory.class);
  }
1154312
public int getPredictedClass(){
        if(predictedClass == -1){
            if(classPredictions.rank() == 1){
                predictedClass = classPredictions.argMax().getInt(0);
            } else {
                // ravel in case we get a column vector, or rank 2 row vector, etc
                predictedClass = classPredictions.ravel().argMax().getInt(0);
            }
        }
        return predictedClass;
    }
834808
def _getSuitableClasses(self, data, imageDosHeader):
        """"""
        classes = None
        machine = IMAGE_FILE_MACHINE[c_ushort.from_buffer(data,imageDosHeader.header.e_lfanew+4).value]

        if machine == IMAGE_FILE_MACHINE.I386:
            classes = PE32
        elif machine == IMAGE_FILE_MACHINE.AMD64:
            classes = PE64

        return classes
277761
function class_list() {
  skip_horiz_white();
  classes = [];
  while (look(ident_chain_pattern)) {
    classes.push(ident_chain());
    skip_horiz_white();
  }
  
  return classes;
}
31281
def get_suitable_vis_classes(obj):
    """"""

    ret = []
    for class_ in classes_vis():
        if isinstance(obj, class_.input_classes):
            ret.append(class_)
    return ret
927855
def get_class_list(cls) -> DOMTokenList:
        """"""
        cl = []
        cl.append(DOMTokenList(cls, cls.class_))
        if cls.inherit_class:
            for base_cls in cls.__bases__:
                if issubclass(base_cls, WdomElement):
                    cl.append(base_cls.get_class_list())
        # Reverse order so that parent's class comes to front  <- why?
        cl.reverse()
        return DOMTokenList(cls, *cl)
640003
def get_nehrp_classes(self, sites):
        

        classes = sorted(self.NEHRP_VS30_UPPER_BOUNDS.keys())
        bounds = [self.NEHRP_VS30_UPPER_BOUNDS[item] for item in classes]
        bounds = np.reshape(np.array(bounds), (-1, 1))
        vs30s = np.reshape(sites.vs30, (1, -1))
        site_classes = np.choose((vs30s < bounds).sum(axis=0) - 1, classes)

        return site_classes.astype('object')
829075
protected List<Class> getClassCache(Class cls, String pkgname) {
    return m_CacheClasses.get(cls.getName() + "-" + pkgname);
  }
79752
function (predictionAndLabels) {
        var jvmObject;
        this.logger = Logger.getLogger("MulticlassMetrics_js");
        if (predictionAndLabels instanceof org.apache.spark.mllib.evaluation.MulticlassMetrics) {
            jvmObject = predictionAndLabels;
        } else {
            jvmObject = new org.apache.spark.mllib.evaluation.MulticlassMetrics(Utils.unwrapObject(predictionAndLabels).rdd());
        }


        JavaWrapper.call(this, jvmObject);

    }
1037404
function _checkRefsInClasses (context) {
  for (const key of Object.keys(context.classes)) {
    const classNode = context.classes[key]

    if (_isImportNode(classNode)) {
      return null
    }

    const location = `Class.${classNode.label}.`

    let err = _checkPropertySpecs(context, classNode.propertySpecs)
    if (err) return `${location}${err}`

    if (classNode.subClassOf) {
      err = _checkClassReference(context, classNode.subClassOf)
      if (err) {
        return `${location}subClassOf ${err}`
      }
    }

    if (classNode.excludeParentProperties) {
      for (const parentProp of classNode.excludeParentProperties) {
        err = _checkPropertyReference(context, parentProp)
        if (err) return err
      }
    }
  }
}
184769
private double[] knnDistances(O object) {
    KNNList knns = knnq.getKNNForObject(object, getKmax() - 1);
    double[] distances = new double[getKmax()];
    int i = 0;
    for(DoubleDBIDListIter iter = knns.iter(); iter.valid() && i < getKmax(); iter.advance(), i++) {
      distances[i] = iter.doubleValue();
    }
    return distances;
  }