



'''simple docstring'''







from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast
from ...utils import logging


lowercase__  :	str            =      logging.get_logger(__name__)

lowercase__  :	str            =      {
    'uclanlp/plbart-base': 'https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json',
    # See all PLBART models at https://huggingface.co/models?filter=plbart
}

class    lowerCamelCase_				(						lowerCAmelCase_	):






   '''simple docstring'''

   A			:  Any					=						"plbart"
   A			:  Optional[int]					=						["past_key_values"]
   A			:  List[str]					=						{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}


   def __init__(	self  ,    __UpperCamelCase=5_00_05  ,    __UpperCamelCase=10_24  ,    __UpperCamelCase=6  ,    __UpperCamelCase=30_72  ,    __UpperCamelCase=12  ,    __UpperCamelCase=6  ,    __UpperCamelCase=30_72  ,    __UpperCamelCase=12  ,    __UpperCamelCase=0.0  ,    __UpperCamelCase=0.0  ,    __UpperCamelCase=True  ,    __UpperCamelCase=True  ,    __UpperCamelCase="gelu"  ,    __UpperCamelCase=7_68  ,    __UpperCamelCase=0.1  ,    __UpperCamelCase=0.1  ,    __UpperCamelCase=0.0  ,    __UpperCamelCase=0.02  ,    __UpperCamelCase=0.0  ,    __UpperCamelCase=True  ,    __UpperCamelCase=1  ,    __UpperCamelCase=0  ,    __UpperCamelCase=2  ,    __UpperCamelCase=2  ,    **__UpperCamelCase  ,    ):
       UpperCamelCase__	     =      vocab_size
       UpperCamelCase__	     =      max_position_embeddings
       UpperCamelCase__	     =      d_model
       UpperCamelCase__	     =      encoder_ffn_dim
       UpperCamelCase__	     =      encoder_layers
       UpperCamelCase__	     =      encoder_attention_heads
       UpperCamelCase__	     =      decoder_ffn_dim
       UpperCamelCase__	     =      decoder_layers
       UpperCamelCase__	     =      decoder_attention_heads
       UpperCamelCase__	     =      dropout
       UpperCamelCase__	     =      attention_dropout
       UpperCamelCase__	     =      activation_dropout
       UpperCamelCase__	     =      activation_function
       UpperCamelCase__	     =      init_std
       UpperCamelCase__	     =      encoder_layerdrop
       UpperCamelCase__	     =      decoder_layerdrop
       UpperCamelCase__	     =      classifier_dropout
       UpperCamelCase__	     =      use_cache
       UpperCamelCase__	     =      encoder_layers
       UpperCamelCase__	     =      scale_embedding  # scale factor will be sqrt(d_model) if True
       super().__init__(
           pad_token_id=__UpperCamelCase  ,    bos_token_id=__UpperCamelCase  ,    eos_token_id=__UpperCamelCase  ,    is_encoder_decoder=__UpperCamelCase  ,    forced_eos_token_id=__UpperCamelCase  ,    **__UpperCamelCase  ,    )

class    lowerCamelCase_				(						lowerCAmelCase_	):






   '''simple docstring'''

   @property
   def 						_UpperCamelCase							(	self			):
       return OrderedDict(
           [
               ("input_ids", {0: "batch", 1: "sequence"}),
               ("attention_mask", {0: "batch", 1: "sequence"}),
           ]			)







   @property
   def 						_UpperCamelCase							(	self			):
       if self.use_past:
           return OrderedDict(
               [
                   ("last_hidden_state", {0: "batch", 1: "sequence"}),
                   ("past_keys", {0: "batch", 2: "sequence"}),
                   ("encoder_last_hidden_state", {0: "batch", 1: "sequence"}),
               ]			)
       else:
           return OrderedDict(
               [
                   ("last_hidden_state", {0: "batch", 1: "sequence"}),
                   ("encoder_last_hidden_state", {0: "batch", 1: "sequence"}),
               ]			)









'''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  ,    __UpperCamelCase			):
       UpperCamelCase__	     =      foo







   def __call__(	self			):
       return self.foo

class    lowerCamelCase_				(						datasets.Dataset	):






   '''simple docstring'''

   @fingerprint_transform(inplace=__UpperCamelCase			)
   def 						_UpperCamelCase							(	self  ,    __UpperCamelCase  ,    *__UpperCamelCase  ,    **__UpperCamelCase			):
       return DatasetChild(self.data  ,    fingerprint=__UpperCamelCase			)







   @fingerprint_transform(inplace=__UpperCamelCase			)
   def 						_UpperCamelCase							(	self  ,    __UpperCamelCase  ,    *__UpperCamelCase  ,    **__UpperCamelCase			):
       return DatasetChild(self.data  ,    fingerprint=__UpperCamelCase			)

class    lowerCamelCase_				:






   '''simple docstring'''

   def __init__(	self  ,    __UpperCamelCase			):
       UpperCamelCase__	     =      callable


   def __call__(	self  ,    *__UpperCamelCase  ,    **__UpperCamelCase			):
       if self.callable is not None:
           return self.callable(*__UpperCamelCase  ,    **__UpperCamelCase			)







   def __getstate__(	self			):
       raise pickle.PicklingError()

class    lowerCamelCase_				(						lowerCAmelCase_	):






   '''simple docstring'''

   @require_transformers
   @pytest.mark.integration
   def 						_UpperCamelCase							(	self			):
       from transformers import AutoTokenizer

       def encode(__UpperCamelCase			):
           return tokenizer(__UpperCamelCase			)

       # TODO: add hash consistency tests across sessions
       UpperCamelCase__	     =      AutoTokenizer.from_pretrained("bert-base-uncased"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(lambda __UpperCamelCase			: tokenizer(__UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      AutoTokenizer.from_pretrained("bert-base-cased"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(lambda __UpperCamelCase			: tokenizer(__UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      AutoTokenizer.from_pretrained("bert-base-uncased"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(lambda __UpperCamelCase			: tokenizer(__UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__	     =      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 						_UpperCamelCase							(	self			):
       from transformers import AutoTokenizer

       UpperCamelCase__	     =      AutoTokenizer.from_pretrained("gpt2"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       tokenizer("Hello world !"			)  # call once to change the tokenizer's cache
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)







   @require_regex
   def 						_UpperCamelCase							(	self			):
       import regex

       UpperCamelCase__	     =      regex.Regex("foo"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      regex.Regex("bar"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      regex.Regex("foo"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)

class    lowerCamelCase_				(						lowerCAmelCase_	):






   '''simple docstring'''

   def 						_UpperCamelCase							(	self			):
       def func():
           return foo

       UpperCamelCase__	     =      [0]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      [1]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      [0]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       def func():
           pass

       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()

       def func():
           pass

       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(Foo([0]			)			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(Foo([1]			)			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(Foo([0]			)			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(Foo([0]			).__call__			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(Foo([1]			).__call__			)			).hexdigest()
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(Foo([0]			).__call__			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      (
           "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			):
           if hasattr(args[-3]  ,    "encode"			):
               UpperCamelCase__	     =      list(__UpperCamelCase			)
               UpperCamelCase__	     =      args[-3].encode()  # co_lnotab
               UpperCamelCase__	     =      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  ,    __UpperCamelCase			):
           def func():
               return returned_obj

           UpperCamelCase__	     =      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"			):
               UpperCamelCase__	     =      _create_code_pyaa(
                   *[getattr(__UpperCamelCase  ,    __UpperCamelCase			) if k != "co_filename" else co_filename for k in code_args_pyaa]			)
           else:
               UpperCamelCase__	     =      code.replace(co_filename=__UpperCamelCase			)
           return FunctionType(__UpperCamelCase  ,    func.__globals__  ,    func.__name__  ,    func.__defaults__  ,    func.__closure__			)

       UpperCamelCase__     ,	UpperCamelCase__	     =      "<ipython-input-2-e0383a102aae>", [0]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(create_ipython_func(__UpperCamelCase  ,    __UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__     ,	UpperCamelCase__	     =      "<ipython-input-2-e0383a102aae>", [1]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(create_ipython_func(__UpperCamelCase  ,    __UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__     ,	UpperCamelCase__	     =      "<ipython-input-5-713f6613acf3>", [0]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(create_ipython_func(__UpperCamelCase  ,    __UpperCamelCase			)			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)

       UpperCamelCase__     ,	UpperCamelCase__	     =      os.path.join(gettempdir()  ,    "ipykernel_12345"  ,    "321456789.py"			), [0]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(create_ipython_func(__UpperCamelCase  ,    __UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__     ,	UpperCamelCase__	     =      os.path.join(gettempdir()  ,    "ipykernel_12345"  ,    "321456789.py"			), [1]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(create_ipython_func(__UpperCamelCase  ,    __UpperCamelCase			)			)			).hexdigest()
       UpperCamelCase__     ,	UpperCamelCase__	     =      os.path.join(gettempdir()  ,    "ipykernel_12345"  ,    "654123987.py"			), [0]
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(create_ipython_func(__UpperCamelCase  ,    __UpperCamelCase			)			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)







   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__     ,	UpperCamelCase__	     =      [0], [1]

       def func():
           return foo, bar

       UpperCamelCase__	     =      "__main__"

       def globalvars_mocka_side_effect(__UpperCamelCase  ,    *__UpperCamelCase  ,    **__UpperCamelCase			):
           return {"foo": foo, "bar": bar}

       def globalvars_mocka_side_effect(__UpperCamelCase  ,    *__UpperCamelCase  ,    **__UpperCamelCase			):
           return {"bar": bar, "foo": foo}

       with patch("dill.detect.globalvars"  ,    side_effect=__UpperCamelCase			) as globalvars_mocka:
           UpperCamelCase__	     =      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:
           UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
           self.assertGreater(globalvars_mocka.call_count  ,    0			)
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)

class    lowerCamelCase_				(						lowerCAmelCase_	):






   '''simple docstring'''

   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      Hasher.hash("hello"			)
       UpperCamelCase__	     =      Hasher.hash("hello"			)
       UpperCamelCase__	     =      Hasher.hash("there"			)
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      Hasher.hash(Foo("hello"			)			)
       UpperCamelCase__	     =      Hasher.hash(Foo("hello"			)			)
       UpperCamelCase__	     =      Hasher.hash(Foo("there"			)			)
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      Hasher()
       for x in ["hello", Foo("hello"			)]:
           hasher.update(__UpperCamelCase			)
       UpperCamelCase__	     =      hasher.hexdigest()
       UpperCamelCase__	     =      Hasher()
       for x in ["hello", Foo("hello"			)]:
           hasher.update(__UpperCamelCase			)
       UpperCamelCase__	     =      hasher.hexdigest()
       UpperCamelCase__	     =      Hasher()
       for x in ["there", Foo("there"			)]:
           hasher.update(__UpperCamelCase			)
       UpperCamelCase__	     =      hasher.hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   def 						_UpperCamelCase							(	self			):
       with self.assertRaises(pickle.PicklingError			):
           Hasher.hash(UnpicklableCallable(Foo("hello"			)			)			)


   def 						_UpperCamelCase							(	self			):
       UpperCamelCase__	     =      "abc"
       UpperCamelCase__	     =      [string, string]  # two strings have the same ids
       UpperCamelCase__	     =      [string, string]
       UpperCamelCase__	     =      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]			)
       UpperCamelCase__	     =      Hasher.hash(__UpperCamelCase			)
       UpperCamelCase__	     =      Hasher.hash(__UpperCamelCase			)
       UpperCamelCase__	     =      Hasher.hash(__UpperCamelCase			)
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   @require_tiktoken
   def 						_UpperCamelCase							(	self			):
       import tiktoken

       UpperCamelCase__	     =      tiktoken.get_encoding("gpt2"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      tiktoken.get_encoding("r50k_base"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      tiktoken.get_encoding("gpt2"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)


   @require_torch
   def 						_UpperCamelCase							(	self			):
       import torch

       UpperCamelCase__	     =      torch.tensor([1.0]			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      torch.tensor([2.0]			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      torch.tensor([1.0]			)
       UpperCamelCase__	     =      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 						_UpperCamelCase							(	self			):
       import spacy

       UpperCamelCase__	     =      spacy.load("en_core_web_sm"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      spacy.load("fr_core_news_sm"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       UpperCamelCase__	     =      spacy.load("en_core_web_sm"			)
       UpperCamelCase__	     =      mda(datasets.utils.py_utils.dumps(__UpperCamelCase			)			).hexdigest()
       self.assertEqual(__UpperCamelCase  ,    __UpperCamelCase			)
       self.assertNotEqual(__UpperCamelCase  ,    __UpperCamelCase			)





@pytest.mark.integration
def     snake_case__			(lowerCAmelCase_						):
    UpperCamelCase__	     =      tmp_path / "dir1"
    UpperCamelCase__	     =      tmp_path / "dir2"
    dira.mkdir()
    dira.mkdir()
    UpperCamelCase__	     =      "script.py"
    UpperCamelCase__	     =      dedent(
        "\n    from datasets.fingerprint import Hasher\n    def foo():\n        pass\n    print(Hasher.hash(foo))\n    "						)
    UpperCamelCase__	     =      dira / script_filename
    UpperCamelCase__	     =      dira / script_filename
    with script_patha.open("w"						) as f:
        f.write(lowerCAmelCase_						)
    with script_patha.open("w"						) as f:
        f.write(lowerCAmelCase_						)
    UpperCamelCase__	     =      subprocess.check_output(["python", str(lowerCAmelCase_						)]						)
    UpperCamelCase__	     =      subprocess.check_output(["python", str(lowerCAmelCase_						)]						)
    assert fingerprinta == fingerprinta





def     snake_case__			():
    UpperCamelCase__	     =      {"a": [0, 1, 2]}
    UpperCamelCase__	     =      DatasetChild(InMemoryTable.from_pydict(lowerCAmelCase_						)						)
    UpperCamelCase__	     =      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     snake_case__			():
    UpperCamelCase__	     =      {"a": [0, 1, 2]}

    class    lowerCamelCase_				(						datasets.Dataset	):






       '''simple docstring'''

       @fingerprint_transform(inplace=__UpperCamelCase			)
       def 						_UpperCamelCase							(	self  ,    __UpperCamelCase			):
           return DummyDatasetChild(self.data  ,    fingerprint=__UpperCamelCase			)

    UpperCamelCase__	     =      DummyDatasetChild(InMemoryTable.from_pydict(lowerCAmelCase_						)						).func()

    class    lowerCamelCase_				(						datasets.Dataset	):






       '''simple docstring'''

       @fingerprint_transform(inplace=__UpperCamelCase  ,    version="1.0.0"			)
       def 						_UpperCamelCase							(	self  ,    __UpperCamelCase			):
           return DummyDatasetChild(self.data  ,    fingerprint=__UpperCamelCase			)

    UpperCamelCase__	     =      DummyDatasetChild(InMemoryTable.from_pydict(lowerCAmelCase_						)						).func()

    class    lowerCamelCase_				(						datasets.Dataset	):






       '''simple docstring'''

       @fingerprint_transform(inplace=__UpperCamelCase  ,    version="2.0.0"			)
       def 						_UpperCamelCase							(	self  ,    __UpperCamelCase			):
           return DummyDatasetChild(self.data  ,    fingerprint=__UpperCamelCase			)

    UpperCamelCase__	     =      DummyDatasetChild(InMemoryTable.from_pydict(lowerCAmelCase_						)						).func()

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





def     snake_case__			():
    # AttributeError: module 'dill._dill' has no attribute 'stack'
    UpperCamelCase__	     =      Hasher()
    hasher.update(lambda lowerCAmelCase_						: x						)




