def unmap_url(srcdir, src, destdir='.'):
 if is_url(src):
  url_parts = urlparse.urlparse(src)
  filename = os.path.basename(url_parts[2])
  dest = os.path.join(destdir, filename)
  return get_file(src, dest)
 else:
  return os.path.join(srcdir, src)

def unmap_url ( srcdir , src , destdir = '.' ) : if is_url ( src ) : url_parts = urlparse . urlparse ( src ) filename = os . path . basename ( url_parts [ 2 ] ) dest = os . path . join ( destdir , filename ) return get_file ( src , dest ) else : return os . path . join ( srcdir , src )
receives either a path to a local file or a url .