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
f56d63b9d634998cf4e96ad4d8d87da25a9054d5
diff --git a/emoji/models.py b/emoji/models.py index <HASH>..<HASH> 100644 --- a/emoji/models.py +++ b/emoji/models.py @@ -145,7 +145,10 @@ class Emoji(object): name = e.name_for(character) if name: - character = e._image_string(name, alt=character) + if settings.EMOJI_ALT_AS_UNICODE: + character = e._image_string(name, alt=character) + else: + character = e._image_string(name) output.append(character)
Unicode as alt as a configuration point
gaqzi_django-emoji
train
py
d8181fe8b855e261cadef9ca850e39a877fe19b3
diff --git a/ext_emconf.php b/ext_emconf.php index <HASH>..<HASH> 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -14,6 +14,7 @@ $EM_CONF[$_EXTKEY] = [ 'constraints' => [ 'depends' => [ + 'typo3' => '6.2.0-7.6.99', 'configuration_object' => '1.0.0-1.99.99' ] ]
[TASK] Add TYPO3 version requirement TER release could not be performed because of the TYPO3 version requirement missing in `ext_emconf.php`.
romm_formz
train
php
a37cf45b6684c1566c4e8e720e0645efc126519a
diff --git a/src/validations.js b/src/validations.js index <HASH>..<HASH> 100644 --- a/src/validations.js +++ b/src/validations.js @@ -37,18 +37,20 @@ export const login = joi.object({ session: joi.string().valid('token', 'cookie').default('token'), }), body: joi.object({ - email: userEmail.required(), - // This is less strict than the password validation used in `register`, - // because we check this against the DB anyway, and an error message - // about mismatching passwords makes more sense when logging in than an - // error message about the password being too short. + // This is less strict than the email and password validation used in + // `register`, because we check this against the DB anyway, and an + // error message about a nonexistent account or mismatching passwords + // makes more sense when logging in than an error message about the + // email being incorrectly formatted or the password being too short. + email: joi.string().required(), password: joi.string().required(), }), }); export const requestPasswordReset = joi.object({ body: joi.object({ - email: userEmail.required(), + // Checked against DB like in `login`. + email: joi.string().required(), }), });
Loosen validation in login and password reset forms.
u-wave_core
train
js
e539b24c84b4a4a18d20e77fa7c4fcbefbfefeac
diff --git a/server/httphandler.js b/server/httphandler.js index <HASH>..<HASH> 100644 --- a/server/httphandler.js +++ b/server/httphandler.js @@ -93,6 +93,9 @@ var serveMagicLocale = function (request, response) { } else { negotiator = new Negotiator(request); found_locale = negotiator.language(cached_available_locales); + + // If a locale couldn't be negotiated, use the default + found_locale = found_locale || default_locale_id; } // Send a locale to the browser
Default locale if one couldn't be negotiated
prawnsalad_KiwiIRC
train
js
f0811557f823302f081dd019f17f54940764b958
diff --git a/api/webserver/main.go b/api/webserver/main.go index <HASH>..<HASH> 100644 --- a/api/webserver/main.go +++ b/api/webserver/main.go @@ -82,6 +82,7 @@ func main() { m.Put("/apps/:app/:team", AuthorizationRequiredHandler(app.GrantAccessToTeamHandler)) m.Del("/apps/:app/:team", AuthorizationRequiredHandler(app.RevokeAccessFromTeamHandler)) m.Get("/apps/:name/log", AuthorizationRequiredHandler(app.AppLog)) + m.Post("/apps/:name/log", Handler(app.AddLogHandler)) m.Post("/users", Handler(auth.CreateUser)) m.Post("/users/:email/tokens", Handler(auth.Login))
Added route for add log handler. Related to #<I>.
tsuru_tsuru
train
go
708bd8a5db71fcc2b717abefaf9f2009c0544384
diff --git a/includes/functions/functions_rtl.php b/includes/functions/functions_rtl.php index <HASH>..<HASH> 100644 --- a/includes/functions/functions_rtl.php +++ b/includes/functions/functions_rtl.php @@ -41,6 +41,18 @@ $numberPunctuation = '- ,.:/'; // Treat these like numbers when inside numeric s $punctuation = ',.:;?!'; /** + * This function strips &lrm; and &rlm; from the input string. It should be used for all + * text that has been passed through the PrintReady() function before that text is stored + * in the database. The database should NEVER contain these characters. + * + * @param string The string from which the &lrm; and &rlm; characters should be stripped + * @return string The input string, with &lrm; and &rlm; stripped + */ +function stripLRMRLM($inputText) { + return str_replace(array(WT_UTF8_LRM, WT_UTF8_RLM, WT_UTF8_LRO, WT_UTF8_RLO, WT_UTF8_LRE, WT_UTF8_RLE, WT_UTF8_PDF, "&lrm;", "&rlm;", "&LRM;", "&RLM;"), "", $inputText); +} + +/** * This function encapsulates all texts in the input with <span dir='xxx'> and </span> * according to the directionality specified. *
function stripLRMRLM() deleted prematurely. It is still used by the PDF reports. Restore it.
fisharebest_webtrees
train
php
9b301e3975053eeb5d8d56ba51d24b78d72caef0
diff --git a/lib/solargraph/diagnostics/rubocop.rb b/lib/solargraph/diagnostics/rubocop.rb index <HASH>..<HASH> 100644 --- a/lib/solargraph/diagnostics/rubocop.rb +++ b/lib/solargraph/diagnostics/rubocop.rb @@ -6,6 +6,15 @@ module Solargraph # This reporter provides linting through RuboCop. # class Rubocop < Base + # Conversion of RuboCop severity names to LSP constants + SEVERITIES = { + 'refactor' => 4, + 'convention' => 3, + 'warning' => 2, + 'error' => 1, + 'fatal' => 1 + } + # The rubocop command # # @return [String] @@ -43,14 +52,6 @@ module Solargraph private def make_array resp - # Conversion of RuboCop severity names to LSP constants - severities = { - 'refactor' => 4, - 'convention' => 3, - 'warning' => 2, - 'error' => 1, - 'fatal' => 1 - } diagnostics = [] resp['files'].each do |file| file['offenses'].each do |off| @@ -73,7 +74,7 @@ module Solargraph } }, # 1 = Error, 2 = Warning, 3 = Information, 4 = Hint - severity: severities[off['severity']], + severity: SEVERITIES[off['severity']], source: off['cop_name'], message: off['message'].gsub(/^#{off['cop_name']}\:/, '') }
Move RuboCop severities to constant.
castwide_solargraph
train
rb
3ace122da98fc130ae939ca0c60939933579a497
diff --git a/publify_core/lib/publify_core.rb b/publify_core/lib/publify_core.rb index <HASH>..<HASH> 100644 --- a/publify_core/lib/publify_core.rb +++ b/publify_core/lib/publify_core.rb @@ -5,7 +5,6 @@ require 'publify_core/version' require 'publify_core/engine' require 'publify_core/lang' -require 'activerecord/session_store' require 'bootstrap-sass' require 'carrierwave' require 'dynamic_form'
Do not require activerecord/session_store
publify_publify
train
rb
0f07dbd12f5e809a0246dc5d064cbefa4b1c6025
diff --git a/core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java b/core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java index <HASH>..<HASH> 100644 --- a/core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java +++ b/core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java @@ -882,7 +882,7 @@ public class ConsumerConfig<T> extends AbstractInterfaceConfig<T, ConsumerConfig } /** - * Gets time out. + * Gets the timeout corresponding to the method name * * @param methodName the method name * @return the time out @@ -904,10 +904,10 @@ public class ConsumerConfig<T> extends AbstractInterfaceConfig<T, ConsumerConfig } /** - * Gets time out. + * Gets the call type corresponding to the method name * * @param methodName the method name - * @return the time out + * @return the call type */ public String getMethodInvokeType(String methodName) { return (String) getMethodConfigValue(methodName, RpcConstants.CONFIG_KEY_INVOKE_TYPE,
Modify inappropriate comments in ConsumerConfig. (#<I>)
alipay_sofa-rpc
train
java
ca987bc1af56e76c44a177b7aa1fd1b4d4085d7c
diff --git a/plugins/rcpt_to.ldap.js b/plugins/rcpt_to.ldap.js index <HASH>..<HASH> 100644 --- a/plugins/rcpt_to.ldap.js +++ b/plugins/rcpt_to.ldap.js @@ -33,7 +33,7 @@ exports.ldap_rcpt = function(next, connection, params) { var txn = connection.transaction; if (!txn) return next(); - var rcpt = params[0]; + var rcpt = txn.rcpt_to[txn.rcpt_to.length - 1]; if (!rcpt.host) { txn.results.add(plugin, {fail: '!domain'}); return next();
Aliases plugin modifies transaction.rcpt_to The aliases plugin modifies the transaction.rcpt_to array. Look at the latest entry added to the rcpt_to array and use that for looking up the destination LDAP account.
haraka_Haraka
train
js
e0c6ff9a2f59a0e52eeaba99f5c9fc3ad9fcee6b
diff --git a/lib/rummageable.rb b/lib/rummageable.rb index <HASH>..<HASH> 100644 --- a/lib/rummageable.rb +++ b/lib/rummageable.rb @@ -1,5 +1,4 @@ require "rest_client" -require 'yajl' require 'multi_json' require "plek"
remove the hard dependency on yajl let multi json sort it
alphagov_rummageable
train
rb
016b96ca3896d27b37c5b2d6e223fb3320a0fdec
diff --git a/staging/src/k8s.io/apiserver/pkg/audit/request.go b/staging/src/k8s.io/apiserver/pkg/audit/request.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/request.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/request.go @@ -196,9 +196,11 @@ func LogResponseObject(ctx context.Context, obj runtime.Object, gv schema.GroupV if status, ok := obj.(*metav1.Status); ok { // selectively copy the bounded fields. ae.ResponseStatus = &metav1.Status{ - Status: status.Status, - Reason: status.Reason, - Code: status.Code, + Status: status.Status, + Message: status.Message, + Reason: status.Reason, + Details: status.Details, + Code: status.Code, } }
Issue <I>: Add messages+details to audit logs response (#<I>)
kubernetes_kubernetes
train
go
ea9ad1f3743eed49ecc6fdd4de0b1286080e0934
diff --git a/blocks/dock.js b/blocks/dock.js index <HASH>..<HASH> 100644 --- a/blocks/dock.js +++ b/blocks/dock.js @@ -101,12 +101,7 @@ M.core_dock.init = function(Y) { } else { dock.addClass(css.dock+'_'+this.cfg.position+'_'+this.cfg.orientation); } - this.holdingarea = Y.Node.create('<div></div>').setStyles({ - position:'absolute', - top:'-1000px', - left:'-1000px', - display:'none' - }); + this.holdingarea = Y.Node.create('<div></div>').setStyles({display:'none'}); this.nodes.body.append(this.holdingarea); if (Y.UA.ie > 0 && Y.UA.ie < 7) { // Adjust for IE 6 (can't handle fixed pos)
javascript dock MDL-<I> Fixed regression in last commit to dock
moodle_moodle
train
js
e25953c6bec88df800f1a2eae15625c3a1a9714e
diff --git a/lib/active_remote/rpc.rb b/lib/active_remote/rpc.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/rpc.rb +++ b/lib/active_remote/rpc.rb @@ -53,6 +53,11 @@ module ActiveRemote end end + def remote_call(rpc_method, request_args) + self._execute(rpc_method, request_args) + self.last_response + end + private # Return a protobuf request object for the given rpc call.
Added an instance version of the remote_call method.
liveh2o_active_remote
train
rb
cd26d44b461d8fe8ff545f71f0151da569fe1ced
diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/base.py +++ b/openquake/calculators/base.py @@ -472,7 +472,6 @@ class HazardCalculator(BaseCalculator): self.exposure = readinput.get_exposure(self.oqparam) arefs = numpy.array(self.exposure.asset_refs, hdf5.vstr) self.datastore['asset_refs'] = arefs - self.datastore.flush() self.datastore.set_attrs('asset_refs', nbytes=arefs.nbytes) self.cost_calculator = readinput.get_cost_calculator(self.oqparam) self.sitecol, self.assets_by_site = (
Removed a flush [skip CI]
gem_oq-engine
train
py
87f1083c586f5ff2f2974c6efa377fe0a54643c2
diff --git a/src/passes/Pass.js b/src/passes/Pass.js index <HASH>..<HASH> 100644 --- a/src/passes/Pass.js +++ b/src/passes/Pass.js @@ -143,7 +143,6 @@ export class Pass { * Indicates whether this pass is enabled. * * @type {Boolean} - * @deprecated Use isEnabled() and setEnabled() instead. */ this.enabled = true; @@ -204,6 +203,7 @@ export class Pass { /** * Indicates whether this pass is enabled. * + * @deprecated Use enabled instead. * @return {Boolean} Whether this pass is enabled. */ @@ -216,6 +216,7 @@ export class Pass { /** * Enables or disables this pass. * + * @deprecated Use enabled instead. * @param {Boolean} value - Whether the pass should be enabled. */
Deprecate isEnabled and setEnabled and revert deprecation of enabled flag.
vanruesc_postprocessing
train
js
d46b386c20a8679edf26183a056e1ba512ea577e
diff --git a/sandman/model/models.py b/sandman/model/models.py index <HASH>..<HASH> 100644 --- a/sandman/model/models.py +++ b/sandman/model/models.py @@ -138,3 +138,8 @@ class Model(object): class AdminModelViewWithPK(ModelView): """Mixin admin view class that displays primary keys on the admin form""" column_display_pk = True + +class AuthenticatedAdminModelView(ModelView): + + def is_accessible(self): + raise NotImplementedError('You must implement the \'is_accessible\' method to use authorization.')
Add support for authenticated AdminViews
jeffknupp_sandman
train
py
a9db058a8ca30ab2457c2f801ed7e6fc3facf917
diff --git a/gwpy/segments/flag.py b/gwpy/segments/flag.py index <HASH>..<HASH> 100644 --- a/gwpy/segments/flag.py +++ b/gwpy/segments/flag.py @@ -805,7 +805,7 @@ class DataQualityDict(OrderedDict): """)) @classmethod - def from_veto_definer_file(cls, fp, start=None, end=None): + def from_veto_definer_file(cls, fp, start=None, end=None, ifo=None): """Read a `DataQualityDict` from a LIGO_LW XML VetoDefinerTable. """ # open file @@ -818,13 +818,15 @@ class DataQualityDict(OrderedDict): veto_def_table = VetoDefTable.get_table(xmldoc) out = cls() for row in veto_def_table: - if start and row.end_time < start: + if ifo and row.ifo != ifo: + continue + if start and 0 < row.end_time < start: continue elif start: row.start_time = max(row.start_time, start) if end and row.start_time > end: continue - elif end and row.end_time == 0: + elif end and not row.end_time: row.end_time = end elif end: row.end_time = min(row.end_time, end)
DataQualityDict.from_veto_definer_file: added ifo=None - also fixed bug in zero end time
gwpy_gwpy
train
py
fcc7b01ba7e7d35a8c4e29cf843b1e99ee0ad2d7
diff --git a/lib/haml/engine.rb b/lib/haml/engine.rb index <HASH>..<HASH> 100644 --- a/lib/haml/engine.rb +++ b/lib/haml/engine.rb @@ -135,7 +135,7 @@ module Haml count, line = count_soft_tabs(line) suppress_render = handle_multiline(count, line, index) - if !suppress_render && count && line + if !suppress_render && count && line && (line.strip.size > 0) count, line = process_line(count, line, index) end end
This fixes the "blank line is not ignored" bug that has been around for a while. This was reported by Steve Ross. git-svn-id: svn://hamptoncatlin.com/haml/branches/edge@<I> <I>b-<I>-<I>-af8c-cdc<I>e<I>b9
sass_ruby-sass
train
rb
d347c4b5e2584f51bd7ed6defa8fe24d0033e186
diff --git a/src/main/resources/SparkContext.js b/src/main/resources/SparkContext.js index <HASH>..<HASH> 100644 --- a/src/main/resources/SparkContext.js +++ b/src/main/resources/SparkContext.js @@ -283,20 +283,20 @@ with (imported) { */ SparkContext.prototype.accumulator = function() { var initialValue = arguments[0]; - var name = null; + var name; var param = new FloatAccumulatorParam(); this.logger.debug("accumulator " + initialValue); - if (typeof arguments[1] === "string" ) { - name = arguments[1]; - if (arguments[2]) { - param = arguments[2]; - } - } else { - if (arguments[1]) { + if (arguments[1]) { + if (typeof arguments[1] === "string") { + name = arguments[1]; + if (arguments[2]) { + param = arguments[2]; + } + } else { param = arguments[1]; } - } + } return new Accumulator(initialValue, param, name); };
#<I> name should be undefined instead of null
EclairJS_eclairjs
train
js
d0eafce59475e2f0dab4d5f397e9e0cdd120711d
diff --git a/lang/en/quiz.php b/lang/en/quiz.php index <HASH>..<HASH> 100644 --- a/lang/en/quiz.php +++ b/lang/en/quiz.php @@ -273,7 +273,7 @@ $string['penalty'] = 'Penalty'; $string['penaltyfactor'] = 'Penalty factor'; $string['penaltyscheme'] = 'Apply penalties'; $string['percentcorrect'] = 'Percent Correct'; -$string['popup'] = 'Show quiz in a \"secure\" window'; +$string['popup'] = 'Show quiz in a &quot;secure&quot; window'; $string['popupnotice'] = 'Students will see this quiz in a secure window'; $string['preview'] = 'Preview'; $string['previewquestion'] = 'Preview question';
These quotes were going into (quoted) HTML attributes and breaking XHTML.
moodle_moodle
train
php
9fe57230962e828be2b43f5f88c7d775720ae0a8
diff --git a/lib/player.js b/lib/player.js index <HASH>..<HASH> 100644 --- a/lib/player.js +++ b/lib/player.js @@ -433,10 +433,12 @@ shaka.Player.prototype.configure = function(config) { for (var kind in chosen) { if ((kind == 'audio' && audioLangChanged) || (kind == 'text' && textLangChanged)) { - if (this.switchingPeriods_) + if (this.switchingPeriods_) { this.deferredSwitches_[kind] = chosen[kind]; - else - this.streamingEngine_.switch(kind, chosen[kind]); + } else { + this.streamingEngine_.switch(kind, chosen[kind], + /* clearBuffer */ true); + } } } }
Always clear buffer when changing languages Otherwise, language changes do not take effect immediately. Change-Id: Idfd2ea<I>aa4d<I>bf0da9ab<I>f<I>
google_shaka-player
train
js
d851a07f8c6db2e53beba456913d18f5eb061f08
diff --git a/src/createDispatcher.js b/src/createDispatcher.js index <HASH>..<HASH> 100644 --- a/src/createDispatcher.js +++ b/src/createDispatcher.js @@ -130,8 +130,7 @@ Dispatcher.prototype.next = function next(arg) { const { middlewares, scheduler } = this let agenda = toObservable(arg) .subscribeOn(scheduler) - .publishReplay() - .refCount() + .share() for (let i = 0; i < middlewares.length; i++) { const middleware = middlewares[i] @@ -143,7 +142,9 @@ Dispatcher.prototype.next = function next(arg) { } return this.rawNext(agenda - .filter(Boolean)) + .filter(Boolean) + .publishReplay() + .refCount()) } export default function createDispatcher(opts, middlewares) {
Share middleware agenda and replay agendas
kitten_fluorine
train
js
b09bbec83dd222a7d3f51c983642b466072b0ebd
diff --git a/tests/Convert/Converters/AbstractConverters/AbstractConverterTest.php b/tests/Convert/Converters/AbstractConverters/AbstractConverterTest.php index <HASH>..<HASH> 100644 --- a/tests/Convert/Converters/AbstractConverters/AbstractConverterTest.php +++ b/tests/Convert/Converters/AbstractConverters/AbstractConverterTest.php @@ -25,5 +25,16 @@ class AbstractConverterTest extends TestCase { $this->assertEquals('image/jpeg', AbstractConverter::getMimeType(self::$imgDir . '/test.jpg')); $this->assertEquals('image/png', AbstractConverter::getMimeType(self::$imgDir . '/test.png')); + + $mimeTypeMaybeDetected = AbstractConverter::getMimeType(self::$imgDir . '/png-without-extension'); + if ($mimeTypeMaybeDetected === false) { + // It was not detected, and that is ok! + // - it is not possible to detect mime type on all platforms. In case it could not be detected, + // - and file extension could not be mapped either, the method returns false. + $this->addToAssertionCount(1); + } else { + $this->assertEquals('image/png', $mimeTypeMaybeDetected); + } + } }
Added testing when mimetype might not be detected. #<I>
rosell-dk_webp-convert
train
php
1060193d3f89b40cf85c6d5fb6a78fa3b9fbeb35
diff --git a/lib/discordrb/light/integrations.rb b/lib/discordrb/light/integrations.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/light/integrations.rb +++ b/lib/discordrb/light/integrations.rb @@ -20,10 +20,13 @@ module Discordrb::Light # @!visibility private def initialize(data, bot) @bot = bot + @revoked = data['revoked'] @type = data['type'] @name = data['name'] @id = data['id'] + + @integrations = data['integrations'].map { |e| Integration.new(e, self, bot) } end end
Parse the integrations in the Connection initializer
meew0_discordrb
train
rb
fd2cf49fdec6b9c364f37f5ef10cffc2cafc654b
diff --git a/lib/order.js b/lib/order.js index <HASH>..<HASH> 100644 --- a/lib/order.js +++ b/lib/order.js @@ -38,7 +38,7 @@ Order.get = function(client, id, callback){ }; Order.list = function(client, query, callback){ - if(arguments.length === 1){ + if(arguments.length === 2){ callback = query; query = client; client = new Client();
fix order listing issue (#<I>) * fix order listing issue * disable prettier
Bandwidth_node-bandwidth-iris
train
js
d9433f9b0a42cd0470e5addaf40a65451cee8c8d
diff --git a/src/ORM/Query.php b/src/ORM/Query.php index <HASH>..<HASH> 100644 --- a/src/ORM/Query.php +++ b/src/ORM/Query.php @@ -720,7 +720,7 @@ class Query extends DatabaseQuery implements JsonSerializable } $count = ['count' => $query->func()->count('*')]; - $complex = count($query->clause('group')) || $query->clause('distinct'); + $complex = count($query->clause('group')) || $query->clause('distinct') || $query->clause('having'); $complex = $complex || count($query->clause('union')); if (!$complex) {
Adding having clause as another complex condition
cakephp_cakephp
train
php
74d841bb7a8704745333af40ef45b065673e32ea
diff --git a/packages/runner/src/iframe/iframe-model.js b/packages/runner/src/iframe/iframe-model.js index <HASH>..<HASH> 100644 --- a/packages/runner/src/iframe/iframe-model.js +++ b/packages/runner/src/iframe/iframe-model.js @@ -51,8 +51,8 @@ export default class IframeModel { this.state.url = url } - _updateLoading = (loading) => { - this.state.loading = loading + _updateLoading = (isLoading) => { + this.state.isLoading = isLoading } _clearMessage = () => {
runner: fix loading spinner not displaying correctly
cypress-io_cypress
train
js
8cbab62d394b45551f0153d33030223919470bfe
diff --git a/tests/bitExpert/Http/Middleware/Psr7/Prophiler/ProphilerMiddlewareUnitTest.php b/tests/bitExpert/Http/Middleware/Psr7/Prophiler/ProphilerMiddlewareUnitTest.php index <HASH>..<HASH> 100644 --- a/tests/bitExpert/Http/Middleware/Psr7/Prophiler/ProphilerMiddlewareUnitTest.php +++ b/tests/bitExpert/Http/Middleware/Psr7/Prophiler/ProphilerMiddlewareUnitTest.php @@ -154,8 +154,6 @@ class ProphilerMiddlewareUnitTest extends \PHPUnit_Framework_TestCase ->method('getHeaderLine') ->will($this->returnValue('text/html')); - $this->middleware->__invoke($this->request, $this->response); - } }
Fixed Codesniffer issues.
bitExpert_prophiler-psr7-middleware
train
php
66ddf4852fdf6344b8dcdc18b46be3925e83c552
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -66,7 +66,7 @@ const DOCKER_COUCHBASE = 'couchbase:6.6.0'; const DOCKER_CASSANDRA = 'cassandra:3.11.9'; const DOCKER_MSSQL = 'mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04'; const DOCKER_NEO4J = 'neo4j:4.2.1'; -const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:4.2020.10'; +const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:4.2020.12'; const DOCKER_MEMCACHED = 'memcached:1.6.9-alpine'; const DOCKER_REDIS = 'redis:6.0.9'; const DOCKER_KEYCLOAK = 'jboss/keycloak:11.0.1'; // The version should match the attribute 'keycloakVersion' from /docker-compose/templates/realm-config/jhipster-realm.json.ejs and /server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs
Update hazelcast/management-center docker image version to <I>
jhipster_generator-jhipster
train
js
564fd73438e5669ff8aff1baf02cd0cafa1f7b72
diff --git a/ProxyMiddleware/ProxyMiddleware.py b/ProxyMiddleware/ProxyMiddleware.py index <HASH>..<HASH> 100644 --- a/ProxyMiddleware/ProxyMiddleware.py +++ b/ProxyMiddleware/ProxyMiddleware.py @@ -5,7 +5,7 @@ # from functools import wraps -from bottle import redirect, abort, request, HTTPError +from bottle import redirect, abort, request, HTTPError, response class ReverseProxied(object): """ @@ -73,3 +73,17 @@ def force_slash(fn): else: redirect(request.environ['SCRIPT_NAME'] + request.environ['PATH_INFO'] + '/') return wrapped + +class ClickJackingPlugin(object): + name = "ClickJackingPlugin" + api = 2 + keyword = "clickjack" + + def setup(self, app): + pass + + def apply(self, callback, route): + def wrapper(*args, **kwargs): + response.set_header('X-Frame-Options', "SAMEORIGIN") + return callback(*args, **kwargs) + return wrapper
Added Anticlickjacking bottle plugin This whole module is bottle dependent who am i kidding
Kellel_ProxyMiddleware
train
py
cd5489b0857e68b0e9fd74106e2cc92c337e65fe
diff --git a/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java b/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java +++ b/server/src/main/java/io/atomix/copycat/server/state/AbstractAppender.java @@ -335,7 +335,7 @@ abstract class AbstractAppender implements AutoCloseable { resetNextIndex(member); // If there are more entries to send then attempt to send another commit. - if (hasMoreEntries(member)) { + if (response.logIndex() != request.logIndex() && hasMoreEntries(member)) { appendEntries(member); } }
Prevent infinite recursion in failed AppendRequest responses.
atomix_copycat
train
java
124e8adb1c71f1d3e250680df4549697269c53d1
diff --git a/lib/specjour/dispatcher.rb b/lib/specjour/dispatcher.rb index <HASH>..<HASH> 100644 --- a/lib/specjour/dispatcher.rb +++ b/lib/specjour/dispatcher.rb @@ -117,9 +117,7 @@ module Specjour raise Timeout::Error end rescue Timeout::Error - if replies.any? - replies.each {|r| resolve_reply(r)} - end + replies.each {|r| resolve_reply(r)} end def local_manager_needed?
Get clever with arrays. Don't check, just run!
sandro_specjour
train
rb
8576f994dcdb42fc5557fdf9e225471b19c9995c
diff --git a/code/extensions/RichLinksExtension.php b/code/extensions/RichLinksExtension.php index <HASH>..<HASH> 100644 --- a/code/extensions/RichLinksExtension.php +++ b/code/extensions/RichLinksExtension.php @@ -40,8 +40,8 @@ class RichLinksExtension extends Extension { } // Inject extra attributes into the external links. - $pattern = '/(<a.*)(href=\"http:\/\/[^\"]*\"[^>]*>.*<\/a>)/iU'; - $replacement = '$1class="external" rel="external" $2'; + $pattern = '/(<a.*)(href=\"http:\/\/[^\"]*\"[^>]*>.*)(<\/a>)/iU'; + $replacement = '$1class="external" rel="external" $2 <span class="nonvisual-indicator">(external link)</span> $3'; $content = preg_replace($pattern, $replacement, $content, -1); return $content;
Added non-CSS display of external links
silverstripe_cwp
train
php
b4f1de87d8f6d6337376f2d045141814aabac6f4
diff --git a/x10_any.py b/x10_any.py index <HASH>..<HASH> 100644 --- a/x10_any.py +++ b/x10_any.py @@ -18,6 +18,8 @@ class X10InvalidHouseCode(X10BaseException): def normalize_housecode(house_code): if house_code is None: raise X10InvalidHouseCode('%r is not a valid house code' % house_code) + if len(house_code) != 1: + raise X10InvalidHouseCode('%r is not a valid house code' % house_code) house_code = house_code.upper() if not ('A' <= house_code <= 'P'): raise X10InvalidHouseCode('%r is not a valid house code' % house_code)
Validation of house code ready for larger testing/use
clach04_x10_any
train
py
d2a8189738f067987504befb08304bd043e62323
diff --git a/pyt/__main__.py b/pyt/__main__.py index <HASH>..<HASH> 100644 --- a/pyt/__main__.py +++ b/pyt/__main__.py @@ -65,11 +65,9 @@ def retrieve_nosec_lines( def main(command_line_args=sys.argv[1:]): # noqa: C901 args = parse_args(command_line_args) - ui_mode = UImode.NORMAL + ui_mode = UImode.TRIM if args.interactive: ui_mode = UImode.INTERACTIVE - elif args.trim_reassigned_in: - ui_mode = UImode.TRIM files = discover_files( args.targets,
Removed reference to UImode.NORMAL
python-security_pyt
train
py
1bcf76eb231d10937665096354b76bc8cba5b641
diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/base.py +++ b/openquake/calculators/base.py @@ -31,8 +31,9 @@ import numpy from openquake.hazardlib.geo import geodetic from openquake.baselib import general, hdf5 from openquake.baselib.performance import Monitor +from openquake.risklib import riskinput, __version__ from openquake.commonlib import readinput, riskmodels, datastore, source -from openquake.commonlib.oqvalidation import OqParam, __version__ +from openquake.commonlib.oqvalidation import OqParam from openquake.commonlib.parallel import starmap, executor from openquake.commonlib.views import view, rst_table, stats from openquake.baselib.python3compat import with_metaclass
Fixed an import Former-commit-id: <I>e1a<I>efea6b2f<I>ae<I>b<I>e6a<I>bc<I>
gem_oq-engine
train
py
d1e3205569f11fcb0d9867dd68de781478c4c7f6
diff --git a/core/server/api/v0.1/oembed.js b/core/server/api/v0.1/oembed.js index <HASH>..<HASH> 100644 --- a/core/server/api/v0.1/oembed.js +++ b/core/server/api/v0.1/oembed.js @@ -44,7 +44,8 @@ const oembed = { function unknownProvider() { return Promise.reject(new common.errors.ValidationError({ - message: common.i18n.t('errors.api.oembed.unknownProvider') + message: common.i18n.t('errors.api.oembed.unknownProvider'), + context: url })); } diff --git a/core/server/api/v2/oembed.js b/core/server/api/v2/oembed.js index <HASH>..<HASH> 100644 --- a/core/server/api/v2/oembed.js +++ b/core/server/api/v2/oembed.js @@ -52,7 +52,8 @@ module.exports = { function unknownProvider() { return Promise.reject(new common.errors.ValidationError({ - message: common.i18n.t('errors.api.oembed.unknownProvider') + message: common.i18n.t('errors.api.oembed.unknownProvider'), + context: url })); }
Add url as context to oembed unknownProvider error - This is so that we can use logs to see urls that turn up with this error
TryGhost_Ghost
train
js,js
fefcf2664dc9ff99912e07171390066d55d1ea27
diff --git a/lib/dante/version.rb b/lib/dante/version.rb index <HASH>..<HASH> 100644 --- a/lib/dante/version.rb +++ b/lib/dante/version.rb @@ -1,3 +1,3 @@ module Dante - VERSION = "0.1.5" + VERSION = "0.2.0" end
Bump to <I> release!
nesquena_dante
train
rb
724c5f9c6fcbf492dced9d61c6db8eb3f266ad05
diff --git a/tests/test_cls_file.py b/tests/test_cls_file.py index <HASH>..<HASH> 100644 --- a/tests/test_cls_file.py +++ b/tests/test_cls_file.py @@ -44,6 +44,8 @@ class TestClassFile(unittest.TestCase): #f.delete() - + def test_99_main(self): + cl.TEST() + if __name__ == '__main__': unittest.main()
cls_file test calls TEST
acutesoftware_AIKIF
train
py
0d44aa9d6cb419ae570350392875f9389f16de0e
diff --git a/bw-util-xml/src/main/java/org/bedework/util/xml/tagdefs/BedeworkServerTags.java b/bw-util-xml/src/main/java/org/bedework/util/xml/tagdefs/BedeworkServerTags.java index <HASH>..<HASH> 100644 --- a/bw-util-xml/src/main/java/org/bedework/util/xml/tagdefs/BedeworkServerTags.java +++ b/bw-util-xml/src/main/java/org/bedework/util/xml/tagdefs/BedeworkServerTags.java @@ -79,6 +79,10 @@ public class BedeworkServerTags { public static final QName maxWebCalPeriod = new QName(bedeworkCaldavNamespace, "maxWebCalPeriod"); + /** */ + public static final QName synchAdminCreateEpropsProperty = new QName(bedeworkCaldavNamespace, + "org.bedework.synchAdminCreateEprops"); + /* used for property index */ /** */
Add a switch to admin client ui to control ability to create event properties (loc, contact, category) through the input stream. A number of changes to web support and caldav to support this.
Bedework_bw-util
train
java
d00f1c18eb2d113095e2d21d6876010a748037b0
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -29,12 +29,12 @@ module ActiveRecord relation end - def select(*args) + def select(value = nil) if block_given? to_a.select {|*block_args| yield(*block_args) } else relation = clone - relation.select_values += args if args.present? + relation.select_values += [value] if value relation end end
select does not need a *args
rails_rails
train
rb
278e79f5a8629f7d1b980cc5c66ada3d4ad432be
diff --git a/lib/restify/adapter/typhoeus.rb b/lib/restify/adapter/typhoeus.rb index <HASH>..<HASH> 100644 --- a/lib/restify/adapter/typhoeus.rb +++ b/lib/restify/adapter/typhoeus.rb @@ -43,7 +43,8 @@ module Restify req = convert(request, writer) if sync? - req.run + @hydra.queue(req) + @hydra.run else debug 'request:add', tag: request.object_id,
Use hydra for sync requests The typhoeus adapter has a `sync: true` options that runs requests inline in blocking fashion. This CL changes the internal implementation to also use the existing hydra object for these requests. Options that are set for hydra therefore apply to such requests too.
jgraichen_restify
train
rb
4cb4c7d6e0da2dddca3a40ff211d6b3d80fcc28c
diff --git a/salt/states/svn.py b/salt/states/svn.py index <HASH>..<HASH> 100644 --- a/salt/states/svn.py +++ b/salt/states/svn.py @@ -213,14 +213,14 @@ def export(name, ret, ('{0} doesn\'t exist and is set to be checked out.').format(target)) svn_cmd = 'svn.list' - opts += ('-r', 'HEAD') + rev = 'HEAD' out = __salt__[svn_cmd](cwd, target, user, username, password, *opts) return _neutral_test( ret, ('{0}').format(out)) if rev: - opts += ('-r', str(rev)) + rev = 'HEAD' if force: opts += ('--force',) @@ -231,7 +231,7 @@ def export(name, if trust: opts += ('--trust-server-cert',) - out = __salt__[svn_cmd](cwd, name, basename, user, username, password, *opts) + out = __salt__[svn_cmd](cwd, name, basename, user, username, password, rev, *opts) ret['changes'] = name + ' was Exported to ' + target return ret
changed salt call to modules/svn.py svn.export function, added revision field to function call argument list
saltstack_salt
train
py
6d6aaec1f7ae806224987e8c9a6bac7c79270025
diff --git a/pyqode/core/api/utils.py b/pyqode/core/api/utils.py index <HASH>..<HASH> 100644 --- a/pyqode/core/api/utils.py +++ b/pyqode/core/api/utils.py @@ -334,6 +334,8 @@ class TextHelper(object): """ Removes trailing whitespaces and ensure one single blank line at the end of the QTextDocument. + + ..deprecated: since pyqode 2.6.3, document is cleaned on disk only. """ editor = self._editor value = editor.verticalScrollBar().value() @@ -359,16 +361,16 @@ class TextHelper(object): removed.add(line + j) editor._modified_lines -= removed - # # ensure there is only one blank line left at the end of the file - # i = self.line_count() - # while i: - # line = self.line_text(i - 1) - # if line.strip(): - # break - # self.remove_last_line() - # i -= 1 - # if self.line_text(self.line_count() - 1): - # editor.appendPlainText('') + # ensure there is only one blank line left at the end of the file + i = self.line_count() + while i: + line = self.line_text(i - 1) + if line.strip(): + break + self.remove_last_line() + i -= 1 + if self.line_text(self.line_count() - 1): + editor.appendPlainText('') # restore cursor and scrollbars text_cursor = editor.textCursor()
Mark clean_document as deprecated
pyQode_pyqode.core
train
py
de1a059c72f02814a50e00dbc353bc19a5b0a37c
diff --git a/lib/plugin.template.js b/lib/plugin.template.js index <HASH>..<HASH> 100755 --- a/lib/plugin.template.js +++ b/lib/plugin.template.js @@ -19,8 +19,9 @@ const adsbygoogle = { 'data-analytics-uacct': this.analyticsUacct ? this.analyticsUacct : null, 'data-analytics-domain-name': this.analyticsDomainName ? this.analyticsDomainName : null, 'data-adtest': <%= options.test ? '\'on\'' : 'null' %>, - 'data-adsbygoogle-status': this.show ? null : '' - }, + 'data-adsbygoogle-status': this.show ? null : '', + 'data-full-width-responsive': this.fullWidthResponsive || null, + }, domProps: { innerHTML: this.show ? '' : ' ' }, @@ -68,6 +69,10 @@ const adsbygoogle = { includeQuery: { type: Boolean, default: <%= options.includeQuery %> + }, + fullWidthResponsive: { + type: Boolean, + default: false } }, data () {
feat: Add support for full width responsive prop (#<I>)
nuxt-community_google-adsense-module
train
js
4a9891b47b1d950ff5c239ccc6f40414c760c9a3
diff --git a/test/unit/test_service_models.py b/test/unit/test_service_models.py index <HASH>..<HASH> 100644 --- a/test/unit/test_service_models.py +++ b/test/unit/test_service_models.py @@ -398,9 +398,7 @@ class HostCollectionTest( ) self.host_factory_mock = self.host_factory_patcher.start() - side_effect = lru_cache()( - host_collection_host_factory - ) + side_effect = host_collection_host_factory self.host_factory_mock.side_effect = side_effect self.tested_instance = HostCollection('test_host_collection', self.classification)
Remove lru_cache decorator host_factory_mock used in HostCollectionTest Making sure host_collection_host_factory always returns the same instance of Mock for given host value is not necessary.
piotr-rusin_spam-lists
train
py
107e20520b8ea87f4730e00593a36a063d8da5c6
diff --git a/reef-common/src/main/java/com/microsoft/reef/util/EnvironmentUtils.java b/reef-common/src/main/java/com/microsoft/reef/util/EnvironmentUtils.java index <HASH>..<HASH> 100644 --- a/reef-common/src/main/java/com/microsoft/reef/util/EnvironmentUtils.java +++ b/reef-common/src/main/java/com/microsoft/reef/util/EnvironmentUtils.java @@ -38,7 +38,8 @@ public final class EnvironmentUtils { * @return A set of classpath entries as strings. */ public static Set<String> getAllClasspathJars() { - return getAllClasspathJars("JAVA_HOME", "YARN_HOME", "HADOOP_HOME"); + return getAllClasspathJars("JAVA_HOME", "YARN_HOME", "HADOOP_HOME", + "HADOOP_YARN_HOME", "HADOOP_COMMON_HOME", "HADOOP_MAPRED_HOME", "HADOOP_HDFS_HOME"); } /**
exclude more hadoop paths - used when uploading jars to the remote nodes
apache_reef
train
java
a4b657d093230a1c2357753ca6904edd9a34cb09
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index <HASH>..<HASH> 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -41,11 +41,21 @@ class Piwik_Goals extends Piwik_Plugin 'API.getReportMetadata.end' => 'getReportMetadata', 'WidgetsList.add' => 'addWidgets', 'Menu.add' => 'addMenus', + 'SitesManager.deleteSite' => 'deleteSiteGoals', ); return $hooks; } /** + * Delete goals recorded for this site + */ + function deleteSiteGoals($notification ) + { + $idSite = &$notification->getNotificationObject(); + Piwik_Query("DELETE FROM ".Piwik_Common::prefixTable('goal') . " WHERE idsite = ? ", array($idSite)); + } + + /** * Returns the Metadata for the Goals plugin API. * The API returns general Goal metrics: conv, conv rate and revenue globally * and for each goal.
Fixes #<I> Now, every entity linked to a site is deleted when a site is deleted. Only the logs and archives are not deleted, because it could result in severe data loss. Better deal with this later on.. git-svn-id: <URL>
matomo-org_matomo
train
php
798d10a328b0e30b07e7126a037a9083b7fbf9a7
diff --git a/atlassian/rest_client.py b/atlassian/rest_client.py index <HASH>..<HASH> 100644 --- a/atlassian/rest_client.py +++ b/atlassian/rest_client.py @@ -52,11 +52,11 @@ class AtlassianRestAPI(object): try: import kerberos as kerb except ImportError as e: - log.error(e) + log.debug(e) try: import kerberos_sspi as kerb except ImportError: - log.info("Please, fix issue with dependency of kerberos") + log.error("Please, fix issue with dependency of kerberos") return __, krb_context = kerb.authGSSClientInit(kerberos_service) kerb.authGSSClientStep(krb_context, "")
Loglevel of package imports adjusted.
atlassian-api_atlassian-python-api
train
py
14b390f4a49d6492ca57c77715ba1789d9b1035e
diff --git a/rgcompare.py b/rgcompare.py index <HASH>..<HASH> 100755 --- a/rgcompare.py +++ b/rgcompare.py @@ -247,7 +247,9 @@ class RobotComparison(Tk.Tk): self.mainloop() except KeyboardInterrupt: self.abort() - + finally: + for i,p in enumerate(self.processes): + self.task_queue.put('STOP') def initialize(self): print "Initialising with players",str(self.players)
Reverted accidental removal that resulted in zombie processes. (Thanks Sh4rK)
mueslo_rgcompare
train
py
48d5f902331f4883b8ade984628bc1f7cf55fe28
diff --git a/BimServer/src/org/bimserver/database/DatabaseSession.java b/BimServer/src/org/bimserver/database/DatabaseSession.java index <HASH>..<HASH> 100644 --- a/BimServer/src/org/bimserver/database/DatabaseSession.java +++ b/BimServer/src/org/bimserver/database/DatabaseSession.java @@ -1496,7 +1496,7 @@ public class DatabaseSession implements LazyLoader, OidProvider { buffer.putShort(cid); IdEObject idEObject = (IdEObject) value; if (idEObject.getOid() == -1) { - ((IdEObjectImpl)idEObject).setOid(newOid()); + ((IdEObjectImpl)idEObject).setOid(newOid(object.eClass())); ((IdEObjectImpl)idEObject).setPid(object.getPid()); ((IdEObjectImpl)idEObject).setRid(object.getRid()); }
Merge conflict with myself ?!?
opensourceBIM_BIMserver
train
java
a65430811ca824492f928f218256fbb3909f8d5b
diff --git a/src/main/java/org/gitlab4j/api/ProjectApi.java b/src/main/java/org/gitlab4j/api/ProjectApi.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -1127,9 +1127,8 @@ public class ProjectApi extends AbstractApi implements Constants { * @param projectId the project ID to get team member for * @param userId the user ID of the member * @return the member specified by the project ID/user ID pair - * @throws GitLabApiException if any exception occurs */ - public Optional<Member> getOptionalMember(Integer projectId, Integer userId) throws GitLabApiException { + public Optional<Member> getOptionalMember(Integer projectId, Integer userId) { try { return (Optional.ofNullable(getMember(projectId, userId))); } catch (GitLabApiException glae) {
Removed throws clause fro getOptionalMember() (#<I>).
gmessner_gitlab4j-api
train
java
7ba3ea9d2ce054ab6f9d4450a66787ec04807e3d
diff --git a/gui.go b/gui.go index <HASH>..<HASH> 100644 --- a/gui.go +++ b/gui.go @@ -84,8 +84,8 @@ func NewGui(mode OutputMode) (*Gui, error) { g.maxX, g.maxY = termbox.Size() - g.BgColor, g.FgColor = ColorBlack, ColorWhite - g.SelBgColor, g.SelFgColor = ColorBlack, ColorWhite + g.BgColor, g.FgColor = ColorDefault, ColorDefault + g.SelBgColor, g.SelFgColor = ColorDefault, ColorDefault return g, nil }
Use ColorDefault as default bg and fg color
jroimartin_gocui
train
go
f965c621ea14199cad039642cec49b2e0626aa70
diff --git a/interp/interp_test.go b/interp/interp_test.go index <HASH>..<HASH> 100644 --- a/interp/interp_test.go +++ b/interp/interp_test.go @@ -3713,6 +3713,8 @@ func TestElapsedString(t *testing.T) { true, "610.00", }, + {31 * time.Second, false, "0m31.000s"}, + {102 * time.Second, false, "1m42.000s"}, } for _, tc := range tests { t.Run(tc.in.String(), func(t *testing.T) { diff --git a/interp/runner.go b/interp/runner.go index <HASH>..<HASH> 100644 --- a/interp/runner.go +++ b/interp/runner.go @@ -709,7 +709,7 @@ func elapsedString(d time.Duration, posix bool) string { return fmt.Sprintf("%.2f", d.Seconds()) } min := int(d.Minutes()) - sec := math.Remainder(d.Seconds(), 60.0) + sec := math.Mod(d.Seconds(), 60.0) return fmt.Sprintf("%dm%.3fs", min, sec) }
interp: avoid negative elapsed durations in the time builtin Change the operation to calculate the elapsed seconds from Remainder to Mod, as Remainder can return negative values. Fixes #<I>.
mvdan_sh
train
go,go
da65a4a1150b30ee5d9797b4dda6c0efd1e943a9
diff --git a/ecs-init/volumes/efs_mount_helper.go b/ecs-init/volumes/efs_mount_helper.go index <HASH>..<HASH> 100644 --- a/ecs-init/volumes/efs_mount_helper.go +++ b/ecs-init/volumes/efs_mount_helper.go @@ -92,7 +92,9 @@ func getPath(binary string) (string, error) { var runUnmount = runUnmountCommand func runUnmountCommand(path string, target string) error { - umountCmd := exec.Command(path, target) + // In case of awsvpc network mode, when we unmount the volume, task network namespace has been deleted + // and nfs server is no longer reachable, so umount will hang. Hence doing lazy unmount here. + umountCmd := exec.Command(path, "-l", target) return runCmd(umountCmd) }
Lazy unmount efs volume. In case of awsvpc network mode, when we unmount the volume, task network namespace has been deleted and nfs server is no longer reachable, so umount will hang. Hence doing lazy unmount.
aws_amazon-ecs-agent
train
go
0b4729ff688b6bc7a2d1a01b5497e8bb5920144d
diff --git a/client/index.js b/client/index.js index <HASH>..<HASH> 100644 --- a/client/index.js +++ b/client/index.js @@ -79,7 +79,8 @@ var onSocketMsg = { }, "log-level": function(level) { var hotCtx = require.context("webpack/hot", false, /^\.\/log$/); - if(hotCtx.keys().length > 0) { + var contextKeys = hotCtx.keys(); + if(contextKeys.length && contextKeys["./log"]) { hotCtx("./log").setLogLevel(level); } switch(level) {
Proposed fix for ./log module not found (#<I>) * Proposed fix for ./log module not found * Fixed code * Replaces spaces with tabs..
webpack_webpack-dev-server
train
js
6c6e45a4cd7243e6f331883384f9b159edcadce2
diff --git a/lib/ohai/mixin/os.rb b/lib/ohai/mixin/os.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/mixin/os.rb +++ b/lib/ohai/mixin/os.rb @@ -73,7 +73,7 @@ module Ohai # if it was not caught above, we MUST translate whatever train uses as the 'os' into the proper ruby host_os # string. If it is not unix and not caught above we assume it is something like a REST API which cannot run # ruby. If these assumptions are incorrect then it is a bug, which should be submitted to fix it, and the - # values should not be relied upon until that bug is fixed. The train os is NEVER considered authoritataive + # values should not be relied upon until that bug is fixed. The train os is NEVER considered authoritative # for any target which can run ruby. # when transport_connection.os.unix?
Update lib/ohai/mixin/os.rb
chef_ohai
train
rb
84d007a39266bc8dcf1db85a6552af998bb93da6
diff --git a/src/main/java/com/hmsonline/trident/cql/incremental/CassandraCqlIncrementalState.java b/src/main/java/com/hmsonline/trident/cql/incremental/CassandraCqlIncrementalState.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hmsonline/trident/cql/incremental/CassandraCqlIncrementalState.java +++ b/src/main/java/com/hmsonline/trident/cql/incremental/CassandraCqlIncrementalState.java @@ -39,7 +39,13 @@ public class CassandraCqlIncrementalState<K, V> implements State { Statement readStatement = mapper.read(entry.getKey()); ResultSet resultSet = clientFactory.getSession().execute(readStatement); V persistedValue = mapper.currentValue(resultSet); - V combinedValue = aggregator.combine(entry.getValue(), persistedValue); + V combinedValue; + // TODO: more elegant solution to this issue + // Must be careful here as the first persisted value might not exist yet! + if ( persistedValue != null ) + combinedValue = aggregator.combine(entry.getValue(), persistedValue); + else + combinedValue = entry.getValue(); Statement updateStatement = mapper.update(entry.getKey(), combinedValue); clientFactory.getSession().execute(updateStatement); }
Checked for null persisted value for new dbs
hmsonline_storm-cassandra-cql
train
java
4837ed0c149073bc970f46e9aa0c36f896559e3a
diff --git a/src/Growl.php b/src/Growl.php index <HASH>..<HASH> 100644 --- a/src/Growl.php +++ b/src/Growl.php @@ -47,17 +47,16 @@ class Growl } /** - * Implement the __call magic method to provide an expressive way of setting - * options for commands. + * Set options for Builders with a key/value. * - * @param string $name The name of the method called. - * @param array $args An array of the supplied arguments. + * @param string $key The key. + * @param array $value The value of the key. * * @return $this */ - public function __call($name, $args) + public function set($key, $value) { - $this->options[$name] = $args[0]; + $this->options[$key] = $value; return $this; }
Use set() method instead of __call magic method
bcrowe_growl
train
php
c4bac50ac9b226de3cc9b9c56bd573ebf6a656c4
diff --git a/lib/jsdom/browser/domtohtml.js b/lib/jsdom/browser/domtohtml.js index <HASH>..<HASH> 100644 --- a/lib/jsdom/browser/domtohtml.js +++ b/lib/jsdom/browser/domtohtml.js @@ -92,15 +92,15 @@ var stringifyElement = function(element) { var formatHTML = function(html) { var formatted = '', reg = /(>)(<)(\/*)/g, - html = html.replace(reg, '$1\r\n$2$3'), pad = 0, tags = []; - for (i in singleTags) { + for (var i in singleTags) { tags.push(i); } tags = '<' + tags.join('|<'); + html = html.replace(/(<(\/?\w+).*?>)(?=<(?!\/\2))/gi, '$1\r\n'); html.split('\r\n').forEach(function(node, index) { var indent = 0, padding = '', i;
Don't break and indent empty tags, especially <textarea></textarea> as the resulting whitespace would be interpreted as literal field-value by the browser.
jsdom_jsdom
train
js
9e3f11589fd840f4bd380d49cb0f15efd35eeb62
diff --git a/satin/aapp1b.py b/satin/aapp1b.py index <HASH>..<HASH> 100644 --- a/satin/aapp1b.py +++ b/satin/aapp1b.py @@ -72,9 +72,13 @@ def load_avhrr(satscene, options): if len(file_list) > 1: raise IOError("More than one l1b file matching!") elif len(file_list) == 0: - raise IOError("No l1b file matching!") + raise IOError("No l1b file matching!: "+ + satscene.time_slot.strftime(filename)) + filename = file_list[0] + + LOG.debug("Loading from " + filename) avh = avhrr.avhrr(filename) avh.get_unprojected()
Cosmetics: enhanced error description and debug message in aapp1b, giving names to loaded/missing files.
pytroll_satpy
train
py
8bec833173841debbc60b3e66c114830c22ac657
diff --git a/Cake/Utility/Inflector.php b/Cake/Utility/Inflector.php index <HASH>..<HASH> 100644 --- a/Cake/Utility/Inflector.php +++ b/Cake/Utility/Inflector.php @@ -715,7 +715,7 @@ class Inflector { sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); - $string = str_replace(array_keys(self::$_transliteration), array_values(self::$_transliteration), $string); + $string = str_replace(array_keys(static::$_transliteration), array_values(static::$_transliteration), $string); return preg_replace(array_keys($map), array_values($map), $string); }
changes calls from self:: to static:: in Inflector::slug
cakephp_cakephp
train
php
f58489ef838437e2f021a8829008ec7e708e60ca
diff --git a/lib/prey/agent.js b/lib/prey/agent.js index <HASH>..<HASH> 100644 --- a/lib/prey/agent.js +++ b/lib/prey/agent.js @@ -158,7 +158,7 @@ var Agent = self = { if (!err){ - program.connection_found = connected; + program.connection_found = true; hooks.trigger('connection_found'); if (callback) callback(true);
Fixed program.connection_found setter.
prey_prey-node-client
train
js
2125f23e199562914c49ca3310d07c7954805704
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -3924,6 +3924,9 @@ function get_assignable_roles ($context, $field="name") { $roles[$r->id] = $r->{$field}; } } + foreach ($roles as $roleid => $rolename) { + $roles[$roleid] = strip_tags(format_string($rolename, true)); + } return $roles; }
Make sure that the role names gets filtered in get_assignable_roles()
moodle_moodle
train
php
1ede6a8d123995d13aac87efd3bff22973b2dc5c
diff --git a/packages/react-dev-utils/formatWebpackMessages.js b/packages/react-dev-utils/formatWebpackMessages.js index <HASH>..<HASH> 100644 --- a/packages/react-dev-utils/formatWebpackMessages.js +++ b/packages/react-dev-utils/formatWebpackMessages.js @@ -177,6 +177,11 @@ function formatWebpackMessages(json) { // preceding a much more useful Babel syntax error. result.errors = result.errors.filter(isLikelyASyntaxError); } + // Only keep the first error. Others are often indicative + // of the same problem, but confuse the reader with noise. + if (result.errors.length > 1) { + result.errors.length = 1; + } return result; }
Only show first error (#<I>)
vcarl_create-react-app
train
js
4e5c9372113656866b5cd6ad01a8e57fc5f5af52
diff --git a/sos/sosreport.py b/sos/sosreport.py index <HASH>..<HASH> 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -35,6 +35,7 @@ supplied for application-specific information import sys import traceback import os +import errno import logging from optparse import OptionParser, Option from sos.plugins import import_plugin @@ -903,17 +904,24 @@ class SoSReport(object): self.soslog.error("%s\n%s" % (plugin_name, traceback.format_exc())) def prework(self): + self.policy.pre_work() try: - self.policy.pre_work() self.ui_log.info(_(" Setting up archive ...")) self._set_archive() self._make_archive_paths() + return + except OSError as e: + if e.errno in (errno.ENOSPC, errno.EROFS): + self.ui_log.error("") + self.ui_log.error(" %s while setting up archive" % e.strerror) + self.ui_log.error(" %s" % e.filename) except Exception as e: import traceback + self.ui_log.error("") self.ui_log.error(" Unexpected exception setting up archive:") traceback.print_exc(e) self.ui_log.error(e) - self._exit(1) + self._exit(1) def setup(self): self.ui_log.info(_(" Setting up plugins ..."))
Check for file system errors when setting up archive Check for ENOSPC and EROFS when setting up the archive directory structure and exit with failure and an error message.
sosreport_sos
train
py
ff5b81fecb3eed950a469fe38d89ea2f09269b44
diff --git a/examples/providers/factory_attribute_injections.py b/examples/providers/factory_attribute_injections.py index <HASH>..<HASH> 100644 --- a/examples/providers/factory_attribute_injections.py +++ b/examples/providers/factory_attribute_injections.py @@ -17,7 +17,7 @@ class Container(containers.DeclarativeContainer): client = providers.Factory(Client) service = providers.Factory(Service) - service.add_attributes(clent=client) + service.add_attributes(client=client) if __name__ == '__main__':
Fixed a typo in Factory provider docs "service.add_attributes(clent=client)" #<I> (#<I>)
ets-labs_python-dependency-injector
train
py
0f003866d320e0bd962c05d67ddd00baf8050912
diff --git a/component/DateTimePicker.js b/component/DateTimePicker.js index <HASH>..<HASH> 100644 --- a/component/DateTimePicker.js +++ b/component/DateTimePicker.js @@ -46,7 +46,7 @@ class DateTimePicker extends Component { handleDateChange(date){ let {hour, minute, second} = this.state // intialize default time - if (!hour || !minute || !second) { + if (hour === undefined || minute === undefined || second === undefined) { let nowDateObj = extractDate(new Date(), { showTime: true }) hour = nowDateObj.hour minute = nowDateObj.minute diff --git a/lib/DateTimePicker.js b/lib/DateTimePicker.js index <HASH>..<HASH> 100644 --- a/lib/DateTimePicker.js +++ b/lib/DateTimePicker.js @@ -81,7 +81,7 @@ var DateTimePicker = function (_Component) { second = _state.second; // intialize default time - if (!hour || !minute || !second) { + if (hour === undefined || minute === undefined || second === undefined) { var nowDateObj = extractDate(new Date(), { showTime: true }); hour = nowDateObj.hour; minute = nowDateObj.minute;
fixes #<I> Datetime picker initial value error when hour, minute or second is 0
jerryshew_react-component
train
js,js
6e91fb20388111cb2dadee6adb9f55487a251f64
diff --git a/lib/Core/Site/Values/Location.php b/lib/Core/Site/Values/Location.php index <HASH>..<HASH> 100644 --- a/lib/Core/Site/Values/Location.php +++ b/lib/Core/Site/Values/Location.php @@ -216,8 +216,9 @@ final class Location extends APILocation private function getContent() { if ($this->internalContent === null) { - $this->internalContent = $this->site->getLoadService()->loadContent( - $this->contentInfo->id + $this->internalContent = $this->domainObjectMapper->mapContent( + $this->innerVersionInfo, + $this->languageCode ); }
Use DomainObjectMapper to obtain Location's Content
netgen_ezplatform-site-api
train
php
76b966446fdf8eaa50651989e32fee7606471eef
diff --git a/dist/chef/sa-monitoring/libraries/sa-monitoring.rb b/dist/chef/sa-monitoring/libraries/sa-monitoring.rb index <HASH>..<HASH> 100644 --- a/dist/chef/sa-monitoring/libraries/sa-monitoring.rb +++ b/dist/chef/sa-monitoring/libraries/sa-monitoring.rb @@ -17,7 +17,7 @@ module SAM config.merge!(databag) - return config + JSON.pretty_generate(config) end end
config will be pretty generated json
sensu_sensu
train
rb
d7daf485fca6498c44da7afb5edb3f1f512b9a85
diff --git a/client/lib/i18n-utils/switch-locale.js b/client/lib/i18n-utils/switch-locale.js index <HASH>..<HASH> 100644 --- a/client/lib/i18n-utils/switch-locale.js +++ b/client/lib/i18n-utils/switch-locale.js @@ -24,6 +24,7 @@ function languageFileUrl( localeSlug ) { function setLocaleInDOM( localeSlug, isRTL ) { document.documentElement.lang = localeSlug; document.documentElement.dir = isRTL ? 'rtl' : 'ltr'; + document.body.classList[ isRTL ? 'add' : 'remove' ]( 'rtl' ); const directionFlag = isRTL ? '-rtl' : ''; const debugFlag = process.env.NODE_ENV === 'development' ? '-debug' : '';
When switching locale at runtime, modify the body element's LTR/RTL class (#<I>) In RTL mode, the `body` element is expected to have a `rtl` CSS class. This patch ensures that the class is added/removed when switching locales dynamically at runtime. Some styles, i.e., the ones that horizontally flip Gridicon arrows, depend on the `body.rtl` class being present.
Automattic_wp-calypso
train
js
64e42663136280a28969bc17f48403d7fcd9d264
diff --git a/flux_led/models_db.py b/flux_led/models_db.py index <HASH>..<HASH> 100755 --- a/flux_led/models_db.py +++ b/flux_led/models_db.py @@ -1012,10 +1012,14 @@ MODELS = [ model_num=0x44, # v8 - AK001-ZJ200 aka old flux # v9 - AK001-ZJ210 + # v10.49 - AK001-ZJ2101 models=["AK001-ZJ200", "AK001-ZJ210"], description="Bulb RGBW", always_writes_white_and_colors=False, # Formerly rgbwprotocol - protocols=[MinVersionProtocol(0, PROTOCOL_LEDENET_8BYTE)], + protocols=[ + MinVersionProtocol(0, PROTOCOL_LEDENET_8BYTE), + MinVersionProtocol(10, PROTOCOL_LEDENET_8BYTE_AUTO_ON), + ], mode_to_color_mode={}, color_modes=COLOR_MODES_RGB_W, # Formerly rgbwcapable channel_map={},
Add newer 0x<I> bulb to the database (#<I>)
Danielhiversen_flux_led
train
py
75e6623d9ca81893964b3ded0cf181410d8f6d48
diff --git a/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/atom/MatchDatabase.java b/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/atom/MatchDatabase.java index <HASH>..<HASH> 100644 --- a/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/atom/MatchDatabase.java +++ b/languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/atom/MatchDatabase.java @@ -73,7 +73,14 @@ class MatchDatabase { prepSt.setLong(10, ruleMatch.getDiffId()); prepSt.execute(); } catch (SQLException e) { - throw new RuntimeException("Could not add rule match " + ruleMatch + " to database", e); + if (e.toString().contains("Incorrect string value")) { + // Let's accept this - i.e. not crash - for now: + // See http://stackoverflow.com/questions/1168036/ and http://stackoverflow.com/questions/10957238/ + System.err.println("Could not add rule match " + ruleMatch + " to database - stacktrace follows:"); + e.printStackTrace(); + } else { + throw new RuntimeException("Could not add rule match " + ruleMatch + " to database", e); + } } }
feed checker: don't crash on "Incorrect string value" MySQL problem, just log it
languagetool-org_languagetool
train
java
7196fc85e6f02ae06f9bc6168ebcc87830cef6af
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -553,7 +553,8 @@ transports.sse = function(uri, params) { } }); // #### Aborting the transport - // Aborts the current request. + // Aborts the current request. The rest of work, firing the close + // event, will be done by `error` event handler. transport.abort = function() { req.abort(); };
Found which event handler fires close event
vibe-project_vibe-protocol
train
js
cd96b11b41f29b03fde6c1ff13cce5c69f1534ad
diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index <HASH>..<HASH> 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -2165,6 +2165,8 @@ } this._xhr = $.ajax(request) } + + return data } initSearchText () { @@ -3009,9 +3011,8 @@ if (params && params.pageSize) { this.options.pageSize = params.pageSize } - this.initServer(params && params.silent, - params && params.query, params && params.url) - this.trigger('refresh', params) + this.trigger('refresh', this.initServer(params && params.silent, + params && params.query, params && params.url)) } resetWidth () {
ref #<I>: Updated refresh event params.
wenzhixin_bootstrap-table
train
js
4af8215b6d57cd3e3344be0e426755d288b628df
diff --git a/client/selfrepair/self_repair_runner.js b/client/selfrepair/self_repair_runner.js index <HASH>..<HASH> 100644 --- a/client/selfrepair/self_repair_runner.js +++ b/client/selfrepair/self_repair_runner.js @@ -1,5 +1,3 @@ -import uuid from 'node-uuid'; - import JexlEnvironment from './JexlEnvironment.js'; const registeredActions = {}; @@ -58,21 +56,6 @@ export function fetchAction(recipe) { } fetchAction._cache = {}; - -/** - * Get a user id. If one doesn't exist yet, make one up and store it in local storage. - * @return {String} A stored or generated UUID - */ -export function getUserId() { - let userId = localStorage.getItem('userId'); - if (userId === null) { - userId = uuid.v4(); - localStorage.setItem('userId', userId); - } - return userId; -} - - /** * Fetch all enabled recipes from the server. * @promise Resolves with a list of all enabled recipes. @@ -134,7 +117,7 @@ export async function filterContext(driver) { return { normandy: { locale: driver.locale, - userId: getUserId(), + userId: driver.userId, ...client, ...classification, },
Removed uuid stuff from self repair runner
mozilla_normandy
train
js
41fd181f1da93975fcd8513995d98771d4de26f7
diff --git a/remi/server.py b/remi/server.py index <HASH>..<HASH> 100644 --- a/remi/server.py +++ b/remi/server.py @@ -417,6 +417,9 @@ class App(BaseHTTPRequestHandler, object): - file requests """ + re_static_file = re.compile(r"^/*res\/(.*)$") + re_attr_call = re.compile(r"^\/*(\w+)\/(\w+)\?{0,1}(\w*\={1}\w+\${0,1})*$") + def __init__(self, request, client_address, server, **app_args): self._app_args = app_args self.client = None @@ -828,8 +831,8 @@ function uploadFile(widgetID, eventSuccess, eventFail, eventData, file){ def _process_all(self, function): self.log.debug('get: %s' % function) - static_file = re.match(r"^/*res\/(.*)$", function) - attr_call = re.match(r"^\/*(\w+)\/(\w+)\?{0,1}(\w*\={1}\w+\${0,1})*$", function) + static_file = self.re_static_file.match(function) + attr_call = self.re_attr_call.match(function) if (function == '/') or (not function): # build the root page once if necessary should_call_main = not hasattr(self.client, 'root')
static: cache regexs for speed
dddomodossola_remi
train
py
3abfc2c904a9501f0f2b777c38520d4fde7a961a
diff --git a/salt/states/dockerio.py b/salt/states/dockerio.py index <HASH>..<HASH> 100644 --- a/salt/states/dockerio.py +++ b/salt/states/dockerio.py @@ -459,8 +459,8 @@ def run(name, docked_onlyif=None, docked_unless=None, *args, **kwargs): - '''Run a command in a specific container - + ''' + Run a command in a specific container You can match by either name or hostname @@ -487,9 +487,10 @@ def run(name, ''' if hostname: - salt.utils.warn_until((0, 19), - 'The argument \'hostname\' argument' - ' has been deprecated.') + salt.utils.warn_until( + 'Helium', + 'The \'hostname\' argument has been deprecated.' + ) retcode = __salt__['docker.retcode'] drun_all = __salt__['docker.run_all'] valid = functools.partial(_valid, name=name)
Fix warn_until call This is pointing at a release using the old versioning scheme.
saltstack_salt
train
py
067e1c56c3c270fcb361680900c47ae8e6add002
diff --git a/upload/system/library/language.php b/upload/system/library/language.php index <HASH>..<HASH> 100644 --- a/upload/system/library/language.php +++ b/upload/system/library/language.php @@ -15,6 +15,16 @@ class Language { public function set($key, $value) { $this->data[$key] = $value; } + + // Please dont use the below function i'm thinking getting rid of it. + public function all() { + return $this->data; + } + + // Please dont use the below function i'm thinking getting rid of it. + public function merge(&$data) { + array_merge($this->data, $data); + } public function load($filename, &$data = array()) { $_ = array();
Added back language methods for <I>.x rc version Although 3.x will be the next release, updated <I>.x rc version to support language all() and merge() methods again. 3.x may not contain these methods so modules should prepare and remove for that release but backwards support added back for this branch.
opencart_opencart
train
php
b4340c78fde9197f73041cba46517eb9e7e35cef
diff --git a/conf.py b/conf.py index <HASH>..<HASH> 100644 --- a/conf.py +++ b/conf.py @@ -34,7 +34,7 @@ extensions = [ 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', - 'sphinxcontrib.napoleon' + 'sphinx.ext.napoleon' ] # Add any paths that contain templates here, relative to this directory.
Switched to sphinx.ext.napoleon from sphinxcontrib.napoleon
CalebBell_fluids
train
py
c3be0de9ce2e8644f8bf3a718b411326cda8d693
diff --git a/ipyrad/assemble/utils.py b/ipyrad/assemble/utils.py index <HASH>..<HASH> 100644 --- a/ipyrad/assemble/utils.py +++ b/ipyrad/assemble/utils.py @@ -13,6 +13,7 @@ except ImportError: izip = zip import os +import sys import socket import pandas as pd import numpy as np @@ -39,6 +40,7 @@ class IPyradError(Exception): Exception.__init__(self, *args, **kwargs) else: # clean exit for CLI that still exits as an Error (e.g. for HPC) + sys.tracebacklimit = 0 SystemExit(1)
no traceback in CLI unless debug
dereneaton_ipyrad
train
py
448447068e0886d24528f66e278f6a81332cd7b2
diff --git a/src/client/js/main.js b/src/client/js/main.js index <HASH>..<HASH> 100644 --- a/src/client/js/main.js +++ b/src/client/js/main.js @@ -256,17 +256,17 @@ require( var rootNode; - NodeService.on(context, 'initialize', function(c) { - NodeService.loadNode(context, '') + NodeService.on(context, 'initialize', function(currentContext) { + NodeService.loadNode(currentContext, '') .then(function (node) { rootNode = node; console.log(node); - console.log(context); + console.log(currentContext); //console.log(c); }); }); - NodeService.on(context, 'destroy', function(c) { + NodeService.on(context, 'destroy', function(currentContext) { rootNode = null; }); });
Fix suggested usage. Former-commit-id: <I>ed<I>b<I>ebe1d2c4c<I>d<I>b8cffc<I>e<I>
webgme_webgme-engine
train
js
87d16aeb041d45f4f8144e9f1984d02120dd1095
diff --git a/plugins/Dashboard/templates/dashboardWidget.js b/plugins/Dashboard/templates/dashboardWidget.js index <HASH>..<HASH> 100755 --- a/plugins/Dashboard/templates/dashboardWidget.js +++ b/plugins/Dashboard/templates/dashboardWidget.js @@ -120,7 +120,7 @@ var currentWidget = this.element; $('body').on('click.dashboardWidget', function (ev) { - if (ev.target.className == "ui-widget-overlay") { + if (/ui-widget-overlay/.test(ev.target.className)) { $(currentWidget).dialog("close"); } });
refs #<I> fixed maximised widgets not closing on click outside
matomo-org_matomo
train
js
0f2e64165845d584b179d02fb9d113128f248ff4
diff --git a/vendor/document-title/document-title.js b/vendor/document-title/document-title.js index <HASH>..<HASH> 100644 --- a/vendor/document-title/document-title.js +++ b/vendor/document-title/document-title.js @@ -80,13 +80,13 @@ Ember.Router.reopen({ setTitle: function(title) { var container = getOwner ? getOwner(this) : this.container; var renderer = container.lookup('renderer:-dom'); + var domForAppWithGlimmer2 = container.lookup('service:-document'); if (renderer && renderer._dom) { Ember.set(renderer, '_dom.document.title', title); - } else if (renderer && renderer._env && renderer._env.getDOM) { + } else if (domForAppWithGlimmer2) { // Glimmer 2 has a different renderer - var dom = renderer._env.getDOM(); - Ember.set(dom, 'document.title', title); + Ember.set(domForAppWithGlimmer2, 'title', title); } else { document.title = title; }
Fix setting title in fastboot with glimmer2
kimroen_ember-cli-document-title
train
js
9d3196511d4ba45493f6d4e48eab18d01606c202
diff --git a/lib/IDS/Log/Email.php b/lib/IDS/Log/Email.php index <HASH>..<HASH> 100644 --- a/lib/IDS/Log/Email.php +++ b/lib/IDS/Log/Email.php @@ -215,17 +215,15 @@ class IDS_Log_Email implements IDS_Log_Interface * loop through all files in the tmp directory and * delete garbage files */ - $dir = $this->tmp_path; + $dir = $this->tmp_path; $numPrefixChars = strlen($this->file_prefix); - $files = scandir($dir); + $files = scandir($dir); foreach ($files as $file) { - if (is_file($dir . $file)) { + if (is_file($dir . DIRECTORY_SEPARATOR . $file)) { if (substr($file, 0, $numPrefixChars) == $this->file_prefix) { - $lastModified = filemtime($dir . $file); - - if (( - time() - $lastModified) > 3600) { - unlink($dir . $file); + $lastModified = filemtime($dir . DIRECTORY_SEPARATOR . $file); + if ((time() - $lastModified) > 3600) { + unlink($dir . DIRECTORY_SEPARATOR . $file); } } }
* fixed a problem in the IDS Email Logger spotted and fix-suggested by ampt
PHPIDS_PHPIDS
train
php
485badcc312c8cbebbcd85baee0ff8e08327608c
diff --git a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/XsdGeneratorHelper.java b/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/XsdGeneratorHelper.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/XsdGeneratorHelper.java +++ b/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/XsdGeneratorHelper.java @@ -58,6 +58,7 @@ import java.io.Reader; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -544,8 +545,13 @@ public final class XsdGeneratorHelper { FACTORY = TransformerFactory.newInstance(); // Harmonize XML formatting - FACTORY.setAttribute("indent-number", 2); - + for(String currentAttributeName : Arrays.asList("indent-number", OutputKeys.INDENT)) { + try { + FACTORY.setAttribute(currentAttributeName, 2); + } catch(IllegalArgumentException ex) { + // Ignore this. + } + } } catch (Throwable exception) { // This should really not happen... but it seems to happen in some test cases.
Fixes #<I>. Ignored any exceptions from the TransformerFactory when setting the indent level. Also implemented testing out 2 candidates for indentation attribute.
mojohaus_jaxb2-maven-plugin
train
java
b4dede9fb026f53fcd30e48b49eec32b6da4a67b
diff --git a/skyfield/data/earth_orientation.py b/skyfield/data/earth_orientation.py index <HASH>..<HASH> 100644 --- a/skyfield/data/earth_orientation.py +++ b/skyfield/data/earth_orientation.py @@ -16,7 +16,7 @@ def morrison_and_stephenson_2004_table(): def usno_historic_delta_t(): import pandas as pd f = load.open('http://maia.usno.navy.mil/ser7/historic_deltat.data') - df = pd.read_table(f, sep=rb' +', engine='python', skiprows=[1]) + df = pd.read_table(f, sep=b' +', engine='python', skiprows=[1]) return pd.DataFrame({'year': df[b'Year'], 'delta_t': df[b'TDT-UT1']}) def main():
Fix string to be compatible with py<I> (#<I>)
skyfielders_python-skyfield
train
py
33fb13043cc11453f4c91661ee92367f3db6549a
diff --git a/discord/mentions.py b/discord/mentions.py index <HASH>..<HASH> 100644 --- a/discord/mentions.py +++ b/discord/mentions.py @@ -68,6 +68,22 @@ class AllowedMentions: self.users = users self.roles = roles + @classmethod + def all(cls): + """A factory method that returns a :class:`AllowedMentions` with all fields explicitly set to ``True`` + + .. versionadded:: 1.5 + """ + return cls(everyone=True, users=True, roles=True) + + @classmethod + def none(cls): + """A factory method that returns a :class:`AllowedMentions` with all fields set to ``False`` + + .. versionadded:: 1.5 + """ + return cls(everyone=False, users=False, roles=False) + def to_dict(self): parse = [] data = {}
Classmethods all and none for AllowedMentions
Rapptz_discord.py
train
py
d1af395718c92ae1390f893af44ea8a4b9d9384d
diff --git a/testrail/helper.py b/testrail/helper.py index <HASH>..<HASH> 100644 --- a/testrail/helper.py +++ b/testrail/helper.py @@ -30,6 +30,8 @@ def class_name(meth): def singleresult(func): def func_wrapper(*args, **kw): items = func(*args) + if hasattr(items, '__iter__'): + items = list(items) if len(items) > 1: raise TestRailError( 'identifier "%s" returned multiple results' % args[1])
Update singleresult to correctly handle iterators - closes #<I> - Updates singleresult function to detect when an interator has been passed in, and transform it into a list
travispavek_testrail-python
train
py
70d94f999d00fe62382598818b97f65ff377489f
diff --git a/src/Checks/Production/XDebugIsNotEnabled.php b/src/Checks/Production/XDebugIsNotEnabled.php index <HASH>..<HASH> 100644 --- a/src/Checks/Production/XDebugIsNotEnabled.php +++ b/src/Checks/Production/XDebugIsNotEnabled.php @@ -24,7 +24,7 @@ class XDebugIsNotEnabled implements Check */ public function check(): bool { - return extension_loaded('xdebug') === true; + return extension_loaded('xdebug') === false; } /** @@ -36,4 +36,4 @@ class XDebugIsNotEnabled implements Check { return 'You should not have the "xdebug" PHP extension activated in production.'; } -} \ No newline at end of file +}
Fix conditional logic in XDebugIsNotEnabled Check should pass if extension is not loaded
beyondcode_laravel-self-diagnosis
train
php
7ce5df192358d4cdc64136360d9cbdeeac33aac0
diff --git a/lib/fuzz/cache.rb b/lib/fuzz/cache.rb index <HASH>..<HASH> 100644 --- a/lib/fuzz/cache.rb +++ b/lib/fuzz/cache.rb @@ -2,7 +2,7 @@ require "fileutils" class Fuzz::Cache def initialize(cache_file) - @cache_file = cache_file + @cache_file = File.expand_path(cache_file) @entries = cache_entries(@cache_file) end diff --git a/lib/fuzz/version.rb b/lib/fuzz/version.rb index <HASH>..<HASH> 100644 --- a/lib/fuzz/version.rb +++ b/lib/fuzz/version.rb @@ -1,3 +1,3 @@ module Fuzz - VERSION = "0.1.0" + VERSION = "0.1.1" end
Expand cache file path This lets us use `~` and other shortcuts in our cache paths.
hrs_fuzz
train
rb,rb
6608bac67ab9991aa8d9ba68adfcf9d56a51347e
diff --git a/Neos.Flow/Tests/Functional/I18n/Cldr/Reader/DatesReaderTest.php b/Neos.Flow/Tests/Functional/I18n/Cldr/Reader/DatesReaderTest.php index <HASH>..<HASH> 100644 --- a/Neos.Flow/Tests/Functional/I18n/Cldr/Reader/DatesReaderTest.php +++ b/Neos.Flow/Tests/Functional/I18n/Cldr/Reader/DatesReaderTest.php @@ -53,6 +53,6 @@ class DatesReaderTest extends FunctionalTestCase self::assertEquals('M/d/yy, h:mm a', $convertFormatToString($enUSFormat)); $deFormat = $this->datesReader->parseFormatFromCldr(new Locale('de'), DatesReader::FORMAT_TYPE_DATETIME, DatesReader::FORMAT_LENGTH_SHORT); - self::assertEquals('dd.MM.yy HH:mm', $convertFormatToString($deFormat)); + self::assertEquals('dd.MM.yy, HH:mm', $convertFormatToString($deFormat)); } }
TASK: Update test pattern after CLDR update
neos_flow-development-collection
train
php
2fd6cdbd8aa22293281dc6de494d3e6aefe80af6
diff --git a/tests/pyy_html_tests/attributes.py b/tests/pyy_html_tests/attributes.py index <HASH>..<HASH> 100644 --- a/tests/pyy_html_tests/attributes.py +++ b/tests/pyy_html_tests/attributes.py @@ -17,7 +17,9 @@ Public License along with pyy. If not, see ''' import unittest -from pyy_html.html import img +from pyy_html.html import * +from pyy_html.util import * + class AttributeTests(unittest.TestCase): def testAddViaDict(self): @@ -31,4 +33,10 @@ class AttributeTests(unittest.TestCase): def testBooleanAttribute(self): i = img(test=True) - self.assertEqual(str(i), '<img test="test" />') \ No newline at end of file + self.assertEqual(str(i), '<img test="test" />') + + def testUtils(self): + d = div() + d += pipe('echo hi') + self.assertEqual(str(d), '<div>\n\thi\n\n</div>') +
added #<I> to test cases
Knio_dominate
train
py
8235471ee4c900c41208c83bd24d765a44c2fb06
diff --git a/lib/puppet/network/formats.rb b/lib/puppet/network/formats.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/network/formats.rb +++ b/lib/puppet/network/formats.rb @@ -38,6 +38,10 @@ end Puppet::Network::FormatHandler.create_serialized_formats(:b64_zlib_yaml) do require 'base64' + def issue_deprecation_warning + Puppet.deprecation_warning("The b64_zlib_yaml format is deprecated and will be removed in a future release. See http://links.puppetlabs.com/deprecate_yaml_on_network") + end + def use_zlib? Puppet.features.zlib? && Puppet[:zlib] end @@ -51,22 +55,30 @@ Puppet::Network::FormatHandler.create_serialized_formats(:b64_zlib_yaml) do end def intern(klass, text) + issue_deprecation_warning + requiring_zlib do Puppet::Network::FormatHandler.format(:yaml).intern(klass, decode(text)) end end def intern_multiple(klass, text) + issue_deprecation_warning + requiring_zlib do Puppet::Network::FormatHandler.format(:yaml).intern_multiple(klass, decode(text)) end end def render(instance) + issue_deprecation_warning + encode(instance.to_yaml) end def render_multiple(instances) + issue_deprecation_warning + encode(instances.to_yaml) end
(#<I>) Issue deprecation warning for b<I>_zlib_yaml
puppetlabs_puppet
train
rb
ce33711479d52ddf21b5799bc13411d8713eed24
diff --git a/lib/iord/crud.rb b/lib/iord/crud.rb index <HASH>..<HASH> 100644 --- a/lib/iord/crud.rb +++ b/lib/iord/crud.rb @@ -19,6 +19,9 @@ module Iord def index @collection = resource_class.all + index! + end + def index! respond_to do |format| format.html { render } formats(format) @@ -26,6 +29,9 @@ module Iord end def show + show! + end + def show! respond_to do |format| format.html { render } formats(format) @@ -39,6 +45,9 @@ module Iord @resource.public_send "build_#{name}".to_sym end end + new! + end + def new! respond_to do |format| format.html { render } formats(format) @@ -46,6 +55,9 @@ module Iord end def edit + edit! + end + def edit! respond_to do |format| format.html { render } formats(format) @@ -54,10 +66,8 @@ module Iord def create @resource = resource_class.new resource_params - create! end - def create! respond_to do |format| if @resource.save @@ -73,6 +83,9 @@ module Iord def update @resource.update_attributes resource_params + update! + end + def update! respond_to do |format| if @resource.save flash[:notice] = t('iord.flash.update.notice', model: resource_name)
added a lot more customization in crud
Aethelflaed_iord
train
rb
e8cc539a34b53e13348aafbee04de91204f65332
diff --git a/api/python/quilt3/packages.py b/api/python/quilt3/packages.py index <HASH>..<HASH> 100644 --- a/api/python/quilt3/packages.py +++ b/api/python/quilt3/packages.py @@ -1,5 +1,4 @@ from collections import deque -import binascii import copy import hashlib import io @@ -68,15 +67,16 @@ def _delete_local_physical_key(pk): def _filesystem_safe_encode(key): - """Encodes the key as hex. This ensures there are no slashes, uppercase/lowercase conflicts, etc.""" - return binascii.hexlify(key.encode()).decode() + """Returns the sha256 of the key. This ensures there are no slashes, uppercase/lowercase conflicts, + avoids `OSError: [Errno 36] File name too long:`, etc.""" + return hashlib.sha256(key.encode()).hexdigest() class ObjectPathCache(object): @classmethod def _cache_path(cls, url): - prefix = '%08x' % binascii.crc32(url.encode()) - return CACHE_PATH / prefix / _filesystem_safe_encode(url) + url_hash = _filesystem_safe_encode(url) + return CACHE_PATH / url_hash[0:2] / url_hash[2:] @classmethod def get(cls, url):
Use sha<I> hashes when caching files (#<I>) Hex encoding can result in filenames that are too long.
quiltdata_quilt
train
py
c2827e659d487b1b298a8d3478866253170db2f7
diff --git a/idiotic/util/blocks/random.py b/idiotic/util/blocks/random.py index <HASH>..<HASH> 100644 --- a/idiotic/util/blocks/random.py +++ b/idiotic/util/blocks/random.py @@ -1,3 +1,4 @@ +import asyncio import random from idiotic import block from idiotic import resource
Added missing import of asyncio
idiotic_idiotic
train
py
172c943f45ca9398c02c4048fa8d279d6d9ea45c
diff --git a/gnosis/eth/utils.py b/gnosis/eth/utils.py index <HASH>..<HASH> 100644 --- a/gnosis/eth/utils.py +++ b/gnosis/eth/utils.py @@ -65,11 +65,12 @@ def decode_string_or_bytes32(data: bytes) -> str: def remove_swarm_metadata(code: bytes) -> bytes: """ Remove swarm metadata from Solidity bytecode + :param code: :return: Code without metadata """ swarm = b"\xa1\x65bzzr0" - position = code.find(swarm) + position = code.rfind(swarm) if position == -1: raise ValueError("Swarm metadata not found in code %s" % code.hex()) return code[:position] @@ -78,6 +79,7 @@ def remove_swarm_metadata(code: bytes) -> bytes: def compare_byte_code(code_1: bytes, code_2: bytes) -> bool: """ Compare code, removing swarm metadata if necessary + :param code_1: :param code_2: :return: True if same code, False otherwise
Fix proxy validation vulnerability Other contracts could be injected. Take a look at <URL>
gnosis_gnosis-py
train
py
c5dfb94a28c8a67873eda8db59158bd65b726afa
diff --git a/addon/components/md-modal.js b/addon/components/md-modal.js index <HASH>..<HASH> 100644 --- a/addon/components/md-modal.js +++ b/addon/components/md-modal.js @@ -21,7 +21,7 @@ export default Ember.Component.extend(UsesSettings, { isFooterFixed: oneWay('_mdSettings.modalIsFooterFixed'), modalClassNames: ['modal', 'show'], - _modalClassString: computed('modalClassNames.@each', 'isFooterFixed', { + _modalClassString: computed('modalClassNames.[]', 'isFooterFixed', { get() { let names = this.get('modalClassNames'); if (this.get('isFooterFixed')) {
Replaced '@each' computed property with '[]' (fixes #<I>)
mike-north_ember-cli-materialize
train
js