




import os

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


a_										=       logging.get_logger(__name__)

class 	_lowerCamelCase  (     _SCREAMING_SNAKE_CASE				):

      """simple docstring"""

      def __init__(       self   :	List[str]	,    snake_case   :	Optional[Any]	,    snake_case   :	Optional[int]=None			):
          __UpperCamelCase											=  language
          __UpperCamelCase											=  train_language







      def  snake_case		(       self   :	int	,    snake_case   :	Dict			):
          __UpperCamelCase											=  self.language if self.train_language is None else self.train_language
          __UpperCamelCase											=  self._read_tsv(os.path.join(snake_case	,    F"XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"			)			)
          __UpperCamelCase											=  []
          for i, line in enumerate(snake_case			):
              if i == 0:
                  continue
              __UpperCamelCase											=  F"train-{i}"
              __UpperCamelCase											=  line[0]
              __UpperCamelCase											=  line[1]
              __UpperCamelCase											=  '''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  snake_case		(       self   :	Any	,    snake_case   :	Any			):
          __UpperCamelCase											=  self._read_tsv(os.path.join(snake_case	,    '''XNLI-1.0/xnli.test.tsv'''			)			)
          __UpperCamelCase											=  []
          for i, line in enumerate(snake_case			):
              if i == 0:
                  continue
              __UpperCamelCase											=  line[0]
              if language != self.language:
                  continue
              __UpperCamelCase											=  F"test-{i}"
              __UpperCamelCase											=  line[6]
              __UpperCamelCase											=  line[7]
              __UpperCamelCase											=  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  snake_case		(       self   :	int			):
          return ["contradiction", "entailment", "neutral"]







a_										=       {
    "xnli": XnliProcessor,
}

a_										=       {
    "xnli": "classification",
}

a_										=       {
    "xnli": 3,
}












def    __SCREAMING_SNAKE_CASE				(					lowercase_ )    ->		list:

    """simple docstring"""


    __UpperCamelCase											=  len(lowercase_ )

    # Set the gap value to be decreased by a factor of 1.3
    # after each iteration
    __UpperCamelCase											=  1.3

    # Continue sorting until the gap is 1
    while gap > 1:
        # Decrease the gap value
        __UpperCamelCase											=  int(gap / shrink )

        # Sort the elements using insertion sort
        for i in range(lowercase_   ,       len(lowercase_ ) ):
            __UpperCamelCase											=  collection[i]
            __UpperCamelCase											=  i
            while j >= gap and collection[j - gap] > temp:
                __UpperCamelCase											=  collection[j - gap]
                j -= gap
            __UpperCamelCase											=  temp

    return collection


if __name__ == "__main__":
 import doctest

 doctest.testmod()






