<commit_before>'use strict';
var Heroku = require('heroku-client');

const HOST = process.env.HEROKU_REDIS_HOST || "redis-api.heroku.com" ;
const PATH =  "/redis/v0/databases";
const ADDON = process.env.HEROKU_REDIS_ADDON_NAME || "heroku-redis";

function request(context, path, method) {
  return Heroku.request( {
    method: method || "GET",
    path: PATH+"/"+path,
    host: HOST,
    auth: context.auth.username+":"+context.auth.password,
    headers: {
      'Accept': 'application/json',
    },
  });
}

function make_addons_filter(filter) {
  if (filter) {
    filter = filter.toUpperCase();
  }

  function matches(addon) {
    console.log(addon);
    for (var i=0; i<addon.config_vars.length; i++) {
      var cfg_name = addon.config_vars[i].toUpperCase();
      if (cfg_name.indexOf(filter) >= 0) {
        return true;
      }
    }
    if (addon.name.toUpperCase().indexOf(filter) >= 0) {<commit_msg>Allow to pass a request body<commit_after>'use strict';
var Heroku = require('heroku-client');

const HOST = process.env.HEROKU_REDIS_HOST || "redis-api.heroku.com" ;
const PATH =  "/redis/v0/databases";
const ADDON = process.env.HEROKU_REDIS_ADDON_NAME || "heroku-redis";

function request(context, path, method, body) {
  return Heroku.request( {
    method: method || "GET",
    path: PATH+"/"+path,
    host: HOST,
    auth: context.auth.username+":"+context.auth.password,
    headers: {
      'Accept': 'application/json',
    },
    body: body,
  });
}

function make_addons_filter(filter) {
  if (filter) {
    filter = filter.toUpperCase();
  }

  function matches(addon) {
    console.log(addon);
    for (var i=0; i<addon.config_vars.length; i++) {
      var cfg_name = addon.config_vars[i].toUpperCase();
      if (cfg_name.indexOf(filter) >= 0) {
        return true;
      }
    }
    if (addon.name.toUpperCase().indexOf(filter) >= 0) {
{'fraction_non_alphanumeric': 0.16246648793565685, 'fraction_numerical': 0.004289544235924933, 'mean_word_length': 3.4113475177304964, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, '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': '4937793', 'n_tokens_mistral': 678, 'n_tokens_neox': 667, 'n_words': 126}