def _check_shape(param, param_shape, name):
    param = np.array(param)
    if param.shape != param_shape:
        raise ValueError("The parameter '%s' should have the shape of %s, "
                         "but got %s" % (name, param_shape, param.shape))
Validate the shape of the input parameter 'param'.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/mixture/base.py/_check_shape