code: def shellglob(args):
      """
      Do glob expansion for each element in `args` and return a flattened list.
  
      Unmatched glob pattern will remain as-is in the returned list.
  
      """
      expanded = []
      # Do not unescape backslash in Windows as it is interpreted as
      # path separator:
      unescape = (
          unescape_glob if sys.platform != "win32" else lambda x: x
      )
      for a in args:
          expanded.extend(glob.glob(a) or [unescape(a)])
      return expanded
  
imports: import os
  import sys
  import errno
  import shutil
  import random
  import glob
  from warnings import warn
  from hashlib import md5
  from IPython.utils.process import system
  from IPython.utils import py3compat
  from IPython.utils.decorators import undoc
label_desc: Use image node_id 17 for calling a global function with example usage: shellglob(args) and returns: expanded