<commit_before>/* eslint-disable
    camelcase,
    handle-callback-err,
    no-return-assign,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
 * decaffeinate suggestions:
 * DS102: Remove unnecessary code created because of implicit returns
 * DS207: Consider shorter variations of null checks
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
let MockWebServer
const sinon = require('sinon')
const express = require('express')

module.exports = MockWebServer = {
  projects: {},
  privileges: {},

  createMockProject(project_id, privileges, project) {
    MockWebServer.privileges[project_id] = privileges
    return (MockWebServer.projects[project_id] = project)
  },

  joinProject(project_id, user_id, callback) {
    if (callback == null) {
      callback = function (error, project, privilegeLevel) {}
    }
    return callback(
      null,
      MockWebServer.projects[project_id],
      MockWebServer.privileges[project_id][user_id]
    )
  },
<commit_msg>[MockWebServer] grant users at least the privileges of anonymous users<commit_after>/* eslint-disable
    camelcase,
    handle-callback-err,
    no-return-assign,
*/
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
 * decaffeinate suggestions:
 * DS102: Remove unnecessary code created because of implicit returns
 * DS207: Consider shorter variations of null checks
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
let MockWebServer
const sinon = require('sinon')
const express = require('express')

module.exports = MockWebServer = {
  projects: {},
  privileges: {},

  createMockProject(project_id, privileges, project) {
    MockWebServer.privileges[project_id] = privileges
    return (MockWebServer.projects[project_id] = project)
  },

  joinProject(project_id, user_id, callback) {
    if (callback == null) {
      callback = function (error, project, privilegeLevel) {}
    }
    return callback(
      null,
      MockWebServer.projects[project_id],
      MockWebServer.privileges[project_id][user_id] ||
        MockWebServer.privileges[project_id]['anonymous-user']
    )
  },

{'fraction_non_alphanumeric': 0.10997782705099779, 'fraction_numerical': 0.005321507760532151, 'mean_word_length': 3.9691629955947136, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3521451', 'n_tokens_mistral': 681, 'n_tokens_neox': 660, 'n_words': 162}