

def 	__a     (      A__			:  int			,  A__			:  int       ):
    if a < 0 or b < 0:
        raise ValueError("the value of both inputs must be positive"       )
    SCREAMING_SNAKE_CASE										=   str(bin(A__       )       )[2:]  # remove the leading "0b"
    SCREAMING_SNAKE_CASE										=   str(bin(A__       )       )[2:]
    SCREAMING_SNAKE_CASE										=   max(len(A__       )			,  len(A__       )       )
    return "0b" + "".join(
        str(int("1" in (char_a, char_b)       )       )
        for char_a, char_b in zip(a_binary.zfill(A__       )			,  b_binary.zfill(A__       )       )       )


if __name__ == "__main__":
    import doctest

    doctest.testmod()


import tempfile
import unittest

from transformers import AutoModelForSeqaSeqLM, AutoTokenizer
from transformers.testing_utils import (
    is_torch_available,
    require_optimum,
    require_torch,
    slow,
)


if is_torch_available():
    import torch





@require_torch
@require_optimum
@slow
class 			_SCREAMING_SNAKE_CASE (   unittest.TestCase		):







   '''simple docstring'''




   def      _snake_case		(       self					:			Any			):
       SCREAMING_SNAKE_CASE										=   "hf-internal-testing/tiny-random-t5"
       SCREAMING_SNAKE_CASE										=   AutoTokenizer.from_pretrained(__lowerCamelCase			)
       SCREAMING_SNAKE_CASE										=   AutoModelForSeqaSeqLM.from_pretrained(__lowerCamelCase			)

       SCREAMING_SNAKE_CASE										=   tokenizer("This is me"     , return_tensors="pt"			)

       SCREAMING_SNAKE_CASE										=   model.to_bettertransformer()

       self.assertTrue(any("BetterTransformer" in mod.__class__.__name__ for _, mod in model.named_modules()			)			)

       SCREAMING_SNAKE_CASE										=   model.generate(**__lowerCamelCase			)

       SCREAMING_SNAKE_CASE										=   model.reverse_bettertransformer()

       self.assertFalse(any("BetterTransformer" in mod.__class__.__name__ for _, mod in model.named_modules()			)			)

       with tempfile.TemporaryDirectory() as tmpdirname:
           model.save_pretrained(__lowerCamelCase			)

           SCREAMING_SNAKE_CASE										=   AutoModelForSeqaSeqLM.from_pretrained(__lowerCamelCase			)

           self.assertFalse(
               any("BetterTransformer" in mod.__class__.__name__ for _, mod in model_reloaded.named_modules()			)			)

           SCREAMING_SNAKE_CASE										=   model_reloaded.generate(**__lowerCamelCase			)
           self.assertTrue(torch.allclose(__lowerCamelCase     , __lowerCamelCase			)			)





   def      _snake_case		(       self					:			int			):
       SCREAMING_SNAKE_CASE										=   "hf-internal-testing/tiny-random-t5"
       SCREAMING_SNAKE_CASE										=   AutoModelForSeqaSeqLM.from_pretrained(__lowerCamelCase			)

       SCREAMING_SNAKE_CASE										=   model.to_bettertransformer()

       with tempfile.TemporaryDirectory() as tmpdirname:
           with self.assertRaises(__lowerCamelCase			):
               model.save_pretrained(__lowerCamelCase			)

           SCREAMING_SNAKE_CASE										=   model.reverse_bettertransformer()
           model.save_pretrained(__lowerCamelCase			)