<commit_before>'''
Online link spider test
'''
import unittest
from unittest import TestCase
import time

import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

import scrapy
import redis
import json
import threading, time
from crawling.spiders.link_spider import LinkSpider
from scrapy.utils.project import get_project_settings
from twisted.internet import reactor
from scrapy.crawler import CrawlerRunner
from kafka import KafkaClient, SimpleConsumer


class CustomSpider(LinkSpider):
    '''
    Overridden link spider for testing
    '''
    name = "test-spider"
<commit_msg>Import redis ConnectionError<commit_after>'''
Online link spider test
'''
import unittest
from unittest import TestCase
import time

import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

import scrapy
import redis
from redis.exceptions import ConnectionError
import json
import threading, time
from crawling.spiders.link_spider import LinkSpider
from scrapy.utils.project import get_project_settings
from twisted.internet import reactor
from scrapy.crawler import CrawlerRunner
from kafka import KafkaClient, SimpleConsumer


class CustomSpider(LinkSpider):
    '''
    Overridden link spider for testing
    '''
    name = "test-spider"

{'fraction_non_alphanumeric': 0.06651376146788991, 'fraction_numerical': 0.0, 'mean_word_length': 5.611111111111111, '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': '6019770', 'n_tokens_mistral': 383, 'n_tokens_neox': 370, 'n_words': 124}