



'''simple docstring'''






import json
import os
import pickle
import subprocess
from hashlib import mda
from pathlib import Path
from tempfile import gettempdir
from textwrap import dedent
from types import CodeType, FunctionType
from unittest import TestCase
from unittest.mock import patch

import pytest
from multiprocess import Pool
from packaging import version

import datasets
from datasets.fingerprint import Hasher, fingerprint_transform
from datasets.table import InMemoryTable

from .utils import (
    require_regex,
    require_spacy,
    require_spacy_model,
    require_tiktoken,
    require_torch,
    require_transformers,
)

class 	_lowerCAmelCase     :






		'''simple docstring'''
		def __init__(						self							:       int      ,		UpperCamelCase_							:       Optional[Any]		)      ->			Optional[int]:







									'''simple docstring'''





									_lowercase							:		Union[str, Any]				=   foo





		def __call__(						self							:       List[str]		)      ->			Optional[Any]:







									'''simple docstring'''





									return self.foo




class 	_lowerCAmelCase     (    datasets.Dataset       ):






		'''simple docstring'''
		@fingerprint_transform(inplace=UpperCamelCase_		)
		def 						__lowercase      (						self							:       Optional[Any]      ,		UpperCamelCase_							:       Optional[Any]      ,		*UpperCamelCase_							:       Any      ,		**UpperCamelCase_							:       List[str]		)      ->			Optional[Any]:







									'''simple docstring'''





									return DatasetChild(self.data      ,		fingerprint=UpperCamelCase_		)





		@fingerprint_transform(inplace=UpperCamelCase_		)
		def 						__lowercase      (						self							:       List[str]      ,		UpperCamelCase_							:       Any      ,		*UpperCamelCase_							:       Any      ,		**UpperCamelCase_							:       Union[str, Any]		)      ->			List[Any]:







									'''simple docstring'''





									return DatasetChild(self.data      ,		fingerprint=UpperCamelCase_		)




class 	_lowerCAmelCase     :






		'''simple docstring'''
		def __init__(						self							:       Union[str, Any]      ,		UpperCamelCase_							:       Optional[int]		)      ->			Union[str, Any]:







									'''simple docstring'''





									_lowercase							:		Any				=   callable
		def __call__(						self							:       Union[str, Any]      ,		*UpperCamelCase_							:       List[str]      ,		**UpperCamelCase_							:       Union[str, Any]		)      ->			List[Any]:







									'''simple docstring'''





									if self.callable is not None:
																return self.callable(*UpperCamelCase_      ,		**UpperCamelCase_		)





		def __getstate__(						self							:       Dict		)      ->			Tuple:







									'''simple docstring'''





									raise pickle.PicklingError()




class 	_lowerCAmelCase     (    __A       ):






		'''simple docstring'''
		@require_transformers
		@pytest.mark.integration
		def 						__lowercase      (						self							:       Optional[int]		)      ->			Dict:







									'''simple docstring'''





									from transformers import AutoTokenizer

									def encode(UpperCamelCase_							:       int		):
																return tokenizer(UpperCamelCase_		)

									# TODO: add hash consistency tests across sessions
									_lowercase							:		Dict				=   AutoTokenizer.from_pretrained('''bert-base-uncased'''		)
									_lowercase							:		int				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		List[str]				=   mda(datasets.utils.py_utils.dumps(lambda UpperCamelCase_		: tokenizer(UpperCamelCase_		)		)		).hexdigest()
									_lowercase							:		Union[str, Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Optional[int]				=   AutoTokenizer.from_pretrained('''bert-base-cased'''		)
									_lowercase							:		List[str]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Optional[int]				=   mda(datasets.utils.py_utils.dumps(lambda UpperCamelCase_		: tokenizer(UpperCamelCase_		)		)		).hexdigest()
									_lowercase							:		Tuple				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Tuple				=   AutoTokenizer.from_pretrained('''bert-base-uncased'''		)
									_lowercase							:		Optional[int]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		int				=   mda(datasets.utils.py_utils.dumps(lambda UpperCamelCase_		: tokenizer(UpperCamelCase_		)		)		).hexdigest()
									_lowercase							:		Optional[Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		@require_transformers
		@pytest.mark.integration
		def 						__lowercase      (						self							:       Optional[int]		)      ->			int:







									'''simple docstring'''





									from transformers import AutoTokenizer

									_lowercase							:		Optional[Any]				=   AutoTokenizer.from_pretrained('''gpt2'''		)
									_lowercase							:		Tuple				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									tokenizer('''Hello world !'''		)  # call once to change the tokenizer's cache
									_lowercase							:		Optional[Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)





		@require_regex
		def 						__lowercase      (						self							:       Dict		)      ->			List[str]:







									'''simple docstring'''





									import regex

									_lowercase							:		Tuple				=   regex.Regex('''foo'''		)
									_lowercase							:		List[str]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		List[Any]				=   regex.Regex('''bar'''		)
									_lowercase							:		List[str]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		List[Any]				=   regex.Regex('''foo'''		)
									_lowercase							:		str				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)




class 	_lowerCAmelCase     (    __A       ):






		'''simple docstring'''
		def 						__lowercase      (						self							:       Union[str, Any]		)      ->			Any:







									'''simple docstring'''





									def func():
																return foo

									_lowercase							:		Union[str, Any]				=   [0]
									_lowercase							:		List[str]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		List[Any]				=   [1]
									_lowercase							:		List[Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Tuple				=   [0]
									_lowercase							:		str				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       Dict		)      ->			int:







									'''simple docstring'''





									def func():
																pass

									_lowercase							:		Dict				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()

									def func():
																pass

									_lowercase							:		Optional[Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       List[Any]		)      ->			Tuple:







									'''simple docstring'''





									_lowercase							:		Union[str, Any]				=   mda(datasets.utils.py_utils.dumps(Foo([0]		)		)		).hexdigest()
									_lowercase							:		str				=   mda(datasets.utils.py_utils.dumps(Foo([1]		)		)		).hexdigest()
									_lowercase							:		Dict				=   mda(datasets.utils.py_utils.dumps(Foo([0]		)		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       Tuple		)      ->			Any:







									'''simple docstring'''





									_lowercase							:		List[str]				=   mda(datasets.utils.py_utils.dumps(Foo([0]		).__call__		)		).hexdigest()
									_lowercase							:		Optional[int]				=   mda(datasets.utils.py_utils.dumps(Foo([1]		).__call__		)		).hexdigest()
									_lowercase							:		int				=   mda(datasets.utils.py_utils.dumps(Foo([0]		).__call__		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       Tuple		)      ->			List[str]:







									'''simple docstring'''





									_lowercase							:		List[str]				=   (
									    '''co_argcount''',
									    '''co_kwonlyargcount''',
									    '''co_nlocals''',
									    '''co_stacksize''',
									    '''co_flags''',
									    '''co_code''',
									    '''co_consts''',
									    '''co_names''',
									    '''co_varnames''',
									    '''co_filename''',
									    '''co_name''',
									    '''co_firstlineno''',
									    '''co_lnotab''',
									    '''co_freevars''',
									    '''co_cellvars''',
									)

									def _create_code_pyaa(*UpperCamelCase_							:       int		):
																if hasattr(args[-3]      ,		'''encode'''		):
																							_lowercase							:		Union[str, Any]				=   list(UpperCamelCase_		)
																							_lowercase							:		Tuple				=   args[-3].encode()  # co_lnotab
																							_lowercase							:		Optional[Any]				=   args[-10].encode()  # co_code
																if hasattr(UpperCamelCase_      ,		'''co_posonlyargcount'''		):
																							if len(UpperCamelCase_		) == 16:
																														return CodeType(*UpperCamelCase_		)
																							elif len(UpperCamelCase_		) == 15:
																														return CodeType(args[0]      ,		0      ,		*args[1:]		)
																							return CodeType(args[0]      ,		0      ,		0      ,		*args[1:]		)
																elif hasattr(UpperCamelCase_      ,		'''co_kwonlyargcount'''		):
																							if len(UpperCamelCase_		) == 16:
																														return CodeType(args[0]      ,		*args[2:]		)
																							elif len(UpperCamelCase_		) == 15:
																														return CodeType(*UpperCamelCase_		)
																							return CodeType(args[0]      ,		0      ,		*args[1:]		)
																if len(UpperCamelCase_		) == 16:
																							return CodeType(args[0]      ,		*args[3:]		)
																elif len(UpperCamelCase_		) == 15:
																							return CodeType(args[0]      ,		*args[2:]		)
																return CodeType(*UpperCamelCase_		)

									def create_ipython_func(UpperCamelCase_							:       Tuple      ,		UpperCamelCase_							:       Optional[Any]		):
																def func():
																							return returned_obj

																_lowercase							:		Union[str, Any]				=   func.__code__
																# Use _create_code from dill in order to make it work for different python versions
																if datasets.config.PY_VERSION < version.parse('''3.8'''		):
																							_lowercase							:		List[Any]				=   _create_code_pyaa(
																							    *[getattr(UpperCamelCase_      ,		UpperCamelCase_		) if k != '''co_filename''' else co_filename for k in code_args_pyaa]		)
																else:
																							_lowercase							:		Union[str, Any]				=   code.replace(co_filename=UpperCamelCase_		)
																return FunctionType(UpperCamelCase_      ,		func.__globals__      ,		func.__name__      ,		func.__defaults__      ,		func.__closure__		)

									_lowercase			, _lowercase							:		int				=   '''<ipython-input-2-e0383a102aae>''', [0]
									_lowercase							:		Any				=   mda(datasets.utils.py_utils.dumps(create_ipython_func(UpperCamelCase_      ,		UpperCamelCase_		)		)		).hexdigest()
									_lowercase			, _lowercase							:		Any				=   '''<ipython-input-2-e0383a102aae>''', [1]
									_lowercase							:		Dict				=   mda(datasets.utils.py_utils.dumps(create_ipython_func(UpperCamelCase_      ,		UpperCamelCase_		)		)		).hexdigest()
									_lowercase			, _lowercase							:		Optional[Any]				=   '''<ipython-input-5-713f6613acf3>''', [0]
									_lowercase							:		int				=   mda(datasets.utils.py_utils.dumps(create_ipython_func(UpperCamelCase_      ,		UpperCamelCase_		)		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)

									_lowercase			, _lowercase							:		Optional[int]				=   os.path.join(gettempdir()      ,		'''ipykernel_12345'''      ,		'''321456789.py'''		), [0]
									_lowercase							:		int				=   mda(datasets.utils.py_utils.dumps(create_ipython_func(UpperCamelCase_      ,		UpperCamelCase_		)		)		).hexdigest()
									_lowercase			, _lowercase							:		Any				=   os.path.join(gettempdir()      ,		'''ipykernel_12345'''      ,		'''321456789.py'''		), [1]
									_lowercase							:		List[Any]				=   mda(datasets.utils.py_utils.dumps(create_ipython_func(UpperCamelCase_      ,		UpperCamelCase_		)		)		).hexdigest()
									_lowercase			, _lowercase							:		str				=   os.path.join(gettempdir()      ,		'''ipykernel_12345'''      ,		'''654123987.py'''		), [0]
									_lowercase							:		Optional[Any]				=   mda(datasets.utils.py_utils.dumps(create_ipython_func(UpperCamelCase_      ,		UpperCamelCase_		)		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)





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







									'''simple docstring'''





									_lowercase			, _lowercase							:		Optional[int]				=   [0], [1]

									def func():
																return foo, bar

									_lowercase							:		List[str]				=   '''__main__'''

									def globalvars_mocka_side_effect(UpperCamelCase_							:       str      ,		*UpperCamelCase_							:       Any      ,		**UpperCamelCase_							:       Any		):
																return {"foo": foo, "bar": bar}

									def globalvars_mocka_side_effect(UpperCamelCase_							:       Optional[int]      ,		*UpperCamelCase_							:       Optional[int]      ,		**UpperCamelCase_							:       Optional[int]		):
																return {"bar": bar, "foo": foo}

									with patch('''dill.detect.globalvars'''      ,		side_effect=UpperCamelCase_		) as globalvars_mocka:
																_lowercase							:		int				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
																self.assertGreater(globalvars_mocka.call_count      ,		0		)
									with patch('''dill.detect.globalvars'''      ,		side_effect=UpperCamelCase_		) as globalvars_mocka:
																_lowercase							:		Optional[Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
																self.assertGreater(globalvars_mocka.call_count      ,		0		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)




class 	_lowerCAmelCase     (    __A       ):






		'''simple docstring'''
		def 						__lowercase      (						self							:       str		)      ->			List[str]:







									'''simple docstring'''





									_lowercase							:		str				=   Hasher.hash('''hello'''		)
									_lowercase							:		str				=   Hasher.hash('''hello'''		)
									_lowercase							:		str				=   Hasher.hash('''there'''		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       List[str]		)      ->			Any:







									'''simple docstring'''





									_lowercase							:		int				=   Hasher.hash(Foo('''hello'''		)		)
									_lowercase							:		Any				=   Hasher.hash(Foo('''hello'''		)		)
									_lowercase							:		List[str]				=   Hasher.hash(Foo('''there'''		)		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       int		)      ->			List[Any]:







									'''simple docstring'''





									_lowercase							:		List[str]				=   Hasher()
									for x in ["hello", Foo('''hello'''		)]:
																hasher.update(UpperCamelCase_		)
									_lowercase							:		List[Any]				=   hasher.hexdigest()
									_lowercase							:		Optional[Any]				=   Hasher()
									for x in ["hello", Foo('''hello'''		)]:
																hasher.update(UpperCamelCase_		)
									_lowercase							:		Union[str, Any]				=   hasher.hexdigest()
									_lowercase							:		Tuple				=   Hasher()
									for x in ["there", Foo('''there'''		)]:
																hasher.update(UpperCamelCase_		)
									_lowercase							:		Optional[int]				=   hasher.hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		def 						__lowercase      (						self							:       Any		)      ->			Optional[int]:







									'''simple docstring'''





									with self.assertRaises(pickle.PicklingError		):
																Hasher.hash(UnpicklableCallable(Foo('''hello'''		)		)		)
		def 						__lowercase      (						self							:       List[str]		)      ->			int:







									'''simple docstring'''





									_lowercase							:		str				=   '''abc'''
									_lowercase							:		Tuple				=   [string, string]  # two strings have the same ids
									_lowercase							:		Any				=   [string, string]
									_lowercase							:		List[Any]				=   json.loads(F"[\"{string}\", \"{string}\"]"		)  # two strings have different ids
									self.assertIs(obja[0]      ,		UpperCamelCase_		)
									self.assertIs(obja[0]      ,		obja[1]		)
									self.assertIs(obja[0]      ,		UpperCamelCase_		)
									self.assertIs(obja[0]      ,		obja[1]		)
									self.assertIsNot(obja[0]      ,		UpperCamelCase_		)
									self.assertIsNot(obja[0]      ,		obja[1]		)
									_lowercase							:		Tuple				=   Hasher.hash(UpperCamelCase_		)
									_lowercase							:		Union[str, Any]				=   Hasher.hash(UpperCamelCase_		)
									_lowercase							:		List[Any]				=   Hasher.hash(UpperCamelCase_		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		@require_tiktoken
		def 						__lowercase      (						self							:       Optional[Any]		)      ->			Optional[int]:







									'''simple docstring'''





									import tiktoken

									_lowercase							:		Dict				=   tiktoken.get_encoding('''gpt2'''		)
									_lowercase							:		Optional[int]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		List[str]				=   tiktoken.get_encoding('''r50k_base'''		)
									_lowercase							:		str				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Any				=   tiktoken.get_encoding('''gpt2'''		)
									_lowercase							:		Optional[int]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)
		@require_torch
		def 						__lowercase      (						self							:       Union[str, Any]		)      ->			List[str]:







									'''simple docstring'''





									import torch

									_lowercase							:		str				=   torch.tensor([1.0]		)
									_lowercase							:		Any				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		str				=   torch.tensor([2.0]		)
									_lowercase							:		str				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Union[str, Any]				=   torch.tensor([1.0]		)
									_lowercase							:		Any				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)





		@require_spacy
		@require_spacy_model('''en_core_web_sm'''		)
		@require_spacy_model('''fr_core_news_sm'''		)
		@pytest.mark.integration
		def 						__lowercase      (						self							:       Tuple		)      ->			str:







									'''simple docstring'''





									import spacy

									_lowercase							:		Union[str, Any]				=   spacy.load('''en_core_web_sm'''		)
									_lowercase							:		Optional[int]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Any				=   spacy.load('''fr_core_news_sm'''		)
									_lowercase							:		List[Any]				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									_lowercase							:		Union[str, Any]				=   spacy.load('''en_core_web_sm'''		)
									_lowercase							:		str				=   mda(datasets.utils.py_utils.dumps(UpperCamelCase_		)		).hexdigest()
									self.assertEqual(UpperCamelCase_      ,		UpperCamelCase_		)
									self.assertNotEqual(UpperCamelCase_      ,		UpperCamelCase_		)





@pytest.mark.integration
def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Path  )		->List[str]:






							'''simple docstring'''
							_lowercase							:		List[Any]				=   tmp_path / '''dir1'''
							_lowercase							:		List[str]				=   tmp_path / '''dir2'''
							dira.mkdir()
							dira.mkdir()
							_lowercase							:		Tuple				=   '''script.py'''
							_lowercase							:		List[Any]				=   dedent(
							    '''
    from datasets.fingerprint import Hasher
    def foo():
        pass
    print(Hasher.hash(foo))
    '''  )
							_lowercase							:		Union[str, Any]				=   dira / script_filename
							_lowercase							:		Tuple				=   dira / script_filename
							with script_patha.open('''w'''  ) as f:
														f.write(snake_case_  )
							with script_patha.open('''w'''  ) as f:
														f.write(snake_case_  )
							_lowercase							:		Union[str, Any]				=   subprocess.check_output(['''python''', str(snake_case_  )]  )
							_lowercase							:		Optional[Any]				=   subprocess.check_output(['''python''', str(snake_case_  )]  )
							assert fingerprinta == fingerprinta





def 				_SCREAMING_SNAKE_CASE(					)		->Union[str, Any]:






							'''simple docstring'''
							_lowercase							:		List[Any]				=   {'''a''': [0, 1, 2]}
							_lowercase							:		Dict				=   DatasetChild(InMemoryTable.from_pydict(snake_case_  )  )
							_lowercase							:		str				=   dataset.funca()._fingerprint
							assert expected_fingerprint == dataset.funca()._fingerprint
							assert expected_fingerprint != dataset.funca()._fingerprint

							with Pool(2  ) as p:
														assert expected_fingerprint == p.apply_async(dataset.funca  ).get()._fingerprint
														assert expected_fingerprint != p.apply_async(dataset.funca  ).get()._fingerprint





def 				_SCREAMING_SNAKE_CASE(					)		->Dict:






							'''simple docstring'''
							_lowercase							:		str				=   {'''a''': [0, 1, 2]}

							class 	_lowerCAmelCase     (    datasets.Dataset       ):






									'''simple docstring'''
									@fingerprint_transform(inplace=UpperCamelCase_		)
									def 						__lowercase      (						self							:       List[Any]      ,		UpperCamelCase_							:       Optional[int]		)      ->			int:







																'''simple docstring'''





																return DummyDatasetChild(self.data      ,		fingerprint=UpperCamelCase_		)




							_lowercase							:		Optional[Any]				=   DummyDatasetChild(InMemoryTable.from_pydict(snake_case_  )  ).func()

							class 	_lowerCAmelCase     (    datasets.Dataset       ):






									'''simple docstring'''
									@fingerprint_transform(inplace=UpperCamelCase_      ,		version='''1.0.0'''		)
									def 						__lowercase      (						self							:       List[Any]      ,		UpperCamelCase_							:       Dict		)      ->			Union[str, Any]:







																'''simple docstring'''





																return DummyDatasetChild(self.data      ,		fingerprint=UpperCamelCase_		)




							_lowercase							:		Optional[int]				=   DummyDatasetChild(InMemoryTable.from_pydict(snake_case_  )  ).func()

							class 	_lowerCAmelCase     (    datasets.Dataset       ):






									'''simple docstring'''
									@fingerprint_transform(inplace=UpperCamelCase_      ,		version='''2.0.0'''		)
									def 						__lowercase      (						self							:       Optional[int]      ,		UpperCamelCase_							:       Any		)      ->			int:







																'''simple docstring'''





																return DummyDatasetChild(self.data      ,		fingerprint=UpperCamelCase_		)




							_lowercase							:		Optional[Any]				=   DummyDatasetChild(InMemoryTable.from_pydict(snake_case_  )  ).func()

							assert len({fingeprint_no_version, fingeprint_a, fingeprint_a}  ) == 3





def 				_SCREAMING_SNAKE_CASE(					)		->Optional[Any]:






							'''simple docstring'''
							# AttributeError: module 'dill._dill' has no attribute 'stack'
							_lowercase							:		int				=   Hasher()
							hasher.update(lambda snake_case_  : x  )








'''simple docstring'''






def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     List[str]  )		->Dict:






							'''simple docstring'''
							_lowercase							:		Optional[Any]				=   [7_01, 3_01, 1_32, 57, 23, 10, 4, 1]
							for gap in gaps:
														for i in range(snake_case_ ,       len(snake_case_  )  ):
																					_lowercase							:		int				=   collection[i]
																					_lowercase							:		Any				=   i
																					while j >= gap and collection[j - gap] > insert_value:
																												_lowercase							:		Optional[int]				=   collection[j - gap]
																												j -= gap
																					if j != i:
																												_lowercase							:		str				=   insert_value
							return collection


if __name__ == "__main__":
						from doctest import testmod

						testmod()
						lowerCamelCase__	  =		input('Enter numbers separated by a comma:\n').strip()
						lowerCamelCase__	  =		[int(item) for item in user_input.split(',')]
						print(shell_sort(unsorted))



