<commit_before>package main

import "net/http"
import "os"
import "strings"
import "fmt"

func main() {
    port := os.Getenv("PORT")
    if port == "" {
        port = "8080"
    }
    http.HandleFunc("/", IpResponse)
    http.ListenAndServe(":" + port, nil)
}

func IpResponse(response http.ResponseWriter, request *http.Request) {
    ip := request.Header.Get("X-Forwarded-For")
    if ip == "" {
        ip = request.RemoteAddr
    }

    colonPosition := strings.Index(ip, ":")
    if colonPosition > -1 {
        ip = ip[:colonPosition]
    }

    commaPosition := strings.Index(ip, ",")<commit_msg>Add support for ipv6 (which has colons in the IP address)<commit_after>package main

import "net/http"
import "os"
import "strings"
import "fmt"

func main() {
    port := os.Getenv("PORT")
    if port == "" {
        port = "8080"
    }
    http.HandleFunc("/", IpResponse)
    http.ListenAndServe(":" + port, nil)
}

func IpResponse(response http.ResponseWriter, request *http.Request) {
    ip := request.Header.Get("X-Forwarded-For")
    if ip == "" {
        ip = request.RemoteAddr
    }

    colonPosition := strings.LastIndex(ip, ":")
    if colonPosition > -1 {
        ip = ip[:colonPosition]
    }

    commaPosition := strings.Index(ip, ",")
{'fraction_non_alphanumeric': 0.1573926868044515, 'fraction_numerical': 0.008744038155802861, 'mean_word_length': 2.850152905198777, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, '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': '1800965', 'n_tokens_mistral': 425, 'n_tokens_neox': 412, 'n_words': 96}