<commit_before>import React, { Component } from 'react';
import LinkButton from 'shared/components/linkButton/linkButton';
import Section from 'shared/components/section/section';
import ApprovedSchools from './approvedSchools/approvedSchools';
import PartnerSchools from './partnerSchools/partnerSchools';
import OnlineSchools from './onlineSchools/onlineSchools';
import StateSortedSchools from './stateSortedSchools/stateSortedSchools';
import styles from './codeSchools.css';

class CodeSchools extends Component {
  constructor(props) {
    super(props);

    this.state = {
      schools: null
    };
  }

  componentWillMount() {
    return fetch('https://api.operationcode.org/api/v1/code_schools.json')
      .then(response =>
        response.json().then((data) => {
          this.setState({
            schools: data
          });
        }))
      .catch(() => {});
  }

  render() {
    return (
      <div>
        <Section title="Code Schools" theme="white">
          <p>
            Code schools are accelerated learning programs that will prepare you
            for a career in software development. <br />Each school listed below
            ranges in length, vary in tuition costs, and in programming
            languages. <br />Desirable from an employer&apos;s standpoint, code
            schools are founded by software developers who saw a need <br />for
            more programmers and aspired to teach the next generation.
            <br />
            <br />
            We encourage you to check out the schools below, do your research,
            and ask fellow software developers in Slack in our Slack Community.
          </p>

          <div className={styles.filterButtonDiv}>
            <LinkButton
              link="approvedSchools"
              text="VA-Approved Schools"
              theme="blue"
              scrollLink
            />
            <LinkButton
              link="partnerSchools"
              text="Partnered Schools"
              theme="blue"
              scrollLink
            />
            <LinkButton
              link="onlineSchools"
              text="Online Schools"
              theme="blue"
              scrollLink
            />
            <LinkButton
              link="schoolsByState"
              text="Search by State"
              theme="blue"
              scrollLink
            />
          </div>
        </Section>
        {!this.state.schools && (
          <p className={styles.codeschoolError}>
            Whoops! Something went wrong… please check back later.
            <br />
          </p>
        )}
        {this.state.schools && <ApprovedSchools schools={this.state.schools} />}
        {this.state.schools && <PartnerSchools schools={this.state.schools} />}
        {this.state.schools && <OnlineSchools schools={this.state.schools} />}
        {this.state.schools && (
          <StateSortedSchools schools={this.state.schools} /><commit_msg>doesn't preload error message<commit_after>import React, { Component } from 'react';
import LinkButton from 'shared/components/linkButton/linkButton';
import Section from 'shared/components/section/section';
import ApprovedSchools from './approvedSchools/approvedSchools';
import PartnerSchools from './partnerSchools/partnerSchools';
import OnlineSchools from './onlineSchools/onlineSchools';
import StateSortedSchools from './stateSortedSchools/stateSortedSchools';
import styles from './codeSchools.css';

class CodeSchools extends Component {
  constructor(props) {
    super(props);

    this.state = {
      schools: null,
      errorResponse: false
    };
  }

  componentWillMount() {
    return fetch('https://api.operationcode.org/api/v2/code_schools.json')
      .then(response =>
        response.json().then((data) => {
          this.setState({
            schools: data
          });
        }))
      .catch(() => {
        this.setState({
          errorResponse: true
        });
      });
  }

  render() {
    return (
      <div>
        <Section title="Code Schools" theme="white">
          <p>
            Code schools are accelerated learning programs that will prepare you
            for a career in software development. <br />Each school listed below
            ranges in length, vary in tuition costs, and in programming
            languages. <br />Desirable from an employer&apos;s standpoint, code
            schools are founded by software developers who saw a need <br />for
            more programmers and aspired to teach the next generation.
            <br />
            <br />
            We encourage you to check out the schools below, do your research,
            and ask fellow software developers in Slack in our Slack Community.
          </p>

          <div className={styles.filterButtonDiv}>
            <LinkButton
              link="approvedSchools"
              text="VA-Approved Schools"
              theme="blue"
              scrollLink
            />
            <LinkButton
              link="partnerSchools"
              text="Partnered Schools"
              theme="blue"
              scrollLink
            />
            <LinkButton
              link="onlineSchools"
              text="Online Schools"
              theme="blue"
              scrollLink
            />
            <LinkButton
              link="schoolsByState"
              text="Search by State"
              theme="blue"
              scrollLink
            />
          </div>
        </Section>
        {this.state.errorResponse && (
          <p className={styles.codeschoolError}>
            Whoops! Something went wrong… please check back later.
            <br />
          </p>
        )}
        {this.state.schools && <ApprovedSchools schools={this.state.schools} />}
        {this.state.schools && <PartnerSchools schools={this.state.schools} />}
        {this.state.schools && <OnlineSchools schools={this.state.schools} />}
        {this.state.schools && (
          <StateSortedSchools schools={this.state.schools} />
{'fraction_non_alphanumeric': 0.10159098442161087, 'fraction_numerical': 0.00033145508783559825, 'mean_word_length': 1.88755980861244, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 55, 'https://': 2, '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': '7238263', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1510, 'n_words': 406}