docstr: Test that in1d raises expected errors.
docstr_tok: ["Test","that","in1d","raises","expected","errors","."]
code: def test_in1d_errors(self):
      """Test that in1d raises expected errors."""
  
      # Error 1: `kind` is not one of 'sort' 'table' or None.
      ar1 = np.array([1, 2, 3, 4, 5])
      ar2 = np.array([2, 4, 6, 8, 10])
      assert_raises(ValueError, in1d, ar1, ar2, kind="quicksort")
  
      # Error 2: `kind="table"` does not work for non-integral arrays.
      obj_ar1 = np.array([1, "a", 3, "b", 5], dtype=object)
      obj_ar2 = np.array([1, "a", 3, "b", 5], dtype=object)
      assert_raises(ValueError, in1d, obj_ar1, obj_ar2, kind="table")
  
      for dtype in [np.int32, np.int64]:
          ar1 = np.array([-1, 2, 3, 4, 5], dtype=dtype)
          # The range of this array will overflow:
          overflow_ar2 = np.array(
              [-1, np.iinfo(dtype).max], dtype=dtype
          )
  
          # Error 3: `kind="table"` will trigger a runtime error
          #  if there is an integer overflow expected when computing the
          #  range of ar2
          assert_raises(
              RuntimeError, in1d, ar1, overflow_ar2, kind="table"
          )
  
          # Non-error: `kind=None` will *not* trigger a runtime error
          #  if there is an integer overflow, it will switch to
          #  the `sort` algorithm.
          result = np.in1d(ar1, overflow_ar2, kind=None)
          assert_array_equal(result, [True] + [False] * 4)
          result = np.in1d(ar1, overflow_ar2, kind="sort")
          assert_array_equal(result, [True] + [False] * 4)
  
imports: import numpy
  from numpy.testing import assert_array_equal, assert_equal, assert_raises, assert_raises_regex
  from numpy.lib.arraysetops import ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, in1d, isin
  import pytest
label_desc: Use image node_id 24 for calling the TestSetOps obj's underlying member method code with example usage: obj.test_in1d_errors() without return types