code: def testDictToExample(self):
      instance_dict = {
          "int": 10,
          "float": 5.0,
          "str": "abc",
          "int_list": [1, 2],
          "float_list": [3.0],
          "str_list": ["ab", "cd"],
          "none": None,
          "empty_list": [],
      }
      example = utils.dict_to_example(instance_dict)
      self.assertProtoEquals(
          """
          features {
            feature {
              key: "empty_list"
              value {
              }
            }
            feature {
              key: "float"
              value {
                float_list {
                  value: 5.0
                }
              }
            }
            feature {
              key: "float_list"
              value {
                float_list {
                  value: 3.0
                }
              }
            }
            feature {
              key: "int"
              value {
                int64_list {
                  value: 10
                }
              }
            }
            feature {
              key: "int_list"
              value {
                int64_list {
                  value: 1
                  value: 2
                }
              }
            }
            feature {
              key: "none"
              value {
              }
            }
            feature {
              key: "str"
              value {
                bytes_list {
                  value: "abc"
                }
              }
            }
            feature {
              key: "str_list"
              value {
                bytes_list {
                  value: "ab"
                  value: "cd"
                }
              }
            }
          }
          """,
          example,
      )
  
imports: import os
  import re
  import tensorflow
  from tfx.components.example_gen import utils
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types
  from tfx.proto import example_gen_pb2
  from tfx.proto import range_config_pb2
  from tfx.utils import io_utils
  from tfx.utils import json_utils
label_desc: Use image node_id 2 for calling the UtilsTest obj's underlying member method code with example usage: obj.testDictToExample() without return types