




'''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 			_snake_case		(     lowercase_							):




			def __init__( self    ,							a__ = None    ,							a__ = None    ,							a__ = None    ,							a__ = None    ,							a__ = False    ,							a__ = False    ,							a__ = None    ,							**a__    ,							)    ->    List[Any]:

										'''simple docstring'''




										snake_case_      =				path_or_paths
										snake_case_      =				split if split or isinstance(__A    ,							__A							) else "train"
										snake_case_      =				features
										snake_case_      =				cache_dir
										snake_case_      =				keep_in_memory
										snake_case_      =				streaming
										snake_case_      =				num_proc
										snake_case_      =				kwargs




			@abstractmethod
			def        lowerCAmelCase__    ( self							)    ->    Union[Dataset, DatasetDict, IterableDataset, IterableDatasetDict]:

										'''simple docstring'''




										pass




class 			_snake_case		(     lowercase_							):




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

										'''simple docstring'''




										snake_case_      =				features
										snake_case_      =				cache_dir
										snake_case_      =				keep_in_memory
										snake_case_      =				streaming
										snake_case_      =				num_proc
										snake_case_      =				kwargs




			@abstractmethod
			def        lowerCAmelCase__    ( self							)    ->    Union[Dataset, IterableDataset]:

										'''simple docstring'''




										pass










'''simple docstring'''





import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class 			_snake_case		(     unittest.TestCase						,						lowercase_							):




			def        lowerCAmelCase__    ( self							)    ->    Optional[int]:

										'''simple docstring'''




										snake_case_      =				load_tool("text-classification"							)
										self.tool.setup()
										snake_case_      =				load_tool("text-classification"    ,							remote=a__							)




			def        lowerCAmelCase__    ( self							)    ->    str:

										'''simple docstring'''




										snake_case_      =				self.tool("That's quite cool"    ,							["positive", "negative"]							)
										self.assertEqual(a__    ,							"positive"							)




			def        lowerCAmelCase__    ( self							)    ->    Optional[int]:

										'''simple docstring'''




										snake_case_      =				self.remote_tool("That's quite cool"    ,							["positive", "negative"]							)
										self.assertEqual(a__    ,							"positive"							)




			def        lowerCAmelCase__    ( self							)    ->    int:

										'''simple docstring'''




										snake_case_      =				self.tool(text="That's quite cool"    ,							labels=["positive", "negative"]							)
										self.assertEqual(a__    ,							"positive"							)




			def        lowerCAmelCase__    ( self							)    ->    Any:

										'''simple docstring'''




										snake_case_      =				self.remote_tool(text="That's quite cool"    ,							labels=["positive", "negative"]							)
										self.assertEqual(a__    ,							"positive"							)




