
"""simple docstring"""




from collections import deque

from .hash_table import HashTable


class 			__magic_name__       (       SCREAMING_SNAKE_CASE__ ):
       def __init__(     self ,				*A_ ,				**A_       )     ->	List[str]:





         """simple docstring"""




         super().__init__(*A_ ,				**A_       )
       def 							lowercase_							(     self ,				A_ ,				A_       )     ->	Union[str, Any]:





         """simple docstring"""




         _lowercase:			str       =     deque([]       ) if self.values[key] is None else self.values[key]
         self.values[key].appendleft(A_       )
         _lowercase:			Optional[int]       =     self.values[key]
       def 							lowercase_							(     self       )     ->	Optional[int]:





         """simple docstring"""




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



       def 							lowercase_							(     self ,				A_ ,				A_=None       )     ->	Any:





         """simple docstring"""




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


"""simple docstring"""




from typing import Any

import numpy as np




def  _lowerCAmelCase		(		_UpperCamelCase						):






  """simple docstring"""



  return np.array_equal(_UpperCamelCase ,				matrix.conjugate().T						)




def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase						):






  """simple docstring"""



  _lowercase:			str       =     v.conjugate().T
  _lowercase:			List[Any]       =     v_star.dot(_UpperCamelCase						)
  assert isinstance(_UpperCamelCase ,				np.ndarray						)
  return (v_star_dot.dot(_UpperCamelCase						)) / (v_star.dot(_UpperCamelCase						))




def  _lowerCAmelCase		(		):






  """simple docstring"""



  _lowercase:			int       =     np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]						)
  _lowercase:			str       =     np.array([[1], [2], [3]]						)
  assert is_hermitian(_UpperCamelCase						), f'''{a} is not hermitian.'''
  print(rayleigh_quotient(_UpperCamelCase ,				_UpperCamelCase						)						)

  _lowercase:			Any       =     np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]						)
  assert is_hermitian(_UpperCamelCase						), f'''{a} is not hermitian.'''
  assert rayleigh_quotient(_UpperCamelCase ,				_UpperCamelCase						) == float(3						)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  tests()
