code: def test_allow_copy_false_bool_categorical():
      if Version(pd.__version__) < Version("1.5.0"):
          pytest.skip("__dataframe__ added to pandas in 1.5.0")
  
      # Test that an error is raised for boolean
      # and categorical dtype (copy is always made)
  
      df = pd.DataFrame({"a": [None, False, True]})
      with pytest.raises(RuntimeError):
          pi.from_dataframe(df, allow_copy=False)
  
      df = pd.DataFrame({"a": [True, False, True]})
      with pytest.raises(RuntimeError):
          pi.from_dataframe(df, allow_copy=False)
  
      df = pd.DataFrame({"weekday": ["a", "b", None]})
      df = df.astype("category")
      with pytest.raises(RuntimeError):
          pi.from_dataframe(df, allow_copy=False)
  
      df = pd.DataFrame({"weekday": ["a", "b", "c"]})
      df = df.astype("category")
      with pytest.raises(RuntimeError):
          pi.from_dataframe(df, allow_copy=False)
  
imports: from datetime import datetime
  import numpy
  import pyarrow
  from pyarrow.vendored.version import Version
  import pytest
  import pyarrow.interchange
  from pyarrow.interchange.column import _PyArrowColumn, ColumnNullType, DtypeKind
  from pyarrow.interchange.from_dataframe import _from_dataframe
label_desc: Use image node_id 17 for calling a global function with example usage: test_allow_copy_false_bool_categorical() without return types