code: def test_python_scalar_construtors():
      b = asarray(False)
      i = asarray(0)
      f = asarray(0.0)
      c = asarray(0j)
  
      assert bool(b) == False
      assert int(i) == 0
      assert float(f) == 0.0
      assert operator.index(i) == 0
  
      # bool/int/float/complex should only be allowed on 0-D arrays.
      assert_raises(TypeError, lambda: bool(asarray([False])))
      assert_raises(TypeError, lambda: int(asarray([0])))
      assert_raises(TypeError, lambda: float(asarray([0.0])))
      assert_raises(TypeError, lambda: complex(asarray([0j])))
      assert_raises(TypeError, lambda: operator.index(asarray([0])))
  
      # bool should work on all types of arrays
      assert bool(b) is bool(i) is bool(f) is bool(c) is False
  
      # int should fail on complex arrays
      assert int(b) == int(i) == int(f) == 0
      assert_raises(TypeError, lambda: int(c))
  
      # float should fail on complex arrays
      assert float(b) == float(i) == float(f) == 0.0
      assert_raises(TypeError, lambda: float(c))
  
      # complex should work on all types of arrays
      assert complex(b) == complex(i) == complex(f) == complex(c) == 0j
  
      # index should only work on integer arrays
      assert operator.index(i) == 0
      assert_raises(TypeError, lambda: operator.index(b))
      assert_raises(TypeError, lambda: operator.index(f))
      assert_raises(TypeError, lambda: operator.index(c))
  
file_path: catboost/contrib/python/numpy/py3/numpy/array_api/tests/test_array_object.py
imports: import operator
  from numpy.testing import assert_raises, suppress_warnings
  import numpy
  import pytest
  from numpy.array_api import ones, asarray, reshape, result_type, all, equal
  from numpy.array_api._array_object import Array
  from numpy.array_api._dtypes import _all_dtypes, _boolean_dtypes, _real_floating_dtypes, _floating_dtypes, _complex_floating_dtypes, _integer_dtypes, _integer_or_boolean_dtypes, _real_numeric_dtypes, _numeric_dtypes, int8, int16, int32, int64, uint64, bool
label_desc: Use image node_id 3 for calling a global function with example usage: test_python_scalar_construtors() without return types