





'''simple docstring'''






import math
import unittest


def 					_a   (__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  assert isinstance(SCREAMING_SNAKE_CASE_  ,      SCREAMING_SNAKE_CASE_   ) and (
      number >= 0
  ), "'number' must been an int and positive"

  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5  ,      int(math.sqrt(SCREAMING_SNAKE_CASE_   ) + 1   )  ,      6   ):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True







class 		UpperCAmelCase   (				unittest.TestCase):


  """simple docstring"""







  def   UpperCamelCase__      (				self    :					List[Any]  )     ->						Tuple:
    self.assertTrue(is_prime(2  )  )
    self.assertTrue(is_prime(3  )  )
    self.assertTrue(is_prime(5  )  )
    self.assertTrue(is_prime(7  )  )
    self.assertTrue(is_prime(11  )  )
    self.assertTrue(is_prime(13  )  )
    self.assertTrue(is_prime(17  )  )
    self.assertTrue(is_prime(19  )  )
    self.assertTrue(is_prime(23  )  )
    self.assertTrue(is_prime(29  )  )




  def   UpperCamelCase__      (				self    :					Any  )     ->						Tuple:






    with self.assertRaises(lowercase__  ):
      is_prime(-19  )
    self.assertFalse(
        is_prime(0  )							,	'''Zero doesn\'t have any positive factors, primes must have exactly two.'''							,	)
    self.assertFalse(
        is_prime(1  )							,	'''One only has 1 positive factor, primes must have exactly two.'''							,	)
    self.assertFalse(is_prime(2 * 2  )  )
    self.assertFalse(is_prime(2 * 3  )  )
    self.assertFalse(is_prime(3 * 3  )  )
    self.assertFalse(is_prime(3 * 5  )  )
    self.assertFalse(is_prime(3 * 5 * 7  )  )


if __name__ == "__main__":
      unittest.main()













'''simple docstring'''






from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

__lowerCamelCase						: Optional[int]		=   TypeVar('T')







class 		UpperCAmelCase   (				Generic[T]):


  """simple docstring"""







  lowerCAmelCase_					=				42  # Cache store of keys
  lowerCAmelCase_					=				42  # References of the keys in cache
  lowerCAmelCase_					=				10  # Maximum capacity of cache


  def __init__(				self    :					Union[str, Any]							,	UpperCamelCase__    :					int  )     ->						None:
    _UpperCamelCase       			=deque()
    _UpperCamelCase       			=set()
    if not n:
      _UpperCamelCase       			=sys.maxsize
    elif n < 0:
      raise ValueError('''n should be an integer greater than 0.'''  )
    else:
      _UpperCamelCase       			=n


  def   UpperCamelCase__      (				self    :					List[str]							,	UpperCamelCase__    :					T  )     ->						None:
    if x not in self.key_reference:
      if len(self.dq_store  ) == LRUCache._MAX_CAPACITY:
        _UpperCamelCase       			=self.dq_store.pop()
        self.key_reference.remove(UpperCamelCase__  )
    else:
      self.dq_store.remove(UpperCamelCase__  )

    self.dq_store.appendleft(UpperCamelCase__  )
    self.key_reference.add(UpperCamelCase__  )


  def   UpperCamelCase__      (				self    :					Union[str, Any]  )     ->						None:
    for k in self.dq_store:
      print(UpperCamelCase__  )




  def __repr__(				self    :					str  )     ->						str:
    return F'''LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store  )}'''


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      __lowerCamelCase						: LRUCache[str | int]		=   LRUCache(4)
      lru_cache.refer('A')
      lru_cache.refer(2)
      lru_cache.refer(3)
      lru_cache.refer('A')
      lru_cache.refer(4)
      lru_cache.refer(5)
      lru_cache.display()

      print(lru_cache)
      assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"






