



from .imports import is_tqdm_available


if is_tqdm_available():
		from tqdm.auto import tqdm as _tqdm

from ..state import PartialState
def 	snake_case__       (					__lowercase = True							,     *__lowercase							,     **__lowercase       )		->		Union[str, Any]:







						"""simple docstring"""

						if not is_tqdm_available():
												raise ImportError("Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`."       )
						A__	:							List[str]						    = False
						if main_process_only:
												A__	:							str						    = PartialState().local_process_index == 0
						return _tqdm(*__lowercase							,     **__lowercase							,     disable=__lowercase       )




import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class 							lowerCAmelCase__  (	unittest.TestCase					,							UpperCamelCase						):







					def  _lowercase			(       self      :     List[Any]):
											A__	:							Optional[Any]						    = load_tool("text-classification")
											self.tool.setup()
											A__	:							Any						    = load_tool("text-classification"			,		remote=_A)







					def  _lowercase			(       self      :     List[Any]):
											A__	:							Optional[Any]						    = self.tool("That's quite cool"			,		["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     List[str]):
											A__	:							Any						    = self.remote_tool("That's quite cool"			,		["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     Optional[Any]):
											A__	:							List[str]						    = self.tool(text="That's quite cool"			,		labels=["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     Tuple):
											A__	:							Union[str, Any]						    = self.remote_tool(text="That's quite cool"			,		labels=["positive", "negative"])
											self.assertEqual(_A			,		"positive")