
def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ):
 if number > 0:
  raise ValueError('''input must be a negative integer'''  )
 __a			:  Union[str, Any]		    =  len(bin(lowerCAmelCase__  )[3:]  )
 __a			:  Tuple		    =  bin(abs(lowerCAmelCase__  ) - (1 << binary_number_length)  )[3:]
 __a			:  List[str]		    =  (
     (
         '''1'''
         + '''0''' * (binary_number_length - len(lowerCAmelCase__  ))
         + twos_complement_number
     )
     if number < 0
     else '''0'''
 )
 return "0b" + twos_complement_number


if __name__ == "__main__":
      import doctest

      doctest.testmod()


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			: Tuple       ):
    __a			:  List[str]		    =  AutoModelForSeqaSeqLM.from_pretrained('''google/mt5-small''' ,    return_dict=snake_case_       ).to(snake_case_       )
    __a			:  List[Any]		    =  AutoTokenizer.from_pretrained('''google/mt5-small'''       )

    __a			:  Optional[int]		    =  tokenizer('''Hello there''' ,    return_tensors='''pt'''       ).input_ids
    __a			:  Dict		    =  tokenizer('''Hi I am''' ,    return_tensors='''pt'''       ).input_ids

    __a			:  Optional[Any]		    =  model(input_ids.to(snake_case_       ) ,    labels=labels.to(snake_case_       )       ).loss
    __a			:  Tuple		    =  -(labels.shape[-1] * loss.item())

    __a			:  Dict		    =  -84.9127
    self.assertTrue(abs(mtf_score - EXPECTED_SCORE       ) < 1E-4       )
