<commit_before># coding: utf-8

import io
import collections.abc

class EncoderError(Exception):
	pass

def encode_str(obj):
	buf = io.BytesIO()
	encode(buf, obj)
	return buf.getvalue()

def encode(io, obj):
	if isinstance(obj, list):
		encode_list(io, obj)
	elif isinstance(obj, dict):
		encode_dict(io, obj)
	elif isinstance(obj, str):
		encode_textstring(io, obj)
	elif isinstance(obj, bytes):
		encode_bytestring(io, obj)
	elif isinstance(obj, int):
		encode_integer(io, obj)
	elif isinstance(obj, tuple):
		if isinstance(obj[0], int):
			encode_tagging(io, obj)
		elif isinstance(obj[0], collections.abc.Iterator):
			iterator, type_ = obj
			encode_generator(io, iterator, type_)
	elif obj is True:
		encode_true(io)
	elif obj is False:
		encode_false(io)
	elif obj is None:
		encode_null(io)
	elif callable(obj):
		obj = obj()
		if isinstance(obj, collections.abc.Iterator):
			type_ = next(obj)
			encode_generator(io, obj, type_)
		else:
			encode(io, obj)
	else:<commit_msg>Fix encoding of boolean values<commit_after># coding: utf-8

import io
import collections.abc

class EncoderError(Exception):
	pass

def encode_str(obj):
	buf = io.BytesIO()
	encode(buf, obj)
	return buf.getvalue()

def encode(io, obj):
	if isinstance(obj, list):
		encode_list(io, obj)
	elif isinstance(obj, dict):
		encode_dict(io, obj)
	elif isinstance(obj, str):
		encode_textstring(io, obj)
	elif isinstance(obj, bytes):
		encode_bytestring(io, obj)
	elif isinstance(obj, int) and not isinstance(obj, bool):
		encode_integer(io, obj)
	elif isinstance(obj, tuple):
		if isinstance(obj[0], int):
			encode_tagging(io, obj)
		elif isinstance(obj[0], collections.abc.Iterator):
			iterator, type_ = obj
			encode_generator(io, iterator, type_)
	elif obj is True:
		encode_true(io)
	elif obj is False:
		encode_false(io)
	elif obj is None:
		encode_null(io)
	elif callable(obj):
		obj = obj()
		if isinstance(obj, collections.abc.Iterator):
			type_ = next(obj)
			encode_generator(io, obj, type_)
		else:
			encode(io, obj)
	else:
{'fraction_non_alphanumeric': 0.12258064516129032, 'fraction_numerical': 0.002977667493796526, 'mean_word_length': 4.843478260869565, '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': '1253624', 'n_tokens_mistral': 765, 'n_tokens_neox': 714, 'n_words': 195}