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
f04820e1549ed13419c9ce9f1fefe51b567022fd
diff --git a/core/graph.py b/core/graph.py index <HASH>..<HASH> 100644 --- a/core/graph.py +++ b/core/graph.py @@ -3,7 +3,7 @@ Modules contains graphing routines common for flow cytometry files. """ from fcm.graphics.util import bilinear_interpolate -from bases import to_list +from GoreUtilities.util import to_list import numpy import pylab as pl import matplotlib
moved to_list method to goreutilities
eyurtsev_FlowCytometryTools
train
py
c0aadff989219737edf909238f070bcb2cefb6eb
diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/LDAPGuacamoleProperties.java b/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/LDAPGuacamoleProperties.java index <HASH>..<HASH> 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/LDAPGuacamoleProperties.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/glyptodon/guacamole/auth/ldap/LDAPGuacamoleProperties.java @@ -64,8 +64,9 @@ public class LDAPGuacamoleProperties { }; /** - * The base DN of role based access control (RBAC) groups. All groups - * should be under this DN. + * The base DN of role based access control (RBAC) groups. All groups which + * will be used for RBAC must be contained somewhere within the subtree of + * this DN. */ public static final StringGuacamoleProperty LDAP_GROUP_BASE_DN = new StringGuacamoleProperty() {
GUAC-<I>: Clarify definition of "ldap-group-base-dn" property.
glyptodon_guacamole-client
train
java
00211300ccf6a51aae1dabf99f935b19bf23df9b
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -187,7 +187,7 @@ module.exports = function(grunt) { grunt.registerTask('build', ['replace', 'jshint', 'uglify:prewebpack', 'webpack', 'uglify:dist']); grunt.registerTask('release', ['build', 'copyrelease']); - var testjobs = ['webpack', 'express']; + var testjobs = ['uglify:prewebpack', 'webpack', 'express']; if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined'){ testjobs.push('saucelabs-mocha'); } else {
Minimize vendor files before webpack on grunt test.
rollbar_rollbar.js
train
js
5bc121e813db93daf513b051cfd4271760ab2052
diff --git a/subproviders/hooked-wallet.js b/subproviders/hooked-wallet.js index <HASH>..<HASH> 100644 --- a/subproviders/hooked-wallet.js +++ b/subproviders/hooked-wallet.js @@ -128,6 +128,8 @@ HookedWalletSubprovider.prototype.validateMessage = function(msgParams, cb){ HookedWalletSubprovider.prototype.validateSender = function(senderAddress, cb){ const self = this + // shortcut: undefined sender is valid + if (senderAddress === undefined) return cb(null, true) self.getAccounts(function(err, accounts){ if (err) return cb(err) var senderIsValid = (accounts.indexOf(senderAddress.toLowerCase()) !== -1)
hooked-wallet - undefined sender is invalid
MetaMask_web3-provider-engine
train
js
a02beb482c61ffa921ec261fc29bf9dc33a80101
diff --git a/tests/test_regions.py b/tests/test_regions.py index <HASH>..<HASH> 100644 --- a/tests/test_regions.py +++ b/tests/test_regions.py @@ -109,8 +109,11 @@ class testMutationRegions(unittest.TestCase): class testMultivariateGaussianEffects(unittest.TestCase): def testConstruction(self): - fwdpy11.MultivariateGaussianEffects( - 0, 1, 1, np.identity(2)) + try: + fwdpy11.MultivariateGaussianEffects( + 0, 1, 1, np.identity(2)) + except Exception: + self.fail("Unexpected exception during object construction") def testInvalidMatrixShape(self): # Input matrix has wrong shape:
check for exceptions during object construction test
molpopgen_fwdpy11
train
py
bd9c88cc26479804155f4716701c77b5bfc2e214
diff --git a/closure/goog/events/listenable.js b/closure/goog/events/listenable.js index <HASH>..<HASH> 100644 --- a/closure/goog/events/listenable.js +++ b/closure/goog/events/listenable.js @@ -295,7 +295,7 @@ goog.events.ListenableKey.reserveKey = function() { /** * The source event target. - * @type {!(Object|goog.events.Listenable|goog.events.EventTarget)} + * @type {Object|goog.events.Listenable|goog.events.EventTarget} */ goog.events.ListenableKey.prototype.src; @@ -323,7 +323,7 @@ goog.events.ListenableKey.prototype.capture; /** * The 'this' object for the listener function's scope. - * @type {Object} + * @type {Object|undefined} */ goog.events.ListenableKey.prototype.handler;
The subclass can't broaden the type of a property. Relax the types of two properties of goog.events.ListenableKey to match the types of goog.events.Listener. Bugs found by NTI. ------------- Created by MOE: <URL>
google_closure-library
train
js
8e87ef0fd959fdd9de6d7e09c3ed551b4e53178f
diff --git a/test.rb b/test.rb index <HASH>..<HASH> 100644 --- a/test.rb +++ b/test.rb @@ -37,16 +37,11 @@ require 'default_value_for' puts "\nTesting with Active Record version #{ActiveRecord::VERSION::STRING}\n\n" -if RUBY_PLATFORM == "java" - database_adapter = "jdbcsqlite3" -else - database_adapter = "sqlite3" -end ActiveRecord::Base.default_timezone = :local ActiveRecord::Base.logger = Logger.new(STDERR) ActiveRecord::Base.logger.level = Logger::WARN ActiveRecord::Base.establish_connection( - :adapter => database_adapter, + :adapter => RUBY_PLATFORM == 'java' ? 'jdbcsqlite3' : 'sqlite3', :database => ':memory:' ) ActiveRecord::Base.connection.create_table(:users, :force => true) do |t|
Use ternary operator for brevity
FooBarWidget_default_value_for
train
rb
da008162eb2af8c52d2010faa1d366af68bf4359
diff --git a/src/Common/GeneratorField.php b/src/Common/GeneratorField.php index <HASH>..<HASH> 100644 --- a/src/Common/GeneratorField.php +++ b/src/Common/GeneratorField.php @@ -105,9 +105,7 @@ class GeneratorField } else { $this->migrationText .= '->'.$functionName; $this->migrationText .= '('; - foreach ($inputParams as $param) { - $this->migrationText .= ', '.$param; - } + $this->migrationText .= implode(', ', $inputParams); $this->migrationText .= ')'; } }
#<I> minor fix for params in function
InfyOmLabs_laravel-generator
train
php
d69521755e5b247164734896a826a6044a2cabd8
diff --git a/spec/support/helpers/model_helper.rb b/spec/support/helpers/model_helper.rb index <HASH>..<HASH> 100644 --- a/spec/support/helpers/model_helper.rb +++ b/spec/support/helpers/model_helper.rb @@ -57,7 +57,11 @@ module ModelHelper when :mongo_mapper MongoMapper::DocumentNotValid when /mongoid/ - Mongoid::Errors::Validations + error_classes = [Mongoid::Errors::Validations] + error_classes << Moped::Errors::OperationFailure if defined?(::Moped) # Mongoid 4 + error_classes << Mongo::Error::OperationFailure if defined?(::Mongo) # Mongoid 5 + + proc { |error| expect(error.class).to be_in(error_classes) } else raise "'#{DOORKEEPER_ORM}' ORM is not supported!" end
Fix specs uniqueness check for Mongoid ORMs
doorkeeper-gem_doorkeeper
train
rb
e5bfcfebc513e9711f7f8185c4b19f27cf2f0fc5
diff --git a/supernova/supernova.py b/supernova/supernova.py index <HASH>..<HASH> 100644 --- a/supernova/supernova.py +++ b/supernova/supernova.py @@ -55,16 +55,11 @@ class SuperNova(object): msg = "[%s] Unable to locate section '%s' in your configuration." print(msg % (colors.rwrap("Failed"), self.nova_env)) sys.exit(1) - nova_re = re.compile(r"(^nova_|^os_|^novaclient|^trove_)") proxy_re = re.compile(r"(^http_proxy|^https_proxy)") creds = [] for param, value in raw_creds: - # Skip parameters we're unfamiliar with - if not nova_re.match(param) and not proxy_re.match(param): - continue - if not proxy_re.match(param): param = param.upper()
don't filter environment variables based on prefix. This allows us to use supernova from clients that are not explicitly supported
major_supernova
train
py
6331651f39f2f52bd9b849736a4dafd4d93c7816
diff --git a/compiler/lang.py b/compiler/lang.py index <HASH>..<HASH> 100644 --- a/compiler/lang.py +++ b/compiler/lang.py @@ -18,7 +18,7 @@ def value_is_trivial(value): if value[0] == '(' and value[-1] == ')': value = value[1:-1] - if value == 'true' or value == 'false' or value == 'null': + if value == 'true' or value == 'false' or value == 'null' or value == 'undefined' or value == 'this': return True if trivial_value_re.match(value):
handle undefined/null as trivial values
pureqml_qmlcore
train
py
b853057024692a8bd02719146ebc45dfa7105139
diff --git a/lib/dimples/version.rb b/lib/dimples/version.rb index <HASH>..<HASH> 100644 --- a/lib/dimples/version.rb +++ b/lib/dimples/version.rb @@ -1,3 +1,3 @@ module Dimples - VERSION = '1.7.1'.freeze + VERSION = '1.7.2'.freeze end
Bumped to <I>.
waferbaby_dimples
train
rb
7d9da6014e4ce2912801a899904c0a6c65222b59
diff --git a/test/plugin/test_out_google_cloud.rb b/test/plugin/test_out_google_cloud.rb index <HASH>..<HASH> 100644 --- a/test/plugin/test_out_google_cloud.rb +++ b/test/plugin/test_out_google_cloud.rb @@ -400,6 +400,7 @@ class GoogleCloudOutputTest < Test::Unit::TestCase end def test_one_log_ec2 + ENV['GOOGLE_APPLICATION_CREDENTIALS'] = 'test/plugin/data/credentials.json' setup_ec2_metadata_stubs setup_logging_stubs d = create_driver(CONFIG_EC2_PROJECT_ID)
Add missing credentials for EC2 logging test. This test was picking up the credentials from my local filesystem and succeeding, but failed on travis. Setting the credentials explicitly makes it (properly) pass everywhere.
GoogleCloudPlatform_fluent-plugin-google-cloud
train
rb
f21e8409ac878d2f8992f9e14ad6579751a9d2d3
diff --git a/packages/ember-views/lib/system/render_buffer.js b/packages/ember-views/lib/system/render_buffer.js index <HASH>..<HASH> 100644 --- a/packages/ember-views/lib/system/render_buffer.js +++ b/packages/ember-views/lib/system/render_buffer.js @@ -528,7 +528,10 @@ _RenderBuffer.prototype = { this._element.appendChild(nodes[0]); } } - this.hydrateMorphs(contextualElement); + // This should only happen with legacy string buffers + if (this.childViews.length > 0) { + this.hydrateMorphs(contextualElement); + } return this._element; },
[BUGFIX beta] Only start hydrating morphs if there are legacy childViews
emberjs_ember.js
train
js
7b7be6aa5bae9ec22aafad817dcc937531ecf9f0
diff --git a/android/src/main/java/com/tradle/react/UdpReceiverTask.java b/android/src/main/java/com/tradle/react/UdpReceiverTask.java index <HASH>..<HASH> 100644 --- a/android/src/main/java/com/tradle/react/UdpReceiverTask.java +++ b/android/src/main/java/com/tradle/react/UdpReceiverTask.java @@ -47,7 +47,7 @@ public class UdpReceiverTask extends AsyncTask<Pair<DatagramSocket, UdpReceiverT final InetAddress address = packet.getAddress(); final String base64Data = Base64.encodeToString(packet.getData(), packet.getOffset(), packet.getLength(), Base64.NO_WRAP); - receiverListener.didReceiveData(base64Data, address.getHostName(), packet.getPort()); + receiverListener.didReceiveData(base64Data, address.getHostAddress(), packet.getPort()); } catch (IOException ioe) { if (receiverListener != null) { receiverListener.didReceiveError(ioe.getMessage());
Assure `host` is always an IP address (#<I>) Use `InetAddress.getHostAddress()` instead of `InetAddress.getHostName()` to get the host IP. The second one sometimes returns a textual name of the local host and this info is not really useful as a source address unless there's a way to resolve that name.
tradle_react-native-udp
train
java
48f157a9b7338180ce7157539e9b2067180ebcf3
diff --git a/webroot/js/embedded.js b/webroot/js/embedded.js index <HASH>..<HASH> 100644 --- a/webroot/js/embedded.js +++ b/webroot/js/embedded.js @@ -49,6 +49,17 @@ var embedded = embedded || {}; var modalId = $(form).data('modal_id'); var url = $(form).attr('action'); + var embedded = $(form).data('embedded'); + + $.each($(form).serializeArray(), function(i, field) { + if (0 === field.name.indexOf(embedded)) { + var name = field.name.replace(embedded, ''); + name = name.replace('[', ''); + name = name.replace(']', ''); + data.append( name, field.value ); + } + }); + $.each(that.files, function(key, value) { data.append('file[]', value);
Fixed multiple data saving in File uploads for (task #<I>)
QoboLtd_cakephp-csv-migrations
train
js
774915b91358b2e8ec7f665826b3dde4be1b5607
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -21,4 +21,6 @@ setup(name='hashids', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', ],)
Extend list of supported python versions
davidaurelio_hashids-python
train
py
fad3a882fcb86b46aa2fbee93a2550baf048dbc4
diff --git a/src/resources/purchases.js b/src/resources/purchases.js index <HASH>..<HASH> 100644 --- a/src/resources/purchases.js +++ b/src/resources/purchases.js @@ -46,13 +46,24 @@ class Purchases extends ResourceBase { async get(address) { const contractData = await this.contractFn(address, 'data') + + const ipfsHashBytes32 = contractData[5] + let ipfsData = {} + if (ipfsHashBytes32) { + const ipfsHash = this.contractService.getIpfsHashFromBytes32( + ipfsHashBytes32 + ) + ipfsData = await this.ipfsService.getFile(ipfsHash) + } + return { address: address, stage: _NUMBERS_TO_STAGE[contractData[0]], listingAddress: contractData[1], buyerAddress: contractData[2], created: Number(contractData[3]), - buyerTimeout: Number(contractData[4]) + buyerTimeout: Number(contractData[4]), + ipfsData } }
Include IPFS data in purchases get method
OriginProtocol_origin-js
train
js
40b6a974768484024158f7a7c2907c1feb42073e
diff --git a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/server/HTTPServer.java b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/server/HTTPServer.java index <HASH>..<HASH> 100644 --- a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/server/HTTPServer.java +++ b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/server/HTTPServer.java @@ -208,6 +208,8 @@ public class HTTPServer extends ContentOracle { * @throws UnsupportedEncodingException If character encoding needs to be consulted, but named character encoding is not supported */ private Map<String, String> getParamMap(Request connRequest) throws UnsupportedEncodingException { + if ((null == connRequest) || (null == connRequest.getParamString())) + return new HashMap<String, String>(); Map<String, String> paramMap = new HashMap<String, String>(); String[] comps = connRequest.getParamString().split("&"); for (int i = 0; i < comps.length; i++) {
Added some tests to validate request string.
languagetool-org_languagetool
train
java
c290c3dfd938a9639720fc5ea72224325b3cf3ef
diff --git a/lib/haibu/drone/index.js b/lib/haibu/drone/index.js index <HASH>..<HASH> 100644 --- a/lib/haibu/drone/index.js +++ b/lib/haibu/drone/index.js @@ -166,6 +166,32 @@ exports.start = function (options, callback) { } function startHook (err) { + // + // There is a current bug in node that throws here: + // + // https://github.com/joyent/node/blob/v0.4.12/lib/net.js#L159 + // + // It will throw a broken pipe error (EPIPE) when a child process that you + // are piping to unexpectedly exits. The write function on line 159 is + // defined here: + // + // https://github.com/joyent/node/blob/v0.4.12/lib/net.js#L62 + // + // This uncaughtExceptionHandler will catch that error, + // and since it originated with in another sync context, + // this section will still respond to the request. + // + haibu.exceptions.logger.exitOnError = function (err) { + if (err.code === 'EPIPE') { + console.log('expected error:'); + console.log('EPIPE -- probabaly caused by someone pushing a non gzip file.'); + console.log('"net" throws on a broken pipe, current node bug, not haibu.'); + return false; + } + + return true; + } + return err ? callback(err) : exports.startHook(options, startServer)
[minor] Add warning for supressed exception on EPIPE. This error is thrown in node@<I> when attempting to pipe a bad tarball to `haibu.config.get("tar")`
nodejitsu_haibu
train
js
a223356dcc2f09f1e5f55269066d609b91fa2c1a
diff --git a/webdriver_test_tools/cmd/cmd.py b/webdriver_test_tools/cmd/cmd.py index <HASH>..<HASH> 100644 --- a/webdriver_test_tools/cmd/cmd.py +++ b/webdriver_test_tools/cmd/cmd.py @@ -39,9 +39,6 @@ def print_validation_warning(text): print(COLORS['warning'](text)) -# TODO: more print methods for other formats? - - # User Input class ValidationError(Exception): diff --git a/webdriver_test_tools/version.py b/webdriver_test_tools/version.py index <HASH>..<HASH> 100644 --- a/webdriver_test_tools/version.py +++ b/webdriver_test_tools/version.py @@ -11,3 +11,14 @@ __devstatus__ = 'Development Status :: 2 - Pre-Alpha' __selenium__ = '3.11.0' + +def get_version_info(): + """Returns a dictionary with version information about the webdriver_test_tools package + + :return: Dictionary with keys 'version', 'devstatus', and 'selenium' + """ + return { + 'version': __version__, + 'devstatus': __devstatus__, + 'selenium': __selenium__, + }
Added get_version_info() method to version submodule Currently not yet implemented, but will be used to reduce accessing its variables directly via import
connordelacruz_webdriver-test-tools
train
py,py
2e19c92c950b47082bad559c59b46e9ff5f81f17
diff --git a/public/build/js/bundle.js b/public/build/js/bundle.js index <HASH>..<HASH> 100644 --- a/public/build/js/bundle.js +++ b/public/build/js/bundle.js @@ -23682,9 +23682,9 @@ var melisCore = (function(window){ $tabArrowTop.addClass("hide-arrow"); } - /* if ( textUndefined === 'undefined' ) { + if ( textUndefined === 'undefined' ) { $title.hide(); - } */ + } } // OPEN TOOLS - opens the tools from the sidebar @@ -31827,7 +31827,7 @@ var dashboardNotify = (function() { * * src: https://stackoverflow.com/a/22479460/7870472 */ - var MAX_COOKIE_AGE = 2147483647; + var MAX_COOKIE_AGE = 2147483647000; // cache DOM var $body = $("body"),
fix on undefined right side mobile responsive menu
melisplatform_melis-core
train
js
c84cdbd08ab4f8e0bcbda4c979871ebede776c0e
diff --git a/tika/tika.py b/tika/tika.py index <HASH>..<HASH> 100644 --- a/tika/tika.py +++ b/tika/tika.py @@ -61,7 +61,7 @@ Example usage as python client: import sys, os, getopt, time try: - unicode_string = unicode + unicode_string = 'utf_8' binary_string = str except NameError: unicode_string = str @@ -451,4 +451,4 @@ if __name__ == '__main__': if type(resp) == list: print('\n'.join([r[1] for r in resp])) else: - print resp + print(resp)
fix: removed errors in running python3
chrismattmann_tika-python
train
py
4d5caf83fba1515cd3aa6989578fe77da4cde2af
diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java index <HASH>..<HASH> 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java @@ -80,6 +80,7 @@ public class TestServiceClient { } finally { client.tearDown(); } + System.exit(0); } private String serverHost = "localhost";
Use exit() for integration test client On my machine, the client currently takes ~3s to run a test. However, with exit() it takes < 1s. When doing lots of integration tests, those seconds add up. We know one of those seconds is the DESTROY_DELAY_SECONDS of SharedResourceHolder. Part of another second appears to be Netty creating any threads that weren't previously created when shutting down.
grpc_grpc-java
train
java
3084fa82244972ba88635b4f06f0e92564b94e39
diff --git a/angr/variableseekr.py b/angr/variableseekr.py index <HASH>..<HASH> 100644 --- a/angr/variableseekr.py +++ b/angr/variableseekr.py @@ -226,7 +226,7 @@ class VariableSeekr(object): irsb = current_run memory = irsb.exits()[0].state.memory - events = memory.events('uninitialized') + events = memory.state.log.events_of_type('uninitialized') print events for region_id, region in memory.regions.items(): if region.is_stack: @@ -362,4 +362,4 @@ class VariableSeekr(object): else: return None -from .errors import AngrInvalidArgumentError \ No newline at end of file +from .errors import AngrInvalidArgumentError
adapted variableseekr to use the state event log for printing out uninitialized reads (although htis code should be moved elsewhere, anyways)
angr_angr
train
py
b764a6b0211cf7823b180e00c1876b207ec5d548
diff --git a/lib/bitescript/builder.rb b/lib/bitescript/builder.rb index <HASH>..<HASH> 100644 --- a/lib/bitescript/builder.rb +++ b/lib/bitescript/builder.rb @@ -333,7 +333,28 @@ module BiteScript def static_init(&block) method(Opcodes::ACC_STATIC, "<clinit>", [void], [], &block) end - + + def build_method(name, visibility, static, exceptions, type, *args) + flags = + case visibility + when :public; Opcodes::ACC_PUBLIC + when :private; Opcodes::ACC_PRIVATE + when :protected; Opcodes::ACC_PROTECTED + end + flags |= Opcodes::ACC_STATIC if static + method(flags, name, [type, *args], exceptions) + end + + def build_constructor(visibility, exceptions, *args) + flags = + case visibility + when :public; Opcodes::ACC_PUBLIC + when :private; Opcodes::ACC_PRIVATE + when :protected; Opcodes::ACC_PROTECTED + end + @constructor = method(flags, "<init>", [nil, *args], exceptions) + end + def method(flags, name, signature, exceptions, &block) flags |= Opcodes::ACC_ABSTRACT if interface? mb = MethodBuilder.new(self, flags, name, exceptions, signature)
Add more general methods for declaring methods and constructors.
headius_bitescript
train
rb
f11011f2887ba17f71cf974fc319dbb550a48ed5
diff --git a/value.go b/value.go index <HASH>..<HASH> 100644 --- a/value.go +++ b/value.go @@ -475,7 +475,18 @@ func (fn *Function) String() string { return toString(fn) } func (fn *Function) Type() string { return "function" } func (fn *Function) Truth() Bool { return true } -func (fn *Function) Syntax() *syntax.Function { return fn.syntax } +// syntax accessors +// +// We do not expose the syntax tree; future versions of Function may dispense with it. + +func (fn *Function) Position() syntax.Position { return fn.position } +func (fn *Function) NumParams() int { return len(fn.syntax.Params) } +func (fn *Function) Param(i int) (string, syntax.Position) { + id := fn.syntax.Locals[i] + return id.Name, id.NamePos +} +func (fn *Function) HasVarargs() bool { return fn.syntax.HasVarargs } +func (fn *Function) HasKwargs() bool { return fn.syntax.HasKwargs } // A Builtin is a function implemented in Go. type Builtin struct {
evaluator: replace Function.Syntax method with accessors (#<I>) * evaluator: replace Function.Syntax method with accessors Future versions of Function may not have a syntax tree. This is a breaking API change.
google_skylark
train
go
2404c0a24ddebca00ad777374c90f125c3d677b3
diff --git a/src/Wrep/Notificare/Tests/Apns/SenderTest.php b/src/Wrep/Notificare/Tests/Apns/SenderTest.php index <HASH>..<HASH> 100644 --- a/src/Wrep/Notificare/Tests/Apns/SenderTest.php +++ b/src/Wrep/Notificare/Tests/Apns/SenderTest.php @@ -65,7 +65,7 @@ class SenderTests extends \PHPUnit_Framework_TestCase { return array( // Add a valid certificate and pushtoken here to run this test - array(new Certificate(__DIR__ . '/../resources/paspas.pem'), '95e3097b302dd0634c4300d0386b582efc51d740bb8869412a73b52c0fda6d7c') + //array(new Certificate(__DIR__ . '/../resources/paspas.pem'), '95e3097b302dd0634c4300d0386b582efc51d740bb8869412a73b52c0fda6d7c') ); } } \ No newline at end of file
Comment out the cert that isn't available for everybody
mac-cain13_notificato
train
php
5782cf186d0bd54d3af5a6d8d26c690d5cfdb4ed
diff --git a/ppb/systems/inputs.py b/ppb/systems/inputs.py index <HASH>..<HASH> 100644 --- a/ppb/systems/inputs.py +++ b/ppb/systems/inputs.py @@ -26,7 +26,7 @@ class EventPoller(SdlSubSystem): """ An event poller that converts Pygame events into PPB events. """ - _subsystems = SDL_INIT_EVENTS + _sdl_subsystems = SDL_INIT_EVENTS event_map = { SDL_QUIT: "quit",
ppb.systems.input: Typo'd "_sdl_subsystems"
ppb_pursuedpybear
train
py
5c77abe9439d4ce93beffa7e47979be14fc677db
diff --git a/decidim-core/app/cells/decidim/coauthorships_cell.rb b/decidim-core/app/cells/decidim/coauthorships_cell.rb index <HASH>..<HASH> 100644 --- a/decidim-core/app/cells/decidim/coauthorships_cell.rb +++ b/decidim-core/app/cells/decidim/coauthorships_cell.rb @@ -19,7 +19,7 @@ module Decidim include Decidim::ApplicationHelper def show - if authorable? || official? + if authorable? cell "decidim/author", presenter_for_author(model), extra_classes.merge(has_actions: has_actions?, from: model) else cell( @@ -41,7 +41,13 @@ module Decidim end def presenters_for_identities(coauthorable) - coauthorable.identities.map { |identity| present(identity) } + coauthorable.identities.map do |identity| + if identity.is_a?(Decidim::Organization) + "#{model.class.parent}::OfficialAuthorPresenter".constantize.new + else + present(identity) + end + end end def presenter_for_author(authorable)
Update coauthorships_cell.rb (#<I>)
decidim_decidim
train
rb
ec6158300ee3a4b3a6c092e23e61411b81391952
diff --git a/molo/profiles/forms.py b/molo/profiles/forms.py index <HASH>..<HASH> 100644 --- a/molo/profiles/forms.py +++ b/molo/profiles/forms.py @@ -109,7 +109,7 @@ class DateOfBirthValidationMixin(object): except ValueError: date_of_birth = None - if self.profile_settings.dob_required and not date_of_birth: + if self.fields['date_of_birth'].required and not date_of_birth: err = _("This field is required.") raise forms.ValidationError(err)
Check if dob is required by the form, not by the settings
praekeltfoundation_molo
train
py
97f0c46a9180a1641b1a97a407b9d3f82c84db45
diff --git a/src/abeautifulsite/SimpleImage.php b/src/abeautifulsite/SimpleImage.php index <HASH>..<HASH> 100644 --- a/src/abeautifulsite/SimpleImage.php +++ b/src/abeautifulsite/SimpleImage.php @@ -658,7 +658,7 @@ class SimpleImage { $imagestring = ob_get_contents(); ob_end_clean(); - return [ $mimetype, $imagestring ]; + return array($mimetype, $imagestring); } /** @@ -1441,4 +1441,4 @@ class SimpleImage { return false; } -} \ No newline at end of file +}
PHP <I> Support (#<I>) For PHP <I> support, we must not use bracket arrays. Fixed a bracket array .
claviska_SimpleImage
train
php
37de76b9b8b2a20610b1a090a2bfbd0f1732d46a
diff --git a/src/main/java/hudson/plugins/groovy/Groovy.java b/src/main/java/hudson/plugins/groovy/Groovy.java index <HASH>..<HASH> 100644 --- a/src/main/java/hudson/plugins/groovy/Groovy.java +++ b/src/main/java/hudson/plugins/groovy/Groovy.java @@ -222,11 +222,16 @@ public class Groovy extends AbstractGroovy { } private File getExeFile(String execName) { - if (File.separatorChar == '\\') { - execName += ".exe"; - } String groovyHome = Util.replaceMacro(getHome(),EnvVars.masterEnvVars); - return new File(groovyHome, "bin/" + execName); + File binDir = new File(groovyHome, "bin/"); + if (File.separatorChar == '\\') { + if(new File(binDir, execName + ".exe").exists()) { + execName += ".exe"; + } else { + execName += ".bat"; + } + } + return new File(binDir, execName); } /**
Support for *.bat executable on windows, applied patch from HUDSON-<I>
jenkinsci_groovy-plugin
train
java
b67258a9081bf47567a663cc8b627e11ccb68d15
diff --git a/synapse/lib/remcycle.py b/synapse/lib/remcycle.py index <HASH>..<HASH> 100644 --- a/synapse/lib/remcycle.py +++ b/synapse/lib/remcycle.py @@ -492,6 +492,7 @@ class Hypnos(s_config.Config): # Stamp api http config ontop of global config, then stamp it into the API config _http = self.global_request_headers[_namespace].copy() _http.update(val.get('http', {})) + val['http'] = _http nyx_obj = Nyx(config=val) self._register_api(name=name, obj=nyx_obj) self.namespaces.add(_namespace)
Fix a issue where the global http config was not carried into the api config
vertexproject_synapse
train
py
4a2fee2b9b79939e8c193d4fac34d061c896ef4e
diff --git a/gcs/bucket.go b/gcs/bucket.go index <HASH>..<HASH> 100644 --- a/gcs/bucket.go +++ b/gcs/bucket.go @@ -219,8 +219,9 @@ func (b *bucket) NewReader( } url := &url.URL{ - Scheme: "https", - Opaque: opaque, + Scheme: "https", + Opaque: opaque, + RawQuery: query.Encode(), } // Create an HTTP request.
Fixed a bug introduced in bf<I>d1e<I>bace<I>ae6ce<I>f<I>eecd<I>.
jacobsa_gcloud
train
go
e7e43411c5fd3191605b0dfb4d0dfb97c1466561
diff --git a/lib/mysql2/client.rb b/lib/mysql2/client.rb index <HASH>..<HASH> 100644 --- a/lib/mysql2/client.rb +++ b/lib/mysql2/client.rb @@ -1,6 +1,6 @@ module Mysql2 class Client - attr_reader :query_options, :read_timeout + attr_reader :query_options, :read_timeout, :write_timeout, :local_infile @@default_query_options = { :as => :hash, # the type of object you want each row back as; also supports :array (an array of values) :async => false, # don't wait for a result after sending the query, you'll have to monitor the socket yourself then eventually call Mysql2::Client#async_result @@ -16,6 +16,8 @@ module Mysql2 def initialize(opts = {}) opts = Mysql2::Util.key_hash_as_symbols( opts ) @read_timeout = nil + @write_timeout = nil + @local_infile = nil @query_options = @@default_query_options.dup @query_options.merge! opts
make sure write_timeout and local_infile ivars are setup to avoid warnings
brianmario_mysql2
train
rb
9c6ad8eadc23294b1c66d92876c11f13c5d4cf48
diff --git a/data/models-ios.php b/data/models-ios.php index <HASH>..<HASH> 100644 --- a/data/models-ios.php +++ b/data/models-ios.php @@ -49,6 +49,7 @@ DeviceModels::$IOS_MODELS = [ 'iPhone10,3' => [ 'Apple', 'iPhone X', DeviceType::MOBILE ], 'iPhone10,4' => [ 'Apple', 'iPhone 8', DeviceType::MOBILE ], 'iPhone10,5' => [ 'Apple', 'iPhone 8 Plus', DeviceType::MOBILE ], + 'iPhone10,6' => [ 'Apple', 'iPhone X', DeviceType::MOBILE ], 'iPhone11,2' => [ 'Apple', 'iPhone XS', DeviceType::MOBILE ], 'iPhone11,4' => [ 'Apple', 'iPhone XS Max', DeviceType::MOBILE ], 'iPhone11,6' => [ 'Apple', 'iPhone XS Max', DeviceType::MOBILE ],
Re-add iPhone X after mistakenly removing it
WhichBrowser_Parser-PHP
train
php
ec2e227fa6227999a33099710443fa9af65c3724
diff --git a/command/agent/command.go b/command/agent/command.go index <HASH>..<HASH> 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -153,6 +153,7 @@ func (c *Command) Run(args []string, rawUi cli.Ui) int { ui.Info(fmt.Sprintf("Node name: '%s'", config.NodeName)) ui.Info(fmt.Sprintf("Bind addr: '%s:%d'", bindIP, bindPort)) ui.Info(fmt.Sprintf(" RPC addr: '%s'", config.RPCAddr)) + ui.Info(fmt.Sprintf("Encrypted: %#v", config.EncryptKey != "")) if len(config.StartJoin) > 0 { ui.Output("Joining cluster...")
command/agent: output whether encryption is enabled
hashicorp_serf
train
go
566d444d7031b62514f9714963b6c084c82aed0d
diff --git a/progressbar/widgets.py b/progressbar/widgets.py index <HASH>..<HASH> 100644 --- a/progressbar/widgets.py +++ b/progressbar/widgets.py @@ -137,10 +137,12 @@ class AdaptiveETA(ETA): ETA.__init__(self) self.num_samples = num_samples self.samples = [] + self.sample_vals = [] self.last_sample_val = None def _eta(self, pbar): samples = self.samples + sample_vals = self.sample_vals if pbar.currval != self.last_sample_val: # Update the last sample counter, we only update if currval has # changed @@ -148,15 +150,18 @@ class AdaptiveETA(ETA): # Add a sample but limit the size to `num_samples` samples.append(pbar.seconds_elapsed) + sample_vals.append(pbar.currval) if len(samples) > self.num_samples: samples.pop(0) + sample_vals.pop(0) if len(samples) <= 1: # No samples so just return the normal ETA calculation return ETA._eta(self, pbar) todo = pbar.maxval - pbar.currval - per_item = float(samples[-1] - samples[0]) / len(samples) + items = samples[-1] - samples[0] + per_item = float(samples[-1] - samples[0]) / items return todo * per_item
fixed inaccuracy for adaptive ETA when not all items get sent
WoLpH_python-progressbar
train
py
5303e875a26a68252045e640a14f7d851b0cae1a
diff --git a/test/Application_test.py b/test/Application_test.py index <HASH>..<HASH> 100644 --- a/test/Application_test.py +++ b/test/Application_test.py @@ -18,3 +18,6 @@ class TestApplicationClass(unittest.TestCase): def test_none(self): pass + +if __name__ == '__main__': + unittest.main()
Update notes and config files for Mac / Xcode 5. svn r<I>
nion-software_nionswift
train
py
61e0a5bdb7c084467baaab2c4672fde68d97283d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -201,7 +201,7 @@ CassandraStore.prototype.queryTileAsync = function(options) { throw new Error('Options must contain an integer idx parameter'); var maxEnd = Math.pow(4, options.zoom); if (options.idx < 0 || options.idx >= maxEnd) - throw new Error('Options must satisfy: 0 <= idx < ' + maxEnd); + throw new Error('Options must satisfy: 0 <= idx < ' + maxEnd + ', requestd idx=' + options.idx); getTile = typeof options.getTile === 'undefined' ? true : options.getTile; getWriteTime = typeof options.getWriteTime === 'undefined' ? false : options.getWriteTime; getSize = typeof options.getSize === 'undefined' ? false : options.getSize;
Better error reporting for bad idx
kartotherian_cassandra
train
js
7decf6763b6ee40cddb3c0dfb9c7140bb9d35f81
diff --git a/lib/sass/util.rb b/lib/sass/util.rb index <HASH>..<HASH> 100644 --- a/lib/sass/util.rb +++ b/lib/sass/util.rb @@ -568,7 +568,7 @@ MSG Regexp.new(/\A(?:#{_enc("\uFEFF", e)})?#{ _enc('@charset "', e)}(.*?)#{_enc('"', e)}|\A(#{ _enc("\uFEFF", e)})/) - rescue Encoding::ConverterNotFound => _ + rescue Encoding::ConverterNotFoundError => _ nil # JRuby on Java 5 doesn't support UTF-32 rescue # /\A@charset "(.*?)"/
Don't die if a UTF encoding isn't supported. f1a<I>a<I>c<I>dcb<I>aa<I>e<I>b incorrectly introduced a missing constant. It should be Encoding::ConverterNotFoundError.
sass_ruby-sass
train
rb
ce829f71ba2586b1bf387549dab4afc0fbc3c7b9
diff --git a/fake_filesystem_test.py b/fake_filesystem_test.py index <HASH>..<HASH> 100755 --- a/fake_filesystem_test.py +++ b/fake_filesystem_test.py @@ -3293,11 +3293,7 @@ class DiskSpaceTest(TestCase): self.assertEqual((100, 5, 95), self.filesystem.GetDiskUsage()) def testFileSystemSizeAfterAsciiStringFileCreation(self): - if sys.version_info < (3, 0): - contents = u'complicated' - else: - contents = 'complicated' - self.filesystem.CreateFile('/foo/bar', contents=contents) + self.filesystem.CreateFile('/foo/bar', contents='complicated') self.assertEqual((100, 11, 89), self.filesystem.GetDiskUsage()) def testFileSystemSizeAfter2ByteUnicodeStringFileCreation(self):
Second go to fix the test - do not use unicode in Python 2
jmcgeheeiv_pyfakefs
train
py
ca7d067ab751367f350ee2e1d3621d0d6e65696f
diff --git a/simulator/src/test/java/com/hazelcast/simulator/protocol/connector/WorkerConnectorTest.java b/simulator/src/test/java/com/hazelcast/simulator/protocol/connector/WorkerConnectorTest.java index <HASH>..<HASH> 100644 --- a/simulator/src/test/java/com/hazelcast/simulator/protocol/connector/WorkerConnectorTest.java +++ b/simulator/src/test/java/com/hazelcast/simulator/protocol/connector/WorkerConnectorTest.java @@ -39,6 +39,7 @@ public class WorkerConnectorTest { assertEquals(WORKER_INDEX, address.getWorkerIndex()); assertEquals(AGENT_INDEX, address.getAgentIndex()); + assertEquals(0, connector.getMessageQueueSize()); assertEquals(PORT, connector.getPort()); assertEquals(WorkerOperationProcessor.class, connector.getProcessor().getClass()); }
Increased code coverage of WorkerConnector.
hazelcast_hazelcast-simulator
train
java
3b3edb85964a0226cb371c081ac9053e7d13265d
diff --git a/lib/bulk/common.js b/lib/bulk/common.js index <HASH>..<HASH> 100644 --- a/lib/bulk/common.js +++ b/lib/bulk/common.js @@ -13,10 +13,7 @@ const executeOperation = require('../utils').executeOperation; const isPromiseLike = require('../utils').isPromiseLike; // Error codes -const UNKNOWN_ERROR = 8; -const INVALID_BSON_ERROR = 22; const WRITE_CONCERN_ERROR = 64; -const MULTIPLE_ERROR = 65; // Insert types const INSERT = 1; @@ -1145,20 +1142,8 @@ Object.defineProperty(BulkOperationBase.prototype, 'length', { module.exports = { Batch, BulkOperationBase, - BulkWriteError, - BulkWriteResult, bson, - FindOperators, - handleMongoWriteConcernError, - LegacyOp, - mergeBatchResults, - INVALID_BSON_ERROR: INVALID_BSON_ERROR, - MULTIPLE_ERROR: MULTIPLE_ERROR, - UNKNOWN_ERROR: UNKNOWN_ERROR, - WRITE_CONCERN_ERROR: WRITE_CONCERN_ERROR, INSERT: INSERT, UPDATE: UPDATE, - REMOVE: REMOVE, - WriteError, - WriteConcernError + REMOVE: REMOVE };
refactor(BulkOp): remove code that is not used
mongodb_node-mongodb-native
train
js
f49a8effc63e1d3f5c32d23823197d08a49673bb
diff --git a/src/com/google/javascript/jscomp/AstValidator.java b/src/com/google/javascript/jscomp/AstValidator.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/AstValidator.java +++ b/src/com/google/javascript/jscomp/AstValidator.java @@ -293,6 +293,7 @@ public final class AstValidator implements CompilerPass { case MUL: case MOD: case DIV: + case EXPONENT: validateBinaryOp(n); return;
Update AstValidator for exponentiation operator. Also add some missing default cases to switch statements. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
7da688691ec7d031953c23fdd64afa023605cdab
diff --git a/tests/Backend/CommonPart1/AlterTableTest.php b/tests/Backend/CommonPart1/AlterTableTest.php index <HASH>..<HASH> 100644 --- a/tests/Backend/CommonPart1/AlterTableTest.php +++ b/tests/Backend/CommonPart1/AlterTableTest.php @@ -79,7 +79,7 @@ class AlterTableTest extends StorageApiTestCase return [ [ '_abc-def----ghi_', - 'abc_def_ghi', + 'abc_def_ghi_', ], [ 'žluťoučký kůň', @@ -87,7 +87,7 @@ class AlterTableTest extends StorageApiTestCase ], [ 'lot__of_____underscores____', - 'lot__of_____underscores', + 'lot__of_____underscores____', ] ]; }
fix expected columns names after webalize
keboola_storage-api-php-client
train
php
741fba51f503641bbd54a8e8db9c172cc7511214
diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/NspAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/NspAnalyzer.java index <HASH>..<HASH> 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/NspAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/NspAnalyzer.java @@ -269,6 +269,7 @@ public class NspAnalyzer extends AbstractFileTypeAnalyzer { nodeModule.setEcosystem(DEPENDENCY_ECOSYSTEM); //this is virtual - the sha1 is purely for the hyperlink in the final html report nodeModule.setSha1sum(Checksum.getSHA1Checksum(String.format("%s:%s", name, version))); + nodeModule.setMd5sum(Checksum.getMD5Checksum(String.format("%s:%s", name, version))); nodeModule.addEvidence(EvidenceType.PRODUCT, "package.json", "name", name, Confidence.HIGHEST); nodeModule.addEvidence(EvidenceType.VENDOR, "package.json", "name", name, Confidence.HIGH); nodeModule.addEvidence(EvidenceType.VERSION, "package.json", "version", version, Confidence.HIGHEST);
updated as this would end up similiar to #<I>
jeremylong_DependencyCheck
train
java
0b796c7815ca510fb663e158001753b3d62cd099
diff --git a/src/segments/tokenizer.py b/src/segments/tokenizer.py index <HASH>..<HASH> 100644 --- a/src/segments/tokenizer.py +++ b/src/segments/tokenizer.py @@ -323,7 +323,7 @@ class Tokenizer(object): continue else: if unicodedata.category(result[-1][0]) == "Sk": - result[-1] = grapheme + result[-1] + result[-1] = grapheme + temp + result[-1] temp = "" continue
Vietnamese tone contour grouping (#<I>) * potential fix to deal with Vietnamese problem * updated solution to Vietnamese problem
cldf_segments
train
py
a5a16dbb60462096639c71581b9ef1827a4d7c35
diff --git a/pulsar/async/defer.py b/pulsar/async/defer.py index <HASH>..<HASH> 100755 --- a/pulsar/async/defer.py +++ b/pulsar/async/defer.py @@ -595,7 +595,7 @@ function when a generator is passed as argument.''' elif last_result is not self.errors: self.errors.append(last_result) if self.max_errors and len(self.errors) >= self.max_errors: - return self._conclude() + return self._conclude(last_result) try: result = self.gen.send(last_result) except StopIteration: @@ -617,13 +617,11 @@ function when a generator is passed as argument.''' # the passed result (which is not asynchronous). return result - def _conclude(self, last_result=None): + def _conclude(self, last_result): # Conclude the generator and callback the listeners - #result = last_result if not self.errors else self.errors - result = last_result del self.gen del self.errors - return self.callback(result) + return self.callback(last_result) ############################################################### MultiDeferred class MultiDeferred(Deferred):
deferredcoroutine conclude by calling back the last result
quantmind_pulsar
train
py
c08de2e7b1c66b98ced39f6899ad999b61583bb0
diff --git a/IPython/html/static/notebook/js/widgets/multicontainer.js b/IPython/html/static/notebook/js/widgets/multicontainer.js index <HASH>..<HASH> 100644 --- a/IPython/html/static/notebook/js/widgets/multicontainer.js +++ b/IPython/html/static/notebook/js/widgets/multicontainer.js @@ -22,9 +22,9 @@ define(["notebook/js/widget"], function(widget_manager){ render: function(){ var guid = 'accordion' + IPython.utils.uuid(); - this.$el = $('<div />', {id: guid}) + this.$el + .attr('id', guid) .addClass('accordion'); - this._ensureElement(); this.containers = []; },
Fixed backbone event handling for accordion view
jupyter-widgets_ipywidgets
train
js
21b84714e98bcf983dea8fbcf1462873555c1d9d
diff --git a/lib/sidekiq-unique-jobs.rb b/lib/sidekiq-unique-jobs.rb index <HASH>..<HASH> 100644 --- a/lib/sidekiq-unique-jobs.rb +++ b/lib/sidekiq-unique-jobs.rb @@ -56,7 +56,7 @@ module SidekiqUniqueJobs end def redis_version - @redis_version ||= connection { |c| c.info('server')['redis_version'] } + @redis_version ||= connection { |c| c.info('server'.freeze)['redis_version'.freeze] } end def connection(redis_pool = nil) @@ -67,10 +67,6 @@ module SidekiqUniqueJobs end end - def mock_redis - @redis_mock ||= MockRedis.new if defined?(MockRedis) - end - def synchronize(item, redis_pool) Lock::WhileExecuting.synchronize(item, redis_pool) { yield } end
Remove mock_redis completely Not in use anymore
mhenrixon_sidekiq-unique-jobs
train
rb
4567f8e5386f32135d75e1dcd9b7dc704c81c948
diff --git a/sos/plugins/samba.py b/sos/plugins/samba.py index <HASH>..<HASH> 100644 --- a/sos/plugins/samba.py +++ b/sos/plugins/samba.py @@ -34,10 +34,10 @@ class Samba(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): self.add_copy_spec("/var/log/samba/") self.add_cmd_output([ - "wbinfo --domain='.' -g", - "wbinfo --domain='.' -u", - "wbinfo --trusted-domains --verbose", "testparm -s", + "wbinfo --domain='.' --domain-users", + "wbinfo --domain='.' --domain-groups", + "wbinfo --trusted-domains --verbose", ])
[samba] Use verbose names and get testparm output first Related: #<I>
sosreport_sos
train
py
9925f9afb010bade835963ac7dce8e2bcef08a14
diff --git a/gui/src/main/java/org/jboss/as/console/client/shared/subsys/ejb3/model/StrictMaxBeanPool.java b/gui/src/main/java/org/jboss/as/console/client/shared/subsys/ejb3/model/StrictMaxBeanPool.java index <HASH>..<HASH> 100644 --- a/gui/src/main/java/org/jboss/as/console/client/shared/subsys/ejb3/model/StrictMaxBeanPool.java +++ b/gui/src/main/java/org/jboss/as/console/client/shared/subsys/ejb3/model/StrictMaxBeanPool.java @@ -55,7 +55,8 @@ public interface StrictMaxBeanPool extends NamedEntity { void setTimeout(long timeout); @Binding(detypedName="timeout-unit") - @FormItem(formItemTypeForEdit="UNITS") + @FormItem(defaultValue="MINUTES", + formItemTypeForEdit="UNITS") String getTimeoutUnit(); void setTimeoutUnit(String unit); }
AS7-<I> Fix for failure to add EJB3 pool Added missing default to model.
hal_core
train
java
78ad042f42179834f78c00951068168766503597
diff --git a/saltcloud/clouds/ec2.py b/saltcloud/clouds/ec2.py index <HASH>..<HASH> 100644 --- a/saltcloud/clouds/ec2.py +++ b/saltcloud/clouds/ec2.py @@ -612,6 +612,9 @@ def create(vm_=None, call=None): key_filename=__opts__['EC2.private_key']): username = user break + else: + return {vm_['name']: 'Failed to authenticate'} + sudo = True if 'sudo' in vm_.keys(): sudo = vm_['sudo']
Fix `UnboundLocalError` when failed to authenticated using SSH with EC2.
saltstack_salt
train
py
dd4b4b3971c0c50c28275ca61da071aad31249d5
diff --git a/ai/methods.py b/ai/methods.py index <HASH>..<HASH> 100644 --- a/ai/methods.py +++ b/ai/methods.py @@ -128,16 +128,20 @@ def _search(problem, fringe, graph_search=False, depth_limit=None, if problem.is_goal(node.state): return node if depth_limit is None or node.depth < depth_limit: - childs = node.expand() - if filter_nodes: - childs = filter_nodes(problem, node, childs) - for n in childs: + childs = [] + for n in node.expand(): if graph_search: if n.state not in memory: memory.add(n.state) - fringe.append(n) + childs.append(n) else: - fringe.append(n) + childs.append(n) + + if filter_nodes: + childs = filter_nodes(problem, node, childs) + + for n in childs: + fringe.append(n) # Math literally copied from aima-python
Fixed problem between node filtering and memory of nodes
simpleai-team_simpleai
train
py
c7f2983c5e6a95677c1b08f7c8f79e322be2236c
diff --git a/phydmslib/treelikelihood.py b/phydmslib/treelikelihood.py index <HASH>..<HASH> 100644 --- a/phydmslib/treelikelihood.py +++ b/phydmslib/treelikelihood.py @@ -268,6 +268,7 @@ class TreeLikelihood: bounds.append(self.model.PARAMLIMITS[param[0]]) else: raise ValueError("Invalid param type") + bounds = [(tup[0] + ALMOST_ZERO, tup[1] - ALMOST_ZERO) for tup in bounds] assert len(bounds) == len(self._index_to_param) return tuple(bounds) @@ -359,7 +360,8 @@ class TreeLikelihood: if modelparams: self.model.updateParams(modelparams) if otherparams: - raise RuntimeError("cannot currently handle non-model params") + raise RuntimeError("Cannot handle non-model params: {0}".format( + otherparams)) if newvalues: self._updateInternals() self._paramsarray = None
Added margins on parameter bounds for optimization The bounds on the L-BFGS optimizer seem to sometimes get slightly exceeded. Now the lower bound is + ALMOST_ZERO and the upper bound is - ALMOST_ZERO to avoid this problem.
jbloomlab_phydms
train
py
273781a5af2af580c85fb76d35b3706c2aaef567
diff --git a/halogen/types.py b/halogen/types.py index <HASH>..<HASH> 100644 --- a/halogen/types.py +++ b/halogen/types.py @@ -27,10 +27,15 @@ class List(Type): """List type for Halogen schema attribute.""" - def __init__(self, item_type=None): - """Create a new List.""" + def __init__(self, item_type=None, allow_scalar=False): + """Create a new List. + + :param item_type: Item type or schema. + :param allow_scalar: Automatically convert scalar value to the list. + """ super(List, self).__init__() self.item_type = item_type or Type + self.allow_scalar = allow_scalar def serialize(self, value, **kwargs): """Serialize every item of the list.""" @@ -38,4 +43,6 @@ class List(Type): def deserialize(self, value, **kwargs): """Deserialize every item of the list.""" + if self.allow_scalar and not isinstance(value, (list, tuple)): + value = [value] return [self.item_type.deserialize(val, **kwargs) for val in value]
allow scalar in the list
paylogic_halogen
train
py
0c5e878ef6fb97edd3b1fb75c33e5fee92ba0df8
diff --git a/renku/core/__init__.py b/renku/core/__init__.py index <HASH>..<HASH> 100644 --- a/renku/core/__init__.py +++ b/renku/core/__init__.py @@ -16,3 +16,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """Renku core.""" +import logging + +logging.getLogger('py-filelock.filelock').setLevel(logging.ERROR)
chore(core): set filelock logging to warning (#<I>)
SwissDataScienceCenter_renku-python
train
py
7453895d2ff2a3f117e6375d059c5a6bb5a601e0
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -8,7 +8,6 @@ * PHP version 5 * @package MetaModels * @subpackage Tests - * @author Christian Schiffler <c.schiffler@cyberspectrum.de> * @author Christopher Boelter <christopher@boelter.eu> * @copyright The MetaModels team. * @license LGPL.
added missing languages, removed author from boostrap.php
MetaModels_attribute_translatedurl
train
php
d0699d0cd088f3bd825a2dfcd1e07f7d27c74f39
diff --git a/Lib/RelativeTime/Languages/French.php b/Lib/RelativeTime/Languages/French.php index <HASH>..<HASH> 100644 --- a/Lib/RelativeTime/Languages/French.php +++ b/Lib/RelativeTime/Languages/French.php @@ -19,7 +19,7 @@ class French extends LanguageAdapter { protected $strings = array( 'now' => 'maintenant', - 'ago' => 'depuis %s', + 'ago' => 'il y a %s', 'left' => '%s restant', 'seconds' => array( 'plural' => '%d secondes',
French: Replace "depuis" with "il y a" The original translation from <I> translated "2 seconds ago" as "since 2 seconds". Which is inaccurate since every single French I've seen translated it to (literally) "there are 2 seconds".
mpratt_RelativeTime
train
php
04de3b2ef64595aa333a245d31b6c95cc2b46115
diff --git a/SEOstats/Config/Services.php b/SEOstats/Config/Services.php index <HASH>..<HASH> 100644 --- a/SEOstats/Config/Services.php +++ b/SEOstats/Config/Services.php @@ -41,7 +41,7 @@ interface Services const GOOGLE_APISEARCH_URL = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=%s&q=%s'; // Google Pagespeed Insights API Endpoint. - const GOOGLE_PAGESPEED_URL = 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=%s&key=%s'; + const GOOGLE_PAGESPEED_URL = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=%s&strategy=%s&key=%s'; // Google +1 Fastbutton URL. const GOOGLE_PLUSONE_URL = 'https://plusone.google.com/u/0/_/+1/fastbutton?count=true&url=%s';
Update pagespeed URL to 'v2', include strategy
eyecatchup_SEOstats
train
php
28b59ddb940075e2de047bc5e4829d47006ebddc
diff --git a/lib/fog/vcloud_director/models/compute/vm.rb b/lib/fog/vcloud_director/models/compute/vm.rb index <HASH>..<HASH> 100644 --- a/lib/fog/vcloud_director/models/compute/vm.rb +++ b/lib/fog/vcloud_director/models/compute/vm.rb @@ -90,6 +90,17 @@ module Fog service.process_task(response.body) end + def undeploy + requires :id + begin + response = service.post_undeploy_vapp(id) + rescue Fog::Compute::VcloudDirector::BadRequest => ex + Fog::Logger.debug(ex.message) + return false + end + service.process_task(response.body) + end + # Shut down the VM. def shutdown requires :id
Power off leaves it in 'Partially Running' state. VMs must be fully OFF when deleting them with recompose.
fog_fog
train
rb
95ae8e0100f5c784689d2f1c3addf406e5e507af
diff --git a/cougar-framework/cougar-util/src/main/java/com/betfair/cougar/util/geolocation/RemoteAddressUtils.java b/cougar-framework/cougar-util/src/main/java/com/betfair/cougar/util/geolocation/RemoteAddressUtils.java index <HASH>..<HASH> 100644 --- a/cougar-framework/cougar-util/src/main/java/com/betfair/cougar/util/geolocation/RemoteAddressUtils.java +++ b/cougar-framework/cougar-util/src/main/java/com/betfair/cougar/util/geolocation/RemoteAddressUtils.java @@ -42,7 +42,7 @@ public class RemoteAddressUtils { StringBuilder localAddresses = new StringBuilder(); Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces(); if (enumeration == null) { - throw new RuntimeException("Failed to retrieve any network interfaces"); + throw new RuntimeException("Failed to retrieve any network interfaces, consider setting system property \"cougar.addressUtils.allowLoopBackIfNoOthers\" to true"); } // we only use this if there are no others and we're willing to accept the loopback NetworkInterface loopback = null;
#<I> implemented via double headers (X-UUID and X-UUID-Parents) and a new socket protocol version (5) to ensure backwards compatibility. Includes unit and integration tests following the new style started in #<I>
betfair_cougar
train
java
5cdf8508d3f6445db276ff9ce6cdcd7e8730a7a1
diff --git a/sportsreference/ncaaf/boxscore.py b/sportsreference/ncaaf/boxscore.py index <HASH>..<HASH> 100644 --- a/sportsreference/ncaaf/boxscore.py +++ b/sportsreference/ncaaf/boxscore.py @@ -700,8 +700,9 @@ class Boxscore: values. The index for the DataFrame is the string URI that is used to instantiate the class, such as '2018-01-08-georgia'. """ - if self._away_points is None and self._home_points is None: - return None + for points in [self._away_points, self._home_points]: + if points is None or points == '': + return None fields_to_include = { 'away_first_downs': self.away_first_downs, 'away_fumbles': self.away_fumbles,
Fix issue with boxscores throwing errors For games that are yet to occur which are listed in an NCAAF team's schedule, an error will be thrown while attempting to parse a score for the game when none exists. To circumvent this issue, not only should the points be checked if they are None, they should also be checked if they are empty.
roclark_sportsreference
train
py
705a6156171554fe0bdd78152d130b79f821492c
diff --git a/app/search_engines/bento_search/eds_engine.rb b/app/search_engines/bento_search/eds_engine.rb index <HASH>..<HASH> 100644 --- a/app/search_engines/bento_search/eds_engine.rb +++ b/app/search_engines/bento_search/eds_engine.rb @@ -45,6 +45,9 @@ require 'http_client_patch/include_client' # openurl. http://support.ebsco.com/knowledge_base/detail.php?id=1111 (May # have to ask EBSCO support for help, it's confusing!). # +# TODO: May have to add configuration code to pull the OpenURL link out by +# it's configured name or label, not assume first one is it. +# # As always, you can customize links and other_links with Item Decorators. # # == Technical Notes and Difficulties
EDS, docs on including OpenURL links
jrochkind_bento_search
train
rb
acfd35b6f8373e2f0c250f5ed17891dd66c2cb6b
diff --git a/explauto/environment/poppy/poppy_env.py b/explauto/environment/poppy/poppy_env.py index <HASH>..<HASH> 100644 --- a/explauto/environment/poppy/poppy_env.py +++ b/explauto/environment/poppy/poppy_env.py @@ -49,9 +49,12 @@ class PoppyEnvironment(Environment): pos = {m.name: pos for m, pos in zip(self.motors, m_env)} self.robot.goto_position(pos, self.move_duration, wait=True) - return self.tracker.get_object_position(self.tracked_obj) + # This allows to actually apply a motor command + # Without having a tracker + if self.tracker is not None: + return self.tracker.get_object_position(self.tracked_obj) def reset(self): - """ Resets simulation and does nothing when using a real robot. """ + """ Resets simulation and does nothing when using a real robot. """ if self.robot.simulated: self.robot.reset_simulation()
Add the possibility to create the poppy env without defining a tracker.
flowersteam_explauto
train
py
8f62d5ede3885b8f0b5b752ff2be56c4c8c7a8e6
diff --git a/argcomplete/my_shlex.py b/argcomplete/my_shlex.py index <HASH>..<HASH> 100644 --- a/argcomplete/my_shlex.py +++ b/argcomplete/my_shlex.py @@ -29,8 +29,6 @@ try: except NameError: basestring = str -__all__ = ["shlex", "split"] - class shlex: "A lexical analyzer class for simple shell-like syntaxes." def __init__(self, instream=None, infile=None, posix=False,
Remove __all__ from my_shlex (#<I>)
kislyuk_argcomplete
train
py
c2765b438d971d7d334de21c6c26f75dddd36fc7
diff --git a/lib/shell_mock/command_stub.rb b/lib/shell_mock/command_stub.rb index <HASH>..<HASH> 100644 --- a/lib/shell_mock/command_stub.rb +++ b/lib/shell_mock/command_stub.rb @@ -3,7 +3,7 @@ require 'shell_mock/stub_registry' module ShellMock class CommandStub - attr_reader :command, :expected_output, :exitstatus, :env, :options, :side_effect, :writer + attr_reader :command, :expected_output, :exitstatus, :env, :options, :side_effect def initialize(command) @command = command @@ -63,7 +63,7 @@ module ShellMock private - attr_reader :reader + attr_reader :reader, :writer def marshaled_signatures messages = ""
no reason for this to be a public method
yarmiganosca_shell_mock
train
rb
28b72c7b232ed273311e12b934f712e312a55437
diff --git a/lib/chef/compliance/runner.rb b/lib/chef/compliance/runner.rb index <HASH>..<HASH> 100644 --- a/lib/chef/compliance/runner.rb +++ b/lib/chef/compliance/runner.rb @@ -17,6 +17,8 @@ class Chef def_delegators :node, :logger def enabled? + return false if @node.nil? + # Did we parse the libraries file from the audit cookbook? This class dates back to when Chef Automate was # renamed from Chef Visibility in 2017, so should capture all modern versions of the audit cookbook. audit_cookbook_present = defined?(::Reporter::ChefAutomate) diff --git a/spec/unit/compliance/runner_spec.rb b/spec/unit/compliance/runner_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/compliance/runner_spec.rb +++ b/spec/unit/compliance/runner_spec.rb @@ -12,6 +12,12 @@ describe Chef::Compliance::Runner do end describe "#enabled?" do + context "when the node is not available" do + let(:runner) { described_class.new } + it "is false because it needs the node to answer that question" do + expect(runner).not_to be_enabled + end + end it "is true if the node attributes have audit profiles and the audit cookbook is not present, and the compliance mode attribute is nil" do node.normal["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
Report not enabled if the node is not available The #enabled? method needs a node object to answer the question, and the node object is not always available to it (for example, run_failed when config is wrong).
chef_chef
train
rb,rb
12e254dbec7fc20c743e1766b5f54673bb9350e2
diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/UserAgentFilter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/UserAgentFilter.java index <HASH>..<HASH> 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/UserAgentFilter.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/UserAgentFilter.java @@ -86,17 +86,18 @@ public class UserAgentFilter extends ClientFilter { * @return the version from resources */ private String getVersionFromResources() { - String version; + String version = "unknown"; Properties properties = new Properties(); try { InputStream inputStream = getClass().getClassLoader().getResourceAsStream( "META-INF/maven/com.microsoft.windowsazure/microsoft-windowsazure-api/pom.properties"); - properties.load(inputStream); - version = properties.getProperty("version"); - inputStream.close(); + if (inputStream != null) { + properties.load(inputStream); + version = properties.getProperty("version"); + inputStream.close(); + } } catch (IOException e) { - version = ""; } return version;
fix an issue on Jason's machine.
Azure_azure-sdk-for-java
train
java
b2ea6f29d625a0398f27775d2029ddeb32e0a6d2
diff --git a/claripy/ast/base.py b/claripy/ast/base.py index <HASH>..<HASH> 100644 --- a/claripy/ast/base.py +++ b/claripy/ast/base.py @@ -285,11 +285,11 @@ class Base: return b'\x2e' elif type(arg) is int: if arg < 0: - if arg >= -0xffff: + if arg >= -0x7fff: return b'-' + struct.pack("<h", arg) - elif arg >= -0xffff_ffff: + elif arg >= -0x7fff_ffff: return b'-' + struct.pack("<i", arg) - elif arg >= -0xffff_ffff_ffff_ffff: + elif arg >= -0x7fff_ffff_ffff_ffff: return b'-' + struct.pack("<q", arg) return None else:
_arg_serialize(): Don't serialize negative numbers beyond their respective ranges.
angr_claripy
train
py
e249546578822155f595d40c2605391b7dd25f91
diff --git a/classes/PodsComponents.php b/classes/PodsComponents.php index <HASH>..<HASH> 100644 --- a/classes/PodsComponents.php +++ b/classes/PodsComponents.php @@ -90,7 +90,7 @@ class PodsComponents { if ( empty( $component_data[ 'MenuPage' ] ) && ( !isset( $component_data[ 'object' ] ) || !method_exists( $component_data[ 'object' ], 'admin' ) ) ) continue; - $component_data[ 'File' ] = realpath( PODS_DIR . str_replace( array( PODS_DIR, ABSPATH ), '', $component_data[ 'File' ] ) ); + $component_data[ 'File' ] = realpath( PODS_DIR . $component_data[ 'File' ] ); if ( !file_exists( $component_data[ 'File' ] ) ) continue; @@ -159,7 +159,7 @@ class PodsComponents { $component_data = $this->components[ $component ]; - $component_data[ 'File' ] = realpath( PODS_DIR . str_replace( array( PODS_DIR, ABSPATH ), '', $component_data[ 'File' ] ) ); + $component_data[ 'File' ] = realpath( PODS_DIR . $component_data[ 'File' ] ); if ( !file_exists( $component_data[ 'File' ] ) ) continue;
More tweaks to handling now that components transient is cleared
pods-framework_pods
train
php
c5317e64a4b25de3024381d970a6b559498782c7
diff --git a/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java b/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java +++ b/src/main/java/org/dasein/cloud/google/compute/server/ServerSupport.java @@ -440,7 +440,8 @@ public class ServerSupport extends AbstractVMSupport { VirtualMachine vm = new VirtualMachine(); vm.setProviderVirtualMachineId(instance.getName()); vm.setName(instance.getName()); - vm.setDescription(instance.getDescription()); + if(instance.getDescription() != null)vm.setDescription(instance.getDescription()); + else vm.setDescription(instance.getName()); vm.setProviderOwnerId(provider.getContext().getAccountNumber()); VmState vmState = null;
Fix possible NPE listing VMs with no description
dasein-cloud_dasein-cloud-google
train
java
ff21df692d08909b549b69542d93e920bababfad
diff --git a/src/Image/Service.php b/src/Image/Service.php index <HASH>..<HASH> 100644 --- a/src/Image/Service.php +++ b/src/Image/Service.php @@ -31,10 +31,10 @@ class Service */ public function upload($image, $path = null, $makeDiffSizes = true) { - $this->directory(public_path($path)); + $this->directory(storage_path('app/public/' . $path)); $name = $image->getClientOriginalName(); - $image->move(public_path($path), $name); - $relativePath = public_path($path . DIRECTORY_SEPARATOR . $name); + $image->move(storage_path('app/public/' . $path), $name); + $relativePath = storage_path('app/public/' . $path . DIRECTORY_SEPARATOR . $name); if (true === $makeDiffSizes) { $sizes = config('avored-framework.image.sizes'); @@ -42,7 +42,7 @@ class Service list($width, $height) = $widthHeight; $this->make($relativePath); $this->resizeImage($width, $height, 'crop'); - $imagePath = public_path($path) . DIRECTORY_SEPARATOR . $sizeName . '-' . $name; + $imagePath = storage_path('app/public/' . $path) . DIRECTORY_SEPARATOR . $sizeName . '-' . $name; $this->saveImage($imagePath, 100); } }
updated to use storage path now for images
avored_framework
train
php
29a98f6c6d1cfdde4adc6c840a851e79f1aacc32
diff --git a/src/JsonStreamingParser/Listener.php b/src/JsonStreamingParser/Listener.php index <HASH>..<HASH> 100644 --- a/src/JsonStreamingParser/Listener.php +++ b/src/JsonStreamingParser/Listener.php @@ -15,8 +15,8 @@ interface JsonStreamingParser_Listener { // Key will always be a string public function key($key); - // Note that value may be a string, integer, boolean, array, etc. + // Note that value may be a string, integer, boolean, etc. public function value($value); public function whitespace($whitespace); -} \ No newline at end of file +}
update misleading comment as arrays are never passed into Listener
salsify_jsonstreamingparser
train
php
e064875810e2a248536e1f771613b39d21902cd0
diff --git a/performance/cache_runner.rb b/performance/cache_runner.rb index <HASH>..<HASH> 100644 --- a/performance/cache_runner.rb +++ b/performance/cache_runner.rb @@ -4,7 +4,6 @@ require 'active_support/core_ext' require 'active_support/cache' require 'identity_cache' require 'memcache' -require 'debugger' if ENV['BOXEN_HOME'].present? $memcached_port = 21211 diff --git a/performance/externals.rb b/performance/externals.rb index <HASH>..<HASH> 100644 --- a/performance/externals.rb +++ b/performance/externals.rb @@ -24,8 +24,6 @@ end def count_externals(results) count = {} - EXTERNALS.each do - end results.split(/\n/).each do |line| fields = line.split if ext = EXTERNALS.detect { |e| e[1].any? { |method| method == fields[-1] } } @@ -40,7 +38,6 @@ end create_database(RUNS) - run(FindRunner.new(RUNS)) run(FetchHitRunner.new(RUNS))
Remove some unneeded code post-review
Shopify_identity_cache
train
rb,rb
20469a82e7e5abac9c5c5611c04f23c88b322971
diff --git a/src/geo/ui/widgets/histogram/content-view.js b/src/geo/ui/widgets/histogram/content-view.js index <HASH>..<HASH> 100644 --- a/src/geo/ui/widgets/histogram/content-view.js +++ b/src/geo/ui/widgets/histogram/content-view.js @@ -224,11 +224,14 @@ module.exports = WidgetContent.extend({ this.histogramChartView.removeSelection(); var data = this.originalData; - this.filter.setRange( - data[loBarIndex].start, - data[hiBarIndex - 1].end - ); - this._updateStats(); + + if (loBarIndex > 0 && loBarIndex < data.length && (hiBarIndex - 1) > 0 && (hiBarIndex - 1) < data.length) { + this.filter.setRange( + data[loBarIndex].start, + data[hiBarIndex - 1].end + ); + this._updateStats(); + } }, _onBrushEnd: function(loBarIndex, hiBarIndex) {
Prevents from accessing the limits of an array
CartoDB_carto.js
train
js
a2c5900a3b7f6e2874a7ac86b2a4d4651e5606ad
diff --git a/packages/idyll-cli/bin/idyll.js b/packages/idyll-cli/bin/idyll.js index <HASH>..<HASH> 100755 --- a/packages/idyll-cli/bin/idyll.js +++ b/packages/idyll-cli/bin/idyll.js @@ -12,7 +12,13 @@ var cmd if (!idyll) { cmd = p.join(__dirname, './cli.js'); } else { - cmd = p.join(idyll, '..', '..', 'bin', 'cli.js'); + var idyllBin = p.join(idyll, '..', '..', 'bin') + cmd = p.join(idyllBin, 'cli.js'); + try { + p.statSync(cmd) + } catch (err) { + cmd = p.join(idyllBin, 'idyll.js') + } } spawnSync(cmd, process.argv.slice(2), { stdio: 'inherit'
Fix for backwards-compat issue
idyll-lang_idyll
train
js
b47e3ac6ad1c9ed0cd54ba7388d78edcfd6ab29c
diff --git a/chef/lib/chef/knife/data_bag_from_file.rb b/chef/lib/chef/knife/data_bag_from_file.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/knife/data_bag_from_file.rb +++ b/chef/lib/chef/knife/data_bag_from_file.rb @@ -46,7 +46,7 @@ class Chef option :all, :short => "-a", :long => "--all", - :description => "Upload all data bags" + :description => "Upload all data bags or all items for specified data bags" def read_secret if config[:secret]
Add a note about a secret knife data bag from file feature knife data bag from file -a ; loads all data bags and items knife data bag from file users -a ; loads all data bag items for data bag users
chef_chef
train
rb
b03fd3532e5fb079de1b35217834522cb48fdb88
diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -69,7 +69,7 @@ def install_debian(codename, version_kind, version): key = 'autobuild' subprocess.check_call( - args='wget -q -O- https://raw.github.com/ceph/ceph/master/keys/{key}.asc | apt-key add -'.format(key=key), + args='wget -q -O- \'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc\' | apt-key add -'.format(key=key), shell=True, )
install: use new build key URL on ceph.com The new URL is on ceph.com and uses https.
ceph_ceph-deploy
train
py
94e69e9ac8c3827d8b0fa14f16f4b60dcdedddb9
diff --git a/concrete/blocks/express_entry_list/controller.php b/concrete/blocks/express_entry_list/controller.php index <HASH>..<HASH> 100644 --- a/concrete/blocks/express_entry_list/controller.php +++ b/concrete/blocks/express_entry_list/controller.php @@ -158,6 +158,7 @@ class Controller extends BlockController if ($pagination->haveToPaginate()) { $pagination = $pagination->renderDefaultView(); $this->set('pagination', $pagination); + $this->requireAsset('css', 'core/frontend/pagination'); } $this->set('list', $list);
Require pagination asset from express entry list block
concrete5_concrete5
train
php
593d0085b4010e69e1f4f689f424c275faddd3fe
diff --git a/lib/active_resource/base_ext.rb b/lib/active_resource/base_ext.rb index <HASH>..<HASH> 100644 --- a/lib/active_resource/base_ext.rb +++ b/lib/active_resource/base_ext.rb @@ -17,10 +17,5 @@ module ActiveResource connection.delete(element_path(id, options), headers) end end - - def self.build(attributes = {}) - attrs = self.format.decode(connection.get("#{new_element_path}", headers).body).merge(attributes) - self.new(attrs) - end end end
don't bother overriding ActiveResource::Base.build
Shopify_shopify_api
train
rb
5cf448a2fe9c6539a89e802f3843e66bceac6320
diff --git a/spec/bin_spec.rb b/spec/bin_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bin_spec.rb +++ b/spec/bin_spec.rb @@ -61,11 +61,14 @@ describe "the sortah executable" do end it "should print to STDOUT the location it intends to write the file" do - run_with('--dry-run', @email.to_s)[:result].should =~ %r|writing email to: /tmp/\.mail/foo/| + run_with('--dry-run', @email.to_s)[:result]. + should =~ %r|writing email to: /tmp/\.mail/foo/| end it "should write to the destination specified by #error_dest when an exception is raised during sorting" do - run_with('--dry-run', @failing_email.to_s)[:result].should =~ %r|writing email to: /tmp/\.mail/errors/| + run_with('--dry-run', @failing_email.to_s)[:result]. + should =~ %r|writing email to: /tmp/\.mail/errors/| + end end end end
clean up the lines on bin_spec so they aren't so long.
jfredett_sortah
train
rb
124af2dd5813027430316985271fdeaea8be9f27
diff --git a/pmxbot/util.py b/pmxbot/util.py index <HASH>..<HASH> 100644 --- a/pmxbot/util.py +++ b/pmxbot/util.py @@ -69,19 +69,12 @@ def splitem(query): >>> splitem('stuff: a, b, c') ['a', 'b', 'c'] """ - s = query.rstrip('?.!') - if ':' in s: - question, choices = s.rsplit(':', 1) - else: - choices = s + prompt, sep, query = query.rstrip('?.!').rpartition(':') - c = choices.split(',') - if ' or ' in c[-1]: - c = c[:-1] + c[-1].split(' or ') + choices = query.split(',') + choices[-1:] = choices[-1].split(' or ') - c = [x.strip() for x in c] - c = list(filter(None, c)) - return c + return [choice.strip() for choice in choices if choice.strip()] def open_url(url): headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) '
Simplify the implementation to just a few lines.
yougov_pmxbot
train
py
eefa85c74cead01ac3ac88b5cf1dc7947bb36b6f
diff --git a/lib/logan/client.rb b/lib/logan/client.rb index <HASH>..<HASH> 100644 --- a/lib/logan/client.rb +++ b/lib/logan/client.rb @@ -91,6 +91,13 @@ module Logan handle_response(response, Proc.new {|h| Logan::Person.new(h) }) end + def person(id) + response = self.class.get "/people/#{id}.json" + person = Logan::Person.new response + person.json_raw = response.body + person + end + private def all_projects response = self.class.get '/projects.json'
Add person (singular) to the client class.
birarda_logan
train
rb
27cdb5bdfe4abaaec6005145bbc29fec1cd7a3b6
diff --git a/eliot/_util.py b/eliot/_util.py index <HASH>..<HASH> 100644 --- a/eliot/_util.py +++ b/eliot/_util.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals from types import ModuleType -from six import exec_, text_type as unicode +from six import exec_, text_type as unicode, PY3 def safeunicode(o): @@ -52,9 +52,15 @@ def load_module(name, original_module): @return: A new, distinct module. """ module = ModuleType(name) - path = original_module.__file__ - if path.endswith(".pyc") or path.endswith(".pyo"): - path = path[:-1] - with open(path) as f: - exec_(f.read(), module.__dict__, module.__dict__) + if PY3: + import importlib.util + spec = importlib.util.find_spec(original_module.__name__) + source = spec.loader.get_code(original_module.__name__) + else: + path = original_module.__file__ + if path.endswith(".pyc") or path.endswith(".pyo"): + path = path[:-1] + with open(path) as f: + source = f.read() + exec_(source, module.__dict__, module.__dict__) return module
Support PyInstaller on Python 3.
itamarst_eliot
train
py
756bdc590e2761ca8e0bd364d32621e494f9c382
diff --git a/lib/aws/shared_credentials.rb b/lib/aws/shared_credentials.rb index <HASH>..<HASH> 100644 --- a/lib/aws/shared_credentials.rb +++ b/lib/aws/shared_credentials.rb @@ -44,8 +44,8 @@ module Aws end # @return [Boolean] Returns `true` if a credential file - # exists and has appropriate read permissions at {path}. - # @note This method does not indicate if the file found at {path} + # exists and has appropriate read permissions at {#path}. + # @note This method does not indicate if the file found at {#path} # will be parsable, only if it can be read. def loadable? !path.nil? && File.exists?(path) && File.readable?(path) diff --git a/lib/aws/signers/v4.rb b/lib/aws/signers/v4.rb index <HASH>..<HASH> 100644 --- a/lib/aws/signers/v4.rb +++ b/lib/aws/signers/v4.rb @@ -25,7 +25,7 @@ module Aws @region = region end - # @param [Seahorse::Client::Http::Request] request + # @param [Seahorse::Client::Http::Request] req # @return [Seahorse::Client::Http::Request] the signed request. def sign(req) datetime = Time.now.utc.strftime("%Y%m%dT%H%M%SZ")
Fixed a few yard warnings.
aws_aws-sdk-ruby
train
rb,rb
5956a14038240d34c2e8dc12694d1d5798fc27d2
diff --git a/src/Provider/AbstractProvider.php b/src/Provider/AbstractProvider.php index <HASH>..<HASH> 100644 --- a/src/Provider/AbstractProvider.php +++ b/src/Provider/AbstractProvider.php @@ -641,7 +641,13 @@ abstract class AbstractProvider return $parsed; } - return $content; + // Attempt to parse the string as JSON anyway, + // since some providers use non-standard content types. + try { + return $this->parseJson($content); + } catch (UnexpectedValueException $e) { + return $content; + } } /**
Always attempt to parse as JSON and fallback on failure
thephpleague_oauth2-client
train
php
83876ba9b85c5f53ad5cd5f8a4e97c4a58625a71
diff --git a/WrightTools/collection/_collection.py b/WrightTools/collection/_collection.py index <HASH>..<HASH> 100644 --- a/WrightTools/collection/_collection.py +++ b/WrightTools/collection/_collection.py @@ -37,7 +37,7 @@ class Collection(Group): def __next__(self): if self.__n < len(self): - out = self[self.__n] + out = self.item_names[self.__n] self.__n += 1 else: raise StopIteration
Collections next return key, rather than value (Closes #<I>) (#<I>)
wright-group_WrightTools
train
py
f26c620ee2f70ae63d25b42c6b9d23cff6e66cba
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -48,6 +48,7 @@ class Application extends Silex\Application $this['resources']->setApp($this); $this->initConfig(); + $this->initSession(); $this['resources']->initialize(); $this['debug'] = $this['config']->get('general/debug', false); @@ -61,12 +62,13 @@ class Application extends Silex\Application $this['jsdata'] = array(); } - /** - * Initialize the config and session providers. - */ protected function initConfig() { $this->register(new Provider\ConfigServiceProvider()); + } + + protected function initSession() + { $this->register( new Silex\Provider\SessionServiceProvider(), array(
Move config initialization to it's own method.
bolt_bolt
train
php
d802652896444faeb6856c1178dfe0092edffc0e
diff --git a/lib/ui/Modal.js b/lib/ui/Modal.js index <HASH>..<HASH> 100644 --- a/lib/ui/Modal.js +++ b/lib/ui/Modal.js @@ -1,6 +1,7 @@ -var React = require('react/addons'), - classnames = require('classnames'), - Tappable = require('react-tappable'); +var classnames = require('classnames'); + +var React = require('react/addons'); +var Tappable = require('react-tappable'); module.exports = React.createClass({ displayName: 'Modal', @@ -24,7 +25,7 @@ module.exports = React.createClass({ showModal: false }; }, - + getInitialState: function() { return { showModal: this.props.showModal @@ -34,7 +35,10 @@ module.exports = React.createClass({ // TODO: use ReactTransitionGroup to handle fade in/out componentDidMount: function() { var self = this; + setTimeout(function() { + if (!self.isMounted()) return + self.setState({ showModal: true }); }, 1); },
Modal: enforce modal is mounted for setState
touchstonejs_touchstonejs
train
js
ad2c8b7142dc042c881dd1896a9835a75c73af50
diff --git a/lib/tcp.js b/lib/tcp.js index <HASH>..<HASH> 100644 --- a/lib/tcp.js +++ b/lib/tcp.js @@ -10,19 +10,19 @@ function TCP(options) { // Start socket var sock; var successCallback = function () { + if(!sock.authorized) { + sock.end(); + return; + } + sock.setNoDelay(true); sock.on('data', sock.onchunk); sock.on('close', sock.onclose); sock.onopen(); }; - var certPath = path.join(__dirname, '..', 'include', 'flotype.crt'); - var certFile = fs.readFileSync(certPath); - var sslOptions = { - 'cert': certFile, - 'ca': certFile - }; + var sslOptions = {}; if(options.secure) { var connect = require('tls').connect;
remove references to old self-signed SSL cert from tcp.js
getbridge_bridge-js
train
js
165d72c0d8c33709501a6e7a8affd525beef13da
diff --git a/src/CommandPool.php b/src/CommandPool.php index <HASH>..<HASH> 100644 --- a/src/CommandPool.php +++ b/src/CommandPool.php @@ -82,7 +82,7 @@ class CommandPool implements PromisorInterface return (new self($client, $commands, $config)) ->promise() - ->then(function () use (&$results) { + ->then(static function () use (&$results) { ksort($results); return $results; }) @@ -96,7 +96,7 @@ class CommandPool implements PromisorInterface { $before = $this->getBefore($config); - return function ($command) use ($client, $before) { + return static function ($command) use ($client, $before) { if (!($command instanceof CommandInterface)) { throw new \InvalidArgumentException('Each value yielded by the ' . 'iterator must be an Aws\CommandInterface.'); @@ -104,6 +104,10 @@ class CommandPool implements PromisorInterface if ($before) { $before($command); } + // Add a delay to ensure execution on the next tick. + if (empty($command['@http']['delay'])) { + $command['@http']['delay'] = 0.0001; + } return $client->executeAsync($command); }; }
Using a delay in CommandPool to ensure future tick
aws_aws-sdk-php
train
php
1ec761ca4b0859c2f784162b194d19312a3e8d7e
diff --git a/src/CapabilityTrait.php b/src/CapabilityTrait.php index <HASH>..<HASH> 100644 --- a/src/CapabilityTrait.php +++ b/src/CapabilityTrait.php @@ -41,6 +41,7 @@ trait CapabilityTrait public static function getCapabilities($controllerName = null, array $actions = []) { $capabilitiesAccess = new CapabilitiesAccess(); + return $capabilitiesAccess->getCapabilities($controllerName, $actions); }
Fixed codestyle as per phpcs report
QoboLtd_cakephp-roles-capabilities
train
php
45015bd564395ab83ecc131ad6c46cad59056edf
diff --git a/Str.php b/Str.php index <HASH>..<HASH> 100644 --- a/Str.php +++ b/Str.php @@ -403,7 +403,7 @@ class Str public static function startsWith($haystack, $needles) { foreach ((array) $needles as $needle) { - if ($needle != '' && strpos((string) $haystack, (string) $needle) === 0) { + if ($needle != '' && substr($haystack, 0, strlen($needle)) === (string) $needle) { return true; } }
Revert changes to startsWith() (#<I>)
illuminate_support
train
php
1df9859c322c28bcfab27999d133dcb6ac53944d
diff --git a/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb b/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb index <HASH>..<HASH> 100644 --- a/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb +++ b/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb @@ -18,6 +18,7 @@ module Artsy def self.get_connection @mutex.synchronize do @connection ||= self.build_connection + @connection = self.build_connection if @connection.closed? end end
renegotiate connection if connection exists but is closed
artsy_artsy-eventservice
train
rb
daf8cc963bbfe8449aa1fb5e68614b259cb80941
diff --git a/app/models/agent.rb b/app/models/agent.rb index <HASH>..<HASH> 100644 --- a/app/models/agent.rb +++ b/app/models/agent.rb @@ -384,7 +384,7 @@ class Agent < ActiveRecord::Base agent.last_receive_at = Time.now agent.save! rescue => e - agent.error "Exception during receive: #{e.message} -- #{e.backtrace}" + agent.error "Exception during receive. #{e.message}: #{e.backtrace.join("\n")}" raise end end @@ -422,7 +422,7 @@ class Agent < ActiveRecord::Base agent.last_check_at = Time.now agent.save! rescue => e - agent.error "Exception during check: #{e.message} -- #{e.backtrace}" + agent.error "Exception during check. #{e.message}: #{e.backtrace.join("\n")}" raise end end
seperate error logs with new lines
huginn_huginn
train
rb
874e7e17407ab047d87ccb5739d73c8e8a938146
diff --git a/lib/ood_core/job/adapters/linux_host/launcher.rb b/lib/ood_core/job/adapters/linux_host/launcher.rb index <HASH>..<HASH> 100644 --- a/lib/ood_core/job/adapters/linux_host/launcher.rb +++ b/lib/ood_core/job/adapters/linux_host/launcher.rb @@ -75,7 +75,7 @@ class OodCore::Job::Adapters::LinuxHost::Launcher # find the sinit process for the tmux PID # kill the sinit process kill_cmd = <<~SCRIPT - kill $(pstree -p $(tmux list-panes -aF '#\{session_name} \#{pane_pid}' | grep '#{session_name}' | cut -f 2 -d ' ') | grep -Po 'sinit\\(\\d+' | grep -Po '[0-9]+') + kill $(pstree -p $(tmux list-panes -aF '#\{session_name} \#{pane_pid}' | grep '#{session_name}' | cut -f 2 -d ' ') | grep -o 'sinit([[:digit:]]*' | grep -o '[[:digit:]]*') SCRIPT call(*cmd, stdin: kill_cmd)
Remove requirement that grep dependency support -P flag
OSC_ood_core
train
rb
1c5e318c8cee7d712054d60314791aae6a7c27cb
diff --git a/packages/neos-ui-editors/src/Reference/index.js b/packages/neos-ui-editors/src/Reference/index.js index <HASH>..<HASH> 100644 --- a/packages/neos-ui-editors/src/Reference/index.js +++ b/packages/neos-ui-editors/src/Reference/index.js @@ -18,7 +18,7 @@ export default class ReferenceEditor extends PureComponent { value: PropTypes.string, commit: PropTypes.func.isRequired, options: PropTypes.shape({ - nodeTypes: PropTypes.arrayOf(PropTypes.string), + nodeTypes: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), placeholder: PropTypes.string, threshold: PropTypes.number }),
TASK: Adjust proptype validation for ReferenceEditor The nodetpye option in ReferenceEditor props can be a strig with a single nodetype as well as an array
neos_neos-ui
train
js