<commit_before>(function () {
'use strict';

function saveTask(resources, metadata) {
   var task = ModelsManager.createRecord('tm_tasks');
   task.sAuthor = metadata.authors ? metadata.authors.join(',') : '';
   task.nbHintsTotal = resources.hints ? resources.hints.length : 0;
   task.sTextId = metadata.id;<commit_msg>set task.sScriptAnimation if possible<commit_after>(function () {
'use strict';

function getAnimationRes(taskRes) {
   for (var i = 0; i < taskRes.length; i++) {
      var resource = taskRes[i];
      if (resource.type == 'javascript' && resource.id == 'animation') {
         return resource;
      }
   }
   return null;
}

function saveTask(resources, metadata) {
   var task = ModelsManager.createRecord('tm_tasks');
   var animationRes = getAnimationRes(resources.task);
   if (animationRes && animationRes.content) {
      task.sScriptAnimation = animationRes.content;
   }
   task.sAuthor = metadata.authors ? metadata.authors.join(',') : '';
   task.nbHintsTotal = resources.hints ? resources.hints.length : 0;
   task.sTextId = metadata.id;
{'fraction_non_alphanumeric': 0.1400560224089636, 'fraction_numerical': 0.0028011204481792717, 'mean_word_length': 3.962962962962963, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '2344850', 'n_tokens_mistral': 334, 'n_tokens_neox': 323, 'n_words': 67}