<commit_before>import React, { PropTypes } from 'react';
import marked from 'marked';
import Model from './Model';

const Response = ({ status, response }) => {
  const { description = '', schema, headers, examples } = response;
  return (
    <div>
      <span className="blue-text">Response {status}</span>
      <div
        className="grey-text"
        dangerouslySetInnerHTML={{
          __html: marked(description),
        }}
      />
      { schema || examples ? <Model schema={schema} examples={examples}/> : null}
    </div>
  );
};

Response.propTypes = {
  status: PropTypes.string.isRequired,
  response: PropTypes.shape({
    description: PropTypes.string.isRequired,
    schema: PropTypes.object,
    headers: PropTypes.objectOf(PropTypes.shape({
      description: PropTypes.string,
      type: PropTypes.string,
    })),
    examples: PropTypes.object,
  }).isRequired,
};

export default Response;<commit_msg>ui: response status code color<commit_after>import React, { PropTypes } from 'react';
import marked from 'marked';
import classNames from 'classnames';
import Model from './Model';

const Response = ({ status, response }) => {
  const { description = '', schema, examples } = response;
  return (
    <div>
      <span className="blue-text">Response </span>
      <span
        className={classNames({
          'blue-text': status === 'default',
          'teal-text': Number(status) < 400,
          'deep-orange-text': Number(status) >= 400,
        })}
      >{status}</span>
      <div
        className="grey-text"
        dangerouslySetInnerHTML={{
          __html: marked(description),
        }}
      />
      { schema || examples ? <Model schema={schema} examples={examples}/> : null}
    </div>
  );
};

Response.propTypes = {
  status: PropTypes.string.isRequired,
  response: PropTypes.shape({
    description: PropTypes.string.isRequired,
    schema: PropTypes.object,
    headers: PropTypes.objectOf(PropTypes.shape({
      description: PropTypes.string,
      type: PropTypes.string,
    })),
    examples: PropTypes.object,
  }).isRequired,
};

export default Response;
{'fraction_non_alphanumeric': 0.1450165328294757, 'fraction_numerical': 0.002834199338686821, 'mean_word_length': 3.0342857142857143, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, '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': '4121002', 'n_tokens_mistral': 596, 'n_tokens_neox': 600, 'n_words': 140}