Return all Particles of the Compound.
776440
def _particles(self, include_ports=False):
        
        for child in self.successors():
            if not child.children:
                if include_ports or not child.port_particle:
                    yield child
988082
def implfuncs(self):
    """"""
    for f in self.body:
        if (hasattr(f, '_ctype')
                and isinstance(f._ctype, FuncType)
                and hasattr(f, 'body')):
            yield f
649270
def get_go2nt_all(self, rcntobj):
        """"""
        if 'go2nt' in self.kws:
            go2nt = self.kws['go2nt']
            return {go:go2nt[go] for go in self.go2obj}
        else:
            return self._get_go2nt_all(rcntobj)
797391
def get_all(self, key, fallback=None):
        """"""
        if key in self.headers:
            value = self.headers[key]
        else:
            value = fallback or []
        return value
1182343
def get_all_compound_origins(chebi_ids):
    ''''''
    all_compound_origins = [get_compound_origins(chebi_id)
                            for chebi_id in chebi_ids]
    return [x for sublist in all_compound_origins for x in sublist]
553443
def all(cls, sort=None, limit=None):
        
        return cls.where(sort=sort, limit=limit)
1318090
def get_all(self):
        
        if not self.vars:
            return self.parent
        if not self.parent:
            return self.vars
        return dict(self.parent, **self.vars)
245026
def all_fields(self):
        """"""
        return [field 
                for container in FieldsContainer.class_container.values()
                for field in getattr(self, container)]
22496
def getAllTriples(self):
        
        return [(str(s), str(p), str(o)) for s, p, o in self]
442063
def get_compound_bodies(node):
    
    if isinstance(node, (ast.Module, ast.FunctionDef, ast.ClassDef, ast.With)):
        return [node.body]
    elif isinstance(node, (ast.If, ast.While, ast.For)):
        return [node.body, node.orelse]
    elif PY2 and isinstance(node, ast.TryFinally):
        return [node.body, node.finalbody]
    elif PY2 and isinstance(node, ast.TryExcept):
        return [node.body, node.orelse] + [h.body for h in node.handlers]
    elif PY3 and isinstance(node, ast.Try):
        return ([node.body, node.orelse, node.finalbody]
                + [h.body for h in node.handlers])
    end
    return []
346329
def all(self, as_dict=False, as_ordereddict=False):
        """"""

        # By calling list it calls the __iter__ method
        rows = list(self)

        if as_dict:
            return [r.as_dict() for r in rows]
        elif as_ordereddict:
            return [r.as_dict(ordered=True) for r in rows]

        return rows
1079494
def all(cls):
        
        if not hasattr(cls, '_cache'):
            cls._cache = cls._all()
        return cls._cache
684844
def all_energies(self):
        
        all_energies = []
        for i in range(len(self.electronic_steps)):
            energies = [step["E"] for step in self.electronic_steps[i]]
            energies.append(self.ionic_steps[i]["F"])
            all_energies.append(tuple(energies))
        return tuple(all_energies)
21719
def all(self, data={}, **kwargs):
        "
        return super(Order, self).all(data, **kwargs)
1110894
def get_atoms(self, inc_alt_states=False):
        
        if inc_alt_states:
            return itertools.chain(*[x[1].values() for x in sorted(list(self.states.items()))])
        return self.atoms.values()
148047
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)

        epsilon = self._args.epsilon

        if self._args.unrestricted:
            # Allow all exchange reactions with no flux limits
            for reaction in self._mm.reactions:
                if self._mm.is_exchange(reaction):
                    del self._mm.limits[reaction].bounds

        loop_removal = self._get_loop_removal_option()
        enable_tfba = loop_removal == 'tfba'
        enable_fastcore = self._args.fastcore

        if enable_tfba and enable_fastcore:
            self.argument_error(
                'Using Fastcore with thermodynamic constraints'
                ' is not supported!')
        start_time = time.time()

        if enable_fastcore:
            solver = self._get_solver()
            try:
                inconsistent = set(fastcore.fastcc(
                    self._mm, epsilon, solver=solver))
            except fluxanalysis.FluxBalanceError as e:
                self.report_flux_balance_error(e)
        else:
            if enable_tfba:
                solver = self._get_solver(integer=True)
            else:
                solver = self._get_solver()

            if self._args.reduce_lp:
                logger.info('Running with reduced number of LP problems.')
                try:
                    inconsistent = set(
                        fluxanalysis.consistency_check(
                            self._mm, self._mm.reactions, epsilon,
                            tfba=enable_tfba, solver=solver))
                except fluxanalysis.FluxBalanceError as e:
                    self.report_flux_balance_error(e)
            else:
                logger.info('Using flux bounds to determine consistency.')
                try:
                    inconsistent = set(self._run_fva_fluxcheck(
                        self._mm, solver, enable_tfba, epsilon))
                except FluxCheckFVATaskError:
                    self.report_flux_balance_error()

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

        # Count the number of reactions that are fixed at zero. While these
        # reactions are still inconsistent, they are inconsistent because they
        # have been explicitly disabled.
        disabled_exchange = 0
        disabled_internal = 0

        count_exchange = 0
        total_exchange = 0

        count_internal = 0
        total_internal = 0

        # Print result
        for reaction in sorted(self._mm.reactions):
            disabled = self._mm.limits[reaction].bounds == (0, 0)

            if self._mm.is_exchange(reaction):
                total_exchange += 1
                count_exchange += int(reaction in inconsistent)
                disabled_exchange += int(disabled)
            else:
                total_internal += 1
                count_internal += int(reaction in inconsistent)
                disabled_internal += int(disabled)

            if reaction in inconsistent:
                rx = self._mm.get_reaction(reaction)
                rxt = rx.translated_compounds(compound_name)
                print('{}\t{}'.format(reaction, rxt))

        logger.info('Model has {}/{} inconsistent internal reactions'
                    ' ({} disabled by user)'.format(
                        count_internal, total_internal, disabled_internal))
        logger.info('Model has {}/{} inconsistent exchange reactions'
                    ' ({} disabled by user)'.format(
                        count_exchange, total_exchange, disabled_exchange))
240279
def all(cls, otp=False, ccid=False, u2f=False):
        """"""
        pids = set([
            cls.YUBIKEY,
            cls.NEO_OTP,
            cls.NEO_OTP_CCID,
            cls.NEO_CCID,
            cls.NEO_U2F,
            cls.NEO_OTP_U2F,
            cls.NEO_U2F_CCID,
            cls.NEO_OTP_U2F_CCID,
            cls.NEO_SKY,
            cls.YK4_OTP,
            cls.YK4_U2F,
            cls.YK4_OTP_U2F,
            cls.YK4_CCID,
            cls.YK4_OTP_CCID,
            cls.YK4_U2F_CCID,
            cls.YK4_OTP_U2F_CCID,
            cls.PLUS_U2F_OTP
        ])

        if otp:
            pids.difference_update(set([
                cls.NEO_CCID,
                cls.NEO_U2F,
                cls.NEO_U2F_CCID,
                cls.NEO_SKY,
                cls.YK4_U2F,
                cls.YK4_CCID,
                cls.YK4_U2F_CCID
            ]))

        if ccid:
            pids.difference_update(set([
                cls.YUBIKEY,
                cls.NEO_OTP,
                cls.NEO_U2F,
                cls.NEO_OTP_U2F,
                cls.NEO_SKY,
                cls.YK4_OTP,
                cls.YK4_U2F,
                cls.YK4_OTP_U2F,
                cls.PLUS_U2F_OTP
            ]))

        if u2f:
            pids.difference_update(set([
                cls.YUBIKEY,
                cls.NEO_OTP,
                cls.NEO_OTP_CCID,
                cls.NEO_CCID,
                cls.YK4_OTP,
                cls.YK4_CCID,
                cls.YK4_OTP_CCID
            ]))

        return pids