code: def test_error_invalid_values(
      data, all_arithmetic_operators, using_infer_string
  ):
      # invalid ops
  
      if using_infer_string:
          import pyarrow as pa
  
          err = (
              TypeError,
              pa.lib.ArrowNotImplementedError,
              NotImplementedError,
          )
      else:
          err = TypeError
  
      op = all_arithmetic_operators
      s = pd.Series(data)
      ops = getattr(s, op)
  
      # invalid scalars
      msg = (
          "did not contain a loop with signature matching types|"
          "BooleanArray cannot perform the operation|"
          "not supported for the input types, and the inputs could not be safely coerced "
          "to any supported types according to the casting rule ''safe''"
      )
      with pytest.raises(TypeError, match=msg):
          ops("foo")
      msg = "|".join(
          [
              r"unsupported operand type\(s\) for",
              "Concatenation operation is not implemented for NumPy arrays",
              "has no kernel",
          ]
      )
      with pytest.raises(err, match=msg):
          ops(pd.Timestamp("20180101"))
  
      # invalid array-likes
      if op not in ("__mul__", "__rmul__"):
          # TODO(extension) numpy's mul with object array sees booleans as numbers
          msg = "|".join(
              [
                  r"unsupported operand type\(s\) for",
                  "can only concatenate str",
                  "not all arguments converted during string formatting",
                  "has no kernel",
                  "not implemented",
              ]
          )
          with pytest.raises(err, match=msg):
              ops(pd.Series("foo", index=s.index))
  
file_path: pandas/pandas/tests/arrays/boolean/test_arithmetic.py
imports: import operator
  import numpy
  import pytest
  import pandas
  import pandas._testing
label_desc: Use image node_id 8 for calling a global function with example usage: test_error_invalid_values(data, all_arithmetic_operators, using_infer_string) without return types