






from abc import ABC, abstractmethod
from argparse import ArgumentParser


class     __SCREAMING_SNAKE_CASE					(   __a):






						@staticmethod
						@abstractmethod
						def       UpperCamelCase__      (	_UpperCamelCase   ):






												"""simple docstring"""
												raise NotImplementedError()







						@abstractmethod
						def       UpperCamelCase__      (	self   ):






												"""simple docstring"""
												raise NotImplementedError()













from collections import deque

from .hash_table import HashTable


class     __SCREAMING_SNAKE_CASE					(   __lowercase):






						def __init__(	self     ,						*_UpperCamelCase     ,						**_UpperCamelCase   ):






												"""simple docstring"""
												super().__init__(*_UpperCamelCase     ,						**_UpperCamelCase   )






						def       UpperCamelCase__      (	self     ,						_UpperCamelCase     ,						_UpperCamelCase   ):






												"""simple docstring"""
												lowerCAmelCase__    						=						deque([]   ) if self.values[key] is None else self.values[key]
												self.values[key].appendleft(_UpperCamelCase   )
												lowerCAmelCase__    						=						self.values[key]






						def       UpperCamelCase__      (	self   ):






												"""simple docstring"""
												return (
												    sum(self.charge_factor - len(_UpperCamelCase   ) for slot in self.values   )
												    / self.size_table
												    * self.charge_factor
												)







						def       UpperCamelCase__      (	self     ,						_UpperCamelCase     ,						_UpperCamelCase=None   ):






												"""simple docstring"""
												if not (
												    len(self.values[key]   ) == self.charge_factor and self.values.count(_UpperCamelCase   ) == 0
												):
																		return key
												return super()._collision_resolution(_UpperCamelCase     ,						_UpperCamelCase   )





