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
c5d3c691481a2d93d8deb96fd8bbdc1b95c44fbc
diff --git a/aeron-client/src/main/java/uk/co/real_logic/aeron/ClientConductor.java b/aeron-client/src/main/java/uk/co/real_logic/aeron/ClientConductor.java index <HASH>..<HASH> 100644 --- a/aeron-client/src/main/java/uk/co/real_logic/aeron/ClientConductor.java +++ b/aeron-client/src/main/java/uk/co/real_logic/aeron/ClientConductor.java @@ -185,7 +185,7 @@ class ClientConductor implements Agent, DriverListener logMetaDataBuffer, correlationId); - activePublications.put(publication.channel(), publication.sessionId(), publication.streamId(), publication); + activePublications.put(channel, sessionId, streamId, publication); } public void onNewConnection(
[Java]: Use local vars rather than look them up in the class again.
real-logic_aeron
train
java
9d53ab1e6cdf95f15286ad4faf2836d119d04367
diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/PasteButtonListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/PasteButtonListener.php index <HASH>..<HASH> 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/PasteButtonListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/PasteButtonListener.php @@ -101,6 +101,6 @@ class PasteButtonListener extends AbstractConditionFactoryUsingListener return true; } - return \count($collector->collectChildrenOf($model)) < $max; + return \count($collector->collectDirectChildrenOf($model)) < $max; } }
Use collectDirectChildrenOf() from dc-general
MetaModels_core
train
php
fc5943061714a3967393951d1463fe8c1f45602c
diff --git a/docs/build.js b/docs/build.js index <HASH>..<HASH> 100644 --- a/docs/build.js +++ b/docs/build.js @@ -51,6 +51,7 @@ export default function build(done) { .use(prism({ decode: true })) + .use(mock()) .use(collections({ pages: { pattern: 'pages/**/*.html', @@ -81,7 +82,6 @@ export default function build(done) { engine: 'nunjucks', partials: 'layouts/partials' })) - .use(mock()) .use(tocify({selector: '.docs-section-header, .docs-subsection-title'})) .use(layouts({ engine: 'nunjucks',
apply metalsmith-mock plugin higher in middleware
Availity_availity-uikit
train
js
71332738b11e649889c2acb513f1b9e4f56bd6b8
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -13,13 +13,31 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { /** + * Proxy to get root node for Symfony < 4.2. + * Props to William Durand <[email protected]> in BazingaGeocoderBundle + * + * @param TreeBuilder $treeBuilder + * @param string $name + * + * @return NodeDefinition + */ + protected function getRootNode(TreeBuilder $treeBuilder, string $name) + { + if (\method_exists($treeBuilder, 'getRootNode')) { + return $treeBuilder->getRootNode(); + } else { + return $treeBuilder->root($name); + } + } + + /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('spraed_pdf_generator'); - $treeBuilder->getRootNode() + $this->getRootNode($treeBuilder, 'spraed_pdf_generator') ->children() ->arrayNode('java') ->children()
Update Configuration.php Add compatibility after the suppression of getRootNode() function in the TreeBuilder of Symfony <I>, and get rid of the message 'Attempted to call an undefined method named "getRootNode" '
stedekay_SpraedPDFGeneratorBundle
train
php
70c24266d84fb3bb4ec58cf5229323afd2e3374e
diff --git a/Testing/Fakes/NotificationFake.php b/Testing/Fakes/NotificationFake.php index <HASH>..<HASH> 100644 --- a/Testing/Fakes/NotificationFake.php +++ b/Testing/Fakes/NotificationFake.php @@ -206,6 +206,22 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory } /** + * Assert the total count of notification that were sent. + * + * @param int $expectedCount + * @return void + */ + public function assertCount($expectedCount) + { + $actualCount = collect($this->notifications)->flatten(3)->count(); + + PHPUnit::assertSame( + $expectedCount, $actualCount, + "Expected {$expectedCount} notifications to be sent, but {$actualCount} were sent." + ); + } + + /** * Assert the total amount of times a notification was sent. * * @param int $expectedCount
[9.x] Add AssertCount() in NotificationFake (#<I>) * Add AssertCount in NotificationFake * wip
illuminate_support
train
php
ee60ceb4a1dd26a4f1e18a65a9b643d377d0d890
diff --git a/mouse/_winmouse.py b/mouse/_winmouse.py index <HASH>..<HASH> 100644 --- a/mouse/_winmouse.py +++ b/mouse/_winmouse.py @@ -151,6 +151,7 @@ def listen(queue): event = ButtonEvent(type, button, t) if (event.event_type == DOWN) and previous_button_event is not None: + # https://msdn.microsoft.com/en-us/library/windows/desktop/gg153548%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 if event.time - previous_button_event.time <= GetDoubleClickTime() / 1000.0: event = ButtonEvent(DOUBLE, event.button, event.time)
Fix double click events not generating on Window (#3)
boppreh_mouse
train
py
22b78b5ff3b4ecc0774c3d720526b34e043eb179
diff --git a/openpnm/algorithms/GenericTransport.py b/openpnm/algorithms/GenericTransport.py index <HASH>..<HASH> 100644 --- a/openpnm/algorithms/GenericTransport.py +++ b/openpnm/algorithms/GenericTransport.py @@ -198,6 +198,10 @@ class GenericTransport(GenericAlgorithm): self['pore.bc_rate'] = np.nan self['pore.bc_value'] = np.nan + @property + def x(self): + return self[self.settings['quantity']] + @docstr.get_full_description(base='GenericTransport.reset') @docstr.get_sections(base='GenericTransport.reset', sections=['Parameters']) @docstr.dedent
added x as a property method
PMEAL_OpenPNM
train
py
b17846acbfc4a99433defb662ee87ea1c1f68f32
diff --git a/tests/integration/PhantomJSConfig.php b/tests/integration/PhantomJSConfig.php index <HASH>..<HASH> 100644 --- a/tests/integration/PhantomJSConfig.php +++ b/tests/integration/PhantomJSConfig.php @@ -61,9 +61,9 @@ class PhantomJSConfig extends AbstractConfig { return "Due to the nature of the phantomjs javascript implementation we can not use this standard tests"; } - if ($testCase == "Behat\\Mink\\Tests\\Driver\\Js\\WindowTest" && in_array($test, array("testResizeWindow", "testWindow"))) { - //TODO: testWindow is giving random crashes, fix it but for the moment disable it - return "Due to the nature of the phantomjs javascript implementation we can not use this standard test"; + if ($testCase == "Behat\\Mink\\Tests\\Driver\\Js\\WindowTest") { + //TODO: This suite is giving random phantomjs crashes, not good for the moment + return "This suite is giving random phantomjs crashes, not good for the moment"; } return parent::skipMessage($testCase, $test);
Damm you phantomjs and random crashes
jcalderonzumba_MinkPhantomJSDriver
train
php
10c4e93a8d8fe3afea3892119f2e61a4602bd712
diff --git a/buffer.js b/buffer.js index <HASH>..<HASH> 100644 --- a/buffer.js +++ b/buffer.js @@ -77,7 +77,7 @@ proto.update = function(array, offset) { dtype = "float32" } if(this.type === this.gl.ELEMENT_ARRAY_BUFFER) { - var wgl = webglew(gl) + var wgl = webglew(this.gl) var ext = wgl.OES_element_index_uint if(ext && dtype !== "uint16") { dtype = "uint32"
bugfix: fix "gl" reference error with ndarray element buffers
stackgl_gl-buffer
train
js
85dd1f853e19b9537b178498100ddbfaf81886f7
diff --git a/src/Storage/Field/Collection/RepeatingFieldCollection.php b/src/Storage/Field/Collection/RepeatingFieldCollection.php index <HASH>..<HASH> 100644 --- a/src/Storage/Field/Collection/RepeatingFieldCollection.php +++ b/src/Storage/Field/Collection/RepeatingFieldCollection.php @@ -122,6 +122,7 @@ class RepeatingFieldCollection extends ArrayCollection foreach ($collection->flatten() as $entity) { $master = $this->getOriginal($entity); $master->setValue($entity->getValue()); + $master->setFieldtype($entity->getFieldtype()); $master->handleStorage($this->getFieldType($entity->getFieldname())); $updated[] = $master;
allow updating the fieldtype on save if the config has changed
bolt_bolt
train
php
ea1e7460dd655cf10f5316a5c32a639735787865
diff --git a/app/validators/slug_validator.rb b/app/validators/slug_validator.rb index <HASH>..<HASH> 100644 --- a/app/validators/slug_validator.rb +++ b/app/validators/slug_validator.rb @@ -18,7 +18,7 @@ class SlugValidator < ActiveModel::EachValidator protected class InstanceValidator < Struct.new(:record, :attribute, :value) def starts_with?(expected_prefix) - value.to_s[0...expected_prefix.size] == expected_prefix + value.to_s.start_with?(expected_prefix) end def of_kind?(expected_kind)
Use String#start_with? to implement starts_with? It makes more sense to use a standard library method than to reinvent the wheel.
alphagov_govuk_content_models
train
rb
aa78fd084463f81b183cccb21ceb4d6d0ded33c8
diff --git a/carnifex/sshprocess.py b/carnifex/sshprocess.py index <HASH>..<HASH> 100644 --- a/carnifex/sshprocess.py +++ b/carnifex/sshprocess.py @@ -73,18 +73,17 @@ class SSHProcessInductor(ProcessInductor): else SSHCommand(command, self.precursor, path)) commandLine = sshCommand.getCommandLine() - user = self._getUser(uid) - # Get connection to ssh server - connectionDeferred = self.getConnection(user) + connectionDeferred = self.getConnection(uid) # spawn the remote process connectionDeferred.addCallback(connectProcess, processProtocol, commandLine, env, usePTY, childFDs) return connectionDeferred - def getConnection(self, user): + def getConnection(self, uid): #TODO: Fix case where we try to get another connection to the same user # before the first has connected... + user = self._getUser(uid) connection = self._connections.get(user, None) if connection: return defer.succeed(connection)
Handle uid to user lookup on a lower level; getConnection instead of execute
sporsh_carnifex
train
py
3cf335b0b9bf39480638f29fce16d830e71a16e7
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -251,7 +251,7 @@ project = 'Salt' version = salt.version.__version__ latest_release = '2018.3.2' # latest release -previous_release = '2017.7.6' # latest release from previous branch +previous_release = '2017.7.7' # latest release from previous branch previous_release_dir = '2017.7' # path on web server for previous branch next_release = '' # next release next_release_dir = '' # path on web server for next release branch
Update release versions for the <I> branch
saltstack_salt
train
py
aa753e04a5fcb5779e45a848d4c3ca0aac9cc1b1
diff --git a/js/heidelberg/heidelberg.js b/js/heidelberg/heidelberg.js index <HASH>..<HASH> 100644 --- a/js/heidelberg/heidelberg.js +++ b/js/heidelberg/heidelberg.js @@ -54,9 +54,12 @@ this.setupSpreads(); } + var leftFunction = options.canClose ? 'even' : 'odd'; + var rightFunction = options.canClose ? 'odd' : 'even'; + els.pages = $('.Heidelberg-Page', this.el); - els.pagesLeft = options.canClose ? $('.Heidelberg-Page:nth-child(2n)', el) : $('.Heidelberg-Page:nth-child(2n+1)', el); - els.pagesRight = options.canClose ? $('.Heidelberg-Page:nth-child(2n+1)', el) : $('.Heidelberg-Page:nth-child(2n)', el); + els.pagesLeft = $('.Heidelberg-Page:nth-child('+leftFunction+')', el); + els.pagesRight = $('.Heidelberg-Page:nth-child('+rightFunction+')', el); if(!options.canClose) { var coverEl = $('<div />').addClass('Heidelberg-HiddenCover');
Tidy up left and right functions
djgrant_heidelberg
train
js
d50d9efc25d2807063ebf93ba83618ac2e7faba8
diff --git a/angr/analyses/cfg/cfg_base.py b/angr/analyses/cfg/cfg_base.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg/cfg_base.py +++ b/angr/analyses/cfg/cfg_base.py @@ -6,7 +6,7 @@ from collections import defaultdict import networkx -from cle import ELF, PE +from cle import ELF, PE, Blob import pyvex import simuvex from claripy.utils.orderedset import OrderedSet @@ -563,6 +563,20 @@ class CFGBase(Analysis): tpl = (rebase_addr + section.min_addr, rebase_addr + section.max_addr) memory_regions.append(tpl) + elif isinstance(b, Blob): + # a blob is entirely executable + tpl = (rebase_addr + b.get_min_addr(), rebase_addr + b.get_max_addr()) + memory_regions.append(tpl) + + elif isinstance(b, AngrExternObject): + pass + + else: + l.warning('Unsupported object format "%s". Treat it as an executable.', b.__class__.__name__) + + tpl = (rebase_addr + b.get_min_addr(), rebase_addr + b.get_max_addr()) + memory_regions.append(tpl) + if not memory_regions: memory_regions = [ (self.project.loader.main_bin.rebase_addr + start,
CFGBase: _executable_memory_regions() supports more types of objects.
angr_angr
train
py
950bf3193fcdc190c84e63fea8b2116063d0cce5
diff --git a/lib/ractive-render.js b/lib/ractive-render.js index <HASH>..<HASH> 100644 --- a/lib/ractive-render.js +++ b/lib/ractive-render.js @@ -122,7 +122,13 @@ rr.renderFile = function (file, options, callback) { return rr.loaders[options.use](file, options).then(function (Component) { options.data = options.data || options; - return new Component(options).toHTML(); + var component = new Component( options ); + var html = component.toHTML(); + + component.teardown(); + + return html; + }); }).nodeify(callback); };
Teardown components after render to prevent leaking
MartinKolarik_ractive-render
train
js
e56014c9caf63fec9173da7a8591057475883b32
diff --git a/mode/soy/soy.js b/mode/soy/soy.js index <HASH>..<HASH> 100644 --- a/mode/soy/soy.js +++ b/mode/soy/soy.js @@ -300,10 +300,10 @@ } else if (peekChar == "[") { state.soyState.push('param-type-record'); return null; + } else if (peekChar == "<") { + state.soyState.push('param-type-parameter'); + return null; } else if (match = stream.match(/^([\w]+|[?])/)) { - if (match[0] == "map" || match[0] == "list") { - state.soyState.push('param-type-map-list'); - } return "type"; } stream.next(); @@ -322,8 +322,7 @@ stream.next(); return null; - case "param-type-map-list": - var peekChar = stream.peek(); + case "param-type-parameter": if (stream.match(/^[>]/)) { state.soyState.pop(); return null;
[soy mode] Fix bug with "map" in type name
codemirror_CodeMirror
train
js
80640e2a9bc0853e17fd663ce0fb356c3f26c8cd
diff --git a/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/OutlierLinearScaling.java b/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/OutlierLinearScaling.java index <HASH>..<HASH> 100644 --- a/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/OutlierLinearScaling.java +++ b/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/OutlierLinearScaling.java @@ -189,7 +189,7 @@ public class OutlierLinearScaling implements OutlierScalingFunction { } } } - factor = (max - min); + factor = max > min ? max - min : 1.; } @Override @@ -245,7 +245,7 @@ public class OutlierLinearScaling implements OutlierScalingFunction { } } } - factor = (max - min); + factor = max > min ? max - min : 1.; } @Override
Fix outlier scaling for constant scores.
elki-project_elki
train
java
5e63e091301de6a45d4d2af7ab2a8c03b6c79298
diff --git a/core/src/main/java/lucee/runtime/orm/ORMDatasourceConnection.java b/core/src/main/java/lucee/runtime/orm/ORMDatasourceConnection.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/lucee/runtime/orm/ORMDatasourceConnection.java +++ b/core/src/main/java/lucee/runtime/orm/ORMDatasourceConnection.java @@ -416,4 +416,9 @@ public class ORMDatasourceConnection implements DatasourceConnectionPro { public int getDefaultTransactionIsolation() { return ((DataSourcePro) datasource).getDefaultTransactionIsolation(); } + + @Override + public boolean validate() { + return datasource.validate(); + } } \ No newline at end of file
reduce default live timeout of a connection from <I> to <I> minutes. Validate a connection once a minute, even the validation flag is set to false. check timeout when grapping a connection from pool
lucee_Lucee
train
java
e5691ce69f54cb8bae5a856bd546bb830b45e92e
diff --git a/napalm_logs/publisher.py b/napalm_logs/publisher.py index <HASH>..<HASH> 100644 --- a/napalm_logs/publisher.py +++ b/napalm_logs/publisher.py @@ -81,6 +81,10 @@ class NapalmLogsPublisherProc(NapalmLogsProc): self.transport = transport_class(self.address, self.port, **self.publisher_opts) + self.__transport_encrypt = True + if hasattr(self.transport, 'NO_ENCRYPT') and\ + getattr(self.transport, 'NO_ENCRYPT') == True: + self.__transport_encrypt = False def _prepare(self, bin_obj): ''' @@ -120,10 +124,8 @@ class NapalmLogsPublisherProc(NapalmLogsProc): log.error(error, exc_info=True) raise NapalmLogsExit(error) log.debug('Publishing the OC object (serialised)') - if not self.disable_security: + if not self.disable_security and self.__transport_encrypt: bin_obj = self._prepare(bin_obj) - # else: - # bin_obj = umsgpack.packb(obj) self.transport.publish(bin_obj) def stop(self):
Allow the possibility to send unencrypted data to the publisher Transports such as HTTP cannot send binary data, but rather send the data in the HTTP payload, so there's no need to encrypt, or encrypt then decrypt. If the transport cannot handle encrypted data, it can add the NO_ENCRYPT instance variable in the transport class.
napalm-automation_napalm-logs
train
py
07ca0378bfd62b1815c42b44f17d0438763a7180
diff --git a/cmd/influx_inspect/reporttsi/report.go b/cmd/influx_inspect/reporttsi/report.go index <HASH>..<HASH> 100644 --- a/cmd/influx_inspect/reporttsi/report.go +++ b/cmd/influx_inspect/reporttsi/report.go @@ -79,6 +79,10 @@ func (cmd *Command) Run(args ...string) error { return err } + if cmd.byTagKey { + return errors.New("Segmenting cardinality by tag key is not yet implemented") + } + if cmd.dbPath == "" { return errors.New("path to database must be provided") }
Implementing -tag-keys is a TODO
influxdata_influxdb
train
go
ca552420b053d76fe33dd99a74d449865801e287
diff --git a/lib/hector/session.rb b/lib/hector/session.rb index <HASH>..<HASH> 100644 --- a/lib/hector/session.rb +++ b/lib/hector/session.rb @@ -12,11 +12,13 @@ module Hector def receive(request) if respond_to?(request.event_name) send(request.event_name) - else - connection.close_connection end end + def on_quit + connection.close_connection + end + def unbind end
Don't disconnect when unknown commands hit the session
sstephenson_hector
train
rb
8a3bfabcf617bf5266c46f23d5703bddd8a3f760
diff --git a/src/views/layouts/master.blade.php b/src/views/layouts/master.blade.php index <HASH>..<HASH> 100644 --- a/src/views/layouts/master.blade.php +++ b/src/views/layouts/master.blade.php @@ -40,12 +40,12 @@ </header> <section class="sub-header"> - <div class="container"> + <div class="container-fluid"> @yield('subheader') </div> </section> - <div class="container"> + <div class="container-fluid"> @yield('content') </div>
everything is fluid. more on that soon
krafthaus_bauhaus
train
php
069a288a5976ee0c4582ac29b06e352b3687e2bc
diff --git a/etcd/peer.go b/etcd/peer.go index <HASH>..<HASH> 100644 --- a/etcd/peer.go +++ b/etcd/peer.go @@ -122,7 +122,7 @@ func (p *peer) post(d []byte) { buf := bytes.NewBuffer(d) resp, err := p.c.Post(p.url, "application/octet-stream", buf) if err != nil { - log.Println("peer.post url=%s err=\"%v\"", p.url, err) + log.Printf("peer.post url=%s err=\"%v\"", p.url, err) return } resp.Body.Close() diff --git a/etcd/peer_hub.go b/etcd/peer_hub.go index <HASH>..<HASH> 100644 --- a/etcd/peer_hub.go +++ b/etcd/peer_hub.go @@ -25,6 +25,7 @@ import ( "net/url" "path" "sync" + "time" "github.com/coreos/etcd/raft" ) @@ -77,6 +78,9 @@ func (h *peerHub) stop() { for _, p := range h.peers { p.stop() } + // http.Transport needs some time to put used connections + // into idle queues. + time.Sleep(time.Millisecond) tr := h.c.Transport.(*http.Transport) tr.CloseIdleConnections() }
peer: wait a little before closing idle connections It seems that it needs some time to set connections that just used as idle.
etcd-io_etcd
train
go,go
6e76f8f5c05cb2f00d7a2f4d58e6dd35a23655f6
diff --git a/activesupport/lib/active_support/tagged_logging.rb b/activesupport/lib/active_support/tagged_logging.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/tagged_logging.rb +++ b/activesupport/lib/active_support/tagged_logging.rb @@ -14,7 +14,6 @@ module ActiveSupport class TaggedLogging def initialize(logger) @logger = logger - @tags = Hash.new { |h,k| h[k] = [] } end def tagged(*new_tags) @@ -39,7 +38,7 @@ module ActiveSupport end def flush - @tags.delete(Thread.current) + current_tags.clear @logger.flush if @logger.respond_to?(:flush) end @@ -57,7 +56,7 @@ module ActiveSupport end def current_tags - @tags[Thread.current] + Thread.current[:activesupport_tagged_logging_tags] ||= [] end end end
use thread variable in TaggedLogging previous solution can cause race conditions under GIL-free ruby implementations
rails_rails
train
rb
0225ad42eab9f20ac4348dd85ccde8fdbfc206fb
diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,11 +29,11 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2018112000.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2018112000.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -$release = '3.6beta (Build: 20181118)'; // Human-friendly version name +$release = '3.6beta+ (Build: 20181120)'; // Human-friendly version name $branch = '36'; // This version's branch. $maturity = MATURITY_BETA; // This version's maturity level.
on-demand release <I>beta+
moodle_moodle
train
php
432bc5a5b191b0cb0c62df8448bfc2eb710a0f5d
diff --git a/lib/monitor.js b/lib/monitor.js index <HASH>..<HASH> 100644 --- a/lib/monitor.js +++ b/lib/monitor.js @@ -339,6 +339,11 @@ Dashboard.prototype.layoutCmd = function() { process.exit(0); }); + this.input.key(["C-w"], function() { + self.input.clearValue(); + self.input.focus(); + }); + this.input.key(["up"], function() { var cmd = self.history.getPreviousCommand(); self.input.setValue(cmd);
clear cmd line on ctrl-w
embark-framework_embark
train
js
7e3be53f9fbe43b7affeebca55171e5d77398fe3
diff --git a/discoverd/health/check_test.go b/discoverd/health/check_test.go index <HASH>..<HASH> 100644 --- a/discoverd/health/check_test.go +++ b/discoverd/health/check_test.go @@ -25,7 +25,9 @@ func (CheckSuite) TestTCPSuccess(c *C) { go func() { conn, err := l.Accept() - if err != nil { + if err != nil && strings.Contains(err.Error(), "use of closed network connection") { + return + } else if err != nil { panic(err) } conn.Close()
discoverd/health: Fix accept race in Check test Sometimes the TCP checker will close the connection before the listener has finished accepting the connection.
flynn_flynn
train
go
799224346274a91bcbff2a2e38495472fcffc2bb
diff --git a/src/CloudApi/ClientInterface.php b/src/CloudApi/ClientInterface.php index <HASH>..<HASH> 100644 --- a/src/CloudApi/ClientInterface.php +++ b/src/CloudApi/ClientInterface.php @@ -16,6 +16,7 @@ use AcquiaCloudApi\Response\EnvironmentResponse; use AcquiaCloudApi\Response\EnvironmentsResponse; use AcquiaCloudApi\Response\InsightsResponse; use AcquiaCloudApi\Response\InvitationsResponse; +use AcquiaCloudApi\Response\LogstreamResponse; use AcquiaCloudApi\Response\MembersResponse; use AcquiaCloudApi\Response\OperationResponse; use AcquiaCloudApi\Response\OrganizationsResponse;
Corrects include to use the right return type.
typhonius_acquia-php-sdk-v2
train
php
b41da2119ab751982d470a012889b0d22b567b4d
diff --git a/configure.py b/configure.py index <HASH>..<HASH> 100755 --- a/configure.py +++ b/configure.py @@ -58,6 +58,9 @@ n.comment('This file is used to build ninja itself.') n.comment('It is generated by ' + os.path.basename(__file__) + '.') n.newline() +n.comment('The arguments passed to configure.py, for rerunning it.') +n.variable('configure_args', ' '.join(sys.argv[1:])) + def src(filename): return os.path.join('src', filename) def built(filename): @@ -206,7 +209,7 @@ n.newline() n.comment('Regenerate build files if build script changes.') n.rule('configure', - command='./configure.py') + command='./configure.py $configure_args') n.build('build.ninja', 'configure', implicit='configure.py') n.newline()
preserve configure.py params across re-runs
ninja-build_ninja
train
py
1a294c87ff5fe2d36d4da71e167b8e39c5bd2870
diff --git a/tests/python_package_test/test_dask.py b/tests/python_package_test/test_dask.py index <HASH>..<HASH> 100644 --- a/tests/python_package_test/test_dask.py +++ b/tests/python_package_test/test_dask.py @@ -8,8 +8,10 @@ from itertools import groupby from os import getenv from sys import platform -import lightgbm as lgb import pytest + +import lightgbm as lgb + if not platform.startswith('linux'): pytest.skip('lightgbm.dask is currently supported in Linux environments', allow_module_level=True) if not lgb.compat.DASK_INSTALLED: @@ -21,16 +23,15 @@ import dask.dataframe as dd import joblib import numpy as np import pandas as pd -from scipy.stats import spearmanr from dask.array.utils import assert_eq -from dask.distributed import default_client, Client, LocalCluster, wait +from dask.distributed import Client, LocalCluster, default_client, wait from distributed.utils_test import client, cluster_fixture, gen_cluster, loop from scipy.sparse import csr_matrix +from scipy.stats import spearmanr from sklearn.datasets import make_blobs, make_regression from .utils import make_ranking - # time, in seconds, to wait for the Dask client to close. Used to avoid teardown errors # see https://distributed.dask.org/en/latest/api.html#distributed.Client.close CLIENT_CLOSE_TIMEOUT = 120
[ci][python] apply isort to tests/python_package_test/test_dask.py #<I> (#<I>)
Microsoft_LightGBM
train
py
18dbe2d1b3f5ee396c38e9b0bfeaa5a66d53e419
diff --git a/src/functionHelper.js b/src/functionHelper.js index <HASH>..<HASH> 100644 --- a/src/functionHelper.js +++ b/src/functionHelper.js @@ -116,7 +116,9 @@ exports.createExternalHandler = function createExternalHandler( function handleFatal(error) { debugLog(`External handler received fatal error ${stringify(error)}`); - handlerContext.inflight.forEach((id) => messageCallbacks[id](error)); + handlerContext.inflight.forEach((id) => { + messageCallbacks[id](error); + }); handlerContext.inflight.clear(); delete handlerCache[funOptions.handlerPath]; }
Add braces for non-returning functions
dherault_serverless-offline
train
js
dce3b5a9c70e8c1403e69971cd79ee8a85dc42c9
diff --git a/gimmemotifs/commands/pwmscan.py b/gimmemotifs/commands/pwmscan.py index <HASH>..<HASH> 100755 --- a/gimmemotifs/commands/pwmscan.py +++ b/gimmemotifs/commands/pwmscan.py @@ -14,7 +14,6 @@ from gimmemotifs.utils import parse_cutoff from gimmemotifs.scan import scan VERSION = "1.2" -NREPORT = 1 MAX_CPUS = 16 DEFAULT_CUTOFF = 0.9 @@ -25,7 +24,7 @@ def pwmscan(args): bed = args.bed motifs = pwmfile_to_motifs(args.pwmfile) - result = scan(inputfile, motifs, cutoff, NREPORT) + result = scan(inputfile, motifs, cutoff, nreport) p = re.compile(r'([^\s:]+):(\d+)-(\d+)') fa = Fasta(inputfile)
Fixed bug where nrpeport was not taken into account
vanheeringen-lab_gimmemotifs
train
py
11196b079ed5fabcc71e345ce73645bc0199954d
diff --git a/src/rez/utils/_version.py b/src/rez/utils/_version.py index <HASH>..<HASH> 100644 --- a/src/rez/utils/_version.py +++ b/src/rez/utils/_version.py @@ -3,4 +3,4 @@ # Update this value to version up Rez. Do not place anything else in this file. -_rez_version = "2.107.0" +_rez_version = "2.108.0"
need to do this just to simplify Method internal stuff, we need this change and I'm deploying from branch
nerdvegas_rez
train
py
7e4b0986c84ba5358ba691e1a44cb18395cb577e
diff --git a/mod/feedback/backup/moodle2/restore_feedback_activity_task.class.php b/mod/feedback/backup/moodle2/restore_feedback_activity_task.class.php index <HASH>..<HASH> 100644 --- a/mod/feedback/backup/moodle2/restore_feedback_activity_task.class.php +++ b/mod/feedback/backup/moodle2/restore_feedback_activity_task.class.php @@ -54,7 +54,7 @@ class restore_feedback_activity_task extends restore_activity_task { static public function define_decode_contents() { $contents = array(); - $contents[] = new restore_decode_content('feedback', array('intro'), 'feedback'); + $contents[] = new restore_decode_content('feedback', array('intro', 'site_after_submit', 'page_after_submit'), 'feedback'); $contents[] = new restore_decode_content('feedback_item', array('presentation'), 'feedback_item'); $contents[] = new restore_decode_content('feedback_value', array('value'), 'feedback_value');
MDL-<I> - When a Feedback activity is restore the "Site after submit" URL is not updated and shows "$@PAGEVIEWBYID*<I>@$"
moodle_moodle
train
php
28f664a50ee3f3981628c4813eef46c4b69bb890
diff --git a/PyCIM/Test/CIM15Test.py b/PyCIM/Test/CIM15Test.py index <HASH>..<HASH> 100644 --- a/PyCIM/Test/CIM15Test.py +++ b/PyCIM/Test/CIM15Test.py @@ -20,6 +20,8 @@ import unittest +import pytest + from CIM15.IEC61970.Core import \ ConnectivityNode, Terminal @@ -228,7 +230,7 @@ class ACLineSegmentTests(unittest.TestCase): def test_more_than_one_impedance_returns_error(self): per_length_sequence_impedance = PerLengthSequenceImpedance() per_length_phase_impedance = PerLengthPhaseImpedance() - with self.assertRaises(ValueError): + with pytest.raises(ValueError): ac_line_segment = ACLineSegment( PhaseImpedance=per_length_phase_impedance, SequenceImpedance=per_length_sequence_impedance)
Use pytest.raises instead of self.assertRaises. The hope is that pytest's "raises" context manager will work in python <I>, which doesn't ship with unittest's assertRaises as a context manager.
rwl_PyCIM
train
py
82213b5045aacb1c0abc0ece5cb0719127c703a6
diff --git a/lib/group_consumer.js b/lib/group_consumer.js index <HASH>..<HASH> 100644 --- a/lib/group_consumer.js +++ b/lib/group_consumer.js @@ -269,6 +269,9 @@ GroupConsumer.prototype._prepareOffsetRequest = function (type, commits) { */ GroupConsumer.prototype.commitOffset = function (commits) { var self = this; + if (self.memberId === null) { + return Promise.reject(errors.byName('RebalanceInProgress')); + } return self.client.offsetCommitRequestV2(self.options.groupId, self.memberId, self.generationId, self._prepareOffsetRequest('commit', commits)); };
Reject commitOffset call if group rebalance is in progress
oleksiyk_kafka
train
js
1854092413a1c5be7ff100f8db99ccab8dd6d0c8
diff --git a/samples/test/dns.test.js b/samples/test/dns.test.js index <HASH>..<HASH> 100644 --- a/samples/test/dns.test.js +++ b/samples/test/dns.test.js @@ -28,12 +28,14 @@ describe(__filename, () => { before(async () => { const projectId = await dns.getProjectId(); - return dns.createZone(zoneName, { + await dns.createZone(zoneName, { dnsName: `${projectId}.appspot.com.`, }); }); - after(() => dns.zone(zoneName).delete()); + after(async () => { + await dns.zone(zoneName).delete(); + }); it('should run the quickstart', () => { const output = exec('node quickstart');
test: harden sample tests a bit (#<I>)
googleapis_nodejs-dns
train
js
206a8e3eed29ac40f3d082912d1e1e8253d4cd3a
diff --git a/types/types.go b/types/types.go index <HASH>..<HASH> 100644 --- a/types/types.go +++ b/types/types.go @@ -57,7 +57,6 @@ type Image interface { // May be "" if unknown. IntendedDockerReference() string // Manifest is like ImageSource.GetManifest, but the result is cached; it is OK to call this however often you need. - // FIXME? This should also return a MIME type if known, to differentiate between schema versions. Manifest() ([]byte, error) // Signatures is like ImageSource.GetSignatures, but the result is cached; it is OK to call this however often you need. Signatures() ([][]byte, error)
Remove a FIXME? about types.Image.Manifest. Per the discussion in <URL>. So, Image.Manifest will not be all that useful for parsing the contents, it is basically useful only for verifying against a digest.
containers_image
train
go
2545650dc5b3e770eb49b807e7a9ec450c6a0d4e
diff --git a/tests/test_interface.py b/tests/test_interface.py index <HASH>..<HASH> 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -4,6 +4,9 @@ from __future__ import unicode_literals import unittest import resources +from nose.plugins.skip import SkipTest +raise SkipTest() + class TestInterface(unittest.TestCase):
Skip these old tests for now until we decide whether to keep them.
core_uricore
train
py
7a55a0c812e801c43e4a6846234acd79d7b02544
diff --git a/themes/colors/header.php b/themes/colors/header.php index <HASH>..<HASH> 100644 --- a/themes/colors/header.php +++ b/themes/colors/header.php @@ -53,22 +53,7 @@ if (WT_USE_LIGHTBOX) { echo '</head>', - '<body id="body">', - $javascript; -?> -<!-- Remove submenu from home --> -<script type="text/javascript"> -jQuery(document).ready(function() { - var obj = {}; - var num = 0; - var num = jQuery('#menu-tree ul li').length; - if(num == 2) { - jQuery('#menu-tree ul').remove(); - } -}); -</script> -<!-- begin header section --> -<?php + '<body id="body">'; if ($view!='simple') { // Use "simple" headers for popup windows echo @@ -157,4 +142,9 @@ if ($view!='simple') { // Use "simple" headers for popup windows } echo '</div>'; // <div id="header"> } +// Remove submenu from home +$javascript; +$this->addInlineJavaScript( + 'if (jQuery("#menu-tree ul li").length == 2) jQuery("#menu-tree ul").remove();' +); echo $javascript, '<div id="content">';
Move jquery code for home icon to end of header
fisharebest_webtrees
train
php
2c27564ef31edd593e7057925c5af4743e5a4aeb
diff --git a/src/Navigation.js b/src/Navigation.js index <HASH>..<HASH> 100644 --- a/src/Navigation.js +++ b/src/Navigation.js @@ -67,13 +67,13 @@ function _registerComponentRedux(screenID, generator, store, Provider, options) constructor(props) { super(props); this.state = { - internalProps: {...props, ...PropRegistry.load(props.screenInstanceID)} + internalProps: {...props, ...PropRegistry.load(props.screenInstanceID || props.passPropsKey)} } } componentWillReceiveProps(nextProps) { this.setState({ - internalProps: {...PropRegistry.load(this.props.screenInstanceID), ...nextProps} + internalProps: {...PropRegistry.load(this.props.screenInstanceID || this.props.passPropsKey), ...nextProps} }) }
Load props from props registry for redux screens
wix_react-native-navigation
train
js
e52ef94799f57d791f8946f6fb3a81aa26c48ddd
diff --git a/telepot/aio/api.py b/telepot/aio/api.py index <HASH>..<HASH> 100644 --- a/telepot/aio/api.py +++ b/telepot/aio/api.py @@ -1,3 +1,4 @@ +import os import asyncio import aiohttp import async_timeout @@ -117,7 +118,10 @@ async def _parse(response): async def request(req, **user_kw): fn, args, kwargs, timeout, cleanup = _transform(req, **user_kw) - + + # If http_proxy is set in the environment we should take care of + kwargs['proxy'] = os.environ.get('http_proxy') + try: if timeout is None: async with fn(*args, **kwargs) as r:
Handle http_proxy environment variable
AmanoTeam_amanobot
train
py
1f96538a2aae39a4f4f7c0f0fc3a9fdbd0cf3f59
diff --git a/js/render/live.js b/js/render/live.js index <HASH>..<HASH> 100644 --- a/js/render/live.js +++ b/js/render/live.js @@ -73,7 +73,7 @@ function renderLivePreview(withalerts) { remove = $live.find('iframe').length > 0, frame = $live.append('<iframe class="stretch" frameBorder="0"></iframe>').find('iframe:first')[0], doc = frame.contentDocument || frame.contentWindow.document, - window = document.defaultView || document.parentWindow, + win = doc.defaultView || doc.parentWindow, d = new Date(); if (!useCustomConsole) console.log('--- refreshing live preview @ ' + [two(d.getHours()),two(d.getMinutes()),two(d.getSeconds())].join(':') + ' ---'); @@ -102,8 +102,17 @@ function renderLivePreview(withalerts) { } else { doc.write('<script>delete window.print;delete window.alert;delete window.prompt;delete window.confirm;</script>'); } + + // almost jQuery Mobile specific - when the page renders + // it moves the focus over to the live preview - since + // we no longer have a "render" panel, our code loses + // focus which is damn annoying. So, I cancel the iframe + // focus event...because I can :) + win.onfocus = function () { + return false; + }; + doc.write(source); - console.log(source); } doc.close();
Fixed focusing issue when testing jQueryMobile
jsbin_jsbin
train
js
5d5e691041e30770a0023e1d52c789b702ab76ae
diff --git a/lib/main/redis.main.js b/lib/main/redis.main.js index <HASH>..<HASH> 100644 --- a/lib/main/redis.main.js +++ b/lib/main/redis.main.js @@ -112,10 +112,7 @@ Redis.prototype.connect = function() { var vers = client.server_info.versions; var verError = 'Kansas will only work with Redis Server v2.8.0 or later.' + ' Your version: ' + vers[0] + '.' + vers[1] + '.' + vers[2]; - if (vers[0] < 2) { - return reject(verError); - } - if (vers[1] < 8) { + if (vers[0] < 2 && vers[1] < 8) { return reject(verError); } client.removeListener('error', onError);
fix check version error credit for finding the if-case to @attheodo
thanpolas_kansas
train
js
c59aad9175885c51521300a2af3276c104d74981
diff --git a/spec/unit/association_spec.rb b/spec/unit/association_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/association_spec.rb +++ b/spec/unit/association_spec.rb @@ -160,6 +160,7 @@ describe Neo4j::ActiveNode::HasN::Association do before(:each) do stub_const('TheRel', Class.new do + def self.name; 'TheRel' end include Neo4j::ActiveRel from_class :any end)
Rel class needs a name to avoid stack overflow ('type' defaults to `self.namespaced_model_name` which is `nil` without a properly named class, so `#type`calls `#rel_type` which sets type as `self.namespaced_model_name` which is still `nil`, so `#type` calls `#rel_type`, .....)
neo4jrb_neo4j
train
rb
ac11b8b6a8e5f7d8cf3c5f9de493a0f02f4ac93a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,6 @@ install_requires = [ 'aiohttp~=3.5.0', 'async_timeout~=3.0', # to avoid pip10 resolver issue 'attrs>=18.0', # to avoid pip10 resolver issue - 'namedlist>=1.6', 'python-dateutil>=2.5', 'tabulate>=0.7.7', 'tqdm~=4.21',
setup: Remove namedlist from requirements (#<I>)
lablup_backend.ai-client-py
train
py
5a16dbc343b29383cbdd26e32e94bca09ada2de2
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -65,9 +65,9 @@ author = 'Pachyderm' # built documents. # # The short X.Y version. -version = '1.7.4' +version = '1.7.5' # The full version, including alpha/beta/rc tags. -release = '1.7.4' +release = '1.7.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/client/version/client.go b/src/client/version/client.go index <HASH>..<HASH> 100644 --- a/src/client/version/client.go +++ b/src/client/version/client.go @@ -12,7 +12,7 @@ const ( // MinorVersion is the current minor version for pachyderm. MinorVersion = 7 // MicroVersion is the patch number for pachyderm. - MicroVersion = 4 + MicroVersion = 5 ) var (
Bumpd version to <I>.
pachyderm_pachyderm
train
py,go
d0cb9b37360afba563708d459a60e027a508d19a
diff --git a/graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java b/graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java +++ b/graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java @@ -115,7 +115,7 @@ public class SessionsResource extends RestResource { ((DefaultSecurityManager) SecurityUtils.getSecurityManager()).getSubjectDAO().save(subject); } catch (AuthenticationException e) { - LOG.warn("Unable to log in user " + createRequest.username(), e); + LOG.info("Invalid username or password for user \"{}\"", createRequest.username()); } catch (UnknownSessionException e) { subject.logout(); }
Make log message for invalid credentials less verbose There's little use in logging the complete stacktrace of the failed login every time a user enters invalid credentials. (cherry picked from commit <I>f<I>df<I>f<I>d6ddc<I>fc1c<I>ec<I>de<I>bd)
Graylog2_graylog2-server
train
java
2b49a7f466b37ddb3e8dda63d5fa1a9ccdce9268
diff --git a/app/Blueprint/Webserver/WebserverBlueprint.php b/app/Blueprint/Webserver/WebserverBlueprint.php index <HASH>..<HASH> 100644 --- a/app/Blueprint/Webserver/WebserverBlueprint.php +++ b/app/Blueprint/Webserver/WebserverBlueprint.php @@ -297,7 +297,7 @@ class WebserverBlueprint implements Blueprint { $imageName = $config->get('docker.repository') . ':' . $config->get('docker.version-prefix') . $version; $appService = new AppService($imageName); - $appService->setName($config->get('service-name') . '-App'); + $appService->setName($config->get('service-name') . 'App'); $serverService->addSidekick($appService); $serverService->addVolumeFrom($appService);
Changed AppContainer nameing scheme from `service-name`-App to `service-name`App
ipunkt_rancherize
train
php
8521edd4296664ee660cc56318827c1edebc9a04
diff --git a/api/server/sdk/volume_ops.go b/api/server/sdk/volume_ops.go index <HASH>..<HASH> 100644 --- a/api/server/sdk/volume_ops.go +++ b/api/server/sdk/volume_ops.go @@ -57,7 +57,7 @@ func (s *VolumeServer) waitForVolumeReady(ctx context.Context, id string) (*api. } // Check if the volume is ready - if v.GetStatus() == api.VolumeStatus_VOLUME_STATUS_UP { + if v.GetStatus() == api.VolumeStatus_VOLUME_STATUS_UP && v.GetState() != api.VolumeState_VOLUME_STATE_ATTACHED { return false, nil }
PWX-<I>: Make sure the volume is detached before we return (#<I>)
libopenstorage_openstorage
train
go
a0335f87edc8062e28bda49af49afda704906635
diff --git a/cpp/__init__.py b/cpp/__init__.py index <HASH>..<HASH> 100644 --- a/cpp/__init__.py +++ b/cpp/__init__.py @@ -1 +1 @@ -__version__ = '0.1.2' +__version__ = '0.1.3'
Increment patch version to <I>
myint_cppclean
train
py
6da3183105aa0722609029bc1a8e55775ea8bde3
diff --git a/services/server/server.go b/services/server/server.go index <HASH>..<HASH> 100644 --- a/services/server/server.go +++ b/services/server/server.go @@ -450,8 +450,16 @@ func LoadPlugins(ctx context.Context, config *srvconfig.Config) ([]*plugin.Regis path := filepath.Join(ic.Root, "meta.db") ic.Meta.Exports["path"] = path + options := *bolt.DefaultOptions + // Reading bbolt's freelist sometimes fails when the file has a data corruption. + // Disabling freelist sync reduces the chance of the breakage. + // https://github.com/etcd-io/bbolt/pull/1 + // https://github.com/etcd-io/bbolt/pull/6 + options.NoFreelistSync = true + // Without the timeout, bbolt.Open would block indefinitely due to flock(2). options.Timeout = timeout.Get(boltOpenTimeout) + doneCh := make(chan struct{}) go func() { t := time.NewTimer(10 * time.Second)
Disable writing freelist to make the file robust against data corruptions A bbolt database has a freelist to track all pages that are available for allocation. However writing the list takes some time and reading the list sometimes panics. This commit sets NoFreelistSync true to skipping the freelist entirely, following what etcd does. <URL>
containerd_containerd
train
go
f7d109d2cfb5c82ac0189e399f81a8892adb2ffd
diff --git a/pods/lab.py b/pods/lab.py index <HASH>..<HASH> 100644 --- a/pods/lab.py +++ b/pods/lab.py @@ -176,7 +176,7 @@ if gdata_available: sheet = self._get_sheet(user) for share in sheet.share_list(): if user in share: - sheet.share_modify([user], share_type, send_notifications) + sheet.share_modify(user, share_type, send_notifications=False) return sheet.share([user], share_type, send_notifications)
Changes for ambassadors lab class.
sods_ods
train
py
a9bf5d9fd88483363298dbf881a582a80bd32101
diff --git a/spacy/tests/matcher/test_matcher_api.py b/spacy/tests/matcher/test_matcher_api.py index <HASH>..<HASH> 100644 --- a/spacy/tests/matcher/test_matcher_api.py +++ b/spacy/tests/matcher/test_matcher_api.py @@ -205,6 +205,19 @@ def test_matcher_set_value(en_vocab): assert len(matches) == 0 [email protected] +def test_matcher_set_value_operator(en_vocab): + matcher = Matcher(en_vocab) + pattern = [{"ORTH": {"IN": ["a", "the"]}, "OP": "?"}, {"ORTH": "house"}] + matcher.add("DET_HOUSE", None, pattern) + doc = Doc(en_vocab, words=["In", "a", "house"]) + matches = matcher(doc) + assert len(matches) == 1 + doc = Doc(en_vocab, words=["my", "house"]) + matches = matcher(doc) + assert len(matches) == 1 + + def test_matcher_regex(en_vocab): matcher = Matcher(en_vocab) pattern = [{"ORTH": {"REGEX": r"(?:a|an)"}}]
Add xfailing test for set value with operator [ci skip]
explosion_spaCy
train
py
b5762a4c7dbedc2baf363965299c47ad7083be9b
diff --git a/src/Bank/Service.php b/src/Bank/Service.php index <HASH>..<HASH> 100644 --- a/src/Bank/Service.php +++ b/src/Bank/Service.php @@ -71,13 +71,6 @@ class Bank_Service { $form = new Bank_Form_ReceiptNew($param); $receipt = $form->save(); - // Replace variables in the callback URL - $m = new Mustache_Engine(); - $receipt->callbackURL = $m->render($receipt->callbackURL, $receipt->getData()); - // Request to engine to create receipt - $backend = $receipt->get_backend(); - $engine = $backend->get_engine(); - $engine->create($receipt); if ($owner instanceof Pluf_Model) { // Pluf module $receipt->owner_class = $owner->getClass(); $receipt->owner_id = $owner->getId(); @@ -85,6 +78,13 @@ class Bank_Service $receipt->owner_class = $owner; $receipt->owner_id = $ownerId; } + // Replace variables in the callback URL + $m = new Mustache_Engine(); + $receipt->callbackURL = $m->render($receipt->callbackURL, $receipt->getData()); + // Request to engine to create receipt + $backend = $receipt->get_backend(); + $engine = $backend->get_engine(); + $engine->create($receipt); $receipt->update(); return $receipt; }
Change order of some codes to better use of mustach template in the callbackUrl of bank receipt
pluf_bank
train
php
ba30d278bb727404ba2a453b05d5ae4237e24ef6
diff --git a/apps/Sandbox/public/_dev/edit/input.php b/apps/Sandbox/public/_dev/edit/input.php index <HASH>..<HASH> 100644 --- a/apps/Sandbox/public/_dev/edit/input.php +++ b/apps/Sandbox/public/_dev/edit/input.php @@ -10,6 +10,9 @@ $line = isset($_GET['line']) ? $_GET['line'] : 0; $path = isset($_REQUEST['file']) ? $_REQUEST['file'] : false; $rootDir = isset($_ENV['SUNDAY_ROOT']) ? $_ENV['SUNDAY_ROOT'] : dirname(dirname(dirname(dirname(dirname(__DIR__))))); +if (! isset($_ENV['SUNDAY_DISABLE_FULL_PATH_FILE_EDIT']) && is_readable($path)) { + return [$path, $line, $path]; +} // disallow full path $fullPath = $rootDir . '/' . $path; $relativePath = $path;
allow full path file edit SUNDAY_DISABLE_FULL_PATH_FILE_EDIT is for demo site
bearsunday_BEAR.Package
train
php
dd7668296ce1ba7f23bbe1dad90e19b6e396920c
diff --git a/generators/server/templates/src/main/java/package/aop/logging/_LoggingAspect.java b/generators/server/templates/src/main/java/package/aop/logging/_LoggingAspect.java index <HASH>..<HASH> 100644 --- a/generators/server/templates/src/main/java/package/aop/logging/_LoggingAspect.java +++ b/generators/server/templates/src/main/java/package/aop/logging/_LoggingAspect.java @@ -34,12 +34,12 @@ public class LoggingAspect { public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) { log.error("Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'", joinPoint.getSignature().getDeclaringTypeName(), - joinPoint.getSignature().getName(), e.getCause(), e.getMessage()); + joinPoint.getSignature().getName(), (e.getCause() != null? e.getCause() : "NULL"), e.getMessage()); e.printStackTrace(); } else { log.error("Exception in {}.{}() with cause = {}", joinPoint.getSignature().getDeclaringTypeName(), - joinPoint.getSignature().getName(), e.getCause()); + joinPoint.getSignature().getName(), (e.getCause() != null? e.getCause() : "NULL")); } }
Handling cause when it is null
jhipster_generator-jhipster
train
java
b488b1a82449331d16ebfe2a81471efd3123017d
diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go index <HASH>..<HASH> 100644 --- a/lxd/container_lxc.go +++ b/lxd/container_lxc.go @@ -2770,7 +2770,7 @@ func (c *containerLXC) Delete() error { // Delete the container from disk if shared.PathExists(c.Path()) && c.storage != nil { if err := c.storage.ContainerDelete(c); err != nil { - logger.Error("Failed deleting container storage", ctxMap) + logger.Error("Failed deleting container storage", log.Ctx{"name": c.Name(), "err": err}) return err } } @@ -2778,7 +2778,7 @@ func (c *containerLXC) Delete() error { // Remove the database record if err := dbContainerRemove(c.daemon.db, c.Name()); err != nil { - logger.Error("Failed deleting container entry", ctxMap) + logger.Error("Failed deleting container entry", log.Ctx{"name": c.Name(), "err": err}) return err }
Show underlying error when container delete fails
lxc_lxd
train
go
de8a7ce53ae5216ec04b2bfa7d511ea65b60e2cb
diff --git a/src/Storage/Field/Type/RepeaterBlockType.php b/src/Storage/Field/Type/RepeaterBlockType.php index <HASH>..<HASH> 100644 --- a/src/Storage/Field/Type/RepeaterBlockType.php +++ b/src/Storage/Field/Type/RepeaterBlockType.php @@ -9,5 +9,11 @@ namespace Bolt\Storage\Field\Type; */ class RepeaterBlockType extends RepeaterType { - + /** + * {@inheritdoc} + */ + public function getName() + { + return 'repeaterblock'; + } }
adjust the getName for the new field type
bolt_bolt
train
php
f75f7c192586fd856dad10673cd6d1f8cce03f75
diff --git a/testing/conftest.py b/testing/conftest.py index <HASH>..<HASH> 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -1,5 +1,13 @@ +import pytest + + [email protected](hookwrapper=True, tryfirst=True) def pytest_collection_modifyitems(config, items): - """Prefer faster tests.""" + """Prefer faster tests. + + Use a hookwrapper to do this in the beginning, so e.g. --ff still works + correctly. + """ fast_items = [] slow_items = [] neutral_items = [] @@ -24,3 +32,5 @@ def pytest_collection_modifyitems(config, items): fast_items.append(item) items[:] = fast_items + neutral_items + slow_items + + yield
conftest: use a hookwrapper with sorting faster tests first
pytest-dev_pytest
train
py
58cc8bc0a051f73a5f8504e3097079952864b775
diff --git a/angr/analyses/vfg.py b/angr/analyses/vfg.py index <HASH>..<HASH> 100644 --- a/angr/analyses/vfg.py +++ b/angr/analyses/vfg.py @@ -21,7 +21,7 @@ class VFG(Analysis, CFGBase): This class represents a control-flow graph with static analysis result. ''' - def __init__(self, cfg, context_sensitivity_level=2, function_start=None, interfunction_level=0): + def __init__(self, cfg=None, context_sensitivity_level=2, function_start=None, interfunction_level=0): ''' :param project: The project object. @@ -709,4 +709,4 @@ class VFG(Analysis, CFGBase): successors = self._graph.successors(b) for succ in successors: self._graph.remove_edge(b, succ) - l.debug("Removing partial loop header edge %s -> %s", b, succ) \ No newline at end of file + l.debug("Removing partial loop header edge %s -> %s", b, succ)
fixed VFG to take CFG as an optional argument
angr_angr
train
py
66f39b0fe61c51f824c3fa816a62a782be1173d3
diff --git a/src/Symfony/Component/HttpClient/NativeHttpClient.php b/src/Symfony/Component/HttpClient/NativeHttpClient.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpClient/NativeHttpClient.php +++ b/src/Symfony/Component/HttpClient/NativeHttpClient.php @@ -80,9 +80,11 @@ final class NativeHttpClient implements HttpClientInterface, LoggerAwareInterfac } } + $sendContentLength = !\is_string($options['body']) || 'POST' === $method; + $options['body'] = self::getBodyAsString($options['body']); - if ('' === $options['body'] && 'POST' === $method && !isset($options['normalized_headers']['content-length'])) { + if ('' === $options['body'] && $sendContentLength && !isset($options['normalized_headers']['content-length'])) { $options['headers'][] = 'Content-Length: 0'; } if (('' !== $options['body'] || 'POST' === $method) && !isset($options['normalized_headers']['content-type'])) {
[HttpClient] always send Content-Length when a body is passed
symfony_symfony
train
php
9f7add7021edc0edee7c48558a1308cc97956fe7
diff --git a/lib/registry/manifest.js b/lib/registry/manifest.js index <HASH>..<HASH> 100644 --- a/lib/registry/manifest.js +++ b/lib/registry/manifest.js @@ -55,3 +55,5 @@ function fetchFromRegistry (uri, registry, opts, cb) { cb(err, data) }) } + +module.exports._clearMemoized = function () { memoizedManifests = {} } diff --git a/test/util/tnock.js b/test/util/tnock.js index <HASH>..<HASH> 100644 --- a/test/util/tnock.js +++ b/test/util/tnock.js @@ -1,8 +1,12 @@ var nock = require('nock') +var regManifest = require('../../lib/registry/manifest') module.exports = tnock function tnock (t, host) { var server = nock(host) - t.tearDown(function () { server.done() }) + t.tearDown(function () { + server.done() + regManifest._clearMemoized() + }) return server }
test: export utility fn to clear memoized registry manifest requests This should be generalized later
zkat_pacote
train
js,js
6d40ccb04a8402c94879388cd734ac3c6a3f66b7
diff --git a/src/providers/sh/commands/domains/buy.js b/src/providers/sh/commands/domains/buy.js index <HASH>..<HASH> 100644 --- a/src/providers/sh/commands/domains/buy.js +++ b/src/providers/sh/commands/domains/buy.js @@ -55,10 +55,10 @@ module.exports = async function({ domains, args, currentTeam, user, coupon }) { validCoupon = true if (cards.length === 0) { - info( + console.log(info( 'You have no credit cards on file. Please add one in order to claim your free domain' - ) - info(`Your card will ${bold('not')} be charged`) + )) + console.log(info(`Your card will ${bold('not')} be charged`)) await addBilling({ creditCards, @@ -100,7 +100,7 @@ module.exports = async function({ domains, args, currentTeam, user, coupon }) { eraseLines(1) if (!confirmation) { - return info('Aborted') + return console.log(info('Aborted')) } stopSpinner = wait('Purchasing')
Add remaining missing 'console.log' (#<I>)
zeit_now-cli
train
js
e536a96f1d119269e9edc6124825edcebe240d69
diff --git a/code/fields/ComboField.php b/code/fields/ComboField.php index <HASH>..<HASH> 100644 --- a/code/fields/ComboField.php +++ b/code/fields/ComboField.php @@ -65,6 +65,9 @@ class ComboField extends DropdownField public function Field($properties = array()) { + if(empty($this->source) || count($this->source) === 1) { + $this->setEmptyString(''); + } return parent::Field($properties); } } \ No newline at end of file diff --git a/javascript/ComboField.js b/javascript/ComboField.js index <HASH>..<HASH> 100644 --- a/javascript/ComboField.js +++ b/javascript/ComboField.js @@ -5,7 +5,6 @@ $(function () { $(document).on('change', '.field.combo select', function () { - var $this = $(this); var chosenField = null; if ($this.hasClass('has-chzn')) {
if list is empty, make sure we have an empty element
lekoala_silverstripe-form-extras
train
php,js
b36c1802702c645d4bd274e689290b00102e890b
diff --git a/logentry_admin/admin.py b/logentry_admin/admin.py index <HASH>..<HASH> 100644 --- a/logentry_admin/admin.py +++ b/logentry_admin/admin.py @@ -84,6 +84,16 @@ class LogEntryAdmin(admin.ModelAdmin): object_link.admin_order_field = 'object_repr' object_link.short_description = u'object' + def queryset(self, request): + return super( + LogEntryAdmin, + self + ).queryset( + request + ).prefetch_related( + 'content_type' + ) + def action_description(self, obj): return action_names[obj.action_flag] action_description.short_description = 'Action'
Prefetch contenttypes for better performances.
yprez_django-logentry-admin
train
py
441faf6c7ad36ff617a25031a460d78d84578dbb
diff --git a/tests/spec/input-spec.js b/tests/spec/input-spec.js index <HASH>..<HASH> 100644 --- a/tests/spec/input-spec.js +++ b/tests/spec/input-spec.js @@ -1,11 +1,17 @@ describe("me.input", function () { var renderable; + var evenType; beforeAll(function () { renderable = new me.Entity(0, 0, { "width" : 32, "height" : 32 }); + if (me.device.pointerEvent) { + evenType = "pointerdown"; + } else { + evenType ="mousedown" + } }); describe("Pointer Event", function () { @@ -34,7 +40,7 @@ describe("me.input", function () { }); // Create the event. - var event = new CustomEvent("mousedown"); + var event = new CustomEvent(evenType); // configure the event event.pointerId = 1;
[#<I>] generate custom event based on browser support
melonjs_melonJS
train
js
18d3b7b004682486afb1c777420c306fe9115ec8
diff --git a/lib/table_setter/table.rb b/lib/table_setter/table.rb index <HASH>..<HASH> 100644 --- a/lib/table_setter/table.rb +++ b/lib/table_setter/table.rb @@ -100,7 +100,7 @@ module TableSetter # A convienence method to return the sort array for table setter. def sort_array @data.sorted_by.inject([]) do |memo, (key, value)| - memo << [@data.columns.index(key), value == 'descending' ? 0 : 1] + memo << [@data.columns.index(key), value == 'descending' ? 1 : 0] end end
table sorting proper now, asc is asc and not the other way around
propublica_table-setter
train
rb
f1777cba6c2290701ff5ffb022338a984d3647d2
diff --git a/lib/conceptql/operators/occurrence.rb b/lib/conceptql/operators/occurrence.rb index <HASH>..<HASH> 100644 --- a/lib/conceptql/operators/occurrence.rb +++ b/lib/conceptql/operators/occurrence.rb @@ -62,7 +62,7 @@ occurrence, this operator returns nothing for that person def ordered_columns ordered_columns = [Sequel.send(asc_or_desc, :start_date)] - ordered_columns += [:criterion_type, :criterion_id] + ordered_columns += [:criterion_id] end end end
Occurrence: Impala was unhappy with criterion_type criterion_type is a string constant and apparently Impala doesn't want those used in the order by clause of a window function (for some reason) so I took it out
outcomesinsights_conceptql
train
rb
9c559501511f781060a8013794ea27e3432e99a5
diff --git a/bika/lims/browser/calcs.py b/bika/lims/browser/calcs.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/calcs.py +++ b/bika/lims/browser/calcs.py @@ -262,8 +262,8 @@ class ajaxCalculateAnalysisEntry(BrowserView): if analysis.portal_type == 'ReferenceAnalysis': # The analysis is a Control or Blank. We might use the # reference results instead other specs - uid = analysis.getServiceUID() - specs = analysis.aq_parent.getResultsRangeDict().get(uid, {}) + _uid = analysis.getServiceUID() + specs = analysis.aq_parent.getResultsRangeDict().get(_uid, {}) else: # Get the specs directly from the analysis. The getResultsRange
LIMS-<I> appears to be caused by 1a<I>
senaite_senaite.core
train
py
4bc89baa3414fe1802f641b128ccfecf67e65ee3
diff --git a/alphafilter/admin.py b/alphafilter/admin.py index <HASH>..<HASH> 100644 --- a/alphafilter/admin.py +++ b/alphafilter/admin.py @@ -2,7 +2,7 @@ from django.db.models import get_model from django.contrib import admin from django.conf import settings -MODEL_REGISTRY = getattr(settings, 'ALPHAFILTER_ADMIN_FIELDS', ()) +MODEL_REGISTRY = getattr(settings, 'ALPHAFILTER_ADMIN_FIELDS', {}) FIELDS = {} for key, val in MODEL_REGISTRY.items():
Fixed a bug where the default model registry was a tuple instead of a dict.
coordt_django-alphabetfilter
train
py
3445e6529aa252b6f15da83f78c7857d1a2014bf
diff --git a/ocrd_utils/setup.py b/ocrd_utils/setup.py index <HASH>..<HASH> 100644 --- a/ocrd_utils/setup.py +++ b/ocrd_utils/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name='ocrd_utils', - version='1.0.0a1', + version='1.0.0a2', description='OCR-D framework - shared code, helpers, constants', long_description=open('README.md').read(), long_description_content_type='text/markdown',
:package: <I>a2
OCR-D_core
train
py
98f91fab6dbf852034ba195e33e632dbfe2fa346
diff --git a/includes/session.php b/includes/session.php index <HASH>..<HASH> 100644 --- a/includes/session.php +++ b/includes/session.php @@ -115,7 +115,7 @@ define('WT_SCRIPT_NAME', basename(Filter::server('SCRIPT_NAME'))); set_error_handler(function ($errno, $errstr, $errfile, $errline) { // Ignore errors that are silenced with '@' if (error_reporting() & $errno) { - throw new ErrorException($errfile . ':' . $errline . ' ' . $errstr, $errno); + throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } });
Missing stack dump in error handler
fisharebest_webtrees
train
php
63c3ea935de1987d95d0fb36d1e59629be468b8b
diff --git a/Pragma/ORM/Model.php b/Pragma/ORM/Model.php index <HASH>..<HASH> 100644 --- a/Pragma/ORM/Model.php +++ b/Pragma/ORM/Model.php @@ -176,7 +176,7 @@ class Model extends QueryBuilder implements SerializableInterface{ if (empty(self::$table_desc[$this->table])) { foreach ($db->describe($this->table) as $data) { - if (empty($data['default']) && !$data['null']) { + if ($data['default'] === null && !$data['null']) { self::$table_desc[$this->table][$data['field']] = ''; } else { self::$table_desc[$this->table][$data['field']] = $data['default'];
Fix field with "empty" default values i.e: empty() would trigger for "0" string Convert only explicit NULL default values, on a non-null field to an empty string.
pragma-framework_core
train
php
6335ea2f524fcd18069b129fe3f2567f68753fce
diff --git a/src/aspectlib/__init__.py b/src/aspectlib/__init__.py index <HASH>..<HASH> 100644 --- a/src/aspectlib/__init__.py +++ b/src/aspectlib/__init__.py @@ -520,7 +520,9 @@ def weave_instance(instance, aspect, methods=NORMAL_METHODS, lazy=False, bag=Bro method_matches = make_method_matcher(methods) logdebug("weave_instance (module=%r, aspect=%s, methods=%s, lazy=%s, **options=%s)", instance, aspect, methods, lazy, options) - fixup = lambda func: func.__get__(instance, type(instance)) + + def fixup(func): + return func.__get__(instance, type(instance)) fixed_aspect = aspect + [fixup] if isinstance(aspect, (list, tuple)) else [aspect, fixup] for attr in dir(instance):
Don't use lambda here
ionelmc_python-aspectlib
train
py
4b8895c8b66ba4e73939d27836c2316b2fb1fd63
diff --git a/model/fieldtypes/ForeignKey.php b/model/fieldtypes/ForeignKey.php index <HASH>..<HASH> 100644 --- a/model/fieldtypes/ForeignKey.php +++ b/model/fieldtypes/ForeignKey.php @@ -37,8 +37,15 @@ class ForeignKey extends Int { $field = new UploadField($relationName, $title); } else { $titleField = (singleton($hasOneClass)->hasField('Title')) ? "Title" : "Name"; - $map = DataList::create($hasOneClass)->map("ID", $titleField); - $field = new DropdownField($this->name, $title, $map, null, null, ' '); + $list = DataList::create($hasOneClass); + // Don't scaffold a dropdown for large tables, as making the list concrete + // might exceed the available PHP memory in creating too many DataObject instances + if($list->count() < 100) { + $field = new DropdownField($this->name, $title, $list->map("ID", $titleField), null, null, ' '); + } else { + $field = new NumericField($this->name, $title); + } + } return $field;
BUGFIX Don't scaffold has_one relations into a DropdownField in ForeignKey->scaffoldFormField() if more than <I> records would be created, to avoid exceeding PHP memory (fixes #<I>)
silverstripe_silverstripe-framework
train
php
f1f7109f73663c05c7eb72f5050e2a6b6d29e5a7
diff --git a/spec/CheckReturnTypeTest.php b/spec/CheckReturnTypeTest.php index <HASH>..<HASH> 100644 --- a/spec/CheckReturnTypeTest.php +++ b/spec/CheckReturnTypeTest.php @@ -36,7 +36,7 @@ class CheckReturnTypeTest extends StaticTestSuite { $this->fail("Should have thrown an exception"); } catch (\ReflectionException $e) { $this->assert($e->getMessage(), '[' . CheckReturnTypeTest_FooClass::class . '::returnsString()] ' . - 'returned [DateTime] which does not match its return type'); + 'returned [DateTime] which does not match its return type [string]'); } $this->assert(Mockster::stub($this->foo->returnsString())->has()->beenCalled()); } diff --git a/src/Stub.php b/src/Stub.php index <HASH>..<HASH> 100644 --- a/src/Stub.php +++ b/src/Stub.php @@ -181,7 +181,7 @@ class Stub { if (!$type->is($returnValue)) { $returned = $this->toString($returnValue); throw new \ReflectionException("[{$this->class}::{$this->name}()] returned [$returned] " . - "which does not match its return type"); + "which does not match its return type [$type]"); } }
Print return Type if doesn't match
rtens_mockster
train
php,php
ea8eab864c96a56a6e6a408c3f1864dcd7d31d07
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index <HASH>..<HASH> 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + import os import pytest @@ -129,7 +131,7 @@ def test_prepare_metadata_for_build_wheel(build_backend): def test_prepare_metadata_for_build_wheel_with_unicode(build_backend): - dist_dir = os.path.abspath(u'pip-dist-info') + dist_dir = os.path.abspath('pip-dist-info') os.makedirs(dist_dir) dist_info = build_backend.prepare_metadata_for_build_wheel(dist_dir)
Use unicode literals throughout.
pypa_setuptools
train
py
676531427faf66504539e4e4dc5c38d89b5b2b46
diff --git a/lib/Utilities.js b/lib/Utilities.js index <HASH>..<HASH> 100644 --- a/lib/Utilities.js +++ b/lib/Utilities.js @@ -76,11 +76,10 @@ exports.checkConditions = function (conditions, one_associations) { // E) var association_fields = Object.keys(associations[k].field); var model = associations[k].model; - - + // F) for (i = 0; i < values.length; i++) { - if (values[i].isInstance && values[i].model() === model) { + if (values[i].isInstance && values[i].model().table == model.table) { if (association_fields.length == 1) { if (typeof conditions[association_fields[0]] == 'undefined') conditions[association_fields[0]] = values[i][model.id[0]];
Fix model equality test (#<I>)
dresende_node-orm2
train
js
0c1b82218677f951b21f35d415ba4b0f40ef2f20
diff --git a/pyt/vulnerability_log.py b/pyt/vulnerability_log.py index <HASH>..<HASH> 100644 --- a/pyt/vulnerability_log.py +++ b/pyt/vulnerability_log.py @@ -25,7 +25,7 @@ class VulnerabilityLog(object): print('%s vulnerabilities found:' % number_of_vulnerabilities) for i, vulnerability in enumerate(self.vulnerabilities, start=1): - print('Vulnerability {}:\n{}'.format(i, vulnerability)) + print('Vulnerability {}:\n{}\n'.format(i, vulnerability)) class Vulnerability(object):
more newlines in vuln presentation
python-security_pyt
train
py
91b7752f6b8465cf8c68c31b5a48e9ee990e7a93
diff --git a/shared/chat/inbox/row/selectors.js b/shared/chat/inbox/row/selectors.js index <HASH>..<HASH> 100644 --- a/shared/chat/inbox/row/selectors.js +++ b/shared/chat/inbox/row/selectors.js @@ -113,13 +113,14 @@ const snippetRowSelector = createCachedSelector( )(passConversationIDKey) const pendingSnippetRowSelector = createCachedSelector( - [getSelected, getPendingParticipants, getNowOverride, passConversationIDKey], - (selected, participants, nowOverride, conversationIDKey) => { + [getSelected, getPendingParticipants, getNowOverride, passConversationIDKey, getYou], + (selected, participants, nowOverride, conversationIDKey, you) => { const isSelected = selected === conversationIDKey const isMuted = false const isError = false const timestamp = formatTimeForConversationList(Date.now(), nowOverride) const d = _commonDerivedProps(null, null, 0, 0, isError, isSelected) + const participantsWithoutYou = Constants.participantFilter(participants, you) return { backgroundColor: d.backgroundColor, @@ -128,7 +129,7 @@ const pendingSnippetRowSelector = createCachedSelector( isMuted, isSelected, participantNeedToRekey: d.participantNeedToRekey, - participants, + participants: participantsWithoutYou, showBold: d.showBold, subColor: d.subColor, timestamp,
Modify pending conversation selector to filter out own user from participants
keybase_client
train
js
0ce84776dfed8bef6ac9991ccbac509199141f7d
diff --git a/tests/contracts/test_contract_estimateGas.py b/tests/contracts/test_contract_estimateGas.py index <HASH>..<HASH> 100644 --- a/tests/contracts/test_contract_estimateGas.py +++ b/tests/contracts/test_contract_estimateGas.py @@ -7,8 +7,7 @@ from web3.utils.abi import ( @pytest.fixture(autouse=True) def wait_for_first_block(web3, wait_for_block): - if not isinstance(web3.currentProvider, TestRPCProvider): - wait_for_block(web3) + wait_for_block(web3) @pytest.fixture()
fix wait_for_block for testrpc
ethereum_web3.py
train
py
f06f650c0271b46ceb6910a0e21b9774a01d4e39
diff --git a/spec/text2pngSpec.js b/spec/text2pngSpec.js index <HASH>..<HASH> 100644 --- a/spec/text2pngSpec.js +++ b/spec/text2pngSpec.js @@ -29,9 +29,9 @@ describe('text2png', () => { ignoreAntialiasing: true, antialiasingTolerance: 3 }, - (error, { equal }) => { + (error, match) => { if (error) reject(error); - expect(equal).toBe(true, 'generated image does not match'); + expect(match.equal).toBe(true, match); resolve(); } );
change to output diff when the test failed
tkrkt_text2png
train
js
142ddc2da26ca8571f3ebbd36225dd2c5ba46302
diff --git a/test/extended/builds/new_app.go b/test/extended/builds/new_app.go index <HASH>..<HASH> 100644 --- a/test/extended/builds/new_app.go +++ b/test/extended/builds/new_app.go @@ -45,7 +45,7 @@ var _ = g.Describe("[Feature:Builds][Conformance] oc new-app", func() { g.It("should succeed with a --name of 58 characters", func() { g.By("calling oc new-app") - err := oc.Run("new-app").Args("https://github.com/sclorg/nodejs-ex", "--name", a58).Execute() + err := oc.Run("new-app").Args("https://github.com/sclorg/nodejs-ex", "--name", a58, "--build-env=BUILD_LOGLEVEL=5").Execute() o.Expect(err).NotTo(o.HaveOccurred()) g.By("waiting for the build to complete")
Bug <I>: Increase logs on flaking build test Test flakes due to image pull auth errors. Temporarily increasing build log level to capture pull specs and pull auth.
openshift_origin
train
go
0cd4f4dfa6a50816607578ac52934607c5d14d2b
diff --git a/mautrix/util/async_db/upgrade.py b/mautrix/util/async_db/upgrade.py index <HASH>..<HASH> 100644 --- a/mautrix/util/async_db/upgrade.py +++ b/mautrix/util/async_db/upgrade.py @@ -109,8 +109,8 @@ class UpgradeTable: return async with db.acquire() as conn: - for new_version in range(version + 1, len(self.upgrades) + 1): - version_index = new_version - 1 + for version_index in range(version, len(self.upgrades)): + new_version = version_index + 1 upgrade = self.upgrades[version_index] desc = getattr(upgrade, "__mau_db_upgrade_description__", None) suffix = f": {desc}" if desc else ""
Make loop a bit more readable
tulir_mautrix-python
train
py
f011f34059fafbb709f9f320696f0c6fcb944a90
diff --git a/tests/test_main.py b/tests/test_main.py index <HASH>..<HASH> 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,6 +1,11 @@ +import mock +import sys + from validator.main import main -def test_main(): + [email protected](sys, 'stderr') +def test_main(stderr): """Test that `main()` initializes without errors.""" try: main()
Fix unintended output from test_main.py.
mozilla_amo-validator
train
py
43cbf67d2a87244c32285abaf55fa95f357ec1a6
diff --git a/webpack.config.js b/webpack.config.js index <HASH>..<HASH> 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,6 @@ module.exports = { devtool: 'source-map', entry: { - standalone: "./example/standalone.js", mapbox: "./example/mapbox.js", }, output: {
Remove standalone example from webpack config
CartoDB_carto-vl
train
js
8325005d25deeb9a176e33efc574d15fe65c0733
diff --git a/src/Label.js b/src/Label.js index <HASH>..<HASH> 100644 --- a/src/Label.js +++ b/src/Label.js @@ -7,7 +7,8 @@ L.Label = L.Class.extend({ clickable: false, noHide: false, offset: new L.Point(12, -15), // 6 (width of the label triangle) + 6 (padding) - opacity: 1 + opacity: 1, + zoomAnimation: true }, initialize: function (options, source) {
Add back in zoomAnimation option.
Leaflet_Leaflet.label
train
js
9711d83c670977969b6b4b314e8f66686d9e0e54
diff --git a/src/main/java/com/turn/ttorrent/tracker/MultiAnnounceRequestProcessor.java b/src/main/java/com/turn/ttorrent/tracker/MultiAnnounceRequestProcessor.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/turn/ttorrent/tracker/MultiAnnounceRequestProcessor.java +++ b/src/main/java/com/turn/ttorrent/tracker/MultiAnnounceRequestProcessor.java @@ -51,13 +51,18 @@ public class MultiAnnounceRequestProcessor { }); } if (responseMessages.isEmpty()) { - ByteBuffer res = ByteBuffer.allocate(0); + ByteBuffer res; + Status status; try { res = HTTPTrackerErrorMessage.craft("").getData(); + status = Status.BAD_REQUEST; } catch (TrackerMessage.MessageValidationException e) { logger.warn("Could not craft tracker error message!", e); + status = Status.INTERNAL_SERVER_ERROR; + res = ByteBuffer.allocate(0); + } - requestHandler.serveResponse(Status.BAD_REQUEST.getCode(), "", res); + requestHandler.serveResponse(status.getCode(), "", res); return; } final ByteArrayOutputStream out = new ByteArrayOutputStream();
removed useless allocation byte buffer. Changed response code if tracker can not create error message from "bad request" to "internal server error"
mpetazzoni_ttorrent
train
java
2a1312000a3a9069c0a477de9f989bfe8efeec34
diff --git a/ipython_helpers/notebook.py b/ipython_helpers/notebook.py index <HASH>..<HASH> 100644 --- a/ipython_helpers/notebook.py +++ b/ipython_helpers/notebook.py @@ -64,9 +64,9 @@ class Session(object): # Determine which port the notebook is running on. cre_address = re.compile(r'The IPython Notebook is running at: ' r'(?P<address>https?://.*?:' - r'(?P<port>\d+).*/)$') + r'(?P<port>\d+)[^\r]*/)\r?$') cre_notebook_dir = re.compile(r'Serving notebooks from local ' - r'directory:\s+(?P<notebook_dir>.*)$') + r'directory:\s+(?P<notebook_dir>[^\r]*)\r?$') match = None self.stderr_lines = []
Handle Windows line endings in regular expressions
cfobel_ipython-helpers
train
py
aebe0ae8d292708feb2851713830822f5a889278
diff --git a/core/src/main/java/com/github/jsonldjava/core/Context.java b/core/src/main/java/com/github/jsonldjava/core/Context.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/github/jsonldjava/core/Context.java +++ b/core/src/main/java/com/github/jsonldjava/core/Context.java @@ -745,6 +745,9 @@ public class Context extends LinkedHashMap<String, Object> { return iri; } + /** + * This method is only visible for testing. + */ public static String _iriCompactionStep5point4(String iri, Object value, String compactIRI, final String candidate, Map<String, Object> termDefinitions) {
Note that the method is only visible for testing
jsonld-java_jsonld-java
train
java
4282ff1c6bde3e73c57a5e7e7cbce7bac812a0be
diff --git a/presto-main/src/main/java/com/facebook/presto/block/BlockBuilderStatus.java b/presto-main/src/main/java/com/facebook/presto/block/BlockBuilderStatus.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/block/BlockBuilderStatus.java +++ b/presto-main/src/main/java/com/facebook/presto/block/BlockBuilderStatus.java @@ -13,8 +13,6 @@ */ package com.facebook.presto.block; -import com.google.common.base.Objects; - public class BlockBuilderStatus { public static final int DEFAULT_MAX_PAGE_SIZE_IN_BYTES = 1024 * 1024; @@ -71,10 +69,11 @@ public class BlockBuilderStatus @Override public String toString() { - return Objects.toStringHelper(this) - .add("maxSizeInBytes", maxPageSizeInBytes) - .add("full", full) - .add("currentSize", currentSize) - .toString(); + StringBuffer buffer = new StringBuffer("BlockBuilderStatus{"); + buffer.append("maxSizeInBytes=").append(maxPageSizeInBytes); + buffer.append(", full=").append(full); + buffer.append(", currentSize=").append(currentSize); + buffer.append('}'); + return buffer.toString(); } }
Remove use of Guava in Block api
prestodb_presto
train
java
f7f588d19ee94e535eb97fa03ad572f81c319c3b
diff --git a/scuba/__main__.py b/scuba/__main__.py index <HASH>..<HASH> 100755 --- a/scuba/__main__.py +++ b/scuba/__main__.py @@ -210,7 +210,13 @@ def main(argv=None): sys.exit(42) try: - rc = subprocess.call(run_args) + # Explicitly pass sys.stdout/stderr so they apply to the + # child process if overridden (by tests). + rc = subprocess.call( + args = run_args, + stdout = sys.stdout, + stderr = sys.stderr, + ) except OSError as e: if e.errno == errno.ENOENT: appmsg('Failed to execute docker. Is it installed?')
Explicitly pass sys.stdout/stderr subprocess.call() This allows the tests to easily capture the Docker stdout/stderr, by simply overriding sys.stdout/stderr, and has no impact on normal execution.
JonathonReinhart_scuba
train
py
c7da1d82c852216d8197bdbc8fe0c3adb049a006
diff --git a/src/Router/MatchingResult.php b/src/Router/MatchingResult.php index <HASH>..<HASH> 100644 --- a/src/Router/MatchingResult.php +++ b/src/Router/MatchingResult.php @@ -10,6 +10,8 @@ namespace Brain\Cortex\Router; +use Brain\Cortex\Controller\ControllerInterface; + /** * @author Giuseppe Mazzapica <[email protected]> * @license http://opensource.org/licenses/MIT MIT @@ -41,7 +43,9 @@ class MatchingResult $data = array_merge($defaults, array_change_key_case($data, CASE_LOWER)); is_array($data['vars']) or $data['vars'] = []; $data['matched'] = (bool) filter_var($data['matched'], FILTER_VALIDATE_BOOLEAN); - is_callable($data['handler']) or $data['handler'] = null; + if (!is_callable($data['handler']) && ! $data['handler'] instanceof ControllerInterface) { + $data['handler'] = null; + } is_callable($data['before']) or $data['before'] = null; is_callable($data['after']) or $data['after'] = null; is_string($data['template']) or $data['template'] = null;
Ensure that handler can be also a controller
Brain-WP_Cortex
train
php
89d87a2d753545f640d7ac3ea94e0f0a3bdcfae9
diff --git a/quilt/data.py b/quilt/data.py index <HASH>..<HASH> 100644 --- a/quilt/data.py +++ b/quilt/data.py @@ -50,7 +50,7 @@ class PackageNode(object): def __repr__(self): finfo = self._package.get_path()[:-len(PackageStore.PACKAGE_FILE_EXT)] pinfo = self._prefix - kinfo = '\n'.join(self._keys()) if hasattr(self, '_keys') else '' + kinfo = '\n'.join(self._keys()) if isinstance(self, GroupNode) else '' return "<%s %r:%r>\n%s" % (self.__class__.__name__, finfo, pinfo, kinfo)
isnstance instead of hasattr
quiltdata_quilt
train
py
5afa8db5192bebe9be40efe75ac25994a67795de
diff --git a/ctfile/ctfile.py b/ctfile/ctfile.py index <HASH>..<HASH> 100644 --- a/ctfile/ctfile.py +++ b/ctfile/ctfile.py @@ -1062,9 +1062,6 @@ class Atom(object): """Representation of atom ``Ctab`` data.""" return str(self._ctab_data) - def __bool__(self): - """""" - class Bond(object): """Bond that connects two atoms within ``Ctab`` block."""
Remove bool from "Atom".
MoseleyBioinformaticsLab_ctfile
train
py
a27b5e2adc27c3ac5d30e2cc3f3d29f3ffa28456
diff --git a/restcomm/restcomm.rvd/src/main/webapp/js/controllers/designer.js b/restcomm/restcomm.rvd/src/main/webapp/js/controllers/designer.js index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.rvd/src/main/webapp/js/controllers/designer.js +++ b/restcomm/restcomm.rvd/src/main/webapp/js/controllers/designer.js @@ -341,7 +341,7 @@ var designerCtrl = App.controller('designerCtrl', function($scope, $q, $routePar $scope.getUssdNodeLang = function (node) { var lang = "en"; - for ( var i=0; i>node.steps.length; i++ ) { + for ( var i=0; i<node.steps.length; i++ ) { var step = node.steps[i]; if ( step.kind == "ussdLanguage") if (step.language != null && step.language != 'en') {
Fixed character counter for ussd RVD ussd applications. Fixes #<I>.
RestComm_Restcomm-Connect
train
js
acb95ba60abbc0b06b688950f8c1a384fc0b250f
diff --git a/src/SEOTools/OpenGraph.php b/src/SEOTools/OpenGraph.php index <HASH>..<HASH> 100644 --- a/src/SEOTools/OpenGraph.php +++ b/src/SEOTools/OpenGraph.php @@ -716,6 +716,7 @@ class OpenGraph implements OpenGraphContract 'type', 'width', 'height', + 'alt', ]; if (is_array($source)) {
add/image alternative Text to Open Graph Data - add the meta property "og:image:alt" to the Open Graph Class - will generate something like this: `<meta property="og:image:alt" content="alternative image Text">`
artesaos_seotools
train
php
ecc887dce3b7c84fba998afeee1168dfed5cf379
diff --git a/src/colab_gitlab/views.py b/src/colab_gitlab/views.py index <HASH>..<HASH> 100644 --- a/src/colab_gitlab/views.py +++ b/src/colab_gitlab/views.py @@ -5,3 +5,6 @@ from colab.plugins.views import ColabProxyView class GitlabProxyView(ColabProxyView): app_label = 'colab_gitlab' diazo_theme_template = 'proxy/gitlab.html' + rewrite = ( + (r'^/[^/]+/profile/password/edit/?$', 'password_change'), + )
Block users from updating their gitlab passwords manually
colab_colab-gitlab-plugin
train
py