code: def compress_user(path):
      """Reverse of :func:`os.path.expanduser`"""
      home = os.path.expanduser("~")
      if path.startswith(home):
          path = "~" + path[len(home) :]
      return path
  
imports: import os
  import sys
  import errno
  import shutil
  import random
  import glob
  from IPython.utils.process import system
label_desc: Use image node_id 3 for calling a global function with example usage: compress_user(path) and returns: path