<commit_before>import csv
import sys

from datetime import datetime
from StringIO import StringIO
from pylons.controllers.util import Response

from openspending import model
from openspending.mongo import DBRef, ObjectId

def write_csv(entries, response):
    response.content_type = 'text/csv'
    response.headers['Transfer-Encoding'] = 'chunked'
    return generate_csv(entries)

def generate_csv(entries):
    generate_headers = True
    for entry in entries:<commit_msg>remove chunked encoding after being explained what that means by @nickstenning, see: https://gist.github.com/1257451<commit_after>import csv
import sys

from datetime import datetime
from StringIO import StringIO
from pylons.controllers.util import Response

from openspending import model
from openspending.mongo import DBRef, ObjectId

def write_csv(entries, response):
    response.content_type = 'text/csv'
    #response.headers['Transfer-Encoding'] = 'chunked'
    return generate_csv(entries)

def generate_csv(entries):
    generate_headers = True
    for entry in entries:
{'fraction_non_alphanumeric': 0.07007575757575757, 'fraction_numerical': 0.006628787878787879, 'mean_word_length': 5.291666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '750470', 'n_tokens_mistral': 295, 'n_tokens_neox': 286, 'n_words': 95}