






'''simple docstring'''






def        _SCREAMING_SNAKE_CASE  (				A  :       list  ,		A  :       int = 0  )    -> list:







   """simple docstring"""
   __snake_case				:      Dict     							= length or len(A  )
   __snake_case				:      Any     							= False
   for i in range(length - 1  ):
      if list_data[i] > list_data[i + 1]:
         __snake_case				:      Tuple     							= list_data[i + 1], list_data[i]
         __snake_case				:      Optional[int]     							= True

   return list_data if not swapped else bubble_sort(A  ,		length - 1  )


if __name__ == "__main__":
      import doctest

      doctest.testmod()







'''simple docstring'''






from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
      import accelerate




def        _SCREAMING_SNAKE_CASE  (				A  :       Optional[Any]  )    -> int:







   """simple docstring"""
   if not is_accelerate_available():
      return method
   __snake_case				:      Optional[Any]     							= version.parse(accelerate.__version__  ).base_version
   if version.parse(A  ) < version.parse('0.17.0'  ):
      return method

   def wrapper(self  :       Optional[Any]  ,		*A  :       Optional[Any]  ,		**A  :       Optional[int]  ):
      if hasattr(self  ,		'_hf_hook'  ) and hasattr(self._hf_hook  ,		'pre_forward'  ):
         self._hf_hook.pre_forward(self  )
      return method(self  ,		*A  ,		**A  )

   return wrapper