def fastcc(model, flux_threshold=<NUM_LIT:1.0>, zero_cutoff=None):
zero_cutoff = normalize_cutoff(model, zero_cutoff)<EOL>with model:<EOL><INDENT>obj_vars = []<EOL>vars_and_cons = []<EOL>prob = model.problem<EOL>for rxn in model.reactions:<EOL><INDENT>var = prob.Variable("<STR_LIT>".format(rxn.id),<EOL>lb=<NUM_LIT:0.0>, ub=flux_threshold)<EOL>const = prob.Constraint(rxn.forward_variable +<EOL>rxn.reverse_variable -<EOL>var, name="<STR_LIT>".format(rxn.id),<EOL>lb=<NUM_LIT:0.0>)<EOL>vars_and_cons.extend([var, const])<EOL>obj_vars.append(var)<EOL><DEDENT>model.add_cons_vars(vars_and_cons)<EOL>model.objective = prob.Objective(Zero, sloppy=True, direction="<STR_LIT>")<EOL>model.objective.set_linear_coefficients({v: <NUM_LIT:1.0> for v in obj_vars})<EOL>sol = model.optimize()<EOL><DEDENT>rxns_to_remove = sol.fluxes[sol.fluxes.abs() < zero_cutoff].index<EOL>consistent_model = model.copy()<EOL>consistent_model.remove_reactions(rxns_to_remove, remove_orphans=True)<EOL>return consistent_model<EOL>
r"""
    Check consistency of a metabolic network using FASTCC [1]_.

    FASTCC (Fast Consistency Check) is an algorithm for rapid and
    efficient consistency check in metabolic networks. FASTCC is
    a pure LP implementation and is low on computation resource
    demand. FASTCC also circumvents the problem associated with
    reversible reactions for the purpose. Given a global model,
    it will generate a consistent global model i.e., remove
    blocked reactions. For more details on FASTCC, please
    check [1]_.

    Parameters
    ----------
    model: cobra.Model
        The constraint-based model to operate on.
    flux_threshold: float, optional (default 1.0)
        The flux threshold to consider.
    zero_cutoff: float, optional
        The cutoff to consider for zero flux (default model.tolerance).

    Returns
    -------
    cobra.Model
        The consistent constraint-based model.

    Notes
    -----
    The LP used for FASTCC is like so:
    maximize: \sum_{i \in J} z_i
    s.t.    : z_i \in [0, \varepsilon] \forall i \in J, z_i \in \mathbb{R}_+
              v_i \ge z_i \forall i \in J
              Sv = 0 v \in B

    References
    ----------
    .. [1] Vlassis N, Pacheco MP, Sauter T (2014)
           Fast Reconstruction of Compact Context-Specific Metabolic Network
           Models.
           PLoS Comput Biol 10(1): e1003424. doi:10.1371/journal.pcbi.1003424