code: def test_pivot_by_lambda(self):
      table = Table(self.rows, self.column_names, self.column_types)
  
      pivot_table = table.pivot(lambda r: r["gender"])
  
      pivot_rows = (("male", 3), ("female", 3))
  
      self.assertColumnNames(pivot_table, ["group", "Count"])
      self.assertRowNames(pivot_table, ["male", "female"])
      self.assertColumnTypes(pivot_table, [Text, Number])
      self.assertRows(pivot_table, pivot_rows)
  
imports: import sys
  from decimal import Decimal
  from agate import Table
  from agate.aggregations import Sum
  from agate.computations import Percent
  from agate.data_types import Number, Text
  from agate.testcase import AgateTestCase
label_desc: Use image node_id 3 for calling the TestPivot obj's underlying member method code with example usage: obj.test_pivot_by_lambda() without return types