






'''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 							__magic_name__     (	unittest.TestCase,						UpperCamelCase_				):







 """simple docstring"""



 def        lowerCamelCase__		(							self       )						->  List[Any]:
       lowercase_      :   List[str]        =			load_tool('text-to-speech'       )
       self.tool.setup()
 def        lowerCamelCase__		(							self       )						->  Optional[Any]:
       torch.manual_seed(0       )
       lowercase_      :   Dict        =			self.tool('hey'       )
       lowercase_      :   List[Any]        =			result.to_raw()
       self.assertTrue(
           torch.allclose(
               resulting_tensor[:3]  ,      torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]       )  ,      )       )







 def        lowerCamelCase__		(							self       )						->  List[Any]:
       torch.manual_seed(0       )
       lowercase_      :   Any        =			self.tool('hey'       )
       lowercase_      :   Any        =			result.to_raw()
       self.assertTrue(
           torch.allclose(
               resulting_tensor[:3]  ,      torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]       )  ,      )       )








'''simple docstring'''

import os
from distutils.util import strtobool






def 	_UpperCAmelCase    (  a		:	Any						,			a		:	int							)			->			Any:





						"""simple docstring"""
						for e in env_keys:
												lowercase_      :   Optional[Any]        =			int(os.environ.get(a						,			-1							)							)
												if val >= 0:
																		return val
						return default






def 	_UpperCAmelCase    (  a		:	List[Any]						,			a		:	Dict=False							)			->			Optional[Any]:





						"""simple docstring"""
						lowercase_      :   Optional[int]        =			os.environ.get(a						,			str(a							)							)
						return strtobool(a							) == 1  # As its name indicates `strtobool` actually returns an int...






def 	_UpperCAmelCase    (  a		:	List[Any]						,			a		:	Dict="no"							)			->			str:





						"""simple docstring"""
						lowercase_      :   List[Any]        =			os.environ.get(a						,			str(a							)							)
						return value
