<commit_before>package maker.remote

import java.io.{BufferedReader, InputStreamReader, PrintWriter}
import java.net.Socket
import maker.utils.os.Command
import maker.utils.Int

case class RemoteBuild(remoteHost : String, sshPort : Int, socketPort : Int, remoteAbsDir : String){
  def remoteCompile(){
    val copyScalaFilesCommand = Command(
      "rsync", 
      "-aive", 
      s"'ssh -p $sshPort'", 
      "--exclude=.git", 
      "--include='*/'", 
      "--exclude='target*/'", 
      "--include='*.scala'",
      "--include='*.java'",
      "--exclude='*'", 
      ".",
      s"$remoteHost:$remoteAbsDir"
    )

    val copyClassFilesCommand = Command(
      "rsync", 
      "-aive", 
      s"'ssh -p $sshPort'", 
      "--exclude=.git", 
      "--include='*/'", 
      "--exclude=src/", 
      "--exclude=tests/", 
      "--include='*.class'",
      "--exclude='*'", 
      s"$remoteHost:$remoteAbsDir",
      "."
    )

    println("Opening socket")
    val socket = new Socket("localhost", socketPort)
    println("Opened socket")
    val in = new BufferedReader(new InputStreamReader(socket.getInputStream()))
    val out = new PrintWriter(socket.getOutputStream(), true)

    val succeeded = try {
      println(s"Copying source files\n$copyScalaFilesCommand")
      if (copyScalaFilesCommand.run() != 0)
        throw new RuntimeException("Failed to copy source files")

      out.println("COMPILE")
      in.readLine() match {
        case "SUCCEEDED" =>
          println("SUCCEEDED")
        case "FAILED" =>
          throw new RuntimeException("Compilation failed")
      }
      if (copyClassFilesCommand.run() != 0)
        throw new RuntimeException("Failed to copy class files")
      true
    } catch {
      case e : Exception =>
        println(e.getMessage)
        false
    }
  }
}


<commit_msg>remote 3<commit_after>package maker.remote

import java.io.{BufferedReader, InputStreamReader, PrintWriter}
import java.net.Socket
import maker.utils.os.Command
import maker.utils.Int

case class RemoteBuild(remoteHost : String, sshPort : Int, socketPort : Int, remoteAbsDir : String){
  def remoteCompile(){
    val copyScalaFilesCommand = Command(
      "rsync", 
      "-aive", 
      s"'ssh -p $sshPort'", 
      "--exclude=.git", 
      "--include='*/'", 
      "--exclude='target*/'", 
      "--include='*.scala'",
      "--include='*.java'",
      "--exclude='*'", 
      "'.'",
      s"$remoteHost:$remoteAbsDir"
    )

    val copyClassFilesCommand = Command(
      "rsync", 
      "-aive", 
      s"'ssh -p $sshPort'", 
      "--exclude=.git", 
      "--include='*/'", 
      "--exclude=src/", 
      "--exclude=tests/", 
      "--include='*.class'",
      "--exclude='*'", 
      s"$remoteHost:$remoteAbsDir",
      "'.'"
    )

    println("Opening socket")
    val socket = new Socket("localhost", socketPort)
    println("Opened socket")
    val in = new BufferedReader(new InputStreamReader(socket.getInputStream()))
    val out = new PrintWriter(socket.getOutputStream(), true)

    val succeeded = try {
      println(s"Copying source files\n$copyScalaFilesCommand")
      if (copyScalaFilesCommand.run() != 0)
        throw new RuntimeException("Failed to copy source files")

      out.println("COMPILE")
      in.readLine() match {
        case "SUCCEEDED" =>
          println("SUCCEEDED")
        case "FAILED" =>
          throw new RuntimeException("Compilation failed")
      }
      if (copyClassFilesCommand.run() != 0)
        throw new RuntimeException("Failed to copy class files")
      true
    } catch {
      case e : Exception =>
        println(e.getMessage)
        false
    }
  }
}



{'fraction_non_alphanumeric': 0.15684123937482863, 'fraction_numerical': 0.0013709898546750755, 'mean_word_length': 2.4545454545454546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1445654', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1078, 'n_words': 237}