<commit_before>from __future__ import division
import requests
import zipfile
import cStringIO as StringIO
import csv
import redis
from urlparse import urlparse
from publicsuffix import PublicSuffixList

from malware_crawl.defaults import redis_db

domains_key = "alexa:domains"


def chunks(l, n):
    """ Yield successive n-sized chunks from l.
    """
    for i in xrange(0, len(l), n):
        yield l[i:i + n]


def dict_chunk(mapping, chunk_size):
    items = mapping.items()<commit_msg>use chunks function from celery<commit_after>from __future__ import division
import requests
import zipfile
import cStringIO as StringIO
import csv
import redis
from urlparse import urlparse
from publicsuffix import PublicSuffixList

from celery.utils.functional import chunks

from malware_crawl.defaults import redis_db

domains_key = "alexa:domains"


def dict_chunk(mapping, chunk_size):
    items = mapping.items()
{'fraction_non_alphanumeric': 0.0625, 'fraction_numerical': 0.0010964912280701754, 'mean_word_length': 5.12751677852349, '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': '2238328', 'n_tokens_mistral': 286, 'n_tokens_neox': 264, 'n_words': 95}