def test_invalid_level(self): with self.assertRaises(ValueError): exercise.Exercise(self.correct_title, self.correct_description, self.correct_category_id, self.correct_is_default, self.correct_target_sets, self.correct_measurement_type, "11")
def get_exercise(self, exercise_id): """ Get a new instance of the named Exercise object Throws: KeyError if the named exercise_id doesn't exist. """ (name, desc, tips) = self.exercises[exercise_id] return exercise.Exercise(name, desc, tips)
def parse_file(file_name): exercises = [] with open(file_name) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') # skip header next(csv_reader) for row in csv_reader: e = exercise.Exercise(row[0], row[1], row[2], row[3], row[4], row[5], row[6]) exercises.append(e) return exercises
def test_correct(self): exercise.Exercise(self.correct_title, self.correct_description, self.correct_category_id, self.correct_is_default, self.correct_target_sets, self.correct_measurement_type, self.correct_level)
import sys, ast import loadmovielens as reader import decimal import exercise """ ============================================ DO NOT FORGET TO INCLUDE YOUR STUDENT ID ============================================ """ student_ID = '014632888' "load the data into python" e = exercise.Exercise() def my_info(): """ :return: DO NOT FORGET to include your student ID as a string, this function is used to evaluate your code and results """ return student_ID def Jaccard_Coefficient(movie_id_1, movie_id_2): """ :param movie_id_1: (integer) id regarding the first movie :param movie_id2: (integer) id regarding the second movie :return: (float) Jaccard_Coefficient regarding these movies based on the given movie IDs ROUND OFF TO THREE DECIMAL DIGITS """ coefficient = e.get_jacobian_coefficient_from_ids(movie_id_1, movie_id_2)