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
1aff701e0ac21b7ddbf4c20a4f3b2c52653a8da9
diff --git a/admin_pgv_to_wt.php b/admin_pgv_to_wt.php index <HASH>..<HASH> 100644 --- a/admin_pgv_to_wt.php +++ b/admin_pgv_to_wt.php @@ -494,6 +494,10 @@ if ($PGV_SCHEMA_VERSION>=12) { // a) we've already done it (upgrade) // b) it doesn't exist (new install) } + // Some PGV installations store the u_reg_timestamp in the format "2010-03-07 21:41:07" + WT_DB::prepare( + "UPDATE `##user_setting` SET setting_value=UNIX_TIMESTAMP(setting_value) WHERE setting_name='reg_timestamp' AND setting_value like '____-__-__ __:__:__'" + )->execute(); echo '<p>pgv_users => wt_user_gedcom_setting ...</p>'; ob_flush(); flush(); usleep(50000); try { $user_gedcom_settings=
PGV->WT wizard. Old PGV installations store reg_timestamp in the format "<I>-<I>-<I> <I>:<I>:<I>". Convert these to timestamps.
fisharebest_webtrees
train
php
934cecc0841da5856d87a0a85f8c62f6faa6570a
diff --git a/healthy.py b/healthy.py index <HASH>..<HASH> 100644 --- a/healthy.py +++ b/healthy.py @@ -105,7 +105,7 @@ def calculate_health(package_name, package_version=None, verbose=False, no_outpu if package_info.get('author') in BAD_VALUES or package_info.get('author_email') in BAD_VALUES: score -= AUTHOR_MISSING - reasons.append('Author name and email missing') + reasons.append('Author name or email missing') if isinstance(package_uploaded_time, int) and package_uploaded_time < 0: score -= NO_RELEASE_FILES_PENALTY
updating message for missing author name/email
dustinmm80_healthy
train
py
74c8b66007f0e37fd4be495380a15d1fb24dbe22
diff --git a/src/grid/ReminderGridView.php b/src/grid/ReminderGridView.php index <HASH>..<HASH> 100644 --- a/src/grid/ReminderGridView.php +++ b/src/grid/ReminderGridView.php @@ -14,6 +14,9 @@ class ReminderGridView extends BoxedGridView { return [ 'periodicity' => [ + 'value' => function ($model) { + return Yii::t('hiqdev/yii2/reminder', ucfirst($model->periodicity)); + }, 'filter' => false, ], 'description' => [
Fixed translations for periodicity in the grid
hiqdev_yii2-reminder
train
php
0f3a1b0d0c25b8b1d31a550ee3e65c71a0d97f49
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -145,7 +145,6 @@ setup( 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], install_requires=[
setup.py: drop py<I> trove classifier I'm not testing this version
ktdreyer_txkoji
train
py
19703bfa6fcd48b2f156ba31ae46ca8c5b32b3ed
diff --git a/core-bundle/src/Resources/contao/controllers/FrontendShare.php b/core-bundle/src/Resources/contao/controllers/FrontendShare.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/controllers/FrontendShare.php +++ b/core-bundle/src/Resources/contao/controllers/FrontendShare.php @@ -31,7 +31,7 @@ class FrontendShare extends Frontend case 'facebook': return new RedirectResponse( 'https://www.facebook.com/sharer/sharer.php' - . '?u=' . rawurlencode(Input::get('u', true)) + . '?p[url]=' . rawurlencode(Input::get('u', true)) ); case 'twitter':
Update the facebook share link (see #<I>) Description ----------- I noticed that the Facebook share link no longer works. The issue can be reproduced on <URL>
contao_contao
train
php
27164a6bdb0d5571d0d01abd92a53d321d729d26
diff --git a/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php b/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php +++ b/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php @@ -32,7 +32,7 @@ class BeanstalkdConnector implements ConnectorInterface */ protected function pheanstalk(array $config) { - return Pheanstalk::connect( + return Pheanstalk::create( $config['host'], $config['port'] ?? Pheanstalk::DEFAULT_PORT, $config['timeout'] ?? Connection::DEFAULT_CONNECT_TIMEOUT
Use proper method name for Pheanstalk
laravel_framework
train
php
259c54c4ccb457e52a0ab0868f4034edb6e51230
diff --git a/Connection.php b/Connection.php index <HASH>..<HASH> 100644 --- a/Connection.php +++ b/Connection.php @@ -24,7 +24,7 @@ use yii\helpers\Inflector; * * The execution of [redis commands](http://redis.io/commands) is possible with via [[executeCommand()]]. * - * @method mixed set($key, $value) Set the string value of a key + * @method mixed set($key, ...$value) Set the string value of a key * @method mixed get($key) Set the string value of a key * TODO document methods * @@ -344,7 +344,7 @@ class Connection extends Component * Allows issuing all supported commands via magic methods. * * ```php - * $redis->hmset(['test_collection', 'key1', 'val1', 'key2', 'val2']) + * $redis->hmset('test_collection', 'key1', 'val1', 'key2', 'val2') * ``` * * @param string $name name of the missing method to execute
Fixed docs for set and hmset [skip ci]
yiisoft_yii2-redis
train
php
ef386b9ba6495ebe4518d2be32e1cbc71a10bd68
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -460,7 +460,7 @@ var decodeHTMLEntities = exports.decodeHTMLEntities = function(str) { * @api public */ -var encodeHTMLEntities = exports.decodeHTMLEntities = function(str) { +var encodeHTMLEntities = exports.encodeHTMLEntities = function(str) { if ('string' != typeof str) return str; return str.replace(htmlEntitiesRegExp, function(match) { return '&' + htmlEntitiesMap[match] + ';';
Fixing exports.encodeHTMLEntities
keystonejs_keystone-utils
train
js
1d7671a8dea8638c7bfeb314883c31dbe256e238
diff --git a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java index <HASH>..<HASH> 100644 --- a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java +++ b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterManager.java @@ -135,6 +135,8 @@ public class GobblinClusterManager implements ApplicationLauncher, StandardMetri private GobblinHelixJobScheduler jobScheduler; @Getter private JobConfigurationManager jobConfigurationManager; + @Getter + private volatile boolean started = false; protected final String clusterName; @Getter @@ -317,6 +319,7 @@ public class GobblinClusterManager implements ApplicationLauncher, StandardMetri } else { startAppLauncherAndServices(); } + this.started = true; } /**
[GOBBLIN-<I>] add a flag to indicate the start of cluster manager (#<I>) Metrics in GobblinClusterManager are initialized after the GobblinClusterManager starts, so added a flag in GobblinClusterManager to indicate the start, otherwise downstream applications may use uninitialized metrics.
apache_incubator-gobblin
train
java
678ffa60dc17a5df2b215c0acea1b16f44370575
diff --git a/plugins/hosts/void/cap/dummy.rb b/plugins/hosts/void/cap/dummy.rb index <HASH>..<HASH> 100644 --- a/plugins/hosts/void/cap/dummy.rb +++ b/plugins/hosts/void/cap/dummy.rb @@ -2,9 +2,9 @@ module VagrantPlugins module HostVoid module Cap class Dummy - def self.dummy(ui, argument) - ui.info "Dummy host cap in ruby runtime, sent argument: #{argument}" - true + def self.dummy(bag, ui, argument) + ui.info "Dummy host cap in ruby runtime, sent argument: `#{argument}' with bag: #{bag}" + "this is a result value string!" end end end
Add state bag argument to dummy capability
hashicorp_vagrant
train
rb
20368d7a1c7d198252765ab7aee5eefc3ef8f1ea
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup(name='wilson', ], }, install_requires=['scipy>=1.0', 'numpy', 'pylha>=0.2', 'pyyaml', - 'ckmutil>=0.3', 'wcxf==1.4.7', 'rundec>=0.5', + 'ckmutil>=0.3', 'wcxf>=1.4.7', 'rundec>=0.5', 'voluptuous'], extras_require={ 'testing': ['nose',],
[setup] Do not pin wcxf version
wilson-eft_wilson
train
py
e070d8fbe08be4c694cb239ac40d994fa7855bdb
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,7 @@ var gulp = require("gulp"), include = require('gulp-include'), coffee = require('gulp-coffee'); -gulp.task("default", function() { +gulp.task("default", function(done) { gulp.src([ 'src/widgets/build/widgets.coffee', 'src/support/index.coffee' @@ -18,7 +18,7 @@ gulp.task("default", function() { 'src/custom_formatter.coffee', 'src/config_builder.coffee', 'src/scaffold_builder.coffee' - ]) + ], { allowEmpty: true }) .pipe(coffee()) .pipe(gulp.dest("lib/")) @@ -26,7 +26,7 @@ gulp.task("default", function() { 'src/config.json', 'src/pioneerformat.js', 'src/pioneersummaryformat.js' - ]) + ], { allowEmpty: true }) .pipe(gulp.dest("lib/")) gulp.src([ @@ -35,6 +35,8 @@ gulp.task("default", function() { 'src/scaffold/example.json' ]) .pipe(gulp.dest("lib/scaffold")) + + done() }); gulp.task("watch", function() {
Fix Gulpfile for v4
mojotech_pioneer
train
js
578ca065a662cd6887db62c2a3367d67347d2902
diff --git a/lib/rubocop/cop/style/align_hash.rb b/lib/rubocop/cop/style/align_hash.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/style/align_hash.rb +++ b/lib/rubocop/cop/style/align_hash.rb @@ -156,7 +156,7 @@ module RuboCop def on_hash(node) return if ignored_node?(node) return if node.children.empty? - return unless multiline?(node) + return unless node.multiline? @alignment_for_hash_rockets ||= new_alignment('EnforcedHashRocketStyle') @@ -201,17 +201,6 @@ module RuboCop node.loc.begin end - # Returns true if the hash spans multiple lines - def multiline?(node) - return false unless node.loc.expression.source.include?("\n") - - return false if node.children[1..-1].all? do |child| - !begins_its_line?(child.loc.expression) - end - - true - end - def alignment_for(pair) if pair.loc.operator.is?('=>') @alignment_for_hash_rockets
Use Node#multiline? in Style/AlignHash AlignHash#multiline?(node) has some extra logic which checks whether *every* child of a hash literal (after the first) is *not* the first node on its line. But how could a hash literal which spans multiple lines possibly have *every* child *not* first on its line? It doesn't make sense. Just using a simple check whether the literal spans multiple lines or not, all the tests still pass.
rubocop-hq_rubocop
train
rb
8e8f41f944fac34895a27b42b1595f677649b1f9
diff --git a/core/comment_events.js b/core/comment_events.js index <HASH>..<HASH> 100644 --- a/core/comment_events.js +++ b/core/comment_events.js @@ -191,11 +191,7 @@ Blockly.Events.CommentChange.prototype.run = function(forward) { var contents = forward ? this.newContents_ : this.oldContents_; if (contents.hasOwnProperty('minimized')) { - if (comment instanceof Blockly.ScratchBlockComment) { - // TODO remove this check when workspace comments also get a minimized - // state - comment.setMinimized(contents.minimized); - } + comment.setMinimized(contents.minimized); } if (contents.hasOwnProperty('width') && contents.hasOwnProperty('height')) { comment.setSize(contents.width, contents.height);
Minimize event should work for workspace comments.
LLK_scratch-blocks
train
js
1f37289f261a1342ab131aea4ef2f652a388964a
diff --git a/gdxpy.py b/gdxpy.py index <HASH>..<HASH> 100644 --- a/gdxpy.py +++ b/gdxpy.py @@ -649,7 +649,8 @@ def gload(smatch, gpaths=None, glabels=None, filt=None, reducel=False, if verbose: if isinstance(svar, pd.DataFrame): print('Rows : {} ... {}'.format(str(svar.index[0]), str(svar.index[-1]))) - print('Columns: {} ... {}'.format(str(svar.columns[0]), str(svar.columns[-1]))) + print('Columns: {}'.format(';\n '.join(['{} = {{{}, ..., {}}}'.format( + str(svar.columns[i]), svar.iloc[0,i], svar.iloc[-1,i]) for i in range(len(svar.columns))]))) elif isinstance(svar, pd.Series): print('Index : {} ... {}'.format(str(svar.index[0]), str(svar.index[-1]))) else:
improved summary of gloaded dataframes
jackjackk_gdxpy
train
py
52525ef6bc2a4a06df621f645a5cf1a229ce8204
diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index <HASH>..<HASH> 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -337,6 +337,17 @@ describe('browser-window module', function () { }) }) + describe('BrowserWindow.setProgressBar(progress)', function () { + it('sets the progress', function () { + assert.doesNotThrow(function () { + if (process.platform === 'darwin') { + app.dock.setIcon(path.join(fixtures, 'assets', 'logo.png')) + } + w.setProgressBar(.5) + }) + }) + }) + describe('BrowserWindow.fromId(id)', function () { it('returns the window with id', function () { assert.equal(w.id, BrowserWindow.fromId(w.id).id)
Add failing spec for icon progress crash
electron_electron
train
js
91c52e384ffb0fb5e71a972c9b90fadd9ee49ddd
diff --git a/server/irc/connection.js b/server/irc/connection.js index <HASH>..<HASH> 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -121,7 +121,7 @@ IrcConnection.prototype.register = function () { this.write('PASS ' + this.password); } this.write('NICK ' + this.nick); - this.write('USER ' + this.nick.replace(/[^0-9a-zA-Z\-_.]/, '') + ' 0 0 :' + '[www.kiwiirc.com] ' + this.nick); + this.write('USER ' + this.user + ' 0 0 :' + '[www.kiwiirc.com] ' + this.nick); if (this.cap_negotation) { this.write('CAP END'); }
Send the modified USER line to the IRCd
prawnsalad_KiwiIRC
train
js
65799848860c087833fae44aa71c310b7e7d6a21
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,29 @@ class PyTest(TestCommand): sys.exit(errno) +try: + from wheel.bdist_wheel import bdist_wheel + + class _bdist_wheel(bdist_wheel): + def get_tag(self): + tag = bdist_wheel.get_tag(self) + pythons = 'py2.py3.cp26.cp27.cp32.cp33.cp34.cp35.pp27.pp32' + if platform == 'darwin': + oses = 'macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_5_x86_64' + elif platform == 'win32': + if architecture0 == '32bit': + oses = 'win32' + else: + oses = 'win_amd64' + else: + oses = 'any' + tag = (pythons, 'none', oses) + return tag + + cmdclass = {'bdist_wheel': _bdist_wheel} +except ImportError: + cmdclass = {} + setup( name='PySoundFile', version='0.6.0', @@ -74,5 +97,5 @@ setup( ], long_description=open('README.rst').read(), tests_require=['pytest'], - cmdclass={'test': PyTest}, + cmdclass=dict(cmdclass, test=PyTest) )
Wheels are now os-dependent but python-independent
bastibe_SoundFile
train
py
23a5cf72d0faa3a3d94e93eb319533623ec1249f
diff --git a/go/cmd/vttablet/vttablet.go b/go/cmd/vttablet/vttablet.go index <HASH>..<HASH> 100644 --- a/go/cmd/vttablet/vttablet.go +++ b/go/cmd/vttablet/vttablet.go @@ -97,8 +97,8 @@ func main() { initQueryService(dbcfgs) initUpdateStreamService(mycnf) - initAgent(dbcfgs, mycnf, *dbConfigsFile, *dbCredentialsFile) // depends on both query and updateStream ts.RegisterCacheInvalidator() // depends on both query and updateStream + initAgent(dbcfgs, mycnf, *dbConfigsFile, *dbCredentialsFile) // depends on both query and updateStream rpc.HandleHTTP()
Fix for vttablet crash - fixed order of initialization
vitessio_vitess
train
go
01405523229f3b9750326aa832716ad12009cf4b
diff --git a/js/src/modal.js b/js/src/modal.js index <HASH>..<HASH> 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -127,8 +127,6 @@ class Modal { this._adjustDialog() - $(document.body).addClass(ClassName.OPEN) - this._setEscapeEvent() this._setResizeEvent() @@ -466,6 +464,8 @@ class Modal { .data('padding-right', actualPadding) .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`) } + + $(document.body).addClass(ClassName.OPEN) } _resetScrollbar() {
Fix body scrolling issue when modal open (#<I>)
twbs_bootstrap
train
js
8ab6944088fe258b630b20e8a77ae3d0dcceb214
diff --git a/producer/kafka.go b/producer/kafka.go index <HASH>..<HASH> 100644 --- a/producer/kafka.go +++ b/producer/kafka.go @@ -15,10 +15,10 @@ package producer import ( + kafka "github.com/shopify/sarama" // "gopkg.in/Shopify/sarama.v1" "github.com/trivago/gollum/core" "github.com/trivago/gollum/core/log" "github.com/trivago/gollum/shared" - kafka "gopkg.in/Shopify/sarama.v1" "strings" "sync" "time"
[mod] Using saram trunk again to get the latest broker fixes
trivago_gollum
train
go
41b4ec56ff08af9d9928874dcd4511abfb4f7ba3
diff --git a/lib/tesla-api/data.rb b/lib/tesla-api/data.rb index <HASH>..<HASH> 100644 --- a/lib/tesla-api/data.rb +++ b/lib/tesla-api/data.rb @@ -10,7 +10,7 @@ module TeslaAPI if has_query_ivar_method?(method_name) instance_variable_get(ivar_for_method_name(method_name)) else - super(symbol, *args, &block) + super end end diff --git a/lib/tesla-api/version.rb b/lib/tesla-api/version.rb index <HASH>..<HASH> 100644 --- a/lib/tesla-api/version.rb +++ b/lib/tesla-api/version.rb @@ -1,4 +1,4 @@ module TeslaAPI # Version Number - VERSION = "0.0.1" + VERSION = "0.0.2" end
Fixes issue in method_missing that would lead to 'stack level too deep' errors
gstark_tesla-api
train
rb,rb
1101ff2c864129a940f38943031b967808b2fc17
diff --git a/src/Valkyrja/Auth/Repositories/Repository.php b/src/Valkyrja/Auth/Repositories/Repository.php index <HASH>..<HASH> 100644 --- a/src/Valkyrja/Auth/Repositories/Repository.php +++ b/src/Valkyrja/Auth/Repositories/Repository.php @@ -137,6 +137,10 @@ class Repository implements Contract */ public function getUserFromSession(): User { + if (isset($this->user)) { + return $this->user; + } + $sessionUser = $this->session->get($this->userEntityName::getUserSessionId()); if (! $sessionUser) { @@ -145,7 +149,7 @@ class Repository implements Contract $userData = Arr::fromString($sessionUser); - return $this->userEntityName::fromArray($userData); + return $this->user = $this->userEntityName::fromArray($userData); } /**
Auth: Use static user variable for return on getUserFromSession if it exists instead of always pulling from session.
valkyrjaio_valkyrja
train
php
428be87c7b4a1d1fe3b3c95634fc7b42425d3b2a
diff --git a/lib/github_cli/apis/assignee.rb b/lib/github_cli/apis/assignee.rb index <HASH>..<HASH> 100644 --- a/lib/github_cli/apis/assignee.rb +++ b/lib/github_cli/apis/assignee.rb @@ -5,15 +5,15 @@ module GithubCLI class << self - def all(user, repo, params, format) - output format do - github_api.issues.assignees.list user, repo, params + def all(user, repo, params, options) + output options[:format], options[:quiet] do + github_api(options).issues.assignees.list user, repo, params end end - def check(user, repo, assignee, params, format) - output format do - github_api.issues.assignees.check user, repo, assignee, params + def check(user, repo, assignee, params, options) + output options[:format], options[:quiet] do + github_api(options).issues.assignees.check user, repo, assignee, params end end end
Change assigne api to take options.
piotrmurach_github_cli
train
rb
b7d5ef662ec5c7e9f26e063f2aa358da4b8e1b3e
diff --git a/src/Asset/AssetServiceProvider.php b/src/Asset/AssetServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Asset/AssetServiceProvider.php +++ b/src/Asset/AssetServiceProvider.php @@ -52,6 +52,7 @@ class AssetServiceProvider implements ServiceProviderInterface { $app['assetic.filters.compass'] = $app->share(function () use ($app) { $filter = new CompassFilter(); $filter->setCacheLocation($app['paths.cache'] . '/compass'); + $filter->addLoadPath($app['paths.layer'] . '/Resource/scss'); return $filter; });
Added core scss load path
mikegibson_sentient
train
php
8fad29f08fd0095a8e43e23ec38ccf02a3a622d7
diff --git a/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java b/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java index <HASH>..<HASH> 100755 --- a/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java +++ b/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java @@ -42,24 +42,26 @@ import edu.umd.cs.findbugs.visitclass.PreorderVisitor; public class DeclaredRuntimeException extends PreorderVisitor implements Detector { private final BugReporter bugReporter; - private static final Set<String> runtimeExceptions = new HashSet<String>(); private static JavaClass runtimeExceptionClass; static { try { runtimeExceptionClass = Repository.lookupClass("java.lang.RuntimeException"); - runtimeExceptions.add("java.lang.RuntimeException"); } catch (ClassNotFoundException cnfe) { runtimeExceptionClass = null; } } + private static final Set<String> runtimeExceptions = new HashSet<String>(); + + /** * constructs a DRE detector given the reporter to report bugs on * @param bugReporter the sync of bug reports */ public DeclaredRuntimeException(final BugReporter bugReporter) { this.bugReporter = bugReporter; + runtimeExceptions.add("java.lang.RuntimeException"); } /**
no need for the runtimeExceptions set to be static in DRE
mebigfatguy_fb-contrib
train
java
6947ee9bc9f971dfb44443fbe15833b4e2d2e577
diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index <HASH>..<HASH> 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -15,6 +15,7 @@ package metric import ( "fmt" + "os" "sort" "sync" "time" @@ -114,7 +115,9 @@ const watermarkCacheLimit = 1024 * 1024 func NewTieredStorage(appendToDiskQueueDepth, viewQueueDepth uint, flushMemoryInterval time.Duration, memoryTTL time.Duration, rootDirectory string) (*TieredStorage, error) { if isDir, _ := utility.IsDir(rootDirectory); !isDir { - return nil, fmt.Errorf("Could not find metrics directory %s", rootDirectory) + if err := os.MkdirAll(rootDirectory, 0755); err != nil { + return nil, fmt.Errorf("Could not find or create metrics directory %s: %s", rootDirectory, err) + } } diskStorage, err := NewLevelDBMetricPersistence(rootDirectory)
Try to create metrics root directory if missing This change tries to be nice and create the metrics directoy first before erroring out. Change-Id: I<I>cdc<I>cd<I>c6ef1fb7db<I>fe<I>
prometheus_prometheus
train
go
d675888e317419db025117b937f955f89ba5b12f
diff --git a/isc_dhcp_leases/iscdhcpleases.py b/isc_dhcp_leases/iscdhcpleases.py index <HASH>..<HASH> 100644 --- a/isc_dhcp_leases/iscdhcpleases.py +++ b/isc_dhcp_leases/iscdhcpleases.py @@ -31,7 +31,7 @@ def _extract_prop_option(line): def _extract_prop_set(line): """ - Extract the (key, value)-tuple from a tring like: + Extract the (key, value)-tuple from a string like: >>> 'set foo = "bar"' :param line: :return: tuple (key, value)
Fixed typo in inline docs
MartijnBraam_python-isc-dhcp-leases
train
py
963e12ddc2b15af824d45d882675026529616965
diff --git a/salt/modules/nftables.py b/salt/modules/nftables.py index <HASH>..<HASH> 100644 --- a/salt/modules/nftables.py +++ b/salt/modules/nftables.py @@ -25,8 +25,10 @@ _NFTABLES_FAMILIES = { 'ip': 'ip', 'ipv6': 'ip6', 'ip6': 'ip6', + 'inet': 'inet', 'arp': 'arp', - 'bridge': 'bridge' + 'bridge': 'bridge', + 'netdev': 'netdev' }
Add missing nftables families The inet family a special hybrid ipv4+ipv6 table, netdev for filtering from ingress.
saltstack_salt
train
py
c3b31a6fb0e9a1220bc1897e782080773802f2f3
diff --git a/sanic/request.py b/sanic/request.py index <HASH>..<HASH> 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -1,6 +1,5 @@ import sys import json -import socket from cgi import parse_header from collections import namedtuple from http.cookies import SimpleCookie @@ -192,18 +191,10 @@ class Request(dict): return self._socket def _get_address(self): - sock = self.transport.get_extra_info('socket') - - if sock.family == socket.AF_INET: - self._socket = (self.transport.get_extra_info('peername') or - (None, None)) - self._ip, self._port = self._socket - elif sock.family == socket.AF_INET6: - self._socket = (self.transport.get_extra_info('peername') or - (None, None, None, None)) - self._ip, self._port, *_ = self._socket - else: - self._ip, self._port = (None, None) + self._socket = self.transport.get_extra_info('peername') or \ + (None, None) + self._ip = self._socket[0] + self._port = self._socket[1] @property def remote_addr(self):
Simplify request ip and port retrieval logic This change also ensures that cases where transport stream is already closed is handled gracefully.
huge-success_sanic
train
py
2085655b3b56d5e6e091aeddebad3e742fb295ce
diff --git a/test/api.js b/test/api.js index <HASH>..<HASH> 100644 --- a/test/api.js +++ b/test/api.js @@ -139,8 +139,24 @@ describe('Angular-aware PouchDB public API', function() { rawPut(putAttachment); }); - it('should wrap removeAttachment', function() { - self.fail('Spec unimplemented'); + it('should wrap removeAttachment', function(done) { + function removeAttachment(response) { + return db.removeAttachment('test', 'test', response.rev); + } + + function putAttachment(putDocResult) { + var id = putDocResult.id; + var rev = putDocResult.rev; + var attachment = new Blob(['test']); + + db.putAttachment(id, 'test', rev, attachment, 'text/plain') + .then(removeAttachment) + .then(shouldBeOK) + .catch(shouldNotBeCalled) + .finally(done); + } + + rawPut(putAttachment); }); it('should wrap query', function() {
Implement removeAttachment spec
angular-pouchdb_angular-pouchdb
train
js
ec2d9406e24533919dd36524ec77380b0a2a3a36
diff --git a/yoke/__init__.py b/yoke/__init__.py index <HASH>..<HASH> 100644 --- a/yoke/__init__.py +++ b/yoke/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. __title__ = 'yoke' -__version__ = '0.7.0' +__version__ = '0.8.0-dev' __license__ = 'Apache 2.0' __copyright__ = 'Copyright Rackspace US, Inc. 2017' __url__ = 'https://github.com/rackerlabs/yoke'
Start <I>-dev version
rackerlabs_yoke
train
py
f4da22216309f206920b653b8db616cb1100c9ae
diff --git a/app/models/manager_refresh/dto_lazy.rb b/app/models/manager_refresh/dto_lazy.rb index <HASH>..<HASH> 100644 --- a/app/models/manager_refresh/dto_lazy.rb +++ b/app/models/manager_refresh/dto_lazy.rb @@ -2,12 +2,13 @@ module ManagerRefresh class DtoLazy include Vmdb::Logging - attr_reader :ems_ref, :dto_collection, :path + attr_reader :ems_ref, :dto_collection, :path, :default - def initialize(dto_collection, ems_ref, path: nil) + def initialize(dto_collection, ems_ref, path: nil, default: nil) @ems_ref = ems_ref @dto_collection = dto_collection @path = path + @default = default end def to_s @@ -22,13 +23,14 @@ module ManagerRefresh path ? load_object_with_path : load_object end + def dependency? + !path || dto_collection.dependency_attributes.keys.include?(path.first) + end + private def load_object_with_path - dto_collection.find(to_s).data.fetch_path(*path) - rescue => e - _log.error("Trying to find non existent path #{path} on #{dto_collection}") - raise e + (dto_collection.find(to_s).try(:data) || {}).fetch_path(*path) || default end def load_object
DtoLazy with default and conditional dependency DtoLazy doesn't have to be necesarily a dependency if it points to a non dependency attribute of another DtoCollection. If the attribute doesn't exist, we provide a default value. (transferred from ManageIQ/manageiq@de<I>c<I>ce<I>b3e<I>d<I>cfa<I>b<I>a<I>e<I>)
ManageIQ_inventory_refresh
train
rb
d41d2c31bb8f6d39293967ad931c465c61d485b3
diff --git a/tests/core/contracts/test_extracting_event_data_old.py b/tests/core/contracts/test_extracting_event_data_old.py index <HASH>..<HASH> 100644 --- a/tests/core/contracts/test_extracting_event_data_old.py +++ b/tests/core/contracts/test_extracting_event_data_old.py @@ -8,9 +8,6 @@ from web3._utils.events import ( get_event_data, ) -# Ignore warning in pyethereum 1.6 - will go away with the upgrade -pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'") - @pytest.fixture() def Emitter(web3, EMITTER):
Remove unneeded pytestmark warnings
ethereum_web3.py
train
py
746f6cfb6a8862a4a3297e43cc3eb688af998f41
diff --git a/lib/active_mocker/mock.rb b/lib/active_mocker/mock.rb index <HASH>..<HASH> 100644 --- a/lib/active_mocker/mock.rb +++ b/lib/active_mocker/mock.rb @@ -6,7 +6,6 @@ require 'virtus' require 'active_mocker/logger' require 'active_mocker/loaded_mocks' -require 'active_mocker/rspec_helper' require 'active_mocker/mock/hash_process' require 'active_mocker/mock/collection' require 'active_mocker/mock/queries'
remove rspec_helper from mock.rb
zeisler_active_mocker
train
rb
97a0c632a889b73d38805142eb28147a5ad1145a
diff --git a/ext_localconf.php b/ext_localconf.php index <HASH>..<HASH> 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -258,6 +258,8 @@ $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'] = array_mer 'ai[pin_action]', 'ai[pin_id]', 'ai[wat_action]', 'ai[wat_id]', 'ai[wat_page]', 'ai[site]', 'ai[locale]', 'ai[currency]', + 'ai[resource]', 'ai[include]', 'ai[related]', 'ai[id]', 'ai[filter]', + 'ai[fields]', 'ai[page]', 'ai[sort]', ] );
[TASK] extend the cacheHash configuration array for api calls (#<I>)
aimeos_aimeos-typo3
train
php
768001f44b3892a91cccd4f3464352f677bd26a1
diff --git a/lib/discordrb/errors.rb b/lib/discordrb/errors.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/errors.rb +++ b/lib/discordrb/errors.rb @@ -60,6 +60,9 @@ module Discordrb @code_classes[code] end + # Used when Discord doesn't provide a more specific code + UnknownError = Code(0) + # Unknown Account UnknownAccount = Code(10_001)
Add an UnknownError class for code 0 (when Discord doesn't provide anything more specific than that)
meew0_discordrb
train
rb
3e59e68c951602a2df4d918fe751487235699ea5
diff --git a/rollbar/contrib/django/middleware.py b/rollbar/contrib/django/middleware.py index <HASH>..<HASH> 100644 --- a/rollbar/contrib/django/middleware.py +++ b/rollbar/contrib/django/middleware.py @@ -17,6 +17,7 @@ import sys import rollbar from django.core.exceptions import MiddlewareNotUsed +from django.core.urlresolvers import resolve from django.conf import settings from django.http import Http404 @@ -91,6 +92,19 @@ class RollbarNotifierMiddleware(object): rollbar.init(access_token, environment, **kw) def hook(request, data): + try: + # try django 1.5 method for getting url_name + url_name = request.resolver_match.url_name + except: + # fallback to older method + try: + url_name = resolve(request.path_info).url_name + except: + url_name = None + + if url_name: + data['context'] = url_name + data['framework'] = 'django' if request:
add context for errors in django middleware. Uses the url_name that was specified when building the url rules in urls.py @brianr
rollbar_pyrollbar
train
py
767e13a66dd101202da5f6ea19e35c8308b96b3e
diff --git a/tests/plots/test_declarative.py b/tests/plots/test_declarative.py index <HASH>..<HASH> 100644 --- a/tests/plots/test_declarative.py +++ b/tests/plots/test_declarative.py @@ -1497,7 +1497,7 @@ def test_declarative_plot_geometry_polygons(): pc = PanelContainer() pc.size = (12, 12) pc.panels = [panel] - pc.show() + pc.draw() return pc.figure @@ -1536,7 +1536,7 @@ def test_declarative_plot_geometry_lines(ccrs): pc = PanelContainer() pc.size = (12, 12) pc.panels = [panel] - pc.show() + pc.draw() return pc.figure @@ -1576,7 +1576,7 @@ def test_declarative_plot_geometry_points(ccrs): pc = PanelContainer() pc.size = (12, 12) pc.panels = [panel] - pc.show() + pc.draw() return pc.figure
Replace non-agg show with draw
Unidata_MetPy
train
py
e451deb9a9eb28002f6753c87495d054009258b2
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -111,6 +111,9 @@ itk.runPipelineBrowser = runPipelineBrowser import setMatrixElement from './setMatrixElement.js' itk.setMatrixElement = setMatrixElement +import writeArrayBuffer from './writeArrayBuffer.js' +itk.writeArrayBuffer = writeArrayBuffer + import writeImageArrayBuffer from './writeImageArrayBuffer.js' itk.writeImageArrayBuffer = writeImageArrayBuffer
fix(index.js): Add missing writeArrayBuffer
InsightSoftwareConsortium_itk-js
train
js
70be33369145f3460754c6c4c6f0e241c9a8c914
diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js index <HASH>..<HASH> 100644 --- a/src/app/services/influxdb/influxdbDatasource.js +++ b/src/app/services/influxdb/influxdbDatasource.js @@ -227,7 +227,7 @@ function (angular, _, kbn, InfluxSeries) { data: data }; - return $http(options).then(function (data) { + return $http(options).success(function (data) { deferred.resolve(data); }); }, 10);
Last miniute fix for issue in influxdb http request calling
grafana_grafana
train
js
49b889b4bf0cf3ce9c6a539cff6173e38bbebd6c
diff --git a/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb b/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb index <HASH>..<HASH> 100644 --- a/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb +++ b/contrib/distributed_rails_event_store/dres_client/lib/dres_client/version.rb @@ -1,3 +1,3 @@ module DresClient - VERSION = "0.3.3" + VERSION = "0.4.0" end diff --git a/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb b/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb index <HASH>..<HASH> 100644 --- a/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb +++ b/contrib/distributed_rails_event_store/dres_rails/lib/dres_rails/identity.rb @@ -12,7 +12,7 @@ module DresRails end def self.version - "0.3.3" + "0.4.0" end def self.version_label
Increase VERSION to <I>
RailsEventStore_rails_event_store
train
rb,rb
a052efd26bd6ec8527e4874be7322e18c74ac13f
diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Functional/EnsureShardingTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Functional/EnsureShardingTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Functional/EnsureShardingTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Functional/EnsureShardingTest.php @@ -30,6 +30,7 @@ class EnsureShardingTest extends BaseTest public function testEnsureShardingForCollectionWithDocuments() { + $this->markTestSkipped('Test does not pass due to https://github.com/mongodb/mongo-php-driver/issues/296'); $class = \Documents\Sharded\ShardedOne::class; $collection = $this->dm->getDocumentCollection($class); $doc = array('title' => 'hey', 'k' => 'hi'); @@ -63,6 +64,7 @@ class EnsureShardingTest extends BaseTest public function testEnsureShardingForCollectionWithData() { + $this->markTestSkipped('Test does not pass due to https://github.com/mongodb/mongo-php-driver/issues/296'); $document = new \Documents\Sharded\ShardedOne(); $this->dm->persist($document); $this->dm->flush();
Skip failing sharding tests The tests currently fail because of a missing feature in ext-mongodb. Skipping the tests is the best way to solve this for now.
doctrine_mongodb-odm
train
php
0919c0a738f44a795cb0d6ff380b65b85541e5b2
diff --git a/sh.py b/sh.py index <HASH>..<HASH> 100644 --- a/sh.py +++ b/sh.py @@ -797,10 +797,7 @@ class RunningCommand(object): def output_redirect_is_filename(out): - return out \ - and not callable(out) \ - and not hasattr(out, "write") \ - and not isinstance(out, (cStringIO, StringIO)) + return isinstance(out, basestring) def get_prepend_stack():
more correctly determine if out is filename
amoffat_sh
train
py
70098475256d30f17802b06f8c19e57e37e4b510
diff --git a/config/initializers/will_paginate.rb b/config/initializers/will_paginate.rb index <HASH>..<HASH> 100644 --- a/config/initializers/will_paginate.rb +++ b/config/initializers/will_paginate.rb @@ -27,7 +27,7 @@ module WillPaginate end def gap - tag :li, link('&hellip;'.html_safe, '#', :class => 'disabled') + tag :li, link('&hellip;'.html_safe, '#'), :class => 'disabled' end def previous_or_next_page(page, text, classname)
Fix gap styling by moving disabled class up to the li tag
yrgoldteeth_bootstrap-will_paginate
train
rb
4c3511c30fef92e2084d4477f0ce7afd5553527b
diff --git a/libs/options.js b/libs/options.js index <HASH>..<HASH> 100644 --- a/libs/options.js +++ b/libs/options.js @@ -375,7 +375,7 @@ var parse = function(args,cb) { argv.ips = result[0]; argv.ports = result[1]; - if (!argv.port) { + if (!argv.port && !argv.reverse && !argv.geo) { var msg = 'Please specify at least one port, --port=80'; return cb(msg); }
fix test not passing because of #<I>
eviltik_evilscan
train
js
17368f6af6b797a127ab77146e4f4852888463c1
diff --git a/clients/web/src/views/body/PluginsView.js b/clients/web/src/views/body/PluginsView.js index <HASH>..<HASH> 100644 --- a/clients/web/src/views/body/PluginsView.js +++ b/clients/web/src/views/body/PluginsView.js @@ -10,7 +10,7 @@ girder.views.PluginsView = girder.View.extend({ 'click .g-plugin-restart-button': function (evt) { var params = { text: 'Are you sure you want to restart the server? This ' + - 'will interrupt any running tasks.', + 'will interrupt all running tasks for all users.', yesText: 'Restart', confirmCallback: girder.restartServer };
Modified warning message to mention all users.
girder_girder
train
js
a69479a4f8d8bac9cc1086ee6b6a9d02ac6ff2b4
diff --git a/src/Illuminate/Support/Stringable.php b/src/Illuminate/Support/Stringable.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Support/Stringable.php +++ b/src/Illuminate/Support/Stringable.php @@ -745,6 +745,23 @@ class Stringable implements JsonSerializable } /** + * Execute the given callback if the string is not empty. + * + * @param callable $callback + * @return static + */ + public function whenNotEmpty($callback) + { + if ($this->isNotEmpty()) { + $result = $callback($this); + + return is_null($result) ? $this : $result; + } + + return $this; + } + + /** * Limit the number of words in a string. * * @param int $words
[8.x] Add Stringable::whenNotEmpty() (#<I>)
laravel_framework
train
php
ca26b94fa03c487e313dba034165fb59eab8554c
diff --git a/src/dnd-service.js b/src/dnd-service.js index <HASH>..<HASH> 100644 --- a/src/dnd-service.js +++ b/src/dnd-service.js @@ -50,6 +50,10 @@ html, body { box-shadow: 0 0 16px gray; } +.bcx-dnd-preview .bcx-dnd-preview-hide { + visible: hidden !important; +} + .bcx-dnd-hide { display: none !important; }
feat: support class .bcx-dnd-preview-hide to hide some node in .bcx-dnd-preview.
buttonwoodcx_bcx-aurelia-dnd
train
js
17eab6a0be3ead4270c964ecd56d9ebab6b10a60
diff --git a/storage/iordf/src/main/java/org/openscience/cdk/io/rdf/CDKOWLWriter.java b/storage/iordf/src/main/java/org/openscience/cdk/io/rdf/CDKOWLWriter.java index <HASH>..<HASH> 100644 --- a/storage/iordf/src/main/java/org/openscience/cdk/io/rdf/CDKOWLWriter.java +++ b/storage/iordf/src/main/java/org/openscience/cdk/io/rdf/CDKOWLWriter.java @@ -109,7 +109,7 @@ public class CDKOWLWriter extends DefaultChemObjectWriter { writeMolecule((IAtomContainer) object); } catch (Exception ex) { ex.printStackTrace(); - throw new CDKException("Error while writing HIN file: " + ex.getMessage(), ex); + throw new CDKException("Error while writing CDK OWL file: " + ex.getMessage(), ex); } } else { throw new CDKException("CDKOWLWriter only supports output of IAtomContainer classes.");
Fixed the error message: correct writer description
cdk_cdk
train
java
6f167cbbb7500f80a556cdd7a5404e9022c60ae7
diff --git a/py3status/modules/keyboard_layout.py b/py3status/modules/keyboard_layout.py index <HASH>..<HASH> 100644 --- a/py3status/modules/keyboard_layout.py +++ b/py3status/modules/keyboard_layout.py @@ -30,7 +30,7 @@ LANG_COLORS = { LAYOUT_RE = re.compile(r".*layout:\s*(\w+).*", flags=re.DOTALL) -def xbklayout(): +def xkblayout(): """ check using xkblayout-state (preferred method) """ @@ -63,11 +63,11 @@ class Py3status: find the best implementation to get the keyboard's layout """ try: - xbklayout() + xkblayout() except: self.command = setxkbmap else: - self.command = xbklayout + self.command = xkblayout def keyboard_layout(self, i3s_output_list, i3s_config): response = {
Fix typos in keyboard_layout module resolves #<I>
ultrabug_py3status
train
py
16db73e420ff3cee9ab417cbcfc86f78e986824b
diff --git a/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java b/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java +++ b/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java @@ -222,9 +222,11 @@ public class ConfigurationFile { private File findSnapshotWithPrefix(final String prefix, boolean errorIfNoFiles) { List<String> names = new ArrayList<String>(); - for (String curr : snapshotsDirectory.list()) { - if (curr.startsWith(prefix)) { - names.add(curr); + if (snapshotsDirectory.exists() && snapshotsDirectory.isDirectory()) { + for (String curr : snapshotsDirectory.list()) { + if (curr.startsWith(prefix)) { + names.add(curr); + } } } if (names.size() == 0 && errorIfNoFiles) {
[JBAS-<I>] Avoid NPE when -host-config is set
wildfly_wildfly
train
java
01956c3732b8dd5af07777779b144451f3bc2739
diff --git a/networkzero/discovery.py b/networkzero/discovery.py index <HASH>..<HASH> 100644 --- a/networkzero/discovery.py +++ b/networkzero/discovery.py @@ -607,7 +607,7 @@ def reset_beacon(): if __name__ == '__main__': handler = logging.StreamHandler() - handler.setLevel(logging.DEBUG) + handler.setLevel(logging.INFO) handler.setFormatter(logging.Formatter("%(levelname)s - %(message)s")) _logger.addHandler(handler) _start_beacon()
Dial back the output when discovery is run as a module
tjguk_networkzero
train
py
82d4a42d0835d3b8dceb8918199d5282fdae6d83
diff --git a/src/PageItem.js b/src/PageItem.js index <HASH>..<HASH> 100644 --- a/src/PageItem.js +++ b/src/PageItem.js @@ -6,6 +6,7 @@ const PageItem = React.createClass({ propTypes: { href: React.PropTypes.string, target: React.PropTypes.string, + title: React.PropTypes.string, disabled: React.PropTypes.bool, previous: React.PropTypes.bool, next: React.PropTypes.bool,
Define type for `title` property in PageItem Accorging to <URL>
react-bootstrap_react-bootstrap
train
js
c85860b3a0651631519c00d527b153dd611fc262
diff --git a/web/ext/base.py b/web/ext/base.py index <HASH>..<HASH> 100644 --- a/web/ext/base.py +++ b/web/ext/base.py @@ -5,10 +5,16 @@ try: except ImportError: IOBase = None +try: + from collections import Generator +except ImportError: + def _tmp(): + yield None + Generator = type(_tmp()) + from os.path import getmtime from time import mktime, gmtime from datetime import datetime -from collections import Generator from mimetypes import init, add_type, guess_type from webob import Request, Response
Generator is, apparently, rather new.
marrow_WebCore
train
py
78c8ac88576d5b146e553fdb3e74b9e3dd2b64be
diff --git a/design/admin2/javascript/ezajaxsubitems_datatable.js b/design/admin2/javascript/ezajaxsubitems_datatable.js index <HASH>..<HASH> 100644 --- a/design/admin2/javascript/ezajaxsubitems_datatable.js +++ b/design/admin2/javascript/ezajaxsubitems_datatable.js @@ -181,7 +181,7 @@ var sortableSubitems = function () { return "::" + state.pagination.rowsPerPage + "::" + state.pagination.recordOffset + "::" + state.sortedBy.key + - "::" + ((state.sortedBy.dir === YAHOO.widget.DataTable.CLASS_ASC) ? "1" : "0") + + "::" + ((state.sortedBy.dir === YAHOO.widget.DataTable.CLASS_ASC) ? "0" : "1") + "?ContentType=json"; }
Fix bug #<I>: Admin subitems have reverse ordering of items on pagination
ezsystems_ezpublish-legacy
train
js
6acad332708c87eee6f251a86e10e1f27b6c0a73
diff --git a/prow/github/client.go b/prow/github/client.go index <HASH>..<HASH> 100644 --- a/prow/github/client.go +++ b/prow/github/client.go @@ -452,7 +452,11 @@ func (c *Client) requestRetry(method, path, accept string, body interface{}) (*h break } } else if oauthScopes := resp.Header.Get("X-Accepted-OAuth-Scopes"); len(oauthScopes) > 0 { - err = fmt.Errorf("is the account using at least one of the following oauth scopes?: %s", oauthScopes) + authorizedScopes := resp.Header.Get("X-OAuth-Scopes") + if authorizedScopes == "" { + authorizedScopes = "no" + } + err = fmt.Errorf("the account is using %s oauth scopes, please make sure you are using at least one of the following oauth scopes: %s", authorizedScopes, oauthScopes) resp.Body.Close() break }
List currently authorized scopes on <I> We cannot be certain that the <I> error is caused by insufficient permissions, so while displaying which scopes should be used also display which scopes are in use.
kubernetes_test-infra
train
go
afc409b08f1f2504d331f9ad93f09ff7912c2fd5
diff --git a/pymola/backends/casadi/model.py b/pymola/backends/casadi/model.py index <HASH>..<HASH> 100644 --- a/pymola/backends/casadi/model.py +++ b/pymola/backends/casadi/model.py @@ -543,11 +543,16 @@ class Model: @property def variable_metadata_function(self): out = [] + zero, one = ca.MX(0), ca.MX(1) # Recycle these common nodes as much as possible. for variable_list in [self.states, self.alg_states, self.inputs, self.parameters, self.constants]: attribute_lists = [[] for i in range(len(ast.Symbol.ATTRIBUTES))] for variable in variable_list: for attribute_list_index, attribute in enumerate(ast.Symbol.ATTRIBUTES): value = ca.MX(getattr(variable, attribute)) + if value.is_zero(): + value = zero + elif (value - 1).is_zero(): + value = one value = value if value.numel() != 1 else ca.repmat(value, *variable.symbol.size()) attribute_lists[attribute_list_index].append(value) out.append(ca.horzcat(*[ca.veccat(*attribute_list) for attribute_list in attribute_lists]))
CasADi backend, metadata_function: Recycle common nodes (0, 1) as much as possible.
pymoca_pymoca
train
py
e523cc2aa7616ad52145f5e14e4a8de39a9daf25
diff --git a/test/docker-tests/src/test/java/it/unibz/inf/ontop/docker/postgres/AnnotationMovieTest.java b/test/docker-tests/src/test/java/it/unibz/inf/ontop/docker/postgres/AnnotationMovieTest.java index <HASH>..<HASH> 100644 --- a/test/docker-tests/src/test/java/it/unibz/inf/ontop/docker/postgres/AnnotationMovieTest.java +++ b/test/docker-tests/src/test/java/it/unibz/inf/ontop/docker/postgres/AnnotationMovieTest.java @@ -116,8 +116,8 @@ public class AnnotationMovieTest extends AbstractVirtualModeTest{ "}"; - - countResults(queryBind, 876722); + // TODO: double-check this number (obtained after inserting DISTINCT) + countResults(queryBind, 546032); } @@ -174,7 +174,8 @@ public class AnnotationMovieTest extends AbstractVirtualModeTest{ "}"; - countResults(queryBind, 705859); + // TODO: double-check this number (obtained after inserting DISTINCT) + countResults(queryBind, 131645); // countResults(queryBind, 10000); }
AnnotationMovieTest counts updated.
ontop_ontop
train
java
bc89ec189abbf50dec1e4f74774fde0f32d5d900
diff --git a/tests/RatesTest.php b/tests/RatesTest.php index <HASH>..<HASH> 100644 --- a/tests/RatesTest.php +++ b/tests/RatesTest.php @@ -116,7 +116,7 @@ class RatesTest extends PHPUnit_Framework_TestCase $cacheMock ->expects(self::once()) - ->method('put'); + ->method('set'); $rates = new Rates( $clientMock, $cacheMock ); }
Update test cases to test new cache interface
ibericode_vat
train
php
d3b7559b9b2e1ccb62cd315bd103cafbb34118a2
diff --git a/src/adapters/adapter.moment.js b/src/adapters/adapter.moment.js index <HASH>..<HASH> 100644 --- a/src/adapters/adapter.moment.js +++ b/src/adapters/adapter.moment.js @@ -18,7 +18,7 @@ var FORMATS = { year: 'YYYY' }; -adapters._date.override(moment ? { +adapters._date.override(typeof moment === 'function' ? { _id: 'moment', // DEBUG ONLY formats: function() {
Tighten check for detecting if Moment is installed (#<I>)
chartjs_Chart.js
train
js
71efadd4c5fbe621ee2522fc2305be2bb74e4669
diff --git a/etc/test-config.js b/etc/test-config.js index <HASH>..<HASH> 100644 --- a/etc/test-config.js +++ b/etc/test-config.js @@ -98,13 +98,12 @@ module.exports = { rejectUnauthorized: false, ssl: true }, -testConnection: { - host: testHost, + testConnection: { + host: testHost, port: restPort, user: testUser, password: testPassword, authType: restAuthType, - rejectUnauthorized: false, - ssl: true + rejectUnauthorized: false } };
Removing ssl.
marklogic_node-client-api
train
js
3a9c82972b3191a76180364e939ea486dfbc2551
diff --git a/tensorflow_datasets/text/wikipedia.py b/tensorflow_datasets/text/wikipedia.py index <HASH>..<HASH> 100644 --- a/tensorflow_datasets/text/wikipedia.py +++ b/tensorflow_datasets/text/wikipedia.py @@ -115,7 +115,7 @@ class Wikipedia(tfds.core.BeamBasedBuilder): BUILDER_CONFIGS = [ WikipediaConfig( # pylint:disable=g-complex-comprehension version=tfds.core.Version( - "0.0.2", experiments={tfds.core.Experiment.S3: False}), + "0.0.3", experiments={tfds.core.Experiment.S3: False}), language=lang, date="20190301", ) for lang in WIKIPEDIA_LANGUAGES @@ -170,7 +170,7 @@ class Wikipedia(tfds.core.BeamBasedBuilder): return [ tfds.core.SplitGenerator( # pylint:disable=g-complex-comprehension name=tfds.Split.TRAIN, - num_shards=int(math.ceil(total_bytes / (4 * 2 ** 30))), # max 4GB + num_shards=int(math.ceil(total_bytes / (128 * 2**20))), # max 128MB gen_kwargs={"filepaths": downloaded_files["xml"], "language": lang}) ]
Increase number of shards in Wikipedia to allow increased read parallelism. PiperOrigin-RevId: <I>
tensorflow_datasets
train
py
3ad82590ba4643fc9714110fb87847238a2cefb9
diff --git a/server/conn.go b/server/conn.go index <HASH>..<HASH> 100644 --- a/server/conn.go +++ b/server/conn.go @@ -382,6 +382,9 @@ func (cc *clientConn) handleQuery(sql string) (err error) { err = cc.writeOK() } costTime := time.Now().Sub(startTs) + if len(sql) > 1024 { + sql = sql[:1024] + } if costTime < time.Second { log.Debugf("[TIME_QUERY] %v %s", costTime, sql) } else {
server: trim large sql statement for logging. (#<I>)
pingcap_tidb
train
go
91cfb88a21193e521851c6ad924ca4fa2989e5da
diff --git a/src/FluxBB/Models/ConfigRepository.php b/src/FluxBB/Models/ConfigRepository.php index <HASH>..<HASH> 100644 --- a/src/FluxBB/Models/ConfigRepository.php +++ b/src/FluxBB/Models/ConfigRepository.php @@ -32,7 +32,7 @@ class ConfigRepository implements ConfigRepositoryInterface protected function data() { - if ($this->loaded) { + if (!$this->loaded) { $this->data = $this->original = $this->cache->remember('fluxbb.config', 24 * 60, function () { $data = $this->database->table('config')->get(); $cache = array();
Fix negation for loaded check in data method
fluxbb_core
train
php
de8f142c479c167d80685c5cce556c2908f30a57
diff --git a/lib/credit_card_validations/card_rules.rb b/lib/credit_card_validations/card_rules.rb index <HASH>..<HASH> 100644 --- a/lib/credit_card_validations/card_rules.rb +++ b/lib/credit_card_validations/card_rules.rb @@ -52,6 +52,7 @@ module CreditCardValidations maestro: [ {length: [12, 13, 14, 15, 16, 17, 18, 19], prefixes: ['5010', '5011', '5012', '5013', '5014', '5015', '5016', '5017', '5018', '502', '503', '504', '505', '506', '507', '508', + '56','57', '58', '59', '6012', '6013', '6014', '6015', '6016', '6017', '6018', '6019', '602', '603', '604', '605', '6060', '621', '627', '629', @@ -75,7 +76,6 @@ module CreditCardValidations hipercard: [ length: [19], prefixes: ['384'] ] - } end end
added prefixes for maestro
Fivell_credit_card_validations
train
rb
ceff5fe0dd1f5f55228ade61f2cc0902a07fff5b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ export class PortalProvider extends React.Component { _emitter: *; static childContextTypes = oContextTypes; - state = {}; + portals = new Map(); getChildContext() { return { @@ -56,11 +56,13 @@ export class PortalProvider extends React.Component { // 변경 portalSet = (name, value) => { - const emitter = this._emitter; - this.setState({ [name]: value }, () => emitter && emitter.emit(name)); + this.portals.set(name, value); + if (this._emitter) { + this._emitter.emit(name); + } }; - portalGet = name => this.state[name] || null; + portalGet = name => this.portals.get(name) || null; // 변경 render() {
Do not use state in PortalProvider
zenyr_react-native-portal
train
js
92e7e44c5cb30b9de8f53af7062fbae6ef7dee92
diff --git a/Block/Sidebar/Recent.php b/Block/Sidebar/Recent.php index <HASH>..<HASH> 100755 --- a/Block/Sidebar/Recent.php +++ b/Block/Sidebar/Recent.php @@ -56,6 +56,7 @@ class Recent extends Template implements BlockInterface { return $this->postCollectionFactory->create() ->addVisibilityFilter() + ->addStoreFilter($this->context->getStoreManager()->getStore()->getId()) ->addAttributeToSelect(['name', 'featured_image', 'url_key']) ->setOrder('created_at', 'desc'); }
applied store filter to "Recent Posts"
mirasvit_module-blog
train
php
c9866d4a70a46b4c5c6d6c0e2234878d42e68cdf
diff --git a/Log/mail.php b/Log/mail.php index <HASH>..<HASH> 100644 --- a/Log/mail.php +++ b/Log/mail.php @@ -144,6 +144,9 @@ class Log_mail extends Log error_log("Log_mail: Failure executing mail()", 0); return false; } + + /* Clear the message string now that the email has been sent. */ + $this->_message = ''; } $this->_opened = false; }
Clear the message string once the email has been sent.
pear_Log
train
php
36f578d23d7be2e132dcc575fc9b76fdaa2b97e7
diff --git a/test/web.js b/test/web.js index <HASH>..<HASH> 100644 --- a/test/web.js +++ b/test/web.js @@ -12,7 +12,7 @@ suite('Simulates loading scripts in a browser', function () { function load(path) { var text = fs.readFileSync(path, 'utf8'); - var func = new Function('window', 'module', 'exports', 'require', text); + var func = new Function('window', 'module', 'exports', 'require', text); // jshint ignore:line return func(window); }
Suppressed a jshint warning.
c5f7c9_llkp
train
js
fc9a3c635bd95d1fb44777a092bedb045461c794
diff --git a/aws/resource_aws_launch_configuration_test.go b/aws/resource_aws_launch_configuration_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_launch_configuration_test.go +++ b/aws/resource_aws_launch_configuration_test.go @@ -3,11 +3,9 @@ package aws import ( "fmt" "log" - "math/rand" "regexp" "strings" "testing" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" @@ -538,7 +536,7 @@ resource "aws_launch_configuration" "bar" { virtual_name = "ephemeral0" } } -`, rand.New(rand.NewSource(time.Now().UnixNano())).Int()) +`, acctest.RandInt()) } func testAccAWSLaunchConfigurationWithSpotPriceConfig() string { @@ -549,7 +547,7 @@ resource "aws_launch_configuration" "bar" { instance_type = "t2.micro" spot_price = "0.01" } -`, rand.New(rand.NewSource(time.Now().UnixNano())).Int()) +`, acctest.RandInt()) } func testAccAWSLaunchConfigurationNoNameConfig() string {
tests/resource/aws_launch_configuration: Replace rand.New() usage with acctest.RandInt()
terraform-providers_terraform-provider-aws
train
go
240f887927551ae53e85c674ecc74986589d8bef
diff --git a/panels/UserPanel.php b/panels/UserPanel.php index <HASH>..<HASH> 100644 --- a/panels/UserPanel.php +++ b/panels/UserPanel.php @@ -207,7 +207,7 @@ class UserPanel extends Panel try { $authManager = Yii::$app->getAuthManager(); - if ($authManager instanceof yii\rbac\ManagerInterface) { + if ($authManager instanceof \yii\rbac\ManagerInterface) { $roles = ArrayHelper::toArray($authManager->getRolesByUser(Yii::$app->getUser()->id)); foreach ($roles as &$role) { $role['data'] = $this->dataToString($role['data']);
fixed broken instanceof check in UserPanel
yiisoft_yii2-debug
train
php
5e715109a45dd58272b1f9a25a9899bb6fcbbe4e
diff --git a/pyorbital/orbital.py b/pyorbital/orbital.py index <HASH>..<HASH> 100644 --- a/pyorbital/orbital.py +++ b/pyorbital/orbital.py @@ -126,14 +126,15 @@ def get_observer_look(sat_lon, sat_lat, sat_alt, utc_time, lon, lat, alt): top_z = cos_lat * cos_theta * rx + \ cos_lat * sin_theta * ry + sin_lat * rz + # Azimuth is undefined when elevation is 90 degrees, 180 (pi) will be returned. az_ = np.arctan2(-top_e, top_s) + np.pi + az_ = np.mod(az_, 2 * np.pi) # Needed on some platforms rg_ = np.sqrt(rx * rx + ry * ry + rz * rz) top_z_divided_by_rg_ = top_z / rg_ # Due to rounding top_z can be larger than rg_ (when el_ ~ 90). - # And azimuth undefined when elevation is 90 degrees top_z_divided_by_rg_ = top_z_divided_by_rg_.clip(max=1) el_ = np.arcsin(top_z_divided_by_rg_)
Fix problem for macos (hopefully)
pytroll_pyorbital
train
py
a1653a140e44e82be6047a0db63b276192756146
diff --git a/Model/Service/TransactionHandlerService.php b/Model/Service/TransactionHandlerService.php index <HASH>..<HASH> 100755 --- a/Model/Service/TransactionHandlerService.php +++ b/Model/Service/TransactionHandlerService.php @@ -146,7 +146,7 @@ class TransactionHandlerService ); // Create a transaction if needed - if (!$transaction) { + if (!$transaction || $webhook !== 'payment_capture_pending') { // Build the transaction $transaction = $this->buildTransaction( $order,
Transaction now not attempted for capture pending
checkout_checkout-magento2-plugin
train
php
b2ed746e053cf5a5c04f43015f38709116db2194
diff --git a/src/pyop/authz_state.py b/src/pyop/authz_state.py index <HASH>..<HASH> 100644 --- a/src/pyop/authz_state.py +++ b/src/pyop/authz_state.py @@ -46,7 +46,7 @@ class AuthorizationState(object): :param access_token_lifetime: how long before access tokens should expire (in seconds), defaults to 1 hour :param refresh_token_lifetime: how long before refresh tokens should expire (in seconds), - defaults to never expiring + defaults to never issuing a refresh token if not defined :param refresh_token_threshold: how long before refresh token expiry time a new one should be issued (in seconds) in a token refresh request, defaults to never issuing a new refresh token """
Update code docs for refresh_token_lifetime. Refresh tokens are by default not issued (if refresh_token_lifetime is not defined).
IdentityPython_pyop
train
py
4986666d6c08146a42ebc8447514d526d2d5a743
diff --git a/example/src/App.js b/example/src/App.js index <HASH>..<HASH> 100644 --- a/example/src/App.js +++ b/example/src/App.js @@ -38,7 +38,7 @@ class App extends Component { <div className="col-md-4 col-lg-3 col-6"> <div className="card"> <div className="img-wrapper"> - <Picture className={'card-img-top'} breakpoints={{ + <Picture className={'card-img-top'} data-alt={c.Name} breakpoints={{ lg: { src: c.Image, op: 'resize?size=x200'
* Added alt attributes to the example
Pixboost_pixboost-react
train
js
d55b1eebd8ca434113d817695aff7cf2aae3afdd
diff --git a/externs/html5.js b/externs/html5.js index <HASH>..<HASH> 100644 --- a/externs/html5.js +++ b/externs/html5.js @@ -2744,11 +2744,11 @@ MutationObserver.prototype.disconnect = function() {}; Window.prototype.MutationObserver; /** - * @type {function(new:MutationObserver)} + * @type {function(new:MutationObserver, function(Array.<MutationRecord>))} */ Window.prototype.WebKitMutationObserver; /** - * @type {function(new:MutationObserver)} + * @type {function(new:MutationObserver, function(Array.<MutationRecord>))} */ Window.prototype.MozMutationObserver;
Remove webkit_mutationobserver.js from externs now that the externs are in javascript/externs. Also fixed up the type annotation for WebKitMutationObserver and MozMutationObserver constructors. R=isparrow,acleung DELTA=<I> (2 added, <I> deleted, 8 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
js
ef182869ba05fe15e94882e6157ff170da217209
diff --git a/system/modules/generalDriver/DcGeneral/DataDefinition/Palette/Legend.php b/system/modules/generalDriver/DcGeneral/DataDefinition/Palette/Legend.php index <HASH>..<HASH> 100644 --- a/system/modules/generalDriver/DcGeneral/DataDefinition/Palette/Legend.php +++ b/system/modules/generalDriver/DcGeneral/DataDefinition/Palette/Legend.php @@ -233,9 +233,11 @@ class Legend implements LegendInterface $this->palette = null; $properties = array(); - foreach ($this->properties as $index => $property) + foreach ($this->properties as $property) { - $properties[$index] = clone $property; + $bobaFett = clone $property; + + $properties[spl_object_hash($bobaFett)] = $bobaFett; } $this->properties = $properties; }
Bugfix: Remove clone wars. Use the real key of the clones when cloning properties in a legend clone.
contao-community-alliance_dc-general
train
php
d52701aec8d06ece3d6d0dabbc781394a7460175
diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -126,7 +126,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, { * Returns: * {Boolean} Always returns true. */ - draw:function() { + draw: function() { if (this.layer != this.layer.map.baseLayer && this.layer.reproject) { this.bounds = this.getBoundsFromBaseLayer(this.position); }
Adding a space to clean up diffs for transition patch. (No functional change.) git-svn-id: <URL>
openlayers_openlayers
train
js
f6990708d4eb7da6f28785138e27d007982cf6fb
diff --git a/library/CM/Jobdistribution/JobWorker.php b/library/CM/Jobdistribution/JobWorker.php index <HASH>..<HASH> 100644 --- a/library/CM/Jobdistribution/JobWorker.php +++ b/library/CM/Jobdistribution/JobWorker.php @@ -24,6 +24,7 @@ class CM_Jobdistribution_JobWorker extends CM_Class_Abstract { while (true) { $workFailed = false; try { + CM_Cache_Storage_Runtime::getInstance()->flush(); $workFailed = !$this->_getGearmanWorker()->work(); } catch (Exception $ex) { $this->_handleException($ex);
flush runtime cache in worker-process before starting a new job
cargomedia_cm
train
php
3db7b343082106afe1ab4abac8cbb7dacba307e1
diff --git a/rb/lib/selenium/webdriver/remote/capabilities.rb b/rb/lib/selenium/webdriver/remote/capabilities.rb index <HASH>..<HASH> 100644 --- a/rb/lib/selenium/webdriver/remote/capabilities.rb +++ b/rb/lib/selenium/webdriver/remote/capabilities.rb @@ -97,13 +97,17 @@ module Selenium # @api private # - def to_json(*args) + def as_json(*args) { "browserName" => browser_name, "version" => version, "platform" => platform.to_s.upcase, "javascriptEnabled" => javascript? - }.to_json(*args) + } + end + + def to_json(*args) + as_json.to_json(*args) end end # Capabilities
JariBakken: Fix JSON serialization issue when running under Rails. r<I>
SeleniumHQ_selenium
train
rb
a3ebbe78fe246e0d1df75e93b389f7814d2fd64e
diff --git a/lib/puppet/version.rb b/lib/puppet/version.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/version.rb +++ b/lib/puppet/version.rb @@ -6,7 +6,7 @@ # Raketasks and such to set the version based on the output of `git describe` module Puppet - PUPPETVERSION = '5.5.4' + PUPPETVERSION = '5.5.5' ## # version is a public API method intended to always provide a fast and
(PUP-<I>) Update version to <I>
puppetlabs_puppet
train
rb
f48d8785f12205a3c722c05c2e3e683a418ae654
diff --git a/integration/install_test.go b/integration/install_test.go index <HASH>..<HASH> 100644 --- a/integration/install_test.go +++ b/integration/install_test.go @@ -438,7 +438,7 @@ func serviceCreate() ExecFlow { "servicename": "integration-service", } for k, v := range replaces { - cmd := NewCommand("sed", "-i", "'.bak'", "'s~"+k+"~"+v+"~'", "manifest.yaml") + cmd := NewCommand("sed", "-i", "-e", "'s~"+k+"~"+v+"~'", "manifest.yaml") res = cmd.Run(env) c.Assert(res, ResultOk) }
integration: makes sed portable between osx/linux
tsuru_tsuru
train
go
d8c066b86a616f5d5a55e51629727af925e683f2
diff --git a/bytebuffer/buffer.go b/bytebuffer/buffer.go index <HASH>..<HASH> 100644 --- a/bytebuffer/buffer.go +++ b/bytebuffer/buffer.go @@ -18,10 +18,10 @@ package bytebuffer type Buffer interface { + Bytes() []byte Pos() int SetPos(int) Len() int - Buffer() []byte Write([]byte) WriteString(string) WriteInt(int) diff --git a/bytebuffer/bytebuffer.go b/bytebuffer/bytebuffer.go index <HASH>..<HASH> 100644 --- a/bytebuffer/bytebuffer.go +++ b/bytebuffer/bytebuffer.go @@ -34,7 +34,7 @@ func (b *ByteBuffer) SetPos(position int) { func (b *ByteBuffer) Len() int { return len(b.buffer) } -func (b *ByteBuffer) Buffer() []byte { return b.buffer } +func (b *ByteBuffer) Bytes() []byte { return b.buffer } func (b *ByteBuffer) Write(data []byte) { l := len(data) diff --git a/writer.go b/writer.go index <HASH>..<HASH> 100644 --- a/writer.go +++ b/writer.go @@ -319,5 +319,5 @@ func (w *PCPWriter) Start() { buffer := bytebuffer.NewByteBuffer(l) w.fillData(buffer) - w.Write(buffer.Buffer()) + w.Write(buffer.Bytes()) }
bytebuffer: rename Buffer to Bytes same as bytes.Buffer
performancecopilot_speed
train
go,go,go
807c6f66d62eef01228ab8db5a63612be5db9dc4
diff --git a/lib/tus/input.rb b/lib/tus/input.rb index <HASH>..<HASH> 100644 --- a/lib/tus/input.rb +++ b/lib/tus/input.rb @@ -7,7 +7,7 @@ module Tus def read(*args) result = @input.read(*args) - @bytes_read += result.size if result.is_a?(String) + @bytes_read += result.bytesize if result.is_a?(String) result end diff --git a/test/s3_test.rb b/test/s3_test.rb index <HASH>..<HASH> 100644 --- a/test/s3_test.rb +++ b/test/s3_test.rb @@ -53,7 +53,7 @@ describe Tus::Storage::S3 do multipart_upload = @storage.bucket.object("foo").multipart_upload(info["multipart_id"]) assert_equal [], multipart_upload.parts.to_a - @storage.patch_file("foo", StringIO.new("file"), info) + @storage.patch_file("foo", Tus::Input.new(StringIO.new("file")), info) response = @storage.bucket.object("foo").get assert_equal "text/plain", response.content_type
Fix S3 upload for Tus::Input objects
janko_tus-ruby-server
train
rb,rb
f69ad9b4bb4a3b0e038c4ba9afc7ce047d483c0e
diff --git a/detectem/response.py b/detectem/response.py index <HASH>..<HASH> 100644 --- a/detectem/response.py +++ b/detectem/response.py @@ -14,7 +14,7 @@ from detectem.exceptions import DockerStartError, SplashError from detectem.utils import docker_container DEFAULT_CHARSET = 'iso-8859-1' -ERROR_STATUS_CODES = [504] +ERROR_STATUS_CODES = [400, 504] logger = logging.getLogger('detectem')
<I> seems to be a proper error number too I get this when using a non-resolvable name (e.g., <URL>)
alertot_detectem
train
py
8a706fe4541965a0c45f1813f40025040b4393ba
diff --git a/lib/cinch/bot.rb b/lib/cinch/bot.rb index <HASH>..<HASH> 100644 --- a/lib/cinch/bot.rb +++ b/lib/cinch/bot.rb @@ -347,9 +347,10 @@ module Cinch join_lambda = lambda { @config.channels.each { |channel| Channel(channel).join }} if @config.delay_joins.is_a?(Symbol) - on @config.delay_joins do + handlers = on(@config.delay_joins) { + handlers.each { |handler| handler.unregister } join_lambda.call - end + } else Timer.new(self, interval: @config.delay_joins, shots: 1) do join_lambda.call
only join channels the first time an event fired
cinchrb_cinch
train
rb
7fedb9039b9104edef98ecdad789efc7690cb29f
diff --git a/src/widget.property.js b/src/widget.property.js index <HASH>..<HASH> 100644 --- a/src/widget.property.js +++ b/src/widget.property.js @@ -400,6 +400,22 @@ RDFauthor.registerWidget({ e.stopPropagation(); } }); + + /** INPUT EVENTS */ + + $('#filterProperties').val('start typing to filter the results or enter a custom property uri') + .click(function() { + $(this).val(''); + }).keydown(function(event) { + if(event.which == '13') { + event.preventDefault(); + var resourceUri = $('#filterProperties').val(); + var keydownEvent = $.Event("keydown"); + keydownEvent.which=13; + self.element().val(resourceUri).trigger(keydownEvent); + $('.modal-wrapper-propertyselector').remove(); + } + }); /** SHOW-HIDE-SCROLL EVENTS */ $('html').unbind('click').click(function(){
adds the facility to enter custom property uri
AKSW_RDFauthor
train
js
2caf5ed8c83ed1df9e53a88d95fa9d1307dd90a3
diff --git a/client/config/index.js b/client/config/index.js index <HASH>..<HASH> 100644 --- a/client/config/index.js +++ b/client/config/index.js @@ -18,7 +18,11 @@ if ( 'undefined' === typeof window || ! window.configData ) { const configData = window.configData; -if ( process.env.NODE_ENV === 'development' || configData.env_id === 'stage' ) { +if ( + process.env.NODE_ENV === 'development' || + configData.env_id === 'stage' || + ( window && window.location.href.indexOf( 'https://calypso.live' ) === 0 ) +) { const match = document.location.search && document.location.search.match( /[?&]flags=([^&]+)(&|$)/ ); if ( match ) {
Calypso.live: allow for controlling flags by url (#<I>)
Automattic_wp-calypso
train
js
f2249c0ea3bea63124232b15640cb37d554274e9
diff --git a/tests/unit/test_core.py b/tests/unit/test_core.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_core.py +++ b/tests/unit/test_core.py @@ -4,7 +4,7 @@ import copy import pytest from tempora.schedule import DelayedCommand, now -from pmxbot.core import AtHandler, Scheduled +from pmxbot.core import AtHandler, Scheduled, command, Handler class DelayedCommandMatch: @@ -20,6 +20,30 @@ def patch_scheduled_registry(monkeypatch): monkeypatch.setattr(Scheduled, '_registry', []) +@pytest.fixture +def patch_handler_registry(monkeypatch): + """ + Ensure Handler._registry is not mutated by these tests. + """ + monkeypatch.setattr(Handler, '_registry', []) + + +@pytest.mark.usefixtures("patch_handler_registry") +class TestCommandHandlerUniqueness: + def test_command_with_aliases(self): + @command(aliases='mc') + def my_cmd(): + "help for my command" + + assert len(Handler._registry) == 2 + + # attempt to re-registor both the command and its alias + for handler in Handler._registry: + copy.deepcopy(handler).register() + + assert len(Handler._registry) == 2 + + @pytest.mark.usefixtures("patch_scheduled_registry") class TestScheduledHandlerUniqueness: @pytest.fixture
Add test capturing failure. Ref #<I>.
yougov_pmxbot
train
py
05de7c5af32cf12b99360acc04b403dc5d550d05
diff --git a/src/ftscroller.js b/src/ftscroller.js index <HASH>..<HASH> 100755 --- a/src/ftscroller.js +++ b/src/ftscroller.js @@ -558,6 +558,10 @@ var FTScroller, CubicBezier; // If an animation is in progress, stop the scroll. if (triggerScrollInterrupt) { _interruptScroll(); + } else { + + // Allow clicks again, but only if a scroll was not interrupted + _preventClick = false; } // Store the initial event coordinates @@ -571,9 +575,6 @@ var FTScroller, CubicBezier; _eventHistory.length = 0; _eventHistory.push({ x: inputX, y: inputY, t: inputTime }); - // Allow clicks again - _preventClick = false; - if (triggerScrollInterrupt) { _updateScroll(inputX, inputY, inputTime, rawEvent, triggerScrollInterrupt); }
When a touch starts, only allow clicks to go through if the touch wasn't started to interrupt a scroll
ftlabs_ftscroller
train
js
d1abf041261dea8bb0dbb4a3541ef479f384b5a8
diff --git a/hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheDataRecord.java b/hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheDataRecord.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheDataRecord.java +++ b/hazelcast/src/main/java/com/hazelcast/cache/impl/record/CacheDataRecord.java @@ -23,7 +23,7 @@ import com.hazelcast.nio.serialization.Data; import java.io.IOException; /** - * Implementation of {@link com.hazelcast.cache.impl.record.CacheRecord} where value has internal serialized format + * Implementation of {@link com.hazelcast.cache.impl.record.CacheRecord} where value has an internal serialized format. */ class CacheDataRecord extends AbstractCacheRecord<Data> {
Improved JavaDocs for cache.impl.record reviewed.
hazelcast_hazelcast
train
java
2dc58bfe93a067f8789d64fbda705464268ae8d8
diff --git a/lib/rturk/operations/grant_bonus.rb b/lib/rturk/operations/grant_bonus.rb index <HASH>..<HASH> 100644 --- a/lib/rturk/operations/grant_bonus.rb +++ b/lib/rturk/operations/grant_bonus.rb @@ -12,9 +12,10 @@ module RTurk def to_params {'AssignmentId' => self.assignment_id, - 'BonusAmount.1.Amount' => self.amount, - 'BonusAmount.1.CurrencyCode' => (self.currency || 'USD'), - 'RequesterFeedback' => self.feedback} + 'BonusAmount.1.Amount' => self.amount, + 'BonusAmount.1.CurrencyCode' => (self.currency || 'USD'), + 'Reason' => self.feedback, + 'WorkerId' => worker_id} end end
fixed grant_bonus to current mturk api spec
ryantate_rturk
train
rb
f1e3ba74abf39791f0dc9b7e0c6492b40685e1d8
diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index <HASH>..<HASH> 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -659,15 +659,18 @@ class PlatformRepository extends ArrayRepository /** * @param string $name - * @param string $prettyVersion + * @param string|null $prettyVersion * @param string|null $description * @param string[] $replaces * @param string[] $provides * * @return void */ - private function addLibrary(string $name, string $prettyVersion, ?string $description = null, array $replaces = array(), array $provides = array()): void + private function addLibrary(string $name, ?string $prettyVersion, ?string $description = null, array $replaces = array(), array $provides = array()): void { + if (null === $prettyVersion) { + return; + } try { $version = $this->versionParser->normalize($prettyVersion); } catch (\UnexpectedValueException $e) {
Allow passing null to $prettyVersion to handle gracefully cases where a version could not be parsed upstream, refs #<I>
composer_composer
train
php
eb5d4b060fff2984a8d78d179903d6847a50d38d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -104,7 +104,6 @@ module.exports = class Elasticsearch extends Transport { if (entry.indexInterfix !== undefined) { index = this.getIndexName(this.opts, entry.indexInterfix); delete entry.indexInterfix; - console.log(entry); } this.bulkWriter.append( index,
added possibility to use a function for the indexPrefix option to enable to log to multiple indices within one transport
vanthome_winston-elasticsearch
train
js
b2341d86f84a29aeda5499fb07774ca9d0ca32c9
diff --git a/src/Assetic/Filter/Sass/SassFilter.php b/src/Assetic/Filter/Sass/SassFilter.php index <HASH>..<HASH> 100644 --- a/src/Assetic/Filter/Sass/SassFilter.php +++ b/src/Assetic/Filter/Sass/SassFilter.php @@ -36,7 +36,6 @@ class SassFilter extends BaseSassFilter private $debugInfo; private $lineNumbers; private $sourceMap; - private $loadPaths = array(); private $cacheLocation; private $noCache; private $compass; @@ -83,16 +82,6 @@ class SassFilter extends BaseSassFilter $this->sourceMap = $sourceMap; } - public function setLoadPaths(array $loadPaths) - { - $this->loadPaths = $loadPaths; - } - - public function addLoadPath($loadPath) - { - $this->loadPaths[] = $loadPath; - } - public function setCacheLocation($cacheLocation) { $this->cacheLocation = $cacheLocation;
Fix Sass load path Throws "Fatal error: Access level to Assetic\Filter\Sass\SassFilter::$loadPaths must be protected (as in class Assetic\Filter\Sass\BaseSassFilter) or weaker" Since it’s already available thorugh "BaseSassFilter", we don’t need it here.
kriswallsmith_assetic
train
php
04fa1dd34eeb91b8f1e38911a08db1baa5dcef83
diff --git a/src/main/java/com/box/sdk/BoxAPIConnection.java b/src/main/java/com/box/sdk/BoxAPIConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/box/sdk/BoxAPIConnection.java +++ b/src/main/java/com/box/sdk/BoxAPIConnection.java @@ -83,7 +83,7 @@ public class BoxAPIConnection { this.autoRefresh = true; this.maxRequestAttempts = DEFAULT_MAX_ATTEMPTS; this.refreshLock = new ReentrantReadWriteLock(); - this.userAgent = "Box Java SDK v2.1.0"; + this.userAgent = "Box Java SDK v2.1.1"; this.listeners = new ArrayList<BoxAPIConnectionListener>(); }
bumped version number to reflect bug fix
box_box-java-sdk
train
java
b67b7eaed9c0f1c4e00c9d6548b03c5cfe547645
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -2,10 +2,7 @@ from __future__ import absolute_import import codecs -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: readme = f.read()
Remove unnecessary distutils fallback from setup.py Modern Python environment have setuptools. Can rely that it exists.
mingchen_django-cas-ng
train
py
0b71c7d1f00f6b88e83e4d6b95172c0c5b084d03
diff --git a/tests/benchmark_accuracy_real_data.py b/tests/benchmark_accuracy_real_data.py index <HASH>..<HASH> 100755 --- a/tests/benchmark_accuracy_real_data.py +++ b/tests/benchmark_accuracy_real_data.py @@ -23,7 +23,8 @@ import scrubadub from scrubadub.comparison import get_filth_classification_report, KnownFilthItem, get_filth_dataframe from scrubadub.filth.base import Filth -IGNORE_CASE_IN_KNOWN_FILTH_TYPES = ('email', 'address', 'organization', 'phone', 'postalcode', 'url') +IGNORE_CASE_IN_KNOWN_FILTH_TYPES = ('email', 'address', 'organization', 'phone', 'postalcode', 'url', 'name', 'vehicle_licence_plate') +# IGNORE_CASE_IN_KNOWN_FILTH_TYPES = tuple() def get_blob_service(connection_string: Optional[str] = None) -> azure.storage.blob.BlobServiceClient:
expand types of filth where case is ignored
datascopeanalytics_scrubadub
train
py
ab6a163ff2f6d85af441de1d0fa055353a985bd3
diff --git a/builder/virtualbox/common/driver_mock.go b/builder/virtualbox/common/driver_mock.go index <HASH>..<HASH> 100644 --- a/builder/virtualbox/common/driver_mock.go +++ b/builder/virtualbox/common/driver_mock.go @@ -186,4 +186,4 @@ func (d *DriverMock) DeleteSnapshot(string vmName, *VBoxSnapshot snapshot) error } d.DeleteSnapshotCalled = append(d.DeleteSnapshotCalled, snapshot) return nil -} \ No newline at end of file +}
Added missing newline at end of builder\virtualbox\common\driver_mock.go
hashicorp_packer
train
go