


def 							__lowercase   ( __lowerCAmelCase							:				str   ):
							return credit_card_number.startswith(('34', '35', '37', '4', '5', '6')   )






def 							__lowercase   ( __lowerCAmelCase							:				str   ):
							a__             =     credit_card_number
							a__             =     0
							a__             =     len(_UpperCAmelCase   ) - 2
							for i in range(_UpperCAmelCase					,    -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(_UpperCAmelCase   ) + cc_number[i + 1 :]
														total += digit

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

							return total % 1_0 == 0






def 							__lowercase   ( __lowerCAmelCase							:				str   ):
							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(_UpperCAmelCase   ) <= 1_6:
														print(F'{error_message} of its length.'   )
														return False

							if not validate_initial_digits(_UpperCAmelCase   ):
														print(F'{error_message} of its first two digits.'   )
														return False

							if not luhn_validation(_UpperCAmelCase   ):
														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''')





'''simple docstring'''




import numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
from sklearn.metrics import ConfusionMatrixDisplay
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier

def 	UpperCamelCase_							(					_UpperCAmelCase  :      dict    )    ->    tuple:


       """simple docstring"""







       return (data["data"], data["target"])

def 	UpperCamelCase_							(					_UpperCAmelCase  :      np.ndarray			,	_UpperCAmelCase  :      np.ndarray    )    ->    XGBClassifier:


       """simple docstring"""







       _UpperCAmelCase     :  Any							      =    XGBClassifier()
       classifier.fit(_UpperCAmelCase			,	_UpperCAmelCase    )
       return classifier

def 	UpperCamelCase_							(					)    ->    None:


       """simple docstring"""







       _UpperCAmelCase     :  List[str]							      =    load_iris()
       _UpperCAmelCase      ,  _UpperCAmelCase     :  Dict							      =    data_handling(_UpperCAmelCase    )
       _UpperCAmelCase      ,  _UpperCAmelCase      ,  _UpperCAmelCase      ,  _UpperCAmelCase     :  str							      =    train_test_split(
           _UpperCAmelCase			,	_UpperCAmelCase			,	test_size=0.2_5    )

       _UpperCAmelCase     :  Optional[Any]							      =    iris["target_names"]

       # Create an XGBoost Classifier from the training data
       _UpperCAmelCase     :  Tuple							      =    xgboost(_UpperCAmelCase			,	_UpperCAmelCase    )

       # Display the confusion matrix of the classifier with both training and test sets
       ConfusionMatrixDisplay.from_estimator(
           _UpperCAmelCase			,	_UpperCAmelCase			,	_UpperCAmelCase			,	display_labels=_UpperCAmelCase			,	cmap="Blues"			,	normalize="true"			,	)
       plt.title("Normalized Confusion Matrix - IRIS Dataset"    )
       plt.show()


if __name__ == "__main__":
  import doctest

  doctest.testmod(verbose=True)
  main()

