


'''simple docstring'''




from __future__ import annotations





def   _a		(lowercase__			:   int							,   lowercase__			:   int						)			->			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!'						)
     __snake_case           =						number_of_bytes // partitions
     __snake_case           =						[]
     for i in range(lowercase__						):
          __snake_case           =						i * bytes_per_partition + 1
          __snake_case           =						(
              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()







import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import ClassLabel, Features, Value
from .base import TaskTemplate







@dataclass(frozen=lowercase_     )
class 					lowercase							(			lowercase_     ):
				# `task` is not a ClassVar since we want it to be part of the `asdict` output for JSON serialization
				__SCREAMING_SNAKE_CASE   :					str			     =     field(default='''text-classification'''      ,    metadata={'''include_in_asdict_even_if_is_default''': True}     )
				__SCREAMING_SNAKE_CASE   :					ClassVar[Features]			     =     Features({'''text''': Value('''string'''     )}     )
				__SCREAMING_SNAKE_CASE   :					ClassVar[Features]			     =     Features({'''labels''': ClassLabel}     )
				__SCREAMING_SNAKE_CASE   :					str			     =     "text"
				__SCREAMING_SNAKE_CASE   :					str			     =     "labels"




				def        a				(   self ,  snake_case			):
											if self.label_column not in features:
																		raise ValueError(F'''Column {self.label_column} is not present in features.'''			)
											if not isinstance(features[self.label_column] ,  snake_case			):
																		raise ValueError(F'''Column {self.label_column} is not a ClassLabel.'''			)
											snake_case_     							=       copy.deepcopy(self			)
											snake_case_     							=       self.label_schema.copy()
											snake_case_     							=       features[self.label_column]
											snake_case_     							=       label_schema
											return task_template




				@property
				def        a				(   self			):
											return {
											    self.text_column: "text",
											    self.label_column: "labels",
											}




