<commit_before>/** @jsx React.DOM */

(function(global) {

  // --- header ---

  var Header = React.createClass({
    render: function() {
      return (
        <div className="navbar navbar-inverse navbar-fixed-top" role="navigation">
          <div className="container">
            <div className="navbar-header">
              <a className="navbar-brand">Github Repos Navigator</a>
            </div>
            <ul className="nav navbar-nav navbar-right">
              <li>
                <a href="#">New Search</a>
              </li>
            </ul>
          </div>
        </div>
      );
    }
  });

  // --- body ---

  var Body = React.createClass({
    render: function() {
      return (
        <div>{this.props.data.length}</div>
      );
    }
  });

  // --- page ---

  var UserPage = React.createClass({
    getDefaultProps: function() {
      return {
        login: "AF83"
      };
    },

    getInitialState: function() {
      return {
        data: []
      };
    },

    sendGithubQuery: function() {
      var self = this;

      function onSuccess(data) {
        console.log(data);
        self.setState({
          data: data
        });
      }

      function onError(req, txtStatus, err) {
        console.error(err);
      }

      jQuery
        .ajax({
          url: "https://api.github.com/users/" + this.props.login + "/repos",
          dataType: "json"
        })
        .done(onSuccess)
        .fail(onError);
    },

    componentDidMount: function() {
      this.sendGithubQuery();
    },

    render: function() {
      return (
        <div>
          <Header />
          <Body data={this.state.data}/>
        </div>
      );
    }
  });

  global.UserPage = UserPage;

})(this);<commit_msg>Display user repos<commit_after>/** @jsx React.DOM */

(function(global) {

  // --- header ---

  var Header = React.createClass({
    render: function() {
      return (
        <div className="navbar navbar-inverse navbar-fixed-top" role="navigation">
          <div className="container">
            <div className="navbar-header">
              <a className="navbar-brand">Github Repos Navigator</a>
            </div>
            <ul className="nav navbar-nav navbar-right">
              <li>
                <a href="#">New Search</a>
              </li>
            </ul>
          </div>
        </div>
      );
    }
  });

  // --- body ---

  var FilterResults = React.createClass({
    render: function() {
      return (
        <div></div>
      );
    }
  });

  var Pagination = React.createClass({
    render: function() {
      return (
        <div></div>
      );
    }
  });

  var Repo = React.createClass({
    render: function() {
      var repo = this.props.repo;

      return (
        <a className="list-group-item" href={repo.html_url}>{repo.name}</a>
      );
    }
  });

  var Repos = React.createClass({
    repos: function() {
      function addRepo(repo) {
        return <Repo key={repo.name} repo={repo} />;
      }

      return this.props.repos.map(addRepo);
    },

    render: function() {
      return (
        <div className="list-group">
          {this.repos()}
        </div>
      );
    }
  });

  var Body = React.createClass({
    render: function() {
      return (
        <div className="container" role="main">
          <FilterResults />
          <Pagination />
          <Repos repos={this.props.repos} />
        </div>
      );
    }
  });

  // --- page ---

  var UserPage = React.createClass({

    getInitialState: function() {
      return {
        repos: [],
        page: 1
      };
    },

    sendGithubQuery: function() {
      var self = this;

      function onSuccess(data) {
        self.setState({
          repos: data || []
        });
      }

      function onError(req, txtStatus, err) {
        console.error(err);
      }

      jQuery
        .ajax({
          url: "https://api.github.com/users/" +
               this.props.data.user.login +
               "/repos?page=" +
               this.state.page,
          dataType: "json"
        })
        .done(onSuccess)
        .fail(onError);
    },

    componentDidMount: function() {
      this.sendGithubQuery();
    },

    render: function() {
      return (
        <div>
          <Header />
          <Body repos={this.state.repos}/>
        </div>
      );
    }
  });

  global.UserPage = UserPage;

})(this);
{'fraction_non_alphanumeric': 0.16005440943096805, 'fraction_numerical': 0.0006801178871004307, 'mean_word_length': 1.480044969083755, 'pattern_counts': {'":': 0, '<': 55, '<?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': '4495657', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1315, 'n_words': 247}