code: def get_nth_item_or_val(iterable_or_val, n):
      if iterable_or_val is None:
          return None
      if type(iterable_or_val) in (list, tuple, np.ndarray):
          return iterable_or_val[n]
      elif type(iterable_or_val) in (int, float, bool, None):
          return iterable_or_val
      else:
          raise ValueError("Unrecognized parameter type")
  
imports: import numpy
  import numba
  from sklearn.base import BaseEstimator
  from sklearn.utils import check_array
  from umap.sparse import arr_intersect
  from umap.sparse import arr_union
  from umap.umap_ import UMAP, make_epochs_per_sample
  from umap.spectral import spectral_layout
  from umap.layouts import optimize_layout_aligned_euclidean
label_desc: Use image node_id 6 for calling a global function with example usage: get_nth_item_or_val(iterable_or_val, n) and returns: None, iterable_or_val, iterable_or_val