<commit_before>from cantools.util import log
from cantools.db import get_model, get_schema, put_multi

def index(kind): # be careful with this!
	kinds = kind == "*" and get_schema().keys() or [kind]
	i = 0
	puts = []
	for kind in kinds:
		mod = get_model(kind)
		items = mod.query().fetch() # gae doesn't support all()...
		log("assigning sequential index properties to %s %s records"%(len(items), kind), important=True)
		for n in range(len(items)):
			item = items[n]
			i += 1
			item.index = i
			if n and not n % 100:
				log("processed %s %s entities"%(n, kind), 1)
		log("processed %s %s entities"%(len(items), kind))
		items and log(items[0])
		puts += items
	log("saving %s records"%(len(puts),), important=True)
	put_multi(puts)<commit_msg>db admin: removed log spam from index()<commit_after>from cantools.util import log
from cantools.db import get_model, get_schema, put_multi

def index(kind): # be careful with this!
	kinds = kind == "*" and get_schema().keys() or [kind]
	i = 0
	puts = []
	for kind in kinds:
		mod = get_model(kind)
		items = mod.query().fetch() # gae doesn't support all()...
		log("assigning sequential index properties to %s %s records"%(len(items), kind), important=True)
		for n in range(len(items)):
			item = items[n]
			i += 1
			item.index = i
			if n and not n % 100:
				log("processed %s %s entities"%(n, kind), 1)
		log("processed %s %s entities"%(len(items), kind))
		puts += items
	log("saving %s records"%(len(puts),), important=True)
	put_multi(puts)
{'fraction_non_alphanumeric': 0.158, 'fraction_numerical': 0.008666666666666666, 'mean_word_length': 4.175862068965517, 'pattern_counts': {'":': 0, '<': 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': '616946', 'n_tokens_mistral': 581, 'n_tokens_neox': 521, 'n_words': 170}