code: def test_bootstrap_sample_combine_fn_sample_is_nan(self):
      metric_key = metric_types.MetricKey("metric")
      # the sample value is irrelevant for this test as we only verify counters.
      samples = [
          # unsampled value
          (
              confidence_intervals_util.SampleMetrics(
                  sample_id=poisson_bootstrap._FULL_SAMPLE_ID,
                  metrics={
                      metric_key: 2,
                  },
              )
          ),
          (
              confidence_intervals_util.SampleMetrics(
                  sample_id=0, metrics={metric_key: 2}
              )
          ),
          (
              confidence_intervals_util.SampleMetrics(
                  sample_id=1, metrics={metric_key: float("nan")}
              )
          ),
      ]
  
      with beam.Pipeline() as pipeline:
          result = (
              pipeline
              | "Create" >> beam.Create(samples, reshuffle=False)
              | "CombineSamplesPerKey"
              >> beam.CombineGlobally(
                  poisson_bootstrap._BootstrapSampleCombineFn(
                      num_bootstrap_samples=2
                  )
              )
          )
  
          def check_result(got_pcoll):
              self.assertLen(got_pcoll, 1)
              metrics = got_pcoll[0]
  
              self.assertIn(metric_key, metrics)
              self.assertTrue(np.isnan(metrics[metric_key].sample_mean))
              self.assertTrue(
                  np.isnan(
                      metrics[metric_key].sample_standard_deviation
                  )
              )
              self.assertEqual(
                  metrics[metric_key].sample_degrees_of_freedom, 1
              )
              self.assertEqual(metrics[metric_key].unsampled_value, 2.0)
  
          util.assert_that(result, check_result)
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/poisson_bootstrap_test.py
imports: from absl.testing import absltest
  import apache_beam
  from apache_beam.testing import util
  import numpy
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.evaluators import confidence_intervals_util
  from tensorflow_model_analysis.evaluators import poisson_bootstrap
  from tensorflow_model_analysis.metrics import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
label_desc: Use image node_id 4 for calling the PoissonBootstrapTest obj's underlying member method code with example usage: obj.test_bootstrap_sample_combine_fn_sample_is_nan() without return types