<commit_before># Used for integration tests.

import os
import socket
import subprocess
import sys
import time

print os.getcwd()

sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)  # flush print output immediately

def PortHasListener( port ):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    result = sock.connect_ex( ('127.0.0.1',port) )
    sock.close()
    return result == 0

if PortHasListener(10000):
    print 'Something is listening on port 10000 - will assume Minecraft is running.'
    exit(0)
    
print 'Nothing is listening on port 10000 - will attempt to launch Minecraft from a new terminal.'
if os.name == 'nt':
    os.startfile("launchClient.bat")
elif sys.platform == 'darwin':
    subprocess.Popen(['open', '-a', 'Terminal.app', 'launchClient.sh'])
else:
    subprocess.Popen( "x-term-emulator -e ./launchClient.sh", close_fds=True, shell=True )

print 'Giving Minecraft some time to launch... '
for i in xrange( 100 ):
    print '.',
    time.sleep( 3 )
    if PortHasListener(10000):
        print 'ok'
        exit(0)
print 'Minecraft not yet launched. Giving up.'
exit(1)<commit_msg>Fix: typo trampled x-terminal-emulator call.<commit_after># Used for integration tests.

import os
import socket
import subprocess
import sys
import time

print os.getcwd()

sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)  # flush print output immediately

def PortHasListener( port ):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    result = sock.connect_ex( ('127.0.0.1',port) )
    sock.close()
    return result == 0

if PortHasListener(10000):
    print 'Something is listening on port 10000 - will assume Minecraft is running.'
    exit(0)
    
print 'Nothing is listening on port 10000 - will attempt to launch Minecraft from a new terminal.'
if os.name == 'nt':
    os.startfile("launchClient.bat")
elif sys.platform == 'darwin':
    subprocess.Popen(['open', '-a', 'Terminal.app', 'launchClient.sh'])
else:
    subprocess.Popen( "x-terminal-emulator -e ./launchClient.sh", close_fds=True, shell=True )

print 'Giving Minecraft some time to launch... '
for i in xrange( 100 ):
    print '.',
    time.sleep( 3 )
    if PortHasListener(10000):
        print 'ok'
        exit(0)
print 'Minecraft not yet launched. Giving up.'
exit(1)
{'fraction_non_alphanumeric': 0.12680367293397463, 'fraction_numerical': 0.03060778312199388, 'mean_word_length': 3.576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2000725', 'n_tokens_mistral': 791, 'n_tokens_neox': 727, 'n_words': 233}