
"""simple docstring"""

import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin






class 	_lowercase       (    unittest.TestCase    ,	__UpperCAmelCase		):




	def       _UpperCamelCase   (			self )		->							Optional[int]:
			lowerCamelCase					:      Union[str, Any]          =   load_tool('text-classification' )
			self.tool.setup()
			lowerCamelCase					:      Tuple          =   load_tool('text-classification'		,			remote=UpperCAmelCase_ )




	def       _UpperCamelCase   (			self )		->							Dict:
			lowerCamelCase					:      Tuple          =   self.tool('That\'s quite cool'		,			['positive', 'negative'] )
			self.assertEqual(UpperCAmelCase_		,			'positive' )




	def       _UpperCamelCase   (			self )		->							List[str]:
			lowerCamelCase					:      List[Any]          =   self.remote_tool('That\'s quite cool'		,			['positive', 'negative'] )
			self.assertEqual(UpperCAmelCase_		,			'positive' )




	def       _UpperCamelCase   (			self )		->							Dict:
			lowerCamelCase					:      List[str]          =   self.tool(text='That\'s quite cool'		,			labels=['positive', 'negative'] )
			self.assertEqual(UpperCAmelCase_		,			'positive' )




	def       _UpperCamelCase   (			self )		->							int:
			lowerCamelCase					:      List[str]          =   self.remote_tool(text='That\'s quite cool'		,			labels=['positive', 'negative'] )
			self.assertEqual(UpperCAmelCase_		,			'positive' )








"""simple docstring"""

import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
					import ctypes
					import msvcrt  # noqa






					class 	_lowercase       (    ctypes.Structure		):
						# _fields is a specific attr expected by ctypes
						lowercase_				=     [('size', ctypes.c_int), ('visible', ctypes.c_byte)]
def 		UpperCAmelCase (		):





		'''simple docstring'''


		if os.name == "nt":
				lowerCamelCase					:      Optional[int]          =   CursorInfo()
				lowerCamelCase					:      Union[str, Any]          =   ctypes.windll.kernelaa.GetStdHandle(-11      )
				ctypes.windll.kernelaa.GetConsoleCursorInfo(a_,						ctypes.byref(a_      )      )
				lowerCamelCase					:      Dict          =   False
				ctypes.windll.kernelaa.SetConsoleCursorInfo(a_,						ctypes.byref(a_      )      )
		elif os.name == "posix":
				sys.stdout.write('\033[?25l'      )
				sys.stdout.flush()
def 		UpperCAmelCase (		):





		'''simple docstring'''


		if os.name == "nt":
				lowerCamelCase					:      List[str]          =   CursorInfo()
				lowerCamelCase					:      List[Any]          =   ctypes.windll.kernelaa.GetStdHandle(-11      )
				ctypes.windll.kernelaa.GetConsoleCursorInfo(a_,						ctypes.byref(a_      )      )
				lowerCamelCase					:      Optional[Any]          =   True
				ctypes.windll.kernelaa.SetConsoleCursorInfo(a_,						ctypes.byref(a_      )      )
		elif os.name == "posix":
				sys.stdout.write('\033[?25h'      )
				sys.stdout.flush()





@contextmanager
def 		UpperCAmelCase (		):





		'''simple docstring'''


		try:
				hide_cursor()
				yield
		finally:
				show_cursor()






