<commit_before># -*- coding: utf-8 -*-

from berserker_resolver.base import set_kwargs, xrange_compat
from dns.resolver import Resolver

class BaseQuery(object):
    lifetime = 2
    resolver = Resolver()

    def __init__(self, **kwargs):
        set_kwargs(self, kwargs, ['lifetime'])
        self.resolver.lifetime = self.lifetime
        super(BaseQuery, self).__init__(**kwargs)

    def base_query(self, domain):
        q = []
        try:
            q = self.resolver.query(domain, 'A')
            q = [i.to_text() for i in q]
        except:
            pass
        return q

class Query(BaseQuery):
    tries = 2
    nameservers = ['8.8.8.8', '127.0.0.1',]

    def __init__(self, **kwargs):
        set_kwargs(kwargs, ['tries', 'nameservers'])
        super(Query, self).__init__(**kwargs)
<commit_msg>changed default dns from 127.0.0.1 to 192.168.127.12<commit_after># -*- coding: utf-8 -*-

from berserker_resolver.base import set_kwargs, xrange_compat
from dns.resolver import Resolver

class BaseQuery(object):
    lifetime = 2
    resolver = Resolver()

    def __init__(self, **kwargs):
        set_kwargs(self, kwargs, ['lifetime'])
        self.resolver.lifetime = self.lifetime
        super(BaseQuery, self).__init__(**kwargs)

    def base_query(self, domain):
        q = []
        try:
            q = self.resolver.query(domain, 'A')
            q = [i.to_text() for i in q]
        except:
            pass
        return q

class Query(BaseQuery):
    tries = 2
    nameservers = ['8.8.8.8', '192.168.127.12',]

    def __init__(self, **kwargs):
        set_kwargs(kwargs, ['tries', 'nameservers'])
        super(Query, self).__init__(**kwargs)

{'fraction_non_alphanumeric': 0.13961813842482101, 'fraction_numerical': 0.028639618138424822, 'mean_word_length': 2.472049689440994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '5740231', 'n_tokens_mistral': 582, 'n_tokens_neox': 557, 'n_words': 128}