




from collections.abc import Iterable
from typing import Generic, TypeVar

_lowerCamelCase      :  Union[str, Any]      						=						TypeVar("_T")
class        __snake_case  (Generic[_T]		):



				def __init__(      self      :		Union[str, Any]		,	_UpperCAmelCase      :		Iterable[_T] | None = None      )  ->    None:





								'''simple docstring'''




								_lowerCAmelCase    :    list[_T]										=      list(iterable or []      )
								_lowerCAmelCase    :    list[_T]										=      []



				def __len__(      self      :		Union[str, Any]      )  ->    int:





								'''simple docstring'''




								return len(self._stacka      ) + len(self._stacka      )



				def __repr__(      self      :		Union[str, Any]      )  ->    str:





								'''simple docstring'''




								return f"Queue({tuple(self._stacka[::-1] + self._stacka      )})"



				def       SCREAMING_SNAKE_CASE       (      self      :		Any		,	_UpperCAmelCase      :		_T      )  ->    None:





								'''simple docstring'''




								self._stacka.append(_UpperCAmelCase      )



				def       SCREAMING_SNAKE_CASE       (      self      :		Union[str, Any]      )  ->    _T:





								'''simple docstring'''




								_lowerCAmelCase    :    Optional[Any]										=      self._stacka.pop
								_lowerCAmelCase    :    Dict										=      self._stacka.append

								if not self._stacka:
												while self._stacka:
																stacka_append(stacka_pop()      )

								if not self._stacka:
												raise IndexError("""Queue is empty"""      )
								return self._stacka.pop()


if __name__ == "__main__":
	from doctest import testmod

	testmod()











def 							_UpperCAmelCase  (UpperCamelCase_ : str      ,    UpperCamelCase_ : bool = False       ):
				'''simple docstring'''

				if not isinstance(UpperCamelCase_      ,    UpperCamelCase_       ):
								_lowerCAmelCase    :    Tuple										=      F"Expected string as input, found {type(UpperCamelCase_       )}"
								raise ValueError(UpperCamelCase_       )
				if not isinstance(UpperCamelCase_      ,    UpperCamelCase_       ):
								_lowerCAmelCase    :    Optional[Any]										=      F"Expected boolean as use_pascal parameter, found {type(UpperCamelCase_       )}"
								raise ValueError(UpperCamelCase_       )

				_lowerCAmelCase    :    Any										=      input_str.split("""_"""       )

				_lowerCAmelCase    :    str										=      0 if use_pascal else 1

				_lowerCAmelCase    :    Any										=      words[start_index:]

				_lowerCAmelCase    :    List[str]										=      [word[0].upper() + word[1:] for word in words_to_capitalize]

				_lowerCAmelCase    :    Any										=      """""" if use_pascal else words[0]

				return "".join([initial_word, *capitalized_words]       )


if __name__ == "__main__":
	from doctest import testmod

	testmod()

