code: def _set_gather_statistics(
      gather_statistics,
      blocksize,
      split_row_groups,
      aggregation_depth,
      filter_columns,
      stat_columns,
  ):
      # Use available information about the current read options
      # and target dataset to decide if we need to gather metadata
      # statistics to construct the graph for a `read_parquet` op.
  
      # If the user has specified `calculate_divisions=True`, then
      # we will be starting with `gather_statistics=True` here.
      if (
          (blocksize and split_row_groups is True)
          or (int(split_row_groups) > 1 and aggregation_depth)
          or filter_columns.intersection(stat_columns)
      ):
          # Need to gather statistics if we are aggregating files
          # or filtering
          # NOTE: Should avoid gathering statistics when the agg
          # does not depend on a row-group statistic
          gather_statistics = True
      elif not stat_columns:
          # Not aggregating files/row-groups.
          # We only need to gather statistics if `stat_columns`
          # is populated
          gather_statistics = False
  
      return bool(gather_statistics)
  
imports: from __future__ import annotations
  import re
  import warnings
  import numpy
  import pandas
  from fsspec.core import expand_paths_if_needed, get_fs_token_paths, stringify_path
  from fsspec.spec import AbstractFileSystem
  from dask import config
  from dask.dataframe.io.utils import _is_local_fs
  from dask.utils import natural_sort_key, parse_bytes
label_desc: Use image node_id 11 for calling a global function with example usage: _set_gather_statistics(gather_statistics, blocksize, split_row_groups, aggregation_depth, filter_columns, stat_columns) and returns: bool