def check_lengths_all_equal(*args):
    """Check the lengths of all passed objects is the same."""
    lengths = [len(x) for x in args]
    if not len(set(lengths)) == 1:
        raise ValueError(
            f"Passed Series and DataFrames don't all have the same lenghts: {lengths}",
        )
    else:
        return lengths[0]