<commit_before>from IPython.parallel.apps.ipclusterapp import IPClusterStart, IPClusterStop


def start_cluster(profile, n):
    """Start a cluster"""
    c = IPClusterStart(profile=profile, log_level=0, daemonize=True)
    c.n = n
    c.initialize(argv=[])
    c.start()


def stop_cluster(profile):
    """Stop a cluster"""
    c = IPClusterStop(profile=profile, log_level=0)
    c.initialize(argv=[])
    c.start()<commit_msg>Fork new processes when starting/stopping clusters<commit_after>from os import fork
from sys import exit

from IPython.parallel.apps.ipclusterapp import IPClusterStart, IPClusterStop


def start_cluster(profile, n):
    """Start a cluster"""
    me = fork()
    if me == 0:
        c = IPClusterStart(profile=profile, log_level=0, daemonize=True)
        c.n = n
        c.initialize(argv=[])
        c.start()


def stop_cluster(profile):
    """Stop a cluster"""
    me = fork()
    if me == 0:
        c = IPClusterStop(profile=profile, log_level=0)
        c.initialize(argv=[])
        c.start()
        exit(0)
{'fraction_non_alphanumeric': 0.1291866028708134, 'fraction_numerical': 0.0066985645933014355, 'mean_word_length': 3.340248962655602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1764830', 'n_tokens_mistral': 341, 'n_tokens_neox': 334, 'n_words': 81}