<commit_before>
var config = require('./config').config;

exports.handler = (function() {
  var url=require('url'),
    crypto=require('crypto'),
    tokens = {}, lastModified = {}, contentType = {}, content = {};
  function createToken(userName, scopes, cb) {
    var scopePaths=[];
    crypto.randomBytes(48, function(ex, buf) {
      var token = buf.toString('hex');
      for(var i=0; i<scopes.length; i++) {
        var thisScopeParts = scopes[i].split(':');
        if(thisScopeParts[0]=='') {
          scopePaths.push('/:'+thisScopeParts[1]);
        } else {
          scopePaths.push(userName+'/'+thisScopeParts[0]+'/:'+thisScopeParts[1]);
          scopePaths.push(userName+'/public/'+thisScopeParts[0]+'/:'+thisScopeParts[1]);
        }
      }
      tokens[token] = scopePaths;
      cb(token);
    });
  }
  function mayRead(authorizationHeader, path) {
    if(authorizationHeader) {
      var scopes = tokens[authorizationHeader.substring('Bearer '.length)];
      if(scopes) {<commit_msg>fix example server<commit_after>
var config = require('./config').config;

exports.handler = (function() {
  var url=require('url'),
    crypto=require('crypto'),
    tokens = {}, lastModified = {}, contentType = {}, content = {};
  function createToken(userName, scopes, cb) {
    var scopePaths=[];
    crypto.randomBytes(48, function(ex, buf) {
      var token = buf.toString('hex');
      for(var i=0; i<scopes.length; i++) {
        var thisScopeParts = scopes[i].split(':');
        if(thisScopeParts[0]=='') {
          scopePaths.push(userName+'/:'+thisScopeParts[1]);
        } else {
          scopePaths.push(userName+'/'+thisScopeParts[0]+'/:'+thisScopeParts[1]);
          scopePaths.push(userName+'/public/'+thisScopeParts[0]+'/:'+thisScopeParts[1]);
        }
      }
      tokens[token] = scopePaths;
      cb(token);
    });
  }
  function mayRead(authorizationHeader, path) {
    if(authorizationHeader) {
      var scopes = tokens[authorizationHeader.substring('Bearer '.length)];
      if(scopes) {
{'fraction_non_alphanumeric': 0.1815034619188922, 'fraction_numerical': 0.008902077151335312, 'mean_word_length': 3.3319057815845823, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3916252', 'n_tokens_mistral': 641, 'n_tokens_neox': 628, 'n_words': 100}