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
249901bf2cf319295e055f11a0c387dcd2c25f72
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -22,6 +22,8 @@ module.exports = function(json, options) { maxFileSize = options.maxFileSize; } const ajv = new Ajv({ + schemaId: 'id', // for draft-04 + meta: false, // don't load draft-07 meta schema allErrors: true, unknownFormats: true, errorDataPath: 'property', @@ -39,6 +41,9 @@ module.exports = function(json, options) { ajv.removeKeyword('propertyNames'); ajv.removeKeyword('contains'); ajv.removeKeyword('const'); + ajv.removeKeyword('if'); + ajv.removeKeyword('then'); + ajv.removeKeyword('else'); ajv.addKeyword('maxFileSize', { validate: function validateMaxFileSize(schema, data) {
fix: for ajv@6 with JSON Schema draft-<I>
kintone_plugin-manifest-validator
train
js
27cbfc75b6849f8fdf876bec6951d1ef5df39bec
diff --git a/isort/isort.py b/isort/isort.py index <HASH>..<HASH> 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -220,7 +220,7 @@ class _SortImports: module_name = str(module_name) if sub_imports and config["order_by_type"]: - if module_name.isupper() and len(module_name) > 1: + if module_name.isupper() and len(module_name) > 1: # see issue #376 prefix = "A" elif module_name[0:1].isupper(): prefix = "B"
Add comment mentioning relevant ticket at line upercasing letter
timothycrosley_isort
train
py
38cdd02a5cdffeb273486d3a87300b124ed4b8dc
diff --git a/minicluster/src/main/java/tachyon/master/LocalTachyonCluster.java b/minicluster/src/main/java/tachyon/master/LocalTachyonCluster.java index <HASH>..<HASH> 100644 --- a/minicluster/src/main/java/tachyon/master/LocalTachyonCluster.java +++ b/minicluster/src/main/java/tachyon/master/LocalTachyonCluster.java @@ -388,6 +388,7 @@ public final class LocalTachyonCluster { if (mUfsCluster != null) { mUfsCluster.cleanup(); } + // TODO(gpang): is this line necessary? System.clearProperty("tachyon.underfs.address"); }
Add todo for investigating system property clearing
Alluxio_alluxio
train
java
33068e47471b256264d58475a2157365e947677d
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,12 +31,12 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.3.13'; - public const VERSION_ID = '10313'; + public const VERSION = '1.3.14-DEV'; + public const VERSION_ID = '10314'; public const MAJOR_VERSION = '1'; public const MINOR_VERSION = '3'; - public const RELEASE_VERSION = '13'; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = '14'; + public const EXTRA_VERSION = 'DEV'; public function __construct(string $environment, bool $debug) {
Change application's version to <I>-DEV
Sylius_Sylius
train
php
f063f1f4f1d0dfd9376035df3a53a733991daf24
diff --git a/examples/apps/JavaScript/Chart/appclass.js b/examples/apps/JavaScript/Chart/appclass.js index <HASH>..<HASH> 100644 --- a/examples/apps/JavaScript/Chart/appclass.js +++ b/examples/apps/JavaScript/Chart/appclass.js @@ -155,10 +155,10 @@ F2.Apps["com_openf2_examples_javascript_chart"] = (function(){ // Add the up month/down month data to the chart's series - //issue #1 + //GH issue #1 //hcChartObj.series[1].setData(upSeriesData, false); //hcChartObj.series[2].setData(downSeriesData, false); - + hcChartObj.yAxis[0].setExtremes(dataRanges.dataMin, dataRanges.dataMax, true, false); this.ui.updateHeight();
Fixes chart in IE #1
OpenF2_F2
train
js
2947bd7a71c06cc31364f7be9af5eb8f42f53e9a
diff --git a/rfc1869.js b/rfc1869.js index <HASH>..<HASH> 100644 --- a/rfc1869.js +++ b/rfc1869.js @@ -33,7 +33,7 @@ exports.parse = function(type, line) { var matches; while (matches = chew_regexp.exec(line)) { params.push(matches[1]); - line = line.slice(matches[1].length); + line = line.slice(matches[0].length); } params = params.reverse();
Need to zeroth element to slice off not the bracketed match
haraka_Haraka
train
js
a71c5930d3bbdf5b3bbd0548da0f9ba958cd2ae1
diff --git a/lib/safe_yaml/psych_resolver.rb b/lib/safe_yaml/psych_resolver.rb index <HASH>..<HASH> 100644 --- a/lib/safe_yaml/psych_resolver.rb +++ b/lib/safe_yaml/psych_resolver.rb @@ -14,7 +14,12 @@ module SafeYAML end def resolve_tree(tree) - resolve_node(tree)[0] + case tree + when Psych::Nodes::Document + resolve_node(tree)[0] + else + resolve_node(tree) + end end def resolve_alias(node)
fixed PsychResolver for older versions of Psych (Ruby <I>)
dtao_safe_yaml
train
rb
cd72b31c2d8cf2914a9c1db55096f8f15f0b7be6
diff --git a/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php b/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php index <HASH>..<HASH> 100644 --- a/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php +++ b/tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php @@ -560,7 +560,8 @@ class VerbalExpressionsTest extends PHPUnit_Framework_TestCase /** * @depends testGetRegex */ - public function testReplace() { + public function testReplace() + { $regex = new VerbalExpressions(); $regex->add('foo');
rolling back change to verify that psr-2 violations trigger a failed travis build
VerbalExpressions_PHPVerbalExpressions
train
php
7e7545e55654b9bf096101dab5f3a33caa9420a4
diff --git a/contrib/seccomp/seccomp_default.go b/contrib/seccomp/seccomp_default.go index <HASH>..<HASH> 100644 --- a/contrib/seccomp/seccomp_default.go +++ b/contrib/seccomp/seccomp_default.go @@ -235,11 +235,13 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp { "prctl", "pread64", "preadv", + "preadv2", "prlimit64", "pselect6", "pselect6_time64", "pwrite64", "pwritev", + "pwritev2", "read", "readahead", "readlink",
seccomp: allow add preadv2 and pwritev2 syscalls
containerd_containerd
train
go
cc95005a7b4c1109a47d697f3d61551457722322
diff --git a/lib/dcell/messages.rb b/lib/dcell/messages.rb index <HASH>..<HASH> 100644 --- a/lib/dcell/messages.rb +++ b/lib/dcell/messages.rb @@ -26,6 +26,8 @@ module DCell # A request to open relay pipe class RelayOpen < Message + attr_reader :sender + def initialize(sender) @id = DCell.id @sender = sender @@ -92,6 +94,8 @@ module DCell # Ping message checks if remote node is alive or not class Ping < Message + attr_reader :sender + def initialize(sender) @sender = sender end
messages: export sender attribute for Ping and RelayOpen messages
celluloid_dcell
train
rb
d0ff4a9e819d4ec4a37592eba48f51e1eeafaa46
diff --git a/src/Utils/XmlLoaderUtils.php b/src/Utils/XmlLoaderUtils.php index <HASH>..<HASH> 100644 --- a/src/Utils/XmlLoaderUtils.php +++ b/src/Utils/XmlLoaderUtils.php @@ -23,7 +23,10 @@ class XmlLoaderUtils throw new OpdsParserNotFoundException(); } - $content = fread($handle, filesize($file)); + + while (!feof($handle)) { + $content .= fread($handle, 8192); // 8192 : nombre d'octets équivalent à la taille d'un bloc + } fclose($handle); return new \SimpleXMLElement($content);
MBW-<I> update read file
BOOKEEN_opds-parser
train
php
455f87a66cc94fed432de5d794f94ca6cdb058fc
diff --git a/kcp.go b/kcp.go index <HASH>..<HASH> 100644 --- a/kcp.go +++ b/kcp.go @@ -785,7 +785,7 @@ func (kcp *KCP) flush(ackOnly bool) { needsend = true segment.xmit++ segment.fastack = 0 - segment.resendts = current + segment.rto + segment.resendts = current + kcp.rx_rto change++ fastRetransSegs++ } else if segment.fastack > 0 && newSegsCount == 0 && @@ -793,7 +793,7 @@ func (kcp *KCP) flush(ackOnly bool) { needsend = true segment.xmit++ segment.fastack = 0 - segment.resendts = current + segment.rto + segment.resendts = current + kcp.rx_rto change++ earlyRetransSegs++ }
reset RTO for fastacked packets
xtaci_kcp-go
train
go
33a898954d5b5ef212bf918a979c1d81fe2b30d1
diff --git a/api/src/main/java/io/neba/api/tags/package-info.java b/api/src/main/java/io/neba/api/tags/package-info.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/io/neba/api/tags/package-info.java +++ b/api/src/main/java/io/neba/api/tags/package-info.java @@ -20,10 +20,11 @@ * of project-specific implementations to the NEBA core, i.e. to prevent * project code to inherit from these tag implementations. */ -@TagLibrary(value = "http://www.neba.io/core/1.0", +@TagLibrary( + value = "http://neba.io/1.0", descriptorFile = "neba.tld", shortName = "neba", - description = "NEBA core tag library", + description = "NEBA tag library", libraryVersion = "1.0") package io.neba.api.tags;
neba-9 Change the taglib URI to match the fact that it is published via the API bundle
unic_neba
train
java
8441affb21179664ef7e03dcf7e4be3bc7063b5e
diff --git a/icalevents/icalparser.py b/icalevents/icalparser.py index <HASH>..<HASH> 100644 --- a/icalevents/icalparser.py +++ b/icalevents/icalparser.py @@ -408,7 +408,10 @@ def parse_events(content, start=None, end=None, default_span=timedelta(days=7)): if exdate not in exceptions: found.append(e) # Filter out all events that are moved as indicated by the recurrence-id prop - return [event for event in found if e.sequence is None or not (event.uid, event.start, e.sequence) in recurrence_ids] + return [ + event for event in found + if e.sequence is None or not (event.uid, event.start, e.sequence) in recurrence_ids + ] def parse_rrule(component, tz=UTC):
Split up list comprehension for readability.
irgangla_icalevents
train
py
9b8e99221eaef2bfff79fd8eb0936abf43462f5a
diff --git a/src/main/java/com/couchbase/lite/replicator/Pusher.java b/src/main/java/com/couchbase/lite/replicator/Pusher.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/replicator/Pusher.java +++ b/src/main/java/com/couchbase/lite/replicator/Pusher.java @@ -92,6 +92,7 @@ public final class Pusher extends Replication implements Database.ChangeListener return; } Log.v(Database.TAG, "Remote db might not exist; creating it..."); + asyncTaskStarted(); sendAsyncRequest("PUT", "", null, new RemoteRequestCompletionBlock() { @Override @@ -104,6 +105,7 @@ public final class Pusher extends Replication implements Database.ChangeListener } shouldCreateTarget = false; beginReplicating(); + asyncTaskFinished(1); } });
Issue #<I> - was not calling asyncTaskStarted() and asyncTaskFinished() when making remote request to create a remote DB. Needed for testPusher() to pass w/o having any exceptions. <URL>
couchbase_couchbase-lite-java-core
train
java
b8988ecf7edfbcb414fc93baa54e702f95ed80fe
diff --git a/lib/oxidized/pfsense.rb b/lib/oxidized/pfsense.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/pfsense.rb +++ b/lib/oxidized/pfsense.rb @@ -1,6 +1,5 @@ class PfSense < Oxidized::Model - prompt /^\e\[0;1;33m\[\S*\e\[0;1;33m\]\e\[0;1;33m\e\[\S*\e\[0;1;31m@\S*\e\[0;1;33m\]\S*\e\[0;1;31m:\e\[0;0;0m\s$/ comment '# ' @@ -20,6 +19,10 @@ class PfSense < Oxidized::Model end + cfg :ssh do + exec true + end + cfg :telnet do username /^Username:/ password /^Password:/
Switched from prompt grap to ssh exec
ytti_oxidized
train
rb
03d4e6d82965db77946a862c35e00807ae348ba9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -10,20 +10,20 @@ const util = require('./src/util') const version = require('./package').version -const install = function () { - return host.install() +const install = function (...args) { + return host.install(...args) } const environ = function () { return console.log(JSON.stringify(host.environ(), null, ' ')) // eslint-disable-line no-console } -const start = function (address='127.0.0.1', port=2000) { - return host.start(address, port) +const start = function (...args) { + return host.start(...args) } -const stop = function () { - return host.stop() +const stop = function (...args) { + return host.stop(...args) } -const run = function (address='127.0.0.1', port=2000, timeout=Infinity, duration=Infinity) { - return host.run(address, port, timeout, duration) +const run = function (...args) { + return host.run(...args) } module.exports = {
Pass args on to host methods
stencila_node
train
js
63005e9190a8ae71075eed55411ee6188415272f
diff --git a/src/instrumentation/transaction.js b/src/instrumentation/transaction.js index <HASH>..<HASH> 100644 --- a/src/instrumentation/transaction.js +++ b/src/instrumentation/transaction.js @@ -1,5 +1,6 @@ var logger = require('../lib/logger') var Trace = require('./trace') +var utils = require('../lib/utils') var Transaction = function (queue, name, type, options) { this.metadata = {} @@ -9,6 +10,7 @@ var Transaction = function (queue, name, type, options) { this._markDoneAfterLastTrace = false this._isDone = false this._options = options + this.uuid = utils.generateUuid() this.traces = [] this._activeTraces = {}
Generate UUID on Transcations for easier debugging
opbeat_opbeat-react
train
js
c97f33f9a4e2263417bde58b3f512e3583fada32
diff --git a/core/src/main/java/hudson/matrix/MatrixBuild.java b/core/src/main/java/hudson/matrix/MatrixBuild.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/matrix/MatrixBuild.java +++ b/core/src/main/java/hudson/matrix/MatrixBuild.java @@ -104,7 +104,7 @@ public class MatrixBuild extends AbstractBuild<MatrixProject,MatrixBuild> { return; } - List<MatrixRun> runs = getRuns(); + List<MatrixRun> runs = getExactRuns(); for(MatrixRun run : runs){ why = run.getWhyKeepLog(); if (why!=null) {
When deleting whole matrix build, including sub-builds, delete only builds which actually run, not linekd ones
jenkinsci_jenkins
train
java
4e1c07b1fd6ac5a81f006ce6c26b72d0deb5807e
diff --git a/src/Pdf/Engine/DomPdfEngine.php b/src/Pdf/Engine/DomPdfEngine.php index <HASH>..<HASH> 100644 --- a/src/Pdf/Engine/DomPdfEngine.php +++ b/src/Pdf/Engine/DomPdfEngine.php @@ -2,7 +2,6 @@ namespace CakePdf\Pdf\Engine; use CakePdf\Pdf\CakePdf; -use Dompdf\Dompdf; class DomPdfEngine extends AbstractPdfEngine { @@ -30,7 +29,7 @@ class DomPdfEngine extends AbstractPdfEngine */ public function output() { - $DomPDF = new Dompdf(); + $DomPDF = new \DOMPDF(); $DomPDF->set_paper($this->_Pdf->pageSize(), $this->_Pdf->orientation()); $DomPDF->load_html($this->_Pdf->html()); $DomPDF->render();
Revert back namespace change for dompdf. Changing the namespace meant one needed to use dompdf <I>beta. Such a change should not have been done in a bugfix release.
FriendsOfCake_CakePdf
train
php
efd1dbf54a800c197ea40def4b54a6c87c50f541
diff --git a/core/src/main/java/org/springframework/security/authentication/ProviderManager.java b/core/src/main/java/org/springframework/security/authentication/ProviderManager.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/springframework/security/authentication/ProviderManager.java +++ b/core/src/main/java/org/springframework/security/authentication/ProviderManager.java @@ -205,7 +205,7 @@ public class ProviderManager extends AbstractAuthenticationManager implements Me * * @return {@link ConcurrentSessionController} instance */ - public ConcurrentSessionController getSessionController() { + ConcurrentSessionController getSessionController() { return sessionController; }
Removed public modifier from getSessionController() method on ProviderManager.
spring-projects_spring-security
train
java
46bce702d06da9c7b0c8c3d7d391e8f4409a4dd0
diff --git a/queue.go b/queue.go index <HASH>..<HASH> 100644 --- a/queue.go +++ b/queue.go @@ -50,7 +50,7 @@ func (q *queue) peek() interface{} { func (q *queue) dequeue() { q.head = (q.head+1) % len(q.buf) q.count-- - if len(q.buf) > minQueueLen && q.count*3 < len(q.buf) { + if len(q.buf) > minQueueLen && q.count*4 < len(q.buf) { q.resize() } }
Be slightly less agressive in shrinking the queue. The power of two is marginally more efficient to calculate, and the less agressive bounds mean we have to reallocate+copy less. It does mean we might waste slightly more memory when a large buffer is emptied, but given that garbage-collection means old slices aren't necessarily freed immediately anyways, that isn't a big deal.
eapache_channels
train
go
126accf63d34ff655bf28cee19170daadb2022b9
diff --git a/django_tenants/migration_executors/base.py b/django_tenants/migration_executors/base.py index <HASH>..<HASH> 100644 --- a/django_tenants/migration_executors/base.py +++ b/django_tenants/migration_executors/base.py @@ -3,6 +3,7 @@ import sys from django.db import transaction from django.core.management.commands.migrate import Command as MigrateCommand +from django.db.migrations.recorder import MigrationRecorder from django_tenants.signals import schema_migrated, schema_migrate_message from django_tenants.utils import get_public_schema_name, get_tenant_database_alias @@ -38,6 +39,11 @@ def run_migrations(args, options, executor_codename, schema_name, tenant_type='' connection = connections[options.get('database', get_tenant_database_alias())] connection.set_schema(schema_name, tenant_type=tenant_type) + # ensure that django_migrations table is created in the schema before migrations run, otherwise the migration + # table in the public schema gets picked and no migrations are applied + migration_recorder = MigrationRecorder(connection) + migration_recorder.ensure_schema() + stdout = OutputWrapper(sys.stdout) stdout.style_func = style_func stderr = OutputWrapper(sys.stderr)
Ensure django_migrations table is created in a schema before migrations begin
tomturner_django-tenants
train
py
f7f49084810ad47cfb0d3b518ad6a18b7bbab49e
diff --git a/websockets/protocol.py b/websockets/protocol.py index <HASH>..<HASH> 100644 --- a/websockets/protocol.py +++ b/websockets/protocol.py @@ -379,7 +379,7 @@ class WebSocketCommonProtocol(asyncio.StreamReaderProtocol): # longer than the worst case (2 * self.timeout) but not unlimited. if self.state == CLOSING: yield from asyncio.wait_for( - self.connection_closed, 3 * self.timeout, loop=self.loop) + self.worker, 3 * self.timeout, loop=self.loop) raise ConnectionClosed(self.close_code, self.close_reason) # Control may only reach this point in buggy third-party subclasses.
Prevent unintended timeout. The library considers that its job is done when the worker task exits. Usually connection_closed will have been set by connection_lost, but this is somewhat outside of our control, making it preferrable to test consistently for the worker's termination.
aaugustin_websockets
train
py
389c5dbe1a4701afc67d4dcdc5708277e2766925
diff --git a/lib/transit/handlers.rb b/lib/transit/handlers.rb index <HASH>..<HASH> 100644 --- a/lib/transit/handlers.rb +++ b/lib/transit/handlers.rb @@ -231,13 +231,13 @@ module Transit class SetHandler def tag(_) "set" end - def rep(s) TaggedValue.new("array", s.to_a) end + def rep(s) s.to_a end def string_rep(_) nil end end class ListHandler def tag(_) "list" end - def rep(l) TaggedValue.new("array", l.to_a) end + def rep(l) l.to_a end def string_rep(_) nil end end @@ -246,7 +246,7 @@ module Transit @type = type end def tag(_) @type end - def rep(a) TaggedValue.new("array", a.to_a) end + def rep(a) a.to_a end def string_rep(_) nil end end
remove unneeded use of TaggedValues (arrays already marshall as arrays)
cognitect_transit-ruby
train
rb
a720847414bce8c1e1ca273fbf1db9092ae8d202
diff --git a/io/flushing_writer_test.go b/io/flushing_writer_test.go index <HASH>..<HASH> 100644 --- a/io/flushing_writer_test.go +++ b/io/flushing_writer_test.go @@ -13,6 +13,7 @@ import ( "net" "net/http" "net/http/httptest" + "sync" "time" check "gopkg.in/check.v1" @@ -166,3 +167,24 @@ func (h *hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) { } return h.conn, &rw, nil } + +func (s *S) TestFlushingWriterFlushAfterWrite(c *check.C) { + wg := sync.WaitGroup{} + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + flusher, ok := w.(WriterFlusher) + c.Assert(ok, check.Equals, true) + fw := FlushingWriter{WriterFlusher: flusher} + defer fw.Flush() + for i := 0; i < 100; i++ { + wg.Add(1) + go func() { + defer wg.Done() + fw.Write([]byte("a")) + }() + } + })) + defer srv.Close() + _, err := http.Get(srv.URL) + c.Assert(err, check.IsNil) + wg.Wait() +}
io: add test to expose panic in write after close with flushing writer
tsuru_tsuru
train
go
ff473ee3fa72d52c828833cf610a0150af606d72
diff --git a/spyder/widgets/editor.py b/spyder/widgets/editor.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/editor.py +++ b/spyder/widgets/editor.py @@ -1318,6 +1318,9 @@ class EditorStack(QWidget): # Save the currently edited file index = self.get_stack_index() finfo = self.data[index] + # The next line is necessary to avoid checking if the file exists + # While running __check_file_status + # See issues 3678 and 3026 finfo.newly_created = True filename = self.select_savename(finfo.filename) if filename:
Added comment about the necessity of the change
spyder-ide_spyder
train
py
5c906c54f548f7ed8790f8f097d5bff228449d96
diff --git a/sunspot_rails/lib/sunspot/rails/stub_session_proxy.rb b/sunspot_rails/lib/sunspot/rails/stub_session_proxy.rb index <HASH>..<HASH> 100644 --- a/sunspot_rails/lib/sunspot/rails/stub_session_proxy.rb +++ b/sunspot_rails/lib/sunspot/rails/stub_session_proxy.rb @@ -148,6 +148,7 @@ module Sunspot def previous_page nil end + alias :prev_page :previous_page def next_page nil
Added prev_page alias to stubbed PaginatedCollection Also see <URL>
sunspot_sunspot
train
rb
0ece27c073a38bd0a69f9b7bec298d6c761e76a4
diff --git a/src/Netzmacht/Bootstrap/Installer.php b/src/Netzmacht/Bootstrap/Installer.php index <HASH>..<HASH> 100644 --- a/src/Netzmacht/Bootstrap/Installer.php +++ b/src/Netzmacht/Bootstrap/Installer.php @@ -86,10 +86,10 @@ class Installer } if(!$success) { - \Controller::log("Error during creating symlink '$target'", 'Netzmacht\Bootstrap\Installer createSymlink', TL_ERROR); + \Controller::log("Error during creating symlink '$target'", 'Netzmacht\Bootstrap\Installer createSymlink', 'TL_ERROR'); } else { - \Controller::log("Created symlink '$target'", 'Netzmacht\Bootstrap\Installer createSymlink', TL_INFO); + \Controller::log("Created symlink '$target'", 'Netzmacht\Bootstrap\Installer createSymlink', 'TL_INFO'); } }
fix usage of undefined TL_INFO class
netzmacht-archive_contao-bootstrap
train
php
14ffb555f077575a9da12e5ad892376cafc3e016
diff --git a/classes/fields/pick.php b/classes/fields/pick.php index <HASH>..<HASH> 100644 --- a/classes/fields/pick.php +++ b/classes/fields/pick.php @@ -1299,11 +1299,21 @@ class PodsField_Pick extends PodsField { $selected = false; if ( is_array( $args->value ) ) { - // Cast values in array as string. - $args->value = array_map( 'strval', $args->value ); + if ( ! isset( $args->value[0] ) ) { + $keys = array_map( 'strval', array_keys( $args->value ) ); - if ( in_array( (string) $item_id, $args->value, true ) ) { - $selected = true; + if ( in_array( (string) $item_id, $keys, true ) ) { + $selected = true; + } + } + + if ( ! $selected ) { + // Cast values in array as string. + $args->value = array_map( 'strval', $args->value ); + + if ( in_array( (string) $item_id, $args->value, true ) ) { + $selected = true; + } } } elseif ( (string) $item_id === (string) $args->value ) { $selected = true;
Records added modally via DFV's 'Add New' were not being selected
pods-framework_pods
train
php
62088a88aa1e827b4d51cb9088b18cb2e86c37bd
diff --git a/mockserver-core/src/test/java/org/mockserver/configuration/ConfigurationTest.java b/mockserver-core/src/test/java/org/mockserver/configuration/ConfigurationTest.java index <HASH>..<HASH> 100644 --- a/mockserver-core/src/test/java/org/mockserver/configuration/ConfigurationTest.java +++ b/mockserver-core/src/test/java/org/mockserver/configuration/ConfigurationTest.java @@ -443,7 +443,7 @@ public class ConfigurationTest { long original = ConfigurationProperties.maxFutureTimeout(); try { // then - default value - assertThat(configuration.maxFutureTimeoutInMillis(), equalTo(60000L)); + assertThat(configuration.maxFutureTimeoutInMillis(), equalTo(90000L)); // when - system property setter ConfigurationProperties.maxFutureTimeout(10L);
increase max future timeout by <I> seconds to allow for state retrieve were the log is very large - fixed test
jamesdbloom_mockserver
train
java
4f0ca83fea6d8ad91cb282cc871790035c4c73f4
diff --git a/js/lib/mediawiki.TokenTransformManager.js b/js/lib/mediawiki.TokenTransformManager.js index <HASH>..<HASH> 100644 --- a/js/lib/mediawiki.TokenTransformManager.js +++ b/js/lib/mediawiki.TokenTransformManager.js @@ -101,7 +101,10 @@ TokenTransformManager.prototype._cmpTransformations = function ( a, b ) { * @param {String} tag name for tags, omitted for non-tags */ TokenTransformManager.prototype.addTransform = function ( transformation, debug_name, rank, type, name ) { - var t = { rank: rank }; + var t = { + rank: rank, + name: debug_name + }; if (!this.env.trace) { t.transform = transformation; } else { @@ -741,6 +744,12 @@ SyncTokenTransformManager.prototype.onChunk = function ( tokens ) { //this.env.dp( 'sync res:', res ); if ( res.tokens && res.tokens.length ) { + if ( token.constructor === EOFTk && + res.tokens.last().constructor !== EOFTk ) { + console.error( 'ERROR: EOFTk was dropped by ' + transformer.name ); + // fix it up for now by adding it back in + res.tokens.push(token); + } // Splice in the returned tokens (while replacing the original // token), and process them next. var revTokens = res.tokens.slice();
Make sure the EOFTk is preserved in the SyncTokenTransformer And blame transformers when they drop it. Change-Id: Ib<I>fd<I>d0a3e<I>b0dfaf2bd9b4cd<I>f
wikimedia_parsoid
train
js
c4104b531078b282618b7b7004922142032854da
diff --git a/src/__tests__/reduxForm.spec.js b/src/__tests__/reduxForm.spec.js index <HASH>..<HASH> 100644 --- a/src/__tests__/reduxForm.spec.js +++ b/src/__tests__/reduxForm.spec.js @@ -1566,6 +1566,33 @@ const describeReduxForm = (name, structure, combineReducers, expect) => { expect(decorated.wrappedInstance.props).toEqual(wrapped.props) }) + + it('should return an empty list if there are no registered fields', () => { + const store = makeStore({}) + + class Form extends Component { + render() { + return ( + <form> + </form> + ) + } + } + + const Decorated = reduxForm({ + form: 'testForm' + })(Form) + + const dom = TestUtils.renderIntoDocument( + <Provider store={store}> + <Decorated/> + </Provider> + ) + + const decorated = TestUtils.findRenderedComponentWithType(dom, Decorated) + + expect(decorated.refs.wrapped.getWrappedInstance().getFieldList()).toEqual([]) + }) }) }
added "empty registered fields" test from #<I>
erikras_redux-form
train
js
828e83562a0f3910eeb4db36c6530af6abd8a7ad
diff --git a/alot/init.py b/alot/init.py index <HASH>..<HASH> 100755 --- a/alot/init.py +++ b/alot/init.py @@ -44,7 +44,7 @@ def parse_args(): choices=['debug', 'info', 'warning', 'error'], help='debug level') parser.add_argument('-l', dest='logfile', - default='debug.log', + default='/dev/null', help='logfile') parser.add_argument('query', nargs='?', default='tag:inbox AND NOT tag:killed', @@ -62,7 +62,8 @@ def main(): # setup logging numeric_loglevel = getattr(logging, args.debug_level.upper(), None) - logging.basicConfig(level=numeric_loglevel, filename=args.logfile) + logfilename = os.path.expanduser(args.logfile) + logging.basicConfig(level=numeric_loglevel, filename=logfilename) logger = logging.getLogger() # get ourselves a database manager
log to /dev/null by default
pazz_alot
train
py
d6f1c6f976f737b851f6bd0752b57f80cf1f33ea
diff --git a/src/require.js b/src/require.js index <HASH>..<HASH> 100644 --- a/src/require.js +++ b/src/require.js @@ -119,6 +119,13 @@ function _gpfRequireResolve (name) { return _gpfPathJoin(this.base, name); } +function _gpfRequireDocumentStack (reason, name) { + if (!Array.isArray(reason.requires)) { + reason.requires = []; + } + reason.requires.push(name); +} + /** * Get the cached resource or load it * @@ -134,7 +141,10 @@ function _gpfRequireGet (name) { } promise = _gpfRequireLoad.call(me, name); me.cache[name] = promise; - return promise; + return promise["catch"](function (reason) { + _gpfRequireDocumentStack(reason, name); + return Promise.reject(reason); + }); } /**
Document requires path (#<I>)
ArnaudBuchholz_gpf-js
train
js
407760e1cdd176a5879efa434a0372c36ed9dcf0
diff --git a/ghost/admin/app/helpers/parse-member-event.js b/ghost/admin/app/helpers/parse-member-event.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/helpers/parse-member-event.js +++ b/ghost/admin/app/helpers/parse-member-event.js @@ -11,7 +11,7 @@ export default function parseMemberEvent(event, hasMultipleNewsletters) { let timestamp = moment(event.data.created_at); return { - memberId: event.data.member_id, + memberId: event.data.member_id ?? event.data.member?.id, member: event.data.member, emailId: event.data.email_id, email: event.data.email,
Fixed clicking on member in dashboard activity feed comment events refs <URL>
TryGhost_Ghost
train
js
c0c5e4bd1da1586efb6311b856dfc071d3b11b03
diff --git a/lib/dm-core.rb b/lib/dm-core.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core.rb +++ b/lib/dm-core.rb @@ -17,7 +17,7 @@ require 'yaml' require 'rubygems' -gem 'addressable', '>=1.0.4' +gem 'addressable', '=2.0.0' require 'addressable/uri' gem 'extlib', '>=0.9.5'
Updated gem() dependency to be =<I>
datamapper_dm-core
train
rb
806497c2c5e15983aaef435805bd212e316af7ac
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,2 @@ gem 'rspec', '~> 2.4' require 'rspec' -require 'hexdump/version' - -include Hexdump
Do not include Hexdump.
postmodern_hexdump
train
rb
44bf050da02fad698ec962bfefe0f3f8955a8595
diff --git a/api/src/opentrons/api/session.py b/api/src/opentrons/api/session.py index <HASH>..<HASH> 100755 --- a/api/src/opentrons/api/session.py +++ b/api/src/opentrons/api/session.py @@ -548,15 +548,6 @@ class Session(object): self._broker.set_logger(self._default_logger) return self - def identify(self): - self._hw_iface().identify() - - def turn_on_rail_lights(self): - self._hw_iface().set_lights(rails=True) - - def turn_off_rail_lights(self): - self._hw_ifce().set_lights(rails=False) - def set_state(self, state): log.debug("State set to {}".format(state)) if state not in VALID_STATES:
fix(api): typo in Session.turn_off_rail_lights (#<I>) * fix typo in Session.turn_off_rail_lights * remove identify, turn_on_rail_lights, and turn_off_rail_lights from Session. these methods are not used.
Opentrons_opentrons
train
py
6119912e477035eaea14053d337889484b2a86ed
diff --git a/bernhard/__init__.py b/bernhard/__init__.py index <HASH>..<HASH> 100644 --- a/bernhard/__init__.py +++ b/bernhard/__init__.py @@ -15,8 +15,22 @@ class TransportError(Exception): class TCPTransport(object): def __init__(self, host, port): - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((host, port)) + for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM): + af, socktype, proto, canonname, sa = res + try: + self.sock = socket.socket(af, socktype, proto) + except socket.error, e: + self.sock = None + continue + try: + self.sock.connect(sa) + except socket.error, e: + self.sock.close() + self.sock = None + continue + break + if self.sock is None: + raise TransportError("Could not open socket.") def close(self): self.sock.close() @@ -58,7 +72,7 @@ class UDPTransport(object): self.sock = socket.socket(af, socktype, proto) self.host = sa[0] self.port = sa[1] - except socket.error as msg: + except socket.error, e: self.sock = None continue break
Add dual-stack support for TCP transport.
banjiewen_bernhard
train
py
db434e8ce4ac7f5070d8f7e7563dfe8f21c3af14
diff --git a/src/component.js b/src/component.js index <HASH>..<HASH> 100644 --- a/src/component.js +++ b/src/component.js @@ -1,5 +1,8 @@ -import { select, local } from "d3-selection"; -var instanceLocal = local(), +import { select } from "d3-selection"; +var instanceLocal = { + set: function (node, value){ node.__instance__ = value }, + get: function (node){ return node.__instance__; } + }, noop = function (){}; // no operation export default function (tagName, className){ @@ -56,7 +59,7 @@ export default function (tagName, className){ function destroyDescendant(){ var instance = instanceLocal.get(this); - instanceLocal.remove(this) && instance.destroy(); + instance && instance.destroy(); } component.render = function(_) { return (render = _, component); };
Un-adopt d3.local to avoid DOM walking performance hit
curran_d3-component
train
js
5dcb4ac417baedb4735033d430b4162d73ec265d
diff --git a/OpenPNM/Geometry/models/pore_diameter.py b/OpenPNM/Geometry/models/pore_diameter.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Geometry/models/pore_diameter.py +++ b/OpenPNM/Geometry/models/pore_diameter.py @@ -4,6 +4,8 @@ pore_diameter =============================================================================== """ +from OpenPNM.Base import logging +_logger = logging.getLogger() from . import misc as _misc import scipy as _sp @@ -105,6 +107,9 @@ def largest_sphere(geometry, network, iters=10, **kwargs): am = network.create_adjacency_matrix(data=Lt, sprsfmt='lil', dropzeros=False) D[Ps] = D[Ps] + _sp.array([_sp.amin(row) for row in am.data])[Ps]*0.95 + if _sp.any(D < 0): + _logger.warning('Negative pore diameters found! Neighboring pores' + + ' must be larger than the pore spacing.') return D[network.pores(geometry.name)]
Added logger warning if negative pore diameters found.
PMEAL_OpenPNM
train
py
e9e706263d0ceeac46d07ff14ff62cf8e3c5d33e
diff --git a/src/Schema/JsonApi/DynamicEntitySchema.php b/src/Schema/JsonApi/DynamicEntitySchema.php index <HASH>..<HASH> 100644 --- a/src/Schema/JsonApi/DynamicEntitySchema.php +++ b/src/Schema/JsonApi/DynamicEntitySchema.php @@ -127,7 +127,7 @@ class DynamicEntitySchema extends BaseSchema ? $entity->getVisible() : $entity->visibleProperties(); foreach ($properties as $property) { - if ($property === '_joinData' || $property === '_matchingData') { + if ($property[0] === '_') { continue; }
Exclude internal properties (starts with underscore) from payload
FriendsOfCake_crud-json-api
train
php
c35db48bb5645b3708ada04463fdcbfcb5a6006a
diff --git a/twtxt/cli.py b/twtxt/cli.py index <HASH>..<HASH> 100644 --- a/twtxt/cli.py +++ b/twtxt/cli.py @@ -159,7 +159,7 @@ def timeline(ctx, pager, limit, twtfile, sorting, timeout, porcelain, source, ca help="Cache remote twtxt files locally. (Default: True") @click.argument("source") @click.pass_context -def view(ctx, pager, limit, sorting, timeout, porcelain, cache, source): +def view(ctx, **kwargs): """Show feed of given source.""" ctx.forward(timeline)
Use **kwargs for view command
buckket_twtxt
train
py
55302df1a92bf5a54ff378d2f6853c1edbf219a1
diff --git a/lib/kue.js b/lib/kue.js index <HASH>..<HASH> 100755 --- a/lib/kue.js +++ b/lib/kue.js @@ -404,6 +404,14 @@ Queue.prototype.active = function (fn) { }; /** + * Delayed jobs. + */ + +Queue.prototype.delayed = function (fn) { + return this.state('delayed', fn); +}; + +/** * Completed jobs count. */
Add Queue.prototype.delayed function Queue.prototype.delayed appears to be missing, added to complete the suite (and I need it).
Automattic_kue
train
js
6fce5d9128b62e67565b196169be146d90e3ea09
diff --git a/taboo.js b/taboo.js index <HASH>..<HASH> 100644 --- a/taboo.js +++ b/taboo.js @@ -97,7 +97,7 @@ function Taboo(tableName){ } else { options = defaultOptions; } - this.addColumns([header]); + this.addColumns([header], options); if (!options.silent){ this.triggerCallbacks('update'); } diff --git a/tests/tabooSpec.js b/tests/tabooSpec.js index <HASH>..<HASH> 100644 --- a/tests/tabooSpec.js +++ b/tests/tabooSpec.js @@ -101,6 +101,13 @@ describe("Taboo", function() { table.addColumn('hello'); expect(table.getColumnHeaders().length).toBe(2); }); + + it("should ignore duplicate headers if option passed", function(){ + table.addColumn('hello', {ignoreDuplicates:true}); + table.addColumn('hello', {ignoreDuplicates:true}); + console.log(table.print()); + expect(table.getColumnHeaders().length).toBe(1); + }); it('should be able to clone new copies of the table', function(){ table.addRows(dogs);
pass options from addColumn to addColumns
mrmagooey_taboo
train
js,js
4002b9391dd6342ae8275b566f308a5e7eaaf6f0
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -78,6 +78,11 @@ exports.start = function(config) { }); - return { listen: server.listen.bind(server) }; + return { + listen: function(port) { + console.log("Game engine listening on port", port); + server.listen(port); + } + }; }; \ No newline at end of file
Changed a couple of configuration options and added a debug message when the server is started.
Yuffster_discord-engine
train
js
9941060120952fe4cb08577ba2e0092c7601ffec
diff --git a/blocks/action-list/action-list.js b/blocks/action-list/action-list.js index <HASH>..<HASH> 100644 --- a/blocks/action-list/action-list.js +++ b/blocks/action-list/action-list.js @@ -97,8 +97,14 @@ define([ var $active = $el.parent().find(ACTIVE_SELECTOR); if ($active.length) { - var eventData = items[$el.parent().find(ITEM_ACTION_SELECTOR).index($active)]; - actionList.trigger('action_' + uid, (eventData && eventData.event[0] && eventData.event[0].data) || false); + var eventEl = items[$el.parent().find(ITEM_ACTION_SELECTOR).index($active)], + eventData; + if ((eventEl && eventEl.event && eventEl.event[0] && eventEl.event[0])) { + eventData = eventEl.event[0].data; + } else { + eventData = eventEl; + } + actionList.trigger('action_' + uid, eventData || false); return false; } else { @@ -164,7 +170,9 @@ define([ override: true }, getUID: { - method:function() { return uid; }, + method: function () { + return uid; + }, override: true } });
RG-<I> fix action-list trigger action event Former-commit-id: e<I>f<I>f<I>c<I>ade<I>dca1df<I>d9abc<I>
JetBrains_ring-ui
train
js
f5b4b8b15da9bb6211e5e1fd42232cffbb687555
diff --git a/jbehave-core/src/main/java/org/jbehave/core/embedder/Embedder.java b/jbehave-core/src/main/java/org/jbehave/core/embedder/Embedder.java index <HASH>..<HASH> 100755 --- a/jbehave-core/src/main/java/org/jbehave/core/embedder/Embedder.java +++ b/jbehave-core/src/main/java/org/jbehave/core/embedder/Embedder.java @@ -312,7 +312,7 @@ public class Embedder { MetaFilter filter = metaFilter(); return storyManager.runningStory(storyId, story, filter, null).getFuture(); } - + public void reportStepdocs() { reportStepdocs(configuration(), candidateSteps()); } @@ -411,7 +411,7 @@ public class Embedder { return executorService; } - private StoryManager storyManager() { + public StoryManager storyManager() { return new StoryManager(configuration(), embedderControls(), embedderMonitor(), executorService(), stepsFactory(), storyRunner()); }
JBEHAVE-<I>: StoryManager now accessible via the public method from Embedder.
jbehave_jbehave-core
train
java
5a3877cfc554a3ebff01574aab8a1ed784b5f388
diff --git a/cmd/auto-pause/auto-pause.go b/cmd/auto-pause/auto-pause.go index <HASH>..<HASH> 100644 --- a/cmd/auto-pause/auto-pause.go +++ b/cmd/auto-pause/auto-pause.go @@ -103,7 +103,7 @@ func runPause() { mu.Lock() defer mu.Unlock() if runtimePaused { - out.Step(style.AddonEnable, "Auto-pause is already enabled.") + out.Styled(style.AddonEnable, "Auto-pause is already enabled.") return } diff --git a/pkg/addons/addons_autopause.go b/pkg/addons/addons_autopause.go index <HASH>..<HASH> 100644 --- a/pkg/addons/addons_autopause.go +++ b/pkg/addons/addons_autopause.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors All rights reserved. +Copyright 2021 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Prefer out.Styled to out.Step, revert copyright
kubernetes_minikube
train
go,go
47f936a1266a0d166bb8521eba4c56b52c5e11e9
diff --git a/tests/Jaguar/Tests/Action/CropActionTest.php b/tests/Jaguar/Tests/Action/CropActionTest.php index <HASH>..<HASH> 100644 --- a/tests/Jaguar/Tests/Action/CropActionTest.php +++ b/tests/Jaguar/Tests/Action/CropActionTest.php @@ -25,4 +25,11 @@ class CropActionTest extends AbstractActionTest ); } + public function testSetGetBox() + { + $action = new CropAction(); + $this->assertSame($action, $action->setBox(new Box())); + $this->assertInstanceOf('\Jaguar\Box', $action->getBox()); + } + }
Imporved Crop Action Test
hyyan_jaguar
train
php
8a0dfb140f5e19044b7fd432552c38ee5d3b1ece
diff --git a/src/actions.js b/src/actions.js index <HASH>..<HASH> 100644 --- a/src/actions.js +++ b/src/actions.js @@ -35,7 +35,7 @@ var actions = { actionType: RowConstants.QUERY_START }); client.runQuery(query, (err, res) => { - if (!err) { + if (!err && res) { Dispatcher.handleViewAction({ actionType: RowConstants.QUERY_DONE, value: res
Test not just that there's no error, but also that there's a result
tmcw_stickshift
train
js
bcd0feef3f47bc1813ab009debee493ee24cc5e8
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -72,7 +72,7 @@ module.exports = function (grunt) { ci: { configFile: 'karma.conf.js', singleRun: true, - browsers: ['PhantomJS'] + browsers: ['Firefox'] }, watch: { configFile: 'karma.conf.js',
Change karma ci task to use Firefox
jonashartmann_webcam-directive
train
js
6811371da92e954960a72cc9581aa1a020d13076
diff --git a/findspark.py b/findspark.py index <HASH>..<HASH> 100644 --- a/findspark.py +++ b/findspark.py @@ -23,7 +23,8 @@ def find(): for path in [ '/usr/local/opt/apache-spark/libexec', # OS X Homebrew '/usr/lib/spark/', # AWS Amazon EMR - '/usr/local/spark/' # common linux path for spark + '/usr/local/spark/', # common linux path for spark + '/opt/spark/' # other common linux path for spark # Any other common places to look? ]: if os.path.exists(path):
Added another common linux path for spark
minrk_findspark
train
py
263880db92251ff501a733d7fdb8f5fb026ac548
diff --git a/middleware/compress.go b/middleware/compress.go index <HASH>..<HASH> 100644 --- a/middleware/compress.go +++ b/middleware/compress.go @@ -92,6 +92,7 @@ var defaultContentTypes = map[string]struct{}{ "application/json": {}, "application/atom+xml": {}, "application/rss+xml": {}, + "image/svg+xml": {}, } // DefaultCompress is a middleware that compresses response
middleware: add image/svg+xml content-type to compress
go-chi_chi
train
go
c2d5c2d4ba1f3c56e998389a85acdaf8622eea38
diff --git a/liquibase-core/src/main/java/liquibase/datatype/core/UUIDType.java b/liquibase-core/src/main/java/liquibase/datatype/core/UUIDType.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/datatype/core/UUIDType.java +++ b/liquibase-core/src/main/java/liquibase/datatype/core/UUIDType.java @@ -6,6 +6,7 @@ import liquibase.datatype.DataTypeInfo; import liquibase.datatype.DatabaseDataType; import liquibase.datatype.LiquibaseDataType; import liquibase.exception.DatabaseException; +import liquibase.statement.DatabaseFunction; @DataTypeInfo(name="uuid", aliases = {"uniqueidentifier"}, minParameters = 0, maxParameters = 0, priority = LiquibaseDataType.PRIORITY_DEFAULT) public class UUIDType extends LiquibaseDataType { @@ -35,7 +36,7 @@ public class UUIDType extends LiquibaseDataType { @Override public String objectToSql(Object value, Database database) { if (database instanceof MSSQLDatabase) { - return "'"+value+"'"; + return (value instanceof DatabaseFunction) ? database.generateDatabaseFunctionValue((DatabaseFunction) value) : "'" + value + "'"; } return super.objectToSql(value, database); }
defaultValueComputed is no longer quoted for GUID columns in MSSQL
liquibase_liquibase
train
java
eaef629a82511f8c0a25630bc60d9d1080d40b5d
diff --git a/src/umm/index.js b/src/umm/index.js index <HASH>..<HASH> 100644 --- a/src/umm/index.js +++ b/src/umm/index.js @@ -153,7 +153,7 @@ module.exports = ({ logger, middlewares, botfile, projectLocation, db, contentMa let markdown = await getDocument() // TODO Add more context - const fullContext = Object.assign({ + const fullContext = Object.assign({}, initialData, { user: incomingEvent.user, originalEvent: incomingEvent }, additionalData)
Merging initialData in UMM rendering
botpress_botpress
train
js
11d4bb15964db29650a95ec8b44004ca4ba869e7
diff --git a/theanets/trainer.py b/theanets/trainer.py index <HASH>..<HASH> 100644 --- a/theanets/trainer.py +++ b/theanets/trainer.py @@ -180,7 +180,6 @@ class SGD(Trainer): logging.info('compiling %s learning function', self.__class__.__name__) self.f_learn = theano.function( network.inputs, - self.cost_exprs, updates=list(network.updates) + list(self.learning_updates())) def learning_updates(self): @@ -232,9 +231,15 @@ class SGD(Trainer): break try: + [self.train_minibatch(*x) for x in train_set] + except KeyboardInterrupt: + logging.info('interrupted!') + break + + try: costs = list(zip( self.cost_names, - np.mean([self.train_minibatch(*x) for x in train_set], axis=0))) + np.mean([self.f_eval(*x) for i, x in zip(range(3), train_set)], axis=0))) except KeyboardInterrupt: logging.info('interrupted!') break
Make f_learn an update-only function. To get monitor values for training data, run f_eval on three of the minibatches from the training set.
lmjohns3_theanets
train
py
7ee85266114faae24eb4d939b9b30652bac0eec9
diff --git a/ics/parser.py b/ics/parser.py index <HASH>..<HASH> 100644 --- a/ics/parser.py +++ b/ics/parser.py @@ -127,11 +127,11 @@ if __name__ == "__main__": def printTree(elem, lvl=0): if isinstance(elem, list) or isinstance(elem, Container): if isinstance(elem, Container): - print(' '*lvl, elem.name) + print("{}{}".format(' '*lvl, elem.name)) for sub_elem in elem: printTree(sub_elem, lvl+1) elif isinstance(elem, ContentLine): - print(' '*lvl, elem.name, elem.params, elem.value) + print("{}{}{}".format(' '*lvl, elem.name, elem.params, elem.value)) else: print("Wuuut ?")
[fix] wrong format in printTree on py2
C4ptainCrunch_ics.py
train
py
f2c6faec663dec776443b58b73a81c804912e417
diff --git a/pkg/client/s3/bucket.go b/pkg/client/s3/bucket.go index <HASH>..<HASH> 100644 --- a/pkg/client/s3/bucket.go +++ b/pkg/client/s3/bucket.go @@ -180,10 +180,8 @@ func (c *s3Client) ListObjects(bucket, objectPrefix string) (items []*client.Ite if err != nil { return nil, err } - if len(items) > 0 { - return items, nil - } - return nil, os.ErrNotExist + // even if items are equal to '0' is valid case + return items, nil default: // Error return nil, err }
Length of items to be zero in ListObjects is a valid case
minio_mc
train
go
47a97c3a3d92365d4e46cd71148a40abae718edd
diff --git a/phonopy/version.py b/phonopy/version.py index <HASH>..<HASH> 100644 --- a/phonopy/version.py +++ b/phonopy/version.py @@ -32,4 +32,4 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -__version__ = "1.11.12" +__version__ = "1.11.14"
Increment version number to <I>
atztogo_phonopy
train
py
35f1fac40a03a94d7e079b1d57fc8771e18234d5
diff --git a/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/AbstractResourceMojo.java b/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/AbstractResourceMojo.java index <HASH>..<HASH> 100644 --- a/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/AbstractResourceMojo.java +++ b/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/AbstractResourceMojo.java @@ -95,8 +95,7 @@ public abstract class AbstractResourceMojo extends AbstractFabric8Mojo { public static File writeResourcesIndividualAndComposite(KubernetesList resources, File resourceFileBase, ResourceFileType resourceFileType, Logger log, Boolean generateRoute) throws MojoExecutionException { - List<HasMetadata> oldItemList = new ArrayList<>(); - oldItemList = resources.getItems(); + List<HasMetadata> oldItemList = resources.getItems(); List<HasMetadata> newItemList = new ArrayList<>(); @@ -118,7 +117,6 @@ public abstract class AbstractResourceMojo extends AbstractFabric8Mojo { // if the list contains a single Template lets unwrap it Template template = getSingletonTemplate(resources); if (template != null) { - System.out.println("In"); entity = template; }
Updated for removing pepperrboat issue
fabric8io_fabric8-maven-plugin
train
java
14e0b13339fa9b78ce8168c36c6054afc2a0c6e4
diff --git a/src/sap.m/src/sap/m/Dialog.js b/src/sap.m/src/sap/m/Dialog.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/Dialog.js +++ b/src/sap.m/src/sap/m/Dialog.js @@ -685,7 +685,7 @@ sap.ui.define(['jquery.sap.global', './Bar', './InstanceManager', './Associative $dialogContent.height(parseInt($dialog.height(), 10)); } - if (this.getStretch()) { + if (this.getStretch() || this._bDisableRepositioning) { return; }
[FIX] sap.m.Dialog: Dialog repositioning is fixed - when dialog is resizeble and click on the resize corner, it jumps in top and left direction due to resize transformation. BCP: <I> Change-Id: I<I>e4be<I>ba8bd3a<I>eda3df2befe<I>df2f1a
SAP_openui5
train
js
4acc36d44c1c606d0e2b3de14f0837a93261eb7e
diff --git a/irc3/plugins/casefold.py b/irc3/plugins/casefold.py index <HASH>..<HASH> 100644 --- a/irc3/plugins/casefold.py +++ b/irc3/plugins/casefold.py @@ -48,11 +48,14 @@ class Casefold(object): # casemapping @irc3.event(r'^:\S+ 005 \S+ .+CASEMAPPING.*') def recalculate_casemaps(self): - casemapping = self.bot.config.get('server_config', {}).get('CASEMAPPING', 'rfc1459') + casemapping = self.bot.config['server_config'].get('CASEMAPPING', + 'rfc1459') if casemapping == 'rfc1459': - lower_chars = string.ascii_lowercase + ''.join(chr(i) for i in range(123, 127)) - upper_chars = string.ascii_uppercase + ''.join(chr(i) for i in range(91, 95)) + lower_chars = (string.ascii_lowercase + + ''.join(chr(i) for i in range(123, 127))) + upper_chars = (string.ascii_uppercase + + ''.join(chr(i) for i in range(91, 95))) elif casemapping == 'ascii': lower_chars = string.ascii_lowercase
Fix Casefolding PEP8 errors
gawel_irc3
train
py
eaf187bb4416c690519d01fa21db64ca3812cd4c
diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageStubProvider.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageStubProvider.java index <HASH>..<HASH> 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageStubProvider.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageStubProvider.java @@ -186,10 +186,11 @@ public class StorageStubProvider { .put("maxAttempts", GRPC_MAX_RETRY_ATTEMPTS) .put( "initialBackoff", - Durations.fromMillis(readOptions.getBackoffInitialIntervalMillis()).toString()) + Durations.toString( + Durations.fromMillis(readOptions.getBackoffInitialIntervalMillis()))) .put( "maxBackoff", - Durations.fromMillis(readOptions.getBackoffMaxIntervalMillis()).toString()) + Durations.toString(Durations.fromMillis(readOptions.getBackoffMaxIntervalMillis()))) .put("backoffMultiplier", readOptions.getBackoffMultiplier()) .put("retryableStatusCodes", ImmutableList.of("UNAVAILABLE", "RESOURCE_EXHAUSTED")) .build();
Fix duration format for grpc retry (#<I>)
GoogleCloudPlatform_bigdata-interop
train
java
df04e09c06d66fcad96a3f133482f2c6d4da0dd3
diff --git a/test/browser/interactive.js b/test/browser/interactive.js index <HASH>..<HASH> 100644 --- a/test/browser/interactive.js +++ b/test/browser/interactive.js @@ -60,8 +60,8 @@ function execute() { eval(code); error.text(''); } catch (e) { + console.error(e); var text = 'Error: ' + e.message; - console.warn(text); error.text(text); setRight(empty); }
interactive page: print full error to the console
image-js_image-js
train
js
b7dc22ca469b240dba8a315387da27b01403a9e3
diff --git a/lib/adhearsion/foundation/object.rb b/lib/adhearsion/foundation/object.rb index <HASH>..<HASH> 100644 --- a/lib/adhearsion/foundation/object.rb +++ b/lib/adhearsion/foundation/object.rb @@ -1,16 +1,5 @@ require 'adhearsion/logging' -# Monkey patch Object to support the #tap method. -# This method is present in Ruby 1.8.7 and later. -unless Object.respond_to?(:tap) - class Object - def tap - yield self - self - end - end -end - class Object def pb_logger logger
[CS] Remove definition of Object#tap since all supported Ruby platforms support it natively
adhearsion_adhearsion
train
rb
9a3c9286142eb13fde562aff92a19b119a1fa874
diff --git a/openquake/server/tests/tests.py b/openquake/server/tests/tests.py index <HASH>..<HASH> 100644 --- a/openquake/server/tests/tests.py +++ b/openquake/server/tests/tests.py @@ -110,12 +110,7 @@ class EngineServerTestCase(unittest.TestCase): def setUp(self): if sys.version_info[0] == 2: - # in Python 2 the tests fail when doing _lgeos = load_dll( - # 'geos_c', fallbacks=['libgeos_c.so.1', 'libgeos_c.so']) - raise unittest.SkipTest('Python 2') - - def setUp(self): - if sys.version_info[0] == 2: + # python 2 will die raise unittest.SkipTest('Python 2') # tests
Merged from master [skip CI]
gem_oq-engine
train
py
73ab708d30be6a324832db9b6ff78e3406fd3771
diff --git a/src/main/java/org/robolectric/res/AndroidResourcePathFinder.java b/src/main/java/org/robolectric/res/AndroidResourcePathFinder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/robolectric/res/AndroidResourcePathFinder.java +++ b/src/main/java/org/robolectric/res/AndroidResourcePathFinder.java @@ -3,12 +3,7 @@ package org.robolectric.res; import android.R; import org.robolectric.util.PropertiesHelper; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.List; +import java.io.*; import java.util.Properties; public class AndroidResourcePathFinder { @@ -37,7 +32,7 @@ public class AndroidResourcePathFinder { return resourcePath; } - throw new RuntimeException("Unable to find path to Android SDK"); + throw new RuntimeException("Unable to find path to Android SDK, (you probably need a local.properties file, see: http://pivotal.github.com/robolectric/resources.html"); } private String getAndroidResourcePathFromLocalProperties() {
Point users to the website when their tests can't find Android.
robolectric_robolectric
train
java
1fec372744182a648b0a2d9df36704d93207f3a3
diff --git a/trimesh/exchange/gltf.py b/trimesh/exchange/gltf.py index <HASH>..<HASH> 100644 --- a/trimesh/exchange/gltf.py +++ b/trimesh/exchange/gltf.py @@ -1122,6 +1122,10 @@ def _append_material(mat, tree, buffer_items): except BaseException: pass + # if alphaMode is defined, export + if isinstance(mat.alphaMode, str): + pbr['alphaMode'] = mat.alphaMode + # if scalars are defined correctly export if isinstance(mat.metallicFactor, float): pbr['metallicFactor'] = mat.metallicFactor diff --git a/trimesh/visual/material.py b/trimesh/visual/material.py index <HASH>..<HASH> 100644 --- a/trimesh/visual/material.py +++ b/trimesh/visual/material.py @@ -135,7 +135,7 @@ class PBRMaterial(Material): self.doubleSided = doubleSided # str - alphaMode = alphaMode + self.alphaMode = alphaMode def to_color(self, uv): """
Preserves the alphaMode when reading and writing gltf
mikedh_trimesh
train
py,py
5d4541516c28959b4cb54e2e6c3fc91693d53664
diff --git a/lib/pseudohiki/blockparser.rb b/lib/pseudohiki/blockparser.rb index <HASH>..<HASH> 100644 --- a/lib/pseudohiki/blockparser.rb +++ b/lib/pseudohiki/blockparser.rb @@ -411,11 +411,5 @@ module PseudoHiki end end end - -# class << Formatter[HeadingLeaf] -# def make_html_element(tree) -# create_element(@element_name+tree.nominal_level.to_s) -# end -# end end end
removed XhtmlFormat::Formatter[HeadingLeaf].make_html_element that is unnecessary now
nico-hn_PseudoHikiParser
train
rb
ecb027ae026d0e81c6746da274e968b89f952a10
diff --git a/Kwc/Paragraphs/Trl/Generator.php b/Kwc/Paragraphs/Trl/Generator.php index <HASH>..<HASH> 100644 --- a/Kwc/Paragraphs/Trl/Generator.php +++ b/Kwc/Paragraphs/Trl/Generator.php @@ -12,17 +12,4 @@ class Kwc_Paragraphs_Trl_Generator extends Kwc_Chained_Trl_Generator } return $ret; } - - protected function _formatConfig($parentData, $row) - { - $ret = parent::_formatConfig($parentData, $row); - $id = $parentData->dbId.$this->getIdSeparator().$this->_getIdFromRow($row); - $ret['row'] = $this->_getRow($id); - if (!$ret['row']) { - $m = Kwc_Abstract::createChildModel($this->_class); - $ret['row'] = $m->createRow(); - $ret['row']->component_id = $id; - } - return $ret; - } }
Paragraphs Trl: don't add row to data - it's not used or required - it breaks serializing the data
koala-framework_koala-framework
train
php
df822934d4c18e5e3f57ca0af345349bc935bd9c
diff --git a/www/src/py_dict.js b/www/src/py_dict.js index <HASH>..<HASH> 100644 --- a/www/src/py_dict.js +++ b/www/src/py_dict.js @@ -96,7 +96,7 @@ $iterator_wrapper = function(items,klass){ return items.next() //return items[counter++] }, - //__repr__:function(){return "<"+klass.__name__+" object>"}, + __repr__:function(){return "<"+klass.__name__+" object>"}, //counter:0 } res.__str__ = res.toString = res.__repr__ diff --git a/www/src/py_int.js b/www/src/py_int.js index <HASH>..<HASH> 100644 --- a/www/src/py_int.js +++ b/www/src/py_int.js @@ -271,6 +271,9 @@ $IntDict.bit_length = function(self){ return s.length // len('100101') --> 6 } +$IntDict.numerator = function(self){return self} +$IntDict.denominator = function(self){return int(1)} + // code for operands & | ^ << >> var $op_func = function(self,other){ if(isinstance(other,int)) return self-other
add numerator and denominator to int
brython-dev_brython
train
js,js
2f5d421befd26b9b5b79411b8e41474c7aa91bd2
diff --git a/pool_test.go b/pool_test.go index <HASH>..<HASH> 100644 --- a/pool_test.go +++ b/pool_test.go @@ -47,10 +47,12 @@ func TestPool_Get(t *testing.T) { } for i := 0; i < (InitialCap - 1); i++ { - _, err := testPool.Get() - if err != nil { - t.Errorf("Get error: %s", err) - } + go func() { + _, err := testPool.Get() + if err != nil { + t.Errorf("Get error: %s", err) + } + }() } if testPool.UsedCapacity() != 0 {
test: run get's concurrently
fatih_pool
train
go
a71825edacca7795b6b27d801ed671474107ee8a
diff --git a/wordcloud/wordcloud.py b/wordcloud/wordcloud.py index <HASH>..<HASH> 100644 --- a/wordcloud/wordcloud.py +++ b/wordcloud/wordcloud.py @@ -9,8 +9,10 @@ from __future__ import division import warnings from random import Random +import io import os import re +import base64 import sys import colorsys import matplotlib @@ -729,7 +731,7 @@ class WordCloud(object): def to_html(self): raise NotImplementedError("FIXME!!!") - def to_svg(self): + def to_svg(self, embed_image=False): """Export to SVG. Returns @@ -797,6 +799,21 @@ class WordCloud(object): '</rect>' .format(self.background_color) ) + + # Embed image, useful for debug purpose + if embed_image: + image = self.to_image() + data = io.BytesIO() + image.save(data, format='JPEG') + data = base64.b64encode(data.getbuffer()).decode('ascii') + result.append( + '<image' + ' width="100%"' + ' height="100%"' + ' href="data:image/jpg;base64,{}"' + '/>' + .format(data) + ) # For each word in layout for (word, count), font_size, (y, x), orientation, color in self.layout_:
Add option to embed image in SVG, useful for debug
amueller_word_cloud
train
py
4513a618ddb7236488e8d337f4fd819fcb02e4c1
diff --git a/cmd/gb-vendor/main.go b/cmd/gb-vendor/main.go index <HASH>..<HASH> 100644 --- a/cmd/gb-vendor/main.go +++ b/cmd/gb-vendor/main.go @@ -79,7 +79,7 @@ func main() { } if err := command.Run(ctx, args); err != nil { - gb.Fatalf("command %q failed: %v", args[0], err) + gb.Fatalf("command %q failed: %v", command.Name, err) } return }
Fix a panic with the gb vendor command
constabulary_gb
train
go
8c51cabcb5464c2746d40edc6feec3699ba72e9f
diff --git a/api/policies/ModelPolicy.js b/api/policies/ModelPolicy.js index <HASH>..<HASH> 100644 --- a/api/policies/ModelPolicy.js +++ b/api/policies/ModelPolicy.js @@ -26,12 +26,7 @@ module.exports = function ModelPolicy (req, res, next) { if (!_.isObject(model)) { req.options.unknownModel = true; - if (!sails.config.permissions.allowUnknownModelDefinition) { - return next(new Error('Model definition not found: '+ req.options.modelIdentity)); - } - else { - model = sails.models[req.options.modelIdentity]; - } + model = sails.models[req.options.modelIdentity]; } req.model = model; diff --git a/config/permissions.js b/config/permissions.js index <HASH>..<HASH> 100644 --- a/config/permissions.js +++ b/config/permissions.js @@ -9,7 +9,5 @@ module.exports.permissions = { afterEvents: [ 'hook:auth:initialized' - ], - - allowUnknownModelDefinitions: false + ] };
allowing unknown models isn't really a feature after all
trailsjs_sails-permissions
train
js,js
a8d38e06a3ef701a818b244c666f86aa33ad5361
diff --git a/src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java b/src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java +++ b/src/main/java/com/googlecode/lanterna/terminal/ansi/StreamBasedTerminal.java @@ -159,6 +159,9 @@ public abstract class StreamBasedTerminal extends AbstractTerminal { long startTime = System.currentTimeMillis(); TerminalSize newTerminalSize = terminalSizeReportQueue.poll(); while(newTerminalSize == null) { + if(System.currentTimeMillis() - startTime > 2000) { + throw new IllegalStateException("Terminal didn't send any position report for 2 seconds, please file a bug with a reproduce!"); + } KeyStroke keyStroke = readInput(false, false); if(keyStroke != null) { keyQueue.add(keyStroke);
Like before, let's put a time limit here so we don't keep spinning forever if no position report shows up
mabe02_lanterna
train
java
4300db248b0065c734dc39f1a45931b7ee482fb8
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -58,6 +58,7 @@ CONFIG = { options: { server_selection_timeout: 0.5, max_pool_size: 3, + wait_queue_timeout: 5, heartbeat_frequency: 180, user: MONGOID_ROOT_USER.name, password: MONGOID_ROOT_USER.password,
increase wait_queue_timeout in tests
mongodb_mongoid
train
rb
f331dfacca0dff43e6a980240fda8ebce6bf876e
diff --git a/lib/pwwka/configuration.rb b/lib/pwwka/configuration.rb index <HASH>..<HASH> 100755 --- a/lib/pwwka/configuration.rb +++ b/lib/pwwka/configuration.rb @@ -9,6 +9,7 @@ module Pwwka attr_accessor :delayed_exchange_name attr_accessor :logger attr_accessor :options + attr_accessor :send_message_resque_backoff_strategy def initialize @rabbit_mq_host = nil @@ -16,6 +17,9 @@ module Pwwka @delayed_exchange_name = "pwwka.delayed.#{Pwwka.environment}" @logger = MonoLogger.new(STDOUT) @options = {} + @send_message_resque_backoff_strategy = [5, #intermittent glitch? + 60, # quick interruption + 600, 600, 600] # longer-term outage? end
Add configuration for resque backoff strategy.
stitchfix_pwwka
train
rb
8882472d3bb7e691f44b3347e30502a7ab004f21
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -6,18 +6,13 @@ var Q = require('q'), Generator = Parent.inherit(); Generator.prototype.createData = function() { - var q = Q.defer(); - connection.connect(this.config) + return connection.connect(this.config) .then(function() { return tables.get(); }) .then(function(tables) { - q.resolve(tables); - }) - .fail(function(error) { - q.reject(error); + return tables; }); - return q.promise; }; Generator.prototype.explain = function() {
refactoring of createData promise
heinzelmannchen_heinzelmannchen-gen-pg
train
js
1fbbc1ffe6bf6c1e2f5128c0102b82cef15815cd
diff --git a/Transport/Rpc/RpcClient.php b/Transport/Rpc/RpcClient.php index <HASH>..<HASH> 100644 --- a/Transport/Rpc/RpcClient.php +++ b/Transport/Rpc/RpcClient.php @@ -13,6 +13,7 @@ use Ramsey\Uuid\Uuid; class RpcClient implements QueueProducerInterface { private $connectionManager; + private $connection; private $channel; private $fromName; private $queueName; @@ -25,6 +26,7 @@ class RpcClient implements QueueProducerInterface $this->queueName = $queueName; $this->fromName = $fromName; $this->connectionManager = $manager; + $this->connection = $this->connectionManager->getConnection(); } /** @@ -44,12 +46,10 @@ class RpcClient implements QueueProducerInterface */ public function refreshChannel() { - $connection = $this->connectionManager->getConnection(); - - if (!$connection->isConnected()) { - $connection->reconnect(); + if (! $this->connection->isConnected()) { + $this->connection->reconnect(); } - $this->channel = $connection->channel(); + $this->channel = $this->connection->channel(); return $this->channel; }
fix segmentation fault caused by RpcClient after many interactions
contamobi_CmobiRabbitmqBundle
train
php
ae39ffeff3ed700bacf959f502c51120b5b6f987
diff --git a/src/js/Dividers/Divider.js b/src/js/Dividers/Divider.js index <HASH>..<HASH> 100644 --- a/src/js/Dividers/Divider.js +++ b/src/js/Dividers/Divider.js @@ -34,6 +34,10 @@ export default class Divider extends Component { render() { const { className, inset, vertical, ...props } = this.props; + // When in a list + delete props.expanderIconChildren; + delete props.expanderIconClassName; + const dividerProps = { role: 'divider', className: classnames('md-divider', className, { inset, vertical }),
Updated Divider for when it is in a list/card to remove more props
mlaursen_react-md
train
js
e021775a286e75e37796e144beb2d417c3858300
diff --git a/node-netpbm.js b/node-netpbm.js index <HASH>..<HASH> 100644 --- a/node-netpbm.js +++ b/node-netpbm.js @@ -158,6 +158,7 @@ module.exports.convert = function(fileIn, fileOut, options, callback) return; } + var scaler, fitter; if (options.alpha) { scaler = 'pamscale '; fitter = '-xyfit ';
Declare variables so they don't end up globals `scaler` and `fitter` variables were never declared.
punkave_node-netpbm
train
js
dd0a8cd787be7a33774c9f659562d2f5c6254931
diff --git a/webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java b/webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java index <HASH>..<HASH> 100644 --- a/webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java +++ b/webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java @@ -279,7 +279,7 @@ public class SimpleWebServer extends NanoHTTPD { private String findIndexFileInDirectory(File directory) { for (String fileName : SimpleWebServer.INDEX_FILE_NAMES) { File indexFile = new File(directory, fileName); - if (indexFile.exists()) { + if (indexFile.isFile()) { return fileName; } }
Fix webserver serving folder named like index file If there was a directory named like an index file (e.g. "index.html"), other index files registered later (e.g. "index.htm") were ignored and the directory was served instead (or an index file in the directory). This was fixed by now checking if the index file is not a directory.
NanoHttpd_nanohttpd
train
java
5a7a427d0741992b57161b46a8a0712f50ac2233
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -15162,6 +15162,21 @@ const devices = [ fromZigbee: [fz.on_off, fz.silvercrest_smart_led_string], exposes: [e.light_brightness_colorhs()], }, + + // LightSolutions + { + zigbeeModel: ['91-947'], + model: '200403V2-B', + vendor: 'LightSolutions', + description: 'Mini dimmer 200W', + extend: generic.light_onoff_brightness, + meta: {configureKey: 1}, + configure: async (device, coordinatorEndpoint) => { + const endpoint = device.getEndpoint(1); + await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']); + await configureReporting.onOff(endpoint); + }, + }, ];
Added support for LightSolutions '<I>-<I>' (#<I>) * Update devices.js * Update devices.js * Update devices.js * Update devices.js
Koenkk_zigbee-shepherd-converters
train
js
2ad4cae53a2954ccb288a139d535d82468cdc652
diff --git a/pkg/minikube/extract/extract.go b/pkg/minikube/extract/extract.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/extract/extract.go +++ b/pkg/minikube/extract/extract.go @@ -53,7 +53,7 @@ var exclude = []string{ } // ErrMapFile is a constant to refer to the err_map file, which contains the Advice strings. -const ErrMapFile string = "pkg/minikube/problem/err_map.go" +const ErrMapFile string = "pkg/minikube/reason/known_issues.go" // state is a struct that represent the current state of the extraction process type state struct {
fix make extract > err_map.go is not gone, it was just renamed in a recent refactor: > <URL> /home/lizj/workspace/k8s/minikube/cmd/extract/extract.go:<I> <I>x1b4 exit status 2 Makefile:<I>: recipe for target 'extract' failed make: *** [extract] Error 1 Fixes #<I>
kubernetes_minikube
train
go
797af0e945180d64f89ac84531c275dff5017148
diff --git a/Swat/SwatOption.php b/Swat/SwatOption.php index <HASH>..<HASH> 100644 --- a/Swat/SwatOption.php +++ b/Swat/SwatOption.php @@ -37,7 +37,7 @@ class SwatOption extends SwatObject public $value = null; // }}} - // {{{ public function __construct( + // {{{ public function __construct() /** * Creates a flydown option
Fix folding. svn commit r<I>
silverorange_swat
train
php
d914c79207c0dbb5be23eaba460d7d4f129ce038
diff --git a/tests/test_mock_pin.py b/tests/test_mock_pin.py index <HASH>..<HASH> 100644 --- a/tests/test_mock_pin.py +++ b/tests/test_mock_pin.py @@ -24,8 +24,9 @@ def test_mock_pin_init(): assert MockPin(2).number == 2 def test_mock_pin_frequency_unsupported(): + pin = MockPin(3) + pin.frequency = None with pytest.raises(PinPWMUnsupported): - pin = MockPin(3) pin.frequency = 100 def test_mock_pin_frequency_supported():
Small change to test_mock_pin_frequency_unsupported
RPi-Distro_python-gpiozero
train
py
b417d10ac58c7c39cc7604f1bcf54df0b86b70d0
diff --git a/packages/react-server/core/renderMiddleware.js b/packages/react-server/core/renderMiddleware.js index <HASH>..<HASH> 100644 --- a/packages/react-server/core/renderMiddleware.js +++ b/packages/react-server/core/renderMiddleware.js @@ -63,9 +63,6 @@ module.exports = function(server, routes) { initResponseCompletePromise(res); - // Just to keep an eye out for leaks. - logger.gauge("requestLocalStorageNamespaces", RequestLocalStorage.getCountNamespaces()); - // monkey-patch `res.write` so that we don't try to write to the stream if it's // already closed var origWrite = res.write;
Kill the requestLocalStorageNamespaces gauge This isn't something that needs to be logged per request. The module is exported, so users can track this themselves if necessary.
redfin_react-server
train
js
1b67c992bffb13557e864009ae569302faf42e12
diff --git a/lib/constants.rb b/lib/constants.rb index <HASH>..<HASH> 100644 --- a/lib/constants.rb +++ b/lib/constants.rb @@ -19,7 +19,7 @@ module Riml SPECIAL_VARIABLE_PREFIXES = %w(& @ $) BUILTIN_COMMANDS = - %w(echo echon echomsg echoerr echohl execute sleep throw) + %w(echo echon echomsg echoerr echohl execute exec sleep throw) RIML_COMMANDS = %w(riml_source riml_include) VIML_COMMANDS =
allow `exec` to be used as abbreviaton for `execute` NOTE: this is the ONLY supported abbreviation
luke-gru_riml
train
rb
84d12960ed5cb2c5ab64fa638c2a55d81539b754
diff --git a/structr-ui/src/main/resources/structr/js/websocket.js b/structr-ui/src/main/resources/structr/js/websocket.js index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/resources/structr/js/websocket.js +++ b/structr-ui/src/main/resources/structr/js/websocket.js @@ -40,7 +40,11 @@ function wsConnect() { try { - ws = undefined; + if (ws) { + ws.close(); + ws.length = 0; + } + localStorage.removeItem(userKey); var isEnc = (window.location.protocol === 'https:'); @@ -444,7 +448,10 @@ function wsConnect() { } catch (exception) { log('Error in connect(): ' + exception); - ws.close(); + if (ws) { + ws.close(); + ws.length = 0; + } } }
Fixed very annoying bug which caused unlimited WS connections to be triggered in FF when restarting the backend multiple times and not reloading the UI.
structr_structr
train
js
0b587047231bae25784a40d635400a2fd8b63451
diff --git a/lib/icomoon-phantomjs.js b/lib/icomoon-phantomjs.js index <HASH>..<HASH> 100644 --- a/lib/icomoon-phantomjs.js +++ b/lib/icomoon-phantomjs.js @@ -42,9 +42,17 @@ casper.then(function () { this.click('#saveFont'); }); -// Wait for the link to no longer be disabled +// Wait for a redirect request +var downloadLink; casper.waitFor(function () { - console.log(this.getCurrentUrl()); + casper.on('navigation.requested', function (url) { + downloadLink = url; + }); + return downloadLink; +}); + +casper.then(function () { + console.log('link:', downloadLink); }); // TODO: [node only] Extract variables (if specified)
Successfully walking through icomoon submission process
twolfson_icomoon-phantomjs
train
js
4a6154a42d255393fb23ec8eae685dfc5b518d80
diff --git a/mavproxy.py b/mavproxy.py index <HASH>..<HASH> 100755 --- a/mavproxy.py +++ b/mavproxy.py @@ -1192,7 +1192,7 @@ def master_callback(m, master): 'NAV_CONTROLLER_OUTPUT' ]: return - if mtype == 'HEARTBEAT': + if mtype == 'HEARTBEAT' and m.get_srcSystem() != 255: if (mpstate.status.target_system != m.get_srcSystem() or mpstate.status.target_component != m.get_srcComponent()): mpstate.status.target_system = m.get_srcSystem()
don't use GCS messages to update armed state
ArduPilot_MAVProxy
train
py
559adab13aa1af4936b86f08535b5db323548d33
diff --git a/lib/jrubyfx/fxml_controller.rb b/lib/jrubyfx/fxml_controller.rb index <HASH>..<HASH> 100644 --- a/lib/jrubyfx/fxml_controller.rb +++ b/lib/jrubyfx/fxml_controller.rb @@ -24,6 +24,15 @@ class JRubyFX::Controller java_import 'java.net.URL' java_import 'javafx.fxml.FXMLLoader' + @@default_settings = { + width: -1, + height: -1, + fill: Color::WHITE, + depth_buffer: false, + relative_to: nil, + initialized: nil, + } + # Controllers usually need access to the stage. attr_accessor :stage, :scene @@ -51,14 +60,7 @@ class JRubyFX::Controller def self.new filename, stage, settings={} # Inherit from default settings - settings = { - width: -1, - height: -1, - fill: Color::WHITE, - depth_buffer: false, - relative_to: nil, - initialized: nil, - }.merge settings + settings = @@default_settings.merge settings # Magic self-java-ifying new call. (Creates a Java instance from our ruby) self.become_java!
move new's default settings to a class variable
jruby_jrubyfx
train
rb
9e76939296bf940c6f2f05b4cea20de0c643fa68
diff --git a/src/main/java/org/fit/cssbox/layout/TableBodyBox.java b/src/main/java/org/fit/cssbox/layout/TableBodyBox.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/fit/cssbox/layout/TableBodyBox.java +++ b/src/main/java/org/fit/cssbox/layout/TableBodyBox.java @@ -399,6 +399,12 @@ public class TableBodyBox extends BlockBox //the background is drawn in the individual cells } + @Override + protected void loadPadding(CSSDecoder dec, int contw) + { + padding = new LengthSet(); //padding does not apply to table body boxes + } + //==================================================================================== /**
Padding does not apply to table row groups
radkovo_CSSBox
train
java
340ab1e482a94ef8fcc7cd101e5d64641ce68b04
diff --git a/salt/modules/file.py b/salt/modules/file.py index <HASH>..<HASH> 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -1801,7 +1801,7 @@ def get_managed( protos = ['salt', 'http', 'ftp'] if salt._compat.urlparse(source_hash).scheme in protos: # The source_hash is a file on a server - hash_fn = __salt__['cp.cache_file'](source_hash) + hash_fn = __salt__['cp.cache_file'](source_hash, saltenv) if not hash_fn: return '', {}, 'Source hash file {0} not found'.format( source_hash)
Reference the current salt environment. Thanks @hvnsweeting!
saltstack_salt
train
py
25ae54a67becba66f687061a7074cfc80d9827c9
diff --git a/intranet/apps/dashboard/views.py b/intranet/apps/dashboard/views.py index <HASH>..<HASH> 100644 --- a/intranet/apps/dashboard/views.py +++ b/intranet/apps/dashboard/views.py @@ -9,7 +9,7 @@ logger = logging.getLogger(__name__) @login_required def dashboard_view(request): - """Process and show the dashboard.""" + """Process and show the dashboard.""" announcements = Announcement.objects.order_by("-updated").all()[:10] context = {"user": request.user, diff --git a/intranet/apps/files/views.py b/intranet/apps/files/views.py index <HASH>..<HASH> 100644 --- a/intranet/apps/files/views.py +++ b/intranet/apps/files/views.py @@ -7,7 +7,7 @@ logger = logging.getLogger(__name__) @login_required def files_view(request): - """The main filecenter view.""" + """The main filecenter view.""" context = {"user": request.user, "page": "files" }
Remove rogue tab from files view
tjcsl_ion
train
py,py
5f933b2875d5ff91e66bbfcfd42ece588451c0f6
diff --git a/estnltk/syntax/syntax_preprocessing.py b/estnltk/syntax/syntax_preprocessing.py index <HASH>..<HASH> 100644 --- a/estnltk/syntax/syntax_preprocessing.py +++ b/estnltk/syntax/syntax_preprocessing.py @@ -72,9 +72,6 @@ class Cg3Exporter(): line = ' "+0" Y nominal ' # '!~~~' if line == ' "" Z ': line = ' //_Z_ //' # '<<' - # FinV on siin arvatavasti ebakorrektne ja tekkis cap märgendi tõttu - if morph_extended.form == 'aux neg': - line = re.sub('ei" L0(.*) V aux neg cap ','ei" L0\\1 V aux neg cap <FinV> ', line) # 'Astun-ei' if morph_extended.partofspeech == 'H': line = re.sub(' L0 H $',' L0 H ', line) morph_lines.append(line)
removed hack for the lines that contain 'ei" L0(.*) V aux neg cap '
estnltk_estnltk
train
py
ad496e7d5082e633cafb345f784ec45b6a90c30b
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Handler.php @@ -438,7 +438,7 @@ class Handler implements BaseContentHandler /** * Copy Content with Fields and Versions from $contentId in $version. * - * Copies all fields from $contentId in $version (or all versions if false) + * Copies all fields from $contentId in $versionNo (or all versions if null) * to a new object which is returned. Version numbers are maintained. * * @todo Should relations be copied? Which ones?
Fixed: wrong variable reference in phpdoc
ezsystems_ezpublish-kernel
train
php