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 |
|---|---|---|---|---|---|
d98971b9e7cab9bd9b2024036fd89cbd78159993 | diff --git a/src/ploneintranet/workspace/workspacecontainer.py b/src/ploneintranet/workspace/workspacecontainer.py
index <HASH>..<HASH> 100644
--- a/src/ploneintranet/workspace/workspacecontainer.py
+++ b/src/ploneintranet/workspace/workspacecontainer.py
@@ -15,3 +15,12 @@ class WorkspaceContainer(Container):
A folder to contain WorkspaceFolders
"""
grok.implements(IWorkspaceContainer)
+
+try:
+ from ploneintranet.attachments.attachments import IAttachmentStoragable
+except ImportError:
+ IAttachmentStoragable = None
+
+if IAttachmentStoragable is not None:
+ from zope import interface
+ interface.classImplements(WorkspaceContainer, IAttachmentStoragable) | also allow temporary attachments on WorkspaceContainer | ploneintranet_ploneintranet.workspace | train | py |
8d9809ddd173bb3c2d87d57a12b066c8d264a183 | diff --git a/lib/houston/roadmaps/railtie.rb b/lib/houston/roadmaps/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/houston/roadmaps/railtie.rb
+++ b/lib/houston/roadmaps/railtie.rb
@@ -1,4 +1,3 @@
-require "houston/tickets"
require "houston/roadmaps/milestone_ext"
require "houston/roadmaps/project_ext"
require "houston/roadmaps/team_ext" | [skip] Removed require of houston/tickets (1m)
It caused errors here | houston_houston-roadmaps | train | rb |
afe47d5efc5ec3e09eea9d9f6305bde14e984e19 | diff --git a/lib/base_controller.js b/lib/base_controller.js
index <HASH>..<HASH> 100644
--- a/lib/base_controller.js
+++ b/lib/base_controller.js
@@ -629,6 +629,14 @@ controller.BaseController.prototype = new (function () {
callback(content);
});
+ // Mix in controller instance-vars -- don't overwrite
+ // data properties, and don't use inherited props
+ for (var p in this) {
+ if (this.hasOwnProperty(p) && !data[p]) {
+ data[p] = this[p];
+ }
+ };
+
templater.render(data, {
layout: this.layout
, template: this.template | Mix controller instance-vars into view-data | mde_ejs | train | js |
2b5bb2fa881b1ada3835307b43263b76f6abc6db | diff --git a/app/search_builders/hyrax/catalog_search_builder.rb b/app/search_builders/hyrax/catalog_search_builder.rb
index <HASH>..<HASH> 100644
--- a/app/search_builders/hyrax/catalog_search_builder.rb
+++ b/app/search_builders/hyrax/catalog_search_builder.rb
@@ -1,3 +1,31 @@
+##
+# The default Blacklight catalog `search_builder_class` for Hyrax.
+#
+# Use of this builder is configured in the `CatalogController` generated by
+# Hyrax's install task.
+#
+# If you plan to customize the base catalog search builder behavior (e.g. by
+# adding a mixin module provided by a blacklight extension gem), inheriting this
+# class, customizing behavior, and reconfiguring `CatalogController` is the
+# preferred mechanism.
+#
+# @example extending and customizing SearchBuilder
+# class MyApp::CustomCatalogSearchBuilder < Hyrax::CatalogSearchBuilder
+# include BlacklightRangeLimit::RangeLimitBuilder
+# # and/or other extensions
+# end
+#
+# class CatalogController < ApplicationController
+# # ...
+# configure_blacklight do |config|
+# config.search_builder_class = MyApp::CustomCatalogSearchBuilder
+# # ...
+# end
+# # ...
+# end
+#
+# @see Blacklight::SearchBuilder
+# @see Hyrax::SearchFilters
class Hyrax::CatalogSearchBuilder < Hyrax::SearchBuilder
self.default_processor_chain += [
:add_access_controls_to_solr_params, | Add class level documentation for `Hyrax::CatalogSearchBuilder`
Some folks were thinking about ways to extend this class, but had missed that
Blacklight provides an extension mechanism. Adding some class level docs should
help folks find the right extension points. | samvera_hyrax | train | rb |
b6a30ad94a100440b040b3533d90960582bc42b0 | diff --git a/lib/generators/init-generator.js b/lib/generators/init-generator.js
index <HASH>..<HASH> 100644
--- a/lib/generators/init-generator.js
+++ b/lib/generators/init-generator.js
@@ -31,7 +31,11 @@ module.exports = class InitGenerator extends Generator {
constructor(args, opts) {
super(args, opts);
this.isProd = false;
- this.dependencies = ["webpack", "uglifyjs-webpack-plugin"];
+ this.dependencies = [
+ "webpack",
+ "webpack-cli",
+ "uglifyjs-webpack-plugin"
+ ];
this.configuration = {
config: {
webpackOptions: {}, | cli(init): add webpack-cli dep (#<I>) | webpack_webpack-cli | train | js |
f0b01283cc80656b766a60cf9ed1da92d840a1ef | diff --git a/python_modules/dagster/dagster/cli/new_repo.py b/python_modules/dagster/dagster/cli/new_repo.py
index <HASH>..<HASH> 100644
--- a/python_modules/dagster/dagster/cli/new_repo.py
+++ b/python_modules/dagster/dagster/cli/new_repo.py
@@ -2,13 +2,17 @@ import os
import click
from dagster.generate import generate_new_repo
+from dagster.utils.backcompat import experimental
@click.command(name="new-repo")
@click.argument("path", type=click.Path())
+@experimental
def new_repo_command(path: str):
"""
- Creates a new Dagster repository and generates boilerplate code.
+ Creates a new Dagster repository and generates boilerplate code. ``dagster new-repo`` is an
+ experimental command and it may generate different files in future versions, even between dot
+ releases.
PATH: Location of the new Dagster repository in your filesystem.
""" | Marks ``dagster new-repo`` as experimental.
Summary: In ancitipation of feedback and changes in the near future, `dagster new-repo` is marked as an experimental feature.
Test Plan: buildkite
Reviewers: catherinewu, schrockn
Reviewed By: catherinewu
Differential Revision: <URL> | dagster-io_dagster | train | py |
99da085c0390242dd754e0c820f7574f7abf129a | diff --git a/src/utils/get-extension-info.js b/src/utils/get-extension-info.js
index <HASH>..<HASH> 100644
--- a/src/utils/get-extension-info.js
+++ b/src/utils/get-extension-info.js
@@ -19,7 +19,7 @@ function getManifestJSON (src) {
try {
return require(resolve(src, 'manifest.json'))
} catch (error) {
- throw new Error(`You need to provide a valid 'manifest.json'`)
+ throw new Error('You need to provide a valid \'manifest.json\'')
}
} | Fix Standard errors
Strings must use singlequote | webextension-toolbox_webextension-toolbox | train | js |
e41bee911df3bb07f7a903165626ead303fc76a9 | diff --git a/src/Illuminate/Notifications/Channels/MailChannel.php b/src/Illuminate/Notifications/Channels/MailChannel.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Notifications/Channels/MailChannel.php
+++ b/src/Illuminate/Notifications/Channels/MailChannel.php
@@ -184,8 +184,12 @@ class MailChannel
$recipients = [$recipients];
}
- return collect($recipients)->map(function ($recipient) {
- return is_string($recipient) ? $recipient : $recipient->email;
+ return collect($recipients)->mapWithKeys(function ($recipient, $email) {
+ if (! is_numeric($email)) {
+ return [$email => $recipient];
+ }
+
+ return [(is_string($recipient) ? $recipient : $recipient->email)];
})->all();
} | Allow passing of recipient name in Mail notifications | laravel_framework | train | php |
9a0de3cacca0612d457e7c2f726ff054aafb6353 | diff --git a/resources/config/default.php b/resources/config/default.php
index <HASH>..<HASH> 100644
--- a/resources/config/default.php
+++ b/resources/config/default.php
@@ -12,6 +12,7 @@ $config->CM_Render->cdnResource = false;
$config->CM_Render->cdnUserContent = false;
$config->CM_Mail = new stdClass();
+$config->CM_Mail->send = true;
$config->CM_Site_Abstract = new stdClass();
$config->CM_Site_Abstract->class = 'CM_Site_CM'; | Set `$config->CM_Mail->send` to `true`. It _is_ actually a change, but I think it shouldn't hurt. | cargomedia_cm | train | php |
a132457455a06f068dd2088d8ac2ca4130608e84 | diff --git a/src/ecjTransformer/lombok/ast/ecj/EcjTreeConverter.java b/src/ecjTransformer/lombok/ast/ecj/EcjTreeConverter.java
index <HASH>..<HASH> 100644
--- a/src/ecjTransformer/lombok/ast/ecj/EcjTreeConverter.java
+++ b/src/ecjTransformer/lombok/ast/ecj/EcjTreeConverter.java
@@ -27,6 +27,7 @@ public class EcjTreeConverter extends EcjTreeVisitor {
return params.containsKey(key);
}
+ @SuppressWarnings("unused")
private Object getFlag(FlagKey key) {
return params.get(key);
}
@@ -53,6 +54,7 @@ public class EcjTreeConverter extends EcjTreeVisitor {
this.result = result;
}
+ @SuppressWarnings("unused")
private void set(ASTNode node, List<? extends Node> values) {
if (values.isEmpty()) System.err.printf("Node '%s' (%s) did not produce any results\n", node, node.getClass().getSimpleName()); | Added @SuppressWarnings(unused) where needed so the project is warning free. | rzwitserloot_lombok.ast | train | java |
ddec449d88b8eb3b8c0807b3746a01fc6b402b3e | diff --git a/Challenge/Dns/LibDnsResolver.php b/Challenge/Dns/LibDnsResolver.php
index <HASH>..<HASH> 100644
--- a/Challenge/Dns/LibDnsResolver.php
+++ b/Challenge/Dns/LibDnsResolver.php
@@ -87,11 +87,15 @@ class LibDnsResolver implements DnsResolverInterface
public function getTxtEntries($domain)
{
$nsDomain = implode('.', array_slice(explode('.', rtrim($domain, '.')), -2));
- $nameServers = $this->request(
- $nsDomain,
- ResourceTypes::NS,
- $this->nameServer
- );
+ try {
+ $nameServers = $this->request(
+ $nsDomain,
+ ResourceTypes::NS,
+ $this->nameServer
+ );
+ } catch (\Exception $e) {
+ throw new AcmeDnsResolutionException(sprintf('Unable to find domain %s on nameserver %s', $domain, $this->nameServer), $e);
+ }
$this->logger->debug('Fetched NS in charge of domain', ['nsDomain' => $nsDomain, 'servers' => $nameServers]);
if (empty($nameServers)) { | Wrap external call in try/catch block | acmephp_core | train | php |
c5a34c534b987a5767db7757699453cb14991c14 | diff --git a/framework/yii/console/controllers/MigrateController.php b/framework/yii/console/controllers/MigrateController.php
index <HASH>..<HASH> 100644
--- a/framework/yii/console/controllers/MigrateController.php
+++ b/framework/yii/console/controllers/MigrateController.php
@@ -584,7 +584,7 @@ class MigrateController extends Controller
->from($this->migrationTable)
->orderBy('version DESC')
->limit($limit)
- ->createCommand()
+ ->createCommand($this->db)
->queryAll();
$history = ArrayHelper::map($rows, 'version', 'apply_time');
unset($history[self::BASE_MIGRATION]); | Fix Issue #<I>
Fixes issue #<I>. Command is created for the selected database, not the default database. | yiisoft_yii2-debug | train | php |
b77c58b11d77932a7441b170b226fa85abcc80d6 | diff --git a/app/assets/javascripts/caboose/placeholder.js b/app/assets/javascripts/caboose/placeholder.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/caboose/placeholder.js
+++ b/app/assets/javascripts/caboose/placeholder.js
@@ -2,7 +2,6 @@
$(document).ready(function() {
$('[placeholder]').focus(function() {
- console.log("PH");
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val(''); | Remove console.log from placeholder js | williambarry007_caboose-cms | train | js |
453e29eaf624f4997c38b432049af29d0d1b527f | diff --git a/client/my-sites/themes/index.node.js b/client/my-sites/themes/index.node.js
index <HASH>..<HASH> 100644
--- a/client/my-sites/themes/index.node.js
+++ b/client/my-sites/themes/index.node.js
@@ -38,7 +38,10 @@ export default function( router ) {
'/themes/:site?/filter/:filter',
'/themes/:site?/filter/:filter/type/:tier(free|premium)'
], redirectFilterAndType );
- router( '/themes/:site?/:theme/:section(support)?', redirectToThemeDetails );
+ router( [
+ '/themes/:theme/:section(support)?',
+ '/themes/:site/:theme/:section(support)?'
+ ], redirectToThemeDetails );
// The following route definition is needed so direct hits on `/themes/<mysite>` don't result in a 404.
router( '/themes/*', fetchThemeData, loggedOut, makeLayout );
} | Use unambiguous routes for support urls. (#<I>) | Automattic_wp-calypso | train | js |
47a4d963a30b0487685d298df2da686daf8a717f | diff --git a/src/Service/Filler.php b/src/Service/Filler.php
index <HASH>..<HASH> 100644
--- a/src/Service/Filler.php
+++ b/src/Service/Filler.php
@@ -306,7 +306,8 @@ class Filler extends FillerPlugin
'Music' => 'Music video',
'Special' => 'TV-special',
];
- $type = isset($rename[$body['kind']]) ? $rename[$body['kind']] : $body['kind'];
+ $type = ucfirst($body['kind']);
+ $type = isset($rename[$type]) ? $rename[$type] : $type;
return $item->setType(
$this | correct case for type #<I> | anime-db_shikimori-filler-bundle | train | php |
1958f54cb8708d840c8931cb66211165cc81842e | diff --git a/src/main/java/org/nanopub/NanopubImpl.java b/src/main/java/org/nanopub/NanopubImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/nanopub/NanopubImpl.java
+++ b/src/main/java/org/nanopub/NanopubImpl.java
@@ -209,6 +209,9 @@ public class NanopubImpl implements NanopubWithNs, Serializable {
}
private void init() throws MalformedNanopubException {
+ if (statements.isEmpty()) {
+ throw new MalformedNanopubException("No content received for nanopub");
+ }
collectNanopubUri(statements);
if (nanopubUri == null || headUri == null) {
throw new MalformedNanopubException("No nanopub URI found"); | Special error message when set of statements is empty | Nanopublication_nanopub-java | train | java |
24dd8a4698315a4aafee5071f4fe4d74fa06c377 | diff --git a/builder/parser/line_parsers.go b/builder/parser/line_parsers.go
index <HASH>..<HASH> 100644
--- a/builder/parser/line_parsers.go
+++ b/builder/parser/line_parsers.go
@@ -279,7 +279,7 @@ func parseMaybeJSON(rest string) (*Node, map[string]bool, error) {
}
// parseMaybeJSONToList determines if the argument appears to be a JSON array. If
-// so, passes to parseJSON; if not, attmpts to parse it as a whitespace
+// so, passes to parseJSON; if not, attempts to parse it as a whitespace
// delimited string.
func parseMaybeJSONToList(rest string) (*Node, map[string]bool, error) {
node, attrs, err := parseJSON(rest) | Fix a typo in comment of parseMaybeJSONToList | moby_moby | train | go |
b0caff831b9a561d25d8df1fef35b0c6b8588b9e | diff --git a/spyder_kernels/customize/spyderpdb.py b/spyder_kernels/customize/spyderpdb.py
index <HASH>..<HASH> 100755
--- a/spyder_kernels/customize/spyderpdb.py
+++ b/spyder_kernels/customize/spyderpdb.py
@@ -15,8 +15,8 @@ import traceback
from collections import namedtuple
from IPython.core.autocall import ZMQExitAutocall
-from IPython.core.getipython import get_ipython
from IPython.core.debugger import Pdb as ipyPdb
+from IPython.core.getipython import get_ipython
from spyder_kernels.comms.frontendcomm import CommError, frontend_request
from spyder_kernels.customize.utils import path_is_library
@@ -92,6 +92,10 @@ class SpyderPdb(ipyPdb, object): # Inherits `object` to call super() in PY2
self._pdb_breaking = False
self._frontend_notified = False
+ # Don't report hidden frames for IPython 7.24+. This attribute
+ # has no effect in previous versions.
+ self.report_skipped = False
+
# --- Methods overriden for code execution
def print_exclamation_warning(self):
"""Print pdb warning for exclamation mark.""" | Debugger: Don't report skipped frames for IPython <I>+ | spyder-ide_spyder-kernels | train | py |
b0f7b91bdaece8e54e52077206d0a0111cd6b3a8 | diff --git a/pkg/nodediscovery/nodediscovery.go b/pkg/nodediscovery/nodediscovery.go
index <HASH>..<HASH> 100644
--- a/pkg/nodediscovery/nodediscovery.go
+++ b/pkg/nodediscovery/nodediscovery.go
@@ -297,7 +297,10 @@ func (n *NodeDiscovery) updateLocalNode() {
controller.NewManager().UpdateController("propagating local node change to kv-store",
controller.ControllerParams{
DoFunc: func(ctx context.Context) error {
- err := n.Registrar.UpdateLocalKeySync(&n.localNode)
+ n.localNodeLock.Lock()
+ localNode := n.localNode.DeepCopy()
+ n.localNodeLock.Unlock()
+ err := n.Registrar.UpdateLocalKeySync(localNode)
if err != nil {
log.WithError(err).Error("Unable to propagate local node change to kvstore")
} | pkg/nodediscovery: protect variable against concurrent access
This variable can be accessed concurrently since controllers run on a
separate go routine. Using its mutex and performing a DeepCopy will
help protecting it against concurrent access.
Fixes: e<I>fe1d<I>d1c ("nodediscovery: Make LocalNode object private") | cilium_cilium | train | go |
d4a7d08cbe15d10545ecdb8a01cad4570bcc7fd3 | diff --git a/examples/project_create_script.rb b/examples/project_create_script.rb
index <HASH>..<HASH> 100644
--- a/examples/project_create_script.rb
+++ b/examples/project_create_script.rb
@@ -14,6 +14,10 @@ cname = gets.chomp
client_search_results = harvest.clients.all.select { |c| c.name.downcase.include?(cname) }
case client_search_results.length
+when 0
+ puts "No client found. Please try again."
+ puts
+ abort
when 1
#Result is exactly 1. We got the client.
client_index = 0
@@ -26,12 +30,8 @@ when 1..15
end
client_index = gets.chomp.to_i - 1
-when 16..(1.0 / 0.0) #16 to infinity
- puts "Too many client matches. Please try a more specific search term."
- puts
- abort
else
- puts "No client found. Please try again."
+ puts "Too many client matches. Please try a more specific search term."
puts
abort
end | Better case statement to not have to use hacky ```(<I>/<I>)``` to get infinity. | zmoazeni_harvested | train | rb |
08c90668cd81780b2a3254d0dff3a5f6da26ceae | diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/errors.py
+++ b/discord/ext/commands/errors.py
@@ -261,7 +261,7 @@ class MaxConcurrencyReached(CommandError):
suffix = 'per %s' % name if per.name != 'default' else 'globally'
plural = '%s times %s' if number > 1 else '%s time %s'
fmt = plural % (number, suffix)
- super().__init__('Too many people using this command. It can only be used {}.'.format(fmt))
+ super().__init__('Too many people using this command. It can only be used {} concurrently.'.format(fmt))
class MissingRole(CheckFailure):
"""Exception raised when the command invoker lacks a role to run a command. | [commands] Be more clear in the default error for MaxConcurrencyReached | Rapptz_discord.py | train | py |
491479f5f70b25237510ee2d5cb9468449bf74fd | diff --git a/libraries/joomla/session/storage/xcache.php b/libraries/joomla/session/storage/xcache.php
index <HASH>..<HASH> 100644
--- a/libraries/joomla/session/storage/xcache.php
+++ b/libraries/joomla/session/storage/xcache.php
@@ -13,7 +13,7 @@ defined('JPATH_PLATFORM') or die;
* XCache session storage handler
*
* @package Joomla.Platform
- * @subpackage Cache
+ * @subpackage Session
* @since 11.1
*/
class JSessionStorageXcache extends JSessionStorage | Fix a docblock in the session package. | joomla_joomla-framework | train | php |
fbe30b97d629d5b2108f82db70312c4de4dfb64e | diff --git a/spec/support/actor_examples.rb b/spec/support/actor_examples.rb
index <HASH>..<HASH> 100644
--- a/spec/support/actor_examples.rb
+++ b/spec/support/actor_examples.rb
@@ -395,6 +395,19 @@ shared_examples "Celluloid::Actor examples" do |included_module, task_klass|
actor.should_not be_alive
end
+ it "is not dead when it's alive" do
+ actor = actor_class.new 'Bill Murray'
+ actor.should be_alive
+ actor.should_not be_dead
+ end
+
+ it "is dead when it's not alive" do
+ actor = actor_class.new 'Bill Murray'
+ actor.terminate
+ actor.should_not be_alive
+ actor.should be_dead
+ end
+
it "raises DeadActorError if called after terminated" do
actor = actor_class.new "Arnold Schwarzenegger"
actor.terminate | Add specs for alive/dead | celluloid_celluloid | train | rb |
8b9e5e10fd8dc60aaa09af88f04b397826f298be | diff --git a/fscache.go b/fscache.go
index <HASH>..<HASH> 100644
--- a/fscache.go
+++ b/fscache.go
@@ -37,8 +37,12 @@ func New(dir string, expiry int) (*Cache, error) {
expiry: time.Duration(expiry) * expiryPeriod,
files: make(map[string]*cachedFile),
}
- time.AfterFunc(reaperPeriod, c.reaper)
- return c, c.load()
+ err = c.load()
+ if err != nil {
+ return nil, err
+ }
+ c.reaper()
+ return c, nil
}
func (c *Cache) reaper() { | reaper runs right after load to remove expired items from the cache | djherbis_fscache | train | go |
4836cfcdf54e4923639c8e304b230327838552e4 | diff --git a/code/GoogleGeocoding.php b/code/GoogleGeocoding.php
index <HASH>..<HASH> 100644
--- a/code/GoogleGeocoding.php
+++ b/code/GoogleGeocoding.php
@@ -26,6 +26,10 @@ class GoogleGeocoding {
'region' => $region,
'key' => $key
));
+ if (!$service->request()->getBody()) {
+ // If blank response, ignore to avoid XML parsing errors.
+ return false;
+ }
$response = $service->request()->simpleXML();
if ($response->status != 'OK') { | fix(EmptyResponse): If the response is empty, avoid parsing with XML as it will throw an exception. | symbiote_silverstripe-addressable | train | php |
20cc2ee975a3524933863a44c0134c078e3db7e3 | diff --git a/yamcs-client/yamcs/tmtc/model.py b/yamcs-client/yamcs/tmtc/model.py
index <HASH>..<HASH> 100644
--- a/yamcs-client/yamcs/tmtc/model.py
+++ b/yamcs-client/yamcs/tmtc/model.py
@@ -202,7 +202,7 @@ class IssuedCommand(object):
:type: :class:`~datetime.datetime`
"""
if self._proto.HasField('generationTime'):
- return parse_isostring(self._proto.generationTime)
+ return self._proto.generationTime.ToDatetime()
return None
@property | fixed the datetime conversion broken since the field has been changed to
Timestamp | yamcs_yamcs-python | train | py |
911e2de395e6cc1d7660f19f79df662188de83f1 | diff --git a/scapy/layers/tls/keyexchange.py b/scapy/layers/tls/keyexchange.py
index <HASH>..<HASH> 100644
--- a/scapy/layers/tls/keyexchange.py
+++ b/scapy/layers/tls/keyexchange.py
@@ -746,7 +746,7 @@ class ClientDiffieHellmanPublic(_GenericTLSSessionInheritance):
if s.client_kx_privkey and s.server_kx_pubkey:
pms = s.client_kx_privkey.exchange(s.server_kx_pubkey)
- s.pre_master_secret = pms
+ s.pre_master_secret = pms.lstrip(b"\x00")
if not s.extms or s.session_hash:
# If extms is set (extended master secret), the key will
# need the session hash to be computed. This is provided
@@ -780,7 +780,7 @@ class ClientDiffieHellmanPublic(_GenericTLSSessionInheritance):
if s.server_kx_privkey and s.client_kx_pubkey:
ZZ = s.server_kx_privkey.exchange(s.client_kx_pubkey)
- s.pre_master_secret = ZZ
+ s.pre_master_secret = ZZ.lstrip(b"\x00")
if not s.extms or s.session_hash:
s.compute_ms_and_derive_keys() | Fix an error in the PMS derivation for DHE key exchange in TLS.
The RFC states that the leading zero bytes must be stripped when storing the
Pre Master Secret. This is bad practice, since it leads to exploitable timing
attacks such as the Raccoon Attack (<URL>). However, this is the standard and the current
implementation leads to handshake failure with a probability of 1/<I>.
The leading zero injunction does NOT apply to ECDHE. | secdev_scapy | train | py |
841fbc65c5a8cd9511fba264eaed2c9fa0cb7d21 | diff --git a/zimsoap/client.py b/zimsoap/client.py
index <HASH>..<HASH> 100644
--- a/zimsoap/client.py
+++ b/zimsoap/client.py
@@ -1397,8 +1397,10 @@ not {0}'.format(type(ids)))
def get_folder_grant(self, **kwargs):
folder = self.get_folder(**kwargs)
-
- return folder['folder']['acl']
+ if 'acl' in folder['folder']:
+ return folder['folder']['acl']
+ else:
+ return None
def modify_folder_grant(
self, | Return None when no acl found | oasiswork_zimsoap | train | py |
c70b10c54a6d144e178b2dfd5dbd84d78b237571 | diff --git a/control.js b/control.js
index <HASH>..<HASH> 100644
--- a/control.js
+++ b/control.js
@@ -7,4 +7,4 @@ exports.task = task.task;
exports.begin = task.begin;
exports.perform = task.perform;
exports.hosts = host.hosts;
-exports.host = host.perform;
+exports.host = host.host | Fixes export of host() method. | tsmith_node-control | train | js |
623ed936dcfa3711d6b99cdeedea9e5201953abe | diff --git a/aiohttp/connector.py b/aiohttp/connector.py
index <HASH>..<HASH> 100644
--- a/aiohttp/connector.py
+++ b/aiohttp/connector.py
@@ -460,19 +460,20 @@ class TCPConnector(BaseConnector):
sslcontext = None
hosts = yield from self._resolve_host(req.host, req.port)
+ exc = None
- while hosts:
- hinfo = hosts.pop()
+ for hinfo in hosts:
try:
return (yield from self._loop.create_connection(
self._factory, hinfo['host'], hinfo['port'],
ssl=sslcontext, family=hinfo['family'],
proto=hinfo['proto'], flags=hinfo['flags'],
server_hostname=hinfo['hostname'] if sslcontext else None))
- except OSError as exc:
- if not hosts:
- raise ClientOSError('Can not connect to %s:%s' %
- (req.host, req.port)) from exc
+ except OSError as e:
+ exc = e
+ else:
+ raise ClientOSError('Can not connect to %s:%s' %
+ (req.host, req.port)) from exc
class ProxyConnector(TCPConnector): | Refactor TCPConnector._create_connection a bit | aio-libs_aiohttp | train | py |
18f3685d1e2e4d3ded753fcfd4fc8240f3551bf6 | diff --git a/liquibase-core/src/main/java/liquibase/database/core/HsqlDatabase.java b/liquibase-core/src/main/java/liquibase/database/core/HsqlDatabase.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/database/core/HsqlDatabase.java
+++ b/liquibase-core/src/main/java/liquibase/database/core/HsqlDatabase.java
@@ -432,7 +432,6 @@ public class HsqlDatabase extends AbstractJdbcDatabase {
"SCRIPT",
"SCRIPTFORMAT",
"SEMICOLON",
- "SEQUENCE",
"SHUTDOWN",
"TEMP",
"TEXT", | CORE-<I> Sequence is not a reserved object name in HSQLDB | liquibase_liquibase | train | java |
9db21adad312bfd6411eb2f37bd24d673fc3548a | diff --git a/cf/commands/application/start_test.go b/cf/commands/application/start_test.go
index <HASH>..<HASH> 100644
--- a/cf/commands/application/start_test.go
+++ b/cf/commands/application/start_test.go
@@ -83,8 +83,8 @@ var _ = Describe("start command", func() {
ui = new(testterm.FakeUI)
cmd := NewStart(ui, config, displayApp, appRepo, appInstancesRepo, logRepo)
- cmd.StagingTimeout = 50 * time.Millisecond
- cmd.StartupTimeout = 100 * time.Millisecond
+ cmd.StagingTimeout = 100 * time.Millisecond
+ cmd.StartupTimeout = 200 * time.Millisecond
cmd.PingerThrottle = 50 * time.Millisecond
testcmd.RunCommand(cmd, args, requirementsFactory) | Bump timeouts in the start_test | cloudfoundry_cli | train | go |
35325f2a7d1cc71b897f94577596c2d4ed69e41e | diff --git a/app/controllers/stripe_event/webhook_controller.rb b/app/controllers/stripe_event/webhook_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/stripe_event/webhook_controller.rb
+++ b/app/controllers/stripe_event/webhook_controller.rb
@@ -7,12 +7,20 @@ module StripeEvent
end
end
end
-
+
def event
StripeEvent.instrument(params)
head :ok
- rescue StripeEvent::UnauthorizedError
+ rescue StripeEvent::UnauthorizedError => e
+ log_error(e)
head :unauthorized
end
+
+ private
+
+ def log_error(e)
+ logger.error e.message
+ e.backtrace.each { |line| logger.error " #{line}" }
+ end
end
end | Add error logging to WebhookController
For easier debugging.
Fixes #<I> | integrallis_stripe_event | train | rb |
fd3656f2e318882b018e8eea0720dc6736aa43a2 | diff --git a/notification-portlet-webcomponents/notification-component-icon/src/NotificationIcon.js b/notification-portlet-webcomponents/notification-component-icon/src/NotificationIcon.js
index <HASH>..<HASH> 100644
--- a/notification-portlet-webcomponents/notification-component-icon/src/NotificationIcon.js
+++ b/notification-portlet-webcomponents/notification-component-icon/src/NotificationIcon.js
@@ -21,6 +21,11 @@ const StyledDropdownMenu = styled(DropdownMenu)`
}
`;
const StyledDropdownToggle = styled(DropdownToggle)`
+ &:hover,
+ &:focus {
+ color: white;
+ }
+
&.up-notification--toggle {
background-color: inherit;
}
@@ -191,9 +196,9 @@ class NotificationIcon extends Component {
const {t, seeAllNotificationsUrl} = this.props;
const {notifications, isDropdownOpen} = this.state;
- const dropdownClasses = ['up-notification--toggle'];
+ let dropdownClasses = 'up-notification--toggle';
if (notifications.length !== 0) {
- dropdownClasses.push('up-active');
+ dropdownClasses += ' up-active';
}
return ( | fix: ensure notification button shows are red when there are unread | Jasig_NotificationPortlet | train | js |
1811de9d3e2040cc64882b50eaf9e05b4025b465 | diff --git a/src/locale/tk.js b/src/locale/tk.js
index <HASH>..<HASH> 100644
--- a/src/locale/tk.js
+++ b/src/locale/tk.js
@@ -1,5 +1,5 @@
//! moment.js locale configuration
-//! locale : Turkmen [trk]
+//! locale : Turkmen [tk]
//! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy
import moment from '../moment'; | [locale] tk: fix country code (#<I>) | moment_moment | train | js |
81370717544eb789508b81891dcf8042c0ec8468 | diff --git a/src/request_handlers/status_request_handler.js b/src/request_handlers/status_request_handler.js
index <HASH>..<HASH> 100644
--- a/src/request_handlers/status_request_handler.js
+++ b/src/request_handlers/status_request_handler.js
@@ -30,17 +30,18 @@ var ghostdriver = ghostdriver || {};
ghostdriver.StatusReqHand = function() {
// private:
var
+ _system = require("system"),
_protoParent = ghostdriver.StatusReqHand.prototype,
- _statusObj = { //< TODO Report real status
+ _statusObj = {
"build" : {
- "version" : "0.1a",
- "revision" : "none",
- "time" : "20120320"
+ "version" : "1.0-dev",
+ "revision" : "unknown",
+ "time" : "unknown"
},
"os" : {
- "arch" : "x86",
- "name" : "osx",
- "version" : "10.7.2"
+ "name" : _system.os.name,
+ "version" : _system.os.version,
+ "arch" : _system.os.architecture
}
}, | Completed command "/status" | detro_ghostdriver | train | js |
3159b4d2a68c0ddeaf5c8921fa41341a1f791101 | diff --git a/src/test/java/io/github/bonigarcia/test/docker/DockerHtmlVncJupiterTest.java b/src/test/java/io/github/bonigarcia/test/docker/DockerHtmlVncJupiterTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/io/github/bonigarcia/test/docker/DockerHtmlVncJupiterTest.java
+++ b/src/test/java/io/github/bonigarcia/test/docker/DockerHtmlVncJupiterTest.java
@@ -45,6 +45,7 @@ public class DockerHtmlVncJupiterTest {
void setup() {
SeleniumJupiter.config().setVnc(true);
SeleniumJupiter.config().setVncRedirectHtmlPage(true);
+ SeleniumJupiter.config().useSurefireOutputFolder();
}
@AfterAll
@@ -61,7 +62,8 @@ public class DockerHtmlVncJupiterTest {
assertThat(driver.getTitle(),
containsString("A JUnit 5 extension for Selenium WebDriver"));
- htmlFile = new File("testHtmlVnc_arg0_CHROME_64.0_"
+ String folder = "target/surefire-reports/io.github.bonigarcia.test.docker.DockerHtmlVncJupiterTest";
+ htmlFile = new File(folder, "testHtmlVnc_arg0_CHROME_64.0_"
+ driver.getSessionId() + ".html");
} | Use surefire-reports folder in test | bonigarcia_selenium-jupiter | train | java |
73d09fa9f0fb9da28093cab2bf663b3d2fa13e5c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -11,7 +11,8 @@ module.exports = (function (array) {
while (length) {
value = parseInt(number.charAt(--length), 10)
- sum += (bit ^= 1) ? array[value] : value
+ bit ^= 1
+ sum += bit ? array[value] : value
}
return !!sum && sum % 10 === 0 | avoid assigning in conidition of ternary | bendrucker_fast-luhn | train | js |
51512508d1bc84d531a88b99a37e60d4bf64113f | diff --git a/grade/edit/scale/edit.php b/grade/edit/scale/edit.php
index <HASH>..<HASH> 100644
--- a/grade/edit/scale/edit.php
+++ b/grade/edit/scale/edit.php
@@ -107,6 +107,7 @@ if ($mform->is_cancelled()) {
if (empty($scale->id)) {
$data->description = $data->description_editor['text'];
+ $data->descriptionformat = $data->description_editor['format'];
grade_scale::set_properties($scale, $data);
if (!has_capability('moodle/grade:manage', $systemcontext)) {
$data->standard = 0; | gradebook MDL-<I> now saves scale description format when you create a new scale | moodle_moodle | train | php |
17df26eecef590dfd117167eafff2500ceddeca7 | diff --git a/multiplex.go b/multiplex.go
index <HASH>..<HASH> 100644
--- a/multiplex.go
+++ b/multiplex.go
@@ -170,7 +170,7 @@ func (mp *Multiplex) sendMsg(ctx context.Context, header uint64, data []byte) er
if err != nil && written > 0 {
// Bail. We've written partial message and can't do anything
// about this.
- mp.con.Close()
+ mp.closeNoWait()
return err
} | close the session, not just the connection if we fail to write | libp2p_go-mplex | train | go |
329769cc9f50d8729d2871fc1ed74c3f1dfee5ca | diff --git a/src/bezierizer.core.js b/src/bezierizer.core.js
index <HASH>..<HASH> 100644
--- a/src/bezierizer.core.js
+++ b/src/bezierizer.core.js
@@ -104,10 +104,14 @@ Bezierizer.prototype.getHandlePositions = function () {
Bezierizer.prototype.setHandlePositions = function (points) {
$.extend(this._points, points);
- this._$handles.eq(0).css('left', this._points.x1);
- this._$handles.eq(0).css('top', this._points.y1);
- this._$handles.eq(1).css('left', this._points.x2);
- this._$handles.eq(1).css('top', this._points.y2);
+ this._$handles.eq(0).css({
+ left: this._points.x1
+ ,top: this._points.y1
+ });
+ this._$handles.eq(1).css({
+ left: this._points.x2
+ ,top: this._points.y2
+ });
this.redraw();
}; | Refactors some calls to .css. | jeremyckahn_bezierizer | train | js |
ff0de39631e1958a2ff2abc32e36f0946d367e03 | diff --git a/lib/merb-core/bootloader.rb b/lib/merb-core/bootloader.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core/bootloader.rb
+++ b/lib/merb-core/bootloader.rb
@@ -124,9 +124,8 @@ end
class Merb::BootLoader::DropPidFile < Merb::BootLoader
class << self
-
def run
- Merb::Server.store_pid(Merb::Config[:port])
+ Merb::Server.store_pid(Merb::Config[:port]) unless Merb::Config[:daemonize] || Merb::Config[:cluster]
end
end
end
diff --git a/lib/merb-core/logger.rb b/lib/merb-core/logger.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core/logger.rb
+++ b/lib/merb-core/logger.rb
@@ -196,7 +196,7 @@ module Merb
# DOC
def #{name}(message = nil, &block)
- self.<<(message, &block) if #{name}?
+ self.<<(message, &block) if #{number} >= level
end
# DOC | Do not drop PID file is not running as daemon or cluster
Avoid extra method call in logging | wycats_merb | train | rb,rb |
0c5c2c1b882c753d22676306ccb864bfbbab2e99 | diff --git a/lib/juici/callback.rb b/lib/juici/callback.rb
index <HASH>..<HASH> 100644
--- a/lib/juici/callback.rb
+++ b/lib/juici/callback.rb
@@ -10,7 +10,12 @@ module Juici
end
def process!
- Net::HTTP.post_form(url, build.to_form_hash)
+ Net::HTTP.start(url.host, url.port) do |http|
+ request = Net::HTTP::Post.new(url.request_uri)
+ request.body = build.to_callback_json
+
+ response = http.request request # Net::HTTPResponse object
+ end
end
end
diff --git a/lib/juici/models/build.rb b/lib/juici/models/build.rb
index <HASH>..<HASH> 100644
--- a/lib/juici/models/build.rb
+++ b/lib/juici/models/build.rb
@@ -1,3 +1,4 @@
+require 'json'
# status enum
# :waiting
# :started
@@ -114,12 +115,12 @@ module Juici
end
- def to_form_hash
+ def to_callback_json
{
"project" => self[:parent],
"status" => self[:status],
"url" => ""
- }
+ }.to_json
end
end | Refactor callbacks to use raw POST body | richo_juici | train | rb,rb |
cad7c044054357b5ab59b4460d51f97b09a3ffc6 | diff --git a/lib/active_record/connection_adapters/sqlserver/database_statements.rb b/lib/active_record/connection_adapters/sqlserver/database_statements.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/sqlserver/database_statements.rb
+++ b/lib/active_record/connection_adapters/sqlserver/database_statements.rb
@@ -33,10 +33,6 @@ module ActiveRecord
super(sql, name, binds).rows.first.first
end
- def supports_statement_cache?
- true
- end
-
def begin_db_transaction
do_execute 'BEGIN TRANSACTION'
end | Remove un-necessary adapter override | rails-sqlserver_activerecord-sqlserver-adapter | train | rb |
67b3a26f9c6563986677d192647789bba6dea991 | diff --git a/aws/resource_aws_batch_job_queue_test.go b/aws/resource_aws_batch_job_queue_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_batch_job_queue_test.go
+++ b/aws/resource_aws_batch_job_queue_test.go
@@ -100,11 +100,6 @@ func TestAccAWSBatchJobQueue_disappears(t *testing.T) {
),
ExpectNonEmptyPlan: true,
},
- {
- ResourceName: resourceName,
- ImportState: true,
- ImportStateVerify: true,
- },
},
})
} | tests/resource/aws_batch_job_queue: Remove extraneous import testing from disappears test
Output from acceptance testing:
```
--- PASS: TestAccAWSBatchJobQueue_disappears (<I>s)
``` | terraform-providers_terraform-provider-aws | train | go |
21664e03f2fbc5001af53e918eb3202405e8037d | diff --git a/lib/beepboop.js b/lib/beepboop.js
index <HASH>..<HASH> 100644
--- a/lib/beepboop.js
+++ b/lib/beepboop.js
@@ -3,8 +3,8 @@
var Resourcer = require(__dirname + '/resourcer.js')
module.exports = {
- start: function (config) {
- var resourcer = Resourcer(config)
+ start: function (options) {
+ var resourcer = Resourcer(options)
resourcer.connect()
return resourcer
}
diff --git a/lib/resourcer.js b/lib/resourcer.js
index <HASH>..<HASH> 100644
--- a/lib/resourcer.js
+++ b/lib/resourcer.js
@@ -19,6 +19,9 @@ const AUTH_MSG = {
const MSG_PREFIX = 'message'
module.exports = function Resourcer (options) {
+ // TODO add log level based on debug flag
+ options = parseOptions(options)
+
var ws = null
var resourcer = new EventEmitter2({wildcard: true})
@@ -31,6 +34,15 @@ module.exports = function Resourcer (options) {
.on('error', handledError)
}
+ function parseOptions (options) {
+ var opts = {}
+
+ // set supported options
+ opts.debug = !!opts.debug
+
+ return opts
+ }
+
// handle enables retry ws cleanup and mocking
function initWs (inWs) {
if (ws) { | Stub-in means of taking options into the resourcer. | BeepBoopHQ_beepboop-js | train | js,js |
ac83201e7124d0257b9cd1f7e283465eb70ecc8e | diff --git a/lib/ntlmrequest.js b/lib/ntlmrequest.js
index <HASH>..<HASH> 100644
--- a/lib/ntlmrequest.js
+++ b/lib/ntlmrequest.js
@@ -75,8 +75,8 @@ function ntlmRequest(opts) {
if (supportedAuthSchemes.indexOf('ntlm') !== -1) {
authHeader = ntlm.createType1Message();
- } else if (supportedAuthSchemes.indexOf('basic')) {
- authHeader = 'Basic ' + new Buffer(opts.username + ':' + opts.passsword).toString('base64');
+ } else if (supportedAuthSchemes.indexOf('basic') !== -1) {
+ authHeader = 'Basic ' + new Buffer(opts.username + ':' + opts.password).toString('base64');
ntlmState.status = 2;
} else {
return reject(new Error('Could not negotiate on an authentication scheme'));
@@ -128,4 +128,4 @@ function ntlmRequest(opts) {
return new Promise(sendRequest);
}
-module.exports = ntlmRequest;
\ No newline at end of file
+module.exports = ntlmRequest; | Fix basic auth check and password variable | clncln1_node-ntlm-client | train | js |
a98963ae1e5730d2534c2fd9fea4d8f3068a3e86 | diff --git a/widgets/ActionBox.php b/widgets/ActionBox.php
index <HASH>..<HASH> 100644
--- a/widgets/ActionBox.php
+++ b/widgets/ActionBox.php
@@ -78,7 +78,7 @@ JS
}
public function renderSearchButton() {
- return AdvancedSearch::renderButton();
+ return AdvancedSearch::renderButton() . "\n";
}
public function beginSearchForm() { | Add additional gap while render AdvancedSearchButton | hiqdev_hipanel-core | train | php |
0a7bc0cb8b5b0f03f346d47c4d237040cbf09988 | diff --git a/lib/virtus/typecast/string.rb b/lib/virtus/typecast/string.rb
index <HASH>..<HASH> 100644
--- a/lib/virtus/typecast/string.rb
+++ b/lib/virtus/typecast/string.rb
@@ -127,6 +127,8 @@ module Virtus
end
end
+ private_class_method :to_numeric
+
# Parse the value or return it as-is if it is invalid
#
# @param [#parse] parser | Update String numeric parser utility method to be private | solnic_virtus | train | rb |
66f2fa1db7f64807ca8f25747bd7f82a77072918 | diff --git a/TYPO3.Flow/Classes/MVC/Controller/F3_FLOW3_MVC_Controller_ActionController.php b/TYPO3.Flow/Classes/MVC/Controller/F3_FLOW3_MVC_Controller_ActionController.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Flow/Classes/MVC/Controller/F3_FLOW3_MVC_Controller_ActionController.php
+++ b/TYPO3.Flow/Classes/MVC/Controller/F3_FLOW3_MVC_Controller_ActionController.php
@@ -129,7 +129,7 @@ class ActionController extends F3::FLOW3::MVC::Controller::RequestHandlingContro
* @author Robert Lemke <robert@typo3.org>
*/
protected function indexAction() {
- return 'No default action has been implemented yet for this controller.';
+ return 'No index action has been implemented yet for this controller.';
}
}
?>
\ No newline at end of file | FLOW3: When no indexAction can be found in a controller, the message shown says so now.
Original-Commit-Hash: fb<I>c<I>d<I>ac4bee<I>a<I>f<I>a<I>df<I> | neos_flow-development-collection | train | php |
3b59a80180d607ac36d7112a1ffc7f4dcf975a8b | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java
@@ -248,7 +248,12 @@ class SequencerAgent implements Agent
ctx.snapshotCounter().incrementOrdered();
state(ConsensusModule.State.ACTIVE);
ClusterControl.ToggleState.reset(controlToggle);
- // TODO: Should session timestamps be reset in case of timeout
+
+ final long nowNs = epochClock.time();
+ for (final ClusterSession session : sessionByIdMap.values())
+ {
+ session.timeOfLastActivityMs(nowNs);
+ }
break;
case SHUTDOWN:
@@ -348,9 +353,7 @@ class SequencerAgent implements Agent
if (session.id() == clusterSessionId && session.state() == CHALLENGED)
{
final long nowMs = cachedEpochClock.time();
-
session.lastActivity(nowMs, correlationId);
-
authenticator.onChallengeResponse(clusterSessionId, credentialData, nowMs);
break;
} | [Java] Reset client activity timestamp after taking a snapshot to avoid session timeout. | real-logic_aeron | train | java |
a125b17659b774b43f0274987d9c2779e25b9197 | diff --git a/test_cipher.py b/test_cipher.py
index <HASH>..<HASH> 100644
--- a/test_cipher.py
+++ b/test_cipher.py
@@ -52,14 +52,14 @@ def test_internal():
def test_speed():
cipher = Cipher('0123456789abcdef', mode='ecb')
- start_time = time.clock()
+ start_time = time.time()
txt = '0123456789abcdef'
for i in xrange(50000):
txt = cipher.encrypt(txt)
for i in xrange(50000):
txt = cipher.decrypt(txt)
assert txt == '0123456789abcdef', 'speed test is wrong: %r' % txt
- print 'Ran in %.2fps' % (10000 * (time.clock() - start_time))
+ print 'Ran in %.2fns' % ((time.time() - start_time) * 1000000000 / 100000)
def test_openssl(): | Cherry pick timing from 5c9d<I>e. | mikeboers_PyTomCrypt | train | py |
eaea6445607ef182789412305985028a79a1c103 | diff --git a/source/rafcon/gui/mygaphas/canvas.py b/source/rafcon/gui/mygaphas/canvas.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/mygaphas/canvas.py
+++ b/source/rafcon/gui/mygaphas/canvas.py
@@ -60,8 +60,6 @@ class MyCanvas(gaphas.canvas.Canvas):
def remove(self, item):
from rafcon.gui.mygaphas.items.state import StateView
from rafcon.gui.mygaphas.items.connection import ConnectionView, ConnectionPlaceholderView, DataFlowView
- print "remove view", item, hex(id(item))
- print "for model", item.model, hex(id(item.model))
if isinstance(item, (StateView, ConnectionView)) and not isinstance(item, ConnectionPlaceholderView):
self._remove_view_maps(item)
super(MyCanvas, self).remove(item) | chore(canvas): clean prints of Franz | DLR-RM_RAFCON | train | py |
0ad3739b03b790ded7f14ed192d6dc5f0122ace8 | diff --git a/lib/appsignal/transmitter.rb b/lib/appsignal/transmitter.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/transmitter.rb
+++ b/lib/appsignal/transmitter.rb
@@ -78,7 +78,6 @@ module Appsignal
client.tap do |http|
if uri.scheme == "https"
http.use_ssl = true
- http.ssl_version = :TLSv1
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
ca_file = config[:ca_file_path] | Remove SSL version lock in transmitter (#<I>)
By removing the version lock we will no longer be limited to TLSv1, this
has known security issues.
By not specifying it, it will work with TLS<I> as well.
The `ssl_version` option itself is also deprecated. Instead we could use
the `min_option` version, but we think the Ruby default should be good
enough and more future proof. | appsignal_appsignal-ruby | train | rb |
19d0515d3673481ebce2f8b1e2d8c2b15fe109d6 | diff --git a/periphery/mmio.py b/periphery/mmio.py
index <HASH>..<HASH> 100644
--- a/periphery/mmio.py
+++ b/periphery/mmio.py
@@ -305,7 +305,7 @@ class MMIO(object):
:type: ctypes.c_void_p
"""
- return ctypes.cast(ctypes.pointer(ctypes.c_uint8.from_buffer(self.mapping, 0)), ctypes.c_void_p)
+ return ctypes.cast(ctypes.pointer(ctypes.c_uint8.from_buffer(self.mapping, self._adjust_offset(0))), ctypes.c_void_p)
# String representation | mmio: fix memory offset of pointer property
the pointer property was returning a unoffset pointer to the beginning
of the mapped memory region, which is not at the MMIO object base
address when the base address is not page aligned. | vsergeev_python-periphery | train | py |
e7ceb63b7d80a170732640f9652d3dd1a8d26e76 | diff --git a/spec/main-spec.js b/spec/main-spec.js
index <HASH>..<HASH> 100644
--- a/spec/main-spec.js
+++ b/spec/main-spec.js
@@ -177,7 +177,7 @@ describe('execNode', function() {
await promise
expect(false).toBe(true)
} catch (error) {
- expect(error.message).toBe('Process exited with non-zero code: null')
+ expect(error.message.startsWith('Process exited with non-zero code')).toBe(true)
}
})
}) | :white_check_mark: Make a spec more cross platform | steelbrain_exec | train | js |
6d4888cf9b38a8328f1b0ff2635b1d584452569c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ setup(
author_email='tim@takeflight.com.au',
url='https://bitbucket.org/takeflight/wagtailnews',
- install_requires=['wagtail>=1.0b2'],
+ install_requires=['wagtail>=1.0'],
zip_safe=False,
license='BSD License', | Bump required Wagtail version to <I> | neon-jungle_wagtailnews | train | py |
3925822bb6e72af5e2ddc67c3a40441d9607d5e8 | diff --git a/spec/lib/exception_notifier_spec.rb b/spec/lib/exception_notifier_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/exception_notifier_spec.rb
+++ b/spec/lib/exception_notifier_spec.rb
@@ -80,7 +80,7 @@ describe Crashbreak::ExceptionNotifier do
end
context 'github integration' do
- let(:error_hash) { Hash[id: 1, deploy_revision: 'test', similar: false] }
+ let(:error_hash) { Hash['id' => 1, 'deploy_revision' => 'test', 'similar' => false] }
it 'passes error hash from request to github integration service' do
Crashbreak.configure.github_repo_name = 'user/repo'
@@ -92,7 +92,7 @@ describe Crashbreak::ExceptionNotifier do
end
it 'skips github integration if error is similar' do
- allow_any_instance_of(Crashbreak::ExceptionsRepository).to receive(:create).and_return(error_hash.merge(similar: true))
+ allow_any_instance_of(Crashbreak::ExceptionsRepository).to receive(:create).and_return(error_hash.merge('similar' => true))
expect_any_instance_of(Crashbreak::GithubIntegrationService).to_not receive(:initialize)
subject.notify | Use string as keys when stubbing server resposne | crashbreak_crashbreak | train | rb |
d5f91fe9b00c01e6066d1cef7a51afcd29b9b0ec | diff --git a/salt/grains/core.py b/salt/grains/core.py
index <HASH>..<HASH> 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -1779,12 +1779,14 @@ def ip_fqdn():
ret[key] = []
else:
try:
+ start_time = datetime.datetime.utcnow()
info = socket.getaddrinfo(_fqdn, None, socket_type)
ret[key] = list(set(item[4][0] for item in info))
except socket.error:
- if __opts__['__role'] == 'master':
- log.warning('Unable to find IPv{0} record for "{1}" causing a 10 second timeout when rendering grains. '
- 'Set the dns or /etc/hosts for IPv{0} to clear this.'.format(ipv_num, _fqdn))
+ timediff = datetime.datetime.utcnow() - start_time
+ if timediff.seconds > 5 and __opts__['__role'] == 'master':
+ log.warning('Unable to find IPv{0} record for "{1}" causing a {2} second timeout when rendering grains. '
+ 'Set the dns or /etc/hosts for IPv{0} to clear this.'.format(ipv_num, _fqdn, timediff))
ret[key] = []
return ret | require large timediff for ipv6 warning | saltstack_salt | train | py |
fd05de08cd27b5bbb3a76d620425fbb5bdc26bd6 | diff --git a/lib/solargraph/source.rb b/lib/solargraph/source.rb
index <HASH>..<HASH> 100644
--- a/lib/solargraph/source.rb
+++ b/lib/solargraph/source.rb
@@ -340,6 +340,7 @@ module Solargraph
def parse
node, comments = inner_parse(@fixed, filename)
@node = node
+ @comments = comments
process_parsed node, comments
@parsed = true
end
@@ -348,6 +349,7 @@ module Solargraph
@fixed = @code.gsub(/[^\s]/, ' ')
node, comments = inner_parse(@fixed, filename)
@node = node
+ @comments = comments
process_parsed node, comments
@parsed = false
end | Expose Source#comments for fragments. | castwide_solargraph | train | rb |
a1b8a1291522bd73999fb463fcde4a73a4bd45d9 | diff --git a/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java b/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java
index <HASH>..<HASH> 100644
--- a/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java
+++ b/biodata-models/src/main/java/org/opencb/biodata/models/variant/annotation/ConsequenceTypeMappings.java
@@ -62,6 +62,7 @@ public class ConsequenceTypeMappings {
tmpTermToAccession.put("incomplete_terminal_codon_variant", 1626);
tmpTermToAccession.put("synonymous_variant", 1819);
tmpTermToAccession.put("stop_retained_variant", 1567);
+ tmpTermToAccession.put("start_retained_variant", 2019);
tmpTermToAccession.put("coding_sequence_variant", 1580);
tmpTermToAccession.put("miRNA", 276);
tmpTermToAccession.put("miRNA_target_site", 934); | feature-vep-comparison: stop_retained_variant added to ConsequenceTypeMappings | opencb_biodata | train | java |
0b57aa2f4e7641a46a88c47544928ad9004e0d9d | diff --git a/src/Helpers/CrudApi.php b/src/Helpers/CrudApi.php
index <HASH>..<HASH> 100644
--- a/src/Helpers/CrudApi.php
+++ b/src/Helpers/CrudApi.php
@@ -45,7 +45,14 @@ class CrudApi
public function getModel()
{
- $fqModel = $this->getAppNamespace() . $this->model;
+ $namespace = $this->getAppNamespace();
+ $fqModel = $namespace . $this->model;
+ if (!class_exists($fqModel)) {
+ $fqModel = $namespace . "Models\\" . $this->model;
+ if (!class_exists($fqModel)) {
+ return false;
+ }
+ }
return $fqModel;
} | If model is not found in App\ also look in App\Models\ | taskforcedev_crud-api | train | php |
1e400af13c2d0d86c198112b5bcc09e8423ff1c9 | diff --git a/lib/mj-single.js b/lib/mj-single.js
index <HASH>..<HASH> 100644
--- a/lib/mj-single.js
+++ b/lib/mj-single.js
@@ -586,7 +586,7 @@ function GetSVG(result) {
//
if (data.speakText) {
ID++; var id = "MathJax-SVG-"+ID;
- svg.setAttribute("role","math");
+ svg.setAttribute("role","img");
svg.setAttribute("aria-labelledby",id+"-Title "+id+"-Desc");
for (var i=0, m=svg.childNodes.length; i < m; i++)
svg.childNodes[i].setAttribute("aria-hidden",true); | SVG+SRE: change role from math to img
Fixes #<I> | mathjax_MathJax-node | train | js |
18e06133f8e48f5f3ed6c6cb0bb5270e8e3425e4 | diff --git a/errors.go b/errors.go
index <HASH>..<HASH> 100644
--- a/errors.go
+++ b/errors.go
@@ -50,6 +50,10 @@ var (
// ErrProcNotFound is an error encountered when the the process cannot be found
ErrProcNotFound = syscall.Errno(0x7f)
+
+ // ErrVmcomputeOperationAccessIsDenied is an error which can be encountered when enumerating compute systems in RS1/RS2
+ // builds when the underlying silo might be in the process of terminating. HCS was fixed in RS3.
+ ErrVmcomputeOperationAccessIsDenied = syscall.Errno(0x5)
)
// ProcessError is an error encountered in HCS during an operation on a Process object | Add 'Access is denied' error | Microsoft_hcsshim | train | go |
241b7483ea954653512d4895ad6bacf79ee26ddc | diff --git a/tpl/tplimpl/template.go b/tpl/tplimpl/template.go
index <HASH>..<HASH> 100644
--- a/tpl/tplimpl/template.go
+++ b/tpl/tplimpl/template.go
@@ -598,10 +598,16 @@ func (t *templateHandler) applyBaseTemplate(overlay, base templateInfo) (tpl.Tem
}
}
- templ, err = templ.Parse(overlay.template)
+ templ, err = texttemplate.Must(templ.Clone()).Parse(overlay.template)
if err != nil {
return nil, overlay.errWithFileContext("parse failed", err)
}
+
+ // The extra lookup is a workaround, see
+ // * https://github.com/golang/go/issues/16101
+ // * https://github.com/gohugoio/hugo/issues/2549
+ // templ = templ.Lookup(templ.Name())
+
return templ, nil
} | tpl: Fix race condition in text template baseof
Copy most of the htmltemplate cloning to the textemplate implementation
in the same function. | gohugoio_hugo | train | go |
ceefc403d359efbdc4fe967c8164d150b4a86519 | diff --git a/test/OfferCommandHandlerTestTrait.php b/test/OfferCommandHandlerTestTrait.php
index <HASH>..<HASH> 100644
--- a/test/OfferCommandHandlerTestTrait.php
+++ b/test/OfferCommandHandlerTestTrait.php
@@ -160,7 +160,6 @@ trait OfferCommandHandlerTestTrait
]
)
->when(
-
new $commandClass($id, $image)
)
->then([new $eventClass($id, $image)]); | III-<I>: Fix coding standard violation | cultuurnet_udb3-php | train | php |
73499543ff60e0aa3e10d52007549c99500d8c9f | diff --git a/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php b/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php
+++ b/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php
@@ -215,6 +215,16 @@ DateTime:: # a
}
',
],
+ [
+ '<?php
+ namespace Foo\\Bar;
+ var_dump(Foo\\Bar\\Baz);
+ ',
+ '<?php
+ namespace Foo\Bar;
+ var_dump(Baz::class);
+ '
+ ]
];
} | add a failed condition for issue #<I> | FriendsOfPHP_PHP-CS-Fixer | train | php |
6bdc906288798625fffe0cd73680007bef059f6f | diff --git a/server/auth_test.go b/server/auth_test.go
index <HASH>..<HASH> 100644
--- a/server/auth_test.go
+++ b/server/auth_test.go
@@ -66,6 +66,19 @@ func TestUserClonePermissionsNoLists(t *testing.T) {
}
}
+func TestUserCloneNoPermissions(t *testing.T) {
+ user := &User{
+ Username: "foo",
+ Password: "bar",
+ }
+
+ clone := user.clone()
+
+ if clone.Permissions != nil {
+ t.Fatalf("Expected Permissions to be nil, got: %v", clone.Permissions)
+ }
+}
+
func TestUserCloneNil(t *testing.T) {
user := (*User)(nil)
clone := user.clone() | Add User clone test for nil Permissions | nats-io_gnatsd | train | go |
7caca06cfc28fab22ec9c3a2d1363fec8d8c1951 | diff --git a/src/fx/fx.js b/src/fx/fx.js
index <HASH>..<HASH> 100644
--- a/src/fx/fx.js
+++ b/src/fx/fx.js
@@ -415,7 +415,8 @@ jQuery.extend({
// Get the current size
z.cur = function(){
- return parseFloat( jQuery.curCSS(z.el, prop) ) || z.max();
+ var r = parseFloat( jQuery.curCSS(z.el, prop) );
+ return r && r > -10000 ? r : z.max();
};
// Start an animation from one number to another | Fixed the giant negative number issue that Opera was having. | jquery_jquery | train | js |
041016f804b4377d6aef394eb906ad8e89bbd8b0 | diff --git a/client.js b/client.js
index <HASH>..<HASH> 100644
--- a/client.js
+++ b/client.js
@@ -1,4 +1,4 @@
-pipe.on('search::render', function render(pagelet) {
+pipe.on('search:render', function render(pagelet) {
'use strict';
var placeholders = $(pagelet.placeholders); | [migrate] Support bigpipe <I> | nodejitsu_npm-search-pagelet | train | js |
f458f6e7b466f66c032fa758a3838a34c376f74a | diff --git a/cassiopeia/dto/matchapi.py b/cassiopeia/dto/matchapi.py
index <HASH>..<HASH> 100644
--- a/cassiopeia/dto/matchapi.py
+++ b/cassiopeia/dto/matchapi.py
@@ -1,7 +1,7 @@
import cassiopeia.dto.requests
import cassiopeia.type.dto.match
-def get_match(id_):
+def get_match(id_, includeTimeline=True):
"""https://developer.riotgames.com/api/methods#!/1014/3442
id_ int the ID of the match to get
@@ -9,4 +9,4 @@ def get_match(id_):
return MatchDetail the match
"""
request = "{version}/match/{id_}".format(version=cassiopeia.dto.requests.api_versions["match"], id_=id_)
- return cassiopeia.type.dto.match.MatchDetail(cassiopeia.dto.requests.get(request, {"includeTimeline": True}))
\ No newline at end of file
+ return cassiopeia.type.dto.match.MatchDetail(cassiopeia.dto.requests.get(request, {"includeTimeline": includeTimeline}))
\ No newline at end of file | Exposed the option to get the timeline to the api | meraki-analytics_cassiopeia | train | py |
3aaffba32f7100ed707e6aab5727b199e9be8d2d | diff --git a/lib/joint.rb b/lib/joint.rb
index <HASH>..<HASH> 100755
--- a/lib/joint.rb
+++ b/lib/joint.rb
@@ -49,10 +49,6 @@ module Joint
@grid ||= Mongo::Grid.new(database)
end
- def attachments
- self.class.attachment_names.map { |name| self.send(name) }
- end
-
private
def assigned_attachments
@assigned_attachments ||= {}
@@ -62,18 +58,12 @@ module Joint
@nil_attachments ||= Set.new
end
- def attachment(name)
- self.send(name)
- end
-
# IO must respond to read and rewind
def save_attachments
assigned_attachments.each_pair do |name, io|
next unless io.respond_to?(:read)
- # puts "before: #{database['fs.files'].find().to_a.inspect}"
- grid.delete(send(name).id)
- # puts "after: #{database['fs.files'].find().to_a.inspect}"
io.rewind if io.respond_to?(:rewind)
+ grid.delete(send(name).id)
grid.put(io.read, send(name).name, {
:_id => send(name).id,
:content_type => send(name).type,
@@ -88,7 +78,7 @@ module Joint
end
def destroy_all_attachments
- attachments.each { |attachment| grid.delete(attachment.id) }
+ self.class.attachment_names.map { |name| grid.delete(send(name).id) }
end
end | Removed attachment and attachments methods. Really not needed. | jnunemaker_joint | train | rb |
b6bd8ee506bdbc875fbd64cd5bb654422b9ec47a | diff --git a/Controller/CartController.php b/Controller/CartController.php
index <HASH>..<HASH> 100644
--- a/Controller/CartController.php
+++ b/Controller/CartController.php
@@ -121,7 +121,7 @@ class CartController extends BaseFrontController
*/
protected function getCartEvent()
{
- $cart = $this->getCart($this->getRequest());
+ $cart = $this->getCart($this->getDispatcher(), $this->getRequest());
return new CartEvent($cart);
}
diff --git a/Controller/CustomerController.php b/Controller/CustomerController.php
index <HASH>..<HASH> 100644
--- a/Controller/CustomerController.php
+++ b/Controller/CustomerController.php
@@ -125,7 +125,7 @@ class CustomerController extends BaseFrontController
$this->processLogin($customerCreateEvent->getCustomer());
- $cart = $this->getCart($this->getRequest());
+ $cart = $this->getCart($this->getDispatcher(), $this->getRequest());
if ($cart->getCartItems()->count() > 0) {
$this->redirectToRoute('cart.view');
} else { | Removes container from all Thelia actions, but Modules (#<I>) | thelia-modules_Front | train | php,php |
0e299a65b18cf93bf10089b7c540008f7f7faf20 | diff --git a/components/hoc/Portal.js b/components/hoc/Portal.js
index <HASH>..<HASH> 100644
--- a/components/hoc/Portal.js
+++ b/components/hoc/Portal.js
@@ -7,6 +7,7 @@ class Portal extends Component {
children: PropTypes.node,
className: PropTypes.string,
container: PropTypes.node,
+ style: PropTypes.style,
}
static defaultProps = {
@@ -55,7 +56,11 @@ class Portal extends Component {
_getOverlay() {
if (!this.props.children) return null;
- return <div className={this.props.className}>{this.props.children}</div>;
+ return (
+ <div className={this.props.className} style={this.props.style}>
+ {this.props.children}
+ </div>
+ );
}
_renderOverlay() { | allows the Portal HOC root element to receive a style props. This allows coordinate runtime positioning of the portal element using top/left/bottom/right values (#<I>) | react-toolbox_react-toolbox | train | js |
383141a11b3b792c6269b3ae09ea17238c4f4f06 | diff --git a/modules/orionode/lib/cf/apps.js b/modules/orionode/lib/cf/apps.js
index <HASH>..<HASH> 100644
--- a/modules/orionode/lib/cf/apps.js
+++ b/modules/orionode/lib/cf/apps.js
@@ -542,7 +542,7 @@ function bindRoute(req, appTarget){
function uploadBits(req, appTarget){
var cloudAccessToken;
var archiveredFilePath;
- return target.getAccessToken(req.user.username)
+ return target.getAccessToken(req.user.username, appTarget)
.then(function(token){
cloudAccessToken = token;
return archiveTarget(appCache.appStore)
diff --git a/modules/orionode/lib/cf/logz.js b/modules/orionode/lib/cf/logz.js
index <HASH>..<HASH> 100644
--- a/modules/orionode/lib/cf/logz.js
+++ b/modules/orionode/lib/cf/logz.js
@@ -41,7 +41,7 @@ module.exports.router = function() {
};
return target.cfRequest(null, req.user.username, infoURL, null, null, infoHeader, null, targetRequest);
}).then(function(infoData) {
- return target.getAccessToken(req.user.username)
+ return target.getAccessToken(req.user.username, targetRequest)
.then(function(cloudAccessToken){
loggingEndpoint = infoData.logging_endpoint; | Bug <I> - Should pass appTarget to all getAccessToken methods. | eclipse_orion.client | train | js,js |
982210450b41cf7c55999500877c2604e1577087 | diff --git a/tests/tests.py b/tests/tests.py
index <HASH>..<HASH> 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -63,6 +63,14 @@ class FilePickerTests(FileUploadTestCase):
response = self.client.get('/adminfiles/all/?field=test')
self.assertContains(response, 'href="/media/adminfiles/tiny.png"')
self.assertContains(response, 'href="/media/adminfiles/somefile.txt')
+
+ def test_browser_links(self):
+ """
+ Test correct rendering of browser links.
+
+ """
+ response = self.client.get('/adminfiles/all/?field=test')
+ self.assertContains(response, 'href="/adminfiles/images/?field=test')
def test_images_picker_loads(self):
response = self.client.get('/adminfiles/images/?field=test') | add test for issue <I>: Browsers names not showing | carljm_django-adminfiles | train | py |
eb97811783a3998911e8c0d8328877277d6ad37b | diff --git a/packages/backpack-core/config/webpack.config.js b/packages/backpack-core/config/webpack.config.js
index <HASH>..<HASH> 100644
--- a/packages/backpack-core/config/webpack.config.js
+++ b/packages/backpack-core/config/webpack.config.js
@@ -125,7 +125,7 @@ module.exports = options => {
'source-map-support/register'
: // It's not under the project, it's linked via lerna.
require.resolve('source-map-support/register')
- }')`,
+ }');`,
}),
// The FriendlyErrorsWebpackPlugin (when combined with source-maps)
// gives Backpack its human-readable error messages. | Add semicolon to source-map-support banner to fix 'require() is not a function' error (#<I>) | jaredpalmer_backpack | train | js |
3d6656020910f0c568583e0f0c310cd0e17f3b6d | diff --git a/psiturk/psiturk_config.py b/psiturk/psiturk_config.py
index <HASH>..<HASH> 100644
--- a/psiturk/psiturk_config.py
+++ b/psiturk/psiturk_config.py
@@ -8,6 +8,9 @@ class PsiturkConfig(SafeConfigParser):
self.parent.__init__(self, **kwargs)
self.localFile = localConfig
self.globalFile = os.path.expanduser(globalConfig)
+ # psiturkConfig contains two additional SafeConfigParser's holding the values
+ # of the local and global config files. This lets us write to the local or global file
+ # separately without writing all fields to both.
self.localParser = self.parent(**kwargs)
self.globalParser = self.parent(**kwargs)
@@ -23,9 +26,14 @@ class PsiturkConfig(SafeConfigParser):
print "No '.psiturkconfig' file found in your home directory.\nCreating default '.psiturkconfig' file."
file_util.copy_file(global_defaults_file, self.globalFile)
self.globalParser.read(self.globalFile)
+ # read default global and local, then user's global and local. This way
+ # any field not in the user's files will be set to the default value.
self.read([global_defaults_file, local_defaults_file, self.globalFile, self.localFile])
def write(self, changeGlobal=False):
+ """
+ write to the user's global or local config file.
+ """
filename = self.localFile
configObject = self.localParser
if changeGlobal: | add some comments to PsiturkConfig
Might not be clear why things work the way they do otherwise... | NYUCCL_psiTurk | train | py |
a3f8065554b0b555a785666708d00c01cebd08c7 | diff --git a/src/uki-core/view/focusable.js b/src/uki-core/view/focusable.js
index <HASH>..<HASH> 100644
--- a/src/uki-core/view/focusable.js
+++ b/src/uki-core/view/focusable.js
@@ -57,7 +57,7 @@ uki.view.Focusable = {
if (!preCreatedInput) this.bind('mousedown', function(e) {
setTimeout(uki.proxy(function() {
- this._focusableInput.disabled || this._focusableInput.focus();
+ try { this._focusableInput.disabled || this._focusableInput.focus(); } catch (e) {};
}, this), 1);
});
},
@@ -73,7 +73,7 @@ uki.view.Focusable = {
},
blur: function() {
- this._focusableInput.blur()
+ this._focusableInput.blur();
},
hasFocus: function() { | fix: ie fails to focus sometimes | voloko_uki | train | js |
9791ca97d8eed1fad7a77aa8e64d91a7cae348fe | diff --git a/structr-core/src/main/java/org/structr/common/VersionHelper.java b/structr-core/src/main/java/org/structr/common/VersionHelper.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/common/VersionHelper.java
+++ b/structr-core/src/main/java/org/structr/common/VersionHelper.java
@@ -42,7 +42,7 @@ public class VersionHelper {
classPath = System.getProperty("java.class.path");
final Pattern outerPattern = Pattern.compile("(structr-[^:]*\\.jar)");
- final Pattern innerPattern = Pattern.compile("(structr-core|structr-rest|structr-ui|structr)-([^-]*(?:-SNAPSHOT|-rc\\d){0,1})-{0,1}(?:([0-9]{0,12})\\.{0,1}([0-9a-f]{0,6}))\\.jar");
+ final Pattern innerPattern = Pattern.compile("(structr-core|structr-rest|structr-ui|structr)-([^-]*(?:-SNAPSHOT|-rc\\d){0,1})-{0,1}(?:([0-9]{0,12})\\.{0,1}([0-9a-f]{0,32}))\\.jar");
final Matcher outerMatcher = outerPattern.matcher(classPath); | Minor: Modifies regex to support <I> characters for short version string. | structr_structr | train | java |
12a645eeeeab9f8b6e843f2f7898a8ffe6f1b50d | diff --git a/examples/core/parallelize.js b/examples/core/parallelize.js
index <HASH>..<HASH> 100755
--- a/examples/core/parallelize.js
+++ b/examples/core/parallelize.js
@@ -2,10 +2,10 @@
var sc = require('skale-engine').context();
-sc.parallelize([1, 2, 3, 4], 1)
+sc.parallelize([1, 2, 3, 4, 5])
.collect()
.toArray(function(err, res) {
console.log(res);
- console.assert(JSON.stringify(res) === JSON.stringify([1, 2, 3, 4]));
+ console.assert(JSON.stringify(res) === JSON.stringify([1, 2, 3, 4, 5]));
sc.end();
}) | examples/parallelize: do not force number of partitions | skale-me_skale | train | js |
de5f1fe76eb012831833f4ea5f69f7b10a1832af | diff --git a/progressbar/bar.py b/progressbar/bar.py
index <HASH>..<HASH> 100644
--- a/progressbar/bar.py
+++ b/progressbar/bar.py
@@ -45,10 +45,12 @@ class DefaultFdMixin(ProgressBarMixinBase):
def update(self, *args, **kwargs):
ProgressBarMixinBase.update(self, *args, **kwargs)
self.fd.write('\r' + self._format_line())
+ self.fd.flush()
def finish(self, *args, **kwargs): # pragma: no cover
ProgressBarMixinBase.finish(self, *args, **kwargs)
self.fd.write('\n')
+ self.fd.flush()
class ResizableMixin(ProgressBarMixinBase): | made sure to flush after writing to stream | WoLpH_python-progressbar | train | py |
e418443be2be34dc3ea79fdba87e801e49347431 | diff --git a/spyderlib/widgets/sourcecode/base.py b/spyderlib/widgets/sourcecode/base.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/sourcecode/base.py
+++ b/spyderlib/widgets/sourcecode/base.py
@@ -157,10 +157,12 @@ class CompletionWidget(QListWidget):
def focusOutEvent(self, event):
event.ignore()
+ # Don't hide it on Mac when main window loses focus because
+ # keyboard input is lost
# Fixes Issue 1318
- if (sys.platform == "darwin") and \
- (event.reason() != Qt.ActiveWindowFocusReason):
- self.hide()
+ if sys.platform == "darwin":
+ if event.reason() != Qt.ActiveWindowFocusReason:
+ self.hide()
else:
self.hide() | Completion Widget: Fix revision 5a<I>a2fc1c6 because it wasn't working as expected
Update Issue <I>
Status: Verified
- I commited the previous revision without testing, thinking that it
would work without problems.
- I also added a comment explaining the purpose of the change. | spyder-ide_spyder | train | py |
0334fee5509b8cb3fd6ca3c1a6025804be978107 | diff --git a/kafka/consumer/__init__.py b/kafka/consumer/__init__.py
index <HASH>..<HASH> 100644
--- a/kafka/consumer/__init__.py
+++ b/kafka/consumer/__init__.py
@@ -1,6 +1,6 @@
from .simple import SimpleConsumer
from .multiprocess import MultiProcessConsumer
-from .kafka import KafkaConsumer
+from .group import KafkaConsumer
__all__ = [
'SimpleConsumer', 'MultiProcessConsumer', 'KafkaConsumer' | Switch to new KafkaConsumer in module imports | dpkp_kafka-python | train | py |
7f2b5cc88c0ff1656d985c1f29bc4faeedd66f03 | diff --git a/graylog2-server/src/main/java/org/graylog2/rest/resources/users/requests/ChangePasswordRequest.java b/graylog2-server/src/main/java/org/graylog2/rest/resources/users/requests/ChangePasswordRequest.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog2/rest/resources/users/requests/ChangePasswordRequest.java
+++ b/graylog2-server/src/main/java/org/graylog2/rest/resources/users/requests/ChangePasswordRequest.java
@@ -22,17 +22,20 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.auto.value.AutoValue;
import org.hibernate.validator.constraints.NotEmpty;
+import javax.annotation.Nullable;
+
@JsonAutoDetect
@AutoValue
public abstract class ChangePasswordRequest {
@JsonProperty
+ @Nullable
public abstract String oldPassword();
@JsonProperty
public abstract String password();
@JsonCreator
- public static ChangePasswordRequest create(@JsonProperty("old_password") @NotEmpty String oldPassword,
+ public static ChangePasswordRequest create(@JsonProperty("old_password") @Nullable String oldPassword,
@JsonProperty("password") @NotEmpty String password) {
return new AutoValue_ChangePasswordRequest(oldPassword, password);
} | Relaxing constraints for old password field that might be null.
Fixes Graylog2/graylog2-web-interface#<I> | Graylog2_graylog2-server | train | java |
74043e825cdc4d902f198cf288d526e0a0c4790a | diff --git a/simuvex/s_format.py b/simuvex/s_format.py
index <HASH>..<HASH> 100644
--- a/simuvex/s_format.py
+++ b/simuvex/s_format.py
@@ -56,7 +56,7 @@ class FormatString(object):
i_val = args(argpos)
c_val = int(self.parser.state.se.any_int(i_val))
c_val &= (1 << (fmt_spec.size * 8)) - 1
- if fmt_spec.signed:
+ if fmt_spec.signed and (c_val & (1 << ((fmt_spec.size * 8) - 1))):
c_val -= (1 << fmt_spec.size * 8)
if fmt_spec.spec_type == 'd': | Only invert the sign of an argument if it is signed | angr_angr | train | py |
23ffb2c63529c85538285465669b0b01a3c85ffe | diff --git a/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java b/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java
+++ b/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java
@@ -287,7 +287,8 @@ public class SelectBooleanCheckboxRenderer extends CoreRenderer {
throws IOException {
rw.startElement("input", selectBooleanCheckbox);
rw.writeAttribute("name", clientId+"_helper", null);
- rw.writeAttribute("value", "oxff", "value");
+ rw.writeAttribute("value", "on", "value");
+ rw.writeAttribute("checked", "true", "checked");
rw.writeAttribute("type", "hidden", "type");
rw.writeAttribute("style", "display:none", "style");
rw.endElement("input"); | Bugfix: you couldn't uncheck a checkbox (probably this error was caused
by AngularFaces) | TheCoder4eu_BootsFaces-OSP | train | java |
59fd14dec8523c2e42d9ed5ca2b7939d226a7d2a | diff --git a/SoftLayer/CLI/dedicatedhost/create_options.py b/SoftLayer/CLI/dedicatedhost/create_options.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/CLI/dedicatedhost/create_options.py
+++ b/SoftLayer/CLI/dedicatedhost/create_options.py
@@ -58,4 +58,4 @@ def cli(env, **kwargs):
br_table.add_row([router['hostname']])
tables.append(br_table)
- env.fout(formatting.listing(tables, separator='\n'))
+ env.fout(tables)
diff --git a/SoftLayer/CLI/hardware/create_options.py b/SoftLayer/CLI/hardware/create_options.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/CLI/hardware/create_options.py
+++ b/SoftLayer/CLI/hardware/create_options.py
@@ -51,9 +51,7 @@ def cli(env, prices, location=None):
tables.append(_port_speed_prices_table(options['port_speeds'], prices))
tables.append(_extras_prices_table(options['extras'], prices))
tables.append(_get_routers(routers))
-
- # since this is multiple tables, this is required for a valid JSON object to be rendered.
- env.fout(formatting.listing(tables, separator='\n'))
+ env.fout(tables)
def _preset_prices_table(sizes, prices=False): | Change form to print the multiples tables | softlayer_softlayer-python | train | py,py |
8d99ea823a1c2424c2c1d4356b29b4cbace24829 | diff --git a/dump2polarion/dumper_cli.py b/dump2polarion/dumper_cli.py
index <HASH>..<HASH> 100644
--- a/dump2polarion/dumper_cli.py
+++ b/dump2polarion/dumper_cli.py
@@ -129,7 +129,7 @@ def submit_if_ready(args, submit_args, config):
return None
# TODO: better detection of xunit file that is ready for import needed
- if "<testsuites" in xml and "<properties>" not in xml:
+ if "<testsuites" in xml and 'name="pytest"' in xml:
return None
if args.no_submit: | Fix pytest junit file detection | mkoura_dump2polarion | train | py |
3e82d38ebc0903f90d11491a2b12d9e289d47b8b | diff --git a/lib/merb-core/core_ext/set.rb b/lib/merb-core/core_ext/set.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core/core_ext/set.rb
+++ b/lib/merb-core/core_ext/set.rb
@@ -26,7 +26,6 @@ module Merb
# SimpleSet:: The set after the Array was merged in.
def merge(arr)
super(arr.inject({}) {|s,x| s[x] = true; s })
- self
end
# ==== Returns
diff --git a/spec/public/abstract_controller/controllers/helpers.rb b/spec/public/abstract_controller/controllers/helpers.rb
index <HASH>..<HASH> 100644
--- a/spec/public/abstract_controller/controllers/helpers.rb
+++ b/spec/public/abstract_controller/controllers/helpers.rb
@@ -1,7 +1,7 @@
module Merb::Test::Fixtures
module Abstract
- class Testing < Merb::AbstractController
+ class HelperTesting < Merb::AbstractController
self._template_root = File.dirname(__FILE__) / "views"
def _template_location(action, type = nil, controller = controller_name)
@@ -9,7 +9,7 @@ module Merb::Test::Fixtures
end
end
- class Capture < Testing
+ class Capture < HelperTesting
def index
render
end
@@ -21,7 +21,7 @@ module Merb::Test::Fixtures
end
end
- class Concat < Testing
+ class Concat < HelperTesting
def index
render
end | Fixes <I> fails | wycats_merb | train | rb,rb |
7029adb797b75afdac28d57853955ea0e294fe20 | diff --git a/worker/buildbot_worker/scripts/runner.py b/worker/buildbot_worker/scripts/runner.py
index <HASH>..<HASH> 100644
--- a/worker/buildbot_worker/scripts/runner.py
+++ b/worker/buildbot_worker/scripts/runner.py
@@ -95,7 +95,7 @@ class RestartOptions(MakerBase):
class UpgradeWorkerOptions(MakerBase):
- subcommandFunction = "buildbot_worker.scripts.upgrade_slave.upgradeWorker"
+ subcommandFunction = "buildbot_worker.scripts.upgrade_worker.upgradeWorker"
optFlags = [
]
optParameters = [ | fix missed upgrade_slave module rename | buildbot_buildbot | train | py |
477d7c39fbd01184e7c53c4668cc0996a20d57d6 | diff --git a/tcconfig/tcshow.py b/tcconfig/tcshow.py
index <HASH>..<HASH> 100644
--- a/tcconfig/tcshow.py
+++ b/tcconfig/tcshow.py
@@ -68,7 +68,7 @@ def main():
).get_tc_parameter()
)
except NetworkInterfaceNotFoundError as e:
- logger.debug(msgfy.to_debug_message(e))
+ logger.warn(e)
continue
command_history = "\n".join(spr.SubprocessRunner.get_history()) | Change a message log level from debug to warning | thombashi_tcconfig | train | py |
8bd941fa8ba3bc0885b12cf1148c3758004cc1dc | diff --git a/rrrspec-web/lib/rrrspec/web/api.rb b/rrrspec-web/lib/rrrspec/web/api.rb
index <HASH>..<HASH> 100644
--- a/rrrspec-web/lib/rrrspec/web/api.rb
+++ b/rrrspec-web/lib/rrrspec/web/api.rb
@@ -4,9 +4,12 @@ require 'oj'
module RRRSpec
module Web
+ DEFAULT_PER_PAGE = 10
+
class API < Grape::API
version 'v1', using: :path
format :json
+ set :per_page, DEFAULT_PER_PAGE
resource :tasksets do
desc "Return active tasksets"
@@ -63,6 +66,7 @@ module RRRSpec
version 'v2', using: :path
format :json
formatter :json, OjFormatter
+ set :per_page, DEFAULT_PER_PAGE
rescue_from(ActiveRecord::RecordNotFound) do
[404, {}, ['']] | Fix default per_page for api-pagination >= <I>
The default per_page value was changed from <I> to <I> since
api-pagination <I>. | cookpad_rrrspec | train | rb |
3f0994cc1c03b797276b2e2d10e10328fe765c60 | diff --git a/views/helpers/tinymce.php b/views/helpers/tinymce.php
index <HASH>..<HASH> 100644
--- a/views/helpers/tinymce.php
+++ b/views/helpers/tinymce.php
@@ -97,7 +97,7 @@ class TinymceHelper extends AppHelper {
$selector = "data[{$this->__modelFieldPair['model']}][{$this->__modelFieldPair['field']}]";
if (isset($options['class'])) {
- $options['class'] .= $selector;
+ $options['class'] .= ' ' . $selector;
} else {
$options['class'] = $selector;
}
@@ -114,12 +114,12 @@ class TinymceHelper extends AppHelper {
* @return string An HTML textarea element with TinyMCE
*/
function textarea($field, $options = array(), $tinyoptions = array()) {
- $options['type'] = 'textareas';
+ $options['type'] = 'textarea';
$this->__field($field);
$selector = "data[{$this->__modelFieldPair['model']}][{$this->__modelFieldPair['field']}]";
if (isset($options['class'])) {
- $options['class'] .= $selector;
+ $options['class'] .= ' ' . $selector;
} else {
$options['class'] = $selector;
} | with options place needed space between current class setting and added and model data selector class | josegonzalez_cakephp-wysiwyg | train | php |
ab02c072bdb1b080ed030e91688c651051edca42 | diff --git a/core/Version.php b/core/Version.php
index <HASH>..<HASH> 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -1,6 +1,6 @@
<?php
final class Piwik_Version {
- const VERSION = '0.2.14';
+ const VERSION = '0.2.16';
} | - I messed up with the version file (really need the build script to sanity check...!!)
git-svn-id: <URL> | matomo-org_matomo | train | php |
3420637f1502d75eb6e7ac001478e81a2ad18f5e | diff --git a/src/Model/Invoice.php b/src/Model/Invoice.php
index <HASH>..<HASH> 100644
--- a/src/Model/Invoice.php
+++ b/src/Model/Invoice.php
@@ -15,6 +15,7 @@ namespace Nails\Invoice\Model;
use Nails\Common\Model\Base;
use Nails\Factory;
use Nails\Invoice\Exception\InvoiceException;
+use Nails\Invoice\Factory\Invoice\Item;
class Invoice extends Base
{
@@ -460,6 +461,10 @@ class Invoice extends Base
$aTaxIds = [];
foreach ($aData['items'] as &$aItem) {
+ if ($aItem instanceof Item) {
+ $aItem = $aItem->toArray();
+ }
+
// Has an ID or is null
$aItem['id'] = !empty($aItem['id']) ? (int) $aItem['id'] : null; | Supporting using Factory Items whenc reating invoices | nails_module-invoice | train | php |
cd41d5b352000a934df52d17e530b38e0dccb621 | diff --git a/test/test_queue_consumer.py b/test/test_queue_consumer.py
index <HASH>..<HASH> 100644
--- a/test/test_queue_consumer.py
+++ b/test/test_queue_consumer.py
@@ -299,7 +299,5 @@ def test_kill_closes_connections(rabbit_manager, rabbit_config):
# kill should close all connections
queue_consumer.kill(Exception('test-kill'))
- def check_connections_closed():
- connections = rabbit_manager.get_connections()
- assert connections is None
- assert_stops_raising(check_connections_closed)
+ connections = rabbit_manager.get_connections()
+ assert connections is None | no longer need assert_stops_raising wrapper | nameko_nameko | train | py |
1a72f3c41b3e7ad076a5fd8e020f26f35b9e4a62 | diff --git a/gobgp/main.go b/gobgp/main.go
index <HASH>..<HASH> 100644
--- a/gobgp/main.go
+++ b/gobgp/main.go
@@ -355,7 +355,7 @@ func (x *ShowNeighborRibCommand) Execute(args []string) error {
rt = "ipv6"
}
} else {
- rt = args[1]
+ rt = args[0]
}
b := get("neighbor/" + x.remoteIP.String() + "/" + x.resource + "/" + rt) | gobgp: fix showing rib with a specific route family | osrg_gobgp | train | go |
6ddf845c25b6e0288e387e2d19ab0b48b11c6dc0 | diff --git a/lib/puppet/pops/validation/checker3_1.rb b/lib/puppet/pops/validation/checker3_1.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/pops/validation/checker3_1.rb
+++ b/lib/puppet/pops/validation/checker3_1.rb
@@ -126,7 +126,7 @@ class Puppet::Pops::Validation::Checker3_1
case o.left_expr
when Model::QualifiedName
# allows many keys, but the name should really be a QualifiedReference
- acceptor.accept(Issues::DEPRECATED_NAME_AS_TYPE, o, :name => o.value)
+ acceptor.accept(Issues::DEPRECATED_NAME_AS_TYPE, o, :name => o.left_expr.value)
when Model::QualifiedReference
# ok, allows many - this is a resource reference | (#<I>) Fix failing validation.
Validation of deprecated resource references using QualifiedName
(i.e. a lower case bare word) instead of QualifiedReference (i.e.
an upper cased bare word) should have accessed the `value` of the
instructions `left_expr`, but instead did this on the instruction
itself.
This fixes one part of the issue #<I> which gives users a better clue
how to work around the issue. | puppetlabs_puppet | train | rb |
b96dc972e0162cdf44a630ce7ab048457bbc150b | diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb
index <HASH>..<HASH> 100644
--- a/plugins/guests/redhat/cap/nfs_client.rb
+++ b/plugins/guests/redhat/cap/nfs_client.rb
@@ -4,7 +4,8 @@ module VagrantPlugins
class NFSClient
def self.nfs_client_install(machine)
machine.communicate.tap do |comm|
- comm.sudo("yum -y install nfs-utils nfs-utils-lib")
+ comm.sudo("yum -y install nfs-utils nfs-utils-lib avahi")
+ comm.sudo("/etc/init.d/rpcbind restart; /etc/init.d/nfs restart")
end
end
end | install rpc package while installing nfs client on centos guests | hashicorp_vagrant | train | rb |
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.