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
5e61d707350fc140f504f7e2f01df2239ef06e9e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import find_packages, setup MIN_PY_VERSION = "3.9" PACKAGES = find_packages(exclude=["tests", "tests.*"]) REQUIREMENTS = list(val.strip() for val in open("requirements.txt")) -VERSION = "88" +VERSION = "89" setup( name="pydeconz",
Bump to <I> (#<I>)
Kane610_deconz
train
py
93673b761ed37ebe4b9ca7622a17c20b4fb6da4f
diff --git a/session/manager.go b/session/manager.go index <HASH>..<HASH> 100644 --- a/session/manager.go +++ b/session/manager.go @@ -4,6 +4,7 @@ import ( "context" "time" + "github.com/gorilla/websocket" "github.com/mafredri/cdp" "github.com/mafredri/cdp/internal/errors" "github.com/mafredri/cdp/protocol/target" @@ -79,6 +80,10 @@ func (m *Manager) watch(ev *sessionEvents, created <-chan *session, done, errC c m.cancel() return true } + if _, ok := e.(*websocket.CloseError); ok { + m.cancel() + return true + } } if cdp.ErrorCause(err) == context.Canceled { // Manager was closed.
session: allow Manager.watch to take care of websocket errors (#<I>) Fixes: #<I>
mafredri_cdp
train
go
2825a8be903b2902946e1d9cab918e6cf89e0057
diff --git a/bigfloat/bigfloat_config.py b/bigfloat/bigfloat_config.py index <HASH>..<HASH> 100644 --- a/bigfloat/bigfloat_config.py +++ b/bigfloat/bigfloat_config.py @@ -6,7 +6,8 @@ ## which one should be used. If this variable isn't set then the ## bigfloat module will make an attempt to find the library itself. ## -mpfr_library_location = '/opt/local/lib/libmpfr.dylib' +## Here's an example that's suitable for an OS X machine using MacPorts: +# mpfr_library_location = '/opt/local/lib/libmpfr.dylib' ## Set 'gmp_mp_size_t_int' to True if GMP uses the C 'int' type for ## mp_size_t and mp_exp_t, and to False if is uses the C 'long' type
Remove hardcoded MPFR library location from configuration file
mdickinson_bigfloat
train
py
fd7a02d1f095732ae50dbf6b1ae3aa7a10d404b3
diff --git a/core/Controller.php b/core/Controller.php index <HASH>..<HASH> 100644 --- a/core/Controller.php +++ b/core/Controller.php @@ -20,6 +20,7 @@ use monolyth\account\Logout_Controller; use monolyth\HTTP301_Exception; use monolyth\HTTP400_Exception; use monolyth\HTTP403_Exception; +use monolyth\HTTP401_Exception; use monolyth\HTTP404_Exception; use monolyth\render\HTTP404_Controller; use monolyth\HTTP405_Exception; @@ -160,6 +161,13 @@ abstract class Controller } ); $this->addRequirement( + 'monolyth\Ajax_Login_Required', + $user->loggedIn(), + function() use($project, $redir) { + throw new HTTP401_Exception; + } + ); + $this->addRequirement( 'monolyth\Nologin_Required', !$user->loggedIn(), function() { throw new HTTP301_Exception($this->url('')); }
this should be its own exception so we can catch it in an angular interceptor for instance
monolyth-php_frontal
train
php
78d2786d95c6bfb4252c84185dcf0ad6fd62bc11
diff --git a/tasks/build.js b/tasks/build.js index <HASH>..<HASH> 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -10,11 +10,14 @@ module.exports = function(grunt){ var buildOptions = options.buildOptions; // Run the build with the provided options - build(system, buildOptions).then(function(){ - grunt.log.writeln("Build was successful."); + var promise = build(system, buildOptions); + if(promise.then) { + promise.then(function(){ + grunt.log.writeln("Build was successful."); - done(); - }); + done(); + }); + } });
Allow the grunt task to work with the watch mode
stealjs_steal-tools
train
js
ff73ea91eea0a0844398a3da0906f4d61c509d7c
diff --git a/lib/wed/wed.js b/lib/wed/wed.js index <HASH>..<HASH> 100644 --- a/lib/wed/wed.js +++ b/lib/wed/wed.js @@ -1119,11 +1119,20 @@ oop.implement(Editor, SimpleEventEmitter); var it = this._selection_stack.pop(); if (it instanceof Array) this.setCaret(it); // setCaret() will call _caretChangeEmitter. - else { + else if (it !== undefined) { rangy.restoreSelection(it); // Call with a minimal object this._caretChangeEmitter(); } + else + // Null value means there was no selection, ergo... + this.clearSelection(); + }; + + this.clearSelection = function () { + this._$fake_caret.remove(); + this._raw_caret = undefined; + rangy.getSelection(this.my_window).removeAllRanges(); }; var state_to_str = {};
Fixed popSelection to clear the selection when needed.
mangalam-research_wed
train
js
ef5ccfd38544d69eaf2e344f10f02b7c496ad096
diff --git a/pandas/core/generic.py b/pandas/core/generic.py index <HASH>..<HASH> 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2780,7 +2780,7 @@ class NDFrame(PandasObject, SelectionMixin, indexing.IndexingMixin): protocol : int Int which indicates which protocol should be used by the pickler, default HIGHEST_PROTOCOL (see [1]_ paragraph 12.1.2). The possible - values are 0, 1, 2, 3, 4. A negative value for the protocol + values are 0, 1, 2, 3, 4, 5. A negative value for the protocol parameter is equivalent to setting its value to HIGHEST_PROTOCOL. .. [1] https://docs.python.org/3/library/pickle.html.
DOC: Add protocol value '5' to pickle #<I> (#<I>)
pandas-dev_pandas
train
py
2149ba79314009a9355ff34c1d583994d2b4fa8c
diff --git a/src/test/java/noraui/Runner.java b/src/test/java/noraui/Runner.java index <HASH>..<HASH> 100644 --- a/src/test/java/noraui/Runner.java +++ b/src/test/java/noraui/Runner.java @@ -17,7 +17,7 @@ public class Runner { */ @BeforeClass public static void setUpClass() { - Context.getInstance().initializeEnv("demoGherkin.properties"); + Context.getInstance().initializeEnv("demoExcel.properties"); Context.getInstance().initializeRobot(Runner.class); }
Use demoExcel.properties because demoGherkin can't be used with serialized data
NoraUi_NoraUi
train
java
bbb3c392768e098c9e4c3120cc026643e3426679
diff --git a/Lib/fontbakery/specifications/googlefonts_test.py b/Lib/fontbakery/specifications/googlefonts_test.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/googlefonts_test.py +++ b/Lib/fontbakery/specifications/googlefonts_test.py @@ -297,7 +297,21 @@ def test_id_006(): assert status == PASS -# TODO: test_id_007 +def test_id_007(): + """ Font designer field in METADATA.pb must not be 'unknown'. """ + from fontbakery.specifications.googlefonts import \ + (check_font_designer_field_is_not_unknown, + metadata) + good = metadata("data/test/merriweather/") + print('Test PASS with a good METADATA.pb file...') + status, message = list(check_font_designer_field_is_not_unknown(good))[-1] + assert status == PASS + + bad = metadata("data/test/merriweather/") + bad.designer = "unknown" + print('Test FAIL with a bad METADATA.pb file...') + status, message = list(check_font_designer_field_is_not_unknown(bad))[-1] + assert status == FAIL def test_id_008(mada_ttFonts):
pytest: test/<I> (issue #<I>)
googlefonts_fontbakery
train
py
09ef34c2c1c1f10276cb2715ba4910ceab5cc2bb
diff --git a/examples/mnist_mlp_spark.py b/examples/mnist_mlp_spark.py index <HASH>..<HASH> 100644 --- a/examples/mnist_mlp_spark.py +++ b/examples/mnist_mlp_spark.py @@ -18,6 +18,10 @@ batch_size = 64 nb_classes = 10 nb_epoch = 3 +# Create Spark context +conf = SparkConf().setAppName('Mnist_Spark_MLP') # .setMaster('local[8]') +sc = SparkContext(conf=conf) + # Load data (X_train, y_train), (X_test, y_test) = mnist.load_data() @@ -48,10 +52,6 @@ model.add(Activation('softmax')) sgd = SGD(lr=0.1) model.compile(loss='categorical_crossentropy', optimizer=sgd) -# Create Spark context -conf = SparkConf().setAppName('Mnist_Spark_MLP') # .setMaster('local[8]') -sc = SparkContext(conf=conf) - # Build RDD from numpy features and labels rdd = to_simple_rdd(sc, X_train, Y_train)
Initialize SparkContext first to avoid timeout problem on YARN.
maxpumperla_elephas
train
py
4b324d001345d20b007107e506b89fbfe45b725d
diff --git a/optimizely/event/user_event_factory.py b/optimizely/event/user_event_factory.py index <HASH>..<HASH> 100644 --- a/optimizely/event/user_event_factory.py +++ b/optimizely/event/user_event_factory.py @@ -1,4 +1,4 @@ -# Copyright 2019 Optimizely +# Copyright 2019, 2021 Optimizely # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -45,12 +45,12 @@ class UserEventFactory(object): if not activated_experiment and rule_type is not enums.DecisionSources.ROLLOUT: return None - variation, experiment_key = None, None + variation, experiment_id = None, None if activated_experiment: - experiment_key = activated_experiment.key + experiment_id = activated_experiment.id - if variation_id and experiment_key: - variation = project_config.get_variation_from_id(experiment_key, variation_id) + if variation_id and experiment_id: + variation = project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id) event_context = user_event.EventContext( project_config.account_id, project_config.project_id, project_config.revision, project_config.anonymize_ip, )
Fix Impression Events - Variation lookup by id and Experiment id (#<I>) * Fix in user_event_factory to use experiment_id to lookup variation for impression events. * Update License Header to <I>.
optimizely_python-sdk
train
py
a092b060eb583cd1ee4d94170f348a6222256c30
diff --git a/server/request_handling.go b/server/request_handling.go index <HASH>..<HASH> 100644 --- a/server/request_handling.go +++ b/server/request_handling.go @@ -1048,9 +1048,15 @@ func (s *GardenServer) streamInput(decoder *json.Decoder, in *io.PipeWriter, pro case payload.Signal != nil: switch *payload.Signal { case garden.SignalKill: - process.Signal(garden.SignalKill) + err = process.Signal(garden.SignalKill) + if err != nil { + s.logger.Error("stream-input-process-signal-kill-failed", err, lager.Data{"payload": payload}) + } case garden.SignalTerminate: - process.Signal(garden.SignalTerminate) + err = process.Signal(garden.SignalTerminate) + if err != nil { + s.logger.Error("stream-input-process-signal-terminate-failed", err, lager.Data{"payload": payload}) + } default: s.logger.Error("stream-input-unknown-process-payload-signal", nil, lager.Data{"payload": payload}) in.Close()
Improve logging of process signalling. [#<I>]
cloudfoundry_garden
train
go
7e686cdcabb7a6ad9e393dd4b6052344fc70c08e
diff --git a/src/app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.2.1-2.2.2.php b/src/app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.2.1-2.2.2.php index <HASH>..<HASH> 100644 --- a/src/app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.2.1-2.2.2.php +++ b/src/app/code/community/Fontis/Australia/sql/australia_setup/mysql4-upgrade-2.2.1-2.2.2.php @@ -20,7 +20,7 @@ $installer = $this; $installer->startSetup(); $installer->run( - "ALTER TABLE `australia_eparcel`" + "ALTER TABLE {$this->getTable('australia_eparcel')}" . " ADD `charge_code_individual` VARCHAR( 50 ) NULL DEFAULT NULL," . " ADD `charge_code_business` VARCHAR( 50 ) NULL DEFAULT NULL" );
Allowing extension to run on prefixed database tables.
fontis_fontis_australia
train
php
a9a19af37b688122bc3614e447b135a9663bd252
diff --git a/nose/test_diskdf.py b/nose/test_diskdf.py index <HASH>..<HASH> 100644 --- a/nose/test_diskdf.py +++ b/nose/test_diskdf.py @@ -47,6 +47,17 @@ def test_surfaceSigmaProfile_formatStringParams(): assert essp.formatStringParams()[2] == r'%6.4f', "surfaceSigmaProfile's formatStringParams does not behave as expected" return None +def test_dfsetup_surfaceSigmaProfile(): + df= dehnendf(profileParams=(0.25,0.75,0.1), + beta=0.,correct=False) + from galpy.df import expSurfaceSigmaProfile + essp= expSurfaceSigmaProfile(params=(0.25,0.75,0.1)) + df_alt= dehnendf(surfaceSigma=essp, + beta=0.,correct=False) + assert numpy.all(numpy.fabs(numpy.array(df._surfaceSigmaProfile._params) + -numpy.array(df_alt._surfaceSigmaProfile._params)) < 10.**-10.), 'diskdf setup with explicit surfaceSigmaProfile class does not give the same profile as with parameters only' + return None + # Tests for cold population, flat rotation curve: <vt> =~ v_c def test_dehnendf_cold_flat_vt(): df= dehnendf(profileParams=(0.3333333333333333,1.0, 0.01),
test diskdf setup with explicit surfaceSigmaProfile class
jobovy_galpy
train
py
bbdd950075463514e467089c1da53a50d9257d8a
diff --git a/resources/lang/de-DE/dashboard.php b/resources/lang/de-DE/dashboard.php index <HASH>..<HASH> 100644 --- a/resources/lang/de-DE/dashboard.php +++ b/resources/lang/de-DE/dashboard.php @@ -35,6 +35,7 @@ return [ 'failure' => 'Etwas ist mit dem Aktualisieren des Vorfall Updates schief gelaufen', ], ], + 'reported_by' => 'Reported by :user', 'add' => [ 'title' => 'Ereignis hinzufügen', 'success' => 'Ereignis hinzugefügt.',
New translations dashboard.php (German)
CachetHQ_Cachet
train
php
5ae964a3290557726301299a4056e6bdef4a13cc
diff --git a/pycbc/workflow/jobsetup.py b/pycbc/workflow/jobsetup.py index <HASH>..<HASH> 100644 --- a/pycbc/workflow/jobsetup.py +++ b/pycbc/workflow/jobsetup.py @@ -426,10 +426,10 @@ class JobSegmenter(object): else: # Pick the tile size that is closest to 1/3 of the science segment target_size = seg_size / 3 - pick, pick_size = 0, valid_lengths[0] + pick, pick_diff = 0, abs(valid_lengths[0] - target_size) for i, size in enumerate(valid_lengths): - if abs(size - target_size) < pick_size: - pick, pick_size = i, size + if abs(size - target_size) < pick_diff: + pick, pick_diff = i, abs(size - target_size) return data_lengths[pick], valid_chunks[pick], valid_lengths[pick] def get_valid_times_for_job(self, num_job, allow_overlap=True):
fix the tile choosing algorithm to use the difference between the target and the choice
gwastro_pycbc
train
py
d0cc08272ed73a77d8e13ff5f2546d6ed4fa1975
diff --git a/lib/commonAPI/ConnectionChecking/ext/platform/android/src/com/rho/connectionchecking/ConnectionCheckingService.java b/lib/commonAPI/ConnectionChecking/ext/platform/android/src/com/rho/connectionchecking/ConnectionCheckingService.java index <HASH>..<HASH> 100644 --- a/lib/commonAPI/ConnectionChecking/ext/platform/android/src/com/rho/connectionchecking/ConnectionCheckingService.java +++ b/lib/commonAPI/ConnectionChecking/ext/platform/android/src/com/rho/connectionchecking/ConnectionCheckingService.java @@ -295,6 +295,13 @@ private void navigatetoBadLink() Logger.E(TAG, "excetion in Thread run()"+e.getMessage()); } } + + if(isDialoguePresent) + { + killDialogue(); + isDialoguePresent=false; + counterTimeout=0; + } System.out.println("Thread is about to exit"); }
Update ConnectionCheckingService.java To check a special case when dialogue was coming on top of licensing screen
rhomobile_rhodes
train
java
2e01a9972edf328ac8476e6123c04c8e2b5a2dd5
diff --git a/spec/amq/protocol_spec.rb b/spec/amq/protocol_spec.rb index <HASH>..<HASH> 100644 --- a/spec/amq/protocol_spec.rb +++ b/spec/amq/protocol_spec.rb @@ -57,9 +57,8 @@ describe AMQ::Protocol do AMQ::Protocol::Connection::StartOk.name.should eql("connection.start-ok") end - it "should have method equal to TODO" do - pending - AMQ::Protocol::Connection::StartOk.method.should eql("TODO") + it "should have method equal to 11" do + AMQ::Protocol::Connection::StartOk.method_id.should == 11 end describe ".encode" do
connection.start-ok has method id of <I>
ruby-amqp_amq-protocol
train
rb
195e40ac3cf5813d5779e93e23733feb08de7ed1
diff --git a/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java b/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java index <HASH>..<HASH> 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java +++ b/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java @@ -22,6 +22,7 @@ package org.sonar.batch.indexer; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import org.apache.commons.lang.math.NumberUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.batch.Event; @@ -311,7 +312,7 @@ public class DefaultSonarIndex extends SonarIndex { ResourceUtils.isEntity(resource) && metric.isOptimizedBestValue() == Boolean.TRUE && metric.getBestValue() != null && - Double.compare(metric.getBestValue(), measure.getValue())==0 && + NumberUtils.compare(metric.getBestValue(), measure.getValue())==0 && !measure.hasOptionalData()); }
compare doubles with NumberUtils.compare() instead of Double.compare()
SonarSource_sonarqube
train
java
8d480a4985ff26708b1e1fc6fb08170feadc8e0a
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -14,7 +14,7 @@ module.exports = { packageTTL: parseInt(env.CACHE_PACKAGE_TTL) || 60, tarballTTL: parseInt(env.CACHE_TARBALL_TTL) || (6 * 60 * 60) }, - fs: {directory: env.NPM_REGISTER_FS_DIRECTORY || 'fs'}, + fs: {directory: env.NPM_REGISTER_FS_DIRECTORY || 'tmp'}, s3: {bucket: env.AWS_S3_BUCKET} } diff --git a/lib/storage/fs.js b/lib/storage/fs.js index <HASH>..<HASH> 100644 --- a/lib/storage/fs.js +++ b/lib/storage/fs.js @@ -9,7 +9,7 @@ const Stream = require('stream') class FS extends require('./base') { constructor () { super() - this.directory = path.resolve(config.fs.directory || 'fs') + this.directory = path.resolve(config.fs.directory) console.error(`Saving files to local filesystem at ${this.directory}`) if (!config.fs.directory) console.error('Set NPM_REGISTER_FS_DIRECTORY to change directory') }
fix: default fs path should be './tmp' according to the README (#<I>)
jdxcode_npm-register
train
js,js
d7b6c38ff7724caec702b20c2927e6b00d525c65
diff --git a/web/js/GMap.js b/web/js/GMap.js index <HASH>..<HASH> 100644 --- a/web/js/GMap.js +++ b/web/js/GMap.js @@ -3,6 +3,13 @@ (function () { "use strict"; + if (!window.google) { + tangelo.GMap = function () { + throw "Use of the GMap class requires loading the Google Map API *before* loading Tangelo."; + }; + return; + } + tangelo.GMap = function (elem, mapoptions, cfg) { var that;
Preventing Tangelo loading errors for apps that don't use Google Maps.
Kitware_tangelo
train
js
42118b087bcb1b759b55be10115c6641c78b52a9
diff --git a/src/_picker/DropdownMenu.js b/src/_picker/DropdownMenu.js index <HASH>..<HASH> 100644 --- a/src/_picker/DropdownMenu.js +++ b/src/_picker/DropdownMenu.js @@ -108,6 +108,8 @@ class DropdownMenu extends React.Component<Props> { dropdownMenuItemComponentClass: DropdownMenuItem } = this.props; + this.menuItems = {}; + const createMenuItems = (items = [], groupId = 0) => items.map((item, index) => { const value = item[valueKey];
Fix: option value error when current keyboard operation option on `<TagPicker>` (#<I>)
rsuite_rsuite
train
js
bebefd8b80acb92ccfb34d2bc3bd1c723a700252
diff --git a/server/etcdserver/api/v3rpc/watch.go b/server/etcdserver/api/v3rpc/watch.go index <HASH>..<HASH> 100644 --- a/server/etcdserver/api/v3rpc/watch.go +++ b/server/etcdserver/api/v3rpc/watch.go @@ -346,8 +346,9 @@ func (sws *serverWatchStream) recvLoop() error { } default: // we probably should not shutdown the entire stream when - // receive an valid command. + // receive an invalid command. // so just do nothing instead. + sws.lg.Warn("invalid watch request received in gRPC stream") continue } }
chore: log when an invalid watch request is received As protobuf doesn't have required field, user may send an empty WatchRequest by mistake. Currently, etcd will ignore the invalid request and keep the stream opening. If we don't reject the invalid request by closing the stream, it would be better to leave a log there. This commit also fixes a typo in the comment.
etcd-io_etcd
train
go
17eefbab8dba9b96f751671d7624e4b8d55f7249
diff --git a/lib/assets/javascripts/_modules/search.js b/lib/assets/javascripts/_modules/search.js index <HASH>..<HASH> 100644 --- a/lib/assets/javascripts/_modules/search.js +++ b/lib/assets/javascripts/_modules/search.js @@ -3,8 +3,6 @@ (function ($, Modules) { 'use strict' - s.lunrIndex; - s.lunrData; Modules.Search = function Search () { var s = this var $html = $('html') @@ -160,7 +158,7 @@ content = $(content).mark(query) // Split content by sentence. - var sentences = content.html().replace(/(\.+|\:|\!|\?|\r|\n)(\"*|\'*|\)*|}*|]*)/gm, "|").split("|"); + var sentences = content.html().replace(/(\.+|:|!|\?|\r|\n)("*|'*|\)*|}*|]*)/gm, '|').split('|') // Select the first five sentences that contain a <mark> var selectedSentences = []
Fixes issues in search.js identified by Standard Theres no need to declare two properties on `s` variable as they will be added to `s` when they are first useds. Standard also raised an issue on unnessary escaping in the regex which is why I removed the couple `\` in the regex.
alphagov_tech-docs-gem
train
js
3bcaf7e8225e4f19ccde99bac29fb3ba57dad4f5
diff --git a/nailgun/entities.py b/nailgun/entities.py index <HASH>..<HASH> 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -4152,7 +4152,7 @@ class User( 'login': entity_fields.StringField( length=(1, 100), required=True, - str_type=('alpha', 'alphanumeric', 'cjk', 'latin1', 'utf8'), + str_type=('alpha', 'alphanumeric', 'cjk', 'latin1'), ), 'mail': entity_fields.EmailField(required=True), 'organization': entity_fields.OneToManyField(Organization),
utf8 value for login is removed as it is rejected by satellite
SatelliteQE_nailgun
train
py
209cf6ede36b95d33a2af30621d93f4ad124dd98
diff --git a/gump.class.php b/gump.class.php index <HASH>..<HASH> 100644 --- a/gump.class.php +++ b/gump.class.php @@ -398,7 +398,7 @@ class GUMP { return array( 'field' => $field, - 'value' => $input[$field], + 'value' => NULL, 'rule' => __FUNCTION__ ); }
Fixing validate_required() to not return the value of the field if it does not exist
Wixel_GUMP
train
php
746faa5d4930f2f67e0e0cadda95eeb1c3c3ba7b
diff --git a/webmap/__init__.py b/webmap/__init__.py index <HASH>..<HASH> 100644 --- a/webmap/__init__.py +++ b/webmap/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -__version__ = '0.8.0' +__version__ = '0.8.1' default_app_config = 'webmap.apps.WebmapConfig' diff --git a/webmap/urls.py b/webmap/urls.py index <HASH>..<HASH> 100644 --- a/webmap/urls.py +++ b/webmap/urls.py @@ -5,10 +5,10 @@ from .rest import router from django.conf import settings -urlpatterns = ( +urlpatterns = [ url(r'^kml/([-\w]+)/$', views.kml_view), url(r'^search/([- \w]+)/$', views.search_view), -) +] if getattr(settings, 'REST_ENABLED', False): urlpatterns.append(url(r'^', include(router.urls)))
make url patterns appendable, bump minor version
auto-mat_django-webmap-corpus
train
py,py
fdf82390af28ed86e08bc26ef85ffacd72dc9948
diff --git a/src/Common/Identity.php b/src/Common/Identity.php index <HASH>..<HASH> 100644 --- a/src/Common/Identity.php +++ b/src/Common/Identity.php @@ -280,7 +280,7 @@ class Identity implements IdentityInterface return $this; } - private function arrayException($value) + protected function arrayException($value) { if (is_array($value)) { throw new \Exception('Value cannot be array', 101); @@ -299,7 +299,7 @@ class Identity implements IdentityInterface * @param string $value * @throws \Exception */ - private function operator($symbol, $value) + protected function operator($symbol, $value) { if ($this->isVoid()) { throw new \Exception('Field is not defined', 101);
<I> - 2 private methods changed to protected so they can be used in child classes.
g4code_data-mapper
train
php
490cf31a38a8ca3828f55b80e92537113e90d976
diff --git a/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocbookBuildUtilities.java b/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocbookBuildUtilities.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocbookBuildUtilities.java +++ b/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocbookBuildUtilities.java @@ -323,10 +323,10 @@ public class DocbookBuildUtilities { } if (bookVersion == null) { - rev.append(BuilderConstants.DEFAULT_EDITION + ".0"); + rev.append(BuilderConstants.DEFAULT_EDITION + ".0.0"); } else if (contentSpec.getEdition().matches("^[0-9]+\\.[0-9]+\\.[0-9]+$")) { rev.append(bookVersion); - } else if (contentSpec.getEdition().matches("^[0-9]+\\.[0-9]+(\\.[0-9]+)?$")) { + } else if (contentSpec.getEdition().matches("^[0-9]+\\.[0-9]+$")) { rev.append(bookVersion + ".0"); } else { rev.append(bookVersion + ".0.0");
Fixed a bug in the generateRevision method, where in some cases not enough 0's were appended.
pressgang-ccms_PressGangCCMSBuilder
train
java
31190018a9144da6a2165bf13306af5c7419a194
diff --git a/core/codeWriter.js b/core/codeWriter.js index <HASH>..<HASH> 100644 --- a/core/codeWriter.js +++ b/core/codeWriter.js @@ -97,7 +97,8 @@ if (APPLY_LINE_NUMBERS) { var l = code.split("\n"); var i = 0; - while (l[i] && l[i].substr(0,8)=="Modules.") i++; + while (l[i] && (l[i].substr(0,8)=="Modules." || + l[i].substr(0,8)=="setTime(")) i++; lineNumberOffset = -i; }
add one more hack to work around debugging lines when modules and setTime are used
espruino_EspruinoTools
train
js
1977e081c33eecce63ec8a01c5ff2779b8b6d8f6
diff --git a/commands/release/stage/command.go b/commands/release/stage/command.go index <HASH>..<HASH> 100644 --- a/commands/release/stage/command.go +++ b/commands/release/stage/command.go @@ -154,7 +154,7 @@ func runMain() (err error) { // Delete the local release branch. task = fmt.Sprintf("Delete branch '%v'", releaseBranch) log.Run(task) - if err := git.Branch("-d", releaseBranch); err != nil { + if err := git.Branch("-D", releaseBranch); err != nil { return errs.NewError(task, err) } defer action.RollbackTaskOnError(&err, task, action.ActionFunc(func() error {
release stage: Use git branch -D Use -D while deleting the local release branch. Story-Id: unassigned Change-Id: a0b5b<I>b7
salsaflow_salsaflow
train
go
4515aa59fb32bb3eb73b7d4aae2ce4ecdcf4040e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,8 @@ var rework = require('rework'), color = require('rework-color'), autoprefixer = require('autoprefixer'), read = require('fs-extra').readFileSync, - write = require('fs-extra').writeFileSync; + write = require('fs-extra').writeFileSync, + exists = require('fs-extra').existsSync; module.exports = function(options) { options = options || {}; @@ -13,7 +14,7 @@ module.exports = function(options) { browsers = options.browsers || [], output; - if (!src) { + if (!exists(src)) { throw new Error("Sorry, I couldn't find an input file. Did you supply one?"); }
Updating source file check to test for existence of file not just a string being passed.
topcoat_resin
train
js
56ccfd3a67149d7955e49b76c28e9727a87ed286
diff --git a/peek_plugin_base/__init__.py b/peek_plugin_base/__init__.py index <HASH>..<HASH> 100644 --- a/peek_plugin_base/__init__.py +++ b/peek_plugin_base/__init__.py @@ -1,4 +1,4 @@ __project__ = 'Synerty Peek' __copyright__ = '2016, Synerty' __author__ = 'Synerty' -__version__ = '0.8.0' \ No newline at end of file +__version__ = '0.8.1' \ No newline at end of file diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from setuptools import find_packages pip_package_name = "peek-plugin-base" py_package_name = "peek_plugin_base" -package_version = '0.8.0' +package_version = '0.8.1' egg_info = "%s.egg-info" % pip_package_name if os.path.isdir(egg_info):
Updated to version <I>
Synerty_peek-plugin-base
train
py,py
ce8870ef8f28a7d6a889a0489ef23bbd51a33a03
diff --git a/cartoframes/utils/utils.py b/cartoframes/utils/utils.py index <HASH>..<HASH> 100644 --- a/cartoframes/utils/utils.py +++ b/cartoframes/utils/utils.py @@ -21,6 +21,18 @@ try: except NameError: basestring = str +if sys.version_info < (3, 0): + from io import BytesIO + from gzip import GzipFile + + def compress(data): + buf = BytesIO() + with GzipFile(fileobj=buf, mode='wb') as f: + f.write(data) + return buf.getvalue() + + gzip.compress = compress + GEOM_TYPE_POINT = 'point' GEOM_TYPE_LINE = 'line'
Fix gzip.compress in P<I>
CartoDB_cartoframes
train
py
1466394c0b6e5bb8f98ea66adc1de429dca9e5c8
diff --git a/indra/assemblers/pysb/kappa_util.py b/indra/assemblers/pysb/kappa_util.py index <HASH>..<HASH> 100644 --- a/indra/assemblers/pysb/kappa_util.py +++ b/indra/assemblers/pysb/kappa_util.py @@ -159,7 +159,15 @@ def cm_json_to_graph(cm_json): graph : pygraphviz.Agraph A graph representing the contact map. """ + # This is for kappy compatibility: as of 4.1.2, im_json is a string, + # whereas before it was a json object + if isinstance(cm_json, str): + cm_json = json.loads(cm_json) cmap_data = cm_json['contact map']['map'] + # There also seems to be an additional level of nesting in a one-element + # list that we can unpack here + if len(cmap_data) == 1 and isinstance(cmap_data[0], list): + cmap_data = cmap_data[0] # Initialize the graph graph = AGraph()
Start adapting to changes for CM structure
sorgerlab_indra
train
py
0f105effca371ea03cd3a1a4264c4bbe7990d2ce
diff --git a/hwtypes/bit_vector.py b/hwtypes/bit_vector.py index <HASH>..<HASH> 100644 --- a/hwtypes/bit_vector.py +++ b/hwtypes/bit_vector.py @@ -281,6 +281,8 @@ class BitVector(AbstractBitVector): @bv_cast def bvurem(self, other): other = other.as_uint() + if other == 0: + return self return type(self)(self.as_uint() % other) # bvumod
Implement the corner case of x % 0
leonardt_hwtypes
train
py
15a0b27f6517482cfab5bd8e166e14ecd12d61e6
diff --git a/Form/Admin/ProducerFormBuilder.php b/Form/Admin/ProducerFormBuilder.php index <HASH>..<HASH> 100755 --- a/Form/Admin/ProducerFormBuilder.php +++ b/Form/Admin/ProducerFormBuilder.php @@ -40,6 +40,9 @@ class ProducerFormBuilder extends AbstractFormBuilder $name = $languageData->addChild($this->getElement('text_field', [ 'name' => 'name', 'label' => $this->trans('common.label.name'), + 'rules' => [ + $this->getRule('required') + ], ])); $languageData->addChild($this->getElement('slug_field', [ @@ -47,7 +50,10 @@ class ProducerFormBuilder extends AbstractFormBuilder 'label' => $this->trans('common.label.slug'), 'name_field' => $name, 'generate_route' => 'admin.routing.generate', - 'translatable_id' => $this->getRequestHelper()->getAttributesBagParam('id') + 'translatable_id' => $this->getRequestHelper()->getAttributesBagParam('id'), + 'rules' => [ + $this->getRule('required') + ], ])); $metaData = $form->addChild($this->getElement('nested_fieldset', [
Added rule required to all forms (cherry picked from commit 0ffd7c3b<I>f<I>d<I>bf9b<I>bebeb<I>)
WellCommerce_WishlistBundle
train
php
44ece17716e0bc0ff7107831822ce3b1f227e9c1
diff --git a/src/Http/Controller.php b/src/Http/Controller.php index <HASH>..<HASH> 100644 --- a/src/Http/Controller.php +++ b/src/Http/Controller.php @@ -7,6 +7,7 @@ use Illuminate\Contracts\Config\Repository; use Illuminate\Contracts\Validation\ValidatesWhenResolved; use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; +use Illuminate\Routing\ResourceRegistrar; use Illuminate\Routing\ResponseFactory; use Illuminate\Support\Collection; use Larapie\Contracts\TransformableContract; @@ -167,7 +168,9 @@ class Controller extends BaseController protected function findModel($model, $resourceName) { - return call_user_func([$model, 'find'], $this->request->route($resourceName)); + $id = $this->findIdInRoute($resourceName); + + return call_user_func([$model, 'find'], $id); } protected function notFound() @@ -260,4 +263,13 @@ class Controller extends BaseController } } } + + protected function findIdInRoute($resourceName) + { + $id = $this->request->route($resourceName) + ?: $this->request->route(str_plural($resourceName)) + ?: $this->request->route(str_singular($resourceName)); + + return $id; + } }
Handling singular/plural resources in any case
thomasruiz_larapie
train
php
38d9299ae3cb95cd5eb354008dc19884d00f7edc
diff --git a/Nominatim.php b/Nominatim.php index <HASH>..<HASH> 100644 --- a/Nominatim.php +++ b/Nominatim.php @@ -48,8 +48,9 @@ final class Nominatim extends AbstractHttpProvider implements Provider private $referer; /** - * @param HttpClient $client - * @param string|null $locale + * @param HttpClient $client an HTTP client + * @param string $userAgent Value of the User-Agent header + * @param string $referer Value of the Referer header * * @return Nominatim */ @@ -59,8 +60,10 @@ final class Nominatim extends AbstractHttpProvider implements Provider } /** - * @param HttpClient $client an HTTP adapter - * @param string $rootUrl Root URL of the nominatim server + * @param HttpClient $client an HTTP client + * @param string $rootUrl Root URL of the nominatim server + * @param string $userAgent Value of the User-Agent header + * @param string $referer Value of the Referer header */ public function __construct(HttpClient $client, $rootUrl, string $userAgent, string $referer = '') {
[Nominatim] Updated doc blocks (#<I>) * Updated doc blocks * cs
geocoder-php_nominatim-provider
train
php
d2f1815c20427e22cf3984b2c4786db70e573d0f
diff --git a/pyqtree.py b/pyqtree.py index <HASH>..<HASH> 100644 --- a/pyqtree.py +++ b/pyqtree.py @@ -343,4 +343,9 @@ class Index(_QuadTree): Returns: - A list of inserted items whose bounding boxes intersect with the input bbox. """ - return list(set(self._intersect(bbox))) + uniq = [] + for item in self._intersect(bbox): + if item not in uniq: + uniq.append(item) + + return uniq diff --git a/pyqtree_test.py b/pyqtree_test.py index <HASH>..<HASH> 100644 --- a/pyqtree_test.py +++ b/pyqtree_test.py @@ -5,7 +5,7 @@ INDEX_BBOX = (0, 0, 10, 10) ITEM1 = 'Item 1' BBOX1 = (0, 0, 0, 0) -ITEM2 = 'Item 2' +ITEM2 = {'name': 'Item 2'} # non-hashable BBOX2 = (1, 1, 1, 1)
Add support for non-hashable items
karimbahgat_Pyqtree
train
py,py
70c4a1a96b5392e0113638711be8e9864d807848
diff --git a/lib/sensu/transport/base.rb b/lib/sensu/transport/base.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/transport/base.rb +++ b/lib/sensu/transport/base.rb @@ -60,7 +60,7 @@ module Sensu # @param options [Hash, String] # @return [Transport] the transport object. def self.connect(options={}) - options ||= Hash.new + options ||= {} transport = self.new transport.connect(options) transport
use {} instead of Hash.new, consistency
sensu_sensu-transport
train
rb
4db2e161bf1293cdd93343df671058270fd2d519
diff --git a/winsetup.py b/winsetup.py index <HASH>..<HASH> 100644 --- a/winsetup.py +++ b/winsetup.py @@ -64,6 +64,10 @@ def main(): '--title="PyTango 9" ' \ '--bitmap="%s" ' \ '--plat-name=%s ' % (ver, bdist_dir, dist_dir, bitmap, plat_name) + cmd_line += 'bdist_wheel --skip-build ' \ + '--bdist-dir=%s ' \ + '--dist-dir=%s ' \ + '--plat-name=%s ' % (bdist_dir, dist_dir, plat_name) os.system(cmd_line) except: print("Failed:")
winsetup: add support to build wheel
tango-controls_pytango
train
py
28eaa95c1f5f9b58c81414ed5921fafa33e6b3f6
diff --git a/quark/ast.py b/quark/ast.py index <HASH>..<HASH> 100644 --- a/quark/ast.py +++ b/quark/ast.py @@ -296,8 +296,10 @@ class Callable(Definition): return result def copy(self): - return self.__class__(copy(self.type), copy(self.name), - copy(self.params), copy(self.body)) + result = self.__class__(copy(self.type), copy(self.name), + copy(self.params), copy(self.body)) + result.static = self.static + return result class Function(Callable): pass @@ -413,7 +415,9 @@ class Declaration(AST): return result def copy(self): - return self.__class__(copy(self.type), copy(self.name), copy(self.value)) + result = self.__class__(copy(self.type), copy(self.name), copy(self.value)) + result.static = self.static + return result class Param(Declaration): pass
Keep static-ness when copy()ing Callable and Declaration AST nodes
datawire_quark
train
py
01cef5243d8137468d9e94d34fbf82694c774f8e
diff --git a/appframe-express.js b/appframe-express.js index <HASH>..<HASH> 100644 --- a/appframe-express.js +++ b/appframe-express.js @@ -162,13 +162,13 @@ module.exports = require('appframe')().registerPlugin({ app.server.use(function(req, res, next){ req.id = app.random(128) + '-' + req.originalUrl; requests[req.id] = true; - app.emit('express.request_open', req.id); + app.emit('express.request_open', req); if(app.config.debug){ app.info('> REQ: ' + req.originalUrl, req.id); } var cleanup = function(){ delete requests[req.id]; - app.emit('express.request_finish', req.id); + app.emit('express.request_finish', req); }; res.on('finish', cleanup); res.on('close', cleanup);
Emit full request object on every request for logging purposes
nodecraft_spawnpoint-express
train
js
1ab96b4676dd734caded3df773dc0f8416ec3797
diff --git a/example/client-server.js b/example/client-server.js index <HASH>..<HASH> 100644 --- a/example/client-server.js +++ b/example/client-server.js @@ -8,8 +8,7 @@ * client can then set and get these values using method calls. */ -var http = require('http') - , xmlrpc = require('../lib/node-xmlrpc.js') +var xmlrpc = require('../lib/node-xmlrpc.js') ////////////////////////////////////////////////////////////////////////
Removes HTTP requirement in example script.
baalexander_node-xmlrpc
train
js
e11551fe6aa3fecc9fcb6ba8767fe791cfd82854
diff --git a/hypermap/aggregator/models.py b/hypermap/aggregator/models.py index <HASH>..<HASH> 100644 --- a/hypermap/aggregator/models.py +++ b/hypermap/aggregator/models.py @@ -48,7 +48,7 @@ class Resource(PolymorphicModel): is_public = models.BooleanField(default=True) def __unicode__(self): - return '%s - %s' % (self.polymorphic_ctype.name, self.title) + return '%s - %s' % (self.polymorphic_ctype.name, self.id) @property def first_check(self): @@ -233,7 +233,7 @@ class Layer(Resource): keywords = TaggableManager() def __unicode__(self): - return self.name + return '%s - %s' % (self.id, self.name) def get_url_endpoint(self): """
Added a better unicode repr for layer
cga-harvard_Hypermap-Registry
train
py
b5f58a06c312b17fcbb10d216e6d883bf2d01101
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ if sys.argv[-1] == 'publish': os.system('python setup.py sdist bdist_wheel upload') sys.exit() -required = ['numpy>=1.14.0'] +required = ['numpy==1.19.2', 'scikit-learn==0.23.2'] setup( name=NAME,
Update setup.py to include scikit-learn
chakki-works_seqeval
train
py
d2634c38c38cbb7069089fc3b189f3742fd92c74
diff --git a/lib/netsuite/utilities.rb b/lib/netsuite/utilities.rb index <HASH>..<HASH> 100644 --- a/lib/netsuite/utilities.rb +++ b/lib/netsuite/utilities.rb @@ -86,6 +86,7 @@ module NetSuite !e.message.include?('com.netledger.common.exceptions.NLDatabaseOfflineException') && !e.message.include?('com.netledger.database.NLConnectionUtil$NoCompanyDbsOnlineException') && !e.message.include?('com.netledger.cache.CacheUnavailableException') && + !e.message.include?('java.lang.IllegalStateException') && !e.message.include?('An unexpected error occurred.') && !e.message.include?('An unexpected error has occurred. Technical Support has been alerted to this problem.') && !e.message.include?('Session invalidation is in progress with different thread') &&
Adding new netsuite error to retry list
NetSweet_netsuite
train
rb
3d4737d4b6e11fed6d3013cdb0e15586ced91e7a
diff --git a/src/backform.js b/src/backform.js index <HASH>..<HASH> 100644 --- a/src/backform.js +++ b/src/backform.js @@ -260,7 +260,7 @@ this.clearInvalid(); - this.$el.find(':input').each(function(ix, el) { + this.$el.find(':input').not('button').each(function(ix, el) { var attrArr = $(el).attr('name').split('.'), name = attrArr.shift(), path = attrArr.join('.'),
Ignoring buttons for model error-checking.
AmiliaApp_backform
train
js
8cd1300ea9dff23cc82527f3cd4cd9c9f41a4ba4
diff --git a/tests/test_gluon_block.py b/tests/test_gluon_block.py index <HASH>..<HASH> 100644 --- a/tests/test_gluon_block.py +++ b/tests/test_gluon_block.py @@ -1,3 +1,4 @@ +import pytest import mxnet as mx from mxnet import nd, np, npx from mxnet.test_utils import assert_allclose @@ -50,6 +51,8 @@ def test_gluon_nonzero_hybridize(): out.wait_to_read() +@pytest.mark.xfail(reason='Expected to fail due to MXNet bug https://github.com/apache/' + 'incubator-mxnet/issues/19659') def test_gluon_boolean_mask(): class Foo(HybridBlock): def forward(self, data, indices):
Unblock CI by skipping the test (#<I>) * Update test_gluon_block.py * Update test_gluon_block.py
dmlc_gluon-nlp
train
py
18a0b33e938e38d6f4e38af14a53431928390314
diff --git a/src/entity/camera.js b/src/entity/camera.js index <HASH>..<HASH> 100755 --- a/src/entity/camera.js +++ b/src/entity/camera.js @@ -182,12 +182,17 @@ /** * set the viewport to follow the specified entity - * @param {Object} Object Entity to follow + * @param {Object} Object ObjectEntity or Position Vector to follow * @param {axis} [axis="AXIS.BOTH"] AXIS.HORIZONTAL, AXIS.VERTICAL, AXIS.BOTH */ follow : function(target, axis) { - this.target = target; + if (target instanceof me.ObjectEntity) + this.target = target.pos; + else if (target instanceof me.Vector2d) + this.target = target; + else + throw "melonJS: invalid target for viewport.follow"; // if axis is null, camera is moved on target center this.follow_axis = axis || this.AXIS.NONE; },
Allowed to specify either an ObjectEntity or a position Vector as Target (Other object type will now throw an exception).
melonjs_melonJS
train
js
5bc20c85e7b1ca63459713a09208b0fe9dd88078
diff --git a/src/components/VCard/VCard.js b/src/components/VCard/VCard.js index <HASH>..<HASH> 100644 --- a/src/components/VCard/VCard.js +++ b/src/components/VCard/VCard.js @@ -22,7 +22,8 @@ export default { type: String, default: 'div' }, - tile: Boolean + tile: Boolean, + width: [String, Number] }, computed: { @@ -47,6 +48,10 @@ export default { style.background = `url("${this.img}") center center / cover no-repeat` } + if (this.width) { + style.width = isNaN(this.width) ? this.width : `${this.width}px` + } + return style } },
feat(v-card): added new **width** prop
vuetifyjs_vuetify
train
js
346ec1934af71b0ff520ad754b5157045a60b7b3
diff --git a/src/vr-controls.js b/src/vr-controls.js index <HASH>..<HASH> 100644 --- a/src/vr-controls.js +++ b/src/vr-controls.js @@ -30,7 +30,7 @@ module.exports = document.registerElement( this.yawObject.add(this.pitchObject); this.setAttribute('locomotion', true); - this.setAttribute('mouse-look', true); + this.setAttribute('mouselook', true); this.attachMouseKeyboardListeners(); this.load();
fix mouselook for vr-controls
aframevr_aframe
train
js
621ac9457af7c4b41b3c7f6eb6f691f1d97b00ba
diff --git a/binance/client.py b/binance/client.py index <HASH>..<HASH> 100644 --- a/binance/client.py +++ b/binance/client.py @@ -6346,4 +6346,4 @@ class Client(object): :type recvWindow: int """ - return self._request_options_api('get', 'userTrades', signed=True, data=params + return self._request_options_api('get', 'userTrades', signed=True, data=params)
Update client.py Add missing bracket
sammchardy_python-binance
train
py
267e63f58078f488e5777911ab0e37893db9fb4b
diff --git a/lib/prey/os/windows/wmic.js b/lib/prey/os/windows/wmic.js index <HASH>..<HASH> 100644 --- a/lib/prey/os/windows/wmic.js +++ b/lib/prey/os/windows/wmic.js @@ -61,6 +61,7 @@ var splitter = function(cmd) { var queue = async.queue(function(cmd,callback) { var wm = spawn("wmic",splitter(cmd)); + var pid = wm.pid; var all = ""; var err = null; @@ -74,15 +75,25 @@ var queue = async.queue(function(cmd,callback) { wm.on('exit',function() { removeTmpFile(); - callback(err,all); + // add a pid to the output string object + callback(err,{data:all,pid:pid}); }); wm.stdin.end(); },1); + +/** + * Run the wmic command provided. + * + * The resulting output string has an additional pid property added so, one may get the process + * details. This seems the easiest way of doing so given the run is in a queue. + **/ var run = exports.run = function(cmd,cb) { - queue.push(cmd,cb); + queue.push(cmd,function(err,o) { + cb(err,o.data,o.pid); + }); }; exports.extractValue = function(str) {
add a pid to the output of wmic.run
prey_prey-node-client
train
js
aeb0963f6a07ea86345935292d7969abc6d3edd5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ function qed(promiser, params) { if (!params.length) { var info = fninfo(promiser) if (info.length === 2 && info[0] === 'req' && info[1] === 'res') { - params = ['req','res'] + params = ['req','res'] } } params = params.map(dot.safe) @@ -40,8 +40,6 @@ function qed(promiser, params) { }).then(null, function (err) { if (res.error) res.error(err) else if (res.send) res.send(500, msg(err)) - - throw err }) }
don't rethrow error
junosuarez_qed
train
js
7f0280dd9d389963132338b46f45603c9daceeb0
diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index <HASH>..<HASH> 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -1,3 +1,4 @@ +import Ember from 'ember'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; @@ -18,6 +19,8 @@ export default function(name, options = {}) { if (options.afterEach) { options.afterEach.apply(this, arguments); } + + Ember.Test.adapter = null; } }); }
Ensure Ember.Test.adapter is removed after acceptance tests.
machty_ember-concurrency
train
js
bfe76d854aaa42fbc03ec4fecc9ef6fbb5af7be3
diff --git a/lib/veewee/provider/virtualbox/box/helper/create.rb b/lib/veewee/provider/virtualbox/box/helper/create.rb index <HASH>..<HASH> 100644 --- a/lib/veewee/provider/virtualbox/box/helper/create.rb +++ b/lib/veewee/provider/virtualbox/box/helper/create.rb @@ -24,7 +24,7 @@ module Veewee def add_ssh_nat_mapping - unless definition.nil? || definition.force_ssh_port + unless definition.nil? || definition.no_nat #Map SSH Ports command="#{@vboxcmd} modifyvm \"#{name}\" --natpf#{self.natinterface} \"guestssh,tcp,,#{definition.ssh_host_port},,#{definition.ssh_guest_port}\"" shell_exec("#{command}")
created a new :no_nat configuration stanza (boolean) separated from force_ssh_port: it is now possible to deactivate one or the other separately
jedi4ever_veewee
train
rb
54b232f9b5dead98329e6f9039307a6cda34302d
diff --git a/tests/test_types.py b/tests/test_types.py index <HASH>..<HASH> 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -5,15 +5,12 @@ from zephyr.types import MISSING, ValidationError, Type, Any, String, \ Field, AttributeField, MethodField, FunctionField, ConstantField, Object, \ Optional, LoadOnly, DumpOnly from zephyr.errors import merge_errors +from zephyr.validators import Predicate from collections import namedtuple def validator(predicate, message='Something went wrong'): - def validate(value): - if not predicate(value): - raise ValidationError(message) - - return validate + return Predicate(predicate, message) def constant_succeed_validator():
Replace custom validator with Predicate in type tests
maximkulkin_lollipop
train
py
4fc8d6117f0c7c4e0f95fbba19929af5a6b95f78
diff --git a/GPy/testing/kernel_tests.py b/GPy/testing/kernel_tests.py index <HASH>..<HASH> 100644 --- a/GPy/testing/kernel_tests.py +++ b/GPy/testing/kernel_tests.py @@ -9,8 +9,6 @@ from GPy.core.parameterization.param import Param verbose = 0 -np.random.seed(50) - class Kern_check_model(GPy.core.Model): """
removed random.seed from the base of kernel_tests.py (the tests still pass)
SheffieldML_GPy
train
py
f7acdd0f572e70cc0d35b6a303d6c89e41201ea9
diff --git a/Swipeable.js b/Swipeable.js index <HASH>..<HASH> 100644 --- a/Swipeable.js +++ b/Swipeable.js @@ -81,7 +81,7 @@ export default class Swipeable extends Component<PropType, StateType> { ); } - componentWillUpdate(props: PropType, state: StateType) { + UNSAFE_componentWillUpdate(props: PropType, state: StateType) { if ( this.props.friction !== props.friction || this.props.overshootLeft !== props.overshootLeft ||
Use UNSAFE_componentWillUpdate in Swipable.js (#<I>) To silence the react warning, ideally we'd migrate to new React apis.
kmagiera_react-native-gesture-handler
train
js
eb1d2c9312c279c3217d913ff85592fe2d577924
diff --git a/lib/rufus/decision.rb b/lib/rufus/decision.rb index <HASH>..<HASH> 100644 --- a/lib/rufus/decision.rb +++ b/lib/rufus/decision.rb @@ -276,6 +276,8 @@ module Decision hash end + alias :run :transform + # Outputs back this table as a CSV String # def to_csv
todo #<I> : run() as an alias to transform()
jmettraux_rufus-decision
train
rb
b86f252c777c160273c8147bbb49b54a5d9fb96c
diff --git a/http/sys_seal.go b/http/sys_seal.go index <HASH>..<HASH> 100644 --- a/http/sys_seal.go +++ b/http/sys_seal.go @@ -13,7 +13,10 @@ import ( func handleSysSeal(core *vault.Core) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Method != "PUT" { + switch r.Method { + case "PUT": + case "POST": + default: respondError(w, http.StatusMethodNotAllowed, nil) return } @@ -33,7 +36,10 @@ func handleSysSeal(core *vault.Core) http.Handler { func handleSysUnseal(core *vault.Core) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Method != "PUT" { + switch r.Method { + case "PUT": + case "POST": + default: respondError(w, http.StatusMethodNotAllowed, nil) return }
Allow POST as well as PUT for seal/unseal command, fits in more with how logical handles things
hashicorp_vault
train
go
3b2201a86235b85f1927df8760282dd45dc6e685
diff --git a/demo/src/screens/MainScreen.js b/demo/src/screens/MainScreen.js index <HASH>..<HASH> 100644 --- a/demo/src/screens/MainScreen.js +++ b/demo/src/screens/MainScreen.js @@ -105,6 +105,7 @@ export default class UiLibExplorerMenu extends Component { text80 placeholder="Search your component.." onChangeText={this.filterExplorerScreens} + autoCorrect={false} /> </View> <ListView
don't auto correct search field in the main screen (of demo app)
wix_react-native-ui-lib
train
js
55ea029b7585ceaacc93ba87ba8860c6d521727c
diff --git a/lib/unobservable.rb b/lib/unobservable.rb index <HASH>..<HASH> 100644 --- a/lib/unobservable.rb +++ b/lib/unobservable.rb @@ -2,6 +2,15 @@ require 'set' module Unobservable + # Unobservable is designed so that it will not interfere with + # existing classes. Rather than injecting an instance_events + # method directly into Module, we have chosen to externalize + # this logic. + # + # In short: instance_events_for produces a list of instance + # events for any module regardless of whether or + # not that module includes the Unobservable::ModuleSupport + # mixin. def self.instance_events_for(mod, include_supers = true) raise TypeError, "Only modules and classes can have instance_events" unless mod.is_a? Module @@ -25,6 +34,12 @@ module Unobservable end module ModuleSupport + + # Returns the list of instance events that are associated with the + # module or class. If include_supers = true, then the list of events + # will also include events defined in superclasses and included modules. + # Otherwise, instance_events will only return the events defined explicitly + # by this module or class. By default, include_supers = true . def instance_events(include_supers = true) if include_supers == false @unobservable_instance_events ||= Set.new @@ -36,6 +51,8 @@ module Unobservable private + + # def attr_event(*names) @unobservable_instance_events ||= Set.new @@ -150,6 +167,7 @@ module Unobservable end + # Pass the specific arguments / block to all of the # event handlers. Return true if there was at least # 1 event handler; return false otherwise.
Added some comments to the code.
briandamaged_unobservable
train
rb
f579b9b5778d34370263756d8099a7b9632364ac
diff --git a/lib/weixin_authorize/api/media.rb b/lib/weixin_authorize/api/media.rb index <HASH>..<HASH> 100644 --- a/lib/weixin_authorize/api/media.rb +++ b/lib/weixin_authorize/api/media.rb @@ -43,11 +43,31 @@ module WeixinAuthorize # } # ] # } - def upload_news(news) + # Option: author, content_source_url + def upload_mass_news(news=[]) upload_news_url = "#{media_base_url}/uploadnews" http_post(upload_news_url, {articles: news}) end + # media_id: 需通过基础支持中的上传下载多媒体文件来得到 + # https://file.api.weixin.qq.com/cgi-bin/media/uploadvideo?access_token=ACCESS_TOKEN + + # return: + # { + # "type":"video", + # "media_id":"IhdaAQXuvJtGzwwc0abfXnzeezfO0NgPK6AQYShD8RQYMTtfzbLdBIQkQziv2XJc", + # "created_at":1398848981 + # } + def upload_mass_video(media_id, title="", desc="") + video_msg = { + "media_id" => media_id, + "title" => title, + "description" => desc + } + + http_post("#{media_base_url}/uploadvideo", video_msg) + end + private def process_file(media)
added #upload_mass_news and #upload_mass_video
lanrion_weixin_authorize
train
rb
e13aa83a8404e26735425efa0be43561c0e2b2c3
diff --git a/templates/genomics/steps/drug_id.py b/templates/genomics/steps/drug_id.py index <HASH>..<HASH> 100644 --- a/templates/genomics/steps/drug_id.py +++ b/templates/genomics/steps/drug_id.py @@ -33,8 +33,8 @@ class GenomicsOfDrugSensitivityInCancerByGene(Resource): def get_interface(self, filename): interface = {} - fhndl = open(filename) - fhndl.next() + fhndl = open(filename, 'rU') + line = fhndl.next() for line in fhndl: parts = line.rstrip('\r\n').split(',') genes = parts[0].split('///')
added universal newline support to gdsc resource
childsish_sofia
train
py
d073f67c7bc2278595f7791cd967467f3a5ce23c
diff --git a/bokeh/plotting_helpers.py b/bokeh/plotting_helpers.py index <HASH>..<HASH> 100644 --- a/bokeh/plotting_helpers.py +++ b/bokeh/plotting_helpers.py @@ -395,7 +395,7 @@ class _list_attr_splat(list): else: return dir(self) -_arg_template = " %s (%s) : \n %s (default %r)" +_arg_template = " %s (%s) : %s (default %r)" _doc_template = """ Configure and add %s glyphs to this Figure. Args: @@ -404,6 +404,19 @@ Args: Keyword Args: %s +Other Parameters: + alpha (float) : an alias to set all alpha keyword args at once + color (Color) : an alias to set all color keyword args at once + data_source (ColumnDataSource) : a user supplied data source + legend (str) : a legend tag for this glyph + x_range_name (str) : name an extra range to use for mapping x-coordinates + y_range_name (str) : name an extra range to use for mapping y-coordinates + level (Enum) : control the render level order for this glyph + +It is also possible to set the color and alpha parameters of a "nonselection" +glyph. To do so, prefix any visual parameter with ``'nonselection_'``. +For example, pass ``nonselection_alpha`` or ``nonselection_fill_alpha``. + Returns: GlyphRenderer """
add renderer and plot params to docs
bokeh_bokeh
train
py
5c1a9d9da5a609629ba46e76a523265d4a98e58d
diff --git a/tests/behat/features/bootstrap/FeatureContext.php b/tests/behat/features/bootstrap/FeatureContext.php index <HASH>..<HASH> 100644 --- a/tests/behat/features/bootstrap/FeatureContext.php +++ b/tests/behat/features/bootstrap/FeatureContext.php @@ -6,6 +6,7 @@ use SilverStripe\BehatExtension\Context\SilverStripeContext, SilverStripe\BehatExtension\Context\BasicContext, SilverStripe\BehatExtension\Context\LoginContext, SilverStripe\BehatExtension\Context\FixtureContext, + SilverStripe\BehatExtension\Context\EmailContext, SilverStripe\Framework\Test\Behaviour\CmsFormsContext, SilverStripe\Framework\Test\Behaviour\CmsUiContext; @@ -41,6 +42,7 @@ class FeatureContext extends SilverStripeContext $this->useContext('LoginContext', new LoginContext($parameters)); $this->useContext('CmsFormsContext', new CmsFormsContext($parameters)); $this->useContext('CmsUiContext', new CmsUiContext($parameters)); + $this->useContext('EmailContext', new EmailContext($parameters)); $fixtureContext = new FixtureContext($parameters); $fixtureContext->setFixtureFactory($this->getFixtureFactory());
Using Behat EmailContext by default
silverstripe_silverstripe-framework
train
php
1de544180ec5598318bf1c8336335bc9f98323c0
diff --git a/packages/create-razzle-app/lib/utils/get-install-cmd.js b/packages/create-razzle-app/lib/utils/get-install-cmd.js index <HASH>..<HASH> 100644 --- a/packages/create-razzle-app/lib/utils/get-install-cmd.js +++ b/packages/create-razzle-app/lib/utils/get-install-cmd.js @@ -10,7 +10,7 @@ module.exports = function getInstallCmd() { } try { - execa.sync('yarnpkg', '--version'); + execa.sync('yarnpkg', ['--version']); cmd = 'yarn'; } catch (e) { cmd = 'npm';
fix #<I> (#<I>)
jaredpalmer_razzle
train
js
add1479a4094f48933e1b7c76c50e42851ecf322
diff --git a/eng/tox/install_depend_packages.py b/eng/tox/install_depend_packages.py index <HASH>..<HASH> 100644 --- a/eng/tox/install_depend_packages.py +++ b/eng/tox/install_depend_packages.py @@ -32,7 +32,8 @@ MINIMUM_VERSION_SUPPORTED_OVERRIDE = { 'msrest': '0.6.10', 'six': '1.9', 'typing-extensions': '3.6.5', - 'opentelemetry-api': '1.3.0' + 'opentelemetry-api': '1.3.0', + 'cryptography': '3.3' } def install_dependent_packages(setup_py_file_path, dependency_type, temp_dir):
override mindependency for cryptography (#<I>)
Azure_azure-sdk-for-python
train
py
37c54153fa4986274556706009c32188ce1895b4
diff --git a/discovery/gossiper.go b/discovery/gossiper.go index <HASH>..<HASH> 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -251,6 +251,7 @@ func (d *AuthenticatedGossiper) SynchronizeNode(pub *btcec.PublicKey) error { NodeID: node.PubKey, Alias: alias, Features: node.Features.RawFeatureVector, + RGBColor: node.Color, } announceMessages = append(announceMessages, ann)
discovery: properly set node's color when syncing graph state This commit fixes an existing bug wherein we would blank out a node’s color instead of properly setting the field when syncing graph state with another node This would cause the node to reject the node announcement and we would generate an we would invalidate the signature of the node announcement. We fix this simply by properly setting the node announcement.
lightningnetwork_lnd
train
go
a13a6b14ec4ab8e9660fd59d7abe00e3d3666f9f
diff --git a/models/repo.go b/models/repo.go index <HASH>..<HASH> 100644 --- a/models/repo.go +++ b/models/repo.go @@ -831,11 +831,11 @@ func GetCollaborativeRepos(uname string) ([]*Repository, error) { repos := make([]*Repository, 0, 10) for _, access := range accesses { - if strings.HasPrefix(access.RepoName, uname) { + infos := strings.Split(access.RepoName, "/") + if infos[0] == uname { continue } - - infos := strings.Split(access.RepoName, "/") + u, err := GetUserByName(infos[0]) if err != nil { return nil, err
Using strings.HasPrefix(...) will misjudgement `strings.HasPrefix(access.RepoName, uname)` can't handle the situation which like following in access table. user_name | repo_name ----------+------------- toby | toby/blog toby | toby/test toby | tobyzxj/blog toby | tobyzxj/test
gogs_gogs
train
go
dc05be36a60237c930ca60184bbbc054182eeab1
diff --git a/superset/assets/javascripts/SqlLab/reducers.js b/superset/assets/javascripts/SqlLab/reducers.js index <HASH>..<HASH> 100644 --- a/superset/assets/javascripts/SqlLab/reducers.js +++ b/superset/assets/javascripts/SqlLab/reducers.js @@ -242,10 +242,9 @@ export const sqlLabReducer = function (state, action) { let change = false; for (const id in action.alteredQueries) { const changedQuery = action.alteredQueries[id]; - if ( - state.queries[id].state !== 'stopped' && - (!state.queries.hasOwnProperty(id) || - state.queries[id].changedOn !== changedQuery.changedOn)) { + if (!state.queries.hasOwnProperty(id) || + (state.queries[id].changedOn !== changedQuery.changedOn && + state.queries[id].state !== 'stopped')) { newQueries[id] = Object.assign({}, state.queries[id], changedQuery); change = true; }
Check if the query is in state first. (#<I>)
apache_incubator-superset
train
js
7e0e8cd1f9242a2fc278dcd0f9f6e88e8adbb71d
diff --git a/src/Pingpong/Admin/AdminServiceProvider.php b/src/Pingpong/Admin/AdminServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Pingpong/Admin/AdminServiceProvider.php +++ b/src/Pingpong/Admin/AdminServiceProvider.php @@ -97,7 +97,7 @@ class AdminServiceProvider extends ServiceProvider { $this->registerFacades(); - $this->registerEvents(); + $this->registerRoutes(); } /** @@ -105,7 +105,7 @@ class AdminServiceProvider extends ServiceProvider { * * @return void */ - public function registerEvents() + public function registerRoutes() { $this->app->booted(function () {
Renamed registerEvents to registerRoutes
pingpong-labs_admin
train
php
814d1ebbf578a7752f88eba1f60efae13ca79068
diff --git a/Cheque.php b/Cheque.php index <HASH>..<HASH> 100644 --- a/Cheque.php +++ b/Cheque.php @@ -16,10 +16,11 @@ use Propel\Runtime\Connection\ConnectionInterface; use Thelia\Install\Database; use Thelia\Model\MessageQuery; use Thelia\Model\Order; +use Thelia\Module\AbstractPaymentModule; use Thelia\Module\BaseModule; use Thelia\Module\PaymentModuleInterface; -class Cheque extends BaseModule implements PaymentModuleInterface +class Cheque extends AbstractPaymentModule { const MESSAGE_DOMAIN = "Cheque";
Improvement on delivery events (#<I>)
thelia-modules_Cheque
train
php
51720430bfaaeb32bd9f211215d69c0bee87a6ca
diff --git a/java/server/src/org/openqa/selenium/netty/server/RequestConverter.java b/java/server/src/org/openqa/selenium/netty/server/RequestConverter.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/selenium/netty/server/RequestConverter.java +++ b/java/server/src/org/openqa/selenium/netty/server/RequestConverter.java @@ -68,7 +68,7 @@ class RequestConverter extends SimpleChannelInboundHandler<HttpObject> { return; } - if (nettyRequest.headers().contains("Sec-WebSocket-Version") || + if (nettyRequest.headers().contains("Sec-WebSocket-Version") && "upgrade".equals(nettyRequest.headers().get("Connection"))) { // Pass this on to later in the pipeline. ReferenceCountUtil.retain(msg);
Update RequestConverter upgrade header handling. (#<I>)
SeleniumHQ_selenium
train
java
b4b55dacdb8abb5712c4f943f8304609ec58d915
diff --git a/graph/api/src/main/java/org/jboss/windup/graph/service/FileService.java b/graph/api/src/main/java/org/jboss/windup/graph/service/FileService.java index <HASH>..<HASH> 100644 --- a/graph/api/src/main/java/org/jboss/windup/graph/service/FileService.java +++ b/graph/api/src/main/java/org/jboss/windup/graph/service/FileService.java @@ -12,7 +12,6 @@ import org.jboss.windup.graph.GraphContext; import org.jboss.windup.graph.TitanUtil; import org.jboss.windup.graph.frames.FramedVertexIterable; import org.jboss.windup.graph.model.WindupFrame; -import org.jboss.windup.graph.model.WindupVertexFrame; import org.jboss.windup.graph.model.resource.FileModel; import org.jboss.windup.util.ExecutionStatistics; @@ -42,6 +41,12 @@ public class FileService extends GraphService<FileModel> entry.setParentFile(parentFile); } + if (entry.getParentFile() == null && parentFile != null) + { + // Deal with an odd corner case, that probably only happens in my test environment. + entry.setParentFile(parentFile); + } + ExecutionStatistics.get().end("FileService.createByFilePath(parentFile, filePath)"); return entry; }
Fixed a case where the fileservice doesn't behave well if a filemodel entry was precreated. This really only occurs in odd ege cases. For example, if you were to analyze a source directory which contained a user rules directory. The configuration would create FileModels for the rules directory, which would later be reused, but their parents wouldn't be setup correctly.
windup_windup
train
java
b3dabb7f5834db68b4a8640e055b21a7ce44454f
diff --git a/rake-tasks/crazy_fun/mappings/visualstudio.rb b/rake-tasks/crazy_fun/mappings/visualstudio.rb index <HASH>..<HASH> 100644 --- a/rake-tasks/crazy_fun/mappings/visualstudio.rb +++ b/rake-tasks/crazy_fun/mappings/visualstudio.rb @@ -369,7 +369,11 @@ module CrazyFunDotNet if Rake::Task.task_defined? package_dependency_task package_id = Rake::Task[package_dependency_task].out else - package_version = dep.fetch(package_id) + # For package dependencies, specify the *exact* version of + # the dependency, since we're tightly bound because we use + # csc.exe to build instead of loose versioning via Visual + # Studio. + package_version = "[#{dep.fetch(package_id)}]" end nuspec_task.dependency package_id, package_version end
JimEvans: Change NuGet packages to depend on exact version references, rather than range. This fix will be deployed in the next NuGet package release. Fixes issue #<I> r<I>
SeleniumHQ_selenium
train
rb
3265b122951f630574f6976aeb006fb14fb688d4
diff --git a/lib/node-gyp.js b/lib/node-gyp.js index <HASH>..<HASH> 100644 --- a/lib/node-gyp.js +++ b/lib/node-gyp.js @@ -83,6 +83,7 @@ proto.configDefs = { , proxy: String // 'install' , nodedir: String // 'configure' , loglevel: String // everywhere + , python: String // 'configure' } /**
configure: add "python" to the nopt config definition Makes "node-gyp rebuild --python /usr/bin/python<I>` (with " " instead of "=") work properly. Fixes #<I>.
CodeJockey_node-ninja
train
js
8c8dcfa5733f48bdf9dac70aaa6572e8be132bf7
diff --git a/src/block.js b/src/block.js index <HASH>..<HASH> 100644 --- a/src/block.js +++ b/src/block.js @@ -52,7 +52,7 @@ Object.assign(Block.prototype, SimpleBlock.fn, require('./block-validations'), { icon_name: 'default', validationFailMsg: function() { - return i18n.t('errors:validation_fail', { type: this.title }); + return i18n.t('errors:validation_fail', { type: _.isFunction(this.title) ? this.title() : this.title }); }, editorHTML: '<div class="st-block__editor"></div>',
Fix error TypeError in validationFailMsg If `this.title` is not function then method `validationFailMsg` throws exception: ``` TypeError: this.title is not a function(…) ``` If this error occurs on `on_post` form's event - browser reloaded and data magically way didn't saved.
madebymany_sir-trevor-js
train
js
f84897df6c3cfe35dde9eba6dfdd75b92b0ee8bf
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -106,6 +106,10 @@ class RedisMock extends EventEmitter { return mock; } + duplicate() { + return this.createConnectedClient() + } + // eslint-disable-next-line class-methods-use-this disconnect() { const removeFrom = ({ instanceListeners }) => {
fix: Add duplicate function to support instance duplication for TypeScript mocks (#<I>)
stipsan_ioredis-mock
train
js
5f19a907173c52a5a37f3057951c23289548de21
diff --git a/lib/responses/methods/index.js b/lib/responses/methods/index.js index <HASH>..<HASH> 100644 --- a/lib/responses/methods/index.js +++ b/lib/responses/methods/index.js @@ -189,7 +189,15 @@ module.exports = { var res = this.res; var req = this.req; - if (!data) data = {}; + if (typeof data == 'string') { + res.addMessage('error', { + text: data + }); + + data = null; + } else if (!data) { + data = {}; + } res.status(403);
add suport to send messages in forbidden response
wejs_we-core
train
js
be16c50bbdd3577543bd62e5d33f8af094ad2108
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -118,6 +118,20 @@ describe Event do Event.cleanup_expired! expect(Event.find_by_id(event.id)).not_to be_nil end + + it "always keeps the latest Event regardless of its expires_at value only if the database is MySQL" do + Event.delete_all + event1 = agents(:jane_weather_agent).create_event expires_at: 1.minute.ago + event2 = agents(:bob_weather_agent).create_event expires_at: 1.minute.ago + + Event.cleanup_expired! + case ActiveRecord::Base.connection + when ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter + expect(Event.all.pluck(:id)).to eq([event2.id]) + else + expect(Event.all.pluck(:id)).to be_empty + end + end end describe "after destroy" do
Add a spec for the change
huginn_huginn
train
rb
20d10554b0cfd4aa1a2744f1699573090171b12c
diff --git a/holoviews/core/element.py b/holoviews/core/element.py index <HASH>..<HASH> 100644 --- a/holoviews/core/element.py +++ b/holoviews/core/element.py @@ -570,7 +570,8 @@ class AxisLayout(UniformNdMapping): # NOTE: If further composite types supporting Overlaying and Layout these # classes may be moved to core/composite.py - key_dimensions = param.List(default=[Dimension(name="X"), Dimension(name="Y")], bounds=(2,2)) + key_dimensions = param.List(default=[Dimension(name="X"), Dimension(name="Y")], + bounds=(1,2)) label = param.String(constant=True, doc=""" A short label used to indicate what kind of data is contained
Enabled one-dimensional AxisLayouts
pyviz_holoviews
train
py
7cc6d8a5645b8974f07e132cc3c4820e880fd3ce
diff --git a/airflow/jobs.py b/airflow/jobs.py index <HASH>..<HASH> 100644 --- a/airflow/jobs.py +++ b/airflow/jobs.py @@ -1162,8 +1162,8 @@ class SchedulerJob(BaseJob): if task_concurrency is not None: num_running = task_concurrency_map[((task_instance.dag_id, task_instance.task_id))] if num_running >= task_concurrency: - self.logger.info("Not executing %s since the task concurrency for this task" - " has been reached.", task_instance) + self.log.info("Not executing %s since the task concurrency for" + " this task has been reached.", task_instance) continue else: task_concurrency_map[(task_instance.dag_id, task_instance.task_id)] += 1
[AIRFLOW-<I>] Fix invalid reference to logger This should be log instead of logger. Somewhere it went wrong with the refactoring of the code. This patch had conflicts when merged, resolved by Committer: Ash Berlin-Taylor <<EMAIL>> Closes #<I> from Fokko/fd-fix-logger
apache_airflow
train
py
b87f0791da7f3b109dcc49c875909d75a1142542
diff --git a/clustering/web/cache/src/main/java/org/wildfly/clustering/web/cache/session/coarse/CoarseSessionAttributes.java b/clustering/web/cache/src/main/java/org/wildfly/clustering/web/cache/session/coarse/CoarseSessionAttributes.java index <HASH>..<HASH> 100644 --- a/clustering/web/cache/src/main/java/org/wildfly/clustering/web/cache/session/coarse/CoarseSessionAttributes.java +++ b/clustering/web/cache/src/main/java/org/wildfly/clustering/web/cache/session/coarse/CoarseSessionAttributes.java @@ -75,7 +75,12 @@ public class CoarseSessionAttributes extends CoarseImmutableSessionAttributes im Object old = this.attributes.put(name, value); this.mutator.mutate(); if (this.mutations != null) { - this.mutations.remove(name); + // If the object is mutable, we need to indicate trigger a mutation on close + if (this.immutability.test(value)) { + this.mutations.remove(name); + } else { + this.mutations.add(name); + } } return old; }
WFLY-<I> Mutations following HttpSession.setAttribute(...) lost on failover when using SESSION granularity distributed web session with a non-transactional cache
wildfly_wildfly
train
java
40a2facf003857830fa2ea00360ed2697b521296
diff --git a/logentry/logentry.go b/logentry/logentry.go index <HASH>..<HASH> 100644 --- a/logentry/logentry.go +++ b/logentry/logentry.go @@ -43,7 +43,7 @@ type LogEntry struct { } // New constructs a new LogEntry -func New(indexPrefix, typeName, JobType, WorkerName string, Code, ElapsedTime int) *LogEntry { +func New(indexPrefix, typeName, JobType, WorkerName string, Code, ElapsedTime int, success ...bool) *LogEntry { now := time.Now() index := fmt.Sprintf("%v-%04d-%02d-%02d", indexPrefix, now.Year(), now.Month(), now.Day()) @@ -51,6 +51,10 @@ func New(indexPrefix, typeName, JobType, WorkerName string, Code, ElapsedTime in request := Request{Metadata: requestMetadata} Success := (Code < 500) + if len(success) > 0 { + Success = success[0] + } + responseMetadata := ResponseMetadata{Code: Code, Success: Success} response := Response{Metadata: responseMetadata} diff --git a/logentry/version.go b/logentry/version.go index <HASH>..<HASH> 100644 --- a/logentry/version.go +++ b/logentry/version.go @@ -1,4 +1,4 @@ package logentry // VERSION is the current library Version -var VERSION = "1.0.0" +var VERSION = "1.1.0"
allow override of status, <I>
octoblu_go-logentry
train
go,go
fbcbb77fc8c60ac3803607a3aaa33e47763b8f1f
diff --git a/pkg/auth/nodeidentifier/default.go b/pkg/auth/nodeidentifier/default.go index <HASH>..<HASH> 100644 --- a/pkg/auth/nodeidentifier/default.go +++ b/pkg/auth/nodeidentifier/default.go @@ -50,8 +50,6 @@ func (defaultNodeIdentifier) NodeIdentity(u user.Info) (string, bool) { return "", false } - nodeName := strings.TrimPrefix(userName, nodeUserNamePrefix) - isNode := false for _, g := range u.GetGroups() { if g == user.NodesGroup { @@ -63,5 +61,6 @@ func (defaultNodeIdentifier) NodeIdentity(u user.Info) (string, bool) { return "", false } - return nodeName, isNode + nodeName := strings.TrimPrefix(userName, nodeUserNamePrefix) + return nodeName, true }
Only do string trim when it's necessary This will enhance performance a little bit.
kubernetes_kubernetes
train
go
1a437f4e4052a565ea8dff069d87a85a76519f38
diff --git a/auditlog_tests/test_settings.py b/auditlog_tests/test_settings.py index <HASH>..<HASH> 100644 --- a/auditlog_tests/test_settings.py +++ b/auditlog_tests/test_settings.py @@ -57,3 +57,5 @@ STATIC_URL = "/static/" ROOT_URLCONF = "auditlog_tests.urls" USE_TZ = True + +DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
Add DEFAULT_AUTO_FIELD to test settings.
jjkester_django-auditlog
train
py
d97123032fffde66af99736e1b1ee7ec570b5832
diff --git a/proto/src/templates/primitives.py b/proto/src/templates/primitives.py index <HASH>..<HASH> 100644 --- a/proto/src/templates/primitives.py +++ b/proto/src/templates/primitives.py @@ -21,9 +21,8 @@ class _TemplateField(object): def encode(self, paramdict, parent, name=None, little_endian=False): value = self._get_element_value_and_remove_from_params(paramdict, name) - return Field(self.type,self._get_name(name), - *self._encode_value(value, parent, little_endian=little_endian), - little_endian=little_endian) + field_name, field_value = self._encode_value(value, parent, little_endian=little_endian) + return Field(self.type,self._get_name(name), field_name, field_value, little_endian=little_endian) def decode(self, value, message, name=None, little_endian=False): length, aligned_length = self.length.decode_lengths(message)
Refactor setting field_name and field_value in primitives to support Python <I>
robotframework_Rammbock
train
py
0404c3aed1665d96d376e8647e290b5ed9c6fcf9
diff --git a/src/Response.php b/src/Response.php index <HASH>..<HASH> 100644 --- a/src/Response.php +++ b/src/Response.php @@ -208,6 +208,8 @@ class Response implements ResponseInterface $response->body->useGlobally(); } + $response->isStale = false; + return $response; } diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index <HASH>..<HASH> 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -166,6 +166,8 @@ class ResponseTest extends PHPUnit_Framework_TestCase $this->assertInstanceof(Response::class, $response); $this->assertNotSame($this->baseResponse, $response); + + $this->assertFalse($response->isStale()); } public function testReviveNonStale()
The response from `Response::revive()` should not be marked as stale.
jasny_http-message
train
php,php
0290f2f40ee24b7c0e6a55a0bd34d44533f9f97a
diff --git a/treeherder/etl/buildbot.py b/treeherder/etl/buildbot.py index <HASH>..<HASH> 100644 --- a/treeherder/etl/buildbot.py +++ b/treeherder/etl/buildbot.py @@ -15,7 +15,7 @@ RESULT_DICT = { # # PLATFORMS_BUILDERNAME, BUILD_TYPE_BUILDERNAME # -# http://mxr.mozilla.org/build/source/buildapi/buildapi/model/util.py +# https://dxr.mozilla.org/build-central/source/buildapi/buildapi/model/util.py # # PIPEDREAM: Once these attributes are available as build properties in the # pulse stream these structures can be removed.
Bug <I> - Switch a link from mxr to dxr in a comment (#<I>) r=emorley
mozilla_treeherder
train
py
ddbb584235aecce9b7c4f91778fd6371f1beb8a7
diff --git a/builder/lxc/step_wait_init.go b/builder/lxc/step_wait_init.go index <HASH>..<HASH> 100644 --- a/builder/lxc/step_wait_init.go +++ b/builder/lxc/step_wait_init.go @@ -92,6 +92,9 @@ func (s *StepWaitInit) waitForInit(state multistep.StateBag, cancel <-chan struc if currentRunlevel == targetRunlevel { log.Printf("Container finished init.") break + } else if currentRunlevel > targetRunlevel { + log.Printf("Expected Runlevel %d, Got Runlevel %s, continuing", targetRunlevel, currentRunlevel) + break } /*log.Println("Attempting SSH connection...")
[lxc] Ubuntu likes runlevel 5
hashicorp_packer
train
go
fa2fe6f04bbe8263cfad6fbb98526e0cbcdab0b3
diff --git a/switcheo/test_switcheo_client.py b/switcheo/test_switcheo_client.py index <HASH>..<HASH> 100644 --- a/switcheo/test_switcheo_client.py +++ b/switcheo/test_switcheo_client.py @@ -17,6 +17,8 @@ class TestSwitcheoClient(unittest.TestCase): 'address': 'fea2b883725ef2d194c9060f606cd0a0468a2c59', 'pair': 'SWTH_NEO', 'side': 'buy', + 'price': '0.00001', + 'quantity': '1000000000000', 'offer_asset_id': 'c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b', 'want_asset_id': 'ab38352559b8b203bde5fddfa0b07d8b2525e132', 'offer_amount': '6000000',
Adding new keys to the Order History API Return
KeithSSmith_switcheo-python
train
py
3d90aa036bc15a9e59d8bce157b877fadbb6ff22
diff --git a/js/chartbuilder.js b/js/chartbuilder.js index <HASH>..<HASH> 100644 --- a/js/chartbuilder.js +++ b/js/chartbuilder.js @@ -104,7 +104,7 @@ ChartBuilder = { .split("€").join("") .split("%").join(""); - if(value == "null" || value == "" || (/^\s+$/).test(value) || (/^\#[A-Z\\\d\/]+\!$/).test(value)) { + if(value == "null" || value == "" || (/^\s+$/).test(value) || (/^\#[A-Z\\\d\/]+!{0,}$/).test(value)) { //allow for nulls, blank, whitespace only cells (if somehow trim didn't work), and excel errors value = null }
fixed parsing regex to allow for #N/A cells from excel
Quartz_Chartbuilder
train
js
76a909709eaf90f8a3da5f0ccf581b6ef490ceff
diff --git a/sexpr/grammar.py b/sexpr/grammar.py index <HASH>..<HASH> 100644 --- a/sexpr/grammar.py +++ b/sexpr/grammar.py @@ -14,16 +14,15 @@ _str_format = ''' class Grammar(Matcher): def __init__(self, source, options = None): - self.yaml = source - rules = source.get('rules', {}) - self.options = options or {} + self.yaml = source.get('rules', {}) self.path = self.options.get('path', None) - self.rules = self.compile_rules(rules) + self.rules = self.compile_rules(self.yaml) try: self.root = self.options.get('root', None) - self.root = self.root or list(rules.items())[0][0] + self.root = self.root or list(self.yaml.items())[0][0] + self.top_tags = self.yaml.get(self.root, []) except IndexError: raise ValueError('Cannot load root node. Grammar is ill-formed.')
Add public attribute for top-level tags (#3)
IwoHerka_sexpr
train
py
27220035ee6eb79e52e6c532ea673daf19c87c95
diff --git a/middleware/appsload.js b/middleware/appsload.js index <HASH>..<HASH> 100644 --- a/middleware/appsload.js +++ b/middleware/appsload.js @@ -59,7 +59,7 @@ function create(options) { var files = [], remoteCounter = 0; for (var i in list) { var m = /^(?:\/(text|raw);)?([\w\/+-]+(?:\.[\w\/+-]+)*)$/.exec(list[i]), - isTZ = m[2].slice(0, tzModule.length) === tzModule; + isTZ = m && m[2].slice(0, tzModule.length) === tzModule; if (!m) { files.push(invalid(list[i])); continue;
Moved last libs to 3rd.party
Open-Xchange-Frontend_appserver
train
js
0b544171bee00eeaedd533554fd7fb57aafbf5c5
diff --git a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/dsl/expression/GinqExpression.java b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/dsl/expression/GinqExpression.java index <HASH>..<HASH> 100644 --- a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/dsl/expression/GinqExpression.java +++ b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/dsl/expression/GinqExpression.java @@ -115,7 +115,7 @@ public class GinqExpression extends AbstractGinqExpression { @Override public String getText() { return fromExpression.getText() + " " - + joinExpressionList.stream().map(e -> e.getText()).collect(Collectors.joining(" ")) + " " + + (joinExpressionList.isEmpty() ? "" : joinExpressionList.stream().map(e -> e.getText()).collect(Collectors.joining(" ")) + " ") + (null == whereExpression ? "" : whereExpression.getText() + " ") + (null == groupExpression ? "" : groupExpression.getText() + " ") + (null == orderExpression ? "" : orderExpression.getText() + " ")
Tweak text of GINQ expression further
apache_groovy
train
java
024f4eb52d32a8d156ffe11607bb26ecce2604fa
diff --git a/src/motor-html/base.js b/src/motor-html/base.js index <HASH>..<HASH> 100644 --- a/src/motor-html/base.js +++ b/src/motor-html/base.js @@ -166,8 +166,9 @@ export function initMotorHTMLBase() { // being called from the reciprocal API. See the constructor in // motor/Node.js to get see the idea. // TODO: renewable promise after unmount. - this.ready = Promise.resolve() + this._imperativeCounterpartPromise = Promise.resolve() .then(() => this._associateImperativeNode()) + this.ready = this._imperativeCounterpartPromise .then(() => this.imperativeCounterpart.mountPromise) }
Oops, forgot to commit this with the last commit. Needed for the MotorHTMLScene to wait for the imperativeCounterpart.
trusktr_infamous
train
js