





'''simple docstring'''




import os
import sys
import unittest


lowercase__   :				Any      =   os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, '''utils'''))

import get_test_info  # noqa: E402
from get_test_info import (  # noqa: E402
    get_model_to_test_mapping,
    get_model_to_tester_mapping,
    get_test_to_tester_mapping,
)


lowercase__   :				str      =   os.path.join('''tests''', '''models''', '''bert''', '''test_modeling_bert.py''')
lowercase__   :				List[str]      =   os.path.join('''tests''', '''models''', '''blip''', '''test_modeling_blip.py''')


class 			SCREAMING_SNAKE_CASE   (unittest.TestCase							):


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			str								=	get_test_to_tester_mapping(_UpperCAmelCase)
          __A						:			List[str]								=	get_test_to_tester_mapping(_UpperCAmelCase)

          __A						:			List[Any]								=	{'BertModelTest': 'BertModelTester'}

          __A						:			Union[str, Any]								=	{
              'BlipModelTest': 'BlipModelTester',
              'BlipTextImageModelTest': 'BlipTextImageModelsModelTester',
              'BlipTextModelTest': 'BlipTextModelTester',
              'BlipTextRetrievalModelTest': 'BlipTextRetrievalModelTester',
              'BlipVQAModelTest': 'BlipVQAModelTester',
              'BlipVisionModelTest': 'BlipVisionModelTester',
          }

          self.assertEqual(get_test_info.to_json(_UpperCAmelCase)						,     _UpperCAmelCase)
          self.assertEqual(get_test_info.to_json(_UpperCAmelCase)						,     _UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			Union[str, Any]								=	get_model_to_test_mapping(_UpperCAmelCase)
          __A						:			Tuple								=	get_model_to_test_mapping(_UpperCAmelCase)

          __A						:			Optional[Any]								=	{
              'BertForMaskedLM': ['BertModelTest'],
              'BertForMultipleChoice': ['BertModelTest'],
              'BertForNextSentencePrediction': ['BertModelTest'],
              'BertForPreTraining': ['BertModelTest'],
              'BertForQuestionAnswering': ['BertModelTest'],
              'BertForSequenceClassification': ['BertModelTest'],
              'BertForTokenClassification': ['BertModelTest'],
              'BertLMHeadModel': ['BertModelTest'],
              'BertModel': ['BertModelTest'],
          }

          __A						:			int								=	{
              'BlipForConditionalGeneration': ['BlipTextImageModelTest'],
              'BlipForImageTextRetrieval': ['BlipTextRetrievalModelTest'],
              'BlipForQuestionAnswering': ['BlipVQAModelTest'],
              'BlipModel': ['BlipModelTest'],
              'BlipTextModel': ['BlipTextModelTest'],
              'BlipVisionModel': ['BlipVisionModelTest'],
          }

          self.assertEqual(get_test_info.to_json(_UpperCAmelCase)						,     _UpperCAmelCase)
          self.assertEqual(get_test_info.to_json(_UpperCAmelCase)						,     _UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			Any								=	get_model_to_tester_mapping(_UpperCAmelCase)
          __A						:			str								=	get_model_to_tester_mapping(_UpperCAmelCase)

          __A						:			str								=	{
              'BertForMaskedLM': ['BertModelTester'],
              'BertForMultipleChoice': ['BertModelTester'],
              'BertForNextSentencePrediction': ['BertModelTester'],
              'BertForPreTraining': ['BertModelTester'],
              'BertForQuestionAnswering': ['BertModelTester'],
              'BertForSequenceClassification': ['BertModelTester'],
              'BertForTokenClassification': ['BertModelTester'],
              'BertLMHeadModel': ['BertModelTester'],
              'BertModel': ['BertModelTester'],
          }

          __A						:			Optional[Any]								=	{
              'BlipForConditionalGeneration': ['BlipTextImageModelsModelTester'],
              'BlipForImageTextRetrieval': ['BlipTextRetrievalModelTester'],
              'BlipForQuestionAnswering': ['BlipVQAModelTester'],
              'BlipModel': ['BlipModelTester'],
              'BlipTextModel': ['BlipTextModelTester'],
              'BlipVisionModel': ['BlipVisionModelTester'],
          }

          self.assertEqual(get_test_info.to_json(_UpperCAmelCase)						,     _UpperCAmelCase)
          self.assertEqual(get_test_info.to_json(_UpperCAmelCase)						,     _UpperCAmelCase)






'''simple docstring'''




import argparse


lowercase__   :				Any      =   '''docs/source/_static/js/custom.js'''






def 	_lowerCAmelCase      (  __snake_case  :			Union[str, Any]      )					->					str:
     with open(__snake_case			,							encoding='utf-8'			,							newline='\n'      ) as f:
          __A						:			Optional[Any]								=	f.readlines()
     __A						:			List[str]								=	0

     # First let's put the right version
     while not lines[index].startswith('const stableVersion ='      ):
          index += 1
     __A						:			Tuple								=	f'const stableVersion = "v{version}"\n'

     # Then update the dictionary
     while not lines[index].startswith('const versionMapping = {'      ):
          index += 1

     # We go until the end
     while not lines[index].startswith('}'      ):
          index += 1
     # We add the new version at the end
     lines[index - 1] += f'    "v{version}": "v{version}",\n'

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


if __name__ == "__main__":
  lowercase__   :				Optional[Any]      =   argparse.ArgumentParser()
  parser.add_argument('''--version''', help='''Release version.''')
  lowercase__   :				List[str]      =   parser.parse_args()
  update_custom_js(args.version)