




from hashlib import mda, shaaaa

__SCREAMING_SNAKE_CASE      :				Optional[int]				      =(shaaaa, mda)






class      A     :
     """simple docstring"""

     def __init__(      self					:				Optional[int]		,					A__					:				int = 8     )			->    None:
           lowerCamelCase__ 					=			0B0
           lowerCamelCase__ 					=			size




     def 	__snake_case				(      self					:				Optional[int]		,					A__					:				str     )			->    None:
           lowerCamelCase__ 					=			self.hash_(A__     )
           self.bitarray |= h




     def 	__snake_case				(      self					:				Tuple		,					A__					:				str     )			->    bool:
           lowerCamelCase__ 					=			self.hash_(A__     )
           return (h & self.bitarray) == h




     def __contains__(      self					:				Optional[int]		,					A__					:				str     )			->    bool:
           return self.exists(A__     )




     def 	__snake_case				(      self					:				Optional[int]		,					A__					:				int     )			->    str:
           lowerCamelCase__ 					=			bin(A__     )[2:]
           return res.zfill(self.size     )




     @property
     def 	__snake_case				(      self					:				Tuple     )			->    str:
           return self.format_bin(self.bitarray     )




     def 	__snake_case				(      self					:				Optional[int]		,					A__					:				str     )			->    int:
           lowerCamelCase__ 					=			0B0
           for func in HASH_FUNCTIONS:
                 lowerCamelCase__ 					=			(
                     int.from_bytes(func(value.encode()     ).digest()		,					'little'     ) % self.size
                 )
                 res |= 2**position
           return res




     def 	__snake_case				(      self					:				Optional[int]		,					A__					:				str     )			->    str:
           return self.format_bin(self.hash_(A__     )     )




     @property
     def 	__snake_case				(      self					:				Union[str, Any]     )			->    float:
           lowerCamelCase__ 					=			bin(self.bitarray     ).count('1'     )
           return (n_ones / self.size) ** len(A__     )





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__SCREAMING_SNAKE_CASE      :				int				      ={"""configuration_nat""": ["""NAT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NatConfig"""]}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __SCREAMING_SNAKE_CASE      :				Optional[int]				      =[
          """NAT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """NatForImageClassification""",
          """NatModel""",
          """NatPreTrainedModel""",
          """NatBackbone""",
      ]

if TYPE_CHECKING:
      from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_nat import (
                NAT_PRETRAINED_MODEL_ARCHIVE_LIST,
                NatBackbone,
                NatForImageClassification,
                NatModel,
                NatPreTrainedModel,
            )

else:
      import sys

      __SCREAMING_SNAKE_CASE      :				Any				      =_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)