
"""simple docstring"""



from __future__ import annotations

from typing import Any





class 				a			:



      def __init__(   self     ,	UpperCamelCase_ = 6      ):
          UpperCAmelCase__	:      Node | None     							=					None
          UpperCAmelCase__	:      Node | None     							=					None
          self.create_linked_list(UpperCamelCase_      )



      def  __snake_case							(   self     ,	UpperCamelCase_      ):
          UpperCAmelCase__	:      Optional[Any]     							=					Node()
          UpperCAmelCase__	:      Union[str, Any]     							=					current_node
          UpperCAmelCase__	:      Any     							=					current_node
          UpperCAmelCase__	:      Dict     							=					current_node
          for _ in range(1     ,	UpperCamelCase_      ):
              UpperCAmelCase__	:      Any     							=					Node()
              UpperCAmelCase__	:      List[Any]     							=					current_node
              UpperCAmelCase__	:      List[str]     							=					previous_node
              UpperCAmelCase__	:      Any     							=					current_node
          UpperCAmelCase__	:      Optional[int]     							=					self.front
          UpperCAmelCase__	:      List[str]     							=					previous_node



      def  __snake_case							(   self      ):
          return (
              self.front == self.rear
              and self.front is not None
              and self.front.data is None
          )



      def  __snake_case							(   self      ):
          self.check_can_perform_operation()
          return self.front.data if self.front else None



      def  __snake_case							(   self     ,	UpperCamelCase_      ):
          if self.rear is None:
              return

          self.check_is_full()
          if not self.is_empty():
              UpperCAmelCase__	:      List[Any]     							=					self.rear.next
          if self.rear:
              UpperCAmelCase__	:      int     							=					data



      def  __snake_case							(   self      ):
          self.check_can_perform_operation()
          if self.rear is None or self.front is None:
              return None
          if self.front == self.rear:
              UpperCAmelCase__	:      Tuple     							=					self.front.data
              UpperCAmelCase__	:      Optional[int]     							=					None
              return data

          UpperCAmelCase__	:      Optional[int]     							=					self.front
          UpperCAmelCase__	:      Optional[int]     							=					old_front.next
          UpperCAmelCase__	:      List[str]     							=					old_front.data
          UpperCAmelCase__	:      str     							=					None
          return data



      def  __snake_case							(   self      ):
          if self.is_empty():
              raise Exception('Empty Queue'      )



      def  __snake_case							(   self      ):
          if self.rear and self.rear.next == self.front:
              raise Exception('Full Queue'      )





class 				a			:



      def __init__(   self      ):
          UpperCAmelCase__	:      Any | None     							=					None
          UpperCAmelCase__	:      Node | None     							=					None
          UpperCAmelCase__	:      Node | None     							=					None


if __name__ == "__main__":
    import doctest

    doctest.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__)

