<commit_before>package utils

import (
	"net"
	"os"
	"reflect"
	"sync"
)

const (
	Empty = ""
)

var (
	internalIpOnce sync.Once
)

//ips
func GetInternal() string {
	internalIp := ""

	internalIpOnce.Do(func() {
		addrs, err := net.InterfaceAddrs()
		if err != nil {
			os.Stderr.WriteString("Oops:" + err.Error())
			os.Exit(1)
		}
		for _, a := range addrs {
			if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
				if ipnet.IP.To4() != nil {
					internalIp = ipnet.IP.To4().String()
				}
			}
		}
	})
	return internalIp
}

func IsNotNil(object interface{}) bool {
	return !IsNilObject(object)
}

func IsNilObject(object interface{}) bool {
	if object == nil {
		return true
	}

	value := reflect.ValueOf(object)
	kind := value.Kind()
	if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() {
		return true
	}

	return false
}
<commit_msg>add test case for utils<commit_after>package utils

import (
	"net"
	"os"
	"reflect"
	"sync"
)

const (
	Empty = ""
)

var (
	internalIpOnce sync.Once
	internalIp     = ""
)

//ips
func GetInternal() string {
	internalIpOnce.Do(func() {
		addrs, err := net.InterfaceAddrs()
		if err != nil {
			os.Stderr.WriteString("Oops:" + err.Error())
			os.Exit(1)
		}
		for _, a := range addrs {
			if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
				if ipnet.IP.To4() != nil {
					internalIp = ipnet.IP.To4().String()
				}
			}
		}
	})
	return internalIp
}

func IsNotNil(object interface{}) bool {
	return !IsNilObject(object)
}

func IsNilObject(object interface{}) bool {
	if object == nil {
		return true
	}

	value := reflect.ValueOf(object)
	kind := value.Kind()
	if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() {
		return true
	}

	return false
}

{'fraction_non_alphanumeric': 0.16533180778032036, 'fraction_numerical': 0.003432494279176201, 'mean_word_length': 3.125, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5236925', 'n_tokens_mistral': 721, 'n_tokens_neox': 666, 'n_words': 150}