<commit_before>class FXComponent extends React.Component<{}, FXComponentState> {
  constructor(props) {
    super(props);
    this.state = {fxRates: []};
  }
  componentDidMount() {
    io().on("data", data => this.setState({ fxRates: data }));
  }
  render() {
    return (
      <table>
        <tbody>
          {this.state.fxRates.map((rate: FXRow) => (
            <FXRow key={rate.currencyPair} data={rate}></FXRow>))
          }
        </tbody>
      </table>);
  }
}

class Direction extends React.Component<DirectionValue, {}> {
  constructor(props) {
    super();
  }
  render() {
    if (this.props.val === -1) return <td style={{ color: "red" }}>{"\u25bc"}</td>;
    if (this.props.val === 1) return <td style={{ color: "green" }}>{"\u25b2"}</td>;
    return <td></td>;
  }
}

class FXRow extends React.Component<FXRowData, FXRowState> {
  constructor(props: FXRowData) {
    super(props);
    this.state = { direction: 0 };
  }
  componentDidUpdate(prevProps: FXRowData, prevState) {
    if (prevState.direction !== this.state.direction) return;
    const prev = prevProps.data;
    const latest = this.props.data;

    const prevBid = +(prev.bidBig + prev.bidPips);
    const bid = +(latest.bidBig + latest.bidPips);

    if (prevBid > bid && this.state.direction !== -1)<commit_msg>Stateless function<commit_after>class FXComponent extends React.Component<{}, FXComponentState> {
  constructor(props) {
    super(props);
    this.state = {fxRates: []};
  }
  componentDidMount() {
    io().on("data", data => this.setState({ fxRates: data }));
  }
  render() {
    return (
      <table>
        <tbody>
          {this.state.fxRates.map((rate: FXRow) => (
            <FXRow key={rate.currencyPair} data={rate}></FXRow>))
          }
        </tbody>
      </table>);
  }
}

const Direction = ({val = 0}: DirectionValue) => val === -1 ?
  <td style={{ color: "red" }}>{"\u25bc"}</td> :
  <td style={{ color: "green" }}>{(val !== 0 ) && "\u25b2"}</td>;

class FXRow extends React.Component<FXRowData, FXRowState> {
  constructor(props: FXRowData) {
    super(props);
    this.state = { direction: 0 };
  }
  componentDidUpdate(prevProps: FXRowData, prevState) {
    if (prevState.direction !== this.state.direction) return;
    const prev = prevProps.data;
    const latest = this.props.data;

    const prevBid = +(prev.bidBig + prev.bidPips);
    const bid = +(latest.bidBig + latest.bidPips);

    if (prevBid > bid && this.state.direction !== -1)
{'fraction_non_alphanumeric': 0.18288726682887266, 'fraction_numerical': 0.007704785077047851, 'mean_word_length': 3.031045751633987, 'pattern_counts': {'":': 0, '<': 30, '<?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': '2661053', 'n_tokens_mistral': 864, 'n_tokens_neox': 843, 'n_words': 172}