class_docstr: Shuffles and writes Examples to Arrow files.
  The Arrow files are converted from Parquet files that are the output of Apache Beam pipelines.
class_docstr_tok: ["Shuffles","and","writes","Examples","to","Arrow","files",".","The","Arrow","files","are","converted","from","Parquet","files","that","are","the","output","of","Apache","Beam","pipelines","."]
code: def __init__(
      self,
      features: Optional[Features] = None,
      schema: Optional[pa.Schema] = None,
      path: Optional[str] = None,
      namespace: Optional[str] = None,
      cache_dir: Optional[str] = None,
  ):
      if features is None and schema is None:
          raise ValueError(
              "At least one of features and schema must be provided."
          )
      if path is None:
          raise ValueError("Path must be provided.")
  
      if features is not None:
          self._features: Features = features
          self._schema: pa.Schema = features.arrow_schema
      else:
          self._schema: pa.Schema = schema
          self._features: Features = Features.from_arrow_schema(schema)
  
      self._path = path
      self._parquet_path = os.path.splitext(path)[0]  # remove extension
      self._namespace = namespace or "default"
      self._num_examples = None
      self._cache_dir = cache_dir or config.HF_DATASETS_CACHE
  
imports: import errno
  import json
  import os
  import sys
  from pathlib import Path
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  import fsspec
  import numpy
  import pyarrow
  import pyarrow.parquet
  from .None import config
  from .features import Features, Image, Value
  from .features.features import FeatureType, _ArrayXDExtensionType, cast_to_python_objects, generate_from_arrow_type, get_nested_type, list_of_np_array_to_pyarrow_listarray, numpy_to_pyarrow_listarray, to_pyarrow_listarray
  from .filesystems import is_remote_filesystem
  from .info import DatasetInfo
  from .keyhash import DuplicatedKeysError, KeyHasher
  from .table import array_cast, array_concat, cast_array_to_feature, embed_table_storage, table_cast
  from .utils import logging
  from .utils import tqdm
  from .utils.file_utils import hash_url_to_filename
  from .utils.py_utils import asdict, first_non_null_value
label_desc: Use image node_id 1 to create a new BeamWriter object  with example: obj = BeamWriter(features, schema, path, namespace, cache_dir)