<commit_before>package backend

import (
	"fmt"
	"time"
)

// CreateProxy creates a new proxy
func CreateProxy(ip string, port int, t ProxyType, p ProxyProtocol) *Proxy {
	proxy := &Proxy{
		IP:       ip,
		Port:     port,
		Type:     t,
		Protocol: p,
		Joined:   time.Now().Unix(),
	}
	proxy.GenerateIdentifier()
	return proxy
}

// GenerateIdentifier generates the unique identifier for the proxy
func (p *Proxy) GenerateIdentifier() {
	p.Identifier = fmt.Sprintf("%s:%d", p.IP, p.Port)
}<commit_msg>Added HasKey function to check for key duplication<commit_after>package backend

import (
	"fmt"
	"time"
)

// CreateProxy creates a new proxy
func CreateProxy(ip string, port int, t ProxyType, p ProxyProtocol) *Proxy {
	proxy := &Proxy{
		IP:       ip,
		Port:     port,
		Type:     t,
		Protocol: p,
		Joined:   time.Now().Unix(),
	}
	proxy.GenerateIdentifier()
	return proxy
}

// GenerateIdentifier generates the unique identifier for the proxy
func (p *Proxy) GenerateIdentifier() {
	p.Identifier = fmt.Sprintf("%s:%d", p.IP, p.Port)
}

// HasKey checks if a check key is already present
func (p *Proxy) HasKey(key string) bool {
	for i := 0; i < len(p.Checks); i++ {
		if p.Checks[i].Key == key {
			return true
		}
	}
	return false
}
{'fraction_non_alphanumeric': 0.12952534191472245, 'fraction_numerical': 0.0008045052292839903, 'mean_word_length': 3.4748201438848922, 'pattern_counts': {'":': 0, '<': 4, '<?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': '7329558', 'n_tokens_mistral': 440, 'n_tokens_neox': 422, 'n_words': 137}