code: def concatenate_not_none(data, axis=0):
      """Construct a numpy array by stacking not-None arrays in a list
  
      Parameters
      ----------
  
      data : list of arrays
          The list of arrays to be concatenated. Arrays have same shape in all
          but one dimension or are None, in which case they are ignored.
  
      axis : int, default = 0
          Axis for the concatenation
  
  
      Returns
      -------
  
      data_stacked : array
          The resulting concatenated array.
      """
      # Get the indexes of the arrays in the list
      mask = []
      for i in range(len(data)):
          if data[i] is not None:
              mask.append(i)
  
      # Concatenate them
      stacked = np.concatenate([data[i] for i in mask], axis=axis)
      return stacked
  
imports: import numpy
  import re
  import warnings
  import os.path
  import psutil
  from .fmrisim import generate_stimfunction, _double_gamma_hrf, convolve_hrf
  from scipy.fftpack import fft, ifft
  import logging
label_desc: Use image node_id 5 for calling a global function with example usage: concatenate_not_none(data, axis) and returns: stacked