class_docstr: python -m pytorch_toolbelt.datasets.providers.inria_aerial inria_dataset
code: def download_and_extract(cls, data_dir: Union[str, Path]) -> bool:
      try:
          from py7zr import py7zr
      except ImportError:
          print(
              "You need to install py7zr to extract 7z-archive: `pip install py7zr`."
          )
          return False
  
      filenames = []
      for file_url, file_hash in cls.urls.items():
          file_path = os.path.join(data_dir, os.path.basename(file_url))
          if (
              not os.path.isfile(file_path)
              or cls.sha256digest(file_path) != file_hash
          ):
              os.makedirs(data_dir, exist_ok=True)
              torch.hub.download_url_to_file(file_url, file_path)
  
          filenames.append(file_path)
  
      main_archive = os.path.join(data_dir, "aerialimagelabeling.7z")
      with open(main_archive, "ab") as outfile:  # append in binary mode
          for fname in filenames:
              with open(
                  fname, "rb"
              ) as infile:  # open in binary mode also
                  outfile.write(infile.read())
  
      with py7zr.SevenZipFile(main_archive, "r") as archive:
          archive.extractall(data_dir)
      os.unlink(main_archive)
  
      zip_archive = os.path.join(
          data_dir, "NEW2-AerialImageDataset.zip"
      )
      with zipfile.ZipFile(zip_archive, "r") as zip_ref:
          zip_ref.extractall(data_dir)
      os.unlink(zip_archive)
      return True
  
imports: import os
  import subprocess
  import warnings
  from pathlib import Path
  from typing import Union, Optional, Tuple
  import hashlib
  import numpy
  import pandas
  import torch
  import zipfile
  from sklearn.model_selection import GroupKFold
  from pytorch_toolbelt.utils import fs
label_desc: Use image node_id 1 for calling the InriaAerialImageDataset obj's underlying member method code with example usage: obj.download_and_extract(cls, data_dir) and returns: True, False