code: def save_metadata(self, data_dir, feature_name=None):
      
      # Save names if defined
      if self._str2int is not None:
        names_filepath = _get_names_filepath(data_dir, feature_name)
        _write_names_to_file(names_filepath, self.names)
docs: See base class for details.