def save(self, path=None, complevel=<NUM_LIT:1>, complib='<STR_LIT>'):
if path is None:<EOL><INDENT>path = self.hexuid + '<STR_LIT>'<EOL><DEDENT>elif os.path.isdir(path):<EOL><INDENT>path += os.sep + self.hexuid + '<STR_LIT>'<EOL><DEDENT>elif not (path.endswith('<STR_LIT>') or path.endswith('<STR_LIT>')):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>with pd.HDFStore(path, '<STR_LIT:w>', complevel=complevel, complib=complib) as store:<EOL><INDENT>store['<STR_LIT>'] = pd.Series()<EOL>store.get_storer('<STR_LIT>').attrs.metadata = self._rel()<EOL>fc = <NUM_LIT:0>    <EOL>for name, data in self._data().items():<EOL><INDENT>if hasattr(data, '<STR_LIT>'):<EOL><INDENT>data._revert_categories()<EOL><DEDENT>name = name[<NUM_LIT:1>:] if name.startswith('<STR_LIT:_>') else name<EOL>if isinstance(data, Field):    <EOL><INDENT>fname = '<STR_LIT>'.format(fc) + name + '<STR_LIT:/>'<EOL>store[fname + '<STR_LIT:data>'] = pd.DataFrame(data)<EOL>for i, field in enumerate(data.field_values):<EOL><INDENT>ffname = fname + '<STR_LIT>' + str(i)<EOL>if isinstance(field, pd.Series):<EOL><INDENT>store[ffname] = pd.Series(field)<EOL><DEDENT>else:<EOL><INDENT>store[ffname] = pd.DataFrame(field)<EOL><DEDENT><DEDENT>fc += <NUM_LIT:1><EOL><DEDENT>elif isinstance(data, Series):<EOL><INDENT>s = pd.Series(data)<EOL>if isinstance(data.dtype, pd.types.dtypes.CategoricalDtype):<EOL><INDENT>s = s.astype('<STR_LIT:O>')<EOL><DEDENT>store[name] = s<EOL><DEDENT>elif isinstance(data, DataFrame):<EOL><INDENT>store[name] = pd.DataFrame(data)<EOL><DEDENT>elif isinstance(data, SparseSeries):<EOL><INDENT>s = pd.SparseSeries(data)<EOL>if isinstance(data.dtype, pd.types.dtypes.CategoricalDtype):<EOL><INDENT>s = s.astype('<STR_LIT:O>')<EOL><DEDENT>store[name] = s<EOL><DEDENT>elif isinstance(data, SparseDataFrame):<EOL><INDENT>store[name] = pd.SparseDataFrame(data)<EOL><DEDENT>else:<EOL><INDENT>if hasattr(data, '<STR_LIT>') and isinstance(data.dtype, pd.types.dtypes.CategoricalDtype):<EOL><INDENT>data = data.astype('<STR_LIT:O>')<EOL><DEDENT>else:<EOL><INDENT>for col in data:<EOL><INDENT>if isinstance(data[col].dtype, pd.types.dtypes.CategoricalDtype):<EOL><INDENT>data[col] = data[col].astype('<STR_LIT:O>')<EOL><DEDENT><DEDENT><DEDENT>store[name] = data<EOL><DEDENT>if hasattr(data, '<STR_LIT>'):<EOL><INDENT>data._set_categories()<EOL><DEDENT><DEDENT><DEDENT>
Save the container as an HDF5 archive.

Args:
    path (str): Path where to save the container