<commit_before>// Credits go to Mike Bostock: http://bl.ocks.org/mbostock/3468167
export function roundRect (x, y, width, height, radius) {
  const topLeft = radius.topLeft || 0;
  const topRight = radius.topRight || 0;
  const bottomLeft = radius.bottomLeft || 0;
  const bottomRight = radius.bottomRight || 0;

  return 'M' + (x + topLeft) + ',' + y +
    'h' + (width - topLeft - topRight) +
    'a' + topRight + ',' + topRight + ' 0 0 1 ' + topRight + ',' + topRight +
    'v' + (height - (topRight + bottomRight)) +
    'a' + bottomRight + ',' + bottomRight + ' 0 0 1 ' + -bottomRight + ',' + bottomRight +
    'h' + (bottomLeft - (width - bottomRight)) +
    'a' + bottomLeft + ',' + bottomLeft + ' 0 0 1 ' + -bottomLeft + ',' + -bottomLeft +
    'v' + (topLeft - (height - bottomLeft)) +
    'a' + topLeft + ',' + topLeft + ' 0 0 1 ' + topLeft + ',' + -topLeft +
    'z';
}<commit_msg>Add an method to generate a dialog background path.<commit_after>// Credits go to Mike Bostock: http://bl.ocks.org/mbostock/3468167
export function roundRect (x, y, width, height, radius) {
  const topLeft = radius.topLeft || 0;
  const topRight = radius.topRight || 0;
  const bottomLeft = radius.bottomLeft || 0;
  const bottomRight = radius.bottomRight || 0;

  return 'M' + (x + topLeft) + ',' + y +
    'h' + (width - topLeft - topRight) +
    'a' + topRight + ',' + topRight + ' 0 0 1 ' + topRight + ',' + topRight +
    'v' + (height - (topRight + bottomRight)) +
    'a' + bottomRight + ',' + bottomRight + ' 0 0 1 ' + -bottomRight + ',' + bottomRight +
    'h' + (bottomLeft - (width - bottomRight)) +
    'a' + bottomLeft + ',' + bottomLeft + ' 0 0 1 ' + -bottomLeft + ',' + -bottomLeft +
    'v' + (topLeft - (height - bottomLeft)) +
    'a' + topLeft + ',' + topLeft + ' 0 0 1 ' + topLeft + ',' + -topLeft +
    'z';
}

export function dropMenu (x, y, width, height, radius, arrowSize) {
  return 'M' + (x + radius) + ',' + y +
    'h' + (width - radius * 2) +
    'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + radius +
    'v' + (height - radius * 2) +
    'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + radius +
    'h' + (-(width - radius * 2 - arrowSize * 2) / 2) +
    'l' + (-arrowSize) + ',' + (arrowSize) +
    'l' + (-arrowSize) + ',' + (-arrowSize) +
    'h' + (-(width - radius * 2 - arrowSize * 2) / 2) +
    'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + -radius +
    'v' + (radius - (height - radius)) +
    'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + -radius +
    'z';
}
{'fraction_non_alphanumeric': 0.20654316121403232, 'fraction_numerical': 0.0260149783208514, 'mean_word_length': 2.52990264255911, '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': '1337327', 'n_tokens_mistral': 992, 'n_tokens_neox': 926, 'n_words': 257}