code: def _get_sparse_func(op):
      from ....lib.sparse.core import issparse
  
      if isinstance(op, str):
          op = getattr(np, op)
  
      def func(*args):
          new_args = []
          for arg in args:
              if issparse(arg):
                  new_args.append(arg.toarray())
              else:
                  new_args.append(arg)
  
          return op(*new_args)
  
      return func
  
imports: import functools
  import operator
  import numpy
  import scipy.sparse
  import pytest
  from ....config import option_context
  from ....session import execute, fetch
  from ....tests.core import require_cupy
  from ....utils import ignore_warning
  from ...datasource import ones, tensor, zeros, arange
  from ..None import add, cos, truediv, frexp, modf, clip, isclose, arctan2, tree_add, tree_multiply
label_desc: Use image node_id 3 for calling a global function with example usage: _get_sparse_func(op) and returns: func, op