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
e3deb40f69d413c36d06b45d6b10c1ea3faf935a
diff --git a/system/src/Grav/Common/GPM/GPM.php b/system/src/Grav/Common/GPM/GPM.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/GPM/GPM.php +++ b/system/src/Grav/Common/GPM/GPM.php @@ -323,13 +323,20 @@ class GPM extends Iterator return $found; } - foreach ($this->getRepositoryThemes() as $slug => $theme) { + $themes = $this->getRepositoryThemes(); + $plugins = $this->getRepositoryPlugins(); + + if (!$themes && !$plugins) { + throw new \RuntimeException("GPM not reachable. Please check your internet connection or check the Grav site is reachable"); + } + + if ($themes) foreach ($themes as $slug => $theme) { if ($search == $slug || $search == $theme->name) { return $theme; } } - foreach ($this->getRepositoryPlugins() as $slug => $plugin) { + if ($plugins) foreach ($plugins as $slug => $plugin) { if ($search == $slug || $search == $plugin->name) { return $plugin; }
Improve error when trying to install a plugin/theme from the command line and GPM is unreachable Previously it listed four times `PHP Warning: Invalid argument supplied for foreach()...`, now it fails with an error message
getgrav_grav
train
php
d35b716da71722583006f82b647df4f5250b2dd1
diff --git a/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java b/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java +++ b/core/src/main/java/com/orientechnologies/orient/core/config/OGlobalConfiguration.java @@ -158,7 +158,7 @@ public enum OGlobalConfiguration { // NETWORK NETWORK_SOCKET_BUFFER_SIZE("network.socketBufferSize", "TCP/IP Socket buffer size", Integer.class, 32768), - NETWORK_LOCK_TIMEOUT("network.lockTimeout", "Timeout in ms to acquire a lock against a channel", Integer.class, 10000), + NETWORK_LOCK_TIMEOUT("network.lockTimeout", "Timeout in ms to acquire a lock against a channel", Integer.class, 15000), NETWORK_SOCKET_TIMEOUT("network.socketTimeout", "TCP/IP Socket timeout in ms", Integer.class, 10000),
Setted timeout on lock at <I>secs
orientechnologies_orientdb
train
java
fcca59a6bdc9ce8420121aef0ec770a51a04f55d
diff --git a/lib/crawl.rb b/lib/crawl.rb index <HASH>..<HASH> 100644 --- a/lib/crawl.rb +++ b/lib/crawl.rb @@ -90,10 +90,10 @@ module CobwebModule if within_queue_limits? document_links = ContentLinkParser.new(@options[:url], content.body, @options).all_links(:valid_schemes => [:http, :https]) #get rid of duplicate links in the same page. - document_link.uniq! + document_links.uniq! # select the link if its internal - internal_links = document_links.select! { |link| @cobweb_links.internal?(link) } + internal_links = document_links.select{ |link| @cobweb_links.internal?(link) } # reject the link if we've crawled it or queued it internal_links.reject! { |link| @redis.sismember("crawled", link) }
fixed typo on document links and changed select! to select as it should not be descructive
stewartmckee_cobweb
train
rb
ac1ca709408ab8b6553b1219375a5a9010f97c93
diff --git a/lib/Doctrine/MongoDB/EagerCursor.php b/lib/Doctrine/MongoDB/EagerCursor.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/MongoDB/EagerCursor.php +++ b/lib/Doctrine/MongoDB/EagerCursor.php @@ -154,11 +154,10 @@ class EagerCursor implements Iterator */ public function getSingleResult() { - $this->initialize(); - reset($this->data); + $this->rewind(); - if (key($this->data) !== null) { - return current($this->data); + if ($this->valid()) { + return $this->current(); } return null;
Use current() in EagerCursor::getSingleResult() Older ODM versions depend on this behavior, as getSingleResult() is not extended with hydration logic (like current() is).
doctrine_mongodb
train
php
b855f174f54e3db18461f4acb0a083344e961b57
diff --git a/extension/genepattern/static/resources/navigation.js b/extension/genepattern/static/resources/navigation.js index <HASH>..<HASH> 100644 --- a/extension/genepattern/static/resources/navigation.js +++ b/extension/genepattern/static/resources/navigation.js @@ -856,10 +856,15 @@ GenePattern.notebook.buildMenu = function(widget, element, name, href, kind, ind var cellIndex = pairing[0]; var taskWidget = pairing[1]; var task = GenePattern.task(taskWidget.options.lsid); + var name = task !== null ? task.name() : null; + + // If task is null, extract the task name from the widget + if (task === null) name = $(taskWidget.element).find(".gp-widget-task-name").text().trim(); + sendToExistingTask .append( $("<option></option>") - .text(task.name() + " [Cell " + cellIndex + "]") + .text(name + " [Cell " + cellIndex + "]") .data("widget", taskWidget) ); });
GP-<I> - Fix for "send to existing cell" when the cell contains an older version of a module
genepattern_genepattern-notebook
train
js
f37b0d463f1b4cc0cf5843eb97dce21afc684ca1
diff --git a/examples/python-guide/plot_example.py b/examples/python-guide/plot_example.py index <HASH>..<HASH> 100644 --- a/examples/python-guide/plot_example.py +++ b/examples/python-guide/plot_example.py @@ -37,7 +37,7 @@ gbm = lgb.train(params, lgb_train, num_boost_round=100, valid_sets=[lgb_train, lgb_test], - feature_name=['f' + str(i + 1) for i in range(X_train.shape[-1])], + feature_name=[f'f{i + 1}' for i in range(X_train.shape[-1])], categorical_feature=[21], evals_result=evals_result, verbose_eval=10)
[python-package] f-string format updated in plot_example.py (#<I>) * f-string format updated. * space removed * Update examples/python-guide/plot_example.py according to suggestion.
Microsoft_LightGBM
train
py
c85c653e57a702c90ca6527f05e295249ac9c99a
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java @@ -66,7 +66,7 @@ public class ConfigurationPropertiesScanTests { load(TestConfiguration.class); assertThat(this.context.containsBean( "profile-org.springframework.boot.context.properties.scan.valid.a.AScanConfiguration$MyProfileProperties")) - .isFalse(); + .isFalse(); } @Test @@ -87,7 +87,7 @@ public class ConfigurationPropertiesScanTests { load(TestConfiguration.class); assertThat(this.context.containsBean( "resource-org.springframework.boot.context.properties.scan.valid.a.AScanConfiguration$MyResourceProperties")) - .isFalse(); + .isFalse(); } private void load(Class<?>... classes) {
Polish "Add negative tests to ConfigurationPropertiesScanTests" Closes gh-<I>
spring-projects_spring-boot
train
java
b821364b8dbcddf7bfb7cfe2ec61e6b69506e388
diff --git a/lib/snapshot/runner.rb b/lib/snapshot/runner.rb index <HASH>..<HASH> 100644 --- a/lib/snapshot/runner.rb +++ b/lib/snapshot/runner.rb @@ -46,7 +46,7 @@ module Snapshot def config_launch_arguments launch_arguments = Array(Snapshot.config[:launchArguments]) - if (launch_arguments.count == 1) + if launch_arguments.count == 1 [launch_arguments] else launch_arguments.map.with_index { |e, i| [i, e] }
fix rubocop violation: parens in if statement
fastlane_fastlane
train
rb
898da614ce5ee16795f189ab07353b05843fd428
diff --git a/js/product.js b/js/product.js index <HASH>..<HASH> 100644 --- a/js/product.js +++ b/js/product.js @@ -404,11 +404,11 @@ Aimeos.Product.Catalog = { this.items[idx]['css'] = ''; - if(ids.indexOf(this.items[idx]['catalog.id']) !== -1) { + if(ids.indexOf(this.items[idx]['product.lists.siteid'] + '-' + this.items[idx]['catalog.id']) !== -1) { this.items[idx]['css'] = 'is-invalid'; } - ids.push(this.items[idx]['catalog.id']); + ids.push(this.items[idx]['product.lists.siteid'] + '-' + this.items[idx]['catalog.id']); } } }
Allow assigning same category for different sites
aimeos_ai-admin-jqadm
train
js
af414a883d41cf8dcaa3196ca3716d2d62ff336a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,5 +9,7 @@ extensions = [Extension("cyphi/*", ["cyphi/*.pyx"], setup( name="cyphi", + version="0.0.0", + description="A Cython library for computing integrated information", ext_modules=cythonize(extensions) )
Add version and description to setup.py
wmayner_pyphi
train
py
f6561647c2680c737e16faf28faa0e0efa8103d1
diff --git a/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java b/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java index <HASH>..<HASH> 100644 --- a/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java +++ b/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java @@ -67,20 +67,21 @@ public class EventBusTest extends AbstractTest * Tests the remove operation and verifies that the observer is no longer * registered for events. */ - @Test(groups = "observerMethod") + @Test(groups = {"observerMethod", "broken"}) public void testRemoveObserver() { EventBus eventBus = new EventBus(manager); Observer<DangerCall> observer = new AnObserver<DangerCall>(); eventBus.addObserver(observer, DangerCall.class); eventBus.removeObserver(observer, DangerCall.class); + // FIXME CopyOnWrite broke remove, have to check later assert eventBus.getObservers(new DangerCall()).isEmpty(); } /** * Tests the deferred event feature associated with transactions. */ - @Test(groups = "deferredEvent") + @Test(groups = {"deferredEvent", "broken"}) public void testDeferEvent() { // Setup a transaction manager for this test and inject into the event bus
CopyOnWriteArrayList broke remove operation, have to check... git-svn-id: <URL>
weld_core
train
java
6860d09c722b3afc3b5b5de124e3fc80f4e5e42c
diff --git a/src/shared/transitions.js b/src/shared/transitions.js index <HASH>..<HASH> 100644 --- a/src/shared/transitions.js +++ b/src/shared/transitions.js @@ -199,7 +199,7 @@ export var transitionManager = { node.style.animation = node.style.animation .split(', ') .filter(function(anim) { - return !/__svelte/.test(anim); + return anim.indexOf(name) === -1; }) .join(', '); }
only delete applicable transition animations - fixes #<I>
sveltejs_svelte
train
js
1add17ea6c2d00a12c60e3bc5d617b0a792f81ec
diff --git a/src/AsynchronousJobs/Job.php b/src/AsynchronousJobs/Job.php index <HASH>..<HASH> 100644 --- a/src/AsynchronousJobs/Job.php +++ b/src/AsynchronousJobs/Job.php @@ -54,7 +54,9 @@ abstract class Job { $data = array(); foreach (get_object_vars($this) as $key => $value) { - $data[$key] = $value; + if (strpos($key, '__') !== 0) { + $data[$key] = $value; + } } return $data;
Variables of class with double "_" are now ignored during data transfer between job instance and main instance.
oliverde8_PHP-AsynchronousJobs
train
php
85e2b211cc1661829ec661db840f6e19ff4080c6
diff --git a/src/Models/User.php b/src/Models/User.php index <HASH>..<HASH> 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -1013,7 +1013,7 @@ class User extends Entry implements Authenticatable } /** - * Change the password of the current user. This must be performed over SSL. + * Change the password of the current user. This must be performed over SSL / TLS. * * Throws an exception on failure. *
Updated docblock for TLS
Adldap2_Adldap2
train
php
e203295a654bd1cd08859e7a75299c86e21daa3c
diff --git a/lib/svm_helper/selectors/forman.rb b/lib/svm_helper/selectors/forman.rb index <HASH>..<HASH> 100644 --- a/lib/svm_helper/selectors/forman.rb +++ b/lib/svm_helper/selectors/forman.rb @@ -41,7 +41,8 @@ module Selector features = all_words.reduce(Hash.new { |h, k| h[k] = [0,0] }) do |accumulator, bag| label = bag.label ? 1 : 0 label_counts[label] += 1 - bag.features.each do |word| + # only count a feature once per bag + bag.features.uniq.each do |word| unless accumulator.has_key?(word) accumulator[word] = [0,0] end @@ -140,4 +141,4 @@ module Selector x end end -end \ No newline at end of file +end
only count a feature once per bag
andreaseger_svm_helper
train
rb
c3bbc5d0b26a082fb2c4326119df4b52b4279c89
diff --git a/src/plugins/poster/poster.js b/src/plugins/poster/poster.js index <HASH>..<HASH> 100644 --- a/src/plugins/poster/poster.js +++ b/src/plugins/poster/poster.js @@ -91,8 +91,10 @@ class PosterPlugin extends UIContainerPlugin { } clicked() { - this.container.play() - this.hidePlayButton() + if (!this.options.chromeless) { + this.container.play() + this.hidePlayButton() + } return false } @@ -119,6 +121,10 @@ class PosterPlugin extends UIContainerPlugin { this.$playButton = this.$el.find('.poster-icon') this.$playWrapper = this.$el.find('.play-wrapper') process.nextTick(() => this.updateSize()) + if (this.options.chromeless) { + this.hidePlayButton() + this.$el.css({'cursor': 'initial'}) + } return this } }
poster: avoid clicks on chromeless mode (close #<I>)
clappr_clappr
train
js
cd20618458f9ded80f74da81a8b8b4c1e16aa48c
diff --git a/core/commands/repo.go b/core/commands/repo.go index <HASH>..<HASH> 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -102,9 +102,9 @@ var repoStatCmd = &cmds.Command{ ShortDescription: ` 'ipfs repo stat' is a plumbing command that will scan the local set of stored objects and print repo statistics. It outputs to stdout: -NumObjects int number of objects in the local repo -RepoSize int size in bytes that the repo is currently taking -RepoPath string the path to the repo being currently used +NumObjects int Number of objects in the local repo. +RepoPath string The path to the repo being currently used. +RepoSize int Size in bytes that the repo is currently taking. `, }, Run: func(req cmds.Request, res cmds.Response) {
Small syntax changes to repo stat man License: MIT
ipfs_go-ipfs
train
go
ef5d2130c75d73148608ffece13c93e51e886647
diff --git a/djoauth2/models.py b/djoauth2/models.py index <HASH>..<HASH> 100644 --- a/djoauth2/models.py +++ b/djoauth2/models.py @@ -18,11 +18,7 @@ class Client(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=256) description = models.TextField(null=True, blank=True) - # From http://tools.ietf.org/html/rfc6749#section-3.1.2.2 : - # - # The authorization server SHOULD require all clients to register their - # redirection endpoint prior to utilizing the authorization endpoint. - # + image_url = models.URLField(null=True, blank=True) redirect_uri = models.URLField(null=False, blank=False) key = models.CharField( db_index=True,
Add a field to hold a URL for a Client's logo or other image.
peterldowns_djoauth2
train
py
05c0cd79149fc3463ac31e95cfffc8202970ab0e
diff --git a/brozzler/js-templates/facebook.js b/brozzler/js-templates/facebook.js index <HASH>..<HASH> 100644 --- a/brozzler/js-templates/facebook.js +++ b/brozzler/js-templates/facebook.js @@ -35,7 +35,7 @@ var umbraAboveBelowOrOnScreen = function(e) { } // comments - 'a.UFIPagerLink > span, a.UFIPagerLink, span.UFIReplySocialSentenceLinkText' -var UMBRA_THINGS_TO_CLICK_SELECTOR = 'a.uiMorePagerPrimary, a[href^="/browse/likes"], *[rel="theater"]'; +var UMBRA_THINGS_TO_CLICK_SELECTOR = 'a[href^="/browse/likes"], *[rel="theater"]'; //div[class="phm pluginLikeboxStream"] = facebook widget embedded in 3rd party pages var UMBRA_THINGS_TO_SCROLL_SELECTOR = 'div[class="phm pluginLikeboxStream"]'; var NUMBER_FAILED_SCROLL_ATTEMPTS_ON_THING_TO_SCROLL_BEFORE_STOP_SCROLLING = 5;
skip a.uiMorePagerPrimary after all
internetarchive_brozzler
train
js
0e4e12b541a8759ba9e77b4073bc057fadc524bd
diff --git a/Kwf/Form/Field/SuperBoxSelect.php b/Kwf/Form/Field/SuperBoxSelect.php index <HASH>..<HASH> 100644 --- a/Kwf/Form/Field/SuperBoxSelect.php +++ b/Kwf/Form/Field/SuperBoxSelect.php @@ -33,6 +33,7 @@ class Kwf_Form_Field_SuperBoxSelect extends Kwf_Form_Field_ComboBox private function _getIdsFromPostData($postData) { + if (!$postData[$this->getFieldName()]) return array(); return explode(',', $postData[$this->getFieldName()]); }
fix saving of SuperBoxSelect without selected entries
koala-framework_koala-framework
train
php
8c6e34bbcca55f0ab84665b45ab41f9fcce494cc
diff --git a/monitor/services/src/main/java/org/datacleaner/monitor/server/media/FileUploadServlet.java b/monitor/services/src/main/java/org/datacleaner/monitor/server/media/FileUploadServlet.java index <HASH>..<HASH> 100644 --- a/monitor/services/src/main/java/org/datacleaner/monitor/server/media/FileUploadServlet.java +++ b/monitor/services/src/main/java/org/datacleaner/monitor/server/media/FileUploadServlet.java @@ -119,8 +119,12 @@ public class FileUploadServlet extends HttpServlet { File tempFolder = FileHelper.getTempDir(); try { final File subDirectory = new File(tempFolder, ".datacleaner_upload"); - if (subDirectory.mkdirs()) { + subDirectory.mkdirs(); + + if (subDirectory.exists()) { tempFolder = subDirectory; + } else { + logger.warn("Subdirectory '{}' was not created. ", subDirectory.getAbsolutePath()); } } catch (final Exception e) { logger.warn("Could not create subdirectory in temp folder", e);
#<I> Monitor's directory for temporary uploaded files was not used when it already existed.
datacleaner_DataCleaner
train
java
1cfa35982900a91f876587eaf40e0b5d4a6de867
diff --git a/src/frontend/org/voltdb/export/ExportDataSource.java b/src/frontend/org/voltdb/export/ExportDataSource.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/export/ExportDataSource.java +++ b/src/frontend/org/voltdb/export/ExportDataSource.java @@ -728,7 +728,9 @@ public class ExportDataSource implements Comparable<ExportDataSource> { if (m_runEveryWhere) { exportingRole = "XDCR"; } else { - exportingRole = (m_coordinator.isMaster() ? "TRUE" : "FALSE"); + // Note that we are 'ACTIVE' == 'TRUE' only if we are export master AND we have + // an export client configured + exportingRole = (m_coordinator.isMaster() && m_client != null ? "TRUE" : "FALSE"); } return new ExportStatsRow(m_partitionId, m_siteId, m_tableName, m_exportTargetName, exportingRole, m_tupleCount, m_tuplesPending.get(),
ENG-<I>: do not report being ACTIVE if there is no client configured (#<I>)
VoltDB_voltdb
train
java
4a34dd9829e0d4ccaa138771024093e9c592eb60
diff --git a/lib/bbcloud/config.rb b/lib/bbcloud/config.rb index <HASH>..<HASH> 100644 --- a/lib/bbcloud/config.rb +++ b/lib/bbcloud/config.rb @@ -96,7 +96,7 @@ class BBConfig end def to_fog - raise Ini::Error, "No api client configured" if clients.empty? + raise Ini::Error, "No api client configured" unless configured? c = config[client_name] %w{api_url client_id secret}.each do |k| if c[k].to_s.empty? @@ -129,7 +129,7 @@ class BBConfig def finish begin - if @oauth_token != Api.conn.oauth_token + if configured? and @oauth_token != Api.conn.oauth_token File.open(oauth_token_filename + ".#{$$}", "w") do |f| f.write Api.conn.oauth_token end @@ -141,4 +141,8 @@ class BBConfig end + def configured? + client_name != nil and !clients.empty? + end + end
Fix ugly error when no command is called with no config. Closes #<I>
brightbox_brightbox-cli
train
rb
ef350c9f2e35fc7e16c74158686c9ad2805cb465
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -100,6 +100,14 @@ module ActiveRecord # firing an additional query. This will often result in a # performance improvement over a simple +join+. # + # You can also specify multiple relationships, like this: + # + # users = User.includes(:address, :friends) + # + # Loading nested relationships is possible using a Hash: + # + # users = User.includes(:address, friends: [:address, :followers]) + # # === conditions # # If you want to add conditions to your included models you'll have
Improve ActiveRecord::QueryMethods#includes docs It's not immediately clear whether you can pass in multiple relations or not. After going through the code a bit, I saw that the arguments are just appended to an array. Also, added nested relations example. [ci skip]
rails_rails
train
rb
b7a548458513f61a63e7f82c03fe018702cbdb82
diff --git a/lib/show-invisibles.js b/lib/show-invisibles.js index <HASH>..<HASH> 100644 --- a/lib/show-invisibles.js +++ b/lib/show-invisibles.js @@ -45,6 +45,8 @@ peek = stream.peek() === ' '; } + + ret = 'cm-eol'; } return ret; @@ -70,7 +72,7 @@ rules += rule; } - style.textContent = getStyle() + '\n' + rules; + style.textContent = getStyle() + '\n' + getEOL() + '\n' + rules; document.head.appendChild(style); } @@ -86,4 +88,18 @@ return style; } + + function getEOL() { + var style = [ + '.CodeMirror-code > div > pre > span::after {', + 'position: absolute;', + 'pointer-events: none;', + 'color: #404F7D;', + 'content: "¬"', + '}', + + ].join(''); + + return style; + } });
feature(show-invisibles) show new lines
coderaiser_cm-show-invisibles
train
js
50ad6d8ab6a1fff5fa50cbc283b1fd9deeefe9ac
diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/base.py +++ b/openquake/calculators/base.py @@ -472,7 +472,6 @@ class HazardCalculator(BaseCalculator): self.exposure = readinput.get_exposure(self.oqparam) arefs = numpy.array(self.exposure.asset_refs, hdf5.vstr) self.datastore['asset_refs'] = arefs - self.datastore.flush() self.datastore.set_attrs('asset_refs', nbytes=arefs.nbytes) self.cost_calculator = readinput.get_cost_calculator(self.oqparam) self.sitecol, self.assets_by_site = (
Removed a flush [skip CI] Former-commit-id: cd<I>d<I>b<I>d8fe8ff<I>f<I>f<I>da<I>fe1ced
gem_oq-engine
train
py
f06a83a8a79e0507ae58e7f8c5af8888e1d92da8
diff --git a/lark/load_grammar.py b/lark/load_grammar.py index <HASH>..<HASH> 100644 --- a/lark/load_grammar.py +++ b/lark/load_grammar.py @@ -351,7 +351,10 @@ def _fix_escaping(s): for n in i: w += n if n == '\\': - n2 = next(i) + try: + n2 = next(i) + except StopIteration: + raise ValueError("Literal ended unexpectedly (bad escaping): `%r`" % s) if n2 == '\\': w += '\\\\' elif n2 not in 'uxnftr':
Better error for literal with bad escaping (Issue #<I>)
lark-parser_lark
train
py
d999c17f2c6130c5d5a2a69ecc5dd8feaa3a2c6d
diff --git a/lib/apiture/request_context.rb b/lib/apiture/request_context.rb index <HASH>..<HASH> 100644 --- a/lib/apiture/request_context.rb +++ b/lib/apiture/request_context.rb @@ -86,7 +86,7 @@ module Apiture content_types.each do |type| content_type_mappings.each do |(parser, type_match)| if type.match(type_match) - conn.response(parser, content_type: type_match) + conn.response(parser, content_type: type_match, preserve_raw: true) end end end
Preserve unparsed response body
cyu_apiture
train
rb
dae2dab4e4e86938d056b2c38f0d7b68eeb99b7d
diff --git a/source/js/date/VCO.DateUtil.js b/source/js/date/VCO.DateUtil.js index <HASH>..<HASH> 100644 --- a/source/js/date/VCO.DateUtil.js +++ b/source/js/date/VCO.DateUtil.js @@ -10,8 +10,8 @@ VCO.DateUtil = { sortByDate: function(array) { // only for use with slide data objects array.sort(function(a,b){ - if (a.date.data.date_obj < b.date.data.date_obj) return -1; - if (a.date.data.date_obj > b.date.data.date_obj) return 1; + if (a.date.isBefore(b.date)) return -1; + if (a.date.isAfter(b.date)) return 1; return 0; }); },
refactor sortByDate to use date comparison (will help with #2)
NUKnightLab_TimelineJS3
train
js
676473a6d4cdb698555ae880cab215f1e27a0642
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ satdoc = dedent(sgp4.model.Satellite.__doc__.split('\n', 1)[1]) long_description = long_description.replace('entry.', 'entry.' + satdoc) setup(name = 'sgp4', - version = '1.3', + version = '1.4', description = description, long_description = long_description, license = 'MIT', diff --git a/sgp4/__init__.py b/sgp4/__init__.py index <HASH>..<HASH> 100644 --- a/sgp4/__init__.py +++ b/sgp4/__init__.py @@ -97,6 +97,7 @@ was the most recently updated SGP4 implementation in their zip file: Changelog --------- +| 2015-01-15 — 1.4 — Display detailed help when TLE input does not match format. | 2014-06-26 — 1.3 — Return ``(NaN,NaN,NaN)`` vectors on error and set ``.error_message`` | 2013-11-29 — 1.2 — Made ``epochyr`` 4 digits; add ``datetime`` for ``.epoch`` | 2012-11-22 — 1.1 — Python 3 compatibility; more documentation
Describe improved parser in changelog; declare <I>
brandon-rhodes_python-sgp4
train
py,py
262bd8108f70d202da84df01d649d668eb23bdf1
diff --git a/lib/keepassx/database/dumper.rb b/lib/keepassx/database/dumper.rb index <HASH>..<HASH> 100644 --- a/lib/keepassx/database/dumper.rb +++ b/lib/keepassx/database/dumper.rb @@ -34,7 +34,9 @@ module Keepassx raise ArgumentError, 'File path is not set' if new_path.nil? raise ArgumentError, 'Password is not set' if new_password.nil? - File.write new_path, dump(new_password) + File.open(new_path, 'wb') do |file| + file.write dump(new_password) + end end
Be sure to use binary mode when writing DB file
pitluga_keepassx
train
rb
9c35c340cf9be4a1b0c381868eaa89a31715ef98
diff --git a/mimes.php b/mimes.php index <HASH>..<HASH> 100644 --- a/mimes.php +++ b/mimes.php @@ -618,6 +618,7 @@ return [ "pfm" => "application/x-font-type1", "afm" => "application/x-font-type1", "woff" => "application/font-woff", + "woff2" => "application/font-woff2", "arc" => "application/x-freearc", "spl" => "application/x-futuresplash", "gca" => "application/x-gca-compressed",
Add woff2 missing mime type
laravel_valet
train
php
0302c18e72ffc19a030aca72dd797b6572aaf683
diff --git a/lib/google_distance_matrix/client_cache.rb b/lib/google_distance_matrix/client_cache.rb index <HASH>..<HASH> 100644 --- a/lib/google_distance_matrix/client_cache.rb +++ b/lib/google_distance_matrix/client_cache.rb @@ -2,13 +2,17 @@ module GoogleDistanceMatrix class ClientCache attr_reader :client, :cache + def self.key(url) + url + end + def initialize(client, cache) @client = client @cache = cache end def get(url, options = {}) - cache.fetch url do + cache.fetch self.class.key(url) do client.get url, options end end
ClientCache.key. Centralise knowledge on how to generate key.
Skalar_google_distance_matrix
train
rb
a1840fd247ad70da9552decc85c2bb9679224404
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ setup(name='switchboard', 'pylibmc >= 1.2', 'decorator', ], + zip_safe=False, tests_require=[ 'nose >= 0.11', 'mock >= 1.0',
[#2] I wonder if this might cause the slowdown?
switchboardpy_switchboard
train
py
0ef5dd7bce38a7fa47a9ea1351e4e1eb238f9a60
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -107,10 +107,16 @@ func Run(address string, port int) { MainRouter = NewRouter(routePath) MainTemplateLoader = NewTemplateLoader(ViewsPath, RevelTemplatePath) + // If DEV mode, create a watcher for templates and routes. + // The watcher calls Refresh() on things on the first request. if RunMode == DEV { MainWatcher = NewWatcher() MainWatcher.Listen(MainTemplateLoader, ViewsPath, RevelTemplatePath) MainWatcher.Listen(MainRouter, routePath) + } else { + // Else, call refresh on them directly. + MainTemplateLoader.Refresh() + MainRouter.Refresh() } server := &http.Server{ diff --git a/template.go b/template.go index <HASH>..<HASH> 100644 --- a/template.go +++ b/template.go @@ -109,7 +109,6 @@ func NewTemplateLoader(paths ...string) *TemplateLoader { loader := &TemplateLoader{ paths: paths, } - loader.Refresh() return loader }
Bug fix: In Prod mode, call Refresh() on router/templateloader to initialize them.
revel_revel
train
go,go
99c812c2457738ec19d9ccb2d211340091804de5
diff --git a/phypno/scroll_data.py b/phypno/scroll_data.py index <HASH>..<HASH> 100644 --- a/phypno/scroll_data.py +++ b/phypno/scroll_data.py @@ -45,7 +45,7 @@ DATASET_EXAMPLE = None # DATASET_EXAMPLE = '/home/gio/tools/phypno/test/data/sample.edf' # DATASET_EXAMPLE = '/home/gio/Copy/presentations_x/video/VideoFileFormat_1' # DATASET_EXAMPLE = '/home/gio/ieeg/data/MG63_d2_Thurs_d.edf' -# DATASET_EXAMPLE = '/home/gio/tools/phypno/test/data/MG71_d1_Wed_c.edf' +DATASET_EXAMPLE = '/home/gio/tools/phypno/test/data/MG71_d1_Wed_c.edf' setConfigOption('background', 'w') @@ -63,7 +63,6 @@ config.setValue('stage_scoring_window', 30) # sleep scoring window config.setValue('overview_timestamp_steps', 60 * 60) # timestamp in overview - class MainWindow(QMainWindow): """Create an instance of the main window.
temporary, use edf as example
wonambi-python_wonambi
train
py
12bb8750b28b797b08b21c41c0179ea851bbab88
diff --git a/ubersmith/calls/client.py b/ubersmith/calls/client.py index <HASH>..<HASH> 100644 --- a/ubersmith/calls/client.py +++ b/ubersmith/calls/client.py @@ -66,7 +66,7 @@ class InvoiceCountCall(BaseCall): self.cleaned = int(self.cleaned) -class CreditListCall(BaseCall): +class CreditListCall(GroupCall): method = _('credit_list') required_fields = ['client_id']
Changed client.credit_list call to group call
jasonkeene_python-ubersmith
train
py
05937bc6a734fedfd8d5d01b776b409e88da02b2
diff --git a/lib/sprite_factory/runner.rb b/lib/sprite_factory/runner.rb index <HASH>..<HASH> 100644 --- a/lib/sprite_factory/runner.rb +++ b/lib/sprite_factory/runner.rb @@ -183,12 +183,7 @@ module SpriteFactory end def file_contains_exclusion_name?(file) - result = false - exclusion_array.each do |name| - break if result - result = file.include?(name) - end - result + exclusion_array.any? { |exclude| file.include?(exclude) } end #----------------------------------------------------------------------------
Refactor file_contains_exclusion_name? method to make use of ruby enumerable class methods
jakesgordon_sprite-factory
train
rb
2c3c239ab47fd2cfd67086df7e32152855e24be5
diff --git a/Model/Queue.php b/Model/Queue.php index <HASH>..<HASH> 100644 --- a/Model/Queue.php +++ b/Model/Queue.php @@ -194,12 +194,18 @@ class Queue implements QueueInterface $response = $this->sqs->getClient()->receiveMessage($arguments); $service = $this; - return array_map(function ($definition) use ($service) { - return $service->getMessageFactory() - ->create(trim($definition['Body'])) - ->setId(trim($definition['MessageId'])) - ->setReceipthandle(trim($definition['ReceiptHandle'])); - }, $response->get('Messages')); + $messages = array(); + + if (!is_null($response->get('Messages'))) { + $messages = array_map(function ($definition) use ($service) { + return $service->getMessageFactory() + ->create(trim($definition['Body'])) + ->setId(trim($definition['MessageId'])) + ->setReceipthandle(trim($definition['ReceiptHandle'])); + }, $response->get('Messages')); + } + + return $messages; } /**
Fixed empty queue issue in fetching message. Issue #4
lelivrescolaire_SQSBundle
train
php
ba86f518847c50fb689450691f52d180883af3a9
diff --git a/routing.go b/routing.go index <HASH>..<HASH> 100644 --- a/routing.go +++ b/routing.go @@ -509,12 +509,13 @@ func (dht *IpfsDHT) FindProviders(ctx context.Context, c cid.Cid) ([]peer.AddrIn // Peers will be returned on the channel as soon as they are found, even before // the search query completes. func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo { + peerOut := make(chan peer.AddrInfo, count) if !dht.enableProviders { - return nil + close(peerOut) + return peerOut } logger.Event(ctx, "findProviders", key) - peerOut := make(chan peer.AddrInfo, count) go dht.findProvidersAsyncRoutine(ctx, key, count, peerOut) return peerOut
fix: return a closed channel from FindProvidersAsync when providers are disabled.
libp2p_go-libp2p-kad-dht
train
go
075ac89fd33749e3d65a6c51db84109543328371
diff --git a/pyatv/mrp/connection.py b/pyatv/mrp/connection.py index <HASH>..<HASH> 100644 --- a/pyatv/mrp/connection.py +++ b/pyatv/mrp/connection.py @@ -49,7 +49,7 @@ class MrpConnection( """Device connection was dropped.""" _LOGGER.debug("%s Disconnected from device: %s", self._log_str, exc) self._transport = None - self.listener.stop() + self.listener.stop() # type: ignore if self.atv: if exc is None: @@ -144,4 +144,4 @@ class MrpConnection( parsed.ParseFromString(data) log_protobuf(_LOGGER, self._log_str + "<< Receive: Protobuf", parsed) - self.listener.message_received(parsed, data) + self.listener.message_received(parsed, data) # type: ignore
mrp: Disable some type checking Temporary fix due to StateProducer not supporting type hints.
postlund_pyatv
train
py
c01acfe79ad720463ee1ce6562e7b0cc89f25c8d
diff --git a/pubnubsubhandler.py b/pubnubsubhandler.py index <HASH>..<HASH> 100644 --- a/pubnubsubhandler.py +++ b/pubnubsubhandler.py @@ -42,7 +42,7 @@ class PubNubSubscriptionHandler(): """ self._sub_key = sub_key self._pnconfig = PNConfiguration() - self._pnconfig.reconnection_policy = PNReconnectionPolicy.EXPONENTIAL + self._pnconfig.reconnect_policy = PNReconnectionPolicy.EXPONENTIAL self._pnconfig.subscribe_key = sub_key self._pnconfig.ssl = True self._pubnub = PubNub(self._pnconfig)
Corrected pubnub reconnect policy
w1ll1am23_pubnubsub-handler
train
py
07c170e2effa3fde307d8cfe0b47cc4c2d9e7f55
diff --git a/resource_aws_eip.go b/resource_aws_eip.go index <HASH>..<HASH> 100644 --- a/resource_aws_eip.go +++ b/resource_aws_eip.go @@ -163,6 +163,11 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { describeAddresses, err := ec2conn.Addresses(publicIps, assocIds, nil) if err != nil { + if ec2err, ok := err.(*ec2.Error); ok && ec2err.Code == "InvalidAllocationID.NotFound" { + d.SetId("") + return nil + } + return fmt.Errorf("Error retrieving EIP: %s", err) }
providers/aws: check for non-exist on refresh
terraform-providers_terraform-provider-aws
train
go
391ee2c1b53301ea35da776cb7de343e48d1d4d8
diff --git a/openquake/hazardlib/calc/filters.py b/openquake/hazardlib/calc/filters.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/calc/filters.py +++ b/openquake/hazardlib/calc/filters.py @@ -411,7 +411,7 @@ class SourceFilter(object): elif len(indices): src.indices = indices yield src, sites.filtered(indices) - else: # normal filtering + else: # slow filtering for sitecol not at sea level _, maxmag = src.get_min_max_mag() maxdist = self.integration_distance( src.tectonic_region_type, maxmag)
Improved a comment [skip CI]
gem_oq-engine
train
py
a34a8a9691f5e33acff7dc389419d3a048ba4b03
diff --git a/bika/lims/browser/client.py b/bika/lims/browser/client.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/client.py +++ b/bika/lims/browser/client.py @@ -106,8 +106,8 @@ class ClientWorkflowAction(AnalysisRequestWorkflowAction): if Sampler and DateSampled: workflow.doActionFor(sample, action) new_state = workflow.getInfoFor(sample, 'review_state') + doActionFor(ar, action) transitioned[new_state].append(sample.Title()) - doActionFor(ar, action) message = None for state in transitioned:
Fixed indentation error which allowed Sampling without DateSampled being set
senaite_senaite.core
train
py
ae56ab32fc3ef76c2d73bdce494dd763181f041f
diff --git a/lib/searchlogic/named_scopes/conditions.rb b/lib/searchlogic/named_scopes/conditions.rb index <HASH>..<HASH> 100644 --- a/lib/searchlogic/named_scopes/conditions.rb +++ b/lib/searchlogic/named_scopes/conditions.rb @@ -50,7 +50,7 @@ module Searchlogic end CONDITIONS[:equals_any] = CONDITIONS[:equals_any] + [:in] - CONDITIONS[:does_not_equal_any] = CONDITIONS[:equals_any] + [:not_in] + CONDITIONS[:does_not_equal_any] = CONDITIONS[:does_not_equal_any] + [:not_in] BOOLEAN_CONDITIONS.each { |condition, aliases| CONDITIONS[condition] = aliases }
fix typo, setting does_not_equal_any conditions to equals_any conditions
binarylogic_searchlogic
train
rb
a3bbd2ccfe1984a1100785952a9cd71fdd834c9a
diff --git a/lib/github_cli/command.rb b/lib/github_cli/command.rb index <HASH>..<HASH> 100644 --- a/lib/github_cli/command.rb +++ b/lib/github_cli/command.rb @@ -29,9 +29,15 @@ module GithubCLI } end - map "ls" => :list, - "all" => :list, - "del" => :delete + ALIASES = { + "ls" => :list, + "all" => :list, + "del" => :delete, + "rm" => :delete, + "c" => :create, + "e" => :edit + } + map ALIASES class_option :params, :type => :hash, :default => {}, :aliases => '-p', :desc => 'Request parameters e.i per_page:100'
Add usefull aliases for common commands.
piotrmurach_github_cli
train
rb
64cacbf35068be4155f5a4166960d399ccf82e9e
diff --git a/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileModuleProviderBase.java b/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileModuleProviderBase.java index <HASH>..<HASH> 100644 --- a/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileModuleProviderBase.java +++ b/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileModuleProviderBase.java @@ -100,7 +100,11 @@ public abstract class MapTileModuleProviderBase implements OpenStreetMapTileProv @Override protected boolean removeEldestEntry( final Map.Entry<MapTile, MapTileRequestState> pEldest) { - return size() > pPendingQueueSize; + if (size() > pPendingQueueSize) { + removeTileFromQueues(pEldest.getKey()); + pEldest.getValue().getCallback().mapTileRequestFailed(pEldest.getValue()); + } + return false; } }; }
Fix for "stuck" tiles never loading due to old tiles being dropped rather than being reported as failed requests. Fixes issue <I>.
osmdroid_osmdroid
train
java
3b2e5c4d830595319404f2d867a4cf1aa41ea5be
diff --git a/src/TestCase.php b/src/TestCase.php index <HASH>..<HASH> 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -108,19 +108,30 @@ abstract class TestCase extends FoundationTestCase protected function createBrowsersFor(Closure $callback) { if (count(static::$browsers) === 0) { - static::$browsers = collect([new Browser($this->createWebDriver())]); + static::$browsers = collect([$this->newBrowser($this->createWebDriver())]); } $additional = $this->browsersNeededFor($callback) - 1; for ($i = 0; $i < $additional; $i++) { - static::$browsers->push(new Browser($this->createWebDriver())); + static::$browsers->push($this->newBrowser($this->createWebDriver())); } return static::$browsers; } /** + * Create a new Browser instance. + * + * @param \Facebook\WebDriver\Remote\RemoteWebDriver $driver + * @return \Laravel\Dusk\Browser + */ + protected function newBrowser($driver) + { + return new Browser($driver); + } + + /** * Get the number of browsers needed for a given callback. * * @param \Closure $callback
Add the possibility to extend the browser class.
laravel_dusk
train
php
6dceb42a3879984fec0da3751d6f949c5c19487e
diff --git a/src/com/google/javascript/jscomp/ProcessCommonJSModules.java b/src/com/google/javascript/jscomp/ProcessCommonJSModules.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/ProcessCommonJSModules.java +++ b/src/com/google/javascript/jscomp/ProcessCommonJSModules.java @@ -527,7 +527,8 @@ public final class ProcessCommonJSModules implements CompilerPass { initModule.useSourceInfoIfMissingFromForTree(this.script); Node refChild = this.script.getFirstChild(); - while (refChild.getNext() != null & refChild.getNext().isExprResult() + while (refChild.getNext() != null + && refChild.getNext().isExprResult() && refChild.getNext().getFirstChild().isCall() && (refChild.getNext().getFirstFirstChild().matchesQualifiedName("goog.require") || refChild.getNext().getFirstFirstChild().matchesQualifiedName("goog.provide"))) {
Use && for boolean logic instead of & I was surprised to find Java allows '&' and I think it even does the right thing, but it's unusual. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
976ebcb9762454b6877a75da178284db200c5c8c
diff --git a/pkg/image/controller/trigger/image_trigger_controller_test.go b/pkg/image/controller/trigger/image_trigger_controller_test.go index <HASH>..<HASH> 100644 --- a/pkg/image/controller/trigger/image_trigger_controller_test.go +++ b/pkg/image/controller/trigger/image_trigger_controller_test.go @@ -958,7 +958,7 @@ func updateBuildConfigImages(bc *buildapi.BuildConfig, tagRetriever trigger.TagR if updated == nil { updated = bc.DeepCopy() } - p = bc.Spec.Triggers[i].ImageChange + p = updated.Spec.Triggers[i].ImageChange p.LastTriggeredImageID = latest } return updated, nil
Image trigger test was mutating the wrong object
openshift_origin
train
go
e4bb655d1f9c198403300c7eca48d41cf2a86ec9
diff --git a/misc/plugin/amp.rb b/misc/plugin/amp.rb index <HASH>..<HASH> 100644 --- a/misc/plugin/amp.rb +++ b/misc/plugin/amp.rb @@ -15,7 +15,8 @@ end add_content_proc('amp') do |date| diary = @diaries[date] - ERB.new(File.read("views/amp.rhtml")).result(binding) + template = File.read(File.join(TDiary::root, "views/amp.rhtml")) + ERB.new(template).result(binding) end def amp_body(diary)
amp.rb: fix bug, plugin does not work in gem mode
tdiary_tdiary-core
train
rb
3a350837eceddf0c5f5b7e18be4328f01bebe8a6
diff --git a/src/Qcloud/Cos/ResultTransformer.php b/src/Qcloud/Cos/ResultTransformer.php index <HASH>..<HASH> 100644 --- a/src/Qcloud/Cos/ResultTransformer.php +++ b/src/Qcloud/Cos/ResultTransformer.php @@ -33,7 +33,15 @@ class ResultTransformer { if ($action == "GetObject") { if (isset($command['SaveAs'])) { $fp = fopen($command['SaveAs'], "wb"); - fwrite($fp, $response->getBody()); + $stream = $response->getBody(); + $offset = 0; + $partsize = 8192; + while (!$stream->eof()) { + $output = $stream->read($partsize); + fseek($fp, $offset); + fwrite($fp, $output); + $offset += $partsize; + } fclose($fp); } }
fix getObject with saveas (#<I>)
tencentyun_cos-php-sdk-v5
train
php
f43cdbafdf126bb977c08001499088fed3d14b98
diff --git a/lib/apnotic/version.rb b/lib/apnotic/version.rb index <HASH>..<HASH> 100644 --- a/lib/apnotic/version.rb +++ b/lib/apnotic/version.rb @@ -1,3 +1,3 @@ module Apnotic - VERSION = '1.6.1'.freeze + VERSION = '1.7.0'.freeze end
Bump to <I>.
ostinelli_apnotic
train
rb
151e8015835838974f27e3516a5e520dc139f00f
diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index <HASH>..<HASH> 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -15,7 +15,15 @@ class SimpleSAML_Utilities { */ public static function getSelfHost() { - $currenthost = $_SERVER['HTTP_HOST']; + if (array_key_exists('HTTP_HOST', $_SERVER)) { + $currenthost = $_SERVER['HTTP_HOST']; + } elseif (array_key_exists('SERVER_NAME', $_SERVER)) { + $currenthost = $_SERVER['SERVER_NAME']; + } else { + /* Almost certainly not what you want, but ... */ + $currenthost = 'localhost'; + } + if(strstr($currenthost, ":")) { $currenthostdecomposed = explode(":", $currenthost); $currenthost = $currenthostdecomposed[0];
Fix code for determining the current hostname.
simplesamlphp_saml2
train
php
599489cd5dc88c50069a833f51f13b48816d6060
diff --git a/test/bitgo/keyutil.js b/test/bitgo/keyutil.js index <HASH>..<HASH> 100644 --- a/test/bitgo/keyutil.js +++ b/test/bitgo/keyutil.js @@ -29,6 +29,12 @@ describe('privateKeyBufferFromECPair', function () { assert.strictEqual(privateKeyBufferFromECPair(keyPair).length, 32) assert.strictEqual(privateKeyBufferFromECPair(keyPair).toString('hex'), hexString) }) + + it('throws if passed value is not ecpair', function () { + assert.throws(function () { + privateKeyBufferFromECPair({}) + }, new RegExp('invalid argument ecpair')) + }) }) describe('privateKeyBufferToECPair', function () {
Add test for privateKeyBufferFromECPair Try to bump up coverage above <I>% again.
BitGo_bitgo-utxo-lib
train
js
6996cbe09a23182fbca0492652014f72c784c6d8
diff --git a/docker/docker_lifecycle_test.go b/docker/docker_lifecycle_test.go index <HASH>..<HASH> 100644 --- a/docker/docker_lifecycle_test.go +++ b/docker/docker_lifecycle_test.go @@ -107,12 +107,12 @@ var _ = Describe(deaUnsupportedTag+"Docker Application Lifecycle", func() { Eventually(cf.Cf( "set-env", appName, "HOME", "/tmp/fakehome"), - ).Should(Exit(0)) + DEFAULT_TIMEOUT).Should(Exit(0)) Eventually(cf.Cf( "set-env", appName, "TMPDIR", "/tmp/dir"), - ).Should(Exit(0)) + DEFAULT_TIMEOUT).Should(Exit(0)) }) It("prefers the env vars from cf set-env over those in the Dockerfile", func() {
Add DEFAULT_TIMEOUT to Eventually assertions in docker tests
cloudfoundry_cf-acceptance-tests
train
go
d91e4b0c230f7e3c631ff668ed137da01afbe913
diff --git a/galpy/actionAngle_src/actionAngle.py b/galpy/actionAngle_src/actionAngle.py index <HASH>..<HASH> 100644 --- a/galpy/actionAngle_src/actionAngle.py +++ b/galpy/actionAngle_src/actionAngle.py @@ -78,9 +78,6 @@ class actionAngle: 2) numpy.ndarray: [N] phase-space values for N objects - 3) numpy.ndarray: [N,M] phase-space values for N objects at M - times - b) Orbit instance: initial condition used if that's it, orbit(t) if there is a time given as well as the second argument OUTPUT: @@ -106,9 +103,6 @@ class actionAngle: 2) numpy.ndarray: [N] phase-space values for N objects - 3) numpy.ndarray: [N,M] phase-space values for N objects at M - times - b) Orbit instance: initial condition used if that's it, orbit(t) if there is a time given as well as the second argument OUTPUT: @@ -135,9 +129,6 @@ class actionAngle: 2) numpy.ndarray: [N] phase-space values for N objects - 3) numpy.ndarray: [N,M] phase-space values for N objects at M - times - b) Orbit instance: initial condition used if that's it, orbit(t) if there is a time given as well as the second argument OUTPUT:
yet another doc fix in actionAngle inputs
jobovy_galpy
train
py
398bf24a30527fa9fc7a3d9692da62e8a5d85996
diff --git a/pysat/_meta.py b/pysat/_meta.py index <HASH>..<HASH> 100644 --- a/pysat/_meta.py +++ b/pysat/_meta.py @@ -746,13 +746,6 @@ class Meta(object): for i in self.ho_data: yield i - def keypairs_ho(self): - """Yields keypairs for higher order metadata, (key1, attribute1) """ - - for i in self.ho_data.keys(): - for j in self[i].keys: - yield (i, j) - def attrs(self): """Yields metadata products stored for each variable name"""
Removed function I not tested and not yet used. Not needed.
rstoneback_pysat
train
py
cf154c4a7289eb20f4c9037f0454a9914308f16e
diff --git a/core/src/main/java/com/google/errorprone/refactors/emptyifstatement/EmptyIfStatement.java b/core/src/main/java/com/google/errorprone/refactors/emptyifstatement/EmptyIfStatement.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/refactors/emptyifstatement/EmptyIfStatement.java +++ b/core/src/main/java/com/google/errorprone/refactors/emptyifstatement/EmptyIfStatement.java @@ -105,8 +105,9 @@ public class EmptyIfStatement extends RefactoringMatcher<EmptyStatementTree> { public Matcher<EmptyStatementTree> emptyIfMatcher = new EmptyIfStatement(); @Override - public Void visitEmptyStatement(EmptyStatementTree node, VisitorState state) { - if (emptyIfMatcher.matches(node, state.withPath(getCurrentPath()))) { + public Void visitEmptyStatement(EmptyStatementTree node, VisitorState visitorState) { + VisitorState state = visitorState.withPath(getCurrentPath()); + if (emptyIfMatcher.matches(node, state)) { reportMatch(emptyIfMatcher, node, state); } return null;
Fixed EmptyIfStatement.Search to correctly pass path in VisitorState to refactor method
google_error-prone
train
java
814690f73e305239cb6b3e005aca7099ed7ef82d
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/hostname.rb +++ b/lib/chef/resource/hostname.rb @@ -53,7 +53,7 @@ class Chef end ``` - **Change the hostname of a Windows, Domain-joined node (new in 17.3)**: + **Change the hostname of a Windows, Domain-joined node (new in 17.2)**: ```ruby hostname 'renaming a domain-joined computer' do @@ -91,12 +91,12 @@ class Chef property :domain_user, String, description: "A domain account specified in the form of DOMAIN\\user used when renaming a domain-joined device", - introduced: "17.3" + introduced: "17.2" property :domain_password, String, description: "The password to accompany the domain_user parameter", sensitive: true, - introduced: "17.3" + introduced: "17.2" action_class do def append_replacing_matching_lines(path, regex, string)
Fix incorrect versions this resource was updated in I was off by one when I added these
chef_chef
train
rb
793adab5da7fa2f728d979fd686546b45d58c307
diff --git a/Twig/Extensions/IsLoadedExtension.php b/Twig/Extensions/IsLoadedExtension.php index <HASH>..<HASH> 100644 --- a/Twig/Extensions/IsLoadedExtension.php +++ b/Twig/Extensions/IsLoadedExtension.php @@ -2,6 +2,8 @@ namespace Librinfo\CoreBundle\Twig\Extensions; +use Twig_Environment; + class IsLoadedExtension extends \Twig_Extension { /** @@ -12,15 +14,27 @@ class IsLoadedExtension extends \Twig_Extension public function getFunctions() { return array( - new \Twig_SimpleFunction('isExtensionLoaded', [$this, 'isLoaded'], ['needs_environment' => true]), + new \Twig_SimpleFunction('isExtensionLoaded', [$this, 'isExtensionLoaded'], ['needs_environment' => true]), + new \Twig_SimpleFunction('isFunctionLoaded', [$this, 'isFunctionLoaded'], ['needs_environment' => true]), ); } /** * @param string $name + * + * @return boolean + */ + function isFunctionLoaded(Twig_Environment $twig, $name) + { + return $twig->getFunction($name); + } + + /** + * @param string $name + * * @return boolean */ - function isLoaded($twig, $name) + function isExtensionLoaded(Twig_Environment $twig, $name) { return $twig->hasExtension($name); }
fixed miss use of twig->hasExtension replaced by getFunction($name)
blast-project_CoreBundle
train
php
8a986ec340948ba3ce0b9954ffba29e112822b20
diff --git a/public/app/features/dashboard/dashboardNavCtrl.js b/public/app/features/dashboard/dashboardNavCtrl.js index <HASH>..<HASH> 100644 --- a/public/app/features/dashboard/dashboardNavCtrl.js +++ b/public/app/features/dashboard/dashboardNavCtrl.js @@ -52,6 +52,10 @@ function (angular, _) { }; $scope.saveDashboard = function(options) { + if ($scope.dashboardMeta.canSave === false) { + return; + } + var clone = $scope.dashboard.getSaveModelClone(); backendSrv.saveDashboard(clone, options).then(function(data) {
Using CTRL+S should not work when dashboardMeta.canSave is false, #<I>
grafana_grafana
train
js
e8ef271baecf8539681ccfd210fbc86c1ee3d6a2
diff --git a/fireplace/player.py b/fireplace/player.py index <HASH>..<HASH> 100644 --- a/fireplace/player.py +++ b/fireplace/player.py @@ -32,7 +32,7 @@ class Player(Entity): return self.name def __repr__(self): - return "%s(name=%r, deck=%r)" % (self.__class__.__name__, self.name, self.deck) + return "%s(name=%r, hero=%r)" % (self.__class__.__name__, self.name, self.hero) @property def slots(self):
Give Player a better repr()
jleclanche_fireplace
train
py
d106c710dd931c8bf705436b789b8d510ed1d4c7
diff --git a/test/ember/precompiler_test.rb b/test/ember/precompiler_test.rb index <HASH>..<HASH> 100644 --- a/test/ember/precompiler_test.rb +++ b/test/ember/precompiler_test.rb @@ -4,7 +4,7 @@ class EmberPrecompilerTest < MiniTest::Unit::TestCase def test_calls_the_ember_handlebars_precompiler result = compile "Hello {{name}}" assert result - assert_match /data\.buffer|isHTMLBars: true/, result + assert_match /data\.buffer|isHTMLBars: true|"revision": "Ember@/, result end def test_is_a_precompiler
Fix for ember-source <I> The handlebars AST seems to be changed.
tchak_barber
train
rb
710254b66904c0087c67179104a81025a5f32020
diff --git a/blueprints/ember-frost-bunsen/index.js b/blueprints/ember-frost-bunsen/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-frost-bunsen/index.js +++ b/blueprints/ember-frost-bunsen/index.js @@ -1,16 +1,12 @@ -const addBunsenStyleImport = function (project) { - const isAddon = project.isEmberCLIAddon() - const pathPrefix = isAddon ? 'tests/dummy/' : '' - - return this.insertIntoFile( - `${pathPrefix}app/styles/app.scss`, - "@import 'ember-frost-bunsen';" - ) -} - module.exports = { afterInstall: function () { - return addBunsenStyleImport(this.project) + const isAddon = this.project.isEmberCLIAddon() + const pathPrefix = isAddon ? 'tests/dummy/' : '' + + return this.insertIntoFile( + `${pathPrefix}app/styles/app.scss`, + "@import 'ember-frost-bunsen';" + ) }, normalizeEntityName: function () { @@ -19,7 +15,3 @@ module.exports = { // to us } } - -export { - addBunsenStyleImport -}
change approach of setting style import back to previous non exported function
ciena-frost_ember-frost-bunsen
train
js
59fa43dee003ed4b7ae16742bfd0d1e5543d431c
diff --git a/bin/start.js b/bin/start.js index <HASH>..<HASH> 100755 --- a/bin/start.js +++ b/bin/start.js @@ -2,7 +2,7 @@ var cp = require('child_process') -var BIN = '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary' +var BIN = process.platform=='linux' ? '/bin/google-chrome' : '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary'; var ARGS = ['--load-and-launch-app=chrome'] var child = cp.spawn(BIN, ARGS) @@ -11,4 +11,4 @@ var child = cp.spawn(BIN, ARGS) process.once('SIGUSR2', function () { child.kill() process.kill(process.pid, 'SIGUSR2') -}) \ No newline at end of file +})
Improve the accessibility of the project for linux users.
webtorrent_webtorrent
train
js
43d84e3602bd32380b4c0d34105881d4f72a405b
diff --git a/lib/finite_machine/state_parser.rb b/lib/finite_machine/state_parser.rb index <HASH>..<HASH> 100644 --- a/lib/finite_machine/state_parser.rb +++ b/lib/finite_machine/state_parser.rb @@ -21,18 +21,21 @@ module FiniteMachine # Extract states from attributes # + # @param [Proc] block + # # @example # StateParpser.new(attr).parase_states # # @return [Hash[Symbol]] states # # @api public - def parse_states - if contains_from_to_keys? + def parse_states(&block) + transitions = if contains_from_to_keys? convert_from_to_attributes_to_states_hash else convert_attributes_to_states_hash end + block ? transitions.each(&block) : transitions end # Check if attributes contain :from or :to key
Change to iterate transtion when parsing.
piotrmurach_finite_machine
train
rb
48493a201154456d375a12a3c1912f36862881b6
diff --git a/code/libraries/joomlatools/component/koowa/template/helper/actionbar.php b/code/libraries/joomlatools/component/koowa/template/helper/actionbar.php index <HASH>..<HASH> 100644 --- a/code/libraries/joomlatools/component/koowa/template/helper/actionbar.php +++ b/code/libraries/joomlatools/component/koowa/template/helper/actionbar.php @@ -30,7 +30,7 @@ class ComKoowaTemplateHelperActionbar extends KTemplateHelperActionbar // FIXME: take this out when we refactor UI if (JFactory::getApplication()->isSite()) { - $html = str_replace('k-toolbar-buttons', 'btn-group', $html); + $html = str_replace('k-toolbar-buttons', 'k-toolbar-buttons btn-group', $html); } return $html;
re #<I>: Use k-toolbar-buttons as well
joomlatools_joomlatools-framework
train
php
4b263f86a23558c6b8699f426961bf5c36c1be24
diff --git a/scripts/build_wikidata.js b/scripts/build_wikidata.js index <HASH>..<HASH> 100644 --- a/scripts/build_wikidata.js +++ b/scripts/build_wikidata.js @@ -308,9 +308,10 @@ function processEntities(result) { // P18 - Image (use this for flags) imageFile = getClaimValue(entity, 'P18'); } else { - // P154 - Logo Image // P8972 - Small Logo or Icon - imageFile = getClaimValue(entity, 'P8972') || getClaimValue(entity, 'P154'); + // P154 - Logo Image + // P94 - Coat of Arms Image + imageFile = getClaimValue(entity, 'P8972') || getClaimValue(entity, 'P154') || getClaimValue(entity, 'P94'); } if (imageFile) { const re = /\.svg$/i;
Fallback to fetch P<I> Coat of Arms image (closes #<I>)
osmlab_name-suggestion-index
train
js
29286b54f6fd47a6db3b6709c7c29f0a10a3e603
diff --git a/src/location-factory.js b/src/location-factory.js index <HASH>..<HASH> 100644 --- a/src/location-factory.js +++ b/src/location-factory.js @@ -10,8 +10,8 @@ const LocationFactory = function(_window) { const Location = {}; - Location.Navigate = function(path, pushState) { - if (history && pushState !== false) { + Location.Navigate = function(path) { + if (history) { history.pushState({path: path}, null, path); } ChangeLocation(path);
Remove "pushState" option from Location.Navigate This was a holdover from when "navigate" was being abused to notify subscribers for window.onpopstate. Since subscriber notification had been factored out appropriate, this option is no longer necessary to support onpopstate, without introducing incorrect entries in the browser history.
clalimarmo_coherence
train
js
ba3f4e0eca3fafddd48daf847c0111a96eb91bab
diff --git a/mapillary_tools/exif_read.py b/mapillary_tools/exif_read.py index <HASH>..<HASH> 100644 --- a/mapillary_tools/exif_read.py +++ b/mapillary_tools/exif_read.py @@ -168,8 +168,7 @@ class ExifRead: capture_time = format_time(capture_time) sub_sec = self.extract_subsec() capture_time = capture_time + \ - datetime.timedelta(seconds=float( - sub_sec) / 10**len(str(sub_sec))) + datetime.timedelta(seconds=float("0." + sub_sec)) return capture_time @@ -333,7 +332,6 @@ class ExifRead: ] sub_sec, _ = self._extract_alternative_fields( fields, default=0, field_type=str) - sub_sec = int(sub_sec) return sub_sec def fields_exist(self, fields):
bugfix: extract_capture_time return a wrong microsecond value If a jpg file contains a SubSecTimeOriginal field with a value of <I>, the extract_capture_time method returns a microsecond value of <I> instead of 5 this commit correct this bug
mapillary_mapillary_tools
train
py
dccd45528a8a3652eae2af88dd6c4a34f696a92b
diff --git a/acorn.js b/acorn.js index <HASH>..<HASH> 100644 --- a/acorn.js +++ b/acorn.js @@ -700,7 +700,7 @@ // of the type given by its first argument. case 47: // '/' - return readToken_slash(code); + return readToken_slash(); case 37: case 42: // '%*' return readToken_mult_modulo();
Minor: Remove unused argument from readToken_slash Possible dev relic. readToken_slash currently does not have any arguments and does not appear to look at arguments. All existing tests pass after removal of extraneous argument while calling readToken_slash.
babel_babylon
train
js
8e9ecd0bd58d6acf5b10214586d55520d54745cf
diff --git a/js/runner.go b/js/runner.go index <HASH>..<HASH> 100644 --- a/js/runner.go +++ b/js/runner.go @@ -263,11 +263,10 @@ func (r *Runner) newVU(idLocal, idGlobal uint64, samplesOut chan<- stats.SampleC // This is here mostly so if someone tries they get a nice message // instead of "Value is not an object: undefined ..." - common.BindToGlobal(vu.Runtime, map[string]interface{}{ - "open": func() { + _ = vu.Runtime.GlobalObject().Set("open", + func() { common.Throw(vu.Runtime, errors.New(openCantBeUsedOutsideInitContextMsg)) - }, - }) + }) return vu, nil }
Remove one unneeded usage of common.BindToGlobal
loadimpact_k6
train
go
cd3c483ee994ab1cc84740b2fa078f7da9de2333
diff --git a/lib/fluent/plugin/out_splunk_hec.rb b/lib/fluent/plugin/out_splunk_hec.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/out_splunk_hec.rb +++ b/lib/fluent/plugin/out_splunk_hec.rb @@ -303,12 +303,12 @@ module Fluent::Plugin t2 = Time.now # raise Exception to utilize Fluentd output plugin retry machanism - raise "Server error (#{response.code}) for POST #{@hec_api}, response: #{response.body}" if response.code.start_with?('5') + raise "Server error (#{response.code}) for POST #{@api}, response: #{response.body}" if response.code.start_with?('5') # For both success response (2xx) and client errors (4xx), we will consume the chunk. # Because there probably a bug in the code if we get 4xx errors, retry won't do any good. if not response.code.start_with?('2') - log.error "Failed POST to #{@hec_api}, response: #{response.body}" + log.error "Failed POST to #{@api}, response: #{response.body}" log.debug { "Failed request body: #{post.body}" } end
fix hec_api to api (#<I>)
splunk_fluent-plugin-splunk-hec
train
rb
4b2f6e6ae8ee977807ddc5ae3dc52a5b693f5f01
diff --git a/src/LedgerWallet.js b/src/LedgerWallet.js index <HASH>..<HASH> 100644 --- a/src/LedgerWallet.js +++ b/src/LedgerWallet.js @@ -171,7 +171,6 @@ class LedgerWallet { // This is fishy but currently ledger library always returns empty // resolved promise when closing connection so there is no point in // doing anything with returned Promise. - // noinspection JSIgnoredPromiseFromCall await this.closeLedgerConnection(eth); } } @@ -246,7 +245,6 @@ class LedgerWallet { // This is fishy but currently ledger library always returns empty // resolved promise when closing connection so there is no point in // doing anything with returned Promise. - // noinspection JSIgnoredPromiseFromCall await this.closeLedgerConnection(eth); } }
Remove InteliJ specific linting setting
Neufund_ledger-wallet-provider
train
js
3aba171cbcf9393bb1576e593ffaa3849b5fe696
diff --git a/src/Deploy/GitHubDeploy.php b/src/Deploy/GitHubDeploy.php index <HASH>..<HASH> 100644 --- a/src/Deploy/GitHubDeploy.php +++ b/src/Deploy/GitHubDeploy.php @@ -141,8 +141,7 @@ class GitHubDeploy extends DeployBase if ($this->gitRemoteBranchExist()) { $stack ->exec('fetch --all') - ->exec("reset --soft {$origin}/{$branch}") - ->checkout($branch); + ->exec("reset --soft {$origin}/{$branch}"); } } else { $stack
#<I>: Remove the git checkout after the reset, as it's not truely needed.
droath_project-x
train
php
83fab2739d0aad7ed7f17422b66afb0c67193335
diff --git a/salt/cloud/clouds/msazure.py b/salt/cloud/clouds/msazure.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/msazure.py +++ b/salt/cloud/clouds/msazure.py @@ -528,9 +528,9 @@ def create(vm_): conn.create_virtual_machine_deployment(**vm_kwargs) except WindowsAzureConflictError: log.debug("Conflict error. The deployment may already exist, trying add_role") - # Deleting two useless keywords - del vm_kwargs["deployment_slot"] - del vm_kwargs["label"] + # Deleting two useless keywords + del vm_kwargs['deployment_slot'] + del vm_kwargs['label'] conn.add_role(**vm_kwargs) except Exception as exc: error = 'The hosted service name is invalid.'
lint (and single quotes when I see them :) )
saltstack_salt
train
py
68e1c7f58a32587f67130bd336dfd20bf78b6ae4
diff --git a/lib/https/index.js b/lib/https/index.js index <HASH>..<HASH> 100644 --- a/lib/https/index.js +++ b/lib/https/index.js @@ -105,6 +105,12 @@ function handleWebsocket(socket, clientIp, callback) { if (filter.rule) { plugin = null; } + if (!_rules.host) { + var _pluginRules = rulesMgr.resolveRules(fullUrl); + if (_pluginRules.host) { + _rules.host = _pluginRules.host; + } + } Object.keys(filter).forEach(function(name) { delete _rules[name]; }); diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -51,6 +51,12 @@ function tunnelProxy(server, proxy) { if (rulesMgr) { extend(filter, rulesMgr.resolveFilter(tunnelUrl)); extend(disable, rulesMgr.resolveDisable(tunnelUrl)); + if (!_rules.host) { + var _pluginRules = rulesMgr.resolveRules(fullUrl); + if (_pluginRules.host) { + _rules.host = _pluginRules.host; + } + } Object.keys(filter).forEach(function(name) { delete _rules[name]; });
refactor: show plugins rules in overview
avwo_whistle
train
js,js
385259984979fd629de0646fc27e3dc8ad377107
diff --git a/blkn/src/index.js b/blkn/src/index.js index <HASH>..<HASH> 100644 --- a/blkn/src/index.js +++ b/blkn/src/index.js @@ -1,5 +1,8 @@ // @flow export { default as Button } from "./Button"; -export { default as Input } from "./Input"; +export { default as InputText } from "./InputText"; export { default as Typography } from "./Typography"; +export { default as Header } from "./Container/Header"; +export { default as Section } from "./Container/Section"; +export { default as Loader } from "./Loader";
BLKN: Add more exports to index.js
kiwicom_orbit-components
train
js
791430c1a2237a58b0bb691cfe755eb132915045
diff --git a/tensorlayer/layers/recurrent.py b/tensorlayer/layers/recurrent.py index <HASH>..<HASH> 100644 --- a/tensorlayer/layers/recurrent.py +++ b/tensorlayer/layers/recurrent.py @@ -247,10 +247,8 @@ class RNN(Layer): "but got an actual length of a sequence %d" % i ) - ''' - Since sequence_length is not passed into computational graph when build a static model, we force sequence_length to be not None to get dynamic RNN. - We test this code that sequence_length is not passed to the model whatever it is, which induce a lower accuracy for training and validation - ''' + # Since sequence_length is not passed into computational graph when build a static model, we force sequence_length to be not None to get dynamic RNN. + # We test this code that sequence_length is not passed to the model whatever it is, which induce a lower accuracy for training and validation sequence_length = tl.layers.retrieve_seq_length_op3(inputs) sequence_length = [i - 1 if i >= 1 else 0 for i in sequence_length]
Update recurrent.py fix yapf
tensorlayer_tensorlayer
train
py
86c6cc358ddd926bc38836f501acde2c9bf67cc9
diff --git a/audioread/ffdec.py b/audioread/ffdec.py index <HASH>..<HASH> 100644 --- a/audioread/ffdec.py +++ b/audioread/ffdec.py @@ -70,6 +70,8 @@ class QueueReaderThread(threading.Thread): # Stream closed (EOF). break +# Windows error switch is global, we need a lock to ensure thread safety +windows_error_mode_lock = threading.Lock() class FFmpegAudioFile(object): """An audio file decoded by the ffmpeg command-line utility.""" @@ -79,6 +81,7 @@ class FFmpegAudioFile(object): # disables this behavior. windows = sys.platform.startswith("win") if windows: + windows_error_mode_lock.acquire() SEM_NOGPFAULTERRORBOX = 0x0002 import ctypes # We call SetErrorMode in two steps to avoid overriding @@ -103,9 +106,11 @@ class FFmpegAudioFile(object): # back now because the flag was inherited by the subprocess; # we don't need to keep it set in the parent process.) if windows: - import ctypes - ctypes.windll.kernel32.SetErrorMode(previous_error_mode) - + try: + import ctypes + ctypes.windll.kernel32.SetErrorMode(previous_error_mode) + finally: + windows_error_mode_lock.release() # Start another thread to consume the standard output of the # process, which contains raw audio data. self.stdout_reader = QueueReaderThread(self.proc.stdout, block_size)
ensure thread safety for SetErrorMode
beetbox_audioread
train
py
5ec1acac44a49e783cf69e41ae5404204131f173
diff --git a/lib/will_paginate/view_helpers.rb b/lib/will_paginate/view_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/will_paginate/view_helpers.rb +++ b/lib/will_paginate/view_helpers.rb @@ -140,7 +140,7 @@ module WillPaginate end def self.total_pages_for_collection(collection) #:nodoc: - if collection.respond_to? :page_count and !collection.respond_to? :total_pages + if collection.respond_to?('page_count') and !collection.respond_to?('total_pages') WillPaginate::Deprecation.warn <<-MSG You are using a paginated collection of class #{collection.class.name} which conforms to the old API of WillPaginate::Collection by using
use strings in "respond_to?" calls to work around a bug in acts_as_ferret stable (ugh)
mislav_will_paginate
train
rb
64dee20ff48adec6b3606bbe2b06f7dc27a1e75c
diff --git a/smartmin/views.py b/smartmin/views.py index <HASH>..<HASH> 100644 --- a/smartmin/views.py +++ b/smartmin/views.py @@ -46,7 +46,6 @@ class SmartView(object): exclude = None field_config = {} title = None - permission = None refresh = 0 template_name = None @@ -82,7 +81,7 @@ class SmartView(object): self.args = args self.request = request - if not self.permission: + if not getattr(self, 'permission', None): return True else: # first check our anonymous permissions @@ -118,7 +117,7 @@ class SmartView(object): if obj_getter: obj = obj_getter() if obj: - return self.request.user.has_perm(self.permission, obj) + return self.request.user.has_perm(getattr(self, 'permission', None), obj) def dispatch(self, request, *args, **kwargs): """
Handled the permission for actions inheritance issue
nyaruka_smartmin
train
py
10ce584026815c7347fe66f2a6bc58897084c254
diff --git a/sprd/model/Product.js b/sprd/model/Product.js index <HASH>..<HASH> 100644 --- a/sprd/model/Product.js +++ b/sprd/model/Product.js @@ -24,7 +24,11 @@ define(['sprd/model/ProductBase', 'js/core/List', 'sprd/data/ConfigurationTypeRe type: Price, generated: true }, - creator: String + creator: String, + templateId: { + type: String, + required: false + } }, defaults: {
DEV-<I> - Tracking to identify how many templates are sold
spreadshirt_rAppid.js-sprd
train
js
0f1ae75dd8d8f27d4f4356ddb589ccd84fdd9b4e
diff --git a/forms/UploadField.php b/forms/UploadField.php index <HASH>..<HASH> 100644 --- a/forms/UploadField.php +++ b/forms/UploadField.php @@ -933,8 +933,8 @@ class UploadField extends FileField { Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js'); - Requirements::javascript(FRAMEWORK_DIR . '/javascript/i18n.js'); Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js'); + Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang'); Requirements::combine_files('uploadfield.js', array( // @todo jquery templates is a project no longer maintained and should be retired at some point.
Correct JS i<I>n in UploadField (fixes #<I>)
silverstripe_silverstripe-framework
train
php
d2f937ce79f8761b49b6c3721a81c141841b4a93
diff --git a/htdocs/js/console.js b/htdocs/js/console.js index <HASH>..<HASH> 100644 --- a/htdocs/js/console.js +++ b/htdocs/js/console.js @@ -42,6 +42,8 @@ function getAlerts(service, filter, refresh) { var sev_id = '#' + service; + val.severityCounts.normal = val.severityCounts.normal + val.severityCounts.inform; + $.each(val.severityCounts, function(sev, count) { $(sev_id + "-" + sev).text(count);
Inform alerts now contribute to Normal count in console
alerta_alerta
train
js
1f744b31a4bea4258c13811296e1257638efe937
diff --git a/registry/consul/watcher.go b/registry/consul/watcher.go index <HASH>..<HASH> 100644 --- a/registry/consul/watcher.go +++ b/registry/consul/watcher.go @@ -224,9 +224,14 @@ func (cw *consulWatcher) handle(idx uint64, data interface{}) { cw.RUnlock() // remove unknown services from registry + // save the things we want to delete + deleted := make(map[string][]*registry.Service) + for service, _ := range rservices { if _, ok := services[service]; !ok { cw.Lock() + // save this before deleting + deleted[service] = cw.services[service] delete(cw.services, service) cw.Unlock() } @@ -237,6 +242,11 @@ func (cw *consulWatcher) handle(idx uint64, data interface{}) { if _, ok := services[service]; !ok { w.Stop() delete(cw.watchers, service) + for _, oldService := range deleted[service] { + // send a delete for the service nodes that we're removing + cw.next <- &registry.Result{Action: "delete", Service: oldService} + } + // sent the empty list as the last resort to indicate to delete the entire service cw.next <- &registry.Result{Action: "delete", Service: &registry.Service{Name: service}} } }
Return the dead node when deleting the service
micro_go-micro
train
go
942724238fee5f2fe7480df3a7fbf033dcda6ce9
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index <HASH>..<HASH> 100755 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -171,7 +171,7 @@ // flatten the hierarchical stack, and insert <section data-markdown> tags for( var i = 0, len = sectionStack.length; i < len; i++ ) { // vertical - if( sectionStack[i].propertyIsEnumerable( 'length' ) && typeof sectionStack[i].splice === 'function' ) { + if( sectionStack[i] instanceof Array ) { markdownSections += '<section '+ options.attributes +'>'; sectionStack[i].forEach( function( child ) {
better check for arrays in markdown plugin
hakimel_reveal.js
train
js
feb316ccd0e6cc1ac62ab6cce481e427a781b8c7
diff --git a/src/com/esotericsoftware/reflectasm/AccessClassLoader.java b/src/com/esotericsoftware/reflectasm/AccessClassLoader.java index <HASH>..<HASH> 100644 --- a/src/com/esotericsoftware/reflectasm/AccessClassLoader.java +++ b/src/com/esotericsoftware/reflectasm/AccessClassLoader.java @@ -10,11 +10,15 @@ class AccessClassLoader extends ClassLoader { static AccessClassLoader get (Class type) { ClassLoader parent = type.getClassLoader(); - for (int i = 0, n = accessClassLoaders.size(); i < n; i++) { - AccessClassLoader accessClassLoader = accessClassLoaders.get(i); - if (accessClassLoader.getParent() == parent) return accessClassLoader; + synchronized (accessClassLoaders) { + for (int i = 0, n = accessClassLoaders.size(); i < n; i++) { + AccessClassLoader accessClassLoader = accessClassLoaders.get(i); + if (accessClassLoader.getParent() == parent) return accessClassLoader; + } + AccessClassLoader accessClassLoader = new AccessClassLoader(parent); + accessClassLoaders.add(accessClassLoader); + return accessClassLoader; } - return new AccessClassLoader(parent); } private AccessClassLoader (ClassLoader parent) {
Fixed issue 6, AccessClassLoader not tracking instances properly, not synchronized.
EsotericSoftware_reflectasm
train
java
1a99e7b7f4b7f220c515a2db41145129f4e8393f
diff --git a/packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.test.js b/packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.test.js index <HASH>..<HASH> 100644 --- a/packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.test.js +++ b/packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.test.js @@ -37,7 +37,7 @@ test('vanilla: navigator.platform set to host platform', async t => { const platform = await page.evaluate(() => navigator.platform) switch (process.platform) { case 'linux': - t.true(platform === 'Linux') + t.true(platform.includes('Linux')) // TravisCI break case 'darwin': t.true(platform === 'MacIntel')
chore(plugin-stealth): Fix tests for TravisCI
berstend_puppeteer-extra
train
js
921b94be0fd814df5cfb9235b6ee2c2b6ddae9eb
diff --git a/lib/gym/detect_values.rb b/lib/gym/detect_values.rb index <HASH>..<HASH> 100644 --- a/lib/gym/detect_values.rb +++ b/lib/gym/detect_values.rb @@ -24,6 +24,8 @@ module Gym config.load_configuration_file(Gym.gymfile_name) end + config[:use_legacy_build_api] = true if Xcode.pre_7? + detect_scheme detect_platform # we can only do that *after* we have the scheme detect_configuration diff --git a/lib/gym/generators/package_command_generator.rb b/lib/gym/generators/package_command_generator.rb index <HASH>..<HASH> 100644 --- a/lib/gym/generators/package_command_generator.rb +++ b/lib/gym/generators/package_command_generator.rb @@ -26,7 +26,7 @@ module Gym # The generator we need to use for the currently used Xcode version def generator - if Xcode.pre_7? or Gym.config[:use_legacy_build_api] + if Gym.config[:use_legacy_build_api] PackageCommandGeneratorLegacy else PackageCommandGeneratorXcode7
Automatic setting of legacy_build_api when using an old version of Xcode
fastlane_fastlane
train
rb,rb
f90382dc21f786693abb46f3b22a4786e9f21193
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -67,7 +67,7 @@ export default function PrerenderLoader (content) { // @note: this is only used when the entry module exports a String or function // that resolves to a String, otherwise the whole document is serialized. let inject = false; - if (!this.request.match(/.(js|ts)x?$/i)) { + if (!this.request.match(/\.(js|ts)x?$/i)) { const matches = content.match(PRERENDER_REG); if (matches) { inject = true;
Fix detection of if the loaded resource can be a JSDOM template Previous regexp has an unescaped dot at the beginning (`/.(js|ts)x?$/i`) and this regexp matched against files .ejs, that are actually html.
GoogleChromeLabs_prerender-loader
train
js
3c292c48359eb756a48d61006fa3678720eb582a
diff --git a/dependencies/_operation.py b/dependencies/_operation.py index <HASH>..<HASH> 100644 --- a/dependencies/_operation.py +++ b/dependencies/_operation.py @@ -6,6 +6,8 @@ from .exceptions import DependencyError def operation(function): """FIXME: Write a docstring.""" + if inspect.isclass(function): + raise DependencyError("'operation' decorator can not be used on classes") __init__ = make_init(function) return type("Operation", (object,), {"__init__": __init__, "__call__": __call__}) diff --git a/tests/test_operation.py b/tests/test_operation.py index <HASH>..<HASH> 100644 --- a/tests/test_operation.py +++ b/tests/test_operation.py @@ -31,6 +31,21 @@ def test_protect_against_self(): assert str(exc_info.value) == "'operation' decorator can not be used on methods" +def test_protect_against_classes(): + """ + Deny to decorate classes with operation. Classes are injectable + itself. + """ + + with pytest.raises(DependencyError) as exc_info: + + @operation + class Foo(object): + pass + + assert str(exc_info.value) == "'operation' decorator can not be used on classes" + + # TODO: Raise exception if we try to decorate a class. # # TODO: Operation representation with the name of the function.
Deny operation decorator against classes.
dry-python_dependencies
train
py,py
8675d9ef67c8210e64a28e45260bfbd90e1e3c0f
diff --git a/lib/spade.js b/lib/spade.js index <HASH>..<HASH> 100644 --- a/lib/spade.js +++ b/lib/spade.js @@ -218,12 +218,8 @@ exports.Spade = ( function () { return cocker.bye(); } me.emit( 'authorized', password, reply, address ); - if ( ~ db ) { - // db === -1, on reconnection no SELECT. - processCommandQueue( address ); - } else { - sendSelect( address, db ); - } + // when db === -1, on reconnection send no SELECT. + return ~ db ? processCommandQueue( address ) : sendSelect( address, db ); } , auth = encode( 'AUTH', password, null, onAuthReply ); // set special command shortcut
less code for sendAuth.. On branch master modified: lib/spade.js
rootslab_spade
train
js
232512a221b06b0577b918efc7e0b9b3a59194fd
diff --git a/classes/Boom/Model/Page/Version.php b/classes/Boom/Model/Page/Version.php index <HASH>..<HASH> 100644 --- a/classes/Boom/Model/Page/Version.php +++ b/classes/Boom/Model/Page/Version.php @@ -165,6 +165,8 @@ class Boom_Model_Page_Version extends ORM ->set('published', TRUE) ->set('embargoed_until', $time) ->save(); + + return $this; } /**
Bugfix: Model_Page_Version::embargo() wasn't returning itself
boomcms_boom-core
train
php
8ce05ede64f5691c4a7c2766e8a30d8deb7a919b
diff --git a/src/GAuth/Auth.php b/src/GAuth/Auth.php index <HASH>..<HASH> 100644 --- a/src/GAuth/Auth.php +++ b/src/GAuth/Auth.php @@ -56,7 +56,7 @@ class Auth { $this->buildLookup(); - if ($initKey !== false) { + if ($initKey !== null) { $this->setInitKey($initKey); } }
fixing check for init key inside constructor
enygma_gauth
train
php
b87c449d71fcc43be7b75738835cde6dba4bb609
diff --git a/test/unit/access-suite.js b/test/unit/access-suite.js index <HASH>..<HASH> 100644 --- a/test/unit/access-suite.js +++ b/test/unit/access-suite.js @@ -5,8 +5,8 @@ define(['requirejs', 'fs'], function(requirejs, fs, undefined) { var suites = []; suites.push({ - name: "util.js tests", - desc: "a collection of tests for util.js", + name: "access", + desc: "access knows all about the scope we claimed and which paths that gives us access to", setup: function(env, test) { requirejs(['./src/lib/access'], function(Access) { env.Access = Access;
access tests: corrected name & desc
remotestorage_remotestorage.js
train
js
8450e4ed2102ba8bcd17e7d2ee41087dc6d965ec
diff --git a/lib/scrolls/log.rb b/lib/scrolls/log.rb index <HASH>..<HASH> 100644 --- a/lib/scrolls/log.rb +++ b/lib/scrolls/log.rb @@ -245,13 +245,7 @@ module Scrolls def write(data) if log_level_ok?(data[:level]) msg = unparse(data) - mtx.synchronize do - begin - stream.puts(msg) - rescue NoMethodError => e - raise - end - end + stream.print(msg + "\n") end end
print is atomic instead of mutex so it works in threaded environs
asenchi_scrolls
train
rb
433d2068896d676bcb58ad529c11dbe8f7b05196
diff --git a/malcolm/modules/excalibur/parts/femdriverpart.py b/malcolm/modules/excalibur/parts/femdriverpart.py index <HASH>..<HASH> 100644 --- a/malcolm/modules/excalibur/parts/femdriverpart.py +++ b/malcolm/modules/excalibur/parts/femdriverpart.py @@ -10,4 +10,4 @@ class FemDriverPart(StatefulChildPart): def report_configuration(self, context): child = context.block_view(self.params.mri) return [ - NDArrayDatasetInfo(rank=2), UniqueIdInfo(child.arrayCounterReadback.value)] + NDArrayDatasetInfo(rank=2), UniqueIdInfo(child.arrayCounter.value)]
Made excalibur fem driver use array counter rather than readback since it deals with config, not state
dls-controls_pymalcolm
train
py