def check_input_size(array, num):
    """Check that an array has the expected number of elements."""
    if array.shape[0] != num:
        raise ValueError(
            'Input arrays must have the same length (the                           number of clusters).'
            )
