<commit_before>package blocks

import (
	"log"
	"strconv"
	"strings"
	"github.com/bitly/go-simplejson"
	"encoding/json"
)

// getKeyValues returns values for all paths, including arrays
// {"foo":"bar"} returns [bar] for string "foo"
// {"foo":["bar","bar","bar"]} returns [bar, bar, bar] for string "foo.[]"
// {"foo":[{"type":"bar"},{"type":"baz"}]} returns [bar, baz] for string "foo.[].type"
// this function is obscene :(
func getKeyValues(d interface{}, p string) []interface{} {
	var values []interface{}
	var key string
	var rest string

	keyIdx := strings.Index(p, ".")
	
	if keyIdx != -1 {
		key = p[:keyIdx]
		rest = p[keyIdx + 1:]
	} else {
		key = p
	}

	bStart := strings.Index(key, "[")
	bEnd := strings.Index(key, "]")
	var id int64
	id = -1<commit_msg>minor<commit_after>package blocks

import (
	"log"
	"strconv"
	"strings"
	"github.com/bitly/go-simplejson"
	"encoding/json"
)

// getKeyValues returns values for all paths, including arrays
// {"foo":"bar"} returns [bar] for string "foo"
// {"foo":["bar","bar","bar"]} returns [bar, bar, bar] for string "foo.[]"
// {"foo":[{"type":"bar"},{"type":"baz"}]} returns [bar, baz] for string "foo.[].type"
// {"foo":["bar","baz"]} returns [bar] for string "foo.[0]"

// this function is obscene :(
func getKeyValues(d interface{}, p string) []interface{} {
	var values []interface{}
	var key string
	var rest string

	keyIdx := strings.Index(p, ".")
	
	if keyIdx != -1 {
		key = p[:keyIdx]
		rest = p[keyIdx + 1:]
	} else {
		key = p
	}

	bStart := strings.Index(key, "[")
	bEnd := strings.Index(key, "]")
	var id int64
	id = -1
{'fraction_non_alphanumeric': 0.213073538654934, 'fraction_numerical': 0.0069138906348208675, 'mean_word_length': 3.975, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 3, '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': '4358706', 'n_tokens_mistral': 609, 'n_tokens_neox': 574, 'n_words': 161}