






from __future__ import annotations

from typing import Generic, TypeVar

__UpperCAmelCase      =				TypeVar("T")
class 	a_(		lowercase__	):



     """simple docstring"""



     pass

class 	a_(		lowercase__	):



     """simple docstring"""



     pass

class 	a_(		Generic[T]	):



     """simple docstring"""



     def __init__(		self					:	Optional[int]  ,  lowerCAmelCase__					:	int = 1_0)							->	List[Any]:

      """simple docstring"""
      SCREAMING_SNAKE_CASE				    =		[]
      SCREAMING_SNAKE_CASE				    =		limit





     def __bool__(		self					:	Tuple)							->	bool:

      """simple docstring"""
      return bool(self.stack)





     def __str__(		self					:	str)							->	str:

      """simple docstring"""
      return str(self.stack)





     def     __UpperCamelCase						(		self					:	Tuple  ,  lowerCAmelCase__					:	T)							->	None:

      """simple docstring"""
      if len(self.stack) >= self.limit:
       raise StackOverflowError
      self.stack.append(lowerCAmelCase__)





     def     __UpperCamelCase						(		self					:	int)							->	T:

      """simple docstring"""
      if not self.stack:
       raise StackUnderflowError
      return self.stack.pop()





     def     __UpperCamelCase						(		self					:	Tuple)							->	T:

      """simple docstring"""
      if not self.stack:
       raise StackUnderflowError
      return self.stack[-1]





     def     __UpperCamelCase						(		self					:	Tuple)							->	bool:

      """simple docstring"""
      return not bool(self.stack)





     def     __UpperCamelCase						(		self					:	Optional[Any])							->	bool:

      """simple docstring"""
      return self.size() == self.limit





     def     __UpperCamelCase						(		self					:	Any)							->	int:

      """simple docstring"""
      return len(self.stack)





     def __contains__(		self					:	List[Any]  ,  lowerCAmelCase__					:	T)							->	bool:

      """simple docstring"""
      return item in self.stack





def 						A_					(						)				->None:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		Stack(1_0			)
 assert bool(lowercase_			) is False
 assert stack.is_empty() is True
 assert stack.is_full() is False
 assert str(lowercase_			) == "[]"

 try:
  SCREAMING_SNAKE_CASE				    =		stack.pop()
  raise AssertionError  # This should not happen
 except StackUnderflowError:
  assert True  # This should happen

 try:
  SCREAMING_SNAKE_CASE				    =		stack.peek()
  raise AssertionError  # This should not happen
 except StackUnderflowError:
  assert True  # This should happen

 for i in range(1_0			):
  assert stack.size() == i
  stack.push(lowercase_			)

 assert bool(lowercase_			)
 assert not stack.is_empty()
 assert stack.is_full()
 assert str(lowercase_			) == str(list(range(1_0			)			)			)
 assert stack.pop() == 9
 assert stack.peek() == 8

 stack.push(1_0_0			)
 assert str(lowercase_			) == str([0, 1, 2, 3, 4, 5, 6, 7, 8, 1_0_0]			)

 try:
  stack.push(2_0_0			)
  raise AssertionError  # This should not happen
 except StackOverflowError:
  assert True  # This should happen

 assert not stack.is_empty()
 assert stack.size() == 1_0

 assert 5 in stack
 assert 5_5 not in stack


if __name__ == "__main__":
      test_stack()







from __future__ import annotations





def  _snake_case		(snake_case_					:     str  )							->		bool:
  __UpperCAmelCase	:  int
  __UpperCAmelCase	:  list[str]		=     list(snake_case_  )
  __UpperCAmelCase,			__UpperCAmelCase	:  Any		=     _vector[:-1], int(_vector[-1]  )
  __UpperCAmelCase	:  list[int]		=     [int(snake_case_  ) for digit in __vector]

  vector.reverse()
  for i, digit in enumerate(snake_case_  ):
    if i & 1 == 0:
      __UpperCAmelCase	:  int		=     digit * 2
      if doubled > 9:
        doubled -= 9
      check_digit += doubled
    else:
      check_digit += digit

  return check_digit % 10 == 0


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      assert is_luhn('''79927398713''')
      assert not is_luhn('''79927398714''')





