<commit_before>package com.axelby.podax;

import android.content.Context;
import android.content.SharedPreferences;

public class Stats {
	private Stats() { }

	public static void addTime(Context context, float seconds) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		float listenTime = statsPrefs.getFloat("listenTime", 0f) + seconds;
		statsPrefs.edit().putFloat("listenTime", listenTime).commit();
	}

	public static float getTime(Context context) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		return statsPrefs.getFloat("listenTime", 0f);
	}

	public static String getTimeString(Context context) {
		float listenSeconds = Stats.getTime(context);
		final int secondsPerMinute = 60;
		final int secondsPerHour = secondsPerMinute * 60;
		final int secondsPerDay = secondsPerHour * 24;

		StringBuilder listenText = new StringBuilder();
		if (listenSeconds > secondsPerDay) {
			int days = (int) Math.floor(listenSeconds / secondsPerDay);
			listenText.append(days);
			listenText.append(" ");
			listenText.append(context.getResources().getQuantityString(R.plurals.days, days));
			listenSeconds = listenSeconds % secondsPerDay;
		}
		if (listenSeconds > secondsPerHour) {
			int hours = (int) Math.floor(listenSeconds / secondsPerHour);
			listenText.append(hours);
			listenText.append(" ");
			listenText.append(context.getResources().getQuantityString(R.plurals.hours, hours));
			listenSeconds = listenSeconds % secondsPerHour;
		}
		if (listenSeconds > secondsPerMinute) {
			int minutes = (int) Math.floor(listenSeconds / secondsPerMinute);
			listenText.append(minutes);
			listenText.append(" ");
			listenText.append(context.getResources().getQuantityString(R.plurals.minutes, minutes));
		}
		if (listenText.length() == 0)
			listenText.append(context.getString(R.string.none));
		return listenText.toString();
	}

	public static void addCompletion(Context context) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		int completions = statsPrefs.getInt("completions", 0) + 1;
		statsPrefs.edit().putInt("completions", completions).commit();
	}

	public static int getCompletions(Context context) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		return statsPrefs.getInt("completions", 0);
	}
}
<commit_msg>fixed missing space in stats<commit_after>package com.axelby.podax;

import android.content.Context;
import android.content.SharedPreferences;

public class Stats {
	private Stats() { }

	public static void addTime(Context context, float seconds) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		float listenTime = statsPrefs.getFloat("listenTime", 0f) + seconds;
		statsPrefs.edit().putFloat("listenTime", listenTime).commit();
	}

	public static float getTime(Context context) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		return statsPrefs.getFloat("listenTime", 0f);
	}

	public static String getTimeString(Context context) {
		float listenSeconds = Stats.getTime(context);
		final int secondsPerMinute = 60;
		final int secondsPerHour = secondsPerMinute * 60;
		final int secondsPerDay = secondsPerHour * 24;

		StringBuilder listenText = new StringBuilder();
		if (listenSeconds > secondsPerDay) {
			int days = (int) Math.floor(listenSeconds / secondsPerDay);
			listenText.append(days);
			listenText.append(" ");
			listenText.append(context.getResources().getQuantityString(R.plurals.days, days));
			listenSeconds = listenSeconds % secondsPerDay;
		}
		if (listenSeconds > secondsPerHour) {
			int hours = (int) Math.floor(listenSeconds / secondsPerHour);
			if (listenText.length() > 0)
				listenText.append(" ");
			listenText.append(hours);
			listenText.append(" ");
			listenText.append(context.getResources().getQuantityString(R.plurals.hours, hours));
			listenSeconds = listenSeconds % secondsPerHour;
		}
		if (listenSeconds > secondsPerMinute) {
			int minutes = (int) Math.floor(listenSeconds / secondsPerMinute);
			if (listenText.length() > 0)
				listenText.append(" ");
			listenText.append(minutes);
			listenText.append(" ");
			listenText.append(context.getResources().getQuantityString(R.plurals.minutes, minutes));
		}
		if (listenText.length() == 0)
			listenText.append(context.getString(R.string.none));
		return listenText.toString();
	}

	public static void addCompletion(Context context) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		int completions = statsPrefs.getInt("completions", 0) + 1;
		statsPrefs.edit().putInt("completions", completions).commit();
	}

	public static int getCompletions(Context context) {
		SharedPreferences statsPrefs = context.getSharedPreferences("stats", Context.MODE_PRIVATE);
		return statsPrefs.getInt("completions", 0);
	}
}

{'fraction_non_alphanumeric': 0.11918663176967989, 'fraction_numerical': 0.0052345480169116165, 'mean_word_length': 5.528252299605782, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3508127', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1440, 'n_words': 298}