





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


def       UpperCamelCase__(			UpperCamelCase__     :			list    )->float:
       if not isinstance(UpperCamelCase__					,	UpperCamelCase__    ):
              raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''    )
       if len(UpperCamelCase__    ) == 0:
              raise ValueError('''Input list must be a non empty list'''    )
       A__		   =		0
       for val in series:
              answer += val
       return answer / len(UpperCamelCase__    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()












from typing import TYPE_CHECKING

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


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

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a__: Union[str, Any]							   =						[
           '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

       a__: Union[str, Any]							   =						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





