





from __future__ import annotations

from typing import Generic, TypeVar

_UpperCamelCase       :				Tuple           =			TypeVar("""T""")







class 		_lowerCAmelCase(		_a):

  """simple docstring"""







  pass







class 		_lowerCAmelCase(		_a):

  """simple docstring"""







  pass







class 		_lowerCAmelCase(		Generic[T]):

  """simple docstring"""







  def __init__(   self    ,							UpperCAmelCase = 10      )->   str:
     __A    =  []
     __A    =  limit

  def __bool__(   self      )->   bool:
     return bool(self.stack      )

  def __str__(   self      )->   str:
     return str(self.stack      )

  def 						SCREAMING_SNAKE_CASE__			(   self    ,							UpperCAmelCase      )->   None:
     if len(self.stack      ) >= self.limit:
        raise StackOverflowError
     self.stack.append(UpperCAmelCase      )

  def 						SCREAMING_SNAKE_CASE__			(   self      )->   T:
     if not self.stack:
        raise StackUnderflowError
     return self.stack.pop()

  def 						SCREAMING_SNAKE_CASE__			(   self      )->   T:
     if not self.stack:
        raise StackUnderflowError
     return self.stack[-1]

  def 						SCREAMING_SNAKE_CASE__			(   self      )->   bool:
     return not bool(self.stack      )

  def 						SCREAMING_SNAKE_CASE__			(   self      )->   bool:
     return self.size() == self.limit

  def 						SCREAMING_SNAKE_CASE__			(   self      )->   int:
     return len(self.stack      )





  def __contains__(   self    ,							UpperCAmelCase      )->   bool:
     return item in self.stack
def  __UpperCamelCase    (						)    ->		None:


   '''simple docstring'''







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

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

   try:
      __A    =  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(snake_case      )

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

   stack.push(1_0_0      )
   assert str(snake_case      ) == 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  __UpperCamelCase    (						snake_case      )    ->		bool:


   '''simple docstring'''







   __A    =  42
   __A    =  list(snake_case      )
   __A   ,		__A    =  _vector[:-1], int(_vector[-1]      )
   __A    =  [int(snake_case      ) for digit in __vector]

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

   return check_digit % 1_0 == 0


if __name__ == "__main__":
    import doctest

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

