 -> Iterator[_T]: ...
    @classmethod
    def rate_limited_scan(
        cls: Type[_T],
        # TODO: annotate Condition class
        filter_condition: Optional[Any] = ...,
        attributes_to_get: Optional[Sequence[Text]] = ...,
        segment: Optional[int] = ...,
        total_segments: Optional[int] = ...,
        limit: Optional[int] = ...,
        conditional_operator: Optional[Text] = ...,
        last_evaluated_key: Optional[Any] = ...,
        page_size: Optional[int] = ...,
        timeout_seconds: Optional[int] = ...,
        read_capacity_to_consume_per_second: int = ...,
        allow_rate_limited_scan_without_consumed_capacity: Optional[bool] = ...,
        max_sleep_between_retry: int = ...,
        max_consecutive_exceptions: int = ...,
        consistent_read: Optional[bool] = ...,
        index_name: Optional[str] = ...,
        **filters: Any,
    ) -> Iterator[_T]: ...
    @classmethod
    def scan(
        cls: Type[_T],
        segment: Optional[int] = ...,
        total_segments: Optional[int] = ...,
        limit: Optional[int] = ...,
        conditional_operator: Optional[Text] = ...,
        last_evaluated_key: Optional[Any] = ...,
        page_size: Optional[int] = ...,
        **filters,
    ) -> Iterator[_T]: ...
    @classmethod
    def exists(cls: Type[_T]) -> bool: ...
    @classmethod
    def delete_table(cls): ...
    @classmethod
    def describe_table(cls): ...
    @classmethod
    def create_table(
        cls: Type[_T], wait: bool = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ...
    ): ...
    @classmethod
    def dumps(cls): ...
    @classmethod
    def dump(cls, filename): ...
    @classmethod
    def loads(cls, data): ...
    @classmethod
    def load(cls, filename): ...
    @classmethod
    def add_throttle_record(cls, records): ...
    @classmethod
    def get_throttle(cls): ...
    @classmethod
    def get_attributes(cls) -> Dict[str, Attribute[Any]]: ...
    @classmethod
    def _get_attributes(cls) -> Dict[str, Attribute[Any]]: ...

class ModelContextManager(Generic[_T]):
    model: Type[_T]
    auto_commit: bool
    max_operations: int
    pending_operations: List[Dict[Text, Any]]
    def __init__(self, model: Type[_T], auto_commit: bool = ...) -> None: ...
    def __enter__(self) -> ModelContextManager[_T]: ...

class BatchWrite(ModelContextManager[_T]):
    def save(self, put_item: _T) -> None: ...
    def delete(self, del_item: _T) -> None: ...
    def __enter__(self) -> BatchWrite[_T]: ...
    def __exit__(self, exc_type, exc_val, exc_tb) -> None: ...
    pending_operations: Any
    def commit(self) -> None: ...
PK