


'''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 		a__				:





							'''simple docstring'''






							def __init__(		self					,    lowerCamelCase_   )       ->							Optional[int]:
														lowerCAmelCase__          =	foo







							def __call__(		self   )       ->							Tuple:
														return self.foo




class 		a__				(							datasets.Dataset  ):





							'''simple docstring'''






							@fingerprint_transform(inplace=A_   )
							def   __SCREAMING_SNAKE_CASE							(		self					,    lowerCamelCase_					,    *lowerCamelCase_					,    **lowerCamelCase_   )       ->							int:
														return DatasetChild(self.data					,    fingerprint=A_   )







							@fingerprint_transform(inplace=A_   )
							def   __SCREAMING_SNAKE_CASE							(		self					,    lowerCamelCase_					,    *lowerCamelCase_					,    **lowerCamelCase_   )       ->							List[Any]:
														return DatasetChild(self.data					,    fingerprint=A_   )




class 		a__				:





							'''simple docstring'''






							def __init__(		self					,    lowerCamelCase_   )       ->							Optional[Any]:
														lowerCAmelCase__          =	callable







							def __call__(		self					,    *lowerCamelCase_					,    **lowerCamelCase_   )       ->							List[str]:






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







							def __getstate__(		self   )       ->							Optional[int]:
														raise pickle.PicklingError()




class 		a__				(							snake_case_  ):





							'''simple docstring'''






							@require_transformers
							@pytest.mark.integration
							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Any:
														from transformers import AutoTokenizer

														def encode(lowerCamelCase_   ):
																					return tokenizer(A_   )

														# TODO: add hash consistency tests across sessions
														lowerCAmelCase__          =	AutoTokenizer.from_pretrained('''bert-base-uncased'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(lambda lowerCamelCase_   : tokenizer(A_   )   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	AutoTokenizer.from_pretrained('''bert-base-cased'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(lambda lowerCamelCase_   : tokenizer(A_   )   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	AutoTokenizer.from_pretrained('''bert-base-uncased'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(lambda lowerCamelCase_   : tokenizer(A_   )   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							@require_transformers
							@pytest.mark.integration
							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Any:
														from transformers import AutoTokenizer

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







							@require_regex
							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Union[str, Any]:
														import regex

														lowerCAmelCase__          =	regex.Regex('''foo'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	regex.Regex('''bar'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	regex.Regex('''foo'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )




class 		a__				(							snake_case_  ):





							'''simple docstring'''






							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							List[str]:






														def func():
																					return foo

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







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							str:






														def func():
																					pass

														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()

														def func():
																					pass

														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Optional[Any]:
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(Foo([0]   )   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(Foo([1]   )   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(Foo([0]   )   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Optional[Any]:
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(Foo([0]   ).__call__   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(Foo([1]   ).__call__   )   ).hexdigest()
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(Foo([0]   ).__call__   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Optional[Any]:
														lowerCAmelCase__          =	(
														    '''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(*lowerCamelCase_   ):
																					if hasattr(args[-3]					,    '''encode'''   ):
																												lowerCAmelCase__          =	list(A_   )
																												lowerCAmelCase__          =	args[-3].encode()  # co_lnotab
																												lowerCAmelCase__          =	args[-10].encode()  # co_code
																					if hasattr(A_					,    '''co_posonlyargcount'''   ):
																												if len(A_   ) == 16:
																																			return CodeType(*A_   )
																												elif len(A_   ) == 15:
																																			return CodeType(args[0]					,    0					,    *args[1:]   )
																												return CodeType(args[0]					,    0					,    0					,    *args[1:]   )
																					elif hasattr(A_					,    '''co_kwonlyargcount'''   ):
																												if len(A_   ) == 16:
																																			return CodeType(args[0]					,    *args[2:]   )
																												elif len(A_   ) == 15:
																																			return CodeType(*A_   )
																												return CodeType(args[0]					,    0					,    *args[1:]   )
																					if len(A_   ) == 16:
																												return CodeType(args[0]					,    *args[3:]   )
																					elif len(A_   ) == 15:
																												return CodeType(args[0]					,    *args[2:]   )
																					return CodeType(*A_   )

														def create_ipython_func(lowerCamelCase_					,    lowerCamelCase_   ):
																					def func():
																												return returned_obj

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

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

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







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Optional[Any]:
														lowerCAmelCase__   ,					lowerCAmelCase__          =	[0], [1]

														def func():
																					return foo, bar

														lowerCAmelCase__          =	'''__main__'''

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

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

														with patch('''dill.detect.globalvars'''					,    side_effect=A_   ) as globalvars_mocka:
																					lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
																					self.assertGreater(globalvars_mocka.call_count					,    0   )
														with patch('''dill.detect.globalvars'''					,    side_effect=A_   ) as globalvars_mocka:
																					lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
																					self.assertGreater(globalvars_mocka.call_count					,    0   )
														self.assertEqual(A_					,    A_   )




class 		a__				(							snake_case_  ):





							'''simple docstring'''






							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Tuple:
														lowerCAmelCase__          =	Hasher.hash('''hello'''   )
														lowerCAmelCase__          =	Hasher.hash('''hello'''   )
														lowerCAmelCase__          =	Hasher.hash('''there'''   )
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Dict:
														lowerCAmelCase__          =	Hasher.hash(Foo('''hello'''   )   )
														lowerCAmelCase__          =	Hasher.hash(Foo('''hello'''   )   )
														lowerCAmelCase__          =	Hasher.hash(Foo('''there'''   )   )
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							int:
														lowerCAmelCase__          =	Hasher()
														for x in ["hello", Foo('''hello'''   )]:
																					hasher.update(A_   )
														lowerCAmelCase__          =	hasher.hexdigest()
														lowerCAmelCase__          =	Hasher()
														for x in ["hello", Foo('''hello'''   )]:
																					hasher.update(A_   )
														lowerCAmelCase__          =	hasher.hexdigest()
														lowerCAmelCase__          =	Hasher()
														for x in ["there", Foo('''there'''   )]:
																					hasher.update(A_   )
														lowerCAmelCase__          =	hasher.hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Optional[Any]:






														with self.assertRaises(pickle.PicklingError   ):
																					Hasher.hash(UnpicklableCallable(Foo('''hello'''   )   )   )







							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							str:
														lowerCAmelCase__          =	'''abc'''
														lowerCAmelCase__          =	[string, string]  # two strings have the same ids
														lowerCAmelCase__          =	[string, string]
														lowerCAmelCase__          =	json.loads(F"""[\"{string}\", \"{string}\"]"""   )  # two strings have different ids
														self.assertIs(obja[0]					,    A_   )
														self.assertIs(obja[0]					,    obja[1]   )
														self.assertIs(obja[0]					,    A_   )
														self.assertIs(obja[0]					,    obja[1]   )
														self.assertIsNot(obja[0]					,    A_   )
														self.assertIsNot(obja[0]					,    obja[1]   )
														lowerCAmelCase__          =	Hasher.hash(A_   )
														lowerCAmelCase__          =	Hasher.hash(A_   )
														lowerCAmelCase__          =	Hasher.hash(A_   )
														self.assertEqual(A_					,    A_   )
														self.assertEqual(A_					,    A_   )







							@require_tiktoken
							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Dict:
														import tiktoken

														lowerCAmelCase__          =	tiktoken.get_encoding('''gpt2'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	tiktoken.get_encoding('''r50k_base'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	tiktoken.get_encoding('''gpt2'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							@require_torch
							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							int:
														import torch

														lowerCAmelCase__          =	torch.tensor([1.0]   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	torch.tensor([2.0]   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	torch.tensor([1.0]   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )







							@require_spacy
							@require_spacy_model('''en_core_web_sm'''   )
							@require_spacy_model('''fr_core_news_sm'''   )
							@pytest.mark.integration
							def   __SCREAMING_SNAKE_CASE							(		self   )       ->							Optional[Any]:
														import spacy

														lowerCAmelCase__          =	spacy.load('''en_core_web_sm'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	spacy.load('''fr_core_news_sm'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														lowerCAmelCase__          =	spacy.load('''en_core_web_sm'''   )
														lowerCAmelCase__          =	mda(datasets.utils.py_utils.dumps(A_   )   ).hexdigest()
														self.assertEqual(A_					,    A_   )
														self.assertNotEqual(A_					,    A_   )


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


def 					_snake_case   (     )						->    Dict:
							lowerCAmelCase__          =	{'''a''': [0, 1, 2]}
							lowerCAmelCase__          =	DatasetChild(InMemoryTable.from_pydict(A       )       )
							lowerCAmelCase__          =	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   (     )						->    List[Any]:
							lowerCAmelCase__          =	{'''a''': [0, 1, 2]}




							class 		a__				(							datasets.Dataset  ):





														'''simple docstring'''






														@fingerprint_transform(inplace=A_   )
														def   __SCREAMING_SNAKE_CASE							(		self					,    lowerCamelCase_   )       ->							List[Any]:
																					return DummyDatasetChild(self.data					,    fingerprint=A_   )

							lowerCAmelCase__          =	DummyDatasetChild(InMemoryTable.from_pydict(A       )       ).func()




							class 		a__				(							datasets.Dataset  ):





														'''simple docstring'''






														@fingerprint_transform(inplace=A_					,    version='''1.0.0'''   )
														def   __SCREAMING_SNAKE_CASE							(		self					,    lowerCamelCase_   )       ->							str:
																					return DummyDatasetChild(self.data					,    fingerprint=A_   )

							lowerCAmelCase__          =	DummyDatasetChild(InMemoryTable.from_pydict(A       )       ).func()




							class 		a__				(							datasets.Dataset  ):





														'''simple docstring'''






														@fingerprint_transform(inplace=A_					,    version='''2.0.0'''   )
														def   __SCREAMING_SNAKE_CASE							(		self					,    lowerCamelCase_   )       ->							List[str]:
																					return DummyDatasetChild(self.data					,    fingerprint=A_   )

							lowerCAmelCase__          =	DummyDatasetChild(InMemoryTable.from_pydict(A       )       ).func()

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






def 					_snake_case   (     )						->    Optional[int]:
							# AttributeError: module 'dill._dill' has no attribute 'stack'
							lowerCAmelCase__          =	Hasher()
							hasher.update(lambda A       : x       )

'''simple docstring'''
from typing import SupportsIndex

import numpy as np
from scipy.ndimage import convolve







def 						A_(			A		:						np.ndarray						,			A		:						np.ndarray						,			A		:						np.ndarray):
							UpperCamelCase					       =			np.stack((horizontal_flow, vertical_flow)						,			2)

							# Create a grid of all pixel coordinates and subtract the flow to get the
							# target pixels coordinates
							UpperCamelCase					       =			np.stack(
							    np.meshgrid(np.arange(0						,			image.shape[1])						,			np.arange(0						,			image.shape[0]))						,			2)
							UpperCamelCase					       =			np.round(grid - flow).astype(np.intaa)

							# Find the locations outside of the original image
							UpperCamelCase					       =			(grid < 0) | (grid >= np.array([image.shape[1], image.shape[0]]))
							UpperCamelCase					       =			0

							UpperCamelCase					       =			image[grid[:, :, 1], grid[:, :, 0]]

							# Set pixels at invalid locations to 0
							UpperCamelCase					       =			0

							return warped







def 						A_(			A		:						np.ndarray						,			A		:						np.ndarray						,			A		:						SupportsIndex						,			A		:						float | None = None						,			):
							if alpha is None:
														UpperCamelCase					       =			0.1

							# Initialize flow
							UpperCamelCase					       =			np.zeros_like(A)
							UpperCamelCase					       =			np.zeros_like(A)

							# Prepare kernels for the calculation of the derivatives and the average velocity
							UpperCamelCase					       =			np.array([[-1, 1], [-1, 1]]) * 0.25
							UpperCamelCase					       =			np.array([[-1, -1], [1, 1]]) * 0.25
							UpperCamelCase					       =			np.array([[1, 1], [1, 1]]) * 0.25
							UpperCamelCase					       =			np.array(
							    [[1 / 12, 1 / 6, 1 / 12], [1 / 6, 0, 1 / 6], [1 / 12, 1 / 6, 1 / 12]])

							# Iteratively refine the flow
							for _ in range(A):
														UpperCamelCase					       =			warp(A						,			A						,			A)
														UpperCamelCase					       =			convolve(A						,			A) + convolve(A						,			A)
														UpperCamelCase					       =			convolve(A						,			A) + convolve(A						,			A)
														UpperCamelCase					       =			convolve(A						,			A) + convolve(A						,			-kernel_t)

														UpperCamelCase					       =			convolve(A						,			A)
														UpperCamelCase					       =			convolve(A						,			A)

														# This updates the flow as proposed in the paper (Step 12)
														UpperCamelCase					       =			(
														    derivative_x * avg_horizontal_velocity
														    + derivative_y * avg_vertical_velocity
														    + derivative_t
														)
														UpperCamelCase					       =			update / (alpha**2 + derivative_x**2 + derivative_y**2)

														UpperCamelCase					       =			avg_horizontal_velocity - derivative_x * update
														UpperCamelCase					       =			avg_vertical_velocity - derivative_y * update

							return horizontal_flow, vertical_flow


if __name__ == "__main__":
						import doctest

						doctest.testmod()




