Yeah, api/ai.py, worker/training.py, and worker/grading.py all use it.  I am happy to add it as a static somewhere.  @wedaly , what do you think? (Ready to merge after this is resolved)