def length_of_arraylikes_in_sequence(xs):
    """
    Determine the length of the array-like elements in the sequence `xs`.
    `ValueError` is raised if the elements do not all have the same length.

    Parameters
    ----------
    xs: tuple or list
        Sequence of array-like elements.

    Returns
    -------
    int
        The length of the array-like elements in `xs`

    Raises
    ------
    ValueError
        If the lengths of the elements are not the same
    """
    N = len(xs[0])
    # Ensure remainder are consistent
    for i, d1 in enumerate(xs[1:]):
        if len(d1) != N:
            raise ValueError('Index-ables have inconsistent length; element '
                             '0 has length {}, while element {} has length '
                             '{}'.format(N, i+1, len(d1)))
    return N