import numpy as np

def check_dim(X, dim):
    dimX = np.ndim(X)
    if(dimX != dim):
        raise ValueError("{0}d array is expected, but {1}d is given".format(dim, dimX))

4a0b0979038366a07d5b69344c96506fdfc58b55
<mask token>

<mask token>


def check_dim(X, dim):
    dimX = np.ndim(X)
    if dimX != dim:
        raise ValueError('{0}d array is expected, but {1}d is given'.format
            (dim, dimX))

import numpy as np


def check_dim(X, dim):
    dimX = np.ndim(X)
    if dimX != dim:
        raise ValueError('{0}d array is expected, but {1}d is given'.format
            (dim, dimX))

import numpy as np

def check_dim(X, dim):
    dimX = np.ndim(X)
    if(dimX != dim):
        raise ValueError("{0}d array is expected, but {1}d is given".format(dim, dimX))
