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
d28d5d2736d112321d1c5e61abdd88739982c3d8
diff --git a/app/concerns/liquid_interpolatable.rb b/app/concerns/liquid_interpolatable.rb index <HASH>..<HASH> 100644 --- a/app/concerns/liquid_interpolatable.rb +++ b/app/concerns/liquid_interpolatable.rb @@ -111,7 +111,7 @@ module LiquidInterpolatable class Context < Liquid::Context def initialize(agent) - super({}, {}, { agent: agent }, true) + super({}, { '_agent_' => agent }, { agent: agent }, true) end def hash diff --git a/spec/concerns/liquid_interpolatable_spec.rb b/spec/concerns/liquid_interpolatable_spec.rb index <HASH>..<HASH> 100644 --- a/spec/concerns/liquid_interpolatable_spec.rb +++ b/spec/concerns/liquid_interpolatable_spec.rb @@ -430,4 +430,13 @@ HTML expect(@filter.group_by("some string", "anything")).to eq("some string") end end + + describe '_agent_' do + let(:agent) { Agents::InterpolatableAgent.new(name: 'test', options: { 'foo' => '{{bar}}' }) } + + it 'computes digest values from string input' do + agent.options['template'] = 'name={{ _agent_.name }} foo={{ _agent_.options.foo }}' + expect(agent.interpolated['template']).to eq 'name=test foo={{bar}}' + end + end end
Add a Liquid variable referring to the agent itself as `_agent_`
huginn_huginn
train
rb,rb
fb78a0c9495d6791b4633805c0bd0054154315fd
diff --git a/tasks/lib/compass.js b/tasks/lib/compass.js index <HASH>..<HASH> 100644 --- a/tasks/lib/compass.js +++ b/tasks/lib/compass.js @@ -54,7 +54,7 @@ exports.init = function (grunt) { // a string as argument, but either an inline-ruby block (which we don't // support) or a `:none` symbol to disable it. if (options[option] === false) { - raw += underscoredOption + ' :none'; + raw += underscoredOption + ' :none' + '\n'; } delete options[option]; return true;
Update compass.js I've spotted an issue (line #<I>) when you set the assetCacheBuster to false cause the corresponding Ruby option, asset_cache_buster, is created without a '\n' at the end.
gruntjs_grunt-contrib-compass
train
js
e4331e013211ca74802997324110a2075d641142
diff --git a/src/main/java/io/robe/hibernate/entity/BaseEntity.java b/src/main/java/io/robe/hibernate/entity/BaseEntity.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/robe/hibernate/entity/BaseEntity.java +++ b/src/main/java/io/robe/hibernate/entity/BaseEntity.java @@ -6,6 +6,10 @@ import javax.persistence.*; import java.io.Serializable; import java.util.Date; +/** + * An abstract Entity implementation. All entities have to extend this class. + * Standard fields (oid,lastupdated) will be added to your entity. + */ @MappedSuperclass public abstract class BaseEntity implements Serializable {
ROBE-1 Javadocs and refactoring
robeio_robe
train
java
a094003e53ea88bb4670541e206d50934f36ee77
diff --git a/src/com/opera/core/systems/runner/launcher/OperaLauncherBinary.java b/src/com/opera/core/systems/runner/launcher/OperaLauncherBinary.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/runner/launcher/OperaLauncherBinary.java +++ b/src/com/opera/core/systems/runner/launcher/OperaLauncherBinary.java @@ -113,7 +113,7 @@ public class OperaLauncherBinary extends Thread { if (r == -1) { return; } else if (r == '\n') { - logger.finer("linebreak: " + buffer); + logger.finest("line break: " + buffer); buffer = ""; } else { buffer += (char) r;
Reducing logging level for line break notice in OperaLauncherBinary
operasoftware_operaprestodriver
train
java
b29c8a0157c0aa0594524b988f3309493d1a54b8
diff --git a/org/postgresql/Connection.java b/org/postgresql/Connection.java index <HASH>..<HASH> 100644 --- a/org/postgresql/Connection.java +++ b/org/postgresql/Connection.java @@ -267,7 +267,8 @@ public abstract class Connection // firstWarning = null; - java.sql.ResultSet initrset = ExecSQL("set datestyle to 'ISO'; select getdatabaseencoding()"); + java.sql.ResultSet initrset = ExecSQL("set datestyle to 'ISO'; " + + "select case when pg_encoding_to_char(1) = 'SQL_ASCII' then 'UNKNOWN' else getdatabaseencoding() end"); String dbEncoding = null; //retrieve DB properties @@ -319,6 +320,11 @@ public abstract class Connection } else if (dbEncoding.equals("WIN")) { dbEncoding = "Cp1252"; + } else if (dbEncoding.equals("UNKNOWN")) { + //This isn't a multibyte database so we don't have an encoding to use + //We leave dbEncoding null which will cause the default encoding for the + //JVM to be used + dbEncoding = null; } else { dbEncoding = null; }
The following patch for JDBC fixes an issue with jdbc running on a non-multibyte database loosing 8bit characters. This patch will cause the jdbc driver to ignore the encoding reported by the database when multibyte isn't enabled and use the JVM default in that case. Barry Lind
pgjdbc_pgjdbc
train
java
ddf22f6a7403c6285ac04b6a0d03a8dd5bfbd9e2
diff --git a/addon/components/sl-calendar.js b/addon/components/sl-calendar.js index <HASH>..<HASH> 100755 --- a/addon/components/sl-calendar.js +++ b/addon/components/sl-calendar.js @@ -537,7 +537,8 @@ export default Ember.Component.extend({ days.push({ active, content: active ? - contentDates[ year ][ month ][ day ] : null, + contentDates[ year ][ month ][ day ] : + null, day: day++, 'new': inNextMonth, old: inPreviousMonth
Place null ternary else statement on new line
softlayer_sl-ember-components
train
js
d2549e60cd9b86e311ff04d58e7ca6fc2b24aba7
diff --git a/tests/test_requests.py b/tests/test_requests.py index <HASH>..<HASH> 100644 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -200,7 +200,7 @@ def test_redirect_compiles_url(): app.bind('Request', REQUEST) request = app.make('Request').load_app(app) - request.redirect('test/url') + request.redirect('/test/url') assert request.compile_route_to_url() == '/test/url'
fixed redirection tets to be more likely scenario
MasoniteFramework_masonite
train
py
de928be5828fe66cf0f3c41e1933ecda5ae8a6f6
diff --git a/torrent.go b/torrent.go index <HASH>..<HASH> 100644 --- a/torrent.go +++ b/torrent.go @@ -1515,7 +1515,6 @@ func (t *Torrent) cancelRequestsForPiece(piece int) { } func (t *Torrent) onPieceCompleted(piece int) { - t.pendingPieces.Remove(piece) t.pendAllChunkSpecs(piece) t.cancelRequestsForPiece(piece) for conn := range t.conns {
Remove premature update to piece priority after piece is completed This should have prevented Torrent.piecePriorityChanged from being called, meaning requests for the completed piece were not canceled, and the piece remained in connection's piece request queue, which meant wasted effort downloading chunks for an already acquired piece.
anacrolix_torrent
train
go
82779e69d778d254bf330cc31f4b24455189981e
diff --git a/bin/static/config/initializers/03_mqtt_socketService.js b/bin/static/config/initializers/03_mqtt_socketService.js index <HASH>..<HASH> 100644 --- a/bin/static/config/initializers/03_mqtt_socketService.js +++ b/bin/static/config/initializers/03_mqtt_socketService.js @@ -44,8 +44,11 @@ module.exports = function () { }, function (err, session, user) { // eslint-disable-line handle-callback-err if (!user) { conn.connack({ - returnCode: 5 + // Connection Refused, not authorized + returnCode: 0x05 }) + // send an appropriate CONNACK response with a non-zero return code as described in section 3.2 and it MUST close the Network Connection [MQTT-3.1.4] + conn.end() } else { socketService.startListening(emitter, sessionId, session, user) conn.connack({
need to close to prevent stray connections
SciSpike_yaktor
train
js
b38dc84fd10e7f22df7a880692bc586384f69f2d
diff --git a/bcbio/variation/vcfanno.py b/bcbio/variation/vcfanno.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/vcfanno.py +++ b/bcbio/variation/vcfanno.py @@ -116,7 +116,7 @@ def find_annotations(data, retriever=None): elif not retriever: conffn = os.path.join(annodir, conf_file + ".conf") else: - conffn = conf_file + ".conf" + conffn = os.path.join(dd.get_genome_build(data), "config", "vcfanno", conf_file + ".conf") luafn = "%s.lua" % utils.splitext_plus(conffn)[0] if retriever: conffn, luafn = [(x if objectstore.is_remote(x) else None)
Remote support for looking up vcfanno configs with multiple genomes Ensure remove vcfanno lookups are keyed on genome of interest. Fixes #<I>
bcbio_bcbio-nextgen
train
py
f5d572c2aaa6db7273cdb75c2324077038c50bac
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ long_description = read('README.rst') # Core dependencies install_requires = [ 'future', + 'docutils==0.13.1', # currently pinned in conjunction with Sphinx 'Sphinx>=1.5.0,<1.6.0', 'PyYAML', 'sphinx-prompt',
Pin docutils==<I> This is necessary because the Sphinx>=<I>,<<I> constraint effectively requires docutils <I>, but this isn't rigorously enforced by Sphinx's own requirements. This pin will need to change when we upgrade to the Sphinx <I> series.
lsst-sqre_documenteer
train
py
68fd8878ba5a5f6c4f2ee54a65cc3886806e3501
diff --git a/gcs/requests.go b/gcs/requests.go index <HASH>..<HASH> 100644 --- a/gcs/requests.go +++ b/gcs/requests.go @@ -282,4 +282,8 @@ type DeleteObjectRequest struct { // The generation of the object to delete. Zero means the latest generation. Generation int64 + + // If non-nil, the request will fail without effect if the current + // meta-generation for the name is not equal to the given value. + MetaGenerationPrecondition *int64 }
Added DeleteObjectRequest.MetaGenerationPrecondition.
jacobsa_gcloud
train
go
b154f449b8c4a67929f36cba07f58a218acd99e9
diff --git a/lib/netext/tracer.go b/lib/netext/tracer.go index <HASH>..<HASH> 100644 --- a/lib/netext/tracer.go +++ b/lib/netext/tracer.go @@ -264,9 +264,9 @@ func (t *Tracer) GotConn(info httptrace.GotConnInfo) { // request and any body. It may be called multiple times // in the case of retried requests. func (t *Tracer) WroteRequest(info httptrace.WroteRequestInfo) { - atomic.StoreInt64(&t.wroteRequest, now()) - - if info.Err != nil { + if info.Err == nil { + atomic.StoreInt64(&t.wroteRequest, now()) + } else { t.addError(info.Err) } }
Only trace WroteRequest events when there's no error
loadimpact_k6
train
go
573714a6194a52a8b1b2cd376a92f2b97120341d
diff --git a/src/main/webapp/scripts/jquery.notifications.js b/src/main/webapp/scripts/jquery.notifications.js index <HASH>..<HASH> 100644 --- a/src/main/webapp/scripts/jquery.notifications.js +++ b/src/main/webapp/scripts/jquery.notifications.js @@ -18,6 +18,7 @@ // Cache existing DOM elements var portlet = this.find(".notification-portlet-wrapper"), + outerContainer = this.selector, links = this.find(".notification-portlet a"), errorContainer = this.find(".notification-error-container"), loading = this.find(".notification-loading"), @@ -86,7 +87,7 @@ // Once notifications have been injected into the DOM // we cache the notication element... - notification = $(".notifications a"); + notification = $(outerContainer + " .notifications a"); // ...and bind our events bindEvent.accordion(data);
NOJIRA: Fix JS bug where clicking an item with 2 notice portlets on the page would drill-down in both portlets git-svn-id: <URL>
Jasig_NotificationPortlet
train
js
4939f95c9b0c1e68b442c94640831e05eff15a32
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index <HASH>..<HASH> 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1465,8 +1465,7 @@ module ActiveRecord after_destroy(method_name) end - def find_with_associations(options = {}, join_dependency = nil) - join_dependency ||= JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins]) + def find_with_associations(options, join_dependency) rows = select_all_rows(options, join_dependency) join_dependency.instantiate(rows) rescue ThrowResult
Reapply "Remove optional join_dependency argument as Relation always supplies it" - Now without syntax errors
rails_rails
train
rb
6fadd54383f8a30417781e2e0b53d4333bfb5dec
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -71,10 +71,13 @@ setup( description=DESCRIPTION, long_description=readme, url=URL, + download_url='https://github.com/pavdmyt/yaspin/archive/master.zip', packages=find_packages(exclude=('tests', 'docs', 'examples')), include_package_data=True, tests_require=tests_require, cmdclass={'test': PyTest}, + keywords='progressmeter progress meter rate console terminal console cli' + ' loading loader indicator spinner spinners time busy wait idle', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console',
add download_url and keywords to setup.py
pavdmyt_yaspin
train
py
30e99d5f30dcc34c680f69338a6424284993912d
diff --git a/pmml-model/src/main/java/org/dmg/pmml/neural_network/HasNormalizationMethod.java b/pmml-model/src/main/java/org/dmg/pmml/neural_network/HasNormalizationMethod.java index <HASH>..<HASH> 100644 --- a/pmml-model/src/main/java/org/dmg/pmml/neural_network/HasNormalizationMethod.java +++ b/pmml-model/src/main/java/org/dmg/pmml/neural_network/HasNormalizationMethod.java @@ -7,6 +7,17 @@ import org.dmg.pmml.PMMLObject; public interface HasNormalizationMethod<E extends PMMLObject & HasNormalizationMethod<E>> { + default + NeuralNetwork.NormalizationMethod getNormalizationMethod(NeuralNetwork.NormalizationMethod defaultNormalizationMethod){ + NeuralNetwork.NormalizationMethod normalizationMethod = getNormalizationMethod(); + + if(normalizationMethod == null){ + return defaultNormalizationMethod; + } + + return normalizationMethod; + } + NeuralNetwork.NormalizationMethod getNormalizationMethod(); E setNormalizationMethod(NeuralNetwork.NormalizationMethod normalizationMethod);
Added method HasNormalizationMethod#getNormalizationMethod(NeuralNetwork$NormalizationMethod)
jpmml_jpmml-model
train
java
90e5326097e1b508f440404d8b605eae7e57a337
diff --git a/daemon_unix.go b/daemon_unix.go index <HASH>..<HASH> 100644 --- a/daemon_unix.go +++ b/daemon_unix.go @@ -11,8 +11,14 @@ import ( // CmdDaemon execs dockerd with the same flags func (p DaemonProxy) CmdDaemon(args ...string) error { - // Use os.Args[1:] so that "global" args are passed to dockerd - args = stripDaemonArg(os.Args[1:]) + // Special case for handling `docker help daemon`. When pkg/mflag is removed + // we can support this on the daemon side, but that is not possible with + // pkg/mflag because it uses os.Exit(1) instead of returning an error on + // unexpected args. + if len(args) == 0 || args[0] != "--help" { + // Use os.Args[1:] so that "global" args are passed to dockerd + args = stripDaemonArg(os.Args[1:]) + } binaryPath, err := findDaemonBinary() if err != nil {
Support running 'docker help daemon'
docker_cli
train
go
a1448fc012d025d140c6c250249ec0800a80aa23
diff --git a/mod/book/tool/exportimscp/index.php b/mod/book/tool/exportimscp/index.php index <HASH>..<HASH> 100644 --- a/mod/book/tool/exportimscp/index.php +++ b/mod/book/tool/exportimscp/index.php @@ -52,4 +52,4 @@ add_to_log($course->id, 'book', 'exportimscp', 'tool/exportimscp/index.php?id='. $file = booktool_exportimscp_build_package($book, $context); -send_stored_file($file, 10, 0, true, clean_filename($book->name).'.zip'); +send_stored_file($file, 10, 0, true, array('filename' => clean_filename($book->name).'.zip'));
MDL-<I> book: fix send_stored_file() call
moodle_moodle
train
php
b9cdc289ca80eb687b5e580ab5b8bf3579cb4276
diff --git a/lib/poster.js b/lib/poster.js index <HASH>..<HASH> 100644 --- a/lib/poster.js +++ b/lib/poster.js @@ -186,7 +186,7 @@ module.exports = (function() { 'use strict'; return uriRes; } function getProtocol(url) { - return (url.protocol === 'https') ? https : http; + return (url.protocol === 'https:') ? https : http; } function getMultipartForm(fields, fileFieldName, fileName, fileContentType) { var form = ''; @@ -295,4 +295,4 @@ module.exports = (function() { 'use strict'; } } }; -})(); \ No newline at end of file +})();
Fix the https protocol check in getProtocol The string passed into the getProtocol function is 'https:' or 'http:' (with a colon) but the check applied within does not consider this. This causes HTTP connections to be made to HTTPS servers (which results in various errors, mine was the one below). Error I faced when using poster over a https `uploadUrl` was: `Invalid response from upload server. statusCode: <I>`
rfrench_poster
train
js
034d38dc11239003a4d84ac3c33d4e23a6f9622a
diff --git a/bitstring.py b/bitstring.py index <HASH>..<HASH> 100644 --- a/bitstring.py +++ b/bitstring.py @@ -31,6 +31,7 @@ import string import os import struct +os.SEEK_SET = 0 # For backward compatibility with Python 2.4 def _single_byte_from_hex_string(h): """Return a byte equal to the input hex string.""" @@ -67,7 +68,6 @@ def _removewhitespace(s): class BitStringError(Exception): """Base class for errors in the bitstring module.""" - class _FileArray(object): """A class that mimics the array.array type but gets data from a file object.""" @@ -622,7 +622,8 @@ class BitString(object): # Horribly inefficient! i = self.uint for x in xrange(self._length): - c.append('1' if i%2 == 1 else '0') + if i%2 == 1: c.append('1') + else: c.append('0') i /= 2 c.reverse() return ''.join(c)
Small tweaks to make the unit tests pass for Python<I> (as well as <I> and <I>).
scott-griffiths_bitstring
train
py
d6513a0f8bdc131832302cdd3932d562a35e803a
diff --git a/ncluster/aws_backend.py b/ncluster/aws_backend.py index <HASH>..<HASH> 100644 --- a/ncluster/aws_backend.py +++ b/ncluster/aws_backend.py @@ -106,7 +106,6 @@ class Task(backend.Task): self.log("reusing previous initialized state") else: self.log("running install script") - self._mount_efs() # bin/bash needed to make self-executable or use with UserData self.install_script = '#!/bin/bash\n' + self.install_script @@ -115,6 +114,7 @@ class Task(backend.Task): self.run('bash -e install.sh') # fail on errors assert self._is_initialized_fn_present(), f"Install script didn't write to {self._initialized_fn}" + self._mount_efs() self.connect_instructions = f""" To connect to {self.name} ssh -i {u.get_keypair_fn()} -o StrictHostKeyChecking=no {self.ssh_username}@{self.public_ip}
Make EFS mount happen regardless of initialization
diux-dev_ncluster
train
py
8df3dd9797c8afda79dfa99d90aadee6b0d7a093
diff --git a/git/remote.py b/git/remote.py index <HASH>..<HASH> 100644 --- a/git/remote.py +++ b/git/remote.py @@ -50,8 +50,8 @@ def add_progress(kwargs, git, progress): given, we do not request any progress :return: possibly altered kwargs""" if progress is not None: - v = git.version_info - if v[0] > 1 or v[1] > 7 or v[2] > 0 or v[3] > 3: + v = git.version_info[:2] + if v >= (1, 7): kwargs['progress'] = True # END handle --progress # END handle progress
fix(remote): improve version check Make version check much more readable, and fix it at the same time. The previous implementation would assume progress is supported just by looking at the patch-level for instance. A quick check of the git sources seems to indicate the --progress flag exists in <I> of the git command-line already. Fixes #<I>
gitpython-developers_GitPython
train
py
51c665bb466746a4423aa81cd178e0ee63d354e7
diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Ban.php b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Ban.php index <HASH>..<HASH> 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Ban.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Ban.php @@ -92,6 +92,10 @@ class Nexcessnet_Turpentine_Model_Observer_Ban extends Varien_Event_Observer { if( $this->_checkResult( $result ) && $cronHelper->getCrawlerEnabled() ) { $cronHelper->addProductToCrawlerQueue( $product ); + foreach( $banHelper->getParentProducts( $product ) + as $parentProduct ) { + $cronHelper->addProductToCrawlerQueue( $parentProduct ); + } } } } @@ -125,7 +129,7 @@ class Nexcessnet_Turpentine_Model_Observer_Ban extends Varien_Event_Observer { $cronHelper->addProductToCrawlerQueue( $product ); foreach( $banHelper->getParentProducts( $product ) as $parentProduct ) { - $cronHelper->addProductToCrawlerQueue( $product ); + $cronHelper->addProductToCrawlerQueue( $parentProduct ); } } }
add parent products to queue on product page ban
nexcess_magento-turpentine
train
php
0ad6e7267e45fd24c5bf2c96a67b00da23b5bc9f
diff --git a/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java b/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java index <HASH>..<HASH> 100644 --- a/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java +++ b/activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java @@ -93,6 +93,7 @@ public class TaskCandidateTest extends ActivitiInternalTestCase { .assignee(KERMIT) .list(); assertEquals(1, tasks.size()); + task = tasks.get(0); assertEquals("Pay out expenses", task.getName()); // Completing the task ends the process
Improved TaskCandidateTest by getting the task fresh from the user's task list after claiming it from a candidate task list
camunda_camunda-bpm-platform
train
java
f30a5b75cd800cb4fde2e44f5c9ce593972d60d8
diff --git a/morpfw/interfaces.py b/morpfw/interfaces.py index <HASH>..<HASH> 100644 --- a/morpfw/interfaces.py +++ b/morpfw/interfaces.py @@ -2,7 +2,6 @@ import abc import morepath import webob from typing import Optional, Union, BinaryIO, List, Sequence, Type -from dataclasses_json import DataClassJsonMixin class ISchema(object): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -64,8 +64,6 @@ setup(name='morpfw', 'cryptography', 'elasticsearch>=5.0.0,<6.0.0', 'pamela', - 'dataclasses_json', - 'marshmallow>=3.0.0rc3' ], extras_require={ 'test': [
remove dependency to dataclasses_json
morpframework_morpfw
train
py,py
de4c4a662615efa292e0f4425d79bd510b255204
diff --git a/mode/lua/lua.js b/mode/lua/lua.js index <HASH>..<HASH> 100644 --- a/mode/lua/lua.js +++ b/mode/lua/lua.js @@ -50,7 +50,7 @@ CodeMirror.defineMode("lua", function(config, parserConfig) { "true","function", "end", "if", "then", "else", "do", "while", "repeat", "until", "for", "in", "local" ]); - var indentTokens = wordRE(["function", "if","repeat","for","while", "\\(", "{"]); + var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); var dedentTokens = wordRE(["end", "until", "\\)", "}"]); var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]);
Replaced "for" and "while" in indent tokens with "do". This is not only simpler, but allows for correct indentation when "do ... end" blocks are used (these are valid; see the complete syntax of Lua: <URL>).
codemirror_CodeMirror
train
js
ea29f7c3d6ba098802f00ba867a7bff2447dc8d3
diff --git a/src/Console/Command/ReportingCommandTrait.php b/src/Console/Command/ReportingCommandTrait.php index <HASH>..<HASH> 100644 --- a/src/Console/Command/ReportingCommandTrait.php +++ b/src/Console/Command/ReportingCommandTrait.php @@ -74,7 +74,7 @@ trait ReportingCommandTrait */ protected function getReportNamespace(InputInterface $input, $uri = ''):string { - return strtr('target-profile-uri-date', [ + return strtr('target-profile-uri-date.language', [ 'uri' => strtr($uri, [ ':' => '', '/' => '', @@ -84,7 +84,8 @@ trait ReportingCommandTrait ]), 'target' => preg_replace('/[^a-z0-9]/', '', strtolower($input->getArgument('target'))), 'profile' => $input->hasArgument('profile') ? $input->getArgument('profile') : '', - 'date' => date('Ymd-His'), + 'date' => $this->getReportingPeriodStart($input)->format('Ymd-His'), + 'language' => $this->getLanguageManager()->getCurrentLanguage(), ]); }
Added lanuage prefixes to report names.
drutiny_drutiny
train
php
8163ba3a80b4512025b2a9dba89089d816dee141
diff --git a/lib/mongo/session.rb b/lib/mongo/session.rb index <HASH>..<HASH> 100644 --- a/lib/mongo/session.rb +++ b/lib/mongo/session.rb @@ -832,6 +832,7 @@ module Mongo end next else + transaction_in_progress = false raise end end
Fix RUBY-<I> Tx api loop breakage warnings in spec tests (#<I>)
mongodb_mongo-ruby-driver
train
rb
d55b5715a03eb9a8b484877aa0443ab8cff4d32b
diff --git a/gobblin-data-management/src/main/java/gobblin/data/management/trash/Trash.java b/gobblin-data-management/src/main/java/gobblin/data/management/trash/Trash.java index <HASH>..<HASH> 100644 --- a/gobblin-data-management/src/main/java/gobblin/data/management/trash/Trash.java +++ b/gobblin-data-management/src/main/java/gobblin/data/management/trash/Trash.java @@ -298,9 +298,4 @@ public class Trash implements GobblinTrash { } } } - - private boolean safeFsMkdir(FileSystem fs, Path f) throws IOException { - return safeFsMkdir(fs, f, FsPermission.getDirDefault()); - } - }
fix fingmainBugs issue
apache_incubator-gobblin
train
java
1bbb678949da480dce0d9ed3d0fb273bccce9787
diff --git a/src/manipulation/support.js b/src/manipulation/support.js index <HASH>..<HASH> 100644 --- a/src/manipulation/support.js +++ b/src/manipulation/support.js @@ -7,10 +7,13 @@ define([ div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); + // Support: Android 4.0-4.3 + // Check state lost if the name is set (#11217) // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); div.appendChild( input );
Manipulation: Check state lost if the name is set for Android <I>-<I> Refs gh-<I> Closes gh-<I>
jquery_jquery
train
js
d5e3eb29df312c0066d17d675366116dcc52a087
diff --git a/modules/cms/src/helpers/TagParser.php b/modules/cms/src/helpers/TagParser.php index <HASH>..<HASH> 100644 --- a/modules/cms/src/helpers/TagParser.php +++ b/modules/cms/src/helpers/TagParser.php @@ -3,7 +3,6 @@ namespace cms\helpers; use Yii; -use luya\helpers\Url; /** * TagParser to convert CMS Module Tags into HTML Tags @@ -80,7 +79,7 @@ class TagParser } } else { if (substr($result['value'], 0, 2) == '//') { - $href = preg_replace('#//#', Url::base(true) . '/', $result['value'], 1); + $href = preg_replace('#//#', \cms\helpers\Url::base(true) . '/', $result['value'], 1); $external = false; } else { $href = $result['value'];
fixing issue where use namespace can be overwritten by other url helpers from context.
luyadev_luya
train
php
201b11b2b4f0c4a02b768864c35ac5cd5984bbcd
diff --git a/src/components/paginator/CurrentPageReport.js b/src/components/paginator/CurrentPageReport.js index <HASH>..<HASH> 100644 --- a/src/components/paginator/CurrentPageReport.js +++ b/src/components/paginator/CurrentPageReport.js @@ -20,16 +20,16 @@ export class CurrentPageReport extends Component { totalRecords: PropTypes.number, template: PropTypes.string } - + render() { let text = this.props.template .replace("{currentPage}", this.props.page + 1) .replace("{totalPages}", this.props.pageCount) .replace("{first}", this.props.first + 1) - .replace("{last}", this.props.first + this.props.rows) + .replace("{last}", Math.min(this.props.first + this.props.rows, this.props.totalRecords)) .replace("{rows}", this.props.rows) .replace("{totalRecords}", this.props.totalRecords); - + return <span className="p-paginator-current">{text}</span> } -} \ No newline at end of file +}
Fixed #<I> - currentPageReport should check for {last} boundary
primefaces_primereact
train
js
b70ad643c34e6ba03fd2c994fcf6e6e0ade3eee5
diff --git a/src/Plugin/Platform/Joomla.php b/src/Plugin/Platform/Joomla.php index <HASH>..<HASH> 100644 --- a/src/Plugin/Platform/Joomla.php +++ b/src/Plugin/Platform/Joomla.php @@ -52,6 +52,10 @@ use \stdClass; */ class Joomla extends Platform { + const LAT = 0; + const LCT = 1; + const LCP = 2; + var $helper; private $cookies = array();
Added: LAT / LCT / LCP
jfusion_org.jfusion.platform.joomla
train
php
7c5cf579bb2f2a69a44394408ec30396a66d8ae9
diff --git a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php +++ b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php @@ -60,6 +60,15 @@ class WebDebugToolbarListener implements EventSubscriberInterface return self::DISABLED !== $this->mode; } + public function setMode(int $mode): void + { + if (self::DISABLED !== $mode && self::ENABLED !== $mode) { + throw new \InvalidArgumentException(sprintf('Invalid value provided for mode, use one of "%s::DISABLED" or "%s::ENABLED".', self::class, self::class)); + } + + $this->mode = $mode; + } + public function onKernelResponse(ResponseEvent $event) { $response = $event->getResponse();
[WebProfilerBundle] Possibility to dynamically set mode
symfony_symfony
train
php
f939cb39eedd9c14b5fd13530907a43bc4f03742
diff --git a/python/ray/__init__.py b/python/ray/__init__.py index <HASH>..<HASH> 100644 --- a/python/ray/__init__.py +++ b/python/ray/__init__.py @@ -1,6 +1,5 @@ import os import logging -import multiprocessing from os.path import dirname import sys @@ -14,7 +13,7 @@ if "pickle5" in sys.modules: "requires a specific version of pickle5 (which is " "packaged along with Ray).") -if "OMP_NUM_THREADS" not in os.environ and multiprocessing.cpu_count() > 8: +if "OMP_NUM_THREADS" not in os.environ: logger.warning("[ray] Forcing OMP_NUM_THREADS=1 to avoid performance " "degradation with many workers (issue #6998). You can " "override this by explicitly setting OMP_NUM_THREADS.")
always set it (#<I>)
ray-project_ray
train
py
ea94c858f95aa1928f1464b314c8583d7c3af791
diff --git a/scripts/agent_controller.rb b/scripts/agent_controller.rb index <HASH>..<HASH> 100644 --- a/scripts/agent_controller.rb +++ b/scripts/agent_controller.rb @@ -78,6 +78,8 @@ require 'rubygems' require 'right_agent/scripts/agent_controller' +require File.normalize_path(File.join(File.dirname(__FILE__), '..', 'lib', 'instance', 'agent_watcher')) + module RightScale class RightLinkAgentController < AgentController @@ -174,6 +176,23 @@ module RightScale true end + # Start agent + # + # === Parameters + # agent_name(String):: Agent name + # agent_class(Agent):: Agent class + # + # === Return + # true:: Always return true + def start_agent(agent_name, agent_class = Agent) + agent_watcher = AgentWatcher.new( lambda { |s| Log.info(s) }, @options[:pid_dir] ) + agent_watcher.watch_agent("#{@options[:identity]}-rchk", '/opt/rightscale/bin/rchk', '--start', '--stop') + @options[:ready_callback] = Proc.new { agent_watcher.start_watching() } + + super + agent_watcher.stop_watching() + end + # Determine syslog program name based on options # # === Parameters
acu<I> - Integrated AgentWatcher into AgentInstance (rnac)
rightscale_right_link
train
rb
828fdbe1e572f5cc254a602e1faf20e1364b7c70
diff --git a/inc/integrations.php b/inc/integrations.php index <HASH>..<HASH> 100644 --- a/inc/integrations.php +++ b/inc/integrations.php @@ -35,7 +35,7 @@ function rock_register_required_plugins() { // This is an example of how to include a plugin pre-packaged with a theme. array( 'name' => 'ChurchThemes', // The plugin name. - 'slug' => 'churchthemes-plugin-master', // The plugin slug (typically the folder name). + 'slug' => 'churchthemes', // The plugin slug (typically the folder name). 'source' => 'https://github.com/ChurchThemes-WP/churchthemes-plugin/archive/master.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
Update slug for ChurchThemes plugin
faithmade_rock
train
php
b097f3e8dc999a32478d778555c698ab7a479572
diff --git a/value.go b/value.go index <HASH>..<HASH> 100644 --- a/value.go +++ b/value.go @@ -82,6 +82,7 @@ func (v *Value) IsNil() bool { // 3. float (any precision) // 4. bool // 5. time.Time +// 6. String() will be called on the underlying value if provided // // NIL values will lead to an empty string. Unsupported types are leading // to their respective type name. @@ -106,9 +107,6 @@ func (v *Value) String() string { return "False" } case reflect.Struct: - if v.getResolvedValue().Type() == reflect.TypeOf(time.Time{}) { - return v.getResolvedValue().Interface().(time.Time).String() - } if t, ok := v.Interface().(fmt.Stringer); ok { return t.String() } @@ -179,7 +177,7 @@ func (v *Value) Bool() bool { } } -// Tried to evaluate the underlying value the Pythonic-way: +// Tries to evaluate the underlying value the Pythonic-way: // // Returns TRUE in one the following cases: // @@ -188,6 +186,7 @@ func (v *Value) Bool() bool { // * float != 0.0 // * len(array/chan/map/slice/string) > 0 // * bool == true +// * underlying value is a struct // // Otherwise returns always FALSE. func (v *Value) IsTrue() bool {
Slight fixes to the docs; removed time.String() since it's only another Stringer-interface-implementation.
flosch_pongo2
train
go
ef318f10927f5b5c1530ada9018a714571014352
diff --git a/PhpAmqpLib/Wire/IO/StreamIO.php b/PhpAmqpLib/Wire/IO/StreamIO.php index <HASH>..<HASH> 100644 --- a/PhpAmqpLib/Wire/IO/StreamIO.php +++ b/PhpAmqpLib/Wire/IO/StreamIO.php @@ -323,14 +323,14 @@ class StreamIO extends AbstractIO */ public function error_handler($errno, $errstr, $errfile, $errline, $errcontext = null) { - // fwrite notice that the stream isn't ready - if (strstr($errstr, 'Resource temporarily unavailable')) { + // fwrite notice that the stream isn't ready - errno=11, EAGAIN or EWOULDBLOCK + if ($errno == 11) { // it's allowed to retry return null; } - // stream_select warning that it has been interrupted by a signal - if (strstr($errstr, 'Interrupted system call')) { + // stream_select warning that it has been interrupted by a signal - errno=4, EINTR + if ($errno == 4) { // it's allowed while processing signals return null; }
Use errno instead of error strings Errors strings might be localized. In case of non english error messages (that's our case), `EAGAIN` and `EINTR` were not correctly detected and caused client to fail with an exception.
php-amqplib_php-amqplib
train
php
8ee027e0c861bb7dbac4674a8b1e13b3bc6e441d
diff --git a/spaceship/lib/spaceship/module.rb b/spaceship/lib/spaceship/module.rb index <HASH>..<HASH> 100644 --- a/spaceship/lib/spaceship/module.rb +++ b/spaceship/lib/spaceship/module.rb @@ -1,4 +1,8 @@ module Spaceship + # Requiring pathname is required here if not using bundler and requiring spaceship directly + # https://github.com/fastlane/fastlane/issues/14661 + require 'pathname' + ROOT = Pathname.new(File.expand_path('../../..', __FILE__)) DESCRIPTION = "Ruby library to access the Apple Dev Center and App Store Connect".freeze end
[spaceship] require pathname needed when not using bundler and requiring spaceship directly (#<I>)
fastlane_fastlane
train
rb
bc617471bc3bcaa4a465b6887c0bbf7cef2fbacd
diff --git a/src/Image/InputLoaderManager.php b/src/Image/InputLoaderManager.php index <HASH>..<HASH> 100644 --- a/src/Image/InputLoaderManager.php +++ b/src/Image/InputLoaderManager.php @@ -139,7 +139,7 @@ class InputLoaderManager { $iccSRGB = file_get_contents(__DIR__ . '/../../data/profiles/sRGB_v4_ICC_preference.icc'); $this->imagick->profileImage('icc', $iccSRGB); - $this->imagick->setImageColorSpace(Imagick::COLORSPACE_RGB); + $this->imagick->setImageColorSpace(Imagick::COLORSPACE_SRGB); } return $this->imagick;
Use SRGB as destination colorspace to avoid excessive highlights
imbo_imbo
train
php
e90e9cb879f943fb045884f55e8185a9b1bfabbb
diff --git a/lib/PHPPdf/Core/Document.php b/lib/PHPPdf/Core/Document.php index <HASH>..<HASH> 100644 --- a/lib/PHPPdf/Core/Document.php +++ b/lib/PHPPdf/Core/Document.php @@ -8,11 +8,11 @@ namespace PHPPdf\Core; -use PHPPdf\Util\AbstractStringFilterContainer; -use PHPPdf\Util\StringFilter; -use PHPPdf\Exception\RuntimeException; -use PHPPdf\Exception\LogicException; -use PHPPdf\Exception\InvalidArgumentException; +use PHPPdf\Util\AbstractStringFilterContainer; +use PHPPdf\Util\StringFilter; +use PHPPdf\Exception\RuntimeException; +use PHPPdf\Exception\LogicException; +use PHPPdf\Exception\InvalidArgumentException; use PHPPdf\Core\Node\Node; use PHPPdf\Core\Engine\ZF\Engine as ZfEngine; use PHPPdf\Core\Formatter as Formatters; @@ -268,8 +268,10 @@ class Document extends AbstractStringFilterContainer implements Engine { foreach($this->stringFilters as $filter) { - $data[$name] = $filter->filter($value); + $value = $filter->filter($value); } + + $data[$name] = $value; } return $this->engine->createFont($data);
fix bug in %resources% wildcard replacement
psliwa_PHPPdf
train
php
613f01be4fd44789a6e93b4d079228c800804c75
diff --git a/src/components/View.php b/src/components/View.php index <HASH>..<HASH> 100644 --- a/src/components/View.php +++ b/src/components/View.php @@ -19,6 +19,12 @@ class View extends \yii\web\View return $this->assetBundles[$assetName]->baseUrl; } + /** + * Removes redundant whitespaces (>1) and new lines (>1) + * + * @param string $content input string + * @return string compressed string + */ public function compress($content) { return preg_replace(array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'), array('>', '<', '\\1'), $content);
added php doc to compress function in component/view
luyadev_luya
train
php
59f87582fffc50578656f1c72f586a2c30a561a1
diff --git a/java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java b/java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java index <HASH>..<HASH> 100644 --- a/java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java +++ b/java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java @@ -19,6 +19,7 @@ limitations under the License. package org.openqa.selenium.firefox; import static org.openqa.selenium.OutputType.FILE; +import static org.openqa.selenium.remote.CapabilityType.ACCEPT_SSL_CERTS; import static org.openqa.selenium.remote.CapabilityType.PROXY; import org.openqa.selenium.Capabilities; @@ -106,6 +107,11 @@ public class FirefoxDriver extends RemoteWebDriver implements TakesScreenshot { profile.setProxyPreferences(proxy); } + if (capabilities.getCapability(ACCEPT_SSL_CERTS) != null) { + Boolean acceptCerts = (Boolean) capabilities.getCapability(ACCEPT_SSL_CERTS); + profile.setAcceptUntrustedCertificates(acceptCerts); + } + return profile; }
DouniaBerrada: Adding the possibility to control SSL certs from the Firefox profile. r<I>
SeleniumHQ_selenium
train
java
08d86339cccbeaaaac2081ed3c993e3119db44a4
diff --git a/src/Graviton/FileBundle/Controller/FileController.php b/src/Graviton/FileBundle/Controller/FileController.php index <HASH>..<HASH> 100644 --- a/src/Graviton/FileBundle/Controller/FileController.php +++ b/src/Graviton/FileBundle/Controller/FileController.php @@ -183,8 +183,26 @@ class FileController extends RestController $this->getModel()->updateRecord($id, $record); - return parent::getAction($request, $id); + // store id of new record so we dont need to reparse body later when needed + $request->attributes->set('id', $record->getId()); + + $response = $this->getResponse(); + $response->setStatusCode(Response::HTTP_OK); + + $routeName = $request->get('_route'); + $routeParts = explode('.', $routeName); + $routeType = end($routeParts); + + if ($routeType == 'put') { + $routeName = substr($routeName, 0, -3) . 'get'; + } + + $response->headers->set( + 'Location', + $this->getRouter()->generate($routeName, array('id' => $record->getId())) + ); + return $response; }
make file PUT behave like parent PUT..
libgraviton_graviton
train
php
66b6f9cbdbafe3cc822f2c47af6d0df2554be142
diff --git a/androlog/src/main/java/de/akquinet/android/androlog/reporter/Report.java b/androlog/src/main/java/de/akquinet/android/androlog/reporter/Report.java index <HASH>..<HASH> 100644 --- a/androlog/src/main/java/de/akquinet/android/androlog/reporter/Report.java +++ b/androlog/src/main/java/de/akquinet/android/androlog/reporter/Report.java @@ -26,6 +26,8 @@ import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Build; +import android.view.Display; +import android.view.WindowManager; import de.akquinet.android.androlog.Log; /** @@ -110,6 +112,13 @@ public class Report { JSONObject device = new JSONObject(); device.put("device", Build.DEVICE); device.put("brand", Build.BRAND); + + Object windowService = context.getSystemService(Context.WINDOW_SERVICE); + if (windowService instanceof WindowManager) { + Display display = ((WindowManager)windowService).getDefaultDisplay(); + device.put("resolution", display.getWidth() + "x" + display.getHeight()); + device.put("orientation", display.getOrientation()); + } device.put("display", Build.DISPLAY); device.put("manufacturer", Build.MANUFACTURER); device.put("model", Build.MODEL);
Added device resolution and current orientation to report
akquinet_androlog
train
java
bce3f648933a6c48dc30b83c05c44771308049f2
diff --git a/src/Exscript/workqueue/MainLoop.py b/src/Exscript/workqueue/MainLoop.py index <HASH>..<HASH> 100644 --- a/src/Exscript/workqueue/MainLoop.py +++ b/src/Exscript/workqueue/MainLoop.py @@ -116,7 +116,9 @@ class MainLoop(Trackable, threading.Thread): def get_queue_length(self): #print "Queue length:", len(self.queue) - return len(self.queue) + len(self.running_jobs) + return len(self.queue) \ + + len(self.force_start) \ + + len(self.running_jobs) def _start_action(self, action): job = Job(self.condition, action, debug = self.debug)
Fix: Workqueue.get_queue_length() should include force-started actions.
knipknap_exscript
train
py
bf463bd9dc7347a6facd4be360226fc17fb1edea
diff --git a/mstate/unit.go b/mstate/unit.go index <HASH>..<HASH> 100644 --- a/mstate/unit.go +++ b/mstate/unit.go @@ -20,9 +20,9 @@ type Unit struct { doc unitDoc } -func newUnit(s *State, udoc *unitDoc) *Unit { +func newUnit(st *State, udoc *unitDoc) *Unit { return &Unit{ - st: s, + st: st, doc: *udoc, } }
mstate: s/s/st/ in newUnit.
juju_juju
train
go
bc2c97936dfcce29cdf7373ebfdbb3ee3efb4e55
diff --git a/src/Aerys/Handlers/DocRoot/DocRootHandler.php b/src/Aerys/Handlers/DocRoot/DocRootHandler.php index <HASH>..<HASH> 100644 --- a/src/Aerys/Handlers/DocRoot/DocRootHandler.php +++ b/src/Aerys/Handlers/DocRoot/DocRootHandler.php @@ -45,7 +45,7 @@ class DocRootHandler { $this->docRoot = rtrim($docRoot, '/'); $this->assignDefaultMimeTypes(); - $this->multipartBoundary = uniqid(); + $this->multipartBoundary = uniqid('', TRUE); $this->staleCacheClearanceSubscription = $reactor->schedule(function() { $this->cleanCache();
uniqid() now uses more_entropy=TRUE to avoid pathological slowdowns
amphp_http-server
train
php
e17c8f40aa8a8c2d04b359fe18ae614b41b1767f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup( # Release requirements. See dev-requirements.txt for dev version reqs. requirements=['invoke>=0.6.0'], - packages=find_packages(), + packages=['invocations'], classifiers=[ 'Development Status :: 3 - Alpha',
Explicit packages in setup.py
pyinvoke_invocations
train
py
c23649dc91ac19787678e9c590537d124f1e0ad3
diff --git a/lib/cb/responses/spot/retrieve_response.rb b/lib/cb/responses/spot/retrieve_response.rb index <HASH>..<HASH> 100644 --- a/lib/cb/responses/spot/retrieve_response.rb +++ b/lib/cb/responses/spot/retrieve_response.rb @@ -7,6 +7,8 @@ module Cb protected def validate_api_hash + p "///////---------- RESPONSE" + p response required_response_field(root_node, response) required_response_field(spot_collection, response[root_node]) end @@ -30,7 +32,7 @@ module Cb end def spot_hashes - response[root_node][spot_collection] + Cb::Utils::ResponseArrayExtractor.extract(response[root_node], spot_collection) end end diff --git a/lib/cb/version.rb b/lib/cb/version.rb index <HASH>..<HASH> 100755 --- a/lib/cb/version.rb +++ b/lib/cb/version.rb @@ -1,3 +1,3 @@ module Cb - VERSION = '6.2.2' + VERSION = '6.2.3' end
Spot API not working on single response.
careerbuilder_ruby-cb-api
train
rb,rb
11ef6d87337699b8fedd88639d9e65e93e46209f
diff --git a/mockito_test/smart_test_runner.py b/mockito_test/smart_test_runner.py index <HASH>..<HASH> 100644 --- a/mockito_test/smart_test_runner.py +++ b/mockito_test/smart_test_runner.py @@ -1,8 +1,13 @@ import unittest -import os +import sys, os import re def run(): + if '--quiet' in sys.argv: + verbosity_level = 1 + else: + verbosity_level = 2 + pattern = re.compile('([a-z]+_)+test\.py$') loader = unittest.TestLoader() @@ -11,4 +16,4 @@ def run(): names = [f.replace('.py', '') for f in os.listdir('.') if pattern.match(f, 1)] for name in names: suite.addTests(loader.loadTestsFromName(name)) - unittest.TextTestRunner(verbosity=2).run(suite) \ No newline at end of file + unittest.TextTestRunner(verbosity=verbosity_level).run(suite) \ No newline at end of file
Added --quiet option to the smart test-runner
kaste_mockito-python
train
py
24dbde4ce4393f92a2764f0219277af23f4fb1e3
diff --git a/salt/loader.py b/salt/loader.py index <HASH>..<HASH> 100644 --- a/salt/loader.py +++ b/salt/loader.py @@ -1613,7 +1613,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): error_reason = ( 'Exception raised when processing __virtual__ function' ' for {0}. Module will not be loaded: {1}'.format( - module_name, exc)) + mod.__name__, exc)) log.error(error_reason, exc_info_on_loglevel=logging.DEBUG) virtual = None # Get the module's virtual name
Is this a module, a state, a returner. More information.
saltstack_salt
train
py
cba6f1324559888ae195ed938c5c6d9d45292191
diff --git a/browser.js b/browser.js index <HASH>..<HASH> 100644 --- a/browser.js +++ b/browser.js @@ -54,7 +54,7 @@ define(["require", "deepjs/deep", "./index", "./lib/relink"], function(require, console.log("route init : ", uri, deep.route(uri)); }; }) - .logError(); + .elog(); else { if(!closure.node) diff --git a/lib/flat2.js b/lib/flat2.js index <HASH>..<HASH> 100644 --- a/lib/flat2.js +++ b/lib/flat2.js @@ -32,6 +32,6 @@ define(["require", "deepjs/deep", "./route-node", "./route"], function(require, }); return mapper; }) - .logError(); + .elog(); }; }); \ No newline at end of file
refactor logError to elog
deepjs_deep-routes
train
js,js
00cee340dd13380024ad1e1a6fbd8126e48a361e
diff --git a/src/ecpair.js b/src/ecpair.js index <HASH>..<HASH> 100644 --- a/src/ecpair.js +++ b/src/ecpair.js @@ -1,6 +1,5 @@ var baddress = require('./address') var bcrypto = require('./crypto') -var bs58check = require('bs58check') var ecdsa = require('./ecdsa') var randomBytes = require('randombytes') var typeforce = require('typeforce') @@ -59,20 +58,24 @@ ECPair.fromPublicKeyBuffer = function (buffer, network) { } ECPair.fromWIF = function (string, network) { - var buffer = bs58check.decode(string) + network = network || NETWORKS.bitcoin + var decoded = wif.decode(string) + var version = decoded.version + // [network, ...] if (types.Array(network)) { - var version = buffer[0] - network = network.filter(function (network) { return version === network.wif }).pop() if (!network) throw new Error('Unknown network version') + + // network + } else if (network) { + // check version only if defined + if (version !== network.wif) throw new Error('Invalid network version') } - network = network || NETWORKS.bitcoin - var decoded = wif.decodeRaw(buffer, network.wif) var d = BigInteger.fromBuffer(decoded.privateKey) return new ECPair(d, null, {
ECPair: don't depend on WIF error message, avoid unnecessary import
BitGo_bitgo-utxo-lib
train
js
2e945bdc055cc270f0dc04d84c0f339dc8debf7d
diff --git a/tests/ResourceTest.php b/tests/ResourceTest.php index <HASH>..<HASH> 100644 --- a/tests/ResourceTest.php +++ b/tests/ResourceTest.php @@ -373,4 +373,4 @@ class varProvider implements \BEAR\Resource\SignalHandler\HandleInterface return \Aura\Signal\Manager::STOP; } -} \ No newline at end of file +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -13,4 +13,4 @@ AnnotationRegistry::registerAutoloadNamespace('BEAR\Resource\Annotation', dirnam AnnotationRegistry::registerAutoloadNamespace('Ray\Di\Di', dirname(__DIR__) . '/vendor/ray/di/src'); $dir = sys_get_temp_dir(); -ini_set('error_log', $dir . '/error.log'); \ No newline at end of file +ini_set('error_log', $dir . '/error.log');
Merge branch 'release/<I>' into develop
bearsunday_BEAR.Resource
train
php,php
0e48b2130cc53caa9beb9a5f8ce09edbcc40f1b8
diff --git a/ggplotx/tests/test_geom_point.py b/ggplotx/tests/test_geom_point.py index <HASH>..<HASH> 100644 --- a/ggplotx/tests/test_geom_point.py +++ b/ggplotx/tests/test_geom_point.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function import pandas as pd -from ggplotx import ggplot, aes, geom_point +from ggplotx import ggplot, aes, geom_point, theme def test_aesthetics(): @@ -32,6 +32,7 @@ def test_aesthetics(): geom_point(aes(x='h', stroke='a'), fill='white', color='green', size=10) + geom_point(aes(x='i', shape='factor(a)'), - fill='brown', stroke=2, size=10, show_legend=False)) + fill='brown', stroke=2, size=10, show_legend=False) + + theme(facet_spacing={'right': 0.85})) assert p == 'aesthetics'
Add space on the RHS of geom_point test
has2k1_plotnine
train
py
1c22e33b3ff9119e0cbd859280f5cb11e9b1db6e
diff --git a/ext/rev/extconf.rb b/ext/rev/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/rev/extconf.rb +++ b/ext/rev/extconf.rb @@ -59,7 +59,9 @@ create_makefile('rev_ext') if have_header('openssl/ssl.h') and RUBY_PLATFORM =~ /mingw|win32/ print "Note--SSL not yet supported on windows--continuing without SSL support" - makefile_contents = File.read 'Makefile' - makefile_contents.gsub!('-DHAVE_OPENSSL_SSL_H', '') - File.open('Makefile', 'w') { |f| f.write makefile_contents } - end + makefile_contents = File.read 'Makefile' + makefile_contents.gsub!('-DHAVE_OPENSSL_SSL_H', '') + makefile_contents.gsub! 'LIBS = $(LIBRUBYARG_SHARED)', 'LIBS = -lws2_32 $(LIBRUBYARG_SHARED)' # for some reason has to come first or ioctlsocket will be mapped to an [inverted] ruby specific version + + File.open('Makefile', 'w') { |f| f.write makefile_contents } +end
for windoze make it work with <I>
tarcieri_cool.io
train
rb
fc94957a6306f0a3abc3b1a71c98b203eeb4b921
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -42,11 +42,11 @@ module.exports = function(Sequelize) { camelThrough: false }, defineOptions || {}); - // find primary keys + // prep definitions var primaryKeys = {}; _.forIn(definitions, function(definition, modelName) { - primaryKey(modelName, definition); + prepOne(modelName, definition); }); // process definitions @@ -62,7 +62,7 @@ module.exports = function(Sequelize) { // functions - function primaryKey(modelName, definition) + function prepOne(modelName, definition) { // find primary key var fields = definition.fields = definition.fields || {};
Rename primaryKey function to prepOne
overlookmotel_sequelize-definer
train
js
dd703264728d7748fd3428653f5d2d7f9637ce94
diff --git a/lib/test-server/test-server.js b/lib/test-server/test-server.js index <HASH>..<HASH> 100644 --- a/lib/test-server/test-server.js +++ b/lib/test-server/test-server.js @@ -100,6 +100,7 @@ var slaveDisconnected = function (slave) { var testServer = this; arrayRemove(testServer.slaves, slave); arrayRemove(testServer.availableSlaves, slave); + testServer.logger.logInfo("Slave disconnected: " + slave.toString()); }; var slaveAvailable = function (slave) {
Adding a log message on the server when a slave is disconnected. This way, logs are more consistent, showing both the connection and disconnection of slaves.
attester_attester
train
js
fd883629d12cc561a6e968d09fa85a46b67d9c6b
diff --git a/src/org/jgroups/protocols/TP.java b/src/org/jgroups/protocols/TP.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/protocols/TP.java +++ b/src/org/jgroups/protocols/TP.java @@ -43,7 +43,7 @@ import java.util.concurrent.locks.ReentrantLock; * The {@link #receive(Address, Address, byte[], int, int)} method must * be called by subclasses when a unicast or multicast message has been received. * @author Bela Ban - * @version $Id: TP.java,v 1.134 2007/05/01 09:16:47 belaban Exp $ + * @version $Id: TP.java,v 1.135 2007/05/04 06:38:22 belaban Exp $ */ public abstract class TP extends Protocol { @@ -1705,6 +1705,8 @@ public abstract class TP extends Protocol { } private void addMessage(Message msg, Address dest) { // no sync needed, always called with lock held + if(msgs.isEmpty()) + last_bundle_time=System.currentTimeMillis(); List<Message> tmp=msgs.get(dest); if(tmp == null) { tmp=new LinkedList<Message>(); @@ -1735,7 +1737,7 @@ public abstract class TP extends Protocol { } msgs.clear(); count=0; - last_bundle_time=System.currentTimeMillis(); + // last_bundle_time=System.currentTimeMillis(); return copy; }
changed setting of last_bundle_time
belaban_JGroups
train
java
6cde3dcd674c32bca05f3a0fc4ac518556f388e4
diff --git a/lib/ronin/database/database.rb b/lib/ronin/database/database.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/database/database.rb +++ b/lib/ronin/database/database.rb @@ -204,7 +204,7 @@ module Ronin def Database.setup # setup the database log unless @log - if ENV['DEBUG'] + if ($DEBUG || ENV['DEBUG']) setup_log(:stream => $stderr, :level => :debug) else setup_log diff --git a/lib/ronin/ui/output/output.rb b/lib/ronin/ui/output/output.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/ui/output/output.rb +++ b/lib/ronin/ui/output/output.rb @@ -26,7 +26,7 @@ module Ronin # Controls {Output} from Ronin. # module Output - @mode = if ENV['VERBOSE'] + @mode = if ($VERBOSE || $DEBUG || ENV['VERBOSE']) :verbose else :quiet
Respect $VERBOSE and $DEBUG.
ronin-ruby_ronin
train
rb,rb
eb65abbb2b198838b63cb5be661f5a5177044538
diff --git a/Tests/Net/OpenID/CryptUtil.php b/Tests/Net/OpenID/CryptUtil.php index <HASH>..<HASH> 100644 --- a/Tests/Net/OpenID/CryptUtil.php +++ b/Tests/Net/OpenID/CryptUtil.php @@ -55,12 +55,9 @@ class Tests_Net_OpenID_ByteOps extends PHPUnit_TestCase { $a = Net_OpenID_CryptUtil::randrange($lib->pow(2, 128)); $b = Net_OpenID_CryptUtil::randrange($lib->pow(2, 128)); - // If $a is a float, it's because we're using fallback number - // storage (PHP stores overflowed ints as floats). $this->assertFalse($lib->cmp($b, $a) == 0, "Same: $a $b"); $n = $lib->init(Net_OpenID_CryptUtil::maxint()); - $one = $lib->init(1); $n = $lib->add($n, 1); // Make sure that we can generate random numbers that are
[project @ Cruft removal in cryptutil test]
openid_php-openid
train
php
7a704540e9b712278b99e7beee53ff6d829b35e6
diff --git a/elifetools/__init__.py b/elifetools/__init__.py index <HASH>..<HASH> 100644 --- a/elifetools/__init__.py +++ b/elifetools/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.3.0' +__version__ = '0.3.1'
Bump to version <I> with lxml dependency change.
elifesciences_elife-tools
train
py
a7e4e4a05452432ff522930a2d13dd3bab12e8f1
diff --git a/mode/clike/clike.js b/mode/clike/clike.js index <HASH>..<HASH> 100644 --- a/mode/clike/clike.js +++ b/mode/clike/clike.js @@ -264,9 +264,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { function cppHook(stream, state) { if (!state.startOfLine) return false for (var ch, next = null; ch = stream.peek();) { - if (!ch) { - break - } else if (ch == "\\" && stream.match(/^.$/)) { + if (ch == "\\" && stream.match(/^.$/)) { next = cppHook break } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
[clike mode] Remove redundant code
codemirror_CodeMirror
train
js
c6b36ba7922c2d119cda1bbd8eb7e5a4ba1ecc61
diff --git a/xchange-examples/src/main/java/org/knowm/xchange/examples/bittrex/account/BittrexAccountDemo.java b/xchange-examples/src/main/java/org/knowm/xchange/examples/bittrex/account/BittrexAccountDemo.java index <HASH>..<HASH> 100644 --- a/xchange-examples/src/main/java/org/knowm/xchange/examples/bittrex/account/BittrexAccountDemo.java +++ b/xchange-examples/src/main/java/org/knowm/xchange/examples/bittrex/account/BittrexAccountDemo.java @@ -21,7 +21,7 @@ public class BittrexAccountDemo { AccountService accountService = exchange.getAccountService(); - // generic(accountService); + generic(accountService); raw((BittrexAccountServiceRaw) accountService); }
[bittrex] minor change in example class
knowm_XChange
train
java
7e0d584b15bb297d1c0a6de59887b389e7cf87f8
diff --git a/path.py b/path.py index <HASH>..<HASH> 100644 --- a/path.py +++ b/path.py @@ -1308,11 +1308,16 @@ class Path(text_type): return self._next_class(newpath) if hasattr(os, 'symlink'): - def symlink(self, newlink): + def symlink(self, newlink=None): """ Create a symbolic link at `newlink`, pointing here. + If newlink is not supplied, the symbolic link will assume + the name self.basename(), creating the link in the cwd. + .. seealso:: :func:`os.symlink` """ + if newlink is None: + newlink = self.basename() os.symlink(self, newlink) return self._next_class(newlink)
Draft of an implementation accepting an implied name for a symlink based on the target's name.
jaraco_path.py
train
py
a7147e833d4fdbb10b318735c5ffc32677dd3c67
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -127,7 +127,7 @@ todo_include_todos = True # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'classic' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the
adding better theme for readthedocs
xhtml2pdf_xhtml2pdf
train
py
b5fa4b71163af077b9d3bd9b31b0993cb379af27
diff --git a/src/StatementResult.php b/src/StatementResult.php index <HASH>..<HASH> 100644 --- a/src/StatementResult.php +++ b/src/StatementResult.php @@ -30,8 +30,8 @@ class StatementResult protected $moreUrlPath; /** - * @param Statement[] $statements The collection of Statements - * @param string $urlPath The URL path + * @param Statement[] $statements The collection of Statements + * @param string $urlPath The URL path */ public function __construct(array $statements, $urlPath = null) {
CS: fix alignment in some docblocks
php-xapi_model
train
php
180335f03658bfdd60bb3c7fe54bcdfdce1f4c60
diff --git a/src/js/load.js b/src/js/load.js index <HASH>..<HASH> 100644 --- a/src/js/load.js +++ b/src/js/load.js @@ -81,7 +81,7 @@ var scaleX; var scaleY; - if (orientation) { + if (orientation > 1) { $.each(new Uint8Array(arrayBuffer), function (i, code) { base64 += fromCharCode(code); });
Only handle Orientation great than 1
fengyuanchen_cropper
train
js
027bd0dfc25cda435b3340e4c88f4c8bc58760d6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup_requirements = [ setup( name='git-gifi', - version='0.11', + version='0.11-SNAPSHOT', description='Git and github enhancements to git.', author='Grzegorz Kokosinski', author_email='g.kokosinski a) gmail.com',
Add SNAPSHOT to version
kokosing_git-gifi
train
py
0f43d644a9f08d8cf1a1f1c293e5d4ffc375c0e3
diff --git a/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/services/iomanager/ChannelReader.java b/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/services/iomanager/ChannelReader.java index <HASH>..<HASH> 100644 --- a/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/services/iomanager/ChannelReader.java +++ b/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/services/iomanager/ChannelReader.java @@ -62,7 +62,7 @@ public final class ChannelReader extends ChannelAccess<Buffer.Input> implements { synchronized (this) { if (this.closed) { - throw new IllegalStateException("Writer is already closing or has been closed."); + throw new IllegalStateException("Reader is already closing or has been closed."); } this.closed = true; }
- Fixed copy-and-paste mistake in exception statement
apache_flink
train
java
85a8f7ea5b4ad2b3ecbbc735bdfa8943d70f1e3d
diff --git a/flake8_docstrings.py b/flake8_docstrings.py index <HASH>..<HASH> 100644 --- a/flake8_docstrings.py +++ b/flake8_docstrings.py @@ -6,7 +6,7 @@ included as module into flake8 """ import sys -import pep8 +import pycodestyle try: import pydocstyle as pep257 module_name = 'pydocstyle' @@ -71,7 +71,7 @@ class pep257Checker(object): """Load the source for the specified file.""" if self.filename in self.STDIN_NAMES: self.filename = 'stdin' - self.source = pep8.stdin_get_value() + self.source = pycodestyle.stdin_get_value() else: with pep257.tokenize_open(self.filename) as fd: self.source = fd.read()
Migrate pep8 to pycodestyle The pep8 code linter has been renamed to pycodestyle [1]. This change fixes an import error caused by the migration. [1] <URL>
tylertrussell_flake8-docstrings-catnado
train
py
f9e9555806d73033ca41c86e5ee6203d628fb768
diff --git a/scraper/util.py b/scraper/util.py index <HASH>..<HASH> 100644 --- a/scraper/util.py +++ b/scraper/util.py @@ -38,7 +38,8 @@ def configure_logging(verbose=False): 'formatters': { 'standard': { # 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s' - 'format': '%(levelname)s: %(message)s' + # 'format': '%(levelname)s: %(message)s' + 'format': '%(asctime)s - %(levelname)s: %(message)s' }, }, 'handlers': {
Added timestamp to logging format
LLNL_scraper
train
py
1a08aa5cbca685ffd8b056f4a4fc64ce9912027c
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index <HASH>..<HASH> 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java @@ -258,9 +258,9 @@ public class PatchFixes { public static IMethod[] removeGeneratedMethods(IMethod[] methods) throws Exception { List<IMethod> result = new ArrayList<IMethod>(); for (IMethod m : methods) { - if (m.getNameRange().getLength() > 0) result.add(m); + if (m.getNameRange().getLength() > 0 && !m.getNameRange().equals(m.getSourceRange())) result.add(m); } - return result.size() == methods.length ? methods : result.toArray(new IMethod[0]); + return result.size() == methods.length ? methods : result.toArray(new IMethod[result.size()]); } public static SimpleName[] removeGeneratedSimpleNames(SimpleName[] in) throws Exception {
removeGeneratedMethods was broken, causing the rename to fail
rzwitserloot_lombok
train
java
447c46395e72a13ba9721581b9aff007b73c9536
diff --git a/lib/roo_on_rails/checks/github/branch_protection.rb b/lib/roo_on_rails/checks/github/branch_protection.rb index <HASH>..<HASH> 100644 --- a/lib/roo_on_rails/checks/github/branch_protection.rb +++ b/lib/roo_on_rails/checks/github/branch_protection.rb @@ -52,7 +52,7 @@ module RooOnRails end def ensure_coverage_status_check!(contexts) - return if (contexts & coverage_contexts) == coverage_contexts + return if (contexts & coverage_contexts).sort == coverage_contexts.sort fail! 'no code coverage status checks' end @@ -92,7 +92,7 @@ module RooOnRails def ci_context if Pathname.new('.travis.yml').exist? then 'continuous-integration/travis-ci' - else 'ci/circle-ci' + else 'ci/circleci' end end
BUGFIX: Branch protection with CircleCI and codecov checks There were a couple of issues here: * The context for CircleCI was spelled incorrectly * The coverage contexts could have different sort orders This fixes both of these issues.
deliveroo_roo_on_rails
train
rb
f1ffe444bcaf003b34ca40dbe69d39e5782709e7
diff --git a/isso/client/app/isso.js b/isso/client/app/isso.js index <HASH>..<HASH> 100644 --- a/isso/client/app/isso.js +++ b/isso/client/app/isso.js @@ -169,8 +169,6 @@ define(["lib/q", "lib/HTML", "helper/utils", "./api", "./forms", "./logging"], f console.log(utils.heading()); -// return; - var rootmsgbox = forms.msgbox({}); HTML.query("#isso-thread").add("div#isso-root").add(rootmsgbox); rootmsgbox.query("input[type=submit]").addEventListener("click", function(event) { @@ -181,8 +179,10 @@ define(["lib/q", "lib/HTML", "helper/utils", "./api", "./forms", "./logging"], f text: rootmsgbox.query("textarea").value, parent: null }) .then(function(rv) { - // remove box on submit - rootmsgbox.remove() + rootmsgbox.query("[name=author]").value = ""; + rootmsgbox.query("[name=email]").value = ""; + rootmsgbox.query("[name=website]").value = ""; + rootmsgbox.query("textarea").value = ""; insert(rv); }) event.preventDefault()
don't remove root msg box on submit, but clear fields
posativ_isso
train
js
d5be199501fdd0e3d1ee9811f38bc2bc59718594
diff --git a/zebra/zapi.go b/zebra/zapi.go index <HASH>..<HASH> 100644 --- a/zebra/zapi.go +++ b/zebra/zapi.go @@ -850,14 +850,15 @@ func (b *IPRouteBody) DecodeFromBytes(data []byte, version uint8) error { if b.Message&MESSAGE_DISTANCE > 0 { b.Distance = data[pos] + pos += 1 } if b.Message&MESSAGE_METRIC > 0 { - pos += 1 b.Metric = binary.BigEndian.Uint32(data[pos : pos+4]) + pos += 4 } if b.Message&MESSAGE_MTU > 0 { - pos += 4 b.Mtu = binary.BigEndian.Uint32(data[pos : pos+4]) + pos += 4 } return nil
zebra/zapi: Fix offset calculation in IPRouteBody
osrg_gobgp
train
go
52d38b8a1c949dbbb509f3e0b4b3054754f84bed
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -752,22 +752,26 @@ cache(function(data, match, sendBadge, request) { }); })); +// SensioLabs. camp.route(/^\/sensiolabs\/i\/([^\/]+)\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { var projectUuid = match[1]; var format = match[2]; var options = { method: 'GET', - auth: { - user: serverSecrets.sl_insight_userUuid, - pass: serverSecrets.sl_insight_apiToken - }, uri: 'https://insight.sensiolabs.com/api/projects/' + projectUuid, headers: { Accept: 'application/vnd.com.sensiolabs.insight+xml' } }; + if (!serverSecrets && serverSecrets.sl_insight_userUuid) { + options.auth = { + user: serverSecrets.sl_insight_userUuid, + pass: serverSecrets.sl_insight_apiToken + }; + } + var badgeData = getBadgeData('check', data); request(options, function(err, res, body) {
SensioLabs don't break when server secrets absent
badges_shields
train
js
4d28e0f8a563a7084e789480d775dbb66e274de1
diff --git a/sockeye/training.py b/sockeye/training.py index <HASH>..<HASH> 100644 --- a/sockeye/training.py +++ b/sockeye/training.py @@ -256,8 +256,6 @@ class GluonEarlyStoppingTrainer: # send sharded inputs to the backend for inputs, labels in batch.shards(): - if self.dtype == C.DTYPE_FP16: - inputs = (i.astype(C.DTYPE_FP16, copy=False) for i in inputs) # type: ignore self._parallel.put((inputs, labels)) # get outputs from parallel requests to the backend. Each shard output contains a list of tuples, one for each diff --git a/sockeye/transformer.py b/sockeye/transformer.py index <HASH>..<HASH> 100644 --- a/sockeye/transformer.py +++ b/sockeye/transformer.py @@ -320,7 +320,7 @@ class TransformerValidLengthMask(mx.gluon.HybridBlock): :return: """ # (batch, 1) - mask = F.reshape(F.zeros_like(lengths), shape=(-1, 1)) + mask = F.reshape(F.zeros_like(lengths.astype(self._dtype)), shape=(-1, 1)) # (batch, seq_len) mask = F.broadcast_like(mask, data, lhs_axes=(1,), rhs_axes=(1,)) # (batch_size, max_length)
Fix FP<I> training: not casting inputs to float<I> due to limited fp<I> range. Requires casting of lengths in transformer valid length mask
awslabs_sockeye
train
py,py
94933dba93f39ff4e3c101e7821c362c4072e6ed
diff --git a/Task/CsvWriterTask.php b/Task/CsvWriterTask.php index <HASH>..<HASH> 100644 --- a/Task/CsvWriterTask.php +++ b/Task/CsvWriterTask.php @@ -38,7 +38,7 @@ class CsvWriterTask extends AbstractCsvTask implements BlockingTaskInterface try { if (!$this->csv instanceof CsvFile) { $this->initFile($state); - if (0 === filesize($this->csv->getFilePath())) { + if ($this->getOption($state, 'write_headers') && 0 === filesize($this->csv->getFilePath())) { $this->csv->writeHeaders(); } } @@ -79,8 +79,9 @@ class CsvWriterTask extends AbstractCsvTask implements BlockingTaskInterface parent::configureOptions($resolver); $resolver->setDefaults( [ - 'mode' => 'wb', + 'mode' => 'wb', 'split_character' => '|', + 'write_headers' => true, ] );
Added an option to avoid CSV headers
cleverage_process-bundle
train
php
09eb3d151ceec693f64398d3f5b57a08b2891a91
diff --git a/msl-server-node/mslMiddleware.js b/msl-server-node/mslMiddleware.js index <HASH>..<HASH> 100644 --- a/msl-server-node/mslMiddleware.js +++ b/msl-server-node/mslMiddleware.js @@ -17,6 +17,7 @@ module.exports = function (argv, callback) { var debug = argv.debug || true; var localAppDir = argv.localAppDir || __dirname; var extensions = argv.extensions||''; + var responseObj = {}; var record = function (message, severity) { if (debug) { @@ -135,7 +136,7 @@ module.exports = function (argv, callback) { } if (req.method === 'POST') { var mockReqRespMapKey = req._parsedUrl.pathname + md5(JSON.stringify(req.body)); - var responseObj = mockReqRespMap[mockReqRespMapKey]; + responseObj = mockReqRespMap[mockReqRespMapKey]; if (responseObj === undefined) { mockReqRespMapKey = req.url + md5(JSON.stringify(req.body)); if (mockReqRespMapKey.indexOf("?") >= 0)
tring to fix some undefined issue
FINRAOS_MSL
train
js
7cfce29f6c0a36b8d9a2f8f57392c84749cb1d84
diff --git a/src/Middleware.php b/src/Middleware.php index <HASH>..<HASH> 100644 --- a/src/Middleware.php +++ b/src/Middleware.php @@ -78,7 +78,7 @@ class Middleware public static function create(callable $factory) { return function (RequestInterface $request, ResponseInterface $response, callable $next) use ($factory) { - $middleware = $factory(); + $middleware = $factory($request, $response); if ($middleware === false) { return $next($request, $response);
access to request/response instances in Middleware:create()
oscarotero_psr7-middlewares
train
php
024e337e32f1db9c528ef15a99fd74f23cdaadf6
diff --git a/js/jquery.cloudinary.js b/js/jquery.cloudinary.js index <HASH>..<HASH> 100644 --- a/js/jquery.cloudinary.js +++ b/js/jquery.cloudinary.js @@ -228,7 +228,7 @@ } } - var prefix = window.location.protocol == 'file:' ? "file://" : (secure ? 'https://' : 'http://'); + var prefix = secure ? 'https://' : window.location.protocol + '//'; if (cloud_name.match(/^\//) && !secure) { prefix = "/res" + cloud_name; } else {
Secure option overrides window.location.protocol When the secure option is truthy, the the URL prefix will be set to https:// regardless of what the window.location.protocol is. When the option is falsy, the URL prefix will be the same as the window.location.protocol.
cloudinary_cloudinary_js
train
js
a53546fdd8f75947e3947769eb52b310e3cb145b
diff --git a/lib/parsers.js b/lib/parsers.js index <HASH>..<HASH> 100644 --- a/lib/parsers.js +++ b/lib/parsers.js @@ -128,10 +128,7 @@ exports.getContextFromRequest = function (req, logBody) { exports.getContextFromResponse = function (res, isError) { var context = { - status: { - code: res.statusCode, - message: res.statusMessage - }, + status_code: res.statusCode, headers: httpHeaders(res, true) }
refactor(*): support new context.response status code format This API schema change was introduced in elastic/apm-server#<I>
elastic_apm-agent-nodejs
train
js
ae0f50155571875d09ba969e7b062854c823b57d
diff --git a/Provider/HttpProvider.php b/Provider/HttpProvider.php index <HASH>..<HASH> 100755 --- a/Provider/HttpProvider.php +++ b/Provider/HttpProvider.php @@ -43,12 +43,13 @@ class HttpProvider implements ProviderInterface } $xml = curl_exec($session); - curl_close($session); if($xml === false) { throw new HttpException('cURL error: ' . curl_errno($session)); } + curl_close($session); + return $xml; }
Fixed bug with closing session before extracting error message.
EdgedesignCZ_ares
train
php
7fdf1868b0ea65e1edf81d04a56808cca9f7f8e5
diff --git a/Mbstring.php b/Mbstring.php index <HASH>..<HASH> 100644 --- a/Mbstring.php +++ b/Mbstring.php @@ -568,7 +568,7 @@ final class Mbstring } $rx .= '.{'.$split_length.'})/us'; - return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); } $result = [];
Passing null to preg_split() throws deprecation on PHP <I> > preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated
symfony_polyfill-mbstring
train
php
2744c6b10966fdb959626ba63e2b6b10bde2d460
diff --git a/spec/acceptance/acceptance_helper.rb b/spec/acceptance/acceptance_helper.rb index <HASH>..<HASH> 100644 --- a/spec/acceptance/acceptance_helper.rb +++ b/spec/acceptance/acceptance_helper.rb @@ -4,19 +4,19 @@ require "steak" require 'capybara/dsl' require 'rack' -require File.dirname(__FILE__) + '/../../tdiary_app' +require File.dirname(__FILE__) + '/../../tdiary/tdiary_application' Capybara.app = Rack::Builder.new do map '/' do - run Rack::TDiaryApp.new(:index) + run TDiary::Application.new(:index) end map '/index.rb' do - run Rack::TDiaryApp.new(:index) + run TDiary::Application.new(:index) end map '/update.rb' do - run Rack::TDiaryApp.new(:update) + run TDiary::Application.new(:update) end end
rename TDiary::Application
tdiary_tdiary-core
train
rb
9a063d84984c9a6762a3dcf3fc8498390694b073
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/batch_bootstrap_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/batch_bootstrap_controller.rb index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/batch_bootstrap_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/batch_bootstrap_controller.rb @@ -21,6 +21,9 @@ # Since 3.4 class BatchBootstrapController < Api::ApiController + # SONAR-4211 Access to index should not require authentication + skip_before_filter :check_authentication, :only => 'index' + # GET /batch_bootstrap/db?project=<key or id> def db project = load_project() @@ -51,7 +54,7 @@ class BatchBootstrapController < Api::ApiController render :json => JSON(json_properties) end - + # GET /batch_bootstrap/index def index redirect_to "/deploy/bootstrap/index.txt"
SONAR-<I> Allow Sonar Runner to work with secured server when sonar.forceAuthentication=true
SonarSource_sonarqube
train
rb
cf81397af07d0a13924138d46e7fb6d6c97c7454
diff --git a/azkaban-common/src/test/java/azkaban/executor/InteractiveTestJob.java b/azkaban-common/src/test/java/azkaban/executor/InteractiveTestJob.java index <HASH>..<HASH> 100644 --- a/azkaban-common/src/test/java/azkaban/executor/InteractiveTestJob.java +++ b/azkaban-common/src/test/java/azkaban/executor/InteractiveTestJob.java @@ -40,7 +40,7 @@ public class InteractiveTestJob extends AbstractProcessJob { } public static InteractiveTestJob getTestJob(final String name) { - for (int i = 0; i < 100; i++) { + for (int i = 0; i < 1000; i++) { if (testJobs.containsKey(name)) { return testJobs.get(name); } @@ -48,6 +48,7 @@ public class InteractiveTestJob extends AbstractProcessJob { try { InteractiveTestJob.testJobs.wait(10L); } catch (final InterruptedException e) { + i--; } } }
Improve InteractiveTestJob stability (#<I>) Wait for the job to appear for <I> seconds instead of 1 second. This should help avoid test failures when they're running slower than usual for some reason. If wait is interrupted, have another round (i--) of trying, so that the method always waits _at least_ <I> seconds before it gives up.
azkaban_azkaban
train
java
caccd60e213d4b66315c2206097b1bc628a635fe
diff --git a/applications/default/extensions/panel/panel.js b/applications/default/extensions/panel/panel.js index <HASH>..<HASH> 100644 --- a/applications/default/extensions/panel/panel.js +++ b/applications/default/extensions/panel/panel.js @@ -49,6 +49,50 @@ panel.type = function(types, callback) { } }; + newTypes['panelReaction'] = { + title: 'Panel reaction', + formTitle: 'Region', + description: 'Panel reaction item used on panel context reaction.', + standalone: false, + fields: { + region: { + title: 'Region', + description: 'Region to add the panel.', + type: 'text' + }, + panels: { + title: 'Panels', + description: 'Panels to show.', + type: 'reference', + reference: { + type: 'panelReactionPanel', + multiple: true, + inline: true + } + } + } + }; + + newTypes['panelReactionPanel'] = { + title: 'Panel reaction panel', + formTitle: 'Panel', + description: 'Panel reaction item panel used on panel context reaction.', + standalone: false, + fields: { + panel: { + title: 'Panel', + type: 'reference', + reference: { + type: 'panel' + } + }, + weight: { + title: 'Weight', + type: 'text' + } + } + }; + callback(null, newTypes); };
Adding missing types referenced by the panel context reaction type.
recidive_choko
train
js
d85a35d8741a5e534c0c45b194a716de10803198
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java index <HASH>..<HASH> 100644 --- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java +++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/engine/GremlinExecutor.java @@ -247,11 +247,12 @@ public class GremlinExecutor implements AutoCloseable { final Bindings bindings = new SimpleBindings(); bindings.putAll(globalBindings); bindings.putAll(boundVars); - lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings); final CompletableFuture<Object> evaluationFuture = new CompletableFuture<>(); final FutureTask<Void> f = new FutureTask<>(() -> { try { + lifeCycle.getBeforeEval().orElse(beforeEval).accept(bindings); + logger.debug("Evaluating script - {} - in thread [{}]", script, Thread.currentThread().getName()); final Object o = scriptEngines.eval(script, bindings, lang);
TINKERPOP3-<I> Move beforeEval to occur in same thread as eval In this way, beforeEval can working with ThreadLocal settings on the Graph instances (as it may pertain to transactions).
apache_tinkerpop
train
java
868ad1ce2af961a9de300cfc0dcc0b0318ef716c
diff --git a/test/bulb/index.js b/test/bulb/index.js index <HASH>..<HASH> 100644 --- a/test/bulb/index.js +++ b/test/bulb/index.js @@ -72,9 +72,9 @@ describe('Bulb', function () { }); }); - describe('#getColorTemperatureRange get', function () { + describe('#colorTemperatureRange get', function () { it('should return is_variable_color_temp from cached sysInfo if supported (LB120/LB130/KL430)', function () { - const range = bulb.getColorTemperatureRange; + const range = bulb.colorTemperatureRange; if (bulb.supportsColorTemperature) { expect(range) .to.to.have.property('min') @@ -99,7 +99,7 @@ describe('Bulb', function () { } }); it('should return null if not supported (LB100)', function () { - const range = bulb.getColorTemperatureRange; + const range = bulb.colorTemperatureRange; if (!bulb.supportsColorTemperature) { expect(range).to.be.null; expect(testDevice.model).to.not.match(/lb1[23]0/);
test: fix getColorTemperatureRange test
plasticrake_tplink-smarthome-api
train
js
d5133a859066ff66ad5d2040711e35d710d4e1a7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,11 @@ version = '0.1.1' ext_kwargs = dict( name = "pycosat", sources = ["pycosat.c"], - define_macros = [('PYCOSAT_VERSION', '"%s"' % version)], + define_macros = [] ) +if sys.platform != 'win32': + ext_kwargs['define_macros'].append(( + 'PYCOSAT_VERSION', '"%s"' % version)) if '--inplace' in sys.argv: ext_kwargs['define_macros'].append(('DONT_INCLUDE_PICOSAT', 1)) ext_kwargs['library_dirs'] = ['.']
don't use version macro on Windows
ContinuumIO_pycosat
train
py
8f9ab7fe562a0caf58af5a1e8af65446d5040134
diff --git a/modules/core/lib/Auth/Process/WarnShortSSOInterval.php b/modules/core/lib/Auth/Process/WarnShortSSOInterval.php index <HASH>..<HASH> 100644 --- a/modules/core/lib/Auth/Process/WarnShortSSOInterval.php +++ b/modules/core/lib/Auth/Process/WarnShortSSOInterval.php @@ -40,7 +40,7 @@ class sspmod_core_Auth_Process_WarnShortSSOInterval extends SimpleSAML_Auth_Proc $entityId = 'UNKNOWN'; } - SimpleSAML_Logger::warn('WarnShortSSOInterval: Only ' . $timeDelta . + SimpleSAML_Logger::warning('WarnShortSSOInterval: Only ' . $timeDelta . ' seconds since last SSO for this user from the SP ' . var_export($entityId, TRUE));
WarnShortSSOInterval: Log warnings with correct function.
simplesamlphp_saml2
train
php
33ac8a0927cc30f23105b44e9ef7943cce806c0e
diff --git a/python-package/xgboost/sklearn.py b/python-package/xgboost/sklearn.py index <HASH>..<HASH> 100644 --- a/python-package/xgboost/sklearn.py +++ b/python-package/xgboost/sklearn.py @@ -139,7 +139,6 @@ class XGBModel(XGBModelBase): self.silent = silent self.objective = objective self.booster = booster - self.nthread = nthread self.gamma = gamma self.min_child_weight = min_child_weight self.max_delta_step = max_delta_step
delete duplicated code in python-package (#<I>)
dmlc_xgboost
train
py
9979b11b59483c7178500b07d0b636ac99d76246
diff --git a/model/ArrayList.php b/model/ArrayList.php index <HASH>..<HASH> 100644 --- a/model/ArrayList.php +++ b/model/ArrayList.php @@ -130,7 +130,9 @@ class ArrayList extends ViewableData implements SS_List, SS_Filterable, SS_Sorta * @return ArrayList */ public function limit($length, $offset = 0) { - return new ArrayList(array_slice($this->items, $offset, $length)); + $list = clone $this; + $list->items = array_slice($this->items, $offset, $length); + return $list; } /**
FIX Make sure ArrayList#limit uses clone so for subclasses it returns instances of same subclass
silverstripe_silverstripe-framework
train
php
903fedb36de1e8808eabeac774ed1f5193f24b2c
diff --git a/js/i18n/defaults-it_IT.js b/js/i18n/defaults-it_IT.js index <HASH>..<HASH> 100644 --- a/js/i18n/defaults-it_IT.js +++ b/js/i18n/defaults-it_IT.js @@ -8,8 +8,12 @@ $.fn.selectpicker.defaults = { noneSelectedText: 'Nessuna selezione', noneResultsText: 'Nessun risultato per {0}', - countSelectedText: 'Selezionati {0} di {1}', + countSelectedText: function (numSelected, numTotal){ + return (numSelected == 1) ? 'Selezionato {0} di {1}' : 'Selezionati {0} di {1}'; + }, maxOptionsText: ['Limite raggiunto ({n} {var} max)', 'Limite del gruppo raggiunto ({n} {var} max)', ['elementi', 'elemento']], - multipleSeparator: ', ' + multipleSeparator: ', ', + selectAllText: 'Seleziona Tutto', + deselectAllText: 'Deseleziona Tutto', }; })(jQuery);
select text addition and logic to countselected I added selectAllText and deselectAllText I also added logic to countSelectedText to detect singular
snapappointments_bootstrap-select
train
js
33e512385897f56bcaf7e72707e04a8aa7027620
diff --git a/concrete/controllers/backend/page.php b/concrete/controllers/backend/page.php index <HASH>..<HASH> 100644 --- a/concrete/controllers/backend/page.php +++ b/concrete/controllers/backend/page.php @@ -16,25 +16,21 @@ class Page extends Controller public function create($ptID, $parentID = false) { $pagetype = PageType::getByID(Loader::helper('security')->sanitizeInt($ptID)); - if ($parentID) { - $parent = ConcretePage::getByID($parentID); - } if (is_object($pagetype)) { $proceed = false; + $parent = $parentID ? ConcretePage::getByID($parentID) : null; if (is_object($parent) && !$parent->isError()) { $pp = new Permissions($parent); $proceed = $pp->canAddSubCollection($pagetype); } else { $ptp = new Permissions($pagetype); $proceed = $ptp->canAddPageType(); - if (isset($parent)) { - unset($parent); - } + $parent = null; } if ($proceed) { $pt = $pagetype->getPageTypeDefaultPageTemplateObject(); $d = $pagetype->createDraft($pt); - if (is_object($parent)) { + if ($parent !== null) { $d->setPageDraftTargetParentPageID($parent->getCollectionID()); }
Avoid accessing undefined variable in page backend controller
concrete5_concrete5
train
php