def intersection_count(G: nx.MultiDiGraph, *, min_streets: int = 2) -> int:
    """
    Count the intersections in a graph.

    Intersections are defined as nodes with at least `min_streets` number of
    streets incident on them.

    Parameters
    ----------
    G
        Input graph.
    min_streets
        A node must have at least `min_streets` incident on them to count as
        an intersection.

    Returns
    -------
    count
        Count of intersections in graph.
    """
    spn = streets_per_node(G)
    node_ids = set(G.nodes)
    count = sum(c >= min_streets and n in node_ids for n, c in spn.items())

    # ensure count value has type int (otherwise could be type np.int64) if
    # user has projected the graph bc GeoDataFrames use np.int64 for ints
    return int(count)

    Count the intersections in a graph.

    Intersections are defined as nodes with at least `min_streets` number of
    streets incident on them.

    Parameters
    ----------
    G
        Input graph.
    min_streets
        A node must have at least `min_streets` incident on them to count as
        an intersection.

    Returns
    -------
    count
        Count of intersections in graph.
    
osmnx/stats.py