<commit_before>import os, re
from process import RemoteProcess
from server import SizelessConnectableServer

class RemoteLinuxProcess(RemoteProcess):
    def __init__(self, server, pid, logfile):
        super(RemoteLinuxProcess, self).__init__(server, pid, logfile)

    def is_running(self):
        "Returns bool."
        lines = self.server.run_command("ps -l %d; echo $?" % (self.pid))[0].split('\n')
        if lines[-1] == '':
            lines = lines[:-1]
        return lines[-1] == '0'

    def kill(self):
        """
        Kill process if running
        """
        self.server.run_command("kill %d" % (self.pid))

    def halt(self):
        """Temporarily stop a process."""
        self.server.run_command("kill -STOP %d" % (self.pid))

    def resume(self):
        """Resume a halted process."""
        self.server.run_command("kill -CONT %d" % (self.pid))

    def clean(self):<commit_msg>Added process __str__ method<commit_after>import os, re
from process import RemoteProcess
from server import SizelessConnectableServer


class RemoteLinuxProcess(RemoteProcess):
    def __init__(self, server, pid, logfile):
        super(RemoteLinuxProcess, self).__init__(server, pid, logfile)

    def __str__(self):
        return self.server.utup[0] + ',' + self.server.utup[1] + ',' + str(self.pid) + ',' + self.logfile
        # JK_Note: Use for db representation in django server.

    def is_running(self):
        "Returns bool."
        lines = self.server.run_command("ps -l %d; echo $?" % (self.pid))[0].split('\n')
        if lines[-1] == '':
            lines = lines[:-1]
        return lines[-1] == '0'

    def kill(self):
        """
        Kill process if running
        """
        self.server.run_command("kill %d" % (self.pid))

    def halt(self):
        """Temporarily stop a process."""
        self.server.run_command("kill -STOP %d" % (self.pid))

    def resume(self):
        """Resume a halted process."""
        self.server.run_command("kill -CONT %d" % (self.pid))

    def clean(self):
{'fraction_non_alphanumeric': 0.15184275184275184, 'fraction_numerical': 0.005896805896805897, 'mean_word_length': 2.6357142857142857, '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': '3676856', 'n_tokens_mistral': 641, 'n_tokens_neox': 624, 'n_words': 157}