


"""simple docstring"""






def __lowercase     (      lowerCamelCase_  :      int = 200  ):
				SCREAMING_SNAKE_CASE__     							=				[1, 2, 5, 10, 20, 50, 100, 200]
				SCREAMING_SNAKE_CASE__     							=				[0] * (pence + 1)
				SCREAMING_SNAKE_CASE__     							=				1  # base case: 1 way to make 0 pence

				for coin in coins:
								for i in range(lowerCamelCase_						,					pence + 1						,					1  ):
												number_of_ways[i] += number_of_ways[i - coin]
				return number_of_ways[pence]


if __name__ == "__main__":
	assert solution(200) == 73682




"""simple docstring"""






import json
import os
import tempfile

import transformers

import datasets
from utils import generate_example_dataset, get_duration


_lowerCamelCase     =  500000

_lowerCamelCase     ,     _lowerCamelCase     =  os.path.split(__file__)
_lowerCamelCase     =  os.path.join(RESULTS_BASEPATH, 'results', RESULTS_FILENAME.replace('.py', '.json'))


@get_duration
def __lowercase     (      lowerCamelCase_  :      datasets.Dataset						,					**lowerCamelCase_  :      Optional[int]  ):
				SCREAMING_SNAKE_CASE__     							=				dataset.map(**lowerCamelCase_  )


@get_duration
def __lowercase     (      lowerCamelCase_  :      datasets.Dataset						,					**lowerCamelCase_  :      Optional[int]  ):
				SCREAMING_SNAKE_CASE__     							=				dataset.filter(**lowerCamelCase_  )


def __lowercase     (      ):
				SCREAMING_SNAKE_CASE__     							=				{"num examples": SPEED_TEST_N_EXAMPLES}
				with tempfile.TemporaryDirectory() as tmp_dir:
								SCREAMING_SNAKE_CASE__     							=				datasets.Features({"text": datasets.Value("string"  ), "numbers": datasets.Value("float32"  )}  )
								SCREAMING_SNAKE_CASE__     							=				generate_example_dataset(
								    os.path.join(lowerCamelCase_						,					"dataset.arrow"  )						,					lowerCamelCase_						,					num_examples=lowerCamelCase_  )

								SCREAMING_SNAKE_CASE__     							=				transformers.AutoTokenizer.from_pretrained("bert-base-cased"						,					use_fast=lowerCamelCase_  )

								def tokenize(lowerCamelCase_  :      Union[str, Any]  ):
												return tokenizer(examples["text"]  )

								SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_  )

								SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					batched=lowerCamelCase_  )

								SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					function=lambda lowerCamelCase_  : None						,					batched=lowerCamelCase_  )

								with dataset.formatted_as(type="numpy"  ):
												SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					function=lambda lowerCamelCase_  : None						,					batched=lowerCamelCase_  )

								with dataset.formatted_as(type="pandas"  ):
												SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					function=lambda lowerCamelCase_  : None						,					batched=lowerCamelCase_  )

								with dataset.formatted_as(type="torch"						,					columns="numbers"  ):
												SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					function=lambda lowerCamelCase_  : None						,					batched=lowerCamelCase_  )

								with dataset.formatted_as(type="tensorflow"						,					columns="numbers"  ):
												SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					function=lambda lowerCamelCase_  : None						,					batched=lowerCamelCase_  )

								SCREAMING_SNAKE_CASE__     							=				map(lowerCamelCase_						,					function=lowerCamelCase_						,					batched=lowerCamelCase_  )

								SCREAMING_SNAKE_CASE__     							=				filter(lowerCamelCase_  )

								# Activate later when tokenizer support batched inputs
								# with dataset.formatted_as(type='numpy'):
								#     times[func.__name__ + " fast-tokenizer batched numpy"] = func(dataset, function=tokenize, batched=True)

				with open(lowerCamelCase_						,					"wb"  ) as f:
								f.write(json.dumps(lowerCamelCase_  ).encode("utf-8"  )  )


if __name__ == "__main__":  # useful to run the profiler
	benchmark_map_filter()
