code: def fill_missing(x):
      # ppca if missing data
      m = PPCA()
      m.fit(data=np.vstack(x))
      x_pca = m.transform()
  
      # if the whole row is missing, return nans
      all_missing = [
          idx
          for idx, a in enumerate(np.vstack(x))
          if all([type(b) == np.nan for b in a])
      ]
      if len(all_missing) > 0:
          for i in all_missing:
              x_pca[i, :] = np.nan
  
      # get the original lists back
      if len(x) > 1:
          x_split = np.cumsum([i.shape[0] for i in x][:-1])
          return list(np.split(x_pca, x_split, axis=0))
      else:
          return [x_pca]
  
imports: import warnings
  import numpy
  from .._externals.ppca import PPCA
  from .._shared.helpers import get_type
label_desc: Use image node_id 2 for calling a global function with example usage: fill_missing(x) and returns: list, list