parameters: (context, directory_path, aggregated_directories=None, aggregated_content=None)
docstring: Creates a zip file containing the contents of the specified directory.
  
      Args:
  
          context: A Context object.
  
          directory_path: The path to the directory to zip.
  
          aggregated_directories (named): a dictionary where the values are additional
          directories whose contents will be included in the zip file, as either a single
          directory path string or a list of directory path strings. The keys are
          the path in the zip file where the content is put. By default no additional
          directories are included.
  
          aggregated_content (named): a dictionary where the values are additional content
          to include in the zip file. The keys are the path in the zip file where the
          content is put. By default no additional content is included.
  
      Returns:
  
          The full path to the created zip file.
           
      Note:
  
          The directory may contain a .ignore file. If it does, the file should contain
          the names of the files in the directory that will not be included in the zip.
docstring_summary: Creates a zip file containing the contents of the specified directory.
docstring_tokens: Creates a zip file containing the contents of the specified directory .
function: def zip_directory(context, directory_path, aggregated_directories=None, aggregated_content=None):
      '''Creates a zip file containing the contents of the specified directory.
  
      Args:
  
          context: A Context object.
  
          directory_path: The path to the directory to zip.
  
          aggregated_directories (named): a dictionary where the values are additional
          directories whose contents will be included in the zip file, as either a single
          directory path string or a list of directory path strings. The keys are
          the path in the zip file where the content is put. By default no additional
          directories are included.
  
          aggregated_content (named): a dictionary where the values are additional content
          to include in the zip file. The keys are the path in the zip file where the
          content is put. By default no additional content is included.
  
      Returns:
  
          The full path to the created zip file.
           
      Note:
  
          The directory may contain a .ignore file. If it does, the file should contain
          the names of the files in the directory that will not be included in the zip. 
  
      '''
  
      with tempfile.NamedTemporaryFile(
          prefix=os.path.basename(directory_path) + '_', 
          suffix='.zip', 
          dir=os.path.dirname(directory_path),
          delete=False) as file:
              zip_file_path = file.name
  
      try:
  
          with ZipFile(zip_file_path, 'w') as zip_file:
                  
              __zip_directory(context, zip_file, zip_file_path, directory_path)
  
              if aggregated_directories:
                  for destination_path, directory_paths in six.iteritems(aggregated_directories):
                      if not isinstance(directory_paths, list):
                          directory_paths= [ directory_paths ]
                      for directory_path in directory_paths:
                          __zip_directory(context, zip_file, zip_file_path, directory_path, destination_path)
  
              if aggregated_content:
                  for destination_path, content in six.iteritems(aggregated_content):
                      __zip_content(context, zip_file, zip_file_path, destination_path, content)
  
          return zip_file_path
  
      except:
          if os.path.exists(zip_file_path):
              context.view.deleting_file(zip_file_path)
              os.remove(zip_file_path)
          raise
function_tokens: def zip_directory ( context , directory_path , aggregated_directories = None , aggregated_content = None ) : with tempfile . NamedTemporaryFile ( prefix = os . path . basename ( directory_path ) + '_' , suffix = '.zip' , dir = os . path . dirname ( directory_path ) , delete = False ) as file : zip_file_path = file . name try : with ZipFile ( zip_file_path , 'w' ) as zip_file : __zip_directory ( context , zip_file , zip_file_path , directory_path ) if aggregated_directories : for destination_path , directory_paths in six . iteritems ( aggregated_directories ) : if not isinstance ( directory_paths , list ) : directory_paths = [ directory_paths ] for directory_path in directory_paths : __zip_directory ( context , zip_file , zip_file_path , directory_path , destination_path ) if aggregated_content : for destination_path , content in six . iteritems ( aggregated_content ) : __zip_content ( context , zip_file , zip_file_path , destination_path , content ) return zip_file_path except : if os . path . exists ( zip_file_path ) : context . view . deleting_file ( zip_file_path ) os . remove ( zip_file_path ) raise