<commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

import os
from ConfigParser import ConfigParser

import win32serviceutil
import win32service

import wrun

CWD = os.path.dirname(os.path.realpath(__file__))
config = ConfigParser()
config.read(os.path.join(CWD, "test.ini"))
SERVICE_NAME = config.get('DEFAULT', 'SERVICE_NAME')
EXECUTABLE_PATH = config.get('DEFAULT', 'EXECUTABLE_PATH')
PORT = config.get('DEFAULT', 'PORT')


class DSLCMPlugInsSvc(win32serviceutil.ServiceFramework):
    _svc_name_ = SERVICE_NAME
    _svc_display_name_ = SERVICE_NAME

    def SvcDoRun(self):
        self.ReportServiceStatus(win32service.SERVICE_START_PENDING)
        self.service = wrun.Server(EXECUTABLE_PATH, PORT)
        self.ReportServiceStatus(win32service.SERVICE_RUNNING)
        self.service.start()

    def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        self.service.stop()
        self.ReportServiceStatus(win32service.SERVICE_STOPPED)


if __name__ == '__main__':
    win32serviceutil.HandleCommandLine(DSLCMPlugInsSvc)<commit_msg>rename service<commit_after>from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals

import os
from ConfigParser import ConfigParser

import win32serviceutil
import win32service

import wrun

CWD = os.path.dirname(os.path.realpath(__file__))
config = ConfigParser()
config.read(os.path.join(CWD, "test.ini"))
SERVICE_NAME = config.get('DEFAULT', 'SERVICE_NAME')
EXECUTABLE_PATH = config.get('DEFAULT', 'EXECUTABLE_PATH')
PORT = config.get('DEFAULT', 'PORT')


class WRUNService(win32serviceutil.ServiceFramework):
    _svc_name_ = SERVICE_NAME
    _svc_display_name_ = SERVICE_NAME

    def SvcDoRun(self):
        self.ReportServiceStatus(win32service.SERVICE_START_PENDING)
        self.service = wrun.Server(EXECUTABLE_PATH, PORT)
        self.ReportServiceStatus(win32service.SERVICE_RUNNING)
        self.service.start()

    def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        self.service.stop()
        self.ReportServiceStatus(win32service.SERVICE_STOPPED)


if __name__ == '__main__':
    win32serviceutil.HandleCommandLine(WRUNService)
{'fraction_non_alphanumeric': 0.08929345470307759, 'fraction_numerical': 0.013870827915041179, 'mean_word_length': 5.271739130434782, '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': '2076679', 'n_tokens_mistral': 748, 'n_tokens_neox': 732, 'n_words': 124}