<commit_before># -*-coding:Utf-8 -*-

"""Contains functions to establish ssh connections"""

# Compatibility 2.7-3.4
from __future__ import absolute_import
from __future__ import unicode_literals

import os

def connect(target, filelog, login, port, sshoptions, originalcmd):
    """ Simply launch the ssh connection or execute the ssh command"""
    if not originalcmd:
        os.system("script -q --timing=" + filelog + ".timing " + filelog + \
                ' -c "ssh -t -p ' + str(port) + " " + login + '@' + target + \
                ' ' + sshoptions + '"')
    else:
        os.system("echo \"DIRECT COMMAND --- " + \
                  originalcmd + "\" >" + filelog + \
                  ' && ssh -p ' + str(port) + " " + login + '@' + target + \
                  ' ' + sshoptions + " " + originalcmd )

<commit_msg>Escaping log (rewritten in python)<commit_after># -*-coding:Utf-8 -*-

"""Contains functions to establish ssh connections"""

# Compatibility 2.7-3.4
from __future__ import absolute_import
from __future__ import unicode_literals

import os

def connect(target, filelog, login, port, sshoptions, originalcmd):
    """ Simply launch the ssh connection or execute the ssh command"""
    if not originalcmd:
        os.system("script -q --timing=" + filelog + ".timing " + filelog + \
                ' -c "ssh -t -p ' + str(port) + " " + login + '@' + target + \
                ' ' + sshoptions + '"')
    else:
        f = open(filelog, "w")
        f.write("DIRECT COMMAND --- " + originalcmd)
        f.close()
        os.system('ssh -p ' + str(port) + " " + login + '@' + target + \
                  ' ' + sshoptions + " '" + originalcmd + "'" )


{'fraction_non_alphanumeric': 0.1567342073897497, 'fraction_numerical': 0.0059594755661501785, 'mean_word_length': 2.1739130434782608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '504113', 'n_tokens_mistral': 538, 'n_tokens_neox': 499, 'n_words': 140}