code: def test_array_to_png_works_with_floats(self, shape, should_succeed):
      arr = np.random.random(shape)
  
      if should_succeed:
          temp_dir = self.create_tempdir().full_path
          output_path = os.path.join(temp_dir, "test.png")
          # Check the file doesn't already exist before function runs.
          self.assertEmpty(glob.glob(output_path))
          vis.array_to_png(arr, path=output_path)
          self.assertLen(glob.glob(output_path), 1)
      else:
          self.assertRaisesWithPredicateMatch(
              ValueError,
              lambda x: str(x).index("dimensions") != -1,
              vis.array_to_png,
              arr,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import glob
  import os
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import vis
  from tensorflow.core.example import example_pb2
  from tensorflow.core.example import feature_pb2
label_desc: Use image node_id 11 for calling the VisTest obj's underlying member method code with example usage: obj.test_array_to_png_works_with_floats(shape, should_succeed) without return types