content
stringlengths
263
5.24M
pred_label
stringclasses
1 value
pred_score_pos
float64
0.6
1
## Decorator ### Instructions Now let's implement the Decorator Design Pattern ```mermaid classDiagram class Raclette { <<interface>> +getCalories()* int +getIngredients()* String } class BaseRaclette { +getCalories() int +getIngredients() String } class RacletteDecorator { <<abstract>> ...
__label__POS
0.972666
## CleanExtract ### Instructions Create a file `CleanExtract.java`. You are given a single string consisting of several substrings; each separated by a `|` character. Unfortunately, some of these substrings contain unnecessary characters that need to be removed in order to form a well-structured output string. For ...
__label__POS
0.999761
## StarMass ### Instructions For this last exercise, let's compute the mass of all objects in a galaxy, according to their type. Firstly, let's add a mass property (it will be an integer) to all objects. I let you guess the class where to add it ;) You need to add the getter and setter for this property too. You wil...
__label__POS
0.963794
## StreamCollect ### Instructions Create a file `StreamCollect.java`. Create a function `mapByFirstLetter` which maps the first letter (to upper case) to a list of Strings begining with the given letter. Create a function `getMaxByModulo4` which groups the integers by modulo 4 and returns a map associating each mo...
__label__POS
0.999384
## Chifoumi ### Prerequisite Create a file `ChifoumiAction.java` and paste the following code inside it: ```java public enum ChifoumiAction { ROCK, PAPER, SCISSOR } ``` ### Instructions Create a file `Chifoumi.java`. Write a function `getActionBeatenBy` which takes an action as a parameter, and returns the ac...
__label__POS
0.999925
## StarGetters ### Instructions Now, we will update the accessibility of the properties. In order to still have access to them, we need to implement getters and setters for each property : - `getX` and `setX` for the `x` property - `getY` and `setY` for the `y` property - `getZ` and `setZ` for the `z` property - `g...
__label__POS
0.645839
## Wedding ### Instructions Create a file `Wedding.java`. Write a function `createCouple` that returns a map of names which associates randomly a name from the first list to a name of the second list. If the lists have different sizes, some names from the bigger list will be ignored. ### Expected Functions ```ja...
__label__POS
0.999651
## IntOperations ### Instructions Create a file `IntOperations.java`. Write the following functions: - `addTwoIntegers` that returns the sum of two integers passed as parameter. - `substractTwoIntegers` that subtracts the second parameter from the first parameter, and returns the result. - `multiplyTwoIntegers` tha...
__label__POS
0.999656
## Factory ### Instructions Now let's implement the Factory Design Pattern ```mermaid classDiagram class Driver { <<abstract>> +createTransport()* Transport } class CarDriver { +createTransport() Transport } class PlaneDriver { +createTransport() Transport } class Transport { <<interface>> +getD...
__label__POS
0.965872
## Observer ### Instructions Now let's implement the Observer Design Pattern ```mermaid classDiagram class ValuePublisher { -List~NumericBaseObserver~ observers +updateState(int value) +subscribe(NumericBaseObserver observer) +unsubscribe(NumericBaseObserver observer) } class NumericBaseObserver ...
__label__POS
0.913291
## ListSearchIndex ### Instructions Create a file `ListSearchIndex.java`. Write a function `findLastIndex` that returns the last index of an element in a list. Returns null otherwise. Write a function `findFirstIndex` that returns the first index of an element in a list. Returns null otherwise. Write a function ...
__label__POS
0.999912
## SortArgs ### Instructions Create a file named `SortArgs.java`. Write a function `sort` that sorts the given array specified in the parameters and prints it to the standard output. The elements should be separated by spaces followed by a a new line character. All the given elements are valid numbers. ### Expecte...
__label__POS
0.999831
## FloatOperations ### Instructions Create a file `FloatOperations.java`. Write the following functions: - Write a function `divideTwoFloats` that returns the float division of two floats passed as parameter. - Write a function `addTwoFloats` that returns the sum of two floats passed as parameter. ### Expected Fun...
__label__POS
0.999425
## Capitalize ### Instructions Create a file named `Capitalize.java`. Write a function `capitalize` that reads the text from a file given as the first parameter and writes the result to a file given as the second parameter. ### Provided files You can find the [input](input.txt) and its [result](result.txt) files t...
__label__POS
0.999901
## AdventurAbstract ### Instructions Let's change things a bit: make the `Character` as `abstract`. You can now try to instantiate a Character object, it will fail :) Change `attack` and `takeDamage` methods : make them `abstract` too. Now, if you try to launch an example, it will fail. Indeed, you need to implemen...
__label__POS
0.957713
## RegexReplace ### Instructions Create a file `RegexReplace.java`. Write a function `removeUnits` that returns the string where the units `cm` and `€` are removed if they follow directly a number and followed by a space. Write a function `obfuscateEmail` that returns a string where parts of email addresses are repl...
__label__POS
0.998756
## ListEquals ### Instructions Create a file `ListEquals.java`. Write a function `areListsEqual` that returns true if the lists in parameters are equal. Returns false otherwise. ### Expected Functions ```java import java.util.List; public class ListEquals { public static boolean areListsEqual(List<String> lis...
__label__POS
0.999918
## SetEquals ### Instructions Create a file `SetEquals.java`. Write a function `areSetsEqual` that returns `true` if the sets as parameters are equal. Returns `false` otherwise. ### Expected Functions ```java import java.util.Set; public class SetEquals { public static boolean areSetsEqual(Set<String> set1, S...
__label__POS
0.999804
## MapEquals ### Instructions Create a file `MapEquals.java`. Write a function `areMapsEqual` that returns `true` if the maps as parameters are equal. Returns `false` otherwise. ### Expected Functions ```java import java.util.Map; public class MapEquals { public static boolean areMapsEqual(Map<String, Integer...
__label__POS
0.999618
## WeddingComplex ### Instructions Create a file `WeddingComplex.java`. Write a function `createBestCouple` that returns a map of name from the first map associated with a name from the second list. Each map argument will be composed as follows : * Key: The name of the member to marry * Value: The ordered list of ...
__label__POS
0.940821
## CatInFile ### Instructions Create a file named `CatInFile.java`. Write a function `cat` that reads from standard input and write to file given as parameter. > ⚠️ You may read from the input some binary content. > 💡 Be aware of how much you read at once. ### Expected Functions ```java import java.io.*; publi...
__label__POS
0.999849
#### Functional ##### Try to create a new user and login. ###### Can you confirm that the user was created? ##### Navigate to the homepage using the user you created. Try to erase products that were not created by the user. ###### Is it impossible to edit and delete products that were not created by your user? ###...
__label__POS
0.941414
## Custom calendar ### Instructions Create a file `custom_calendar.py` which will have 2 functions: - `day_from_number(day_number)` - `day_to_number(day)` Those functions perform conversion between day `index` and day `word`: - 1 = Monday - 2 = Tuesday - 3 = Wednesday - 4 = Thursday - 5 = Friday - 6 = Saturday - 7...
__label__POS
0.917038
## Hello Python Here starts your journey in the marvelous world of Python, a very versatile programming language, popular for being accessible for beginner programmers and yet very powerful. ### Setup First, you'll need to have Python installed on your machine. In those exercises we use Python 3.10, we then recommen...
__label__POS
0.866928
## array-selector ### Instructions Create a script `array-selector.sh`, which will have an array declared with the following values (in this order): `red`, `blue`, `green`, `white`, `black`. When executed, the script will try to print the element at the position specified in the first argument passed to the script. ...
__label__POS
0.95532
package cn.mcmod.sakura.level; import java.util.List; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.block.BlockRegistry; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.placement.PlacementUtils; import net.minecraft.resources.ResourceKey;...
__label__POS
0.904258
package cn.mcmod.sakura.recipes; import java.util.List; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import cn.mcmod_mmf.mmlib.recipe.AbstractRecipe; import cn.mcmod_mmf.mmlib.recipe.ChanceResult; import net.minecraft.core.NonNu...
__label__POS
0.919353
package cn.mcmod.sakura.recipes; import java.util.List; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import cn.mcmod_mmf.mmlib.fluid.FluidIngredient; import cn.mcmod_mmf.mmlib.recipe.AbstractRecipe; import net.minecraft.core.Non...
__label__POS
0.854818
## Read file ### Instructions Create a file `read_file.py` which will have a function `get_recipes(file_name)` that takes the `file name` as an argument. Create another file `recipes_data.json` and paste the following content on it: ```json [ { "title": "Vegetable Lasagna", "ingredients": [ "1 lb. l...
__label__POS
0.815607
package cn.mcmod.sakura.recipes; import java.util.List; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import cn.mcmod_mmf.mmlib.recipe.AbstractRecipe; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAcces...
__label__POS
0.874699
package cn.mcmod.sakura.recipes; import cn.mcmod.sakura.SakuraMod; import cn.mcmod_mmf.mmlib.recipe.AbstractRecipeSerializer; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.craf...
__label__POS
0.958083
package cn.mcmod.sakura.recipes; import java.util.List; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import cn.mcmod_mmf.mmlib.fluid.FluidIngredient; import cn.mcmod_mmf.mmlib.recipe.AbstractRecipe; import net.minecraft.core.Non...
__label__POS
0.884495
package cn.mcmod.sakura.recipes; import java.util.List; import com.google.common.collect.Lists; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import cn.mcmod_mmf.mmlib.fluid.FluidIngredient; import cn.mcmod_mmf.mmlib.recipe.AbstractRecipe; import net.minecraft.core.Non...
__label__POS
0.867434
package cn.mcmod.sakura.block; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; import net.minecraft.world.level.block.RotatedPillarBlock; import net.minecraft.world.level.block.SoundType; import net.minecraf...
__label__POS
0.630567
package cn.mcmod.sakura.block; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.block.crops.RiceCrop; import cn.mcmod.sakura.block.crops.RiceCropRoot; import cn.mcmod.sakura.block.foods.NabeBlock; import cn.mcmod.sakura.block.foods.TeishokuBlock; import cn.mcmod.sakura.block.foods.TeishokuFinishedBlock; import...
__label__POS
0.903366
## Punishment ### Instructions Often in schools we are asked to copy hundreds of sentences in order to better remember not to do something, this punishment is very old and quite boring! Hopefully we now have Python that can do the job for us. In order to do so create a file `punishment.py` which will contain a funct...
__label__POS
0.929585
## string_tokenizer_count ### Instructions Create a file `string_tokenizer_count.py` that contains a function `tokenizer_counter` which takes in a string as a parameter and returns a dictionary of words and their count in the string. - The function should remove any punctuation from the string and convert it to lowe...
__label__POS
0.999569
package cn.mcmod.sakura.block; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.tags.BlockTags; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.BlockGett...
__label__POS
0.842984
package cn.mcmod.sakura.block; import java.util.function.Supplier; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.util.RandomSource; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world....
__label__POS
0.615114
## Merge two One very useful data structure in Python are the dictionaries, in this exercise we will start to familiarize and use them. ### Instructions Create a file `merge_two.py` which will have a function named `merge_two()`. This function will accept one dictionary. It will prompt the user to create a new dicti...
__label__POS
0.760173
## Write file ### Instructions Create a file `write_file.py` which will have a function `to_do(input)` with one input as an argument `list[tuple[dt.date, str]]` which will be a to-do list like the following example: ```python [ (dt.date(2022, 6, 1), "fix the seat"), (dt.date(2022, 6, 2), "take the trash"), ]...
__label__POS
0.863569
package cn.mcmod.sakura.block; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.item.StoneMortarItem; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraf...
__label__POS
0.81494
package cn.mcmod.sakura.tags; import cn.mcmod.sakura.SakuraMod; import cn.mcmod_mmf.mmlib.utils.TagUtils; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraftforge.common.Tags; public class SakuraItemTags { public static final TagKey<Item> OFFHAND_EQUIPMENT = TagUtils.modIt...
__label__POS
1.000003
package cn.mcmod.sakura.fluid; import cn.mcmod.sakura.SakuraMod; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; import net.minecraftforge.common.SoundActions; import net.minecraftforge.fluids.Fluid...
__label__POS
0.99872
package cn.mcmod.sakura.fluid; import java.util.function.Supplier; import java.util.function.UnaryOperator; import cn.mcmod.sakura.SakuraMod; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.material.FlowingFluid; import net.minecraft.world.lev...
__label__POS
0.720163
package cn.mcmod.sakura.fluid; import cn.mcmod.sakura.SakuraMod; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LiquidBlock; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; ...
__label__POS
0.907887
package cn.mcmod.sakura.fluid; import cn.mcmod.sakura.SakuraMod; import net.minecraft.world.item.*; import net.minecraftforge.event.BuildCreativeModeTabContentsEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.DeferredRegister; ...
__label__POS
0.754803
## joker-num ### Instructions In this exercise you are going to create a guessing game. Create the script `joker-num.sh` which will receive the number to guess as argument. The number should be between 1 and 100 (inclusive). The player will then have 5 tries to guess the number. To achieve this you will have to use a...
__label__POS
0.681016
package cn.mcmod.sakura.inventory; import javax.annotation.Nonnull; import javax.annotation.Nullable; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; public class FermenterItemHandler implements IItemHandler { private static final int ...
__label__POS
0.968885
package cn.mcmod.sakura.inventory; import javax.annotation.Nonnull; import javax.annotation.Nullable; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; public class CookingPotItemHandler implements IItemHandler { private static final int...
__label__POS
0.969184
package cn.mcmod.sakura.inventory; import javax.annotation.Nonnull; import javax.annotation.Nullable; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; public class StoneMortarItemHandler implements IItemHandler { private static final in...
__label__POS
0.965047
package cn.mcmod.sakura.container; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; import cn.mcmod.sakura.block.entity.StoneMortarBlockEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandle...
__label__POS
0.988762
package cn.mcmod.sakura.container; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; import cn.mcmod.sakura.block.entity.CookingPotBlockEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler...
__label__POS
0.98888
package cn.mcmod.sakura.container; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; import cn.mcmod.sakura.block.entity.DistillerBlockEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler;...
__label__POS
0.988741
package cn.mcmod.sakura.container; import cn.mcmod.sakura.SakuraMod; import net.minecraft.world.inventory.MenuType; import net.minecraftforge.common.extensions.IForgeMenuType; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registri...
__label__POS
0.996813
package cn.mcmod.sakura.container; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; import cn.mcmod.sakura.block.entity.FermenterBlockEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler;...
__label__POS
0.988916
package cn.mcmod.sakura.loot_modifier; import cn.mcmod.sakura.item.FoodRegistry; import cn.mcmod.sakura.item.enums.SakuraFoodSet; import cn.mcmod.sakura.loot_modifier.SeedsDrop.SeedDropModifier; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import it.unimi.dsi.fast...
__label__POS
0.923659
package cn.mcmod.sakura.loot_modifier; import java.util.List; import javax.annotation.Nonnull; import com.google.common.collect.Lists; import cn.mcmod.sakura.item.ItemRegistry; import com.mojang.serialization.*; import com.mojang.serialization.codecs.RecordCodecBuilder; import it.unimi.dsi.fastutil.objects.ObjectAr...
__label__POS
0.948867
package cn.mcmod.sakura.item; import java.util.Map; import java.util.function.Supplier; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.item.enums.SakuraCuisineSet; import cn.mcmod.sakura.item.enums.SakuraFoodSet; import cn.mcmod_mmf.mmlib.item.ItemFoodBase; import cn.mcmod_mmf.mmlib.item.info.FoodInfo; impo...
__label__POS
0.852704
## flex_function ### Instructions Create a file `flex_function.py` that contains a function `create_person` which takes in first name and last name as required positional parameters, age and gender as positional or keyword parameters, size and job as keyword only parameters, with size and job default values: size=1.8...
__label__POS
0.967018
package cn.mcmod.sakura.item; import java.util.function.Consumer; import javax.annotation.Nonnull; import com.mojang.blaze3d.vertex.PoseStack; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.block.BlockRegistry; import cn.mcmod.sakura.block.entity.BlockEntityRegistry; import cn.mcmod.sakura.block.entity.St...
__label__POS
0.776615
package cn.mcmod.sakura.item; import java.util.Map; import java.util.function.Supplier; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.block.BlockRegistry; import cn.mcmod.sakura.item.enums.SakuraNormalItemSet; import cn.mcmod_mmf.mmlib.item.ItemFoodSeeds; import cn.mcmod_mmf.mmlib.item.info.FoodInfo; impor...
__label__POS
0.940248
## division ### Instructions In this exercise, you will make a script `division.sh` that will take two arguments from the command line, and divide the first one by the second one. If there is a remainder after doing the division, it should be ignored. You will need to handle what to do when the inputs are wrong: -...
__label__POS
0.82118
package cn.mcmod.sakura.item; import cn.mcmod_mmf.mmlib.item.IFoodLike; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.ComposterBlock; public class ComposterRegistry { public static void registerCompost() { FoodRegistry.ITEMS.getEntries().forEach( item->{ registe...
__label__POS
0.909609
package cn.mcmod.sakura.events; import java.util.function.Supplier; import cn.mcmod.sakura.block.BlockItemRegistry; import cn.mcmod.sakura.item.ItemRegistry; import cn.mcmod.sakura.item.enums.SakuraNormalItemSet; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraftforg...
__label__POS
0.883008
package cn.mcmod.sakura.events; import cn.mcmod.sakura.block.BlockRegistry; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.common.ToolActions; import net.m...
__label__POS
0.813088
## Numerical operations: the return! ### Instructions Create a file `numerical_operations_the_return.py` containing the following functions: - `modulo(a, b)` - `divide(a, b)` - `integer_division(a, b)` We assume that `a` and `b` are numbers (`int` or `float`). > In case of a division by zero or modulo zero your fu...
__label__POS
0.90449
## Clean the list ### Instructions Create a file `clean_the_list.py` that contains a function `clean_list` which takes and returns a list of strings and performs the following operations on each list item: - Removes all spaces before and after (but not between words). - Capitalizes the first letter (first letter on...
__label__POS
0.929792
package cn.mcmod.sakura.data; import cn.mcmod.sakura.tags.SakuraBiomeTags; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.BiomeTagsProvider; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biomes; import net.minecraftfor...
__label__POS
0.902711
## object_to_json A lot of information on the web are shared in the JSON format. This exercise will be about transforming object to JSON and vice-versa. ### Instructions You just landed a new job, congrats! Your new task is to build two functions to allow new users to register to your new shiny website. The new reg...
__label__POS
0.803898
## String processing ### Instructions Tokenization is the process of breaking down a string into smaller pieces, called tokens. In natural language processing, tokenization typically refers to the process of breaking down a sentence into words or breaking down a paragraph into sentences. Create a file `string_proces...
__label__POS
0.977926
package cn.mcmod.sakura.data; import cn.mcmod.sakura.data.loot.SakuraBlockLoot; import net.minecraft.data.PackOutput; import net.minecraft.data.loot.LootTableProvider; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import java.util.List; import java.util.Set; public class SakuraLootTa...
__label__POS
0.978248
package cn.mcmod.sakura.data; import cn.mcmod.sakura.block.BlockRegistry; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.tags.BlockTags; import net.minecraftforge.common.data.BlockTagsProvider; import net.minecraftforge.common.data.ExistingFileHelper; import java.ut...
__label__POS
0.897411
package cn.mcmod.sakura.data; import cn.mcmod.sakura.fluid.FluidRegistry; import cn.mcmod.sakura.tags.SakuraFluidTags; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.FluidTagsProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.ta...
__label__POS
0.782082
package cn.mcmod.sakura.level.tree; import java.util.ArrayList; import java.util.List; import java.util.OptionalInt; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.block.BlockRegistry; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; import net.minecraft.resources...
__label__POS
0.9868
package cn.mcmod.sakura.level.tree; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceKey; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; import net.minecraft.world.level.block.grower.AbstractTreeGrower; import net.minecraft.world.level.block.state.Block...
__label__POS
0.930307
## shopping ### Instructions Create a file `shopping.py` with a function `remember_the_apple(shopping_list)`. This function input is a list of strings, like this: ```python ['tomatoes', 'pastas', 'apple', 'salt'] ``` If the string `'apple'` is not in the list, it should be added. The function return the updated li...
__label__POS
0.999939
## skip_secrets ### Instructions You need to write a script, `skip_secrets.py`, that will be able to decrypt the text coming form a specific file. The script will receive a file name as the first argument, check if the file is readable, filter the content by skipping all the lines containing `pineapple` and save the...
__label__POS
0.931241
package cn.mcmod.sakura.client.layers; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.client.render.StoneMortarRenderer; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client....
__label__POS
0.981063
package cn.mcmod.sakura.client.particle; import cn.mcmod.sakura.SakuraMod; import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.SimpleParticleType; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.reg...
__label__POS
0.993581
package cn.mcmod.sakura.client.gui; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.container.ContainerRegistry; import net.minecraft.client.gui.screens.MenuScreens; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; ...
__label__POS
0.83693
## credentials_searches ### Instructions Create a file `credentials_searches.py` that contains a function `credentials_search` which takes no parameters and searches for the keys `password` and `secret` in a file called `logs.json`. - If both keys are found, the function should create a new json file named `credenti...
__label__POS
0.940547
package cn.mcmod.sakura.client.gui; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.container.StoneMortarContainer; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.network.chat.Component; import net.minecraft.resource...
__label__POS
0.685439
## grades ### Instructions Create a script `grades.sh` which will ask, as an argument, for the user to give a specific number of students in order to evaluate them. After the number is set, the script will ask you to introduce the "names" and "grades" of the persons you wish to evaluate. The grades will have a range...
__label__POS
0.653546
package cn.mcmod.sakura.block.crops; import cn.mcmod.sakura.block.BlockRegistry; import cn.mcmod.sakura.item.ItemRegistry; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.LevelReader; import net.minecraft.worl...
__label__POS
0.779002
package cn.mcmod.sakura.block.entity; import cn.mcmod.sakura.SakuraMod; import cn.mcmod.sakura.block.BlockRegistry; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.regis...
__label__POS
0.993615
#### General ##### Check the Repo content: Files that must be inside the repository: - CI/CD pipeline configuration files, scripts, and any other required artifacts. - An Ansible playbook and used scripts for deploying and configuring a GitLab instance. - A well-documented README file that explains the pipeline desi...
__label__POS
0.66688
package cn.mcmod.sakura.block.entity; import javax.annotation.Nonnull; import javax.annotation.Nullable; import cn.mcmod_mmf.mmlib.block.entity.SyncedBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; i...
__label__POS
0.900342
#### General ##### Ask the student to describe what they have done to prepare for the DevOps Institute Foundation Examination. ###### Did the student utilize the recommended study materials for the exam? ###### Was the student familiar with the DevOps Institute DevOps Foundation Exam Guide? ###### Did the student r...
__label__POS
0.841504
package cn.mcmod.sakura.item.enums; public enum SakuraNormalItemSet { BAMBOO("bamboo"), BAMBOO_SUNBURNT("bamboo_sunburnt"), BAMBOO_CHARCOAL("bamboo_charcoal"), LUMBER_BAMBOO("lumber_bamboo"), LUMBER_SAKURA("lumber_sakura"), LUMBER_MAPLE("lumber_maple"), STRAW("straw"), CHARCOAL_POWDER("...
__label__POS
0.990932
package cn.mcmod.sakura.data.client; import cn.mcmod.sakura.block.BlockRegistry; import cn.mcmod_mmf.mmlib.data.AbstractBlockStateProvider; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.min...
__label__POS
0.878309
## Introduction Following are examples of SQL queries to help you get you started. ## Examples of SQL queries ### Sign up The following query returns the users that are currently in the sign up process. ```sql SELECT DISTINCT u.id, u."githubLogin", u.attrs ->> 'email' as email, u.attrs ->> 'image' ...
__label__POS
0.844913
using ProgressMeter using ReTestItems export evaluation function evaluation(model, temperature=0.0; is_force=true) src_parent_dir = joinpath(@__DIR__, "..", "generations", model, string(temperature)) @showprogress desc = "[$model]Evaluating..." for s in readdir(src_parent_dir) generation_dir = joinpat...
__label__POS
0.857341
""" max_fill(grid::Vector{Vector{Int}}, capacity::Int)::Int You are given a rectangular grid of wells. Each row represents a single well, and each 1 in a row represents a single unit of water. Each well has a corresponding bucket that can be used to extract water from it, and all buckets have the same capacity. Yo...
__label__POS
0.998314
""" pluck(xs::Vector{Int})::Vector{Int} Given an array representing a branch of a tree that has non-negative integer nodes your task is to pluck one of the nodes and return it. The plucked node should be the node with the smallest even value. If multiple nodes with the same smallest even value are found return the...
__label__POS
0.981879
""" tri(n::Int)::Vector{Int} Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in the last couple centuries. However, what people don't know is Tribonacci sequence. Tribonacci sequence is defined by the recurrence: tri(1) = 1 tri(n) = 1 + n / 2, if n is even. tri(n) = tri(n - 1) + tri(...
__label__POS
0.84382
""" get_odd_collatz(n::Int)::Vector{BigInt} Given a positive integer `n`, return a sorted list that has the odd numbers in collatz sequence. The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined as follows: start with any positive integer n. Then each term is obtained from the pre...
__label__POS
0.997686
""" valid_date(date::String)::Bool You have to write a function which validates a given date string and returns `true` if the date is valid otherwise `false` The date is valid if all of the following rules are satisfied: 1. The date string is not empty. 2. The number of days is not less than 1 or higher than 31...
__label__POS
0.836309
""" bf(planet1::String, planet2::String)::NTuple There are eight planets in our solar system: the closerst to the Sun is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn, Uranus, Neptune. Write a function that takes two planet names as strings `planet1` and `planet2`. The function should return a ...
__label__POS
0.895112
""" skjkasdkd(xs::Vector{Int})::Int You are given a list of integers. You need to find the largest prime value and return the sum of its digits. # Examples ```jldoctest julia> skjkasdkd([0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3]) 10 julia> skjkasdkd([1, 0, 1, 8, 2, 4597, 2, 1, 3, ...
__label__POS
0.998637