



'''simple docstring'''






from typing import TYPE_CHECKING

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


lowerCAmelCase: List[str]							=						{
    '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:
     lowerCAmelCase: int							=						['FunnelTokenizerFast']

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

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




'''simple docstring'''






lowerCAmelCase: Union[str, Any]							=						{
    'meter': 'm',
    'kilometer': 'km',
    'megametre': 'Mm',
    'gigametre': 'Gm',
    'terametre': 'Tm',
    'petametre': 'Pm',
    'exametre': 'Em',
    'zettametre': 'Zm',
    'yottametre': 'Ym',
}
# Exponent of the factor(meter)
lowerCAmelCase: Optional[Any]							=						{
    'm': 0,
    'km': 3,
    'Mm': 6,
    'Gm': 9,
    'Tm': 1_2,
    'Pm': 1_5,
    'Em': 1_8,
    'Zm': 2_1,
    'Ym': 2_4,
}
def 				lowerCamelCase__	(						_A			,      _A			,      _A    ):
  a						: Optional[int]					       =					from_type.lower().strip('s'    )
  a						: Optional[Any]					       =					to_type.lower().strip('s'    )

  a						: Dict					       =					UNIT_SYMBOL.get(_A			,      _A    )
  a						: Optional[Any]					       =					UNIT_SYMBOL.get(_A			,      _A    )

  if from_sanitized not in METRIC_CONVERSION:
    a						: Optional[Any]					       =					(
        f"""Invalid 'from_type' value: {from_type!r}.\n"""
        f"""Conversion abbreviations are: {", ".join(_A    )}"""
    )
    raise ValueError(_A    )
  if to_sanitized not in METRIC_CONVERSION:
    a						: Union[str, Any]					       =					(
        f"""Invalid 'to_type' value: {to_type!r}.\n"""
        f"""Conversion abbreviations are: {", ".join(_A    )}"""
    )
    raise ValueError(_A    )
  a						: List[Any]					       =					METRIC_CONVERSION[from_sanitized]
  a						: int					       =					METRIC_CONVERSION[to_sanitized]
  a						: Tuple					       =					1

  if from_exponent > to_exponent:
    a						: Optional[int]					       =					from_exponent - to_exponent
  else:
    a						: Optional[Any]					       =					-(to_exponent - from_exponent)

  return value * pow(10			,      _A    )


if __name__ == "__main__":
     from doctest import testmod

     testmod()