<commit_before>module.exports = function (callback) {
  var identity;
  var account;
  identity = new app.models.Identity({ provider: 'github', token: '<PASSWORD>' });
  identity.save(function (err) {
    account = new app.models.Account({ email: '<EMAIL>', identities: [ identity._id ]});
    account.save(function (err) {

      if (err) { callback(err); }

      nock('https://github.com')
        .post('/login/oauth/access_token')
        .reply(200, "access_token=a%20fake%20token&scope=user%3Aemail&token_type=bearer");

      nock('https://api.github.com')
        .get('/user/emails')
        .reply(200, [
          { email: '<EMAIL>', verified: true },
          { email: '<EMAIL>', primary: true }
        ]);

      session
        .post('/api/sessions')
        .send({
          code: 'fake',
          provider: 'github'
        })
        .end(function (err, res) {
          if (err) { callback(err); }
          app.models.Identity
            .findOne()
            .exec(function (err, identity) {
              if (err) { callback(err); }
              callback(null, identity);
            });
        });
    });
  });
};<commit_msg>modified session create helper to return account<commit_after>module.exports = function (callback) {
  var identity;
  var account;
  identity = new app.models.Identity({ provider: 'github', token: '<PASSWORD>' });
  identity.save(function (err) {
    account = new app.models.Account({ email: '<EMAIL>', identities: [ identity._id ]});
    account.save(function (err, account) {

      if (err) { callback(err); }

      nock('https://github.com')
        .post('/login/oauth/access_token')
        .reply(200, "access_token=a%20fake%20token&scope=user%3Aemail&token_type=bearer");

      nock('https://api.github.com')
        .get('/user/emails')
        .reply(200, [
          { email: '<EMAIL>', verified: true },
          { email: '<EMAIL>', primary: true }
        ]);

      session
        .post('/api/sessions')
        .send({
          code: 'fake',
          provider: 'github'
        })
        .end(function (err, res) {
          if (err) { callback(err); }
          app.models.Identity
            .findOne()
            .exec(function (err, identity) {
              if (err) { callback(err); }
              callback(null, account);
            });
        });
    });
  });
};
{'fraction_non_alphanumeric': 0.17267713194739076, 'fraction_numerical': 0.009333899024183284, 'mean_word_length': 2.0623376623376624, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '1349647', 'n_tokens_mistral': 725, 'n_tokens_neox': 708, 'n_words': 139}