code: def check_entropy_vect_scale(distfn, arg):
      # check 2-d
      sc = np.asarray([[1, 2], [3, 4]])
      v_ent = distfn.entropy(*arg, scale=sc)
      s_ent = [distfn.entropy(*arg, scale=s) for s in sc.ravel()]
      s_ent = np.asarray(s_ent).reshape(v_ent.shape)
      assert_allclose(v_ent, s_ent, atol=1e-14)
  
      # check invalid value, check cast
      sc = [1, 2, -3]
      v_ent = distfn.entropy(*arg, scale=sc)
      s_ent = [distfn.entropy(*arg, scale=s) for s in sc]
      s_ent = np.asarray(s_ent).reshape(v_ent.shape)
      assert_allclose(v_ent, s_ent, atol=1e-14)
  
imports: import pickle
  import numpy
  import numpy.testing
  from numpy.testing import assert_allclose, assert_equal
  from pytest import raises
  import numpy.ma.testutils
  from scipy._lib._util import getfullargspec_no_self
  from scipy import stats
label_desc: Use image node_id 10 for calling a global function with example usage: check_entropy_vect_scale(distfn, arg) without return types