code: def generate_sparse_data(batch_size, seq_len, feature_size):
      sparse_data = []
      for batch in range(0, batch_size):
          data = np.zeros((seq_len, feature_size)).astype(np.float32)
          np.random.seed(0)
          for i in range(0, seq_len):
              one_hot_index = np.random.random_integers(
                  0, feature_size - 1
              )
              data[i][one_hot_index] = 1.0
          sparse_data.append(scipy.sparse.csr_matrix(data))
      return sparse_data
  
file_path: CNTK/bindings/python/cntk/tests/onnx_verify_helper.py
imports: from __future__ import print_function
  import os, re, sys, subprocess, scipy, pytest, numpy
  import cntk
label_desc: Use image node_id 8 for calling a global function with example usage: generate_sparse_data(batch_size, seq_len, feature_size) and returns: sparse_data