code: def setup_method(self):
      self.cases = []
  
      def make_cases(original, dtype):
          cases = []
  
          cases.append((matrix(original, dtype=dtype), original))
          cases.append((np.array(original, dtype=dtype), original))
          cases.append(
              (sparse.csr_matrix(original, dtype=dtype), original)
          )
  
          # Test default implementations of _adjoint and _rmatvec, which
          # refer to each other.
          def mv(x, dtype):
              y = original.dot(x)
              if len(x.shape) == 2:
                  y = y.reshape(-1, 1)
              return y
  
          def rmv(x, dtype):
              return original.T.conj().dot(x)
  
          class BaseMatlike(interface.LinearOperator):
              args = ()
  
              def __init__(self, dtype):
                  self.dtype = np.dtype(dtype)
                  self.shape = original.shape
  
              def _matvec(self, x):
                  return mv(x, self.dtype)
  
          class HasRmatvec(BaseMatlike):
              args = ()
  
              def _rmatvec(self, x):
                  return rmv(x, self.dtype)
  
          class HasAdjoint(BaseMatlike):
              args = ()
  
              def _adjoint(self):
                  shape = self.shape[1], self.shape[0]
                  matvec = partial(rmv, dtype=self.dtype)
                  rmatvec = partial(mv, dtype=self.dtype)
                  return interface.LinearOperator(
                      matvec=matvec,
                      rmatvec=rmatvec,
                      dtype=self.dtype,
                      shape=shape,
                  )
  
          class HasRmatmat(HasRmatvec):
              def _matmat(self, x):
                  return original.dot(x)
  
              def _rmatmat(self, x):
                  return original.T.conj().dot(x)
  
          cases.append((HasRmatvec(dtype), original))
          cases.append((HasAdjoint(dtype), original))
          cases.append((HasRmatmat(dtype), original))
          return cases
  
      original = np.array([[1, 2, 3], [4, 5, 6]])
      self.cases += make_cases(original, np.int32)
      self.cases += make_cases(original, np.float32)
      self.cases += make_cases(original, np.float64)
      self.cases += [
          (interface.aslinearoperator(M).T, A.T)
          for M, A in make_cases(original.T, np.float64)
      ]
      self.cases += [
          (interface.aslinearoperator(M).H, A.T.conj())
          for M, A in make_cases(original.T, np.float64)
      ]
  
      original = np.array([[1, 2j, 3j], [4j, 5j, 6]])
      self.cases += make_cases(original, np.complex_)
      self.cases += [
          (interface.aslinearoperator(M).T, A.T)
          for M, A in make_cases(original.T, np.complex_)
      ]
      self.cases += [
          (interface.aslinearoperator(M).H, A.T.conj())
          for M, A in make_cases(original.T, np.complex_)
      ]
  
imports: from functools import partial
  from itertools import product
  import operator
  import pytest
  from pytest import raises, warns
  from numpy.testing import assert_, assert_equal
  import numpy
  import scipy.sparse
  from scipy.sparse.linalg import interface
  from scipy.sparse.sputils import matrix
label_desc: Use image node_id 1 for calling the TestAsLinearOperator obj's underlying member method code with example usage: obj.setup_method() and returns: cases, y, original, mv, rmv, interface, original, original