<commit_before>exports.extendCore = {
  'parameterOne': 1,
  'parameterTwo': [1, 2, 3, 4, 5],
  'parameterThree': {},
  'parameterFour': function () {
    return this.parameterOne+this.parameterTwo[0];
  },
  'getSum': function(a,b){
    return a+b;
  }
};


exports.extendModel = {
  'Cats': function (mongoose, config) {
    var CatsSchema = new mongoose.Schema({
      'nickname': String
    });

    CatsSchema.index({
      nickname: 1
    });
    return mongoose.model('cats', CatsSchema);
  },

  'Dogs': function (mongoose, config) {
    var DogsSchema = new mongoose.Schema({
      'nickname': String
    });

    DogsSchema.index({
      nickname: 1
    });

    return mongoose.model('Dogs', DogsSchema);
  }
};

exports.extendApp = function (app, config) {
  app.set('someValue',42);
  //we do it for all application enviroments
  //app - is a expressJS application. it turned out that we do not need core here...
  //config - is a current mwc config object
};

//sorry, only one(!) passportJS strategy per plugin!
var LinkedInStrategy = require('passport-linkedin').Strategy;
exports.extendStrategy = {
  'strategy': function (core) {
    return new LinkedInStrategy({
      consumerKey: core.config.passport.LINKEDIN_API_KEY,
      consumerSecret: core.config.passport.LINKEDIN_SECRET_KEY,
      callbackURL: core.config.hostUrl + 'auth/linkedin/callback'
    }, function (token, tokenSecret, profile, done) {
      console.log('==============');
      console.log(profile);
      console.log('==============');
      var email = profile.emails[0].value;
      if (email) {
        core.model.Users.processOAuthProfile(email, done);
      } else {
        return done(new Error('There is something strange instead of user profile'));
      }
    });
  },
  'routes': function (passport, core) {
    core.app.get('/auth/linkedin', passport.authenticate('linkedin'), function (req, res) {
    });
    core.app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { failureRedirect: '/' }),
      function (req, res) {
        res.redirect('/');
      });
  }
};

//the most hard to understand function
//because middleware conseption is trkicky and it do need the core object, for example, in this way
//or maybe in some other way. But it do need the core!!!<commit_msg>[example] - file that will be the prototype object of plugin<commit_after>exports.extendCore = {
  'parameterOne': 1,
  'parameterTwo': [1, 2, 3, 4, 5],
  'parameterThree': {},
  'parameterFour': function () {
    return this.parameterOne+this.parameterTwo[0];
  },
  'getSum': function(a,b){
    return a+b;
  }
};


exports.extendModel = {
  'Cats': function (mongoose, config) {
    var CatsSchema = new mongoose.Schema({
      'nickname': String
    });

    CatsSchema.index({
      nickname: 1
    });
    return mongoose.model('cats', CatsSchema);
  },

  'Dogs': function (mongoose, config) {
    var DogsSchema = new mongoose.Schema({
      'nickname': String
    });

    DogsSchema.index({
      nickname: 1
    });

    return mongoose.model('Dogs', DogsSchema);
  }
};

//we do it for all application enviroments
//app - is a expressJS application. it turned out that we do not need core here...
//config - is a current mwc config object
exports.extendApp = function (app, config) {
  app.set('someValue',42);
};

var LinkedInStrategy = require('passport-linkedin').Strategy;

//sorry, only one(!) passportJS strategy per plugin!
exports.extendStrategy = {
  'strategy': function (core) {
    return new LinkedInStrategy({
      consumerKey: core.config.passport.LINKEDIN_API_KEY,
      consumerSecret: core.config.passport.LINKEDIN_SECRET_KEY,
      callbackURL: core.config.hostUrl + 'auth/linkedin/callback'
    }, function (token, tokenSecret, profile, done) {
      console.log('==============');
      console.log(profile);
      console.log('==============');
      var email = profile.emails[0].value;
      if (email) {
        core.model.Users.processOAuthProfile(email, done);
      } else {
        return done(new Error('There is something strange instead of user profile'));
      }
    });
  },
  'routes': function (passport, core) {
    core.app.get('/auth/linkedin', passport.authenticate('linkedin'), function (req, res) {
    });
    core.app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { failureRedirect: '/' }),
      function (req, res) {
        res.redirect('/');
      });
  }
};

//the most hard to understand function
//because middleware conception is tricky and it do need the core object, for example,
// in this way or maybe in some other way. But it do need the core!!!
{'fraction_non_alphanumeric': 0.15399568034557234, 'fraction_numerical': 0.005183585313174946, 'mean_word_length': 3.240842490842491, 'pattern_counts': {'":': 0, '<': 3, '<?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': '325249', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1414, 'n_words': 380}