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
1e4fb88d07791e4b6c6673a1487421698c55e80a
diff --git a/src/Di/ClassInspector.php b/src/Di/ClassInspector.php index <HASH>..<HASH> 100644 --- a/src/Di/ClassInspector.php +++ b/src/Di/ClassInspector.php @@ -36,7 +36,7 @@ class ClassInspector if ($method === '__construct') { return $dependencies; } - throw new MethodNotFoundException($class, $method); + throw new MethodNotFoundException($r->getName(), $method); } $rp = $r->getMethod($method)->getParameters();
fix bug where MethodNotFoundException was not created correctly
peakphp_framework
train
php
5dd38792a82e1f7bb0579263e8854a8b373371e4
diff --git a/runtime/v2/shim/util_unix.go b/runtime/v2/shim/util_unix.go index <HASH>..<HASH> 100644 --- a/runtime/v2/shim/util_unix.go +++ b/runtime/v2/shim/util_unix.go @@ -30,6 +30,7 @@ import ( "syscall" "time" + "github.com/containerd/containerd/defaults" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/dialer" "github.com/containerd/containerd/sys" @@ -63,7 +64,7 @@ func AdjustOOMScore(pid int) error { return nil } -const socketRoot = "/run/containerd" +const socketRoot = defaults.DefaultStateDir // SocketAddress returns a socket address func SocketAddress(ctx context.Context, socketPath, id string) (string, error) {
darwin: use the default values for socketRoot variable Since the /run directory on macOS is read-only, darwin containerd should use a different directory. Use the pre-defined default values instead to avoid this issue. Fixes: bd<I>acab ("Use path based unix socket for shims")
containerd_containerd
train
go
4b057f07e18406e0a777d18938cb57f16a73d508
diff --git a/content/article.go b/content/article.go index <HASH>..<HASH> 100644 --- a/content/article.go +++ b/content/article.go @@ -55,7 +55,6 @@ type Article interface { Extract() ArticleExtract } -// TODO: merge with Article type ScoredArticle interface { Article
scores aren't used often enough to justify another join
urandom_readeef
train
go
f52af251937e3e763817499df1136b43ab16c706
diff --git a/lib/sy/quantity.rb b/lib/sy/quantity.rb index <HASH>..<HASH> 100644 --- a/lib/sy/quantity.rb +++ b/lib/sy/quantity.rb @@ -449,7 +449,9 @@ class SY::Quantity ɴλ.call % "Unit" # as for @Magnitude applies.) end end - end.namespace! SY::Unit + end.tap do |unit_parametrized_subclass| + unit_parametrized_subclass.namespace = SY::Unit + end end ).tap do |u| puts "@Unit constructed, its namespace is #{u.namespace}" if SY::DEBUG puts "its instances are #{u.namespace.instances}" if SY::DEBUG diff --git a/lib/sy/version.rb b/lib/sy/version.rb index <HASH>..<HASH> 100644 --- a/lib/sy/version.rb +++ b/lib/sy/version.rb @@ -1,5 +1,5 @@ module SY - VERSION = "2.0.9" + VERSION = "2.0.14" DEBUG = false # debug mode switch - sometimes there are lines like # puts "something" if SY::DEBUG end
adapting to y_support/name_magic change
boris-s_sy
train
rb,rb
ab6d18f89cb499f4737fcfde926a4e24c900249e
diff --git a/modelcluster/fields.py b/modelcluster/fields.py index <HASH>..<HASH> 100644 --- a/modelcluster/fields.py +++ b/modelcluster/fields.py @@ -62,7 +62,11 @@ def create_deferring_foreign_related_manager(related, original_manager_cls): try: results = self.instance._cluster_related_objects[relation_name] except (AttributeError, KeyError): - return self.get_live_queryset() + if self.instance.pk is None: + # use an empty fake queryset if the instance is unsaved + results = [] + else: + return self.get_live_queryset() return FakeQuerySet(related.related_model, results) @@ -105,7 +109,10 @@ def create_deferring_foreign_related_manager(related, original_manager_cls): try: object_list = cluster_related_objects[relation_name] except KeyError: - object_list = list(self.get_live_queryset()) + if self.instance.pk is None: + object_list = [] + else: + object_list = list(self.get_live_queryset()) cluster_related_objects[relation_name] = object_list return object_list
Avoid accessing live queryset on unsaved instances In cases where a DeferringRelatedManager was read on an in-memory instance before being written to, it was accessing the real manager on an unsaved instance. This was tolerated up to Django <I>, but it's a hard fail as of <URL>
wagtail_django-modelcluster
train
py
4e63cbe2430c36dc3910cf42471cb0be314b1e2b
diff --git a/spec/public/reloading/directory/app/controllers/reload.rb b/spec/public/reloading/directory/app/controllers/reload.rb index <HASH>..<HASH> 100644 --- a/spec/public/reloading/directory/app/controllers/reload.rb +++ b/spec/public/reloading/directory/app/controllers/reload.rb @@ -1,7 +1,6 @@ - - class Reloader < Application - end +class Reloader < Application +end - class Hello < Application - end \ No newline at end of file +class Hello < Application +end
merge hcatlins doc patches, \m/
wycats_merb
train
rb
c0cdc7ebeae31e16eac11c759fdca1f7f12ad252
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -773,9 +773,9 @@ FSWatcher.prototype._addToFsEvents = function(file, pathTransform) { _this._readyCount++; _this._addToFsEvents(linkPath, function(path) { var ds = '.' + sysPath.sep; - return linkPath && linkPath !== ds ? + return pathTransform(linkPath && linkPath !== ds ? path.replace(linkPath, entryPath) : - path === ds ? entryPath : sysPath.join(entryPath, path); + path === ds ? entryPath : sysPath.join(entryPath, path)); }); } else if (linkStats.isFile()) { processEntry();
Adjust paths of nested symlinks gh-<I>
paulmillr_chokidar
train
js
a7606fb6764bda685654c15cbc7a087e68b17a9a
diff --git a/core/server/master/src/test/java/alluxio/master/AlluxioMasterProcessTest.java b/core/server/master/src/test/java/alluxio/master/AlluxioMasterProcessTest.java index <HASH>..<HASH> 100644 --- a/core/server/master/src/test/java/alluxio/master/AlluxioMasterProcessTest.java +++ b/core/server/master/src/test/java/alluxio/master/AlluxioMasterProcessTest.java @@ -230,6 +230,10 @@ public final class AlluxioMasterProcessTest { waitForServing(ServiceType.MASTER_WEB); assertTrue(isBound(mRpcPort)); assertTrue(isBound(mWebPort)); + boolean testMode = ServerConfiguration.getBoolean(PropertyKey.TEST_MODE); + ServerConfiguration.set(PropertyKey.TEST_MODE, false); + master.waitForReady(5000); + ServerConfiguration.set(PropertyKey.TEST_MODE, testMode); master.stop(); assertFalse(isBound(mRpcPort)); assertFalse(isBound(mWebPort));
Fix test startStopPrimary failure from time to time Fix test startStopPrimary failure from time to time pr-link: Alluxio/alluxio#<I> change-id: cid-<I>fa<I>be<I>d5f9dd<I>c<I>f<I>d<I>ca<I>b2
Alluxio_alluxio
train
java
07483cda5bd160ba90b5e686eb15a0c82d55209b
diff --git a/src/main/java/org/telegram/botapi/api/internal/chat/updates/RequestUpdatesManager.java b/src/main/java/org/telegram/botapi/api/internal/chat/updates/RequestUpdatesManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/telegram/botapi/api/internal/chat/updates/RequestUpdatesManager.java +++ b/src/main/java/org/telegram/botapi/api/internal/chat/updates/RequestUpdatesManager.java @@ -30,8 +30,8 @@ public class RequestUpdatesManager extends UpdateManager { super(telegramBot); - new Thread(new UpdaterRunnable(this)).start(); eventManager = (ListenerRegistryImpl) telegramBot.getEventsManager(); + new Thread(new UpdaterRunnable(this)).start(); } public UpdateMethod getUpdateMethod() { @@ -72,6 +72,8 @@ public class RequestUpdatesManager extends UpdateManager { Update update = UpdateImpl.createUpdate(updates.getJSONObject(i)); + System.out.println(update.getMessage().getContent().getType()); + eventManager.callEvent(new MessageReceivedEvent(update.getMessage())); switch(update.getMessage().getContent().getType()) {
Set updateManager variable before starting update thread.
zackpollard_JavaTelegramBot-API
train
java
44c8746d8cd16fca91d3681f29478785dea0cbbd
diff --git a/defender/test_settings.py b/defender/test_settings.py index <HASH>..<HASH> 100644 --- a/defender/test_settings.py +++ b/defender/test_settings.py @@ -29,6 +29,13 @@ INSTALLED_APPS = [ 'defender', ] +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + }, +] + SECRET_KEY = os.environ.get('SECRET_KEY', 'too-secret-for-test') LOGIN_REDIRECT_URL = '/admin' diff --git a/defender/travis_settings.py b/defender/travis_settings.py index <HASH>..<HASH> 100644 --- a/defender/travis_settings.py +++ b/defender/travis_settings.py @@ -29,6 +29,13 @@ INSTALLED_APPS = [ 'defender', ] +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + }, +] + SECRET_KEY = os.environ.get('SECRET_KEY', 'too-secret-for-test') LOGIN_REDIRECT_URL = '/admin'
Templates settings as recommended from Django <I>
kencochrane_django-defender
train
py,py
36c041615fd03ef142032f87c027715794c0b902
diff --git a/elpy/jedibackend.py b/elpy/jedibackend.py index <HASH>..<HASH> 100644 --- a/elpy/jedibackend.py +++ b/elpy/jedibackend.py @@ -215,6 +215,12 @@ def run_with_debug(jedi, name, *args, **kwargs): # Bug in Python 2.6, see #275 if isinstance(e, OSError) and e.errno == 13: return None + # Bug jedi#466 + if ( + isinstance(e, SyntaxError) and + "EOL while scanning string literal" in str(e) + ): + return None from jedi import debug diff --git a/elpy/tests/support.py b/elpy/tests/support.py index <HASH>..<HASH> 100644 --- a/elpy/tests/support.py +++ b/elpy/tests/support.py @@ -215,6 +215,14 @@ x._|_ self.rpc(filename, source, offset) + def test_should_not_fail_on_literals(self): + # Bug #344 / jedi#466 + source = u'lit = u"""\\\n# -*- coding: utf-8 -*-\n"""\n' + offset = 0 + filename = self.project_file("project.py", source) + + self.rpc(filename, source, offset) + class RPCGetCompletionsTests(GenericRPCTests): METHOD = "rpc_get_completions"
Catch a SyntaxError from Jedi. This is a workaround for a bug in Jedi. Fixes #<I>.
jorgenschaefer_elpy
train
py,py
8093378d76ccf2ea0bffd0abde526574b4743d57
diff --git a/lib/components/form/default-search-form.js b/lib/components/form/default-search-form.js index <HASH>..<HASH> 100644 --- a/lib/components/form/default-search-form.js +++ b/lib/components/form/default-search-form.js @@ -26,7 +26,7 @@ export default class DefaultSearchForm extends Component { render () { const { icons, mobile } = this.props - const actionText = mobile ? 'long press' : 'right-click' + const actionText = mobile ? 'tap' : 'click' return ( <div>
fix(form): Update placeholder language in location field to reflect new mouse/tap interaction Refs conveyal/trimet-mod-otp#<I>
opentripplanner_otp-react-redux
train
js
a7e82b8a52c47164b1df22d8f7845e5a479e2d95
diff --git a/src/Record.php b/src/Record.php index <HASH>..<HASH> 100755 --- a/src/Record.php +++ b/src/Record.php @@ -255,6 +255,26 @@ class Record extends Origin implements IteratorAggregate } /** + * Update all data in Record + * + * @param array $public + * @param array $private + * @return Record + * @throws SimplesRecordReadonlyError + */ + public function update(array $public, array $private = []): Record + { + if ($this->isEditable()) { + $this->public = $public; + if (count($private)) { + $this->private = $private; + } + return $this; + } + return static::make($public, $this->isEditable(), $this->mutations, $this->private); + } + + /** * Get the name of properties managed by Record * @param array $except * @return array
New method update to override all data into record
phpzm_data
train
php
0143305d5cfdef450db8df5d592ba931e6fed905
diff --git a/informationminer/__init__.py b/informationminer/__init__.py index <HASH>..<HASH> 100644 --- a/informationminer/__init__.py +++ b/informationminer/__init__.py @@ -5,4 +5,4 @@ The ClassifierBasedGermanTagger can be used for POS-Tagging on the German langua from .InformationMiner import InformationMiner from .ClassifierBasedGermanTagger import ClassifierBasedGermanTagger from .POSTagger import tag - +__version__ = '1.6' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,12 +2,12 @@ from distutils.core import setup setup( name = 'informationminer', packages = ['informationminer'], - version = '1.3', + version = '1.6', description = 'Automatically performs NLP techniques. Currently supports German and English language.', author = 'Richard Polzin', author_email = 'polzin.richard@gmail.com', url = 'https://github.com/deastiny/informationminer', - download_url = 'https://github.com/DeastinY/informationminer/archive/1.3.tar.gz', + download_url = 'https://github.com/DeastinY/informationminer/archive/1.6.tar.gz', keywords = ['NLP', 'POS', 'NER', 'NLTK'], classifiers = [], include_package_data = True,
Trying to figure out PyPI updates
DeastinY_informationminer
train
py,py
f6799ce847782e9b027f1bd55e777a391188064d
diff --git a/test/net/fortuna/ical4j/model/property/ExDateTest.java b/test/net/fortuna/ical4j/model/property/ExDateTest.java index <HASH>..<HASH> 100644 --- a/test/net/fortuna/ical4j/model/property/ExDateTest.java +++ b/test/net/fortuna/ical4j/model/property/ExDateTest.java @@ -73,6 +73,7 @@ public class ExDateTest extends TestCase { protected void tearDown() throws Exception { CompatibilityHints.setHintEnabled( CompatibilityHints.KEY_RELAXED_UNFOLDING, false); + CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING, false); } /**
Reset compatibility flags on test completion
ical4j_ical4j
train
java
096ca5ba41251ceddb341cb33fa92ca3d4fd30be
diff --git a/sk/passwords.php b/sk/passwords.php index <HASH>..<HASH> 100644 --- a/sk/passwords.php +++ b/sk/passwords.php @@ -21,6 +21,6 @@ return [ "sent" => "Pripomienka k zmene hesla bola odoslaná!", - "reset" => "Password has been reset!", + "reset" => "Heslo bolo zmenené!", ];
Translated key "reset" to slovak
caouecs_Laravel-lang
train
php
4c7a1d57eef5394b9fc579578217cb7014460c30
diff --git a/src/Message/SecureXMLAbstractRequest.php b/src/Message/SecureXMLAbstractRequest.php index <HASH>..<HASH> 100644 --- a/src/Message/SecureXMLAbstractRequest.php +++ b/src/Message/SecureXMLAbstractRequest.php @@ -65,7 +65,7 @@ abstract class SecureXMLAbstractRequest extends AbstractRequest $xml = new \SimpleXMLElement('<SecurePayMessage/>'); $messageInfo = $xml->addChild('MessageInfo'); - $messageInfo->addChild('messageID', $this->getMessageId()); + $messageInfo->messageID = $this->getMessageId(); $messageInfo->addChild('messageTimestamp', $this->generateTimestamp()); $messageInfo->addChild('timeoutValue', 60); $messageInfo->addChild('apiVersion', 'xml-4.2'); @@ -98,7 +98,7 @@ abstract class SecureXMLAbstractRequest extends AbstractRequest $transaction->addChild('txnSource', 23); // Must always be 23 for SecureXML. $transaction->addChild('amount', $this->getAmountInteger()); $transaction->addChild('currency', $this->getCurrency()); - $transaction->addChild('purchaseOrderNo', $this->getTransactionId()); + $transaction->purchaseOrderNo = $this->getTransactionId(); return $xml; }
Always encode entities in messageID and purchaseOrderNo This fixes an issue where a client submitting a transaction containing a purchaseOrderNo with an ampersand in it resulted in an 'unterminated entity reference' exception. Turns out that in SimpleXML 'addChild' doesn't encode entities however when assigning the value directly it does.
thephpleague_omnipay-securepay
train
php
7e9fc9f7051c075a837cb7cbb635b2e838e84f7e
diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2591,7 +2591,9 @@ class I18nTest extends CakeTestCase { function testTimeDefinition() { Configure::write('Config.language', 'po'); - $abday = __c('abday', 5, true); + $result = __c('d_fmt', 5, true); + $expected = '%m/%d/%Y'; + $this->assertEqual($result,$expected); } /**
Test case for date format definition using a LC_TIME locale file
cakephp_cakephp
train
php
82c8e0b1487141a39aad7eef1cb59126ca71d233
diff --git a/example.js b/example.js index <HASH>..<HASH> 100644 --- a/example.js +++ b/example.js @@ -2,6 +2,7 @@ var xml = require('xml4node'); var dual = require('./index'); var _ = require('underscore'); +var EventEmitter = require('events').EventEmitter; var exampleHost = function () { @@ -27,7 +28,36 @@ var exampleHost = function () { var hostA = exampleHost(); var hostB = exampleHost(); -hostA.serve(hostB); +if (true) { + var socket = (function () { + + var sideA = new EventEmitter(); + var sideB = new EventEmitter(); + + _.extend(sideA, { + trigger: function () { + sideB.emit.apply(sideB, arguments); + } + }); + + _.extend(sideB, { + trigger: function () { + sideA.emit.apply(sideA, arguments); + } + }); + + return { + sideA: sideA + , sideB: sideB; + } + })(); + + hostA.serve(socket.sideA); + hostB.serve(socket.sideB); +} +else { + hostA.serve(hostB); +} hostA.trigger('put', ['site', 'doc'], xml.elt('bands', [xml.elt('beatles'), xml.elt('doors')])); hostB.emit('get', ['site', 'doc', 'bands']);
Add an example where hosts are connected by a socket.
plediii_dual-protocol
train
js
161d784232d31bd324f3403c12dafd5d91c18033
diff --git a/jpx/src/main/java/io/jenetics/jpx/GPX.java b/jpx/src/main/java/io/jenetics/jpx/GPX.java index <HASH>..<HASH> 100644 --- a/jpx/src/main/java/io/jenetics/jpx/GPX.java +++ b/jpx/src/main/java/io/jenetics/jpx/GPX.java @@ -1805,7 +1805,6 @@ public final class GPX implements Serializable { } - /** * Return a GPX reader, reading GPX files with the given version and in the * given reading mode. @@ -1889,7 +1888,6 @@ public final class GPX implements Serializable { } - /** * Read an GPX object from the given {@code input} stream. This method is a * shortcut for @@ -1908,7 +1906,6 @@ public final class GPX implements Serializable { } - /** * Read an GPX object from the given {@code input} stream. This method is a * shortcut for
#<I>: Some code formatting.
jenetics_jpx
train
java
28cb8b9e001b87b85fc4657bc7a3766d250b4099
diff --git a/utils/eslint-config/index.js b/utils/eslint-config/index.js index <HASH>..<HASH> 100644 --- a/utils/eslint-config/index.js +++ b/utils/eslint-config/index.js @@ -4,7 +4,7 @@ * @see http://eslint.org/docs/user-guide/configuring.html */ -/* eslint-disable sort-keys */ +/* eslint-disable @typescript-eslint/no-magic-numbers, sort-keys */ 'use strict'; @@ -261,6 +261,7 @@ module.exports = { '*.test.tsx', ], // `extends` aren't allowed in overrides so inject the config manually + // eslint-disable-next-line @typescript-eslint/ban-ts-ignore // @ts-ignore - We don't need types here ...require('eslint-plugin-jest').configs.recommended, // eslint-disable-line global-require plugins: ['jest', 'import'], @@ -268,6 +269,7 @@ module.exports = { jest: true, }, rules: { + '@typescript-eslint/no-magic-numbers': OFF, // too verbose for short unit tests 'import/no-extraneous-dependencies': [ ERROR, {
Tweak lint rules
WeAreGenki_minna-ui
train
js
6b5b59ee0ed83e9dd4b7dfa95a09d79e5cdc1977
diff --git a/insights/client/__init__.py b/insights/client/__init__.py index <HASH>..<HASH> 100644 --- a/insights/client/__init__.py +++ b/insights/client/__init__.py @@ -535,9 +535,10 @@ def pre_update(): updated = InsightsSchedule().remove_scheduling() if updated: logger.info('Automatic scheduling for Insights has been disabled.') - elif not os.path.exists('/etc/cron.daily/' + constants.app_name): + elif not os.path.exists('/etc/cron.daily/' + constants.app_name) and not config['register']: logger.info('Automatic scheduling for Insights already disabled.') - die() + if not config['register']: + die() if config['container_mode']: logger.debug('Not scanning host.') @@ -600,7 +601,7 @@ def post_update(): if config['register']: client.try_register() - if os.path.exists('/etc/cron.daily') and InsightsSchedule().set_daily(): + if not config['disable_schedule'] and os.path.exists('/etc/cron.daily') and InsightsSchedule().set_daily(): logger.info('Automatic scheduling for Insights has been enabled.') # check registration before doing any uploads
Fix disable schedule when registering (#<I>) The `--disable-schedule` flag can now be run alongside `--register` so that the registration will not automatically enable the cron job.
RedHatInsights_insights-core
train
py
46f723f4cc182c4f5316e4249dbe758ad46795e0
diff --git a/lib/navigator/menu.rb b/lib/navigator/menu.rb index <HASH>..<HASH> 100644 --- a/lib/navigator/menu.rb +++ b/lib/navigator/menu.rb @@ -84,9 +84,9 @@ module Navigator end end - def method_missing name, *positionals, **keywords, &block + def method_missing(name, *positionals, **keywords, &) if respond_to_missing? name - add(name, *positionals, **keywords, &block) + add(name, *positionals, **keywords, &) else template.public_send(name, *positionals, **keywords) || super end
Refactored implementation to use anonymous block forwarding Necessary to reduce typing and redundant code when we can use the shorthand anonymous block forwarding syntax introduced in Ruby <I>. These changes cause issues to crop up with the Rubocop Style/MethodDefParentheses cop which is why it's being disabled on certain methods. This issue has been logged with the Rubocop team and hopefully will be fixed soon.
bkuhlmann_navigator
train
rb
f6e4c1487323c62ffb4d9eaeabcf343b31342b38
diff --git a/restclients_core/util/mock.py b/restclients_core/util/mock.py index <HASH>..<HASH> 100644 --- a/restclients_core/util/mock.py +++ b/restclients_core/util/mock.py @@ -175,4 +175,4 @@ def attempt_open_query_permutations(url, orig_file_path, is_header_file): def _compare_file_name(orig_file_path, directory, filename): return (len(unquote(orig_file_path)) - len(unquote(directory)) == - len(filename)) + len(unquote(filename)))
Switching both sides of file comparison to unquoted
uw-it-aca_uw-restclients-core
train
py
8b5cb46006b2f28b6bac39802bb25d29f34d9efe
diff --git a/lib/anycable/rails/action_cable_ext/channel.rb b/lib/anycable/rails/action_cable_ext/channel.rb index <HASH>..<HASH> 100644 --- a/lib/anycable/rails/action_cable_ext/channel.rb +++ b/lib/anycable/rails/action_cable_ext/channel.rb @@ -3,13 +3,15 @@ require "action_cable/channel" ActionCable::Channel::Base.prepend(Module.new do - def subscribe_to_channel(force: false) - return if anycabled? && !force - super() + def subscribe_to_channel + super unless anycabled? && !@__anycable_subscribing__ end def handle_subscribe - subscribe_to_channel(force: true) + @__anycable_subscribing__ = true + subscribe_to_channel + ensure + @__anycable_subscribing__ = false end def start_periodic_timers
fix: do not change signatures in the channel patch
anycable_anycable-rails
train
rb
67eddd8101823bf97e2ed08d571cf6c13c675b25
diff --git a/core/editor.js b/core/editor.js index <HASH>..<HASH> 100644 --- a/core/editor.js +++ b/core/editor.js @@ -281,6 +281,10 @@ function convertHTML(blot, index, length, isRoot = false) { } const { outerHTML, innerHTML } = blot.domNode; const [start, end] = outerHTML.split(`>${innerHTML}<`); + // TODO cleanup + if (start === '<table') { + return `<table style="border: 1px solid #000;">${parts.join('')}<${end}`; + } return `${start}>${parts.join('')}<${end}`; } return blot.domNode.outerHTML;
workaround for copying table into other app
quilljs_quill
train
js
c1baf8225c77d7880a34a384e277a643fa050b52
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # python-quilt - A Python implementation of the quilt patch system # -# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com> +# Copyright (C) 2012, 2017 Björn Ricks <bjoern.ricks@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -20,7 +20,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA -from distutils.core import setup +from setuptools import setup import quilt
Use setuptools instead of distutils setuptools are the standard to install python packages now.
bjoernricks_python-quilt
train
py
0990363806c374b5c59df9b9f095364eff76f3e3
diff --git a/kibitzr/transformer/factory.py b/kibitzr/transformer/factory.py index <HASH>..<HASH> 100644 --- a/kibitzr/transformer/factory.py +++ b/kibitzr/transformer/factory.py @@ -47,7 +47,9 @@ class TransformPipeline(object): if ok: ok, content = transform(content) else: - content = self.on_error(content) + break + if not ok: + content = self.on_error(content) if content: content = content.strip() return ok, content diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def changelog_version(): setup( name='kibitzr', - version='4.0.2beta7', + version='4.0.2beta8', description="Self hosted web page changes monitoring", long_description=readme + '\n\n' + history, author="Peter Demin",
Fixed error reporting policy when no transforms defined
kibitzr_kibitzr
train
py,py
c244de3ab63aa58dc08da3b061918efbb9e2d5ab
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ setup( author_email="tjelvar.olsson@jic.ac.uk", url=url, install_requires=[ - "click", "dtoolcore>=2.4.0", ], entry_points={
Remove click requirment from setup.py
jic-dtool_dtool-symlink
train
py
64f69dae699553e7d4371b5573fd792c345c64d5
diff --git a/aiocqhttp/__init__.py b/aiocqhttp/__init__.py index <HASH>..<HASH> 100644 --- a/aiocqhttp/__init__.py +++ b/aiocqhttp/__init__.py @@ -183,6 +183,9 @@ class CQHttp: def run(self, host=None, port=None, *args, **kwargs): self._server_app.run(host=host, port=port, *args, **kwargs) + async def call_action(self, action: str, **params) -> Any: + return await self._api.call_action(action=action, **params) + def __getattr__(self, item) -> Callable: return self._api.__getattr__(item)
Add proxy for "call_action" method in CQHttp
richardchien_python-aiocqhttp
train
py
ce96d1e15be28ad1a81b4c46540bd3142c21b727
diff --git a/Form/Type/SecurityRolesType.php b/Form/Type/SecurityRolesType.php index <HASH>..<HASH> 100644 --- a/Form/Type/SecurityRolesType.php +++ b/Form/Type/SecurityRolesType.php @@ -57,7 +57,7 @@ class SecurityRolesType extends AbstractType }); // POST METHOD - $formBuilder->addEventListener(FormEvents::PRE_BIND, function(FormEvent $event) use ($transformer) { + $formBuilder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($transformer) { $transformer->setOriginalRoles($event->getForm()->getData()); });
Fix deprecated FormEvents::PRE_BIND usage
sonata-project_SonataUserBundle
train
php
0f93d6839e5ba984290c898199d9e1c4de0da4dd
diff --git a/lib/wiselinks/rendering.rb b/lib/wiselinks/rendering.rb index <HASH>..<HASH> 100644 --- a/lib/wiselinks/rendering.rb +++ b/lib/wiselinks/rendering.rb @@ -7,7 +7,9 @@ module Wiselinks protected - def render_with_wiselinks(options = {}, *args, &block) + def render_with_wiselinks(*args) + options = _normalize_render(*args) + if self.request.wiselinks? self.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate' self.headers['Pragma'] = 'no-cache' @@ -29,7 +31,7 @@ module Wiselinks end end - self.render_without_wiselinks(options, args, &block) + self.render_without_wiselinks(options) end end end
#4 undefined method for :check:Symbol
igor-alexandrov_wiselinks
train
rb
60d802d43db94df6b1da042677fe79771accbb1d
diff --git a/pylibdmtx/pylibdmtx.py b/pylibdmtx/pylibdmtx.py index <HASH>..<HASH> 100644 --- a/pylibdmtx/pylibdmtx.py +++ b/pylibdmtx/pylibdmtx.py @@ -195,7 +195,12 @@ def decode(image, timeout=None, gap_size=None, shrink=1, shape=None, elif 'numpy.ndarray' in str(type(image)): if 'uint8' != str(image.dtype): image = image.astype('uint8') - pixels = image.tobytes() + try: + pixels = image.tobytes() + except AttributeError: + # `numpy.ndarray.tobytes()` introduced in `numpy` 1.9.0 - use the + # older `tostring` method. + pixels = image.tostring() height, width = image.shape[:2] else: # image should be a tuple (pixels, width, height)
[#9] Reinstate numpy version check
NaturalHistoryMuseum_pylibdmtx
train
py
0b29048625d464625f81bb0b3eb5b32d67c2399f
diff --git a/lib/dpl/ctx/bash.rb b/lib/dpl/ctx/bash.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/ctx/bash.rb +++ b/lib/dpl/ctx/bash.rb @@ -410,9 +410,9 @@ module Dpl `git log #{git_sha} -n 1 --pretty=%ae`.chomp end - # Whether or not the git working directory is dirty + # Whether or not the git working directory is dirty or has new or deleted files def git_dirty? - !Kernel.system('git diff --quiet') + !`git status --short`.chomp.empty? end # Returns the output of `git log`, using the given args.
do not skip if new or only deleted files are present
travis-ci_dpl
train
rb
ab06b12e57f07a6984bd30cd4c32b6c7b1a081a9
diff --git a/gutenberg/gutenberg.py b/gutenberg/gutenberg.py index <HASH>..<HASH> 100644 --- a/gutenberg/gutenberg.py +++ b/gutenberg/gutenberg.py @@ -192,32 +192,3 @@ class EText(ORM_BASE): title=self.title, path=self.path, )) - - -def _main(): - """This function implements the main/script/command-line functionality of - the module and will be called from the `if __name__ == '__main__':` block. - - """ - import gutenberg.common.cliutil as cliutil - - doc = 'command line utilities to manage the Project Gutenberg corpus' - parser = cliutil.ArgumentParser(description=doc) - parser.add_argument('configfile', type=str, nargs='?', - help='path to corpus configuration file') - parser.add_argument('--download', action='store_true', - help='download more etexts') - parser.add_argument('--persist', action='store_true', - help='persist meta-data of etexts to database') - - with parser.parse_args() as args: - corpus = (GutenbergCorpus() if args.configfile is None - else GutenbergCorpus.using_config(args.configfile)) - if args.download: - corpus.download() - if args.persist: - corpus.persist() - - -if __name__ == '__main__': - _main()
Remove CLI functionality - use as module only
c-w_gutenberg
train
py
59fb3a74a5971b0ebe891f9e4fa2ea1c0c5ab539
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,7 @@ -from pip.req import parse_requirements +try: # for pip >= 10 + from pip._internal.req import parse_requirements +except ImportError: # for pip <= 9.0.3 + from pip.req import parse_requirements from setuptools import setup from setuptools import find_packages
pip <I> support.
socialwifi_sqlalchemy-postgres-autocommit
train
py
0c9dc6f895b1df857eb249ed49ba7344b7176c24
diff --git a/src/decorators/on.js b/src/decorators/on.js index <HASH>..<HASH> 100644 --- a/src/decorators/on.js +++ b/src/decorators/on.js @@ -38,10 +38,12 @@ export default function on(eventDomain) { let eventHandler = Eventhandler.create({ events: domNode.$appDecorators.on.events, element: domNode, + bind: domNode, }); // define namespace for eventhandler - domNode.$ ? null : domNode.$ = { eventHandler }; + domNode.$ ? null : domNode.$ = {}; + domNode.$.eventHandler = eventHandler; }); diff --git a/src/decorators/view.js b/src/decorators/view.js index <HASH>..<HASH> 100644 --- a/src/decorators/view.js +++ b/src/decorators/view.js @@ -47,7 +47,8 @@ function view(template, templateName = 'base') { }); // define namespace for view - domNode.$ ? null : domNode.$ = { view }; + domNode.$ ? null : domNode.$ = {}; + domNode.$.view = view; // render view domNode.$.view.render();
Bugfix: it was not a good idea to use the shortform of object assigning, see {n}th pre commit
SerkanSipahi_app-decorators
train
js,js
6b6bd37924b6bb1a64a562d1340cacc62bcdcf84
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java index <HASH>..<HASH> 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java @@ -92,7 +92,7 @@ public class RunCommand extends OptionParsingCommand { if (this.runner != null) { throw new RuntimeException( - "Already running. Please stop the current application before running another."); + "Already running. Please stop the current application before running another (use the 'stop' command)."); } SourceOptions sourceOptions = new SourceOptions(options);
Add hint to user about 'stop' command Improves gh-<I>
spring-projects_spring-boot
train
java
6112c43cae8818ef7971422d46a930d4eed0528f
diff --git a/test/rngout/main.go b/test/rngout/main.go index <HASH>..<HASH> 100644 --- a/test/rngout/main.go +++ b/test/rngout/main.go @@ -23,12 +23,12 @@ package main import ( "bufio" - "github.com/skarllot/raiqub" + "github.com/skarllot/raiqub/crypt" "os" ) func main() { - rng := raiqub.NewRandom() + rng := crypt.NewRandom() scanner := bufio.NewScanner(rng) sout := bufio.NewWriter(os.Stdout)
Fixed rngout test to match last changes
skarllot_raiqub
train
go
f9643bf7376a5953da2050a5361c9b465f7ee7d9
diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index <HASH>..<HASH> 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -962,7 +962,7 @@ class DownloadMethods: f = file try: - with aiohttp.ClientSession() as session: + async with aiohttp.ClientSession() as session: # TODO Use progress_callback; get content length from response # https://github.com/telegramdesktop/tdesktop/blob/c7e773dd9aeba94e2be48c032edc9a78bb50234e/Telegram/SourceFiles/ui/images.cpp#L1318-L1319 async with session.get(web.url) as response:
Add missing async when downloading from URL (#<I>)
LonamiWebs_Telethon
train
py
ec495bfcec4eac2f9013b4b842df5bec2dcc4200
diff --git a/src/ol/Geolocation.js b/src/ol/Geolocation.js index <HASH>..<HASH> 100644 --- a/src/ol/Geolocation.js +++ b/src/ol/Geolocation.js @@ -1,7 +1,6 @@ /** * @module ol/Geolocation */ -import {inherits} from './util.js'; import GeolocationProperty from './GeolocationProperty.js'; import BaseObject, {getChangeEventType} from './Object.js'; import {listen} from './events.js'; @@ -44,10 +43,9 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr * }); * * @fires error - * @extends {module:ol/Object} * @api */ -class Geolocation { +class Geolocation extends BaseObject { /** * @param {module:ol/Geolocation~Options=} opt_options Options. @@ -100,7 +98,7 @@ class Geolocation { */ disposeInternal() { this.setTracking(false); - BaseObject.prototype.disposeInternal.call(this); + super.disposeInternal(); } /** @@ -333,7 +331,5 @@ class Geolocation { } } -inherits(Geolocation, BaseObject); - export default Geolocation;
Use extends and super for Geolocation
openlayers_openlayers
train
js
97600cae61a610e4fbd0549f81905078d05786cf
diff --git a/src/Norm/Filter/Filter.php b/src/Norm/Filter/Filter.php index <HASH>..<HASH> 100644 --- a/src/Norm/Filter/Filter.php +++ b/src/Norm/Filter/Filter.php @@ -157,7 +157,8 @@ class Filter $innerMethodName = 'filter'.strtoupper($method[0]).substr($method, 1); if (method_exists($this, $innerMethodName)) { $method = $innerMethodName; - $data[$k] = $this->$method($k, $data[$k], $data, $args); + $val = (isset($data[$k])) ? $data[$k] : null; + $data[$k] = $this->$method($k, $val, $data, $args); } elseif (isset(static::$registries[$method]) && is_callable(static::$registries[$method])) { $method = static::$registries[$method]; $data[$k] = call_user_func($method, $data[$k], $data, $args);
fixed empty post submission caused error for Filter
xinix-technology_norm
train
php
d7d82fbbee6646c352c73f0607f152f2cf4fcc8f
diff --git a/multi_form_view/base.py b/multi_form_view/base.py index <HASH>..<HASH> 100644 --- a/multi_form_view/base.py +++ b/multi_form_view/base.py @@ -2,7 +2,6 @@ Django class based views for using more than one Form or ModelForm in a single view. """ from django.http import HttpResponseRedirect -from django.shortcuts import render from django.views.generic import FormView import six @@ -32,15 +31,13 @@ class MultiFormView(FormView): """ Renders a response containing the form errors. """ - context = self.get_context_data(forms=forms) - return render(self.request, self.template_name, context) + return self.render_to_response(self.get_context_data(forms=forms)) - def get(self, request, **kwargs): + def get(self, request, *args, **kwargs): """ - Render the forms. + Handles GET requests and instantiates blank versions of the forms. """ - context = self.get_context_data() - return render(request, self.template_name, context=context) + return self.render_to_response(self.get_context_data()) def get_context_data(self, **kwargs): """
prefer render_to_response over render Matches FormView --> ProcessFormView implementation and allows other rendering implementations
TimBest_django-multi-form-view
train
py
9b9d1eda4a287c59eba6a3f4ac5585966702a795
diff --git a/src/Illuminate/Support/ViewErrorBag.php b/src/Illuminate/Support/ViewErrorBag.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Support/ViewErrorBag.php +++ b/src/Illuminate/Support/ViewErrorBag.php @@ -10,6 +10,17 @@ class ViewErrorBag implements Countable { * @var array */ protected $bags = []; + + /** + * Checks if a MessageBag exists. + * + * @param string $key + * @return boolean + */ + public function hasBag($key = "default") + { + return isset($this->bags[$key]); + } /** * Get a MessageBag instance from the bags.
Add method hasBag to ViewErrorBag When redirecting withErrors($validator) the edit form can show individual messages. But to show a generic message, something like: please check the red marked field below I don't know anything else but to flash a extra variable. This method would remedy that. Now I could check: $errors->hasBag() to see if the form is a redirect from a post with a errors message bag or a first get for input.
laravel_framework
train
php
5bb6c51698fbdb6e93fbe36bef648165db87f2b9
diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index <HASH>..<HASH> 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -361,7 +361,7 @@ class DockerVM(BaseNode): try: yield from self._add_ubridge_connection(nio, adapter_number) except UbridgeNamespaceError: - log.error("Container {} failed to start", self.name) + log.error("Container %s failed to start", self.name) yield from self.stop() # The container can crash soon after the start, this means we can not move the interface to the container namespace
Fix an error when logging Docker container fail to start
GNS3_gns3-server
train
py
66584f94fe4f26f4c34f5b829e5ea30c061e7db4
diff --git a/src/Drivers/JsonDriver.php b/src/Drivers/JsonDriver.php index <HASH>..<HASH> 100644 --- a/src/Drivers/JsonDriver.php +++ b/src/Drivers/JsonDriver.php @@ -18,7 +18,7 @@ class JsonDriver implements Driver throw new CantBeSerialized('Resources can not be serialized to json'); } - return json_encode($data, JSON_PRETTY_PRINT).PHP_EOL; + return json_encode($data, JSON_PRETTY_PRINT)."\n"; } public function extension(): string @@ -29,7 +29,7 @@ class JsonDriver implements Driver public function match($expected, $actual) { if (is_array($actual)) { - $actual = json_encode($actual, JSON_PRETTY_PRINT).PHP_EOL; + $actual = json_encode($actual, JSON_PRETTY_PRINT)."\n"; } Assert::assertJsonStringEqualsJsonString($expected, $actual);
Fix inconsistent EOLs in JSON snapshots on Windows It replaces OS dependent `PHP_EOL` with `\n`. `json_encode` with `JSON_PRETTY_PRINT` flag always use `\n` regardless of OS, but `PHP_EOL` yields `\r\n` on Windows causing inconsistent line ends and unnecessary diff for git, if files are regenerated.
spatie_phpunit-snapshot-assertions
train
php
01cb6f277a6e2e5fe24a7c6665e5107ebdd6073a
diff --git a/openquake/hazardlib/lt.py b/openquake/hazardlib/lt.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/lt.py +++ b/openquake/hazardlib/lt.py @@ -773,15 +773,13 @@ class CompositeLogicTree(object): """ def __init__(self, branchsets): self.branchsets = branchsets - self.shortener = {} attach_to_branches(branchsets) nb = len(branchsets) paths = [] for bsno, bset in enumerate(branchsets): for brno, br in enumerate(bset.branches): - self.shortener[bsno, br.branch_id] = char = BASE64[brno] path = ['*'] * nb - path[bsno] = char + path[bsno] = br.short_id = BASE64[brno] paths.append(''.join(path)) self.basepaths = paths @@ -790,7 +788,7 @@ class CompositeLogicTree(object): ordinal = 0 for weight, branches in self.branchsets[0].enumerate_paths(): value = [br.value for br in branches] - lt_path = ''.join(branch.branch_id for branch in branches) + lt_path = ''.join(branch.short_id for branch in branches) yield Realization(value, weight, ordinal, lt_path.ljust(nb, '.')) ordinal += 1
Added .short_id
gem_oq-engine
train
py
39cb8af11529c66147f95d972f4e4ca6309d8395
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) -require 'acme_client' +require 'acme-client' require 'rspec' require 'vcr' @@ -9,6 +9,9 @@ require 'webrick' module TestHelper def generate_private_key OpenSSL::PKey::RSA.new(2048) + rescue OpenSSL::PKey::RSAError # Try again + sleep(0.05) + OpenSSL::PKey::RSA.new(2048) end def generate_csr(common_name, private_key) @@ -33,7 +36,7 @@ module TestHelper def serve_once(body) dev_null = Logger.new(StringIO.new) - server = WEBrick::HTTPServer.new(:Port => 5001, :Logger => dev_null, :AccessLog => dev_null) + server = WEBrick::HTTPServer.new(:Port => 5002, :Logger => dev_null, :AccessLog => dev_null) thread = Thread.new do server.mount_proc('/') do |_, response|
Try again when failing to generate RSA key
unixcharles_acme-client
train
rb
4a269299b2bcb5a3aac9d73c42097a14e7a54db8
diff --git a/Resources/public/js/MMMediaBundle.js b/Resources/public/js/MMMediaBundle.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/MMMediaBundle.js +++ b/Resources/public/js/MMMediaBundle.js @@ -275,10 +275,7 @@ function MMMediaBundleFileDropzoneInitiateEvents() { } -/** - * Start loading the dom is rdy - */ -MMMediaBundleDomReady(function (event) { +var MMMediaBundleInit = function (event) { var elements = document.getElementsByClassName('mmmb-dropzone'); @@ -333,4 +330,10 @@ MMMediaBundleDomReady(function (event) { MMMediaBundleFileDropzoneInitiateEvents(); -}); \ No newline at end of file +}; + + +/** + * Start loading the dom is rdy + */ +MMMediaBundleDomReady(MMMediaBundleInit); \ No newline at end of file
Callback event moved into a separate function -> MMMediaBundleInit
Mandarin-Medien_MMMediaBundle
train
js
15e58b9d47da8bffae1552079fa1b497a8866845
diff --git a/src/engine/engine-state.js b/src/engine/engine-state.js index <HASH>..<HASH> 100644 --- a/src/engine/engine-state.js +++ b/src/engine/engine-state.js @@ -231,7 +231,7 @@ export class EngineState { let i = 0 const servers = this.pluginState - .sortStratumServers(this.io.Socket !== null, this.io.TLSSocket !== null) + .sortStratumServers(this.io.Socket != null, this.io.TLSSocket != null) .filter(uri => !this.connections[uri]) while (Object.keys(this.connections).length < 5) { const uri = servers[i++] @@ -260,10 +260,14 @@ export class EngineState { ) if (this.engineStarted) this.refillServers() if (this.addressCacheDirty) { - this.saveAddressCache().catch(e => console.error('saveAddressCache', e.message)) + this.saveAddressCache().catch(e => + console.error('saveAddressCache', e.message) + ) } if (this.txCacheDirty) { - this.saveTxCache().catch(e => console.error('saveTxCache', e.message)) + this.saveTxCache().catch(e => + console.error('saveTxCache', e.message) + ) } },
Do not crash when TLS is unavailable
EdgeApp_edge-currency-bitcoin
train
js
320a5cb18f864b18ae7ca74a9cd0bf0a7efc023e
diff --git a/nomad/structs/diff.go b/nomad/structs/diff.go index <HASH>..<HASH> 100644 --- a/nomad/structs/diff.go +++ b/nomad/structs/diff.go @@ -79,10 +79,6 @@ func (j *Job) Diff(other *Job, contextual bool) (*JobDiff, error) { oldPrimitiveFlat = flatmap.Flatten(j, filter, true) diff.ID = j.ID } else { - if !reflect.DeepEqual(j, other) { - diff.Type = DiffTypeEdited - } - if j.ID != other.ID { return nil, fmt.Errorf("can not diff jobs with different IDs: %q and %q", j.ID, other.ID) } @@ -130,6 +126,20 @@ func (j *Job) Diff(other *Job, contextual bool) (*JobDiff, error) { diff.Objects = append(diff.Objects, pDiff) } + // If the job is not a delete or add, determine if there are edits. + if diff.Type == DiffTypeNone { + tgEdit := false + for _, tg := range diff.TaskGroups { + if tg.Type != DiffTypeNone { + tgEdit = true + break + } + } + if tgEdit || len(diff.Fields)+len(diff.Objects) != 0 { + diff.Type = DiffTypeEdited + } + } + return diff, nil }
Fix determining whether a job is edited
hashicorp_nomad
train
go
d4964bf394d189912c1ccf736890c457a302a13a
diff --git a/app/assets/javascripts/thin_man.js b/app/assets/javascripts/thin_man.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/thin_man.js +++ b/app/assets/javascripts/thin_man.js @@ -130,6 +130,10 @@ var initThinMan = function(){ $(this.emptyOnSuccess()).empty(); } } + if ($.contains(document, this.jq_obj[0])) { + this.jq_obj.find('.error').removeClass('error') + this.jq_obj.find('.help-inline').remove() + } }, ajaxComplete: function(jqXHR) { this.showTrigger(); diff --git a/lib/thin_man/version.rb b/lib/thin_man/version.rb index <HASH>..<HASH> 100644 --- a/lib/thin_man/version.rb +++ b/lib/thin_man/version.rb @@ -1,3 +1,3 @@ module ThinMan - VERSION = "0.12.0" + VERSION = "0.12.1" end
remove error class and inline-help after successful response
edraut_thin-man
train
js,rb
870384671749cf208dc15eb72a7472fcd107a889
diff --git a/lib/dm-core/adapters/data_objects_adapter.rb b/lib/dm-core/adapters/data_objects_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/adapters/data_objects_adapter.rb +++ b/lib/dm-core/adapters/data_objects_adapter.rb @@ -551,7 +551,7 @@ module DataMapper Query::Conditions::Comparison.new(:lt, comparison.property, value.last) ) - statement, bind_values = operation_statement(operation, qualify) + statement, bind_values = conditions_statement(operation, qualify) return "(#{statement})", bind_values end
Condition statement construction should be controlled by conditions_statement
datamapper_dm-core
train
rb
5aff71f1dbdf7d155aa2b0696d93d9e40902432a
diff --git a/js/tests/unit/wee.dom.js b/js/tests/unit/wee.dom.js index <HASH>..<HASH> 100644 --- a/js/tests/unit/wee.dom.js +++ b/js/tests/unit/wee.dom.js @@ -304,6 +304,10 @@ define(function(require) { 'Closest element was not identified' ); + assert.strictEqual(Wee.$closest('#inner', '#inner').length, 1, + 'Closest element was not identified' + ); + assert.isArray(Wee.$closest('#inner', '#container'), 'Closest element was identified successfully' );
Add test to $closest method
weepower_wee-core
train
js
ee50f8993047c9dc4c1e38a63e73c9cc4e8088f3
diff --git a/CmsManager/CmsSnapshotManager.php b/CmsManager/CmsSnapshotManager.php index <HASH>..<HASH> 100644 --- a/CmsManager/CmsSnapshotManager.php +++ b/CmsManager/CmsSnapshotManager.php @@ -11,7 +11,6 @@ namespace Sonata\PageBundle\CmsManager; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Templating\EngineInterface; use Symfony\Component\HttpFoundation\Response; @@ -190,7 +189,7 @@ class CmsSnapshotManager extends BaseCmsPageManager $snapshot = $this->getPageManager()->findEnableSnapshot($parameters); if (!$snapshot) { - throw new NotFoundHttpException(sprintf('Unable to find the snapshot : %s', $value)); + return false; } $page = new SnapshotPageProxy($this->getPageManager(), $snapshot);
Remove <I> from the CmsSnapshotManager
sonata-project_SonataPageBundle
train
php
ebaf80ea29b88e10b257fc1096c2c6d604dad0c0
diff --git a/gunicorn_console.py b/gunicorn_console.py index <HASH>..<HASH> 100755 --- a/gunicorn_console.py +++ b/gunicorn_console.py @@ -125,19 +125,23 @@ def handle_keypress(screen): move_selection(reverse=True) elif key in ("A", "+"): send_signal("TTIN") - gunicorns[selected_pid]["workers"] = 0 - elif key in ("W", "-"): - if gunicorns[selected_pid]["workers"] != 1: - send_signal("TTOU") + if selected_pid in gunicorns: gunicorns[selected_pid]["workers"] = 0 + elif key in ("W", "-"): + if selected_pid in gunicorns: + if gunicorns[selected_pid]["workers"] != 1: + send_signal("TTOU") + gunicorns[selected_pid]["workers"] = 0 elif key in ("R",): - send_signal("HUP") - del gunicorns[selected_pid] - selected_pid = None + if selected_pid in gunicorns: + send_signal("HUP") + del gunicorns[selected_pid] + selected_pid = None elif key in ("M", "-"): - send_signal("QUIT") - del gunicorns[selected_pid] - selected_pid = None + if selected_pid in gunicorns: + send_signal("QUIT") + del gunicorns[selected_pid] + selected_pid = None elif key in ("Q",): raise KeyboardInterrupt
Add more "no gunicorn selected" protection. Trying a command before cursoring into a selection was aborting.
stephenmcd_gunicorn-console
train
py
0149108a94d369810c667e1d50853c3a2256afba
diff --git a/component-1-util-1-object.js b/component-1-util-1-object.js index <HASH>..<HASH> 100644 --- a/component-1-util-1-object.js +++ b/component-1-util-1-object.js @@ -161,7 +161,7 @@ _cs.clone = function (source, continue_recursion) { /* helper functions */ var myself = arguments.callee; var clone_func = function (f, continue_recursion) { - var g = function () { + var g = function ComponentJS_function_clone () { return f.apply(this, arguments); }; g.prototype = f.prototype;
function clones occur in stack traces, so give the function clone a ComponentJS-indicating name
rse_componentjs
train
js
18e3b7cdd9f409de0701d3f254d3c3593c3fe2dc
diff --git a/src/utils.js b/src/utils.js index <HASH>..<HASH> 100644 --- a/src/utils.js +++ b/src/utils.js @@ -23,8 +23,8 @@ exports.serverFromURL = function(url) { parts.host = parts.host.split(':'); sagRes = exports.server( - parts.host.shift(), - parts.host.shift() || (useSSL) ? 443 : 80, + parts.host[0], + parts.host[1] || ((useSSL) ? 443 : 80), useSSL); //log the user in (if provided)
Fixing ternary in c5a<I>f0ba0dc<I>cf<I>cd<I>bd4dd<I>ed3b (#<I>)
sbisbee_sag-js
train
js
5a9a00e7ae968104c26eee501f9ec966c11ce617
diff --git a/telethon/client/telegrambaseclient.py b/telethon/client/telegrambaseclient.py index <HASH>..<HASH> 100644 --- a/telethon/client/telegrambaseclient.py +++ b/telethon/client/telegrambaseclient.py @@ -433,6 +433,9 @@ class TelegramBaseClient(abc.ABC): if not sender: sender = await self._create_exported_sender(dc_id) sender.dc_id = dc_id + elif not n: + dc = await self._get_dc(dc_id) + await sender.connect(dc.ip_address, dc.port) self._borrowed_senders[dc_id] = (n + 1, sender) @@ -447,12 +450,10 @@ class TelegramBaseClient(abc.ABC): dc_id = sender.dc_id n, _ = self._borrowed_senders[dc_id] n -= 1 - if n > 0: - self._borrowed_senders[dc_id] = (n, sender) - else: + self._borrowed_senders[dc_id] = (n, sender) + if not n: __log__.info('Disconnecting borrowed sender for DC %d', dc_id) await sender.disconnect() - del self._borrowed_senders[dc_id] async def _get_cdn_client(self, cdn_redirect): """Similar to ._borrow_exported_client, but for CDNs"""
Assume exported auths last forever This implies that export senders will NOT be deleted from memory once all borrows are returned, thus their auth_key remains as well. When borrowing them if they existed they will be connect()ed if it's the first borrow. This probably fixes #<I>.
LonamiWebs_Telethon
train
py
5768a1fe5e17f036a9c2f48afd91753e2ab6668d
diff --git a/superset/assets/javascripts/dashboard/reducers.js b/superset/assets/javascripts/dashboard/reducers.js index <HASH>..<HASH> 100644 --- a/superset/assets/javascripts/dashboard/reducers.js +++ b/superset/assets/javascripts/dashboard/reducers.js @@ -39,16 +39,21 @@ export function getInitialState(bootstrapData) { dashboard.posDict[position.slice_id] = position; }); } - dashboard.slices.forEach((slice, index) => { + const lastRowId = Math.max.apply(null, + dashboard.position_json.map(pos => (pos.row + pos.size_y))); + let newSliceCounter = 0; + dashboard.slices.forEach((slice) => { const sliceId = slice.slice_id; let pos = dashboard.posDict[sliceId]; if (!pos) { + // append new slices to dashboard bottom, 3 slices per row pos = { - col: (index * 4 + 1) % 12, - row: Math.floor((index) / 3) * 4, - size_x: 4, - size_y: 4, + col: (newSliceCounter % 3) * 16 + 1, + row: lastRowId + Math.floor(newSliceCounter / 3) * 16, + size_x: 16, + size_y: 16, }; + newSliceCounter++; } dashboard.layout.push({
for <I> columns layout, adjust default size and layout for newly added slices (#<I>)
apache_incubator-superset
train
js
53768c5cde7b002d42eb1151c21a662159463072
diff --git a/cereslib/_version.py b/cereslib/_version.py index <HASH>..<HASH> 100644 --- a/cereslib/_version.py +++ b/cereslib/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.1.13" +__version__ = "0.1.14"
Update version number to <I>
chaoss_grimoirelab-cereslib
train
py
367f509303619e2ce25a76875a4bb9f459592e8c
diff --git a/lib/chore/queues/filesystem/publisher.rb b/lib/chore/queues/filesystem/publisher.rb index <HASH>..<HASH> 100644 --- a/lib/chore/queues/filesystem/publisher.rb +++ b/lib/chore/queues/filesystem/publisher.rb @@ -25,12 +25,11 @@ module Chore begin f.write(job.to_json) rescue StandardError => e - Chore.logger.error "#{e.class.name}: #{e.message}. Could not write #{job[:class]} job to #{queue_name} file.\n#{e.stacktrace}" - raise e + Chore.logger.error "#{e.class.name}: #{e.message}. Could not write #{job[:class]} job to '#{queue_name}' queue file.\n#{e.backtrace}" ensure f.flock(File::LOCK_UN) - break end + break end end end
Remove ambiguous control-flow in error handling The 'break' in the ensure block actually aborts the bubbling of errors to higher level code. So even though we don't explicitly catch errors, they are still swallowed.
Tapjoy_chore
train
rb
d2a4b8661b2362c0ea5e4f47ccfa64077eeb54de
diff --git a/src/ZfcUser/Controller/UserController.php b/src/ZfcUser/Controller/UserController.php index <HASH>..<HASH> 100644 --- a/src/ZfcUser/Controller/UserController.php +++ b/src/ZfcUser/Controller/UserController.php @@ -156,7 +156,11 @@ class UserController extends AbstractActionController // redirect to the login redirect route return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute()); } - + // if registration is disabled + if (!$this->getOptions()->getEnableRegistration()) { + return array('enableRegistration' => false); + } + $request = $this->getRequest(); $service = $this->getUserService(); $form = $this->getRegisterForm();
Update src/ZfcUser/Controller/UserController.php The view was only place where was checked if registration was disabled. Sending post data would still register new user.
ZF-Commons_ZfcUser
train
php
6761ae32012132d07d38f38a82a88cc8abb7fc6b
diff --git a/output/html/languages.php b/output/html/languages.php index <HASH>..<HASH> 100644 --- a/output/html/languages.php +++ b/output/html/languages.php @@ -77,7 +77,11 @@ class QM_Output_Html_Languages extends QM_Output_Html { echo '<td class="qm-ltr">'; if ( $mofile['file'] ) { - echo esc_html( QM_Util::standard_dir( $mofile['file'], '' ) ); + if ( 'jed' === $mofile['type'] && self::has_clickable_links() ) { + echo self::output_filename( QM_Util::standard_dir( $mofile['file'], '' ), $mofile['file'], 1, true ); // WPCS: XSS ok. + } else { + echo esc_html( QM_Util::standard_dir( $mofile['file'], '' ) ); + } } else { echo '<em>' . esc_html__( 'None', 'query-monitor' ) . '</em>'; }
Allow JED translation file paths to be clickable.
johnbillion_query-monitor
train
php
31aaca6b8cf67af269cae1e728bed4480f9be390
diff --git a/tests/src/test/java/alluxio/master/file/FileSystemMasterIntegrationTest.java b/tests/src/test/java/alluxio/master/file/FileSystemMasterIntegrationTest.java index <HASH>..<HASH> 100644 --- a/tests/src/test/java/alluxio/master/file/FileSystemMasterIntegrationTest.java +++ b/tests/src/test/java/alluxio/master/file/FileSystemMasterIntegrationTest.java @@ -119,6 +119,9 @@ public class FileSystemMasterIntegrationTest { } } + /* + * This class provides multiple concurrent threads to free all files in one directory. + */ class ConcurrentFreer implements Callable<Void> { private int mDepth; private int mConcurrencyDepth; @@ -173,7 +176,9 @@ public class FileSystemMasterIntegrationTest { } } } - + /* + * This class provides multiple concurrent threads to delete all files in one directory. + */ class ConcurrentDeleter implements Callable<Void> { private int mDepth; private int mConcurrencyDepth;
[SMALLFIX] Add comments in ConcurrentFree test.
Alluxio_alluxio
train
java
7f9a6a58b99c97235fb4b22c8e2ca51e65b1f399
diff --git a/HISTORY.rst b/HISTORY.rst index <HASH>..<HASH> 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ History ------- +0.5.2 (2015-10-22) +------------------ + +* added `management` to `MANIFEST.in` + 0.5.1 (2015-10-22) ------------------ diff --git a/liquimigrate/__init__.py b/liquimigrate/__init__.py index <HASH>..<HASH> 100644 --- a/liquimigrate/__init__.py +++ b/liquimigrate/__init__.py @@ -3,4 +3,4 @@ __author__ = 'Marek Wywiał' __email__ = 'onjinx@gmail.com' -__version__ = '0.5.1' +__version__ = '0.5.2' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ test_requirements = [ setup( name='liquimigrate', - version='0.5.1', + version='0.5.2', description="Liquibase migrations with django", long_description=readme + '\n\n' + history, author="Marek Wywiał",
Bumped version to <I>
onjin_liquimigrate
train
rst,py,py
f729e4091af0e755fbf06e6ac80942abee662daf
diff --git a/lib/cocoapods-deploy/deploy_transformer.rb b/lib/cocoapods-deploy/deploy_transformer.rb index <HASH>..<HASH> 100644 --- a/lib/cocoapods-deploy/deploy_transformer.rb +++ b/lib/cocoapods-deploy/deploy_transformer.rb @@ -3,10 +3,12 @@ module Pod attr_accessor :lockfile attr_accessor :sandbox + attr_accessor :metadata def initialize(lockfile, sandbox) @lockfile = lockfile @sandbox = sandbox + @metadata = Source::Metadata.new({'prefix_lengths' => [1, 1, 1]}) end def transform_podfile(podfile) @@ -64,7 +66,8 @@ module Pod end def podspec_url(pod, version) - "{root-url}/#{pod}/#{version}/#{pod}" + path_fragment = metadata.path_fragment(pod) + "{root-url}/#{path_fragment}/#{version}/#{pod}" end def collect_podspec_dependencies(name_or_hash)
Compatibility with the new CocoaPods Spec layout
jcampbell05_cocoapods-deploy
train
rb
02a9b4c3f447c06ac41775b969c605e097c636b3
diff --git a/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemIntegrationTest.java b/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemIntegrationTest.java index <HASH>..<HASH> 100644 --- a/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemIntegrationTest.java +++ b/gcsio/src/test/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystemIntegrationTest.java @@ -209,12 +209,12 @@ public class GoogleCloudStorageFileSystemIntegrationTest { "stale file? testStartTime: %s, fileCreationTime: %s", testStartTime, fileCreationTime) .that(fileCreationTime) - .isGreaterThan(testStartTime); + .isAtLeast(testStartTime); assertWithMessage( "unexpected creation-time: clock skew? currentTime: %s, fileCreationTime: %s", currentTime, fileCreationTime) .that(fileCreationTime) - .isLessThan(currentTime); + .isAtMost(currentTime); } else { assertThat(fileInfo.getCreationTime()).isEqualTo(0); }
Fix test flakiness. Failed test example: []
GoogleCloudPlatform_bigdata-interop
train
java
ddb29609b1dcbd35a030cb1d2f42cffbef0be0ab
diff --git a/lib/wupee/notifier.rb b/lib/wupee/notifier.rb index <HASH>..<HASH> 100644 --- a/lib/wupee/notifier.rb +++ b/lib/wupee/notifier.rb @@ -77,16 +77,22 @@ module Wupee end end + notifications = [] + notif_type_configs.each do |notif_type_config| notification = Wupee::Notification.new(receiver: notif_type_config.receiver, notification_type: @notification_type, attached_object: @attached_object) notification.is_read = true unless notif_type_config.wants_notification? notification.save! + notifications << notification + subject_interpolations = interpolate_vars(@subject_vars, notification) locals_interpolations = interpolate_vars(@locals, notification) send_email(notification, subject_interpolations, locals_interpolations) if notif_type_config.wants_email? end + + notifications end private
Wupee::Notifier#execute method now returns an array of sent notifications
sleede_wupee
train
rb
5a997c1b0dfe7e6b99f6ddeb74f9144b69e24a3a
diff --git a/dev/io.openliberty.concurrent.cdi/src/io/openliberty/concurrent/cdi/interceptor/AsyncInterceptor.java b/dev/io.openliberty.concurrent.cdi/src/io/openliberty/concurrent/cdi/interceptor/AsyncInterceptor.java index <HASH>..<HASH> 100644 --- a/dev/io.openliberty.concurrent.cdi/src/io/openliberty/concurrent/cdi/interceptor/AsyncInterceptor.java +++ b/dev/io.openliberty.concurrent.cdi/src/io/openliberty/concurrent/cdi/interceptor/AsyncInterceptor.java @@ -57,7 +57,7 @@ public class AsyncInterceptor implements Serializable { Class<?> returnType = method.getReturnType(); if (!returnType.equals(CompletableFuture.class) && !returnType.equals(CompletionStage.class) - && !returnType.equals(Void.class)) + && !returnType.equals(Void.TYPE)) // void throw new UnsupportedOperationException("@Asynchronous " + returnType.getName() + " " + method.getName()); // TODO NLS? ManagedExecutorService executor;
Void.class is different from void
OpenLiberty_open-liberty
train
java
bcce6ccad25a94ab61d69486f671192b9db9859c
diff --git a/chess/pgn.py b/chess/pgn.py index <HASH>..<HASH> 100644 --- a/chess/pgn.py +++ b/chess/pgn.py @@ -1597,7 +1597,10 @@ def read_game(handle: TextIO, *, Visitor: Any = GameBuilder) -> Any: board.pop() board_stack.append(board) elif token == ")": - if skip_variation_depth: + if skip_variation_depth == 1: + skip_variation_depth = 0 + visitor.end_variation() + elif skip_variation_depth: skip_variation_depth -= 1 elif len(board_stack) > 1: visitor.end_variation()
Call matching end_variation while skipping (#<I>)
niklasf_python-chess
train
py
e4f5de5278857ad57ed06cd45a99ca9e40790990
diff --git a/src/frontend/org/voltdb/VoltZK.java b/src/frontend/org/voltdb/VoltZK.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/VoltZK.java +++ b/src/frontend/org/voltdb/VoltZK.java @@ -56,7 +56,7 @@ public class VoltZK { /* * Processes that want to block catalog updates create children here */ - public static final String catalogUpdateBlockers = "/db/export_generations"; + public static final String catalogUpdateBlockers = "/db/catalog_update_blockers"; // configuration (ports, interfaces, ...) public static final String cluster_metadata = "/db/cluster_metadata";
For ENG-<I>, fix a misnamed ZK path
VoltDB_voltdb
train
java
0d7182f8bd64a194e7aace094b11c8390ee2d5ce
diff --git a/test/e2e/apps/job.go b/test/e2e/apps/job.go index <HASH>..<HASH> 100644 --- a/test/e2e/apps/job.go +++ b/test/e2e/apps/job.go @@ -181,7 +181,7 @@ var _ = SIGDescribe("Job", func() { Expect(err).NotTo(HaveOccurred()) By("Ensuring job exceed backofflimit") - err = framework.WaitForJobFailure(f.ClientSet, f.Namespace.Name, job.Name, time.Duration(30)*time.Second, "BackoffLimitExceeded") + err = framework.WaitForJobFailure(f.ClientSet, f.Namespace.Name, job.Name, framework.JobTimeout, "BackoffLimitExceeded") Expect(err).NotTo(HaveOccurred()) By("Checking that only one pod created and status is failed")
Fix e2e Flaky Apps/Job BackoffLimit test This fix is linked to the PR #<I> that introduce the JobSpec.BackoffLimit. Previously the Timeout used in the test was too agressive and generates flaky test execution. Now it used the default framework.JobTimeout used in others tests.
kubernetes_kubernetes
train
go
4927df59a5bc76df3e5cb9fe10cc24bdd485e5bd
diff --git a/qbit/core/src/main/java/io/advantageous/qbit/service/impl/CallbackManagerWithTimeout.java b/qbit/core/src/main/java/io/advantageous/qbit/service/impl/CallbackManagerWithTimeout.java index <HASH>..<HASH> 100644 --- a/qbit/core/src/main/java/io/advantageous/qbit/service/impl/CallbackManagerWithTimeout.java +++ b/qbit/core/src/main/java/io/advantageous/qbit/service/impl/CallbackManagerWithTimeout.java @@ -157,18 +157,18 @@ public class CallbackManagerWithTimeout implements CallbackManager { @Override public void process(long currentTime) { - if (handlers.size() > 1_000) { + if (handlers.size() > 8_000) { logger.error("Issue with handlers growing too large size {} " + "service name {}", handlers.size(), this.name); } - if (handlers.size() > 100_000) { + if (handlers.size() > 32_000) { logger.error("Issue with handlers growing very large size {} " + "service name {}", handlers.size(), this.name); - checkForTimeOuts(60_000 * 5); + checkForTimeOuts(60_000); } if (!handleTimeouts) { return;
fixing auto-checkin and adding debugging for callback handler
advantageous_qbit
train
java
75bf3a771d8be4958328b43af7695f9e095d154f
diff --git a/lib/steam/packets/A2A_INFO_ResponsePacket.php b/lib/steam/packets/A2A_INFO_ResponsePacket.php index <HASH>..<HASH> 100644 --- a/lib/steam/packets/A2A_INFO_ResponsePacket.php +++ b/lib/steam/packets/A2A_INFO_ResponsePacket.php @@ -47,8 +47,8 @@ class A2A_INFO_ResponsePacket extends SteamPacket $this->botNumber = $byteBuffer->getByte(); $this->dedicated = chr($byteBuffer->getByte()); $this->operatingSystem = chr($byteBuffer->getByte()); - $this->passwordProtexted = $byteBuffer->getByte(); - $this->secureServer = $byteBuffer->getByte(); + $this->passwordProtected = $byteBuffer->getByte() == 1; + $this->secureServer = $byteBuffer->getByte() == 1; $this->gameVersion = $byteBuffer->getString(); $extraDataFlag = $byteBuffer->getByte();
* (PHP) Changed A2A_INFO response to store boolean values of passwordProtected and secure * (PHP) Fixed typo in A2A_INFO_ResponsePacket * (Java) Removed ipAddress and portNumber from SourceServer * (Ruby) Fixed some file properties
koraktor_steam-condenser-php
train
php
678e9123660986cb069ebfaace5be24d8a7590c0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,9 @@ var EventEmitter = require('eventemitter3'); // some validation routines var checkCandidate = require('rtc-validator/candidate'); +// the sdp cleaner +var sdpclean = require('rtc-sdpclean'); + var PRIORITY_LOW = 100; var PRIORITY_WAIT = 1000; @@ -119,6 +122,20 @@ module.exports = function(pc, opts) { }); } + function cleansdp(desc) { + // ensure we have clean sdp + var sdpErrors = []; + var sdp = desc && sdpclean(desc.sdp, { collector: sdpErrors }); + + // if we don't have a match, log some info + if (desc && sdp !== desc.sdp) { + console.info('invalid lines removed from sdp: ', sdpErrors); + desc.sdp = sdp; + } + + return desc; + } + function completeConnection() { if (pc.signalingState === 'have-remote-offer') { return tq.createAnswer(); @@ -248,6 +265,7 @@ module.exports = function(pc, opts) { }); tq.setLocalDescription = enqueue('setLocalDescription', execMethod, { + processArgs: cleansdp, pass: emitSdp });
Ensure generated sdp is valid before setting local description
rtc-io_rtc-taskqueue
train
js
85dfa745b6c2895d968409780c650e783328899f
diff --git a/satpy/modifiers/geometry.py b/satpy/modifiers/geometry.py index <HASH>..<HASH> 100644 --- a/satpy/modifiers/geometry.py +++ b/satpy/modifiers/geometry.py @@ -17,6 +17,8 @@ # satpy. If not, see <http://www.gnu.org/licenses/>. """Modifier classes for corrections based on sun and other angles.""" +from __future__ import annotations + import logging import time from datetime import datetime @@ -135,7 +137,6 @@ class SunZenithCorrector(SunZenithCorrectorBase): def _apply_correction(self, proj, coszen): logger.debug("Apply the standard sun-zenith correction [1/cos(sunz)]") - print("Applying sunzen: ", proj.chunks == coszen.chunks) res = proj.copy() res.data = sunzen_corr_cos(proj.data, coszen.data, limit=self.correction_limit, max_sza=self.max_sza) return res
Refactor SZA and cos(SZA) generation to reduce duplicate computations
pytroll_satpy
train
py
e9c03f355ed5859ddc1002653c3425b7a0f9f0f2
diff --git a/lib/pdk/cli/exec/interactive_command.rb b/lib/pdk/cli/exec/interactive_command.rb index <HASH>..<HASH> 100644 --- a/lib/pdk/cli/exec/interactive_command.rb +++ b/lib/pdk/cli/exec/interactive_command.rb @@ -1,4 +1,4 @@ -require 'pdk/cli/exec/command' +require 'pdk' module PDK module CLI
(maint) Ensure pdk/cli/exec/interactive_command works standalone
puppetlabs_pdk
train
rb
7561c4c2326f9c0a1ece372fdb4ae9cd458a7e93
diff --git a/GPy/core/parameterised.py b/GPy/core/parameterised.py index <HASH>..<HASH> 100644 --- a/GPy/core/parameterised.py +++ b/GPy/core/parameterised.py @@ -191,8 +191,8 @@ class parameterised(object): self.constrain(which, transformations.logistic(lower, upper)) def all_constrained_indices(self): - if len(self.constrained_indices): - return np.hstack(self.constrained_indices) + if len(self.constrained_indices) or len(self.fixed_indices): + return np.hstack(self.constrained_indices + self.fixed_indices) else: return np.empty(shape=(0,))
fixed a bug in all_constrained_indices
SheffieldML_GPy
train
py
89a18a3c3a237dbfd21c6968fd7dc27cdff5aedc
diff --git a/Slim/Http/Stream.php b/Slim/Http/Stream.php index <HASH>..<HASH> 100644 --- a/Slim/Http/Stream.php +++ b/Slim/Http/Stream.php @@ -317,7 +317,7 @@ class Stream implements StreamInterface $this->seekable = false; if ($this->isAttached()) { $meta = $this->getMetadata(); - $this->seekable = $meta['seekable'] && !$this->isPipe(); + $this->seekable = $meta['seekable']; } }
gh-<I> removed check for isPipe from Stream::isSeekable
slimphp_Slim
train
php
d37dac9c06113e2461bf2038fe0dfb5d35e54040
diff --git a/imgaug/augmenters/blend.py b/imgaug/augmenters/blend.py index <HASH>..<HASH> 100644 --- a/imgaug/augmenters/blend.py +++ b/imgaug/augmenters/blend.py @@ -387,6 +387,18 @@ class Alpha(meta.Augmenter): # pylint: disable=locally-disabled, unused-variabl keypoints_on_images, random_state, parents, hooks, _augfunc ) + def _augment_polygons(self, polygons_on_images, random_state, parents, hooks): + def _augfunc(augs_, polygons_on_images_, parents_, hooks_): + return augs_.augment_polygons( + keypoints_on_images=[polysoi_i.deepcopy() for polysoi_i in polygons_on_images_], + parents=parents_, + hooks=hooks_ + ) + + return self._augment_coordinate_based( + polygons_on_images, random_state, parents, hooks, _augfunc + ) + def _augment_coordinate_based(self, inputs, random_state, parents, hooks, func): nb_images = len(inputs) if nb_images == 0:
Add polygon augmentation method to Alpha
aleju_imgaug
train
py
2a642b22722ba1e1cdd35710b63fe6ab53307a74
diff --git a/scripts/npm-release.js b/scripts/npm-release.js index <HASH>..<HASH> 100644 --- a/scripts/npm-release.js +++ b/scripts/npm-release.js @@ -148,7 +148,7 @@ const waitOnTests = async (names, packageInfo) => { console.log(`\nWaiting on the following CI jobs: ${jobs.join(', ')}`) return Promise.all(jobs.map((job) => { - return Promise.resolve(waitForJobToPass(job)) + return waitForJobToPass(job) .timeout(minutes(60)) .then(() => { console.log(`${job} passed`)
chore: adding bluebird promise to release script (#<I>)
cypress-io_cypress
train
js
bace01c04796eb25d80f50000f4243a40a48b90f
diff --git a/plugins/udp/src/main/java/kg/apc/jmeter/samplers/DNSJavaTCPClientImpl.java b/plugins/udp/src/main/java/kg/apc/jmeter/samplers/DNSJavaTCPClientImpl.java index <HASH>..<HASH> 100644 --- a/plugins/udp/src/main/java/kg/apc/jmeter/samplers/DNSJavaTCPClientImpl.java +++ b/plugins/udp/src/main/java/kg/apc/jmeter/samplers/DNSJavaTCPClientImpl.java @@ -3,6 +3,7 @@ package kg.apc.jmeter.samplers; import kg.apc.io.BinaryUtils; import org.apache.jmeter.protocol.tcp.sampler.TCPClient; +import org.apache.jmeter.samplers.SampleResult; import org.apache.jorphan.logging.LoggingManager; import java.io.ByteArrayOutputStream; @@ -61,6 +62,10 @@ public class DNSJavaTCPClientImpl extends DNSJavaDecoder implements TCPClient { return new String(super.decode(buf)); } + public String read(InputStream in, SampleResult sampleResult) { + return this.read(in); + } + public byte getEolByte() { throw new UnsupportedOperationException("Not supported yet."); }
Add read method for Jmeter-<I> TCPClient signature (#<I>) * Add read method for Jmeter-<I> TCPClient signature * Fix missing semi-colon.
undera_jmeter-plugins
train
java
32bd20d40878e3979f8236a72ca7035f50285cfd
diff --git a/amibaker/ami_baker.py b/amibaker/ami_baker.py index <HASH>..<HASH> 100644 --- a/amibaker/ami_baker.py +++ b/amibaker/ami_baker.py @@ -18,7 +18,7 @@ class AmiBaker(object): ec2 = AmiEc2(quiet=self.__quiet, recipe=self.__recipe) if self._instance_id: - ec2.grab_existing_instance(self._instance_id) + ec2.get_instance(self._instance_id) else: ec2.instantiate() diff --git a/amibaker/ami_ec2.py b/amibaker/ami_ec2.py index <HASH>..<HASH> 100644 --- a/amibaker/ami_ec2.py +++ b/amibaker/ami_ec2.py @@ -72,7 +72,7 @@ class AmiEc2(object): self.__describe_instance() - def grab_existing_instance(self, ec2_id): + def get_instance(self, ec2_id): self.__describe_instance(ec2_id) def terminate(self):
Renamed method name to match others
hamidnazari_amibaker
train
py,py
479398f555c667cf24e77fd87632e27dcb9ba932
diff --git a/dev_tools/modules.py b/dev_tools/modules.py index <HASH>..<HASH> 100644 --- a/dev_tools/modules.py +++ b/dev_tools/modules.py @@ -303,6 +303,9 @@ def parse(args): def main(argv: List[str]): + if argv == []: + # If no arguments are given, print the help/usage info. + argv = ['--help'] args = parse(argv) # args.func is where we store the function to be called for a given subparser # e.g. it is list_modules for the `list` subcommand
Fix <I>: prevent confusing error if `dev_tools/modules.py` is invoked without arguments (#<I>) This PR changes `main` in `dev_tools/modules.py` in a very simple way: if the user invokes it without any arguments, it pretends that `--help` was given as the argument instead. This prevents the error described in issue #<I> and makes the whole thing a little bit more user friendly.
quantumlib_Cirq
train
py
ae02e7d62d2fc0e0fa33bfa6646c3356831705d5
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -78,7 +78,7 @@ var init = function() { } fs.writeFileSync(g_configPath, JSON.stringify({ installDir: path.resolve(path.normalize(path.join(__dirname, ".."))), - gamesDir: path.resolve(path.normalize(path.join(__dirname, "..", "public", "games"))), + gamesDir: path.resolve(path.normalize(path.join(configDir, "games"))), options: [ { name: "dns", value: false, }, { name: "private", value: false, },
move default games dir to the config folder
greggman_HappyFunTimes
train
js
306e5b61e74d9130b3d82a16805287723235e792
diff --git a/router_test.go b/router_test.go index <HASH>..<HASH> 100644 --- a/router_test.go +++ b/router_test.go @@ -319,12 +319,7 @@ func Test_buildRouteName(t *testing.T) { func Test_CatchAll_Route(t *testing.T) { r := require.New(t) - rr := render.New(render.Options{ - // HTMLLayout: "application.html", - TemplateEngine: plush.BuffaloRenderer, - TemplatesBox: packr.NewBox("../templates"), - Helpers: map[string]interface{}{}, - }) + rr := render.New(render.Options{}) a := Automatic(Options{}) a.GET("/{name:.+}", func(c Context) error {
cleaning out test to use only what it needs
gobuffalo_buffalo
train
go
d63bee8bc345171db74a77782f295e325926f3e3
diff --git a/zone.go b/zone.go index <HASH>..<HASH> 100644 --- a/zone.go +++ b/zone.go @@ -577,8 +577,15 @@ func (api *API) PurgeEverything(zoneID string) (PurgeCacheResponse, error) { // // API reference: https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags func (api *API) PurgeCache(zoneID string, pcr PurgeCacheRequest) (PurgeCacheResponse, error) { + return api.PurgeCacheContext(context.TODO(), zoneID, pcr) +} + +// PurgeCacheContext purges the cache using the given PurgeCacheRequest (zone/url/tag). +// +// API reference: https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags +func (api *API) PurgeCacheContext(ctx context.Context, zoneID string, pcr PurgeCacheRequest) (PurgeCacheResponse, error) { uri := "/zones/" + zoneID + "/purge_cache" - res, err := api.makeRequest("POST", uri, pcr) + res, err := api.makeRequestContext(ctx, "POST", uri, pcr) if err != nil { return PurgeCacheResponse{}, errors.Wrap(err, errMakeRequestError) }
feat(zones): Add PurgeCacheContext method (#<I>) Support context for purging cache. Adds a *Context method as suggested in #<I>, and used in ListZonesContext.
cloudflare_cloudflare-go
train
go
bc81777677de2f0138ef55de9a58077a05f33864
diff --git a/sailthru/Sailthru_Client.php b/sailthru/Sailthru_Client.php index <HASH>..<HASH> 100644 --- a/sailthru/Sailthru_Client.php +++ b/sailthru/Sailthru_Client.php @@ -579,8 +579,9 @@ class Sailthru_Client { * @param Mixed $tags Null for empty values, or String or arrays * @link http://docs.sailthru.com/api/content */ - public function pushContent($title, $url, $date = null, $tags = null, $vars = array()) { + public function pushContent($title, $url, $date = null, $tags = null, $vars = array(),$spider = 1) { $data = array(); + $data['spider'] = $spider; $data['title'] = $title; $data['url'] = $url; if (!is_null($tags)) {
Update Sailthru_Client.php
sailthru_sailthru-php5-client
train
php
f8f507a09d8007d1c1bb58a88000217e994f9c90
diff --git a/lib/htmlRenderer.js b/lib/htmlRenderer.js index <HASH>..<HASH> 100644 --- a/lib/htmlRenderer.js +++ b/lib/htmlRenderer.js @@ -61,7 +61,9 @@ HTMLRenderer.prototype.renderPage = function (url, pageData, cb) { renderData.gpsiData = pageData.gpsi; renderData.browsertimeData = pageData.browsertime; renderData.wptData = pageData.webpagetest; - renderData.phantomjsData = pageData.phantomjs.getStats(); + if (pageData.phantomjs) { + renderData.phantomjsData = pageData.phantomjs.getStats(); + } renderData.config = config; renderData.pageMeta = {
don't get phantomjs metrics if we don't fetch phantomjs
sitespeedio_sitespeed.io
train
js
35fc7a13c8b69ca056b47a8990d9c059cd5f0f74
diff --git a/test/src/test/java/hudson/search/SearchTest.java b/test/src/test/java/hudson/search/SearchTest.java index <HASH>..<HASH> 100644 --- a/test/src/test/java/hudson/search/SearchTest.java +++ b/test/src/test/java/hudson/search/SearchTest.java @@ -173,7 +173,7 @@ public class SearchTest extends HudsonTestCase { project1.setDisplayName(displayName); WebClient wc = new WebClient(); - Page result = wc.goTo("search/suggest?query=name", "application/javascript"); + Page result = wc.goTo("search/suggest?query=name", "application/json"); Assert.assertNotNull(result); assertGoodStatus(result);
fixed test error. we expected application/json.
jenkinsci_jenkins
train
java
8cd2ad37eb126fee01ec3201f8bbedd5cd8c20a5
diff --git a/lib/mtgox/client.rb b/lib/mtgox/client.rb index <HASH>..<HASH> 100644 --- a/lib/mtgox/client.rb +++ b/lib/mtgox/client.rb @@ -33,10 +33,10 @@ module MtGox # offers.bids[0, 3] def offers offers = get('/code/data/getDepth.php') - offers['asks'] = offers['asks'].sort_by{|ask| ask[0].to_f}.map do |ask| + offers['asks'].sort_by!{|ask| ask[0].to_f}.map! do |ask| Ask.new(*ask) end - offers['bids'] = offers['bids'].sort_by{|bid| bid[0].to_f}.reverse.map do |bid| + offers['bids'].sort_by!{|bid| bid[0].to_f}.reverse!.map! do |bid| Bid.new(*bid) end offers
Don't waste memory by duplicating objects
sferik_mtgox
train
rb
9e1306b9619c50374777b9f7e86e9628b2d11c99
diff --git a/tests/test_creation.py b/tests/test_creation.py index <HASH>..<HASH> 100644 --- a/tests/test_creation.py +++ b/tests/test_creation.py @@ -142,8 +142,9 @@ class CreationTest(g.unittest.TestCase): path = g.np.c_[x, y, z] # Extrude - mesh = g.trimesh.creation.sweep_polygon(poly, path) - assert mesh.is_volume + for engine in self.engines: + mesh = g.trimesh.creation.sweep_polygon(poly, path, engine=engine) + assert mesh.is_volume def test_annulus(self): """ @@ -264,8 +265,9 @@ class CreationTest(g.unittest.TestCase): if len(self.engines) == 0: return p = g.get_mesh('2D/ChuteHolderPrint.DXF') - v, f = p.triangulate() - check_triangulation(v, f, p.area) + for engine in self.engines: + v, f = p.triangulate(engine=engine) + check_triangulation(v, f, p.area) def test_truncated(self, count=10): # create some random triangles
Use available triangulation engines in tests In test_path_sweep and test_triangulate_plumbing, use all available triangulation engines (and no unavailable ones). This specifically allows the tests to run when the 'earcut' engine is available but the non-free 'triangle' engine is not. It also provides coverage of the 'earcut' engine when 'triangle' (the implicit default) *is* available.
mikedh_trimesh
train
py
05bbff3e3a8f59b4d08cfa4f5fc9d9927fe723d0
diff --git a/extensions/composer/Installer.php b/extensions/composer/Installer.php index <HASH>..<HASH> 100644 --- a/extensions/composer/Installer.php +++ b/extensions/composer/Installer.php @@ -176,6 +176,9 @@ class Installer extends LibraryInstaller protected function saveExtensions(array $extensions) { $file = $this->vendorDir . '/' . self::EXTENSION_FILE; + if (!file_exists(dirname($file))) { + mkdir(dirname($file), 0777, true); + } $array = str_replace("'<vendor-dir>", '$vendorDir . \'', var_export($extensions, true)); file_put_contents($file, "<?php\n\n\$vendorDir = dirname(__DIR__);\n\nreturn $array;\n"); // invalidate opcache of extensions.php if exists
composer: create directory if it does not exists may happen if yii is installed globally. fixes #<I>
yiisoft_yii-core
train
php
49596ea0d1b439fb0feb628bf5253ee2206fcacf
diff --git a/test/test_coursera.py b/test/test_coursera.py index <HASH>..<HASH> 100755 --- a/test/test_coursera.py +++ b/test/test_coursera.py @@ -3,9 +3,10 @@ Test functionality of coursera module. """ -import unittest import os import os.path +import unittest + from coursera import coursera_dl TEST_SYLLABUS_FILE = \
test: Sort stdlib imports and separate local import from the former.
coursera-dl_coursera-dl
train
py
0a02871f37186f8aeb5e15b60430aa0bdcce3c1b
diff --git a/holoviews/core/dimension.py b/holoviews/core/dimension.py index <HASH>..<HASH> 100644 --- a/holoviews/core/dimension.py +++ b/holoviews/core/dimension.py @@ -483,6 +483,9 @@ class Dimensioned(LabelledData): if selection == 'all': dims = [dim for group in self._dim_groups for dim in getattr(self, group)] + elif isinstance(selection, list): + dims = [dim for group in selection + for dim in getattr(self, '%s_dimensions' % group)] elif selection in ['key', 'value', 'constant']: lmbd, kwargs = lambdas[selection] key_traversal = self.traverse(lmbd, **kwargs)
Dimensioned.dimensions now accepts list of selections
pyviz_holoviews
train
py
3d6b9f4593748eb6c17bde71259520ff479ec57a
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1206,6 +1206,7 @@ function doInitialSync(client, historyLen) { client.emit("syncComplete"); _pollForEvents(client); }, function(err) { + console.error("/initialSync error: %s", err); client.emit("syncError", err); // TODO: Retries. }); @@ -1254,6 +1255,7 @@ function _pollForEvents(client) { var discardResult = false; var timeoutObj = setTimeout(function() { discardResult = true; + console.error("/events request timed out."); _pollForEvents(client); }, 40000); @@ -1330,6 +1332,7 @@ function _pollForEvents(client) { } _pollForEvents(self); }, function(err) { + console.error("/events error: %s", JSON.stringify(err)); if (discardResult) { return; }
Add more logging when sync requests fail.
matrix-org_matrix-js-sdk
train
js
fd88d180b315b8c70bada350017b62c8d5e5bb6c
diff --git a/daemon/cmd/daemon_main.go b/daemon/cmd/daemon_main.go index <HASH>..<HASH> 100644 --- a/daemon/cmd/daemon_main.go +++ b/daemon/cmd/daemon_main.go @@ -936,7 +936,7 @@ func initEnv(cmd *cobra.Command) { // Prepopulate option.Config with options from CLI. option.Config.Populate() - // add hooks after setting up metrics in the option.Confog + // add hooks after setting up metrics in the option.Config logging.DefaultLogger.Hooks.Add(metrics.NewLoggingHook(components.CiliumAgentName)) // Logging should always be bootstrapped first. Do not add any code above this!
daemon_main: fix comments error The option.Confog is replaced with option.Config.
cilium_cilium
train
go
9547e6ab425f742fef59245c725ae35ce7fdcb0c
diff --git a/models/event/event.go b/models/event/event.go index <HASH>..<HASH> 100644 --- a/models/event/event.go +++ b/models/event/event.go @@ -46,6 +46,8 @@ const ( DisconnectedFromServer string = "discFromServer" MatchEnded string = "matchEnded" Test string = "test" + + ReservationOver string = "reservationOver" ) var stop = make(chan struct{}) @@ -82,6 +84,8 @@ func StartListening() { disconnectedFromServer(event.LobbyID) case MatchEnded: matchEnded(event.LobbyID, event.LogsID, event.ClassTimes) + case ReservationOver: + reservationEnded(event.LobbyID) } case <-stop: return @@ -94,6 +98,12 @@ func StopListening() { stop <- struct{}{} } +func reservationEnded(lobbyID uint) { + lobby, _ := models.GetLobbyByID(lobbyID) + lobby.Close(false, false) + models.SendNotification("Lobby Closed (serveme.tf reservation ended)", int(lobby.ID)) +} + func playerDisc(steamID string, lobbyID uint) { player, _ := models.GetPlayerBySteamID(steamID) lobby, _ := models.GetLobbyByID(lobbyID)
stop lobby when the serveme reservation is over
TF2Stadium_Helen
train
go
6dde7e2d735f6e1419304345dea958cafd4d87dc
diff --git a/src/OAuth/Services/OAuthService.php b/src/OAuth/Services/OAuthService.php index <HASH>..<HASH> 100644 --- a/src/OAuth/Services/OAuthService.php +++ b/src/OAuth/Services/OAuthService.php @@ -251,7 +251,7 @@ class OAuthService */ public function getAppToken(\DTS\eBaySDK\OAuth\Types\GetAppTokenRestRequest $request = null) { - return $this->getAppTokenAsync()->wait(); + return $this->getAppTokenAsync($request)->wait(); } /**
Pass through the request for grabbing the app token.
davidtsadler_ebay-sdk-php
train
php