code: def _check_tensor_dim_shape(x, n_dims, shape_):
      """Check whether the number of dimensions of the input data and the shape for each sample are consistent with
          expected values
  
      Args:
          x (array-like): input data, shape (n_samples, I_1, I_2, ..., I_N)
          n_dims (int): number of dimensions expected, i.e. N+1
          shape_: expected shape for each sample, i.e. (I_1, I_2, ..., I_N)
  
      """
      _check_n_dim(x, n_dims)
      _check_shape(x, shape_)
  
imports: import logging
  import warnings
  import numpy
  from numpy.linalg import multi_dot
  from scipy import linalg
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.metrics.pairwise import pairwise_kernels
  from sklearn.preprocessing import KernelCenterer, LabelBinarizer
  from sklearn.utils.validation import check_is_fitted
  from tensorly.base import fold, unfold
  from tensorly.tenalg import multi_mode_dot
label_desc: Use image node_id 3 for calling a global function with example usage: _check_tensor_dim_shape(x, n_dims, shape_) without return types