


"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCamelCase_  :  Optional[Any]     		=    {"""configuration_sew_d""": ["""SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SEWDConfig"""]}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCamelCase_  :  str     		=    [
           """SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """SEWDForCTC""",
           """SEWDForSequenceClassification""",
           """SEWDModel""",
           """SEWDPreTrainedModel""",
       ]

if TYPE_CHECKING:
       from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_sew_d import (
                  SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
                  SEWDForCTC,
                  SEWDForSequenceClassification,
                  SEWDModel,
                  SEWDPreTrainedModel,
              )


else:
       import sys

       lowerCamelCase_  :  List[str]     		=    _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       str(snake_case     ).strip()
					if not bin_string:
										raise ValueError("""Empty string was passed to the function"""     )
					_lowerCAmelCase         =       bin_string[0] == """-"""
					if is_negative:
										_lowerCAmelCase         =       bin_string[1:]
					if not all(char in """01""" for char in bin_string     ):
										raise ValueError("""Non-binary value was passed to the function"""     )
					_lowerCAmelCase         =       0
					for char in bin_string:
										_lowerCAmelCase         =       2 * decimal_number + int(snake_case     )
					return -decimal_number if is_negative else decimal_number


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

	testmod()



