code: def _test(self, tf_type, good_pairs, bad_pairs):
      with self.cached_session():
          # Build a small testing graph.
          input_string = array_ops.placeholder(dtypes.string)
          output = parsing_ops.string_to_number(
              input_string, out_type=tf_type
          )
  
          # Check all the good input/output pairs.
          for instr, outnum in good_pairs:
              (result,) = output.eval(feed_dict={input_string: [instr]})
              self.assertAllClose([outnum], [result])
  
          # Check that the bad inputs produce the right errors.
          for instr, outstr in bad_pairs:
              with self.assertRaisesOpError(outstr):
                  output.eval(feed_dict={input_string: [instr]})
  
file_path: tensorflow-upstream/tensorflow/python/kernel_tests/strings_ops/string_to_number_op_test.py
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import parsing_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the StringToNumberOpTest obj's underlying member method code with example usage: obj._test(tf_type, good_pairs, bad_pairs) without return types