def _check_len(a, b):
    """
    Raises an exception if the two values do not have the same
    length. This is useful for validating preconditions.

    :a: the first value
    :b: the second value
    :raises ValueError: if the sizes do not match
    """
    if len(a) != len(b):
        msg = "Length must be {}. Got {}".format(len(a), len(b))
        raise ValueError(msg)
def _check_len ( a , b ) : if len ( a ) != len ( b ) : msg = "Length must be {}. Got {}" . format ( len ( a ) , len ( b ) ) raise ValueError ( msg )
Raises an exception if the two values do not have the same
    length. This is useful for validating preconditions.

    :a: the first value
    :b: the second value
    :raises ValueError: if the sizes do not match