<commit_before>"""Crawler which fetches comic strips from the web"""

import datetime as dt
import logging
import optparse

from comics.crawler.exceptions import ComicsError, StripAlreadyExists

logger = logging.getLogger('comics.crawler')

class SuperCrawler(object):
    CRAWLER_PACKAGE = 'comics.crawler.crawlers'

    def __init__(self, config=None, optparse_options=None):
        if config is None and optparse_options is not None:
            self.config = SuperCrawlerConfig(optparse_options)
        else:
            assert isinstance(config, SuperCrawlerConfig)
            self.config = config

    def start(self):
        for comic in self.config.comics:
            self._try_crawl_one_comic(comic)

    def stop(self):<commit_msg>Set default socket timeout to 10s to avoid infinite connections to comics.com<commit_after>"""Crawler which fetches comic strips from the web"""

import datetime as dt
import logging
import optparse
import socket

from comics.crawler.exceptions import ComicsError, StripAlreadyExists

logger = logging.getLogger('comics.crawler')
socket.setdefaulttimeout(10)

class SuperCrawler(object):
    CRAWLER_PACKAGE = 'comics.crawler.crawlers'

    def __init__(self, config=None, optparse_options=None):
        if config is None and optparse_options is not None:
            self.config = SuperCrawlerConfig(optparse_options)
        else:
            assert isinstance(config, SuperCrawlerConfig)
            self.config = config

    def start(self):
        for comic in self.config.comics:
            self._try_crawl_one_comic(comic)

    def stop(self):
{'fraction_non_alphanumeric': 0.07379612257661038, 'fraction_numerical': 0.0025015634771732333, 'mean_word_length': 3.5845272206303727, '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': '7033548', 'n_tokens_mistral': 485, 'n_tokens_neox': 460, 'n_words': 127}