


"""simple docstring"""


from collections import deque

from .hash_table import HashTable
class snake_case      (  _A):







		def __init__(					self      :       int    ,   *a__      :       Union[str, Any]    ,   **a__      :       Optional[Any]		)       ->						Optional[Any]:





						'''simple docstring'''







						super().__init__(*UpperCamelCase__    ,   **UpperCamelCase__		)







		def  a_ (					self      :       Optional[Any]    ,   a__      :       Optional[int]    ,   a__      :       Any		)       ->						Dict:





						'''simple docstring'''







						_A					  =			deque([]		) if self.values[key] is None else self.values[key]
						self.values[key].appendleft(UpperCamelCase__		)
						_A					  =			self.values[key]







		def  a_ (					self      :       List[str]		)       ->						int:





						'''simple docstring'''







						return (
						    sum(self.charge_factor - len(UpperCamelCase__		) for slot in self.values		)
						    / self.size_table
						    * self.charge_factor
						)







		def  a_ (					self      :       Optional[Any]    ,   a__      :       str    ,   a__      :       Tuple=None		)       ->						str:





						'''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__		)








"""simple docstring"""


import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin
class snake_case      (  unittest.TestCase     ,				_UpperCamelCase):







		def  a_ (					self      :       Optional[Any]		)       ->						List[str]:





						'''simple docstring'''







						_A					  =			load_tool("text-classification"		)
						self.tool.setup()
						_A					  =			load_tool("text-classification"    ,   remote=a__		)







		def  a_ (					self      :       Optional[int]		)       ->						Dict:





						'''simple docstring'''







						_A					  =			self.tool("That's quite cool"    ,   ["positive", "negative"]		)
						self.assertEqual(a__    ,   "positive"		)







		def  a_ (					self      :       Optional[Any]		)       ->						Dict:





						'''simple docstring'''







						_A					  =			self.remote_tool("That's quite cool"    ,   ["positive", "negative"]		)
						self.assertEqual(a__    ,   "positive"		)







		def  a_ (					self      :       Dict		)       ->						Optional[int]:





						'''simple docstring'''







						_A					  =			self.tool(text="That's quite cool"    ,   labels=["positive", "negative"]		)
						self.assertEqual(a__    ,   "positive"		)







		def  a_ (					self      :       Dict		)       ->						Any:





						'''simple docstring'''







						_A					  =			self.remote_tool(text="That's quite cool"    ,   labels=["positive", "negative"]		)
						self.assertEqual(a__    ,   "positive"		)