def METHOD_NAME(
    name: str = EXAMPLE_COUNT_NAME,
    model_names: Optional[List[str]] = None,
    output_names: Optional[List[str]] = None,
    sub_keys: Optional[List[metric_types.SubKey]] = None,
    example_weighted: bool = False) -> metric_types.MetricComputations:
  """Returns metric computations for example count."""
  computations = []
  for model_name in model_names or ['']:
    for output_name in output_names or ['']:
      keys = []
      for sub_key in sub_keys or [None]:
        key = metric_types.MetricKey(
            name=name,
            model_name=model_name,
            output_name=output_name,
            sub_key=sub_key,
            example_weighted=example_weighted)
        keys.append(key)
      # Note: This cannot be implemented based on the weight stored in
      # calibration because weighted example count is used with multi-class, etc
      # models that do not use calibration metrics.
      # The combiner only needs example weights in case users do not have
      # predictions or labels.
      computations.append(
          metric_types.MetricComputation(
              keys=keys,
              preprocessors=[
                  metric_types.StandardMetricInputsPreprocessor(
                      include_filter={constants.EXAMPLE_WEIGHTS_KEY: {}},
                      include_default_inputs=False,
                  )
              ],
              combiner=_ExampleCountCombiner(
                  model_name, output_name, keys, example_weighted
              ),
          )
      )
  return computations