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
57e35d1e2e1d30aa9308c661bccffb1a6f7313e9
diff --git a/lib/Utility.php b/lib/Utility.php index <HASH>..<HASH> 100644 --- a/lib/Utility.php +++ b/lib/Utility.php @@ -113,9 +113,13 @@ class Utility ********************/ public static function dumper($var) { - echo "<pre>\n"; + if (php_sapi_name() != 'cli') { // DONT PRE THE CLI! + echo "<pre>\n"; + } print_r($var); - echo "</pre><br>\n"; + if (php_sapi_name() != 'cli') { // DONT PRE THE CLI! + echo "</pre><br>\n"; + } } public static function dumperToString($var) @@ -459,7 +463,7 @@ class Utility public static function flush() { - if (php_sapi_name() != 'cli') { // DONT FLUSH THE FUCKING CLI! + if (php_sapi_name() != 'cli') { // DONT FLUSH THE CLI! //echo(str_repeat(' ',256)); if (ob_get_length()) { @ob_flush();
added cli detection to dumper... after like 7+ years its about time i got around to doing that
metaclassing_utility
train
php
3b5eface6a68974d062c964bae502aa988f94902
diff --git a/spec/requests/feed_spec.rb b/spec/requests/feed_spec.rb index <HASH>..<HASH> 100644 --- a/spec/requests/feed_spec.rb +++ b/spec/requests/feed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe "feed" do before(:each) do - Factory(:posts_revision, url: "url/to/post") + Factory(:posts_revision, :url => "url/to/post") end # test to prevent regression for issue #72
fixed a test that used <I> style
jipiboily_monologue
train
rb
fe756a74c5e3b8db410394d833521b8d2f0c7540
diff --git a/loompy/_version.py b/loompy/_version.py index <HASH>..<HASH> 100644 --- a/loompy/_version.py +++ b/loompy/_version.py @@ -1 +1 @@ -__version__ = '1.0.1' +__version__ = '1.0.2'
version bump for pypi
linnarsson-lab_loompy
train
py
ab3b70b9fb982840551cb5d9450458adb1f74f8f
diff --git a/test/mock/index.js b/test/mock/index.js index <HASH>..<HASH> 100644 --- a/test/mock/index.js +++ b/test/mock/index.js @@ -1,5 +1,34 @@ var Server = require('./lib/server'); +const cleanup = (servers, spy, callback) => { + if (!Array.isArray(servers)) { + throw new Error('First argument must be an array of mock servers'); + } + + if (spy) { + const alreadyDrained = spy.connectionCount() === 0; + const finish = () => { + callback(null, null); + }; + + if (!alreadyDrained) { + spy.once('drained', () => finish()); + } + + const cleanupPromise = Promise.all(servers.map(server => server.destroy())).catch(err => + callback(err, null) + ); + + if (alreadyDrained) { + cleanupPromise.then(() => finish()); + } + } else { + Promise.all(servers.map(server => server.destroy())) + .then(() => callback(null, null)) + .catch(err => callback(err, null)); + } +}; + /* * Main module */ @@ -7,5 +36,7 @@ module.exports = { createServer: function(port, host, options) { options = options || {}; return new Server(port, host, options).start(); - } + }, + + cleanup: cleanup };
feat(mock): support a means of consistently cleaning up mock servers NODE-<I>
mongodb-js_mongodb-core
train
js
4be49386ee0ff35c71e39e15296793bb9c2137a7
diff --git a/jfoenix/src/main/java/com/jfoenix/validation/RegexValidator.java b/jfoenix/src/main/java/com/jfoenix/validation/RegexValidator.java index <HASH>..<HASH> 100644 --- a/jfoenix/src/main/java/com/jfoenix/validation/RegexValidator.java +++ b/jfoenix/src/main/java/com/jfoenix/validation/RegexValidator.java @@ -63,7 +63,9 @@ public class RegexValidator extends ValidatorBase { private void evalTextInputField() { TextInputControl textField = (TextInputControl) srcControl.get(); - if (regexPatternCompiled.matcher(textField.getText()).matches()) { + String text = (textField.getText() == null) ? "" : textField.getText(); // Treat null like empty string + + if (regexPatternCompiled.matcher(text).matches()) { hasErrors.set(false); } else { hasErrors.set(true);
Matcher doesn't like nulls. If the text is null, we'll treat it like an empty string.
jfoenixadmin_JFoenix
train
java
a005ffab3bdf58a4aca5564756889ed6278980cd
diff --git a/is.go b/is.go index <HASH>..<HASH> 100644 --- a/is.go +++ b/is.go @@ -31,7 +31,7 @@ // is.Equal(signedin, true) // must be signed in // // body := readBody(r) -// is.OK(strings.Contains(body, "Hi there")) +// is.True(strings.Contains(body, "Hi there")) // // } package is
Replace is.OK with is.True in package description Looks like this was an oversight in #2.
matryer_is
train
go
55b522028723afb9f1f4388a5951a32fde74c053
diff --git a/core/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java b/core/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java +++ b/core/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java @@ -35,7 +35,7 @@ public class WebInterfaceBrowseServlet extends HttpServlet { * Class to make referencing file objects more intuitive. Mainly to avoid implicit association by * array indexes. */ - public static class UiBlockInfo implements Comparable<UiBlockInfo> { + public static final class UiBlockInfo { private final long mId; private final long mBlockLength; private final boolean mInMemory; @@ -46,11 +46,6 @@ public class WebInterfaceBrowseServlet extends HttpServlet { mInMemory = blockInfo.isInMemory(); } - @Override - public int compareTo(UiBlockInfo p) { - return (mId < p.mId ? -1 : (mId == p.mId ? 0 : 1)); - } - public long getBlockLength() { return mBlockLength; }
removed compareTo from UiBlockInfo since its bad practice to define it without equals and hash. Inspecting the code, it wasnt needed so removed
Alluxio_alluxio
train
java
13fcae51cb851c011e04cab20c7325e3a5dab970
diff --git a/php/commands/export.php b/php/commands/export.php index <HASH>..<HASH> 100644 --- a/php/commands/export.php +++ b/php/commands/export.php @@ -36,7 +36,7 @@ class Export_Command extends WP_CLI_Command { * comma. Defaults to all. * * [--post_type__not_in=<post-type>] - * : Export all post types except those identified. Seperate multiple post types + * : Export all post types except those identified. Separate multiple post types * with a comma. Defaults to none. * * [--post__in=<pid>]
Correct spelling of 'separate' in the `wp export` command docs.
wp-cli_export-command
train
php
7cfee8d9d881c9c437b276c143109870f4496d97
diff --git a/lxd/db/images_test.go b/lxd/db/images_test.go index <HASH>..<HASH> 100644 --- a/lxd/db/images_test.go +++ b/lxd/db/images_test.go @@ -37,7 +37,7 @@ func TestLocateImage(t *testing.T) { address, err = cluster.LocateImage("abc") require.Equal(t, "", address) - require.EqualError(t, err, "image not available on any online node") + require.EqualError(t, err, "Image not available on any online node") } func TestImageExists(t *testing.T) {
lxd/db/images/test: Fixes tests for LocateImage
lxc_lxd
train
go
33076767805d60a7afaf75ecb38322e02c8887d8
diff --git a/dump2polarion/csv2sqlite_cli.py b/dump2polarion/csv2sqlite_cli.py index <HASH>..<HASH> 100644 --- a/dump2polarion/csv2sqlite_cli.py +++ b/dump2polarion/csv2sqlite_cli.py @@ -80,6 +80,9 @@ def main(args=None): init_log(args.log_level) + if '.csv' not in args.input_file.lower(): + logger.warn("Make sure the input file '{}' is in CSV format".format(args.input_file)) + try: records = csvtools.get_imported_data(args.input_file) except (EnvironmentError, Dump2PolarionException) as err:
warn if input file doesn't seem to be CSV file
mkoura_dump2polarion
train
py
0ad2154f3ae81da6af1b0aca24cf5940099ef1a8
diff --git a/js/server/SocketServer.js b/js/server/SocketServer.js index <HASH>..<HASH> 100644 --- a/js/server/SocketServer.js +++ b/js/server/SocketServer.js @@ -22,6 +22,10 @@ function start(httpServer, withEngine) { engine = withEngine storage.setStore(engine.getStore()) + if (!httpServer) { + httpServer = require('http').createServer(function(){}) + httpServer.listen(8080, '127.0.0.1') + } var socket = io.listen(httpServer) socket.on('connection', _handleConnection) }
If there's not http server, start one
marcuswestin_fin
train
js
60881be23cc6a8a5478e94e32f6e0d7ae579d3cc
diff --git a/src/Offer/ReadModel/JSONLD/OfferLDProjector.php b/src/Offer/ReadModel/JSONLD/OfferLDProjector.php index <HASH>..<HASH> 100644 --- a/src/Offer/ReadModel/JSONLD/OfferLDProjector.php +++ b/src/Offer/ReadModel/JSONLD/OfferLDProjector.php @@ -94,6 +94,9 @@ abstract class OfferLDProjector implements OrganizerServiceInterface protected $eventsNotTriggeringUpdateModified; /** + * Associative array of bases prices. + * Key is the language, value is the translated string. + * * @var string[] */ private $basePriceTranslations;
III-<I> Add comment about base price translations being an associative array.
cultuurnet_udb3-php
train
php
ba864441a625fd6e315cabfd33bb62c61aa5803c
diff --git a/src/you_get/cli_wrapper/player/__main__.py b/src/you_get/cli_wrapper/player/__main__.py index <HASH>..<HASH> 100644 --- a/src/you_get/cli_wrapper/player/__main__.py +++ b/src/you_get/cli_wrapper/player/__main__.py @@ -1,7 +1,9 @@ #!/usr/bin/env python +''' WIP def main(): script_main('you-get', any_download, any_download_playlist) if __name__ == "__main__": main() +'''
comment the WIP code to silent lint
soimort_you-get
train
py
f2e31573150b3ebd5a5353736e6dab360d5d6a87
diff --git a/bundles/org.eclipse.orion.client.core/static/js/status.js b/bundles/org.eclipse.orion.client.core/static/js/status.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/static/js/status.js +++ b/bundles/org.eclipse.orion.client.core/static/js/status.js @@ -60,16 +60,16 @@ eclipse.StatusReportingService.prototype = { } var message = status.message || status; var color = "red"; - if (status.severity) { - switch (status.severity) { - case "warning": + if (status.Severity) { + switch (status.Severity) { + case "Warning": color = "#FFCC00"; break; - case "error": + case "Error": color = "red"; break; - case "info": - case "ok": + case "Info": + case "Ok": color = "green"; break; }
Bug <I> - Exception JSON response objects should have upper case properties
eclipse_orion.client
train
js
9719d57fb6e7046f6ba984834c029876caa892f7
diff --git a/fuseops/convert.go b/fuseops/convert.go index <HASH>..<HASH> 100644 --- a/fuseops/convert.go +++ b/fuseops/convert.go @@ -82,6 +82,14 @@ func Convert(r bazilfuse.Request, logger *log.Logger) (o Op) { o = to co = &to.commonOp + case *bazilfuse.ForgetRequest: + to := &ForgetInodeOp{ + Inode: InodeID(typed.Header.Node), + N: typed.N, + } + o = to + co = &to.commonOp + case *bazilfuse.MkdirRequest: to := &MkDirOp{ Parent: InodeID(typed.Header.Node), diff --git a/fuseops/ops.go b/fuseops/ops.go index <HASH>..<HASH> 100644 --- a/fuseops/ops.go +++ b/fuseops/ops.go @@ -255,10 +255,10 @@ type ForgetInodeOp struct { commonOp // The inode whose reference count should be decremented. - ID InodeID + Inode InodeID // The amount to decrement the reference count. - N int + N uint64 } func (o *ForgetInodeOp) Respond(err error) {
Added connection support for ForgetInodeOp.
jacobsa_fuse
train
go,go
4495de28db1ddf918260683ab576107dcd3e0ca3
diff --git a/lib/middleware/hsts.js b/lib/middleware/hsts.js index <HASH>..<HASH> 100644 --- a/lib/middleware/hsts.js +++ b/lib/middleware/hsts.js @@ -12,7 +12,7 @@ module.exports = function (maxAge, includeSubdomains) { if (includeSubdomains) header += '; includeSubdomains'; return function (req, res, next) { - if (req.connection.encrypted) { + if (typeof req.secure !== "undefined" ? req.secure : req.connection.encrypted) { res.header('Strict-Transport-Security', header); } next();
Use req.secure if it is set
venables_koa-helmet
train
js
1341c3608c0b7c75672c4650df11a05218882613
diff --git a/bin/changelog.js b/bin/changelog.js index <HASH>..<HASH> 100755 --- a/bin/changelog.js +++ b/bin/changelog.js @@ -138,7 +138,7 @@ async function getCommitMessage(commitInfo) { let lines = message.split(/\n\n/); - if (lines[1] === '') { + if (!lines[1]) { let pullRequest = await getPullRequest({ user: 'emberjs', repo: 'ember.js',
Fetch PR title Github on undefined/null as well as empty string
emberjs_ember.js
train
js
2853767b468d3bf41b2a93020e1f0c0f6439cede
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ install_requires = [ "troposphere>=1.9.0", "botocore>=1.6.0", "boto3>=1.3.1", - "PyYAML~=3.12", + "PyYAML>=3.12", "awacs>=0.6.0", "formic~=0.9b", "gitpython~=2.0",
Use a less strict pinning for PyYAML (#<I>) * loosen up PyYAML version a bit. * Update setup.py
cloudtools_stacker
train
py
f78c93a301e7b97c678e0f39f47bc0bf9297d3d0
diff --git a/lib/rules/spaced-comment.js b/lib/rules/spaced-comment.js index <HASH>..<HASH> 100644 --- a/lib/rules/spaced-comment.js +++ b/lib/rules/spaced-comment.js @@ -46,7 +46,7 @@ module.exports = function(context) { markers = unescapedMarkers.map(escaper); // the markerMatcher includes any markers in the list, followed by space/tab - markerMatcher = new RegExp("((^(" + markers.join("))|(^(") + ")))[ \\t]"); + markerMatcher = new RegExp("((^(" + markers.join("))|(^(") + ")))[ \\t\\n]"); } diff --git a/tests/lib/rules/spaced-comment.js b/tests/lib/rules/spaced-comment.js index <HASH>..<HASH> 100644 --- a/tests/lib/rules/spaced-comment.js +++ b/tests/lib/rules/spaced-comment.js @@ -130,6 +130,10 @@ eslintTester.addRuleTest("lib/rules/spaced-comment", { { code: "/* \n *Test\n */", options: ["always"] + }, + { + code: "/*!\n *comment\n */", + options: ["always", { markers: ["!"] }] } ],
Fix: Allow blocked comments with markers and new-line (fixes #<I>)
eslint_eslint
train
js,js
82a2d1fc54277d030d0b7406b43f3e5927734dfb
diff --git a/simuvex/storage/paged_memory.py b/simuvex/storage/paged_memory.py index <HASH>..<HASH> 100644 --- a/simuvex/storage/paged_memory.py +++ b/simuvex/storage/paged_memory.py @@ -777,7 +777,8 @@ class SimPagedMemory(object): if self.state.mode != 'fastpath': for page in xrange(pages): if base_page_num + page in self._pages: - raise SimMemoryError("map_page received address and length combination which contained mapped page") + l.warning("map_page received address and length combination which contained mapped page") + return if isinstance(permissions, (int, long)): permissions = claripy.BVV(permissions, 3)
map_page now warns if a page is already mapped instead of raising SimMemoryError
angr_angr
train
py
b21c5ebebf25b280ed36105adb7b0f413c337ebf
diff --git a/src/main/java/com/bullhornsdk/data/model/entity/file/CandidateFileAttachment.java b/src/main/java/com/bullhornsdk/data/model/entity/file/CandidateFileAttachment.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/bullhornsdk/data/model/entity/file/CandidateFileAttachment.java +++ b/src/main/java/com/bullhornsdk/data/model/entity/file/CandidateFileAttachment.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonRootName; "fileType", "isCopied", "isDeleted", + "isEncrypted", "isExternal", "isOpen", "isPrivate",
added json tag isEncrypted
bullhorn_sdk-rest
train
java
7376bdef29ec9035cde4a4a6db6f7f76cf1eb40b
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100644 --- a/devices.js +++ b/devices.js @@ -1393,6 +1393,13 @@ const devices = [ extend: generic.light_onoff_brightness_colortemp, }, { + zigbeeModel: ['LIGHTIFY BR RGBW'], + model: '73739', + vendor: 'Sylvania', + description: 'LIGHTIFY LED RGBW BR30', + extend: generic.light_onoff_brightness_colortemp_colorxy, + }, + { zigbeeModel: ['LIGHTIFY A19 RGBW'], model: '73693', vendor: 'Sylvania',
Add Support for Osram BR<I> RGBW (#<I>) * Add support for Sengled E<I>-N<I> (BR<I>) Light * Add Osram BR<I> RGBW LED to HA * Update devices.js
Koenkk_zigbee-shepherd-converters
train
js
2b89c418db9b49bb2f5fa468a755b768c44e060a
diff --git a/lib/netsuite/records/journal_entry.rb b/lib/netsuite/records/journal_entry.rb index <HASH>..<HASH> 100644 --- a/lib/netsuite/records/journal_entry.rb +++ b/lib/netsuite/records/journal_entry.rb @@ -39,6 +39,10 @@ module NetSuite "Transaction" end + def self.search_class_namespace + "tranSales" + end + end end end
Add search namespace override to JournalEntry The namespace for JournalEntry is tranGeneral, but it's search falls under the Transaction schema with the namespace tranSales. Add a search_class_namespace override to make this work properly.
NetSweet_netsuite
train
rb
7d36597823609b3a4a64380f43803bb4ec958536
diff --git a/app/models/barbeque/job_execution.rb b/app/models/barbeque/job_execution.rb index <HASH>..<HASH> 100644 --- a/app/models/barbeque/job_execution.rb +++ b/app/models/barbeque/job_execution.rb @@ -3,7 +3,7 @@ class Barbeque::JobExecution < Barbeque::ApplicationRecord belongs_to :job_queue has_one :slack_notification, through: :job_definition has_one :app, through: :job_definition - has_many :job_retries + has_many :job_retries, dependent: :destroy enum status: { pending: 0,
Destroy retries after their execution destruction
cookpad_barbeque
train
rb
f9a44b2683d9ce23a908609446b84946a7a16f47
diff --git a/tests/unit/components/when-input-test.js b/tests/unit/components/when-input-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/components/when-input-test.js +++ b/tests/unit/components/when-input-test.js @@ -131,7 +131,7 @@ describe('Unit: frost-bunsen-input-when', function () { component.send('selectedButton', eventObject) }) - it('sets "selectedValue" to the value the second radio button', function () { + it('sets "selectedValue" to the value the first radio button', function () { expect(component.get('selectedValue')).to.equal(firstButtonValue) })
update a test title to be correct
ciena-frost_ember-frost-bunsen
train
js
86cc24aeea58590bc1aa445bcac8e17ebaa979bf
diff --git a/spec/baza_models/query_spec.rb b/spec/baza_models/query_spec.rb index <HASH>..<HASH> 100644 --- a/spec/baza_models/query_spec.rb +++ b/spec/baza_models/query_spec.rb @@ -42,6 +42,13 @@ describe BazaModels::Query do expect(query.to_sql).to eq "SELECT `users`.* FROM `users` LEFT JOIN roles ON roles.user_id = users.id WHERE `roles`.`role` = 'administrator'" expect(query.to_a).to eq [user] end + + it "does deep joins" do + query = Organization.joins(user: :person).to_sql + + expect(query).to include "INNER JOIN `users` ON `users.organization_id` = `organizations`.`id`" + expect(query).to include "INNER JOIN `persons` ON `persons.user_id` = `users`.`id`" + end end context "#group, #order" do
Added spec for deep joins
kaspernj_baza_models
train
rb
20b6f91cfd6caa9a3b79268d37167f58f37939c7
diff --git a/test/com/belladati/sdk/impl/SDKTest.java b/test/com/belladati/sdk/impl/SDKTest.java index <HASH>..<HASH> 100644 --- a/test/com/belladati/sdk/impl/SDKTest.java +++ b/test/com/belladati/sdk/impl/SDKTest.java @@ -28,7 +28,7 @@ public class SDKTest { protected final JsonBuilder builder = new JsonBuilder(); /** system default locale */ - private static final Locale DEFAULT_LOCALE = Locale.getDefault(); + private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; @BeforeMethod(alwaysRun = true) protected void setupServer() throws Exception {
Failing tests fixed. Root cause was system locale. If different from ENGLISH, hardcoded date strings do not match with hardcoded generated once (Pi vs Fri, etc.)
BellaDati_belladati-sdk-java
train
java
7a3723637b38f4f69c9b8689adfd95e410491d79
diff --git a/tofu/geom/_core_optics.py b/tofu/geom/_core_optics.py index <HASH>..<HASH> 100644 --- a/tofu/geom/_core_optics.py +++ b/tofu/geom/_core_optics.py @@ -2801,6 +2801,14 @@ class CrystalBragg(utils.ToFuObject): ) # --------------- + # refactor pts and lambok + + indok = np.any(lambok, axis=0) + pts = pts[:, indok] + ptsXYZ = ptsXYZ[:, indok] + lambok = lambok[:, indok] + + # --------------- # check strict if strict is True:
[#<I>] Cryst.get_plasmadomain_at_lamb() now faster and lighter thanks to refactoring, TODO: parallelizing?
ToFuProject_tofu
train
py
4f9fa23a1cc637cbe7c9701a430eab6e216cdb2e
diff --git a/mongo_orchestration/servers.py b/mongo_orchestration/servers.py index <HASH>..<HASH> 100644 --- a/mongo_orchestration/servers.py +++ b/mongo_orchestration/servers.py @@ -326,17 +326,18 @@ class Server(BaseModel): self.port = int(self.hostname.split(':')[1]) # Wait for Server to respond to isMaster. - for i in range(timeout): + # Only try 6 times, each ConnectionFailure is 30 seconds. + max_attempts = 6 + for i in range(max_attempts): try: self.run_command('isMaster') break except pymongo.errors.ConnectionFailure: logger.exception('isMaster command failed:') - time.sleep(0.1) else: raise TimeoutError( "Server did not respond to 'isMaster' after %d attempts." - % timeout) + % max_attempts) except (OSError, TimeoutError): logpath = self.cfg.get('logpath') if logpath:
Reduce isMaster waiting time from <I> hours to 3 minutes.
10gen_mongo-orchestration
train
py
c0aaff5aa55dd5344c7b8d6c6a8ee549aec74f1e
diff --git a/table/tables/tables_test.go b/table/tables/tables_test.go index <HASH>..<HASH> 100644 --- a/table/tables/tables_test.go +++ b/table/tables/tables_test.go @@ -397,7 +397,7 @@ func (ts *testSuite) TestTableFromMeta(c *C) { c.Assert(err, IsNil) tb, err := ts.dom.InfoSchema().TableByName(model.NewCIStr("test"), model.NewCIStr("meta")) c.Assert(err, IsNil) - tbInfo := tb.Meta() + tbInfo := tb.Meta().Clone() // For test coverage tbInfo.Columns[0].GeneratedExprString = "a"
planner: fix the unstable unit test TestTableFromMeta (#<I>)
pingcap_tidb
train
go
be63f932e31d3184d8cc13668f3de34e58fd409b
diff --git a/boot/server.js b/boot/server.js index <HASH>..<HASH> 100644 --- a/boot/server.js +++ b/boot/server.js @@ -1,5 +1,17 @@ /* global process, __dirname */ +// Ensure running a compatible version of Node before getting too far... +var semver = require('semver') +var packageJson = require('../package.json') +if (packageJson.engines && + packageJson.engines.node && + !semver.satisfies(process.versions.node, packageJson.engines.node)) { + console.error('Incompatible version of node - running [%s] but require [%s]', + process.versions.node, packageJson.engines.node) + process.exit(1) +} + + /** * Configuration dependencies */
Added version check to server.js
anvilresearch_connect
train
js
6be4f68ac76bf9fc956d9a34ab2c320cc949d1cc
diff --git a/src/main/java/org/zendesk/client/v2/Zendesk.java b/src/main/java/org/zendesk/client/v2/Zendesk.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/zendesk/client/v2/Zendesk.java +++ b/src/main/java/org/zendesk/client/v2/Zendesk.java @@ -2402,6 +2402,11 @@ public class Zendesk implements Closeable { @Override public JobStatus<T> onCompleted(Response response) throws Exception { JobStatus<T> result = super.onCompleted(response); + if (result == null) { + // null is when we receive a 404 response. + // For an async job we trigger an error + throw new ZendeskResponseException(response); + } result.setResultsClass(resultClass); return result; }
[fix] A <I> answer (result==null) for an async Job should be considered as an error.
cloudbees_zendesk-java-client
train
java
78b9f245fa62718fefd8790415c6e203b0535183
diff --git a/Kwc/Basic/Text/StylesModel.php b/Kwc/Basic/Text/StylesModel.php index <HASH>..<HASH> 100644 --- a/Kwc/Basic/Text/StylesModel.php +++ b/Kwc/Basic/Text/StylesModel.php @@ -45,9 +45,7 @@ class Kwc_Basic_Text_StylesModel extends Kwf_Model_Db_Proxy $package = Kwf_Assets_Package_Default::getInstance('Frontend'); $ret = array(); foreach ($package->getDependency()->getFilteredUniqueDependencies('text/css') as $dep) { - if ($dep instanceof Kwf_Assets_Dependency_File) { - $ret = array_merge($ret, self::parseMasterStyles(file_get_contents($dep->getAbsoluteFileName()))); - } + $ret = array_merge($ret, self::parseMasterStyles($dep->getContentsSourceString())); } Kwf_Cache_SimpleStatic::add($cacheId, $ret); return $ret;
Use ConentsSourceString method to get contents - Kwf_Assets_Components_Dependency_Css isn't a File dependency - this is also very efficent
koala-framework_koala-framework
train
php
630c210dd4450a69310055d468339e4427574c46
diff --git a/src/BTChip.js b/src/BTChip.js index <HASH>..<HASH> 100644 --- a/src/BTChip.js +++ b/src/BTChip.js @@ -58,6 +58,9 @@ BTChip.prototype._almostConvertU32 = function(number, hdFlag) { } BTChip.prototype.parseBIP32Path = function(path) { + if (path.indexOf("m/") == 0) { + path = path.substring(2); + } var result = []; var components = path.split("/"); for (var i=0; i<components.length; i++) {
Handle conventional path naming m/
LedgerHQ_ledgerjs
train
js
7e11d410498dd04131d7890c71697daad9fd97ba
diff --git a/tests/unit/models/geometry/PoreVolumeTest.py b/tests/unit/models/geometry/PoreVolumeTest.py index <HASH>..<HASH> 100644 --- a/tests/unit/models/geometry/PoreVolumeTest.py +++ b/tests/unit/models/geometry/PoreVolumeTest.py @@ -49,6 +49,15 @@ class PoreVolumeTest: b = np.unique(self.geo['pore.volume']) assert_approx_equal(a, b) + def test_effective(self): + net = op.network.Cubic(shape=[2, 2, 1]) + net['pore.volume'] = 0.5 + net['throat.volume'] = 0.25 + net.add_model(propname='pore.volume_effective', + model=mods.effective) + a = np.array([0.5 + 0.25]) + b = np.unique(net['pore.volume_effective']) + assert_approx_equal(a, b) if __name__ == '__main__':
Added unit test for effective volume model
PMEAL_OpenPNM
train
py
c829b7d251d188ccd23e053fdea6adea693e6d4f
diff --git a/ipyrad/assemble/demultiplex.py b/ipyrad/assemble/demultiplex.py index <HASH>..<HASH> 100644 --- a/ipyrad/assemble/demultiplex.py +++ b/ipyrad/assemble/demultiplex.py @@ -216,10 +216,10 @@ class FileLinker: rasyncs = {} if createdinc: for sample in self.data.samples.values(): - gzipped = bool(sample.files.fastqs[0].endswith(".gz")) + gzipped = bool(sample.files.fastqs[0][0].endswith(".gz")) rasyncs[sample.name] = self.lbview.apply( zbufcountlines, - *(sample.files.fastqs[0], gzipped) + *(sample.files.fastqs[0][0], gzipped) ) # wait for link jobs to finish if parallel
fix to fastqs tuple in a list on fastq loader
dereneaton_ipyrad
train
py
2209d479283a832d35a891a4ce617ac286056275
diff --git a/src/security/is-request-valid.js b/src/security/is-request-valid.js index <HASH>..<HASH> 100644 --- a/src/security/is-request-valid.js +++ b/src/security/is-request-valid.js @@ -14,7 +14,7 @@ module.exports = function isRequestValid(context, req, cb) { currentDate = new Date(), diff = (currentDate - requestDate) / 1000; - req.pipe(hashStream(context.secretKey, queryString.dt)).pipe(concat(function(hash) { + req.pipe(hashStream(context.sharedSecret, queryString.dt)).pipe(concat(function(hash) { if (hash !== queryString.messageHash || diff > timeout) { console.error(util.format("Unauthorized access from %s, %s, %s Computed: %s"), req.headers.host, queryString.messageHash, queryString.dt, hash);
changing secretKey to sharedSecret in isRequestValid
Mozu_mozu-node-sdk
train
js
a27bf9af6c39e7ee79e243294d84c24c8ba46098
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( 'simple_elasticsearch.management', 'simple_elasticsearch.management.commands' ], - version = '0.1.1', + version = '0.1.3', url='http://github.com/jaddison/django-simple-elasticsearch', keywords=['search', 'django', 'elasticsearch', 'es', 'index'], license='BSD', diff --git a/simple_elasticsearch/utils.py b/simple_elasticsearch/utils.py index <HASH>..<HASH> 100644 --- a/simple_elasticsearch/utils.py +++ b/simple_elasticsearch/utils.py @@ -39,7 +39,7 @@ def recursive_dict_update(d, u): return d -def queryset_generator(queryset, chunksize=1000): +def queryset_iterator(queryset, chunksize=1000): last_pk = queryset.order_by('-pk')[0].pk queryset = queryset.order_by('pk') pk = queryset[0].pk - 1
Updating pypi version and fixing a function naming bug.
jaddison_django-simple-elasticsearch
train
py,py
2020aa5d10e0d0a9131775c09f8b88a278b55c5d
diff --git a/providers/providers.go b/providers/providers.go index <HASH>..<HASH> 100644 --- a/providers/providers.go +++ b/providers/providers.go @@ -118,12 +118,7 @@ func loadProvSet(dstore ds.Datastore, k *cid.Cid) (*providerSet, error) { } out := newProviderSet() - //for e := range res.Next() { - for { - e, ok := res.NextSync() - if !ok { - break - } + for e := range res.Next() { if e.Error != nil { log.Error("got an error: ", e.Error) continue
use old 'Next' method for now
libp2p_go-libp2p-kad-dht
train
go
b8ef669ebd48a54c24cae03cba868bd3ed43cc03
diff --git a/quarkc/compiler.py b/quarkc/compiler.py index <HASH>..<HASH> 100644 --- a/quarkc/compiler.py +++ b/quarkc/compiler.py @@ -38,7 +38,7 @@ from .dispatch import overload from .helpers import ( lineinfo, is_meta, get_fields, base_bindings, get_methods, get_field, is_abstract, constructor, base_type, base_constructors, has_super, has_return, - is_newer, compiled_quark, namever, mdroot, + is_newer, compiled_quark, namever, mdroot, is_extendable ) from .environment import Environment from . import docmaker @@ -948,7 +948,7 @@ class Reflector: "mdefs": "\n".join(mdefs), "methods": ", ".join(mids), "parents": ", ".join(['reflect.Class.get("{}")'.format(self.qual(parent_type.resolved.type)) - for parent_type in cls.bases] + for parent_type in cls.bases if is_extendable(parent_type)] or ["reflect.Class.OBJECT"]), "construct": construct}
Only try to track parent relationships of types have a reflect.Class.
datawire_quark
train
py
9da58389b3403687fe2f1b575c7c4fe6382710c2
diff --git a/src/Select.js b/src/Select.js index <HASH>..<HASH> 100644 --- a/src/Select.js +++ b/src/Select.js @@ -172,7 +172,10 @@ var Select = React.createClass({ }, selectValue: function(value) { - this[this.props.multi ? 'addValue' : 'setValue'](value); + if(!this.props.multi) + this.setValue(value); + else if(value) + this.addValue(value); }, addValue: function(value) {
Do not ever addValue(undefined)
HubSpot_react-select-plus
train
js
044e97524a8b321a5bce01b931c5c642208a78cd
diff --git a/Generator/Info8.php b/Generator/Info8.php index <HASH>..<HASH> 100644 --- a/Generator/Info8.php +++ b/Generator/Info8.php @@ -29,7 +29,7 @@ class Info8 extends Info { $files = array_shift($args); $module_data = $this->base_component->component_data; - print_r($module_data); + //print_r($module_data); $lines = array(); $lines['name'] = $module_data['readable_name'];
Fixed uncommented debug code.
drupal-code-builder_drupal-code-builder
train
php
f77a1b2e337d8b371c9708fd0c8d37a82e206813
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -80,14 +80,6 @@ var createServer = function(e, index) { return server; }; -//--------------------------------------------------------------- -//exit on ctrl-c -process.on('SIGINT', function() { - console.log("\n[ QUIT ]--> Caught interrupt signal on SERVER module"); - process.exit(); -}); -//--------------------------------------------------------------- - module.exports = function(torrent, opts) { if (!opts) opts = {}; if (opts.blocklist) {
removed on sigint handling, not required as it is the default behaviouor
mafintosh_peerflix
train
js
c785b39eda490704a63c5b52664ac4d4af1faba4
diff --git a/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java b/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java index <HASH>..<HASH> 100644 --- a/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java +++ b/dependency-check-core/src/test/java/org/owasp/dependencycheck/suppression/SuppressionHandlerTest.java @@ -88,7 +88,15 @@ public class SuppressionHandlerTest { xmlReader.parse(in); - List result = handler.getSuppressionRules(); + List<SuppressionRule> result = handler.getSuppressionRules(); assertTrue(result.size() > 3); + int baseCount = 0; + for (SuppressionRule r : result) { + if (r.isBase()) { + baseCount++; + } + } + assertTrue(baseCount > 0); + } }
added assertion to validate that the base flag is being processed Former-commit-id: <I>e<I>af8f<I>d<I>f<I>f<I>e<I>c<I>
jeremylong_DependencyCheck
train
java
7578480aefeef92ee552700a85ff2bc29e068c2e
diff --git a/lib/command_line_reporter/row.rb b/lib/command_line_reporter/row.rb index <HASH>..<HASH> 100644 --- a/lib/command_line_reporter/row.rb +++ b/lib/command_line_reporter/row.rb @@ -46,7 +46,7 @@ module CommandLineReporter # c1.screen_rows.size == 5 # c2.screen_rows.size == 2 # - # So when we don't have a screen row for c2 we need to fill the screen with the + # So when we don't have a screen row for c2 we need to fill the screen with the # proper number of blanks so the layout looks like (parenthesis on the right just # indicate screen row index) # @@ -58,12 +58,15 @@ module CommandLineReporter # | xxxxxxxxxxx | | (4) # +-------------+------------+ if col.screen_rows[sr].nil? - line << ' ' * col.width + line << ' ' * col.width << ' ' else - line << self.columns[mc].screen_rows[sr] + line << self.columns[mc].screen_rows[sr] << ' ' end - line << ' ' + ((self.border) ? "#{border_char} " : '') + if self.border + line << border_char + line << ' ' if mc < self.columns.size - 1 + end end puts line
Do not print superfluous whitespace behind rows This fix removes the single whitespace character that would be printed behind the last border on a row.
wbailey_command_line_reporter
train
rb
5a80458c6fc9fbd7cd0d5ede8e6655479046ff3a
diff --git a/app/models/changeset.rb b/app/models/changeset.rb index <HASH>..<HASH> 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -36,8 +36,9 @@ class Changeset < ActiveRecord::Base PROMOTED = 'promoted' PROMOTING = 'promoting' DELETING = 'deleting' + DELETED = 'deleted' FAILED = 'failed' - STATES = [NEW, REVIEW, PROMOTING, PROMOTED, FAILED, DELETING] + STATES = [NEW, REVIEW, PROMOTING, PROMOTED, FAILED, DELETING, DELETED] PROMOTION = 'promotion'
Adding a missing 'deleted' state to indicate succesfu completion of delete
Katello_katello
train
rb
f3225b308b41d811afda81677885dcd55b97ba08
diff --git a/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php b/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php index <HASH>..<HASH> 100644 --- a/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php +++ b/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php @@ -434,9 +434,9 @@ final class PhpStormStubsSourceStubber implements SourceStubber } /** - * @param Node\Stmt[] $stmts + * @param list<Node\Stmt> $stmts * - * @return Node\Stmt[] + * @return list<Node\Stmt> */ private function modifyStmtsByPhpVersion(array $stmts): array {
Improved array types in PhpStormStubsSourceStubber
Roave_BetterReflection
train
php
e5d038f7f0d1cad62c9ceb12a65c44516139ad27
diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index <HASH>..<HASH> 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -189,7 +189,15 @@ else if(this.attr('id') == 'CanCreateTopLevelType') dropdown = $('#CreateTopLevelGroups'); this.find('.optionset :input').bind('change', function(e) { - dropdown[e.target.value == 'OnlyTheseUsers' ? 'show' : 'hide'](); + var wrapper = $(this).closest('.middleColumn').parent('div'); + if(e.target.value == 'OnlyTheseUsers') { + wrapper.addClass('remove-splitter'); + dropdown['show'](); + } + else { + wrapper.removeClass('remove-splitter'); + dropdown['hide'](); + } }); // initial state
BUGFIX: #<I> Removed bottom border of the parent div wrapped around settings' options-sets when radio-buttons with a value of 'OnlyTheseUsers' is selected.
silverstripe_silverstripe-siteconfig
train
js
4ae9e3eb9939201746a3f8f1312d01a4e8cee00d
diff --git a/fetch.js b/fetch.js index <HASH>..<HASH> 100644 --- a/fetch.js +++ b/fetch.js @@ -82,7 +82,8 @@ } this.formData = function() { - return Promise.resolve(decode(this._body)) + var rejected = consumed(this) + return rejected ? rejected : Promise.resolve(decode(this._body)) } this.json = function() {
FormData should only able to consume once
Netflix_yetch
train
js
6fbc735dce032d57e44ea753a660ef9f65260f09
diff --git a/lib/crass/parser.rb b/lib/crass/parser.rb index <HASH>..<HASH> 100644 --- a/lib/crass/parser.rb +++ b/lib/crass/parser.rb @@ -76,20 +76,32 @@ module Crass string = '' nodes.each do |node| + next if node.nil? + case node[:node] + when :at_rule + string << node[:tokens].first[:raw] + string << self.stringify(node[:prelude], options) + + if node[:block] + string << self.stringify(node[:block], options) + end + when :comment string << node[:raw] unless options[:exclude_comments] - when :style_rule - string << self.stringify(node[:selector][:tokens], options) - string << "{" - string << self.stringify(node[:children], options) - string << "}" - when :property - string << options[:indent] if options[:indent] string << self.stringify(node[:tokens], options) + when :simple_block + string << node[:start] + string << self.stringify(node[:value], options) + string << node[:end] + + when :style_rule + string << self.stringify(node[:selector][:tokens], options) + string << "{#{self.stringify(node[:children], options)}}" + else if node.key?(:raw) string << node[:raw]
Improve serialization of simple blocks and at-rules. You can now alter the value of a simple block and have those changes reflected in the serialized CSS (previously simple blocks were serialized directly from their original tokens).
rgrove_crass
train
rb
98b841ead9959e654c3896ac90e67f3bf13f925e
diff --git a/lib/assertions.js b/lib/assertions.js index <HASH>..<HASH> 100644 --- a/lib/assertions.js +++ b/lib/assertions.js @@ -238,7 +238,7 @@ module.exports = function (expect) { if (this.flags.only) { expect(hasKeys, 'to be truthy'); - expect(Object.keys(subject).length === keys.length, '[not] to be truthy'); + expect(expect.findTypeOf(subject).getKeys(subject).length === keys.length, '[not] to be truthy'); } else { expect(hasKeys, '[not] to be truthy'); } diff --git a/test/unexpected.spec.js b/test/unexpected.spec.js index <HASH>..<HASH> 100644 --- a/test/unexpected.spec.js +++ b/test/unexpected.spec.js @@ -1210,6 +1210,12 @@ describe('unexpected', function () { }); }); + describe('to have keys assertion', function () { + it('should work with non-enumerable keys returned by the getKeys function of the subject type', function () { + expect(new Error('foo'), 'to only have key', 'message'); + }); + }); + describe('properties assertion', function () { it('asserts presence of a list of properties', function () { expect({a: 'foo', b: 'bar'}, 'to have properties', ['a', 'b']);
to have only key(s): Use type.getKeys instead of Object.keys.
unexpectedjs_unexpected
train
js,js
86db5c78ad591571dd8c486fb8a93b6f48cd96c6
diff --git a/src/Requests/Application/Scan/Issue/CommentRequests.php b/src/Requests/Application/Scan/Issue/CommentRequests.php index <HASH>..<HASH> 100644 --- a/src/Requests/Application/Scan/Issue/CommentRequests.php +++ b/src/Requests/Application/Scan/Issue/CommentRequests.php @@ -34,12 +34,9 @@ class CommentRequests extends BaseRequest * @param array $queryParams * @return Response */ - public function getAll($appId = null, $scanId = null, $issueId = null, array $queryParams = []) + public function getAll($appId, $scanId, $issueId, array $queryParams = []) { - $uri = is_null($appId) - ? "/applications/scans/issues/comments/all" - : $this->uri($appId, $scanId, $issueId); - $response = $this->client->get($uri, [ + $response = $this->client->get($this->uri($appId, $scanId, $issueId), [ 'query' => $queryParams, ]);
Remove end point to read out all comments
rips_php-connector
train
php
546e290299512fdfdd6f367ab6fff07c677d25f2
diff --git a/src/DailymilePHP/Client.php b/src/DailymilePHP/Client.php index <HASH>..<HASH> 100644 --- a/src/DailymilePHP/Client.php +++ b/src/DailymilePHP/Client.php @@ -26,7 +26,7 @@ class Client { } return $getAll - ? $this->getPagedEntries() + ? $this->getPagedEntries($parameters) : $this->normaliseAndFetch($parameters, 'entries')['entries']; } @@ -90,14 +90,14 @@ class Client { return is_array($param) ? $param[$key] : $param; } - private function getPagedEntries($username, $params) + private function getPagedEntries($params) { $results = []; $page = 1; do { - $parameters['page'] = strval($page++); - $fetched = $this->normaliseAndFetch($parameters, 'entries')['entries']; + $params['page'] = strval($page++); + $fetched = $this->normaliseAndFetch($params, 'entries')['entries']; $results = array_merge($results, $fetched); } while (count($fetched));
remember to run tests after refactoring. oops.
SimonS_dailymile-php-wrapper
train
php
64433f8e3cdf38d8ad762e7e1a0bd29546b1d4ad
diff --git a/tests/test_pipeline/test_network.py b/tests/test_pipeline/test_network.py index <HASH>..<HASH> 100644 --- a/tests/test_pipeline/test_network.py +++ b/tests/test_pipeline/test_network.py @@ -14,7 +14,8 @@ def test_http_client(): instance = Session.return_value http_client = HTTPClientProperty(session_class=Session, a=1) assert http_client.provide_value(dinergate) is instance - Session.assert_called_once_with(a=1) + Session.assert_called_once_with() + assert instance.a == 1 def test_url_query():
fix up the broken unittest for last commit.
douban_brownant
train
py
032093958c22aeb6d2d2cccc8ad8f9d5cb742745
diff --git a/support/cas-server-support-token-tickets/src/main/java/org/apereo/cas/token/authentication/principal/TokenWebApplicationServiceResponseBuilder.java b/support/cas-server-support-token-tickets/src/main/java/org/apereo/cas/token/authentication/principal/TokenWebApplicationServiceResponseBuilder.java index <HASH>..<HASH> 100644 --- a/support/cas-server-support-token-tickets/src/main/java/org/apereo/cas/token/authentication/principal/TokenWebApplicationServiceResponseBuilder.java +++ b/support/cas-server-support-token-tickets/src/main/java/org/apereo/cas/token/authentication/principal/TokenWebApplicationServiceResponseBuilder.java @@ -34,7 +34,7 @@ public class TokenWebApplicationServiceResponseBuilder extends WebApplicationSer final Map<String, String> parameters) { final RegisteredService registeredService = this.servicesManager.findServiceBy(service); RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(service, registeredService); - final boolean tokenAsResponse = RegisteredServiceProperty.RegisteredServiceProperties.TOKEN_AS_RESPONSE.isAssignedTo(registeredService); + final boolean tokenAsResponse = RegisteredServiceProperty.RegisteredServiceProperties.TOKEN_AS_SERVICE_TICKET.isAssignedTo(registeredService); if (!tokenAsResponse) { return super.buildInternal(service, parameters);
TOKEN_AS_RESPONSE is deprecated, TOKEN_AS_SERVICE_TICKET is to be used instead (#<I>)
apereo_cas
train
java
22bc0f81653371e389199211b6fb2e6825257079
diff --git a/lib/couch.php b/lib/couch.php index <HASH>..<HASH> 100644 --- a/lib/couch.php +++ b/lib/couch.php @@ -173,7 +173,7 @@ class couch { $this->_disconnect(); //log_message('debug',"COUCH : Executed query $method $url"); - + //log_message('debug',"COUCH : ".$raw_response); return $raw_response; } diff --git a/lib/couchClient.php b/lib/couchClient.php index <HASH>..<HASH> 100644 --- a/lib/couchClient.php +++ b/lib/couchClient.php @@ -605,7 +605,7 @@ class couchException extends Exception { * @param string $raw_response HTTP response from the CouchDB server */ function __construct($raw_response) { - $this->couch_response = couch::parse_raw_response($raw_response); + $this->couch_response = couch::parseRawResponse($raw_response); parent::__construct($this->couch_response['status_message'], $this->couch_response['status_code']); }
another bugfix related to mass renaming, in excpetion class
dready92_PHP-on-Couch
train
php,php
44d8ce6f195a9730e5526e71fefc0b067e5ebb31
diff --git a/lib/views.js b/lib/views.js index <HASH>..<HASH> 100644 --- a/lib/views.js +++ b/lib/views.js @@ -110,6 +110,7 @@ Views.prototype.setView = function(key, value) { var name = this.options.inflection; if (name) this.emit(name, view, this); + view.isType = this.isType.bind(this); this.views[view.key] = view; return view;
expose `isType` on view
jonschlinkert_templates
train
js
9ad687acf761e06c44c74ef8d1d2fa385908e59e
diff --git a/lib/websearch_external_collections.py b/lib/websearch_external_collections.py index <HASH>..<HASH> 100644 --- a/lib/websearch_external_collections.py +++ b/lib/websearch_external_collections.py @@ -331,7 +331,7 @@ def calculate_hosted_collections_results(req, pattern_list, field, hosted_collec if not hosted_collections: return (None, None) vprint = get_verbose_print(req, 'Hosted collections: ', verbosity_level) - vprint(3, 'pattern_list = %s, field = %s' % (cgi.escape(pattern_list), cgi.escape(field))) + vprint(3, 'pattern_list = %s, field = %s' % (cgi.escape(repr(pattern_list)), cgi.escape(field))) # firstly we calculate the search parameters, i.e. the actual hosted search engines and the basic search units (hosted_search_engines, basic_search_units) = \
WebSearch: external search pattern_list escape fix * Fixes problem with escaping of pattern_list in external searching that slipped in c<I>ce6cee2d3dcf1eef<I>f<I>e<I>a7c8f.
inveniosoftware_invenio-records
train
py
8c30fa7b0fe5ea9fc46aa7f3e4925fb8ff1e4fd7
diff --git a/benchmarks/memory/test_curves.py b/benchmarks/memory/test_curves.py index <HASH>..<HASH> 100644 --- a/benchmarks/memory/test_curves.py +++ b/benchmarks/memory/test_curves.py @@ -29,7 +29,10 @@ SUCCESS_TEMPLATE = 'Memory usage: {:g}KB.' def get_bounds(): # NOTE: These bounds assume **just** the interpeter is running this code. # When using a test runner like `py.test`, usage goes up by 4-8 KB. - return 28, 32 + if os.getenv('CIRCLECI') == 'true': + return 28, 33 + else: + return 28, 32 def intersect_all(): diff --git a/benchmarks/time/test_curves.py b/benchmarks/time/test_curves.py index <HASH>..<HASH> 100644 --- a/benchmarks/time/test_curves.py +++ b/benchmarks/time/test_curves.py @@ -22,7 +22,7 @@ FAILURES = (11, 20, 24, 42) def get_bounds(): if os.getenv('CIRCLECI') == 'true': - return 42.0 / 1024.0, 52.0 / 1024.0 + return 42.0 / 1024.0, 70.0 / 1024.0 else: return 35.0 / 1024.0, 42.0 / 1024.0
Loosening bounds on benchmarks on CircleCI. These are "supported" by builds #<I> through #<I> (e.g. <URL>
dhermes_bezier
train
py,py
10538ac1b11a87e0ed9abef2bccb5b244deb1a13
diff --git a/src/App/Component/Module/Manager.php b/src/App/Component/Module/Manager.php index <HASH>..<HASH> 100644 --- a/src/App/Component/Module/Manager.php +++ b/src/App/Component/Module/Manager.php @@ -245,9 +245,7 @@ class Manager if (in_array($setupClass, $completedExecutions)) { continue; } - if (class_exists($setupClass)) { - $this->objectManager->get($setupClass)->execute(); - } + $this->objectManager->get($setupClass)->execute(); $completedSetupClasses[] = ['class' => $setupClass]; } } @@ -338,7 +336,7 @@ class Manager } /** - * @param string $routeName + * @param string $routeName * @param string|null $areaCode * @return \CrazyCat\Framework\App\Component\Module|null */
# throw exception when setup field of module is invalid
crazy-cats_framework
train
php
880b121a5c4bdd9d36d9c9c6923d8d2439929959
diff --git a/gitenberg/__init__.py b/gitenberg/__init__.py index <HASH>..<HASH> 100644 --- a/gitenberg/__init__.py +++ b/gitenberg/__init__.py @@ -11,6 +11,6 @@ from .workflow import upload_all_books, upload_list, upload_book __title__ = 'gitberg' __appname__ = 'gitberg' -__version__ = '0.1.0' +__version__ = '0.2.0' __copyright__ = 'Copyright 2012-2016 Seth Woodworth and the Free Ebook Foundation'
it seems <I> has been previously used
gitenberg-dev_gitberg
train
py
49cb2b087a6963cb2e4124ce6b517dcbb497c0a7
diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index <HASH>..<HASH> 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -294,6 +294,24 @@ records = "*" c = p.pipenv('run python -c "import tablib"') assert c.return_code == 0 + @pytest.mark.cli + @pytest.mark.install + def test_install_without_dev_section(self, pypi): + with PipenvInstance(pypi=pypi) as p: + with open(p.pipfile_path, 'w') as f: + contents = """ +[packages] +tablib = "*" + """.strip() + f.write(contents) + c = p.pipenv('install') + assert c.return_code == 0 + assert 'tablib' in p.pipfile['packages'] + assert p.pipfile.get('dev-packages', {}) == {} + assert 'tablib' in p.lockfile['default'] + assert p.lockfile['develop'] == {} + c = p.pipenv('run python -c "import tablib"') + assert c.return_code == 0 @pytest.mark.run @pytest.mark.uninstall
Add test to go through the editable check code path This would have failed without the previous commit.
pypa_pipenv
train
py
89b62407344b65452d4c0c166ea5230fbb9349c5
diff --git a/type/Left.js b/type/Left.js index <HASH>..<HASH> 100644 --- a/type/Left.js +++ b/type/Left.js @@ -17,11 +17,11 @@ const Left = value => Object.create( ) function map() { - return Left(this.value) + return this } function flatMap() { - return Left(this.value) + return this } function leftMap(func) { @@ -35,7 +35,7 @@ function leftFlatMap(func) { } function ap() { - return Left(this.value) + return this } const prototype = { diff --git a/type/Right.js b/type/Right.js index <HASH>..<HASH> 100644 --- a/type/Right.js +++ b/type/Right.js @@ -27,11 +27,11 @@ function flatMap(func) { } function leftMap() { - return Right(this.value) + return this } function leftFlatMap() { - return Right(this.value) + return this } function ap(right) {
Simplify some of the Left and Right methods <URL>
joelnet_MojiScript
train
js,js
b1f8844495631b3123af6fffbd55bd69347c7971
diff --git a/raiden/network/transport/matrix/transport.py b/raiden/network/transport/matrix/transport.py index <HASH>..<HASH> 100644 --- a/raiden/network/transport/matrix/transport.py +++ b/raiden/network/transport/matrix/transport.py @@ -605,7 +605,12 @@ class MatrixTransport(Runnable): It also whitelists the address to answer invites and listen for messages. """ - if self._address_mgr.is_address_known(node_address): + is_health_information_available = ( + self._address_mgr.get_address_reachability(node_address) + is not AddressReachability.UNKNOWN + ) + + if is_health_information_available: self.log.debug( "Healthcheck already enabled", peer_address=to_checksum_address(node_address) )
bugfix: healthcheck and whitelist is not the same thing An address that is whitelist does not necessarily have the healthcheck running, this means that checking if the address is available in the address manager is not sufficient, one also has to check the current value for the availability information. If the node state is anything but UNKNWON we know the presence information was used at least once (it does not, however, mean the presence information is up-to-date).
raiden-network_raiden
train
py
4945cacd5166b97c39e9e9d22aa4fc6a58ca58af
diff --git a/src/main/java/water/parser/ParseDataset.java b/src/main/java/water/parser/ParseDataset.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/parser/ParseDataset.java +++ b/src/main/java/water/parser/ParseDataset.java @@ -250,7 +250,6 @@ public final class ParseDataset extends Job { try { switch(_comp){ case ZIP: - ZipInputStream zis = new ZipInputStream(v.openStream(new UnzipProgressMonitor(_job._progress))); ZipEntry ze = zis.getNextEntry(); // There is at least one entry in zip file and it is not a directory. @@ -306,6 +305,7 @@ public final class ParseDataset extends Job { numRows += _p1._nrows[i]; _fileInfo[_idx]._nrows[i] = numRows; } + quietlyComplete(); // wake up anyone who is joining on this task! } }
Bugfix in reducing parallelism during unzip and parse. I used to call get on a guy who has a completer set and fj by default does not call complete (which sets the status and wakes up all waiting for this guy) so I added it into onCompletion call.
h2oai_h2o-2
train
java
0d1054b967f9b16576a17d47a457e64947c3b174
diff --git a/documenteer/stackdocs/stackcli.py b/documenteer/stackdocs/stackcli.py index <HASH>..<HASH> 100644 --- a/documenteer/stackdocs/stackcli.py +++ b/documenteer/stackdocs/stackcli.py @@ -4,8 +4,11 @@ __all__ = ('main',) import logging +import sys import click +from .build import build_stack_docs + # Add -h as a help shortcut option CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @@ -58,3 +61,13 @@ def help(ctx, topic, **kw): click.echo(ctx.parent.get_help()) else: click.echo(main.commands[topic].get_help(ctx)) + + +@main.command() +@click.pass_context +def build(ctx): + """Build documentation as HTML. + """ + return_code = build_stack_docs(ctx.obj['root_project_dir']) + if return_code > 0: + sys.exit(return_code)
Add stack-docs build command Uses the existing build pipeline from build-stack-docs (the earlier argparse-based CLI).
lsst-sqre_documenteer
train
py
9b322dec6790f6d273b8f707bc07976d778c4cf6
diff --git a/tests/tests.js b/tests/tests.js index <HASH>..<HASH> 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -58,6 +58,7 @@ exports.defineAutoTests = function () { var isBrowser = cordova.platformId === "browser"; var isIE = isBrowser && navigator.userAgent.indexOf("Trident") >= 0; var isIos = cordova.platformId === "ios"; + var isIot = cordova.platformId === "android" && navigator.userAgent.indexOf("iot") >= 0; // tests describe("FileTransferError", function () { @@ -1078,7 +1079,7 @@ exports.defineAutoTests = function () { // windows store and ios are too fast, win is called before we have a chance to abort // so let's get them busy - while not providing an extra load to the slow Android emulators - var arrayLength = ((isWindows && !isWindowsPhone81) || isIos) ? 3000000 : 200000; + var arrayLength = ((isWindows && !isWindowsPhone81) || isIos) ? 3000000 : isIot ? 150000 : 200000; writeFile(specContext.root, specContext.fileName, new Array(arrayLength).join("aborttest!"), fileWin, done); }, UPLOAD_TIMEOUT);
Don't crash on low memory devices It will be OOM when running file-transfer tests on baseline Android Memory class which is <I>M (It happens to be the java heap limit of those devices). This closes #<I>
apache_cordova-plugin-file-transfer
train
js
ec35e0447ee704a718b49f88ba46f9a156e5cf78
diff --git a/plugin/pkg/scheduler/factory/factory.go b/plugin/pkg/scheduler/factory/factory.go index <HASH>..<HASH> 100644 --- a/plugin/pkg/scheduler/factory/factory.go +++ b/plugin/pkg/scheduler/factory/factory.go @@ -345,7 +345,7 @@ func (f *ConfigFactory) CreateFromConfig(policy schedulerapi.Policy) (*scheduler // Creates a scheduler from a set of registered fit predicate keys and priority keys. func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys sets.String, extenders []algorithm.SchedulerExtender) (*scheduler.Config, error) { - glog.V(2).Infof("creating scheduler with fit predicates '%v' and priority functions '%v", predicateKeys, priorityKeys) + glog.V(2).Infof("Creating scheduler with fit predicates '%v' and priority functions '%v", predicateKeys, priorityKeys) if f.HardPodAffinitySymmetricWeight < 0 || f.HardPodAffinitySymmetricWeight > 100 { return nil, fmt.Errorf("invalid hardPodAffinitySymmetricWeight: %d, must be in the range 0-100", f.HardPodAffinitySymmetricWeight)
Corrected a typo in scheduler factory.go.
kubernetes_kubernetes
train
go
0868a6778939b217f4fed23d013732a4eb1e95ce
diff --git a/src/Statement/Update.php b/src/Statement/Update.php index <HASH>..<HASH> 100644 --- a/src/Statement/Update.php +++ b/src/Statement/Update.php @@ -48,7 +48,7 @@ class Update extends AdvancedStatement */ public function set(array $pairs) { - $this->pairs = $pairs; + $this->pairs = array_merge($this->pairs, $pairs); return $this; }
Make Update::set append values, not replace. Resolves issue #<I>
FaaPz_PDO
train
php
ca01642970c3110195f354d4491ac45a017ba03d
diff --git a/lib/simpler_tiles/map.rb b/lib/simpler_tiles/map.rb index <HASH>..<HASH> 100644 --- a/lib/simpler_tiles/map.rb +++ b/lib/simpler_tiles/map.rb @@ -17,7 +17,7 @@ module SimplerTiles # A convienence method to use Active Record configuration and add a new # layer. - def ar_layer + def ar_layer(&blk) if !defined?(ActiveRecord) raise "ActiveRecord not available" end @@ -31,7 +31,9 @@ module SimplerTiles :password => config[:password] } - layer "PG:" + params.reject {|k,v| v.nil? }.map {|k,v| "#{k}='#{v}'"}.join(' ') + conn = "PG:" + params.reject {|k,v| v.nil? }.map {|k,v| "#{k}=#{v}"}.join(' ') + + layer(conn) {|l| blk.call(l) } end # Render the data to a blob of png data.
ar_layer yeilds now
propublica_simpler-tiles
train
rb
dc112a899635086174ed5f9cfc0d334dac2a4f18
diff --git a/yaks/lib/yaks/attributes.rb b/yaks/lib/yaks/attributes.rb index <HASH>..<HASH> 100644 --- a/yaks/lib/yaks/attributes.rb +++ b/yaks/lib/yaks/attributes.rb @@ -24,12 +24,6 @@ module Yaks alias with update - this.names.each do |attr| - define_method "with_#{attr}" do |value| - with(attr => value) - end - end - define_singleton_method(:attributes) { this } end end diff --git a/yaks/spec/unit/yaks/attributes_spec.rb b/yaks/spec/unit/yaks/attributes_spec.rb index <HASH>..<HASH> 100644 --- a/yaks/spec/unit/yaks/attributes_spec.rb +++ b/yaks/spec/unit/yaks/attributes_spec.rb @@ -168,7 +168,7 @@ WidgetContainer.new( describe '#initialize' do it 'should take hash-based args' do - expect(widget_container.new(widgets: [:bar])).to eql widget_container.new.with_widgets([:bar]) + expect(widget_container.new(widgets: [:bar])).to eql widget_container.new.with(widgets: [:bar]) end it 'should use defaults when available' do
Drop the automatic generation of with_* methods Including Attributes.new(:foo) would generate a #with_foo method. This behavior was not used, and can be written just as concisely as with(foo: ..), so it was dropped.
plexus_yaks
train
rb,rb
61292e6819921f45e0af70a752f21838ef8123a9
diff --git a/lib/byebug/commands/set.rb b/lib/byebug/commands/set.rb index <HASH>..<HASH> 100644 --- a/lib/byebug/commands/set.rb +++ b/lib/byebug/commands/set.rb @@ -54,7 +54,7 @@ module Byebug if setting_value == true Byebug.post_mortem else - return print 'Sorry... not implemented yet. Restart byebug' + Byebug.post_mortem = false end when /^autoeval|autoreload|basename|forcestep|fullpath|linetrace_plus| testing|stack_on_error$/x
Allow disabling post_mortem mode
deivid-rodriguez_byebug
train
rb
6afb6134b24f233cac3dd5fe44599eb95cc4cc33
diff --git a/bika/lims/upgrade/to1115.py b/bika/lims/upgrade/to1115.py index <HASH>..<HASH> 100644 --- a/bika/lims/upgrade/to1115.py +++ b/bika/lims/upgrade/to1115.py @@ -16,5 +16,4 @@ def upgrade(tool): bc.delIndex('getSamplePointTitle') bc.addIndex('getSampleTypeTitle', 'KeywordIndex') bc.addIndex('getSamplePointTitle', 'KeywordIndex') - for o in bc(): - o.reindexObject(idxs=['getSampleTypeTitle', 'getSamplePointTitle']) + bc.clearFindAndRebuild()
Fix upgrade step <I>: rebuild catalog
senaite_senaite.core
train
py
f20dd721082c17ab5c32077b4b75f681ccff31b1
diff --git a/src/Bridge/NetteDI/OrmExtension.php b/src/Bridge/NetteDI/OrmExtension.php index <HASH>..<HASH> 100644 --- a/src/Bridge/NetteDI/OrmExtension.php +++ b/src/Bridge/NetteDI/OrmExtension.php @@ -29,12 +29,7 @@ class OrmExtension extends CompilerExtension if (!isset($config['model'])) { throw new InvalidStateException('Model is not defined.'); } - } - - public function beforeCompile() - { - $config = $this->getConfig(); $repositories = $this->getRepositoryList($config['model']); $repositoriesConfig = Model::getConfiguration($repositories); diff --git a/src/Bridge/NetteDI/OrmTestsExtension.php b/src/Bridge/NetteDI/OrmTestsExtension.php index <HASH>..<HASH> 100644 --- a/src/Bridge/NetteDI/OrmTestsExtension.php +++ b/src/Bridge/NetteDI/OrmTestsExtension.php @@ -21,15 +21,9 @@ class OrmTestsExtension extends OrmExtension public function loadConfiguration() { - parent::loadConfiguration(); $config = $this->getConfig(['testingMappers' => TRUE]); $this->testingMappers = $config['testingMappers']; - } - - - public function beforeCompile() - { - parent::beforeCompile(); + parent::loadConfiguration(); $this->setupEntityCreator(); }
nette di: fixed late service definition in compiler extension
nextras_orm
train
php,php
19a3a39a36feca217524aa19cf56f9a0eee4fb1d
diff --git a/src/Console/SchemaUpdateCommand.php b/src/Console/SchemaUpdateCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/SchemaUpdateCommand.php +++ b/src/Console/SchemaUpdateCommand.php @@ -84,8 +84,10 @@ class SchemaUpdateCommand extends Command $this->getName())); $this->comment(sprintf(' <info>php artisan %s --sql</info> to dump the SQL statements to the screen', $this->getName())); + + return 1; } - return 1; + return 0; } }
[FIX] Fix exit codes for SchemaUpdateCommand (#<I>) * Fix exit codes for SchemaUpdateCommand * Fix StyleCI issue
laravel-doctrine_orm
train
php
96c6816366bbc7261e304aafee79c8a3ba04eb64
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java index <HASH>..<HASH> 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryResults.java @@ -98,6 +98,11 @@ public class QuatSymmetryResults { this.clusters = clusters; this.stoichiometry = SubunitClusterUtils .getStoichiometryString(clusters); + + subunits = new ArrayList<Subunit>(); + for (SubunitCluster c : clusters) { + subunits.addAll(c.getSubunits()); + } this.helixLayers = helixLayers; this.method = method; @@ -117,11 +122,8 @@ public class QuatSymmetryResults { * * @return an unmodifiable view of the List */ - public List<Subunit> getSubunits() { - if (subunits != null) - return Collections.unmodifiableList(subunits); - else - return Collections.unmodifiableList(new ArrayList<>()); + public List<Subunit> getSubunits() { + return Collections.unmodifiableList(subunits); } /**
Better fix for null subunits as advised by @lafita
biojava_biojava
train
java
b97efff66c28ff0f77aa9e5b335e15036422600e
diff --git a/htdocs/api/v1/alert-dbapi.py b/htdocs/api/v1/alert-dbapi.py index <HASH>..<HASH> 100755 --- a/htdocs/api/v1/alert-dbapi.py +++ b/htdocs/api/v1/alert-dbapi.py @@ -21,7 +21,7 @@ import logging import pytz import re -__version__ = '1.9.5' +__version__ = '1.9.6' BROKER_LIST = [('localhost', 61613)] # list of brokers for failover NOTIFY_TOPIC = '/topic/notify' @@ -266,7 +266,7 @@ def main(): { '$inc': { "count": 1, "totalTime": diff}}, True) - m = re.search(r'[PUT|POST] /alerta/api/v1/alerts/alert/(?P<id>[a-z0-9-]+)$', request) + m = re.search(r'(PUT|POST) /alerta/api/v1/alerts/alert/(?P<id>[a-z0-9-]+)$', request) if m: alertid = m.group('id') query['_id'] = dict()
Wrong brackets in regex
alerta_alerta
train
py
6e0272b0143cfbc266f5904125c6a9ab8e131259
diff --git a/app/scripts/Insets2dTrack.js b/app/scripts/Insets2dTrack.js index <HASH>..<HASH> 100644 --- a/app/scripts/Insets2dTrack.js +++ b/app/scripts/Insets2dTrack.js @@ -555,6 +555,13 @@ export default class Insets2dTrack extends PixiTrack { return base64ToCanvas(data); } + remove() { + // Make sure we remove all insets to avoid memory leaks + this.insets.forEach((inset) => { + this.destroyInset(inset.id); + }); + } + setDimensions(newDimensions) { super.setDimensions(newDimensions);
Destroy insets on track removal to avoid memory leaks
higlass_higlass
train
js
ccfdc1b0055d25da2d9139fd4aafc3af521c20cd
diff --git a/dalesbred/src/main/java/fi/evident/dalesbred/Database.java b/dalesbred/src/main/java/fi/evident/dalesbred/Database.java index <HASH>..<HASH> 100644 --- a/dalesbred/src/main/java/fi/evident/dalesbred/Database.java +++ b/dalesbred/src/main/java/fi/evident/dalesbred/Database.java @@ -172,6 +172,13 @@ public final class Database { } } + /** + * Returns true if and only if the current thread has an active transaction for this database. + */ + public boolean hasActiveTransaction() { + return activeTransaction.get() != null; + } + private <T> T withSuspendedTransaction(@Nullable Isolation isolation, @NotNull TransactionCallback<T> callback) { DatabaseTransaction suspended = activeTransaction.get(); try {
Added method for checking if there's an active transaction.
EvidentSolutions_dalesbred
train
java
da25db1d6c3fc209f882f90d6e0ac52224e28551
diff --git a/keyring/backend.py b/keyring/backend.py index <HASH>..<HASH> 100644 --- a/keyring/backend.py +++ b/keyring/backend.py @@ -28,11 +28,6 @@ except ImportError: def abstractproperty(funcobj): return property(funcobj) -try: - import gnomekeyring -except ImportError: - pass - _KEYRING_SETTING = 'keyring-setting' _CRYPTED_PASSWORD = 'crypted-password' _BLOCK_SIZE = 32
Remove the try import that has not point.
jaraco_keyring
train
py
4645e77670ddc9b11ab0b8292c6b7dc4c82a779d
diff --git a/insteonplm/plm.py b/insteonplm/plm.py index <HASH>..<HASH> 100644 --- a/insteonplm/plm.py +++ b/insteonplm/plm.py @@ -273,13 +273,14 @@ class PLM(asyncio.Protocol): # we can use that as the device type for this record # Otherwise we need to request the device ID. if device is not None: - if device.prod_data_in_aldb: - if device is not None: - if isinstance(device, list): - for currdev in device: + if device is not None: + if isinstance(device, list): + for currdev in device: + if device.prod_data_in_aldb: self.devices[currdev.id] = currdev self.log.info('Device with id %s added to device list from ALDB Data.', currdev.id) - else: + else: + if device.prod_data_in_aldb: self.devices[device.id] = device self.log.info('Device with id %s added to device list from ALDB data.', device.id)
Fixed adding complex devices from ALDB data
nugget_python-insteonplm
train
py
92793d8e08b86bbb2a79a79af9a9565fa553465b
diff --git a/Helper/Order.php b/Helper/Order.php index <HASH>..<HASH> 100644 --- a/Helper/Order.php +++ b/Helper/Order.php @@ -979,10 +979,6 @@ class Order extends AbstractHelper $this->setShippingMethod($quote, $transaction); $this->quoteAfterChange($quote); - $email = @$transaction->order->cart->billing_address->email_address ?: - @$transaction->order->cart->shipments[0]->shipping_address->email_address; - $this->addCustomerDetails($quote, $email); - // Check if Mageplaza Gift Card data exist and apply it to the parent quote $this->discountHelper->applyMageplazaDiscountToQuote($quote); @@ -998,6 +994,10 @@ class Order extends AbstractHelper ] ); + $email = @$transaction->order->cart->billing_address->email_address ?: + @$transaction->order->cart->shipments[0]->shipping_address->email_address; + $this->addCustomerDetails($quote, $email); + $quote->setReservedOrderId($quote->getBoltReservedOrderId()); $this->cartHelper->quoteResourceSave($quote);
Ensure customer email is set to the quote before saving the order (#<I>)
BoltApp_bolt-magento2
train
php
07b51a7c29bb540af32c1c284759a6685220d056
diff --git a/media/boom/js/boom/wysihtml5.js b/media/boom/js/boom/wysihtml5.js index <HASH>..<HASH> 100644 --- a/media/boom/js/boom/wysihtml5.js +++ b/media/boom/js/boom/wysihtml5.js @@ -187,10 +187,13 @@ $.widget('wysihtml5.editor', $.boom.textEditor, _insert_toolbar : function(element) { var self = this; - return $.get('/cms/toolbar/text?mode=' + self.mode) - .done(function(response) { - top.$('body').prepend(response) - }); + return $.ajax({ + url : '/cms/toolbar/text?mode=' + self.mode, + cache : true, + }) + .done(function(response) { + top.$('body').prepend(response) + }); }, /**
Don't cache text editor toolbars
boomcms_boom-core
train
js
e8ee057ce8dd8c59871933694906f2d8c31296d2
diff --git a/lib/http-client.js b/lib/http-client.js index <HASH>..<HASH> 100644 --- a/lib/http-client.js +++ b/lib/http-client.js @@ -60,7 +60,7 @@ function onCommand(question, cb) { } ).on("error", function(err) { body = err; - onCallback(err, body, res, cb); + onCallback(err, body, null, cb); }).end(); } diff --git a/lib/run.js b/lib/run.js index <HASH>..<HASH> 100644 --- a/lib/run.js +++ b/lib/run.js @@ -58,6 +58,13 @@ function run(question, cb) { } ).on("error", function(err) { body = err; + + if (options.json === true) { + cservice.results(JSON.stringify(body)); + } else { + cservice.results(util.inspect(body, { depth: null, colors: true })); + } + cb && cb(err, body); }).end(); } diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cluster-service", - "version": "0.5.8", + "version": "0.5.9", "author": { "name": "Aaron Silvas", "email": "asilvas@godaddy.com"
fix error handling for client & run
godaddy_node-cluster-service
train
js,js,json
a42f72317daa053867e7cd30995d374166b38ead
diff --git a/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php b/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php index <HASH>..<HASH> 100644 --- a/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php +++ b/Adapter/PlentymarketsAdapter/ResponseParser/OrderStatus/OrderStatusResponseParser.php @@ -31,6 +31,10 @@ class OrderStatusResponseParser implements OrderStatusResponseParserInterface */ public function parse(array $entry) { + if (empty($entry['id'])) { + return null; + } + $identity = $this->identityService->findOneOrCreate( (string) $entry['id'], PlentymarketsAdapter::NAME,
extra safety check for order statuses from plentymarkets
plentymarkets_plentymarkets-shopware-connector
train
php
2c288a35f8dc133e38bb4ee7ea642f54b1e29007
diff --git a/theanets/layers.py b/theanets/layers.py index <HASH>..<HASH> 100644 --- a/theanets/layers.py +++ b/theanets/layers.py @@ -1006,7 +1006,7 @@ class MRNN(Recurrent): x = inputs['out'] h = TT.dot(x, self.find('xh')) + self.find('b') f = TT.dot(x, self.find('xf')) - (pre, factors, out), updates = self._scan(fn, [h, f], [None, x]) + (pre, out), updates = self._scan(fn, [h, f], [None, x]) return dict(pre=pre, factors=f, out=out), updates
We don't return factors from scan!
lmjohns3_theanets
train
py
04c24e9231ba3a3f4716bdfebddaaaa8b8bc76a0
diff --git a/config/webpack.js b/config/webpack.js index <HASH>..<HASH> 100644 --- a/config/webpack.js +++ b/config/webpack.js @@ -116,7 +116,8 @@ const shared = { }, timeout: 80000, plugins: [ - new webpack.DefinePlugin({'fs.writeSync': false}) + new webpack.DefinePlugin({'fs.writeSync': false}), + new webpack.optimize.DedupePlugin() ] }
feat(webpack): enable dedupe plugin
ipfs_aegir
train
js
690089baa800ba3430c413cf1c8a2af7c1977b91
diff --git a/lib/http/request/writer.rb b/lib/http/request/writer.rb index <HASH>..<HASH> 100644 --- a/lib/http/request/writer.rb +++ b/lib/http/request/writer.rb @@ -68,7 +68,7 @@ module HTTP elsif @body.is_a?(Enumerable) @body.each do |chunk| @socket << chunk.bytesize.to_s(16) << CRLF - @socket << chunk + @socket << chunk << CRLF end @socket << '0' << CRLF * 2 diff --git a/spec/http/request/writer_spec.rb b/spec/http/request/writer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/http/request/writer_spec.rb +++ b/spec/http/request/writer_spec.rb @@ -21,5 +21,13 @@ describe HTTP::Request::Writer do it "does throw on a body that isn't string, enumerable or nil" do expect { construct true }.to raise_error end + + it 'writes a chunked request from an Enumerable correctly' do + io = StringIO.new + writer = HTTP::Request::Writer.new(io, %w[bees cows], [], '') + writer.send_request_body + io.rewind + expect(io.string).to eq "4\r\nbees\r\n4\r\ncows\r\n0\r\n\r\n" + end end end
Added missing CRLF for chunked bodies
httprb_http
train
rb,rb
71cb27836d6ddda01551f36ec255444c528e77b6
diff --git a/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go b/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go index <HASH>..<HASH> 100644 --- a/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go +++ b/cmd/kubeadm/app/cmd/phases/init/waitcontrolplane.go @@ -19,6 +19,7 @@ package phases import ( "fmt" "io" + "os" "path/filepath" "text/template" "time" @@ -100,6 +101,13 @@ func runWaitControlPlanePhase(c workflow.RunData) error { return errors.New("couldn't initialize a Kubernetes cluster") } + // Deletes the kubelet boostrap kubeconfig file, so the credential used for TLS bootstrap is removed from disk + // This is done only on success. + bootstrapKubeConfigFile := kubeadmconstants.GetBootstrapKubeletKubeConfigPath() + if err := os.Remove(bootstrapKubeConfigFile); err != nil { + klog.Warningf("[wait-control-plane] could not delete the file %q: %v", bootstrapKubeConfigFile, err) + } + return nil }
kubeadm: delete boostrap-kubelet.conf after TLS bootstrap on init
kubernetes_kubernetes
train
go
0841bd91403595b26380b1340033311023418e42
diff --git a/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php b/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php index <HASH>..<HASH> 100644 --- a/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php +++ b/src/CoandaCMS/Coanda/Pages/PagesModuleProvider.php @@ -445,6 +445,18 @@ class PagesModuleProvider implements \CoandaCMS\Coanda\CoandaModuleProvider { throw new \Exception('Home page not created yet!'); } + private function renderAttributes($page, $pagelocation) + { + $attributes = new \stdClass; + + foreach ($page->attributes as $attribute) + { + $attributes->{$attribute->identifier} = $attribute->render($page, $pagelocation); + } + + return $attributes; + } + /** * @param $page * @param bool $pagelocation @@ -468,7 +480,7 @@ class PagesModuleProvider implements \CoandaCMS\Coanda\CoandaModuleProvider { 'page' => $page, 'location' => $pagelocation, 'meta' => $meta, - 'attributes' => $pagelocation->attributes + 'attributes' => $this->renderAttributes($page, $pagelocation) ]; // Make the view and pass all the render data to it...
Reinstated the renderAttributes method in the pages module. This is in case there is no location, in the case of the home page.
CoandaCMS_coanda-core
train
php
4613140a5dea2e8222e367103f0a44b80e1599b9
diff --git a/pavement.py b/pavement.py index <HASH>..<HASH> 100644 --- a/pavement.py +++ b/pavement.py @@ -70,6 +70,13 @@ def test_install(): sh('%s setup.py install' % VPYEXEC) @task +def build_version_files(options): + from common import write_version + write_version(os.path.join("scikits", "audiolab", "version.py")) + if os.path.exists(os.path.join("docs", "src")): + write_version(os.path.join("docs", "src", "audiolab_version.py")) + +@task #@needs(['latex', 'html']) def dmg(): builddir = path("build") / "dmg" @@ -118,6 +125,7 @@ if paver.doctools.has_sphinx: return Bunch(locals()) @task + @needs('build_version_files') def latex(): """Build Audiolab's documentation and install it into scikits/audiolab/docs""" @@ -134,7 +142,7 @@ if paver.doctools.has_sphinx: pdf.move(destdir) @task - @needs(['paver.doctools.html']) + @needs('build_version_files', 'paver.doctools.html') def html_build(): """Build Audiolab's html documentation.""" pass
Automatically build version file for doc.
cournape_audiolab
train
py
3afb2862c0cdb8e9d229b7c7e4141e1abfa57d00
diff --git a/moto/logs/models.py b/moto/logs/models.py index <HASH>..<HASH> 100644 --- a/moto/logs/models.py +++ b/moto/logs/models.py @@ -19,7 +19,7 @@ class LogEvent: def to_filter_dict(self): return { - "eventId": self.eventId, + "eventId": str(self.eventId), "ingestionTime": self.ingestionTime, # "logStreamName": "message": self.message, diff --git a/tests/test_logs/test_logs.py b/tests/test_logs/test_logs.py index <HASH>..<HASH> 100644 --- a/tests/test_logs/test_logs.py +++ b/tests/test_logs/test_logs.py @@ -121,4 +121,8 @@ def test_filter_logs_interleaved(): interleaved=True, ) events = res['events'] - events.should.have.length_of(2) + for original_message, resulting_event in zip(messages, events): + resulting_event['eventId'].should.equal(str(resulting_event['eventId'])) + resulting_event['timestamp'].should.equal(original_message['timestamp']) + resulting_event['message'].should.equal(original_message['message']) +
Filter event log ids should be strings Based on the boto docs, eventId should be returned as a string. <URL>
spulec_moto
train
py,py
bcb298dee55de4b468df3614562c3bc19c3dc8bf
diff --git a/library/Controller/BaseController.php b/library/Controller/BaseController.php index <HASH>..<HASH> 100644 --- a/library/Controller/BaseController.php +++ b/library/Controller/BaseController.php @@ -12,7 +12,6 @@ class BaseController public function __construct() { - add_filter('HbgBlade/data', array($this, 'getData')); $this->init(); } @@ -27,6 +26,6 @@ class BaseController */ public function getData() { - return $this->data; + return apply_filters('HbgBlade/data', $this->data); } }
Correted code error for blade data filter
helsingborg-stad_Municipio
train
php
11f703b45c2ab6f56abbd0f3e055afa3c682dfd5
diff --git a/mutagen/id3.py b/mutagen/id3.py index <HASH>..<HASH> 100644 --- a/mutagen/id3.py +++ b/mutagen/id3.py @@ -623,13 +623,16 @@ class ID3(DictProxy, mutagen.Metadata): # TDAT, TYER, and TIME have been turned into TDRC. try: - if str(self.get("TYER", "")).strip("\x00"): - date = str(self.pop("TYER")) - if str(self.get("TDAT", "")).strip("\x00"): - dat = str(self.pop("TDAT")) + date = text_type(self.get("TYER", "")) + if date.strip(u"\x00"): + self.pop("TYER") + dat = text_type(self.get("TDAT", "")) + if dat.strip("\x00"): + self.pop("TDAT") date = "%s-%s-%s" % (date, dat[2:], dat[:2]) - if str(self.get("TIME", "")).strip("\x00"): - time = str(self.pop("TIME")) + time = text_type(self.get("TIME", "")) + if time.strip("\x00"): + self.pop("TIME") date += "T%s:%s:00" % (time[:2], time[2:]) if "TDRC" not in self: self.add(TDRC(encoding=0, text=date))
id3.py: modified TDAT/TYER/TIME upgrade algorithm to work with Python 3.
quodlibet_mutagen
train
py
178bbbc31c594f9ded4b8a66b0beecbb16cfa949
diff --git a/test/e2e/hooks_test.go b/test/e2e/hooks_test.go index <HASH>..<HASH> 100644 --- a/test/e2e/hooks_test.go +++ b/test/e2e/hooks_test.go @@ -120,6 +120,7 @@ spec: }).ExpectWorkflowNode(func(status v1alpha1.NodeStatus) bool { return strings.Contains(status.Name, "hook") }, func(t *testing.T, status *v1alpha1.NodeStatus, pod *apiv1.Pod) { + t.Skip("https://github.com/argoproj/argo-workflows/issues/8757") assert.Equal(t, v1alpha1.NodeSucceeded, status.Phase) }) }
fix: Temporarily fix CI build. Fixes #<I>. (#<I>) * fix: Temporarily fix CI build
argoproj_argo
train
go
85f1f7f64a1af4fd82296f1a3354528720a97d3e
diff --git a/examples/official-storybook/image-snapshots/storyshots-image.runner.js b/examples/official-storybook/image-snapshots/storyshots-image.runner.js index <HASH>..<HASH> 100644 --- a/examples/official-storybook/image-snapshots/storyshots-image.runner.js +++ b/examples/official-storybook/image-snapshots/storyshots-image.runner.js @@ -20,10 +20,11 @@ if (!fs.existsSync(pathToStorybookStatic)) { suite: 'Image snapshots', framework: 'react', configPath: path.join(__dirname, '..'), + storyNameRegex: /^((?!tweaks static values with debounce delay|Inlines component inside story).)$/, test: imageSnapshot({ storybookUrl: `file://${pathToStorybookStatic}`, getMatchOptions: () => ({ - failureThreshold: 0.01, // 1% threshold, + failureThreshold: 0.04, // 4% threshold, failureThresholdType: 'percent', }), }),
Image snapshots: raise threshold, skip too flaky stories
storybooks_storybook
train
js
769577650ac2615a234cf20fe239b028532d0e0b
diff --git a/src/field.js b/src/field.js index <HASH>..<HASH> 100644 --- a/src/field.js +++ b/src/field.js @@ -363,7 +363,7 @@ export default class Field { }; } else { fn = (...args) => { - if (args.length === 0 || args[0] instanceof Event) { + if (args.length === 0 || (isCallable(Event) && args[0] instanceof Event)) { args[0] = this.value; } this.validator.validate(`#${this.id}`, args[0]);
make sure event is a ctor closes #<I>
baianat_vee-validate
train
js
73458560787315aa97027f0059be7f1696b379cb
diff --git a/examples/wms/script.js b/examples/wms/script.js index <HASH>..<HASH> 100644 --- a/examples/wms/script.js +++ b/examples/wms/script.js @@ -16,7 +16,7 @@ L.tileLayer.wms('http://geodata.havochvatten.se/geoservices/hav-bakgrundskartor/ format: 'image/png', maxZoom: 14, minZoom: 0, - attribution: '&copy; OpenStreetMap <a href="https://www.havochvatten.se/kunskap-om-vara-vatten/kartor-och-geografisk-information/karttjanster.html">Havs- och vattenmyndigheten (Swedish Agency for Marine and Water Management)</a>' + attribution: '&copy; OpenStreetMap contributors <a href="https://www.havochvatten.se/kunskap-om-vara-vatten/kartor-och-geografisk-information/karttjanster.html">Havs- och vattenmyndigheten (Swedish Agency for Marine and Water Management)</a>' }).addTo(map); map.setView([55.8, 14.3], 3);
change attribution for wms example
kartena_Proj4Leaflet
train
js
7d9396c1cbe9c751e6fab2f1e76c5ff25288fa5a
diff --git a/lib/chartkick/helper.rb b/lib/chartkick/helper.rb index <HASH>..<HASH> 100644 --- a/lib/chartkick/helper.rb +++ b/lib/chartkick/helper.rb @@ -74,7 +74,7 @@ module Chartkick # js vars js_vars = { - type: klass, # don't convert to JSON, but still escape + type: klass.to_json, id: element_id.to_json, data: data_source.respond_to?(:chart_json) ? data_source.chart_json : data_source.to_json, options: options.to_json @@ -82,7 +82,7 @@ module Chartkick js_vars.each_key do |k| js_vars[k] = chartkick_json_escape(js_vars[k]) end - createjs = "new Chartkick.%{type}(%{id}, %{data}, %{options});" % js_vars + createjs = "new Chartkick[%{type}](%{id}, %{data}, %{options});" % js_vars if defer js = <<JS
klass always trusted, but safer pattern
ankane_chartkick
train
rb
e907a5209b57dc3f2b526a4ad4b27b88bb55271a
diff --git a/lib/haibu/drone/drone.js b/lib/haibu/drone/drone.js index <HASH>..<HASH> 100644 --- a/lib/haibu/drone/drone.js +++ b/lib/haibu/drone/drone.js @@ -353,6 +353,7 @@ Drone.prototype._add = function (app, drone, callback) { // drone.monitor.on('restart', function (_, data) { self._update(record, pid, data); + pid = data.pid; }); this._autostartUpdate('add', app, record.drones, callback);
[drone] don't forget to update pid
nodejitsu_haibu
train
js