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 "quarterly"
      data frequency
  max_workers: int, default None
      number of threads
  date_column_name: str, default "date"
      the name of the date field in the csv
  file_suffix: str, default ".csv"
      file suffix
  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","``","quarterly","''","data","frequency","max_workers",":","int",",","default","None","number","of","threads","date_column_name",":","str",",","default","``","date","''","the","name","of","the","date","field","in","the","csv","file_suffix",":","str",",","default","``",".csv","''","file","suffix","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 = "quarterly",
      max_workers: int = 16,
      date_column_name: str = "date",
      period_column_name: str = "period",
      value_column_name: str = "value",
      field_column_name: str = "field",
      file_suffix: str = ".csv",
      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 "quarterly"
          data frequency
      max_workers: int, default None
          number of threads
      date_column_name: str, default "date"
          the name of the date field in the csv
      file_suffix: str, default ".csv"
          file suffix
      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.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.works = max_workers
      self.date_column_name = date_column_name
      self.period_column_name = period_column_name
      self.value_column_name = value_column_name
      self.field_column_name = field_column_name
  
      self._mode = self.ALL_MODE
  
imports: import shutil
  import struct
  from pathlib import Path
  from typing import Iterable
  from functools import partial
  from concurrent.futures import ProcessPoolExecutor
  import fire
  import pandas
  from tqdm import tqdm
  from loguru import logger
  from qlib.utils import fname_to_code, get_period_offset
  from qlib.config import C
label_desc: Use image node_id 1 to create a new DumpPitData object  with example: obj = DumpPitData(csv_path, qlib_dir, backup_dir, freq, max_workers, date_column_name, period_column_name, value_column_name, field_column_name, file_suffix, exclude_fields, include_fields, limit_nums)