




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_snake_case										=       {
    "configuration_nllb_moe": [
        "NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "NllbMoeConfig",
    ]
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case										=       [
      "NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST",
      "NllbMoeForConditionalGeneration",
      "NllbMoeModel",
      "NllbMoePreTrainedModel",
      "NllbMoeTop2Router",
      "NllbMoeSparseMLP",
  ]


if TYPE_CHECKING:
  from .configuration_nllb_moe import (
      NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
      NllbMoeConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_nllb_moe import (
        NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
        NllbMoeForConditionalGeneration,
        NllbMoeModel,
        NllbMoePreTrainedModel,
        NllbMoeSparseMLP,
        NllbMoeTopaRouter,
    )


else:
  import sys

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






'''simple docstring'''





def        a_     (							_lowerCAmelCase       )      ->      str:
  if not all(char in '01' for char in bin_string       ):
    raise ValueError('Non-binary value was passed to the function'       )
  if not bin_string:
    raise ValueError('Empty string was passed to the function'       )
  __lowerCamelCase       :       int           = ''
  while len(_lowerCAmelCase       ) % 3 != 0:
    __lowerCamelCase       :       str           = '0' + bin_string
  __lowerCamelCase       :       Union[str, Any]           = [
      bin_string[index : index + 3]
      for index in range(len(_lowerCAmelCase       )       )
      if index % 3 == 0
  ]
  for bin_group in bin_string_in_3_list:
    __lowerCamelCase       :       Tuple           = 0
    for index, val in enumerate(_lowerCAmelCase       ):
      oct_val += int(2 ** (2 - index) * int(_lowerCAmelCase       )       )
    oct_string += str(_lowerCAmelCase       )
  return oct_string


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

   testmod()






