code: def test_nlargest_n(self, nselect_method, n, order):
      # GH#10393
      df = pd.DataFrame(
          {
              "a": np.random.default_rng(2).permutation(10),
              "b": list(ascii_lowercase[:10]),
              "c": np.random.default_rng(2)
              .permutation(10)
              .astype("float64"),
          }
      )
      if "b" in order:
          error_msg = (
              f"Column 'b' has dtype (object|string), "
              f"cannot use method '{nselect_method}' with this dtype"
          )
          with pytest.raises(TypeError, match=error_msg):
              getattr(df, nselect_method)(n, order)
      else:
          ascending = nselect_method == "nsmallest"
          result = getattr(df, nselect_method)(n, order)
          expected = df.sort_values(order, ascending=ascending).head(n)
          tm.assert_frame_equal(result, expected)
  
file_path: pandas/pandas/tests/frame/methods/test_nlargest.py
imports: from string import ascii_lowercase
  import numpy
  import pytest
  import pandas
  import pandas._testing
  from pandas.util.version import Version
label_desc: Use image node_id 1 for calling the TestNLargestNSmallest obj's underlying member method code with example usage: obj.test_nlargest_n(nselect_method, n, order) without return types