code: def test_get_image_type_from_array(self, shape, expected):
      arr = _image_array(shape)
      if expected is not None:
          self.assertEqual(
              vis._get_image_type_from_array(arr), expected
          )
      else:
          self.assertRaisesWithPredicateMatch(
              ValueError,
              lambda x: str(x).index("dimensions") != -1,
              vis.save_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 9 for calling the VisTest obj's underlying member method code with example usage: obj.test_get_image_type_from_array(shape, expected) without return types