<commit_before>var Q = require('q');
var authenticate = require('./authenticate');
var request = require('request');
var google = require('googleapis');
var errors = require('./errors');

var DOWNLOAD_URL = 'https://script.google.com/feeds/download/export?format=json&id=';

function getProjectById(fileId) {
  return authenticate().then(function(auth) {
    return Q.all([getProjectTitle(fileId, auth), getProjectFiles(fileId, auth)]);
  })
  .spread(function(title, files) {
    return {
      title: title,
      files: files,
      id: fileId
    };
  });
}

function getProjectTitle(fileId, auth) {
  var deferred = Q.defer();
  var drive = google.drive({ version: 'v2', auth: auth });
  drive.files.get({ fileId: fileId }, function(err, res) {
    if (err) return deferred.reject('Error getting project');<commit_msg>pass through error<commit_after>var Q = require('q');
var authenticate = require('./authenticate');
var request = require('request');
var google = require('googleapis');
var errors = require('./errors');

var DOWNLOAD_URL = 'https://script.google.com/feeds/download/export?format=json&id=';

function getProjectById(fileId) {
  return authenticate().then(function(auth) {
    return Q.all([getProjectTitle(fileId, auth), getProjectFiles(fileId, auth)]);
  })
  .spread(function(title, files) {
    return {
      title: title,
      files: files,
      id: fileId
    };
  });
}

function getProjectTitle(fileId, auth) {
  var deferred = Q.defer();
  var drive = google.drive({ version: 'v2', auth: auth });
  drive.files.get({ fileId: fileId }, function(err, res) {
    if (err) return deferred.reject(err);
{'fraction_non_alphanumeric': 0.16554261189454322, 'fraction_numerical': 0.001226241569589209, 'mean_word_length': 4.45819397993311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590211', 'n_tokens_mistral': 521, 'n_tokens_neox': 504, 'n_words': 119}