


"""simple docstring"""






import importlib.metadata
import subprocess
import sys





def 							A_					(   snake_case__ = False		)				->     int:
			_UpperCamelCase				:Union[str, Any]				    =  False
			if "IPython" in sys.modules:
						_UpperCamelCase				:Tuple				    =  '''google.colab''' in str(sys.modules['''IPython'''].get_ipython()		)

			if in_colab:
						if upgrade:
									_UpperCamelCase				:Dict				    =  ['''pip''', '''install''', '''-U''', '''torch''']
									subprocess.run(snake_case__					,				check=snake_case__		)
						# get the current version of torch
						_UpperCamelCase				:Optional[int]				    =  importlib.metadata.version('''torch'''		)
						_UpperCamelCase				:Union[str, Any]				    =  torch_version[: torch_version.rindex('''.'''		)]
						_UpperCamelCase				:List[str]				    =  f"https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"
						_UpperCamelCase				:str				    =  ['''pip''', '''install''', xla_wheel]
						subprocess.run(snake_case__					,				check=snake_case__		)
			else:
						raise RuntimeError('''`install_xla` utility works only on google colab.'''		)





"""simple docstring"""






class     A:

		"""simple docstring"""





		def __init__(   self      )			->  List[str]:

					"""simple docstring"""



					_UpperCamelCase				:List[Any]				    =  []
					_UpperCamelCase				:Dict				    =  0
					_UpperCamelCase				:List[Any]				    =  0
		def __str__(   self      )			->  Optional[int]:

					"""simple docstring"""



					_UpperCamelCase				:Optional[Any]				    =  '''<''' + str(self.entries      )[1:-1] + '''>'''
					return printed
		def      _UpperCamelCase(   self				,							SCREAMING_SNAKE_CASE__      )			->  Tuple:

					"""simple docstring"""



					self.entries.append(SCREAMING_SNAKE_CASE__      )
					_UpperCamelCase				:Union[str, Any]				    =  self.length + 1
		def      _UpperCamelCase(   self      )			->  Dict:

					"""simple docstring"""



					_UpperCamelCase				:str				    =  self.length - 1
					_UpperCamelCase				:Optional[int]				    =  self.entries[self.front]
					# self.front-=1
					# self.entries = self.entries[self.front:]
					_UpperCamelCase				:Tuple				    =  self.entries[1:]
					return dequeued
		def      _UpperCamelCase(   self				,							SCREAMING_SNAKE_CASE__      )			->  str:

					"""simple docstring"""



					for _ in range(SCREAMING_SNAKE_CASE__      ):
								self.put(self.get()      )
		def      _UpperCamelCase(   self      )			->  str:

					"""simple docstring"""



					return self.entries[0]
		def      _UpperCamelCase(   self      )			->  Union[str, Any]:

					"""simple docstring"""



					return self.length

