code: def test_basic():
      """test_basic"""
      content = [
          "1 1:3.4 2:0.5 4:0.231",
          "1 2:2.5 3:inf 5:0.503",
          "2 3:2.5 2:nan 1:0.105",
      ]
      sparse_features, labels = tfio.experimental.text.decode_libsvm(
          content, num_features=6
      )
      features = tf.sparse.to_dense(
          sparse_features, validate_indices=False
      )
  
      assert labels.shape == [3]
  
      assert np.all(labels == [1, 1, 2])
  
      assert features.shape == [3, 6]
      expected = [
          [0, 3.4, 0.5, 0, 0.231, 0],
          [0, 0, 2.5, np.inf, 0, 0.503],
          [0, 0.105, np.nan, 2.5, 0, 0],
      ]
      for i, e in enumerate(expected):
          for j, v in enumerate(e):
              assert features[i, j] == v or (
                  np.isnan(features[i, j]) and np.isnan(v)
              )
  
imports: import os
  import numpy
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic() without return types