code: def test_read_from_tfds(
      dummy_dataset: dataset_builder.DatasetBuilder,
      tmp_path: pathlib.Path,
      split: str,
      workers_per_shard: Optional[int],
      expected_result: str,
  ):
      import apache_beam as beam  # pylint: disable=g-import-not-at-top
  
      with beam.Pipeline() as pipeline:
          _ = (
              pipeline
              | beam_utils.ReadFromTFDS(
                  dummy_dataset,
                  split=split,
                  workers_per_shard=workers_per_shard,
              )
              | beam.Map(dataset_utils.as_numpy)
              | beam.io.WriteToText(os.fspath(tmp_path / "out.txt"))
          )
  
      assert (
          tmp_path / "out.txt-00000-of-00001"
      ).read_text() == expected_result
  
file_path: datasets/tensorflow_datasets/core/beam_utils_test.py
imports: import os
  import pathlib
  from typing import Optional
  import pytest
  from tensorflow_datasets.core import beam_utils
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_read_from_tfds(dummy_dataset, tmp_path, split, workers_per_shard, expected_result) without return types