<commit_before>import React, {Component} from 'react';

class Dashboard extends Component {
	constructor() {
		// Required function call for every constructor
		super();

		// Bind every class function to 'this'
		this.retrieveCourses = this
		.retrieveCourses
		.bind(this);
		//Set up our state
		this.state = {
			courses: []
		};
		//Async call to retrieve courses
		this.retrieveCourses();
	}

	retrieveCourses() {
		// Make modifications to an object referring the class's 'this'
		let coursesRef = this;

		// Fetch the data, convert response to json, assign json object to 'courses'
		fetch('/courses/allCourses').then((response) => response.json())
		.then(function (response) {
			console.log(response);
			let courses = [];
			if (response.courses) {
				for (let course in response.courses) {
					console.log('course is', course);
					courses.push(
						// This code needs to be abstracted into a class Component Talk to Tony about
						// how to pass props, etc
						<li key = {course}> { course + ' - ' + response.courses[course].name}</li>
					);
				}
			}
			coursesRef.setState({
				courses: courses
			});
		})
		.catch(function(error) {
			console.log(error);
		});
	}

	render() {

		return (
			<div>
				<h1> Dashboard Component! </h1 > <ul>
					{this.state.courses}
				</ul> < /div>);
	}
}

export default Dashboard;<commit_msg>Fix syntax warnings on Dashboard<commit_after>import React, {Component} from 'react';

class Dashboard extends Component {
	constructor() {
		// Required function call for every constructor
		super();

		// Bind every class function to 'this'
		this.retrieveCourses = this
		.retrieveCourses
		.bind(this);
		//Set up our state
		this.state = {
			courses: []
		};
		//Async call to retrieve courses
		this.retrieveCourses();
	}

	retrieveCourses() {
		// Make modifications to an object referring the class's 'this'
		let coursesRef = this;

		// Fetch the data, convert response to json, assign json object to 'courses'
		fetch('/courses/allCourses').then((response) => response.json())
		.then(function (response) {
			console.log(response);
			let courses = [];
			if (response.courses) {
				for (let course in response.courses) {
					console.log('course is', course);
					courses.push(
						// This code needs to be abstracted into a class Component Talk to Tony about
						// how to pass props, etc
						<li key={course}> { course + ' - ' + response.courses[course].name}</li>
					);
				}
			}
			coursesRef.setState({
				courses: courses
			});
		})
		.catch(function(error) {
			console.log(error);
		});
	}

	render() {

		return (
			<div>
				<h1> Dashboard Component! </h1>
				<ul>
					{this.state.courses}
				</ul>
			</div>);
	}
}

export default Dashboard;
{'fraction_non_alphanumeric': 0.13629737609329445, 'fraction_numerical': 0.0014577259475218659, 'mean_word_length': 2.899147727272727, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '3922026', 'n_tokens_mistral': 1053, 'n_tokens_neox': 868, 'n_words': 252}