<commit_before>package com.github.davidmoten.logan;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Scanner;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;

public class DataCore {

	

	public static Buckets execute(Data data, BucketQuery query) {
		// get the time range of entries
		Iterable<LogEntry> entries = data.find(query.getStartTime(),
				query.getFinishTime());

		// filter by field, source, text
		Iterable<LogEntry> filtered = filter(entries, query);

		// get numeric values or count
		return getBuckets(filtered, query);
	}

	private static Iterable<LogEntry> filter(Iterable<LogEntry> entries,
			BucketQuery query) {

		Iterable<LogEntry> filtered = entries;<commit_msg>make DataCore a utility class<commit_after>package com.github.davidmoten.logan;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Scanner;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;

public final class DataCore {

    private DataCore() {
        // prevent instantiation
    }
    
	public static Buckets execute(Data data, BucketQuery query) {
		// get the time range of entries
		Iterable<LogEntry> entries = data.find(query.getStartTime(),
				query.getFinishTime());

		// filter by field, source, text
		Iterable<LogEntry> filtered = filter(entries, query);

		// get numeric values or count
		return getBuckets(filtered, query);
	}

	private static Iterable<LogEntry> filter(Iterable<LogEntry> entries,
			BucketQuery query) {

		Iterable<LogEntry> filtered = entries;
{'fraction_non_alphanumeric': 0.10418521816562779, 'fraction_numerical': 0.0, 'mean_word_length': 4.866840731070496, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2010401', 'n_tokens_mistral': 714, 'n_tokens_neox': 668, 'n_words': 162}