code: 
  
  
  from dataclasses import dataclass
  
  UpperCAmelCase__														=      "0.1"
  UpperCAmelCase__														=      "Lucia Harcekova"
  
  @dataclass
  class 						snake_case			:
  			'''simple docstring'''
  
  			UpperCAmelCase       :       int
  			UpperCAmelCase       :       int
  			UpperCAmelCase       :       str
  
  			def __repr__(	self     :     Union[str, Any]					)					->					str:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								return F'''({self.offset}, {self.length}, {self.indicator})'''
  
  class 						snake_case			:
  			'''simple docstring'''
  
  			def __init__(	self     :     str							,							lowerCAmelCase_     :     int = 13							,							lowerCAmelCase_     :     int = 6					)					->					None:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								SCREAMING_SNAKE_CASE_	      =       window_size
  								SCREAMING_SNAKE_CASE_	      =       lookahead_buffer_size
  								SCREAMING_SNAKE_CASE_	      =       self.window_size - self.lookahead_buffer_size
  
  			def _lowercase (	self     :     Dict							,							lowerCAmelCase_     :     str					)					->					list[Token]:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								SCREAMING_SNAKE_CASE_	      =       []
  								SCREAMING_SNAKE_CASE_	      =       ''''''
  
  								# while there are still characters in text to compress
  								while text:
  													# find the next encoding phrase
  													# - triplet with offset, length, indicator (the next encoding character)
  													SCREAMING_SNAKE_CASE_	      =       self._find_encoding_token(lowerCAmelCase_							,							lowerCAmelCase_					)
  
  													# update the search buffer:
  													# - add new characters from text into it
  													# - check if size exceed the max search buffer size, if so, drop the
  													#   oldest elements
  													search_buffer += text[: token.length + 1]
  													if len(lowerCAmelCase_					) > self.search_buffer_size:
  																		SCREAMING_SNAKE_CASE_	      =       search_buffer[-self.search_buffer_size :]
  
  													# update the text
  													SCREAMING_SNAKE_CASE_	      =       text[token.length + 1 :]
  
  													# append the token to output
  													output.append(lowerCAmelCase_					)
  
  								return output
  
  			def _lowercase (	self     :     Optional[int]							,							lowerCAmelCase_     :     list[Token]					)					->					str:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								SCREAMING_SNAKE_CASE_	      =       ''''''
  
  								for token in tokens:
  													for _ in range(token.length					):
  																		output += output[-token.offset]
  													output += token.indicator
  
  								return output
  
  			def _lowercase (	self     :     Tuple							,							lowerCAmelCase_     :     str							,							lowerCAmelCase_     :     str					)					->					Token:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								if not text:
  													raise ValueError('''We need some text to work with.'''					)
  
  								# Initialise result parameters to default values
  								SCREAMING_SNAKE_CASE_      ,SCREAMING_SNAKE_CASE_	      =       0, 0
  
  								if not search_buffer:
  													return Token(lowerCAmelCase_							,							lowerCAmelCase_							,							text[length]					)
  
  								for i, character in enumerate(lowerCAmelCase_					):
  													SCREAMING_SNAKE_CASE_	      =       len(lowerCAmelCase_					) - i
  													if character == text[0]:
  																		SCREAMING_SNAKE_CASE_	      =       self._match_length_from_index(lowerCAmelCase_							,							lowerCAmelCase_							,							0							,							lowerCAmelCase_					)
  																		# if the found length is bigger than the current or if it's equal,
  																		# which means it's offset is smaller: update offset and length
  																		if found_length >= length:
  																							SCREAMING_SNAKE_CASE_      ,SCREAMING_SNAKE_CASE_	      =       found_offset, found_length
  
  								return Token(lowerCAmelCase_							,							lowerCAmelCase_							,							text[length]					)
  
  
  
  
  			def _lowercase (	self     :     Any							,							lowerCAmelCase_     :     str							,							lowerCAmelCase_     :     str							,							lowerCAmelCase_     :     int							,							lowerCAmelCase_     :     int					)					->					int:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								if not text or text[text_index] != window[window_index]:
  													return 0
  								return 1 + self._match_length_from_index(
  								    lowerCAmelCase_							,							window + text[text_index]							,							text_index + 1							,							window_index + 1					)
  
  
  if __name__ == "__main__":
  		from doctest import testmod
  
  		testmod()
  		# Initialize compressor class
  		UpperCAmelCase__														=      LZaaCompressor(window_size=1_3, lookahead_buffer_size=6)
  
  		# Example
  		UpperCAmelCase__														=      "cabracadabrarrarrad"
  		UpperCAmelCase__														=      lzaa_compressor.compress(TEXT)
  		print(lzaa_compressor.compress("ababcbababaa"))
  		UpperCAmelCase__														=      lzaa_compressor.decompress(compressed_text)
  		assert decompressed_text == TEXT, "The LZ77 algorithm returned the invalid result."
  
  
  
style_context: 
  
  
  def 							UpperCAmelCase				(     UpperCAmelCase				,UpperCAmelCase      )->		int:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  					return (input_a, input_a).count(0      ) % 2
  
  
  
  
  
  
  
  def 							UpperCAmelCase				(     )->		None:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  					assert xor_gate(0				,0      ) == 0
  					assert xor_gate(0				,1      ) == 1
  					assert xor_gate(1				,0      ) == 1
  					assert xor_gate(1				,1      ) == 0
  
  
  if __name__ == "__main__":
  		print(xor_gate(0, 0))
  		print(xor_gate(0, 1))
  
  
  