def _number_of_links(shape):
    """Number of links in a structured quad grid.

    Parameters
    ----------
    shape : tuple of int
        Shape of grid of nodes.

    Returns
    -------
    int :
        Number of links in grid.

    Examples
    --------
    >>> from landlab.components.overland_flow._links import _number_of_links
    >>> _number_of_links((3, 4))
    17
    """
    return (shape[0] - 1) * shape[1] + shape[0] * (shape[1] - 1)
