


"""simple docstring"""






import os

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


UpperCamelCase__							:str       =  logging.get_logger(__name__)






class     A(     lowerCamelCase__		):

		"""simple docstring"""





		def __init__(   self				,							SCREAMING_SNAKE_CASE__				,							SCREAMING_SNAKE_CASE__=None      )			->  Optional[Any]:

					"""simple docstring"""



					_UpperCamelCase				:Optional[int]				    =  language
					_UpperCamelCase				:str				    =  train_language
		def      _UpperCamelCase(   self				,							SCREAMING_SNAKE_CASE__      )			->  Optional[Any]:

					"""simple docstring"""



					_UpperCamelCase				:str				    =  self.language if self.train_language is None else self.train_language
					_UpperCamelCase				:List[str]				    =  self._read_tsv(os.path.join(SCREAMING_SNAKE_CASE__				,							f"XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"      )      )
					_UpperCamelCase				:Optional[Any]				    =  []
					for i, line in enumerate(SCREAMING_SNAKE_CASE__      ):
								if i == 0:
											continue
								_UpperCamelCase				:List[str]				    =  f"train-{i}"
								_UpperCamelCase				:Optional[Any]				    =  line[0]
								_UpperCamelCase				:str				    =  line[1]
								_UpperCamelCase				:Union[str, Any]				    =  '''contradiction''' if line[2] == '''contradictory''' else line[2]
								if not isinstance(SCREAMING_SNAKE_CASE__				,							SCREAMING_SNAKE_CASE__      ):
											raise ValueError(f"Training input {text_a} is not a string"      )
								if not isinstance(SCREAMING_SNAKE_CASE__				,							SCREAMING_SNAKE_CASE__      ):
											raise ValueError(f"Training input {text_b} is not a string"      )
								if not isinstance(SCREAMING_SNAKE_CASE__				,							SCREAMING_SNAKE_CASE__      ):
											raise ValueError(f"Training label {label} is not a string"      )
								examples.append(InputExample(guid=SCREAMING_SNAKE_CASE__				,							text_a=SCREAMING_SNAKE_CASE__				,							text_b=SCREAMING_SNAKE_CASE__				,							label=SCREAMING_SNAKE_CASE__      )      )
					return examples
		def      _UpperCamelCase(   self				,							SCREAMING_SNAKE_CASE__      )			->  Dict:

					"""simple docstring"""



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





		def      _UpperCamelCase(   self      )			->  List[str]:

					"""simple docstring"""



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

UpperCamelCase__							:List[str]       =  {
    """xnli""": XnliProcessor,
}

UpperCamelCase__							:List[Any]       =  {
    """xnli""": """classification""",
}

UpperCamelCase__							:str       =  {
    """xnli""": 3,
}





"""simple docstring"""






from __future__ import annotations

from enum import Enum






class     A(     lowerCamelCase__		):

		"""simple docstring"""





		A         =       24
		A         =       21
		A         =       18
		A         =       15
		A         =       12
		A         =       9
		A         =       6
		A         =       3
		A         =       2
		A         =       1
		A         =       -1
		A         =       -2
		A         =       -3
		A         =       -6
		A         =       -9
		A         =       -12
		A         =       -15
		A         =       -18
		A         =       -21
		A         =       -24






class     A(     lowerCamelCase__		):

		"""simple docstring"""





		A         =       8
		A         =       7
		A         =       6
		A         =       5
		A         =       4
		A         =       3
		A         =       2
		A         =       1





def 							A_					(   snake_case__					,				snake_case__					,				snake_case__					,				)				->     float:
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Tuple				    =  SIUnit[known_prefix.lower()]
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Optional[int]				    =  SIUnit[unknown_prefix.lower()]
			_UpperCamelCase				:float				    =  known_amount * (
			    10 ** (known_prefix.value - unknown_prefix.value)
			)
			return unknown_amount





def 							A_					(   snake_case__					,				snake_case__					,				snake_case__					,				)				->     float:
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Any				    =  BinaryUnit[known_prefix.lower()]
			if isinstance(snake_case__					,				snake_case__		):
						_UpperCamelCase				:Dict				    =  BinaryUnit[unknown_prefix.lower()]
			_UpperCamelCase				:float				    =  known_amount * (
			    2 ** ((known_prefix.value - unknown_prefix.value) * 10)
			)
			return unknown_amount


if __name__ == "__main__":
					import doctest

					doctest.testmod()

