code: def test_dataset():
      """test_dataset"""
      libsvm_file = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          "test_libsvm",
          "sample",
      )
      dataset = tfio.experimental.IODataset.from_libsvm(
          libsvm_file, num_features=6
      )
      dataset = dataset.map(
          lambda sparse_features, labels: (
              tf.sparse.to_dense(
                  sparse_features, validate_indices=False
              ),
              labels,
          )
      )
      expected_f = [
          [0.0, 3.4, 0.5, 0.0, 0.231, 0.0],
          [0, 0, 2.5, np.inf, 0, 0.503],
          [0, 0.105, np.nan, 2.5, 0, 0],
      ]
      expected_l = [[1], [1], [2]]
      i = 0
      for f, l in dataset:
          for j, v in enumerate(f[0]):
              assert np.isclose(expected_f[i][j], v.numpy()) or (
                  np.isnan(expected_f[i][j]) and np.isnan(v.numpy())
              )
          assert np.allclose(expected_l[i], l)
          i += 1
  
imports: import os
  import numpy
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 3 for calling a global function with example usage: test_dataset() without return types