def _multi_deletion(model, entity, element_lists, method="<STR_LIT>",<EOL>solution=None, processes=None, **kwargs):
solver = sutil.interface_to_str(model.problem.__name__)<EOL>if method == "<STR_LIT>" and solver not in sutil.qp_solvers:<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(solver))<EOL><DEDENT>if processes is None:<EOL><INDENT>processes = CONFIGURATION.processes<EOL><DEDENT>with model:<EOL><INDENT>if "<STR_LIT>" in method:<EOL><INDENT>add_moma(model, solution=solution, linear="<STR_LIT>" in method)<EOL><DEDENT>elif "<STR_LIT>" in method:<EOL><INDENT>add_room(model, solution=solution, linear="<STR_LIT>" in method,<EOL>**kwargs)<EOL><DEDENT>args = set([frozenset(comb) for comb in product(*element_lists)])<EOL>processes = min(processes, len(args))<EOL>def extract_knockout_results(result_iter):<EOL><INDENT>result = pd.DataFrame([<EOL>(frozenset(ids), growth, status)<EOL>for (ids, growth, status) in result_iter<EOL>], columns=['<STR_LIT>', '<STR_LIT>', '<STR_LIT:status>'])<EOL>result.set_index('<STR_LIT>', inplace=True)<EOL>return result<EOL><DEDENT>if processes > <NUM_LIT:1>:<EOL><INDENT>worker = dict(gene=_gene_deletion_worker,<EOL>reaction=_reaction_deletion_worker)[entity]<EOL>chunk_size = len(args) // processes<EOL>pool = multiprocessing.Pool(<EOL>processes, initializer=_init_worker, initargs=(model,)<EOL>)<EOL>results = extract_knockout_results(pool.imap_unordered(<EOL>worker,<EOL>args,<EOL>chunksize=chunk_size<EOL>))<EOL>pool.close()<EOL>pool.join()<EOL><DEDENT>else:<EOL><INDENT>worker = dict(gene=_gene_deletion,<EOL>reaction=_reaction_deletion)[entity]<EOL>results = extract_knockout_results(map(<EOL>partial(worker, model), args))<EOL><DEDENT>return results<EOL><DEDENT>
Provide a common interface for single or multiple knockouts.

Parameters
----------
model : cobra.Model
    The metabolic model to perform deletions in.
entity : 'gene' or 'reaction'
    The entity to knockout (``cobra.Gene`` or ``cobra.Reaction``).
element_lists : list
    List of iterables ``cobra.Reaction``s or ``cobra.Gene``s (or their IDs)
    to be deleted.
method: {"fba", "moma", "linear moma", "room", "linear room"}, optional
    Method used to predict the growth rate.
solution : cobra.Solution, optional
    A previous solution to use as a reference for (linear) MOMA or ROOM.
processes : int, optional
    The number of parallel processes to run. Can speed up the computations
    if the number of knockouts to perform is large. If not passed,
    will be set to the number of CPUs found.
kwargs :
    Passed on to underlying simulation functions.

Returns
-------
pandas.DataFrame
    A representation of all combinations of entity deletions. The
    columns are 'growth' and 'status', where

    index : frozenset([str])
        The gene or reaction identifiers that were knocked out.
    growth : float
        The growth rate of the adjusted model.
    status : str
        The solution's status.