
import argparse
import hashlib  # hashlib is only used inside the Test class
import struct




class   SCREAMING_SNAKE_CASE__	:





	'''simple docstring'''



	def __init__(    self      :       List[Any]     ,    lowercase      :       Dict      ):


				'''simple docstring'''


				_snake_case            =     data
				_snake_case            =     [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]



	@staticmethod
	def 					A				(    lowercase      :       Tuple     ,    lowercase      :       Dict      ):


				'''simple docstring'''


				return ((n << b) | (n >> (32 - b))) & 0xFFFFFFFF



	def 					A				(    self      :       Optional[Any]      ):


				'''simple docstring'''


				_snake_case            =     B"\x80" + B"\x00" * (63 - (len(self.data      ) + 8) % 64)
				_snake_case            =     self.data + padding + struct.pack('>Q'     ,    8 * len(self.data      )      )
				return padded_data



	def 					A				(    self      :       Optional[Any]      ):


				'''simple docstring'''


				return [
				    self.padded_data[i : i + 64] for i in range(0     ,    len(self.padded_data      )     ,    64      )
				]



	def 					A				(    self      :       Any     ,    lowercase      :       List[str]      ):


				'''simple docstring'''


				_snake_case            =     list(struct.unpack('>16L'     ,    a_      )      ) + [0] * 64
				for i in range(16     ,    80      ):
							_snake_case            =     self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16])     ,    1      )
				return w





	def 					A				(    self      :       Tuple      ):


				'''simple docstring'''


				_snake_case            =     self.padding()
				_snake_case            =     self.split_blocks()
				for block in self.blocks:
							_snake_case            =     self.expand_block(a_      )
							_snake_case            =     self.h
							for i in range(0     ,    80      ):
										if 0 <= i < 20:
													_snake_case            =     (b & c) | ((~b) & d)
													_snake_case            =     0x5A827999
										elif 20 <= i < 40:
													_snake_case            =     b ^ c ^ d
													_snake_case            =     0x6ED9EBA1
										elif 40 <= i < 60:
													_snake_case            =     (b & c) | (b & d) | (c & d)
													_snake_case            =     0x8F1BBCDC
										elif 60 <= i < 80:
													_snake_case            =     b ^ c ^ d
													_snake_case            =     0xCA62C1D6
										_snake_case            =     (
										    self.rotate(a_     ,    5      ) + f + e + k + expanded_block[i] & 0xFFFFFFFF,
										    a,
										    self.rotate(a_     ,    30      ),
										    c,
										    d,
										)
							_snake_case            =     (
							    self.h[0] + a & 0xFFFFFFFF,
							    self.h[1] + b & 0xFFFFFFFF,
							    self.h[2] + c & 0xFFFFFFFF,
							    self.h[3] + d & 0xFFFFFFFF,
							    self.h[4] + e & 0xFFFFFFFF,
							)
				return ("{:08x}" * 5).format(*self.h      )






def 			a_						(			)					->    Dict:
			_snake_case            =     b"Test String"
			assert SHAaHash(lowerCAmelCase__					).final_hash() == hashlib.shaa(lowerCAmelCase__					).hexdigest()  # noqa: S324






def 			a_						(			)					->    Dict:
			_snake_case            =     argparse.ArgumentParser(description='Process some strings or files'					)
			parser.add_argument(
			    '--string'			,   dest='input_string'			,   default='Hello World!! Welcome to Cryptography'			,   help='Hash the string'			,   )
			parser.add_argument('--file'			,   dest='input_file'			,   help='Hash contents of a file'					)
			_snake_case            =     parser.parse_args()
			_snake_case            =     args.input_string
			# In any case hash input should be a bytestring
			if args.input_file:
						with open(args.input_file			,   'rb'					) as f:
									_snake_case            =     f.read()
			else:
						_snake_case            =     bytes(lowerCAmelCase__			,   'utf-8'					)
			print(SHAaHash(lowerCAmelCase__					).final_hash()					)


if __name__ == "__main__":
			main()
			import doctest

			doctest.testmod()






"""simple docstring"""






from sklearn.metrics import matthews_corrcoef

import datasets


__UpperCAmelCase						=			'''
Compute the Matthews correlation coefficient (MCC)

The Matthews correlation coefficient is used in machine learning as a
measure of the quality of binary and multiclass classifications. It takes
into account true and false positives and negatives and is generally
regarded as a balanced measure which can be used even if the classes are of
very different sizes. The MCC is in essence a correlation coefficient value
between -1 and +1. A coefficient of +1 represents a perfect prediction, 0
an average random prediction and -1 an inverse prediction.  The statistic
is also known as the phi coefficient. [source: Wikipedia]
'''

__UpperCAmelCase						=			'''
Args:
    predictions (list of int): Predicted labels, as returned by a model.
    references (list of int): Ground truth labels.
    sample_weight (list of int, float, or bool): Sample weights. Defaults to `None`.
Returns:
    matthews_correlation (dict containing float): Matthews correlation.
Examples:
    Example 1, a basic example with only predictions and references as inputs:
        >>> matthews_metric = datasets.load_metric("matthews_correlation")
        >>> results = matthews_metric.compute(references=[1, 3, 2, 0, 3, 2],
        ...                                     predictions=[1, 2, 2, 0, 3, 3])
        >>> print(round(results[\'matthews_correlation\'], 2))
        0.54

    Example 2, the same example as above, but also including sample weights:
        >>> matthews_metric = datasets.load_metric("matthews_correlation")
        >>> results = matthews_metric.compute(references=[1, 3, 2, 0, 3, 2],
        ...                                     predictions=[1, 2, 2, 0, 3, 3],
        ...                                     sample_weight=[0.5, 3, 1, 1, 1, 2])
        >>> print(round(results[\'matthews_correlation\'], 2))
        0.1

    Example 3, the same example as above, but with sample weights that cause a negative correlation:
        >>> matthews_metric = datasets.load_metric("matthews_correlation")
        >>> results = matthews_metric.compute(references=[1, 3, 2, 0, 3, 2],
        ...                                     predictions=[1, 2, 2, 0, 3, 3],
        ...                                     sample_weight=[0.5, 1, 0, 0, 0, 1])
        >>> print(round(results[\'matthews_correlation\'], 2))
        -0.25
'''

__UpperCAmelCase						=			'''\
@article{scikit-learn,
  title={Scikit-learn: Machine Learning in {P}ython},
  author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V.
         and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P.
         and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and
         Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},
  journal={Journal of Machine Learning Research},
  volume={12},
  pages={2825--2830},
  year={2011}
}
'''



@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION						,  _KWARGS_DESCRIPTION  )
class 					__UpperCAmelCase							(						datasets.Metric  ):
				def       UpperCAmelCase      (		self    :			Optional[int]    )	->	str:



							'''simple docstring'''



							return datasets.MetricInfo(
							    description=_DESCRIPTION	, citation=_CITATION	, inputs_description=_KWARGS_DESCRIPTION	, features=datasets.Features(
							        {
							            "predictions": datasets.Value("int32"    ),
							            "references": datasets.Value("int32"    ),
							        }    )	, reference_urls=[
							        "https://scikit-learn.org/stable/modules/generated/sklearn.metrics.matthews_corrcoef.html"
							    ]	, )






				def       UpperCAmelCase      (		self    :			Tuple	, a_    :			Optional[Any]	, a_    :			Optional[Any]	, a_    :			Any=None    )	->	Union[str, Any]:



							'''simple docstring'''



							return {
							    "matthews_correlation": float(matthews_corrcoef(a_	, a_	, sample_weight=a_    )    ),
							}