






'''simple docstring'''






def        _SCREAMING_SNAKE_CASE  (				A  :       Tuple  )    -> int:







   """simple docstring"""
   return "".join([hex(_snake_case  )[2:].zfill(2  ).upper() for byte in list(_snake_case  )]  )




def        _SCREAMING_SNAKE_CASE  (				A  :       Tuple  )    -> List[str]:







   """simple docstring"""






   if (len(_snake_case  ) % 2) != 0:
      raise ValueError(
          'Base16 encoded data is invalid:\nData does not have an even number of hex digits.'  )
   # Check the character set - the standard base16 alphabet
   # is uppercase according to RFC3548 section 6
   if not set(_snake_case  ) <= set('0123456789ABCDEF'  ):
      raise ValueError(
          'Base16 encoded data is invalid:\nData is not uppercase hex or it contains invalid characters.'  )
   # For every two hexadecimal digits (= a byte), turn it into an integer.
   # Then, string the result together into bytes, and return it.
   return bytes(int(data[i] + data[i + 1]  ,		16  ) for i in range(0  ,		len(_snake_case  )  ,		2  )  )


if __name__ == "__main__":
      import doctest

      doctest.testmod()







'''simple docstring'''






import unittest

from transformers import load_tool
from transformers.utils import is_torch_available


if is_torch_available():
      import torch

from transformers.testing_utils import require_torch

from .test_tools_common import ToolTesterMixin




@require_torch
class a_    (    unittest.TestCase		,      UpperCamelCase_							):







   def     SCREAMING_SNAKE_CASE__					(self)			->      List[Any]:
      """simple docstring"""






      __snake_case				:      List[str]     							= load_tool('text-to-speech')
      self.tool.setup()







   def     SCREAMING_SNAKE_CASE__					(self)			->      Optional[Any]:
      """simple docstring"""






      torch.manual_seed(0)
      __snake_case				:      Dict     							= self.tool('hey')
      __snake_case				:      List[Any]     							= result.to_raw()
      self.assertTrue(
          torch.allclose(
              resulting_tensor[:3]					,   torch.tensor([-0.0_005_966_668_832_115_829, -0.0_003_657_640_190_795_064, -0.00_013_439_502_799_883_485])					,   ))







   def     SCREAMING_SNAKE_CASE__					(self)			->      List[Any]:
      """simple docstring"""






      torch.manual_seed(0)
      __snake_case				:      Any     							= self.tool('hey')
      __snake_case				:      Any     							= result.to_raw()
      self.assertTrue(
          torch.allclose(
              resulting_tensor[:3]					,   torch.tensor([-0.0_005_966_668_832_115_829, -0.0_003_657_640_190_795_064, -0.00_013_439_502_799_883_485])					,   ))