# Path: cameo/io.py
# def load_model(path_or_handle, solver_interface=optlang, sanitize=True):
#     """Read a metabolic model .
# 
#     Parameters
#     ----------
#     path_or_handle : path, fhandle or name.
#         One of:
#             * file path of a model file;
#             * file handle to a SBML or pickled model; or
#             * the identifier of a model in a web database (optflux.org/models)
#     solver_interface : solver_interface, optional
#         E.g. optlang.glpk_interface or any other optlang interface.
#     sanitize : boolean, optional
#         If reaction and metabolite IDs should be sanitized (works only for SBML models).
#     """
#     solver_interface = solvers.get(solver_interface, solver_interface)
# 
#     if isinstance(path_or_handle, str) and not os.path.isfile(path_or_handle):
#         from cameo.models.webmodels import load_webmodel
#         logger.debug("Given path is not a file. Trying to load from webmodels")
#         model = load_webmodel(path_or_handle, solver_interface)
#     else:
#         if isinstance(path_or_handle, str):
#             # Open the given file
#             path = path_or_handle
#             handle = open(path_or_handle, 'rb')
#         elif hasattr(path_or_handle, 'read'):
#             # Argument is already an open file
#             path = path_or_handle.name
#             handle = path_or_handle
#         else:
#             raise ValueError('Provided argument %s has to be either a string or a file handle' % path_or_handle)
#         model = _load_model_from_file(path, handle)  # Parse model from the file
# 
#     if sanitize:
#         sanitize_ids(model)
# 
#     if solver_interface is not None and not isinstance(model.solver, solver_interface.Model):
#         logger.debug("Changing solver interface to %s" % solver_interface)
#         model.solver = solver_interface
# 
#     return model
# 
# Path: cameo/util.py
# _BIOMASS_RE_ = re.compile("biomass", re.IGNORECASE)
# class frozendict(dict):
# class ProblemCache(object):
# class RandomGenerator(object):
# class Singleton(object):
# class AutoVivification(dict):
# class TimeMachine(object):
# class Timer(object):
# class IntelliContainer(object):
#     def __init__(self, iterable, **kwargs):
#     def popitem(self):
#     def pop(self, k, d=None):
#     def __setitem__(self, key, value):
#     def setdefault(self, k, d=None):
#     def __delitem__(self, key):
#     def __hash__(self):
#     def update(self, E=None, **F):
# def float_ceil(val, decimals=0):
# def float_floor(val, decimals=0):
#     def __init__(self, model):
#     def begin_transaction(self):
#     def model(self):
#     def _append_constraint(self, constraint_id, create, *args, **kwargs):
#     def _remove_constraint(self, constraint_id):
#     def _append_variable(self, variable_id, create, *args, **kwargs):
#     def _remove_variable(self, variable_id):
#     def _rebuild_variable(self, variable):
#         def rebuild():
#     def add_constraint(self, constraint_id, create, update, *args, **kwargs):
#     def add_variable(self, variable_id, create, update, *args, **kwargs):
#     def add_objective(self, create, update, *args):
#     def reset(self):
#     def rollback(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
#     def __init__(self, seed=None):
#     def seed(self, seed):
#     def random(self):
#     def randint(self, a, b=None):
#     def sample(self, population, k):
#     def __getattr__(self, attr):
#     def __getstate__(self):
#     def __setstate__(self, d):
#     def uniform(self, low=0.0, high=1.0, size=None):
#     def __new__(cls, *args, **kwargs):
#     def __getitem__(self, item):
#     def __init__(self):
#     def __call__(self, do=None, undo=None, bookmark=None):
#     def __str__(self):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def _history_item_to_str(item):
#     def undo(self, bookmark=None):
#     def redo(self):
#     def reset(self):
#     def __init__(self, name=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def __init__(self, **kwargs):
#     def __getattr__(self, value):
#     def __setitem__(self, key, value):
#     def __iter__(self):
#     def __dir__(self):
# def inheritdocstring(name, bases, attrs):
# def partition_(lst, n):
# def partition(ite, n):
# def flatten(input_list):
# def generate_colors(n):
# def memoize(function, memo={}):
#     def wrapper(*args):
# def get_system_info():
# def in_ipnb():
# def str_to_valid_variable_name(s):
# def zip_repeat(long_iter, short_iter):
# def pick_one(iterable):
# def reduce_reaction_set(reaction_set, groups):
# def decompose_reaction_groups(reaction_groups, reactions):
# def current_solver_name(model):


import sys
import os
import glob
import cameo
from cameo.io import load_model
from cameo import util
from functools import partial
from lazy_object_proxy import Proxy
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import



__all__ = ['universal']


class ModelDB(object):
    pass


universal = ModelDB()

for file_path in glob.glob(os.path.join(os.path.dirname(cameo.__file__), 'models', 'universal_models', '*.json')):

# Path: cameo/io.py
# def load_model(path_or_handle, solver_interface=optlang, sanitize=True):
#     """Read a metabolic model .
# 
#     Parameters
#     ----------
#     path_or_handle : path, fhandle or name.
#         One of:
#             * file path of a model file;
#             * file handle to a SBML or pickled model; or
#             * the identifier of a model in a web database (optflux.org/models)
#     solver_interface : solver_interface, optional
#         E.g. optlang.glpk_interface or any other optlang interface.
#     sanitize : boolean, optional
#         If reaction and metabolite IDs should be sanitized (works only for SBML models).
#     """
#     solver_interface = solvers.get(solver_interface, solver_interface)
# 
#     if isinstance(path_or_handle, str) and not os.path.isfile(path_or_handle):
#         from cameo.models.webmodels import load_webmodel
#         logger.debug("Given path is not a file. Trying to load from webmodels")
#         model = load_webmodel(path_or_handle, solver_interface)
#     else:
#         if isinstance(path_or_handle, str):
#             # Open the given file
#             path = path_or_handle
#             handle = open(path_or_handle, 'rb')
#         elif hasattr(path_or_handle, 'read'):
#             # Argument is already an open file
#             path = path_or_handle.name
#             handle = path_or_handle
#         else:
#             raise ValueError('Provided argument %s has to be either a string or a file handle' % path_or_handle)
#         model = _load_model_from_file(path, handle)  # Parse model from the file
# 
#     if sanitize:
#         sanitize_ids(model)
# 
#     if solver_interface is not None and not isinstance(model.solver, solver_interface.Model):
#         logger.debug("Changing solver interface to %s" % solver_interface)
#         model.solver = solver_interface
# 
#     return model
# 
# Path: cameo/util.py
# _BIOMASS_RE_ = re.compile("biomass", re.IGNORECASE)
# class frozendict(dict):
# class ProblemCache(object):
# class RandomGenerator(object):
# class Singleton(object):
# class AutoVivification(dict):
# class TimeMachine(object):
# class Timer(object):
# class IntelliContainer(object):
#     def __init__(self, iterable, **kwargs):
#     def popitem(self):
#     def pop(self, k, d=None):
#     def __setitem__(self, key, value):
#     def setdefault(self, k, d=None):
#     def __delitem__(self, key):
#     def __hash__(self):
#     def update(self, E=None, **F):
# def float_ceil(val, decimals=0):
# def float_floor(val, decimals=0):
#     def __init__(self, model):
#     def begin_transaction(self):
#     def model(self):
#     def _append_constraint(self, constraint_id, create, *args, **kwargs):
#     def _remove_constraint(self, constraint_id):
#     def _append_variable(self, variable_id, create, *args, **kwargs):
#     def _remove_variable(self, variable_id):
#     def _rebuild_variable(self, variable):
#         def rebuild():
#     def add_constraint(self, constraint_id, create, update, *args, **kwargs):
#     def add_variable(self, variable_id, create, update, *args, **kwargs):
#     def add_objective(self, create, update, *args):
#     def reset(self):
#     def rollback(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
#     def __init__(self, seed=None):
#     def seed(self, seed):
#     def random(self):
#     def randint(self, a, b=None):
#     def sample(self, population, k):
#     def __getattr__(self, attr):
#     def __getstate__(self):
#     def __setstate__(self, d):
#     def uniform(self, low=0.0, high=1.0, size=None):
#     def __new__(cls, *args, **kwargs):
#     def __getitem__(self, item):
#     def __init__(self):
#     def __call__(self, do=None, undo=None, bookmark=None):
#     def __str__(self):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def _history_item_to_str(item):
#     def undo(self, bookmark=None):
#     def redo(self):
#     def reset(self):
#     def __init__(self, name=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def __init__(self, **kwargs):
#     def __getattr__(self, value):
#     def __setitem__(self, key, value):
#     def __iter__(self):
#     def __dir__(self):
# def inheritdocstring(name, bases, attrs):
# def partition_(lst, n):
# def partition(ite, n):
# def flatten(input_list):
# def generate_colors(n):
# def memoize(function, memo={}):
#     def wrapper(*args):
# def get_system_info():
# def in_ipnb():
# def str_to_valid_variable_name(s):
# def zip_repeat(long_iter, short_iter):
# def pick_one(iterable):
# def reduce_reaction_set(reaction_set, groups):
# def decompose_reaction_groups(reaction_groups, reactions):
# def current_solver_name(model):


# Path: cameo/models/universal.py
import sys
import os
import glob
import cameo
from cameo.io import load_model
from cameo import util
from functools import partial
from lazy_object_proxy import Proxy

# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import



__all__ = ['universal']


class ModelDB(object):
    pass


universal = ModelDB()

for file_path in glob.glob(os.path.join(os.path.dirname(cameo.__file__), 'models', 'universal_models', '*.json')):

    model_id = os.path.splitext(os.path.basename(file_path))[0]