<commit_before>#!/usr/bin/env python

import ssl
import socket
from datetime import datetime

from heppy import Net

class REPP:
    def __init__(self, config):
        self.config = config
        self.connect()

    def connect(self):
        self.epp = EPP(self.config)
        self.greeting = self.epp.greeting

    def get_greeting(self):
        return self.greeting

    def request(self, xml):
        res = self.epp.request(xml)
        if not res:
            self.connect()
            res = self.epp.request(xml)
        return res

class EPP:
    def __init__(self, config):
        self.config = config
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.socket.connect((self.config['host'], self.config['port']))
        self.ssl = ssl.wrap_socket(self.socket,
            keyfile  = self.config['keyfile'],
            certfile = self.config['certfile'],
            ca_certs = self.config['ca_certs'])
        self.greeting = self.read()
        self.config['start_time'] = datetime.now().isoformat(' ')

    def get_greeting(self):
        return self.greeting

    def request(self, xml):
        self.write(xml)
        return self.read()

    def write(self, xml):
        Net.write(self.ssl, xml)
<commit_msg>+ find ssl files<commit_after>#!/usr/bin/env python

import ssl
import socket
from datetime import datetime

from heppy import Net

class REPP:
    def __init__(self, config):
        self.config = config
        self.connect()

    def connect(self):
        self.epp = EPP(self.config)
        self.greeting = self.epp.greeting

    def get_greeting(self):
        return self.greeting

    def request(self, xml):
        res = self.epp.request(xml)
        if not res:
            self.connect()
            res = self.epp.request(xml)
        return res

class EPP:
    def __init__(self, config):
        self.config = config
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.socket.connect((self.config['epp']['host'], self.config['epp']['port']))
        a = config.find(self.config['epp']['keyfile'])
        self.ssl = ssl.wrap_socket(self.socket,
            keyfile  = self.config.find(self.config['epp']['keyfile']),
            certfile = self.config.find(self.config['epp']['certfile']),
            ca_certs = self.config.find(self.config['epp']['ca_certs']),
        )
        self.greeting = self.read()
        self.config['start_time'] = datetime.now().isoformat(' ')

    def get_greeting(self):
        return self.greeting

    def request(self, xml):
        self.write(xml)
        return self.read()

    def write(self, xml):
        Net.write(self.ssl, xml)

{'fraction_non_alphanumeric': 0.13147113594040968, 'fraction_numerical': 0.0, 'mean_word_length': 2.3407960199004973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '4956804', 'n_tokens_mistral': 850, 'n_tokens_neox': 845, 'n_words': 173}