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
6e41edb90f1b831d474fa53cae14dbd6f194c33f
diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index <HASH>..<HASH> 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -6,7 +6,7 @@ import { Position } from "../util/location"; import { types as ct, type TokContext } from "./context"; import type { Token } from "./index"; -import { types as tt, type TokenType } from "./types"; +import { types as tt, type TokenType, type TopicContextState } from "./types"; export default class State { init(options: Options, input: string): void { @@ -36,7 +36,7 @@ export default class State { // Used by smartPipelines. this.topicContext = { maxNumOfResolvableTopics: 0, - maxTopicIndex: undefined, + maxTopicIndex: null, }; this.classLevel = 0; @@ -118,7 +118,7 @@ export default class State { isIterator: boolean; // For the smartPipelines plugin: - topicContextState: tt.TopicContextState; + topicContext: TopicContextState; // Check whether we are in a (nested) class or not. classLevel: number;
Fix TopicContextState type in Flow
babel_babel
train
js
6380b7156968d2517868e6e8a7b447ba3e9542de
diff --git a/app/jobs/sendgrid_notification/sendmail_job.rb b/app/jobs/sendgrid_notification/sendmail_job.rb index <HASH>..<HASH> 100644 --- a/app/jobs/sendgrid_notification/sendmail_job.rb +++ b/app/jobs/sendgrid_notification/sendmail_job.rb @@ -1,11 +1,11 @@ module SendgridNotification - class SendmailJob < ActiveJob::Base + class SendmailJob < ApplicationJob queue_as :sendmail MailerClass = Rails.application.config.sendgrid_notification.mailer.constantize def perform(to, notification_mail, params) - MailerClass.new.sendmail(to, notification_mail, params) + MailerClass.new(params).sendmail(to, notification_mail, params) end end end
Modify SendmailJob to set mail_from, mail_from_name
holysugar_sendgrid_notification
train
rb
8293add46f7d6c38c47e4853fb841215c3e235fe
diff --git a/report/metrics/jira.py b/report/metrics/jira.py index <HASH>..<HASH> 100644 --- a/report/metrics/jira.py +++ b/report/metrics/jira.py @@ -88,7 +88,7 @@ class Closed(JiraMetrics): name = "Closed tickets" desc = "Number of closed tickets" # filters = {"status":["Closed", "Resolved", "Done"]} - filters = {"status":"Closed"} + filters = {"*status": "Open"} FIELD_COUNT="key" FIELD_NAME="url"
[jira] Find the ticket closed as the ones which are not Open Use as filter: filters = {"*status": "Open"}
chaoss_grimoirelab-manuscripts
train
py
0ecbb12444794eaa9c62e51f7146871429ce6c6c
diff --git a/glances/plugins/glances_wifi.py b/glances/plugins/glances_wifi.py index <HASH>..<HASH> 100644 --- a/glances/plugins/glances_wifi.py +++ b/glances/plugins/glances_wifi.py @@ -39,7 +39,7 @@ else: # Python 3 is not supported (see issue #1377) if PY3: - import_error_tag = False + import_error_tag = True logger.warning("Wifi lib is not compliant with Python 3, Wifi plugin is disabled")
Correct an issue with unitest on Python 3.x
nicolargo_glances
train
py
23f36ac1642fc8e2720edb4be45d0841c448dc86
diff --git a/lib/chef_server/init.rb b/lib/chef_server/init.rb index <HASH>..<HASH> 100644 --- a/lib/chef_server/init.rb +++ b/lib/chef_server/init.rb @@ -156,7 +156,7 @@ Merb::Config.use do |c| c[:exception_details] = true c[:reload_classes] = true c[:log_level] = :debug - c[:log_file] = STDOUT + c[:log_file] = "/var/log/chef-server.log" end Merb.logger.info("Compiling routes...")
Lets log to /var/log, shall we?
chef_chef
train
rb
9da371f76a09ffe264d6a565ecf55ca658fc4406
diff --git a/macroeco/models/_distributions.py b/macroeco/models/_distributions.py index <HASH>..<HASH> 100644 --- a/macroeco/models/_distributions.py +++ b/macroeco/models/_distributions.py @@ -206,6 +206,22 @@ class rv_discrete_meco(rv_discrete): """{0}""" return self.ppf((np.arange(1, n+1) - 0.5) / n, *args) + @doc_sub(_doc_rvs_alt) + def rvs_alt(self, *args, **kwargs): + """{0}""" + l = kwargs.get('l', 1) + b = kwargs.get('b', 1e5) + size = kwargs.get('size', 1) + + model_cdf = self.cdf(np.arange(l, b + 1), *args) + + unif_rands = np.random.random(size) + model_rands = np.array([np.where(tx <= model_cdf)[0][0] + l + for tx in unif_rands]) + + return model_rands + + # # Discrete #
Added alternative way to compute random variables
jkitzes_macroeco
train
py
253487d01260fc2d58d406696cf974c309ccb075
diff --git a/dom/test/browser/render.js b/dom/test/browser/render.js index <HASH>..<HASH> 100644 --- a/dom/test/browser/render.js +++ b/dom/test/browser/render.js @@ -486,6 +486,30 @@ describe('Rendering', function () { }); }); + it('should add a className to a vtree sink that had no className', function (done) { + function app(sources) { + let vtree$ = Rx.Observable.just(h3()); + return { + DOM: sources.DOM.isolateSink(vtree$, 'foo'), + }; + } + let {sinks, sources} = Cycle.run(app, { + DOM: makeDOMDriver(createRenderTarget()) + }); + // Make assertions + sources.DOM.select(':root').observable.skip(1).take(1) + .subscribe(function (root) { + let element = root.querySelector('h3'); + assert.notStrictEqual(element, null); + assert.notStrictEqual(typeof element, 'undefined'); + assert.strictEqual(element.tagName, 'H3'); + assert.strictEqual(element.className, 'cycle-scope-foo'); + sources.dispose(); + done(); + }); + }); + + it('should prevent parent from DOM.selecting() inside the isolation', function (done) { function app(sources) { return {
Add test for PR #<I> (isolateSink on vtree with no className)
cyclejs_cyclejs
train
js
3bba9a96a07e4edd81b7f39d165b2dba43bf570c
diff --git a/devices/ikea.js b/devices/ikea.js index <HASH>..<HASH> 100644 --- a/devices/ikea.js +++ b/devices/ikea.js @@ -148,12 +148,19 @@ module.exports = [ }, { zigbeeModel: ['TRADFRIbulbE27WWclear250lm'], - model: 'LED1934G3', + model: 'LED1934G3_E27', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 WW clear 250 lumen, dimmable', extend: tradfriExtend.light_onoff_brightness(), }, { + zigbeeModel: ['TRADFRIbulbE26WWclear250lm'], + model: 'LED1934G3_E26', + vendor: 'IKEA', + description: 'LED bulb E26 250 lumen, wireless dimmable warm white/globe clear', + extend: tradfriExtend.light_onoff_brightness(), + }, + { zigbeeModel: ['TRADFRI bulb E14 WS opal 600lm'], model: 'LED1733G7', vendor: 'IKEA',
Add LED<I>G3_E<I> (#<I>) * Add support for E<I> version of LED<I>G3 Based on original LED<I>G3 * Update ikea.js
Koenkk_zigbee-shepherd-converters
train
js
6080837a9bebb90221ab2fa6f1b38bc4e84c6cca
diff --git a/client/extensions/woocommerce/app/settings/payments/payments-location-currency.js b/client/extensions/woocommerce/app/settings/payments/payments-location-currency.js index <HASH>..<HASH> 100644 --- a/client/extensions/woocommerce/app/settings/payments/payments-location-currency.js +++ b/client/extensions/woocommerce/app/settings/payments/payments-location-currency.js @@ -78,7 +78,7 @@ class SettingsPaymentsLocationCurrency extends Component { <option key={ option.code } value={ option.code } > - { decodeEntities( option.symbol ) } - { option.name } + { decodeEntities( option.symbol ) } - { decodeEntities( option.name ) } </option> ); }
Fixes encoding on currency name (#<I>)
Automattic_wp-calypso
train
js
ee465fe156e11168e9478ddbc8c914ec21233bdc
diff --git a/asketch2sketch/asketch2sketch.js b/asketch2sketch/asketch2sketch.js index <HASH>..<HASH> 100644 --- a/asketch2sketch/asketch2sketch.js +++ b/asketch2sketch/asketch2sketch.js @@ -89,14 +89,14 @@ function addSharedTextStyle(document, style) { function removeSharedColors(document) { const assets = document.documentData().assets(); - assets.removeAllColors(); + assets.removeAllColorAssets(); } function addSharedColor(document, colorJSON) { const assets = document.documentData().assets(); const color = fromSJSONDictionary(colorJSON); - assets.addColor(color); + assets.addColorAsset(color); } export default function asketch2sketch(context, asketchFiles) {
Adjustments in handling colors (#<I>)
brainly_html-sketchapp
train
js
0aceecbcc1cfbd9b57a9b3246faea122900d11fe
diff --git a/lib/table.js b/lib/table.js index <HASH>..<HASH> 100644 --- a/lib/table.js +++ b/lib/table.js @@ -195,7 +195,7 @@ Table.prototype.subQuery = function(alias) { Table.prototype.insert = function() { var query = new Query(this); - if(arguments[0].length == 0){ + if(arguments[0].length === 0){ query.select.call(query, this.star()); query.where.apply(query,["1=2"]); } else {
jshint: Use '===' to compare with '0'
brianc_node-sql
train
js
ce7ea562fbb1f76f9090588d40cb79975c84f37f
diff --git a/yargy/parser.py b/yargy/parser.py index <HASH>..<HASH> 100644 --- a/yargy/parser.py +++ b/yargy/parser.py @@ -143,8 +143,9 @@ class Grammar(object): optional = rule.get('optional', False) terminal = rule.get('terminal', False) skip = rule.get('skip', False) + labels = rule.get('labels', []) - if not all(self.match(token, rule)) and not terminal: + if not all(self.match(token, labels)) and not terminal: last_index = self.index recheck = False if optional or (repeatable and self.stack.have_matches_by_rule_index(self.index)): @@ -213,9 +214,9 @@ class Grammar(object): self.stack = Stack() self.index = 0 - def match(self, token, rule): + def match(self, token, labels): stack = self.stack.flatten() - for label in rule.get('labels', []): + for label in labels: yield label(token, stack) def __copy__(self):
Pass labels to parser match method instead of complete rule
natasha_yargy
train
py
5a3868ed91b4dba6f0613882e417627695603683
diff --git a/src/components/buttons/buttons.js b/src/components/buttons/buttons.js index <HASH>..<HASH> 100644 --- a/src/components/buttons/buttons.js +++ b/src/components/buttons/buttons.js @@ -75,10 +75,11 @@ function MaterialButtonDirective(ngHrefDirectives, $expectAria) { innerElement .addClass('material-button-inner') - .append(element.contents()) - .append('<material-ripple start="center" initial-opacity="0.25" opacity-decay-velocity="0.75"></material-ripple>'); + .append(element.contents()); - element.append(innerElement); + element + .append(innerElement) + .append('<material-ripple start="center" initial-opacity="0.25" opacity-decay-velocity="0.75"></material-ripple>'); return function postLink(scope, element, attr) { $expectAria(element, 'aria-label', element.text());
refactor(buttons): put material-ripple outside inner-button
angular_material
train
js
063de46dec3ebea05847b869bd1c5645e03fb54c
diff --git a/tests/test_run.py b/tests/test_run.py index <HASH>..<HASH> 100755 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -19,7 +19,7 @@ from msaf.input_output import FileStruct # Global vars audio_file = os.path.join("data", "chirp.mp3") -long_audio_file = os.path.join("..", "examples", "Sargon", "audio", +long_audio_file = os.path.join("..", "datasets", "Sargon", "audio", "01-Sargon-Mindless.mp3") fake_module_name = "fake_caca_name_module"
Updated unit tests to read from the new datasets folder Former-commit-id: 3f<I>a<I>bf<I>cf<I>ec4d<I>d<I>e4e<I>c Former-commit-id: <I>a6fb<I>c<I>f<I>ad<I>beb2eb5d<I>a<I>
urinieto_msaf
train
py
f5703dcf9328a977710728321184422fc2668fd6
diff --git a/lib/hz2600/Kazoo/Api/Collection/VMBoxes.php b/lib/hz2600/Kazoo/Api/Collection/VMBoxes.php index <HASH>..<HASH> 100644 --- a/lib/hz2600/Kazoo/Api/Collection/VMBoxes.php +++ b/lib/hz2600/Kazoo/Api/Collection/VMBoxes.php @@ -4,5 +4,9 @@ namespace Kazoo\Api\Collection; class VMBoxes extends AbstractCollection { - + public function messages() { + $response = $this->get(array(), '/messages'); + $this->setCollection($response->getData()); + return $this; + } }
Update VMBoxes.php (#<I>)
2600hz_kazoo-php-sdk
train
php
5d859cb6ccb268205de1205af5d5f0b9a9f8b766
diff --git a/plugins/CoreVisualizations/javascripts/jqplot.js b/plugins/CoreVisualizations/javascripts/jqplot.js index <HASH>..<HASH> 100644 --- a/plugins/CoreVisualizations/javascripts/jqplot.js +++ b/plugins/CoreVisualizations/javascripts/jqplot.js @@ -125,7 +125,7 @@ $.each(series, function(index, value) { if ($.isArray(value) && value[1]) { sum = sum + value[1]; - } else { + } else if (!$.isArray(value)) { sum = sum + value; } });
fixes #<I> fixes percentages in chart tooltips are sometimes 0% although they should not. Happened when there was a value 0 in value[1] meaning there was no data for one of the points. In such a case sum was the value of the concatenated array such as "0-5:3,5-<I>:<I>,...
matomo-org_matomo
train
js
89f19cc86de3636a2fbf84950260856f8288797c
diff --git a/lib/client_includes.js b/lib/client_includes.js index <HASH>..<HASH> 100644 --- a/lib/client_includes.js +++ b/lib/client_includes.js @@ -42,9 +42,7 @@ app.get('/nodecg-api.js', function(req, res) { if (browserifiedBuf) { res.send(browserifiedBuf); } else { - console.log('waiting for pipe'); promise.then(function() { - console.log('done piping'); res.send(browserifiedBuf); }); }
[client_includes] remove leftover debug prints [ci skip]
nodecg_nodecg
train
js
7368ff53af6b4bcb151ac2c2a3e75176bfc9309a
diff --git a/src/MetaModels/ItemList.php b/src/MetaModels/ItemList.php index <HASH>..<HASH> 100644 --- a/src/MetaModels/ItemList.php +++ b/src/MetaModels/ItemList.php @@ -19,6 +19,7 @@ * @author Stefan Heimes <[email protected]> * @author Tim Gatzky <[email protected]> * @author Martin Treml <[email protected]> + * @author Jeremie Constant <[email protected]> * @copyright 2012-2015 The MetaModels team. * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0 * @filesource @@ -772,7 +773,12 @@ class ItemList implements IServiceContainerAware $arrDescription = $objCurrentItem->parseAttribute($this->strDescriptionAttribute, 'text'); if (!empty($arrDescription['text'])) { - $page->description = \String::substr($arrDescription['text'], 120); + // PHP 7 compatibility, see https://github.com/contao/core-bundle/issues/309 + if (version_compare(VERSION . '.' . BUILD, '3.5.5', '>=')) { + $page->description = \StringUtil::substr($arrDescription['text'], 160); + } else { + $page->description = \String::substr($arrDescription['text'], 160); + } break; } }
#<I> #<I> Increase length of Meta-Description + PHP7 compatibility Google shows <I> characters, but metamodels are only rendering out <I>.
MetaModels_core
train
php
6ec604f150023e93859af90dff08dba6dc624f79
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index <HASH>..<HASH> 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -159,7 +159,7 @@ class Chef # Thrown when Win32 API layer binds to non-existent Win32 function. Occurs # when older versions of Windows don't support newer Win32 API functions. - class Win32APIFunctionNotImplemented < RuntimeError; end + class Win32APIFunctionNotImplemented < NotImplementedError; end # rubocop:disable Lint/InheritException # Attempting to run windows code on a not-windows node class Win32NotWindows < RuntimeError; end class WindowsNotAdmin < RuntimeError; end
seems this exception type is necessary as well
chef_chef
train
rb
aa562bca60e74eb0bc0a1e03114958b8ed9d68a4
diff --git a/common/lib/common/agent/mapper_proxy.rb b/common/lib/common/agent/mapper_proxy.rb index <HASH>..<HASH> 100644 --- a/common/lib/common/agent/mapper_proxy.rb +++ b/common/lib/common/agent/mapper_proxy.rb @@ -241,7 +241,7 @@ module RightScale request.token = AgentIdentity.generate @pending_requests[parent][:retry_parent] = parent if count == 1 @pending_requests[request.token] = @pending_requests[parent] - request_with_retry(request, parent, count, multiplier * 2, elapsed) + request_with_retry(request, parent, count, multiplier * 4, elapsed) else RightLinkLog.warn("RE-SEND TIMEOUT after #{elapsed} seconds for #{request.to_s([:tags, :target, :tries])}") result = OperationResult.timeout("Timeout after #{elapsed} seconds and #{count} attempts")
Reduce frequency of retries in agents
rightscale_right_link
train
rb
2c0e9ce8e68cc510f9ece996f98d01b99030e9bd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,10 @@ """Setup module for the duallog package This module configures setuptools so that it can create a distribution for the -duallog package. +package. """ -# Import required system libraries. +# Import required standard libraries. import io import os import setuptools @@ -18,7 +18,7 @@ with io.open(os.path.join(maindir, 'README.md'), encoding='utf-8') as file: # Configure setuptools. setuptools.setup(name='duallog', - version='0.13', + version='0.14', description='Parallel logging to console and logfile', long_description=readme, long_description_content_type='text/markdown',
Cosmetic changes to setup.py.
acschaefer_duallog
train
py
891a518d8485a0574b9fd3feb510e367456352a8
diff --git a/src/samples/java/ex/COM_Sample.java b/src/samples/java/ex/COM_Sample.java index <HASH>..<HASH> 100755 --- a/src/samples/java/ex/COM_Sample.java +++ b/src/samples/java/ex/COM_Sample.java @@ -1,4 +1,5 @@ package ex; + import java.util.HashSet; import java.util.Set; @@ -12,7 +13,7 @@ public class COM_Sample { } public Set<String> test3(String a, String b, String c) { - Set<String> ss = new HashSet<String>(); + Set<String> ss = new HashSet<>(); ss.add(a); ss.add(b); ss.add(c); @@ -33,7 +34,7 @@ public class COM_Sample { @Override public Set<String> test3(String a, String b, String c) { - Set<String> ss = new HashSet<String>(); + Set<String> ss = new HashSet<>(); ss.add(a); ss.add(b); ss.add(c); @@ -90,3 +91,16 @@ abstract class s2 extends s1 { return FOO; } } + +class NonSync { + public int foo() { + return 42; + } +} + +class Sync extends NonSync { + @Override + public synchronized int foo() { + return super.foo(); + } +}
Add COM fp as shown in issue #<I>
mebigfatguy_fb-contrib
train
java
637531ea57ced607701606743d52f053632796bb
diff --git a/src/CommonFactory.php b/src/CommonFactory.php index <HASH>..<HASH> 100644 --- a/src/CommonFactory.php +++ b/src/CommonFactory.php @@ -277,7 +277,7 @@ class CommonFactory implements Factory, DomainEventFactory, CommandFactory */ public function createProductJsonSnippetKeyGenerator() { - $usedDataParts = ['product_id']; + $usedDataParts = [Product::ID]; return new GenericSnippetKeyGenerator( ProductJsonSnippetRenderer::CODE,
Issue #<I>: Replace string literal with Product::ID constant
lizards-and-pumpkins_catalog
train
php
047537833d69654356cc901ca885896cea9578d8
diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go index <HASH>..<HASH> 100644 --- a/agent/consul/leader_connect_ca.go +++ b/agent/consul/leader_connect_ca.go @@ -278,8 +278,11 @@ func (c *CAManager) Stop() { needsStop.Stop() } } - c.setCAProvider(nil, nil) + c.setState(caStateUninitialized, false) + c.primaryRoots = structs.IndexedCARoots{} + c.actingSecondaryCA = false + c.setCAProvider(nil, nil) } func (c *CAManager) startPostInitializeRoutines(ctx context.Context) {
add missing state reset when stopping ca manager
hashicorp_consul
train
go
eb1dfb8cbe4300ea3f29cb5bb1d937faeb332af7
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java index <HASH>..<HASH> 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java @@ -98,7 +98,7 @@ public interface TraversalSource extends Cloneable, AutoCloseable { /** * Add an arbitrary collection of {@link TraversalStrategy} instances to the traversal source. * - * @param traversalStrategies a colleciton of traversal strategies to add + * @param traversalStrategies a collection of traversal strategies to add * @return a new traversal source with updated strategies */ public default TraversalSource withStrategies(final TraversalStrategy... traversalStrategies) {
Fixed spelling mistake in javadoc CTR
apache_tinkerpop
train
java
09246eb179ceb4202c5f404179088db0056e8370
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -43,5 +43,4 @@ if(!defined('PIWIK_PRINT_ERROR_BACKTRACE')) { define('PIWIK_PRINT_ERROR_BACKTRACE', false); } -require_once PIWIK_INCLUDE_PATH . '/core/dispatch.php'; - // TODO: check every folder in libs/ for autoload crap (maybe move to composr?) \ No newline at end of file +require_once PIWIK_INCLUDE_PATH . '/core/dispatch.php'; \ No newline at end of file
Remove TODO from index.php.
matomo-org_matomo
train
php
41d03bd08b3e264e4b7f85f114df9cb520603a71
diff --git a/core/server/api/canary/settings.js b/core/server/api/canary/settings.js index <HASH>..<HASH> 100644 --- a/core/server/api/canary/settings.js +++ b/core/server/api/canary/settings.js @@ -2,13 +2,18 @@ const Promise = require('bluebird'); const _ = require('lodash'); const models = require('../../models'); const routeSettings = require('../../services/route-settings'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const {BadRequestError} = require('@tryghost/errors'); const settingsService = require('../../services/settings'); const membersService = require('../../services/members'); const settingsBREADService = settingsService.getSettingsBREADServiceInstance(); +const messages = { + failedSendingEmail: 'Failed Sending Email' + +}; + module.exports = { docName: 'settings', @@ -109,7 +114,7 @@ module.exports = { } catch (err) { throw new BadRequestError({ err, - message: i18n.t('errors.mail.failedSendingEmail.error') + message: tpl(messages.failedSendingEmail) }); } }
replaced i<I>n with tpl (#<I>) refs: #<I> - The i<I>n package is deprecated. It is being replaced with the tpl package.
TryGhost_Ghost
train
js
f5f8e84da13c621370d4a3f2e3e5ba854f3cb9de
diff --git a/fmn/lib/defaults.py b/fmn/lib/defaults.py index <HASH>..<HASH> 100644 --- a/fmn/lib/defaults.py +++ b/fmn/lib/defaults.py @@ -272,6 +272,12 @@ exclusion_mutual = [ #'compose_rawhide_rsync_complete', #'compose_branched_rsync_start', #'compose_rawhide_rsync_start', + + # Go ahead and ignore all summershum messages by default too. @jwboyer + # complained rightly https://github.com/fedora-infra/fmn/issues/27 + 'summershum_ingest_start', + 'summershum_ingest_complete', + 'summershum_ingest_fail', ]
Ignore summershum messages by default as per fedora-infra/fmn.rules#<I>.
fedora-infra_fmn.lib
train
py
10b5c94f239f8d13e9efd0a95fd4cdf1dd66ae0b
diff --git a/salt/states/archive.py b/salt/states/archive.py index <HASH>..<HASH> 100644 --- a/salt/states/archive.py +++ b/salt/states/archive.py @@ -67,6 +67,7 @@ def extracted(name, source, archive_format, archive_user=None, + password=None, user=None, group=None, tar_options=None, @@ -135,6 +136,10 @@ def extracted(name, name Directory name where to extract the archive + password + Password to use with password protected zip files. Currently only zip + files with passwords are supported. + source Archive source, same syntax as file.managed source argument. @@ -273,7 +278,7 @@ def extracted(name, log.debug('Extract {0} in {1}'.format(filename, name)) if archive_format == 'zip': - files = __salt__['archive.unzip'](filename, name, options=zip_options, trim_output=trim_output) + files = __salt__['archive.unzip'](filename, name, options=zip_options, trim_output=trim_output, password=password) elif archive_format == 'rar': files = __salt__['archive.unrar'](filename, name, trim_output=trim_output) else:
add zip passwords to archive.extracted
saltstack_salt
train
py
3548b821cc46ce92f6049cc61740fd112d1e4928
diff --git a/lib/haml/template/options.rb b/lib/haml/template/options.rb index <HASH>..<HASH> 100644 --- a/lib/haml/template/options.rb +++ b/lib/haml/template/options.rb @@ -8,7 +8,7 @@ module Haml @options = {} # The options hash for Haml when used within Rails. - # See {file:REFERENCE.md#haml_options the Haml options documentation}. + # See {file:REFERENCE.md#options the Haml options documentation}. # # @return [{Symbol => Object}] attr_accessor :options
Fix link in documentation (cherry picked from commit 3b<I>d<I>cf<I>eb<I>a6d<I>a3b<I>e<I>b0f<I>)
haml_haml
train
rb
9d2303a21710703b9283f93a8bc0d94e226572c5
diff --git a/internal/services/datafactory/validate/datafactory.go b/internal/services/datafactory/validate/datafactory.go index <HASH>..<HASH> 100644 --- a/internal/services/datafactory/validate/datafactory.go +++ b/internal/services/datafactory/validate/datafactory.go @@ -37,8 +37,8 @@ func DataFactoryManagedPrivateEndpointName() pluginsdk.SchemaValidateFunc { return } - if !regexp.MustCompile(`^[A-Za-z0-9_]+$`).MatchString(v) { - errors = append(errors, fmt.Errorf("invalid Data Factory Managed Private Endpoint name, must match the regular expression ^[A-Za-z0-9_]+")) + if !regexp.MustCompile(`^([_A-Za-z0-9]|([_A-Za-z0-9][-_A-Za-z0-9]{0,125}[_A-Za-z0-9]))$`).MatchString(v) { + errors = append(errors, fmt.Errorf("invalid Data Factory Managed Private Endpoint name, must match the regular expression ^([_A-Za-z0-9]|([_A-Za-z0-9][-_A-Za-z0-9]{0,125}[_A-Za-z0-9]))$")) } return warnings, errors
Add support for `-` in `azurerm_data_factory_managed_private_endpoint` (#<I>)
terraform-providers_terraform-provider-azurerm
train
go
4113e0c14503be4707ee7534e44fcd320f582cb1
diff --git a/spyderlib/utils/inspector/conf.py b/spyderlib/utils/inspector/conf.py index <HASH>..<HASH> 100644 --- a/spyderlib/utils/inspector/conf.py +++ b/spyderlib/utils/inspector/conf.py @@ -167,4 +167,4 @@ def setup(app): app.connect('autodoc-process-docstring', process_docstring_cython) app.connect('autodoc-process-docstring', process_directives) app.connect('autodoc-process-docstring', process_docstring_module_title) - \ No newline at end of file +
Object Inspector: Remove indented line at the end of conf.py It was giving an error for certain users
spyder-ide_spyder
train
py
68ad109cd18197f8e515954457309efad8b0b39e
diff --git a/bids/grabbids/bids_validator.py b/bids/grabbids/bids_validator.py index <HASH>..<HASH> 100644 --- a/bids/grabbids/bids_validator.py +++ b/bids/grabbids/bids_validator.py @@ -11,8 +11,8 @@ class BIDSValidator(): Parameters ---------- index_associated : bool, default: True - Specifies if an associated data should be checked. If it is true then any file paths in directories `code/`, - `derivatives/`, `sourcedata/`, `stimuli/` and `.git/` will pass the validation, else they won't. + Specifies if an associated data should be checked. If it is true then any file paths in directories `code/`, + `derivatives/`, `sourcedata/` and `stimuli/` will pass the validation, else they won't. Examples --------
modified docstring for assocaited data -- removed .git
bids-standard_pybids
train
py
c14cd014c494386f669f3bb26c8d4a6ea3af6e67
diff --git a/android/guava/src/com/google/common/base/Splitter.java b/android/guava/src/com/google/common/base/Splitter.java index <HASH>..<HASH> 100644 --- a/android/guava/src/com/google/common/base/Splitter.java +++ b/android/guava/src/com/google/common/base/Splitter.java @@ -370,7 +370,7 @@ public final class Splitter { * use {@link #splitToList(CharSequence)}. * * @param sequence the sequence of characters to split - * @return an iteration over the segments split from the parameter. + * @return an iteration over the segments split from the parameter */ public Iterable<String> split(final CharSequence sequence) { checkNotNull(sequence); diff --git a/guava/src/com/google/common/base/Splitter.java b/guava/src/com/google/common/base/Splitter.java index <HASH>..<HASH> 100644 --- a/guava/src/com/google/common/base/Splitter.java +++ b/guava/src/com/google/common/base/Splitter.java @@ -370,7 +370,7 @@ public final class Splitter { * use {@link #splitToList(CharSequence)}. * * @param sequence the sequence of characters to split - * @return an iteration over the segments split from the parameter. + * @return an iteration over the segments split from the parameter */ public Iterable<String> split(final CharSequence sequence) { checkNotNull(sequence);
Remove extra punctuation in single-sentence @return As per [] ------------- Created by MOE: <URL>
google_guava
train
java,java
e0f064140a9dff504c42acadd7469ba6da8b51ce
diff --git a/tst.py b/tst.py index <HASH>..<HASH> 100755 --- a/tst.py +++ b/tst.py @@ -171,7 +171,7 @@ class TestCase(unittest.TestCase): # the same as defined in Base. @dataclass class Base: - x: str = 'base' + x: float = 15.0 y: int = 0 @dataclass
Issue #<I>: Make test with fields overriden in a base class satisfy the Liskov Substitution Principle. There's no different functionality being used here, it's just clearer pedagogically.
ericvsmith_dataclasses
train
py
eb467ff9158e72d1effa8995710f710c54edde14
diff --git a/ui/admin/callouts/friends_2021_29.php b/ui/admin/callouts/friends_2021_29.php index <HASH>..<HASH> 100644 --- a/ui/admin/callouts/friends_2021_29.php +++ b/ui/admin/callouts/friends_2021_29.php @@ -39,7 +39,7 @@ $donate_now_link = add_query_arg( $campaign_args, $donate_now_link ); <h2 class="pods-admin_friends-callout_headline"> <?php printf( - esc_html__( 'We need %1$sYOU%2$s in 2021 and beyond', 'pods' ), + esc_html__( 'We need %1$sYOU%2$s', 'pods' ), '<span class="pods-admin_friends-you">', '</span>' ); @@ -51,7 +51,7 @@ $donate_now_link = add_query_arg( $campaign_args, $donate_now_link ); <?php printf( '%1$s: <a href="%2$s" target="_blank" rel="noreferrer">%3$s</a>', - esc_html__( 'Pods 2.8 is out now and we are building the next feature for Pods 2.9', 'pods' ), + esc_html__( 'Pods 2.8 is out and we are building the next feature for Pods 2.9', 'pods' ), esc_url( $feature_callout_link ), esc_html__( 'Simple Repeatable Fields', 'pods' ) );
Update callout title (omit year)
pods-framework_pods
train
php
0a08a302d10f440b4a77e47011338c1e4d58a61f
diff --git a/engine/test_engine.py b/engine/test_engine.py index <HASH>..<HASH> 100644 --- a/engine/test_engine.py +++ b/engine/test_engine.py @@ -1514,13 +1514,16 @@ class Test_Engine(unittest.TestCase): assert category.lower() in ['high', 'very high'] count += 1 + # FIXME: TODO msg = ('Expected 34 points tagged with category, ' 'but got only %i' % count) - assert count == 34, msg + assert count == 14, msg ##### y, but got only 14 - #print I_geometry[1123] - #print I_attributes[1123] - assert I_attributes[1123]['Catergory'] == 'Very High' + + print I_geometry[1123] + print I_attributes[1123] + # TODO + ##assert I_attributes[1123]['Catergory'] == 'Very High' def test_layer_integrity_raises_exception(self): """Layers without keywords raise exception
More work to update the tests for polygon clipping with segment joining
inasafe_inasafe
train
py
c1e16b5c55a3ea7ad036964176534d53021480e8
diff --git a/tinman.py b/tinman.py index <HASH>..<HASH> 100755 --- a/tinman.py +++ b/tinman.py @@ -60,7 +60,7 @@ class Application(tornado.web.Application): h = getattr(m,p[-1]) # Append our handle stack - logging.debug('Appending handler for "%s": %s.%s' % (config['RequestHandlers'][handler][0], s, p[len(p)-1:][0])) + logging.debug('Appending handler for "%s": %s.%s' % (config['RequestHandlers'][handler][0], s, p[-1])) handlers.append((config['RequestHandlers'][handler][0], h)) # Get the dictionary from our YAML file @@ -87,7 +87,7 @@ class Application(tornado.web.Application): logging.error('Import module name error') # Import the module, getting the file from the __dict__ - m = __import__(settings['ui_modules']).__dict__[p[1]] + m = __import__(settings['ui_modules'], fromlist=[p[1]]) # Assign the modules to the import settings['ui_modules'] = m
More __import__ and list slicing glitches fixed.
gmr_tinman
train
py
e1526171074c1ff2fe2c85632c8ae317715b9696
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,8 +11,8 @@ setup( version=__version__, author='Simo Linkola', author_email='[email protected]', - description=('A library for creative MAS build on top of aiomas.'), - long_description=('See https://creamas.readthedocs.io/'), + description='A library for creative MAS build on top of aiomas.', + long_description='See https://creamas.readthedocs.io/', url='https://creamas.readthedocs.io/', license='GNU General Public License v2 (GPLv2)', install_requires=[
Removed some redundant parentheses from setup.py
assamite_creamas
train
py
fb41189a33d7bc5775e2a6cfee4815a955938633
diff --git a/build_examples.py b/build_examples.py index <HASH>..<HASH> 100644 --- a/build_examples.py +++ b/build_examples.py @@ -2,7 +2,10 @@ import os import glob import shutil - -for filepath in glob.glob('examples/*/*.py'): +# Copy example files into current working directory +for filepath in glob.glob('examples/*/*'): filename = os.path.basename(filepath) - shutil.copyfile(filepath, 'test_'+filename) + if filepath.endswith('.py'): + shutil.copyfile(filepath, 'test_'+filename) # Prepend 'test' to *.py + else: + shutil.copyfile(filepath, filename)
Also copy non-python example files into work directory
mottosso_Qt.py
train
py
459290c88e8e5ba07fcfe2bece01c063fd2ab178
diff --git a/src/Illuminate/Console/Parser.php b/src/Illuminate/Console/Parser.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Console/Parser.php +++ b/src/Illuminate/Console/Parser.php @@ -56,7 +56,7 @@ class Parser if (!Str::startsWith($token, '--')) { $arguments[] = static::parseArgument($token); } else { - $options [] = static::parseOption(ltrim($token, '-')); + $options[] = static::parseOption(ltrim($token, '-')); } }
Fix typo in Parser.php
laravel_framework
train
php
8e9577170c4709707cef8eddcb17a6d84d99abc8
diff --git a/tests/conftest.py b/tests/conftest.py index <HASH>..<HASH> 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,15 +3,15 @@ import pytest def pytest_addoption(parser): parser.addoption( - "--no-slow", action="store_true", default=False, + "--skip-slow", action="store_true", default=False, help="skip any slow tests" ) def pytest_collection_modifyitems(config, items): - if config.getoption("--no-slow"): - # --noslow given in cli: skip slow tests - skip_slow = pytest.mark.skip(reason="need --noslow option to run") + if config.getoption("--skip-slow"): + # --skip-slow given in cli: skipping slow tests + skip_slow = pytest.mark.skip(reason="--skip-slow option was provided") for item in items: if "slow" in item.keywords: item.add_marker(skip_slow)
Renamed commandline option no-slow to skip-slow
openclimatedata_pymagicc
train
py
8799b5cb86ea6af2acfda44bf46f2c677f886b17
diff --git a/test/relay-kills-socket-after-timeouts.js b/test/relay-kills-socket-after-timeouts.js index <HASH>..<HASH> 100644 --- a/test/relay-kills-socket-after-timeouts.js +++ b/test/relay-kills-socket-after-timeouts.js @@ -143,6 +143,7 @@ allocCluster.test('send some requests to timed out peer through relay', { cassert = testContext.checkConnTimeoutLogs(); cassert.report(assert, 'the connection timeout logs are correct'); + cluster.logger.popLogs('stale tombstone'); assert.ok(cluster.logger.isEmpty(), 'should have no logs'); assert.end();
get rid of stale tombstone logs
uber_tchannel-node
train
js
6a9c847e0961e98ce569765f5b9c2dded628a78e
diff --git a/lib/arjdbc/db2/adapter.rb b/lib/arjdbc/db2/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/db2/adapter.rb +++ b/lib/arjdbc/db2/adapter.rb @@ -654,14 +654,14 @@ module ArJdbc def db2_schema @db2_schema = false unless defined? @db2_schema return @db2_schema if @db2_schema != false + schema = config[:schema] @db2_schema = - if config[:schema].present? - config[:schema] - elsif config[:jndi].present? + if schema then schema + elsif config[:jndi] || config[:data_source] nil # let JNDI worry about schema else # LUW implementation uses schema name of username by default - config[:username].presence || ENV['USER'] + config[:username] || ENV['USER'] end end @@ -681,4 +681,4 @@ module ActiveRecord::ConnectionAdapters include ::ArJdbc::DB2::Column end -end \ No newline at end of file +end
avoid AS present? usage - :schema/:username set to empty is for the user to fix + also correctly detect programatic JNDI configuration (config[:data_source] set)
jruby_activerecord-jdbc-adapter
train
rb
e3e3150399cec85b2df5a4e121fd617855fd9598
diff --git a/modules/ve/ce/ve.es.Surface.js b/modules/ve/ce/ve.es.Surface.js index <HASH>..<HASH> 100644 --- a/modules/ve/ce/ve.es.Surface.js +++ b/modules/ve/ce/ve.es.Surface.js @@ -38,10 +38,12 @@ ve.es.Surface = function( $container, model ) { console.log(_this.clipboard); - if (event.type == 'cut') { - var selection = _this.getSelection(); + if (event.type == 'cut') { setTimeout(function() { + document.execCommand('undo', false, false); + + var selection = _this.getSelection(); var tx = _this.model.getDocument().prepareRemoval( selection ); _this.model.transact( tx ); _this.showCursorAt(selection.start);
using execcommand to undo cut - model controls mutation
wikimedia_parsoid
train
js
5bedcf179a87d62ba371f405d466390227b201bd
diff --git a/code/libraries/koowa/controller/behavior/editable.php b/code/libraries/koowa/controller/behavior/editable.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/controller/behavior/editable.php +++ b/code/libraries/koowa/controller/behavior/editable.php @@ -217,7 +217,7 @@ class KControllerBehaviorEditable extends KControllerBehaviorAbstract $this->getToolbar() ->addCommand('save') ->addCommand('apply') - ->addCommand('cancel'); + ->addCommand('cancel', array('attribs' => array('data-novalidate' => 'novalidate'))); } } } \ No newline at end of file
The cancel command is not fully being set through the editable behavior.
joomlatools_joomlatools-framework
train
php
49c30863c18eb672e37cfc018739d7c5ed510147
diff --git a/src/Pingpong/Modules/Commands/GenerateFilterCommand.php b/src/Pingpong/Modules/Commands/GenerateFilterCommand.php index <HASH>..<HASH> 100644 --- a/src/Pingpong/Modules/Commands/GenerateFilterCommand.php +++ b/src/Pingpong/Modules/Commands/GenerateFilterCommand.php @@ -54,7 +54,7 @@ class GenerateFilterCommand extends GeneratorCommand { { $path = $this->laravel['modules']->getModulePath($this->getModuleName()); - $seederPath = $this->laravel['config']->get('paths.generator.filter'); + $seederPath = $this->laravel['modules']->config('paths.generator.filter'); return $path . $seederPath . '/' . $this->getFileName() . '.php'; }
Fix generate filter command, related to #<I>
pingpong-labs_modules
train
php
f6292d6a80a5c9ad60d7b25b011ee6f363a3c5f9
diff --git a/src/BaseFileStream.php b/src/BaseFileStream.php index <HASH>..<HASH> 100644 --- a/src/BaseFileStream.php +++ b/src/BaseFileStream.php @@ -88,7 +88,7 @@ class BaseFileStream /** * @var \CommandInterface[] */ - protected $commands = []; + protected $commands = array(); protected function runCommand($filename) { foreach ($this->commands as $command) { diff --git a/src/FileStream.php b/src/FileStream.php index <HASH>..<HASH> 100644 --- a/src/FileStream.php +++ b/src/FileStream.php @@ -118,7 +118,7 @@ class FileStream extends BaseFileStream $fileName = parent::getFileName(); if ($this->maxCount !== false) { - $fileName = strtr($fileName, [$this->countPlaceHolder => $this->currentFileCount]); + $fileName = strtr($fileName, array($this->countPlaceHolder => $this->currentFileCount)); } return $fileName;
fixes for php<I> compatibility
pastuhov_php-file-stream
train
php,php
070dbde399ea59c7aac130584c68ce66a972d2cb
diff --git a/classes/models/catalog/Product.php b/classes/models/catalog/Product.php index <HASH>..<HASH> 100644 --- a/classes/models/catalog/Product.php +++ b/classes/models/catalog/Product.php @@ -627,10 +627,16 @@ class Shopgate_Model_Catalog_Product extends Shopgate_Model_AbstractExport { $doc->loadXML($childItem->asXML()); $xpath = new DOMXPath($doc); - - foreach($xpath->query('//*[not(@forceEmpty) and (not(node()) or normalize-space() = "")]') as $node) { + $xpQuery = '//*[not(@forceEmpty) and not(descendant::*[@forceEmpty]) and normalize-space() = ""]'; + + /** @var DOMElement $node */ + foreach($xpath->query($xpQuery) as $node) { $node->parentNode->removeChild($node); } + + foreach($xpath->query('//*[@forceEmpty]') as $node) { + $node->removeAttribute('forceEmpty'); + } return simplexml_import_dom($doc); }
LIBRARY-<I> XML product export: * empty tags with "forceEmpty" attribute were still deleted under certain circumstances * forceEmpty attribute is now removed once it's not needed anymore
shopgate_cart-integration-sdk
train
php
9dba833956996fb2ff53f75d35dd314536f9a7cc
diff --git a/rebound/particle.py b/rebound/particle.py index <HASH>..<HASH> 100644 --- a/rebound/particle.py +++ b/rebound/particle.py @@ -443,6 +443,28 @@ class Particle(Structure): def index(self): clibrebound.reb_get_particle_index.restype = c_int return clibrebound.reb_get_particle_index(byref(self)) + + @property + def xyz(self): + return [self.x, self.y, self.z] + @xyz.setter + def xyz(self, value): + if len(value)!=3: + raise AttributeError("Can only set xyz positions to array with length 3") + self.x = float(value[0]) + self.y = float(value[1]) + self.z = float(value[2]) + + @property + def vxyz(self): + return [self.vx, self.vy, self.vz] + @vxyz.setter + def vxyz(self, value): + if len(value)!=3: + raise AttributeError("Can only set xyz velocities to array with length 3") + self.vx = float(value[0]) + self.vy = float(value[1]) + self.vz = float(value[2]) @property def d(self):
Added xyz convenience properties to particle.
hannorein_rebound
train
py
d56bd9e3e308cbeadb8445be3abc08a355b71303
diff --git a/tests/format_date.js b/tests/format_date.js index <HASH>..<HASH> 100644 --- a/tests/format_date.js +++ b/tests/format_date.js @@ -5,7 +5,7 @@ describe('format/date', function(){ var dateFormat; - // 2012-08-07 19:39:27 + // 2012-08-07 17:39:27 UTC var testTime = (new Date(1344361167946)); it('should be loadable',function(){ @@ -19,6 +19,6 @@ describe('format/date', function(){ var date = dateFormat('Y-m-d H:i:s',testTime); date.should.be.a('string'); - date.should.be.eql('2012-08-07 19:39:27'); + date.should.be.eql('2012-08-07 '+testTime.getHours()+':39:27'); }); }); \ No newline at end of file
fix unit tests to work with CI
piscis_toolbelt
train
js
618296f6406f1daa81130e38ff5a89238c16c44d
diff --git a/vault/activity_log.go b/vault/activity_log.go index <HASH>..<HASH> 100644 --- a/vault/activity_log.go +++ b/vault/activity_log.go @@ -2099,11 +2099,15 @@ func (a *ActivityLog) precomputedQueryWorker(ctx context.Context) error { mountRecord := make([]*activity.MountRecord, 0, len(nsMap[nsID].Mounts)) for mountAccessor, mountData := range nsMap[nsID].Mounts { var displayPath string - valResp := a.core.router.ValidateMountByAccessor(mountAccessor) - if valResp == nil { - displayPath = fmt.Sprintf("deleted mount; accessor %q", mountAccessor) + if mountAccessor == "" { + displayPath = "no mount accessor (pre-1.10 upgrade?)" } else { - displayPath = valResp.MountPath + valResp := a.core.router.ValidateMountByAccessor(mountAccessor) + if valResp == nil { + displayPath = fmt.Sprintf("deleted mount; accessor %q", mountAccessor) + } else { + displayPath = valResp.MountPath + } } mountRecord = append(mountRecord, &activity.MountRecord{
Handle the empty mount accessor case. (#<I>)
hashicorp_vault
train
go
339137b4b27fe958cb7171e4cdbf912f79ad5a4a
diff --git a/Lagometer.js b/Lagometer.js index <HASH>..<HASH> 100644 --- a/Lagometer.js +++ b/Lagometer.js @@ -38,7 +38,7 @@ define(function(require, exports, module) { Engine.on('postrender', this._onEngineRender.bind(this, false)); // Create drawing canvas - this.canvas = new CanvasSurface(); + this.canvas = new CanvasSurface(this.options.canvasSurface); this.add(this.canvas); } Lagometer.prototype = Object.create(View.prototype); @@ -53,7 +53,12 @@ define(function(require, exports, module) { textColor: 'rgba(255, 255, 255, 0.8)', font: '28px Arial', frameColor: '#00FF00', - scriptColor: '#BBBBFF' + scriptColor: '#BBBBFF', + canvasSurface: { + properties: { + 'pointer-events': 'none' + } + } }; /**
Disable pointer-events on lagometer and make canvasSurface configurable through options.canvasSurface
IjzerenHein_famous-lagometer
train
js
082556877d16e5435f3c9105da40a043a22633ca
diff --git a/site/js/Routing.js b/site/js/Routing.js index <HASH>..<HASH> 100644 --- a/site/js/Routing.js +++ b/site/js/Routing.js @@ -172,7 +172,7 @@ class MatchNone extends Match { class MatchEmpty extends Match { constructor() { - super(/^.{0}$/g); + super(/^$/g); } }
Tweaked empty string route matcher for simplicity
MiguelCastillo_bit-imports
train
js
83e632be0a5f026acd0d23746740be4dbeddf0db
diff --git a/elasticutils/tests/__init__.py b/elasticutils/tests/__init__.py index <HASH>..<HASH> 100644 --- a/elasticutils/tests/__init__.py +++ b/elasticutils/tests/__init__.py @@ -89,10 +89,10 @@ class ElasticTestCase(TestCase): es.delete_index(cls.index_name) except pyelasticsearch.exceptions.ElasticHttpNotFoundError: pass - if settings == None: - settings = {} - else: + if settings: settings = {'settings': settings} + else: + settings = {} es.create_index(cls.index_name, **settings) @classmethod
Cosmetic. Tweaked some code to look better.
mozilla_elasticutils
train
py
fe64b06a6d13e354f4a64b1f2f901e872ab055d8
diff --git a/oci/spec_unix.go b/oci/spec_unix.go index <HASH>..<HASH> 100644 --- a/oci/spec_unix.go +++ b/oci/spec_unix.go @@ -155,6 +155,7 @@ func createDefaultSpec(ctx context.Context, id string) (*Spec, error) { MaskedPaths: []string{ "/proc/acpi", "/proc/kcore", + "/proc/keys", "/proc/latency_stats", "/proc/timer_list", "/proc/timer_stats",
Add /proc/keys to masked paths This leaks information about keyrings on the host. Keyrings are not namespaced.
containerd_containerd
train
go
4daf00f19a5e0b4dc078d2ad087674f7b906635d
diff --git a/holoviews/plotting/bokeh/chart.py b/holoviews/plotting/bokeh/chart.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/bokeh/chart.py +++ b/holoviews/plotting/bokeh/chart.py @@ -91,7 +91,7 @@ class PointPlot(ElementPlot): properties.pop('legend', None) unselected = Circle(**dict(properties, fill_color=unselect_color, **mapping)) selected = Circle(**dict(properties, fill_color=color, **mapping)) - renderer = plot.add_glyph(source, selected, selection_glyph=glyph, + renderer = plot.add_glyph(source, selected, selection_glyph=selected, nonselection_glyph=unselected) else: renderer = getattr(plot, self._plot_method)(**dict(properties, **mapping))
Fixed unreferenced variable in bokeh PointPlot
pyviz_holoviews
train
py
7e557fe3354f2c035c12bc15bf1af5a48fac56c7
diff --git a/environs/instances/instancetype.go b/environs/instances/instancetype.go index <HASH>..<HASH> 100644 --- a/environs/instances/instancetype.go +++ b/environs/instances/instancetype.go @@ -149,7 +149,10 @@ func (bc byCost) Less(i, j int) bool { if inst0.CpuCores != inst1.CpuCores { return inst0.CpuCores < inst1.CpuCores } - return inst0.RootDisk < inst1.RootDisk + if inst0.RootDisk != inst1.RootDisk { + inst0.RootDisk < inst1.RootDisk + } + return false } func (bc byCost) Swap(i, j int) {
- Change to return false by default, so it's easier to add new constraints here.
juju_juju
train
go
153f0b43a08d45fec9b5c375953a9c6f78d36715
diff --git a/Eloquent/Model.php b/Eloquent/Model.php index <HASH>..<HASH> 100644 --- a/Eloquent/Model.php +++ b/Eloquent/Model.php @@ -183,14 +183,26 @@ abstract class Model implements Arrayable, ArrayAccess, Jsonable, JsonSerializab $this->fireModelEvent('booting', false); + static::booting(); static::boot(); + static::booted(); $this->fireModelEvent('booted', false); } } /** - * The "booting" method of the model. + * Perform any actions required before the model boots. + * + * @return void + */ + protected static function booting() + { + // + } + + /** + * Bootstrap the model and its traits. * * @return void */ @@ -244,6 +256,16 @@ abstract class Model implements Arrayable, ArrayAccess, Jsonable, JsonSerializab } /** + * Perform any actions required after the model boots. + * + * @return void + */ + protected static function booted() + { + // + } + + /** * Clear the list of booted models so they will be re-booted. * * @return void
Adding booting / booted methods to Model Currently, users who extend the boot method to add event listeners on model events must remember to call parent::boot() at the start of their method (or after). This is often forgotten and causes confusion for the user. By adding these simple place-holder extension points we can point users towards these methods instead which do not require them to call any parent methods at all.
illuminate_database
train
php
8d895a32aab290dd054771ba81092513e4a2e4bf
diff --git a/lib/sprockets-derailleur/manifest.rb b/lib/sprockets-derailleur/manifest.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets-derailleur/manifest.rb +++ b/lib/sprockets-derailleur/manifest.rb @@ -157,7 +157,7 @@ module Sprockets def skip_gzip?(asset) if sprockets2? - asset.is_a?(BundledAsset) + !asset.is_a?(BundledAsset) else environment.skip_gzip? end
Correctly gzip bundled assets in Sprockets 2 (#<I>)
steel_sprockets-derailleur
train
rb
3f68c40ac1011059ad0e3a7098bc1c75e4cd92bc
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -180,7 +180,16 @@ module.exports = function (grunt) { autoprefixer: { options: { - browsers: ['last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12'] + browsers: [ + 'Android 2.3', + 'Android >= 4', + 'Chrome >= 20', + 'Firefox >= 24', // Firefox 24 is the latest ESR + 'Explorer >= 8', + 'iOS >= 6', + 'Opera >= 12', + 'Safari >= 6' + ] }, core: { options: {
Make autoprefixer browsers fixed Closes #<I> by merging it.
twbs_bootstrap
train
js
77cb146bfef302053a985015a7b2ad34cd7b23e5
diff --git a/test/ImportExportTest.php b/test/ImportExportTest.php index <HASH>..<HASH> 100644 --- a/test/ImportExportTest.php +++ b/test/ImportExportTest.php @@ -99,7 +99,7 @@ class ImportExportTest extends TaoPhpUnitTestRunner */ public function testWrongClass() { - $itemClass = new \core_kernel_classes_Class(TAO_GROUP_CLASS); + $itemClass = new \core_kernel_classes_Class(GENERIS_RESOURCE); $report = $this->importService->importXhtmlFile('dummy', $itemClass, true); }
Exchanged tao_Group reference with generis
oat-sa_extension-tao-itemhtml
train
php
c3e90727229dd4eb7d39db520f52b31a1577ac36
diff --git a/frameworks/zuul.js b/frameworks/zuul.js index <HASH>..<HASH> 100644 --- a/frameworks/zuul.js +++ b/frameworks/zuul.js @@ -223,15 +223,18 @@ ZuulReporter.prototype.test_end = function(test) { self._set_status(self.stats); - var cov = window.__coverage__ || {}; - ajax.post('/__zuul/coverage/client') - .send(cov) - .end(function(err, res) { - if (err) { - console.log('error in coverage reports'); - console.log(err); - } - }); + var cov = window.__coverage__ ; + + if (cov) { + ajax.post('/__zuul/coverage/client') + .send(cov) + .end(function(err, res) { + if (err) { + console.log('error in coverage reports'); + console.log(err); + } + }); + } post_message({ type: 'test_end',
Only post coverage data if it exists
airtap_airtap
train
js
ae39e4d99c3193aabaf04a7834da8b54f50c9982
diff --git a/src/Rendering/Bs3FormRenderer.php b/src/Rendering/Bs3FormRenderer.php index <HASH>..<HASH> 100644 --- a/src/Rendering/Bs3FormRenderer.php +++ b/src/Rendering/Bs3FormRenderer.php @@ -109,7 +109,7 @@ class Bs3FormRenderer extends DefaultFormRenderer $this->form->getElementPrototype()->addClass('form-horizontal'); foreach ($this->form->getControls() as $control) { if ($control instanceof Controls\Button) { - $markAsPrimary = $control === $this->primaryButton || (!isset($this->primary) && empty($usedPrimary) && $control->parent instanceof Form); + $markAsPrimary = $control === $this->primaryButton || (!isset($this->primaryButton) && empty($usedPrimary) && $control->parent instanceof Form); if ($markAsPrimary) { $class = 'btn btn-primary'; $usedPrimary = TRUE;
fix a typo in pull request #<I>
nextras_forms
train
php
c67361a5a83200e1b2387c676b49262e28ebb81f
diff --git a/repairbox/cli.py b/repairbox/cli.py index <HASH>..<HASH> 100644 --- a/repairbox/cli.py +++ b/repairbox/cli.py @@ -27,7 +27,7 @@ def add_source(rbox: 'RepairBox', src: str) -> None: def remove_source(rbox: 'RepairBox', src: str) -> None: - rbox.sources.remove(ds) + rbox.sources.remove(src) print('removed source: {}'.format(src))
bug fix: typo caused by API change (#<I>)
squaresLab_BugZoo
train
py
5fe4dab51c8b7c725b49bd6352fbf531003ead4e
diff --git a/openpnm/topotools/generators/__init__.py b/openpnm/topotools/generators/__init__.py index <HASH>..<HASH> 100644 --- a/openpnm/topotools/generators/__init__.py +++ b/openpnm/topotools/generators/__init__.py @@ -1,3 +1,29 @@ +r""" +================================================ +Generators (:mod:`openpnm.topotools.generators`) +================================================ + +This module contains a selection of functions that deal specifically with +generating sufficient information that can be turned into an openpnm network. + +.. currentmodule:: openpnm.topotools.generators + +.. autosummary:: + :template: mybase.rst + :toctree: generated/ + :nosignatures: + + cubic + delaunay + gabriel + voronoi + voronoi_delaunay_dual + cubic_template + fcc + bcc + +""" + from .cubic import cubic from .delaunay import delaunay from .gabriel import gabriel
Add docstrings to generators' init file
PMEAL_OpenPNM
train
py
088e471c8591b3fcc79028b32e16e6349dab7e63
diff --git a/lib/kafka/client.rb b/lib/kafka/client.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/client.rb +++ b/lib/kafka/client.rb @@ -132,6 +132,14 @@ module Kafka @cluster.topics end + # Counts the number of partitions in a topic. + # + # @param topic [String] + # @return [Integer] the number of partitions in the topic. + def partitions_for(topic) + @cluster.partitions_for(topic).count + end + def close @cluster.disconnect end diff --git a/lib/kafka/cluster.rb b/lib/kafka/cluster.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/cluster.rb +++ b/lib/kafka/cluster.rb @@ -67,6 +67,7 @@ module Kafka end def partitions_for(topic) + add_target_topics([topic]) cluster_info.partitions_for(topic) end diff --git a/spec/functional/client_spec.rb b/spec/functional/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/functional/client_spec.rb +++ b/spec/functional/client_spec.rb @@ -19,4 +19,8 @@ describe "Producer API", functional: true do example "listing all topics in the cluster" do expect(kafka.topics).to include "test-messages" end + + example "fetching the partition count for a topic" do + expect(kafka.partitions_for("test-messages")).to eq 3 + end end
Allow fetching the partition count for a topic
zendesk_ruby-kafka
train
rb,rb,rb
119766c5fa70cc1e5dcb0edb69c1a2652d7dbb5b
diff --git a/src/lib/htmlPropsUtils.js b/src/lib/htmlPropsUtils.js index <HASH>..<HASH> 100644 --- a/src/lib/htmlPropsUtils.js +++ b/src/lib/htmlPropsUtils.js @@ -29,6 +29,7 @@ export const htmlInputAttrs = [ 'readOnly', 'required', 'step', + 'title', 'type', 'value', ]
fix(Input): pass `title` down to an input element (#<I>) fix(Input): pass `title` down to an input element
Semantic-Org_Semantic-UI-React
train
js
afb083c6f1c8334594a7a5da61e582983dcb0865
diff --git a/src/TableColumn/Template.php b/src/TableColumn/Template.php index <HASH>..<HASH> 100644 --- a/src/TableColumn/Template.php +++ b/src/TableColumn/Template.php @@ -19,7 +19,7 @@ class Template extends Generic * * @param string $template Template with {$tags} */ - public function setDefaults($template) + public function setDefaults($template = [], $strict = false) { if (is_array($template) && isset($template[0])) { $this->template = $template[0];
clean up for strict type checks of <I>
atk4_ui
train
php
93ccdcc10359a5445a4a87afd73c1a731c6c5d65
diff --git a/lib/models/debit.js b/lib/models/debit.js index <HASH>..<HASH> 100644 --- a/lib/models/debit.js +++ b/lib/models/debit.js @@ -22,6 +22,12 @@ const Debit = new mongoose.Schema({ type: String, enum: Object.keys(DEBIT_TYPES).map((key) => (DEBIT_TYPES[key])), required: true + }, + bandwidth: { + type: mongoose.Types.Currency + }, + storage: { + type: mongoose.Types.Currency } });
Edited bandwidth models in Debit
storj_service-storage-models
train
js
38b1128c8c51fbeef9bfd2f8cf3cb9b2629a0272
diff --git a/spec/integration/session_spec.rb b/spec/integration/session_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/session_spec.rb +++ b/spec/integration/session_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' skip = [] skip << :windows if ENV['TRAVIS'] +skip << :download # PhantomJS doesn't support downloading files Capybara::SpecHelper.run_specs TestSessions::Poltergeist, 'Poltergeist', capybara_skip: skip describe Capybara::Session do
Skip Capybaras download tests because its unsupported in Poltergeist
teampoltergeist_poltergeist
train
rb
041f1897273d1bc63b6125eb3558691ab137a160
diff --git a/lib/rack/subdomain.rb b/lib/rack/subdomain.rb index <HASH>..<HASH> 100644 --- a/lib/rack/subdomain.rb +++ b/lib/rack/subdomain.rb @@ -1,6 +1,6 @@ module Rack class Subdomain - VERSION = '0.1.0' + VERSION = '0.2.0' def initialize(app, domain, options = {}, &block) # Maintain compatibility with previous rack-subdomain gem
Bumping version to <I>
mattt_rack-subdomain
train
rb
59825e95271863f12698ffbfe4f2d56901680584
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -40,6 +40,9 @@ function inherits(Child, Parent) { var exports = exports || {}; var isArray = Array.isArray; +// conjure function declared at this level to avoid linting issues due to +// interdependence between different functions. +var conjure; // ________ // | \ @@ -325,7 +328,6 @@ function arrayInit(tome, val, seen) { seen.push(val[i]); } - /* global conjure */ tome._arr[i] = conjure(val[i], tome, i, seen); // We use hasOwnProperty here because arrays instantiated with new @@ -395,7 +397,6 @@ function objectInit(tome, val, seen) { seen.push(kv); } - /* global conjure */ tome[key] = kv === undefined ? undefined : conjure(kv, tome, key, seen); }
Remove jshint global option As suggested I added a declaration of the function as a var on top of the lib
Wizcorp_node-tomes
train
js
e88de2a6df5d008d4403b2c78a4e081a6b3afaf7
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -186,7 +186,7 @@ def _error(ret, err_msg): return ret -def check_recurse( +def _check_recurse( name, source, clean,
fix function definition for _check_recurse I had initially moved this to the file module along with other pieces that were moved to implement issue #<I>, but moved it back to the file state and did not put the leading underscore back in the function definition.
saltstack_salt
train
py
fd0805a0bca153ba8b377ebfc65432f6edc03a31
diff --git a/salt/modules/boto_lambda.py b/salt/modules/boto_lambda.py index <HASH>..<HASH> 100644 --- a/salt/modules/boto_lambda.py +++ b/salt/modules/boto_lambda.py @@ -116,11 +116,14 @@ def __virtual__(): # which was added in boto 2.8.0 # https://github.com/boto/boto/commit/33ac26b416fbb48a60602542b4ce15dcc7029f12 if not HAS_BOTO: - return False + return (False, 'The boto_lambda module could not be loaded: ' + 'boto libraries not found') elif _LooseVersion(boto.__version__) < _LooseVersion(required_boto_version): - return False + return (False, 'The boto_lambda module could not be loaded: ' + 'boto version {0} or later must be installed.'.format(required_boto_version)) elif _LooseVersion(boto3.__version__) < _LooseVersion(required_boto3_version): - return False + return (False, 'The boto_lambda module could not be loaded: ' + 'boto version {0} or later must be installed.'.format(required_boto3_version)) else: return True
modules.boto_lambda: __virtual__ return err msg. Added messages when return False is boto libraries are missing or version is old.
saltstack_salt
train
py
7075d431f68346f022ca9a0f4201812378dd98f9
diff --git a/frame.go b/frame.go index <HASH>..<HASH> 100644 --- a/frame.go +++ b/frame.go @@ -219,10 +219,12 @@ func (f frameHeader) Header() frameHeader { return f } +const defaultBufSize = 128 + var framerPool = sync.Pool{ New: func() interface{} { return &framer{ - buf: make([]byte, 0, 4096), + buf: make([]byte, defaultBufSize), } }, } @@ -367,7 +369,7 @@ func (f *framer) parseFrame() (frame, error) { return nil, NewErrProtocol("unknown op in frame header: %s", f.header.op) } - f.buf = make([]byte, 1024) + f.buf = make([]byte, defaultBufSize) return frame, err }
reduce buf size, reducing bytes used by around <I>%
gocql_gocql
train
go
3afdbd289ba07d89036d3a03a3592f6196747a1c
diff --git a/lib/metriks/reporter/logger.rb b/lib/metriks/reporter/logger.rb index <HASH>..<HASH> 100644 --- a/lib/metriks/reporter/logger.rb +++ b/lib/metriks/reporter/logger.rb @@ -14,6 +14,8 @@ module Metriks::Reporter def start @thread ||= Thread.new do loop do + sleep @interval + Thread.new do begin write @@ -21,8 +23,6 @@ module Metriks::Reporter @on_error[ex] rescue nil end end - - sleep @interval end end end
Sleep before writing the first metrics to the log
eric_metriks
train
rb
30034e5ff56b1e75b0b8716b3f22be1f339dca6e
diff --git a/raft/progress.go b/raft/progress.go index <HASH>..<HASH> 100644 --- a/raft/progress.go +++ b/raft/progress.go @@ -185,7 +185,8 @@ func (pr *Progress) needSnapshotAbort() bool { } func (pr *Progress) String() string { - return fmt.Sprintf("next = %d, match = %d, state = %s, waiting = %v, pendingSnapshot = %d", pr.Next, pr.Match, pr.State, pr.IsPaused(), pr.PendingSnapshot) + return fmt.Sprintf("next = %d, match = %d, state = %s, waiting = %v, pendingSnapshot = %d, recentActive = %v, isLearner = %v", + pr.Next, pr.Match, pr.State, pr.IsPaused(), pr.PendingSnapshot, pr.RecentActive, pr.IsLearner) } type inflights struct {
raft: add learner field to progress stringer
etcd-io_etcd
train
go
947816917334b139cf8ec7e6ad23d03684e2ea93
diff --git a/spyderlib/plugins/projectexplorer.py b/spyderlib/plugins/projectexplorer.py index <HASH>..<HASH> 100644 --- a/spyderlib/plugins/projectexplorer.py +++ b/spyderlib/plugins/projectexplorer.py @@ -27,8 +27,7 @@ class ProjectExplorer(ProjectExplorerWidget, PluginMixin): DATAPATH = get_conf_path('.projects') def __init__(self, parent=None): include = CONF.get(self.ID, 'include', '.') - exclude = CONF.get(self.ID, 'exclude', - r'\.pyc$|\.pyo$|\.orig$|\.hg|\.svn') + exclude = CONF.get(self.ID, 'exclude', r'\.pyc$|\.pyo$|\.orig$|^\.') show_all = CONF.get(self.ID, 'show_all', False) ProjectExplorerWidget.__init__(self, parent=parent, include=include, exclude=exclude, show_all=show_all)
Project explorer: changed default 'exclude' option to r'\.pyc$|\.pyo$|\.orig$|^\.' (excluding all files/dirs starting with '.')
spyder-ide_spyder
train
py
34e1f503537390c3b14533527effb066741d8244
diff --git a/lib/sequel/schema/db_schema_parser.rb b/lib/sequel/schema/db_schema_parser.rb index <HASH>..<HASH> 100644 --- a/lib/sequel/schema/db_schema_parser.rb +++ b/lib/sequel/schema/db_schema_parser.rb @@ -27,11 +27,10 @@ module Sequel # :table2 => { ... } } # def parse_db_schema - result = {} - @db.tables.each do |table_name| + @db.tables.inject({}) do |result, table_name| result[table_name] = {:columns => parse_table_schema(@db.schema(table_name))} + result end - result end # Extracts an array of hashes representing the columns in the
Refactoring to inject in parse_db_schema.
knaveofdiamonds_sequel_migration_builder
train
rb
8452d79549a86144d9f49bf70dde8536ccddbea6
diff --git a/ftfy/__init__.py b/ftfy/__init__.py index <HASH>..<HASH> 100644 --- a/ftfy/__init__.py +++ b/ftfy/__init__.py @@ -340,10 +340,8 @@ def guess_bytes(bstring): return bstring.decode('utf-16'), 'utf-16' byteset = set(bytes(bstring)) - byte_ed, byte_c0, byte_CR, byte_LF = b'\xed\xc0\r\n' - try: - if byte_ed in byteset or byte_c0 in byteset: + if 0xed in byteset or 0xc0 in byteset: # Byte 0xed can be used to encode a range of codepoints that # are UTF-16 surrogates. UTF-8 does not use UTF-16 surrogates, # so when we see 0xed, it's very likely we're being asked to @@ -370,7 +368,8 @@ def guess_bytes(bstring): except UnicodeDecodeError: pass - if byte_CR in bstring and byte_LF not in bstring: + if 0x0d in byteset and 0x0a not in byteset: + # Files that contain CR and not LF are likely to be MacRoman. return bstring.decode('macroman'), 'macroman' else: return bstring.decode('sloppy-windows-1252'), 'sloppy-windows-1252'
simplify how bytes are identified in guess_bytes
LuminosoInsight_python-ftfy
train
py
1cb344d7a2bb58030efc3848038635b75a5f49c4
diff --git a/src/test/java/org/brutusin/json/spi/DataCodecTest.java b/src/test/java/org/brutusin/json/spi/DataCodecTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/brutusin/json/spi/DataCodecTest.java +++ b/src/test/java/org/brutusin/json/spi/DataCodecTest.java @@ -17,6 +17,7 @@ package org.brutusin.json.spi; import java.io.InputStream; import java.util.HashMap; +import java.util.Map; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -86,5 +87,11 @@ public abstract class DataCodecTest { assertEquals(node.get("inputStream").asStream(), is); TestClass instance2 = JsonCodec.getInstance().load(node, TestClass.class); assertEquals(instance.getInputStream(), instance2.getInputStream()); + Map<String, InputStream> streams = new HashMap(); + streams.put(node.get("inputStream").asString(), is); + JsonNode node2 = JsonCodec.getInstance().parse(node.toString(), streams); + assertEquals(node2.get("inputStream").asStream(), is); + TestClass instance3 = JsonCodec.getInstance().parse(node.toString(), TestClass.class, streams); + assertEquals(instance3.getInputStream(), instance3.getInputStream()); } }
Added inputstream attachments Added inputstream/file formats Changed json-schema spec uri
brutusin_json
train
java
14151d79bd2d345d2afc1bba4444963de1e281c5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup(name='scattertext', 'jieba', #'tinysegmenter', 'empath', - 'umap', + #'umap', #'gensim' # 'matplotlib', # 'seaborn',
Taking out the UMAP requirement.
JasonKessler_scattertext
train
py
73bfb719c1422468f47a3afa04f6b376bf431fcf
diff --git a/SimplePie/File.php b/SimplePie/File.php index <HASH>..<HASH> 100644 --- a/SimplePie/File.php +++ b/SimplePie/File.php @@ -143,16 +143,17 @@ class SimplePie_File { $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; $url_parts = parse_url($url); + $socket_host = $url_parts['host']; if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { - $url_parts['host'] = "ssl://$url_parts[host]"; + $socket_host = "ssl://$url_parts[host]"; $url_parts['port'] = 443; } if (!isset($url_parts['port'])) { $url_parts['port'] = 80; } - $fp = @fsockopen($url_parts['host'], $url_parts['port'], $errno, $errstr, $timeout); + $fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout); if (!$fp) { $this->error = 'fsockopen error: ' . $errstr;
Don't leak fsockopen's special HTTPS host in request headers. Fixes #<I>
simplepie_simplepie
train
php
0b4f2a70e573243bdf507d3ec09b068b22b5b592
diff --git a/ui/js/perf.js b/ui/js/perf.js index <HASH>..<HASH> 100644 --- a/ui/js/perf.js +++ b/ui/js/perf.js @@ -300,9 +300,9 @@ perf.controller('PerfCtrl', [ '$state', '$stateParams', '$scope', '$rootScope', mean]); flotSeries.resultSetData.push( dataPoint.result_set_id); - flotSeries.data.sort(function(a,b) { - return a[0] > b[0]; }); }); + flotSeries.data.sort(function(a,b) { + return a[0] < b[0]; }); series.flotSeries = flotSeries; }); }
Fix sorting of performance series (we were sorting them in reverse order before, oops)
mozilla_treeherder
train
js
628abe13eafdad64b53e760bef1f35a75a5ef741
diff --git a/spm.py b/spm.py index <HASH>..<HASH> 100644 --- a/spm.py +++ b/spm.py @@ -162,6 +162,9 @@ class Subprocess(object): otherprocess.stdin = self return otherprocess + def wait(self): + return self._process.communicate() + def run(*args, **kwargs): """
Add the ability to wait for the process
acatton_python-spm
train
py
961ad9852bdb3b989abd10ddb77c793a509100e5
diff --git a/src/Yggdrasil/Core/Driver/DriverAccessorTrait.php b/src/Yggdrasil/Core/Driver/DriverAccessorTrait.php index <HASH>..<HASH> 100644 --- a/src/Yggdrasil/Core/Driver/DriverAccessorTrait.php +++ b/src/Yggdrasil/Core/Driver/DriverAccessorTrait.php @@ -128,7 +128,7 @@ trait DriverAccessorTrait */ protected function installDrivers(): void { - foreach ($this->drivers as $name => $driver) { + foreach ($this->drivers->all() as $name => $driver) { $this->{$name} = $this->drivers->get($name); } } diff --git a/src/Yggdrasil/Core/Driver/DriverCollection.php b/src/Yggdrasil/Core/Driver/DriverCollection.php index <HASH>..<HASH> 100644 --- a/src/Yggdrasil/Core/Driver/DriverCollection.php +++ b/src/Yggdrasil/Core/Driver/DriverCollection.php @@ -42,6 +42,16 @@ final class DriverCollection } /** + * Returns all drivers in an array + * + * @return array + */ + public function all(): array + { + return $this->drivers; + } + + /** * Adds driver to collection * * @param string $key Name of driver
[Driver] Hotfix for generating magic properties
Assasz_yggdrasil
train
php,php
2ec0b772bb5e4a9228b3c387b1c82e39673955c3
diff --git a/cmd.js b/cmd.js index <HASH>..<HASH> 100755 --- a/cmd.js +++ b/cmd.js @@ -133,7 +133,9 @@ playerName = argv.airplay ? 'Airplay' var command = argv._[0] -if (command === 'help' || argv.help) { +if (['info', 'create', 'download', 'add', 'seed'].indexOf(command) !== -1 && argv._.length !== 2) { + runHelp() +} else if (command === 'help' || argv.help) { runHelp() } else if (command === 'version' || argv.version) { runVersion()
show help if there is not exactly one argument for info, create, download, add and seed, fix #<I>
webtorrent_webtorrent-cli
train
js
1e31d7b094addf39657240769319469b76cae1cd
diff --git a/lambda-behave/src/main/java/com/insightfullogic/lambdabehave/impl/AbstractSuiteRunner.java b/lambda-behave/src/main/java/com/insightfullogic/lambdabehave/impl/AbstractSuiteRunner.java index <HASH>..<HASH> 100644 --- a/lambda-behave/src/main/java/com/insightfullogic/lambdabehave/impl/AbstractSuiteRunner.java +++ b/lambda-behave/src/main/java/com/insightfullogic/lambdabehave/impl/AbstractSuiteRunner.java @@ -11,7 +11,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.insightfullogic.lambdabehave.SpecificationError; -import com.insightfullogic.lambdabehave.TestFailure; import com.insightfullogic.lambdabehave.impl.reports.SpecificationReport; public abstract class AbstractSuiteRunner extends ParentRunner<CompleteBehaviour> { @@ -61,7 +60,7 @@ public abstract class AbstractSuiteRunner extends ParentRunner<CompleteBehaviour notifier.fireTestFinished(test); return; case FAILURE: - notifier.fireTestFailure(new Failure(test, new TestFailure(spec.getMessage()))); + notifier.fireTestFailure(new Failure(test, spec.getCause())); return; case ERROR: default:
Don't hide assertion stack trace when reporting test failures
RichardWarburton_lambda-behave
train
java
8f47c1e73cbf3a3c1984c593c949c20eb8f1fb9f
diff --git a/src/Spryker/Zed/PriceProductDataImport/Communication/Plugin/PriceProductDataImportPlugin.php b/src/Spryker/Zed/PriceProductDataImport/Communication/Plugin/PriceProductDataImportPlugin.php index <HASH>..<HASH> 100644 --- a/src/Spryker/Zed/PriceProductDataImport/Communication/Plugin/PriceProductDataImportPlugin.php +++ b/src/Spryker/Zed/PriceProductDataImport/Communication/Plugin/PriceProductDataImportPlugin.php @@ -13,7 +13,7 @@ use Spryker\Zed\Kernel\Communication\AbstractPlugin; use Spryker\Zed\PriceProductDataImport\PriceProductDataImportConfig; /** - * @method \Spryker\Zed\PriceProductDataImport\Business\PriceProductDataImportFacade getFacade() + * @method \Spryker\Zed\PriceProductDataImport\Business\PriceProductDataImportFacadeInterface getFacade() * @method \Spryker\Zed\PriceProductDataImport\PriceProductDataImportConfig getConfig() */ class PriceProductDataImportPlugin extends AbstractPlugin implements DataImportPluginInterface
TE-<I> Use the interfaces not the concrete implementation for magic methods
spryker_price-product-data-import
train
php
bcccd125b9afc5128fe684212b08c62e2ee49edb
diff --git a/src/org/zaproxy/zap/control/AddOn.java b/src/org/zaproxy/zap/control/AddOn.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/control/AddOn.java +++ b/src/org/zaproxy/zap/control/AddOn.java @@ -53,6 +53,8 @@ import org.zaproxy.zap.control.BaseZapAddOnXmlData.Dependencies; public class AddOn { public enum Status {unknown, example, alpha, beta, weekly, release} + private static ZapRelease v2_4 = new ZapRelease("2.4.0"); + /** * The installation status of the add-on. * @@ -706,6 +708,11 @@ public class AddOn { if (zrc.compare(zr, notBeforeRelease) < 0) { return false; } + + if (zrc.compare(notBeforeRelease, v2_4) < 0) { + // Dont load any add-ons that imply they are prior to 2.4.0 - they probably wont work + return false; + } } if (this.notFromVersion != null && this.notFromVersion.length() > 0) { ZapRelease notFromRelease = new ZapRelease(this.notFromVersion);
Disable any add-ons that appear to be from <I> or before
zaproxy_zaproxy
train
java
57a2d3a695b719f556949f22d44370b936e36ae2
diff --git a/table/columns/linkcolumn.py b/table/columns/linkcolumn.py index <HASH>..<HASH> 100644 --- a/table/columns/linkcolumn.py +++ b/table/columns/linkcolumn.py @@ -59,8 +59,8 @@ class Link(object): """ text = self.text.resolve(obj) if isinstance(self.text, Accessor) else self.text if self.confirm: - return mark_safe('''<a href="%s" onclick="return confirm('%s')">%s</a>''' % + return mark_safe(u'''<a href="%s" onclick="return confirm('%s')">%s</a>''' % (self.resolve(obj), self.confirm, text)) else: - return mark_safe('<a href="%s">%s</a>' % (self.resolve(obj), text)) + return mark_safe(u'<a href="%s">%s</a>' % (self.resolve(obj), text))
fix bug about unicode in LinkColumn
shymonk_django-datatable
train
py
c44d4248ac27dddc267e7dc0909eb802b7b9bafb
diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -164,6 +164,12 @@ module Jekyll config.delete('server') end + if config.has_key? 'server_port' + Jekyll::Logger.warn "Deprecation:", "The 'server_port' configuration option" + + " has been renamed to 'port'. Update your config file" + + " accordingly." + end + config end
warn on use of deprecated "server_port" option
jekyll_jekyll
train
rb
c515673da559c47338d122d6a5db279bd0747022
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -35,11 +35,15 @@ except ImportError: try: import sphinx - import sphinx.cmd.build _HAVE_SPHINX = True except ImportError: _HAVE_SPHINX = False - +try: + import sphinx.cmd.build +except ImportError: + # older version of sphinx; should have sphinx.main and won't need this + pass + # Sphinx needs to import the built extension to generate # html docs, so build the extension inplace first. @@ -65,8 +69,10 @@ class doc(build_ext): status = sphinx.build_main(sphinx_args) elif hasattr(sphinx, 'main'): status = sphinx.main(sphinx_args) - else: + elif hasattr(sphinx, 'cmd'): status = sphinx.cmd.build.main(sphinx_args) + else: + status = 1 if status: raise RuntimeError("Documentation build failed")
Better deal with older version of sphinx while still allowing docs to build with newer versions
mongodb-labs_winkerberos
train
py
b5655a82dab84ed49eb0603f1ccceaa9181d51f3
diff --git a/mysql/toolkit/components/connector.py b/mysql/toolkit/components/connector.py index <HASH>..<HASH> 100644 --- a/mysql/toolkit/components/connector.py +++ b/mysql/toolkit/components/connector.py @@ -10,6 +10,7 @@ class Connector: from a query, executing a query and batch executing multiple queries. """ def __init__(self, config, enable_printing): + self._config = config self.enable_printing = enable_printing self._cursor = None self._cnx = None @@ -76,3 +77,15 @@ class Connector: self._cursor.executemany(command) self._commit() return True + + def change_db(self, db): + """Change connect database.""" + # Get original config and change database key + config = self._config + config['database'] = db + + # Close current database connection + self._disconnect() + + # Reconnect to the new database + self._connect(config)
Added change_db method to connect to a different database
mrstephenneal_mysql-toolkit
train
py
a1e595edac4dd7ca39e4d9fd6d0cd12da1389a05
diff --git a/discovery/xds/kuma.go b/discovery/xds/kuma.go index <HASH>..<HASH> 100644 --- a/discovery/xds/kuma.go +++ b/discovery/xds/kuma.go @@ -103,11 +103,7 @@ func (c *KumaSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { return errors.Errorf("kuma SD server must not be empty and have a scheme: %s", c.Server) } - if err := c.HTTPClientConfig.Validate(); err != nil { - return err - } - - return nil + return c.HTTPClientConfig.Validate() } func (c *KumaSDConfig) Name() string { diff --git a/tsdb/wal/wal.go b/tsdb/wal/wal.go index <HASH>..<HASH> 100644 --- a/tsdb/wal/wal.go +++ b/tsdb/wal/wal.go @@ -452,10 +452,7 @@ func (w *WAL) Repair(origErr error) error { if err != nil { return err } - if err := w.setSegment(s); err != nil { - return err - } - return nil + return w.setSegment(s) } // SegmentName builds a segment name for the directory.
Fix two trivial lint warnings Not sure why those show up for me locally but not if run by the CI.
prometheus_prometheus
train
go,go
21fbab41c062454588ce85e1a815a707416c3963
diff --git a/better_od/core.py b/better_od/core.py index <HASH>..<HASH> 100644 --- a/better_od/core.py +++ b/better_od/core.py @@ -84,7 +84,10 @@ class OrderedSet(MutableSet): self._keys = [] return self._set = set(items) - self._keys = list(items) + self._keys = [] + for key in items: + if key not in self._keys: + self._keys.append(key) def __contains__(self, value): return value in self._set
Rewrite OrderedSet constructor. The constructor here was incorrectly creating the _keys list leading to incorrect index behavior.
therealfakemoot_collections2
train
py
abd95ddb45290ca20821ff934d108f4c0ac1bd6b
diff --git a/django_extensions/db/fields/__init__.py b/django_extensions/db/fields/__init__.py index <HASH>..<HASH> 100644 --- a/django_extensions/db/fields/__init__.py +++ b/django_extensions/db/fields/__init__.py @@ -71,9 +71,13 @@ class UniqueFieldMixin(object): constraints = getattr(model_instance._meta, 'constraints', None) if constraints: for constraint in constraints: - query &= Q(**{field: getattr(model_instance, field, None) for field in constraint.fields}) - if constraint.condition: - query &= constraint.condition + if self.attname in constraint.fields: + condition = { + field: getattr(model_instance, field, None) + for field in constraint.fields + if field != self.attname + } + query &= Q(**condition) new = six.next(iterator) kwargs[self.attname] = new
Fix find_unique related to constraints The value of UniqueConstraint.condition is redundant.
django-extensions_django-extensions
train
py
14d1fdcab357dd78e325a1ee7e8ea87a0b578a28
diff --git a/spec/unit/provider/exec/posix_spec.rb b/spec/unit/provider/exec/posix_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/provider/exec/posix_spec.rb +++ b/spec/unit/provider/exec/posix_spec.rb @@ -5,10 +5,10 @@ describe Puppet::Type.type(:exec).provider(:posix) do include PuppetSpec::Files def make_exe - command = tmpfile('my_command') - FileUtils.touch(command) - File.chmod(0755, command) - command + command_path = tmpdir('cmdpath') + command = Tempfile.new('my_command', command_path) + File.chmod(0755, command.path) + command.path end let(:resource) { Puppet::Type.type(:exec).new(:title => File.expand_path('/foo'), :provider => :posix) } @@ -74,8 +74,8 @@ describe Puppet::Type.type(:exec).provider(:posix) do end it "should fail if the command is in the path but not executable" do - command = tmpfile('foo') - FileUtils.touch(command) + command = make_exe + File.chmod(0644, command) FileTest.stubs(:executable?).with(command).returns(false) resource[:path] = [File.dirname(command)] filename = File.basename(command)
Don't make executables in /tmp in posix_spec The posix specs were creating executable files in /tmp, which caused a warning about an insecure directory in the path. This adds an intermediate safe directory.
puppetlabs_puppet
train
rb
7257be0a546c3452ea3f5a74e6ba8160d45f2d57
diff --git a/tasks/common.js b/tasks/common.js index <HASH>..<HASH> 100644 --- a/tasks/common.js +++ b/tasks/common.js @@ -29,6 +29,7 @@ module.exports.browserify = function(options) { .require('./src/playbacks/hls', { expose: 'hls' }) .require('./src/playbacks/html5_audio', { expose: 'html5_audio' }) .require('./src/playbacks/html5_video', { expose: 'html5_video' }) + .require('./src/plugins/poster', { expose: 'poster' }) .require('zepto') .require('underscore') };
tasks: expose poster built-in plugin
clappr_clappr
train
js