<commit_before>package org.holmesprocessing.totem.services.cfgangr

import dispatch.Defaults._
import dispatch.{url, _}
import org.json4s.JsonAST.{JString, JValue}
import org.holmesprocessing.totem.types.{TaskedWork, WorkFailure, WorkResult, WorkSuccess}
import collection.mutable


case class cfgangrWork(key: Long, filename: String, TimeoutMillis: Int, WorkType: String, Worker: String, Arguments: List[String]) extends TaskedWork {
  def doWork()(implicit myHttp: dispatch.Http): Future[WorkResult] = {

    val uri = cfgangrREST.constructURL(Worker, filename, Arguments)
    val requestResult = myHttp(url(uri) OK as.String)
      .either
      .map({
      case Right(content) =>
        cfgAngrSuccess(true, JString(content), Arguments)

      case Left(StatusCode(404)) =>
        cfgAngrFailure(false, JString("Not found (File already deleted?)"), Arguments)

      case Left(StatusCode(500)) =><commit_msg>fix typo from cfgangrWork to cfgAngrWork<commit_after>package org.holmesprocessing.totem.services.cfgangr

import dispatch.Defaults._
import dispatch.{url, _}
import org.json4s.JsonAST.{JString, JValue}
import org.holmesprocessing.totem.types.{TaskedWork, WorkFailure, WorkResult, WorkSuccess}
import collection.mutable


case class cfgAngrWork(key: Long, filename: String, TimeoutMillis: Int, WorkType: String, Worker: String, Arguments: List[String]) extends TaskedWork {
  def doWork()(implicit myHttp: dispatch.Http): Future[WorkResult] = {

    val uri = cfgangrREST.constructURL(Worker, filename, Arguments)
    val requestResult = myHttp(url(uri) OK as.String)
      .either
      .map({
      case Right(content) =>
        cfgAngrSuccess(true, JString(content), Arguments)

      case Left(StatusCode(404)) =>
        cfgAngrFailure(false, JString("Not found (File already deleted?)"), Arguments)

      case Left(StatusCode(500)) =>
{'fraction_non_alphanumeric': 0.11308562197092084, 'fraction_numerical': 0.007539041464728056, 'mean_word_length': 4.879746835443038, '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': '6205312', 'n_tokens_mistral': 579, 'n_tokens_neox': 566, 'n_words': 135}