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
|
---|---|---|---|---|---|
5b6bd1f286bdf0ad2baa4751585c365c001d3bf9 | diff --git a/src/Nbobtc/Bitcoind/Client.php b/src/Nbobtc/Bitcoind/Client.php
index <HASH>..<HASH> 100644
--- a/src/Nbobtc/Bitcoind/Client.php
+++ b/src/Nbobtc/Bitcoind/Client.php
@@ -56,12 +56,17 @@ class Client implements ClientInterface
CURLOPT_POSTFIELDS => $json,
));
$response = curl_exec($ch);
+ $status = curl_getinfo($ch);
curl_close($ch);
if (false === $response) {
throw new \Exception('The server is not available.');
}
+ if ($status['http_code'] != 200) {
+ throw new \Exception('The server status code is '.$status['http_code'].'.');
+ }
+
$stdClass = json_decode($response);
if (!empty($stdClass->error)) { | handling http status codes and throwing exception when not <I> (OK) | nbobtc_bitcoind-php | train | php |
562d6b9de6a6f029f7f8580f89bca12460901361 | diff --git a/cfgrib/eccodes.py b/cfgrib/eccodes.py
index <HASH>..<HASH> 100644
--- a/cfgrib/eccodes.py
+++ b/cfgrib/eccodes.py
@@ -414,7 +414,7 @@ def codes_get_long_array(handle, key, size):
_codes_get_double_array = check_return(lib.codes_get_double_array)
-def codes_get_double_array(handle, key, size=None):
+def codes_get_double_array(handle, key, size):
# type: (cffi.FFI.CData, bytes, int) -> T.List[float]
"""
Get double array values from a key.
@@ -423,8 +423,6 @@ def codes_get_double_array(handle, key, size=None):
:rtype: T.List(float)
"""
- if size is None:
- size = codes_get_size(handle, key)
values = ffi.new('double[]', size)
size_p = ffi.new('size_t *', size)
_codes_get_double_array(handle, key, values, size_p) | Move size auto-detection on get_array out of low-level functions. | ecmwf_cfgrib | train | py |
2f3a77c4667ecd3a51ba7e61d1b4d65f82c65d27 | diff --git a/lib/celluloid/actor.rb b/lib/celluloid/actor.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/actor.rb
+++ b/lib/celluloid/actor.rb
@@ -347,7 +347,7 @@ module Celluloid
end
end
- tasks.to_a.each { |task| task.terminate }
+ tasks.to_a.each(&:terminate)
rescue => ex
# TODO: metadata
Logger.crash("CLEANUP CRASHED!", ex) | Use shorthand notation for each instead. | celluloid_celluloid | train | rb |
9976d594fd895034df3c9fad89ba420aa8af672d | diff --git a/test/adapter/socket.io.test.js b/test/adapter/socket.io.test.js
index <HASH>..<HASH> 100644
--- a/test/adapter/socket.io.test.js
+++ b/test/adapter/socket.io.test.js
@@ -106,9 +106,9 @@ suite('Socket.IO Adapter', function() {
utils.setupServer(application)
.next(function(newServer) {
server = newServer;
-
+ connection = utils.createStubbedBackendConnection();
var registeredCommands = socketIoAdapter.register(application, server, {
- connection: utils.createStubbedBackendConnection(),
+ connection: connection,
plugins: [
api.API_REST,
api.API_SOCKET_IO,
@@ -157,8 +157,9 @@ suite('Socket.IO Adapter', function() {
utils.setupServer(application)
.next(function(newServer) {
server = newServer;
+ connection = utils.createStubbedBackendConnection();
socketIoAdapter.register(application, server, {
- connection: utils.createStubbedBackendConnection(),
+ connection: connection,
plugins: [
api.API_REST,
api.API_SOCKET_IO, | Store used connection to the global variable "connection" correctly | droonga_express-droonga | train | js |
2e72eea00a01c421039984ccc245f3fb44c93f04 | diff --git a/client/driver/lxc.go b/client/driver/lxc.go
index <HASH>..<HASH> 100644
--- a/client/driver/lxc.go
+++ b/client/driver/lxc.go
@@ -253,7 +253,7 @@ func (d *LxcDriver) Start(ctx *ExecContext, task *structs.Task) (*StartResponse,
}
c.SetLogLevel(logLevel)
- logFile := filepath.Join(ctx.TaskDir.LogDir, fmt.Sprintf("%v-lxc.log", task.Name))
+ logFile := filepath.Join(ctx.TaskDir.Dir, fmt.Sprintf("%v-lxc.log", task.Name))
c.SetLogFile(logFile)
options := lxc.TemplateOptions{ | lxc: move lxc log file out of container-visible alloc dir
The LXC runtime's log file is currently written to TaskDir.LogDir,
which is mounted as alloc/logs inside the containers in the task
group.
This file is not intended to be visible to containers, and depending
on the log level, may have information about the host that a container
should not be allowed to see. | hashicorp_nomad | train | go |
9b0dad4def75750b87cff88f55c01a0dc82d5436 | diff --git a/modules/source-bookshelf/lib/process_filter.js b/modules/source-bookshelf/lib/process_filter.js
index <HASH>..<HASH> 100644
--- a/modules/source-bookshelf/lib/process_filter.js
+++ b/modules/source-bookshelf/lib/process_filter.js
@@ -1,14 +1,16 @@
const _ = require('lodash');
+const idFilter = function (qb, value) {
+ return qb.whereIn('id', value);
+};
+
module.exports = function (model, query, filterBy) {
var filters = model.filters;
return _.transform(filterBy, function (result, value, key) {
var filter = filters[key];
value = String(value).split(',');
if (key === 'id' && !filter) {
- filter = function (qb, value) {
- return qb.whereIn('id', value);
- };
+ filter = idFilter;
}
return filter ? filter.call(filters, result, value) : result;
}, query); | don't re-create id filter every time one is used | endpoints_endpoints | train | js |
c58139d2cfb66ab8bf78ad88211de80b383b7548 | diff --git a/app/controllers/backend/images_controller.rb b/app/controllers/backend/images_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/backend/images_controller.rb
+++ b/app/controllers/backend/images_controller.rb
@@ -1,6 +1,7 @@
class Backend::ImagesController < Backend::BaseController
before_action :find_model
before_action :init_image, only: [:index, :new, :create]
+ layout 'backend/lightbox'
def index
@search = Asset.ransack params[:q] | Use the lightbox layout for the image management. | udongo_udongo | train | rb |
9454c11c59ce430c87f9dff1cd2744881b22a369 | diff --git a/lib/compiler/passes/generate-js.js b/lib/compiler/passes/generate-js.js
index <HASH>..<HASH> 100644
--- a/lib/compiler/passes/generate-js.js
+++ b/lib/compiler/passes/generate-js.js
@@ -1268,10 +1268,10 @@ function generateJS(ast, options) {
},
umd: function() {
- var parts = [],
- dependencyIds = objects.values(options.dependencies),
- dependencyVars = objects.keys(options.dependencies),
- dependencies = '['
+ var parts = [],
+ dependencyIds = objects.values(options.dependencies),
+ dependencyVars = objects.keys(options.dependencies),
+ dependencies = '['
+ arrays.map(
dependencyIds,
function(id) { return '"' + js.stringEscape(id) + '"'; } | generate-js.js: Fix "=" alignment | pegjs_pegjs | train | js |
7d65b08728b52f3a6b90217e28e088a07715ffd1 | diff --git a/lib/chrome/tabs.js b/lib/chrome/tabs.js
index <HASH>..<HASH> 100644
--- a/lib/chrome/tabs.js
+++ b/lib/chrome/tabs.js
@@ -1,6 +1,7 @@
'use strict'
const utils = require('../utils')
+ , log = require('../log')
, config = require('../config')
, WebSocket = require('ws')
@@ -18,6 +19,11 @@ module.exports = function() {
return utils.request(config.chromeUrl + '/json/new?' + config.url)
}).then(tab => {
+ if (!tab.devtoolsFrontendUrl) {
+ log('Can\'t connect while chrome dev tools is open - Exiting')
+ return process.exit()
+ }
+
const devUrl = tab.devtoolsFrontendUrl.replace(':' + config.debugPort, ':' + config.debugProxyPort)
const devTab = tabs.find(t => t.url.includes(':' + config.debugProxyPort + '/devtools/page')) | Log and exit if chrome dev tools appears to be open | porsager_wright | train | js |
9fa2d522deb0b5c90429322488b60f342f012a23 | diff --git a/openquake/hazard/classical_psha.py b/openquake/hazard/classical_psha.py
index <HASH>..<HASH> 100644
--- a/openquake/hazard/classical_psha.py
+++ b/openquake/hazard/classical_psha.py
@@ -141,9 +141,9 @@ def compute_quantile_hazard_curves(job, sites):
LOG.debug("[QUANTILE_HAZARD_CURVES] List of quantiles is %s" % quantiles)
for site in sites:
- for quantile in quantiles:
- poes = poes_at(job.id, site, realizations)
+ poes = poes_at(job.id, site, realizations)
+ for quantile in quantiles:
quantile_poes = compute_quantile_curve(poes, quantile)
quantile_curve = {"site_lat": site.latitude, | Fetch curves for the site in the outer loop.
Former-commit-id: 6d<I>ada<I>abc<I>c<I>dcc1deb<I>d4b7dc2 | gem_oq-engine | train | py |
b1894e0d54c319bdf0f6290986cf0af060a183f6 | diff --git a/zipline/pipeline/mixins.py b/zipline/pipeline/mixins.py
index <HASH>..<HASH> 100644
--- a/zipline/pipeline/mixins.py
+++ b/zipline/pipeline/mixins.py
@@ -457,5 +457,6 @@ class DownsampledMixin(StandardOutputs):
return type(
'Downsampled' + other_base.__name__,
(cls, other_base,),
- {'__doc__': doc},
+ {'__doc__': doc,
+ '__module__': other_base.__module__},
) | BUG: Supply a module for Downsampled terms. | quantopian_zipline | train | py |
3ba7af30e7d8195957a98047f377547e4cb04cfa | diff --git a/jquery.fileupload.js b/jquery.fileupload.js
index <HASH>..<HASH> 100644
--- a/jquery.fileupload.js
+++ b/jquery.fileupload.js
@@ -1,5 +1,5 @@
/*
- * jQuery File Upload Plugin 3.8.1
+ * jQuery File Upload Plugin 3.8.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@@ -434,7 +434,7 @@
},
initFileInput = function () {
- fileInput = uploadForm.find('input:file')
+ fileInput = (uploadForm.length ? uploadForm : container).find('input:file')
.filter(settings.fileInputFilter);
}, | Update to find file input fields without a surrounding form. | blueimp_jQuery-File-Upload | train | js |
8b9ae45549150b9d25dc0576eaf08562cd52158c | diff --git a/tests/speech_to_text/test_modeling_tf_speech_to_text.py b/tests/speech_to_text/test_modeling_tf_speech_to_text.py
index <HASH>..<HASH> 100644
--- a/tests/speech_to_text/test_modeling_tf_speech_to_text.py
+++ b/tests/speech_to_text/test_modeling_tf_speech_to_text.py
@@ -90,6 +90,7 @@ class TFSpeech2TextModelTester:
eos_token_id=2,
pad_token_id=1,
bos_token_id=0,
+ scale_embedding=False,
):
self.parent = parent
self.batch_size = batch_size
@@ -115,6 +116,7 @@ class TFSpeech2TextModelTester:
self.eos_token_id = eos_token_id
self.pad_token_id = pad_token_id
self.bos_token_id = bos_token_id
+ self.scale_embedding = scale_embedding
def prepare_config_and_inputs(self):
input_features = floats_tensor(
@@ -155,6 +157,7 @@ class TFSpeech2TextModelTester:
eos_token_id=self.eos_token_id,
bos_token_id=self.bos_token_id,
pad_token_id=self.pad_token_id,
+ scale_embedding=self.scale_embedding,
)
def prepare_config_and_inputs_for_common(self): | Set scale_embedding to False in some TF tests (#<I>)
* set scale_embedding to False to avoid large (> 1e-5) output differences between PT/TF | huggingface_pytorch-pretrained-BERT | train | py |
8a3164877717ac6d1eb02863e9f679e5e89976cb | diff --git a/api/v1/models/c_n_i_chaining_status.go b/api/v1/models/c_n_i_chaining_status.go
index <HASH>..<HASH> 100644
--- a/api/v1/models/c_n_i_chaining_status.go
+++ b/api/v1/models/c_n_i_chaining_status.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-// Copyright 2017-2021 Authors of Cilium
+// Copyright 2017-2022 Authors of Cilium
// SPDX-License-Identifier: Apache-2.0
package models | api/v1: regenerate to update copyright year
PR #<I> updated the API with CNI chaining status and that PR was
created before PR #<I> bumping the copyright year. Regenerate the API
using `make generate-api generate-health-api generate-hubble-api
generate-operator-api generate-k8s-api` to get the correct copyright
year in the newly created file as well. | cilium_cilium | train | go |
ebd17c8831624fdcfff7e588a9cf37cf3d9aa71b | diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -62,7 +62,7 @@ app.use(passport.session())
app.use(BASE_URL, express.static(path.join(__dirname, 'public')))
if (DEBUG) app.use(morgan('dev'))
app.use(function (req, res, next) {
- // Boostrap res.locals with any common variables
+ // Bootstrap res.locals with any common variables
res.locals.message = null
res.locals.navbarConnections = []
res.locals.debug = null | fix typo (#<I>) | rickbergfalk_sqlpad | train | js |
c51c08e861ac0a81bf0ff46dddfd140ab45e9dcb | diff --git a/src/util/dom.js b/src/util/dom.js
index <HASH>..<HASH> 100644
--- a/src/util/dom.js
+++ b/src/util/dom.js
@@ -68,8 +68,8 @@ export function activeElt() {
} catch(e) {
activeElement = document.body || null
}
- while (activeElement && activeElement.root && activeElement.root.activeElement)
- activeElement = activeElement.root.activeElement
+ while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
+ activeElement = activeElement.shadowRoot.activeElement
return activeElement
} | Use .shadowRoot rather than .root to descend shadow dom
Closes #<I> | codemirror_CodeMirror | train | js |
b7f74ac9741be0c8ba7ee3bbe0f94ab956968818 | diff --git a/bugsnag-spring/src/main/java/com/bugsnag/ExceptionClassCallback.java b/bugsnag-spring/src/main/java/com/bugsnag/ExceptionClassCallback.java
index <HASH>..<HASH> 100644
--- a/bugsnag-spring/src/main/java/com/bugsnag/ExceptionClassCallback.java
+++ b/bugsnag-spring/src/main/java/com/bugsnag/ExceptionClassCallback.java
@@ -67,7 +67,7 @@ class ExceptionClassCallback implements Callback {
report.setSeverity(severity);
report.setHandledState(HandledState.newInstance(
SeverityReasonType.REASON_EXCEPTION_CLASS,
- Collections.singletonMap("exceptionClass", exceptionClass.getName()),
+ Collections.singletonMap("exceptionClass", exceptionClass.getSimpleName()),
severity,
handledState.isUnhandled()));
} | Excluding package from exceptionClass | bugsnag_bugsnag-java | train | java |
3f041762b7516cdf37ee62ab4bf6778c6c6355b4 | diff --git a/src/Console/Router/Router.php b/src/Console/Router/Router.php
index <HASH>..<HASH> 100644
--- a/src/Console/Router/Router.php
+++ b/src/Console/Router/Router.php
@@ -54,7 +54,7 @@ class Router
$options = $this->argumentParser->parse($arguments, $flags, $params);
if ($this->commands[$command]['extra'] !== null) {
- $options[$this->commands[$command]['extra']] = $arguments[1];
+ $options[$this->commands[$command]['extra']] = $arguments[1] ?? null;
}
return [$this->handlers[$command], $options]; | Make named parameter not required by the router, commands should handle validation | phOnion_console | train | php |
168858208f726abb6bd64f6d5cbe9efb90b38092 | diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -45,7 +45,7 @@ class Configuration implements ConfigurationInterface
->children()
->arrayNode('globals')
->useAttributeAsKey('key')
- ->example(array('foo' => '"@bar"', 'pi' => 3.14))
+ ->example(array('foo' => '"@bar"', 'pi' => 3.14))
->prototype('array')
->beforeNormalization()
->ifTrue(function ($v) { return is_string($v) && 0 === strpos($v, '@'); }) | Remove trailing whitespace at the end of non-blank lines | bobthecow_BobthecowMustacheBundle | train | php |
9478a09104e807d838e7206d11af38f9d35c2f54 | diff --git a/lib/HiPay/Fullservice/Gateway/Request/Order/HostedPaymentPageRequest.php b/lib/HiPay/Fullservice/Gateway/Request/Order/HostedPaymentPageRequest.php
index <HASH>..<HASH> 100644
--- a/lib/HiPay/Fullservice/Gateway/Request/Order/HostedPaymentPageRequest.php
+++ b/lib/HiPay/Fullservice/Gateway/Request/Order/HostedPaymentPageRequest.php
@@ -69,4 +69,19 @@ class HostedPaymentPageRequest extends OrderRequest
*
*/
public $time_limit_to_pay;
-}
\ No newline at end of file
+
+ /**
+ * Indicates the tokenization module whether the payment card token
+ * should be generated either for a single-use or a multi-use. Possible values:
+ *
+ * 1: Generates a multi-use token
+ * 0: Generates a single-use token While a single-use token is typically generated for a short time and for
+ * processing a single transaction, multi-use tokens are generally generated for recurrent payments.
+ *
+ * @var int $multi_use
+ * @length 1
+ * @type options
+ * @values 0|Generate a single-use token,1|Generate a multi-use token
+ */
+ public $multi_use;
+} | Add multi_use field for Hpayment | hipay_hipay-fullservice-sdk-php | train | php |
76042dd72b2c3e4ee43343ca23aa17a5ed0a99f5 | diff --git a/lib/octokit/client/refs.rb b/lib/octokit/client/refs.rb
index <HASH>..<HASH> 100644
--- a/lib/octokit/client/refs.rb
+++ b/lib/octokit/client/refs.rb
@@ -46,6 +46,7 @@ module Octokit
}
post("repos/#{Repository.new(repo)}/git/refs", options.merge(parameters))
end
+ alias :create_reference :create_ref
# Update a reference
#
@@ -64,6 +65,7 @@ module Octokit
}
patch("repos/#{Repository.new(repo)}/git/refs/#{ref}", options.merge(parameters))
end
+ alias :update_reference :update_ref
# Delete a single reference
#
@@ -76,6 +78,7 @@ module Octokit
def delete_ref(repo, ref, options={})
delete("/repos/#{Repository.new(repo)}/git/refs/#{ref}", options, 3, true, true)
end
+ alias :delete_reference :delete_ref
end
end | add alias for create, update and delete | octokit_octokit.rb | train | rb |
1593639bbf73e27b106feb8e7eb0605300a34893 | diff --git a/lib/routes.js b/lib/routes.js
index <HASH>..<HASH> 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -34,6 +34,10 @@ module.exports = async function (srcDir, { conf, log, app }) {
res.status(200).send('pong')
})
+ app.get('/_env', (req, res) => {
+ res.status(200).send(conf.env)
+ })
+
app.get('/_version', (req, res) => {
res.status(200).send(conf.version)
})
@@ -88,6 +92,11 @@ module.exports = async function (srcDir, { conf, log, app }) {
// Create route handle for the exported routes
moduleRoutes = moduleRoutes.filter((r, index) => {
+ // Check if env is the same as NODE_ENV
+ r.env = (Array.isArray(r.env) ? r.env : (!r.env ? ['*'] : [r.env]))
+ if (!r.env.includes('*') && !r.env.includes(conf.env)) {
+ return false
+ }
// Validate required params
if (!r.path) {
log.error(`Module [${name}]: Route with index [${index}] must have a \`path\` defined`) | minor: Add env property in routes | mono-js_mono | train | js |
8d646b4be1e38e1cfc0f73c92a1fdfd6d60ff373 | diff --git a/cmd/commands/dockerize/dockerize.go b/cmd/commands/dockerize/dockerize.go
index <HASH>..<HASH> 100644
--- a/cmd/commands/dockerize/dockerize.go
+++ b/cmd/commands/dockerize/dockerize.go
@@ -44,8 +44,7 @@ ENTRYPOINT $APP_DIR/{{.Entrypoint}}
ADD . $APP_DIR
# Compile the binary and statically link
-RUN cd $APP_DIR
-RUN CGO_ENABLED=0 godep go build -ldflags '-d -w -s'
+RUN cd $APP_DIR && CGO_ENABLED=0 godep go build -ldflags '-d -w -s'
EXPOSE {{.Expose}}
` | fix docker build error by dockerBuildTemplate | beego_bee | train | go |
edd2c8a7fd632cb350b2519f97656c32d2e12af8 | diff --git a/lib/xmpp.js b/lib/xmpp.js
index <HASH>..<HASH> 100644
--- a/lib/xmpp.js
+++ b/lib/xmpp.js
@@ -7,7 +7,7 @@
var tcp = require("tcp");
// External libs
-var xml = require("./node-xml/lib/node-xml");
+var xml = require("node-xml");
var sha1 = require("./sha1");
// This lib | XMPP uses NPM library, not a local one | mwild1_xmppjs | train | js |
d3ba9562a0b7f94b0e0f32a5b28dfca7d61ef3b9 | diff --git a/src/prefs.py b/src/prefs.py
index <HASH>..<HASH> 100644
--- a/src/prefs.py
+++ b/src/prefs.py
@@ -664,10 +664,18 @@ class PrefsDialog(SimpleGladeApp):
dest_screen = screen.get_primary_monitor()
self.client.set_int(KEY('/general/display_n'), dest_screen)
- for i in combo.get_model():
- i_int = int(i[0].split()[0]) # extracts 1 from '1' or from '1 (primary)'
- if i_int == dest_screen:
- combo.set_active_iter(i.iter)
+ if dest_screen == -1:
+ first_item = combo.get_model().get_iter_first()
+ combo.set_active_iter(first_item)
+ else:
+ seen_first = False # first item "always on primary" is special
+ for i in combo.get_model():
+ if seen_first:
+ i_int = int(i[0].split()[0]) # extracts 1 from '1' or from '1 (primary)'
+ if i_int == dest_screen:
+ combo.set_active_iter(i.iter)
+ else:
+ seen_first = True
# use display where the mouse is currently
value = self.client.get_bool(KEY('/general/mouse_display')) | select dest_screen or "always on primary" option | Guake_guake | train | py |
85489563707ac8a0550fb15a00bae45d180c58fe | diff --git a/patroni/version.py b/patroni/version.py
index <HASH>..<HASH> 100644
--- a/patroni/version.py
+++ b/patroni/version.py
@@ -1 +1 @@
-__version__ = '0.90'
+__version__ = '1.0' | Bumped version to <I> | zalando_patroni | train | py |
53db21d53e856936daebf59b30653cd557144698 | diff --git a/scripts/after_prepare.js b/scripts/after_prepare.js
index <HASH>..<HASH> 100755
--- a/scripts/after_prepare.js
+++ b/scripts/after_prepare.js
@@ -48,7 +48,8 @@ var PLATFORM = {
src: [
'google-services.json',
ANDROID_DIR + '/assets/www/google-services.json',
- 'www/google-services.json'
+ 'www/google-services.json',
+ ANDROID_DIR + '/app/src/main/google-services.json'
],
stringsXml: fileExists(ANDROID_DIR + '/app/src/main/res/values/strings.xml') ? ANDROID_DIR + '/app/src/main/res/values/strings.xml' : ANDROID_DIR + '/res/values/strings.xml'
}
@@ -118,4 +119,4 @@ module.exports = function (context) {
console.log('Preparing Firebase on Android');
copyKey(PLATFORM.ANDROID);
}
-};
\ No newline at end of file
+}; | fix android tests running on cordova v7 | arnesson_cordova-plugin-firebase | train | js |
5257ea7f4469bf7f50c86bcfbf8bf13390495177 | diff --git a/railties/guides/rails_guides/textile_extensions.rb b/railties/guides/rails_guides/textile_extensions.rb
index <HASH>..<HASH> 100644
--- a/railties/guides/rails_guides/textile_extensions.rb
+++ b/railties/guides/rails_guides/textile_extensions.rb
@@ -31,10 +31,10 @@ module RailsGuides
end
def code(body)
- body.gsub!(/\<(yaml|shell|ruby|erb|html|sql)\>(.*?)\<\/\1\>/m) do |m|
+ body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql)>(.*?)</\1>}m) do |m|
es = ERB::Util.h($2)
css_class = ['erb', 'shell'].include?($1) ? 'html' : $1
- %{<notextile><div class="code_container"><code class="#{css_class}">#{es}\n</code></div></notextile>}
+ %{<notextile><div class="code_container"><code class="#{css_class}">#{es}</code></div></notextile>}
end
end
end | in textile extensions, simplify regexp literal, and remove spurious extra newline in code blocks | rails_rails | train | rb |
1201e080bb3d38d10c74c80f772a1cd3277673fa | diff --git a/lib/ae_page_objects/core/application.rb b/lib/ae_page_objects/core/application.rb
index <HASH>..<HASH> 100644
--- a/lib/ae_page_objects/core/application.rb
+++ b/lib/ae_page_objects/core/application.rb
@@ -5,7 +5,7 @@ module AePageObjects
class << self
private :new
- delegate :initialize!, :to => :instance
+ delegate :initialize!, :router=, :to => :instance
def inherited(application_class)
super
@@ -31,6 +31,8 @@ module AePageObjects
end
end
+ attr_writer :router
+
delegate :universe, :to => 'self.class'
delegate :path_recognizes_url?, :to => :router | allow router to be configured at the class level | appfolio_ae_page_objects | train | rb |
2844c7ddcda3b9d40fa42f72b69a658be41aa58b | diff --git a/modules/browser.js b/modules/browser.js
index <HASH>..<HASH> 100644
--- a/modules/browser.js
+++ b/modules/browser.js
@@ -9,7 +9,7 @@ let noop = () => {}
/**
* Browser detection
*/
-let isBrowser = typeof window !== undefined
+let isBrowser = typeof window !== 'undefined'
/**
* Browser functions needed by router5 | refactor: fix issue with detecting client/server | router5_router5 | train | js |
420477b455bf84fc627d7a2d8ab5a69a9d54718d | diff --git a/src/Element.js b/src/Element.js
index <HASH>..<HASH> 100644
--- a/src/Element.js
+++ b/src/Element.js
@@ -46,7 +46,13 @@ OO.ui.Element = function OoUiElement( config ) {
// Initialization
doc = OO.ui.Element.static.getDocument( this.$element );
if ( Array.isArray( config.classes ) ) {
- this.$element.addClass( config.classes );
+ this.$element.addClass(
+ // Remove empty strings to work around jQuery bug
+ // https://github.com/jquery/jquery/issues/4998
+ config.classes.filter( function ( val ) {
+ return val;
+ } )
+ );
}
if ( config.id ) {
this.setElementId( config.id ); | Element: Work around jQuery bug with empty strings in `addClass()`
Bug: T<I>
Change-Id: I<I>c<I>f2c<I>c<I>f<I>ee7feffdc2e6e<I>da<I>a | wikimedia_oojs-ui | train | js |
6ebda87d3fdf9d27cf51011e200ec19e994fc5e2 | diff --git a/test/ext/promise/_array.js b/test/ext/promise/_array.js
index <HASH>..<HASH> 100644
--- a/test/ext/promise/_array.js
+++ b/test/ext/promise/_array.js
@@ -30,7 +30,9 @@ module.exports = function (t) {
Error: function (a) {
t("reduce", require("../../../ext/array/reduce"));
deferred([])
- .reduce(function () {})(a.never, function (err) {
+ .reduce(function () {
+ return null;
+ })(a.never, function (err) {
a(isError(err), true, "Error");
})
.done(); | refactor: lint | medikoo_deferred | train | js |
5f421f65004471886836d4deede47dc1ccb46fc4 | diff --git a/src/Compiler/FakeRun.php b/src/Compiler/FakeRun.php
index <HASH>..<HASH> 100644
--- a/src/Compiler/FakeRun.php
+++ b/src/Compiler/FakeRun.php
@@ -47,6 +47,8 @@ class FakeRun
$_SERVER['HTTP_IF_NONE_MATCH'] = '0';
$_SERVER['REQUEST_URI'] = '/';
$_SERVER['REQUEST_METHOD'] = 'GET';
+ $_SERVER['argc'] = 3;
+ $_SERVER['argv'] = ['', 'get', 'page:://self/'];
/** @psalm-suppress MixedArgumentTypeCoercion */
($bootstrap)($this->appMeta->name, $this->context, $GLOBALS, $_SERVER); // @phpstan-ignore-line
$_SERVER['REQUEST_METHOD'] = 'DELETE'; | Give fake console options to run phpunit with no options | bearsunday_BEAR.Package | train | php |
aad67ef3d33bb8f729f82d84689f4ac3a6cd9c83 | diff --git a/lib/cli/init.js b/lib/cli/init.js
index <HASH>..<HASH> 100644
--- a/lib/cli/init.js
+++ b/lib/cli/init.js
@@ -33,7 +33,7 @@ module.exports = function(args){
file.mkdir(target + '/source/_posts', next);
},
function(next){
- file.mkdir(target + '/source/_stash', next);
+ file.mkdir(target + '/source/_drafts', next);
}
], next);
}); | _stash -> _drafts | hexojs_hexo | train | js |
dc088df41c99bd026cc33afa6d7f8ed07895c6d7 | diff --git a/python/ccxt/async_support/binance.py b/python/ccxt/async_support/binance.py
index <HASH>..<HASH> 100644
--- a/python/ccxt/async_support/binance.py
+++ b/python/ccxt/async_support/binance.py
@@ -636,7 +636,7 @@ class binance(Exchange):
'-1125': AuthenticationError, # This listenKey does not exist.
'-1127': BadRequest, # More than %s hours between startTime and endTime.
'-1128': BadRequest, # {"code":-1128,"msg":"Combination of optional parameters invalid."}
- '-1130': BadRequest, # Data sent for paramter %s is not valid.
+ '-1130': BadRequest, # Data sent for parameter %s is not valid.
'-1131': BadRequest, # recvWindow must be less than 60000
'-2010': ExchangeError, # generic error code for createOrder -> 'Account has insufficient balance for requested action.', {"code":-2010,"msg":"Rest API trading is not enabled."}, etc...
'-2011': OrderNotFound, # cancelOrder(1, 'BTC/USDT') -> 'UNKNOWN_ORDER' | Fixed Typo
"Parameter" was misspelled as "paramter". | ccxt_ccxt | train | py |
4c84108982228f7559f3d76d32caf3d2e502e2e9 | diff --git a/trunk/MutabilityDetector/test/org/mutabilitydetector/CheckSomeClass.java b/trunk/MutabilityDetector/test/org/mutabilitydetector/CheckSomeClass.java
index <HASH>..<HASH> 100644
--- a/trunk/MutabilityDetector/test/org/mutabilitydetector/CheckSomeClass.java
+++ b/trunk/MutabilityDetector/test/org/mutabilitydetector/CheckSomeClass.java
@@ -26,7 +26,7 @@ public class CheckSomeClass {
private static void checkClass(Class<?> toAnalyse) {
ClassPath cp = new ClassPathFactory().createFromJVM();
String match = toAnalyse.getName().replace("$", "\\$");
- CommandLineOptions options = new CommandLineOptions("-verbose", "-match", match);
+ CommandLineOptions options = new CommandLineOptions(System.err, "-verbose", "-match", match);
new RunMutabilityDetector(cp, options).run();
} | Pass in a print stream to the CommandLineOptions class so that output can be suppressed during tests.
git-svn-id: <URL> | MutabilityDetector_MutabilityDetector | train | java |
0c1ea6fbd2fdfe6f351ecf2f84f2467c6c1c94cc | diff --git a/magic/__init__.py b/magic/__init__.py
index <HASH>..<HASH> 100644
--- a/magic/__init__.py
+++ b/magic/__init__.py
@@ -36,7 +36,7 @@ class Magic(object):
def __enter__(self):
return self
- def __exit__(self):
+ def __exit__(self, type, value, traceback):
del self
@property | Add additional arguments to __exit__ method | dveselov_python-libmagic | train | py |
b243e574d2ee8c990bfa79b05b102e0e5f77aa6a | diff --git a/pydarksky/darksky.py b/pydarksky/darksky.py
index <HASH>..<HASH> 100644
--- a/pydarksky/darksky.py
+++ b/pydarksky/darksky.py
@@ -283,7 +283,7 @@ class DarkSky(object):
log.debug(url)
- self._response = requests.get(url, headers={"Accept-Encoding": "gzip"})
+ self._response = requests.get(url, headers={"Accept-Encoding": "gzip"}, timeout=5)
self._response.raise_for_status()
self._weather = Weather(self._response.text) | Added up 5 second timeout to API call | PvtHaggard_pydarksky | train | py |
af41c8e28c0d40898c6a50d6f2d4becc29c9fdf9 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -28,7 +28,7 @@ return array(
'name' => 'taoQtiItem',
'label' => 'QTI item model',
'license' => 'GPL-2.0',
- 'version' => '10.0.2',
+ 'version' => '10.0.3',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoItems' => '>=4.2.4',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -439,6 +439,6 @@ class Updater extends \common_ext_ExtensionUpdater
$this->setVersion('10.0.0');
}
- $this->skip('10.0.0', '10.0.2');
+ $this->skip('10.0.0', '10.0.3');
}
} | Bump to version <I> | oat-sa_extension-tao-itemqti | train | php,php |
d24fa54eb6197e797d8fd5ab33651e8379690f69 | diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -13640,6 +13640,10 @@
* @return array Active & public sites collection.
*/
static function get_sites() {
+ if ( ! is_multisite() ) {
+ return array();
+ }
+
/**
* For consistency with get_blog_list() which only return active public sites.
* | [ms] `get_sites()` should try to get the sites only when actually in a multisite environment. | Freemius_wordpress-sdk | train | php |
f528d78ad1710b2a465c0214e074eb63a14f5464 | diff --git a/lltk/images/google.py b/lltk/images/google.py
index <HASH>..<HASH> 100644
--- a/lltk/images/google.py
+++ b/lltk/images/google.py
@@ -6,7 +6,7 @@ import json
from lltk.helpers import debug
-def google(language, word, n = 20, *args, **kwargs):
+def google(language, word, n = 8, *args, **kwargs):
''' Downloads suitable images for a given word from Google Images. '''
if not kwargs.has_key('start'):
@@ -31,7 +31,7 @@ def google(language, word, n = 20, *args, **kwargs):
items = data['responseData']['results']
if items:
images += [item['url'] for item in items]
- if len(images) < n:
+ if len(images) < int(n):
kwargs['start'] += 8
images += google(language, word, n, *args, **kwargs)
- return images[:n]
+ return images[:int(n)] | Minor changes to images/google.py | lltk_lltk | train | py |
d1f50a4cbe54d15a07608b20ed2fc05e8960bc1d | diff --git a/lib/active_text/attachment.rb b/lib/active_text/attachment.rb
index <HASH>..<HASH> 100644
--- a/lib/active_text/attachment.rb
+++ b/lib/active_text/attachment.rb
@@ -74,11 +74,7 @@ module ActiveText
end
def to_html
- if attachable.respond_to?(:to_partial_path)
- ApplicationController.render(self)
- else
- HtmlConversion.node_to_html(node)
- end
+ HtmlConversion.node_to_html(node)
end
def to_s
diff --git a/lib/active_text/content.rb b/lib/active_text/content.rb
index <HASH>..<HASH> 100644
--- a/lib/active_text/content.rb
+++ b/lib/active_text/content.rb
@@ -46,7 +46,11 @@ module ActiveText
end
def to_html
- render_attachments(&:to_html).to_html
+ render_attachments do |attachment|
+ attachment.node.tap do |node|
+ node.inner_html = ApplicationController.render(attachment)
+ end
+ end.to_html
end
def to_s | Preserve the outer attachment element and fix editing | rails_rails | train | rb,rb |
de58ceaa3acf65c2ed67195a1dc39699c0ce34ed | diff --git a/lib/gas/ssh.rb b/lib/gas/ssh.rb
index <HASH>..<HASH> 100644
--- a/lib/gas/ssh.rb
+++ b/lib/gas/ssh.rb
@@ -641,11 +641,13 @@ module Gas
#
# returns "a", "l", "g", or "n"
def self.user_wants_to_delete_all_ssh_data?
- puts "Would you like to remove all ssh keys too!?! (github account keys can be removed as well!)"
+ puts "Would you like to remove all of this user's ssh keys too!?!"
+ puts "(github account keys can be removed as well!)"
+ puts
puts "a: All, the local copy, and checks github too."
- puts "l: Remove local keys only."
- puts "g: Removes keys from github.com only."
- puts "n: Don't remove this users keys."
+ puts "l: Remove local key only."
+ puts "g: Removes key from github.com only."
+ puts "n: Don't remove this user's keys."
puts "Default: l"
while true | changed typo for gas remove user confirmation text. | walle_gas | train | rb |
524da2213ccd249095c7f0ad164d4c56d7bc400d | diff --git a/internal/handshake/qtls.go b/internal/handshake/qtls.go
index <HASH>..<HASH> 100644
--- a/internal/handshake/qtls.go
+++ b/internal/handshake/qtls.go
@@ -91,7 +91,7 @@ func tlsConfigToQtlsConfig(
if cert == nil {
return nil, nil
}
- return (*qtls.Certificate)(unsafe.Pointer(cert)), nil
+ return (*qtls.Certificate)(cert), nil
}
}
var csc qtls.ClientSessionCache
@@ -205,7 +205,7 @@ func toTLSClientHelloInfo(chi *qtls.ClientHelloInfo) *tls.ClientHelloInfo {
qtlsCHI := (*qtlsClientHelloInfo)(unsafe.Pointer(chi))
var config *tls.Config
if qtlsCHI.config != nil {
- config = qtlsConfigToTLSConfig((*qtls.Config)(unsafe.Pointer(qtlsCHI.config)))
+ config = qtlsConfigToTLSConfig(qtlsCHI.config)
}
return (*tls.ClientHelloInfo)(unsafe.Pointer(&clientHelloInfo{
CipherSuites: chi.CipherSuites, | remove redundant qtls-related type conversions | lucas-clemente_quic-go | train | go |
af8a50124f7c5963ce2db2f339624269040b71f8 | diff --git a/examples/ping.rb b/examples/ping.rb
index <HASH>..<HASH> 100644
--- a/examples/ping.rb
+++ b/examples/ping.rb
@@ -4,6 +4,13 @@ require 'discordrb'
# This statement creates a bot with the specified token and application ID. After this line, you can add events to the
# created bot, and eventually run it.
+#
+# If you don't yet have a token and application ID to put in here, you will need to create a bot account here:
+# https://discordapp.com/developers/applications/me
+# (If you're wondering about what redirect URIs and RPC origins, you can ignore those for now.)
+# TODO: Add information describing those
+# After creating the bot, simply copy the token (*not* the OAuth2 secret) and the client ID and put it into the
+# respective places.
bot = Discordrb::Bot.new token: 'B0T.T0KEN.here', application_id: 160123456789876543
# Here we output the invite URL to the console so the bot account can be invited to the channel. This only has to be | Add a note about creating a bot account | meew0_discordrb | train | rb |
2cbbf1fe7d93c21516321fd0ce0731e1d6ef1277 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -23,7 +23,7 @@ module.exports = (rootDir, config = "faucet.js", // eslint-disable-next-line ind
}
let plugin = load(PLUGINS[type]);
- plugin(cfg, { rootDir, configDir }, { watcher, fingerprint, compact });
+ plugin(cfg, configDir, { watcher, fingerprint, compact });
});
}; | simplified plugin API
not only did this turn out to be unnecessary, but plugins should not be
encouraged to use anything other than the config location as reference | faucet-pipeline_faucet-pipeline-core | train | js |
793e198c514a96af55ac894aca37029421f23f17 | diff --git a/src/RoutableInspector.php b/src/RoutableInspector.php
index <HASH>..<HASH> 100644
--- a/src/RoutableInspector.php
+++ b/src/RoutableInspector.php
@@ -23,9 +23,9 @@ class RoutableInspector
'actionIndexGet' => 'index',
'actionCreateGet' => 'create',
'actionCreatePost' => 'create',
- 'actionDeleteDelete' => 'delete/{num}',
- 'actionUpdateGet' => 'update/{num}',
- 'actionUpdatePost' => 'update/{num}',
+ 'actionDeleteDelete' => 'delete/{str}',
+ 'actionUpdateGet' => 'update/{str}',
+ 'actionUpdatePost' => 'update/{str}',
];
/** | Changing "{num}" wildcard to "{str}" | phplegends_routes | train | php |
1fbf04766f5f1e51a9227d2ab6aca2569ed0acfc | diff --git a/packages/nitro-webpack/webpack-config/webpack.config.dev.js b/packages/nitro-webpack/webpack-config/webpack.config.dev.js
index <HASH>..<HASH> 100644
--- a/packages/nitro-webpack/webpack-config/webpack.config.dev.js
+++ b/packages/nitro-webpack/webpack-config/webpack.config.dev.js
@@ -16,6 +16,7 @@ const includePath = path.join(appDirectory, 'src');
module.exports = (options = { rules: {}, features: {} }) => {
const webpackConfig = {
+ mode: 'development',
devtool: 'eval-source-map',
context: appDirectory,
entry: {
diff --git a/packages/nitro-webpack/webpack-config/webpack.config.prod.js b/packages/nitro-webpack/webpack-config/webpack.config.prod.js
index <HASH>..<HASH> 100644
--- a/packages/nitro-webpack/webpack-config/webpack.config.prod.js
+++ b/packages/nitro-webpack/webpack-config/webpack.config.prod.js
@@ -37,6 +37,7 @@ module.exports = (options = { rules: {}, features: {} }) => {
}
const webpackConfig = {
+ mode: 'production',
devtool: 'source-map',
context: appDirectory,
entry: { | chore(webpack): add webpack mode | namics_generator-nitro | train | js,js |
680f0459a3a4fe59b215d26c2de03f963c2c29ee | diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -150,10 +150,6 @@ module ActionView
# here a named route directly as well. Defaults to the current action.
# * <tt>:html</tt> - Optional HTML attributes for the form tag.
#
- # Worth noting is that the +form_for+ tag is called in a ERb evaluation
- # block, not an ERb output block. So that's <tt><% %></tt>, not
- # <tt><%= %></tt>.
- #
# Also note that +form_for+ doesn't create an exclusive scope. It's still
# possible to use both the stand-alone FormHelper methods and methods
# from FormTagHelper. For example: | doc: form_for does return output rather than merely evaluate its block | rails_rails | train | rb |
24e603c377e8276dd79e202668b14bb6f5cff94f | diff --git a/speech/setup.py b/speech/setup.py
index <HASH>..<HASH> 100644
--- a/speech/setup.py
+++ b/speech/setup.py
@@ -57,7 +57,7 @@ REQUIREMENTS = [
setup(
name='google-cloud-speech',
- version='0.25.0',
+ version='0.25.1',
description='Python Client for Google Cloud Speech',
long_description=README,
namespace_packages=[ | Bump Speech to <I> (#<I>) | googleapis_google-cloud-python | train | py |
ba688f2316e3ef118ce7ddc5c6e4cb79146b3a57 | diff --git a/codenerix/management/commands/touch.py b/codenerix/management/commands/touch.py
index <HASH>..<HASH> 100644
--- a/codenerix/management/commands/touch.py
+++ b/codenerix/management/commands/touch.py
@@ -113,7 +113,9 @@ class Command(BaseCommand, Debugger):
# Ask the user if would really like to remove all locale folders
self.debug("Hit a ENTER when ready to go or Q to exit (ENTER|q) ",tail=False, color="purple")
try:
- key=input().lower()
+ key = raw_input().lower()
+ except NameError:
+ key = input().lower()
except KeyboardInterrupt:
self.debug(" ",header=False)
key='q' | Compatibility between python2 and python3 | codenerix_django-codenerix | train | py |
cfa7d42c39bd58cf7eddbedf86adf16c6a9a3159 | diff --git a/examples/helloRPC/rbserver.rb b/examples/helloRPC/rbserver.rb
index <HASH>..<HASH> 100644
--- a/examples/helloRPC/rbserver.rb
+++ b/examples/helloRPC/rbserver.rb
@@ -4,7 +4,7 @@ require 'hello'
Hello = ::Quark::Hello
-class HelloImpl
+class HelloImpl < Hello::Hello
def hello(request)
res = Hello::Response.new | Ruby: New type assertions require subclassing interfaces | datawire_quark | train | rb |
5f5c155a0b824c2710f2e8ffaa552c95f12958ff | diff --git a/src/BaseController.php b/src/BaseController.php
index <HASH>..<HASH> 100644
--- a/src/BaseController.php
+++ b/src/BaseController.php
@@ -1142,6 +1142,21 @@ abstract class BaseController extends Controller
public function failedResponse(Request $request): JsonResponse
{
$response = new ResponseModel();
+ $response->setStatus(false);
+ $this->setResponseData($request, $response);
+ $response->setMessage($this->getTrans(
+ $request->get($this->functionNameResponseTag),
+ 'failed'
+ ));
+ return SmartResponse::response($response);
+ }
+
+ /**
+ * @param Request $request
+ * @param $response
+ */
+ public function setResponseData(Request $request, $response)
+ {
if (!is_null($request->get($this->dataResponseTag))) {
$data = $request->get($this->dataResponseTag);
if (method_exists($data, 'getCode')) {
@@ -1155,11 +1170,5 @@ abstract class BaseController extends Controller
)));
}
};
- $response->setMessage($this->getTrans(
- $request->get($this->functionNameResponseTag),
- 'failed'
- ));
- return SmartResponse::response($response);
}
-
}
\ No newline at end of file | set status false when it's failed | Alive2212_LaravelSmartRestful | train | php |
17eeeaf40a8e065ced699f03bcf4a982fb39fb7c | diff --git a/src/sap.m/src/sap/m/MessageBox.js b/src/sap.m/src/sap/m/MessageBox.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/MessageBox.js
+++ b/src/sap.m/src/sap/m/MessageBox.js
@@ -303,7 +303,8 @@ sap.ui.define(['jquery.sap.global', './Button', './Dialog', './Text', 'sap/ui/co
var oTextArea = new sap.m.TextArea({
editable: false,
- visible: false
+ visible: false,
+ rows: 3
}).setValue(mOptions.details);
var oLink = new sap.m.Link({ | [INTERNAL][FIX] sap.m.MessageBox: The TextArea that shows after the click on Show Details has now 3 rows
Change-Id: Iffbdebfc7d4d<I>c<I>f<I>e4ed0dce<I>fa<I>f<I> | SAP_openui5 | train | js |
6a7b606a60cddd7fd4087ad18d7af82cf6595491 | diff --git a/lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb b/lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb
index <HASH>..<HASH> 100644
--- a/lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb
+++ b/lib/punchblock/translator/asterisk/component/asterisk/ami_action.rb
@@ -7,7 +7,7 @@ module Punchblock
attr_reader :action
def initialize(component_node, translator)
- super
+ super component_node, nil
@translator = translator
end | [BUGFIX] AMIAction components do not have a call | adhearsion_punchblock | train | rb |
f6d20444b3e91c2e12773e5dafb4bf68dfc12876 | diff --git a/pypeerassets/card_parsers.py b/pypeerassets/card_parsers.py
index <HASH>..<HASH> 100644
--- a/pypeerassets/card_parsers.py
+++ b/pypeerassets/card_parsers.py
@@ -43,3 +43,13 @@ def unflushable_parser(cards):
'''parser for UNFLUSHABLE [16] issue mode'''
return [i for i in cards if i.type == "CardIssue"]
+
+
+parsers = {
+ 'NONE': none_parser,
+ 'CUSTOM': none_parser,
+ 'ONCE': once_parser,
+ 'MULTI': multi_parser,
+ 'MONO': mono_parser,
+ 'UNFLUSHABLE': unflushable_parser
+} | add dict with all parsers mapped against issue mode name | PeerAssets_pypeerassets | train | py |
59ccd9621d977c106ee09202dfcac929a13e7e00 | diff --git a/src/taxi/__init__.py b/src/taxi/__init__.py
index <HASH>..<HASH> 100755
--- a/src/taxi/__init__.py
+++ b/src/taxi/__init__.py
@@ -33,8 +33,10 @@ def start(options, args):
raise Exception('Error: the project \'%s\' doesn\'t exist' %\
project_name)
- if not os.path.exists(options.file):
+ if not os.path.exists(os.path.dirname(options.file)):
os.makedirs(os.path.dirname(options.file))
+
+ if not os.path.exists(options.file):
myfile = open(options.file, 'w')
myfile.close() | Fixed bug with the start command when the zebra file does not exist yet | liip_taxi | train | py |
ea6665a6c8f428532c4833a7a9621a2c6d1644f3 | diff --git a/lxd/instance/drivers/qmp/monitor.go b/lxd/instance/drivers/qmp/monitor.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/drivers/qmp/monitor.go
+++ b/lxd/instance/drivers/qmp/monitor.go
@@ -171,16 +171,17 @@ func (m *Monitor) Wait() (chan struct{}, error) {
// Disconnect forces a disconnection from QEMU.
func (m *Monitor) Disconnect() {
+ monitorsLock.Lock()
+ defer monitorsLock.Unlock()
+
// Stop all go routines and disconnect from socket.
if !m.disconnected {
close(m.chDisconnect)
+ m.disconnected = true
+ m.qmp.Disconnect()
}
- m.disconnected = true
- m.qmp.Disconnect()
// Remove from the map.
- monitorsLock.Lock()
- defer monitorsLock.Unlock()
delete(monitors, m.path)
} | lxd/instance/drivers/qmp: Fix race in Disconnect
Can end up calling close() on the chDisconnect channel multiple times if called concurrently.
Fixes #<I> | lxc_lxd | train | go |
36bb7c6023db6c712183e87b23bb7be4c4317a76 | diff --git a/concrete/blocks/top_navigation_bar/controller.php b/concrete/blocks/top_navigation_bar/controller.php
index <HASH>..<HASH> 100644
--- a/concrete/blocks/top_navigation_bar/controller.php
+++ b/concrete/blocks/top_navigation_bar/controller.php
@@ -131,8 +131,9 @@ class Controller extends BlockController implements UsesFeatureInterface, FileTr
protected function getNavigation(): Navigation
{
- $al = Section::getBySectionOfSite(Page::getCurrentPage());
- $home = \Page::getByID($al->getSiteHomePageID());
+ $section = Section::getByLocale(\Localization::getInstance()->getLocale());
+
+ $home = \Page::getByID($section->getSiteHomePageID());
$children = $home->getCollectionChildren();
$navigation = new Navigation(); | more reliable loading of the site tree
instances such as /page_not_found would error out with the previously
proposed solution. | concrete5_concrete5 | train | php |
f41ecbc7acb1a946bf0cee5067844c2b873b44f5 | diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/ClassicPluginStrategy.java
+++ b/core/src/main/java/hudson/ClassicPluginStrategy.java
@@ -239,8 +239,8 @@ public class ClassicPluginStrategy implements PluginStrategy {
new DetachedPlugin("maven-plugin","1.296","1.296"),
new DetachedPlugin("subversion","1.310","1.0"),
new DetachedPlugin("cvs","1.340","0.1"),
- new DetachedPlugin("ant","1.431","1.0"),
- new DetachedPlugin("javadoc","1.431","1.0")
+ new DetachedPlugin("ant","1.430.*","1.0"),
+ new DetachedPlugin("javadoc","1.430.*","1.0")
);
/** | if the plugin is built with <I>-SNAPSHOT core, we don't want that to automatically pick up ant & javadoc. We only want that for plugins built against <I> or earlier. | jenkinsci_jenkins | train | java |
073e9e37e4930f53031cdcf8d11b6701eb57538c | diff --git a/RestFB/source/library/com/restfb/Parameter.java b/RestFB/source/library/com/restfb/Parameter.java
index <HASH>..<HASH> 100644
--- a/RestFB/source/library/com/restfb/Parameter.java
+++ b/RestFB/source/library/com/restfb/Parameter.java
@@ -121,7 +121,7 @@ public final class Parameter {
*/
public static Parameter with(String name, Object value, JsonMapper jsonMapper)
throws FacebookJsonMappingException {
- return Parameter.with(name, value, jsonMapper);
+ return new Parameter(name, value, jsonMapper);
}
/** | Fix for dumb end-of-day-checkin stack overflow (issue <I>, reported by Alex Launi). | restfb_restfb | train | java |
079205893a47e07e0613cce884920f52880ffd01 | diff --git a/test/convenience-commit.js b/test/convenience-commit.js
index <HASH>..<HASH> 100644
--- a/test/convenience-commit.js
+++ b/test/convenience-commit.js
@@ -1,6 +1,6 @@
-var git = require('../');
-var rimraf = require('rimraf');
-var fs = require( 'fs' );
+var git = require('../'),
+ rimraf = require('rimraf'),
+ fs = require( 'fs' );
// Helper functions
var helper = {
@@ -49,8 +49,6 @@ var historyCountKnownSHA = 'fce88902e66c72b5b93e75bdb5ae717038b221f6';
/**
* Test that retreiving walking a given commit's history works as expected.
- *
- * @param {Object} test
*/
exports.history = function(test) {
test.expect(368);
@@ -66,7 +64,6 @@ exports.history = function(test) {
test.equals(null, error, 'There should be no errors');
test.equals(historyCount, expectedHistoryCount, 'Manual count does not match expected');
test.equals(commits.length, expectedHistoryCount, '"end" count does not match expected');
-
test.done();
});
}); | Tidied convenience-commit.js test | nodegit_nodegit | train | js |
34729f5c336a69c26a97cb5b400e12ab883fc779 | diff --git a/lxd/main_checkfeature.go b/lxd/main_checkfeature.go
index <HASH>..<HASH> 100644
--- a/lxd/main_checkfeature.go
+++ b/lxd/main_checkfeature.go
@@ -146,7 +146,7 @@ void is_netnsid_aware(int *hostnetns_fd, int *newnetns_fd)
static void is_uevent_aware(void)
{
- if (can_inject_uevent("dummy", 6) < 0)
+ if (can_inject_uevent("placeholder", 6) < 0)
return;
uevent_aware = true; | lxd/main/checkfeature: Remove dummy term | lxc_lxd | train | go |
87652214da182f2cb822e15b08854be60d0c561f | diff --git a/pyqrcode/builder.py b/pyqrcode/builder.py
index <HASH>..<HASH> 100644
--- a/pyqrcode/builder.py
+++ b/pyqrcode/builder.py
@@ -147,13 +147,14 @@ class QRCodeBuilder:
#Now perform the algorithm that will make the ascii into bit fields
with io.StringIO() as buf:
for (a,b) in self.grouper(2, ascii):
- if b:
+ if b is not None:
buf.write(self.binary_string((45*a)+b, 11))
else:
#This occurs when there is an odd number
#of characters in the data
buf.write(self.binary_string(a, 6))
-
+
+ #Return the binary string
return buf.getvalue()
def encode_numeric(self):
diff --git a/pyqrcode/testpyqrcode.py b/pyqrcode/testpyqrcode.py
index <HASH>..<HASH> 100755
--- a/pyqrcode/testpyqrcode.py
+++ b/pyqrcode/testpyqrcode.py
@@ -8,10 +8,10 @@ import os, sys
code_dir = './qrtests'
scale = 4
-data = 'HELLO WORLD'
+data = 'CSCI 0'
error='H'
version=None
-mode=None
+mode='alphanumeric'
if not os.path.exists(code_dir): | Fixed bug where zero was not always encoded in alphanumeric. | mnooner256_pyqrcode | train | py,py |
beb684d28699dc2832d8ec494404fa9968f0c9b6 | diff --git a/lib/readdir.js b/lib/readdir.js
index <HASH>..<HASH> 100644
--- a/lib/readdir.js
+++ b/lib/readdir.js
@@ -10,7 +10,7 @@ var invoke = require('es5-ext/function/invoke')
, forEach = require('es5-ext/object/for-each')
, isCallable = require('es5-ext/object/is-callable')
, isCopy = require('es5-ext/object/is-copy')
- , toUint = require('es5-ext/number/to-uint')
+ , toPosInt = require('es5-ext/number/to-pos-integer')
, startsWith = require('es5-ext/string/#/starts-with')
, deferred = require('deferred')
, fs = require('fs')
@@ -533,7 +533,7 @@ readdir = function (path, options) {
readdir = new Readdir();
readdir.path = path;
- readdir.depth = isNaN(options.depth) ? 0 : toUint(options.depth);
+ readdir.depth = isNaN(options.depth) ? 0 : toPosInt(options.depth);
readdir.type = (options.type != null) ? Object(options.type) : null;
readdir.pattern = (options.pattern != null) ?
new RegExp(options.pattern) : null; | Update up to changes in es5-ext | medikoo_fs2 | train | js |
547c14b0c1d58ff2ba5e252ee2e6c98ec8bc5e12 | diff --git a/build/build-docs.js b/build/build-docs.js
index <HASH>..<HASH> 100644
--- a/build/build-docs.js
+++ b/build/build-docs.js
@@ -534,13 +534,13 @@ function getComponentInfo(one, lang, docs, name) {
if (one.events) {
// slot title
docs += `\n<span class="vux-props-title">Events</span>\n`
- docs += `\n| ${t('名字')} | ${t('参数')} | ${t('说明')} |
-|-------|-------|-------|
+ docs += `\n| ${t('名字')} | ${t('参数')} | ${t('说明')} | ${t('版本')} |
+|-------|-------|-------|-------|
`
for (let i in one.events) {
let intro = one.events[i][lang]
let params = one.events[i]['params']
- docs += `| ${getKeyHTML(i)} | ${params || ' '} | ${intro} |\n`
+ docs += `| ${getKeyHTML(i)} | ${params || ' '} | ${intro} | ${getVersion(one.events[i].version)} |\n`
}
} | docs: add version for events | airyland_vux | train | js |
803f51f028eb8bd90c86f0225652ee81c9f81246 | diff --git a/examples/stan-bench.go b/examples/stan-bench.go
index <HASH>..<HASH> 100644
--- a/examples/stan-bench.go
+++ b/examples/stan-bench.go
@@ -73,10 +73,9 @@ func main() {
// Run Subscribers first
startwg.Add(*numSubs)
- subCounts := bench.MsgsPerClient(*numMsgs, *numSubs)
for i := 0; i < *numSubs; i++ {
subID := fmt.Sprintf("%s-sub-%d", *clientID, i)
- go runSubscriber(&startwg, &donewg, opts, subCounts[i], *messageSize, *ignoreOld, subID)
+ go runSubscriber(&startwg, &donewg, opts, *numMsgs, *messageSize, *ignoreOld, subID)
}
startwg.Wait() | Made the number of messages the subscribers get the full number of messages that are published. | nats-io_go-nats-streaming | train | go |
aaf0705ce90aa7c59680ef3f5ce57a362ede4086 | diff --git a/bootstrap_py/pypi.py b/bootstrap_py/pypi.py
index <HASH>..<HASH> 100644
--- a/bootstrap_py/pypi.py
+++ b/bootstrap_py/pypi.py
@@ -30,4 +30,4 @@ def package_existent(name):
Timeout,
ConnectionError,
HTTPError) as exc:
- raise BackendFailure(exc)
+ raise BackendFailure(exc) from exc | Fixes raise-missing-from violation. | mkouhei_bootstrap-py | train | py |
17d6dc467304cecfd47d245136bc984b0198b562 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100644
--- a/devices.js
+++ b/devices.js
@@ -10404,7 +10404,7 @@ const devices = [
exposes: [e.cover_position(), e.temperature(), e.battery(), e.pressure()],
},
{
- zigbeeModel: ['SV02-410-MP-1.3', 'SV02-610-MP-1.3'],
+ zigbeeModel: ['SV02-410-MP-1.3', 'SV02-610-MP-1.3', 'SV02-410-MP-1.0'],
model: 'SV02',
vendor: 'Keen Home',
description: 'Smart vent', | Adding Keen Home SV<I> version (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
b795dee99adb7283630ab6bdf2efa723155a2499 | diff --git a/lib/gamejs.js b/lib/gamejs.js
index <HASH>..<HASH> 100644
--- a/lib/gamejs.js
+++ b/lib/gamejs.js
@@ -210,6 +210,22 @@ objects.accessors(Rect.prototype, {
this.top = args.top - (this.height / 2);
return;
}
+ },
+ /**
+ * Top-left Position. You can assign a rectangle form.
+ * @name Rect.prototype.topleft
+ * @type Array
+ */
+ 'topleft': {
+ get: function() {
+ return [this.left, this.top];
+ },
+ set: function() {
+ var args = normalizeRectArguments.apply(this, arguments);
+ this.left = args.left;
+ this.top = args.top;
+ return;
+ }
}
}); | Added 'topleft' accessor to Rect class. | GameJs_gamejs | train | js |
2ff1b64052ccd0a9e113f36fd3468b974cef3d3a | diff --git a/bundles/LayoutsBundle/Gruntfile.js b/bundles/LayoutsBundle/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/bundles/LayoutsBundle/Gruntfile.js
+++ b/bundles/LayoutsBundle/Gruntfile.js
@@ -130,11 +130,17 @@ module.exports = function (grunt) {
grunt.registerTask('server', function () {
grunt.task.run([
+ 'fast_build',
+ 'watch',
+ ]);
+ });
+
+ grunt.registerTask('fast_build', function () {
+ grunt.task.run([
'lockfile',
'sass:dist',
'postcss:dist',
'browserify:dist',
- 'watch',
]);
}); | Add fast_build option to Grunt for LayoutsBundle | netgen-layouts_layouts-core | train | js |
ccdc13ab4d3a8172d6abb7c27cc76d07b5742798 | diff --git a/plenum/server/consensus/ordering_service.py b/plenum/server/consensus/ordering_service.py
index <HASH>..<HASH> 100644
--- a/plenum/server/consensus/ordering_service.py
+++ b/plenum/server/consensus/ordering_service.py
@@ -2307,9 +2307,6 @@ class OrderingService:
if result != PROCESS:
return result, reason
- if sender != self._data.primary_name:
- return DISCARD, "OldViewPrePrepareReply from non-primary"
-
for pp_dict in msg.preprepares:
try:
pp = PrePrepare(**pp_dict) | INDY-<I>: Remove incorrect check from ordering service | hyperledger_indy-plenum | train | py |
3879ea76975ba3b5ca1c4d51a010368865ea887c | diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/instrumentation/field/FieldDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/instrumentation/field/FieldDescription.java
index <HASH>..<HASH> 100644
--- a/byte-buddy-dep/src/main/java/net/bytebuddy/instrumentation/field/FieldDescription.java
+++ b/byte-buddy-dep/src/main/java/net/bytebuddy/instrumentation/field/FieldDescription.java
@@ -183,6 +183,11 @@ public interface FieldDescription extends ModifierReviewable, ByteCodeElement, D
}
@Override
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
+ return false;
+ }
+
+ @Override
public Annotation[] getDeclaredAnnotations() {
return new Annotation[0];
} | Added method that is not defined as a default method in Java versions before Java 8. | raphw_byte-buddy | train | java |
9b4e67f22902a2877cc9e12c1ab06b373d3cc6e6 | diff --git a/resources/lang/pt-PT/cachet.php b/resources/lang/pt-PT/cachet.php
index <HASH>..<HASH> 100644
--- a/resources/lang/pt-PT/cachet.php
+++ b/resources/lang/pt-PT/cachet.php
@@ -81,6 +81,7 @@ return [
'manage' => [
'no_subscriptions' => 'Actualmente está subscrito para todas as actualizações.',
'my_subscriptions' => 'Actualmente está subscrito para as seguintes actualizações.',
+ 'manage_at_link' => 'Manage your subscriptions at :link',
],
'email' => [
'subscribe' => 'Subscrever actualizações via email.', | New translations cachet.php (Portuguese) | CachetHQ_Cachet | train | php |
210e7df06e4cd9fd635c0fc3fa3cea34e0d0408b | diff --git a/samples/ReadWriteFileServer.py b/samples/ReadWriteFileServer.py
index <HASH>..<HASH> 100755
--- a/samples/ReadWriteFileServer.py
+++ b/samples/ReadWriteFileServer.py
@@ -24,6 +24,11 @@ from bacpypes.basetypes import ServicesSupported
_debug = 0
_log = ModuleLogger(globals())
+# configuration
+RECORD_LEN = 128
+RECORD_COUNT = 100
+OCTET_COUNT = 4096
+
#
# Local Record Access File Object Type
#
@@ -44,8 +49,8 @@ class LocalRecordAccessFileObject(FileObject):
self._record_data = [
''.join(random.choice(string.ascii_letters)
- for i in range(random.randint(10, 20)))
- for j in range(random.randint(10, 20))
+ for i in range(RECORD_LEN))
+ for j in range(RECORD_COUNT)
]
if _debug: LocalRecordAccessFileObject._debug(" - %d records",
len(self._record_data),
@@ -110,7 +115,7 @@ class LocalStreamAccessFileObject(FileObject):
)
self._file_data = ''.join(random.choice(string.ascii_letters)
- for i in range(random.randint(100, 200)))
+ for i in range(OCTET_COUNT))
if _debug: LocalRecordAccessFileObject._debug(" - %d octets",
len(self._file_data),
) | adjstable record length, number of records, and stream size | JoelBender_bacpypes | train | py |
6af6fdbce2f5d375200218a0a019e0901144a92f | diff --git a/adapters/index.js b/adapters/index.js
index <HASH>..<HASH> 100644
--- a/adapters/index.js
+++ b/adapters/index.js
@@ -9,8 +9,8 @@
// would expect to work to work.
-// var loader = require('../loader');
-// var databases = { mongoose: require('./mongoose') };
+var loader = require('../loader');
+var databases = { mongoose: require('./mongoose') };
-// module.exports.load = loader('mongoose', databases);
-module.exports.mongoose = require('./mongoose');
+module.exports.load = loader('mongoose', databases);
+module.exports.mongoose = databases.mongoose; | Allowing arbitrary databases to be loaded also. | ballantyne_node-paperclip | train | js |
4c40a463da8394eada19f66dea817f441f70d0fd | diff --git a/subliminal/services/addic7ed.py b/subliminal/services/addic7ed.py
index <HASH>..<HASH> 100644
--- a/subliminal/services/addic7ed.py
+++ b/subliminal/services/addic7ed.py
@@ -17,12 +17,14 @@
# along with subliminal. If not, see <http://www.gnu.org/licenses/>.
from . import ServiceBase
from ..cache import cachedmethod
+from ..exceptions import DownloadFailedError
from ..language import Language, language_set
from ..subtitles import get_subtitle_path, ResultSubtitle
from ..utils import get_keywords
from ..videos import Episode
from bs4 import BeautifulSoup
import logging
+import os
import re
@@ -150,5 +152,13 @@ class Addic7ed(ServiceBase):
subtitles.append(subtitle)
return subtitles
+ def download(self, subtitle):
+ super(Addic7ed, self).download(subtitle)
+ with open(subtitle.path, 'r') as f:
+ soup = BeautifulSoup(f, self.required_features)
+ if soup.title is not None and soup.title.text.strip() == u'Addic7ed.com - Sorry, download limit exceeded':
+ os.remove(subtitle.path)
+ raise DownloadFailedError('Download limit exceeded')
+
Service = Addic7ed | Add an integrity check after subtitles download for Addic7ed | Diaoul_subliminal | train | py |
4cdec7bac4a823aab6497ebe787de03f376187d8 | diff --git a/autofit/tools/promise.py b/autofit/tools/promise.py
index <HASH>..<HASH> 100644
--- a/autofit/tools/promise.py
+++ b/autofit/tools/promise.py
@@ -8,6 +8,7 @@ class Promise:
self.phase = phase
self.path = path
self.is_constant = is_constant
+ phase.variable.object_for_path(path)
def __getattr__(self, item):
return Promise(
diff --git a/test/tools/test_phase.py b/test/tools/test_phase.py
index <HASH>..<HASH> 100644
--- a/test/tools/test_phase.py
+++ b/test/tools/test_phase.py
@@ -26,3 +26,10 @@ class TestCase:
assert promise.path == ("one", "redshift")
assert promise.is_constant is True
assert promise.phase is phase
+
+ def test_non_existent(self, phase):
+ with pytest.raises(AttributeError):
+ assert phase.result.variable.one.bad
+
+ with pytest.raises(AttributeError):
+ assert phase.result.constant.one.bad | use object for path to assert promised object exists | rhayes777_PyAutoFit | train | py,py |
28f7133a9c936925a70ec7d0bbd89e7193e98253 | diff --git a/pkg/endpoint/log.go b/pkg/endpoint/log.go
index <HASH>..<HASH> 100644
--- a/pkg/endpoint/log.go
+++ b/pkg/endpoint/log.go
@@ -60,7 +60,7 @@ func (e *Endpoint) updateLogger() {
// If this endpoint is set to debug ensure it will print debug by giving it
// an independent logger
- if e.Opts.IsEnabled("Debug") {
+ if e.Opts != nil && e.Opts.IsEnabled("Debug") {
baseLogger = logging.InitializeDefaultLogger()
baseLogger.SetLevel(logrus.DebugLevel)
} | endpoint: e.getLogger is nil safe for e.Opts
In some creation paths an Endpoint does not have Opts set when getLogger
is called. It's unfortunate but generally safer to ignore the options
here (mainly Debug). | cilium_cilium | train | go |
00888a729a1f4b4129e2e2e531f3395d9577d8a0 | diff --git a/structr-core/src/main/java/org/structr/common/SecurityContext.java b/structr-core/src/main/java/org/structr/common/SecurityContext.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/common/SecurityContext.java
+++ b/structr-core/src/main/java/org/structr/common/SecurityContext.java
@@ -575,7 +575,7 @@ public class SecurityContext {
}
public boolean hasCustomView() {
- return customView != null;
+ return customView != null && !customView.isEmpty();
}
public Set<String> getCustomView() { | Fixed custom view condition in SecurityContext. | structr_structr | train | java |
b3c9b66f2958bb09ecffdb7a8064121e3a27b989 | diff --git a/rpc/api.go b/rpc/api.go
index <HASH>..<HASH> 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -327,7 +327,7 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
case "eth_newBlockFilter":
*reply = newHexNum(api.xeth().NewBlockFilter())
- case "eth_transactionFilter":
+ case "eth_newPendingTransactionFilter":
*reply = newHexNum(api.xeth().NewTransactionFilter())
case "eth_uninstallFilter":
args := new(FilterIdArgs) | rpc: eth_transactionFilter => eth_newPendingTransactionFilter | ethereum_go-ethereum | train | go |
8c98c80ed4ecfae449da0d20b95207e4cf2d61c3 | diff --git a/src/cartodb.js b/src/cartodb.js
index <HASH>..<HASH> 100644
--- a/src/cartodb.js
+++ b/src/cartodb.js
@@ -93,6 +93,7 @@
'geo/leaflet/leaflet_wmslayer.js',
'geo/leaflet/leaflet_cartodb_layergroup.js',
'geo/leaflet/leaflet_cartodb_layer.js',
+ 'geo/leaflet/leaflet.geometry.js',
'geo/leaflet/leaflet.js',
'geo/gmaps/gmaps_base.js',
@@ -101,6 +102,7 @@
'geo/gmaps/gmaps_tiledlayer.js',
'geo/gmaps/gmaps_cartodb_layergroup.js',
'geo/gmaps/gmaps_cartodb_layer.js',
+ 'geo/gmaps/gmaps.geometry.js',
'geo/gmaps/gmaps.js',
'ui/common/dialog.js', | Added leaflet and gmaps geometries to cartodb.js main entry | CartoDB_carto.js | train | js |
7417748772a9bae5a7b3b0320c0f5f9108d93cd9 | diff --git a/builder/digitalocean/builder.go b/builder/digitalocean/builder.go
index <HASH>..<HASH> 100644
--- a/builder/digitalocean/builder.go
+++ b/builder/digitalocean/builder.go
@@ -11,6 +11,7 @@ import (
"github.com/mitchellh/packer/packer"
"log"
"os"
+ "strings"
"time"
)
@@ -164,7 +165,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
return errs
}
- log.Printf("Config: %+v", b.config)
+ configRepr := fmt.Sprintf("Config: %+v", b.config)
+ scrubbedConfig := strings.Replace(configRepr, b.config.ClientID, "CLIENT_ID", -1)
+ scrubbedConfig = strings.Replace(scrubbedConfig, b.config.APIKey, "API_KEY", -1)
+ log.Println(scrubbedConfig)
return nil
} | builder/digitalocean: Scrub config before logging [GH-<I>] | hashicorp_packer | train | go |
45da0b356512396a2b0bb1bb56fdaecb7b58aeb4 | diff --git a/run_tests.py b/run_tests.py
index <HASH>..<HASH> 100644
--- a/run_tests.py
+++ b/run_tests.py
@@ -16,6 +16,7 @@ Usage Examples:
"""
+import logging
import sys
import unittest | Somehow missed this import during the last commit. | gem_oq-engine | train | py |
4986355e3f169cf0e0f92b3356e7e98700a0449e | diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php
index <HASH>..<HASH> 100644
--- a/code/model/SiteTree.php
+++ b/code/model/SiteTree.php
@@ -2337,27 +2337,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$pageTypeName = $instance->i18n_singular_name();
- if($class == $this->class) {
- $currentClass = $class;
- $result[$class] = $pageTypeName;
- } else {
- $translation = _t(
- 'SiteTree.CHANGETO',
- 'Change to "%s"',
-
- "Pagetype selection dropdown with class names"
- );
-
- // @todo legacy fix to avoid empty classname dropdowns when translation doesn't include %s
- if(strpos($translation, '%s') !== FALSE) {
- $result[$class] = sprintf(
- $translation,
- $pageTypeName
- );
- } else {
- $result[$class] = "{$translation} \"{$pageTypeName}\"";
- }
- }
+ $currentClass = $class;
+ $result[$class] = $pageTypeName;
// if we're in translation mode, the link between the translated pagetype
// title and the actual classname might not be obvious, so we add it in parantheses | MINOR Simplified page type dropdown labels, removed redundant info (fixes #<I>) | silverstripe_silverstripe-siteconfig | train | php |
17f1e85f12d268c891989faaf7b5a99f56f06309 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -12,8 +12,19 @@ class Polka extends Router {
this.server = http.createServer(this.handler);
}
- use(...fn) {
- this.wares = this.wares.concat(fn);
+ use(...fns) {
+ fns.forEach(fn => {
+ if (fn instanceof Polka) {
+ let m, keys, obj=fn.handlers;
+ for (m in obj) {
+ if ((keys=Object.keys(obj[m])).length) {
+ keys.forEach(uri => this.add(m, uri, obj[m][uri]));
+ }
+ }
+ } else {
+ this.wares.push(fn);
+ }
+ });
return this; // chainable
} | absorb sub-applications; closes #1 | lukeed_polka | train | js |
0b4ff37541f264a17df5996d72293f5af9c333d3 | diff --git a/state_machine.js b/state_machine.js
index <HASH>..<HASH> 100644
--- a/state_machine.js
+++ b/state_machine.js
@@ -39,16 +39,17 @@ StateMachine.prototype.setState = function setState(StateType) {
if (currentType &&
StateType.prototype.type &&
StateType.prototype.type === currentType) {
- return;
+ return null;
}
assert(self.stateOptions, 'state machine must have stateOptions');
var state = new StateType(self.stateOptions);
if (state && state.type === currentType) {
- return;
+ return null;
}
var oldState = self.state;
self.state = state;
self.stateChangedEvent.emit(self, [oldState, state]);
+ return state;
}; | StateMachine: return new state from #setState | uber_tchannel-node | train | js |
5dd455fdc727371ace36e4d3f9ab7a52d96fac45 | diff --git a/templates/react/es6/grid/grid-editing/files/client/components/__path__/index.js b/templates/react/es6/grid/grid-editing/files/client/components/__path__/index.js
index <HASH>..<HASH> 100644
--- a/templates/react/es6/grid/grid-editing/files/client/components/__path__/index.js
+++ b/templates/react/es6/grid/grid-editing/files/client/components/__path__/index.js
@@ -31,6 +31,7 @@ export default class $(ClassName) extends Component {
id="grid-editing"
primaryKey="ProductID"
width="700px"
+ autoCommit={true}
dataSource={this.state.products}
features={$(gridfeatures)}
/> | fix: Set autoCommit so FIltering works with newly added records. | IgniteUI_igniteui-cli | train | js |
51c6ee7fd9a59cc9e47237a3630f7478eaa935af | diff --git a/djgeojson/__init__.py b/djgeojson/__init__.py
index <HASH>..<HASH> 100644
--- a/djgeojson/__init__.py
+++ b/djgeojson/__init__.py
@@ -1,8 +1,11 @@
#: Module version, as defined in PEP-0396.
pkg_resources = __import__('pkg_resources')
-distribution = pkg_resources.get_distribution('django-geojson')
-
-__version__ = distribution.version
-
+try:
+ distribution = pkg_resources.get_distribution('django-geojson')
+ __version__ = distribution.version
+except:
+ __version__ = 'unknown'
+ import warnings
+ warnings.warn('No distribution found.')
GEOJSON_DEFAULT_SRID = 4326 | Adds a warning for "Module version, as defined in PEP-<I>" | makinacorpus_django-geojson | train | py |
1270327d8318b906084fd6ddf65d3edac5d9e861 | diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
+++ b/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php
@@ -24,12 +24,12 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac
*/
interface AuthenticationProviderInterface extends AuthenticationManagerInterface
{
- /**
- * Checks whether this provider supports the given token.
- *
- * @param TokenInterface $token A TokenInterface instance
- *
- * @return bool true if the implementation supports the Token, false otherwise
- */
- public function supports(TokenInterface $token);
+ /**
+ * Checks whether this provider supports the given token.
+ *
+ * @param TokenInterface $token A TokenInterface instance
+ *
+ * @return bool true if the implementation supports the Token, false otherwise
+ */
+ public function supports(TokenInterface $token);
} | Fixed the AuthenticationProviderInterface alignment | symfony_symfony | train | php |
c34d61a48bb1c40d1ee83a7a9c40c409ce926bc9 | diff --git a/Tests/OrientDBTypeLinkTest.php b/Tests/OrientDBTypeLinkTest.php
index <HASH>..<HASH> 100644
--- a/Tests/OrientDBTypeLinkTest.php
+++ b/Tests/OrientDBTypeLinkTest.php
@@ -42,7 +42,7 @@ class OrientDBTypeLinkTest extends PHPUnit_Framework_TestCase
$link = new OrientDBTypeLink($value);
$this->assertSame('', (string) $link);
- $this->assertSame(null, $link->get());
- $this->assertSame(null, $link->getHash());
+ $this->assertNull($link->get());
+ $this->assertNull($link->getHash());
}
}
\ No newline at end of file | Test on OrientDBTypeLink improved | AntonTerekhov_OrientDB-PHP | train | php |
8fea37459372535faa833197ed378edaaef9a056 | diff --git a/src/ui/common/tabpane.js b/src/ui/common/tabpane.js
index <HASH>..<HASH> 100644
--- a/src/ui/common/tabpane.js
+++ b/src/ui/common/tabpane.js
@@ -62,9 +62,11 @@ cdb.ui.common.TabPane = cdb.core.View.extend({
if(v.cid === vid) {
v.show();
self.trigger('tabEnabled', name, v);
+ self.trigger('tabEnabled:' + name, v);
} else {
v.hide();
self.trigger('tabDisabled', '' , v);
+ self.trigger('tabDiabled:' + name, v);
}
});
} | added per tab triggers in tabpane | CartoDB_carto.js | train | js |
fb2bb617965a244b6e25b78f88101603411f2864 | diff --git a/src/Braunson/LaravelHTML5Forms/FormBuilder.php b/src/Braunson/LaravelHTML5Forms/FormBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Braunson/LaravelHTML5Forms/FormBuilder.php
+++ b/src/Braunson/LaravelHTML5Forms/FormBuilder.php
@@ -19,19 +19,20 @@ class FormBuilder extends \Illuminate\Html\FormBuilder {
* Create a form date field.
*
* @param string $name
+ * @param date $value
* @param date $min
* @param date $max
* @param array $options
* @return string
*/
- public function date($name, $min = null, $max = null, $options = array())
+ public function date($name, $value = null, $min = null, $max = null, $options = array())
{
if( !isset($min) && !isset($max) ) return 'The date field "'.$name.'" must have a min, max or both.';
if( isset($min) ) $options['min'] = $min;
if( isset($max) ) $options['max'] = $max;
- return $this->input('date', $name, null, $options);
+ return $this->input('date', $name, $value, $options);
}
/** | Added the ability to add a value attribute to a date input. | Braunson_laravel-html5-forms | train | php |
37bd0116ec28de13e4e34af26c1e4bcd25901ac2 | diff --git a/ecc.go b/ecc.go
index <HASH>..<HASH> 100644
--- a/ecc.go
+++ b/ecc.go
@@ -333,11 +333,6 @@ func populateKVStoreFromCache() {
if !OfflineSupport {
return
}
- // Populating KV store from Cache -> consul datastore needs some time interval
- // between consul daemon start and first addition to the KV store.
- // Bad things happen otherwise.
-
- time.Sleep(time.Second * 3)
started = true
for storeName, store := range cache {
for key, val := range store.cache { | Removing an unneccessary time.Sleep() which was added during dev | socketplane_ecc | train | go |
fab90920e7fa15b9fe0589e67f81f996dfbf3a4f | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -224,12 +224,7 @@ module.exports = function nuts(opts) {
releases = _.chain(releases)
- // Exclude deltas and other versions
- .filter(function(entry) {
- return (!entry.isDelta && entry.version == winReleases.normVersion(latest.tag));
- })
-
- // Change filename to use downlaodp roxy
+ // Change filename to use download proxy
.map(function(entry) {
entry.filename = url.resolve(fullUrl, '/download/'+latest.tag+'/'+entry.filename); | Don't filter out old versions or -delta from the RELEASES file. Closes #<I> | GitbookIO_nuts | train | js |
11d1e6e7c919356a74ecb5a13a1b2939ca9712c8 | diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -23,7 +23,7 @@ function createConfig(userConfig) {
}
// Use the same port number local
- if (config.localPort === undefined) {
+ if (config.localPort === null) {
config.localPort = config.dstPort;
}
return config; | Fix wrong comparison causing localPort to stay "null" if not explicitly defined. | agebrock_tunnel-ssh | train | js |
2a219a04cc914cfed96d3d71834fc7da87b1bbc7 | diff --git a/libnetwork/network_windows.go b/libnetwork/network_windows.go
index <HASH>..<HASH> 100644
--- a/libnetwork/network_windows.go
+++ b/libnetwork/network_windows.go
@@ -28,6 +28,9 @@ func executeInCompartment(compartmentID uint32, x func()) {
}
func (n *network) startResolver() {
+ if n.networkType == "ics" {
+ return
+ }
n.resolverOnce.Do(func() {
logrus.Debugf("Launching DNS server for network %q", n.Name())
options := n.Info().DriverOptions() | Fix for docker intercepting DNS requests on ICS network | moby_moby | train | go |
e38eabecacb2ce23d13e1863b04395ee94ad161d | diff --git a/lib/overcommit/plugins/pre_commit/restricted_paths.rb b/lib/overcommit/plugins/pre_commit/restricted_paths.rb
index <HASH>..<HASH> 100644
--- a/lib/overcommit/plugins/pre_commit/restricted_paths.rb
+++ b/lib/overcommit/plugins/pre_commit/restricted_paths.rb
@@ -1,7 +1,7 @@
module Overcommit::GitHook
class RestrictedPaths < HookSpecificCheck
include HookRegistry
- RESTRICTED_PATHS = %w[vendor]
+ RESTRICTED_PATHS = %w[vendor config]
def run_check
RESTRICTED_PATHS.each do |path| | Add config to RESTRICTED_PATHS
We want to add the 'config' directory to the array of RESTRICTED_PATHS
in order to prevent accidental modifications to config files.
Change-Id: I1b1d0ef6e<I>e5d<I>a<I>e<I>fac6cd<I>b<I>
Reviewed-on: <URL> | sds_overcommit | train | rb |
2e16d83e37314e638ef2a21c28acaa9801edee96 | diff --git a/tests/test_JFS.py b/tests/test_JFS.py
index <HASH>..<HASH> 100644
--- a/tests/test_JFS.py
+++ b/tests/test_JFS.py
@@ -89,8 +89,10 @@ class TestJFS:
p = "/Jotta/Archive/testfile_up_and_readpartial.txt"
t = jfs.up(p, StringIO.StringIO(TESTFILEDATA))
f = jfs.getObject(p)
+ # pick a number less than length of text
start = random.randint(0, len(TESTFILEDATA))
- end = random.randint(0, len(TESTFILEDATA)-start)
+ # pick a number between start and length of text
+ end = random.randint(0, len(TESTFILEDATA)-start) + start
assert f.readpartial(start, end) == TESTFILEDATA[start:end]
f.delete() | Fix bug in JFSFile.readpartial() test | havardgulldahl_jottalib | train | py |
18ecac68d1b4ad87cfdd629cb8dfd75e9d194e57 | diff --git a/Infra/Console/Context/ClassContextFactory.php b/Infra/Console/Context/ClassContextFactory.php
index <HASH>..<HASH> 100644
--- a/Infra/Console/Context/ClassContextFactory.php
+++ b/Infra/Console/Context/ClassContextFactory.php
@@ -145,18 +145,17 @@ final class ClassContextFactory implements ContextFactoryInterface
continue;
}
- if ($element->generate($io, $generated)) {
- $this->generatedValues[] = [$element->label, json_encode($generated)];
- $context[$key] = $element->normalize($generated);
- continue;
- }
-
- if ($required) {
+ if ($required || $given) {
if (!$interactive) {
throw new \LogicException(sprintf('No value provided for "%s".', $field));
}
- $context[$key] = $this->askRequiredValue($io, $element, $value);
+ if ($element->generate($io, $generated)) {
+ $this->generatedValues[] = [$element->label, json_encode($generated)];
+ $context[$key] = $element->normalize($generated);
+ } else {
+ $context[$key] = $this->askRequiredValue($io, $element, $value);
+ }
continue;
} | Add missing pieces to make:user (#<I>) | msgphp_domain | train | php |
Subsets and Splits