import re


def get_edge_count(gviz):
    """Get number of edges in a Digraph

    Args:
        gviz (graphviz.graphs.Digraph): Digraph

    Returns:
        int: Number of edges
    """
    edges = 0
    for line in list(gviz):
        if re.search("\".*\" \-> \".*\" \[.*\]", line): # Edge ( "_" -> "_" [_] )
            edges = edges + 1
    return edges