def extract_zip(source, remove=False, fatal=True):
 tempdir = tempfile.mkdtemp()
 zip_file = SafeUnzip(source)
 try:
  if zip_file.is_valid(fatal):
   zip_file.extract_to_dest(tempdir)
 except:
  rm_local_tmp_dir(tempdir)
  raise
 if remove:
  os.remove(source)
 return tempdir

def extract_zip ( source , remove = False , fatal = True ) : tempdir = tempfile . mkdtemp ( ) zip_file = SafeUnzip ( source ) try : if zip_file . is_valid ( fatal ) : zip_file . extract_to_dest ( tempdir ) except : rm_local_tmp_dir ( tempdir ) raise if remove : os . remove ( source ) return tempdir
extracts the zip file .