code: def test_agg_item_by_item_raise_typeerror():
      df = DataFrame(
          np.random.default_rng(2).integers(10, size=(20, 10))
      )
  
      def raiseException(df):
          pprint_thing("----------------------------------------")
          pprint_thing(df.to_string())
          raise TypeError("test")
  
      with pytest.raises(TypeError, match="test"):
          df.groupby(0).agg(raiseException)
  
imports: import datetime
  from functools import partial
  import numpy
  import pytest
  from pandas.errors import SpecificationError
  import pandas
  from pandas import DataFrame, Index, MultiIndex, PeriodIndex, Series, date_range, period_range
  import pandas._testing
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 11 for calling a global function with example usage: test_agg_item_by_item_raise_typeerror() without return types