parameters: (
  
      link,  # type: Link
  
      location,  # type: str
  
      download,  # type: Downloader
  
      download_dir=None,  # type: Optional[str]
  
      hashes=None,  # type: Optional[Hashes]
  
  )
return_statement: return file
docstring: Unpack link into location, downloading if required.
  
  
  
      :param hashes: A Hashes object, one of whose embedded hashes must match,
  
          or HashMismatch will be raised. If the Hashes is empty, no matches are
  
          required, and unhashable types of requirements (like VCS ones, which
  
          would ordinarily raise HashUnsupported) are allowed.
docstring_summary: Unpack link into location, downloading if required.
docstring_tokens: Unpack link into location downloading if required .
function: def unpack_url(
  
      link,  # type: Link
  
      location,  # type: str
  
      download,  # type: Downloader
  
      download_dir=None,  # type: Optional[str]
  
      hashes=None,  # type: Optional[Hashes]
  
  ):
  
      # type: (...) -> Optional[File]
  
      """Unpack link into location, downloading if required.
  
  
  
      :param hashes: A Hashes object, one of whose embedded hashes must match,
  
          or HashMismatch will be raised. If the Hashes is empty, no matches are
  
          required, and unhashable types of requirements (like VCS ones, which
  
          would ordinarily raise HashUnsupported) are allowed.
  
      """
  
      # non-editable vcs urls
  
      if link.is_vcs:
  
          unpack_vcs_link(link, location)
  
          return None
  
  
  
      # If it's a url to a local directory
  
      if link.is_existing_dir():
  
          if os.path.isdir(location):
  
              rmtree(location)
  
          _copy_source_tree(link.file_path, location)
  
          return None
  
  
  
      # file urls
  
      if link.is_file:
  
          file = get_file_url(link, download_dir, hashes=hashes)
  
  
  
      # http urls
  
      else:
  
          file = get_http_url(
  
              link,
  
              download,
  
              download_dir,
  
              hashes=hashes,
  
          )
  
  
  
      # unpack the archive to the build dir location. even when only downloading
  
      # archives, they have to be unpacked to parse dependencies, except wheels
  
      if not link.is_wheel:
  
          unpack_file(file.path, location, file.content_type)
  
  
  
      return file
function_tokens: def unpack_url ( link , # type: Link location , # type: str download , # type: Downloader download_dir = None , # type: Optional[str] hashes = None , # type: Optional[Hashes] ) : # type: (...) -> Optional[File] # non-editable vcs urls if link . is_vcs : unpack_vcs_link ( link , location ) return None # If it's a url to a local directory if link . is_existing_dir ( ) : if os . path . isdir ( location ) : rmtree ( location ) _copy_source_tree ( link . file_path , location ) return None # file urls if link . is_file : file = get_file_url ( link , download_dir , hashes = hashes ) # http urls else : file = get_http_url ( link , download , download_dir , hashes = hashes , ) # unpack the archive to the build dir location. even when only downloading # archives, they have to be unpacked to parse dependencies, except wheels if not link . is_wheel : unpack_file ( file . path , location , file . content_type ) return file