code: def parquet_iterator(
      config: ParquetBasicDataloaderConfig,
  ) -> Generator[BatchOutputType, None, None]:
      """
      Example of usage:
  
         >>> from recipes.parquet.parquet_dataloader import (
         ...    ParquetBasicDataloaderConfig, ParquetBatchFormat, build_parquet_iterator_pipeline)
         >>> from tqdm.auto import tqdm
         >>> bpd_config = ParquetBasicDataloaderConfig(parquet_path="...", batch_size=20,
         ...                                           columns=["src_text", "src_lang", "audio_wav"],
         ...                                           output_format=ParquetBatchFormat.torch)
         >>> ei_batch = parquet_iterator(bpd_config)
         >>> res = []
         >>> for i, batch in tqdm(enumerate(ei_batch)): res.append(len(batch))
      """
      with pyarrow_cpu(config.num_parallel_calls):
          yield from map(
              _to_real_object,
              iter(
                  build_parquet_iterator_pipeline(config)
                  .prefetch(config.num_parallel_calls)
                  .and_return(max_num_warnings=4)
              ),
          )
  
file_path: fairseq2/recipes/parquet/parquet_dataloader.py
imports: from dataclasses import dataclass
  from enum import Enum
  from functools import partial
  from typing import Any, Generator, List, Optional, Union
  import pyarrow
  import pyarrow.parquet
  from fairseq2.data.data_pipeline import DataPipeline, DataPipelineBuilder
  from fairseq2.data.parquet_tools import BatchOutputType, _TableWrapper, _to_real_object, apply_filter, build_iterator_over_one_table, concat_table, list_parquet_fragments, load_one_fragment, pyarrow_cpu, pyarrow_table_to_torch_dict, table_func_wrap
label_desc: Use image node_id 2 for calling a global function with example usage: parquet_iterator(config) without return types