import os

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


snake_case__						      =			logging.get_logger(__name__)



class 			UpperCamelCase					(			__lowercase			):

     '''simple docstring'''

     def __init__(       self					,					A_					,					A_=None    )			->					Tuple:






           """simple docstring"""
           _lowerCamelCase           =					language
           _lowerCamelCase           =					train_language



     def 		UpperCamelCase_    (       self					,					A_    )			->					Optional[Any]:






           """simple docstring"""
           _lowerCamelCase           =					self.language if self.train_language is None else self.train_language
           _lowerCamelCase           =					self._read_tsv(os.path.join(A_					,					F'XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'    )    )
           _lowerCamelCase           =					[]
           for i, line in enumerate(A_    ):
                 if i == 0:
                       continue
                 _lowerCamelCase           =					F'train-{i}'
                 _lowerCamelCase           =					line[0]
                 _lowerCamelCase           =					line[1]
                 _lowerCamelCase           =					'''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 		UpperCamelCase_    (       self					,					A_    )			->					Dict:






           """simple docstring"""
           _lowerCamelCase           =					self._read_tsv(os.path.join(A_					,					'''XNLI-1.0/xnli.test.tsv'''    )    )
           _lowerCamelCase           =					[]
           for i, line in enumerate(A_    ):
                 if i == 0:
                       continue
                 _lowerCamelCase           =					line[0]
                 if language != self.language:
                       continue
                 _lowerCamelCase           =					F'test-{i}'
                 _lowerCamelCase           =					line[6]
                 _lowerCamelCase           =					line[7]
                 _lowerCamelCase           =					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 		UpperCamelCase_    (       self    )			->					Optional[Any]:






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





snake_case__						      =			{
    'xnli': XnliProcessor,
}

snake_case__						      =			{
    'xnli': 'classification',
}

snake_case__						      =			{
    'xnli': 3,
}
from hashlib import mda, shaaaa

snake_case__						      =			(shaaaa, mda)



class 			UpperCamelCase					:

     '''simple docstring'''

     def __init__(       self					,					A_ = 8    )			->					None:






           """simple docstring"""
           _lowerCamelCase           =					0b0
           _lowerCamelCase           =					size



     def 		UpperCamelCase_    (       self					,					A_    )			->					None:






           """simple docstring"""
           _lowerCamelCase           =					self.hash_(A_    )
           self.bitarray |= h



     def 		UpperCamelCase_    (       self					,					A_    )			->					bool:






           """simple docstring"""
           _lowerCamelCase           =					self.hash_(A_    )
           return (h & self.bitarray) == h



     def __contains__(       self					,					A_    )			->					bool:






           """simple docstring"""
           return self.exists(A_    )



     def 		UpperCamelCase_    (       self					,					A_    )			->					str:






           """simple docstring"""
           _lowerCamelCase           =					bin(A_    )[2:]
           return res.zfill(self.size    )



     @property
     def 		UpperCamelCase_    (       self    )			->					str:






           """simple docstring"""
           return self.format_bin(self.bitarray    )



     def 		UpperCamelCase_    (       self					,					A_    )			->					int:






           """simple docstring"""
           _lowerCamelCase           =					0b0
           for func in HASH_FUNCTIONS:
                 _lowerCamelCase           =					(
                     int.from_bytes(func(value.encode()    ).digest()					,					'''little'''    ) % self.size
                 )
                 res |= 2**position
           return res



     def 		UpperCamelCase_    (       self					,					A_    )			->					str:






           """simple docstring"""
           return self.format_bin(self.hash_(A_    )    )





     @property
     def 		UpperCamelCase_    (       self    )			->					float:






           """simple docstring"""
           _lowerCamelCase           =					bin(self.bitarray    ).count('''1'''    )
           return (n_ones / self.size) ** len(A_    )