docstr: Parameters
  ----------
  csv_path: str
      stock data path or directory
  qlib_dir: str
      qlib(dump) data director
  backup_dir: str, default None
      if backup_dir is not None, backup qlib_dir to backup_dir
  freq: str, default "day"
      transaction frequency
  max_workers: int, default None
      number of threads
  date_field_name: str, default "date"
      the name of the date field in the csv
  file_suffix: str, default ".csv"
      file suffix
  symbol_field_name: str, default "symbol"
      symbol field name
  include_fields: tuple
      dump fields
  exclude_fields: tuple
      fields not dumped
  limit_nums: int
      Use when debugging, default None
docstr_tok: ["Parameters","--","--","--","--","--","csv_path",":","str","stock","data","path","or","directory","qlib_dir",":","str","qlib","(","dump",")","data","director","backup_dir",":","str",",","default","None","if","backup_dir","is","not","None",",","backup","qlib_dir","to","backup_dir","freq",":","str",",","default","``","day","''","transaction","frequency","max_workers",":","int",",","default","None","number","of","threads","date_field_name",":","str",",","default","``","date","''","the","name","of","the","date","field","in","the","csv","file_suffix",":","str",",","default","``",".csv","''","file","suffix","symbol_field_name",":","str",",","default","``","symbol","''","symbol","field","name","include_fields",":","tuple","dump","fields","exclude_fields",":","tuple","fields","not","dumped","limit_nums",":","int","Use","when","debugging",",","default","None"]
code: def __init__(
      self,
      csv_path: str,
      qlib_dir: str,
      backup_dir: str = None,
      freq: str = "day",
      max_workers: int = 16,
      date_field_name: str = "date",
      file_suffix: str = ".csv",
      symbol_field_name: str = "symbol",
      exclude_fields: str = "",
      include_fields: str = "",
      limit_nums: int = None,
  ):
      """
  
      Parameters
      ----------
      csv_path: str
          stock data path or directory
      qlib_dir: str
          qlib(dump) data director
      backup_dir: str, default None
          if backup_dir is not None, backup qlib_dir to backup_dir
      freq: str, default "day"
          transaction frequency
      max_workers: int, default None
          number of threads
      date_field_name: str, default "date"
          the name of the date field in the csv
      file_suffix: str, default ".csv"
          file suffix
      symbol_field_name: str, default "symbol"
          symbol field name
      include_fields: tuple
          dump fields
      exclude_fields: tuple
          fields not dumped
      limit_nums: int
          Use when debugging, default None
      """
      csv_path = Path(csv_path).expanduser()
      if isinstance(exclude_fields, str):
          exclude_fields = exclude_fields.split(",")
      if isinstance(include_fields, str):
          include_fields = include_fields.split(",")
      self._exclude_fields = tuple(
          filter(lambda x: len(x) > 0, map(str.strip, exclude_fields))
      )
      self._include_fields = tuple(
          filter(lambda x: len(x) > 0, map(str.strip, include_fields))
      )
      self.file_suffix = file_suffix
      self.symbol_field_name = symbol_field_name
      self.csv_files = sorted(
          csv_path.glob(f"*{self.file_suffix}")
          if csv_path.is_dir()
          else [csv_path]
      )
      if limit_nums is not None:
          self.csv_files = self.csv_files[: int(limit_nums)]
      self.qlib_dir = Path(qlib_dir).expanduser()
      self.backup_dir = (
          backup_dir
          if backup_dir is None
          else Path(backup_dir).expanduser()
      )
      if backup_dir is not None:
          self._backup_qlib_dir(Path(backup_dir).expanduser())
  
      self.freq = freq
      self.calendar_format = (
          self.DAILY_FORMAT
          if self.freq == "day"
          else self.HIGH_FREQ_FORMAT
      )
  
      self.works = max_workers
      self.date_field_name = date_field_name
  
      self._calendars_dir = self.qlib_dir.joinpath(
          self.CALENDARS_DIR_NAME
      )
      self._features_dir = self.qlib_dir.joinpath(
          self.FEATURES_DIR_NAME
      )
      self._instruments_dir = self.qlib_dir.joinpath(
          self.INSTRUMENTS_DIR_NAME
      )
  
      self._calendars_list = []
  
      self._mode = self.ALL_MODE
      self._kwargs = {}
  
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 1 to create a new DumpDataBase object  with example: obj = DumpDataBase(csv_path, qlib_dir, backup_dir, freq, max_workers, date_field_name, file_suffix, symbol_field_name, exclude_fields, include_fields, limit_nums)