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
78867340184cc5f831fd45265d92704fed666146
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ var path = require('path'), R = require('ramda'), pkg = require('be-goods').pkg, gulpTask = require('be-goods').gulpTask, + logger = require('be-goods').logger, cause = require('gulp-cause'), merge = require('lodash.merge'), notifications = require(path.join(__dirname, './notifications.json')), @@ -35,6 +36,12 @@ module.exports = function (gulp, opts) { } }) + if (typeof o.testsRe !== 'string') { + // NOTE: this could become a minimatch glob... + // Perhaps rename & repurpose this for deprecation warnings regarding that too. + logger.warn('Option testsRe must be of type String, for the RegExp constructor.') + } + function test(what) { var cmd = command, template = o.templateFull
testsRe type changed to string, warn people about that
gulpsome_gulp-npm-test
train
js
0a61c7ad0881c82db6fb27274cbbb6e40388004e
diff --git a/openquake/risklib/workflows.py b/openquake/risklib/workflows.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/workflows.py +++ b/openquake/risklib/workflows.py @@ -789,6 +789,7 @@ class RiskModel(collections.Mapping): def __len__(self): return len(self._workflows) + def gen_outputs(self, getters): """ Yield the output generated by each risk input and loss type """
Restored a line deleted by accident
gem_oq-engine
train
py
042306706c379e05df40cb6941af4ee0aa2092d2
diff --git a/util.js b/util.js index <HASH>..<HASH> 100644 --- a/util.js +++ b/util.js @@ -27,10 +27,11 @@ function nameFor(names, friends, source, dest) { }) if(max) return max - return dest + //finally, fallback to their name for themselves + return names[dest][dest] || dest } else - return dest + return names[dest][dest] || dest } function namedAs(names, friends, source, prefix) {
use their name for themselves, if nothing else catches
ssbc_ssb-names
train
js
29d12cd19d8ad11394108c4b9dd8542216c1951c
diff --git a/openquake/commonlib/tests/logictree_test.py b/openquake/commonlib/tests/logictree_test.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/tests/logictree_test.py +++ b/openquake/commonlib/tests/logictree_test.py @@ -2347,3 +2347,15 @@ class LogicTreeSourceSpecificUncertaintyTest(unittest.TestCase): elif src.source_id == 'a1': msg = "Wrong mmax value assigned to source 'a1'" self.assertIn(src.mfd.max_mag, mags, msg) + + def test_smlt_bad(self): + # apply to a source that does not exist in the given branch + path = os.path.join(DATADIR, 'source_specific_uncertainty') + job_ini = os.path.join(path, 'job.ini') + oqparam = readinput.get_oqparam(job_ini) + oqparam.inputs['source_model_logic_tree'] = os.path.join( + oqparam.base_path, 'smlt_bad.xml') + with self.assertRaises(ValueError) as ctx: + readinput.get_composite_source_model(oqparam) + self.assertIn('The source c1 is not in the source model, please fix ' + 'applyToSources', str(ctx.exception))
Test applyToSources for a source that does not exist in the given branch [skip hazardlib]
gem_oq-engine
train
py
0182c52e9ed2b7674a2e30d96793fcc7cc373966
diff --git a/src/sap.m/src/sap/m/Select.js b/src/sap.m/src/sap/m/Select.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/Select.js +++ b/src/sap.m/src/sap/m/Select.js @@ -1889,7 +1889,9 @@ function( }; Select.prototype.updateAriaLabelledBy = function(sValueState, sOldValueState) { - var aIDs = this.$().attr("aria-labelledby").split(" "), + var $this = this.$(), + sAttr = $this.attr("aria-labelledby"), + aIDs = sAttr ? sAttr.split(" ") : [], sNewIDs; if (sOldValueState !== ValueState.None) { @@ -1901,7 +1903,7 @@ function( } sNewIDs = aIDs.join(" "); - this.$().attr("aria-labelledby", sNewIDs); + $this.attr("aria-labelledby", sNewIDs); }; /**
[INTERNAL][FIX] m.Select: updateAriaState method fixed BCP: <I> -additional fix correcting safety net problems Change-Id: I0eaf6a9fa9c<I>c<I>b6d<I>b<I>e<I>ea7
SAP_openui5
train
js
e7e6da4ec28d34334c35cc278f56d00fced516c9
diff --git a/ActiveFixture.php b/ActiveFixture.php index <HASH>..<HASH> 100644 --- a/ActiveFixture.php +++ b/ActiveFixture.php @@ -69,7 +69,7 @@ class ActiveFixture extends BaseActiveFixture /** * Unloads the fixture. * - * The default implementation will clean up the colection by calling [[resetCollection()]]. + * The default implementation will clean up the collection by calling [[resetCollection()]]. */ public function unload() {
Fixes #<I>: `yii\test\BaseActiveFixture::unload()` does not clean up the internal cached data
yiisoft_yii2-mongodb
train
php
d8ef46b9c37832f1bdabd904b8a5952ee647525e
diff --git a/eZ/Publish/Core/Persistence/Legacy/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Handler.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Handler.php +++ b/eZ/Publish/Core/Persistence/Legacy/Handler.php @@ -32,7 +32,9 @@ use eZ\Publish\SPI\Persistence\Handler as HandlerInterface, eZ\Publish\Core\Persistence\Legacy\Content\Search\Gateway\SortClauseHandler, eZ\Publish\Core\Persistence\Legacy\EzcDbHandler, eZ\Publish\Core\Persistence\Legacy\User, - eZ\Publish\Core\Persistence\Legacy\User\Mapper as UserMapper; + eZ\Publish\Core\Persistence\Legacy\User\Mapper as UserMapper, + ezcDbTransactionException, + RuntimeException; /** * The repository handler for the legacy storage engine @@ -782,13 +784,27 @@ class Handler implements HandlerInterface */ public function commit() { - $this->getDatabase()->commit(); + try + { + $this->getDatabase()->commit(); + } + catch ( ezcDbTransactionException $e ) + { + throw new RuntimeException( $e->getMessage() ); + } } /** */ public function rollback() { - $this->getDatabase()->rollback(); + try + { + $this->getDatabase()->rollback(); + } + catch ( ezcDbTransactionException $e ) + { + throw new RuntimeException( $e->getMessage() ); + } } }
Rethrow runtime exception if begin/commit in legacy handler throw an exception
ezsystems_ezpublish-kernel
train
php
ee9857cabb9869620819d9785833736602c2a959
diff --git a/lark/lark.py b/lark/lark.py index <HASH>..<HASH> 100644 --- a/lark/lark.py +++ b/lark/lark.py @@ -489,5 +489,14 @@ class Lark(Serialize): def source(self, value): self.source_path = value + @property + def grammar_source(self): + warn("Lark.grammar_source attribute has been renamed to Lark.source_grammar", DeprecationWarning) + return self.source_grammar + + @grammar_source.setter + def grammar_source(self, value): + self.source_grammar = value + ###}
Added backwards-compatibility property with DeprecationWarning
lark-parser_lark
train
py
f4a86190dfc37634d6be16aee07fcf0dc42a294c
diff --git a/jsonschema/cli.py b/jsonschema/cli.py index <HASH>..<HASH> 100644 --- a/jsonschema/cli.py +++ b/jsonschema/cli.py @@ -157,7 +157,7 @@ parser.add_argument( one formatted object named 'error' for each ValidationError. Only provide this option when using --output=plain, which is the default. If this argument is unprovided and --output=plain is - used, a simple default representation will be used." + used, a simple default representation will be used. """, ) parser.add_argument(
Remove stray double-quote The help-string for --error-format is triple-quoted, so remove unnecessary quote character
Julian_jsonschema
train
py
5f6dc3dc5b85b831d0d3a843ea916a5cef5c08f7
diff --git a/gandi/cli/core/base.py b/gandi/cli/core/base.py index <HASH>..<HASH> 100644 --- a/gandi/cli/core/base.py +++ b/gandi/cli/core/base.py @@ -59,11 +59,18 @@ class GandiModule(GandiConfig): @classmethod def call(cls, method, *args, **kwargs): """ Call a remote api method and return the result.""" + empty_key = kwargs.pop('empty_key', False) try: api = cls.get_api_connector() apikey = cls.get('api.key') + if not apikey and not empty_key: + cls.echo("No apikey found, please use 'gandi setup' " + "command") + sys.exit(1) except MissingConfiguration: - if not kwargs.get('safe'): + if api and empty_key: + apikey = '' + elif not kwargs.get('safe'): cls.echo("No configuration found, please use 'gandi setup' " "command") sys.exit(1)
Add empty_key kwargs to call method. This will say that apikey is not mandatory for this call.
Gandi_gandi.cli
train
py
1ddda5c5f8007bd9297b0e6f0050f03277a2549b
diff --git a/mustache.js b/mustache.js index <HASH>..<HASH> 100644 --- a/mustache.js +++ b/mustache.js @@ -85,7 +85,7 @@ var Mustache = function() { */ render_partial: function(name, context, partials) { name = this.trim(name); - if(!partials || !partials[name]) { + if(!partials || partials[name] === undefined) { throw({message: "unknown_partial '" + name + "'"}); } if(typeof(context[name]) != "object") {
Allow empty-string partials. Closes #<I>.
janl_mustache.js
train
js
18afd3e47ad2cea6301ebed3ee9a5382617a8ea9
diff --git a/ella/core/managers.py b/ella/core/managers.py index <HASH>..<HASH> 100644 --- a/ella/core/managers.py +++ b/ella/core/managers.py @@ -46,6 +46,8 @@ class RelatedManager(models.Manager): ).distinct() if mods: qset = qset.filter(content_type__in=ct_ids) + if only_from_same_site: + qset = qset.filter(category__site__pk=settings.SITE_ID) #print qset #print TaggedItem.objects.all()
Get related by tag only from same site by default.
ella_ella
train
py
ea53d6f516d6b2e12c6c4e25fb9515d1e6470854
diff --git a/server/src/test/java/org/cloudfoundry/identity/uaa/security/CsrfAwareEntryPointAndDeniedHandlerTest.java b/server/src/test/java/org/cloudfoundry/identity/uaa/security/CsrfAwareEntryPointAndDeniedHandlerTest.java index <HASH>..<HASH> 100644 --- a/server/src/test/java/org/cloudfoundry/identity/uaa/security/CsrfAwareEntryPointAndDeniedHandlerTest.java +++ b/server/src/test/java/org/cloudfoundry/identity/uaa/security/CsrfAwareEntryPointAndDeniedHandlerTest.java @@ -62,7 +62,7 @@ public class CsrfAwareEntryPointAndDeniedHandlerTest { AccessDeniedException ex = new MissingCsrfTokenException("something"); handler.handle(request, response, ex); assertEquals(HttpServletResponse.SC_FORBIDDEN, response.getStatus()); - assertEquals("{\"error\":\"Could not verify the provided CSRF token because no token was found to compare.\"}", response.getContentAsString()); + assertEquals("{\"error\":\"" + ex.getMessage() + "\"}", response.getContentAsString()); assertNull(response.getErrorMessage()); }
refactor: no need to test spring lib exeception message string - the exception message string of MissingCsrfTokenException will change soon & might change again in the future. There is no need for us to assert on the exact string, which will require us to update this assertion whenever the spring lib code change. - instead just assert that we return whatever exception message that is attached to spring's MissingCsrfTokenException [this is in preparation for bumping spring boot to <I>]
cloudfoundry_uaa
train
java
b09043fbf6d98adfd22f85a347256f545afb2c11
diff --git a/build/runtest/env.js b/build/runtest/env.js index <HASH>..<HASH> 100644 --- a/build/runtest/env.js +++ b/build/runtest/env.js @@ -357,7 +357,10 @@ var window = this; set selected(val) { return this.setAttribute("selected",val); }, get className() { return this.getAttribute("class") || ""; }, - set className(val) { return this.setAttribute("class",val); }, + set className(val) { + return this.setAttribute("class", + val.replace(/(^\s*|\s*$)/g,"")); + }, get type() { return this.getAttribute("type") || ""; }, set type(val) { return this.setAttribute("type",val); },
Added a className tweak. All core and selector tests now pass.
jquery_jquery
train
js
7ad5d501a16c86a2a7680742cc1a57e7ce4d3dd1
diff --git a/src/Zephyrus/Application/ClassLocator.php b/src/Zephyrus/Application/ClassLocator.php index <HASH>..<HASH> 100644 --- a/src/Zephyrus/Application/ClassLocator.php +++ b/src/Zephyrus/Application/ClassLocator.php @@ -39,20 +39,21 @@ class ClassLocator * definitions in the composer.json file. * * @param $namespace - * @return bool|string + * @return string + * @throws \Exception */ private static function getNamespaceDirectory($namespace) { $composerNamespaces = self::getDefinedNamespaces(); $namespaceFragments = explode('\\', $namespace); $undefinedNamespaceFragments = []; - while($namespaceFragments) { + while ($namespaceFragments) { $possibleNamespace = implode('\\', $namespaceFragments) . '\\'; - if(array_key_exists($possibleNamespace, $composerNamespaces)){ + if (array_key_exists($possibleNamespace, $composerNamespaces)) { return realpath(ROOT_DIR . DIRECTORY_SEPARATOR . $composerNamespaces[$possibleNamespace] . implode('/', $undefinedNamespaceFragments)); } $undefinedNamespaceFragments[] = array_pop($namespaceFragments); } - return false; + throw new \Exception("Specified namespace [$namespace] has not been defined"); } } \ No newline at end of file
Modified ClassLocator to throw exception if namespace not found
dadajuice_zephyrus
train
php
dc87aa8e0cc937545026b5bace3b600b94738d11
diff --git a/hangups/client.py b/hangups/client.py index <HASH>..<HASH> 100644 --- a/hangups/client.py +++ b/hangups/client.py @@ -316,6 +316,7 @@ class HangupsClient(object): # build dict of conversations and their participants self._initial_conversations = {} + self._initial_contacts = {} conversations = data_dict['ds:19'][0][3] for c in conversations: id_ = c[1][0][0] @@ -330,12 +331,20 @@ class HangupsClient(object): self._initial_conversations[id_]['participants'].append( user_ids ) + # Add the user to our list of contacts if their name is + # present. This is a hack to deal with some contacts not being + # found via the other methods. + if len(p) > 1: + display_name = p[1] + self._initial_contacts[user_ids] = { + 'first_name': display_name.split()[0], + 'full_name': display_name, + } logger.info('Found {} conversations' .format(len(self._initial_conversations))) # build dict of contacts and their names (doesn't include users not in # contacts) - self._initial_contacts = {} contacts_main = data_dict['ds:21'][0] # contacts_main[2] has some, but the format is slightly different contacts = (contacts_main[4][2] + contacts_main[5][2] +
Read contacts names from conversation participants This helps deal with contacts whose names can't be found by other methods (#4).
tdryer_hangups
train
py
c5e39bd4afa707aedc9e433e5817b098411ec434
diff --git a/MatchMakingLobby/Services/MatchMakingService.php b/MatchMakingLobby/Services/MatchMakingService.php index <HASH>..<HASH> 100644 --- a/MatchMakingLobby/Services/MatchMakingService.php +++ b/MatchMakingLobby/Services/MatchMakingService.php @@ -103,16 +103,15 @@ class MatchMakingService 'INNER JOIN Players P ON M.id = P.matchId '. 'WHERE M.id = %d ', $matchId )->fetchArrayOfAssoc(); - $match = new Match(); foreach($results as $row) { $match->players[] = $row['login']; - if($row['teamId'] === 0) + if((int)$row['teamId'] === 0) { $match->team1[] = $row['login']; } - elseif($row['teamId'] === 1) + elseif((int)$row['teamId'] === 1) { $match->team2[] = $row['login']; }
correct team repartition in BdD
maniaplanet_matchmaking-lobby
train
php
0261baca8247bb8203786e90aca96d08a2f39e8b
diff --git a/src/components/SimpleInput.js b/src/components/SimpleInput.js index <HASH>..<HASH> 100644 --- a/src/components/SimpleInput.js +++ b/src/components/SimpleInput.js @@ -49,20 +49,12 @@ const Input = React.createClass({ }, _onFocus () { - if (this.input) { - this.input.focus(); - } - this.setState({ focus: true }); }, _onBlur () { - if (this.input) { - this.input.blur(); - } - this.setState({ focus: false }); @@ -74,16 +66,15 @@ const Input = React.createClass({ return ( <div - onBlur={this._onBlur} - onFocus={this._onFocus} style={Object.assign({}, styles.wrapper, this.state.focus ? styles.activeWrapper : null)} - tabIndex={0} > {this.props.icon ? ( <Icon size={20} style={styles.icon} type={this.props.icon} /> ) : null} <input {...elementProps} + onBlur={this._onBlur} + onFocus={this._onFocus} ref={(ref) => { this.input = ref; }}
Fix bug with shift+tab keeping focus on the input
mxenabled_mx-react-components
train
js
dcc063ab89c47f9febaf8f42436b26f35691e399
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -41,6 +41,18 @@ module.exports = function (grunt) { } }, + shell: { + sphinx: { + command: [ + 'cd docs', + 'make html' + ].join('&&'), + options: { + stdout: true + } + } + }, + uglify: { options: { beautify: DEBUG @@ -163,5 +175,6 @@ module.exports = function (grunt) { grunt.registerTask('build-js', ['jade', 'jade-index', 'uglify:app']); grunt.registerTask('init', ['setup', 'uglify:libs']); + grunt.registerTask('docs', ['shell']); grunt.registerTask('default', ['stylus', 'build-js']); };
Adding a grunt task for building the sphinx documentation.
girder_girder
train
js
41182c056938859caa57ba6a939cabbad6dead3f
diff --git a/src/com/opera/core/systems/OperaDriver.java b/src/com/opera/core/systems/OperaDriver.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/OperaDriver.java +++ b/src/com/opera/core/systems/OperaDriver.java @@ -81,6 +81,12 @@ import java.util.logging.SimpleFormatter; import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * OperaDriver is an implementation of the WebDriver interface that allows you to drive the Opera + * web browser. The driver uses the Scope protocol to communicate with Opera directly from Java. + * + * The implementation is vendor-supported and developed by Opera Software and volunteers. + */ public class OperaDriver extends RemoteWebDriver implements TakesScreenshot { // Want to thin some of these out, but will need some re-thinking.
Adding description of the OperaDriver class
operasoftware_operaprestodriver
train
java
01aa689af1a7fbddfd9637cfc84c80123bd6593b
diff --git a/test/couch/requirejs/test.js b/test/couch/requirejs/test.js index <HASH>..<HASH> 100644 --- a/test/couch/requirejs/test.js +++ b/test/couch/requirejs/test.js @@ -1,4 +1,4 @@ require(['request'], function(request) { - window.request = request + window.req = request console.log('ok') })
Change the name of the global variable so I can test whether anything is leaking there accidentally
iriscouch_browser-request
train
js
0cac678a91f60fb7747005fe40892d8c6744484f
diff --git a/test/GroupsTestCase.php b/test/GroupsTestCase.php index <HASH>..<HASH> 100644 --- a/test/GroupsTestCase.php +++ b/test/GroupsTestCase.php @@ -1,6 +1,5 @@ <?php require_once dirname(__FILE__) . '/../../tao/test/TestRunner.php'; -require_once dirname(__FILE__) . '/../includes/common.php'; /** * Test the group management
* implement Property::setDomain to enable multi domains * create a TestSuite for tao to run all the TAO* extensions unit tests * add the class cloning into the abstract service * refactor the getProperties between 2 classes into the abtract service * add the taoQual extension * add the remove method in the wfEngine/actions/ServiceAPi to remove/reset the process shared variables git-svn-id: <URL>
oat-sa_extension-tao-group
train
php
3287c3f40762e9cb99927b3f89828f50942eb48f
diff --git a/tests/__main__.py b/tests/__main__.py index <HASH>..<HASH> 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -1,6 +1,8 @@ import os +import sys from subprocess import check_call + REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.chdir(REPO_ROOT) @@ -10,8 +12,14 @@ os.putenv( os.putenv("DVC_HOME", REPO_ROOT) os.putenv("DVC_TEST", "true") +if len(sys.argv) == 1: + scope = "--all-modules" +else: + scope = " ".join(sys.argv[1:]) + cmd = ( "nosetests -v --processes=-1 --process-timeout=500 --cover-inclusive " - "--cover-erase --cover-package=dvc --with-coverage --all-modules --with-flaky" + "--cover-erase --cover-package=dvc --with-coverage --with-flaky " + "{scope} ".format(scope=scope) ) check_call(cmd, shell=True)
add ability run tests from specified file(s)
iterative_dvc
train
py
ac8355f9d463946dcf9dabe41178c64a7aee2f38
diff --git a/src/parser/selectors.js b/src/parser/selectors.js index <HASH>..<HASH> 100644 --- a/src/parser/selectors.js +++ b/src/parser/selectors.js @@ -17,7 +17,10 @@ module.exports = tree => { } const getSelectorsFromRule = rule => { - return rule.selector.split(',').map(s => s.trim()) + return rule.selector + .split(',') + .map(s => s.trim()) + .filter(Boolean) } module.exports.getSelectorsFromRule = getSelectorsFromRule diff --git a/test/parser/selectors.js b/test/parser/selectors.js index <HASH>..<HASH> 100644 --- a/test/parser/selectors.js +++ b/test/parser/selectors.js @@ -32,3 +32,17 @@ test('"selectors" in @keyframes are not passed as actual selectors', async t => t.deepEqual(actual, expected) }) + +test('it ignores trailing commas in selectorLists', async t => { + const fixture = ` + html, + body, { + color: red; + } + ` + + const {selectors: actual} = await parser(fixture) + const expected = ['html', 'body'] + + t.deepEqual(actual, expected) +})
Don't throw on trailing commas in SelectorList (#<I>) Refs #<I> (thnx @xqin) Technically a traling comma in a SelectorList is a syntax error that the CSS engine does not know how to handle (reduced testcase: <URL>
projectwallace_css-analyzer
train
js,js
060d5da72e03ae4eb21004fffc0e88ee018f78bd
diff --git a/packages/material-ui/src/Tabs/Tabs.js b/packages/material-ui/src/Tabs/Tabs.js index <HASH>..<HASH> 100644 --- a/packages/material-ui/src/Tabs/Tabs.js +++ b/packages/material-ui/src/Tabs/Tabs.js @@ -421,7 +421,9 @@ const Tabs = React.forwardRef(function Tabs(inProps, ref) { const scroll = (scrollValue, { animation = true } = {}) => { if (animation) { - animate(scrollStart, tabsRef.current, scrollValue); + animate(scrollStart, tabsRef.current, scrollValue, { + duration: theme.transitions.duration.standard, + }); } else { tabsRef.current[scrollStart] = scrollValue; }
[Tabs] Use theme transition duration for the Tab animation (#<I>)
mui-org_material-ui
train
js
1678a7d283a3551c9a131576e9849f1b1dc36af2
diff --git a/lib/acts_as_keyed.rb b/lib/acts_as_keyed.rb index <HASH>..<HASH> 100644 --- a/lib/acts_as_keyed.rb +++ b/lib/acts_as_keyed.rb @@ -1,3 +1,11 @@ +Copyright (c) 2012 Jeremy Hubert + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + module ActsAsKeyed def self.included(base) base.extend ClassMethods
Added a copyright and license message
jhubert_acts-as-keyed
train
rb
d3e88db068fb975c9d5215dc72386220a7115e10
diff --git a/Fixtures/NamespaceWithClosureDeclaration.php b/Fixtures/NamespaceWithClosureDeclaration.php index <HASH>..<HASH> 100644 --- a/Fixtures/NamespaceWithClosureDeclaration.php +++ b/Fixtures/NamespaceWithClosureDeclaration.php @@ -2,9 +2,6 @@ namespace Doctrine\Tests\Common\Annotations\Fixtures; -$var = 1; -function () use ($var) {}; - use Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Secure; use Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Route; use Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Template; @@ -12,4 +9,4 @@ use Doctrine\Tests\Common\Annotations\Fixtures\Annotation\Template; $var = 1; function () use ($var) {}; -class NamespaceWithClosureDeclaration {} \ No newline at end of file +class NamespaceWithClosureDeclaration {}
Update tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClosureDeclaration.php Statement duplicate $var = 1; function () use ($var) {};
doctrine_annotations
train
php
f8942855d1541d16dfa4477a16df881aad2b1013
diff --git a/http-client/src/test/java/io/airlift/http/client/AbstractHttpClientTest.java b/http-client/src/test/java/io/airlift/http/client/AbstractHttpClientTest.java index <HASH>..<HASH> 100755 --- a/http-client/src/test/java/io/airlift/http/client/AbstractHttpClientTest.java +++ b/http-client/src/test/java/io/airlift/http/client/AbstractHttpClientTest.java @@ -171,6 +171,7 @@ public abstract class AbstractHttpClientTest throws Exception { if (server != null) { + server.setStopTimeout(3000); server.stop(); } }
Reduce stop timeout to 3s in client tests The default is <I>s and may cause the tests to take a long time.
airlift_airlift
train
java
6be1d7d0026f937f9b7a94e352a3726c630a4f11
diff --git a/handlers/calman.go b/handlers/calman.go index <HASH>..<HASH> 100644 --- a/handlers/calman.go +++ b/handlers/calman.go @@ -23,7 +23,7 @@ func HandleCalman(w http.ResponseWriter, r *http.Request) { message := ParseMessageJSON(r.Body) bot, _ := models.FetchBot(message.GroupID) - if !strings.HasPrefix(strings.ToLower(message.Text[1:]), strings.ToLower(bot.BotName)) { + if len(message.Text) < 1 || !strings.HasPrefix(strings.ToLower(message.Text[1:]), strings.ToLower(bot.BotName)) { return } @@ -133,7 +133,7 @@ func validateURL(u string) bool { resp, err := client.Do(req) - if err == nil && resp.StatusCode >= 200 && resp.StatusCode < 300 { + if err == nil && resp.StatusCode >= 200 && resp.StatusCode < 300 && strings.HasPrefix(resp.Header.Get("Content-Type"), "image") { return true } else { return false
Make sure content type is correct, don't crash when user posts image
NelsonLeDuc_CalmanBot
train
go
7d0fca03cdb79e6d6ccea96e9026b32ebbe6b4fa
diff --git a/src/Ubiquity/utils/http/UResponse.php b/src/Ubiquity/utils/http/UResponse.php index <HASH>..<HASH> 100644 --- a/src/Ubiquity/utils/http/UResponse.php +++ b/src/Ubiquity/utils/http/UResponse.php @@ -11,7 +11,7 @@ use Ubiquity\controllers\Startup; * This class is part of Ubiquity * * @author jcheron <myaddressmail@gmail.com> - * @version 1.1.2 + * @version 1.1.3 * */ class UResponse { @@ -31,6 +31,15 @@ class UResponse { } /** + * Forwards to url using Location header. + * @param string $url + * @param bool $preserveUrl + */ + public static function forward(string $url,bool $preserveUrl=true): void { + self::header('Location',$preserveUrl?$url:URequest::getUrl($url)); + } + + /** * * @param string $headerField * @param mixed $values
[skip ci][http] add forward to UResponse
phpMv_ubiquity
train
php
cea73ab52a28c1c8da59aee774c071a5f5266ec7
diff --git a/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java b/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java +++ b/src/org/opencms/ui/apps/CmsWorkplaceAppManager.java @@ -152,7 +152,7 @@ public class CmsWorkplaceAppManager { /** Legacy apps explicitly hidden from new workplace. */ private static final Set<String> LEGACY_BLACKLIST = Sets.newConcurrentHashSet( - Arrays.asList("/git", "/scheduler", "/galleryoverview")); + Arrays.asList("/git", "/scheduler", "/galleryoverview", "/projects")); /** The standard quick launch apps. */ private static final String[] STANDARD_APPS = new String[] {
Blacklisting legacy project management tool.
alkacon_opencms-core
train
java
6b3363b1486bd92f5355023074db9a52e60b1b34
diff --git a/src/scs_core/aws/client/mqtt_client.py b/src/scs_core/aws/client/mqtt_client.py index <HASH>..<HASH> 100644 --- a/src/scs_core/aws/client/mqtt_client.py +++ b/src/scs_core/aws/client/mqtt_client.py @@ -35,8 +35,8 @@ class MQTTClient(object): __RECONN_MAX = 32 # recommended: 32 (sec) __RECONN_STABLE = 20 # recommended: 20 (sec) - __DISCONNECT_TIMEOUT = 10 # recommended: 10 (sec) was 30 - __OPERATION_TIMEOUT = 5 # recommended: 5 (sec) was 30 + __DISCONNECT_TIMEOUT = 120 # recommended: 10 (sec) was 30 + __OPERATION_TIMEOUT = 60 # recommended: 5 (sec) was 30 __PUB_QOS = 1 __SUB_QOS = 1
Set AWS MQTT timeouts to <I> / <I>.
south-coast-science_scs_core
train
py
5f77b2a8c57ab0855801d6053cede103f0a6f3d2
diff --git a/lib/solargraph/pin/base.rb b/lib/solargraph/pin/base.rb index <HASH>..<HASH> 100644 --- a/lib/solargraph/pin/base.rb +++ b/lib/solargraph/pin/base.rb @@ -69,7 +69,10 @@ module Solargraph def == other return false unless self.class == other.class - location == other.location and namespace == other.namespace and name == other.name and docstring == other.docstring + location == other.location and + namespace == other.namespace and + name == other.name and + ( (docstring.nil? and other.docstring.nil?) or (docstring == other.docstring and docstring.all == other.docstring.all) ) end end end
More precise docstring comparison in Pin::Base#==
castwide_solargraph
train
rb
0b697937cf8039572bca3b8a9d5a67b4878753ac
diff --git a/lib/veritas/relation.rb b/lib/veritas/relation.rb index <HASH>..<HASH> 100644 --- a/lib/veritas/relation.rb +++ b/lib/veritas/relation.rb @@ -1,5 +1,7 @@ module Veritas class Relation + include Enumerable + attr_reader :header, :body def initialize(header, body) diff --git a/spec/unit/veritas/relation/each_spec.rb b/spec/unit/veritas/relation/each_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/veritas/relation/each_spec.rb +++ b/spec/unit/veritas/relation/each_spec.rb @@ -1,5 +1,15 @@ require File.expand_path('../../../../spec_helper', __FILE__) +describe 'Veritas::Relation' do + subject { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ]) } + + it { should be_kind_of(Enumerable) } + + it 'should case match Enumerable' do + (Enumerable === subject).should be_true + end +end + describe 'Veritas::Relation#each' do before do @tuples = []
Updated Relation to be Enumerable
dkubb_axiom
train
rb,rb
fbc41b535c72765de92bd744fb06b1a03bc9d262
diff --git a/php/commands/term.php b/php/commands/term.php index <HASH>..<HASH> 100644 --- a/php/commands/term.php +++ b/php/commands/term.php @@ -23,6 +23,9 @@ class Term_Command extends WP_CLI_Command { * * <taxonomy> * : List terms of a given taxonomy. + * + * --<field>=<value> + * : Filter by one or more fields. For accepted fields, see get_terms(). * * --fields=<fields> * : Limit the output to specific object fields. Defaults to all of the term object fields. @@ -37,7 +40,7 @@ class Term_Command extends WP_CLI_Command { * wp term list post_tag --fields=name,slug * * @subcommand list - * @synopsis <taxonomy> [--fields=<fields>] [--format=<format>] + * @synopsis <taxonomy> [--<field>=<value>] [--fields=<fields>] [--format=<format>] */ public function _list( $args, $assoc_args ) {
Support arbitrary filtering when listing terms
wp-cli_export-command
train
php
8611ac186147406409bce1db6ae2123fe36ed791
diff --git a/Eloquent/Concerns/HasAttributes.php b/Eloquent/Concerns/HasAttributes.php index <HASH>..<HASH> 100644 --- a/Eloquent/Concerns/HasAttributes.php +++ b/Eloquent/Concerns/HasAttributes.php @@ -1066,7 +1066,7 @@ trait HasAttributes $arguments = []; - if (strpos($castType, ':') !== false) { + if (is_string($castType) && strpos($castType, ':') !== false) { $segments = explode(':', $castType, 2); $castType = $segments[0]; @@ -1077,6 +1077,10 @@ trait HasAttributes $castType = $castType::castUsing(); } + if (is_object($castType)) { + return $castType; + } + return new $castType(...$arguments); }
Support returning an instance of a caster (#<I>)
illuminate_database
train
php
45439540f6b8c397ba5c5e4a3ec755014985eddf
diff --git a/helpers.go b/helpers.go index <HASH>..<HASH> 100644 --- a/helpers.go +++ b/helpers.go @@ -15,7 +15,7 @@ func getQueryParam(req *api2go.Request, param string) (interface{}, bool) { return "", false } - if !strings.HasSuffix(param, "-id") && !strings.HasSuffix(param, "ID") { + if !strings.HasSuffix(param, "-id") { return req.QueryParams[param][0], true }
"ID" params get cleaned before
256dpi_fire
train
go
8e5f03fa74830a46590e204e3356c64a7b55e608
diff --git a/ceam/modules/disease_models.py b/ceam/modules/disease_models.py index <HASH>..<HASH> 100644 --- a/ceam/modules/disease_models.py +++ b/ceam/modules/disease_models.py @@ -2,6 +2,7 @@ from datetime import timedelta +from ceam import config from ceam.state_machine import Transition, State, TransitionSet from ceam.modules.disease import DiseaseModule, DiseaseState, ExcessMortalityState, IncidenceRateTransition, ProportionTransition @@ -13,9 +14,9 @@ def heart_disease_factory(): # Calculate an adjusted disability weight for the acute heart attack phase that # accounts for the fact that our timestep is longer than the phase length - # TODO: This assumes a 30.5 day timestep which isn't guaranteed # TODO: This doesn't account for the fact that our timestep is longer than 28 days - weight = 0.43*(2/30.5) + 0.07*(28/30.5) + timestep = config.getfloat('simulation_parameters', 'time_step') + weight = 0.43*(2/timestep) + 0.07*(28/timestep) heart_attack = ExcessMortalityState('heart_attack', disability_weight=weight, dwell_time=timedelta(days=28), modelable_entity_id=1814, prevalence_meid=1814) #
Get the timestep from the config rather than a magic constant. This still falls down if the timestep varies over the course of a single run but I'm not sure we need to support that anyway
ihmeuw_vivarium
train
py
8b14ff39aa871065552f4cc5515ae75a4b9e1572
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -32,13 +32,13 @@ addBrowser( 'OS X 10.9', 'ipad' ); // ======= // addBrowser( 'Linux', 'android', '4.4' ); -browsers.push({ - platformName : 'android', - platformVersion: '4.4', - browserName : 'browser', - deviceName : 'Android', - appiumVersion : '1.3.1' -}); +// browsers.push({ +// platformName : 'android', +// platformVersion: '4.4', +// browserName : 'browser', +// deviceName : 'Android', +// appiumVersion : '1.3.1' +// }); // Windows 8.1
Changed Sauce Labs test harness options
Omega3k_backwards.js
train
js
ae2201dfcd643ac9c8bcb03479a253b6e342684f
diff --git a/Behaviors/ExtendBehavior.php b/Behaviors/ExtendBehavior.php index <HASH>..<HASH> 100644 --- a/Behaviors/ExtendBehavior.php +++ b/Behaviors/ExtendBehavior.php @@ -36,6 +36,7 @@ EOF; public function staticMethods($builder){ $builder->declareClass('Glorpen\\Propel\\PropelBundle\\Events\DetectOMClassEvent'); + $builder->declareClass('Glorpen\\Propel\\PropelBundle\\Dispatcher\\EventDispatcherProxy'); } public function queryMethods($builder){
[ExtendBehavior] Add missing use of EventDispatcherProxy
glorpen_GlorpenPropelBundle
train
php
9bd7463624f703b0f65a4732ee31676faaffab41
diff --git a/lib/simon_says/authorizer.rb b/lib/simon_says/authorizer.rb index <HASH>..<HASH> 100644 --- a/lib/simon_says/authorizer.rb +++ b/lib/simon_says/authorizer.rb @@ -46,7 +46,7 @@ module SimonSays end # @returns Primary resource found; need for +authorize+ calls - def find_resource(resource, options = {}) + def find_resource(resource, options = {}) # :nodoc: resource = resource.to_s scope, query = resource_scope_and_query(resource, options) @@ -66,7 +66,7 @@ module SimonSays end - def authorize(required = nil, options) + def authorize(required = nil, options) # :nodoc: if through = options[:through] name = through.to_s.singularize.to_sym else
Add some nodocs to various Authorizer methods
SimplyBuilt_SimonSays
train
rb
c40fb04466e89d6ca75f39c759be73a2758cef47
diff --git a/filer/__init__.py b/filer/__init__.py index <HASH>..<HASH> 100644 --- a/filer/__init__.py +++ b/filer/__init__.py @@ -1,6 +1,6 @@ """ django-filer - file and image management for django projects """ -VERSION = (0,6,2,'a15') -__version__ = "0.6.2a15" +VERSION = (0,6,2,'a16') +__version__ = "0.6.2a16" __authors__ = ["Stefan Foulis <stefan.foulis@gmail.com>", ] \ No newline at end of file
version bump to <I>a<I>
divio_django-filer
train
py
8a41681567ab586b96cd1a07b660048ccb414957
diff --git a/lib/DefaultClient.php b/lib/DefaultClient.php index <HASH>..<HASH> 100644 --- a/lib/DefaultClient.php +++ b/lib/DefaultClient.php @@ -85,6 +85,7 @@ final class DefaultClient implements Client { } } + /** @var array $headers */ $headers = yield $request->getBody()->getHeaders(); foreach ($headers as $name => $header) { if (!$request->hasHeader($name)) { @@ -254,6 +255,8 @@ final class DefaultClient implements Client { $deferred = $requestCycle->deferred; $requestCycle->deferred = null; $deferred->resolve($response); + $response = null; // clear references + $deferred = null; // there's also a reference in the deferred } else { return; } @@ -300,11 +303,13 @@ final class DefaultClient implements Client { $requestCycle->socket = null; // Complete body AFTER socket checkin, so the socket can be reused for a potential redirect - $requestCycle->body->complete(); + $body = $requestCycle->body; $requestCycle->body = null; $bodyDeferred = $requestCycle->bodyDeferred; $requestCycle->bodyDeferred = null; + + $body->complete(); $bodyDeferred->resolve(); return;
Correctly clear references to the response If a reference is kept, then the body of the body is never destructed and the connection can't be closed for unused bodies. Fixes #<I>.
amphp_artax
train
php
db3dff4b0b2c9be9f7348d44db2629b6069bbfef
diff --git a/nailgun/entities.py b/nailgun/entities.py index <HASH>..<HASH> 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -1276,13 +1276,8 @@ class Domain( def read(self, entity=None, attrs=None, ignore=()): """Deal with weirdly named data returned from the server. - When creating a domain, the server accepts a list named - ``domain_parameters_attributes``. When reading a domain, the server - returns a list named ``parameters``. These appear to be the same data. - Deal with this naming weirdness. - - Also, the server returns an entity ID instead of a hash of attributes - for the ``dns`` one to one field. + For more information, see `Bugzilla #1233245 + <https://bugzilla.redhat.com/show_bug.cgi?id=1233245>`_. """ if attrs is None:
Link to a bug in Domain.read Related to #<I>. From BZ <I>: > A domain has an attribute named "domain_parameters_attributes." This attribute > is accepted when creating (POST) and updating (PUT) a domain. But when reading > a domain (GET), no such attribute is returned. Instead, an attribute named > "parameters" is returned. This mismatch is disorienting and makes using the > API harder. See: <URL>
SatelliteQE_nailgun
train
py
1a0381c44f6dac25f65a3cf170e68d8991b87711
diff --git a/spec/configurate/lookup_chain_spec.rb b/spec/configurate/lookup_chain_spec.rb index <HASH>..<HASH> 100644 --- a/spec/configurate/lookup_chain_spec.rb +++ b/spec/configurate/lookup_chain_spec.rb @@ -58,6 +58,23 @@ describe Configurate::LookupChain do @provider[0].stub(:lookup).and_return(false) subject.lookup("enable").should be_false end + + it "converts 'true' to true" do + @provider[0].stub(:lookup).and_return("true") + subject.lookup("enable").should be_true + end + + it "converts 'false' to false" do + @provider[0].stub(:lookup).and_return("false") + subject.lookup("enable").should be_false + end + + it "returns the value unchanged if it can't be converted" do + value = mock + value.stub(:respond_to?).with(:to_s).and_return(false) + @provider[0].stub(:lookup).and_return(value) + subject.lookup("enable").should == value + end it "returns nil if no value is found" do @provider.each { |p| p.stub(:lookup).and_raise(Configurate::SettingNotFoundError) }
bring coverage to <I>%
jhass_configurate
train
rb
6e22cfe87197e994a1baaf4a9c11562ec735b179
diff --git a/openquake/baselib/tests/parallel_test.py b/openquake/baselib/tests/parallel_test.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/tests/parallel_test.py +++ b/openquake/baselib/tests/parallel_test.py @@ -18,7 +18,6 @@ import os import mock -import tempfile import unittest import itertools import numpy @@ -116,7 +115,9 @@ class StarmapTestCase(unittest.TestCase): monitor.hdf5.close() # check that the correct information is stored in the hdf5 file with hdf5.File(monitor.hdf5.path) as h5: - self.assertGreater(len(h5['performance_data']), 0) + num = general.countby(h5['performance_data'].value, 'operation') + self.assertEqual(num[b'total supertask'], 18) + self.assertEqual(num[b'total get_length'], 17) self.assertGreater(len(h5['task_info/supertask']), 0) os.remove(monitor.hdf5.path)
Better assertions [skip CI]
gem_oq-engine
train
py
ff295f920eee266e5232b84da94bc07e15ee2d5e
diff --git a/Tests/JWKTest.php b/Tests/JWKTest.php index <HASH>..<HASH> 100644 --- a/Tests/JWKTest.php +++ b/Tests/JWKTest.php @@ -122,7 +122,6 @@ final class JWKTest extends TestCase foreach ($jwkset as $key) { self::assertEquals('EC', $key->get('kty')); } - self::assertEquals(null, $jwkset->key()); self::assertEquals('9876543210', $jwkset->get('9876543210')->get('kid')); $jwkset = $jwkset->without('9876543210');
Removed \Iterator in favor of \IteratorAggragate
web-token_jwt-key-mgmt
train
php
1d0e1101261048fa29185acb3a74ab5dd307a321
diff --git a/pyrogram/client/methods/messages/send_photo.py b/pyrogram/client/methods/messages/send_photo.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/methods/messages/send_photo.py +++ b/pyrogram/client/methods/messages/send_photo.py @@ -64,7 +64,7 @@ class SendPhoto(BaseClient): A valid file reference obtained by a recently fetched media message. To be used in combination with a file id in case a file reference is needed. - caption (``bool``, *optional*): + caption (``str``, *optional*): Photo caption, 0-1024 characters. parse_mode (``str``, *optional*):
Fix wrong type hint in docs for send_photo
pyrogram_pyrogram
train
py
706442af27beff8e71237604d6bf8167485cd0ea
diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java +++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java @@ -190,6 +190,9 @@ public class OStorageLocal extends OStorageAbstract { final boolean locked = acquireExclusiveLock(); try { + if (open) + throw new OStorageException("Can't create new storage " + name + " because it isn't closed"); + File storageFolder = new File(storagePath); if (!storageFolder.exists()) storageFolder.mkdir(); @@ -277,7 +280,9 @@ public class OStorageLocal extends OStorageAbstract { public void delete() { final long timer = OProfiler.getInstance().startChrono(); - close(); + // CLOSE THE DATABASE BY REMOVING THE CURRENT USER + if (removeUser() > 0) + throw new OStorageException("Can't delete a storage open"); // GET REAL DIRECTORY File dbDir = new File(url);
Fixed issue on creation of storage while is opened.
orientechnologies_orientdb
train
java
4c41dde550277e54f601674a62539afcdb4adb5e
diff --git a/lib/sshkit/backends/local.rb b/lib/sshkit/backends/local.rb index <HASH>..<HASH> 100644 --- a/lib/sshkit/backends/local.rb +++ b/lib/sshkit/backends/local.rb @@ -4,7 +4,7 @@ module SSHKit module Backend - class Local < Printer + class Local < Abstract def initialize(_ = nil, &block) @host = Host.new(:local) # just for logging diff --git a/lib/sshkit/backends/netssh.rb b/lib/sshkit/backends/netssh.rb index <HASH>..<HASH> 100644 --- a/lib/sshkit/backends/netssh.rb +++ b/lib/sshkit/backends/netssh.rb @@ -37,7 +37,7 @@ module SSHKit module Backend - class Netssh < Printer + class Netssh < Abstract class Configuration attr_accessor :connection_timeout, :pty diff --git a/lib/sshkit/backends/skipper.rb b/lib/sshkit/backends/skipper.rb index <HASH>..<HASH> 100644 --- a/lib/sshkit/backends/skipper.rb +++ b/lib/sshkit/backends/skipper.rb @@ -1,7 +1,7 @@ module SSHKit module Backend - class Skipper < Printer + class Skipper < Abstract def initialize(&block) @block = block
Removed Printer from Local and Netssh backend hierarchy
capistrano_sshkit
train
rb,rb,rb
78e53e391812d9bf4fda3f21d486067f52f100bb
diff --git a/lib/haml/options.rb b/lib/haml/options.rb index <HASH>..<HASH> 100644 --- a/lib/haml/options.rb +++ b/lib/haml/options.rb @@ -261,10 +261,7 @@ module Haml # # @return [{Symbol => Object}] The options hash def for_buffer - self.class.buffer_option_keys.inject({}) do |hash, key| - hash[key] = send(key) - hash - end + Hash[self.class.buffer_option_keys.map {|key| [key, send(key)]}] end private @@ -274,4 +271,4 @@ module Haml end end -end \ No newline at end of file +end
Prefer Hash[] over inject({}) basically this is faster and reads better
haml_haml
train
rb
cc9a930c4af03576c616197b81bab8ee3ae6b4d9
diff --git a/charms/network-health/reactive/network-health.py b/charms/network-health/reactive/network-health.py index <HASH>..<HASH> 100755 --- a/charms/network-health/reactive/network-health.py +++ b/charms/network-health/reactive/network-health.py @@ -21,7 +21,7 @@ def install_network_health(): def start_simple_http(): script = 'scripts.simple-server' file_path = os.path.join(os.environ['CHARM_DIR'], 'files/token.txt') - port = 80 + port = 8039 ip = unit_private_ip() log('Starting simple http server on: {}:{}'.format( ip, port), INFO)
changed NH charm server port to <I>
juju_juju
train
py
12f0d30cd15b4f765e597b36eed4f35ff69c63a4
diff --git a/src/ConfigProvider.php b/src/ConfigProvider.php index <HASH>..<HASH> 100644 --- a/src/ConfigProvider.php +++ b/src/ConfigProvider.php @@ -41,6 +41,8 @@ final class ConfigProvider implements ConfigProviderInterface ); if (!isset($this->config[$scope]) && $this->params->hasScope($scope)) { $this->config[$scope] = $this->loadScope($scope); + } elseif (!isset($this->config[$scope])) { + return $default; } return $this->resolvePath($configPath) ?? $default; } @@ -68,14 +70,10 @@ final class ConfigProvider implements ConfigProviderInterface private function resolvePath(ConfigPathInterface $path) { - $scope = $path->getScope(); - if (!isset($this->config[$scope])) { - return null; - } $pathPos = 0; $pathLen = $path->getLength(); $pathParts = $path->getParts(); - $value = &$this->config[$scope]; + $value = &$this->config[$path->getScope()]; while (!empty($pathParts)) { $pathPos++; $pathPart = array_shift($pathParts);
move scope existence check from resolvePath to get
daikon-cqrs_config
train
php
8fddfbca6c1dc82bc6bf75bbf1efd09ca0c21e28
diff --git a/thali/NextGeneration/thaliMobile.js b/thali/NextGeneration/thaliMobile.js index <HASH>..<HASH> 100644 --- a/thali/NextGeneration/thaliMobile.js +++ b/thali/NextGeneration/thaliMobile.js @@ -692,7 +692,7 @@ var verifyDiscoveryAdvertisingState = function (state) { var advertising = thaliMobileStates.advertising; if (listening !== state.discoveryActive || advertising !== state.advertisingActive) { - logger.warn('Unexpected state: %s', + logger.info('Received state did not match with target: %s', JSON.stringify(getDiscoveryAdvertisingState()) ); }
Reduce the severity in case of state mismatch The mismatch can also happen in very normal scenario where stop is called for thaliMobile, which in turn ends to calling both stops in thaliWifiInfrastructure. After both stops are completed, there is an independent emit of the discover state change and at the time of the first one of those, the state doesn't yet match with the target.
thaliproject_Thali_CordovaPlugin
train
js
74e8865c205b0da07ec43e7c6c504cd550c125dc
diff --git a/fatbotslim/irc/__init__.py b/fatbotslim/irc/__init__.py index <HASH>..<HASH> 100644 --- a/fatbotslim/irc/__init__.py +++ b/fatbotslim/irc/__init__.py @@ -35,16 +35,17 @@ class NullMessage(Exception): class Message(object): def __init__(self, data): self._raw = data - self.src, self.command, self.args = Message.parse(data) + self.src, self.dst, self.command, self.args = Message.parse(data) def __str__(self): - return "<Message(prefix='{0}', command='{1}', args='{2}')>".format( + return "<Message(prefix='{0}', command='{1}', args={2})>".format( self.src.name, self.command, self.args ) @classmethod def parse(cls, data): src = '' + dst = None if not data: raise NullMessage('Received an empty line from the server') if data[0] == ':': @@ -56,7 +57,9 @@ class Message(object): else: args = data.split() command = args.pop(0) - return Source(src), command, args + if command == PRIVMSG: + dst = args.pop(0) + return Source(src), dst, command, args class Source(object):
add a dst attribute to Message objects to store the message destination (only used with PRIVMSG events)
mdeous_fatbotslim
train
py
50314261310e7122f08effde57e6dba7d6ddd181
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,8 +14,6 @@ module.exports = function(grunt) { webdriver: { options: { - user: process.env.SAUCE_USERNAME, - key: process.env.SAUCE_ACCESS_KEY, logLevel: 'command', updateJob: true, waitforTimeout: 12345,
remove sauce creds from gruntfile
webdriverio_grunt-webdriver
train
js
dda0b6889556c17057fbd01ceb61d3ed0325eda5
diff --git a/treeherder/client/thclient/client.py b/treeherder/client/thclient/client.py index <HASH>..<HASH> 100644 --- a/treeherder/client/thclient/client.py +++ b/treeherder/client/thclient/client.py @@ -1,7 +1,6 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -from __future__ import unicode_literals import httplib import oauth2 as oauth diff --git a/treeherder/client/thclient/tests/test_treeherder_client.py b/treeherder/client/thclient/tests/test_treeherder_client.py index <HASH>..<HASH> 100644 --- a/treeherder/client/thclient/tests/test_treeherder_client.py +++ b/treeherder/client/thclient/tests/test_treeherder_client.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import unittest import os from mock import patch
removed unicode_literals for compatibility with django rest api
mozilla_treeherder
train
py,py
0cbbdae1a37c1f5a1c80dca50e62e4d4b97602ac
diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index <HASH>..<HASH> 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -45,6 +45,7 @@ const ( routingOptionSupernodeKwd = "supernode" routingOptionDHTClientKwd = "dhtclient" routingOptionDHTKwd = "dht" + routingOptionNoneKwd = "none" unencryptTransportKwd = "disable-transport-encryption" unrestrictedApiAccessKwd = "unrestricted-api" writableKwd = "writable" @@ -331,6 +332,8 @@ func daemonFunc(req cmds.Request, res cmds.Response) { ncfg.Routing = core.DHTClientOption case routingOptionDHTKwd: ncfg.Routing = core.DHTOption + case routingOptionNoneKwd: + ncfg.Routing = core.NilRouterOption default: res.SetError(fmt.Errorf("unrecognized routing option: %s", routingOption), cmds.ErrNormal) return
add in option to use nil-routing License: MIT
ipfs_go-ipfs
train
go
b4b8dd3c9b2af884bc24728907b31a64c347cf51
diff --git a/src/converter/r2t/WrapBodyContent.js b/src/converter/r2t/WrapBodyContent.js index <HASH>..<HASH> 100644 --- a/src/converter/r2t/WrapBodyContent.js +++ b/src/converter/r2t/WrapBodyContent.js @@ -7,6 +7,10 @@ export default class WrapBodyContent { bodies.forEach((body) => { const sigBlock = body.find('sig-block') const children = body.children + // Ensure there is at least one p element inside body + if (children.length ===0) { + children.push(dom.createElement('p')) + } body.empty() body.append( dom.createElement('body-content').append(children)
Ensure that there is at least one p element inside body.
substance_texture
train
js
c9636407afb92256c6c93e298ef7e23f6a399cc1
diff --git a/pgcrypto_fields/mixins.py b/pgcrypto_fields/mixins.py index <HASH>..<HASH> 100644 --- a/pgcrypto_fields/mixins.py +++ b/pgcrypto_fields/mixins.py @@ -7,6 +7,11 @@ from pgcrypto_fields.aggregates import ( from pgcrypto_fields.proxy import EncryptedProxyField +def remove_validators(validators, validator_class): + """Exclude `validator_class` instances from `validators` list.""" + return [v for v in validators if not isinstance(v, validator_class)] + + class HashMixin: """Keyed hash mixin. @@ -83,9 +88,7 @@ class RemoveMaxLengthValidatorMixin: def __init__(self, *args, **kwargs): """Remove `MaxLengthValidator` in parent's `.__init__`.""" super().__init__(*args, **kwargs) - for validator in self.validators: - if isinstance(validator, MaxLengthValidator): - self.validators.remove(validator) + self.validators = remove_validators(self.validators, MaxLengthValidator) class EmailPGPPublicKeyFieldMixin(PGPPublicKeyFieldMixin, RemoveMaxLengthValidatorMixin):
Refactor loop to exclude MaxLengthValidator
incuna_django-pgcrypto-fields
train
py
42c7b3fba22a9f9dda2a9e62d5889a144956dae4
diff --git a/stripy/spherical.py b/stripy/spherical.py index <HASH>..<HASH> 100755 --- a/stripy/spherical.py +++ b/stripy/spherical.py @@ -683,7 +683,7 @@ F, FX, and FY are the values and partials of a linear function which minimizes Q self._x, self._y, self._z, zdata,\ self.lst, self.lptr, self.lend) elif order == 1: - zi, zierr, ierr = _ssrfpack.interp_linear(lats, lons,\ + zi, zierr, ierr = _stripack.interp_n(order, lats, lons,\ self._x, self._y, self._z, zdata,\ self.lst, self.lptr, self.lend) elif order == 3:
Some random error with linear interpolation Reverting back to stripack.interp_n implementation
underworldcode_stripy
train
py
c4264888513846492783523fdb03b26f31023b9e
diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js b/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js index <HASH>..<HASH> 100644 --- a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js +++ b/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js @@ -21,6 +21,7 @@ export default class UserDropDown extends PureComponent { // // TODO: There are still hard-coded Uris in here // + const csrfToken = document.getElementById('appContainer').dataset.csrfToken; return ( <div className={style.wrapper}> <DropDown className={style.dropDown}> @@ -31,6 +32,7 @@ export default class UserDropDown extends PureComponent { <DropDown.Contents className={style.dropDown__contents}> <li className={style.dropDown__item}> <form title="Logout" action="/neos/logout" method="post"> + <input type="hidden" name="__csrfToken" value={csrfToken}/> <button type="submit" name="" value="logout"> <Icon icon="power-off" className={style.dropDown__itemIcon}/> <I18n id="logout" fallback="Logout"/>
BUGFIX: send csrf token with logout action
neos_neos-ui
train
js
5530dec63336c237b883aa674cb2ce18f785f0a6
diff --git a/oplus/version.py b/oplus/version.py index <HASH>..<HASH> 100644 --- a/oplus/version.py +++ b/oplus/version.py @@ -1 +1 @@ -version='6.0.1.dev7' +version='6.1.0'
[skip ci] updated version as <I>
openergy_oplus
train
py
fd2a21e9dc129168169e257c38ea02482dad1dbd
diff --git a/src/Locator/Resolver/Pipeline/Stages/AbstractStage.php b/src/Locator/Resolver/Pipeline/Stages/AbstractStage.php index <HASH>..<HASH> 100644 --- a/src/Locator/Resolver/Pipeline/Stages/AbstractStage.php +++ b/src/Locator/Resolver/Pipeline/Stages/AbstractStage.php @@ -47,6 +47,9 @@ abstract class AbstractStage implements StageInterface */ protected function newModelManager($class) { + if (method_exists($class, "instance")) { + return call_user_func([$class, "instance"]); + } $manager = new $class(); return $manager; }
add check for instance method in record locator
bytic_orm
train
php
8de10dd159ac1eba199c50f69ffffcc96a34be58
diff --git a/src/Composer/XdebugHandler.php b/src/Composer/XdebugHandler.php index <HASH>..<HASH> 100644 --- a/src/Composer/XdebugHandler.php +++ b/src/Composer/XdebugHandler.php @@ -219,6 +219,10 @@ class XdebugHandler $currentIniScanDir = getenv(self::ENV_INI_SCAN_DIR); if ($currentIniScanDir) { putenv(self::ENV_INI_SCAN_DIR_OLD.'='.$currentIniScanDir); + } else { + // make sure the env var does not exist if none is to be set + // otherwise the child process will reset it incorrectly + putenv(self::ENV_INI_SCAN_DIR_OLD); } if (!putenv(self::ENV_INI_SCAN_DIR.'='.$this->scanDir)) {
Tweak logic in case of dirty state start-up, refs #<I>
composer_composer
train
php
6af18039d9cc400703de5b846257db838cd40f08
diff --git a/pyoanda/__init__.py b/pyoanda/__init__.py index <HASH>..<HASH> 100644 --- a/pyoanda/__init__.py +++ b/pyoanda/__init__.py @@ -1,6 +1,15 @@ from .client import Client # OANDA API URLS -SANDBOX = ("http://api-sandbox.oanda.com", "http://stream-sandbox.oanda.com/") -PRACTICE = ("https://api-fxpractice.oanda.com", "https://stream-fxpractice.oanda.com/") -TRADE = ("https://api-fxtrade.oanda.com", "https://stream-fxtrade.oanda.com/") +SANDBOX = ( + "http://api-sandbox.oanda.com", + "http://stream-sandbox.oanda.com" +) +PRACTICE = ( + "https://api-fxpractice.oanda.com", + "https://stream-fxpractice.oanda.com" +) +TRADE = ( + "https://api-fxtrade.oanda.com", + "https://stream-fxtrade.oanda.com" +)
Fix the streamming urls
toloco_pyoanda
train
py
09a1cae5964ea581d84e4c380d091278a46b817a
diff --git a/src/wavesurfer.js b/src/wavesurfer.js index <HASH>..<HASH> 100644 --- a/src/wavesurfer.js +++ b/src/wavesurfer.js @@ -123,7 +123,7 @@ var WaveSurfer = { // on canplay function () { my.drawer.setMinWidth(~~my.backend.getDuration()); - my.backend.play(); + my.backend.play(my.backend.getCurrentTime()); } ); diff --git a/src/webaudio.js b/src/webaudio.js index <HASH>..<HASH> 100644 --- a/src/webaudio.js +++ b/src/webaudio.js @@ -64,15 +64,15 @@ WaveSurfer.WebAudio = { audio.addEventListener('canplay', function () { my.setSource(my.ac.createMediaElementSource(audio)); - my.bindUpdate(function () { - if (!audio.paused) { - onUpdate && onUpdate(my.waveform(), audio.currentTime); - } - }); - onCanPlay && onCanPlay(); }, false); + audio.addEventListener('timeupdate', function () { + if (!audio.paused) { + onUpdate && onUpdate(my.waveform(), audio.currentTime); + } + }); + audio.autoplay = false; audio.src = url; return audio;
support media fragments URI in streamUrl
katspaugh_wavesurfer.js
train
js,js
f9492a4d3aded7df52be6c809a3fb919c82e6ca7
diff --git a/src/Loader/GeneratorFactory.php b/src/Loader/GeneratorFactory.php index <HASH>..<HASH> 100644 --- a/src/Loader/GeneratorFactory.php +++ b/src/Loader/GeneratorFactory.php @@ -75,6 +75,7 @@ class GeneratorFactory extends \PSX\Api\GeneratorFactory $tokenUrl = $this->url . '/' . $this->dispatch . 'authorization/token'; $generator->setAuthorizationFlow(Authorization::APP, Generator\OpenAPIAbstract::FLOW_AUTHORIZATION_CODE, $authUrl, $tokenUrl, $refreshUrl, $appScopes); + $generator->setAuthorizationFlow(Authorization::APP, Generator\OpenAPIAbstract::FLOW_CLIENT_CREDENTIALS, null, $tokenUrl, $refreshUrl, $appScopes); $generator->setAuthorizationFlow(Authorization::APP, Generator\OpenAPIAbstract::FLOW_PASSWORD, null, $tokenUrl, $refreshUrl, $appScopes); $tokenUrl = $this->url . '/' . $this->dispatch . 'backend/token';
swagger add client credentials flow
apioo_fusio-impl
train
php
3523643de407a9b2522dc4183354af12cb12e1cd
diff --git a/src/main/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java b/src/main/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java +++ b/src/main/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java @@ -731,7 +731,7 @@ public class MolecularFormulaManipulator { * * @param atomContainer IAtomContainer object * @return a molecular formula object - * @see getMolecularFormula(IAtomContainer,IMolecularFormula) + * @see #getMolecularFormula(IAtomContainer,IMolecularFormula) */ @TestMethod("testGetMolecularFormula_IAtomContainer") public static IMolecularFormula getMolecularFormula(IAtomContainer atomContainer) {
Added a missing # in the @see (needed for methods) Change-Id: I<I>e<I>da<I>cb8d<I>a<I>dfba<I>c1ce<I>
cdk_cdk
train
java
95e55621e46bf55039c0a04772447ddaaaf71dc9
diff --git a/formbuilder/views/fields/body-captcha.php b/formbuilder/views/fields/body-captcha.php index <HASH>..<HASH> 100644 --- a/formbuilder/views/fields/body-captcha.php +++ b/formbuilder/views/fields/body-captcha.php @@ -1 +1 @@ -<?=$captcha->html?> \ No newline at end of file +<?=$captcha->getHtml()?> \ No newline at end of file
fix: Captcha is now an object
nails_module-form-builder
train
php
e856071e16f5155932a39421b7fcaac152020ee6
diff --git a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/ResumeCheckpointManuallyITCase.java b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/ResumeCheckpointManuallyITCase.java index <HASH>..<HASH> 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/ResumeCheckpointManuallyITCase.java +++ b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/ResumeCheckpointManuallyITCase.java @@ -344,7 +344,7 @@ public class ResumeCheckpointManuallyITCase extends TestLogger { } private static void waitUntilCanceled(JobID jobId, ClusterClient<?> client) throws ExecutionException, InterruptedException { - while (client.getJobStatus(jobId).get() != JobStatus.CANCELLING) { + while (client.getJobStatus(jobId).get() != JobStatus.CANCELED) { Thread.sleep(50); } }
[hotfix][tests] Fix job-cancellation check in ResumeCheckpointManuallyITCase
apache_flink
train
java
54710a134a60113472498cfc80ca9777a60a2eea
diff --git a/codenerix_extensions/__init__.py b/codenerix_extensions/__init__.py index <HASH>..<HASH> 100644 --- a/codenerix_extensions/__init__.py +++ b/codenerix_extensions/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.0.1" +__version__ = "1.0.2" __authors__ = [ 'Juan Miguel Taboada Godoy <juanmi@juanmitaboada.com>',
New version uploaded to PYPY
codenerix_django-codenerix-extensions
train
py
0d0c9d270ff1d544997d9f73929446b0bfe8360c
diff --git a/src/test/java/org/mapdb/BTreeMapTest.java b/src/test/java/org/mapdb/BTreeMapTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/mapdb/BTreeMapTest.java +++ b/src/test/java/org/mapdb/BTreeMapTest.java @@ -347,7 +347,7 @@ public class BTreeMapTest{ //fill final int c = 1000000; for(int i=0;i<=c;i++){ - m.put(c,c); + m.put(i,i); } Thread t = new Thread(){ @@ -371,7 +371,7 @@ public class BTreeMapTest{ //fill final int c = 1000000; for(int i=0;i<=c;i++){ - m.put(c,c); + m.put(i,i); } Thread t = new Thread(){
BTreeMapTest: fix typo
jankotek_mapdb
train
java
f9435075e1d28d73826eaa03782f1fdaaf508449
diff --git a/src/db-sample.py b/src/db-sample.py index <HASH>..<HASH> 100644 --- a/src/db-sample.py +++ b/src/db-sample.py @@ -7,7 +7,6 @@ db_filename = 'noworkflow.db' db_script = 'noworkflow.sql' db_is_new = not os.path.exists(db_filename) - conn = sqlite3.connect(db_filename) if db_is_new: @@ -16,26 +15,21 @@ if db_is_new: schema = f.read() conn.executescript(schema) - print 'Inserting sample data...' - # nao esta funcionando por algum motivo... + print 'Inserting sample data...' conn.execute(""" insert into test (id, data) values (1, 'row 1') - """) + """) + conn.commit() else: print 'Database exists, assuming schema does, too.' cursor = conn.cursor() - cursor.execute(""" select id, data from test """) - - print 'Retrieving data...' - for colinfo in cursor.description: - print colinfo for row in cursor.fetchall(): - #id, data = row + id, data = row print '%2d %s' % (id, data) conn.close() \ No newline at end of file
Fixed error in the sample DB application
gems-uff_noworkflow
train
py
2cf48bdd4c926a11d0412f883ccee85afd211a53
diff --git a/stanza/utils/training/common.py b/stanza/utils/training/common.py index <HASH>..<HASH> 100644 --- a/stanza/utils/training/common.py +++ b/stanza/utils/training/common.py @@ -2,6 +2,7 @@ import argparse import logging import os import pathlib +import re import subprocess import sys import tempfile @@ -32,6 +33,8 @@ def build_argparse(): parser.add_argument('--force', dest='force', action='store_true', default=False, help='Retrain existing models') return parser +SHORTNAME_RE = re.compile("[a-z]+_[a-z0-9]+") + def main(run_treebank, model_dir, model_name): paths = default_paths.get_default_paths() @@ -59,7 +62,10 @@ def main(run_treebank, model_dir, model_name): treebanks.append(treebank) for treebank in treebanks: - short_name = treebank_to_short_name(treebank) + if SHORTNAME_RE.match(treebank): + short_name = treebank + else: + short_name = treebank_to_short_name(treebank) logger.debug("%s: %s" % (treebank, short_name)) if mode == Mode.TRAIN and not command_args.force:
Add the ability to specify shortname directly in the training scripts
stanfordnlp_stanza
train
py
5d1f443d7e1cb8312fa21923c58fd005a4f05995
diff --git a/src/components/elements/inputs/dropdown-list.js b/src/components/elements/inputs/dropdown-list.js index <HASH>..<HASH> 100644 --- a/src/components/elements/inputs/dropdown-list.js +++ b/src/components/elements/inputs/dropdown-list.js @@ -19,7 +19,7 @@ export default ({ className, errors, onCommit, property, value }) => { return { label: title, value } })} title={property.title} - value={value || ''} /> + value={value || ''} /> </div> ) }
Nonsense change to undo previous but still trigger new build
cignium_hypermedia-client
train
js
115c14f9f7cfbc559c962ee8c907df3301b42be5
diff --git a/spec/parse/lr_table_spec.rb b/spec/parse/lr_table_spec.rb index <HASH>..<HASH> 100644 --- a/spec/parse/lr_table_spec.rb +++ b/spec/parse/lr_table_spec.rb @@ -24,7 +24,7 @@ describe Rly::LRTable do it "computes the LR(0) closure operation on I, where I is a set of LR(0) items" do lr0_c = @t.send(:lr0_closure, [@g.productions[0].lr_next]) - lr0_c.length.should == @g.productions.length + lr0_c.length.should == 5 lr0_c.length.times do |i| lr0_c[i].should == @g.productions[i].lr_next end
Stricter spec for #lr0_closure
farcaller_rly
train
rb
8b6918bafadb44afd0da5924b8ed6267ac6cd6a8
diff --git a/Resources/Public/Scripts/jquery.gomapsext.js b/Resources/Public/Scripts/jquery.gomapsext.js index <HASH>..<HASH> 100644 --- a/Resources/Public/Scripts/jquery.gomapsext.js +++ b/Resources/Public/Scripts/jquery.gomapsext.js @@ -476,7 +476,7 @@ opened: 0, categories: '' }; - _this.addMapPoint(address, Route, $element, infoWindow, gme); + _this.addMapPoint(address, Route, $element, _this.infoWindow, gme); gme.addresses.push(address); }); });
[BUGFIX] JS KML import infoWindow
mhirdes_go_maps_ext
train
js
e103e5eb2e0d8917615c386320197a060501e9a5
diff --git a/build/assembly/lib/assembly_tool.rb b/build/assembly/lib/assembly_tool.rb index <HASH>..<HASH> 100755 --- a/build/assembly/lib/assembly_tool.rb +++ b/build/assembly/lib/assembly_tool.rb @@ -209,7 +209,7 @@ class AssemblyTool def set_welcome_root(doc) unless options[:enable_welcome_root].nil? - element = doc.root.get_elements("//virtual-server[@name='localhost']").first + element = doc.root.get_elements("//virtual-server").first element.attributes['enable-welcome-root'] = options[:enable_welcome_root] end end
Relax the name constraint as its value changed in <I>.Final
torquebox_torquebox
train
rb
149f5ea398083ca2daa07e21e403c85e5d561342
diff --git a/test/transformer.base.js b/test/transformer.base.js index <HASH>..<HASH> 100644 --- a/test/transformer.base.js +++ b/test/transformer.base.js @@ -625,6 +625,18 @@ module.exports = function base(transformer) { socket.on('end', done); }); + it('should receive all headers', function (done) { + primus.on('connection', function (spark) { + expect(spark.headers).to.be.a('object'); + expect(spark.headers).to.have.property('connection'); + + socket.end(); + }); + + var socket = new Socket('http://localhost:'+ server.portnumber +'/?foo=bar'); + socket.on('end', done); + }); + it('should not trigger a reconnect when we end the connection', function (done) { primus.on('connection', function (spark) { spark.end();
[test] ensure that all header values are available
primus_primus
train
js
f1f68d2e42c05ed3d956ea0fbf17990b219b18cd
diff --git a/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java b/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java index <HASH>..<HASH> 100644 --- a/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java +++ b/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/tcp/TcpTransportFactory.java @@ -306,14 +306,7 @@ public class TcpTransportFactory implements TransportFactory { @Override public void invalidateTransport(SocketAddress serverAddress, Transport transport) { - KeyedObjectPool<SocketAddress, TcpTransport> pool = getConnectionPool(); - try { - // Transport could be null, in which case all connections - // to the server address will be invalidated - pool.invalidateObject(serverAddress, (TcpTransport) transport); - } catch (Exception e) { - log.unableToInvalidateTransport(serverAddress); - } + transport.invalidate(); } @Override
ISPN-<I> Avoid invalidating transport twice * On invalidate simply mark transport as invalid instead of invalidating it from the pool. When the transport is released, if the transport is invalid, it'll get evicted from the pool.
infinispan_infinispan
train
java
83538a5c371b428261ab9153e920ffb5a1239753
diff --git a/lib/riddle/client.rb b/lib/riddle/client.rb index <HASH>..<HASH> 100644 --- a/lib/riddle/client.rb +++ b/lib/riddle/client.rb @@ -529,6 +529,8 @@ module Riddle self.connection.call(self) elsif self.class.connection self.class.connection.call(self) + elsif @server.index('/') == 0 + UNIXSocket.new @server else TCPSocket.new @server, @port end
Allowing Riddle to talk to Sphinx via a Unix Socket - thanks to Andrew W for the patch.
pat_riddle
train
rb
b096dbdc9d1d61e7d34d7ed2e4107234951b982b
diff --git a/vyper/ir/compile_ir.py b/vyper/ir/compile_ir.py index <HASH>..<HASH> 100644 --- a/vyper/ir/compile_ir.py +++ b/vyper/ir/compile_ir.py @@ -994,6 +994,7 @@ def assembly_to_evm(assembly, pc_ofst=0, insert_vyper_signature=False): if insert_vyper_signature: # CBOR encoded: {"vyper": [major,minor,patch]} bytecode_suffix += b"\xa1\x65vyper\x83" + bytes(list(version_tuple)) + bytecode_suffix += len(bytecode_suffix).to_bytes(2, "big") CODE_OFST_SIZE = 2 # size of a PUSH instruction for a code symbol
add cbor length metadata (#<I>) add binary encoded length to the end of the CBOR metadata so disassemblers can reliably detect where code ends and metadata starts
ethereum_vyper
train
py
d7b3bce23712f041ae3d213511b5d2444bf6c0c6
diff --git a/scapy/asn1fields.py b/scapy/asn1fields.py index <HASH>..<HASH> 100644 --- a/scapy/asn1fields.py +++ b/scapy/asn1fields.py @@ -275,7 +275,7 @@ class ASN1F_PACKET(ASN1F_field): c = cls(x) except ASN1F_badsequence: c = packet.Raw(x) - cpad = c[packet.Padding] + cpad = c.getlayer(packet.Padding) x = "" if cpad is not None: x = cpad.load
Fixed regression introduced by [e<I>a3a] on ASN1 fields
secdev_scapy
train
py
444e7e8af4ecbb48f7779aa7f90ca1937df9ecfc
diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java @@ -391,9 +391,7 @@ public class Ghprb { specifications.add(new SchemeSpecification(serverUri.getScheme())); specifications.add(new PathSpecification(serverUri.getPath(), null, false)); - - - Domain domain = new Domain(serverAPIUrl, "Auto generated credentials domain", specifications); + Domain domain = new Domain(serverUri.getHost(), "Auto generated credentials domain", specifications); CredentialsStore provider = new SystemCredentialsProvider.StoreImpl(); provider.addDomain(domain, credentials); return credentials.getId();
Change to just use the host name for the default domain
jenkinsci_ghprb-plugin
train
java
1f4b2607cca815ffb72f3e6e37af06202c6facc2
diff --git a/bin/test_api.js b/bin/test_api.js index <HASH>..<HASH> 100644 --- a/bin/test_api.js +++ b/bin/test_api.js @@ -21,7 +21,7 @@ let flagArgs = []; if (process.argv.length > 2) { const args = process.argv.slice(2); - flagArgs = args.filter(e => e.startsWith('--')).flatMap(arg => arg.split('=')); + flagArgs = args.filter(e => e.startsWith('--')).map(arg => arg.split('=')).reduce((arr, val) => arr.concat([...val], [])); console.info(flagArgs); // ability to inject particular test files via // yarn test [testFileA testFileB ...]
Replace flatMap method with reduce and map
xtermjs_xterm.js
train
js
5d4f6ac8ea50b167091dc5e0a4f372f8c15ef1b4
diff --git a/packages/cozy-client/examples/albums-relationships.js b/packages/cozy-client/examples/albums-relationships.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/examples/albums-relationships.js +++ b/packages/cozy-client/examples/albums-relationships.js @@ -13,9 +13,9 @@ class HasManyReferenced extends HasMany { static query(doc, client, assoc) { if ( - !doc['relationships'] || - !doc['relationships']['referenced_by'] || - !doc['relationships']['referenced_by']['data'] + !doc.relationships || + !doc.relationships.referenced_by || + !doc.relationships.referenced_by.data ) { return null }
refactor: Use dot instead of brackets
cozy_cozy-client
train
js
84b7f0f7ff15806bab56fb779ad8913f2a1df58c
diff --git a/src/Lists/ArrayListTrait.php b/src/Lists/ArrayListTrait.php index <HASH>..<HASH> 100644 --- a/src/Lists/ArrayListTrait.php +++ b/src/Lists/ArrayListTrait.php @@ -148,7 +148,7 @@ trait ArrayListTrait public function filter(?callable $predicate = null, bool $preserveKeys = false): ListInterface { $list = emptyList(); - $filtered = array_filter($this->array, $predicate); + $filtered = $predicate == null ? array_filter($this->array) : array_filter($this->array, $predicate); $list->setArray( $preserveKeys ? $filtered : array_values($filtered) ); diff --git a/tests/ArrayListTest.php b/tests/ArrayListTest.php index <HASH>..<HASH> 100644 --- a/tests/ArrayListTest.php +++ b/tests/ArrayListTest.php @@ -199,7 +199,7 @@ class ArrayListTest extends TestCase public function testMapNotNull() { - $list = new ArrayList(1, 2, 3, 4, 5); + $list = listOf(1, 2, 3, 4, 5); $this->assertEquals( listOf(1, 3, 5), $list->mapNotNull(fn($item) => $item % 2 !== 0 ? $item : null)
Version 4: - implemented Map features - additional unit tests
seboettg_Collection
train
php,php
70530209640827ffb3a904ff573325dcce91f445
diff --git a/uliweb/orm/__init__.py b/uliweb/orm/__init__.py index <HASH>..<HASH> 100644 --- a/uliweb/orm/__init__.py +++ b/uliweb/orm/__init__.py @@ -4123,7 +4123,10 @@ class Model(object): else: if collection_name in cls._collection_names: if cls._collection_names.get(collection_name) != from_class_name: - raise DuplicatePropertyError("Model %s already has property %s" % (cls.__name__, collection_name)) + raise DuplicatePropertyError("Model %s already has collection property %s" % (cls.__name__, collection_name)) + #add property check + if collection_name in cls.properties: + raise DuplicatePropertyError("Model %s already has property %s" % (cls.__name__, collection_name)) return collection_name @classmethod
Add collection_name conflict with property_name check
limodou_uliweb
train
py
36bba5dd8a93bbb603f3c89e2f030ded9c013c1a
diff --git a/lib/train/extras/command_wrapper.rb b/lib/train/extras/command_wrapper.rb index <HASH>..<HASH> 100644 --- a/lib/train/extras/command_wrapper.rb +++ b/lib/train/extras/command_wrapper.rb @@ -72,18 +72,16 @@ module Train::Extras rawerr = "#{res.stdout} #{res.stderr}".strip case rawerr - when "Sorry, try again" + when /Sorry, try again/ ["Wrong sudo password.", :bad_sudo_password] - when "sudo: no tty present and no askpass program specified" + when /sudo: no tty present and no askpass program specified/ ["Sudo requires a password, please configure it.", :sudo_password_required] - when "sudo: command not found" + when /sudo: command not found/ ["Can't find sudo command. Please either install and "\ "configure it on the target or deactivate sudo.", :sudo_command_not_found] - when "sudo: sorry, you must have a tty to run sudo" + when /sudo: sorry, you must have a tty to run sudo/ ["Sudo requires a TTY. Please see the README on how to configure "\ "sudo to allow for non-interactive usage.", :sudo_no_tty] - when /\[sudo\] password for root: Sorry, try again./ - ["[sudo] password for root: Sorry, try again", :sudo_root_password_required] else [rawerr, nil] end
matches case with regex for sudo wrapper
inspec_train
train
rb
c80a27f0793f964991649bd760f81f8a7920f7ca
diff --git a/src/means/simulation/solvers.py b/src/means/simulation/solvers.py index <HASH>..<HASH> 100644 --- a/src/means/simulation/solvers.py +++ b/src/means/simulation/solvers.py @@ -24,7 +24,7 @@ class UniqueNameInitialisationMixin(object): class SolverException(Exception): def __init__(self, base_exception): - message = '{0}: {1}'.format(base_exception.__class__.__name__, base_exception.message) + message = '{0.__class__.__name__}: {0!s}'.format(base_exception) super(SolverException, self).__init__(message) def available_solvers(with_sensitivity_support=False):
changed the message for the SolverException
theosysbio_means
train
py
c1c9e8f7f7846a9083dcf9135517e6992c9ed952
diff --git a/src/URTSI.js b/src/URTSI.js index <HASH>..<HASH> 100644 --- a/src/URTSI.js +++ b/src/URTSI.js @@ -10,9 +10,13 @@ class URTSI { this._address = address; this._path = serialPath; this._serialPort = null; + this._channels = []; + for (var ii = 1; ii <= 16; ii++) { + channels.push(new URTSIChannel(this, ii)); + } } - getChannel(channel) { - return new URTSIChannel(this, channel); + getChannels() { + return this._channels; } execute(channel, direction) { this._serialPort = this._serialPort || new Promise((resolve, reject) => {
Replace `getChannel` with `getChannels`
yungsters_node-urtsi
train
js
06cc3eaed39cabfc73559a54fd513520d41b7b7a
diff --git a/src/pymoca/parser.py b/src/pymoca/parser.py index <HASH>..<HASH> 100644 --- a/src/pymoca/parser.py +++ b/src/pymoca/parser.py @@ -467,7 +467,7 @@ class ASTListener(ModelicaListener): ) def exitType_specifier(self, ctx: ModelicaParser.Type_specifierContext): - for element in reversed([self.ast[ctx] for ctx in ctx.type_specifier_element()]): + for element in reversed([self.ast[x] for x in ctx.type_specifier_element()]): if ctx in self.ast: element.child = [self.ast[ctx]] self.ast[ctx] = element @@ -484,7 +484,7 @@ class ASTListener(ModelicaListener): ) def exitComponent_reference(self, ctx: ModelicaParser.Component_referenceContext): - for element in reversed([self.ast[ctx] for ctx in ctx.component_reference_element()]): + for element in reversed([self.ast[x] for x in ctx.component_reference_element()]): if ctx in self.ast: element.child = [self.ast[ctx]] self.ast[ctx] = element
Parser: Fix confusing list comprehensions
pymoca_pymoca
train
py
1483368bba93d26d62b932f865535d6671209d67
diff --git a/app/models/glue/candlepin/consumer.rb b/app/models/glue/candlepin/consumer.rb index <HASH>..<HASH> 100644 --- a/app/models/glue/candlepin/consumer.rb +++ b/app/models/glue/candlepin/consumer.rb @@ -37,7 +37,7 @@ module Glue::Candlepin::Consumer elsif type_key = attrs.has_key?('type') ? 'type' : :type #rename "type" to "cp_type" (activerecord and candlepin variable name conflict) - if attrs.has_key?(type_key) && !(attrs.has_key?(:cp_type) || attrs.has_key?('cp_type')) && new_record? + if attrs.has_key?(type_key) && !(attrs.has_key?(:cp_type) || attrs.has_key?('cp_type')) attrs[:cp_type] = attrs[type_key] end
Made an initializer change so that cp_type is handled right
Katello_katello
train
rb
d199b30f58d612825d4fa6136950ccf08a6a12cf
diff --git a/lib/tdiary/rack/auth/omniauth.rb b/lib/tdiary/rack/auth/omniauth.rb index <HASH>..<HASH> 100644 --- a/lib/tdiary/rack/auth/omniauth.rb +++ b/lib/tdiary/rack/auth/omniauth.rb @@ -19,6 +19,7 @@ class TDiary::Rack::Auth::OmniAuth raise NoStrategyFoundError.new("Not found any strategies. Write the omniauth strategy in your Gemfile.local.") end + OmniAuth.config.allowed_request_methods = [:get] # FixMe @app = ::Rack::Builder.new(app) { use TDiary::Rack::Session }.tap {|builder|
suppurt OmniAuth2 * force useing GET method * this is wrong implements for security * fix to use POST in future
tdiary_tdiary-core
train
rb
03a7b26f8f07a9c5f00f5c807592e78ff558ffe8
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index <HASH>..<HASH> 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -5,7 +5,7 @@ # Be sure to restart your server when you modify this file. -options = { key: '_rubygems_session' } +options = { key: '_rubygems_session', expire_after: Gemcutter::REMEMBER_FOR } Rails.application.config.session_store :cookie_store, options # Use the database for sessions instead of the cookie-based default,
Set httpOnly and expiry on rails session We use rails session for locale setting and mfa registration and sign in. rails session gets destroyed when user closed browser, it is still nice to set http only and expiry on it.
rubygems_rubygems.org
train
rb
c703d9ff2eedaa449732b3c0459a55255e0df13b
diff --git a/test/all.js b/test/all.js index <HASH>..<HASH> 100644 --- a/test/all.js +++ b/test/all.js @@ -179,7 +179,7 @@ function make_sure_new_message_has_the_attributes(done) { msg = msg[0]; var invisible_ms = (msg.visible_at - now) + (query_ms / 2); - assert.almost(invisible_ms, 1500, "Not-visible time (should be 1500): " + invisible_ms); + assert.ok(invisible_ms > 1000, "Not-visible time (should be 1500): " + invisible_ms); state.half_sec = msg; done();
More lenient check for high-latency connections
jhs_cqs
train
js
a303b3c8d454db36e3b119c9767598d3b7612873
diff --git a/run.go b/run.go index <HASH>..<HASH> 100644 --- a/run.go +++ b/run.go @@ -461,11 +461,11 @@ loop: continue } icon := " " - for _, threshold := range engine.Thresholds[name].Thresholds { - icon = "✓" - if threshold.Failed { + if m.Tainted.Valid { + if !m.Tainted.Bool { + icon = "✓" + } else { icon = "✗" - break } } fmt.Printf(" %s %s: %s\n", icon, name, val)
[change] UI now goes off Metrics, not Thresholds
loadimpact_k6
train
go
50b8d982499443f50700b2f406ae69db02f7a885
diff --git a/lib/ronin/network/tcp/proxy.rb b/lib/ronin/network/tcp/proxy.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/network/tcp/proxy.rb +++ b/lib/ronin/network/tcp/proxy.rb @@ -130,7 +130,7 @@ module Ronin server_socket = @connections[client_socket] data = recv(client_socket) - unless (data.empty? || client_socket.eof?) + unless data.empty? client_data(client_socket,server_socket,data) else client_disconnect(client_socket,server_socket) @@ -141,7 +141,7 @@ module Ronin client_socket = @connections.key(server_socket) data = recv(server_socket) - unless (data.empty? || server_socket.eof?) + unless data.empty? server_data(client_socket,server_socket,data) else server_disconnect(client_socket,server_socket)
Do not mix BasicSocket#recv with #eof?.
ronin-ruby_ronin-support
train
rb
4820d5b9d956eb0f7919e3a9dd678136e717e9bb
diff --git a/synapse/lib/socket.py b/synapse/lib/socket.py index <HASH>..<HASH> 100644 --- a/synapse/lib/socket.py +++ b/synapse/lib/socket.py @@ -393,7 +393,13 @@ class Plex(EventBus): # we managed it! any more msgs? if not sock.txque: sock.txbuf = None - self._plex_txsocks.remove(sock) + + # SPEED HACK: faster than if sock in txsocks: + try: + self._plex_txsocks.remove(sock) + except ValueError as e: + pass + return # more msgs! lets serialize the next! @@ -451,7 +457,7 @@ class Plex(EventBus): [ sock.fini() for sock in xxlist ] except Exception as e: - logger.error('plexMainLoop: %s', e) + logger.exception('plexMainLoop: %s', e) def _onPlexFini(self): #self._plex_s2.fini()
fixed duplicate remove issue for removing socket from multiplexor
vertexproject_synapse
train
py