<commit_before>import React, { Component, PropTypes } from 'react';
import Annotation from './Annotation';
import AddAnnotation from './AddAnnotation';
import Can, { can } from '../Can';

class Annotations extends Component {
  render() {
    const props = this.props;
    
    return (
      <div>
        <ul className="annotations-list">
        {props.annotations.map(function(annotation) {
          return (
            <li><Annotation annotation={annotation.node} annotated={props.annotated} annotatedType={props.annotatedType} /></li>
          );
        })}
        </ul>

        {props.annotatedType === 'Media' ? ( // TODO: remove to support Source as well
          <Can permissions={props.annotated.permissions} permission={`update ${props.annotatedType}`}>
            <AddAnnotation annotated={props.annotated} annotatedType={props.annotatedType} types={props.types} />
          </Can>
        ) : <AddAnnotation annotated={props.annotated} annotatedType={props.annotatedType} types={props.types} />}
      </div>
    );
  }
}

export default Annotations;<commit_msg>Use correct create annotation permission<commit_after>import React, { Component, PropTypes } from 'react';
import Annotation from './Annotation';
import AddAnnotation from './AddAnnotation';
import Can, { can } from '../Can';

class Annotations extends Component {
  render() {
    const props = this.props;
    
    return (
      <div>
        <ul className="annotations-list">
        {props.annotations.map(function(annotation) {
          return (
            <li><Annotation annotation={annotation.node} annotated={props.annotated} annotatedType={props.annotatedType} /></li>
          );
        })}
        </ul>

        {props.annotatedType === 'Media' ? ( // TODO: remove to support Source as well
          <Can permissions={props.annotated.permissions} permission='create Comment'>
            <AddAnnotation annotated={props.annotated} annotatedType={props.annotatedType} types={props.types} />
          </Can>
        ) : <AddAnnotation annotated={props.annotated} annotatedType={props.annotatedType} types={props.types} />}
      </div>
    );
  }
}

export default Annotations;
{'fraction_non_alphanumeric': 0.13761467889908258, 'fraction_numerical': 0.0, 'mean_word_length': 3.0388888888888888, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '3093097', 'n_tokens_mistral': 599, 'n_tokens_neox': 567, 'n_words': 133}