
import json
import os
from functools import lru_cache
from typing import Dict, List, Optional, Tuple, Union

import regex as re

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...tokenization_utils_base import BatchEncoding, EncodedInput
from ...utils import PaddingStrategy, logging


UpperCamelCase_						:     Dict	       =							logging.get_logger(__name__)


UpperCamelCase_						:     List[Any]	       =							{"""vocab_file""": """vocab.json""", """merges_file""": """merges.txt"""}

# See all LED models at https://huggingface.co/models?filter=LED
UpperCamelCase_						:     Dict	       =							{
    """vocab_file""": {
        """allenai/led-base-16384""": """https://huggingface.co/allenai/led-base-16384/resolve/main/vocab.json""",
    },
    """merges_file""": {
        """allenai/led-base-16384""": """https://huggingface.co/allenai/led-base-16384/resolve/main/merges.txt""",
    },
    """tokenizer_file""": {
        """allenai/led-base-16384""": """https://huggingface.co/allenai/led-base-16384/resolve/main/tokenizer.json""",
    },
}

UpperCamelCase_						:     Tuple	       =							{
    """allenai/led-base-16384""": 1_6384,
}



@lru_cache()
# Copied from transformers.models.bart.tokenization_bart.bytes_to_unicode
def 		UpperCamelCase     (       )   ->			Any:






						'''simple docstring'''

						_lowercase       :	str           =   (
						    list(range(ord("!"  ) ,			ord("~"  ) + 1  )  ) + list(range(ord("¡"  ) ,			ord("¬"  ) + 1  )  ) + list(range(ord("®"  ) ,			ord("ÿ"  ) + 1  )  )
						)
						_lowercase       :	List[str]           =   bs[:]
						_lowercase       :	List[str]           =   0
						for b in range(2**8  ):
												if b not in bs:
																		bs.append(_UpperCAmelCase  )
																		cs.append(2**8 + n  )
																		n += 1
						_lowercase       :	Tuple           =   [chr(_UpperCAmelCase  ) for n in cs]
						return dict(zip(_UpperCAmelCase ,			_UpperCAmelCase  )  )



def 		UpperCamelCase     (       _UpperCAmelCase  :   str  )   ->			Optional[Any]:






						'''simple docstring'''

						_lowercase       :	Optional[Any]           =   set()
						_lowercase       :	int           =   word[0]
						for char in word[1:]:
												pairs.add((prev_char, char)  )
												_lowercase       :	Dict           =   char
						return pairs




class   __lowercase						(						__snake_case       ):
	_A       =   VOCAB_FILES_NAMES
	_A       =   PRETRAINED_VOCAB_FILES_MAP
	_A       =   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	_A       =   ["input_ids", "attention_mask"]






	def __init__(self				: Dict      ,	snake_case				: List[Any]      ,	snake_case				: List[str]      ,	snake_case				: Any="replace"      ,	snake_case				: Dict="<s>"      ,	snake_case				: str="</s>"      ,	snake_case				: Optional[int]="</s>"      ,	snake_case				: Dict="<s>"      ,	snake_case				: List[str]="<unk>"      ,	snake_case				: List[Any]="<pad>"      ,	snake_case				: List[Any]="<mask>"      ,	snake_case				: Tuple=False      ,	**snake_case				: List[str]      ,	) ->			List[Any]:
							_lowercase       :	Optional[int]           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else bos_token
							_lowercase       :	Dict           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else eos_token
							_lowercase       :	Any           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else sep_token
							_lowercase       :	str           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else cls_token
							_lowercase       :	List[Any]           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else unk_token
							_lowercase       :	int           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else pad_token

							# Mask token behave like a normal word, i.e. include the space before it
							_lowercase       :	str           =   AddedToken(snake_case      ,	lstrip=snake_case      ,	rstrip=snake_case    ) if isinstance(snake_case      ,	snake_case    ) else mask_token

							super().__init__(
							    errors=snake_case      ,	bos_token=snake_case      ,	eos_token=snake_case      ,	unk_token=snake_case      ,	sep_token=snake_case      ,	cls_token=snake_case      ,	pad_token=snake_case      ,	mask_token=snake_case      ,	add_prefix_space=snake_case      ,	**snake_case      ,	)

							with open(snake_case      ,	encoding="utf-8"    ) as vocab_handle:
													_lowercase       :	Dict           =   json.load(snake_case    )
							_lowercase       :	List[str]           =   {v: k for k, v in self.encoder.items()}
							_lowercase       :	Dict           =   errors  # how to handle errors in decoding
							_lowercase       :	Optional[Any]           =   bytes_to_unicode()
							_lowercase       :	Any           =   {v: k for k, v in self.byte_encoder.items()}
							with open(snake_case      ,	encoding="utf-8"    ) as merges_handle:
													_lowercase       :	Any           =   merges_handle.read().split("\n"    )[1:-1]
							_lowercase       :	Optional[Any]           =   [tuple(merge.split()    ) for merge in bpe_merges]
							_lowercase       :	Any           =   dict(zip(snake_case      ,	range(len(snake_case    )    )    )    )
							_lowercase       :	List[str]           =   {}
							_lowercase       :	Union[str, Any]           =   add_prefix_space

							# Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
							_lowercase       :	Any           =   re.compile(R"'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+"    )






	@property
	# Copied from transformers.models.bart.tokenization_bart.BartTokenizer.vocab_size
	def       _a(self				: List[str]    ) ->			int:
							return len(self.encoder    )






	def       _a(self				: Dict    ) ->			str:
							return dict(self.encoder      ,	**self.added_tokens_encoder    )






	def       _a(self				: Union[str, Any]      ,	snake_case				: Dict    ) ->			Union[str, Any]:
							if token in self.cache:
													return self.cache[token]
							_lowercase       :	Tuple           =   tuple(snake_case    )
							_lowercase       :	Dict           =   get_pairs(snake_case    )

							if not pairs:
													return token

							while True:
													_lowercase       :	List[str]           =   min(snake_case      ,	key=lambda snake_case    : self.bpe_ranks.get(snake_case      ,	float("inf"    )    )    )
													if bigram not in self.bpe_ranks:
																			break
													_lowercase      ,    _lowercase       :	Any           =   bigram
													_lowercase       :	List[Any]           =   []
													_lowercase       :	Dict           =   0
													while i < len(snake_case    ):
																			try:
																									_lowercase       :	str           =   word.index(snake_case      ,	snake_case    )
																			except ValueError:
																									new_word.extend(word[i:]    )
																									break
																			else:
																									new_word.extend(word[i:j]    )
																									_lowercase       :	Union[str, Any]           =   j

																			if word[i] == first and i < len(snake_case    ) - 1 and word[i + 1] == second:
																									new_word.append(first + second    )
																									i += 2
																			else:
																									new_word.append(word[i]    )
																									i += 1
													_lowercase       :	Any           =   tuple(snake_case    )
													_lowercase       :	Optional[int]           =   new_word
													if len(snake_case    ) == 1:
																			break
													else:
																			_lowercase       :	Dict           =   get_pairs(snake_case    )
							_lowercase       :	Any           =   " ".join(snake_case    )
							_lowercase       :	Any           =   word
							return word






	def       _a(self				: Optional[Any]      ,	snake_case				: int    ) ->			Optional[int]:
							_lowercase       :	Any           =   []
							for token in re.findall(self.pat      ,	snake_case    ):
													_lowercase       :	Optional[int]           =   "".join(
													    self.byte_encoder[b] for b in token.encode("utf-8"    )    )  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
													bpe_tokens.extend(bpe_token for bpe_token in self.bpe(snake_case    ).split(" "    )    )
							return bpe_tokens






	def       _a(self				: Tuple      ,	snake_case				: Union[str, Any]    ) ->			List[str]:
							return self.encoder.get(snake_case      ,	self.encoder.get(self.unk_token    )    )






	def       _a(self				: Dict      ,	snake_case				: List[str]    ) ->			int:
							return self.decoder.get(snake_case    )






	def       _a(self				: Optional[Any]      ,	snake_case				: Optional[Any]    ) ->			Tuple:
							_lowercase       :	int           =   "".join(snake_case    )
							_lowercase       :	List[str]           =   bytearray([self.byte_decoder[c] for c in text]    ).decode("utf-8"      ,	errors=self.errors    )
							return text






	def       _a(self				: str      ,	snake_case				: str      ,	snake_case				: Optional[str] = None    ) ->			Tuple[str]:
							if not os.path.isdir(snake_case    ):
													logger.error(F"""Vocabulary path ({save_directory}) should be a directory"""    )
													return
							_lowercase       :	int           =   os.path.join(
							    snake_case      ,	(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]    )
							_lowercase       :	int           =   os.path.join(
							    snake_case      ,	(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["merges_file"]    )

							with open(snake_case      ,	"w"      ,	encoding="utf-8"    ) as f:
													f.write(json.dumps(self.encoder      ,	indent=2      ,	sort_keys=snake_case      ,	ensure_ascii=snake_case    ) + "\n"    )

							_lowercase       :	Tuple           =   0
							with open(snake_case      ,	"w"      ,	encoding="utf-8"    ) as writer:
													writer.write("#version: 0.2\n"    )
													for bpe_tokens, token_index in sorted(self.bpe_ranks.items()      ,	key=lambda snake_case    : kv[1]    ):
																			if index != token_index:
																									logger.warning(
																									    F"""Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."""
																									    " Please check that the tokenizer is not corrupted!"    )
																									_lowercase       :	Any           =   token_index
																			writer.write(" ".join(snake_case    ) + "\n"    )
																			index += 1

							return vocab_file, merge_file






	def       _a(self				: str      ,	snake_case				: List[int]      ,	snake_case				: Optional[List[int]] = None    ) ->			List[int]:
							if token_ids_a is None:
													return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
							_lowercase       :	Dict           =   [self.cls_token_id]
							_lowercase       :	str           =   [self.sep_token_id]
							return cls + token_ids_a + sep + sep + token_ids_a + sep






	def       _a(self				: List[Any]      ,	snake_case				: List[int]      ,	snake_case				: Optional[List[int]] = None      ,	snake_case				: bool = False    ) ->			List[int]:
							if already_has_special_tokens:
													return super().get_special_tokens_mask(
													    token_ids_a=snake_case      ,	token_ids_a=snake_case      ,	already_has_special_tokens=snake_case    )

							if token_ids_a is None:
													return [1] + ([0] * len(snake_case    )) + [1]
							return [1] + ([0] * len(snake_case    )) + [1, 1] + ([0] * len(snake_case    )) + [1]






	def       _a(self				: Optional[int]      ,	snake_case				: List[int]      ,	snake_case				: Optional[List[int]] = None    ) ->			List[int]:
							_lowercase       :	List[Any]           =   [self.sep_token_id]
							_lowercase       :	List[str]           =   [self.cls_token_id]

							if token_ids_a is None:
													return len(cls + token_ids_a + sep    ) * [0]
							return len(cls + token_ids_a + sep + sep + token_ids_a + sep    ) * [0]






	def       _a(self				: Optional[int]      ,	snake_case				: Union[str, Any]      ,	snake_case				: List[str]=False      ,	**snake_case				: List[str]    ) ->			Any:
							_lowercase       :	Union[str, Any]           =   kwargs.pop("add_prefix_space"      ,	self.add_prefix_space    )
							if (is_split_into_words or add_prefix_space) and (len(snake_case    ) > 0 and not text[0].isspace()):
													_lowercase       :	List[str]           =   " " + text
							return (text, kwargs)






	def       _a(self				: str      ,	snake_case				: Union[Dict[str, EncodedInput], BatchEncoding]      ,	snake_case				: Optional[int] = None      ,	snake_case				: PaddingStrategy = PaddingStrategy.DO_NOT_PAD      ,	snake_case				: Optional[int] = None      ,	snake_case				: Optional[bool] = None      ,	) ->			dict:
							_lowercase       :	Union[str, Any]           =   super()._pad(
							    encoded_inputs=snake_case      ,	max_length=snake_case      ,	padding_strategy=snake_case      ,	pad_to_multiple_of=snake_case      ,	return_attention_mask=snake_case      ,	)

							# Load from model defaults
							if return_attention_mask is None:
													_lowercase       :	List[Any]           =   "attention_mask" in self.model_input_names

							if return_attention_mask and "global_attention_mask" in encoded_inputs:
													_lowercase       :	str           =   encoded_inputs[self.model_input_names[0]]
													# `global_attention_mask` need to have the same length as other (sequential) inputs.
													_lowercase       :	Union[str, Any]           =   len(encoded_inputs["global_attention_mask"]    ) != len(snake_case    )

													if needs_to_be_padded:
																			_lowercase       :	Optional[int]           =   len(snake_case    ) - len(encoded_inputs["global_attention_mask"]    )

																			if self.padding_side == "right":
																									# Use `-1` since `0` in `global_attention_mask` means `local attention` instead of `not to attend`
																									_lowercase       :	List[str]           =   (
																									    encoded_inputs["global_attention_mask"] + [-1] * difference
																									)
																			elif self.padding_side == "left":
																									_lowercase       :	str           =   [-1] * difference + encoded_inputs[
																									    "global_attention_mask"
																									]
																			else:
																									raise ValueError("Invalid padding strategy:" + str(self.padding_side    )    )

							return encoded_inputs






import numpy as np
import torch
from torch.utils.data import Dataset, IterableDataset

from ..utils.generic import ModelOutput




class   __lowercase						(						__snake_case       ):






	def __init__(self				: List[Any]      ,	snake_case				: Optional[int]      ,	snake_case				: str      ,	snake_case				: str    ) ->			Dict:
							_lowercase       :	Tuple           =   dataset
							_lowercase       :	List[str]           =   process
							_lowercase       :	Any           =   params






	def __len__(self				: Optional[Any]    ) ->			Any:
							return len(self.dataset    )






	def __getitem__(self				: int      ,	snake_case				: Any    ) ->			int:
							_lowercase       :	Optional[Any]           =   self.dataset[i]
							_lowercase       :	Union[str, Any]           =   self.process(snake_case      ,	**self.params    )
							return processed




class   __lowercase						(						__snake_case       ):






	def __init__(self				: int      ,	snake_case				: List[Any]      ,	snake_case				: Tuple      ,	snake_case				: Tuple      ,	snake_case				: List[str]=None    ) ->			Optional[int]:
							_lowercase       :	List[str]           =   loader
							_lowercase       :	Optional[Any]           =   infer
							_lowercase       :	List[Any]           =   params
							if loader_batch_size == 1:
													# Let's spare some time by deactivating altogether
													_lowercase       :	str           =   None
							_lowercase       :	Optional[int]           =   loader_batch_size

							# Internal bookkeeping
							_lowercase       :	Dict           =   None
							_lowercase       :	Union[str, Any]           =   None






	def __len__(self				: Any    ) ->			Any:
							return len(self.loader    )






	def __iter__(self				: int    ) ->			Optional[Any]:
							_lowercase       :	List[str]           =   iter(self.loader    )
							return self






	def       _a(self				: int    ) ->			List[str]:
							if isinstance(self._loader_batch_data      ,	torch.Tensor    ):
													# Batch data is simple tensor, just fetch the slice
													_lowercase       :	Any           =   self._loader_batch_data[self._loader_batch_index]
							else:
													# Batch data is assumed to be BaseModelOutput (or dict)
													_lowercase       :	List[str]           =   {}
													for k, element in self._loader_batch_data.items():
																			if isinstance(snake_case      ,	snake_case    ):
																									# Convert ModelOutput to tuple first
																									_lowercase       :	Dict           =   element.to_tuple()
																									if isinstance(element[0]      ,	torch.Tensor    ):
																															_lowercase       :	Optional[int]           =   tuple(el[self._loader_batch_index].unsqueeze(0    ) for el in element    )
																									elif isinstance(element[0]      ,	np.ndarray    ):
																															_lowercase       :	Optional[Any]           =   tuple(np.expand_dims(el[self._loader_batch_index]      ,	0    ) for el in element    )
																									continue
																			if k in {"hidden_states", "past_key_values", "attentions"} and isinstance(snake_case      ,	snake_case    ):
																									# Those are stored as lists of tensors so need specific unbatching.
																									if isinstance(element[0]      ,	torch.Tensor    ):
																															_lowercase       :	Optional[int]           =   tuple(el[self._loader_batch_index].unsqueeze(0    ) for el in element    )
																									elif isinstance(element[0]      ,	np.ndarray    ):
																															_lowercase       :	List[str]           =   tuple(np.expand_dims(el[self._loader_batch_index]      ,	0    ) for el in element    )
																									continue
																			if element is None:
																									# This can happen for optional data that get passed around
																									_lowercase       :	Optional[Any]           =   None
																			elif isinstance(element[self._loader_batch_index]      ,	torch.Tensor    ):
																									# Take correct batch data, but make it looked like batch_size=1
																									# For compatibility with other methods within transformers

																									_lowercase       :	int           =   element[self._loader_batch_index].unsqueeze(0    )
																			elif isinstance(element[self._loader_batch_index]      ,	np.ndarray    ):
																									# Take correct batch data, but make it looked like batch_size=1
																									# For compatibility with other methods within transformers
																									_lowercase       :	Tuple           =   np.expand_dims(element[self._loader_batch_index]      ,	0    )
																			else:
																									# This is typically a list, so no need to `unsqueeze`.
																									_lowercase       :	Union[str, Any]           =   element[self._loader_batch_index]
            # Recreate the element by reusing the original class to make it look
            # batch_size=1
													_lowercase       :	int           =   self._loader_batch_data.__class__(snake_case    )
							self._loader_batch_index += 1
							return result






	def       _a(self				: Any    ) ->			str:
							if self._loader_batch_index is not None and self._loader_batch_index < self.loader_batch_size:
													# We are currently unrolling a batch so we just need to return
													# the current item within a batch
													return self.loader_batch_item()

							# We're out of items within a batch
							_lowercase       :	str           =   next(self.iterator    )
							_lowercase       :	Any           =   self.infer(snake_case      ,	**self.params    )
							# We now have a batch of "inferred things".
							if self.loader_batch_size is not None:
													# Try to infer the size of the batch
													if isinstance(snake_case      ,	torch.Tensor    ):
																			_lowercase       :	int           =   processed
													else:
																			_lowercase       :	List[str]           =   list(processed.keys()    )[0]
																			_lowercase       :	List[str]           =   processed[key]
													if isinstance(snake_case      ,	snake_case    ):
																			_lowercase       :	int           =   len(snake_case    )
													else:
																			_lowercase       :	Optional[int]           =   first_tensor.shape[0]
													if 0 < observed_batch_size < self.loader_batch_size:
																			# could be last batch so we can't unroll as many
																			# elements.
																			_lowercase       :	Union[str, Any]           =   observed_batch_size
													# Setting internal index to unwrap the batch
													_lowercase       :	Any           =   processed
													_lowercase       :	Dict           =   0
													return self.loader_batch_item()
							else:
													# We're not unrolling batches
													return processed




class   __lowercase						(						__snake_case       ):






	def __init__(self				: Union[str, Any]      ,	snake_case				: str      ,	snake_case				: Dict      ,	snake_case				: Optional[Any]      ,	snake_case				: List[str]=None    ) ->			List[str]:
							super().__init__(snake_case      ,	snake_case      ,	snake_case    )






	def __iter__(self				: List[Any]    ) ->			str:
							_lowercase       :	int           =   iter(self.loader    )
							_lowercase       :	Optional[int]           =   None
							return self






	def       _a(self				: Optional[Any]    ) ->			Optional[int]:
							if self.subiterator is None:
													_lowercase       :	List[str]           =   self.infer(next(self.iterator    )      ,	**self.params    )
							try:
													# Try to return next item
													_lowercase       :	str           =   next(self.subiterator    )
							except StopIteration:
													# When a preprocess iterator ends, we can start lookig at the next item
													# ChunkIterator will keep feeding until ALL elements of iterator
													# all have created their subiterator and have been iterating against.
													#
													# Another way to look at it, is we're basically flattening lists of lists
													# into a single list, but with generators
													_lowercase       :	Any           =   self.infer(next(self.iterator    )      ,	**self.params    )
													_lowercase       :	Optional[int]           =   next(self.subiterator    )
							return processed




class   __lowercase						(						__snake_case       ):






	def __iter__(self				: List[str]    ) ->			List[str]:
							_lowercase       :	Any           =   iter(self.loader    )
							return self






	def       _a(self				: List[Any]    ) ->			Union[str, Any]:
							# Extremely similar to PipelineIterator in its unpacking mechanism
							# BUT, we have an extra required item which is the presence of `is_last`
							# That is because everything is flattened by `PipelineChunkIterator` we
							# need to keep track of how to regroup here in the original `process`
							# boundaries so that `process` and `postprocess` see the same data.

							# This iterator accumulates items (possibly while unbatching) until it
							# its a `is_last` and then just passes it on to the caller.
							_lowercase       :	Dict           =   False
							_lowercase       :	Optional[int]           =   []
							if self._loader_batch_index is not None and self._loader_batch_index < self.loader_batch_size:
													while self._loader_batch_index < self.loader_batch_size:
																			_lowercase       :	Tuple           =   self.loader_batch_item()
																			_lowercase       :	List[Any]           =   item.pop("is_last"    )
																			accumulator.append(snake_case    )
																			if is_last:
																									return accumulator

							while not is_last:
													_lowercase       :	List[Any]           =   self.infer(next(self.iterator    )      ,	**self.params    )
													if self.loader_batch_size is not None:
																			if isinstance(snake_case      ,	torch.Tensor    ):
																									_lowercase       :	Optional[Any]           =   processed
																			else:
																									_lowercase       :	Tuple           =   list(processed.keys()    )[0]
																									_lowercase       :	int           =   processed[key]
																			if isinstance(snake_case      ,	snake_case    ):
																									_lowercase       :	str           =   len(snake_case    )
																			else:
																									_lowercase       :	List[str]           =   first_tensor.shape[0]
																			if 0 < observed_batch_size < self.loader_batch_size:
																									# could be last batch so we can't unroll as many
																									# elements.
																									_lowercase       :	Tuple           =   observed_batch_size
																			_lowercase       :	Any           =   processed
																			_lowercase       :	Dict           =   0
																			while self._loader_batch_index < self.loader_batch_size:
																									_lowercase       :	str           =   self.loader_batch_item()
																									_lowercase       :	int           =   item.pop("is_last"    )
																									accumulator.append(snake_case    )
																									if is_last:
																															return accumulator
													else:
																			_lowercase       :	str           =   processed
																			_lowercase       :	int           =   item.pop("is_last"    )
																			accumulator.append(snake_case    )
							return accumulator




class   __lowercase						(						__snake_case       ):






	def __init__(self				: int      ,	snake_case				: Dataset      ,	snake_case				: str    ) ->			List[Any]:
							_lowercase       :	Optional[Any]           =   dataset
							_lowercase       :	Any           =   key






	def __len__(self				: Any    ) ->			Union[str, Any]:
							return len(self.dataset    )






	def __getitem__(self				: int      ,	snake_case				: Any    ) ->			Any:
							return self.dataset[i][self.key]




class   __lowercase						(						__snake_case       ):






	def __init__(self				: int      ,	snake_case				: Dataset      ,	snake_case				: str      ,	snake_case				: str    ) ->			Dict:
							_lowercase       :	int           =   dataset
							_lowercase       :	Optional[Any]           =   keya
							_lowercase       :	Tuple           =   keya






	def __len__(self				: List[str]    ) ->			Union[str, Any]:
							return len(self.dataset    )






	def __getitem__(self				: Optional[Any]      ,	snake_case				: Dict    ) ->			int:
							return {"text": self.dataset[i][self.keya], "text_pair": self.dataset[i][self.keya]}




