<commit_before>package com.namelessmc.NamelessAPI;

import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;

import com.namelessmc.NamelessAPI.utils.NamelessRequestUtil;
import com.namelessmc.NamelessAPI.utils.NamelessRequestUtil.Request;

public final class NamelessAPI {

	private NamelessAPI() {}
	
	/**
	 * Checks if a web API connection can be established
	 * @return An exception if the connection was unsuccessful, null if the connection was successful.
	 */
	public static Exception checkWebAPIConnection(URL url) {
		Request request = NamelessRequestUtil.sendPostRequest(url, "checkConnection", null);
		if (request.hasSucceeded()) {
			return null;
		} else {
			return request.getException();
		}
		
		/* try {
			boolean https = url.toString().startsWith("https");
			
			URL apiConnection = new URL(url + "/checkConnection");
			
			URLConnection connection;
			
			if (https) {
				HttpsURLConnection httpsConnection = (HttpsURLConnection) apiConnection.openConnection();
				httpsConnection.setRequestMethod("POST");
				connection = httpsConnection;
			} else {
				HttpURLConnection httpConnection = (HttpURLConnection) apiConnection.openConnection();
				httpConnection.setRequestMethod("POST");
				connection = httpConnection;
			}
			
			connection.setRequestProperty("Content-Length", Integer.toString(0));
			connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
			connection.setDoOutput(true);
			connection.addRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");


			// Initialize output stream
			DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());
			// Write request
			outputStream.writeBytes("");

			// Initialize input stream
			InputStream inputStream = connection.getInputStream();

			// Handle response
			BufferedReader streamReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
			StringBuilder responseBuilder = new StringBuilder();

			String responseString;
			while ((responseString = streamReader.readLine()) != null)
				responseBuilder.append(responseString);

			JsonObject response = new JsonObject();
			JsonParser parser = new JsonParser();

			response = parser.parse(responseBuilder.toString()).getAsJsonObject();
			
			outputStream.flush();
			outputStream.close();
			inputStream.close();

			if (https) {
				((HttpsURLConnection) connection).disconnect();
			} else {
				((HttpURLConnection) connection).disconnect();
			}
			
			if (response.has("success")
					|| response.get("message").getAsString().equalsIgnoreCase("Invalid API method")) {
				return null;
			} else if (response.has("error")) {
				return new NamelessException(response.get("message").getAsString());
			} else {
				return new NamelessException();
			}
		} catch (Exception e) {
			return new NamelessException(e);
		}*/
	}
	
	static String urlEncodeString(String string) {
		try {
			return URLEncoder.encode(string, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e.getMessage());
		}
	}

}<commit_msg>Remove unused code<commit_after>package com.namelessmc.NamelessAPI;

import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;

import com.namelessmc.NamelessAPI.utils.NamelessRequestUtil;
import com.namelessmc.NamelessAPI.utils.NamelessRequestUtil.Request;

public final class NamelessAPI {

	private NamelessAPI() {}
	
	/**
	 * Checks if a web API connection can be established
	 * @return An exception if the connection was unsuccessful, null if the connection was successful.
	 */
	public static Exception checkWebAPIConnection(URL url) {
		Request request = NamelessRequestUtil.sendPostRequest(url, "checkConnection", null);
		if (request.hasSucceeded()) {
			return null;
		} else {
			return request.getException();
		}
	}
	
	static String urlEncodeString(String string) {
		try {
			return URLEncoder.encode(string, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e.getMessage());
		}
	}

}
{'fraction_non_alphanumeric': 0.11197853134910954, 'fraction_numerical': 0.0024396194193705783, 'mean_word_length': 4.518169582772543, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '2759613', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1142, 'n_words': 265}