def compare(graph: BELGraph, annotation: str = '<STR_LIT>') -> Mapping[str, Mapping[str, float]]:
canonical_mechanisms = get_subgraphs_by_annotation(graph, annotation)<EOL>canonical_nodes = _transform_graph_dict_to_node_dict(canonical_mechanisms)<EOL>candidate_mechanisms = generate_bioprocess_mechanisms(graph)<EOL>candidate_nodes = _transform_graph_dict_to_node_dict(candidate_mechanisms)<EOL>results: Dict[str, Dict[str, float]] = defaultdict(dict)<EOL>it = itt.product(canonical_nodes.items(), candidate_nodes.items())<EOL>for (canonical_name, canonical_graph), (candidate_bp, candidate_graph) in it:<EOL><INDENT>tanimoto = tanimoto_set_similarity(candidate_nodes, canonical_nodes)<EOL>results[canonical_name][candidate_bp] = tanimoto<EOL><DEDENT>return dict(results)<EOL>
Compare generated mechanisms to actual ones.

    1. Generates candidate mechanisms for each biological process
    2. Gets sub-graphs for all NeuroMMSig signatures
    3. Make tanimoto similarity comparison for all sets

    :return: A dictionary table comparing the canonical subgraphs to generated ones