<commit_before>import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import _ from 'lodash';

import CourseUtils from '../../utils/course_utils.js';
import Feedback from '../common/feedback.jsx';

const userLink = (wiki, assignment) => {
  if (!wiki) {
    return <div key={`assignment_${assignment.id}`}>{assignment.username}</div>;
  }
  const link = `https://${wiki.language}.${wiki.project}.org/wiki/User:${assignment.username}`;
  return <a key={`assignment_${assignment.id}`} href={link} target="_blank">{assignment.username}</a>;
};

const Assignment = createReactClass({
  displayName: 'Assignment',
  propTypes: {
    article: PropTypes.object,
    assignmentGroup: PropTypes.array,
    course: PropTypes.object,
    current_user: PropTypes.object,
    wikidataLabel: PropTypes.string
  },
  render() {
    if (!this.props.course.home_wiki) { return <div />; }
    const article = this.props.article || CourseUtils.articleFromAssignment(this.props.assignmentGroup[0], this.props.course.home_wiki);
    if (!article.formatted_title) {
      article.formatted_title = CourseUtils.formattedArticleTitle(article, this.props.course.home_wiki, this.props.wikidataLabel);
    }
    const className = 'assignment';
    const ratingClass = `rating ${article.rating}`;
    const ratingMobileClass = `${ratingClass} tablet-only`;
    const articleLink = <a onClick={this.stop} href={article.url} target="_blank" className="inline">{article.formatted_title}</a>;
    const assignees = [];
    const reviewers = [];
    const iterable = _.sortBy(this.props.assignmentGroup, 'username');
    for (let i = 0; i < iterable.length; i += 1) {
      const assignment = iterable[i];
      if (assignment.role === 0 && assignment.user_id && assignment.username) {
        const usernameLink = userLink(this.props.course.home_wiki, assignment);
        assignees.push(usernameLink);
        assignees.push(', ');<commit_msg>Fix Assignee user page links for Wikidata<commit_after>import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import _ from 'lodash';

import CourseUtils from '../../utils/course_utils.js';
import Feedback from '../common/feedback.jsx';

const userLink = (wiki, assignment) => {
  if (!wiki) {
    return <div key={`assignment_${assignment.id}`}>{assignment.username}</div>;
  }
  const link = `https://${wiki.language || 'www'}.${wiki.project}.org/wiki/User:${assignment.username}`;
  return <a key={`assignment_${assignment.id}`} href={link} target="_blank">{assignment.username}</a>;
};

const Assignment = createReactClass({
  displayName: 'Assignment',
  propTypes: {
    article: PropTypes.object,
    assignmentGroup: PropTypes.array,
    course: PropTypes.object,
    current_user: PropTypes.object,
    wikidataLabel: PropTypes.string
  },
  render() {
    if (!this.props.course.home_wiki) { return <div />; }
    const article = this.props.article || CourseUtils.articleFromAssignment(this.props.assignmentGroup[0], this.props.course.home_wiki);
    if (!article.formatted_title) {
      article.formatted_title = CourseUtils.formattedArticleTitle(article, this.props.course.home_wiki, this.props.wikidataLabel);
    }
    const className = 'assignment';
    const ratingClass = `rating ${article.rating}`;
    const ratingMobileClass = `${ratingClass} tablet-only`;
    const articleLink = <a onClick={this.stop} href={article.url} target="_blank" className="inline">{article.formatted_title}</a>;
    const assignees = [];
    const reviewers = [];
    const iterable = _.sortBy(this.props.assignmentGroup, 'username');
    for (let i = 0; i < iterable.length; i += 1) {
      const assignment = iterable[i];
      if (assignment.role === 0 && assignment.user_id && assignment.username) {
        const usernameLink = userLink(this.props.course.home_wiki, assignment);
        assignees.push(usernameLink);
        assignees.push(', ');
{'fraction_non_alphanumeric': 0.15229957275697412, 'fraction_numerical': 0.0020105554159336515, 'mean_word_length': 4.371120107962213, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, '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': '5998431', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1212, 'n_words': 247}