Inspect the result of the CifSelectCalculation, verifying that it produced a CifData output node.
487027
def inspect_select_calculation(self):
        """"""
        try:
            node = self.ctx.cif_select
            self.ctx.cif = node.outputs.cif
        except exceptions.NotExistent:
            self.report('aborting: CifSelectCalculation<{}> did not return the required cif output'.format(node.uuid))
            return self.exit_codes.ERROR_CIF_SELECT_FAILED
1364399
def on_open_output_tool_clicked(self):
        
        output_path = self.output_path.text()
        if not output_path:
            output_path = os.path.expanduser('~')
        # noinspection PyCallByClass,PyTypeChecker
        filename, __ = QFileDialog.getSaveFileName(
            self, tr('Output file'), output_path, tr('Raster file (*.tif)'))
        if filename:
            self.output_path.setText(filename)
606227
def _output_results(
            self):
        
        self.log.info('starting the ``_output_results`` method')

        content = ""
        maxNameLen = 0

        for r in self.results:
            if maxNameLen < len(r["ned_name"]):
                maxNameLen = len(r["ned_name"])

        if len(self.results) == 0:
            content += "No resuls found"
        else:
            thisHeader = "| "
            thisLine = "| "
            for head in self.headers:
                if head == "ned_name":
                    s = maxNameLen
                else:
                    s = self.resultSpacing
                thisHeader += str(head).ljust(s,
                                              ' ') + " | "
                thisLine += ":".ljust(s,
                                      '-') + " | "
            content += thisHeader
            content += "\n" + thisLine
            for r in self.results:
                thisRow = "| "
                for head in self.headers:
                    if head == "ned_name":
                        s = maxNameLen
                    else:
                        s = self.resultSpacing
                    thisRow += str(r[head]).ljust(s,
                                                  ' ') + " | "
                content += "\n" + thisRow

        if self.quiet == False:
            print content
        if self.outputFilePath:
            import codecs
            writeFile = codecs.open(
                self.outputFilePath, encoding='utf-8', mode='w')
            writeFile.write(content)
            writeFile.close()

        self.log.info('completed the ``_output_results`` method')
        return None
29848
def _fetch_output_files(self, retrieved):
        
        from aiida.common.datastructures import calc_states
        from aiida.common.exceptions import InvalidOperation
        import os

        # check in order not to overwrite anything
        #         state = self._calc.get_state()
        #         if state != calc_states.PARSING:
        #             raise InvalidOperation("Calculation not in {} state"
        #                                    .format(calc_states.PARSING) )

        # Check that the retrieved folder is there
        try:
            out_folder = retrieved[self._calc._get_linkname_retrieved()]
        except KeyError:
            raise IOError("No retrieved folder found")

        list_of_files = out_folder.get_folder_list()

        output_path = None
        error_path = None

        if self._calc._DEFAULT_OUTPUT_FILE in list_of_files:
            output_path = os.path.join(out_folder.get_abs_path('.'),
                                       self._calc._DEFAULT_OUTPUT_FILE)
        if self._calc._DEFAULT_ERROR_FILE in list_of_files:
            error_path = os.path.join(out_folder.get_abs_path('.'),
                                      self._calc._DEFAULT_ERROR_FILE)

        return output_path, error_path
93994
def getOutput(self, command, env={}, path=None,
                  uid=None, gid=None, usePTY=0, childFDs=None):
        
        deferred = defer.Deferred()
        processProtocol = _SummaryProcessProtocol(deferred)
        self.execute(processProtocol, command, env,
                     path, uid, gid, usePTY, childFDs)
        @deferred.addCallback
        def getStdOut(tuple_):
            stdout, _stderr, _returnCode = tuple_
            return stdout
        return deferred
671919
def results(analyser)
      r = analyser.results
      [0, nil].map do |val|
        r.select { |node, runs| runs == val }
         .keys
         .map(&:source)
      end
    end
597403
def dump_results(self, success):
        
        system = self.system

        t, _ = elapsed()

        if success and (not system.files.no_output):

            # system.varout.dump()
            system.varout.dump_np_vars()
            _, s = elapsed(t)
            logger.info('Simulation data dumped in {:s}.'.format(s))
1031015
protected void computeOutput() {
		outputRegionId.reset();
		outputRegionSizes.reset();
		for( int y = 0; y < graph.height; y++ ) {
			int indexGraph = graph.startIndex + y*graph.stride;
			for( int x = 0; x < graph.width; x++ , indexGraph++) {
				int parent = graph.data[indexGraph];
				if( parent == indexGraph ) {
					outputRegionId.add(indexGraph);
					outputRegionSizes.add(regionSize.get(indexGraph));
				} else {
					// find the parent and set the child to it
					int child = indexGraph;
					while( parent != child ) {
						child = parent;
						parent = graph.data[child];
					}
					graph.data[indexGraph] = parent;
				}
			}
		}
	}
201082
def _detect(self):
        
        results = []
        for c in self.slither.contracts:
            for f in c.functions + c.modifiers:
                if f.contract != c:
                    continue
                unused_return = self.detect_unused_return_values(f)
                if unused_return:
                    info = "{}.{} ({}) does not use the value returned by external calls:\n"
                    info = info.format(f.contract.name,
                                       f.name,
                                       f.source_mapping_str)
                    for node in unused_return:
                        info += "\t-{} ({})\n".format(node.expression, node.source_mapping_str)

                    json = self.generate_json_result(info)
                    self.add_function_to_json(f, json)
                    self.add_nodes_to_json(unused_return, json)
                    results.append(json)

        return results
1155591
def output_callback(self, out, process_status):
        
        self.final_status.append(process_status)
        self.final_output.append(out)
468663
def parse_from_calc(self):
        
        from aiida.common.exceptions import InvalidOperation
        from aiida.common import aiidalogger
        from aiida.backends.djsite.utils import get_dblogger_extra

        import ase, ase.io

        parserlogger = aiidalogger.getChild('aseparser')
        logger_extra = get_dblogger_extra(self._calc)

        # suppose at the start that the job is successful
        successful = True

        # check that calculation is in the right state
        state = self._calc.get_state()
        if state != calc_states.PARSING:
            raise InvalidOperation("Calculation not in {} state"
                                   .format(calc_states.PARSING) )

        # select the folder object
        out_folder = self._calc.get_retrieved_node()

        # check what is inside the folder
        list_of_files = out_folder.get_folder_list()

        # at least the stdout should exist
        if not self._calc._OUTPUT_FILE_NAME in list_of_files:
            successful = False
            parserlogger.error("Standard output not found",extra=logger_extra)
            return successful,()

        # output structure
        has_out_atoms = True if self._calc._output_aseatoms in list_of_files else False
        if has_out_atoms:
            out_atoms = ase.io.read( out_folder.get_abs_path( self._calc._output_aseatoms ) )
            out_structure = StructureData().set_ase(out_atoms)

        # load the results dictionary
        json_outfile = out_folder.get_abs_path( self._calc._OUTPUT_FILE_NAME )
        with open(json_outfile,'r') as f:
            json_params = json.load(f)

        # extract arrays from json_params
        dictionary_array = {}
        for k,v in list(json_params.iteritems()):
            if isinstance(v, (list,tuple)):
                dictionary_array[k] = json_params.pop(k)

        # look at warnings
        warnings = []
        with open(out_folder.get_abs_path( self._calc._SCHED_ERROR_FILE )) as f:
            errors = f.read()
        if errors:
            warnings = [errors]
        json_params['warnings'] = warnings

        # save the outputs
        new_nodes_list= []

        # save the arrays
        if dictionary_array:
            array_data = ArrayData()
            for k,v in dictionary_array.iteritems():
                array_data.set_array(k,numpy.array(v))
            new_nodes_list.append( (self._outarray_name, array_data) )

        # save the parameters
        if json_params:
            parameter_data = ParameterData( dict=json_params )
            new_nodes_list.append( (self._outdict_name, parameter_data) )

        if has_out_atoms:
            structure_data = StructureData()
            new_nodes_list.append( (self._outstruc_name, structure_data) )

        return successful,new_nodes_list
661141
def _result(self) -> ResultLazyType:
        
        config = cast(IntervalsCollectionBasedReplacerConfig, self.config)

        diff_acc = 0
        for interval, aggregated_mark in self.continuous_intervals():
            start, end = interval
            processed_start = start + diff_acc
            processed_end = end + diff_acc

            segment = self.input_sequence[start:end]

            if aggregated_mark is not None:
                processed_segment = config.labeler2repl[cast(Type[workflow.IntervalLabeler],
                                                             aggregated_mark)](segment)

                if not processed_segment:
                    # segment is removed.
                    processed_end = processed_start
                else:
                    processed_end = processed_start + len(processed_segment)

                diff_acc += len(processed_segment) - len(segment)
                segment = processed_segment

            yield segment, (interval, (processed_start, processed_end), aggregated_mark is not None)
1138905
def result_report_parameters(self):
        

        output = self.ui.data(field='Evaluated length', value=self.evaluated_length, unit='sec') + '\n'
        output += self.ui.data(field='Evaluated files', value=self.evaluated_files) + '\n'

        output += self.ui.data(field='Evaluate onset', value=self.evaluate_onset) + '\n'
        output += self.ui.data(field='Evaluate offset', value=self.evaluate_offset) + '\n'

        if self.t_collar < 1:
            output += self.ui.data(field='T collar', value=self.t_collar*1000, unit='ms') + '\n'

        else:
            output += self.ui.data(field='T collar', value=self.t_collar, unit='sec') + '\n'

        output += self.ui.data(field='Offset (length)', value=self.percentage_of_length*100, unit='%') + '\n'

        return output
291633
function(data) {
  var output = {
    name: data.fileName
  };

  var statements = _.without(data.lines, null);

  output.statementsTotal = statements.length;
  output.statementsCovered = _.compact(statements).length;
  output.percentage = percentage(output.statementsCovered, output.statementsTotal);

  if (this.options.branchTracking) {
    output = _.assign(output, branchCoverage(data));
  }
  return output;

}
25721
function benchmarkSelect(numLeft, callback) {
  //connection.query('query from fake server fixture', function(err, result) {

  // comment if no pool:
  next();

  let rows = 0;
  const q = connection.query('query from fake server fixture');
  q.on('result', () => {
    rows++;
  });
  q.on('end', () => {
    if (numLeft > 1) benchmarkSelect(numLeft - 1, callback);
    else callback(rows);
  });
}
366086
protected final function GatherOutput()
    {
        \header('Content-Type: application/json');
        try
        {
            $this->output = json_encode($this->result);
        }
        catch (\Exception $ex)
        {
            $this->AttachException($ex);
        }
    }
379705
def read_results(self):
        """"""
        
        if self.submited:
            # The job has been submitted. Check the state.
            if not self.job_ready() :
                if self.block :
                    while not self.job_ready() :
                        time.sleep(self.job_check_time)
                else :
                    raise CalcNotReadyError
                    

            # Assume the calc finished. Copy the files back.
            subprocess.call(self.copy_in_cmd % {
                'ldir': self.wdir,
                'rdir': os.path.join(self.parameters['rdir'],os.path.split(self.directory)[-1]),
                'user': self.parameters['user'],
                'host': self.parameters['host']
            }, shell=True)
                
        
        fn=os.path.join(self.directory,'pw.out')
        # Read the pan-ultimate line of the output file
        try: 
            ln=open(fn).readlines()[-2]
            if ln.find('JOB DONE.')>-1 :
                # Job is done we can read the output
                r=read_quantumespresso_textoutput(fn)
                self.submited=False
                self.jobid=None
            else :
                # Job not ready.
                raise CalcNotReadyError
        except (IOError, IndexError) :
            # Job not ready.
            raise CalcNotReadyError
        
        # All is fine - really read the results
        self.calc.read_results(self)