<commit_before>package ipfs

import (
	"fmt"
	"os"
)

var IpfsHost string = "http://0.0.0.0"

func IPFSBaseGatewayUrl(gateway string) string {
	if gateway == "eris" {
		return fmt.Sprintf("%s%s", sexyUrl(), ":8080/ipfs/")
	} else if gateway != "" {
		return fmt.Sprintf("%s%s", gateway, ":8080/ipfs/")
	} else {
		return fmt.Sprintf("%s%s", IPFSUrl(), ":8080/ipfs/")
	}
}

func IPFSBaseAPIUrl() string {
	return fmt.Sprintf("%s%s", IPFSUrl(), ":5001/api/v0/")
}

func sexyUrl() string {
	//TODO load balancer (when one isn't enough)
	return "http://ipfs.erisbootstrap.sexy"
}

func IPFSUrl() string {
	var host string
	if os.Getenv("ERIS_CLI_CONTAINER") == "true" {
		host = "http://ipfs"
	} else {
		if os.Getenv("ERIS_IPFS_HOST") != "" {
			host = os.Getenv("ERIS_IPFS_HOST")
		} else {
			host = IpfsHost
		}
	}
	return host
}<commit_msg>sexyUrl -> SexyUrl<commit_after>package ipfs

import (
	"fmt"
	"os"
)

var IpfsHost string = "http://0.0.0.0"

func IPFSBaseGatewayUrl(gateway string) string {
	if gateway == "eris" {
		return fmt.Sprintf("%s%s", SexyUrl(), ":8080/ipfs/")
	} else if gateway != "" {
		return fmt.Sprintf("%s%s", gateway, ":8080/ipfs/")
	} else {
		return fmt.Sprintf("%s%s", IPFSUrl(), ":8080/ipfs/")
	}
}

func IPFSBaseAPIUrl() string {
	return fmt.Sprintf("%s%s", IPFSUrl(), ":5001/api/v0/")
}

func SexyUrl() string {
	//TODO load balancer (when one isn't enough)
	// also hosts toadserver (for init) at port 11113
	return "http://ipfs.erisbootstrap.sexy"
}

func IPFSUrl() string {
	var host string
	if os.Getenv("ERIS_CLI_CONTAINER") == "true" {
		host = "http://ipfs"
	} else {
		if os.Getenv("ERIS_IPFS_HOST") != "" {
			host = os.Getenv("ERIS_IPFS_HOST")
		} else {
			host = IpfsHost
		}
	}
	return host
}
{'fraction_non_alphanumeric': 0.189873417721519, 'fraction_numerical': 0.02704257767548907, 'mean_word_length': 3.7774725274725274, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6400311', 'n_tokens_mistral': 781, 'n_tokens_neox': 723, 'n_words': 153}