code: def check_imgs(
      imgs, n_components=None, atlas_shape=None, ignore_nsubjects=False
  ):
      """
      Check input images
  
      Parameters
      ----------
  
      imgs : array of str, shape=[n_subjects, n_sessions]
              Element i, j of the array is a path to the data of subject i
              collected during session j.
              Data are loaded with numpy.load and expected
              shape is [n_voxels, n_timeframes]
              n_timeframes and n_voxels are assumed to be the same across
              subjects
              n_timeframes can vary across sessions
              Each voxel's timecourse is assumed to have mean 0 and variance 1
  
              imgs can also be a list of list of arrays where element i, j of
              the array is a numpy array of shape [n_voxels, n_timeframes] that
              contains the data of subject i collected during session j.
  
              imgs can also be a list of arrays where element i of the array is
              a numpy array of shape [n_voxels, n_timeframes] that contains the
              data of subject i (number of sessions is implicitly 1)
  
      Returns
      -------
      reshaped_input: bool
          True if input had to be reshaped to match the
          n_subjects, n_sessions input
      new_imgs: list of list of array or np array
          input imgs reshaped if it is a list of arrays so that it becomes a
          list of list of arrays
      shapes: array
          Shape of input images
      """
      reshaped_input = False
      new_imgs = imgs
      if isinstance(imgs, list):
          _check_imgs_list(imgs)
          if isinstance(imgs[0], list):
              shapes = _check_imgs_list_list(imgs)
          elif isinstance(imgs[0], np.ndarray):
              new_imgs, shapes = _check_imgs_list_array(imgs)
              reshaped_input = True
          else:
              raise ValueError(
                  "Since imgs is a list, it should be a list of list "
                  "of arrays or a list of arrays but imgs[0] has type %s"
                  % type(imgs[0])
              )
      elif isinstance(imgs, np.ndarray):
          shapes = _check_imgs_array(imgs)
      else:
          raise ValueError(
              "Input imgs should either be a list or an array but has type %s"
              % type(imgs)
          )
  
      _check_shapes(shapes, n_components, atlas_shape, ignore_nsubjects)
  
      return reshaped_input, new_imgs, shapes
  
imports: import hashlib
  import logging
  import os
  import numpy
  import scipy
  from joblib import Parallel, delayed
  from brainiak.funcalign.srm import DetSRM
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
  import uuid
label_desc: Use image node_id 15 for calling a global function with example usage: check_imgs(imgs, n_components, atlas_shape, ignore_nsubjects) and returns: reshaped_input,  new_imgs,  shapes