code: def compute_cis(
      scenario: str,
      methodology: str,
      num_trials: int,
      num_examples_per_trial: int,
      output_dir: str,
  ) -> None:
      """Computes a collection of CIs and the population values for a scenario."""
      if scenario == _BINARY_CLASSIFICATION_SCENARIO:
          (
              eval_config,
              example_gen_fn,
          ) = get_binary_classification_scenario()
      elif scenario == _REGRESSION_SCENARIO:
          eval_config, example_gen_fn = get_regression_scenario()
      else:
          raise ValueError(
              f"Unexpected scenario {scenario}. "
              f"Expected one of {_SCENARIOS}"
          )
      eval_config.options.compute_confidence_intervals.value = True
      eval_config.options.confidence_intervals.method = config_pb2.ConfidenceIntervalOptions.ConfidenceIntervalMethod.Value(
          methodology
      )
      pipeline_options = beam.options.pipeline_options.PipelineOptions(
          FLAGS.pipeline_options.split(",")
      )
      with beam.Pipeline(options=pipeline_options) as pipeline:
          tfx_io = tf_example_record.TFExampleBeamRecord(
              physical_format="generated",
              raw_record_column_name=constants.ARROW_INPUT_COLUMN,
          )
          inputs_per_trial = []
          for i in range(num_trials):
              inputs = (
                  pipeline
                  | f"CreateExamples[{i}]"
                  >> beam.Create(example_gen_fn(num_examples_per_trial))
                  | f"Serialize[{i}]"
                  >> beam.Map(
                      lambda example: example.SerializeToString()
                  )
                  | f"BatchExamples[{i}]" >> tfx_io.BeamSource()
              )
              inputs_per_trial.append(inputs)
  
              trial_output_dir = os.path.join(output_dir, str(i))
              _ = (
                  inputs
                  | f"Evaluate[{i}]"
                  >> model_eval_lib.ExtractEvaluateAndWriteResults(
                      eval_config=eval_config,
                      output_path=trial_output_dir,
                  )
              )
          population_output_dir = os.path.join(
              output_dir, _POPULATION_OUTPUT_NAME
          )
          _ = (
              inputs_per_trial
              | "FlattenInputs" >> beam.Flatten()
              | "EvaluatePopulation"
              >> model_eval_lib.ExtractEvaluateAndWriteResults(
                  eval_config=eval_config,
                  output_path=population_output_dir,
              )
          )
  
imports: import collections
  import os
  from typing import Callable, Dict, Iterable, Iterator, List, Sequence, Tuple
  from absl import app
  from absl import flags
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from tfx_bsl.tfxio import tf_example_record
  from google.protobuf import text_format
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: compute_cis(scenario, methodology, num_trials, num_examples_per_trial, output_dir) without return types