
"""simple docstring"""






from queue import Queue
from typing import TYPE_CHECKING, Optional


if TYPE_CHECKING:
				from ..models.auto import AutoTokenizer




class 			_SCREAMING_SNAKE_CASE					:






			def  __lowerCAmelCase (					self       ,   __A       )			->     int:
						raise NotImplementedError()






			def  __lowerCAmelCase (					self       )			->     Optional[Any]:
						raise NotImplementedError()




class 			_SCREAMING_SNAKE_CASE					(			A__							):






			def __init__(					self       ,   __A       ,   __A = False       ,   **__A       )			->     int:
						lowerCAmelCase_    :List[str]			     =  tokenizer
						lowerCAmelCase_    :Dict			     =  skip_prompt
						lowerCAmelCase_    :Union[str, Any]			     =  decode_kwargs

						# variables used in the streaming process
						lowerCAmelCase_    :Any			     =  []
						lowerCAmelCase_    :List[Any]			     =  0
						lowerCAmelCase_    :List[Any]			     =  True






			def  __lowerCAmelCase (					self       ,   __A       )			->     str:
						if len(value.shape       ) > 1 and value.shape[0] > 1:
									raise ValueError("""TextStreamer only supports batch size 1"""       )
						elif len(value.shape       ) > 1:
									lowerCAmelCase_    :Tuple			     =  value[0]

						if self.skip_prompt and self.next_tokens_are_prompt:
									lowerCAmelCase_    :int			     =  False
									return

						# Add the new token to the cache and decodes the entire thing.
						self.token_cache.extend(value.tolist()       )
						lowerCAmelCase_    :int			     =  self.tokenizer.decode(self.token_cache       ,   **self.decode_kwargs       )

						# After the symbol for a new line, we flush the cache.
						if text.endswith("""\n"""       ):
									lowerCAmelCase_    :List[str]			     =  text[self.print_len :]
									lowerCAmelCase_    :Tuple			     =  []
									lowerCAmelCase_    :Tuple			     =  0
						# If the last token is a CJK character, we print the characters.
						elif len(__A       ) > 0 and self._is_chinese_char(ord(text[-1]       )       ):
									lowerCAmelCase_    :Union[str, Any]			     =  text[self.print_len :]
									self.print_len += len(__A       )
						# Otherwise, prints until the last space char (simple heuristic to avoid printing incomplete words,
						# which may change with the subsequent token -- there are probably smarter ways to do this!)
						else:
									lowerCAmelCase_    :Tuple			     =  text[self.print_len : text.rfind(""" """       ) + 1]
									self.print_len += len(__A       )

						self.on_finalized_text(__A       )






			def  __lowerCAmelCase (					self       )			->     Dict:
						# Flush the cache, if it exists
						if len(self.token_cache       ) > 0:
									lowerCAmelCase_    :Optional[int]			     =  self.tokenizer.decode(self.token_cache       ,   **self.decode_kwargs       )
									lowerCAmelCase_    :List[str]			     =  text[self.print_len :]
									lowerCAmelCase_    :Optional[int]			     =  []
									lowerCAmelCase_    :int			     =  0
						else:
									lowerCAmelCase_    :Tuple			     =  """"""

						lowerCAmelCase_    :int			     =  True
						self.on_finalized_text(__A       ,   stream_end=__A       )






			def  __lowerCAmelCase (					self       ,   __A       ,   __A = False       )			->     Optional[Any]:
						print(__A       ,   flush=__A       ,   end="""""" if not stream_end else None       )






			def  __lowerCAmelCase (					self       ,   __A       )			->     Dict:
						# This defines a "chinese character" as anything in the CJK Unicode block:
						#   https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)
						#
						# Note that the CJK Unicode block is NOT all Japanese and Korean characters,
						# despite its name. The modern Korean Hangul alphabet is a different block,
						# as is Japanese Hiragana and Katakana. Those alphabets are used to write
						# space-separated words, so they are not treated specially and handled
						# like the all of the other languages.
						if (
						    (cp >= 0x4E_00 and cp <= 0x9F_FF)
						    or (cp >= 0x34_00 and cp <= 0x4D_BF)  #
						    or (cp >= 0x2_00_00 and cp <= 0x2_A6_DF)  #
						    or (cp >= 0x2_A7_00 and cp <= 0x2_B7_3F)  #
						    or (cp >= 0x2_B7_40 and cp <= 0x2_B8_1F)  #
						    or (cp >= 0x2_B8_20 and cp <= 0x2_CE_AF)  #
						    or (cp >= 0xF9_00 and cp <= 0xFA_FF)
						    or (cp >= 0x2_F8_00 and cp <= 0x2_FA_1F)  #
						):  #
									return True

						return False




class 			_SCREAMING_SNAKE_CASE					(			A__							):






			def __init__(					self       ,   __A       ,   __A = False       ,   __A = None       ,   **__A       )			->     Dict:
						super().__init__(__A       ,   __A       ,   **__A       )
						lowerCAmelCase_    :Union[str, Any]			     =  Queue()
						lowerCAmelCase_    :Any			     =  None
						lowerCAmelCase_    :List[Any]			     =  timeout






			def  __lowerCAmelCase (					self       ,   __A       ,   __A = False       )			->     List[str]:
						self.text_queue.put(__A       ,   timeout=self.timeout       )
						if stream_end:
									self.text_queue.put(self.stop_signal       ,   timeout=self.timeout       )






			def __iter__(					self       )			->     Optional[Any]:
						return self






			def  __lowerCAmelCase (					self       )			->     Tuple:
						lowerCAmelCase_    :int			     =  self.text_queue.get(timeout=self.timeout       )
						if value == self.stop_signal:
									raise StopIteration()
						else:
									return value











def 	__UpperCamelCase	(  _lowerCAmelCase = 100_0000		)       ->  int:



    """simple docstring"""






    A :       str          =   limit + 1
    A :       Tuple          =   [0] * limit
    for first_term in range(1      ,     _lowerCAmelCase		):
        for n in range(_lowerCAmelCase      ,     _lowerCAmelCase      ,     _lowerCAmelCase		):
            A :       Any          =   first_term + n / first_term
            if common_difference % 4:  # d must be divisble by 4
                continue
            else:
                common_difference /= 4
                if (
                    first_term > common_difference
                    and first_term < 4 * common_difference
                ):  # since x,y,z are positive integers
                    frequency[n] += 1  # so z>0 and a>d ,also 4d<a

    A :       Optional[int]          =   sum(1 for x in frequency[1:limit] if x == 10		)

    return count


if __name__ == "__main__":
     print(F"""{solution() = }""")


