






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    __lowercase   :







     '''simple docstring'''




     def __init__(					self							:      List[str]			,						UpperCamelCase_							:      Tuple			,						UpperCamelCase_							:      List[str]=13			,						UpperCamelCase_							:      int=7			,						UpperCamelCase_							:      List[Any]=True			,						UpperCamelCase_							:      Union[str, Any]=True			,						UpperCamelCase_							:      int=True			,						UpperCamelCase_							:      Optional[int]=True			,						UpperCamelCase_							:      int=99			,						UpperCamelCase_							:      Tuple=32			,						UpperCamelCase_							:      Tuple=2			,						UpperCamelCase_							:      Any=4			,						UpperCamelCase_							:      Union[str, Any]=37			,						UpperCamelCase_							:      Optional[Any]="gelu"			,						UpperCamelCase_							:      str=0.1			,						UpperCamelCase_							:      Optional[int]=0.1			,						UpperCamelCase_							:      List[Any]=512			,						UpperCamelCase_							:      int=16			,						UpperCamelCase_							:      Tuple=2			,						UpperCamelCase_							:      Optional[Any]=0.02			,						UpperCamelCase_							:      Any=3			,						UpperCamelCase_							:      Tuple=4			,						UpperCamelCase_							:      int=None			,						):


         """simple docstring"""



         __A       =						parent
         __A       =						13
         __A       =						7
         __A       =						True
         __A       =						True
         __A       =						True
         __A       =						True
         __A       =						99
         __A       =						384
         __A       =						2
         __A       =						4
         __A       =						37
         __A       =						"""gelu"""
         __A       =						0.1
         __A       =						0.1
         __A       =						512
         __A       =						16
         __A       =						2
         __A       =						0.02
         __A       =						3
         __A       =						4
         __A       =						128
         __A       =						2
         __A       =						9
         __A       =						1
         __A       =						None




     def 		lowerCAmelCase_  (					self							:      Dict					):


         """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       =						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							:      int			,						UpperCamelCase_							:      Union[str, Any]			,						UpperCamelCase_							:      Optional[int]			,						UpperCamelCase_							:      Optional[Any]			,						UpperCamelCase_							:      List[str]			,						UpperCamelCase_							:      int			,						UpperCamelCase_							:      int			,						UpperCamelCase_							:      List[Any]					):


         """simple docstring"""



         __A       =						TFConvBertModel(config=UpperCamelCase_					)
         __A       =						{"""input_ids""": input_ids, """attention_mask""": input_mask, """token_type_ids""": token_type_ids}

         __A       =						[input_ids, input_mask]
         __A       =						model(UpperCamelCase_					)

         __A       =						model(UpperCamelCase_					)

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




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


         """simple docstring"""



         __A       =						TFConvBertForMaskedLM(config=UpperCamelCase_					)
         __A       =						{
             """input_ids""": input_ids,
             """attention_mask""": input_mask,
             """token_type_ids""": token_type_ids,
         }
         __A       =						model(UpperCamelCase_					)
         self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.seq_length, self.vocab_size)					)




     def 		lowerCAmelCase_  (					self							:      int			,						UpperCamelCase_							:      Union[str, Any]			,						UpperCamelCase_							:      Any			,						UpperCamelCase_							:      str			,						UpperCamelCase_							:      List[str]			,						UpperCamelCase_							:      Any			,						UpperCamelCase_							:      int			,						UpperCamelCase_							:      Tuple					):


         """simple docstring"""



         __A       =						self.num_labels
         __A       =						TFConvBertForSequenceClassification(config=UpperCamelCase_					)
         __A       =						{
             """input_ids""": input_ids,
             """attention_mask""": input_mask,
             """token_type_ids""": token_type_ids,
         }

         __A       =						model(UpperCamelCase_					)
         self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.num_labels)					)




     def 		lowerCAmelCase_  (					self							:      Tuple			,						UpperCamelCase_							:      Tuple			,						UpperCamelCase_							:      Dict			,						UpperCamelCase_							:      int			,						UpperCamelCase_							:      int			,						UpperCamelCase_							:      Dict			,						UpperCamelCase_							:      Optional[int]			,						UpperCamelCase_							:      Union[str, Any]					):


         """simple docstring"""



         __A       =						self.num_choices
         __A       =						TFConvBertForMultipleChoice(config=UpperCamelCase_					)
         __A       =						tf.tile(tf.expand_dims(UpperCamelCase_			,						1					)			,						(1, self.num_choices, 1)					)
         __A       =						tf.tile(tf.expand_dims(UpperCamelCase_			,						1					)			,						(1, self.num_choices, 1)					)
         __A       =						tf.tile(tf.expand_dims(UpperCamelCase_			,						1					)			,						(1, self.num_choices, 1)					)
         __A       =						{
             """input_ids""": multiple_choice_inputs_ids,
             """attention_mask""": multiple_choice_input_mask,
             """token_type_ids""": multiple_choice_token_type_ids,
         }
         __A       =						model(UpperCamelCase_					)
         self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.num_choices)					)




     def 		lowerCAmelCase_  (					self							:      str			,						UpperCamelCase_							:      Tuple			,						UpperCamelCase_							:      List[Any]			,						UpperCamelCase_							:      Union[str, Any]			,						UpperCamelCase_							:      str			,						UpperCamelCase_							:      Union[str, Any]			,						UpperCamelCase_							:      int			,						UpperCamelCase_							:      List[Any]					):


         """simple docstring"""



         __A       =						self.num_labels
         __A       =						TFConvBertForTokenClassification(config=UpperCamelCase_					)
         __A       =						{
             """input_ids""": input_ids,
             """attention_mask""": input_mask,
             """token_type_ids""": token_type_ids,
         }
         __A       =						model(UpperCamelCase_					)
         self.parent.assertEqual(result.logits.shape			,						(self.batch_size, self.seq_length, self.num_labels)					)




     def 		lowerCAmelCase_  (					self							:      Optional[Any]			,						UpperCamelCase_							:      Optional[int]			,						UpperCamelCase_							:      Union[str, Any]			,						UpperCamelCase_							:      List[Any]			,						UpperCamelCase_							:      Optional[Any]			,						UpperCamelCase_							:      str			,						UpperCamelCase_							:      Optional[Any]			,						UpperCamelCase_							:      Union[str, Any]					):


         """simple docstring"""



         __A       =						TFConvBertForQuestionAnswering(config=UpperCamelCase_					)
         __A       =						{
             """input_ids""": input_ids,
             """attention_mask""": input_mask,
             """token_type_ids""": token_type_ids,
         }

         __A       =						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							:      str					):


         """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_tf
class    __lowercase   (						lowercase_      ,   lowercase_      ,   unittest.TestCase	):







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




     def 		lowerCAmelCase_  (					self							:      Tuple					):


         """simple docstring"""



         __A       =						TFConvBertModelTester(self					)
         __A       =						ConfigTester(self			,						config_class=UpperCamelCase_			,						hidden_size=37					)




     def 		lowerCAmelCase_  (					self							:      str					):


         """simple docstring"""



         self.config_tester.run_common_tests()




     def 		lowerCAmelCase_  (					self							:      List[str]					):


         """simple docstring"""



         __A       =						self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*UpperCamelCase_					)




     def 		lowerCAmelCase_  (					self							:      List[Any]					):


         """simple docstring"""



         __A       =						self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_masked_lm(*UpperCamelCase_					)




     def 		lowerCAmelCase_  (					self							:      int					):


         """simple docstring"""



         __A       =						self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_multiple_choice(*UpperCamelCase_					)




     def 		lowerCAmelCase_  (					self							:      int					):


         """simple docstring"""



         __A       =						self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_question_answering(*UpperCamelCase_					)




     def 		lowerCAmelCase_  (					self							:      Tuple					):


         """simple docstring"""



         __A       =						self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_sequence_classification(*UpperCamelCase_					)




     def 		lowerCAmelCase_  (					self							:      str					):


         """simple docstring"""



         __A       =						self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_token_classification(*UpperCamelCase_					)




     @slow
     def 		lowerCAmelCase_  (					self							:      Optional[Any]					):


         """simple docstring"""



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

         if hasattr(UpperCamelCase_			,						"""use_cache"""					):
             __A       =						True

         __A       =						getattr(self.model_tester			,						"""encoder_seq_length"""			,						self.model_tester.seq_length					)
         __A       =						getattr(self.model_tester			,						"""key_length"""			,						UpperCamelCase_					)

         for model_class in self.all_model_classes:
             __A       =						self._prepare_for_class(UpperCamelCase_			,						UpperCamelCase_					)
             __A       =						model_class(UpperCamelCase_					)
             __A       =						len(model(UpperCamelCase_					)					)

             with tempfile.TemporaryDirectory() as tmpdirname:
                 model.save_pretrained(UpperCamelCase_			,						saved_model=UpperCamelCase_					)
                 __A       =						os.path.join(UpperCamelCase_			,						"""saved_model"""			,						"""1"""					)
                 __A       =						tf.keras.models.load_model(UpperCamelCase_					)
                 __A       =						model(UpperCamelCase_					)

                 if self.is_encoder_decoder:
                     __A       =						outputs["""encoder_hidden_states"""]
                     __A       =						outputs["""encoder_attentions"""]
                 else:
                     __A       =						outputs["""hidden_states"""]
                     __A       =						outputs["""attentions"""]

                 self.assertEqual(len(UpperCamelCase_					)			,						UpperCamelCase_					)

                 __A       =						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							:      Tuple					):


         """simple docstring"""



         __A       =						TFConvBertModel.from_pretrained("""YituTech/conv-bert-base"""					)
         self.assertIsNotNone(UpperCamelCase_					)





     def 		lowerCAmelCase_  (					self							:      List[str]					):


         """simple docstring"""



         __A     ,						__A       =						self.model_tester.prepare_config_and_inputs_for_common()
         __A       =						True
         __A       =						getattr(self.model_tester			,						"""decoder_seq_length"""			,						self.model_tester.seq_length					)
         __A       =						getattr(self.model_tester			,						"""encoder_seq_length"""			,						self.model_tester.seq_length					)
         __A       =						getattr(self.model_tester			,						"""key_length"""			,						UpperCamelCase_					)
         __A       =						getattr(self.model_tester			,						"""key_length"""			,						UpperCamelCase_					)

         def check_decoder_attentions_output(UpperCamelCase_							:      List[str]					):
             __A       =						len(UpperCamelCase_					)
             self.assertEqual(out_len % 2			,						0					)
             __A       =						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(UpperCamelCase_							:      Optional[int]					):
             __A       =						[
                 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:
             __A       =						True
             __A       =						False
             __A       =						model_class(UpperCamelCase_					)
             __A       =						model(self._prepare_for_class(UpperCamelCase_			,						UpperCamelCase_					)					)
             __A       =						len(UpperCamelCase_					)
             self.assertEqual(config.output_hidden_states			,						UpperCamelCase_					)
             check_encoder_attentions_output(UpperCamelCase_					)

             if self.is_encoder_decoder:
                 __A       =						model_class(UpperCamelCase_					)
                 __A       =						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"]
             __A       =						True
             __A       =						model_class(UpperCamelCase_					)
             __A       =						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
             __A       =						True
             __A       =						True
             __A       =						model_class(UpperCamelCase_					)
             __A       =						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    __lowercase   (						unittest.TestCase	):







     '''simple docstring'''




     @slow
     def 		lowerCAmelCase_  (					self							:      Union[str, Any]					):


         """simple docstring"""



         __A       =						TFConvBertModel.from_pretrained("""YituTech/conv-bert-base"""					)
         __A       =						tf.constant([[0, 1, 2, 3, 4, 5]]					)
         __A       =						model(UpperCamelCase_					)[0]

         __A       =						[1, 6, 768]
         self.assertEqual(output.shape			,						UpperCamelCase_					)

         __A       =						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					)












import argparse
import os
import re

import packaging.version


__a   :							Tuple						= "examples/"
__a   :							Any						= {
    "examples": (re.compile(R"^check_min_version\(\"[^\"]+\"\)\s*$", re.MULTILINE), "check_min_version(\"VERSION\")\n"),
    "init": (re.compile(R"^__version__\s+=\s+\"([^\"]+)\"\s*$", re.MULTILINE), "__version__ = \"VERSION\"\n"),
    "setup": (re.compile(R"^(\s*)version\s*=\s*\"[^\"]+\",", re.MULTILINE), R"\1version=\"VERSION\","),
    "doc": (re.compile(R"^(\s*)release\s*=\s*\"[^\"]+\"$", re.MULTILINE), "release = \"VERSION\"\n"),
}
__a   :							Tuple						= {
    "init": "src/transformers/__init__.py",
    "setup": "setup.py",
}
__a   :							List[str]						= "README.md"



def       _SCREAMING_SNAKE_CASE    (			__lowercase :      str      ,					__lowercase :      List[str]      ,					__lowercase :      Optional[Any]     )    ->   List[Any]:





    """simple docstring"""

    with open(__lowercase      ,					"""r"""      ,					encoding="""utf-8"""      ,					newline="""\n"""     ) as f:
        __A       =						f.read()
    __A     ,						__A       =						REPLACE_PATTERNS[pattern]
    __A       =						replace.replace("""VERSION"""      ,					__lowercase     )
    __A       =						re_pattern.sub(__lowercase      ,					__lowercase     )
    with open(__lowercase      ,					"""w"""      ,					encoding="""utf-8"""      ,					newline="""\n"""     ) as f:
        f.write(__lowercase     )



def       _SCREAMING_SNAKE_CASE    (			__lowercase :      List[str]     )    ->   Dict:





    """simple docstring"""

    for folder, directories, fnames in os.walk(__lowercase     ):
        # Removing some of the folders with non-actively maintained examples from the walk
        if "research_projects" in directories:
            directories.remove("""research_projects"""     )
        if "legacy" in directories:
            directories.remove("""legacy"""     )
        for fname in fnames:
            if fname.endswith(""".py"""     ):
                update_version_in_file(os.path.join(__lowercase      ,					__lowercase     )      ,					__lowercase      ,					pattern="""examples"""     )



def       _SCREAMING_SNAKE_CASE    (			__lowercase :      Any      ,					__lowercase :      Optional[int]=False     )    ->   Dict:





    """simple docstring"""

    for pattern, fname in REPLACE_FILES.items():
        update_version_in_file(__lowercase      ,					__lowercase      ,					__lowercase     )
    if not patch:
        update_version_in_examples(__lowercase     )



def       _SCREAMING_SNAKE_CASE    (			)    ->   Union[str, Any]:





    """simple docstring"""

    __A       =						"""🤗 Transformers currently provides the following architectures"""
    __A       =						"""1. Want to contribute a new model?"""
    with open(__lowercase      ,					"""r"""      ,					encoding="""utf-8"""      ,					newline="""\n"""     ) as f:
        __A       =						f.readlines()

    # Find the start of the list.
    __A       =						0
    while not lines[start_index].startswith(_start_prompt     ):
        start_index += 1
    start_index += 1

    __A       =						start_index
    # Update the lines in the model list.
    while not lines[index].startswith(_end_prompt     ):
        if lines[index].startswith("""1."""     ):
            __A       =						lines[index].replace(
                """https://huggingface.co/docs/transformers/main/model_doc"""      ,					"""https://huggingface.co/docs/transformers/model_doc"""      ,					)
        index += 1

    with open(__lowercase      ,					"""w"""      ,					encoding="""utf-8"""      ,					newline="""\n"""     ) as f:
        f.writelines(__lowercase     )



def       _SCREAMING_SNAKE_CASE    (			)    ->   Dict:





    """simple docstring"""

    with open(REPLACE_FILES["""init"""]      ,					"""r"""     ) as f:
        __A       =						f.read()
    __A       =						REPLACE_PATTERNS["""init"""][0].search(__lowercase     ).groups()[0]
    return packaging.version.parse(__lowercase     )



def       _SCREAMING_SNAKE_CASE    (			__lowercase :      str=False     )    ->   Optional[Any]:





    """simple docstring"""

    __A       =						get_version()
    if patch and default_version.is_devrelease:
        raise ValueError("""Can't create a patch version from the dev branch, checkout a released version!"""     )
    if default_version.is_devrelease:
        __A       =						default_version.base_version
    elif patch:
        __A       =						f"{default_version.major}.{default_version.minor}.{default_version.micro + 1}"
    else:
        __A       =						f"{default_version.major}.{default_version.minor + 1}.0"

    # Now let's ask nicely if that's the right one.
    __A       =						input(f"Which version are you releasing? [{default_version}]"     )
    if len(__lowercase     ) == 0:
        __A       =						default_version

    print(f"Updating version to {version}."     )
    global_version_update(__lowercase      ,					patch=__lowercase     )
    if not patch:
        print("""Cleaning main README, don't forget to run `make fix-copies`."""     )
        clean_main_ref_in_model_list()



def       _SCREAMING_SNAKE_CASE    (			)    ->   List[str]:





    """simple docstring"""

    __A       =						get_version()
    __A       =						f"{current_version.major}.{current_version.minor + 1}.0.dev0"
    __A       =						current_version.base_version

    # Check with the user we got that right.
    __A       =						input(f"Which version are we developing now? [{dev_version}]"     )
    if len(__lowercase     ) == 0:
        __A       =						dev_version

    print(f"Updating version to {version}."     )
    global_version_update(__lowercase     )
    print("""Cleaning main README, don't forget to run `make fix-copies`."""     )
    clean_main_ref_in_model_list()


if __name__ == "__main__":
  __a   :							str						= argparse.ArgumentParser()
  parser.add_argument("--post_release", action="store_true", help="Whether this is pre or post release.")
  parser.add_argument("--patch", action="store_true", help="Whether or not this is a patch release.")
  __a   :							Union[str, Any]						= parser.parse_args()
  if not args.post_release:
    pre_release_work(patch=args.patch)
  elif args.patch:
    print("Nothing to do after a patch :-)")
  else:
    post_release_work()




