<commit_before>'use strict';

const Module = require('module');


module.exports = { register };


function register (manager, options, callback) {
  const blacklist = options.blacklist || {};
  const blModules = blacklist.modules;
  const blBindings = blacklist.bindings;

  if (blModules !== null && typeof blModules === 'object') {
    const resolveFilename = Module._resolveFilename;

    Module._resolveFilename = function (request, parent) {
      const blEntry = blModules[request];
<commit_msg>allow policy to be retrieved<commit_after>'use strict';

const Module = require('module');


module.exports = { register };


function register (manager, options, callback) {
  const blacklist = Object.assign({}, options.blacklist);
  const blModules = blacklist.modules;
  const blBindings = blacklist.bindings;

  manager.add('policy-get-blacklist', function getBlacklist (options, cb) {
    cb(null, blacklist);
  });

  if (blModules !== null && typeof blModules === 'object') {
    const resolveFilename = Module._resolveFilename;

    Module._resolveFilename = function (request, parent) {
      const blEntry = blModules[request];

{'fraction_non_alphanumeric': 0.12456140350877193, 'fraction_numerical': 0.0, 'mean_word_length': 4.538834951456311, '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': '5477879', 'n_tokens_mistral': 316, 'n_tokens_neox': 313, 'n_words': 86}