code: def __init__(
      self,
      root: Union[str, Path],
      img_transforms: Optional[Callable[[Any], Any]] = None,
      sample_transforms: Optional[
          Callable[[Any, Any], Tuple[Any, Any]]
      ] = None,
      pre_transforms: Optional[
          Callable[[Any, Any], Tuple[Any, Any]]
      ] = None,
  ) -> None:
      if not Path(root).is_dir():
          raise ValueError(
              f"expected a path to a reachable folder: {root}"
          )
  
      self.root = root
      self.img_transforms = img_transforms
      self.sample_transforms = sample_transforms
      self._pre_transforms = pre_transforms
      self._get_img_shape = get_img_shape
  
file_path: doctr/doctr/datasets/datasets/base.py
imports: import os
  import shutil
  from pathlib import Path
  from typing import Any, Callable, List, Optional, Tuple, Union
  import numpy
  from doctr.io.image import get_img_shape
  from doctr.utils.data import download_from_url
  from ...models.utils import _copy_tensor
label_desc: Use image node_id 1 to create a new _AbstractDataset object  with example: obj = _AbstractDataset(root, img_transforms, sample_transforms, pre_transforms)