code: def toarray(a):
      if isinstance(a, np.ndarray) or isscalarlike(a):
          return a
      return a.toarray()
  
file_path: scipy/scipy/sparse/tests/test_minmax1d.py
imports: import pytest
  import numpy
  from numpy.testing import assert_equal, assert_array_equal
  from scipy.sparse import coo_array
  from scipy.sparse._sputils import isscalarlike
label_desc: Use image node_id 1 for calling a global function with example usage: toarray(a) and returns: a, a