



"""simple docstring"""






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


def     _lowercase       (						__snake_case      ,__snake_case      ,__snake_case      ,__snake_case			)		->     Dict:
			__lowerCAmelCase   :						Dict				= multiprocessing.Manager()
			__lowerCAmelCase   :						Tuple				= manager.list()

			__lowerCAmelCase   :						List[str]				= multiprocessing.Process(target=__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     _lowercase       (						__snake_case      ,__snake_case      ,__snake_case			)		->     Optional[Any]:
			with create_tempdir():
						# These system calls are needed when cleaning up tempdir.
						import os
						import shutil

						__lowerCAmelCase   :						List[str]				= shutil.rmtree
						__lowerCAmelCase   :						Dict				= os.rmdir
						__lowerCAmelCase   :						List[Any]				= os.chdir

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

						# Run program.
						try:
									__lowerCAmelCase   :						int				= {}
									with swallow_io():
												with time_limit(__snake_case			):
															exec(__snake_case      ,__snake_case			)
									result.append("passed"			)
						except TimeoutException:
									result.append("timed out"			)
						except BaseException as e:
									result.append(F"""failed: {e}"""			)

						# Needed for cleaning up.
						__lowerCAmelCase   :						str				= rmtree
						__lowerCAmelCase   :						str				= rmdir
						__lowerCAmelCase   :						List[Any]				= chdir


@contextlib.contextmanager
def     _lowercase       (						__snake_case			)		->     Tuple:
			def signal_handler(__snake_case      ,__snake_case			):
						raise TimeoutException("Timed out!"			)

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


@contextlib.contextmanager
def     _lowercase       (						)		->     Tuple:
			__lowerCAmelCase   :						Union[str, Any]				= WriteOnlyStringIO()
			with contextlib.redirect_stdout(__snake_case			):
						with contextlib.redirect_stderr(__snake_case			):
									with redirect_stdin(__snake_case			):
												yield


@contextlib.contextmanager
def     _lowercase       (						)		->     List[str]:
			with tempfile.TemporaryDirectory() as dirname:
						with chdir(__snake_case			):
									yield dirname



class     A__     (						_UpperCAmelCase							):




	'''simple docstring'''





	pass






class     A__     (						io.StringIO							):




	'''simple docstring'''





	def 							_SCREAMING_SNAKE_CASE     (  self:	int ,    *_SCREAMING_SNAKE_CASE:	List[Any] ,    **_SCREAMING_SNAKE_CASE:	Tuple)       -> str:

				"""simple docstring"""

				raise OSError

	def 							_SCREAMING_SNAKE_CASE     (  self:	Dict ,    *_SCREAMING_SNAKE_CASE:	Dict ,    **_SCREAMING_SNAKE_CASE:	Optional[Any])       -> int:

				"""simple docstring"""

				raise OSError

	def 							_SCREAMING_SNAKE_CASE     (  self:	List[str] ,    *_SCREAMING_SNAKE_CASE:	str ,    **_SCREAMING_SNAKE_CASE:	Any)       -> List[Any]:

				"""simple docstring"""

				raise OSError







	def 							_SCREAMING_SNAKE_CASE     (  self:	Optional[Any] ,    *_SCREAMING_SNAKE_CASE:	List[str] ,    **_SCREAMING_SNAKE_CASE:	Optional[int])       -> Tuple:

				"""simple docstring"""

				return False






class     A__     (						contextlib._RedirectStream							):  # type: ignore




	'''simple docstring'''





	SCREAMING_SNAKE_CASE					   =			'''stdin'''






@contextlib.contextmanager
def     _lowercase       (						__snake_case			)		->     Any:
			if root == ".":
						yield
						return
			__lowerCAmelCase   :						List[Any]				= os.getcwd()
			os.chdir(__snake_case			)
			try:
						yield
			except BaseException as exc:
						raise exc
			finally:
						os.chdir(__snake_case			)





def     _lowercase       (						__snake_case=None			)		->     Optional[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

			__lowerCAmelCase   :						List[Any]				= None
			__lowerCAmelCase   :						int				= None

			import os

			__lowerCAmelCase   :						Union[str, Any]				= "1"

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

			import shutil

			__lowerCAmelCase   :						Optional[int]				= None
			__lowerCAmelCase   :						Tuple				= None
			__lowerCAmelCase   :						str				= None

			import subprocess

			__lowerCAmelCase   :						Any				= None  # type: ignore

			__lowerCAmelCase   :						Optional[int]				= None

			import sys

			__lowerCAmelCase   :						Any				= None
			__lowerCAmelCase   :						List[str]				= None
			__lowerCAmelCase   :						Tuple				= None
			__lowerCAmelCase   :						Tuple				= None
			__lowerCAmelCase   :						List[Any]				= None




"""simple docstring"""






import logging

from transformers.configuration_utils import PretrainedConfig


__snake_case							:     Tuple   =					logging.getLogger(__name__)



class     A__     (						__SCREAMING_SNAKE_CASE							):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE					   =			'masked_bert'

	def __init__(  self:	str ,    _SCREAMING_SNAKE_CASE:	Tuple=3_0522 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=768 ,    _SCREAMING_SNAKE_CASE:	List[str]=12 ,    _SCREAMING_SNAKE_CASE:	Any=12 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=3072 ,    _SCREAMING_SNAKE_CASE:	List[str]="gelu" ,    _SCREAMING_SNAKE_CASE:	List[str]=0.1 ,    _SCREAMING_SNAKE_CASE:	str=0.1 ,    _SCREAMING_SNAKE_CASE:	Dict=512 ,    _SCREAMING_SNAKE_CASE:	List[Any]=2 ,    _SCREAMING_SNAKE_CASE:	Tuple=0.02 ,    _SCREAMING_SNAKE_CASE:	int=1e-12 ,    _SCREAMING_SNAKE_CASE:	int=0 ,    _SCREAMING_SNAKE_CASE:	Tuple="topK" ,    _SCREAMING_SNAKE_CASE:	Any="constant" ,    _SCREAMING_SNAKE_CASE:	int=0.0 ,    **_SCREAMING_SNAKE_CASE:	Any ,    )       -> List[str]:

				"""simple docstring"""

				super().__init__(pad_token_id=_SCREAMING_SNAKE_CASE ,    **_SCREAMING_SNAKE_CASE)

				__lowerCAmelCase   :						Union[str, Any]				= vocab_size
				__lowerCAmelCase   :						List[str]				= hidden_size
				__lowerCAmelCase   :						Any				= num_hidden_layers
				__lowerCAmelCase   :						Dict				= num_attention_heads
				__lowerCAmelCase   :						Union[str, Any]				= hidden_act
				__lowerCAmelCase   :						Optional[Any]				= intermediate_size
				__lowerCAmelCase   :						int				= hidden_dropout_prob
				__lowerCAmelCase   :						List[Any]				= attention_probs_dropout_prob
				__lowerCAmelCase   :						int				= max_position_embeddings
				__lowerCAmelCase   :						str				= type_vocab_size
				__lowerCAmelCase   :						Any				= initializer_range
				__lowerCAmelCase   :						Optional[int]				= layer_norm_eps
				__lowerCAmelCase   :						Tuple				= pruning_method
				__lowerCAmelCase   :						Union[str, Any]				= mask_init
				__lowerCAmelCase   :						str				= mask_scale