<commit_before>/**
 * Created by <NAME> on 12/1/2016.
 */

const mongoose = require('mongoose')

const NoticeSchema = new mongoose.Schema({
  sequenceNum: {
    type: Number,
    index: true
  },
  title: String,
  publisher: String,
  publishTime: String,
  state: String,
  content: String
}, {
  toObject: {
    transform: (doc, ret) => {
      delete ret._id
    }
  }
})

const DocumentSchema = new mongoose.Schema({
  sequenceNum: {
    type: Number,
    index: true
  },
  title: {
    type: String,
    index: true
  },
  explanation: String,
  updatingTime: String,
  state: String,
  size: String,
  url: String
})

const AssignmentSchema = new mongoose.Schema({
  sequenceNum: {
    type: Number,
    index: true
  },
  title: {
    type: String,
    index: true
  },
  detail: String,
  startDate: String,
  dueDate: String,
  state: String,
  size: String,
  evaluatingTeacher: String,
  evaluatingDate: String,
  comment: String,
  grade: Number
})

const CourseSchema = new mongoose.Schema({
  courseName: {
    type: String,
    index: true
  },
  courseID: {
    type: String,
    index: true
  },
  unsubmittedOperations: Number,
  unreadNotice: Number,
  newFile: Number,
  notices: [NoticeSchema],
  documents: [DocumentSchema],
  assignments: [AssignmentSchema]
}, {
  toObject: {
    transform: (doc, ret) => {<commit_msg>simplify /courses<commit_after>/**
 * Created by <NAME> on 12/1/2016.
 */

const mongoose = require('mongoose')

const NoticeSchema = new mongoose.Schema({
  sequenceNum: {
    type: Number,
    index: true
  },
  title: String,
  publisher: String,
  publishTime: String,
  state: String,
  content: String
}, {
  toObject: {
    transform: (doc, ret) => {
      delete ret._id
    }
  }
})

const DocumentSchema = new mongoose.Schema({
  sequenceNum: {
    type: Number,
    index: true
  },
  title: {
    type: String,
    index: true
  },
  explanation: String,
  updatingTime: String,
  state: String,
  size: String,
  url: String
})

const AssignmentSchema = new mongoose.Schema({
  sequenceNum: {
    type: Number,
    index: true
  },
  title: {
    type: String,
    index: true
  },
  detail: String,
  startDate: String,
  dueDate: String,
  state: String,
  size: String,
  evaluatingTeacher: String,
  evaluatingDate: String,
  comment: String,
  grade: Number
})

const CourseSchema = new mongoose.Schema({
  courseName: {
    type: String,
    index: true
  },
  courseID: {
    type: String,
    index: true
  },
  unsubmittedOperations: Number,
  unreadNotice: Number,
  newFile: Number,
  notices: [NoticeSchema],
  documents: [DocumentSchema],
  assignments: [AssignmentSchema]
}, {
  toObject: {
    transform: (doc, ret) => {
      for (const [k, v] of Object.entries(ret)) {
        if (Array.isArray(v)) {
          delete ret[k]
        }
      }

{'fraction_non_alphanumeric': 0.1270855520056798, 'fraction_numerical': 0.004969826056088037, 'mean_word_length': 2.9247910863509747, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1315173', 'n_tokens_mistral': 965, 'n_tokens_neox': 972, 'n_words': 251}