<commit_before>from lab.nodes.lab_server import LabServer


class VirtualServer(LabServer):
    def __init__(self, **kwargs):
        super(VirtualServer, self).__init__(**kwargs)
        self._hard_server = self.lab().get_node_by_id(kwargs['virtual-on'])
        self._hard_server.add_virtual_server(self)

    def cmd(self, cmd):
        raise NotImplementedError()

    def get_hardware_server(self):
        return self._hard_server<commit_msg>vritual: add vnc display support<commit_after>from lab.nodes.lab_server import LabServer


class VirtualServer(LabServer):
    def __init__(self, **kwargs):
        super(VirtualServer, self).__init__(**kwargs)
        self._hard_server = self.lab().get_node_by_id(kwargs['virtual-on'])
        self._hard_server.add_virtual_server(self)

    def cmd(self, cmd):
        raise NotImplementedError()

    def get_hardware_server(self):
        return self._hard_server

    def vnc_display(self):
        import os

        name = self.get_node_id().replace('xrvr', 'xrnc')
        ans = self._hard_server.exe('virsh vncdisplay {}'.format(name))
        port = 5900 + int(ans.strip(':'))
        vts_host_ip = self._hard_server.get_ip_mx()
        mgmt_ip = self.lab().get_director().get_ip_api()
        os.system('ssh -2NfL {port}:{vts}:{port} root@{mgmt}'.format(port=port, vts=vts_host_ip, mgmt=mgmt_ip))
{'fraction_non_alphanumeric': 0.12988929889298892, 'fraction_numerical': 0.0036900369003690036, 'mean_word_length': 3.6920415224913494, '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': '2731968', 'n_tokens_mistral': 460, 'n_tokens_neox': 445, 'n_words': 73}