code: def map_path(url, root_dir, path_depth=1):
      # parse path after download to decompress under root_dir
      assert path_depth > 0, "path_depth should be a positive integer"
      dirname = url
      for _ in range(path_depth):
          dirname = osp.dirname(dirname)
      fpath = osp.relpath(url, dirname)
  
      zip_formats = [".zip", ".tar", ".gz"]
      for zip_format in zip_formats:
          fpath = fpath.replace(zip_format, "")
      return osp.join(root_dir, fpath)
  
imports: import os, sys
  import os.path
  import hashlib
  import requests
  import shutil
  import tqdm
  import time
  import tarfile
  import zipfile
  from paddle.utils.download import _get_unique_endpoints
label_desc: Use image node_id 3 for calling a global function with example usage: map_path(url, root_dir, path_depth) and returns: osp