<commit_before>import net/[Socket, Address, DNS, Exceptions]
import io/[Reader, Writer]
import berkeley into socket
import text/Buffer

/**
    A stream based socket interface.
 */
StreamSocket: class extends Socket {
    remote: SocketAddress

    /**
       Create a new socket to a given remote address

       :param remote: The address of the host to eventually connect to.
     */
    init: func ~addr(=remote) {
        super(remote family(), SocketType STREAM, 0)
    }

    /**
       Create a new socket to a given remote address with a specific
       file descriptor.

       :param remote: The address of the host to eventually connect to.
     */
    init: func ~addrDescriptor(=remote, .descriptor) {
        super(remote family(), SocketType STREAM, 0, descriptor)
    }

    /**
       Create a new socket to a given hostname and port number

       :param host: The hostname, for example 'localhost', or 'www.example.org'
       :param port: The port, for example 8080, or 80.
     */
    init: func ~hostAndPort(host: String, port: Int) {
        init(host, port, SocketFamily UNSPEC)
    }


    /**
       Create a new socket to a given hostname, port number and specific family

       :param host: The hostname, for example 'localhost', or 'www.example.org'
       :param port: The port, for example 8080, or 80.
       :param port: The port, for example SocketFamily IP4.
     */
    init: func ~family(host: String, port: Int, family: Int) {
        ip := DNS resolveOne(host, SocketType STREAM, family)
        init(SocketAddress new(ip, port))
    }
<commit_msg>doc typo<commit_after>import net/[Socket, Address, DNS, Exceptions]
import io/[Reader, Writer]
import berkeley into socket
import text/Buffer

/**
    A stream based socket interface.
 */
StreamSocket: class extends Socket {
    remote: SocketAddress

    /**
       Create a new socket to a given remote address

       :param remote: The address of the host to eventually connect to.
     */
    init: func ~addr(=remote) {
        super(remote family(), SocketType STREAM, 0)
    }

    /**
       Create a new socket to a given remote address with a specific
       file descriptor.

       :param remote: The address of the host to eventually connect to.
     */
    init: func ~addrDescriptor(=remote, .descriptor) {
        super(remote family(), SocketType STREAM, 0, descriptor)
    }

    /**
       Create a new socket to a given hostname and port number

       :param host: The hostname, for example 'localhost', or 'www.example.org'
       :param port: The port, for example 8080, or 80.
     */
    init: func ~hostAndPort(host: String, port: Int) {
        init(host, port, SocketFamily UNSPEC)
    }


    /**
       Create a new socket to a given hostname, port number and specific family

       :param host: The hostname, for example 'localhost', or 'www.example.org'
       :param port: The port, for example 8080, or 80.
       :param family: The port, for example SocketFamily IP4.
     */
    init: func ~family(host: String, port: Int, family: Int) {
        ip := DNS resolveOne(host, SocketType STREAM, family)
        init(SocketAddress new(ip, port))
    }

{'fraction_non_alphanumeric': 0.09385826771653544, 'fraction_numerical': 0.009448818897637795, 'mean_word_length': 2.609090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1427374', 'n_tokens_mistral': 935, 'n_tokens_neox': 882, 'n_words': 367}