@uni_in_place_transformation<EOL>def update_context(universe: BELGraph, graph: BELGraph):
for namespace in get_namespaces(graph):<EOL><INDENT>if namespace in universe.namespace_url:<EOL><INDENT>graph.namespace_url[namespace] = universe.namespace_url[namespace]<EOL><DEDENT>elif namespace in universe.namespace_pattern:<EOL><INDENT>graph.namespace_pattern[namespace] = universe.namespace_pattern[namespace]<EOL><DEDENT>else:<EOL><INDENT>log.warning('<STR_LIT>', namespace)<EOL><DEDENT><DEDENT>for annotation in get_annotations(graph):<EOL><INDENT>if annotation in universe.annotation_url:<EOL><INDENT>graph.annotation_url[annotation] = universe.annotation_url[annotation]<EOL><DEDENT>elif annotation in universe.annotation_pattern:<EOL><INDENT>graph.annotation_pattern[annotation] = universe.annotation_pattern[annotation]<EOL><DEDENT>elif annotation in universe.annotation_list:<EOL><INDENT>graph.annotation_list[annotation] = universe.annotation_list[annotation]<EOL><DEDENT>else:<EOL><INDENT>log.warning('<STR_LIT>', annotation)<EOL><DEDENT><DEDENT>
Update the context of a subgraph from the universe of all knowledge.