
from __future__ import annotations

import os
import tempfile
import unittest

from transformers import ConvBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
		import tensorflow as tf

		from transformers import (
		    TFConvBertForMaskedLM,
		    TFConvBertForMultipleChoice,
		    TFConvBertForQuestionAnswering,
		    TFConvBertForSequenceClassification,
		    TFConvBertForTokenClassification,
		    TFConvBertModel,
		)




class 				lowerCamelCase__							:




	'''simple docstring'''




	def __init__(      self	:int  ,     a	:List[str]  ,     a	:str=1_3  ,     a	:Tuple=7  ,     a	:List[str]=True  ,     a	:List[Any]=True  ,     a	:Dict=True  ,     a	:Any=True  ,     a	:int=9_9  ,     a	:Dict=3_2  ,     a	:Tuple=2  ,     a	:Tuple=4  ,     a	:Optional[int]=3_7  ,     a	:Optional[int]="gelu"  ,     a	:List[str]=0.1  ,     a	:Union[str, Any]=0.1  ,     a	:List[str]=5_1_2  ,     a	:Tuple=1_6  ,     a	:Tuple=2  ,     a	:Dict=0.02  ,     a	:Optional[int]=3  ,     a	:List[Any]=4  ,     a	:Union[str, Any]=None  ,     )	->				Dict:
								__UpperCamelCase			:     Any         =      parent
								__UpperCamelCase			:     Tuple         =      1_3
								__UpperCamelCase			:     List[Any]         =      7
								__UpperCamelCase			:     Any         =      True
								__UpperCamelCase			:     Optional[int]         =      True
								__UpperCamelCase			:     Optional[Any]         =      True
								__UpperCamelCase			:     Optional[Any]         =      True
								__UpperCamelCase			:     int         =      9_9
								__UpperCamelCase			:     Dict         =      3_8_4
								__UpperCamelCase			:     List[str]         =      2
								__UpperCamelCase			:     Any         =      4
								__UpperCamelCase			:     int         =      3_7
								__UpperCamelCase			:     int         =      '''gelu'''
								__UpperCamelCase			:     List[Any]         =      0.1
								__UpperCamelCase			:     Any         =      0.1
								__UpperCamelCase			:     Dict         =      5_1_2
								__UpperCamelCase			:     List[Any]         =      1_6
								__UpperCamelCase			:     Optional[int]         =      2
								__UpperCamelCase			:     Optional[Any]         =      0.02
								__UpperCamelCase			:     Dict         =      3
								__UpperCamelCase			:     List[str]         =      4
								__UpperCamelCase			:     int         =      1_2_8
								__UpperCamelCase			:     List[str]         =      2
								__UpperCamelCase			:     int         =      9
								__UpperCamelCase			:     Tuple         =      1
								__UpperCamelCase			:     str         =      None







	def      _lowerCamelCase       (      self	:List[str]		)	->				int:
								__UpperCamelCase			:     str         =      ids_tensor([self.batch_size, self.seq_length]  ,     self.vocab_size		)

								__UpperCamelCase			:     Union[str, Any]         =      None
								if self.use_input_mask:
															__UpperCamelCase			:     Dict         =      random_attention_mask([self.batch_size, self.seq_length]		)

								__UpperCamelCase			:     List[str]         =      None
								if self.use_token_type_ids:
															__UpperCamelCase			:     Optional[int]         =      ids_tensor([self.batch_size, self.seq_length]  ,     self.type_vocab_size		)

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

								__UpperCamelCase			:     Dict         =      ConvBertConfig(
								    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  ,     initializer_range=self.initializer_range  ,     return_dict=UpperCAmelCase__  ,     )

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







	def      _lowerCamelCase       (      self	:Union[str, Any]  ,     a	:Dict  ,     a	:int  ,     a	:List[Any]  ,     a	:str  ,     a	:Union[str, Any]  ,     a	:int  ,     a	:Any		)	->				List[Any]:
								__UpperCamelCase			:     Tuple         =      TFConvBertModel(config=UpperCAmelCase__		)
								__UpperCamelCase			:     List[Any]         =      {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}

								__UpperCamelCase			:     Dict         =      [input_ids, input_mask]
								__UpperCamelCase			:     Tuple         =      model(UpperCAmelCase__		)

								__UpperCamelCase			:     Dict         =      model(UpperCAmelCase__		)

								self.parent.assertEqual(result.last_hidden_state.shape  ,     (self.batch_size, self.seq_length, self.hidden_size)		)







	def      _lowerCamelCase       (      self	:str  ,     a	:int  ,     a	:Any  ,     a	:Optional[Any]  ,     a	:int  ,     a	:List[Any]  ,     a	:Dict  ,     a	:Optional[Any]		)	->				Optional[Any]:
								__UpperCamelCase			:     Dict         =      TFConvBertForMaskedLM(config=UpperCAmelCase__		)
								__UpperCamelCase			:     str         =      {
								    '''input_ids''': input_ids,
								    '''attention_mask''': input_mask,
								    '''token_type_ids''': token_type_ids,
								}
								__UpperCamelCase			:     int         =      model(UpperCAmelCase__		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.seq_length, self.vocab_size)		)







	def      _lowerCamelCase       (      self	:Dict  ,     a	:int  ,     a	:Tuple  ,     a	:List[Any]  ,     a	:Optional[int]  ,     a	:List[str]  ,     a	:int  ,     a	:Any		)	->				Dict:
								__UpperCamelCase			:     str         =      self.num_labels
								__UpperCamelCase			:     Optional[Any]         =      TFConvBertForSequenceClassification(config=UpperCAmelCase__		)
								__UpperCamelCase			:     Optional[int]         =      {
								    '''input_ids''': input_ids,
								    '''attention_mask''': input_mask,
								    '''token_type_ids''': token_type_ids,
								}

								__UpperCamelCase			:     Optional[int]         =      model(UpperCAmelCase__		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.num_labels)		)







	def      _lowerCamelCase       (      self	:Optional[int]  ,     a	:str  ,     a	:int  ,     a	:Optional[Any]  ,     a	:Dict  ,     a	:Union[str, Any]  ,     a	:Union[str, Any]  ,     a	:str		)	->				Optional[int]:
								__UpperCamelCase			:     Optional[Any]         =      self.num_choices
								__UpperCamelCase			:     List[Any]         =      TFConvBertForMultipleChoice(config=UpperCAmelCase__		)
								__UpperCamelCase			:     Optional[int]         =      tf.tile(tf.expand_dims(UpperCAmelCase__  ,     1		)  ,     (1, self.num_choices, 1)		)
								__UpperCamelCase			:     List[Any]         =      tf.tile(tf.expand_dims(UpperCAmelCase__  ,     1		)  ,     (1, self.num_choices, 1)		)
								__UpperCamelCase			:     Optional[Any]         =      tf.tile(tf.expand_dims(UpperCAmelCase__  ,     1		)  ,     (1, self.num_choices, 1)		)
								__UpperCamelCase			:     str         =      {
								    '''input_ids''': multiple_choice_inputs_ids,
								    '''attention_mask''': multiple_choice_input_mask,
								    '''token_type_ids''': multiple_choice_token_type_ids,
								}
								__UpperCamelCase			:     List[str]         =      model(UpperCAmelCase__		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.num_choices)		)







	def      _lowerCamelCase       (      self	:int  ,     a	:Tuple  ,     a	:Optional[Any]  ,     a	:List[str]  ,     a	:Tuple  ,     a	:Union[str, Any]  ,     a	:Tuple  ,     a	:Dict		)	->				List[Any]:
								__UpperCamelCase			:     Optional[int]         =      self.num_labels
								__UpperCamelCase			:     Optional[Any]         =      TFConvBertForTokenClassification(config=UpperCAmelCase__		)
								__UpperCamelCase			:     Optional[Any]         =      {
								    '''input_ids''': input_ids,
								    '''attention_mask''': input_mask,
								    '''token_type_ids''': token_type_ids,
								}
								__UpperCamelCase			:     Optional[Any]         =      model(UpperCAmelCase__		)
								self.parent.assertEqual(result.logits.shape  ,     (self.batch_size, self.seq_length, self.num_labels)		)







	def      _lowerCamelCase       (      self	:List[str]  ,     a	:int  ,     a	:Optional[Any]  ,     a	:Dict  ,     a	:Union[str, Any]  ,     a	:List[Any]  ,     a	:Tuple  ,     a	:int		)	->				Optional[int]:
								__UpperCamelCase			:     int         =      TFConvBertForQuestionAnswering(config=UpperCAmelCase__		)
								__UpperCamelCase			:     Any         =      {
								    '''input_ids''': input_ids,
								    '''attention_mask''': input_mask,
								    '''token_type_ids''': token_type_ids,
								}

								__UpperCamelCase			:     Any         =      model(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      _lowerCamelCase       (      self	:Optional[int]		)	->				int:
								__UpperCamelCase			:     Any         =      self.prepare_config_and_inputs()
								(
								    __UpperCamelCase  
								)			:     str         =      config_and_inputs
								__UpperCamelCase			:     Dict         =      {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
								return config, inputs_dict




@require_tf
class 				lowerCamelCase__							(       lowercase__  ,		lowercase__  ,		unittest.TestCase):




	'''simple docstring'''




	_A			=  (
	    (
	        TFConvBertModel,
	        TFConvBertForMaskedLM,
	        TFConvBertForQuestionAnswering,
	        TFConvBertForSequenceClassification,
	        TFConvBertForTokenClassification,
	        TFConvBertForMultipleChoice,
	    )
	    if is_tf_available()
	    else ()
	)
	_A			=  (
	    {
	        'feature-extraction': TFConvBertModel,
	        'fill-mask': TFConvBertForMaskedLM,
	        'question-answering': TFConvBertForQuestionAnswering,
	        'text-classification': TFConvBertForSequenceClassification,
	        'token-classification': TFConvBertForTokenClassification,
	        'zero-shot': TFConvBertForSequenceClassification,
	    }
	    if is_tf_available()
	    else {}
	)
	_A			=  False
	_A			=  False
	_A			=  False







	def      _lowerCamelCase       (      self	:str		)	->				Optional[Any]:
								__UpperCamelCase			:     Tuple         =      TFConvBertModelTester(self		)
								__UpperCamelCase			:     Any         =      ConfigTester(self  ,     config_class=UpperCAmelCase__  ,     hidden_size=3_7		)







	def      _lowerCamelCase       (      self	:Union[str, Any]		)	->				Union[str, Any]:
								self.config_tester.run_common_tests()







	def      _lowerCamelCase       (      self	:Optional[Any]		)	->				Union[str, Any]:
								__UpperCamelCase			:     Dict         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*UpperCAmelCase__		)







	def      _lowerCamelCase       (      self	:List[str]		)	->				List[Any]:
								__UpperCamelCase			:     Optional[Any]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_masked_lm(*UpperCAmelCase__		)







	def      _lowerCamelCase       (      self	:List[str]		)	->				Tuple:
								__UpperCamelCase			:     Optional[Any]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_multiple_choice(*UpperCAmelCase__		)







	def      _lowerCamelCase       (      self	:Optional[Any]		)	->				Dict:
								__UpperCamelCase			:     List[str]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_question_answering(*UpperCAmelCase__		)







	def      _lowerCamelCase       (      self	:Any		)	->				int:
								__UpperCamelCase			:     Optional[Any]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_sequence_classification(*UpperCAmelCase__		)







	def      _lowerCamelCase       (      self	:Dict		)	->				List[Any]:
								__UpperCamelCase			:     Optional[int]         =      self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_token_classification(*UpperCAmelCase__		)







	@slow
	def      _lowerCamelCase       (      self	:Tuple		)	->				List[Any]:
								__UpperCamelCase			:     Tuple         =      self.model_tester.prepare_config_and_inputs_for_common()
								__UpperCamelCase			:     List[str]         =      True
								__UpperCamelCase			:     str         =      True

								if hasattr(UpperCAmelCase__  ,     "use_cache"		):
															__UpperCamelCase			:     List[Any]         =      True

								__UpperCamelCase			:     Tuple         =      getattr(self.model_tester  ,     "encoder_seq_length"  ,     self.model_tester.seq_length		)
								__UpperCamelCase			:     Dict         =      getattr(self.model_tester  ,     "key_length"  ,     UpperCAmelCase__		)

								for model_class in self.all_model_classes:
															__UpperCamelCase			:     Tuple         =      self._prepare_for_class(UpperCAmelCase__  ,     UpperCAmelCase__		)
															__UpperCamelCase			:     List[str]         =      model_class(UpperCAmelCase__		)
															__UpperCamelCase			:     int         =      len(model(UpperCAmelCase__		)		)

															with tempfile.TemporaryDirectory() as tmpdirname:
																						model.save_pretrained(UpperCAmelCase__  ,     saved_model=UpperCAmelCase__		)
																						__UpperCamelCase			:     Optional[int]         =      os.path.join(UpperCAmelCase__  ,     "saved_model"  ,     "1"		)
																						__UpperCamelCase			:     Any         =      tf.keras.models.load_model(UpperCAmelCase__		)
																						__UpperCamelCase			:     int         =      model(UpperCAmelCase__		)

																						if self.is_encoder_decoder:
																													__UpperCamelCase			:     List[Any]         =      outputs['''encoder_hidden_states''']
																													__UpperCamelCase			:     Optional[Any]         =      outputs['''encoder_attentions''']
																						else:
																													__UpperCamelCase			:     Dict         =      outputs['''hidden_states''']
																													__UpperCamelCase			:     Union[str, Any]         =      outputs['''attentions''']

																						self.assertEqual(len(UpperCAmelCase__		)  ,     UpperCAmelCase__		)

																						__UpperCamelCase			:     Optional[int]         =      getattr(
																						    self.model_tester  ,     "expected_num_hidden_layers"  ,     self.model_tester.num_hidden_layers + 1		)

																						self.assertEqual(len(UpperCAmelCase__		)  ,     UpperCAmelCase__		)
																						self.assertListEqual(
																						    list(output_hidden_states[0].shape[-2:]		)  ,     [self.model_tester.seq_length, self.model_tester.hidden_size]  ,     )

																						self.assertEqual(len(UpperCAmelCase__		)  ,     self.model_tester.num_hidden_layers		)
																						self.assertListEqual(
																						    list(output_attentions[0].shape[-3:]		)  ,     [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]  ,     )







	@slow
	def      _lowerCamelCase       (      self	:Any		)	->				Optional[int]:
								__UpperCamelCase			:     Union[str, Any]         =      TFConvBertModel.from_pretrained("YituTech/conv-bert-base"		)
								self.assertIsNotNone(UpperCAmelCase__		)







	def      _lowerCamelCase       (      self	:Optional[int]		)	->				Union[str, Any]:
								__UpperCamelCase			:     List[str]         =      self.model_tester.prepare_config_and_inputs_for_common()
								__UpperCamelCase			:     Dict         =      True
								__UpperCamelCase			:     Optional[int]         =      getattr(self.model_tester  ,     "decoder_seq_length"  ,     self.model_tester.seq_length		)
								__UpperCamelCase			:     Optional[Any]         =      getattr(self.model_tester  ,     "encoder_seq_length"  ,     self.model_tester.seq_length		)
								__UpperCamelCase			:     Dict         =      getattr(self.model_tester  ,     "key_length"  ,     UpperCAmelCase__		)
								__UpperCamelCase			:     List[Any]         =      getattr(self.model_tester  ,     "key_length"  ,     UpperCAmelCase__		)

								def check_decoder_attentions_output(a	:Union[str, Any]		):
															__UpperCamelCase			:     str         =      len(UpperCAmelCase__		)
															self.assertEqual(out_len % 2  ,     0		)
															__UpperCamelCase			:     Tuple         =      outputs.decoder_attentions
															self.assertEqual(len(UpperCAmelCase__		)  ,     self.model_tester.num_hidden_layers		)
															self.assertListEqual(
															    list(decoder_attentions[0].shape[-3:]		)  ,     [self.model_tester.num_attention_heads / 2, decoder_seq_length, decoder_key_length]  ,     )

								def check_encoder_attentions_output(a	:int		):
															__UpperCamelCase			:     Any         =      [
															    t.numpy() for t in (outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions)
															]
															self.assertEqual(len(UpperCAmelCase__		)  ,     self.model_tester.num_hidden_layers		)
															self.assertListEqual(
															    list(attentions[0].shape[-3:]		)  ,     [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]  ,     )

								for model_class in self.all_model_classes:
															__UpperCamelCase			:     int         =      True
															__UpperCamelCase			:     str         =      False
															__UpperCamelCase			:     int         =      model_class(UpperCAmelCase__		)
															__UpperCamelCase			:     Dict         =      model(self._prepare_for_class(UpperCAmelCase__  ,     UpperCAmelCase__		)		)
															__UpperCamelCase			:     Tuple         =      len(UpperCAmelCase__		)
															self.assertEqual(config.output_hidden_states  ,     UpperCAmelCase__		)
															check_encoder_attentions_output(UpperCAmelCase__		)

															if self.is_encoder_decoder:
																						__UpperCamelCase			:     Tuple         =      model_class(UpperCAmelCase__		)
																						__UpperCamelCase			:     Union[str, Any]         =      model(self._prepare_for_class(UpperCAmelCase__  ,     UpperCAmelCase__		)		)
																						self.assertEqual(config.output_hidden_states  ,     UpperCAmelCase__		)
																						check_decoder_attentions_output(UpperCAmelCase__		)

															# Check that output attentions can also be changed via the config
															del inputs_dict["output_attentions"]
															__UpperCamelCase			:     Optional[int]         =      True
															__UpperCamelCase			:     Optional[Any]         =      model_class(UpperCAmelCase__		)
															__UpperCamelCase			:     List[Any]         =      model(self._prepare_for_class(UpperCAmelCase__  ,     UpperCAmelCase__		)		)
															self.assertEqual(config.output_hidden_states  ,     UpperCAmelCase__		)
															check_encoder_attentions_output(UpperCAmelCase__		)

															# Check attention is always last and order is fine
															__UpperCamelCase			:     Any         =      True
															__UpperCamelCase			:     Dict         =      True
															__UpperCamelCase			:     Optional[Any]         =      model_class(UpperCAmelCase__		)
															__UpperCamelCase			:     Any         =      model(self._prepare_for_class(UpperCAmelCase__  ,     UpperCAmelCase__		)		)

															self.assertEqual(out_len + (2 if self.is_encoder_decoder else 1)  ,     len(UpperCAmelCase__		)		)
															self.assertEqual(model.config.output_hidden_states  ,     UpperCAmelCase__		)
															check_encoder_attentions_output(UpperCAmelCase__		)




@require_tf
class 				lowerCamelCase__							(       unittest.TestCase):




	'''simple docstring'''




	@slow
	def      _lowerCamelCase       (      self	:Optional[Any]		)	->				Optional[Any]:
								__UpperCamelCase			:     List[str]         =      TFConvBertModel.from_pretrained("YituTech/conv-bert-base"		)
								__UpperCamelCase			:     Optional[Any]         =      tf.constant([[0, 1, 2, 3, 4, 5]]		)
								__UpperCamelCase			:     List[str]         =      model(UpperCAmelCase__		)[0]

								__UpperCamelCase			:     Any         =      [1, 6, 7_6_8]
								self.assertEqual(output.shape  ,     UpperCAmelCase__		)

								__UpperCamelCase			:     int         =      tf.constant(
								    [
								        [
								            [-0.03475493, -0.4686034, -0.30638832],
								            [0.22637248, -0.26988646, -0.7423424],
								            [0.10324868, -0.45013508, -0.58280784],
								        ]
								    ]		)
								tf.debugging.assert_near(output[:, :3, :3]  ,     UpperCAmelCase__  ,     atol=1E-4		)



from __future__ import annotations

import math
from collections import Counter
from string import ascii_lowercase




def 			_SCREAMING_SNAKE_CASE      (	_lowerCamelCase				:    str)      ->					None:






							'''simple docstring'''





							__UpperCamelCase     ,		__UpperCamelCase			:     Optional[Any]         =      analyze_text(_lowerCamelCase)
							__UpperCamelCase			:     List[str]         =      list(" " + ascii_lowercase)
							# what is our total sum of probabilities.
							__UpperCamelCase			:     Any         =      sum(single_char_strings.values())

							# one length string
							__UpperCamelCase			:     Optional[Any]         =      0
							# for each alpha we go in our dict and if it is in it we calculate entropy
							for ch in my_alphas:
														if ch in single_char_strings:
																					__UpperCamelCase			:     List[Any]         =      single_char_strings[ch]
																					__UpperCamelCase			:     List[str]         =      my_str / all_sum
																					my_fir_sum += prob * math.loga(_lowerCamelCase)  # entropy formula.

    # print entropy
							print(F'{round(-1 * my_fir_sum):.1f}')

							# two len string
							__UpperCamelCase			:     Optional[Any]         =      sum(two_char_strings.values())
							__UpperCamelCase			:     Tuple         =      0
							# for each alpha (two in size) calculate entropy.
							for cha in my_alphas:
														for cha in my_alphas:
																					__UpperCamelCase			:     List[str]         =      cha + cha
																					if sequence in two_char_strings:
																												__UpperCamelCase			:     Optional[Any]         =      two_char_strings[sequence]
																												__UpperCamelCase			:     Any         =      int(_lowerCamelCase) / all_sum
																												my_sec_sum += prob * math.loga(_lowerCamelCase)

    # print second entropy
							print(F'{round(-1 * my_sec_sum):.1f}')

							# print the difference between them
							print(F'{round((-1 * my_sec_sum) - (-1 * my_fir_sum)):.1f}')




def 			_SCREAMING_SNAKE_CASE      (	_lowerCamelCase				:    str)      ->					tuple[dict, dict]:






							'''simple docstring'''





							__UpperCamelCase			:     Tuple         =      Counter()  # type: ignore
							__UpperCamelCase			:     Any         =      Counter()  # type: ignore
							single_char_strings[text[-1]] += 1

							# first case when we have space at start.
							two_char_strings[" " + text[0]] += 1
							for i in range(0		,						len(_lowerCamelCase) - 1):
														single_char_strings[text[i]] += 1
														two_char_strings[text[i : i + 2]] += 1
							return single_char_strings, two_char_strings




def 			_SCREAMING_SNAKE_CASE      (	)      ->					List[str]:






							'''simple docstring'''





							import doctest

							doctest.testmod()
							# text = (
							#     "Had repulsive dashwoods suspicion sincerity but advantage now him. Remark "
							#     "easily garret nor nay. Civil those mrs enjoy shy fat merry. You greatest "
							#     "jointure saw horrible. He private he on be imagine suppose. Fertile "
							#     "beloved evident through no service elderly is. Blind there if every no so "
							#     "at. Own neglected you preferred way sincerity delivered his attempted. To "
							#     "of message cottage windows do besides against uncivil.  Delightful "
							#     "unreserved impossible few estimating men favourable see entreaties. She "
							#     "propriety immediate was improving. He or entrance humoured likewise "
							#     "moderate. Much nor game son say feel. Fat make met can must form into "
							#     "gate. Me we offending prevailed discovery. "
							# )

							# calculate_prob(text)


if __name__ == "__main__":
		main()