"""
This type stub file was generated by pyright.
"""

from typing import Literal, TYPE_CHECKING
from pandas._typing import PositionalIndexer
from pandas.util._decorators import doc
from pandas import DataFrame, Series
from pandas.core.groupby import groupby

if TYPE_CHECKING:
    ...
class GroupByIndexingMixin:
    """
    Mixin for adding ._positional_selector to GroupBy.
    """
    ...


@doc(GroupByIndexingMixin._positional_selector)
class GroupByPositionalSelector:
    def __init__(self, groupby_object: groupby.GroupBy) -> None:
        ...
    
    def __getitem__(self, arg: PositionalIndexer | tuple) -> DataFrame | Series:
        """
        Select by positional index per group.

        Implements GroupBy._positional_selector

        Parameters
        ----------
        arg : PositionalIndexer | tuple
            Allowed values are:
            - int
            - int valued iterable such as list or range
            - slice with step either None or positive
            - tuple of integers and slices

        Returns
        -------
        Series
            The filtered subset of the original groupby Series.
        DataFrame
            The filtered subset of the original groupby DataFrame.

        See Also
        --------
        DataFrame.iloc : Integer-location based indexing for selection by position.
        GroupBy.head : Return first n rows of each group.
        GroupBy.tail : Return last n rows of each group.
        GroupBy._positional_selector : Return positional selection for each group.
        GroupBy.nth : Take the nth row from each group if n is an int, or a
            subset of rows, if n is a list of ints.
        """
        ...
    


class GroupByNthSelector:
    """
    Dynamically substituted for GroupBy.nth to enable both call and index
    """
    def __init__(self, groupby_object: groupby.GroupBy) -> None:
        ...
    
    def __call__(self, n: PositionalIndexer | tuple, dropna: Literal["any", "all", None] = ...) -> DataFrame | Series:
        ...
    
    def __getitem__(self, n: PositionalIndexer | tuple) -> DataFrame | Series:
        ...
    


