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
1e39a679a28ac2a447beb29f0af7a8d40bc387d0
diff --git a/lib/ProMotion/screen/screen_module.rb b/lib/ProMotion/screen/screen_module.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/screen/screen_module.rb +++ b/lib/ProMotion/screen/screen_module.rb @@ -58,8 +58,12 @@ module ProMotion def resolve_title if self.class.send(:get_title).kind_of? String self.title = self.class.send(:get_title) - else + elsif self.class.send(:get_title).kind_of? UIView + self.navigationItem.titleView = self.class.send(:get_title) + elsif self.class.send(:get_title).kind_of? UIImage self.navigationItem.titleView = UIImageView.alloc.initWithImage(self.class.send(:get_title)) + else + PM.logger.warn("title expects string, UIView, or UIImage, but #{self.class.send(:get_title).class.to_s} given." end end
Updating PM::Screen `resolve_title` if block to support UIView, and else with warning.
infinitered_ProMotion
train
rb
5a3fabd64596164af96801f4f7e394ba48c1455d
diff --git a/gwpy/astro/tests/test_range.py b/gwpy/astro/tests/test_range.py index <HASH>..<HASH> 100644 --- a/gwpy/astro/tests/test_range.py +++ b/gwpy/astro/tests/test_range.py @@ -122,6 +122,7 @@ def test_range_timeseries(hoft, rangekwargs): 0.5, fftlength=0.25, overlap=0.125, + method="welch", nproc=2, **rangekwargs, ) @@ -145,6 +146,7 @@ def test_range_spectrogram(hoft, rangekwargs, outunit): 0.5, fftlength=0.25, overlap=0.125, + method="welch", nproc=2, **rangekwargs, )
gwpy.astro: hardcode ASD method in tests to silence deprecation warnings
gwpy_gwpy
train
py
41510cc009899a28d7b90d4982a0699013ad7fab
diff --git a/src/Rad/Database/DatabaseAdapter.php b/src/Rad/Database/DatabaseAdapter.php index <HASH>..<HASH> 100644 --- a/src/Rad/Database/DatabaseAdapter.php +++ b/src/Rad/Database/DatabaseAdapter.php @@ -27,12 +27,14 @@ namespace Rad\Database; use PDO; +use PDOStatement; /** * Description of DatabaseAdapter * * @author guillaume */ -class DatabaseAdapter extends PDO { - +abstract class DatabaseAdapter extends PDO { + + public abstract function fetch_assoc(PDOStatement $rid); } diff --git a/src/Rad/Database/PDODatabaseHandler.php b/src/Rad/Database/PDODatabaseHandler.php index <HASH>..<HASH> 100644 --- a/src/Rad/Database/PDODatabaseHandler.php +++ b/src/Rad/Database/PDODatabaseHandler.php @@ -136,4 +136,8 @@ class PDODatabaseHandler extends DatabaseAdapter { return $statment->fetchAll(\PDO::FETCH_ASSOC); } + public function fetch_assoc(PDOStatement $rid) { + return $rid->fetch(\PDO::FETCH_ASSOC); + } + }
Add fetch assoc to Interface def
guillaumemonet_Rad
train
php,php
e8c1473fbbfffa8cfde493c415b3ee3fbfaa5ed2
diff --git a/src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java b/src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java +++ b/src/main/java/org/casbin/jcasbin/main/CoreEnforcer.java @@ -312,6 +312,9 @@ public class CoreEnforcer { } } for (AviatorFunction f : functions.values()) { + if (AviatorEvaluator.containsFunction(f.getName())) { + AviatorEvaluator.removeFunction(f.getName()); + } AviatorEvaluator.addFunction(f); }
Remove Aviator warnings by deleting functions first.
casbin_jcasbin
train
java
37537d64e73c5ab5e78e067f6ef5c122d0001eb0
diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index <HASH>..<HASH> 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -81,7 +81,7 @@ MSGS = { 'Used when a line is longer than a given number of characters.'), 'C0302': ('Too many lines in module (%s/%s)', # was W0302 'too-many-lines', - 'Used when a module has too much lines, reducing its readability.' + 'Used when a module has too many lines, reducing its readability.' ), 'C0303': ('Trailing whitespace', 'trailing-whitespace',
Change 'much' to 'many' for consistency
PyCQA_pylint
train
py
1bf180882654605b9c32001f07e5727d23b6c915
diff --git a/test/integration/sb3-roundtrip.js b/test/integration/sb3-roundtrip.js index <HASH>..<HASH> 100644 --- a/test/integration/sb3-roundtrip.js +++ b/test/integration/sb3-roundtrip.js @@ -95,11 +95,11 @@ test('sb3-roundtrip', t => { }); const serializeAndDeserialize = installThings.then(() => { - // `Clone.simple` here helps in two ways: + // Doing a JSON `stringify` and `parse` here more accurately simulate a save/load cycle. In particular: // 1. it ensures that any non-serializable data is thrown away, and - // 2. `sb3.deserialize` does some `hasOwnProperty` checks which fail on the object returned by `sb3.serialize` - // due to its inheritance structure. - const serializedState = Clone.simple(sb3.serialize(runtime1)); + // 2. `sb3.deserialize` and its helpers do some `hasOwnProperty` checks which fail on the object returned by + // `sb3.serialize` but succeed if that object is "flattened" in this way. + const serializedState = JSON.parse(JSON.stringify(sb3.serialize(runtime1))); return sb3.deserialize(serializedState, runtime2); });
Clarify "flattening" step in SB3 roundtrip test
LLK_scratch-vm
train
js
a55be1b086d4f7e2f76740f069d78e1ca74b2d70
diff --git a/css-components/gulpfile.js b/css-components/gulpfile.js index <HASH>..<HASH> 100644 --- a/css-components/gulpfile.js +++ b/css-components/gulpfile.js @@ -179,7 +179,7 @@ gulp.task('build-css-components', ['build-schemes'], function(done) { // build-css-topdoc //////////////////////////////////////// gulp.task('build-css-topdoc', ['build-css-components'], $.shell.task([ - './node_modules/.bin/topdoc --source ./components-src/dist --destination ./www/testcases --template ./components-src/testcases-topdoc-template' + '"./node_modules/.bin/topdoc" --source "./components-src/dist" --destination "./www/testcases" --template "./components-src/testcases-topdoc-template"' ])); ////////////////////////////////////////
fix(css-gulpfile): shell command for Windows environments
OnsenUI_OnsenUI
train
js
493b2b5392b0388aff32e6f224537ae3d2b6defb
diff --git a/tests/test_conversion.py b/tests/test_conversion.py index <HASH>..<HASH> 100644 --- a/tests/test_conversion.py +++ b/tests/test_conversion.py @@ -39,8 +39,8 @@ class TestConversion: def setup_class(cls): im = pyvips.Image.mask_ideal(100, 100, 0.5, reject=True, optical=True) - cls.colour = im * [1, 2, 3] + [2, 3, 4] - cls.mono = cls.colour[1] + cls.colour = (im * [1, 2, 3] + [2, 3, 4]).copy(interpretation="srgb") + cls.mono = cls.colour[1].copy(interpretation="b-w") cls.all_images = [cls.mono, cls.colour] cls.image = pyvips.Image.jpegload(JPEG_FILE)
fix conversion for <I> the new alpha detection in <I> needs to have interpretation set correctly
libvips_pyvips
train
py
3cd6fd4042211649db4a2e754f31690ed705a2d3
diff --git a/src/LocalizedStrings.js b/src/LocalizedStrings.js index <HASH>..<HASH> 100644 --- a/src/LocalizedStrings.js +++ b/src/LocalizedStrings.js @@ -19,14 +19,11 @@ export default class LocalizedStrings { _getBestMatchingLanguage(language, props) { //If an object with the passed language key exists return it if (props[language]) return language; + //if the string is composed try to find a match with only the first language identifiers (en-US --> en) - var idx = language.indexOf("-"); - if (idx >= 0) { - language = language.substring(0, idx); - if (props[language]) return language; - } - //Return the default language (the first coded) - return Object.keys(props)[0]; + const idx = language.indexOf('-'); + const auxLang = (idx >= 0) ? language.substring(0, idx) : language; + return props[auxLang] ? auxLang : Object.keys(props)[0]; }
Refactor bestMatchingLanguage method
stefalda_react-localization
train
js
d4cef285e34f65de40d4c0bbef0fc5ac39d53c94
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages from codecs import open from os import path -__version__ = '0.1.1' +__version__ = '0.1.2' PROJECT_URL = 'https://gitlab.com/vedvyas/doxytag2zealdb' here = path.abspath(path.dirname(__file__))
Artificial version bump; previous package had junk in it.
vedvyas_doxytag2zealdb
train
py
a9f7658c87abb94f70fac7b6ccafb9ed1542e91a
diff --git a/autograd/core.py b/autograd/core.py index <HASH>..<HASH> 100644 --- a/autograd/core.py +++ b/autograd/core.py @@ -160,6 +160,10 @@ class Node(object): def sum_outgrads(outgrads): return sum(outgrads[1:], outgrads[0]) + def __str__(self): + return "Autograd {0} with value {1} and {2} tape(s)".format( + type(self).__name__, str(self.value), len(self.tapes)) + @primitive def cast(value, caster): return caster(value)
Added a __str__ method to Node for more helpful debugging info.
HIPS_autograd
train
py
106182eabe9cd9189dbaaec00cce2754fa41ea1f
diff --git a/src/Core/Checkout/Document/DocumentService.php b/src/Core/Checkout/Document/DocumentService.php index <HASH>..<HASH> 100644 --- a/src/Core/Checkout/Document/DocumentService.php +++ b/src/Core/Checkout/Document/DocumentService.php @@ -190,6 +190,7 @@ class DocumentService ->addFilter(new EqualsFilter('deepLinkCode', $deepLinkCode)) ->addAssociation('lineItems') ->addAssociation('transactions') + ->addAssociation('addresses') ->addAssociation('deliveries', (new Criteria())->addAssociation('positions')); return $this->orderRepository->search($criteria, $context->createWithVersionId($versionId))->get($orderId); @@ -203,6 +204,7 @@ class DocumentService $criteria = (new Criteria([$orderId])) ->addAssociation('lineItems') ->addAssociation('transactions') + ->addAssociation('addresses') ->addAssociation('deliveries', (new Criteria())->addAssociation('positions')); return $this->orderRepository->search($criteria, $context->createWithVersionId($versionId))->get($orderId);
NEXT-<I> - Fix document recipient addresses
shopware_platform
train
php
14cceab105bb08a072ea0a85e703a8569ec2be19
diff --git a/metpy/calc/indices.py b/metpy/calc/indices.py index <HASH>..<HASH> 100644 --- a/metpy/calc/indices.py +++ b/metpy/calc/indices.py @@ -214,6 +214,7 @@ def bulk_shear(pressure, u, v, heights=None, bottom=None, depth=None): @exporter.export +@check_units('[energy] / [mass]', '[speed] * [speed]', '[speed]') def supercell_composite(mucape, effective_storm_helicity, effective_shear): r"""Calculate the supercell composite parameter. @@ -254,6 +255,7 @@ def supercell_composite(mucape, effective_storm_helicity, effective_shear): @exporter.export +@check_units('[energy] / [mass]', '[length]', '[speed] * [speed]', '[speed]') def significant_tornado(sbcape, sblcl, storm_helicity_1km, shear_6km): r"""Calculate the significant tornado parameter (fixed layer).
Add input unit verification to supercell composite and sigtor
Unidata_MetPy
train
py
1ee496f79ba867712ffbcec27a1fe511a5588d6c
diff --git a/src/core/textures/VideoBaseTexture.js b/src/core/textures/VideoBaseTexture.js index <HASH>..<HASH> 100644 --- a/src/core/textures/VideoBaseTexture.js +++ b/src/core/textures/VideoBaseTexture.js @@ -198,7 +198,7 @@ VideoBaseTexture.fromUrl = function (videoSrc, scaleMode) { for (var i = 0; i < videoSrc.length; ++i) { - video.appendChild(createSource(videoSrc.src || videoSrc, videoSrc.mime)); + video.appendChild(createSource(videoSrc[i].src || videoSrc[i], videoSrc[i].mime)); } } // single object or string
fix iterator for VideoBaseTexture.fromUrls so that it finds the source and mime by index
pixijs_pixi.js
train
js
4163ab90a6d1712b093e3f7935beb5a21424685e
diff --git a/tests/test_shell.py b/tests/test_shell.py index <HASH>..<HASH> 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -55,6 +55,15 @@ def test_ignore_select(parse_options, run): assert errors[0].col +def test_skip(parse_options, run): + options = parse_options() + errors = run('dummy.py', options=options, code=( + "undefined()\n" + "# pylama: skip=1" + )) + assert not errors + + def test_stdin(monkeypatch, parse_args): monkeypatch.setattr('sys.stdin', io.StringIO('unknown_call()\ndef no_doc():\n pass\n\n')) options = parse_args("--from-stdin dummy.py")
tests: add test for modeline skip
klen_pylama
train
py
3594ab222b6d2e2832e6ef90d9e89cb14a5cbc66
diff --git a/bika/lims/exportimport/instruments/varian/vistapro/icp.py b/bika/lims/exportimport/instruments/varian/vistapro/icp.py index <HASH>..<HASH> 100644 --- a/bika/lims/exportimport/instruments/varian/vistapro/icp.py +++ b/bika/lims/exportimport/instruments/varian/vistapro/icp.py @@ -102,12 +102,8 @@ def Import(context, request): parser = None if not hasattr(infile, 'filename'): errors.append(_("No file selected")) - if fileformat == 'csv': - parser = VistaPROICPParser(infile) - else: - errors.append(t(_("Unrecognized file format ${fileformat}", - mapping={"fileformat": fileformat}))) + parser = VistaPROICPParser(infile) if parser: # Load the importer status = ['sample_received', 'attachment_due', 'to_be_verified']
do not use fileformat check as it is redundant
senaite_senaite.core
train
py
fcaf4592397985c07d116bd84aa5b9e888e77953
diff --git a/beehive.go b/beehive.go index <HASH>..<HASH> 100644 --- a/beehive.go +++ b/beehive.go @@ -115,9 +115,10 @@ func main() { switch s { case syscall.SIGHUP: config = loadConfig() - bees.RestartBees(config.Bees) + bees.StopBees() bees.SetActions(config.Actions) bees.SetChains(config.Chains) + bees.StartBees(config.Bees) case syscall.SIGTERM: fallthrough
Also reset actions & chains before restarting Bees on SIGHUP
muesli_beehive
train
go
fb6972e1ad2f65d1bf59cc8c663669adbf15648f
diff --git a/stacktrace.js b/stacktrace.js index <HASH>..<HASH> 100644 --- a/stacktrace.js +++ b/stacktrace.js @@ -346,11 +346,13 @@ printStackTrace.implementation.prototype = { frame = stack[i], ref = reStack.exec(frame); if (ref) { - var m = reRef.exec(ref[1]), file = m[1], - lineno = m[2], charno = m[3] || 0; - if (file && this.isSameDomain(file) && lineno) { - var functionName = this.guessAnonymousFunction(file, lineno, charno); - stack[i] = frame.replace('{anonymous}', functionName); + var m = reRef.exec(ref[1]); + if (m){ + var file = m[1], lineno = m[2], charno = m[3] || 0; + if (file && this.isSameDomain(file) && lineno) { + var functionName = this.guessAnonymousFunction(file, lineno, charno); + stack[i] = frame.replace('{anonymous}', functionName); + } } } }
Catering for evals in some anonymous functions. eg "eval at buildTmplFn (<URL>)"
stacktracejs_stacktrace.js
train
js
84d9c773dabc25525da746528c0070c18b7bc92c
diff --git a/scripts/gulp/lint.js b/scripts/gulp/lint.js index <HASH>..<HASH> 100644 --- a/scripts/gulp/lint.js +++ b/scripts/gulp/lint.js @@ -47,7 +47,7 @@ gulp.task( 'lint:scripts', function() { return _genericJSLint( [ 'src/**/src/*.js' ] ); } ); -gulp.task('lint:less', function() { +gulp.task( 'lint:styles', function() { return gulp .src( ['!src/cf-grid/src-generated/*.less', 'src/**/*.less'] ) @@ -65,5 +65,5 @@ gulp.task( 'lint', [ 'lint:build', 'lint:tests', 'lint:scripts', - 'lint:less' + 'lint:styles' ] );
fix spacing and rename task to lint:styles
cfpb_capital-framework
train
js
b44d67f96f2e6ac7424a347a03e69c007f7d06d8
diff --git a/spec/entrez_scraper_spec.rb b/spec/entrez_scraper_spec.rb index <HASH>..<HASH> 100644 --- a/spec/entrez_scraper_spec.rb +++ b/spec/entrez_scraper_spec.rb @@ -59,6 +59,24 @@ describe EntrezScraper do it_behaves_like 'query analyzer' end + + context "when query param is of unknown type" do + let(:input_query) { 100 } + + it "raises an exception" do + expect{entrez_scraper.search input_query}.to \ + raise_error RuntimeError, /^query must be either/ + end + end + + context "when query param is an array of unknown types" do + let(:input_query) { ["known", 100] } + + it "raises an exception" do + expect{entrez_scraper.search input_query}.to \ + raise_error RuntimeError, /^Array elements must be either/ + end + end end describe "#escape_keyword" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,7 +26,6 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [ ] SimpleCov.start do - add_filter "/spec" add_filter "/lib/support/regexp.rb" # copied from activesupport add_filter "/lib/support/blank.rb" # copied from activesupport end
not excluding /spec from coverage
rayyanqcri_rayyan-scrapers
train
rb,rb
81a00d3cbba07e3c7574570a966c5232cabf0fc7
diff --git a/simuvex/s_state.py b/simuvex/s_state.py index <HASH>..<HASH> 100644 --- a/simuvex/s_state.py +++ b/simuvex/s_state.py @@ -600,8 +600,8 @@ class SimState(ana.Storable): # pylint: disable=R0904 """ var_size = self.arch.bits / 8 - sp_sim = self.regs.sp - bp_sim = self.regs.bp + sp_sim = self.regs._sp + bp_sim = self.regs._bp if self.se.symbolic(sp_sim) and sp is None: result = "SP is SYMBOLIC" elif self.se.symbolic(bp_sim) and depth is None: @@ -623,7 +623,7 @@ class SimState(ana.Storable): # pylint: disable=R0904 stack_values = [ ] if o.ABSTRACT_MEMORY in self.options: - sp = self.regs.sp + sp = self.regs._sp segment_sizes = self.memory.get_segments(sp + i * var_size, var_size) pos = i * var_size
don't trigger events when debugging
angr_angr
train
py
e45806eb104394b522b2e7c430524fc9b3735083
diff --git a/metaseq/results_table.py b/metaseq/results_table.py index <HASH>..<HASH> 100644 --- a/metaseq/results_table.py +++ b/metaseq/results_table.py @@ -318,8 +318,10 @@ class ResultsTable(object): # one-to-one line, if kwargs were specified if one_to_one: - ax.plot([xmin, xmax], - [ymin, ymax], + gmin = max(xmin, ymin) + gmax = min(xmax, ymax) + ax.plot([gmin, gmax], + [gmin, gmax], **one_to_one) # plot any specially-highlighted genes, and label if specified
one-to-one line uses min of maxes, max of mins
daler_metaseq
train
py
fb10c847aa5581f34f807d7d4f9db3062ea1b73c
diff --git a/src/Gush/Command/ConfigureCommand.php b/src/Gush/Command/ConfigureCommand.php index <HASH>..<HASH> 100644 --- a/src/Gush/Command/ConfigureCommand.php +++ b/src/Gush/Command/ConfigureCommand.php @@ -151,6 +151,6 @@ class ConfigureCommand extends BaseCommand $client->authenticate($username, $password, Client::AUTH_HTTP_PASSWORD); - return (bool)count($client->api('authorizations')->all()); + return is_array($client->api('authorizations')->all()); } }
Fixed bug with the github authentication validation
gushphp_gush
train
php
bb9b45fc84c93219f299701d86ec7af0c5f481a4
diff --git a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java index <HASH>..<HASH> 100755 --- a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java +++ b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WFieldSet.java @@ -152,11 +152,9 @@ public class WFieldSet extends AbstractMutableContainer implements AjaxTarget, S } if (component instanceof Container) { - Container container = (Container) component; - int childCount = container.getChildCount(); - for (int i = 0; i < childCount; i++) { - boolean hasValue = hasInputWithValue(container.getChildAt(i)); + for (WComponent child : ((Container) component).getChildren()) { + boolean hasValue = hasInputWithValue(child); if (hasValue) { return true;
Add getChildren() to Container API
BorderTech_wcomponents
train
java
f72ce7c136cf2dfe31a67b190c00e30ba7d70bfa
diff --git a/src/managers/PermissionOverwriteManager.js b/src/managers/PermissionOverwriteManager.js index <HASH>..<HASH> 100644 --- a/src/managers/PermissionOverwriteManager.js +++ b/src/managers/PermissionOverwriteManager.js @@ -13,13 +13,19 @@ const { OverwriteTypes } = require('../util/Constants'); */ class PermissionOverwriteManager extends CachedManager { constructor(channel, iterable) { - super(channel.client, PermissionOverwrites, iterable); + super(channel.client, PermissionOverwrites); /** * The channel of the permission overwrite this manager belongs to * @type {GuildChannel} */ this.channel = channel; + + if (iterable) { + for (const item of iterable) { + this._add(item); + } + } } /** diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index <HASH>..<HASH> 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -90,6 +90,12 @@ class GuildChannel extends Channel { } } + _clone() { + const clone = super._clone(); + clone.permissionOverwrites = new PermissionOverwriteManager(clone, this.permissionOverwrites.cache.values()); + return clone; + } + /** * The category parent of this channel * @type {?CategoryChannel}
fix(GuildChannel): clone its PermissionOverwriteManager too (#<I>)
discordjs_discord.js
train
js,js
ea91ddfa6cf334a1e6b3ceea83cb3bd37c9dda81
diff --git a/labkey/query.py b/labkey/query.py index <HASH>..<HASH> 100644 --- a/labkey/query.py +++ b/labkey/query.py @@ -352,6 +352,9 @@ class QueryFilter: BETWEEN = 'between' NOT_BETWEEN = 'notbetween' + IS_BLANK = 'isblank' + IS_NOT_BLANK = 'isnonblank' + MEMBER_OF = 'memberof' def __init__(self, column, value, filter_type=Types.EQUAL):
Add "isblank" and "isnonblank" query filter types (#<I>)
LabKey_labkey-api-python
train
py
d91eac921e3adca0ade3aff29b9c97f642568925
diff --git a/src/utility/getSelectedOperationName.js b/src/utility/getSelectedOperationName.js index <HASH>..<HASH> 100644 --- a/src/utility/getSelectedOperationName.js +++ b/src/utility/getSelectedOperationName.js @@ -31,7 +31,7 @@ export default function getSelectedOperationName( if (prevSelectedOperationName && prevOperations) { const prevNames = prevOperations.map(op => op.name && op.name.value); const prevIndex = prevNames.indexOf(prevSelectedOperationName); - if (prevIndex && prevIndex < names.length) { + if (prevIndex !== -1 && prevIndex < names.length) { return names[prevIndex]; } }
fix to properly check the index `prevIndex` should be compared to `-1`, not to the falseyness.
graphql_graphiql
train
js
818a34b89f27e98d5a32bef453516ba2740556ef
diff --git a/zarr/storage.py b/zarr/storage.py index <HASH>..<HASH> 100644 --- a/zarr/storage.py +++ b/zarr/storage.py @@ -1583,12 +1583,6 @@ def _dbm_encode_key(key): return key -def _dbm_decode_key(key): - if hasattr(key, 'decode'): - key = key.decode('ascii') - return key - - # noinspection PyShadowingBuiltins class DBMStore(MutableMapping): """Storage class using a DBM-style database. @@ -1758,7 +1752,7 @@ class DBMStore(MutableMapping): ) def keys(self): - return (_dbm_decode_key(k) for k in iter(self.db.keys())) + return (ensure_text(k, "ascii") for k in iter(self.db.keys())) def __iter__(self): return self.keys()
Use `ensure_text` in DBMStore
zarr-developers_zarr
train
py
d25d3fba3e94d3f7708f1ef7ac7fd32a0d9e0f5e
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -215,7 +215,7 @@ module ActionController #:nodoc: # the mime-type can be selected by explicitly setting <tt>request.format</tt> in # the controller. # - # If an acceptable response is not found, the application returns a + # If an acceptable format is not identified, the application returns a # '406 - not acceptable' status. Otherwise, the default response is to render # a template named after the current action and the selected format, # e.g. <tt>index.html.erb</tt>. If no template is available, the behavior
respond_with description: changed 'response' to 'format'
rails_rails
train
rb
2e948772d4ada803a18500526be08c09417a2dc8
diff --git a/lib/compendium/query.rb b/lib/compendium/query.rb index <HASH>..<HASH> 100644 --- a/lib/compendium/query.rb +++ b/lib/compendium/query.rb @@ -55,7 +55,7 @@ module Compendium end def collect_metrics(context) - metrics.each{ |m| m.run(context, results) } + metrics.each{ |m| m.run(context, results) } unless results.empty? end def fetch_results(command)
Fix crash when collecting a metric for an empty result set
dvandersluis_compendium
train
rb
b984217cb703237dcafb10e91f07a77aaac9014d
diff --git a/test/debt.js b/test/debt.js index <HASH>..<HASH> 100644 --- a/test/debt.js +++ b/test/debt.js @@ -18,7 +18,7 @@ bux(__dirname + '/../lib', function (err, obj) { test('Debt', function (t) { t.equal(err, null, 'Errors should be null'); t.type(obj, 'number', 'Results should be a number'); - t.ok(obj > 50, 'Total should be greater than 50'); + t.ok(obj > 80, 'Total should be greater than 80'); t.end(); }); }); \ No newline at end of file
Lower debt limit (no greater than <I> codebux)
thisandagain_fastly
train
js
f3e8681f6c19e17bbcaa4ef9964a82fc76b827f8
diff --git a/build/packaging.rb b/build/packaging.rb index <HASH>..<HASH> 100644 --- a/build/packaging.rb +++ b/build/packaging.rb @@ -30,7 +30,7 @@ task 'package:release' => ['package:gem', 'package:tarball', 'package:sign'] do version = PhusionPassenger::VERSION_STRING tag_prefix = (basename !~ /enterprise/) ? 'release' : 'enterprise' - sh "git tag -s #{tag_prefix}-#{version}" + sh "git tag -s #{tag_prefix}-#{version} -u 0A212A8C" puts "Proceed with pushing tag to Github and uploading the gem and signatures? [y/n]" if STDIN.readline == "y\n"
Ensure that tags are signed with the right key.
phusion_passenger
train
rb
4f07b3f34e2eb29b0eddb3fa533da1e0a1dcb9d9
diff --git a/src/nlpia/loaders.py b/src/nlpia/loaders.py index <HASH>..<HASH> 100644 --- a/src/nlpia/loaders.py +++ b/src/nlpia/loaders.py @@ -73,7 +73,7 @@ from nlpia.constants import DATA_PATH, BIGDATA_PATH from nlpia.constants import DATA_INFO_FILE, BIGDATA_INFO_FILE, BIGDATA_INFO_LATEST from nlpia.constants import INT_MIN, INT_NAN, MAX_LEN_FILEPATH, MIN_DATA_FILE_SIZE from nlpia.constants import HTML_TAGS, EOL -from nlpia.futil import find_filepath, expand_filepath, ensure_open +from nlpia.futil import find_filepath, expand_filepath, ensure_open, read_json _parse = None # placeholder for SpaCy parser + language model
dont forget to import read_json in loaders
totalgood_nlpia
train
py
dd36c24c127cb11d36a17e91c0ef03b51341aee6
diff --git a/nameko/rpc.py b/nameko/rpc.py index <HASH>..<HASH> 100644 --- a/nameko/rpc.py +++ b/nameko/rpc.py @@ -280,7 +280,6 @@ class MethodProxy(HeaderEncoder): reply_queue_name = reply_listener.reply_queue_name reply_event = reply_listener.get_reply_event(correlation_id) - _log.debug('Doing publish %s (%s, %s, %s)' % (self, exchange, routing_key, reply_queue_name)) producer.publish( msg, exchange=exchange,
Associate log messages to instances (where possible)
nameko_nameko
train
py
a0474547dcd6b4c1652b7606ca334a80ff1c91e8
diff --git a/lib/Model.js b/lib/Model.js index <HASH>..<HASH> 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -451,9 +451,8 @@ Model.prototype.populate = function (options, resultObj, fillPath) { if (!fillPath) { fillPath = []; } - const self = this; if (!resultObj) { - resultObj = self; + resultObj = this; } let ModelPathName = ''; @@ -486,16 +485,16 @@ Model.prototype.populate = function (options, resultObj, fillPath) { } return Model - .get(self[options.path || options]) - .then(function(target){ + .get(this[options.path || options]) + .then(target => { if (!target) { throw new Error('Invalid reference'); } - self[options.path || options] = target; + this[options.path || options] = target; fillPath = fillPath.concat(options.path || options); objectPath.set(resultObj, fillPath, target); if (options.populate) { - return self[options.path || options].populate(options.populate, resultObj, fillPath); + return this[options.path || options].populate(options.populate, resultObj, fillPath); } else { return resultObj; }
Removing self = this in favor of arrow functions
dynamoosejs_dynamoose
train
js
51f2e94334e07484c5a3ff27949845d8edcca64d
diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py index <HASH>..<HASH> 100644 --- a/salt/utils/__init__.py +++ b/salt/utils/__init__.py @@ -606,6 +606,7 @@ def backup_minion(path, bkroot): shutil.copyfile(path, bkpath) if not salt.utils.is_windows(): os.chown(bkpath, fstat.st_uid, fstat.st_gid) + os.chmod(bkpath, fstat.st_mode) def path_join(*parts):
Copy perms of destination file when backing up Fixes #<I>
saltstack_salt
train
py
2649d236be94d119b13e0ac607964c94a9e51fde
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages NAME = "vsts-cd-manager" -VERSION = "1.0.1" +VERSION = "1.0.2" # To install the library, run the following # diff --git a/vsts_cd_manager/continuous_delivery_manager.py b/vsts_cd_manager/continuous_delivery_manager.py index <HASH>..<HASH> 100644 --- a/vsts_cd_manager/continuous_delivery_manager.py +++ b/vsts_cd_manager/continuous_delivery_manager.py @@ -157,7 +157,7 @@ class ContinuousDeliveryManager(object): raise RuntimeError('Project URL should be in format https://<accountname>.visualstudio.com/<projectname>') def _get_vsts_account_name(self, cd_project_url): - return (cd_project_url.split('.visualstudio.com', 1)[0]).strip('https://') + return (cd_project_url.split('.visualstudio.com', 1)[0]).split('https://', 1)[1] def get_provisioning_configuration_target(self, auth_info, swap_with_slot, test, webapp_list): swap_with_slot_config = None if swap_with_slot is None else SlotSwapConfiguration(swap_with_slot)
Fixing a bug to fetch correct account name (#<I>) * Fixing a bug to fetch correct account name Replaced .strip() with .split() to fetch correct account name * Updated patch version Updated patch version
Microsoft_vsts-cd-manager
train
py,py
af3158d8cc6b626c0f1ac7772aec9eef968e924c
diff --git a/blog/locallib.php b/blog/locallib.php index <HASH>..<HASH> 100644 --- a/blog/locallib.php +++ b/blog/locallib.php @@ -709,7 +709,7 @@ class blog_listing { if (empty($this->entries)) { if ($sqlarray = $this->get_entry_fetch_sql()) { - $this->entries = $DB->get_records_sql($sqlarray['sql'] . " LIMIT $start, $limit", $sqlarray['params']); + $this->entries = $DB->get_records_sql($sqlarray['sql'], $sqlarray['params'], $start, $limit); } else { return false; }
MDL-<I> fix for pg incompatibility - credit goes to Penny Leach
moodle_moodle
train
php
6e216a8e845fa674e2e406d2b628a2d2ba6261d3
diff --git a/kibitzr/transformer.py b/kibitzr/transformer.py index <HASH>..<HASH> 100644 --- a/kibitzr/transformer.py +++ b/kibitzr/transformer.py @@ -1,3 +1,6 @@ +""" +Built-in transforms +""" import sys import logging import contextlib @@ -8,12 +11,13 @@ from lxml import etree import six from bs4 import BeautifulSoup import sh +from lazy_object_proxy import Proxy as lazy from .storage import PageHistory logger = logging.getLogger(__name__) -jq = sh.jq.bake('--monochrome-output') +jq = lazy(lambda: sh.jq.bake('--monochrome-output')) def pipeline_factory(conf): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,7 @@ setup( 'bs4', 'six', 'lxml', + 'lazy-object-proxy', ], license="MIT license", zip_safe=False,
Fixed jq baking - don't raise CommandNotFound until it's needed
kibitzr_kibitzr
train
py,py
91f257d30be394b8971cc450e38d551752c757e8
diff --git a/lib/ronin/network/smtp/email.rb b/lib/ronin/network/smtp/email.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/network/smtp/email.rb +++ b/lib/ronin/network/smtp/email.rb @@ -80,7 +80,7 @@ module Ronin @from = options[:from] @to = options[:to] @subject = options[:subject] - @date = options[:date] || Time.now + @date = options.fetch(:date,Time.now) @message_id = options[:message_id] @body = [] @@ -106,22 +106,22 @@ module Ronin def to_s address = lambda { |info| if info.kind_of?(Array) - return "#{info[0]} <#{info[1]}>" + "#{info[0]} <#{info[1]}>" elsif info.kind_of?(Hash) - return "#{info[:name]} <#{info[:email]}>" + "#{info[:name]} <#{info[:email]}>" else - return info + info end } message = [] if @from - message << "From: #{address.call(@from)}" + message << "From: #{address[@from]}" end if @to - message << "To: #{address.call(@to)}" + message << "To: #{address[@to]}" end if @subject
Updated Network::SMTP::Email.
ronin-ruby_ronin-support
train
rb
f1fd394a03d6e524180091dc87e7356c502ee083
diff --git a/lang_utils.js b/lang_utils.js index <HASH>..<HASH> 100644 --- a/lang_utils.js +++ b/lang_utils.js @@ -28,12 +28,11 @@ export function getLangText(s, ...args) { return formatText(languages['en-US'][s], args); } } catch(err) { - if(!(s in languages[lang])) { - console.warn('Language-string is not in constants file. Add: "' + s + '" to the "' + lang + '" language file. Defaulting to keyname'); - return s; - } else { - console.error(err); - } - + //if(!(s in languages[lang])) { + console.warn('Language-string is not in constants file. Add: "' + s + '" to the "' + lang + '" language file. Defaulting to keyname'); + return s; + //} else { + // console.error(err); + //} } }
Merge remote-tracking branch 'remotes/origin/master' into AD-<I>-decouple-piece-registration-from- Conflicts: bitcoin/models.py web/settings_env/live.py
bigchaindb_js-utility-belt
train
js
f9f80a2c12e85dda491c70e5dc8caa751680312a
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/MetricOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/MetricOptions.java index <HASH>..<HASH> 100644 --- a/flink-core/src/main/java/org/apache/flink/configuration/MetricOptions.java +++ b/flink-core/src/main/java/org/apache/flink/configuration/MetricOptions.java @@ -19,7 +19,6 @@ package org.apache.flink.configuration; import org.apache.flink.annotation.PublicEvolving; -import org.apache.flink.configuration.description.Description; import static org.apache.flink.configuration.ConfigOptions.key;
[hotfix] Remove unused imports from MetricOptions
apache_flink
train
java
88bd17809592bffb09088f49f425d5dc69ae001f
diff --git a/packages/core/renderers/renderer-hyperhtml.js b/packages/core/renderers/renderer-hyperhtml.js index <HASH>..<HASH> 100644 --- a/packages/core/renderers/renderer-hyperhtml.js +++ b/packages/core/renderers/renderer-hyperhtml.js @@ -1,6 +1,7 @@ // HyperHTML Renderer ported to SkateJS import { withComponent, + withUpdate, shadow, props, } from 'skatejs'; @@ -10,7 +11,7 @@ import { findParentTag } from '../utils/find-parent-tag'; export function BoltComponent(Base = HTMLElement) { - return class extends withComponent(Base) { + return class extends withUpdate(withComponent(Base)) { static props = { onClick: props.string,
feat: add withUpdate lifecycle mixin from SkateJS to base Bolt component class
bolt-design-system_bolt
train
js
9d70f5856c11245fa472a1b9765a49e259fa55a5
diff --git a/lib/twitter/user.rb b/lib/twitter/user.rb index <HASH>..<HASH> 100644 --- a/lib/twitter/user.rb +++ b/lib/twitter/user.rb @@ -21,7 +21,6 @@ module Twitter :profile_sidebar_border_color, :profile_sidebar_fill_color, :profile_text_color, :time_zone alias_method :favorites_count, :favourites_count - remove_method :favourites_count alias_method :tweets_count, :statuses_count object_attr_reader :Tweet, :status, :user alias_method :tweet, :status
You win this round, Brittain :uk:
sferik_twitter
train
rb
26b1b3cfc192587ad3cba56061742e51cdf094a5
diff --git a/pkg/fqdn/matchpattern/matchpattern.go b/pkg/fqdn/matchpattern/matchpattern.go index <HASH>..<HASH> 100644 --- a/pkg/fqdn/matchpattern/matchpattern.go +++ b/pkg/fqdn/matchpattern/matchpattern.go @@ -32,7 +32,7 @@ func Validate(pattern string) (matcher *regexp.Regexp, err error) { // error check if strings.ContainsAny(pattern, "[]+{},") { - return nil, errors.New(`Only alphanumeric ASCII characters, the hyphen "-", "." and "*" are allowed in a matchPattern`) + return nil, errors.New(`Only alphanumeric ASCII characters, the hyphen "-", underscore "_", "." and "*" are allowed in a matchPattern`) } return regexp.Compile(ToRegexp(pattern))
fqdn: Update validation error to allow _ We began allowing `_` within the matchpattern fields in f<I>f<I>ac<I>fce<I>e<I>a0d4dc4b but the error message was not updated to explain that `_` is allowed. fixes f<I>f<I>ac<I>fce<I>e<I>a0d4dc4b
cilium_cilium
train
go
3ca8debbe110cd567318cca69a093e1e9ff1908f
diff --git a/src/ContentDelivery/Catalog/ProductRelations/RelationType/SameSeriesProductRelations.php b/src/ContentDelivery/Catalog/ProductRelations/RelationType/SameSeriesProductRelations.php index <HASH>..<HASH> 100644 --- a/src/ContentDelivery/Catalog/ProductRelations/RelationType/SameSeriesProductRelations.php +++ b/src/ContentDelivery/Catalog/ProductRelations/RelationType/SameSeriesProductRelations.php @@ -152,7 +152,7 @@ class SameSeriesProductRelations implements ProductRelations { return SortOrderConfig::create( AttributeCode::fromString('created_at'), - SortOrderDirection::create(SortOrderDirection::ASC) + SortOrderDirection::create(SortOrderDirection::DESC) ); } }
Issue #<I>: Change sort order of related models to DESC
lizards-and-pumpkins_catalog
train
php
04a2216c2d03dc27ee8f1ce29ff0249f431684de
diff --git a/demo/demo/settings.py b/demo/demo/settings.py index <HASH>..<HASH> 100644 --- a/demo/demo/settings.py +++ b/demo/demo/settings.py @@ -197,6 +197,12 @@ GEOIP_PATH = '/usr/share/GeoIP/' ############################################################ +from django import VERSION + + +if VERSION[:2] < (1, 6): + TEST_RUNNER = 'discover_runner.DiscoverRunner' + try: from local_settings import *
test runner for django versions < <I>
LPgenerator_django-db-mailer
train
py
240a6031a540bdcfa3aff3023a798b267e9c3315
diff --git a/spec/integration/aws_tagged_items_spec.rb b/spec/integration/aws_tagged_items_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/aws_tagged_items_spec.rb +++ b/spec/integration/aws_tagged_items_spec.rb @@ -137,7 +137,7 @@ describe "AWS Tagged Items" do expect_recipe { load_balancer 'lbtest' do load_balancer_options :aws_tags => { :marco => 'polo', 'happyhappy' => 'joyjoy' }, - :availability_zones => ["#{driver.aws_config.region}a", "#{driver.aws_config.region}b"] # TODO should enchance to accept letter AZs + :availability_zones => ["#{driver.aws_config.region}a", "#{driver.aws_config.region}c"] end }.to create_an_aws_load_balancer('lbtest' ).and have_aws_load_balancer_tags('lbtest',
Fix a spec that tried to use now-decommissioned AZ us-east-1b.
chef_chef-provisioning-aws
train
rb
134c04744e77d8d1654b6c581a934183c8ac3efc
diff --git a/client/allocrunner/alloc_runner.go b/client/allocrunner/alloc_runner.go index <HASH>..<HASH> 100644 --- a/client/allocrunner/alloc_runner.go +++ b/client/allocrunner/alloc_runner.go @@ -213,8 +213,8 @@ func (ar *allocRunner) Run() { goto POST } - // Run the runners and block until they exit - <-ar.runTasks() + // Run the runners (blocks until they exit) + ar.runTasks() POST: // Run the postrun hooks @@ -249,23 +249,15 @@ func (ar *allocRunner) shouldRun() bool { return true } -// runTasks is used to run the task runners. -func (ar *allocRunner) runTasks() <-chan struct{} { +// runTasks is used to run the task runners and block until they exit. +func (ar *allocRunner) runTasks() { for _, task := range ar.tasks { go task.Run() } - // Return a combined WaitCh that is closed when all task runners have - // exited. - waitCh := make(chan struct{}) - go func() { - defer close(waitCh) - for _, task := range ar.tasks { - <-task.WaitCh() - } - }() - - return waitCh + for _, task := range ar.tasks { + <-task.WaitCh() + } } // Alloc returns the current allocation being run by this runner as sent by the
client/ar: remove useless wait ch from runTasks Arguably this makes task.WaitCh() useless, but I think exposing a wait chan from TaskRunners is a generically useful API.
hashicorp_nomad
train
go
3aea09f99e1c486e1aa6e47e27701f18b7d9f50d
diff --git a/connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaXmlDeploymentProcessor.java b/connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaXmlDeploymentProcessor.java index <HASH>..<HASH> 100644 --- a/connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaXmlDeploymentProcessor.java +++ b/connector/src/main/java/org/jboss/as/connector/deployers/ra/processors/RaXmlDeploymentProcessor.java @@ -58,8 +58,6 @@ import org.jboss.msc.service.ServiceTarget; */ public class RaXmlDeploymentProcessor implements DeploymentUnitProcessor { - private ConnectorXmlDescriptor connectorXmlDescriptor; - public RaXmlDeploymentProcessor() { } @@ -78,7 +76,7 @@ public class RaXmlDeploymentProcessor implements DeploymentUnitProcessor { final Resource deploymentResource = phaseContext.getDeploymentUnit().getAttachment(DeploymentModelUtils.DEPLOYMENT_RESOURCE); - connectorXmlDescriptor = deploymentUnit + final ConnectorXmlDescriptor connectorXmlDescriptor = deploymentUnit .getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY); if (connectorXmlDescriptor == null) { return; // Skip non ra deployments
Fix RaXmlDeploymentProcessor
wildfly_wildfly
train
java
7cdb8ce3a7e9aa85d393b881563b0cf9ef1a24f3
diff --git a/prow/external-plugins/cherrypicker/server.go b/prow/external-plugins/cherrypicker/server.go index <HASH>..<HASH> 100644 --- a/prow/external-plugins/cherrypicker/server.go +++ b/prow/external-plugins/cherrypicker/server.go @@ -38,7 +38,7 @@ import ( const pluginName = "cherrypick" -var cherryPickRe = regexp.MustCompile(`(?m)^/cherrypick\s+(.+)$`) +var cherryPickRe = regexp.MustCompile(`(?m)^(?:/cherrypick|/cherry-pick)\s+(.+)$`) var releaseNoteRe = regexp.MustCompile(`(?s)(?:Release note\*\*:\s*(?:<!--[^<>]*-->\s*)?` + "```(?:release-note)?|```release-note)(.+?)```") type githubClient interface { @@ -65,7 +65,7 @@ func HelpProvider(enabledRepos []string) (*pluginhelp.PluginHelp, error) { Featured: true, // depends on how the cherrypick server runs; needs auth by default (--allow-all=false) WhoCanUse: "Members of the trusted organization for the repo.", - Examples: []string{"/cherrypick release-3.9"}, + Examples: []string{"/cherrypick release-3.9", "/cherry-pick release-1.15"}, }) return pluginHelp, nil }
cherrypicker: allow cherry-pick in command
kubernetes_test-infra
train
go
34b268f36a0714075708a82f48757338ffa992a1
diff --git a/src/tooltip.js b/src/tooltip.js index <HASH>..<HASH> 100644 --- a/src/tooltip.js +++ b/src/tooltip.js @@ -9,6 +9,7 @@ vizwhiz.tooltip.create = function(params) { .attr("id","tooltip") .style("position","absolute") .style("overflow","visible") + .style("z-index",10000) if (params.width) params.parent.attr("width",params.width+"px") else params.parent.attr("width","200px")
added z-index to tooltip sag
alexandersimoes_d3plus
train
js
e69fc08bb38b8bb5187633945a9539cbf2a37fab
diff --git a/lib/WebSocket.js b/lib/WebSocket.js index <HASH>..<HASH> 100644 --- a/lib/WebSocket.js +++ b/lib/WebSocket.js @@ -86,7 +86,6 @@ function WebSocket(address, options) { socket.on('data', function (data) { receiver.add(data); }); - if (upgradeHead) receiver.add(upgradeHead); receiver.on('text', function (data, flags) { flags = flags || {}; self.emit('data', data, flags); @@ -100,6 +99,8 @@ function WebSocket(address, options) { self._sender = new Sender(socket); self._state = 'connected'; self.emit('connected'); + + if (upgradeHead) receiver.add(upgradeHead); }); var realEmit = this.emit; this.emit = function(event) {
*proper* upgradeHead fix ... thanks guille
websockets_ws
train
js
004a9f967373a883d7473fbbe2a24b6de3096685
diff --git a/iarm/arm_instructions/_meta.py b/iarm/arm_instructions/_meta.py index <HASH>..<HASH> 100644 --- a/iarm/arm_instructions/_meta.py +++ b/iarm/arm_instructions/_meta.py @@ -8,8 +8,8 @@ class _Meta(iarm.cpu.RegisterCpu): """ Give helper functions to the instructions """ - REGISTER_REGEX = r'R(\d+)' - IMMEDIATE_REGEX = r'#(0[xX][0-9a-zA-Z]+|2_\d+|\d+)' + REGISTER_REGEX = r'^R(\d+)$' + IMMEDIATE_REGEX = r'^#(0[xX][0-9a-zA-Z]+|2_\d+|\d+)$' ONE_PARAMETER = r'\s*([^\s,]*)(,\s*[^\s,]*)*\s*' TWO_PARAMETER_COMMA_SEPARATED = r'\s*([^\s,]*),\s*([^\s,]*)(,\s*[^\s,]*)*\s*' THREE_PARAMETER_COMMA_SEPARATED = r'\s*([^\s,]*),\s*([^\s,]*),\s*([^\s,]*)(,\s*[^\s,]*)*\s*'
Regex would find any register or imediate in a string. Now it must be alone It was passing `[R0]` as a register, but it should have failed
DeepHorizons_iarm
train
py
51c81edb5be16689ef5ddd3104780b1bd09ffef7
diff --git a/tests/spec/shell/touch.spec.js b/tests/spec/shell/touch.spec.js index <HASH>..<HASH> 100644 --- a/tests/spec/shell/touch.spec.js +++ b/tests/spec/shell/touch.spec.js @@ -41,6 +41,7 @@ describe('FileSystemShell.touch', function() { fs.stat('/newfile', function(error, stats) { expect(error).to.exist; + expect(stats).not.to.exist; done(); }); });
Fix lint issues in touch.spec.js
filerjs_filer
train
js
5c61cbeb0d285abdbc83a789a8219c7a5f325d3e
diff --git a/src/Core/Content/Product/Aggregate/ProductManufacturer/ProductManufacturerDefinition.php b/src/Core/Content/Product/Aggregate/ProductManufacturer/ProductManufacturerDefinition.php index <HASH>..<HASH> 100644 --- a/src/Core/Content/Product/Aggregate/ProductManufacturer/ProductManufacturerDefinition.php +++ b/src/Core/Content/Product/Aggregate/ProductManufacturer/ProductManufacturerDefinition.php @@ -56,7 +56,7 @@ class ProductManufacturerDefinition extends EntityDefinition new TranslatedField('metaDescription'), new TranslatedField('metaKeywords'), new TranslatedField('attributes'), - new ManyToOneAssociationField('media', 'media_id', MediaDefinition::class, false), + new ManyToOneAssociationField('media', 'media_id', MediaDefinition::class, true), (new OneToManyAssociationField('products', ProductDefinition::class, 'product_manufacturer_id', false, 'id'))->addFlags(new RestrictDelete(), new ReverseInherited('manufacturer')), (new TranslationsAssociationField(ProductManufacturerTranslationDefinition::class, 'product_manufacturer_id'))->addFlags(new Required()), ]);
NEXT-<I> - Load product manufacturer image by default
shopware_platform
train
php
cb78646acb6bd906f86fb7bc44dac7ec120a0c55
diff --git a/pyipmi/__init__.py b/pyipmi/__init__.py index <HASH>..<HASH> 100644 --- a/pyipmi/__init__.py +++ b/pyipmi/__init__.py @@ -28,7 +28,7 @@ import sdr import sel import sensor -from pyipmi.errors import TimeoutError +from pyipmi.errors import TimeoutError, CompletionCodeError try: from version import __version__ @@ -164,7 +164,19 @@ class Ipmi(bmc.Bmc, chassis.Chassis, fru.Fru, picmg.Picmg, hpm.Hpm, def send_message(self, msg): msg.target = self.target msg.requester = self.requester - return self.interface.send_and_receive(msg) + + retry = 3 + while True: + retry -= 1 + try: + ret = self.interface.send_and_receive(msg) + break + except CompletionCodeError, e: + if e.cc == msgs.constants.CC_NODE_BUSY: + retry -= 1 + continue + + return ret def raw_command(self, lun, netfn, raw_bytes): return self.interface.send_and_receive_raw(self.target, lun, netfn,
Add retry mechanism in case of device is busy.
kontron_python-ipmi
train
py
27b75cf13d3df2a95e6dfbbe5cf250a84e4a9b63
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,7 @@ import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('..')) #Jes: modules are up one level # -- General configuration ------------------------------------------------
make conf path point up one level
jesford_cluster-lensing
train
py
12aae78291407f207c3128becd2bae8e35959a47
diff --git a/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/WorkspaceResourcesImpl.java @@ -63,7 +63,7 @@ public class WorkspaceResourcesImpl extends AbstractResources implements Workspa */ public WorkspaceResourcesImpl(SmartsheetImpl smartsheet) { super(smartsheet); - this.shares = new ShareResourcesImpl(smartsheet, "workspace"); + this.shares = new ShareResourcesImpl(smartsheet, "workspaces"); this.folders = new WorkspaceFolderResourcesImpl(smartsheet); }
Updated workspaces constructor to reflect "workspaces" instead of "workspace".
smartsheet-platform_smartsheet-java-sdk
train
java
515fa55274f88be553ec6c9770a07d0d0e88a0bb
diff --git a/provision/provision.go b/provision/provision.go index <HASH>..<HASH> 100644 --- a/provision/provision.go +++ b/provision/provision.go @@ -149,6 +149,9 @@ type Provisioner interface { // removed. RemoveUnit(Unit) error + // SetUnitStatus changes the status of a unit. + SetUnitStatus(Unit, Status) error + // ExecuteCommand runs a command in all units of the app. ExecuteCommand(stdout, stderr io.Writer, app App, cmd string, args ...string) error
provision: add method SetUnitStatus, to redefine the status of a unit We will use this method in a handler to set the status of a unit. This handler will be called from a circus plugin. The plugin will always send the status, like a heart beat. Then we will be able to implement some logic based on this behaviour. For example: if circus calls the API every one minute, we can check units that the last call is from 3 minutes and set them automatically to error. Related to #<I>.
tsuru_tsuru
train
go
7bc636fd3ae617f79bc7024060e1db9db1b3a38e
diff --git a/highlight.go b/highlight.go index <HASH>..<HASH> 100644 --- a/highlight.go +++ b/highlight.go @@ -216,20 +216,14 @@ func NewScanner(src []byte) *Scanner { if isQuot(r) { s.kind = STRING - for j := 1; j < len(data); { - i := bytes.IndexRune(data[j:], r) - if i >= 0 { - i += j - if i > 0 && data[i-1] == '\\' { - j += i - continue - } - return i + 1, data[0 : i+1], nil - } - if atEOF { + for j := 1; j < len(data); j++ { + if data[j] == '\\' { + j++ + } else if data[j] == byte(r) { + return j + 1, data[0 : j+1], nil + } else if atEOF { return len(data), data, nil } - return 0, nil, nil } return 0, nil, nil }
fix scanner for strings - was incorrect when there is something like '\\'
sourcegraph_syntaxhighlight
train
go
55bccf271419e70ab23f812ab815f63f08d293de
diff --git a/lib/blockscore/util.rb b/lib/blockscore/util.rb index <HASH>..<HASH> 100644 --- a/lib/blockscore/util.rb +++ b/lib/blockscore/util.rb @@ -34,7 +34,7 @@ module BlockScore end def to_plural(str) - PLURAL_LOOKUP[str] + PLURAL_LOOKUP.fetch(str) end # Taken from activesupport: http://git.io/vkWtR
Strengthen expectation of plural equivalent Every singular object type MUST have a plural equivalent
BlockScore_blockscore-ruby
train
rb
d8d86b0efd62a4f5343a2482db22a0c752daa956
diff --git a/src/CfCommunity/CfHelper/Services/ServiceManager.php b/src/CfCommunity/CfHelper/Services/ServiceManager.php index <HASH>..<HASH> 100644 --- a/src/CfCommunity/CfHelper/Services/ServiceManager.php +++ b/src/CfCommunity/CfHelper/Services/ServiceManager.php @@ -57,4 +57,12 @@ class ServiceManager { return $this->populator->getService($name); } + + /** + * @return Service[] + */ + public function getAllServices() + { + return $this->populator->getAllServices(); + } } \ No newline at end of file
add method to get all services in populator
cloudfoundry-community_cf-helper-php
train
php
3c4f18852721a0212dc36d7c066e6ed52dea74c5
diff --git a/carrot/messaging.py b/carrot/messaging.py index <HASH>..<HASH> 100644 --- a/carrot/messaging.py +++ b/carrot/messaging.py @@ -708,7 +708,7 @@ class Publisher(object): def send(self, message_data, routing_key=None, delivery_mode=None, mandatory=False, immediate=False, priority=0, content_type=None, - content_encoding=None, serializer=None): + content_encoding=None, serializer=None, exchange=None): """Send a message. :param message_data: The message data to send. Can be a list, @@ -746,6 +746,9 @@ class Publisher(object): :keyword serializer: Override the default :attr:`serializer`. + :keyword exchange: Override the exchange to publish to. + Note that this exchange must have been declared. + """ headers = None routing_key = routing_key or self.routing_key @@ -753,6 +756,7 @@ class Publisher(object): if self.exchange_type == "headers": headers, routing_key = routing_key, "" + exchange = exchange or self.exchange message = self.create_message(message_data, priority=priority, delivery_mode=delivery_mode, @@ -760,7 +764,7 @@ class Publisher(object): content_encoding=content_encoding, serializer=serializer) self.backend.publish(message, - exchange=self.exchange, routing_key=routing_key, + exchange=exchange, routing_key=routing_key, mandatory=mandatory, immediate=immediate, headers=headers)
Can now pass exchange argument to Publisher.send, to override the default exchange. (But note that this exchange must have been declared)
ask_carrot
train
py
3412d4a1e7c1b696444119528ea2a0466b180ce9
diff --git a/activerecord/test/cases/locking_test.rb b/activerecord/test/cases/locking_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/locking_test.rb +++ b/activerecord/test/cases/locking_test.rb @@ -335,6 +335,8 @@ class OptimisticLockingWithSchemaChangeTest < ActiveRecord::TestCase assert_raises(ActiveRecord::RecordNotFound) { LegacyThing.find(t.id) } ensure remove_counter_column_from(Person, 'legacy_things_count') + LegacyThing.connection.remove_column LegacyThing.table_name, 'person_id' + LegacyThing.reset_column_information end private
Reset schema properly after schema changing test
rails_rails
train
rb
a928ea2eb4ab177029a844c9502b636a28257ca3
diff --git a/vsphere/internal/helper/envbrowse/environment_browser_helper.go b/vsphere/internal/helper/envbrowse/environment_browser_helper.go index <HASH>..<HASH> 100644 --- a/vsphere/internal/helper/envbrowse/environment_browser_helper.go +++ b/vsphere/internal/helper/envbrowse/environment_browser_helper.go @@ -89,7 +89,7 @@ func (b *EnvironmentBrowser) OSFamily(ctx context.Context, guest string) (string } for _, osd := range res.Returnval.GuestOSDescriptor { if osd.Id == guest { - family := res.Returnval.GuestOSDescriptor[0].Family + family := osd.Family log.Printf("[DEBUG] OSFamily: family for %q is %q", guest, family) return family, nil }
envbrowse: Correctly return family of guest OS descriptor being checked
terraform-providers_terraform-provider-vsphere
train
go
84ebe0e3d1d0323f463bc243c8f986a5b3073fe9
diff --git a/src/Zicht/Bundle/MenuBundle/Menu/Builder.php b/src/Zicht/Bundle/MenuBundle/Menu/Builder.php index <HASH>..<HASH> 100644 --- a/src/Zicht/Bundle/MenuBundle/Menu/Builder.php +++ b/src/Zicht/Bundle/MenuBundle/Menu/Builder.php @@ -162,7 +162,7 @@ class Builder implements ContainerAwareInterface $attributes['class'] = $name; } - if (null === $item['path']) { + if (empty($item['path'])) { $uri = null; } elseif (preg_match('!^(?:https?://|mailto:)!', $item['path'])) { $uri = $item['path'];
[DON-<I>] URI should be null when there is no path
zicht_menu-bundle
train
php
b210d3c6f571ef5822363ff9e9d8f615204bfd86
diff --git a/src/components/dropdown/Dropdown.js b/src/components/dropdown/Dropdown.js index <HASH>..<HASH> 100644 --- a/src/components/dropdown/Dropdown.js +++ b/src/components/dropdown/Dropdown.js @@ -637,11 +637,12 @@ export class Dropdown extends Component { } onOverlayEntered(callback) { + callback && callback(); + this.bindDocumentClickListener(); this.bindScrollListener(); this.bindResizeListener(); - callback && callback(); this.props.onShow && this.props.onShow(); }
Fixed #<I> - Dropdown auto close in mobile when keyboard is open
primefaces_primereact
train
js
5bdf770fcf9d72b61f74692d133bfb8066bdec48
diff --git a/orator/commands/command.py b/orator/commands/command.py index <HASH>..<HASH> 100644 --- a/orator/commands/command.py +++ b/orator/commands/command.py @@ -50,6 +50,26 @@ class Command(BaseCommand): return super(Command, self).call_silent(name, options) + def confirm(self, question, default=False, true_answer_regex='(?i)^y'): + """ + Confirm a question with the user. + + :param question: The question to ask + :type question: str + + :param default: The default value + :type default: bool + + :param true_answer_regex: A regex to match the "yes" answer + :type true_answer_regex: str + + :rtype: bool + """ + if not self.input.is_interactive(): + return True + + return super(Command, self).confirm(question, default=False, true_answer_regex='(?i)^y') + def _get_migration_path(self): return os.path.join(os.getcwd(), 'migrations')
Fixes --no-interaction option not working properly.
sdispater_orator
train
py
372973e18f4ea4ae14c73f6303369b9f7bb61e56
diff --git a/src/lib/Menu/UserMenuBuilder.php b/src/lib/Menu/UserMenuBuilder.php index <HASH>..<HASH> 100644 --- a/src/lib/Menu/UserMenuBuilder.php +++ b/src/lib/Menu/UserMenuBuilder.php @@ -76,10 +76,6 @@ class UserMenuBuilder extends AbstractBuilder implements TranslationContainerInt $token = $this->tokenStorage->getToken(); if (null !== $token && is_object($token->getUser())) { $menu->addChild( - $this->createMenuItem(self::ITEM_CHANGE_PASSWORD, ['route' => 'ezplatform.user_profile.change_password']) - ); - - $menu->addChild( $this->createMenuItem(self::ITEM_USER_SETTINGS, ['route' => 'ezplatform.user_settings.list']) );
EZP-<I>: Hidden 'change password' menu item if user has no access (#<I>)
ezsystems_ezplatform-admin-ui
train
php
2b855b231c4a4c6c0eb136919dae0f5c55798d7e
diff --git a/snippets/video/video.js b/snippets/video/video.js index <HASH>..<HASH> 100644 --- a/snippets/video/video.js +++ b/snippets/video/video.js @@ -7,7 +7,7 @@ tabris.load(function() { tabris.create("Video", { layoutData: {left: 0, right: 0, top: 0, bottom: 0}, - url: "http://mirrorblender.top-ix.org/movies/sintel-1024-surround.mp4" + url: "http://peach.themazzone.com/durian/movies/sintel-1280-stereo.mp4" }).appendTo(page); page.open();
Replace broken video URL in snippet Has been fixed in video *example* in commit <I>cb<I>, however we also have a video *snippet* that remained unchanged. Change-Id: Id0b<I>fd<I>afb<I>a9bb1e<I>e0b0a<I>f2
eclipsesource_tabris-js
train
js
c451270f0dbe77017d2e316f4bf4f78cc90828f3
diff --git a/lib/vips/image.rb b/lib/vips/image.rb index <HASH>..<HASH> 100644 --- a/lib/vips/image.rb +++ b/lib/vips/image.rb @@ -39,7 +39,9 @@ module Vips if Vips::at_least_libvips?(8, 6) attach_function :vips_addalpha, [:pointer, :pointer, :varargs], :int end - attach_function :vips_image_hasalpha, [:pointer], :int + if Vips::at_least_libvips?(8, 5) + attach_function :vips_image_hasalpha, [:pointer], :int + end attach_function :vips_image_set, [:pointer, :string, GObject::GValue.ptr], :void @@ -702,11 +704,13 @@ module Vips [width, height] end - # Detect if image has an alpha channel - # - # @return [Boolean] true if image has an alpha channel. - def has_alpha? - return Vips::vips_image_hasalpha(self) != 0 + if Vips::at_least_libvips?(8, 5) + # Detect if image has an alpha channel + # + # @return [Boolean] true if image has an alpha channel. + def has_alpha? + return Vips::vips_image_hasalpha(self) != 0 + end end # vips_addalpha was added in libvips 8.6
Fix NotFountError when using libvips older than <I>
libvips_ruby-vips
train
rb
54025e8e6b8afd53fe2ce8b26f63594c6f120f8b
diff --git a/test/preposttasks/pre-sample.js b/test/preposttasks/pre-sample.js index <HASH>..<HASH> 100644 --- a/test/preposttasks/pre-sample.js +++ b/test/preposttasks/pre-sample.js @@ -2,12 +2,12 @@ module.exports = { run(context) { console.log('In pretask!!!'); return context.runWithDriver((driver) => { - driver.get('https://www.sitespeed.io') + return driver.get('https://www.sitespeed.io') .then(() => { - return driver.getCurrentUrl(); + return driver.getTitle(); }) - .then((url) => { - console.log('Loaded url: ' + url); + .then((title) => { + console.log('Loaded page with title: ' + title); }); }); }
Make sure to return promise created by pretask. Also update exemple to fetch page title instead of url.
sitespeedio_browsertime
train
js
2a1de6371680e3500e33ffb5094893bb224a569a
diff --git a/app/controllers/no_cms/pages/pages_controller.rb b/app/controllers/no_cms/pages/pages_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/no_cms/pages/pages_controller.rb +++ b/app/controllers/no_cms/pages/pages_controller.rb @@ -5,7 +5,7 @@ module NoCms::Pages def show @page = Page.no_drafts.where(path: "/#{params[:path]}").first raise ActionController::RoutingError.new('Not Found') if @page.nil? - @blocks = @page.blocks.no_drafts + @blocks = @page.blocks.roots.no_drafts render @page.template unless @page.template.blank? end end diff --git a/app/models/no_cms/pages/block.rb b/app/models/no_cms/pages/block.rb index <HASH>..<HASH> 100644 --- a/app/models/no_cms/pages/block.rb +++ b/app/models/no_cms/pages/block.rb @@ -5,7 +5,7 @@ module NoCms::Pages scope :drafts, ->() { where_with_locale(draft: true) } scope :no_drafts, ->() { where_with_locale(draft: false) } - + scope :roots, ->() { where parent_id: nil } belongs_to :page belongs_to :parent, class_name: "NoCms::Pages::Block"
Now that we have 'roots' blocks, we need a way to scope them so we don't show every block in pages#show
simplelogica_nocms-pages
train
rb,rb
e591cebda14db01d40010cabada696a8e5337705
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ EventEmitter.prototype.on = function (evt, fn) { return this; } + // we emit first, because if evt is "newListener" it would go recursive this.emit('newListener', evt, fn); var allHandlers = this._events; @@ -24,10 +25,10 @@ EventEmitter.prototype.on = function (evt, fn) { if (evtHandlers === undefined) { // first event handler for this event type allHandlers[evt] = [fn]; - return this; + } else { + evtHandlers.push(fn); } - evtHandlers.push(fn); return this; }; @@ -55,10 +56,12 @@ EventEmitter.prototype.removeListener = function (evt, handler) { var index = handlers.indexOf(handler); if (index !== -1) { handlers.splice(index, 1); - this.emit('removeListener', evt, handler); + if (handlers.length === 0) { delete this._events[evt]; } + + this.emit('removeListener', evt, handler); } } return this;
Only emit removeListener after all mutations are done
Wizcorp_events
train
js
a8ec9aa9243af8576bf7b3cd1a6e64cebf87e7fd
diff --git a/citrination_client/client.py b/citrination_client/client.py index <HASH>..<HASH> 100644 --- a/citrination_client/client.py +++ b/citrination_client/client.py @@ -29,7 +29,7 @@ class CitrinationClient(object): self.headers = {'X-API-Key': quote(api_key), 'Content-Type': 'application/json', 'X-Citrination-API-Version': '1.0.0'} self.api_url = site + '/api' self.pif_search_url = self.api_url + '/search/pif_search' - self.pif_multi_search_url = self.api_url + '/search/pif_multi_search' + self.pif_multi_search_url = self.api_url + 'search/pif/multi_pif_search' self.dataset_search_url = self.api_url + '/search/dataset' def search(self, pif_system_returning_query):
fix the multi search PIFs route
CitrineInformatics_python-citrination-client
train
py
cb1d8efbd8f8d695a069f671c2aec36862295d90
diff --git a/finance.js b/finance.js index <HASH>..<HASH> 100644 --- a/finance.js +++ b/finance.js @@ -317,8 +317,6 @@ } } loan.amortizationTable = schedule; - console.log(loan.amortizationTable); - d.resolve(loan); } return d.promise;
removed logging on addAmortizationTable
robhicks_financejs
train
js
4de334e034a014cf4c5c2cfe4c6578397fd6153a
diff --git a/connection.go b/connection.go index <HASH>..<HASH> 100644 --- a/connection.go +++ b/connection.go @@ -232,15 +232,27 @@ func (c *Connection) readMessage() (m *buffer.InMessage, err error) { err = m.Init(c.wrapped.Dev) c.wrapped.Rio.RUnlock() - if err != nil { - c.destroyInMessage(m) - m = nil - - // Special case: ENODEV means fuse has hung up. - if pe, ok := err.(*os.PathError); ok && pe.Err == syscall.ENODEV { + // Special cases: + // + // * ENODEV means fuse has hung up. + // + // * EINTR means we should try again. (This seems to happen often on + // OS X, cf. http://golang.org/issue/11180) + // + if pe, ok := err.(*os.PathError); ok { + switch pe.Err { + case syscall.ENODEV: err = io.EOF + + case syscall.EINTR: + err = nil + continue } + } + if err != nil { + c.destroyInMessage(m) + m = nil return }
Fixed a bug related to EINTR.
jacobsa_fuse
train
go
3ea8cf5b97350e8488af7daee65a3e49607aa2c5
diff --git a/lib/media/drm_engine.js b/lib/media/drm_engine.js index <HASH>..<HASH> 100644 --- a/lib/media/drm_engine.js +++ b/lib/media/drm_engine.js @@ -334,10 +334,10 @@ shaka.media.DrmEngine.prototype.attach = function(video) { 'encrypted', (e) => this.onEncrypted_(/** @type {!MediaEncryptedEvent} */ (e))); } - }).catch(function(error) { + }).catch((error) => { if (this.destroyed_) return Promise.resolve(); // Ignore destruction errors return Promise.reject(error); - }.bind(this)); + }); };
Avoid bind in catch in DrmEngine Change-Id: Ia<I>ac<I>cde1c9c<I>db0c<I>cf<I>d<I>
google_shaka-player
train
js
351f9c5146fa2049e3d94fe27f56df7ef070b6b4
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -27,7 +27,7 @@ return array( 'label' => 'extension-tao-mediamanager', 'description' => 'TAO media manager extension', 'license' => 'GPL-2.0', - 'version' => '8.1.0', + 'version' => '9.0.0', 'author' => 'Open Assessment Technologies SA', 'requires' => array( 'tao' => '>=34.0.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100755 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -34,6 +34,6 @@ class Updater extends \common_ext_ExtensionUpdater throw new \common_exception_NotImplemented('Updates from versions prior to Tao 3.1 are not longer supported, please update to Tao 3.1 first'); } - $this->skip('0.3.0', '8.1.0'); + $this->skip('0.3.0', '9.0.0'); } }
TTD-<I> changed major version
oat-sa_extension-tao-mediamanager
train
php,php
6f2e2bd492479eaa30c83b8a3b0e31db308184b9
diff --git a/middleware/static_server/application.js b/middleware/static_server/application.js index <HASH>..<HASH> 100644 --- a/middleware/static_server/application.js +++ b/middleware/static_server/application.js @@ -3,6 +3,7 @@ var app = protos.app, fs = require('fs'), + util = require('util'), mime = require('mime'), pathModule = require('path'), Application = protos.lib.application; @@ -105,6 +106,7 @@ Application.prototype._serveStaticFile = function(path, req, res) { if (isCached) { res.statusCode = 304; delete headers['Content-Length']; + app.emit('static_headers', headers); res.sendHeaders(headers); res.end(); return; @@ -134,6 +136,7 @@ Application.prototype._serveStaticFile = function(path, req, res) { res.statusCode = 416; // HTTP/1.1 416 Requested Range Not Satisfiable delete headers['Content-Length']; headers.Connection = 'close'; + app.emit('static_headers', headers); res.sendHeaders(headers); res.end(''); return; @@ -152,6 +155,7 @@ Application.prototype._serveStaticFile = function(path, req, res) { }); stream.on('open', function() { + app.emit('static_headers', headers); res.sendHeaders(headers); stream.pipe(res); });
Added the 'static_headers' event The event can be used to modify the headers sent for static files via the 'static_server' middleware. The handler callbacks receive the headers object to be passed to res.sendHeaders(). Headers can be modified or deleted on this event.
derdesign_protos
train
js
91355b02588b05f05c4465955f9effdd8aac80fd
diff --git a/pkg/fab/comm/connector.go b/pkg/fab/comm/connector.go index <HASH>..<HASH> 100644 --- a/pkg/fab/comm/connector.go +++ b/pkg/fab/comm/connector.go @@ -114,15 +114,13 @@ func (cc *CachingConnector) DialContext(ctx context.Context, target string, opts logger.Debugf("DialContext: %s", target) cc.lock.Lock() - c, ok := cc.loadConn(target) - if !ok { - createdConn, err := cc.createConn(ctx, target, opts...) - if err != nil { - cc.lock.Unlock() - return nil, errors.WithMessage(err, "connection creation failed") - } - c = createdConn + + createdConn, err := cc.createConn(ctx, target, opts...) + if err != nil { + cc.lock.Unlock() + return nil, errors.WithMessage(err, "connection creation failed") } + c := createdConn cc.lock.Unlock()
Fix see redundant connector caching. (#<I>)
hyperledger_fabric-sdk-go
train
go
e8013c81c9e4a141e330c4d3b1277b886f9ba939
diff --git a/quantum-dom/lib/index.js b/quantum-dom/lib/index.js index <HASH>..<HASH> 100644 --- a/quantum-dom/lib/index.js +++ b/quantum-dom/lib/index.js @@ -321,7 +321,7 @@ function stringify (elements, options) { return Promise.all([stylesheets, scripts]) .spread((stylesheets, scripts) => { - const head = '<head>' + headElements + stylesheets.join('') + '</head>' + const head = '<head>' + stylesheets.join('') + headElements + '</head>' const openBodyTag = bodyClass ? '<body class="' + bodyClass + '">' : '<body>' const body = openBodyTag + bodyElements + scripts.join('') + '</body>' const html = '<!DOCTYPE html>\n' + '<html>' + head + body + '</html>'
put stylesheets at the top of the head so they can be overridden properly without !important
ocadotechnology_quantumjs
train
js
23ba9382a4341db3796238bd4b0122e7e312dba3
diff --git a/src/Storage/Query/ContentQueryParser.php b/src/Storage/Query/ContentQueryParser.php index <HASH>..<HASH> 100644 --- a/src/Storage/Query/ContentQueryParser.php +++ b/src/Storage/Query/ContentQueryParser.php @@ -34,7 +34,7 @@ class ContentQueryParser protected $identifier; - protected $operations = ['search', 'latest', 'first', 'random']; + protected $operations = ['search', 'latest', 'first', 'random', 'nativesearch']; protected $directives = []; @@ -65,6 +65,7 @@ class ContentQueryParser $this->addHandler('random', new RandomQueryHandler()); $this->addHandler('first', new FirstQueryHandler()); $this->addHandler('latest', new LatestQueryHandler()); + $this->addHandler('nativesearch', new NativeSearchHandler()); $this->addDirectiveHandler('returnsingle', new ReturnSingleHandler()); $this->addDirectiveHandler('order', new OrderHandler());
add the new nativesearch operation to the parser
bolt_bolt
train
php
a90b137a4ffe96b00602a5062bf089a619f39bac
diff --git a/circuitbreaker.go b/circuitbreaker.go index <HASH>..<HASH> 100644 --- a/circuitbreaker.go +++ b/circuitbreaker.go @@ -242,7 +242,7 @@ func (cb *FrequencyBreaker) Fail() { // Failures returns the number of failures for this circuit breaker. The failure count // for a FrequencyBreaker resets when the duration expires. func (cb *FrequencyBreaker) Failures() int64 { - if time.Since(cb.failureTick()) > cb.Duration { + if cb.Duration > 0 && (time.Since(cb.failureTick()) > cb.Duration) { return 0 } return cb.TrippableBreaker.Failures()
Only zero the failure count if there's a duration that can expire
rubyist_circuitbreaker
train
go
be585001cf5ea095e3d4ba8398523cb6856d5b4c
diff --git a/DataFixtures/ORM/AbstractFixture.php b/DataFixtures/ORM/AbstractFixture.php index <HASH>..<HASH> 100644 --- a/DataFixtures/ORM/AbstractFixture.php +++ b/DataFixtures/ORM/AbstractFixture.php @@ -135,7 +135,7 @@ abstract class AbstractFixture implements FixtureInterface, ContainerAwareInterf $pathname = $this->getFaker()->imageFile(null, $width, $height, $format, true, $text, $textColor, $backgroundColor, $fontPath); - return new UploadedFile($pathname, $pathname, null, null, null, true); + return new UploadedFile($pathname, $pathname, null, null, true); } /**
Fix instantiating UploadedFile.
DarvinStudio_darvin-utils
train
php
fc869b7a2169f1b64cd467c17f9386de5e09ed4f
diff --git a/glances/plugins/glances_hddtemp.py b/glances/plugins/glances_hddtemp.py index <HASH>..<HASH> 100644 --- a/glances/plugins/glances_hddtemp.py +++ b/glances/plugins/glances_hddtemp.py @@ -92,7 +92,7 @@ class GlancesGrabHDDTemp(object): self.reset() # Only update if --disable-hddtemp is not set - if self.args.disable_hddtemp: + if self.args is None or self.args.disable_hddtemp: return # Fetch the data diff --git a/unitest.py b/unitest.py index <HASH>..<HASH> 100755 --- a/unitest.py +++ b/unitest.py @@ -78,14 +78,14 @@ class TestGlances(unittest.TestCase): print('INFO: [TEST_000] Test the stats update function') try: stats.update() - except: - print('ERROR: Stats update failed') + except Exception as e: + print('ERROR: Stats update failed ({})'.format(e)) self.assertTrue(False) time.sleep(1) try: stats.update() - except: - print('ERROR: Stats update failed') + except Exception as e: + print('ERROR: Stats update failed ({})'.format(e)) self.assertTrue(False) self.assertTrue(True)
Correct an issue on the latest commit, cause unitary tests failed
nicolargo_glances
train
py,py
509a702fc2c8d07f0f5e707a004a31776062b18e
diff --git a/src/Database/Statement/PDOStatement.php b/src/Database/Statement/PDOStatement.php index <HASH>..<HASH> 100644 --- a/src/Database/Statement/PDOStatement.php +++ b/src/Database/Statement/PDOStatement.php @@ -47,6 +47,20 @@ class PDOStatement extends StatementDecorator } /** + * Magic getter to return PDOStatement::$queryString as read-only. + * + * @param string $property internal property to get + * @return mixed + */ + public function __get(string $property) + { + if ($property === 'queryString' && isset($this->_statement->queryString)) { + /** @psalm-suppress NoInterfaceProperties */ + return $this->_statement->queryString; + } + } + + /** * Assign a value to a positional or named variable in prepared query. If using * positional variables you need to start with index one, if using named params then * just use the name in any order.
Fix error when accessing PDOStatement::$queryString. On PHP <I> trying to access PDOStatement::$queryString before it's initialized results in "Error: Typed property PDOStatement::$queryString must not be accessed before initialization".
cakephp_cakephp
train
php
5fc101136f6fb2d0e663a9e394e17173685da8a3
diff --git a/core/server/web/site/app.js b/core/server/web/site/app.js index <HASH>..<HASH> 100644 --- a/core/server/web/site/app.js +++ b/core/server/web/site/app.js @@ -64,6 +64,11 @@ module.exports = function setupSiteApp(options = {}) { const siteApp = express(); + // Make sure 'req.secure' is valid for proxied requests + // (X-Forwarded-Proto header will be checked, if present) + // NB: required here because it's not passed down via vhost + siteApp.enable('trust proxy'); + // ## App - specific code // set the view engine siteApp.set('view engine', 'hbs');
Fixed urls in output when accessing front-end via https no issue - `vhost` as used in <URL>
TryGhost_Ghost
train
js
6377af6b8f1940497b02a7c0075cbfc2bb9f31e5
diff --git a/src/Mysqli/MysqliDriver.php b/src/Mysqli/MysqliDriver.php index <HASH>..<HASH> 100644 --- a/src/Mysqli/MysqliDriver.php +++ b/src/Mysqli/MysqliDriver.php @@ -389,6 +389,22 @@ class MysqliDriver extends DatabaseDriver } /** + * Method to get the database connection collation in use by sampling a text field of a table in the database. + * + * @return mixed The collation in use by the database connection (string) or boolean false if not supported. + * + * @since 1.0 + * @throws \RuntimeException + */ + public function getConnectionCollation() + { + $this->connect(); + + return $this->setQuery('SELECT @@collation_connection;')->loadResult(); + + } + + /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cursor An optional database cursor resource to extract the row count from.
missed getConnectionCollation Pull Request for Issue #<I> . ### Summary of Changes added the missed `getConnectionCollation()` method ### Testing Instructions Access to System -> System Information ### Expected result NO error ### Actual result Call to undefined method Joomla\Database\Mysqli\MysqliDriver::getConnectionCollation()
joomla-framework_database
train
php
c800525ae7bfbae5fb84d6ea344e4bf40df891c8
diff --git a/lib/mongoid/config.rb b/lib/mongoid/config.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/config.rb +++ b/lib/mongoid/config.rb @@ -43,7 +43,6 @@ module Mongoid #:nodoc option :persist_in_safe_mode, :default => false option :preload_models, :default => true option :raise_not_found_error, :default => true - option :reconnect_time, :default => 3 option :skip_version_check, :default => false option :time_zone, :default => nil option :max_retries_on_connection_failure, :default => 0 diff --git a/lib/mongoid/railtie.rb b/lib/mongoid/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/railtie.rb +++ b/lib/mongoid/railtie.rb @@ -35,7 +35,7 @@ module Rails #:nodoc: # module MyApplication # class Application < Rails::Application # config.mongoid.logger = Logger.new($stdout, :warn) - # config.mongoid.reconnect_time = 10 + # config.mongoid.persist_in_safe_mode = true # end # end config.mongoid = ::Mongoid::Config
Getting rid of the old reconnect time option
mongodb_mongoid
train
rb,rb
7e0fb2837d56ed4e8bc338f9ed859eb73556d176
diff --git a/stripe/test/test_resources.py b/stripe/test/test_resources.py index <HASH>..<HASH> 100644 --- a/stripe/test/test_resources.py +++ b/stripe/test/test_resources.py @@ -1586,14 +1586,16 @@ class BitcoinReceiverTest(StripeResourceTest): def test_create_receiver(self): stripe.BitcoinReceiver.create(amount=100, description="some details", - currency="usd") + currency="usd", + email="do+fill_now@stripe.com") self.requestor_mock.request.assert_called_with( 'post', '/v1/bitcoin/receivers', { 'amount': 100, 'description': 'some details', - 'currency': 'usd' + 'currency': 'usd', + 'email': 'do+fill_now@stripe.com' }, None )
made bitcoin receiver creation in test consistent with backend (email is actually required)
stripe_stripe-python
train
py
22b0a6960b6b7c6872dff38560507fa2658f1aa3
diff --git a/autoflake.py b/autoflake.py index <HASH>..<HASH> 100755 --- a/autoflake.py +++ b/autoflake.py @@ -69,17 +69,18 @@ except NameError: def standard_paths(): """Yield paths to standard modules.""" for is_plat_spec in [True, False]: + + # Yield lib paths. path = distutils.sysconfig.get_python_lib(standard_lib=True, plat_specific=is_plat_spec) - for name in os.listdir(path): yield name - try: - for name in os.listdir(os.path.join(path, 'lib-dynload')): + # Yield lib-dynload paths. + dynload_path = os.path.join(path, 'lib-dynload') + if os.path.isdir(dynload_path): + for name in os.listdir(dynload_path): yield name - except OSError: # pragma: no cover - pass def standard_package_names(): @@ -88,7 +89,7 @@ def standard_package_names(): if name.startswith('_') or '-' in name: continue - if '.' in name and name.rsplit('.')[-1] not in ['so', 'py', 'pyc']: + if '.' in name and not name.endswith(("so", "py", "pyc")): continue yield name.split('.')[0]
Fixing some readability issues. (#<I>) - on standard_paths function: * I used `os.path.isdir` instead of `try: ... except OSError: pass` for checking if `lib-dynload` exist. - on `standard_package_names` function: * I used `name.endswith` instead of using the complex expression `name.rsplit('.')[-1]`
myint_autoflake
train
py
aa2c1b0a5609049093b9a3279430f4b917e2fd80
diff --git a/lib/db.js b/lib/db.js index <HASH>..<HASH> 100644 --- a/lib/db.js +++ b/lib/db.js @@ -49,7 +49,7 @@ function updateIndexes(entry, callback) db.indexes.seeders.set(torrent.infoHash, maxSeeders); db.indexes.updated.set(torrent.infoHash, torrent.updated); - if (torrent.files) torrent.files.forEach(function(x) { + if (torrent.files && maxSeeders) torrent.files.forEach(function(x) { if (db.isFileBlacklisted(x)) return; getHashes(x).forEach(function(hash) { db.indexes.meta.delete(hash, torrent.infoHash); // always ensure there are no duplicates
put torrent in meta index only if it has some popularity
jaruba_multipass-torrent
train
js
89919b14b4624a25a9694c3f1292f569e049fc8f
diff --git a/src/components/map/map-legend.js b/src/components/map/map-legend.js index <HASH>..<HASH> 100644 --- a/src/components/map/map-legend.js +++ b/src/components/map/map-legend.js @@ -45,11 +45,11 @@ const StyledMapControlLegend = styled.div` font-size: 11px; padding-right: ${props => props.theme.mapControl.padding}px; } - - .legend--layer__title { + + .legend--layer__title { padding-right: ${props => props.theme.mapControl.padding}px; } - + .legend--layer_by { color: ${props => props.theme.subtextColor}; } @@ -113,13 +113,14 @@ const MultiColorLegend = ({layer, width}) => { const MapLegend = ({layers}) => ( <div> {layers.map((layer, index) => { + if (!layer.isValidToSave()) { + return null; + } + const colorChannelConfig = layer.getVisualChannelDescription('color'); const enableColorBy = colorChannelConfig.measure; const width = DIMENSIONS.mapControl.width - 2 * DIMENSIONS.mapControl.padding; - if (!layer.isValidToSave()) { - return null; - } return ( <StyledMapControlLegend
[bug] fix map legned render error when layer type is not assigned (#<I>)
keplergl_kepler.gl
train
js
6affdb761959aebcb7f74c5f1e67416e9573e492
diff --git a/bitex/interfaces/bittrex.py b/bitex/interfaces/bittrex.py index <HASH>..<HASH> 100644 --- a/bitex/interfaces/bittrex.py +++ b/bitex/interfaces/bittrex.py @@ -59,3 +59,28 @@ class Bittrex(BittrexREST): q.update(kwargs) return self.public_query('getmarkethistory', params=q) + @return_json + def bid(self, pair, price, vol, market=False, **kwargs): + q = {'market': pair, 'rate': price, 'quantity': vol} + q.update(kwargs) + if market: + # send market order + return self.private_query('market/buymarket', params=q) + else: + # send limit order + return self.private_query('market/buylimit', params=q) + + @return_json + def ask(self, pair, price, vol, market=False, **kwargs): + q = {'market': pair, 'rate': price, 'quantity': vol} + q.update(kwargs) + if market: + # send market order + return self.private_query('market/sellmarket', params=q) + else: + # send limit order + return self.private_query('market/selllimit', params=q) + + @return_json + def balance(self): + return self.private_query('account/getbalances') \ No newline at end of file
added ask bid balance methods to bittrex interface
Crypto-toolbox_bitex
train
py
b8f246629c2d8120c73d5f65b5597a4d94367ca5
diff --git a/web/static/scripts/redisCommander.js b/web/static/scripts/redisCommander.js index <HASH>..<HASH> 100644 --- a/web/static/scripts/redisCommander.js +++ b/web/static/scripts/redisCommander.js @@ -302,6 +302,7 @@ function setupEditZSetButton () { } function setupAddKeyButton (connectionId) { + $('#stringValue').val(''); $('#keyValue').keyup(function () { var action = "apiv1/key/" + encodeURIComponent(connectionId) + "/" + encodeURIComponent($(this).val()); $('#addKeyForm').attr("action", action);
remove last added redis value on reopen of addKey modal
joeferner_redis-commander
train
js
01465b433abcaa408cc2468a15551dd3eb218058
diff --git a/cellpy/_version.py b/cellpy/_version.py index <HASH>..<HASH> 100644 --- a/cellpy/_version.py +++ b/cellpy/_version.py @@ -1,2 +1,2 @@ -version_info = (0, 3, 3, "a2") +version_info = (0, 3, 3, "a3") __version__ = ".".join(map(str, version_info))
released a2 - bump v to a3
jepegit_cellpy
train
py
7f6dd3d89eaa7673dcc28b79793fac984124bece
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -37,12 +37,26 @@ function decrypt(key, encryptedData) { var decipher, decoded, + final, + padding, iv = new Buffer(new Array(KEYLENGTH + 1).join(' '), 'binary'); decipher = crypto.createDecipheriv('aes-128-cbc', key, iv); + decipher.setAutoPadding(false); + encryptedData = encryptedData.slice(3); + decoded = decipher.update(encryptedData); - decoded += decipher.final(); + + final = decipher.final(); + final.copy(decoded, decoded.length - 1); + + padding = decoded[decoded.length - 1]; + if (padding) { + decoded = decoded.slice(0, decoded.length - padding); + } + + decoded = decoded.toString('utf8'); return decoded;
Fixed an issue with the padding resulting in a "wrong final block length" error
bertrandom_chrome-cookies-secure
train
js
7390bc7fbe32350f5d85aa29a1385aa720b6c05e
diff --git a/src/fn/triggerListener.js b/src/fn/triggerListener.js index <HASH>..<HASH> 100644 --- a/src/fn/triggerListener.js +++ b/src/fn/triggerListener.js @@ -6,12 +6,14 @@ const err = require('./err') require('setimmediate') function callNode(db, path, i) { - let fn = db.updates.fns[path][i] + let fns = db.updates.fns[path] - if (!fn) { + if (!fns || !fns[i]) { return } + let fn = fns[i] + let val = getNode(db, path) let cacheTest = JSON.stringify(val)
Add guards for triggerListener for listeners that have been cleared entirely.
jsonmvc_db
train
js