


import re






def 						_A						(						_lowercase      ) ->      str:


     """simple docstring"""


     if len(re.findall('[ATCG]' ,   __A      )      ) != len(__A      ):
          raise ValueError('Invalid Strand'      )

     return dna.translate(dna.maketrans('ATCG' ,   'TAGC'      )      )


if __name__ == "__main__":
    import doctest

    doctest.testmod()




'''simple docstring'''







import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
					from transformers import AutoModelForSeqaSeqLM, AutoTokenizer


@require_torch
@require_sentencepiece
@require_tokenizers
class 						__UpperCAmelCase      (					unittest.TestCase						):


							@slow
							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		AutoModelForSeqaSeqLM.from_pretrained('google/mt5-small'    ,   return_dict=lowerCAmelCase_  ).to(lowerCAmelCase_  )
								_snake_case   						=		AutoTokenizer.from_pretrained('google/mt5-small'  )

								_snake_case   						=		tokenizer('Hello there'    ,   return_tensors='pt'  ).input_ids
								_snake_case   						=		tokenizer('Hi I am'    ,   return_tensors='pt'  ).input_ids

								_snake_case   						=		model(input_ids.to(lowerCAmelCase_  )    ,   labels=labels.to(lowerCAmelCase_  )  ).loss
								_snake_case   						=		-(labels.shape[-1] * loss.item())

								_snake_case   						=		-84.9127
								self.assertTrue(abs(mtf_score - EXPECTED_SCORE  ) < 1E-4  )

