code: def _preprocess_patch_list(plist):
      plist = np.asarray(plist)
      assert plist.dtype != np.object
      if plist.ndim == 3:
          plist = plist[:, :, :, np.newaxis]
      assert plist.ndim == 4 and plist.shape[3] in [1, 3], plist.shape
      return plist
  
file_path: tensorpack/tensorpack/utils/viz.py
imports: import numpy
  import os
  import sys
  from ..utils.develop import create_dummy_func
  from .argtools import shape2d
  from .fs import mkdir_p
label_desc: Use image node_id 2 for calling a global function with example usage: _preprocess_patch_list(plist) and returns: plist