<commit_before>import React, { useEffect, useState } from "react";
import { Box } from '@mui/material';
import OutlinedInput from '@mui/material/OutlinedInput';
import InputLabel from '@mui/material/InputLabel';
import MenuItem from '@mui/material/MenuItem';
import FormControl from '@mui/material/FormControl';
import Select from '@mui/material/Select';
import Chip from '@mui/material/Chip';
import MultipleSelectChipStyles from "./MultipleSelectChipStyles";

function MultipleSelectChip(props) {
  const { values, selected, handleExternalChange, label } = props;
  const [itemValue, setItemValue] = useState(selected);
  const multipleSelectChipStyles = MultipleSelectChipStyles();

  const handleChange = (event) => {
    const {target:{value}} = event;
    let itemValueNew = value;
    if (typeof value === 'string') {
      itemValueNew = value.split(',');
    }
    setItemValue(itemValueNew);
    handleExternalChange(itemValueNew);
  };

  useEffect(() => {
    setItemValue(selected);
  }, [selected]);

  return (
      <FormControl fullWidth>
        <InputLabel id="demo-multiple-chip-label">{label}</InputLabel>
        <Select
          labelId="demo-multiple-chip-label"
          id="demo-multiple-chip"
          multiple
          value={itemValue}
          onChange={handleChange}
          input={<OutlinedInput id="select-multiple-chip" label={label} />}
          renderValue={() => (
            <Box className={multipleSelectChipStyles.selectBox} >
              {selected.map((value) => (
                <Chip key={value} label={value} />
              ))}
            </Box>
          )}
        >
          {values.map((item) => (
            <MenuItem key={item} value={item}>
              {item}
            </MenuItem>
          ))}
        </Select>
      </FormControl>
  );
}

export default MultipleSelectChip;
<commit_msg>multi-chip-label changed<commit_after>import React, { useEffect, useState } from "react";
import { Box } from '@mui/material';
import OutlinedInput from '@mui/material/OutlinedInput';
import InputLabel from '@mui/material/InputLabel';
import MenuItem from '@mui/material/MenuItem';
import FormControl from '@mui/material/FormControl';
import Select from '@mui/material/Select';
import Chip from '@mui/material/Chip';
import MultipleSelectChipStyles from "./MultipleSelectChipStyles";

function MultipleSelectChip(props) {
  const { values, selected, handleExternalChange, label } = props;
  const [itemValue, setItemValue] = useState(selected);
  const multipleSelectChipStyles = MultipleSelectChipStyles();

  const handleChange = (event) => {
    const {target:{value}} = event;
    let itemValueNew = value;
    if (typeof value === 'string') {
      itemValueNew = value.split(',');
    }
    setItemValue(itemValueNew);
    handleExternalChange(itemValueNew);
  };

  useEffect(() => {
    setItemValue(selected);
  }, [selected]);

  return (
      <FormControl fullWidth>
        <InputLabel id="multiple-chip-label">{label}</InputLabel>
        <Select
          labelId="multiple-chip-label"
          id="multiple-chip"
          multiple
          value={itemValue}
          onChange={handleChange}
          input={<OutlinedInput id="select-multiple-chip" label={label} />}
          renderValue={() => (
            <Box className={multipleSelectChipStyles.selectBox} >
              {selected.map((value) => (
                <Chip key={value} label={value} />
              ))}
            </Box>
          )}
        >
          {values.map((item) => (
            <MenuItem key={item} value={item}>
              {item}
            </MenuItem>
          ))}
        </Select>
      </FormControl>
  );
}

export default MultipleSelectChip;

{'fraction_non_alphanumeric': 0.13682795698924732, 'fraction_numerical': 0.0, 'mean_word_length': 2.8085977482088023, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 37, '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': '7061066', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1029, 'n_words': 213}