<commit_before>import React from 'react';

const Select = ({
    name,
    value,
    list,
    onChange,
}) => (
    <select name={name} value={value} onChange={onChange}>
        {Array.isArray(list) ?
          list.map((item, idx) => (
              <option key={idx} value={item.value}>{item.text}</option>
          ))
        :
        Object.keys(list).map(key => (
            <React.Fragment key={key}>
                <optgroup label={key}></optgroup>
                {list[key].map((item, idx) => (
                    <option key={idx} value={item.value}>{item.text}</option>
                ))}
            </React.Fragment>
        ))}
    </select>
);<commit_msg>move options inside optgroup<commit_after>import React from 'react';

const Select = ({
    name,
    value,
    list,
    onChange,
}) => (
    <select name={name} value={value} onChange={onChange}>
        {Array.isArray(list) ?
          list.map((item, idx) => (
              <option key={idx} value={item.value}>{item.text}</option>
          ))
        :
        Object.keys(list).map(key => (
            <React.Fragment key={key}>
                <optgroup label={key}>
                    {list[key].map((item, idx) => (
                        <option key={idx} value={item.value}>{item.text}</option>
                    ))}
                </optgroup>
            </React.Fragment>
        ))}
    </select>
);
{'fraction_non_alphanumeric': 0.1754636233951498, 'fraction_numerical': 0.0, 'mean_word_length': 1.6622390891840608, 'pattern_counts': {'":': 0, '<': 23, '<?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': '4671057', 'n_tokens_mistral': 416, 'n_tokens_neox': 416, 'n_words': 68}