class_docstr: Dataset creator
class_docstr_tok: ["Dataset","creator"]
code: def import_data(self, doc_type_l=["Tick", "Transaction", "Order"]):
      # clear all the old files
      for fp in (
          LOG_FILE_PATH,
          DATA_INFO_PATH,
          DATA_FINISH_INFO_PATH,
          DATA_PATH,
      ):
          self._get_empty_folder(fp)
  
      arc = Arctic(ARCTIC_SRV)
      for doc_type in DOC_TYPE:
          # arc.initialize_library(get_library_name(doc_type), lib_type=CHUNK_STORE)
          arc.set_quota(get_library_name(doc_type), MAX_SIZE)
      arc.reset()
  
      # doc_type = 'Day'
      for doc_type in doc_type_l:
          date_list = list(
              set(
                  [
                      int(path.split("_")[0])
                      for path in os.listdir(DATABASE_PATH)
                      if doc_type in path
                  ]
              )
          )
          date_list.sort()
          date_list = [str(date) for date in date_list]
  
          f = open(ALL_STOCK_PATH, "r")
          stock_name_list = [
              lines.split("\t")[0] for lines in f.readlines()
          ]
          f.close()
          stock_name_dict = {
              "SH": [
                  stock_name[2:]
                  for stock_name in stock_name_list
                  if "SH" in stock_name
              ],
              "SZ": [
                  stock_name[2:]
                  for stock_name in stock_name_list
                  if "SZ" in stock_name
              ],
          }
  
          lib_name = get_library_name(doc_type)
          a = Arctic(ARCTIC_SRV)
          # a.initialize_library(lib_name, lib_type=CHUNK_STORE)
  
          stock_name_exist = a[lib_name].list_symbols()
          lib = a[lib_name]
          initialize_count = 0
          for stock_name in stock_name_list:
              if stock_name not in stock_name_exist:
                  initialize_count += 1
                  # A placeholder for stocks
                  pdf = pd.DataFrame(index=[pd.Timestamp("1900-01-01")])
                  pdf.index.name = (
                      "date"  # an col named date is necessary
                  )
                  lib.write(stock_name, pdf)
          print("initialize count: {}".format(initialize_count))
          print("tasks: {}".format(date_list))
          a.reset()
  
          # date_list = [files.split("_")[0] for files in os.listdir("./raw_data_price") if "tar" in files]
          # print(len(date_list))
          date_list = ["20201231"]  # for test
          Parallel(n_jobs=min(2, len(date_list)))(
              delayed(add_data)(date, doc_type, stock_name_dict)
              for date in date_list
          )
  
imports: from datetime import date, datetime
  import os
  from pathlib import Path
  import random
  import shutil
  import time
  import traceback
  from arctic import Arctic, chunkstore
  import arctic
  from arctic import Arctic, CHUNK_STORE
  from arctic.chunkstore.chunkstore import CHUNK_SIZE
  import fire
  from joblib import Parallel, delayed, parallel
  import numpy
  import pandas
  from pandas import DataFrame
  from pandas.core.indexes.datetimes import date_range
  from pymongo.mongo_client import MongoClient
label_desc: Use image node_id 4 for calling the DSCreator obj's underlying member method code with example usage: obj.import_data(doc_type_l) without return types