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
0e70ec035abb48e0a178134921b7e8773ea777be
diff --git a/packages/metascraper-media-provider/src/get-media/provider/generic.js b/packages/metascraper-media-provider/src/get-media/provider/generic.js index <HASH>..<HASH> 100644 --- a/packages/metascraper-media-provider/src/get-media/provider/generic.js +++ b/packages/metascraper-media-provider/src/get-media/provider/generic.js @@ -41,7 +41,7 @@ module.exports = ({ getTunnel, onError, userAgent, cacheDir }) => { do { try { const agent = isTwitterUrl(url) && retry.val() ? await getAgent({ tunnel }) : undefined - debug(`getInfo retry=${retry.val()} agent=${false} url=${url} flags=${flags.join(' ')}`) + debug(`getInfo retry=${retry.val()} agent=${!!agent} url=${url} flags=${flags.join(' ')}`) data = await getInfo(url, agent ? flags.concat(`--proxy=${proxyUri(agent)}`) : flags) } catch (err) { retry.incr()
fix: check if agent is an object
microlinkhq_metascraper
train
js
539ab459e4e72e879db97f8dda9b71271bba718a
diff --git a/app/models/kalibro_configuration.rb b/app/models/kalibro_configuration.rb index <HASH>..<HASH> 100644 --- a/app/models/kalibro_configuration.rb +++ b/app/models/kalibro_configuration.rb @@ -1 +1,3 @@ -class KalibroConfiguration < KalibroClient::Entities::Configurations::KalibroConfiguration; end +class KalibroConfiguration < KalibroClient::Entities::Configurations::KalibroConfiguration + include KalibroRecord +end
Included KalibroRecord on KalibroConfiguration model
mezuro_prezento
train
rb
778096626be431098348cc67eb152865eca588c5
diff --git a/closure/goog/promise/promise.js b/closure/goog/promise/promise.js index <HASH>..<HASH> 100644 --- a/closure/goog/promise/promise.js +++ b/closure/goog/promise/promise.js @@ -166,7 +166,7 @@ goog.Promise = function(resolver, opt_context) { * @define {boolean} Whether traces of {@code then} calls should be included in * exceptions thrown */ -goog.define('goog.Promise.LONG_STACK_TRACES', goog.DEBUG); +goog.define('goog.Promise.LONG_STACK_TRACES', false); /**
Turn off goog.Promise.LONG_STACK_TRACES by default, since it is extremely slow in Chrome and newish Chromes now support async stack traces directly in Dev Tools. I considered several ways how to notify engineers about opting into goog.Promise.LONG_STACK_TRACES upon errors, but none proved to be uninvasive enough for the cases where it is not needed. ------------- Created by MOE: <URL>
google_closure-library
train
js
d1c66d43d8df5d0421ef98e3b08f3212fe61efc5
diff --git a/scripts/release.js b/scripts/release.js index <HASH>..<HASH> 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -100,7 +100,7 @@ const release = async () => { : semver.diff(curVersion, version) let distTag = 'latest' - if (releaseType.startsWith('pre') && !cliOptions['local-registry']) { + if (releaseType.startsWith('pre')) { distTag = 'next' }
workflow: should be able to publish to `next` dist-tag in local registry
vuejs_vue-cli
train
js
f072afdade27b544b3d1dc3d3ec0357f2aac33e2
diff --git a/lib/Ikimea/Browser/Browser.php b/lib/Ikimea/Browser/Browser.php index <HASH>..<HASH> 100644 --- a/lib/Ikimea/Browser/Browser.php +++ b/lib/Ikimea/Browser/Browser.php @@ -516,7 +516,7 @@ class Browser protected function checkBrowserInternetExplorer() { // Test for IE11 - if (stripos($this->_agent, 'Trident/7.0; rv:11.0') !== false) { + if (stripos($this->_agent, 'Trident/7.0') !== false && stripos($this->_agent, 'rv:11.0') !== false) { $this->setBrowser(self::BROWSER_IE); $this->setVersion('11.0');
Internet Explorer <I> (Touch) not recognized (PouleR)
Ikimea_Browser
train
php
431c9dbe4ff595686489914696b586522b4b57a7
diff --git a/src/Form.php b/src/Form.php index <HASH>..<HASH> 100644 --- a/src/Form.php +++ b/src/Form.php @@ -595,7 +595,7 @@ class Form extends View //implements \ArrayAccess - temporarily so that our buil $this->loadPOST(); ob_start(); $response = $this->hook('submit'); - $output = ob_get_clean(); + $output = ob_get_contents(); if ($output) { $message = new Message('Direct Output Detected'); diff --git a/tests/FormTest.php b/tests/FormTest.php index <HASH>..<HASH> 100644 --- a/tests/FormTest.php +++ b/tests/FormTest.php @@ -58,9 +58,6 @@ class FormTest extends \atk4\core\PHPUnit_AgileTestCase $this->assertEquals(false, $f->model['is_admin']); $submit_called = true; - - // prevent default submission handler from outputing and terminating - throw new MyException(); }); $f->render();
we are removing buffer in finally{} so no need to clean there
atk4_ui
train
php,php
5d8d997cd0240b313d6db817a4575f924b126132
diff --git a/backtrader/plot.py b/backtrader/plot.py index <HASH>..<HASH> 100644 --- a/backtrader/plot.py +++ b/backtrader/plot.py @@ -82,6 +82,9 @@ class PlotScheme(object): sellcolor = 'r' buymarkersize = sellmarkersize = 8.0 + plotcashvalue = True + + class Plot(object): __metaclass__ = metabase.MetaParams @@ -110,7 +113,13 @@ class Plot(object): indsubplots = [ind for ind in indplots if ind.subplot] nrows += sum([ind.subplot for ind in indplots]) * self.params.scheme.rowsminor - props = font_manager.FontProperties(size=9) + if self.params.scheme.plotcashvalue: + nrows += len(strategy.valobs) + + indplots = strategy.valobs + indplots + indsubplots = strategy.valobs + indsubplots + + props = font_manager.FontProperties(size=self.params.scheme.subtxtsize) axis = list() # if "dates" are passed, matploblib adds non-existing dates (ie weekends) creating gaps
Plot support for Cash/Value Observers
backtrader_backtrader
train
py
1e289b05b9fc7561188bb0dc9a83531068890e0e
diff --git a/test/inputSpec.js b/test/inputSpec.js index <HASH>..<HASH> 100644 --- a/test/inputSpec.js +++ b/test/inputSpec.js @@ -119,6 +119,9 @@ describe('"input" option', function() { } }; eachClass(function(className) { + if(typeof g[className] === 'undefined') { + return; + } it('correctly sends the input when inputType is bytearray and input is ' + className + postfix, function(done) { httpinvoke(url + 'bytearray', 'POST', { input: new g[className](buffer),
test: inputSpec: check for existence before using a typed array class
jakutis_httpinvoke
train
js
2752c7cc1efb31d81f60559230b44f03e073b18f
diff --git a/src/Presenters/Application/Tabs/SearchResultsTabDefinition.php b/src/Presenters/Application/Tabs/SearchResultsTabDefinition.php index <HASH>..<HASH> 100644 --- a/src/Presenters/Application/Tabs/SearchResultsTabDefinition.php +++ b/src/Presenters/Application/Tabs/SearchResultsTabDefinition.php @@ -22,5 +22,4 @@ require_once __DIR__ . '\SearchPanelTabDefinition.php'; class SearchResultsTabDefinition extends SearchPanelTabDefinition { - } \ No newline at end of file
Fix path - backslashes in paths don't work on linux
RhubarbPHP_Module.Leaf
train
php
2c95b95ab7996b66df76379b77f3ad4328f52dfb
diff --git a/src/Installer/AbstractModuleInstaller.php b/src/Installer/AbstractModuleInstaller.php index <HASH>..<HASH> 100644 --- a/src/Installer/AbstractModuleInstaller.php +++ b/src/Installer/AbstractModuleInstaller.php @@ -484,14 +484,22 @@ abstract class AbstractModuleInstaller extends LibraryInstaller } if (!is_link($target) - || $this->filesystem->normalizePath($source) !== $this->filesystem->normalizePath(readlink($target)) + || $this->filesystem->normalizePath($source) !== $this->filesystem->normalizePath(realpath($target)) ) { if (self::INVALID_IGNORE === $mode) { return false; } if (self::INVALID_FAIL === $mode) { - throw new \RuntimeException(sprintf('"%s" is not a link to "%s"', $target, $source)); + throw new \RuntimeException( + sprintf( + '"%s" is not a link to "%s" (expected "%s" but got "%s")', + $target, + $source, + $this->filesystem->normalizePath($source), + $this->filesystem->normalizePath(readlink($target)) + ) + ); } }
Fixed failing check if relative symlinks are identical
contao-community-alliance_composer-plugin
train
php
63a700a7c5551528ff833d5564b02c0a1bfa67a9
diff --git a/h2o-core/src/main/java/hex/grid/GridSearch.java b/h2o-core/src/main/java/hex/grid/GridSearch.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/hex/grid/GridSearch.java +++ b/h2o-core/src/main/java/hex/grid/GridSearch.java @@ -211,6 +211,8 @@ public final class GridSearch<MP extends Model.Parameters> extends Keyed<GridSea private void attemptBuildNextModel(final ParallelModelBuilder parallelModelBuilder, final Model previousModel) { // Attempt to train next model try { + // I hereby claim that the locking system below has been researched by Andrey Spiridonov + // and the credit should go to him. Thank you. parallelSearchGridLock.lock(); final MP nextModelParams = getNextModelParams(hyperspaceIterator, previousModel, grid); if (nextModelParams != null
Give credit to Andrey Spiridonov
h2oai_h2o-3
train
java
7b0ca2df5064503efd4b5564b167b68c29747629
diff --git a/fedmsg/commands/__init__.py b/fedmsg/commands/__init__.py index <HASH>..<HASH> 100644 --- a/fedmsg/commands/__init__.py +++ b/fedmsg/commands/__init__.py @@ -116,6 +116,8 @@ class command(object): """ Convenience decorator for wrapping fedmsg console script commands. Accepts a list of extra args. See fedmsg.commands.logger for an example. + + ** This is deprecated in favor of using the BaseCommand class above. """ def __init__(self, name, extra_args=None, daemonizable=False):
Added a note about deprecation.
fedora-infra_fedmsg
train
py
8180fb1979a39d395cba1f26a3235c1ea1bf3e6f
diff --git a/bakery/views.py b/bakery/views.py index <HASH>..<HASH> 100644 --- a/bakery/views.py +++ b/bakery/views.py @@ -50,7 +50,7 @@ class BuildableTemplateView(TemplateView): # Otherwise, we can just gzip to a file when rendering, # and forget the .gz extension gz_filename = '%s.gz' % path - gz_file = gzip.open(path, 'wb') + gz_file = gzip.open(gz_filename, 'wb') gz_file.write(six.binary_type(html)) gz_file.close() @@ -102,7 +102,7 @@ class BuildableListView(ListView): # Otherwise, we can just gzip to a file when rendering, # and forget the .gz extension gz_filename = '%s.gz' % path - gz_file = gzip.open(path, 'wb') + gz_file = gzip.open(gz_filename, 'wb') gz_file.write(six.binary_type(html)) gz_file.close() @@ -132,7 +132,7 @@ class BuildableDetailView(DetailView): # Otherwise, we can just gzip to a file when rendering, # and forget the .gz extension gz_filename = '%s.gz' % path - gz_file = gzip.open(path, 'wb') + gz_file = gzip.open(gz_filename, 'wb') gz_file.write(six.binary_type(data)) gz_file.close()
oops used the wrong path name
datadesk_django-bakery
train
py
5f30ee661f6c05a1171f8ce12d7a593a22de806b
diff --git a/lib/klam/version.rb b/lib/klam/version.rb index <HASH>..<HASH> 100644 --- a/lib/klam/version.rb +++ b/lib/klam/version.rb @@ -1,3 +1,3 @@ module Klam - VERSION = '0.0.1-dev' + VERSION = '0.0.1' end
Prepare for <I> release.
gregspurrier_klam
train
rb
170ed36814b558a1b6ca0230cb999ee4242db0d4
diff --git a/lib/qbwc/controller.rb b/lib/qbwc/controller.rb index <HASH>..<HASH> 100644 --- a/lib/qbwc/controller.rb +++ b/lib/qbwc/controller.rb @@ -127,9 +127,7 @@ QWC end def send_request - request = @session.current_request - request = request.try(:request) || '' - QBWC.logger.info("Current request is #{request}") if QBWC.log_sensitive_lines + request = @session.request_to_send render :soap => {'tns:sendRequestXMLResult' => request} end diff --git a/lib/qbwc/session.rb b/lib/qbwc/session.rb index <HASH>..<HASH> 100644 --- a/lib/qbwc/session.rb +++ b/lib/qbwc/session.rb @@ -62,6 +62,14 @@ class QBWC::Session request end + def request_to_send + request = current_request.try(:request) || '' + QBWC.logger.info("Sending request from job #{current_job.name}") + QBWC.logger.info(request) if QBWC.log_sensitive_lines + + request + end + def response=(qbxml_response) begin QBWC.logger.info 'Parsing response.'
Log send_request operation regardless of log_sensitive_lines
qbwc_qbwc
train
rb,rb
0f1f459bbb85b156a63cedea5a77159ed5196cde
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100755 --- a/Collection.php +++ b/Collection.php @@ -148,6 +148,16 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator } /** + * FLip items. + * + * @return \Illuminate\Support\Collection + */ + public function flip() + { + return new static(array_flip($this->items)); + } + + /** * Remove an item from the collection by key. * * @param mixed $key
[<I>] Add flip to Collection
illuminate_support
train
php
6cc598d2bb8a22e01472e3d9e5c045f6280c1b97
diff --git a/src/DataGrid.php b/src/DataGrid.php index <HASH>..<HASH> 100644 --- a/src/DataGrid.php +++ b/src/DataGrid.php @@ -560,7 +560,6 @@ class DataGrid extends Nette\Application\UI\Control /** * Set template file and render it */ - \Tracy\Debugger::barDump($this->getTemplateFile()); $template->setFile($this->getTemplateFile()); $template->render(); }
Fixed sorting: let the previous remain after filtering
contributte_datagrid
train
php
ca0ccffcb1e66df84d8e882dae0ce68d4be0c3ee
diff --git a/includes/os/class.SunOS.inc.php b/includes/os/class.SunOS.inc.php index <HASH>..<HASH> 100644 --- a/includes/os/class.SunOS.inc.php +++ b/includes/os/class.SunOS.inc.php @@ -230,6 +230,7 @@ class SunOS extends OS $dev = new DiskDevice(); $dev->setName('SWAP'); $dev->setFsType('swap'); + $dev->setMountPoint('SWAP'); $dev->setTotal($this->_kstat('unix:0:vminfo:swap_avail') / 1024); $dev->setUsed($this->_kstat('unix:0:vminfo:swap_alloc') / 1024); $dev->setFree($this->_kstat('unix:0:vminfo:swap_free') / 1024);
setMountPoint on SunOS to 'SWAP'
phpsysinfo_phpsysinfo
train
php
3cc77eb44e4a0680bf011b6b759073c40889f683
diff --git a/app/src/main/java/com/mikepenz/materialdrawer/app/MiniDrawerActivity.java b/app/src/main/java/com/mikepenz/materialdrawer/app/MiniDrawerActivity.java index <HASH>..<HASH> 100755 --- a/app/src/main/java/com/mikepenz/materialdrawer/app/MiniDrawerActivity.java +++ b/app/src/main/java/com/mikepenz/materialdrawer/app/MiniDrawerActivity.java @@ -145,7 +145,7 @@ public class MiniDrawerActivity extends AppCompatActivity { // Embed only if orientation is Landscape (regular drawer in Portrait) result = builder.buildView(); - miniResult = new MiniDrawer().withDrawer(result).withAccountHeader(headerResult); + miniResult = new MiniDrawer().withDrawer(result).withInnerShadow(true).withAccountHeader(headerResult); int first = (int) UIUtils.convertDpToPixel(300, this); int second = (int) UIUtils.convertDpToPixel(72, this);
* add shadow to MiniDrawer Sample
mikepenz_MaterialDrawer
train
java
6f7f6d1d9607c10ff8c938922f0731eeb68933f9
diff --git a/Files.php b/Files.php index <HASH>..<HASH> 100644 --- a/Files.php +++ b/Files.php @@ -76,6 +76,7 @@ class sb_Files{ case 'html': case 'txt': + case 'css': $m = 'text/'.$ext; break;
added css mime type sniffer
surebert_surebert-framework
train
php
bf2946f984a2bbf8a3e43819c8cf2833aa40054a
diff --git a/src/HasMedia/HasMediaTrait.php b/src/HasMedia/HasMediaTrait.php index <HASH>..<HASH> 100644 --- a/src/HasMedia/HasMediaTrait.php +++ b/src/HasMedia/HasMediaTrait.php @@ -171,7 +171,7 @@ trait HasMediaTrait throw InvalidBase64Data::create(); } - // decoding and then reeconding should not change the data + // decoding and then reencoding should not change the data if (base64_encode(base64_decode($base64data)) !== $base64data) { throw InvalidBase64Data::create(); }
Update a comment for addMediaFromBase<I>() (#<I>)
spatie_laravel-medialibrary
train
php
6dc4381c50a86291bdb10d30ec82b299f5dc6d7e
diff --git a/modules/citrus-admin/src/main/java/com/consol/citrus/admin/controller/ProjectController.java b/modules/citrus-admin/src/main/java/com/consol/citrus/admin/controller/ProjectController.java index <HASH>..<HASH> 100644 --- a/modules/citrus-admin/src/main/java/com/consol/citrus/admin/controller/ProjectController.java +++ b/modules/citrus-admin/src/main/java/com/consol/citrus/admin/controller/ProjectController.java @@ -42,7 +42,7 @@ public class ProjectController { @RequestMapping(method = RequestMethod.POST) @ResponseBody public String searchProjectHome(@RequestParam("dir") String dir) throws UnsupportedEncodingException { - String directory = String.valueOf(dir); + String directory = dir; if (directory.equals("/")) { directory = configService.getRootDirectory(); }
Even better fix for sonar reported issue
citrusframework_citrus
train
java
32c916464dba2ee6f1ddd2df1b30a6274cc60e99
diff --git a/frontend/Plugin.js b/frontend/Plugin.js index <HASH>..<HASH> 100644 --- a/frontend/Plugin.js +++ b/frontend/Plugin.js @@ -156,7 +156,6 @@ class SgGoogleNative extends SgTrackingPlugin { if (typeof this.register.customEvent === 'function') { this.register.customEvent((data) => { - console.warn(data); this.sendCustomEventCommand(data.eventCategory, data); return false; });
CCP-<I>: Removed console.log
shopgate_pwa
train
js
62bcf532a84bf8ba87dc45328f26aacd0537f524
diff --git a/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java index <HASH>..<HASH> 100644 --- a/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java +++ b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java @@ -228,6 +228,10 @@ public class Transactions { // no active transaction return null; } + if (Status.STATUS_ACTIVE != txn.getStatus()) { + // there is a user transaction which is not valid, so abort everything + throw new IllegalStateException(JcrI18n.errorInvalidUserTransaction.text(txn)); + } return transactionTable.get(txn); } catch (SystemException e) { logger.debug(e, "Cannot determine if there is an active transaction or not"); @@ -650,6 +654,14 @@ public class Transactions { } } } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("[local ").append("txId='") + .append(id).append("', original tx='") + .append(transaction).append("']"); + return sb.toString(); + } } protected class RollbackOnlyTransaction implements Transaction {
MODE-<I> Adds an additional check for the case when there's an aborted user transaction
ModeShape_modeshape
train
java
ec8be5d1cee72c71a2118b3cfbf843eb569524ff
diff --git a/js/materialbox.js b/js/materialbox.js index <HASH>..<HASH> 100644 --- a/js/materialbox.js +++ b/js/materialbox.js @@ -75,6 +75,13 @@ destroy() { this._removeEventHandlers(); this.el.M_Materialbox = undefined; + + // Unwrap image + $(this.placeholder) + .after(this.el) + .remove(); + + this.$el.removeAttr('style'); } /** @@ -227,7 +234,7 @@ } this.$el.removeAttr('style'); - this.$el.attr('style', this.originInlineStyles); + this.originInlineStyles && this.$el.attr('style', this.originInlineStyles); // Remove class this.$el.removeClass('active');
Materialbox destroy now removes wrapper element added during init
Dogfalo_materialize
train
js
047db0c3e2bd77db179312082f9d76a514ca0025
diff --git a/test/stash/item_test.js b/test/stash/item_test.js index <HASH>..<HASH> 100644 --- a/test/stash/item_test.js +++ b/test/stash/item_test.js @@ -109,12 +109,22 @@ describe('Stash::Item', function () { }) }); - it('should accept an expiration Date', function () { - foo.set('bar', new Date(Date.now() + 1000)); - expect(foo.isMiss()).to.be.false; - - foo.set('bar', new Date(Date.now() - 100)); - expect(foo.isMiss()).to.be.true; + it('should accept an expiration Date', function (done) { + foo.set('bar', new Date(Date.now() + 1000)).then(function () { + return foo.isMiss(); + }).then(function (missed) { + try { + expect(missed).to.be.false; + } catch(err) { done(err); } + }).then(function () { + return foo.set('bar', new Date(Date.now() - 100)); + }).then(function () { + return foo.isMiss(); + }).then(function (missed) { + catching(done, function () { + expect(missed).to.be.true; + }); + }); }); context('Expired & Locked', function () {
fix Item expiration accepts Date
onionskin_onionskin
train
js
2179555cc4bbbdce3d2a246706c8b06b57088991
diff --git a/lib/search-presc-example.js b/lib/search-presc-example.js index <HASH>..<HASH> 100644 --- a/lib/search-presc-example.js +++ b/lib/search-presc-example.js @@ -9,7 +9,7 @@ exports.searchPrescExample = function(conn, text, cb){ var args = ["%" + text + "%"]; conn.query(sql, args, function(err, result){ if( err ){ - done(err); + cb(err); return; } result.forEach(function(r){
fixed search-presc-example
hangilc_myclinic-db
train
js
5f0526b64a0519040fd20f15a73df0412850351f
diff --git a/yaml.go b/yaml.go index <HASH>..<HASH> 100644 --- a/yaml.go +++ b/yaml.go @@ -22,7 +22,6 @@ import ( "github.com/mailru/easyjson/jlexer" "github.com/mailru/easyjson/jwriter" - yaml "gopkg.in/yaml.v2" ) diff --git a/yaml_test.go b/yaml_test.go index <HASH>..<HASH> 100644 --- a/yaml_test.go +++ b/yaml_test.go @@ -20,9 +20,8 @@ import ( "net/http/httptest" "testing" - yaml "gopkg.in/yaml.v2" - "github.com/stretchr/testify/assert" + yaml "gopkg.in/yaml.v2" ) /* currently unused:
Fix minor linting issue with goimport
go-openapi_swag
train
go,go
4f29d674ee6d6cac90d0bd3e7cce854bddf45521
diff --git a/src/com/google/javascript/jscomp/TypeCheck.java b/src/com/google/javascript/jscomp/TypeCheck.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/TypeCheck.java +++ b/src/com/google/javascript/jscomp/TypeCheck.java @@ -307,6 +307,7 @@ public final class TypeCheck implements NodeTraversal.Callback, CompilerPass { ILLEGAL_OBJLIT_KEY, NON_STRINGIFIABLE_OBJECT_KEY, ABSTRACT_METHOD_IN_CONCRETE_CLASS, + ABSTRACT_METHOD_NOT_CALLABLE, ES5_CLASS_EXTENDING_ES6_CLASS, RhinoErrorReporter.TYPE_PARSE_ERROR, TypedScopeCreator.UNKNOWN_LENDS, diff --git a/src/com/google/javascript/jscomp/TypeValidator.java b/src/com/google/javascript/jscomp/TypeValidator.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/TypeValidator.java +++ b/src/com/google/javascript/jscomp/TypeValidator.java @@ -142,6 +142,7 @@ class TypeValidator { "Cannot do {0} access on a {1}"); static final DiagnosticGroup ALL_DIAGNOSTICS = new DiagnosticGroup( + ABSTRACT_METHOD_NOT_IMPLEMENTED, INVALID_CAST, TYPE_MISMATCH_WARNING, MISSING_EXTENDS_TAG_WARNING,
Add a couple of DiagnosticTypes about @abstract to proper DiagnosticGroups ------------- Created by MOE: <URL>
google_closure-compiler
train
java,java
d8e97acb13f0a8f379f818773787c80123852ae6
diff --git a/library/WT/Query/Name.php b/library/WT/Query/Name.php index <HASH>..<HASH> 100644 --- a/library/WT/Query/Name.php +++ b/library/WT/Query/Name.php @@ -204,7 +204,7 @@ class WT_Query_Name { break; } // Easy cases: the MySQL collation rules take care of it - return "$field LIKE '@".$letter."%' COLLATE ".WT_I18N::$collation." ESCAPE '@'"; + return "$field LIKE CONCAT('@',".WT_DB::quote($letter).",'%') COLLATE ".WT_I18N::$collation." ESCAPE '@'"; } // Get a list of initial surname letters for indilist.php and famlist.php
Fix: need to quote initial letters in name queries - they may contain quotes.
fisharebest_webtrees
train
php
8d2c2a19f71125ed2cfa1dc45cb557b2b628f926
diff --git a/uberpy/api.py b/uberpy/api.py index <HASH>..<HASH> 100755 --- a/uberpy/api.py +++ b/uberpy/api.py @@ -2,7 +2,7 @@ __author__ = 'Vivan' import json from httplib2 import Http -from urllib import urlencode +from urllib.parse import urlencode from errors import ( UnauthorisedException, MalformedRequestException, InvalidRequestException,
changed urllib to urllib.parse for compatibility with Python 3.x
vivangkumar_uberpy
train
py
d18240ab550b256a50856b3a1c9e644492223caa
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -47,6 +47,10 @@ function bind(thisArg, key, fn, options) { thisArg.options = {}; } + if (typeof options.bindFn === 'function') { + thisArg = options.bindFn(thisArg, key, options); + } + if (options.hasOwnProperty(key)) { var val = options[key]; thisArg.options[key] = val;
support a custom `bindFn` on the options
jonschlinkert_deep-bind
train
js
f1a119ae5312708bc2c5df3b8f5eac0c5954daed
diff --git a/core-bundle/contao/classes/DataContainer.php b/core-bundle/contao/classes/DataContainer.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/classes/DataContainer.php +++ b/core-bundle/contao/classes/DataContainer.php @@ -277,9 +277,10 @@ class DataContainer extends \Backend } $paletteFields = array_intersect($postPaletteFields, $newPaletteFields); + $blnSave = (\Input::post('SUBMIT_TYPE') != 'auto' || $arrData['eval']['submitOnChange']); // Validate and save the field - if (in_array($this->strInputName, $paletteFields) || \Input::get('act') == 'overrideAll') + if ($blnSave && in_array($this->strInputName, $paletteFields) || \Input::get('act') == 'overrideAll') { $objWidget->validate();
[Core] Do not save back end forms if they are auto-submitted (see #<I>)
contao_contao
train
php
8a44609b456ae59ea452aa62bfb6ba2f5eb642b0
diff --git a/tests/TestCase/Utility/HashTest.php b/tests/TestCase/Utility/HashTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Utility/HashTest.php +++ b/tests/TestCase/Utility/HashTest.php @@ -1189,7 +1189,7 @@ class HashTest extends TestCase } /** - * Test the attribute presense selector. + * Test the attribute presence selector. * * @dataProvider articleDataSets * @return void
Fixed "presense" is a misspelling of "presence"
cakephp_cakephp
train
php
8577e1bf0c573c3ab616c4a0e8e1c200d282a955
diff --git a/models/User.php b/models/User.php index <HASH>..<HASH> 100644 --- a/models/User.php +++ b/models/User.php @@ -150,7 +150,7 @@ class User extends ActiveRecord implements UserInterface public function beforeSave($insert) { if (parent::beforeSave($insert)) { - if ($this->isAttributeSafe('password') && !empty($this->password)) { + if (($this->getModule()->generatePassword || $this->isAttributeSafe('password')) && !empty($this->password)) { $this->setAttribute('password_hash', Security::generatePasswordHash($this->password, $this->getModule()->cost)); } if ($this->isNewRecord) {
fixed bug when password hash has not been generated
dektrium_yii2-user
train
php
5f95346286ea8909232aa972fe208b2b1a71de13
diff --git a/msg/scratch_msgs.js b/msg/scratch_msgs.js index <HASH>..<HASH> 100644 --- a/msg/scratch_msgs.js +++ b/msg/scratch_msgs.js @@ -10036,7 +10036,7 @@ Blockly.ScratchMsgs.locales["ckb"] = "NEW_PROCEDURE": "دروستکردنی بلۆکێک", "PROCEDURE_ALREADY_EXISTS": "کارایی ناونراو \"%1\" هەیە.", "PROCEDURE_DEFAULT_NAME": "ناوی بلۆک", - "PROCEDURE_USED": "To delete a block definition, first remove all uses of the block", + "PROCEDURE_USED": "بۆ سڕینەوەی پێناسەی بلۆکێک، سەرەتا هەموو بەکارهێنانەکانی ئەو بلۆکە لابە", "NEW_LIST": "دروستکردنی لیستێک", "NEW_LIST_TITLE": "ناوی نوێی لیست", "LIST_MODAL_TITLE": "لیستی نوێ",
[skip ci] Update translations from transifex
LLK_scratch-blocks
train
js
17eac48c05c90cd2f5aac2f170de1d785563a5b3
diff --git a/Proxy/Client/JsonClient.php b/Proxy/Client/JsonClient.php index <HASH>..<HASH> 100644 --- a/Proxy/Client/JsonClient.php +++ b/Proxy/Client/JsonClient.php @@ -130,7 +130,7 @@ class JsonClient implements ClientInterface $message .= "\n" . $jsonData['error_detail']; } - throw ApiException::create($message, $methodName); + throw ApiException::create($message, $methodName, $jsonData['error_code']); } else if (!is_array($jsonData) || !isset($jsonData['data'])) { throw new \RuntimeException("Invalid response.\n" . $jsonData);
Added error code to ApiException for json client
biplane_yandex-direct
train
php
d35e3dbc0f61f422c39c9ce67cc4a459a41a0e60
diff --git a/scapy.py b/scapy.py index <HASH>..<HASH> 100755 --- a/scapy.py +++ b/scapy.py @@ -6257,16 +6257,12 @@ class UDP(Packet): l = self.len - 8 return s[:l],s[l:] def hashret(self): - if conf.checkIPsrc: - return struct.pack("H",self.sport ^ self.dport)+self.payload.hashret() - else: - return self.payload.hashret() + return self.payload.hashret() def answers(self, other): if not isinstance(other, UDP): return 0 if conf.checkIPsrc: - if not ((self.sport == other.dport) and - (self.dport == other.sport)): + if self.dport != other.sport: return 0 return self.payload.answers(other.payload) def mysummary(self):
Made UDP answers be decided only on the source port of the client
secdev_scapy
train
py
a898408360c655b60fe883e5129ec92ebf61adb5
diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/form/JuelFormEngine.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/form/JuelFormEngine.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/form/JuelFormEngine.java +++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/form/JuelFormEngine.java @@ -12,6 +12,8 @@ */ package org.activiti.engine.impl.form; +import java.io.UnsupportedEncodingException; + import org.activiti.engine.ActivitiException; import org.activiti.engine.form.FormData; import org.activiti.engine.form.StartFormData; @@ -63,7 +65,13 @@ public class JuelFormEngine implements FormEngine { } byte[] resourceBytes = resourceStream.getBytes(); - String formTemplateString = new String(resourceBytes); + String encoding = "UTF-8"; + String formTemplateString = ""; + try { + formTemplateString = new String(resourceBytes, encoding); + } catch (UnsupportedEncodingException e) { + throw new ActivitiException("Unsupported encoding of :" + encoding, e); + } return formTemplateString; } }
Fixed: ACT-<I>
Activiti_Activiti
train
java
1c028db437492c0d0a62544481b3bdbc215ef4e5
diff --git a/pressbooks.php b/pressbooks.php index <HASH>..<HASH> 100644 --- a/pressbooks.php +++ b/pressbooks.php @@ -5,7 +5,7 @@ Plugin URI: https://pressbooks.org GitHub Plugin URI: pressbooks/pressbooks Release Asset: true Description: Simple Book Production -Version: 5.25.0 +Version: 5.26.0-dev Author: Pressbooks (Book Oven Inc.) Author URI: https://pressbooks.org Text Domain: pressbooks
Bump to next minor release <I>-dev (#<I>)
pressbooks_pressbooks
train
php
70a8128a3f20a8564d00b78abac2bf3a34df743d
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,7 +36,7 @@ MOCK_MODULES = ['hebel.pycuda_ops', 'hebel.pycuda_ops.linalg', 'hebel.pycuda_ops.reductions', 'hebel.pycuda_ops.softmax', 'hebel.pycuda_ops.cublas', 'hebel.pycuda_ops.cudadrv', 'skdata', 'skdata.mnist', 'skdata.mnist.view', 'pycuda', 'pycuda.autoinit', - 'pycuda.compiler', 'pycuda.cumath', 'pycuda.driver', + 'pycuda.compiler', 'pycuda.cumath', 'pycuda.driver', 'pycuda.tools', 'pycuda.elementwise', 'pycuda.gpuarray', 'numpy'] for mod_name in MOCK_MODULES:
Added pycuda.tools to mock
hannes-brt_hebel
train
py
5791c824f4515f1fad9b0ffdd8cbcdf7515c811b
diff --git a/test/template.js b/test/template.js index <HASH>..<HASH> 100644 --- a/test/template.js +++ b/test/template.js @@ -13,6 +13,16 @@ test('template: from string with params', assert => { assert.truthy(template('var x = <%= value %>;', { value: { type: 'Literal', value: 1 } })[0].declarations[0].init.value === 1) }) +test.skip('template: from string with import and export', assert => { + assert.truthy(template(` + import foo from "bar"; + + export default function () { + return <%= baz %>; + } + `, { baz: { type: 'Literal', value: 1 } })) +}) + test('template: from undefined and null', assert => { assert.deepEqual(convert(undefined), 'void 0') assert.deepEqual(convert(null), 'null')
Add a skipped test case for import/export in the template method
buxlabs_abstract-syntax-tree
train
js
4da7debc49cc87a243f8fc93a2fccbd4e276da26
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,10 +19,10 @@ setup( author_email = 'dev@babymri.org', url = 'https://github.com/FNNDSC/med2image', packages = ['med2image'], - install_requires = ['nibabel', 'pydicom', 'numpy', 'matplotlib', 'pillow'], + install_requires = ['nibabel', 'dicom', 'pydicom', 'numpy', 'matplotlib', 'pillow'], #test_suite = 'nose.collector', #tests_require = ['nose'], scripts = ['bin/med2image'], license = 'MIT', zip_safe = False -) \ No newline at end of file +)
Add 'dicom' package to the requirements
FNNDSC_med2image
train
py
5f9a6cb9772570b7a4b121c12895306c100b7480
diff --git a/handlers.js b/handlers.js index <HASH>..<HASH> 100644 --- a/handlers.js +++ b/handlers.js @@ -60,8 +60,8 @@ handlers[Language.ClientConnectionStatus] = function(body) { if(proto.status != GlobalOffensive.GCConnectionStatus.HAVE_SESSION && this.haveGCSession) { this.emit('disconnectedFromGC', proto.status); - this._connect(); // Try to reconnect this.haveGCSession = false; + this._connect(); // Try to reconnect } };
Fixed module not properly reconnecting to GC after temporary drops
DoctorMcKay_node-globaloffensive
train
js
483a49aeaf79c2d029fa4e724b54d51dc5a28150
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -132,6 +132,11 @@ class Config { $c )); } + + // if client hasn't been constructed, construct. + if (null === $this->HttpClient) { + $this->HttpClient = new Client(); + } } /** @@ -150,7 +155,6 @@ class Config { $conf = [ 'Address' => '127.0.0.1:8500', 'Scheme' => 'http', - 'HttpClient' => new Client(), ]; // parse env vars
Only construct Guzzle client if not set by something else
dcarbone_php-consul-api
train
php
549d7a8af26792ec04d9c57cb4c77751c8f9c59e
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -110,12 +110,17 @@ func (s *DB) Unscoped() *DB { } func (s *DB) First(out interface{}, where ...interface{}) *DB { - return s.clone().do(out).where(where...).first().db + scope := s.clone().NewScope(out) + scope.Search = scope.Search.clone().order(scope.PrimaryKey()).limit(1) + return scope.Set("gorm:inline_condition", where).callCallbacks(s.parent.callback.queries).db } func (s *DB) Last(out interface{}, where ...interface{}) *DB { - return s.clone().do(out).where(where...).last().db + scope := s.clone().NewScope(out) + scope.Search = scope.Search.clone().order(scope.PrimaryKey() + " DESC").limit(1) + return scope.Set("gorm:inline_condition", where).callCallbacks(s.parent.callback.queries).db } + func (s *DB) Find(out interface{}, where ...interface{}) *DB { return s.clone().NewScope(out).Set("gorm:inline_condition", where).callCallbacks(s.parent.callback.queries).db }
make first, last works with plugin system
jinzhu_gorm
train
go
bf6d6b741c87c38c6651d2b2b9de8f9f556e940e
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index <HASH>..<HASH> 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -6,28 +6,21 @@ from django.conf.urls import url from . import views urlpatterns = [ - # URL pattern for the UserListView url( regex=r'^$', view=views.UserListView.as_view(), name='list' ), - - # URL pattern for the UserRedirectView url( regex=r'^~redirect/$', view=views.UserRedirectView.as_view(), name='redirect' ), - - # URL pattern for the UserDetailView url( regex=r'^(?P<username>[\w.@+-]+)/$', view=views.UserDetailView.as_view(), name='detail' ), - - # URL pattern for the UserUpdateView url( regex=r'^~update/$', view=views.UserUpdateView.as_view(),
Remove redundant comments Thought these comments seemed unnecessary.
pydanny_cookiecutter-django
train
py
b159dbdac8bdc71664e94526a162df9971a5667d
diff --git a/pyforms/Controls/ControlTree.py b/pyforms/Controls/ControlTree.py index <HASH>..<HASH> 100644 --- a/pyforms/Controls/ControlTree.py +++ b/pyforms/Controls/ControlTree.py @@ -1,9 +1,7 @@ # !/usr/bin/python # -*- coding: utf-8 -*- -''' Control Tree - -''' +""""pyforms.Controls.Control Tree""" from pyforms.Controls.ControlBase import ControlBase from PyQt4.QtGui import QTreeWidget, QTreeWidgetItem, QTreeView @@ -54,6 +52,14 @@ class ControlTree(ControlBase, QTreeWidget): def itemSelectionChanged(self): pass + def rowsInsertedEvent(self, parent, start, end): + """ This event is called every time a new row is added to the tree""" + pass + + def rowsInserted(self, parent, start, end): + super(ControlTree, self).rowsInserted(parent, start, end) + self.rowsInsertedEvent(parent, start, end) + def selectionChanged(self, selected, deselected): super(QTreeView, self).selectionChanged(selected, deselected) self.itemSelectionChanged()
new event in the ControlTree to detect when the new row is inserted
UmSenhorQualquer_pyforms
train
py
6516c04e8bb0ba58e0757073c26d7d213fccb674
diff --git a/lxd/networks.go b/lxd/networks.go index <HASH>..<HASH> 100644 --- a/lxd/networks.go +++ b/lxd/networks.go @@ -492,7 +492,7 @@ func networksPostCluster(d *Daemon, projectName string, netInfo *api.Network, re // Check that no node-specific config key has been supplied in request. for key := range req.Config { if shared.StringInSlice(key, db.NodeSpecificNetworkConfig) { - return fmt.Errorf("Config key %q is node-specific", key) + return fmt.Errorf("Config key %q is cluster member specific", key) } } @@ -1161,7 +1161,7 @@ func networkPut(d *Daemon, r *http.Request) response.Response { // If no target is specified, then ensure only non-node-specific config keys are changed. for k := range req.Config { if shared.StringInSlice(k, db.NodeSpecificNetworkConfig) { - return response.BadRequest(fmt.Errorf("Config key %q is node-specific", k)) + return response.BadRequest(fmt.Errorf("Config key %q is cluster member specific", k)) } } } else {
lxd/networks: Removes references to nodes in user facing errors
lxc_lxd
train
go
900a7b7ff9693866dc26d483d44b09ac544d02cb
diff --git a/dev/MigrationTask.php b/dev/MigrationTask.php index <HASH>..<HASH> 100644 --- a/dev/MigrationTask.php +++ b/dev/MigrationTask.php @@ -16,7 +16,7 @@ * protected $description = "Description"; // description of what it does * * public function run($request) { - * if ($request->param('Direction') == 'down') { + * if ($request->getVar('Direction') == 'down') { * $this->down(); * } else { * $this->up();
Unable to migrate down Possible bug? Running PHP <I> I had to override this method in MyMigrationTask.
silverstripe_silverstripe-framework
train
php
f5c00cf20d0431a4cc688e2fda23f088e3e043ac
diff --git a/providers/spotify/session.go b/providers/spotify/session.go index <HASH>..<HASH> 100644 --- a/providers/spotify/session.go +++ b/providers/spotify/session.go @@ -27,7 +27,7 @@ func (s Session) GetAuthURL() (string, error) { // Authorize completes the the authorization with Spotify and returns the access // token to be stored for future use. -func (s Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { +func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) token, err := p.config.Exchange(oauth2.NoContext, params.Get("code")) if err != nil {
Updated spotify Authorize function to point to Session
markbates_goth
train
go
aa20b777d0c8692581c9e140ae138a9dee906161
diff --git a/src/XhtmlFormatter/Formatter.php b/src/XhtmlFormatter/Formatter.php index <HASH>..<HASH> 100644 --- a/src/XhtmlFormatter/Formatter.php +++ b/src/XhtmlFormatter/Formatter.php @@ -11,10 +11,11 @@ * */ -declare(strict_types=1); +declare(strict_types = 1); namespace XhtmlFormatter; + class Formatter {
- <I> - Updated cs
Machy8_xhtml-formatter
train
php
5deffec3be96b7d6550db5296b5efd1a6af7999e
diff --git a/piazza_api/piazza.py b/piazza_api/piazza.py index <HASH>..<HASH> 100644 --- a/piazza_api/piazza.py +++ b/piazza_api/piazza.py @@ -74,14 +74,16 @@ class Piazza(object): # raw_classes = self.get_user_profile().get('all_classes').values() # Get classes from the user status (includes all classes) - raw_classes = self.get_user_status().get('networks', []) + status = self.get_user_status() + uid = status['id'] + raw_classes = status.get('networks', []) classes = [] for rawc in raw_classes: c = {k: rawc[k] for k in ['name', 'term']} c['num'] = rawc.get('course_number', '') c['nid'] = rawc['id'] - c['is_ta'] = rawc.get('is_ta', False) + c['is_ta'] = uid in rawc['prof_hash'] classes.append(c) return classes
fix(dev): repair is_ta boolean in get_user_classes is_ta appears to be no longer sent in the networks list of 'user.status', so instead we use the 'profs_hash' to check for TA status.
hfaran_piazza-api
train
py
dbceb17da979f4247b4e13f183f6ece484fd81f8
diff --git a/src/main/java/org/dynjs/runtime/DynObject.java b/src/main/java/org/dynjs/runtime/DynObject.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dynjs/runtime/DynObject.java +++ b/src/main/java/org/dynjs/runtime/DynObject.java @@ -16,7 +16,7 @@ package org.dynjs.runtime; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import org.dynjs.exception.ThrowException; @@ -26,7 +26,7 @@ public class DynObject implements JSObject { private String className; private JSObject prototype = null; - private final Map<String, PropertyDescriptor> properties = new HashMap<>(); + private final Map<String, PropertyDescriptor> properties = new LinkedHashMap<>(); private boolean extensible = true; public DynObject(GlobalObject globalObject) {
Use LinkedHashMap to retain property ordering
dynjs_dynjs
train
java
d72423010d01dbb1ace2ca9bee76506cdcd9cd8e
diff --git a/tests/integration/routes/profile/get-profile-test.js b/tests/integration/routes/profile/get-profile-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/routes/profile/get-profile-test.js +++ b/tests/integration/routes/profile/get-profile-test.js @@ -97,4 +97,16 @@ getServer(function (error, server) { group.end() }) + + test('GET /session/account/profile?include=foobar', function (t) { + var options = _.defaultsDeep({ + url: '/session/account/profile?include=foobar' + }, routeOptions) + + server.inject(options, function (response) { + t.is(response.statusCode, 400, 'returns 400 status') + t.deepEqual(response.result.errors[0].detail, '?include not allowed', 'returns error message') + t.end() + }) + }) })
test(routes): GET /session/account/profile?include=foobar * * * This commit was sponsored by Neighbourhoodie You can hire Neighbourhoodie for all your Hoodie / CouchDB / Offline First needs <URL>
hoodiehq_hoodie-account-server
train
js
34ae742ffe0eedf1890499028435ffeefa3f26d5
diff --git a/src/Fields/ForeignField.php b/src/Fields/ForeignField.php index <HASH>..<HASH> 100644 --- a/src/Fields/ForeignField.php +++ b/src/Fields/ForeignField.php @@ -58,7 +58,17 @@ class ForeignField extends RelatedField */ public function getFormField($fieldClass = '\Mindy\Form\Fields\DropDownField') { - return parent::getFormField($fieldClass); + $data = parent::getFormField($fieldClass); + + if ($data) { + $choices = []; + foreach ($this->getManager()->all() as $model) { + $choices[$model->pk] = (string)$model; + } + $data['choices'] = $choices; + } + + return $data; } /**
Fix getFormField in fk field
MindyPHP_Orm
train
php
084fc028b13ca6defcc6d76e0f4bf7f6b8543863
diff --git a/werkzeug/urls.py b/werkzeug/urls.py index <HASH>..<HASH> 100644 --- a/werkzeug/urls.py +++ b/werkzeug/urls.py @@ -36,7 +36,7 @@ ALWAYS_SAFE = frozenset( 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' '0123456789' - '_.-' + '_.-+' ) #: Schemes that use a netloc as part of their URL.
Add + to ALWAYS_SAFE
pallets_werkzeug
train
py
81f1895d754087c0af5471a01f85bcefd7869f99
diff --git a/angr/analyses/cfg/cfg_fast.py b/angr/analyses/cfg/cfg_fast.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg/cfg_fast.py +++ b/angr/analyses/cfg/cfg_fast.py @@ -1755,8 +1755,8 @@ class CFGFast(ForwardAnalysis, CFGBase): # pylint: disable=abstract-method ) self._function_add_node(cfg_node, function_addr) - if self.functions.get_by_addr(current_func_addr).returning is not True: - self._updated_nonreturning_functions.add(current_func_addr) + if self.functions.get_by_addr(function_addr).returning is not True: + self._updated_nonreturning_functions.add(function_addr) # If we have traced it before, don't trace it anymore real_addr = self._real_address(self.project.arch, addr)
CFGFast: Fix a stupid bug. Close #<I>. (#<I>)
angr_angr
train
py
84b122ad037657429a9f0f2dabeda7007496ce45
diff --git a/src/Autoload.php b/src/Autoload.php index <HASH>..<HASH> 100644 --- a/src/Autoload.php +++ b/src/Autoload.php @@ -29,7 +29,10 @@ trait Autoload foreach ($maps as $field => $mapto) { $model->$field = $this->$mapto; } - $model->load(); + try { + $model->load(); + } catch (Exception\PrimaryKey $e) { + } $this->$property = $model; } else { $args = [];
this should allow loading to fail of course
ornament-orm_core
train
php
8b5c6cf84d725fe60e1edd0ef9b7fb4073f156c6
diff --git a/kerncraft/kernel.py b/kerncraft/kernel.py index <HASH>..<HASH> 100755 --- a/kerncraft/kernel.py +++ b/kerncraft/kernel.py @@ -840,7 +840,7 @@ class KernelCode(Kernel): """ lock_filename = file_path + '.lock' # 1. Open lockfile (create and write) - lock_fp = open(lock_filename, 'w') + lock_fp = open(lock_filename, 'w+') # 2. Acquire SH lock (blocking) try: fcntl.flock(lock_fp, fcntl.LOCK_SH)
improved locking compatability with NFSv4
RRZE-HPC_kerncraft
train
py
34783f390e529e27ce632d50dc1e41f32af21794
diff --git a/spec/concerns/apis/notification_api_spec.rb b/spec/concerns/apis/notification_api_spec.rb index <HASH>..<HASH> 100644 --- a/spec/concerns/apis/notification_api_spec.rb +++ b/spec/concerns/apis/notification_api_spec.rb @@ -313,10 +313,11 @@ shared_examples_for :notification_api do context "out of the group expiry period" do it "does not belong to single group" do - owner_notification = described_class.notify_to(@user_1, @comment_1, group: @article, group_expiry_delay: 1.second) - member_notification_1 = described_class.notify_to(@user_1, @comment_2, group: @article, group_expiry_delay: 1.second) - sleep(1) - member_notification_2 = described_class.notify_to(@user_1, @comment_2, group: @article, group_expiry_delay: 1.second) + Timecop.travel(90.seconds.ago) + owner_notification = described_class.notify_to(@user_1, @comment_1, group: @article, group_expiry_delay: 1.minute) + member_notification_1 = described_class.notify_to(@user_1, @comment_2, group: @article, group_expiry_delay: 1.minute) + Timecop.return + member_notification_2 = described_class.notify_to(@user_1, @comment_2, group: @article, group_expiry_delay: 1.minute) expect(member_notification_1.group_owner).to eq(owner_notification) expect(member_notification_2.group_owner).to be_nil end
Fix test for group expiry delay to use Timecop
simukappu_activity_notification
train
rb
5007d23f1e0f50d949715384dcf66fdf25e9d608
diff --git a/app/assets/javascripts/fae/form/_ajax.js b/app/assets/javascripts/fae/form/_ajax.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/fae/form/_ajax.js +++ b/app/assets/javascripts/fae/form/_ajax.js @@ -77,6 +77,7 @@ Fae.form.ajax = { Fae.form.dates.initDateRangePicker(); Fae.form.text.slugger(); Fae.form.validator.length_counter.init(); + Fae.form.text.initMarkdown(); $wrapper.find('.hint').hinter(); });
added in init for markdown fields in nested index tables
wearefine_fae
train
js
6cbb85119f67e5eeb985713b1230bd52c718db04
diff --git a/ocrd/model/ocrd_page.py b/ocrd/model/ocrd_page.py index <HASH>..<HASH> 100644 --- a/ocrd/model/ocrd_page.py +++ b/ocrd/model/ocrd_page.py @@ -110,7 +110,7 @@ class OcrdPage(OcrdXmlBase): self.page.set('imageResolutionUnit', v) def add_reading_order_ref(self, region_ref, index): - if not self.page.find('.//page:ReadingOrder', NAMESPACES): + if self.page.find('.//page:ReadingOrder', NAMESPACES) is None: ET.SubElement(self.page, TAG_PAGE_READINGORDER) region_ref_indexed = ET.SubElement(self.page.find('.//page:ReadingOrder', NAMESPACES), TAG_PAGE_REGIONREFINDEXED) region_ref_indexed.set("regionRef", region_ref)
OcrdPage: prefer "X is not None" over "not X"
OCR-D_core
train
py
462af43dba1162d4e4886f3ef7ccd2179b069905
diff --git a/src/test/java/com/github/tomakehurst/wiremock/SnapshotAcceptanceTest.java b/src/test/java/com/github/tomakehurst/wiremock/SnapshotAcceptanceTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/github/tomakehurst/wiremock/SnapshotAcceptanceTest.java +++ b/src/test/java/com/github/tomakehurst/wiremock/SnapshotAcceptanceTest.java @@ -20,6 +20,7 @@ import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.common.Json; import com.github.tomakehurst.wiremock.testsupport.WireMockResponse; import com.github.tomakehurst.wiremock.testsupport.WireMockTestClient; +import org.junit.After; import org.junit.Test; import org.skyscreamer.jsonassert.JSONCompareMode; @@ -45,6 +46,11 @@ public class SnapshotAcceptanceTest extends AcceptanceTestBase { proxyingTestClient = new WireMockTestClient(proxyingService.port()); } + @After + public void proxyServerShutdown() { + proxyingService.stop(); + } + private static final String DEFAULT_SNAPSHOT_RESPONSE = "[ \n" + " { \n" +
Make sure proxy server is stopped in SnapshotAcceptanceTest
tomakehurst_wiremock
train
java
02bb54ae808b28cf66ad02a037d674a87c865cb4
diff --git a/src/core/Selection.js b/src/core/Selection.js index <HASH>..<HASH> 100644 --- a/src/core/Selection.js +++ b/src/core/Selection.js @@ -30,6 +30,7 @@ export class Selection extends Set { * Controls whether objects that are added to this selection should be removed from all other layers. * * @type {Boolean} + * @deprecated Use isExclusive() and setExclusive() instead. */ this.exclusive = false; @@ -104,6 +105,30 @@ export class Selection extends Set { } /** + * Indicates whether objects that are added to this selection will be removed from all other layers. + * + * @return {Number} Whether this selection is exclusive. Default is false. + */ + + isExclusive() { + + return this.exclusive; + + } + + /** + * Controls whether objects that are added to this selection should be removed from all other layers. + * + * @param {Number} value - Whether this selection should be exclusive. + */ + + setExclusive(value) { + + this.exclusive = value; + + } + + /** * Clears this selection. * * @return {Selection} This selection.
Deprecate exclusive Replaced by isExclusive() and setExclusive().
vanruesc_postprocessing
train
js
3a177532766b15576a338b729687978d593cf677
diff --git a/liquibase-core/src/main/java/liquibase/datatype/core/ClobType.java b/liquibase-core/src/main/java/liquibase/datatype/core/ClobType.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/datatype/core/ClobType.java +++ b/liquibase-core/src/main/java/liquibase/datatype/core/ClobType.java @@ -63,10 +63,8 @@ public class ClobType extends LiquibaseDataType { type.addAdditionalInformation(getAdditionalInformation()); return type; } - if (originalDefinition.equalsIgnoreCase("ntext") - || originalDefinition.equals("[ntext]") - || originalDefinition.matches("(?i)ntext .+") - || originalDefinition.matches("\\[ntext\\] .+")) { + if (originalDefinition.toLowerCase().startsWith("ntext") + || originalDefinition.toLowerCase().startsWith("[ntext]")) { DatabaseDataType type = new DatabaseDataType(database.escapeDataTypeName("ntext")); type.addAdditionalInformation(getAdditionalInformation());
Better handling of ntext types in mssql
liquibase_liquibase
train
java
af5d41797ba8b73b92deb6e3003bd2e006d28bb4
diff --git a/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java b/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java index <HASH>..<HASH> 100644 --- a/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java +++ b/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java @@ -94,6 +94,7 @@ public class SchemaService extends Service { @Override public void startService() { TenantService.instance().waitForFullService(); + TenantService.instance().createDefaultTenant(); checkAppStores(); } // startService
Create default tenant at startup to prevent error responses to REST commands on empty databases.
QSFT_Doradus
train
java
0bc7786fdc11d77ae1e1926179e5f61b505359ab
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -61,12 +61,12 @@ setup( 'development': [ 'devpi-client', 'docutils', + 'pyflakes < 1.4.0', 'flake8', 'mock', 'pbr', 'pdbpp', 'pep8 < 1.6', - 'pyflakes', 'pytest', 'pytest-cov', 'pytest-flakes',
We must pin pyflakes for flake8 (apparently)
getsenic_senic.cryptoyaml
train
py
4c0136da4dd7b8ad10bc6fc19872e043fde35578
diff --git a/examples/lazy-loading/app.js b/examples/lazy-loading/app.js index <HASH>..<HASH> 100644 --- a/examples/lazy-loading/app.js +++ b/examples/lazy-loading/app.js @@ -43,7 +43,7 @@ const router = new VueRouter({ { path: '/', component: Home }, // Just use them normally in the route config { path: '/foo', component: Foo }, - // mulitple parameters, `/` should not be encoded. The name is also important + // multiple parameters, `/` should not be encoded. The name is also important // https://github.com/vuejs/vue-router/issues/2719 { path: '/a/:tags*', name: 'tagged', component: () => new Promise(resolve => { setTimeout(() => {
chore(typo): fix typo in comment (#<I>)
vuejs_vue-router
train
js
0609f93f67a5192b9fd2ddc6ebe49a3289ecd43b
diff --git a/mpldatacursor.py b/mpldatacursor.py index <HASH>..<HASH> 100644 --- a/mpldatacursor.py +++ b/mpldatacursor.py @@ -202,6 +202,7 @@ class DataCursor(object): } x, y = event.mouseevent.xdata, event.mouseevent.ydata props = dict(x=x, y=y, label=event.artist.get_label(), event=event) + props['i'] = getattr(event, 'ind', None) func = registry.get(type(event.artist), default_func) props.update(func(event)) return props
Added "i" (index of selected item) to event properties
joferkington_mpldatacursor
train
py
60742f9a95cb5eff549a873a53724863f1ab20e2
diff --git a/libcontainerd/remote_unix.go b/libcontainerd/remote_unix.go index <HASH>..<HASH> 100644 --- a/libcontainerd/remote_unix.go +++ b/libcontainerd/remote_unix.go @@ -154,7 +154,7 @@ func (r *remote) handleConnectionChange() { logrus.Debugf("libcontainerd: containerd health check returned error: %v", err) if r.daemonPid != -1 { - if strings.Contains(err.Error(), "is closing") { + if r.closeManually { // Well, we asked for it to stop, just return return }
fix when rpc reports "transport is closing" error, health check go routine will exit
moby_moby
train
go
1fb0ab08efc1a4def17e91a275f28179b993b273
diff --git a/src/com/google/javascript/rhino/Node.java b/src/com/google/javascript/rhino/Node.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/rhino/Node.java +++ b/src/com/google/javascript/rhino/Node.java @@ -2650,7 +2650,7 @@ public class Node implements Serializable { */ public final void setSideEffectFlags(int flags) { checkArgument( - this.getToken() == Token.CALL || this.getToken() == Token.NEW, + this.isCall() || this.isNew(), "setIsNoSideEffectsCall only supports CALL and NEW nodes, got %s", this.getToken());
Simplify expressions involving Rhino Nodes #2 ------------- Created by MOE: <URL>
google_closure-compiler
train
java
6e9d1c76e065c7c2cc031cede76d3c037124152e
diff --git a/core/Tracker/Settings.php b/core/Tracker/Settings.php index <HASH>..<HASH> 100644 --- a/core/Tracker/Settings.php +++ b/core/Tracker/Settings.php @@ -49,7 +49,7 @@ class Settings } $browserName = !empty($aBrowserInfo['short_name']) ? $aBrowserInfo['short_name'] : 'UNK'; - $browserVersion = !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : ''; + $browserVersion = !empty($aBrowserInfo['version']) ? $aBrowserInfo['version'] : 'UNK'; if ($deviceDetector->isBot()) { $os = 'BOT';
set version to UNK if there is none detected
matomo-org_matomo
train
php
8460699357ee979828dd85c9fc2fe20d0ef3c389
diff --git a/lib/geocoder/lookups/freegeoip.rb b/lib/geocoder/lookups/freegeoip.rb index <HASH>..<HASH> 100644 --- a/lib/geocoder/lookups/freegeoip.rb +++ b/lib/geocoder/lookups/freegeoip.rb @@ -17,14 +17,16 @@ module Geocoder::Lookup end end - def query_url(query) - "#{protocol}://#{host}/json/#{query.sanitized_text}" - end - private # --------------------------------------------------------------- - def cache_key(query) - query_url(query) + def base_query_url(query) + "#{protocol}://#{host}/json/#{query.sanitized_text}?" + end + + def query_url_params(query) + { + :apikey => configuration.api_key + }.merge(super) end def parse_raw_data(raw_data)
Freegeoip abides by base class recommendations and supports an api key
alexreisner_geocoder
train
rb
7196ef108c1901d6ceb7c356840f2ec2adb9a380
diff --git a/widgets_demo.py b/widgets_demo.py index <HASH>..<HASH> 100644 --- a/widgets_demo.py +++ b/widgets_demo.py @@ -53,6 +53,7 @@ if __name__ == "__main__": finally: s.goto(0, 50) s.cursor(True) + s.disable_mouse() s.deinit_tty() print("Result:", res)
widgets_demo.py: Disable console mouse support on exit.
pfalcon_picotui
train
py
b839d4093356914b305b6fd0140782e8e198402e
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -366,7 +366,7 @@ module ActiveRecord case value when String return super unless 'bytea' == column.sql_type - escape_bytea(value) + { :value => value, :format => 1 } else super end @@ -1093,4 +1093,3 @@ module ActiveRecord end end end -
Fix test_load_save in test/cases/binary_test.rb (thanks @tenderlove for actually working out how to fix it)
rails_rails
train
rb
1339ba585a9975dd89d29b4495e980153e90c565
diff --git a/annis-service/src/main/java/annis/AnnisRunner.java b/annis-service/src/main/java/annis/AnnisRunner.java index <HASH>..<HASH> 100644 --- a/annis-service/src/main/java/annis/AnnisRunner.java +++ b/annis-service/src/main/java/annis/AnnisRunner.java @@ -1214,6 +1214,12 @@ public class AnnisRunner extends AnnisBaseRunner System.out.println("bye bye!"); System.exit(0); } + + public void doExit(String dummy) + { + System.out.println("bye bye!"); + System.exit(0); + } private void printAsTable(List<? extends Object> list, String... fields) {
add "exit" as synonym to "quit" to ANNIS console
korpling_ANNIS
train
java
1656005dec69d98325a69500b303bba8ded087ac
diff --git a/shutit_global.py b/shutit_global.py index <HASH>..<HASH> 100644 --- a/shutit_global.py +++ b/shutit_global.py @@ -578,7 +578,8 @@ class ShutIt(object): if res == 1: self.send_and_expect(password,expect=expect,child=child,record_command=False) if cfg['repository']['push'] == True: - self.push_repository(repository,docker_executable,expect=expect) + # Pass the child explicitly as it's the host child. + self.push_repository(repository,docker_executable,expect=expect,child=child) cfg['build']['report'] = cfg['build']['report'] + 'Pushed repository: ' + repository
scrot for win<I> and bugfix for push repo
ianmiell_shutit
train
py
198f7e70a4b9a078d4c3faa69d39a2805cac0309
diff --git a/Spartacus/Database.py b/Spartacus/Database.py index <HASH>..<HASH> 100644 --- a/Spartacus/Database.py +++ b/Spartacus/Database.py @@ -1086,6 +1086,8 @@ class PostgreSQL(Generic): self.v_types = None psycopg2.extras.register_default_json(loads=lambda x: x) psycopg2.extras.register_default_jsonb(loads=lambda x: x) + psycopg2.extensions.register_type( + psycopg2.extensions.new_type(psycopg2.extensions.INTERVAL.values, 'INTERVAL_STR', psycopg2.STRING), self.v_cur) else: raise Spartacus.Database.Exception("PostgreSQL is not supported. Please install it with 'pip install Spartacus[postgresql]'.") def GetConnectionString(self): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ rootdir = os.path.abspath(os.path.dirname(__file__)) long_description = open(os.path.join(rootdir, 'README')).read() setup(name='Spartacus', - version='2.56', + version='2.57', description='Generic database wrapper', long_description=long_description, url='http://github.com/wind39/spartacus',
<I>: PostgreSQL INTERVAL is now converted to string instead of timedelta
wind39_spartacus
train
py,py
47b39bacfdfd50ff29b8f38077e77a02e04b27cc
diff --git a/server.py b/server.py index <HASH>..<HASH> 100755 --- a/server.py +++ b/server.py @@ -10,7 +10,7 @@ __builtin__.MANIFEST_FILE = '.manifest.json' import json import os from os import path -from flask import Flask, request, redirect, url_for, send_from_directory, make_responce +from flask import Flask, request, redirect, url_for, send_from_directory, make_response from werkzeug.utils import secure_filename from base64 import b64encode, b64decode
added missing make_responce to flask import in server
robehickman_simple-http-file-sync
train
py
4891ae1783b5916727180a4958eba46e477195cc
diff --git a/src/you_get/json_output.py b/src/you_get/json_output.py index <HASH>..<HASH> 100644 --- a/src/you_get/json_output.py +++ b/src/you_get/json_output.py @@ -16,6 +16,13 @@ def output(video_extractor, pretty_print=True): out['audiolang'] = ve.audiolang except AttributeError: pass + extra = {} + if ve.referer is not None: + extra["referer"] = ve.referer + if ve.ua is not None: + extra["ua"] = ve.ua + if extra: + out["extra"] = extra if pretty_print: print(json.dumps(out, indent=4, sort_keys=True, ensure_ascii=False)) else:
output refer and ua message in json
soimort_you-get
train
py
ae96b0f39f2690efeca6771311d27c950f80ce4f
diff --git a/lib/Predis/Commands/Preprocessors/PreprocessorChain.php b/lib/Predis/Commands/Preprocessors/PreprocessorChain.php index <HASH>..<HASH> 100644 --- a/lib/Predis/Commands/Preprocessors/PreprocessorChain.php +++ b/lib/Predis/Commands/Preprocessors/PreprocessorChain.php @@ -16,7 +16,10 @@ class PreprocessorChain implements ICommandPreprocessorChain, \ArrayAccess { } public function remove(ICommandPreprocessor $preprocessor) { - // TODO: find index of value + $index = array_search($preprocessor, $this->_preprocessors, true); + if ($index !== false) { + unset($this->_preprocessors); + } } public function process(&$method, &$arguments) {
Actually implement preprocessor removal from a preprocessor chain.
imcj_predis
train
php
de3e300c77ce43f1d41dd851a3b6b03a43aaf73a
diff --git a/app/src/js/modules/submenu.js b/app/src/js/modules/submenu.js index <HASH>..<HASH> 100644 --- a/app/src/js/modules/submenu.js +++ b/app/src/js/modules/submenu.js @@ -25,14 +25,15 @@ * @memberof Bolt.submenu */ submenu.init = function () { - $('#navpage-secondary a.menu-pop').each(function () { - initPopOver($(this)); - }); + var usePopOvers = !$('.navbar-toggle').is(':visible'); - if ($('.navbar-toggle').is(':visible')) { - initMobileAction(); - } else { + if (usePopOvers) { + $('#navpage-secondary a.menu-pop').each(function () { + initPopOver($(this)); + }); initDesktopAction(); + } else { + initMobileAction(); } };
Initialize popovers only in desktop mode
bolt_bolt
train
js
ea0f9fc81ce9c25dc14654ff45ae92f0b9b5848c
diff --git a/devassistant/command_helpers.py b/devassistant/command_helpers.py index <HASH>..<HASH> 100644 --- a/devassistant/command_helpers.py +++ b/devassistant/command_helpers.py @@ -19,7 +19,9 @@ class ClHelper(object): plumbum.local.cwd.chdir(split_string[1]) else: cmd = plumbum.local[split_string[0]] - for i in cls._connect_quoted(split_string[1:]): + fixed_args = cls._connect_quoted(split_string[1:]) + fixed_args = cls._strip_trailing_quotes(fixed_args) + for i in fixed_args: cmd = cmd[i] # log the invocation log_string = settings.COMMAND_LOG_STRING.format(cmd=cmd) @@ -82,6 +84,14 @@ class ClHelper(object): return proper_list + @classmethod + def _strip_trailing_quotes(cls, arg_list): + proper_list = [] + + for arg in arg_list: + proper_list.append(arg.strip('"\'')) + + return proper_list class RPMHelper(object): c_rpm = plumbum.local['rpm']
Strip trailing quotes from arguments passed to Popen via plumbum, it doesn't like them that much...
devassistant_devassistant
train
py
04f2e21c4e2b01849ceff118010fe6fca7a64282
diff --git a/autofit/mapper/prior_model/abstract.py b/autofit/mapper/prior_model/abstract.py index <HASH>..<HASH> 100644 --- a/autofit/mapper/prior_model/abstract.py +++ b/autofit/mapper/prior_model/abstract.py @@ -676,7 +676,7 @@ class AbstractPriorModel(AbstractModel): } @property - def info(self): + def info(self) -> str: """ Use the priors that make up the model_mapper to generate information on each parameter of the overall model. diff --git a/autofit/optimize/non_linear/output.py b/autofit/optimize/non_linear/output.py index <HASH>..<HASH> 100644 --- a/autofit/optimize/non_linear/output.py +++ b/autofit/optimize/non_linear/output.py @@ -262,9 +262,8 @@ class AbstractOutput: self.create_paramnames_file() - text_util.output_list_of_strings_to_file( - file=self.paths.file_model_info, list_of_strings=self.model.info - ) + with open(self.paths.file_model_info, "w+") as f: + f.write(self.model.info) def latex_results_at_sigma(self, sigma, format_str="{:.2f}"):
don't use the silly util functions
rhayes777_PyAutoFit
train
py,py
f46b6dbc15d4b08dd4c33acb93880ae31b9ccc69
diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/session.rb +++ b/lib/capybara/session.rb @@ -114,13 +114,13 @@ module Capybara end def within_fieldset(locator) - within XPath.fieldset(locator) do + within :xpath, XPath.fieldset(locator) do yield end end def within_table(locator) - within XPath.table(locator) do + within :xpath, XPath.table(locator) do yield end end
Always use XPath for within Fails when default selector is CSS
teamcapybara_capybara
train
rb
bc3c2c899fa9752c3387bedc8949dc2d1809befb
diff --git a/master/buildbot/test/unit/reporters/test_generators_utils.py b/master/buildbot/test/unit/reporters/test_generators_utils.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/unit/reporters/test_generators_utils.py +++ b/master/buildbot/test/unit/reporters/test_generators_utils.py @@ -78,6 +78,17 @@ class TestBuildGenerator(ConfigErrorsMixin, TestReactorMixin, with self.assertRaisesConfigError('must be a list or None'): g.check() + @parameterized.expand([ + ('unknown_str', 'unknown', 'not a valid mode'), + ('unknown_list', ['unknown'], 'not a valid mode'), + ('unknown_list_two', ['unknown', 'failing'], 'not a valid mode'), + ('all_in_list', ['all', 'failing'], 'must be passed in as a separate string'), + ]) + def test_tag_check_raises(self, name, mode, expected_exception): + g = self.create_generator(mode=mode) + with self.assertRaisesConfigError(expected_exception): + g.check() + def test_subject_newlines_not_allowed(self): g = self.create_generator(subject='subject\nwith\nnewline') with self.assertRaisesConfigError('Newlines are not allowed'):
test: Add test for tag check logic in build status generators
buildbot_buildbot
train
py
f384ebf6958b275f8fd10cdd8b30029fc7e929fc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import sys if sys.version_info < (3,): - sys.exit('scanpy requires Python >= 3.5') + sys.exit('scanpy requires Python >= 3.6') from pathlib import Path from setuptools import setup, find_packages @@ -22,7 +22,7 @@ setup( author=__author__, author_email=__email__, license='BSD', - python_requires='>=3.5', + python_requires='>=3.6', install_requires=[ l.strip() for l in Path('requirements.txt').read_text('utf-8').splitlines()
we need <I> by now
theislab_scanpy
train
py
18db397d8d7ff9972fe5f141931aba6cb52030fe
diff --git a/core-bundle/contao/library/Contao/Automator.php b/core-bundle/contao/library/Contao/Automator.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/library/Contao/Automator.php +++ b/core-bundle/contao/library/Contao/Automator.php @@ -302,6 +302,11 @@ class Automator extends \System { foreach (scan(TL_ROOT . '/share') as $file) { + if (is_dir(TL_ROOT . '/share/' . $file)) + { + continue; // see #6652 + } + $objFile = new \File('share/' . $file, true); if ($objFile->extension == 'xml' && !in_array($objFile->filename, $arrFeeds))
[Core] Skip directories when purging XML files (see #<I>)
contao_contao
train
php
14f00b1c4de5be7eceba0f5e387d059656018d95
diff --git a/View/AnnotationTemplateListener.php b/View/AnnotationTemplateListener.php index <HASH>..<HASH> 100644 --- a/View/AnnotationTemplateListener.php +++ b/View/AnnotationTemplateListener.php @@ -126,13 +126,16 @@ class AnnotationTemplateListener */ protected function guessTemplateName($controller, Request $request) { - if (!preg_match('/Controller\\\(.*)Controller$/', get_class($controller[0]), $match)) { + if (!preg_match('/Controller\\\(.*)Controller$/', get_class($controller[0]), $matchController)) { throw new \InvalidArgumentException(sprintf('The "%s" class does not look like a controller class (it does not end with Controller)', get_class($controller[0]))); } - + if (!preg_match('/(.*)Action$/', $controller[1], $matchAction)) { + throw new \InvalidArgumentException(sprintf('The "%s" method does not look like an action method (it does not end with Action)', $controller[1])); + } + $bundle = $this->getBundleForClass(get_class($controller[0])); - return new TemplateReference($bundle->getName(), $match[1], substr($controller[1], 0, -6), $request->getRequestFormat(), 'twig'); + return new TemplateReference($bundle->getName(), $matchController[1], $matchAction[1], $request->getRequestFormat(), 'twig'); } /**
Check the action method naming against the conventions instead of just cutting the last six characters.
sensiolabs_SensioFrameworkExtraBundle
train
php
4cb3e7a9b16b33b9d486d43d48b57b764590d5d4
diff --git a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java index <HASH>..<HASH> 100644 --- a/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java +++ b/jcvideoplayer-lib/src/main/java/fm/jiecao/jcvideoplayer_lib/JCVideoPlayer.java @@ -683,7 +683,6 @@ public class JCVideoPlayer extends FrameLayout implements View.OnClickListener, public static void releaseAllVideos() { if (!isClickFullscreen) { JCMediaManager.intance().mediaPlayer.stop(); - JCMediaManager.intance().mediaPlayer = null; JCMediaManager.intance().setUuid(""); JCMediaManager.intance().setUuid(""); EventBus.getDefault().post(new VideoEvents().setType(VideoEvents.VE_MEDIAPLAYER_FINISH_COMPLETE));
fix a bug mediaplayer should alwayse not be null
lipangit_JiaoZiVideoPlayer
train
java
464dabdcf8524b2023dc1f418cf8e95403f9f8f5
diff --git a/src/video/canvas_renderer.js b/src/video/canvas_renderer.js index <HASH>..<HASH> 100644 --- a/src/video/canvas_renderer.js +++ b/src/video/canvas_renderer.js @@ -198,9 +198,14 @@ * @param {Number} dy the y position to draw the image at on the screen * @param {Number} dw the width value to draw the image at on the screen * @param {Number} dh the height value to draw the image at on the screen + * Can be used in three ways: + * me.CanvasRenderer.drawImage(image, dx, dy); + * me.CanvasRenderer.drawImage(image, dx, dy, dw, dh); + * me.CanvasRenderer.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh); + * dx, dy, dw, dh being the destination target & dimensions. sx, sy, sw, sh being the position & dimensions to take from the image */ - api.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { - backBufferContext2D.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh); + api.drawImage = function () { + backBufferContext2D.drawImage.apply(backBufferContext2D, arguments); }; /**
changed drawImage to apply the arguments, supports all 3 calls of draw image removed params to satisfy lint fixed apply call
melonjs_melonJS
train
js
260faee29e2cce68f39e28a640f090a01d40fe1c
diff --git a/src/Psalm/Internal/Codebase/Functions.php b/src/Psalm/Internal/Codebase/Functions.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/Codebase/Functions.php +++ b/src/Psalm/Internal/Codebase/Functions.php @@ -457,7 +457,7 @@ class Functions 'set_error_handler', 'user_error', 'trigger_error', 'restore_error_handler', 'date_default_timezone_set', 'assert_options', 'setlocale', 'set_exception_handler', 'set_time_limit', 'putenv', 'spl_autoload_register', - 'spl_autoload_unregister', 'microtime', 'array_rand', + 'spl_autoload_unregister', 'microtime', 'array_rand', 'set_include_path', // logging 'openlog', 'syslog', 'error_log', 'define_syslog_variables',
Mark `set_include_path()` as impure
vimeo_psalm
train
php
e68f974aee1f6d0e07c5e759858439462e157eb5
diff --git a/lib/hitimes.rb b/lib/hitimes.rb index <HASH>..<HASH> 100644 --- a/lib/hitimes.rb +++ b/lib/hitimes.rb @@ -29,13 +29,21 @@ require 'hitimes/version' # Load the binary extension, try loading one for the specific version of ruby # and if that fails, then fall back to one in the top of the library. # this is the method recommended by rake-compiler -begin - # this will be for windows - require "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}/hitimes" -rescue LoadError - # everyone else. - require 'hitimes/hitimes' + +attempts = [ + "hitimes/#{RUBY_VERSION.sub(/\.\d$/,'')}/hitimes", + "hitimes/hitimes" +] +loaded = false + +attempts.each do |path| + begin + require path + loaded = true + rescue LoadError + end end +raise LoadError, "Unable to find binary extension, was hitimes installed correctly?" unless loaded require 'hitimes/stats' require 'hitimes/mutexed_stats'
Detect rare binary file missing situation Closes #<I>
copiousfreetime_hitimes
train
rb
e16c9578af7015b2b69a7769e0dbb4c55223727b
diff --git a/src/TopGames/Support/Helpers.php b/src/TopGames/Support/Helpers.php index <HASH>..<HASH> 100644 --- a/src/TopGames/Support/Helpers.php +++ b/src/TopGames/Support/Helpers.php @@ -244,7 +244,7 @@ class Helpers { * @param int $offset = 0 * @return string */ - function getTodayDate($offset = 0) + function getDate($offset = 0) { return date("Y-m-d", strtotime($offset.' day')); } @@ -255,7 +255,7 @@ class Helpers { * @param int $offset = 0 * @return string */ - function getTodayTime($offset = 0) + function getTime($offset = 0) { return date("H:i:s", strtotime($offset.' minutes')); }
Updated Helpers' Date and Time methods
micheleangioni_support
train
php
d9c111e9ba461b55bd536a529d57b8e89401d026
diff --git a/lib/Thulium/ViewPathResolver.php b/lib/Thulium/ViewPathResolver.php index <HASH>..<HASH> 100644 --- a/lib/Thulium/ViewPathResolver.php +++ b/lib/Thulium/ViewPathResolver.php @@ -14,7 +14,7 @@ class ViewPathResolver private static function getViewPostfix() { - $contentType = Arrays::first(explode(';', $_SERVER["CONTENT_TYPE"])); + $contentType = Arrays::first(explode(';', Arrays::getValue($_SERVER, "CONTENT_TYPE"))); if ($contentType == 'text/xml') { return '.xml.phtml'; } else {
Fixed undefined index CONTENT_TYPE in viewPathResolver.
letsdrink_ouzo
train
php
7d743ebd3dcf26ba6f0b70797a9e74b64fb11320
diff --git a/lib/rubicure/core.rb b/lib/rubicure/core.rb index <HASH>..<HASH> 100644 --- a/lib/rubicure/core.rb +++ b/lib/rubicure/core.rb @@ -57,16 +57,16 @@ module Rubicure def all_girls(arg = Time.current) date = to_date(arg) - unless @all_stars - @all_stars = [] + unless @all_girls + @all_girls = [] Rubicure::Girl.names.each do |girl_name| - @all_stars << Rubicure::Girl.find(girl_name) + @all_girls << Rubicure::Girl.find(girl_name) end - @all_stars.uniq!(&:human_name) + @all_girls.uniq!(&:human_name) end - @all_stars.select { |girl| girl.created_date && girl.created_date <= date } + @all_girls.select { |girl| girl.created_date && girl.created_date <= date } end alias_method :all, :all_girls
Rename: @all_stars -> @all_girls
sue445_rubicure
train
rb
abdc5573dabbf901a6d5989002bb2ab4a5d33450
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -98,7 +98,7 @@ ClientRequest.prototype._onFinish = function () { var headersObj = self._headers var body - if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') { + if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH' || opts.method === 'MERGE') { if (capability.blobConstructor) { body = new global.Blob(self._body.map(function (buffer) { return toArrayBuffer(buffer)
Add payload for Microsoft Azure Storage MERGE method
jhiesey_stream-http
train
js
a3d348d02638bb36e72abe11f344bd18bbf53d54
diff --git a/components/graph/git-graph-actions.js b/components/graph/git-graph-actions.js index <HASH>..<HASH> 100644 --- a/components/graph/git-graph-actions.js +++ b/components/graph/git-graph-actions.js @@ -290,7 +290,8 @@ GraphActions.CherryPick = function(graph, node) { this.node = node; this.visible = ko.computed(function() { if (self.performProgressBar.running()) return true; - return self.graph.currentActionContext() == self.node + var context = self.graph.currentActionContext(); + return context === self.node && self.graph.HEAD() && context.sha1 !== self.graph.HEAD().sha1 }); } inherits(GraphActions.CherryPick, GraphActions.ActionBase);
Instead of handling self cherry pick, disallow self cherrypick
FredrikNoren_ungit
train
js
965a195b70f36f67cf675a2f85c0db2a23fce5d8
diff --git a/acceptance/ui/features/steps/applications_steps.rb b/acceptance/ui/features/steps/applications_steps.rb index <HASH>..<HASH> 100644 --- a/acceptance/ui/features/steps/applications_steps.rb +++ b/acceptance/ui/features/steps/applications_steps.rb @@ -154,9 +154,10 @@ def addService(name, pool, id) end def addTemplate(dir) - id = `/capybara/serviced --endpoint #{HOST_IP}:4979 template compile #{dir} | /capybara/serviced --endpoint #{HOST_IP}:4979 template add` + servicedCLI = getServicedCLI() + id = `#{servicedCLI} template compile #{dir} | #{servicedCLI} template add` `sleep 1` - return `[ -z "$(/capybara/serviced template list #{id})" ] && return 1` + return `[ -z "$(#{servicedCLI} template list #{id})" ] && return 1` end def closeDeployWizard()
Use a common method to get path to serviced CLI with proper --endpoint
control-center_serviced
train
rb