def safe_zip(*args):
    """
    Like zip, but ensures arguments are of same length.

    Parameters
    ----------
    *args
        Argument list to `zip`

    Returns
    -------
    list
        The zipped list of inputs.

    Raises
    ------
    ValueError
        If the length of any argument is different than the length of args[0].
    """
    base = len(args[0])
    for i, arg in enumerate(args[1:]):
        if len(arg) != base:
            raise ValueError("Argument[0] has length %d but argument %d has "
                             "length %d" % (base, i+1, len(arg)))
    return zip(*args)