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
6b063bf473f3596b7ed3cf57bb5f550c8b906d9c
diff --git a/src/Command/Project/ProjectCreateCommand.php b/src/Command/Project/ProjectCreateCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/Project/ProjectCreateCommand.php +++ b/src/Command/Project/ProjectCreateCommand.php @@ -42,8 +42,23 @@ class ProjectCreateCommand extends CommandBase $this->form->configureInputDefinition($this->getDefinition()); $this->addOption('check-timeout', null, InputOption::VALUE_REQUIRED, 'The API timeout while checking the project status', 30) - ->addOption('timeout', null, InputOption::VALUE_REQUIRED, 'The total timeout for all API checks', 900); + ->addOption('timeout', null, InputOption::VALUE_REQUIRED, 'The total timeout for all API checks (0 to disable the timeout)', 900); + $this->setHelp(<<<EOF +Use this command to create a new project. + +An interactive form will be presented with the available options. But if the +command is run non-interactively (with --yes), the form will not be displayed, +and the --region option will be required. + +A project subscription will be requested, and then checked periodically (every 3 +seconds) until the project has been activated, or until the process times out +(after 15 minutes by default). + +If known, the project ID will be output to STDOUT. All other output will be sent +to STDERR. +EOF + ); } /**
[project:create] add detailed help
platformsh_platformsh-cli
train
php
bfde3894abcd5245b05c6f64c222a583269667d4
diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index <HASH>..<HASH> 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -30,7 +30,7 @@ class Subscription extends Resource const STATUS_ACTIVE = 'active'; const STATUS_REQUESTED = 'requested'; const STATUS_PROVISIONING = 'provisioning'; - const STATUS_FAILED = 'provisioning Failure'; + const STATUS_FAILED = 'provisioning failure'; const STATUS_SUSPENDED = 'suspended'; const STATUS_DELETED = 'deleted'; @@ -115,7 +115,8 @@ class Subscription extends Resource * * This could be one of Subscription::STATUS_ACTIVE, * Subscription::STATUS_REQUESTED, Subscription::STATUS_PROVISIONING, - * Subscription::STATUS_SUSPENDED, or Subscription::STATUS_DELETED. + * Subscription::STATUS_FAILED, Subscription::STATUS_SUSPENDED, + * or Subscription::STATUS_DELETED. * * @return string */
Fix wrong case in Subscription::STATUS_FAILED constant
platformsh_platformsh-client-php
train
php
44725aed45b47e3c7167579bfd622323c2aaf415
diff --git a/src/SteamAuth.php b/src/SteamAuth.php index <HASH>..<HASH> 100644 --- a/src/SteamAuth.php +++ b/src/SteamAuth.php @@ -217,7 +217,7 @@ class SteamAuth implements SteamAuthInterface */ public function parseSteamID() { - preg_match("#^https://steamcommunity.com/openid/id/([0-9]{17,25})#", $this->request->get('openid_claimed_id'), $matches); + preg_match("#^https?://steamcommunity.com/openid/id/([0-9]{17,25})#", $this->request->get('openid_claimed_id'), $matches); $this->steamId = is_numeric($matches[1]) ? $matches[1] : 0; }
Make the `s` in https optional in case Valve changes their mind
invisnik_laravel-steam-auth
train
php
eedb1278e2395b6a508e41002aa7ecca7844880a
diff --git a/drools-decisiontables/src/test/java/org/drools/decisiontable/UnicodeInXLSTest.java b/drools-decisiontables/src/test/java/org/drools/decisiontable/UnicodeInXLSTest.java index <HASH>..<HASH> 100644 --- a/drools-decisiontables/src/test/java/org/drools/decisiontable/UnicodeInXLSTest.java +++ b/drools-decisiontables/src/test/java/org/drools/decisiontable/UnicodeInXLSTest.java @@ -34,7 +34,7 @@ public class UnicodeInXLSTest { if (kbuilder.hasErrors()) { System.out.println(kbuilder.getErrors().toString()); System.out.println(DecisionTableFactory.loadFromInputStream(getClass().getResourceAsStream("unicode.xls"), dtconf)); - fail("Cannot build XLS decision table containing utf-8 characters."); + fail("Cannot build XLS decision table containing utf-8 characters\n" + kbuilder.getErrors().toString() ); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
Added additional error information to failing test
kiegroup_drools
train
java
b6578835c7dfe14bbf2c0b5b32e9c1a3e54e8987
diff --git a/src/Illuminate/Encryption/Encrypter.php b/src/Illuminate/Encryption/Encrypter.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Encryption/Encrypter.php +++ b/src/Illuminate/Encryption/Encrypter.php @@ -114,6 +114,8 @@ class Encrypter implements EncrypterContract * * @param string $value * @return string + * + * @throws \Illuminate\Contracts\Encryption\EncryptException */ public function encryptString($value) { @@ -154,6 +156,8 @@ class Encrypter implements EncrypterContract * * @param string $payload * @return string + * + * @throws \Illuminate\Contracts\Encryption\DecryptException */ public function decryptString($payload) {
Add encrypter throws docblock (#<I>)
laravel_framework
train
php
a4ec2e1b168d4df14e3c91119f65589bfbb98255
diff --git a/lib/compiless.js b/lib/compiless.js index <HASH>..<HASH> 100644 --- a/lib/compiless.js +++ b/lib/compiless.js @@ -3,8 +3,7 @@ var Path = require('path'), fs = require('fs'), async = require('async'), _ = require('underscore'), - passError = require('passerror'), - less = require('less'); + passError = require('passerror'); require('express-hijackresponse'); require('bufferjs'); @@ -27,6 +26,7 @@ module.exports = function compiless(options) { if (!options || !options.root) { throw new Error('options.root is mandatory'); } + var less = options.less || require('less'); return function (req, res, next) { if ((req.headers.accept && req.accepts('text/css')) || /\.less(?:\?.*)?$/.test(req.url)) { // Prevent If-None-Match revalidation with the downstream middleware with ETags that aren't suffixed with "-compiless":
Made the 'less' module a config option so that the caller can choose to up- or downgrade the bundled version.
papandreou_express-compiless
train
js
0687e5552c305dbea4a39987b65151c3f6a73640
diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index <HASH>..<HASH> 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -57,7 +57,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $htmleditors[$editor] = $editor; } $temp->add(new admin_setting_configselect('defaulthtmleditor', get_string('defaulthtmleditor', 'admin'), null, 'tinymce', $htmleditors)); - $temp->add(new admin_setting_configcheckbox('usehtmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1)); + $temp->add(new admin_setting_configcheckbox('htmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1)); $ADMIN->add('htmleditor', $temp); $temp = new admin_settingpage('htmlarea', get_string('htmlarea', 'admin'));
MDL-<I> - Correction to previous change: going back to previous variable name, to prevent bugs
moodle_moodle
train
php
bbaacb56463df9285099a5627e86fceb45316c73
diff --git a/src/ContaoCommunityAlliance/UrlBuilder/UrlBuilder.php b/src/ContaoCommunityAlliance/UrlBuilder/UrlBuilder.php index <HASH>..<HASH> 100644 --- a/src/ContaoCommunityAlliance/UrlBuilder/UrlBuilder.php +++ b/src/ContaoCommunityAlliance/UrlBuilder/UrlBuilder.php @@ -86,7 +86,10 @@ class UrlBuilder $parsed = parse_url($url); // If only one field present it is the path which must be mapped to the query string. - if ((count($parsed) === 1) && isset($parsed['path'])) { + if ((count($parsed) === 1) + && isset($parsed['path']) + && (0 === strpos($parsed['path'], '?') || false !== strpos($parsed['path'], '&')) + ) { $parsed = array( 'query' => $parsed['path'] );
Only treat path as query if it really is one
contao-community-alliance_url-builder
train
php
2096f00990887f0cc1d176ebde28401511460df5
diff --git a/nfc/tag/tt1_broadcom.py b/nfc/tag/tt1_broadcom.py index <HASH>..<HASH> 100644 --- a/nfc/tag/tt1_broadcom.py +++ b/nfc/tag/tt1_broadcom.py @@ -49,7 +49,7 @@ class Topaz(tt1.Type1Tag): unless the wipe argument is set. """ - return super(Type1Tag, self).format(version, wipe) + return super(tt1.Type1Tag, self).format(version, wipe) def _format(self, version, wipe): tag_memory = tt1.Type1TagMemoryReader(self) @@ -76,7 +76,7 @@ class Topaz(tt1.Type1Tag): have any effect. """ - return super(Type1Tag, self).protect( + return super(tt1.Type1Tag, self).protect( password, read_protect, protect_from) def _protect(self, password, read_protect, protect_from): @@ -109,7 +109,7 @@ class Topaz512(tt1.Type1Tag): unless the wipe argument is set. """ - return super(Type1Tag, self).format(version, wipe) + return super(tt1.Type1Tag, self).format(version, wipe) def _format(self, version, wipe): tag_memory = tt1.Type1TagMemoryReader(self) @@ -138,7 +138,7 @@ class Topaz512(tt1.Type1Tag): have any effect. """ - return super(Type1Tag, self).protect( + return super(tt1.Type1Tag, self).protect( password, read_protect, protect_from) def _protect(self, password, read_protect, protect_from):
Type1Tag is imported under tt1 in tt1_broadcom
nfcpy_nfcpy
train
py
2835083ababf17cd7bbe628559fa662cf3d42093
diff --git a/examples/chat/model.js b/examples/chat/model.js index <HASH>..<HASH> 100755 --- a/examples/chat/model.js +++ b/examples/chat/model.js @@ -61,8 +61,15 @@ function setup (channelHex, nick, onReady) { render(doc) } - // FIXME: Commit something to the document? + // Hack alert!!!!! hm.on('peer:joined', () => { + setTimeout(() => { + doc = hm.update( + Automerge.change(doc, changeDoc => { + changeDoc.messages[Date.now()] = {} + }) + ) + }, 1000) }) // This callback is supplied to the onReady callback - it is used diff --git a/examples/chat/ui.js b/examples/chat/ui.js index <HASH>..<HASH> 100755 --- a/examples/chat/ui.js +++ b/examples/chat/ui.js @@ -37,7 +37,9 @@ function render (renderDoc) { if (joined) { displayMessages.push(`${nick} has joined.`) } else { - displayMessages.push(`${nick}: ${message}`) + if (message) { + displayMessages.push(`${nick}: ${message}`) + } } }) // Delete old messages
Implement workaround for getting new peers into the document Waiting on a timeout is not very nice, but it mostly works.
automerge_hypermerge
train
js,js
76a22fee99d5985f09826f7317b7ce71653c7671
diff --git a/lib/writeexcel/workbook.rb b/lib/writeexcel/workbook.rb index <HASH>..<HASH> 100644 --- a/lib/writeexcel/workbook.rb +++ b/lib/writeexcel/workbook.rb @@ -78,7 +78,6 @@ class Workbook < BIFFWriter @biffsize = 0 @sheet_count = 0 @chart_count = 0 - @url_format = '' @codepage = 0x04E4 @country = 1 @worksheets = []
* delete meaningless @url_format value set.
cxn03651_writeexcel
train
rb
3908a52310ac9d9e53db186fce6d74cd8c324168
diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index <HASH>..<HASH> 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -141,14 +141,14 @@ class qtype_multianswer extends question_type { if ($previousid != 0 && $previousid != $wrapped->id) { // for some reasons a new question has been created // so delete the old one - delete_question($previousid); + question_delete_question($previousid); } } // Delete redundant wrapped questions if (is_array($oldwrappedquestions) && count($oldwrappedquestions)) { foreach ($oldwrappedquestions as $oldwrappedquestion) { - delete_question($oldwrappedquestion->id); + question_delete_question($oldwrappedquestion->id); } }
MDL-<I> qtype multianswer refers to old name for the question_delete_questions function.
moodle_moodle
train
php
a725efad7a54fccc388e4b5aaad489a02a09f124
diff --git a/scriptcwl/step.py b/scriptcwl/step.py index <HASH>..<HASH> 100644 --- a/scriptcwl/step.py +++ b/scriptcwl/step.py @@ -13,14 +13,19 @@ from .reference import Reference # Helper function to make the import of cwltool.load_tool quiet @contextmanager def quiet(): + # save stdout/stderr + # Jupyter doesn't support setting it back to + # sys.__stdout__ and sys.__stderr__ + _sys_stdout = sys.stdout + _sys_stderr = sys.stderr # Divert stdout and stderr to devnull sys.stdout = sys.stderr = open(os.devnull, "w") try: yield finally: # Revert back to standard stdout/stderr - sys.stdout = sys.__stdout__ - sys.stderr = sys.__stderr__ + sys.stdout = _sys_stdout + sys.stderr = _sys_stderr # import cwltool.load_tool functions
don't set sys.stdout and sys.stderr back to sys.__stdout__ and sys.__stderr__. This doesn't work in Jupyter notebooks, so save previous state to variable instead and setting back to saved state
NLeSC_scriptcwl
train
py
8ace3505c13c6166fb2cfdf02bac89a090ff43a5
diff --git a/app/scripts/TiledPlot.js b/app/scripts/TiledPlot.js index <HASH>..<HASH> 100644 --- a/app/scripts/TiledPlot.js +++ b/app/scripts/TiledPlot.js @@ -982,8 +982,11 @@ class TiledPlot extends React.Component { * Try to zoom in or out so that the bounds of the view correspond to the * extent of the data. */ - const minPos = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]; - const maxPos = [Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER]; + const maxSafeInt = Number.MAX_SAFE_INTEGER; + const minSafeInt = Number.MIN_SAFE_INTEGER; + console.log(maxSafeInt, minSafeInt); + const minPos = [maxSafeInt, maxSafeInt]; + const maxPos = [minSafeInt, minSafeInt]; const trackObjectsToCheck = this.listAllTrackObjects();
Fix strange zoomToData issue This seems to be an issue with babel rather than HiGlass
higlass_higlass
train
js
472984facce35c92ec6a50f5f40e68975bc7c14a
diff --git a/app/src/Bolt/Storage.php b/app/src/Bolt/Storage.php index <HASH>..<HASH> 100644 --- a/app/src/Bolt/Storage.php +++ b/app/src/Bolt/Storage.php @@ -2481,6 +2481,20 @@ class Storage array(\PDO::PARAM_INT, \PDO::PARAM_STR) )->fetchAll(); + // And the other way around.. + $query = sprintf( + "SELECT id, from_contenttype AS to_contenttype, from_id AS to_id FROM %s WHERE to_id=? AND to_contenttype=?", + $tablename + ); + $currentvalues2 = $this->app['db']->executeQuery( + $query, + array($content_id, $contenttype), + array(\PDO::PARAM_INT, \PDO::PARAM_STR) + )->fetchAll(); + + // Merge them. + $currentvalues = array_merge($currentvalues, $currentvalues2); + // Delete the ones that have been removed. foreach ($currentvalues as $currentvalue) {
Allow removal of relations, if relations were originally created from 'the other end'.
bolt_bolt
train
php
d0717ee458465c981ce993654246df4d083be597
diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -425,15 +425,11 @@ class Parser /** * Checks if the given token indicates a mathematical operator. * - * @return boolean TRUE is the token is a mathematical operator, FALSE otherwise. + * @return boolean TRUE if the token is a mathematical operator, FALSE otherwise. */ private function _isMathOperator($token) { - if (in_array($token['value'], array("+", "-", "/", "*"))) { - return true; - } - - return false; + return in_array($token['value'], array("+", "-", "/", "*")); } /**
Fixed typo and simplified method as mentioned in an earlier comment.
doctrine_orm
train
php
d4cc65856a6e80409aef843b8de11184b60bea17
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -59,17 +59,6 @@ REQUIREMENTS = [ 'google-cloud-storage', ] -GRPC_PACKAGES = [ - 'grpcio >= 1.0.0', - 'google-gax >= 0.14.1, < 0.15dev', - 'gapic-google-logging-v2 >= 0.9.0, < 0.10dev', - 'grpc-google-logging-v2 >= 0.9.0, < 0.10dev', -] - -RTD_ENV_VAR = 'READTHEDOCS' -if RTD_ENV_VAR not in os.environ: - REQUIREMENTS.extend(GRPC_PACKAGES) - setup( name='google-cloud', version='0.20.0dev',
Remove logging deps from setup.py. In the process removing GRPC_PACKAGES entirely.
googleapis_google-cloud-python
train
py
514adc7cf8633cb0439bde0df9173dc8dd11866f
diff --git a/packages/demos-react/.pundle.js b/packages/demos-react/.pundle.js index <HASH>..<HASH> 100644 --- a/packages/demos-react/.pundle.js +++ b/packages/demos-react/.pundle.js @@ -5,9 +5,9 @@ const mainTSConfig = require('../../tsconfig'); module.exports = { entry: ['./src/mount.tsx'], output: { - bundlePath: '/dist/bundle.js', + bundlePath: './site/dist/bundle.js', sourceMap: true, - sourceMapPath: '/dist/bundle.js.map', + sourceMapPath: './site/dist/bundle.js.map', }, server: { port: 8080,
[fixed] deploy path Reviewers: O3 Material JavaScript platform reviewers, #material_motion, O2 Material Motion, featherless Reviewed By: #material_motion, O2 Material Motion, featherless Tags: #material_motion Differential Revision: <URL>
material-motion_material-motion-js
train
js
478168cb3b77f8d1b18a66125a3b3029ea644a4b
diff --git a/core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/transformers/BatchStatementTransformer.java b/core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/transformers/BatchStatementTransformer.java index <HASH>..<HASH> 100644 --- a/core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/transformers/BatchStatementTransformer.java +++ b/core/metrics-core-impl/src/main/java/org/hawkular/metrics/core/impl/transformers/BatchStatementTransformer.java @@ -32,7 +32,7 @@ import rx.functions.Func0; * @author Thomas Segismont */ public class BatchStatementTransformer implements Transformer<Statement, BatchStatement> { - public static final int MAX_BATCH_SIZE = 64; + public static final int MAX_BATCH_SIZE = 10; /** * Creates {@link com.datastax.driver.core.BatchStatement.Type#UNLOGGED} batch statements.
HWKMETRICS-<I> Warning about batch size threshold in the logs Use more conservative value since warnings are still present on Openshift.
hawkular_hawkular-metrics
train
java
b037ecb82ba5f8791433f57de31a90fb57fe986d
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -190,9 +190,10 @@ util.getFileReplacement = function( src, settings, callback ) { var fileName = util.getInlineFilePath( src, settings.relativeTo ); var mimetype = mime.getType( fileName ); - var base64 = fs.readFileSync( fileName, 'base64' ); - var datauri = `data:${mimetype};base64,${base64}`; - callback( null, datauri ); + fs.readFile( fileName, 'base64', function( err, base64 ) { + var datauri = `data:${mimetype};base64,${base64}`; + callback( err, datauri ); + } ); } };
Use callback version of readFile
jrit_web-resource-inliner
train
js
ed256db610163f796379c32beea1a3db656ae034
diff --git a/billy/importers/bills.py b/billy/importers/bills.py index <HASH>..<HASH> 100644 --- a/billy/importers/bills.py +++ b/billy/importers/bills.py @@ -85,7 +85,7 @@ def import_bill(data, votes, categorizer): # clean up bill_ids data['bill_id'] = fix_bill_id(data['bill_id']) data['alternate_bill_ids'] = [fix_bill_id(bid) for bid in - data['alternate_bill_ids']] + data.get('alternate_bill_ids', [])] # move subjects to scraped_subjects # NOTE: intentionally doesn't copy blank lists of subjects
fix case of missing alternate_bill_ids
openstates_billy
train
py
a468c15b6c3d1bd86c846cd0db44d8ca207b2bec
diff --git a/test/types/exec.rb b/test/types/exec.rb index <HASH>..<HASH> 100755 --- a/test/types/exec.rb +++ b/test/types/exec.rb @@ -524,6 +524,8 @@ class TestExec < Test::Unit::TestCase end def test_missing_checks_cause_failures + # Solaris's sh exits with 1 here instead of 127 + return if Facter.value(:operatingsystem) == "Solaris" exec = Puppet::Type.newexec( :command => "echo true", :path => ENV["PATH"],
Disabling a test on solaris, since apparently sh on solaris is different than everywhere else git-svn-id: <URL>
puppetlabs_puppet
train
rb
3fa57c7c441d7ea90a0b813e92aaf519a5eb011f
diff --git a/src/main/java/org/asteriskjava/manager/event/QueueMemberStatusEvent.java b/src/main/java/org/asteriskjava/manager/event/QueueMemberStatusEvent.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/manager/event/QueueMemberStatusEvent.java +++ b/src/main/java/org/asteriskjava/manager/event/QueueMemberStatusEvent.java @@ -29,8 +29,9 @@ public class QueueMemberStatusEvent extends QueueMemberEvent */ private static final long serialVersionUID = -2293926744791895763L; - String ringinuse; - String iface; + private String ringinuse; + private String iface; + private Integer incall; /** * @param source @@ -65,4 +66,16 @@ public class QueueMemberStatusEvent extends QueueMemberEvent { this.ringinuse = ringinuse; } + + public Integer getIncall() + { + return incall; + } + + public void setIncall(Integer incall) + { + this.incall = incall; + } + + }
WARN [Asterisk-Java ManagerConnection-0-Reader-0] (AbstractBuilder.java:<I>) - Unable to set property 'incall' to '0' on org.asteriskjava.manager.event.QueueMemberStatusEvent: no setter. Please report at <URL>
asterisk-java_asterisk-java
train
java
ef374b7be5ab1a556cded83083340edb6a2d28ad
diff --git a/src/view/element-own-attached.js b/src/view/element-own-attached.js index <HASH>..<HASH> 100644 --- a/src/view/element-own-attached.js +++ b/src/view/element-own-attached.js @@ -15,7 +15,7 @@ var NodeType = require('./node-type'); var elementGetTransition = require('./element-get-transition'); var getEventListener = require('./get-event-listener'); var warnEventListenMethod = require('./warn-event-listen-method'); -const handleError = require('../util/handle-error'); +var handleError = require('../util/handle-error'); /** * 双绑输入框CompositionEnd事件监听函数
fix: const handleError to var
baidu_san
train
js
4f5d6f71b516c59b225e3c5231665058c0060d15
diff --git a/tests/test_animalqtl.py b/tests/test_animalqtl.py index <HASH>..<HASH> 100644 --- a/tests/test_animalqtl.py +++ b/tests/test_animalqtl.py @@ -6,15 +6,15 @@ from dipper.sources.AnimalQTLdb import AnimalQTLdb from tests.test_source import SourceTestCase logging.basicConfig(level=logging.WARNING) -logger = logging.getLogger(__name__) +LOG = logging.getLogger(__name__) class AnimalQTLdbTestCase(SourceTestCase): def setUp(self): self.source = AnimalQTLdb('rdf_graph', True) - self.source.gene_ids = self._get_conf()['test_ids']['gene'] - self.source.disease_ids = self._get_conf()['test_ids']['disease'] + self.source.gene_ids = self.source.all_test_ids['gene'] + self.source.disease_ids = self.source.all_test_ids['disease'] self.source.settestonly(True) self._setDirToSource() return
conventions & use common test ids
monarch-initiative_dipper
train
py
d409594c01e11e05a59f5614722dd3035855e399
diff --git a/salt/returners/redis_return.py b/salt/returners/redis_return.py index <HASH>..<HASH> 100644 --- a/salt/returners/redis_return.py +++ b/salt/returners/redis_return.py @@ -21,4 +21,7 @@ def returner(ret): host=__opts__['redis.host'], port=__opts__['redis.port'], db=__opts__['redis.db']) - serv.set(ret['id'] + ':' + ret['jid'], json.dumps(ret['return'])) + serv.sadd(ret['id'] + 'jobs', ret['jid']) + serv.set(ret['jid'] + ':' + ret['id'], json.dumps(ret['return'])) + serv.sadd('jobs', ret['jid']) + serv.sadd(ret['jid'], ret['id'])
Change the redis returner to better use data structures
saltstack_salt
train
py
047131a43a4139702a76a51877de0a688d981c26
diff --git a/interact.js b/interact.js index <HASH>..<HASH> 100644 --- a/interact.js +++ b/interact.js @@ -5577,6 +5577,7 @@ * interact.margin [ method ] * + * Deprecated. Use `interact(target).resizable({ margin: number });` instead. * Returns or sets the margin for autocheck resizing used in * @Interactable.getAction. That is the distance from the bottom and right * edges of an element clicking in which will start resizing @@ -5584,14 +5585,15 @@ - newValue (number) #optional = (number | interact) The current margin value or interact \*/ - interact.margin = function (newvalue) { + interact.margin = warnOnce(function (newvalue) { if (isNumber(newvalue)) { margin = newvalue; return interact; } return margin; - }; + }, + 'interact.margin is deprecated. Use interact(target).resizable({ margin: number }); instead.') ; /*\ * interact.supportsTouch
Mark interact.margin as deprecated Suggest providing `margin` property in the resizable method's options.
taye_interact.js
train
js
0b7f4e041c3ade869ec812f87398127d7003caa9
diff --git a/src/fonduer/utils/utils_visual.py b/src/fonduer/utils/utils_visual.py index <HASH>..<HASH> 100644 --- a/src/fonduer/utils/utils_visual.py +++ b/src/fonduer/utils/utils_visual.py @@ -1,9 +1,17 @@ -from collections import namedtuple +from typing import NamedTuple from fonduer.candidates.models.span_mention import TemporarySpanMention from fonduer.parser.models import Sentence -Bbox = namedtuple("bbox", ["page", "top", "bottom", "left", "right"]) + +class Bbox(NamedTuple): + """Bounding box.""" + + page: int + top: int + bottom: int + left: int + right: int def bbox_from_span(span: TemporarySpanMention) -> Bbox:
Use NamedTuple, a typed version of namedtuple, for Bbox
HazyResearch_fonduer
train
py
6a39ca81d30cefbe28411de04c4f90447abd35c9
diff --git a/gwpy/timeseries/statevector.py b/gwpy/timeseries/statevector.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/statevector.py +++ b/gwpy/timeseries/statevector.py @@ -650,7 +650,7 @@ class StateVector(TimeSeriesBase): gap : `str`, optional how to handle gaps in the cache, one of - - 'ignore': do nothing, let the undelying reader method handle it + - 'ignore': do nothing, let the underlying reader method handle it - 'warn': do nothing except print a warning to the screen - 'raise': raise an exception upon finding a gap (default) - 'pad': insert a value to fill the gaps @@ -1003,7 +1003,7 @@ class StateVectorDict(TimeSeriesBaseDict): gap : `str`, optional how to handle gaps in the cache, one of - - 'ignore': do nothing, let the undelying reader method handle it + - 'ignore': do nothing, let the underlying reader method handle it - 'warn': do nothing except print a warning to the screen - 'raise': raise an exception upon finding a gap (default) - 'pad': insert a value to fill the gaps
Fix typo: undelying -> underlying
gwpy_gwpy
train
py
2b0fad79b7d177ffd3c25ebd16aeda3ccdff0e7a
diff --git a/tpl/template_funcs_test.go b/tpl/template_funcs_test.go index <HASH>..<HASH> 100644 --- a/tpl/template_funcs_test.go +++ b/tpl/template_funcs_test.go @@ -151,6 +151,8 @@ func TestArethmic(t *testing.T) { {float64(1), uint(2), '+', float64(3)}, {float64(1), "do", '+', false}, {uint(1), int(2), '+', uint64(3)}, + {uint(1), int(-2), '+', int64(-1)}, + {int(-1), uint(2), '+', int64(1)}, {uint(1), float64(2), '+', float64(3)}, {uint(1), "do", '+', false}, {"do ", "be", '+', "do be"},
tpl: Add two more doArithmetic test cases
gohugoio_hugo
train
go
95465cb02c05cd0faed13971346efcde3d857cd6
diff --git a/lib/ImageCache.js b/lib/ImageCache.js index <HASH>..<HASH> 100644 --- a/lib/ImageCache.js +++ b/lib/ImageCache.js @@ -10,6 +10,7 @@ function Img (src) { this._img = new Image(); this._img.onload = this.emit.bind(this, 'load'); this._img.onerror = this.emit.bind(this, 'error'); + this._img.crossOrigin = true; this._img.src = src; // The default impl of events emitter will throw on any 'error' event unless
Use crossOrigin=true on images to allow getImageData/WebGL If not using crossOrigin=true, the canvas get "tainted" which throws an exception when you want to use it as a WebGL texture or if using getImageData()
Flipboard_react-canvas
train
js
ab04f383fe0d5bad374d5bbae274ab3395962ddc
diff --git a/src/Injector.php b/src/Injector.php index <HASH>..<HASH> 100644 --- a/src/Injector.php +++ b/src/Injector.php @@ -94,15 +94,13 @@ class Injector implements InjectorInterface throw new InjectorInvocationException( "Can't create $className " . " - __construct() missing parameter '".$e->getParameterString()."'" . - " could not be found. Either register it as a service or pass it to create via parameters.", - $e + " could not be found. Either register it as a service or pass it to create via parameters." ); } catch (InjectorInvocationException $e) { //Wrap the exception stack for recursive calls to aid debugging throw new InjectorInvocationException( $e->getMessage() . - PHP_EOL . " => (Called when creating $className)", - $e + PHP_EOL . " => (Called when creating $className)" ); } } @@ -143,8 +141,7 @@ class Injector implements InjectorInterface throw new InjectorInvocationException( "Can't invoke method $className::$methodName()" . " - missing parameter '".$e->getParameterString()."'" . - " could not be found. Either register it as a service or pass it to invoke via parameters.", - $e + " could not be found. Either register it as a service or pass it to invoke via parameters." ); } catch (\ReflectionException $e) { throw new InjectorInvocationException(
Removed exception wrapping for internal exceptions - default exception handler is unwrapping them and displaying non-detailed exception messages.
bigcommerce-labs_injector
train
php
589d72a7f9261dc084405181cf13ba804e75a88a
diff --git a/src/org/apache/cassandra/gms/Gossiper.java b/src/org/apache/cassandra/gms/Gossiper.java index <HASH>..<HASH> 100644 --- a/src/org/apache/cassandra/gms/Gossiper.java +++ b/src/org/apache/cassandra/gms/Gossiper.java @@ -470,7 +470,6 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC void doStatusCheck() { - long now = System.currentTimeMillis(); Set<EndPoint> eps = endPointStateMap_.keySet(); for ( EndPoint endpoint : eps ) @@ -482,8 +481,7 @@ public class Gossiper implements IFailureDetectionEventListener, IEndPointStateC EndPointState epState = endPointStateMap_.get(endpoint); if ( epState != null ) { - long l = now - epState.getUpdateTimestamp(); - long duration = now - l; + long duration = System.currentTimeMillis() - epState.getUpdateTimestamp(); if ( !epState.isAlive() && (duration > aVeryLongTime_) ) { evictFromMembership(endpoint);
fix duration calculation to avoid evicting dead endpoints instantly git-svn-id: <URL>
Stratio_stratio-cassandra
train
java
3b59c4ffd99c451cf6188c1910eddcfc845458ce
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ var find = require('es5-ext/array/#/find') , memoizeMethods = require('memoizee/methods-plain') , getNormalizer = partial.call(require('memoizee/normalizers/get-fixed'), 2) , ensureDocument = require('dom-ext/html-document/valid-html-document') + , reflow = require('dom-ext/html-document/#/reflow') , resetForms = require('html-dom-ext/element/#/reset-forms') , ensureNodeConf = require('./lib/ensure-node-conf') , SiteNode = require('./lib/node'); @@ -44,6 +45,8 @@ ee(Object.defineProperties(SiteTree.prototype, assign({ }); node._load(); this.current = node; + // Assure repaint after content change + reflow.call(this.document); this.emit('load', node); }),
Assure repaint after view load
medikoo_site-tree
train
js
e52b1525fe0db562fae3dec0068f5a3c57753dde
diff --git a/src/oauth.js b/src/oauth.js index <HASH>..<HASH> 100644 --- a/src/oauth.js +++ b/src/oauth.js @@ -190,7 +190,7 @@ async function getTokenEndpoints (wellKnown) { // set cache timeout wellKnownTimeoutId = setTimeout(() => { debug.wellKnown('cache expired') - getTokenEndpoints() + getTokenEndpoints(wellKnown) .catch(err => { debug.wellKnown('unable to refresh well known information') console.error(err.stack)
fix: pass through wellknown url to timeout callback
byu-oit_byu-wabs-oauth
train
js
d22e7f5802a86e5467c3f99335f01327f907a207
diff --git a/lib/desktop/osx.rb b/lib/desktop/osx.rb index <HASH>..<HASH> 100644 --- a/lib/desktop/osx.rb +++ b/lib/desktop/osx.rb @@ -35,8 +35,7 @@ module Desktop end def update_desktop_image_permissions - system chown_command - system chmod_command + system(chown_command) && system(chmod_command) end def chown_command
Only run chmod if chown is successful
chrishunt_desktop
train
rb
20b9025499630dfcc00a04275d84bc8ce6b8e510
diff --git a/engine/env/spark/src/main/java/org/datacleaner/spark/utils/ResultFilePathUtils.java b/engine/env/spark/src/main/java/org/datacleaner/spark/utils/ResultFilePathUtils.java index <HASH>..<HASH> 100644 --- a/engine/env/spark/src/main/java/org/datacleaner/spark/utils/ResultFilePathUtils.java +++ b/engine/env/spark/src/main/java/org/datacleaner/spark/utils/ResultFilePathUtils.java @@ -48,6 +48,7 @@ public class ResultFilePathUtils { public static String getResultFilePath(final JavaSparkContext sparkContext, final SparkJobContext sparkJobContext) { String resultPath = sparkJobContext.getResultPath(); final Configuration hadoopConfiguration = sparkContext.hadoopConfiguration(); + /** The default value would be read from hadoop configuration at runtime from core-site.xml. It represents the machine's hostname and port. Example: hdfs://bigdatavm:9000 **/ final String fileSystemPrefix = hadoopConfiguration.get("fs.defaultFS"); if (resultPath == null || resultPath.isEmpty()) { resultPath = createPath(fileSystemPrefix, DEFAULT_RESULT_PATH);
added a comment about fileSystemPrefix
datacleaner_DataCleaner
train
java
8446ede10ecbc315eb76c9753d10816b9651406a
diff --git a/src/renderable/container.js b/src/renderable/container.js index <HASH>..<HASH> 100644 --- a/src/renderable/container.js +++ b/src/renderable/container.js @@ -468,7 +468,7 @@ var childIndex = this.getChildIndex(child); if (childIndex > 0) { // note : we use an inverted loop - this.splice(0, 0, this.splice(childIndex, 1)[0]); + this.children.splice(0, 0, this.children.splice(childIndex, 1)[0]); // increment our child z value based on the previous child depth child.z = this.children[1].z + 1; } @@ -485,7 +485,7 @@ var childIndex = this.getChildIndex(child); if (childIndex < (this.children.length - 1)) { // note : we use an inverted loop - this.splice((this.children.length - 1), 0, this.splice(childIndex, 1)[0]); + this.children.splice((this.children.length - 1), 0, this.children.splice(childIndex, 1)[0]); // increment our child z value based on the next child depth child.z = this.children[(this.children.length - 2)].z - 1; }
Fixed the moveToTop and moveToBottom functions (thanks Lamberto!)
melonjs_melonJS
train
js
a9fa781105d47bb1cd395fe23ff3876a24147a8e
diff --git a/django_tenants/management/commands/create_tenant.py b/django_tenants/management/commands/create_tenant.py index <HASH>..<HASH> 100644 --- a/django_tenants/management/commands/create_tenant.py +++ b/django_tenants/management/commands/create_tenant.py @@ -28,7 +28,7 @@ class Command(BaseCommand): for field in self.domain_fields: self.option_list += (make_option('--%s' % field.name, - help='Specifies the %s for tenant.' % field.name), ) + help="Specifies the %s for the tenant's domain." % field.name), ) self.option_list += (make_option('-s', action="store_true", help='Create a superuser afterwards.'),) @@ -95,6 +95,7 @@ class Command(BaseCommand): try: domain = get_tenant_domain_model().objects.create(**fields) domain.save() + return domain except exceptions.ValidationError as e: self.stderr.write("Error: %s" % '; '.join(e.messages)) return None
Fix domain creation bug in create_tenant management command. The 'create_tenant' management command was not handling domain creation options properly and was running into an infinite loop. This was because the store_tenant_domain() method was not returning the domain that it had newly created.
tomturner_django-tenants
train
py
31379f62fed63281f8b1fa92700e35f5fb0b9842
diff --git a/lib/relations/belongs_to.js b/lib/relations/belongs_to.js index <HASH>..<HASH> 100644 --- a/lib/relations/belongs_to.js +++ b/lib/relations/belongs_to.js @@ -15,8 +15,6 @@ _.str = require('underscore.string'); /** * The belongs to property for models. * - * Documentation forthcoming. - * * For example: * * var Article = Model.extend({ @@ -287,7 +285,8 @@ BelongsTo.reopen(/** @lends BelongsTo# */ { }), /** - * Documentation forthcoming. + * Fetch the related object. If there is no foreign key defined on the + * instance, this method will not actually query the database. * * @since 1.0 * @protected @@ -318,7 +317,8 @@ BelongsTo.reopen(/** @lends BelongsTo# */ { }, /** - * Documentation forthcoming. + * Validate fetched objects, ensuring that exactly one object was obtained + * when the foreign key is set. * * @since 1.0 * @protected
Finished docs for belongs to.
wbyoung_azul
train
js
f19e32678cad4e29aefb0c1e3557d7307fb1e724
diff --git a/geomdl/helpers.py b/geomdl/helpers.py index <HASH>..<HASH> 100644 --- a/geomdl/helpers.py +++ b/geomdl/helpers.py @@ -84,7 +84,7 @@ def find_span_linear(degree, knot_vector, num_ctrlpts, knot, **kwargs): :return: knot span :rtype: int """ - span = 0 # Knot span index starts from zero + span = degree + 1 # Knot span index starts from zero while span < num_ctrlpts and knot_vector[span] <= knot: span += 1
Fix span finding for out-of-domain evaluation
orbingol_NURBS-Python
train
py
cdf35f6028d2475825cdf2cfdecc96ce40ee2725
diff --git a/src/server/middleware/auth/gmeauth.js b/src/server/middleware/auth/gmeauth.js index <HASH>..<HASH> 100644 --- a/src/server/middleware/auth/gmeauth.js +++ b/src/server/middleware/auth/gmeauth.js @@ -496,7 +496,8 @@ function GMEAuth(session, gmeConfig) { var i; for (i = 0; i < userDataArray.length; i += 1) { delete userDataArray[i].passwordHash; - // TODO: Consider removing settings and data here. + userDataArray[i].data = userDataArray[i].data || {}; + userDataArray[i].settings = userDataArray[i].settings || {}; } return userDataArray; })
WIP gmeAuth.listUsers should add settings and data. (#<I>) should be cherry picked to <I> Former-commit-id: <I>aef<I>fcd<I>fb<I>bc<I>ab<I>d<I>a<I>a<I>
webgme_webgme-engine
train
js
7880598fae8ca6a670a6b47be6984d06fac1919a
diff --git a/holoviews/element/chart.py b/holoviews/element/chart.py index <HASH>..<HASH> 100644 --- a/holoviews/element/chart.py +++ b/holoviews/element/chart.py @@ -36,6 +36,8 @@ class Chart(Columns, Element2D): lower_bounds, upper_bounds = [None]*ndims, [None]*ndims for i, slc in enumerate(index[:ndims]): if isinstance(slc, slice): + lbound = self.extents[i] + ubound = self.extents[ndims:][i] lower_bounds[i] = lbound if slc.start is None else slc.start upper_bounds[i] = ubound if slc.stop is None else slc.stop sliced.extents = tuple(lower_bounds+upper_bounds)
Minor fix for Chart slicing extent setting
pyviz_holoviews
train
py
7aafc54cd8265b449fb98f5abd80435134620016
diff --git a/src/main/java/org/efaps/ui/wicket/models/objects/UITaskObject.java b/src/main/java/org/efaps/ui/wicket/models/objects/UITaskObject.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/efaps/ui/wicket/models/objects/UITaskObject.java +++ b/src/main/java/org/efaps/ui/wicket/models/objects/UITaskObject.java @@ -203,7 +203,6 @@ public class UITaskObject } uiField = new UISnippletField(getInstance().getKey(), this, new FieldConfiguration(field.getId())); - uiGroup.add(uiField); ((UISnippletField) uiField).setHtml(html.toString()); } if (uiField == null) {
- webapp: field was added twice git-svn-id: <URL>
eFaps_eFaps-WebApp
train
java
de2409450948f6343edab4d7924e4044835d7e27
diff --git a/tests/server/blueprints/cases/test_cases_views.py b/tests/server/blueprints/cases/test_cases_views.py index <HASH>..<HASH> 100644 --- a/tests/server/blueprints/cases/test_cases_views.py +++ b/tests/server/blueprints/cases/test_cases_views.py @@ -786,7 +786,7 @@ def test_omimterms(app, test_omim_term): assert resp.status_code == 200 # containing the OMIM term - assert test_omim_term["_id"] in str(resp.data) + assert resp.mimetype == "application/pdf" def _test_beacon_submit(client, case_obj, vcf_files):
Update tests/server/blueprints/cases/test_cases_views.py
Clinical-Genomics_scout
train
py
b3725cccab956e61f10ca85a9f93238e88bfccea
diff --git a/lib/bot.js b/lib/bot.js index <HASH>..<HASH> 100644 --- a/lib/bot.js +++ b/lib/bot.js @@ -283,10 +283,6 @@ function OpkitBot(name, cmds, persister, params) { winston.log('info', response); return self.persister.save(self.brain[command.script], command.script); }) - .then(function(response){ - winston.log('info', response); - return Promise.resolve(); - }) .catch(function(err){ winston.log('warn', err); return Promise.resolve();
No longer logging persister's response
Bandwidth_opkit
train
js
f15fd6fe427c4460f9588f3298ca473eefc40ea4
diff --git a/Classes/Command/ConfigurationCommandController.php b/Classes/Command/ConfigurationCommandController.php index <HASH>..<HASH> 100644 --- a/Classes/Command/ConfigurationCommandController.php +++ b/Classes/Command/ConfigurationCommandController.php @@ -48,8 +48,8 @@ class ConfigurationCommandController extends CommandController implements Single $this->outputLine('<warning>The configuration path "%s" is overwritten by custom configuration options. Removing from local configuration will have no effect.</warning>', array($path)); } if (!$force && $this->configurationService->hasLocal($path)) { - $answer = strtolower($this->output->ask('Remove ' . $path . ' from system configuration (TYPO3_CONF_VARS)? (y/N): ', 'n')); - if (strtolower($answer) === 'n') { + $reallyDelete = $this->output->askConfirmation('Remove ' . $path . ' from system configuration (TYPO3_CONF_VARS)? (yes/<b>no</b>): ', false); + if (!$reallyDelete) { continue; } }
[CLEANUP] Use askConfirmation for confirmation question (#<I>)
TYPO3-Console_TYPO3-Console
train
php
6ff0f95d02ca2e302f91a7678291a133db316c86
diff --git a/c7n/version.py b/c7n/version.py index <HASH>..<HASH> 100644 --- a/c7n/version.py +++ b/c7n/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -version = u"0.8.30.0" +version = u"0.8.31.0" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def read(fname): setup( name="c7n", - version='0.8.30.0', + version='0.8.31.0', description="Cloud Custodian - Policy Rules Engine", long_description=read('README.rst'), classifiers=[
<I> - minor version release (#<I>)
cloud-custodian_cloud-custodian
train
py,py
036671ebd2d6e524133307bacb5073bcd20df82d
diff --git a/spec/models/thredded/category_spec.rb b/spec/models/thredded/category_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/thredded/category_spec.rb +++ b/spec/models/thredded/category_spec.rb @@ -3,20 +3,5 @@ require 'spec_helper' module Thredded describe Category do - it 'should allow no categories' do - topic = create(:topic) - topic.category_ids = nil - topic.save - - expect(topic).to be_valid - end - - it 'should allow a category' do - topic = create(:topic) - topic.categories << create(:category, messageboard: topic.messageboard) - topic.save - - expect(topic.categories).not_to be_nil - end end end diff --git a/spec/models/thredded/topic_spec.rb b/spec/models/thredded/topic_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/thredded/topic_spec.rb +++ b/spec/models/thredded/topic_spec.rb @@ -124,5 +124,16 @@ module Thredded expect(@post.postable.reload.updated_at.to_s).to eq old_time.to_s end + + it 'can have categories' do + topic = build(:topic) + category = build(:category) + + topic.categories << category + topic.save + + expect(topic.categories.size).to eq 1 + expect(topic.categories.first).to eq category + end end end
Update specs (#<I>) * remove specification about a behaviour belonging to another model (topic) * specify only expected behaviour to avoid over specification (previously it was specified that "don't should allow no categories" ).
thredded_thredded
train
rb,rb
eeeedd8a627260c42bb3001e14ba611a1b7af5ab
diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index <HASH>..<HASH> 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -150,6 +150,9 @@ func commandInitShardPrimary(cmd *cobra.Command, args []string) error { WaitReplicasTimeout: protoutil.DurationToProto(initShardPrimaryOptions.WaitReplicasTimeout), Force: initShardPrimaryOptions.Force, }) + if err != nil { + return err + } for _, event := range resp.Events { log.Infof("%v", event)
Check error response before attempting to access InitShardPrimary response
vitessio_vitess
train
go
ca8ba8d602e9a67b136921752917adc063877b38
diff --git a/src/Decorator.php b/src/Decorator.php index <HASH>..<HASH> 100644 --- a/src/Decorator.php +++ b/src/Decorator.php @@ -2,13 +2,15 @@ namespace Ornament\Core; +use StdClass; + abstract class Decorator implements DecoratorInterface { protected $source; - public function __construct($source, ...$args) + public function __construct(StdClass $model, string $property, ...$args) { - $this->source = $source; + $this->source =& $model->$property; } public function getSource()
right, we need to pass references here
ornament-orm_core
train
php
7e40faa502edf97690035aa5a8527008f943dd4f
diff --git a/Classes/Parser/AbstractParser.php b/Classes/Parser/AbstractParser.php index <HASH>..<HASH> 100644 --- a/Classes/Parser/AbstractParser.php +++ b/Classes/Parser/AbstractParser.php @@ -307,6 +307,7 @@ abstract class AbstractParser implements ParserInterface if ($fileContent !== false) { file_put_contents($outputFilename, $fileContent); + \TYPO3\CMS\Core\Utility\GeneralUtility::fixPermissions($outputFilename); // important for some cache clearing scenarios if (file_exists($preparedFilename)) { unlink($preparedFilename);
Use TYPO3-Configured Permissions (#<I>) file_put_contents uses the default php permissions. with this change the file has the configured typo3-permissions
kaystrobach_TYPO3.dyncss
train
php
7acaaafb1238ff0b8ea14982a46f22c480134bed
diff --git a/js/core/List.js b/js/core/List.js index <HASH>..<HASH> 100644 --- a/js/core/List.js +++ b/js/core/List.js @@ -3,7 +3,7 @@ define(["js/core/Bindable", "underscore"], function (Bindable, _) { ctor: function (items, attributes) { this.$items = []; - this.callBase(this, attributes); + this.callBase(attributes); if (items) { this.add(items);
fixed calling of callBase in List
rappid_rAppid.js
train
js
bc21aad7c297e4825c66fcc2ffa46f018c6afc3b
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -79,4 +79,11 @@ class Application extends \Symfony\Component\Console\Application { $this->getDefinition()->addOption($options); } + + public function extractNamespace(string $name, int $limit = null) + { + $parts = explode('/', $name, -1); + + return implode('/', null === $limit ? $parts : \array_slice($parts, 0, $limit)); + } }
Group by namespace when displaying list of commands
yiisoft_yii-console
train
php
ee83b01138da6227203c965b026f2482049c4a37
diff --git a/src/BaseBranchRepositoryEloquent.php b/src/BaseBranchRepositoryEloquent.php index <HASH>..<HASH> 100644 --- a/src/BaseBranchRepositoryEloquent.php +++ b/src/BaseBranchRepositoryEloquent.php @@ -2,7 +2,7 @@ namespace SedpMis\BaseRepository; -abstract class BaseBranchRepositoryEloquent extends BaseRepositoryEloquent implements RepositoryInterface +class BaseBranchRepositoryEloquent extends BaseRepositoryEloquent implements RepositoryInterface { /** * Branch id to be prefix when creating new item to storage. diff --git a/src/BaseRepositoryEloquent.php b/src/BaseRepositoryEloquent.php index <HASH>..<HASH> 100644 --- a/src/BaseRepositoryEloquent.php +++ b/src/BaseRepositoryEloquent.php @@ -6,7 +6,7 @@ use Illuminate\Support\Collection; use Illuminate\Database\Eloquent\Model as EloquentModel; use Illuminate\Support\Facades\Schema; -abstract class BaseRepositoryEloquent implements RepositoryInterface +class BaseRepositoryEloquent implements RepositoryInterface { /** * Eloquent model.
Change base classes as non-abstract
sedp-mis_base-repository
train
php,php
ffe0e1b5ba46cf22453ce74c2502d13fe20d267f
diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MapReplicationStateHolder.java b/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MapReplicationStateHolder.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MapReplicationStateHolder.java +++ b/hazelcast/src/main/java/com/hazelcast/map/impl/operation/MapReplicationStateHolder.java @@ -45,6 +45,7 @@ import com.hazelcast.map.impl.recordstore.expiry.ExpiryReason; import com.hazelcast.nio.ObjectDataInput; import com.hazelcast.nio.ObjectDataOutput; import com.hazelcast.nio.serialization.IdentifiedDataSerializable; +import com.hazelcast.nio.serialization.impl.Versioned; import com.hazelcast.query.impl.Index; import com.hazelcast.query.impl.Indexes; import com.hazelcast.query.impl.InternalIndex; @@ -68,7 +69,7 @@ import static com.hazelcast.internal.util.MapUtil.isNullOrEmpty; /** * Holder for raw IMap key-value pairs and their metadata. */ -public class MapReplicationStateHolder implements IdentifiedDataSerializable { +public class MapReplicationStateHolder implements IdentifiedDataSerializable, Versioned { // holds recordStore-references of these partitions' maps protected transient Map<String, RecordStore<Record>> storesByMapName;
Restore Versioned interface on MapReplicationStateHolder (#<I>) Required for maintaing RU compatibility with <I>
hazelcast_hazelcast
train
java
690b3f277c6f5c3aef8cd84792929450f516b3ae
diff --git a/lib/websocket.js b/lib/websocket.js index <HASH>..<HASH> 100644 --- a/lib/websocket.js +++ b/lib/websocket.js @@ -523,7 +523,7 @@ function initAsClient (address, protocols, options) { if (options.handshakeTimeout) { req.setTimeout( options.handshakeTimeout, - abortHandshake.bind(null, this, req, 'Opening handshake has timed out') + () => abortHandshake(this, req, 'Opening handshake has timed out') ); }
[minor] Replace bound function with arrow function Do not mask potential issues, like #<I>, with bound arguments.
websockets_ws
train
js
b87ad014d1a57b7b7e84963f00608bc4aabf220c
diff --git a/src/Base62/GmpEncoder.php b/src/Base62/GmpEncoder.php index <HASH>..<HASH> 100644 --- a/src/Base62/GmpEncoder.php +++ b/src/Base62/GmpEncoder.php @@ -31,11 +31,11 @@ class GmpEncoder public function encode($data) { if (is_integer($data)) { - $hex = dechex($data); + $base62 = gmp_strval(gmp_init($data, 10), 62); } else { $hex = bin2hex($data); + $base62 = gmp_strval(gmp_init($hex, 16), 62); } - $base62 = gmp_strval(gmp_init($hex, 16), 62); if (Base62::GMP === $this->options["characters"]) { return $base62;
Remove unneeded dechex() call
tuupola_base62
train
php
2c0cccdb12231c1622ae31908c6b2c3bbadd6226
diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php index <HASH>..<HASH> 100644 --- a/lib/SimpleSAML/Logger.php +++ b/lib/SimpleSAML/Logger.php @@ -16,6 +16,9 @@ interface SimpleSAML_Logger_LoggingHandler { class SimpleSAML_Logger { private static $loggingHandler = null; private static $logLevel = null; + + private static $captureLog = FALSE; + private static $capturedLog = array(); /** * This constant defines the string we set the trackid to while we are fetching the @@ -137,10 +140,20 @@ class SimpleSAML_Logger { self::$loggingHandler = $sh; } + public static function setCaptureLog($val = TRUE) { + self::$captureLog = $val; + } + + public static function getCapturedLog() { + return self::$capturedLog; + } + static function log_internal($level,$string,$statsLog = false) { if (self::$loggingHandler == null) self::createLoggingHandler(); + if (self::$captureLog) self::$capturedLog[] = $string; + if (self::$logLevel >= $level || $statsLog) { if (is_array($string)) $string = implode(",",$string); $string = '['.self::getTrackId().'] '.$string;
Add support for log capturing. used in ldapstatus module.
simplesamlphp_saml2
train
php
4baed8daa2acc12a2b5eaa4e5e0a9f1bc2c790b3
diff --git a/addon/lint/lint.js b/addon/lint/lint.js index <HASH>..<HASH> 100644 --- a/addon/lint/lint.js +++ b/addon/lint/lint.js @@ -46,6 +46,7 @@ } var poll = setInterval(function() { if (tooltip) for (var n = node;; n = n.parentNode) { + if (n && n.nodeType == 11) n = n.root; if (n == document.body) return; if (!n) { hide(); break; } }
[lint addon] When checking whether node is still in document, account for shadow dom Issue #<I>
codemirror_CodeMirror
train
js
4c4f2e87fa9e373cb57e2ba4b69c2fef189b40f9
diff --git a/ratecounter_test.go b/ratecounter_test.go index <HASH>..<HASH> 100644 --- a/ratecounter_test.go +++ b/ratecounter_test.go @@ -27,6 +27,19 @@ func TestRateCounter(t *testing.T) { check(0) } +func TestRateCounter_ScheduleDecrement_ReturnsImmediately(t *testing.T) { + interval := 1 * time.Second + r := NewRateCounter(interval) + + start := time.Now() + r.scheduleDecrement(-1) + duration := time.Since(start) + + if duration >= 1*time.Second { + t.Error("scheduleDecrement took", duration, "to return") + } +} + func BenchmarkRateCounter(b *testing.B) { interval := 0 * time.Millisecond r := NewRateCounter(interval)
added test for ratecounter scheduleDecrement returning immediately
paulbellamy_ratecounter
train
go
321cf8c98f254334086bfea966454ecac10627c2
diff --git a/externs/fileapi.js b/externs/fileapi.js index <HASH>..<HASH> 100644 --- a/externs/fileapi.js +++ b/externs/fileapi.js @@ -242,13 +242,6 @@ Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {}; /** - * @see http://www.w3.org/TR/file-system-api/#widl-Entry-toURI - * @param {string=} mimeType - * @return {string} - */ -Entry.prototype.toURI = function(mimeType) {}; - -/** * @see http://www.w3.org/TR/file-system-api/#widl-Entry-toURL * @param {string=} mimeType * @return {string}
Get rid of the obsolete Entry#toURI extern. R=nicksantos DELTA=7 (0 added, 7 deleted, 0 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
js
331d9d467c627abc0e8731151a22391b7b2ff5bf
diff --git a/src/components/slider.js b/src/components/slider.js index <HASH>..<HASH> 100644 --- a/src/components/slider.js +++ b/src/components/slider.js @@ -89,7 +89,7 @@ AFRAME.registerComponent('gui-slider', { var clickActionFunction = window[clickActionFunctionName]; //console.log("clickActionFunction: "+clickActionFunction); // is object a function? - if (typeof clickActionFunction === "function") clickActionFunction(); + if (typeof clickActionFunction === "function") clickActionFunction(data.percent); }); @@ -134,4 +134,4 @@ AFRAME.registerPrimitive( 'a-gui-slider', { 'active-color': 'gui-slider.activeColor', 'handle-color': 'gui-slider.handleColor' } -}); \ No newline at end of file +});
Modified the slider component It now notifies the user of the current position of the slider by emitting an event using clickActionFunction(data.percent)
rdub80_aframe-gui
train
js
f765fc04e1db073dee9dcbaa25573c5e91ee67ed
diff --git a/locale/de.js b/locale/de.js index <HASH>..<HASH> 100644 --- a/locale/de.js +++ b/locale/de.js @@ -1,4 +1,5 @@ const messages = { + _default: (field) => `${field} ist ungültig.`, after: (field, [target]) => `${field} muss nach ${target} liegen.`, alpha_dash: (field) => `${field} darf alphanumerische Zeichen sowie Striche und Unterstriche enthalten.`, alpha_num: (field) => `${field} darf nur alphanumerische Zeichen enthalten.`,
added missing _default in de.js
baianat_vee-validate
train
js
66fa66548904c3d8fe78658adfea0ee248008593
diff --git a/lib/pay/stripe/billable.rb b/lib/pay/stripe/billable.rb index <HASH>..<HASH> 100644 --- a/lib/pay/stripe/billable.rb +++ b/lib/pay/stripe/billable.rb @@ -172,6 +172,16 @@ module Pay billable.card_token = nil end + # Syncs a customer's subscriptions from Stripe to the database + def sync_subscriptions + subscriptions = ::Stripe::Subscription.list({customer: customer}, {stripe_account: stripe_account}) + subscriptions.map do |subscription| + Pay::Stripe::Subscription.sync(subscription.id) + end + rescue ::Stripe::StripeError => e + raise Pay::Stripe::Error, e + end + # https://stripe.com/docs/api/checkout/sessions/create # # checkout(mode: "payment")
RFC: add a path for syncing all of a customer's subscriptions (#<I>) * add a path for syncing all of a customer's subscriptions * scope scubscription sync to stripe_account * Update billable.rb * Update billable.rb
jasoncharnes_pay
train
rb
52c9beee8b04462b96569fe8df90f86afe97deba
diff --git a/jobs/config_test.py b/jobs/config_test.py index <HASH>..<HASH> 100755 --- a/jobs/config_test.py +++ b/jobs/config_test.py @@ -441,6 +441,14 @@ class JobTest(unittest.TestCase): def test_valid_job_config_json(self): """Validate jobs/config.json.""" + # bootstrap integration test scripts + ignore = [ + 'fake-failure', + 'fake-branch', + 'fake-pr', + 'random_job', + ] + self.load_prow_yaml(self.prow_config) config = config_sort.test_infra('jobs/config.json') owners = config_sort.test_infra('jobs/validOwners.json') @@ -448,6 +456,10 @@ class JobTest(unittest.TestCase): config = json.loads(fp.read()) valid_owners = json.loads(ownfp.read()) for job in config: + if job not in ignore: + self.assertTrue(job in self.prowjobs or job in self.realjobs, + '%s must have a matching jenkins/prow entry' % job) + # onwership assertions self.assertIn('sigOwners', config[job], job) self.assertIsInstance(config[job]['sigOwners'], list, job)
Make sure each job has a config.json entry
kubernetes_test-infra
train
py
a5e0e46d20e4b2c45edb69c5f85b8ebb41fad3fd
diff --git a/client/src/main/java/com/paypal/selion/platform/dataprovider/AbstractExcelDataProvider.java b/client/src/main/java/com/paypal/selion/platform/dataprovider/AbstractExcelDataProvider.java index <HASH>..<HASH> 100644 --- a/client/src/main/java/com/paypal/selion/platform/dataprovider/AbstractExcelDataProvider.java +++ b/client/src/main/java/com/paypal/selion/platform/dataprovider/AbstractExcelDataProvider.java @@ -265,7 +265,12 @@ public abstract class AbstractExcelDataProvider { Object objectToReturn = createObjectToUse(userObj); int index = 0; for (Field eachField : fields) { - + //If the data is not present in excel sheet then skip it + String data = excelRowData.get(index++); + if (StringUtils.isEmpty(data)) { + continue; + } + Class<?> eachFieldType = eachField.getType(); if (eachFieldType.isInterface()) { @@ -278,11 +283,6 @@ public abstract class AbstractExcelDataProvider { + " is an interface. Interfaces are not supported."); } - String data = excelRowData.get(index++); - if (StringUtils.isEmpty(data)) { - continue; - } - eachField.setAccessible(true); boolean isArray = eachFieldType.isArray(); DataMemberInformation memberInfo = new DataMemberInformation(eachField, userObj, objectToReturn, data);
Excel DataProvider Bug fix Refactored AbstractExcelDataProvider.prepareObject method to prepone the check for data from excel before checking if the field type is an interface.
paypal_SeLion
train
java
e7dcf37bd4a14e13e4ed089659f96069781faff8
diff --git a/ext/mysql2/extconf.rb b/ext/mysql2/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/mysql2/extconf.rb +++ b/ext/mysql2/extconf.rb @@ -57,7 +57,7 @@ end asplode h unless have_header h end -unless RUBY_PLATFORM =~ /mswin/ +unless RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /sparc/ $CFLAGS << ' -Wall -funroll-loops' end # $CFLAGS << ' -O0 -ggdb3 -Wextra'
fix to CFLAGS to allow compilation on SPARC with sunstudio compiler
brianmario_mysql2
train
rb
2499f559c0c6d6c53d4c555b04d39ec0633da1ce
diff --git a/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java b/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java index <HASH>..<HASH> 100644 --- a/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +++ b/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java @@ -571,13 +571,15 @@ public class AirMapView extends MapView implements GoogleMap.InfoWindowAdapter, switch (action) { case (MotionEvent.ACTION_DOWN): - this.getParent().requestDisallowInterceptTouchEvent(true); + this.getParent().requestDisallowInterceptTouchEvent( + map != null && map.getUiSettings().isScrollGesturesEnabled()); isTouchDown = true; break; case (MotionEvent.ACTION_MOVE): startMonitoringRegion(); break; case (MotionEvent.ACTION_UP): + // Clear this regardless, since isScrollGesturesEnabled() may have been updated this.getParent().requestDisallowInterceptTouchEvent(false); isTouchDown = false; break;
If we've disabled scrolling within the map, then don't capture the touch events (#<I>) * If we've disabled scrolling within the map, then don't capture the touch events. This allows the containing scrollview to perform a scrollview scroll by dragging on the map. (Previously, the map would absorb the touches, and then not scroll the map *or* the scrollview, which was bad.) * Minor simplification
react-native-community_react-native-maps
train
java
b77e865ae7406a11d3aed416d942bedb6905ea9e
diff --git a/shared/reducers/config.js b/shared/reducers/config.js index <HASH>..<HASH> 100644 --- a/shared/reducers/config.js +++ b/shared/reducers/config.js @@ -157,15 +157,23 @@ export default function (state: ConfigState = initialState, action: Action): Con } } case Constants.globalError: { + const error = action.payload + if (error) { + console.warn('Error (global):', error) + } return { ...state, - globalError: action.payload, + globalError: error, } } case Constants.daemonError: { + const error = action.payload.daemonError + if (error) { + console.warn('Error (daemon):', error) + } return { ...state, - daemonError: action.payload.daemonError, + daemonError: error, } }
Log global and daemon error (#<I>)
keybase_client
train
js
5a1ccc971b13dcc0f4f96da6031bd3dc228e57f5
diff --git a/test/default.test.js b/test/default.test.js index <HASH>..<HASH> 100644 --- a/test/default.test.js +++ b/test/default.test.js @@ -16,6 +16,11 @@ test('should generate the expected default result', async t => { plugins: [new FaviconsWebpackPlugin({logo})] }); + stats.compilation.children + .filter(child => child.name === 'webapp-webpack-plugin') + .forEach(child => { + t.deepEqual(child.assets, {}); + }); const diff = await compare(dist, path.resolve(expected, 'default')); t.deepEqual(diff, []); diff --git a/test/html.test.js b/test/html.test.js index <HASH>..<HASH> 100644 --- a/test/html.test.js +++ b/test/html.test.js @@ -20,6 +20,12 @@ test('should work together with the html-webpack-plugin', async t => { ], }); + stats.compilation.children + .filter(child => child.name === 'webapp-webpack-plugin') + .forEach(child => { + t.deepEqual(child.assets, {}); + }); + const diff = await compare(dist, path.resolve(expected, 'html')); t.deepEqual(diff, []); });
test: check output stats for the child compiler lists no asset
jantimon_favicons-webpack-plugin
train
js,js
57ada485577e76e7342a4173e0f142bb47e7e8d1
diff --git a/src/promise.js b/src/promise.js index <HASH>..<HASH> 100644 --- a/src/promise.js +++ b/src/promise.js @@ -4,6 +4,11 @@ var $$iterator, ArrayIteratorPrototype; + // don't trample native promises if they exist + if ( 'Promise' in global && typeof global.Promise.all === 'function' ) { + return; + } + // set a value as non-configurable and non-enumerable function defineInternal ( obj, key, val ) { Object.defineProperty(obj, key, {
Don't trample native Promise if it exists
kevincennis_promise
train
js
8923e8959cd93f15d23391ba38e772d48a6fe215
diff --git a/src/run.py b/src/run.py index <HASH>..<HASH> 100644 --- a/src/run.py +++ b/src/run.py @@ -16,7 +16,7 @@ import rnn_ctc #import datasets.kunwinjku #import datasets.timit #import datasets.japhug -import datasets.babel +#import datasets.babel from corpus_reader import CorpusReader
Removed Babel import to run.
persephone-tools_persephone
train
py
77fe97220cc0715dd34f4201da5247d9300a3ae4
diff --git a/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java b/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java +++ b/src/test/java/org/mockito/internal/exceptions/stacktrace/StackTraceFilterTest.java @@ -26,7 +26,20 @@ public class StackTraceFilterTest extends TestBase { assertThat(filtered, hasOnlyThoseClasses("MockitoExampleTest")); } - + + @Test + public void shouldFilterOutByteBuddyGarbage() { + StackTraceElement[] t = new TraceBuilder().classes( + "MockitoExampleTest", + "org.testcase.MockedClass$MockitoMock$1882975947.doSomething(Unknown Source)" + ).toTraceArray(); + + StackTraceElement[] filtered = filter.filter(t, false); + + assertThat(filtered, hasOnlyThoseClasses("MockitoExampleTest")); + } + + @Test public void shouldFilterOutMockitoPackage() { StackTraceElement[] t = new TraceBuilder().classes(
Add test for removal of ByteBuddy stacktrace elements
mockito_mockito
train
java
80f92e3ca7f690bc1295265ea366c370a4ae47f9
diff --git a/src/SilexCMS/Set/DataSet.php b/src/SilexCMS/Set/DataSet.php index <HASH>..<HASH> 100644 --- a/src/SilexCMS/Set/DataSet.php +++ b/src/SilexCMS/Set/DataSet.php @@ -37,7 +37,7 @@ class DataSet implements ServiceProviderInterface public function filter(Response $resp) { if ($resp instanceof TransientResponse) { - if ($resp->getTemplate()->hasBlock($this->name)) { + if ($resp->getTemplate()->hasBlock($this->block)) { $repository = new GenericRepository($this->app['db'], $this->table); $resp->getVariables()->{$this->block} = $this->app[$this->block] = $repository->findAll(); }
Fixes a variable name (again)
Wisembly_SilexCMS
train
php
54248f464e1a2d4ebbeb5c4a2c376d637a2da584
diff --git a/app/models/resource.rb b/app/models/resource.rb index <HASH>..<HASH> 100644 --- a/app/models/resource.rb +++ b/app/models/resource.rb @@ -9,6 +9,8 @@ class Resource < ActiveRecord::Base def write_to_disk(up) begin + # create the public/files dir if it doesn't exist + FileUtils.mkdir(fullpath('')) unless File.directory?(fullpath('')) if up.kind_of?(Tempfile) and !up.local_path.nil? and File.exist?(up.local_path) File.chmod(0600, up.local_path) FileUtils.copy(up.local_path, fullpath)
Fix resource upload when dir doesn't exist. (closes #<I>) git-svn-id: <URL>
publify_publify
train
rb
42689845282a6b632c991057bb04493330fdc367
diff --git a/src/middleware/api.js b/src/middleware/api.js index <HASH>..<HASH> 100644 --- a/src/middleware/api.js +++ b/src/middleware/api.js @@ -1,5 +1,6 @@ import axios from 'axios' -import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment'; +import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment' +import invariant from 'fbjs/lib/invariant' function getUrl(path) { if (path.startsWith('http') || canUseDOM) { @@ -28,13 +29,15 @@ export default store => next => action => { const { types, ...rest } = callAPI - if (!Array.isArray(types) || types.length !== 3) { - throw new Error('Expected an array of three action types.') - } + invariant( + Array.isArray(types) || types.length !== 3, + 'middleware/api(...): Expected an array of three action types.' + ) - if (!types.every(type => typeof type === 'string')) { - throw new Error('Expected action types to be strings.') - } + invariant( + types.every(type => typeof type === 'string'), + 'middleware/api(...): Expected action types to be strings.' + ) const [requestType, successType, failureType] = types
use invariant to assert state shape in middleware
jaredpalmer_razzle
train
js
e9772ece3163a66999ec797a17283a6a3934417e
diff --git a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java index <HASH>..<HASH> 100755 --- a/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java +++ b/distributed/src/test/java/com/orientechnologies/orient/server/distributed/DistributedSecurityTest.java @@ -56,8 +56,8 @@ public class DistributedSecurityTest extends AbstractServerClusterTest { try { // TRY DELETING ALL OUSER VIA COMMAND - g.command(new OCommandSQL("delete from OUser")).execute(); - Assert.assertTrue(false); + Long deleted = g.command(new OCommandSQL("delete from OUser")).execute(); + Assert.assertEquals(deleted.longValue(), 0l); } catch (Exception e) { Assert.assertTrue(true); }
Fixed test case according to the restricted visibility of reader/writer on OUser class/cluster
orientechnologies_orientdb
train
java
2957e57cf30f7cd2fbdc1846bbfee973d1db9855
diff --git a/mbdata/replication.py b/mbdata/replication.py index <HASH>..<HASH> 100644 --- a/mbdata/replication.py +++ b/mbdata/replication.py @@ -245,7 +245,7 @@ def load_tar(filename, db, config, ignored_schemas, ignored_tables): logger.info("Skipping %s (table %s already contains data)", name, fulltable) continue logger.info("Loading %s to %s", name, fulltable) - cursor.copy_expert(f'COPY {fulltable} FROM STDIN', tar.extractfile(member)) + cursor.copy_expert('COPY {} FROM STDIN'.format(fulltable), tar.extractfile(member)) db.commit()
Make the changes compatible with python2
lalinsky_mbdata
train
py
92ff13c741a038bf416bee9fd2d561e29f08e373
diff --git a/example/api.py b/example/api.py index <HASH>..<HASH> 100644 --- a/example/api.py +++ b/example/api.py @@ -1,4 +1,4 @@ -from flaskext.rest import RestAPI, RestResource, UserAuthentication +from flaskext.rest import RestAPI, RestResource, UserAuthentication, AdminAuthentication, RestrictOwnerResource from app import app from auth import auth @@ -6,12 +6,25 @@ from models import User, Message, Relationship user_auth = UserAuthentication(auth) +admin_auth = AdminAuthentication(auth) + +# instantiate our api wrapper api = RestAPI(app, default_auth=user_auth) + class UserResource(RestResource): - exclude = ('password',) + exclude = ('password', 'email',) + + +class MessageResource(RestrictOwnerResource): + owner_field = 'user' + + +class RelationshipResource(RestrictOwnerResource): + owner_field = 'from_user' -api.register(Message) -api.register(Relationship) -api.register(User, UserResource) +# register our models so they are exposed via /api/<model>/ +api.register(User, UserResource, auth=admin_auth) +api.register(Relationship, RelationshipResource) +api.register(Message, MessageResource)
Cleaning up the example app's API
coleifer_flask-peewee
train
py
e93493314f4d12d1e3def60a55cd9b89be60c40b
diff --git a/blimpy/file_wrapper.py b/blimpy/file_wrapper.py index <HASH>..<HASH> 100644 --- a/blimpy/file_wrapper.py +++ b/blimpy/file_wrapper.py @@ -9,7 +9,10 @@ import h5py from astropy.coordinates import Angle -from . import sigproc +try: + from . import sigproc +except: + import sigproc # import pdb;# pdb.set_trace() diff --git a/blimpy/filterbank.py b/blimpy/filterbank.py index <HASH>..<HASH> 100755 --- a/blimpy/filterbank.py +++ b/blimpy/filterbank.py @@ -21,14 +21,9 @@ TODO: check the file seek logic works correctly for multiple IFs """ -import os + import sys -import struct -import numpy as np -from pprint import pprint -from astropy import units as u -from astropy.coordinates import Angle from astropy.time import Time import scipy.stats from matplotlib.ticker import NullFormatter
Removing unused imports and adding fail-over for non-package usage
UCBerkeleySETI_blimpy
train
py,py
ec893510d0d71b5cb2b8c0f68560a666de964441
diff --git a/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java b/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java +++ b/src/main/java/com/hubspot/jinjava/lib/tag/SetTag.java @@ -64,6 +64,13 @@ import org.apache.commons.lang3.StringUtils; code = "{% set var_one = \"String 1\" %}\n" + "{% set var_two = \"String 2\" %}\n" + "{% set sequence = [var_one, var_two] %}" + ), + @JinjavaSnippet( + desc = "You can set a value to the string value within a block", + code = "{% set name = 'Jack' %}\n" + + "{% set message %}\n" + + "My name is {{ name }}\n" + + "{% end_set %}" ) } )
Add code snippet for set block
HubSpot_jinjava
train
java
7d8211fb476e9b575df154451a6d339d2b077c32
diff --git a/core/IP.php b/core/IP.php index <HASH>..<HASH> 100644 --- a/core/IP.php +++ b/core/IP.php @@ -83,6 +83,9 @@ class IP // examine proxy headers foreach ($proxyHeaders as $proxyHeader) { if (!empty($_SERVER[$proxyHeader])) { + // this may be buggy if someone has proxy IPs and proxy host headers configured as + // `$_SERVER[$proxyHeader]` could be eg $_SERVER['HTTP_X_FORWARDED_HOST'] and + // include an actual host name, not an IP $proxyIp = self::getLastIpFromList($_SERVER[$proxyHeader], $proxyIps); if (strlen($proxyIp) && stripos($proxyIp, 'unknown') === false) { return $proxyIp;
refs #<I> added a comment that this code may be buggy
matomo-org_matomo
train
php
8779f588342a8959a22fc498bfb843544a614176
diff --git a/tests/utils.py b/tests/utils.py index <HASH>..<HASH> 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -14,6 +14,9 @@ # Yoda. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>. import mock +import os +import shutil + from mock import Mock from mock import MagicMock from yoda import Config @@ -26,3 +29,28 @@ def mock_config(data): config.get = MagicMock(return_value=data) config.write = MagicMock(return_value=None) return config + + +class Sandbox: + """ Sandbox environment utility """ + path = None + + def __init__(self, path=None): + """ Init sandbox environment """ + if path is None: + path = os.path.dirname(os.path.realpath(__file__)) + "/sandbox" + + self.path = path + if os.path.exists(path): + self.destroy() + + os.mkdir(path) + + def mkdir(self, directory): + """ Create directory in sandbox. """ + os.mkdir(os.path.join(self.path, directory)) + + def destroy(self): + """ Destroy sandbox environment """ + if os.path.exists(self.path): + shutil.rmtree(self.path)
Added Sandbox utility for tests.
Numergy_yoda
train
py
f71f77f8a7f6a4210b16f90b0410bef3d8cdfb8b
diff --git a/girder/api/v1/system.py b/girder/api/v1/system.py index <HASH>..<HASH> 100644 --- a/girder/api/v1/system.py +++ b/girder/api/v1/system.py @@ -411,7 +411,8 @@ class System(Resource): models = ['folder', 'item'] steps = sum(self.model(model).find().count() for model in models) progress.update( - total=steps, current=0, title='Checking for incorrect base parents') + total=steps, current=0, + title='Checking for incorrect base parents (Step 2 of 3)') for model in models: for doc in self.model(model).find(): progress.update(increment=1) @@ -434,7 +435,8 @@ class System(Resource): models = ['folder', 'item', 'file'] steps = sum(self.model(model).find().count() for model in models) progress.update( - total=steps, current=0, title='Checking for orphaned records') + total=steps, current=0, + title='Checking for orphaned records (Step 1 of 3)') for model in models: for doc in self.model(model).find(): progress.update(increment=1) @@ -449,7 +451,8 @@ class System(Resource): models = ['collection', 'user'] steps = sum(self.model(model).find().count() for model in models) progress.update( - total=steps, current=0, title='Checking for incorrect sizes') + total=steps, current=0, + title='Checking for incorrect sizes (Step 3 of 3)') for model in models: for doc in self.model(model).find(): progress.update(increment=1)
Include Step N of 3 in progress message
girder_girder
train
py
f1775c105d934a4ba1e7bf8aedba765b5624759e
diff --git a/lib/carapace.js b/lib/carapace.js index <HASH>..<HASH> 100644 --- a/lib/carapace.js +++ b/lib/carapace.js @@ -14,6 +14,9 @@ var events = require('eventemitter2'), evref = require('../build/default/evref'); module.exports = carapace = new events.EventEmitter2(); +for (var k in carapace) { + carapace[k] = carapace[k]; +} // // Plugins list @@ -126,4 +129,4 @@ carapace.run = function (argv, callback) { } return carapace; -}; \ No newline at end of file +};
[fix] reset the prototype methods to be directly on carapace so dnode picks them up
nodejitsu_haibu-carapace
train
js
9bc625aad0c27c43a7f88f689c888581d618bcaa
diff --git a/src/main/php/response/Headers.php b/src/main/php/response/Headers.php index <HASH>..<HASH> 100644 --- a/src/main/php/response/Headers.php +++ b/src/main/php/response/Headers.php @@ -87,6 +87,8 @@ class Headers implements \IteratorAggregate /** * checks if header with given name is present * + * Please note that header names are treated case sensitive. + * * @param string $name * @return bool */
add note about case sensitivity of header names
stubbles_stubbles-webapp-core
train
php
d43feab8f4b453c5a486fac2c2b3b5a7c80f2ff0
diff --git a/p2p/protocol/internal/circuitv1-deprecated/relay.go b/p2p/protocol/internal/circuitv1-deprecated/relay.go index <HASH>..<HASH> 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/relay.go +++ b/p2p/protocol/internal/circuitv1-deprecated/relay.go @@ -107,12 +107,12 @@ func (r *Relay) rmLiveHop(from, to peer.ID) { r.lhLk.Lock() defer r.lhLk.Unlock() - r.lhCount-- trg, ok := r.liveHops[from] if !ok { return } + r.lhCount-- delete(trg, to) if len(trg) == 0 { delete(r.liveHops, from)
Only decrement hop counter when actually removing live hop
libp2p_go-libp2p
train
go
2c2e89041fd916aaec823616b7fce7a8b50380c1
diff --git a/lib/gir_ffi/builder/type/object.rb b/lib/gir_ffi/builder/type/object.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/builder/type/object.rb +++ b/lib/gir_ffi/builder/type/object.rb @@ -83,6 +83,7 @@ module GirFFI @klass.class_eval builder.setter_def end + # TODO: Guard agains accidental invocation of undefined vfuncs. def setup_vfunc_invokers info.vfuncs.each do |vfinfo| invoker = vfinfo.invoker diff --git a/test/integration/generated_gimarshallingtests_test.rb b/test/integration/generated_gimarshallingtests_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/generated_gimarshallingtests_test.rb +++ b/test/integration/generated_gimarshallingtests_test.rb @@ -273,7 +273,6 @@ describe GIMarshallingTests do # NOTE: To call this method, the callback slot vfunc_with_callback has to # be filled in the GIMarshallingTests::Object class structure. The # GIMarshallingTests library doesn't do this. - # FIXME: Guard agains accidental invocation of undefined vfuncs. skip "Needs vfunc setup" end
Move a FIXME to a TODO in the right location
mvz_gir_ffi
train
rb,rb
22969aa69468960b82f16b8d7338869158d53093
diff --git a/application/setup.py b/application/setup.py index <HASH>..<HASH> 100644 --- a/application/setup.py +++ b/application/setup.py @@ -42,6 +42,7 @@ setup( 'python-gnupg', 'repoze.xmliter', 'Paste', + 'watchdog', ], extras_require={ 'development': [
we (apparently) now require the watchdog module
ZeitOnline_briefkasten
train
py
5f79c8474b90bc7261949cf71cee42e3241d152b
diff --git a/packages/core/renderers/bolt-base.js b/packages/core/renderers/bolt-base.js index <HASH>..<HASH> 100644 --- a/packages/core/renderers/bolt-base.js +++ b/packages/core/renderers/bolt-base.js @@ -15,14 +15,6 @@ export function BoltBase(Base = HTMLElement) { if (!this.slots) { this.setupSlots(); } - - // Automatically force a component to render if no props exist BUT props are defined. - if ( - Object.keys(this.props).length !== 0 && - Object.keys(this._props).length === 0 - ) { - this.updated(); - } } setupSlots() {
refactor: remove auto `updated()` call in component's connected callback — fixes issue with components using context not always having data available initially
bolt-design-system_bolt
train
js
e1e001266065364ea3d123a2e6bcbd79b142df96
diff --git a/lib/gitlog-md/version.rb b/lib/gitlog-md/version.rb index <HASH>..<HASH> 100644 --- a/lib/gitlog-md/version.rb +++ b/lib/gitlog-md/version.rb @@ -1,5 +1,5 @@ module GitlogMD module Version - STRING = '0.0.2' + STRING = '0.0.3' end end
(GEM) update gitlog-md version to <I>
puppetlabs_gitlog-md
train
rb
50d1537f43e81c70f74e700a56affcb4838e09d4
diff --git a/tests/test_debuglink.py b/tests/test_debuglink.py index <HASH>..<HASH> 100644 --- a/tests/test_debuglink.py +++ b/tests/test_debuglink.py @@ -9,9 +9,12 @@ from trezorlib.client import PinException class TestDebugLink(common.TrezorTest): + # disable for now + """ def test_layout(self): layout = self.client.debug.read_layout() self.assertEqual(len(layout), 1024) + """ def test_mnemonic(self): self.setup_mnemonic_nopin_nopassphrase()
disable layout retrieval in debuglink for now
trezor_python-trezor
train
py
032d70c9a8599f0cd68d9afddec993dfdc7a560f
diff --git a/vsphere/virtual_machine_config_structure.go b/vsphere/virtual_machine_config_structure.go index <HASH>..<HASH> 100644 --- a/vsphere/virtual_machine_config_structure.go +++ b/vsphere/virtual_machine_config_structure.go @@ -540,6 +540,11 @@ func flattenExtraConfig(d *schema.ResourceData, opts []types.BaseOptionValue) er func expandVAppConfig(d *schema.ResourceData, client *govmomi.Client) *types.VmConfigSpec { if !d.HasChange("vapp") { return nil + } else { + // Many vApp config values, such as IP address, will require a + // restart of the machine to properly apply. We don't necessarily + // know which ones they are, so we will restart for every change. + d.Set("reboot_required", true) } var props []types.VAppPropertySpec
Reboot required for change in vApp config
terraform-providers_terraform-provider-vsphere
train
go
bf807ce67fcde95a275c18d14bb4c99c6046b18e
diff --git a/kubernetes/check.py b/kubernetes/check.py index <HASH>..<HASH> 100644 --- a/kubernetes/check.py +++ b/kubernetes/check.py @@ -372,7 +372,6 @@ class Kubernetes(AgentCheck): self.publish_gauge(self, '{}.{}.limits'.format(NAMESPACE, limit), values[0], _tags) except (KeyError, AttributeError) as e: self.log.debug("Unable to retrieve container limits for %s: %s", c_name, e) - self.log.debug("Container object for {}: {}".format(c_name, container)) # requests try: @@ -384,7 +383,6 @@ class Kubernetes(AgentCheck): self.publish_gauge(self, '{}.{}.requests'.format(NAMESPACE, request), values[0], _tags) except (KeyError, AttributeError) as e: self.log.debug("Unable to retrieve container requests for %s: %s", c_name, e) - self.log.debug("Container object for {}: {}".format(c_name, container)) self._update_pods_metrics(instance, pods_list) self._update_node(instance)
[kubernetes] Remove debug log lines (#<I>) Those logs line can leak sensitive data. We should not log them.
DataDog_integrations-core
train
py
d5e6ad4a1f464fea7539304d0b12ade919d3495f
diff --git a/lib/sshkit/backends/abstract.rb b/lib/sshkit/backends/abstract.rb index <HASH>..<HASH> 100644 --- a/lib/sshkit/backends/abstract.rb +++ b/lib/sshkit/backends/abstract.rb @@ -127,6 +127,12 @@ module SSHKit end end + # Backends which extend the Abstract backend should implement the following methods: + def upload!(local, remote, options = {}) raise MethodUnavailableError end + def download!(remote, local=nil, options = {}) raise MethodUnavailableError end + def execute_command(cmd) raise MethodUnavailableError end + private :execute_command # Can inline after Ruby 2.1 + private def output diff --git a/test/unit/backends/test_abstract.rb b/test/unit/backends/test_abstract.rb index <HASH>..<HASH> 100644 --- a/test/unit/backends/test_abstract.rb +++ b/test/unit/backends/test_abstract.rb @@ -64,6 +64,16 @@ module SSHKit assert_equal 'Some stdout', output end + def test_calling_abstract_with_undefined_execute_command_raises_exception + abstract = Abstract.new(ExampleBackend.example_host) do + execute(:some_command) + end + + assert_raises(SSHKit::Backend::MethodUnavailableError) do + abstract.run + end + end + def test_abstract_backend_can_be_configured Abstract.configure do |config| config.some_option = 100
Added stub implementations for abstract methods on Abstract backend Stub methods throw MethodUnavailableError to be consistent with previous behaviour
capistrano_sshkit
train
rb,rb
32f68006222b293d8b9482616a7e79d63fe97829
diff --git a/lib/ffmpeg/movie.rb b/lib/ffmpeg/movie.rb index <HASH>..<HASH> 100644 --- a/lib/ffmpeg/movie.rb +++ b/lib/ffmpeg/movie.rb @@ -114,7 +114,7 @@ module FFMPEG end def calculated_aspect_ratio - aspect_from_dar || aspect_from_dimensions + aspect_from_dimensions end def calculated_pixel_aspect_ratio
Ignore DAR when calculating dimensions
streamio_streamio-ffmpeg
train
rb
d86f4cdea0bbc19c1c4e71ffd11663cae6597088
diff --git a/lib/beaker-pe/install/pe_utils.rb b/lib/beaker-pe/install/pe_utils.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-pe/install/pe_utils.rb +++ b/lib/beaker-pe/install/pe_utils.rb @@ -111,8 +111,8 @@ module Beaker pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -D' : '' pe_cmd = "cd #{host['working_dir']}/#{host['dist']} && ./#{host['pe_installer']}#{pe_debug}" if ! version_is_less(host['pe_ver'], '2016.2.1') - # -f option forces non-interactive mode - pe_cmd += " -f" + # -y option sets "assume yes" mode where yes or whatever default will be assumed + pe_cmd += " -y" end # If there are no answer overrides, and we are doing an upgrade from 2016.2.0,
(PE-<I>) Change -f option to -y Prior to this commit I was using the `-f` option in the installer, now it is `-y`. For more information, see <URL>
puppetlabs_beaker-pe
train
rb
2da1570ce7b15433d03c78a9277f629e05c70eda
diff --git a/tests/resources/conf.py b/tests/resources/conf.py index <HASH>..<HASH> 100644 --- a/tests/resources/conf.py +++ b/tests/resources/conf.py @@ -28,13 +28,17 @@ use os.path.abspath to make it absolute, like shown here. import sys +import os + +sys.path.insert(0, os.path.abspath('..')) + import semantic_version from recommonmark.parser import CommonMarkParser -_package = '{{ package }}' +_package = 'steenzout.sphinx' _version = semantic_version.Version('{{ metadata.__version__ }}') # -- General configuration ------------------------------------------------
updated conf.py expected output.
steenzout_python-sphinx
train
py
6514c21626b8ea9e63a7046ce38526c9ce687dda
diff --git a/ELiDE/layout.py b/ELiDE/layout.py index <HASH>..<HASH> 100644 --- a/ELiDE/layout.py +++ b/ELiDE/layout.py @@ -60,14 +60,14 @@ class ELiDELayout(FloatLayout): d = arr.destination.name self.board.remove_widget(arr) del self.board.arrow[o][d] - del self.board.character.portal[o][d] + arr.portal.delete() elif isinstance(self.selection, Spot): spot = self.selection spot.canvas.clear() self.selection = None self.board.remove_widget(spot) del self.board.spot[spot.name] - del self.board.character.place[spot.name] + spot.remote.delete() else: assert(isinstance(self.selection, Pawn)) pawn = self.selection @@ -80,8 +80,8 @@ class ELiDELayout(FloatLayout): canvas.remove(pawn.group) self.selection = None self.board.remove_widget(pawn) - del self.board.pawn[pawn.name] del self.board.character.thing[pawn.name] + pawn.remote.delete() def toggle_spot_config(self): """Show the dialog where you select graphics and a name for a place,
let LiSE decide how best to delete an entity
LogicalDash_LiSE
train
py