对多个样本进行分类，返回前n个分类内部结果
标签为内部表示索引，需要还原处理
@param instances
@param n 返回结果个数
@return
333645
public TPredict[] classify(InstanceSet instances, int n) {
		TPredict[] ress = new TPredict[instances.size()];
		for(int i=0;i<instances.size();i++){
			ress[i] = classify(instances.get(i), n);
		}
		return ress;
	}
1291707
public List<Object> stepsInstances(List<CandidateSteps> candidateSteps) {
        List<Object> instances = new ArrayList<>();
        for (CandidateSteps steps : candidateSteps) {
            if (steps instanceof Steps) {
                instances.add(((Steps) steps).instance());
            }
        }
        return instances;
    }
865740
public static void index(final List<Instance> _instances)
        throws EFapsException
    {
        Indexer.index(new IndexContext().setAnalyzer(Index.getAnalyzer()).setDirectory(Index.getDirectory())
                        .setLanguage(Context.getThreadContext().getLanguage())
                        .setCompanyId(Context.getThreadContext().getCompany().getId()), _instances);
    }
830581
private Group get_group_i(final String n, final boolean fwd) {
	final GroupElement e = find_i(n, fwd);
	return e != null && e instanceof Group ? (Group) e : null;
    }
925324
public void setInstanceGroups(java.util.Collection<InstanceGroupDetail> instanceGroups) {
        if (instanceGroups == null) {
            this.instanceGroups = null;
            return;
        }

        this.instanceGroups = new com.amazonaws.internal.SdkInternalList<InstanceGroupDetail>(instanceGroups);
    }
713013
public int getMinimumNumberOfInstances(final InstanceType instanceType) {

		final Integer val = this.minimumMap.get(instanceType);
		if (val != null) {
			return val.intValue();
		}

		return 0;
	}
851544
public java.util.List<InstanceStateChange> getStoppingInstances() {
        if (stoppingInstances == null) {
            stoppingInstances = new com.amazonaws.internal.SdkInternalList<InstanceStateChange>();
        }
        return stoppingInstances;
    }
1117538
@Override
    public Collection<? extends NameClassPair> listInstances(JavaColonNamespace namespace, String nameInContext) throws NamingException {
        ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        J2EEName j2eeName = cmd.getJ2EEName();
        Collection<? extends NameClassPair> instances;
        if (JavaColonNamespace.APP.equals(namespace) || JavaColonNamespace.GLOBAL.equals(namespace)) {
            try {
                ClientSupport jndiHelper = clientSupportFactory.getRemoteClientSupport();
                instances = jndiHelper.listRemoteInstances(j2eeName.getApplication(), j2eeName.getModule(), j2eeName.getComponent(), namespace.toString(), nameInContext);
            } catch (RemoteException ex) {
                //ffdc
                instances = Collections.emptyList();
            }
        } else {
            instances = Collections.emptyList();
        }
        return instances;
    }
593447
public java.util.List<InstanceFleet> getInstanceFleets() {
        if (instanceFleets == null) {
            instanceFleets = new com.amazonaws.internal.SdkInternalList<InstanceFleet>();
        }
        return instanceFleets;
    }
402085
def instances_set(self, root, reservation):
        
        instances = []
        for instance_data in root.find("instancesSet"):
            instances.append(self.instance(instance_data, reservation))
        return instances
1091003
public ListInstancesResponse listInstances(ListInstancesRequest request) {
        checkNotNull(request, "request should not be null.");
        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, INSTANCE_PREFIX);
        if (request.getMarker() != null) {
            internalRequest.addParameter("marker", request.getMarker());
        }
        if (request.getMaxKeys() > 0) {
            internalRequest.addParameter("maxKeys", String.valueOf(request.getMaxKeys()));
        }
        if (!Strings.isNullOrEmpty(request.getInternalIp())) {
            internalRequest.addParameter("internalIp", request.getInternalIp());
        }
        if (!Strings.isNullOrEmpty(request.getDedicatedHostId())) {
            internalRequest.addParameter("dedicatedHostId", request.getDedicatedHostId());
        }
        if (!Strings.isNullOrEmpty(request.getZoneName())) {
            internalRequest.addParameter("zoneName", request.getZoneName());
        }
        return invokeHttpClient(internalRequest, ListInstancesResponse.class);
    }
1279429
public java.util.List<String> getInstancesToProtect() {
        if (instancesToProtect == null) {
            instancesToProtect = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return instancesToProtect;
    }
494122
public static PermutationMatrix getInstance(int n)
    {
        PermutationMatrix pm = map.get(n);
        if (pm == null)
        {
            pm = new PermutationMatrix(n);
            map.put(n, pm);
        }
        return pm;
    }
765111
public Instances samoaInstances(weka.core.Instances instances) {
        Instances samoaInstances = samoaInstancesInformation(instances);
        //We assume that we have only one samoaInstanceInformation for WekaToSamoaInstanceConverter
        this.samoaInstanceInformation = samoaInstances;
        for (int i = 0; i < instances.numInstances(); i++) {
            samoaInstances.add(samoaInstance(instances.instance(i)));
        }
        return samoaInstances;
    }
1215189
public ListInstancesResponse listInstances(ListInstancesRequest request) {
        checkNotNull(request, "request should not be null.");
        checkStringNotEmpty(request.getClusterId(), "The parameter clusterId should not be null or empty string.");
        checkStringNotEmpty(request.getInstanceGroupId(),
                "The parameter instanceGroupId should not be null or empty string.");

        InternalRequest internalRequest = this.createRequest(
                request, HttpMethodName.GET, CLUSTER, request.getClusterId(), INSTANCE_GROUP,
                request.getInstanceGroupId(), INSTANCE);

        return this.invokeHttpClient(internalRequest, ListInstancesResponse.class);
    }
274176
@SuppressWarnings("rawtypes")
    public void evaluateInstanceList(TransducerTrainer tt, InstanceList data,
            String description) {
        Transducer model = tt.getTransducer();
        int numCorrectTokens, totalTokens;
        int[] numTrueSegments, numPredictedSegments, numCorrectSegments;
        int allIndex = segmentStartTags.length;
        numTrueSegments = new int[allIndex + 1];
        numPredictedSegments = new int[allIndex + 1];
        numCorrectSegments = new int[allIndex + 1];

        totalTokens = numCorrectTokens = 0;
        for (int n = 0; n < numTrueSegments.length; n++)
            numTrueSegments[n] = numPredictedSegments[n] = numCorrectSegments[n] = 0;
        for (int i = 0; i < data.size(); i++) {
            Instance instance = data.get(i);
            Sequence input = (Sequence) instance.getData();
            // String tokens = null;
            // if (instance.getSource() != null)
            // tokens = (String) instance.getSource().toString();
            Sequence trueOutput = (Sequence) instance.getTarget();
            assert (input.size() == trueOutput.size());
            Sequence predOutput = model.transduce(input);
            assert (predOutput.size() == trueOutput.size());
            int trueStart, predStart; // -1 for non-start, otherwise index into
                                      // segmentStartTag

            boolean hasIncorrect = false;
            StringBuilder sentencePrint = new StringBuilder();

            for (int j = 0; j < trueOutput.size(); j++) {
                totalTokens++;
                if (trueOutput.get(j).equals(predOutput.get(j))) {
                    numCorrectTokens++;
                    if (printMissclassified)
                        sentencePrint.append(getText(input, j) + " ");

                } else if (printMissclassified) {// not predicted correctly
                    hasIncorrect = true;
                    sentencePrint.append("{{" + getText(input, j) + "}} ");
                }

                trueStart = predStart = -1;
                // Count true segment starts
                for (int n = 0; n < segmentStartTags.length; n++) {
                    if (segmentStartTags[n].equals(trueOutput.get(j))) {
                        numTrueSegments[n]++;
                        numTrueSegments[allIndex]++;
                        trueStart = n;
                        break;
                    }
                }
                // Count predicted segment starts
                for (int n = 0; n < segmentStartTags.length; n++) {
                    if (segmentStartTags[n].equals(predOutput.get(j))) {
                        numPredictedSegments[n]++;
                        numPredictedSegments[allIndex]++;
                        predStart = n;
                    }
                }
                if (trueStart != -1 && trueStart == predStart) {
                    // Truth and Prediction both agree that the same segment
                    // tag-type is starting now
                    int m;
                    boolean trueContinue = false;
                    boolean predContinue = false;
                    for (m = j + 1; m < trueOutput.size(); m++) {
                        trueContinue = segmentContinueTags[predStart]
                                .equals(trueOutput.get(m));
                        predContinue = segmentContinueTags[predStart]
                                .equals(predOutput.get(m));
                        if (!trueContinue || !predContinue) {
                            if (trueContinue == predContinue) {
                                // They agree about a segment is ending somehow
                                numCorrectSegments[predStart]++;
                                numCorrectSegments[allIndex]++;
                            }
                            break;
                        }
                    }
                    // for the case of the end of the sequence
                    if (m == trueOutput.size()) {
                        if (trueContinue == predContinue) {
                            numCorrectSegments[predStart]++;
                            numCorrectSegments[allIndex]++;
                        }
                    }
                }
            }
            if (hasIncorrect && printMissclassified)
                System.out.println(sentencePrint.toString());
        }

        tokenAccuracy = ((double) numCorrectTokens) / totalTokens;
        for (int n = 0; n < numCorrectSegments.length; n++) {
            if (!(n < allIndex)) {// only "OVERALL"
                precision = numPredictedSegments[n] == 0 ? 1
                        : ((double) numCorrectSegments[n])
                                / numPredictedSegments[n];
                recall = numTrueSegments[n] == 0 ? 1
                        : ((double) numCorrectSegments[n]) / numTrueSegments[n];
                f1 = recall + precision == 0.0 ? 0.0
                        : (2.0 * recall * precision) / (recall + precision);
            }
        }
    }
195145
public void setInstanceIds(java.util.Collection<InstanceIdDetail> instanceIds) {
        if (instanceIds == null) {
            this.instanceIds = null;
            return;
        }

        this.instanceIds = new java.util.ArrayList<InstanceIdDetail>(instanceIds);
    }