code: def get_date_range(
      data_1min_dir: Path,
      max_workers: int = 16,
      date_field_name: str = "date",
  ):
      csv_files = list(data_1min_dir.glob("*.csv"))
      min_date = None
      max_date = None
      with tqdm(total=len(csv_files)) as p_bar:
          with ThreadPoolExecutor(max_workers=max_workers) as executor:
              for _file, _result in zip(
                  csv_files, executor.map(pd.read_csv, csv_files)
              ):
                  if not _result.empty:
                      _dates = pd.to_datetime(_result[date_field_name])
  
                      _tmp_min = _dates.min()
                      min_date = (
                          min(min_date, _tmp_min)
                          if min_date is not None
                          else _tmp_min
                      )
                      _tmp_max = _dates.max()
                      max_date = (
                          max(max_date, _tmp_max)
                          if max_date is not None
                          else _tmp_max
                      )
                  p_bar.update()
      return min_date, max_date
  
file_path: qlib/scripts/data_collector/contrib/fill_cn_1min_data/fill_cn_1min_data.py
imports: import sys
  from pathlib import Path
  from concurrent.futures import ThreadPoolExecutor
  import fire
  import qlib
  import pandas
  from tqdm import tqdm
  from qlib.data import D
  from loguru import logger
  from data_collector.utils import generate_minutes_calendar_from_daily
label_desc: Use image node_id 1 for calling a global function with example usage: get_date_range(data_1min_dir, max_workers, date_field_name) and returns: min_date,  max_date