code: def test_pivot_apply():
      data = pd.DataFrame(
          {
              "id": list("abcabc"),
              "x": [1, 2, 3, 11, 22, 33],
              "y": [1, 2, 3, 11, 22, 33],
          }
      )
  
      res1 = pivot_apply(data, "x", "id", np.min)
      res2 = pivot_apply(data, "y", "id", np.max)
  
      assert res1.index.tolist() == list("abc")
      assert res1.index.name == "id"
      assert (res1 + res2 == [12, 24, 36]).all()
  
file_path: plotnine/tests/test_utils.py
imports: import itertools
  import random
  import string
  import warnings
  import numpy
  import pandas
  from plotnine._utils import _margins, add_margins, join_keys, match, ninteraction, pivot_apply, remove_missing, uniquecols
  from plotnine.data import mtcars
label_desc: Use image node_id 9 for calling a global function with example usage: test_pivot_apply() without return types