code: def safe_extract(
      tar_file: TarFile, root: Path, members: list[TarInfo]
  ) -> None:
      """Extract safe members from a tar archive.
  
      Args:
          tar_file (TarFile): TarFile object.
          root (Path): Root directory where the dataset will be stored.
          members (List[TarInfo]): List of safe members to be extracted.
  
      """
      for member in members:
          tar_file.extract(member, root)
  
imports: from __future__ import annotations
  import hashlib
  import io
  import logging
  import os
  import re
  import tarfile
  from dataclasses import dataclass
  from pathlib import Path
  from tarfile import TarFile, TarInfo
  from typing import Iterable
  from urllib.request import urlretrieve
  from zipfile import ZipFile
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: safe_extract(tar_file, root, members) without return types