<commit_before>Meteor.methods({
  // Accept node inserts and updates from Drupal.
  DrupalSaveNode: function (data) {
    console.log(data);
    // Handle Nodes
    if(data.content.ddp_type == 'node'){
      var actualColl = DrupalDdp.collections[data.content.type];
      if (!actualColl) {
        throw new Meteor.Error("You haven't registered this type of collection yet.");
      }
      if (data.content.is_new) {
        // Add new posts.
        actualColl.insert(data);
      }
      else if(data.content.delete_content){
        // Delete existing posts.
        actualColl.remove({"content.nid": data.content.nid});
      }
      else {
        // Update existing posts.
        actualColl.upsert({"content.nid": data.content.nid},{$set: data.content});
      }
    }

    // Handle Taxonomies
    if(data.content.ddp_type == 'taxonomy'){
      if (data.content.is_new) {
        drupalDdpTaxonomies.insert(data);
      }
      else if(data.content.delete_content){
        // Delete existing taxonomies.
        drupalDdpTaxonomies.remove({"content.tid": data.content.tid});
      }
      else {
        // Update existing taxonomies.
        drupalDdpTaxonomies.update({"content.tid": data.content.tid},{$set:{content:data.content}});
      }
    }
  }
});<commit_msg>Added function to handle adding users.<commit_after>Meteor.methods({
  // Accept node inserts and updates from Drupal.
  DrupalSaveNode: function (data) {
    console.log(data);
    // Handle Nodes
    if(data.content.ddp_type == 'node'){
      var actualColl = DrupalDdp.collections[data.content.type];
      if (!actualColl) {
        throw new Meteor.Error("You haven't registered this type of collection yet.");
      }
      if (data.content.is_new) {
        // Add new posts.
        actualColl.insert(data);
      }
      else if(data.content.delete_content){
        // Delete existing posts.
        actualColl.remove({"content.nid": data.content.nid});
      }
      else {
        // Update existing posts.
        actualColl.upsert({"content.nid": data.content.nid},{$set: data.content});
      }
    }

    // Handle Taxonomies
    if(data.content.ddp_type == 'taxonomy'){
      if (data.content.is_new) {
        drupalDdpTaxonomies.insert(data);
      }
      else if(data.content.delete_content){
        // Delete existing taxonomies.
        drupalDdpTaxonomies.remove({"content.tid": data.content.tid});
      }
      else {
        // Update existing taxonomies.
        drupalDdpTaxonomies.update({"content.tid": data.content.tid},{$set:{content:data.content}});
      }
    }

    // Handle Users
    if(data.content.ddp_type == 'user'){
      if (data.content.is_new) {
        // Create User
        Accounts.createUser({
          username: data.content.name,
          email : data.content.mail,
          password : <PASSWORD>,
          profile  : {
            first_name: 'First',
            last_name: 'Last',
            uid: data.content.uid,
            roles: data.content.roles,
          }
        });

        // Set account 'verified' to true
        Meteor.users.update({"profile.uid": data.content.uid}, {$set: {"emails.0.verified" :true}});
      }
      else if(data.content.delete_content){
        // Delete existing taxonomies.
        drupalDdpUsers.remove({"content.tid": data.content.tid});
      }
      else {
        // Update existing taxonomies.
        drupalDdpUsers.update({"content.tid": data.content.tid},{$set:{content:data.content}});
      }
    }
  }
});
{'fraction_non_alphanumeric': 0.14057142857142857, 'fraction_numerical': 0.00028571428571428574, 'mean_word_length': 2.1943430656934306, 'pattern_counts': {'":': 11, '<': 4, '<?xml version=': 0, '>': 4, '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': '1630903', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1075, 'n_words': 194}