<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_database(name: str, version: Optional[str] = None, manager: Optional[Manager] = None):
 """Load a BEL graph from a database. If name and version are given, finds it exactly with :meth:`pybel.manager.Manager.get_network_by_name_version`. If just the name is given, finds most recent with :meth:`pybel.manager.Manager.get_network_by_name_version` :param name: The name of the graph :param version: The version string of the graph. If not specified, loads most recent graph added with this name :return: A BEL graph loaded from the database :rtype: Optional[BELGraph] """

    if manager is None:
        manager = Manager()

    if version is None:
        return manager.get_graph_by_most_recent(name)

    return manager.get_graph_by_name_version(name, version)