




from __future__ import annotations

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

snake_case_ : Union[str, Any]    		=       TypeVar("T")







class __snake_case			(			Generic[T]		):
   UpperCAmelCase__  :    deque[T]  # Cache store of keys
   UpperCAmelCase__  :    set[T]  # References of the keys in cache
   UpperCAmelCase__  :    int          =  1_0  # Maximum capacity of cache







   def __init__(      self		:						Optional[int]					,						_snake_case		:						int):

        """simple docstring"""


        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 lowerCamelCase						(      self		:						int					,						_snake_case		:						T):

        """simple docstring"""


        if x not in self.key_reference:
             if len(self.dq_store) == LRUCache._MAX_CAPACITY:
                  UpperCAmelCase_          =							self.dq_store.pop()
                  self.key_reference.remove(_snake_case)
        else:
             self.dq_store.remove(_snake_case)

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







   def lowerCamelCase						(      self		:						Any):

        """simple docstring"""


        for k in self.dq_store:
             print(_snake_case)







   def __repr__(      self		:						Optional[Any]):

        """simple docstring"""


        return F"""LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store)}"""


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    snake_case_ : 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]"










"""simple docstring"""







import math
import random




def    UpperCAmelCase__       (lowerCAmelCase_  ,						lowerCAmelCase_ = False   ):




					'''simple docstring'''


					if deriv:
										return value * (1 - value)
					return 1 / (1 + math.exp(-value   ))


# Initial Value
a__				:							Tuple						=     0.02




def    UpperCAmelCase__       (lowerCAmelCase_  ,						lowerCAmelCase_   ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE						   =				float(2 * (random.randint(1  ,						100   )) - 1   )

					for _ in range(lowerCAmelCase_   ):
										# Forward propagation
										__SCREAMING_SNAKE_CASE						   =				sigmoid_function(INITIAL_VALUE * weight   )
										# How much did we miss?
										__SCREAMING_SNAKE_CASE						   =				(expected / 100) - layer_a
										# Error delta
										__SCREAMING_SNAKE_CASE						   =				layer_1_error * sigmoid_function(lowerCAmelCase_  ,						lowerCAmelCase_   )
										# Update weight
										weight += INITIAL_VALUE * layer_1_delta

					return layer_a * 100


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		a__				:							List[str]						=     int(input('''Expected value: '''))
		a__				:							str						=     int(input('''Number of propagations: '''))
		print(forward_propagation(expected, number_propagations))
