code: def test_singleton_dataset(self):
      ds = _create_dataset(range(10))
      np_ds = dataset_utils.as_numpy(ds)
      self.assertEqual(list(range(10)), [int(el) for el in list(np_ds)])
      # Iterating twice on the dataset recreate the iterator.
      self.assertEqual(list(range(10)), [int(el) for el in list(np_ds)])
  
      if tf.executing_eagerly():
          self.assertEqual(len(np_ds), 10)
          self.assertEqual(
              np_ds.element_spec,
              enp.ArraySpec(shape=(), dtype=np.int32),
          )
      else:
          with self.assertRaisesWithPredicateMatch(
              TypeError,
              "__len__() is not supported for `tfds.as_numpy`",
          ):
              _ = len(np_ds)
  
imports: from etils import enp
  import numpy
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import dataset_utils
label_desc: Use image node_id 3 for calling the DatasetAsNumPyTest obj's underlying member method code with example usage: obj.test_singleton_dataset() without return types