def compress_user(path, tilde_expand, tilde_val):
 if tilde_expand:
  return path.replace(tilde_val, '~')
 else:
  return path

def compress_user ( path , tilde_expand , tilde_val ) : if tilde_expand : return path . replace ( tilde_val , '~' ) else : return path
reverse of :func:os .