


'''simple docstring'''
import collections
import json
import os
import re
from typing import TYPE_CHECKING, List, Optional, Tuple

import numpy as np

from ...tokenization_utils_fast import PreTrainedTokenizer
from ...utils import logging


if TYPE_CHECKING:
    from transformers.pipelines.conversational import Conversation


lowerCAmelCase						=					logging.get_logger(__name__)

lowerCAmelCase						=					{"""vocab_file""": """vocab.txt""", """emoji_file""": """emoji.json"""}

lowerCAmelCase						=					{
    """vocab_file""": {
        """abeja/gpt-neox-japanese-2.7b""": """https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/vocab.txt""",
    },
    """emoji_file""": {
        """abeja/gpt-neox-japanese-2.7b""": """https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/emoji.json""",
    },
}

lowerCAmelCase						=					{
    """abeja/gpt-neox-japanese-2.7b""": 2_048,
}

def 					lowerCamelCase_ ( __UpperCamelCase					:       str							,    __UpperCamelCase					:       Tuple		)					->	List[str]:







     """simple docstring"""
     with open(__UpperCamelCase							,    'r'							,    encoding='utf-8'		) as f:
          _A				=							json.loads(f.read()		)

     _A				=							collections.OrderedDict()
     _A				=							collections.OrderedDict()
     _A				=							collections.OrderedDict()
     with open(__UpperCamelCase							,    'r'							,    encoding='utf-8'		) as f:
          _A				=							f.readlines()
     _A				=							[[t.rstrip('\n'		)] if (t == ',' or ',' not in t) else t.rstrip('\n'		).split(','		) for t in token]
     for idx, b in enumerate(__UpperCamelCase		):
          _A				=							b
          _A				=							idx
          for wd in b:
               _A				=							idx

     return vocab, raw_vocab, ids_to_tokens, emoji






class        lowerCAmelCase_  (     UpperCAmelCase	):
       __UpperCAmelCase					=VOCAB_FILES_NAMES
       __UpperCAmelCase					=PRETRAINED_VOCAB_FILES_MAP
       __UpperCAmelCase					=PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       __UpperCAmelCase					=['input_ids', 'attention_mask']






       def __init__( self			,     _UpperCamelCase			,     _UpperCamelCase			,     _UpperCamelCase="<|endoftext|>"			,     _UpperCamelCase="<|endoftext|>"			,     _UpperCamelCase="<|startoftext|>"			,     _UpperCamelCase="<|endoftext|>"			,     _UpperCamelCase=False			,     **_UpperCamelCase			,     )->      str:
            super().__init__(
                unk_token=_UpperCamelCase			,     pad_token=_UpperCamelCase			,     bos_token=_UpperCamelCase			,     eos_token=_UpperCamelCase			,     do_clean_text=_UpperCamelCase			,     **_UpperCamelCase			,     )
            if not os.path.isfile(_UpperCamelCase   ):
                 raise ValueError(
                     F'Can\'t find a vocabulary file at path \'{vocab_file}\'. To load the vocabulary from a Google pretrained'
                     ' model use `tokenizer = GPTNeoXJapaneseokenizer.from_pretrained(PRETRAINED_MODEL_NAME)`'   )
            if not os.path.isfile(_UpperCamelCase   ):
                 raise ValueError(
                     F'Can\'t find a emoji file at path \'{emoji_file}\'. To load the emoji information from a Google'
                     ' pretrained model use `tokenizer = GPTNeoXJapaneseokenizer.from_pretrained(PRETRAINED_MODEL_NAME)`'   )
            _A				=							do_clean_text
            _A		,				_A		,				_A		,				_A				=							load_vocab_and_emoji(_UpperCamelCase			,     _UpperCamelCase   )
            _A				=							SubWordJapaneseTokenizer(
                vocab=self.vocab			,     ids_to_tokens=self.ids_to_tokens			,     emoji=self.emoji   )






       @property
       def   UpperCamelCase						( self   )->      Union[str, Any]:
            # self.vocab contains support for character fluctuation unique to Japanese, and has a large number of vocab
            return len(self.raw_vocab   )






       def   UpperCamelCase						( self   )->      Tuple:
            return dict(self.raw_vocab			,     **self.added_tokens_encoder   )






       def   UpperCamelCase						( self			,     _UpperCamelCase   )->      Any:
            return self.subword_tokenizer.tokenize(_UpperCamelCase			,     clean=self.do_clean_text   )






       def   UpperCamelCase						( self			,     _UpperCamelCase   )->      Any:
            return self.vocab.get(_UpperCamelCase			,     self.vocab.get(self.unk_token   )   )






       def   UpperCamelCase						( self			,     _UpperCamelCase   )->      List[str]:
            return self.subword_tokenizer.convert_id_to_token(_UpperCamelCase   )






       def   UpperCamelCase						( self			,     _UpperCamelCase   )->      str:
            _A				=							''.join(_UpperCamelCase   ).strip()
            return out_string






       def   UpperCamelCase						( self			,     _UpperCamelCase   )->      List[int]:
            _A				=							[]
            for is_user, text in conversation.iter_texts():
                 input_ids.extend(self.encode(_UpperCamelCase			,     add_special_tokens=_UpperCamelCase   ) + [self.eos_token_id]   )

            if len(_UpperCamelCase   ) > self.model_max_length:
                 _A				=							input_ids[-self.model_max_length :]
            return input_ids






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase = None   )->      Tuple[str]:
            _A				=							0
            if os.path.isdir(_UpperCamelCase   ):
                 _A				=							os.path.join(
                     _UpperCamelCase			,     (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']   )
                 _A				=							os.path.join(
                     _UpperCamelCase			,     (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['emoji_file']   )
            else:
                 _A				=							(
                     (filename_prefix + '-' if filename_prefix else '') + save_directory + VOCAB_FILES_NAMES['vocab_file']
                 )
                 _A				=							(
                     (filename_prefix + '-' if filename_prefix else '') + save_directory + VOCAB_FILES_NAMES['emoji_file']
                 )
            with open(_UpperCamelCase			,     'w'			,     encoding='utf-8'   ) as writer:
                 for token_index, token in self.ids_to_tokens.items():
                      if index != token_index:
                           logger.warning(
                               F'Saving vocabulary to {vocab_file}: vocabulary indices are not consecutive.'
                               ' Please check that the vocabulary is not corrupted!'   )
                           _A				=							token_index
                      writer.write(','.join(_UpperCamelCase   ) + '\n'   )
                      index += 1
            with open(_UpperCamelCase			,     'w'			,     encoding='utf-8'   ) as writer:
                 json.dump(self.emoji			,     _UpperCamelCase   )
            return vocab_file, emoji_file






class        lowerCAmelCase_  (     UpperCAmelCase	):






       def __init__( self			,     _UpperCamelCase			,     _UpperCamelCase			,     _UpperCamelCase   )->      Dict:
            _A				=							vocab  # same as swe
            _A				=							ids_to_tokens  # same as bpe
            _A				=							emoji
            _A				=							np.max([len(_UpperCamelCase   ) for w in self.vocab.keys()]   )
            _A				=							re.compile(R'(https?|ftp)(:\/\/[-_\.!~*\'()a-zA-Z0-9;\/?:\@&=\+$,%#]+)'   )
            _A				=							re.compile(R'[A-Za-z0-9\._+]*@[\-_0-9A-Za-z]+(\.[A-Za-z]+)*'   )
            _A				=							re.compile(R'[\(]{0,1}[0-9]{2,4}[\)\-\(]{0,1}[0-9]{2,4}[\)\-]{0,1}[0-9]{3,4}'   )
            _A				=							re.compile(
                R'([12]\d{3}[/\-年])*(0?[1-9]|1[0-2])[/\-月]((0?[1-9]|[12][0-9]|3[01])日?)*(\d{1,2}|:|\d{1,2}時|\d{1,2}分|\(日\)|\(月\)|\(火\)|\(水\)|\(木\)|\(金\)|\(土\)|㈰|㈪|㈫|㈬|㈭|㈮|㈯)*'   )
            _A				=							re.compile(
                R'(明治|大正|昭和|平成|令和|㍾|㍽|㍼|㍻|\u32ff)\d{1,2}年(0?[1-9]|1[0-2])月(0?[1-9]|[12][0-9]|3[01])日(\d{1,2}|:|\d{1,2}時|\d{1,2}分|\(日\)|\(月\)|\(火\)|\(水\)|\(木\)|\(金\)|\(土\)|㈰|㈪|㈫|㈬|㈭|㈮|㈯)*'   )
            _A				=							re.compile(
                R'((0|[1-9]\d*|[1-9]\d{0,2}(,\d{3})+)*億)*((0|[1-9]\d*|[1-9]\d{0,2}(,\d{3})+)*万)*((0|[1-9]\d*|[1-9]\d{0,2}(,\d{3})+)*千)*(0|[1-9]\d*|[1-9]\d{0,2}(,\d{3})+)*(千円|万円|千万円|円|千ドル|万ドル|千万ドル|ドル|千ユーロ|万ユーロ|千万ユーロ|ユーロ)+(\(税込\)|\(税抜\)|\+tax)*'   )
            _A				=							'─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳╴╵╶╷╸╹╺╻╼╽╾╿'
            _A				=							'▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟'
            _A				=							str.maketrans({k: '<BLOCK>' for k in keisen + blocks}   )






       def __len__( self   )->      Dict:
            return len(self.ids_to_tokens   )






       def   UpperCamelCase						( self			,     _UpperCamelCase   )->      Optional[Any]:
            _A				=							self.content_repattera.sub('<URL>'			,     _UpperCamelCase   )
            _A				=							self.content_repattera.sub('<EMAIL>'			,     _UpperCamelCase   )
            _A				=							self.content_repattera.sub('<TEL>'			,     _UpperCamelCase   )
            _A				=							self.content_repattera.sub('<DATE>'			,     _UpperCamelCase   )
            _A				=							self.content_repattera.sub('<DATE>'			,     _UpperCamelCase   )
            _A				=							self.content_repattera.sub('<PRICE>'			,     _UpperCamelCase   )
            _A				=							content.translate(self.content_transa   )
            while "<BLOCK><BLOCK>" in content:
                 _A				=							content.replace('<BLOCK><BLOCK>'			,     '<BLOCK>'   )
            return content






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase=False   )->      int:
            _A				=							text.replace(' '			,     '<SP>'   )
            _A				=							text.replace('　'			,     '<SP>'   )
            _A				=							text.replace('\r\n'			,     '<BR>'   )
            _A				=							text.replace('\n'			,     '<BR>'   )
            _A				=							text.replace('\r'			,     '<BR>'   )
            _A				=							text.replace('\t'			,     '<TAB>'   )
            _A				=							text.replace('—'			,     'ー'   )
            _A				=							text.replace('−'			,     'ー'   )
            for k, v in self.emoji["emoji"].items():
                 if k in text:
                      _A				=							text.replace(_UpperCamelCase			,     _UpperCamelCase   )
            if clean:
                 _A				=							self.clean_text(_UpperCamelCase   )

            def check_simbol(_UpperCamelCase   ):
                 _A				=							x.encode()
                 if len(_UpperCamelCase   ) == 1 and len(_UpperCamelCase   ) == 2:
                      _A				=							(int(e[0]   ) << 8) + int(e[1]   )
                      if (
                          (c >= 0Xc_2a1 and c <= 0Xc_2bf)
                          or (c >= 0Xc_780 and c <= 0Xc_783)
                          or (c >= 0Xc_ab9 and c <= 0Xc_bbf)
                          or (c >= 0Xc_c80 and c <= 0Xc_da2)
                      ):
                           return True
                 return False

            def checkuae(_UpperCamelCase   ):
                 _A				=							x.encode()
                 if len(_UpperCamelCase   ) == 1 and len(_UpperCamelCase   ) == 3:
                      _A				=							(int(e[0]   ) << 16) + (int(e[1]   ) << 8) + int(e[2]   )
                      if c >= 0Xe28_080 and c <= 0Xe2b_07f:
                           return True
                 return False

            _A				=							0
            _A				=							[]
            while pos < len(_UpperCamelCase   ):
                 _A				=							min(len(_UpperCamelCase   )			,     pos + self.maxlen + 1   ) if text[pos] == '<' else pos + 3
                 _A				=							[]  # (token_id, token, pos)
                 for e in range(_UpperCamelCase			,     _UpperCamelCase			,     -1   ):
                      _A				=							text[pos:e]
                      if wd in self.vocab:
                           if wd[0] == "<" and len(_UpperCamelCase   ) > 2:
                                _A				=							[(self.vocab[wd], wd, e)]
                                break
                           else:
                                candidates.append((self.vocab[wd], wd, e)   )
                 if len(_UpperCamelCase   ) > 0:
                      # the smallest token_id is adopted
                      _A		,				_A		,				_A				=							sorted(_UpperCamelCase			,     key=lambda _UpperCamelCase   : x[0]   )[0]
                      result.append(_UpperCamelCase   )
                      _A				=							e
                 else:
                      _A				=							pos + 1
                      _A				=							text[pos:end]
                      if check_simbol(_UpperCamelCase   ):
                           result.append('<KIGOU>'   )
                      elif checkuae(_UpperCamelCase   ):
                           result.append('<U2000U2BFF>'   )
                      else:
                           for i in wd.encode('utf-8'   ):
                                result.append('<|byte%d|>' % i   )
                      _A				=							end
            return result






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase="\n"   )->      Optional[Any]:
            _A				=							[]
            _A				=							[]
            _A				=							self.ids_to_tokens[index][0]
            if word[:6] == "<|byte" and word[-2:] == "|>":
                 byte_tokens.append(int(word[6:-2]   )   )
            else:
                 if len(_UpperCamelCase   ) > 0:
                      words.append(bytearray(_UpperCamelCase   ).decode('utf-8'			,     errors='replace'   )   )
                      _A				=							[]
                 if word[:7] == "<|emoji" and word[-2:] == "|>":
                      words.append(self.emoji['emoji_inv'][word]   )
                 elif word == "<SP>":
                      words.append(' '   )
                 elif word == "<BR>":
                      words.append(_UpperCamelCase   )
                 elif word == "<TAB>":
                      words.append('\t'   )
                 elif word == "<BLOCK>":
                      words.append('▀'   )
                 elif word == "<KIGOU>":
                      words.append('ǀ'   )
                 elif word == "<U2000U2BFF>":
                      words.append('‖'   )
                 else:
                      words.append(_UpperCamelCase   )
            if len(_UpperCamelCase   ) > 0:
                 words.append(bytearray(_UpperCamelCase   ).decode('utf-8'			,     errors='replace'   )   )
            _A				=							''.join(_UpperCamelCase   )
            return text









'''simple docstring'''
def 					lowerCamelCase_ ( __UpperCamelCase					:       int							,    __UpperCamelCase					:       int		)					->	int:







     """simple docstring"""
     while second != 0:
          _A				=							first & second
          first ^= second
          _A				=							c << 1
     return first


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    lowerCAmelCase						=					int(input("""Enter the first number: """).strip())
    lowerCAmelCase						=					int(input("""Enter the second number: """).strip())
    print(F'{add(first, second) = }')





