code: def indent(code, spaces=4):
      """indent a block of code with whitespace (default is 4 spaces)"""
      indent = indentsize(code)
      if type(spaces) is int:
          spaces = " " * spaces
      # if '\t' is provided, will indent with a tab
      nspaces = indentsize(spaces)
      # blank lines (etc) need to be ignored
      lines = code.split("\n")
      ##  stq = "'''"; dtq = '"""'
      ##  in_stq = in_dtq = False
      for i in range(len(lines)):
          # FIXME: works... but shouldn't indent 2nd+ lines of multiline doc
          _indent = indentsize(lines[i])
          if indent > _indent:
              continue
          lines[i] = spaces + lines[i]
      ##      #FIXME: may fail when stq and dtq in same line (depends on ordering)
      ##      nstq, ndtq = lines[i].count(stq), lines[i].count(dtq)
      ##      if not in_dtq and not in_stq:
      ##          lines[i] = spaces+lines[i] # we indent
      ##          # entering a comment block
      ##          if nstq%2: in_stq = not in_stq
      ##          if ndtq%2: in_dtq = not in_dtq
      ##      # leaving a comment block
      ##      elif in_dtq and ndtq%2: in_dtq = not in_dtq
      ##      elif in_stq and nstq%2: in_stq = not in_stq
      ##      else: pass
      if lines[-1].strip() == "":
          lines[-1] = ""
      return "\n".join(lines)
  
imports: import linecache
  import re
  from inspect import getblock, getfile, getmodule, getsourcefile, indentsize, isbuiltin, isclass, iscode, isframe, isfunction, ismethod, ismodule, istraceback
  from tokenize import TokenError
  from ._dill import IS_IPYTHON
label_desc: Use image node_id 12 for calling a global function with example usage: indent(code, spaces) and returns: str