<commit_before>package continuum;

import continuum.rest.client.Client;
import continuum.rest.http.ContinuumReadHandler;
import continuum.rest.http.ContinuumWriteHandler;
import continuum.rest.http.HttpServerConfig;
import continuum.rest.http.IHttpServer;
import continuum.rest.http.netty.NettyHttpServer;
import continuum.universe.Universe;

/**
 * Main library entry point
 * Created by zack on 2/23/16.
 */
public class REST {

    private static REST instance;

    private final IHttpServer httpServer;

    private final Continuum continuum;

    public REST(Continuum continuum) throws Exception {
        this(continuum, 1337);
    }

    public REST(Continuum continuum, int port) throws Exception {
        if (instance != null) {
            throw new Exception("Already Running!");
        }
        this.continuum = continuum;
        HttpServerConfig config = HttpServerConfig.basicConfig();
        config.port = port;
        config.handlers.add(new ContinuumReadHandler());
        config.handlers.add(new ContinuumWriteHandler());
        this.httpServer = new NettyHttpServer(config);
        instance = this; // AHHHH!
    }

    public REST start() {
        httpServer.start();
        return this;
    }

    public void stop() {
        httpServer.stop();
    }

    public static REST instance() {
        return instance;
    }

    public Continuum continuum() {
        return continuum;
    }

    /**
     * Create a REST client for a given Continuum rest server
     * @param host rest host
     * @param port rest port
     * @return new REST client
     */
    public static Client client(String host, int port) {
        return new Client(host, port);
    }
<commit_msg>add util handler<commit_after>package continuum;

import continuum.rest.client.Client;
import continuum.rest.http.*;
import continuum.rest.http.netty.NettyHttpServer;
import continuum.universe.Universe;

/**
 * Main library entry point
 * Created by zack on 2/23/16.
 */
public class REST {

    private static REST instance;

    private final IHttpServer httpServer;

    private final Continuum continuum;

    public REST(Continuum continuum) throws Exception {
        this(continuum, 1337);
    }

    public REST(Continuum continuum, int port) throws Exception {
        if (instance != null) {
            throw new Exception("Already Running!");
        }
        this.continuum = continuum;
        HttpServerConfig config = HttpServerConfig.basicConfig();
        config.port = port;
        config.handlers.add(new ContinuumReadHandler());
        config.handlers.add(new ContinuumWriteHandler());
        config.handlers.add(new ContinuumUtilHandler());
        this.httpServer = new NettyHttpServer(config);
        instance = this; // AHHHH!
    }

    public REST start() {
        httpServer.start();
        return this;
    }

    public void stop() {
        httpServer.stop();
    }

    public static REST instance() {
        return instance;
    }

    public Continuum continuum() {
        return continuum;
    }

    /**
     * Create a REST client for a given Continuum rest server
     * @param host rest host
     * @param port rest port
     * @return new REST client
     */
    public static Client client(String host, int port) {
        return new Client(host, port);
    }

{'fraction_non_alphanumeric': 0.09173204586602293, 'fraction_numerical': 0.005431502715751358, 'mean_word_length': 2.618995633187773, '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': '3624337', 'n_tokens_mistral': 943, 'n_tokens_neox': 867, 'n_words': 262}