class_docstr: Hugging Face Dataset datasource, for reading from a
  `Hugging Face Datasets Dataset <https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset/>`_.
  This Datasource implements a streamed read using a
  single read task, most beneficial for a
  `Hugging Face Datasets IterableDataset <https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.IterableDataset/>`_
  or datasets which are too large to fit in-memory.
  For an in-memory Hugging Face Dataset (`datasets.Dataset`), use :meth:`~ray.data.from_huggingface`
  directly for faster performance.
code: def get_read_tasks(
      self,
      parallelism: int,
  ) -> List[ReadTask]:
      # Note: `parallelism` arg is currently not used by HuggingFaceDatasource.
      # We always generate a single ReadTask to perform the read.
      _check_pyarrow_version()
      import numpy as np
      import pandas as pd
      import pyarrow
  
      def _read_dataset(
          dataset: "datasets.IterableDataset",
      ) -> Iterable[Block]:
          for batch in dataset.with_format("arrow").iter(
              batch_size=self._batch_size
          ):
              # HuggingFace IterableDatasets do not fully support methods like
              # `set_format`, `with_format`, and `formatted_as`, so the dataset
              # can return whatever is the default configured batch type, even if
              # the format is manually overriden before iterating above.
              # Therefore, we limit support to batch formats which have native
              # block types in Ray Data (pyarrow.Table, pd.DataFrame),
              # or can easily be converted to such (dict, np.array).
              # See: https://github.com/huggingface/datasets/issues/3444
              if not isinstance(
                  batch, (pyarrow.Table, pd.DataFrame, dict, np.array)
              ):
                  raise ValueError(
                      f"Batch format {type(batch)} isn't supported. Only the "
                      f"following batch formats are supported: "
                      f"dict (corresponds to `None` in `dataset.with_format()`), "
                      f"pyarrow.Table, np.array, pd.DataFrame."
                  )
              # Ensure np.arrays are wrapped in a dict
              # (subsequently converted to a pyarrow.Table).
              if isinstance(batch, np.ndarray):
                  batch = {"item": batch}
              if isinstance(batch, dict):
                  batch = pyarrow.Table.from_pydict(batch)
              # Ensure that we return the default block type.
              block = BlockAccessor.for_block(batch).to_default()
              yield block
  
      # TODO(scottjlee): IterableDataset doesn't provide APIs
      # for getting number of rows, byte size, etc., so the
      # BlockMetadata is currently empty. Properly retrieve
      # or calculate these so that progress bars have meaning.
      meta = BlockMetadata(
          num_rows=None,
          size_bytes=None,
          schema=None,
          input_files=None,
          exec_stats=None,
      )
      read_tasks: List[ReadTask] = [
          ReadTask(
              lambda hfds=self._dataset: _read_dataset(hfds),
              meta,
          )
      ]
      return read_tasks
  
file_path: ray/python/ray/data/datasource/huggingface_datasource.py
imports: import sys
  from typing import TYPE_CHECKING, Iterable, List, Optional, Union
  from ray.data._internal.dataset_logger import DatasetLogger
  from ray.data._internal.util import _check_pyarrow_version
  from ray.data.block import Block, BlockAccessor, BlockMetadata
  from ray.data.datasource import Datasource, ReadTask
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 3 for calling the HuggingFaceDatasource obj's underlying member method code with example usage: obj.get_read_tasks(parallelism) and returns: read_tasks