<commit_before>package co.gem.round;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.junit.Assert;

import java.io.*;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Random;

/**
 * Created by jled on 12/31/14.
 */
public class Utils {


  // Set these for testing.

  private static final String API_URL = "http://localhost:8999";

  private static final String API_TOKEN = "<KEY>";
  private static final String ADMIN_TOKEN = "<KEY>";
  private static final String TOTP_SECRET = "<KEY>";


  private static final String USER_EMAIL = "<EMAIL>";


  public static String getUserInput(String str) throws IOException {
    BufferedReader buff = new BufferedReader(
            new InputStreamReader(System.in));
    System.out.print(str);
    System.out.flush();
    return buff.readLine();
  }

  public static void print(String str) {
    System.out.println(str);
  }

  public static String getApiUrl() { return API_URL; }

  public static String getAdminToken() {
    return ADMIN_TOKEN;
  }

  public static String getTotpSecret() {
    return TOTP_SECRET;
  }

  public static String getApiToken() {
    return API_TOKEN;
  }

  public static String getUserEmail() {
    return USER_EMAIL;
  }

  public static String getRandomUserEmail() {
    String[] email = USER_EMAIL.split("@");
    Random rand = new Random();
    String first = email[0] + "+roundjavatest" + rand.nextInt(100000);
    return first + "@" + email[1];
  }


  public static JsonObject loadJsonResource(String path) throws
      URISyntaxException, FileNotFoundException, IOException {
    URL url = Utils.class.getResource("/wallet_ciphertexts.json");
    Assert.assertNotNull(url);

    String payload = null;
    BufferedReader br = new BufferedReader(new FileReader(new File(url.toURI())));
    try {
      StringBuilder sb = new StringBuilder();
      String line = br.readLine();

      while (line != null) {
        sb.append(line);
        sb.append("\n");
        line = br.readLine();
      }
      payload = sb.toString();
    } finally {
      br.close();
    }

    return new JsonParser().parse(payload).getAsJsonObject();
  }
}



<commit_msg>utils updated for testing on my machine<commit_after>package co.gem.round;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.junit.Assert;

import java.io.*;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Random;

/**
 * Created by jled on 12/31/14.
 */
public class Utils {


  // Set these for testing.

  private static final String API_URL = "http://localhost:8999";

  private static final String API_TOKEN = "<KEY>";
  private static final String ADMIN_TOKEN = "<KEY>";
  private static final String TOTP_SECRET = "<KEY>";


  private static final String USER_EMAIL = "<EMAIL>";


  public static String getUserInput(String str) throws IOException {
    BufferedReader buff = new BufferedReader(
            new InputStreamReader(System.in));
    System.out.print(str);
    System.out.flush();
    return buff.readLine();
  }

  public static void print(String str) {
    System.out.println(str);
  }

  public static String getApiUrl() { return API_URL; }

  public static String getAdminToken() {
    return ADMIN_TOKEN;
  }

  public static String getTotpSecret() {
    return TOTP_SECRET;
  }

  public static String getApiToken() {
    return API_TOKEN;
  }

  public static String getUserEmail() {
    return USER_EMAIL;
  }

  public static String getRandomUserEmail() {
    String[] email = USER_EMAIL.split("@");
    Random rand = new Random();
    String first = email[0] + "+roundjavatest" + rand.nextInt(100000);
    return first + "@" + email[1];
  }


  public static JsonObject loadJsonResource(String path) throws
      URISyntaxException, FileNotFoundException, IOException {
    URL url = Utils.class.getResource("/wallet_ciphertexts.json");
    Assert.assertNotNull(url);

    String payload = null;
    BufferedReader br = new BufferedReader(new FileReader(new File(url.toURI())));
    try {
      StringBuilder sb = new StringBuilder();
      String line = br.readLine();

      while (line != null) {
        sb.append(line);
        sb.append("\n");
        line = br.readLine();
      }
      payload = sb.toString();
    } finally {
      br.close();
    }

    return new JsonParser().parse(payload).getAsJsonObject();
  }
}




{'fraction_non_alphanumeric': 0.11740707162284678, 'fraction_numerical': 0.008159564823209429, 'mean_word_length': 3.2555448408871746, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6329235', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1329, 'n_words': 354}