<commit_before>/**
 * Copyright IBM Corporation 2015
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

import KituraNet
import LoggerAPI

import Foundation
import Dispatch


// MARK Kitura

public class Kitura {
    //
    // add an HTTPServer on a port with a delegate. The server is only registered with the framework,
    // it does not start listening on the port until Kitura.run() is called
    //
    public class func addHTTPServer(onPort port: Int, with delegate: HTTPServerDelegate) -> HTTPServer {
        let server = HTTP.createServer()
        server.delegate = delegate
        httpServersAndPorts.append(server: server, port: port)
        return server
    }

    //
    // Start Kitura framework - make all the registered servers to start listening on their port
    // The function never returns - should be the last call in main.swift
    //
    @noreturn
    public class func run() {<commit_msg>Revert "Marked Kitura.run as noreturn"<commit_after>/**
 * Copyright IBM Corporation 2015
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

import KituraNet
import LoggerAPI

import Foundation
import Dispatch


// MARK Kitura

public class Kitura {
    //
    // add an HTTPServer on a port with a delegate. The server is only registered with the framework,
    // it does not start listening on the port until Kitura.run() is called
    //
    public class func addHTTPServer(onPort port: Int, with delegate: HTTPServerDelegate) -> HTTPServer {
        let server = HTTP.createServer()
        server.delegate = delegate
        httpServersAndPorts.append(server: server, port: port)
        return server
    }

    //
    // Start Kitura framework - make all the registered servers to start listening on their port
    // The function never returns - should be the last call in main.swift
    //
    public class func run() {
{'fraction_non_alphanumeric': 0.06910994764397906, 'fraction_numerical': 0.005584642233856894, 'mean_word_length': 3.1119081779053084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5777811', 'n_tokens_mistral': 731, 'n_tokens_neox': 720, 'n_words': 355}