code: def test_instances():
      # Test the finfo and iinfo results on numeric instances agree with
      # the results on the corresponding types
  
      for c in [int, np.int16, np.int32, np.int64]:
          class_iinfo = iinfo(c)
          instance_iinfo = iinfo(c(12))
  
          assert_iinfo_equal(class_iinfo, instance_iinfo)
  
      for c in [float, np.float16, np.float32, np.float64]:
          class_finfo = finfo(c)
          instance_finfo = finfo(c(1.2))
          assert_finfo_equal(class_finfo, instance_finfo)
  
      with pytest.raises(ValueError):
          iinfo(10.0)
  
      with pytest.raises(ValueError):
          iinfo("hi")
  
      with pytest.raises(ValueError):
          finfo(np.int64(1))
  
imports: import warnings
  import numpy
  import pytest
  from numpy.core import finfo, iinfo
  from numpy import half, single, double, longdouble
  from numpy.testing import assert_equal, assert_, assert_raises
  from numpy.core.getlimits import _discovered_machar, _float_ma
label_desc: Use image node_id 3 for calling a global function with example usage: test_instances() without return types