



'''simple docstring'''





from __future__ import annotations

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

_lowerCAmelCase      						=	TypeVar('''T''')






class        lowerCAmelCase_(				Generic[T]     ):
  '''simple docstring'''




  __lowercase							:      deque[T]  # Cache store of keys
  __lowercase							:      set[T]  # References of the keys in cache
  __lowercase							:      int				=      1_0  # Maximum capacity of cache




  def __init__(    self  ,__UpperCAmelCase      )    ->		Optional[int]:
      lowerCAmelCase__ :  Tuple							      =					deque()
      lowerCAmelCase__ :  Optional[int]							      =					set()
      if not n:
          lowerCAmelCase__ :  Tuple							      =					sys.maxsize
      elif n < 0:
          raise ValueError("""n should be an integer greater than 0."""      )
      else:
          lowerCAmelCase__ :  Dict							      =					n




  def 							UpperCAmelCase_	(    self  ,__UpperCAmelCase      )    ->		Tuple:






      if x not in self.key_reference:
          if len(self.dq_store      ) == LRUCache._MAX_CAPACITY:
              lowerCAmelCase__ :  int							      =					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      )    ->		Optional[int]:






      for k in self.dq_store:
          print(__UpperCAmelCase      )






  def __repr__(    self      )    ->		Optional[int]:
      return F"""LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store      )}"""


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 _lowerCAmelCase      						=	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]"










import numpy as np







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	np.array:
     return 1 / (1 + np.exp(-vector			))







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	np.array:
     return vector * sigmoid(1.7_0_2 * vector			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()