def peak_bounds(x, i):
    """ Find bounds around peak

    Parameters
    ----------

    x: np.ndarray
        Array of values
    i: int
        Index location of a peak

    >>> #                  bound    Peak     bound
    >>> #                  |        |        |
    >>> peak_bounds([3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3], 5)
    (2, 8)

    >>> peak_bounds([3, 1, 2, 3, 4], 4)
    (1, 4)
    """
    smallest = x[i]
    j = i
    while j + 1< len(x) and x[j] >= x[j + 1]:
        j += 1

    k = i
    while k - 1 >= 0 and x[k] >= x[k - 1]:
        k -= 1

    return k, j