code: def save_instruments(
      self, instruments_data: Union[list, pd.DataFrame]
  ):
      self._instruments_dir.mkdir(parents=True, exist_ok=True)
      instruments_path = str(
          self._instruments_dir.joinpath(
              self.INSTRUMENTS_FILE_NAME
          ).resolve()
      )
      if isinstance(instruments_data, pd.DataFrame):
          _df_fields = [
              self.symbol_field_name,
              self.INSTRUMENTS_START_FIELD,
              self.INSTRUMENTS_END_FIELD,
          ]
          instruments_data = instruments_data.loc[:, _df_fields]
          instruments_data[self.symbol_field_name] = instruments_data[
              self.symbol_field_name
          ].apply(lambda x: fname_to_code(x.lower()).upper())
          instruments_data.to_csv(
              instruments_path,
              header=False,
              sep=self.INSTRUMENTS_SEP,
              index=False,
          )
      else:
          np.savetxt(
              instruments_path,
              instruments_data,
              fmt="%s",
              encoding="utf-8",
          )
  
imports: import abc
  import shutil
  import traceback
  from pathlib import Path
  from typing import Iterable, List, Union
  from functools import partial
  from concurrent.futures import ThreadPoolExecutor, as_completed, ProcessPoolExecutor
  import fire
  import numpy
  import pandas
  from tqdm import tqdm
  from loguru import logger
  from qlib.utils import fname_to_code, code_to_fname
label_desc: Use image node_id 11 for calling the DumpDataBase obj's underlying member method code with example usage: obj.save_instruments(instruments_data) without return types