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
5cc13d2e268603ff9127402fbfc5c1ed21b99192
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -18,6 +18,7 @@ module.exports = { "no-unused-expressions": 0, "no-use-before-define": 0, "react/sort-comp": 0, - "react/no-multi-comp": 0 + "react/no-multi-comp": 0, + "react/require-extension": 0 } };
Update eslint.rc Removed a rule that gave a console log error when running npm start.
Stupidism_stupid-rc-starter
train
js
a0972e3855a3766c426a83a220292af30a95cce9
diff --git a/src/Select.js b/src/Select.js index <HASH>..<HASH> 100644 --- a/src/Select.js +++ b/src/Select.js @@ -1009,7 +1009,14 @@ const Select = React.createClass({ let focusedOption = this.state.focusedOption || selectedOption; if (focusedOption && !focusedOption.disabled) { - const focusedOptionIndex = options.findIndex(option => option.value === focusedOption.value); + let focusedOptionIndex = -1; + options.some((option, index) => { + const isOptionEqual = option.value === focusedOption.value; + if (isOptionEqual) { + focusedOptionIndex = index; + } + return isOptionEqual; + }); if (focusedOptionIndex !== -1) { return focusedOptionIndex; }
Fixed bug. Looking for focusedOption can return incorrect value in case when focusedOption not equal to any element of array, IE compatible
HubSpot_react-select-plus
train
js
2f9df55d8d08bb9fb491893cba0f903e56dd1a8f
diff --git a/webapps/webapp/src/main/webapp/app/cockpit/pages/processInstance.js b/webapps/webapp/src/main/webapp/app/cockpit/pages/processInstance.js index <HASH>..<HASH> 100644 --- a/webapps/webapp/src/main/webapp/app/cockpit/pages/processInstance.js +++ b/webapps/webapp/src/main/webapp/app/cockpit/pages/processInstance.js @@ -233,7 +233,9 @@ ngDefine('cockpit.pages.processInstance', [ child.name = getActivityName(bpmnElement); activityIdToInstancesMap[activityId] = instances; - instanceIdToInstanceMap[child.id] = child; + if(!instanceIdToInstanceMap[child.id]) { + instanceIdToInstanceMap[child.id] = child; + } instances.push(child); decorateActivityInstanceTree(child); @@ -250,7 +252,9 @@ ngDefine('cockpit.pages.processInstance', [ transition.name = getActivityName(bpmnElement); activityIdToInstancesMap[activityId] = instances; - instanceIdToInstanceMap[transition.id] = transition; + if(!instanceIdToInstanceMap[transition.id]) { + instanceIdToInstanceMap[transition.id] = transition; + } instances.push(transition); } }
fix(cockpit): variable scope with TransitionInst - set correct variable scope for variables in Transition Instance related to #CAM-<I>
camunda_camunda-bpm-platform
train
js
04bd4e440a46f2ccbc070ce750f064ca8705c484
diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index <HASH>..<HASH> 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -204,6 +204,7 @@ module.exports = function (grunt) { html: '<%%= yeoman.app %>/index.html', options: { dest: '<%%= yeoman.dist %>', + staging: '<%%= yeoman.temp %>', flow: { html: { steps: { @@ -228,7 +229,7 @@ module.exports = function (grunt) { // The following *-min tasks produce minified files in the dist folder cssmin: { options: { - root: '<%%= yeoman.app %>', + //root: '<%= yeoman.app %>', noRebase: true } },
Added fixes for usemin to adjust to new directory structure (<URL>)
diegonetto_generator-ionic
train
js
57880e4198b8b7eba88a04fc947ebab08a04a172
diff --git a/integration_tests/blockstack_integration_tests/scenarios/testlib.py b/integration_tests/blockstack_integration_tests/scenarios/testlib.py index <HASH>..<HASH> 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/testlib.py +++ b/integration_tests/blockstack_integration_tests/scenarios/testlib.py @@ -159,8 +159,9 @@ class TestAPIProxy(object): client_config = blockstack_client.get_config(client_path) log.debug("Connect to Blockstack node at {}:{}".format(client_config['server'], client_config['port'])) - self.client = blockstack_client.BlockstackRPCClient( + self.client = blockstack.lib.client.BlockstackRPCClient( client_config['server'], client_config['port'], protocol = client_config['protocol']) + self.config_path = client_path self.conf = { "start_block": blockstack.FIRST_BLOCK_MAINNET,
use blockstack's client, not blockstack_client's client
blockstack_blockstack-core
train
py
b645613975c5ab73ea3df7aaf048338946b70aa3
diff --git a/handlers/awsJobs.js b/handlers/awsJobs.js index <HASH>..<HASH> 100644 --- a/handlers/awsJobs.js +++ b/handlers/awsJobs.js @@ -417,7 +417,7 @@ let handlers = { if(job.analysis.status === 'CANCELED') return callback ? callback(null, job) : job; aws.batch.getAnalysisJobs(job, (err, jobs) => { - if(err) {return callback(err);} + if(err) {return callback ? callback(err) : err;} //check jobs status let analysis = {}; let createdDate = job.analysis.created;
check to make sure callback exists before calling in getJobStatus
OpenNeuroOrg_openneuro
train
js
69f780c3343d5611ef450f4e10c5662bafc6068b
diff --git a/lib/slap.js b/lib/slap.js index <HASH>..<HASH> 100644 --- a/lib/slap.js +++ b/lib/slap.js @@ -58,10 +58,14 @@ Slap.prototype.save = function (path) { var text = self.editor.text(); fs.writeFile(path, text, function (err) { - if (err) { throw err; } - self.path(path); - self.editor.changeStack.save(); - self.emit('save', path, text); + if (!err) { + self.path(path); + self.editor.changeStack.save(); + self.emit('save', path, text); + } else { + if (err.code === 'EACCES') { self.message(err.message, 'error'); } + else { throw err; } + } }); };
Don't exit if cannot write to file
slap-editor_slap
train
js
3d08af292693d12e5f331994147f4445e7e22eac
diff --git a/trimesh/scene/scene.py b/trimesh/scene/scene.py index <HASH>..<HASH> 100644 --- a/trimesh/scene/scene.py +++ b/trimesh/scene/scene.py @@ -63,7 +63,9 @@ class Scene(Geometry): def add_geometry(self, geometry, node_name=None, - geom_name=None): + geom_name=None, + parent_node_name=None, + transform=None): """ Add a geometry to the scene. @@ -75,6 +77,8 @@ class Scene(Geometry): ---------- geometry: Trimesh, Path3D, or list of same node_name: name in the scene graph + parent_node_name: name of parent node in the scene graph + transform: (4, 4) float, transformation matrix Returns ---------- @@ -123,9 +127,12 @@ class Scene(Geometry): # geometry name + UUID node_name = name + '_' + unique.upper() - # create an identity transform from world - transform = np.eye(4) + if transform is None: + # create an identity transform from parent_node + transform = np.eye(4) + self.graph.update(frame_to=node_name, + frame_from=parent_node_name, matrix=transform, geometry=name, geometry_flags={'visible': True})
Add parent_node and transform to add_geometry
mikedh_trimesh
train
py
dfe8e998d2e0ffab6c879d898c4138aaa05c9a43
diff --git a/extensions/test/filter/Syntax.php b/extensions/test/filter/Syntax.php index <HASH>..<HASH> 100644 --- a/extensions/test/filter/Syntax.php +++ b/extensions/test/filter/Syntax.php @@ -8,6 +8,7 @@ namespace li3_quality\extensions\test\filter; +use lithium\core\Libraries; use li3_quality\test\Rules; use li3_quality\test\Testable; @@ -20,12 +21,22 @@ class Syntax extends \lithium\test\Filter { * */ public static function apply($report, $tests, array $options = array()) { + $config = Libraries::get('li3_quality'); + + $ruleConfig = $config['path'] . '/test/defaultRules.json'; + $ruleConfig = json_decode(file_get_contents($ruleConfig), true); + + $filters = $ruleConfig['rules']; + + if (isset($ruleConfig['variables'])) { + Rules::ruleOptions($ruleConfig['variables']); + } + foreach ($tests->invoke('subject') as $class) { $report->collect(__CLASS__, array( - $class => Rules::apply(new Testable(array('path' => $class))) + $class => Rules::apply(new Testable(array('path' => $class)), $filters) )); } - return $tests; }
Use rules config in web test filter, too.
UnionOfRAD_li3_quality
train
php
68dc1d82fd4bbb63198558a98188eded09e1fe68
diff --git a/Twig/Extension/GrossumTwigSwitchLocaleExtension.php b/Twig/Extension/GrossumTwigSwitchLocaleExtension.php index <HASH>..<HASH> 100644 --- a/Twig/Extension/GrossumTwigSwitchLocaleExtension.php +++ b/Twig/Extension/GrossumTwigSwitchLocaleExtension.php @@ -11,7 +11,7 @@ use Symfony\Component\HttpKernel\HttpKernel; * Returns the current top level/main request route with a new locale */ -class LocalizedRouteExtension extends \Twig_Extension +class GrossumTwigSwitchLocaleExtension extends \Twig_Extension { private $request; private $router;
Added Twig Extension for switch locale
GrossumUA_CoreBundle
train
php
8a9afbb1aa36c6ba04142c6e6c1cfbd7de982a6a
diff --git a/github/Requester.py b/github/Requester.py index <HASH>..<HASH> 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -215,6 +215,4 @@ class Requester: requestHeaders["Authorization"] = "Basic (login and password removed)" elif requestHeaders["Authorization"].startswith("token"): requestHeaders["Authorization"] = "token (oauth token removed)" - else: # pragma no cover - requestHeaders["Authorization"] = "Unknown authorization removed" logger.debug("%s %s://%s%s %s %s ==> %i %s %s", str(verb), self.__scheme, self.__hostname, str(url), str(requestHeaders), str(input), status, str(responseHeaders), str(output)) diff --git a/github/tests/Framework.py b/github/tests/Framework.py index <HASH>..<HASH> 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -63,8 +63,6 @@ def fixAuthorizationHeader(headers): headers["Authorization"] = "token private_token_removed" elif headers["Authorization"].startswith("Basic "): headers["Authorization"] = "Basic login_and_password_removed" - else: # pragma no cover - assert False class RecordingConnection: # pragma no cover
Remove branches for hypothetical unknown Authorization headers
PyGithub_PyGithub
train
py,py
2c19f33032a2b5c772b921baf8ae8f62fd85545d
diff --git a/projects/samskivert/src/java/com/samskivert/swing/Label.java b/projects/samskivert/src/java/com/samskivert/swing/Label.java index <HASH>..<HASH> 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/Label.java +++ b/projects/samskivert/src/java/com/samskivert/swing/Label.java @@ -1,5 +1,5 @@ // -// $Id: Label.java,v 1.29 2002/12/02 21:55:45 mdb Exp $ +// $Id: Label.java,v 1.30 2002/12/06 21:52:35 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2002 Michael Bayne @@ -462,24 +462,6 @@ public class Label implements SwingConstants, LabelStyleConstants y += layout.getAscent(); float extra = (float)(_size.width - getWidth(lbounds)); - switch (_style) { - case OUTLINE: - // if we're outlining, we really have two pixels less space - // than we think we do - extra -= 2; - break; - - case SHADOW: - case BOLD: - // if we're rendering shadowed or bolded text, we really - // have one pixel less space than we think we do - extra -= 1; - break; - - default: - break; - } - float rx = x; switch (_align) { case -1: rx = x + (layout.isLeftToRight() ? 0 : extra); break;
And the hits just keep on coming: we no longer need to adjust our extra space calculations where we did because we're accounting for the shadow and outline space requirements from the get go. git-svn-id: <URL>
samskivert_samskivert
train
java
ad8447cc3560a61bb0f135c52edac770ede361bb
diff --git a/src/js/select2/utils.js b/src/js/select2/utils.js index <HASH>..<HASH> 100644 --- a/src/js/select2/utils.js +++ b/src/js/select2/utils.js @@ -124,9 +124,23 @@ define([ Observable.prototype.trigger = function (event) { var slice = Array.prototype.slice; + var params = slice.call(arguments, 1); this.listeners = this.listeners || {}; + // Params should always come in as an array + if (params == null) { + params = []; + } + + // If there are no arguments to the event, use a temporary object + if (params.length === 0) { + params.push({}); + } + + // Set the `_type` of the first object to the event + params[0]._type = event; + if (event in this.listeners) { this.invoke(this.listeners[event], slice.call(arguments, 1)); }
Add a new _type parameter for the first event argument This will include the event type in the _type property, so it can be accessed within the event handlers if it's not normally passed in. This should not conflict with any existing handlers, and this should not be considered a public property on event arguments.
select2_select2
train
js
d7e01c7dc454767d5eaf167543de57694d8154be
diff --git a/src/Analyser/Scope.php b/src/Analyser/Scope.php index <HASH>..<HASH> 100644 --- a/src/Analyser/Scope.php +++ b/src/Analyser/Scope.php @@ -417,9 +417,8 @@ class Scope $constantName = $node->name; if ($this->broker->hasClass($constantClass)) { $constantClassReflection = $this->broker->getClass($constantClass); - $constants = $constantClassReflection->getNativeReflection()->getConstants(); - if (array_key_exists($constantName, $constants)) { - $constantValue = $constants[$constantName]; + if ($constantClassReflection->hasConstant($constantName)) { + $constantValue = $constantClassReflection->getNativeReflection()->getConstant($constantName); $typeFromValue = $this->getTypeFromValue($constantValue); if ($typeFromValue !== null) { return $typeFromValue;
Simplified code around getting a type from a constant
phpstan_phpstan
train
php
819e1ed5e171b1567cd6a5a6bac389dc2b37bebc
diff --git a/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java b/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java index <HASH>..<HASH> 100644 --- a/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java +++ b/check_api/src/main/java/com/google/errorprone/scanner/ErrorProneScanner.java @@ -128,6 +128,7 @@ import com.sun.source.tree.VariableTree; import com.sun.source.tree.WhileLoopTree; import com.sun.source.tree.WildcardTree; import com.sun.source.util.TreePath; +import com.sun.tools.javac.code.Symbol.CompletionFailure; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; import java.lang.annotation.Annotation; import java.util.ArrayList; @@ -1193,6 +1194,9 @@ public class ErrorProneScanner extends Scanner { if (t instanceof ErrorProneError) { throw (ErrorProneError) t; } + if (t instanceof CompletionFailure) { + throw (CompletionFailure) t; + } TreePath path = getCurrentPath(); throw new ErrorProneError( s.canonicalName(),
Improve CompletionFailure crash handling RELNOTES: N/A ------------- Created by MOE: <URL>
google_error-prone
train
java
92f7a6f8a1ff45767e48707bab684c13c12a0eed
diff --git a/src/Database/Query/Builder.php b/src/Database/Query/Builder.php index <HASH>..<HASH> 100755 --- a/src/Database/Query/Builder.php +++ b/src/Database/Query/Builder.php @@ -9,10 +9,16 @@ class Builder extends BaseQueryBuilder public function whereIn($column, $values, $boolean = 'and', $not = false) { //Here we implement custom support for multi-column 'IN' + //A multi-column 'IN' is a series of OR/AND clauses + //TODO: Optimization if (is_array($column)) { $this->where(function ($query) use ($column, $values) { - foreach ($column as $index => $aColumn) { - $query->whereIn($aColumn, array_unique(array_column($values, $index))); + foreach ($values as $value) { + $query->orWhere(function ($query) use ($column, $value) { + foreach ($column as $index => $aColumn) { + $query->where($aColumn, $value[$index]); + } + }); } });
Reverted the changes from PR #<I>
topclaudy_compoships
train
php
2c2169e089fcff3a8ecb6c1a8ae191220206da4b
diff --git a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php @@ -178,7 +178,7 @@ class MySqlSchemaManager extends AbstractSchemaManager } if ($this->_platform instanceof MariaDb102Platform) { - $columnDefault = $this->getMariaDb1027ColumnDefault($this->_platform, $tableColumn['default'] ?? null); + $columnDefault = $this->getMariaDb1027ColumnDefault($this->_platform, $tableColumn['default']); } else { $columnDefault = (isset($tableColumn['default'])) ? $tableColumn['default'] : null; }
@morozov review: According to MySqlPlatform::getListTableColumnsSQL(), the default column is always selected. Removed ??
doctrine_dbal
train
php
31fc3b8c9fd2f0c7f10e14078fca2e7cd43ac4b1
diff --git a/lifelines/tests/__main__.py b/lifelines/tests/__main__.py index <HASH>..<HASH> 100644 --- a/lifelines/tests/__main__.py +++ b/lifelines/tests/__main__.py @@ -1,5 +1,7 @@ +import sys import pytest if __name__ == '__main__': - pytest.main("--pyargs lifelines.tests") + # Exit with correct code + sys.exit(pytest.main("--pyargs lifelines.tests"))
Exit with correct error code after tests
CamDavidsonPilon_lifelines
train
py
8d8b8313793b50f0d4b88ff89072ea3733581308
diff --git a/lib/FSi/Component/DataSource/Extension/Core/Ordering/Field/FieldExtension.php b/lib/FSi/Component/DataSource/Extension/Core/Ordering/Field/FieldExtension.php index <HASH>..<HASH> 100644 --- a/lib/FSi/Component/DataSource/Extension/Core/Ordering/Field/FieldExtension.php +++ b/lib/FSi/Component/DataSource/Extension/Core/Ordering/Field/FieldExtension.php @@ -38,7 +38,7 @@ class FieldExtension extends FieldAbstractExtension */ public function getExtendedFieldTypes() { - return array('text', 'number', 'date', 'time', 'datetime', 'entity'); + return array('text', 'number', 'date', 'time', 'datetime'); } /**
Sorting results by entity field does not make any sense
fsi-open_datasource
train
php
575a6f956c6e7eac929d9c2d9be04be93bd1a1c1
diff --git a/test/src/SanitizerTest.php b/test/src/SanitizerTest.php index <HASH>..<HASH> 100644 --- a/test/src/SanitizerTest.php +++ b/test/src/SanitizerTest.php @@ -60,6 +60,14 @@ class SanitizerTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(9, $this->object->filter($testValue)); $this->assertEquals(FILTER_SANITIZE_NUMBER_INT, $this->object->getSanitizeFilter()); $this->assertEquals(FILTER_NULL_ON_FAILURE, $this->object->getSanitizeFlags()); + + try { + $this->object->setSanitizeFilter('foobar'); + } catch (\Exception $ex) { + return; + } + + $this->fail('Exception was not thrown on invalid filter'); } /**
Test if Exception is thrown when trying to set an invalid filter
broeser_sanitor
train
php
a1c73f6b6faa6000e46a0e839f7c9d0979c32968
diff --git a/law/contrib/cms/tasks.py b/law/contrib/cms/tasks.py index <HASH>..<HASH> 100644 --- a/law/contrib/cms/tasks.py +++ b/law/contrib/cms/tasks.py @@ -15,6 +15,7 @@ import luigi from law import Task, LocalFileTarget, NO_STR +from law.target.file import get_path from law.decorator import log from law.util import rel_path, interruptable_popen @@ -41,7 +42,7 @@ class BundleCMSSW(Task): self.bundle(tmp.path) def bundle(self, dst_path): - cmd = [rel_path(__file__, "bundle_cmssw.sh"), self.cmssw_path, dst_path] + cmd = [rel_path(__file__, "bundle_cmssw.sh"), self.cmssw_path, get_path(dst_path)] if self.exclude != NO_STR: cmd += [self.exclude]
Use get_path in contrib.cms.BundleCMSSW.
riga_law
train
py
152e773d698c7dcbdf3cfcfb4d055449e152725b
diff --git a/code/extensions/MultisitesReport.php b/code/extensions/MultisitesReport.php index <HASH>..<HASH> 100644 --- a/code/extensions/MultisitesReport.php +++ b/code/extensions/MultisitesReport.php @@ -65,7 +65,7 @@ class Multisites_SideReport_EmptyPages extends SideReport_EmptyPages{ class Multisites_BrokenLinksReport extends BrokenLinksReport{ public function columns() { - return MultisitesReport::getMultisitesReportColumns(); + return MultisitesReport::getMultisitesReportColumns() + parent::columns(); } public function parameterFields() {
Correcting the display fields for the broken links report, making sure the "problem" was coming through.
symbiote_silverstripe-multisites
train
php
dc98d009975386d58dcbdfb37c1ec56a6d510112
diff --git a/ccxt.js b/ccxt.js index <HASH>..<HASH> 100644 --- a/ccxt.js +++ b/ccxt.js @@ -451,6 +451,7 @@ const Exchange = function (config) { } let { url, method, headers, body, resolve, reject } = this.restRequestQueue.shift () + this.lastRestRequestTimestamp = this.milliseconds () this.executeRestRequest (url, method, headers, body).then (resolve).catch (reject) } @@ -459,20 +460,18 @@ const Exchange = function (config) { this.issueRestRequest = function (url, method = 'GET', headers = undefined, body = undefined) { - if (this.enableRateLimit) - + if (this.enableRateLimit) { return new Promise ((resolve, reject) => { this.restRequestQueue.push ({ url, method, headers, body, resolve, reject }) this.runRestPollerLoop () }) + } return this.executeRestRequest (url, method, headers, body) } this.executeRestRequest = function (url, method = 'GET', headers = undefined, body = undefined) { - this.lastRestRequestTimestamp = this.milliseconds () - let promise = fetch (url, { 'method': method, 'headers': headers, 'body': body }) .catch (e => {
rest poller lastRestRequestTimestamp moved to runRestPollerLoop, added explicit brackets to issueRestRequest
ccxt_ccxt
train
js
22d5c6a958a8d739d1a5f83e89278186a8bf669f
diff --git a/resource_aws_elb.go b/resource_aws_elb.go index <HASH>..<HASH> 100644 --- a/resource_aws_elb.go +++ b/resource_aws_elb.go @@ -339,7 +339,7 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error { d.Set("availability_zones", flattenStringList(lb.AvailabilityZones)) d.Set("instances", flattenInstances(lb.Instances)) d.Set("listener", flattenListeners(lb.ListenerDescriptions)) - d.Set("security_groups", lb.SecurityGroups) + d.Set("security_groups", flattenStringList(lb.SecurityGroups)) if lb.SourceSecurityGroup != nil { d.Set("source_security_group", lb.SourceSecurityGroup.GroupName)
Fix ELB security groups read logic.
terraform-providers_terraform-provider-aws
train
go
7968399712a7176c5ef4c48e7ca1687d34f15be3
diff --git a/core/commands/swarm.go b/core/commands/swarm.go index <HASH>..<HASH> 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -233,6 +233,14 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3 return } + snet, ok := n.PeerHost.Network().(*swarm.Network) + if !ok { + res.SetError(fmt.Errorf("peerhost network was not swarm"), cmds.ErrNormal) + return + } + + swrm := snet.Swarm() + pis, err := peersWithAddresses(addrs) if err != nil { res.SetError(err, cmds.ErrNormal) @@ -241,6 +249,8 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3 output := make([]string, len(pis)) for i, pi := range pis { + swrm.Backoff().Clear(pi.ID) + output[i] = "connect " + pi.ID.Pretty() err := n.PeerHost.Connect(ctx, pi)
clear dial backoff on explicit dial License: MIT
ipfs_go-ipfs
train
go
6d9c83a86df49f209963e2e2870f7301abb271a0
diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -144,6 +144,14 @@ public class Executor extends Thread implements ModelObject { if (LOGGER.isLoggable(FINE)) LOGGER.log(FINE, String.format("%s is interrupted(%s): %s", getDisplayName(), result, Util.join(Arrays.asList(causes),",")), new InterruptedException()); + synchronized (this) { + if (!started) { + // not yet started, so simply dispose this + owner.removeExecutor(this); + return; + } + } + interruptStatus = result; synchronized (this.causes) { for (CauseOfInterruption c : causes) {
if an executor is interrupted before it's started, just throw it away
jenkinsci_jenkins
train
java
74db4f75c27846e392f814c69747ba75d0fb3206
diff --git a/tests/jmp_test.py b/tests/jmp_test.py index <HASH>..<HASH> 100644 --- a/tests/jmp_test.py +++ b/tests/jmp_test.py @@ -17,4 +17,4 @@ class JmpTest(unittest.TestCase): code = semantic(ast) self.assertEquals(code, [0x4c, 0x34, 0x12]) -#TODO: http://www.6502.buss.hk/6502-instruction-set/jmp says that there is a indirect \ No newline at end of file +#TODO: http://www.6502.buss.hk/6502-instruction-set/jmp says that there is a indirect
added TODO on jmp_test
gutomaia_nesasm_py
train
py
58b61929b930052bc20eb682ad5866d019942a63
diff --git a/rocketbelt/base/rocketbelt.js b/rocketbelt/base/rocketbelt.js index <HASH>..<HASH> 100644 --- a/rocketbelt/base/rocketbelt.js +++ b/rocketbelt/base/rocketbelt.js @@ -43,6 +43,14 @@ 'role': 'role' }; + // Self-removing event listener. + window.rb.once = (node, type, callback) => { + node.addEventListener(type, function handler(e) { + e.target.removeEventListener(e.type, handler); + return callback(e); + }); + }; + window.rb.getShortId = function getShortId() { // Break the id into 2 parts to provide enough bits to the random number. // This should be unique up to 1:2.2 bn.
feat(Javascript): Add vanilla self-removing event handler.
Pier1_rocketbelt
train
js
ec502e8a0dd6a08b81ad0dc9f658f829c8c6b330
diff --git a/lib/instance/cook/cook.rb b/lib/instance/cook/cook.rb index <HASH>..<HASH> 100644 --- a/lib/instance/cook/cook.rb +++ b/lib/instance/cook/cook.rb @@ -49,7 +49,7 @@ module RightScale Log.log_to_file_only(options[:log_to_file_only]) Log.init(agent_id, options[:log_path]) Log.level = CookState.log_level - Log.info("Cook process starting up.") + Log.info("[cook] Process starting up with tags: #{CookState.startup_tags.join(', ')}.") fail('Missing command server listen port') unless options[:listen_port] fail('Missing command cookie') unless options[:cookie] @client = CommandClient.new(options[:listen_port], options[:cookie]) @@ -97,7 +97,7 @@ module RightScale end ensure - Log.info("Cook process stopping.") + Log.info("[cook] Process stopping.") exit(1) unless success end
Added startup_tags to cook startup log
rightscale_right_link
train
rb
aed8e8ae0ca41f878351cc31bba5cee438e1aa50
diff --git a/applications/default/extensions/rest/rest.js b/applications/default/extensions/rest/rest.js index <HASH>..<HASH> 100644 --- a/applications/default/extensions/rest/rest.js +++ b/applications/default/extensions/rest/rest.js @@ -56,7 +56,7 @@ rest.route = function(routes, callback) { // @todo: filter out dangerous stuff from query before passing it to // list() method? var query = request.query; - application.invoke('query', query, request, function() { + application.invoke('query', typeName, query, request, function() { return typeModel.list(query, callback); }); }
Issue #<I>: Fixing problem in last, missing typeName in hook args. The correct hook interface is query(typeName, query, request, callback).
recidive_choko
train
js
e39dcacea2b5f7b169519c1b8ec7e6ef18899fb5
diff --git a/src/components/toast/toast.js b/src/components/toast/toast.js index <HASH>..<HASH> 100644 --- a/src/components/toast/toast.js +++ b/src/components/toast/toast.js @@ -24,8 +24,9 @@ let ] Events.on('app:vue-ready', (_Vue) => { - toast = new _Vue(Toast) - document.body.appendChild(toast.$el) + let node = document.createElement('div') + document.body.appendChild(node) + toast = new _Vue(Toast).$mount(node) }) function create (opts, defaults) {
refactor: [vue2] Toast
quasarframework_quasar
train
js
5d1e5718de41a75d6ce61664d0ffca6e67801d9e
diff --git a/swf-db/src/main/java/com/venky/swf/routing/Config.java b/swf-db/src/main/java/com/venky/swf/routing/Config.java index <HASH>..<HASH> 100644 --- a/swf-db/src/main/java/com/venky/swf/routing/Config.java +++ b/swf-db/src/main/java/com/venky/swf/routing/Config.java @@ -119,7 +119,7 @@ public class Config { public String getServerBaseUrl(){ String protocol = getExternalURIScheme(); - StringBuilder url = new StringBuilder().append(protocol).append("//").append(getHostName()); + StringBuilder url = new StringBuilder().append(protocol).append("://").append(getHostName()); if (getExternalPortNumber() != 80){ url.append(":").append(getExternalPortNumber());
External https support missed a :
venkatramanm_swf-all
train
java
426c9df09c3cc5789bc7e7b2da8a1e5d435cdc52
diff --git a/nodeconductor/iaas/managers.py b/nodeconductor/iaas/managers.py index <HASH>..<HASH> 100644 --- a/nodeconductor/iaas/managers.py +++ b/nodeconductor/iaas/managers.py @@ -1,7 +1,9 @@ from django.db import models +from nodeconductor.structure.managers import StructureQueryset -class InstanceQueryset(models.QuerySet): + +class InstanceQueryset(StructureQueryset): """ Hack that allow to filter iaas instances based on service_project_links and services """ def filter(self, *args, **kwargs):
Inherit iaas instance manager from structure manager - itacloud-<I>
opennode_waldur-core
train
py
7534b82e1d7bd66526355f279784830edd7cda7a
diff --git a/concrete/blocks/top_navigation_bar/controller.php b/concrete/blocks/top_navigation_bar/controller.php index <HASH>..<HASH> 100644 --- a/concrete/blocks/top_navigation_bar/controller.php +++ b/concrete/blocks/top_navigation_bar/controller.php @@ -289,5 +289,22 @@ class Controller extends BlockController implements UsesFeatureInterface, FileTr } return $files; } + + public function getPageItemNavTarget($pageItem) // Respect nav_target Page Attribute & External Link targets + { + if (!is_object($pageItem) || !$pageItem instanceof \Concrete\Core\Navigation\Item\PageItem) { + return ''; + } + $page = Page::getByID($pageItem->getPageID()); + + if ($page->getCollectionPointerExternalLink() != '' && $page->openCollectionPointerExternalLinkInNewWindow()) { + $target = '_blank'; + } else { + $target = $page->getAttribute('nav_target'); + } + $target = empty($target) ? '_self' : $target; + + return $target; + } }
Add method to get $pageItem Nav Target
concrete5_concrete5
train
php
07dd3e3998fd27d70dc0a4a9b89fa32df1b27763
diff --git a/lib/ffmpeg/transcoder.rb b/lib/ffmpeg/transcoder.rb index <HASH>..<HASH> 100644 --- a/lib/ffmpeg/transcoder.rb +++ b/lib/ffmpeg/transcoder.rb @@ -54,9 +54,9 @@ module FFMPEG end if @@timeout - stderr.each_with_timeout(wait_thr.pid, @@timeout, "r", &next_line) + stderr.each_with_timeout(wait_thr.pid, @@timeout, 'frame=', &next_line) else - stderr.each("r", &next_line) + stderr.each('frame=', &next_line) end rescue Timeout::Error => e
Have transcoder break line on 'frame=' rather than 'r'. - r had unclear purpose (originally cargo culted) - actually split every line into to two (fRame and bitRate)
streamio_streamio-ffmpeg
train
rb
a0815906e1299f96a2cf693f282b9ed844bd4178
diff --git a/js/modules/k6/metrics/metrics.go b/js/modules/k6/metrics/metrics.go index <HASH>..<HASH> 100644 --- a/js/modules/k6/metrics/metrics.go +++ b/js/modules/k6/metrics/metrics.go @@ -32,7 +32,7 @@ import ( "github.com/loadimpact/k6/stats" ) -var nameRegexString = "^[\\p{L}\\p{N}\\._ -]{1,128}$" +var nameRegexString = "^[\\p{L}\\p{N}\\._ !\\?/&#\\(\\)<>%-]{1,128}$" var compileNameRegex = regexp.MustCompile(nameRegexString)
Loosen metric name restriction to include '!?/&#()<>%'
loadimpact_k6
train
go
26f76ea45e311ce4782539498a3ea2bfbb41eb97
diff --git a/config/software/bookshelf.rb b/config/software/bookshelf.rb index <HASH>..<HASH> 100644 --- a/config/software/bookshelf.rb +++ b/config/software/bookshelf.rb @@ -16,7 +16,7 @@ # name "bookshelf" -version "92fd6d3308ad7bcdd4e7ab64c39c7678973df448" +version "4b2721362596262527f4bff70e97bff56204d957" dependencies ["erlang", "rebar", "rsync"]
updated bookshelf which uses public git urls for all deps
chef_chef
train
rb
9c1f6fc561b0f4ce39f95ae852062322e1393fac
diff --git a/lib/Parser/XML.php b/lib/Parser/XML.php index <HASH>..<HASH> 100644 --- a/lib/Parser/XML.php +++ b/lib/Parser/XML.php @@ -190,7 +190,7 @@ class XML extends Parser { * @param resource|string $input * @return void */ - public function setInput ( $input ) { + public function setInput($input) { if(is_resource($input)) $input = stream_get_contents($input);
!xml Fix CS.
sabre-io_vobject
train
php
522a2f00406ba5281a2f4b5a876321c9c1ba03e9
diff --git a/raiden/transfer/mediated_transfer/mediation_fee.py b/raiden/transfer/mediated_transfer/mediation_fee.py index <HASH>..<HASH> 100644 --- a/raiden/transfer/mediated_transfer/mediation_fee.py +++ b/raiden/transfer/mediated_transfer/mediation_fee.py @@ -61,7 +61,24 @@ def _collect_x_values( balance_out: Balance, max_x: int, ) -> List[Fraction]: - """ Collect all relevant x values (edges of piece wise linear sections) """ + """ Normalizes the x-axis of the penalty functions around the amount of + tokens being transferred. + + A penalty function maps the participant's balance to a fee. These functions + are then used to penalize transfers that unbalance the node's channels, and + as a consequence incentivize transfers that re-balance the channels. + + Here the x-axis of the penalty functions normalized around the current + channel's capacity. So that instead of computing: + + penalty(current_capacity + amount_being_transferred) + + One can simply compute: + + penalty(amount_being_transferred) + + To find the penalty fee for the current transfer. + """ all_x_vals = [x - balance_in for x in penalty_func_in.x_list] + [ balance_out - x for x in penalty_func_out.x_list ]
Added explanation for _collect_x_values
raiden-network_raiden
train
py
7c9a32aa195f03ff21b977d9193306c752d1d084
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/FutureReturnValueIgnored.java b/core/src/main/java/com/google/errorprone/bugpatterns/FutureReturnValueIgnored.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/FutureReturnValueIgnored.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/FutureReturnValueIgnored.java @@ -65,6 +65,12 @@ public final class FutureReturnValueIgnored extends AbstractReturnValueIgnored { // CompletionService is intended to be used in a way where the Future returned // from submit is discarded, because the Futures are available later via e.g. take() instanceMethod().onDescendantOf(CompletionService.class.getName()).named("submit"), + // IntelliJ's executeOnPooledThread wraps the Callable/Runnable in one that catches + // Throwable, so it can't fail (unless logging the Throwable also throws, but there's + // nothing much to be done at that point). + instanceMethod() + .onDescendantOf("com.intellij.openapi.application.Application") + .named("executeOnPooledThread"), // ChannelFuture#addListern(s) returns itself for chaining. Any exception during the // future execution should be dealt by the listener(s). instanceMethod()
Blacklist Futures returned from IntelliJ's Application#executeOnPooledThread. RELNOTES: N/A ------------- Created by MOE: <URL>
google_error-prone
train
java
00d94dafb53bb87c178301c896e3d59c3af703c9
diff --git a/lib/tessel-ssh.js b/lib/tessel-ssh.js index <HASH>..<HASH> 100644 --- a/lib/tessel-ssh.js +++ b/lib/tessel-ssh.js @@ -18,6 +18,7 @@ function createConnection(callback) { port: 22, username: config.username, privateKey: fs.readFileSync(config.keyPath), + passphrase: config.keyPassphrase }); }
added line to allow for key passphrase
tessel_t2-cli
train
js
aa2a07ef6ea4b7ea0661b497ae79a89e1b66fc98
diff --git a/lib/__tests__/findUndefinedIdentifiers-test.js b/lib/__tests__/findUndefinedIdentifiers-test.js index <HASH>..<HASH> 100644 --- a/lib/__tests__/findUndefinedIdentifiers-test.js +++ b/lib/__tests__/findUndefinedIdentifiers-test.js @@ -248,10 +248,12 @@ it('knows about hoisting', () => { hoistedFunction(); hoistedVariable.foo(); new HoistedClass(); + hoistedImport.bar(); function hoistedFunction() {} var hoistedVariable = { foo: () => null }; class HoistedClass {} + import hoistedImport from 'hoisterImport'; `, ), ),
Make sure hoisted imports are handled by findUndefinedIdentifiers @lencioni asked a question [1] in code review about hoisted imports. They are covered, but it makes sense to have a test for them. [1] <URL>
Galooshi_import-js
train
js
e033d6872be2d2803aee0a68ac91000208f1110e
diff --git a/worker/uniter/charm/bundles_test.go b/worker/uniter/charm/bundles_test.go index <HASH>..<HASH> 100644 --- a/worker/uniter/charm/bundles_test.go +++ b/worker/uniter/charm/bundles_test.go @@ -118,7 +118,8 @@ func (s *BundlesDirSuite) TestGet(c *gc.C) { // Try to get the charm when the content doesn't match. gitjujutesting.Server.Response(200, nil, []byte("roflcopter")) _, err = d.Read(apiCharm, nil) - prefix := fmt.Sprintf(`failed to download charm "cs:quantal/dummy-1" from "%s": `, apiCharm.ArchiveURL()) + archiveURL := apiCharm.ArchiveURL() + prefix := fmt.Sprintf(`failed to download charm "cs:quantal/dummy-1" from %q: `, archiveURL) c.Assert(err, gc.ErrorMatches, prefix+fmt.Sprintf(`expected sha256 %q, got ".*"`, sch.BundleSha256())) // Try to get a charm whose bundle doesn't exist.
second attempt at silencing stupid warning on push
juju_juju
train
go
564c4d2a27efca9338aaf56fd27ffcfe81522fb6
diff --git a/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js b/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js index <HASH>..<HASH> 100644 --- a/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js +++ b/plugins/sigma.layout.forceAtlas2/sigma.layout.forceAtlas2.js @@ -993,15 +993,16 @@ var self = this; function addJob() { - conrad.addJob({ - id: 'forceatlas2_' + self.id, - job: self.forceatlas2.atomicGo, - end: function() { - self.refresh(); - if (self.forceatlas2.isRunning) - addJob(); - } - }); + if (!conrad.hasJob('forceatlas2_' + self.id)) + conrad.addJob({ + id: 'forceatlas2_' + self.id, + job: self.forceatlas2.atomicGo, + end: function() { + self.refresh(); + if (self.forceatlas2.isRunning) + addJob(); + } + }); } addJob();
Minor fix in ForceAtlas2 conrad calls Due to some weird schedule when using quickly stopForceAtlas2 / startForceAtlas2, it appears that sometimes the addJob function is called when the job has actually already been added. So, I just added a quick job check before adding it.
jacomyal_sigma.js
train
js
df13d209aafb5aa7e2055429df9b68e6ad28093e
diff --git a/future/__init__.py b/future/__init__.py index <HASH>..<HASH> 100644 --- a/future/__init__.py +++ b/future/__init__.py @@ -220,7 +220,7 @@ if not utils.PY3: 'apply', 'cmp', 'coerce', 'execfile', 'file', 'long', 'raw_input', 'reduce', 'reload', 'unicode', 'xrange', 'StandardError', - 'round', 'input', 'range', 'super', + 'bytes', 'round', 'input', 'range', 'super', 'str'] else:
Add bytes to "from future import *"
PythonCharmers_python-future
train
py
9d05bf1c9d3e9906a79f37fa7713455fe703591f
diff --git a/tests/library/Garp/File/ExtensionTest.php b/tests/library/Garp/File/ExtensionTest.php index <HASH>..<HASH> 100644 --- a/tests/library/Garp/File/ExtensionTest.php +++ b/tests/library/Garp/File/ExtensionTest.php @@ -3,6 +3,7 @@ * @group File */ class Garp_File_ExtensionTest extends Garp_Test_PHPUnit_TestCase { + protected $_mockPngFile = '/../public/css/images/favicon.png'; public function testShouldGetTheExtensionCorrectly() { $ext = new Garp_File_Extension('image/jpeg'); @@ -13,15 +14,13 @@ class Garp_File_ExtensionTest extends Garp_Test_PHPUnit_TestCase { public function testShouldGetTheExtensionForLiveObject() { // Use finfo for a real-live example $finfo = new finfo(FILEINFO_MIME); - $mime = $finfo->file(__FILE__); -var_dump(__FILE__); -var_dump($mime); -exit; + $mime = $finfo->file(GARP_APPLICATION_PATH . $this->_mockPngFile); + $mime = explode(';', $mime); $mime = $mime[0]; $ext = new Garp_File_Extension($mime); - $this->assertEquals('php', $ext->getValue()); + $this->assertEquals('png', $ext->getValue()); } public function testShouldReturnNullForUnknownExtension() {
Removed debug lines, changed extension unit test mock object to png instead of php, for compatibility with Ubuntu
grrr-amsterdam_garp3
train
php
2c46d1b45af0baba87804f451c566de256c8d390
diff --git a/mode/css/css.js b/mode/css/css.js index <HASH>..<HASH> 100644 --- a/mode/css/css.js +++ b/mode/css/css.js @@ -748,8 +748,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { } }, ":": function(stream) { - if (stream.match(/\s*\{/)) - return [null, "{"]; + if (stream.match(/\s*\{/, false)) + return [null, null] return false; }, "$": function(stream) {
[css mode] Prevent SCSS ': {' from being treated like a single token Closes #<I>
codemirror_CodeMirror
train
js
dad2efab6b0b77c26d9efc99b82c877857fc5fe4
diff --git a/lang/nl/moodle.php b/lang/nl/moodle.php index <HASH>..<HASH> 100644 --- a/lang/nl/moodle.php +++ b/lang/nl/moodle.php @@ -115,6 +115,7 @@ $string['choosetheme'] = 'Kies een thema'; $string['chooseuser'] = 'Kies een gebruiker '; $string['city'] = 'Plaats'; $string['cleaningtempdata'] = 'Schoon de tijdelijke data op'; +$string['clicktochange'] = 'Klik om te wijzigen'; $string['closewindow'] = 'Sluit dit venster'; $string['comparelanguage'] = 'Vergelijk en bewerk huidige taal '; $string['complete'] = 'Voltooid';
translating on moodle-speed ;-)
moodle_moodle
train
php
85bdcc0cdff7d06f367e4ac97335b27d8ffe0bee
diff --git a/robots/settings.py b/robots/settings.py index <HASH>..<HASH> 100644 --- a/robots/settings.py +++ b/robots/settings.py @@ -7,3 +7,5 @@ SITEMAP_URLS.extend(getattr(settings, 'ROBOTS_SITEMAP_URLS', [])) USE_SITEMAP = getattr(settings, 'ROBOTS_USE_SITEMAP', True) CACHE_TIMEOUT = getattr(settings, 'ROBOTS_CACHE_TIMEOUT', None) + +SITE_BY_REQUEST = getattr(settings, 'ROBOTS_SITE_BY_REQUEST', False) diff --git a/robots/views.py b/robots/views.py index <HASH>..<HASH> 100644 --- a/robots/views.py +++ b/robots/views.py @@ -18,7 +18,10 @@ class RuleList(ListView): cache_timeout = settings.CACHE_TIMEOUT def get_current_site(self, request): - return Site.objects.get_current() + if settings.SITE_BY_REQUEST: + return Site.objects.get(domain=request.get_host()) + else: + return Site.objects.get_current() def reverse_sitemap_url(self): try:
Detect current site via http host var
jazzband_django-robots
train
py,py
402893a609ecac15c1350a2a9e39007a033f9a2a
diff --git a/spec/integration/veritas/algebra/projection_spec.rb b/spec/integration/veritas/algebra/projection_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/veritas/algebra/projection_spec.rb +++ b/spec/integration/veritas/algebra/projection_spec.rb @@ -6,7 +6,7 @@ describe Algebra::Projection do context 'remove attributes in predicate' do subject { restriction.project([ :name ]) } - let(:left) { Relation.new([ [ :id, Integer ] ], (1..100).map { |n| [ n ] }) } + let(:left) { Relation.new([ [ :id, Integer ] ], (0..11).map { |n| [ n ] }) } let(:right) { Relation.new([ [ :name, String ] ], [ [ 'Dan Kubb' ], [ 'John Doe' ], [ 'Jane Doe' ] ]) } let(:relation) { left * right } let(:restriction) { relation.restrict { |r| r.id.gte(1).and(r.id.lte(10)).and(r.name.eq('Dan Kubb')) } }
Change spec to initialize a smaller set of integers
dkubb_axiom
train
rb
b7c604795ed6b07c4391d128d131d3569214343b
diff --git a/packer/plugin/server.go b/packer/plugin/server.go index <HASH>..<HASH> 100644 --- a/packer/plugin/server.go +++ b/packer/plugin/server.go @@ -33,7 +33,7 @@ const MagicCookieValue = "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d69 // The APIVersion is outputted along with the RPC address. The plugin // client validates this API version and will show an error if it doesn't // know how to speak it. -const APIVersion = "3" +const APIVersion = "4" // Server waits for a connection to this plugin and returns a Packer // RPC server that you can use to register components and serve them.
packer/plugin: increase version for Yamux
hashicorp_packer
train
go
e4cce4ab05e813f7d9b04577f4b6f589cd0ae037
diff --git a/testsrc/org/mozilla/javascript/benchmarks/V8Benchmark.java b/testsrc/org/mozilla/javascript/benchmarks/V8Benchmark.java index <HASH>..<HASH> 100644 --- a/testsrc/org/mozilla/javascript/benchmarks/V8Benchmark.java +++ b/testsrc/org/mozilla/javascript/benchmarks/V8Benchmark.java @@ -19,7 +19,7 @@ public class V8Benchmark throws IOException { PrintWriter out = new PrintWriter( - new FileWriter(new File(System.getProperty("rhino.benchmark.report"), "v8benchmark.csv.csv")) + new FileWriter(new File(System.getProperty("rhino.benchmark.report"), "v8benchmark.csv")) ); // Hard code the opt levels for now -- we will make it more generic when we need to out.println("Optimization 0,Optimization 9");
Fix file name for V8 benchmark results.
mozilla_rhino
train
java
0b8e03a89db920f7418b0505ce4fe35bbd719125
diff --git a/tenacity/__init__.py b/tenacity/__init__.py index <HASH>..<HASH> 100644 --- a/tenacity/__init__.py +++ b/tenacity/__init__.py @@ -315,7 +315,7 @@ class Retrying(BaseRetrying): try: result = fn(*args, **kwargs) continue - except Exception: + except BaseException: exc_info = sys.exc_info() continue elif isinstance(do, DoSleep): diff --git a/tenacity/async.py b/tenacity/async.py index <HASH>..<HASH> 100644 --- a/tenacity/async.py +++ b/tenacity/async.py @@ -50,7 +50,7 @@ class AsyncRetrying(BaseRetrying): result = yield from fn(*args, **kwargs) exc_info = None continue - except Exception: + except BaseException: result = NO_RESULT exc_info = sys.exc_info() continue diff --git a/tenacity/tornadoweb.py b/tenacity/tornadoweb.py index <HASH>..<HASH> 100644 --- a/tenacity/tornadoweb.py +++ b/tenacity/tornadoweb.py @@ -48,7 +48,7 @@ class TornadoRetrying(BaseRetrying): result = yield fn(*args, **kwargs) exc_info = None continue - except Exception: + except BaseException: result = NO_RESULT exc_info = sys.exc_info() continue
Catch BaseException rather than just Exception Fixes #<I>
jd_tenacity
train
py,py,py
cea20f04d447ebeb0d57b86f6f3c39ba3540d417
diff --git a/src/directive/messaging-view.js b/src/directive/messaging-view.js index <HASH>..<HASH> 100644 --- a/src/directive/messaging-view.js +++ b/src/directive/messaging-view.js @@ -18,6 +18,7 @@ module.exports = angular vm.inputPlaceholderText = $scope.inputPlaceholderText; vm.submitButtonText = $scope.submitButtonText; vm.title = $scope.title; + vm.theme = angular.fromJson($scope.theme); vm.message = ''; vm.submitCall = submitCall; @@ -66,6 +67,7 @@ module.exports = angular title: '@', inputPlaceholderText: '@', submitButtonText: '@', + theme: '@', submitCallback: '&' }, link: function (scope, element) {
WBC-<I> Implement the consumer-side
MovingImage24_mi-angular-wbc-pack
train
js
419743f1657a9473623178fc8dbe9152a102a116
diff --git a/client/allocrunner/testing.go b/client/allocrunner/testing.go index <HASH>..<HASH> 100644 --- a/client/allocrunner/testing.go +++ b/client/allocrunner/testing.go @@ -63,6 +63,7 @@ func testAllocRunnerConfig(t *testing.T, alloc *structs.Allocation) (*Config, fu Vault: vaultclient.NewMockVaultClient(), StateUpdater: &MockStateUpdater{}, PrevAllocWatcher: allocwatcher.NoopPrevAlloc{}, + PrevAllocMigrator: allocwatcher.NoopPrevAlloc{}, PluginSingletonLoader: singleton.NewSingletonLoader(clientConf.Logger, pluginLoader), DeviceManager: devicemanager.NoopMockManager(), }
allocrunner: Test alloc runners should include a noop migrator
hashicorp_nomad
train
go
4613cf52897a258197987f2d15a3dc48401cc11b
diff --git a/lib/nyny/request_scope.rb b/lib/nyny/request_scope.rb index <HASH>..<HASH> 100644 --- a/lib/nyny/request_scope.rb +++ b/lib/nyny/request_scope.rb @@ -36,9 +36,10 @@ module NYNY @halt_response = Response.new body, status, @headers.merge(headers) end - def redirect_to path - @redirect = path + def redirect_to uri, status=302 + @redirect = [uri, status] end + alias_method :redirect, :redirect_to def apply_to &handler @response = @halt_response || begin @@ -46,7 +47,7 @@ module NYNY end cookies.each {|k,v| @response.set_cookie k,v } - @response.redirect(@redirect) if @redirect + @response.redirect(*@redirect) if @redirect @response.finish @response end
Allow to set status in redirect, add alias for sinatra interop
alisnic_nyny
train
rb
a1b6c44d9597bdf251180a3281db956592ac1e2a
diff --git a/library/umi/templating/toolbox/TemplatingTools.php b/library/umi/templating/toolbox/TemplatingTools.php index <HASH>..<HASH> 100644 --- a/library/umi/templating/toolbox/TemplatingTools.php +++ b/library/umi/templating/toolbox/TemplatingTools.php @@ -77,6 +77,8 @@ class TemplatingTools implements IToolbox return $this->getTemplateEngineFactory(); case 'umi\templating\extension\IExtensionFactory': return $this->getExtensionFactory(); + case 'umi\templating\extension\adapter\IExtensionAdapterFactory': + return $this->getExtensionAdapterFactory(); } throw new UnsupportedServiceException($this->translate( 'Toolbox "{name}" does not support service "{interface}".', diff --git a/library/umi/templating/toolbox/config.php b/library/umi/templating/toolbox/config.php index <HASH>..<HASH> 100644 --- a/library/umi/templating/toolbox/config.php +++ b/library/umi/templating/toolbox/config.php @@ -21,6 +21,7 @@ return [ ], 'services' => [ 'umi\templating\engine\ITemplateEngineFactory', - 'umi\templating\extension\IExtensionFactory' + 'umi\templating\extension\IExtensionFactory', + 'umi\templating\extension\adapter\IExtensionAdapterFactory', ] ]; \ No newline at end of file
[templating] fix registered services list
Umisoft_umi-framework
train
php,php
1dcb725ec8eb52d34ef889958f9388d3b737ebaa
diff --git a/spec/span_spec.rb b/spec/span_spec.rb index <HASH>..<HASH> 100644 --- a/spec/span_spec.rb +++ b/spec/span_spec.rb @@ -162,6 +162,11 @@ EXPECTATIONS = Maruku.new.instance_eval do ["[a](#url)", [md_im_link(['a'],'#url')]], ["[a](</script?foo=1&bar=2>)", [md_im_link(['a'],'/script?foo=1&bar=2')]], + # Links to URLs that contain closing parentheses. #128 + ['[a](url())', [md_im_link(['a'],'url()')], 'Link with parentheses 1', true], # PENDING + ['[a](url\(\))', [md_im_link(['a'],'url()')], 'Link with parentheses 2', true], # PENDING + ['[a](url()foo)', [md_im_link(['a'],'url()foo')], 'Link with parentheses 3', true], # PENDING + ['[a](url(foo))', [md_im_link(['a'],'url(foo)')], 'Link with parentheses 4', true], # PENDING # Images ["\\![a](url)", ['!', md_im_link(['a'],'url') ], 'Escaping images'],
Add pending tests for links with parentheses in them (#<I>)
bhollis_maruku
train
rb
87694c2f8569d519289bf4913a870f679a4a0886
diff --git a/src/drivers/PiBot/real/piBot.py b/src/drivers/PiBot/real/piBot.py index <HASH>..<HASH> 100644 --- a/src/drivers/PiBot/real/piBot.py +++ b/src/drivers/PiBot/real/piBot.py @@ -204,7 +204,7 @@ class PiBot: def leerIRSigueLineas(self): #devuelve el estado de los sensores IR - right_sensor_port = 4 + right_sensor_port = 22 left_sensor_port = 27 self._GPIO.setmode(self._GPIO.BCM)
latest version of driver piBot.py modified
JdeRobot_base
train
py
d22874075d0456e4888790a4639d64b40b165e96
diff --git a/openstates/events.py b/openstates/events.py index <HASH>..<HASH> 100644 --- a/openstates/events.py +++ b/openstates/events.py @@ -82,7 +82,15 @@ class OpenstatesEventScraper(OpenstatesBaseScraper): item.add_bill(bill=b['bill_id'], note=b.pop('type', b.pop('+type', None))) + seen_documents = set([]) for document in event.pop('documents', []): + if document['url'] in seen_documents: + print("XXX: Buggy data in: Duped Document URL: %s (%s)" % ( + document['url'], document['name'] + )) + continue + + seen_documents.add(document['url']) e.add_document(url=document['url'], note=document['name'])
Duck bad documents from OpenStates on events.
openstates_billy
train
py
1c56a2afbf77ae352ab47ebbae8babc7078d13d4
diff --git a/funcserver/funcserver.py b/funcserver/funcserver.py index <HASH>..<HASH> 100644 --- a/funcserver/funcserver.py +++ b/funcserver/funcserver.py @@ -573,7 +573,7 @@ class Server(BaseScript): self.static_handler_class = shclass - self.nav_tabs = [('Console', '/console'), ('Logs', '/logs')] + self.nav_tabs = [('Console', '/console'), ('Logs', '/logs')] if self.args.debug else [] self.nav_tabs = self.prepare_nav_tabs(self.nav_tabs) settings = {
fixes #<I>, console and logs only in debug mode now
deep-compute_funcserver
train
py
902c4147a2100c1f71d8493c526ae5275bab4cdc
diff --git a/spec/unit/configurer_spec.rb b/spec/unit/configurer_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/configurer_spec.rb +++ b/spec/unit/configurer_spec.rb @@ -244,7 +244,7 @@ describe Puppet::Configurer do Puppet.settings[:prerun_command] = "/my/command" Puppet::Util.expects(:execute).with(["/my/command"]).raises(Puppet::ExecutionFailure, "Failed") - report.expects(:<<).with { |log| log.message.start_with?("Could not run command from prerun_command") } + report.expects(:<<).with { |log| log.message =~ /^Could not run command from prerun_command/ } @agent.run.should be_nil end @@ -267,7 +267,7 @@ describe Puppet::Configurer do Puppet.settings[:postrun_command] = "/my/command" Puppet::Util.expects(:execute).with(["/my/command"]).raises(Puppet::ExecutionFailure, "Failed") - report.expects(:<<).with { |log| log.message.start_with?("Could not run command from postrun_command") } + report.expects(:<<).with { |log| log.message =~ /^Could not run command from postrun_command/ } @agent.run.should be_nil end
Update configurer_spec.rb to work with Ruby <I> Ruby <I> doesn't have start_with? on String, so instead of checking the log message using start_with? we check using a regex.
puppetlabs_puppet
train
rb
c2f37928bfb470f000408461b5f55a57567d2285
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -41,7 +41,7 @@ const config = { // Developer tool to enhance debugging, source maps // http://webpack.github.io/docs/configuration.html#devtool - devtool: debug ? 'source-map' : false, + devtool: debug ? '#cheap-module-eval-source-map' : '#cheap-source-map', // What information should be printed to the console stats: {
[Webpack Setting] Adjust devtool setting (AKA sourcemap)
thangngoc89_electron-react-app
train
js
7fa680deb1539dd7a53cecd4852e7eb2f7f7a5a6
diff --git a/code/administrator/components/com_files/files.php b/code/administrator/components/com_files/files.php index <HASH>..<HASH> 100644 --- a/code/administrator/components/com_files/files.php +++ b/code/administrator/components/com_files/files.php @@ -18,4 +18,6 @@ * @subpackage Files */ +defined('KOOWA') or die; + echo KService::get('com://admin/files.dispatcher')->dispatch(); \ No newline at end of file diff --git a/code/site/components/com_files/files.php b/code/site/components/com_files/files.php index <HASH>..<HASH> 100644 --- a/code/site/components/com_files/files.php +++ b/code/site/components/com_files/files.php @@ -18,4 +18,6 @@ * @subpackage Files */ +defined('KOOWA') or die; + echo KService::get('com://admin/files.dispatcher')->dispatch(); \ No newline at end of file
Add missing defined('KOOWA') checks to com_files
joomlatools_joomlatools-framework
train
php,php
536d5fca423189511dfca13bbfd7866933c29544
diff --git a/lib/retester/cloud_retester.py b/lib/retester/cloud_retester.py index <HASH>..<HASH> 100644 --- a/lib/retester/cloud_retester.py +++ b/lib/retester/cloud_retester.py @@ -432,7 +432,7 @@ def copy_basedata_to_testing_node(node): try: node.make_directory(node.global_build_path + "/" + config) node.put_file(base_directory + "/../build/" + config + "/rethinkdb", node.global_build_path + "/" + config + "/rethinkdb") - node.put_file(base_directory + "/../build/" + config + "/rethinkdb-extract", node.global_build_path + "/" + config + "/rethinkdb-extract") + #node.put_file(base_directory + "/../build/" + config + "/rethinkdb-extract", node.global_build_path + "/" + config + "/rethinkdb-extract") #node.put_file(base_directory + "/../build/" + config + "/rethinkdb-fsck", node.global_build_path + "/" + config + "/rethinkdb-fsck") command_result = node.run_command("chmod +x " + node.global_build_path + "/" + config + "/*") if command_result[0] != 0:
We don't need rethinkdb-extract anymore
rethinkdb_rethinkdb
train
py
112ca1f836f3c81cf27733b9b845661d133cef04
diff --git a/gui/src/main/java/org/jboss/mbui/client/aui/aim/DataInputOutput.java b/gui/src/main/java/org/jboss/mbui/client/aui/aim/DataInputOutput.java index <HASH>..<HASH> 100644 --- a/gui/src/main/java/org/jboss/mbui/client/aui/aim/DataInputOutput.java +++ b/gui/src/main/java/org/jboss/mbui/client/aui/aim/DataInputOutput.java @@ -22,7 +22,7 @@ package org.jboss.mbui.client.aui.aim; * @author Harald Pehl * @date 10/25/2012 */ -public class DataInputOutput extends InteractionUnit +public class DataInputOutput extends Input { public DataInputOutput(final String id) { diff --git a/gui/src/main/java/org/jboss/mbui/client/cui/Reification.java b/gui/src/main/java/org/jboss/mbui/client/cui/Reification.java index <HASH>..<HASH> 100644 --- a/gui/src/main/java/org/jboss/mbui/client/cui/Reification.java +++ b/gui/src/main/java/org/jboss/mbui/client/cui/Reification.java @@ -35,7 +35,6 @@ public abstract class Reification this.interactionUnit = interactionUnit; } - public abstract Widget create(Context context); public abstract Widget update(Context context);
Fixed superclass for DataInputOutput
hal_core
train
java,java
a458ad2daf8d061b62c71d9371f62d37d20ee468
diff --git a/addon/services/audio.js b/addon/services/audio.js index <HASH>..<HASH> 100644 --- a/addon/services/audio.js +++ b/addon/services/audio.js @@ -4,6 +4,7 @@ import Track from '../utils/track'; import { base64ToUint8, mungeSoundFont } from '../utils/decode-base64'; import { Note, sortNotes } from '../utils/note'; import ObjectLikeMap from '../utils/object-like-map'; +import fetch from 'ember-network/fetch'; const { RSVP: { all, resolve }, @@ -54,7 +55,8 @@ export default Service.extend({ return resolve(register.get(name)); } - return this.get('request')(src) + return fetch(src) + .then((response) => response.arrayBuffer()) .then((arrayBuffer) => audioContext.decodeAudioData(arrayBuffer)) .then((audioBuffer) => { let sound; @@ -98,7 +100,7 @@ export default Service.extend({ fonts.set(instrumentName, ObjectLikeMap.create()); - return this.get('request')(src, 'text') + return fetch(src).then((response) => response.text()) // Strip extraneous stuff from soundfont (which is currently a long string) // and split by line into an array
replaced using "request" with using "fetch"
sethbrasile_ember-audio
train
js
87ac7f642fe575b1b197e5916c71a5465fcb85c2
diff --git a/python/phonenumbers/__init__.py b/python/phonenumbers/__init__.py index <HASH>..<HASH> 100644 --- a/python/phonenumbers/__init__.py +++ b/python/phonenumbers/__init__.py @@ -147,7 +147,7 @@ from .phonenumbermatcher import PhoneNumberMatch, PhoneNumberMatcher, Leniency # Version number is taken from the upstream libphonenumber version # together with an indication of the version of the Python-specific code. -__version__ = "8.8.10" +__version__ = "8.8.11" __all__ = ['PhoneNumber', 'CountryCodeSource', 'FrozenPhoneNumber', 'REGION_CODE_FOR_NON_GEO_ENTITY', 'NumberFormat', 'PhoneNumberDesc', 'PhoneMetadata',
Prep for <I> release
daviddrysdale_python-phonenumbers
train
py
75ed9ec84d2ead46754349ea3fc8b1c685a89e91
diff --git a/integration-test/src/test/java/org/jboss/pnc/integration/BuildTest.java b/integration-test/src/test/java/org/jboss/pnc/integration/BuildTest.java index <HASH>..<HASH> 100644 --- a/integration-test/src/test/java/org/jboss/pnc/integration/BuildTest.java +++ b/integration-test/src/test/java/org/jboss/pnc/integration/BuildTest.java @@ -80,7 +80,7 @@ public class BuildTest { //then assertThat(triggeredConfiguration.getRestCallResponse().getStatusCode()).isEqualTo(200); - ResponseUtils.waitSynchronouslyFor(() -> buildRecordRestClient.get(buildRecordId, false).hasValue() == true, 10, TimeUnit.SECONDS); + ResponseUtils.waitSynchronouslyFor(() -> buildRecordRestClient.get(buildRecordId, false).hasValue() == true, 60, TimeUnit.SECONDS); } @Test
Increased timeout for BuildTest
project-ncl_pnc
train
java
d6146807efed0854853c60e7c897578a9a83ed63
diff --git a/src/EventListener/ConfigurationNoticesListener.php b/src/EventListener/ConfigurationNoticesListener.php index <HASH>..<HASH> 100644 --- a/src/EventListener/ConfigurationNoticesListener.php +++ b/src/EventListener/ConfigurationNoticesListener.php @@ -279,8 +279,8 @@ class ConfigurationNoticesListener implements EventSubscriberInterface return; } - $filePath = '/thumbs/configtester_' . date('Y-m-d-h-i-s') . '.txt'; - $contents = $this->isWritable('web', $filePath); + $filePath = 'configtester_' . date('Y-m-d-h-i-s') . '.txt'; + $contents = $this->isWritable(['name' => 'web', 'folder' => 'thumbs'], $filePath); if ($contents != 'ok') { $notice = json_encode([ 'severity' => 1,
Change tests for thumbnails directory solves #<I>
bolt_configuration-notices
train
php
bcaf3c8843d00e59ce18e482520e6f8fc3d93f4d
diff --git a/rails_event_store/lib/rails_event_store/pub_sub/broker.rb b/rails_event_store/lib/rails_event_store/pub_sub/broker.rb index <HASH>..<HASH> 100644 --- a/rails_event_store/lib/rails_event_store/pub_sub/broker.rb +++ b/rails_event_store/lib/rails_event_store/pub_sub/broker.rb @@ -7,8 +7,6 @@ module RailsEventStore end def add_subscriber(subscriber, event_types) - raise SubscriberNotExist if subscriber.nil? - raise MethodNotDefined unless subscriber.methods.include? :handle_event subscribe(subscriber, [*event_types]) end
untested code * how can we check the event handler without checking the method?
RailsEventStore_rails_event_store
train
rb
28b5f11b6d94d1dfb9056f155902fc5539bd6797
diff --git a/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js b/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js index <HASH>..<HASH> 100644 --- a/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js +++ b/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js @@ -81,7 +81,9 @@ export default class CoreYarnGenerator extends Generator { const pkg = this.fs.readJSON(this.destinationPath('package.json')); if (pkg.scripts.preversion) { - this.spawnCommandSync('yarn', ['run', 'preversion']); + try { + this.spawnCommandSync('yarn', ['run', 'preversion']); + } catch {} } else { if (pkg.scripts.build) { this.spawnCommandSync('yarn', ['run', 'build']);
fix(pob): add try/catch when running preversion script
christophehurpeau_pob-lerna
train
js
5df6671bc586752662a823b960f548a440f62984
diff --git a/src/main/java/uk/co/real_logic/agrona/concurrent/UnsafeBuffer.java b/src/main/java/uk/co/real_logic/agrona/concurrent/UnsafeBuffer.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/co/real_logic/agrona/concurrent/UnsafeBuffer.java +++ b/src/main/java/uk/co/real_logic/agrona/concurrent/UnsafeBuffer.java @@ -540,7 +540,7 @@ public class UnsafeBuffer implements AtomicBuffer if (NATIVE_BYTE_ORDER != byteOrder) { final int bits = Integer.reverseBytes(Float.floatToRawIntBits(value)); - UNSAFE.putLong(byteArray, addressOffset + index, bits); + UNSAFE.putInt(byteArray, addressOffset + index, bits); } else {
Update UnsafeBuffer.java <I> bit rather than <I> put of a long (if this code is ever used).
real-logic_agrona
train
java
ffed4e2844363ddb8a796724c3f08e20e0c62410
diff --git a/ipyvolume/volume.py b/ipyvolume/volume.py index <HASH>..<HASH> 100644 --- a/ipyvolume/volume.py +++ b/ipyvolume/volume.py @@ -29,8 +29,8 @@ class Scatter(widgets.DOMWidget): selected = Array(default_value=None,allow_none=True).tag(sync=True, **array_serialization) size = traitlets.Float(0.01).tag(sync=True) size_selected = traitlets.Float(0.02).tag(sync=True) - color = traitlets.Tuple(traitlets.CFloat(1), traitlets.CFloat(0), traitlets.CFloat(0)).tag(sync=True) - color_selected = traitlets.Tuple(traitlets.CFloat(0), traitlets.CFloat(0), traitlets.CFloat(1)).tag(sync=True) + color = traitlets.Unicode(default_value="red").tag(sync=True) + color_selected = traitlets.Unicode(default_value="white").tag(sync=True) geo = traitlets.Unicode('diamond').tag(sync=True)
change: color is now a string, can be 'red', or '#ccc' etc, parsed by three js
maartenbreddels_ipyvolume
train
py
e8a057dca231083c0cc6efd3105311b9714536d4
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,13 +9,14 @@ var fs = require('fs'), // bundle the script using browserify gulp.task('build', function() { - gulp.src(['./index.js']) + gulp.src(['./index.js'], {read: false}) // read false because browserify doesn't support streams when using standalone + .pipe(browserify({ + standalone: 'mathjs' // TODO: standalone not supported when using streams + })) + .pipe(replace('@@date', today())) .pipe(replace('@@version', version())) - .pipe(browserify({ - // standalone: 'mathjs' // TODO: standalone not yet supported - })) .pipe(concat('math.js')) .pipe(gulp.dest('./dist'))
Browserify working via a workaround
josdejong_mathjs
train
js
a0d2840ca6aea8392f56932a869982b46fcf6396
diff --git a/Resources/public/js/media_widget.js b/Resources/public/js/media_widget.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/media_widget.js +++ b/Resources/public/js/media_widget.js @@ -29,8 +29,8 @@ dropzoneUri = $(this).data('url'), uploadMultiple = ($(this).data('multiple') > 0), mimeTypes = $(this).data('allowed-mime-types'), - thumbnailWidth = ($(this).data('thumbnail-width') === 'undefined') ? 140 : $(this).data('thumbnail-width'), - thumbnailHeight = ($(this).data('thumbnail-height') === 'undefined') ? 93 : $(this).data('thumbnail-height'); + thumbnailWidth = (el.dataset.thumbnailWidth === 'undefined') ? 140 : el.dataset.thumbnailWidth, + thumbnailHeight = (el.dataset.thumbnailHeight === 'undefined') ? 93 : el.dataset.thumbnailHeight; // Is multiple upload allowed ? if (uploadMultiple)
Set thumbnailWidth and thumbnailHeight with dataset functions
alpixel_AlpixelMediaBundle
train
js
48d5a14c4ee3963476048ff9c7a1c02eb224349d
diff --git a/src/js/nav.js b/src/js/nav.js index <HASH>..<HASH> 100644 --- a/src/js/nav.js +++ b/src/js/nav.js @@ -614,6 +614,8 @@ exports.createNavDrawer = function(typeInfo, currentFile, basePath) { events.listen(navButton, 'click', drawer.toggleVisibility, false, drawer); events.listen(navEl, 'click', drawer.onClick_, false, drawer); + events.listen(mask, 'touchmove', e => e.preventDefault(), false); + const typeSection = navEl.querySelector('.types'); if (typeSection && typeInfo.types) { buildSectionList(typeSection, typeInfo.types, false);
Prevent the main content from scrolling when the nav menu is open
jleyba_js-dossier
train
js
99c5d4628dc8554c081cb20b91ce257fa980b6d0
diff --git a/src/test/java/com/relayrides/pushy/apns/ApnsClientTest.java b/src/test/java/com/relayrides/pushy/apns/ApnsClientTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/relayrides/pushy/apns/ApnsClientTest.java +++ b/src/test/java/com/relayrides/pushy/apns/ApnsClientTest.java @@ -72,7 +72,7 @@ public class ApnsClientTest { private ApnsClient<SimpleApnsPushNotification> client; @Rule - public Timeout globalTimeout = new Timeout(30000); + public Timeout globalTimeout = new Timeout(90_000); private static class TestMetricsListener implements ApnsClientMetricsListener {
Extended test timeout to <I> seconds. The addition of paranoid leak detection in ac8a<I> seems to have slowed things down enough that we were sometimes taking longer than <I> seconds for the send-lots-of-notifications tests, which would case an alarming cascade of test failures (which we should address as a separate issue).
relayrides_pushy
train
java
8b83cb6d8b03749118b555373cc12cda378ed487
diff --git a/src/Discord/Repository/AbstractRepository.php b/src/Discord/Repository/AbstractRepository.php index <HASH>..<HASH> 100755 --- a/src/Discord/Repository/AbstractRepository.php +++ b/src/Discord/Repository/AbstractRepository.php @@ -93,7 +93,7 @@ abstract class AbstractRepository extends Collection $endpoint->bindAssoc($this->vars); return $this->http->get($endpoint)->then(function ($response) { - $this->fill([]); + $this->clear(); foreach ($response as $value) { $value = array_merge($this->vars, (array) $value);
Fix repository cleanup Fix repository cleanup on refresh
teamreflex_DiscordPHP
train
php
70cc4a11de4adb99aa24da1e7b1782da5535beaa
diff --git a/inotify_test.go b/inotify_test.go index <HASH>..<HASH> 100644 --- a/inotify_test.go +++ b/inotify_test.go @@ -11,6 +11,7 @@ import ( "os" "path/filepath" "strings" + "sync" "testing" "time" ) @@ -390,9 +391,12 @@ func TestInotifyOverflow(t *testing.T) { errChan := make(chan error, numDirs*numFiles) + // All events need to be in the inotify queue before pulling events off it to trigger this error. + wg := sync.WaitGroup{} for dn := 0; dn < numDirs; dn++ { testSubdir := fmt.Sprintf("%s/%d", testDir, dn) + wg.Add(1) go func() { for fn := 0; fn < numFiles; fn++ { testFile := fmt.Sprintf("%s/%d", testSubdir, fn) @@ -409,8 +413,10 @@ func TestInotifyOverflow(t *testing.T) { continue } } + wg.Done() }() } + wg.Wait() creates := 0 overflows := 0
Fix TestInotifyOverflow (#<I>) * Queued inotify events could have been read by the test before max_queued_events was hit
fsnotify_fsnotify
train
go
006ea092309dc949035a1671654298baaefd14dc
diff --git a/sql-bricks.js b/sql-bricks.js index <HASH>..<HASH> 100644 --- a/sql-bricks.js +++ b/sql-bricks.js @@ -489,7 +489,7 @@ return sql._joinCriteria(getTable(left_tbl), getAlias(left_tbl), getTable(tbl), getAlias(tbl)); }; Join.prototype.toString = function toString(opts) { - var on = this.on, tbl = handleTable(this.tbl, opts), left_tbl = handleTable(this.left_tbl, opts); + var on = this.on, tbl = handleTable(this.tbl, opts); // Natural or cross join, no criteria needed. // Debt: Determining whether join is natural/cross by reading the string is slightly hacky... but works. @@ -498,10 +498,13 @@ // Not a natural or cross, check for criteria. if (!on || _.isEmpty(on)) { - if (sql._joinCriteria) + if (sql._joinCriteria) { + var left_tbl = handleTable(this.left_tbl, opts); on = this.autoGenerateOn(tbl, left_tbl); - else + } + else { throw new Error('No join criteria supplied for "' + getAlias(tbl) + '" join'); + } } // Array value for on indicates join using "using", rather than "on".
fixed bug (or at least symptom) by not calling handleTable() unless necessary b/c it has side-effects
CSNW_sql-bricks
train
js
b876da8f90be883d5ccf13cda4301ceacbbc6d83
diff --git a/lib/dpl/provider/openshift.rb b/lib/dpl/provider/openshift.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/provider/openshift.rb +++ b/lib/dpl/provider/openshift.rb @@ -1,10 +1,8 @@ module DPL class Provider class Openshift < Provider - # rhc 1.25.3 and later are required for httpclient 2.4.0 and up - # See https://github.com/openshift/rhc/pull/600 requires 'httpclient', version: '~> 2.4.0' - requires 'rhc', version: '~> 1.25.3' + requires 'rhc' def initialize(context, options) super
Update rhc to something more recent than <I>
travis-ci_dpl
train
rb
2e6a907f3c8d17351122bd9487f51d9936f69e2c
diff --git a/lib/cli.js b/lib/cli.js index <HASH>..<HASH> 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -35,9 +35,9 @@ module.exports = function() { this.server(argv.server === true && 'start' || argv.server, config); } else if(!config.tests) { Logger.log('JetRunner error - no tests to run.' + ' \nSeriously, dude, c\'mon...'.grey); - process.exit(); + process.exit(); } else { - this.run(config.tests, config, function(code) { process.exit(Number(code) || 1); }); + this.run(config.tests, config, function(code) { process.exit(Number(code)); }); } return this; diff --git a/lib/drivers/saucelabs.js b/lib/drivers/saucelabs.js index <HASH>..<HASH> 100644 --- a/lib/drivers/saucelabs.js +++ b/lib/drivers/saucelabs.js @@ -118,7 +118,7 @@ SauceLabsClient.prototype = util.merge(new TunnelClient, { function complete() { var passed = result == TestStatusEnum.PASS; - function exit() { + function exit(err) { self.emit(!err && passed ? 'success' : 'failure', result || undefined); self.emit('complete', err || result); }
Fixed some shell signal propagation stuff. Jenkins intergation lookin good.
peteromano_jetrunner
train
js,js
1531d789df97dbf1ed3f5b0340bbf39918d9fe48
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index <HASH>..<HASH> 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -8,7 +8,10 @@ from git.util import ( assure_directory_exists ) -from gitdb.exc import BadObject +from gitdb.exc import ( + BadObject, + BadName +) from gitdb.util import ( join, dirname, @@ -201,7 +204,7 @@ class SymbolicReference(object): else: try: invalid_type = self.repo.rev_parse(commit).type != Commit.type - except BadObject: + except (BadObject, BadName): raise ValueError("Invalid object: %s" % commit) # END handle exception # END verify type @@ -283,7 +286,7 @@ class SymbolicReference(object): try: obj = self.repo.rev_parse(ref + "^{}") # optionally deref tags write_value = obj.hexsha - except BadObject: + except (BadObject, BadName): raise ValueError("Could not extract object from %s" % ref) # END end try string else:
Now finally, tests should be working on travis too. Now handling the new exception BadName as well
gitpython-developers_GitPython
train
py
9596e114098a24174f30831b47b0171e80b174dd
diff --git a/tests/test_tokenize.py b/tests/test_tokenize.py index <HASH>..<HASH> 100644 --- a/tests/test_tokenize.py +++ b/tests/test_tokenize.py @@ -587,5 +587,5 @@ class TestTokenizePackage(unittest.TestCase): self.assertEqual(sefr_cut.segment(None), []) self.assertEqual(sefr_cut.segment(""), []) self.assertIsNotNone( - sefr_cut.segment("ฉันรักภาษาไทยเพราะฉันเป็นคนไทย", engine="sefr_cut"), + sefr_cut.segment("ฉันรักภาษาไทยเพราะฉันเป็นคนไทย"), )
Update test_tokenize.py
PyThaiNLP_pythainlp
train
py
0ebf31a6e39ffff68e811e0f139689f1ef81addc
diff --git a/linux/adv/packet.go b/linux/adv/packet.go index <HASH>..<HASH> 100644 --- a/linux/adv/packet.go +++ b/linux/adv/packet.go @@ -174,7 +174,7 @@ func (p *Packet) Field(typ byte) []byte { return nil } l, t := b[0], b[1] - if len(b) < int(1+l) { + if int(l) < 1 || len(b) < int(1+l) { return nil } if t == typ {
Fix for panic on invalid advertising packets
currantlabs_ble
train
go
214a6f0828b70fa7fbae855fcee72f28a96bca34
diff --git a/ravel.py b/ravel.py index <HASH>..<HASH> 100644 --- a/ravel.py +++ b/ravel.py @@ -271,9 +271,12 @@ class Connection(dbus.TaskKeeper) : def __del__(self) : - def remove_listeners(level, path) : + # Note: if remove_listeners refers directly to outer “self", + # then Connection object is not disposed immediately. Passing + # reference as explicit arg seems to fix this. + def remove_listeners(self, level, path) : for node, child in level.children.items() : - remove_listeners(child, path + [node]) + remove_listeners(self, child, path + [node]) #end for if not self._direct_connect : for interface in level.interfaces.values() : @@ -296,8 +299,9 @@ class Connection(dbus.TaskKeeper) : #begin __del__ if self._client_dispatch != None : - remove_listeners(self._client_dispatch, []) + remove_listeners(self, self._client_dispatch, []) #end if + connection = None #end __del__ def attach_asyncio(self, loop = None) :
Found another source of reference cycles, involving inner routines making nonlocal references to “self”.
ldo_dbussy
train
py
2ad546d04ff0a203a7559393c496e400c729a058
diff --git a/greenhouse/utils.py b/greenhouse/utils.py index <HASH>..<HASH> 100644 --- a/greenhouse/utils.py +++ b/greenhouse/utils.py @@ -317,8 +317,6 @@ class Timer(object): return self.cancelled = True index = bisect.bisect(tp, (self.waketime, None)) - while tp[index][0] < self.waketime: - index += 1 if tp[index][1].run is self.func: tp[index:index + 1] = []
useless check, that code would only ever run if bisect.bisect was wrong
teepark_greenhouse
train
py
e4a34c621da8d38b0d85aef272761bb0d17e1639
diff --git a/lib/transforms/logEvents.js b/lib/transforms/logEvents.js index <HASH>..<HASH> 100644 --- a/lib/transforms/logEvents.js +++ b/lib/transforms/logEvents.js @@ -12,7 +12,8 @@ function escapeRegExpMetaChars(str) { return str.replace(/[$.^()[\]{}]/g, '\\$&'); } -module.exports = ({ afterTransform, repl, stopOnWarning } = {}) => { +module.exports = ({ afterTransform, repl, stopOnWarning, console } = {}) => { + console = console || global.console; let startReplRegExp; if (repl) {
logEvents: Support a custom console implementation
assetgraph_assetgraph
train
js
f8d7f9bb0b5c81758167931a5061d050ac212af1
diff --git a/django_socketio/channels.py b/django_socketio/channels.py index <HASH>..<HASH> 100644 --- a/django_socketio/channels.py +++ b/django_socketio/channels.py @@ -50,10 +50,10 @@ class SocketIOChannelProxy(object): given. If no channel is given, send to the subscribers for all the channels that this socket is subscribed to. """ - if channel in self.channels: - channels = [channel] - else: + if channel is None: channels = self.channels + else: + channels = [channel] for channel in channels: for subscriber in CHANNELS[channel]: if subscriber != self.socket.session.session_id:
Allow broadcast by sockets to channels even if they're not subscribed.
stephenmcd_django-socketio
train
py
ce3be0397afa4ff5742b1ae3177e8b6cb4657e33
diff --git a/packages/cozy-pouch-link/src/PouchManager.js b/packages/cozy-pouch-link/src/PouchManager.js index <HASH>..<HASH> 100644 --- a/packages/cozy-pouch-link/src/PouchManager.js +++ b/packages/cozy-pouch-link/src/PouchManager.js @@ -114,10 +114,11 @@ export default class PouchManager { } console.info('Start replication loop') delay = delay || this.options.replicationDelay || DEFAULT_DELAY - this._stopReplicationLoop = promises.setInterval( - () => this.replicateOnce(), - delay - ) + this._stopReplicationLoop = promises.setInterval(() => { + if (window.navigator.onLine) { + this.replicateOnce() + } + }, delay) this.addListener() return this._stopReplicationLoop }
fix: Launch replication when device are online 📞
cozy_cozy-client
train
js
466aa8ba2d114099dd4ec2da31efeefc7b936182
diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index <HASH>..<HASH> 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -492,7 +492,7 @@ Guacamole.Client = function(tunnel) { var stream_index = parseInt(parameters[0]); var reason = parameters[1]; - var code = parameters[2]; + var code = parseInt(parameters[2]); // Get stream var stream = output_streams[stream_index]; @@ -718,7 +718,7 @@ Guacamole.Client = function(tunnel) { "error": function(parameters) { var reason = parameters[0]; - var code = parameters[1]; + var code = parseInt(parameters[1]); // Call handler if defined if (guac_client.onerror)
GUAC-<I> Always send error codes as numbers, not strings.
glyptodon_guacamole-client
train
js
99dfa501be0a681f47176a0599de6f125a8e6199
diff --git a/lib/octokit/client/users.rb b/lib/octokit/client/users.rb index <HASH>..<HASH> 100644 --- a/lib/octokit/client/users.rb +++ b/lib/octokit/client/users.rb @@ -88,7 +88,7 @@ module Octokit end def remove_key(id, options={}) - delete("user/keys/#{id}", options, 3, true, raw=true) + delete("user/keys/#{id}", options, 3, true, raw=true).status == 204 end def emails(options={})
Change Users#remove_key to return boolean
octokit_octokit.rb
train
rb
68e85b33ee93b25ad1851ef8281ba006bc1e5d09
diff --git a/ontobio/__init__.py b/ontobio/__init__.py index <HASH>..<HASH> 100644 --- a/ontobio/__init__.py +++ b/ontobio/__init__.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -__version__ = '2.7.1' +__version__ = '2.7.2rc0' from .ontol_factory import OntologyFactory
rc0 for docs release test
biolink_ontobio
train
py
c454553191385fb5eb536132fb2c22daafa5a47e
diff --git a/test/CommonProtocolDriver.js b/test/CommonProtocolDriver.js index <HASH>..<HASH> 100644 --- a/test/CommonProtocolDriver.js +++ b/test/CommonProtocolDriver.js @@ -37,7 +37,14 @@ export class CommonProtocolDriver { if (rule) { _.delay(() => { res.writeHead(200, {'Content-Type': rule.useRawResponse ? 'text/html' : 'application/json'}) - res.end(rule.useRawResponse ? rule.response : JSON.stringify(rule.response)) + + let response = rule.response; + + if (typeof(response) === 'function') { + response = response(request); + } + + res.end(rule.useRawResponse ? response : JSON.stringify(response)) }, rule.delay) } else { res.writeHead(404)
Added response as function to common protocol
wix_wix-restaurants-js-sdk
train
js
146d61d3db07f84d007b8f31824e6e5703d8c44d
diff --git a/upup/pkg/fi/nodeup/command.go b/upup/pkg/fi/nodeup/command.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/nodeup/command.go +++ b/upup/pkg/fi/nodeup/command.go @@ -178,8 +178,8 @@ func (c *NodeUpCommand) Run(out io.Writer) error { return fmt.Errorf("no instance group defined in nodeup config") } - if bootConfig.NodeupConfigHash != base64.StdEncoding.EncodeToString(nodeupConfigHash[:]) { - return fmt.Errorf("nodeup config hash mismatch") + if want, got := bootConfig.NodeupConfigHash, base64.StdEncoding.EncodeToString(nodeupConfigHash[:]); got != want { + return fmt.Errorf("nodeup config hash mismatch (was %q, expected %q)", got, want) } err = evaluateSpec(c, &nodeupConfig)
nodeup: print more info on hash mismatches
kubernetes_kops
train
go
a81e747a40edfb0056d4339e5bf42dcea1e73d85
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java @@ -598,7 +598,7 @@ public class Task implements Runnable, TaskSlotPayload, TaskActions, PartitionPr // ---------------------------- // activate safety net for task thread - LOG.info("Creating FileSystem stream leak safety net for task {}", this); + LOG.debug("Creating FileSystem stream leak safety net for task {}", this); FileSystemSafetyNet.initializeSafetyNetForThread(); // first of all, get a user-code classloader @@ -836,7 +836,7 @@ public class Task implements Runnable, TaskSlotPayload, TaskActions, PartitionPr fileCache.releaseJob(jobId, executionId); // close and de-activate safety net for task thread - LOG.info("Ensuring all FileSystem streams are closed for task {}", this); + LOG.debug("Ensuring all FileSystem streams are closed for task {}", this); FileSystemSafetyNet.closeSafetyNetAndGuardedResourcesForThread(); notifyFinalState();
[FLINK-<I>][runtime] Log FS safety-net lifecycle on DEBUG
apache_flink
train
java
47d93ba25dcf5a60ba99da8ddc803f416b56dc31
diff --git a/version.py b/version.py index <HASH>..<HASH> 100755 --- a/version.py +++ b/version.py @@ -1,2 +1,2 @@ #/usr/bin/env python -VERSION = '1.2.7-r2032' +VERSION = '1.2.7-r2035'
Ready for v. <I>
boriel_zxbasic
train
py
b4a055dce535927f72409c5626f517fe76c860c5
diff --git a/test/test_command_line_interface.py b/test/test_command_line_interface.py index <HASH>..<HASH> 100644 --- a/test/test_command_line_interface.py +++ b/test/test_command_line_interface.py @@ -4,8 +4,9 @@ This also contains some "end to end" tests. That means some very high level calls to the main function and a check against the output. These might later be converted to proper "unit" tests. """ -# TODO We are still missing high level tests for the following subcommands: -# details, add-email and merge. +# TODO We are still missing high level tests for the add-email and merge +# subcommands. They depend heavily on user interaction and are hard to test in +# their current form. import io import pathlib @@ -113,6 +114,14 @@ class ListingCommands(unittest.TestCase): expect = "foo" self.assertEqual(text, expect) + def test_simple_details_without_options(self): + with mock_stdout() as stdout: + khard.main(['details', 'uid1']) + text = stdout.getvalue() + # Currently the FN field is not shown with "details". + self.assertIn('Address book: foo', text) + self.assertIn('UID: testuid1', text) + @mock.patch('khard.config.find_executable', lambda x: x) class FileSystemCommands(unittest.TestCase):
Add high level test for "details"
scheibler_khard
train
py
339ed92ba8393e9d4f276c039a0269b241e765f8
diff --git a/test/e2e/storage/testsuites/volumelimits.go b/test/e2e/storage/testsuites/volumelimits.go index <HASH>..<HASH> 100644 --- a/test/e2e/storage/testsuites/volumelimits.go +++ b/test/e2e/storage/testsuites/volumelimits.go @@ -349,9 +349,9 @@ func getCSINodeLimits(cs clientset.Interface, config *PerTestConfig, nodeName st return false, nil } var csiDriver *storagev1.CSINodeDriver - for _, c := range csiNode.Spec.Drivers { + for i, c := range csiNode.Spec.Drivers { if c.Name == driverInfo.Name || c.Name == config.GetUniqueDriverName() { - csiDriver = &c + csiDriver = &csiNode.Spec.Drivers[i] break } }
[e2e/storage] fix range issue in getCSINodeLimits
kubernetes_kubernetes
train
go