

# Lint as: python3

import hashlib
from typing import Union



def 			SCREAMING_SNAKE_CASE       (   lowercase__      ) ->	bytes:






 if isinstance(_UpperCAmelCase				,				_UpperCAmelCase      ):
  # Data already in bytes, returns as it as
  return hash_data
 elif isinstance(_UpperCAmelCase				,				_UpperCAmelCase      ):
  # We keep the data as it as for it ot be later encoded to UTF-8
  # However replace `\\` with `/` for Windows compatibility
  lowerCAmelCase__      :							Optional[Any]    =							hash_data.replace("\\"				,				"/"      )
 elif isinstance(_UpperCAmelCase				,				_UpperCAmelCase      ):
  lowerCAmelCase__      :							Optional[Any]    =							str(_UpperCAmelCase      )
 else:
  # If data is not of the required type, raise error
  raise InvalidKeyError(_UpperCAmelCase      )

 return hash_data.encode("utf-8"      )






class  __a				(	__magic_name__					):





       """simple docstring"""


       def __init__(      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							Optional[int]    =							'\nFAILURE TO GENERATE DATASET: Invalid key type detected'
        lowerCAmelCase__      :							Optional[int]    =							F"""\nFound Key {hash_data} of type {type(UpperCAmelCase_      )}"""
        lowerCAmelCase__      :							Dict    =							'\nKeys should be either str, int or bytes type'
        super().__init__(F"""{self.prefix}{self.err_msg}{self.suffix}"""      )






class  __a				(	__magic_name__					):





       """simple docstring"""


       def __init__(      self ,				snake_case ,				snake_case ,				snake_case=""      ):





        """simple docstring"""

        lowerCAmelCase__      :							int    =							key
        lowerCAmelCase__      :							List[Any]    =							duplicate_key_indices
        lowerCAmelCase__      :							Optional[Any]    =							fix_msg
        lowerCAmelCase__      :							List[str]    =							'Found multiple examples generated with the same key'
        if len(UpperCAmelCase_      ) <= 20:
         lowerCAmelCase__      :							List[str]    =							F"""\nThe examples at index {", ".join(UpperCAmelCase_      )} have the key {key}"""
        else:
         lowerCAmelCase__      :							int    =							F"""\nThe examples at index {", ".join(duplicate_key_indices[:20]      )}... ({len(UpperCAmelCase_      ) - 20} more) have the key {key}"""
        lowerCAmelCase__      :							str    =							'\n' + fix_msg if fix_msg else ''
        super().__init__(F"""{self.prefix}{self.err_msg}{self.suffix}"""      )






class  __a				:





       """simple docstring"""


       def __init__(      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							Union[str, Any]    =							hashlib.mda(_as_bytes(UpperCAmelCase_      )      )






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							Any    =							self._split_mda.copy()
        lowerCAmelCase__      :							str    =							_as_bytes(UpperCAmelCase_      )
        mda.update(UpperCAmelCase_      )
        # Convert to integer with hexadecimal conversion
        return int(mda.hexdigest() ,				16      )









"""simple docstring"""

def 			SCREAMING_SNAKE_CASE       (   lowercase__      ) ->	int:
 return 1 if input_a == 0 else 0



def 			SCREAMING_SNAKE_CASE       (   ) ->	None:
 assert not_gate(0      ) == 1
 assert not_gate(1      ) == 0


if __name__ == "__main__":
    print(not_gate(0))
    print(not_gate(1))






