docstr: download cn qlib data from remote
  
  Parameters
  ----------
  target_dir: str
      data save directory
  name: str
      dataset name, value from [qlib_data, qlib_data_simple], by default qlib_data
  version: str
      data version, value from [v1, ...], by default None(use script to specify version)
  interval: str
      data freq, value from [1d], by default 1d
  region: str
      data region, value from [cn, us], by default cn
  delete_old: bool
      delete an existing directory, by default True
  exists_skip: bool
      exists skip, by default False
  
  Examples
  ---------
  # get 1d data
  python get_data.py qlib_data --name qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
  When this command is run, the data will be downloaded from this link: https://qlibpublic.blob.core.windows.net/data/default/stock_data/v2/qlib_data_cn_1d_latest.zip?{token}
  
  # get 1min data
  python get_data.py qlib_data --name qlib_data --target_dir ~/.qlib/qlib_data/cn_data_1min --interval 1min --region cn
  When this command is run, the data will be downloaded from this link: https://qlibpublic.blob.core.windows.net/data/default/stock_data/v2/qlib_data_cn_1min_latest.zip?{token}
  -------
docstr_tok: ["download","cn","qlib","data","from","remote","Parameters","--","--","--","--","--","target_dir",":","str","data","save","directory","name",":","str","dataset","name",",","value","from","[","qlib_data",",","qlib_data_simple","]",",","by","default","qlib_data","version",":","str","data","version",",","value","from","[","v1",",","...","]",",","by","default","None","(","use","script","to","specify","version",")","interval",":","str","data","freq",",","value","from","[","1d","]",",","by","default","1d","region",":","str","data","region",",","value","from","[","cn",",","us","]",",","by","default","cn","delete_old",":","bool","delete","an","existing","directory",",","by","default","True","exists_skip",":","bool","exists","skip",",","by","default","False","Examples","--","--","--","--","-","#","get","1d","data","python","get_data.py","qlib_data","--","name","qlib_data","--","target_dir","~\/.qlib\/qlib_data\/cn_data","--","interval","1d","--","region","cn","When","this","command","is","run",",","the","data","will","be","downloaded","from","this","link",":","https",":","\/\/qlibpublic.blob.core.windows.net\/data\/default\/stock_data\/v2\/qlib_data_cn_1d_latest.zip","?","{","token","}","#","get","1min","data","python","get_data.py","qlib_data","--","name","qlib_data","--","target_dir","~\/.qlib\/qlib_data\/cn_data_1min","--","interval","1min","--","region","cn","When","this","command","is","run",",","the","data","will","be","downloaded","from","this","link",":","https",":","\/\/qlibpublic.blob.core.windows.net\/data\/default\/stock_data\/v2\/qlib_data_cn_1min_latest.zip","?","{","token","}","--","--","--","-"]
code: def qlib_data(
      self,
      name="qlib_data",
      target_dir="~/.qlib/qlib_data/cn_data",
      version=None,
      interval="1d",
      region="cn",
      delete_old=True,
      exists_skip=False,
  ):
      """download cn qlib data from remote
  
      Parameters
      ----------
      target_dir: str
          data save directory
      name: str
          dataset name, value from [qlib_data, qlib_data_simple], by default qlib_data
      version: str
          data version, value from [v1, ...], by default None(use script to specify version)
      interval: str
          data freq, value from [1d], by default 1d
      region: str
          data region, value from [cn, us], by default cn
      delete_old: bool
          delete an existing directory, by default True
      exists_skip: bool
          exists skip, by default False
  
      Examples
      ---------
      # get 1d data
      python get_data.py qlib_data --name qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
      When this command is run, the data will be downloaded from this link: https://qlibpublic.blob.core.windows.net/data/default/stock_data/v2/qlib_data_cn_1d_latest.zip?{token}
  
      # get 1min data
      python get_data.py qlib_data --name qlib_data --target_dir ~/.qlib/qlib_data/cn_data_1min --interval 1min --region cn
      When this command is run, the data will be downloaded from this link: https://qlibpublic.blob.core.windows.net/data/default/stock_data/v2/qlib_data_cn_1min_latest.zip?{token}
      -------
  
      """
      if exists_skip and exists_qlib_data(target_dir):
          logger.warning(
              f"Data already exists: {target_dir}, the data download will be skipped\n"
              f"\tIf downloading is required: `exists_skip=False` or `change target_dir`"
          )
          return
  
      qlib_version = ".".join(re.findall(r"(\d+)\.+", qlib.__version__))
  
      def _get_file_name_with_version(qlib_version, dataset_version):
          dataset_version = (
              "v2" if dataset_version is None else dataset_version
          )
          file_name_with_version = f"{dataset_version}/{name}_{region.lower()}_{interval.lower()}_{qlib_version}.zip"
          return file_name_with_version
  
      file_name = _get_file_name_with_version(
          qlib_version, dataset_version=version
      )
      if not self.check_dataset(file_name):
          file_name = _get_file_name_with_version(
              "latest", dataset_version=version
          )
      self.download_data(file_name.lower(), target_dir, delete_old)
  
imports: import os
  import re
  import sys
  import qlib
  import shutil
  import zipfile
  import requests
  import datetime
  from tqdm import tqdm
  from pathlib import Path
  from loguru import logger
  from cryptography.fernet import Fernet
  from qlib.utils import exists_qlib_data
label_desc: Use image node_id 7 for calling the GetData obj's underlying member method code with example usage: obj.qlib_data(name, target_dir, version, interval, region, delete_old, exists_skip) and returns: file_name_with_version