<commit_before>package net.simpvp.Jail;

import java.io.File;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.file.YamlConfiguration;

import com.maxmind.geoip.Country;
import com.maxmind.geoip.LookupService;

public class GeoIP {

	private static LookupService asn4 = null;
	private static LookupService asn6 = null;
	private static LookupService country4 = null;
	private static LookupService country6 = null;

	// Key is ASN, value is reason it's added to list.
	public static HashMap<Integer, String> bad_asns = null;

	public static void init() {
		String geoipDatabaseDir = Jail.instance.getConfig().getString("geoipDatabase");

		if (geoipDatabaseDir == null) {
			Jail.instance.getLogger().info("Not using geoip database");
			return;
		}

		if (!geoipDatabaseDir.endsWith("/")) {
			geoipDatabaseDir += "/";
		}

		try {
			asn4 = new LookupService(geoipDatabaseDir + "GeoIPASNum.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);
			asn6 = new LookupService(geoipDatabaseDir + "GeoIPASNumv6.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);
			country4 = new LookupService(geoipDatabaseDir + "GeoIP.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);
			country6 = new LookupService(geoipDatabaseDir + "GeoIPv6.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);

			Jail.instance.getLogger().info("Initiated geoip database");
		} catch (Exception e) {
			Jail.instance.getLogger().severe("Error instantiating GeoIP database " + e);
			e.printStackTrace();
		}

		try {
			File f = new File(Jail.instance.getDataFolder(), "bad_asns.yaml");<commit_msg>Add missing return<commit_after>package net.simpvp.Jail;

import java.io.File;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.file.YamlConfiguration;

import com.maxmind.geoip.Country;
import com.maxmind.geoip.LookupService;

public class GeoIP {

	private static LookupService asn4 = null;
	private static LookupService asn6 = null;
	private static LookupService country4 = null;
	private static LookupService country6 = null;

	// Key is ASN, value is reason it's added to list.
	public static HashMap<Integer, String> bad_asns = null;

	public static void init() {
		String geoipDatabaseDir = Jail.instance.getConfig().getString("geoipDatabase");

		if (geoipDatabaseDir == null) {
			Jail.instance.getLogger().info("Not using geoip database");
			return;
		}

		if (!geoipDatabaseDir.endsWith("/")) {
			geoipDatabaseDir += "/";
		}

		try {
			asn4 = new LookupService(geoipDatabaseDir + "GeoIPASNum.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);
			asn6 = new LookupService(geoipDatabaseDir + "GeoIPASNumv6.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);
			country4 = new LookupService(geoipDatabaseDir + "GeoIP.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);
			country6 = new LookupService(geoipDatabaseDir + "GeoIPv6.dat", LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);

			Jail.instance.getLogger().info("Initiated geoip database");
		} catch (Exception e) {
			Jail.instance.getLogger().severe("Error instantiating GeoIP database " + e);
			e.printStackTrace();
			return;
		}

		try {
			File f = new File(Jail.instance.getDataFolder(), "bad_asns.yaml");
{'fraction_non_alphanumeric': 0.11015625, 'fraction_numerical': 0.00625, 'mean_word_length': 5.286415711947627, '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': '4427945', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1264, 'n_words': 258}