



import copy
import tempfile
import unittest

from transformers import MaMaaaConfig, is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
from transformers.utils import cached_property

from ...generation.test_utils import GenerationTesterMixin
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 MaMaaaForConditionalGeneration, MaMaaaModel, MaMaaaTokenizer
				from transformers.models.mam_aaa.modeling_mam_aaa import MaMaaaDecoder, MaMaaaEncoder






def        __lowerCAmelCase		(	__lowerCamelCase						:     str					, __lowerCamelCase						:     Union[str, Any]					, __lowerCamelCase						:     Any					, __lowerCamelCase						:     Union[str, Any]=None					, __lowerCamelCase						:     Optional[int]=None					, __lowerCamelCase						:     Dict=None					, __lowerCamelCase						:     List[str]=None					, __lowerCamelCase						:     Optional[int]=None					, )	->    Dict:
					if attention_mask is None:
										__lowerCAmelCase						 =input_ids.ne(config.pad_token_id						)
					if decoder_attention_mask is None:
										__lowerCAmelCase						 =decoder_input_ids.ne(config.pad_token_id						)
					if head_mask is None:
										__lowerCAmelCase						 =torch.ones(config.encoder_layers					, config.encoder_attention_heads					, device=__lowerCamelCase						)
					if decoder_head_mask is None:
										__lowerCAmelCase						 =torch.ones(config.decoder_layers					, config.decoder_attention_heads					, device=__lowerCamelCase						)
					if cross_attn_head_mask is None:
										__lowerCAmelCase						 =torch.ones(config.decoder_layers					, config.decoder_attention_heads					, device=__lowerCamelCase						)
					return {
					    "input_ids": input_ids,
					    "decoder_input_ids": decoder_input_ids,
					    "attention_mask": attention_mask,
					    "decoder_attention_mask": attention_mask,
					    "head_mask": head_mask,
					    "decoder_head_mask": decoder_head_mask,
					    "cross_attn_head_mask": cross_attn_head_mask,
					}






class     __a			:



	def __init__(    self				:     Any					,						snake_case_				:     Dict					,						snake_case_				:     Optional[Any]=13					,						snake_case_				:     List[Any]=7					,						snake_case_				:     Dict=True					,						snake_case_				:     Any=False					,						snake_case_				:     Union[str, Any]=99					,						snake_case_				:     Union[str, Any]=16					,						snake_case_				:     Union[str, Any]=2					,						snake_case_				:     Any=4					,						snake_case_				:     Optional[Any]=4					,						snake_case_				:     List[Any]="relu"					,						snake_case_				:     Dict=0.1					,						snake_case_				:     List[str]=0.1					,						snake_case_				:     Optional[Any]=0.0					,						snake_case_				:     Dict=0.0					,						snake_case_				:     Dict=20					,						snake_case_				:     List[Any]=2					,						snake_case_				:     Union[str, Any]=1					,						snake_case_				:     List[str]=0					,						)->				int:
						__lowerCAmelCase						 =parent
						__lowerCAmelCase						 =batch_size
						__lowerCAmelCase						 =seq_length
						__lowerCAmelCase						 =is_training
						__lowerCAmelCase						 =use_labels
						__lowerCAmelCase						 =vocab_size
						__lowerCAmelCase						 =hidden_size
						__lowerCAmelCase						 =num_hidden_layers
						__lowerCAmelCase						 =num_attention_heads
						__lowerCAmelCase						 =intermediate_size
						__lowerCAmelCase						 =hidden_act
						__lowerCAmelCase						 =hidden_dropout_prob
						__lowerCAmelCase						 =attention_probs_dropout_prob
						__lowerCAmelCase						 =encoder_layerdrop
						__lowerCAmelCase						 =decoder_layerdrop
						__lowerCAmelCase						 =max_position_embeddings
						__lowerCAmelCase						 =eos_token_id
						__lowerCAmelCase						 =pad_token_id
						__lowerCAmelCase						 =bos_token_id



	def 		UpperCamelCase				(    self				:     Any)->				Any:
						__lowerCAmelCase						 =ids_tensor([self.batch_size, self.seq_length]					,						self.vocab_size)
						__lowerCAmelCase						 =self.eos_token_id  # Eos Token
						__lowerCAmelCase						 =ids_tensor([self.batch_size, self.seq_length]					,						self.vocab_size)

						# we need to clamp the input ids here to avoid having pad token in between
						# this is because for M2M100 the position_ids are prepared such that
						# all pad tokens have pos id = 2 and rest are between 2..seq_length
						# and the seq_length here is seq_length - num_pad_tokens
						# but when using past, there is no way of knowing if the past input ids had
						# pad tokens in them, which results in incorrect seq_lenth and which in turn results in
						# position_ids being off by num_pad_tokens in past input
						__lowerCAmelCase						 =input_ids.clamp(self.pad_token_id + 1)
						__lowerCAmelCase						 =decoder_input_ids.clamp(self.pad_token_id + 1)

						__lowerCAmelCase						 =self.get_config()
						__lowerCAmelCase						 =prepare_mam_aaa_inputs_dict(snake_case_					,						snake_case_					,						snake_case_)
						return config, inputs_dict



	def 		UpperCamelCase				(    self				:     Union[str, Any])->				Dict:
						return MaMaaaConfig(
						    vocab_size=self.vocab_size					,						d_model=self.hidden_size					,						encoder_layers=self.num_hidden_layers					,						decoder_layers=self.num_hidden_layers					,						encoder_attention_heads=self.num_attention_heads					,						decoder_attention_heads=self.num_attention_heads					,						encoder_ffn_dim=self.intermediate_size					,						decoder_ffn_dim=self.intermediate_size					,						dropout=self.hidden_dropout_prob					,						attention_dropout=self.attention_probs_dropout_prob					,						encoder_layerdrop=self.encoder_layerdrop					,						decoder_layerdrop=self.decoder_layerdrop					,						max_position_embeddings=self.max_position_embeddings					,						eos_token_id=self.eos_token_id					,						bos_token_id=self.bos_token_id					,						pad_token_id=self.pad_token_id					,						)



	def 		UpperCamelCase				(    self				:     str)->				Tuple:
						__lowerCAmelCase ,						__lowerCAmelCase						 =self.prepare_config_and_inputs()
						return config, inputs_dict



	def 		UpperCamelCase				(    self				:     Dict					,						snake_case_				:     Optional[Any]					,						snake_case_				:     Any)->				str:
						__lowerCAmelCase						 =MaMaaaModel(config=snake_case_).get_decoder().to(snake_case_).eval()
						__lowerCAmelCase						 =inputs_dict["""input_ids"""]
						__lowerCAmelCase						 =inputs_dict["""attention_mask"""]
						__lowerCAmelCase						 =inputs_dict["""head_mask"""]

						# first forward pass
						__lowerCAmelCase						 =model(snake_case_					,						attention_mask=snake_case_					,						head_mask=snake_case_					,						use_cache=snake_case_)

						__lowerCAmelCase ,						__lowerCAmelCase						 =outputs.to_tuple()

						# create hypothetical multiple next token and extent to next_input_ids
						__lowerCAmelCase						 =ids_tensor((self.batch_size, 3)					,						config.vocab_size)
						__lowerCAmelCase						 =ids_tensor((self.batch_size, 3)					,						2)

						# append to next input_ids and
						__lowerCAmelCase						 =torch.cat([input_ids, next_tokens]					,						dim=-1)
						__lowerCAmelCase						 =torch.cat([attention_mask, next_attn_mask]					,						dim=-1)

						__lowerCAmelCase						 =model(snake_case_					,						attention_mask=snake_case_)["""last_hidden_state"""]
						__lowerCAmelCase						 =model(snake_case_					,						attention_mask=snake_case_					,						past_key_values=snake_case_)[
						    """last_hidden_state"""
						]

						# select random slice
						__lowerCAmelCase						 =ids_tensor((1,)					,						output_from_past.shape[-1]).item()
						__lowerCAmelCase						 =output_from_no_past[:, -3:, random_slice_idx].detach()
						__lowerCAmelCase						 =output_from_past[:, :, random_slice_idx].detach()

						self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1])

						# test that outputs are equal for slice
						self.parent.assertTrue(torch.allclose(snake_case_					,						snake_case_					,						atol=1e-2))



	def 		UpperCamelCase				(    self				:     Tuple					,						snake_case_				:     List[str]					,						snake_case_				:     Tuple)->				List[str]:
						__lowerCAmelCase						 =MaMaaaModel(config=snake_case_).to(snake_case_).eval()
						__lowerCAmelCase						 =model(**snake_case_)

						__lowerCAmelCase						 =outputs.encoder_last_hidden_state
						__lowerCAmelCase						 =outputs.last_hidden_state

						with tempfile.TemporaryDirectory() as tmpdirname:
											__lowerCAmelCase						 =model.get_encoder()
											encoder.save_pretrained(snake_case_)
											__lowerCAmelCase						 =MaMaaaEncoder.from_pretrained(snake_case_).to(snake_case_)

						__lowerCAmelCase						 =encoder(inputs_dict["""input_ids"""]					,						attention_mask=inputs_dict["""attention_mask"""])[
						    0
						]

						self.parent.assertTrue((encoder_last_hidden_state_a - encoder_last_hidden_state).abs().max().item() < 1e-3)

						with tempfile.TemporaryDirectory() as tmpdirname:
											__lowerCAmelCase						 =model.get_decoder()
											decoder.save_pretrained(snake_case_)
											__lowerCAmelCase						 =MaMaaaDecoder.from_pretrained(snake_case_).to(snake_case_)

						__lowerCAmelCase						 =decoder(
						    input_ids=inputs_dict["""decoder_input_ids"""]					,						attention_mask=inputs_dict["""decoder_attention_mask"""]					,						encoder_hidden_states=snake_case_					,						encoder_attention_mask=inputs_dict["""attention_mask"""]					,						)[0]

						self.parent.assertTrue((last_hidden_state_a - last_hidden_state).abs().max().item() < 1e-3)






@require_torch
class     __a			(  SCREAMING_SNAKE_CASE						,     SCREAMING_SNAKE_CASE						,     SCREAMING_SNAKE_CASE						,     unittest.TestCase					):
	SCREAMING_SNAKE_CASE  	=							(
	    (
	        MaMaaaModel,
	        MaMaaaForConditionalGeneration,
	    )
	    if is_torch_available()
	    else ()
	)
	SCREAMING_SNAKE_CASE  	=							(MaMaaaForConditionalGeneration,) if is_torch_available() else ()
	SCREAMING_SNAKE_CASE  	=							(
	    {
	        "conversational": MaMaaaForConditionalGeneration,
	        "feature-extraction": MaMaaaModel,
	        "summarization": MaMaaaForConditionalGeneration,
	        "text2text-generation": MaMaaaForConditionalGeneration,
	        "translation": MaMaaaForConditionalGeneration,
	    }
	    if is_torch_available()
	    else {}
	)
	SCREAMING_SNAKE_CASE  	=							True
	SCREAMING_SNAKE_CASE  	=							True
	SCREAMING_SNAKE_CASE  	=							False
	SCREAMING_SNAKE_CASE  	=							False



	def 		UpperCamelCase				(    self				:     List[Any]					,						snake_case_				:     int					,						snake_case_				:     Union[str, Any]					,						snake_case_				:     Any					,						snake_case_				:     Dict					,						snake_case_				:     str)->				Union[str, Any]:
						if pipeline_test_casse_name == "TranslationPipelineTests":
											# Get `ValueError: Translation requires a `src_lang` and a `tgt_lang` for this model`.
											# `M2M100Config` was never used in pipeline tests: cannot create a simple tokenizer.
											return True

						return False



	def 		UpperCamelCase				(    self				:     Dict)->				Optional[int]:
						__lowerCAmelCase						 =MaMaaaModelTester(self)
						__lowerCAmelCase						 =ConfigTester(self					,						config_class=snake_case_)



	def 		UpperCamelCase				(    self				:     List[str])->				Optional[int]:
						self.config_tester.run_common_tests()



	def 		UpperCamelCase				(    self				:     List[Any])->				int:
						__lowerCAmelCase ,						__lowerCAmelCase						 =self.model_tester.prepare_config_and_inputs()
						for model_class in self.all_model_classes:
											__lowerCAmelCase						 =model_class(snake_case_)

											with tempfile.TemporaryDirectory() as tmpdirname:
																model.save_pretrained(snake_case_)
																__lowerCAmelCase ,						__lowerCAmelCase						 =model_class.from_pretrained(snake_case_					,						output_loading_info=snake_case_)
											self.assertEqual(info["""missing_keys"""]					,						[])



	def 		UpperCamelCase				(    self				:     Optional[Any])->				Tuple:
						__lowerCAmelCase						 =self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_decoder_model_past_large_inputs(*snake_case_)



	def 		UpperCamelCase				(    self				:     Optional[Any])->				Any:
						__lowerCAmelCase						 =self.model_tester.prepare_config_and_inputs_for_common()
						self.model_tester.check_encoder_decoder_model_standalone(*snake_case_)



	def 		UpperCamelCase				(    self				:     List[str])->				Tuple:
						__lowerCAmelCase ,						__lowerCAmelCase						 =self.model_tester.prepare_config_and_inputs_for_common()

						for model_class in (MaMaaaModel, MaMaaaForConditionalGeneration):
											__lowerCAmelCase						 =model_class(snake_case_)
											model.to(snake_case_)
											model.eval()

											__lowerCAmelCase						 =copy.deepcopy(self._prepare_for_class(snake_case_					,						snake_case_))

											if not self.is_encoder_decoder:
																__lowerCAmelCase						 =inputs["""input_ids"""]
																del inputs["input_ids"]
											else:
																__lowerCAmelCase						 =inputs["""input_ids"""]
																__lowerCAmelCase						 =inputs.get("""decoder_input_ids"""					,						snake_case_)
																del inputs["input_ids"]
																inputs.pop("""decoder_input_ids"""					,						snake_case_)

											__lowerCAmelCase						 =model.get_input_embeddings()
											if not self.is_encoder_decoder:
																__lowerCAmelCase						 =wte(snake_case_)
											else:
																__lowerCAmelCase						 =wte(snake_case_)
																__lowerCAmelCase						 =wte(snake_case_)

											with torch.no_grad():
																model(**snake_case_)[0]



	def 		UpperCamelCase				(    self				:     List[Any])->				Optional[Any]:
						__lowerCAmelCase ,						__lowerCAmelCase						 =self.model_tester.prepare_config_and_inputs()
						__lowerCAmelCase						 =input_dict["""input_ids"""]
						__lowerCAmelCase						 =input_ids.ne(1).to(snake_case_)
						__lowerCAmelCase						 =MaMaaaForConditionalGeneration(snake_case_).eval().to(snake_case_)
						if torch_device == "cuda":
											model.half()
						model.generate(snake_case_					,						attention_mask=snake_case_)
						model.generate(num_beams=4					,						do_sample=snake_case_					,						early_stopping=snake_case_					,						num_return_sequences=3)






def        __lowerCAmelCase		(	__lowerCamelCase						:     Optional[Any]						)	->    int:
					return torch.tensor(__lowerCamelCase					, dtype=torch.long					, device=__lowerCamelCase						)


lowercase_													=      1E-4






@require_torch
@require_sentencepiece
@require_tokenizers
@slow
class     __a			(  unittest.TestCase					):



	@cached_property
	def 		UpperCamelCase				(    self				:     Tuple)->				List[Any]:
						return MaMaaaTokenizer.from_pretrained("""facebook/m2m100_418M""")



	def 		UpperCamelCase				(    self				:     Optional[int])->				List[Any]:
						__lowerCAmelCase						 =MaMaaaModel.from_pretrained("""facebook/m2m100_418M""").to(snake_case_)
						__lowerCAmelCase						 =_long_tensor([[12_80_28, 98, 12, 3_05_27, 27_32, 1_59, 77_55, 6_19_04, 3_91_44, 38, 2]])
						__lowerCAmelCase						 =_long_tensor([[2, 12_80_28, 98, 12, 3_05_27, 27_32, 1_59, 77_55, 6_19_04, 3_91_44, 38]])
						__lowerCAmelCase						 =prepare_mam_aaa_inputs_dict(model.config					,						snake_case_					,						snake_case_)
						with torch.no_grad():
											__lowerCAmelCase						 =model(**snake_case_)[0]
						__lowerCAmelCase						 =torch.Size((1, 11, 10_24))
						self.assertEqual(output.shape					,						snake_case_)
						# change to expected output here
						__lowerCAmelCase						 =torch.tensor(
						    [[-0.7_7_8_0, -0.1_6_7_6, 0.1_0_3_8], [-6.7_5_5_6, -1.3_9_9_2, 0.0_5_6_7], [-7.5_3_8_3, -0.5_9_2_0, -0.2_7_7_9]]					,						device=snake_case_)
						self.assertTrue(torch.allclose(output[:, :3, :3]					,						snake_case_					,						atol=snake_case_))



	def 		UpperCamelCase				(    self				:     Optional[int])->				List[Any]:
						__lowerCAmelCase						 =MaMaaaForConditionalGeneration.from_pretrained("""facebook/m2m100_418M""").to(snake_case_)

						# change to intended input
						__lowerCAmelCase						 =_long_tensor([[12_80_28, 98, 12, 3_05_27, 27_32, 1_59, 77_55, 6_19_04, 3_91_44, 38, 2]])
						__lowerCAmelCase						 =_long_tensor([[2, 12_80_28, 98, 12, 3_05_27, 27_32, 1_59, 77_55, 6_19_04, 3_91_44, 38]])
						__lowerCAmelCase						 =prepare_mam_aaa_inputs_dict(model.config					,						snake_case_					,						snake_case_)
						with torch.no_grad():
											__lowerCAmelCase						 =model(**snake_case_)[0]
						__lowerCAmelCase						 =torch.Size((1, 11, model.config.vocab_size))
						self.assertEqual(output.shape					,						snake_case_)
						# change to expected output here
						__lowerCAmelCase						 =torch.tensor(
						    [[-1.0_4_4_8, -1.0_4_1_1, 3.7_9_9_2], [-3.2_1_9_1, -3.2_3_8_6, -1.3_4_5_1], [-3.6_2_1_0, -3.5_9_9_3, 0.4_9_2_5]]					,						device=snake_case_)
						self.assertTrue(torch.allclose(output[:, :3, :3]					,						snake_case_					,						atol=snake_case_))



	def 		UpperCamelCase				(    self				:     Dict)->				Any:
						__lowerCAmelCase						 =MaMaaaForConditionalGeneration.from_pretrained("""facebook/m2m100_418M""").to(snake_case_)
						__lowerCAmelCase						 =MaMaaaTokenizer.from_pretrained("""facebook/m2m100_418M"""					,						src_lang="""fr"""					,						tgt_lang="""en""")

						__lowerCAmelCase						 =[
						    """L'affaire NSA souligne l'absence totale de débat sur le renseignement""",
						    """Selon moi, il y a deux niveaux de réponse de la part du gouvernement français.""",
						    """Lorsque François Hollande téléphone à Barack Obama ou quand le ministre des affaires étrangères Laurent"""
						    """ Fabius convoque l'ambassadeur des Etats-Unis, ils réagissent à une vraie découverte, qui est celle de"""
						    """ l'ampleur de la surveillance américaine sur l'ensemble des communications en France.""",
						]

						# The below article tests that we don't add any hypotheses outside of the top n_beams
						__lowerCAmelCase						 =tokenizer(snake_case_					,						padding=snake_case_					,						return_tensors="""pt""")

						__lowerCAmelCase						 =model.generate(
						    input_ids=dct["""input_ids"""].to(snake_case_)					,						attention_mask=dct["""attention_mask"""].to(snake_case_)					,						num_beams=5					,						forced_bos_token_id=tokenizer.get_lang_id("""en""")					,						)

						__lowerCAmelCase						 =[
						    """The NSA case highlights the total absence of intelligence debate""",
						    """I think there are two levels of response from the French government.""",
						    """When François Hollande calls Barack Obama or when Foreign Minister Laurent Fabius calls the U.S."""
						    """ Ambassador, they respond to a real discovery, which is that of the scale of U.S. surveillance on all"""
						    """ communications in France.""",
						]

						__lowerCAmelCase						 =tokenizer.batch_decode(
						    hypotheses_batch.tolist()					,						clean_up_tokenization_spaces=snake_case_					,						skip_special_tokens=snake_case_)
						assert generated == expected_en









from collections.abc import Sequence
from queue import Queue






class     __a			:



	def __init__(    self				:     str					,						snake_case_				:     List[str]					,						snake_case_				:     Tuple					,						snake_case_				:     Tuple					,						snake_case_				:     Optional[Any]=None					,						snake_case_				:     Dict=None)->				Optional[int]:
						__lowerCAmelCase						 =start
						__lowerCAmelCase						 =end
						__lowerCAmelCase						 =val
						__lowerCAmelCase						 =(start + end) // 2
						__lowerCAmelCase						 =left
						__lowerCAmelCase						 =right



	def __repr__(    self				:     List[Any])->				Dict:
						return F"""SegmentTreeNode(start={self.start}, end={self.end}, val={self.val})"""






class     __a			:



	def __init__(    self				:     List[str]					,						snake_case_				:     Sequence					,						snake_case_				:     int)->				str:
						__lowerCAmelCase						 =collection
						__lowerCAmelCase						 =function
						if self.collection:
											__lowerCAmelCase						 =self._build_tree(0					,						len(snake_case_) - 1)



	def 		UpperCamelCase				(    self				:     Dict					,						snake_case_				:     Tuple					,						snake_case_				:     Optional[int])->				Optional[int]:
						self._update_tree(self.root					,						snake_case_					,						snake_case_)



	def 		UpperCamelCase				(    self				:     Optional[Any]					,						snake_case_				:     Any					,						snake_case_				:     Union[str, Any])->				Union[str, Any]:
						return self._query_range(self.root					,						snake_case_					,						snake_case_)



	def 		UpperCamelCase				(    self				:     List[str]					,						snake_case_				:     List[str]					,						snake_case_				:     List[str])->				List[Any]:
						if start == end:
											return SegmentTreeNode(snake_case_					,						snake_case_					,						self.collection[start])
						__lowerCAmelCase						 =(start + end) // 2
						__lowerCAmelCase						 =self._build_tree(snake_case_					,						snake_case_)
						__lowerCAmelCase						 =self._build_tree(mid + 1					,						snake_case_)
						return SegmentTreeNode(snake_case_					,						snake_case_					,						self.fn(left.val					,						right.val)					,						snake_case_					,						snake_case_)



	def 		UpperCamelCase				(    self				:     Dict					,						snake_case_				:     Tuple					,						snake_case_				:     int					,						snake_case_				:     int)->				List[Any]:
						if node.start == i and node.end == i:
											__lowerCAmelCase						 =val
											return
						if i <= node.mid:
											self._update_tree(node.left					,						snake_case_					,						snake_case_)
						else:
											self._update_tree(node.right					,						snake_case_					,						snake_case_)
						__lowerCAmelCase						 =self.fn(node.left.val					,						node.right.val)



	def 		UpperCamelCase				(    self				:     Tuple					,						snake_case_				:     str					,						snake_case_				:     str					,						snake_case_				:     List[Any])->				Optional[int]:
						if node.start == i and node.end == j:
											return node.val

						if i <= node.mid:
											if j <= node.mid:
																# range in left child tree
																return self._query_range(node.left					,						snake_case_					,						snake_case_)
											else:
																# range in left child tree and right child tree
																return self.fn(
																    self._query_range(node.left					,						snake_case_					,						node.mid)					,						self._query_range(node.right					,						node.mid + 1					,						snake_case_)					,						)
						else:
											# range in right child tree
											return self._query_range(node.right					,						snake_case_					,						snake_case_)



	def 		UpperCamelCase				(    self				:     List[str])->				Tuple:
						if self.root is not None:
											__lowerCAmelCase						 =Queue()
											queue.put(self.root)
											while not queue.empty():
																__lowerCAmelCase						 =queue.get()
																yield node

																if node.left is not None:
																					queue.put(node.left)

																if node.right is not None:
																					queue.put(node.right)


if __name__ == "__main__":
				import operator

				for fn in [operator.add, max, min]:
								print('''*''' * 50)
								lowercase_													=      SegmentTree([2, 1, 5, 3, 4], fn)
								for node in arr.traverse():
												print(node)
								print()

								arr.update(1, 5)
								for node in arr.traverse():
												print(node)
								print()

								print(arr.query_range(3, 4))  # 7
								print(arr.query_range(2, 2))  # 5
								print(arr.query_range(1, 3))  # 13
								print()




