def from_yaml(document):
content = StringIO(document)<EOL>return model_from_dict(yaml.load(content))<EOL>
Load a cobra model from a YAML document.

Parameters
----------
document : str
    The YAML document representation of a cobra model.

Returns
-------
cobra.Model
    The cobra model as represented in the YAML document.

See Also
--------
load_yaml_model : Load directly from a file.