






"""simple docstring"""

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

lowercase__  			=					TypeVar("""_T""")


class 						__lowerCamelCase							(					Generic[_T]     ):





		'''simple docstring'''






		def __init__(  self				:      Dict		,     a_				:      str = None      ):
				lowerCAmelCase_  :				list[_T]   							=     list(iterable or []      )
				lowerCAmelCase_  :				list[_T]   							=     []





		def __len__(  self				:      List[str]      ):
				return len(self._stacka      ) + len(self._stacka      )





		def __repr__(  self				:      Dict      ):
				return f'''Queue({tuple(self._stacka[::-1] + self._stacka      )})'''





		def   lowerCamelCase			(  self				:      Union[str, Any]		,     a_				:      int      ):
				self._stacka.append(UpperCamelCase_      )





		def   lowerCamelCase			(  self				:      int      ):
				lowerCAmelCase_  :				List[str]   							=     self._stacka.pop
				lowerCAmelCase_  :				Optional[Any]   							=     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()


"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCamelCase__          =	{
    'configuration_mega': ['MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegaConfig', 'MegaOnnxConfig'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase__          =	[
        'MEGA_PRETRAINED_MODEL_ARCHIVE_LIST',
        'MegaForCausalLM',
        'MegaForMaskedLM',
        'MegaForMultipleChoice',
        'MegaForQuestionAnswering',
        'MegaForSequenceClassification',
        'MegaForTokenClassification',
        'MegaModel',
        'MegaPreTrainedModel',
    ]

if TYPE_CHECKING:
    from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_mega import (
            MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
            MegaForCausalLM,
            MegaForMaskedLM,
            MegaForMultipleChoice,
            MegaForQuestionAnswering,
            MegaForSequenceClassification,
            MegaForTokenClassification,
            MegaModel,
            MegaPreTrainedModel,
        )

else:
    import sys

    UpperCamelCase__          =	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

