<commit_before>package ducttape.workflow

import collection._
import ducttape.exec.UnpackedDagVisitor
import ducttape.versioner.WorkflowVersionInfo
import ducttape.workflow.Types.UnpackedWorkVert
import ducttape.hyperdag.walker.Traversal
import ducttape.hyperdag.walker.Arbitrary
import grizzled.slf4j.Logging

object Visitors extends Logging {
  def visitAll[A <: UnpackedDagVisitor](
      workflow: HyperWorkflow,
      visitor: A,
      planPolicy: PlanPolicy,
      workflowVersion: WorkflowVersionInfo,
      numCores: Int = 1,
      traversal: Traversal = Arbitrary): A = {
    
    debug("Visiting workflow in a(n) " + traversal + " traversal")
    workflow.unpackedWalker(planPolicy,traversal=traversal).foreach(numCores, { v: UnpackedWorkVert =>
      val taskT: TaskTemplate = v.packed.value.get
      val task: VersionedTask = taskT.toRealTask(v).toVersionedTask(workflowVersion)
      debug(s"Visiting $task")
      visitor.visit(task)
    })
    visitor
  }
}<commit_msg>I <3 string interpolation<commit_after>package ducttape.workflow

import collection._
import ducttape.exec.UnpackedDagVisitor
import ducttape.versioner.WorkflowVersionInfo
import ducttape.workflow.Types.UnpackedWorkVert
import ducttape.hyperdag.walker.Traversal
import ducttape.hyperdag.walker.Arbitrary
import grizzled.slf4j.Logging

object Visitors extends Logging {
  def visitAll[A <: UnpackedDagVisitor](
      workflow: HyperWorkflow,
      visitor: A,
      planPolicy: PlanPolicy,
      workflowVersion: WorkflowVersionInfo,
      numCores: Int = 1,
      traversal: Traversal = Arbitrary): A = {
    
    debug(s"Visiting workflow using traversal: ${traversal}")
    workflow.unpackedWalker(planPolicy, traversal=traversal).foreach(numCores, { v: UnpackedWorkVert =>
      val taskT: TaskTemplate = v.packed.value.get
      val task: VersionedTask = taskT.toRealTask(v).toVersionedTask(workflowVersion)
      debug(s"Visiting ${task}")
      visitor.visit(task)
    })
    visitor
  }
}
{'fraction_non_alphanumeric': 0.09141414141414142, 'fraction_numerical': 0.0025252525252525255, 'mean_word_length': 4.2967914438502675, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '5443533', 'n_tokens_mistral': 658, 'n_tokens_neox': 629, 'n_words': 121}