parameters: (input_dir, zip_file)
docstring: Creates a zip archive of the specified input directory.
docstring_summary: Creates a zip archive of the specified input directory.
docstring_tokens: Creates a zip archive of the specified input directory .
function: def create_archive(input_dir, zip_file):
    """ Creates a zip archive of the specified input directory. """
    zf = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED)
    def addDir(dir):
      for f in os.listdir(dir):
        full_path = os.path.join(dir, f)
        if os.path.isdir(full_path):
          addDir(full_path)
        else:
          zf.write(full_path, os.path.relpath(full_path, \
                   os.path.join(input_dir, os.pardir)))
    addDir(input_dir)
    zf.close()
function_tokens: def create_archive ( input_dir , zip_file ) : zf = zipfile . ZipFile ( zip_file , 'w' , zipfile . ZIP_DEFLATED ) def addDir ( dir ) : for f in os . listdir ( dir ) : full_path = os . path . join ( dir , f ) if os . path . isdir ( full_path ) : addDir ( full_path ) else : zf . write ( full_path , os . path . relpath ( full_path , os . path . join ( input_dir , os . pardir ) ) ) addDir ( input_dir ) zf . close ( )