






from typing import TYPE_CHECKING

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


UpperCAmelCase__            =	{"configuration_pegasus": ["PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP", "PegasusConfig"]}

try:
     if not is_sentencepiece_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase__            =	["PegasusTokenizer"]

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase__            =	["PegasusTokenizerFast"]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase__            =	[
         "PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST",
         "PegasusForCausalLM",
         "PegasusForConditionalGeneration",
         "PegasusModel",
         "PegasusPreTrainedModel",
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase__            =	[
         "TFPegasusForConditionalGeneration",
         "TFPegasusModel",
         "TFPegasusPreTrainedModel",
     ]

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase__            =	[
         "FlaxPegasusForConditionalGeneration",
         "FlaxPegasusModel",
         "FlaxPegasusPreTrainedModel",
     ]


if TYPE_CHECKING:
     from .configuration_pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig

     try:
          if not is_sentencepiece_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_pegasus import PegasusTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_pegasus_fast import PegasusTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_pegasus import (
              PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
              PegasusForCausalLM,
              PegasusForConditionalGeneration,
              PegasusModel,
              PegasusPreTrainedModel,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_pegasus import TFPegasusForConditionalGeneration, TFPegasusModel, TFPegasusPreTrainedModel

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_pegasus import (
              FlaxPegasusForConditionalGeneration,
              FlaxPegasusModel,
              FlaxPegasusPreTrainedModel,
          )

else:
     import sys

     UpperCAmelCase__            =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)










from collections import namedtuple

UpperCAmelCase__            =	namedtuple("from_to", "from_ to")

UpperCAmelCase__            =	{
    "atm": from_to(1, 1),
    "pascal": from_to(0.000_0098, 101325),
    "bar": from_to(0.98_6923, 1.0_1325),
    "kilopascal": from_to(0.0098_6923, 101.325),
    "megapascal": from_to(9.8_6923, 0.10_1325),
    "psi": from_to(0.06_8046, 14.6959),
    "inHg": from_to(0.033_4211, 29.9213),
    "torr": from_to(0.0013_1579, 760),
}
def 		_a					(   a				:float			,							a				:str			,							a				:str				)							->    float:
 if from_type not in PRESSURE_CONVERSION:
  raise ValueError(
      F"""Invalid 'from_type' value: {from_type!r}  Supported values are:\n"""
      + ''', '''.join(a				)				)
 if to_type not in PRESSURE_CONVERSION:
  raise ValueError(
      F"""Invalid 'to_type' value: {to_type!r}.  Supported values are:\n"""
      + ''', '''.join(a				)				)
 return (
     value * PRESSURE_CONVERSION[from_type].from_ * PRESSURE_CONVERSION[to_type].to
 )


if __name__ == "__main__":
     import doctest

     doctest.testmod()


