code: def to_scipy_sparse(m, **options):
      """Convert a sympy/numpy matrix to a scipy.sparse matrix."""
      dtype = options.get("dtype", "complex")
      if isinstance(m, (MatrixBase, Expr)):
          return sympy_to_scipy_sparse(m, dtype=dtype)
      elif isinstance(m, numpy_ndarray):
          if not sparse:
              raise ImportError
          return sparse.csr_matrix(m)
      elif isinstance(m, scipy_sparse_matrix):
          return m
      raise TypeError(
          "Expected sympy/numpy/scipy.sparse matrix, got: %r" % m
      )
  
imports: from sympy.core.expr import Expr
  from sympy.core.numbers import I
  from sympy.core.singleton import S
  from sympy.matrices.matrixbase import MatrixBase
  from sympy.matrices import eye, zeros
  from sympy.external import import_module
label_desc: Use image node_id 7 for calling a global function with example usage: to_scipy_sparse(m) and returns: sympy_to_scipy_sparse, sparse, m