

import json
import os
import re
import unittest

from transformers import CodeGenTokenizer, CodeGenTokenizerFast
from transformers.models.codegen.tokenization_codegen import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin



@require_tokenizers
class lowerCamelCase			(  lowerCAmelCase__	,						unittest.TestCase						):



			'''simple docstring'''






			__snake_case        =	CodeGenTokenizer
			__snake_case        =	CodeGenTokenizerFast
			__snake_case        =	True
			__snake_case        =	{"add_prefix_space": True}
			__snake_case        =	False


			def lowercase__						(				self	:						str			)      ->		Tuple:





									'''simple docstring'''
									super().setUp()

									# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
									A__					:       str     =[
									    """l""",
									    """o""",
									    """w""",
									    """e""",
									    """r""",
									    """s""",
									    """t""",
									    """i""",
									    """d""",
									    """n""",
									    """\u0120""",
									    """\u0120l""",
									    """\u0120n""",
									    """\u0120lo""",
									    """\u0120low""",
									    """er""",
									    """\u0120lowest""",
									    """\u0120newer""",
									    """\u0120wider""",
									    """<unk>""",
									    """<|endoftext|>""",
									]
									A__					:       Union[str, Any]     =dict(zip(_SCREAMING_SNAKE_CASE		,      range(len(_SCREAMING_SNAKE_CASE			)			)			)			)
									A__					:       str     =["""#version: 0.2""", """\u0120 l""", """\u0120l o""", """\u0120lo w""", """e r""", """"""]
									A__					:       Any     ={"""unk_token""": """<unk>"""}

									A__					:       Optional[Any]     =os.path.join(self.tmpdirname		,      VOCAB_FILES_NAMES["""vocab_file"""]			)
									A__					:       Any     =os.path.join(self.tmpdirname		,      VOCAB_FILES_NAMES["""merges_file"""]			)
									with open(self.vocab_file		,      """w"""		,      encoding="""utf-8"""			) as fp:
															fp.write(json.dumps(_SCREAMING_SNAKE_CASE			) + """\n"""			)
									with open(self.merges_file		,      """w"""		,      encoding="""utf-8"""			) as fp:
															fp.write("""\n""".join(_SCREAMING_SNAKE_CASE			)			)


			def lowercase__						(				self	:						Any		,      **lowerCAmelCase_	:						Dict			)      ->		List[Any]:





									'''simple docstring'''
									kwargs.update(self.special_tokens_map			)
									return CodeGenTokenizer.from_pretrained(self.tmpdirname		,      **_SCREAMING_SNAKE_CASE			)


			def lowercase__						(				self	:						Optional[Any]		,      **lowerCAmelCase_	:						Any			)      ->		Tuple:





									'''simple docstring'''
									kwargs.update(self.special_tokens_map			)
									return CodeGenTokenizerFast.from_pretrained(self.tmpdirname		,      **_SCREAMING_SNAKE_CASE			)


			def lowercase__						(				self	:						Optional[Any]		,      lowerCAmelCase_	:						str			)      ->		List[Any]:





									'''simple docstring'''
									A__					:       Optional[Any]     ="""lower newer"""
									A__					:       str     ="""lower newer"""
									return input_text, output_text


			def lowercase__						(				self	:						Any			)      ->		Dict:





									'''simple docstring'''
									A__					:       Optional[Any]     =CodeGenTokenizer(self.vocab_file		,      self.merges_file		,      **self.special_tokens_map			)
									A__					:       Optional[int]     ="""lower newer"""
									A__					:       Optional[int]     =["""\u0120low""", """er""", """\u0120""", """n""", """e""", """w""", """er"""]
									A__					:       Union[str, Any]     =tokenizer.tokenize(_SCREAMING_SNAKE_CASE		,      add_prefix_space=_SCREAMING_SNAKE_CASE			)
									self.assertListEqual(_SCREAMING_SNAKE_CASE		,      _SCREAMING_SNAKE_CASE			)

									A__					:       str     =tokens + [tokenizer.unk_token]
									A__					:       Tuple     =[14, 15, 10, 9, 3, 2, 15, 19]
									self.assertListEqual(tokenizer.convert_tokens_to_ids(_SCREAMING_SNAKE_CASE			)		,      _SCREAMING_SNAKE_CASE			)


			def lowercase__						(				self	:						Optional[Any]			)      ->		Any:





									'''simple docstring'''
									if not self.test_rust_tokenizer:
															return

									A__					:       Optional[int]     =self.get_tokenizer()
									A__					:       Tuple     =self.get_rust_tokenizer(add_prefix_space=_SCREAMING_SNAKE_CASE			)

									A__					:       List[str]     ="""lower newer"""

									# Testing tokenization
									A__					:       str     =tokenizer.tokenize(_SCREAMING_SNAKE_CASE		,      add_prefix_space=_SCREAMING_SNAKE_CASE			)
									A__					:       List[Any]     =rust_tokenizer.tokenize(_SCREAMING_SNAKE_CASE			)
									self.assertListEqual(_SCREAMING_SNAKE_CASE		,      _SCREAMING_SNAKE_CASE			)

									# Testing conversion to ids without special tokens
									A__					:       Union[str, Any]     =tokenizer.encode(_SCREAMING_SNAKE_CASE		,      add_special_tokens=_SCREAMING_SNAKE_CASE		,      add_prefix_space=_SCREAMING_SNAKE_CASE			)
									A__					:       str     =rust_tokenizer.encode(_SCREAMING_SNAKE_CASE		,      add_special_tokens=_SCREAMING_SNAKE_CASE			)
									self.assertListEqual(_SCREAMING_SNAKE_CASE		,      _SCREAMING_SNAKE_CASE			)

									# Testing conversion to ids with special tokens
									A__					:       Dict     =self.get_rust_tokenizer(add_prefix_space=_SCREAMING_SNAKE_CASE			)
									A__					:       str     =tokenizer.encode(_SCREAMING_SNAKE_CASE		,      add_prefix_space=_SCREAMING_SNAKE_CASE			)
									A__					:       Dict     =rust_tokenizer.encode(_SCREAMING_SNAKE_CASE			)
									self.assertListEqual(_SCREAMING_SNAKE_CASE		,      _SCREAMING_SNAKE_CASE			)

									# Testing the unknown token
									A__					:       Any     =tokens + [rust_tokenizer.unk_token]
									A__					:       Any     =[14, 15, 10, 9, 3, 2, 15, 19]
									self.assertListEqual(rust_tokenizer.convert_tokens_to_ids(_SCREAMING_SNAKE_CASE			)		,      _SCREAMING_SNAKE_CASE			)


			def lowercase__						(				self	:						Any		,      *lowerCAmelCase_	:						Optional[int]		,      **lowerCAmelCase_	:						List[str]			)      ->		Dict:





									'''simple docstring'''
									# It's very difficult to mix/test pretokenization with byte-level
									# And get both CodeGen and Roberta to work at the same time (mostly an issue of adding a space before the string)
									pass


			def lowercase__						(				self	:						Optional[Any]		,      lowerCAmelCase_	:						List[str]=15			)      ->		Union[str, Any]:





									'''simple docstring'''
									for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
															with self.subTest(f"{tokenizer.__class__.__name__} ({pretrained_name})"			):
																					A__					:       Optional[int]     =self.rust_tokenizer_class.from_pretrained(_SCREAMING_SNAKE_CASE		,      **_SCREAMING_SNAKE_CASE			)

																					# Simple input
																					A__					:       Union[str, Any]     ="""This is a simple input"""
																					A__					:       Optional[Any]     =["""This is a simple input 1""", """This is a simple input 2"""]
																					A__					:       List[Any]     =("""This is a simple input""", """This is a pair""")
																					A__					:       str     =[
																					    ("""This is a simple input 1""", """This is a simple input 2"""),
																					    ("""This is a simple pair 1""", """This is a simple pair 2"""),
																					]

																					# Simple input tests
																					self.assertRaises(_SCREAMING_SNAKE_CASE		,      tokenizer_r.encode		,      _SCREAMING_SNAKE_CASE		,      max_length=_SCREAMING_SNAKE_CASE		,      padding="""max_length"""			)

																					# Simple input
																					self.assertRaises(_SCREAMING_SNAKE_CASE		,      tokenizer_r.encode_plus		,      _SCREAMING_SNAKE_CASE		,      max_length=_SCREAMING_SNAKE_CASE		,      padding="""max_length"""			)

																					# Simple input
																					self.assertRaises(
																					    _SCREAMING_SNAKE_CASE		,      tokenizer_r.batch_encode_plus		,      _SCREAMING_SNAKE_CASE		,      max_length=_SCREAMING_SNAKE_CASE		,      padding="""max_length"""		,      )

																					# Pair input
																					self.assertRaises(_SCREAMING_SNAKE_CASE		,      tokenizer_r.encode		,      _SCREAMING_SNAKE_CASE		,      max_length=_SCREAMING_SNAKE_CASE		,      padding="""max_length"""			)

																					# Pair input
																					self.assertRaises(_SCREAMING_SNAKE_CASE		,      tokenizer_r.encode_plus		,      _SCREAMING_SNAKE_CASE		,      max_length=_SCREAMING_SNAKE_CASE		,      padding="""max_length"""			)

																					# Pair input
																					self.assertRaises(
																					    _SCREAMING_SNAKE_CASE		,      tokenizer_r.batch_encode_plus		,      _SCREAMING_SNAKE_CASE		,      max_length=_SCREAMING_SNAKE_CASE		,      padding="""max_length"""		,      )


			def lowercase__						(				self	:						List[str]			)      ->		str:





									'''simple docstring'''
									A__					:       Tuple     =CodeGenTokenizer.from_pretrained(self.tmpdirname		,      pad_token="""<pad>"""			)

									# Simple input
									A__					:       Optional[Any]     ="""This is a simple input"""
									A__					:       Union[str, Any]     =["""This is a simple input looooooooong""", """This is a simple input"""]
									A__					:       str     =("""This is a simple input""", """This is a pair""")
									A__					:       str     =[
									    ("""This is a simple input loooooong""", """This is a simple input"""),
									    ("""This is a simple pair loooooong""", """This is a simple pair"""),
									]

									A__					:       Union[str, Any]     =tokenizer.pad_token_id

									A__					:       Any     =tokenizer(_SCREAMING_SNAKE_CASE		,      padding="""max_length"""		,      max_length=30		,      return_tensors="""np"""			)
									A__					:       str     =tokenizer(_SCREAMING_SNAKE_CASE		,      padding=_SCREAMING_SNAKE_CASE		,      truncate=_SCREAMING_SNAKE_CASE		,      return_tensors="""np"""			)
									A__					:       Tuple     =tokenizer(*_SCREAMING_SNAKE_CASE		,      padding="""max_length"""		,      max_length=60		,      return_tensors="""np"""			)
									A__					:       List[str]     =tokenizer(_SCREAMING_SNAKE_CASE		,      padding=_SCREAMING_SNAKE_CASE		,      truncate=_SCREAMING_SNAKE_CASE		,      return_tensors="""np"""			)

									# s
									# test single string max_length padding
									self.assertEqual(out_s["""input_ids"""].shape[-1]		,      30			)
									self.assertTrue(pad_token_id in out_s["""input_ids"""]			)
									self.assertTrue(0 in out_s["""attention_mask"""]			)

									# s2
									# test automatic padding
									self.assertEqual(out_sa["""input_ids"""].shape[-1]		,      33			)
									# long slice doesn't have padding
									self.assertFalse(pad_token_id in out_sa["""input_ids"""][0]			)
									self.assertFalse(0 in out_sa["""attention_mask"""][0]			)
									# short slice does have padding
									self.assertTrue(pad_token_id in out_sa["""input_ids"""][1]			)
									self.assertTrue(0 in out_sa["""attention_mask"""][1]			)

									# p
									# test single pair max_length padding
									self.assertEqual(out_p["""input_ids"""].shape[-1]		,      60			)
									self.assertTrue(pad_token_id in out_p["""input_ids"""]			)
									self.assertTrue(0 in out_p["""attention_mask"""]			)

									# p2
									# test automatic padding pair
									self.assertEqual(out_pa["""input_ids"""].shape[-1]		,      52			)
									# long slice pair doesn't have padding
									self.assertFalse(pad_token_id in out_pa["""input_ids"""][0]			)
									self.assertFalse(0 in out_pa["""attention_mask"""][0]			)
									# short slice pair does have padding
									self.assertTrue(pad_token_id in out_pa["""input_ids"""][1]			)
									self.assertTrue(0 in out_pa["""attention_mask"""][1]			)


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





									'''simple docstring'''
									A__					:       str     ="""$$$"""
									A__					:       Any     =CodeGenTokenizer.from_pretrained(self.tmpdirname		,      bos_token=_SCREAMING_SNAKE_CASE		,      add_bos_token=_SCREAMING_SNAKE_CASE			)

									A__					:       List[str]     ="""This is a simple input"""
									A__					:       Union[str, Any]     =["""This is a simple input 1""", """This is a simple input 2"""]

									A__					:       Optional[Any]     =tokenizer.bos_token_id

									A__					:       List[Any]     =tokenizer(_SCREAMING_SNAKE_CASE			)
									A__					:       str     =tokenizer(_SCREAMING_SNAKE_CASE			)

									self.assertEqual(out_s.input_ids[0]		,      _SCREAMING_SNAKE_CASE			)
									self.assertTrue(all(o[0] == bos_token_id for o in out_sa.input_ids			)			)

									A__					:       Optional[Any]     =tokenizer.decode(out_s.input_ids			)
									A__					:       Any     =tokenizer.batch_decode(out_sa.input_ids			)

									self.assertEqual(decode_s.split()[0]		,      _SCREAMING_SNAKE_CASE			)
									self.assertTrue(all(d.split()[0] == bos_token for d in decode_sa			)			)


			@slow
			def lowercase__						(				self	:						int			)      ->		Optional[Any]:





									'''simple docstring'''
									A__					:       int     =CodeGenTokenizer.from_pretrained("""Salesforce/codegen-350M-mono"""			)

									A__					:       Optional[int]     ="""\nif len_a > len_b:\n    result = a\nelse:\n    result = b\n\n\n\n#"""
									A__					:       Union[str, Any]     ="""\nif len_a > len_b:      result = a\nelse:      result = b"""

									A__					:       Optional[int]     =tokenizer.encode(_SCREAMING_SNAKE_CASE			)
									A__					:       Union[str, Any]     =["""^#""", re.escape("""<|endoftext|>"""			), """^'''""", """^\"\"\"""", """\n\n\n"""]
									A__					:       Any     =tokenizer.decode(_SCREAMING_SNAKE_CASE		,      truncate_before_pattern=_SCREAMING_SNAKE_CASE			)
									self.assertEqual(_SCREAMING_SNAKE_CASE		,      _SCREAMING_SNAKE_CASE			)



			def lowercase__						(				self	:						Tuple			)      ->		Optional[Any]:





									'''simple docstring'''
									pass




'''simple docstring'''



import os
import re
import shutil
import sys
import tempfile
import unittest

import black


__snake_case			:     List[str]										=      os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, 'utils'))

import check_copies  # noqa: E402


# This is the reference code that will be used in the tests.
# If BertLMPredictionHead is changed in modeling_bert.py, this code needs to be manually updated.
__snake_case			:     Optional[int]										=      '    def __init__(self, config):\n        super().__init__()\n        self.transform = BertPredictionHeadTransform(config)\n\n        # The output weights are the same as the input embeddings, but there is\n        # an output-only bias for each token.\n        self.decoder = nn.Linear(config.hidden_size, config.vocab_size, bias=False)\n\n        self.bias = nn.Parameter(torch.zeros(config.vocab_size))\n\n        # Need a link between the two variables so that the bias is correctly resized with `resize_token_embeddings`\n        self.decoder.bias = self.bias\n\n    def forward(self, hidden_states):\n        hidden_states = self.transform(hidden_states)\n        hidden_states = self.decoder(hidden_states)\n        return hidden_states\n'



class lowerCamelCase			(  unittest.TestCase						):



			'''simple docstring'''






			def lowercase__						(				self	:						Tuple			)      ->		Dict:





									'''simple docstring'''
									A__					:       Tuple     =tempfile.mkdtemp()
									os.makedirs(os.path.join(self.transformer_dir		,      """models/bert/"""			)			)
									A__					:       List[str]     =self.transformer_dir
									shutil.copy(
									    os.path.join(lowerCAmelCase_		,      """src/transformers/models/bert/modeling_bert.py"""			)		,      os.path.join(self.transformer_dir		,      """models/bert/modeling_bert.py"""			)		,      )


			def lowercase__						(				self	:						str			)      ->		List[str]:





									'''simple docstring'''
									A__					:       Union[str, Any]     ="""src/transformers"""
									shutil.rmtree(self.transformer_dir			)


			def lowercase__						(				self	:						Union[str, Any]		,      lowerCAmelCase_	:						Any		,      lowerCAmelCase_	:						List[Any]		,      lowerCAmelCase_	:						Optional[Any]		,      lowerCAmelCase_	:						int=None			)      ->		Dict:





									'''simple docstring'''
									A__					:       Union[str, Any]     =comment + f"\nclass {class_name}(nn.Module):\n" + class_code
									if overwrite_result is not None:
															A__					:       Optional[Any]     =comment + f"\nclass {class_name}(nn.Module):\n" + overwrite_result
									A__					:       str     =black.Mode(target_versions={black.TargetVersion.PYaa}		,      line_length=1_19			)
									A__					:       Any     =black.format_str(lowerCAmelCase_		,      mode=lowerCAmelCase_			)
									A__					:       Union[str, Any]     =os.path.join(self.transformer_dir		,      """new_code.py"""			)
									with open(lowerCAmelCase_		,      """w"""		,      newline="""\n"""			) as f:
															f.write(lowerCAmelCase_			)
									if overwrite_result is None:
															self.assertTrue(len(check_copies.is_copy_consistent(lowerCAmelCase_			)			) == 0			)
									else:
															check_copies.is_copy_consistent(f.name		,      overwrite=lowerCAmelCase_			)
															with open(lowerCAmelCase_		,      """r"""			) as f:
																					self.assertTrue(f.read()		,      lowerCAmelCase_			)


			def lowercase__						(				self	:						Any			)      ->		Any:





									'''simple docstring'''
									A__					:       Dict     =check_copies.find_code_in_transformers("""models.bert.modeling_bert.BertLMPredictionHead"""			)
									self.assertEqual(lowerCAmelCase_		,      lowerCAmelCase_			)


			def lowercase__						(				self	:						Dict			)      ->		List[Any]:





									'''simple docstring'''
									# Base copy consistency
									self.check_copy_consistency(
									    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead"""		,      """BertLMPredictionHead"""		,      REFERENCE_CODE + """\n"""		,      )

									# With no empty line at the end
									self.check_copy_consistency(
									    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead"""		,      """BertLMPredictionHead"""		,      lowerCAmelCase_		,      )

									# Copy consistency with rename
									self.check_copy_consistency(
									    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead with Bert->TestModel"""		,      """TestModelLMPredictionHead"""		,      re.sub("""Bert"""		,      """TestModel"""		,      lowerCAmelCase_			)		,      )

									# Copy consistency with a really long name
									A__					:       Tuple     ="""TestModelWithAReallyLongNameBecauseSomePeopleLikeThatForSomeReason"""
									self.check_copy_consistency(
									    f"# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead with Bert->{long_class_name}"		,      f"{long_class_name}LMPredictionHead"		,      re.sub("""Bert"""		,      lowerCAmelCase_		,      lowerCAmelCase_			)		,      )

									# Copy consistency with overwrite
									self.check_copy_consistency(
									    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead with Bert->TestModel"""		,      """TestModelLMPredictionHead"""		,      lowerCAmelCase_		,      overwrite_result=re.sub("""Bert"""		,      """TestModel"""		,      lowerCAmelCase_			)		,      )



			def lowercase__						(				self	:						Optional[Any]			)      ->		Optional[int]:





									'''simple docstring'''
									A__					:       List[Any]     =check_copies.LOCALIZED_READMES["""README_zh-hans.md"""]

									A__					:       List[str]     =(
									    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (from Google Research and the"""
									    """ Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for"""
									    """ Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong"""
									    """ Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut.\n1."""
									    """ **[DistilBERT](https://huggingface.co/transformers/model_doc/distilbert.html)** (from HuggingFace),"""
									    """ released together with the paper [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and"""
									    """ lighter](https://arxiv.org/abs/1910.01108) by Victor Sanh, Lysandre Debut and Thomas Wolf. The same"""
									    """ method has been applied to compress GPT2 into"""
									    """ [DistilGPT2](https://github.com/huggingface/transformers/tree/main/examples/distillation), RoBERTa into"""
									    """ [DistilRoBERTa](https://github.com/huggingface/transformers/tree/main/examples/distillation),"""
									    """ Multilingual BERT into"""
									    """ [DistilmBERT](https://github.com/huggingface/transformers/tree/main/examples/distillation) and a German"""
									    """ version of DistilBERT.\n1. **[ELECTRA](https://huggingface.co/transformers/model_doc/electra.html)**"""
									    """ (from Google Research/Stanford University) released with the paper [ELECTRA: Pre-training text encoders"""
									    """ as discriminators rather than generators](https://arxiv.org/abs/2003.10555) by Kevin Clark, Minh-Thang"""
									    """ Luong, Quoc V. Le, Christopher D. Manning."""
									)
									A__					:       Union[str, Any]     =(
									    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (来自 Google Research and the"""
									    """ Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
									    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
									    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n"""
									)
									A__					:       str     =(
									    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (来自 Google Research and the"""
									    """ Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
									    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
									    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n1."""
									    """ **[DistilBERT](https://huggingface.co/transformers/model_doc/distilbert.html)** (来自 HuggingFace) 伴随论文"""
									    """ [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and"""
									    """ lighter](https://arxiv.org/abs/1910.01108) 由 Victor Sanh, Lysandre Debut and Thomas Wolf 发布。 The same"""
									    """ method has been applied to compress GPT2 into"""
									    """ [DistilGPT2](https://github.com/huggingface/transformers/tree/main/examples/distillation), RoBERTa into"""
									    """ [DistilRoBERTa](https://github.com/huggingface/transformers/tree/main/examples/distillation),"""
									    """ Multilingual BERT into"""
									    """ [DistilmBERT](https://github.com/huggingface/transformers/tree/main/examples/distillation) and a German"""
									    """ version of DistilBERT.\n1. **[ELECTRA](https://huggingface.co/transformers/model_doc/electra.html)** (来自"""
									    """ Google Research/Stanford University) 伴随论文 [ELECTRA: Pre-training text encoders as discriminators rather"""
									    """ than generators](https://arxiv.org/abs/2003.10555) 由 Kevin Clark, Minh-Thang Luong, Quoc V. Le,"""
									    """ Christopher D. Manning 发布。\n"""
									)

									A__   ,						A__					:       Optional[Any]     =check_copies.convert_to_localized_md(
									    lowerCAmelCase_		,      lowerCAmelCase_		,      localized_readme["""format_model_list"""]			)

									self.assertFalse(lowerCAmelCase_			)
									self.assertEqual(lowerCAmelCase_		,      lowerCAmelCase_			)

									A__   ,						A__					:       List[str]     =check_copies.convert_to_localized_md(
									    lowerCAmelCase_		,      lowerCAmelCase_		,      localized_readme["""format_model_list"""]			)

									# Check whether the number of models is equal to README.md after conversion.
									self.assertTrue(lowerCAmelCase_			)

									A__					:       Dict     =(
									    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (from Google Research and the"""
									    """ Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for"""
									    """ Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong"""
									    """ Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut."""
									)
									A__					:       str     =(
									    """1. **[ALBERT](https://huggingface.co/transformers/main/model_doc/albert.html)** (来自 Google Research and"""
									    """ the Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
									    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
									    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n"""
									)
									A__					:       int     =(
									    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (来自 Google Research and the"""
									    """ Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
									    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
									    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n"""
									)

									A__   ,						A__					:       int     =check_copies.convert_to_localized_md(
									    lowerCAmelCase_		,      lowerCAmelCase_		,      localized_readme["""format_model_list"""]			)

									# Check if the model link is synchronized.
									self.assertEqual(lowerCAmelCase_		,      lowerCAmelCase_			)

