<commit_before>import { connect } from 'react-redux';
import {
        getEvents,
      } from '../actions/index';

const getPullRequestByType = (events, prType) => {
  const pullReq = events.filter((ghEvent) => ghEvent.type==='PullRequestEvent');
  const listOfPullRequests = pullReq.filter((obj) => obj.payload.action===`${prType}`);
  return listOfPullRequests
}

const getIssueByType = (events, issueType) => {
  const issues = events.filter((ghEvent) => ghEvent.type==='IssuesEvent');
  const listOfIssues = issues.filter((obj) => obj.payload.action===`${issueType}`);
  return listOfIssues
}

const getCommits = (events) => {
  const pushEvents = events.filter((ghEvent) => ghEvent.type==='PushEvent')
  const commitLengths = pushEvents.map((obj) => obj.payload.commits.length);
  const reducedCommits = commitLengths.reduce((a, b) => a + b, 0);
  return reducedCommits
}

const mapStateToProps = (state) => {
 const { events } = state
 return {
   events: events,
   openedPullRequests: getPullRequestByType(events, 'opened'),
   issuesCreated: getIssueByType(events, 'opened'),
   issuesClosed: getIssueByType(events, 'closed'),
   commits: getCommits(events),
 };
};

const mapDispatchToProps = (dispatch) => {
 return {
   getEvents: (events) => {
      dispatch(getEvents(events));
    },
    getOpenedPullRequests: (openedPullRequests) => {
      dispatch(getOpenedPullRequests(openedPullRequests));
    },
    getIssuesCreated: (issuesCreated) => {
      dispatch(getIssuesCreated(issuesCreated));
    },
    getIssuesClosed: (issuesClosed) => {
      dispatch(getIssuesClosed(issuesClosed));
    },
    getCommits: (commits) => {
      dispatch(getCommits(commits));
    }

 };
};

export default connect(mapStateToProps, mapDispatchToProps);<commit_msg>Remove unnecessary items in mapDispatchToProps<commit_after>import { connect } from 'react-redux';
import {
        getEvents,
      } from '../actions/index';

const getPullRequestByType = (events, prType) => {
  const pullReq = events.filter((ghEvent) => ghEvent.type==='PullRequestEvent');
  const listOfPullRequests = pullReq.filter((obj) => obj.payload.action===`${prType}`);
  return listOfPullRequests
}

const getIssueByType = (events, issueType) => {
  const issues = events.filter((ghEvent) => ghEvent.type==='IssuesEvent');
  const listOfIssues = issues.filter((obj) => obj.payload.action===`${issueType}`);
  return listOfIssues
}

const getCommits = (events) => {
  const pushEvents = events.filter((ghEvent) => ghEvent.type==='PushEvent')
  const commitLengths = pushEvents.map((obj) => obj.payload.commits.length);
  const reducedCommits = commitLengths.reduce((a, b) => a + b, 0);
  return reducedCommits
}

const mapStateToProps = (state) => {
 const { events } = state
 return {
   events: events,
   openedPullRequests: getPullRequestByType(events, 'opened'),
   issuesCreated: getIssueByType(events, 'opened'),
   issuesClosed: getIssueByType(events, 'closed'),
   commits: getCommits(events),
 };
};

const mapDispatchToProps = (dispatch) => {
 return {
   getEvents: (events) => {
      dispatch(getEvents(events));
    }
 };
};

export default connect(mapStateToProps, mapDispatchToProps);
{'fraction_non_alphanumeric': 0.15220125786163521, 'fraction_numerical': 0.0006289308176100629, 'mean_word_length': 4.826007326007326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '5910788', 'n_tokens_mistral': 1023, 'n_tokens_neox': 993, 'n_words': 189}