






"""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       snake_case_       :



	"""simple docstring"""

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


					"""simple docstring"""

					A__							 =       parent
					A__							 =       batch_size
					A__							 =       seq_length
					A__							 =       is_training
					A__							 =       use_input_mask
					A__							 =       use_token_type_ids
					A__							 =       use_labels
					A__							 =       vocab_size
					A__							 =       hidden_size
					A__							 =       num_hidden_layers
					A__							 =       num_attention_heads
					A__							 =       intermediate_size
					A__							 =       hidden_act
					A__							 =       hidden_dropout_prob
					A__							 =       attention_probs_dropout_prob
					A__							 =       max_position_embeddings
					A__							 =       type_vocab_size
					A__							 =       type_sequence_label_size
					A__							 =       initializer_range
					A__							 =       num_labels
					A__							 =       num_choices
					A__							 =       scope


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

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

					A__							 =       None
					if self.use_input_mask:
									A__							 =       random_attention_mask([self.batch_size, self.seq_length]						)

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

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

					A__							 =       self.get_config()

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


	def       _UpperCAmelCase						(      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=__UpperCamelCase  ,					initializer_range=self.initializer_range  ,					)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					(
					    (
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			
					)							 =       self.prepare_config_and_inputs()

					A__							 =       True
					A__							 =       floats_tensor([self.batch_size, self.seq_length, self.hidden_size]						)
					A__							 =       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       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       NezhaModel(config=__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase						)
					A__							 =       model(__UpperCamelCase  ,					token_type_ids=__UpperCamelCase						)
					A__							 =       model(__UpperCamelCase						)
					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       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					):


					"""simple docstring"""

					A__							 =       True
					A__							 =       NezhaModel(__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(
					    __UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					encoder_hidden_states=__UpperCamelCase  ,					encoder_attention_mask=__UpperCamelCase  ,					)
					A__							 =       model(
					    __UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					encoder_hidden_states=__UpperCamelCase  ,					)
					A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase						)
					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       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       NezhaForMaskedLM(config=__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					labels=__UpperCamelCase						)
					self.parent.assertEqual(result.logits.shape  ,					(self.batch_size, self.seq_length, self.vocab_size)						)


	def       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       NezhaForNextSentencePrediction(config=__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(
					    __UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					labels=__UpperCamelCase  ,					)
					self.parent.assertEqual(result.logits.shape  ,					(self.batch_size, 2)						)


	def       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       NezhaForPreTraining(config=__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(
					    __UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					labels=__UpperCamelCase  ,					next_sentence_label=__UpperCamelCase  ,					)
					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       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       NezhaForQuestionAnswering(config=__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(
					    __UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					start_positions=__UpperCamelCase  ,					end_positions=__UpperCamelCase  ,					)
					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  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       self.num_labels
					A__							 =       NezhaForSequenceClassification(__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					labels=__UpperCamelCase						)
					self.parent.assertEqual(result.logits.shape  ,					(self.batch_size, self.num_labels)						)


	def       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

					A__							 =       self.num_labels
					A__							 =       NezhaForTokenClassification(config=__UpperCamelCase						)
					model.to(__UpperCamelCase						)
					model.eval()
					A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase  ,					token_type_ids=__UpperCamelCase  ,					labels=__UpperCamelCase						)
					self.parent.assertEqual(result.logits.shape  ,					(self.batch_size, self.seq_length, self.num_labels)						)


	def       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a  ,					__a						):


					"""simple docstring"""

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






	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

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





@require_torch
class       snake_case_       (    _UpperCAmelCase    ,							_UpperCAmelCase    ,							_UpperCAmelCase    ,							unittest.TestCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							List[str]   			=					(
	    (
	        NezhaModel,
	        NezhaForMaskedLM,
	        NezhaForMultipleChoice,
	        NezhaForNextSentencePrediction,
	        NezhaForPreTraining,
	        NezhaForQuestionAnswering,
	        NezhaForSequenceClassification,
	        NezhaForTokenClassification,
	    )
	    if is_torch_available()
	    else ()
	)
	SCREAMING_SNAKE_CASE_:							Union[str, Any]   			=					(
	    {
	        'feature-extraction': NezhaModel,
	        'fill-mask': NezhaForMaskedLM,
	        'question-answering': NezhaForQuestionAnswering,
	        'text-classification': NezhaForSequenceClassification,
	        'token-classification': NezhaForTokenClassification,
	        'zero-shot': NezhaForSequenceClassification,
	    }
	    if is_torch_available()
	    else {}
	)
	SCREAMING_SNAKE_CASE_:							int   			=					True


	def       _UpperCAmelCase						(      self  ,					__a  ,					__a  ,					__a=False						):


					"""simple docstring"""

					A__							 =       super()._prepare_for_class(__UpperCamelCase  ,					__UpperCamelCase  ,					return_labels=__UpperCamelCase						)

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


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       NezhaModelTester(self						)
					A__							 =       ConfigTester(self  ,					config_class=__UpperCamelCase  ,					hidden_size=37						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					self.config_tester.run_common_tests()


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_model(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs_for_decoder()
					self.model_tester.create_and_check_model_as_decoder(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					(
					    (
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			(
					    A__
					) ,			
					)							 =       self.model_tester.prepare_config_and_inputs_for_decoder()

					A__							 =       None

					self.model_tester.create_and_check_model_as_decoder(
					    __UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					__UpperCamelCase  ,					)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_masked_lm(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_multiple_choice(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_next_sequence_prediction(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_pretraining(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_question_answering(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_sequence_classification(*__UpperCamelCase						)


	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_token_classification(*__UpperCamelCase						)


	@slow
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					for model_name in NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
									A__							 =       NezhaModel.from_pretrained(__UpperCamelCase						)
									self.assertIsNotNone(__UpperCamelCase						)






	@slow
	@require_torch_gpu
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__ ,			A__							 =       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

									A__							 =       True
									A__							 =       model_class(config=__UpperCamelCase						)

									A__							 =       self._prepare_for_class(__UpperCamelCase  ,					__UpperCamelCase						)
									A__							 =       torch.jit.trace(
									    __UpperCamelCase  ,					(inputs_dict['input_ids'].to('cpu'						), inputs_dict['attention_mask'].to('cpu'						))						)

									with tempfile.TemporaryDirectory() as tmp:
													torch.jit.save(__UpperCamelCase  ,					os.path.join(__UpperCamelCase  ,					'bert.pt'						)						)
													A__							 =       torch.jit.load(os.path.join(__UpperCamelCase  ,					'bert.pt'						)  ,					map_location=__UpperCamelCase						)
													loaded(inputs_dict['input_ids'].to(__UpperCamelCase						)  ,					inputs_dict['attention_mask'].to(__UpperCamelCase						)						)





@require_torch
class       snake_case_       (    unittest.TestCase       ):



	"""simple docstring"""

	@slow
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       NezhaModel.from_pretrained('sijunhe/nezha-cn-base'						)
					A__							 =       torch.tensor([[0, 1, 2, 3, 4, 5]]						)
					A__							 =       torch.tensor([[0, 1, 1, 1, 1, 1]]						)
					with torch.no_grad():
									A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase						)[0]
					A__							 =       torch.Size((1, 6, 768)						)
					self.assertEqual(output.shape  ,					__UpperCamelCase						)
					A__							 =       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]  ,					__UpperCamelCase  ,					atol=1E-4						)						)






	@slow
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       NezhaForMaskedLM.from_pretrained('sijunhe/nezha-cn-base'						)
					A__							 =       torch.tensor([[0, 1, 2, 3, 4, 5]]						)
					A__							 =       torch.tensor([[1, 1, 1, 1, 1, 1]]						)
					with torch.no_grad():
									A__							 =       model(__UpperCamelCase  ,					attention_mask=__UpperCamelCase						)[0]
					A__							 =       torch.Size((1, 6, 2_1128)						)
					self.assertEqual(output.shape  ,					__UpperCamelCase						)
					A__							 =       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]  ,					__UpperCamelCase  ,					atol=1E-4						)						)










"""simple docstring"""






import argparse
import logging
import pickle
import random
import time

import numpy as np

from transformers import BertTokenizer, GPTaTokenizer, RobertaTokenizer


logging.basicConfig(
    format='''%(asctime)s - %(levelname)s - %(name)s - %(message)s''', datefmt='''%m/%d/%Y %H:%M:%S''', level=logging.INFO
)
SCREAMING_SNAKE_CASE						:						Optional[int]					   =       logging.getLogger(__name__)



def  __lowerCamelCase					(					):
				A__							 =       argparse.ArgumentParser(
				    description='Preprocess the data to avoid re-doing it several times by (tokenization + token_to_ids).'				)
				parser.add_argument('--file_path'       ,type=lowerCAmelCase__       ,default='data/dump.txt'       ,help='The path to the data.'				)
				parser.add_argument('--tokenizer_type'       ,type=lowerCAmelCase__       ,default='bert'       ,choices=['bert', 'roberta', 'gpt2']				)
				parser.add_argument('--tokenizer_name'       ,type=lowerCAmelCase__       ,default='bert-base-uncased'       ,help='The tokenizer to use.'				)
				parser.add_argument('--dump_file'       ,type=lowerCAmelCase__       ,default='data/dump'       ,help='The dump file prefix.'				)
				A__							 =       parser.parse_args()

				logger.info(f'''Loading Tokenizer ({args.tokenizer_name})'''				)
				if args.tokenizer_type == "bert":
								A__							 =       BertTokenizer.from_pretrained(args.tokenizer_name				)
								A__							 =       tokenizer.special_tokens_map['cls_token']  # `[CLS]`
								A__							 =       tokenizer.special_tokens_map['sep_token']  # `[SEP]`
				elif args.tokenizer_type == "roberta":
								A__							 =       RobertaTokenizer.from_pretrained(args.tokenizer_name				)
								A__							 =       tokenizer.special_tokens_map['cls_token']  # `<s>`
								A__							 =       tokenizer.special_tokens_map['sep_token']  # `</s>`
				elif args.tokenizer_type == "gpt2":
								A__							 =       GPTaTokenizer.from_pretrained(args.tokenizer_name				)
								A__							 =       tokenizer.special_tokens_map['bos_token']  # `<|endoftext|>`
								A__							 =       tokenizer.special_tokens_map['eos_token']  # `<|endoftext|>`

				logger.info(f'''Loading text from {args.file_path}'''				)
				with open(args.file_path       ,'r'       ,encoding='utf8'				) as fp:
								A__							 =       fp.readlines()

				logger.info('Start encoding'				)
				logger.info(f'''{len(lowerCAmelCase__				)} examples to process.'''				)

				A__							 =       []
				A__							 =       0
				A__							 =       1_0000
				A__							 =       time.time()
				for text in data:
								A__							 =       f'''{bos} {text.strip()} {sep}'''
								A__							 =       tokenizer.encode(lowerCAmelCase__       ,add_special_tokens=lowerCAmelCase__				)
								rslt.append(lowerCAmelCase__				)

								iter += 1
								if iter % interval == 0:
												A__							 =       time.time()
												logger.info(f'''{iter} examples processed. - {(end-start):.2f}s/{interval}expl'''				)
												A__							 =       time.time()
				logger.info('Finished binarization'				)
				logger.info(f'''{len(lowerCAmelCase__				)} examples processed.'''				)

				A__							 =       f'''{args.dump_file}.{args.tokenizer_name}.pickle'''
				A__							 =       tokenizer.vocab_size
				if vocab_size < (1 << 16):
								A__							 =       [np.uintaa(lowerCAmelCase__				) for d in rslt]
				else:
								A__							 =       [np.intaa(lowerCAmelCase__				) for d in rslt]
				random.shuffle(rslt_				)
				logger.info(f'''Dump to {dp_file}'''				)
				with open(lowerCAmelCase__       ,'wb'				) as handle:
								pickle.dump(rslt_       ,lowerCAmelCase__       ,protocol=pickle.HIGHEST_PROTOCOL				)


if __name__ == "__main__":
					main()


