def download_package_dict(package_name):
 global download_count, not_found_count
 download_count += 1
 if ((download_count % 1000) == 0):
  logger.info('Downloaded %s packages (%s not found)', download_count, not_found_count)
 response = session.get(('https://pypi.python.org/pypi/%s/json' % package_name))
 if (response.status_code == requests.codes.ok):
  return response.json()
 elif (response.status_code == requests.codes.not_found):
  not_found_count += 1
 else:
  logger.warning('Unexpected error code for package %s: %s', package_name, response.status_code)

def download_package_dict ( package_name ) : global download_count , not_found_count download_count += 1 if ( ( download_count % 1000 ) == 0 ) : logger . info ( 'Downloaded %s packages (%s not found)' , download_count , not_found_count ) response = session . get ( ( 'https://pypi.python.org/pypi/%s/json' % package_name ) ) if ( response . status_code == requests . codes . ok ) : return response . json ( ) elif ( response . status_code == requests . codes . not_found ) : not_found_count += 1 else : logger . warning ( 'Unexpected error code for package %s: %s' , package_name , response . status_code )
download the given package .