<commit_before>
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import GameEquipSlot from './game-equip-slot';

/** Component which shows the equipment of the player.*/
const GameEquipment = (props) => {
  const eq = props.eq;
  const slots = eq.getSlotTypes();
  const equipped = [];
  const setEquip = props.setEquipSelected;

  let attr = '';
  if (props.isMasterEquipper) {
    attr = '(Weight reduced by 50%)';
  }

  // Creates the equipment slots based on whether they have items or not.
  for (let i = 0; i < slots.length; i++) {
    const item = eq.getEquipped(slots[i]);
    const items = [];
    if (item !== null) {items.push(item);}

    let key = i;
    if (items.length > 0) {
      for (let j = 0; j < items.length; j++) {
        key += ',' + j;
        equipped.push(
          <GameEquipSlot
            item={items[j]}
            key={key}
            setEquipSelected={setEquip}
            slotName={slots[i]}
            slotNumber={j}
          />
        );
      }
    }
    else {
      equipped.push(
        <GameEquipSlot
          item={null}
          key={key}
          setEquipSelected={setEquip}
          slotName={slots[i]}
          slotNumber={0}
        />
      );
    }
  }

  return (
    <div>
      <p>Equipment {attr}</p>
      {equipped}
    </div>
  );
}

GameEquipment.propTypes = {
  eq: PropTypes.object,
  isMasterEquipper: PropTypes.bool,
  setEquipSelected: PropTypes.func
};

export default GameEquipment;<commit_msg>Fixed linting errors.<commit_after>
import React from 'react';
import PropTypes from 'prop-types';
import GameEquipSlot from './game-equip-slot';

/* Component which shows the equipment of the player.*/
const GameEquipment = (props) => {
  const eq = props.eq;
  const slots = eq.getSlotTypes();
  const equipped = [];
  const setEquip = props.setEquipSelected;

  let attr = '';
  if (props.isMasterEquipper) {
    attr = '(Weight reduced by 50%)';
  }

  // Creates the equipment slots based on whether they have items or not.
  for (let i = 0; i < slots.length; i++) {
    const item = eq.getEquipped(slots[i]);
    const items = [];
    if (item !== null) {items.push(item);}

    let key = i;
    if (items.length > 0) {
      for (let j = 0; j < items.length; j++) {
        key += ',' + j;
        equipped.push(
          <GameEquipSlot
            item={items[j]}
            key={key}
            setEquipSelected={setEquip}
            slotName={slots[i]}
            slotNumber={j}
          />
        );
      }
    }
    else {
      equipped.push(
        <GameEquipSlot
          item={null}
          key={key}
          setEquipSelected={setEquip}
          slotName={slots[i]}
          slotNumber={0}
        />
      );
    }
  }

  return (
    <div>
      <p>Equipment {attr}</p>
      {equipped}
    </div>
  );
};

GameEquipment.propTypes = {
  eq: PropTypes.object,
  isMasterEquipper: PropTypes.bool,
  setEquipSelected: PropTypes.func
};

export default GameEquipment;
{'fraction_non_alphanumeric': 0.13871290430143382, 'fraction_numerical': 0.0040013337779259755, 'mean_word_length': 2.1088082901554404, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '96998', 'n_tokens_mistral': 985, 'n_tokens_neox': 969, 'n_words': 238}