




import unittest

from transformers import FunnelConfig, FunnelTokenizer, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
				import torch

				from transformers import (
				    MODEL_FOR_PRETRAINING_MAPPING,
				    FunnelBaseModel,
				    FunnelForMaskedLM,
				    FunnelForMultipleChoice,
				    FunnelForPreTraining,
				    FunnelForQuestionAnswering,
				    FunnelForSequenceClassification,
				    FunnelForTokenClassification,
				    FunnelModel,
				)






class    __lowerCAmelCase			:







						def __init__(	self   :      Optional[Any]   ,   snake_case__   :      Optional[int]   ,   snake_case__   :      Tuple=13   ,   snake_case__   :      Any=7   ,   snake_case__   :      List[Any]=True   ,   snake_case__   :      Optional[int]=True   ,   snake_case__   :      List[str]=True   ,   snake_case__   :      Dict=True   ,   snake_case__   :      Dict=99   ,   snake_case__   :      int=[1, 1, 2]   ,   snake_case__   :      Optional[int]=1   ,   snake_case__   :      Optional[int]=32   ,   snake_case__   :      List[str]=4   ,   snake_case__   :      List[Any]=8   ,   snake_case__   :      List[Any]=37   ,   snake_case__   :      Any="gelu_new"   ,   snake_case__   :      Optional[Any]=0.1   ,   snake_case__   :      Tuple=0.1   ,   snake_case__   :      Optional[int]=0.0   ,   snake_case__   :      Any=512   ,   snake_case__   :      Union[str, Any]=3   ,   snake_case__   :      Tuple=0.02   ,   snake_case__   :      Union[str, Any]=3   ,   snake_case__   :      Optional[int]=4   ,   snake_case__   :      Union[str, Any]=None   ,   snake_case__   :      List[str]=False   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					parent
												_UpperCAmelCase													=					batch_size
												_UpperCAmelCase													=					seq_length
												_UpperCAmelCase													=					is_training
												_UpperCAmelCase													=					use_input_mask
												_UpperCAmelCase													=					use_token_type_ids
												_UpperCAmelCase													=					use_labels
												_UpperCAmelCase													=					vocab_size
												_UpperCAmelCase													=					block_sizes
												_UpperCAmelCase													=					num_decoder_layers
												_UpperCAmelCase													=					d_model
												_UpperCAmelCase													=					n_head
												_UpperCAmelCase													=					d_head
												_UpperCAmelCase													=					d_inner
												_UpperCAmelCase													=					hidden_act
												_UpperCAmelCase													=					hidden_dropout
												_UpperCAmelCase													=					attention_dropout
												_UpperCAmelCase													=					activation_dropout
												_UpperCAmelCase													=					max_position_embeddings
												_UpperCAmelCase													=					type_vocab_size
												_UpperCAmelCase													=					2
												_UpperCAmelCase													=					num_labels
												_UpperCAmelCase													=					num_choices
												_UpperCAmelCase													=					scope
												_UpperCAmelCase													=					initializer_std

												# Used in the tests to check the size of the first attention layer
												_UpperCAmelCase													=					n_head
												# Used in the tests to check the size of the first hidden state
												_UpperCAmelCase													=					self.d_model
												# Used in the tests to check the number of output hidden states/attentions
												_UpperCAmelCase													=					sum(self.block_sizes				) + (0 if base else self.num_decoder_layers)
												# FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
												# the last hidden state of the first block (which is the first hidden state of the decoder).
												if not base:
																		_UpperCAmelCase													=					self.num_hidden_layers + 2







						def UpperCamelCase      (	self   :      Union[str, Any]				):




												"""simple docstring"""


												_UpperCAmelCase													=					ids_tensor([self.batch_size, self.seq_length]   ,   self.vocab_size				)

												_UpperCAmelCase													=					None
												if self.use_input_mask:
																		_UpperCAmelCase													=					ids_tensor([self.batch_size, self.seq_length]   ,   vocab_size=2				)

												_UpperCAmelCase													=					None
												if self.use_token_type_ids:
																		_UpperCAmelCase													=					ids_tensor([self.batch_size, self.seq_length]   ,   self.type_vocab_size				)

												_UpperCAmelCase													=					None
												_UpperCAmelCase													=					None
												_UpperCAmelCase													=					None
												if self.use_labels:
																		_UpperCAmelCase													=					ids_tensor([self.batch_size]   ,   self.type_sequence_label_size				)
																		_UpperCAmelCase													=					ids_tensor([self.batch_size, self.seq_length]   ,   self.num_labels				)
																		_UpperCAmelCase													=					ids_tensor([self.batch_size]   ,   self.num_choices				)
																		_UpperCAmelCase													=					ids_tensor([self.batch_size, self.seq_length]   ,   1				)

												_UpperCAmelCase													=					self.get_config()

												return (
												    config,
												    input_ids,
												    token_type_ids,
												    input_mask,
												    sequence_labels,
												    token_labels,
												    choice_labels,
												    fake_token_labels,
												)







						def UpperCamelCase      (	self   :      Tuple				):




												"""simple docstring"""


												return FunnelConfig(
												    vocab_size=self.vocab_size   ,   block_sizes=self.block_sizes   ,   num_decoder_layers=self.num_decoder_layers   ,   d_model=self.d_model   ,   n_head=self.n_head   ,   d_head=self.d_head   ,   d_inner=self.d_inner   ,   hidden_act=self.hidden_act   ,   hidden_dropout=self.hidden_dropout   ,   attention_dropout=self.attention_dropout   ,   activation_dropout=self.activation_dropout   ,   max_position_embeddings=self.max_position_embeddings   ,   type_vocab_size=self.type_vocab_size   ,   initializer_std=self.initializer_std   ,   )







						def UpperCamelCase      (	self   :      Union[str, Any]   ,   snake_case__   :      List[Any]   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      List[str]   ,   snake_case__   :      List[Any]   ,   snake_case__   :      Any   ,   snake_case__   :      str   ,   snake_case__   :      Any   ,   snake_case__   :      List[str]   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelModel(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase				)
												_UpperCAmelCase													=					model(__lowercase   ,   token_type_ids=__lowercase				)
												_UpperCAmelCase													=					model(__lowercase				)
												self.parent.assertEqual(result.last_hidden_state.shape   ,   (self.batch_size, self.seq_length, self.d_model)				)

												_UpperCAmelCase													=					False
												_UpperCAmelCase													=					model(__lowercase				)
												self.parent.assertEqual(result.last_hidden_state.shape   ,   (self.batch_size, self.seq_length, self.d_model)				)

												_UpperCAmelCase													=					False
												_UpperCAmelCase													=					model(__lowercase				)
												self.parent.assertEqual(result.last_hidden_state.shape   ,   (self.batch_size, self.seq_length, self.d_model)				)







						def UpperCamelCase      (	self   :      Union[str, Any]   ,   snake_case__   :      List[str]   ,   snake_case__   :      str   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Any   ,   snake_case__   :      int   ,   snake_case__   :      List[str]   ,   snake_case__   :      str   ,   snake_case__   :      str   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelBaseModel(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase				)
												_UpperCAmelCase													=					model(__lowercase   ,   token_type_ids=__lowercase				)
												_UpperCAmelCase													=					model(__lowercase				)
												self.parent.assertEqual(result.last_hidden_state.shape   ,   (self.batch_size, 2, self.d_model)				)

												_UpperCAmelCase													=					False
												_UpperCAmelCase													=					model(__lowercase				)
												self.parent.assertEqual(result.last_hidden_state.shape   ,   (self.batch_size, 3, self.d_model)				)

												_UpperCAmelCase													=					False
												_UpperCAmelCase													=					model(__lowercase				)
												self.parent.assertEqual(result.last_hidden_state.shape   ,   (self.batch_size, 2, self.d_model)				)







						def UpperCamelCase      (	self   :      List[Any]   ,   snake_case__   :      Any   ,   snake_case__   :      List[str]   ,   snake_case__   :      str   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      Optional[Any]   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					self.num_labels
												_UpperCAmelCase													=					FunnelForPreTraining(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase   ,   labels=__lowercase				)
												self.parent.assertEqual(result.logits.shape   ,   (self.batch_size, self.seq_length)				)







						def UpperCamelCase      (	self   :      Optional[Any]   ,   snake_case__   :      str   ,   snake_case__   :      List[str]   ,   snake_case__   :      Any   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      int   ,   snake_case__   :      Dict   ,   snake_case__   :      Dict   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelForMaskedLM(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase   ,   labels=__lowercase				)
												self.parent.assertEqual(result.logits.shape   ,   (self.batch_size, self.seq_length, self.vocab_size)				)







						def UpperCamelCase      (	self   :      Any   ,   snake_case__   :      Dict   ,   snake_case__   :      List[Any]   ,   snake_case__   :      Any   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Dict   ,   snake_case__   :      Any   ,   snake_case__   :      List[str]   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					self.num_labels
												_UpperCAmelCase													=					FunnelForSequenceClassification(__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase   ,   labels=__lowercase				)
												self.parent.assertEqual(result.logits.shape   ,   (self.batch_size, self.num_labels)				)







						def UpperCamelCase      (	self   :      Union[str, Any]   ,   snake_case__   :      str   ,   snake_case__   :      Dict   ,   snake_case__   :      Dict   ,   snake_case__   :      Dict   ,   snake_case__   :      List[str]   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Dict   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					self.num_choices
												_UpperCAmelCase													=					FunnelForMultipleChoice(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					input_ids.unsqueeze(1				).expand(-1   ,   self.num_choices   ,   -1				).contiguous()
												_UpperCAmelCase													=					token_type_ids.unsqueeze(1				).expand(-1   ,   self.num_choices   ,   -1				).contiguous()
												_UpperCAmelCase													=					input_mask.unsqueeze(1				).expand(-1   ,   self.num_choices   ,   -1				).contiguous()
												_UpperCAmelCase													=					model(
												    __lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase   ,   labels=__lowercase   ,   )
												self.parent.assertEqual(result.logits.shape   ,   (self.batch_size, self.num_choices)				)







						def UpperCamelCase      (	self   :      Tuple   ,   snake_case__   :      Optional[int]   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      int   ,   snake_case__   :      Dict   ,   snake_case__   :      List[str]   ,   snake_case__   :      Tuple   ,   snake_case__   :      List[str]   ,   snake_case__   :      List[Any]   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					self.num_labels
												_UpperCAmelCase													=					FunnelForTokenClassification(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase   ,   labels=__lowercase				)
												self.parent.assertEqual(result.logits.shape   ,   (self.batch_size, self.seq_length, self.num_labels)				)







						def UpperCamelCase      (	self   :      Optional[Any]   ,   snake_case__   :      Any   ,   snake_case__   :      List[Any]   ,   snake_case__   :      List[Any]   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Dict   ,   snake_case__   :      Union[str, Any]   ,   snake_case__   :      Optional[int]   ,   snake_case__   :      Optional[int]   ,   ):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelForQuestionAnswering(config=__lowercase				)
												model.to(__lowercase				)
												model.eval()
												_UpperCAmelCase													=					model(
												    __lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase   ,   start_positions=__lowercase   ,   end_positions=__lowercase   ,   )
												self.parent.assertEqual(result.start_logits.shape   ,   (self.batch_size, self.seq_length)				)
												self.parent.assertEqual(result.end_logits.shape   ,   (self.batch_size, self.seq_length)				)







						def UpperCamelCase      (	self   :      int				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.prepare_config_and_inputs()
												(
												    (
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,			(
												    _UpperCAmelCase				
												)							,							
												)													=					config_and_inputs
												_UpperCAmelCase													=					{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
												return config, inputs_dict






@require_torch
class    __lowerCAmelCase			(	UpperCAmelCase__ ,		UpperCAmelCase__ ,		unittest.TestCase			):
						snake_case_				:			Union[str, Any]								=					False
						snake_case_				:			List[str]								=					False
						snake_case_				:			List[Any]								=					(
						    (
						        FunnelModel,
						        FunnelForMaskedLM,
						        FunnelForPreTraining,
						        FunnelForQuestionAnswering,
						        FunnelForTokenClassification,
						    )
						    if is_torch_available()
						    else ()
						)
						snake_case_				:			int								=					(
						    {
						        "feature-extraction": (FunnelBaseModel, FunnelModel),
						        "fill-mask": FunnelForMaskedLM,
						        "question-answering": FunnelForQuestionAnswering,
						        "text-classification": FunnelForSequenceClassification,
						        "token-classification": FunnelForTokenClassification,
						        "zero-shot": FunnelForSequenceClassification,
						    }
						    if is_torch_available()
						    else {}
						)







						def UpperCamelCase      (	self   :      Dict   ,   snake_case__   :      Any   ,   snake_case__   :      Optional[Any]   ,   snake_case__   :      Optional[int]=False				):




												"""simple docstring"""


												_UpperCAmelCase													=					super()._prepare_for_class(__lowercase   ,   __lowercase   ,   return_labels=__lowercase				)

												if return_labels:
																		if model_class in get_values(__lowercase				):
																								_UpperCAmelCase													=					torch.zeros(
																								    (self.model_tester.batch_size, self.model_tester.seq_length)   ,   dtype=torch.long   ,   device=__lowercase				)
												return inputs_dict







						def UpperCamelCase      (	self   :      int				):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelModelTester(self				)
												_UpperCAmelCase													=					ConfigTester(self   ,   config_class=__lowercase				)







						def UpperCamelCase      (	self   :      Optional[int]				):




												"""simple docstring"""


												self.config_tester.run_common_tests()







						def UpperCamelCase      (	self   :      List[Any]				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_model(*__lowercase				)







						def UpperCamelCase      (	self   :      List[str]				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_pretraining(*__lowercase				)







						def UpperCamelCase      (	self   :      Tuple				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_masked_lm(*__lowercase				)







						def UpperCamelCase      (	self   :      Dict				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_token_classification(*__lowercase				)







						def UpperCamelCase      (	self   :      List[str]				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_question_answering(*__lowercase				)







						def UpperCamelCase      (	self   :      List[Any]   ,   snake_case__   :      Tuple				):




												"""simple docstring"""


												if hasattr(__lowercase   ,   "weight"				) and module.weight is not None:
																		module.weight.data.fill_(3				)
												if hasattr(__lowercase   ,   "bias"				) and module.bias is not None:
																		module.bias.data.fill_(3				)

												for param in ["r_w_bias", "r_r_bias", "r_kernel", "r_s_bias", "seg_embed"]:
																		if hasattr(__lowercase   ,   __lowercase				) and getattr(__lowercase   ,   __lowercase				) is not None:
																								_UpperCAmelCase													=					getattr(__lowercase   ,   __lowercase				)
																								weight.data.fill_(3				)






@require_torch
class    __lowerCAmelCase			(	UpperCAmelCase__ ,		unittest.TestCase			):
						snake_case_				:			List[str]								=					False
						snake_case_				:			int								=					False
						snake_case_				:			Optional[Any]								=					(
						    (FunnelBaseModel, FunnelForMultipleChoice, FunnelForSequenceClassification) if is_torch_available() else ()
						)







						def UpperCamelCase      (	self   :      Dict				):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelModelTester(self   ,   base=__lowercase				)
												_UpperCAmelCase													=					ConfigTester(self   ,   config_class=__lowercase				)







						def UpperCamelCase      (	self   :      str				):




												"""simple docstring"""


												self.config_tester.run_common_tests()







						def UpperCamelCase      (	self   :      Optional[Any]				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_base_model(*__lowercase				)







						def UpperCamelCase      (	self   :      List[Any]				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_sequence_classification(*__lowercase				)







						def UpperCamelCase      (	self   :      int				):




												"""simple docstring"""


												_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_multiple_choice(*__lowercase				)







						def UpperCamelCase      (	self   :      Dict				):




												"""simple docstring"""


												_UpperCAmelCase							,			_UpperCAmelCase													=					self.model_tester.prepare_config_and_inputs_for_common()
												_UpperCAmelCase													=					True

												for model_class in self.all_model_classes:
																		if model_class.__name__ == "FunnelBaseModel":
																								continue
																		_UpperCAmelCase													=					model_class(__lowercase				)
																		model.to(__lowercase				)
																		model.train()
																		_UpperCAmelCase													=					self._prepare_for_class(__lowercase   ,   __lowercase   ,   return_labels=__lowercase				)
																		_UpperCAmelCase													=					model(**__lowercase				).loss
																		loss.backward()







						def UpperCamelCase      (	self   :      str   ,   snake_case__   :      Optional[Any]				):




												"""simple docstring"""


												if hasattr(__lowercase   ,   "weight"				) and module.weight is not None:
																		module.weight.data.fill_(3				)
												if hasattr(__lowercase   ,   "bias"				) and module.bias is not None:
																		module.bias.data.fill_(3				)

												for param in ["r_w_bias", "r_r_bias", "r_kernel", "r_s_bias", "seg_embed"]:
																		if hasattr(__lowercase   ,   __lowercase				) and getattr(__lowercase   ,   __lowercase				) is not None:
																								_UpperCAmelCase													=					getattr(__lowercase   ,   __lowercase				)
																								weight.data.fill_(3				)






@require_torch
@require_sentencepiece
@require_tokenizers
class    __lowerCAmelCase			(	unittest.TestCase			):







						def UpperCamelCase      (	self   :      List[Any]				):




												"""simple docstring"""


												_UpperCAmelCase													=					13
												_UpperCAmelCase													=					7
												_UpperCAmelCase													=					torch.arange(0   ,   batch_size * sequence_length				).long().reshape(__lowercase   ,   __lowercase				)
												_UpperCAmelCase													=					[0, 1, 2, 3, 4, 5, 6, 4, 1, 3, 5, 0, 1]
												_UpperCAmelCase													=					torch.tensor([[2] + [0] * a + [1] * (sequence_length - a - 1) for a in lengths]				)

												_UpperCAmelCase													=					FunnelModel.from_pretrained("sgugger/funnel-random-tiny"				)
												_UpperCAmelCase													=					model(__lowercase   ,   token_type_ids=__lowercase				)[0].abs()

												_UpperCAmelCase													=					torch.tensor(2_344.8_352				)
												_UpperCAmelCase													=					torch.tensor(0.8_052				)
												self.assertTrue(torch.allclose(output.sum()   ,   __lowercase   ,   atol=1e-4				)				)
												self.assertTrue(torch.allclose(output.mean()   ,   __lowercase   ,   atol=1e-4				)				)

												_UpperCAmelCase													=					torch.tensor([[1] * 7, [1] * 4 + [0] * 3] * 6 + [[0, 1, 1, 0, 0, 1, 1]]				)
												_UpperCAmelCase													=					model(__lowercase   ,   attention_mask=__lowercase   ,   token_type_ids=__lowercase				)[0].abs()

												_UpperCAmelCase													=					torch.tensor(2_343.8_425				)
												_UpperCAmelCase													=					torch.tensor(0.8_049				)
												self.assertTrue(torch.allclose(output.sum()   ,   __lowercase   ,   atol=1e-4				)				)
												self.assertTrue(torch.allclose(output.mean()   ,   __lowercase   ,   atol=1e-4				)				)







						@slow
						def UpperCamelCase      (	self   :      str				):




												"""simple docstring"""


												_UpperCAmelCase													=					FunnelTokenizer.from_pretrained("huggingface/funnel-small"				)
												_UpperCAmelCase													=					FunnelModel.from_pretrained("huggingface/funnel-small"				)
												_UpperCAmelCase													=					tokenizer("Hello! I am the Funnel Transformer model."   ,   return_tensors="pt"				)
												_UpperCAmelCase													=					model(**__lowercase				)[0]

												_UpperCAmelCase													=					torch.tensor(235.7_246				)
												_UpperCAmelCase													=					torch.tensor(0.0_256				)
												self.assertTrue(torch.allclose(output.sum()   ,   __lowercase   ,   atol=1e-4				)				)
												self.assertTrue(torch.allclose(output.mean()   ,   __lowercase   ,   atol=1e-4				)				)










from __future__ import annotations


def 							__SCREAMING_SNAKE_CASE  (      snake_case_     ,   snake_case_						):

						'''simple docstring'''


						_UpperCAmelCase													=					{}
						for index, val in enumerate(snake_case_						):
												_UpperCAmelCase													=					target - val
												if compl in chk_map:
																		return [chk_map[compl], index]
												_UpperCAmelCase													=					index
						return []


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				print(f"""{two_sum([2, 7, 11, 15], 9) = }""")




