






"""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

lowercase_								=	[(1,)]



def    lowerCAmelCase							(       ):




  """simple docstring"""







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



def    lowerCAmelCase							(       ):




  """simple docstring"""







  __A		     =					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    snake_case						(				unittest.TestCase		):


   '''simple docstring'''

   @slow
   @require_torch_gpu
   def 							_SCREAMING_SNAKE_CASE							(      self					:	Optional[int]    ):

     '''simple docstring'''
     check_slow_torch_cuda()


   @require_torch_gpu
   @slow
   def 							_SCREAMING_SNAKE_CASE							(      self					:	Union[str, Any]    ):

     '''simple docstring'''
     check_slow_torch_cuda()






   @parameterized.expand(_lowerCamelCase    )
   @slow
   def 							_SCREAMING_SNAKE_CASE							(      self					:	List[str],			_lowerCamelCase					:	Any=None    ):

     '''simple docstring'''
     check_slow()





@slow
@require_torch_gpu
def    lowerCAmelCase							(       ):




  """simple docstring"""







  check_slow_torch_cuda()



@require_torch_gpu
@slow
def    lowerCAmelCase							(       ):




  """simple docstring"""







  check_slow_torch_cuda()



@slow
@pytest.mark.parametrize('''param'''						,			[1]					)
def    lowerCAmelCase							(       __UpperCamelCase					):




  """simple docstring"""







  check_slow()





@pytest.mark.parametrize('''param'''						,			[1]					)
@slow
def    lowerCAmelCase							(       __UpperCamelCase					):




  """simple docstring"""







  check_slow()





'''simple docstring'''


def    _lowerCamelCase       ( lowerCamelCase_   :				list  ):



     """simple docstring"""





     UpperCAmelCase_				:  Optional[int]  = len(lowerCamelCase_  )

     # Set the gap value to be decreased by a factor of 1.3
     # after each iteration
     UpperCAmelCase_				:  Optional[Any]  = 1.3

     # Continue sorting until the gap is 1
     while gap > 1:
          # Decrease the gap value
          UpperCAmelCase_				:  Optional[Any]  = int(gap / shrink  )

          # Sort the elements using insertion sort
          for i in range(lowerCamelCase_      ,	len(lowerCamelCase_  )  ):
               UpperCAmelCase_				:  Optional[int]  = collection[i]
               UpperCAmelCase_				:  Tuple  = i
               while j >= gap and collection[j - gap] > temp:
                    UpperCAmelCase_				:  Tuple  = collection[j - gap]
                    j -= gap
               UpperCAmelCase_				:  Optional[int]  = temp

     return collection


if __name__ == "__main__":
 import doctest

 doctest.testmod()






