class_docstr: Abstract callable that provides metadata for
  :class:`~ray.data.datasource.file_based_datasource.FileBasedDatasource`
  implementations that reuse the base :meth:`~ray.data.Datasource.prepare_read`
  method.
  
  Also supports file and file size discovery in input directory paths.
  
  Current subclasses:
      - :class:`DefaultFileMetadataProvider`
docstr: Resolves and returns block metadata for files of a single dataset block.
  
  Args:
      paths: The file paths for a single dataset block. These
          paths will always be a subset of those previously returned from
          :meth:`.expand_paths`.
      schema: The user-provided or inferred schema for the given file
          paths, if any.
      rows_per_file: The fixed number of rows per input file, or None.
      file_sizes: Optional file size per input file previously returned
          from :meth:`.expand_paths`, where `file_sizes[i]` holds the size of
          the file at `paths[i]`.
  
  Returns:
      BlockMetadata aggregated across the given file paths.
docstr_tok: ["Resolves","and","returns","block","metadata","for","files","of","a","single","dataset","block",".","Args",":","paths",":","The","file","paths","for","a","single","dataset","block",".","These","paths","will","always","be","a","subset","of","those","previously","returned","from",":","meth",":","`",".expand_paths","`",".","schema",":","The","user-provided","or","inferred","schema","for","the","given","file","paths",",","if","any",".","rows_per_file",":","The","fixed","number","of","rows","per","input","file",",","or","None",".","file_sizes",":","Optional","file","size","per","input","file","previously","returned","from",":","meth",":","`",".expand_paths","`",",","where","`","file_sizes","[","i","]","`","holds","the","size","of","the","file","at","`","paths","[","i","]","`",".","Returns",":","BlockMetadata","aggregated","across","the","given","file","paths","."]
code: def _get_block_metadata(
      self,
      paths: List[str],
      schema: Optional[Union[type, "pyarrow.lib.Schema"]],
      *,
      rows_per_file: Optional[int],
      file_sizes: List[Optional[int]],
  ) -> BlockMetadata:
      """Resolves and returns block metadata for files of a single dataset block.
  
      Args:
          paths: The file paths for a single dataset block. These
              paths will always be a subset of those previously returned from
              :meth:`.expand_paths`.
          schema: The user-provided or inferred schema for the given file
              paths, if any.
          rows_per_file: The fixed number of rows per input file, or None.
          file_sizes: Optional file size per input file previously returned
              from :meth:`.expand_paths`, where `file_sizes[i]` holds the size of
              the file at `paths[i]`.
  
      Returns:
          BlockMetadata aggregated across the given file paths.
      """
      raise NotImplementedError
  
imports: import itertools
  import logging
  import os
  import pathlib
  import re
  from typing import TYPE_CHECKING, Any, Callable, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  from ray.data._internal.progress_bar import ProgressBar
  from ray.data._internal.remote_fn import cached_remote_fn
  from ray.data.block import BlockMetadata
  from ray.data.datasource.partitioning import Partitioning
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 1 for calling the BaseFileMetadataProvider obj's underlying member method code with example usage: obj._get_block_metadata(paths, schema) without return types