class_docstr: Binary datasource, for reading and writing binary files. Ignores None values.
  
  Examples:
      >>> import ray
      >>> from ray.data.datasource import BinaryDatasource
      >>> source = BinaryDatasource() # doctest: +SKIP
      >>> ray.data.read_datasource( # doctest: +SKIP
      ...     source, paths=["/path/to/dir", None]).take()
      [b"file_data", ...]
docstr: Creates and returns read tasks for a file-based datasource.
  
  If `paths` is a tuple, The resulting dataset will have an `idx` key containing the second item in the tuple.
  Useful for tracking the order of files in the dataset.
docstr_tok: ["Creates","and","returns","read","tasks","for","a","file-based","datasource",".","If","`","paths","`","is","a","tuple",",","The","resulting","dataset","will","have","an","`","idx","`","key","containing","the","second","item","in","the","tuple",".","Useful","for","tracking","the","order","of","files","in","the","dataset","."]
code: def prepare_read(
      self,
      parallelism: int,
      path_and_idxs: Union[
          str, List[str], Tuple[str, int], List[Tuple[str, int]]
      ],
      filesystem: Optional["pyarrow.fs.FileSystem"] = None,
      schema: Optional[Union[type, "pyarrow.lib.Schema"]] = None,
      open_stream_args: Optional[Dict[str, Any]] = None,
      meta_provider: BaseFileMetadataProvider = DefaultFileMetadataProvider(),
      partition_filter: "PathPartitionFilter" = None,
      # TODO(ekl) deprecate this once read fusion is available.
      _block_udf: Optional[Callable[[Block], Block]] = None,
      **reader_args,
  ) -> List[ReadTask]:
      """Creates and returns read tasks for a file-based datasource.
  
      If `paths` is a tuple, The resulting dataset will have an `idx` key containing the second item in the tuple.
      Useful for tracking the order of files in the dataset.
      """
      reader = self.create_reader(
          paths=path_and_idxs,
          filesystem=filesystem,
          schema=schema,
          open_stream_args=open_stream_args,
          meta_provider=meta_provider,
          partition_filter=partition_filter,
          _block_udf=_block_udf,
          **reader_args,
      )
      return reader.get_read_tasks(parallelism)
  
imports: import contextlib
  import logging
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, TYPE_CHECKING, Union
  import ray
  import urllib3
  from packaging import version
  from ray.data.block import Block
  from ray.data.context import DatasetContext
  from ray.data.datasource.binary_datasource import BinaryDatasource
  from ray.data.datasource.datasource import Datasource, ReadTask
  from ray.data.datasource.file_based_datasource import _check_pyarrow_version, _resolve_paths_and_filesystem, _S3FileSystemWrapper, _wrap_s3_serialization_workaround, BaseFileMetadataProvider, BlockOutputBuffer, DefaultFileMetadataProvider
  from ludwig.utils.fs_utils import get_bytes_obj_from_http_path, is_http
label_desc: Use image node_id 2 for calling the BinaryIgnoreNoneTypeDatasource obj's underlying member method code with example usage: obj.prepare_read(parallelism, path_and_idxs, filesystem, schema, open_stream_args, meta_provider, partition_filter, _block_udf) and returns: reader