def array_equal(x, y, interval=None):
    """Check if two one-dimentional integer arrays are equal.

    Parameters
    ----------
    x, y : ndarray, int
        1D vectors of integers.
    interval : tuple, int shape (2, ), optional
        A pair of integers defining a half open interval.

    Returns
    -------
    equality : bool
        True if `x` and `y` are equal (within an interval
        if specified).

    """
    if interval is None:
        r = range(len(x))
    else:
        r = range(interval[0], interval[1])

    for i in r:
        if x[i] != y[i]:
            return False
    return True