Execute the actions necessary to perform a `molecule converge` and
        returns None.

        :return: None
325790
def execute(self):
        
        self.print_info()
        self._config.provisioner.converge()
        self._config.state.change_state('converged', True)
722697
def run(self):
        """"""

        # Load compound information
        def compound_name(id):
            if id not in self._model.compounds:
                return id
            return self._model.compounds[id].properties.get('name', id)

        # Create a set of excluded reactions
        exclude = set(self._args.exclude)
        count = 0
        unbalanced = 0
        unchecked = 0
        for reaction, charge in charge_balance(self._model):
            count += 1

            if reaction.id in exclude or reaction.equation is None:
                continue

            if math.isnan(charge):
                logger.debug('Not checking reaction {};'
                             ' missing charge'.format(reaction.id))
                unchecked += 1
            elif abs(charge) > self._args.epsilon:
                unbalanced += 1
                rxt = reaction.equation.translated_compounds(compound_name)
                print('{}\t{}\t{}'.format(reaction.id, charge, rxt))

        logger.info('Unbalanced reactions: {}/{}'.format(unbalanced, count))
        logger.info('Unchecked reactions due to missing charge: {}/{}'.format(
            unchecked, count))
        logger.info('Reactions excluded from check: {}/{}'.format(
            len(exclude), count))
128919
def do_execute(self):
        
        for s in self.resolve_option("strings"):
            self._output.append(Token(s))
        return None
849857
def run(self, f, *args, **kwargs):
        
        parent = _ACTION_CONTEXT.set(self)
        try:
            return f(*args, **kwargs)
        finally:
            _ACTION_CONTEXT.reset(parent)
500687
def do_execute(self):
        
        result = None
        cont = self.input.payload
        serialization.write_all(
            str(self.resolve_option("output")),
            [cont.get("Model").jobject, cont.get("Header").jobject])
        return result
11440
def execute(self, eopatch):
        
        feature_type, feature_name = next(self.feature(eopatch))

        good_idxs = self._get_filtered_indices(eopatch[feature_type][feature_name] if feature_name is not ... else
                                               eopatch[feature_type])

        for feature_type, feature_name in self.filter_features(eopatch):
            if feature_type.is_time_dependent():
                if feature_type.has_dict():
                    if feature_type.contains_ndarrays():
                        eopatch[feature_type][feature_name] = np.asarray([eopatch[feature_type][feature_name][idx] for
                                                                          idx in good_idxs])
                    # else:
                    #     NotImplemented
                else:
                    eopatch[feature_type] = [eopatch[feature_type][idx] for idx in good_idxs]

        self._update_other_data(eopatch)

        return eopatch
346665
function performAction(params, feature, cbdone, cbcleanup) {
    var alchemy_vision = watson.alchemy_vision( { api_key: apikey } );

    if (feature == 'imageFaces')
    {
      alchemy_vision.recognizeFaces(params, cbdone);
    } else if (feature == 'imageLink') {
      alchemy_vision.getImageLinks(params, cbdone);
    } else if (feature == 'imageKeywords') {
      alchemy_vision.getImageKeywords(params, cbdone);
    } else if (feature == 'imageText') {
      alchemy_vision.getImageSceneText(params, cbdone);
    }

    if (cbcleanup) cbcleanup();
  }
743671
def do_execute(self):
        
        evl = self.input.payload
        if isinstance(evl, Evaluation):
            summary = evl.summary(title=self.resolve_option("title"), complexity=bool(self.resolve_option("complexity")))
            if bool(self.resolve_option("matrix")):
                summary += "\n" + evl.matrix(title=self.resolve_option("title"))
        else:
            summary = evl.cluster_results
        self._output.append(Token(summary))
        return None
361730
def perform(action_name, container, **kwargs):
    
    cf = container_fabric()
    cf.call(action_name, container, **kwargs)
1277576
def run(self):
        """"""

        # Create solver
        solver = self._get_solver()

        # Load compound information
        def compound_name(id):
            if id not in self._model.compounds:
                return id
            return self._model.compounds[id].properties.get('name', id)

        # TODO: The exchange and transport reactions have tuple names. This
        # means that in Python 3 the reactions can no longer be directly
        # compared (e.g. while sorting) so define this helper function as a
        # workaround.
        def reaction_key(r):
            return r if isinstance(r, tuple) else (r,)

        # Calculate penalty if penalty file exists
        penalties = {}
        if self._args.penalty is not None:
            for line in self._args.penalty:
                line, _, comment = line.partition('#')
                line = line.strip()
                if line == '':
                    continue
                rxnid, penalty = line.split(None, 1)
                penalties[rxnid] = float(penalty)

        model_extended, weights = create_extended_model(
            self._model,
            db_penalty=self._args.db_penalty,
            ex_penalty=self._args.ex_penalty,
            tp_penalty=self._args.tp_penalty,
            penalties=penalties)

        epsilon = self._args.epsilon
        core = set()
        if self._args.subset is None:
            for r in self._mm.reactions:
                if not self._mm.is_exchange(r):
                    core.add(r)
        else:
            for line in self._args.subset:
                line = line.strip()
                if line == '':
                    continue
                core.add(line)
        induced = fastgapfill(model_extended, core, weights=weights,
                              epsilon=epsilon, solver=solver)

        for reaction_id in sorted(self._mm.reactions):
            rx = self._mm.get_reaction(reaction_id)
            rxt = rx.translated_compounds(compound_name)
            print('{}\t{}\t{}\t{}'.format(reaction_id, 'Model', 0, rxt))

        for rxnid in sorted(induced, key=reaction_key):
            if self._mm.has_reaction(rxnid):
                continue
            rx = model_extended.get_reaction(rxnid)
            rxt = rx.translated_compounds(compound_name)
            print('{}\t{}\t{}\t{}'.format(
                rxnid, 'Add', weights.get(rxnid, 1), rxt))
1261436
def async_steps(self, n):
        
        assert len(self._agents_to_act) == 0
        for _ in range(n):
            self.async_step()
695045
def do_execute(self):
        
        result = None
        data = self.input.payload
        pltdataset.line_plot(
            data,
            atts=self.resolve_option("attributes"),
            percent=float(self.resolve_option("percent")),
            seed=int(self.resolve_option("seed")),
            title=self.resolve_option("title"),
            outfile=self.resolve_option("outfile"),
            wait=bool(self.resolve_option("wait")))
        return result
12432
def execute(self, eopatch):
        
        # pylint: disable=invalid-name
        amax_ndvi, amin_ndvi = eopatch.data_timeless[self.argmax_ndvi], eopatch.data_timeless[self.argmin_ndvi]
        amax_ndvi_slope, amin_ndvi_slope = eopatch.data_timeless[self.argmax_ndvi_slope], \
                                           eopatch.data_timeless[self.argmin_ndvi_slope]
        amax_red = eopatch.data_timeless[self.argmax_red]

        stf_idx = [amax_ndvi, amin_ndvi, amax_ndvi_slope, amin_ndvi_slope, amax_red]

        bands = eopatch.data[self.data_feature][..., self.indices]

        _, h, w, _ = bands.shape
        hh, ww = np.ogrid[:h, :w]
        stf = np.concatenate([bands[ii.squeeze(), hh, ww] for ii in stf_idx if ii is not None], axis=-1)

        eopatch.data_timeless[self.feats_feature] = stf

        return eopatch
280760
def do_execute(self):
        
        data = self.input.payload
        search = self.config["search"].shallow_copy()
        evl = self.config["eval"].shallow_copy()
        asel = attsel.AttributeSelection()
        asel.search(search)
        asel.evaluator(evl)
        asel.select_attributes(data)
        cont = AttributeSelectionContainer(
            original=data,
            reduced=asel.reduce_dimensionality(data),
            num_atts=asel.number_attributes_selected,
            selected=asel.selected_attributes,
            results=asel.results_string)
        self._output.append(Token(cont))
        return None
969558
def _run(self):
        
        tup = self.read_tuple()
        self._current_tups = [tup]
        if self.is_heartbeat(tup):
            self.send_message({"command": "sync"})
        elif self.is_tick(tup):
            self.process_tick(tup)
            if self.auto_ack:
                self.ack(tup)
        else:
            self.process(tup)
            if self.auto_ack:
                self.ack(tup)
        # Reset _current_tups so that we don't accidentally fail the wrong
        # Tuples if a successive call to read_tuple fails.
        # This is not done in `finally` clause because we want the current
        # Tuples to fail when there is an exception.
        self._current_tups = []
921088
def execute(self):
        

        for n in self.g.nodes():
            self.g.node[n]['communities'] = [n]

        all_communities = {}

        for ego in tqdm.tqdm(nx.nodes(self.g), ncols=35, bar_format='Exec: {l_bar}{bar}'):

            ego_minus_ego = nx.ego_graph(self.g, ego, 1, False)
            community_to_nodes = self.__overlapping_label_propagation(ego_minus_ego, ego)

            # merging phase
            for c in community_to_nodes.keys():
                if len(community_to_nodes[c]) > self.min_community_size:
                    actual_community = community_to_nodes[c]
                    all_communities = self.__merge_communities(all_communities, actual_community)

        # write output on file
        if self.file_output:
            with open(self.file_output, "w") as out_file_com:
                for idc, c in enumerate(all_communities.keys()):
                    out_file_com.write("%d\t%s\n" % (idc, str(sorted(c))))

        return list(all_communities.keys())
758737
def run(self):
        """"""

        reaction = self._get_objective()
        if not self._mm.has_reaction(reaction):
            self.fail('Specified biomass reaction is not in model: {}'.format(
                reaction))

        varying_reaction = self._args.varying
        if not self._mm.has_reaction(varying_reaction):
            self.fail('Specified varying reaction is not in model: {}'.format(
                varying_reaction))

        steps = self._args.steps
        if steps <= 0:
            self.argument_error('Invalid number of steps: {}\n'.format(steps))

        loop_removal = self._get_loop_removal_option()
        if loop_removal == 'tfba':
            solver = self._get_solver(integer=True)
        else:
            solver = self._get_solver()

        p = fluxanalysis.FluxBalanceProblem(self._mm, solver)
        if loop_removal == 'tfba':
            p.add_thermodynamic()

        try:
            p.check_constraints()
        except fluxanalysis.FluxBalanceError as e:
            self.report_flux_balance_error(e)

        # Determine minimum and maximum flux for varying reaction
        if self._args.maximum is None:
            p.maximize(varying_reaction)
            flux_max = p.get_flux(varying_reaction)
        else:
            flux_max = self._args.maximum

        if self._args.minimum is None:
            p.maximize({varying_reaction: -1})
            flux_min = p.get_flux(varying_reaction)
        else:
            flux_min = self._args.minimum

        if flux_min > flux_max:
            self.argument_error('Invalid flux range: {}, {}\n'.format(
                flux_min, flux_max))

        logger.info('Varying {} in {} steps between {} and {}'.format(
            varying_reaction, steps, flux_min, flux_max))

        start_time = time.time()

        handler_args = (
            self._mm, solver, loop_removal, self._args.all_reaction_fluxes)
        executor = self._create_executor(
            RobustnessTaskHandler, handler_args, cpus_per_worker=2)

        def iter_tasks():
            for i in range(steps):
                fixed_flux = flux_min + i*(flux_max - flux_min)/float(steps-1)
                constraint = varying_reaction, fixed_flux
                yield constraint, reaction

        # Run FBA on model at different fixed flux values
        with executor:
            for task, result in executor.imap_unordered(iter_tasks(), 16):
                (varying_reaction, fixed_flux), _ = task
                if result is None:
                    logger.warning('No solution found for {} at {}'.format(
                        varying_reaction, fixed_flux))
                elif self._args.all_reaction_fluxes:
                    for other_reaction in self._mm.reactions:
                        print('{}\t{}\t{}'.format(
                            other_reaction, fixed_flux,
                            result[other_reaction]))
                else:
                    print('{}\t{}'.format(fixed_flux, result))

        executor.join()

        logger.info('Solving took {:.2f} seconds'.format(
            time.time() - start_time))