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
a30653a27e751536eff2c882bc54a609a85188f9
diff --git a/src/angular-materialize.js b/src/angular-materialize.js index <HASH>..<HASH> 100644 --- a/src/angular-materialize.js +++ b/src/angular-materialize.js @@ -767,6 +767,7 @@ // Internal Pagination Click Action function internalAction(scope, page) { + page = page.valueOf(); // Block clicks we try to load the active page if (scope.page == page) { return;
Fixed that the pagination-action sometimes returned an object, instead of a number. Fixes #<I> (again).
krescruz_angular-materialize
train
js
dbe649c69f084d3e9500fd1e07869392b5e1749e
diff --git a/spec/integration/ssh_spec.rb b/spec/integration/ssh_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/ssh_spec.rb +++ b/spec/integration/ssh_spec.rb @@ -39,25 +39,20 @@ describe Gas::Ssh do it 'should detect when an id_rsa is already in the .gas directory', :current => true do Gas::Ssh.corresponding_rsa_files_exist?(@uid).should be_true end - end describe "File System Changes..." do - before :all do - @gas_dir = File.expand_path('~/.gas') - @ssh_dir = File.expand_path('~/.ssh') - + # @gas_dir = File.expand_path('~/.gas') + # @ssh_dir = File.expand_path('~/.ssh') @nickname = "thisaccountmaybedeletedmysteriously" @name = "tim T" @email = "tim@timmy.com" - `rm #{@gas_dir}/#{@nickname}_id_rsa` - `rm #{@gas_dir}/#{@nickname}_id_rsa.pub` + #`rm #{@gas_dir}/#{@nickname}_id_rsa` + #`rm #{@gas_dir}/#{@nickname}_id_rsa.pub` Gas.delete(@nickname) - - # make sure that nickname isn't in use end
commented out some junk in a before filter that probably can be removed
walle_gas
train
rb
fc4927bcf6eacdf62a5b9f4d4198b93a3d347163
diff --git a/src/js/JSONEditor.js b/src/js/JSONEditor.js index <HASH>..<HASH> 100644 --- a/src/js/JSONEditor.js +++ b/src/js/JSONEditor.js @@ -171,7 +171,7 @@ function JSONEditor (container, options, json) { */ JSONEditor.modes = {} -// debounce interval for JSON schema vaidation in milliseconds +// debounce interval for JSON schema validation in milliseconds JSONEditor.prototype.DEBOUNCE_INTERVAL = 150 JSONEditor.VALID_OPTIONS = [
docs: Fix simple typo, vaidation -> validation (#<I>) There is a small typo in src/js/JSONEditor.js. Should read `validation` rather than `vaidation`.
josdejong_jsoneditor
train
js
ad8b9b885a1afb556fcf1af7c8b82539c02bef0a
diff --git a/src/Router.php b/src/Router.php index <HASH>..<HASH> 100644 --- a/src/Router.php +++ b/src/Router.php @@ -240,7 +240,7 @@ class Router { self::$errorCallback = function () { - var_dump(self::$uri); + /* Set errors */ }; }
Updated to version <I>
Josantonius_PHP-Router
train
php
368f0bf8f6314707764ac7648f1f68a32a87b0a9
diff --git a/user/index.php b/user/index.php index <HASH>..<HASH> 100644 --- a/user/index.php +++ b/user/index.php @@ -410,9 +410,9 @@ list($esql, $params) = get_enrolled_sql($context, null, $currentgroup, true); $joins = array("FROM {user} u"); $wheres = array(); -$mainuserfields = user_picture::fields('u', array('username', 'email', 'city', 'country', 'lang', 'timezone', 'maildisplay')); -$alreadyretrievedfields = explode(',', $mainuserfields); -$extrasql = get_extra_user_fields_sql($context, 'u', '', $alreadyretrievedfields); +$userfields = array('username', 'email', 'city', 'country', 'lang', 'timezone', 'maildisplay'); +$mainuserfields = user_picture::fields('u', $userfields); +$extrasql = get_extra_user_fields_sql($context, 'u', '', $userfields); if ($isfrontpage) { $select = "SELECT $mainuserfields, u.lastaccess$extrasql";
MDL-<I> user: Add duplicate field check to avoid oracle db error.
moodle_moodle
train
php
56d97038d4d4d09b4203c64e54411d037ca63eeb
diff --git a/elastic.js b/elastic.js index <HASH>..<HASH> 100644 --- a/elastic.js +++ b/elastic.js @@ -186,6 +186,8 @@ angular.module('monospaced.elastic', []) forceAdjust(); }); + $timeout(adjust); + /* * destroy */
restore inital run of adjust in timeout #<I>
monospaced_angular-elastic
train
js
1a675f48b3bb350a99e357375706f9a895eb0b95
diff --git a/src/pixi/display/MovieClip.js b/src/pixi/display/MovieClip.js index <HASH>..<HASH> 100644 --- a/src/pixi/display/MovieClip.js +++ b/src/pixi/display/MovieClip.js @@ -73,6 +73,23 @@ PIXI.MovieClip.prototype = Object.create( PIXI.Sprite.prototype ); PIXI.MovieClip.prototype.constructor = PIXI.MovieClip; /** +* [read-only] totalFrames is the total number of frames in the MovieClip. This is the same as number of textures +* assigned to the MovieClip. +* +* @property totalFrames +* @type Number +* @default 0 +* @readOnly +*/ +Object.defineProperty( PIXI.MovieClip.prototype, 'totalFrames', { + get: function() { + + return this.textures.length; + } +}); + + +/** * Stops the MovieClip * * @method stop
Added totalframes to MovieClip
drkibitz_node-pixi
train
js
6afc6ade28b073af2e53022316ada6a838b41815
diff --git a/src/main/java/org/influxdb/dto/Point.java b/src/main/java/org/influxdb/dto/Point.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/influxdb/dto/Point.java +++ b/src/main/java/org/influxdb/dto/Point.java @@ -276,11 +276,11 @@ public class Point { } if (column.tag()) { - if(fieldValue != null) { + if (fieldValue != null) { this.tags.put(fieldName, (String) fieldValue); } } else { - if(fieldValue != null) { + if (fieldValue != null) { this.fields.put(fieldName, fieldValue); } }
Fixing build Adding space after if
influxdata_influxdb-java
train
java
4db0c622111a8598831de14cf6de44942b78acdd
diff --git a/src/Embera/Provider/Altru.php b/src/Embera/Provider/Altru.php index <HASH>..<HASH> 100755 --- a/src/Embera/Provider/Altru.php +++ b/src/Embera/Provider/Altru.php @@ -52,6 +52,7 @@ class Altru extends ProviderAdapter implements ProviderInterface /** inline {@inheritdoc} */ public function getFakeResponse() { + $embedUrl = ''; if (preg_match('~answer_id=([0-9]+)~i', (string) $this->url, $matches)) { $embedUrl = 'https://api.altrulabs.com/api/v1/social/embed_player/' . $matches['1']; } else if (preg_match('~/player/([0-9]+)~i', (string) $this->url, $matches)) {
Added missing vars on Altru provider
mpratt_Embera
train
php
67cff7e30440b2fb7de6980c886b766edf044447
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,7 @@ import path from 'path'; import MagicString from 'magic-string'; import { createFilter } from 'rollup-pluginutils'; -const componentRegex = /@Component\({([\s\S]*)}\)$/gm; +const componentRegex = /@Component\(\s?{([\s\S]*)}\s?\)$/gm; const templateUrlRegex = /templateUrl\s*:(.*)/g; const styleUrlsRegex = /styleUrls\s*:(\s*\[[\s\S]*?\])/g; const stringRegex = /(['"])((?:[^\\]\\\1|.)*?)\1/g;
Accept whitespace before braces in @Component (#<I>) * Accept whitespace before braces in @Component Change componentRegex to also accept a single whitespace before { and after } to support further coding styles * Reset package version
cebor_rollup-plugin-angular
train
js
8ed5d8f64024ab0e88a2a38c85666733ae8986b8
diff --git a/demo/demo-scriptinclude.js b/demo/demo-scriptinclude.js index <HASH>..<HASH> 100755 --- a/demo/demo-scriptinclude.js +++ b/demo/demo-scriptinclude.js @@ -10,8 +10,16 @@ function init() { foucTarget && (foucTarget.className = ''); // Add the card container listeners, using the necessary event trigger - document.body.dispatchEvent(new CustomEvent('cardstrap', { detail: '.container'})); + document.body.dispatchEvent(new CustomEvent('cardstrap', { + detail: '.container' + })); + + // Listen for any events coming out of evented components + eventedElement.addEventListener('card-comment', function(e) { + console.info(`${e.detail.username} says "${e.detail.comment}"`); + }); + // Initialize the card instances // Data in detail objects could come from a service endpoint eventedElement.dispatchEvent(new CustomEvent('initCard', {
feat(demo): Add event listener for card comments.
aaronkaka_es6-react-component
train
js
946850962697b02c2d03701396fdc4d517ba4bfb
diff --git a/src/Silex/Util/Compiler.php b/src/Silex/Util/Compiler.php index <HASH>..<HASH> 100644 --- a/src/Silex/Util/Compiler.php +++ b/src/Silex/Util/Compiler.php @@ -82,7 +82,8 @@ class Compiler $phar->stopBuffering(); - // $phar->compressFiles(\Phar::GZ); + // FIXME: phar compression feature is not yet implemented + //$phar->compressFiles(\Phar::GZ); unset($phar); }
Make reason of prenatal code visible. Code is commented since ages, the reason is missing (because there is a reason).
silexphp_Silex
train
php
8c06a313ba0a2b22e6f92ceb2ede4a0f74f8b0f9
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php @@ -476,6 +476,7 @@ class Handler implements BaseContentTypeHandler * field (default) values. * * @param mixed $contentTypeId + * @param int $status One of Type::STATUS_DEFINED|Type::STATUS_DRAFT|Type::STATUS_MODIFIED * @param \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition * @return void */
Fixed: missing param in phpdoc
ezsystems_ezpublish-kernel
train
php
b06b7055f891d755f47054ae438a107af048ff12
diff --git a/Eloquent/Model.php b/Eloquent/Model.php index <HASH>..<HASH> 100644 --- a/Eloquent/Model.php +++ b/Eloquent/Model.php @@ -8,12 +8,10 @@ use JsonSerializable; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Routing\UrlRoutable; use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Database\Eloquent\Relations\Pivot; -use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\ConnectionResolverInterface as Resolver;
Remove useless imports. (#<I>)
illuminate_database
train
php
ba2f7619d1088b7c0e2e64685cd4ec273af4dc10
diff --git a/eZ/Publish/API/REST/Server/View/Visitor.php b/eZ/Publish/API/REST/Server/View/Visitor.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/REST/Server/View/Visitor.php +++ b/eZ/Publish/API/REST/Server/View/Visitor.php @@ -44,7 +44,16 @@ class Visitor extends RMF\View */ public function display( RMF\Request $request, $result ) { - $message = $this->visitor->visit( $result ); + if ( $result === null ) + { + $message = new Common\Message( + array( 'Status' => '200 No content', ) + ); + } + else + { + $message = $this->visitor->visit( $result ); + } foreach ( $message->headers as $name => $value ) {
Implemented: Correct handling of empty bodies. The visitor now automatically detects if the return value of a controller is null and then sends the correct "<I> No Content" header. This solves the issue of "No Content" for now, let's see if we need additional header handling from the controller side.
ezsystems_ezpublish-kernel
train
php
15d2ffb2df259b89f54762a990a1aef24d10b681
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/method/misc/OSQLMethodFormat.java b/core/src/main/java/com/orientechnologies/orient/core/sql/method/misc/OSQLMethodFormat.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/method/misc/OSQLMethodFormat.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/method/misc/OSQLMethodFormat.java @@ -42,8 +42,8 @@ public class OSQLMethodFormat extends OAbstractSQLMethod { final Object v = getParameterValue(iRecord, iMethodParams[0].toString()); if (v != null) { - if (ioResult instanceof Long) - ioResult = new Date((Long) ioResult); + if (ioResult instanceof Number) + ioResult = new Date(((Long) ioResult).longValue()); if (ioResult instanceof Date) { final SimpleDateFormat format = new SimpleDateFormat(v.toString());
.format(): supported conversion from any Number
orientechnologies_orientdb
train
java
5746e62f4d1d4829ba110b2c1c770ad7b09ced46
diff --git a/androguard/core/bytecodes/apk.py b/androguard/core/bytecodes/apk.py index <HASH>..<HASH> 100644 --- a/androguard/core/bytecodes/apk.py +++ b/androguard/core/bytecodes/apk.py @@ -1024,7 +1024,7 @@ class APK: ] def is_tag_matched(self, tag, **attribute_filter): - """ + r""" Return true if the attributes matches in attribute filter. An attribute filter is a dictionary containing: {attribute_name: value}.
fixs docstring in issue #<I> by pyupgrade
androguard_androguard
train
py
cf8f4e69572af0b6b47648f8d371af4576cd97ea
diff --git a/java/client/src/org/openqa/selenium/SessionNotCreatedException.java b/java/client/src/org/openqa/selenium/SessionNotCreatedException.java index <HASH>..<HASH> 100644 --- a/java/client/src/org/openqa/selenium/SessionNotCreatedException.java +++ b/java/client/src/org/openqa/selenium/SessionNotCreatedException.java @@ -24,4 +24,8 @@ public class SessionNotCreatedException extends WebDriverException { public SessionNotCreatedException(String msg) { super(msg); } + + public SessionNotCreatedException(String msg, Throwable cause) { + super(message, cause); + } }
adding ability to pass Throwable to creating SessionNotCreatedException ~ desired by ios-driver
SeleniumHQ_selenium
train
java
e22b71621233b2ceab9857be32033812ec8c25f5
diff --git a/lib/ui/modal/modal.js b/lib/ui/modal/modal.js index <HASH>..<HASH> 100644 --- a/lib/ui/modal/modal.js +++ b/lib/ui/modal/modal.js @@ -237,15 +237,17 @@ proto.hide = function() { + var self = this; + var deferred = $q.defer(); this.templatePromise.then(function() { - this.$element.one('hidden.bs.modal', function() { + self.$element.one('hidden.bs.modal', function() { deferred.resolve(true); }); - this.$element.modal('hide'); + self.$element.modal('hide'); });
changed hide to reference self instead of this.
Availity_availity-angular
train
js
aab91b1309a2afcfca2a20dc3e454fb1dd61858a
diff --git a/Framework/DoozR/Di/Factory.php b/Framework/DoozR/Di/Factory.php index <HASH>..<HASH> 100644 --- a/Framework/DoozR/Di/Factory.php +++ b/Framework/DoozR/Di/Factory.php @@ -48,7 +48,7 @@ * @author Benjamin Carl <opensource@clickalicious.de> * @copyright 2012 - 2013 Benjamin Carl * @license http://www.opensource.org/licenses/bsd-license.php The BSD License - * @version Git: $Id: $ + * @version Git: $Id: 618b341e3281f9f88aa0a0e84a4778959303b18a $ * @link https://github.com/clickalicious/Di * @see - * @since -
fixed: Wrong hash placeholder
Doozer-Framework_Doozr
train
php
38be73e8e42ed276fedf859757c5732115643298
diff --git a/lfs/lfs.go b/lfs/lfs.go index <HASH>..<HASH> 100644 --- a/lfs/lfs.go +++ b/lfs/lfs.go @@ -17,10 +17,6 @@ import ( "github.com/rubyist/tracerx" ) -var ( - LargeSizeThreshold = 5 * 1024 * 1024 -) - // LocalMediaDir returns the root of lfs objects func LocalMediaDir() string { if localstorage.Objects() != nil {
lfs: remove unused LargeSizeThreshold constant The constant was introduced in dca7f<I> ("really basic pre-commit hook that rejects commits with files > 5MB", <I>-<I>-<I>) and is not used anymore. Cleanup the code and remove it.
git-lfs_git-lfs
train
go
5af65da4096ce2d7694d825f362f202cd4752414
diff --git a/api/register.go b/api/register.go index <HASH>..<HASH> 100644 --- a/api/register.go +++ b/api/register.go @@ -172,7 +172,7 @@ func (this *EngineGroup) getHandlerImp(handler APIHandler) gin.HandlerFunc { session.Save(c.Request, c.Writer) switch context.code { case unresolvedCode: - c.AbortWithStatus(http.StatusNoContent) + c.AbortWithStatus(http.StatusInternalServerError) case http.StatusMovedPermanently: c.Redirect(context.code, context.ret.(string)) case http.StatusTemporaryRedirect:
change unresolved statuscode StatusNoContent -> StatusInternalServerError
blackss2_utility
train
go
bd2ea8670f648a2672ab504e139f30807a605ada
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor/widgets/codeeditor.py +++ b/spyder/plugins/editor/widgets/codeeditor.py @@ -2043,6 +2043,7 @@ class CodeEditor(TextEditBaseWidget): self.highlight_line_warning(block_data) def highlight_line_warning(self, block_data): + """Highlight errors and warnings in this editor.""" self.clear_extra_selections('code_analysis_highlight') self.__highlight_selection('code_analysis_highlight', block_data.selection,
Add docstring for highlight_line_warning
spyder-ide_spyder
train
py
65edc87f42a70f634051cd332db7cc27d8777a1f
diff --git a/spyderlib/widgets/externalshell/namespacebrowser.py b/spyderlib/widgets/externalshell/namespacebrowser.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/externalshell/namespacebrowser.py +++ b/spyderlib/widgets/externalshell/namespacebrowser.py @@ -39,7 +39,8 @@ class NamespaceBrowser(QWidget): self.shellwidget = None self.is_internal_shell = None - self.is_visible = False + + self.is_visible = True # Do not modify: light mode won't work! self.setup_in_progress = None
Spyder light mode's variable explorer was broken: fixed!
spyder-ide_spyder
train
py
8658b2934aa4c5f25971fded82c79425e3f61293
diff --git a/src/Http/ContentDelivery/PageBuilder/SnippetTransformation/PricesJsonSnippetTransformation.php b/src/Http/ContentDelivery/PageBuilder/SnippetTransformation/PricesJsonSnippetTransformation.php index <HASH>..<HASH> 100644 --- a/src/Http/ContentDelivery/PageBuilder/SnippetTransformation/PricesJsonSnippetTransformation.php +++ b/src/Http/ContentDelivery/PageBuilder/SnippetTransformation/PricesJsonSnippetTransformation.php @@ -4,7 +4,6 @@ namespace LizardsAndPumpkins\Http\ContentDelivery\PageBuilder\SnippetTransformat use LizardsAndPumpkins\Http\ContentDelivery\PageBuilder\PageSnippets; use LizardsAndPumpkins\Context\Context; -use LizardsAndPumpkins\Http\ContentDelivery\PageBuilder\SnippetTransformation\SnippetTransformation; /** * @todo remove when product listing uses ProductJsonServiceProvider
Issue #<I>: Remove unused import
lizards-and-pumpkins_catalog
train
php
e99d75f4fd9043b37e034022760058302925e372
diff --git a/linkedin/linkedin.py b/linkedin/linkedin.py index <HASH>..<HASH> 100644 --- a/linkedin/linkedin.py +++ b/linkedin/linkedin.py @@ -15,6 +15,7 @@ from .utils import enum, to_utf8, raise_for_error, json, StringIO __all__ = ['LinkedInAuthentication', 'LinkedInApplication', 'PERMISSIONS'] PERMISSIONS = enum('Permission', + COMPANY_ADMIN='rw_company_admin', BASIC_PROFILE='r_basicprofile', FULL_PROFILE='r_fullprofile', EMAIL_ADDRESS='r_emailaddress',
Added rw_company_admin permission This perimission is missing. It's documented here <URL>
ozgur_python-linkedin
train
py
17136475eb31fc99c6aa067161b193135aecfe2e
diff --git a/jquery.powertip.js b/jquery.powertip.js index <HASH>..<HASH> 100644 --- a/jquery.powertip.js +++ b/jquery.powertip.js @@ -101,8 +101,12 @@ }, mouseleave: function() { if (tipElement.data('mouseOnToPopup')) { - cancelHoverTimer(session.activeHover); - setHoverTimer(session.activeHover, 'hide'); + // check activeHover in case the mouse cursor entered + // the tooltip during the fadeOut and close cycle + if (session.activeHover) { + cancelHoverTimer(session.activeHover); + setHoverTimer(session.activeHover, 'hide'); + } session.mouseTarget = null; } }
Added check for activeHover on tip mouseleave. Solves edge case where the mouse cursor enters the tooltip during the fadeOut cycle, causing an undefined error when the fadeOut completes and the mouseout fires.
stevenbenner_jquery-powertip
train
js
ff53a61c3c9f26660eed69c7eae5441ba0438d89
diff --git a/app.js b/app.js index <HASH>..<HASH> 100644 --- a/app.js +++ b/app.js @@ -91,7 +91,7 @@ mongoose.connection.on('error', function (err) { }); mongoose.connection.on('disconnected', function() { - mongoose.connect(settings.mongoURI); + throw new Error('Could not connect to database'); }); //
Throw exception if mongo cannot be reached
sdelements_lets-chat
train
js
f048234938012c1cb82ccdadca93e8374fbf9f6a
diff --git a/mockserver-core/src/main/java/org/mockserver/mock/action/ExpectationForwardCallback.java b/mockserver-core/src/main/java/org/mockserver/mock/action/ExpectationForwardCallback.java index <HASH>..<HASH> 100644 --- a/mockserver-core/src/main/java/org/mockserver/mock/action/ExpectationForwardCallback.java +++ b/mockserver-core/src/main/java/org/mockserver/mock/action/ExpectationForwardCallback.java @@ -16,7 +16,9 @@ public interface ExpectationForwardCallback extends ExpectationCallback<HttpRequ * @param httpRequest the request that satisfied the expectation condition * @return the request that will be proxied */ - HttpRequest handle(HttpRequest httpRequest) throws Exception; + default HttpRequest handle(HttpRequest httpRequest) throws Exception { + return httpRequest; + } /** * Called for every response received from a proxied request, the return
adding default implementation for all methods so only the required ones need to be implemented
jamesdbloom_mockserver
train
java
ddf1281c7911aa10103c3c224b0cdf1cdc378a10
diff --git a/server/Publish.rb b/server/Publish.rb index <HASH>..<HASH> 100644 --- a/server/Publish.rb +++ b/server/Publish.rb @@ -80,7 +80,7 @@ class Dbus_actuator < DBus::Object def define_dbus_methods(methods) methdef = "dbus_interface 'org.openplacos.server.actuator' do \n " - methdef += "dbus_method :state, 'out return:a{sv}' do \n return @act.state \n end \n" + methdef += "dbus_method :state, 'out return:a{sv}' do \n return [@act.state] \n end \n" methods.each_value { |name| methdef += "dbus_method :" + name + ", 'out return:v' do \n return @act." + name + " \n end \n " } diff --git a/server/Top.rb b/server/Top.rb index <HASH>..<HASH> 100755 --- a/server/Top.rb +++ b/server/Top.rb @@ -128,7 +128,7 @@ class Top # store config if not done before $database.store_config( @drivers, @measures, @actuators) else - $database = nil + #$database = nil end
patch for state method and $database error
openplacos_openplacos
train
rb,rb
0f7f158e46732d13a14fadbca4d885e6ea6762f0
diff --git a/cpp_coveralls/coverage.py b/cpp_coveralls/coverage.py index <HASH>..<HASH> 100644 --- a/cpp_coveralls/coverage.py +++ b/cpp_coveralls/coverage.py @@ -311,7 +311,7 @@ def collect(args): src_report['coverage'] = parse_gcov_file(fobj) src_files[src_path] = combine_reports(src_files.get(src_path), src_report) - report['source_files'] = src_files.values() + report['source_files'] = list(src_files.values()) # Also collects the source files that have no coverage reports. report['source_files'].extend( collect_non_report_files(args, discovered_files))
Fixed issue with python 3 returning a view
eddyxu_cpp-coveralls
train
py
bd348e212adbcd57b4ce2fa425c70ddc11e9ce10
diff --git a/Task/Generate.php b/Task/Generate.php index <HASH>..<HASH> 100644 --- a/Task/Generate.php +++ b/Task/Generate.php @@ -207,6 +207,15 @@ class Generate extends Base { * a key $property_name if data has been supplied for this property. */ protected function setComponentDataPropertyDefault($property_name, $property_info, &$component_data_local) { + // Don't clobber a default value that's already been set. This can happen + // if a parent property sets a default value for a child item. + // TODO: consider whether the child item should win if it has a default + // value or callback of its own -- or indeed if this combination ever + // happens. + if (isset($component_data_local[$property_name])) { + return; + } + // During the prepare stage, we always want to provide a default, for the // convenience of the user in the UI. if (isset($property_info['default'])) {
Fixed defaults set by parent properties into child items getting clobbered by child item setting defaults.
drupal-code-builder_drupal-code-builder
train
php
cc84f37951300ef6783a454165bdc5fae02ca5b0
diff --git a/spec/unit/provider/directory_spec.rb b/spec/unit/provider/directory_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/provider/directory_spec.rb +++ b/spec/unit/provider/directory_spec.rb @@ -47,6 +47,9 @@ describe Chef::Provider::Directory do end describe "scanning file security metadata on unix" do + before do + Chef::Platform.stub!(:windows?).and_return(false) + end let(:mock_stat) do cstats = mock("stats") cstats.stub!(:uid).and_return(500)
Stub windows detection in directory spec.
chef_chef
train
rb
3cf8b620ee1db936a418ad2ae89237b17cdc4365
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open('requirements.txt') as f: setup( name='pyicloud', - version='0.7.0', + version='0.7.1', url='https://github.com/picklepete/pyicloud', description=( 'PyiCloud is a module which allows pythonistas to '
Release <I>; Validates Apple's server certificate (to eliminate an emitted warning).
picklepete_pyicloud
train
py
11c8cc2b6114d7c0a015273498fd5d63f725d305
diff --git a/src/services/EmailService.php b/src/services/EmailService.php index <HASH>..<HASH> 100644 --- a/src/services/EmailService.php +++ b/src/services/EmailService.php @@ -2,7 +2,7 @@ namespace app\email\services; -use infuse\Util; +use infuse\Utility as U; use App; @@ -22,8 +22,8 @@ class EmailService { $this->app = $app; - $this->fromEmail = Util::array_value( $settings, 'from_email' ); - $this->fromName = Util::array_value( $settings, 'from_name' ); + $this->fromEmail = U::array_value( $settings, 'from_email' ); + $this->fromName = U::array_value( $settings, 'from_name' ); if ($settings[ 'type' ] == 'smtp') { $transport = \Swift_SmtpTransport::newInstance( $settings[ 'host' ], $settings[ 'port' ] )
renamed infuse/Util to Utility
infusephp_email
train
php
918dd54a721458f46888ef8beb2c8f9b2911dee0
diff --git a/handler/src/main/java/io/netty/handler/stream/ChunkedInput.java b/handler/src/main/java/io/netty/handler/stream/ChunkedInput.java index <HASH>..<HASH> 100644 --- a/handler/src/main/java/io/netty/handler/stream/ChunkedInput.java +++ b/handler/src/main/java/io/netty/handler/stream/ChunkedInput.java @@ -37,7 +37,7 @@ public interface ChunkedInput<B> { /** * Fetches a chunked data from the stream. Once this method returns the last chunk * and thus the stream has reached at its end, any subsequent {@link #isEndOfInput()} - * call must return {@code false}. + * call must return {@code true}. * * @return the fetched chunk. * {@code null} if there is no data left in the stream.
[#<I>] Correct javadoc of ChunkedInput
netty_netty
train
java
01e03ca10a9fe5f4cc4c466e12921a94190a19fa
diff --git a/ipywidgets/widgets/widget.py b/ipywidgets/widgets/widget.py index <HASH>..<HASH> 100644 --- a/ipywidgets/widgets/widget.py +++ b/ipywidgets/widgets/widget.py @@ -266,6 +266,12 @@ class Widget(LoggingConfigurable): """Return (state_without_buffers, state_with_buffers, buffer_paths, buffers) for binary message parts state_with_buffers is a dict where any of it's decendents is is a binary_type. + + As an example: + >>> state = {'plain': [0, 'text'], 'x': {'ar': memoryview(ar1)}, 'y': {shape: (10,10), data: memoryview(ar2)}} + >>> widget._split_state_buffers(state) + ({'plain': [0, 'text']}, {'x': {}, 'y': {'shape': (10, 10)}}, [['x', 'ar'], ['y', 'data']], + [<memory at 0x107ffec48>, <memory at 0x107ffed08>]) """ def seperate_buffers(substate, path, buffer_paths, buffers): # remove binary types from dicts and lists, and keep there key, e.g. {'x': {'ar': ar}, 'y': [ar2, ar3]}
better docstring for _split_state_buffers
jupyter-widgets_ipywidgets
train
py
a8502a18fbbdb0d03087226557280441dcc29b75
diff --git a/admin/cron.php b/admin/cron.php index <HASH>..<HASH> 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -20,6 +20,7 @@ echo "<pre>\n"; $timenow = time(); + echo "Server Time: ".date('r',$timenow)."\n\n"; /// Run all cron jobs for each module
Output the time in the cron output
moodle_moodle
train
php
c3d8fdffc8d3708f656d3155e31e616be9f82dcd
diff --git a/lib/HotModuleReplacementPlugin.js b/lib/HotModuleReplacementPlugin.js index <HASH>..<HASH> 100644 --- a/lib/HotModuleReplacementPlugin.js +++ b/lib/HotModuleReplacementPlugin.js @@ -153,7 +153,7 @@ module.exports = class HotModuleReplacementPlugin { const buf = [source]; buf.push(""); buf.push("// __webpack_hash__"); - buf.push(`${this.requireFn}.h = () => hotCurrentHash`); + buf.push(this.requireFn + ".h = function() { return hotCurrentHash; };"); return this.asString(buf); });
- Fix bug while refactoring HotModuleReplacementPlugin as suggested in PR
webpack_webpack
train
js
af478a90b0bce8d777c1e15735f8760a29f96ca2
diff --git a/p2p/muxer/yamux/transport.go b/p2p/muxer/yamux/transport.go index <HASH>..<HASH> 100644 --- a/p2p/muxer/yamux/transport.go +++ b/p2p/muxer/yamux/transport.go @@ -2,6 +2,7 @@ package sm_yamux import ( "io/ioutil" + "math" "net" "github.com/libp2p/go-libp2p-core/network" @@ -24,7 +25,9 @@ func init() { // We always run over a security transport that buffers internally // (i.e., uses a block cipher). config.ReadBufSize = 0 - config.MaxIncomingStreams = 256 + // Effectively disable the incoming streams limit. + // This is now dynamically limited by the resource manager. + config.MaxIncomingStreams = math.MaxUint32 DefaultTransport = (*Transport)(config) }
disable the incoming streams limit (#<I>) This is now handled by the resource manager.
libp2p_go-libp2p
train
go
5d3fdbf7c203b05e13edab7b4f9981b19877f368
diff --git a/src/ComposerPlugin.php b/src/ComposerPlugin.php index <HASH>..<HASH> 100644 --- a/src/ComposerPlugin.php +++ b/src/ComposerPlugin.php @@ -20,6 +20,8 @@ use Composer\IO\IOInterface; use Composer\Plugin\PluginInterface; use Composer\Script\Event; use Composer\Script\ScriptEvents; +use Composer\Util\ProcessExecutor; +use Symfony\Component\Process\ExecutableFinder; /** Plugin for PHP composer to automatically update the autoload map whenever * dependencies are changed or updated. @@ -58,6 +60,10 @@ final class ComposerPlugin */ public function onPostAutoloadDump(Event $event) { $args = $event->isDevMode() ? '' : ' --no-dev'; - shell_exec('hhvm '.escapeshellarg($this->vendor.'/bin/hh-autoload').$args); + $finder = new ExecutableFinder(); + $hhvm = $finder->find('hhvm', 'hhvm'); + $executor = new ProcessExecutor($this->io); + $command = $hhvm . ' ' . ProcessExecutor::escape($this->vendor.'/bin/hh-autoload') . $args; + $executor->execute($command); } }
Update ComposerPlugin.php (#<I>)
hhvm_hhvm-autoload
train
php
1c5d8e5242283e4a5f397f802103a05140ced909
diff --git a/test/test.py b/test/test.py index <HASH>..<HASH> 100644 --- a/test/test.py +++ b/test/test.py @@ -27,7 +27,7 @@ for entry in os.listdir(sys.argv[1]): # Run the test. test_fname = gold_fname[:-len(suffix):] + '.py' command = '%s %s'%(sys.executable, test_fname) - #print(command) + print(command) p = Popen(command, shell=True, stdout=PIPE, stderr=STDOUT) test_lines = p.stdout.readlines()
Echo command to stdout.
vmlaker_mpipe
train
py
233c6807751d38ddebcb3af2a70dd4a1df835959
diff --git a/worker/provisioner/container_initialisation_test.go b/worker/provisioner/container_initialisation_test.go index <HASH>..<HASH> 100644 --- a/worker/provisioner/container_initialisation_test.go +++ b/worker/provisioner/container_initialisation_test.go @@ -177,12 +177,16 @@ func (s *ContainerSetupSuite) TestContainerProvisionerStarted(c *gc.C) { } } -func (s *ContainerSetupSuite) TestKvmContainerUsesConstraintsArch(c *gc.C) { +func (s *ContainerSetupSuite) TestLxcContainerUsesConstraintsArch(c *gc.C) { + // LXC should override the architecture in constraints with the + // host's architecture. s.PatchValue(&version.Current.Arch, arch.PPC64EL) s.testContainerConstraintsArch(c, instance.LXC, arch.PPC64EL) } -func (s *ContainerSetupSuite) TestLxcContainerUsesHostArch(c *gc.C) { +func (s *ContainerSetupSuite) TestKvmContainerUsesHostArch(c *gc.C) { + // KVM should do what it's told, and use the architecture in + // constraints. s.PatchValue(&version.Current.Arch, arch.PPC64EL) s.testContainerConstraintsArch(c, instance.KVM, arch.AMD64) }
worker/provisioner: fix test names
juju_juju
train
go
8367735063eaa12bd42ae71b8922119ce747f4c6
diff --git a/salt/client/ssh/state.py b/salt/client/ssh/state.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/state.py +++ b/salt/client/ssh/state.py @@ -184,10 +184,10 @@ def prep_trans_tar(opts, file_client, chunks, file_refs, pillar=None, id_=None): if id_ is None: id_ = '' try: - cachedir = os.path.join(opts['cachedir'], 'salt-ssh', id_).rstrip(os.sep) + cachedir = os.path.join('salt-ssh', id_).rstrip(os.sep) except AttributeError: # Minion ID should always be a str, but don't let an int break this - cachedir = os.path.join(opts['cachedir'], 'salt-ssh', str(id_)).rstrip(os.sep) + cachedir = os.path.join('salt-ssh', str(id_)).rstrip(os.sep) for saltenv in file_refs: # Location where files in this saltenv will be cached
allow file_client to figure out cachedir We do not need to specify the entire path here. _cache_loc in salt.fileclient will do that for us. If we specify cachedir here, it will use the /var/tmp/*/running_data/var/cache path which we do not want to use when on the master. This is intelligent enough to use the /var/tmp path on the minion and a /var/cache/salt/master type path on the master. Fixes #<I>
saltstack_salt
train
py
e4f007f38b2ac11bc9cf23ab115dc51d6393535f
diff --git a/src/Configurator/Helpers/RulesHelper.php b/src/Configurator/Helpers/RulesHelper.php index <HASH>..<HASH> 100644 --- a/src/Configurator/Helpers/RulesHelper.php +++ b/src/Configurator/Helpers/RulesHelper.php @@ -44,8 +44,6 @@ abstract class RulesHelper } $k = ''; - - // Look into each matrix whether current tag is allowed as child/descendant foreach ($matrix as $tagMatrix) { $k .= $tagMatrix['allowedChildren'][$tagName];
Removed comment [ci skip]
s9e_TextFormatter
train
php
0067eee9f005296ac60a30c3ad5de17b9438200f
diff --git a/ailment/analyses/simplifier.py b/ailment/analyses/simplifier.py index <HASH>..<HASH> 100644 --- a/ailment/analyses/simplifier.py +++ b/ailment/analyses/simplifier.py @@ -1,6 +1,7 @@ from angr import Analysis, register_analysis from angr.analyses.reaching_definitions import OP_AFTER +from angr.analyses.reaching_definitions.external_codeloc import ExternalCodeLocation from ..block import Block from ..statement import Assignment @@ -72,7 +73,8 @@ class Simplifier(Analysis): used_tmp_indices = set(rd.one_result.tmp_uses.keys()) dead_virgins = rd.one_result._dead_virgin_definitions - dead_virgins_stmt_idx = set([ d.codeloc.stmt_idx for d in dead_virgins ]) + dead_virgins_stmt_idx = set([ d.codeloc.stmt_idx for d in dead_virgins + if not isinstance(d.codeloc, ExternalCodeLocation) ]) for idx, stmt in enumerate(block.statements): if type(stmt) is Assignment:
Fix a bug where statements are incorrectly removed because we do not differentiate between internal codelocs and external codelocs.
angr_ailment
train
py
2645f502b731c89767c92ab0ee72a27e81e7d5dd
diff --git a/gspread/models.py b/gspread/models.py index <HASH>..<HASH> 100644 --- a/gspread/models.py +++ b/gspread/models.py @@ -1596,7 +1596,7 @@ class Worksheet(object): .. _ValueInputOption: https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption """ - return self.insert_rows([values], index, value_input_option='RAW') + return self.insert_rows([values], index, value_input_option=value_input_option) def insert_rows(self, values, row=1, value_input_option='RAW'): """Adds multiple rows to the worksheet at the specified index and
Fixed a bug with insert_row Regardless of what the end user put as `value_input_option`, it always resulted in "RAW"
burnash_gspread
train
py
9b86b3ddd3b18605d5f95887a0226732d58eaaad
diff --git a/nfc/dev/pn53x.py b/nfc/dev/pn53x.py index <HASH>..<HASH> 100644 --- a/nfc/dev/pn53x.py +++ b/nfc/dev/pn53x.py @@ -476,7 +476,7 @@ class Device(nfc.dev.Device): pollrq = "\x00\xFF\xFF\x00\x03" nfcid3 = "\x01\xfe" + os.urandom(8) - for mode, speed in (("active", "424"), ("passive", "424")): + for mode, speed in (("passive", "424"), ("active", "424")): try: rsp = self.chipset.in_jump_for_dep( mode, speed, pollrq, nfcid3, general_bytes)
poll first for NFC-DEP passive, then active mode
nfcpy_nfcpy
train
py
f7087ee8b839a5509c15807d9ff478e2dce884db
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -28,9 +28,15 @@ var HeaderSet = require('./header-set'); var Logger = require('./logger'); var Connection = require('./connection'); +var SerialConnection = require('./serial-connection'); var TcpConnection = require('./tcp-connection'); +var DataSource = require('./data-source'); +var SerialDataSource = require('./serial-data-source'); +var TcpDataSource = require('./tcp-data-source'); + var DataSourceProvider = require('./data-source-provider'); +var SerialDataSourceProvider = require('./serial-data-source-provider'); var TcpDataSourceProvider = require('./tcp-data-source-provider'); var Converter = require('./converter'); @@ -63,9 +69,15 @@ module.exports = { Logger: Logger, Connection: Connection, + SerialConnection: SerialConnection, TcpConnection: TcpConnection, + DataSource: DataSource, + SerialDataSource: SerialDataSource, + TcpDataSource: TcpDataSource, + DataSourceProvider: DataSourceProvider, + SerialDataSourceProvider: SerialDataSourceProvider, TcpDataSourceProvider: TcpDataSourceProvider, Converter: Converter,
- Added exports for serial classes and data sources
danielwippermann_resol-vbus
train
js
98fad0939948397eddbd4aaab3873924bb5d0bfb
diff --git a/src/Model/Project.php b/src/Model/Project.php index <HASH>..<HASH> 100644 --- a/src/Model/Project.php +++ b/src/Model/Project.php @@ -104,7 +104,10 @@ class Project extends Resource */ public function addDomain($name, $wildcard = false, array $ssl = []) { - $body = ['name' => $name, 'wildcard' => $wildcard, 'ssl' => $ssl]; + $body = ['name' => $name, 'wildcard' => $wildcard]; + if (!empty($ssl)) { + $body['ssl'] = $ssl; + } return Domain::create($body, $this->getUri() . '/domains', $this->client); } diff --git a/src/Model/Resource.php b/src/Model/Resource.php index <HASH>..<HASH> 100644 --- a/src/Model/Resource.php +++ b/src/Model/Resource.php @@ -126,7 +126,7 @@ class Resource implements \ArrayAccess throw new \InvalidArgumentException($message); } - $request = $client->createRequest('post', $collectionUrl, ['body' => $body]); + $request = $client->createRequest('post', $collectionUrl, ['json' => $body]); $response = self::send($request, $client); $data = (array) $response->json(); $data['_full'] = true;
Fix - 'body' on create needs to be JSON; the API cannot cope with empty arrays
platformsh_platformsh-client-php
train
php,php
352495b8a2b71622c063d319953be4fc6610aa49
diff --git a/js/select/js/lumx.select_directive.js b/js/select/js/lumx.select_directive.js index <HASH>..<HASH> 100644 --- a/js/select/js/lumx.select_directive.js +++ b/js/select/js/lumx.select_directive.js @@ -289,7 +289,7 @@ angular.module('lumx.select', []) if ($scope.change) { - $scope.change({ newValue: angular.copy(newConvertedValue), oldValue: angular.copy($scope.model) }); + $scope.change({ newValue: angular.copy(newConvertedValue), oldValue: angular.copy($scope.ngModel.$modelValue) }); } $scope.ngModel.$setViewValue(angular.copy(newConvertedValue)); });
fix select: missing model to ngModel rename
lumapps_lumX
train
js
c800b607a514a4b4ec3e1e169b2acc8b84241c3d
diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py index <HASH>..<HASH> 100644 --- a/charmhelpers/contrib/openstack/utils.py +++ b/charmhelpers/contrib/openstack/utils.py @@ -140,6 +140,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([ ('yakkety', 'newton'), ('zesty', 'ocata'), ('artful', 'pike'), + ('bionic', 'queens'), ]) @@ -157,6 +158,7 @@ OPENSTACK_CODENAMES = OrderedDict([ ('2016.2', 'newton'), ('2017.1', 'ocata'), ('2017.2', 'pike'), + ('2018.1', 'queens'), ]) # The ugly duckling - must list releases oldest to newest @@ -187,6 +189,8 @@ SWIFT_CODENAMES = OrderedDict([ ['2.11.0', '2.12.0', '2.13.0']), ('pike', ['2.13.0', '2.15.0']), + ('queens', + ['2.16.0']), ]) # >= Liberty version->codename mapping
Add remaining series support for queens (#<I>)
juju_charm-helpers
train
py
f530ef8a3b9e692e3a0d4e798f778b581acaf0be
diff --git a/src/public/assets/assets/scripts/admin/custom.js b/src/public/assets/assets/scripts/admin/custom.js index <HASH>..<HASH> 100644 --- a/src/public/assets/assets/scripts/admin/custom.js +++ b/src/public/assets/assets/scripts/admin/custom.js @@ -103,7 +103,20 @@ var app = { var order = urlParts[urlPartsLength-1]; var newUrl = ""; - order = (order == "asc") ? "desc" : "asc"; + if (order == "asc") + { + order = "desc"; + $(".fa.fa-sort-up.fa-fw").remove(); + $(".fa.fa-sort-down.fa-fw").remove(); + link.append(' <span class="fa fa-sort-down fa-fw"></span>') + } + else + { + order = "asc"; + $(".fa.fa-sort-up.fa-fw").remove(); + $(".fa.fa-sort-down.fa-fw").remove(); + link.append(' <span class="fa fa-sort-up fa-fw"></span>') + } for ( var i = 2; i < urlPartsLength - 1; i++ ) {
Icons I added icons on the column where the user has been sorting the data on.
Blogify_Blogify
train
js
ba56dc7747c79ac0329c7ce0ca2430623c6c5398
diff --git a/system/src/Grav/Console/CleanCommand.php b/system/src/Grav/Console/CleanCommand.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Console/CleanCommand.php +++ b/system/src/Grav/Console/CleanCommand.php @@ -88,7 +88,7 @@ class CleanCommand extends Command { protected function configure() { $this ->setName("clean") - ->setDescription("Handles cleaning chores for Grav") + ->setDescription("Handles cleaning chores for Grav distribution") ->setHelp('The <info>clean</info> clean extraneous folders and data'); }
Minor description update for the CLI Clean command
getgrav_grav
train
php
92f22e564f5acc3c4cb982f22ff8630f6ce13dbf
diff --git a/provision/docker/provisioner.go b/provision/docker/provisioner.go index <HASH>..<HASH> 100644 --- a/provision/docker/provisioner.go +++ b/provision/docker/provisioner.go @@ -224,8 +224,8 @@ func (p *dockerProvisioner) Destroy(app provision.App) error { go func(c container) { defer containersGroup.Done() unit := c.asUnit(app) - errUnbind := app.UnbindUnit(&unit) - if errUnbind != nil { + err := app.UnbindUnit(&unit) + if err != nil { log.Errorf("Unable to unbind unit %q: %s", c.ID, err) } err = removeContainer(&c)
provision/docker: fix code and build Using the proper error fixes the build (+race), and the error reporting itself.
tsuru_tsuru
train
go
c53cec75ef487ccd2eb9e86987f67bd8bfff87d2
diff --git a/tests/integration/cli/sync_test.py b/tests/integration/cli/sync_test.py index <HASH>..<HASH> 100644 --- a/tests/integration/cli/sync_test.py +++ b/tests/integration/cli/sync_test.py @@ -23,3 +23,9 @@ class TestSyncCLI(DustyIntegrationTestCase): self.assertFileContentsInContainer('busyboxa', '/repo/README.md', '# fake-repo') + + def test_sync_repo_is_destructive(self): + self.exec_in_container('busyboxa', 'touch /repo/testfile') + self.assertFileInContainer('busyboxa', '/repo/testfile') + self.run_command('sync fake-repo') + self.assertFileNotInContainer('busyboxa', '/repo/testfile')
Add test that sync is now destructive
gamechanger_dusty
train
py
4520dd4cfa51dc6b73c66203c55065b87c58088f
diff --git a/test/plugin/test_out_elasticsearch.rb b/test/plugin/test_out_elasticsearch.rb index <HASH>..<HASH> 100644 --- a/test/plugin/test_out_elasticsearch.rb +++ b/test/plugin/test_out_elasticsearch.rb @@ -4107,12 +4107,6 @@ class ElasticsearchOutputTest < Test::Unit::TestCase stub_request(:post, url) .with( body: "{\"query\":{\"ids\":{\"values\":#{ids.uniq.to_json}}},\"_source\":false,\"sort\":[{\"_index\":{\"order\":\"desc\"}}]}", - headers: { - 'Accept'=>'*/*', - 'Content-Type'=>'application/json', - 'Host'=>'localhost:9200', - 'User-Agent'=>'elasticsearch-ruby/7.12.0 (RUBY_VERSION: 2.7.0; linux x86_64; Faraday v1.4.1)' - } ) .to_return(lambda do |req| { :status => 200,
test: out_elasticsearch: Remove a needless headers from affinity stub
uken_fluent-plugin-elasticsearch
train
rb
338c25213cd6daa3a1261e25ae9c030444231af0
diff --git a/components/Validation/src/Validator/Types.php b/components/Validation/src/Validator/Types.php index <HASH>..<HASH> 100644 --- a/components/Validation/src/Validator/Types.php +++ b/components/Validation/src/Validator/Types.php @@ -17,6 +17,7 @@ */ use DateTime; +use DateTimeInterface; use Limoncello\Validation\Contracts\MessageCodes; use Limoncello\Validation\Contracts\RuleInterface; use Limoncello\Validation\Rules\CallableRule; @@ -74,7 +75,7 @@ trait Types protected static function isDateTime(): RuleInterface { return new CallableRule(function ($value) { - return $value instanceof DateTime; + return $value instanceof DateTimeInterface; }, MessageCodes::IS_DATE_TIME); }
Check dates with DateTimeInterface rather than specific type DateTime.
limoncello-php_framework
train
php
792e6288856a2735bfd5b9543ff61a7d9ffa6188
diff --git a/grab/spider/base.py b/grab/spider/base.py index <HASH>..<HASH> 100644 --- a/grab/spider/base.py +++ b/grab/spider/base.py @@ -781,14 +781,14 @@ class Spider(object): # even if `proxy` options is set with another proxy server grab.setup(connection_reuse=False) if self.proxy_auto_change: - self.proxy = self.change_proxy(task, grab) - - def change_proxy(self, task, grab): - proxy = self.proxylist.get_random_proxy() - grab.setup(proxy=proxy.get_address(), - proxy_userpwd=proxy.get_userpwd(), - proxy_type=proxy.proxy_type) - return proxy + self.change_active_proxy(task) + if self.proxy: + grab.setup(proxy=self.proxy.get_address(), + proxy_userpwd=self.proxy.get_userpwd(), + proxy_type=self.proxy.proxy_type) + + def change_active_proxy(self, task, grab): + self.proxy = self.proxylist.get_random_proxy() def submit_task_to_transport(self, task, grab): if self.only_cache:
Refactored the selection of active proxy for the spider tasks
lorien_grab
train
py
6add859a8bdcb0cd0a6eded008a63abb724c633c
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,9 +31,11 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.autodoc', +extensions = [ + 'sphinx.ext.autodoc', 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx'] + 'sphinx.ext.intersphinx', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -49,7 +51,7 @@ master_doc = 'index' # General information about the project. project = 'Seaworthy' -copyright = '2017, Jamie Hewland & Jeremy Thurgood' +copyright = '2017, Praekelt.org' author = 'Jamie Hewland & Jeremy Thurgood' # The version info for the project you're documenting, acts as replacement for @@ -168,7 +170,5 @@ texinfo_documents = [ ] - - # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None}
docs: Clean up conf.py a bit
praekeltfoundation_seaworthy
train
py
279f6d846165c1d10a664a14246286f76f8ac69d
diff --git a/command.go b/command.go index <HASH>..<HASH> 100644 --- a/command.go +++ b/command.go @@ -1269,7 +1269,7 @@ func SetCommandBufferPool(poolSize, initBufSize, maxBufferSize int) { panic("There is no need to optimize the buffer pool anymore. Buffers have moved to Connection object.") } -func (cmd *baseCommand) execute(ifc command) (err error) { +func (cmd *baseCommand) execute(ifc command) error { policy := ifc.getPolicy(ifc).GetBasePolicy() iterations := -1 @@ -1279,6 +1279,11 @@ func (cmd *baseCommand) execute(ifc command) (err error) { // set timeout outside the loop deadline := time.Now().Add(policy.Timeout) + socketTimeout, err := policy.socketTimeout() + if err != nil { + return err + } + // Execute command until successful, timed out or maximum iterations have been reached. for { // too many retries @@ -1306,11 +1311,6 @@ func (cmd *baseCommand) execute(ifc command) (err error) { continue } - socketTimeout, err := policy.socketTimeout() - if err != nil { - return err - } - cmd.conn, err = ifc.getConnection(socketTimeout) if err != nil { Logger.Warn("Node " + cmd.node.String() + ": " + err.Error())
Get socket timeout once per command execution, do not redefine err var in command execution loop
aerospike_aerospike-client-go
train
go
09ce77cb287907a3e726c14b82fc783d51bf95d1
diff --git a/lib/spec.js b/lib/spec.js index <HASH>..<HASH> 100644 --- a/lib/spec.js +++ b/lib/spec.js @@ -19,6 +19,9 @@ var debug = require('debug')('electrolyte'); * @protected */ function Spec(id, dependencies, mod) { + var keys = Object.keys(mod) + , i, len; + this.id = id; this.dependencies = dependencies; this.singleton = mod['@singleton']; @@ -26,6 +29,12 @@ function Spec(id, dependencies, mod) { if (typeof this.implements == 'string') { this.implements = [ this.implements ] } + this.a = {}; + for (i = 0, len = keys.length; i < len; ++i) { + if (keys[i].indexOf('@') == 0) { + this.a[keys[i]] = mod[keys[i]]; + } + } this._module = mod; this._initialized = false;
Stash all annotations on the spec.
jaredhanson_electrolyte
train
js
1d06e41f04d75c31334c455063e9ec7b4136bf23
diff --git a/p2p/dial.go b/p2p/dial.go index <HASH>..<HASH> 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -157,7 +157,7 @@ func (s *dialstate) removeStatic(n *discover.Node) { } func (s *dialstate) newTasks(nRunning int, peers map[discover.NodeID]*Peer, now time.Time) []task { - if s.start == (time.Time{}) { + if s.start.IsZero() { s.start = now } diff --git a/swarm/network/kademlia/kaddb.go b/swarm/network/kademlia/kaddb.go index <HASH>..<HASH> 100644 --- a/swarm/network/kademlia/kaddb.go +++ b/swarm/network/kademlia/kaddb.go @@ -330,7 +330,7 @@ func (self *KadDb) load(path string, cb func(*NodeRecord, Node) error) (err erro } } n++ - if (node.After == time.Time{}) { + if node.After.IsZero() { node.After = time.Now() } self.index[node.Addr] = node
p2p, swarm/network/kademlia: use IsZero to check for zero time (#<I>)
ethereum_go-ethereum
train
go,go
b76ee6deeb0b11345c69bbe266458673aad2a5d8
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -8,5 +8,5 @@ DATABASES = { SECRET_KEY = 'tests' INSTALLED_APPS = ( - 'tests' + 'tests', )
Fix 'INSTALLED_APPS setting must be a list or a tuple' error
birdsarah_django-spreadsheetresponsemixin
train
py
ce6b33d0a82e18590ee36f74db906087021f7e5d
diff --git a/src/LdapTools/DomainConfiguration.php b/src/LdapTools/DomainConfiguration.php index <HASH>..<HASH> 100644 --- a/src/LdapTools/DomainConfiguration.php +++ b/src/LdapTools/DomainConfiguration.php @@ -265,7 +265,6 @@ class DomainConfiguration public function setPort($port) { $this->config['port'] = $this->validateInteger($port, "port number"); - ; return $this; }
Fix incorrectly added semi-colon after CS fix script.
ldaptools_ldaptools
train
php
fa5efa1fd581f4d9ee0e5ac3e9b9642a244aa844
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java b/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/internal/WebsocketHandler.java @@ -21,6 +21,10 @@ public class WebsocketHandler { public void handleFrame(final ChannelHandlerContext ctx, final WebSocketFrame message) { + if (this.websocketServer == null) { + return; + } + Optional<WebSocketFrame> frame = getResponseFrame(ctx, message); frame.ifPresent(webSocketFrame -> ctx.channel().writeAndFlush(webSocketFrame)); }
added guard for handle frame in websocket handler
dreamhead_moco
train
java
bda13fcf01fc50dffb4c2d84f29588566fecb235
diff --git a/src/transports/remote.js b/src/transports/remote.js index <HASH>..<HASH> 100644 --- a/src/transports/remote.js +++ b/src/transports/remote.js @@ -78,6 +78,10 @@ function jsonDepth(json, depth) { } if (typeof json === 'object') { + if (json instanceof Error) { + return json.stack || json.constructor.name + ': ' + json.message; + } + if (typeof json.toJSON === 'function') { json = json.toJSON(); }
remote: Serialize Error instances correctly.
megahertz_electron-log
train
js
502db402d73911dc5681a72727d1f3c0b9623f03
diff --git a/spec/compiler_spec.rb b/spec/compiler_spec.rb index <HASH>..<HASH> 100644 --- a/spec/compiler_spec.rb +++ b/spec/compiler_spec.rb @@ -32,8 +32,14 @@ module CorrespondenceMarkup it "compiles with backslash quoting" do parse("a\\[23\\] = b \\\\ c", :text).value.should == "a[23] = b \\ c" + parse("a\\[23\\] = b \\\\ c", :non_item).value.should == NonItem.new("a[23] = b \\ c") + parse("[31 a\\[23\\] = c]", :item).value.should == Item.new(31, "a[23] = c") end + it "compiles with backslash quoting, matching forward only (no overlaps)" do + parse("\\[\\\\\\\\\\]", :text).value.should == "[\\\\]" + end + it "compiles structure" do parse("[1 an item] in between stuff [2 a second item]", :structure).value.should == Structure.new([Item.new(1, "an item"), NonItem.new(" in between stuff "),
more backslash quoting tests
pdorrell_correspondence-markup
train
rb
4ca3f99d4ceafa8e3fde3f4baa5e4c611b764714
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -13,7 +13,6 @@ require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/module/introspection' require 'active_support/core_ext/object/duplicable' require 'active_support/core_ext/class/subclasses' -require 'arel' require 'active_record/attribute_decorators' require 'active_record/errors' require 'active_record/log_subscriber'
Remove duplicated `require 'arel'` It appears first in `lib/active_record.rb`.
rails_rails
train
rb
67fdf4d318a77ae02a98c32b56815ee3332a8cdd
diff --git a/bcbio/qc/multiqc.py b/bcbio/qc/multiqc.py index <HASH>..<HASH> 100644 --- a/bcbio/qc/multiqc.py +++ b/bcbio/qc/multiqc.py @@ -198,9 +198,9 @@ def _work_path_to_rel_final_path(path, upload_path_mapping, upload_base_dir): return path upload_path = None for work_path, final_path in upload_path_mapping.items(): - if os.path.isfile(work_path) and path == work_path: + if path == work_path and os.path.isfile(work_path): upload_path = final_path - elif os.path.isdir(work_path) and path.startswith(work_path): + elif path.startswith(work_path) and os.path.isdir(work_path): upload_path = path.replace(work_path, final_path) if upload_path: return os.path.relpath(upload_path, upload_base_dir)
MultiQC: avoid os.stat lookups when preparing final paths Attempts to do less filesystem checks to avoid long runtimes on slow filesystems. Fixes #<I>
bcbio_bcbio-nextgen
train
py
fda09173deedbd514d1d0ed8a20fae1bc6bbeb11
diff --git a/test/test_generic_http_grabber.rb b/test/test_generic_http_grabber.rb index <HASH>..<HASH> 100644 --- a/test/test_generic_http_grabber.rb +++ b/test/test_generic_http_grabber.rb @@ -1,9 +1,9 @@ -require File.dirname(__FILE__) + '/helper' +#require File.dirname(__FILE__) + '/helper' -class GenericHttpGrabberTest < Test::Unit::TestCase +# class GenericHttpTest < Test::Unit::TestCase - context "The GenericHttpGrabber" do - end +# # context "The GenericHttpGrabber" do +# # end -end +# end
Commenting our GenericHttpGrabber test setup until we have tests.
futurechimp_octopus
train
rb
8db1f076c1b30a4e87236085857839f70dc1bc46
diff --git a/classes/Collector.php b/classes/Collector.php index <HASH>..<HASH> 100644 --- a/classes/Collector.php +++ b/classes/Collector.php @@ -78,6 +78,8 @@ abstract class QM_Collector { if ( ! defined( $constant ) ) { /* translators: Undefined PHP constant */ return __( 'undefined', 'query-monitor' ); + } elseif ( is_string( constant( $constant ) ) && ! is_numeric( constant( $constant ) ) ) { + return constant( $constant ); } elseif ( ! constant( $constant ) ) { return 'false'; } else {
Handle non-boolean constants such as WP_DEBUG_LOG, which now accepts a path too.
johnbillion_query-monitor
train
php
4e79c9d8c8a79d9910f94c1ba835f1020fe8373e
diff --git a/fastlane/lib/fastlane/version.rb b/fastlane/lib/fastlane/version.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/version.rb +++ b/fastlane/lib/fastlane/version.rb @@ -1,5 +1,5 @@ module Fastlane - VERSION = '2.62.0'.freeze + VERSION = '2.62.1'.freeze DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze MINIMUM_XCODE_RELEASE = "7.0".freeze end
Version bump to <I> (#<I>)
fastlane_fastlane
train
rb
aa5d09a6ce222c2ae5c607bbd102cfaa4dbdaa0d
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindDeadLocalStores.java @@ -99,6 +99,12 @@ public class FindDeadLocalStores implements Detector { if (!isStore(location)) continue; + // Ignore exception handler blocks: + // javac always stores caught exceptions in + // a local, even if the value is not used. + if (location.getBasicBlock().isExceptionHandler()) + continue; + IndexedInstruction store = (IndexedInstruction) location.getHandle().getInstruction(); int local = store.getIndex();
Ignore dead local stores in exception handler blocks: javac always stores caught exceptions in a local, even if the exception is ignored. git-svn-id: <URL>
spotbugs_spotbugs
train
java
e5b7f4fddc9df6f2dcfeacd6a1ad5ba9374ed93b
diff --git a/state/backups.go b/state/backups.go index <HASH>..<HASH> 100644 --- a/state/backups.go +++ b/state/backups.go @@ -388,7 +388,7 @@ func (s *backupMetadataStorage) SetStored(meta filestorage.Metadata) error { const backupStorageRoot = "/" // Ensure we satisfy the interface. -var _ = filestorage.RawFileStorage(&envFileStorage{}) +var _ = filestorage.RawFileStorage((*envFileStorage)(nil)) type envFileStorage struct { envStor storage.Storage
Use a more canonical form for testing interface satisfaction.
juju_juju
train
go
3175744e50546538b3095070a0ee6d3ff95dd89e
diff --git a/view/attachments/tmpl/app.html.php b/view/attachments/tmpl/app.html.php index <HASH>..<HASH> 100644 --- a/view/attachments/tmpl/app.html.php +++ b/view/attachments/tmpl/app.html.php @@ -163,7 +163,10 @@ $can_detach = isset(parameters()->config['can_detach']) ? parameters()->config[' <div class="attachments-top"> <div class="attachments-table"> <div class="attachments-upload"> - <div class="k-upload">Upload</div> + <?= helper('uploader.container', array( + 'container' => 'fileman-attachments', + 'element' => '.fileman-attachments-uploader', + )) ?> </div> <div class="attachments-lists"> <div class="attachments-existing">
re #<I>: Add uploader
joomlatools_joomlatools-framework
train
php
15f03292804a7601a69ec0eddd4a1661e5f186f3
diff --git a/nion/swift/ScriptsDialog.py b/nion/swift/ScriptsDialog.py index <HASH>..<HASH> 100644 --- a/nion/swift/ScriptsDialog.py +++ b/nion/swift/ScriptsDialog.py @@ -19,6 +19,7 @@ from nion.ui import Converter from nion.ui import Dialog from nion.ui import Selection from nion.swift import Widgets +from nion.swift.model import PlugInManager from nion.swift.model import Utility _ = gettext.gettext @@ -279,7 +280,8 @@ class RunScriptDialog(Dialog.ActionDialog): if Utility.compare_versions(version, actual_version) > 0: raise NotImplementedError("API requested version %s is greater than %s." % (version, actual_version)) return interactive_session - + def get_api(self, version, ui_version): + return PlugInManager.api_broker_fn(version, ui_version) try: g = dict() g["api_broker"] = APIBroker()
Add ability to get api object from script dialog.
nion-software_nionswift
train
py
b5549d9985553427eeaf7c3e633b325e9d79aefe
diff --git a/tfatool/_version.py b/tfatool/_version.py index <HASH>..<HASH> 100644 --- a/tfatool/_version.py +++ b/tfatool/_version.py @@ -1,2 +1,2 @@ -__version__ = "v2.0.3" +__version__ = "v2.1.0"
minor version for the improvements to sync
TadLeonard_tfatool
train
py
8e441b5f45bd42e58162698a68cca103705dc6cd
diff --git a/lib/Gitlab/Api/Repositories.php b/lib/Gitlab/Api/Repositories.php index <HASH>..<HASH> 100644 --- a/lib/Gitlab/Api/Repositories.php +++ b/lib/Gitlab/Api/Repositories.php @@ -178,6 +178,16 @@ class Repositories extends AbstractApi /** * @param int $project_id + * @param $sha + * @return mixed + */ + public function commitrefs($project_id, $sha) + { + return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha) . '/refs')); + } + + /** + * @param int $project_id * @param array $parameters ( * * @var string $branch Name of the branch to commit into. To create a new branch, also provide start_branch.
add a method to pull refs (tags and branches) for a given commit
m4tthumphrey_php-gitlab-api
train
php
18934d60e5e81e919814ba10ffae71c983255faa
diff --git a/src/Service/ViewHelper.php b/src/Service/ViewHelper.php index <HASH>..<HASH> 100644 --- a/src/Service/ViewHelper.php +++ b/src/Service/ViewHelper.php @@ -138,6 +138,9 @@ class ViewHelper */ public function forms() { + if (!$this->dataView->inputs) { + $this->dataView->setInputs($this->viewData->getInput()); + } return $this->dataView->forms; }
fix bug that input values not populated in html form.
TuumPHP_Respond
train
php
985313f8a6eec0a1e81878f08a1a03a5876cbe74
diff --git a/packages/vaex-viz/vaex/viz/mpl.py b/packages/vaex-viz/vaex/viz/mpl.py index <HASH>..<HASH> 100644 --- a/packages/vaex-viz/vaex/viz/mpl.py +++ b/packages/vaex-viz/vaex/viz/mpl.py @@ -843,7 +843,7 @@ def plot(self, x=None, y=None, z=None, what="count(*)", vwhat=None, reduce=["col if show: pylab.show() if return_extra: - return im, grid, fgrid, ngrid, rgrid, rgba8 + return im, grid, fgrid, ngrid, rgrid else: return im # colorbar = None
Removed unused, undefined variable in the `plot` method.
vaexio_vaex
train
py
d7ffa7f18065af3926de26768b1b9f37aa8f5782
diff --git a/indra/tools/reading/submit_reading_pipeline.py b/indra/tools/reading/submit_reading_pipeline.py index <HASH>..<HASH> 100644 --- a/indra/tools/reading/submit_reading_pipeline.py +++ b/indra/tools/reading/submit_reading_pipeline.py @@ -304,9 +304,9 @@ def get_environment(): # Get the Elsevier keys from the Elsevier client environment_vars = [ {'name': ec.api_key_env_name, - 'value': ec.elsevier_keys.get('X-ELS-APIKey')}, + 'value': ec.elsevier_keys.get('X-ELS-APIKey', '')}, {'name': ec.inst_key_env_name, - 'value': ec.elsevier_keys.get('X-ELS-Insttoken')}, + 'value': ec.elsevier_keys.get('X-ELS-Insttoken', '')}, {'name': 'AWS_ACCESS_KEY_ID', 'value': access_key}, {'name': 'AWS_SECRET_ACCESS_KEY',
Fix small bug in environment variables passed to batch.
sorgerlab_indra
train
py
25afdcb2c40504b049ba402b7445778f3921506e
diff --git a/src/ComponentManager.js b/src/ComponentManager.js index <HASH>..<HASH> 100644 --- a/src/ComponentManager.js +++ b/src/ComponentManager.js @@ -55,12 +55,15 @@ ComponentManager.prototype._preprocess = function(next, args, callback) { */ ComponentManager.prototype.ls = function(args, callback) { var config = utils.getConfig(), - plugins = Object.keys(config.components[this._group]).join(' ') || '<none>', + components = Object.keys(config.components[this._group]).join(' ') || '<none>', deps = Object.keys(config.dependencies[this._group]).join(' ') || '<none>'; - this._logger.write('Detected '+this._group+': '+plugins+ - '\nThird party '+this._group+': '+deps); - callback(null, {components: plugins, dependencies: deps}); + this._logger.write( + this._group+':\n' + + ' local: ' + components + '\n' + + ' dependencies: ' + deps + '\n' + ); + callback(null, {components: components, dependencies: deps}); }; ComponentManager.prototype.rm = function(args, callback) {
Cleaned ls formatting. Fixes #<I>
webgme_webgme-cli
train
js
bb4cedde33c480edecf38065a83df36743f7cfeb
diff --git a/dramatiq/cli.py b/dramatiq/cli.py index <HASH>..<HASH> 100644 --- a/dramatiq/cli.py +++ b/dramatiq/cli.py @@ -388,6 +388,8 @@ def worker_process(args, worker_id, logging_pipe, canteen, event): # worker process will realize that soon enough. event.set() + running = True + def termhandler(signum, frame): nonlocal running if running: @@ -408,7 +410,6 @@ def worker_process(args, worker_id, logging_pipe, canteen, event): # Unblock the blocked signals inherited from the parent process. try_unblock_signals() - running = True while running: time.sleep(1)
cli: ensure 'running' is assigned before reference Fixes #<I>
Bogdanp_dramatiq
train
py
9b1b9373b8638153f1f6995460ccd45bbf7a93e0
diff --git a/src/Symfony/Component/HttpFoundation/RequestMatcher.php b/src/Symfony/Component/HttpFoundation/RequestMatcher.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpFoundation/RequestMatcher.php +++ b/src/Symfony/Component/HttpFoundation/RequestMatcher.php @@ -70,7 +70,7 @@ class RequestMatcher implements RequestMatcherInterface */ public function matchMethod($method) { - $this->methods = array_map('strtolower', is_array($method) ? $method : array($method)); + $this->methods = array_map('strtoupper', is_array($method) ? $method : array($method)); } /** @@ -89,7 +89,7 @@ class RequestMatcher implements RequestMatcherInterface */ public function matches(Request $request) { - if (null !== $this->methods && !in_array(strtolower($request->getMethod()), $this->methods)) { + if (null !== $this->methods && !in_array($request->getMethod(), $this->methods)) { return false; }
[HttpFoundation] simplified code
symfony_symfony
train
php
41b59818189822371217eb646042917c6eb4b263
diff --git a/sos/plugins/pacemaker.py b/sos/plugins/pacemaker.py index <HASH>..<HASH> 100644 --- a/sos/plugins/pacemaker.py +++ b/sos/plugins/pacemaker.py @@ -44,7 +44,7 @@ class Pacemaker(Plugin): self.add_copy_spec("/var/log/pcsd/pcsd.log") self.add_cmd_output([ "pcs config", - "pcs status", + "pcs status --full", "pcs stonith sbd status", "pcs stonith sbd watchdog list", "pcs stonith history show",
[pacemaker] Collect full status output Changes the 'pcs status' collection to display full status results. Resolves: #<I>
sosreport_sos
train
py
79d9557829e40cf853ddc814957ffdd8fc5fdd62
diff --git a/common/models/LoginForm.php b/common/models/LoginForm.php index <HASH>..<HASH> 100644 --- a/common/models/LoginForm.php +++ b/common/models/LoginForm.php @@ -67,7 +67,7 @@ class LoginForm extends Model * * @return User|null */ - private function getUser() + protected function getUser() { if ($this->_user === null) { $this->_user = User::findByUsername($this->username);
Changed \common\models\LoginForm::getUser from private to protected
yiisoft_yii2-app-advanced
train
php
46a715764ac3c9be62d81cd7163110d353bdeddc
diff --git a/alphafilter/templatetags/alphafilter.py b/alphafilter/templatetags/alphafilter.py index <HASH>..<HASH> 100644 --- a/alphafilter/templatetags/alphafilter.py +++ b/alphafilter/templatetags/alphafilter.py @@ -90,7 +90,6 @@ class AlphabetFilterNode(Node): def render(self, context): try: qset = self.qset.resolve(context) - except VariableDoesNotExist: raise TemplateSyntaxError("Can't resolve the queryset passed") try: @@ -106,7 +105,9 @@ class AlphabetFilterNode(Node): if request is not None: alpha_lookup = request.GET.get(alpha_field, '') - qstring_items = request.GET.items() + qstring_items = request.GET.copy() + if alpha_field in qstring_items: + qstring_items.pop(alpha_field) qstring = "&amp;".join(["%s=%s" % (k, v) for k, v in qstring_items]) else: alpha_lookup = ''
The query string was appending the field lookup, so I needed to pop it from the query string stack.
coordt_django-alphabetfilter
train
py
f256c863048a77a8c60814d5b89c0b73a7ca90d5
diff --git a/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java b/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java index <HASH>..<HASH> 100644 --- a/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java +++ b/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java @@ -222,6 +222,13 @@ public class MySQLRubyJdbcConnection extends RubyJdbcConnection { } @Override + protected String caseConvertIdentifierForRails(final Connection connection, final String value) + throws SQLException { + if ( value == null ) return null; + return value; // MySQL does not storesUpperCaseIdentifiers() : + } + + @Override protected Connection newConnection() throws RaiseException, SQLException { final Connection connection = super.newConnection(); killCancelTimer(connection);
MySQL does not store upper-case identifiers (for lower case it depends)
jruby_activerecord-jdbc-adapter
train
java
042f8eb204ff322798e9f0ab66115a358c5b96ac
diff --git a/tests/custom_map_key_type.go b/tests/custom_map_key_type.go index <HASH>..<HASH> 100644 --- a/tests/custom_map_key_type.go +++ b/tests/custom_map_key_type.go @@ -22,9 +22,8 @@ var customMapKeyTypeValue CustomMapKeyType func init() { customMapKeyTypeValue.Map = map[customKeyType]int{ - customKeyType{0x01, 0x01}: 1, - customKeyType{0x02, 0x02}: 2, + customKeyType{0x01, 0x02}: 3, } } -var customMapKeyTypeValueString = `{"Map":{"0101":1,"0202":2}}` +var customMapKeyTypeValueString = `{"Map":{"0102":3}}`
reduce the unit test map to 1 element so the encoding is consistent otherwise, since the map iterates in randomish order, some of the time the element order does not match the unit test expected result, causing the unit test to fail unnecessarily.
mailru_easyjson
train
go
c41f264ebf28568524daa5d111dc30e6fe9de9a8
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindUncalledPrivateMethods.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindUncalledPrivateMethods.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindUncalledPrivateMethods.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindUncalledPrivateMethods.java @@ -51,6 +51,7 @@ public class FindUncalledPrivateMethods extends BytecodeScanningDetector { && !methodName.equals("readObject") && !methodName.equals("writeObject") && !methodName.equals("<init>") + && !methodName.equals("<clinit>") ) definedPrivateMethods.add(MethodAnnotation.fromVisitedMethod(this)); }
Don't report class initializers. While Sun's javac gives these default access, jikes makes them private, which would lead to spurious warnings. git-svn-id: <URL>
spotbugs_spotbugs
train
java
7c5253876f0c6d4eca5bd05a25351f6da797a8fa
diff --git a/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java b/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java index <HASH>..<HASH> 100644 --- a/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java +++ b/cas-server-core/src/main/java/org/jasig/cas/ticket/TicketGrantingTicketImpl.java @@ -50,7 +50,6 @@ public final class TicketGrantingTicketImpl extends AbstractTicket implements Ti /** Unique Id for serialization. */ private static final long serialVersionUID = -5197946718924166491L; - private static final Logger LOGGER = LoggerFactory.getLogger(TicketGrantingTicketImpl.class); /** The authenticated object for which this ticket was generated for. */ @Lob @Column(name="AUTHENTICATION", nullable=false)
NOJIRA: Fixed compilation issue after the merge with master. Removed the unneeded logger.
apereo_cas
train
java
43f1b8adff3ea20eaeade867d0e57cccad785e5c
diff --git a/families/track_and_trade/server/api/users.js b/families/track_and_trade/server/api/users.js index <HASH>..<HASH> 100644 --- a/families/track_and_trade/server/api/users.js +++ b/families/track_and_trade/server/api/users.js @@ -23,13 +23,14 @@ const auth = require('./auth') const { BadRequest } = require('./errors') const create = user => { - return agents.fetch(user.publicKey, null) - .then(agent => { - if (!agent) { - throw new BadRequest('Public key must match an Agent on the blockchain') - } - return auth.hashPassword(user.password) + return Promise.resolve() + .then(() => { + return agents.fetch(user.publicKey, null) + .catch(() => { + throw new BadRequest('Public key must match an Agent on blockchain') + }) }) + .then(() => auth.hashPassword(user.password)) .then(hashed => { return db.insert(_.assign({}, user, {password: hashed})) .catch(err => { throw new BadRequest(err.message) })
Fix error handling when creating a user without Agent
hyperledger_sawtooth-core
train
js
1a500f9717bd92b2d376bde6aec387e3dfd92878
diff --git a/spacy/about.py b/spacy/about.py index <HASH>..<HASH> 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -1,6 +1,6 @@ # fmt: off __title__ = "spacy-nightly" -__version__ = "3.0.0a34" +__version__ = "3.0.0a35" __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" __projects__ = "https://github.com/explosion/projects"
Set version to <I>a<I>
explosion_spaCy
train
py
4db12e2d64c714b87fbcc53e912d3e76e5c7d2e3
diff --git a/stanza/server/semgrex.py b/stanza/server/semgrex.py index <HASH>..<HASH> 100644 --- a/stanza/server/semgrex.py +++ b/stanza/server/semgrex.py @@ -25,11 +25,11 @@ relative to the search if used many times on small documents. Ideally larger texts would be processed, and all of the desired semgrex patterns would be run at once. The worst thing to do would be to call this multiple times on a large document, one invocation per semgrex -pattern, as that would serialize the document each time. There are of -course multiple ways of making this more efficient, such as including -it as a separate call in the server or keeping the subprocess alive -for multiple queries, but we didn't do any of those. We do, however, -accept pull requests... +pattern, as that would serialize the document each time. +Included here is a context manager which allows for keeping the same +java process open for multiple requests. This saves on the subprocess +launching time. It is still important not to wastefully serialize the +same document over and over, though. """ import stanza
Update an incorrect doc in the semgrex context manager
stanfordnlp_stanza
train
py
5c02166c3f6c687419db94c8d754068c783f523b
diff --git a/lark/parsers/resolve_ambig.py b/lark/parsers/resolve_ambig.py index <HASH>..<HASH> 100644 --- a/lark/parsers/resolve_ambig.py +++ b/lark/parsers/resolve_ambig.py @@ -24,7 +24,10 @@ def _compare_rules(rule1, rule2): def _compare_drv(tree1, tree2): if not (isinstance(tree1, Tree) and isinstance(tree2, Tree)): - return -compare(tree1, tree2) + try: + return -compare(tree1, tree2) + except TypeError: + return 0 try: rule1, rule2 = tree1.rule, tree2.rule
Bugfix #<I>: Ambiguity resolver sometimes failed under Python3
lark-parser_lark
train
py
a0402a01293a2920294e2eb2b54f5b3d2e51f079
diff --git a/pemutil_test.go b/pemutil_test.go index <HASH>..<HASH> 100644 --- a/pemutil_test.go +++ b/pemutil_test.go @@ -6,6 +6,7 @@ import ( "errors" "io/ioutil" "path" + "sort" "strings" "testing" ) @@ -261,13 +262,29 @@ func TestGenKeys(t *testing.T) { } } -func keys(s Store) []BlockType { - k := make([]BlockType, len(s)) +type BlockTypeKeys []BlockType + +func (btk BlockTypeKeys) Len() int { + return len(btk) +} + +func (btk BlockTypeKeys) Swap(i, j int) { + btk[i], btk[j] = btk[j], btk[i] +} + +func (btk BlockTypeKeys) Less(i, j int) bool { + return strings.Compare(btk[i].String(), btk[j].String()) < 0 +} + +func keys(s Store) BlockTypeKeys { + k := make(BlockTypeKeys, len(s)) i := 0 for key, _ := range s { k[i] = key i++ } + sort.Sort(k) + return k }
Adding sorting to map key check to fix unit test failure
knq_pemutil
train
go
7b0f22cf6cf519ece57e5282412669f460859293
diff --git a/tasklib/backends.py b/tasklib/backends.py index <HASH>..<HASH> 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -201,3 +201,6 @@ class TaskWarrior(object): # altering the data before saving task.refresh(after_save=True) + def delete_task(self, task): + self.execute_command([task['uuid'], 'delete']) + diff --git a/tasklib/task.py b/tasklib/task.py index <HASH>..<HASH> 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -586,7 +586,7 @@ class Task(TaskResource): if self.deleted: raise Task.DeletedTask("Task was already deleted") - self.warrior.execute_command([self['uuid'], 'delete']) + self.backend.delete_task(self) # Refresh the status again, so that we have updated info stored self.refresh(only_fields=['status', 'start', 'end'])
Task: Move TW-specific deletion logic into TW backend
robgolding_tasklib
train
py,py
e8dc190645e33d286e134013c39aa78ecf2afe71
diff --git a/assets/js/components/Revealer.js b/assets/js/components/Revealer.js index <HASH>..<HASH> 100644 --- a/assets/js/components/Revealer.js +++ b/assets/js/components/Revealer.js @@ -153,6 +153,7 @@ class Group { this.elements[i].hide(); } } + this.adminController.refreshUi(); } // --------------------------------------------------------------------------
Refreshing the UI after revealing
nails_module-admin
train
js
bd2068283a9ada875cddd54c2e782c39022ab157
diff --git a/src/pfs/fuse/fuse.go b/src/pfs/fuse/fuse.go index <HASH>..<HASH> 100644 --- a/src/pfs/fuse/fuse.go +++ b/src/pfs/fuse/fuse.go @@ -1,9 +1,8 @@ package fuse type Mounter interface { - // Mount mounts a repository available as a fuse filesystem at mountPoint at the commitID. - // commitID is optional - if not passed, all commits will be mounted. - // Mount will not block and will return once mounted, or error otherwise. + // Mount mounts a repository available as a fuse filesystem at mountPoint. + // Mount blocks and will return once the volume is unmounted. Mount( mountPoint string, shard uint64,
Updates docs for Mount.
pachyderm_pachyderm
train
go