code: def __init__(
      self,
      path_or_paths,
      filesystem=None,
      schema=None,
      *,
      filters=None,
      read_dictionary=None,
      memory_map=False,
      buffer_size=None,
      partitioning="hive",
      ignore_prefixes=None,
      pre_buffer=True,
      coerce_int96_timestamp_unit=None,
      decryption_properties=None,
      thrift_string_size_limit=None,
      thrift_container_size_limit=None,
      page_checksum_verification=False,
      use_legacy_dataset=None,
  ):
      if use_legacy_dataset is not None:
          warnings.warn(
              "Passing 'use_legacy_dataset' is deprecated as of pyarrow 15.0.0 "
              "and will be removed in a future version.",
              FutureWarning,
              stacklevel=2,
          )
  
      import pyarrow.dataset as ds
  
      # map format arguments
      read_options = {
          "pre_buffer": pre_buffer,
          "coerce_int96_timestamp_unit": coerce_int96_timestamp_unit,
          "thrift_string_size_limit": thrift_string_size_limit,
          "thrift_container_size_limit": thrift_container_size_limit,
          "page_checksum_verification": page_checksum_verification,
      }
      if buffer_size:
          read_options.update(
              use_buffered_stream=True, buffer_size=buffer_size
          )
      if read_dictionary is not None:
          read_options.update(dictionary_columns=read_dictionary)
  
      if decryption_properties is not None:
          read_options.update(
              decryption_properties=decryption_properties
          )
  
      self._filter_expression = None
      if filters is not None:
          self._filter_expression = filters_to_expression(filters)
  
      # map old filesystems to new one
      if filesystem is not None:
          filesystem = _ensure_filesystem(
              filesystem, use_mmap=memory_map
          )
      elif filesystem is None and memory_map:
          # if memory_map is specified, assume local file system (string
          # path can in principle be URI for any filesystem)
          filesystem = LocalFileSystem(use_mmap=memory_map)
  
      # This needs to be checked after _ensure_filesystem, because that
      # handles the case of an fsspec LocalFileSystem
      if (
          hasattr(path_or_paths, "__fspath__")
          and filesystem is not None
          and not _is_local_file_system(filesystem)
      ):
          raise TypeError(
              "Path-like objects with __fspath__ must only be used with "
              f"local file systems, not {type(filesystem)}"
          )
  
      # check for single fragment dataset
      single_file = None
      self._base_dir = None
      if not isinstance(path_or_paths, list):
          if _is_path_like(path_or_paths):
              path_or_paths = _stringify_path(path_or_paths)
              if filesystem is None:
                  # path might be a URI describing the FileSystem as well
                  try:
                      filesystem, path_or_paths = FileSystem.from_uri(
                          path_or_paths
                      )
                  except ValueError:
                      filesystem = LocalFileSystem(use_mmap=memory_map)
              finfo = filesystem.get_file_info(path_or_paths)
              if finfo.is_file:
                  single_file = path_or_paths
              if finfo.type == FileType.Directory:
                  self._base_dir = path_or_paths
          else:
              single_file = path_or_paths
  
      parquet_format = ds.ParquetFileFormat(**read_options)
  
      if single_file is not None:
          fragment = parquet_format.make_fragment(
              single_file, filesystem
          )
  
          self._dataset = ds.FileSystemDataset(
              [fragment],
              schema=schema or fragment.physical_schema,
              format=parquet_format,
              filesystem=fragment.filesystem,
          )
          return
  
      # check partitioning to enable dictionary encoding
      if partitioning == "hive":
          partitioning = ds.HivePartitioning.discover(
              infer_dictionary=True
          )
  
      self._dataset = ds.dataset(
          path_or_paths,
          filesystem=filesystem,
          schema=schema,
          format=parquet_format,
          partitioning=partitioning,
          ignore_prefixes=ignore_prefixes,
      )
  
imports: from collections import defaultdict
  from contextlib import nullcontext
  from functools import reduce
  import inspect
  import json
  import os
  import re
  import operator
  import warnings
  import pyarrow
  from pyarrow._parquet import ParquetReader, Statistics, FileMetaData, RowGroupMetaData, ColumnChunkMetaData, ParquetSchema, ColumnSchema, ParquetLogicalType, FileEncryptionProperties, FileDecryptionProperties, SortingColumn
  from pyarrow.fs import LocalFileSystem, FileSystem, FileType, _resolve_filesystem_and_path, _ensure_filesystem
  from pyarrow import filesystem
  from pyarrow.util import guid, _is_path_like, _stringify_path, _deprecate_api
label_desc: Use image node_id 1 to create a new ParquetDataset object  with example: obj = ParquetDataset(path_or_paths, filesystem, schema)