code: def _ComputeBootstrapSample(  # pylint disable=invalid-name
      sliced_extracts: beam.pvalue.PCollection[
          Tuple[slicer.SliceKeyType, types.Extracts]
      ],
      sample_id: int,
      computations_combine_fn: beam.CombineFn,
      derived_metrics_ptransform: beam.PTransform,
      seed: int,
      hot_key_fanout: int,
  ) -> beam.PCollection[confidence_intervals_util.SampleMetrics]:
      """Computes a single bootstrap sample from SlicedExtracts.
  
      Args:
        sliced_extracts: Incoming PCollection consisting of slice key and extracts.
        sample_id: The sample_id to attach to the computed metrics as part of the
          returned SampleMetrics objects.
        computations_combine_fn: a beam.CombineFn instance that takes input elements
          of type Extracts and returns a MetricsDict. This will be invoked as part
          of a CombinePerKey in which the key is a slice key.
        derived_metrics_ptransform: A PTransform which adds derived metrics to the
          results of the computations_combine_fn. This PTransform should both input
          and output a single PCollection with elements of type MetricsDict where
          the output MetricsDict includes additional derived metrics.
        seed: The seed to use when doing resampling. Note that this is only useful
          in testing or when using a single worker, as otherwise Beam will introduce
          non-determinism in when using distributed computation.
        hot_key_fanout: The hot key fanout factor to use when calling
          beam.CombinePerKey with the computations_combine_fn on replicates. Note
          that these replicates will in expectation have the same size as the input
          PCollection of extracts and will use the normal set of slices keys.
  
      Returns:
        A PCollection of sliced SampleMetrics objects, containing the metrics dicts
        for a given slice, computed from the resampled extracts, along with the
        provided sample_id.
      """
      return (
          sliced_extracts
          | "CombineSampledMetricsPerSlice"
          >> beam.CombinePerKey(
              _BootstrapCombineFn(computations_combine_fn, seed)
          ).with_hot_key_fanout(hot_key_fanout)
          | "AddSampledDerivedCrossSliceAndDiffMetrics"
          >> derived_metrics_ptransform
          | "AddSampleIdToValue"
          >> beam.MapTuple(_add_sample_id, sample_id=sample_id)
      )
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/poisson_bootstrap.py
imports: from typing import Any, Optional, Set, Tuple, TypeVar
  import apache_beam
  import numpy
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.evaluators import confidence_intervals_util
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.utils import beam_util
label_desc: Use image node_id 2 for calling a global function with example usage: _ComputeBootstrapSample(sliced_extracts, sample_id, computations_combine_fn, derived_metrics_ptransform, seed, hot_key_fanout) and returns: unknown