<jupyter_start><jupyter_text>Futures<jupyter_code>numbers = [
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
    18014398777917439,
]
def is_prime(n):
    if n < 2:
        return False
    if n in (2, 3, 5, 7):
        return True
    if n % 2 == 0 or n % 3 == 0 or n % 5 == 0 or n % 7 == 0:
        return False
    upper_limit = int(math.sqrt(n)) + 1
    for i in range(11, upper_limit, 2):
        if n % i == 0:
            return False
    return True
start = time.perf_counter_ns()

with ThreadPoolExecutor(max_workers=10) as ex:
    for number, prime in zip(numbers, ex.map(is_prime, numbers)):
        print(f'{number} is prime: {prime}')

end = time.perf_counter_ns()
print(f"time: {(end - start) / 1000000.0} ms")<jupyter_output>10657331232548839 is prime: True
10963707205259 is prime: True
15285151248481 is prime: True
1111111111111111111 is prime: True
70368760954879 is prime: True
18014398777917439 is prime: True
time: 36224.4556 ms
{'fraction_non_alphanumeric': 0.09519797809604044, 'fraction_numerical': 0.2830665543386689, 'mean_word_length': 2.9207920792079207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '175491', 'license': 'MIT', 'n_tokens_mistral': 666, 'n_tokens_neox': 446, 'n_words': 114, 'path': 'Chapter13_ParallelCode/futures.ipynb', 'repo_name': 'stefan-ewald/UdemyPythonPro', 'size': '1187'}