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
bf3dae948ea4f2a073be9b1c663b595a896efdfa
diff --git a/src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java b/src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java index <HASH>..<HASH> 100644 --- a/src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java +++ b/src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java @@ -158,11 +158,10 @@ public class FailedTestsContent extends DataBoundTokenMacro { } private List<TestResult> filterTests(List<? extends TestResult> failedTests, String regexPattern) { - List<TestResult> filteredTests = failedTests.stream().collect(Collectors.toList()); if(regexPattern.length() != 0) { Pattern pattern = Pattern.compile(regexPattern); - filteredTests = filteredTests.stream().filter(t -> pattern.matcher(t.getFullName()).matches()).collect(Collectors.toList()); + failedTests = failedTests.stream().filter(t -> pattern.matcher(t.getFullName()).matches()).collect(Collectors.toList()); } - return filteredTests; + return (List<TestResult>)failedTests; } }
avoid creating a new List of TestResult
jenkinsci_email-ext-plugin
train
java
ebd698020ad12a8c284bcddcd1ea3f433a645c81
diff --git a/languagetool-standalone/src/test/java/org/languagetool/language/LanguageIdentifierTest.java b/languagetool-standalone/src/test/java/org/languagetool/language/LanguageIdentifierTest.java index <HASH>..<HASH> 100644 --- a/languagetool-standalone/src/test/java/org/languagetool/language/LanguageIdentifierTest.java +++ b/languagetool-standalone/src/test/java/org/languagetool/language/LanguageIdentifierTest.java @@ -80,7 +80,10 @@ public class LanguageIdentifierTest { private void langAssert(String expectedLangCode, String text) { Language expectedLang = expectedLangCode != null ? Languages.getLanguageForShortCode(expectedLangCode) : null; + //long start = System.currentTimeMillis(); Language detectedLang = identifier.detectLanguage(text); + //long end = System.currentTimeMillis(); + //System.out.println("-> " + (end-start) + "ms"); if (!Objects.equals(expectedLang, detectedLang)) { fail("Got '" + detectedLang + "', expected '" + expectedLangCode + "' for '" + text + "'"); }
code to measure performance (commented out)
languagetool-org_languagetool
train
java
d612a3b62a78e3f27a05c417f544f9d892ad2b5b
diff --git a/neuropythy/__init__.py b/neuropythy/__init__.py index <HASH>..<HASH> 100644 --- a/neuropythy/__init__.py +++ b/neuropythy/__init__.py @@ -11,7 +11,7 @@ from vision import (retinotopy_data, empirical_retinotopy_data, predicted_re neighborhood_cortical_magnification) # Version information... -__version__ = '0.2.21' +__version__ = '0.2.22' description = 'Integrate Python environment with FreeSurfer and perform mesh registration'
upped version number for pypi
noahbenson_neuropythy
train
py
606e7b90f99d11637f40d23b05451f0f4243c9f4
diff --git a/bin/operations.js b/bin/operations.js index <HASH>..<HASH> 100644 --- a/bin/operations.js +++ b/bin/operations.js @@ -75,10 +75,12 @@ exports.nijsBuild = function(args) { nixExpression : expr, params : params, callback : function(err, result) { - if(err) + if(err) { process.stdout.write(result + "\n"); - else - process.exit(code); + } else { + process.stderr.write(err + "\n"); + process.exit(1); + } } }); };
We no longer have an error code, but an error message
svanderburg_nijs
train
js
895987c8cda7d2a5939c60e88bb714fd71ca8276
diff --git a/test/CliMenuBuilderTest.php b/test/CliMenuBuilderTest.php index <HASH>..<HASH> 100644 --- a/test/CliMenuBuilderTest.php +++ b/test/CliMenuBuilderTest.php @@ -286,6 +286,23 @@ class CliMenuBuilderTest extends TestCase $this->assertSame($builder, $subMenuBuilder->end()); } + public function testAddSubMenuWithBuilder() : void + { + $subMenuBuilder = new CliMenuBuilder; + + $builder = new CliMenuBuilder; + $builder->disableDefaultItems(); + $builder->addSubMenu('sub-menu', $subMenuBuilder); + + $menu = $builder->build(); + + $this->checkItems($menu, [ + [ + 'class' => MenuMenuItem::class + ] + ]); + } + public function testSubMenuInheritsParentsStyle() : void { $builder = new CliMenuBuilder;
Test addSubMenu with menu builder
php-school_cli-menu
train
php
271ae7a1483d2fcf336257c89c0c750474c3281f
diff --git a/magic.py b/magic.py index <HASH>..<HASH> 100644 --- a/magic.py +++ b/magic.py @@ -163,7 +163,8 @@ if not libmagic or not libmagic._name: 'cygwin': windows_dlls, 'linux': ['libmagic.so.1'], # fallback for some Linuxes (e.g. Alpine) where library search does not work } - for dll in platform_to_lib.get(sys.platform, []): + platform = 'linux' if sys.platform.startswith('linux') else sys.platform + for dll in platform_to_lib.get(platform, []): try: libmagic = ctypes.CDLL(dll) break
Accommodate linux distros that return trailing version, i.e. Alpine
ahupp_python-magic
train
py
eb03bb73be9cf4cd90921b8b0584b9cc3cdaf91c
diff --git a/lib/rubicure/girl.rb b/lib/rubicure/girl.rb index <HASH>..<HASH> 100644 --- a/lib/rubicure/girl.rb +++ b/lib/rubicure/girl.rb @@ -4,7 +4,7 @@ module Rubicure # Precure girl (ex. Cure Peace, Cure Rosetta, Cure Honey) # # this is record of "config/girls/*.yml" - class Girl < Hash + class Girl < Hash # rubocop:disable Metrics/ClassLength include Hashie::Extensions::MethodAccess ATTRIBUTES = [
[Disabled] Metrics/ClassLength: Class has too many lines. [<I>/<I>]
sue445_rubicure
train
rb
5ba2a41cb5c46771a579fe90986764ee70ace3bd
diff --git a/openxc/tools/control.py b/openxc/tools/control.py index <HASH>..<HASH> 100644 --- a/openxc/tools/control.py +++ b/openxc/tools/control.py @@ -62,7 +62,7 @@ def write(controller, name, value, event=None, raw=False): method = controller.write_raw else: method = controller.write - method(name, value, event) + method(name=name, value=value, event=event, raw=raw) print("Done.")
Hack a quick fix to writing to a controller with kwargs.
openxc_openxc-python
train
py
124ecc8f4d68046d495ff12755ca9f3062d5c9e9
diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -206,7 +206,7 @@ def install(args): if (distro == 'Debian' or distro == 'Ubuntu'): LOG.debug('Installing on host %s ...', hostname) install_r = sudo.compile(install_debian) - elif (distro == 'CentOS') or distro.startswith('RedHat'): + elif (distro == 'CentOS') or distro.startswith('RedHat') or (distro == 'Fedora'): LOG.debug('Installing on host %s ...', hostname) install_r = sudo.compile(install_centos) else:
ceph_deploy: Add Fedora installation support Fixes #<I>.
ceph_ceph-deploy
train
py
44d55fad2f0252b02da646135283572b3659f6da
diff --git a/test/medea_test.js b/test/medea_test.js index <HASH>..<HASH> 100644 --- a/test/medea_test.js +++ b/test/medea_test.js @@ -114,7 +114,7 @@ describe('Medea', function() { var buf = Buffer.concat([empty, contents]); var fd = fs.openSync(path.join(directory, '1.medea.data'), 'w+'); - fs.write(fd, buf, 0, buf.length, function(err) { + fs.write(fd, buf, 0, buf.length, 0, function(err) { fs.closeSync(fd); db.open(directory, function(err) {
Fixing <I> support.
medea_medea
train
js
e58c701c35f32fe75e02b7938a94f937ec901275
diff --git a/index_edit.php b/index_edit.php index <HASH>..<HASH> 100644 --- a/index_edit.php +++ b/index_edit.php @@ -36,10 +36,12 @@ if ($user_id) { $gedcom_id=safe_REQUEST($_REQUEST, 'gedcom_id'); } +// Only an admin can edit the "default" page // Only managers can edit the "home page" // Only a user or an admin can edit a user's "my page" if ( - $gedcom_id && !userGedcomAdmin(WT_USER_ID, $gedcom_id) || + $gedcom_id<0 && !WT_USER_IS_ADMIN || + $gedcom_id>0 && !userGedcomAdmin(WT_USER_ID, $gedcom_id) || $user_id && WT_USER_ID!=$user_id && !WT_USER_IS_ADMIN ) { $controller->pageHeader();
Fix: cannot update default gedcom blocks with new WT_Tree code
fisharebest_webtrees
train
php
96305b2044ca225a2faf9f81da569baa92036f57
diff --git a/Controller/MenuItemAdminController.php b/Controller/MenuItemAdminController.php index <HASH>..<HASH> 100644 --- a/Controller/MenuItemAdminController.php +++ b/Controller/MenuItemAdminController.php @@ -116,7 +116,7 @@ class MenuItemAdminController extends CRUDController } //use one of the locale to filter the list of menu entries (see above - $rootNodes = $menuItemManager->getRootNodesByLocale($this->currentMenuLanguage); + $rootNodes = $menuItemManager->getRootNodesByLocale($this->currentMenuLanguage, 'id'); $childOpen = function ($node) { return sprintf('<li class="table-row-style" id="listItem_%s">', $node['id']);
Order root nodes by id
networking_init-cms-bundle
train
php
41740de5f46318af9599148681dd9cd7c7e5a2f4
diff --git a/stl/stl.py b/stl/stl.py index <HASH>..<HASH> 100644 --- a/stl/stl.py +++ b/stl/stl.py @@ -321,7 +321,7 @@ class BaseStl(base.BaseMesh): :param str filename: The file to load :param bool calculate_normals: Whether to update the normals :param file fh: The file handle to open - :param dict \**kwargs: The same as for :py:class:`stl.mesh.Mesh` + :param dict kwargs: The same as for :py:class:`stl.mesh.Mesh` ''' if fh: @@ -352,7 +352,7 @@ class BaseStl(base.BaseMesh): :param str filename: The file to load :param bool calculate_normals: Whether to update the normals :param file fh: The file handle to open - :param dict \**kwargs: The same as for :py:class:`stl.mesh.Mesh` + :param dict kwargs: The same as for :py:class:`stl.mesh.Mesh` ''' if fh: close = False
Fix flake8 issue at stl.py
WoLpH_numpy-stl
train
py
025ba38b3e28af67525e63b31457d196ec92d4f9
diff --git a/test/index.test.js b/test/index.test.js index <HASH>..<HASH> 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -5,11 +5,31 @@ const { strict: assert } = require('assert') const Vinyl = require('vinyl') const data = require('gulp-data') +const ejsDependency = require('ejs') + const ejs = require('../') describe('gulp-ejs', function() { it('should expose ejs global object', function() { - assert.equal(typeof ejs.__EJS__, 'object') + assert.equal(ejs.__EJS__, ejsDependency) + }) + + it('should work with no suplied data', done => { + const stream = ejs() + + stream.on('data', data => { + assert.equal(data.contents.toString(), '') + }) + + stream.on('end', done) + + stream.write( + new Vinyl({ + contents: Buffer.from('') + }) + ) + + stream.end() }) it('should render ejs template', done => {
test: add test case for passing no data
rogeriopvl_gulp-ejs
train
js
d64e54a019296cbd6e94c8ab9e05cbb5ba77c0bf
diff --git a/openid/consumer/impl.py b/openid/consumer/impl.py index <HASH>..<HASH> 100644 --- a/openid/consumer/impl.py +++ b/openid/consumer/impl.py @@ -239,10 +239,12 @@ class OpenIDConsumer(object): assert isinstance(url, basestring), type(url) url = url.strip() - if not (url.startswith('http://') or url.startswith('https://')): + parsed = urlparse.urlparse(url) + + if parsed[0] == '': url = 'http://' + url + parsed = urlparse.urlparse(url) - parsed = urlparse.urlparse(url) authority = parsed[1].encode('idna') tail = map(self._quoteMinimal, parsed[2:]) if tail[0] == '':
[project @ Now should normalize all URLs correctly]
openid_python-openid
train
py
3eedc74e05be7b709491f3a3b8deffdb4c57600c
diff --git a/src/main/java/com/balancedpayments/Callback.java b/src/main/java/com/balancedpayments/Callback.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/balancedpayments/Callback.java +++ b/src/main/java/com/balancedpayments/Callback.java @@ -18,7 +18,7 @@ public class Callback extends Resource { @ResourceField(mutable=true, required=false) public String method; - @ResourceField(mutable=true, required=false) + @ResourceField(required=false) public String revision; public static class Collection extends ResourceCollection<Callback> {
Remove mutability of callback revision
balanced_balanced-java
train
java
13e31de3106a08f2a806ec9f8d61a87285c19054
diff --git a/app/models/agent.rb b/app/models/agent.rb index <HASH>..<HASH> 100644 --- a/app/models/agent.rb +++ b/app/models/agent.rb @@ -396,7 +396,7 @@ class Agent < ActiveRecord::Base agent = Agent.find(agent_id) begin return if agent.unavailable? - agent.receive(Event.where(:id => event_ids)) + agent.receive(Event.where(:id => event_ids).order(:id)) agent.last_receive_at = Time.now agent.save! rescue => e
Fix random spec failure caused by async_receive not ordering queried events
huginn_huginn
train
rb
47653c87f460df4524b1b900b75cd972ff9f57de
diff --git a/src/test/java/com/googlecode/lanterna/terminal/TerminalInputTest.java b/src/test/java/com/googlecode/lanterna/terminal/TerminalInputTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/googlecode/lanterna/terminal/TerminalInputTest.java +++ b/src/test/java/com/googlecode/lanterna/terminal/TerminalInputTest.java @@ -54,7 +54,7 @@ public class TerminalInputTest { } rawTerminal.setCursorPosition(0, currentRow++); - putString(rawTerminal, key.toString().replaceAll("\n", "\\\\n")); + putString(rawTerminal, key.toString()); if(currentRow >= rawTerminal.getTerminalSize().getRows()) { currentRow = 0;
KeyStroke.toString() change obsoletes sanitizing in TerminalInputTest
mabe02_lanterna
train
java
909b59af4f07b58dcc047822f3ad69c8ef4c5bb6
diff --git a/base-sync.js b/base-sync.js index <HASH>..<HASH> 100644 --- a/base-sync.js +++ b/base-sync.js @@ -294,8 +294,9 @@ BaseSync.prototype = { }, /** - * Return Promise until {@link BaseSync#state} will be changed - * to specific value. + * Return Promise until {@link BaseSync#state} sync will have specific state. + * + * If current state is correct, method will return resolved Promise. * * @param {string} state The expected synchronization state value. * @@ -307,6 +308,10 @@ BaseSync.prototype = { * }) */ waitFor: function (state) { + if (this.state === state) { + return Promise.resolve() + } + var sync = this return new Promise(function (resolve) { var unbind = sync.on('state', function () { diff --git a/test/base-sync.test.js b/test/base-sync.test.js index <HASH>..<HASH> 100644 --- a/test/base-sync.test.js +++ b/test/base-sync.test.js @@ -194,6 +194,10 @@ it('has state', function () { }) }) +it('does not wait for state change is current state is correct', function () { + return createSync().waitFor('disconnected') +}) + it('loads lastSent, lastReceived and lastAdded from store', function () { var log = TestTime.getLog() var con = new NanoEvents()
BaseSync#waitFor resolves now if current state is correct
logux_core
train
js,js
2aea6131120527f8b129fae4c26f526b8d470217
diff --git a/retask/queue.py b/retask/queue.py index <HASH>..<HASH> 100644 --- a/retask/queue.py +++ b/retask/queue.py @@ -93,7 +93,7 @@ class Queue(object): .. doctest:: - >>> from retask.queue import Queue + >>> from retask import Queue >>> q = Queue('test') >>> q.connect() True @@ -120,7 +120,7 @@ class Queue(object): .. doctest:: - >>> from retask.queue import Queue + >>> from retask import Queue >>> q = Queue('test') >>> q.connect() True @@ -156,7 +156,7 @@ class Queue(object): .. doctest:: - >>> from retask.queue import Queue + >>> from retask import Queue >>> q = Queue('test') >>> q.connect() True @@ -194,7 +194,7 @@ class Queue(object): .. doctest:: - >>> from retask.queue import Queue + >>> from retask import Queue >>> q = Queue('test') >>> q.connect() True
updated docstrings to show absolute imports
kushaldas_retask
train
py
85350aa4435a4d171450bb433d4f47270a01ec60
diff --git a/editormd.js b/editormd.js index <HASH>..<HASH> 100644 --- a/editormd.js +++ b/editormd.js @@ -365,7 +365,7 @@ var _this = this; var classPrefix = this.classPrefix = editormd.classPrefix; - var settings = this.settings = $.extend(true, editormd.defaults, options); + var settings = this.settings = $.extend(true, {}, editormd.defaults, options); id = (typeof id === "object") ? settings.id : id;
Handle two editors with different toolbars on the same page
pandao_editor.md
train
js
12c837ca32b616b39d47c810aaf2cc7a06e8572c
diff --git a/test/engine.tests.js b/test/engine.tests.js index <HASH>..<HASH> 100644 --- a/test/engine.tests.js +++ b/test/engine.tests.js @@ -28,15 +28,17 @@ module.exports = function (idProperty, getEngine, beforeCallback, afterCallback) }) describe('#idProperty', function () { - it('should return name of the idProperty', function () { + it('should return name of the idProperty', function (done) { getEngine(function (error, engine) { engine.idProperty.should.eql('_id') + done() }) }) - it('should should be able to change the idProperty', function () { + it('should should be able to change the idProperty', function (done) { getEngine({ idProperty: 'hello' }, function (error, engine) { engine.idProperty.should.eql('hello') + done() }) }) })
Add done fn to #idProperty tests
serby_save
train
js
7c8fd8b68699e9e41b76db24899d267d65dd8ee2
diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -1566,6 +1566,7 @@ def test_requirement_file_from_url(tmpdir): with open(constraints, "w") as fp: print("translate>=3.2.1,<3.6.0", file=fp) print("protobuf<=3.17.3", file=fp) + print("setuptools<60", file=fp) pex_file = os.path.join(str(tmpdir), "pex")
Work around setuptools <I> release in test. (#<I>) The release added a warning that trips up a test. Pin low to avoid this since setuptools version is incidental to the test. See: <URL>
pantsbuild_pex
train
py
f25d638db97bf363a621246df8031eb18c82ad94
diff --git a/src/CacheMiddleware.php b/src/CacheMiddleware.php index <HASH>..<HASH> 100644 --- a/src/CacheMiddleware.php +++ b/src/CacheMiddleware.php @@ -142,6 +142,8 @@ class CacheMiddleware ); } } + }else{ + $cacheEntry = null; } /** @var Promise $promise */
Ensure a $cacheEntry can either be a CacheEntry or null The Doctrine cache implementation does not return "null" for unsuccessful fetches, but false. That can lead to crashes in `getStaleResponse`.
Kevinrob_guzzle-cache-middleware
train
php
7d51e9edbed579bdeb1815d8f5902668f22af929
diff --git a/src/Tasks.php b/src/Tasks.php index <HASH>..<HASH> 100644 --- a/src/Tasks.php +++ b/src/Tasks.php @@ -189,7 +189,13 @@ class Tasks extends \Robo\Tasks ->line('TS_INSTALL_PROFILE=' . $this->projectProperties['install_profile']) ->run(); - return $result; + // Write drush aliases. + $this->say('Writing drush aliases to .yml file.'); + // Run the installation. + $result2 = $this->taskExec('drush site:alias-convert') + ->run(); + + return $result && $result2; } /**
Issue #<I> attempting to add drush aliases during configure.
thinkshout_robo-drupal
train
php
bb9edd10205fa40c98993c72c087211310b3242c
diff --git a/agrona/src/main/java/org/agrona/UnsafeAccess.java b/agrona/src/main/java/org/agrona/UnsafeAccess.java index <HASH>..<HASH> 100644 --- a/agrona/src/main/java/org/agrona/UnsafeAccess.java +++ b/agrona/src/main/java/org/agrona/UnsafeAccess.java @@ -28,6 +28,7 @@ public final class UnsafeAccess * Reference to the {@link Unsafe} instance. */ public static final Unsafe UNSAFE; + /** * Byte array base offset. */ @@ -56,7 +57,7 @@ public final class UnsafeAccess } UNSAFE = unsafe; - ARRAY_BYTE_BASE_OFFSET = Unsafe.ARRAY_BYTE_BASE_OFFSET; + ARRAY_BYTE_BASE_OFFSET = unsafe.arrayBaseOffset(byte[].class); } private UnsafeAccess()
Avoid static fields on Unsafe as they are not supported on Android.
real-logic_agrona
train
java
ea153c4bb81f900c924d632c8a34fbcd64ba4c96
diff --git a/merb-gen/app_generators/merb/templates/config/init.rb b/merb-gen/app_generators/merb/templates/config/init.rb index <HASH>..<HASH> 100644 --- a/merb-gen/app_generators/merb/templates/config/init.rb +++ b/merb-gen/app_generators/merb/templates/config/init.rb @@ -95,10 +95,20 @@ end <%= "# " unless default_test_suite?(:test) %>use_test :test_unit <%= "# " unless default_test_suite?(:spec) %>use_test :rspec - # # ==== Set up your basic configuration # + +# IMPORTANT: +# +# early on Merb boot init file is not yet loaded. +# Thus setting PORT, PID FILE and ADAPTER using init file does not +# make sense and only can lead to confusion because default settings +# will be used instead. +# +# Please use command line options for them. +# See http://wiki.merbivore.com/pages/merb-core-boot-process +# if you want to know more. Merb::Config.use do |c| # Sets up a custom session id key, if you want to piggyback sessions of other applications
Add note on which options must only be set using command line (see details). As #<I> and #<I> in -core state, people try to set every possible option in init file. On server start and pid file drop, though, init file(s) are not yet loaded. So, setting pid file or port in init file makes no sense. Defaults are being used and it causes confusion in future. Given all this, add a note in generated init file.
wycats_merb
train
rb
2613d1937ad5b5c4defa96c694f805c12f6dfed8
diff --git a/run.php b/run.php index <HASH>..<HASH> 100755 --- a/run.php +++ b/run.php @@ -250,6 +250,9 @@ // Required PDF Engine set -- to phantomjs or tcpdf $q->pdf_engine = "phantomjs"; + // Path to Phantom js executable relative to root + $q->pdf_phantomjs_path = "bin/phantomjs"; + // How CSV, PDF out is delivered to the browser ( TCPDF output only ) // either as // "DOWNLOAD_SAME_WINDOW" - downloaded as attachment from within the current browser window ( default )
Path to phantomjs needed setting for windows operation
reportico-web_reportico
train
php
c817a8870ed931d4d5ce76edb7768d2d0bec005b
diff --git a/lib/prepare.js b/lib/prepare.js index <HASH>..<HASH> 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -13,6 +13,7 @@ module.exports = async (npmrc, {tarballDir, pkgRoot}, {cwd, env, stdout, stderr, { cwd: basePath, env, + preferLocal: true, } ); versionResult.stdout.pipe(stdout, {end: false});
fix: add missed `preferLocal` option for execa call (#<I>)
semantic-release_npm
train
js
1e9618e07a6c052b2587d67e93e7084c10c41c53
diff --git a/gcm.go b/gcm.go index <HASH>..<HASH> 100644 --- a/gcm.go +++ b/gcm.go @@ -292,6 +292,7 @@ func (c *xmppGcmClient) listen(h MessageHandler, stop <-chan bool) error { case ccsAck: _, ok = c.messages[cm.MessageId] if ok { + go h(*cm) delete(c.messages, cm.MessageId) } // nack for a sent message, retry if retryable error, bubble up otherwise @@ -299,7 +300,11 @@ func (c *xmppGcmClient) listen(h MessageHandler, stop <-chan bool) error { if retryableErrors[cm.Error] { c.retryMessage(*cm, h) } else { - go h(*cm) + _, ok = c.messages[cm.MessageId] + if ok { + go h(*cm) + delete(c.messages, cm.MessageId) + } } case ccsControl: // TODO(silvano): create a new connection, drop the old one 'after a while'
Bubble up CCS ack replies. Successful replies (acks) should be also bubbled in order to enable custom handling of canonical registration_id. Also deleting message from the message log if nacked and `not retriable, otherwise it will stay there forever.
googlearchive_go-gcm
train
go
43db5d137e8a5847783f9315d1bdd9493c3a30cf
diff --git a/funcparserlib/parser.py b/funcparserlib/parser.py index <HASH>..<HASH> 100644 --- a/funcparserlib/parser.py +++ b/funcparserlib/parser.py @@ -504,11 +504,6 @@ def a(value): >>> expr = a("x") >>> expr.parse("x") 'x' - - ``` - - ```pycon - >>> expr = a("x") >>> expr.parse("y") Traceback (most recent call last): ...
docs: Use a single code fence block for the examples in the docstring for `a()` It's two tests for the same parser.
vlasovskikh_funcparserlib
train
py
376772dc8240dbba9af013e03042444f83394b00
diff --git a/lib/instana/version.rb b/lib/instana/version.rb index <HASH>..<HASH> 100644 --- a/lib/instana/version.rb +++ b/lib/instana/version.rb @@ -1,4 +1,4 @@ module Instana - VERSION = "1.7.1" + VERSION = "1.7.2" VERSION_FULL = "instana-#{VERSION}" end
Bump gem version to <I>
instana_ruby-sensor
train
rb
073059d2eec443cd005df623900ad2f972aef962
diff --git a/src/rabird/core/distutils/command/install.py b/src/rabird/core/distutils/command/install.py index <HASH>..<HASH> 100644 --- a/src/rabird/core/distutils/command/install.py +++ b/src/rabird/core/distutils/command/install.py @@ -106,7 +106,7 @@ class BaseUwbpepServer(object): self.packages = packages - def find_package(self, requirement_text): + def _find_package(self, requirement_text): requirement = pkg_resources.Requirement.parse(requirement_text) wheel_contexts = self.packages[requirement.key]["wheels"] @@ -138,7 +138,7 @@ class BaseUwbpepServer(object): raise KeyError("Can't find the requirement : %s" % requirement_text) def install(self, requirement): - wheel, url = self.find_package(requirement) + wheel, url = self._find_package(requirement) filename = wheel.filename print("Downloading ... %s " % url)
Renamed find_package() to _find_package() for hide it from others
starofrainnight_rabird.core
train
py
a2947ecc736893b2d55e4e28d4dfabbe65b440d3
diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py index <HASH>..<HASH> 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py @@ -69,6 +69,10 @@ INSTALLED_APPS = ('collectfast', ) + INSTALLED_APPS # AWS cache settings, don't change unless you know what you're doing: AWS_EXPIRY = 60 * 60 * 24 * 7 + +# TODO See: https://github.com/jschneier/django-storages/issues/47 +# Revert the following and use str after the above-mentioned bug is fixed in +# either django-storage-redux or boto AWS_HEADERS = { 'Cache-Control': str.encode( 'max-age=%d, s-maxage=%d, must-revalidate' % (
Added a note as a reminder to revert the last commit after this issue is fixed: <URL>
pydanny_cookiecutter-django
train
py
90a27e072ce60907f42f759bc169d2286123f17d
diff --git a/lib/rdl/typecheck.rb b/lib/rdl/typecheck.rb index <HASH>..<HASH> 100644 --- a/lib/rdl/typecheck.rb +++ b/lib/rdl/typecheck.rb @@ -35,6 +35,7 @@ module RDL::Typecheck def self.typecheck(klass, meth) raise RuntimeError, "singleton method typechecking not supported yet" if RDL::Util.has_singleton_marker(klass) file, line = $__rdl_info.get(klass, meth, :source_location) + raise RuntimeError, "static type checking in irb not supported" if file == "(irb)" digest = Digest::MD5.file file cache_hit = (($__rdl_ruby_parser_cache.has_key? file) && ($__rdl_ruby_parser_cache[file][0] == digest))
error on static type check in irb
plum-umd_rdl
train
rb
b97d00aaa1a00f6c68145679cc278eef7242f083
diff --git a/lib/sbsm/lookandfeel.rb b/lib/sbsm/lookandfeel.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/lookandfeel.rb +++ b/lib/sbsm/lookandfeel.rb @@ -119,6 +119,9 @@ module SBSM end result end + def zone_navigation + @session.zone_navigation + end private def collect_resource(base, rname, rstr=nil) varpart = self::class::RESOURCES[rname] diff --git a/lib/sbsm/session.rb b/lib/sbsm/session.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/session.rb +++ b/lib/sbsm/session.rb @@ -325,6 +325,9 @@ module SBSM def zones @active_state.zones end + def zone_navigation + @state.zone_navigation + end def ==(other) super end diff --git a/lib/sbsm/state.rb b/lib/sbsm/state.rb index <HASH>..<HASH> 100644 --- a/lib/sbsm/state.rb +++ b/lib/sbsm/state.rb @@ -275,6 +275,9 @@ module SBSM def zones self::class::ZONES end + def zone_navigation + [] + end def <=>(other) @mtime <=> other.mtime end
ChangeSet <I>: added zone_navigation lib/sbsm/lookandfeel.rb: added zone_navigation lib/sbsm/session.rb: added zone_navigation lib/sbsm/state.rb: added zone_navigation
zdavatz_sbsm
train
rb,rb,rb
49ef22bdb508d77902ef471a612d9e1f2ce7da44
diff --git a/logging_tree/__init__.py b/logging_tree/__init__.py index <HASH>..<HASH> 100644 --- a/logging_tree/__init__.py +++ b/logging_tree/__init__.py @@ -1,5 +1,9 @@ """Introspection for the ``logging`` logger tree in the Standard Library. +You can install this package with the standard ``pip`` command:: + + $ pip install logging_tree + While you can write programs that call this package's ``tree()`` function and examine the hierarchy of logger objects that it finds inside of the Standard Library ``logging`` module, the simplest use of
Tell people that this can be installed with "pip"
brandon-rhodes_logging_tree
train
py
1b83deaa554282a31fded2b74e02ad2ae23044ec
diff --git a/spec/mongo/database_spec.rb b/spec/mongo/database_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongo/database_spec.rb +++ b/spec/mongo/database_spec.rb @@ -330,7 +330,7 @@ describe Mongo::Database do context 'when a write concern is not defined on the client/database object' do - context 'when a write concern is provided in the selector' do + context 'when a write concern is provided in the selector', if: standalone? do let(:cmd) do {
RUBY-<I> Test hangs in <I> if w is > number of members
mongodb_mongo-ruby-driver
train
rb
d3dd42d75b9bd649eeff809681d2805e76a883fc
diff --git a/Service/Manager.php b/Service/Manager.php index <HASH>..<HASH> 100644 --- a/Service/Manager.php +++ b/Service/Manager.php @@ -130,7 +130,7 @@ class Manager } } - if ($doer !== 'anon.') { + if ($doer instanceof Claroline\CoreBundle\Entity\User) { $doerId = $doer->getId(); } @@ -189,7 +189,7 @@ class Manager $loggedUser = $token->getUser(); $removeUserIds = array($notification->getUserId()); - if ($loggedUser !== 'anon.') { + if ($loggedUser instanceof Claroline\CoreBundle\Entity\User) { if (!empty($loggedUser) && $loggedUser->getId() != $notification->getUserId()) { array_push($removeUserIds, $loggedUser->getId()); }
[NotificationBundle] instanceof comparison
claroline_Distribution
train
php
9ef7ad7d3f7448beb7a3e60a99895099acae1aca
diff --git a/ELiDE/rulesview.py b/ELiDE/rulesview.py index <HASH>..<HASH> 100644 --- a/ELiDE/rulesview.py +++ b/ELiDE/rulesview.py @@ -185,7 +185,7 @@ class RulesView(FloatLayout): ) for trigger in self.rule.triggers ] - self._trigger_builder.decks = [unused_triggers, used_triggers] + self._trigger_builder.decks = [used_triggers, unused_triggers] unused_prereqs = [ Card( ud={'type': 'prereq'}, @@ -209,7 +209,7 @@ class RulesView(FloatLayout): ) for prereq in self.rule.prereqs ] - self._prereq_builder.decks = [unused_prereqs, used_prereqs] + self._prereq_builder.decks = [used_prereqs, unused_prereqs] unused_actions = [ Card( ud={'type': 'action'}, @@ -233,4 +233,4 @@ class RulesView(FloatLayout): ) for action in self.rule.actions ] - self._action_builder.decks = [unused_actions, used_actions] + self._action_builder.decks = [used_actions, unused_actions]
used cards on the left, unused on the right
LogicalDash_LiSE
train
py
a16b261f61195bcc73ef826fa31659a51a5d8d83
diff --git a/aws/aws_sweeper_test.go b/aws/aws_sweeper_test.go index <HASH>..<HASH> 100644 --- a/aws/aws_sweeper_test.go +++ b/aws/aws_sweeper_test.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os" + "strings" "testing" "time" @@ -88,7 +89,7 @@ func testSweepResourceOrchestrator(sweepResources []*testSweepResource) error { err := testAccDeleteResource(sweepResource.resource, sweepResource.d, sweepResource.meta) if err != nil { - if tfawserr.ErrCodeContains(err, "Throttling") { + if strings.Contains(err.Error(), "Throttling") { log.Printf("[INFO] While sweeping resource (%s), encountered throttling error (%s). Retrying...", sweepResource.d.Id(), err) return resource.RetryableError(err) }
tests/sweeper: Update throttling check
terraform-providers_terraform-provider-aws
train
go
7a016e04a17c7b0320824022427f748e717f8492
diff --git a/test/bitcore.js b/test/bitcore.js index <HASH>..<HASH> 100644 --- a/test/bitcore.js +++ b/test/bitcore.js @@ -559,6 +559,23 @@ describe('bitcore', () => { return false; }, 20 * 1000, done); }); + + it('streams error when bitcore turned off', function (done) { + const addresses = [getAddress(), getAddress(), getAddress()]; + + testBlockchain(() => { + return stopBitcore(); + }, (blockchain, done) => { + const stream = blockchain.lookupTransactionsStream(addresses, 10000000, 0); + + testStreamMultiple(stream, (e) => { + if (typeof e === 'object' && e instanceof Error) { + return true; + } + return false; + }, 30 * 1000, done, 100 * 3); + }, done); + }); }); function testTxsPromise(promise, test, done) { @@ -583,6 +600,11 @@ describe('bitcore', () => { let lastTx = null; describe('lookupTransactions', () => { + it('starts bitcore', function () { + this.timeout(60 * 1000); + return startBitcore(); + }); + it('looks up unconfirmed transactions', function (done) { this.timeout(2 * 60 * 1000); const addresses = [getAddress(), getAddress(), getAddress()];
Experimenting with stopping bitcore + errors
trezor_hd-wallet
train
js
c0057fe97833b9f7bc5127be15072be601e59f2a
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 @@ -2,6 +2,12 @@ require 'rubygems' require 'vcr' require File.dirname(__FILE__) + '/../lib/oembed' +RSpec.configure do |config| + config.raise_errors_for_deprecations! + config.tty = true + config.color = true +end + module OEmbedSpecHelper EXAMPLE = YAML.load_file(File.expand_path(File.join(__FILE__, '../spec_helper_examples.yml'))) unless defined?(EXAMPLE) @@ -27,7 +33,7 @@ module OEmbedSpecHelper results end - + def example_body(site) EXAMPLE[site][:body] end @@ -62,7 +68,7 @@ module OEmbedSpecHelper XML end end - + def invalid_response(case_name, format) format = format.to_s valid = valid_response(format)
Raise errors on deprecations! ...because I've removed all deprecated syntax calls :-D
ruby-oembed_ruby-oembed
train
rb
29a1ef040e635253f12f7ac2d93e97808c28cf9e
diff --git a/source/lib/workbook/builder.js b/source/lib/workbook/builder.js index <HASH>..<HASH> 100644 --- a/source/lib/workbook/builder.js +++ b/source/lib/workbook/builder.js @@ -17,9 +17,9 @@ let addRootContentTypesXML = (promiseObj) => { .att('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types'); let contentTypesAdded = []; + let extensionsAdded = []; promiseObj.wb.sheets.forEach((s, i) => { if (s.drawingCollection.length > 0) { - let extensionsAdded = []; s.drawingCollection.drawings.forEach((d) => { if (extensionsAdded.indexOf(d.extension) < 0) { let typeRef = d.contentType + '.' + d.extension;
fix image issue, eq. add image in 2 sheet, it make microsoft office to warning with repair
natergj_excel4node
train
js
d9daaa692feba7f4f760cee1c627c3ea40193345
diff --git a/src/Tests/IncompleteAbstractTestClass.php b/src/Tests/IncompleteAbstractTestClass.php index <HASH>..<HASH> 100644 --- a/src/Tests/IncompleteAbstractTestClass.php +++ b/src/Tests/IncompleteAbstractTestClass.php @@ -36,6 +36,11 @@ abstract class IncompleteAbstractTestClass implements TestInterface }; } + public function & getReference(): array + { + return []; + } + public function withArgument(int $argument): int { return $argument;
Test mocking classes with methods returning references
facile-it_moka
train
php
b37e31ea815b809394bf0a33f0579e2a9d2f56c8
diff --git a/app/Factories/AbstractGedcomRecordFactory.php b/app/Factories/AbstractGedcomRecordFactory.php index <HASH>..<HASH> 100644 --- a/app/Factories/AbstractGedcomRecordFactory.php +++ b/app/Factories/AbstractGedcomRecordFactory.php @@ -25,6 +25,8 @@ use Fisharebest\Webtrees\Tree; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Support\Collection; +use function str_starts_with; + /** * Make a GedcomRecord object. */ @@ -61,6 +63,10 @@ abstract class AbstractGedcomRecordFactory return $match[1]; } + if (str_starts_with($gedcom, '0 HEAD')) { + return 'HEAD'; + } + return $xref; } }
Fix: case mismatch when searching for HEAD record creates incorrect xref in changes table
fisharebest_webtrees
train
php
d335d594f5ff719fe007f78c996ba959f2eea52c
diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index <HASH>..<HASH> 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -13,6 +13,7 @@ import json from ssl import CERT_NONE, create_default_context from multiprocessing import Pool, Value from itertools import repeat +import sys import time from tqdm import tqdm @@ -626,11 +627,15 @@ def _main(): repeat(opts.offline), repeat(opts.n_procs >= 1)), opts.chunk_size) - pbar = tqdm(total=len(file_paths)) - while not results.ready(): - pbar.update(counter.value - pbar.n) - time.sleep(0.1) - pbar.close() + if sys.stdout.isatty(): + pbar = tqdm(total=len(file_paths)) + while not results.ready(): + pbar.update(counter.value - pbar.n) + time.sleep(0.1) + pbar.close() + else: + while not results.ready(): + time.sleep(0.1) results = results.get() pool.close() pool.join()
print tqdm progress bar only in interactive tty (as opposed to cronjob)
domainaware_parsedmarc
train
py
703122369ed0c6a4e4217e7a77a8bf47d2ec3671
diff --git a/scour/scour.py b/scour/scour.py index <HASH>..<HASH> 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -3356,8 +3356,8 @@ def serializeXML(element, options, indent_depth=0, preserveWhitespace=False): if not preserveWhitespace: # strip / consolidate whitespace according to spec, see # https://www.w3.org/TR/SVG/text.html#WhiteSpace - # As a workaround for inconsistent handling of renderers keep newlines if they were in the original if element.nodeName in ['text', 'tspan', 'tref', 'textPath', 'altGlyph']: + text_content = text_content.replace('\n', '') text_content = text_content.replace('\t', ' ') if child == element.firstChild: text_content = text_content.lstrip()
Strip newlines from text nodes and be done with it Follow the spec "blindly" as it turns out covering all the border and getting reasonably styled output is just to cumbersome. This way at least scour output is consistent and it also saves us some bytes (a lot in some cases as we do not indent <tspan>s etc. anymore)
scour-project_scour
train
py
4966819789f5e905a9aa68ac7887fb894f68d61f
diff --git a/openquake/hazardlib/nrml.py b/openquake/hazardlib/nrml.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/nrml.py +++ b/openquake/hazardlib/nrml.py @@ -157,7 +157,10 @@ def get_source_model_05(node, fname, converter=default): groups = [] # expect a sequence of sourceGroup nodes for src_group in node: if 'sourceGroup' not in src_group.tag: - raise ValueError('expected sourceGroup') + raise InvalidFile( + '%s: you have an incorrect declaration ' + 'xmlns="http://openquake.org/xmlns/nrml/0.5"; it should be ' + 'xmlns="http://openquake.org/xmlns/nrml/0.4"' % fname) groups.append(converter.convert_node(src_group)) return sorted(groups)
Improved error message for source model files with the wrong NRML version [skip CI] Former-commit-id: 2b4bd7a3a6b2b<I>f<I>a<I>fcb<I>
gem_oq-engine
train
py
6407d920ea32dd0221387b7d959be2d5e6089cf7
diff --git a/lib/neo4j-embedded/embedded_session.rb b/lib/neo4j-embedded/embedded_session.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j-embedded/embedded_session.rb +++ b/lib/neo4j-embedded/embedded_session.rb @@ -26,9 +26,13 @@ module Neo4j def properties_map return @properties_map if @properties_map - props = @config[:properties_map].each_with_object({}) do |(k, v), m| - m[k.to_s.to_java] = v.to_s.to_java - end + props = if @config[:properties_map].is_a?(Hash) + @config[:properties_map].each_with_object({}) do |(k, v), m| + m[k.to_s.to_java] = v.to_s.to_java + end + else + {} + end @properties_map = java.util.HashMap.new(props) end
Address missing Hash to address #<I>
neo4jrb_neo4j-core
train
rb
cad9394011b1c41fea53b999082465ef6ea264af
diff --git a/lib/compiler.js b/lib/compiler.js index <HASH>..<HASH> 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -67,13 +67,17 @@ Compiler.prototype.compile = function(callback) { function onCompiled(err, compiled) { if(err) return callback(err); - var func = new Function("$template", - "$tools", - "_", - "$data", - "$helpers", - "$callback", - compiled); + try { + var func = new Function("$template", + "$tools", + "_", + "$data", + "$helpers", + "$callback", + compiled); + } catch(err) { + return callback(err); + } func.$helpers = _this.helpers;
Fixed a bug that could cause the application to crash in case of parsing error.
coolony_kiwi
train
js
31ca58bef2c800fa723daf82eec2903981cfbb72
diff --git a/TYPO3.Fluid/Classes/Core/ViewHelper/TagBasedViewHelper.php b/TYPO3.Fluid/Classes/Core/ViewHelper/TagBasedViewHelper.php index <HASH>..<HASH> 100644 --- a/TYPO3.Fluid/Classes/Core/ViewHelper/TagBasedViewHelper.php +++ b/TYPO3.Fluid/Classes/Core/ViewHelper/TagBasedViewHelper.php @@ -135,7 +135,7 @@ abstract class TagBasedViewHelper extends \F3\Fluid\Core\ViewHelper\AbstractView $this->registerTagAttribute('title', 'string', 'Tooltip text of element'); $this->registerTagAttribute('accesskey', 'string', 'Keyboard shortcut to access this element'); $this->registerTagAttribute('tabindex', 'integer', 'Specifies the tab order of this element'); - $this->registerTagAttribute('onClick', 'string', 'JavaScript evaluated for the onClick event'); + $this->registerTagAttribute('onclick', 'string', 'JavaScript evaluated for the onclick event'); } } ?> \ No newline at end of file
[!!!][~FEATURE] Fluid: Changed TagBasedViewHelper Argument from onClick to onclick (mind the spelling). This is in conformance with <URL>
neos_flow-development-collection
train
php
1016b68103ee81afe5497555c755bc9b93aa2c10
diff --git a/server/handlers/default.go b/server/handlers/default.go index <HASH>..<HASH> 100644 --- a/server/handlers/default.go +++ b/server/handlers/default.go @@ -46,13 +46,16 @@ func AtomicUpdateHandler(ctx context.Context, w http.ResponseWriter, r *http.Req func atomicUpdateHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error { gun := vars["imageName"] s := ctx.Value("metaStore") + logger := ctxu.GetLoggerWithField(ctx, gun, "gun") store, ok := s.(storage.MetaStore) if !ok { + logger.Error("500 POST unable to retrieve storage") return errors.ErrNoStorage.WithDetail(nil) } cryptoServiceVal := ctx.Value("cryptoService") cryptoService, ok := cryptoServiceVal.(signed.CryptoService) if !ok { + logger.Error("500 POST unable to retrieve signing service") return errors.ErrNoCryptoService.WithDetail(nil) } @@ -102,6 +105,7 @@ func atomicUpdateHandler(ctx context.Context, w http.ResponseWriter, r *http.Req return errors.ErrOldVersion.WithDetail(err) } // More generic storage update error, possibly due to attempted rollback + logger.Errorf("500 POST error applying update request: %v", err) return errors.ErrUpdating.WithDetail(nil) } return nil
Error logging for <I> POSTs to notary server
theupdateframework_notary
train
go
c98783b776408b402cbf4e2fba8ae26bb128ee06
diff --git a/package/config.js b/package/config.js index <HASH>..<HASH> 100644 --- a/package/config.js +++ b/package/config.js @@ -3,7 +3,8 @@ const { safeLoad } = require('js-yaml') const { readFileSync } = require('fs') const filePath = resolve('config', 'webpacker.yml') -const config = safeLoad(readFileSync(filePath), 'utf8')[process.env.NODE_ENV] +const environment = process.env.NODE_ENV || 'development' +const config = safeLoad(readFileSync(filePath), 'utf8')[environment] const isBoolean = str => /^true/.test(str) || /^false/.test(str)
Default environment to 'development' when NODE_ENV isn't set (#<I>)
rails_webpacker
train
js
7d11e79c2964586ac14985ec61710e75c72afa6a
diff --git a/wpull/version.py b/wpull/version.py index <HASH>..<HASH> 100644 --- a/wpull/version.py +++ b/wpull/version.py @@ -6,4 +6,4 @@ A string conforming to `Semantic Versioning Guidelines <http://semver.org/>`_ ''' -__version__ = '0.28a1' +__version__ = '0.29a1'
Bumps version to <I>a1.
ArchiveTeam_wpull
train
py
7baf8dc3c1bd2ac3e88f616f482165d3c0e7e3f0
diff --git a/DataItem.py b/DataItem.py index <HASH>..<HASH> 100644 --- a/DataItem.py +++ b/DataItem.py @@ -445,7 +445,9 @@ class DataItem(Storage.StorageBase): def __get_live_status_as_string(self): if self.is_live: - return "{0:s} {1:s}".format(_("Live"), str(self.__properties.get("frame_index", str()))) + frame_index_str = str(self.__properties.get("frame_index", str())) + partial_str = "{0:d}/{0:d}".format(self.__properties.get("valid_rows"), self.spatial_shape[-1]) if "valid_rows" in self.__properties else str() + return "{0:s} {1:s} {2:s}".format(_("Live"), frame_index_str, partial_str) return str() live_status_as_string = property(__get_live_status_as_string)
Updated Live status to include valid rows. svn r<I>
nion-software_nionswift
train
py
4b4385bd443a3b3c3769f2cbfe7b7e0414adaf34
diff --git a/collector/cpu_dragonfly.go b/collector/cpu_dragonfly.go index <HASH>..<HASH> 100644 --- a/collector/cpu_dragonfly.go +++ b/collector/cpu_dragonfly.go @@ -97,16 +97,9 @@ int getCPUTimes(int *ncpu, struct exported_cputime **cputime) { *cputime = &xp_t[0]; - // free(&cp_t); - return 0; } - -void freeCPUTimes(double *cpu_times) { - free(cpu_times); -} - */ import "C" @@ -156,8 +149,6 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) (err error) { if C.getCPUTimes(&ncpu, &cpuTimesC) == -1 { return errors.New("could not retrieve CPU times") } - // TODO: Remember to free variables - // defer C.freeCPUTimes(cpuTimesC) cpuTimes := (*[1 << 30]C.struct_exported_cputime)(unsafe.Pointer(cpuTimesC))[:ncpu:ncpu]
Remove free Don't need it since we aren't malloc'ing
prometheus_node_exporter
train
go
c16e6fd37d96050eb20c5fda59606b90fb5e97d4
diff --git a/public/assets/appCore.js b/public/assets/appCore.js index <HASH>..<HASH> 100644 --- a/public/assets/appCore.js +++ b/public/assets/appCore.js @@ -909,7 +909,9 @@ function defaultPageTransitionPosition(direction, $element) { } function animateTimeout($element, $aux, scroll) { - $(".core-style:not(:last-of-type)").remove(); + if($(".core-style").length > 1) + $(".core-style:not(:last-of-type)").remove(); + $aux.attr("id", $element.attr('id')).css({"position": "relative", "top": "initial", "left": "initial", "width": "100%"}); $element.remove(); aniTransitionPage = null;
core-style check if is the last
edineibauer_uebConfig
train
js
53e72ebc8d963649ab0ba6d9c24a11cb3c561231
diff --git a/packages/node_modules/@webex/webex-server/src/webex.js b/packages/node_modules/@webex/webex-server/src/webex.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/webex-server/src/webex.js +++ b/packages/node_modules/@webex/webex-server/src/webex.js @@ -19,7 +19,7 @@ import '@webex/internal-plugin-search'; import '@webex/internal-plugin-support'; import '@webex/internal-plugin-team'; import '@webex/internal-plugin-user'; -import '@webex/internal-plugin-wdm'; +import '@webex/internal-plugin-device'; import WebexCore from '@webex/webex-core';
refactor(webex-server): migrate to device Migrate from internal-plugin-wdm to internal-plugin-device.
webex_spark-js-sdk
train
js
35653386c18d8b2b075e0cb5356e32278832fede
diff --git a/hypervisor/pod.go b/hypervisor/pod.go index <HASH>..<HASH> 100644 --- a/hypervisor/pod.go +++ b/hypervisor/pod.go @@ -105,6 +105,15 @@ func (mypod *PodStatus) AddContainer(containerId, name, image string, cmds []str mypod.Containers = append(mypod.Containers, container) } +func (mypod *PodStatus) DeleteContainer(containerId string) { + for i, c := range mypod.Containers { + if c.Id == containerId { + mypod.Containers = append(mypod.Containers[:i], mypod.Containers[i+1:]...) + return + } + } +} + func (mypod *PodStatus) GetPodIP(vm *Vm) []string { if mypod.Vm == "" { return nil
support DeleteContainer for PodStatus
hyperhq_runv
train
go
4b7d6d80c5ff6ae8d58824bdee4c628960928444
diff --git a/tests/integration/modules/test_win_pkg.py b/tests/integration/modules/test_win_pkg.py index <HASH>..<HASH> 100644 --- a/tests/integration/modules/test_win_pkg.py +++ b/tests/integration/modules/test_win_pkg.py @@ -55,7 +55,6 @@ class WinPKGTest(ModuleCase): # now add new sls with salt.utils.fopen(CURL, 'w') as fp_: fp_.write(textwrap.dedent(''' - {% set PROGRAM_FILES = "%ProgramFiles%" %} curl: '7.46.0': full_name: 'cURL'
Remove unnecessary jinja in curl.sls file
saltstack_salt
train
py
81b56d59bde1646b1988192b643d9833255575dd
diff --git a/jupyter_server_proxy/handlers.py b/jupyter_server_proxy/handlers.py index <HASH>..<HASH> 100644 --- a/jupyter_server_proxy/handlers.py +++ b/jupyter_server_proxy/handlers.py @@ -140,7 +140,7 @@ class ProxyHandler(WebSocketHandlerMixin, IPythonHandler): else: client_path = proxied_path - # client_path = quote(client_path) + client_path = quote(client_path) client_uri = '{protocol}://{host}:{port}{path}'.format( protocol=protocol,
Recover the fix so the test should pass
jupyterhub_jupyter-server-proxy
train
py
d88a941b8c7b7618fcf1f3c41eaa0deb14cadfea
diff --git a/src/UuidFactory.php b/src/UuidFactory.php index <HASH>..<HASH> 100644 --- a/src/UuidFactory.php +++ b/src/UuidFactory.php @@ -55,7 +55,7 @@ class UuidFactory implements UuidFactoryInterface */ private $timeGenerator = null; - /* + /** * * @var TimeConverterInterface */
Fix errant docblock comment asterisk removal
ramsey_uuid
train
php
14fba3d889d166f48e0989ad374c91e0b2637973
diff --git a/lib/upgrader.js b/lib/upgrader.js index <HASH>..<HASH> 100644 --- a/lib/upgrader.js +++ b/lib/upgrader.js @@ -184,8 +184,7 @@ var Upgrader = new (function() { }, needsUpgradeRemotePersonFeeds = function(person) { return !person._user && - (_.some(["replies", "likes", "shares"], function(feed) { return person[feed] && isMismatchURL(person, person[feed].url); }) || - _.some(["followers", "following", "lists", "favorites"], function(feed) { return !_.has(person, feed) || isMismatchURL(person, person[feed].url); }) || + (_.some(["followers", "following", "lists", "favorites"], function(feed) { return !_.has(person, feed) || isMismatchURL(person, person[feed].url); }) || _.some(["self", "activity-inbox", "activity-outbox"], function(rel) { return !_.has(person.links, rel) || isMismatchURL(person, person.links[rel].href); })); }, upgradePersonFeeds = function(person, callback) {
Don't upgrade remotes for bad likes/replies/shares
pump-io_pump.io
train
js
16ce844c54a3054be10da97f33c5e0654b37a5a7
diff --git a/salt/config/__init__.py b/salt/config/__init__.py index <HASH>..<HASH> 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -921,7 +921,7 @@ VALID_OPTS = { # http://docs.python.org/2/library/ssl.html#ssl.wrap_socket # Note: to set enum arguments values like `cert_reqs` and `ssl_version` use constant names # without ssl module prefix: `CERT_REQUIRED` or `PROTOCOL_SSLv23`. - 'ssl': dict, + 'ssl': (dict, type(None)), } # default configurations
Eliminate warning when 'ssl' not set (#<I>) When not specifying 'ssl' in a config file, the following warning is displayed: `[WARNING ] Key 'ssl' with value None has an invalid type of NoneType, a dict is required for this value` This has been caused by PR #<I>. Fix this by allowing `None` as a valid value for `ssl`.
saltstack_salt
train
py
60e7278b503f3d1041663bc627a4584bbcb26d2d
diff --git a/test/db.test.js b/test/db.test.js index <HASH>..<HASH> 100644 --- a/test/db.test.js +++ b/test/db.test.js @@ -340,6 +340,32 @@ describe('Database', function () { describe('#getCandidates', function () { + it('Auto-indexing works', function (done) { + d.options.autoIndexing.should.equal(true); + + d.insert({ tf: 4, r: 6 }, function (err, _doc1) { + d.getCandidates({ r: 6, tf: 4 }, null, function(data) { + assert.isDefined(d.indexes.tf); + assert.isDefined(d.indexes.r); + done(); + }); + }); + }); + + + it('Auto-indexing can be disabled', function (done) { + d.options.autoIndexing.should.equal(true); + d.options.autoIndexing = false; + + d.insert({ tf: 4, r: 6 }, function (err, _doc1) { + d.getCandidates({ r: 6, tf: 4 }, null, function(data) { + assert.isUndefined(d.indexes.tf); + assert.isUndefined(d.indexes.r); + done(); + }); + }); + }); + it('Can use an index to get docs with a basic match on two indexes', function (done) { d.options.autoIndexing.should.equal(true);
Tests: testing auto-indexing
Ivshti_linvodb3
train
js
073c65a6ebf9fa79f89429b21b243ea36f81ebf2
diff --git a/source/rafcon/gui/controllers/state_editor/description_editor.py b/source/rafcon/gui/controllers/state_editor/description_editor.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/controllers/state_editor/description_editor.py +++ b/source/rafcon/gui/controllers/state_editor/description_editor.py @@ -43,9 +43,10 @@ class DescriptionEditorController(EditorController): view.textview.connect('size-allocate', self.scroll_to_bottom) - if isinstance(self.model.state, LibraryState): + if isinstance(self.model.state, LibraryState) or self.model.state.get_library_root_state() is not None: view.textview.set_sensitive(True) - description = self.model.state.state_copy.description if self.model.state.state_copy.description is not None else '' + _state = self.model.state.state_copy if isinstance(self.model.state, LibraryState) else self.model.state + description = _state.description if _state.description is not None else '' view.textview.get_buffer().set_text(description) view.textview.set_editable(False) else:
state editor: with inner library state selection support for Description widget - all descriptions of inner library states are handled like they are library state descriptions
DLR-RM_RAFCON
train
py
c6ae9e2711ee89c3833540e344b47da7ba87c471
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ REQUIRES = [ 'retrying >= 1.3.3', 'six >= 1.8.0', 'jsonpickle >= 0.9.2', + 'PyYAML >= 3.11', ] with open('README.md', 'r') as f:
Adding PyYAML to setup.py
sky-shiny_smolder
train
py
b97c315df59a0dc4c46872d6ce24bd6e4d3ded3f
diff --git a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java index <HASH>..<HASH> 100644 --- a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java +++ b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/DriverConductor.java @@ -845,9 +845,9 @@ public class DriverConductor extends Agent return countersManager.allocate(String.format("%s pos: %s %x %x", type, dirName, sessionId, streamId)); } - private String generateSourceInfo(final InetSocketAddress address) + private static String generateSourceInfo(final InetSocketAddress address) { - return String.format("%s:%d", address.getAddress().getHostAddress(), address.getPort()); + return String.format("%s:%d", address.getHostString(), address.getPort()); } private static DriverSubscription removeSubscription(
[Java]: make a method static that doesn't need to be a class method. Use jdk 7 method for host string that won't lookup.
real-logic_aeron
train
java
5dd8277f5b7ab800609a8a3241ba398ac4efc370
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -485,8 +485,8 @@ module ActionView # # Generates a select field for hours that defaults to the number given. # select_hour(13) # - # # Generates a select field for hours that defaults to the minutes for the time in my_time - # # that is named 'stride' rather than 'second'. + # # Generates a select field for hours that defaults to the hour for the time in my_time + # # that is named 'stride' rather than 'hour'. # select_hour(my_time, :field_name => 'stride') # # # Generates a select field for hours with a custom prompt. Use <tt>:prompt => true</tt> for a
use 'hour' instead of 'minutes' and 'second' for select_hour
rails_rails
train
rb
e87cf252e1573520eb1ff98ea2e0f28eee11eb4f
diff --git a/pyfolio/interesting_periods.py b/pyfolio/interesting_periods.py index <HASH>..<HASH> 100644 --- a/pyfolio/interesting_periods.py +++ b/pyfolio/interesting_periods.py @@ -58,3 +58,6 @@ PERIODS['Flash Crash'] = ( # April and October 2014). PERIODS['Apr14'] = (pd.Timestamp('20140401'), pd.Timestamp('20140501')) PERIODS['Oct14'] = (pd.Timestamp('20141001'), pd.Timestamp('20141101')) + +# Market +PERIODS['Aug15'] = (pd.Timestamp('20150820'), pd.Timestamp('20150904'))
ENH Add market stress period for Aug <I> Closes #<I>.
quantopian_pyfolio
train
py
008c3d3433e6d7a2052e746b7774ebf0a5c45c4e
diff --git a/polyfills/Object.defineProperty/polyfill-ie7.js b/polyfills/Object.defineProperty/polyfill-ie7.js index <HASH>..<HASH> 100755 --- a/polyfills/Object.defineProperty/polyfill-ie7.js +++ b/polyfills/Object.defineProperty/polyfill-ie7.js @@ -15,7 +15,7 @@ Object.defineProperty = function defineProperty(object, property, descriptor) { // handle descriptor.get if ('get' in descriptor) { - object[propertyString] = object === Element.prototype ? Element.__defineGetter__(propertyString, descriptor.get) : descriptor.get.call(object); + object[propertyString] = object === Element.prototype ? new Element.__getter__(descriptor.get) : descriptor.get.call(object); } // handle descriptor.value else {
Update defineProperty for old IE
Financial-Times_polyfill-service
train
js
b2cb028b32edf0918caa681b647ce2d1b6c98dc2
diff --git a/requests_html.py b/requests_html.py index <HASH>..<HASH> 100644 --- a/requests_html.py +++ b/requests_html.py @@ -583,7 +583,7 @@ class HTML(BaseParser): Chromium into your home directory (``~/.pyppeteer``). """ - self.browser = self.session.browser # Automatycally create a event loop and browser + self.browser = self.session.browser # Automatically create a event loop and browser content = None # Automatically set Reload to False, if example URL is being used. @@ -766,8 +766,8 @@ class AsyncHTMLSession(BaseSession): def run(self, *coros): """ Pass in all the coroutines you want to run, it will wrap each one - in a task, run it and wait for the result. Retuen a list with all - results, this are returned in the same order coros are passed in. """ + in a task, run it and wait for the result. Return a list with all + results, this is returned in the same order coros are passed in. """ tasks = [ asyncio.ensure_future(coro()) for coro in coros ]
Update requests_html.py small grammar/typos
kennethreitz_requests-html
train
py
ffeb6476c08d9609bdedac88aab829a82e76c422
diff --git a/capnslog/formatters.go b/capnslog/formatters.go index <HASH>..<HASH> 100644 --- a/capnslog/formatters.go +++ b/capnslog/formatters.go @@ -135,3 +135,23 @@ func (lf *LogFormatter) Format(pkg string, _ LogLevel, _ int, entries ...interfa func (lf *LogFormatter) Flush() { // noop } + +// NilFormatter is a no-op log formatter that does nothing. +type NilFormatter struct { +} + +// NewNilFormatter is a helper to produce a new LogFormatter struct. It logs no +// messages so that you can cause part of your logging to be silent. +func NewNilFormatter() Formatter { + return &NilFormatter{} +} + +// Format does nothing. +func (_ *NilFormatter) Format(_ string, _ LogLevel, _ int, _ ...interface{}) { + // noop +} + +// Flush is included so that the interface is complete, but is a no-op. +func (_ *NilFormatter) Flush() { + // noop +}
capnslog: Add NilFormatter for silencing unwanted log messages This is useful for turning off logs on a project that uses capnslog that you're embedding.
coreos_pkg
train
go
89b2afceebd72c53083ffee54549cc360c57429b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( description="Django utilities for publishing events as a calendar", name="pinax-calendars", long_description=read("README.rst"), - version="1.0.0", + version="1.1.0", url="http://github.com/pinax/pinax-calendars/", license="MIT", packages=find_packages(),
bumped version to <I>
pinax_pinax-calendars
train
py
f40348d0321ffdda849af3a84c14470a4cfbf185
diff --git a/src/Test/IntegrationTestCase.php b/src/Test/IntegrationTestCase.php index <HASH>..<HASH> 100644 --- a/src/Test/IntegrationTestCase.php +++ b/src/Test/IntegrationTestCase.php @@ -206,7 +206,7 @@ abstract class IntegrationTestCase extends \PHPUnit_Framework_TestCase ); } } catch (\Exception $e) { - ob_clean(); + ob_end_clean(); if (!$exception) { throw $e; } diff --git a/test/IntegrationTests/ExceptionIntegrationTest.php b/test/IntegrationTests/ExceptionIntegrationTest.php index <HASH>..<HASH> 100644 --- a/test/IntegrationTests/ExceptionIntegrationTest.php +++ b/test/IntegrationTests/ExceptionIntegrationTest.php @@ -1,10 +1,4 @@ <?php -/** - * Created by PhpStorm. - * User: ASUS T100 - * Date: 2014.06.14. - * Time: 21:46 - */ namespace Minty\IntegrationTests;
Correctly close output buffer in tests.
bugadani_Minty
train
php,php
f13c0380db4f8ce3aad37fbc944ef2e92b763539
diff --git a/config/common.php b/config/common.php index <HASH>..<HASH> 100644 --- a/config/common.php +++ b/config/common.php @@ -26,7 +26,7 @@ return [ 'useMemcached' => true, 'servers' => [ 'memcached' => [ - 'host' => 'memcached', + 'host' => $params['memcached.host'], 'port' => 11211, 'weight' => 60, ], diff --git a/config/params.php b/config/params.php index <HASH>..<HASH> 100644 --- a/config/params.php +++ b/config/params.php @@ -62,4 +62,6 @@ return [ 'ad-banner.dashboard.items' => [], 'ad-banner.sidebar.items' => [], + + 'memcached.host' => 'memcached', ];
Use prop for memcached host
hiqdev_hipanel-core
train
php,php
c5bd130bb3a34a98ad790abe9147696facc5ed53
diff --git a/lib/phantomScript.js b/lib/phantomScript.js index <HASH>..<HASH> 100644 --- a/lib/phantomScript.js +++ b/lib/phantomScript.js @@ -10,10 +10,10 @@ var webpage = require('webpage'); var webserver = require('webserver').create(); var system = require('system'); var fs = require('fs'); -var port = system.stdin.readLine(); +var hostPort = system.stdin.readLine(); var page = webpage.create(); -var service = webserver.listen('127.0.0.1:' + port, function (req, res) { +var service = webserver.listen(hostPort, function (req, res) { try { res.statusCode = 200; res.setHeader('Content-Type', 'application/json');
OpenShift IP and PORT
pofider_phantom-html-to-pdf
train
js
b2990064ad983471cdea83a34b1ba4b0b5f570e0
diff --git a/resumable.js b/resumable.js index <HASH>..<HASH> 100644 --- a/resumable.js +++ b/resumable.js @@ -60,8 +60,8 @@ var Resumable = function(opts){ if($.events[i]==event) $.events[i+1].apply($,args.slice(1)); if($.events[i]=='catchall') $.events[i+1].apply(null,args); } - if(event=='fileError') $.fire('error', args[2], args[1]); - if(event=='fileProgress') $.fire('progress'); + if(event=='fileerror') $.fire('error', args[2], args[1]); + if(event=='fileprogress') $.fire('progress'); };
fix typo, event was lowercased earlier, make correct comparison
23_resumable.js
train
js
74326ba8e38f184cd582df2f672d0d5f6c01c840
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -872,7 +872,7 @@ $$.util.regex = {}; - $$.util.regex.number = "(?:[-]?\\d*\\.\\d+|[-]?\\d+|[-]?\\d*\\.\\d+[eE]\\d+)"; + $$.util.regex.number = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))"; $$.util.regex.rgba = "rgb[a]?\\(("+ $$.util.regex.number +"[%]?)\\s*,\\s*("+ $$.util.regex.number +"[%]?)\\s*,\\s*("+ $$.util.regex.number +"[%]?)(?:\\s*,\\s*("+ $$.util.regex.number +"))?\\)"; $$.util.regex.rgbaNoBackRefs = "rgb[a]?\\((?:"+ $$.util.regex.number +"[%]?)\\s*,\\s*(?:"+ $$.util.regex.number +"[%]?)\\s*,\\s*(?:"+ $$.util.regex.number +"[%]?)(?:\\s*,\\s*(?:"+ $$.util.regex.number +"))?\\)";
Selectors containing numbers represented using scientific notation not supported #<I>
cytoscape_cytoscape.js
train
js
5b54af5886b522a37c718d71ae5d62c43dd0ef6a
diff --git a/core/src/main/java/org/commonjava/indy/core/content/DefaultContentManager.java b/core/src/main/java/org/commonjava/indy/core/content/DefaultContentManager.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/commonjava/indy/core/content/DefaultContentManager.java +++ b/core/src/main/java/org/commonjava/indy/core/content/DefaultContentManager.java @@ -497,6 +497,12 @@ public class DefaultContentManager public boolean delete( final ArtifactStore store, final String path, final EventMetadata eventMetadata ) throws IndyWorkflowException { + if ( Boolean.TRUE.equals( eventMetadata.get( CHECK_CACHE_ONLY ) ) && hosted == store.getKey().getType() ) + { + logger.info( "Can not delete from hosted {}, path: {}", store.getKey(), path ); + return false; + } + logger.info( "Delete from {}, path: {}", store.getKey(), path ); boolean result = false; @@ -513,6 +519,7 @@ public class DefaultContentManager { throw new IndyWorkflowException( "Failed to lookup concrete members of: %s. Reason: %s", e, store, e.getMessage() ); } + for ( final ArtifactStore member : members ) { if ( downloadManager.delete( member, path, eventMetadata ) )
Protect hosted from being deleted when cache-only is true (#<I>)
Commonjava_indy
train
java
307d064fde66f519720d62213d00aaeb75176e46
diff --git a/init.go b/init.go index <HASH>..<HASH> 100644 --- a/init.go +++ b/init.go @@ -75,7 +75,7 @@ type pluginDetail struct { } func init() { - apid.RegisterPlugin(initPlugin) + apid.RegisterPlugin(initPlugin, pluginData) } func initConfigDefaults() { diff --git a/pluginData.go b/pluginData.go index <HASH>..<HASH> 100644 --- a/pluginData.go +++ b/pluginData.go @@ -18,7 +18,7 @@ import "github.com/apid/apid-core" var pluginData = apid.PluginData{ Name: "apidApigeeSync", - Version: "0.0.3", + Version: "0.0.4", ExtraData: map[string]interface{}{ "schemaVersion": "0.0.2", },
[<I>] include pluginData as one of the parameter while registration. This will be used for plugin version tracker (#<I>)
apid_apidApigeeSync
train
go,go
2eb8c6e05cb5a5ddddc8bea81a8ea71c001555fa
diff --git a/lib/rvc/modules/vm.rb b/lib/rvc/modules/vm.rb index <HASH>..<HASH> 100644 --- a/lib/rvc/modules/vm.rb +++ b/lib/rvc/modules/vm.rb @@ -79,18 +79,19 @@ opts :wait_for_shutdown do end def wait_for_shutdown vms, opts - finish_time = Time.now + opts[:timeout] - while Time.now < finish_time - all_off = true - vms.each do |vm| - if vm.summary.runtime.powerState == 'poweredOn' - all_off = false + Timeout.timeout opts[:timeout] do + while true + all_off = true + vms.each do |vm| + if vm.summary.runtime.powerState == 'poweredOn' + all_off = false + end end + return if all_off + sleep opts[:delay] end - return if all_off - sleep_time = [opts[:delay], finish_time - Time.now].min - sleep sleep_time if sleep_time > 0 end +rescue Timeout::Error err "At least one VM did not shut down!" end
Updated wait_for_shutdown to use timeout
vmware_rvc
train
rb
07438776d9b117378a495c262c024d0323235d2c
diff --git a/openpnm/topotools/topotools.py b/openpnm/topotools/topotools.py index <HASH>..<HASH> 100644 --- a/openpnm/topotools/topotools.py +++ b/openpnm/topotools/topotools.py @@ -1441,7 +1441,13 @@ def merge_networks(network, donor=[]): if network[key].dtype == bool: donor[key] = False else: - donor[key] = sp.nan + element = key.split('.')[0] + L = donor._count(element) + try: + W = network[key].shape[1] + except IndexError: + W = 1 + donor[key] = sp.squeeze(sp.empty([L, W])*sp.nan) pop_flag = True # Then merge it with existing array on network try:
Adding check for width of array to create based on size of data on donor
PMEAL_OpenPNM
train
py
bc0259c84e39fd036990c2e6fa1d5fb8d1dad978
diff --git a/Resources/public/js/KilikTable.js b/Resources/public/js/KilikTable.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/KilikTable.js +++ b/Resources/public/js/KilikTable.js @@ -410,18 +410,23 @@ function KilikTable(id, path, options) { var massActions = $('[data-mass-action]', $table); massActions.each(function() { - var checked = $('[name="kilik_' + table.id + '_selected[]"]').val(), + var checkedRows = [], event, eventDetails, massActionName, action; massActionName = $(this).data('name'); action = $(this).data('mass-action'); $(this).on('click', function () { + $('[name="kilik_' + table.id + '_selected[]"]').each(function() { + if ($(this).is(":checked")) { + checkedRows.push($(this).val()); + } + }); if (action !== '') { form.attr("action", action); form.submit(); } else { - eventDetails = { 'checked': checked, 'action' : massActionName }; + eventDetails = { 'checked': checkedRows, 'action' : massActionName }; $table.trigger('massAction', [eventDetails]); } });
get all checked rows for javascript event
KilikFr_TableBundle
train
js
4102871392e487427c6acb36a1c287355c365ac4
diff --git a/lib/OpenLayers/Layer/VirtualEarth.js b/lib/OpenLayers/Layer/VirtualEarth.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Layer/VirtualEarth.js +++ b/lib/OpenLayers/Layer/VirtualEarth.js @@ -4,6 +4,7 @@ /** + * @requires OpenLayers/Layer/SphericalMercator.js * @requires OpenLayers/Layer/EventPane.js * @requires OpenLayers/Layer/FixedZoomLevels.js */
As we do for the other proprietary providers, let's pull in SphericalMercator with VE. No functional change. git-svn-id: <URL>
openlayers_openlayers
train
js
cb914cc501eb4079d73187272c187d6dd0764db5
diff --git a/lib/gifsparser.js b/lib/gifsparser.js index <HASH>..<HASH> 100644 --- a/lib/gifsparser.js +++ b/lib/gifsparser.js @@ -15,7 +15,7 @@ exports.parseGIF = function (gif, successCB, errorCB) { var frames = []; var loopCnt = 0; if (gif[0] === 0x47 && gif[1] === 0x49 && gif[2] === 0x46 && // 'GIF' - gif[3] === 0x38 && gif[4] === 0x39 && gif[5] === 0x61) { // '89a' + gif[3] === 0x38 && (gif[4] === 0x39 || gif[4] === 0x37) && gif[5] === 0x61) { // '89a' pos += 13 + (+!!(gif[10] & 0x80) * Math.pow(2, (gif[10] & 0x07) + 1) * 3); var gifHeader = gif.subarray(0, pos); while (gif[pos] && gif[pos] !== 0x3b) { @@ -85,4 +85,4 @@ exports.parseGIF = function (gif, successCB, errorCB) { } loadImg(); } -} \ No newline at end of file +}
<I>a GIFs aren't supported by @Danpollak
mayognaise_aframe-gif-shader
train
js
03e8fc55672fbdc2b46b34ae796f53f0933b554f
diff --git a/src/bn/passwords.php b/src/bn/passwords.php index <HASH>..<HASH> 100644 --- a/src/bn/passwords.php +++ b/src/bn/passwords.php @@ -13,10 +13,10 @@ return [ | */ - 'password' => 'Passwords must be at least six characters and match the confirmation.', - 'reset' => 'Your password has been reset!', - 'sent' => 'We have e-mailed your password reset link!', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that e-mail address.", + 'password' => 'পাসওয়ার্ডে কমপক্ষে ছয় অক্ষরের হতে হবে এবং নিশ্চিতকরণ মেলাতে হবে .', + 'reset' => 'আপনার পাসওয়ার্ড পুনরায় সেট করা হয়েছে!', + 'sent' => 'আমরা আপনার পাসওয়ার্ড পুনরায় সেট করার লিঙ্ক ইমেইল করেছি !', + 'token' => 'এই পাসওয়ার্ড রিসেট টোকেন অবৈধ.', + 'user' => "আমরা এই ইমেল ঠিকানা দিয়ে ব্যবহারকারী খুঁজে পাচ্ছি না", ];
Update passwords.php file bangla language
caouecs_Laravel-lang
train
php
bfbda389397a17c9ab45de2d953f71d4c32554e4
diff --git a/state/api/apiclient.go b/state/api/apiclient.go index <HASH>..<HASH> 100644 --- a/state/api/apiclient.go +++ b/state/api/apiclient.go @@ -339,6 +339,9 @@ func (s *State) AllFacadeVersions() map[string][]int { // BestFacadeVersion compares the versions of facades that we know about, and // the versions available from the server, and reports back what version is the // 'best available' to use. +// TODO(jam) this is the eventual implementation of what version of a given +// Facade we will want to use. It needs to line up the versions that the server +// reports to us, with the versions that our client knows how to use. func (s *State) BestFacadeVersion(facade string) int { return 0 }
add a TODO around the BestFacadeVersion function.
juju_juju
train
go
2bb068a2b336c329bdd9ebf51bf26bc7c67c13a5
diff --git a/Neos.Utility.ObjectHandling/Tests/Unit/TypeHandlingTest.php b/Neos.Utility.ObjectHandling/Tests/Unit/TypeHandlingTest.php index <HASH>..<HASH> 100644 --- a/Neos.Utility.ObjectHandling/Tests/Unit/TypeHandlingTest.php +++ b/Neos.Utility.ObjectHandling/Tests/Unit/TypeHandlingTest.php @@ -202,7 +202,8 @@ class TypeHandlingTest extends \PHPUnit\Framework\TestCase ['ArrayObject', true], ['SplObjectStorage', true], ['Doctrine\Common\Collections\Collection', true], - ['Doctrine\Common\Collections\ArrayCollection', true] + ['Doctrine\Common\Collections\ArrayCollection', true], + ['\IteratorAggregate', true] ]; }
TASK: Add \IteratorAggregate to unit test
neos_flow-development-collection
train
php
1988c451f3af1f3c782ffac5416e3e56dbfb4c98
diff --git a/model/EditingInterface.js b/model/EditingInterface.js index <HASH>..<HASH> 100644 --- a/model/EditingInterface.js +++ b/model/EditingInterface.js @@ -173,7 +173,7 @@ class EditingInterface { paste(content) { const sel = this._selection - if (sel && !sel.isNull()) { + if (sel && !sel.isNull() && !sel.isCustomSelection()) { return this._impl.paste(this, content) } } diff --git a/model/paste.js b/model/paste.js index <HASH>..<HASH> 100644 --- a/model/paste.js +++ b/model/paste.js @@ -13,8 +13,8 @@ import { setCursor } from './selectionHelpers' function paste(tx, args) { let sel = tx.selection - if (!sel || sel.isNull()) { - throw new Error("Can not paste, without selection.") + if (!sel || sel.isNull() || sel.isCustomSelection()) { + throw new Error("Can not paste, without selection or a custom selection.") } args = args || {} args.text = args.text || ''
Don't execute paste with a custom selection.
substance_substance
train
js,js
756222a5d22f8d5c4ef0f9db21264d2214c918d3
diff --git a/beets/mediafile.py b/beets/mediafile.py index <HASH>..<HASH> 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -1092,7 +1092,7 @@ class DateField(MediaField): datestring = super(DateField, self).__get__(mediafile, None) if isinstance(datestring, basestring): datestring = re.sub(r'[Tt ].*$', '', unicode(datestring)) - items = re.split('-|/', unicode(datestring)) + items = re.split('[-/]', unicode(datestring)) else: items = []
Added test for date with slashed and fixed date regex Original: beetbox/beets@b<I>da5e
beetbox_mediafile
train
py
c75417d81b2ad4e1b8d2b95bbc8d0bbb5e8ab4f3
diff --git a/example/inventories/example.py b/example/inventories/example.py index <HASH>..<HASH> 100644 --- a/example/inventories/example.py +++ b/example/inventories/example.py @@ -1,27 +1,17 @@ # pyinfra -# File: example/inventories/test.py -# Desc: basic IP based inventory for testing the example -# see ./hostnames.py for a more advanced example +# File: example/inventories/example.py +# Desc: example inventory, not actually used anywhere -# Defines a group - group names must be defined in ALL_CAPS -linux = [ - # Ubuntu 14 - '20.20.20.21', - # Ubuntu 15 - '20.20.20.26', - # CentOS 6 - '20.20.20.22', - # CentOS 7 - '20.20.20.23', - # Debian 7 - '20.20.20.24', - # Debian 8 - '20.20.20.27', - # Fedora 23 - '20.20.20.28' +# Define a group +web_servers = [ + 'web-01.company.net', + 'web-02.company.net', ] -bsd = [ - # OpenBSD 5.8 - '20.20.20.25' + +# Define another group +db_servers = [ + 'db-01.company.net', + # Define hosts with extra, per-host, data + ('db-02.company.net', {'hello': 'world'}), ]
Make example inventory a non-usable example now we have `@vagrant`.
Fizzadar_pyinfra
train
py
785f21b832366735ba6157724cda74b844aa1210
diff --git a/tasks/helpers.js b/tasks/helpers.js index <HASH>..<HASH> 100644 --- a/tasks/helpers.js +++ b/tasks/helpers.js @@ -4,6 +4,13 @@ var lf = grunt.util.linefeed; var fs = require('fs'); var Helpers = {}; +/* Overwrite browser env variables if grunt options are set */ +var browsers = grunt.option('browser') || grunt.option('browsers'); +if (browsers) { + process.env.KARMA_BROWSERS = browsers; + process.env.PROTRACTOR_BROWSERS = browsers; +} + Helpers.config = { pkg: grunt.file.readJSON('./package.json'), env: process.env diff --git a/tasks/options/karma.js b/tasks/options/karma.js index <HASH>..<HASH> 100644 --- a/tasks/options/karma.js +++ b/tasks/options/karma.js @@ -1,6 +1,6 @@ var files = require('../files'); var grunt = require('grunt'); -var browsers = grunt.option('browser') || grunt.option('browsers') || process.env.KARMA_BROWSERS; +var browsers = process.env.KARMA_BROWSERS; module.exports = { options: {
Make e2e browsers configurable by option
Jimdo_angular-draggabilly
train
js,js
ed2a860d19644d979d88f491c84e8ba1a09111c5
diff --git a/test/context_test.rb b/test/context_test.rb index <HASH>..<HASH> 100644 --- a/test/context_test.rb +++ b/test/context_test.rb @@ -1,5 +1,4 @@ # coding: utf-8 -require 'treetop' require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") Treetop.load File.dirname(__FILE__) + "/../lib/personify/parser/personify" diff --git a/test/parser_test.rb b/test/parser_test.rb index <HASH>..<HASH> 100644 --- a/test/parser_test.rb +++ b/test/parser_test.rb @@ -1,5 +1,4 @@ # coding: utf-8 -require 'treetop' require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") Treetop.load File.dirname(__FILE__) + "/../lib/personify/parser/personify" diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +require 'rubygems' +require 'treetop' require 'shoulda' require File.join(File.expand_path(File.dirname(__FILE__)), "../lib/personify")
Make tests run in ruby <I> too
DigitPaint_personify
train
rb,rb,rb
9e22ba86024c80a34eab4b4680101c2492b24124
diff --git a/src/components/observable/view.js b/src/components/observable/view.js index <HASH>..<HASH> 100644 --- a/src/components/observable/view.js +++ b/src/components/observable/view.js @@ -20,13 +20,14 @@ const SEPARATORS = 20 const ObservableView = ({ width = 500, height = 200, + scale = 1, completion = 1, emissions = [] }) => { const boundedPadding = (PADDING_FACTOR * width > EMISSION_RADIUS * height) ? PADDING_FACTOR : (EMISSION_RADIUS * height) / width const upperBound = 1 - boundedPadding - ARROW_WIDTH_FACTOR const transformFactor = x => ( - (upperBound - boundedPadding) * x + boundedPadding + (upperBound - boundedPadding) * (x / scale) + boundedPadding ) return (
Add scale for warping x axis
kitten_rxjs-diagrams
train
js
c3059399ddba21f4b2b79f46200824399da14bc6
diff --git a/build_config.php b/build_config.php index <HASH>..<HASH> 100644 --- a/build_config.php +++ b/build_config.php @@ -2,7 +2,7 @@ $buildConfig = array ( 'major' => 2, 'minor' => 9, - 'build' => 37, + 'build' => 38, 'shopgate_library_path' => "", 'plugin_name' => "library", 'display_name' => "Shopgate Library 2.9.x", diff --git a/classes/core.php b/classes/core.php index <HASH>..<HASH> 100644 --- a/classes/core.php +++ b/classes/core.php @@ -24,7 +24,7 @@ ################################################################################### # define constants ################################################################################### -define('SHOPGATE_LIBRARY_VERSION', '2.9.37'); +define('SHOPGATE_LIBRARY_VERSION', '2.9.38'); define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8'); define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../'));
Increased Shopgate Library <I>.x to version <I>.
shopgate_cart-integration-sdk
train
php,php
84519e2725e2093af4a1c6b6396407e31e37998f
diff --git a/src/ai/backend/client/cli/admin/users.py b/src/ai/backend/client/cli/admin/users.py index <HASH>..<HASH> 100644 --- a/src/ai/backend/client/cli/admin/users.py +++ b/src/ai/backend/client/cli/admin/users.py @@ -20,6 +20,7 @@ def user(email): ('UUID', 'uuid'), ('Username', 'username'), ('Email', 'email'), + ('Name', 'full_name'), ('Need Password Change', 'need_password_change'), ('Active?', 'is_active'), ('Created At', 'created_at'), @@ -58,6 +59,7 @@ def users(ctx, is_active): ('UUID', 'uuid'), ('Username', 'username'), ('Email', 'email'), + ('Name', 'full_name'), ('Need Password Change', 'need_password_change'), ('Active?', 'is_active'), ('Created At', 'created_at'),
List user's full name in user/users command
lablup_backend.ai-client-py
train
py
c3d6590efd6353404951da4274a2097c2c07ec5a
diff --git a/src/Commands/InfoCommand.php b/src/Commands/InfoCommand.php index <HASH>..<HASH> 100644 --- a/src/Commands/InfoCommand.php +++ b/src/Commands/InfoCommand.php @@ -88,7 +88,7 @@ class InfoCommand extends \Composer\Command\BaseCommand $composerRuntime = $this->getComposer(); try { - $package = $this->resolvePackage($packageName); + $package = $this->resolvePackage(is_string($packageName) ? $packageName : ''); } catch (PackageResolverException $exception) { $this->printException($exception, $output); diff --git a/src/Readers/JsonFileReader.php b/src/Readers/JsonFileReader.php index <HASH>..<HASH> 100644 --- a/src/Readers/JsonFileReader.php +++ b/src/Readers/JsonFileReader.php @@ -35,6 +35,10 @@ class JsonFileReader throw new \Vaimo\ComposerChangelogs\Exceptions\ReaderException($message, 0, $exception); } + if (!is_array($fileContents)) { + return array(); + } + return $fileContents; } }
address potential issues when data type of a variable is not what expected
vaimo_composer-changelogs
train
php,php
cb871c44c38a4c1575ed076389f14641afafad7d
diff --git a/launcher/src/main/java/org/apache/spark/launcher/SparkClassCommandBuilder.java b/launcher/src/main/java/org/apache/spark/launcher/SparkClassCommandBuilder.java index <HASH>..<HASH> 100644 --- a/launcher/src/main/java/org/apache/spark/launcher/SparkClassCommandBuilder.java +++ b/launcher/src/main/java/org/apache/spark/launcher/SparkClassCommandBuilder.java @@ -93,6 +93,9 @@ class SparkClassCommandBuilder extends AbstractCommandBuilder { toolsDir.getAbsolutePath(), className); javaOptsKeys.add("SPARK_JAVA_OPTS"); + } else { + javaOptsKeys.add("SPARK_JAVA_OPTS"); + memKey = "SPARK_DRIVER_MEMORY"; } List<String> cmd = buildJavaCommand(extraClassPath);
[SPARK-<I>] spark class command builder need read SPARK_JAVA_OPTS and SPARK_DRIVER_MEMORY properly SPARK_JAVA_OPTS was missed in reconstructing the launcher part, we should add it back so process launched by spark-class could read it properly. And so does `SPARK_DRIVER_MEMORY`. The missing part is [here](<URL>
apache_spark
train
java