






import os

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


a    =       logging.get_logger(__name__)
class        __snake_case(					__UpperCamelCase      ):



 def __init__(	self   :   int ,		UpperCAmelCase__   :   Optional[int] ,		UpperCAmelCase__   :   Dict=None	):

    """simple docstring"""






    lowercase__						:	Optional[int]         = language
    lowercase__						:	Tuple         = train_language



 def 						UpperCAmelCase    (	self   :   List[Any] ,		UpperCAmelCase__   :   List[str]	):

    """simple docstring"""






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



 def 						UpperCAmelCase    (	self   :   Any ,		UpperCAmelCase__   :   Any	):

    """simple docstring"""






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







 def 						UpperCAmelCase    (	self   :   List[Any]	):

    """simple docstring"""






    return ["contradiction", "entailment", "neutral"]
a    =       {
    'xnli': XnliProcessor,
}

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

a    =       {
    'xnli': 3,
}










def       a__						(  A					):

   if not isinstance(A		,				A					) or number < 0:
      raise ValueError("""Input must be a non-negative integer"""					)

   lowercase__						:	str         = number & ~(number - 1)
   lowercase__						:	Optional[int]         = 0
   while intermediate:
      intermediate >>= 1
      index += 1
   return index - 1


if __name__ == "__main__":
 import doctest

 doctest.testmod(verbose=True)


