Datasets:
original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Remove unreachable!() macro (upstream has it now).
Apply this change to `src/libhttp/lib.rs` and return the full updated file.
```rust
#[link(name = "http",
vers = "0.1-pre",
uuid = "d2ad8df0-547a-4ce1-99c6-a9da3b98fb3e",
url = "")];
#[comment = "Rust HTTP server"];
#[license = "MIT/ASL2"];
#[cr... | ```rust
#[link(name = "http",
vers = "0.1-pre",
uuid = "d2ad8df0-547a-4ce1-99c6-a9da3b98fb3e",
url = "")];
#[comment = "Rust HTTP server"];
#[license = "MIT/ASL2"];
#[crate_type = "lib"];
#[deny(non_camel_case_types)];
//#[deny(missing_doc)];
#[macro_escape];
extern mod extra;
pub mod buffer;
... | null | null |
Update the import due to wrong name
Apply this change to `Tests/LinuxMain.swift` and return the full updated file.
```swift
/**
* Copyright IBM Corporation 2016
*
* 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 ... | ```swift
/**
* Copyright IBM Corporation 2016
*
* 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 ... | null | null |
Fix compilation on FreeBSD 10.3 with default compiler
Apply this change to `fmacros.h` and return the full updated file.
```c
#ifndef __HIREDIS_FMACRO_H
#define __HIREDIS_FMACRO_H
#if defined(__linux__)
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#endif
#if defined(__CYGWIN__)
#include <sys/cdefs.h>
#endif
#if def... | ```c
#ifndef __HIREDIS_FMACRO_H
#define __HIREDIS_FMACRO_H
#if defined(__linux__)
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#endif
#if defined(__CYGWIN__)
#include <sys/cdefs.h>
#endif
#if defined(__sun__)
#define _POSIX_C_SOURCE 200112L
#else
#if !(defined(__APPLE__) && defined(__MACH__)) && !(defined(__FreeBSD__... | null | null |
Make sure we're using the latest minitest.
Apply this change to `harbor-ftp.gemspec` and return the full updated file.
```ruby
require_relative "lib/harbor/ftp/version"
Gem::Specification.new do |s|
s.name = "harbor-ftp"
s.summary = s.description = "Harbor FTP Server"
s.author = "Sam Smoot"
s.homepage = "htt... | ```ruby
require_relative "lib/harbor/ftp/version"
Gem::Specification.new do |s|
s.name = "harbor-ftp"
s.summary = s.description = "Harbor FTP Server"
s.author = "Sam Smoot"
s.homepage = "https://github.com/sam/harbor-ftp"
s.email = "ssmoot@gmail.com"
s.version = Harbor::FTP::VERSION
s.platform = "java"
... | null | null |
Tweak gemspec a little, trying to work around 'DefaultKey' issue, but to no avail
Apply this change to `master_slave_adapter.gemspec` and return the full updated file.
```ruby
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = 'master_slave_adapter_... | ```ruby
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = 'master_slave_adapter_soundcloud'
s.version = File.read('VERSION').to_s
s.date = '2011-06-21'
s.platform = Gem::Platform::RUBY
s.authors = [ 'Mauricio Linhares', 'Tor... | null | null |
Switch uuid to original implementation
The original code.google.com go-uuid package has now been migrated to github by Paul Borman, a Googler and a Golang core contributor.
Apply this change to `tokengen.go` and return the full updated file.
```go
package osin
import (
"encoding/base64"
"strings"
"github.com/sa... | ```go
package osin
import (
"encoding/base64"
"strings"
"github.com/pborman/uuid"
)
// AuthorizeTokenGenDefault is the default authorization token generator
type AuthorizeTokenGenDefault struct {
}
func removePadding(token string) string {
return strings.TrimRight(token, "=")
}
// GenerateAuthorizeToken genera... | null | null |
Remove persisting of unnecessary permission
Apply this change to `app/src/main/java/de/stephanlindauer/criticalmaps/utils/GpxUtils.java` and return the full updated file.
```java
package de.stephanlindauer.criticalmaps.utils;
import android.content.ContentResolver;
import android.content.Intent;
import android.os.Bu... | ```java
package de.stephanlindauer.criticalmaps.utils;
import android.content.ContentResolver;
import android.content.Intent;
import android.os.Build;
public class GpxUtils {
public static void persistPermissionOnFile(Intent data, ContentResolver contentResolver) {
final int permissionFlags = data.getFla... | null | null |
Make configuration true by default
Apply this change to `src/app/services/config/JSONConfiguration.ts` and return the full updated file.
```typescript
import {Configuration} from './Configuration';
import {TrueConfiguration} from './TrueConfiguration';
import {FalseConfiguration} from './FalseConfiguration';
export ... | ```typescript
import {Configuration} from './Configuration';
import {TrueConfiguration} from './TrueConfiguration';
import {FalseConfiguration} from './FalseConfiguration';
export class JSONConfiguration implements Configuration {
constructor(private config: Object) {
}
public isFieldMandatory(name: strin... | null | null |
Adjust test to handle fallout from r217102.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@217104 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/Misc/backend-optimization-failure.cpp` and return the full updated file.
```cpp
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -O3 -emit-llvm -... | ```cpp
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -O3 -emit-llvm -gline-tables-only -S -verify -o /dev/null
// REQUIRES: x86-registered-target
// Test verifies optimization failures generated by the backend are handled
// correctly by clang. LLVM tests verify all of the failure conditions.
void test_switch(... | null | null |
Add missing title to anhcors
Apply this change to `components/BlogPostPreview.tsx` and return the full updated file.
```typescript
import Link from "next/link"
import { FunctionComponent } from "react"
import TagsList from "./TagsList"
import BlogPostPreview from "../models/BlogPostPreview"
import FormattedDate from ... | ```typescript
import Link from "next/link"
import { FunctionComponent } from "react"
import TagsList from "./TagsList"
import BlogPostPreview from "../models/BlogPostPreview"
import FormattedDate from "./FormattedDate"
import HorizontalRule from "./HorizontalRule"
interface Props {
post: BlogPostPreview
}
const Blo... | null | null |
WIP: Implement tests for syscalls in example scheme
Apply this change to `filesystem/apps/example/main.rs` and return the full updated file.
```rust
use std::fs::File;
use std::io::{Read, Write};
use system::scheme::{Packet, Scheme};
extern crate system;
struct ExampleScheme;
impl Scheme for ExampleScheme {
}
f... | ```rust
use std::fs::File;
use std::io::{Read, Write};
use system::error::{Error, Result, ENOENT, EBADF};
use system::scheme::{Packet, Scheme};
extern crate system;
struct ExampleScheme;
impl Scheme for ExampleScheme {
fn open(&mut self, path: &str, flags: usize, mode: usize) -> Result {
println!("open ... | null | null |
Add method for querying active entities
Apply this change to `ECS/EntityComponentSystem.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ECS
{
public class EntityComponentSystem
{
... | ```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ECS
{
public class EntityComponentSystem
{
private EntityManager entityManager;
private SystemManager systemManager;
public EntityComponentSystem()
... | null | null |
Save only days with lessons
Apply this change to `app/src/main/java/com/goldenpiedevs/schedule/app/core/api/lessons/LessonsManager.kt` and return the full updated file.
```kotlin
package com.goldenpiedevs.schedule.app.core.api.lessons
import com.goldenpiedevs.schedule.app.core.dao.BaseResponseModel
import com.golden... | ```kotlin
package com.goldenpiedevs.schedule.app.core.api.lessons
import com.goldenpiedevs.schedule.app.core.dao.BaseResponseModel
import com.goldenpiedevs.schedule.app.core.dao.timetable.DaoWeekModel
import com.goldenpiedevs.schedule.app.core.dao.timetable.TimeTableData
import io.realm.Realm
import io.realm.RealmList... | null | null |
FIX : in handling of sample dataset
Apply this change to `mne/datasets/sample/__init__.py` and return the full updated file.
```python
# Author: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# License: BSD Style.
import os
import os.path as op
def data_path(path='.'):
"""Get path to local copy of Sample dat... | ```python
# Author: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# License: BSD Style.
import os
import os.path as op
def data_path(path='.'):
"""Get path to local copy of Sample dataset
Parameters
----------
dir : string
Location of where to look for the sample dataset.
If not s... | null | null |
Add orbfile write code to checkpoint file writing
Apply this change to `src/tests/test_hdf5.cc` and return the full updated file.
```cpp
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except... | ```cpp
/*
* Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | null | null |
Fix issue when running shellchek for the first time with docker
Apply this change to `scripts/install_shellcheck.sh` and return the full updated file.
```bash
#!/bin/bash
set -eu -o pipefail
# shellcheck disable=SC1091
os_id=$(. /etc/os-release; echo "$ID")
# Install ShellCheck
case $os_id in
ol | amzn)
cp "$... | ```bash
#!/bin/bash
set -eu -o pipefail
# shellcheck disable=SC1091
os_id=$(. /etc/os-release; echo "$ID")
# Install ShellCheck
case $os_id in
ol | amzn)
cp "$(cd "$(dirname "$0")/.." && pwd)/bin/shellcheck" /usr/local/bin/shellcheck
chmod +x /usr/local/bin/shellcheck
/usr/local/bin/shellcheck -V
;;... | null | null |
[BUILD] Remove the execution of InitRunfilesDir from InitXls. The InitXLS assumes that an executable has Runfiles and is a Runfile marker. Moreover, as XLS moves to a bazel toolchain implementation, toolchain executables are not a runfile or a runfile marker.
PiperOrigin-RevId: 382363810
Apply this change to `xls/com... | ```cpp
// Copyright 2020 The XLS Authors
//
// 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 a... | null | null |
Update the comment for Graph::GetEdge.
Apply this change to `graphgolf/graph.h` and return the full updated file.
```c
#include "base/base.h"
class Graph {
public:
typedef int16_t Node;
typedef int16_t Degree;
Graph(Node order, Degree degree)
: order_(order),
degree_(degree),
edges_(ord... | ```c
#include "base/base.h"
class Graph {
public:
typedef int16_t Node;
typedef int16_t Degree;
Graph(Node order, Degree degree)
: order_(order),
degree_(degree),
edges_(order * degree, -1) {}
inline Node order() { return order_; }
inline Degree degree() { return degree_; }
// Ret... | null | null |
Remove old inline code token meanings
Apply this change to `src/Parsing/Inline/Token.ts` and return the full updated file.
```typescript
export enum TokenMeaning {
Text,
EmphasisStart,
EmphasisEnd,
StressStart,
StressEnd,
InlineCode,
InlineCodeStart,
InlineCodeEnd,
RevisionDeletionStart,
RevisionD... | ```typescript
export enum TokenMeaning {
Text,
EmphasisStart,
EmphasisEnd,
StressStart,
StressEnd,
InlineCode,
RevisionDeletionStart,
RevisionDeletionEnd,
SpoilerStart,
SpoilerEnd,
InlineAsideStart,
InlineAsideEnd
}
export class Token {
constructor(
public meaning: TokenMeaning,
publi... | null | null |
Make content shortcuts support subclasses
Apply this change to `Stevia/Stevia/Stevia/Source/Stevia+Content.swift` and return the full updated file.
```swift
//
// Stevia+Content.swift
// LoginStevia
//
// Created by Sacha Durand Saint Omer on 01/10/15.
// Copyright © 2015 Sacha Durand Saint Omer. All rights reser... | ```swift
//
// Stevia+Content.swift
// LoginStevia
//
// Created by Sacha Durand Saint Omer on 01/10/15.
// Copyright © 2015 Sacha Durand Saint Omer. All rights reserved.
//
import UIKit
public extension UIButton {
public func text(t:String) -> Self {
setTitle(t, forState: .Normal)
return... | null | null |
Add passing spoiler block HTML test
Apply this change to `src/Test/Html/Config/ToggleSpoiler.ts` and return the full updated file.
```typescript
import { expect } from 'chai'
import Up from '../../../index'
import { InlineSpoilerNode } from '../../../SyntaxNodes/InlineSpoilerNode'
describe("The text in an inline sp... | ```typescript
import { expect } from 'chai'
import Up from '../../../index'
import { InlineSpoilerNode } from '../../../SyntaxNodes/InlineSpoilerNode'
import { SpoilerBlockNode } from '../../../SyntaxNodes/SpoilerBlockNode'
describe("The text in an inline spoiler's label", () => {
it("uses the provided term for 'to... | null | null |
Read config-file and cluster options from environ
This would make it DRY in scripts/wrappers with non-default values.
Apply this change to `carbonate/util.py` and return the full updated file.
```python
import fileinput
import os
import socket
import argparse
def local_addresses():
ips = socket.gethostbyname_e... | ```python
import fileinput
import os
import socket
import argparse
def local_addresses():
ips = socket.gethostbyname_ex(socket.gethostname())[2]
return set([ip for ip in ips if not ip.startswith("127.")][:1])
def common_parser(description='untitled'):
parser = argparse.ArgumentParser(
descriptio... | null | null |
Replace safarians with luchadors for HWCC
Apply this change to `app/roles.rb` and return the full updated file.
```ruby
require 'titleize'
module PublicRoles
extend Discordrb::Commands::CommandContainer
# Assuming case-sensitive, case-matched to Discord roles
public_roles = [
'Roleplayers',
'Safarians... | ```ruby
require 'titleize'
module PublicRoles
extend Discordrb::Commands::CommandContainer
# Assuming case-sensitive, case-matched to Discord roles
public_roles = [
'Roleplayers',
'Luchadors'
]
command :role, description: "Add or remove a public role on yourself", usage: "role <rolename>\nAvailable... | null | null |
Implement "Drop" trait for CodeCache
Apply this change to `src/chip8/codecache.rs` and return the full updated file.
```rust
extern crate libc;
use std::ops::Index;
use std::{ptr, mem};
use chip8::MEMORY_SIZE;
use chip8::codeblock::CodeBlock;
pub struct CodeCache {
code_blocks: [*mut CodeBlock; MEMORY_SIZE]
}
im... | ```rust
extern crate libc;
use std::ops::Index;
use std::{ptr, mem};
use chip8::MEMORY_SIZE;
use chip8::codeblock::CodeBlock;
pub struct CodeCache {
code_blocks: [*mut CodeBlock; MEMORY_SIZE]
}
impl CodeCache {
pub fn new() -> CodeCache {
CodeCache {
code_blocks: [ptr::null_mut(); MEMORY_SIZE]
}
}
pub f... | null | null |
Refactor program options and make them "temp" and "location"
* --temp to sort by temperature instead of location
* "location" will be vector of the places to look up
Apply this change to `main.cpp` and return the full updated file.
```cpp
#include <iostream>
#include "boost/program_options.hpp"
using namespace st... | ```cpp
#include <iostream>
#include "boost/program_options.hpp"
using namespace std;
namespace po = boost::program_options;
po::variables_map parse_args(int argc, char **argv) {
po::options_description desc("Accepted options");
desc.add_options()
("help", "produce help message")
("temp", "sor... | null | null |
[liuxia] Change count word to medium level.
Apply this change to `src/CSharpViaTest.Collections/30_MapReducePractices/CountNumberOfWordsInMultipleTextFiles.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CSharpViaTest.Collectio... | ```csharp
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CSharpViaTest.Collections.Annotations;
using CSharpViaTest.Collections.Helpers;
using Xunit;
namespace CSharpViaTest.Collections._30_MapReducePractices
{
[Medium]
public class CountNumberOfWordsInMultipleTextFi... | null | null |
Update back to business scenarios
Apply this change to `node-server/config.js` and return the full updated file.
```javascript
// Don't commit this file to your public repos. This config is for first-run
exports.creds = {
mongoose_auth_local: 'mongodb://localhost/tasklist', // Your mongo auth uri goes here
... | ```javascript
// Don't commit this file to your public repos. This config is for first-run
exports.creds = {
mongoose_auth_local: 'mongodb://localhost/tasklist', // Your mongo auth uri goes here
audience: 'http://localhost:8888/', // the Audience is the App URL when you registered the application.
iden... | null | null |
Migrate to @angular:2.0.0-rc.1. - partial test support
Apply this change to `generators/app/templates/karma-shim.js` and return the full updated file.
```javascript
'use strict';
Error.stackTraceLimit = Infinity;
require('es6-shim');
require('angular2/bundles/angular2-polyfills.js');
require('angular2/testing');
/*... | ```javascript
'use strict';
Error.stackTraceLimit = Infinity;
require('es6-shim');
require('reflect-metadata');
require('zone.js/dist/zone');
require('@angular/core/testing');
/*
Ok, this is kinda crazy. We can use the the context method on
require that webpack created in order to tell webpack
what files we actua... | null | null |
Convert mFunctions to anonymous objects
Apply this change to `src/m/MFunction.kt` and return the full updated file.
```kotlin
package m
/**
* Created by Aedan Smith.
*/
inline fun <reified I, reified O> mFunction(
noinline mFunction: (I) -> O
) = MFunctionWrapper0(
mFunction,
I::class.qual... | ```kotlin
package m
/**
* Created by Aedan Smith.
*/
inline fun <reified I, reified O> mFunction(noinline mFunction: (I) -> O) = object : (I) -> O {
override fun invoke(p1: I) = mFunction(p1)
override fun toString() = "(${I::class.qualifiedName}) -> ${O::class.qualifiedName}"
}
inline fun <reified I1, reif... | null | null |
Add comment about where opioid_measure data comes from
Apply this change to `openprescribing/frontend/management/commands/measure_sql/opioid_total_ome.sql` and return the full updated file.
```sql
SELECT
month,
practice,
pct,
SUM(quantity*dose_per_unit*ome_multiplier) AS total_ome
FROM
{project}.{hscic}.nor... | ```sql
SELECT
month,
practice,
pct,
SUM(quantity*dose_per_unit*ome_multiplier) AS total_ome
FROM
{project}.{hscic}.normalised_prescribing_standard AS presc
JOIN
-- data in richard.opioid_measure comes from:
-- https://docs.google.com/spreadsheets/d/1IjnHbYVszZKPmVSYydtMVzbDLPOmq8bOFq45QsSu6sE/edit?usp=sha... | null | null |
Fix bug caused by giving post detail view a new name
Apply this change to `service/urls.py` and return the full updated file.
```python
from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import servic... | ```python
from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.nodes.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserVie... | null | null |
Fix empty object instead of no body for default audience
The ticket seemed to indicate that if there is no audience specified, then
the request was to have an empty body. However, that leads to a 500 from
the API. Reading the associated plugin show that an empty object is
expected in that case.
Apply this change to `... | ```go
package api
import (
"errors"
"fmt"
)
var ErrAudienceTooLong = errors.New("the API only supports at most one element in the audience")
type OidcToken struct {
Token string `json:"token"`
}
func (c *Client) OidcToken(jobId string, audience ...string) (*OidcToken, *Response, error) {
type oidcTokenRequest s... | null | null |
Add missing import for object mapper to team members
Apply this change to `Drift/Models/TeamMember.swift` and return the full updated file.
```swift
//
// TeamMember.swift
// Drift
//
// Created by Brian McDonald on 31/08/2017.
// Copyright © 2017 Drift. All rights reserved.
//
import Foundation
class TeamMembe... | ```swift
//
// TeamMember.swift
// Drift
//
// Created by Brian McDonald on 31/08/2017.
// Copyright © 2017 Drift. All rights reserved.
//
import ObjectMapper
class TeamMember: Mappable {
var id: Int = 0
var avatarURL: String!
var bot: Bool!
required init?(map: Map) {
if map.JSON["ava... | null | null |
Add method to get current number of fetched items.
Apply this change to `gremlin-driver/src/main/java/com/tinkerpop/gremlin/driver/ResultSet.java` and return the full updated file.
```java
package com.tinkerpop.gremlin.driver;
import com.tinkerpop.gremlin.driver.message.ResponseMessage;
import java.util.ArrayList;
... | ```java
package com.tinkerpop.gremlin.driver;
import com.tinkerpop.gremlin.driver.message.ResponseMessage;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public class Resul... | null | null |
Fix alpha build and add __FBSDID.
PR: 70518
Apply this change to `lib/libc/alpha/gen/_set_tp.c` and return the full updated file.
```c
/*-
* Copyright (c) 2004 Doug Rabson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that th... | ```c
/*-
* Copyright (c) 2004 Doug Rabson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of co... | null | null |
Add `optional: true` to `belongs_to` to retain the rails<5 behaviour.
Apply this change to `app/models/spree/slide.rb` and return the full updated file.
```ruby
class Spree::Slide < ActiveRecord::Base
has_and_belongs_to_many :slide_locations,
class_name: 'Spree::SlideLocation',
... | ```ruby
class Spree::Slide < ActiveRecord::Base
has_and_belongs_to_many :slide_locations,
class_name: 'Spree::SlideLocation',
join_table: 'spree_slide_slide_locations'
has_attached_file :image,
url: '/spree/slides/:id/:style/:basename.:extens... | null | null |
Test with empty listener list to be sure.
Signed-off-by: Yoshi2889 <77953cd64cc4736aae27fa116356e02d2d97f7ce@gmail.com>
Apply this change to `tests/EventEmitterTest.php` and return the full updated file.
```php
<?php
/**
* Copyright 2017 The WildPHP Team
*
* You should have received a copy of the MIT license with... | ```php
<?php
/**
* Copyright 2017 The WildPHP Team
*
* You should have received a copy of the MIT license with the project.
* See the LICENSE file for more information.
*/
use WildPHP\Core\EventEmitter;
class EventEmitterTest extends \PHPUnit\Framework\TestCase
{
public function testFirst()
{
$eventEmitter =... | null | null |
[TSan][libdispatch] Make test work on Linux
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@357729 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/tsan/libdispatch/groups-destructor.cc` and return the full updated file.
```cpp
// RUN: %clangxx_tsan %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s --... | ```cpp
// RUN: %clangxx_tsan %s %link_libcxx_tsan -o %t
// RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
#include <dispatch/dispatch.h>
#include <memory>
#include <stdatomic.h>
#include <cstdio>
_Atomic(long) destructor_counter = 0;
struct MyStruct {
virtual ~MyStruct() {
usleep(1000... | null | null |
Use Python.h, not allobjects.h.
Don't call initall() (Experimental incompatible change!!!!!!)
Apply this change to `PC/dl_nt.c` and return the full updated file.
```c
/*
Entry point for the Windows NT DLL.
About the only reason for having this, is so initall() can automatically
be called, removing that burden (and... | ```c
/*
Entry point for the Windows NT DLL.
About the only reason for having this, is so initall() can automatically
be called, removing that burden (and possible source of frustration if
forgotten) from the programmer.
*/
#include "windows.h"
/* NT and Python share these */
#include "config.h"
#include "Python.h"... | null | null |
Add derive(Debug) to the error structure
Apply this change to `src/lib.rs` and return the full updated file.
```rust
// Systray Lib
#[macro_use]
extern crate log;
#[cfg(target_os = "windows")]
extern crate winapi;
#[cfg(target_os = "windows")]
extern crate kernel32;
#[cfg(target_os = "windows")]
extern crate user32;... | ```rust
// Systray Lib
#[macro_use]
extern crate log;
#[cfg(target_os = "windows")]
extern crate winapi;
#[cfg(target_os = "windows")]
extern crate kernel32;
#[cfg(target_os = "windows")]
extern crate user32;
#[cfg(target_os = "windows")]
extern crate shell32;
#[cfg(target_os = "windows")]
extern crate libc;
pub mod ... | null | null |
Generalize print_tree to work with different number of columns.
Apply this change to `conllu/tree_helpers.py` and return the full updated file.
```python
from __future__ import print_function, unicode_literals
from collections import namedtuple
TreeNode = namedtuple('TreeNode', ['data', 'children'])
def create_tree... | ```python
from __future__ import print_function, unicode_literals
from collections import namedtuple
TreeNode = namedtuple('TreeNode', ['data', 'children'])
def create_tree(node_children_mapping, start=0):
subtree = [
TreeNode(child, create_tree(node_children_mapping, child["id"]))
for child in no... | null | null |
Add modifying article link iterator typedef
Apply this change to `src/Article.h` and return the full updated file.
```c
#ifndef _ARTICLE_H
#define _ARTICLE_H
#include <string>
#include <vector>
/*!
* represents a Wikipedia (Mediawiki) and its links
*/
class Article
{
public:
typedef std::vector<Article*> ... | ```c
#ifndef _ARTICLE_H
#define _ARTICLE_H
#include <string>
#include <vector>
/*!
* represents a Wikipedia (Mediawiki) and its links
*/
class Article
{
public:
//! representation of links to other articles
typedef std::vector<Article*> ArticleLinkStorage;
//! representation of iterator ... | null | null |
Use plumber to prenvent babel from crashing gulp
Apply this change to `gulpfile.js` and return the full updated file.
```javascript
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const gulp = require('gulp');
const babel = require('gulp-babel');
const del = require('del');
const babelRc = JSON.pa... | ```javascript
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const gulp = require('gulp');
const watch = require('gulp-watch');
const plumber = require('gulp-plumber');
const babel = require('gulp-babel');
const del = require('del');
const babelRc = JSON.parse(fs.readFileSync('./.babelrc.node'));
... | null | null |
Remove undefined import in coach plugin.
Apply this change to `kolibri/plugins/coach/kolibri_plugin.py` and return the full updated file.
```python
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from . import hooks
from kolibri.core.auth.constants... | ```python
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from kolibri.core.auth.constants.user_kinds import COACH
from kolibri.core.hooks import NavigationHook
from kolibri.core.hooks import RoleBasedRedirectHook
from kolibri.core.webpack import hoo... | null | null |
Make it harder to accidentally reset prod database
Apply this change to `Anlab.Mvc/Controllers/SystemController.cs` and return the full updated file.
```csharp
using System;
using AnlabMvc.Models.Roles;
using AnlabMvc.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Syste... | ```csharp
using System;
using AnlabMvc.Models.Roles;
using AnlabMvc.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace AnlabMvc.Controllers
{
[Authorize(Roles = RoleCodes.Admin)]
public class SystemController : ApplicationContro... | null | null |
Add ParseCookie and handle parsing errors
Apply this change to `parse.go` and return the full updated file.
```go
package i18n
import (
"net/http"
"golang.org/x/text/language"
)
// A Parser is a funcion that returns a list of accepted languages, most preferred first.
type Parser func(*http.Request) []language.Ta... | ```go
package i18n
import (
"net/http"
"golang.org/x/text/language"
)
// A Parser is a funcion that returns a list of accepted languages, most preferred first.
type Parser func(*http.Request) []language.Tag
// ParseAcceptLanguage parses the Accept-Language header.
func ParseAcceptLanguage(r *http.Request) []langu... | null | null |
Make it into a package
Apply this change to `setup.py` and return the full updated file.
```python
from distutils.core import setup
setup(
name='passphrase',
version='0.0.2',
author='Rob Martin @version2beta',
author_email='rob@version2beta.com',
packages=['passphrase'],
scripts=[],
url='... | ```python
from distutils.core import setup
setup(
name='passphrase',
version='0.0.2',
author='Rob Martin @version2beta',
author_email='rob@version2beta.com',
packages=['passphrase'],
scripts=[],
url='http://pypi.python.org/pypi/passphrase/',
license='LICENSE.txt',
description='List ... | null | null |
Fix PreciseDelay to work properly
Apply this change to `robotpy_ext/misc/precise_delay.py` and return the full updated file.
```python
import wpilib
class PreciseDelay:
'''
Used to synchronize a timing loop.
Usage::
delay = PreciseDelay(time_to_delay)
... | ```python
import hal
import time
import wpilib
class PreciseDelay:
'''
Used to synchronize a timing loop. Will delay precisely so that
the next invocation of your loop happens at the same period, as long
as your code does not run longer than the length of the delay.
Our e... | null | null |
Print server port on app launch
[#29]
Apply this change to `src/main/kotlin/com/jgreubel/TreelineApplication.kt` and return the full updated file.
```kotlin
package com.jgreubel
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
@SpringBootApplicat... | ```kotlin
package com.jgreubel
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
@SpringBootApplication
open class TreelineApplication
fun main(args: Array<String>) {
val app = SpringApplication.run(TreelineApplication::class.java, *args)
pr... | null | null |
[build] Remove usage of a GNU sed extension, for FreeBSD portability
Signed-off-by: Bertrand Lorentz <eb7ac131ef7bff6d2ebccd6e5bf9a7cb6485cf2c@gmail.com>
Apply this change to `data/desktop-files/update-desktop-file.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
DESKTOP_SOURCE="$1"
VERSION="$2"
UP... | ```bash
#!/usr/bin/env bash
DESKTOP_SOURCE="$1"
VERSION="$2"
UPDATE_MIME_FILE="$3"
MIMETYPES_FILE="$(basename "$DESKTOP_SOURCE" .in.in).mime"
echo "[Desktop Entry]"
(cat "$DESKTOP_SOURCE" && cat common.desktop) |
sed "s/\@VERSION\@/${VERSION}/g"
if [[ -f "$MIMETYPES_FILE" ]]; then
MIMETYPES=$(
grep -vE '^[[:spa... | null | null |
Fix input test on Mac for ControlModifier
On Mac OS X Qt's ControlModifier is actually the Cmd key and
generates the input sequence <D-Key>.
Apply this change to `test/tst_input.cpp` and return the full updated file.
```cpp
#include <QtTest/QtTest>
#include <gui/input.h>
class TestInput: public QObject
{
Q_OBJECT... | ```cpp
#include <QtTest/QtTest>
#include <gui/input.h>
class TestInput: public QObject
{
Q_OBJECT
private slots:
void specialKeys();
private:
NeovimQt::InputConv input;
};
void TestInput::specialKeys()
{
foreach(int k, input.specialKeys.keys()) {
QCOMPARE(input.convertKey("", k, Qt::NoModifier),
QString("<%... | null | null |
Add summary for spin control class
Apply this change to `Settings/Controls/Spinner.h` and return the full updated file.
```c
#pragma once
#include "Control.h"
#include <CommCtrl.h>
class Spinner : public Control {
public:
Spinner() {
}
Spinner(int id, HWND parent) :
Control(id, parent) {
}
... | ```c
#pragma once
#include "Control.h"
#include <CommCtrl.h>
/// <summary>
/// Manages a 'spin control': a numeric edit box with a up/down 'buddy' to
/// increment or decrement the current value of the box.
/// </summary>
class Spinner : public Control {
public:
Spinner() {
}
Spinner(int id, HWND paren... | null | null |
Fix left join in to_rate scope
Apply this change to `app/models/submission.rb` and return the full updated file.
```ruby
class Submission < ActiveRecord::Base
validates :full_name, :age, :email, :codeacademy_username, :description, :html, :css, :js, :ror, :db,
:programming_others, :english, :operating_s... | ```ruby
class Submission < ActiveRecord::Base
validates :full_name, :age, :email, :codeacademy_username, :description, :html, :css, :js, :ror, :db,
:programming_others, :english, :operating_system, :goals, presence: true
validates_inclusion_of :first_time, in: [true, false]
validates :age, numericalit... | null | null |
Fix issues with empty lists
Apply this change to `lib/kempelen/API/responses/reviewable_hits_response.rb` and return the full updated file.
```ruby
module Kempelen
module API
module Responses
class ReviewableHitsResponse < Base
attr_accessor :number_of_results
attr_accessor :page_number
... | ```ruby
module Kempelen
module API
module Responses
class ReviewableHitsResponse < Base
attr_accessor :number_of_results
attr_accessor :page_number
attr_accessor :total_number_of_results
attr_accessor :hits
def initialize(response)
super()
@hits ... | null | null |
Add $ method to ShellContextType.
Apply this change to `SwiftShell/Command.swift` and return the full updated file.
```swift
/*
* Released under the MIT License (MIT), http://opensource.org/licenses/MIT
*
* Copyright (c) 2015 Kåre Morstøl, NotTooBad Software (nottoobadsoftware.com)
*
*/
import Foundation
public fun... | ```swift
/*
* Released under the MIT License (MIT), http://opensource.org/licenses/MIT
*
* Copyright (c) 2015 Kåre Morstøl, NotTooBad Software (nottoobadsoftware.com)
*
*/
import Foundation
/** Print message to standard error and halt execution. */
@noreturn public func printErrorAndExit <T> (errormessage: T, errorc... | null | null |
Exit the pancake test with success instead of failure and print the
hash values too.
Apply this change to `src/pancake/PancakeTest.cpp` and return the full updated file.
```cpp
/**
* \file PancakeTest.cpp
*
* Some simple tests to make sure the pancake domain works properly.
*
* \author eaburns
* \date 18-01-201... | ```cpp
/**
* \file PancakeTest.cpp
*
* Some simple tests to make sure the pancake domain works properly.
*
* \author eaburns
* \date 18-01-2010
*/
#include "pancake/PancakeTypes.hpp"
#include "pancake/PancakeState.hpp"
#include <stdlib.h>
int main(void)
{
boost::array<Pancake, 14> cakes;
for (unsigned int ... | null | null |
Allow batchjobstate type to exist in any schema, not just public
Apply this change to `FUNCTIONS/is_valid_function.sql` and return the full updated file.
```sql
CREATE OR REPLACE FUNCTION cron.Is_Valid_Function(_Function regprocedure)
RETURNS boolean
LANGUAGE sql
STABLE
SET search_path TO public, pg_temp
AS $FUNC$
SE... | ```sql
CREATE OR REPLACE FUNCTION cron.Is_Valid_Function(_Function regprocedure)
RETURNS boolean
LANGUAGE sql
STABLE
SET search_path TO public, pg_temp
AS $FUNC$
SELECT TRUE FROM pg_catalog.pg_proc
-- All functions registered in Jobs must return BATCHJOBSTATE which is just an ENUM 'AGAIN' or 'DONE',
-- to indicate whet... | null | null |
Update testing script to use cargo
Apply this change to `_test/check-exercises.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
tmp=${TMPDIR:-/tmp/}
check_assignment () {
intest="$1"
testfn=${intest##*/}
assignment=${testfn%_test.rs}
workdir=$(mktemp -d "${tmp}${assignment}.XXXXXXXXXX"... | ```bash
#!/usr/bin/bash
set -e
tmp=${TMPDIR:-/tmp/}
# An exercise worth testing is defined here as any top level directory with
# a 'tests' directory
for exercise in */tests; do
# This assumes that exercises are only one directory deep
# and that the primary module is named the same as the directory
... | null | null |
Add better error message when Gridhook fires but sengrid adapter is not loaded.
Apply this change to `lib/email_events/railtie.rb` and return the full updated file.
```ruby
require 'rails'
module EmailEvents
class Railtie < Rails::Railtie
initializer 'email_events.initialize', after: :load_config_initializers ... | ```ruby
require 'rails'
module EmailEvents
class Railtie < Rails::Railtie
initializer 'email_events.initialize', after: :load_config_initializers do
ActiveSupport.on_load(:action_mailer) do
include EmailEvents::Mailer
end
EmailEvents.initialize
# Gridhook gets upset when it draw... | null | null |
Build and print the trie
Apply this change to `ProgrammingPraxis/red_squiggles.cs` and return the full updated file.
```csharp
// https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/
//
// Your challenge today is to implement a real time spell checker and indicat... | ```csharp
// https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/
//
// Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words
//
using System;
using System... | null | null |
Add HTTP status code to logs
This adds the status code to the response log message to make it easier
to diagnose issues. It also replaces the placeholder "Success" message
with the decoded value of the HTTP Status, resulting in messages like:
INFO[0041] Response: Temporary Redirect code=307
...and s... | ```go
package server
import (
"net/http"
"time"
"github.com/influxdata/chronograf"
)
type logResponseWriter struct {
http.ResponseWriter
responseCode int
}
func (l *logResponseWriter) WriteHeader(status int) {
l.responseCode = status
l.ResponseWriter.WriteHeader(status)
}
// Logger is middleware that logs ... | null | null |
Remove redundant 'repo' in WrapperPath()
Apply this change to `wrapper.py` and return the full updated file.
```python
#!/usr/bin/env python
#
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | ```python
#!/usr/bin/env python
#
# Copyright (C) 2014 The Android Open Source Project
#
# 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
#
# ... | null | null |
Use STB Image instead of SDL Image
Apply this change to `src/texture.cpp` and return the full updated file.
```cpp
#include "texture.hpp"
#include <string>
#include <SDL_image.h>
const std::string Texture::filename(const std::string &name)
{
return "/textures/" + name;
}
Texture::Texture(const Adapter &adapter,... | ```cpp
#include "texture.hpp"
#include <string>
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ASSERT(x)
#define STBI_ONLY_PNG
#include <stb_image.h>
const std::string Texture::filename(const std::string &name)
{
return "/textures/" + name;
}
Texture::Texture(const Adapter &adapter, const std::string &name)
{
GL... | null | null |
Use static methods for options
Apply this change to `Games-Engine/src/net/kirauks/minigames/engine/utils/Options.java` and return the full updated file.
```java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the ... | ```java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package net.kirauks.minigames.engine.utils;
import javafx.scene.input.KeyCode;
/**
*
* @author Karl
*/
public class Optio... | null | null |
Remove the PartialOrd bound due to some limitation of the genericity in Rust.
Apply this change to `src/libinterval/ops.rs` and return the full updated file.
```rust
// Copyright 2015 Pierre Talbot (IRCAM)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compl... | ```rust
// Copyright 2015 Pierre Talbot (IRCAM)
// 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 a... | null | null |
Allow a user id in the modified file, so we can force-update their wand and notify them
Apply this change to `Magic/src/main/java/com/elmakers/mine/bukkit/magic/ConfigCheckTask.java` and return the full updated file.
```java
package com.elmakers.mine.bukkit.magic;
import java.io.File;
import org.bukkit.Bukkit;
pub... | ```java
package com.elmakers.mine.bukkit.magic;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.UUID;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import com.google.gson.Gson;
import... | null | null |
Fix crush whe string is empty
Apply this change to `app/src/main/kotlin/com/popalay/cardme/utils/extensions/StringExt.kt` and return the full updated file.
```kotlin
package com.popalay.cardme.utils.extensions
fun String.firstLetters(maxLetters: Int = 2): String {
return if (this.isBlank()) "" else split(" ")
... | ```kotlin
package com.popalay.cardme.utils.extensions
fun String.firstLetters(maxLetters: Int = 2): String {
return if (this.isBlank()) "" else split(" ")
.take(maxLetters)
.map { if (it.isBlank()) "" else it[0].toString() }
.reduce { acc, s -> acc + s }
}
fun String.clean(): S... | null | null |
Change expected type of value in registerEditable
Apply this change to `packages/tux/src/services/editor.ts` and return the full updated file.
```typescript
const schema = new Map()
export interface Field {
field: string,
label: string,
component: React.ReactElement<any>,
props?: Object
}
export interface M... | ```typescript
const schema = new Map()
export interface Field {
field: string,
label: string,
component: React.ReactElement<any>,
props?: Object
}
export interface Meta {
type: string,
editorSchema?: Array<Field>,
name?: string,
}
export function registerEditable(
type: string,
value: Array<Field> ... | null | null |
Change the test not to rely on internals.
Apply this change to `tests/run-pass/concurrency/tls_lib_drop.rs` and return the full updated file.
```rust
// ignore-windows: Concurrency on Windows is not supported yet.
//! Check that destructors of the library thread locals are executed immediately
//! after a thread ter... | ```rust
// ignore-windows: Concurrency on Windows is not supported yet.
//! Check that destructors of the library thread locals are executed immediately
//! after a thread terminates.
use std::cell::RefCell;
use std::thread;
struct TestCell {
value: RefCell<u8>,
}
impl Drop for TestCell {
fn drop(&mut self)... | null | null |
Use $routeParams for retrieving project name
Apply this change to `bugminer-server/src/main/frontend/app/js/app.js` and return the full updated file.
```javascript
(function(angular) {
'use strict';
var app = angular.module('bugminerApp', ['ngResource', 'ngRoute']);
app.config(['$routeProvider', function($rout... | ```javascript
(function(angular) {
'use strict';
var app = angular.module('bugminerApp', ['ngResource', 'ngRoute']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'partials/projects/index.html',
controller: 'ProjectsCtrl'
})
.when('/projects/... | null | null |
Update prod mode check to reflect changes in angular core
Apply this change to `src/utils/ng-validate.ts` and return the full updated file.
```typescript
import {messageJumpContext, browserSubscribeOnce} from '../communication/message-dispatch';
import {MessageFactory} from '../communication/message-factory';
import ... | ```typescript
import {messageJumpContext, browserSubscribeOnce} from '../communication/message-dispatch';
import {MessageFactory} from '../communication/message-factory';
import {MessageType} from '../communication/message-type';
import {send} from '../backend/indirect-connection';
declare const getAllAngularTestabili... | null | null |
Fix false boolean match (wrong semantics)
Apply this change to `org.metaborg.meta.lang.dynsem.interpreter/src/main/java/org/metaborg/meta/lang/dynsem/interpreter/nodes/matching/FalseLiteralTermMatchPattern.java` and return the full updated file.
```java
package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching... | ```java
package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;
public abstract class FalseLiteralTermMatchPattern extends LiteralMatchPattern {
public FalseLiteralTermMatchPattern(SourceSection source) {... | null | null |
Update application entry point to use custom controller implementation.
Apply this change to `src/main/java/com/solsticesquared/schelling/AppEntry.java` and return the full updated file.
```java
/*
* Copyright 2016 Will Knez <wbknez.dev@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");... | ```java
/*
* Copyright 2016 Will Knez <wbknez.dev@gmail.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
*
* Unless required by... | null | null |
Add "periodicnoise" to lock filename
Apply this change to `cmd/pn/locking.go` and return the full updated file.
```go
package main
import (
"github.com/nightlyone/lockfile"
"os"
"path/filepath"
)
// Get name of lock file, which is derived from the monitoring event name
func getLockfileName() string {
return fil... | ```go
package main
import (
"github.com/nightlyone/lockfile"
"os"
"path/filepath"
)
// Create a new lock file
func createLock() (lockfile.Lockfile, error) {
filename := filepath.Join(os.TempDir(), "periodicnoise", monitoringEvent, monitoringEvent+".lock")
if err := os.MkdirAll(filepath.Dir(filename), 0700); err... | null | null |
Add id and make fields work with Ember default JSON serialization
Apply this change to `game/game.go` and return the full updated file.
```go
package game
import (
"fmt"
)
type Game struct {
Name string
SetupRules []SetupRule
}
func NewGame(name string, rules []SetupRule) *Game {
return &Game{
Name: na... | ```go
package game
import (
"fmt"
)
type Game struct {
Id uint `json:"id"`
Name string `json:"name"`
SetupRules []SetupRule
}
func NewGame(name string, rules []SetupRule) *Game {
return &Game{
Name: name,
SetupRules: rules,
}
}
func (game *Game) PrintSetupRules() {
for _,r := range game.SetupR... | null | null |
Remove greenkeeper directories from gh-pages
Apply this change to `buildtools/cleanup-ghpages.py` and return the full updated file.
```python
#! python
import sys
import requests
import urllib3
from os import listdir
from shutil import rmtree
from json import loads
urllib3.disable_warnings()
def main():
url =... | ```python
#! python
import sys
import requests
import urllib3
from os import listdir
from shutil import rmtree
from json import loads
urllib3.disable_warnings()
def main():
url = "https://api.github.com/repos/{}/ngeo/branches?per_page=100".format(sys.argv[1])
try:
json = requests.get(url).json()
... | null | null |
Fix bug: call reply method on messenger
Apply this change to `lib/server/model.js` and return the full updated file.
```javascript
'use strict';
const CommonModel = require('../common/model.js');
class ServerModel extends CommonModel {
constructor(validator, messenger, dbStorage, config, jwt) {
super(validato... | ```javascript
'use strict';
const CommonModel = require('../common/model.js');
class ServerModel extends CommonModel {
constructor(validator, messenger, dbStorage, config, jwt) {
super(validator, messenger);
this.db = dbStorage;
this.config = config;
this.jwt = jwt;
}
signinPassword(event) {
... | null | null |
Put everything in the precache?
Apply this change to `workbox.config.js` and return the full updated file.
```javascript
const path = require('path');
const BUILD_DIR = 'dist';
module.exports = {
globDirectory: BUILD_DIR,
globPatterns: ['/', '**/*.{js,css,woff2,webmanifest}'],
swSrc: path.join(BUILD_DIR, 'ser... | ```javascript
const path = require('path');
const BUILD_DIR = 'dist';
module.exports = {
globDirectory: BUILD_DIR,
globPatterns: ['*', '**/*'],
swSrc: path.join(BUILD_DIR, 'service-worker.js'),
swDest: path.join(BUILD_DIR, 'service-worker.js'),
mode: 'production',
};
``` | null | null |
Fix sorting order for food browsing
Apply this change to `FoodDataSQL/src/main/resources/sql/user/category_contents_foods.sql` and return the full updated file.
```sql
SELECT code, description, coalesce(fl.local_description, flp.local_description) as local_description
FROM foods_categories
INNER JOIN foods_l... | ```sql
SELECT code, description, coalesce(fl.local_description, flp.local_description) as local_description
FROM foods_categories
INNER JOIN foods_local_lists ON foods_categories.food_code = foods_local_lists.food_code AND foods_local_lists.locale_id = {locale_id}
LEFT JOIN foods ON foods.code = foods... | null | null |
Include what you use fixes.
Relying on transitive dependencies for what you are going to use is a bad idea because it can break on changes done by said transitive dependencies.
This CL adds necessary headers for accessing gRPC.
PiperOrigin-RevId: 240629991
Apply this change to `tensorflow/core/distributed_runtime/rp... | ```c
/* Copyright 2016 The TensorFlow 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 required by applicable law... | null | null |
Change permission nodes to lowercase
Apply this change to `src/main/kotlin/com/projectcitybuild/spigot/modules/ranks/RankMapper.kt` and return the full updated file.
```kotlin
package com.projectcitybuild.spigot.modules.ranks
import com.projectcitybuild.entities.models.Group
object RankMapper {
fun mapGroupsTo... | ```kotlin
package com.projectcitybuild.spigot.modules.ranks
import com.projectcitybuild.entities.models.Group
object RankMapper {
fun mapGroupsToPermissionGroups(groups: List<Group>): List<String> {
val permissionGroups = mutableSetOf<String>()
// TODO: [@andy] use Config file instead of hardcod... | null | null |
gatekeeper: Add the core datastructure and some items
Apply this change to `src/gatekeeper/main.go` and return the full updated file.
```go
package main
import (
"io"
"log"
"net/http"
)
func main() {
http.HandleFunc("/version", func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "gatekeeper v0")... | ```go
package main
import (
"errors"
"io"
"log"
"net/http"
)
type gatekeeper struct {
objects map[string] struct {
value string
owner string
permissions map[string]bool
}
owners map[string]bool
}
func(g *gatekeeper) Get(item, key string) (value string, err error) {
er... | null | null |
Upgrade 'logging' to Groovy 3
Apply this change to `subprojects/logging/build.gradle.kts` and return the full updated file.
```kotlin
plugins {
id("gradlebuild.distribution.api-java")
}
description = "Logging infrastructure"
gradlebuildJava.usedInWorkers()
dependencies {
api(libs.slf4jApi)
implementat... | ```kotlin
plugins {
id("gradlebuild.distribution.api-java")
}
description = "Logging infrastructure"
gradlebuildJava.usedInWorkers()
dependencies {
api(libs.slf4jApi)
implementation(project(":base-services"))
implementation(project(":messaging"))
implementation(project(":cli"))
implementatio... | null | null |
Use 'if let' in 'SemaphorePool', because 'if let' is not slow in that context
The previous version left a small window open for a race condition leading to dereferencing nil. This version should be impervious to this.
Apply this change to `concurrency/queue/semaphorepool.swift` and return the full updated file.
```s... | ```swift
//
// semaphorepool.swift
// Channels
//
// Created by Guillaume Lessard on 2014-12-16.
// Copyright (c) 2014 Guillaume Lessard. All rights reserved.
//
import Darwin
struct SemaphorePool
{
static let poolq = ObjectQueue<dispatch_semaphore_t>()
static func enqueue(s: dispatch_semaphore_t)
{
po... | null | null |
Use require to fix route issue on unit testing.
Apply this change to `src/Http/routes.php` and return the full updated file.
```php
<?php
/**
* Administrator routes main entry point.
*
* @prefix /administrator
* @middleware("administrator") /administrator
* @var \Illuminate\Routing\Router $router
*/
use Yajra\... | ```php
<?php
/**
* Administrator routes main entry point.
*
* @prefix /administrator
* @middleware("administrator") /administrator
* @var \Illuminate\Routing\Router $router
*/
use Yajra\CMS\Http\Controllers\DashboardController;
$router->get('/', DashboardController::class . '@index')->name('index');
require 'r... | null | null |
Change docker run script to check for postgres
Apply this change to `run_docker.sh` and return the full updated file.
```bash
# docker run --add-host=db:172.17.0.2 -p 8000:8000 -v /code:./src -t -i django_all /bin/bash
docker run --add-host=db:172.17.0.2 -v $(pwd)/src:/code -p 8000:8000 -t -i django_web python /code/... | ```bash
# --add-host=db:172.17.0.2
#get postgres ip
id=$(docker ps -q -f image=postgres)
if [ -z "$id" ]
then
echo "[!] Error: Start the postgres image before running django! Try: docker run -d postgres"
return
fi
docker run --link $id:db -v $(pwd)/src:/code -p 8000:8000 -t -i django_web python /code... | null | null |
Improve output of Challenge 3
Apply this change to `set1/challenge3/src/main.rs` and return the full updated file.
```rust
// Crypto challenge Set1 / Challenge 3
// Decrypt single XOR chiffre
extern crate codec;
extern crate challenge3;
#[cfg(not(test))]
fn main() {
let args = std::os::args();
if args.... | ```rust
// Crypto challenge Set1 / Challenge 3
// Decrypt single XOR chiffre
extern crate codec;
extern crate challenge3;
#[cfg(not(test))]
fn main() {
let args = std::os::args();
if args.len() != 2 {
println!("USAGE: challenge3 HEX_ENCODED_STRING");
} else {
let input = args[1].as_sl... | null | null |
Remove unused/incorrect meters/angles conversion code.
Apply this change to `Sources/ARKit-CoreLocation/Extensions/BaseTypes+Extensions.swift` and return the full updated file.
```swift
//
// BaseTypes+Extensions.swift
// ARKit+CoreLocation
//
// Created by Ilya Seliverstov on 08/08/2017.
// Copyright © 2017 Proj... | ```swift
//
// BaseTypes+Extensions.swift
// ARKit+CoreLocation
//
// Created by Ilya Seliverstov on 08/08/2017.
// Copyright © 2017 Project Dent. All rights reserved.
//
import Foundation
public extension Float {
var short: String { return String(format: "%.2f", self) }
}
public extension Int {
var shor... | null | null |
End of preview. Expand in Data Studio
Commit-Message Code Edits
Code-change tasks from real commits: an instruction (commit message) and the edited code.
| Rows | 2,000 |
| Domain | programming |
| Format | data.parquet, one row per example |
| Licence | mit |
| Built for | supervised fine-tuning (SFT) experiments on Adaption AutoScientist |
Columns
| Column | Description |
|---|---|
original_prompt |
The prompt (user turn) as uploaded. |
original_completion |
The target response as uploaded. |
enhanced_prompt |
Empty in this dataset. |
enhanced_completion |
Empty in this dataset. |
How it was built
Sampled from CommitPackFT.
Sources and licence
- bigcode/commitpackft (MIT)
Notes
- Columns
enhanced_prompt,enhanced_completionare empty in this dataset (the Adaption export reserves them for rewritten text).
Loading
from datasets import load_dataset
ds = load_dataset("rodriguescarson/adaption-codeskill-raw-commitpack-2k", split="train")
import pandas as pd
df = pd.read_parquet("hf://datasets/rodriguescarson/adaption-codeskill-raw-commitpack-2k/data.parquet")
Published by Carson Rodrigues (Hugging Face, Kaggle).
- Downloads last month
- 47