<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save(self, path, table_format='txt', sep='\t', table_ext=None, float_format='%.12g'):
 """ Saving the system to path Parameters path : pathlib.Path or string path for the saved data (will be created if necessary, data within will be overwritten). table_format : string Format to save the DataFrames: - 'pkl' : Binary pickle files, alias: 'pickle', 'bin', 'binary' - 'txt' : Text files (default), alias: 'text', 'csv' table_ext : string, optional File extension, default depends on table_format(.pkl for pickle, .txt for text) sep : string, optional Field delimiter for the output file, only for txt files. Default: tab ('\t') float_format : string, optional Format for saving the DataFrames, default = '%.12g', only for txt files """


        if type(path) is str:
            path = path.rstrip('\\')
            path = Path(path)

        path.mkdir(parents=True, exist_ok=True)

        para_file_path = path / DEFAULT_FILE_NAMES['filepara']
        file_para = dict()
        file_para['files'] = dict()

        if table_format in ['text', 'csv', 'txt']:
            table_format = 'txt'
        elif table_format in ['pickle', 'bin', 'binary', 'pkl']:
            table_format = 'pkl'
        else:
            raise ValueError('Unknown table format "{}" - '
                             'must be "txt" or "pkl"'.format(table_format))
            return None

        if not table_ext:
            if table_format == 'txt':
                table_ext = '.txt'
            if table_format == 'pkl':
                table_ext = '.pkl'

        if str(type(self)) == "<class 'pymrio.core.mriosystem.IOSystem'>":
            file_para['systemtype'] = GENERIC_NAMES['iosys']
        elif str(type(self)) == "<class 'pymrio.core.mriosystem.Extension'>":
            file_para['systemtype'] = GENERIC_NAMES['ext']
            file_para['name'] = self.name
        else:
            logging.warn('Unknown system type {} - set to "undef"'.format(
                str(type(self))))
            file_para['systemtype'] = 'undef'

        for df, df_name in zip(self.get_DataFrame(data=True),
                               self.get_DataFrame()):
            if type(df.index) is pd.MultiIndex:
                nr_index_col = len(df.index.levels)
            else:
                nr_index_col = 1

            if type(df.columns) is pd.MultiIndex:
                nr_header = len(df.columns.levels)
            else:
                nr_header = 1

            save_file = df_name + table_ext
            save_file_with_path = path / save_file
            logging.info('Save file {}'.format(save_file_with_path))
            if table_format == 'txt':
                df.to_csv(save_file_with_path, sep=sep,
                          float_format=float_format)
            else:
                df.to_pickle(save_file_with_path)

            file_para['files'][df_name] = dict()
            file_para['files'][df_name]['name'] = save_file
            file_para['files'][df_name]['nr_index_col'] = str(nr_index_col)
            file_para['files'][df_name]['nr_header'] = str(nr_header)

        with para_file_path.open(mode='w') as pf:
            json.dump(file_para, pf, indent=4)

        if file_para['systemtype'] == GENERIC_NAMES['iosys']:
            if not self.meta:
                self.meta = MRIOMetaData(name=self.name,
                                         location=path)

            self.meta._add_fileio("Saved {} to {}".format(self.name, path))
            self.meta.save(location=path)

        return self