code: def kernel_sparse_poly(
      fm_train_real=traindat,
      fm_test_real=testdat,
      cache_size=10,
      degree=3,
      c=1.0,
  ):
      from shogun import SparseRealFeatures
      import shogun as sg
  
      feats_train = SparseRealFeatures(fm_train_real)
      feats_test = SparseRealFeatures(fm_test_real)
  
      kernel = sg.create_kernel(
          "PolyKernel", cache_size=cache_size, degree=degree, c=c
      )
      kernel.init(feats_train, feats_train)
      km_train = kernel.get_kernel_matrix()
  
      kernel.init(feats_train, feats_test)
      km_test = kernel.get_kernel_matrix()
      return km_train, km_test, kernel
  
label_desc: Use image node_id 1 for calling a global function with example usage: kernel_sparse_poly(fm_train_real, fm_test_real, cache_size, degree, c) and returns: km_train,  km_test,  kernel