code: def make_example(**kwargs) -> example_pb2.Example:
      """Make a TensorFlow Example with the given fields.
  
      The arguments can be singleton values, or a list of values, e.g.
      makeExample(age=3.0, fruits=['apples', 'pears', 'oranges']).
      Empty lists are not allowed, since we won't be able to deduce the type.
  
      Args:
       **kwargs: Each key=value pair defines a field in the example to be
         constructed. The name of the field will be key, and the value will be
         value. The type will be deduced from the type of the value. Care must be
         taken for numeric types: 0 will be interpreted as an int, and 0.0 as a
           float.
  
      Returns:
        TensorFlow.Example with the corresponding fields set to the corresponding
        values.
  
      Raises:
        ValueError: One of the arguments was an empty list.
        TypeError: One of the elements (or one of the elements in a list) had an
          unsupported type.
      """
  
      result = example_pb2.Example()
      for key, value in kwargs.items():
          if isinstance(value, float):
              result.features.feature[key].float_list.value[:] = [value]
          elif isinstance(value, int):
              result.features.feature[key].int64_list.value[:] = [value]
          elif isinstance(value, bytes):
              result.features.feature[key].bytes_list.value[:] = [value]
          elif isinstance(value, str):
              result.features.feature[key].bytes_list.value[:] = [
                  value.encode("utf8")
              ]
          elif isinstance(value, list):
              if (
                  len(value) == 0
              ):  # pylint: disable=g-explicit-length-test
                  raise ValueError(
                      "empty lists not allowed, but field %s was an empty "
                      "list" % key
                  )
              if isinstance(value[0], float):
                  result.features.feature[key].float_list.value[
                      :
                  ] = value
              elif isinstance(value[0], int):
                  result.features.feature[key].int64_list.value[
                      :
                  ] = value
              elif isinstance(value[0], bytes):
                  result.features.feature[key].bytes_list.value[
                      :
                  ] = value
              elif isinstance(value[0], str):
                  result.features.feature[key].bytes_list.value[:] = [
                      v.encode("utf8") for v in value
                  ]
              else:
                  raise TypeError(
                      "field %s was a list, but the first element had "
                      "unknown type %s" % key,
                      type(value[0]),
                  )
          else:
              raise TypeError(
                  "unrecognised type for field %s: type %s"
                  % (key, type(value))
              )
      return result
  
file_path: model-analysis/tensorflow_model_analysis/eval_saved_model/util.py
imports: from typing import Any, Callable, List, Optional, Tuple
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.utils import util
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: make_example() and returns: result