instruction
stringclasses
10 values
inputs
dict
outputs
stringlengths
52
1.61k
meta
dict
There is a task context: {left_context} Write the contents of the last function after the argument header. The response expects only the body of one function. Do not add new functions or classes to the response, try to use those already in the context or imported at the very beginning. Maintain code indentation and fo...
{ "left_context": "/*\n * MIT License\n *\n * Copyright (c) 2025 Volodya Lombrozo\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitati...
return new Xnav(this.xml.child(name)); }
{ "id": 0, "repo": "volodya-lombrozo/xnav", "base_commit": "7b9af2698add7bae670d7a06fcdf6b52c140063b", "gt": " return new Xnav(this.xml.child(name));\n }", "stub": " return null;\n }", "right_context": "\n\n /**\n * Get all child nodes by their name.\n *\n * @param filters...
Given the context before the function: ```java {left_context} ``` Write the **content** of the last method immediately after the signature. The answer should be limited to this method. Place your answer within the tag: ```java your answer code ``` Try to maintain the same indentation and formatting as the context. Do...
{ "left_context": "package com.comp301.a06image;\n\nimport java.awt.Color;\n\n/**\n * This class implements the Image interface and represents an image with a border around it. The\n * border is a specified thickness and color. The border is drawn around the entire image, so the\n * width and height of the image are ...
// Get the width and height of the image int width = this.getWidth(); int height = this.getHeight(); // Early check for out-of-bounds coordinates to throw an exception for invalid coordinates if (x < 0 || y < 0 || x >= width || y >= height) { throw new IllegalArgumentException( "Pix...
{ "id": 1, "repo": "hoangsonww/Software-Design-Patterns", "base_commit": "6d0784d1108ce1a638a585b9126bfff7d3e12b56", "gt": " // Get the width and height of the image\n int width = this.getWidth();\n int height = this.getHeight();\n\n // Early check for out-of-bounds coordinates to throw an exception...
Here is the beginning of the file: {left_context} Your task is to write the contents of the last function in the file after the signature. Your answer should consist of the body of this function. Do not invent additional functions and classes, but you can use those that are in the file or imported at the very beginnin...
{ "left_context": "package com.comp301.a06image;\n\nimport java.awt.Color;\n\n/**\n * The ZoomDecorator class is an Image decorator that zooms in on a base image. The zoom factor is\n * defined by a multiplier. The width and height of the image are increased by the multiplier, and\n * the color of a pixel can be retr...
// Check for invalid arguments (out-of-bounds coordinates) // Throw an exception for invalid coordinates if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) { throw new IllegalArgumentException( "Pixel coordinates (" + x + ", " + y + ") are out of bounds."); } int originalX =...
{ "id": 2, "repo": "hoangsonww/Software-Design-Patterns", "base_commit": "6d0784d1108ce1a638a585b9126bfff7d3e12b56", "gt": " // Check for invalid arguments (out-of-bounds coordinates)\n // Throw an exception for invalid coordinates\n if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) {\n t...
Use the following code: {left_context} Write the contents of the last function after the argument header. Do not invent new functions or classes, but you can use existing ones. The answer consists of a single function. Place the answer in the following block: ```java function body ``` maintain indentation and formatti...
{ "left_context": "package com.comp301.a06image;\n\nimport java.awt.Color;\n\n/**\n * The CircleDecorator class is an Image decorator that draws a circle on top of a base image. The\n * circle is defined by a center point, a radius, and a color. If a point is within the circle, the\n * circle's color is returned. Oth...
// If the point is within the circle, return the circle's color if (isWithinCircle(x, y) == true) { return this.color; } // Otherwise, return the base image's color return this.baseImage.getPixelColor(x, y); }
{ "id": 3, "repo": "hoangsonww/Software-Design-Patterns", "base_commit": "6d0784d1108ce1a638a585b9126bfff7d3e12b56", "gt": " // If the point is within the circle, return the circle's color\n if (isWithinCircle(x, y) == true) {\n return this.color;\n }\n\n // Otherwise, return the base image's c...
Based on the following example: {left_context} From here (i.e., after the signature), continue the function body until it completes. The answer should include only this function. Do not invent new functions or classes; instead, try to use the existing code from the example (including the imports from the beginning). Fo...
{ "left_context": "package com.comp301.a06image;\n\nimport java.awt.Color;\n\n/**\n * The SolidColorImage class is an Image implementation that represents an image with a solid color.\n * The image is defined by a width, a height, and a color. The color of a pixel can be retrieved by\n * calling the getPixelColor met...
// Check for invalid arguments (negative x or y, or out-of-bounds x or y) if (x < 0) { throw new IllegalArgumentException("Pixel x-coordinate must be non-negative."); } if (y < 0) { throw new IllegalArgumentException("Pixel y-coordinate must be non-negative."); } if (x >= this.widt...
{ "id": 4, "repo": "hoangsonww/Software-Design-Patterns", "base_commit": "6d0784d1108ce1a638a585b9126bfff7d3e12b56", "gt": " // Check for invalid arguments (negative x or y, or out-of-bounds x or y)\n if (x < 0) {\n throw new IllegalArgumentException(\"Pixel x-coordinate must be non-negative.\");\n ...
Here is part of the file: ```java {left_context} ``` From here, write the body of the last function without the signature. You can use functions and classes from the file in your response, including those imported at the very beginning of the file. Important: do not invent new functions or classes. Your response should...
{ "left_context": "package com.comp301.a06image;\n\nimport java.awt.Color;\n\n/**\n * The SquareDecorator class is an Image decorator that draws a square on top of a base image. The\n * square is defined by a top-left corner point, a side length, and a color. If a point is within\n * the square, the square's color is...
// Get the dimensions of the square int squareXDimension = this.squareX + this.squareSize; int squareYDimension = this.squareY + this.squareSize; // If the point is within the square, return the square's color if (x >= this.squareX && x < squareXDimension && y >= this.squareY && y < squareYDimensio...
{ "id": 5, "repo": "hoangsonww/Software-Design-Patterns", "base_commit": "6d0784d1108ce1a638a585b9126bfff7d3e12b56", "gt": " // Get the dimensions of the square\n int squareXDimension = this.squareX + this.squareSize;\n int squareYDimension = this.squareY + this.squareSize;\n\n // If the point is wi...
Here is the beginning of the file: {left_context} Write the contents of the last method (without the signature). Only this method is needed in the answer. You can use methods and classes from the file (but do not create new ones) and the contents of the imports from the beginning of the file. Place the entire answer i...
{ "left_context": "package com.accenture.shopsystem.controllers;\n\nimport com.accenture.shopsystem.domain.Vendedor.Vendedor;\nimport com.accenture.shopsystem.services.email.EmailService;\nimport com.accenture.shopsystem.dtos.email.EmailDto;\nimport com.accenture.shopsystem.repositories.VendedorRepository;\nimport io...
String nome = principal.getAttribute("name"); String email = principal.getAttribute("email"); // Verifica se o vendedor já existe no banco if (vendedorRepository.findByEmail(email).isEmpty()) { Vendedor vendedor = new Vendedor(); vendedor.setVendedorNome(nome); ...
{ "id": 6, "repo": "RonildoLima/ShopSystem", "base_commit": "ea204aa9b2cbdc02b01c02692dfb82b29f543813", "gt": " String nome = principal.getAttribute(\"name\");\n String email = principal.getAttribute(\"email\");\n\n // Verifica se o vendedor já existe no banco\n if (vendedorRepositor...
Here is your task: {left_context} Continue writing the last method (function) after the argument header. Your answer should contain only the contents of this method. You can use functions and classes that are already declared or imported at the very beginning, but do not add new ones to your answer. Format your answer...
{ "left_context": "package com.accenture.shopsystem.domain.Pedido;\n\nimport com.accenture.shopsystem.domain.PedidoTemProdutos.PedidoTemProdutos;\nimport com.accenture.shopsystem.domain.Vendedor.Vendedor;\nimport com.fasterxml.jackson.annotation.JsonFormat;\nimport jakarta.persistence.*;\nimport lombok.AllArgsConstru...
return "Pedido{" + "id='" + id + '\'' + ", pedidoDescricao='" + pedidoDescricao + '\'' + ", pedidoValor=" + pedidoValor + ", pedidoQuantidade=" + pedidoQuantidade + '}'; }
{ "id": 7, "repo": "RonildoLima/ShopSystem", "base_commit": "ea204aa9b2cbdc02b01c02692dfb82b29f543813", "gt": " return \"Pedido{\" +\n \"id='\" + id + '\\'' +\n \", pedidoDescricao='\" + pedidoDescricao + '\\'' +\n \", pedidoValor=\" + pedidoValor +\n ...
Here is a code example: {left_context} Write the contents of the last function. Start your answer where the example ends. The answer must consist only of the body of this function. Adding new functions and classes is not allowed. You can use adjacent functions and classes from the example in your answer, including tho...
{ "left_context": "package com.accenture.shopsystem.controllers.vendedor;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport com.accenture.shopsystem.domain.Vendedor.Vendedor;\nimport com.accenture.shopsystem.dtos.vendedor.VendedorRequestDTO;\nimport com.accenture.shopsystem.repositories.VendedorRep...
logger.info("Recuperando lista de todos os vendedores"); try { Iterable<Vendedor> vendedores = vendedorRepository.findAll(); logger.info("Lista de vendedores recuperada com sucesso"); return ResponseEntity.ok(vendedores); } catch (Exception e) { l...
{ "id": 8, "repo": "RonildoLima/ShopSystem", "base_commit": "ea204aa9b2cbdc02b01c02692dfb82b29f543813", "gt": " logger.info(\"Recuperando lista de todos os vendedores\");\n\n try {\n Iterable<Vendedor> vendedores = vendedorRepository.findAll();\n logger.info(\"Lista de vended...
In the example below, write the contents of the last function after the argument header. Do not invent new functions or classes; you can use those already in the example or those imported. Try to maintain the same indentation and formatting as in the example. Here is the example: {left_context} Format the rest of the ...
{ "left_context": "package use_case.set_targetaudience;\n\nimport org.json.JSONException;\n\n/**\n * Public class for the Target Audience Interactor.\n */\npublic class TargetAudienceInteractor implements TargetAudienceInputBoundary {\n\n private final TargetAudienceDataAccessInterface dataAccessObject;\n priva...
if (inputData == null) { throw new IllegalArgumentException("inputData must not be null"); } String response = ""; final String systemMessage = """ Based on the name and description of this project, I want you to give me a list of five \ categories of ...
{ "id": 9, "repo": "cemreboz/Pitch-t", "base_commit": "da4af08d4d347a76f16a2411afeef0f1d19c174e", "gt": " if (inputData == null) {\n throw new IllegalArgumentException(\"inputData must not be null\");\n }\n String response = \"\";\n final String systemMessage = \"\"\"\n ...
There is a task context: {left_context} Write the contents of the last function after the argument header. The response expects only the body of one function. Do not add new functions or classes to the response, try to use those already in the context or imported at the very beginning. Maintain code indentation and fo...
{ "left_context": "package cn.iocoder.yudao.framework.common.util.json;\n\nimport cn.hutool.core.util.ArrayUtil;\nimport cn.hutool.core.util.StrUtil;\nimport cn.hutool.json.JSONUtil;\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.core.type.TypeReference;\nimport com.fasterxml.jack...
if (StrUtil.isEmpty(text)) { return null; } try { return objectMapper.readValue(text, clazz); } catch (IOException e) { log.error("json parse err,json:{}", text, e); throw new RuntimeException(e); } }
{ "id": 10, "repo": "jeelowcode/jeelowcode", "base_commit": "4be9b5d3de6ef44a165508ae4c981addce35308f", "gt": " if (StrUtil.isEmpty(text)) {\n return null;\n }\n try {\n return objectMapper.readValue(text, clazz);\n } catch (IOException e) {\n log.err...