




'''simple docstring'''





from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
   import accelerate





def       __a      (  _UpperCamelCase:       Optional[Any]       )		->					Optional[Any]:

     """simple docstring"""




     if not is_accelerate_available():
          return method
     _snake_case				= version.parse(accelerate.__version__       ).base_version
     if version.parse(_UpperCamelCase       ) < version.parse("0.17.0"       ):
          return method

     def wrapper(self:       str   ,		*_UpperCamelCase:       Any   ,		**_UpperCamelCase:       Dict       ):
          if hasattr(self   ,		"_hf_hook"       ) and hasattr(self._hf_hook   ,		"pre_forward"       ):
               self._hf_hook.pre_forward(self       )
          return method(self   ,		*_UpperCamelCase   ,		**_UpperCamelCase       )

     return wrapper








'''simple docstring'''





from typing import Any

class   _a							:






     def __init__(					self   ,_SCREAMING_SNAKE_CASE       )				->     List[str]:
          _snake_case				= data
          _snake_case				= None







class   _a							:






     def __init__(					self       )				->     List[Any]:
          _snake_case				= None






     def 							_lowercase      (					self       )				->     str:
          _snake_case				= self.head
          while temp is not None:
               print(temp.data   ,end=" "       )
               _snake_case				= temp.next
          print()






     def 							_lowercase      (					self   ,_SCREAMING_SNAKE_CASE       )				->     Dict:
          _snake_case				= Node(_SCREAMING_SNAKE_CASE       )
          _snake_case				= self.head
          _snake_case				= new_node






     def 							_lowercase      (					self   ,_SCREAMING_SNAKE_CASE   ,_SCREAMING_SNAKE_CASE       )				->     Tuple:
          if node_data_a == node_data_a:
               return
          else:
               _snake_case				= self.head
               while node_a is not None and node_a.data != node_data_a:
                    _snake_case				= node_a.next

               _snake_case				= self.head
               while node_a is not None and node_a.data != node_data_a:
                    _snake_case				= node_a.next

               if node_a is None or node_a is None:
                    return

               _snake_case				,   _snake_case				= node_a.data, node_a.data


if __name__ == "__main__":
   UpperCamelCase_		:     str          =		LinkedList()
   for i in range(5, 0, -1):
      ll.push(i)

   ll.print_list()

   ll.swap_nodes(1, 4)
   print('''After swapping''')
   ll.print_list()


