



def      __lowercase(						UpperCAmelCase__			):


      """simple docstring"""



      if not isinstance(_a , _a			):
            raise ValueError("Input series is not valid, valid series - [2, 4, 6]"			)
      if len(_a			) == 0:
            raise ValueError("Input list must be a non empty list"			)
      if len(_a			) == 1:
            return True
      lowerCamelCase             =		series[1] - series[0]
      for index in range(len(_a			) - 1			):
            if series[index + 1] - series[index] != common_diff:
                  return False
      return True

def      __lowercase(						UpperCAmelCase__			):


      """simple docstring"""



      if not isinstance(_a , _a			):
            raise ValueError("Input series is not valid, valid series - [2, 4, 6]"			)
      if len(_a			) == 0:
            raise ValueError("Input list must be a non empty list"			)
      lowerCamelCase             =		0
      for val in series:
            answer += val
      return answer / len(_a			)


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




