source stringclasses 1
value | task_type stringclasses 1
value | in_source_id stringlengths 40 40 | instruction_seed stringlengths 440 3.8k | gold_standard_solution stringlengths 15 4.44k | verification_info stringclasses 1
value | metadata stringlengths 70 81 | problem_id stringlengths 5 9 | _source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
commitpack | llm_judgeable_groundtruth_similarity | b4b210373a9cdc0df5bdb7cf577320c328520f72 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the IpGetterTest.kt file to fix the test by changing the plugin application to use IpGetter::class.java, update the type assertion for 'localIpOr' to Closure::class.java, a... | ```Kotlin
package com.brunodles.ipgetter
import com.brunodles.oleaster.suiterunner.OleasterSuiteRunner
import com.brunodles.test.helper.context
import com.brunodles.test.helper.given
import com.mscharhag.oleaster.runner.StaticRunnerSupport.beforeEach
import com.mscharhag.oleaster.runner.StaticRunnerSupport.it
import g... | {'judging_instructions': ''} | {'language': 'Kotlin', 'diff_stats': {'total_changes': 7, 'operations': 6}} | jdg_66375 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 1e6fcb420c0cd3c41afd8a91ec020b6e15cf1973 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Django views by adding a login restriction to a chatroom feature. Implement a view function that retrieves messages from the database, orders them by date, and renders... | ```Python
from django.shortcuts import render
from django.http import HttpResponse, Http404
from .models import Message
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required
def chatroom(request):
messages = Message.objects.order_by('date')
context = {'messages': ... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 9, 'operations': 2}} | jdg_46793 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 94c2a97bf926e01ae68730ffdb92a9d1439b3dcc |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the `PipelineStatusUpdateTask` class to maintain the scroll position in the data source and sink lists. Instead of replacing the adapter each time the list is updated, ke... | ```Java
package com.openxc.enabler;
import java.util.TimerTask;
import android.app.Activity;
import com.openxc.VehicleManager;
import android.widget.ListView;
import android.widget.ArrayAdapter;
public class PipelineStatusUpdateTask extends TimerTask {
private VehicleManager mVehicleManager;
private Activit... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 19, 'operations': 3}} | jdg_18035 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 2353c00e76d841b10e7c27750c4ce973d536f453 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the manage.py script by adding a new command to remove all .pyc files from the project directory. Implement this functionality using the Flask-Script manager and ensure it... | ```Python
# Set the path
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from flask.ext.script import Manager, Server
from maproulette import app
manager = Manager(app)
# Turn on debugger by default and reloader
manager.add_command("runserver", Server(
use_debugger ... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 6, 'operations': 1}} | jdg_66557 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 5a0796804eb1a15c40ed6cb3f0310e4ffea6ce5b |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the existing HtmlSafeI18nExceptionHandler class to handle exceptions more robustly by checking if the exception is a MissingTranslation type and ensuring HTML escaping for... | ```Ruby
if ::Rails::VERSION::MAJOR == 3 ||
(::Rails::VERSION::MAJOR == 4 && ::Rails::VERSION::MINOR == 0)
require 'i18n'
# Override exception handler to more carefully html-escape missing-key results.
class HtmlSafeI18nExceptionHandler
Missing = I18n.const_defined?(:MissingTranslation) ? I18n::MissingTra... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 14, 'operations': 3}} | jdg_28094 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 0137da853166c5837bb83df9910ef7ab28d33955 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the `echo` method in the Gearman Client class to remove the timeout mechanism and add error handling for socket connection failures. Ensure that the code handles socket rea... | ```Ruby
require 'timeout'
module Gearman
class Client
PACK = 'NN'
UNPACK = 'a4NN'
def echo(data)
echo_req_packet_type = 16
echo_req_packet_magic = "\0REQ"
echo_req_packet_meta = [echo_req_packet_type, data.size].pack(PACK)
echo_req_packet = [
echo_req_packet_magic,
... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 19, 'operations': 6}} | jdg_17310 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 356c9cd23ebf4953af169f38126fd521b49ca6c4 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the AbstractScraper class by adding descriptive docstrings to each method. The docstrings should explain the purpose and expected behavior of each method, such as retrievi... | ```Python
from urllib import request
from bs4 import BeautifulSoup
class AbstractScraper():
def __init__(self, url, test=False):
if test:
# when testing, we simply load a file
self.soup = BeautifulSoup(url.read(), "html.parser")
else:
self.soup = BeautifulSoup... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 7, 'operations': 7}} | jdg_59662 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | dfd12d7e1e9d7eac9ea968ed77a188391170243a |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the ExpressionXml class to fix XML parsing issues by removing the Obsolete attribute from the Value property, updating the getter and setter to directly access Script.Code,... | ```C#
using NBi.Core.Evaluate;
using NBi.Core.ResultSet;
using NBi.Core.Transformation;
using NBi.Xml.Variables;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace NBi.Xml.Items.Calc... | {'judging_instructions': ''} | {'language': 'C#', 'diff_stats': {'total_changes': 10, 'operations': 5}} | jdg_45189 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 752b3f760f56a6d8f097230e5cb9cd39f322c647 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the Asteroid class to apply angular velocity when asteroids collide with other objects. Update the Update method to adjust the facing based on angular velocity and apply de... | ```C#
/*
** Project ShiftDrive
** (C) Mika Molenkamp, 2016.
*/
using System;
using Microsoft.Xna.Framework;
namespace ShiftDrive {
/// <summary>
/// A <seealso cref="GameObject"/> representing a single asteroid.
/// </summary>
internal sealed class Asteroid : GameObject {
private float angu... | {'judging_instructions': ''} | {'language': 'C#', 'diff_stats': {'total_changes': 8, 'operations': 4}} | jdg_57649 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a8d6c1209a737eb760ece69e12348b4bd275dc9f |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the IPv6Endpoint class by adding stream operators for input and output. Implement the 'operator>>' to parse a string from an input stream into an IPv6Endpoint object and '... | ```C
#ifndef OFP_IPV6ENDPOINT_H
#define OFP_IPV6ENDPOINT_H
#include "ofp/ipv6address.h"
#include <istream>
#include "ofp/log.h"
namespace ofp { // <namespace ofp>
class IPv6Endpoint {
public:
IPv6Endpoint() = default;
IPv6Endpoint(const IPv6Address &addr, UInt16 port) : addr_{addr}, port_{port} {}
IPv6Endpoint(co... | {'judging_instructions': ''} | {'language': 'C', 'diff_stats': {'total_changes': 21, 'operations': 2}} | jdg_15294 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 5502319b6f43be0c476d89ba01115179ce4d7b83 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the ShareActivity class by implementing a check to determine if a user exists using SharedPreferences. If the user does not exist, initiate the registration process by sta... | ```Java
package io.github.shark_app.shark;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class ShareActivity extends AppCompatActivity {
public static final String PREFS_NAM... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 18, 'operations': 4}} | jdg_19883 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 3c563d2b83532e84fcb4a80cd74fb755f2bd5a80 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Extend the TCHome XCTestCase class by adding a test to verify the session loading process. Import the 'gattaca' module, define private variables for the session and controller, an... | ```Swift
import XCTest
@testable import gattaca
class TCHome:XCTestCase
{
private var session:MSession?
private var controller:CHome?
private let kWaitSession:UInt32 = 3
override func setUp()
{
super.setUp()
let session:MSession = MSession()
self.session = sess... | {'judging_instructions': ''} | {'language': 'Swift', 'diff_stats': {'total_changes': 27, 'operations': 3}} | jdg_9159 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | d12cfc648eb996730fa052e70b2fb27339dd3582 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the test suite for Everypolitician::AreaTest by adding a new test method to verify that the properties of an area, such as id, name, and type, are accessible and return th... | ```Ruby
require 'test_helper'
class Everypolitician::AreaTest < Minitest::Test
def test_reading_popolo_areas
popolo = Everypolitician::Popolo::JSON.new(
areas: [{ id: '123', name: 'Newtown', type: 'constituency' }]
)
area = popolo.areas.first
assert_instance_of Everypolitician::Popolo::Areas, ... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 11, 'operations': 1}} | jdg_37582 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | bab95a0a17ae94f2363d789eb70ab50b1eaebf91 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the existing React application to include a new set of components for handling challenges. Create a constant array 'CHALLENGES' with a sample challenge and options. Imple... | ```JavaScript
import React from 'react';
import { render } from 'react-dom';
const CHALLENGES = [
{
title: "Here is a question title",
optionList: [
{
id: 0,
title: "First",
order: 1
},
{
id: 1,
title: "Second",
order: 2
},
{
... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 86, 'operations': 7}} | jdg_106 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 5c86f56ff2a10390af5039956a788ec083034aef |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Expand the existing test suite in JavascriptFunctionTests.cs to include additional tests for function passing and managed object interoperability. Add tests for named functions, a... | ```C#
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Noesis.Javascript.Tests
{
[TestClass]
public class JavascriptFunctionTests
{
private JavascriptContext _context;
[TestInitialize]
public... | {'judging_instructions': ''} | {'language': 'C#', 'diff_stats': {'total_changes': 45, 'operations': 4}} | jdg_2295 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 01331f37c629f0738c5517527a6e78be55334e04 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the AbstractFieldSerializer and AbstractSerializerMixin classes to allow overriding the ManyRelatedField for image fields. Introduce a many_field_class attribute and a many... | ```Python
# -*- coding: utf-8 -*-
from functools import lru_cache
from rest_framework import serializers
from rest_framework.relations import ManyRelatedField, MANY_RELATION_KWARGS
class AbstractFieldSerializer(serializers.RelatedField):
parent_serializer_class = serializers.ModelSerializer
many_field_class ... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 15, 'operations': 6}} | jdg_24791 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 48dcf46b048c94437b957616a363f9f64447b8da |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the `pyinfra/__init__.py` file by adding a TODO comment to highlight the need for removing the import statements for all operations and facts, as these imports trigger un... | ```Python
'''
Welcome to pyinfra.
'''
import logging
# Global flag set True by `pyinfra_cli.__main__`
is_cli = False
# Global pyinfra logger
logger = logging.getLogger('pyinfra')
# Setup package level version
from .version import __version__ # noqa
# Trigger pseudo_* creation
from . import pseudo_modules # noqa... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 11, 'operations': 2}} | jdg_36904 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | c465b1f0c995ac2cb7c6c8b4ad5f721f800e2864 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Update the ARGparams class to include 'beta' and 'theta' as attributes in the class docstring. Also, add a 'Raises' section to document the AssertionError that may be raised durin... | ```Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""ARG parameters class
"""
from __future__ import print_function, division
class ARGparams(object):
"""Class for ARG model parameters.
Attributes
----------
scale : float
rho : float
delta : float
beta : float
theta : list
... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 6, 'operations': 2}} | jdg_66873 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | ecac13f406b31a7e6e71b49a2dacec2680d4baa8 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the DBConfig class by adding a method to create a ConnectionSource object using the current JDBC URL, user, and password. Ensure to handle any SQLExceptions that might occ... | ```Java
package edu.umass.cs.ciir.waltz.dbindex;
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.support.ConnectionSource;
import java.io.File;
import java.sql.SQLException;
/**
* @author jfoley
*/
public class DBConfig {
private final String jdbcURL;
private final String password;
... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 8, 'operations': 3}} | jdg_57185 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 92e9c53b715b8ba5e004bbceec73c3181726acae |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the JavaScript code by adding an AJAX call to handle the deletion of an entry on a user's dashboard page. Implement this by binding a 'submit' event to a '#delete-button',... | ```JavaScript
$(document).ready(function() {
$('#login-link').on('click', function(event) {
event.preventDefault();
var $target = $(event.target);
$.ajax({
type: 'GET',
url: $target.attr('href'),
dataType: 'html'
}).done(function(response){
$resp = $(response).children('.auth... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 20, 'operations': 7}} | jdg_16271 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | c9d70386d230ec0ffd1fe7cacb14ee601654dcf1 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Expand the main function to calculate and print the cosine and sine of a given input x using a series approximation. Define a helper function 'formula' to compute terms of the ser... | ```C++
#include <stdio.h>
#define MAX_LOOP 10000
double formula(const double x, const double k)
{
return (x * x) / ((2 * k - 1) * (2 * k));
}
int main(void)
{
double x;
printf("Enter x= ");
scanf("%lf", &x);
double cosx = 1,
sinx = x;
int k = 2;
while(k < MAX_LOOP)
{
... | {'judging_instructions': ''} | {'language': 'C++', 'diff_stats': {'total_changes': 25, 'operations': 2}} | jdg_10859 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 16d5a32553342cdff499ca0bb96b767d9bbbcedf |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the function to support 'root' as a direct string argument. If 'options' is a string, assign it to 'root'. Otherwise, convert 'options' to an object and set 'root' to 'opti... | ```JavaScript
'use strict';
module.exports = function (deck/*, options*/) {
var options = arguments[1], root, update, activateSlide;
if (typeof options === 'string') {
root = options;
} else {
options = Object(options);
root = options.root || '/';
}
activateSlide = function (index) {
if (index === deck.... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 8, 'operations': 1}} | jdg_56061 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a1eae2e3e3b2fe8aba3b6ebbe3590a7f853f136b |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the SkippedStepResult class to include a public method getSearchResult() that returns the private $searchResult attribute. This change allows access to the searchResult aft... | ```PHP
<?php
/*
* This file is part of the Behat.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Behat\Behat\Tester\Result;
use Behat\Behat\Definition\SearchResult;
/**... | {'judging_instructions': ''} | {'language': 'PHP', 'diff_stats': {'total_changes': 10, 'operations': 1}} | jdg_44396 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 9963afd9ff13e8256d3f63080140ee3f80963e64 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Config class by modifying the get method to throw a RuntimeException if the requested key does not exist. Additionally, implement a magic __call method to allow dynami... | ```PHP
<?php
namespace HeyDoc;
class Config
{
protected $config;
/**
*
*
* @param array $config The container
*/
public function __construct(array $config)
{
$this->config = new \ArrayObject(array_replace($this->getDefaults(), $config));
}
public function has($k... | {'judging_instructions': ''} | {'language': 'PHP', 'diff_stats': {'total_changes': 9, 'operations': 3}} | jdg_50085 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | ffcd8b53f23f83f5022152071d99c0c2c32a1fd0 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Fixtures class by adding a new method named createAssignment. This method should create and return a StudyParticipantAssignment object by utilizing the existing method... | ```Java
package gov.nih.nci.cabig.caaers.domain;
/**
* @author Rhett Sutphin
*/
public class Fixtures {
public static <T extends DomainObject> T setId(int id, T target) {
target.setId(id);
return target;
}
public static Participant createParticipant(String first, String last) {
P... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 10, 'operations': 2}} | jdg_45019 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 064d5b673d539d884b1dfb53012bf49e56b49832 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the Avatar function to allow customization of the default avatar by context. Use the instance context name to attempt to retrieve a context-specific avatar file before fall... | ```Go
// Package public adds some public routes that can be used to give information
// to anonymous users, or to the not yet authentified cozy owner on its login
// page.
package public
import (
"net/http"
"time"
"github.com/cozy/cozy-stack/pkg/statik/fs"
"github.com/cozy/cozy-stack/web/middlewares"
"github.com... | {'judging_instructions': ''} | {'language': 'Go', 'diff_stats': {'total_changes': 7, 'operations': 3}} | jdg_66163 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 117ce3f5b86de2ec4d773537bd88c9f2e9d38391 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the CLI tool by adding a legend that provides usage instructions for the split and merge commands. Ensure to handle errors gracefully by displaying appropriate messages an... | ```JavaScript
#!/usr/bin/env node
var split = require('./split-file.js');
if (require.main === module) {
cli();
}
function cli() {
var option = process.argv[2];
switch (option) {
case '-m':
cliMerge();
break;
case '-s':
cliSplit();
break;
default:
printLegend();
}
}
... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 35, 'operations': 5}} | jdg_4791 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 1f32ef0de22465a69b5db7a96dcf6d3a449eec6f |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the `compare_gpa_spec.rb` file to include additional branch information in the `before` block. Add a new branch 'another_branch' with a GPA of 2. Update the test to check i... | ```Ruby
require 'spec_helper'
module CodeclimateCi
describe CompareGpa do
let(:codeclimate_ci) { CodeclimateCi::CompareGpa.new('repo11', 'token1') }
before do
allow_any_instance_of(ApiRequester).to receive(:branch_info).with('master')
.and_return(
'last_snapshot' => { 'gpa' => 3 }
... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 9, 'operations': 4}} | jdg_48393 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 64a30e3fff0c893c82816c0de0f45faac1c7e9d8 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the `stub_filesystem!` method to not only create directories but also ensure that each directory contains a stub file named 'file.stub' with the content 'Stub file'. Updat... | ```Ruby
def stub_filesystem!
[
'/root/app/assets/javascripts',
'/root/app/assets/stylesheets',
'/root/app/assets/images',
'/root/contao/non_existing_folder',
'/root/contao/system/modules/some_extension',
'/root/public/resources',
'/root/public/system/modules/frontend',
'/root/vendor/a... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 18, 'operations': 1}} | jdg_19131 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | d146036998d3595730b3de5f03fd7ac6e63ae498 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the OrganizationMemberSerializer to include the user's ID in the serialized output. If the user object is present, add a 'user' key with a dictionary containing the user's ... | ```Python
from __future__ import absolute_import
from sentry.api.serializers import Serializer, register
from sentry.models import OrganizationMember
@register(OrganizationMember)
class OrganizationMemberSerializer(Serializer):
def serialize(self, obj, attrs, user):
if obj.user:
user_data = {... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 6, 'operations': 2}} | jdg_68390 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 6a436412ace79a233d7b23200ddd881d08e573f9 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the test suite for update expression construction in the UpdateExpressionTest.scala file. Add additional arbitrary generators for Set[Int] and List[String]. Include new op... | ```Scala
package com.gu.scanamo.update
import org.scalacheck.{Arbitrary, Gen}
import org.scalacheck.Arbitrary._
import com.gu.scanamo.syntax._
class UpdateExpressionTest extends org.scalatest.FunSpec
with org.scalatest.Matchers
with org.scalatest.prop.Checkers {
implicit lazy val arbSymbol: Arbitrary[Symbol] =... | {'judging_instructions': ''} | {'language': 'Scala', 'diff_stats': {'total_changes': 13, 'operations': 3}} | jdg_32866 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 7931974900deb703ceab6eb759be0f1b56c8a209 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Add a helper method named 'display_event' to the EventsHelper module. This method should determine the event type from a constant array 'Event::EVENT_TYPE' and return the first el... | ```Ruby
module EventsHelper
def event_location(event)
location = Location.find(event.location_id)
html = ''
content_tag(:address) do
html << "#{location.address1} \n<br />\n #{location.city}, #{location.state_abbrv} #{location.zipcode}"
end
html.html_safe
end
def event_dates(event)
content_tag(:span... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 7, 'operations': 2}} | jdg_60811 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | e4d6556664aad6efadbe8942e49a56490112bfc9 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the Rust CLI application code to replace the use of the `clap_app!` macro with the `app_from_crate!` macro. Additionally, extract the command-line argument parsing logic ... | ```Rust
#[macro_use]
extern crate clap;
extern crate names;
use clap::{AppSettings, Arg};
use names::{Generator, Name};
fn main() {
let (naming, amount) = parse_cli_args();
let mut generator = Generator::with_naming(naming);
for _ in 0..amount {
println!("{}", generator.next().unwrap());
}
}
... | {'judging_instructions': ''} | {'language': 'Rust', 'diff_stats': {'total_changes': 50, 'operations': 3}} | jdg_1586 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 143787623e9a923e0b606d4b3a3e080c872152e3 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the FastPrimitiveConverter class by adding support for converting strings to float primitives. Implement a new entry in the primitiveConverterMap for the 'float' type, ens... | ```Java
package com.arondor.common.reflection.reflect.instantiator;
import java.util.HashMap;
import java.util.Map;
public class FastPrimitiveConverter
{
private interface PrimitiveConverter
{
Object convert(String value);
}
private final Map<String, PrimitiveConverter> primitiveConverterMap ... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 7, 'operations': 1}} | jdg_64592 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 1cfd300a0aed8cf1aa940b06975c56f9d2196c30 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Update the script to accommodate changes in the routing of Ingress intel and mission URLs by using wildcard subdomains. Also, increment the version number from 0.1.0 to 0.1.1.
Co... | ```JavaScript
// ==UserScript==
// @id iitc-plugin-drawtools-sync@hansolo669
// @name IITC plugin: drawtools sync
// @category Tweaks
// @version 0.1.1
// @namespace https://github.com/hansolo669/iitc-tweaks
// @updateURL https://iitc.reallyawesomedomain.com/drawtools-sync.m... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 9, 'operations': 2}} | jdg_48932 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | b1c659f0ae77336ebad33ef040d64985eba9c612 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the SQL view definition in the provided code by adding explicit column aliases to each selected field in the 'userView'. Ensure that each column in the SELECT statement is ... | ```SQL
CREATE TABLE IF NOT EXISTS users (
id BIGSERIAL NOT NULL,
firstName VARCHAR NOT NULL,
middleName VARCHAR,
lastName VARCHAR NOT NULL,
title VARCHAR,
streetAddress VARCHAR NOT NULL,
city VARCHAR NOT NULL,
state VARCHAR NOT NULL,
zipcode VARCHAR(5) NOT NULL,
phoneNumber VARC... | {'judging_instructions': ''} | {'language': 'SQL', 'diff_stats': {'total_changes': 12, 'operations': 1}} | jdg_36769 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a2f2a006f5c91001abe8868ec8720c349d017960 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the Program.cs file to use environment variables for the Recurly client configuration. Replace hardcoded strings for the subdomain and API key with calls to 'Environment.Ge... | ```C#
using System;
using Recurly;
using Recurly.Resources;
namespace RecurlyTestRig
{
class Program
{
static void Main(string[] args)
{
try {
var subdomain = Environment.GetEnvironmentVariable("RECURLY_SUBDOMAIN");
var apiKey = Environment.GetEnvi... | {'judging_instructions': ''} | {'language': 'C#', 'diff_stats': {'total_changes': 12, 'operations': 6}} | jdg_36129 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 210b303b03c686cd16f76617b8761af14baffc75 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the Gulp tasks in the provided gulpfile.js to use separate functions for bundling games and users JavaScript files. Replace the existing task definitions with calls to th... | ```JavaScript
// gulpfile.js
// Packages
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
// Tasks
var b... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 16, 'operations': 5}} | jdg_23093 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | c0563f5c112d02f13eabd94765da4565a2f6c235 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Wedding component by adding a countdown timer that displays the milliseconds remaining until the next wedding anniversary. Use the date '2018-09-23T00:00:00+1200' as t... | ```JavaScript
import React from 'react';
import css from './styles.css';
const weddingAnniversary = new Date('2018-09-23T00:00:00+1200');
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
const timeUntilAnniversary = () => {
const currentYear = (new Date()).getFullYear(... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 50, 'operations': 2}} | jdg_1518 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 069f69e866f85938f5cf4fe338e73a39f1089b1d |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Ruby cask definition for 'adium-beta' by adding missing stanzas. Specifically, include the 'name' stanza with the value 'Adium', update the 'license' stanza to ':gpl',... | ```Ruby
cask :v1 => 'adium-beta' do
version '1.5.11b2'
sha256 'e7690718f14defa3bc08cd3949a4eab52e942abd47f7ac2ce7157ed7295658c6'
url "https://adiumx.cachefly.net/Adium_#{version}.dmg"
name 'Adium'
homepage 'https://beta.adium.im/'
license :gpl
app 'Adium.app'
zap :delete => [
'~/Lib... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 8, 'operations': 3}} | jdg_53553 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 4873469225a9d0b2cfca473daadd168a17271c58 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the initializer 'pay.processors' in the Ruby module to use ActiveSupport::Reloader's to_prepare block, ensuring that processor backends are continuously included on reloads... | ```Ruby
module Pay
class Engine < ::Rails::Engine
isolate_namespace Pay
config.autoload_paths += Dir["#{config.root}/lib/**/"]
initializer 'pay.processors' do
ActiveSupport::Reloader.to_prepare do
# Include processor backends
if defined? Stripe
Dir[File.join(__dir__, 'pay... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 25, 'operations': 7}} | jdg_10308 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | afcdaa4983563ca3ca4ffd3c4dd87d43442f0cb2 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the App component in the given JavaScript file to ensure the application builds successfully by wrapping the PageHeader and Switch components inside a div within the Connec... | ```JavaScript
import React from 'react'
import {connect} from 'react-redux'
import {compose, lifecycle} from 'recompose'
import {Route, Switch} from "react-router"
import {ConnectedRouter} from "react-router-redux"
import auth from '../auth'
import {updateAuth} from '../actions/auth'
import PageHeader from './PageHea... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 11, 'operations': 2}} | jdg_39039 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | e582ef07d4b9f537e31d31c1546df870a2bd361c |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the AsyncPlugin class to fix multiprocessing issues in Python 2.7. Specifically, move the _train method outside the class as a standalone function since Python 2.7 cannot... | ```Python
from senpy.plugins import AnalysisPlugin
import multiprocessing
def _train(process_number):
return process_number
class AsyncPlugin(AnalysisPlugin):
def _do_async(self, num_processes):
pool = multiprocessing.Pool(processes=num_processes)
values = pool.map(_train, range(num_process... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 10, 'operations': 3}} | jdg_41112 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 76ff703ace51f5d672432cbc9d59b12b35e4b047 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the RoleDescriptor class by removing the deprecated tag methods: 'with_any_tag', 'with_all_tags', and 'join_tags'. Ensure the class maintains its functionality without th... | ```Ruby
class RoleDescriptor < Sequel::Model
many_to_one :entity_descriptor
many_to_one :organization
one_to_many :protocol_supports
one_to_many :key_descriptors
one_to_many :contact_people
one_to_many :scopes, class: 'SHIBMD::Scope'
one_to_one :ui_info, class: 'MDUI::UIInfo'
plugin :class_table_inhe... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 12, 'operations': 1}} | jdg_34252 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 9b68793a42b82fe00b6cba6dac10676cc9f52624 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the 'compress' function to use a string for accumulating the result instead of a bytes.Buffer. Update the logic to concatenate characters and counts directly to the strin... | ```Go
package compress
import "strconv"
func compress(uncompressed string) string {
var buf string
if len(uncompressed) == 0 {
return buf
}
var prev byte
letter := uncompressed[0]
last := 0
for i := 1; i < len(uncompressed); i++ {
prev = uncompressed[i-1]
letter = uncompressed[i]
if letter != prev {
... | {'judging_instructions': ''} | {'language': 'Go', 'diff_stats': {'total_changes': 8, 'operations': 6}} | jdg_58343 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 7b74210b6e1a896143388a89766d8f898e630db0 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the provided Ruby Rake task code to ensure that updates are queued up in all environments, not just in production. Remove the condition that restricts the task execution to... | ```Ruby
desc "This task is called by the Heroku cron add-on"
task :cron => :environment do
# Get all streams
streams = Stream.all_active
# Check for feed updates for each stream
streams.each do |stream|
puts "Queuing up an update for #{stream.name}"
stream.feeds.each do |feed|
Resque.enqueue(Fee... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 9, 'operations': 3}} | jdg_48328 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 91352ed9a745cad0caff5484e1143095c0243544 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Update the Perl script to enhance the log message checks in the 'file' section. Modify the client's message format and add specific regex patterns in 'loggrep' to verify the prese... | ```Perl
# The syslogd listens on 127.0.0.1 TCP socket.
# The client writes a message to Sys::Syslog TCP method.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, ... | {'judging_instructions': ''} | {'language': 'Perl', 'diff_stats': {'total_changes': 12, 'operations': 2}} | jdg_36747 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 98bb4305ccdd8a83763bedb1f09c261e9904487c |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the test method 'test_filter_queryset_success_200' in the 'FullCaseViewSetTestCase' class to use a URL generated by 'reverse'. Create a new test method to verify filterin... | ```Python
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from legalaid.views import FullCaseViewSet
from cla_backend.apps.call_centre.permiss... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 15, 'operations': 9}} | jdg_24789 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 68810450d29da4b62023629b5a3064cf3f08f1df |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the Ruby script to fix the fog gem installation on RHEL and its variants. Update the platform detection logic to use 'platform_family' instead of 'platform', and adjust the... | ```Ruby
#
# Cookbook Name:: route53
# Recipe:: default
#
# Copyright 2010, Platform14.com.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 18, 'operations': 4}} | jdg_19038 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | ca97842f85a569f6123f62976f35c51986ffd586 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the test for the OptimizerComponent to ensure it creates three panels. Update the test to check for three child nodes and verify the presence of 'user-input', 'barchart', a... | ```TypeScript
import {
beforeEach,
beforeEachProviders,
describe,
expect,
it,
inject,
} from '@angular/core/testing';
import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
import { Component } from '@angular/core';
import { By } from '@angular/platform-browser';
import { Optimi... | {'judging_instructions': ''} | {'language': 'TypeScript', 'diff_stats': {'total_changes': 11, 'operations': 3}} | jdg_40612 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 2f2f6cba331515b8d563d0e2f7869111df4227c3 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the existing Django management command to handle new fields when scraping convening times. Update the code to parse the status and time from the 'time_string', make the tim... | ```Python
from django.core.management.base import BaseCommand
from django.utils import timezone
from core.models import ConveneTime
from legislators.models import Chamber
from dateutil.parser import parse
import requests
class Command(BaseCommand):
help = u'Scrape TLO for convening times.'
def handle(self,... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 7, 'operations': 4}} | jdg_59120 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 754f5c968ad1dff3ae7f602d23baac1299731062 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the script to sort the list of source and header files alphabetically before appending them to the project file. Use Python's built-in list.sort method with a case-insensit... | ```Python
#!/usr/bin/python3
import os
import re
import subprocess
dir_path = os.path.dirname(os.path.realpath(__file__))
filename = 'chatterino.pro'
data = ""
with open(filename, 'r') as project:
data = project.read()
sources_list = subprocess.getoutput("find ./src -type f -regex '.*\.cpp' | sed 's_\./_ ... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 6, 'operations': 2}} | jdg_67149 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 362751ba24ee4a5efc5895981d0c032d0baaa889 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the messageCreateHandler function to include a check for whether a user has accepted the rules in a Discord channel named 'regeln'. If the user types the command '$accept'... | ```Go
package main
import (
"fmt"
"strings"
"github.com/bwmarrin/discordgo"
"github.com/spf13/viper"
)
const commandPrefix = `$`
func messageCreateHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
user, _ := s.User("@me")
if m.Author.ID != user.ID {
if !strings.HasPrefix(m.Content, commandPrefix)... | {'judging_instructions': ''} | {'language': 'Go', 'diff_stats': {'total_changes': 17, 'operations': 3}} | jdg_22110 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | e081646028e4f3283fb9c7278fed89c3e42cc4d3 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the test suite for the User API by implementing tests for retrieving an empty user list and a single user list. Use the 'api_request' method to check the number of results... | ```Python
import json
from tests.helpers import FlaskTestCase, fixtures
class TestUserAPI(FlaskTestCase):
@fixtures('base.json')
def test_get_empty_users(self):
"""Test GET /api/users endpoint with no data"""
response, data = self.api_request('get', '/api/users')
assert data['num_resu... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 9, 'operations': 6}} | jdg_46815 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 2488110480cd817d4ae5e0578a25f235968f9f35 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the toggleTrackingOptOut function to improve privacy tracking by adding a promise that combines trackEvent and processEvent for both analytics and internalAnalytics. Ensu... | ```JavaScript
import { createAction } from 'redux-act'
import analytics from 'src/analytics'
import internalAnalytics from 'src/analytics/internal'
export const setTrackingFlag = createAction(
'privacy/setTrackingFlag',
value => {
// Value will be string from UI events, else bool from storage syncing
... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 14, 'operations': 5}} | jdg_28334 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | cc6b9e82123d9a9f75075ed0e843227ea9c74e4d |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the 'trigger' function in the provided JavaScript code to minimize its responsibilities by moving functionality to separate functions. Ensure to use '===' for strict equa... | ```JavaScript
var Timer = (function(Util) {
'use strict';
// Internal constants for the various timer states.
var Waiting = 0, Inspecting = 1, Ready = 2, Running = 3, Delay = 4;
var state = Waiting;
var startTime = undefined, endTime = undefined, solveTime = undefined;
var intervalID = undefined;
funct... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 28, 'operations': 4}} | jdg_8264 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 52d037d9093a18ebdf15d1c00b959cae06aa345b |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the Sequelize model definition in the 'api/models/submission.js' file to include a new field named 'version'. This field should be of type INTEGER, not allow null values, h... | ```JavaScript
const Sequelize = require('sequelize');
const sequelize = require('./');
const Stage = require('./stage');
const Submission = sequelize.define('submissions', {
name: {
type: Sequelize.STRING,
allowNull: false,
validate: {
len: [1, 100],
},
},
board: {
type: Sequelize.TEXT,
allowNull: f... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 8, 'operations': 1}} | jdg_55955 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a46c7d80a627a7043678dee6fc6486147401b9e4 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the SpecHelpers module in the spec_helper.rb file by adding methods to access directories within the project directory structure. Implement a 'spec_dir' method to join the... | ```Ruby
gem 'minitest'
require 'yacl'
require 'minitest/autorun'
require 'minitest/pride'
require 'tmpdir'
module SpecHelpers
def self.tmpfile_with_contents( full_path, contents )
File.open( full_path, "w+" ) do |f|
f.write( contents )
end
end
def self.spec_dir( *other )
::File.join( proj_root... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 9, 'operations': 2}} | jdg_48217 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 058f4288d7d0424a55045aee86f46e37e48b883a |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the 'lowland.events.DataEvent' class by adding a constructor that accepts 'value' and 'oldValue' parameters. Implement logic to set the 'data' and 'oldData' properties usi... | ```JavaScript
/*
==================================================================================================
Lowland - JavaScript low level functions
Copyright (C) 2012 Sebatian Fastner
==================================================================================================
*/
core.Class("lowland.... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 11, 'operations': 1}} | jdg_38687 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a9b226f56edd9fce977257afb2a76a5975e28bdc |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the existing Express.js application by implementing Mongo and Redis adapters. Create a function to handle service execution and integrate middleware to manage dependencies... | ```JavaScript
var express = require('express');
var app = express();
var CurrentUser = require('../Architecture/CurrentUser').CurrentUser;
var WebService = require('../Architecture/WebService').WebService;
var MongoAdapter = require('../Adapters/Mongo').MongoAdapter;
var RedisAdapter = require('../Adapters/Redis').Red... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 36, 'operations': 2}} | jdg_4401 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 17cbd84b9b5a4bd08123ff5f429be191b1bdf063 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Polynomial class by implementing an __init__ method that accepts a list of coefficients, and add attributes for coefficients and degree. Ensure the coefficients are va... | ```Python
class Polynomial(object):
def __init__(self, coeffs):
"""
1 parameter:
coeff (list): coeff[n] = coefficient of nth degree term
"""
self.coeffs = coeffs
@property
def coeffs(self):
return self._coeffs
@property
def degree(self):
r... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 34, 'operations': 1}} | jdg_5015 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 8fdd73b7b8b907da264eac26ea52eef2bb8f6ce7 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the 'load_image_as_array' function by adding an alternative implementation using OpenCV. Ensure the function reads an image file as a numpy array, converts it to RGB, and ... | ```Python
# ==============================================================================
# LOAD_IMAGE_AS_ARRAY
# ==============================================================================
# USING SCIPY (with i think PIL on the backend)
import scipy.misc
d... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 13, 'operations': 2}} | jdg_30096 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 6908ebe12d4dca68d45694575c48adcbfb4e0009 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Swift file by implementing a new function named 'bisect' that operates on a 'Sliceable' sequence. The function should split the sequence at a specified index, returnin... | ```Swift
// Copyright (c) 2015 Neil Pankey. All rights reserved.
/// "Missing" sequence and related protocol functions
// TODO Better name than `bisect` since that implies equal slices. Could use `split` but
// but that would overload an existing stdlib function.
public func bisect<S: Sliceable>(sequence: S, atIndex... | {'judging_instructions': ''} | {'language': 'Swift', 'diff_stats': {'total_changes': 8, 'operations': 1}} | jdg_57923 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a38be80a86bb07db2ffd68e9e3c33f6242291d5b |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Revert the changes made in a previous commit that aimed to fix an IE bug by using a secondary global and eval. Instead, restore the code to refer to the actual global object using... | ```JavaScript
var global = { },
ObjectiveJ = { };
(function (global, exports, namespace)
{
var GLOBAL_NAMESPACE = namespace;
#include "Includes.js"
})(global, ObjectiveJ, window);
var hasOwnProperty = Object.prototype.hasOwnProperty;
// If we can't trust the host object, don't treat it as global
// and fall... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 21, 'operations': 4}} | jdg_14901 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 883f1b1c28e76ade6632f762391cbb4a97918e12 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the import statement to import 'core' from 'panda3d' instead of 'HTTPChannel' directly. Ensure compatibility by checking if 'HTTPChannel' exists in 'core' before applying '... | ```Python
####################################################################
#Dtool_funcToMethod(func, class)
#del func
#####################################################################
from panda3d import core
from .extension_native_helpers import Dtool_funcToMethod
"""
HTTPChannel-extensions module: c... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 8, 'operations': 3}} | jdg_51899 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | edca0a4e339b034f622b7d1425c67a56eb2fa823 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Update the SMTP settings in the Ruby configuration file to enhance security and ensure proper mail delivery in production. Replace the hardcoded 'user_name' with an environment va... | ```Ruby
ActionMailer::Base.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "gmail.com",
user_name: ENV["EMAIL_USERNAME"],
password: ENV["EMAIL_PASSWORD"],
authentication: :login
}
``` | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 7, 'operations': 1}} | jdg_60904 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 9605b60fb537714c295dfa0f50313e38f89d2d88 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Flask web application by adding an API endpoint for Let's Encrypt auto-renewal. Implement a function to retrieve the ACME key based on a given token, and create a new ... | ```Python
"""
This is a simple cheatsheet webapp.
"""
import os
from flask import Flask, send_from_directory
from flask_sslify import SSLify
DIR = os.path.dirname(os.path.realpath(__file__))
ROOT = os.path.join(DIR, 'docs', '_build', 'html')
def find_key(token):
if token == os.environ.get("ACME_TOKEN"):
... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 21, 'operations': 5}} | jdg_14184 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 22ff95021a6e5667f0591048bb03e40b045ddc39 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the FrontpageController.php to dynamically change the registration message and button text based on whether applications are open. Use a setting check to determine if appli... | ```PHP
<?hh
class FrontpageController extends BaseController {
public static function getPath(): string {
return '/';
}
public static function get(): :xhp {
# If a user is logged in, redirect them to where they belong
if(Session::isActive()) {
header('Location: /dashboard');
}
$regist... | {'judging_instructions': ''} | {'language': 'PHP', 'diff_stats': {'total_changes': 9, 'operations': 2}} | jdg_50268 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | c8c3227cba90a931edb9ae7ee89c5318258a2f25 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the LiveNotificationsManager class by adding methods to mark notifications as read, mark all notifications as read, and mark notifications as unread. Ensure each method ge... | ```Python
# -*- coding: utf-8 -*-
from .generic import Manager, GetByIdMixin, AllMixin, SyncMixin
class LiveNotificationsManager(Manager, GetByIdMixin, AllMixin, SyncMixin):
state_name = 'live_notifications'
object_type = None # there is no object type associated
def set_last_read(self, id):
""... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 37, 'operations': 2}} | jdg_3965 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 97aeed066aee1b166e7c635755f275bf58eb530c |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the JavaScript functions `getProcessCount` and `getThreadCount` to handle scenarios where the total number of users exceeds 600. Ensure that the process count is capped at ... | ```JavaScript
function getProcessCount(total) {
if (total < 2) {
return 1;
}
var processCount = 2;
if (total > 80) {
processCount = parseInt(total / 40) + 1;
}
if (processCount > 20) {
processCount = 20;
}
return processCount;
}
function getThreadCount(total) {
var processCount = getProcessCount(to... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 16, 'operations': 4}} | jdg_23559 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 600334f33696320e2c38039e6c07f93017be8544 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the Merger class by implementing a helper method called chooseMostRecentDate. Use this helper method in mergeLastAuthenticatedAt, mergeLastMessagedAt, and mergeLastAccess... | ```PHP
<?php
namespace Northstar\Merge;
use Northstar\Exceptions\NorthstarValidationException;
class Merger
{
public function merge($field, $target, $duplicate)
{
$mergeMethod = 'merge'.studly_case($field);
if (! method_exists($this, $mergeMethod)) {
throw new NorthstarValidation... | {'judging_instructions': ''} | {'language': 'PHP', 'diff_stats': {'total_changes': 20, 'operations': 4}} | jdg_16388 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 79e7f3f578cf1c3bf766c83391e940ada8a6e0ed |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the Hypercuke module to use 'extend self' for defining module-level methods instead of prefixing each method with 'self.'. This change should simplify the method definiti... | ```Ruby
require 'hypercuke/version'
require 'hypercuke/cli'
require 'hypercuke/context'
require 'hypercuke/exceptions'
require 'hypercuke/mini_inflector'
require 'hypercuke/step_driver'
require 'hypercuke/step_adapter'
require 'hypercuke/step_adapters'
require 'hypercuke/adapter_definition'
module Hypercuke
extend s... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 9, 'operations': 7}} | jdg_47635 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 1819ea00d05c9db3d9688f1d66fef30dcb3f2485 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the DefaultTerminalLocationCustomizer class to set the PWD environment variable to the workspace root path when customizing the Terminal plugin's working directory. Refacto... | ```Java
/*
* Copyright 2017 The Bazel Authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requi... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 16, 'operations': 2}} | jdg_23918 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | e3038c549a27d65ace8e4dcf69ba18cddd70ccc3 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the existing Node-RED server setup by adding an exit handler to manage process termination gracefully. Implement handlers for 'exit', 'SIGINT', and 'uncaughtException' eve... | ```JavaScript
'use strict';
import 'source-map-support/register';
import http from 'http';
import express from 'express';
import RED from 'node-red';
// Exit handler
process.stdin.resume();
function exitHandler(err) {
if (err instanceof Error) {
console.log(err.stack);
process.exit(1);
} else if (isNaN(er... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 16, 'operations': 1}} | jdg_23621 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 96499391091a81302ac3947536b573c21f571677 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the regex pattern to expand the search for the site-packages directory to include dist-packages as well. Add error handling to inform the user if the site-packages director... | ```Python
from setuptools import setup
from distutils import sysconfig
import re
#from setuptools.dist import Distribution
site_packages_path = sysconfig.get_python_lib()
try:
sprem = re.match(
r'.*(lib[\\/](python\d(\.\d)*[\\/])?site-packages)', site_packages_path, re.I)
if sprem is None:
spre... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 12, 'operations': 1}} | jdg_33175 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 7a2625c1ee3eb5b64837cdffc4e3162b1e5587e0 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the given JavaScript code by replacing all double quotes with single quotes for consistency in string literals. Ensure that the functionality of the AngularJS directive r... | ```JavaScript
(function() {
'use strict';
angular.module('angular.jsgrid', [])
.directive('ngJsgrid', function() {
return {
restrict: 'A',
replace: false,
transclude: false,
scope: {
config: '=ngJsgrid'
... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 7, 'operations': 5}} | jdg_62574 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 90a3fdb8fce4a6f7f98d1b969715451236ac9a2d |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the AddInput component by implementing methods to add and remove pomodoros. Introduce addPomodoro and removePomodoro methods to increment and decrement the pomodoros state... | ```JavaScript
// @flow
import React, { Component } from "react";
import { connect } from "react-redux";
import { addTask } from "../actions/task";
import type { actionType } from "../reducers/task";
type Props = {
cancel: () => void,
dispatch: (action: actionType) => void
};
type State = {
pomodoros: number
};
... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 19, 'operations': 2}} | jdg_17534 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 495d7a008b1621531cdf39f2d74ac22aee42deac |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the existing route '/wish-detail/:_id' to '/wish/:_id' and add a new route '/wish/new' with the name 'wishNew' that renders the 'wishNew' template using BlazeLayout.
Cod... | ```JavaScript
const authenticatedRoutes = FlowRouter.group({
name: 'authenticated'
});
authenticatedRoutes.route( '/', {
name: 'index',
action() {
BlazeLayout.render( 'default', { yield: 'index' } );
}
});
authenticatedRoutes.route( '/dashboard', {
name: 'dashboard',
action() {
BlazeLayout.render(... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 8, 'operations': 2}} | jdg_56247 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | e6acbd0c0e537061373cc8f877264681c5b9b476 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the code to combine the two separate tests for locale filenames and JSON validity into a single test case. Ensure that the new test iterates over all filenames, checks bo... | ```JavaScript
import test from "ava";
const fs = require("fs");
const path = require("path");
const localesPath = path.join(__dirname, "..", "locales");
const filenameRegex = /^[a-z][a-z](_[A-Z]+)*\.json$/;
test("locale files are valid", t => {
const filenames = fs.readdirSync(localesPath);
filenames.forEach(fil... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 12, 'operations': 5}} | jdg_35331 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | d9e902c00cae5586699a209e15dce149edccfd3f |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the Group class in the Arrthorizer module to introduce a private is_member? method. Modify the applies_to_user? method to call this new method, removing the context param... | ```Ruby
##
# This is the class of all Groups. A Group is a role that does not depend
# on context, but rather on membership - a user can be made a member
# of such a role. This might be related to that person's role in the
# organization, for example.
module Arrthorizer
class Group < Role
attr_reader :name
d... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 6, 'operations': 1}} | jdg_69572 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 287e33837692871a59192a7498bffc0d22ffe9ba |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the given Java class by adding the @Override annotation to the start and stop methods to indicate that these methods override superclass methods.
Code:
bndtools.builder/s... | ```Java
package org.bndtools.builder;
import org.osgi.framework.BundleContext;
public class BuilderPlugin extends org.eclipse.core.runtime.Plugin {
private static BuilderPlugin instance = null;
public static BuilderPlugin getInstance() {
synchronized (BuilderPlugin.class) {
return instan... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 20, 'operations': 4}} | jdg_16508 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 04f9d540e4c89ffebbdc027d5e15e031af5dce42 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Controller class by adding a helper method named 'api' that formats responses in a way suitable for an Angular client. The method should accept parameters for content,... | ```PHP
<?php
namespace App\Http\Controllers;
use Laravel\Lumen\Routing\Controller as BaseController;
class Controller extends BaseController
{
/**
* Simple wrapper that wraps responses into a
* format that the Angular client expects.
*
* @param string $content
* @param int $status... | {'judging_instructions': ''} | {'language': 'PHP', 'diff_stats': {'total_changes': 13, 'operations': 1}} | jdg_31911 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 4ed07adf9aa039fd7f9c9a0d43a13f031550d218 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the 'discover_for' method in the EmailSettings class to change the API request parameter from 'email_address' to 'email'. Additionally, add methods to access nested attribu... | ```Ruby
module ContextIO
class EmailSettings < APIResource
def self.discover_for(email_address, source_type = 'imap')
attrs = ContextIO::API.request(:get, 'discovery', email: email_address, source_type: source_type)
new(attrs)
end
attr_reader :email, :found, :type, :documentation, :imap
... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 25, 'operations': 2}} | jdg_10250 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | d2444e43b30bc9f5b0ad64b5aa1c797c17107119 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the Karma configuration file to dynamically adjust the list of files based on command-line arguments. Implement logic to include different polyfills: if '--webcomponentsjs'... | ```JavaScript
const base = require('skatejs-build/karma.conf');
module.exports = function (config) {
base(config);
config.files = (function () {
if (process.argv.indexOf('--webcomponentsjs') > -1) {
return ['node_modules/webcomponents.js/webcomponents.js'];
} else if (process.argv.indexOf('--named-slo... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 8, 'operations': 1}} | jdg_55158 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 0b069bab7d94c187915398f02cde1479413d8929 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the Awspec::Type::Base class by adding a to_s method that returns a string representation of the object. The string should include the class type and a display name, using... | ```Ruby
require 'aws-sdk'
require 'awspec/helper/finder'
module Awspec::Type
class Base
include Awspec::Helper::Finder
attr_reader :id, :resource
def initialize(id = nil)
@display_name = id
super
@id = nil
end
def to_s
type = self.class.name.demodulize.underscore
"... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 6, 'operations': 2}} | jdg_69330 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | f90e3e8edcb5012c6b78dcc482a270db4ba5f369 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the RSpec test for TricksDecorator to utilize fixtures instead of creating objects manually. Replace the setup code with fixtures for rounds, players, and cards, and upda... | ```Ruby
require "rails_helper"
RSpec.describe TricksDecorator, type: :decorator do
fixtures :all
let(:round) { rounds(:playing_round) }
let(:base_trick) { round.tricks.first }
let(:trick) { TricksDecorator.new(base_trick) }
let(:player) { players(:player2) }
let(:card) { cards(:jack_of_... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 20, 'operations': 6}} | jdg_15978 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 4fe96cf69b5936619f2d82a7a53bdb3d327b29b6 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the DefaultConfig in the Go file to dynamically determine the execution directory on Windows using the GetModuleFileNameW function from the kernel32 DLL. Update the Root, P... | ```Go
package config
import (
"log"
"path/filepath"
"syscall"
"unsafe"
)
func execdirInit() string {
var (
kernel32 = syscall.NewLazyDLL("kernel32")
procGetModuleFileName = kernel32.NewProc("GetModuleFileNameW")
)
var wpath [syscall.MAX_PATH]uint16
r1, _, err := procGetModuleFileName.Call(0, ... | {'judging_instructions': ''} | {'language': 'Go', 'diff_stats': {'total_changes': 25, 'operations': 2}} | jdg_10875 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 0319ff5049da2c53d8b6507d7fc625ce00a421af |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the 'compare.py' module by implementing a '@matcher' decorator. This decorator should register functions as matchers, attaching them to the 'Expr' class, allowing them to ... | ```Python
"""The compare module contains the components you need to
compare values and ensure that your expectations are met.
To make use of this module, you simply import the "expect"
starter into your spec/test file, and specify the expectation
you have about two values.
The expect starter is simply an alias to the... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 36, 'operations': 6}} | jdg_4290 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | a1c570001e4214d1e2e2c4d34e2ee74721ecb2d5 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the UserSerializer's create method to include user profile creation and email activation. Ensure that upon user registration, a profile is created with an activation code,... | ```Python
from django.contrib.auth.models import User
from rest_framework import serializers, viewsets
from xpserver_api.services import generate_activation_code, EmailSender
from xpserver_web.models import Profile
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 9, 'operations': 3}} | jdg_47098 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 5b1f2361f23a9d479004d8cdf063c708ebacf92a |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the Rust code to replace the manual VGA buffer manipulation for printing 'Hello World!' with a more idiomatic approach using the `println!` macro. Ensure that the `vga_bu... | ```Rust
// Copyright 2015 Philipp Oppermann
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... | {'judging_instructions': ''} | {'language': 'Rust', 'diff_stats': {'total_changes': 13, 'operations': 2}} | jdg_32899 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | ef4b8cf7d28021cd8e05948ca388ef24e71348bc |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Update the compressor_test.cpp file to reflect the move of gzstream from the 'util' namespace to the 'io' namespace. Ensure that all instances of 'util::gzofstream' and 'util::gzi... | ```C++
/**
* @file compressor_test.cpp
* @author Chase Geigle
*/
#include <array>
#include <iostream>
#include <fstream>
#include "io/gzstream.h"
using namespace meta;
int main(int argc, char** argv)
{
if (argc < 3)
{
std::cerr << "Usage: " << argv[0] << " input output" << std::endl;
retur... | {'judging_instructions': ''} | {'language': 'C++', 'diff_stats': {'total_changes': 7, 'operations': 5}} | jdg_65918 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | d4a23fe4eeb40efebf2f41ad445dd30260bae6af |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the code to sort the choices by their ID before sending them to the view. Ensure that each choice object includes both the choice ID and text when rendering the index page.... | ```JavaScript
var uuidV4 = require('uuid/v4');
var models = require('../models');
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
var promise;
if (req.session.uuid) {
promise = models.Guest.find({
where: { sessionId: req.se... | {'judging_instructions': ''} | {'language': 'JavaScript', 'diff_stats': {'total_changes': 12, 'operations': 2}} | jdg_35028 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | b28041603abe01215532166c749d8051fd8c0df7 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Expand the CreationTests class in the CreationTests.swift file to include additional test cases for creating files without an extension, creating files in subfolders, and creating... | ```Swift
/**
* CodeRunnerClI
* Copyright (c) Mateusz Zając 2017
* Licensed under the MIT license. See LICENSE file.
*/
import XCTest
import Files
@testable import CodeRunnerCore
@available(OSX 10.11, *)
class CreationTests: XCTestCase {
fileprivate var testFolder: Folder!
fileprivate let fileSyste... | {'judging_instructions': ''} | {'language': 'Swift', 'diff_stats': {'total_changes': 34, 'operations': 2}} | jdg_5294 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 970d2e0a24d25f61ba31eee9575f73f48dd1102d |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the ZorbaArrayAutoPointer class by adding an operator[] to access elements by index. Also, ensure memory safety by checking if thePtr is not null before deleting it in the... | ```C
/*
* Copyright 2006-2008 The FLWOR Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | {'judging_instructions': ''} | {'language': 'C', 'diff_stats': {'total_changes': 17, 'operations': 6}} | jdg_21958 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 20238e4c60a280305f960233d4bb54e0647e9252 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Expand the existing unit test in SimpleTest.java by adding additional test methods to verify XML parsing and serialization. Create a helper method to streamline the testing proces... | ```Java
package com.arondor.common.w3c2gwt;
import org.junit.Assert;
import org.junit.Test;
public class SimpleTest
{
private void testXml(String xml)
{
Document doc = XMLParser.parse(xml);
String result = doc.toString();
Assert.assertEquals(xml, result);
}
@Test
public vo... | {'judging_instructions': ''} | {'language': 'Java', 'diff_stats': {'total_changes': 23, 'operations': 5}} | jdg_12698 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 7144fe4f633abeefcbae717807495588aa163f69 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Update the semantic versioning for the dependencies in the Ruby gem specification file. Ensure that the dependencies 'rails', 'jquery-rails', 'sqlite3', 'capybara', and 'selenium-... | ```Ruby
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "subdivision_select/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "subdivision_select"
s.version = SubdivisionSelect::VERSION
s.authors = ["Sean Collins"]
s.email = [... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 7, 'operations': 5}} | jdg_61786 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 1dfe243975c576ba1820ca20b0d7ee17e2540e7b |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Modify the 'uri=' method in the FeedDataFile class to ensure that data is loaded before removing the file when the URI changes. This prevents the issue of having nothing to sync b... | ```Ruby
require 'digest/md5'
require 'yaml'
module Feed2Email
class FeedDataFile
def initialize(uri)
@uri = uri
@dirty = false
end
def uri=(new_uri)
return if new_uri == uri
data # load data if not already loaded
remove_file
mark_dirty
@uri = new_uri
end
... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 6, 'operations': 1}} | jdg_69063 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | e6a7548546b690118537ae2a52b63d39eea6580f |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Enhance the 'Page' model in the provided Django code by adding descriptive help_text to the 'time_from' and 'time_until' fields. The help_text should explain the purpose of these ... | ```Python
from django.db import models
from django.core.urlresolvers import reverse
class Chart(models.Model):
title = models.CharField(max_length=50)
url = models.CharField(max_length=1024)
def __unicode__(self):
return self.title
class Page(models.Model):
title = models.CharField(max_length=50)
slug = mod... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 12, 'operations': 2}} | jdg_33645 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 708efb79ed891baecc10bd1e32dc4249bb190a18 |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the ArticlesController by removing the implementation details of the index, show, create, update, and destroy methods, leaving them empty. Retain the before_filter, set_a... | ```Ruby
class ArticlesController < ApplicationController
before_filter :set_article, only: [:show, :update, :destroy]
def index
end
def show
end
def destroy
end
def update
end
def create
end
private
def set_article
@article = Article.find(params[:id])
end
def article_params
... | {'judging_instructions': ''} | {'language': 'Ruby', 'diff_stats': {'total_changes': 27, 'operations': 3}} | jdg_8758 | PrimeIntellect/real-world-swe-problems |
commitpack | llm_judgeable_groundtruth_similarity | 5a2fcbbc12c1876ff01ad3a4a14ad2077ffedf5c |
Below is an instruction to modify a code file along with the code file. Apply these instructions and return the adapted code:
Instruction:
Refactor the 'runtests.py' script to dynamically create doctest suites for modules. Replace the hardcoded module imports with a list of module names and use 'get_module' from 'fir... | ```Python
#!/usr/bin/python
import unittest
import doctest
import sys
from optparse import OptionParser
from firmant.utils import get_module
# Import this now to avoid it throwing errors.
import pytz
if __name__ == '__main__':
suite = unittest.TestSuite()
modules = ['firmant.du',
'firmant.ent... | {'judging_instructions': ''} | {'language': 'Python', 'diff_stats': {'total_changes': 19, 'operations': 2}} | jdg_16991 | PrimeIntellect/real-world-swe-problems |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.