def edge_has_annotation(edge_data: EdgeData, key: str) -> Optional[Any]:
    """Check if an edge has the given annotation.

    :param edge_data: The data dictionary from a BELGraph's edge
    :param key: An annotation key
    :return: If the annotation key is present in the current data dictionary

    For example, it might be useful to print all edges that are annotated with 'Subgraph':

    >>> from pybel.examples import sialic_acid_graph
    >>> for u, v, data in sialic_acid_graph.edges(data=True):
    >>>     if edge_has_annotation(data, 'Species')
    >>>         print(u, v, data)
    """
    annotations = edge_data.get(ANNOTATIONS)

    if annotations is None:
        return None

    return annotations.get(key)
def edge_has_annotation ( edge_data : EdgeData , key : str ) -> Optional [ Any ] : annotations = edge_data . get ( ANNOTATIONS ) if annotations is None : return None return annotations . get ( key )
Check if an edge has the given annotation.

    :param edge_data: The data dictionary from a BELGraph's edge
    :param key: An annotation key
    :return: If the annotation key is present in the current data dictionary

    For example, it might be useful to print all edges that are annotated with 'Subgraph':

    >>> from pybel.examples import sialic_acid_graph
    >>> for u, v, data in sialic_acid_graph.edges(data=True):
    >>>     if edge_has_annotation(data, 'Species')
    >>>         print(u, v, data)