




'''simple docstring'''

from __future__ import annotations

from collections.abc import Iterable
from dataclasses import dataclass
from typing import Any





class __magic_name__:
						UpperCAmelCase_		:					int    =  ("""_front""", """_back""", """_len""")





						@dataclass
						class __magic_name__:
												UpperCAmelCase_		:					Any    =  None
												UpperCAmelCase_		:					Deque._Node | None    =  None
												UpperCAmelCase_		:					Deque._Node | None    =  None







						class __magic_name__:
												UpperCAmelCase_		:					str    =  ("""_cur""",)






												def __init__(   self						:						Union[str, Any]					,   __UpperCamelCase						:						Deque._Node | None       ):



															'''simple docstring'''






															snake_case__          =						cur






												def __iter__(   self						:						int       ):



															'''simple docstring'''






															return self







												def       __lowerCAmelCase(   self						:						Optional[Any]       ):



															'''simple docstring'''






															if self._cur is None:
																		# finished iterating
																		raise StopIteration
															snake_case__          =						self._cur.val
															snake_case__          =						self._cur.next_node

															return val







						def __init__(   self						:						int					,   __UpperCamelCase						:						Iterable[Any] | None = None       ):



									'''simple docstring'''






									snake_case__          =						None
									snake_case__          =						None
									snake_case__          =						0

									if iterable is not None:
												# append every value to the deque
												for val in iterable:
															self.append(__UpperCamelCase       )






						def       __lowerCAmelCase(   self						:						List[Any]					,   __UpperCamelCase						:						Any       ):



									'''simple docstring'''






									snake_case__          =						self._Node(__UpperCamelCase					,   __UpperCamelCase					,   __UpperCamelCase       )
									if self.is_empty():
												# front = back
												snake_case__          =						snake_case__          =						node
												snake_case__          =						1
									else:
												# connect nodes
												snake_case__          =						node
												snake_case__          =						self._back
												snake_case__          =						node  # assign new back to the new node

												self._len += 1

												# make sure there were no errors
												assert not self.is_empty(), "Error on appending value."






						def       __lowerCAmelCase(   self						:						Optional[int]					,   __UpperCamelCase						:						Any       ):



									'''simple docstring'''






									snake_case__          =						self._Node(__UpperCamelCase					,   __UpperCamelCase					,   __UpperCamelCase       )
									if self.is_empty():
												# front = back
												snake_case__          =						snake_case__          =						node
												snake_case__          =						1
									else:
												# connect nodes
												snake_case__          =						self._front
												snake_case__          =						node
												snake_case__          =						node  # assign new front to the new node

												self._len += 1

												# make sure there were no errors
												assert not self.is_empty(), "Error on appending value."






						def       __lowerCAmelCase(   self						:						Optional[Any]					,   __UpperCamelCase						:						Iterable[Any]       ):



									'''simple docstring'''






									for val in iterable:
												self.append(__UpperCamelCase       )






						def       __lowerCAmelCase(   self						:						Optional[int]					,   __UpperCamelCase						:						Iterable[Any]       ):



									'''simple docstring'''






									for val in iterable:
												self.appendleft(__UpperCamelCase       )






						def       __lowerCAmelCase(   self						:						Optional[int]       ):



									'''simple docstring'''






									assert not self.is_empty(), "Deque is empty."

									snake_case__          =						self._back
									snake_case__          =						self._back.prev_node  # set new back
									# drop the last node - python will deallocate memory automatically
									snake_case__          =						None

									self._len -= 1

									return topop.val






						def       __lowerCAmelCase(   self						:						List[Any]       ):



									'''simple docstring'''






									assert not self.is_empty(), "Deque is empty."

									snake_case__          =						self._front
									snake_case__          =						self._front.next_node  # set new front and drop the first node
									snake_case__          =						None

									self._len -= 1

									return topop.val






						def       __lowerCAmelCase(   self						:						Optional[int]       ):



									'''simple docstring'''






									return self._front is None






						def __len__(   self						:						str       ):



									'''simple docstring'''






									return self._len






						def __eq__(   self						:						List[Any]					,   __UpperCamelCase						:						object       ):



									'''simple docstring'''






									if not isinstance(__UpperCamelCase					,   __UpperCamelCase       ):
												return NotImplemented

									snake_case__          =						self._front
									snake_case__          =						other._front

									# if the length of the dequeues are not the same, they are not equal
									if len(self       ) != len(__UpperCamelCase       ):
												return False

									while me is not None and oth is not None:
												# compare every value
												if me.val != oth.val:
															return False
												snake_case__          =						me.next_node
												snake_case__          =						oth.next_node

									return True






						def __iter__(   self						:						Dict       ):



									'''simple docstring'''






									return Deque._Iterator(self._front       )







						def __repr__(   self						:						List[Any]       ):



									'''simple docstring'''






									snake_case__          =						[]
									snake_case__          =						self._front
									while aux is not None:
												# append the values in a list to display
												values_list.append(aux.val       )
												snake_case__          =						aux.next_node

									return f"""[{", ".join(repr(__UpperCamelCase       ) for val in values_list       )}]"""


if __name__ == "__main__":
		import doctest

		doctest.testmod()



def 	_lowerCamelCase  (		A_  :	float							,  A_  :	float							,  A_  :	int      )			->			float:

   '''simple docstring'''






   UpperCamelCase__ :			Union[str, Any] 						=[1 / first_term]
   UpperCamelCase__ :			Tuple 						=1 / first_term
   for _ in range(number_of_terms - 1      ):
      first_term += common_difference
      arithmetic_progression.append(A_      )
   UpperCamelCase__ :			List[str] 						=[1 / step for step in arithmetic_progression]
   return sum(A_      )


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     print(sum_of_harmonic_progression(1 / 2, 2, 2))

