class_docstr: Reader interface for a single Parquet file.
  
  Parameters
  ----------
  source : str, pathlib.Path, pyarrow.NativeFile, or file-like object
      Readable source. For passing bytes or buffer-like file containing a
      Parquet file, use pyarrow.BufferReader.
  metadata : FileMetaData, default None
      Use existing metadata object, rather than reading from file.
  common_metadata : FileMetaData, default None
      Will be used in reads for pandas schema metadata if not found in the
      main file's metadata, no other uses at the moment.
  read_dictionary : list
      List of column names to read directly as DictionaryArray.
  memory_map : bool, default False
      If the source is a file path, use a memory map to read file, which can
      improve performance in some environments.
  buffer_size : int, default 0
      If positive, perform read buffering when deserializing individual
      column chunks. Otherwise IO calls are unbuffered.
  pre_buffer : bool, default False
      Coalesce and issue file reads in parallel to improve performance on
      high-latency filesystems (e.g. S3). If True, Arrow will use a
      background I/O thread pool.
  coerce_int96_timestamp_unit : str, default None
      Cast timestamps that are stored in INT96 format to a particular
      resolution (e.g. 'ms'). Setting to None is equivalent to 'ns'
      and therefore INT96 timestamps will be inferred as timestamps
      in nanoseconds.
  decryption_properties : FileDecryptionProperties, default None
      File decryption properties for Parquet Modular Encryption.
  thrift_string_size_limit : int, default None
      If not None, override the maximum total string size allocated
      when decoding Thrift structures. The default limit should be
      sufficient for most Parquet files.
  thrift_container_size_limit : int, default None
      If not None, override the maximum total size of containers allocated
      when decoding Thrift structures. The default limit should be
      sufficient for most Parquet files.
  filesystem : FileSystem, default None
      If nothing passed, will be inferred based on path.
      Path will try to be found in the local on-disk filesystem otherwise
      it will be parsed as an URI to determine the filesystem.
  page_checksum_verification : bool, default False
      If True, verify the checksum for each page read from the file.
  
  Examples
  --------
  
  Generate an example PyArrow Table and write it to Parquet file:
  
  >>> import pyarrow as pa
  >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
  ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
  ...                              "Brittle stars", "Centipede"]})
  
  >>> import pyarrow.parquet as pq
  >>> pq.write_table(table, 'example.parquet')
  
  Create a ``ParquetFile`` object from the Parquet file:
  
  >>> parquet_file = pq.ParquetFile('example.parquet')
  
  Read the data:
  
  >>> parquet_file.read()
  pyarrow.Table
  n_legs: int64
  animal: string
  ----
  n_legs: [[2,2,4,4,5,100]]
  animal: [["Flamingo","Parrot","Dog","Horse","Brittle stars","Centipede"]]
  
  Create a ParquetFile object with "animal" column as DictionaryArray:
  
  >>> parquet_file = pq.ParquetFile('example.parquet',
  ...                               read_dictionary=["animal"])
  >>> parquet_file.read()
  pyarrow.Table
  n_legs: int64
  animal: dictionary<values=string, indices=int32, ordered=0>
  ----
  n_legs: [[2,2,4,4,5,100]]
  animal: [  -- dictionary:
  ["Flamingo","Parrot",...,"Brittle stars","Centipede"]  -- indices:
  [0,1,2,3,4,5]]
class_docstr_tok: ["Reader","interface","for","a","single","Parquet","file",".","Parameters","--","--","--","--","--","source",":","str",",","pathlib.Path",",","pyarrow.NativeFile",",","or","file-like","object","Readable","source",".","For","passing","bytes","or","buffer-like","file","containing","a","Parquet","file",",","use","pyarrow.BufferReader",".","metadata",":","FileMetaData",",","default","None","Use","existing","metadata","object",",","rather","than","reading","from","file",".","common_metadata",":","FileMetaData",",","default","None","Will","be","used","in","reads","for","pandas","schema","metadata","if","not","found","in","the","main","file","'s","metadata",",","no","other","uses","at","the","moment",".","read_dictionary",":","list","List","of","column","names","to","read","directly","as","DictionaryArray",".","memory_map",":","bool",",","default","False","If","the","source","is","a","file","path",",","use","a","memory","map","to","read","file",",","which","can","improve","performance","in","some","environments",".","buffer_size",":","int",",","default","0","If","positive",",","perform","read","buffering","when","deserializing","individual","column","chunks",".","Otherwise","IO","calls","are","unbuffered",".","pre_buffer",":","bool",",","default","False","Coalesce","and","issue","file","reads","in","parallel","to","improve","performance","on","high-latency","filesystems","(","e.g",".","S3",")",".","If","True",",","Arrow","will","use","a","background","I\/O","thread","pool",".","coerce_int96_timestamp_unit",":","str",",","default","None","Cast","timestamps","that","are","stored","in","INT96","format","to","a","particular","resolution","(","e.g",".","'ms","'",")",".","Setting","to","None","is","equivalent","to","'ns'","and","therefore","INT96","timestamps","will","be","inferred","as","timestamps","in","nanoseconds",".","decryption_properties",":","FileDecryptionProperties",",","default","None","File","decryption","properties","for","Parquet","Modular","Encryption",".","thrift_string_size_limit",":","int",",","default","None","If","not","None",",","override","the","maximum","total","string","size","allocated","when","decoding","Thrift","structures",".","The","default","limit","should","be","sufficient","for","most","Parquet","files",".","thrift_container_size_limit",":","int",",","default","None","If","not","None",",","override","the","maximum","total","size","of","containers","allocated","when","decoding","Thrift","structures",".","The","default","limit","should","be","sufficient","for","most","Parquet","files",".","filesystem",":","FileSystem",",","default","None","If","nothing","passed",",","will","be","inferred","based","on","path",".","Path","will","try","to","be","found","in","the","local","on-disk","filesystem","otherwise","it","will","be","parsed","as","an","URI","to","determine","the","filesystem",".","page_checksum_verification",":","bool",",","default","False","If","True",",","verify","the","checksum","for","each","page","read","from","the","file",".","Examples","--","--","--","--","Generate","an","example","PyArrow","Table","and","write","it","to","Parquet","file",":",">",">",">","import","pyarrow","as","pa",">",">",">","table","=","pa.table","(","{","'n_legs","'",":","[","2",",","2",",","4",",","4",",","5",",","100","]",",","...","'animal","'",":","[","``","Flamingo","''",",","``","Parrot","''",",","``","Dog","''",",","``","Horse","''",",","...","``","Brittle","stars","''",",","``","Centipede","''","]","}",")",">",">",">","import","pyarrow.parquet","as","pq",">",">",">","pq.write_table","(","table",",","'example.parquet","'",")","Create","a","``","ParquetFile","``","object","from","the","Parquet","file",":",">",">",">","parquet_file","=","pq.ParquetFile","(","'example.parquet","'",")","Read","the","data",":",">",">",">","parquet_file.read","(",")","pyarrow.Table","n_legs",":","int64","animal",":","string","--","--","n_legs",":","[","[","2,2,4,4,5,100","]","]","animal",":","[","[","``","Flamingo","''",",","''","Parrot","''",",","''","Dog","''",",","''","Horse","''",",","''","Brittle","stars","''",",","''","Centipede","''","]","]","Create","a","ParquetFile","object","with","``","animal","''","column","as","DictionaryArray",":",">",">",">","parquet_file","=","pq.ParquetFile","(","'example.parquet","'",",","...","read_dictionary=","[","``","animal","''","]",")",">",">",">","parquet_file.read","(",")","pyarrow.Table","n_legs",":","int64","animal",":","dictionary","<","values=string",",","indices=int32",",","ordered=0",">","--","--","n_legs",":","[","[","2,2,4,4,5,100","]","]","animal",":","[","--","dictionary",":","[","``","Flamingo","''",",","''","Parrot","''",",","...",",","''","Brittle","stars","''",",","''","Centipede","''","]","--","indices",":","[","0,1,2,3,4,5","]","]"]
code: def _get_column_indices(
      self, column_names, use_pandas_metadata=False
  ):
      if column_names is None:
          return None
  
      indices = []
  
      for name in column_names:
          if name in self._nested_paths_by_prefix:
              indices.extend(self._nested_paths_by_prefix[name])
  
      if use_pandas_metadata:
          file_keyvalues = self.metadata.metadata
          common_keyvalues = (
              self.common_metadata.metadata
              if self.common_metadata is not None
              else None
          )
  
          if file_keyvalues and b"pandas" in file_keyvalues:
              index_columns = _get_pandas_index_columns(file_keyvalues)
          elif common_keyvalues and b"pandas" in common_keyvalues:
              index_columns = _get_pandas_index_columns(
                  common_keyvalues
              )
          else:
              index_columns = []
  
          if indices is not None and index_columns:
              indices += [
                  self.reader.column_name_idx(descr)
                  for descr in index_columns
                  if not isinstance(descr, dict)
              ]
  
      return indices
  
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 16 for calling the ParquetFile obj's underlying member method code with example usage: obj._get_column_indices(column_names, use_pandas_metadata) and returns: indices, None