<commit_before>package main

import "net"
import "fmt"

func getDocker0Network() net.IPNet {
	iface, _ := net.InterfaceByName("docker0")
	addresses, _ := iface.Addrs()
	docker0IP := net.ParseIP(addresses[0].String())

	return net.IPNet{
		IP:   docker0IP,
		Mask: docker0IP.DefaultMask(),
	}
}

func getIps(
	excludeLocalhost bool,
	excludeDockerNetwork bool,
	separator string) []string {

	adresses, _ := net.InterfaceAddrs()
	ips := make([]string, 0)

	docker0Network := getDocker0Network()

	for _, addr := range adresses {
		parsedIP := net.ParseIP(addr.String())

		fmt.Println(addr.String())

		if excludeLocalhost && parsedIP.IsLoopback() {
			continue
		} else if excludeDockerNetwork && docker0Network.Contains(parsedIP) {
			continue
		} else {
			ips = append(ips, parsedIP.String())
		}

		fmt.Println(parsedIP.String())
	}

	return ips
}

func main() {
	fmt.Println(getIps(true, true, ","))
}<commit_msg>Checkpoint<commit_after>package main

import (
	"fmt"
	"net"
	"strings"
)

func getDocker0Network() net.IPNet {
	iface, _ := net.InterfaceByName("docker0")
	addresses, _ := iface.Addrs()
	docker0IP := net.ParseIP(addresses[0].String())

	return net.IPNet{
		IP:   docker0IP,
		Mask: docker0IP.DefaultMask(),
	}
}

func getIps(
	excludeLocalhost bool,
	excludeDockerNetwork bool,
	onlyipv4 bool,
	onlyipv6 bool) []string {

	adresses, _ := net.InterfaceAddrs()
	ips := make([]string, 0)

	docker0Network := getDocker0Network()

	for _, addr := range adresses {
		parsedIP, _, _ := net.ParseCIDR(addr.String())

		if excludeLocalhost && parsedIP.IsLoopback() {
			continue
		} else if excludeDockerNetwork && docker0Network.Contains(parsedIP) {
			continue
		} else if onlyipv4 && parsedIP.To4() == nil {
			continue
		} else if onlyipv6 && parsedIP.To4() != nil {
			continue
		}

		ips = append(ips, parsedIP.String())
	}

	return ips
}

func formatOutput(ips []string, separator string) string {
	return strings.Join(ips, separator)
}

func main() {
	excludeLocalhost := false
	excludeDockerNetwork := true
	onlyipv4 := true
	onlyipv6 := false
	separator := ","

	ips := getIps(
		excludeLocalhost,
		excludeDockerNetwork,
		onlyipv4,
		onlyipv6,
	)

	output := formatOutput(ips, separator)

	fmt.Println(output)
}
{'fraction_non_alphanumeric': 0.1374832064487237, 'fraction_numerical': 0.013434841021047918, 'mean_word_length': 4.319047619047619, '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': '3530668', 'n_tokens_mistral': 870, 'n_tokens_neox': 798, 'n_words': 165}