ENH: Implement nlargest and nsmallest for DataFrameGroupBy
- [ ] closes #46924 
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file if fixing a bug or adding a new feature.

Try to implement `nlargest` and `nsmallest` methods for `DataFrameGroupBy`. Appreciate any comments.

```python
>>> df
  group name  data
0   bar   b1     1
1   bar   b2     3
2   bar   b3     3
3   foo   f1     1
4   foo   f2     1
5   foo   f3     3


>>> df.groupby("group").nlargest(n=2)
        name  data
group
bar   1   b2     3
      2   b3     3
foo   5   f3     3
      3   f1     1


>>> df.groupby("group").nlargest(n=2, keep="all")
        name  data
group
bar   1   b2     3
      2   b3     3
foo   5   f3     3
      3   f1     1
      4   f2     1

>>> df.groupby("group").nsmallest(n=2)
        name  data
group
bar   0   b1     1
      1   b2     3
foo   3   f1     1
      4   f2     1


>>> df.groupby("group").nsmallest(n=2, keep="all")
        name  data
group
bar   0   b1     1
      1   b2     3
      2   b3     3
foo   3   f1     1
      4   f2     1
```
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.