<commit_before>import optparse
import os
if os.name == 'nt':
  import win32api
  import string
import subprocess
import sys

DEFAULT_SLAVENAME = 'production-slave'
SVN_URL = 'https://skia.googlecode.com/svn/buildbot'
DRIVE_MAPPING=True

if os.name == 'nt':
  def GetFirstFreeDriveLetter():
    all_possible = [c for c in string.uppercase]
    in_use = win32api.GetLogicalDriveStrings()
    free = list(set(all_possible) - set(in_use))
    return free[0]

def StartSlave(slavename):
  print 'Starting slave: %s' % slavename
  slave_dir = os.path.join(os.path.realpath(os.curdir),
                           slavename)
  if not os.path.isdir(slave_dir):
    print 'Creating directory: %s' % slave_dir
    os.makedirs(slave_dir)
    os.chdir(slave_dir)
    if os.name == 'nt' and DRIVE_MAPPING:
      drive_letter = GetFirstFreeDriveLetter()
      print 'Mapping %c' % drive_letter
      cmd = 'net use %c: \\\\localhost\%s' % (drive_letter,
                                              slave_dir.replace(':', '$'))
      print 'Running cmd: %s' % cmd
      proc = subprocess.Popen(cmd)
      if proc.wait() != 0:
        raise Exception('Could not map %c' % drive_letter)
      cmd = '%c:' % drive_letter
      os.chdir(os.path.join('%c:' % drive_letter))
      print os.path.realpath(os.curdir)
  if os.name == 'nt':
    gclient = 'gclient.bat'
  else:
    gclient = 'gclient'
  proc = subprocess.Popen([gclient, 'config', SVN_URL])
  if proc.wait() != 0:
    raise Exception('Could not successfully configure gclient.')<commit_msg>Update launch_slaves.py (again)<commit_after>import optparse
import os
if os.name == 'nt':
  import win32api
  import string
import subprocess
import sys

DEFAULT_SLAVENAME = 'production-slave'
SVN_URL = 'https://skia.googlecode.com/svn/buildbot'
DRIVE_MAPPING=True

if os.name == 'nt':
  def GetFirstFreeDriveLetter():
    all_possible = [c for c in string.uppercase]
    in_use = win32api.GetLogicalDriveStrings()
    free = list(set(all_possible) - set(in_use))
    return free[0]

def StartSlave(slavename):
  print 'Starting slave: %s' % slavename
  slave_dir = os.path.join(os.path.realpath(os.curdir),
                           slavename)
  if not os.path.isdir(slave_dir):
    print 'Creating directory: %s' % slave_dir
    os.makedirs(slave_dir)
    os.chdir(slave_dir)
  if os.name == 'nt' and DRIVE_MAPPING:
    drive_letter = GetFirstFreeDriveLetter()
    print 'Mapping %c' % drive_letter
    cmd = 'net use %c: \\\\localhost\%s' % (drive_letter,
                                            slave_dir.replace(':', '$'))
    print 'Running cmd: %s' % cmd
    proc = subprocess.Popen(cmd)
    if proc.wait() != 0:
      raise Exception('Could not map %c' % drive_letter)
    cmd = '%c:' % drive_letter
    os.chdir(os.path.join('%c:' % drive_letter))
    print os.path.realpath(os.curdir)
  if os.name == 'nt':
    gclient = 'gclient.bat'
  else:
    gclient = 'gclient'
  proc = subprocess.Popen([gclient, 'config', SVN_URL])
  if proc.wait() != 0:
    raise Exception('Could not successfully configure gclient.')
{'fraction_non_alphanumeric': 0.13374754741661216, 'fraction_numerical': 0.004578155657292348, 'mean_word_length': 3.0144356955380576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3067233', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1045, 'n_words': 241}