class_docstr: Tries to reconstruct the parallelism from a .ninja_log
docstr: Places target in an available thread, or adds a new thread.
docstr_tok: ["Places","target","in","an","available","thread",",","or","adds","a","new","thread","."]
code: def alloc(self, target):
      """Places target in an available thread, or adds a new thread."""
      for worker in range(len(self.workers)):
          if self.workers[worker] >= target.end:
              self.workers[worker] = target.start
              return worker
      self.workers.append(target.start)
      return len(self.workers) - 1
  
file_path: scipy/tools/ninjatracing.py
imports: import json
  import os
  import argparse
  import re
  import sys
label_desc: Use image node_id 2 for calling the Threads obj's underlying member method code with example usage: obj.alloc(target) and returns: unknown, worker