<commit_before>package de.avalax.fitbuddy.datalayer;

import de.avalax.fitbuddy.core.workout.Exercise;
import de.avalax.fitbuddy.core.workout.Set;
import de.avalax.fitbuddy.core.workout.Workout;
import de.avalax.fitbuddy.core.workout.basic.BasicExercise;
import de.avalax.fitbuddy.core.workout.basic.BasicSet;
import de.avalax.fitbuddy.core.workout.basic.BasicWorkout;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class FakeWorkoutDAO implements WorkoutDAO {

    @Override
    public void save(Workout workout) {
        //Nothing to do here, it's just a static workout ;-)
    }

    @Override
    public Workout load(int position) {
        if (position%2 == 0) {
            LinkedList<Exercise> exercises = new LinkedList<>();
            exercises.add(new BasicExercise("Bankdrücken", createExerciseWithThreeSets(70, 12), 5));
            exercises.add(new BasicExercise("Schrägbankdrücken", createExerciseWithThreeSets(40, 10), 5));
            exercises.add(new BasicExercise("Butterfly", createExerciseWithThreeSets(60, 15), 5));
            exercises.add(new BasicExercise("Liegestütze", createExerciseWithThreeSets(0, 30), 12.5));
            exercises.add(new BasicExercise("Lat-Ziehen hinter den Nacken", createExerciseWithThreeSets(50, 12), 5));
            exercises.add(new BasicExercise("Hochziehen der Langhantel mit enger Handstellung", createExerciseWithThreeSets(10, 12), 2.5));
            exercises.add(new BasicExercise("Klimmzüge", createExerciseWithThreeSets(60, 8), 5));
            exercises.add(new BasicExercise("Hammercurls", createExerciseWithThreeSets(30, 20), 2.5));
            exercises.add(new BasicExercise("Larry Scoot Armbeugen", createExerciseWithThreeSets(30, 12), 2.5));
            exercises.add(new BasicExercise("Situps", createExerciseWithThreeSets(0, 30), 2.5));
            return new BasicWorkout(exercises);
        } else {
            LinkedList<Exercise> exercises = new LinkedList<>();
            exercises.add(new BasicExercise("Bankdrücken", createExerciseWithThreeSets(50, 12), 5));
            exercises.add(new BasicExercise("KH-Rudern", createExerciseWithThreeSets(10, 12), 2.5));
            exercises.add(new BasicExercise("KH-Latissimus", createExerciseWithThreeSets(10, 12), 2.5));
            exercises.add(new BasicExercise("Triceps am hohen Block", createExerciseWithThreeSets(25, 12), 5));
            exercises.add(new BasicExercise("Ausfallschritte", createExerciseWithThreeSets(2, 12), 2));
            exercises.add(new BasicExercise("KH-Nackendrücken", createExerciseWithThreeSets(15, 12), 2.5));
            exercises.add(new BasicExercise("Rückenstrecker", createExerciseWithThreeSets(0, 12), 5));
            exercises.add(new BasicExercise("Crunches am Gerät", createExerciseWithThreeSets(45, 12), 5));
            return new BasicWorkout(exercises);
        }

    }

    @Override
    public String[] getWorkoutlist() {
        return new String[] {
                "Workout A",
                "Workout B",
                "Workout C",
                "Workout D",
                "Workout E"};
    }

    private List<Set> createExerciseWithThreeSets(double weight, int reps) {
        List<Set> sets = new ArrayList<>();
        sets.add(new BasicSet(weight, reps));
        sets.add(new BasicSet(weight, reps));
        sets.add(new BasicSet(weight, reps));
        return sets;
    }
}
<commit_msg>FakeWorkoutDAO more dynamic<commit_after>package de.avalax.fitbuddy.datalayer;

import de.avalax.fitbuddy.core.workout.Exercise;
import de.avalax.fitbuddy.core.workout.Set;
import de.avalax.fitbuddy.core.workout.Workout;
import de.avalax.fitbuddy.core.workout.basic.BasicExercise;
import de.avalax.fitbuddy.core.workout.basic.BasicSet;
import de.avalax.fitbuddy.core.workout.basic.BasicWorkout;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class FakeWorkoutDAO implements WorkoutDAO {

    private ArrayList<Workout> workouts;

    public FakeWorkoutDAO() {
        workouts = new ArrayList<>();
        workouts.add(fakeWorkoutOne());
        workouts.add(fakeWorkoutTwo());
    }

    @Override
    public void save(Workout workout) {
        if (!workouts.contains(workout)) {
            workouts.add(workout);
        }
    }

    @Override
    public Workout load(int position) {
        return workouts.get(position);
    }

    private Workout fakeWorkoutOne() {
        LinkedList<Exercise> exercises = new LinkedList<>();
        exercises.add(new BasicExercise("Bankdrücken", createExerciseWithThreeSets(70, 12), 5));
        exercises.add(new BasicExercise("Schrägbankdrücken", createExerciseWithThreeSets(40, 10), 5));
        exercises.add(new BasicExercise("Butterfly", createExerciseWithThreeSets(60, 15), 5));
        exercises.add(new BasicExercise("Liegestütze", createExerciseWithThreeSets(0, 30), 12.5));
        exercises.add(new BasicExercise("Lat-Ziehen hinter den Nacken", createExerciseWithThreeSets(50, 12), 5));
        exercises.add(new BasicExercise("Hochziehen der Langhantel mit enger Handstellung", createExerciseWithThreeSets(10, 12), 2.5));
        exercises.add(new BasicExercise("Klimmzüge", createExerciseWithThreeSets(60, 8), 5));
        exercises.add(new BasicExercise("Hammercurls", createExerciseWithThreeSets(30, 20), 2.5));
        exercises.add(new BasicExercise("<NAME>", createExerciseWithThreeSets(30, 12), 2.5));
        exercises.add(new BasicExercise("Situps", createExerciseWithThreeSets(0, 30), 2.5));
        BasicWorkout workout = new BasicWorkout(exercises);
        workout.setName("fake workout one");
        return workout;
    }

    private Workout fakeWorkoutTwo() {
        LinkedList<Exercise> exercises = new LinkedList<>();
        exercises.add(new BasicExercise("Bankdrücken", createExerciseWithThreeSets(50, 12), 5));
        exercises.add(new BasicExercise("KH-Rudern", createExerciseWithThreeSets(10, 12), 2.5));
        exercises.add(new BasicExercise("KH-Latissimus", createExerciseWithThreeSets(10, 12), 2.5));
        exercises.add(new BasicExercise("Triceps am hohen Block", createExerciseWithThreeSets(25, 12), 5));
        exercises.add(new BasicExercise("Ausfallschritte", createExerciseWithThreeSets(2, 12), 2));
        exercises.add(new BasicExercise("KH-Nackendrücken", createExerciseWithThreeSets(15, 12), 2.5));
        exercises.add(new BasicExercise("Rückenstrecker", createExerciseWithThreeSets(0, 12), 5));
        exercises.add(new BasicExercise("Crunches am Gerät", createExerciseWithThreeSets(45, 12), 5));
        BasicWorkout workout = new BasicWorkout(exercises);
        workout.setName("fake workout two");
        return workout;
    }

    @Override
    public String[] getWorkoutlist() {
        String[] workoutNames = new String[workouts.size()];
        for (int i=0;i<workouts.size();i++) {
            workoutNames[i] = workouts.get(i).getName();
        }
        return workoutNames;
    }

    private List<Set> createExerciseWithThreeSets(double weight, int reps) {
        List<Set> sets = new ArrayList<>();
        sets.add(new BasicSet(weight, reps));
        sets.add(new BasicSet(weight, reps));
        sets.add(new BasicSet(weight, reps));
        return sets;
    }
}

{'fraction_non_alphanumeric': 0.12300275482093664, 'fraction_numerical': 0.02630853994490358, 'mean_word_length': 3.678479381443299, 'pattern_counts': {'":': 0, '<': 21, '<?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': '6962617', 'n_tokens_mistral': 2383, 'n_tokens_neox': 2278, 'n_words': 428}