original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Change Transactions Explorer journey to GOV.UK
Apply this change to `journeys/transactions_explorer_journey.rb` and return the full updated file.
```ruby
class TransactionsExplorerJourney < BaseJourney
def run()
@browser.goto 'gov.uk/performance'
sleep 5
moveToEl(@browser.link(:text => 'Transactions E... | ```ruby
class TransactionsExplorerJourney < BaseJourney
def run()
@browser.goto 'gov.uk/performance'
sleep 4
moveToEl(@browser.link(:text => 'Transactions Explorer'), { :click => true })
sleep 5
moveToEl(@browser.link(:text => 'High-volume services'), { :click => true })
sleep 8
moveTo... | null | null |
Add more controllers to demo
Apply this change to `Pod/PagesDemo/AppDelegate.swift` and return the full updated file.
```swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOpt... | ```swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let viewController1 = UIViewController()
viewControll... | null | null |
Remove govuk_setenv as we're setting it manually
Apply this change to `jenkins.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
rm -f Gemfile.lock
bundle install --path "${HOME}/bundles/${JOB_NAME}"
export GOVUK_APP_DOMAIN=development
govuk_setenv default bundle exec rake test
govuk_setenv default bun... | ```bash
#!/bin/bash
set -e
rm -f Gemfile.lock
bundle install --path "${HOME}/bundles/${JOB_NAME}"
export GOVUK_APP_DOMAIN=development
bundle exec rake test
bundle exec rake publish_gem
``` | null | null |
Remove explicit rootProject references in root cleanup plugin
Apply this change to `buildSrc/subprojects/cleanup/src/main/kotlin/gradlebuild/root-cleanup.gradle.kts` and return the full updated file.
```kotlin
/*
* Copyright 2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (t... | ```kotlin
/*
* Copyright 2020 the original author or 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 ... | null | null |
Fix derived constructor to call base class constructor
Apply this change to `src/mjolnir/directededgebuilder.cc` and return the full updated file.
```cpp
#include "mjolnir/directededgebuilder.h"
namespace valhalla {
namespace mjolnir {
// Default constructor
DirectedEdgeBuilder::DirectedEdgeBuilder()
: speed_(0... | ```cpp
#include "mjolnir/directededgebuilder.h"
namespace valhalla {
namespace mjolnir {
// Default constructor
DirectedEdgeBuilder::DirectedEdgeBuilder()
: DirectedEdge() {
}
// Sets the length of the edge in kilometers.
void DirectedEdgeBuilder::length(const float length) {
length_ = length;
}
// Sets the end... | null | null |
Fix bugs that native functions with parameters are not instantiable due to parsing mistakes
Apply this change to `NBi.Core/Transformation/Transformer/NativeTransformationfactory.cs` and return the full updated file.
```csharp
using NBi.Core.Transformation.Transformer.Native;
using System;
using System.Collections.Ge... | ```csharp
using NBi.Core.Transformation.Transformer.Native;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NBi.Core.Transformation.Transformer
{
public class NativeTransformationFactory
{
public ... | null | null |
Make it easy to compile-test Sensorama
Apply this change to `scripts/gen_files.sh` and return the full updated file.
```bash
#!/bin/sh
[ -z "$FABRIC_API_KEY" ] && echo "FABRIC_API_KEY can't be empty" && exit 1
[ -z "$FABRIC_BUILD_SECRET" ] && echo "FABRIC_BUILD_SECRET can't be empty" && exit 1
BUILD_INFO="`date +%Y... | ```bash
#!/bin/sh
env_gen () {
VARNAME=$1
eval VARVAL="\$$VARNAME"
if [ -z "$VARVAL" ]; then
echo "// $VARNAME is empty!!!! Project may not work as expected" | tee .wrong_env_vars
VARVAL=""
fi
echo "const static char *$VARNAME = \"$VARVAL\";"
}
BUILD_INFO="`date +%Y%m%d.%H%M`;`hostname`;`whoami`(`id -u`)"
#... | null | null |
Remove duplicate code; fix docblock
Apply this change to `src/Inline/Element/Image.php` and return the full updated file.
```php
<?php
/*
* This file is part of the league/commonmark package.
*
* (c) Colin O'Dell <colinodell@gmail.com>
*
* Original code based on the CommonMark JS reference parser (http://bitly.... | ```php
<?php
/*
* This file is part of the league/commonmark package.
*
* (c) Colin O'Dell <colinodell@gmail.com>
*
* Original code based on the CommonMark JS reference parser (http://bitly.com/commonmarkjs)
* - (c) John MacFarlane
*
* For the full copyright and license information, please view the LICENSE
*... | null | null |
Set canvas HTML element height to 100% so it follows the height of the browser.
Apply this change to `src/main/kotlin/threed/main.kt` and return the full updated file.
```kotlin
package threed
import org.khronos.webgl.WebGLRenderingContext
import org.w3c.dom.HTMLCanvasElement
import org.w3c.dom.HTMLDivElement
import... | ```kotlin
package threed
import org.khronos.webgl.WebGLRenderingContext
import org.w3c.dom.HTMLCanvasElement
import org.w3c.dom.HTMLDivElement
import kotlin.browser.document
import kotlin.browser.window
fun main(args: Array<String>) {
val container = document.getElementById("container") as HTMLDivElement
va... | null | null |
Add a foreach induction variable cast test
Apply this change to `tests/cs/foreach/Foreach.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
public class Enumerator
{
public Enumerator() { }
public int Current { get; private set; } = 10;
public bool MoveNext... | ```csharp
using System;
using System.Collections.Generic;
public class Enumerator
{
public Enumerator() { }
public int Current { get; private set; } = 10;
public bool MoveNext()
{
Current--;
return Current > 0;
}
public void Dispose()
{
Console.WriteLine("Hi!");
... | null | null |
Remove hack in mdbd fs.host.fqdn driver.
Apply this change to `cmd/mdbd/loadDsHostFqdn.go` and return the full updated file.
```go
package main
import (
"encoding/json"
"errors"
"github.com/Symantec/Dominator/lib/mdb"
"io"
"log"
)
func loadDsHostFqdn(reader io.Reader, datacentre string, logger *log.Logger) (
... | ```go
package main
import (
"encoding/json"
"errors"
"github.com/Symantec/Dominator/lib/mdb"
"io"
"log"
)
func loadDsHostFqdn(reader io.Reader, datacentre string, logger *log.Logger) (
*mdb.Mdb, error) {
type machineType struct {
Fqdn string
}
type dataCentreType map[string]machineType
type inMdbType ma... | null | null |
Split `urls.py` to separate modules
Apply this change to `setup.py` and return the full updated file.
```python
from setuptools import setup
setup(
name='mcrypto',
version='0.1',
author='Pavel Brodsky',
author_email='mcouthon@gmail.com',
packages=[
'mcrypto',
'mcrypto.mcrypto_pro... | ```python
from setuptools import setup
setup(
name='mcrypto',
version='0.1',
author='Pavel Brodsky',
author_email='mcouthon@gmail.com',
packages=[
'mcrypto',
'mcrypto.mcrypto_project',
'mcrypto.mcrypto_project.mcrypto_project',
'mcrypto.mcrypto_project.portfolio',
... | null | null |
Change MaybeNullWhenAttribute to internal to remove collision with diagnostics ns
Apply this change to `NBitcoin/NullableShims.cs` and return the full updated file.
```csharp
#if NULLABLE_SHIMS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namesp... | ```csharp
#if NULLABLE_SHIMS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
internal sealed class MaybeNullWhenAttribute : Attribute
{
p... | null | null |
Change rebranding feedback scale from 0-5 to 1-5
CP-4053
Apply this change to `packages/components/containers/feedback/RebrandingFeedbackModal.tsx` and return the full updated file.
```typescript
import { c } from 'ttag';
import useFeature from '../../hooks/useFeature';
import { FeatureCode } from '../features/Feat... | ```typescript
import { c } from 'ttag';
import useFeature from '../../hooks/useFeature';
import { FeatureCode } from '../features/FeaturesContext';
import FeedbackModal, { FeedbackModalProps } from './FeedbackModal';
import { RebrandingFeatureValue } from './useRebrandingFeedback';
const RebrandingFeedbackModal = (pr... | null | null |
Add newline at end of file
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@78227 0039d316-1c4b-4281-b951-d872f2087c98
Apply this change to `content/common/child_process_messages.h` and return the full updated file.
```c
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code ... | ```c
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Common IPC messages used for child processes.
// Multiply-included message file, hence no include guard.
#include "googleurl/src/gurl.h"
#inc... | null | null |
Update Google Maps API key
Apply this change to `config/dev.env.js` and return the full updated file.
```javascript
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
API_SERVER: '""', // False good idea, remove me
RECAPTCHA_SIT... | ```javascript
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
API_SERVER: '""', // False good idea, remove me
RECAPTCHA_SITE_KEY: '"6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"',
GOOGLE_ANALYTICS_PROPERTY_ID: '"UA-25136319-8"',
... | null | null |
Improve Sqlite3 schema by adding drop statement
Drop, if exists, before create table. Easier to reset database.
Apply this change to `_examples/2_server/data/schema.sqlite3.sql` and return the full updated file.
```sql
--
-- example schema
-- --------------
-- schema file for sqlite3 database
-- to be used in this e... | ```sql
--
-- example schema
-- --------------
-- schema file for sqlite3 database
-- to be used in this example
--
DROP TABLE IF EXISTS posts;
CREATE TABLE posts (
`id` INTEGER PRIMARY KEY,
`uid` INTEGER,
`title` TEXT,
`body` TEXT,
`size` INTEGER,
`date` INTEGER
);
DROP TABLE IF EXISTS comments;
C... | null | null |
Comment white noise test for now
Apply this change to `tests/Tools/WhiteNoiseGeneratorFilter.cpp` and return the full updated file.
```cpp
/**
* \ file WhiteNoiseGeneratorFilter.cpp
*/
#include <cmath>
#include <ATK/Tools/WhiteNoiseGeneratorFilter.h>
#include <array>
#define BOOST_TEST_DYN_LINK
#define BOOST_TE... | ```cpp
/**
* \ file WhiteNoiseGeneratorFilter.cpp
*/
#include <cmath>
#include <ATK/Tools/WhiteNoiseGeneratorFilter.h>
#include <array>
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
const size_t PROCESSSIZE = 1024*1024;
BOOST_AUTO_TEST_CASE( WhiteNoiseGeneratorFilter... | null | null |
Remove hardcoded date from gemspec
Apply this change to `penkit.gemspec` and return the full updated file.
```ruby
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "penkit/version"
Gem::Specification.new do |s|
s.name = "penkit"
s.version = Penkit::VERSION
s.date = "2017-03-03"
s.summary = "Pe... | ```ruby
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "penkit/version"
Gem::Specification.new do |s|
s.name = "penkit"
s.version = Penkit::VERSION
s.summary = "Penkit CLI"
s.description = "Command-line interface for managing Penkit containers"
s.authors = ["Don Humphreys", "Sam Lachance"]
... | null | null |
Revert "Revert "Fix DDL on timestamp""
Apply this change to `src/main/resources/db/migration/V26__Add_Timestamp_Columns.sql` and return the full updated file.
```sql
-- add timestap column
-- timestamp column is not null by default
ALTER TABLE project ADD create_time timestamp DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE p... | ```sql
-- add timestap column
-- https://dev.mysql.com/doc/refman/5.5/en/timestamp-initialization.html
-- at most one TIMESTAMP column per table could be automatically initialized or updated to the current date and time
-- timestamp column is not null by default
-- Usage: you must set NULL to create_at column during in... | null | null |
Add `RawFd` to WASI's `std::os::wasi::prelude`.
Add `RawFd` to WASI's `std::os::wasi::prelude`, making it consistent
with all other platforms which also have `AsRawFd`, `FromRawFd`, and
`IntoRawFd` in their respective preludes.
Apply this change to `src/libstd/sys/wasi/ext/mod.rs` and return the full updated file.
`... | ```rust
pub mod ffi;
pub mod fs;
pub mod io;
/// A prelude for conveniently writing platform-specific code.
///
/// Includes all extension traits, and some important type definitions.
#[stable(feature = "rust1", since = "1.0.0")]
pub mod prelude {
#[doc(no_inline)]
#[stable(feature = "rust1", since = "1.0.0")]... | null | null |
Remove test to summarize NewIndexes and parseIndexesList
Apply this change to `selector_test.go` and return the full updated file.
```go
package main
import (
"reflect"
"testing"
)
var parseIndexesListTests = []struct {
list string
indexes []int
}{
// Only one index
{
list: "10",
indexes: []int{9},
... | ```go
package main
``` | null | null |
Fix load from local empty data store
Apply this change to `app/src/main/java/cz/inventi/inventiskeleton/data/post/LocalPostStore.kt` and return the full updated file.
```kotlin
package cz.inventi.inventiskeleton.data.post
import android.content.SharedPreferences
import com.f2prateek.rx.preferences2.RxSharedPreferenc... | ```kotlin
package cz.inventi.inventiskeleton.data.post
import android.content.SharedPreferences
import com.f2prateek.rx.preferences2.RxSharedPreferences
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import io.reactivex.Observable
import javax.inject.Inject
/**
* Created by tomas.valenta on 5/2... | null | null |
Fix the 'base' attribute for ng-apps
Apply this change to `web/app/themes/theme/templates/head.php` and return the full updated file.
```php
<!doctype html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name... | ```php
<!doctype html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="alternate" type="application/rss+xml" title="<?= get_bloginfo(... | null | null |
Update tests to use compile-pass
Apply this change to `src/test/ui/rfc1598-generic-associated-types/shadowing.rs` and return the full updated file.
```rust
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.... | ```rust
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE... | null | null |
Use explicit classloader when loading installed CoroutineExceptionHandler impls
Fixes #530
Apply this change to `core/kotlinx-coroutines-core/src/CoroutineExceptionHandlerImpl.kt` and return the full updated file.
```kotlin
/*
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache ... | ```kotlin
/*
* Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.coroutines.experimental
import java.util.*
import kotlin.coroutines.experimental.*
/**
* A list of globally installed [CoroutineExceptionHandler] instances.
*
* Note, that Androi... | null | null |
Move event manager type inference to subscribe function
Apply this change to `packages/components/hooks/useEventManager.ts` and return the full updated file.
```typescript
import { useContext } from 'react';
import { EventManager } from 'proton-shared/lib/eventManager/eventManager';
import Context from '../containers... | ```typescript
import { useContext } from 'react';
import Context from '../containers/eventManager/context';
function useEventManager() {
const eventManager = useContext(Context);
if (!eventManager) {
throw new Error('Trying to use uninitialized EventManagerContext');
}
return eventManager;
}
... | null | null |
Fix tests of module `type_constructor`, disable unstable feature
Apply this change to `rust/test/dt/type_constructor/type_constructor_tests.rs` and return the full updated file.
```rust
#![ warn( rust_2018_idioms ) ]
#![ warn( missing_debug_implementations ) ]
#![ warn( missing_docs ) ]
// #![ feature( trace_macros ... | ```rust
#![ warn( rust_2018_idioms ) ]
#![ warn( missing_debug_implementations ) ]
#![ warn( missing_docs ) ]
// #![ feature( trace_macros ) ]
// #![ feature( type_name_of_val ) ]
use type_constructor as TheModule;
#[ allow( unused_imports ) ]
use test_tools::*;
#[ path = "./inc.rs" ]
mod inc;
// zzz : move to inc ... | null | null |
Fix date error in books model
Fix typos and the auto addition of date to the date_added field.
Apply this change to `src/books/models.py` and return the full updated file.
```python
from django.db import models
from datetime import date
from django.utils import timezone
# Create your models here.
class Book(models.... | ```python
from django.db import models
from datetime import datetime
from django.utils import timezone
# Create your models here.
class Book(models.Model):
title = models.CharField(max_length=200)
author = models.CharField(max_length=200)
year = models.DateTimeField('year published',
help_text="Please use the fol... | null | null |
Use batch_execute instead of execute
It'll should speed up the check since we'll end up with 1 round trip
instead of 3 and don't care about the result anyway.
Apply this change to `src/lib.rs` and return the full updated file.
```rust
extern crate r2d2;
extern crate postgres;
use postgres::{PostgresConnection, Post... | ```rust
extern crate r2d2;
extern crate postgres;
use postgres::{PostgresConnection, PostgresConnectParams, IntoConnectParams, SslMode};
use postgres::error::PostgresConnectError;
pub struct PostgresPoolManager {
params: PostgresConnectParams,
ssl_mode: SslMode,
}
impl PostgresPoolManager {
pub fn new<T:... | null | null |
Implement ThreadBound always in terms of ThreadId
Apply this change to `src/thread.rs` and return the full updated file.
```rust
use std::fmt::{self, Debug};
use self::thread_id::ThreadId;
/// ThreadBound is a Sync-maker and Send-maker that allows accessing a value
/// of type T only from the original thread on whi... | ```rust
use std::fmt::{self, Debug};
use std::thread::{self, ThreadId};
/// ThreadBound is a Sync-maker and Send-maker that allows accessing a value
/// of type T only from the original thread on which the ThreadBound was
/// constructed.
pub struct ThreadBound<T> {
value: T,
thread_id: ThreadId,
}
unsafe imp... | null | null |
Make this test not try to write on object file and test all of the
output rather than just part of it.
Also, remove the frighteningly ancient comment about not working with
the gcc-driver. (!!!)
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@187376 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `tes... | ```c
// RUN: env QA_OVERRIDE_GCC3_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-ccc-print-options " %clang x -O2 b -O3 2>&1 | FileCheck %s
// RUN: env QA_OVERRIDE_GCC3_OPTIONS="x-Werror +-mfoo" %clang -Werror %s -c -### 2>&1 | FileCheck %s -check-prefix=RM-WERROR
// CHECK-NOT: ###
// CHECK: Option 0 ... | null | null |
Fix package ImportError for Python3
https://docs.python.org/3.0/whatsnew/3.0.html#removed-syntax
"The only acceptable syntax for relative imports is
from .[module] import name. All import forms not starting with . are
interpreted as absolute imports. (PEP 0328)"
Apply this change to `poeditor/__init__.py` and return ... | ```python
"""
API Client Interface for POEditor API (https://poeditor.com).
Usage:
>>> from poeditor import POEditorAPI
>>> client = POEditorAPI(api_token='my_token')
>>> projects = client.list_projects()
"""
__version__ = "1.1.0"
try:
from .client import POEditorAPI, POEditorException, POEd... | null | null |
Change validate() signature (i.e throws Exception)
OPEN - task 66: Update Item functionalities implementation
http://github.com/DevOpsDistilled/OpERP/issues/issue/66
Apply this change to `OpERP/src/main/java/devopsdistilled/operp/client/abstracts/CreateEntityPaneController.java` and return the full updated file.
``... | ```java
package devopsdistilled.operp.client.abstracts;
import devopsdistilled.operp.server.data.entity.Entiti;
public interface CreateEntityPaneController<E extends Entiti<?>> extends
SubTaskPaneController {
public void validate(E entity) throws Exception;
public E save(E entity);
}
``` | null | null |
Add `dyn` to trait object
Apply this change to `src/func.rs` and return the full updated file.
```rust
//! Module for working with `Function`s
//!
//! This module contains a type alias for `Rc<Fn(f64) -> f64>`,
//! which is used in many other modules, and functions for
//! working with the alias.
pub use std::rc::Rc... | ```rust
//! Module for working with `Function`s
//!
//! This module contains a type alias for `Rc<Fn(f64) -> f64>`,
//! which is used in many other modules, and functions for
//! working with the alias.
pub use std::rc::Rc;
/// Type alias used to represent functions.
///
/// A `Function` is a `Fn` that takes a single... | null | null |
Set automatic releases as 'prerelease'.
Apply this change to `bin/upload_version.py` and return the full updated file.
```python
#!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = ... | ```python
#!python
import os
import sys
import json
import requests
if __name__ == '__main__':
version = sys.argv[1]
filepath = sys.argv[2]
filename = filepath.split('/')[-1]
github_token = os.environ['GITHUB_TOKEN']
auth = (github_token, 'x-oauth-basic')
commit_sha = os.environ['CIRCLE_SHA1']
params = ... | null | null |
Use localised string for guest participation beatmaps header
Apply this change to `osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs` and return the full updated file.
```csharp
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full ... | ```csharp
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Localisation;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Profile.Sections.Beatmaps;
using osu.Game.Resources.Localisation.... | null | null |
Return false if the size does not match
Apply this change to `src/helper/unorderedContainer.cpp` and return the full updated file.
```cpp
#include <mantella_bits/helper/unorderedContainer.hpp>
// C++ standard library
#include <functional>
namespace mant {
arma::uword Hash::operator()(
const arma::Col<double... | ```cpp
#include <mantella_bits/helper/unorderedContainer.hpp>
// C++ standard library
#include <functional>
namespace mant {
arma::uword Hash::operator()(
const arma::Col<double>& key) const {
// Start with the hash of the first value ...
arma::uword hashedKey = std::hash<double>()(key(0));
// ..... | null | null |
Add test for parsing amounts
This will likely need to use BigDecimal eventually, but works for now.
Apply this change to `spec/functional/ynab_spec.rb` and return the full updated file.
```ruby
require 'ynab'
describe Ynab do
let(:ynab) { Ynab.open('./spec/fixtures/Test~E8570C74.ynab4') }
describe '.transactio... | ```ruby
require 'bigdecimal'
require 'ynab'
describe Ynab do
let(:ynab) { Ynab.open('./spec/fixtures/Test~E8570C74.ynab4') }
describe '.transactions' do
let(:transactions) { ynab.transactions }
let(:transaction) { ynab.transactions.first }
it 'shows how many total transactions exist for a budget' do... | null | null |
Remove hash from grades table
Apply this change to `sql/schema.sql` and return the full updated file.
```sql
DROP TABLE IF EXISTS users;
CREATE TABLE users (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
email TEXT NOT NULL
);
drop table if exists courses;
CREATE TABLE... | ```sql
DROP TABLE IF EXISTS users;
CREATE TABLE users (
uid INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
email TEXT NOT NULL
);
drop table if exists courses;
CREATE TABLE courses (
cid INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT UNIQUE NOT NULL,
displayname TEXT NOT NUL... | null | null |
Clean up Problem 30 solution
Apply this change to `src/SubstringWithConcatenationOfAllWords.cpp` and return the full updated file.
```cpp
#include "SubstringWithConcatenationOfAllWords.hpp"
#include <unordered_map>
using namespace std;
vector<int> SubstringWithConcatenationOfAllWords::findSubstring(string s, vector... | ```cpp
#include "SubstringWithConcatenationOfAllWords.hpp"
#include <unordered_map>
using namespace std;
vector<int> SubstringWithConcatenationOfAllWords::findSubstring(string s, vector<string>& words)
{
vector<int> ret;
size_t strlen = s.size();
size_t numw = words.size();
if (strlen == 0 || numw == 0) retu... | null | null |
Add code to record time user invoked an action in he system
Apply this change to `system_user/system_user_database/utility_functions/util_get_user_state.sql` and return the full updated file.
```sql
/* The function system_user_schema.util_get_user_state retuns the current state of the user
* indicated by the _login p... | ```sql
/* The function system_user_schema.util_get_user_state retuns the current state of the user
* indicated by the _login parameter. If the submitted login doesn't correspond
* to a system user it returns "Unknown"
*
* The function also records the time the function ran as the time the user was
* last active on the ... | null | null |
Add method to get a link to an animal.
Apply this change to `WebUtils/src/ts/WebUtils/LabKey.ts` and return the full updated file.
```typescript
declare const LABKEY: {
CSRF: string,
ActionURL: any,
getModuleContext(moduleName: string): any;
};
export function getCSRF(): string {
return LABKEY.CSRF |... | ```typescript
declare const LABKEY: {
CSRF: string,
ActionURL: any,
getModuleContext(moduleName: string): any;
};
export function getCSRF(): string {
return LABKEY.CSRF || "";
}
export function getCurrentController(): string {
return LABKEY.ActionURL.getController();
}
export function getCurrentC... | null | null |
Fix bug where store immediate was treated as label
Apply this change to `src/main/kotlin/venus/assembler/pseudos/Store.kt` and return the full updated file.
```kotlin
package venus.assembler.pseudos
import venus.assembler.AssemblerPassOne
import venus.assembler.LineTokens
import venus.assembler.PseudoWriter
import v... | ```kotlin
package venus.assembler.pseudos
import venus.assembler.AssemblerPassOne
import venus.assembler.LineTokens
import venus.assembler.PseudoWriter
import venus.riscv.insts.dsl.relocators.PCRelHiRelocator
import venus.riscv.insts.dsl.relocators.PCRelLoRelocator
import venus.riscv.userStringToInt
/**
* Writes a s... | null | null |
Add percona-toolkit to travis build
Apply this change to `.travis/before_script.sh` and return the full updated file.
```bash
#!/bin/bash -e
if [[ $DB == 'mysql' ]]
then
if [[ $DB_VERSION == '5.5' ]]
then
sudo service mysql start || true # Travis default installed version
else
sudo apt-get -y remove m... | ```bash
#!/bin/bash -e
# Add percona
sudo apt-get install -y percona-toolkit
# Add database
if [[ $DB == 'mysql' ]]
then
if [[ $DB_VERSION == '5.5' ]]
then
sudo service mysql start || true # Travis default installed version
else
sudo apt-get -y remove mysql-server
sudo apt-get -y autoremove
su... | null | null |
Use a cache directory for the disk cache
Apply this change to `app/src/main/kotlin/com.felipecosta.kotlinrxjavasample/di/AppModule.kt` and return the full updated file.
```kotlin
package com.felipecosta.kotlinrxjavasample.di
import android.app.Application
import com.felipecosta.kotlinrxjavasample.data.CacheDataRepos... | ```kotlin
package com.felipecosta.kotlinrxjavasample.di
import android.app.Application
import com.felipecosta.kotlinrxjavasample.data.CacheDataRepository
import com.felipecosta.kotlinrxjavasample.data.DataRepository
import com.felipecosta.kotlinrxjavasample.data.NetworkDataRepository
import com.felipecosta.kotlinrxjav... | null | null |
Fix CSQlite dep for 4.2 manifest
...
Apply this change to `Package.swift` and return the full updated file.
```swift
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "ZeeQL3",
products: [ // TBD: Use ZeeQL3 as library name?
.library(name: "ZeeQL", targets: [ "ZeeQL" ])
],... | ```swift
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "ZeeQL3",
products: [ // TBD: Use ZeeQL3 as library name?
.library(name: "ZeeQL", targets: [ "ZeeQL" ])
],
dependencies: [
.package(url: "https://github.com/ZeeQL/CSQLite3.git",
from: "2.0.3")
],
... | null | null |
Fix condition that use ResourceReader
Because Aws::Resources::Resource removed
Apply this change to `lib/awspec/resource_reader.rb` and return the full updated file.
```ruby
module Awspec
module BlackListForwardable
class CalledMethodInBlackList < StandardError
end
def method_missing_via_black_list(na... | ```ruby
module Awspec
module BlackListForwardable
class CalledMethodInBlackList < StandardError
end
def method_missing_via_black_list(name, delegate_to: nil)
raise ArguementError, 'delegate_to: must be specified' unless delegate_to
if match_black_list?(name) && !match_white_list?(name)
... | null | null |
Add minitest in an effort to get ree tests to pass.
Apply this change to `subtle.gemspec` and return the full updated file.
```ruby
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/subtle/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Darren Cauthon"]
gem.email = ["da... | ```ruby
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/subtle/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Darren Cauthon"]
gem.email = ["darren@cauthon.com"]
gem.description = %q{A few small updates to make even more concise Ruby.}
gem.summary = %q{A fe... | null | null |
[MarkLogic] Add the column number to thedebug stack frame.
Apply this change to `src/plugin-marklogic/main/uk/co/reecedunn/intellij/plugin/marklogic/query/rest/debugger/MarkLogicDebugFrame.kt` and return the full updated file.
```kotlin
/*
* Copyright (C) 2020 Reece H. Dunn
*
* Licensed under the Apache License, V... | ```kotlin
/*
* Copyright (C) 2020 Reece H. Dunn
*
* 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 o... | null | null |
Fix server crashing on initial sync
Apply this change to `TachiServer/src/main/java/xyz/nulldev/ts/api/http/sync/LastSyncDb.kt` and return the full updated file.
```kotlin
package xyz.nulldev.ts.api.http.sync
import xyz.nulldev.ts.config.ConfigManager
import xyz.nulldev.ts.config.ServerConfig
import java.io.File
cl... | ```kotlin
package xyz.nulldev.ts.api.http.sync
import xyz.nulldev.ts.config.ConfigManager
import xyz.nulldev.ts.config.ServerConfig
import java.io.File
class LastSyncDb {
private val serverConfig = ConfigManager.module<ServerConfig>()
private val dbFile = File(serverConfig.rootDir, "last_sync.db")
val la... | null | null |
Allow POLYGON_DEPTH to be configurable by compile commands.
Apply this change to `polygon.h` and return the full updated file.
```c
#ifndef _POLYGON_H_
#define _POLYGON_H_
/*
* geometric properties of the polygon meant for solving
*
* The default C pre-processor configuration here is to solve triangles.
*/
#def... | ```c
#ifndef _POLYGON_H_
#define _POLYGON_H_
/*
* geometric properties of the polygon meant for solving
*
* The default C pre-processor configuration here is to solve triangles.
*/
#ifndef POLYGON_DEPTH
#define POLYGON_DEPTH 3
#endif
#if (POLYGON_DEPTH < 3)
#error You cannot have a polygon with fewer th... | null | null |
Add missing "max_atomic_width" to new armv7 android target.
Apply this change to `src/librustc_back/target/armv7_linux_androideabi.rs` and return the full updated file.
```rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rus... | ```rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE... | null | null |
Add impl of `IndexData` for arrays of `IndexDatum`s
Apply this change to `src/index_data.rs` and return the full updated file.
```rust
pub use std::mem;
pub use std::slice;
pub enum IndexDatumType {
UnsignedByte,
UnsignedShort
}
pub trait IndexData {
fn index_datum_type() -> IndexDatumType;
fn index... | ```rust
pub use std::mem;
pub use std::slice;
pub enum IndexDatumType {
UnsignedByte,
UnsignedShort
}
pub trait IndexData {
fn index_datum_type() -> IndexDatumType;
fn index_bytes(&self) -> &[u8];
fn index_elements(&self) -> usize;
}
pub trait IndexDatum {
fn index_datum_type() -> IndexDatumT... | null | null |
Add method to check if chapter title contains the given string
Apply this change to `Yomu/ViewModels/ChapterViewModel.swift` and return the full updated file.
```swift
//
// ChapterViewModel.swift
// Yomu
//
// Created by Sendy Halim on 7/6/16.
// Copyright © 2016 Sendy Halim. All rights reserved.
//
import RxCo... | ```swift
//
// ChapterViewModel.swift
// Yomu
//
// Created by Sendy Halim on 7/6/16.
// Copyright © 2016 Sendy Halim. All rights reserved.
//
import RxCocoa
import RxMoya
import RxSwift
struct ChapterViewModel {
private let _chapter: Variable<Chapter>
private let _previewUrl = Variable(ImageUrl(endpoint: "")... | null | null |
Change explanation field type to text to allow long explanations.
Apply this change to `database/migrations/2016_12_04_122328_create_trios_table.php` and return the full updated file.
```php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migr... | ```php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTriosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('trios', fu... | null | null |
Clarify meaning of --all option for packages command
Apply this change to `guild/commands/packages_list.py` and return the full updated file.
```python
# Copyright 2017-2020 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | ```python
# Copyright 2017-2020 TensorHub, Inc.
#
# 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 agreed ... | null | null |
Use mt64_context instead of mp_rand_ctx
Apply this change to `include/rsa.h` and return the full updated file.
```c
#ifndef _RSA_H_
#define _RSA_H_
#include "mpi.h"
/* Everything must be kept private except for n and e.
* (n,e) is the public key, (n,d) is the private key. */
typedef struct {
mpi_t n; /* modulus ... | ```c
#ifndef _RSA_H_
#define _RSA_H_
#include "mpi.h"
/* Everything must be kept private except for n and e.
* (n,e) is the public key, (n,d) is the private key. */
typedef struct {
mpi_t n; /* modulus n = pq */
mpi_t phi; /* phi = (p-1)(q-1) */
mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */
mpi_... | null | null |
Test the construction of the empty tag.
Apply this change to `ManifoldTests/TagTests.swift` and return the full updated file.
```swift
// Copyright © 2015 Rob Rix. All rights reserved.
final class TagTests: XCTestCase {
func testTagTypechecksAsFunction() {
let expected = Expression.FunctionType(Enumeration, Term... | ```swift
// Copyright © 2015 Rob Rix. All rights reserved.
final class TagTests: XCTestCase {
func testEmptyEnumerationYieldsEmptyTag() {
assert(Manifold.Tag.tags([]), ==, [])
}
func testTagTypechecksAsFunction() {
let expected = Expression.FunctionType(Enumeration, Term(.Type(0)))
let actual = Tag.out.chec... | null | null |
Add explaination to why virtual destructors are needed
Signed-off-by: WajahatSiddiqui <3c3ea4adfdf19decee174766aef6add34b32b7f0@gmail.com>
Apply this change to `C++/pure_desctructors.cpp` and return the full updated file.
```cpp
// http://www.geeksforgeeks.org/pure-virtual-destructor-c/
// 1) C++ Accepts pure virtua... | ```cpp
// http://www.geeksforgeeks.org/pure-virtual-destructor-c/
// 1) C++ Accepts pure virtual destructors, a Base class needs to provide definition for pure
// virtual destructor as well because it is being called in reverse order and compiler
// looks for its definition
// 2) class contains abstract class if it con... | null | null |
Convert a list of files.
Apply this change to `src/deply.spec.js` and return the full updated file.
```javascript
import {describe, it} from 'mocha';
import {
assertThat, equalTo,
} from 'hamjest';
import {
buildFunctionSpy, wasNotCalled, callCountWas, wasCalledWith,
} from 'hamjest-spy';
const toSrcDestPairs = ... | ```javascript
import {describe, it} from 'mocha';
import {
assertThat, equalTo,
} from 'hamjest';
import {
buildFunctionSpy, wasNotCalled, callCountWas, wasCalledWith,
} from 'hamjest-spy';
describe('Build src-dest pairs from file names', () => {
const srcPath = '/src/path';
const destPath = '/dest/path';
c... | null | null |
Change element allowed type account if not exists.
Apply this change to `Architecture/WebService.js` and return the full updated file.
```javascript
var PermissionConstructor = require('./PermissionConstructor').PermissionConstructor;
function WebService(currentUser) {
this._currentUser = currentUser;
this._depend... | ```javascript
var PermissionConstructor = require('./PermissionConstructor').PermissionConstructor;
function WebService(currentUser) {
this._currentUser = currentUser;
this._dependencies = {};
this.runRef = undefined;
}
WebService.prototype.runWrapper = function () {
var self = this;
return function (name, allo... | null | null |
[ci] Correct test to use the instantiated class instead
Apply this change to `Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/WindowsRealmTests.java` and return the full updated file.
```java
/**
* Waffle (https://github.com/Waffle/waffle)
*
* Copyright (c) 2010-2016 Application Security, Inc.
*
* All righ... | ```java
/**
* Waffle (https://github.com/Waffle/waffle)
*
* Copyright (c) 2010-2017 Application Security, Inc.
*
* All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
* Public License v1.0 which accompanies this distribution, and is available at
* ht... | null | null |
Remove override form Begin Auto End methods of QtCreator plugin as they don't override anymore
Apply this change to `qtcreator/cutelyst/classes/controller.h` and return the full updated file.
```c
%{Cpp:LicenseTemplate}\
#ifndef %{GUARD}
#define %{GUARD}
#include <Cutelyst/Controller>
%{JS: Cpp.openNamespaces('%{Cl... | ```c
%{Cpp:LicenseTemplate}\
#ifndef %{GUARD}
#define %{GUARD}
#include <Cutelyst/Controller>
%{JS: Cpp.openNamespaces('%{Class}')}\
using namespace Cutelyst;
class %{CN} : public Controller
{
Q_OBJECT
@if %{CustomNamespace}
C_NAMESPACE("%{CustomNamespaceValue}")
@endif
public:
explicit %{CN}(QObject *... | null | null |
Fix UI recipe to use string interpolation for base url.
Apply this change to `recipes/ui.rb` and return the full updated file.
```ruby
# Copyright 2014 Benny Wong <benny@bwong.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | ```ruby
# Copyright 2014 Benny Wong <benny@bwong.net>
#
# 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 |
Support low priority processes on Windows
Apply this change to `platform/platform-api/src/com/intellij/execution/configurations/LowPriorityProcessRunner.kt` and return the full updated file.
```kotlin
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be fou... | ```kotlin
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.configurations
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.registry.Registry
import java.io.File
/**
*... | null | null |
[UPDATE] Move earlier to before provisioning
Apply this change to `lib/vagrant-git/plugin.rb` and return the full updated file.
```ruby
module VagrantPlugins
module VagrantGit
class Plugin < Vagrant.plugin("2")
name "vagrant git support"
description <<-DESC
A vagrant plugin to allow checking ou... | ```ruby
module VagrantPlugins
module VagrantGit
class Plugin < Vagrant.plugin("2")
name "vagrant git support"
description <<-DESC
A vagrant plugin to allow checking out git repositories as part of
vagrant tasks.
DESC
config(:git) do
require File.expand_path("../config", ... | null | null |
Update scheme-229to2210.sql to reflect redundant virtual router change
Apply this change to `setup/db/db/schema-229to2210.sql` and return the full updated file.
```sql
--;
-- Schema upgrade from 2.2.9 to 2.2.10;
--;
ALTER TABLE `cloud`.`account` ADD COLUMN `network_domain` varchar(255);
ALTER TABLE `cloud`.`dom... | ```sql
--;
-- Schema upgrade from 2.2.9 to 2.2.10;
--;
ALTER TABLE `cloud`.`account` ADD COLUMN `network_domain` varchar(255);
ALTER TABLE `cloud`.`domain` ADD COLUMN `network_domain` varchar(255);
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'B... | null | null |
Make close() idempotent and implement Closable rather than AutoClosable
Apply this change to `src/main/java/org/purl/wf4ever/robundle/Bundle.java` and return the full updated file.
```java
package org.purl.wf4ever.robundle;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
impo... | ```java
package org.purl.wf4ever.robundle;
import java.io.Closeable;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import org.purl.wf4ever.robundle.fs.BundleFileSystem;
public class Bundle implements Closeable {
private boolean deleteOnClose;... | null | null |
Make no gui test random all tracks
Apply this change to `test/nogui.go` and return the full updated file.
```go
package test
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/fabiofalci/sconsify/events"
"github.com/fabiofalci/sconsify/spotify"
"github.com/howeyc/gopass"
)
func main2() {
username, pass := c... | ```go
package test
import (
"bufio"
"fmt"
"math/rand"
"os"
"strings"
"github.com/fabiofalci/sconsify/events"
"github.com/fabiofalci/sconsify/spotify"
ui "github.com/fabiofalci/sconsify/ui"
"github.com/howeyc/gopass"
sp "github.com/op/go-libspotify/spotify"
)
func main2() {
username, pass := credentials()
... | null | null |
Fix dumb error in quark run command
Apply this change to `.travis/test.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
cwd=$(pwd)
cd $(dirname "$0")/..
source .travis/sanitize.sh
sanitize test
source quark-travis/bin/activate
if [[ -f ~/.nvm/nvm.sh ]]; then
source ~/.nvm/nvm.sh
fi
# Allow s... | ```bash
#!/bin/bash
set -e
cwd=$(pwd)
cd $(dirname "$0")/..
source .travis/sanitize.sh
sanitize test
source quark-travis/bin/activate
if [[ -f ~/.nvm/nvm.sh ]]; then
source ~/.nvm/nvm.sh
fi
# Allow subsequent quark install commands to run offline
q=/tmp/maven_cache_warmup.q
echo 'quark *; void main(List<Strin... | null | null |
docs(@angular/cli): Add Cypress schematic to e2e command
Add Cypress schematic/builder, see
https://github.com/cypress-io/cypress/tree/master/npm/cypress-schematic
and
https:1a94db227b83d9e7ff09a0653dff3a00dcc5f32a@cypress/schematic
Apply this change to `packages/angular/cli/commands/e2e-impl.ts` and return the full ... | ```typescript
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ArchitectCommand } from '../models/architect-command';
import { Arguments } from '../models/in... | null | null |
Test that the unary product ends with the unit term.
e.g. (T, ())
Apply this change to `ManifoldTests/ValueTests.swift` and return the full updated file.
```swift
// Copyright (c) 2015 Rob Rix. All rights reserved.
final class ValueTests: XCTestCase {
func testQuotation() {
assert(Value.pi(.type, id).quote, ==,... | ```swift
// Copyright (c) 2015 Rob Rix. All rights reserved.
final class ValueTests: XCTestCase {
func testQuotation() {
assert(Value.pi(.type, id).quote, ==, Value.pi(.type, id).quote)
}
func testNestedQuotation() {
assert(Value.pi(.type) { Value.pi(.type, const($0)) }.quote, ==, Term(.Pi(Box(.type), Box(Ter... | null | null |
Add ":environment" dependency to rake task
or the task will raise with "NameError: uninitialized constant TestJob"
Apply this change to `lib/tasks/test_jobs.rake` and return the full updated file.
```ruby
namespace :test_jobs do
task :notify_admins_on_inconsistent_states do
if TestJob.joins(:test_run).
w... | ```ruby
namespace :test_jobs do
task notify_admins_on_inconsistent_states: :environment do
if TestJob.joins(:test_run).
where("test_runs.status NOT IN (?)", [TestStatus::RUNNING, TestStatus::QUEUED]).
where(status: [TestStatus::RUNNING,TestStatus::QUEUED]).exists?
AdminNotificationMailer.incons... | null | null |
Use $eval to maintain state
Apply this change to `src/yolisp.php` and return the full updated file.
```php
<?php #YOLO
namespace yolo;
function yolisp($swag, array $env = []) {
if (!is_array($swag)) {
if (isset($env[$swag])) {
return $env[$swag];
} else if (function_exists($swag)) {
... | ```php
<?php #YOLO
namespace yolo;
function yolisp($swag, array $env = []) {
if (!is_array($swag)) {
if (isset($env[$swag])) {
return $env[$swag];
} else if (function_exists($swag)) {
return $swag;
} else {
throw new \Exception("Could not find $swag in e... | null | null |
Clear errno, just to be sure.
Apply this change to `Python/strtod.c` and return the full updated file.
```c
/* This is not a proper strtod() implementation, but sufficient for Python.
Python won't detect floating point constant overflow, though. */
extern int strlen();
extern double atof();
double
strtod(p, pp)
... | ```c
/* This is not a proper strtod() implementation, but sufficient for Python.
Python won't detect floating point constant overflow, though. */
extern int errno;
extern int strlen();
extern double atof();
double
strtod(p, pp)
char *p;
char **pp;
{
double res;
if (pp)
*pp = p + strlen(p);
res = atof(p);
... | null | null |
Add more multicolumn sample lines
Apply this change to `2019/joins/joins-multicolumn.sql` and return the full updated file.
```sql
-- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
c... | ```sql
-- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
create table t2 (
code char(1) primary key,
id int,
ranking int);
insert into t1 values(1, 'Joanne', 7);
insert in... | null | null |
Remove offer with model name
Apply this change to `tests/integration/test_crossmodel.py` and return the full updated file.
```python
import pytest
from .. import base
@base.bootstrapped
@pytest.mark.asyncio
async def test_offer(event_loop):
async with base.CleanModel() as model:
application = await mod... | ```python
import pytest
from .. import base
@base.bootstrapped
@pytest.mark.asyncio
async def test_offer(event_loop):
async with base.CleanModel() as model:
application = await model.deploy(
'cs:~jameinel/ubuntu-lite-7',
application_name='ubuntu',
series='bionic',
... | null | null |
Test of index arrays of type int.
Apply this change to `landlab/grid/structured_quad/tests/test_links.py` and return the full updated file.
```python
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_true
from landlab.grid.structured_quad.nodes import status_with_... | ```python
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import raises, assert_equal
from landlab.grid.structured_quad.nodes import status_with_perimeter_as_boundary
from landlab.grid.structured_quad.links import active_link_ids
from landlab.grid.base import CORE_NODE, FIXED_VALUE_BO... | null | null |
Add python-dev package for the sdk
Apply this change to `code/app/deploy.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
apt-get -y -qq update; apt-get -y -qq upgrade
apt-get -y -qq install python-pip git nginx
echo "source /root/app_env.rc" >> /root/.profile
source /root/.profile
git clone https... | ```bash
#!/usr/bin/env bash
apt-get -y -qq update; apt-get -y -qq upgrade
apt-get -y -qq install python-dev python-pip git nginx
echo "source /root/app_env.rc" >> /root/.profile
source /root/.profile
git clone https://github.com/everett-toews/app-on-openstack.git /root/app-on-openstack
pip install virtualenv
virtual... | null | null |
Raise log level on test_harness tests
Apply this change to `beacon_node/beacon_chain/test_harness/tests/chain.rs` and return the full updated file.
```rust
use env_logger::{Builder, Env};
use log::debug;
use test_harness::BeaconChainHarness;
use types::ChainSpec;
#[test]
fn it_can_build_on_genesis_block() {
Buil... | ```rust
use env_logger::{Builder, Env};
use log::debug;
use test_harness::BeaconChainHarness;
use types::ChainSpec;
#[test]
fn it_can_build_on_genesis_block() {
Builder::from_env(Env::default().default_filter_or("info")).init();
let spec = ChainSpec::few_validators();
let validator_count = 8;
let mut... | null | null |
Use got for ping command
Apply this change to `lib/ping_cmd.js` and return the full updated file.
```javascript
'use strict'
var http = require('http')
var https = require('https')
var url = require('url')
var config = require('./config')
function ping (cb) {
if (url.parse(config.registry).protocol === 'https:') ... | ```javascript
'use strict'
var url = require('url')
var got = require('got')
var config = require('./config')
function ping (cb) {
got(url.resolve(config.registry, '-/ping'), { json: true }, function (err, body, res) {
if (err) return cb(err)
if (res.statusCode !== 200) {
return cb(new Error('Unexpect... | null | null |
Add newly added configurations to test case expectation
Apply this change to `provider/src/test/kotlin/org/gradle/kotlin/dsl/accessors/GenerateProjectSchemaTest.kt` and return the full updated file.
```kotlin
package org.gradle.kotlin.dsl.accessors
import org.gradle.kotlin.dsl.fixtures.AbstractIntegrationTest
impor... | ```kotlin
package org.gradle.kotlin.dsl.accessors
import org.gradle.kotlin.dsl.fixtures.AbstractIntegrationTest
import org.hamcrest.CoreMatchers.equalTo
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Test
class GenerateProjectSchemaTest : AbstractIntegrationTest() {
@Test
fun `writes multi-pr... | null | null |
Remove unnecessary system test code
It turns out that we don't need to require system tests in the railties
test helper so we can remove it. If you're using system tests they will
be loaded by inheriting from ActionDispatch::SystemTestCase and the
routes will be loaded by ActionDispatch::IntegrationTest.
Apply this c... | ```ruby
# Make double-sure the RAILS_ENV is not set to production,
# so fixtures aren't loaded into that environment
abort("Abort testing: Your Rails environment is running in production mode!") if Rails.env.production?
require "rails/test_unit/minitest_plugin"
require "active_support/test_case"
require "action_contro... | null | null |
Improve list of headers returned with health route in order to remove /r/n
Apply this change to `flask_skeleton_api/views/general.py` and return the full updated file.
```python
from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registere... | ```python
from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
... | null | null |
Fix import time issue with member_required decorator.
Apply this change to `jazzband/members/decorators.py` and return the full updated file.
```python
from flask import flash, redirect
from flask_login import current_user
import wrapt
from ..account.views import default_url
def member_required(next_url=None, mess... | ```python
from flask import flash, redirect
from flask_login import current_user
import wrapt
from ..account.views import default_url
def member_required(next_url=None, message=None):
if message is None:
message = "Sorry but you're not a member of Jazzband at the moment."
@wrapt.decorator
def wr... | null | null |
Call yarn from travis javascript setup script.
Apply this change to `tools/ci/setup_js_env.sh` and return the full updated file.
```bash
which bower || npm install -g bower
# Check if the bower cache is valid, otherwise delete it
if ! cmp --silent bower.json vendor/assets/bower_components/bower.json; then
rm -rf v... | ```bash
which bower || npm install -g bower
# Check if the bower cache is valid, otherwise delete it
if ! cmp --silent bower.json vendor/assets/bower_components/bower.json; then
rm -rf vendor/assets/bower_components
fi
yarn
if [ -d vendor/assets/bower_components ]; then
# Using bower_components from cache
echo... | null | null |
Add linker test for two files
Apply this change to `src/test/kotlin/assembler/LinkerTest.kt` and return the full updated file.
```kotlin
package venus.assembler
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import venus.simulator.Simulator
class LinkerTest {
@Test
fun l... | ```kotlin
package venus.assembler
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import venus.simulator.Simulator
class LinkerTest {
@Test
fun linkOneFile() {
val prog = Assembler.assemble("""
start:
addi x8 x8 1
addi x9 x0 2
beq x8 ... | null | null |
Use the cleanHex for the hash
Apply this change to `model/src/main/java/org/kethereum/model/Address.kt` and return the full updated file.
```kotlin
package org.kethereum.model
data class Address(private val input: String) {
val cleanHex = input.replace("0x","")
@Transient
val hex = "0x$cleanHex"
o... | ```kotlin
package org.kethereum.model
data class Address(private val input: String) {
val cleanHex = input.replace("0x","")
@Transient
val hex = "0x$cleanHex"
override fun toString() = "0x" + cleanHex
override fun equals(other: Any?)
= other is Address && other.cleanHex.toUpperCase(... | null | null |
Add latitude and longitude to location
Apply this change to `gattaca/Firebase/Database/Model/FDatabaseCountriesItemUser.swift` and return the full updated file.
```swift
import Foundation
class FDatabaseCountriesItemUser:FDatabaseProtocol
{
var identifier:String?
var parent:FDatabaseProtocol?
init(
... | ```swift
import Foundation
class FDatabaseCountriesItemUser:FDatabaseProtocol
{
static let kKeyLatitude:String = "latitude"
static let kKeyLongitude:String = "longitude"
var identifier:String?
var parent:FDatabaseProtocol?
let latitude:Double
let longitude:Double
init(
par... | null | null |
Include java-only modules in modules list
Apply this change to `src/me/scana/okgradle/util/IntellijTools.kt` and return the full updated file.
```kotlin
package me.scana.okgradle.util
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.module.impl.sc... | ```kotlin
package me.scana.okgradle.util
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope
import com.intellij.openapi.project.Project
class IntellijTools(private val project: Project) {
fun getMod... | null | null |
Change sql to avoid startup errors if already initialized.
Apply this change to `cwfdemo-webapp-parent/cwfdemo-webapp-connectathon/src/main/resources/org/hspconsortium/cwfdemo/setup/setup.sql` and return the full updated file.
```sql
CREATE TABLE CWF_DOMAIN (
ID VARCHAR(20) PRIMARY KEY,
NAME VARCHAR(255),
ATTRIBUT... | ```sql
CREATE TABLE IF NOT EXISTS CWF_DOMAIN (
ID VARCHAR(20) PRIMARY KEY,
NAME VARCHAR(255),
ATTRIBUTES CLOB DEFAULT '');
MERGE INTO CWF_DOMAIN (ID, NAME, ATTRIBUTES) KEY(ID) VALUES
('1', 'General Medicine Clinic', ''),
('2', 'Emergency Room', ''),
('3', 'Test Hospital', 'default=true'),
('*', 'All Domains', '... | null | null |
Remove db password from source control
Apply this change to `ext/recieve.php` and return the full updated file.
```php
<?php
# Database variables
$dbhost = 'localhost:3036';
$dbuser = 'c0smic_tyro';
$dbpass = '2$M*k^4!?oDm';
# Read GET variables
$stime = $_POST['stime'];
$etime = $_POST['... | ```php
<?php
include("/secure/data_db_settings.php");
# Read GET variables
$stime = $_POST['stime'];
$etime = $_POST['etime'];
$moves = $_POST['moves'];
$conn = mysql_connect('localhost:3036', $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
... | null | null |
Add parsers header to root header
Apply this change to `TrailsKit/TrailsKit.h` and return the full updated file.
```c
//
// TrailsKit.h
// TrailsKit
//
// Created by Mike Mertsock on 1/1/13.
// Copyright (c) 2013 Esker Apps. All rights reserved.
//
#ifndef TrailsKit_TrailsKit_h
#define TrailsKit_TrailsKit_h
#im... | ```c
//
// TrailsKit.h
// TrailsKit
//
// Created by Mike Mertsock on 1/1/13.
// Copyright (c) 2013 Esker Apps. All rights reserved.
//
#ifndef TrailsKit_TrailsKit_h
#define TrailsKit_TrailsKit_h
#import "TrailsKitGeometry.h"
#import "TrailsKitParsers.h"
#import "TrailsKitTypes.h"
#import "TrailsKitUI.h"
#endif
... | null | null |
Add other cmd line options
Apply this change to `index.js` and return the full updated file.
```javascript
#!/usr/bin/env node
var optimist = require('optimist'),
argv;
argv = optimist
.usage('Pack the input, Usage: $0')
.alias('h', 'help')
.describe('h', 'Load this help')
.argv;
if (argv.help) {
ret... | ```javascript
#!/usr/bin/env node
var optimist = require('optimist'),
argv;
argv = optimist
.usage('Pack the input, Usage: $0')
.alias('h', 'help')
.describe('h', 'Load this help')
.alias('l', 'list')
.describe('l', 'List of languages')
.alias('i', 'include')
.describe('i', 'Include languages')
.a... | null | null |
Use $(..) instead of legacy `..`
Backtick command substitution `STATEMENT` is legacy syntax with several issues.
1. It has a series of undefined behaviors related to quoting in POSIX.
2. It imposes a custom escaping mode with surprising results.
3. It's exceptionally hard to nest.
Apply this change to `filechang... | ```bash
#!/bin/bash
# $1 is the service which sent the request
if [ "$1" != "mp" ]
then
#stop mopidy
mpc stop
fi
AIRPLAY=$(netstat -atunp | grep ESTABLISHED | grep 5002)
UPNP=$(netstat -atunp | grep gmediarender | grep "CLOSE_WAIT\|ESTABLISHED")
if [ "$1" != "gm" ]
then
# check gmediarender state with: netsta... | null | null |
Fix: Fix django development settingns again
Apply this change to `manage.py` and return the full updated file.
```python
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
if "--settings" not in sys.argv:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings.development")
... | ```python
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
if not any(arg.startswith("--settings") for arg in sys.argv):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pinry.settings.development")
from django.core.management import execute_from_command_line
if 'test' in sys.a... | null | null |
Update to work with the latest iteration
Apply this change to `conda_env/main_env.py` and return the full updated file.
```python
from __future__ import print_function, division, absolute_import
import argparse
from argparse import RawDescriptionHelpFormatter
import sys
from conda.cli import common
description = "... | ```python
from __future__ import print_function, division, absolute_import
import argparse
from argparse import RawDescriptionHelpFormatter
import sys
from conda.cli import common
description = """
Handles interacting with Conda environments.
"""
example = """
examples:
conda env list
conda env list --json
... | null | null |
Fix super frustrating sometimes-visual editor bug
Apply this change to `bash/main.sh` and return the full updated file.
```bash
source /etc/profile
export DOTFILES=~/my-dotfiles
export DEV_DOTFILES=~/dev-dotfiles
if [ -s "$DEV_DOTFILES/bash/main.sh" ]
then source "$DEV_DOTFILES/bash/main.sh"
fi
source "$DOTFILES/... | ```bash
source /etc/profile
export DOTFILES=~/my-dotfiles
export DEV_DOTFILES=~/dev-dotfiles
if [ -s "$DEV_DOTFILES/bash/main.sh" ]
then source "$DEV_DOTFILES/bash/main.sh"
fi
source "$DOTFILES/bash/aliases.sh"
source "$DOTFILES/bash/git.sh"
source "$DOTFILES/bash/prompt.sh"
if [ -s "$DOTFILES/bash/private.sh" ]
... | null | null |
Change pip to pip3 install bigchaindb
Apply this change to `bigchaindb-on-ubuntu/scripts/init.sh` and return the full updated file.
```bash
#!/bin/sh
. /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- https://downl... | ```bash
#!/bin/sh
. /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install rethinkdb
rethinkdb --bind a... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.