


'''simple docstring'''
import unittest

from accelerate import debug_launcher
from accelerate.test_utils import require_cpu, test_ops, test_script
@require_cpu
class      lowercase			(							unittest.TestCase      ):

		"""simple docstring"""

		def 					lowerCAmelCase__       (	self							):

							'''simple docstring'''


							debug_launcher(test_script.main							)




		def 					lowerCAmelCase__       (	self							):

							'''simple docstring'''


							debug_launcher(test_ops.main							)



'''simple docstring'''
class      lowercase			:

		"""simple docstring"""

		def __init__(	self					,     UpperCamelCase_							):

							'''simple docstring'''


							UpperCamelCase__     :Union[str, Any]							      =				n
							UpperCamelCase__     :Tuple							      =				[None] * self.n
							UpperCamelCase__     :str							      =				0  # index of the first element
							UpperCamelCase__     :List[Any]							      =				0
							UpperCamelCase__     :Dict							      =				0




		def __len__(	self							):

							'''simple docstring'''


							return self.size




		def 					lowerCAmelCase__       (	self							):

							'''simple docstring'''


							return self.size == 0




		def 					lowerCAmelCase__       (	self							):

							'''simple docstring'''


							return False if self.is_empty() else self.array[self.front]




		def 					lowerCAmelCase__       (	self					,     UpperCamelCase_							):

							'''simple docstring'''


							if self.size >= self.n:
												raise Exception('''QUEUE IS FULL'''							)

							UpperCamelCase__     :List[Any]							      =				data
							UpperCamelCase__     :List[Any]							      =				(self.rear + 1) % self.n
							self.size += 1
							return self




		def 					lowerCAmelCase__       (	self							):

							'''simple docstring'''


							if self.size == 0:
												raise Exception('''UNDERFLOW'''							)

							UpperCamelCase__     :Dict							      =				self.array[self.front]
							UpperCamelCase__     :Union[str, Any]							      =				None
							UpperCamelCase__     :Union[str, Any]							      =				(self.front + 1) % self.n
							self.size -= 1
							return temp