class_docstr: A naive pipeline for obtaining dataset.
  
  download -> extract -> move
  
  Args:
      files (list[dict]): A list of file information.
      cache_path (str): The path to cache the downloaded files.
      data_root (str): The root path of the dataset. It is usually set auto-
          matically and users do not need to set it manually in config file
          in most cases.
      task (str): The task of the dataset. It is usually set automatically
          and users do not need to set it manually in config file
          in most cases.
class_docstr_tok: ["A","naive","pipeline","for","obtaining","dataset",".","download","-",">","extract","-",">","move","Args",":","files","(","list","[","dict","]",")",":","A","list","of","file","information",".","cache_path","(","str",")",":","The","path","to","cache","the","downloaded","files",".","data_root","(","str",")",":","The","root","path","of","the","dataset",".","It","is","usually","set","auto-","matically","and","users","do","not","need","to","set","it","manually","in","config","file","in","most","cases",".","task","(","str",")",":","The","task","of","the","dataset",".","It","is","usually","set","automatically","and","users","do","not","need","to","set","it","manually","in","config","file","in","most","cases","."]
docstr: Extract zip/tar.gz files.
  
  Args:
      src_path (str): Path to the zip file.
      dst_path (str): Path to the destination folder.
      delete (bool, optional): Whether to delete the zip file. Defaults
          to False.
docstr_tok: ["Extract","zip\/tar.gz","files",".","Args",":","src_path","(","str",")",":","Path","to","the","zip","file",".","dst_path","(","str",")",":","Path","to","the","destination","folder",".","delete","(","bool",",","optional",")",":","Whether","to","delete","the","zip","file",".","Defaults","to","False","."]
code: def extract(
      self, src_path: str, dst_path: str, delete: bool = False
  ) -> None:
      """Extract zip/tar.gz files.
  
      Args:
          src_path (str): Path to the zip file.
          dst_path (str): Path to the destination folder.
          delete (bool, optional): Whether to delete the zip file. Defaults
              to False.
      """
      if not is_archive(src_path):
          # Copy the file to the destination folder if it is not a zip
          if osp.isfile(src_path):
              shutil.copy(src_path, dst_path)
          else:
              shutil.copytree(src_path, dst_path)
          return
  
      zip_name = osp.basename(src_path).split(".")[0]
      if dst_path is None:
          dst_path = osp.join(osp.dirname(src_path), zip_name)
      else:
          dst_path = osp.join(dst_path, zip_name)
  
      extracted = False
      if osp.exists(dst_path):
          name = set(os.listdir(dst_path))
          if ".finish" in name:
              extracted = True
          elif ".finish" not in name and len(name) > 0:
              while True:
                  c = (
                      input(
                          f"{dst_path} already exists when extracting "
                          "{zip_name}, unzip again? (y/N) "
                      )
                      or "N"
                  )
                  if c.lower() in ["y", "n"]:
                      extracted = c == "n"
                      break
      if extracted:
          open(osp.join(dst_path, ".finish"), "w").close()
          print(f"{zip_name} has been extracted. Skip")
          return
      mkdir_or_exist(dst_path)
      print(f"Extracting: {osp.basename(src_path)}")
      if src_path.endswith(".zip"):
          try:
              import zipfile
          except ImportError:
              raise ImportError(
                  'Please install zipfile by running "pip install zipfile".'
              )
          with zipfile.ZipFile(src_path, "r") as zip_ref:
              zip_ref.extractall(dst_path)
      elif src_path.endswith(".tar.gz") or src_path.endswith(".tar"):
          if src_path.endswith(".tar.gz"):
              mode = "r:gz"
          elif src_path.endswith(".tar"):
              mode = "r:"
          try:
              import tarfile
          except ImportError:
              raise ImportError(
                  'Please install tarfile by running "pip install tarfile".'
              )
          with tarfile.open(src_path, mode) as tar_ref:
              tar_ref.extractall(dst_path)
  
      open(osp.join(dst_path, ".finish"), "w").close()
      if delete:
          os.remove(src_path)
  
file_path: mmocr/mmocr/datasets/preparers/obtainers/naive_data_obtainer.py
imports: import glob
  import os
  import os.path
  import shutil
  import ssl
  import urllib.request
  from typing import Dict, List, Optional, Tuple
  from mmengine import mkdir_or_exist
  from mmocr.registry import DATA_OBTAINERS
  from mmocr.utils import check_integrity, is_archive
label_desc: Use image node_id 4 for calling the NaiveDataObtainer obj's underlying member method code with example usage: obj.extract(src_path, dst_path, delete) without return types