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
bd56ccab3fb4d96af59394b307bac4502f205ce7
diff --git a/ui/js/components/logviewer/logviewer.js b/ui/js/components/logviewer/logviewer.js index <HASH>..<HASH> 100644 --- a/ui/js/components/logviewer/logviewer.js +++ b/ui/js/components/logviewer/logviewer.js @@ -9,7 +9,7 @@ treeherder.component('thLogViewer', { let params = { lineHeight: 13 }; if (q.lineNumber) { - const lines = q.lineNumber.split('-'); + const lines = q.lineNumber.toString().split('-'); params.lineNumber = lines[0]; params.highlightStart = lines[0];
Bug <I> - Log viewer sometimes doesn't load the log (#<I>) Occasionally the log viewer doesn't seem to load. The JS error in the console was `q.lineNumber.split is not a function`. This was happening because `q.lineNumber` was sometimes interpreted as a number. To fix that, the use of `toString()` is used before splitting it.
mozilla_treeherder
train
js
49151745d058d3cba8ef79e0938a767ce217c0db
diff --git a/looper/models.py b/looper/models.py index <HASH>..<HASH> 100644 --- a/looper/models.py +++ b/looper/models.py @@ -3110,6 +3110,10 @@ def _import_sample_subtype(pipeline_filepath, subtype_name=None): """ base_type = Sample + _, ext = _os.path.splitext(pipeline_filepath) + if ext != ".py": + return base_type + try: _LOGGER.debug("Attempting to import module defined by {}". format(pipeline_filepath))
only attempt import of Python pipelines; fix #<I>
pepkit_peppy
train
py
6ffa7e35e322173d099c78974dd09c477d3187c3
diff --git a/test/api.js b/test/api.js index <HASH>..<HASH> 100644 --- a/test/api.js +++ b/test/api.js @@ -751,9 +751,9 @@ function expectWorkingPort (port, done, options) { function expectBadPort (port, done) { request({ url: 'http://localhost:' + port, - timeout: 300 + timeout: 500 }, function (err, res, body) { - if (err.code === 'ECONNREFUSED' || err.code === 'ETIMEDOUT') { + if (err.code === 'ECONNREFUSED' || err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT') { return done() } if (!err && body) {
check for ESOCKETTIMEDOUT in test script
yyx990803_pod
train
js
d519fb8a5355405f338c2efa27bad64644906643
diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index <HASH>..<HASH> 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -224,6 +224,7 @@ class PluginManager } if ($oldInstallerPlugin) { + $this->io->writeError('<warning>Loading "'.$package->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').'which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.</warning>'); $installer = new $class($this->io, $this->composer); $this->composer->getInstallationManager()->addInstaller($installer); $this->registeredPlugins[$package->getName()] = $installer;
Add warning when loading plugins of type composer-installer as they are unlikely to function correctly and should be upgraded to the composer-plugin type
composer_composer
train
php
7e9741a8d158d4db261d788fe6a447cf3c4d61cc
diff --git a/src/lib/accounts.js b/src/lib/accounts.js index <HASH>..<HASH> 100644 --- a/src/lib/accounts.js +++ b/src/lib/accounts.js @@ -44,8 +44,8 @@ function getLastSync (cozy, account) { selector: {'account': account._id} })) // FIXME: nosupport for multiple accounts right now - .then(results => results[0].last_success) - .then(lastSync => /^0001/.test(lastSync) ? null : new Date(lastSync)) + .then(results => results[0] && results[0].last_success) + .then(lastSync => !lastSync || /^0001/.test(lastSync) ? null : new Date(lastSync)) } export function getAccountsByType (cozy, accountType) {
[fix] prevent errors when last sync is unavailable
cozy_cozy-home
train
js
bdbce00da12ab1a8e50b637906c45633043a521e
diff --git a/go/kbfs/libkbfs/block_retrieval_queue.go b/go/kbfs/libkbfs/block_retrieval_queue.go index <HASH>..<HASH> 100644 --- a/go/kbfs/libkbfs/block_retrieval_queue.go +++ b/go/kbfs/libkbfs/block_retrieval_queue.go @@ -342,14 +342,15 @@ func (brq *blockRetrievalQueue) checkCaches(ctx context.Context, cachedBlock, err := brq.config.BlockCache().Get(ptr) if err == nil { - block.Set(cachedBlock) if dbc == nil { + block.Set(cachedBlock) return brq.getPrefetchStatus(ptr.ID), nil } prefetchStatus, err := dbc.GetPrefetchStatus( ctx, kmd.TlfID(), ptr.ID, preferredCacheType) if err == nil { + block.Set(cachedBlock) return prefetchStatus, nil } // If the prefetch status wasn't in the preferred cache, do a
block_retrieval_queue: fix bug failing to use mem-cached blocks If a block was in the memory cache, but had no prefetch status in our preferred on-disk cache, we drop down to do a full get of the block (which moves the block into our preferred cache). But in that case we were leaving `block` filled in (from the memory cache), which caused an error when trying to decode the encoded-disk version of the block again, and this caused the block to never be read from the disk cache.
keybase_client
train
go
c2c49e4407009078f45fe3b491699c49bfa478c3
diff --git a/src/behaviors/File.php b/src/behaviors/File.php index <HASH>..<HASH> 100644 --- a/src/behaviors/File.php +++ b/src/behaviors/File.php @@ -9,12 +9,6 @@ * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/) */ -/** - * Created by PhpStorm. - * User: tofid - * Date: 11.02.15 - * Time: 17:59. - */ namespace hipanel\behaviors; use hipanel\base\Model; @@ -57,7 +51,7 @@ class File extends Behavior * * @param \yii\base\ModelEvent $event */ - public function processFiles($event) + public function processFiles($event = null) { /** @var Model $model */ $model = $this->owner;
File behavior - changed precessFiles() method signature
hiqdev_hipanel-core
train
php
72ffd6cc5b654af759b7442e2df4424137da378e
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java @@ -499,14 +499,15 @@ public class TypeFrameModelingVisitor extends AbstractFrameModelingVisitor<Type, @Override public void handleStoreInstruction(StoreInstruction obj) { - if (isTopOfStackExact() && obj.consumeStack(cpg) == 1) { + int numConsumed = obj.consumeStack(cpg); + if ( numConsumed == 1) { try { - int numConsumed = obj.consumeStack(cpg); + boolean isExact = isTopOfStackExact(); TypeFrame frame = getFrame(); int index = obj.getIndex(); Type value = frame.popValue(); frame.setValue(index, value); - frame.setExact(index, true); + frame.setExact(index, isExact); } catch (DataflowAnalysisException e) { throw new InvalidBytecodeException(e.toString()); }
have to be more careful about tracking exact types git-svn-id: <URL>
spotbugs_spotbugs
train
java
4e0d1155dee9caf05ca8b4e4b25099ff491f920e
diff --git a/src/js/remote.js b/src/js/remote.js index <HASH>..<HASH> 100644 --- a/src/js/remote.js +++ b/src/js/remote.js @@ -698,14 +698,16 @@ Remote.prototype.request_transaction_entry = function (hash) { .tx_hash(hash); }; -Remote.prototype.request_ripple_lines_get = function (accountID) { +Remote.prototype.request_ripple_lines_get = function (accountID, index) { // XXX Does this require the server to be trusted? //assert(this.trusted); var request = new Request(this, 'ripple_lines_get'); - // XXX Convert API call to JSON - request.message.params = [accountID]; + request.message.account = accountID; + + if (index) + request.message.index = index; return request; }; @@ -1001,10 +1003,13 @@ Remote.prototype.request_unl_list = function () { return new Request(this, 'unl_list'); }; -Remote.prototype.request_unl_add = function (addr, note) { +Remote.prototype.request_unl_add = function (addr, comment) { var request = new Request(this, 'unl_add'); - request.message.params = [addr, note]; + request.message.node = addr; + + if (comment !== undefined) + request.message.comment = note; return request; };
Refactor RPC ripple_lines_get.
ChainSQL_chainsql-lib
train
js
25c51ef626e8ded7aab8f6f3efd19d09aabb589b
diff --git a/src/test/java/picocli/ArgSplitTest.java b/src/test/java/picocli/ArgSplitTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/picocli/ArgSplitTest.java +++ b/src/test/java/picocli/ArgSplitTest.java @@ -398,6 +398,22 @@ public class ArgSplitTest { } } + @Test + public void testParseQuotedOptionsWithNestedQuotedValuesGivesError2() { + class Example { + @Option(names = "-x", split = ",") + List<String> parts; + } + String[] args = {"\"-x=a,b,\"c,d,e\",f\""}; + Example example = new Example(); + try { + new CommandLine(example).setTrimQuotes(true).parseArgs(args); + fail("Expected exception"); + } catch (Exception ex) { + assertEquals("Unmatched argument at index 0: '\"-x=a,b,\"c,d,e\",f\"'", ex.getMessage()); + } + } + // test https://github.com/remkop/picocli/issues/379 @Test
[#<I>] added test
remkop_picocli
train
java
1059ba22c0951d36e5a23b02c024971dd34fd593
diff --git a/buildbucket/cmd/bbagent/main.go b/buildbucket/cmd/bbagent/main.go index <HASH>..<HASH> 100644 --- a/buildbucket/cmd/bbagent/main.go +++ b/buildbucket/cmd/bbagent/main.go @@ -102,7 +102,7 @@ type stopInfo struct { // // build has been canceled. // * Shuts down the luciexe if the build is canceled. -func (si stopInfo) stopEvents(ctx context.Context, c clientInput, fatalUpdateBuildErrorSlot atomic.Value) { +func (si stopInfo) stopEvents(ctx context.Context, c clientInput, fatalUpdateBuildErrorSlot *atomic.Value) { stopped := false for { select { @@ -540,7 +540,7 @@ func mainImpl() int { dispatcherErrCh, } - go si.stopEvents(ctx, bbclientInput, fatalUpdateBuildErrorSlot) + go si.stopEvents(ctx, bbclientInput, &fatalUpdateBuildErrorSlot) // Now all we do is shuttle builds through to the buildbucket client channel // until there are no more builds to shuttle.
[bbagent] fix a bug - should pass fatalUpdateBuildErrorSlot as a pointer Go is pass-by-value. So the fatalUpdateBuildErrorSlot should be passed as a pointer. Otherwise, `si.stopEvents()` function cannot pass value to main function via fatalUpdateBuildErrorSlot(demo-<URL>
luci_luci-go
train
go
0c1ff4243e40ff7535bfd348efa1888733599ab0
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -2054,7 +2054,7 @@ module ActionDispatch # your url helper definition, e.g: # # direct :browse, page: 1, size: 10 do |options| - # [ :products, options.merge(params.permit(:page, :size)) ] + # [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_keys) ] # end # # In this instance the `params` object comes from the context in which the the
Fix `direct` with params example [ci skip] Since `ActionController:Parameters` does not inherit `Hash`, need to explicitly convert it to `Hash`. Also, `Parameters#to_h` returns `Hash` whose key is `String`. Therefore, if merge as it is, the value will not be overwritten as expected.
rails_rails
train
rb
32e12bf53be5eb5bf51fb67d1a5b3e9aa8c404c3
diff --git a/lib/dish/plate.rb b/lib/dish/plate.rb index <HASH>..<HASH> 100644 --- a/lib/dish/plate.rb +++ b/lib/dish/plate.rb @@ -28,7 +28,11 @@ module Dish @_original_hash end - alias_method :as_hash, :to_h + def as_hash + # TODO: Add the version number where this was deprecated? + warn 'Dish::Plate#as_hash has been deprecated. Use Dish::Plate#to_h.' + to_h + end def to_json(*args) # If we're using RubyMotion #to_json isn't available like with Ruby's JSON stdlib
Add a deprecation notice to Dish::Plate#as_hash
lassebunk_dish
train
rb
665370877f60a3c6fa64f7a1637718df0cf2a295
diff --git a/src/request/import/ImportApi.js b/src/request/import/ImportApi.js index <HASH>..<HASH> 100644 --- a/src/request/import/ImportApi.js +++ b/src/request/import/ImportApi.js @@ -107,7 +107,7 @@ class ImportApi extends TopLevelApi { } else { // Passphrase-encoded this._encryptedKey = Nimiq.BufferUtils.fromBase64(encryptedKeyBase64); - this._passphraseBox.setMinLength(8); + this._passphraseBox.setMinLength(10); } this._goToEnterPassphrase(); @@ -216,14 +216,14 @@ class ImportApi extends TopLevelApi { } _goToEnterPassphrase() { - window.location.hash = ImportApi.Pages.ENTER_PASSPHRASE; this._passphraseBox.reset(); + window.location.hash = ImportApi.Pages.ENTER_PASSPHRASE; this._passphraseBox.focus(); } _goToSetPassphrase() { - window.location.hash = ImportApi.Pages.SET_PASSPHRASE; this._passphraseSetterBox.reset(); + window.location.hash = ImportApi.Pages.SET_PASSPHRASE; this._passphraseSetterBox.focus(); } }
Fix min passphrase length for legacy passphrases, reset passphraseBox before navigating
nimiq_keyguard-next
train
js
4d0cb8ce0a0fe3a5ec9c27d2b32bb47dc5a9fd62
diff --git a/lib/ohm.rb b/lib/ohm.rb index <HASH>..<HASH> 100644 --- a/lib/ohm.rb +++ b/lib/ohm.rb @@ -73,7 +73,7 @@ module Ohm class << self def method_missing(method_id, *args) - raise NoMethodError, "You tried to call #{@name}##{method_id}, but #{@name} is not defined on #{@caller}" + raise ::NoMethodError, "You tried to call #{@name}##{method_id}, but #{@name} is not defined on #{@caller}" end end end
Fix that NoMethodError was not found.
soveran_ohm
train
rb
15b1770330367e0ff019c27977e4cfc9415398f8
diff --git a/hydpy/core/devicetools.py b/hydpy/core/devicetools.py index <HASH>..<HASH> 100644 --- a/hydpy/core/devicetools.py +++ b/hydpy/core/devicetools.py @@ -414,8 +414,8 @@ class Devices(object): del(self.__dict__[key]) def __iter__(self): - for (name, device) in vars(self).items(): - yield (name, device) + for name in sorted(vars(self).keys()): + yield (name, self[name]) def __contains__(self, device): device = self._contentclass(device)
iterate through devices in alphatical order
hydpy-dev_hydpy
train
py
90e21bcdc1b05bcd671906adddc30d9533ec2086
diff --git a/hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java b/hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java index <HASH>..<HASH> 100644 --- a/hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java +++ b/hellocharts-library/src/lecho/lib/hellocharts/gesture/ChartTouchHandler.java @@ -68,15 +68,20 @@ public class ChartTouchHandler { return false; } boolean needInvalidate = false; - // TODO: What the heck, why onTouchEvent() always return true? - - needInvalidate = scaleGestureDetector.onTouchEvent(event); - needInvalidate = gestureDetector.onTouchEvent(event) || needInvalidate; if (isValueTouchEnabled) { needInvalidate = computeTouch(event) || needInvalidate; } + // Check gestures only if value touch was not handled, that prevents for example zooming while user taping chart + // value. + if (!needInvalidate) { + + needInvalidate = scaleGestureDetector.onTouchEvent(event); + + needInvalidate = gestureDetector.onTouchEvent(event) || needInvalidate; + } + return needInvalidate; } @@ -128,6 +133,7 @@ public class ChartTouchHandler { needInvalidate = true; } } + break; case MotionEvent.ACTION_CANCEL: if (renderer.isTouched()) {
Improved touch handling, now gestures don't obscure value touch events
lecho_hellocharts-android
train
java
799e45498422111c3b33059127a90bcfbac58814
diff --git a/modopt/opt/algorithms.py b/modopt/opt/algorithms.py index <HASH>..<HASH> 100644 --- a/modopt/opt/algorithms.py +++ b/modopt/opt/algorithms.py @@ -279,7 +279,7 @@ class ForwardBackward(SetUp): raise ValueError('When using metrics, you must pass a linear ' 'operator') - If self._linear is None: + if self._linear is None: self._linear = Identity() # Set the algorithm parameters
last fix, it is supposed to work on travis now
CEA-COSMIC_ModOpt
train
py
08b6a9f8cde1130dcf31800efc967ff43d2ac284
diff --git a/runtime.go b/runtime.go index <HASH>..<HASH> 100644 --- a/runtime.go +++ b/runtime.go @@ -600,7 +600,7 @@ func parseOutput(w http.ResponseWriter, stdoutTxt io.Reader, runtime string, wg // Set any HTTP headers requested by the proxy function if len(proxy.Headers) > 0 { for key, value := range proxy.Headers { - w.Header().Set(key, value) + w.Header().Add(key, value) } }
Update runtime.go - Don't overwrite headers
awslabs_aws-sam-cli
train
go
815bd790f4aa8dce3f355f613a23ea45d8f08153
diff --git a/src/main/org/openscience/cdk/smiles/DeduceBondSystemTool.java b/src/main/org/openscience/cdk/smiles/DeduceBondSystemTool.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/smiles/DeduceBondSystemTool.java +++ b/src/main/org/openscience/cdk/smiles/DeduceBondSystemTool.java @@ -195,7 +195,8 @@ public class DeduceBondSystemTool { for (int i=0;i<molecule.getAtomCount();i++) { IAtom ai=molecule.getAtom(i); - if (ai.getSymbol().equals("N") && ai.getFormalCharge()==0) { + if (ai.getSymbol().equals("N") && + (ai.getFormalCharge() == null || ai.getFormalCharge() == 0)) { if (inRingSet(ai,ringSet)) { List ca=molecule.getConnectedAtomsList(ai); for (int j=0;j<ca.size();j++){
Fixed a NPE caused by formal charge now being an Object instead of native git-svn-id: <URL>
cdk_cdk
train
java
3d4f2b980b529a21c847604ea6cc016b5ae9aee0
diff --git a/java/client/test/org/openqa/selenium/LargeTests.java b/java/client/test/org/openqa/selenium/LargeTests.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/LargeTests.java +++ b/java/client/test/org/openqa/selenium/LargeTests.java @@ -23,8 +23,7 @@ import org.junit.runners.Suite; @Suite.SuiteClasses({ ByTest.class, CookieImplementationTest.class, - ExecutingAsyncJavascriptTest.class, - TagNameTest.class + ExecutingAsyncJavascriptTest.class }) public class LargeTests {
Removing a reference to a deleted test class
SeleniumHQ_selenium
train
java
4cad36e37eb4cf4ce462a6b800ff4fc376694a04
diff --git a/lib/common/common.go b/lib/common/common.go index <HASH>..<HASH> 100644 --- a/lib/common/common.go +++ b/lib/common/common.go @@ -338,6 +338,11 @@ func writeACI(layer io.ReadSeeker, manifest schema.ImageManifest, curPwl []strin } t.Header.Name = path.Join("rootfs", name) absolutePath := strings.TrimPrefix(t.Header.Name, "rootfs") + + if filepath.Clean(absolutePath) == "/dev" && t.Header.Typeflag != tar.TypeDir { + return fmt.Errorf(`invalid layer: "/dev" is not a directory`) + } + fileMap[absolutePath] = struct{}{} if strings.Contains(t.Header.Name, "/.wh.") { whiteouts = append(whiteouts, strings.Replace(absolutePath, ".wh.", "", 1))
common: error if /dev is not a directory in any layer Since docker2aci is creating stdio symlinks in /dev, a layer with a /dev that's not a directory can cause general badness. Return an error in that case.
appc_docker2aci
train
go
daf4874707713e829c406c863b8252c95b14ec36
diff --git a/annis-service/src/main/java/annis/administration/DefaultAdministrationDao.java b/annis-service/src/main/java/annis/administration/DefaultAdministrationDao.java index <HASH>..<HASH> 100644 --- a/annis-service/src/main/java/annis/administration/DefaultAdministrationDao.java +++ b/annis-service/src/main/java/annis/administration/DefaultAdministrationDao.java @@ -474,6 +474,9 @@ public class DefaultAdministrationDao implements AdministrationDao log.error("Another import is currently running"); return false; } + + // explicitly unset any timeout + jdbcTemplate.update("SET statement_timeout TO 0"); createStagingArea(temporaryStagingArea); bulkImport(path); @@ -668,6 +671,7 @@ public class DefaultAdministrationDao implements AdministrationDao } else if (columnNumber == 10) { + jdbcTemplate.execute("DROP TABLE IF EXISTS _tmpnode;"); // old node table without segmentations // create temporary table for bulk import jdbcTemplate.execute(
make import a little bit more robust
korpling_ANNIS
train
java
5f1e0c88c4be3d4a8e1e88024cd6d464a525886c
diff --git a/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java b/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java index <HASH>..<HASH> 100755 --- a/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java +++ b/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java @@ -315,8 +315,14 @@ public class ExtendedEmailPublisher extends Notifier implements MatrixAggregatab AttachmentUtils attachments = new AttachmentUtils(attachmentsPattern); attachments.attach(multipart, build, listener); msg.setContent(multipart); - - EnvVars env = build.getEnvironment(listener); + EnvVars env = null; + try { + env = build.getEnvironment(listener); + } catch(Exception e) { + listener.getLogger().println("Error retrieving environment vars: " + e.getMessage()); + // create an empty set of env vars + env = new EnvVars(); + } // Get the recipients from the global list of addresses Set<InternetAddress> recipientAddresses = new LinkedHashSet<InternetAddress>();
Fix JENKINS-<I> Added try/catch around environment gathering.
jenkinsci_email-ext-plugin
train
java
1d1fd2d9ce6cca62f9904035ab7cfa56b76c08ef
diff --git a/writer.go b/writer.go index <HASH>..<HASH> 100644 --- a/writer.go +++ b/writer.go @@ -7,18 +7,40 @@ import ( ) func (logger *Logger) Writer() *io.PipeWriter { + return logger.WriterLevel(255) +} + +func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { reader, writer := io.Pipe() - go logger.writerScanner(reader) + var printFunc func(args ...interface{}) + switch level { + case DebugLevel: + printFunc = logger.Debug + case InfoLevel: + printFunc = logger.Info + case WarnLevel: + printFunc = logger.Warn + case ErrorLevel: + printFunc = logger.Error + case FatalLevel: + printFunc = logger.Fatal + case PanicLevel: + printFunc = logger.Panic + default: + printFunc = logger.Print + } + + go logger.writerScanner(reader, printFunc) runtime.SetFinalizer(writer, writerFinalizer) return writer } -func (logger *Logger) writerScanner(reader *io.PipeReader) { +func (logger *Logger) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { scanner := bufio.NewScanner(reader) for scanner.Scan() { - logger.Print(scanner.Text()) + printFunc(scanner.Text()) } if err := scanner.Err(); err != nil { logger.Errorf("Error while reading from Writer: %s", err)
Add WriterLevel() function to the logger This commit adds a variant of the logger's Writer() function that accepts a log level. When the variant is used, any messages written to the returned pipe will be written with the provided level. The original Writer() function uses the logger's Print() method as it always has.
sirupsen_logrus
train
go
4527fa1fb57e101637a1dff13cf59b0b82fe4f76
diff --git a/src/column-header.js b/src/column-header.js index <HASH>..<HASH> 100644 --- a/src/column-header.js +++ b/src/column-header.js @@ -8,8 +8,8 @@ export default function ColumnHeader(props) { return ( <GridCell className={props.className} - idX={props.id} - idY={props.rowId} + idX={props.idX} + idY={props.idY} role="columnheader" > {props.children}
Bugfix: ensure column headers appropriately forwards gridcell interface There is most likely a better way to forward these things...
juanca_react-aria-components
train
js
f7963b8841e679c1a22737e971af02ad5211d31e
diff --git a/tests/test-plugin.php b/tests/test-plugin.php index <HASH>..<HASH> 100644 --- a/tests/test-plugin.php +++ b/tests/test-plugin.php @@ -3,28 +3,6 @@ class Test_Plugin extends WP_UnitTestCase { private $readme_data; - public function test_tested_up_to() { - if ( ! $readme_data = $this->get_readme() ) { - $this->markTestSkipped( 'There is no readme file' ); - return; - } - - wp_version_check(); - - $cur = get_preferred_from_update_core(); - - if ( false === $cur ) { - $this->markTestSkipped( 'There is no internet connection' ); - return; - } - - if ( isset( $cur->current ) ) { - list( $display_version ) = explode( '-', $cur->current ); - - $this->assertTrue( version_compare( $readme_data['tested_up_to'], $display_version, '>=' ), sprintf( '%s >= %s', $readme_data['tested_up_to'], $display_version ) ); - } - } - public function test_stable_tag() { if ( ! $readme_data = $this->get_readme() ) { $this->markTestSkipped( 'There is no readme file' );
Remove the `Tested up to` test because it dirties otherwise passing builds.
johnbillion_user-switching
train
php
4ca72207532b1f2d848d326c3fc7f50b13f03043
diff --git a/lib/v8-to-istanbul.js b/lib/v8-to-istanbul.js index <HASH>..<HASH> 100644 --- a/lib/v8-to-istanbul.js +++ b/lib/v8-to-istanbul.js @@ -8,7 +8,7 @@ const CovSource = require('./source') const { readFileSync } = require('fs') const { SourceMapConsumer } = require('source-map') -const isOlderNode10 = /^v10\.[0-5]/u.test(process.version) +const isOlderNode10 = /^v10\.(([0-9]\.)|(1[0-5]\.))/u.test(process.version) // Injected when Node.js is loading script into isolate pre Node 10.16.x. // see: https://github.com/nodejs/node/pull/21573.
fix: regex for detecting Node < <I> was off
istanbuljs_v8-to-istanbul
train
js
e8ed6ea9152a4e825ca56bdc96dfb7a3f0581a2b
diff --git a/shared/common-adapters/input.desktop.js b/shared/common-adapters/input.desktop.js index <HASH>..<HASH> 100644 --- a/shared/common-adapters/input.desktop.js +++ b/shared/common-adapters/input.desktop.js @@ -152,7 +152,7 @@ class Input extends Component<void, Props, State> { ? { ...globalStyles.flexBoxRow, borderBottom: `1px solid ${underlineColor}`, - flex: 1, + width: '100%', } : { ...globalStyles.flexBoxColumn,
fixes pgp add screen. we don't want this to be expanding vertically (#<I>) * fixes pgp add screen. we don't want this to be expanding vertically * we really want full width, not flex: 1
keybase_client
train
js
6944da219d74e51c6b56d0b571c731af616e087c
diff --git a/mwxml/utilities/__init__.py b/mwxml/utilities/__init__.py index <HASH>..<HASH> 100644 --- a/mwxml/utilities/__init__.py +++ b/mwxml/utilities/__init__.py @@ -1 +1,5 @@ from .dump2revdocs import dump2revdocs +from .normalize import normalize +from .validate import validate + +__all__ = [dump2revdocs, normalize, validate]
adds normalize and validate to utilities
mediawiki-utilities_python-mwxml
train
py
6d3f3528ddf911392cd1a8401814aab3ae6edb89
diff --git a/source/src/main/java/com/linkedin/uif/source/extractor/extract/BaseSource.java b/source/src/main/java/com/linkedin/uif/source/extractor/extract/BaseSource.java index <HASH>..<HASH> 100644 --- a/source/src/main/java/com/linkedin/uif/source/extractor/extract/BaseSource.java +++ b/source/src/main/java/com/linkedin/uif/source/extractor/extract/BaseSource.java @@ -70,6 +70,11 @@ public abstract class BaseSource<S, D> implements Source<S, D> { partitionState.setProp(ConfigurationKeys.WORK_UNIT_LOW_WATER_MARK_KEY, entry.getKey()); partitionState.setProp(ConfigurationKeys.WORK_UNIT_HIGH_WATER_MARK_KEY, entry.getValue()); Extract extract = partitionState.createExtract(tableType, nameSpaceName, entityName); + + // setting current time for the full extract + if(Boolean.valueOf(state.getProp(ConfigurationKeys.EXTRACT_IS_FULL_KEY))) { + extract.setFullTrue(System.currentTimeMillis()); + } workUnits.add(partitionState.createWorkUnit(extract)); workUnitCount++; }
Setting current time for the full extract RB=<I> R=stakiar,kgoodhop,lqiao,ynli A=stakiar
apache_incubator-gobblin
train
java
5b9557ebe372ce3ce8883cc8794b168b9522da3d
diff --git a/pkg/adaptor/registry.go b/pkg/adaptor/registry.go index <HASH>..<HASH> 100644 --- a/pkg/adaptor/registry.go +++ b/pkg/adaptor/registry.go @@ -35,7 +35,7 @@ func Register(name, desc string, fn func(*pipe.Pipe, string, Config) (StopStartL // Registry maps the adaptor's name to the RegistryEntry type Registry map[string]RegistryEntry -// RegistryEnrtry stores the adaptor constructor and configuration struct +// RegistryEntry stores the adaptor constructor and configuration struct type RegistryEntry struct { Name string Description string @@ -46,7 +46,7 @@ type RegistryEntry struct { // About inspects the RegistryEntry's Config object, and uses // each field's tags as a docstring func (r *RegistryEntry) About() string { - doc := fmt.Sprintf("%s %s\n\n",r.Name,r.Description); + doc := fmt.Sprintf("%s %s\n\n", r.Name, r.Description) t := reflect.TypeOf(r.Config) doc += fmt.Sprintf("%-15s %-10s %s\n", "name", "type", "description") for i := 0; i < t.NumField(); i++ {
Fix typo in registry comments for doc gen
compose_transporter
train
go
6f1bce33294dbd0dd99658a591fe3b182a12d58e
diff --git a/__tests__/stream2block.js b/__tests__/stream2block.js index <HASH>..<HASH> 100644 --- a/__tests__/stream2block.js +++ b/__tests__/stream2block.js @@ -104,3 +104,10 @@ test('defer data events if no one is listening', (done) => { } catch (e) { done(e); } }); }); + +test('forward close event', (done) => { + const socket = createSocket(); + const s2b = new Stream2Block(socket); + s2b.on('close', () => done()); + socket.emit('close'); +}); diff --git a/stream2block.js b/stream2block.js index <HASH>..<HASH> 100644 --- a/stream2block.js +++ b/stream2block.js @@ -50,6 +50,8 @@ function Stream2Block (stream) { setImmediate(() => processChunk()); }; this.on('newListener', onNewListener); + // Once the stream has been closed, we release the handle and remove our + // event listeners. So if you want to destroy s2b, just close the stream. this.stream.on('close', () => { this.stream.removeListener('data', onData); this.removeListener('newListener', onNewListener);
stream2block: Added close event unit test
jue89_node-tubemail
train
js,js
edd725825070e309f7baee4058bccb8cadb55eef
diff --git a/src/PeskyCMF/resources/views/layout.blade.php b/src/PeskyCMF/resources/views/layout.blade.php index <HASH>..<HASH> 100644 --- a/src/PeskyCMF/resources/views/layout.blade.php +++ b/src/PeskyCMF/resources/views/layout.blade.php @@ -26,7 +26,7 @@ <link href="/packages/cmf/css/helpers.css" rel="stylesheet" type="text/css"/> <link href="/packages/cmf/js/lib/toastr/toastr.css" rel="stylesheet" type="text/css"/> <link href="/packages/cmf/js/lib/query_builder/css/query-builder.default.css" rel="stylesheet" type="text/css"/> - <link href="/packages/cmf/css/admin.app.css" rel="stylesheet" type="text/css"/> + <link href="/packages/cmf/css/cmf.app.css" rel="stylesheet" type="text/css"/> @foreach(\PeskyCMF\Config\CmfConfig::getInstance()->layout_css_includes() as $cssPath) <link href="{{ $cssPath }}" rel="stylesheet" type="text/css"/>
layout view - css file path fix
swayok_PeskyCMF
train
php
59197903d17fc219ec4d29e220ea058fbd5d62da
diff --git a/logging/cef_formatter.go b/logging/cef_formatter.go index <HASH>..<HASH> 100644 --- a/logging/cef_formatter.go +++ b/logging/cef_formatter.go @@ -21,6 +21,7 @@ import ( "fmt" "github.com/sirupsen/logrus" "os" + "sort" "strings" "sync" "time" @@ -135,7 +136,7 @@ func (f *CEFTextFormatter) Format(entry *logrus.Entry) ([]byte, error) { } func otherExtensionKeys(data logrus.Fields) []string { - extensionKeys := make([]string, 0, len(data)) + extensionKeys := make(sort.StringSlice, 0, len(data)) for k := range data { if k != FieldKeyVendor && k != FieldKeyProduct && k != FieldKeyVersion && @@ -144,6 +145,7 @@ func otherExtensionKeys(data logrus.Fields) []string { extensionKeys = append(extensionKeys, k) } } + extensionKeys.Sort() return extensionKeys }
format custom field before output cef logs (#<I>)
cossacklabs_acra
train
go
29d8ea6d766b0bdf85f8d4a7d415750ab4af0c53
diff --git a/tests/functional/SearchOperationsTest.php b/tests/functional/SearchOperationsTest.php index <HASH>..<HASH> 100644 --- a/tests/functional/SearchOperationsTest.php +++ b/tests/functional/SearchOperationsTest.php @@ -172,7 +172,11 @@ class SearchOperationsTest extends TestCase $this->assertEquals('200', $response->getCode(), $response->getMessage()); $this->assertEquals(2, $response->getNumFound()); - $this->assertEquals('B. Gionta', $response->getDocs()[1]->name_s); + + $docs = $response->getDocs(); + foreach ($docs as $d) { + $this->assertTrue('B. Gionta' == $d->name_s || 'Z. Girgensons' == $d->name_s); + } } /**
Do not assume a certain sort order
basho_riak-php-client
train
php
eb7e7130488cfd86d8dbea74060056c088fab78e
diff --git a/lib/dugway/theme.rb b/lib/dugway/theme.rb index <HASH>..<HASH> 100644 --- a/lib/dugway/theme.rb +++ b/lib/dugway/theme.rb @@ -101,6 +101,8 @@ module Dugway sprockets = Sprockets::Environment.new sprockets.append_path source_dir + Sprockets::Sass.options[:line_comments] = false + # CSS engines like Sass and LESS choke on Liquid variables, so here we render the Liquid # if we're viewing the file, or escape and unescape it if we're building the file.
remove sass line comments
bigcartel_dugway
train
rb
41c1487e97fe8a740f15d06bea18bc3ffe182063
diff --git a/conch/analysis/segments.py b/conch/analysis/segments.py index <HASH>..<HASH> 100644 --- a/conch/analysis/segments.py +++ b/conch/analysis/segments.py @@ -44,6 +44,8 @@ class FileSegment(object): return False if self.channel != other.channel: return False + if self.properties != other.properties: + return False return True def __lt__(self, other):
Fixed error in __eq__ func which didn't account for properties
mmcauliffe_Conch-sounds
train
py
a4bcbaf81a7f859b157b1fe494098b523bc82592
diff --git a/react-winjs.js b/react-winjs.js index <HASH>..<HASH> 100644 --- a/react-winjs.js +++ b/react-winjs.js @@ -1,6 +1,7 @@ var React = require('react'); var ReactDOM = require('react-dom'); -var ReactDOMServer = require('react-dom/server') +var ReactDOMServer = require('react-dom/server'); +var WinJS = require("winjs"); // // Implementation Overview
require WinJS - Don't depend on WinjS global
winjs_react-winjs
train
js
5b3bc2dd1f4eb0b9d6eaf1db27f8d6ea89f2190f
diff --git a/remote.go b/remote.go index <HASH>..<HASH> 100644 --- a/remote.go +++ b/remote.go @@ -278,6 +278,20 @@ func (repo *Repository) CreateRemote(name string, url string) (*Remote, error) { return remote, nil } +func (repo *Repository) DeleteRemote(name string) error { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + ret := C.git_remote_delete(repo.ptr, cname) + if ret < 0 { + return MakeGitError(ret) + } + return nil +} + func (repo *Repository) CreateRemoteWithFetchspec(name string, url string, fetch string) (*Remote, error) { remote := &Remote{}
Add (*Repository).DeleteRemote
libgit2_git2go
train
go
3db7795bf6b971df52e1e3bd8be7c90279bfce54
diff --git a/gems/decorators.py b/gems/decorators.py index <HASH>..<HASH> 100644 --- a/gems/decorators.py +++ b/gems/decorators.py @@ -112,7 +112,8 @@ class cached(object): def _(x): for o in x.__bases__: for key in o.__dict__: - props[key] = o.__dict__[key] + if key not in props: + props[key] = o.__dict__[key] _(o) return _(obj.__class__)
updated cached decorator to honor mro when finding class properties
bprinty_gems
train
py
3df54dfe7a6c41a225ae02cd66eb267b3234f943
diff --git a/axiom/store.py b/axiom/store.py index <HASH>..<HASH> 100644 --- a/axiom/store.py +++ b/axiom/store.py @@ -28,7 +28,7 @@ class XFilePath(FilePath): def dirname(self): return os.path.dirname(self.path) -def _md(dirname): +def _mkdirIfNotExists(dirname): if os.path.isdir(dirname): return False os.makedirs(dirname) @@ -51,7 +51,7 @@ class AtomicFile(file): now = time.time() try: file.close(self) - _md(self._destpath.dirname()) + _mkdirIfNotExists(self._destpath.dirname()) self.finalpath = self._destpath os.rename(self.name, self.finalpath.path) os.utime(self.finalpath.path, (now, now)) @@ -106,9 +106,9 @@ class Store(Empowered): "The path %r is already a directory, " "but not an Axiom Store" % (dbfpath,)) else: - _md(dbdir) - _md(self.filesdir) - _md(os.path.join(dbdir, 'temp')) + _mkdirIfNotExists(dbdir) + _mkdirIfNotExists(self.filesdir) + _mkdirIfNotExists(os.path.join(dbdir, 'temp')) self.dbdir = dbdir self.connection = sqlite.connect(dbfpath) self.cursor = self.connection.cursor()
i don't understand what is so hard about typing.
twisted_axiom
train
py
8c8efb7aa36ae32d71dbfe7830411ee225b81cf2
diff --git a/trunk/metpy/vis/plots.py b/trunk/metpy/vis/plots.py index <HASH>..<HASH> 100644 --- a/trunk/metpy/vis/plots.py +++ b/trunk/metpy/vis/plots.py @@ -194,8 +194,9 @@ def meteogram(data, fig=None, num_panels=3, time_range=None, layout=None, lims = limits.get(varname, (None, None)) #Store the max and min for auto scaling - var_max.append(var.max()) - var_min.append(var.min()) + if var.max() is not np.ma.masked: + var_max.append(var.max()) + var_min.append(var.min()) if style.pop('fill', False): #Plot the filled area. Need latest Matplotlib for date support
Eliminate triggering a warning when plotting an entirely masked array. This also fixes the plot bounds changing off of any previous hard limits when the array is masked. git-svn-id: <URL>
Unidata_MetPy
train
py
cae18f8177234a7c29b81c0b7319073de21f1dcd
diff --git a/tests/Honeybadger/FilterTest.php b/tests/Honeybadger/FilterTest.php index <HASH>..<HASH> 100644 --- a/tests/Honeybadger/FilterTest.php +++ b/tests/Honeybadger/FilterTest.php @@ -186,9 +186,44 @@ class FilterTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($expanded, $actual['file']); } - public function test_honeybadger_paths() + public function provider_honeybadger_paths() { - $this->markTestIncomplete(); + return array( + array( + TRUE, + 'lib/Honeybadger', + ), + array( + FALSE, + 'bananas.php', + ), + + array( + TRUE, + '/usr/local/share/php/lib/honeybadger-php/lib/Honeybadger/Config.php', + ), + ); + } + + /** + * @dataProvider provider_honeybadger_paths + */ + public function test_honeybadger_paths($filtered, $file) + { + $line = array( + 'file' => $file, + ); + + $actual = Filter::honeybadger_paths($line); + + if ($filtered) + { + $this->assertNull($actual); + } + else + { + $this->assertEquals($line, $actual); + } } } \ No newline at end of file
Add test for Filter::honeybadger_paths
honeybadger-io_honeybadger-php
train
php
ba8dfdd5cfcaad62e08cbc67ac1cea66d9060601
diff --git a/lib/Energy/index.js b/lib/Energy/index.js index <HASH>..<HASH> 100644 --- a/lib/Energy/index.js +++ b/lib/Energy/index.js @@ -11,6 +11,7 @@ class Energy { 'LS14250', 'AA', 'AAA', + 'A23', 'A27', 'PP3', 'CR123A',
Add A<I> battery Used in KaKu, Action, Elro, Flamingo etc devices.
athombv_node-homey-lib
train
js
43f41863fa55a4708815552cbcd76e8bdad36983
diff --git a/src/ocrmypdf/helpers.py b/src/ocrmypdf/helpers.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/helpers.py +++ b/src/ocrmypdf/helpers.py @@ -190,8 +190,10 @@ def check_pdf(input_file: Path) -> bool: log.warning(msg) sio = StringIO() - linearize = None + linearize_msgs = '' try: + # If linearization is missing entirely, we do not complain. We do + # complain if linearization is present but incorrect. pdf.check_linearization(sio) except RuntimeError: pass @@ -202,11 +204,11 @@ def check_pdf(input_file: Path) -> bool: ): pass else: - linearize = sio.getvalue() - if linearize: - log.warning(linearize) + linearize_msgs = sio.getvalue() + if linearize_msgs: + log.warning(linearize_msgs) - if not messages and not linearize: + if not messages and not linearize_msgs: return True return False finally:
check_pdf: document how we handle linearization
jbarlow83_OCRmyPDF
train
py
861e011254b5865fcfd36326a309957f2ea9aa64
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -38,7 +38,3 @@ end Parslet::Atoms::DSL.infect_an_assertion :assert_parse, :must_parse, :do_not_flip Parslet::Atoms::DSL.infect_an_assertion :assert_not_parse, :must_not_parse, :do_not_flip - -Debugger.settings[:autoeval] = true -Debugger.settings[:autolist] = 1 -
Removing these Debugger settings There's no need for this to be in the repo since it can be set in ~/.rdebugrc like: ``` $ vi ~/.rdebugrc set autolist set autoeval ``` See: <URL>
zmoazeni_csscss
train
rb
239b860222928d28acb3b40b8cd956cf01709e04
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java @@ -41,6 +41,7 @@ import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.ba.AnalysisContext; import edu.umd.cs.findbugs.ba.ObjectTypeFactory; import edu.umd.cs.findbugs.ba.XClass; +import edu.umd.cs.findbugs.ba.XMethod; import edu.umd.cs.findbugs.classfile.ClassDescriptor; import edu.umd.cs.findbugs.classfile.DescriptorFactory; import edu.umd.cs.findbugs.internalAnnotations.DottedClassName; @@ -160,6 +161,10 @@ public class Subtypes2 { * @param appXClass application XClass to add to the inheritance graph */ public void addApplicationClass(XClass appXClass) { + for(XMethod m : appXClass.getXMethods()) { + if (m.isStub()) + return; + } ClassVertex vertex = addClassAndGetClassVertex(appXClass); vertex.markAsApplicationClass();
If a class has stub methods, it isn't treated as an application class git-svn-id: <URL>
spotbugs_spotbugs
train
java
1b189932593375b1116ece1dcd8e3c0f21d1757a
diff --git a/helpers/Html.php b/helpers/Html.php index <HASH>..<HASH> 100644 --- a/helpers/Html.php +++ b/helpers/Html.php @@ -351,7 +351,7 @@ class Html { } /** - * @param $text + * @param string $text * @param null $url * @param array $options * @@ -364,9 +364,20 @@ class Html { return static::tag( 'a', $text, $options ); } + + /** + * @param string $text + * @param string $email + * @param array $options + * + * @return string + */ + public static function mailto( $text, $email, $options = [] ) { + return static::a( $text, "mailto: {$email}", $options ); + } /** - * @param $src + * @param string $src * @param array $options * * @return string @@ -380,7 +391,7 @@ class Html { } /** - * @param $items + * @param array $items * @param array $options * * @return string
Add mailto method to Html class
nikonorovsv_wpf
train
php
4f53d936d547b424f331d6a376053075b567f5ce
diff --git a/rollup.config.js b/rollup.config.js index <HASH>..<HASH> 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -50,8 +50,8 @@ export default [ { input: srcEntry, output: [ - { file: pkg.main, format: 'cjs' }, - { file: pkg.module, format: 'es' } + { file: pkg.main, format: 'cjs', exports: 'default' }, + { file: pkg.module, format: 'es', exports: 'default' } ], external: [ 'min-dash',
chore: disable bundle warning We're fine with ESM / CommonJS non-interoperability.
bpmn-io_bpmn-moddle
train
js
ec9067a35b805ca7ae2b6d11597f14fbf07c21e6
diff --git a/localfs.js b/localfs.js index <HASH>..<HASH> 100644 --- a/localfs.js +++ b/localfs.js @@ -281,7 +281,7 @@ module.exports = function setup(fsOptions) { meta.etag = calcEtag(stat); // ETag support - if (options.etag === meta.etag) { + if (stat.mtime % 1000 && options.etag === meta.etag) { meta.notModified = true; fs.close(fd); return callback(null, meta); @@ -350,7 +350,7 @@ module.exports = function setup(fsOptions) { // ETag support meta.etag = calcEtag(stat); - if (options.etag === meta.etag) { + if (stat.mtime % 1000 && options.etag === meta.etag) { meta.notModified = true; return callback(null, meta); }
Fixed caching issue in vfs
c9_vfs-local
train
js
cb344e460838a03fab2924017391a5982f19808f
diff --git a/scout/parse/ensembl.py b/scout/parse/ensembl.py index <HASH>..<HASH> 100644 --- a/scout/parse/ensembl.py +++ b/scout/parse/ensembl.py @@ -43,6 +43,7 @@ def parse_ensembl_line(line, header): ensembl_info = read_transcript_info(ensembl_info, word, value) ensembl_info = read_exon_info(ensembl_info, word, value) ensembl_info = read_utr_info(ensembl_info, word, value) + ensembl_info = read_refseq_info(ensembl_info, word, value) return ensembl_info
Bugfix: Function Was Not Called
Clinical-Genomics_scout
train
py
8280ef7e2f5aad1d4f02ce2ffedcacfd7c3e8a23
diff --git a/test/all.js b/test/all.js index <HASH>..<HASH> 100644 --- a/test/all.js +++ b/test/all.js @@ -6,9 +6,20 @@ describe('hanzidecomposer', function(){ it('checks if component exists', function() { assert(hanzi.ifComponentExists('爱')); }); + it("checks if component don't exist", function() { + assert(!hanzi.ifComponentExists('$')); + }); it('detects invalid input', function() { - assert.equal(hanzi.decompose('a'), 'Invalid Input'); + assert.deepEqual(hanzi.decompose('a'), {"character":"a","components1":["a"],"components2":["a"],"components3":["a"]}); + }); + + it("gets a character's pinyin", function() { + assert.deepEqual(hanzi.getPinyin('的'), ['de5', 'di2', 'di4']); + }); + + it("gets a radical's meaning", function() { + assert(hanzi.getRadicalMeaning('氵'), "water"); }); it('should once decompose simplified character', function(){
Added more unit tests (ifComponentExists, getRadicalMeaning, getPinyin)
nieldlr_hanzi
train
js
d29d5592b42903cc25324ae9dea4cc18b5a83fb4
diff --git a/agrona/src/main/java/org/agrona/MarkFile.java b/agrona/src/main/java/org/agrona/MarkFile.java index <HASH>..<HASH> 100644 --- a/agrona/src/main/java/org/agrona/MarkFile.java +++ b/agrona/src/main/java/org/agrona/MarkFile.java @@ -582,13 +582,10 @@ public class MarkFile implements AutoCloseable if (shouldPreExist) { - final int minExpectedLength = Math.max( - versionFieldOffset + SIZE_OF_INT, timestampFieldOffset + SIZE_OF_LONG); - - if (buffer.capacity() < minExpectedLength) + if (buffer.capacity() < (timestampFieldOffset + SIZE_OF_LONG)) { throw new IllegalStateException("active MarkFile too short capacity=" + buffer.capacity() + - " < " + minExpectedLength); + " < " + (timestampFieldOffset + SIZE_OF_LONG)); } final int version = buffer.getIntVolatile(versionFieldOffset);
Simplify check in mapNewOrExisting to account for validation of version & timestamp offsets.
real-logic_agrona
train
java
f026920603d55ddfc69262729854e46cc1a024d4
diff --git a/spec/hostname_spec.rb b/spec/hostname_spec.rb index <HASH>..<HASH> 100644 --- a/spec/hostname_spec.rb +++ b/spec/hostname_spec.rb @@ -3,7 +3,7 @@ require 'nmap/hostname' describe Hostname do describe "#to_s" do - let(:type) { :user } + let(:type) { 'user' } let(:name) { 'scanme.nmap.org' } subject { described_class.new(type, name) }
type for Hostname should be a String.
sophsec_ruby-nmap
train
rb
3bbbf08786dfbb8ed3205f0581db0dcd7c186288
diff --git a/packages/node_modules/pouchdb-route/lib/index.js b/packages/node_modules/pouchdb-route/lib/index.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/pouchdb-route/lib/index.js +++ b/packages/node_modules/pouchdb-route/lib/index.js @@ -28,7 +28,10 @@ module.exports = function route(PouchDB, req, options) { } if (req.query) { for (var key in req.query) { - if (req.query.hasOwnProperty(key)) { + // Object returned by the `querystring` module on Node doesn't have the + // `hasOwnProperty()` method for some reasons, so we can't just do + // `req.query.hasOwnProperty()`. + if (Object.prototype.hasOwnProperty.call(req.query, key)) { try { req.query[key] = JSON.parse(req.query[key]); } catch (e) {
Fix issue in pouchdb-route. Object returned by the `querystring` module on Node doesn't have the `hasOwnProperty()` method for some reasons.
pouchdb_pouchdb-server
train
js
8203bdeb77ac0d3f32f1a88304b9a34de66ae7b6
diff --git a/sos/plugins/ovirt_hosted_engine.py b/sos/plugins/ovirt_hosted_engine.py index <HASH>..<HASH> 100644 --- a/sos/plugins/ovirt_hosted_engine.py +++ b/sos/plugins/ovirt_hosted_engine.py @@ -48,6 +48,12 @@ class OvirtHostedEngine(Plugin, RedHatPlugin): '/var/log/ovirt-hosted-engine-ha/agent.log', '/var/log/ovirt-hosted-engine-ha/broker.log', ]) + + # Add gluster deployment and cleanup log + self.add_copy_spec([ + '/var/log/cockpit/ovirt-dashboard' + ]) + # Add older ovirt-hosted-engine-ha log files only if requested if self.get_option('all_logs'): self.add_copy_spec(self.HA_LOG_GLOB)
[ovirt_hosted_engine] Add gluster deployment and cleanup log Resolves: #<I>
sosreport_sos
train
py
e266750ccbaf4ffcef3fbb716925057ff00483eb
diff --git a/Services/NyrodevService.php b/Services/NyrodevService.php index <HASH>..<HASH> 100644 --- a/Services/NyrodevService.php +++ b/Services/NyrodevService.php @@ -30,6 +30,10 @@ class NyrodevService extends AbstractService $this->get('translator')->setLocale($locale); } + if (!defined('NYRO_LOCALE')) { + define(NYRO_LOCALE, $locale); + } + $locales = [ $locale, $locale.'@euro',
Set NYRO_LOCALE constant
nyroDev_UtilityBundle
train
php
9de9c7123751996759ca7d20ae90f97f20be8b68
diff --git a/hypervisor/qemu/qemu.go b/hypervisor/qemu/qemu.go index <HASH>..<HASH> 100644 --- a/hypervisor/qemu/qemu.go +++ b/hypervisor/qemu/qemu.go @@ -9,6 +9,7 @@ import ( "path/filepath" "strconv" "strings" + "syscall" "github.com/golang/glog" "github.com/hyperhq/runv/hypervisor" @@ -118,6 +119,10 @@ func (qd *QemuDriver) LoadContext(persisted map[string]interface{}) (hypervisor. if err != nil { return nil, err } + // test if process has already exited + if err = proc.Signal(syscall.Signal(0)); err != nil { + return nil, fmt.Errorf("signal 0 on Qemu process(%d) failed: %v", int(p.(float64)), err) + } default: return nil, errors.New("wrong pid field type in persist info") }
test qemu process with signal 0 when loading qemu
hyperhq_runv
train
go
a3e696f47b644b3fbaba65e8a9f7a32cc832519d
diff --git a/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_SUNLDAP_SSLTest.java b/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_SUNLDAP_SSLTest.java index <HASH>..<HASH> 100755 --- a/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_SUNLDAP_SSLTest.java +++ b/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_SUNLDAP_SSLTest.java @@ -41,7 +41,7 @@ import componenttest.topology.impl.LibertyServerFactory; import componenttest.topology.utils.LDAPUtils; @RunWith(FATRunner.class) -@Mode(TestMode.LITE) +@Mode(TestMode.FULL) public class URAPIs_SUNLDAP_SSLTest { private static LibertyServer server = LibertyServerFactory.getLibertyServer("com.ibm.ws.security.wim.adapter.ldap.fat.sun.ssl"); private static final Class<?> c = URAPIs_SUNLDAP_SSLTest.class;
moved URAPIs_SUNLDAP_SSLTest to FULL
OpenLiberty_open-liberty
train
java
50fd92dc30cdfb89d83054e8cc8f5294d807f943
diff --git a/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java b/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java +++ b/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java @@ -58,23 +58,30 @@ public abstract class ProcessingUnit { * Initializes the ProcessingUnit to the empty state. */ public ProcessingUnit(final CompilerConfiguration configuration, final GroovyClassLoader classLoader, final ErrorCollector errorCollector) { + setConfiguration(configuration != null ? configuration : CompilerConfiguration.DEFAULT); setClassLoader(classLoader); - configure(configuration != null ? configuration : CompilerConfiguration.DEFAULT); this.errorCollector = errorCollector != null ? errorCollector : new ErrorCollector(getConfiguration()); + configure(getConfiguration()); } /** * Reconfigures the ProcessingUnit. */ public void configure(CompilerConfiguration configuration) { - this.configuration = configuration; + setConfiguration(configuration); } + /** + * Get the CompilerConfiguration for this ProcessingUnit. + */ public CompilerConfiguration getConfiguration() { return configuration; } - public void setConfiguration(CompilerConfiguration configuration) { + /** + * Sets the CompilerConfiguration for this ProcessingUnit. + */ + public final void setConfiguration(CompilerConfiguration configuration) { this.configuration = configuration; }
GROOVY-<I>: code smell in ProcessingUnit
apache_groovy
train
java
26c86e7e407759a5973af95ce85d8711e9b69040
diff --git a/dispatch/static/manager/src/js/components/EventEditor/EventForm.js b/dispatch/static/manager/src/js/components/EventEditor/EventForm.js index <HASH>..<HASH> 100644 --- a/dispatch/static/manager/src/js/components/EventEditor/EventForm.js +++ b/dispatch/static/manager/src/js/components/EventEditor/EventForm.js @@ -153,6 +153,17 @@ export default class EventForm extends React.Component { </FormInput> <FormInput + label='Ticket Link' + padded={false} + error={this.props.errors.ticket_url}> + <TextInput + placeholder='Ticket Link' + value={this.props.listItem.ticket_url || ''} + fill={true} + onChange={ e => this.props.update('ticket_url', e.target.value) } /> + </FormInput> + + <FormInput label='Submitter Email' padded={false} error={this.props.errors.submitter_email}>
Added ticket link to event form on admin panel
ubyssey_dispatch
train
js
8970a4f5e0d1e7c58d245e8f7bb6ff3044d7b692
diff --git a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php index <HASH>..<HASH> 100644 --- a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php +++ b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php @@ -31,6 +31,7 @@ class Normalizer /** * @var array * @see https://secure.php.net/manual/en/reserved.keywords.php + * @see https://www.php.net/manual/en/reserved.other-reserved-words.php */ private static $reservedKeywords = [ '__halt_compiler', @@ -100,7 +101,21 @@ class Normalizer 'while', 'xor', 'yield', - 'void' + 'void', + + // Other reserved words: + 'int', + 'true', + 'false', + 'null', + 'void', + 'bool', + 'float', + 'string', + 'object', + 'resource', + 'mixed', + 'numeric' ]; /**
Add other reserved keywords (#<I>)
phpro_soap-client
train
php
6796e47c8531f0cbd4a6fe0701df2bf6a1187466
diff --git a/tests/test_validator.py b/tests/test_validator.py index <HASH>..<HASH> 100755 --- a/tests/test_validator.py +++ b/tests/test_validator.py @@ -35,7 +35,7 @@ def test_validate_subject_sample_factors(file_source): def test_validate_subject_sample_factors(file_source): mwfile = next(mwtab.read_files(file_source)) _, validation_log = mwtab.validate_file(mwfile, metabolites=False) - assert "Section missing data entry for sample(s):" in validation_log + # assert "Section missing data entry for sample(s):" in validation_log assert "SUBJECT_SAMPLE_FACTORS: Section missing sample ID(s)" in validation_log
Removes twst for data in _DATA sections for each sample listed in the SUBJECT_SAMPLE_FACTORS section.
MoseleyBioinformaticsLab_mwtab
train
py
4ebeab8f8746d43238fcc48dc3c65fc97dc602f8
diff --git a/src/main/python/rlbot/version.py b/src/main/python/rlbot/version.py index <HASH>..<HASH> 100644 --- a/src/main/python/rlbot/version.py +++ b/src/main/python/rlbot/version.py @@ -3,9 +3,18 @@ # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module # https://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package -__version__ = '1.0.6' +__version__ = '1.1.0' release_notes = { + '1.1.0': """ + You can now get information about the ball's status in Dropshot mode thanks to hallo_doei! + Read all about it at https://github.com/RLBot/RLBot/wiki/Dropshot + + Other changes: + - Fixed a bug where the GUI would crash with a "KeyError". - hallo_doei + - Avoiding and suppressing some game crashes, and also restoring the + ability to get game tick data during replays and the postgame. - tarehart + """, '1.0.6': """ The latest Rocket League patch broke dodges for our bots; this update fixes it. """,
Creating release notes for version <I>. (#<I>)
RLBot_RLBot
train
py
9d7d5c157531b64f5af177ae87d0f5c9c936b45a
diff --git a/tests/integration/test.changes.js b/tests/integration/test.changes.js index <HASH>..<HASH> 100644 --- a/tests/integration/test.changes.js +++ b/tests/integration/test.changes.js @@ -905,6 +905,12 @@ adapters.forEach(function (adapter) { }); it('changes w/ many modifications of same doc', function () { + // this test depends on the order of changes + // so fails against CouchDB 2 when multiple shards are present + if (testUtils.isCouchMaster()) { + return true; + } + var db = new PouchDB(dbs.name); var promise = testUtils.Promise.resolve(); var doc = {_id: '1'}; @@ -925,6 +931,7 @@ adapters.forEach(function (adapter) { ]); }).then(function () { return db.changes({since: 0, limit: 3}).then(function (res) { + normalizeResult(res); res.results.map(function (x) { delete x.changes; delete x.seq;
skip unreliable changes test in CouchDB master
pouchdb_pouchdb
train
js
d8586fc43a11d232b26adc5f0397045b0d2d14b9
diff --git a/examples/task.php b/examples/task.php index <HASH>..<HASH> 100644 --- a/examples/task.php +++ b/examples/task.php @@ -50,7 +50,7 @@ class VaultTask { if (!$this->factory) { $options = []; - $options['defaults']['headers']['X-Vault-Token'] = $this->getVaultToken(); + $options['headers']['X-Vault-Token'] = $this->getVaultToken(); $this->factory = new VaultFactory($options); }
Fixed incorrect example that was causing missing token error
jippi_vault-php-sdk
train
php
50dfb9390e75a5bc480e77473fc0e102a37121c7
diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -355,10 +355,6 @@ class REST extends \Codeception\Module { $this->debugSection("Request headers", $this->headers); - if ($parameters instanceof \JsonSerializable) { - $parameters = $parameters->jsonSerialize(); - } - foreach ($this->headers as $header => $val) { $header = str_replace('-','_',strtoupper($header)); $this->client->setServerParameter("HTTP_$header", $val);
Reverted unnecessary and not working fix inspired by scrutinizer #<I>
Codeception_base
train
php
2f24bf64c2a3f2b5e9ffaa0aa91c8a8b52118aa8
diff --git a/pyani/pyani_graphics.py b/pyani/pyani_graphics.py index <HASH>..<HASH> 100644 --- a/pyani/pyani_graphics.py +++ b/pyani/pyani_graphics.py @@ -18,16 +18,20 @@ from math import floor, log10 # Define custom matplotlib colourmaps # 1) Map for species boundaries (95%: 0.95), blue for values at -# 0.9 or below, red for values at 1.0; white at 0.95 -cdict_spbnd_BuRd = {'red': ((0.0, 0.0, 0.0), +# 0.9 or below, red for values at 1.0; white at 0.95. +# Also, anything below 0.7 is 70% grey +cdict_spbnd_BuRd = {'red': ((0.0, 0.0, 0.7), + (0.7, 0.7, 0.0), (0.9, 0.0, 0.0), (0.95, 1.0, 1.0), (1.0, 1.0, 1.0)), - 'green': ((0.0, 0.0, 0.0), + 'green': ((0.0, 0.0, 0.7), + (0.7, 0.7, 0.0), (0.9, 0.0, 0.0), (0.95, 1.0, 1.0), (1.0, 0.0, 0.0)), - 'blue': ((0.0, 1.0, 1.0), + 'blue': ((0.0, 0.0, 0.7), + (0.7, 0.7, 1.0), (0.95, 1.0, 1.0), (1.0, 0.0, 0.0))} cmap_spbnd_BuRd = LinearSegmentedColormap("spbnd_BuRd", cdict_spbnd_BuRd)
pyani_graphics.py: Modified spbnd_BuRd colormap
widdowquinn_pyani
train
py
fe039573b757a05f0d1266dd5d9610767ae55e30
diff --git a/pkg/util/mount/mount_unsupported.go b/pkg/util/mount/mount_unsupported.go index <HASH>..<HASH> 100644 --- a/pkg/util/mount/mount_unsupported.go +++ b/pkg/util/mount/mount_unsupported.go @@ -48,10 +48,6 @@ func (mounter *Mounter) PathIsDevice(pathname string) (bool, error) { return true, nil } -func (mounter *Mounter) GetDeviceNameFromMount(mountPath, pluginDir string) (string, error) { - return "", nil -} - func (mounter *SafeFormatAndMount) formatAndMount(source string, target string, fstype string, options []string) error { return nil }
pkg/util/mount: remove method redeclaration Fix the `GetDeviceNameFromMount` method thats declared twice.
kubernetes_kubernetes
train
go
869b78d33d1127b2db2c28a6507dfbb625c3c4d1
diff --git a/zhaquirks/tuya/ts0601.py b/zhaquirks/tuya/ts0601.py index <HASH>..<HASH> 100644 --- a/zhaquirks/tuya/ts0601.py +++ b/zhaquirks/tuya/ts0601.py @@ -38,6 +38,7 @@ class TuyaSingleSwitch(TuyaSwitch): ("_TZE200_vhy3iakz", "TS0601"), ("_TZ3000_uim07oem", "TS0601"), ("_TZE200_tz32mtza", "TS0601"), + ("_TZE200_amp6tsvy", "TS0601"), ], ENDPOINTS: { 1: {
Added Meos Touch Switch 1 Gang EU (#<I>)
dmulcahey_zha-device-handlers
train
py
914d9e388fb3ff67fae14f0085e24a7140dada71
diff --git a/opsfrontiers.py b/opsfrontiers.py index <HASH>..<HASH> 100644 --- a/opsfrontiers.py +++ b/opsfrontiers.py @@ -23,13 +23,20 @@ class OPSFrontiers(opsgenerator.OPSGenerator): self.doi_frag = self.doi.split('10.3389/')[1] self.makeFragmentIdentifiers() self.ops_dir = os.path.join(output_dir, 'OPS') + self.createSynopsis() def createSynopsis(self): """ This method encapsulates the functions necessary to create the synopsis segment of the article. """ - pass + self.doc = self.makeDocument('synop') + body = self.doc.getElementsByTagName('body')[0] + title = self.appendNewElement('h1', body) + self.setSomeAttributes(title, {'id': 'title', + 'class': 'article-title'}) + title.childNodes = self.metadata.title.article_title.childNodes + print(self.doc.toprettyxml(encoding='utf-8')) def createMain(self): """ @@ -73,4 +80,3 @@ import article mydoc = article.Article('downloaded_xml_files/fimmu-03-00104.xml') myops = OPSFrontiers(mydoc, os.path.join('output', 'fimmu-03-00104')) print(myops.doi) -
createSynopsis() now successfully pulls childNodes from the article_title in metadata to add them to the synopsis document
SavinaRoja_OpenAccess_EPUB
train
py
2dd8a0215c9d06fe669e1ba630dbe5b17dc10b60
diff --git a/lib/authCodeGrant.js b/lib/authCodeGrant.js index <HASH>..<HASH> 100644 --- a/lib/authCodeGrant.js +++ b/lib/authCodeGrant.js @@ -119,6 +119,8 @@ function checkClient (done) { return done(error('invalid_request', 'redirect_uri does not match')); } + // Make the request redirectUri as the client's redirectUri + client.redirectUri = self.redirectUri; // The request contains valid params so any errors after this point // are redirected to the redirect_uri self.res.oauthRedirect = true;
Fix authCodeGrant bug. Make the request redirectUri as the client's redirectUri. This is correct when client.redirectUri is an Array type.
oauthjs_node-oauth2-server
train
js
074d9bfd5476d0430e75073fb27001f43435c081
diff --git a/src/main/java/org/jsoup/nodes/Node.java b/src/main/java/org/jsoup/nodes/Node.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jsoup/nodes/Node.java +++ b/src/main/java/org/jsoup/nodes/Node.java @@ -210,7 +210,9 @@ public abstract class Node implements Cloneable { @return list of children. If no children, returns an empty list. */ public List<Node> childNodes() { - return Collections.unmodifiableList(childNodes); + // actually returns the real list, as this method is hit many times during selection, and so is a GC time-sink + // leaving the documentation as is (warning of unmodifiability) to discourage out-of-API modifications + return childNodes; } protected Node[] childNodesAsArray() {
To save GC time in select, don't wrap childnodes in unmodifiable list.
jhy_jsoup
train
java
9c84f4d79fe778ec8f5874a2468ff72fb3d3dda1
diff --git a/src/Composer/Repository/RepositorySet.php b/src/Composer/Repository/RepositorySet.php index <HASH>..<HASH> 100644 --- a/src/Composer/Repository/RepositorySet.php +++ b/src/Composer/Repository/RepositorySet.php @@ -22,6 +22,7 @@ use Composer\Repository\CompositeRepository; use Composer\Repository\PlatformRepository; use Composer\Repository\LockArrayRepository; use Composer\Repository\InstalledRepositoryInterface; +use Composer\Repository\InstalledRepository; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Package\Version\StabilityFilter; @@ -190,7 +191,7 @@ class RepositorySet $poolBuilder = new PoolBuilder($this->acceptableStabilities, $this->stabilityFlags, $this->rootAliases, $this->rootReferences, $eventDispatcher); foreach ($this->repositories as $repo) { - if ($repo instanceof InstalledRepositoryInterface && !$this->allowInstalledRepositories) { + if (($repo instanceof InstalledRepositoryInterface || $repo instanceof InstalledRepository) && !$this->allowInstalledRepositories) { throw new \LogicException('The pool can not accept packages from an installed repository'); } }
Make sure InstalledRepository itself can be added too but requires allowing installed repos in reposet
composer_composer
train
php
acd5dd292d1f95e12b60602d103c41d72402633d
diff --git a/lib/steam/community/SteamId.php b/lib/steam/community/SteamId.php index <HASH>..<HASH> 100644 --- a/lib/steam/community/SteamId.php +++ b/lib/steam/community/SteamId.php @@ -241,7 +241,7 @@ class SteamId { $this->friends = array(); $friendsData = new SimpleXMLElement(file_get_contents($url)); foreach($friendsData->friends->friend as $friend) { - $this->friends[] = SteamId::create((string) $friend, true); + $this->friends[] = SteamId::create((string) $friend, false); } }
PHP: Fixed friends being fetched immediately
koraktor_steam-condenser-php
train
php
fb1df634e236acb137403dc748200202f6462328
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -2,9 +2,9 @@ #-*- coding:utf-8 -*- -########################################################################## -# This test has been performed with a default rexster-0.4.1 distribution # -########################################################################## +############################################################################### +# This test has been performed with a default neo4j-community-1.3 distribution# +############################################################################### import unittest from pyblueprints.neo4j import *
Fixed comment about the distribution used in tests
escalant3_pyblueprints
train
py
a6e479f280796cda232a1fb740ca16de3cb0a7dc
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorPartitionLifecycleTest.java @@ -197,7 +197,7 @@ public class TaskExecutorPartitionLifecycleTest extends TestLogger { trackerIsTrackingPartitions.set(false); // the TM should check whether partitions are still stored, and afterwards terminate the connection - releaseOrPromoteCall.accept(taskExecutor, jobId, resultPartitionId); + releaseOrPromoteCall.accept(taskExecutorGateway, jobId, resultPartitionId); disconnectFuture.get(); } finally {
[hotfix][tests] Use self gateway in TaskExecutorPartitionLifecycleTest.testJobMasterConnectionTerminationAfterExternalReleaseOrPromotion The test used the RpcEndpoint in order to call Rpcs instead of the self gateway. This violated the RpcEndpoint contract and caused concurrent modifications of the RpcEndpoint's state.
apache_flink
train
java
dceba61e2602b64978de1b9ab2cb1133749549a3
diff --git a/src/Google/Service/Directory/User.php b/src/Google/Service/Directory/User.php index <HASH>..<HASH> 100644 --- a/src/Google/Service/Directory/User.php +++ b/src/Google/Service/Directory/User.php @@ -36,6 +36,8 @@ class Google_Service_Directory_User extends Google_Collection public $ipWhitelisted; public $isAdmin; public $isDelegatedAdmin; + public $isEnforcedIn2Sv; + public $isEnrolledIn2Sv; public $isMailboxSetup; public $kind; public $lastLoginTime; @@ -199,6 +201,22 @@ class Google_Service_Directory_User extends Google_Collection { return $this->isDelegatedAdmin; } + public function setIsEnforcedIn2Sv($isEnforcedIn2Sv) + { + $this->isEnforcedIn2Sv = $isEnforcedIn2Sv; + } + public function getIsEnforcedIn2Sv() + { + return $this->isEnforcedIn2Sv; + } + public function setIsEnrolledIn2Sv($isEnrolledIn2Sv) + { + $this->isEnrolledIn2Sv = $isEnrolledIn2Sv; + } + public function getIsEnrolledIn2Sv() + { + return $this->isEnrolledIn2Sv; + } public function setIsMailboxSetup($isMailboxSetup) { $this->isMailboxSetup = $isMailboxSetup;
Autogenerated update for admin version directory_v1 (<I>-<I>-<I>)
googleapis_google-api-php-client-services
train
php
aa3fbfeedfd780aa1b39e333a7f56a2534ffd977
diff --git a/lib/transform.js b/lib/transform.js index <HASH>..<HASH> 100644 --- a/lib/transform.js +++ b/lib/transform.js @@ -50,7 +50,7 @@ import once from './internal/once'; * }) */ export default function transform (coll, accumulator, iteratee, callback) { - if (arguments.length === 3) { + if (arguments.length <= 3) { callback = iteratee; iteratee = accumulator; accumulator = isArray(coll) ? [] : {};
Make async.transform actually support 2 arguments The documentation suggests that both the `accumulator` and `callback` arguments to transform is optional. However, if both are left out (and transform therefore is called with only 2 arguments), transform crashes with a `iteratee is not a function` exception. This fixes that.
caolan_async
train
js
9c507d61233d400e1a01c6eabbdeef7dc3e085bc
diff --git a/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java b/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java index <HASH>..<HASH> 100644 --- a/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java +++ b/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryService.java @@ -147,7 +147,7 @@ public class RepositoryService implements AdministeredService { CheckArg.isNotNull(context, "context"); if (pathToConfigurationRoot == null) pathToConfigurationRoot = context.getValueFactories() .getPathFactory() - .create("/dna:system"); + .create("/jcr:system"); this.sources = sources; this.pathToConfigurationRoot = pathToConfigurationRoot; this.configurationSourceName = configurationSourceName;
DNA-<I> Repository example uses different path in configuration repository than assumed by RepositoryService Changed RepositoryService to use '/jcr:system' as the default path, since that makes for better integration git-svn-id: <URL>
ModeShape_modeshape
train
java
60cb96abead70eb9d510efd56013ec705baf0d63
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -402,16 +402,13 @@ module ActiveRecord return memory if persisted.empty? persisted.map! do |record| + # Unfortunately we cannot simply do memory.delete(record) since on 1.8 this returns + # record rather than memory.at(memory.index(record)). The behaviour is fixed in 1.9. + mem_index = memory.index(record) - # To work with ruby 1.8.7 - # > 1.9 #=> mem_record = memory.delete(record) - mem_record_index = memory.index(record) - if mem_record_index - mem_record = memory.at(mem_record_index) - memory.delete_at(mem_record_index) - end + if mem_index + mem_record = memory.delete_at(mem_index) - if mem_record (record.attribute_names - mem_record.changes.keys).each do |name| mem_record[name] = record[name] end
Implementing @dmathieu's cleaner fix from #<I>. Unfortunately he deleted the branch so I cannot just merge it.
rails_rails
train
rb
9ba4d6e9d76e41f898eefdde20d24ae184b152e6
diff --git a/pyad2usb/ad2usb.py b/pyad2usb/ad2usb.py index <HASH>..<HASH> 100644 --- a/pyad2usb/ad2usb.py +++ b/pyad2usb/ad2usb.py @@ -167,10 +167,10 @@ class AD2USB(object): on_write = event.Event('Called when data has been written to the device.') # Constants - F1 = str(1) + str(1) + str(1) - F2 = str(2) + str(2) + str(2) - F3 = str(3) + str(3) + str(3) - F4 = str(4) + str(4) + str(4) + F1 = unichr(1) + unichr(1) + unichr(1) + F2 = unichr(2) + unichr(2) + unichr(2) + F3 = unichr(3) + unichr(3) + unichr(3) + F4 = unichr(4) + unichr(4) + unichr(4) def __init__(self, device): """ diff --git a/test.py b/test.py index <HASH>..<HASH> 100755 --- a/test.py +++ b/test.py @@ -222,8 +222,8 @@ def test_socket(): a2u.open() #a2u.reboot() - time.sleep(2) a2u.get_config() + print pyad2usb.ad2usb.AD2USB.F1 print dev._id
Corrected F-keys, though its still untested.
nutechsoftware_alarmdecoder
train
py,py
143f91ea7e7030defac9bcd4d57ce9481d9c2a76
diff --git a/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb b/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb @@ -47,7 +47,6 @@ module ActiveRecord SQL end - # Needs to consider how to support synonyms in Rails 5.1 def data_source_exists?(table_name) (_owner, table_name, _db_link) = @connection.describe(table_name) true
synonyms are part of data_sources [skip ci] Refer #<I>
rsim_oracle-enhanced
train
rb
a63d5e7a5569978fcc7f83d190b132d09e55fe9e
diff --git a/py/selenium/webdriver/remote/webdriver.py b/py/selenium/webdriver/remote/webdriver.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/remote/webdriver.py +++ b/py/selenium/webdriver/remote/webdriver.py @@ -167,11 +167,15 @@ class WebDriver(object): - javascript_enabled - Whether the new session should support JavaScript. - browser_profile - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile object. Only used if Firefox is requested. """ + capabilities = {} + for k, v in desired_capabilities.items(): + if k not in ('desiredCapabilities', 'requiredCapabilities'): + capabilities.setdefault('desiredCapabilities', {})[k] = v + else: + capabilities[k] = v if browser_profile: - desired_capabilities['firefox_profile'] = browser_profile.encoded - response = self.execute(Command.NEW_SESSION, { - 'desiredCapabilities': desired_capabilities, - }) + capabilities['requiredCapabilities']['firefox_profile'] = browser_profile.encoded + response = self.execute(Command.NEW_SESSION, capabilities) self.session_id = response['sessionId'] self.capabilities = response['value']
Ensure all capabilities are either within desiredCapabilities or requiredCapabilities
SeleniumHQ_selenium
train
py
b57f4e6321db8073b676b7eea2dbbaaaaacdeb84
diff --git a/src/index.test.js b/src/index.test.js index <HASH>..<HASH> 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -1,7 +1,5 @@ -'use strict'; - -var test = require('ava'); -var mixinable = require('./index'); +import test from 'ava'; +import * as mixinable from './index'; var async = mixinable.async; var sync = mixinable.sync;
test: convert test to esm syntax
untool_mixinable
train
js
2bf39cfdd70916b7bb8aeed19978d53b2abf7fc6
diff --git a/goof.go b/goof.go index <HASH>..<HASH> 100644 --- a/goof.go +++ b/goof.go @@ -277,6 +277,10 @@ func (e *Goof) GetLogData() map[string]interface{} { // MarshalJSON marshals this object to JSON for the encoding/json package. func (e *Goof) MarshalJSON() ([]byte, error) { + if len(e.Fields()) == 0 { + return json.Marshal(e.Error()) + } + var m map[string]interface{} if e.includeMsgInJSON {
Fixes Marshaling Bug w Message Only This patch fixes a bug where Goof errors are not properly marshaled if only a message is supplied instead of any fields.
akutz_goof
train
go
9c4345618cbd844a3e3378624176af8e67a3b25e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setup( packages=find_packages(exclude=['tests*']), install_requires=[ 'Django>=1.11', - 'graphene-django>=2.1rc0', + 'graphene-django>=2.1.0', ], classifiers=[ 'Development Status :: 1 - Planning', @@ -53,6 +53,6 @@ setup( zip_safe=False, tests_require=[ 'Django>=1.11', - 'graphene-django>=2.1rc0', + 'graphene-django>=2.1.0', ], )
Updated graphene-django req version
flavors_django-graphql-geojson
train
py
211222cc182218c06e9a1b094f48d9e96e905865
diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/notifications/fanout.rb +++ b/activesupport/lib/active_support/notifications/fanout.rb @@ -24,10 +24,11 @@ module ActiveSupport synchronize do if String === pattern @string_subscribers[pattern] << subscriber + @listeners_for.delete(pattern) else @other_subscribers << subscriber + @listeners_for.clear end - @listeners_for.clear end subscriber end @@ -37,16 +38,17 @@ module ActiveSupport case subscriber_or_name when String @string_subscribers[subscriber_or_name].clear + @listeners_for.delete(subscriber_or_name) else pattern = subscriber_or_name.try(:pattern) if String === pattern @string_subscribers[pattern].delete(subscriber_or_name) + @listeners_for.delete(pattern) else @other_subscribers.delete(subscriber_or_name) + @listeners_for.clear end end - - @listeners_for.clear end end
Keep cache for strings in notifications/fanout When adding/removing a subscription with a string pattern, it isn't necessary to clear the entire cache, only the cache for the key being added. When adding/removing subscriptions for a regex or to match all events, the full cache is still cleared.
rails_rails
train
rb
3c2bb7adfcfa32e03bd3532a5dd5ae97fc010aad
diff --git a/salt/loader.py b/salt/loader.py index <HASH>..<HASH> 100644 --- a/salt/loader.py +++ b/salt/loader.py @@ -11,7 +11,6 @@ import imp import logging import os import salt -import random from salt.exceptions import LoaderError log = logging.getLogger(__name__) @@ -207,7 +206,7 @@ class Loader(object): "modules.") return getattr(mod, fun[fun.rindex('.') + 1:])(*arg) - def gen_functions(self, pack=None): + def gen_functions(self, pack=None, virtual_enable=True): ''' Return a dict of functions found in the defined module_dirs ''' @@ -285,9 +284,10 @@ class Loader(object): except TypeError: pass - if hasattr(mod, '__virtual__'): - if callable(mod.__virtual__): - virtual = mod.__virtual__() + if virtual_enable: + if hasattr(mod, '__virtual__'): + if callable(mod.__virtual__): + virtual = mod.__virtual__() for attr in dir(mod): if attr.startswith('_'):
add a virtual_enable option to the gen_function method in the loader
saltstack_salt
train
py
efde7cc90a4b91487e83ac16cdbb6e5dfb58882d
diff --git a/lib/childprocess/version.rb b/lib/childprocess/version.rb index <HASH>..<HASH> 100644 --- a/lib/childprocess/version.rb +++ b/lib/childprocess/version.rb @@ -1,3 +1,3 @@ module ChildProcess - VERSION = '2.0.0' + VERSION = '3.0.0' end
Bump gem version to <I> Given the removal of the extension logic that conditionally installed the `ffi` gem on Windows platforms, this fundamentally changes the assumptions around what the gem installs and thus its backwards compatibility, hence necessitating a major version upgrade.
enkessler_childprocess
train
rb
fee439f6423ada2ba2d10f9078381b43f4e7e6ab
diff --git a/server/sonar-web/src/main/js/apps/system/main.js b/server/sonar-web/src/main/js/apps/system/main.js index <HASH>..<HASH> 100644 --- a/server/sonar-web/src/main/js/apps/system/main.js +++ b/server/sonar-web/src/main/js/apps/system/main.js @@ -93,7 +93,7 @@ export default React.createClass({ </li> <li> <a href={window.baseUrl + '/api/system/logs?process=web'} id="web-logs-link"> - Web + Web Server </a> </li> </ul>
SONAR-<I> fix label "Web Server" of link to logs
SonarSource_sonarqube
train
js
21a17b10721ae3666c5cef62495fa6c130c64191
diff --git a/lib/poolparty/poolparty/cloud.rb b/lib/poolparty/poolparty/cloud.rb index <HASH>..<HASH> 100644 --- a/lib/poolparty/poolparty/cloud.rb +++ b/lib/poolparty/poolparty/cloud.rb @@ -56,7 +56,7 @@ module PoolParty remote_base.dsl_options.has_key?(k) end if args.size==1 && args.first.respond_to?(:merge) - new_args = [remoter_opts.merge args.first] + new_args = [remoter_opts.merge(args.first)] else new_args = args.push(remoter_opts) end
Removed whitespace in method call (cloud.rb) to remove warning
auser_poolparty
train
rb
a62f40bec361a3697a21c1fb0032a13b0c0dcffc
diff --git a/holoviews/plotting/__init__.py b/holoviews/plotting/__init__.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/__init__.py +++ b/holoviews/plotting/__init__.py @@ -294,7 +294,9 @@ Palette.colormaps.update({cm: plt.get_cmap(cm) for cm in plt.cm.datad}) # Register default Element options Store.register_plots(style_aliases={'edgecolor': ['ec', 'ecolor'], 'facecolor': ['fc'], 'linewidth': ['lw'], 'edgecolors': ['ec', 'edgecolor'], - 'linestyle': ['ls'], 'size': ['s'], 'color': ['c']}) + 'linestyle': ['ls'], 'size': ['s'], 'color': ['c'], + 'markeredgecolor': ['mec'], 'markeredgewidth': ['mew'], + 'markerfacecolor': ['mfc'], 'markersize': ['ms']}) # Charts Store.options.Curve = Options('style', color=Cycle(), linewidth=2)
Added additional style option aliases
pyviz_holoviews
train
py
b228a18df3775f8f641d79d67d02c56dfa6ed959
diff --git a/classes/Fuel/Doctrine/Logger.php b/classes/Fuel/Doctrine/Logger.php index <HASH>..<HASH> 100644 --- a/classes/Fuel/Doctrine/Logger.php +++ b/classes/Fuel/Doctrine/Logger.php @@ -3,7 +3,7 @@ namespace Fuel\Doctrine; /** - * Log Doctrine DBAL queries to FuelPHP profiler + * Log Doctrine DBAL queries to FuelPHP profiler and internal array */ class Logger implements \Doctrine\DBAL\Logging\SQLLogger { @@ -12,6 +12,9 @@ class Logger implements \Doctrine\DBAL\Logging\SQLLogger /** @var mixed */ protected $benchmark; + + /** @var array */ + protected $queries = array(); /** * @param string $db_name database name to save in profiler @@ -78,6 +81,7 @@ class Logger implements \Doctrine\DBAL\Logging\SQLLogger } $this->benchmark = \Profiler::start("Database (Doctrine: $this->db_name)", $sql); + $this->queries[] = $sql; } public function stopQuery() @@ -88,4 +92,12 @@ class Logger implements \Doctrine\DBAL\Logging\SQLLogger $this->benchmark = null; } } + + /** + * @return array + */ + public function getQueries() + { + return $this->queries; + } }
Also store logged queries in internal array
aspendigital_fuel-doctrine2
train
php
a7e3487a96d181d3af8e15793f0a0cf72abe0775
diff --git a/asyncirc/ircbot.py b/asyncirc/ircbot.py index <HASH>..<HASH> 100644 --- a/asyncirc/ircbot.py +++ b/asyncirc/ircbot.py @@ -20,7 +20,7 @@ else: from .ircclient import IRCClient #Somewhat complex regex that accurately matches nick!username@host, with named groups for easy parsing and usage -user_re = re.compile(r'(?P<nick>[\w\d<-\[\]\^\{\}]+)!(?P<user>[\w\d<-\[\]\^\{\}]+)@(?P<host>.+)') +user_re = re.compile(r'(?P<nick>[\w\d<-\[\]\^\{\}\~]+)!(?P<user>[\w\d<-\[\]\^\{\}\~]+)@(?P<host>.+)') class IRCBot(IRCClient): '''See `IRCClient` for basic client usage, here is usage for the bot system @@ -168,4 +168,4 @@ class IRCBot(IRCClient): self._handlers['nick'].append(func) return func -__all__ = ['IRCBot'] \ No newline at end of file +__all__ = ['IRCBot']
Fixed user ident regex does ignore things like: `:noqqe!~noqqe@unaffiliated/noqqe`
kageurufu_AsyncIRC
train
py
0a560aae79face05679852d9d9b5c3d23010aaa6
diff --git a/lib/oxidized/model/ciscosmb.rb b/lib/oxidized/model/ciscosmb.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/model/ciscosmb.rb +++ b/lib/oxidized/model/ciscosmb.rb @@ -1,6 +1,6 @@ class CiscoSMB < Oxidized::Model - # Cisco Small Business 200, 300, 500, and ESW2 series switches + # Cisco Small Business 300, 500, and ESW2 series switches # http://www.cisco.com/c/en/us/support/switches/small-business-300-series-managed-switches/products-release-notes-list.html prompt /^\r?([\w.@()-]+[#>]\s?)$/
Update ciscosmb.rb Cisco SG<I> series do not support SSH
ytti_oxidized
train
rb
68d13e3176c23e3fbb8c16742d3dc93d41e6236e
diff --git a/src/parser/try.js b/src/parser/try.js index <HASH>..<HASH> 100644 --- a/src/parser/try.js +++ b/src/parser/try.js @@ -17,12 +17,13 @@ module.exports = function(api, tokens, EOF) { read_try: function() { // @todo implement the short form of declarations - this.expect(tokens.T_TRY).nextWithComments(); + this.expect(tokens.T_TRY); - var code = this.read_statement(); + var code = this.nextWithComments().read_statement(); var allways = false; var catches = []; - + + this.ignoreComments(); while(this.token === tokens.T_CATCH) { this.next().expect('(').next(); var exName = this.read_namespace_name(); @@ -33,6 +34,7 @@ module.exports = function(api, tokens, EOF) { as: varName, body: this.read_statement() }); + this.ignoreComments(); } if (this.token === tokens.T_FINALLY) { allways = this.nextWithComments().read_statement();
fix comments on try / catch structure
glayzzle_php-parser
train
js
39232f4e4330f409f4d3abd6cf0a134db2f2a4db
diff --git a/tensor2tensor/serving/serving_utils.py b/tensor2tensor/serving/serving_utils.py index <HASH>..<HASH> 100644 --- a/tensor2tensor/serving/serving_utils.py +++ b/tensor2tensor/serving/serving_utils.py @@ -23,6 +23,7 @@ import base64 import functools from googleapiclient import discovery import grpc +import numpy as np from tensor2tensor import problems as problems_lib # pylint: disable=unused-import from tensor2tensor.data_generators import text_encoder @@ -140,8 +141,12 @@ def make_cloud_mlengine_request_fn(credentials, model_name, version): } } for ex in examples] } - prediction = api.projects().predict(body=input_data, name=parent).execute() - return prediction["predictions"] + response = api.projects().predict(body=input_data, name=parent).execute() + predictions = response["predictions"] + for prediction in predictions: + prediction["outputs"] = np.array([prediction["outputs"]]) + prediction["scores"] = np.array(prediction["scores"]) + return predictions return _make_cloud_mlengine_request
Fix serving response from Cloud ML Engine (#<I>)
tensorflow_tensor2tensor
train
py
1807c05359ce67d36641855f8f6422d2a213f08e
diff --git a/mousetrap.js b/mousetrap.js index <HASH>..<HASH> 100644 --- a/mousetrap.js +++ b/mousetrap.js @@ -548,7 +548,7 @@ window.Mousetrap = (function() { // if this is not a keypress event then we should // be smart about using shift keys // this will only work for US keyboards however - if (action != 'keypress' && _SHIFT_MAP[key]) { + if (action && action != 'keypress' && _SHIFT_MAP[key]) { key = _SHIFT_MAP[key]; modifiers.push('shift'); }
Make sure there is an action before checking shift map
ccampbell_mousetrap
train
js