<commit_before>// Ours
const {getLongest, identity} = require('./misc');

const CAMELABLE_PATTERN = /-\w/g;
const COLON = ':';
const EMPTY = '';
const NEWLINE = '\n';
const SLASH = '/';
const SPACE = ' ';

module.exports.COLON = COLON;
module.exports.EMPTY = EMPTY;
module.exports.NEWLINE = NEWLINE;
module.exports.SLASH = SLASH;
module.exports.SPACE = SPACE;

module.exports.indented = (str, indent = 2) =>
  str.split(`${NEWLINE}`).join(`${NEWLINE}${SPACE.repeat(indent)}`);

module.exports.bulleted = strs =>
  strs.map(str => `• ${str}`).join(NEWLINE);

module.exports.inlineList = strs =>
  strs.reduce((acc, str, index) => {
    return [acc, str].join(index === strs.length - 1 ? ' & ' : ', ');
  });

const padding = module.exports.padding = (str, len, char = SPACE) =>
  char.repeat(len > str.length ? len - str.length : 0);

module.exports.padLeft = (str, len, char = SPACE) =>
  padding(str, len, char) + String(str);

const padRight = module.exports.padRight = (str, len, char = SPACE) =>
  String(str) + padding(str, len, char);

module.exports.listPairs = (obj, style = identity) => {
  const keys = Object.keys(obj);
  const longest = getLongest(keys).length;

  return keys.map(key => {
    return `${style(padRight(key, longest))}  ${obj[key]}`;
  }).join(NEWLINE);
};

module.exports.zipTemplateLiterals = (literals, separator = EMPTY) => {
  const literalsLines = literals.map(literal => literal.split(NEWLINE));

  return literalsLines[0].reduce((memo, _, index) => [memo, NEWLINE].join(<commit_msg>Simplify inlineList.<commit_after>// Ours
const {getLongest, identity} = require('./misc');

const CAMELABLE_PATTERN = /-\w/g;
const COLON = ':';
const EMPTY = '';
const NEWLINE = '\n';
const SLASH = '/';
const SPACE = ' ';

module.exports.COLON = COLON;
module.exports.EMPTY = EMPTY;
module.exports.NEWLINE = NEWLINE;
module.exports.SLASH = SLASH;
module.exports.SPACE = SPACE;

module.exports.indented = (str, indent = 2) =>
  str.split(`${NEWLINE}`).join(`${NEWLINE}${SPACE.repeat(indent)}`);

module.exports.bulleted = strs =>
  strs.map(str => `• ${str}`).join(NEWLINE);

module.exports.inlineList = strs =>
  strs.reduce((acc, str, index) =>
    [acc, str].join(index === strs.length - 1 ? ' & ' : ', '));

const padding = module.exports.padding = (str, len, char = SPACE) =>
  char.repeat(len > str.length ? len - str.length : 0);

module.exports.padLeft = (str, len, char = SPACE) =>
  padding(str, len, char) + String(str);

const padRight = module.exports.padRight = (str, len, char = SPACE) =>
  String(str) + padding(str, len, char);

module.exports.listPairs = (obj, style = identity) => {
  const keys = Object.keys(obj);
  const longest = getLongest(keys).length;

  return keys.map(key => {
   return `${style(padRight(key, longest))}  ${obj[key]}`;
  }).join(NEWLINE);
};

module.exports.zipTemplateLiterals = (literals, separator = EMPTY) => {
  const literalsLines = literals.map(literal => literal.split(NEWLINE));

  return literalsLines[0].reduce((memo, _, index) => [memo, NEWLINE].join(
{'fraction_non_alphanumeric': 0.19484808454425362, 'fraction_numerical': 0.002642007926023778, 'mean_word_length': 4.323374340949034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, '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': '6052327', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1080, 'n_words': 223}