def urlretrieve(url, filename, data=None, timeout=300):
 logging.debug('Fetching %s -> %s', url, filename)
 src_file = urlopen(url, data=data, timeout=timeout)
 try:
  dest_file = open(filename, 'wb')
  try:
   shutil.copyfileobj(src_file, dest_file)
  finally:
   dest_file.close()
 finally:
  src_file.close()

def urlretrieve ( url , filename , data = None , timeout = 300 ) : logging . debug ( 'Fetching %s -> %s' , url , filename ) src_file = urlopen ( url , data = data , timeout = timeout ) try : dest_file = open ( filename , 'wb' ) try : shutil . copyfileobj ( src_file , dest_file ) finally : dest_file . close ( ) finally : src_file . close ( )
retrieve a file from given url .