parameters: (self, links, location)
docstring: Download the files given by links into location.
docstring_summary: Download the files given by links into location.
docstring_tokens: Download the files given by links into location .
function: def __call__(self, links, location):
  
          # type: (Iterable[Link], str) -> Iterable[Tuple[str, Tuple[str, str]]]
  
          """Download the files given by links into location."""
  
          for link in links:
  
              try:
  
                  resp = _http_get_download(self._session, link)
  
              except NetworkConnectionError as e:
  
                  assert e.response is not None
  
                  logger.critical(
  
                      "HTTP error %s while getting %s",
  
                      e.response.status_code, link,
  
                  )
  
                  raise
  
  
  
              filename = _get_http_response_filename(resp, link)
  
              filepath = os.path.join(location, filename)
  
  
  
              chunks = _prepare_download(resp, link, self._progress_bar)
  
              with open(filepath, 'wb') as content_file:
  
                  for chunk in chunks:
  
                      content_file.write(chunk)
  
              content_type = resp.headers.get('Content-Type', '')
  
              yield link.url, (filepath, content_type)
function_tokens: def __call__ ( self , links , location ) : # type: (Iterable[Link], str) -> Iterable[Tuple[str, Tuple[str, str]]] for link in links : try : resp = _http_get_download ( self . _session , link ) except NetworkConnectionError as e : assert e . response is not None logger . critical ( "HTTP error %s while getting %s" , e . response . status_code , link , ) raise filename = _get_http_response_filename ( resp , link ) filepath = os . path . join ( location , filename ) chunks = _prepare_download ( resp , link , self . _progress_bar ) with open ( filepath , 'wb' ) as content_file : for chunk in chunks : content_file . write ( chunk ) content_type = resp . headers . get ( 'Content-Type' , '' ) yield link . url , ( filepath , content_type )