





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


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

     testmod()








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_UpperCamelCase       = {'''configuration_nat''': ['''NAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''NatConfig''']}


try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase       = [
         '''NAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''NatForImageClassification''',
         '''NatModel''',
         '''NatPreTrainedModel''',
         '''NatBackbone''',
     ]

if TYPE_CHECKING:
     from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_nat import (
              NAT_PRETRAINED_MODEL_ARCHIVE_LIST,
              NatBackbone,
              NatForImageClassification,
              NatModel,
              NatPreTrainedModel,
          )

else:
     import sys

     _UpperCamelCase       = _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

