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... |
User edited file: "djangae/blobstore_service.py":
```diff
@@ -20,7 +20,7 @@
global blobstore_service
global server
- from wsgiref.simple_server import make_server, demo_app
+ from wsgiref.simple_server import make_server
from google.appengine.tools.devappserver2.blob_upload import Application
... | ```djangae/blobstore_service.py
import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploa... | ```djangae/blobstore_service.py
import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploa... |
User edited file: "packages/coinstac-common/src/models/project.js":
```diff
@@ -9,7 +9,7 @@
* @extends PouchDocument
* @constructor
* @property {string} name
- * @property {string=} defaultConsortiumId
+ * @property {string=} consortiumId
* @property {(File[])=} files
*/
function Project() {
@@ -23,4 +23,4 ... | ```packages/coinstac-common/src/models/project.js
'use strict';
const PouchDocument = require('./pouch-document');
const joi = require('joi');
const util = require('util');
/**
* @class Project
* @extends PouchDocument
* @constructor
* @property {string} name
* @property {string=} consortiumId
* @property {(Fil... | ```packages/coinstac-common/src/models/project.js
'use strict';
const PouchDocument = require('./pouch-document');
const joi = require('joi');
const util = require('util');
/**
* @class Project
* @extends PouchDocument
* @constructor
* @property {string} name
* @property {string=} consortiumId
* @property {(Fil... |
User edited file: "protocol/src/lib.rs":
```diff
@@ -8,7 +8,7 @@
pub type Result<T> = std::result::Result<T, error::LDAPError>;
-pub fn build_envelope(msgid: i32, protocolOp: common::Tag, controls: Option<common::Tag>) -> common::Tag
+pub fn construct_envelope(msgid: i32, protocolOp: common::Tag, controls: Option... | ```protocol/src/lib.rs
extern crate byteorder;
pub mod ber;
pub mod error;
use ber::common;
use ber::types::ASNType;
pub type Result<T> = std::result::Result<T, error::LDAPError>;
pub fn construct_envelope(msgid: i32, protocolOp: common::Tag, controls: Option<common::Tag>) -> common::Tag
{
let msgidtag = msgid.... | ```protocol/src/lib.rs
extern crate byteorder;
pub mod ber;
pub mod error;
use ber::common;
use ber::types::ASNType;
pub type Result<T> = std::result::Result<T, error::LDAPError>;
pub fn construct_envelope(msgid: i32, protocolOp: common::Tag, controls: Option<common::Tag>) -> common::Tag
{
let msgidtag = msgid.... |
User edited file: "app/src/store/index.js":
```diff
@@ -18,7 +18,7 @@
persistencePlugin({
prefix: "sulcalc",
saveOn: {
- addCustomSets: "sets.custom",
+ importPokemon: "sets.custom",
setSmogonSets: "enabledSets.smogon",
... | ```app/src/store/index.js
import Vue from "vue";
import Vuex, {Store} from "vuex";
import state from "./state";
import * as mutations from "./mutations";
import * as getters from "./getters";
import * as actions from "./actions";
import {persistencePlugin, i18nPlugin} from "./plugins";
Vue.use(Vuex);
export default n... | ```app/src/store/index.js
import Vue from "vue";
import Vuex, {Store} from "vuex";
import state from "./state";
import * as mutations from "./mutations";
import * as getters from "./getters";
import * as actions from "./actions";
import {persistencePlugin, i18nPlugin} from "./plugins";
Vue.use(Vuex);
export default n... |
User edited file: "rust/all-your-base/src/lib.rs":
```diff
@@ -1,34 +1,3 @@
-///
-/// Convert a number between two bases.
-///
-/// A number is any slice of digits.
-/// A digit is any unsigned integer (e.g. u8, u16, u32, u64, or usize).
-/// Bases are specified as unsigned integers.
-///
-/// Return an `Err(.)` if th... | ```rust/all-your-base/src/lib.rs
pub fn convert(number: &[u32], from_base: u32, to_base: u32) -> Result<Vec<u32>, ()> {
if from_base < 2 || to_base < 2 {
return Err(());
}
if number.iter().any(|&x| x >= from_base) {
return Err(());
}
let limit = number.iter().fold(0, |acc, &x| acc ... | ```rust/all-your-base/src/lib.rs
pub fn convert(number: &[u32], from_base: u32, to_base: u32) -> Result<Vec<u32>, ()> {
if from_base < 2 || to_base < 2 {
return Err(());
}
if number.iter().any(|&x| x >= from_base) {
return Err(());
}
let limit = number.iter().fold(0, |acc, &x| acc ... |
User edited file: "platform/platform-impl/src/com/intellij/ui/NotificationActions.kt":
```diff
@@ -23,7 +23,7 @@
* @author Alexander Lobas
*/
-abstract class NotificationAction : AnAction() {
+abstract class CloseNotificationAction : AnAction() {
override fun update(e: AnActionEvent) {
val layout = getBa... | ```platform/platform-impl/src/com/intellij/ui/NotificationActions.kt
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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... | ```platform/platform-impl/src/com/intellij/ui/NotificationActions.kt
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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... |
User edited file: "src/Input/TouchInput.js":
```diff
@@ -1,5 +1,6 @@
-function TouchInput(inputController) {
+function TouchInput(inputController, element) {
this.inputController = inputController;
+ this.element = typeof element !== 'undefined' ? element : document;
}
TouchInput.prototype.listen = functio... | ```src/Input/TouchInput.js
function TouchInput(inputController, element) {
this.inputController = inputController;
this.element = typeof element !== 'undefined' ? element : document;
}
TouchInput.prototype.listen = function() {
<|user_cursor_is_here|>
document.addEventListener('touchstart', this.startT... | ```src/Input/TouchInput.js
function TouchInput(inputController, element) {
this.inputController = inputController;
this.element = typeof element !== 'undefined' ? element : document;
}
TouchInput.prototype.listen = function() {
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "document... |
User edited file: "core/src/us/thirdmillenium/desktoptrainer/DesktopTrainer.java":
```diff
@@ -3,7 +3,7 @@
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
-import us.thirdmillenium.desktoptrainer.environment.SinglePlayEnvironment;
+import us.thirdmillenium.desktoptrainer.environment.Enviro... | ```core/src/us/thirdmillenium/desktoptrainer/DesktopTrainer.java
package us.thirdmillenium.desktoptrainer;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import us.thirdmillenium.desktoptrainer.environment.Environment;
import java.util.Random;
public class DesktopTrainer extends Applicati... | ```core/src/us/thirdmillenium/desktoptrainer/DesktopTrainer.java
package us.thirdmillenium.desktoptrainer;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import us.thirdmillenium.desktoptrainer.environment.Environment;
import java.util.Random;
public class DesktopTrainer extends Applicati... |
User edited file: "src/test/ui/lint/lint-group-nonstandard-style.rs":
```diff
@@ -13,7 +13,7 @@
fn CamelCase() {} //~ ERROR should have a snake
-#[allow(bad_style)]
+#[allow(nonstandard_style)]
mod test {
fn CamelCase() {}
@@ -33,4 +33,4 @@
}
}
-fn main() {}
+fn main() {}
```
User edited file: "s... | ```src/test/ui/lint/lint-group-nonstandard-style.rs
// Copyright 2014–2017 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/lic... | ```src/test/ui/lint/lint-group-nonstandard-style.rs
// Copyright 2014–2017 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/lic... |
User edited file: "service/opencv.py":
```diff
@@ -11,7 +11,7 @@
img = cv2.imread(filename_in)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
th = cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,11,2)
- params = [cv2.cv.CV_IMWRITE_JPEG_QUALITY, 100]
+ ... | ```service/opencv.py
__author__ = 'paulo'
import cv2
class OpenCVIntegration(object):
@staticmethod
def adaptive_threshold(filename_in, filename_out):
img = cv2.imread(filename_in)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
th = cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAU... | ```service/opencv.py
__author__ = 'paulo'
import cv2
class OpenCVIntegration(object):
@staticmethod
def adaptive_threshold(filename_in, filename_out):
img = cv2.imread(filename_in)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
th = cv2.adaptiveThreshold(img,255,cv2.ADAPTIVE_THRESH_GAU... |
User edited file: "libra_node/src/main.rs":
```diff
@@ -20,7 +20,7 @@
let thread = std::thread::current();
unsafe {
signal_hook::register(*signal, move || {
- term_clone.store(true, Ordering::Relaxed);
+ term_clone.store(true, Ordering::Release);
... | ```libra_node/src/main.rs
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use executable_helpers::helpers::{
setup_executable, ARG_CONFIG_PATH, ARG_DISABLE_LOGGING, ARG_PEER_ID,
};
use signal_hook;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
fn register_sig... | ```libra_node/src/main.rs
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use executable_helpers::helpers::{
setup_executable, ARG_CONFIG_PATH, ARG_DISABLE_LOGGING, ARG_PEER_ID,
};
use signal_hook;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
fn register_sig... |
User edited file: "src/angular-bluebird-promises.js":
```diff
@@ -2,6 +2,7 @@
var angular = require('angular');
var bluebird = require('bluebird');
+var MODULE_NAME = 'mwl.bluebird';
angular
.module('mwl.bluebird', [])
@@ -47,4 +48,4 @@
});
-module.exports = 'mwl.bluebird';
+module.exports = 'mwl.blue... | ```src/angular-bluebird-promises.js
'use strict';
var angular = require('angular');
var bluebird = require('bluebird');
var MODULE_NAME = 'mwl.bluebird';
angular
.module(MODULE_NAME, [])
.constant('Bluebird', bluebird)
.config(function($provide, Bluebird) {
//Make bluebird API compatible with angular's sub... | ```src/angular-bluebird-promises.js
'use strict';
var angular = require('angular');
var bluebird = require('bluebird');
var MODULE_NAME = 'mwl.bluebird';
angular
.module(MODULE_NAME, [])
.constant('Bluebird', bluebird)
.config(function($provide, Bluebird) {
//Make bluebird API compatible with angular's sub... |
User edited file: "seax-svm/src/lib.rs":
```diff
@@ -8,8 +8,8 @@
///
/// This is used internally to represent list primitives in the machine.
pub enum List<T> {
- Cons(T ~List<T>),
- Nil
+ Nil,
+ Cons(T, List<T>)
}
/// Public implementation for List.
@@ -28,4 +28,... | ```seax-svm/src/lib.rs
#[test]
fn it_works() {
}
mod SVM {
/// Singly-linked cons list.
///
/// This is used internally to represent list primitives in the machine.
pub enum List<T> {
Nil,
Cons(T, List<T>)
}
/// Public implementation for List.
impl<T> List<T> {
fn... | ```seax-svm/src/lib.rs
#[test]
fn it_works() {
}
mod SVM {
/// Singly-linked cons list.
///
/// This is used internally to represent list primitives in the machine.
pub enum List<T> {
Nil,
Cons(T, List<T>)
}
/// Public implementation for List.
impl<T> List<T> {
fn... |
User edited file: "ee-schkola_des/src/main/kotlin/ee/schkola/SchkolaGenerator.kt":
```diff
@@ -1,6 +1,7 @@
package ee.schkola
import ee.design.gen.go.DesignGoGenerator
+import ee.design.gen.kt.DesignKotlinGenerator
import ee.lang.integ.dPath
fun main(args: Array<String>) {
``` | ```ee-schkola_des/src/main/kotlin/ee/schkola/SchkolaGenerator.kt
package ee.schkola
import ee.design.gen.go.DesignGoGenerator
import ee.design.gen.kt.DesignKotlinGenerator
import ee.lang.integ.dPath
fun main(args: Array<String>) {
<|user_cursor_is_here|>
//val kotlinGenerator = DesignKotlinGenerator(Schkola)
... | ```ee-schkola_des/src/main/kotlin/ee/schkola/SchkolaGenerator.kt
package ee.schkola
import ee.design.gen.go.DesignGoGenerator
import ee.design.gen.kt.DesignKotlinGenerator
import ee.lang.integ.dPath
fun main(args: Array<String>) {
//val kotlinGenerator = DesignKotlinGenerator(Schkola)
<|tool_call|>
{"name... |
User edited file: "app/src/main/java/net/squanchy/support/font/TypefaceDelegate.kt":
```diff
@@ -12,12 +12,12 @@
}
fun applyTypefaceTo(paint: Paint) {
- val fakeStyle = fakeStyle(paint)
+ val previousStyle = fakeStyle(paint)
- if (bold(fakeStyle)) {
+ if (bold(previousStyle)) ... | ```app/src/main/java/net/squanchy/support/font/TypefaceDelegate.kt
package net.squanchy.support.font
import android.graphics.Paint
import android.graphics.Typeface
class TypefaceDelegate(private val newTypeface: Typeface) {
private companion object {
@SuppressWarnings("MagicNumber")
const val TEX... | ```app/src/main/java/net/squanchy/support/font/TypefaceDelegate.kt
package net.squanchy.support.font
import android.graphics.Paint
import android.graphics.Typeface
class TypefaceDelegate(private val newTypeface: Typeface) {
private companion object {
@SuppressWarnings("MagicNumber")
const val TEX... |
User edited file: "app/src/main/java/com/satsumasoftware/timetable/framework/Assignment.kt":
```diff
@@ -1,5 +1,5 @@
package com.satsumasoftware.timetable.framework
-import java.util.*
+import org.threeten.bp.LocalDate
-class Assignment(val id: Int, val title: String, val detail: String, val dueDate: Date)
+class... | ```app/src/main/java/com/satsumasoftware/timetable/framework/Assignment.kt
package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
<|user_cursor_is_here|>
class Assignment(val id: Int, val title: String, val detail: String, val dueDate: Date)
``` | ```app/src/main/java/com/satsumasoftware/timetable/framework/Assignment.kt
package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
<|tool_call|>
{"name": "refactor.rename", "arguments": {"symbol": "Date", "newName": "LocalDate"}}
</|tool_call|>
class Assignment(val id: Int, val title: String,... |
User edited file: "acornui-core/src/commonMain/kotlin/com/acornui/core/UidUtil.kt":
```diff
@@ -19,6 +19,7 @@
import com.acornui.core.time.time
import com.acornui.string.toRadix
import kotlin.math.abs
+import kotlin.random.Random
object UidUtil {
``` | ```acornui-core/src/commonMain/kotlin/com/acornui/core/UidUtil.kt
/*
* Copyright 2017 Nicholas Bilyk
*
* 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/licen... | ```acornui-core/src/commonMain/kotlin/com/acornui/core/UidUtil.kt
/*
* Copyright 2017 Nicholas Bilyk
*
* 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/licen... |
User edited file: "src/index.js":
```diff
@@ -1,8 +1,8 @@
(function () {
/* jshint maxstatements: 1000 */
'use strict';
-var basicParser;
-basicParser = require('./parser.peg.js');
+var pegParser;
+pegParser = require('./parser.peg.js');
/**
* [newpage]
@@ -54,4 +54,4 @@
};
module.exports = { Parser: Pars... | ```src/index.js
(function () {
/* jshint maxstatements: 1000 */
'use strict';
var pegParser;
pegParser = require('./parser.peg.js');
/**
* [newpage]
* [chapter:.*]
* [pixivimage:\d*(-\d*)?]
* [jump:\d*]
* [[jumpuri:.* > URL]]
*
* [ruby: rb > rt]
* [emoji:.*]
* [strong:.*]
*/
function Parser() {
this.tree ... | ```src/index.js
(function () {
/* jshint maxstatements: 1000 */
'use strict';
var pegParser;
pegParser = require('./parser.peg.js');
/**
* [newpage]
* [chapter:.*]
* [pixivimage:\d*(-\d*)?]
* [jump:\d*]
* [[jumpuri:.* > URL]]
*
* [ruby: rb > rt]
* [emoji:.*]
* [strong:.*]
*/
function Parser() {
this.tree ... |
User edited file: "examples/test_markers.py":
```diff
@@ -4,7 +4,7 @@
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
- pytest -v -m xkcd_code ... | ```examples/test_markers.py
""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 ... | ```examples/test_markers.py
""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 ... |
User edited file: "rxpalette-kotlin/src/main/kotlin/io/sweers/rxpalette/RxPalette.kt":
```diff
@@ -7,7 +7,7 @@
/**
* Generate the `Palette` synchronously.
*/
-public inline fun Palette.generate(bitmap: Bitmap): Observable<Palette> = RxPalette.generate(bitmap)
+public inline fun Palette.asObservable(bitmap: Bitmap... | ```rxpalette-kotlin/src/main/kotlin/io/sweers/rxpalette/RxPalette.kt
package io.sweers.rxpalette
import android.graphics.Bitmap
import android.support.v7.graphics.Palette
import rx.Observable
/**
* Generate the `Palette` synchronously.
*/
public inline fun Palette.asObservable(bitmap: Bitmap): Observable<Palette> =... | ```rxpalette-kotlin/src/main/kotlin/io/sweers/rxpalette/RxPalette.kt
package io.sweers.rxpalette
import android.graphics.Bitmap
import android.support.v7.graphics.Palette
import rx.Observable
/**
* Generate the `Palette` synchronously.
*/
public inline fun Palette.asObservable(bitmap: Bitmap): Observable<Palette> =... |
User edited file: "tests/test.rs":
```diff
@@ -8,7 +8,7 @@
#[test]
fn test_scalar_types() {
- fn check_type<T: TypeInfo>(ty: Type) {
+ fn check_scalar_type<T: TypeInfo>(ty: Type) {
assert_eq!(<T as TypeInfo>::type_info(), ty);
assert_eq!(ty.size(), mem::size_of::<T>());
}
@@ -27,4 +27,... | ```tests/test.rs
#[macro_use]
extern crate pod_typeinfo;
use std::mem;
use pod_typeinfo::Type::*;
use pod_typeinfo::{Type, TypeInfo};
#[test]
fn test_scalar_types() {
fn check_scalar_type<T: TypeInfo>(ty: Type) {
assert_eq!(<T as TypeInfo>::type_info(), ty);
assert_eq!(ty.size(), mem::size_of::<T... | ```tests/test.rs
#[macro_use]
extern crate pod_typeinfo;
use std::mem;
use pod_typeinfo::Type::*;
use pod_typeinfo::{Type, TypeInfo};
#[test]
fn test_scalar_types() {
fn check_scalar_type<T: TypeInfo>(ty: Type) {
assert_eq!(<T as TypeInfo>::type_info(), ty);
assert_eq!(ty.size(), mem::size_of::<T... |
User edited file: "rust/rotational-cipher/src/lib.rs":
```diff
@@ -2,6 +2,8 @@
use std::ascii::AsciiExt;
pub fn rotate(text: &str, key: usize) -> String {
+ const LA: u8 = b'a';
+ const UA: u8 = b'A';
text.chars()
.map(|x| match x {
_ if x.is_ascii_lowercase() => {
@@ -15,4 +17,4 @... | ```rust/rotational-cipher/src/lib.rs
#![feature(ascii_ctype)]
use std::ascii::AsciiExt;
pub fn rotate(text: &str, key: usize) -> String {
const LA: u8 = b'a';
const UA: u8 = b'A';
text.chars()
.map(|x| match x {
_ if x.is_ascii_lowercase() => {
let v = (x as u8 - LA + ke... | ```rust/rotational-cipher/src/lib.rs
#![feature(ascii_ctype)]
use std::ascii::AsciiExt;
pub fn rotate(text: &str, key: usize) -> String {
const LA: u8 = b'a';
const UA: u8 = b'A';
text.chars()
.map(|x| match x {
_ if x.is_ascii_lowercase() => {
let v = (x as u8 - LA + ke... |
User edited file: "django_evolution/__init__.py":
```diff
@@ -40,6 +40,8 @@
if VERSION[2]:
version += ".%s" % VERSION[2]
+ tag = VERSION[3]
+
if VERSION[3] != 'final':
version += '%s%s' % (VERSION[3], VERSION[4])
@@ -51,4 +53,4 @@
__version_info__ = VERSION[:-1]
-__version__ = g... | ```django_evolution/__init__.py
"""Django Evolution version and package information.
These variables and functions can be used to identify the version of
Review Board. They're largely used for packaging purposes.
"""
from __future__ import unicode_literals
# The version of Django Evolution
#
# This is in the format... | ```django_evolution/__init__.py
"""Django Evolution version and package information.
These variables and functions can be used to identify the version of
Review Board. They're largely used for packaging purposes.
"""
from __future__ import unicode_literals
# The version of Django Evolution
#
# This is in the format... |
User edited file: "app/modules/weather/weather.sagas.js":
```diff
@@ -1,4 +1,4 @@
-import { call, put, takeLatest } from 'redux-saga/effects';
+import { call, put, takeLatest, select } from 'redux-saga/effects';
import envConfig from 'env-config';
import { WeatherActions, WeatherTypes } from './weather.redux';
@@ ... | ```app/modules/weather/weather.sagas.js
import { call, put, takeLatest, select } from 'redux-saga/effects';
import envConfig from 'env-config';
import { WeatherActions } from './weather.redux';
import { MapTypes } from '../map/map.redux';
import { selectPosition } from '../map/map.selectors';
import { get } from '../a... | ```app/modules/weather/weather.sagas.js
import { call, put, takeLatest, select } from 'redux-saga/effects';
import envConfig from 'env-config';
import { WeatherActions } from './weather.redux';
import { MapTypes } from '../map/map.redux';
import { selectPosition } from '../map/map.selectors';
import { get } from '../a... |
User edited file: "src/kotlin/com/kotlinnlp/simplednn/simplemath/simplemath.kt":
```diff
@@ -8,7 +8,6 @@
package com.kotlinnlp.simplednn.simplemath
import com.kotlinnlp.simplednn.simplemath.ndarray.Shape
-import com.kotlinnlp.simplednn.simplemath.ndarray.wrapper.JBlasArray
typealias NDArray = JBlasArray
@@ -4... | ```src/kotlin/com/kotlinnlp/simplednn/simplemath/simplemath.kt
/* Copyright 2016-present The KotlinNLP Authors. All Rights Reserved.
*
* 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://mozi... | ```src/kotlin/com/kotlinnlp/simplednn/simplemath/simplemath.kt
/* Copyright 2016-present The KotlinNLP Authors. All Rights Reserved.
*
* 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://mozi... |
User edited file: "serde_macros/tests/compile-fail/reject-unknown-attributes.rs":
```diff
@@ -5,7 +5,7 @@
#[derive(Serialize)]
#[serde(abc="xyz")] //~ unknown serde container attribute `abc = "xyz"`
-struct Foo {
+struct A {
x: u32,
}
@@ -27,4 +27,4 @@
x: u32,
}
-fn main() { }
+fn main() { }
```
U... | ```serde_macros/tests/compile-fail/reject-unknown-attributes.rs
#![feature(custom_attribute, custom_derive, plugin)]
#![plugin(serde_macros)]
extern crate serde;
#[derive(Serialize)]
#[serde(abc="xyz")] //~ unknown serde container attribute `abc = "xyz"`
struct A {
x: u32,
}
#[derive(Deserialize)]
#[serde(abc="x... | ```serde_macros/tests/compile-fail/reject-unknown-attributes.rs
#![feature(custom_attribute, custom_derive, plugin)]
#![plugin(serde_macros)]
extern crate serde;
#[derive(Serialize)]
#[serde(abc="xyz")] //~ unknown serde container attribute `abc = "xyz"`
struct A {
x: u32,
}
#[derive(Deserialize)]
#[serde(abc="x... |
User edited file: "detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/Resources.kt":
```diff
@@ -13,6 +13,4 @@
return resource.toURI()
}
-fun resourcePath(name: String): String = resource(name).path
-
fun resourceAsString(name: String): String = String(Files.readAllBytes(Paths.get(resourcePath(name))))... | ```detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/Resources.kt
package io.gitlab.arturbosch.detekt.test
import java.net.URI
import java.nio.file.Files
import java.nio.file.Paths
internal object Resources
fun resource(name: String): URI {
val explicitName = if (name.startsWith("/")) name else "/$name"
... | ```detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/Resources.kt
package io.gitlab.arturbosch.detekt.test
import java.net.URI
import java.nio.file.Files
import java.nio.file.Paths
internal object Resources
fun resource(name: String): URI {
val explicitName = if (name.startsWith("/")) name else "/$name"
... |
User edited file: "app/src/test/java/com/doctoror/particleswallpaper/data/config/SceneConfiguratorImplTest.kt":
```diff
@@ -16,7 +16,7 @@
package com.doctoror.particleswallpaper.data.config
import com.doctoror.particlesdrawable.ParticlesScene
-import com.doctoror.particleswallpaper.data.execution.ComputationSchedu... | ```app/src/test/java/com/doctoror/particleswallpaper/data/config/SceneConfiguratorImplTest.kt
/*
* Copyright (C) 2017 Yaroslav Mytkalyk
*
* 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
*... | ```app/src/test/java/com/doctoror/particleswallpaper/data/config/SceneConfiguratorImplTest.kt
/*
* Copyright (C) 2017 Yaroslav Mytkalyk
*
* 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/main/java/li/cil/oc/example/architecture/ModExampleArchitecture.java":
```diff
@@ -13,8 +13,8 @@
* specific parts. It is not intended for use or distribution, but you're free
* to base a proper addon on this code.
*/
-@Mod(modid = "OpenComputers|ExampleTileEntity",
- name = "OpenCom... | ```src/main/java/li/cil/oc/example/architecture/ModExampleArchitecture.java
package li.cil.oc.example.architecture;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* This mod demonstrates how to create tile entities tha... | ```src/main/java/li/cil/oc/example/architecture/ModExampleArchitecture.java
package li.cil.oc.example.architecture;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* This mod demonstrates how to create tile entities tha... |
User edited file: "src/main/java/com/suse/saltstack/netapi/datatypes/Event.java":
```diff
@@ -1,6 +1,6 @@
package com.suse.saltstack.netapi.datatypes;
-import java.util.HashMap;
+import java.util.Map;
/**
* Parse events into objects.
@@ -25,4 +25,4 @@
public HashMap<String, Object> getData() {
re... | ```src/main/java/com/suse/saltstack/netapi/datatypes/Event.java
package com.suse.saltstack.netapi.datatypes;
import java.util.Map;
/**
* Parse events into objects.
*/
public class Event {
private String tag;
private Map<String, Object> data;
/**
* Return this event's tag.
* @return the tag
... | ```src/main/java/com/suse/saltstack/netapi/datatypes/Event.java
package com.suse.saltstack.netapi.datatypes;
import java.util.Map;
/**
* Parse events into objects.
*/
public class Event {
private String tag;
private Map<String, Object> data;
/**
* Return this event's tag.
* @return the tag
... |
User edited file: "app/src/main/kotlin/com/github/ramonrabello/kiphy/trends/TrendingEndpoint.kt":
```diff
@@ -1,6 +1,6 @@
package com.github.ramonrabello.kiphy.trends
-import com.github.ramonrabello.kiphy.data.model.Trending
+import com.github.ramonrabello.kiphy.trends.model.TrendingResponse
import retrofit2.Call
... | ```app/src/main/kotlin/com/github/ramonrabello/kiphy/trends/TrendingEndpoint.kt
package com.github.ramonrabello.kiphy.trends
import com.github.ramonrabello.kiphy.trends.model.TrendingResponse
import retrofit2.Call
import retrofit2.http.GET
/**
* Retrofit interface for Trending API endpoint.
*/
interface TrendingEnd... | ```app/src/main/kotlin/com/github/ramonrabello/kiphy/trends/TrendingEndpoint.kt
package com.github.ramonrabello.kiphy.trends
import com.github.ramonrabello.kiphy.trends.model.TrendingResponse
import retrofit2.Call
import retrofit2.http.GET
/**
* Retrofit interface for Trending API endpoint.
*/
interface TrendingEnd... |
User edited file: "app/src/main/java/jp/toastkid/yobidashi/main/StartUp.kt":
```diff
@@ -26,7 +26,7 @@
return valueOf(name)
}
- private fun getDefault(): StartUp = START
+ private fun getDefault(): StartUp = BROWSER
fun findById(@IdRes checkedRadioButtonId: Int): StartU... | ```app/src/main/java/jp/toastkid/yobidashi/main/StartUp.kt
package jp.toastkid.yobidashi.main
import android.support.annotation.IdRes
import android.support.annotation.StringRes
import jp.toastkid.yobidashi.R
/**
* Start-up view definition.
*
* @param titleId
* @param radioButtonId
*
* @author toastkidjp
*/
en... | ```app/src/main/java/jp/toastkid/yobidashi/main/StartUp.kt
package jp.toastkid.yobidashi.main
import android.support.annotation.IdRes
import android.support.annotation.StringRes
import jp.toastkid.yobidashi.R
/**
* Start-up view definition.
*
* @param titleId
* @param radioButtonId
*
* @author toastkidjp
*/
en... |
User edited file: "linkatos/activities.py":
```diff
@@ -14,6 +14,10 @@
def is_reaction(index):
return index is not None
+
+
+def remove_url_from(url_cache_list, index):
+ url_cache_list.pop(index)
def event_consumer(expecting_url, url_cache_list, slack_client,
@@ -44,4 +48,4 @@
... | ```linkatos/activities.py
from . import parser
from . import printer
from . import firebase as fb
from . import reaction as react
def is_empty(events):
return ((events is None) or (len(events) == 0))
def is_url(url_cache):
return url_cache is not None
def is_reaction(index):
return index is not None
... | ```linkatos/activities.py
from . import parser
from . import printer
from . import firebase as fb
from . import reaction as react
def is_empty(events):
return ((events is None) or (len(events) == 0))
def is_url(url_cache):
return url_cache is not None
def is_reaction(index):
return index is not None
... |
User edited file: "atomicpress/admin.py":
```diff
@@ -14,6 +14,10 @@
return self.render('admin/home.html')
+class PostView(ModelView):
+ column_default_sort = ('date', True)
+
+
def create_admin():
app = current_app._get_current_object()
admin = Admin(app, "AtomicPress", index_view=HomeView(... | ```atomicpress/admin.py
# -*- coding: utf-8 -*-
from flask import current_app
from flask_admin.contrib.fileadmin import FileAdmin
from flask_admin import AdminIndexView, expose, Admin
from flask_admin.contrib.sqla import ModelView
from atomicpress import models
from atomicpress.app import db
class HomeView(AdminInde... | ```atomicpress/admin.py
# -*- coding: utf-8 -*-
from flask import current_app
from flask_admin.contrib.fileadmin import FileAdmin
from flask_admin import AdminIndexView, expose, Admin
from flask_admin.contrib.sqla import ModelView
from atomicpress import models
from atomicpress.app import db
class HomeView(AdminInde... |
User edited file: "convention/build.gradle.kts":
```diff
@@ -18,7 +18,7 @@
indraPluginPublishing {
plugin(
- id = "convention",
+ id = "sponge.dev",
mainClass = "org.spongepowered.gradle.convention.SpongeConventionPlugin",
displayName = "SpongePowered Convention",
descr... | ```convention/build.gradle.kts
plugins {
groovy
}
tasks.withType(GroovyCompile::class).configureEach {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
options.release.set(indra.javaVersions.target)
}
dependencies {
api(project(":spongegradle-plugin-development"))
implementation(localGr... | ```convention/build.gradle.kts
plugins {
groovy
}
tasks.withType(GroovyCompile::class).configureEach {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
options.release.set(indra.javaVersions.target)
}
dependencies {
api(project(":spongegradle-plugin-development"))
implementation(localGr... |
User edited file: "rust/test/time/now_test.rs":
```diff
@@ -1,34 +1,36 @@
-
use test_tools::*;
use super::TheModule;
//
-fn basic_test()
+tests_impls!
{
- use TheModule::*;
+ #[ test ]
+ fn basic()
+ {
+ use TheModule::*;
- // test.case( "time::now" );
- let got = time::now();
- assert!( got > 0 ... | ```rust/test/time/now_test.rs
use test_tools::*;
use super::TheModule;
//
tests_impls!
{
#[ test ]
fn basic()
{
use TheModule::*;
// test.case( "time::now" );
let got = time::now();
assert!( got > 0 );
// test.case( "time::ms::now" );
let got1 = time::now();
let got2 = time::ms::n... | ```rust/test/time/now_test.rs
use test_tools::*;
use super::TheModule;
//
tests_impls!
{
#[ test ]
fn basic()
{
use TheModule::*;
// test.case( "time::now" );
let got = time::now();
assert!( got > 0 );
// test.case( "time::ms::now" );
let got1 = time::now();
let got2 = time::ms::n... |
User edited file: "statistics.js":
```diff
@@ -4,6 +4,12 @@
module.exports = function statistics() {
return function (req, res, next) {
+ var ip = '';
+ if (req.headers['x-nginx-proxy'] == 'true') {
+ ip = req.headers['x-real-ip'];
+ } else {
+ ip = req.connection.remoteAddress;
+ }
rd... | ```statistics.js
var config = require('./config');
var rdb = config.rdb;
var rdbLogger = config.rdbLogger;
module.exports = function statistics() {
return function (req, res, next) {
var ip = '';
if (req.headers['x-nginx-proxy'] == 'true') {
ip = req.headers['x-real-ip'];
} else {
ip = req.co... | ```statistics.js
var config = require('./config');
var rdb = config.rdb;
var rdbLogger = config.rdbLogger;
module.exports = function statistics() {
return function (req, res, next) {
var ip = '';
if (req.headers['x-nginx-proxy'] == 'true') {
ip = req.headers['x-real-ip'];
} else {
ip = req.co... |
User edited file: "droidbox/src/main/java/com/github/jackparisi/droidbox/binding/SpinnerAdapters.kt":
```diff
@@ -10,6 +10,14 @@
* https://github.com/JackParisi
*/
+/**
+ *
+ * Set a fixed height for the view dropdown popup
+ *
+ * @param view The spinner view that need a custom dropdown popup height
+ * @param ... | ```droidbox/src/main/java/com/github/jackparisi/droidbox/binding/SpinnerAdapters.kt
package com.github.jackparisi.droidbox.binding
import android.databinding.BindingAdapter
import android.widget.ListPopupWindow
import android.widget.Spinner
import com.github.jackparisi.droidbox.utility.dpToPx
/**
* Created by Giacom... | ```droidbox/src/main/java/com/github/jackparisi/droidbox/binding/SpinnerAdapters.kt
package com.github.jackparisi.droidbox.binding
import android.databinding.BindingAdapter
import android.widget.ListPopupWindow
import android.widget.Spinner
import com.github.jackparisi.droidbox.utility.dpToPx
/**
* Created by Giacom... |
User edited file: "src/ios.rs":
```diff
@@ -1,4 +1,4 @@
-use crate::{Error, ErrorKind, Result};
+use crate::{Browser, BrowserOptions, Error, ErrorKind, Result};
use objc::{class, msg_send, runtime::Object, sel, sel_impl};
/// Deal with opening of browsers on iOS
@@ -35,4 +35,4 @@
let () = msg_send![app, o... | ```src/ios.rs
use crate::{Browser, BrowserOptions, Error, ErrorKind, Result};
use objc::{class, msg_send, runtime::Object, sel, sel_impl};
/// Deal with opening of browsers on iOS
#[inline]
pub fn open_browser_internal(
_browser: Browser,
url: &str,
_options: &BrowserOptions,
) -> Result<()> {
// alway... | ```src/ios.rs
use crate::{Browser, BrowserOptions, Error, ErrorKind, Result};
use objc::{class, msg_send, runtime::Object, sel, sel_impl};
/// Deal with opening of browsers on iOS
#[inline]
pub fn open_browser_internal(
_browser: Browser,
url: &str,
_options: &BrowserOptions,
) -> Result<()> {
// alway... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.