parameters: (self, path)
docstring: :Description: saves all levels
  
          :param str path: a path where to save hierarchy files
                           This must be existing empty path,
                           otherwise exception is raised
docstring_summary: :Description: saves all levels
docstring_tokens: : Description : saves all levels
function: def save(self, path):
          """
          :Description: saves all levels
  
          :param str path: a path where to save hierarchy files
                           This must be existing empty path,
                           otherwise exception is raised
          """
          if len(glob.glob(os.path.join(path, "*"))):
              raise ValueError("Passed path should be empty")
  
          for level_idx, level in enumerate(self._levels):
              level.save(os.path.join(path, "level" +
                                      str(level_idx) + "_nwt.model"), model_name="n_wt")
              level.save(os.path.join(path, "level" +
                                      str(level_idx) + "_pwt.model"), model_name="p_wt")
  
          info = {"num_level_topics": [level.num_topics for level in self._levels],
                  "parent_level_weight": [level.parent_level_weight for level in self._levels[1:]]}
  
          with open(os.path.join(path, "info.dump"), "wb") as fout:
              pickle.dump(info, fout)
function_tokens: def save ( self , path ) : if len ( glob . glob ( os . path . join ( path , "*" ) ) ) : raise ValueError ( "Passed path should be empty" ) for level_idx , level in enumerate ( self . _levels ) : level . save ( os . path . join ( path , "level" + str ( level_idx ) + "_nwt.model" ) , model_name = "n_wt" ) level . save ( os . path . join ( path , "level" + str ( level_idx ) + "_pwt.model" ) , model_name = "p_wt" ) info = { "num_level_topics" : [ level . num_topics for level in self . _levels ] , "parent_level_weight" : [ level . parent_level_weight for level in self . _levels [ 1 : ] ] } with open ( os . path . join ( path , "info.dump" ) , "wb" ) as fout : pickle . dump ( info , fout )