code: def assert_valid_index(indexes, max_value, name_indexes):
      """
      Check that indexes are between 0 and max_value and number
      of indexes is less than max_value
      """
      for i, ind_i in enumerate(indexes):
          if ind_i < 0 or ind_i >= max_value:
              raise ValueError(
                  "Index %i of %s has value %i "
                  "whereas value should be between 0 and %i"
                  % (i, name_indexes, ind_i, max_value - 1)
              )
  
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 6 for calling a global function with example usage: assert_valid_index(indexes, max_value, name_indexes) without return types