






"""simple docstring"""





import os
import unittest

import pytest
from parameterized import parameterized

from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device


# skipping in unittest tests

UpperCamelCase			=      [(1,)]






def     A(  ):
       """simple docstring"""





       lowercase__:    Any        =      bool(os.getenv("RUN_SLOW"						,       0		)		)
       if run_slow:
              assert True
       else:
              assert False, "should have been skipped"






def     A(  ):
       """simple docstring"""





       lowercase__:    Optional[Any]        =      bool(os.getenv("RUN_SLOW"						,       0		)		)
       if run_slow and torch_device == "cuda":
              assert True
       else:
              assert False, "should have been skipped"







@require_torch
class 		_a       (						unittest.TestCase   ):





   '''simple docstring'''






   @slow
   @require_torch_gpu
   def __lowercase    (   self)	-> Optional[Any]:




          '''simple docstring'''




          check_slow_torch_cuda()





   @require_torch_gpu
   @slow
   def __lowercase    (   self)	-> List[str]:




          '''simple docstring'''




          check_slow_torch_cuda()





   @parameterized.expand(__snake_case)
   @slow
   def __lowercase    (   self			,				UpperCAmelCase_=None)	-> List[Any]:




          '''simple docstring'''




          check_slow()







@slow
@require_torch_gpu
def     A(  ):
       """simple docstring"""





       check_slow_torch_cuda()






@require_torch_gpu
@slow
def     A(  ):
       """simple docstring"""





       check_slow_torch_cuda()






@slow
@pytest.mark.parametrize("param"						,       [1]		)
def     A(  snake_case_		):
       """simple docstring"""





       check_slow()






@pytest.mark.parametrize("param"						,       [1]		)
@slow
def     A(  snake_case_		):
       """simple docstring"""





       check_slow()














"""simple docstring"""





from __future__ import annotations






def     A(  snake_case_						,       snake_case_		):
       """simple docstring"""





       lowercase__  ,     lowercase__:    Optional[int]        =      0, len(snake_case_		) - 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))






