hash stringlengths 40 40 | diff stringlengths 131 26.7k | message stringlengths 7 694 | project stringlengths 5 67 | split stringclasses 1 value | diff_languages stringlengths 2 24 |
|---|---|---|---|---|---|
c2b00a9096617b44a902f7e165f3017dbdc98a09 | diff --git a/lib/runBlock.js b/lib/runBlock.js
index <HASH>..<HASH> 100644
--- a/lib/runBlock.js
+++ b/lib/runBlock.js
@@ -116,8 +116,9 @@ module.exports = function (opts, cb) {
}
var txLogs = result.vm.logs || []
+
var rawTxReceipt = [
- receiptResult.toArrayLike(Buffer),
+ result.vm.exception ? 1 : 0, //result.vm.exception is 0 when an exception occurs, and 1 when it doesn't. TODO make this the opposite
gasUsed.toArrayLike(Buffer),
result.bloom.bitvector,
txLogs | correctly handle transaction success or failure in transaction receipt | ethereumjs_ethereumjs-vm | train | js |
6b9b214ac5ff9b89effcfcd06bc821563e6d28b7 | diff --git a/tests/acceptance/ember-init-test.js b/tests/acceptance/ember-init-test.js
index <HASH>..<HASH> 100644
--- a/tests/acceptance/ember-init-test.js
+++ b/tests/acceptance/ember-init-test.js
@@ -4,7 +4,11 @@ import lookup from '../helpers/lookup';
import { module, test } from 'qunit';
function lookupFactory(app, key) {
- return app.__container__.lookupFactory(key);
+ if (app.__container__.factoryFor) {
+ return app.__container__.factoryFor(key);
+ } else {
+ return app.__container__.lookupFactory(key);
+ }
}
let toriiConfiguration = configuration.torii; | Fix deprecated lookupFactory usage in acceptance test | Vestorly_torii | train | js |
8785821126451d75b416522aeef866189d884789 | diff --git a/packet.go b/packet.go
index <HASH>..<HASH> 100644
--- a/packet.go
+++ b/packet.go
@@ -308,6 +308,8 @@ const (
OptionTFTPServerName OptionCode = 66
OptionBootFileName OptionCode = 67
+ OptionClientArchitecture OptionCode = 93
+
OptionTZPOSIXString OptionCode = 100
OptionTZDatabaseString OptionCode = 101 | Added OptionCode <I> for Client Architecture
Determine which of [BIOS, <I>-bit EFI, <I>-bit EFI] the client is, if provided by the client. Used for determining whether to serve up legacy, <I>-bit EFI, or <I>-bit EFI boot images for PXE. Value expected is 0, 6, or 9 (= legacy, <I>, <I>). | krolaw_dhcp4 | train | go |
77ca9d6081d7ea1e788bb966399ff8f55ec3ed59 | diff --git a/java-video-intelligence/samples/snippets/src/test/java/com/example/video/DetectIT.java b/java-video-intelligence/samples/snippets/src/test/java/com/example/video/DetectIT.java
index <HASH>..<HASH> 100644
--- a/java-video-intelligence/samples/snippets/src/test/java/com/example/video/DetectIT.java
+++ b/java-video-intelligence/samples/snippets/src/test/java/com/example/video/DetectIT.java
@@ -79,17 +79,11 @@ public class DetectIT {
@Test
public void testTrackObjects() throws Exception {
- VideoAnnotationResults result = TrackObjects.trackObjects("resources/cat.mp4");
+ TrackObjects.trackObjects("resources/googlework_short.mp4");
- boolean textExists = false;
- for (ObjectTrackingAnnotation objectTrackingAnnotation : result.getObjectAnnotationsList()) {
- if (objectTrackingAnnotation.getEntity().getDescription().toUpperCase().contains("CAT")) {
- textExists = true;
- break;
- }
- }
+ String got = bout.toString();
- assertThat(textExists).isTrue();
+ assertThat(got).contains("Entity id");
}
@Test | samples: video: update .mp4 file used in test (#<I>)
Fixes <URL>
- [ x] Environment Variables need to be set (ask us to set them) | googleapis_google-cloud-java | train | java |
081dc0f88895c742441f19cac78250bcdc3a7268 | diff --git a/slackviewer/message.py b/slackviewer/message.py
index <HASH>..<HASH> 100644
--- a/slackviewer/message.py
+++ b/slackviewer/message.py
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import datetime
+import logging
import re
import emoji
@@ -180,7 +181,12 @@ class Message(object):
def _sub_channel_ref(self, matchobj):
channel_id = matchobj.group(0)[2:-1]
- channel_name = self.__CHANNEL_DATA[channel_id]["name"]
+ try:
+ channel_name = self.__CHANNEL_DATA[channel_id]["name"]
+ except KeyError as e:
+ logging.error("A channel reference was detected but metadata "
+ "not found in channels.json: {}".format(e))
+ channel_name = channel_id
return "*#{}*".format(channel_name)
def __em_strong(self, matchobj, format="em"): | In case channel name isn't in metadata, use id instead | hfaran_slack-export-viewer | train | py |
06bcf1c9ace7ae2ad0a15cd6b37afb33a872e5a7 | diff --git a/backbone-firebase.js b/backbone-firebase.js
index <HASH>..<HASH> 100644
--- a/backbone-firebase.js
+++ b/backbone-firebase.js
@@ -497,8 +497,8 @@
}
this._listenLocalChange(false);
this.set(newModel);
- this.trigger("sync", this, null, null);
this._listenLocalChange(true);
+ this.trigger("sync", this, null, null);
},
_log: function(msg) { | Trigger sync after listen is reenabled. | googlearchive_backbonefire | train | js |
a4f6df985a499f437cd9a9eaa247a25f129f85f2 | diff --git a/http_test.go b/http_test.go
index <HASH>..<HASH> 100644
--- a/http_test.go
+++ b/http_test.go
@@ -150,7 +150,7 @@ func TestParseAddr(t *testing.T) {
// Contains the server test for multi running servers
func TestMultiRunningServers_v1_PROXY(t *testing.T) {
defer Close()
- host := "mydomain.com" // you have to add it to your hosts file( for windows, as 127.0.0.1 mydomain.com)
+ host := "localhost" // you have to add it to your hosts file( for windows, as 127.0.0.1 mydomain.com)
initDefault()
Default.Config.DisableBanner = true
// create the key and cert files on the fly, and delete them when this test finished | Iris has been updated to <I> . Fix travis http_test...
Please read HISTORY.md | kataras_iris | train | go |
2f9c7f6432d857529edcc16248daea33c65d2485 | diff --git a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerExpVisitor.java b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerExpVisitor.java
index <HASH>..<HASH> 100644
--- a/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerExpVisitor.java
+++ b/core/typechecker/src/main/java/org/overture/typechecker/visitor/TypeCheckerExpVisitor.java
@@ -207,6 +207,26 @@ public class TypeCheckerExpVisitor extends AbstractTypeCheckVisitor
}
@Override
+ public PType caseAAndBooleanBinaryExp(AAndBooleanBinaryExp node, TypeCheckInfo question) throws AnalysisException
+ {
+ List<QualifiedDefinition> qualified = node.getLeft().apply(question.assistantFactory.getQualificationVisitor(), question);
+
+ for (QualifiedDefinition qdef: qualified)
+ {
+ qdef.qualifyType();
+ }
+
+ PType result = defaultSBooleanBinaryExp(node, question);
+
+ for (QualifiedDefinition qdef: qualified)
+ {
+ qdef.resetType();
+ }
+
+ return result;
+ }
+
+ @Override
public PType caseACompBinaryExp(ACompBinaryExp node, TypeCheckInfo question)
throws AnalysisException
{ | Account for is_ expressions in and clauses, fixes #<I> | overturetool_overture | train | java |
e80900d7f3e8c3150eb8c8c3ecc40512b38a3ef3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -385,7 +385,7 @@ Pagelet.readable('params', {
* @return {Number} Length of queue
* @api private
*/
-Pagelet.set('length', function length() {
+Pagelet.get('length', function length() {
return this._children.length;
}); | [fix] use getter in stead of setter | bigpipe_pagelet | train | js |
458195d97df556dc912c4484cd868becc708873c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -236,7 +236,7 @@ function getCurrentState(systemID, authOpts) {
sensors: typeof sensors != 'undefined' ? sensors.data : [],
lights: typeof lights != 'undefined' ? lights.data : [],
locks: typeof locks != 'undefined' ? locks.data : [],
- garages: typeof locks != 'undefined' ? garageDoors.data : [],
+ garages: typeof garageDoors != 'undefined' ? garageDoors.data : [],
relationships: rels
}
}) | Fixes mistake with ternary assignment. | mkormendy_node-alarm-dot-com | train | js |
f9f94221d3cb869da417ab76a1232e79fc336eab | diff --git a/intake/cli/server/server.py b/intake/cli/server/server.py
index <HASH>..<HASH> 100644
--- a/intake/cli/server/server.py
+++ b/intake/cli/server/server.py
@@ -114,11 +114,10 @@ class ServerInfoHandler(tornado.web.RequestHandler):
# This could be a search of a search of a serach (etc.).
# Progressively apply each search and then page through the
# final results.
- refined_cat = cat
for query in query_list:
- refined_cat = refined_cat.search(query)
+ cat = cat.search(query)
page = itertools.islice(
- refined_cat.walk(depth=1).items(), start, stop)
+ cat.walk(depth=1).items(), start, stop)
else:
# Page through all results.
page = itertools.islice(cat.walk(depth=1).items(), start, stop)
@@ -129,7 +128,7 @@ class ServerInfoHandler(tornado.web.RequestHandler):
sources.append(info)
server_info = dict(version=__version__, sources=sources,
- metadata=self.catalog.metadata)
+ metadata=cat.metadata)
else:
msg = 'Access forbidden'
raise tornado.web.HTTPError(status_code=403, log_message=msg, | Give metadata from relevant (maybe nested) Catalog. | intake_intake | train | py |
ad52d2baab3fbd969b2ea6dc59c44f00c0a61973 | diff --git a/pkg/testing/integration/command.go b/pkg/testing/integration/command.go
index <HASH>..<HASH> 100644
--- a/pkg/testing/integration/command.go
+++ b/pkg/testing/integration/command.go
@@ -40,7 +40,6 @@ func RunCommand(t *testing.T, name string, args []string, wd string, opts *Progr
env = append(env, "PULUMI_DEBUG_COMMANDS=true")
env = append(env, "PULUMI_RETAIN_CHECKPOINTS=true")
env = append(env, "PULUMI_CONFIG_PASSPHRASE=correct horse battery staple")
- env = append(env, "PULUMI_IGNORE_AMBIENT_PLUGINS=true")
cmd := exec.Cmd{
Path: path, | Don't disable ambiant providers during tests (#<I>)
I had wanted this to ensure that dynamic providers were working correctly, but we also have test providers that we don't install as proper plugins. | pulumi_pulumi | train | go |
2304a04a51aff014fb4fe3792b855a46643b74ae | diff --git a/lib/neo4j/active_node/has_n/association.rb b/lib/neo4j/active_node/has_n/association.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/active_node/has_n/association.rb
+++ b/lib/neo4j/active_node/has_n/association.rb
@@ -68,7 +68,7 @@ module Neo4j
end
def target_classes
- target_class_names.map(&ClassArguments.method(:constantize_argument))
+ ClassArguments.constantize_argument(target_class_names)
end
def target_classes_or_nil | Already doing the mapping inside of .constantize_argument | neo4jrb_neo4j | train | rb |
fc7ed016c3817daa7dc7458df69b86d8c9d1e98e | diff --git a/lib/mortar/version.rb b/lib/mortar/version.rb
index <HASH>..<HASH> 100644
--- a/lib/mortar/version.rb
+++ b/lib/mortar/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Mortar
- VERSION = "0.3.2"
+ VERSION = "0.3.3"
end | Release <I> (#<I>) | kontena_mortar | train | rb |
2a1be3729dac216d3128039aa259ef9fd7900013 | diff --git a/core/server/services/channels/Channels2.js b/core/server/services/channels/Channels2.js
index <HASH>..<HASH> 100644
--- a/core/server/services/channels/Channels2.js
+++ b/core/server/services/channels/Channels2.js
@@ -131,10 +131,7 @@ const collection1 = new Collection({
value: '/{settings.permalinks}/'
},
config: {
- type: 'posts',
- options: {
- filter: 'featured:false'
- }
+ type: 'posts'
}
}); | Fixed wrong default filter for default collection
refs #<I>
- while i was testing different collections and different filters, i somehow thought that the default
collection does not contain featured posts 😀 🙊
- this is wrong (!!!!)
- the url service is not yet connected
- so: this is not a bug | TryGhost_Ghost | train | js |
dc33b5426c65be18ad07dffc97fb32a3546c9604 | diff --git a/tensorflow_datasets/core/load.py b/tensorflow_datasets/core/load.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/core/load.py
+++ b/tensorflow_datasets/core/load.py
@@ -291,7 +291,7 @@ def load(
Returns:
ds: `tf.data.Dataset`, the dataset requested, or if `split` is None, a
- `dict<key: tfds.Split, value: tfds.data.Dataset>`. If `batch_size=-1`,
+ `dict<key: tfds.Split, value: tf.data.Dataset>`. If `batch_size=-1`,
these will be full datasets as `tf.Tensor`s.
ds_info: `tfds.core.DatasetInfo`, if `with_info` is True, then `tfds.load`
will return a tuple `(ds, ds_info)` containing dataset information | fix return type of tfds.load in doc
Was referring to `tfds.data.Dataset` instead of `tf.data.Dataset`. | tensorflow_datasets | train | py |
90e84866bac6769433f112c7e1990f5b88db6229 | diff --git a/code/photini/googlemap.py b/code/photini/googlemap.py
index <HASH>..<HASH> 100644
--- a/code/photini/googlemap.py
+++ b/code/photini/googlemap.py
@@ -55,7 +55,7 @@ show_map = """<!DOCTYPE html>
"""
class WebView(QtWebKit.QWebView):
- def dragEnterEvent(self, event):
+ def dragMoveEvent(self, event):
if event.mimeData().hasText():
event.acceptProposedAction() | Got drag and drop working on Windows.
All it took (after a lot of searching) was to change dragEnterEvent to
dragMoveEvent. | jim-easterbrook_Photini | train | py |
1cdd46025f76035fd4edfc75db2d236d04241f0a | diff --git a/mongo_orchestration/server.py b/mongo_orchestration/server.py
index <HASH>..<HASH> 100644
--- a/mongo_orchestration/server.py
+++ b/mongo_orchestration/server.py
@@ -2,6 +2,7 @@
# coding=utf-8
import argparse
import json
+import logging
import os
import signal
import sys
@@ -19,9 +20,6 @@ work_dir = os.environ.get('MONGO_ORCHESTRATION_HOME', os.getcwd())
pid_file = os.path.join(work_dir, 'server.pid')
log_file = os.path.join(work_dir, 'server.log')
-import logging
-logging.basicConfig(level=logging.DEBUG, filename=log_file, filemode='w')
-
def read_env():
"""return command-line arguments"""
@@ -114,6 +112,7 @@ class MyDaemon(Daemon):
def main():
+ logging.basicConfig(level=logging.DEBUG, filename=log_file, filemode='w')
daemon = MyDaemon(pid_file, timeout=5, stdout=sys.stdout)
args = read_env()
daemon.set_args(args) | Configure logging in main().
Allows a wrapper library to configure logging differently
from how Orchestration configures it when running
standalone. | 10gen_mongo-orchestration | train | py |
6fa5d4501c0745050e14fe48f175cf9869f5a8b3 | diff --git a/examples/js/tickers.js b/examples/js/tickers.js
index <HASH>..<HASH> 100644
--- a/examples/js/tickers.js
+++ b/examples/js/tickers.js
@@ -58,6 +58,14 @@ let printTickers = async (id) => {
for (let symbol of exchange.symbols)
if ((symbol.indexOf ('.d') < 0)) { // skip darkpool symbols
+
+ const market = exchange.markets[symbol];
+
+ if (!market['active']) {
+ log.red (exchange.id + ' ' + symbol + ' inactive');
+ continue;
+ }
+
await sleep (exchange.rateLimit)
await printTicker (exchange, symbol)
} | added a check for `active` markets to examples/js/tickers.js fix #<I> | ccxt_ccxt | train | js |
0a2895b0998bc7ab66b8339acf64fda0339d1e53 | diff --git a/tests/perf_bench/bm_chaos.py b/tests/perf_bench/bm_chaos.py
index <HASH>..<HASH> 100644
--- a/tests/perf_bench/bm_chaos.py
+++ b/tests/perf_bench/bm_chaos.py
@@ -218,6 +218,10 @@ class Chaosgame(object):
###########################################################################
# Benchmark interface
+if not hasattr(random, "randrange"):
+ print("SKIP")
+ raise SystemExit
+
bm_params = {
(100, 50): (0.25, 100, 50, 50, 50, 1234),
(1000, 1000): (0.25, 200, 400, 400, 1000, 1234), | tests/perf_bench: Skip bm_chaos test if random.randrange is unavailable. | micropython_micropython | train | py |
86a8e9b7c44a88ed7510282f87e34c50dfc28037 | diff --git a/coconut/compiler/header.py b/coconut/compiler/header.py
index <HASH>..<HASH> 100644
--- a/coconut/compiler/header.py
+++ b/coconut/compiler/header.py
@@ -532,7 +532,7 @@ class _coconut_partial(object):'''
return _coconut.repr(self.func) + "$(" + ", ".join(args) + ")"
def datamaker(data_type):
"""Returns base data constructor of passed data type."""
- if _coconut.isinstance(data_type, _coconut.tuple) and _coconut.hasattr(data_type, "_make"):
+ if _coconut.issubclass(data_type, _coconut.tuple) and _coconut.hasattr(data_type, "_make"):
return data_type._make
else:
return _coconut.functools.partial(_coconut.super(data_type, data_type).__new__, data_type) | Fix datamaker on starred data types | evhub_coconut | train | py |
c26de033e9351fc7a6da1c221ba9875b8802fd74 | diff --git a/src/DoctrineStaticMeta.php b/src/DoctrineStaticMeta.php
index <HASH>..<HASH> 100644
--- a/src/DoctrineStaticMeta.php
+++ b/src/DoctrineStaticMeta.php
@@ -313,7 +313,6 @@ class DoctrineStaticMeta
}
$skip = [
'getDoctrineStaticMeta' => true,
- 'getIdField' => true,
'isValid' => true,
]; | removing getIdField skip, no longer needed | edmondscommerce_doctrine-static-meta | train | php |
373adf3161aeee927ea99742b3c75dc3ea3d3922 | diff --git a/lib/mongo/grid/stream/read.rb b/lib/mongo/grid/stream/read.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/grid/stream/read.rb
+++ b/lib/mongo/grid/stream/read.rb
@@ -74,7 +74,7 @@ module Mongo
view.each_with_index.reduce(0) do |length_read, (doc, index)|
chunk = Grid::File::Chunk.new(doc)
validate!(index, num_chunks, chunk, length_read)
- data = Grid::File::Chunk.assemble([ chunk ])
+ data = chunk.data.data
yield data
length_read += data.size
end if block_given? | Remove unnecessary string allocation
When streaming the chunked GridFS file, instead of assembling the
contents into a new string, we can just return the already allocated
string. Normally this wouldn't matter, but since these strings are parts
of a file they're relatively large (default is <I> KB, but people can
set it to more). | mongodb_mongo-ruby-driver | train | rb |
2e25ed63e8ffff056dd1f2b75e5db6e550311f71 | diff --git a/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/cors/ConfigurePage.java b/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/cors/ConfigurePage.java
index <HASH>..<HASH> 100644
--- a/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/cors/ConfigurePage.java
+++ b/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/cors/ConfigurePage.java
@@ -69,6 +69,7 @@ class ConfigurePage implements IsWidget {
portItem = new NumberBoxItem("port", "Port");
form.setFields(nameItem, schemeItem, hostItem, portItem);
+ form.setEnabled(true);
content.add(form);
DefaultButton pingButton = new DefaultButton(Console.CONSTANTS.bs_ping());
@@ -137,6 +138,7 @@ class ConfigurePage implements IsWidget {
void reset() {
configureStatus.setVisible(false);
form.clearValues();
+ form.setEnabled(true);
portItem.setValue(9990);
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override | Fix ballroom <I>: edit state for server access page (bootstrap) | hal_core | train | java |
92678a737c73ca16590dee2108b329216e5930e9 | diff --git a/lib/preprocessor.js b/lib/preprocessor.js
index <HASH>..<HASH> 100644
--- a/lib/preprocessor.js
+++ b/lib/preprocessor.js
@@ -163,10 +163,19 @@ function Preprocessor(bundler, compiler, sharedProcessedFiles) {
}
}
+ function assert(config) {
+
+ if(config && config.frameworks && config.frameworks.indexOf("karma-typescript") !== -1) {
+ return config;
+ }
+
+ throw new Error("Missing karma-typescript framework, please add 'frameworks: [\"karma-typescript\"]' to your Karma config");
+ }
+
var create = function(_config, helper, logger) {
log = logger.create("preprocessor.karma-typescript");
- config = _config;
+ config = assert(_config);
karmaTypescriptConfig = config.karmaTypescriptConfig || {};
var coveragePreprocessor = coverage( | Assert that the plugin is added as framework with a helpful message, #<I> | monounity_karma-typescript | train | js |
24ecb24cb578851d0a34dfe2ce48c43f03206569 | diff --git a/math/Vector.php b/math/Vector.php
index <HASH>..<HASH> 100644
--- a/math/Vector.php
+++ b/math/Vector.php
@@ -205,4 +205,15 @@ class Vector
return new static($result);
}
+
+ /**
+ * Returns the normalized Vector, ie. a Vector with the same direction but a length of 1.
+ *
+ * @return Vector The normalized vector.
+ * @throws exceptions\DivisionByZero When the Vector's length is zero.
+ */
+ public function normalize() : Vector
+ {
+ return $this->divide($this->length());
+ }
} | [Utils/Math] Added Vector::normalize() | unyx_utils | train | php |
5fe5c47cd15499ecbc97718a6c57b0536152a39c | diff --git a/src/components/button/__tests__/CdrButton.spec.js b/src/components/button/__tests__/CdrButton.spec.js
index <HASH>..<HASH> 100644
--- a/src/components/button/__tests__/CdrButton.spec.js
+++ b/src/components/button/__tests__/CdrButton.spec.js
@@ -97,8 +97,10 @@ describe('CdrButton.vue', () => {
it('adds icon class when slot is used', () => {
const wrapper = shallowMount(CdrButton, {
slots: {
- default: [
+ icon: [
'named slot icon',
+ ],
+ default: [
'default slot for text'
],
}, | test(button): fix unit test that looks at slots
affects: @rei/cdr-button | rei_rei-cedar | train | js |
69969d0d73c6f5e3581e9ec217c9a6507449b6fc | diff --git a/dht/dht.go b/dht/dht.go
index <HASH>..<HASH> 100644
--- a/dht/dht.go
+++ b/dht/dht.go
@@ -862,7 +862,8 @@ func (s *Server) bootstrap() (err error) {
var t *transaction
t, err = s.findNode(node.addr, s.id)
if err != nil {
- return
+ log.Printf("error sending find_node: %s", err)
+ continue
}
outstanding.Add(1)
go func() { | dht: Error while sending a find_node during bootstrap is not fatal | anacrolix_torrent | train | go |
e59deec9725d387a23db3226609c07bc764dfc20 | diff --git a/common/gce/gce.go b/common/gce/gce.go
index <HASH>..<HASH> 100644
--- a/common/gce/gce.go
+++ b/common/gce/gce.go
@@ -23,8 +23,8 @@ import (
)
const (
- waitForGCEInterval = 2 * time.Second
- waitForGCETimeout = time.Minute
+ waitForGCEInterval = 5 * time.Second
+ waitForGCETimeout = 3 * time.Minute
)
func EnsureOnGCE() error { | Increased timeout while waiting for GCE metadata | kubernetes-retired_heapster | train | go |
d9ce1306e182fff35dbd2efa82385d3312042235 | diff --git a/test/unit/features/options/name.spec.js b/test/unit/features/options/name.spec.js
index <HASH>..<HASH> 100644
--- a/test/unit/features/options/name.spec.js
+++ b/test/unit/features/options/name.spec.js
@@ -39,13 +39,12 @@ describe('Options name', () => {
expect(vm.options.components['Hyper*Vue']).toBeUndefined()
})
- it('id should override given name when using Vue.component', () => {
+ it('id should not override given name when using Vue.component', () => {
const SuperComponent = Vue.component('super-component', {
name: 'SuperVue'
})
- expect(SuperComponent.options.components['SuperVue']).toBeUndefined()
- expect(SuperComponent.options.components['super-component']).toBeDefined()
+ expect(SuperComponent.options.components['SuperVue']).toEqual(SuperComponent)
expect(SuperComponent.options.components['super-component']).toEqual(SuperComponent)
})
}) | fix tests for global name override | IOriens_wxml-transpiler | train | js |
9d8730c312941cf7c214097d1594187590157cd7 | diff --git a/Controller/ContactClientController.php b/Controller/ContactClientController.php
index <HASH>..<HASH> 100644
--- a/Controller/ContactClientController.php
+++ b/Controller/ContactClientController.php
@@ -46,12 +46,12 @@ class ContactClientController extends FormController
$session = $this->get('session');
$search = $this->request->get('search', $session->get('mautic.'.$this->getSessionBase().'.filter', ''));
if (isset($search) && is_numeric(trim($search))) {
- $search = trim($search).' OR id:'.trim($search);
+ $search = '%'.trim($search).'% OR ids:'.trim($search);
$query = $this->request->query->all();
$query['search'] = $search;
$this->request = $this->request->duplicate($query);
$session->set('mautic.'.$this->getSessionBase().'.filter', $search);
- } elseif (false === strpos($search, '%')) {
+ } elseif (false === strpos($search, '%') && strlen($search) > 0 && false === strpos($search, 'OR ids:')) {
$search = '%'.trim($search, ' \t\n\r\0\x0B"%').'%';
$search = strpos($search, ' ') ? '"'.$search.'"' : $search;
$query = $this->request->query->all(); | [ENG-<I>] remove %% from search filter | TheDMSGroup_mautic-contact-client | train | php |
cc1e3933c9bdd07bce39fbde26df20acd012e86a | diff --git a/modules/CUAV/camera.py b/modules/CUAV/camera.py
index <HASH>..<HASH> 100644
--- a/modules/CUAV/camera.py
+++ b/modules/CUAV/camera.py
@@ -751,7 +751,7 @@ def mavlink_packet(m):
bottle = m.servo7_raw
if bottle == 1000:
mpstate.console.set_status('Bottle', 'Bottle: HELD', row=0, fg='green')
- elif bottle == 1380:
+ elif bottle == 1430:
mpstate.console.set_status('Bottle', 'Bottle: DROP', row=0, fg='red')
else:
mpstate.console.set_status('Bottle', 'Bottle: %u' % bottle, row=0, fg='red') | camera: bottle release at <I> | ArduPilot_MAVProxy | train | py |
03bd92d84fa92f2dbf01ce6783087df9f3fd078c | diff --git a/addon/components/street-view.js b/addon/components/street-view.js
index <HASH>..<HASH> 100644
--- a/addon/components/street-view.js
+++ b/addon/components/street-view.js
@@ -74,7 +74,7 @@ export default Component.extend({
},
updatePanoramaPosition: on('init', observer('lat', 'lng', 'latLng', 'panorama', function() {
- if (!(this.lat && this.lng) && this.latLng) {
+ if (this.latLng) {
this.setLatLng();
}
let lat = this.get('lat'); | Allow subsequent latLng updates to work
Fixes #<I> | accessterminal_ember-cli-google-street-view | train | js |
da4345e279523f5a513939588fd0695b2017f41e | diff --git a/src/Symfony/Component/HttpKernel/HttpKernel.php b/src/Symfony/Component/HttpKernel/HttpKernel.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/HttpKernel.php
+++ b/src/Symfony/Component/HttpKernel/HttpKernel.php
@@ -33,7 +33,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
// Help opcache.preload discover always-needed symbols
-class_exists(LegacyEventDispatcherProxy::class);
class_exists(ControllerArgumentsEvent::class);
class_exists(ControllerEvent::class);
class_exists(ExceptionEvent::class); | Remove preloading of unused class | symfony_symfony | train | php |
120080f34b67a35c3e61ad2d416dbf63fafa8c2d | diff --git a/src/Joomlatools/Console/Command/Site/Configure.php b/src/Joomlatools/Console/Command/Site/Configure.php
index <HASH>..<HASH> 100644
--- a/src/Joomlatools/Console/Command/Site/Configure.php
+++ b/src/Joomlatools/Console/Command/Site/Configure.php
@@ -101,7 +101,7 @@ class Configure extends AbstractDatabase
$contents = file_get_contents($source);
$replace = function($name, $value, &$contents) {
- $pattern = sprintf("#%s = '.*?'#", $name);
+ $pattern = sprintf("#%s\s+= '.*?'#", $name);
$match = preg_match($pattern, $contents);
if(!$match) | #<I>: Match multiple whitespace characters at once | joomlatools_joomlatools-console | train | php |
a9bcd38181ceb79afba82adcd4de1aebf571e74c | diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go
index <HASH>..<HASH> 100644
--- a/publisher/htmlElementsCollector.go
+++ b/publisher/htmlElementsCollector.go
@@ -152,18 +152,21 @@ type htmlElementsCollectorWriter struct {
}
// Write collects HTML elements from p.
-func (w *htmlElementsCollectorWriter) Write(p []byte) (n int, err error) {
- n = len(p)
+func (w *htmlElementsCollectorWriter) Write(p []byte) (int, error) {
w.input = p
- w.pos = 0
for {
w.r = w.next()
if w.r == eof {
- return
+ break
}
w.state = w.state(w)
}
+
+ w.pos = 0
+ w.input = nil
+
+ return len(p), nil
}
func (l *htmlElementsCollectorWriter) backup() { | publisher: Get the collector in line with the io.Writer interface
As in: Do not retain the input slice. | gohugoio_hugo | train | go |
bdc30c6454f3ec194ef2b9a6da9647879a75f642 | diff --git a/js/braziliex.js b/js/braziliex.js
index <HASH>..<HASH> 100644
--- a/js/braziliex.js
+++ b/js/braziliex.js
@@ -263,7 +263,7 @@ module.exports = class braziliex extends Exchange {
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'symbol': symbol,
- 'id': undefined,
+ 'id': this.safeString (trade, '_id'),
'order': orderId,
'type': 'limit',
'side': trade['type'], | recovered _id back in trades #<I> | ccxt_ccxt | train | js |
424039e1c6a39eca8bec08eb1d2ac3c89a44b483 | diff --git a/src/OAuth/Services/OAuthService.php b/src/OAuth/Services/OAuthService.php
index <HASH>..<HASH> 100644
--- a/src/OAuth/Services/OAuthService.php
+++ b/src/OAuth/Services/OAuthService.php
@@ -177,8 +177,8 @@ class OAuthService
}
$url = $this->getConfig('sandbox')
- ? 'https://signin.sandbox.ebay.com/authorize?'
- : 'https://signin.ebay.com/authorize?';
+ ? 'https://auth.sandbox.ebay.com/oauth2/authorize?'
+ : 'https://auth.ebay.com/oauth2/authorize?';
$urlParams = [
'client_id' => $this->getConfig('credentials')->getAppId(), | Responsive OAuth Redirect URL
Responsive version of OAuth redirect URL provided by eBay to avoid error message on mobile devices. Fixes error "This can't be completed on a small screen, Please try again using a desktop computer instead." | davidtsadler_ebay-sdk-php | train | php |
b3860c55d16b5ede6c43d933e5bdc4259d04f1a3 | diff --git a/options.go b/options.go
index <HASH>..<HASH> 100644
--- a/options.go
+++ b/options.go
@@ -276,7 +276,7 @@ func hasArg(s string) bool {
if !strings.HasPrefix(s, "-") {
s = "-" + s
}
- for _, arg := range os.Args {
+ for _, arg := range os.Args[1:] {
if strings.Split(arg, "=")[0] == s {
return true
} | Skip the first os.Args when iterating
This will always be the program name, so no point checking it | mreiferson_go-options | train | go |
c0f5d7c236d1e41cf927274efac50fb1f71007b6 | diff --git a/lib/header/index.js b/lib/header/index.js
index <HASH>..<HASH> 100644
--- a/lib/header/index.js
+++ b/lib/header/index.js
@@ -15,7 +15,6 @@ module.exports = (function() {
this.branch(
'list',
- 'content',
'x'
); | Removed 'content' from default branching in lib/header/index.js | jhermsmeier_node-envelope | train | js |
eebf20aea86d8cfd6586ecffd76666fd6deb08e1 | diff --git a/lib/active_admin/reloader.rb b/lib/active_admin/reloader.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/reloader.rb
+++ b/lib/active_admin/reloader.rb
@@ -2,6 +2,10 @@ module ActiveAdmin
class FileUpdateChecker < ::ActiveSupport::FileUpdateChecker
+ def paths
+ @files
+ end if !respond_to?(:paths)
+
# Over-ride the default #updated_at to support the deletion of files
def updated_at
paths.map { |path| File.mtime(path) rescue Time.now }.max | Fix file reloading with Rails <I> | activeadmin_activeadmin | train | rb |
a3339b3c49745f4a45dc857c74c19fb1aab3a073 | diff --git a/pywal/sequences.py b/pywal/sequences.py
index <HASH>..<HASH> 100644
--- a/pywal/sequences.py
+++ b/pywal/sequences.py
@@ -7,7 +7,7 @@ from .settings import CACHE_DIR, OS
from . import util
-def set_special(index, color, iterm_name):
+def set_special(index, color, iterm_name="g"):
"""Convert a hex color to a special sequence."""
alpha = util.Color.alpha_num
@@ -45,7 +45,7 @@ def create_sequences(colors, vte):
# Set a blank color that isn't affected by bold highlighting.
# Used in wal.vim's airline theme.
- sequences.append(set_color(66, colors["special"]["background"]))
+ sequences.append(set_color(66, colors["special"]["background"], "h"))
# This escape sequence doesn"t work in VTE terminals.
if not vte: | sequences: Add missing args | dylanaraps_pywal | train | py |
0ae148716be3f060aa62ee037320cb1985837b67 | diff --git a/squad/api/rest.py b/squad/api/rest.py
index <HASH>..<HASH> 100644
--- a/squad/api/rest.py
+++ b/squad/api/rest.py
@@ -52,8 +52,8 @@ class ProjectStatusFilter(filters.FilterSet):
class BuildFilter(filters.FilterSet):
- project = filters.RelatedFilter(ProjectFilter, name="project", queryset=Project.objects.all())
- status = filters.RelatedFilter(ProjectStatusFilter, name="status", queryset=ProjectStatus.objects.all())
+ project = filters.RelatedFilter(ProjectFilter, name="project", queryset=Project.objects.all(), widget=forms.TextInput)
+ status = filters.RelatedFilter(ProjectStatusFilter, name="status", queryset=ProjectStatus.objects.all(), widget=forms.TextInput)
class Meta:
model = Build
@@ -362,7 +362,7 @@ class BuildViewSet(ModelViewSet):
List of all builds in the system. Only builds belonging to public projects
and to projects you have access to are available.
"""
- queryset = Build.objects.prefetch_related('test_runs').order_by('-datetime').all()
+ queryset = Build.objects.prefetch_related('status', 'test_runs').order_by('-datetime').all()
serializer_class = BuildSerializer
filter_fields = ('version', 'project')
filter_class = BuildFilter | api: speed up API UI for builds | Linaro_squad | train | py |
ac1886bf7b1a5b28db75a70cbf3c2c0960e6627e | diff --git a/lib/jsdom/living/nodes/CharacterData-impl.js b/lib/jsdom/living/nodes/CharacterData-impl.js
index <HASH>..<HASH> 100644
--- a/lib/jsdom/living/nodes/CharacterData-impl.js
+++ b/lib/jsdom/living/nodes/CharacterData-impl.js
@@ -33,10 +33,10 @@ class CharacterDataImpl extends NodeImpl {
}
if (offset + count > length) {
- return this._data.substring(offset);
+ return this._data.slice(offset);
}
- return this._data.substring(offset, offset + count);
+ return this._data.slice(offset, offset + count);
}
appendData(data) {
@@ -62,8 +62,8 @@ class CharacterDataImpl extends NodeImpl {
count = length - offset;
}
- const start = this._data.substring(0, offset);
- const end = this._data.substring(offset + count);
+ const start = this._data.slice(0, offset);
+ const end = this._data.slice(offset + count);
this._data = start + data + end; | Improve the performance of parsing text
The impact of this change is particularly noticeable for large inline `<style>` or `<script>` elements, since these are more likely to contain a single uninterrupted text node than other elements. | jsdom_jsdom | train | js |
abe66a7f1c49f34667470fa12e883745ae7181ef | diff --git a/requests_ntlm/requests_ntlm.py b/requests_ntlm/requests_ntlm.py
index <HASH>..<HASH> 100644
--- a/requests_ntlm/requests_ntlm.py
+++ b/requests_ntlm/requests_ntlm.py
@@ -55,9 +55,8 @@ class HttpNtlmAuth(AuthBase):
# get the challenge
auth_header_value = response2.headers[auth_header_field]
- if auth_header_value.endswith', Negotiate'):
- auth_header_value = auth_header_value[:-11]
- ServerChallenge, NegotiateFlags = ntlm.parse_NTLM_CHALLENGE_MESSAGE(auth_header_value[5:])
+ ntlm_header_value = filter(lambda s: s.startswith('NTLM '), auth_header_value.split(','))[0]
+ ServerChallenge, NegotiateFlags = ntlm.parse_NTLM_CHALLENGE_MESSAGE(ntlm_header_value[5:])
# build response
request = copy_request(request) | Pick only the NTLM challenge from the auth cookie | requests_requests-ntlm | train | py |
a24d8fad01aa51265dcc620666724b648656221b | diff --git a/src/components/tabs/tabs.js b/src/components/tabs/tabs.js
index <HASH>..<HASH> 100644
--- a/src/components/tabs/tabs.js
+++ b/src/components/tabs/tabs.js
@@ -40,6 +40,11 @@ class Tab extends ContentSwitcher {
this._handleKeyDown(event);
})
);
+ this.manage(
+ on(this.element.ownerDocument, 'click', event => {
+ this._handleDocumentClick(event);
+ })
+ );
const selected = this.element.querySelector(this.options.selectorButtonSelected);
if (selected) {
@@ -82,6 +87,20 @@ class Tab extends ContentSwitcher {
}
/**
+ * Handles click on document.
+ * @param {Event} event The triggering event.
+ * @private
+ */
+ _handleDocumentClick(event) {
+ const { element } = this;
+ const isOfSelf = element.contains(event.target);
+ if (isOfSelf) {
+ return;
+ }
+ this._updateMenuState(false);
+ }
+
+ /**
* Handles arrow keys on tab container.
* * Left keys are used to go to previous tab.
* * Right keys are used to go to next tab. | feat(tabs): collapse dropdown on document click in mobile variant (#<I>) | carbon-design-system_carbon-components | train | js |
79f7a84273e755aed3c500013950f9893ac5661a | diff --git a/tcex/case_management/case.py b/tcex/case_management/case.py
index <HASH>..<HASH> 100644
--- a/tcex/case_management/case.py
+++ b/tcex/case_management/case.py
@@ -280,8 +280,12 @@ class Users:
def __init__(self, users):
self.user = []
- for data in users:
- self.user.append(User(**data.get('data', data)))
+ if isinstance(users, dict):
+ for data in users.get('data', []):
+ self.user.append(User(**data))
+ elif isinstance(users, list):
+ for user in users:
+ self.user.append(user)
@property
def as_dict(self): | minor change to Users to get the appropriate data | ThreatConnect-Inc_tcex | train | py |
690c11201d9e48c0210c8dc644cc281f40e896ad | diff --git a/bugtool/cmd/root.go b/bugtool/cmd/root.go
index <HASH>..<HASH> 100644
--- a/bugtool/cmd/root.go
+++ b/bugtool/cmd/root.go
@@ -307,6 +307,7 @@ func runAll(commands []string, cmdDir string, k8sPods []string) {
continue
}
+ cmd := cmd // https://golang.org/doc/faq#closures_and_goroutines
err := wp.Submit(cmd, func(_ context.Context) error {
if strings.Contains(cmd, "xfrm state") {
// Output of 'ip -s xfrm state' needs additional processing to replace | bugtool: fix data race occurring when running commands
A version of the classic closure with concurrency gotcha. Bind the value
of cmd in the loop to a new variable to address the issue. | cilium_cilium | train | go |
6c555d6f350b3da5433e7c6a77336df175ab13b5 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -254,7 +254,7 @@ codesign.signAppDirectory = function (path, config, cb) {
}
try {
if (!fs.lstatSync(config.outdir + '/Payload').isDirectory()) {
- throw new ('Invalid IPA');
+ throw new Error('Invalid IPA');
}
} catch (e) {
return codesign.cleanup(config, () => { | throw an Error instead of a string | nowsecure_node-applesign | train | js |
290be6ffcbe21d8097a4124bb630bbf4a52d9e7e | diff --git a/registry/hub.go b/registry/hub.go
index <HASH>..<HASH> 100644
--- a/registry/hub.go
+++ b/registry/hub.go
@@ -58,7 +58,13 @@ func (h *HubService) GetDeleteToken(repo string, auth Authenticator) (*TokenAuth
}
func (h *HubService) newRequest(method, urlStr string, auth Authenticator) (*http.Request, error) {
- req, err := h.client.newRequest(method, urlStr, auth, nil)
+ var req *http.Request
+ var err error
+ if method == "GET" {
+ req, err = h.client.newRequest(method, urlStr, auth, nil)
+ } else {
+ req, err = h.client.newRequest(method, urlStr, auth, []string{})
+ }
if err != nil {
return nil, err
} | sets a request body when the method type isn't GET. This fixes any errors recieved from doing PUTs with no body | CenturyLinkLabs_docker-reg-client | train | go |
6af5d6ab5abc5b3433f0d6544fe4d08e47321619 | diff --git a/src/lib/PlayerManager.js b/src/lib/PlayerManager.js
index <HASH>..<HASH> 100644
--- a/src/lib/PlayerManager.js
+++ b/src/lib/PlayerManager.js
@@ -67,10 +67,6 @@ class PlayerManager extends PlayerStore {
const node = new LavalinkNode(this, options);
node.on("error", error => this.client.emit("error", error));
- node.on("disconnect", reason => {
- if (!this.nodes.size) return this.client.emit("debug", new Error("[Lavalink] - No available voice nodes."));
- this.client.emit("debug", reason);
- });
node.on("message", this.onMessage.bind(this));
this.nodes.set(options.host, node); | Literally pointless to have that there | MrJacz_discord.js-lavalink | train | js |
f6674cf58a28d9d5aa1e393d0101aaee757ff328 | diff --git a/pynYNAB/schema/budget.py b/pynYNAB/schema/budget.py
index <HASH>..<HASH> 100644
--- a/pynYNAB/schema/budget.py
+++ b/pynYNAB/schema/budget.py
@@ -160,7 +160,7 @@ class MonthlyAccountCalculation(Entity):
transaction_count=EntityField(None)
uncleared_balance=AmountField()
warning_count=EntityField(None)
- rolling_balance=EntityField(None)
+ rolling_balance=AmountField()
class MonthlySubcategoryBudgetCalculation(Entity): | rolling_balance as AmountField | rienafairefr_pynYNAB | train | py |
d2595e008d755990979cbef5dfbcc96e22f45938 | diff --git a/lib/engine.go b/lib/engine.go
index <HASH>..<HASH> 100644
--- a/lib/engine.go
+++ b/lib/engine.go
@@ -86,6 +86,8 @@ type Engine struct {
numIterations int64
numTaints int64
+ thresholdsTainted bool
+
// Subsystem-related.
lock sync.Mutex
subctx context.Context
@@ -365,6 +367,10 @@ func (e *Engine) GetVUsMax() int64 {
}
func (e *Engine) IsTainted() bool {
+ if e.thresholdsTainted {
+ return true
+ }
+
e.lock.Lock()
defer e.lock.Unlock()
@@ -560,14 +566,16 @@ func (e *Engine) processThresholds() {
if !ok {
continue
}
+
e.Logger.WithField("m", m.Name).Debug("running thresholds")
succ, err := ts.Run(s)
if err != nil {
- e.Logger.WithField("m", m.Name).WithError(err).Error("Threshold Error")
+ e.Logger.WithField("m", m.Name).WithError(err).Error("Threshold error")
continue
}
if !succ {
e.Logger.WithField("m", m.Name).Debug("Thresholds failed")
+ e.thresholdsTainted = true
}
}
} | [fix] Failed thresholds should taint the test | loadimpact_k6 | train | go |
a460b8c80dffe253de7f063358328730af4397fd | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@ if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
-version = '0.0.20'
+version = '0.0.21'
install_requires = [
'chevron >= 0.13.1', | Release <I> (#<I>) | googleapis_protoc-java-resource-names-plugin | train | py |
d467f5a37a05307ea667ac803c21479b447354b2 | diff --git a/src/DoctrineModule/Module.php b/src/DoctrineModule/Module.php
index <HASH>..<HASH> 100644
--- a/src/DoctrineModule/Module.php
+++ b/src/DoctrineModule/Module.php
@@ -35,7 +35,7 @@ class Module implements ConfigProviderInterface, InitProviderInterface, Bootstra
public function init(ModuleManagerInterface $moduleManager)
{
AnnotationRegistry::registerLoader(
- function ($className) {
+ static function ($className) {
return class_exists($className);
}
); | bind Closure to null to allow the garbage collector do it's work | doctrine_DoctrineModule | train | php |
1c565dff2a48f70e4bf6302873005e3c8bf3071b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -92,7 +92,7 @@ if install:
# Prepare coverage report and prepare it for sphinx.
if coverage_report:
os.system('coverage report -m --skip-covered')
- os.system('coverage xml')
+ os.system('coverage xml --skip-covered')
os.system('pycobertura show --format html '
'--output coverage.html coverage.xml')
shutil.move('coverage.html', | add --skip-covered also to the temporary xml report (used for creating the final html report) | hydpy-dev_hydpy | train | py |
fe8a31e752fd38ebbff204fc849afad98f3c6238 | diff --git a/config/webpack-testing.config.js b/config/webpack-testing.config.js
index <HASH>..<HASH> 100644
--- a/config/webpack-testing.config.js
+++ b/config/webpack-testing.config.js
@@ -15,7 +15,7 @@ config.node = {
};
config.module.loaders.forEach(function (loader) {
- if (loader.loader !== 'babel-loader') {
+ if (loader.loader !== 'babel-loader' && loader.tag !== 'glo') {
delete loader.include;
}
});
diff --git a/webpack.js b/webpack.js
index <HASH>..<HASH> 100644
--- a/webpack.js
+++ b/webpack.js
@@ -67,11 +67,11 @@ module.exports = function (config, basePath, options) {
query: {
presets: ['es2015']
},
- include: includePaths,
- exclude: gloPath
+ include: includePaths.concat(gloPath)
},
{
test: /\.js$/,
+ tag: 'glo',
loaders: [
'exports-loader?GLO',
'imports-loader?_=underscore&cola=webcola' | test: build glo.js with webpack so unit tests run | Kitware_candela | train | js,js |
e5830d2b1831f3f193f1983de8cf50b5804f4dd2 | diff --git a/hendrix/facilities/resources.py b/hendrix/facilities/resources.py
index <HASH>..<HASH> 100644
--- a/hendrix/facilities/resources.py
+++ b/hendrix/facilities/resources.py
@@ -6,7 +6,7 @@ from twisted.web.server import NOT_DONE_YET
from twisted.web.wsgi import WSGIResource, _WSGIResponse
import chalk
from hendrix.facilities.response import HendrixWSGIResponse, LoudWSGIResponse
-
+from twisted.logger import Logger
class HendrixWSGIResource(WSGIResource):
@@ -37,6 +37,8 @@ class HendrixResource(resource.Resource):
to ensure that django always gets the full path.
"""
+ logger = Logger()
+
def __init__(self, reactor, threads, application, loud=False):
resource.Resource.__init__(self)
if loud:
@@ -88,7 +90,7 @@ class HendrixResource(resource.Resource):
name = parts[-1] # get the path part that we care about
if children.get(name):
- logger.warning(
+ self.logger.warning(
'A resource already exists at this path. Check '
'your resources list to ensure each path is '
'unique. The previous resource will be overridden.' | Using Twisted Logger for Resource. Fixes #<I>. | hendrix_hendrix | train | py |
9fd57ce4c04946a3e20e5f0b314a91b61a87c1a4 | diff --git a/tests/Entities/LocationTest.php b/tests/Entities/LocationTest.php
index <HASH>..<HASH> 100644
--- a/tests/Entities/LocationTest.php
+++ b/tests/Entities/LocationTest.php
@@ -64,7 +64,7 @@ class LocationTest extends TestCase
*/
public function testSearchByFoursquareId()
{
- $response = $this->location->searchByFoursquareId(48.858325999999998, 2.294505)->get();
+ $response = $this->location->searchByFoursquareId('51a2445e5019c80b56934c75')->get();
$this->assertCount(1, $response);
}
} | Fixed incorrect data in test for `Location` | larabros_elogram | train | php |
85332cc3690ca8fd05642e5cd2b2c6205bf4d740 | diff --git a/backtrader/cerebro.py b/backtrader/cerebro.py
index <HASH>..<HASH> 100644
--- a/backtrader/cerebro.py
+++ b/backtrader/cerebro.py
@@ -28,6 +28,7 @@ import multiprocessing
from .utils.py3 import map, range, zip, with_metaclass, string_types
from . import linebuffer
+from . import indicator
from .broker import BrokerBack
from .metabase import MetaParams
from . import observers
@@ -357,6 +358,7 @@ class Cerebro(with_metaclass(MetaParams, object)):
Strategy classes added with ``addstrategy``
'''
linebuffer.LineActions.cleancache() # clean cache
+ indicator.Indicator.cleancache() # clean cache
if not self.datas:
return [] # nothing can be run | Indicator cache clean-up on each cerebro run | backtrader_backtrader | train | py |
62b103b84357ccc12dea0d4bdfedfe68cc6accbf | diff --git a/pkg/tsdb/azuremonitor/azuremonitor-datasource.go b/pkg/tsdb/azuremonitor/azuremonitor-datasource.go
index <HASH>..<HASH> 100644
--- a/pkg/tsdb/azuremonitor/azuremonitor-datasource.go
+++ b/pkg/tsdb/azuremonitor/azuremonitor-datasource.go
@@ -293,9 +293,11 @@ func (e *AzureMonitorDatasource) parseResponse(queryRes *tsdb.QueryResult, amr A
dataField := frame.Fields[1]
dataField.Name = amr.Value[0].Name.LocalizedValue
dataField.Labels = labels
- dataField.SetConfig(&data.FieldConfig{
- Unit: toGrafanaUnit(amr.Value[0].Unit),
- })
+ if amr.Value[0].Unit != "Unspecified" {
+ dataField.SetConfig(&data.FieldConfig{
+ Unit: toGrafanaUnit(amr.Value[0].Unit),
+ })
+ }
if query.Alias != "" {
dataField.Config.DisplayName = formatAzureMonitorLegendKey(query.Alias, query.UrlComponents["resourceName"],
amr.Value[0].Name.LocalizedValue, "", "", amr.Namespace, amr.Value[0].ID, labels) | Azuremonitor: do not set unit if literal "Unspecified" (#<I>)
part of #<I> | grafana_grafana | train | go |
2f0a4864bcff2f1cf8f195d0a8adda6b122b9143 | diff --git a/src/lib/exceptions.js b/src/lib/exceptions.js
index <HASH>..<HASH> 100644
--- a/src/lib/exceptions.js
+++ b/src/lib/exceptions.js
@@ -43,6 +43,12 @@ module.exports = {
processWindowError: function (msg, file, line, col, error) {
var that = this
+
+ if(msg === "Script error." && !file) {
+ // ignoring script errors: See https://github.com/getsentry/raven-js/issues/41
+ return
+ }
+
var exception = {
'message': error ? error.message : msg,
'type': error ? error.name : '', | Ignore “script errors” for now. | opbeat_opbeat-react | train | js |
231fc06ca45ff999034920da16a93840526edd2a | diff --git a/scripts/rollup.js b/scripts/rollup.js
index <HASH>..<HASH> 100644
--- a/scripts/rollup.js
+++ b/scripts/rollup.js
@@ -28,6 +28,7 @@ gulp.task('rollup-code', '', function() {
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'@angular/material': 'ng.material',
+ '@angular/flex-layout': 'ng.flexLayout',
// Rxjs dependencies
'rxjs/Subject': 'Rx', | fix(rollup): add missing dep to options.globals (#<I>) | Teradata_covalent | train | js |
8ddf1f2567c87e377b5e91005cfdb16ca3d9bac8 | diff --git a/spec/lib/jobs/base-job-spec.js b/spec/lib/jobs/base-job-spec.js
index <HASH>..<HASH> 100644
--- a/spec/lib/jobs/base-job-spec.js
+++ b/spec/lib/jobs/base-job-spec.js
@@ -32,6 +32,8 @@ describe("Base Job", function () {
var logger = injector.get('Logger').initialize(MockJob);
MockJob.super_.call(this, logger, {}, {}, uuid.v4());
this.nodeId = "54c69f87c7100ec77bfde17c";
+ this.snmpRoutingKey = uuid.v4();
+ this.ipmiSdrRoutingKey = uuid.v4();
this.graphId = uuid.v4();
}; | Minor additions to mock base job values | RackHD_on-tasks | train | js |
26bf3096ea8f1ee8af2fe3fc727745fa17ae130e | diff --git a/exa/util/isotopes.py b/exa/util/isotopes.py
index <HASH>..<HASH> 100644
--- a/exa/util/isotopes.py
+++ b/exa/util/isotopes.py
@@ -34,7 +34,6 @@ Warning:
.. _NIST: https://www.nist.gov/
"""
-import bz2 as _bz2
import json as _json
import six as _six
import sys as _sys
@@ -168,10 +167,11 @@ def get(key):
isotopes.get(92)
isotopes.get("U")
+ isotopes.get("h") # Corrects lowercase
"""
if isinstance(key, _six.integer_types):
key = df.loc[df['Z'] == key, 'symbol'].values[0]
- return getattr(_this, key)
+ return getattr(_this, key.title())
# Data order of isotopic (nuclear) properties: | Added automatic titling for isotopes.get and removed unneeded import | exa-analytics_exa | train | py |
6d7d21d240f0337d663dc5670942ec6cf5579d56 | diff --git a/test/coordinator.js b/test/coordinator.js
index <HASH>..<HASH> 100644
--- a/test/coordinator.js
+++ b/test/coordinator.js
@@ -48,4 +48,8 @@ describe('Grasshopper core - coordinator', function(){
});
});
+
+ if('coordinator should be able to register multiple methods with a specified set of firmware and process them as a batch.', function(done){
+ true.should.equal(false);
+ });
}); | Added failing test for batching a coordinator. | grasshopper-cms_grasshopper-core-nodejs | train | js |
a36538da2e614a05dd789d6f78d6bbd71a55f748 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
-import sys
+import datetime
import os
-import shlex
+
+import rebin
extensions = [
'sphinx.ext.autodoc',
@@ -16,10 +17,20 @@ source_suffix = '.rst'
master_doc = 'index'
project = 'rebin'
-copyright = '2016, Sébastien Brisard'
author = 'Sébastien Brisard'
-version = '0.1'
-release = '0.1'
+
+initial_year = 2016
+today = datetime.date.today()
+current_year = today.year
+if current_year == initial_year:
+ copyright = '{}, {}. BSD-3 license.'.format(initial_year, author)
+else:
+ copyright = '2016-{}, {}. BSD-3 license.'.format(initial_year,
+ current_year,
+ author)
+
+version = rebin.__version__
+release = rebin.__version__
language = None | Sphinx docs: automated copyright & version. | sbrisard_rebin | train | py |
532420c81d4a9a595a2b987c01cbab692f202184 | diff --git a/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java b/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java
+++ b/structr-ui/src/main/java/org/structr/web/entity/dom/DOMNode.java
@@ -1012,7 +1012,12 @@ public abstract class DOMNode extends LinkedTreeNode implements Node, Renderable
value = value.replace(group, partValue);
} else {
- value = value.replace(group, "");
+
+ // If the whole expression should be replaced, and partValue is null
+ // replace it by null to make it possible for HTML attributes to not be rendered
+ // and avoid something like ... selected="" ... which is interpreted as selected==true by
+ // all browsers
+ value = value.equals(group) ? null : value.replace(group, "");
}
} | don't replace null values by an empty string | structr_structr | train | java |
9c42a5cf11c3be4a3ade0a3a7a64ac7790725165 | diff --git a/cocaine/proxy/proxy.py b/cocaine/proxy/proxy.py
index <HASH>..<HASH> 100644
--- a/cocaine/proxy/proxy.py
+++ b/cocaine/proxy/proxy.py
@@ -500,7 +500,7 @@ class CocaineProxy(object):
body_parts = []
attempts -= 1
try:
- request.logger.info("%s: enqueue event (attempt %d)", app.id, attempts)
+ request.logger.debug("%s: enqueue event (attempt %d)", app.id, attempts)
channel = yield app.enqueue(event, trace=trace)
request.logger.debug("%s: send event data (attempt %d)", app.id, attempts)
yield channel.tx.write(msgpack.packb(data), trace=trace)
@@ -535,7 +535,7 @@ class CocaineProxy(object):
# or reading a reply. And retry only writing fails.
request.logger.error("%s: %s", app.id, err)
if attempts <= 0:
- request.logger.info("%s: no more attempts", app.id)
+ request.logger.error("%s: no more attempts", app.id)
fill_response_in(request, httplib.INTERNAL_SERVER_ERROR,
httplib.responses[httplib.INTERNAL_SERVER_ERROR],
"UID %s: Connection problem" % request.traceid, proxy_error_headers()) | [Proxy] Fix some items loglevels | cocaine_cocaine-tools | train | py |
b192a16ea383361288b4993617f7369a5822900e | diff --git a/src/hooks/add-route-object.js b/src/hooks/add-route-object.js
index <HASH>..<HASH> 100644
--- a/src/hooks/add-route-object.js
+++ b/src/hooks/add-route-object.js
@@ -31,7 +31,10 @@ export default function addRouteObject (name, opts) {
if (!context.params[name]) {
try {
const service = context.app.service(options.service);
- const object = await service.get(primary, { query: { $select: opts.select }});
+ const object = await service.get(primary, {
+ query: { $select: opts.select },
+ user: context.params.user
+ });
if (!object) {
throw new Error(`Not found primary service object ${name} of ${primary}`);
} | Fix get route object with user for permission | MostlyJS_mostly-feathers-mongoose | train | js |
2064a7279af5f15e75b87d0858cc163176da5099 | diff --git a/lib/role_authorization/controller.rb b/lib/role_authorization/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/role_authorization/controller.rb
+++ b/lib/role_authorization/controller.rb
@@ -5,12 +5,13 @@ module RoleAuthorization
helper_method :authorized?
helper_method :accessible?
- if Rails::VERSION::MAJOR >= 5
+ if respond_to?(:before_action)
before_action :check_request_authorization
else
before_filter :check_request_authorization
end
end
+
base.send :extend, RoleAuthorization::Ruleset::ClassMethods
base.send :cattr_ruleset, :ruleset, :allowable_groups | updated the if statement with respond_to? | asceth_role_authorization | train | rb |
fc283a929aad0c156181e708af2fd9a0c13b711d | diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -120,11 +120,7 @@ class Configuration implements ConfigurationInterface
->defaultValue(['@EasyAdmin/form/bootstrap_4.html.twig'])
->treatNullLike(['@EasyAdmin/form/bootstrap_4.html.twig'])
->info('The form theme applied to backend forms. Allowed values: any valid form theme path or an array of theme paths.')
- ->validate()
- ->ifString()->then(function ($v) {
- return [$v];
- })
- ->end()
+ ->validate()->castToArray()->end()
->end()
->arrayNode('assets') | Minor simplification in DI config class | EasyCorp_EasyAdminBundle | train | php |
61ab096635c72bbaad274f6124e84bc1877a119f | diff --git a/lib/active_mock/base.rb b/lib/active_mock/base.rb
index <HASH>..<HASH> 100644
--- a/lib/active_mock/base.rb
+++ b/lib/active_mock/base.rb
@@ -150,7 +150,7 @@ class Base
end
def inspect
- ObjectInspect.new(self.class.name, attributes)
+ ObjectInspect.new(self.class.name, attributes).to_s
end
def hash
@@ -247,4 +247,4 @@ class Base
include MockAbilities
end
-end
\ No newline at end of file
+end | update inspect method on base.rb
Added .to_s on the inspect method so that RSpec would print return results for failing tests properly. | zeisler_active_mocker | train | rb |
ee916b77031616f95d79583e701fa4cc364c53e5 | diff --git a/wagtailvideos/models.py b/wagtailvideos/models.py
index <HASH>..<HASH> 100644
--- a/wagtailvideos/models.py
+++ b/wagtailvideos/models.py
@@ -227,10 +227,7 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model):
@classmethod
def get_transcode_model(cls):
- if django.VERSION >= (1, 9):
- return cls.transcodes.rel.related_model
- else:
- return cls.transcodes.related.related_model
+ return cls.transcodes.rel.related_model
def get_transcode(self, media_format):
Transcode = self.get_transcode_model()
diff --git a/wagtailvideos/views/chooser.py b/wagtailvideos/views/chooser.py
index <HASH>..<HASH> 100644
--- a/wagtailvideos/views/chooser.py
+++ b/wagtailvideos/views/chooser.py
@@ -118,12 +118,7 @@ def chooser_upload(request):
video.save()
# Reindex the video to make sure all tags are indexed
- from wagtail.wagtailcore import __version__
- if __version__.startswith("1.4"):
- for backend in get_search_backends():
- backend.add(video)
- else:
- search_index.insert_or_update_object(video)
+ search_index.insert_or_update_object(video)
return render_modal_workflow(
request, None, 'wagtailvideos/chooser/video_chosen.js', | Remove compatibility code for unsupported django, wagtail versions | neon-jungle_wagtailvideos | train | py,py |
f2e54dd247b81d8d57d54a9362feae8715d6c8d6 | diff --git a/controller/jobs.go b/controller/jobs.go
index <HASH>..<HASH> 100644
--- a/controller/jobs.go
+++ b/controller/jobs.go
@@ -248,9 +248,6 @@ func streamJobs(req *http.Request, w http.ResponseWriter, app *ct.App, repo *Job
w.(http.Flusher).Flush()
return nil
}
- if err = sendKeepAlive(); err != nil {
- return
- }
sendJobEvent := func(e *ct.JobEvent) error {
if _, err := fmt.Fprintf(w, "id: %d\nevent: %s\ndata: ", e.ID, e.State); err != nil {
@@ -305,6 +302,10 @@ func streamJobs(req *http.Request, w http.ResponseWriter, app *ct.App, repo *Job
case <-connected:
}
+ if err = sendKeepAlive(); err != nil {
+ return
+ }
+
closed := w.(http.CloseNotifier).CloseNotify()
for {
select { | controller: Don't sendKeepAlive until listening
This avoids a race where the client receives the response header,
assumes the controller is listening for events and triggers something. | flynn_flynn | train | go |
05a9f50490dd4fb8a8cdcebc8650e13cb90ee93d | diff --git a/regions/__init__.py b/regions/__init__.py
index <HASH>..<HASH> 100644
--- a/regions/__init__.py
+++ b/regions/__init__.py
@@ -22,3 +22,14 @@ if not _ASTROPY_SETUP_:
from .core import *
from .io import *
from .shapes import *
+else:
+ import sys
+ if 'test' in sys.argv:
+ try:
+ import pytest_arraydiff
+ except ImportError:
+ raise ImportError("The pytest-arraydiff package is required for the tests. "
+ "You can install it with: pip install pytest-arraydiff")
+ else:
+ # Just make sure the plugin import works to avoid obscure errors later
+ import pytest_arraydiff.plugin | Check that pytest-arraydiff is installed | astropy_regions | train | py |
f4584c8acf7d82ab291d5d41e3c2c11a08f58d04 | diff --git a/libraries/lithium/console/command/Library.php b/libraries/lithium/console/command/Library.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/console/command/Library.php
+++ b/libraries/lithium/console/command/Library.php
@@ -199,9 +199,7 @@ class Library extends \lithium\console\Command {
$archive = new Phar("{$path}.phar");
$from = $this->_toPath($from);
- $filter = '/^(?(?=\.)\.(htaccess|gitignore|gitmodules))|(.*)$/i';
- $filter = null;
- //$filter = '/.*\.(htaccess|gitignore|gitmodules)/i';
+ $filter = '/^(\.(htaccess|gitignore|gitmodules|.+?))$/i';
$result = (boolean) $archive->buildFromDirectory($from, $filter);
if (file_exists("{$path}.phar.gz")) { | Modifying console\command\Library::archive() phar archive filter regex. | UnionOfRAD_framework | train | php |
57870f5ab29888b20882b9c9a94c7c1c1a531558 | diff --git a/allennlp/training/trainer_pieces.py b/allennlp/training/trainer_pieces.py
index <HASH>..<HASH> 100644
--- a/allennlp/training/trainer_pieces.py
+++ b/allennlp/training/trainer_pieces.py
@@ -55,8 +55,7 @@ class TrainerPieces(NamedTuple):
vocab = Vocabulary.from_params(
params.pop("vocabulary", {}),
(instance for key, dataset in all_datasets.items()
- for instance in dataset
- if key in datasets_for_vocab_creation)
+ if key in datasets_for_vocab_creation for instance in dataset)
)
model = Model.from_params(vocab=vocab, params=params.pop('model')) | removing unnecessary data iteration (#<I>) | allenai_allennlp | train | py |
0951045f573bbe99ae75e15787583f095093a5b7 | diff --git a/tests/settings_base.py b/tests/settings_base.py
index <HASH>..<HASH> 100644
--- a/tests/settings_base.py
+++ b/tests/settings_base.py
@@ -14,7 +14,7 @@ INSTALLED_APPS = [
"versatileimagefield",
]
-MIDDLEWARE = (
+MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@@ -23,6 +23,8 @@ MIDDLEWARE = (
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
+MIDDLEWARE = MIDDLEWARE_CLASSES
+
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', | Added both MIDDLEWARE and MIDDLEWARE_CLASSES to settings
So older versions of Django will be able to properly run tests. | respondcreate_django-versatileimagefield | train | py |
5d18af78001101f29b722cff3de1f94f07d85e74 | diff --git a/remi/gui.py b/remi/gui.py
index <HASH>..<HASH> 100644
--- a/remi/gui.py
+++ b/remi/gui.py
@@ -1395,7 +1395,7 @@ class SvgPolyline(Widget):
if self.max_len > 0:
if len(self.coordsX) > self.max_len:
#we assume that if there is some chars, there is a space
- if(self.attributes['points']) > 1: #slower performaces if ' ' in self.attributes['points'] :
+ if len(self.attributes['points']) > 1: #slower performaces if ' ' in self.attributes['points'] :
self.attributes['points'] = self.attributes['points'][self.attributes['points'].find(' ')+1:]
self.coordsX = self.coordsX[len(self.coordsX)-self.max_len:]
self.coordsY = self.coordsY[len(self.coordsY)-self.max_len:] | SvgPolyline fixed mistake. | dddomodossola_remi | train | py |
c0f9f09b59316c01e00820b8f93e752c2e5f6fc9 | diff --git a/slither/detectors/reentrancy/reentrancy.py b/slither/detectors/reentrancy/reentrancy.py
index <HASH>..<HASH> 100644
--- a/slither/detectors/reentrancy/reentrancy.py
+++ b/slither/detectors/reentrancy/reentrancy.py
@@ -59,6 +59,8 @@ class Reentrancy(AbstractDetector):
# We can check that the function called is
# reentrancy-safe
if ir.destination == SolidityVariable('this'):
+ if isinstance(ir.function, Variable):
+ continue
if not ir.function.all_high_level_calls():
if not ir.function.all_low_level_calls():
continue | Fix missing support for this.variable() in reentrancy detector | crytic_slither | train | py |
0a28c4282e8f16205960d0eb6a1fef03b08b50a2 | diff --git a/src/ol/style/iconstyle.js b/src/ol/style/iconstyle.js
index <HASH>..<HASH> 100644
--- a/src/ol/style/iconstyle.js
+++ b/src/ol/style/iconstyle.js
@@ -426,7 +426,7 @@ ol.style.IconImage_ = function(image, src, size, crossOrigin, imageState) {
* @type {boolean}
*/
this.tainting_ = false;
-
+ if (this.imageState_ == ol.style.ImageState.LOADED)this.determineTainting_();
};
goog.inherits(ol.style.IconImage_, goog.events.EventTarget);
@@ -456,8 +456,8 @@ ol.style.IconImage_.get = function(image, src, size, crossOrigin, imageState) {
*/
ol.style.IconImage_.prototype.determineTainting_ = function() {
var context = ol.dom.createCanvasContext2D(1, 1);
- context.drawImage(this.image_, 0, 0);
try {
+ context.drawImage(this.image_, 0, 0);
context.getImageData(0, 0, 1, 1);
} catch (e) {
this.tainting_ = true; | Adding check to see if already loaded images taints the canvas | openlayers_openlayers | train | js |
b0abd2821b92dccebfdb04592c2a6bb2f6f91461 | diff --git a/lib/adminlib.php b/lib/adminlib.php
index <HASH>..<HASH> 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -1760,11 +1760,11 @@ class admin_setting_sitesettext extends admin_setting_configtext {
}
function validate($data) {
- $cleaned = clean_param($data, PARAM_NOTAGS);
+ $cleaned = stripslashes(clean_param($data, PARAM_MULTILANG));
if ($cleaned == '') {
return false; // can not be empty
}
- return ("$data" == "$cleaned"); // implicit conversion to string is needed to do exact comparison
+ return ($data == $cleaned); // implicit conversion to string is needed to do exact comparison
}
function write_setting($data) {
@@ -2434,7 +2434,7 @@ class admin_setting_special_gradebookroles extends admin_setting {
} else {
$return .= '<br />';
}
- $return .= '<input type="checkbox" name="s_'.$this->name.'['.$roleid.']" value="1"'.$checked.' /> '.$role->name;
+ $return .= '<input type="checkbox" name="s_'.$this->name.'['.$roleid.']" value="1"'.$checked.' /> '.format_string($role->name);
}
$return .= '</div>';
} | MDL-<I> Added multilang filter to roles in Admin->Appearance->Gradebook | moodle_moodle | train | php |
0aa09c605657698b5d562e18d0384241ef2ef99b | diff --git a/intranet/apps/signage/views.py b/intranet/apps/signage/views.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/signage/views.py
+++ b/intranet/apps/signage/views.py
@@ -112,6 +112,10 @@ def touch_signage(request, sign=None, landscape=False):
zoom = request.GET.get("zoom", 3)
if sign and sign.zoom:
zoom = sign.zoom
+
+ # Chromium has a weird bug where zoom level of 300% is the same as zoom level 100%
+ if zoom == 3:
+ zoom = '301%'
landscape = request.GET.get("landscape", landscape)
if sign and sign.landscape: | Add workaround for chromium browsers | tjcsl_ion | train | py |
1e99dd5aaad2091dba4673b9f85ec5ce910c484a | diff --git a/faker/providers/person/uk_UA/__init__.py b/faker/providers/person/uk_UA/__init__.py
index <HASH>..<HASH> 100644
--- a/faker/providers/person/uk_UA/__init__.py
+++ b/faker/providers/person/uk_UA/__init__.py
@@ -1,15 +1,24 @@
# coding=utf-8
from __future__ import unicode_literals
+
+from collections import OrderedDict
+
from .. import Provider as PersonProvider
class Provider(PersonProvider):
- formats = (
- '{{first_name_male}} {{last_name}}',
- '{{first_name_female}} {{last_name}}',
- '{{prefix_male}} {{first_name_male}} {{last_name}}',
- '{{prefix_female}} {{first_name_female}} {{last_name}}',
- )
+ formats_female = OrderedDict((
+ ('{{first_name_female}} {{last_name}}', 0.9),
+ ('{{prefix_female}} {{first_name_female}} {{last_name}}', 0.1),
+ ))
+
+ formats_male = OrderedDict((
+ ('{{first_name_male}} {{last_name}}', 0.9),
+ ('{{prefix_male}} {{first_name_male}} {{last_name}}', 0.1),
+ ))
+
+ formats = formats_female.copy()
+ formats.update(formats_male)
# Source: uk.wikipedia.org/wiki/Українські_імена
first_names_male = ( | Differentiate Ukrainian female and male names | joke2k_faker | train | py |
39c6986546a7c6e7c93bb9ec1f75b949abe1beb2 | diff --git a/ReadableStream.php b/ReadableStream.php
index <HASH>..<HASH> 100644
--- a/ReadableStream.php
+++ b/ReadableStream.php
@@ -6,7 +6,7 @@ use Evenement\EventEmitter;
class ReadableStream extends EventEmitter implements ReadableStreamInterface
{
- public $closed = false;
+ protected $closed = false;
public function isReadable()
{
diff --git a/WritableStream.php b/WritableStream.php
index <HASH>..<HASH> 100644
--- a/WritableStream.php
+++ b/WritableStream.php
@@ -6,7 +6,7 @@ use Evenement\EventEmitter;
class WritableStream extends EventEmitter implements WritableStreamInterface
{
- public $closed = false;
+ protected $closed = false;
public function write($data)
{ | Make ReadableStream::$closed and WritableStream::$closed protected | reactphp_stream | train | php,php |
9a2fbe0e9728db5fc16bc213dc0a66a9efe7d1d9 | diff --git a/lib/shortener/shorten_url_interceptor.rb b/lib/shortener/shorten_url_interceptor.rb
index <HASH>..<HASH> 100644
--- a/lib/shortener/shorten_url_interceptor.rb
+++ b/lib/shortener/shorten_url_interceptor.rb
@@ -17,7 +17,7 @@ Usage:
'cloudfront\.net/' ].map {|r| Regexp.new(r) }
DEFAULT_LENGTH_THRESHOLD = 20
- URL_REGEX = /\b((https?):\/\/\w+\.)[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[-A-Z0-9+&@#\/%=~_|$]/i
+ URL_REGEX = /\b((https?):\/\/[\w\.-]+[\.]\w+)([-A-Z0-9+&@#\/%?=~_|$!:,.;]*[-A-Z0-9+&@#\/%=~_|$])?/i
MIME_TYPES = %w(text/plain text/html application/xhtml+xml)
def initialize(opts = {}) | updated URL regex to match hosts with '-' characters
also preserved existing semantics of non-matching hosts (i.e.:
localhost, etc). | jpmcgrath_shortener | train | rb |
3790d3024fe3b1d47066add1426c91280136820b | diff --git a/atam4j/src/main/java/me/atam/atam4j/AcceptanceTestsRunnerTask.java b/atam4j/src/main/java/me/atam/atam4j/AcceptanceTestsRunnerTask.java
index <HASH>..<HASH> 100644
--- a/atam4j/src/main/java/me/atam/atam4j/AcceptanceTestsRunnerTask.java
+++ b/atam4j/src/main/java/me/atam/atam4j/AcceptanceTestsRunnerTask.java
@@ -29,9 +29,5 @@ public class AcceptanceTestsRunnerTask implements Runnable {
final Result result = jUnitCore.run(testClasses);
testsState.setResult(result);
-
- for (Failure failure: result.getFailures()) {
- LOGGER.error(failure.getDescription().toString(), failure.getException());
- }
}
} | removing redundant logging of test failures | atam4j_atam4j | train | java |
828d2ae8410b87a09fe216b6cda8a30066632c6f | diff --git a/ide/main/src/content/formats/webdriver.js b/ide/main/src/content/formats/webdriver.js
index <HASH>..<HASH> 100644
--- a/ide/main/src/content/formats/webdriver.js
+++ b/ide/main/src/content/formats/webdriver.js
@@ -544,6 +544,7 @@ SeleniumWebDriverAdaptor.prototype._elementLocator = function(sel1Locator) {
return locator;
}
if (locator.type == 'link') {
+ locator.string = locator.string.replace(/^exact:/, '');
return locator;
}
if (locator.type == 'name') { | Fixing 'link' locator formatting: WebDriver does not need 'exact:' label. Fixes issue <I> | SeleniumHQ_selenium | train | js |
0488c5209199211fcde610a20e7be851829a4371 | diff --git a/holoviews/core/operation.py b/holoviews/core/operation.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/operation.py
+++ b/holoviews/core/operation.py
@@ -107,7 +107,7 @@ class ElementOperation(Operation):
raise NotImplementedError
- def process_element(self, element, key=None, **params):
+ def process_element(self, element, key, **params):
"""
The process_element method allows a single element to be
operated on given an externally supplied key. | Reverted change to ElementOperation.process_element | pyviz_holoviews | train | py |
d40c2c8096d52f19252f70675344631df124e8c3 | diff --git a/lib/fog/linode/models/compute/server.rb b/lib/fog/linode/models/compute/server.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/linode/models/compute/server.rb
+++ b/lib/fog/linode/models/compute/server.rb
@@ -19,7 +19,7 @@ module Fog
end
def public_ip_address
- ips.find{|ip| ip.ip !~ /^192/}.ip
+ ips.find{|ip| ip.ip !~ /^192\.168\./}.ip
end
def disks | fix for linode using public ip blocks in <I>.* | fog_fog | train | rb |
fab5602cd3851c98f21413ed17f77ed304c49dfb | diff --git a/test/test_experiments.py b/test/test_experiments.py
index <HASH>..<HASH> 100644
--- a/test/test_experiments.py
+++ b/test/test_experiments.py
@@ -143,13 +143,13 @@ class ExperimentTests(unittest.TestCase):
self.assertTrue(res[Experiment.METADATA][Experiment.STATUS])
timing = res[Experiment.METADATA]
- print(timing)
+ #print(timing)
self.assertTrue(timing[Experiment.END_TIME] > timing[Experiment.START_TIME])
self.assertTrue(timing[Experiment.ELAPSED_TIME] > 0)
self.assertTrue(timing[Experiment.SETUP_TIME] > 0)
self.assertTrue(timing[Experiment.EXPERIMENT_TIME] > 0)
self.assertTrue(timing[Experiment.TEARDOWN_TIME] > 0)
- self.assertTrue(timing[Experiment.ELAPSED_TIME] >= timing[Experiment.SETUP_TIME] + timing[Experiment.TEARDOWN_TIME] + timing[Experiment.EXPERIMENT_TIME])
+ self.assertAlmostEqual(timing[Experiment.ELAPSED_TIME], timing[Experiment.SETUP_TIME] + timing[Experiment.TEARDOWN_TIME] + timing[Experiment.EXPERIMENT_TIME], places=3)
def testException( self ):
'''Test that exceptions are caught and reported in-line.''' | Foxed rounding error in timing comparisons | simoninireland_epyc | train | py |
1c1f784f7c35e28408d28e3f0a81947acf7a894a | diff --git a/lib/stats/DefaultStatsFactoryPlugin.js b/lib/stats/DefaultStatsFactoryPlugin.js
index <HASH>..<HASH> 100644
--- a/lib/stats/DefaultStatsFactoryPlugin.js
+++ b/lib/stats/DefaultStatsFactoryPlugin.js
@@ -509,6 +509,12 @@ const SIMPLE_EXTRACTORS = {
moduleName: reason.originModule
? reason.originModule.readableIdentifier(requestShortener)
: null,
+ resolvedModuleId: reason.resolvedOriginModule
+ ? chunkGraph.getModuleId(reason.resolvedOriginModule)
+ : null,
+ resolvedModuleIdentifier: reason.resolvedOriginModule
+ ? reason.resolvedOriginModule.identifier()
+ : null,
resolvedModule: reason.resolvedOriginModule
? reason.resolvedOriginModule.readableIdentifier(requestShortener)
: null, | Add resolveModuleId and resolvedModuleIdentifier to reason | webpack_webpack | train | js |
17e9e95a2ac3eff6784f318aea315484daa8a2c5 | diff --git a/spec/formotion_spec.rb b/spec/formotion_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/formotion_spec.rb
+++ b/spec/formotion_spec.rb
@@ -36,9 +36,9 @@ describe "formotion" do
end
it "binds data from rendered form into model fields" do
- @subject.from_formotion!({:name => '007 Reunion', :date => '3-3-13', :location => "Q's Lab"})
+ @subject.from_formotion!({:name => '007 Reunion', :date => 1358197323, :location => "Q's Lab"})
@subject.name.should == '007 Reunion'
- @subject.date.strftime("%Y-%d-%d %H:%M:%S").should == '2013-03-03 12:00:00'
+ @subject.date.strftime("%Y-%m-%d %H:%M").should == '2013-01-14 13:02'
@subject.location.should == "Q's Lab"
end | Changed to reflect that Formotion returns a number for date fields. | sxross_MotionModel | train | rb |
aa867c35e6da6d133107bed446420f59000bfe7f | diff --git a/rb/spec/integration/selenium/webdriver/target_locator_spec.rb b/rb/spec/integration/selenium/webdriver/target_locator_spec.rb
index <HASH>..<HASH> 100644
--- a/rb/spec/integration/selenium/webdriver/target_locator_spec.rb
+++ b/rb/spec/integration/selenium/webdriver/target_locator_spec.rb
@@ -93,7 +93,7 @@ describe "WebDriver::TargetLocator" do
driver.switch_to.active_element.should be_an_instance_of(WebDriver::Element)
end
- compliant_on :browser => :firefox do
+ compliant_on :browser => nil do
describe "alerts" do
it "allows the user to accept an alert" do
driver.navigate.to url_for("alerts.html") | JariBakken: Guard Ruby's alert specs, which keep hanging the Firefox builds.
r<I> | SeleniumHQ_selenium | train | rb |
23236df2c0e8f08f8a6bfcc33f0592c5e124e59a | diff --git a/markerclustererplus/src/markerclusterer.js b/markerclustererplus/src/markerclusterer.js
index <HASH>..<HASH> 100644
--- a/markerclustererplus/src/markerclusterer.js
+++ b/markerclustererplus/src/markerclusterer.js
@@ -1,6 +1,6 @@
/**
* @name MarkerClustererPlus for Google Maps V3
- * @version 2.1.7 [March 3, 2018]
+ * @version 2.1.8 [March 5, 2018]
* @author Gary Little
* @fileoverview
* The library creates and manages per-zoom-level clusters for large amounts of markers.
@@ -134,9 +134,10 @@ ClusterIcon.prototype.onAdd = function () {
});
// March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522
- google.maps.event.addDomListener(this.div_, "touchstart", function (e) {
- e.stopPropagation();
- });
+// But it doesn't work with earlier releases so back to the drawing board.
+// google.maps.event.addDomListener(this.div_, "touchstart", function (e) {
+// e.stopPropagation();
+// });
google.maps.event.addDomListener(this.div_, "click", function (e) {
cMouseDownInCluster = false; | Update markerclusterer.js
I've backed out the fix for issue #<I> because, although it works for <I>exp, it breaks on the stable release. | googlemaps_v3-utility-library | train | js |
c2ab9c143c01879c045ec86903bd7c80c2333582 | diff --git a/rollbar/__init__.py b/rollbar/__init__.py
index <HASH>..<HASH> 100644
--- a/rollbar/__init__.py
+++ b/rollbar/__init__.py
@@ -801,7 +801,8 @@ def _scrub_request_data(request_data):
"""
if request_data:
for field in ['POST', 'GET', 'headers']:
- request_data[field] = _scrub_obj(request_data[field])
+ if request_data.get(field):
+ request_data[field] = _scrub_obj(request_data[field])
if request_data.get('url'):
request_data['url'] = _scrub_request_url(request_data['url']) | Check if field exists before scrubbing it | rollbar_pyrollbar | train | py |
18492459f14f24af14a380a1f17bfdeccf002d11 | diff --git a/core/containers.py b/core/containers.py
index <HASH>..<HASH> 100644
--- a/core/containers.py
+++ b/core/containers.py
@@ -19,6 +19,17 @@ class FCSample(BaseSample):
a single well or a single tube.
'''
+ @property
+ def channels(self):
+ '''
+ TODO: get the channels from the metadata toavoid having to
+ load the data
+ '''
+ if self.data is not None:
+ return list(self.data.columns)
+ else:
+ return None
+
def read_data(self, **kwargs):
'''
Read the datafile specified in Sample.datafile and | added channels property to FCSample (TODO: get channels from metadata) | eyurtsev_FlowCytometryTools | train | py |
ba9dd5bcb3bea6cfdca47c04c2f0153ad5cfa148 | diff --git a/py/tests/unit/with_runtime_sparkling/test_gcs_import.py b/py/tests/unit/with_runtime_sparkling/test_gcs_import.py
index <HASH>..<HASH> 100644
--- a/py/tests/unit/with_runtime_sparkling/test_gcs_import.py
+++ b/py/tests/unit/with_runtime_sparkling/test_gcs_import.py
@@ -18,7 +18,8 @@
import h2o
def testImportFromGCS(hc):
- path = "gs://solutions-public-assets/time-series-master/GBPUSD_2014_01.csv"
- frame = h2o.import_file(path=path)
+ some_public_gcp_file = "gs://gcp-public-data-landsat" \
+ "/LC08/01/001/009/LC08_L1GT_001009_20210612_20210622_01_T2/LC08_L1GT_001009_20210612_20210622_01_T2_MTL.txt"
+ frame = h2o.import_file(path=some_public_gcp_file)
df = hc.asSparkFrame(frame)
- assert df.count() == 1280546
+ assert df.count() == 218 | [SW-<I>] change GCS import test file (#<I>) | h2oai_sparkling-water | train | py |
a22aed162c33a9bccd61568906133f8c605b1a04 | diff --git a/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/ComponentRegistry.java b/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/ComponentRegistry.java
index <HASH>..<HASH> 100644
--- a/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/ComponentRegistry.java
+++ b/simulator/src/main/java/com/hazelcast/simulator/protocol/registry/ComponentRegistry.java
@@ -46,7 +46,7 @@ public class ComponentRegistry {
public AgentData getFirstAgent() {
if (agents.size() == 0) {
- throw new CommandLineExitException("No agents registered!");
+ throw new CommandLineExitException("No agents running!");
}
return agents.get(0);
}
@@ -81,7 +81,7 @@ public class ComponentRegistry {
public WorkerData getFirstWorker() {
if (workers.size() == 0) {
- throw new CommandLineExitException("No workers registered!");
+ throw new CommandLineExitException("No workers running!");
}
return workers.get(0);
} | Improved error messages in ComponentRegistry. | hazelcast_hazelcast-simulator | train | java |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.