code: def test_descending_groupby_k_3(df):
      """Test descending group by, k=3"""
      expected = (
          df.groupby("result", sort=False)
          .apply(
              lambda d: d.sort_values("age", ascending=False).head(3)
          )
          .droplevel(0)
          .reset_index(drop=True)
      )
      assert_frame_equal(
          df.groupby_topk("result", "age", 3, ascending=False), expected
      )
  
file_path: pyjanitor/tests/functions/test_groupby_topk.py
imports: import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_descending_groupby_k_3(df) without return types