






"""simple docstring"""







import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


class    __UpperCAmelCase(       unittest.TestCase  ,  SCREAMING_SNAKE_CASE__							):




						"""simple docstring"""




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Union[str, Any]=	load_tool("text-classification"      )
												self.tool.setup()
												lowercase__    :				Union[str, Any]=	load_tool("text-classification"	,  remote=snake_case__      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				List[str]=	self.tool("That's quite cool"	,  ["positive", "negative"]      )
												self.assertEqual(snake_case__	,  "positive"      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				str=	self.remote_tool("That's quite cool"	,  ["positive", "negative"]      )
												self.assertEqual(snake_case__	,  "positive"      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				int=	self.tool(text="That's quite cool"	,  labels=["positive", "negative"]      )
												self.assertEqual(snake_case__	,  "positive"      )




						def 		UpperCAmelCase_	(       self      ):
												'''simple docstring'''
												lowercase__    :				Dict=	self.remote_tool(text="That's quite cool"	,  labels=["positive", "negative"]      )
												self.assertEqual(snake_case__	,  "positive"      )














"""simple docstring"""







from __future__ import annotations





def 						lowercase__(A ,		A						)    ->list[str]:




						"""simple docstring"""



						if partitions <= 0:
												raise ValueError("partitions must be a positive number!"						)
						if partitions > number_of_bytes:
												raise ValueError("partitions can not > number_of_bytes!"						)
						lowercase__    :				List[str]=	number_of_bytes // partitions
						lowercase__    :				Dict=	[]
						for i in range(A						):
												lowercase__    :				Union[str, Any]=	i * bytes_per_partition + 1
												lowercase__    :				Any=	(
												    number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
												)
												allocation_list.append(f'''{start_bytes}-{end_bytes}'''						)
						return allocation_list


if __name__ == "__main__":
			import doctest

			doctest.testmod()






