



'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE__     : Dict				=   {
    """configuration_decision_transformer""": [
        """DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """DecisionTransformerConfig""",
    ],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							SCREAMING_SNAKE_CASE__     : List[str]				=   [
							    """DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """DecisionTransformerGPT2Model""",
							    """DecisionTransformerGPT2PreTrainedModel""",
							    """DecisionTransformerModel""",
							    """DecisionTransformerPreTrainedModel""",
							]


if TYPE_CHECKING:
							from .configuration_decision_transformer import (
							    DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    DecisionTransformerConfig,
							)

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_decision_transformer import (
														    DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DecisionTransformerGPTaModel,
														    DecisionTransformerGPTaPreTrainedModel,
														    DecisionTransformerModel,
														    DecisionTransformerPreTrainedModel,
														)


else:
							import sys

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



from __future__ import annotations





def  _snake_case		(snake_case_					:     str  )							->		bool:
  __UpperCAmelCase	:  int
  __UpperCAmelCase	:  list[str]		=     list(snake_case_  )
  __UpperCAmelCase,			__UpperCAmelCase	:  Any		=     _vector[:-1], int(_vector[-1]  )
  __UpperCAmelCase	:  list[int]		=     [int(snake_case_  ) for digit in __vector]

  vector.reverse()
  for i, digit in enumerate(snake_case_  ):
    if i & 1 == 0:
      __UpperCAmelCase	:  int		=     digit * 2
      if doubled > 9:
        doubled -= 9
      check_digit += doubled
    else:
      check_digit += digit

  return check_digit % 10 == 0


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      assert is_luhn('''79927398713''')
      assert not is_luhn('''79927398714''')





