code: def check_atlas(atlas, n_components=None):
      """Check input atlas
  
      Parameters
      ----------
      atlas :  array, shape=[n_supervoxels, n_voxels] or array, shape=[n_voxels]
       or str or None
          Probabilistic or deterministic atlas on which to project the data
          Deterministic atlas is an array of shape [n_voxels,] where values
          range from 1 to n_supervoxels. Voxels labelled 0 will be ignored.
          If atlas is a str the corresponding array is loaded with numpy.load
          and expected shape is (n_voxels,) for a deterministic atlas and
          (n_supervoxels, n_voxels) for a probabilistic atlas.
  
      n_components : int
          Number of timecourses of the shared coordinates
  
      Returns
      -------
      shape : array or None
          atlas shape
      """
      if atlas is None:
          return None
  
      if not (
          isinstance(atlas, np.ndarray)
          or isinstance(atlas, str)
          or isinstance(atlas, np.str_)
          or isinstance(atlas, str)
      ):
          raise ValueError(
              "Atlas is stored using "
              "type %s which is neither np.ndarray or str" % type(atlas)
          )
  
      if isinstance(atlas, np.ndarray):
          shape = atlas.shape
      else:
          shape = get_shape(atlas)
  
      if len(shape) == 1:
          # We have a deterministic atlas
          atlas_array = safe_load(atlas)
          n_voxels = atlas_array.shape[0]
          n_supervoxels = len(np.unique(atlas_array)) - 1
          shape = (n_supervoxels, n_voxels)
      elif len(shape) != 2:
          raise ValueError(
              "Atlas has %i axes. It should have either 1 or 2 axes."
              % len(shape)
          )
  
      n_supervoxels, n_voxels = shape
  
      if n_supervoxels > n_voxels:
          raise ValueError(
              "Number of regions in the atlas is bigger than "
              "the number of voxels (%i > %i)"
              % (n_supervoxels, n_voxels)
          )
  
      if n_components is not None:
          if n_supervoxels < n_components:
              raise ValueError(
                  "Number of regions in the atlas is "
                  "lower than the number of components "
                  "(%i < %i)" % (n_supervoxels, n_components)
              )
      return shape
  
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 14 for calling a global function with example usage: check_atlas(atlas, n_components) and returns: shape, None