code: def getdata(obj, dtype=None, copy=False) -> np.ndarray:
      """
      This is a wrapper of `np.array(obj, dtype=dtype, copy=copy)`
      that will generate a warning if the result is an object array.
      """
      data = np.array(obj, dtype=dtype, copy=copy)
      # Defer to getdtype for checking that the dtype is OK.
      # This is called for the validation only; we don't need the return value.
      getdtype(data.dtype)
      return data
  
imports: import sys
  import operator
  import numpy
  from math import prod
  import scipy.sparse
  from scipy._lib._util import np_long, np_ulong
label_desc: Use image node_id 7 for calling a global function with example usage: getdata(obj, dtype, copy) and returns: data