<commit_before>from twisted.internet import reactor
from twisted.names import dns, client, server

class DNSServerFactory(server.DNSServerFactory):
	def handleQuery(self, message, protocol, address):
		query = message.queries[0]

		print query.name.name
		x = dns.RRHeader(name=query.name.name, type=dns.NS, cls=dns.IN, ttl=0, auth=False,
						 payload=dns.Record_NS(name='nbapuns.com', ttl=0))

		ans = [x]
		auth = []
		add = []
		args = (self, (ans, auth, add), protocol, message, address)

		return server.DNSServerFactory.gotResolverResponse(*args)

factory = DNSServerFactory()
protocol = dns.DNSDatagramProtocol(factory)

reactor.listenUDP(53, protocol)
reactor.listenTCP(53, factory)
reactor.run()<commit_msg>return ns and a record<commit_after>from twisted.internet import reactor
from twisted.names import dns, client, server

class DNSServerFactory(server.DNSServerFactory):
    def handleQuery(self, message, protocol, address):
        query = message.queries[0]

        print query.name.name
        NS = dns.RRHeader(name=query.name.name, type=dns.NS, cls=dns.IN, ttl=0, auth=True,
                         payload=dns.Record_NS(name='ns1.nbapuns.com', ttl=0))
        A = dns.RRHeader(name='ns1.nbapuns.com', type=dns.A, cls=dns.IN, ttl=0,
                        payload=dns.Record_A(address='127.0.0.1', ttl=None))

        ans = []
        auth = [NS]
        add = [A]
        args = (self, (ans, auth, add), protocol, message, address)

        return server.DNSServerFactory.gotResolverResponse(*args)

factory = DNSServerFactory()
protocol = dns.DNSDatagramProtocol(factory)

reactor.listenUDP(53, protocol)
reactor.listenTCP(53, factory)
reactor.run()
{'fraction_non_alphanumeric': 0.13059033989266547, 'fraction_numerical': 0.013714967203339297, 'mean_word_length': 3.877906976744186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '3547028', 'n_tokens_mistral': 609, 'n_tokens_neox': 569, 'n_words': 115}