


"""simple docstring"""


import os

from ...utils import logging
from .utils import DataProcessor, InputExample


a_											=     logging.get_logger(__name__)
class snake_case   (	_UpperCamelCase):







		def __init__(       self   :							List[Any]     , a__   :							Dict     , a__   :							Optional[int]=None		)							->    List[Any]:





						'''simple docstring'''







						_A       	=      language
						_A       	=      train_language







		def 			a_			(       self   :							int     , a__   :							List[str]		)							->    int:





						'''simple docstring'''







						_A       	=      self.language if self.train_language is None else self.train_language
						_A       	=      self._read_tsv(os.path.join(a__     , F"""XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"""		)		)
						_A       	=      []
						for i, line in enumerate(a__		):
										if i == 0:
														continue
										_A       	=      F"""train-{i}"""
										_A       	=      line[0]
										_A       	=      line[1]
										_A       	=      "contradiction" if line[2] == "contradictory" else line[2]
										if not isinstance(a__     , a__		):
														raise ValueError(F"""Training input {text_a} is not a string"""		)
										if not isinstance(a__     , a__		):
														raise ValueError(F"""Training input {text_b} is not a string"""		)
										if not isinstance(a__     , a__		):
														raise ValueError(F"""Training label {label} is not a string"""		)
										examples.append(InputExample(guid=a__     , text_a=a__     , text_b=a__     , label=a__		)		)
						return examples







		def 			a_			(       self   :							Any     , a__   :							int		)							->    Any:





						'''simple docstring'''







						_A       	=      self._read_tsv(os.path.join(a__     , "XNLI-1.0/xnli.test.tsv"		)		)
						_A       	=      []
						for i, line in enumerate(a__		):
										if i == 0:
														continue
										_A       	=      line[0]
										if language != self.language:
														continue
										_A       	=      F"""test-{i}"""
										_A       	=      line[6]
										_A       	=      line[7]
										_A       	=      line[1]
										if not isinstance(a__     , a__		):
														raise ValueError(F"""Training input {text_a} is not a string"""		)
										if not isinstance(a__     , a__		):
														raise ValueError(F"""Training input {text_b} is not a string"""		)
										if not isinstance(a__     , a__		):
														raise ValueError(F"""Training label {label} is not a string"""		)
										examples.append(InputExample(guid=a__     , text_a=a__     , text_b=a__     , label=a__		)		)
						return examples







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





						'''simple docstring'''







						return ["contradiction", "entailment", "neutral"]





a_											=     {
    "xnli": XnliProcessor,
}

a_											=     {
    "xnli": "classification",
}

a_											=     {
    "xnli": 3,
}



"""simple docstring"""


from .hash_table import HashTable
class snake_case   (	_UpperCamelCase):







		def __init__(       self   :							Any     , *a__   :							Any     , **a__   :							Tuple		)							->    Tuple:





						'''simple docstring'''







						super().__init__(*a__     , **a__		)







		def 			a_			(       self   :							Tuple     , a__   :							int     , a__   :							str=None		)							->    Optional[int]:





						'''simple docstring'''







						_A       	=      1
						_A       	=      self.hash_function(key + i * i		)

						while self.values[new_key] is not None and self.values[new_key] != key:
										i += 1
										_A       	=      (
										    self.hash_function(key + i * i		)
										    if not self.balanced_factor() >= self.lim_charge
										    else None
										)

										if new_key is None:
														break

						return new_key