






def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			str    )						->      bool:





    """simple docstring"""

    return credit_card_number.startswith(("""34""", """35""", """37""", """4""", """5""", """6""")    )



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			str    )						->      bool:





    """simple docstring"""

    __A         =	credit_card_number
    __A         =	0
    __A         =	len(__lowercase    ) - 2
    for i in range(__lowercase			,				-1			,				-2    ):
        #  double the value of every second digit
        __A         =	int(cc_number[i]    )
        digit *= 2
        # If doubling of a number results in a two digit number
        # i.e greater than 9(e.g., 6 × 2 = 12),
        # then add the digits of the product (e.g., 12: 1 + 2 = 3, 15: 1 + 5 = 6),
        # to get a single digit number.
        if digit > 9:
            digit %= 1_0
            digit += 1
        __A         =	cc_number[:i] + str(__lowercase    ) + cc_number[i + 1 :]
        total += digit

    # Sum up the remaining digits
    for i in range(len(__lowercase    ) - 1			,				-1			,				-2    ):
        total += int(cc_number[i]    )

    return total % 1_0 == 0



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			str    )						->      bool:





    """simple docstring"""

    __A         =	f"{credit_card_number} is an invalid credit card number because"
    if not credit_card_number.isdigit():
        print(f"{error_message} it has nonnumerical characters."    )
        return False

    if not 1_3 <= len(__lowercase    ) <= 1_6:
        print(f"{error_message} of its length."    )
        return False

    if not validate_initial_digits(__lowercase    ):
        print(f"{error_message} of its first two digits."    )
        return False

    if not luhn_validation(__lowercase    ):
        print(f"{error_message} it fails the Luhn check."    )
        return False

    print(f"{credit_card_number} is a valid credit card number."    )
    return True


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  validate_credit_card_number("4111111111111111")
  validate_credit_card_number("32323")












import platform
from argparse import ArgumentParser

import huggingface_hub

from .. import __version__ as version
from ..utils import is_accelerate_available, is_torch_available, is_transformers_available, is_xformers_available
from . import BaseDiffusersCLICommand



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			Any    )						->      Optional[int]:





    """simple docstring"""

    return EnvironmentCommand()






class       __lowercase      (	lowercase_  ):







     '''simple docstring'''




     @staticmethod
     def 		lowerCAmelCase_     (				UpperCamelCase_       :			ArgumentParser				):


         """simple docstring"""



         __A         =	parser.add_parser("""env"""				)
         download_parser.set_defaults(func=UpperCamelCase_				)




     def 		lowerCAmelCase_     (				self       :			Any				):


         """simple docstring"""



         __A         =	huggingface_hub.__version__

         __A         =	"""not installed"""
         __A         =	"""NA"""
         if is_torch_available():
             import torch

             __A         =	torch.__version__
             __A         =	torch.cuda.is_available()

         __A         =	"""not installed"""
         if is_transformers_available():
             import transformers

             __A         =	transformers.__version__

         __A         =	"""not installed"""
         if is_accelerate_available():
             import accelerate

             __A         =	accelerate.__version__

         __A         =	"""not installed"""
         if is_xformers_available():
             import xformers

             __A         =	xformers.__version__

         __A         =	{
             """`diffusers` version""": version,
             """Platform""": platform.platform(),
             """Python version""": platform.python_version(),
             """PyTorch version (GPU?)""": F"{pt_version} ({pt_cuda_available})",
             """Huggingface_hub version""": hub_version,
             """Transformers version""": transformers_version,
             """Accelerate version""": accelerate_version,
             """xFormers version""": xformers_version,
             """Using GPU in script?""": """<fill in>""",
             """Using distributed or parallel set-up in script?""": """<fill in>""",
         }

         print("""\nCopy-and-paste the text below in your GitHub issue and FILL OUT the two last points.\n"""				)
         print(self.format_dict(UpperCamelCase_				)				)

         return info





     @staticmethod
     def 		lowerCAmelCase_     (				UpperCamelCase_       :			str				):


         """simple docstring"""



         return "\n".join([F"- {prop}: {val}" for prop, val in d.items()]				) + "\n"




