code: def _validate_report_dict(dictionary):
      """Validates that entries of a MaterializedReport dictionary field."""
  
      for key, value in dictionary.items():
          if isinstance(value, np.integer):
              dictionary[key] = int(value)
          if isinstance(value, np.float):
              dictionary[key] = float(value)
          if isinstance(value, (six.string_types, six.binary_type)):
              if six.PY2:
                  if not isinstance(value, six.text_type):
                      dictionary[key] = six.u(value).encode("utf-8")
              if six.PY3:
                  dictionary[key] = str(dictionary[key])
          elif not isinstance(value, (bool, six.text_type, int, float)):
              raise ValueError(
                  "Values must be a binary type "
                  "(str in python 2; bytes in python 3), "
                  "a text type (unicode in python 2; str in python 3), "
                  "int, bool, or float, but its type is {}.".format(
                      type(value)
                  )
              )
      return dictionary
  
file_path: adanet/adanet/core/report_accessor.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  from absl import logging
  from adanet import subnetwork
  import numpy
  import six
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_report_dict(dictionary) and returns: dictionary