code: def _copy_with_dtype(data, dtype):
      
      result = np.empty(data.shape, dtype)
      result[...] = data
      return result
docs: Create a copy of an array with the given dtype.
  
      We use this instead of np.array() to ensure that custom object dtypes end
      up on the resulting array.