


'''simple docstring'''







import os
import tempfile
import unittest

from transformers import NezhaConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
       import torch

       from transformers import (
           MODEL_FOR_PRETRAINING_MAPPING,
           NezhaForMaskedLM,
           NezhaForMultipleChoice,
           NezhaForNextSentencePrediction,
           NezhaForPreTraining,
           NezhaForQuestionAnswering,
           NezhaForSequenceClassification,
           NezhaForTokenClassification,
           NezhaModel,
       )
       from transformers.models.nezha.modeling_nezha import NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST
class 	UpperCamelCase__					:



     """simple docstring"""






     def __init__( self      ,	snake_case__      ,	snake_case__=13      ,	snake_case__=7      ,	snake_case__=True      ,	snake_case__=True      ,	snake_case__=True      ,	snake_case__=True      ,	snake_case__=99      ,	snake_case__=32      ,	snake_case__=5      ,	snake_case__=4      ,	snake_case__=37      ,	snake_case__="gelu"      ,	snake_case__=0.1      ,	snake_case__=0.1      ,	snake_case__=128      ,	snake_case__=32      ,	snake_case__=16      ,	snake_case__=2      ,	snake_case__=0.02      ,	snake_case__=3      ,	snake_case__=4      ,	snake_case__=None      ,	):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       parent
            _lowerCAmelCase    :							Any   			=       batch_size
            _lowerCAmelCase    :							Dict   			=       seq_length
            _lowerCAmelCase    :							Any   			=       is_training
            _lowerCAmelCase    :							Tuple   			=       use_input_mask
            _lowerCAmelCase    :							int   			=       use_token_type_ids
            _lowerCAmelCase    :							str   			=       use_labels
            _lowerCAmelCase    :							List[Any]   			=       vocab_size
            _lowerCAmelCase    :							Optional[Any]   			=       hidden_size
            _lowerCAmelCase    :							List[str]   			=       num_hidden_layers
            _lowerCAmelCase    :							Union[str, Any]   			=       num_attention_heads
            _lowerCAmelCase    :							Any   			=       intermediate_size
            _lowerCAmelCase    :							Any   			=       hidden_act
            _lowerCAmelCase    :							Union[str, Any]   			=       hidden_dropout_prob
            _lowerCAmelCase    :							Tuple   			=       attention_probs_dropout_prob
            _lowerCAmelCase    :							Dict   			=       max_position_embeddings
            _lowerCAmelCase    :							Optional[int]   			=       type_vocab_size
            _lowerCAmelCase    :							Optional[Any]   			=       type_sequence_label_size
            _lowerCAmelCase    :							Tuple   			=       initializer_range
            _lowerCAmelCase    :							Any   			=       num_labels
            _lowerCAmelCase    :							str   			=       num_choices
            _lowerCAmelCase    :							Optional[Any]   			=       scope







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Dict   			=       ids_tensor([self.batch_size, self.seq_length]      ,	self.vocab_size   )

            _lowerCAmelCase    :							Dict   			=       None
            if self.use_input_mask:
                   _lowerCAmelCase    :							Tuple   			=       random_attention_mask([self.batch_size, self.seq_length]   )

            _lowerCAmelCase    :							Dict   			=       None
            if self.use_token_type_ids:
                   _lowerCAmelCase    :							Optional[int]   			=       ids_tensor([self.batch_size, self.seq_length]      ,	self.type_vocab_size   )

            _lowerCAmelCase    :							Tuple   			=       None
            _lowerCAmelCase    :							Dict   			=       None
            _lowerCAmelCase    :							List[str]   			=       None
            if self.use_labels:
                   _lowerCAmelCase    :							int   			=       ids_tensor([self.batch_size]      ,	self.type_sequence_label_size   )
                   _lowerCAmelCase    :							int   			=       ids_tensor([self.batch_size, self.seq_length]      ,	self.num_labels   )
                   _lowerCAmelCase    :							Union[str, Any]   			=       ids_tensor([self.batch_size]      ,	self.num_choices   )

            _lowerCAmelCase    :							Optional[int]   			=       self.get_config()

            return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







     def a	( self   ):

            '''simple docstring'''

            return NezhaConfig(
                vocab_size=self.vocab_size      ,	hidden_size=self.hidden_size      ,	num_hidden_layers=self.num_hidden_layers      ,	num_attention_heads=self.num_attention_heads      ,	intermediate_size=self.intermediate_size      ,	hidden_act=self.hidden_act      ,	hidden_dropout_prob=self.hidden_dropout_prob      ,	attention_probs_dropout_prob=self.attention_probs_dropout_prob      ,	max_position_embeddings=self.max_position_embeddings      ,	type_vocab_size=self.type_vocab_size      ,	is_decoder=lowerCamelCase_      ,	initializer_range=self.initializer_range      ,	)







     def a	( self   ):

            '''simple docstring'''

            (
                _lowerCAmelCase					
            )    :							Optional[Any]   			=       self.prepare_config_and_inputs()

            _lowerCAmelCase    :							Optional[int]   			=       True
            _lowerCAmelCase    :							int   			=       floats_tensor([self.batch_size, self.seq_length, self.hidden_size]   )
            _lowerCAmelCase    :							List[Any]   			=       ids_tensor([self.batch_size, self.seq_length]      ,	vocab_size=2   )

            return (
                config,
                input_ids,
                token_type_ids,
                input_mask,
                sequence_labels,
                token_labels,
                choice_labels,
                encoder_hidden_states,
                encoder_attention_mask,
            )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       NezhaModel(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Any   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_   )
            _lowerCAmelCase    :							Any   			=       model(lowerCamelCase_      ,	token_type_ids=lowerCamelCase_   )
            _lowerCAmelCase    :							Optional[Any]   			=       model(lowerCamelCase_   )
            self.parent.assertEqual(result.last_hidden_state.shape      ,	(self.batch_size, self.seq_length, self.hidden_size)   )
            self.parent.assertEqual(result.pooler_output.shape      ,	(self.batch_size, self.hidden_size)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	):

            '''simple docstring'''

            _lowerCAmelCase    :							int   			=       True
            _lowerCAmelCase    :							str   			=       NezhaModel(lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Optional[Any]   			=       model(
                lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	encoder_hidden_states=lowerCamelCase_      ,	encoder_attention_mask=lowerCamelCase_      ,	)
            _lowerCAmelCase    :							int   			=       model(
                lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	encoder_hidden_states=lowerCamelCase_      ,	)
            _lowerCAmelCase    :							str   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_   )
            self.parent.assertEqual(result.last_hidden_state.shape      ,	(self.batch_size, self.seq_length, self.hidden_size)   )
            self.parent.assertEqual(result.pooler_output.shape      ,	(self.batch_size, self.hidden_size)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Optional[int]   			=       NezhaForMaskedLM(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							str   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	labels=lowerCamelCase_   )
            self.parent.assertEqual(result.logits.shape      ,	(self.batch_size, self.seq_length, self.vocab_size)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Optional[Any]   			=       NezhaForNextSentencePrediction(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							str   			=       model(
                lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	labels=lowerCamelCase_      ,	)
            self.parent.assertEqual(result.logits.shape      ,	(self.batch_size, 2)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Union[str, Any]   			=       NezhaForPreTraining(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Dict   			=       model(
                lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	labels=lowerCamelCase_      ,	next_sentence_label=lowerCamelCase_      ,	)
            self.parent.assertEqual(result.prediction_logits.shape      ,	(self.batch_size, self.seq_length, self.vocab_size)   )
            self.parent.assertEqual(result.seq_relationship_logits.shape      ,	(self.batch_size, 2)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       NezhaForQuestionAnswering(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Tuple   			=       model(
                lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	start_positions=lowerCamelCase_      ,	end_positions=lowerCamelCase_      ,	)
            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 a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Any   			=       self.num_labels
            _lowerCAmelCase    :							Union[str, Any]   			=       NezhaForSequenceClassification(lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Any   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	labels=lowerCamelCase_   )
            self.parent.assertEqual(result.logits.shape      ,	(self.batch_size, self.num_labels)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[Any]   			=       self.num_labels
            _lowerCAmelCase    :							Any   			=       NezhaForTokenClassification(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Tuple   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	labels=lowerCamelCase_   )
            self.parent.assertEqual(result.logits.shape      ,	(self.batch_size, self.seq_length, self.num_labels)   )







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[Any]   			=       self.num_choices
            _lowerCAmelCase    :							List[str]   			=       NezhaForMultipleChoice(config=lowerCamelCase_   )
            model.to(lowerCamelCase_   )
            model.eval()
            _lowerCAmelCase    :							Optional[int]   			=       input_ids.unsqueeze(1   ).expand(-1      ,	self.num_choices      ,	-1   ).contiguous()
            _lowerCAmelCase    :							Optional[int]   			=       token_type_ids.unsqueeze(1   ).expand(-1      ,	self.num_choices      ,	-1   ).contiguous()
            _lowerCAmelCase    :							Optional[Any]   			=       input_mask.unsqueeze(1   ).expand(-1      ,	self.num_choices      ,	-1   ).contiguous()
            _lowerCAmelCase    :							str   			=       model(
                lowerCamelCase_      ,	attention_mask=lowerCamelCase_      ,	token_type_ids=lowerCamelCase_      ,	labels=lowerCamelCase_      ,	)
            self.parent.assertEqual(result.logits.shape      ,	(self.batch_size, self.num_choices)   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Optional[Any]   			=       self.prepare_config_and_inputs()
            (
                _lowerCAmelCase					
            )    :							List[str]   			=       config_and_inputs
            _lowerCAmelCase    :							int   			=       {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
            return config, inputs_dict
@require_torch
class 	UpperCamelCase__					( _UpperCAmelCase    ,					_UpperCAmelCase    ,					_UpperCAmelCase    ,					unittest.TestCase	):



     """simple docstring"""






     __magic_name__    			=    (
         (
             NezhaModel,
             NezhaForMaskedLM,
             NezhaForMultipleChoice,
             NezhaForNextSentencePrediction,
             NezhaForPreTraining,
             NezhaForQuestionAnswering,
             NezhaForSequenceClassification,
             NezhaForTokenClassification,
         )
         if is_torch_available()
         else ()
     )
     __magic_name__    			=    (
         {
             "feature-extraction": NezhaModel,
             "fill-mask": NezhaForMaskedLM,
             "question-answering": NezhaForQuestionAnswering,
             "text-classification": NezhaForSequenceClassification,
             "token-classification": NezhaForTokenClassification,
             "zero-shot": NezhaForSequenceClassification,
         }
         if is_torch_available()
         else {}
     )
     __magic_name__    			=    True







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__=False   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[Any]   			=       super()._prepare_for_class(lowerCamelCase_      ,	lowerCamelCase_      ,	return_labels=lowerCamelCase_   )

            if return_labels:
                   if model_class in get_values(lowerCamelCase_   ):
                          _lowerCAmelCase    :							int   			=       torch.zeros(
                              (self.model_tester.batch_size, self.model_tester.seq_length)      ,	dtype=torch.long      ,	device=lowerCamelCase_   )
                          _lowerCAmelCase    :							Optional[int]   			=       torch.zeros(
                              self.model_tester.batch_size      ,	dtype=torch.long      ,	device=lowerCamelCase_   )
            return inputs_dict







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							str   			=       NezhaModelTester(self   )
            _lowerCAmelCase    :							Any   			=       ConfigTester(self      ,	config_class=lowerCamelCase_      ,	hidden_size=37   )







     def a	( self   ):

            '''simple docstring'''

            self.config_tester.run_common_tests()







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Optional[int]   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_model(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Any   			=       self.model_tester.prepare_config_and_inputs_for_decoder()
            self.model_tester.create_and_check_model_as_decoder(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            (
                _lowerCAmelCase					
            )    :							List[Any]   			=       self.model_tester.prepare_config_and_inputs_for_decoder()

            _lowerCAmelCase    :							List[str]   			=       None

            self.model_tester.create_and_check_model_as_decoder(
                lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	lowerCamelCase_      ,	)







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Union[str, Any]   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_masked_lm(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Union[str, Any]   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_multiple_choice(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Dict   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_next_sequence_prediction(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Any   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_pretraining(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_question_answering(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Optional[int]   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_sequence_classification(*lowerCamelCase_   )







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_token_classification(*lowerCamelCase_   )







     @slow
     def a	( self   ):

            '''simple docstring'''

            for model_name in NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                   _lowerCAmelCase    :							Optional[int]   			=       NezhaModel.from_pretrained(lowerCamelCase_   )
                   self.assertIsNotNone(lowerCamelCase_   )







     @slow
     @require_torch_gpu
     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[Any]   			=       self.model_tester.prepare_config_and_inputs_for_common()
            for model_class in self.all_model_classes:
                   # NezhaForMultipleChoice behaves incorrectly in JIT environments.
                   if model_class == NezhaForMultipleChoice:
                          return

                   _lowerCAmelCase    :							Union[str, Any]   			=       True
                   _lowerCAmelCase    :							Optional[Any]   			=       model_class(config=lowerCamelCase_   )

                   _lowerCAmelCase    :							Optional[int]   			=       self._prepare_for_class(lowerCamelCase_      ,	lowerCamelCase_   )
                   _lowerCAmelCase    :							Optional[Any]   			=       torch.jit.trace(
                       lowerCamelCase_      ,	(inputs_dict['input_ids'].to('cpu'   ), inputs_dict['attention_mask'].to('cpu'   ))   )

                   with tempfile.TemporaryDirectory() as tmp:
                          torch.jit.save(lowerCamelCase_      ,	os.path.join(lowerCamelCase_      ,	'bert.pt'   )   )
                          _lowerCAmelCase    :							Optional[Any]   			=       torch.jit.load(os.path.join(lowerCamelCase_      ,	'bert.pt'   )      ,	map_location=lowerCamelCase_   )
                          loaded(inputs_dict['input_ids'].to(lowerCamelCase_   )      ,	inputs_dict['attention_mask'].to(lowerCamelCase_   )   )
@require_torch
class 	UpperCamelCase__					( unittest.TestCase	):



     """simple docstring"""






     @slow
     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Dict   			=       NezhaModel.from_pretrained('sijunhe/nezha-cn-base'   )
            _lowerCAmelCase    :							List[str]   			=       torch.tensor([[0, 1, 2, 3, 4, 5]]   )
            _lowerCAmelCase    :							Optional[int]   			=       torch.tensor([[0, 1, 1, 1, 1, 1]]   )
            with torch.no_grad():
                   _lowerCAmelCase    :							Any   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_   )[0]
            _lowerCAmelCase    :							Tuple   			=       torch.Size((1, 6, 768)   )
            self.assertEqual(output.shape      ,	lowerCamelCase_   )
            _lowerCAmelCase    :							Union[str, Any]   			=       torch.tensor([[[0.0685, 0.2441, 0.1102], [0.0600, 0.1906, 0.1349], [0.0221, 0.0819, 0.0586]]]   )

            self.assertTrue(torch.allclose(output[:, 1:4, 1:4]      ,	lowerCamelCase_      ,	atol=1E-4   )   )







     @slow
     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Optional[int]   			=       NezhaForMaskedLM.from_pretrained('sijunhe/nezha-cn-base'   )
            _lowerCAmelCase    :							Union[str, Any]   			=       torch.tensor([[0, 1, 2, 3, 4, 5]]   )
            _lowerCAmelCase    :							Dict   			=       torch.tensor([[1, 1, 1, 1, 1, 1]]   )
            with torch.no_grad():
                   _lowerCAmelCase    :							int   			=       model(lowerCamelCase_      ,	attention_mask=lowerCamelCase_   )[0]
            _lowerCAmelCase    :							List[str]   			=       torch.Size((1, 6, 2_1128)   )
            self.assertEqual(output.shape      ,	lowerCamelCase_   )
            _lowerCAmelCase    :							Any   			=       torch.tensor(
                [[-2.7939, -1.7902, -2.2189], [-2.8585, -1.8908, -2.3723], [-2.6499, -1.7750, -2.2558]]   )

            self.assertTrue(torch.allclose(output[:, 1:4, 1:4]      ,	lowerCamelCase_      ,	atol=1E-4   )   )





'''simple docstring'''







def 			lowercase				(_A   ,						_A					):







       """simple docstring"""







       _lowerCAmelCase    :							Optional[int]   			=       (boundary[1] - boundary[0]) / steps
       _lowerCAmelCase    :							Any   			=       boundary[0]
       _lowerCAmelCase    :							List[str]   			=       boundary[1]
       _lowerCAmelCase    :							Tuple   			=       make_points(_A   ,						_A   ,						_A					)
       _lowerCAmelCase    :							Tuple   			=       0.0
       y += (h / 2.0) * f(_A					)
       for i in x_i:
              # print(i)
              y += h * f(_A					)
       y += (h / 2.0) * f(_A					)
       return y






def 			lowercase				(_A   ,						_A   ,						_A					):







       """simple docstring"""







       _lowerCAmelCase    :							Tuple   			=       a + h
       while x < (b - h):
              yield x
              _lowerCAmelCase    :							Any   			=       x + h






def 			lowercase				(_A					):  # enter your function here







       """simple docstring"""







       _lowerCAmelCase    :							int   			=       (x - 0) * (x - 0)
       return y






def 			lowercase				():







       """simple docstring"""







       _lowerCAmelCase    :							Optional[Any]   			=       0.0  # Lower bound of integration
       _lowerCAmelCase    :							Dict   			=       1.0  # Upper bound of integration
       _lowerCAmelCase    :							Optional[Any]   			=       10.0  # define number of steps or resolution
       _lowerCAmelCase    :							Optional[int]   			=       [a, b]  # define boundary of integration
       _lowerCAmelCase    :							List[Any]   			=       method_a(_A   ,						_A					)
       print(f'y = {y}'					)


if __name__ == "__main__":
       main()

