code: def __init__(self, obj, n: int, keep: str) -> None:
      self.obj = obj
      self.n = n
      self.keep = keep
  
      if self.keep not in ("first", "last", "all"):
          raise ValueError(
              'keep must be either "first", "last" or "all"'
          )
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/methods/selectn.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Hashable, Sequence, cast, final
  import numpy
  from pandas._libs import algos
  from pandas._typing import DtypeObj, IndexLabel
  from pandas.core.dtypes.common import is_bool_dtype, is_complex_dtype, is_integer_dtype, is_list_like, is_numeric_dtype, needs_i8_conversion
  from pandas.core.dtypes.dtypes import BaseMaskedDtype
label_desc: Use image node_id 1 to create a new SelectN object  with example: obj = SelectN(obj, n, keep)