




'''simple docstring'''






import unittest

from transformers import DebertaVaTokenizer, DebertaVaTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


A_			      =		get_tests_dir("fixtures/spiece.model")






@require_sentencepiece
@require_tokenizers
class        lowercase_      (						lowerCAmelCase_						,       unittest.TestCase							):
     A_											=			DebertaVaTokenizer
     A_											=			DebertaVaTokenizerFast
     A_											=			True
     A_											=			True





     def 			_lowerCAmelCase      (     self     :					List[str]			):
           super().setUp()

           # We have a SentencePiece fixture for testing
           snake_case__       :   Optional[Any]	      =    DebertaVaTokenizer(__lowerCamelCase     ,							unk_token='<unk>'			)
           tokenizer.save_pretrained(self.tmpdirname			)





     def 			_lowerCAmelCase      (     self     :					Tuple     ,							__lowerCamelCase     :					Dict			):
           snake_case__       :   Tuple	      =    'this is a test'
           snake_case__       :   Optional[Any]	      =    'this is a test'
           return input_text, output_text





     def 			_lowerCAmelCase      (     self     :					Optional[int]			):
           snake_case__       :   int	      =    '<pad>'
           snake_case__       :   Optional[Any]	      =    0

           self.assertEqual(self.get_tokenizer()._convert_token_to_id(__lowerCamelCase			)     ,							__lowerCamelCase			)
           self.assertEqual(self.get_tokenizer()._convert_id_to_token(__lowerCamelCase			)     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					Optional[int]			):
           snake_case__       :   Any	      =    list(self.get_tokenizer().get_vocab().keys()			)
           self.assertEqual(vocab_keys[0]     ,							'<pad>'			)
           self.assertEqual(vocab_keys[1]     ,							'<unk>'			)
           self.assertEqual(vocab_keys[-1]     ,							'[PAD]'			)
           self.assertEqual(len(__lowerCamelCase			)     ,							30001			)





     def 			_lowerCAmelCase      (     self     :					Optional[Any]			):
           self.assertEqual(self.get_tokenizer().vocab_size     ,							30000			)





     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           # fmt: off
           snake_case__       :   List[Any]	      =    ' \tHeLLo!how  \n Are yoU?  '
           snake_case__       :   str	      =    ['▁hello', '!', 'how', '▁are', '▁you', '?']
           # fmt: on

           snake_case__       :   str	      =    DebertaVaTokenizer(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase			)
           snake_case__       :   Any	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Optional[int]	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase			)
           snake_case__       :   Optional[int]	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     @unittest.skip('There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.'			)
     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           pass





     @unittest.skip('There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.'			)
     def 			_lowerCAmelCase      (     self     :					str			):
           pass





     def 			_lowerCAmelCase      (     self     :					List[str]			):
           # fmt: off
           snake_case__       :   int	      =    'I was born in 92000, and this is falsé.'
           snake_case__       :   Optional[Any]	      =    ['▁', '<unk>', '▁was', '▁born', '▁in', '▁9', '2000', '▁', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '▁', '.', ]
           # fmt: on

           snake_case__       :   str	      =    DebertaVaTokenizer(__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   List[str]	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Any	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Optional[int]	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					Any			):
           # fmt: off
           snake_case__       :   Dict	      =    'I was born in 92000, and this is falsé.'
           snake_case__       :   Optional[Any]	      =    ['▁i', '▁was', '▁born', '▁in', '▁9', '2000', '▁', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '▁', '.', ]
           # fmt: on

           snake_case__       :   Union[str, Any]	      =    DebertaVaTokenizer(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Optional[Any]	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Optional[int]	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Tuple	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					Optional[int]			):
           # fmt: off
           snake_case__       :   Dict	      =    'I was born in 92000, and this is falsé.'
           snake_case__       :   Union[str, Any]	      =    ['▁i', '▁was', '▁born', '▁in', '▁9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '.', ]
           # fmt: on

           snake_case__       :   Union[str, Any]	      =    DebertaVaTokenizer(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Union[str, Any]	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Optional[Any]	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Union[str, Any]	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					Any			):
           # fmt: off
           snake_case__       :   Optional[Any]	      =    'I was born in 92000, and this is falsé.'
           snake_case__       :   int	      =    ['▁', '<unk>', '▁was', '▁born', '▁in', '▁9', '2000', '▁', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '▁', '.', ]
           # fmt: on

           snake_case__       :   Union[str, Any]	      =    DebertaVaTokenizer(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Any	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Union[str, Any]	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Tuple	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           # fmt: off
           snake_case__       :   List[str]	      =    ' \tHeLLo!how  \n Are yoU?  '
           snake_case__       :   Union[str, Any]	      =    ['▁', '<unk>', 'e', '<unk>', 'o', '!', 'how', '▁', '<unk>', 're', '▁yo', '<unk>', '?']
           # fmt: on

           snake_case__       :   str	      =    DebertaVaTokenizer(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Optional[int]	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Union[str, Any]	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							do_lower_case=__lowerCamelCase     ,							split_by_punct=__lowerCamelCase			)
           snake_case__       :   Any	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)

           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					str			):
           snake_case__       :   Any	      =    self.get_tokenizer()
           snake_case__       :   Optional[int]	      =    self.get_rust_tokenizer()

           snake_case__       :   Optional[Any]	      =    'I was born in 92000, and this is falsé.'

           snake_case__       :   Union[str, Any]	      =    tokenizer.convert_ids_to_tokens(tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)
           snake_case__       :   Dict	      =    rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   List[str]	      =    tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)
           snake_case__       :   Optional[Any]	      =    rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   Optional[int]	      =    self.get_rust_tokenizer()
           snake_case__       :   Union[str, Any]	      =    tokenizer.encode(__lowerCamelCase			)
           snake_case__       :   Dict	      =    rust_tokenizer.encode(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					Any			):
           snake_case__       :   Dict	      =    'This is a test'
           snake_case__       :   str	      =    [13, 1, 4398, 25, 21, 1289]
           snake_case__       :   Union[str, Any]	      =    ['▁', 'T', 'his', '▁is', '▁a', '▁test']
           snake_case__       :   Any	      =    ['▁', '<unk>', 'his', '▁is', '▁a', '▁test']

           snake_case__       :   Union[str, Any]	      =    DebertaVaTokenizer(__lowerCamelCase     ,							keep_accents=__lowerCamelCase			)
           snake_case__       :   List[Any]	      =    DebertaVaTokenizerFast(__lowerCamelCase     ,							keep_accents=__lowerCamelCase			)

           snake_case__       :   Dict	      =    tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   str	      =    tokenizer.tokenize(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   List[str]	      =    tokenizer.convert_ids_to_tokens(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   List[str]	      =    rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   str	      =    rust_tokenizer.tokenize(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   List[Any]	      =    rust_tokenizer.convert_ids_to_tokens(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           # fmt: off
           snake_case__       :   List[Any]	      =    'I was born in 92000, and this is falsé.'
           snake_case__       :   Optional[Any]	      =    [13, 1, 23, 386, 19, 561, 3050, 15, 17, 48, 25, 8256, 18, 1, 9]
           snake_case__       :   str	      =    ['▁', 'I', '▁was', '▁born', '▁in', '▁9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', 'é', '.', ]
           snake_case__       :   Any	      =    ['▁', '<unk>', '▁was', '▁born', '▁in', '▁9', '2000', ',', '▁and', '▁this', '▁is', '▁fal', 's', '<unk>', '.', ]
           # fmt: on

           snake_case__       :   int	      =    tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   Dict	      =    tokenizer.tokenize(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   Dict	      =    tokenizer.convert_ids_to_tokens(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)

           snake_case__       :   str	      =    rust_tokenizer.encode(__lowerCamelCase     ,							add_special_tokens=__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   Optional[Any]	      =    rust_tokenizer.tokenize(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)
           snake_case__       :   Union[str, Any]	      =    rust_tokenizer.convert_ids_to_tokens(__lowerCamelCase			)
           self.assertListEqual(__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					int			):
           snake_case__       :   List[str]	      =    DebertaVaTokenizer(__lowerCamelCase			)

           snake_case__       :   Dict	      =    tokenizer.encode('sequence builders'			)
           snake_case__       :   Any	      =    tokenizer.encode('multi-sequence build'			)

           snake_case__       :   List[Any]	      =    tokenizer.build_inputs_with_special_tokens(__lowerCamelCase			)
           snake_case__       :   List[str]	      =    tokenizer.build_inputs_with_special_tokens(__lowerCamelCase     ,							__lowerCamelCase			)

           self.assertEqual([tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]     ,							__lowerCamelCase			)
           self.assertEqual(
               [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [tokenizer.sep_token_id]     ,							__lowerCamelCase     ,							)





     @slow
     def 			_lowerCAmelCase      (     self     :					Union[str, Any]			):
           # fmt: off
           snake_case__       :   List[str]	      =    {'input_ids': [[1, 39867, 36, 19390, 486, 27, 35052, 81436, 18, 60685, 1225, 7, 35052, 81436, 18, 9367, 16899, 18, 15937, 53, 594, 773, 18, 16287, 30465, 36, 15937, 6, 41139, 38, 36979, 60763, 191, 6, 34132, 99, 6, 50538, 390, 43230, 6, 34132, 2779, 20850, 14, 699, 1072, 1194, 36, 382, 10901, 53, 7, 699, 1072, 2084, 36, 20422, 630, 53, 19, 105, 3049, 1896, 1053, 16899, 1506, 11, 37978, 4243, 7, 1237, 31869, 200, 16566, 654, 6, 35052, 81436, 7, 55630, 13593, 4, 2], [1, 26, 15011, 13, 667, 8, 1053, 18, 23611, 1237, 72356, 12820, 34, 104134, 1209, 35, 13313, 6627, 21, 202, 347, 7, 164, 2399, 11, 46, 4485, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 5, 1232, 2864, 15785, 14951, 105, 5, 8581, 1250, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], 'token_type_ids': [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], 'attention_mask': [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}  # noqa: E501
           # fmt: on

           self.tokenizer_integration_test_util(
               expected_encoding=__lowerCamelCase     ,							model_name='microsoft/deberta-v2-xlarge'     ,							revision='ad6e42c1532ddf3a15c39246b63f5559d558b670'     ,							)






'''simple docstring'''






# This code is adapted from OpenAI's release
# https://github.com/openai/human-eval/blob/master/human_eval/execution.py

import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   Dict:
      snake_case__       :   int	      =    multiprocessing.Manager()
      snake_case__       :   Any	      =    manager.list()

      snake_case__       :   List[str]	      =    multiprocessing.Process(target=__SCREAMING_SNAKE_CASE				,      args=(check_program, result, timeout)		)
      p.start()
      p.join(timeout=timeout + 1		)
      if p.is_alive():
            p.kill()

      if not result:
            result.append('timed out'		)

      return {
          "task_id": task_id,
          "passed": result[0] == "passed",
          "result": result[0],
          "completion_id": completion_id,
      }






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   Tuple:
      with create_tempdir():
            # These system calls are needed when cleaning up tempdir.
            import os
            import shutil

            snake_case__       :   List[Any]	      =    shutil.rmtree
            snake_case__       :   Tuple	      =    os.rmdir
            snake_case__       :   Any	      =    os.chdir

            # Disable functionalities that can make destructive changes to the test.
            reliability_guard()

            # Run program.
            try:
                  snake_case__       :   Union[str, Any]	      =    {}
                  with swallow_io():
                        with time_limit(__SCREAMING_SNAKE_CASE		):
                              exec(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)
                  result.append('passed'		)
            except TimeoutException:
                  result.append('timed out'		)
            except BaseException as e:
                  result.append(f"failed: {e}"		)

            # Needed for cleaning up.
            snake_case__       :   List[Any]	      =    rmtree
            snake_case__       :   Optional[int]	      =    rmdir
            snake_case__       :   Dict	      =    chdir






@contextlib.contextmanager
def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   List[str]:
      def signal_handler(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		):
            raise TimeoutException('Timed out!'		)

      signal.setitimer(signal.ITIMER_REAL				,      __SCREAMING_SNAKE_CASE		)
      signal.signal(signal.SIGALRM				,      __SCREAMING_SNAKE_CASE		)
      try:
            yield
      finally:
            signal.setitimer(signal.ITIMER_REAL				,      0		)






@contextlib.contextmanager
def 		UpperCamelCase__      (		)    ->   List[str]:
      snake_case__       :   Dict	      =    WriteOnlyStringIO()
      with contextlib.redirect_stdout(__SCREAMING_SNAKE_CASE		):
            with contextlib.redirect_stderr(__SCREAMING_SNAKE_CASE		):
                  with redirect_stdin(__SCREAMING_SNAKE_CASE		):
                        yield






@contextlib.contextmanager
def 		UpperCamelCase__      (		)    ->   Optional[int]:
      with tempfile.TemporaryDirectory() as dirname:
            with chdir(__SCREAMING_SNAKE_CASE		):
                  yield dirname






class        lowercase_      (						lowerCAmelCase_							):
     pass






class        lowercase_      (						io.StringIO							):





     def 			_lowerCAmelCase      (     self     :					Optional[Any]     ,							*__lowerCamelCase     :					int     ,							**__lowerCamelCase     :					Optional[int]			):
           raise OSError





     def 			_lowerCAmelCase      (     self     :					int     ,							*__lowerCamelCase     :					List[Any]     ,							**__lowerCamelCase     :					Tuple			):
           raise OSError





     def 			_lowerCAmelCase      (     self     :					Any     ,							*__lowerCamelCase     :					int     ,							**__lowerCamelCase     :					Union[str, Any]			):
           raise OSError





     def 			_lowerCAmelCase      (     self     :					Tuple     ,							*__lowerCamelCase     :					List[str]     ,							**__lowerCamelCase     :					Optional[Any]			):
           return False






class        lowercase_      (						contextlib._RedirectStream							):  # type: ignore
     A_											=			"stdin"






@contextlib.contextmanager
def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   List[str]:
      if root == ".":
            yield
            return
      snake_case__       :   str	      =    os.getcwd()
      os.chdir(__SCREAMING_SNAKE_CASE		)
      try:
            yield
      except BaseException as exc:
            raise exc
      finally:
            os.chdir(__SCREAMING_SNAKE_CASE		)






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE=None		)    ->   Any:

      if maximum_memory_bytes is not None:
            import resource

            resource.setrlimit(resource.RLIMIT_AS				,      (maximum_memory_bytes, maximum_memory_bytes)		)
            resource.setrlimit(resource.RLIMIT_DATA				,      (maximum_memory_bytes, maximum_memory_bytes)		)
            if not platform.uname().system == "Darwin":
                  resource.setrlimit(resource.RLIMIT_STACK				,      (maximum_memory_bytes, maximum_memory_bytes)		)

      faulthandler.disable()

      import builtins

      snake_case__       :   List[Any]	      =    None
      snake_case__       :   List[str]	      =    None

      import os

      snake_case__       :   List[Any]	      =    '1'

      snake_case__       :   Union[str, Any]	      =    None
      snake_case__       :   Tuple	      =    None
      snake_case__       :   Dict	      =    None
      snake_case__       :   Tuple	      =    None
      snake_case__       :   List[str]	      =    None
      snake_case__       :   Any	      =    None
      snake_case__       :   Optional[Any]	      =    None
      snake_case__       :   Union[str, Any]	      =    None
      snake_case__       :   int	      =    None
      snake_case__       :   Optional[int]	      =    None
      snake_case__       :   Union[str, Any]	      =    None
      snake_case__       :   List[Any]	      =    None
      snake_case__       :   Optional[int]	      =    None
      snake_case__       :   Union[str, Any]	      =    None
      snake_case__       :   Tuple	      =    None
      snake_case__       :   int	      =    None
      snake_case__       :   Optional[Any]	      =    None
      snake_case__       :   Optional[int]	      =    None
      snake_case__       :   List[str]	      =    None
      snake_case__       :   List[str]	      =    None
      snake_case__       :   List[str]	      =    None
      snake_case__       :   Dict	      =    None
      snake_case__       :   Optional[Any]	      =    None
      snake_case__       :   List[Any]	      =    None
      snake_case__       :   Tuple	      =    None
      snake_case__       :   Optional[int]	      =    None
      snake_case__       :   int	      =    None

      import shutil

      snake_case__       :   List[str]	      =    None
      snake_case__       :   List[Any]	      =    None
      snake_case__       :   List[Any]	      =    None

      import subprocess

      snake_case__       :   int	      =    None  # type: ignore

      snake_case__       :   Dict	      =    None

      import sys

      snake_case__       :   Tuple	      =    None
      snake_case__       :   Tuple	      =    None
      snake_case__       :   List[str]	      =    None
      snake_case__       :   Optional[int]	      =    None
      snake_case__       :   List[Any]	      =    None
