<commit_before>const generateCredential = (name, awsAccessKeyId, awsSecretAccessKey, region) => `[${name}]
aws_access_key_id = ${awsAccessKeyId}
aws_secret_access_key = ${awsSecretAccessKey}
${region ? `region = ${region}\n` : ''}`;

module.exports = credentials => Object.keys(credentials)
  .reduce((lines, profile) => {
    const { awsSecretAccessKey, awsAccessKeyId, region } = credentials[profile];

    return [
      ...lines,
      generateCredential(profile, awsAccessKeyId, awsSecretAccessKey, region),
    ];
  }, [])
  .join('\n');<commit_msg>generate credentials<commit_after>const generateCredential = (name, aws_access_key_id, aws_secret_access_key, region, output) => (`[${name}]
aws_access_key_id = ${aws_access_key_id}
aws_secret_access_key = ${aws_secret_access_key}\n` +
(region ? `region = ${region}\n` : '') +
(output ? `output = ${output}\n` : ''));

module.exports = credentials => Object.keys(credentials)
  .reduce((lines, profile) => {
    const { aws_secret_access_key, aws_access_key_id, region, output } = credentials[profile];

    return [
      ...lines,
      generateCredential(profile, aws_access_key_id, aws_secret_access_key, region, output),
    ];
  }, [])
  .join('\n');
{'fraction_non_alphanumeric': 0.1635012386457473, 'fraction_numerical': 0.0, 'mean_word_length': 5.183673469387755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1652195', 'n_tokens_mistral': 394, 'n_tokens_neox': 405, 'n_words': 68}