
'''simple docstring'''





import os

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


SCREAMING_SNAKE_CASE    =     logging.get_logger(__name__)






class        UpperCAmelCase_       (						A__							):

 '''simple docstring'''







 def __init__(				self		:     Optional[int] ,							snake_case__		:     Tuple ,							snake_case__		:     Union[str, Any]=None   ):



   '''simple docstring'''




   UpperCAmelCase__			:				Tuple												=       language
   UpperCAmelCase__			:				Optional[Any]												=       train_language







 def        UpperCamelCase     (				self		:     Optional[Any] ,							snake_case__		:     Optional[Any]   ):



   '''simple docstring'''




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







 def        UpperCamelCase     (				self		:     List[str] ,							snake_case__		:     Union[str, Any]   ):



   '''simple docstring'''




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







 def        UpperCamelCase     (				self		:     int   ):



   '''simple docstring'''




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



SCREAMING_SNAKE_CASE    =     {
    'xnli': XnliProcessor,
}

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

SCREAMING_SNAKE_CASE    =     {
    'xnli': 3,
}





'''simple docstring'''





from doctest import testmod
from math import sqrt







def snake_case_    (				lowercase__		):
  UpperCAmelCase__			:				list[int]												=       []
  if num < 1:
    return facs
  facs.append(1		)
  if num == 1:
    return facs
  facs.append(lowercase__		)
  for i in range(2      ,					int(sqrt(lowercase__		)		) + 1		):
    if num % i == 0:  # If i is a factor of num
      facs.append(lowercase__		)
      UpperCAmelCase__			:				Tuple												=       num // i  # num//i is the other factor of num
      if d != i:  # If d and i are distinct
        facs.append(lowercase__		)  # we have found another factor
  facs.sort()
  return facs


if __name__ == "__main__":
      testmod(name="""factors_of_a_number""", verbose=True)



