code: def sklearn_metrics_wrapper(
      metric_str,
      metric_dict_str=None,
      metric_post_process_fn=None,
      **metric_fn_kwargs,
  ):
      """Wraps any sklearn.metric function and returns a t5 metric function.
  
      Args:
        metric_str: string, the function from `sklearn.metrics` to use.
        metric_dict_str: optional string, if not specified `metric_str` is used as
          the key in the returned dictionary.
        metric_post_process_fn: callable, if specified the final computed metric
          will be passed through this.
        **metric_fn_kwargs: kwargs, passed to the metric function we are calling.
  
      Returns:
        the function that calculates the metric in a dict.
      """
      if not hasattr(sklearn.metrics, metric_str):
          raise ValueError(
              "sklearn.metrics does not have: %s" % metric_str
          )
  
      def fn(targets, predictions):
          metric_fn = getattr(sklearn.metrics, metric_str)
          metric_val = metric_fn(
              targets, predictions, **metric_fn_kwargs
          )
          if metric_post_process_fn is not None:
              metric_val = metric_post_process_fn(metric_val)
          return {metric_dict_str or metric_str: metric_val}
  
      return fn
  
imports: import collections
  import itertools
  import re
  import string
  from typing import Any, Dict, Mapping, Optional, Sequence, Tuple, Union
  from absl import logging
  import editdistance
  import flax
  import jax.numpy
  import numpy
  import sacrebleu
  import scipy.stats
  import seqio
  import sklearn.metrics
  from t5.evaluation import qa_utils
  import tensorflow.compat.v2
  from rouge_score import rouge_scorer
  from rouge_score import scoring
label_desc: Use image node_id 20 for calling a global function with example usage: sklearn_metrics_wrapper(metric_str, metric_dict_str, metric_post_process_fn) and returns: fn, dict