Gather analysis result required by this analysis
343370
def prepare(self, node):
        ''''''
        if isinstance(node, ast.Module):
            self.ctx.module = node
        elif isinstance(node, ast.FunctionDef):
            self.ctx.function = node

        for D in self.deps:
            d = D()
            d.attach(self.passmanager, self.ctx)
            result = d.run(node)
            setattr(self, uncamel(D.__name__), result)
130692
def analyze(self, filename):
        """"""
        if self.dockwidget and not self.ismaximized:
            self.dockwidget.setVisible(True)
            self.dockwidget.setFocus()
            self.dockwidget.raise_()
        self.pylint.analyze(filename)
671919
def results(analyser)
      r = analyser.results
      [0, nil].map do |val|
        r.select { |node, runs| runs == val }
         .keys
         .map(&:source)
      end
    end
60675
def get_analytic(user, job_id, anc_id):
    """"""

    v1_utils.verify_existence_and_get(job_id, models.JOBS)
    analytic = v1_utils.verify_existence_and_get(anc_id, _TABLE)
    analytic = dict(analytic)
    if not user.is_in_team(analytic['team_id']):
        raise dci_exc.Unauthorized()
    return flask.jsonify({'analytic': analytic})
1256220
def getAnalysisRequestBySample(self):
        
        # rows will contain the data for each html row
        rows = []
        # columns will be used to sort and define the columns
        columns = {
            'column_order': [
                'sample_id',
                'sample_type',
                'sampling_point',
                'sampling_date',
                'analyses',
                ],
            'titles': {
                'sample_id': _('Sample ID'),
                'sample_type': _('Sample Type'),
                'sampling_point': _('Sampling Point'),
                'sampling_date': _('Sampling Date'),
                'analyses': _('Analysis'),
            }
        }
        ars = self.context.getAnalysisRequests()
        for ar in ars:
            ar = ar.getObject()
            arcell = False
            analyses = ar.getAnalyses()
            numans = len(analyses)
            for analysis in analyses:
                row = {
                    'sample_id': {
                        'hidden': True if arcell else False,
                        'rowspan': numans,
                        'value': ar.getId(),
                        },
                    'sample_type': {
                        'hidden': True if arcell else False,
                        'rowspan': numans,
                        'value': ar.getSampleType().title,
                        },
                    'sampling_point': {
                        'hidden': True if arcell else False,
                        'rowspan': numans,
                        'value': ar.getSamplePoint().title if ar.getSamplePoint() else '',
                        },
                    'sampling_date': {
                        'hidden': True if arcell else False,
                        'rowspan': numans,
                        'value': self.context.sampling_date,
                        },
                    'analyses': {
                        'title': analysis.title,
                        'units': analysis.getUnit,
                    },
                }
                rows.append(row)
                arcell = True

        # table will contain the data that from where the html
        # will take the info
        table = {
            'columns': columns,
            'rows': rows,
        }
        return table
721720
def after_receive(analysis_request):
    
    # Mark this analysis request as IReceived
    alsoProvides(analysis_request, IReceived)

    analysis_request.setDateReceived(DateTime())
    do_action_to_analyses(analysis_request, "initialize")
1281599
def analysis_output(self, location: Optional[str] = None) -> None:
        
        try:
            if not location:
                location = self.prompt(
                    "Analysis results: ",
                    history_key="analysis_results",
                    completer=PathCompleter(),
                )
            self.current_analysis_output = AnalysisOutput.from_str(location)
        except AnalysisOutputError as e:
            raise UserError(f"Error loading results: {e}")
871919
def run(self):
    """"""
    while not self._abort:
      hashes = self._GetHashes(self._hash_queue, self.hashes_per_batch)
      if hashes:
        time_before_analysis = time.time()
        hash_analyses = self.Analyze(hashes)
        current_time = time.time()
        self.seconds_spent_analyzing += current_time - time_before_analysis
        self.analyses_performed += 1
        for hash_analysis in hash_analyses:
          self._hash_analysis_queue.put(hash_analysis)
          self._hash_queue.task_done()
        time.sleep(self.wait_after_analysis)
      else:
        # Wait for some more hashes to be added to the queue.
        time.sleep(self.EMPTY_QUEUE_WAIT_TIME)
1166164
def analysis(self):
        """"""
        if self._analysis is None:
            with open(self.path, 'rb') as f:
                self.read_analysis(f)
        return self._analysis
734136
def collect_analysis(using):
    
    python_analysis = defaultdict(dict)
    for index in registry.indexes_for_connection(using):
        python_analysis.update(index._doc_type.mapping._collect_analysis())

    return stringer(python_analysis)
340610
def analyse(string = nil)
      raise(ArgumentError, 'Lexer: failed to start analysis: no source given!') unless
        string || @scanner

      self.data = string || @scanner.string

      until @scanner.eos?
        send("parse_#{MODE[@mode]}")
      end

      push([false, '$end'])
    end
724591
def run_analysis(self, argv):
        """"""
        args = self._parser.parse_args(argv)


        sedfile = args.sed_file

        if is_not_null(args.config):
            configfile = os.path.join(os.path.dirname(sedfile), args.config)
        else:
            configfile = os.path.join(os.path.dirname(sedfile), 'config.yaml')

        nbins = _get_enum_bins(configfile)

        first = args.seed
        last = first + args.nsims
        flist = [sedfile.replace("_SEED.fits", "_%06i.fits" % seed)
                 for seed in range(first, last)]
        outfile = args.outfile
        summaryfile = args.summaryfile


        outtable = fill_output_table(
            flist, "SED", CollectSED.collist, nbins=nbins)

        if is_not_null(outfile):
            outtable.write(outfile)

        if is_not_null(summaryfile):
            summary = summarize_sed_results(outtable)
            summary.write(summaryfile)
749053
def analyses():
    """"""
    per_page = int(request.args.get('per_page', 50))
    page = int(request.args.get('page', 1))
    query = store.analyses(status=request.args.get('status'),
                           query=request.args.get('query'),
                           is_visible=request.args.get('is_visible') == 'true' or None)

    query_page = query.paginate(page, per_page=per_page)
    data = []
    for analysis_obj in query_page.items:
        analysis_data = analysis_obj.to_dict()
        analysis_data['user'] = analysis_obj.user.to_dict() if analysis_obj.user else None
        analysis_data['failed_jobs'] = [job_obj.to_dict() for job_obj in analysis_obj.failed_jobs]
        data.append(analysis_data)

    return jsonify(analyses=data)
736790
def parse_result(self, data):
        """"""
        def valid_score(score):
            return "" if score is None else score

        return self.Result(
            data["homeTeam"]["name"],
            valid_score(data["score"]["fullTime"]["homeTeam"]),
            data["awayTeam"]["name"],
            valid_score(data["score"]["fullTime"]["awayTeam"]))
910971
def _get_result(future, pipe, timeout):
    """"""
    counter = count(step=SLEEP_UNIT)

    try:
        while not pipe.poll(SLEEP_UNIT):
            if timeout is not None and next(counter) >= timeout:
                return TimeoutError('Task Timeout', timeout)
            elif future.cancelled():
                return CancelledError()

        return pipe.recv()
    except (EOFError, OSError):
        return ProcessExpired('Abnormal termination')
    except Exception as error:
        return error
661126
def pass_result(db: JobDB, always_cache=False):
    """"""
    @pull
    def pass_result_stream(worker_source):
        """Pull stream instance created by `pass_result`."""
        for result in worker_source():
            if result is EndOfQueue:
                return

            attached = db.store_result_in_db(
                result, always_cache=always_cache)

            yield result
            yield from (ResultMessage(key, 'attached', result.value, None)
                        for key in attached)

    return pass_result_stream
245612
def run_analysis(self, argv):
        """"""
        args = self._parser.parse_args(argv)

        if is_null(args.config):
            raise ValueError("Config yaml file must be specified")
        if is_null(args.rand_config):
            raise ValueError(
                "Random direction config yaml file must be specified")
        config = load_yaml(args.config)
        rand_config = load_yaml(args.rand_config)

        wcsgeom = self._make_wcsgeom_from_config(config)
        dir_dict = self._build_skydir_dict(wcsgeom, rand_config)

        if is_not_null(args.outfile):
            write_yaml(dir_dict, args.outfile)