<commit_before># from __future__ import absolute_import, unicode_literals
from .celery import app
from celery.utils.log import get_task_logger
from crawler import crawler
from .logger import log_url
from .logger import log_url_validator

logger = get_task_logger(__name__)


@app.task(rate_limit="6/s", queue='crawler', ignore_result=True, task_compression='zlib')
def crawl_url_task(url, value):
    # crawl_url(url, value)
    crawler.crawl_url(url, value)
    # response, status, redirected = crawler.crawl_url(url, value)
    # if response is not None:
    #     logger.info(str(url) + " | " + str(response.status_code) + " | " + str(response.reason) +
    #                 " | " + str(response.headers['Content-Type']) + " | " + str(status) + " | Redirected: " + str(redirected))
    # else:
    #     logger.info(url + " | " + str(status) + " | Redirected: " + str(redirected))


@app.task(queue='logger', ignore_result=True, task_compression='zlib')<commit_msg>Missing import<commit_after># from __future__ import absolute_import, unicode_literals
from .celery import app
from celery.utils.log import get_task_logger
from crawler import crawler
from .logger import log_url
from .logger import log_url_validator
from .logger import log_url_reason

logger = get_task_logger(__name__)


@app.task(rate_limit="6/s", queue='crawler', ignore_result=True, task_compression='zlib')
def crawl_url_task(url, value):
    # crawl_url(url, value)
    crawler.crawl_url(url, value)
    # response, status, redirected = crawler.crawl_url(url, value)
    # if response is not None:
    #     logger.info(str(url) + " | " + str(response.status_code) + " | " + str(response.reason) +
    #                 " | " + str(response.headers['Content-Type']) + " | " + str(status) + " | Redirected: " + str(redirected))
    # else:
    #     logger.info(url + " | " + str(status) + " | Redirected: " + str(redirected))


@app.task(queue='logger', ignore_result=True, task_compression='zlib')
{'fraction_non_alphanumeric': 0.1403242147922999, 'fraction_numerical': 0.0010131712259371835, 'mean_word_length': 4.266666666666667, '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': '4463987', 'n_tokens_mistral': 672, 'n_tokens_neox': 655, 'n_words': 132}