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
97599e7f2f739b168de1b2b40ccdff633a913d41
diff --git a/public/ModuleDlstatsStatisticsDetails.php b/public/ModuleDlstatsStatisticsDetails.php index <HASH>..<HASH> 100644 --- a/public/ModuleDlstatsStatisticsDetails.php +++ b/public/ModuleDlstatsStatisticsDetails.php @@ -33,8 +33,7 @@ while ($dir != '.' && $dir != '/' && !is_file($dir . '/system/initialize.php')) if (!is_file($dir . '/system/initialize.php')) { - echo 'Could not find initialize.php!'; - exit(1); + throw new \ErrorException('Could not find initialize.php!',2,1,basename(__FILE__),__LINE__); } require($dir . '/system/initialize.php');
Fixed #<I> - exit() and die() functions should be avoided
BugBuster1701_dlstats
train
php
a698946d7a6bd52bd1ceed0df1221d848f143b9d
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -2,4 +2,4 @@ package manifold // Version is the package version of go-manifold. This gets automatically // updated by running `make release`. -const Version = "0.9.5" +const Version = "0.9.7"
Tagging <I> (#<I>)
manifoldco_go-manifold
train
go
1e6d452553f8d18b28e7d9c3589b7a84956731b3
diff --git a/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java b/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java +++ b/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java @@ -1502,16 +1502,8 @@ class ProcessClosurePrimitives extends AbstractPostOrderCallback return decl; } - /** - * There are some special cases where clients of the compiler - * do not run TypedScopeCreator after running this pass. - * So always give the namespace literal a type. - */ private Node createNamespaceLiteral() { - Node objlit = IR.objectlit(); - objlit.setJSType( - compiler.getTypeRegistry().createAnonymousObjectType(null)); - return objlit; + return IR.objectlit(); } /**
Remove a leftover use of the old type checker in ProcessClosurePrimitives. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
0243b14e30db91b04d4684aa0ddbde1a127ced7c
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -524,6 +524,10 @@ export function get (object, path) { } export function has (object, path, parent = false) { + if (typeof object === 'undefined') { + return false + } + const sections = path.split('.') const size = !parent ? 1 : 2 while (sections.length > size) {
fix: error on edit data of component without properties in devtools (#<I>)
vuejs_vue-devtools
train
js
98ea8cb57065dce36dc3349af241f362f56c0975
diff --git a/lib/adapters/postgres.js b/lib/adapters/postgres.js index <HASH>..<HASH> 100644 --- a/lib/adapters/postgres.js +++ b/lib/adapters/postgres.js @@ -577,15 +577,11 @@ var DB = define(Database, { }, primaryKey:function (table, opts) { - var ret = new Promise(); - var quotedTable = this.__quoteSchemaTable(table), pks = this.__primaryKeys; + var ret, quotedTable = this.__quoteSchemaTable(table).toString(), pks = this.__primaryKeys; if (pks.hasOwnProperty(quotedTable.toString())) { - ret.callback(pks[quotedTable.toString()]); + ret = pks[quotedTable]; } else { - this.__primarykey(table).then(function (res) { - pks[quotedTable] = res; - ret.callback(res); - }, ret); + ret = (pks[quotedTable] = this.__primarykey(table)); } return ret.promise(); },
fixed primarykey caching to use the promise.
C2FO_patio
train
js
4750ae78e082b9666b11125a058fc4035096f08b
diff --git a/pipdeps.py b/pipdeps.py index <HASH>..<HASH> 100755 --- a/pipdeps.py +++ b/pipdeps.py @@ -52,7 +52,8 @@ def command_install(bucket, verbose=False): for key in bucket.list(prefix=PREFIX): archive = key.name[len(PREFIX):] key.get_contents_to_filename(os.path.join(archives_dir, archive)) - run_pip_install(["--user", "--no-index", "--find-links", archives_dir], + archives_url = "file://" + archives_dir + run_pip_install(["--user", "--no-index", "--find-links", archives_url], verbose=verbose)
Support precise pip by using file: url for directory
juju_juju
train
py
ab36a42ea2bc5eacfd6a201c0d19c888793bfa6f
diff --git a/lib/distillery/document.rb b/lib/distillery/document.rb index <HASH>..<HASH> 100644 --- a/lib/distillery/document.rb +++ b/lib/distillery/document.rb @@ -27,7 +27,7 @@ module Distillery # HTML elements that are possible unrelated to the content of the content HTML # element. - POSSIBLE_UNRELATED_ELEMENTS = %w[table ul div] + POSSIBLE_UNRELATED_ELEMENTS = %w[table ul div a] # The Nokogiri document attr_reader :doc
Add <a> tags to the list list of possible unrelated elements. This helps remove bad anchors that are not part of the content.
Fluxx_distillery
train
rb
057e0559af0491b3b3dcb6069be66a6d253f317a
diff --git a/test/feature-emulation-helpers.js b/test/feature-emulation-helpers.js index <HASH>..<HASH> 100644 --- a/test/feature-emulation-helpers.js +++ b/test/feature-emulation-helpers.js @@ -120,6 +120,34 @@ return result; } + function fromCodePoint() + { + var codeUnits = []; + Array.prototype.forEach.call( + arguments, + function (arg) + { + var codePoint = Number(arg); + if ((codePoint & 0x1fffff) !== codePoint || codePoint > 0x10ffff) + { + throw RangeError(codePoint + ' is not a valid code point'); + } + if (codePoint <= 0xffff) + { + codeUnits.push(codePoint); + } + else + { + var highSurrogate = (codePoint - 0x10000 >> 10) + 0xd800; + var lowSurrogate = (codePoint & 0x3ff) + 0xdc00; + codeUnits.push(highSurrogate, lowSurrogate); + } + } + ); + var result = String.fromCharCode.apply(null, codeUnits); + return result; + } + function makeEmuFeatureEntries(str, regExp) { var result = @@ -385,7 +413,7 @@ { setUp: function () { - override(this, 'String.fromCodePoint', { value: String.fromCharCode }); + override(this, 'String.fromCodePoint', { value: fromCodePoint }); } }, GMT:
FROM_CODE_POINT feature emulation
fasttime_JScrewIt
train
js
a039316c74253b6176b8fd9517a93295033f8ec5
diff --git a/mode/haxe/haxe.js b/mode/haxe/haxe.js index <HASH>..<HASH> 100644 --- a/mode/haxe/haxe.js +++ b/mode/haxe/haxe.js @@ -191,21 +191,20 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { pass.apply(null, arguments); return true; } + function inList(name, list) { + for (var v = list; v; v = v.next) + if (v.name == name) return true; + return false; + } function register(varname) { - function inList(list) { - for (var v = list; v; v = v.next) - if (v.name == varname) return true; - return false; - } var state = cx.state; if (state.context) { cx.marked = "def"; - if (inList(state.localVars)) return; + if (inList(varname, state.localVars)) return; state.localVars = {name: varname, next: state.localVars}; - } else { - if (inList(state.globalVars)) return; - if (parserConfig.globalVars) - state.globalVars = {name: varname, next: state.globalVars}; + } else if (state.globalVars) { + if (inList(varname, state.globalVars)) return; + state.globalVars = {name: varname, next: state.globalVars}; } }
[haxe mode] Tweak previous patch
codemirror_CodeMirror
train
js
375f8be5a2f8be1ffd2d17d5d91b30900138565a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), setup( name='cartoframes', - version='0.2.1-beta.1', + version='0.2.1b2', description='An experimental Python pandas interface for using CARTO', long_description=LONG_DESCRIPTION, url='https://github.com/CartoDB/cartoframes', @@ -29,6 +29,7 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', @@ -41,6 +42,13 @@ setup( 'webcolors>=1.7.0', 'carto>=1.0.1', 'tqdm>=4.14.0',], + extras_require={ + ':python_version <= "2.7"': [ + 'IPython>=5.0.0,<6.0.0', + ], + ':python_version >= "3.0"': [ + 'IPython>=6.0.0' + ]}, package_dir={'cartoframes': 'cartoframes'}, package_data={ '': ['LICENSE',
conditionally installs IPython depending on major python version
CartoDB_cartoframes
train
py
8af6ce8e447f9939638b8fd02a92889de654d58b
diff --git a/app/controllers/administrate/application_controller.rb b/app/controllers/administrate/application_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/administrate/application_controller.rb +++ b/app/controllers/administrate/application_controller.rb @@ -27,7 +27,7 @@ module Administrate end def new - resource = resource_class.new + resource = new_resource authorize_resource(resource) render locals: { page: Administrate::Page::Form.new(dashboard, resource),
Use new_resource in new action (#<I>)
thoughtbot_administrate
train
rb
de0e4d39963e3efb13933ff30d06ec5ad259ffb0
diff --git a/simra/engine.go b/simra/engine.go index <HASH>..<HASH> 100644 --- a/simra/engine.go +++ b/simra/engine.go @@ -61,9 +61,11 @@ func (simra *Simra) Start(onStart, onStop chan bool) { func (simra *Simra) SetScene(driver Driver) { peer.LogDebug("IN") peer.GetGLPeer().Reset() + peer.GetTouchPeer().RemoveAllTouchListener() peer.GetSpriteContainer().RemoveSprites() simra.driver = driver + peer.GetSpriteContainer().Initialize() driver.Initialize() peer.LogDebug("OUT") }
remove and initialize touch listener on scene change
pankona_gomo-simra
train
go
87ca23fc36cc024f55ee81f7421e7e833557de1b
diff --git a/incoming_request.js b/incoming_request.js index <HASH>..<HASH> 100644 --- a/incoming_request.js +++ b/incoming_request.js @@ -109,8 +109,10 @@ TChannelIncomingRequest.prototype.handleFrame = function handleFrame(parts) { self._argstream.handleFrame(parts); } else { if (!parts) return; - if (parts.length !== 3 || - self.state !== States.Initial) throw new Error('not implemented'); + if (parts.length !== 3 || self.state !== States.Initial) { + self.emit('error', new Error( + 'un-streamed argument defragmentation is not implemented')); + } self.arg1 = parts[0] || emptyBuffer; self.arg2 = parts[1] || emptyBuffer; self.arg3 = parts[2] || emptyBuffer; @@ -124,7 +126,7 @@ TChannelIncomingRequest.prototype.handleFrame = function handleFrame(parts) { TChannelIncomingRequest.prototype.finish = function finish() { var self = this; if (self.state === States.Done) { - throw new Error('request already done'); // TODO: typed error + self.emit('error', new Error('request already done')); // TODO: typed error } else { self.state = States.Done; }
IncomingRequest: emit errors rather than throw them
uber_tchannel-node
train
js
1f263709ffc168143625f7cc9b9a5d04a38d4fd5
diff --git a/src/main/java/wyil/builders/VerificationConditionGenerator.java b/src/main/java/wyil/builders/VerificationConditionGenerator.java index <HASH>..<HASH> 100644 --- a/src/main/java/wyil/builders/VerificationConditionGenerator.java +++ b/src/main/java/wyil/builders/VerificationConditionGenerator.java @@ -582,12 +582,12 @@ public class VerificationConditionGenerator { // for (int i = 0; i != type.size(); ++i) { String field = fields[i]; - Opcode op = field.equals(bytecode.fieldName()) ? Opcode.EXPR_eq : Opcode.EXPR_neq; WyalFile.Identifier fieldIdentifier = new WyalFile.Identifier(field); - Expr oldField = new Expr.RecordAccess(originalSource, fieldIdentifier); + Expr oldField = field.equals(bytecode.fieldName()) ? rval + : new Expr.RecordAccess(originalSource, fieldIdentifier); oldField.attributes().addAll(lval.attributes()); Expr newField = new Expr.RecordAccess(newSource, fieldIdentifier); - context = context.assume(new Expr.Operator(op, oldField, newField)); + context = context.assume(new Expr.Operator(Opcode.EXPR_eq, oldField, newField)); } return context; } catch (ResolveError e) {
Bug fix for record assignment There was a bug in the way that record assignment was being translated in the VerificationConditionGenerator. It wasn't really doing anything that made sense for the field being assigned!!
Whiley_WhileyCompiler
train
java
d03e2f8fd481603b609340a447558d38f1ad76ec
diff --git a/runtests.py b/runtests.py index <HASH>..<HASH> 100644 --- a/runtests.py +++ b/runtests.py @@ -8,8 +8,10 @@ File for running tests programmatically. """ +# Standard library imports +import sys + # Third party imports -import qtpy import pytest @@ -17,9 +19,9 @@ def main(): """ Run pytest tests. """ - pytest.main(['-x', 'spyderlib', '-v', '-rw', '--durations=10', - '--cov=spyderlib', '--cov-report=term-missing']) - + errno = pytest.main(['-x', 'spyderlib', '-v', '-rw', '--durations=10', + '--cov=spyderlib', '--cov-report=term-missing']) + sys.exit(errno) if __name__ == '__main__': main()
Tests: Exit runtests.py with error code from py.test This allows CI tools to notice when tests fail.
spyder-ide_spyder
train
py
37b42cac2a618b7e4b8e0b9261e8babb8e5e5a58
diff --git a/src/Middleware/Middleware.php b/src/Middleware/Middleware.php index <HASH>..<HASH> 100644 --- a/src/Middleware/Middleware.php +++ b/src/Middleware/Middleware.php @@ -41,7 +41,7 @@ class Middleware implements MiddlewareInterface public function __invoke($request) { if ($this->isMatch($request)) { - $app = $this->next; + $app = $this->app; $response = $app($request); if ($response) { return $response;
bug fix: use the main app from $this->app, not $this->next.
TuumPHP_Web
train
php
570edfd1ee1e6a7e5657d10dac3d67810ff461bf
diff --git a/src/finalisers/shared/getExportBlock.js b/src/finalisers/shared/getExportBlock.js index <HASH>..<HASH> 100644 --- a/src/finalisers/shared/getExportBlock.js +++ b/src/finalisers/shared/getExportBlock.js @@ -1,3 +1,7 @@ +function propertyAccess ( name ) { + return name === 'default' ? `['default']` : `.${name}`; +} + export default function getExportBlock ( bundle, exportMode, mechanism = 'return' ) { if ( exportMode === 'default' ) { const defaultExportName = bundle.exports.lookup( 'default' ).name; @@ -7,9 +11,12 @@ export default function getExportBlock ( bundle, exportMode, mechanism = 'return return bundle.toExport .map( name => { - const prop = name === 'default' ? `['default']` : `.${name}`; const id = bundle.exports.lookup( name ); - return `exports${prop} = ${id.name};`; + + const reference = ( id.originalName !== 'default' && id.module && id.module.isExternal ) ? + id.module.name + propertyAccess( id.name ) : id.name; + + return `exports${propertyAccess( name )} = ${reference};`; }) .join( '\n' ); }
Fixed `getExportBlock` for external names.
rollup_rollup
train
js
5fa250514d260b5189178bc8e5ff495fd8e782cf
diff --git a/lib/rails_admin/config/fields/types/multiple_file_upload.rb b/lib/rails_admin/config/fields/types/multiple_file_upload.rb index <HASH>..<HASH> 100644 --- a/lib/rails_admin/config/fields/types/multiple_file_upload.rb +++ b/lib/rails_admin/config/fields/types/multiple_file_upload.rb @@ -38,7 +38,8 @@ module RailsAdmin image_html = v.image_tag(thumb_url, class: 'img-thumbnail') url != thumb_url ? v.link_to(image_html, url, target: '_blank', rel: 'noopener noreferrer') : image_html else - v.link_to(value, url, target: '_blank', rel: 'noopener noreferrer') + display_value = value.respond_to?(:filename) ? value.filename : value + v.link_to(display_value, url, target: '_blank', rel: 'noopener noreferrer') end end end
feat(types): show correct file name
sferik_rails_admin
train
rb
b3be074ddf62d4990111845816fa9ab627076ce7
diff --git a/src/interfaces/writablestream.js b/src/interfaces/writablestream.js index <HASH>..<HASH> 100644 --- a/src/interfaces/writablestream.js +++ b/src/interfaces/writablestream.js @@ -6,6 +6,7 @@ "use strict"; /*global _gpfDefineInterface*/ // Internal interface definition helper /*global _gpfSyncReadSourceJSON*/ // Reads a source json file (only in source mode) +/*exported _gpfIWritableStream*/ // gpf.interfaces.IWritableStream /*#endif*/ /** @@ -24,4 +25,10 @@ * @since 0.1.9 */ -_gpfDefineInterface("WritableStream", _gpfSyncReadSourceJSON("interfaces/writablestream.json")); +/** + * IWritableStream interface specifier + * + * @type {gpf.interfaces.IWritableStream} + */ +var _gpfIWritableStream = _gpfDefineInterface("WritableStream", + _gpfSyncReadSourceJSON("interfaces/writablestream.json"));
export _gpfIWritableStream
ArnaudBuchholz_gpf-js
train
js
0e2f76f598275ceb0cfcef1f753df8d663dce0fc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ setup( 'License :: OSI Approved :: MIT License', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4',
Fix programming language classifier (we do support python <I>)
pyQode_pyqode.core
train
py
a84de283b2012836a8512c54f927e34907e46c5a
diff --git a/lib/stats/DefaultStatsPrinterPlugin.js b/lib/stats/DefaultStatsPrinterPlugin.js index <HASH>..<HASH> 100644 --- a/lib/stats/DefaultStatsPrinterPlugin.js +++ b/lib/stats/DefaultStatsPrinterPlugin.js @@ -305,7 +305,7 @@ const SIMPLE_PRINTERS = { rendered ? green(formatFlag("rendered")) : undefined, "chunk.recorded": (recorded, { formatFlag, green }) => recorded ? green(formatFlag("recorded")) : undefined, - "chunk.reason": (reason, { yellow }) => yellow(reason), + "chunk.reason": (reason, { yellow }) => (reason ? yellow(reason) : undefined), "chunk.rootModules": (modules, context) => { let maxModuleId = 0; for (const module of modules) {
avoid printing undefined when there is no chunk reason
webpack_webpack
train
js
59f5c606a9b5208ba64c874199dcb3977a1d282f
diff --git a/src/global.js b/src/global.js index <HASH>..<HASH> 100644 --- a/src/global.js +++ b/src/global.js @@ -29,8 +29,8 @@ } // CommonJS module 1.1.1 spec (`exports` cannot be a function) exports.me = me; - } else { - global.me = me; } + // declare me globally + global.me = me; }(this)); /* eslint-enable no-undef */
always export/declare `me` globally
melonjs_melonJS
train
js
14ea525805d7948d1ade3234d33bcc9408953b30
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/core/bootstrap_context.rb +++ b/lib/chef/knife/core/bootstrap_context.rb @@ -223,6 +223,7 @@ validation_client_name "#{@chef_config[:validation_client_name]}" attributes[:run_list] = @run_list end + attributes.delete(:run_list) if attributes[:policy_name] && !attributes[:policy_name].empty? attributes.merge!(:tags => @config[:tags]) if @config[:tags] && !@config[:tags].empty? end end diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -586,6 +586,10 @@ describe Chef::Knife::Bootstrap do expect(knife.bootstrap_context.first_boot).to have_key(:policy_group) end + it "ensures that run_list is not set in the bootstrap context" do + expect(knife.bootstrap_context.first_boot).to_not have_key(:run_list) + end + end # https://github.com/chef/chef/issues/4131
If we don't have a run_list, don't send it This should help bootstrapping with policies Fixes: #<I>
chef_chef
train
rb,rb
afffba5b8480f9bb7f3c7a5da9f43101636e7bb4
diff --git a/openid.js b/openid.js index <HASH>..<HASH> 100644 --- a/openid.js +++ b/openid.js @@ -1021,7 +1021,7 @@ openid.verifyAssertion = function(requestOrUrl, callback, stateless, extensions, if(typeof(requestOrUrl) !== typeof('')) { if(requestOrUrl.method == 'POST') { - if(requestOrUrl.headers['content-type'] == 'application/x-www-form-urlencoded') { + if((requestOrUrl.headers['content-type'] || '').toLowerCase().indexOf('application/x-www-form-urlencoded') === 0) { // POST response received var data = '';
Looser content-type check for POST responses accepts charsets (fixes #<I>)
havard_node-openid
train
js
abbf8ba519c500fdfd6cdb3bc03b835af149b110
diff --git a/kerncraft/cacheprediction.py b/kerncraft/cacheprediction.py index <HASH>..<HASH> 100755 --- a/kerncraft/cacheprediction.py +++ b/kerncraft/cacheprediction.py @@ -83,12 +83,14 @@ class LayerConditionPredictor(CachePredictor): raise ValueError("Only one loop counter may appear per term. " "Problematic term: {}.".format(t)) else: # len(idx) == 1 + idx = idx.pop() # Check that number of multiplication match access order of iterator - stride_dim = len(t.as_ordered_factors()) - #if loop_stack[len(loop_stack)-stride_dim]['index'] != idx.pop().name: - # raise ValueError("Number of multiplications in index term does not " - # "match loop counter order. " - # "Problematic term: {}.".format(t)) + pow_dict = {k: v for k, v in t.as_powers_dict().items() if k != idx} + stride_dim = sum(pow_dict.values()) + if loop_stack[-stride_dim-1]['index'] != idx.name: + raise ValueError("Number of multiplications in index term does not " + "match loop counter order. " + "Problematic term: {}.".format(t)) # 3. Indices may only increase with one # TODO use a public interface, not self.kernel._*
improved compatibility check in layer condition predictor
RRZE-HPC_kerncraft
train
py
87e83b8b43cc0cef4eb3613cdb37005e752d723a
diff --git a/lib/plugins/aws/invokeLocal/index.js b/lib/plugins/aws/invokeLocal/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/aws/invokeLocal/index.js +++ b/lib/plugins/aws/invokeLocal/index.js @@ -233,7 +233,7 @@ class AwsInvokeLocal { 'package', '-f', path.join(javaBridgePath, 'pom.xml'), - ]); + ], { shell: true }); this.serverless.cli .log('Building Java bridge, first invocation might take a bit longer.');
Add Windows support for spawning mvn
serverless_serverless
train
js
e7a260f6ff89fb5e76bc31def23115bddc80cca6
diff --git a/parsl/dataflow/futures.py b/parsl/dataflow/futures.py index <HASH>..<HASH> 100644 --- a/parsl/dataflow/futures.py +++ b/parsl/dataflow/futures.py @@ -45,8 +45,31 @@ class AppFuture(Future): super().__init__() self.parent = parent + + def parent_callback(self, executor_fu): + ''' Callback from executor future to update the parent. + Args: + executor_fu (Future): Future returned by the executor along with callback + + Updates the super() with the result() or exception() + ''' + logger.debug("App_fu updated with executor_Fu state") + + if executor_fu.done() == True: + super().set_result(executor_fu.result()) + + e = executor_fu.exception() + if e: + super().set_exception(e) + + def update_parent(self, fut): + ''' Handle the case where the user has called result on the AppFuture + before the parent exists. Add a callback to the parent to update the + state + ''' self.parent = fut + fut.add_done_callback(self.parent_callback) def result(self, timeout=None): #print("FOooo")
Added the callback to update super() when executor_future is resolved.
Parsl_parsl
train
py
cebbae3045be660366b696b038abbdb3d07be1b1
diff --git a/src/org/parosproxy/paros/core/scanner/PluginFactory.java b/src/org/parosproxy/paros/core/scanner/PluginFactory.java index <HASH>..<HASH> 100644 --- a/src/org/parosproxy/paros/core/scanner/PluginFactory.java +++ b/src/org/parosproxy/paros/core/scanner/PluginFactory.java @@ -42,6 +42,7 @@ // ZAP: 2015/11/02 Issue 1969: Issues with installation of scanners // ZAP: 2015/12/21 Issue 2112: Wrong policy on active Scan // ZAP: 2016/01/26 Fixed findbugs warning +// ZAP: 2016/05/04 Use existing Plugin instances when setting them as completed package org.parosproxy.paros.core.scanner; @@ -637,9 +638,11 @@ public class PluginFactory { } synchronized void setRunningPluginCompleted(Plugin plugin) { - listRunning.remove(plugin); - listCompleted.add(plugin); - plugin.setTimeFinished(); + if (listRunning.remove(plugin)) { + Plugin completedPlugin = mapAllPlugin.get(plugin.getId()); + listCompleted.add(completedPlugin); + completedPlugin.setTimeFinished(); + } } boolean isRunning(Plugin plugin) {
Set existing Plugin instance as completed Change PluginFactory to set the existing Plugin instance as completed instead of the instance passed as parameter, to ensure that the Plugin that's returned as completed is the correct instance and not one of the instances created during and for the active scan (which might not have all its state up-to-date). The change prevents completed AbstractHostPlugin scanners from having unknown status when returning scans' progress through the active scan API.
zaproxy_zaproxy
train
java
e16e76f96bc7bf27008e0622cc786887a8c03991
diff --git a/src/settings.js b/src/settings.js index <HASH>..<HASH> 100644 --- a/src/settings.js +++ b/src/settings.js @@ -107,7 +107,7 @@ export class Settings { /** * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals - * @type {Zone} + * @type {boolean} */ static get throwOnInvalid() { return throwOnInvalid; @@ -115,7 +115,7 @@ export class Settings { /** * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals - * @type {Zone} + * @type {boolean} */ static set throwOnInvalid(t) { throwOnInvalid = t;
throwOnInvalid is a boolean (#<I>)
moment_luxon
train
js
ecff790978e4de33fe0bf98e0854a01c2dd3ee34
diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/tokenizers/de/GermanCompoundTokenizer.java b/languagetool-language-modules/de/src/main/java/org/languagetool/tokenizers/de/GermanCompoundTokenizer.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/de/src/main/java/org/languagetool/tokenizers/de/GermanCompoundTokenizer.java +++ b/languagetool-language-modules/de/src/main/java/org/languagetool/tokenizers/de/GermanCompoundTokenizer.java @@ -139,6 +139,7 @@ public class GermanCompoundTokenizer implements Tokenizer { wordSplitter.addException("Siebengestirnen", asList("Sieben", "gestirnen")); wordSplitter.addException("Siebengestirns", asList("Sieben", "gestirns")); wordSplitter.addException("Siebengestirnes", asList("Sieben", "gestirnes")); + wordSplitter.addException("Alpinforum", asList("Alpin", "forum")); wordSplitter.setStrictMode(strictMode); wordSplitter.setMinimumWordLength(3); }
[de] fix splitting of Alpinforum
languagetool-org_languagetool
train
java
9fbb1e10759f338ea39afaa6e8f63d74cdfe9ba4
diff --git a/jimfs/src/main/java/com/google/jimfs/internal/PathMatchers.java b/jimfs/src/main/java/com/google/jimfs/internal/PathMatchers.java index <HASH>..<HASH> 100644 --- a/jimfs/src/main/java/com/google/jimfs/internal/PathMatchers.java +++ b/jimfs/src/main/java/com/google/jimfs/internal/PathMatchers.java @@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Ascii; import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; import com.google.jimfs.path.Normalization; @@ -53,7 +54,7 @@ final class PathMatchers { checkArgument(syntaxSeparator > 0, "Must be of the form 'syntax:pattern': %s", syntaxAndPattern); - String syntax = syntaxAndPattern.substring(0, syntaxSeparator); + String syntax = Ascii.toLowerCase(syntaxAndPattern.substring(0, syntaxSeparator)); String pattern = syntaxAndPattern.substring(syntaxSeparator + 1); switch (syntax) {
Make path matcher syntax (e.g. "glob:" or "regex:") case insensitive as specified.
google_jimfs
train
java
7528beea1e7808e59a425fd83cd770afe1f50752
diff --git a/Proxy/Client/SoapClient.php b/Proxy/Client/SoapClient.php index <HASH>..<HASH> 100644 --- a/Proxy/Client/SoapClient.php +++ b/Proxy/Client/SoapClient.php @@ -16,8 +16,8 @@ use Biplane\YandexDirectBundle\Exception\NetworkException; */ class SoapClient extends \SoapClient implements ClientInterface { - const ENDPOINT = 'http://soap.direct.yandex.ru/live/v4/wsdl/'; - const API_NS = 'API'; + const ENDPOINT = 'https://api.direct.yandex.ru/live/v4/wsdl/'; + const API_NS = 'API'; const INVALID_NS = 'http://namespaces.soaplite.com/perl'; private static $classmap = array(
Changed the endpoint for SOAP
biplane_yandex-direct
train
php
2556aad78d398beb85b1bd96c94fa390cde158e0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -68,9 +68,16 @@ class TestCommand(Command): sys.exit(exit_code) +from os import path +this_directory = path.abspath(path.dirname(__file__)) +with open(path.join(this_directory, 'README.rst')) as f: + long_description = f.read() + setup(name='pyxtuml', version='2.2.2', # ensure that this is the same as in xtuml.version description='Library for parsing, manipulating, and generating BridgePoint xtUML models', + long_description=long_description, + long_description_content_type='text/x-rst', author=u'John Törnblom', author_email='john.tornblom@gmail.com', url='https://github.com/xtuml/pyxtuml',
Adjust setup.py to fix missing long description
xtuml_pyxtuml
train
py
f4d702aec36a3b8a29207d9c6f67d183d1d4e64b
diff --git a/src/main/java/org/jdbdt/Table.java b/src/main/java/org/jdbdt/Table.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jdbdt/Table.java +++ b/src/main/java/org/jdbdt/Table.java @@ -152,7 +152,7 @@ public final class Table extends DataSource { * Ensure table is bound to a connection, * otherwise throw {@link InvalidUsageException}. */ - private void checkIfBound() { + void checkIfBound() { if (connection == null) { throw new InvalidUsageException("Table is not bound to a connection."); } @@ -161,7 +161,7 @@ public final class Table extends DataSource { * Ensure table is NOT bound to a connection, * otherwise throw {@link InvalidUsageException}. */ - private void checkIfNotBound() { + void checkIfNotBound() { if (connection != null) { throw new InvalidUsageException("Table is already bound to a connection."); }
Table: checkIfBound/notBound package protected (again)
JDBDT_jdbdt
train
java
d1579b4c5b18b4bf81dc832bc84c2e6d14f2b34a
diff --git a/tests/__init__.py b/tests/__init__.py index <HASH>..<HASH> 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,8 +1,7 @@ import os import sys - f = os.readlink(__file__) if os.path.islink(__file__) else __file__ path = os.path.realpath(os.path.join(f, "..", "..", "src")) if path not in sys.path: - sys.path.append(path) + sys.path.insert(0, path)
ensure code from src dir is used
jopohl_urh
train
py
3b3251752577e6945627de7d1bd8631c91c1cfda
diff --git a/app/models/socializer/activity.rb b/app/models/socializer/activity.rb index <HASH>..<HASH> 100644 --- a/app/models/socializer/activity.rb +++ b/app/models/socializer/activity.rb @@ -5,6 +5,7 @@ module Socializer class Activity < ActiveRecord::Base include ObjectTypeBase + # TODO: Remove default_scope. Prevents the Rails 4.2 adequate record caching default_scope { order(created_at: :desc) } attr_accessible :verb, :circles, :actor_id, :activity_object_id, :target_id diff --git a/app/models/socializer/notification.rb b/app/models/socializer/notification.rb index <HASH>..<HASH> 100644 --- a/app/models/socializer/notification.rb +++ b/app/models/socializer/notification.rb @@ -3,6 +3,7 @@ # module Socializer class Notification < ActiveRecord::Base + # TODO: Remove default_scope. Prevents the Rails 4.2 adequate record caching default_scope { order(created_at: :desc) } attr_accessible :read
add some TODOs related to default_scope
socializer_socializer
train
rb,rb
26ea1af44d908debcc7f0ac29ea2f1de4106ae1f
diff --git a/src/main/java/com/github/tomakehurst/wiremock/client/VerificationException.java b/src/main/java/com/github/tomakehurst/wiremock/client/VerificationException.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/client/VerificationException.java +++ b/src/main/java/com/github/tomakehurst/wiremock/client/VerificationException.java @@ -54,7 +54,7 @@ public class VerificationException extends AssertionError { } - private static String renderList(List list) { + private static String renderList(List<?> list) { return Joiner.on("\n\n").join( from(list).transform(toStringFunction()) );
Added missing type parameter to List in method signature in VerificationException
tomakehurst_wiremock
train
java
1e7295ce1e35f64b3c13f26830239c9cbf3c5379
diff --git a/go/libkb/ca.go b/go/libkb/ca.go index <HASH>..<HASH> 100644 --- a/go/libkb/ca.go +++ b/go/libkb/ca.go @@ -11,7 +11,7 @@ var apiCAOverrideForTest = "" // no matching CA is found for host. func GetBundledCAsFromHost(host string) (rootCA []byte, ok bool) { host = strings.TrimSpace(strings.ToLower(host)) - realAPICA := apiCA + realAPICA := APICA if len(apiCAOverrideForTest) > 0 { realAPICA = apiCAOverrideForTest } @@ -39,7 +39,7 @@ func GetBundledCAsFromHost(host string) (rootCA []byte, ok bool) { } } -const apiCA = ` +const APICA = ` -----BEGIN CERTIFICATE----- MIIGmzCCBIOgAwIBAgIJAPzhpcIBaOeNMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD VQQGEwJVUzELMAkGA1UECBMCTlkxETAPBgNVBAcTCE5ldyBZb3JrMRQwEgYDVQQK
expose API CA (#<I>)
keybase_client
train
go
605bfe4f56f9d58e69180947ae8aa89526103fc5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -35,15 +35,14 @@ setup(author='Mateusz Susik', 'Topic :: Utilities' ], cmdclass={'test': PyTest}, - description='A python wrapper over ORCID API', + description='A python wrapper over the ORCID API', install_requires=['requests', 'simplejson'], keywords=['orcid', 'api', 'wrapper'], license='BSD', long_description=open('README.rst', 'r').read(), name='orcid', - package_data={'orcid': ['templates/*.xml']}, packages=['orcid'], tests_require=['pytest', 'coverage', 'httpretty'], - url='https://github.com/MSusik/python-orcid', + url='https://github.com/ORCID/python-orcid', version='0.5.1' )
setup: move to ORCID organisation
ORCID_python-orcid
train
py
346f4042c18005af51b97e984808be287047a5ee
diff --git a/test/vain.js b/test/vain.js index <HASH>..<HASH> 100644 --- a/test/vain.js +++ b/test/vain.js @@ -129,5 +129,22 @@ describe('Vain', function() { router.handle({ url: testPath, method: 'GET', path: testPath}, res); }); + + it("should return a 404 for invalid paths", function(done) { + var testPath = '/nonexistent-path', + router = vain.router("./test/examples"), + res = { + render: function(val) { + done("Render was invoked."); + }, + + send: function(code) { + code.should.equal(404); + done(); + } + }; + + router.handle({ url: testPath, method: 'GET', path: testPath}, res); + }); }); });
Add a spec for returning <I> for invalid paths.
farmdawgnation_vain
train
js
8f70c0cc2fd0a8e671e8b7655001da00060a7d04
diff --git a/moz_sql_parser/sql_parser.py b/moz_sql_parser/sql_parser.py index <HASH>..<HASH> 100644 --- a/moz_sql_parser/sql_parser.py +++ b/moz_sql_parser/sql_parser.py @@ -99,7 +99,7 @@ KNOWN_OPS = [ Literal("==").setName("eq").setDebugActions(*debug), Literal("!=").setName("neq").setDebugActions(*debug), IN.setName("in").setDebugActions(*debug), - NOTIN.setName("not in").setDebugActions(*debug), + NOTIN.setName("nin").setDebugActions(*debug), IS.setName("is").setDebugActions(*debug), LIKE.setName("like").setDebugActions(*debug), OR.setName("or").setDebugActions(*debug),
rename the not in keyword in SQL ast to nin
mozilla_moz-sql-parser
train
py
80b9463d550b865d6dc513cbec59e72fc400c51a
diff --git a/symphony/lib/toolkit/class.mysql.php b/symphony/lib/toolkit/class.mysql.php index <HASH>..<HASH> 100644 --- a/symphony/lib/toolkit/class.mysql.php +++ b/symphony/lib/toolkit/class.mysql.php @@ -326,7 +326,8 @@ elseif($this->_lastResult == NULL){ return array(); } - + + $newArray = array(); foreach ($this->_lastResult as $row){ $newArray[] = get_object_vars($row); }
In case of mysql->query() returning empty array, fetch() was returning NULL. Initialize to fix that.
symphonycms_symphony-2
train
php
2955856bae93893872994fbe0362bc559e1108a5
diff --git a/pharen.php b/pharen.php index <HASH>..<HASH> 100644 --- a/pharen.php +++ b/pharen.php @@ -860,7 +860,7 @@ class LeafNode extends Node{ public $value; public $tok; - public function __construct($parent, $children, $value, $tok){ + public function __construct($parent, $children, $value, $tok=Null){ parent::__construct($parent); $this->children = Null; $this->value = $value;
Let LeafNodes have a reference to the ancestral token.
Scriptor_pharen
train
php
c924619f9f57b98c077af77f9ec9093406f39b88
diff --git a/minimongo/test.py b/minimongo/test.py index <HASH>..<HASH> 100644 --- a/minimongo/test.py +++ b/minimongo/test.py @@ -164,7 +164,6 @@ class TestSimpleModel(unittest.TestCase): self.assertEqual(indices['x_1'], {'key': [('x', 1)]}) - def test_unique_index(self): """Test behavior of indices with unique=True""" # This will work (y is undefined) @@ -391,9 +390,7 @@ class TestNoAutoIndex(unittest.TestCase): def tearDown(self): """unittest teardown, drop all collections.""" - TestModel.collection.drop() - TestModelUnique.collection.drop() - TestDerivedModel.collection.drop() + TestNoAutoIndexModel.collection.drop() def test_no_auto_index(self): TestNoAutoIndexModel({'x': 1}).save() @@ -462,6 +459,5 @@ class TestOptions(unittest.TestCase): del Options.foo - if __name__ == '__main__': unittest.main()
Fixed bad test for previous changeset, pep8
slacy_minimongo
train
py
e9d127f7eee4a3dbffee6b421e293adcf46fcc52
diff --git a/treeherder/settings/base.py b/treeherder/settings/base.py index <HASH>..<HASH> 100644 --- a/treeherder/settings/base.py +++ b/treeherder/settings/base.py @@ -308,9 +308,9 @@ BUILDAPI_BUILDS4H_URL = "https://secure.pub.build.mozilla.org/builddata/buildjso # data job ingestion. # If TreeherderCollections are larger, they will be chunked # to this size. -BUILDAPI_PENDING_CHUNK_SIZE = 50 -BUILDAPI_RUNNING_CHUNK_SIZE = 50 -BUILDAPI_BUILDS4H_CHUNK_SIZE = 50 +BUILDAPI_PENDING_CHUNK_SIZE = 150 +BUILDAPI_RUNNING_CHUNK_SIZE = 150 +BUILDAPI_BUILDS4H_CHUNK_SIZE = 150 PARSER_MAX_STEP_ERROR_LINES = 100 PARSER_MAX_SUMMARY_LINES = 200
bump chunk size to <I> from <I>
mozilla_treeherder
train
py
6fb8bf625fcfa12b085101838813ab7bc4635dae
diff --git a/spec/unit/parser/ast/definition.rb b/spec/unit/parser/ast/definition.rb index <HASH>..<HASH> 100755 --- a/spec/unit/parser/ast/definition.rb +++ b/spec/unit/parser/ast/definition.rb @@ -30,7 +30,7 @@ describe Puppet::Parser::AST::Definition, "when evaluating" do end it "should have a get_classname method" do - @definition.should respond_to :get_classname + @definition.should respond_to(:get_classname) end it "should return the current classname with get_classname" do
Fixing ruby warning in definition test
puppetlabs_puppet
train
rb
3519ef04e2e7ff7d19a7dc01f9055613024c1a3b
diff --git a/src/ZineInc/Storage/Common/FileId.php b/src/ZineInc/Storage/Common/FileId.php index <HASH>..<HASH> 100644 --- a/src/ZineInc/Storage/Common/FileId.php +++ b/src/ZineInc/Storage/Common/FileId.php @@ -41,6 +41,23 @@ final class FileId return count($this->attributes->all()) > 0 || $this->filename() !== $this->id; } + /** + * Creates variant with given attributes of this file + * + * @param array $attrs Variant attributes - it might be image size, file name etc. + * + * @return FileId + */ + public function variant(array $attrs) + { + return new self($this->id, $attrs); + } + + /** + * Creates id to original file. + * + * @return FileId + */ public function original() { return new self($this->id);
FileId::variant factory method
zineinc_floppy-common
train
php
6d618c4f01c373ad798c6e2fb1599deb90018db0
diff --git a/bin/templates/scripts/cordova/lib/Podfile.js b/bin/templates/scripts/cordova/lib/Podfile.js index <HASH>..<HASH> 100644 --- a/bin/templates/scripts/cordova/lib/Podfile.js +++ b/bin/templates/scripts/cordova/lib/Podfile.js @@ -39,7 +39,7 @@ function Podfile (podFilePath, projectName, minDeploymentTarget) { this.path = podFilePath; this.projectName = projectName; - this.minDeploymentTarget = minDeploymentTarget || '9.0'; + this.minDeploymentTarget = minDeploymentTarget || '10.0'; this.contents = null; this.sources = null; this.declarations = null; @@ -75,7 +75,7 @@ Podfile.prototype.__parseForDeclarations = function (text) { // split by \n var arr = text.split('\n'); - // getting lines between "platform :ios, '9.0'"" and "target 'HelloCordova'" do + // getting lines between "platform :ios, '10.0'"" and "target 'HelloCordova'" do var declarationsPreRE = new RegExp('platform :ios,\\s+\'[^\']+\''); var declarationsPostRE = new RegExp('target\\s+\'[^\']+\'\\s+do'); var declarationRE = new RegExp('^\\s*[^#]');
Bump default minDeploymentTarget to <I> in Podfile (#<I>)
apache_cordova-ios
train
js
c9b771aacfff102dbe74244f8b48eebcfe5278e2
diff --git a/src/com/google/javascript/rhino/jstype/UnionType.java b/src/com/google/javascript/rhino/jstype/UnionType.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/rhino/jstype/UnionType.java +++ b/src/com/google/javascript/rhino/jstype/UnionType.java @@ -352,7 +352,7 @@ public class UnionType extends JSType { * A {@link UnionType} contains a given type (alternate) iff the member * vector contains it. * - * @param alternate The alternate which might be in this union. + * @param type The alternate which might be in this union. * * @return {@code true} if the alternate is in the union */
fix a javadoc warning that was bugging me R=zhuyi DELTA=1 (0 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
java
26653c8b5c69879e9ff166055d96c5b0b6fcaf17
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,11 +29,11 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2015111600.00; // 20151116 = branching date YYYYMMDD - do not modify! +$version = 2015111600.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '3.0 (Build: 20151116)'; // Human-friendly version name +$release = '3.1dev (Build: 20151116)'; // Human-friendly version name -$branch = '30'; // This version's branch. -$maturity = MATURITY_STABLE; // This version's maturity level. +$branch = '31'; // This version's branch. +$maturity = MATURITY_ALPHA; // This version's maturity level.
weekly back-to-dev release <I>dev
moodle_moodle
train
php
81b51967d856f232d42cfc233c4f35a66ae8fd41
diff --git a/easypysmb/easypysmb.py b/easypysmb/easypysmb.py index <HASH>..<HASH> 100644 --- a/easypysmb/easypysmb.py +++ b/easypysmb/easypysmb.py @@ -71,11 +71,12 @@ class EasyPySMB(): logger.warning( 'Share {} does not exist on the server'.format(self.share_name) ) - dir_content = [x.filename for x in self.ls(os.path.dirname(self.file_path))] - if os.path.basename(self.file_path) not in dir_content: - logger.warning( - 'File {} does not exist on the server'.format(self.file_path) - ) + if self.file_path: + dir_content = [x.filename for x in self.ls(os.path.dirname(self.file_path))] + if os.path.basename(self.file_path) not in dir_content: + logger.warning( + 'File {} does not exist on the server'.format(self.file_path) + ) def __decompose_smb_path(self, path): '''
Skip file path check if not set
pschmitt_easypysmb
train
py
dbe38062010ef96a8a6232394b4b3fb0ad8b2494
diff --git a/pyannote/metrics/spotting.py b/pyannote/metrics/spotting.py index <HASH>..<HASH> 100644 --- a/pyannote/metrics/spotting.py +++ b/pyannote/metrics/spotting.py @@ -58,8 +58,8 @@ class LowLatencySpeakerSpotting(BaseMetric): 'true_negative': 0., 'false_negative': 0.} - def __init__(self, thresholds=None, **kwargs): - super(LowLatencySpeakerSpotting, self).__init__(**kwargs) + def __init__(self, thresholds=None): + super(LowLatencySpeakerSpotting, self).__init__(parallel=False) self.thresholds = np.sort(thresholds) def compute_metric(self, detail):
chore: disable parallel processing for speaker spotting metric
pyannote_pyannote-metrics
train
py
285440727764881daaa2de106334e83078c5d33c
diff --git a/src/User/User.php b/src/User/User.php index <HASH>..<HASH> 100644 --- a/src/User/User.php +++ b/src/User/User.php @@ -17,7 +17,7 @@ use vxPHP\Security\Password\PasswordEncrypter; * wraps authentication and role assignment * * @author Gregor Kofler, info@gregorkofler.com - * @version 2.1.2 2021-04-28 + * @version 2.1.3 2021-05-22 */ class User implements UserInterface { @@ -132,7 +132,7 @@ class User implements UserInterface * {@inheritDoc} * @see \vxPHP\User\UserInterface::getAttribute() */ - public function getAttribute(string $attribute, $default = null): string + public function getAttribute(string $attribute, $default = null): ?string { if (!$this->attributes || !array_key_exists(strtolower($attribute), $this->attributes)) { return $default;
fix: User::getAttribute() can return null
Vectrex_vxPHP
train
php
42716aa1266a1870492b9131a4f2d5d695cc82ce
diff --git a/redis_collections/dicts.py b/redis_collections/dicts.py index <HASH>..<HASH> 100644 --- a/redis_collections/dicts.py +++ b/redis_collections/dicts.py @@ -84,13 +84,6 @@ class Dict(RedisCollection, collections.MutableMapping): if data: self.update(data) - def _get_hash_dict(self, key, redis): - key_hash = hash(key) - D = redis.hget(self.key, key_hash) - D = {} if D is None else self._unpickle(D) - - return key_hash, D - def __len__(self, pipe=None): """Return the number of items in the dictionary.""" pipe = pipe or self.redis
Remove _get_hash_dict method
honzajavorek_redis-collections
train
py
ff120bc8306b12e041ea1f67956136b2ebd919bb
diff --git a/thinc/extra/datasets.py b/thinc/extra/datasets.py index <HASH>..<HASH> 100644 --- a/thinc/extra/datasets.py +++ b/thinc/extra/datasets.py @@ -74,6 +74,8 @@ def read_conll(loc): word, pos, head, label = pieces else: idx, word, lemma, pos1, pos, morph, head, label, _, _2 = pieces + if '-' in idx: + continue words.append(word) tags.append(pos) yield words, tags
Filter fused tokens from Ancora data
explosion_thinc
train
py
82d2884da91fc6c660cb875e6f6cf48b371f6f3c
diff --git a/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitIssueSearchExtension.java b/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitIssueSearchExtension.java index <HASH>..<HASH> 100644 --- a/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitIssueSearchExtension.java +++ b/ontrack-extension-git/src/main/java/net/nemerosa/ontrack/extension/git/GitIssueSearchExtension.java @@ -101,7 +101,7 @@ public class GitIssueSearchExtension extends AbstractExtension implements Search // ... and creates a result entry results.add( new SearchResult( - issue.getKey(), + issue.getDisplayKey(), String.format("Issue %s in Git repository %s for branch %s/%s", issue.getKey(), c.getGitConfiguration().getName(),
#<I> Displaying the GitHub issue with a leading #
nemerosa_ontrack
train
java
76f23a56dd8782518a1bf71dc60066c97b0fe144
diff --git a/lib/erector/needs.rb b/lib/erector/needs.rb index <HASH>..<HASH> 100644 --- a/lib/erector/needs.rb +++ b/lib/erector/needs.rb @@ -1,5 +1,7 @@ module Erector module Needs + NO_DUP_CLASSES = [NilClass, FalseClass, TrueClass, 0.class, Float, Symbol].freeze + def self.included(base) base.extend ClassMethods end @@ -83,7 +85,7 @@ module Erector # set variables with default values self.class.needed_defaults.each do |name, value| unless assigned.include?(name) - value = [NilClass, FalseClass, TrueClass, Fixnum, Float, Symbol].include?(value.class) ? value : value.dup + value = NO_DUP_CLASSES.include?(value.class) ? value : value.dup instance_variable_set("@#{name}", value) assigned << name end
Fixnum is deprecated in ruby >= <I>
erector_erector
train
rb
4f163ff66e4c4d780b9f7a3304204d0e6bfccc54
diff --git a/graphistry/tests/test_compute.py b/graphistry/tests/test_compute.py index <HASH>..<HASH> 100644 --- a/graphistry/tests/test_compute.py +++ b/graphistry/tests/test_compute.py @@ -118,3 +118,9 @@ class TestComputeMixin(NoAuthTestCase): cg = CGFull() g = cg.edges(pd.DataFrame({'s': ['a', 'b'], 'd': ['b', 'a']}), 's', 'd').get_topological_levels(allow_cycles=True) assert g._nodes.to_dict(orient='records') == [{'id': 'a', 'level': 0}, {'id': 'b', 'level': 1}] + + def test_drop_nodes(self): + cg = CGFull() + g = cg.edges(pd.DataFrame({'x': ['m', 'm', 'n', 'm'], 'y': ['a', 'b', 'c', 'd']}), 'x', 'y') + g2 = g.drop_nodes(['m']) + assert g2._edges.to_dict(orient='records') == [{'x': 'n', 'y': 'c'}]
add tests for drop_nodes (#<I>)
graphistry_pygraphistry
train
py
e88fbdf48ab0f6bee60cb848ec87c620c3786a1a
diff --git a/templates/html/views/methodDetails.php b/templates/html/views/methodDetails.php index <HASH>..<HASH> 100644 --- a/templates/html/views/methodDetails.php +++ b/templates/html/views/methodDetails.php @@ -23,6 +23,7 @@ ArrayHelper::multisort($methods, 'name'); <div class="detailHeader h3" id="<?= $method->name . '()-detail' ?>"> <?= $method->name ?>() <span class="detailHeaderTag small"> + <?= $method->visibility ?> method <?php if (!empty($method->since)): ?> (available since version <?php echo $method->since; ?>)
added method visibility to api docs issue #<I>
yiisoft_yii2-apidoc
train
php
fd0cfe0dfb9c31e77c32209c5d0a1d91cd386a65
diff --git a/src/ContextMenu.js b/src/ContextMenu.js index <HASH>..<HASH> 100644 --- a/src/ContextMenu.js +++ b/src/ContextMenu.js @@ -96,12 +96,11 @@ export default class ContextMenu extends Component { } getMenuPosition = (x, y) => { - const {scrollTop: scrollX, scrollLeft: scrollY} = document.documentElement; const { innerWidth, innerHeight } = window; const rect = this.menu.getBoundingClientRect(); const menuStyles = { - top: y + scrollY, - left: x + scrollX + top: y, + left: x }; if (y + rect.height > innerHeight) {
Fix bug for menu not showing when page is scrolled
vkbansal_react-contextmenu
train
js
6ffd79ff6bf5f345e965d28e4d0064cb44937c11
diff --git a/vdom/patch-op.js b/vdom/patch-op.js index <HASH>..<HASH> 100644 --- a/vdom/patch-op.js +++ b/vdom/patch-op.js @@ -137,7 +137,7 @@ function reorderChildren(domNode, bIndex) { move = bIndex[i] if (move !== undefined && move !== i) { // the element currently at this index will be moved later so increase the insert offset - if (reverseIndex[i] > i) { + if (reverseIndex[i] > i + 1) { insertOffset++ } @@ -148,7 +148,7 @@ function reorderChildren(domNode, bIndex) { } // the moved element came from the front of the array so reduce the insert offset - if (move < i) { + if (move < i - 1) { insertOffset-- } }
optimize the case where a new element is added to front of list
Matt-Esch_virtual-dom
train
js
6f70f2443e065b5eb7cd78b7760fe566c4c64cfa
diff --git a/bse/refconverters/bib.py b/bse/refconverters/bib.py index <HASH>..<HASH> 100644 --- a/bse/refconverters/bib.py +++ b/bse/refconverters/bib.py @@ -13,6 +13,9 @@ def _ref_bib(key,ref): entry_lines = [] for k,v in ref.items(): + if k == 'type': + continue + # Handle authors/editors if k == 'authors': entry_lines.append(u' author = {{{}}}'.format(' and '.join(v)))
Don't use type key in bibtex output
MolSSI-BSE_basis_set_exchange
train
py
320d187f2a434bcde306e4ce982dd53fba2dc090
diff --git a/core-bundle/contao/library/Contao/Model.php b/core-bundle/contao/library/Contao/Model.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/library/Contao/Model.php +++ b/core-bundle/contao/library/Contao/Model.php @@ -183,7 +183,6 @@ abstract class Model } $this->arrData[$strKey] = $varValue; - unset($this->arrRelated[$key]); } @@ -280,7 +279,6 @@ abstract class Model public function mergeRow(array $arrData) { $this->setRow(array_diff_key($arrData, $this->arrModified)); - return $this; }
[Core] Fix some minor code formatting issues
contao_contao
train
php
85fed7cdcbd07c59c9cf5e2b50db350b0b0176dd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ setup_params = dict( extras_require={ ':sys_platform=="win32"': 'jaraco.windows>=3.4', ':sys_platform=="darwin"': richxerox, - ':sys_platform=="linux2" or sys.platform=="linux"': pyperclip, + ':sys_platform=="linux2" or sys.platform=="linux"': "pyperclip", }, setup_requires=[ 'setuptools_scm>=1.9',
Literally pyperclip.
jaraco_jaraco.clipboard
train
py
0624981e73b270391eed5a1d538fd5c5a079f3b0
diff --git a/post-processing.rb b/post-processing.rb index <HASH>..<HASH> 100755 --- a/post-processing.rb +++ b/post-processing.rb @@ -9,7 +9,7 @@ buffer = ARGF.inject(String.new) do |buffer, line| # line filters line.gsub!(/\s*\n$/, "\n") line.gsub!("'", '"') - line.gsub!('u"', '"') + line.gsub!('u"', '"') if line =~ /^\s*# \[/ buffer += line end
Made the u"..." removal a bit safer
ruby-amqp_amq-protocol
train
rb
9cbacf4144c915f01eed79b55aa8968ae98791fa
diff --git a/matplotlib2tikz.py b/matplotlib2tikz.py index <HASH>..<HASH> 100644 --- a/matplotlib2tikz.py +++ b/matplotlib2tikz.py @@ -666,7 +666,7 @@ def _transform_to_data_coordinates(obj, xdata, ydata): ''' try: import matplotlib.transforms - points = zip(xdata, ydata) + points = np.array(zip(xdata, ydata)) transform = matplotlib.transforms.composite_transform_factory( obj.get_transform(), obj.get_axes().transData.inverted()
Fix transformation error In "_transform_to_data_coordinates" the points are passed to "Transform.transform" which expects a numpy array. Fix this by converting points to numpy array.
nschloe_matplotlib2tikz
train
py
b2cc97018edda1039039a41973c949c42694bbbc
diff --git a/src/map.js b/src/map.js index <HASH>..<HASH> 100644 --- a/src/map.js +++ b/src/map.js @@ -446,12 +446,12 @@ map.cellAtTile = function(x, y) { // Get the cell at the given pixel coordinates, or return a dummy cell. map.cellAtPixel = function(x, y) { - return map.cellAtTile(Math.round(this.x / TILE_SIZE_PIXEL), Math.round(this.y / TILE_SIZE_PIXEL)); + return map.cellAtTile(Math.round(x / TILE_SIZE_PIXEL), Math.round(y / TILE_SIZE_PIXEL)); }; // Get the cell at the given world coordinates, or return a dummy cell. map.cellAtWorld = function(x, y) { - return map.cellAtTile(Math.round(this.x / TILE_SIZE_WORLD), Math.round(this.y / TILE_SIZE_WORLD)); + return map.cellAtTile(Math.round(x / TILE_SIZE_WORLD), Math.round(y / TILE_SIZE_WORLD)); }; // Iterate over the map cells, either the complete map or a specific area.
Fix silly copy&paste mistake.
stephank_orona
train
js
7de2d129c2292b77abe090d84a646fea106fc251
diff --git a/visidata/sheets.py b/visidata/sheets.py index <HASH>..<HASH> 100644 --- a/visidata/sheets.py +++ b/visidata/sheets.py @@ -1077,7 +1077,9 @@ def preloadHook(sheet): @VisiData.api def newSheet(vd, name, ncols, **kwargs): - return Sheet(name, columns=[SettableColumn() for i in range(ncols)], **kwargs) + vs = Sheet(name, columns=[SettableColumn() for i in range(ncols)], **kwargs) + vs.options.quitguard = True + return vs @Sheet.api
[quitguard] guard new sheets by default #<I>
saulpw_visidata
train
py
ffe5f0755e656296aafe8521b5bc08937709cd7e
diff --git a/lib/lol/request.rb b/lib/lol/request.rb index <HASH>..<HASH> 100644 --- a/lib/lol/request.rb +++ b/lib/lol/request.rb @@ -115,7 +115,7 @@ module Lol # @param body [Hash] Body for POST request # @param options [Hash] Options passed to HTTParty # @return [String] raw response of the call - def perform_request url, verb = :get, body = nil, options = {} + def perform_request (url, verb = :get, body = nil, options = {}) options_id = options.inspect can_cache = [:post, :put].include?(verb) ? false : cached? if can_cache && result = store.get("#{clean_url(url)}#{options_id}") @@ -126,14 +126,14 @@ module Lol response end - def perform_rate_limited_request url, verb = :get, body = nil, options = {} + def perform_rate_limited_request (url, verb = :get, body = nil, options = {}) return perform_uncached_request(url, verb, body, options) unless rate_limiter @rate_limiter.times 1 do perform_uncached_request(url, verb, body, options) end end - def perform_uncached_request url, verb = :get, body = nil, options = {} + def perform_uncached_request (url, verb = :get, body = nil, options = {}) options[:headers] ||= {} options[:headers].merge!({ "Content-Type" => "application/json",
Rubymine linter suggestions for parens according to Ruby Style Guide
mikamai_ruby-lol
train
rb
34fca36ea4628a708dbf625e957899abf0a0cf95
diff --git a/lib/hocon/impl/config_number.rb b/lib/hocon/impl/config_number.rb index <HASH>..<HASH> 100644 --- a/lib/hocon/impl/config_number.rb +++ b/lib/hocon/impl/config_number.rb @@ -30,16 +30,9 @@ class Hocon::Impl::ConfigNumber end def int_value_range_checked(path) - l = long_value - - # guess we don't need to bother with this ... - # - # if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) - # { - # throw new ConfigException.WrongType(origin(), path, "32-bit integer", - # "out-of-range value " + l); - # } - l + # We don't need to do any range checking here due to the way Ruby handles + # integers (doesn't have the 32-bit/64-bit distinction that Java does). + long_value end def long_value
(maint) add comment about Ruby vs. Java integers
puppetlabs_ruby-hocon
train
rb
3d74ff97af50e47bd93a50c010b8f296bcda76b8
diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -1123,7 +1123,7 @@ func (s *apiService) getSupportBundle(w http.ResponseWriter, r *http.Request) { } // Set zip file name and path - zipFileName := fmt.Sprintf("support-bundle-%s.zip", time.Now().Format("2018-01-02T15.04.05")) + zipFileName := fmt.Sprintf("support-bundle-%s.zip", time.Now().Format("2006-01-02T150405")) zipFilePath := filepath.Join(baseDirs["config"], zipFileName) // Write buffer zip to local zip file (back up)
cmd/syncthing: Fix support bundle zip name pattern
syncthing_syncthing
train
go
8283f46d0bd286e3c84245a94f360e683c153fd8
diff --git a/packages/@vue/cli/lib/util/configTransforms.js b/packages/@vue/cli/lib/util/configTransforms.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli/lib/util/configTransforms.js +++ b/packages/@vue/cli/lib/util/configTransforms.js @@ -13,7 +13,7 @@ const isObject = val => val && typeof val === 'object' const transformJS = { read: ({ filename, context }) => { try { - return loadModule(filename, context, true) + return loadModule(`./${filename}`, context, true) } catch (e) { return null }
fix: fix config merging during `vue invoke` in Node.js <I> (#<I>) The root cause here is the same as #<I> The failing `loadModule` call will return `undefined` for a js config read operation, which later caused config being overwritten.
vuejs_vue-cli
train
js
7324c0a28da457f0a76fc07cef3a7b8fb7704aac
diff --git a/regression/clear_datastore.py b/regression/clear_datastore.py index <HASH>..<HASH> 100644 --- a/regression/clear_datastore.py +++ b/regression/clear_datastore.py @@ -21,7 +21,6 @@ from gcloud.datastore import _implicit_environ _implicit_environ._DATASET_ENV_VAR_NAME = 'GCLOUD_TESTS_DATASET_ID' -datastore.set_defaults() FETCH_MAX = 20 diff --git a/regression/datastore.py b/regression/datastore.py index <HASH>..<HASH> 100644 --- a/regression/datastore.py +++ b/regression/datastore.py @@ -24,7 +24,6 @@ from regression import populate_datastore _implicit_environ._DATASET_ENV_VAR_NAME = 'GCLOUD_TESTS_DATASET_ID' -datastore.set_defaults() class TestDatastore(unittest2.TestCase): diff --git a/regression/populate_datastore.py b/regression/populate_datastore.py index <HASH>..<HASH> 100644 --- a/regression/populate_datastore.py +++ b/regression/populate_datastore.py @@ -21,7 +21,6 @@ from gcloud.datastore import _implicit_environ _implicit_environ._DATASET_ENV_VAR_NAME = 'GCLOUD_TESTS_DATASET_ID' -datastore.set_defaults() ANCESTOR = ('Book', 'GoT')
Using fully implicit auth in datastore regression.
googleapis_google-cloud-python
train
py,py,py
373f668562fedede73ec46c017d4bbc2b5e059fb
diff --git a/src/message.js b/src/message.js index <HASH>..<HASH> 100644 --- a/src/message.js +++ b/src/message.js @@ -1,8 +1,9 @@ /// Implements Bitcoin's feature for signing arbitrary messages. -var SHA256 = require('crypto-js/sha256') -var ecdsa = require('./ecdsa') +var Address = require('./address') var convert = require('./convert') +var ecdsa = require('./ecdsa') +var SHA256 = require('crypto-js/sha256') var Message = {} @@ -59,7 +60,8 @@ Message.verifyMessage = function (address, sig, message) { pubKey.compressed = isCompressed // Compare address to expected address - return address === pubKey.getAddress().toString() + address = new Address(address) + return address.toString() === pubKey.getAddress(address.version).toString() } module.exports = Message
Adds version support to Message.verifyMessage
BitGo_bitgo-utxo-lib
train
js
575ff70a1be7cc33a678048e813ccb0e6a84571b
diff --git a/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java b/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java index <HASH>..<HASH> 100644 --- a/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java +++ b/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java @@ -49,7 +49,7 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom private void createAndAddScreenStack(int position) { ScreenStack newStack = new ScreenStack(activity, params.tabParams.get(position)); screenStacks[position] = newStack; - newStack.setVisibility(GONE); + newStack.setVisibility(INVISIBLE); addView(newStack, 0, new LayoutParams(MATCH_PARENT, MATCH_PARENT)); } @@ -170,7 +170,7 @@ public class BottomTabsLayout extends RelativeLayout implements Layout, AHBottom private void hideCurrentStack() { ScreenStack currentScreenStack = getCurrentScreenStack(); - currentScreenStack.setVisibility(GONE); + currentScreenStack.setVisibility(INVISIBLE); } private ScreenStack getCurrentScreenStack() {
Use INVISIBLE to hide screens so they get measured on creation
wix_react-native-navigation
train
java
82643d7f7e6dae15e78d5bb5864f9530ab3fdcc8
diff --git a/src/js/tree.js b/src/js/tree.js index <HASH>..<HASH> 100644 --- a/src/js/tree.js +++ b/src/js/tree.js @@ -270,13 +270,13 @@ expand = expand === undefined ? $li.hasClass('open') : false; if(expand) this.store[id] = expand; else delete this.store[id]; - this.store.time = new Date(); + this.store.time = new Date().getTime(); $.zui.store[this.options.name ? 'set' : 'pageSet'](this.selector, this.store); } else { var that = this; this.store = {}; this.$.find('li').each(function() { - that.store($(this)); + that.preserve($(this)); }); } };
* fix error in preserve method of tree.
easysoft_zui
train
js
58d1716ccc5cd4b16a9b5f2a6070157e2b411c82
diff --git a/src/Bkwld/Decoy/Models/Worker.php b/src/Bkwld/Decoy/Models/Worker.php index <HASH>..<HASH> 100644 --- a/src/Bkwld/Decoy/Models/Worker.php +++ b/src/Bkwld/Decoy/Models/Worker.php @@ -160,10 +160,15 @@ class Worker extends \Illuminate\Console\Command { } /** - * Write Command input types to the log + * Write Command output types to the log */ public function log($level, $message, $context = array()) { - if (empty($this->logger)) throw new Exception('Worker logger not created'); + + // This will be empty when output messages are triggered by the command + // when it's NOT called by a worker option + if (empty($this->logger)) return; + + // Call the logger's level specific methods $method = 'add'.ucfirst($level); $this->logger->$method($message, $context); }
Fixing error when worker not called via worker options
BKWLD_decoy
train
php
bd15b915d113da4b3d35fddc3dc1a62dee91aa5b
diff --git a/example/config/routes.rb b/example/config/routes.rb index <HASH>..<HASH> 100644 --- a/example/config/routes.rb +++ b/example/config/routes.rb @@ -1,4 +1,5 @@ Rails.application.routes.draw do + resources :attached_files resources :issue_comments devise_for :users resources :projects
be rails g resource_route attached_files
akm_model_base_generators
train
rb
4bd48ac066d7ef49b7126e9487aa4f2479616247
diff --git a/test/tests.js b/test/tests.js index <HASH>..<HASH> 100644 --- a/test/tests.js +++ b/test/tests.js @@ -4,7 +4,7 @@ var r = function(suite) { } var fetch = [ - "level1/core", + "level1/core", "level1/html", "level1/svg", "level2/core", @@ -12,10 +12,13 @@ var fetch = [ "level2/style", "level2/extra", "level3/core", - "level3/ls", + //"level3/ls", "level3/xpath", - /*"window",*/ - "jsdom" + /* + TODO: this needs work, will break everything if included. + "window",*/ + "jsdom", + "sizzle" ]; module.exports = {}; @@ -25,3 +28,4 @@ module.exports = {}; fetch.forEach(function(k) { module.exports[k] = r(k); }); +
remove level3 from the runner as it seems to be breaking stuff
jsdom_jsdom
train
js
c2e3bf5bcebb5356b5e260d558d2468d4f840c6f
diff --git a/GPy/util/caching.py b/GPy/util/caching.py index <HASH>..<HASH> 100644 --- a/GPy/util/caching.py +++ b/GPy/util/caching.py @@ -57,13 +57,15 @@ class Cacher(object): for ind in combined_args_kw: if ind is not None: ind_id = self.id(ind) - ref, cache_ids = self.cached_input_ids[ind_id] - if len(cache_ids) == 1 and ref() is not None: - ref().remove_observer(self, self.on_cache_changed) - del self.cached_input_ids[ind_id] - else: - cache_ids.remove(cache_id) - self.cached_input_ids[ind_id] = [ref, cache_ids] + tmp = self.cached_input_ids.get(ind_id, None) + if tmp is not None: + ref, cache_ids = tmp + if len(cache_ids) == 1 and ref() is not None: + ref().remove_observer(self, self.on_cache_changed) + del self.cached_input_ids[ind_id] + else: + cache_ids.remove(cache_id) + self.cached_input_ids[ind_id] = [ref, cache_ids] self.logger.debug("removing caches") del self.cached_outputs[cache_id] del self.inputs_changed[cache_id]
[caching] catching key error, when individuum is already gone
SheffieldML_GPy
train
py
a3b988d56753bdce7727461d485659e659b83b59
diff --git a/shutdownmanagers/awsmanager/aws.go b/shutdownmanagers/awsmanager/aws.go index <HASH>..<HASH> 100644 --- a/shutdownmanagers/awsmanager/aws.go +++ b/shutdownmanagers/awsmanager/aws.go @@ -193,21 +193,23 @@ func (awsManager *AwsManager) handleMessage(message string) bool { go awsManager.gs.StartShutdown(awsManager) return true } else if awsManager.config.Port != 0 { - awsManager.forwardMessage(hookMessage, message) + if err := awsManager.forwardMessage(hookMessage, message); err != nil { + awsManager.gs.ReportError(err) + return false + } return true } return false } -func (awsManager *AwsManager) forwardMessage(hookMessage *lifecycleHookMessage, message string) { +func (awsManager *AwsManager) forwardMessage(hookMessage *lifecycleHookMessage, message string) error { host, err := awsManager.api.GetHost(hookMessage.EC2InstanceId) if err != nil { - awsManager.gs.ReportError(err) - return + return err } _, err = http.Post(fmt.Sprintf("http://%s:%d/", host, awsManager.config.Port), "application/json", strings.NewReader(message)) - awsManager.gs.ReportError(err) + return err } // ShutdownStart calls Ping every pingTime
Do not delete sqs message from queue if http fails.
Zemanta_gracefulshutdown
train
go
746352d317ed78e6a53d6c62d126f706467a1ec3
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java @@ -157,7 +157,7 @@ public abstract class OCommandExecutorSQLResultsetAbstract extends OCommandExecu protected Object getResult() { if (tempResult != null) { - for (OIdentifiable d : tempResult) + for (Object d : tempResult) if (d != null) request.getResultListener().result(d); }
SQL: flatten() now creates projection even on non-records
orientechnologies_orientdb
train
java
0c391b5f376231dfa24271fe1065afbf7c540095
diff --git a/drivers/ruby/test.rb b/drivers/ruby/test.rb index <HASH>..<HASH> 100644 --- a/drivers/ruby/test.rb +++ b/drivers/ruby/test.rb @@ -544,6 +544,14 @@ class ClientTest < Test::Unit::TestCase id_sort(rdb.filter{r[:id] < 5}.run.to_a)) end + def test_pluck + e=r.expr([{ 'a' => 1, 'b' => 2, 'c' => 3}, + { 'a' => 4, 'b' => 5, 'c' => 6}]) + assert_equal(e.pluck().run(), [{}, {}]) + assert_equal(e.pluck('a').run(), [{ 'a' => 1 }, { 'a' => 4 }]) + assert_equal(e.pluck('a', 'b').run(), [{ 'a' => 1, 'b' => 2 }, { 'a' => 4, 'b' => 5 }]) + end + def test_pickattrs # PICKATTRS, # UNION, # LENGTH q1=r.union(rdb.map{r[:$_].pickattrs(:id,:name)}, rdb.map{|row| row.attrs(:id,:num)}) q2=r.union(rdb.map{r[:$_].attrs(:id,:name)}, rdb.map{|row| row.pick(:id,:num)})
Adding ruby test for pluck
rethinkdb_rethinkdb
train
rb
673c25372b6999c739f032e3378a98271144e07c
diff --git a/src/Symfony/Component/Console/Helper/DialogHelper.php b/src/Symfony/Component/Console/Helper/DialogHelper.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Console/Helper/DialogHelper.php +++ b/src/Symfony/Component/Console/Helper/DialogHelper.php @@ -20,7 +20,7 @@ use Symfony\Component\Console\Formatter\OutputFormatterStyle; * @author Fabien Potencier <fabien@symfony.com> * * @deprecated Deprecated since version 2.5, to be removed in 3.0. - * Use the question helper instead. + * Use {@link \Symfony\Component\Console\Helper\QuestionHelper} instead. */ class DialogHelper extends InputAwareHelper { @@ -28,6 +28,12 @@ class DialogHelper extends InputAwareHelper private static $shell; private static $stty; + public function __construct() + { + trigger_error('DialogHelper is deprecated since version 2.5 and will be removed in 3.0. Use QuestionHelper instead.', E_USER_DEPRECATED); + + parent::__construct(); + } /** * Asks the user to select a value. *
[Console] Adding a deprecation note about DialogHelper
symfony_symfony
train
php
cc8bb8243c933eb1497e0570e35d5773d44ad701
diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java index <HASH>..<HASH> 100755 --- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java +++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java @@ -234,7 +234,9 @@ class ActivityUtils { getCurrentActivity().finish(); inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK); activityList.clear(); - + if (activityMonitor != null) { + inst.removeMonitor(activityMonitor); + } } catch (Exception ignored) {} super.finalize(); }
Remove added ActivityMonitor during ActivityUtils finalisation. Otherwise, each Solo instance leaks an ActivityMonitor into Instrumentation, with knock-on effects for other tests using ActivityMonitors.
RobotiumTech_robotium
train
java
711a8e3ea4ac9ac10c0b96e7256001f371a8004d
diff --git a/annis-gui/src/main/java/annis/gui/visualizers/component/rst/RSTImpl.java b/annis-gui/src/main/java/annis/gui/visualizers/component/rst/RSTImpl.java index <HASH>..<HASH> 100644 --- a/annis-gui/src/main/java/annis/gui/visualizers/component/rst/RSTImpl.java +++ b/annis-gui/src/main/java/annis/gui/visualizers/component/rst/RSTImpl.java @@ -392,16 +392,7 @@ public class RSTImpl extends Panel implements SGraphTraverseHandler // since we have found some tokens, it must be a sentence in RST. if (token.size() > 0) { - data.put("sentence", sb.toString()); - - String color = null; - if (markedAndCovered != null - && markedAndCovered.containsKey(token.get(0)) - && (color = getHTMLColor(token.get(0))) != null) - { - data.put("color", color); - } }
Do not put the color information into a json property.
korpling_ANNIS
train
java
4ffb27fbcafbd3997ca4b3a37b33fe7d6f7d9ba0
diff --git a/java/server/src/org/openqa/selenium/grid/node/local/LocalNode.java b/java/server/src/org/openqa/selenium/grid/node/local/LocalNode.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/selenium/grid/node/local/LocalNode.java +++ b/java/server/src/org/openqa/selenium/grid/node/local/LocalNode.java @@ -461,7 +461,7 @@ public class LocalNode extends Node { private URI rewrite(String path) { try { return new URI( - gridUri.getScheme(), + "ws", gridUri.getUserInfo(), gridUri.getHost(), gridUri.getPort(),
[java] Return a ws scheme instead of the http scheme of the grid
SeleniumHQ_selenium
train
java
5c89bebdd7df1f81c943c7936887de9a1dc0d6d4
diff --git a/globalify.js b/globalify.js index <HASH>..<HASH> 100644 --- a/globalify.js +++ b/globalify.js @@ -10,8 +10,6 @@ var browserify = require('browserify'), }, rootPath = __dirname; -console.log(rootPath); - module.exports = function globalify(settings, callback){ settings = settings || {}; diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ #!/usr/bin/env node -"use strict"; -const program = require('commander'), +var program = require('commander'), globalify = require('./globalify'), packageJson = require('./package.json'), fs = require('fs'); @@ -17,11 +16,11 @@ if (program.args.length !== 1) { program.help() } -const moduleNameAndVersion = program.args[0].split('@'), +var moduleNameAndVersion = program.args[0].split('@'), moduleName = moduleNameAndVersion[0], version = moduleNameAndVersion[1] || 'x.x.x'; -const outStream = fs.createWriteStream(program.out || `${moduleName}.js`); +var outStream = fs.createWriteStream(program.out || moduleName + '.js'); globalify({ module: moduleName,
Remove the other console.log in globalify.js and es6 code.
KoryNunn_globalify
train
js,js
148d27b029889658bfb421c2c1322fa6cd68f139
diff --git a/tasks/html.js b/tasks/html.js index <HASH>..<HASH> 100644 --- a/tasks/html.js +++ b/tasks/html.js @@ -107,7 +107,7 @@ function loadData () { var dataFile = fs.readFileSync(datapath, 'utf8') if (ext === '.js') { - data[name] = requireFromString(dataFile, datapath).data + data[name] = requireFromString(dataFile, datapath).data() } else if (ext === '.yml' || ext === '.yaml') { data[name] = yaml.safeLoad(dataFile).data } diff --git a/web/data/templates.js b/web/data/templates.js index <HASH>..<HASH> 100644 --- a/web/data/templates.js +++ b/web/data/templates.js @@ -1 +1,3 @@ -exports.data = ['at', 'bt'] +exports.data = function () { + return ['at', 'bt'] +}
Module data loaded as function to allow pre-processing
kunruch_mmpilot
train
js,js
56292774b7e8e8a187f96eb08b6d1528ca5f5c39
diff --git a/openhtf/plugs/__init__.py b/openhtf/plugs/__init__.py index <HASH>..<HASH> 100644 --- a/openhtf/plugs/__init__.py +++ b/openhtf/plugs/__init__.py @@ -516,6 +516,7 @@ class PlugManager(object): if self._xmlrpc_server: _LOG.debug('Shutting down Plug XMLRPC Server.') self._xmlrpc_server.shutdown() + self._xmlrpc_server.server_close() self._xmlrpc_server = None _LOG.debug('Tearing down all plugs.')
Also close the underlying socket for the plug manager's xmlrpc server
google_openhtf
train
py
7ac2fe152ae01af98484d88e8c98c612bcb50573
diff --git a/src/services/search-builder.js b/src/services/search-builder.js index <HASH>..<HASH> 100644 --- a/src/services/search-builder.js +++ b/src/services/search-builder.js @@ -152,7 +152,9 @@ function SearchBuilder(model, opts, params, fieldNamesRequested) { if (!Number.isNaN(value)) { if (Number.isInteger(value) && !Number.isSafeInteger(value)) { - value = BigInt(params.search); + // NOTE: Numbers higher than MAX_SAFE_INTEGER need to be handled as + // strings to circumvent precision problems + value = params.search; } condition[field.field] = value;
fix(search): handle tables that contain floats and bigints
ForestAdmin_forest-express-sequelize
train
js
8c1ca54c3e5de0b259ff34bf1b8f6c6b318c99a4
diff --git a/testing/provisioner.go b/testing/provisioner.go index <HASH>..<HASH> 100644 --- a/testing/provisioner.go +++ b/testing/provisioner.go @@ -92,6 +92,10 @@ func (a *FakeApp) ProvisionUnits() []provision.AppUnit { return a.units } +func (a *FakeApp) AddUnit(u *FakeUnit) { + a.units = append(a.units, u) +} + func (a *FakeApp) SetUnitStatus(s provision.Status, index int) { if index < len(a.units) { a.units[index].(*FakeUnit).Status = s diff --git a/testing/provisioner_test.go b/testing/provisioner_test.go index <HASH>..<HASH> 100644 --- a/testing/provisioner_test.go +++ b/testing/provisioner_test.go @@ -20,6 +20,12 @@ type S struct{} var _ = gocheck.Suite(&S{}) +func (s *S) TestFakeAppAddUnit(c *gocheck.C) { + app := NewFakeApp("jean", "mj", 0) + app.AddUnit(&FakeUnit{Name: "jean/0"}) + c.Assert(app.units, gocheck.HasLen, 1) +} + func (s *S) TestFindApp(c *gocheck.C) { app := NewFakeApp("red-sector", "rush", 1) p := NewFakeProvisioner()
testing/provisioner: added method to add units to a fake app
tsuru_tsuru
train
go,go
d095fc910e9225f2d77ecb41f3e36baabdce8c6b
diff --git a/lib/render/renderer.js b/lib/render/renderer.js index <HASH>..<HASH> 100644 --- a/lib/render/renderer.js +++ b/lib/render/renderer.js @@ -42,6 +42,7 @@ Renderer.prototype.hr = function() { }; Renderer.prototype.after = function(text, token, parser) { + if(!text) return text; // crude way of removing escapes return unescape(text); }
Guard against undefined text in after().
tmpfs_markzero
train
js
631469a4872f4a3dc8919ceffb2c33187f32098c
diff --git a/selenium_test/environment.py b/selenium_test/environment.py index <HASH>..<HASH> 100644 --- a/selenium_test/environment.py +++ b/selenium_test/environment.py @@ -320,6 +320,15 @@ def before_scenario(context, scenario): def after_scenario(context, _scenario): driver = context.driver + # Close all extra tabs. + handles = driver.window_handles + if handles: + for handle in handles: + if handle != context.initial_window_handle: + driver.switch_to_window(handle) + driver.close() + driver.switch_to_window(context.initial_window_handle) + # # Make sure we did not trip a fatal error. # @@ -379,15 +388,6 @@ def after_scenario(context, _scenario): dump_javascript_log(context) assert_false(terminating, "should not have experienced a fatal error") - # Close all extra tabs. - handles = driver.window_handles - if handles: - for handle in handles: - if handle != context.initial_window_handle: - driver.switch_to_window(handle) - driver.close() - driver.switch_to_window(context.initial_window_handle) - def before_step(context, step): if context.behave_captions:
Close tabs first. It is unclear why this has never bit us before but now we close the tabs first. Doing this ensures that the async code is run on the main page, which is what we want. Otherwise, the async code may run on some documentat tab, and fail.
mangalam-research_wed
train
py
625dd3741f359e4db62a0a95de03800c36303b72
diff --git a/lib/cxxproject/ext/rake.rb b/lib/cxxproject/ext/rake.rb index <HASH>..<HASH> 100644 --- a/lib/cxxproject/ext/rake.rb +++ b/lib/cxxproject/ext/rake.rb @@ -1,5 +1,7 @@ require 'cxxproject/ext/stdout' require 'cxxproject/utils/exit_helper' +require 'cxxproject/errorparser/error_parser' + require 'rake' require 'stringio' @@ -82,6 +84,26 @@ module Rake super(args, invocation_chain) Dir.chdir(@bb.project_dir) do + if Dir.pwd != @bb.project_dir and File.dirname(Dir.pwd) != File.dirname(@bb.project_dir) + isSym = false + begin + isSym = File.symlink?(@bb.project_dir) + rescue + end + if isSym + message = "Symlinks only allowed with the same parent dir as the target: #{@bb.project_dir} --> #{Dir.pwd}" + res = Cxxproject::ErrorDesc.new + res.file_name = @bb.project_dir + res.line_number = 0 + res.severity = Cxxproject::ErrorParser::SEVERITY_ERROR + res.message = message + Rake.application.idei.set_errors([res]) + Cxxproject::Printer.printError message + set_failed + return + end + end + file_tasks = @bb.create_object_file_tasks enhance(file_tasks) return if file_tasks.length == 0
added error if symlink has other parent dir than target
marcmo_cxxproject
train
rb
bb79c9d6f03438a3bce1394df61b7d8f16da52df
diff --git a/object.lookup.go b/object.lookup.go index <HASH>..<HASH> 100644 --- a/object.lookup.go +++ b/object.lookup.go @@ -5,6 +5,14 @@ import ( "time" ) +func (c *ObjectStorage) Exists(objectname string) bool { + id := "internal" + if o, _ := c.lookup(&id, &objectname, true); o != nil { + return true + } + return false +} + func (c *ObjectStorage) Lookup(client_identifier, objectname string) (*Object, error) { return c.lookup(&client_identifier, &objectname, false) }
Add the Exists method to object lookups This does a quieter lookup and will, in the future, exclude the inline_payload fetching of the lookup process.
dmichellis_gocassos
train
go
9afd44282b7ee411ba340375c1872664a587a966
diff --git a/src/extensions/default/JavaScriptCodeHints/unittests.js b/src/extensions/default/JavaScriptCodeHints/unittests.js index <HASH>..<HASH> 100644 --- a/src/extensions/default/JavaScriptCodeHints/unittests.js +++ b/src/extensions/default/JavaScriptCodeHints/unittests.js @@ -832,7 +832,7 @@ define(function (require, exports, module) { testEditor.setCursorPos(start); var hintObj = expectHints(JSCodeHints.jsHintProvider); runs(function () { - hintsPresentExact(hintObj, ["getAmountDue", "getName", "name", "setAmountDue"]); + hintsPresentExact(hintObj, ["amountDue", "getAmountDue", "getName", "name", "setAmountDue"]); }); });
Update expected results, as Tern now gives us better results than what the test was expecting.
adobe_brackets
train
js
82d1e1eb1e27b3b63b99fe8b500ff76edbf1ca59
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -84,7 +84,7 @@ if __name__ == '__main__': zip_safe=False, extras_require={ 'docs': [ - 'sphinx>=1.7.1', + 'sphinx==1.6.9', ], 'tests': [ 'flake8>=3.5.0',
attempted fix for readthedocs/sphinx bug
WoLpH_python-progressbar
train
py
e98e804fb894935dd1c6a2ae41ffa688595312a5
diff --git a/lib/Yucca/Component/Iterator/ShowMoreIterator.php b/lib/Yucca/Component/Iterator/ShowMoreIterator.php index <HASH>..<HASH> 100644 --- a/lib/Yucca/Component/Iterator/ShowMoreIterator.php +++ b/lib/Yucca/Component/Iterator/ShowMoreIterator.php @@ -10,7 +10,7 @@ namespace Yucca\Component\Iterator; -class ShowMoreIterator extends \LimitIterator { +class ShowMoreIterator extends \LimitIterator implements \Countable { protected $offset; protected $limit; @@ -55,4 +55,13 @@ class ShowMoreIterator extends \LimitIterator { public function canShowMore() { return $this->getInnerIterator()->count() > ($this->offset + $this->limit); } -} + + /** + * give model count + * @return int + */ + public function count() + { + return $this->getInnerIterator()->count(); + } +}
[SHOW MORE ITERATOR] Is now countable
yucca-php_yucca
train
php
391c0f78a496dbe0334686dfcabde8c9af8a474f
diff --git a/workflow/util/util.go b/workflow/util/util.go index <HASH>..<HASH> 100644 --- a/workflow/util/util.go +++ b/workflow/util/util.go @@ -410,6 +410,11 @@ func selectorMatchesNode(selector fields.Selector, node wfv1.NodeStatus) bool { nodeFields := fields.Set{ "displayName": node.DisplayName, "templateName": node.TemplateName, + "phase": string(node.Phase), + } + if node.TemplateRef != nil { + nodeFields["templateRef.name"] = node.TemplateRef.Name + nodeFields["templateRef.template"] = node.TemplateRef.Template } if node.Inputs != nil { for _, inParam := range node.Inputs.Parameters {
Make phase and templateRef available for unsuspend and retry selectors (#<I>)
argoproj_argo
train
go