


'''simple docstring'''




import os

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


_lowerCAmelCase	:		int		  =						logging.get_logger(__name__)



class 			lowerCAmelCase					(					a				):



	def __init__(       self			,       snake_case__			,       snake_case__=None     ):
		lowerCAmelCase       :     Any   				=			language
		lowerCAmelCase       :     str   				=			train_language



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



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



	def 					lowercase  (       self     ):
		return ["contradiction", "entailment", "neutral"]


_lowerCAmelCase	:		List[str]		  =						{
    'xnli': XnliProcessor,
}

_lowerCAmelCase	:		Any		  =						{
    'xnli': 'classification',
}

_lowerCAmelCase	:		Tuple		  =						{
    'xnli': 3,
}




'''simple docstring'''




from itertools import combinations, product

def       __UpperCamelCase     (     _A     :					int       , _A     :					int       , _A     :					int       , _A     :					int					)     ->   bool:




	"""simple docstring"""





	if xa == ya == 0 or xa == ya == 0:
		return False
	lowerCAmelCase       :     Optional[Any]   				=			xa * xa + ya * ya
	lowerCAmelCase       :     Tuple   				=			xa * xa + ya * ya
	lowerCAmelCase       :     List[str]   				=			(xa - xa) * (xa - xa) + (ya - ya) * (ya - ya)
	return (
	    a_square + b_square == c_square
	    or a_square + c_square == b_square
	    or b_square + c_square == a_square
	)

def       __UpperCamelCase     (     _A     :					int = 50					)     ->   int:




	"""simple docstring"""





	return sum(
	    1
	    for pta, pta in combinations(product(range(limit + 1					)       , repeat=2					)       , 2					)
	    if is_right(*_A       , *_A					)					)


if __name__ == "__main__":
				print(f"""{solution() = }""")
