<commit_before>package pt.api;

import org.apache.commons.lang3.StringUtils;
import org.yaml.snakeyaml.Yaml;
import pt.uptodate.util.io.IOUtils;
import pt.uptodate.util.io.WebUtils;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Strikingwolf
 */
public class UpdateableUtils {
	public static String fromUrlPlain(String url) {
		List<String> read = WebUtils.readWebsite(url);
		if (read == null) {
			return null;
		} else {
			return StringUtils.join(WebUtils.readWebsite(url), "");
		}
	}

	public static HashMap<String, String> localVersionFile(File file) {
		Set<String> read = IOUtils.readLines(file);
		Yaml yaml = new Yaml();
		Map<String, Object> load = (Map<String, Object>) yaml.load(StringUtils.join(read));

		HashMap<String, String> result = new HashMap<String, String>();
		result.put("localDisp", (String) load.get("localDisp"));
		result.put("localTech", (String) load.get("localTech"));

		return result;<commit_msg>Things fail when I'm tired :P<commit_after>package pt.api;

import org.apache.commons.lang3.StringUtils;
import org.yaml.snakeyaml.Yaml;
import pt.uptodate.util.io.IOUtils;
import pt.uptodate.util.io.WebUtils;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Strikingwolf
 */
public class UpdateableUtils {
	public static String fromUrlPlain(String url) {
		List<String> read = WebUtils.readWebsite(url);
		if (read == null) {
			return null;
		} else {
			return StringUtils.join(read, "");
		}
	}

	public static HashMap<String, String> localVersionFile(File file) {
		Set<String> read = IOUtils.readLines(file);
		Yaml yaml = new Yaml();
		Map<String, Object> load = (Map<String, Object>) yaml.load(StringUtils.join(read));

		HashMap<String, String> result = new HashMap<String, String>();
		result.put("localDisp", (String) load.get("localDisp"));
		result.put("localTech", (String) load.get("localTech"));

		return result;
{'fraction_non_alphanumeric': 0.14652195362604833, 'fraction_numerical': 0.000986679822397632, 'mean_word_length': 4.947214076246334, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '3005089', 'n_tokens_mistral': 729, 'n_tokens_neox': 688, 'n_words': 152}