code: def test_linear_invariant(
      self, xp, scp, sys, sample_time, samples_number
  ):
      time = xp.arange(samples_number) * sample_time
      sys = scp.signal.tf2ss(*sys)
  
      c2d = scp.signal.cont2discrete
      _, yout_cont, _ = scp.signal.lsim(sys, T=time, U=time)
      _, yout_disc, _ = scp.signal.dlsim(
          c2d(sys, sample_time, method="foh"), u=time
      )
      return yout_cont, yout_disc
  
imports: import math
  import cupyx.scipy.signal
  import pytest
  from cupy import testing
label_desc: Use image node_id 3 for calling the TestC2dInvariants obj's underlying member method code with example usage: obj.test_linear_invariant(xp, scp, sys, sample_time, samples_number) and returns: yout_cont,  yout_disc