code: def read_parquet(
      filepath_or_buffer,
      engine="cudf",
      columns=None,
      storage_options=None,
      filters=None,
      row_groups=None,
      use_pandas_metadata=True,
      use_python_file_object=True,
      categorical_partitions=True,
      open_file_options=None,
      bytes_per_thread=None,
      dataset_kwargs=None,
      *args,
      **kwargs,
  ):
      """{docstring}"""
      if engine not in {"cudf", "pyarrow"}:
          raise ValueError(
              f"Only supported engines are {{'cudf', 'pyarrow'}}, got {engine=}"
          )
      # Do not allow the user to set file-opening options
      # when `use_python_file_object=False` is specified
      if use_python_file_object is False:
          if open_file_options:
              raise ValueError(
                  "open_file_options is not currently supported when "
                  "use_python_file_object is set to False."
              )
          open_file_options = {}
  
      if bytes_per_thread is None:
          bytes_per_thread = ioutils._BYTES_PER_THREAD_DEFAULT
  
      # Multiple sources are passed as a list. If a single source is passed,
      # wrap it in a list for unified processing downstream.
      if not is_list_like(filepath_or_buffer):
          filepath_or_buffer = [filepath_or_buffer]
  
      # a list of row groups per source should be passed. make the list of
      # lists that is expected for multiple sources
      if row_groups is not None:
          if not is_list_like(row_groups):
              row_groups = [[row_groups]]
          elif not is_list_like(row_groups[0]):
              row_groups = [row_groups]
  
      # Check columns input
      if columns is not None:
          if not is_list_like(columns):
              raise ValueError("Expected list like for columns")
  
      # Start by trying construct a filesystem object, so we
      # can apply filters on remote file-systems
      fs, paths = ioutils._get_filesystem_and_paths(
          path_or_data=filepath_or_buffer,
          storage_options=storage_options,
      )
  
      # Normalize and validate filters
      filters = _normalize_filters(filters)
  
      # Use pyarrow dataset to detect/process directory-partitioned
      # data and apply filters. Note that we can only support partitioned
      # data and filtering if the input is a single directory or list of
      # paths.
      partition_keys = []
      partition_categories = {}
      if fs and paths:
          (
              paths,
              row_groups,
              partition_keys,
              partition_categories,
          ) = _process_dataset(
              paths=paths,
              fs=fs,
              filters=filters,
              row_groups=row_groups,
              categorical_partitions=categorical_partitions,
              dataset_kwargs=dataset_kwargs,
          )
      filepath_or_buffer = paths if paths else filepath_or_buffer
  
      filepaths_or_buffers = []
      if use_python_file_object:
          open_file_options = _default_open_file_options(
              open_file_options=open_file_options,
              columns=columns,
              row_groups=row_groups,
              fs=fs,
          )
      for source in filepath_or_buffer:
          (
              tmp_source,
              compression,
          ) = ioutils.get_reader_filepath_or_buffer(
              path_or_data=source,
              compression=None,
              fs=fs,
              use_python_file_object=use_python_file_object,
              open_file_options=open_file_options,
              storage_options=storage_options,
              bytes_per_thread=bytes_per_thread,
          )
  
          if compression is not None:
              raise ValueError(
                  "URL content-encoding decompression is not supported"
              )
          if isinstance(tmp_source, list):
              filepath_or_buffer.extend(tmp_source)
          else:
              filepaths_or_buffers.append(tmp_source)
  
      # Warn user if they are not using cudf for IO
      # (There is a good chance this was not the intention)
      if engine != "cudf":
          warnings.warn(
              "Using CPU via PyArrow to read Parquet dataset. "
              "This option is both inefficient and unstable!"
          )
          if filters is not None:
              warnings.warn(
                  "Parquet row-group filtering is only supported with "
                  "'engine=cudf'. Use pandas or pyarrow API directly "
                  "for full CPU-based filtering functionality."
              )
  
      # Make sure we read in the columns needed for row-wise
      # filtering after IO. This means that one or more columns
      # will be dropped almost immediately after IO. However,
      # we do NEED these columns for accurate filtering.
      projected_columns = None
      if columns and filters:
          projected_columns = columns
          columns = sorted(
              set(v[0] for v in itertools.chain.from_iterable(filters))
              | set(columns)
          )
  
      # Convert parquet data to a cudf.DataFrame
      df = _parquet_to_frame(
          filepaths_or_buffers,
          engine,
          *args,
          columns=columns,
          row_groups=row_groups,
          use_pandas_metadata=use_pandas_metadata,
          partition_keys=partition_keys,
          partition_categories=partition_categories,
          dataset_kwargs=dataset_kwargs,
          **kwargs,
      )
  
      # Apply filters row-wise (if any are defined), and return
      df = _apply_post_filters(df, filters)
      if projected_columns:
          # Elements of `projected_columns` may now be in the index.
          # We must filter these names from our projection
          projected_columns = [
              col
              for col in projected_columns
              if col in df._column_names
          ]
          return df[projected_columns]
      return df
  
imports: from __future__ import annotations
  import itertools
  import math
  import operator
  import shutil
  import tempfile
  import warnings
  from collections import defaultdict
  from contextlib import ExitStack
  from functools import partial, reduce
  from typing import Callable, Dict, List, Optional, Tuple
  from uuid import uuid4
  import numpy
  import pandas
  from pyarrow import dataset
  import cudf
  from cudf._lib import parquet
  from cudf.api.types import is_list_like
  from cudf.core.column import build_categorical_column, column_empty, full
  from cudf.utils import ioutils
  from cudf.utils.nvtx_annotation import _cudf_nvtx_annotate
label_desc: Use image node_id 5 for calling a global function with example usage: read_parquet(filepath_or_buffer, engine, columns, storage_options, filters, row_groups, use_pandas_metadata, use_python_file_object, categorical_partitions, open_file_options, bytes_per_thread, dataset_kwargs) and returns: df, df