<commit_before>/// <reference path="../resources/interfaces.ts" />
import React = require("react/addons");

// TODO: Remove deprecated classSet.
var cx = React.addons.classSet;
var r = React.DOM;

/**
 * The JSON response code block.
 */
class JsonResponse extends React.Component<JsonResponse.Props, {}> {
  static create = React.createFactory(JsonResponse);

  private _renderResponseHeaderInfo = () => {
    var action = this.props.response.action;

    return action === undefined ? null :
      r.div({
        className: "json-response-info",
        children: [
          action.method + " " + this.props.response.route,
          action.method !== "GET" ? "" :
            r.a({
              className: "raw-route-link",
              href: this.props.response.route_url,
              target: "_blank"
            }, "(open raw response)")
        ]
      });
  };

  render() {
    var raw_response = this.props.response.raw_response;

    var json_string = raw_response === undefined ? null :
      JSON.stringify(raw_response, undefined, 2);<commit_msg>Format the response text and link<commit_after>/// <reference path="../resources/interfaces.ts" />
import React = require("react/addons");

// TODO: Remove deprecated classSet.
var cx = React.addons.classSet;
var r = React.DOM;

/**
 * The JSON response code block.
 */
class JsonResponse extends React.Component<JsonResponse.Props, {}> {
  static create = React.createFactory(JsonResponse);

  private _renderResponseHeaderInfo = () => {
    var action = this.props.response.action;

    return action === undefined ? null :
      r.p({
        className: "json-response-info",
        children: [
          action.method + " " + this.props.response.route,
          action.method !== "GET" ? "" :
            r.a({
              className: "raw-route-link",
              href: this.props.response.route_url,
              target: "_blank"
            }, r.small({ }, " (open raw response)"))
        ]
      });
  };

  render() {
    var raw_response = this.props.response.raw_response;

    var json_string = raw_response === undefined ? null :
      JSON.stringify(raw_response, undefined, 2);
{'fraction_non_alphanumeric': 0.14226327944572748, 'fraction_numerical': 0.0009237875288683603, 'mean_word_length': 2.4711538461538463, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1761423', 'n_tokens_mistral': 618, 'n_tokens_neox': 605, 'n_words': 139}