


"""simple docstring"""


from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader
class snake_case      (  _UpperCamelCase):







		def __init__(					self      :       Any    ,   a__      :       NestedDataStructureLike[PathLike]    ,   a__      :       Optional[NamedSplit] = None    ,   a__      :       Optional[Features] = None    ,   a__      :       str = None    ,   a__      :       bool = False    ,   a__      :       bool = False    ,   a__      :       Optional[int] = None    ,   **a__      :       Optional[Any]    ,   )       ->						Tuple:





						'''simple docstring'''







						super().__init__(
						    a__    ,   split=a__    ,   features=a__    ,   cache_dir=a__    ,   keep_in_memory=a__    ,   streaming=a__    ,   num_proc=a__    ,   **a__    ,   )
						_A					  =			path_or_paths if isinstance(a__    ,   a__		) else {self.split: path_or_paths}
						_A					  =			Text(
						    cache_dir=a__    ,   data_files=a__    ,   features=a__    ,   **a__    ,   )







		def  a_ (					self      :       List[Any]		)       ->						List[str]:





						'''simple docstring'''







						if self.streaming:
										_A					  =			self.builder.as_streaming_dataset(split=self.split		)
						# Build regular (map-style) dataset
						else:
										_A					  =			None
										_A					  =			None
										_A					  =			None
										_A					  =			None

										self.builder.download_and_prepare(
										    download_config=a__    ,   download_mode=a__    ,   verification_mode=a__    ,   base_path=a__    ,   num_proc=self.num_proc    ,   )
										_A					  =			self.builder.as_dataset(
										    split=self.split    ,   verification_mode=a__    ,   in_memory=self.keep_in_memory		)
						return dataset



"""simple docstring"""


import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin
class snake_case      (  unittest.TestCase     ,				_UpperCamelCase):







		def  a_ (					self      :       Optional[Any]		)       ->						List[str]:





						'''simple docstring'''







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







		def  a_ (					self      :       Optional[int]		)       ->						Dict:





						'''simple docstring'''







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







		def  a_ (					self      :       Optional[Any]		)       ->						Dict:





						'''simple docstring'''







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







		def  a_ (					self      :       Dict		)       ->						Optional[int]:





						'''simple docstring'''







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







		def  a_ (					self      :       Dict		)       ->						Any:





						'''simple docstring'''







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