code: def test_string_to_boolean_cast(dtype, out_dtype):
      """
      Currently, for `astype` strings are cast to booleans effectively by
      calling `bool(int(string)`. This is not consistent (see gh-9875) and
      will eventually be deprecated.
      """
      arr = np.array(["10", "10\0\0\0", "0\0\0", "0"], dtype=dtype)
      expected = np.array([True, True, False, False], dtype=out_dtype)
      assert_array_equal(arr.astype(out_dtype), expected)
  
imports: import sys
  import numpy
  from numpy.core._rational_tests import rational
  import pytest
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_raises, assert_warns, HAS_REFCOUNT
label_desc: Use image node_id 9 for calling a global function with example usage: test_string_to_boolean_cast(dtype, out_dtype) without return types