events stringlengths 233 2.9k | input stringlengths 273 1.93k | output stringlengths 363 2.15k |
|---|---|---|
User edited file: "tests/web/test_request.py":
```diff
@@ -4,7 +4,7 @@
class RequestTestCase(unittest.TestCase):
def setUp(self):
- self.url = 'http://www.google.com'
+ self.host = 'http://www.google.com'
def test_constants(self):
self.assertEqual('get', Request.GET)
@@ -40,4 +40,... | ```tests/web/test_request.py
import unittest
from performance.web import Request, RequestTypeError, RequestTimeError
class RequestTestCase(unittest.TestCase):
def setUp(self):
self.host = 'http://www.google.com'
def test_constants(self):
self.assertEqual('get', Request.GET)
self.asser... | ```tests/web/test_request.py
import unittest
from performance.web import Request, RequestTypeError, RequestTimeError
class RequestTestCase(unittest.TestCase):
def setUp(self):
self.host = 'http://www.google.com'
def test_constants(self):
self.assertEqual('get', Request.GET)
self.asser... |
User edited file: "protobuf-test/src/v2/test_tokio_bytes_default_value.rs":
```diff
@@ -4,14 +4,11 @@
#[test]
fn test_default_values() {
- assert_eq!(
- "sss",
- TestTokioBytesDefaultValues::default_instance().get_s()
- );
+ assert_eq!("sss", TestTokioBytesDefaultValues::default_instance().s... | ```protobuf-test/src/v2/test_tokio_bytes_default_value.rs
use protobuf::*;
use super::test_tokio_bytes_default_value_pb::*;
#[test]
fn test_default_values() {
assert_eq!("sss", TestTokioBytesDefaultValues::default_instance().s());
<|user_cursor_is_here|>
assert_eq!(
b"bbb",
TestTokioBytesD... | ```protobuf-test/src/v2/test_tokio_bytes_default_value.rs
use protobuf::*;
use super::test_tokio_bytes_default_value_pb::*;
#[test]
fn test_default_values() {
assert_eq!("sss", TestTokioBytesDefaultValues::default_instance().s());
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "get_b", ... |
User edited file: "parse-parameter.js":
```diff
@@ -3,7 +3,7 @@
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
-module.exports = function(value) {
+module.exports = exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(... | ```parse-parameter.js
'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
module.exports = exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
... | ```parse-parameter.js
'use strict';
let moment = require('moment');
let dateTimeFormat = require('./date-time-format');
module.exports = exports = function(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format(dateTimeFormat);
}
try {
return JSON.parse(value);
... |
User edited file: "examples/simple/src/main/java/coffee/CoffeeApp.java":
```diff
@@ -6,7 +6,7 @@
public class CoffeeApp {
@Singleton
@Component(modules = { DripCoffeeModule.class })
- public interface Coffee {
+ public interface CoffeeShop {
CoffeeMaker maker();
}
@@ -14,4 +14,4 @@
Coffee coffe... | ```examples/simple/src/main/java/coffee/CoffeeApp.java
package coffee;
import dagger.Component;
import javax.inject.Singleton;
public class CoffeeApp {
@Singleton
@Component(modules = { DripCoffeeModule.class })
public interface CoffeeShop {
CoffeeMaker maker();
}
public static void main(String[] args)... | ```examples/simple/src/main/java/coffee/CoffeeApp.java
package coffee;
import dagger.Component;
import javax.inject.Singleton;
public class CoffeeApp {
@Singleton
@Component(modules = { DripCoffeeModule.class })
public interface CoffeeShop {
CoffeeMaker maker();
}
public static void main(String[] args)... |
User edited file: "evaluate/src/main.rs":
```diff
@@ -1,5 +1,7 @@
extern crate document;
extern crate xpath;
+
+use std::io::File;
use std::collections::hashmap::HashMap;
@@ -36,4 +38,4 @@
let res = expr.evaluate(&context);
println!("{}", res);
-}
+}
```
User edited file: "evaluate/src/main.rs":
`... | ```evaluate/src/main.rs
extern crate document;
extern crate xpath;
use std::io::File;
use std::collections::hashmap::HashMap;
use document::ToAny;
use document::parser::Parser;
use xpath::{XPathEvaluationContext,XPathFactory};
use xpath::expression::XPathExpression;
fn main() {
let mut args = std::os::args();
... | ```evaluate/src/main.rs
extern crate document;
extern crate xpath;
use std::io::File;
use std::collections::hashmap::HashMap;
use document::ToAny;
use document::parser::Parser;
use xpath::{XPathEvaluationContext,XPathFactory};
use xpath::expression::XPathExpression;
fn main() {
let mut args = std::os::args();
... |
User edited file: "src/test/java/de/innoaccel/wamp/server/converter/GeneralMessageTests.java":
```diff
@@ -18,7 +18,7 @@
}
@Test(expected = MessageParseException.class)
- public void deserializeThrowsMessageParseExceptionWhenThereIsNoFirstField(final Websocket socket)
+ public void deserializeThrowsM... | ```src/test/java/de/innoaccel/wamp/server/converter/GeneralMessageTests.java
package de.innoaccel.wamp.server.converter;
import de.innoaccel.wamp.server.Websocket;
import de.innoaccel.wamp.server.message.Message;
import org.junit.Test;
import java.io.IOException;
abstract public class GeneralMessageTests<T extends M... | ```src/test/java/de/innoaccel/wamp/server/converter/GeneralMessageTests.java
package de.innoaccel.wamp.server.converter;
import de.innoaccel.wamp.server.Websocket;
import de.innoaccel.wamp.server.message.Message;
import org.junit.Test;
import java.io.IOException;
abstract public class GeneralMessageTests<T extends M... |
User edited file: "fuzz/fuzz_targets/fuzz_asn1_parse.rs":
```diff
@@ -1,6 +1,5 @@
#![no_main]
-#[macro_use]
-extern crate libfuzzer_sys;
+use libfuzzer_sys::fuzz_target;
libfuzzer_sys::fuzz_target!(|data: &[u8]| {
let _ = asn1::parse(data, |d| {
@@ -23,4 +22,4 @@
Ok(())
});
-});
+});
``` | ```fuzz/fuzz_targets/fuzz_asn1_parse.rs
#![no_main]
use libfuzzer_sys::fuzz_target;
<|user_cursor_is_here|>
libfuzzer_sys::fuzz_target!(|data: &[u8]| {
let _ = asn1::parse(data, |d| {
d.read_element::<()>()?;
d.read_element::<bool>()?;
d.read_element::<i8>()?;
d.read_element::<u8>(... | ```fuzz/fuzz_targets/fuzz_asn1_parse.rs
#![no_main]
use libfuzzer_sys::fuzz_target;
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "libfuzzer_sys::fuzz_target!", "newName": "fuzz_target!"}}
</|tool_call|>
libfuzzer_sys::fuzz_target!(|data: &[u8]| {
let _ = asn1::parse(data, |d| {
d.read_... |
User edited file: "cmsplugin_zinnia/placeholder.py":
```diff
@@ -4,7 +4,7 @@
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
-from zinnia.models.entry import EntryAbstractClass
+from zinnia.models_bases.entry import AbstractEntry
class EntryPlaceholder(EntryA... | ```cmsplugin_zinnia/placeholder.py
"""Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models_bases.entry import AbstractEntry
class EntryPlaceholder(AbstractEntry):
"""Entry with a Placeholder to edit c... | ```cmsplugin_zinnia/placeholder.py
"""Placeholder model for Zinnia"""
import inspect
from cms.models.fields import PlaceholderField
from cms.plugin_rendering import render_placeholder
from zinnia.models_bases.entry import AbstractEntry
class EntryPlaceholder(AbstractEntry):
"""Entry with a Placeholder to edit c... |
User edited file: "consulrest/keyvalue.py":
```diff
@@ -20,6 +20,8 @@
if r.ok:
return json.loads(r.text)
+ elif r.status_code == 404:
+ return None
else:
r.raise_for_status()
@@ -51,4 +53,4 @@
if recurse is not None:
params['recurs... | ```consulrest/keyvalue.py
import json
import re
import requests
class KeyValue(object):
def __init__(self, url):
self._url = "%s/kv" % url
def _get(self, key, recurse=None, keys=None):
url = self._url + '/' + key
params = dict()
if recurse is not None:
params['rec... | ```consulrest/keyvalue.py
import json
import re
import requests
class KeyValue(object):
def __init__(self, url):
self._url = "%s/kv" % url
def _get(self, key, recurse=None, keys=None):
url = self._url + '/' + key
params = dict()
if recurse is not None:
params['rec... |
User edited file: "src/KeyboardObserver.js":
```diff
@@ -1,4 +1,4 @@
-import {DeviceEventEmitter} from 'react-native';
+import {Keyboard} from 'react-native';
class KeyboardObserver {
@@ -42,4 +42,4 @@
}
}
-export default new KeyboardObserver();
+export default new KeyboardObserver();
``` | ```src/KeyboardObserver.js
import {Keyboard} from 'react-native';
class KeyboardObserver {
constructor() {
this.keyboardHeight = 0;
this.animationWillEndAt = 0;
this.listeners = {};
this.listenerId = 0;
<|user_cursor_is_here|>
DeviceEventEmitter.addListener('keyboardWillShow', this.handleKey... | ```src/KeyboardObserver.js
import {Keyboard} from 'react-native';
class KeyboardObserver {
constructor() {
this.keyboardHeight = 0;
this.animationWillEndAt = 0;
this.listeners = {};
this.listenerId = 0;
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "DeviceEventEmitter", "... |
User edited file: "src/gx/realtime/RealtimeOptions.java":
```diff
@@ -1,5 +1,6 @@
package gx.realtime;
+import gx.realtime.RealtimeLoader.OnDocumentLoadedCallback;
import gx.realtime.RealtimeLoader.InitializeModelCallback;
import gx.realtime.RealtimeLoader.HandleErrorsCallback;
@@ -56,4 +57,4 @@
public voi... | ```src/gx/realtime/RealtimeOptions.java
package gx.realtime;
import gx.realtime.RealtimeLoader.OnDocumentLoadedCallback;
import gx.realtime.RealtimeLoader.InitializeModelCallback;
import gx.realtime.RealtimeLoader.HandleErrorsCallback;
/**
* Options (key/value) for the RealtimeLoader.
*/
public class RealtimeOption... | ```src/gx/realtime/RealtimeOptions.java
package gx.realtime;
import gx.realtime.RealtimeLoader.OnDocumentLoadedCallback;
import gx.realtime.RealtimeLoader.InitializeModelCallback;
import gx.realtime.RealtimeLoader.HandleErrorsCallback;
/**
* Options (key/value) for the RealtimeLoader.
*/
public class RealtimeOption... |
User edited file: "test/dom/test/basics.spec.js":
```diff
@@ -11,7 +11,7 @@
it('absolute tracking', async () => {
let times = 0;
let poolCopy;
- const targetOne = createTarget({ marginLeft: '-30px' });
+ const targetOne = createTarget({ left: '-30px' });
const targetTwo = createTarget({ marginT... | ```test/dom/test/basics.spec.js
/**
* Basics
*/
describe('Basics', () => {
beforeEach(beforeEachHook);
afterEach(afterEachHook);
/**
* Absolute tracking
*/
it('absolute tracking', async () => {
let times = 0;
let poolCopy;
const targetOne = createTarget({ left: '-30px' });
const targetT... | ```test/dom/test/basics.spec.js
/**
* Basics
*/
describe('Basics', () => {
beforeEach(beforeEachHook);
afterEach(afterEachHook);
/**
* Absolute tracking
*/
it('absolute tracking', async () => {
let times = 0;
let poolCopy;
const targetOne = createTarget({ left: '-30px' });
const targetT... |
User edited file: "src/main/kotlin/com/simonorono/bitc/BitArray.kt":
```diff
@@ -1,4 +1,6 @@
package com.simonorono.bitc
+
+import kotlin.math.ceil
/**
* The BitArray class represents an array of booleans. It stores them packed
@@ -50,4 +52,4 @@
*/
val indices: IntRange
get() = IntRange(0, si... | ```src/main/kotlin/com/simonorono/bitc/BitArray.kt
package com.simonorono.bitc
import kotlin.math.ceil
/**
* The BitArray class represents an array of booleans. It stores them packed
* inside regular integers to not waste the overhead of storing booleans.
*
* @property size The size of the array
*/
class BitArra... | ```src/main/kotlin/com/simonorono/bitc/BitArray.kt
package com.simonorono.bitc
import kotlin.math.ceil
/**
* The BitArray class represents an array of booleans. It stores them packed
* inside regular integers to not waste the overhead of storing booleans.
*
* @property size The size of the array
*/
class BitArra... |
User edited file: "module/index.js":
```diff
@@ -1,3 +1,10 @@
+const requireFromString = (source, filename) => {
+ var m = new module.constructor();
+ m._compile(source, filename);
+ return m.exports;
+};
+ // Credits: http://stackoverflow.com/a/17585470/2816199
+
const startsWithDot = /^\./;
const moduleIdParts... | ```module/index.js
const requireFromString = (source, filename) => {
var m = new module.constructor();
m._compile(source, filename);
return m.exports;
};
// Credits: http://stackoverflow.com/a/17585470/2816199
const loaderContext = {
cacheable() {},
dependencies() {},
async() {throw new Error(
'isomo... | ```module/index.js
const requireFromString = (source, filename) => {
var m = new module.constructor();
m._compile(source, filename);
return m.exports;
};
// Credits: http://stackoverflow.com/a/17585470/2816199
const loaderContext = {
cacheable() {},
dependencies() {},
async() {throw new Error(
'isomo... |
User edited file: "ml/test_amaranth_lib.py":
```diff
@@ -5,6 +5,9 @@
class TestAmaranthHelpers(unittest.TestCase):
+
+ def test_combine_dataframes(self):
+ raise NotImplementedError
def test_load_calorie_data(self):
raise NotImplementedError
@@ -26,4 +29,4 @@
if __name__ == '__main__':
- unitt... | ```ml/test_amaranth_lib.py
# Lint as: python3
"""These tests ensure correctness for the helper functions in amaranth_lib."""
import unittest
class TestAmaranthHelpers(unittest.TestCase):
def test_combine_dataframes(self):
raise NotImplementedError
<|user_cursor_is_here|>
def test_load_calorie_data(self):... | ```ml/test_amaranth_lib.py
# Lint as: python3
"""These tests ensure correctness for the helper functions in amaranth_lib."""
import unittest
class TestAmaranthHelpers(unittest.TestCase):
def test_combine_dataframes(self):
raise NotImplementedError
<|tool_call|>
{"name": "refactor.rename", "arguments": {"... |
User edited file: "lib/components/completeBlock/completeBlock.js":
```diff
@@ -1,4 +1,4 @@
-import CompleteBlock from './completeBlock.html';
+import TemplateCompleteBlock from './completeBlock.html';
import './completeBlock.scss';
class CompleteBlock {
@@ -19,4 +19,4 @@
}
}
-export default CompleteBlock.deta... | ```lib/components/completeBlock/completeBlock.js
import TemplateCompleteBlock from './completeBlock.html';
import './completeBlock.scss';
class CompleteBlock {
static detailsComponent() {
return {
<|user_cursor_is_here|>
templateUrl: CompleteBlock,
bindings: {
headerImg: '@',
headerTitle: '@',
... | ```lib/components/completeBlock/completeBlock.js
import TemplateCompleteBlock from './completeBlock.html';
import './completeBlock.scss';
class CompleteBlock {
static detailsComponent() {
return {
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "CompleteBlock", "newName": "TemplateCompleteBl... |
User edited file: "exercises/bank-account/src/example/kotlin/BankAccount.kt":
```diff
@@ -24,4 +24,5 @@
}
}
-}
+ private val lock = Any()
+}
```
User edited file: "exercises/bank-account/src/example/kotlin/BankAccount.kt":
```diff
@@ -1,12 +1,11 @@
class BankAccount {
var balance: Long = 0
... | ```exercises/bank-account/src/example/kotlin/BankAccount.kt
class BankAccount {
var balance: Long = 0
get() {
synchronized(lock) {
if (!isOpen) throw IllegalStateException("Account is closed")
return field
}
}
private set
var isOpe... | ```exercises/bank-account/src/example/kotlin/BankAccount.kt
class BankAccount {
var balance: Long = 0
get() {
synchronized(lock) {
if (!isOpen) throw IllegalStateException("Account is closed")
return field
}
}
private set
var isOpe... |
User edited file: "python/src/com/jetbrains/python/sdk/flavors/MayaSdkFlavor.kt":
```diff
@@ -3,7 +3,6 @@
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.vfs.VirtualFile
-import icons.PythonIcons
import java.io.File
import javax.swing.Icon
@@ -51,4 +50,4 @@
class MayaFlavorProvider:... | ```python/src/com/jetbrains/python/sdk/flavors/MayaSdkFlavor.kt
// Copyright 2000-2020 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.jetbrains.python.sdk.flavors
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.... | ```python/src/com/jetbrains/python/sdk/flavors/MayaSdkFlavor.kt
// Copyright 2000-2020 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.jetbrains.python.sdk.flavors
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.... |
User edited file: "csunplugged/utils/check_glossary_links.py":
```diff
@@ -1,5 +1,6 @@
"""Module for checking glossary links found within Markdown conversions."""
+from django.core.exceptions import DoesNotExist
from utils.errors.CouldNotFindGlossaryTerm import CouldNotFindGlossaryTerm
from topics.models import G... | ```csunplugged/utils/check_glossary_links.py
"""Module for checking glossary links found within Markdown conversions."""
from django.core.exceptions import DoesNotExist
from utils.errors.CouldNotFindGlossaryTerm import CouldNotFindGlossaryTerm
from topics.models import GlossaryTerm
def check_converter_glossary_links... | ```csunplugged/utils/check_glossary_links.py
"""Module for checking glossary links found within Markdown conversions."""
from django.core.exceptions import DoesNotExist
from utils.errors.CouldNotFindGlossaryTerm import CouldNotFindGlossaryTerm
from topics.models import GlossaryTerm
def check_converter_glossary_links... |
User edited file: "src/test/java/seedu/address/testutil/ItemBuilder.java":
```diff
@@ -9,7 +9,7 @@
*/
public class ItemBuilder {
- private TestItem person;
+ private TestItem item;
public ItemBuilder() {
this.person = new TestItem();
@@ -56,4 +56,4 @@
return this.person;
}
-}... | ```src/test/java/seedu/address/testutil/ItemBuilder.java
package seedu.address.testutil;
import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;
/**
*
*/
public class ItemBuilder {
private TestItem item;
public ItemBuilder() {
... | ```src/test/java/seedu/address/testutil/ItemBuilder.java
package seedu.address.testutil;
import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;
/**
*
*/
public class ItemBuilder {
private TestItem item;
public ItemBuilder() {
... |
User edited file: "django_lightweight_queue/task.py":
```diff
@@ -27,10 +27,10 @@
return "<TaskWrapper: %s>" % self.path
def __call__(self, *args, **kwargs):
- # Allow us to override which queue at the last moment
+ # Allow us to override the default values dynamically
queue = kw... | ```django_lightweight_queue/task.py
from .job import Job
from .utils import get_backend
from . import app_settings
class task(object):
def __init__(self, queue='default', timeout=None, sigkill_on_stop=False):
self.queue = queue
self.timeout = timeout
self.sigkill_on_stop = sigkill_on_stop
... | ```django_lightweight_queue/task.py
from .job import Job
from .utils import get_backend
from . import app_settings
class task(object):
def __init__(self, queue='default', timeout=None, sigkill_on_stop=False):
self.queue = queue
self.timeout = timeout
self.sigkill_on_stop = sigkill_on_stop
... |
User edited file: "src/autobot/src/stopsign.py":
```diff
@@ -14,7 +14,7 @@
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
- self.ignoreDuration = 2
+ self.ignoreDuration = 4
def stopSignDetected(self):
self.state = StopStates.FULL_STOP
@@ -... | ```src/autobot/src/stopsign.py
#!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 4
def stopS... | ```src/autobot/src/stopsign.py
#!/usr/bin/env python
import rospy
class StopStates(object):
NORMAL = 0
FULL_STOP = 1
IGNORE_STOP_SIGNS = 2
class StopSign(object):
def __init__(self):
self.state = StopStates.NORMAL
self.stopDuration = 2
self.ignoreDuration = 4
def stopS... |
User edited file: "worker/build.gradle.kts":
```diff
@@ -4,7 +4,7 @@
}
application {
- mainClassName = "com.github.k0kubun.gitstar_ranking.Main"
+ mainClass.set("com.github.k0kubun.gitstar_ranking.Main")
}
repositories {
@@ -24,4 +24,4 @@
compile("org.jboss.resteasy:resteasy-jackson2-provider:3.1.2.... | ```worker/build.gradle.kts
plugins {
id("java")
id("application")
}
application {
mainClass.set("com.github.k0kubun.gitstar_ranking.Main")
}
repositories {
mavenCentral()
}
dependencies {
implementation("ch.qos.logback:logback-classic:1.3.0-alpha4")
implementation("com.google.guava:guava:21.0... | ```worker/build.gradle.kts
plugins {
id("java")
id("application")
}
application {
mainClass.set("com.github.k0kubun.gitstar_ranking.Main")
}
repositories {
mavenCentral()
}
dependencies {
implementation("ch.qos.logback:logback-classic:1.3.0-alpha4")
implementation("com.google.guava:guava:21.0... |
User edited file: "src/libcore/num/int_macros.rs":
```diff
@@ -14,7 +14,7 @@
concat!("The smallest value that can be represented by this integer type.
Use [`", stringify!($T), "::MIN", "`](../../std/primitive.", stringify!($T), ".html#associatedconstant.MIN) instead."),
#[$attr]
- ... | ```src/libcore/num/int_macros.rs
#![doc(hidden)]
macro_rules! doc_comment {
($x:expr, $($tt:tt)*) => {
#[doc = $x]
$($tt)*
};
}
macro_rules! int_module {
($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
($T:ident, #[$attr:meta]) => (
doc_comment!... | ```src/libcore/num/int_macros.rs
#![doc(hidden)]
macro_rules! doc_comment {
($x:expr, $($tt:tt)*) => {
#[doc = $x]
$($tt)*
};
}
macro_rules! int_module {
($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]););
($T:ident, #[$attr:meta]) => (
doc_comment!... |
User edited file: "app/src/test/java/com/google/android/stardroid/units/LatLongRoboTest.kt":
```diff
@@ -1,11 +1,9 @@
package com.google.android.stardroid.units
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
-imp... | ```app/src/test/java/com/google/android/stardroid/units/LatLongRoboTest.kt
package com.google.android.stardroid.units
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
/**
* Tests... | ```app/src/test/java/com/google/android/stardroid/units/LatLongRoboTest.kt
package com.google.android.stardroid.units
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
/**
* Tests... |
User edited file: "kernel/fs/kscheme.rs":
```diff
@@ -2,7 +2,7 @@
use alloc::boxed::Box;
-use system::error::{Error, Result, ENOENT};
+use system::error::{Error, Result, EPERM};
use system::syscall::Stat;
#[allow(unused_variables)]
@@ -34,4 +34,4 @@
fn unlink(&mut self, path: Url) -> Result<()> {
... | ```kernel/fs/kscheme.rs
use super::{Resource, Url};
use alloc::boxed::Box;
use system::error::{Error, Result, EPERM};
use system::syscall::Stat;
#[allow(unused_variables)]
pub trait KScheme {
fn on_irq(&mut self, irq: u8) {
}
fn scheme(&self) -> &str {
""
}
fn open(&mut self, path: Url... | ```kernel/fs/kscheme.rs
use super::{Resource, Url};
use alloc::boxed::Box;
use system::error::{Error, Result, EPERM};
use system::syscall::Stat;
#[allow(unused_variables)]
pub trait KScheme {
fn on_irq(&mut self, irq: u8) {
}
fn scheme(&self) -> &str {
""
}
fn open(&mut self, path: Url... |
User edited file: "app/src/main/java/com/battlelancer/seriesguide/ui/shows/FabRecyclerViewScrollDetector.kt":
```diff
@@ -3,6 +3,7 @@
import androidx.recyclerview.widget.RecyclerView
import com.battlelancer.seriesguide.R
import com.google.android.material.floatingactionbutton.FloatingActionButton
+import kotlin.mat... | ```app/src/main/java/com/battlelancer/seriesguide/ui/shows/FabRecyclerViewScrollDetector.kt
package com.battlelancer.seriesguide.ui.shows
import androidx.recyclerview.widget.RecyclerView
import com.battlelancer.seriesguide.R
import com.google.android.material.floatingactionbutton.FloatingActionButton
import kotlin.mat... | ```app/src/main/java/com/battlelancer/seriesguide/ui/shows/FabRecyclerViewScrollDetector.kt
package com.battlelancer.seriesguide.ui.shows
import androidx.recyclerview.widget.RecyclerView
import com.battlelancer.seriesguide.R
import com.google.android.material.floatingactionbutton.FloatingActionButton
import kotlin.mat... |
User edited file: "src/conn/futures/ping.rs":
```diff
@@ -6,7 +6,6 @@
use lib_futures::Async::Ready;
use lib_futures::Future;
use lib_futures::Poll;
-use proto::Packet;
use proto::PacketType;
@@ -65,4 +64,4 @@
},
}
}
-}
+}
```
User edited file: "src/conn/futures/ping.rs":
```diff
@... | ```src/conn/futures/ping.rs
use Conn;
use conn::futures::read_packet::ReadPacket;
use conn::futures::write_packet::WritePacket;
use errors::*;
use lib_futures::Async;
use lib_futures::Async::Ready;
use lib_futures::Future;
use lib_futures::Poll;
use proto::PacketType;
steps! {
Ping {
WritePacket(WritePack... | ```src/conn/futures/ping.rs
use Conn;
use conn::futures::read_packet::ReadPacket;
use conn::futures::write_packet::WritePacket;
use errors::*;
use lib_futures::Async;
use lib_futures::Async::Ready;
use lib_futures::Future;
use lib_futures::Poll;
use proto::PacketType;
steps! {
Ping {
WritePacket(WritePack... |
User edited file: "ee-email_des/src/main/kotlin/ee/email/EmailModelGenerator.kt":
```diff
@@ -1,9 +1,9 @@
package ee.email
-import ee.design.KotlinGenerator
+import ee.design.gen.DesingKotlinGenerator
import ee.lang.integ.eePath
fun main(args: Array<String>) {
val generator = KotlinGenerator(model())
... | ```ee-email_des/src/main/kotlin/ee/email/EmailModelGenerator.kt
package ee.email
import ee.design.gen.DesingKotlinGenerator
import ee.lang.integ.eePath
fun main(args: Array<String>) {
<|user_cursor_is_here|>
val generator = KotlinGenerator(model())
generator.generate(eePath)
}
``` | ```ee-email_des/src/main/kotlin/ee/email/EmailModelGenerator.kt
package ee.email
import ee.design.gen.DesingKotlinGenerator
import ee.lang.integ.eePath
fun main(args: Array<String>) {
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "KotlinGenerator", "newName": "DesingKotlinGenerator"}}
... |
User edited file: "lazers-changes-stream/examples/simple_parsing.rs":
```diff
@@ -1,7 +1,7 @@
extern crate hyper;
extern crate serde;
extern crate serde_json as json;
-extern crate syncdb_changes_stream;
+extern crate lazers_changes_stream;
use syncdb_changes_stream::changes_stream::ChangesStream;
@@ -24,5 +24... | ```lazers-changes-stream/examples/simple_parsing.rs
extern crate hyper;
extern crate serde;
extern crate serde_json as json;
extern crate lazers_changes_stream;
<|user_cursor_is_here|>
use syncdb_changes_stream::changes_stream::ChangesStream;
use hyper::Client;
use hyper::header::Connection;
fn main() {
// Creat... | ```lazers-changes-stream/examples/simple_parsing.rs
extern crate hyper;
extern crate serde;
extern crate serde_json as json;
extern crate lazers_changes_stream;
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "syncdb_changes_stream", "newName": "lazers_changes_stream"}}
</|tool_call|>
use syncdb_chan... |
User edited file: "src/world/World.java":
```diff
@@ -2,7 +2,7 @@
import edu.stuy.starlorn.entities.Entity;
-import java.util.ArrayList;
+import java.util.LinkedList;
/*
* Represents a world with entities in it
@@ -25,4 +25,4 @@
e.postStep();
}
}
-}
+}
```
User edited file: "src/w... | ```src/world/World.java
package edu.stuy.starlorn.world;
import edu.stuy.starlorn.entities.Entity;
import java.util.LinkedList;
/*
* Represents a world with entities in it
*/
public class World {
private LinkedList<Entity> _entities;
public World() {
<|user_cursor_is_here|>
_entities = new... | ```src/world/World.java
package edu.stuy.starlorn.world;
import edu.stuy.starlorn.entities.Entity;
import java.util.LinkedList;
/*
* Represents a world with entities in it
*/
public class World {
private LinkedList<Entity> _entities;
public World() {
<|tool_call|>
{"name": "refactor.rename... |
User edited file: "subprojects/docs/src/samples/providers/propertyAndProvider/kotlin/build.gradle.kts":
```diff
@@ -21,7 +21,7 @@
// Read-only property calculated from the message
@get:Internal
- val fullMessage: Provider<String> = message.map { "$it from Gradle" }
+ val fullMessage: Provider<String>... | ```subprojects/docs/src/samples/providers/propertyAndProvider/kotlin/build.gradle.kts
/*
* Copyright 2018 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
... | ```subprojects/docs/src/samples/providers/propertyAndProvider/kotlin/build.gradle.kts
/*
* Copyright 2018 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
... |
User edited file: "app/utils/utilities.py":
```diff
@@ -1,5 +1,5 @@
from re import search
-from flask import g
+from flask import g, request
from flask_restplus import abort
from flask_httpauth import HTTPBasicAuth
from app.models.user import User
@@ -21,4 +21,4 @@
if user_id:
g.current_user = User.q... | ```app/utils/utilities.py
from re import search
from flask import g, request
from flask_httpauth import HTTPTokenAuth
from app.models.user import User
auth = HTTPTokenAuth(scheme='Token')
def validate_email(email):
''' Method to check that a valid email is provided '''
email_re = r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z... | ```app/utils/utilities.py
from re import search
from flask import g, request
from flask_httpauth import HTTPTokenAuth
from app.models.user import User
auth = HTTPTokenAuth(scheme='Token')
def validate_email(email):
''' Method to check that a valid email is provided '''
email_re = r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z... |
User edited file: "src/main/java/com/github/blindpirate/gogradle/task/go/GoExecutionAction.java":
```diff
@@ -31,7 +31,7 @@
closure.setResolveStrategy(Closure.DELEGATE_FIRST);
ClassLoader original = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(... | ```src/main/java/com/github/blindpirate/gogradle/task/go/GoExecutionAction.java
package com.github.blindpirate.gogradle.task.go;
import groovy.lang.Closure;
import org.gradle.api.Task;
import org.gradle.api.internal.tasks.ContextAwareTaskAction;
import org.gradle.api.internal.tasks.TaskExecutionContext;
import java.u... | ```src/main/java/com/github/blindpirate/gogradle/task/go/GoExecutionAction.java
package com.github.blindpirate.gogradle.task.go;
import groovy.lang.Closure;
import org.gradle.api.Task;
import org.gradle.api.internal.tasks.ContextAwareTaskAction;
import org.gradle.api.internal.tasks.TaskExecutionContext;
import java.u... |
User edited file: "src/main/java/org/bubenheimer/android/rx/DisposableWrapper.kt":
```diff
@@ -18,7 +18,7 @@
package org.bubenheimer.android.rx
import io.reactivex.rxjava3.disposables.Disposable
-import org.bubenheimer.android.Check
+import org.bubenheimer.util.examIsNull
/** Cheaper replacement for `SerialDisp... | ```src/main/java/org/bubenheimer/android/rx/DisposableWrapper.kt
/*
* Copyright (c) 2015-2019 Uli Bubenheimer
*
* 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... | ```src/main/java/org/bubenheimer/android/rx/DisposableWrapper.kt
/*
* Copyright (c) 2015-2019 Uli Bubenheimer
*
* 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... |
User edited file: "app/src/main/java/nl/dionsegijn/steppertouchdemo/MainActivity.kt":
```diff
@@ -3,6 +3,7 @@
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.Toast
+import kotlinx.android.synthetic.main.activity_main.*
import nl.dionsegijn.steppertouch.OnStepCallback
... | ```app/src/main/java/nl/dionsegijn/steppertouchdemo/MainActivity.kt
package nl.dionsegijn.steppertouchdemo
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
import nl.dionsegijn.steppertouch.OnStepCallback
import n... | ```app/src/main/java/nl/dionsegijn/steppertouchdemo/MainActivity.kt
package nl.dionsegijn.steppertouchdemo
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
import nl.dionsegijn.steppertouch.OnStepCallback
import n... |
User edited file: "mycollab-servlet/src/main/java/com/mycollab/module/billing/servlet/BillingSpringServletRegistrator.kt":
```diff
@@ -37,6 +37,6 @@
@Bean("resetPasswordServlet")
fun resetPasswordServlet() = ServletRegistrationBean(ResetPasswordHandler(), "/user/recoverypassword/action/*")
- @Bean("rese... | ```mycollab-servlet/src/main/java/com/mycollab/module/billing/servlet/BillingSpringServletRegistrator.kt
/**
* Copyright © MyCollab
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundatio... | ```mycollab-servlet/src/main/java/com/mycollab/module/billing/servlet/BillingSpringServletRegistrator.kt
/**
* Copyright © MyCollab
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundatio... |
User edited file: "src/main/java/seedu/address/storage/XmlFileStorage.java":
```diff
@@ -15,7 +15,7 @@
/**
* Saves the given taskmanager data to the specified file.
*/
- public static void saveDataToFile(File file, XmlSerializableTaskManager addressBook)
+ public static void saveDataToFile(File ... | ```src/main/java/seedu/address/storage/XmlFileStorage.java
package seedu.address.storage;
import java.io.File;
import java.io.FileNotFoundException;
import javax.xml.bind.JAXBException;
import seedu.address.commons.exceptions.DataConversionException;
import seedu.address.commons.util.XmlUtil;
/**
* Stores taskmana... | ```src/main/java/seedu/address/storage/XmlFileStorage.java
package seedu.address.storage;
import java.io.File;
import java.io.FileNotFoundException;
import javax.xml.bind.JAXBException;
import seedu.address.commons.exceptions.DataConversionException;
import seedu.address.commons.util.XmlUtil;
/**
* Stores taskmana... |
User edited file: "deploy/generate_production_ini.py":
```diff
@@ -3,7 +3,7 @@
"""
import os
-from dcicutils.deployment_utils import Deployer
+from dcicutils.deployment_utils import BasicLegacyFourfrontIniFileManager
class FourfrontDeployer(Deployer):
@@ -17,4 +17,4 @@
if __name__ == '__main__':
- mai... | ```deploy/generate_production_ini.py
"""
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import BasicLegacyFourfrontIniFileManager
<|user_cursor_is_here|>
class FourfrontDeployer(Deployer):
_MY_DIR = os.path.dirname(__f... | ```deploy/generate_production_ini.py
"""
Based on environment variables make a config file (production.ini) for our encoded application.
"""
import os
from dcicutils.deployment_utils import BasicLegacyFourfrontIniFileManager
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "Deployer", "newName": "Ba... |
User edited file: "src/main/kotlin/com/demonwav/mcdev/platform/mixin/MixinCustomJavaDocTagProvider.kt":
```diff
@@ -10,7 +10,7 @@
package com.demonwav.mcdev.platform.mixin
-import com.demonwav.mcdev.platform.mixin.util.MixinConstants.Annotations.OVERWRITE
+import com.demonwav.mcdev.platform.mixin.util.MixinConsta... | ```src/main/kotlin/com/demonwav/mcdev/platform/mixin/MixinCustomJavaDocTagProvider.kt
/*
* Minecraft Dev for IntelliJ
*
* https://minecraftdev.org
*
* Copyright (c) 2017 minecraft-dev
*
* MIT License
*/
package com.demonwav.mcdev.platform.mixin
import com.demonwav.mcdev.platform.mixin.util.MixinConstants
imp... | ```src/main/kotlin/com/demonwav/mcdev/platform/mixin/MixinCustomJavaDocTagProvider.kt
/*
* Minecraft Dev for IntelliJ
*
* https://minecraftdev.org
*
* Copyright (c) 2017 minecraft-dev
*
* MIT License
*/
package com.demonwav.mcdev.platform.mixin
import com.demonwav.mcdev.platform.mixin.util.MixinConstants
imp... |
User edited file: "hold-and-fifo/fifo.js":
```diff
@@ -4,8 +4,6 @@
function Fifo(config) {
RED.nodes.createNode(this,config);
- var me = this;
-
this.queue = [];
this.depth = config.depth;
this.status({fill:"red",shape:"ring",text:"no value"});
@@ -44,4 +42,4 @@
RED.nodes.registerType("fifo",Fif... | ```hold-and-fifo/fifo.js
module.exports = function(RED) {
"use strict";
function Fifo(config) {
RED.nodes.createNode(this,config);
this.queue = [];
this.depth = config.depth;
this.status({fill:"red",shape:"ring",text:"no value"});
this.on('input', function (msg) {
// are we full?
// if so, ... | ```hold-and-fifo/fifo.js
module.exports = function(RED) {
"use strict";
function Fifo(config) {
RED.nodes.createNode(this,config);
this.queue = [];
this.depth = config.depth;
this.status({fill:"red",shape:"ring",text:"no value"});
this.on('input', function (msg) {
// are we full?
// if so, ... |
User edited file: "tests/ui/zero_offset.rs":
```diff
@@ -12,7 +12,7 @@
c.sub(0);
c.wrapping_sub(0);
- let y = &1 as *const i32;
+ let sized = &1 as *const i32;
y.offset(0);
}
-}
+}
``` | ```tests/ui/zero_offset.rs
fn main() {
unsafe {
let m = &mut () as *mut ();
m.offset(0);
m.wrapping_add(0);
m.sub(0);
m.wrapping_sub(0);
let c = &() as *const ();
c.offset(0);
c.wrapping_add(0);
c.sub(0);
c.wrapping_sub(0);
le... | ```tests/ui/zero_offset.rs
fn main() {
unsafe {
let m = &mut () as *mut ();
m.offset(0);
m.wrapping_add(0);
m.sub(0);
m.wrapping_sub(0);
let c = &() as *const ();
c.offset(0);
c.wrapping_add(0);
c.sub(0);
c.wrapping_sub(0);
le... |
User edited file: "UM/View/CompositePass.py":
```diff
@@ -1,7 +1,10 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
+from UM.Application import Application
from UM.Resources import Resources
+
+from UM.Math.Matrix import Matrix
from UM.View.RenderPass import R... | ```UM/View/CompositePass.py
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Application import Application
from UM.Resources import Resources
from UM.Math.Matrix import Matrix
from UM.View.RenderPass import RenderPass
from UM.View.GL.OpenGL import OpenGL
class... | ```UM/View/CompositePass.py
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Application import Application
from UM.Resources import Resources
from UM.Math.Matrix import Matrix
from UM.View.RenderPass import RenderPass
from UM.View.GL.OpenGL import OpenGL
class... |
User edited file: "djs_playground/urls.py":
```diff
@@ -1,5 +1,5 @@
from django.conf import settings
-from django.conf.urls import url, include
+from django.urls import re_path, include
from django.conf.urls.static import static
from django.contrib import admin
from djs_playground.views import index
@@ -8,4 +8,4 @... | ```djs_playground/urls.py
from django.conf import settings
from django.urls import re_path, include
from django.conf.urls.static import static
from django.contrib import admin
from djs_playground.views import index
urlpatterns = [
<|user_cursor_is_here|>
url(r'^$', index, name='index'),
url(r'^admin/', adm... | ```djs_playground/urls.py
from django.conf import settings
from django.urls import re_path, include
from django.conf.urls.static import static
from django.contrib import admin
from djs_playground.views import index
urlpatterns = [
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "url", "newNam... |
User edited file: "buildSrc/src/main/kotlin/androidx/build/resources/PublicResourcesStubHelper.kt":
```diff
@@ -16,6 +16,7 @@
package androidx.build.resources
+import androidx.build.getSupportRootFolder
import com.android.build.gradle.LibraryExtension
import org.gradle.api.Project
import java.io.File
@@ -28,4 ... | ```buildSrc/src/main/kotlin/androidx/build/resources/PublicResourcesStubHelper.kt
/*
* Copyright 2021 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
*
... | ```buildSrc/src/main/kotlin/androidx/build/resources/PublicResourcesStubHelper.kt
/*
* Copyright 2021 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
*
... |
User edited file: "day3/solution.js":
```diff
@@ -6,6 +6,9 @@
let uniqueSantaPositions = [];
function updateUniquePositions() {
+ let santaPositionStr = santaPosition.toString();
+ let roboSantaPositionStr = roboSantaPosition.toString();
+
if (uniqueSantaPositions.indexOf(santaPosition.toString()) === -1) {
u... | ```day3/solution.js
let input = require("fs").readFileSync("./data").toString();
let santaPosition = [0, 0];
let roboSantaPosition = [0, 0];
let uniqueSantaPositions = [];
function updateUniquePositions() {
let santaPositionStr = santaPosition.toString();
let roboSantaPositionStr = roboSantaPosition.toString();
... | ```day3/solution.js
let input = require("fs").readFileSync("./data").toString();
let santaPosition = [0, 0];
let roboSantaPosition = [0, 0];
let uniqueSantaPositions = [];
function updateUniquePositions() {
let santaPositionStr = santaPosition.toString();
let roboSantaPositionStr = roboSantaPosition.toString();
... |
User edited file: "src/test/kotlin/jeb/ddsl/FileDescr.kt":
```diff
@@ -6,7 +6,7 @@
name: File,
fileContent: () -> String) : Node(name) {
- private val content = lazy { fileContent() }
+ private val content by lazy { fileContent() }
override fun create() {
name.writeText(conten... | ```src/test/kotlin/jeb/ddsl/FileDescr.kt
package jeb.ddsl
import java.io.File
class FileDescr(
name: File,
fileContent: () -> String) : Node(name) {
private val content by lazy { fileContent() }
override fun create() {
name.writeText(content)
}
<|user_cursor_is_here|>
ov... | ```src/test/kotlin/jeb/ddsl/FileDescr.kt
package jeb.ddsl
import java.io.File
class FileDescr(
name: File,
fileContent: () -> String) : Node(name) {
private val content by lazy { fileContent() }
override fun create() {
name.writeText(content)
}
<|tool_call|>
{"name": "re... |
User edited file: "testing/tests/simple.rs":
```diff
@@ -8,7 +8,7 @@
#[derive(Template)]
#[template(path = "simple.html")]
-struct TestTemplate {
+struct VariablesTemplate {
strvar: String,
num: i64,
i18n: String,
@@ -25,4 +25,4 @@
with number: 42\n\
... | ```testing/tests/simple.rs
#![feature(proc_macro)]
#[macro_use]
extern crate askama_derive;
extern crate askama;
use askama::Template;
#[derive(Template)]
#[template(path = "simple.html")]
struct VariablesTemplate {
strvar: String,
num: i64,
i18n: String,
}
#[test]
fn test_variables() {
<|user_curso... | ```testing/tests/simple.rs
#![feature(proc_macro)]
#[macro_use]
extern crate askama_derive;
extern crate askama;
use askama::Template;
#[derive(Template)]
#[template(path = "simple.html")]
struct VariablesTemplate {
strvar: String,
num: i64,
i18n: String,
}
#[test]
fn test_variables() {
<|tool_call|... |
User edited file: "app/components/stack-metadata/component.js":
```diff
@@ -12,7 +12,7 @@
return this.model.get('vhostNames.length') > this.get('maxVisibleDomainNames');
}),
- vhostRemaining: Ember.computed('vhostNames', function() {
+ vhostRemaining: Ember.computed('model.vhostNames', function() {
re... | ```app/components/stack-metadata/component.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
maxVisibleDomainNames: 1,
displayVhostNames: Ember.computed('model.vhostNames', function() {
return this.model.get('vhostNames').join(', ');
}),
showVhostTooltip: Ember.computed... | ```app/components/stack-metadata/component.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
maxVisibleDomainNames: 1,
displayVhostNames: Ember.computed('model.vhostNames', function() {
return this.model.get('vhostNames').join(', ');
}),
showVhostTooltip: Ember.computed... |
User edited file: "index.js":
```diff
@@ -15,7 +15,7 @@
if(!isSecure(req)){
if(req.method === "GET"){
var httpsPort = req.app.get('httpsPort') || 443;
- var fullUrl = parseUrl('http://' + req.header('Host') + req.url);
+ var fullUrl = parseUrl(req.protocol + '://' + req.header('Host') + req.ur... | ```index.js
var parseUrl = require('url').parse;
var isSecure = function(req) {
if (req.secure) {
return true;
} else if (
req.get('X-Forwarded-Proto') &&
req.get('X-Forwarded-Proto').toLowerCase &&
req.get('X-Forwarded-Proto').toLowerCase() === 'https'
) {
return true;
}
return false;
}... | ```index.js
var parseUrl = require('url').parse;
var isSecure = function(req) {
if (req.secure) {
return true;
} else if (
req.get('X-Forwarded-Proto') &&
req.get('X-Forwarded-Proto').toLowerCase &&
req.get('X-Forwarded-Proto').toLowerCase() === 'https'
) {
return true;
}
return false;
}... |
User edited file: "14-redis-repositories/src/main/java/example/Person.java":
```diff
@@ -5,7 +5,7 @@
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Reference;
-import org.springframework.data.keyvalue.annotation.KeySpace;
+import org.springframework.data.redis.core.RedisH... | ```14-redis-repositories/src/main/java/example/Person.java
package example;
import java.util.Collections;
import java.util.Map;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Reference;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.red... | ```14-redis-repositories/src/main/java/example/Person.java
package example;
import java.util.Collections;
import java.util.Map;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Reference;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.red... |
User edited file: "bots.sample/number-jokes/__init__.py":
```diff
@@ -1,7 +1,7 @@
import random
from botfriend.bot import TextGeneratorBot
-class ExampleBot(TextGeneratorBot):
+class NumberJokes(TextGeneratorBot):
def generate_text(self):
"""Tell a joke about numbers."""
@@ -15,4 +15,4 @@
... | ```bots.sample/number-jokes/__init__.py
import random
from botfriend.bot import TextGeneratorBot
class NumberJokes(TextGeneratorBot):
def generate_text(self):
"""Tell a joke about numbers."""
num = random.randint(1,10)
arguments = dict(
num=num,
plus_1=num+1,
... | ```bots.sample/number-jokes/__init__.py
import random
from botfriend.bot import TextGeneratorBot
class NumberJokes(TextGeneratorBot):
def generate_text(self):
"""Tell a joke about numbers."""
num = random.randint(1,10)
arguments = dict(
num=num,
plus_1=num+1,
... |
User edited file: "src/main/kotlin/me/mrkirby153/KirBot/command/args/elements/NumberElement.kt":
```diff
@@ -12,7 +12,7 @@
val number = num.toDouble()
if (number < min) {
- throw ArgumentParseException(String.format("The number you specified (%.2f) must be greater than %.2f",... | ```src/main/kotlin/me/mrkirby153/KirBot/command/args/elements/NumberElement.kt
package me.mrkirby153.KirBot.command.args.elements
import me.mrkirby153.KirBot.command.args.ArgumentList
import me.mrkirby153.KirBot.command.args.ArgumentParseException
import me.mrkirby153.KirBot.command.args.CommandElement
class NumberEl... | ```src/main/kotlin/me/mrkirby153/KirBot/command/args/elements/NumberElement.kt
package me.mrkirby153.KirBot.command.args.elements
import me.mrkirby153.KirBot.command.args.ArgumentList
import me.mrkirby153.KirBot.command.args.ArgumentParseException
import me.mrkirby153.KirBot.command.args.CommandElement
class NumberEl... |
User edited file: "src/org/yoooo/se1/Application.java":
```diff
@@ -31,7 +31,7 @@
Scanner scanner = new Scanner(string);
SimpleDirectedWeightGraph<String, Integer> graph = new SimpleDirectedWeightGraph<>(
new EdgeFactory<String, Integer>() {
- int next;
+ ... | ```src/org/yoooo/se1/Application.java
package org.yoooo.se1;
import java.util.Scanner;
public class Application {
public void run(String[] args) {
}
public SimpleDirectedWeightGraph<String, Integer> getGraph() {
return null;
}
private static Application sInstance = new Application();
... | ```src/org/yoooo/se1/Application.java
package org.yoooo.se1;
import java.util.Scanner;
public class Application {
public void run(String[] args) {
}
public SimpleDirectedWeightGraph<String, Integer> getGraph() {
return null;
}
private static Application sInstance = new Application();
... |
User edited file: "lib/curry-provider.js":
```diff
@@ -14,23 +14,23 @@
}
getSuggestions({prefix}) {
- if (prefix) {
- const suggestions = [];
-
- for (const module of completions) {
- for (const [key, type] of this.acpTypes) {
- const createSugg = this.createSuggestion.bind(null, m... | ```lib/curry-provider.js
'use babel';
import completions from '../data/completions';
class CurryProvider {
constructor() {
this.scopeSelector = '.source.curry';
this.disableForScopeSelector = '.source.curry .comment';
this.suggestionPriority = 2;
this.filterSuggestions = true;
this.acpTypes = ... | ```lib/curry-provider.js
'use babel';
import completions from '../data/completions';
class CurryProvider {
constructor() {
this.scopeSelector = '.source.curry';
this.disableForScopeSelector = '.source.curry .comment';
this.suggestionPriority = 2;
this.filterSuggestions = true;
this.acpTypes = ... |
User edited file: "app.js":
```diff
@@ -4,7 +4,7 @@
// TOKEN is required for connecting to Slack
-if (!process.env.TOKEN) {
+if (!process.env.SLACK_TOKEN) {
console.log('Error: Please specify TOKEN in the environment.');
process.exit(1);
}
``` | ```app.js
/**
* A Bot for Slack that tracks Mario Kart results and calculates rankings.
*/
// TOKEN is required for connecting to Slack
if (!process.env.SLACK_TOKEN) {
console.log('Error: Please specify TOKEN in the environment.');
process.exit(1);
}
var Botkit = require('botkit');
var controller = Botkit.s... | ```app.js
/**
* A Bot for Slack that tracks Mario Kart results and calculates rankings.
*/
// TOKEN is required for connecting to Slack
if (!process.env.SLACK_TOKEN) {
console.log('Error: Please specify TOKEN in the environment.');
process.exit(1);
}
var Botkit = require('botkit');
var controller = Botkit.s... |
User edited file: "src/main/java/com/skelril/skree/service/ModifierService.java":
```diff
@@ -11,7 +11,7 @@
import java.util.Collection;
public interface ModifierService {
- void setExpiry(String modifierName, long time);
+ void setExpiry(String modifier, long time);
long expiryOf(String modifierName);
... | ```src/main/java/com/skelril/skree/service/ModifierService.java
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.skelril.skree.service;
import com... | ```src/main/java/com/skelril/skree/service/ModifierService.java
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.skelril.skree.service;
import com... |
User edited file: "tasks.py":
```diff
@@ -10,10 +10,10 @@
@task(help={
'pty': "Whether to run tests under a pseudo-tty",
})
-def integration_tests(pty=True):
+def integration(pty=True):
"""Runs integration tests."""
cmd = 'inv test -o --tests=integration'
run(cmd + ('' if pty else ' --no-pty'), p... | ```tasks.py
from invocations import docs
from invocations.testing import test
from invocations.packaging import release
from invoke import Collection
from invoke import run
from invoke import task
@task(help={
'pty': "Whether to run tests under a pseudo-tty",
})
def integration(pty=True):
"""Runs integration... | ```tasks.py
from invocations import docs
from invocations.testing import test
from invocations.packaging import release
from invoke import Collection
from invoke import run
from invoke import task
@task(help={
'pty': "Whether to run tests under a pseudo-tty",
})
def integration(pty=True):
"""Runs integration... |
User edited file: "buildSrc/src/main/kotlin/androidx/build/resources/PublicResourcesStubHelper.kt":
```diff
@@ -16,6 +16,7 @@
package androidx.build.resources
+import androidx.build.getSupportRootFolder
import com.android.build.gradle.LibraryExtension
import org.gradle.api.Project
import org.gradle.api.tasks.C... | ```buildSrc/src/main/kotlin/androidx/build/resources/PublicResourcesStubHelper.kt
/*
* Copyright 2021 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
*
... | ```buildSrc/src/main/kotlin/androidx/build/resources/PublicResourcesStubHelper.kt
/*
* Copyright 2021 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
*
... |
User edited file: "src/middleware/authenticate.js":
```diff
@@ -3,7 +3,6 @@
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
- var verifyHeader = ( !! config.header)
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = ... | ```src/middleware/authenticate.js
import handleAdapter from '../handleAdapter'
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLengt... | ```src/middleware/authenticate.js
import handleAdapter from '../handleAdapter'
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLengt... |
User edited file: "src/test/java/org/jenkins/ci/plugins/jenkinslint/check/SlaveVersionCheckerTestCase.java":
```diff
@@ -1,9 +1,16 @@
package org.jenkins.ci.plugins.jenkinslint.check;
+import hudson.model.Node;
+import hudson.model.Slave;
import hudson.slaves.DumbSlave;
+import hudson.slaves.JNLPLauncher;
+import ... | ```src/test/java/org/jenkins/ci/plugins/jenkinslint/check/SlaveVersionCheckerTestCase.java
package org.jenkins.ci.plugins.jenkinslint.check;
import hudson.model.Node;
import hudson.model.Slave;
import hudson.slaves.DumbSlave;
import hudson.slaves.JNLPLauncher;
import hudson.slaves.NodeProperty;
import hudson.slaves.Re... | ```src/test/java/org/jenkins/ci/plugins/jenkinslint/check/SlaveVersionCheckerTestCase.java
package org.jenkins.ci.plugins.jenkinslint.check;
import hudson.model.Node;
import hudson.model.Slave;
import hudson.slaves.DumbSlave;
import hudson.slaves.JNLPLauncher;
import hudson.slaves.NodeProperty;
import hudson.slaves.Re... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 10