

from typing import TYPE_CHECKING

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


lowercase_     :   List[Any] 				=				{
    'configuration_funnel': ['FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FunnelConfig'],
    'convert_funnel_original_tf_checkpoint_to_pytorch': [],
    'tokenization_funnel': ['FunnelTokenizer'],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_     :   int 				=				['FunnelTokenizerFast']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_     :   Optional[int] 				=				[
          'FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
          'FunnelBaseModel',
          'FunnelForMaskedLM',
          'FunnelForMultipleChoice',
          'FunnelForPreTraining',
          'FunnelForQuestionAnswering',
          'FunnelForSequenceClassification',
          'FunnelForTokenClassification',
          'FunnelModel',
          'FunnelPreTrainedModel',
          'load_tf_weights_in_funnel',
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_     :   Optional[Any] 				=				[
          'TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST',
          'TFFunnelBaseModel',
          'TFFunnelForMaskedLM',
          'TFFunnelForMultipleChoice',
          'TFFunnelForPreTraining',
          'TFFunnelForQuestionAnswering',
          'TFFunnelForSequenceClassification',
          'TFFunnelForTokenClassification',
          'TFFunnelModel',
          'TFFunnelPreTrainedModel',
      ]


if TYPE_CHECKING:
      from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
      from .tokenization_funnel import FunnelTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_funnel_fast import FunnelTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_funnel import (
                FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                FunnelBaseModel,
                FunnelForMaskedLM,
                FunnelForMultipleChoice,
                FunnelForPreTraining,
                FunnelForQuestionAnswering,
                FunnelForSequenceClassification,
                FunnelForTokenClassification,
                FunnelModel,
                FunnelPreTrainedModel,
                load_tf_weights_in_funnel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_funnel import (
                TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFFunnelBaseModel,
                TFFunnelForMaskedLM,
                TFFunnelForMultipleChoice,
                TFFunnelForPreTraining,
                TFFunnelForQuestionAnswering,
                TFFunnelForSequenceClassification,
                TFFunnelForTokenClassification,
                TFFunnelModel,
                TFFunnelPreTrainedModel,
            )

else:
      import sys

      lowercase_     :   Optional[int] 				=				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


# Lint as: python3
import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


lowercase_     :   str 				=				re.compile(R'^(?P<major>\d+)' R'\.(?P<minor>\d+)' R'\.(?P<patch>\d+)$')






@total_ordering
@dataclass
class 		_lowerCamelCase		:
    __a  =      42
    __a  =      None
    __a  =      None
    __a  =      None
    __a  =      None
    def 						UpperCamelCase_				(  self   )       ->					str:
     SCREAMING_SNAKE_CASE__,	SCREAMING_SNAKE_CASE__,	SCREAMING_SNAKE_CASE__:   int=      _str_to_version_tuple(self.version_str   )
    def __repr__(  self   )       ->					Dict:
     return f'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'
    @property
    def 						UpperCamelCase_				(  self   )       ->					List[str]:
     return self.major, self.minor, self.patch
    def 						UpperCamelCase_				(  self , lowerCAmelCase   )       ->					Dict:
     if isinstance(lowerCAmelCase , lowerCAmelCase   ):
      return Version(lowerCAmelCase   )
     elif isinstance(lowerCAmelCase , lowerCAmelCase   ):
      return other
     raise TypeError(f'{other} (type {type(lowerCAmelCase   )}) cannot be compared to version.'   )
    def __eq__(  self , lowerCAmelCase   )       ->					Optional[int]:
     try:
      SCREAMING_SNAKE_CASE__:   List[str]=      self._validate_operand(lowerCAmelCase   )
     except (TypeError, ValueError):
      return False
     else:
      return self.tuple == other.tuple
    def __lt__(  self , lowerCAmelCase   )       ->					List[str]:
     SCREAMING_SNAKE_CASE__:   Optional[Any]=      self._validate_operand(lowerCAmelCase   )
     return self.tuple < other.tuple
    def __hash__(  self   )       ->					List[Any]:
     return hash(_version_tuple_to_str(self.tuple   )   )
    @classmethod
    def 						UpperCamelCase_				(  cls , lowerCAmelCase   )       ->					Tuple:
     SCREAMING_SNAKE_CASE__:   Dict=      {f.name for f in dataclasses.fields(cls   )}
     return cls(**{k: v for k, v in dic.items() if k in field_names}   )



    def 						UpperCamelCase_				(  self   )       ->					str:
     return self.version_str







def 			A__      (	snake_case_ :		int      ):
 SCREAMING_SNAKE_CASE__:   List[Any]=      _VERSION_REG.match(snake_case_      )
 if not res:
  raise ValueError(F'Invalid version \'{version_str}\'. Format should be x.y.z with {{x,y,z}} being digits.'      )
 return tuple(int(snake_case_      ) for v in [res.group('''major'''      ), res.group('''minor'''      ), res.group('''patch'''      )]      )







def 			A__      (	snake_case_ :		Union[str, Any]      ):
 return ".".join(str(snake_case_      ) for v in version_tuple      )

