

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



class SCREAMING_SNAKE_CASE     :
  """simple docstring"""






  def __init__(      self			:   str	,							lowerCAmelCase			:   Optional[int]   )							->     Optional[Any]:






     """simple docstring"""







     __lowerCAmelCase  :      List[str]    =						data
     __lowerCAmelCase  :      int    =						[0X67452301, 0Xefcdab89, 0X98badcfe, 0X10325476, 0Xc3d2e1f0]







  @staticmethod
  def 	SCREAMING_SNAKE_CASE   (      lowerCAmelCase			:   int	,							lowerCAmelCase			:   Dict   )							->     Any:






     """simple docstring"""







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







  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple   )							->     Optional[int]:






     """simple docstring"""







     __lowerCAmelCase  :      List[Any]    =						b'''\x80''' + b'''\x00''' * (63 - (len(self.data   ) + 8) % 64)
     __lowerCAmelCase  :      List[Any]    =						self.data + padding + struct.pack(""">Q"""	,							8 * len(self.data   )   )
     return padded_data







  def 	SCREAMING_SNAKE_CASE   (      self			:   Union[str, Any]   )							->     List[Any]:






     """simple docstring"""







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







  def 	SCREAMING_SNAKE_CASE   (      self			:   Tuple	,							lowerCAmelCase			:   List[str]   )							->     Dict:






     """simple docstring"""







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







  def 	SCREAMING_SNAKE_CASE   (      self			:   int   )							->     List[str]:






     """simple docstring"""







     __lowerCAmelCase  :      int    =						self.padding()
     __lowerCAmelCase  :      List[Any]    =						self.split_blocks()
     for block in self.blocks:
        __lowerCAmelCase  :      str    =						self.expand_block(_UpperCAmelCase   )
        __lowerCAmelCase  :      int    =						self.h
        for i in range(0	,							80   ):
           if 0 <= i < 20:
              __lowerCAmelCase  :      int    =						(b & c) | ((~b) & d)
              __lowerCAmelCase  :      int    =						0X5a827999
           elif 20 <= i < 40:
              __lowerCAmelCase  :      int    =						b ^ c ^ d
              __lowerCAmelCase  :      List[str]    =						0X6ed9eba1
           elif 40 <= i < 60:
              __lowerCAmelCase  :      Tuple    =						(b & c) | (b & d) | (c & d)
              __lowerCAmelCase  :      Dict    =						0X8f1bbcdc
           elif 60 <= i < 80:
              __lowerCAmelCase  :      Tuple    =						b ^ c ^ d
              __lowerCAmelCase  :      Optional[Any]    =						0Xca62c1d6
           __lowerCAmelCase  :      Any    =						(
               self.rotate(_UpperCAmelCase	,							5   ) + f + e + k + expanded_block[i] & 0Xffffffff,
               a,
               self.rotate(_UpperCAmelCase	,							30   ),
               c,
               d,
           )
        __lowerCAmelCase  :      Tuple    =						(
            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      snake_case_				()      ->     Union[str, Any]:
   __lowerCAmelCase  :      List[Any]    =						b'''Test String'''
   assert SHAaHash(__UpperCAmelCase					).final_hash() == hashlib.shaa(__UpperCAmelCase					).hexdigest()  # noqa: S324





def      snake_case_				()      ->     Optional[int]:
   __lowerCAmelCase  :      List[Any]    =						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"""					)
   __lowerCAmelCase  :      Dict    =						parser.parse_args()
   __lowerCAmelCase  :      List[Any]    =						args.input_string
   # In any case hash input should be a bytestring
   if args.input_file:
      with open(args.input_file ,       """rb"""					) as f:
         __lowerCAmelCase  :      Union[str, Any]    =						f.read()
   else:
      __lowerCAmelCase  :      int    =						bytes(__UpperCAmelCase ,       """utf-8"""					)
   print(SHAaHash(__UpperCAmelCase					).final_hash()					)


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

   doctest.testmod()





# Lint as: python3
# pylint: enable=line-too-long
# pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position

__UpperCAmelCase								=			"""2.13.1"""

import platform

import pyarrow
from packaging import version


if version.parse(platform.python_version()) < version.parse("""3.7"""):
   raise ImportWarning(
       """To use `datasets`, Python>=3.7 is required, and the current version of Python doesn't match this condition."""
   )

if version.parse(pyarrow.__version__).major < 8:
   raise ImportWarning(
       """To use `datasets`, the module `pyarrow>=8.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n"""
       """If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`."""
   )

del platform
del pyarrow
del version

from .arrow_dataset import Dataset
from .arrow_reader import ReadInstruction
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
from .combine import concatenate_datasets, interleave_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .download import *
from .features import *
from .fingerprint import disable_caching, enable_caching, is_caching_enabled, set_caching_enabled
from .info import DatasetInfo, MetricInfo
from .inspect import (
    get_dataset_config_info,
    get_dataset_config_names,
    get_dataset_infos,
    get_dataset_split_names,
    inspect_dataset,
    inspect_metric,
    list_datasets,
    list_metrics,
)
from .iterable_dataset import IterableDataset
from .load import load_dataset, load_dataset_builder, load_from_disk, load_metric
from .metric import Metric
from .splits import (
    NamedSplit,
    NamedSplitAll,
    Split,
    SplitBase,
    SplitDict,
    SplitGenerator,
    SplitInfo,
    SubSplitInfo,
    percent,
)
from .tasks import *
from .utils import *
from .utils import logging


# deprecated modules
from datasets import arrow_dataset as _arrow_dataset  # isort:skip
from datasets import utils as _utils  # isort:skip
from datasets.utils import download_manager as _deprecated_download_manager  # isort:skip

__UpperCAmelCase								=			concatenate_datasets
__UpperCAmelCase								=			DownloadConfig
__UpperCAmelCase								=			DownloadManager
__UpperCAmelCase								=			DownloadMode
__UpperCAmelCase								=			DownloadConfig
__UpperCAmelCase								=			DownloadMode
__UpperCAmelCase								=			DownloadManager

del _arrow_dataset, _utils, _deprecated_download_manager


