



'''simple docstring'''
from abc import ABC, abstractmethod
from typing import Optional, Union

from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit
from ..utils.typing import NestedDataStructureLike, PathLike



class _A     (			__SCREAMING_SNAKE_CASE			):





		def __init__(   self       ,				__UpperCAmelCase = None       ,				__UpperCAmelCase = None       ,				__UpperCAmelCase = None       ,				__UpperCAmelCase = None       ,				__UpperCAmelCase = False       ,				__UpperCAmelCase = False       ,				__UpperCAmelCase = None       ,				**__UpperCAmelCase       ,				)				->   Union[str, Any]:

					'''simple docstring'''
					__UpperCAmelCase      :					List[Any]   =   path_or_paths
					__UpperCAmelCase      :					Optional[Any]   =   split if split or isinstance(UpperCAmelCase__       ,				UpperCAmelCase__ ) else """train"""
					__UpperCAmelCase      :					Union[str, Any]   =   features
					__UpperCAmelCase      :					List[str]   =   cache_dir
					__UpperCAmelCase      :					Optional[int]   =   keep_in_memory
					__UpperCAmelCase      :					Optional[int]   =   streaming
					__UpperCAmelCase      :					Tuple   =   num_proc
					__UpperCAmelCase      :					str   =   kwargs





		@abstractmethod
		def 							__A				(   self )				->   Optional[int]:

					'''simple docstring'''
					pass



class _A     (			__SCREAMING_SNAKE_CASE			):





		def __init__(   self       ,				__UpperCAmelCase = None       ,				__UpperCAmelCase = None       ,				__UpperCAmelCase = False       ,				__UpperCAmelCase = False       ,				__UpperCAmelCase = None       ,				**__UpperCAmelCase       ,				)				->   Dict:

					'''simple docstring'''
					__UpperCAmelCase      :					Optional[int]   =   features
					__UpperCAmelCase      :					Any   =   cache_dir
					__UpperCAmelCase      :					Union[str, Any]   =   keep_in_memory
					__UpperCAmelCase      :					Dict   =   streaming
					__UpperCAmelCase      :					Optional[int]   =   num_proc
					__UpperCAmelCase      :					Any   =   kwargs





		@abstractmethod
		def 							__A				(   self )				->   Optional[Any]:

					'''simple docstring'''
					pass







"""simple docstring"""





import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class 					_lowerCAmelCase  (	unittest.TestCase     ,lowercase   ):







 """simple docstring"""







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


 def 					_lowercase (			self							:			str	):
    __lowercase								=						self.tool("That's quite cool",					["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)


 def 					_lowercase (			self							:			str	):
    __lowercase								=						self.remote_tool("That's quite cool",					["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)


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



 def 					_lowercase (			self							:			Tuple	):
    __lowercase								=						self.remote_tool(text="That's quite cool",					labels=["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)




