





'''simple docstring'''


import os

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


A_				     =							logging.get_logger(__name__)


class 		UpperCamelCase__     (       a							):
      '''simple docstring'''






      def __init__(     self     , SCREAMING_SNAKE_CASE     , SCREAMING_SNAKE_CASE=None )				->  Any:
        __lowerCAmelCase		:    Optional[int]			     =  language
        __lowerCAmelCase		:    Any			     =  train_language




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




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







      def 	snake_case  (     self )				->  Any:
        return ["contradiction", "entailment", "neutral"]



A_				     =							{
    "xnli": XnliProcessor,
}

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

A_				     =							{
    "xnli": 3,
}












'''simple docstring'''


from __future__ import annotations




def       A							(      _UpperCAmelCase   :				list[int]						,_UpperCAmelCase   :				int					)  ->				int:


  '''simple docstring'''




  __lowerCAmelCase     ,					__lowerCAmelCase		:    Dict			     =  0, len(_UpperCAmelCase					) - 1
  while start_ind <= end_ind:
    if array[start_ind] == search_item:
      return start_ind
    elif array[end_ind] == search_item:
      return end_ind
    else:
      start_ind += 1
      end_ind -= 1
    # returns -1 if search_item is not found in array
  return -1


if __name__ == "__main__":
    print(double_linear_search(list(range(1_00)), 40))





