Get a previously calculated output
@param enforceExistence If true: throw an exception if the array does not exist
177070
public T get(String variable, String frame, int iteration, FrameIter parentFrameIter, boolean enforceExistence) {
        //TODO eventually we'll cache and reuse VarId objects here to avoid garbage generation on lookup etc
        VarId varId = newVarId(variable, frame, iteration, parentFrameIter);
        T out = nodeOutputs.get(varId);
        if(enforceExistence) {
            Preconditions.checkNotNull(out, "No output found for variable %s (frame %s, iteration %s)", variable, frame, iteration);
        }
        return out;
    }
910158
Output getDefaultOutput()
    {
        if (default_output != null)
            return default_output;

        if (parent_queue != null)
            return parent_queue.getDefaultOutput();

        return null;
    }
1290553
public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuilder(
      int index) {
    return violations_.get(index);
  }
1366100
public List<E> results() throws Exception {
        List<E> result = new ArrayList<E>(futures.size());
        for (ICompletableFuture<E> f : futures) {
            result.add(f.get());
        }
        return result;
    }
463276
public Object getResult(Object workingMemoryContext,
                            Object context,
                            Tuple leftTuple,
                            Declaration[] declarations,
                            WorkingMemory workingMemory) throws Exception {
        return ((CollectContext) context).result;
    }
1144579
private int doAfterRun(Map<String, Command> references) throws Exception
	{
		if (status == Command.COMMAND_EXECUTED)
		{
			// System.out.println("doAfterRun(): command " + getResultType() + "
			// processed...");
			Vector<Command> toBeRemoved = new Vector<Command>();
			try
			{
				Statement[] statements = null;

				for (int i = 0; i < operations.size(); ++i)
				{
					Command cmd = operations.elementAt(i);

					if (cmd.isArrayElement())
					{

						if (cmd.isResolved())
						{
							if (statements == null)
							{
								statements = new Statement[operations.size()];
							}
							statements[i] = new Statement(getResultValue(), "set", new Object[] { Integer.valueOf(i), //$NON-NLS-1$
									cmd.getResultValue() });
							if ((i + 1) == operations.size())
							{
								for (int j = 0; j < operations.size(); ++j)
								{
									statements[j].execute();
								}
								toBeRemoved.addAll(operations);
							}
						}
						else
						{
							break;
						}

					}
					else
					{
						// since the call is Array.set()
						if (!isArray())
						{
							cmd.setTarget(getResultValue());
						}
						cmd.exec(references);

						if (cmd.isResolved())
						{
							// System.out.println("doAfterRun(): cmd = " +
							// cmd.methodName + " is resolved");
							toBeRemoved.add(cmd);
						}
						else
						{
							// System.out.println("doAfterRun(): cmd = " +
							// cmd.methodName + " is unresolved");
							break;
						}

					}

				}
			}
			catch (Exception e)
			{
				throw new Exception(e);
			}
			finally
			{
				operations.removeAll(toBeRemoved);
			}

			// if (operations.size() == 0) {
			// System.out.println("doAfterRun(): command " + getResultType()
			// + " completely processed.");
			// } else {
			// System.out.println("doAfterRun(): command " + getResultType()
			// + " contains incomplete " +
			// operations.size() + " commands.");
			// }
			return (operations.size() == 0) ? Command.CHILDREN_PROCESSED : status;
		}
		return status;
	}
649107
public void execute( EnforcerRuleHelper helper )
        throws EnforcerRuleException
    {

        if ( !allowNulls && files.length == 0 )
        {
            throw new EnforcerRuleException( "The file list is empty and Null files are disabled." );
        }

        List<File> failures = new ArrayList<File>();
        for ( File file : files )
        {
            if ( !allowNulls && file == null )
            {
                failures.add( file );
            }
            else if ( !checkFile( file ) )
            {
                failures.add( file );
            }
        }

        // if anything was found, log it with the optional message.
        if ( !failures.isEmpty() )
        {
            String message = getMessage();
            
            StringBuilder buf = new StringBuilder();
            if ( message != null )
            {
                buf.append( message + "\n" );
            }
            buf.append( getErrorMsg() );

            for ( File file : failures )
            {
                if ( file != null )
                {
                    buf.append( file.getAbsolutePath() + "\n" );
                }
                else
                {
                    buf.append( "(an empty filename was given and allowNulls is false)\n" );
                }
            }

            throw new EnforcerRuleException( buf.toString() );
        }
    }
891780
public com.google.rpc.PreconditionFailure.Violation getViolations(int index) {
    return violations_.get(index);
  }
695023
public double getExpectationAt(int index){
		if(index <0 || index>=expectations.getObservationCount())
			throw new IndexOutOfBoundsException();
		return expectations.getValueAt(index);
	}
1322010
@Override
    public T get() throws InterruptedException, ExecutionException {
        // when get returns without an exception the synchronisation is complete
        // and else the exception will be thrown
        if (isInitialized()) {
            synchronisationFuture.get();
        }
        return internalFuture.get();
    }
237063
function getConstantViolationsBefore(binding, path, functions) {
  var violations = binding.constantViolations.slice();
  violations.unshift(binding.path);
  return violations.filter(function (violation) {
    violation = violation.resolve();
    var status = violation._guessExecutionStatusRelativeTo(path);
    if (functions && status === "function") functions.push(violation);
    return status === "before";
  });
}
524199
private String[] getExpectedRow( TableIterator<String[]> tableRowIterator, DateTime expectedDT ) throws IOException {
        while( tableRowIterator.hasNext() ) {
            String[] row = tableRowIterator.next();
            DateTime currentTimestamp = formatter.parseDateTime(row[1]);
            if (currentTimestamp.equals(expectedDT)) {
                if (pNum == 1) {
                    return row;
                } else {
                    String[][] allRows = new String[pNum][];
                    allRows[0] = row;
                    int rowNum = 1;
                    for( int i = 1; i < pNum; i++ ) {
                        if (tableRowIterator.hasNext()) {
                            String[] nextRow = tableRowIterator.next();
                            allRows[i] = nextRow;
                            rowNum++;
                        }
                    }
                    // now aggregate
                    String[] aggregatedRow = new String[row.length];
                    // date is the one of the first instant
                    aggregatedRow[0] = allRows[0][0];
                    aggregatedRow[1] = allRows[0][1];
                    for( int col = 2; col < allRows[0].length; col++ ) {

                        boolean hasOne = false;
                        switch( pAggregation ) {
                        case 0:
                            double sum = 0;
                            for( int j = 0; j < rowNum; j++ ) {
                                String valueStr = allRows[j][col];
                                if (!valueStr.equals(fileNovalue)) {
                                    double value = Double.parseDouble(valueStr);
                                    sum = sum + value;
                                    hasOne = true;
                                }
                            }
                            if (!hasOne) {
                                sum = doubleNovalue;
                            }
                            aggregatedRow[col] = String.valueOf(sum);
                            break;
                        case 1:
                            double avg = 0;
                            for( int j = 0; j < rowNum; j++ ) {
                                String valueStr = allRows[j][col];
                                if (!valueStr.equals(fileNovalue)) {
                                    double value = Double.parseDouble(valueStr);
                                    avg = avg + value;
                                    hasOne = true;
                                }
                            }
                            if (!hasOne) {
                                avg = doubleNovalue;
                            } else {
                                avg = avg / pNum;
                            }
                            aggregatedRow[col] = String.valueOf(avg);
                            break;

                        default:
                            break;
                        }

                    }
                    return aggregatedRow;
                }
            } else if (currentTimestamp.isBefore(expectedDT)) {
                // browse until the instant is found
                continue;
            } else if (currentTimestamp.isAfter(expectedDT)) {
                /*
                 * lost the moment, for now throw exception.
                 * Could be enhanced in future.
                 */
                String message = "The data are not aligned with the simulation interval (" + currentTimestamp + "/" + expectedDT
                        + "). Check your data file: " + file;
                throw new IOException(message);
            }

        }
        return null;
    }
1087988
@Override
    public void doExecute() throws MojoExecutionException, MojoFailureException {
        if (!ignoreResultFailures && !scanResultsForFailedRequests) {
            getLog().warn(String.format(
                    "current value of scanResultsForFailedRequests(%s) is incompatible with ignoreResultFailures(%s), setting scanResultsForFailedRequests to true",
                    scanResultsForFailedRequests,
                    ignoreResultFailures
            ));
            scanResultsForFailedRequests = true;
        }
        if (scanResultsForSuccessfulRequests || scanResultsForFailedRequests) {
            getLog().info(" ");
            getLog().info(LINE_SEPARATOR);
            getLog().info("S C A N N I N G    F O R    R E S U L T S");
            getLog().info(LINE_SEPARATOR);
            getLog().info(" ");
            TestConfig testConfig = new TestConfig(new File(testConfigFile));
            String resultFormat = testConfig.getResultsOutputIsCSVFormat() ? "CSV" : "JTL";
            getLog().info(String.format("Will scan results using format: %s", resultFormat));
            ResultScanner resultScanner = new ResultScanner(
                    scanResultsForSuccessfulRequests,
                    scanResultsForFailedRequests,
                    testConfig.getResultsOutputIsCSVFormat()
            );
            for (String resultFileLocation : testConfig.getResultsFileLocations()) {
                resultScanner.parseResultFile(new File(resultFileLocation));
            }
            getLog().info(" ");
            getLog().info(LINE_SEPARATOR);
            getLog().info("P E R F O R M A N C E    T E S T    R E S U L T S");
            getLog().info(LINE_SEPARATOR);
            getLog().info(" ");
            getLog().info(String.format("Result (.%s) files scanned: %s", resultFormat.toLowerCase(), testConfig.getResultsFileLocations().size()));
            getLog().info(String.format("Successful requests:         %s", resultScanner.getSuccessCount()));
            getLog().info(String.format("Failed requests:             %s", resultScanner.getFailureCount()));
            TestFailureDecider decider = new TestFailureDecider(ignoreResultFailures, errorRateThresholdInPercent, resultScanner);
            decider.runChecks();
            getLog().info(String.format("Failures:                    %s%% (%s%% accepted)", decider.getErrorPercentage(), decider.getErrorPercentageThreshold()));
            getLog().info(" ");
            if (decider.failBuild()) {
                throw new MojoFailureException(String.format(
                        "Failing build because error percentage %s is above accepted threshold %s. JMeter logs are available at: '%s'",
                        logsDirectory.getAbsolutePath(),
                        decider.getErrorPercentage(),
                        decider.getErrorPercentageThreshold()
                ));
            }
        } else {
            getLog().info(" ");
            getLog().info("Results of Performance Test(s) have not been scanned.");
            getLog().info(" ");
        }
    }
393938
public int totalCount(int outputNum) {
        assertIndex(outputNum);
        return countTruePositive[outputNum] + countTrueNegative[outputNum] + countFalseNegative[outputNum]
                        + countFalsePositive[outputNum];
    }
1293289
final int recordExceptionalCompletion(Throwable ex) {
        int s;
        if ((s = status) >= 0) {
            int h = System.identityHashCode(this);
            final ReentrantLock lock = exceptionTableLock;
            lock.lock();
            try {
                expungeStaleExceptions();
                ExceptionNode[] t = exceptionTable;
                int i = h & (t.length - 1);
                for (ExceptionNode e = t[i]; ; e = e.next) {
                    if (e == null) {
                        t[i] = new ExceptionNode(this, ex, t[i]);
                        break;
                    }
                    if (e.get() == this) // already present
                        break;
                }
            } finally {
                lock.unlock();
            }
            s = setCompletion(EXCEPTIONAL);
        }
        return s;
    }
41319
def get_output(self, include_exceptions=False):
        
        # Order all rendered items in the correct sequence.
        # Don't assume the derived tables are in perfect shape, hence the dict + KeyError handling.
        # The derived tables could be truncated/reset or store_output() could be omitted.
        ordered_output = []
        for item_id in self.output_ordering:
            contentitem = self.item_source[item_id]
            try:
                output = self.item_output[item_id]
            except KeyError:
                # The item was not rendered!
                if not include_exceptions:
                    continue

                output = self.MISSING
            else:
                # Filter exceptions out.
                if not include_exceptions:
                    if isinstance(output, Exception) or output is self.SKIPPED:
                        continue

            ordered_output.append((contentitem, output))

        return ordered_output
1219626
public function getViolations($ignoredVioltations=null)
    {
        if (!$this->isValidated())
            throw new StoreException("You must call validate() method before.",
                StoreException::STORE_002);

        if (!is_array($ignoredVioltations)) {
            return $this->violations;
        }

        /**
         * Ignore violation by property path
         */
        $violations = array();
        foreach ($this->getViolations() as $violation) {
            if (!in_array($violation->getPropertyPath(), $ignoredVioltations)) {
                $violations[] = $violation;
            }
        }

        return $violations;
    }