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 |
|---|---|---|---|---|---|
e2d7b18e05cdc4906afc2a23aeaf959edd9351b0 | diff --git a/src/input/input.js b/src/input/input.js
index <HASH>..<HASH> 100644
--- a/src/input/input.js
+++ b/src/input/input.js
@@ -70,7 +70,9 @@ export class MdInput {
}
mdValueChanged() {
- this.updateService.update();
+ if (!$(this.input).is(':focus')) {
+ this.updateService.update();
+ }
if (this.mdTextArea) {
$(this.input).trigger('autoresize');
} | fix(md-input): run updateService only..
..if input has no focus. If an input have text and
you delete the text, the label get pulled down into
the input before focus is removed.
This also move an error message downward when using validateTrigger.change. | aurelia-ui-toolkits_aurelia-materialize-bridge | train | js |
a7db020251819a271f27bec4f5979fa0d832ad57 | diff --git a/lib/qx/tool/cli/commands/Serve.js b/lib/qx/tool/cli/commands/Serve.js
index <HASH>..<HASH> 100644
--- a/lib/qx/tool/cli/commands/Serve.js
+++ b/lib/qx/tool/cli/commands/Serve.js
@@ -179,10 +179,10 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
* @Override
*/
_mergeArguments: function(parsedArgs, config, contribConfig) {
- this.base(arguments, parsedArgs, config, contribConfig);
if (!config.serve) {
config.serve = {};
}
+ this.base(arguments, parsedArgs, config, contribConfig);
config.serve.listenPort = config.serve.listenPort||this.argv.listenPort;
return config;
} | Fix missing serve property (#<I>)
Aproved and merged. Thanks @cboulanger! | qooxdoo_qooxdoo-compiler | train | js |
c80e62e95274a008d6436c8da1af01c251a3aea9 | diff --git a/lib/figs/git_handler.rb b/lib/figs/git_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/figs/git_handler.rb
+++ b/lib/figs/git_handler.rb
@@ -6,12 +6,10 @@ module Figs
TMP_GIT_DIR = "tmp/figs/"
def location gitpath, filenames
- begin
- git_clone gitpath
- tmp_filenames(([]<<filenames).flatten)
- rescue
- clear_tmp_dir
- end
+ git_clone gitpath
+ tmp_filenames(([]<<filenames).flatten)
+ rescue
+ clear_tmp_dir
end
private | Revert back to def rescue end. | NYULibraries_figs | train | rb |
fb500503296369ea6e9ee8b5936ae37a8d7c1844 | diff --git a/sdk/javascript/signing/core.js b/sdk/javascript/signing/core.js
index <HASH>..<HASH> 100644
--- a/sdk/javascript/signing/core.js
+++ b/sdk/javascript/signing/core.js
@@ -193,6 +193,15 @@ class Context {
getPublicKey (privateKey) {
throw new TypeError('Abstract method not implemented')
}
+
+ /**
+ * Generate a new random private key, based on the underlying algorithm.
+ *
+ * @return {PrivateKey} - a private key instance
+ */
+ newRandomPrivateKey () {
+ throw new TypeError('Abstract method not implemented')
+ }
}
module.exports = {
diff --git a/sdk/javascript/signing/secp256k1.js b/sdk/javascript/signing/secp256k1.js
index <HASH>..<HASH> 100644
--- a/sdk/javascript/signing/secp256k1.js
+++ b/sdk/javascript/signing/secp256k1.js
@@ -125,6 +125,10 @@ class Secp256k1Context extends Context {
return new Secp256k1PublicKey(
secp256k1.publicKeyCreate(privateKey.privateKeyBytes))
}
+
+ newRandomPrivateKey () {
+ return Secp256k1PrivateKey.newRandom()
+ }
}
module.exports = { | Add newRandomPrivateKey to Context
Add newRandomPrivateKey to Context creates a seam for implementations of
Context to generate random keys, without needing to reference a specific
implementation of PrivateKey. | hyperledger_sawtooth-core | train | js,js |
e35e28751bb5a9ab83ef66c7ea5d82ceb3a3913c | diff --git a/package.json b/package.json
index <HASH>..<HASH> 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"dependencies": {
"babel": "6.23.0",
"babel-core": "6.26.0",
+ "babel-register": "6.26.0",
"bluebird": "3.5.0",
"browser-sync": "2.18.13",
"chai": "4.1.1",
diff --git a/src/config/conf.dev.js b/src/config/conf.dev.js
index <HASH>..<HASH> 100644
--- a/src/config/conf.dev.js
+++ b/src/config/conf.dev.js
@@ -1,6 +1,6 @@
/* global browser */
import path from 'path';
-import 'babel/register';
+import 'babel-register';
import './global';
// Reference Configuration File
//
diff --git a/src/config/conf.js b/src/config/conf.js
index <HASH>..<HASH> 100644
--- a/src/config/conf.js
+++ b/src/config/conf.js
@@ -1,7 +1,7 @@
/* global browser */
import path from 'path';
import program from 'commander';
-import 'babel/register';
+import 'babel-register';
import './global';
import { getIPaddress, httpServer, logSeleniumNodeInfo } from '../utils'; | Adding babel-register to solve eslint error | qlik-oss_after-work.js | train | json,js,js |
bf865a17c7dc21c7d212e856512241fcad90355b | diff --git a/lib/gruvi/hub.py b/lib/gruvi/hub.py
index <HASH>..<HASH> 100644
--- a/lib/gruvi/hub.py
+++ b/lib/gruvi/hub.py
@@ -257,6 +257,9 @@ class Hub(fibers.Fiber):
self._loop.excepthook = self._uncaught_exception
self._data = {}
self._noswitch_depth = 0
+ # Use a deque() instead of our dllist from gruvi.callbacks because we
+ # need a thread-safe append, and we don't need to remove things from
+ # the middle.
self._callbacks = collections.deque()
# Thread IDs may be recycled when a thread exits. But as long as the
# hub is alive, it won't be recycled so in that case we can use just
@@ -413,7 +416,7 @@ class Hub(fibers.Fiber):
raise RuntimeError('hub is closed')
elif not callable(callback):
raise TypeError('"callback": expecting a callable')
- self._callbacks.append((callback, args)) # atomic
+ self._callbacks.append((callback, args)) # thread-safe
self._stop_loop() | hub: comment update
Explain why a collections.deque() is used for callback and not a
dlllist from gruvi.callbacks (answer: thread-safety). | geertj_gruvi | train | py |
1c13d8c9f3567276540f49673097197a2e37b27e | diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpChunkAggregator.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpChunkAggregator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/netty/handler/codec/http/HttpChunkAggregator.java
+++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpChunkAggregator.java
@@ -89,6 +89,7 @@ public class HttpChunkAggregator extends SimpleChannelUpstreamHandler {
if (encodings.isEmpty()) {
m.removeHeader(HttpHeaders.Names.TRANSFER_ENCODING);
}
+ m.setChunked(false);
m.setContent(ChannelBuffers.dynamicBuffer(e.getChannel().getConfig().getBufferFactory()));
this.currentMessage = m;
} else { | Fixed a bug where HttpMessage.chunked flag is not cleared by HttpChunkAggregator | netty_netty | train | java |
80d7e7e4295f8bf149099942ab3d1ba869786722 | diff --git a/src/runners/WorkerProcess.js b/src/runners/WorkerProcess.js
index <HASH>..<HASH> 100644
--- a/src/runners/WorkerProcess.js
+++ b/src/runners/WorkerProcess.js
@@ -126,6 +126,12 @@ export default class WorkerProcess extends EventEmitter {
if (this._debugger) {
await this._debugger.close();
}
+
+ this._send({
+ type: 'exit',
+ status: status,
+ });
+ this._childProc.kill('SIGINT');
this._reset();
} | OI-<I> Potential memory leak in Oxygen IDE (#<I>) | oxygenhq_oxygen | train | js |
560ca9487e513b47b7dc4bca253553a9a738a20c | diff --git a/lib/run/execution.js b/lib/run/execution.js
index <HASH>..<HASH> 100644
--- a/lib/run/execution.js
+++ b/lib/run/execution.js
@@ -106,7 +106,7 @@ module.exports = function *(lambdaPath, event, context, environment, assets) {
child.on('exit', function() {
console.log('');
- if (result.type === 'error') {
+ if (result && result.type === 'error') {
reject(new Error(result.result));
} else {
resolve(result.result); | Make sure to check for result before checking its type
This affects Lambda functions that timeout without producing any result, as in that case result may end up being null. | Testlio_lambda-tools | train | js |
f89cab0eee653d28e64c31cce0ffcecb803edb21 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -277,9 +277,9 @@ module.exports = function (grunt) {
]);
grunt.registerTask('publish', ['publish:patch']);
- grunt.registerTask('publish:patch', ['fulltest', 'bump-only:patch', '_publish']);
- grunt.registerTask('publish:minor', ['fulltest', 'bump-only:minor', '_publish']);
- grunt.registerTask('publish:major', ['fulltest', 'bump-only:major', '_publish']);
+ grunt.registerTask('publish:patch', ['test', 'bump-only:patch', '_publish']);
+ grunt.registerTask('publish:minor', ['test', 'bump-only:minor', '_publish']);
+ grunt.registerTask('publish:major', ['test', 'bump-only:major', '_publish']);
grunt.registerTask('default', [
'test', | refactor(grunt): forgot to change task names
Ref 6ff<I>a | seriema_angular-apimock | train | js |
0b0f90f2d21f202525931ff93e48af94bb3049bf | diff --git a/alerta/management/views.py b/alerta/management/views.py
index <HASH>..<HASH> 100644
--- a/alerta/management/views.py
+++ b/alerta/management/views.py
@@ -145,8 +145,8 @@ def health_check():
@cross_origin()
@permission(Scope.admin_management)
def housekeeping():
- expired_threshold = request.args.get('expired', current_app.config['DEFAULT_EXPIRED_DELETE_HRS'], type='int')
- info_threshold = request.args.get('info', current_app.config['DEFAULT_INFO_DELETE_HRS'], type='int')
+ expired_threshold = request.args.get('expired', default=current_app.config['DEFAULT_EXPIRED_DELETE_HRS'], type=int)
+ info_threshold = request.args.get('info', default=current_app.config['DEFAULT_INFO_DELETE_HRS'], type=int)
has_expired, has_timedout = Alert.housekeeping(expired_threshold, info_threshold) | Fix cast to int for hk params (#<I>) | alerta_alerta | train | py |
003f2d9323df0fbb92b0ef7d0d9d5ef73b6fac1e | diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py
index <HASH>..<HASH> 100644
--- a/salt/states/saltmod.py
+++ b/salt/states/saltmod.py
@@ -651,7 +651,7 @@ def runner(name, **kwargs):
if __opts__.get('test', False):
ret = {
'name': name,
- 'result': True,
+ 'result': False,
'changes': {},
'comment': "Runner function '{0}' would be executed.".format(name)
}
@@ -716,7 +716,7 @@ def wheel(name, **kwargs):
jid = None
if __opts__.get('test', False):
- ret['result'] = True,
+ ret['result'] = False,
ret['comment'] = "Wheel function '{0}' would be executed.".format(name)
return ret | Following the documentation, when passed the test=True argument the runner and wheel functions should return a result value of False. | saltstack_salt | train | py |
ea8e8e38e4598f283b0fe13342aa432c755ee9b9 | diff --git a/lib/amp-core/support/hex_string.rb b/lib/amp-core/support/hex_string.rb
index <HASH>..<HASH> 100644
--- a/lib/amp-core/support/hex_string.rb
+++ b/lib/amp-core/support/hex_string.rb
@@ -22,12 +22,12 @@ module Amp
class HexString
# Construct a HexString
def self.from_bin(bin)
- new(bin, nil)
+ HexString === bin ? bin : new(bin, nil)
end
# Construct a HexString
def self.from_hex(hex)
- new(nil, hex)
+ HexString === hex ? hex : new(nil, hex)
end
# Mainly internal/test helper method; change the encoding in 1.9 | Replaced from_bin/from_hex to avoid constructing nested HexStrings. | michaeledgar_amp-core | train | rb |
983241e5ba35e3cc2265d6e1f3201e03196eb800 | diff --git a/js/test/Exchange/test.fetchOrderBooks.js b/js/test/Exchange/test.fetchOrderBooks.js
index <HASH>..<HASH> 100644
--- a/js/test/Exchange/test.fetchOrderBooks.js
+++ b/js/test/Exchange/test.fetchOrderBooks.js
@@ -13,7 +13,7 @@ const log = require ('ololog')
module.exports = async (exchange) => {
- const randomSymbols = exchange.symbols.sort (() => 0.5 - Math.random ()).slice (0, 2)
+ const randomSymbols = exchange.symbols.slice ().sort (() => 0.5 - Math.random ()).slice (0, 2)
const customExchangeParams = ([
'yobit',
'tidex', | Prevent exchange.symbols mutation
exchange.symbols was getting shuffled here not only for this test but also affecting subsequent ones. | ccxt_ccxt | train | js |
c6e72f55cb10bccdcba2f31e9d52c528b12c5a0e | diff --git a/ffi/build.py b/ffi/build.py
index <HASH>..<HASH> 100755
--- a/ffi/build.py
+++ b/ffi/build.py
@@ -82,6 +82,16 @@ def main_win32():
def main_posix(kind, library_ext):
os.chdir(here_dir)
+ # Check availability of llvm-config
+ llvm_config = os.environ.get('LLVM_CONFIG', 'llvm-config')
+ print("LLVM version... ", end='')
+ sys.stdout.flush()
+ try:
+ subprocess.check_call([llvm_config, '--version'])
+ except (OSError, subprocess.CalledProcessError):
+ raise RuntimeError("%s failed executing, please point LLVM_CONFIG "
+ "to the path for llvm-config" % (llvm_config,))
+
makefile = "Makefile.%s" % (kind,)
subprocess.check_call(['make', '-f', makefile])
shutil.copy('libllvmlite' + library_ext, target_dir) | Add a guard against missing llvm-config (fix #<I>) | numba_llvmlite | train | py |
c304925f575ba19467891a8b8c6cd4a9f24c235c | diff --git a/DataFixtures/ORM/LoadSiteData.php b/DataFixtures/ORM/LoadSiteData.php
index <HASH>..<HASH> 100644
--- a/DataFixtures/ORM/LoadSiteData.php
+++ b/DataFixtures/ORM/LoadSiteData.php
@@ -8,6 +8,7 @@ use Kitpages\CmsBundle\Entity\Site;
use Kitpages\CmsBundle\Entity\Page;
use Kitpages\CmsBundle\Entity\PageZone;
use Kitpages\CmsBundle\Entity\Zone;
+use Doctrine\Common\Persistence\ObjectManager;
class LoadSiteData implements FixtureInterface, ContainerAwareInterface
{
@@ -17,7 +18,7 @@ class LoadSiteData implements FixtureInterface, ContainerAwareInterface
{
$this->container = $container;
}
- public function load($em)
+ public function load(ObjectManager $em)
{
$em->getRepository('KitpagesCmsBundle:Site')->set(Site::IS_NAV_PUBLISHED, 0); | fixed:
Fatal error: Declaration of Kitpages\CmsBundle\DataFixtures\ORM\LoadSiteData::load() must be compatible with that of Doctrine\Common\DataFixtures\FixtureInterface::load() | kitpages_KitpagesCmsBundle | train | php |
9bc93634383ed41711d41494d24dc452711650f8 | diff --git a/card.go b/card.go
index <HASH>..<HASH> 100644
--- a/card.go
+++ b/card.go
@@ -74,7 +74,7 @@ type Card struct {
Attachments []*Attachment `json:"attachments,omitempty"`
// Labels
- IDLabels []string `json:idLabels,omitempty"`
+ IDLabels []string `json:"idLabels,omitempty"`
Labels []*Label `json:"labels,omitempty"`
} | fixed typo for Card.IDLabels struct tag | adlio_trello | train | go |
d95ac0bf4ff6f060f23dc0305a20db2e25fd2d38 | diff --git a/tibber/subscription_manager.py b/tibber/subscription_manager.py
index <HASH>..<HASH> 100644
--- a/tibber/subscription_manager.py
+++ b/tibber/subscription_manager.py
@@ -61,8 +61,8 @@ class SubscriptionManager:
subprotocols=["graphql-subscriptions"])
self._state = STATE_RUNNING
_LOGGER.debug("Running")
- self.websocket.send(json.dumps({"type": "init",
- "payload": self._init_payload}))
+ await self.websocket.send(json.dumps({"type": "init",
+ "payload": self._init_payload}))
while self._state == STATE_RUNNING:
try: | Add missing await (#<I>) | Danielhiversen_pyTibber | train | py |
93265e69030bca133732a18afc0e32f1ff5a25c1 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -346,20 +346,19 @@ PageClass.prototype.importDocument = function(doc) {
// make sure script is not loaded when inserted into document
node.type = "text/plain";
// fetch script content ourselves
- if (node.src) return pGet(node.src).then(function(txt) {
- return {
- src: node.src,
- txt: txt,
- node: node
- };
- }).catch(function(err) {
- console.error("Error loading", node.src, err);
- return {
- src: node.src,
- node: node
- };
- });
- else return Promise.resolve({
+ if (node.src) {
+ return pGet(node.src).then(function(txt) {
+ return {
+ src: node.src,
+ txt: txt,
+ node: node
+ };
+ }).catch(function(err) {
+ // let the script load on insertion - screw the ordering since this is remote anyway
+ node.type = "text/javascript";
+ return {};
+ });
+ } else return Promise.resolve({
src: "inline", txt: node.textContent, node: node
});
}); | If a script cannot be fetched, just let it run ! | kapouer_window-page | train | js |
d66bf04798abb01f8cc25854687e892300f3fb25 | diff --git a/bundles/as3/lib/sprout/as3/version.rb b/bundles/as3/lib/sprout/as3/version.rb
index <HASH>..<HASH> 100644
--- a/bundles/as3/lib/sprout/as3/version.rb
+++ b/bundles/as3/lib/sprout/as3/version.rb
@@ -3,7 +3,7 @@ module Sprout # :nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 0
- TINY = 32
+ TINY = 36
STRING = [MAJOR, MINOR, TINY].join('.')
MAJOR_MINOR = [MAJOR, MINOR].join('.')
diff --git a/bundles/as3/lib/sprout/tasks/mxmlc_task.rb b/bundles/as3/lib/sprout/tasks/mxmlc_task.rb
index <HASH>..<HASH> 100644
--- a/bundles/as3/lib/sprout/tasks/mxmlc_task.rb
+++ b/bundles/as3/lib/sprout/tasks/mxmlc_task.rb
@@ -453,7 +453,7 @@ This is an advanced option.
EOF
end
- add_param(:load_config, :file) do |p|
+ add_param(:load_config, :files) do |p|
p.description =<<EOF
Specifies the location of the configuration file that defines compiler options. | Updated MXMLCTask load_config so that it accepts multiple arguments | lukebayes_project-sprouts | train | rb,rb |
77d44234db6ef3ee89ded94b3795c5549583376d | diff --git a/src/rules/no-extraneous-dependencies.js b/src/rules/no-extraneous-dependencies.js
index <HASH>..<HASH> 100644
--- a/src/rules/no-extraneous-dependencies.js
+++ b/src/rules/no-extraneous-dependencies.js
@@ -1,5 +1,6 @@
import path from 'path'
import fs from 'fs'
+import has from 'has'
import readPkgUp from 'read-pkg-up'
import minimatch from 'minimatch'
import resolve from 'eslint-module-utils/resolve'
@@ -30,7 +31,7 @@ function getDependencies(context, packageDir) {
peerDependencies: {},
}
- if (Object.prototype.hasOwnProperty.call(context.settings, 'import/paths')) {
+ if (has(context.settings, 'import/paths')) {
paths.push(
...context.settings['import/paths']
.map((dir) => path.resolve(dir)) | replaced Object.prototype.hasOwnProperty usage with has module | benmosher_eslint-plugin-import | train | js |
18a1bc63b258e16bb4aeb0dbf2f271feabe36a0b | diff --git a/Manager/WorkspaceManager.php b/Manager/WorkspaceManager.php
index <HASH>..<HASH> 100644
--- a/Manager/WorkspaceManager.php
+++ b/Manager/WorkspaceManager.php
@@ -236,11 +236,14 @@ class WorkspaceManager
public function deleteWorkspace(Workspace $workspace)
{
$root = $this->resourceManager->getWorkspaceRoot($workspace);
- $children = $root->getChildren();
-
- if ($children) {
- foreach ($children as $node) {
- $this->resourceManager->delete($node);
+
+ if ($root) {
+ $children = $root->getChildren();
+
+ if ($children) {
+ foreach ($children as $node) {
+ $this->resourceManager->delete($node);
+ }
}
} | [CoreBundle] Update WorkspaceManager.php | claroline_Distribution | train | php |
e59bbffc4ec7031bf9079f22f6e69b7b87f292c5 | diff --git a/client_test.go b/client_test.go
index <HASH>..<HASH> 100644
--- a/client_test.go
+++ b/client_test.go
@@ -54,12 +54,12 @@ func testClient(c Client, t *testing.T) {
})
t.Run("Multiple ASNs", func(t *testing.T) {
+ // TODO: find an IP address which changes hands less frequently.
ip := net.ParseIP("103.235.224.237") // See #6
resp, err := c.LookupIP(ip)
require.NoError(t, err)
- assert.Equal(t, ASN(4808), resp.ASN)
+ assert.Equal(t, ASN(23724), resp.ASN)
})
-
})
} | Update flakey Multiple ASNs test | ammario_ipisp | train | go |
03c658391fa99d2c25c5b182897481b2c2ff2673 | diff --git a/mysite/ruby/deploy.rb b/mysite/ruby/deploy.rb
index <HASH>..<HASH> 100644
--- a/mysite/ruby/deploy.rb
+++ b/mysite/ruby/deploy.rb
@@ -11,16 +11,16 @@ namespace :deploy do
task :migrate do
if exists?(:webserver_user)
- run "sudo su #{webserver_user} -c '#{latest_release}/#{:sake_path} dev/build flush=1'", :roles => :db
+ run "sudo su #{webserver_user} -c '#{latest_release}/#{sake_path} dev/build flush=1'", :roles => :db
else
run "mkdir -p #{latest_release}/silverstripe-cache", :roles => :db
- run "#{latest_release}/#{:sake_path} dev/build flush=1", :roles => :db
+ run "#{latest_release}/#{sake_path} dev/build flush=1", :roles => :db
run "rm -rf #{latest_release}/silverstripe-cache", :roles => :db
end
# Initialise the cache, in case dev/build wasn't executed on all hosts
if exists?(:webserver_user)
- run "sudo su #{webserver_user} -c '#{latest_release}/#{:sake_path} dev"
+ run "sudo su #{webserver_user} -c '#{latest_release}/#{sake_path} dev"
end
end | BUG Sake path still not working | silverstripe-archive_deploynaut | train | rb |
13bfcc238f620f45c099aeef66b2c1a5d8166790 | diff --git a/resource_openstack_compute_instance_v2.go b/resource_openstack_compute_instance_v2.go
index <HASH>..<HASH> 100644
--- a/resource_openstack_compute_instance_v2.go
+++ b/resource_openstack_compute_instance_v2.go
@@ -442,6 +442,7 @@ func resourceComputeInstanceV2Delete(d *schema.ResourceData, meta interface{}) e
log.Printf("[DEBUG] Waiting for instance (%s) to delete", d.Id())
stateConf := &resource.StateChangeConf{
+ Pending: []string{"ACTIVE"},
Target: "DELETED",
Refresh: ServerV2StateRefreshFunc(computeClient, d.Id()),
Timeout: 10 * time.Minute, | add ACTIVE as pending state when deleting instance | terraform-providers_terraform-provider-openstack | train | go |
4c592becc0977de24175c5d63a668d7835bd9877 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -47,7 +47,7 @@ export class DefaultLoader extends Loader {
var that = this;
if(System.polyfilled){
- define('html-import-template', [], {
+ define('view', [], {
load: function (name, req, onload, config) {
var entry = that.getOrCreateTemplateRegistryEntry(name),
address;
@@ -66,7 +66,7 @@ export class DefaultLoader extends Loader {
}
});
}else{
- System.set('html-import-template', System.newModule({
+ System.set('view', System.newModule({
fetch: function(load, fetch) {
var id = load.name.substring(0, load.name.indexOf('!'));
var entry = load.metadata.templateRegistryEntry = that.getOrCreateTemplateRegistryEntry(id);
@@ -113,9 +113,9 @@ export class DefaultLoader extends Loader {
loadTemplate(url){
if(System.polyfilled){
- return System.import('html-import-template!' + url);
+ return System.import('view!' + url);
}else{
- return System.import(url + '!html-import-template');
+ return System.import(url + '!view');
}
}
} | fix(loader): change plugin name to view
Changing the internal name used with the various loaders for plugins to
view. This will make it nicer for developers to use in their own code
as part of their imports. | aurelia_loader-default | train | js |
5b572b14d7c4a73ba0d678b9393a6bd97b05f792 | diff --git a/src/Leevel/Debug/Console/LinkDebugBar.php b/src/Leevel/Debug/Console/LinkDebugBar.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Debug/Console/LinkDebugBar.php
+++ b/src/Leevel/Debug/Console/LinkDebugBar.php
@@ -49,7 +49,7 @@ class LinkDebugBar extends Command
*
* @var string
*/
- protected $description = 'Create a symbolic link from `vendor/maximebf/debugbar/src/DebugBar/Resources` to `www/debugbar`.';
+ protected $description = 'Create a symbolic link from `debugbar/src/DebugBar/Resources` to `www/debugbar`.';
/**
* 响应命令.
@@ -67,7 +67,7 @@ class LinkDebugBar extends Command
}
link(
- $path = $app->path('vendor/maximebf/debugbar/src/DebugBar/Resources'), $link
+ $path = $app->path('debugbar'), $link
);
$this->info(sprintf('Linked `%s` directory to `%s` successed.', $path, $link)); | refactor: adjust debugbar | hunzhiwange_framework | train | php |
27f27ac49cb26a234caf2151a6c07c6ab131289c | diff --git a/project/library/CM/Response/Abstract.php b/project/library/CM/Response/Abstract.php
index <HASH>..<HASH> 100644
--- a/project/library/CM/Response/Abstract.php
+++ b/project/library/CM/Response/Abstract.php
@@ -55,7 +55,7 @@ abstract class CM_Response_Abstract extends CM_Class_Abstract {
* @return CM_Model_User|null
* @throws CM_Exception_AuthRequired
*/
- public function getViewer($needed = false) {
+ public function getViewer($needed = false) {
return $this->_request->getViewer($needed);
} | t<I>: refactored SK_Entity_Blogpost to be based on users instead of profiles | cargomedia_cm | train | php |
3d597f8d9f7fb94af57644904a70f1ba4c916cda | diff --git a/packages/build-tools/tasks/pattern-lab-tasks.js b/packages/build-tools/tasks/pattern-lab-tasks.js
index <HASH>..<HASH> 100644
--- a/packages/build-tools/tasks/pattern-lab-tasks.js
+++ b/packages/build-tools/tasks/pattern-lab-tasks.js
@@ -67,7 +67,7 @@ async function plBuild(errorShouldExit) {
sh(
'php',
- ['-d', 'memory_limit=4048M', consolePath, '--generate'],
+ ['-d', 'memory_limit=8096M', consolePath, '--generate'],
errorShouldExit,
false,
) | fix: update max memory for Pattern Lab PHP generation command — testing fix for PL not compiling as expected. | bolt-design-system_bolt | train | js |
417765b8145866552369b24d44e346a19c203304 | diff --git a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java
index <HASH>..<HASH> 100644
--- a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java
+++ b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java
@@ -611,7 +611,7 @@ public final class ProtocolNegotiators {
BufferUntilTlsNegotiatedHandler(
ChannelHandler bootstrapHandler, GrpcHttp2ConnectionHandler grpcHandler) {
- super(bootstrapHandler, grpcHandler);
+ super(bootstrapHandler);
this.grpcHandler = grpcHandler;
}
@@ -630,6 +630,10 @@ public final class ProtocolNegotiators {
// Successfully negotiated the protocol.
logSslEngineDetails(Level.FINER, ctx, "TLS negotiation succeeded.", null);
+ // Wait until negotiation is complete to add gRPC. If added too early, HTTP/2 writes
+ // will fail before we see the userEvent, and the channel is closed down prematurely.
+ ctx.pipeline().addBefore(ctx.name(), null, grpcHandler);
+
// Successfully negotiated the protocol.
// Notify about completion and pass down SSLSession in attributes.
grpcHandler.handleProtocolNegotiationCompleted( | netty: only add gRPC negotiator once SSL is established | grpc_grpc-java | train | java |
7b0b7909122342b275b7eb99b9f51c18abae6028 | diff --git a/code/libraries/koowa/controller/behavior/commandable.php b/code/libraries/koowa/controller/behavior/commandable.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/controller/behavior/commandable.php
+++ b/code/libraries/koowa/controller/behavior/commandable.php
@@ -146,11 +146,23 @@ class KControllerBehaviorCommandable extends KControllerBehaviorAbstract
* .
* @param KCommandContext A command context object
*/
- protected function _afterBrowse(KCommandContext $contex)
+ protected function _afterBrowse(KCommandContext $context)
{
- if($this->hasToolbar()) {
- $this->getToolbar()->addCommand('new');
- $this->getToolbar()->addCommand('delete');
+ if($this->hasToolbar())
+ {
+ if($this->canAdd())
+ {
+ $identifier = $context->caller->getIdentifier();
+ $config = array('attribs' => array(
+ 'href' => JRoute::_( 'index.php?option=com_'.$identifier->package.'&view='.$identifier->name)
+ ));
+
+ $this->getToolbar()->addCommand('new', $config);
+ }
+
+ if($this->canDelete()) {
+ $this->getToolbar()->addCommand('delete');
+ }
}
}
}
\ No newline at end of file | - Only add the new and delete commands if the corresponding actions are executable.
- Moved setting up the new command from the default toolbar into the commandable behavior. | joomlatools_joomlatools-framework | train | php |
728bf6922980e7f790832ee646630bd2720d1d2f | diff --git a/src/program/types/JSXOpeningElement.js b/src/program/types/JSXOpeningElement.js
index <HASH>..<HASH> 100644
--- a/src/program/types/JSXOpeningElement.js
+++ b/src/program/types/JSXOpeningElement.js
@@ -56,7 +56,7 @@ export default class JSXOpeningElement extends Node {
if (!this.program.options.objectAssign) {
throw new CompileError( this, 'Mixed JSX attributes ending in spread requires specified objectAssign option with \'Object.assign\' or polyfill helper.' );
}
- before = html ? `', ${this.program.options.objectAssign}({},` : `, ${this.program.objectAssign}({},`;
+ before = html ? `', ${this.program.options.objectAssign}({},` : `, ${this.program.options.objectAssign}({},`;
after = ')';
}
} else { | fix emitting undefined instead of Object.assign in JSXOpeningElement (#<I>) | bublejs_buble | train | js |
1f5f2f1085e227656186c215d2421bb4c00122fa | diff --git a/mutant/__init__.py b/mutant/__init__.py
index <HASH>..<HASH> 100644
--- a/mutant/__init__.py
+++ b/mutant/__init__.py
@@ -3,6 +3,6 @@ from __future__ import unicode_literals
import logging
-__version__ = VERSION = (0, 1, 0)
+__version__ = VERSION = (0, 1, 1)
logger = logging.getLogger('mutant') | Bumped version number to <I> | charettes_django-mutant | train | py |
9328f67e20e4874b6b7cc9b9551cdf4725ce0620 | diff --git a/lib/helper.js b/lib/helper.js
index <HASH>..<HASH> 100644
--- a/lib/helper.js
+++ b/lib/helper.js
@@ -6,7 +6,8 @@ var Promise = require('bluebird')
exports.browserFullNameToShort = function (fullName) {
var agent = useragent.parse(fullName)
- return agent.family !== 'Other' ? agent.toAgent() + ' (' + agent.os + ')' : fullName
+ var isKnown = agent.family !== 'Other' && agent.os.family !== 'Other'
+ return isKnown ? agent.toAgent() + ' (' + agent.os + ')' : fullName
}
exports.isDefined = function (value) { | fix(helper): Ensure browser detection is handled in the unkown case | karma-runner_karma | train | js |
809ba48bef0568830c56965ca09abd9a7b4b1416 | diff --git a/test-complete/nodejs-documents-query-2.js b/test-complete/nodejs-documents-query-2.js
index <HASH>..<HASH> 100644
--- a/test-complete/nodejs-documents-query-2.js
+++ b/test-complete/nodejs-documents-query-2.js
@@ -162,13 +162,14 @@ describe('Document query test 2', function(){
it('should do element query', function(done){
db.documents.query(
q.where(
- q.word(q.element('name'), q.value('John'))
- )
+ q.word(q.element('name'), q.value('Jo*'), q.termOptions('wildcarded'))
+ ).
+ withOptions({search:['filtered'], debug: true})
).
result(function(response) {
//console.log(JSON.stringify(response, null, 2));
- response.length.should.equal(1);
- response[0].uri.should.equal('/test/query/matchList/doc6.xml');
+ response.length.should.equal(2);
+ response[1].uri.should.equal('/test/query/matchList/doc6.xml');
done();
}, done);
}); | wildcard test on xml | marklogic_node-client-api | train | js |
17f74fa2f28a7225d0435b6f620dc0dc930f53e5 | diff --git a/components/amorphic/lib/utils/logger.js b/components/amorphic/lib/utils/logger.js
index <HASH>..<HASH> 100644
--- a/components/amorphic/lib/utils/logger.js
+++ b/components/amorphic/lib/utils/logger.js
@@ -71,8 +71,8 @@ function setupLogger(logger, path, context, applicationConfig) {
logger.startContext(context);
logger.setLevel(applicationConfig[path].logLevel);
- if (AmorphicContext.sendToLog) {
- logger.sendToLog = AmorphicContext.sendToLog;
+ if (AmorphicContext.appContext.sendToLog) {
+ logger.sendToLog = AmorphicContext.appContext.sendToLog;
}
} | Merge pull request #<I> from hackerrdave/fix-send-to-logger-setup
Grab sendToLog function from appContext during setupLogger | haven-life_amorphic | train | js |
c3c0785c908ecd20583ca753419de02481fbaadf | diff --git a/py_msm/skill_entry.py b/py_msm/skill_entry.py
index <HASH>..<HASH> 100644
--- a/py_msm/skill_entry.py
+++ b/py_msm/skill_entry.py
@@ -98,11 +98,15 @@ class SkillEntry(object):
weights = [
(9, self._compare(name, search)),
(9, self._compare(name.split(' '), search_tokens)),
- (2, self._compare(name_common, search_common))
+ (2, self._compare(name_common, search_common)),
]
if author:
- weights.append((5, self._compare(self.author, author)))
- return (
+ author_weight = self._compare(self.author, author)
+ weights.append((5, author_weight))
+ author_weight = author_weight
+ else:
+ author_weight = 1.0
+ return author_weight * (
sum(weight * val for weight, val in weights) /
sum(weight for weight, val in weights)
) | Improve author matching
This puts more weight on having the correct author when searching a skill | MycroftAI_mycroft-skills-manager | train | py |
58f950fe4aab7e8d9fc3e8a21ece300ff4fc4bff | diff --git a/lwr/lwr_client/__init__.py b/lwr/lwr_client/__init__.py
index <HASH>..<HASH> 100644
--- a/lwr/lwr_client/__init__.py
+++ b/lwr/lwr_client/__init__.py
@@ -7,7 +7,7 @@ This module contains logic for interfacing with an external LWR server.
"""
from .stager import FileStager
-from .client import Client
+from .client import Client, OutputNotFoundException
from .destination import url_to_destination_params
-__all__ = [Client, FileStager, url_to_destination_params]
+__all__ = [Client, OutputNotFoundException, FileStager, url_to_destination_params]
diff --git a/lwr/lwr_client/client.py b/lwr/lwr_client/client.py
index <HASH>..<HASH> 100644
--- a/lwr/lwr_client/client.py
+++ b/lwr/lwr_client/client.py
@@ -172,7 +172,7 @@ class Client(object):
elif output_type == "task":
output_path = os.path.join(working_directory, name)
else:
- raise OutputNotFoundException("No remote output found for dataset with path %s" % path)
+ raise OutputNotFoundException(path)
self.__raw_download_output(name, self.job_id, output_type, output_path)
def __raw_download_output(self, name, job_id, output_type, output_path): | Slight exception handling improvement in lwr_client. | galaxyproject_pulsar | train | py,py |
6bb007e26f14563343d667a50c9d87213b574074 | diff --git a/time.go b/time.go
index <HASH>..<HASH> 100644
--- a/time.go
+++ b/time.go
@@ -4,6 +4,11 @@ import (
"time"
)
+const (
+ Day = 24 * time.Hour
+ Week = 7 * Day
+)
+
// SleepUntil sleeps until the specified time.
func SleepUntil(t time.Time) {
now := time.Now() | Add constants of Day/Week | golangplus_time | train | go |
176fda0381e74b12ed83d8d8622b9b5d493c4ee6 | diff --git a/src/Engine/Elasticsearch/ElasticsearchAdapter.php b/src/Engine/Elasticsearch/ElasticsearchAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Engine/Elasticsearch/ElasticsearchAdapter.php
+++ b/src/Engine/Elasticsearch/ElasticsearchAdapter.php
@@ -178,6 +178,17 @@ class ElasticsearchAdapter implements AdapterInterface
{
throw new NotImplementedException();
}
+
+ /**
+ * @param CollectionNameInterface $collectionName
+ */
+ public function refresh(CollectionNameInterface $collectionName)
+ {
+ $this->client
+ ->setIndex($collectionName)
+ ->setMethod(self::METHOD_POST)
+ ->refresh();
+ }
private function extractIdValue($data)
{ | Update ElasticsearchAdapter with refresh method | g4code_data-mapper | train | php |
35a22df316ee0f149d3d4aa3be0535ab3e841644 | diff --git a/test/fetch-https.test.js b/test/fetch-https.test.js
index <HASH>..<HASH> 100644
--- a/test/fetch-https.test.js
+++ b/test/fetch-https.test.js
@@ -15,10 +15,8 @@ describe('fetch: https', function () {
// This is a remote call which isn't great but it means we get a valid
// https certificate without having to pull any tricks.
this.timeout(2000);
- return fetch('https://api.reddit.com/r/javascript/about.json')
- .then(function (res) {
- assert.equal(200, res.statusCode);
- });
+ return fetch('https://api.reddit.com/user/ageitgey/about.json')
+ .json();
});
it('fails with self-signed https', function () { | test: Use smaller reddit endpoint | groupon_gofer | train | js |
716dd16327dc3c159a5178bfdee88733916f4359 | diff --git a/lib/accesslib.php b/lib/accesslib.php
index <HASH>..<HASH> 100755
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -2541,6 +2541,9 @@ function create_role($name, $shortname, $description, $legacy='') {
//find free sortorder number
$role->sortorder = $DB->get_field('role', 'MAX(sortorder) + 1', array());
+ if (empty($role->sortorder)) {
+ $role->sortorder = 1;
+ }
$id = $DB->insert_record('role', $role);
if (!$id) {
@@ -4138,12 +4141,12 @@ function allow_override($sroleid, $troleid) {
* @param int troleid - target roleid
* @return int - id or false
*/
-function allow_assign($sroleid, $troleid) {
+function allow_assign($fromroleid, $targetroleid) {
global $DB;
$record = new object;
- $record->roleid = $sroleid;
- $record->allowassign = $troleid;
+ $record->roleid = $fromroleid;
+ $record->allowassign = $targetroleid;
return $DB->insert_record('role_allow_assign', $record);
} | install / accesslib: Fix install problem | moodle_moodle | train | php |
6fa5c036be6c926cdaaaf58070398186a5fae06f | diff --git a/tests/test_menu_launcher.py b/tests/test_menu_launcher.py
index <HASH>..<HASH> 100644
--- a/tests/test_menu_launcher.py
+++ b/tests/test_menu_launcher.py
@@ -33,9 +33,22 @@ def test_run_plugins():
menu_launcher.run_plugins(path_dirs, "start")
menu_launcher.run_plugins(invalid_dirs, "start")
+ ### Core Test ###
+ # Check if modes.template has core as a namespace
+ config = ConfigParser.RawConfigParser()
+ config.read(path_dirs.template_dir+'modes.template')
+ if config.has_section("plugins"):
+ config.set("plugins", "core", "all")
+
+ with open(path_dirs.template_dir+'modes.template', 'w') as f:
+ config.write(f)
+
+ menu_launcher.run_plugins(path_dirs, "start")
+
+
+
### Visualization Test ###
# Find modes.template
- os.system("touch "+path_dirs.template_dir+'modes.template')
config = ConfigParser.RawConfigParser()
config.read(path_dirs.template_dir+'modes.template') | Adding core to modes.template to trigger lines <I>-<I> | CyberReboot_vent | train | py |
cf99c8be78480d5140ef1c04a4c91f122dd061b4 | diff --git a/src/Phinx/Db/Adapter/PostgresAdapter.php b/src/Phinx/Db/Adapter/PostgresAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Phinx/Db/Adapter/PostgresAdapter.php
+++ b/src/Phinx/Db/Adapter/PostgresAdapter.php
@@ -913,7 +913,7 @@ class PostgresAdapter extends PdoAdapter implements AdapterInterface
{
$buffer = array();
if ($column->isIdentity()) {
- $buffer[] = 'SERIAL';
+ $buffer[] = $column->getType() == 'biginteger' ? 'BIGSERIAL' : 'SERIAL';
} else {
$sqlType = $this->getSqlType($column->getType(), $column->getLimit());
$buffer[] = strtoupper($sqlType['name']); | support BIGSERIAL for postgres pks | cakephp_phinx | train | php |
9402f6627f69d14ee7ae01aac6a688b0aac35e25 | diff --git a/cake/tests/lib/templates/simpletest.php b/cake/tests/lib/templates/simpletest.php
index <HASH>..<HASH> 100644
--- a/cake/tests/lib/templates/simpletest.php
+++ b/cake/tests/lib/templates/simpletest.php
@@ -27,6 +27,7 @@
<li><?php echo CAKE; ?>vendors </li>
<li><?php echo APP_DIR . DS; ?>vendors</li>
</ul>
+ <p>Changes made in SimpleTest v1.1 are incompatible with CakePHP. Please ensure you download SimpleTest v1.0.x</p>
<p><a href="http://simpletest.org/en/download.html" target="_blank">Download SimpleTest</a></p>
</div>
<?php include dirname(__FILE__) . DS . 'footer.php'; ?>
\ No newline at end of file | Added notice about SimpleTest compatability.
Fixes #<I>. | cakephp_cakephp | train | php |
b0f1be170b4948564d8e5349d889e1d972708a1b | diff --git a/lib/TextBox.js b/lib/TextBox.js
index <HASH>..<HASH> 100644
--- a/lib/TextBox.js
+++ b/lib/TextBox.js
@@ -130,7 +130,9 @@ TextBox.prototype.create = function(bounds, style, value, options) {
}, parentStyle);
var contentStyle = pick(style, [
+ 'fontFamily',
'fontSize',
+ 'fontWeight',
'lineHeight',
'padding',
'paddingTop', | feat(text-box): accept font family and font weight styles | bpmn-io_diagram-js-direct-editing | train | js |
5a8bf80615775d211c679040009439ce08f03e09 | diff --git a/generators/client/templates/gulpfile.js b/generators/client/templates/gulpfile.js
index <HASH>..<HASH> 100644
--- a/generators/client/templates/gulpfile.js
+++ b/generators/client/templates/gulpfile.js
@@ -23,7 +23,8 @@ var gulp = require('gulp'),<% if(useSass) { %>
changed = require('gulp-changed'),
gulpIf = require('gulp-if'),
inject = require('gulp-inject'),
- angularFilesort = require('gulp-angular-filesort');
+ angularFilesort = require('gulp-angular-filesort'),
+ bowerFiles = require('main-bower-files');
var handleErrors = require('./gulp/handleErrors'),
serve = require('./gulp/serve'), | included bower Files Main dependancy | jhipster_generator-jhipster | train | js |
208f1dc0cca2f6fed4cb09cc7031b69c32d3cebc | diff --git a/lib/hey/pubsub/payload.rb b/lib/hey/pubsub/payload.rb
index <HASH>..<HASH> 100644
--- a/lib/hey/pubsub/payload.rb
+++ b/lib/hey/pubsub/payload.rb
@@ -26,7 +26,7 @@ class Hey::Pubsub::Payload
def sanitize_value!(value)
Hey::ThreadCargo.sanitizable_values.each do |sanitizable_value|
- value = value.gsub(sanitizable_value, "")
+ value = value.to_s.gsub(sanitizable_value, "")
end
value
end | Cast to string before replacing substring. | ShippingEasy_hey-pubsub | train | rb |
0905a4b8dad4145ff022d655d4ff65fd8efd0715 | diff --git a/src/OAuth2/TokenType/Bearer.php b/src/OAuth2/TokenType/Bearer.php
index <HASH>..<HASH> 100644
--- a/src/OAuth2/TokenType/Bearer.php
+++ b/src/OAuth2/TokenType/Bearer.php
@@ -76,6 +76,7 @@ class OAuth2_TokenType_Bearer implements OAuth2_TokenTypeInterface, OAuth2_Respo
if ($request->server('CONTENT_TYPE') !== null && $request->server('CONTENT_TYPE') != 'application/x-www-form-urlencoded') {
// IETF specifies content-type. NB: Not all webservers populate this _SERVER variable
+ // @see http://tools.ietf.org/html/rfc6750#section-2.2
$this->response = new OAuth2_Response_Error(400, 'invalid_request', 'The content type for POST requests must be "application/x-www-form-urlencoded"');
return null;
} | links to docs for error message | bshaffer_oauth2-server-php | train | php |
52457dee3525d5b3aaaebb382b107831556f9d80 | diff --git a/phoebe/backend/universe.py b/phoebe/backend/universe.py
index <HASH>..<HASH> 100644
--- a/phoebe/backend/universe.py
+++ b/phoebe/backend/universe.py
@@ -1533,6 +1533,9 @@ class Star(Body):
"""
# is aligned, spin should be (0,1,0). Since spin must have length 1,
# we can just check the y-direction
+ if self._is_single:
+ return False
+
return self.spin[1] != 1.0
@property | fix misaligned check for single stars
the spin vector check doesn't make sense for a single star since we're no longer in "roche" coordinates. Instead, for single stars to be considered aligned. Should fix test_single nosetest | phoebe-project_phoebe2 | train | py |
a7e0a1560581e8b9530f9d8847a9e8cb551563bd | diff --git a/lib/ditty/controllers/component.rb b/lib/ditty/controllers/component.rb
index <HASH>..<HASH> 100644
--- a/lib/ditty/controllers/component.rb
+++ b/lib/ditty/controllers/component.rb
@@ -52,8 +52,8 @@ module Ditty
# Create
post '/' do
- authorize settings.model_class, :create
entity = settings.model_class.new(permitted_attributes(settings.model_class, :create))
+ authorize entity, :create
success = entity.valid? && entity.save
log_action("#{dehumanized}_create".to_sym) if success && settings.track_actions | fix: Authorize create on object, not class | EagerELK_ditty | train | rb |
6a9f2227a6d704f1c884890822ec26f4592427fb | diff --git a/src/main/java/io/github/bonigarcia/wdm/OperaDriverManager.java b/src/main/java/io/github/bonigarcia/wdm/OperaDriverManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/github/bonigarcia/wdm/OperaDriverManager.java
+++ b/src/main/java/io/github/bonigarcia/wdm/OperaDriverManager.java
@@ -76,7 +76,7 @@ public class OperaDriverManager extends WebDriverManager {
int i = 0;
File operadriver;
do {
- operadriver = listFiles[0];
+ operadriver = listFiles[i];
i++;
} while (!config().isExecutable(operadriver)
|| i >= listFiles.length); | Use incremental index to read opera driver extracted files | bonigarcia_webdrivermanager | train | java |
2ceadf4b2e3d4c0b89a540ed068aa3fc0ec6d7d6 | diff --git a/src/Formatter/FeatureDescription.php b/src/Formatter/FeatureDescription.php
index <HASH>..<HASH> 100644
--- a/src/Formatter/FeatureDescription.php
+++ b/src/Formatter/FeatureDescription.php
@@ -24,8 +24,15 @@ namespace KawaiiGherkin\Formatter;
*/
final class FeatureDescription extends AbstractFormatter
{
+ /**
+ * @param string $shortDescription
+ * @param array $descriptionLines
+ *
+ * @return string
+ */
public function format($shortDescription, array $descriptionLines)
{
+ // TODO: get keyword here, can't say `feature` hardcoded
$shortDesc = 'Feature: ' . $shortDescription . PHP_EOL;
$longDesc = implode(
array_map( | Add dock block and todo task | malukenho_kawaii-gherkin | train | php |
173cf8beab265242c71edbe18d5e01d84c14c79a | diff --git a/howler.js b/howler.js
index <HASH>..<HASH> 100644
--- a/howler.js
+++ b/howler.js
@@ -157,7 +157,7 @@
self._sprite = o.sprite || {};
self._src = o.src || '';
self._pos3d = o.pos3d || [0, 0, -0.5];
- self._volume = o.volume || 1;
+ self._volume = o.volume !== undefined ? o.volume : 1;
self._urls = o.urls || [];
self._rate = o.rate || 1; | Fix bug preventing volume from being set to 0 in a Howl defintion | goldfire_howler.js | train | js |
a35e3427181f46dcd75a3fb419a9ed45a8cdb963 | diff --git a/lib/merb-core/controller/mixins/controller.rb b/lib/merb-core/controller/mixins/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core/controller/mixins/controller.rb
+++ b/lib/merb-core/controller/mixins/controller.rb
@@ -102,7 +102,7 @@ module Merb
def redirect(url)
Merb.logger.info("Redirecting to: #{url}")
- set_status(302)
+ self.status = 302
headers['Location'] = url
"<html><body>You are being <a href=\"#{url}\">redirected</a>.</body></html>"
end
@@ -214,5 +214,18 @@ module Merb
}
)
end
+
+ # Escapes the string representation of +obj+ and escapes
+ # it for use in XML.
+ #
+ # ==== Parameter
+ #
+ # +obj+ - The object to escape for use in XML.
+ #
+ def escape_xml(obj)
+ obj.to_s.gsub(/[&<>"']/) { |s| Merb::Const::ESCAPE_TABLE[s] }
+ end
+ alias h escape_xml
+ alias html_escape escape_xml
end
end
\ No newline at end of file | add escape_xml as well as h and freinds | wycats_merb | train | rb |
706084f2e91754ae799b6fd5152235b7682cd9cc | diff --git a/src/org/jgroups/blocks/PullPushAdapter.java b/src/org/jgroups/blocks/PullPushAdapter.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/blocks/PullPushAdapter.java
+++ b/src/org/jgroups/blocks/PullPushAdapter.java
@@ -1,4 +1,4 @@
-// $Id: PullPushAdapter.java,v 1.11 2005/01/12 01:36:51 belaban Exp $
+// $Id: PullPushAdapter.java,v 1.12 2005/04/14 03:59:56 laran Exp $
package org.jgroups.blocks;
@@ -104,7 +104,7 @@ public class PullPushAdapter implements Runnable, ChannelListener {
* Sends a message to the group - listeners to this identifier will receive the messages
* @param identifier the key that the proper listeners are listenting on
* @param msg the Message to be sent
- * @see registerListener
+ * @see #registerListener
*/
public void send(Serializable identifier, Message msg) throws Exception {
if(msg == null) { | fixed javadoc on line <I> | belaban_JGroups | train | java |
e1e35f05b5fa275d1dbcb9bec1d34b9ef93954e6 | diff --git a/src/widgets/panel/panel.js b/src/widgets/panel/panel.js
index <HASH>..<HASH> 100644
--- a/src/widgets/panel/panel.js
+++ b/src/widgets/panel/panel.js
@@ -410,7 +410,7 @@
pin () {
- if ( this._isPinned ) return;
+ if ( this.isLocked () || this._isPinned ) return;
this._isPinned = true;
@@ -434,7 +434,7 @@
unpin () {
- if ( !this._isOpen || !this._isPinned ) return;
+ if ( this.isLocked () || !this._isOpen || !this._isPinned ) return;
this._isPinned = false; | Panel: improved support for fast pinning/closing | svelto_svelto | train | js |
e6d82585214acee7e094dba19b46441d266ec7c6 | diff --git a/index.php b/index.php
index <HASH>..<HASH> 100644
--- a/index.php
+++ b/index.php
@@ -31,7 +31,7 @@
} else {
$currlang = current_language();
$langs = get_list_of_languages();
- $langmenu = popup_form ("$CFG->wwwroot/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
+ $langmenu = popup_form ("$CFG->wwwroot/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
print_header(strip_tags($site->fullname), "$site->fullname", "home", "", | A fix to help some misconfigured sites (without DirectoryIndex) | moodle_moodle | train | php |
936a9f0a1490441ea5d9e46651811b6c21ba556f | diff --git a/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java b/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java
index <HASH>..<HASH> 100644
--- a/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java
+++ b/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java
@@ -522,7 +522,7 @@ implements ShutdownListener {
// Otherwise, replay the previous matched capture.
// This chain is unlikely to go past one previous capture, but is possible
if (isSelfRedirect(httpHeadersResource, closest, wbRequest, requestURL)) {
- throw new ResourceNotInArchiveException("Self Redirect");
+ throw new ResourceNotAvailableException("Skipping Self Redirect", closest.getFile());
}
// Redirect to url for the actual closest capture | FIX: Throw correct exception in case of self-redirect to find the next capture! | iipc_openwayback | train | java |
43146cd4c35e55380add053d13dea769647352d4 | diff --git a/tests/framework/helpers/VarDumperTest.php b/tests/framework/helpers/VarDumperTest.php
index <HASH>..<HASH> 100644
--- a/tests/framework/helpers/VarDumperTest.php
+++ b/tests/framework/helpers/VarDumperTest.php
@@ -89,6 +89,26 @@ RESULT;
RESULT;
$data[] = [$var, $expectedResult];
+ $var = [
+ 'key1' => [
+ 'subkey1' => 'value2',
+ ],
+ 'key2' => [
+ 'subkey2' => 'value3',
+ ],
+ ];
+ $expectedResult = <<<RESULT
+[
+ 'key1' => [
+ 'subkey1' => 'value2',
+ ],
+ 'key2' => [
+ 'subkey2' => 'value3',
+ ],
+]
+RESULT;
+ $data[] = [$var, $expectedResult];
+
// Objects :
$var = new \StdClass(); | added nested array test to vardumper
issue #<I> | yiisoft_yii-core | train | php |
b390d7c33fccf1d3787e2e49746c44b9a8bdaa8a | diff --git a/src/BoomCMS/Link/Link.php b/src/BoomCMS/Link/Link.php
index <HASH>..<HASH> 100644
--- a/src/BoomCMS/Link/Link.php
+++ b/src/BoomCMS/Link/Link.php
@@ -2,7 +2,7 @@
namespace BoomCMS\Link;
-use Illuminate\Support\Facades\Request;
+use BoomCMS\Support\Helpers\URL;
abstract class Link
{
@@ -13,7 +13,7 @@ abstract class Link
public static function factory($link)
{
- $link = preg_replace('|^https?://'.Request::getHttpHost().'|', '', $link);
+ $link = URL::makeRelative($link);
if (is_int($link) || ctype_digit($link) || substr($link, 0, 1) == '/') {
$internal = new Internal($link); | Removed duplication of making URL relative in Link factory | boomcms_boom-core | train | php |
8cce2ad27dfc18ffd93c0daad20d759c67aaa054 | diff --git a/velbus/messages/meteo_raw.py b/velbus/messages/meteo_raw.py
index <HASH>..<HASH> 100644
--- a/velbus/messages/meteo_raw.py
+++ b/velbus/messages/meteo_raw.py
@@ -20,11 +20,6 @@ class MeteoRawMessage(Message):
self.light = 0
self.wind = 0
- def getCurTemp(self):
- #FIXME: self.cur does not exist
- #return self.cur
- pass
-
def populate(self, priority, address, rtr, data):
"""
data bytes (high + low) | getCurTemp not applicable with meteoRawMessage (FIXME) | thomasdelaet_python-velbus | train | py |
f23eeccd1c8c850bf09a6940e7dc359b99d49c2d | diff --git a/centinel/__init__.py b/centinel/__init__.py
index <HASH>..<HASH> 100644
--- a/centinel/__init__.py
+++ b/centinel/__init__.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
__title__ = 'centinel'
-__version__ = '0.1.5.5'
+__version__ = '0.1.5.5.1'
import centinel.backend
import centinel.client
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ online information controls, and Internet censorship."""
setup(
name="centinel",
- version="0.1.5.5",
+ version="0.1.5.5.1",
author="ICLab Developers",
author_email="info@iclab.org",
description=DESCRIPTION, | bumped version to <I> | iclab_centinel | train | py,py |
be5ca8a1bbd62a137dc2bd9c7e9ee0f6ace634e8 | diff --git a/src/config/config.php b/src/config/config.php
index <HASH>..<HASH> 100644
--- a/src/config/config.php
+++ b/src/config/config.php
@@ -50,6 +50,11 @@ return [
'compression' => false,
'compressionType' => 'gzip',
],
+
+ 'client' => [
+ 'http_errors' => true,
+ 'verify' => false,
+ ],
/*
* Where do you want to store access tokens fetched from Salesforce | Update config.php (#<I>)
Add ability to edit guzzle client settings. | omniphx_forrest | train | php |
37960b2f939249bb27a652b38b0c2d887345a3d1 | diff --git a/webpack/prod.config.js b/webpack/prod.config.js
index <HASH>..<HASH> 100755
--- a/webpack/prod.config.js
+++ b/webpack/prod.config.js
@@ -39,7 +39,7 @@ module.exports = {
// css files from the extract-text-plugin loader
new ExtractTextPlugin('[name]-[chunkhash].css'),
- new webpack.DefinePlugin({__CLIENT__: true, __SERVER__: false}),
+ new webpack.DefinePlugin({__CLIENT__: true, __SERVER__: false, __DEVELOPMENT__: false, __DEVTOOLS__: false}),
// ignore dev config
new webpack.IgnorePlugin(/\.\/dev/, /\/config$/), | add __DEVELOPMENT__ and __DEVTOOLS__ global variables in production webpack config | bdefore_universal-redux | train | js |
0337175cb314a66cb55184b6a504a53d59537f4a | diff --git a/samples/missioners.py b/samples/missioners.py
index <HASH>..<HASH> 100644
--- a/samples/missioners.py
+++ b/samples/missioners.py
@@ -74,8 +74,8 @@ result = breadth_first_search(problem)
#result = astar_search(problem)
#result = astar_search(problem, graph_search=True)
-#result = beam_search(problem, beam_size=10)
-#result = beam_search(problem, beam_size=10, graph_search=True)
+#result = beam_search(problem, beam_size=5)
+#result = beam_search(problem, beam_size=5, graph_search=True)
#result = hill_climbing(problem)
#result = hill_climbing(problem, graph_search=True) | Reduced the beam size for missioners | simpleai-team_simpleai | train | py |
ddaa094d34cf2cc84e1a4400ff954d0261e81bd4 | diff --git a/tests/flags.js b/tests/flags.js
index <HASH>..<HASH> 100644
--- a/tests/flags.js
+++ b/tests/flags.js
@@ -2,6 +2,7 @@
const assert = require("assert");
const shell = require("shelljs");
+const spawn = require("cross-spawn");
const fs = require("fs-extra");
const xml2js = require("xml2js");
const readline = require("readline");
@@ -171,9 +172,10 @@ describe("flags", () => {
describe("--watch", () => {
it("Should re-run tests if a test file is touched", done => {
- const child = shell.exec(
- "elm-test --report=json --watch tests/OnePassing.elm",
- { silent: true, async: true }
+ const child = spawn(
+ "elm-test",
+ ["--report=json", "--watch", "tests/OnePassing.elm"],
+ { silent: true }
);
let hasRetriggered = false; | Use cross-spawn over shell.exec | rtfeldman_node-test-runner | train | js |
08ba4b0f84eb3418620b9d277a0d85ab06d5a436 | diff --git a/clock.py b/clock.py
index <HASH>..<HASH> 100644
--- a/clock.py
+++ b/clock.py
@@ -59,7 +59,7 @@ def check_email():
hash = hashlib.sha256(signature.encode('utf-8')).hexdigest()
- if user_to in u.to or user_to in u.headers.get('Cc'):
+ if user_to in u.to or user_to in u.headers.get('Cc', []):
job_id = conn.get(hash) | Handle emails with no Cc headers | amperser_proselint | train | py |
168505a95cc398d087e3f793600c7352d6e02c9e | diff --git a/test/unit/query-param.test.js b/test/unit/query-param.test.js
index <HASH>..<HASH> 100644
--- a/test/unit/query-param.test.js
+++ b/test/unit/query-param.test.js
@@ -80,6 +80,34 @@ describe('QueryParam', function () {
it('should bail out of the provided set of params is falsy', function () {
expect(QueryParam.unparse()).to.be('');
});
+
+ it('should set value as empty for null and drop undefined', function () {
+ var queryParams = [{
+ key: 'foo',
+ value: 'foo'
+ }, {
+ key: 'bar',
+ value: null
+ }, {
+ key: 'baz',
+ value: undefined
+ }];
+
+ // if query param value is undefined the param is not appeneded
+ // but the trailing ampersand is not removed
+ // this is the current behaviour
+ expect(QueryParam.unparse(queryParams)).to.equal('foo=foo&bar&');
+
+ });
+
+ it('should set value as empty for null and drop undefined when unparsing object format', function () {
+ expect(QueryParam.unparse({ foo: 'foo', bar: null, baz: undefined }))
+
+ // if query param value is undefined the param is not appeneded
+ // but the trailing ampersand is not removed
+ // this is the current behaviour
+ .to.equal('foo=foo&bar&');
+ });
});
describe('.unparseSingle', function () { | Added tests for unparse with null and undefined values | postmanlabs_postman-collection | train | js |
ccf79a41611249329f80214cf145c82e29fdf99c | diff --git a/h2o-core/src/main/java/water/ExtensionManager.java b/h2o-core/src/main/java/water/ExtensionManager.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/ExtensionManager.java
+++ b/h2o-core/src/main/java/water/ExtensionManager.java
@@ -161,7 +161,8 @@ public class ExtensionManager {
restApiExtensions.put(r.getName(), r);
}
} catch (Exception e) {
- Log.info("Cannot register extension: " + r + ". Skipping it...");
+ Log.err(e);
+ Log.err("Cannot register extension: " + r + ". Skipping it...");
}
} | [CORE] log exception when a REST API extension fails to register | h2oai_h2o-3 | train | java |
dd3a6f7a6c4cd3ae157667b9ad2dc31955648224 | diff --git a/lxd/db/cluster/projects.go b/lxd/db/cluster/projects.go
index <HASH>..<HASH> 100644
--- a/lxd/db/cluster/projects.go
+++ b/lxd/db/cluster/projects.go
@@ -59,7 +59,7 @@ func (p *Project) ToAPI(ctx context.Context, tx *sql.Tx) (*api.Project, error) {
var err error
apiProject.Config, err = GetProjectConfig(ctx, tx, p.ID)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("Failed loading project config: %w", err)
}
return apiProject, nil | lxd/db/cluster/projects: Improve error in ToAPI | lxc_lxd | train | go |
7a1b02b5aad62bdd996d877d94c3fcfc67eada2b | diff --git a/python/vaex/dataset.py b/python/vaex/dataset.py
index <HASH>..<HASH> 100644
--- a/python/vaex/dataset.py
+++ b/python/vaex/dataset.py
@@ -3328,10 +3328,11 @@ class DatasetAstropyTable(DatasetArrays):
self.ucds[clean_name] = column._meta["ucd"]
if column.description:
self.descriptions[clean_name] = column.description
- if type.kind in ["f"]:
- masked_array.data[masked_array.mask] = np.nan
- if type.kind in ["i"]:
- masked_array.data[masked_array.mask] = 0
+ if hasattr(masked_array, "mask")
+ if type.kind in ["f"]:
+ masked_array.data[masked_array.mask] = np.nan
+ if type.kind in ["i"]:
+ masked_array.data[masked_array.mask] = 0
self.add_column(clean_name, self.table[name].data)
if type.kind in ["S"]:
self.add_column(clean_name, self.table[name].data) | not always is an array a masked array.. | vaexio_vaex | train | py |
bff279d507fc6b7a5a5f25f57eaff8941ab121c8 | diff --git a/jetserver/src/main/java/org/menacheri/server/netty/NettyTCPServer.java b/jetserver/src/main/java/org/menacheri/server/netty/NettyTCPServer.java
index <HASH>..<HASH> 100644
--- a/jetserver/src/main/java/org/menacheri/server/netty/NettyTCPServer.java
+++ b/jetserver/src/main/java/org/menacheri/server/netty/NettyTCPServer.java
@@ -36,12 +36,14 @@ public class NettyTCPServer extends NettyServer
super(portNumber, serverBootstrap, pipelineFactory, gameAdminService);
}
+ @Override
public void startServer(int port)
{
portNumber = port;
startServer(null);
}
+ @Override
public void startServer()
{
startServer(null); | Added override annotations. | menacher_java-game-server | train | java |
3ce2c3e2e41e3890487d564035580bab338011d6 | diff --git a/salt/modules/tls.py b/salt/modules/tls.py
index <HASH>..<HASH> 100644
--- a/salt/modules/tls.py
+++ b/salt/modules/tls.py
@@ -1642,7 +1642,7 @@ def cert_info(cert, digest='sha256'):
try:
ext = cert.get_extension(i)
key = salt.utils.stringutils.to_unicode(ext.get_short_name())
- ret['extensions'][key] = str(ext)
+ ret['extensions'][key] = str(ext).strip()
except AttributeError:
continue | tls.cert_info: strip newlines/spaces from extensions | saltstack_salt | train | py |
9fbe9176cc736be33e76baeb8d6a45acb8439d5b | diff --git a/src/Finder.php b/src/Finder.php
index <HASH>..<HASH> 100644
--- a/src/Finder.php
+++ b/src/Finder.php
@@ -18,7 +18,9 @@ use League\Flysystem\PluginInterface;
use Flyfinder\Specification\SpecificationInterface;
/**
- * Flysystem plugin to add file finding capabilities to the filesystem entity
+ * Flysystem plugin to add file finding capabilities to the filesystem entity.
+ *
+ * Note that found *directories* are **not** returned... only found *files*.
*/
class Finder implements PluginInterface
{
@@ -49,19 +51,29 @@ class Finder implements PluginInterface
/**
* Find the specified files
*
+ * Note that only found *files* are yielded at this level,
+ * which go back to the caller.
+ *
* @param SpecificationInterface $specification
* @return Generator
*/
public function handle(SpecificationInterface $specification)
{
foreach ($this->yieldFilesInPath($specification, '') as $path) {
- yield $path;
+ if (isset($path['type']) && $path['type'] === 'file') {
+ yield $path;
+ }
}
}
/**
* Recursively yield files that meet the specification
*
+ * Note that directories are also yielded at this level,
+ * since they have to be recursed into. Yielded directories
+ * will not make their way back to the caller, as they are filtered out
+ * by {@link handle()}.
+ *
* @param SpecificationInterface $specification
* @param string $path
* @return Generator | only yield found files, not directories; | phpDocumentor_FlyFinder | train | php |
4f7881ba4014c305e021f99c12a1f458a005f06d | diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/commands/serve.rb
+++ b/lib/jekyll/commands/serve.rb
@@ -11,6 +11,7 @@ module Jekyll
mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
mime_types.store 'js', 'application/javascript'
+ mime_types.store 'svg', 'image/svg+xml'
s = HTTPServer.new(
:Port => options['port'], | Add SVG support to Jekyll/Webrick. Fixes #<I>. | jekyll_jekyll | train | rb |
b5fcebaa806343d0bc01d23f4cc48afaca00e967 | diff --git a/packages/reactotron-app/App/Stores/UiStore.js b/packages/reactotron-app/App/Stores/UiStore.js
index <HASH>..<HASH> 100644
--- a/packages/reactotron-app/App/Stores/UiStore.js
+++ b/packages/reactotron-app/App/Stores/UiStore.js
@@ -121,6 +121,7 @@ class UI {
this.isTimelineSearchVisible = false
}
+ @action
showTimelineSearch = () => {
this.isTimelineSearchVisible = false // hack to ensure the reaction on the timeline header works (sheesh.)
this.isTimelineSearchVisible = true
@@ -128,6 +129,15 @@ class UI {
}
@action
+ toggleTimelineSearch = () => {
+ if (this.isTimelineSearchVisible) {
+ this.hideTimelineSearch()
+ } else {
+ this.showTimelineSearch()
+ }
+ }
+
+ @action
switchTab = newTab => {
this.tab = newTab
} | 🐛 Allows the search icon toggle to work | infinitered_reactotron | train | js |
62272d11f75ab6c297ff7b037c664763e110f963 | diff --git a/plenum/config.py b/plenum/config.py
index <HASH>..<HASH> 100644
--- a/plenum/config.py
+++ b/plenum/config.py
@@ -46,7 +46,7 @@ seqNoDbName = 'seq_no_db'
clientBootStrategy = ClientBootStrategy.PoolTxn
hashStore = {
- "type": HS_FILE
+ "type": HS_ROCKSDB
}
primaryStorage = None | Revert hash store to RocksDB | hyperledger_indy-plenum | train | py |
4d40ed5ea3e0ff79264861d1ffbedbc5c01e3de5 | diff --git a/noxfile.py b/noxfile.py
index <HASH>..<HASH> 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -55,7 +55,7 @@ def docs(session, batch_run: bool = False):
"""Build the documentation or serve documentation interactively."""
shutil.rmtree(Path("docs").joinpath("_build"), ignore_errors=True)
session.install("-r", "docs/requirements.txt")
- session.install(".")
+ session.install("-e", ".")
session.cd("docs")
sphinx_args = ["-b", "html", "-W", ".", "_build/html"]
@@ -69,7 +69,13 @@ def docs(session, batch_run: bool = False):
"--port",
"9812",
"--watch",
- "../",
+ "../*.md",
+ "--watch",
+ "../*.rst",
+ "--watch",
+ "../*.py",
+ "--watch",
+ "../cookiecutter",
]
) | Update list of directories for looking for files changes in interactive documentation build | audreyr_cookiecutter | train | py |
4b87c4f60895c9d2dea2becd6a58c3d3167dd0e1 | diff --git a/tchannel/sync/client.py b/tchannel/sync/client.py
index <HASH>..<HASH> 100644
--- a/tchannel/sync/client.py
+++ b/tchannel/sync/client.py
@@ -21,13 +21,14 @@
from __future__ import absolute_import
from collections import namedtuple
+from concurrent.futures import TimeoutError
from threadloop import ThreadLoop
from tornado import gen
from tchannel import glossary
from tchannel import tornado as async
-from tchannel.tornado.hyperbahn import FIRST_ADVERTISE_TIME
+from tchannel.tornado.hyperbahn import FIRST_ADVERTISE_TIME, AdvertiseError
class TChannelSyncClient(object):
@@ -107,14 +108,20 @@ class TChannelSyncClient(object):
future = self.threadloop.submit(make_request)
- # we're going to wait 10% longer, or at max 1s,
- # so advertise has a chance to timeout by itself
+ # we're going to wait 1s longer than advertises
+ # timeout mechanism, so it has a chance to timeout
wait_until = timeout or FIRST_ADVERTISE_TIME
wait_until += 1
# block for advertise's first response,
# using wait_until as a fallback timeout mechanism
- result = future.result(wait_until)
+ try:
+ result = future.result(wait_until)
+ except TimeoutError:
+ raise AdvertiseError(
+ "Failed to register with Hyperbahn "
+ "(advertise did not timeout in time)"
+ )
return result | only ever throw AdvertiseError when unable to advertise from sync client | uber_tchannel-python | train | py |
5098c23e8b5c269eb26a81144051c421d4846b87 | diff --git a/lib/errors.js b/lib/errors.js
index <HASH>..<HASH> 100644
--- a/lib/errors.js
+++ b/lib/errors.js
@@ -86,7 +86,7 @@ module.exports = function(server, handler) {
// Attach 404s
server.use(function(req, res, next) {
if (!isErrorCode(res.statusCode)) res.status(404);
- next(new Error("Not Found"));
+ next(new Error("Not Found: " + req.url));
});
// Attach error and render | Include url in <I> errors | shippjs_shipp-server | train | js |
eb67886e9f1f0c115048cf8c1ec1f202974968b8 | diff --git a/js/core/Component.js b/js/core/Component.js
index <HASH>..<HASH> 100644
--- a/js/core/Component.js
+++ b/js/core/Component.js
@@ -532,6 +532,8 @@ define(["require", "js/core/Element", "js/core/TextElement", "js/core/Bindable",
/***
* Converts all child nodes of a descriptor to instances of Components or TextElement
* @param descriptor
+ * @param attributes
+ * @param rootScope
*/
_getChildrenFromDescriptor: function (descriptor, rootScope, attributes) {
var childrenFromDescriptor = [], node, component; | fixed jsdoc for Component | rappid_rAppid.js | train | js |
9d593eeca54dbfb5def7ee526050ba9580d4085b | diff --git a/raven/transport/base.py b/raven/transport/base.py
index <HASH>..<HASH> 100644
--- a/raven/transport/base.py
+++ b/raven/transport/base.py
@@ -282,7 +282,7 @@ class GeventedHTTPTransport(AsyncTransport, HTTPTransport):
if greenlet.successful():
success_cb()
else:
- failure_cb(greenlet.value)
+ failure_cb(greenlet.exception)
class TwistedHTTPTransport(AsyncTransport, HTTPTransport): | pass exception, not the value on failure | getsentry_raven-python | train | py |
93e956a919ac3d021c66f595514a4c38e6d0c29e | diff --git a/src/System/Query.php b/src/System/Query.php
index <HASH>..<HASH> 100755
--- a/src/System/Query.php
+++ b/src/System/Query.php
@@ -792,8 +792,6 @@ class Query {
$proxies = [];
- $proxyLoaded = false;
-
foreach($results as $result)
{
$instance = clone $prototype;
@@ -805,17 +803,11 @@ class Query {
// Hydrate any embedded Value Object
$this->hydrateValueObjects($resultArray);
- // We need to set the proxy for lazy loading on
- // the first hydration pass only, as they will be duplicated
- // at next pass when cloning instance.
- if (! $proxyLoaded)
- {
- $instance->setEntityAttributes($resultArray);
- $proxies = $this->getLazyLoadingProxies($instance);
- $instance->setEntityAttributes($resultArray + $proxies);
- $proxyLoaded = true;
- }
- else
+ $instance->setEntityAttributes($resultArray);
+
+ $proxies = $this->getLazyLoadingProxies($instance);
+
+ if (count($proxies) > 0)
{
$instance->setEntityAttributes($resultArray + $proxies);
} | Fix bug with Lazy Loading in Entity Collections | analogueorm_analogue | train | php |
9b612a25b0c59ab2d88da06aa8d3e40837e11d7a | diff --git a/-util.js b/-util.js
index <HASH>..<HASH> 100644
--- a/-util.js
+++ b/-util.js
@@ -17,6 +17,9 @@ function wasNotInSet(item, set) {
function contains(parent, child){
+ if(child && child.nodeType === Node.TEXT_NODE) {
+ return contains(parent, child.parentNode);
+ }
if(parent.contains) {
return parent.contains(child);
} | Work around IE<I> contains() that does not recognize text nodes | canjs_can-dom-mutate | train | js |
f1b752842da56c4b6c8ed5e8e49e52da763adca6 | diff --git a/src/Repo/Def/Entity.php b/src/Repo/Def/Entity.php
index <HASH>..<HASH> 100644
--- a/src/Repo/Def/Entity.php
+++ b/src/Repo/Def/Entity.php
@@ -90,7 +90,16 @@ class Entity implements IEntity
/**
* @inheritdoc
*/
- public function update($data, $id)
+ public function update($data, $where)
+ {
+ $result = $this->_repoBasic->updateEntity($this->_entityName, $data, $where);
+ return $result;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function updateById($data, $id)
{
if (is_array($id)) {
/* probably this is complex PK */
diff --git a/src/Repo/IEntity.php b/src/Repo/IEntity.php
index <HASH>..<HASH> 100644
--- a/src/Repo/IEntity.php
+++ b/src/Repo/IEntity.php
@@ -54,13 +54,15 @@ interface IEntity
*/
public function getRef();
+ public function update($data, $where);
+
/**
- * Update instance in the DB.
+ * Update instance in the DB (look up by ID values).
*
* @param array|DataObject $data
* @param int|array $id
* @return int number of the rows affected
*/
- public function update($data, $id);
+ public function updateById($data, $id);
}
\ No newline at end of file | MOBI-<I> - Code review & tests in Odoo module (after REST API) | praxigento_mobi_mod_core | train | php,php |
7040bd5e933c2f318f091f25a2d143500b4b301c | diff --git a/src/Expose/FilterCollection.php b/src/Expose/FilterCollection.php
index <HASH>..<HASH> 100644
--- a/src/Expose/FilterCollection.php
+++ b/src/Expose/FilterCollection.php
@@ -60,11 +60,6 @@ class FilterCollection implements \ArrayAccess, \Iterator, \Countable
}
}
- // public function __construct()
- // {
- // $this->load();
- // }
-
public function load($path = null)
{
$loadFile = $this->filterPath; | removing constructor from FilterCollection | enygma_expose | train | php |
79bd5eaf88ba5053aaa3b6878a8218c83a66c5e1 | diff --git a/app/controllers/katello/api/v1/candlepin_proxies_controller.rb b/app/controllers/katello/api/v1/candlepin_proxies_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/katello/api/v1/candlepin_proxies_controller.rb
+++ b/app/controllers/katello/api/v1/candlepin_proxies_controller.rb
@@ -207,9 +207,11 @@ module Katello
#api :POST, "/environments/:environment_id/consumers", "Register a consumer in environment"
def consumer_create
- @system = System.create!(system_params.merge(:environment => @environment,
- :content_view => @content_view,
- :serviceLevel => params[:service_level]))
+ @system = System.new(system_params.merge(:environment => @environment,
+ :content_view => @content_view,
+ :serviceLevel => params[:service_level]))
+ sync_task(::Actions::Headpin::System::Create, @system)
+ @system.reload
render :json => Resources::Candlepin::Consumer.get(@system.uuid)
end | fixes #<I> - rhsm register though Dynflow | Katello_katello | train | rb |
22214610b3f786e701261d8402fc2fce97b1bb49 | diff --git a/tests/test_issues.py b/tests/test_issues.py
index <HASH>..<HASH> 100644
--- a/tests/test_issues.py
+++ b/tests/test_issues.py
@@ -249,7 +249,7 @@ class TestResolvedIssues(unittest.TestCase):
Check that when downloading hashtags, the downloader
actually stops.
"""
- looter = instaLooter.InstaLooter(self.tmpdir, hashtag="aliaime")
+ looter = instaLooter.InstaLooter(self.tmpdir, hashtag="oulianov")
postcount = looter.__length_hint__() # operator.length_hint
for i, m in enumerate(looter.medias()): | Use hashtag with lower post count in test_issue_<I> | althonos_InstaLooter | train | py |
1e65b8d621ce1e971762454f191f2dfc7c73ecce | diff --git a/src/Exporters/HLSExporter.php b/src/Exporters/HLSExporter.php
index <HASH>..<HASH> 100755
--- a/src/Exporters/HLSExporter.php
+++ b/src/Exporters/HLSExporter.php
@@ -269,10 +269,10 @@ class HLSExporter extends MediaExporter
if ($filtersCallback) {
$outs = $this->applyFiltersCallback($filtersCallback, $key);
}
+ $formatPlaylistOutput = $disk->makeMedia($formatPlaylistPath);
+ $this->addFormatOutputMapping($format, $formatPlaylistOutput, $outs ?? ['0']);
- $this->addFormatOutputMapping($format, $disk->makeMedia($formatPlaylistPath), $outs ?? ['0']);
-
- return $this->getDisk()->makeMedia($formatPlaylistPath);
+ return $formatPlaylistOutput;
})->tap(function () {
$this->addHandlerToRotateEncryptionKey();
}); | Issue with HLS not saving completely to S3 (#<I>) | pascalbaljetmedia_laravel-ffmpeg | train | php |
5ecc2f3d4e71bcade18aafd85aebcc8418f9c29b | diff --git a/pysat/tests/test_meta.py b/pysat/tests/test_meta.py
index <HASH>..<HASH> 100644
--- a/pysat/tests/test_meta.py
+++ b/pysat/tests/test_meta.py
@@ -1,3 +1,8 @@
+#!/usr/bin/env python
+# Full license can be found in License.md
+# Full author list can be found in .zenodo.json file
+# DOI:10.5281/zenodo.1199703
+# ----------------------------------------------------------------------------
"""
tests the pysat meta object and code
""" | DOC: added file header info
Added file header info. | rstoneback_pysat | train | py |
6ecd5904066f4fd9487e0223c5eb0006caf846e8 | diff --git a/utilities/service-utils.js b/utilities/service-utils.js
index <HASH>..<HASH> 100644
--- a/utilities/service-utils.js
+++ b/utilities/service-utils.js
@@ -25,7 +25,7 @@ ServiceUtils.prototype = {
for (var service in services) {
if (services[service].hasOwnProperty('credentials')) {
if(services[service].credentials.hasOwnProperty('url')){
- if(services[service].credentials.url.search(regex) == 0){
+ if(services[service].credentials.url.search(regex) === 0){
return true;
}
} | changing equivalence to === | watson-developer-cloud_node-red-node-watson | train | js |
360dc623588299e3571f0528940590f0b9f067b6 | diff --git a/lib/statsd/instrument.rb b/lib/statsd/instrument.rb
index <HASH>..<HASH> 100644
--- a/lib/statsd/instrument.rb
+++ b/lib/statsd/instrument.rb
@@ -6,9 +6,6 @@ module StatsD
end
self.enabled = true
- trap("TTOU") { self.enabled = false }
- trap("TTIN") { self.enabled = true }
-
# StatsD.server = 'localhost:1234'
def self.server=(conn)
self.host, port = conn.split(':')
diff --git a/test/statsd-instrument_test.rb b/test/statsd-instrument_test.rb
index <HASH>..<HASH> 100644
--- a/test/statsd-instrument_test.rb
+++ b/test/statsd-instrument_test.rb
@@ -131,18 +131,4 @@ class StatsDTest < Test::Unit::TestCase
StatsD.increment('fooz')
StatsD.enabled = true
end
-
- def test_receiving_TTOU_should_disable
- Process.kill("TTOU", $$)
- sleep 0.5
- assert !StatsD.enabled
- end
-
- def test_receiving_TTIN_should_disable
- StatsD.enabled = false
-
- Process.kill("TTIN", $$)
- sleep 0.5
- assert StatsD.enabled
- end
end | Removes signal trapping
This was for emergency backout purposes, no longer needed. | Shopify_statsd-instrument | train | rb,rb |
e54dbc16509109fa8bcc42ea0bc4d2b75c03411c | diff --git a/js/lib/prompts.js b/js/lib/prompts.js
index <HASH>..<HASH> 100644
--- a/js/lib/prompts.js
+++ b/js/lib/prompts.js
@@ -102,6 +102,10 @@ var that = {
process.stdout.write('\b \b');
}
}
+ else if (chunk[0] == 3) {
+ process.stdout.write("\nBreak!\n");
+ dfd.reject("break");
+ }
else if (chunk[0] != 13) {
arr.push(chunk);
process.stdout.write("*"); | allowing CTRL-C during password entry | particle-iot_particle-cli | train | js |
5021d16cea2b476382a8ccdac5d6746743b7569f | diff --git a/thefuck/ui.py b/thefuck/ui.py
index <HASH>..<HASH> 100644
--- a/thefuck/ui.py
+++ b/thefuck/ui.py
@@ -44,9 +44,9 @@ def read_actions():
buffer.append(ch)
buffer = buffer[-3:]
- if buffer == ['\x1b', '[', 'A']: # ↑
+ if buffer == ['\x1b', '[', 'A'] or ch == 'k': # ↑
yield PREVIOUS
- elif buffer == ['\x1b', '[', 'B']: # ↓
+ elif buffer == ['\x1b', '[', 'B'] or ch == 'j': # ↓
yield NEXT | Add j, k key for arrow action at read_actions | nvbn_thefuck | train | py |
0aa7bc5a11306cc5b3743b0b6aa01402f0a4393f | diff --git a/src/main/java/com/zaxxer/hikari/proxy/ProxyFactory.java b/src/main/java/com/zaxxer/hikari/proxy/ProxyFactory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/zaxxer/hikari/proxy/ProxyFactory.java
+++ b/src/main/java/com/zaxxer/hikari/proxy/ProxyFactory.java
@@ -30,7 +30,7 @@ import com.zaxxer.hikari.HikariPool;
*/
public final class ProxyFactory
{
- public static Connection getProxyConnection(HikariPool pool, Connection connection, int defaultIsolationLevels)
+ public static Connection getProxyConnection(HikariPool pool, Connection connection, int defaultIsolationLevel, boolean defaultAutoCommit)
{
// Body is injected by JavassistProxyFactory
return null; | Pass default auto commit state into constructor. | brettwooldridge_HikariCP | train | java |
cc1250f54d2898b542d226f5646d12378e2e4236 | diff --git a/ariadne/executable_schema.py b/ariadne/executable_schema.py
index <HASH>..<HASH> 100644
--- a/ariadne/executable_schema.py
+++ b/ariadne/executable_schema.py
@@ -31,7 +31,7 @@ def make_executable_schema(
if isinstance(bindable, list):
for obj in bindable:
obj.bind_to_schema(schema)
- elif bindable:
+ else:
bindable.bind_to_schema(schema)
set_default_enum_values_on_schema(schema) | Remove unnecessary test for bindable not being empty | mirumee_ariadne | train | py |
988cab414150b11ae802dd52725efd90c6f0a69f | diff --git a/lib/validation_scopes.rb b/lib/validation_scopes.rb
index <HASH>..<HASH> 100644
--- a/lib/validation_scopes.rb
+++ b/lib/validation_scopes.rb
@@ -14,23 +14,31 @@ module ValidationScopes
r.marked_for_destruction? || r.send("no_#{options[:scope]}?")
end
unless all_valid
- record.errors.add(attribute, :invalid, options.merge(:value => value))
+ record.errors.add(attribute, 'is invalid')
end
end
end
module ClassMethods
- def validation_scope(scope)
- @all_scopes ||= []
- @all_scopes << scope
+ def validation_scopes
+ @validation_scopes ||= []
+ end
- def self.all_scopes
- @all_scopes
- end
+ def validation_proxies
+ @validation_proxies ||= {}
+ end
+
+ def validation_scope(scope)
+ validation_scopes << scope
base_class = self
- proxy_class = Class.new(DelegateClass(base_class)) do
+ superclass = if self.superclass.validation_proxies[scope]
+ self.superclass.validation_proxies[scope]
+ else
+ DelegateClass(base_class)
+ end
+ proxy_class = Class.new(superclass) do
include ActiveModel::Validations
@scope = scope
@@ -57,6 +65,8 @@ module ValidationScopes
end
end
+ validation_proxies[scope] = proxy_class
+
yield proxy_class
define_method(scope) do | Made the validation scopes work with STI | gtd_validation_scopes | train | rb |
6a507be238e24c6c4f22531f81334f6aad74b645 | diff --git a/hazelcast-client/src/main/java/com/hazelcast/client/LifecycleServiceImpl.java b/hazelcast-client/src/main/java/com/hazelcast/client/LifecycleServiceImpl.java
index <HASH>..<HASH> 100644
--- a/hazelcast-client/src/main/java/com/hazelcast/client/LifecycleServiceImpl.java
+++ b/hazelcast-client/src/main/java/com/hazelcast/client/LifecycleServiceImpl.java
@@ -86,10 +86,12 @@ public final class LifecycleServiceImpl implements LifecycleService {
fireLifecycleEvent(STARTED);
}
+ @Override
public boolean isRunning() {
return active.get();
}
+ @Override
public void shutdown() {
if (!active.compareAndSet(true, false)) {
return;
@@ -100,6 +102,7 @@ public final class LifecycleServiceImpl implements LifecycleService {
fireLifecycleEvent(SHUTDOWN);
}
+ @Override
public void terminate() {
shutdown();
} | Added some @Overrides in LifecycleServiceImpl | hazelcast_hazelcast | train | java |
b9cf9a4be86e6306b4924a735d7b30f5b91e564f | diff --git a/plyfile.py b/plyfile.py
index <HASH>..<HASH> 100644
--- a/plyfile.py
+++ b/plyfile.py
@@ -570,6 +570,8 @@ class PlyProperty(object):
return self._name
def _set_name(self, name):
+ name = str(name)
+
if any(c.isspace() for c in name):
msg = "Error: property name %r contains spaces" % name
raise RuntimeError(msg) | Explicitly convert property names to str
This is necessary for Python 2. | dranjan_python-plyfile | train | py |
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.