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
35738aceb35505bd3c77c2a618fb1947ca3f72da
diff --git a/namespace/namespace.go b/namespace/namespace.go index <HASH>..<HASH> 100644 --- a/namespace/namespace.go +++ b/namespace/namespace.go @@ -3,7 +3,6 @@ package namespace import ( "fmt" "strings" - "time" ds "github.com/jbenet/go-datastore" ktds "github.com/jbenet/go-datastore/keytransform" @@ -77,7 +76,6 @@ func (d *datastore) Query(q dsq.Query) (dsq.Results, error) { r.Entry.Key = d.Datastore.InvertKey(k).String() ch <- r - <-time.After(100 * time.Millisecond) } }()
bugfix: had left a debugging time.After in
ipfs_go-datastore
train
go
58eda94d4163167f067c941420ca429e1d2b6166
diff --git a/resources/lang/ar-SA/dashboard.php b/resources/lang/ar-SA/dashboard.php index <HASH>..<HASH> 100644 --- a/resources/lang/ar-SA/dashboard.php +++ b/resources/lang/ar-SA/dashboard.php @@ -79,11 +79,11 @@ return [ 'add' => [ 'title' => 'إضافة إجراء صيانة', 'success' => 'تم إضافة إجراء الصيانة.', - 'failure' => 'Something went wrong adding the schedule, please try again.', + 'failure' => 'طرأ هناك خلل أثناء القيام بإضافة صيانة، يُرجى إعادة المحاولة.', ], 'edit' => [ - 'title' => 'Edit Scheduled Maintenance', - 'success' => 'Schedule has been updated!', + 'title' => 'تعديل إجراء الصيانة المُبرمَجة', + 'success' => 'تم تحديث الصيانة !', 'failure' => 'Something went wrong editing the schedule, please try again.', ], 'delete' => [
New translations dashboard.php (Arabic)
CachetHQ_Cachet
train
php
163f4593d3eeada3c6e27b4fb62698b228e4ea65
diff --git a/master/buildbot/changes/gitpoller.py b/master/buildbot/changes/gitpoller.py index <HASH>..<HASH> 100644 --- a/master/buildbot/changes/gitpoller.py +++ b/master/buildbot/changes/gitpoller.py @@ -196,6 +196,7 @@ class GitPoller(base.ChangeSource): commit_timestamp = None # use current time c = changes.Change(who = self._get_commit_name(rev), + revision = rev, files = self._get_commit_files(rev), comments = self._get_commit_comments(rev), when = commit_timestamp, @@ -253,4 +254,4 @@ class GitPoller(base.ChangeSource): self.workdir) self.stopService() return res - \ No newline at end of file +
Gitpoller should set revision on new Change objects
buildbot_buildbot
train
py
a1b8319f774b532d1a0739ed0c4959189660cc3d
diff --git a/pybooru/api_danbooru.py b/pybooru/api_danbooru.py index <HASH>..<HASH> 100644 --- a/pybooru/api_danbooru.py +++ b/pybooru/api_danbooru.py @@ -741,3 +741,12 @@ class DanbooruApi(object): } return self._get('pools/{0}.json'.format(pool_id), params, method='PUT', auth=True) + + def pool_delete(self, pool_id): + """Delete a pool (Requires login) (UNTESTED). + + Parameters: + pool_id: REQUIRED Where pool_id is the pool id. + """ + return self._get('pools/{0}.json'.format(pool_id), method='DELETE', + auth=True)
Danbooru: implements pool_delete()
LuqueDaniel_pybooru
train
py
9bd0650b1c693887e99fbb272d4c9664a8893b2a
diff --git a/tests/integration/routes/accounts/patch-accounts-test.js b/tests/integration/routes/accounts/patch-accounts-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/routes/accounts/patch-accounts-test.js +++ b/tests/integration/routes/accounts/patch-accounts-test.js @@ -100,8 +100,18 @@ getServer(function (error, server) { t.end() }) - group.test('data.type & data.id don’t match existing document', {todo: true}, function (t) { - t.end() + group.test('data.type & data.id don’t match existing document', function (t) { + server.inject(Object.assign({}, routeOptions, { + payload: { + data: { + type: 'not-account', + id: 'not-abc456' + } + } + }), function (response) { + t.is(response.statusCode, 409, 'returns 409 status') + t.end() + }) }) group.test('changing password', function (t) {
test(routes): PATCH /accounts/<I> with invalid type / id attributes
hoodiehq_hoodie-account-server
train
js
1880e991f770f9decb1e20d4429b87a1fc202332
diff --git a/externs/browser/chrome.js b/externs/browser/chrome.js index <HASH>..<HASH> 100644 --- a/externs/browser/chrome.js +++ b/externs/browser/chrome.js @@ -472,6 +472,13 @@ chrome.runtime.sendMessage = function( opt_callback) {}; +/** + * Returns an object representing current load times. Note that the properties + * on the object do not change and the function must be called again to get + * up-to-date data. + * + * @return {!ChromeLoadTimes} + */ chrome.loadTimes = function() {};
Restore the JsDoc that seems to have been deleted accidentally <I>a9a<I>c<I>eb<I>c<I>d7e<I>a8be3b seems to have deleted the JsDoc accidentally, restore it but leave out the internal-only link.
google_closure-compiler
train
js
24c7db2ed58e12fdceb2e2ee644365807dbe1e94
diff --git a/llvmlite/ir/values.py b/llvmlite/ir/values.py index <HASH>..<HASH> 100644 --- a/llvmlite/ir/values.py +++ b/llvmlite/ir/values.py @@ -486,7 +486,7 @@ class ReturnValue(_BaseArgument): class Block(Value): """ - A LLVM IR building block. A building block is a sequence of + A LLVM IR basic block. A basic block is a sequence of instructions whose execution always goes from start to end. That is, a control flow instruction (branch) can only appear as the last instruction, and incoming branches can only jump to the first
Fix Block documentation: s/building block/basic block/.
numba_llvmlite
train
py
dc4a881d68b196d20b5e918462ad3ac3e4bf057e
diff --git a/src/Zoho/CRM/ZohoClient.php b/src/Zoho/CRM/ZohoClient.php index <HASH>..<HASH> 100755 --- a/src/Zoho/CRM/ZohoClient.php +++ b/src/Zoho/CRM/ZohoClient.php @@ -579,7 +579,7 @@ class ZohoClient protected function mapSingleEntity(Element $entity) { $element = new \ReflectionObject($entity); - $properties = $element->getProperties(); + $properties = $element->getProperties(\ReflectionProperty::IS_PUBLIC); $xml = ''; foreach ($properties as $property) { $propName = $property->getName();
Implemented converting only public Element's properties to XML
mctekk_zohocrm
train
php
3566548c3684aa6423a2ec6ce9bc23cd107e42c4
diff --git a/src/styles/style.js b/src/styles/style.js index <HASH>..<HASH> 100644 --- a/src/styles/style.js +++ b/src/styles/style.js @@ -129,7 +129,7 @@ export var Style = { this.startData(tile.key); } - let style = this.parseFeature(feature, rule, context); + let style = this.parseFeature.apply(this, arguments); // allow subclasses to pass extra args // Skip feature? if (!style) { @@ -195,7 +195,7 @@ export var Style = { } // Subclass implementation - style = this._parseFeature(feature, rule_style, context); + style = this._parseFeature.apply(this, arguments); // allow subclasses to pass extra args return style; }
styles: allow subclasses to pass extra args through parse/build process
tangrams_tangram
train
js
4bd69c82b9dfd9e2da90ac79a34aca28579d59f3
diff --git a/src/app/api/filters.js b/src/app/api/filters.js index <HASH>..<HASH> 100644 --- a/src/app/api/filters.js +++ b/src/app/api/filters.js @@ -18,7 +18,7 @@ export function getLocalFilter(config) { export function isFiltered(action, localFilter) { if ( - !localFilter || window.devToolsOptions && + !localFilter && window.devToolsOptions && window.devToolsOptions.filter === FilterState.DO_NOT_FILTER || typeof action.type.match !== 'function' ) return false;
If filter options provided in arguments, should ignore from option page
zalmoxisus_redux-devtools-extension
train
js
b87efdcd40c8fe8827c5a53fb27ee9fab9c48c60
diff --git a/src/Resources/contao/config/config.php b/src/Resources/contao/config/config.php index <HASH>..<HASH> 100644 --- a/src/Resources/contao/config/config.php +++ b/src/Resources/contao/config/config.php @@ -19,7 +19,13 @@ array_push($GLOBALS['BE_MOD']['design']['themes']['tables'], 'tl_content_blocks' $GLOBALS['BE_MOD']['design']['themes']['stylesheet'][] = 'bundles/agoatcontentblocks/style.css'; $GLOBALS['BE_MOD']['content']['article']['stylesheet'][] = 'bundles/agoatcontentblocks/style.css'; -$GLOBALS['BE_MOD']['content']['news']['stylesheet'][] = 'bundles/agoatcontentblocks/style.css'; + +$bundles = \System::getContainer()->getParameter('kernel.bundles'); + +if (isset($bundles['ContaoNewsBundle'])) +{ + $GLOBALS['BE_MOD']['content']['news']['stylesheet'][] = 'bundles/agoatcontentblocks/style.css'; +} /**
Check if ContaoNewsBundle is installed
agoat_contao-customcontentelements-bundle
train
php
1bcb5a2d1aeb2d9dfc1b4cbee146ffb9b03946d8
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java b/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java index <HASH>..<HASH> 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java @@ -185,7 +185,7 @@ public class DNSUtil { } List<SRVRecord> srvRecords = dnsResolver.lookupSRVRecords(srvDomain, failedAddresses, dnssecMode); - if (srvRecords != null) { + if (srvRecords != null && !srvRecords.isEmpty()) { if (LOGGER.isLoggable(Level.FINE)) { String logMessage = "Resolved SRV RR for " + srvDomain + ":"; for (SRVRecord r : srvRecords)
Also check that srvRecords is not empty
igniterealtime_Smack
train
java
74ada6dd5170dac444b7285ab216988343cec4e9
diff --git a/flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java b/flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java index <HASH>..<HASH> 100755 --- a/flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java +++ b/flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java @@ -474,7 +474,7 @@ public class YarnResourceManager extends ActiveResourceManager<YarnWorkerNode> final ResourceID resourceId = new ResourceID(containerId.toString()); // release the failed container - YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(resourceId); + workerNodeMap.remove(resourceId); resourceManagerClient.releaseAssignedContainer(containerId); // and ask for a new one requestYarnContainerIfRequired();
[hotfix][yarn] Code clean-up in YarnResourceManager.
apache_flink
train
java
27612bfc61513f8fdd7454799f346b9526ceebd4
diff --git a/lib/jcr/version.rb b/lib/jcr/version.rb index <HASH>..<HASH> 100644 --- a/lib/jcr/version.rb +++ b/lib/jcr/version.rb @@ -15,6 +15,6 @@ module JCR - VERSION = "0.8.3" + VERSION = "0.9.0" end \ No newline at end of file
bumping the version to <I>
arineng_jcrvalidator
train
rb
ac2cda1ffc37c6427a89781e2a4bf3f54410e54d
diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py index <HASH>..<HASH> 100644 --- a/discord/ext/tasks/__init__.py +++ b/discord/ext/tasks/__init__.py @@ -132,6 +132,7 @@ class Loop: """Cancels the internal task, if any are running.""" if self._task: self._task.cancel() + self._task = None def add_exception_type(self, exc): r"""Adds an exception type to be handled during the reconnect logic.
[tasks] set internal task to None after canceling
Rapptz_discord.py
train
py
44d0a631b652a76c1c025ee08a967b0e36780182
diff --git a/design/standard/javascript/ezxhprof.js b/design/standard/javascript/ezxhprof.js index <HASH>..<HASH> 100644 --- a/design/standard/javascript/ezxhprof.js +++ b/design/standard/javascript/ezxhprof.js @@ -52,7 +52,7 @@ } tokens = tokens.join().replace( '<!-- XHProf runs: ', '' ).replace( ' -->', '' ); - $('#debug').append( '<h3>XHProf Profiling Run for this page</h3><table class="debug_resource_usage"><tr><td> <a href="' + prefix + '/xhprof/view?run=' + tokens + '">' + tokens + '</a> </td></tr></table>' ); + $('#debug').append( '<h3>XHProf Profiling Run for this page:</h3><table class="debug_resource_usage"><tr><td> <a href="' + prefix + '/xhprof/view?run=' + tokens + '">' + tokens + '</a> </td></tr></table>' ); } } );
Style nitpick: debug output titles end with colons
gggeek_ezperformancelogger
train
js
173a9bc4eab097fc41905a7be24bee661d634327
diff --git a/src/service/translate.js b/src/service/translate.js index <HASH>..<HASH> 100644 --- a/src/service/translate.js +++ b/src/service/translate.js @@ -720,7 +720,9 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY', var $translate = function (translationId, interpolateParams, interpolationId) { // trim off any whitespace - translationId = translationId.trim(); + if (translationId) { + translationId = translationId.trim(); + } // determine translation table and current Interpolator var table = $uses ? $translationTable[$uses] : $translationTable,
fix(): fix npe introduced in <I>a<I> (#<I>) fixes #<I>
angular-translate_angular-translate
train
js
5d3d5a3937be28dd947580cf48a7f1fd162019bc
diff --git a/falafel/config/specs.py b/falafel/config/specs.py index <HASH>..<HASH> 100644 --- a/falafel/config/specs.py +++ b/falafel/config/specs.py @@ -144,6 +144,7 @@ static_specs = { "rhn-charsets" : CommandSpec("/usr/bin/rhn-charsets"), "rhn-entitlement-cert.xml" : SimpleFileSpec("etc/sysconfig/rhn/rhn-entitlement-cert.xml"), "rhn_hibernate.conf" : SimpleFileSpec("usr/share/rhn/config-defaults/rhn_hibernate.conf"), + "rhn-schema-version" : SimpleFileSpec("usr/bin/rhn-schema-version"), "rhn_taskomatic_daemon.log" : SimpleFileSpec("var/log/rhn/rhn_taskomatic_daemon.log", large_content=True), "root_crontab" : CommandSpec("/usr/bin/crontab -l -u root"), "rpm_-V_packages" : CommandSpec("/bin/rpm -V coreutils procps procps-ng shadow-utils passwd sudo"),
Added rhn-schema-version for collection.
RedHatInsights_insights-core
train
py
189569a3aadf39d940373fb2695e5b9f02ec24d9
diff --git a/widgets/HighchartWidgetBase.php b/widgets/HighchartWidgetBase.php index <HASH>..<HASH> 100644 --- a/widgets/HighchartWidgetBase.php +++ b/widgets/HighchartWidgetBase.php @@ -84,6 +84,7 @@ abstract class HighchartWidgetBase extends \yii\base\Widget public function run() { return Highcharts::widget([ + 'htmlOptions'=>['id'=>$this->id], 'scripts'=>$this->scripts(), 'options'=>$this->widgetConfig, ]);
setting id on underlying highcharts-widget making it configurable from the outside
asinfotrack_yii2-chartwidgets
train
php
bb3902cbdbdb9111f347acd250aa0a6169c38966
diff --git a/tests/test_flake8_comprehensions.py b/tests/test_flake8_comprehensions.py index <HASH>..<HASH> 100644 --- a/tests/test_flake8_comprehensions.py +++ b/tests/test_flake8_comprehensions.py @@ -14,7 +14,8 @@ python_3_6_plus = pytest.mark.skipif(sys.version_info < (3, 6), reason="Python 3 def test_version(flake8dir): result = flake8dir.run_flake8(["--version"]) version_string = "flake8-comprehensions: " + version("flake8-comprehensions") - assert version_string in result.out_lines[0] + unwrapped = "".join(result.out_lines) + assert version_string in unwrapped # C400
Improve version test (#<I>) In case of wrapping as in <URL>
adamchainz_flake8-comprehensions
train
py
c5d360c9f07187c95129d46cd574996cb339de05
diff --git a/src/RemoteProcessor.php b/src/RemoteProcessor.php index <HASH>..<HASH> 100644 --- a/src/RemoteProcessor.php +++ b/src/RemoteProcessor.php @@ -34,6 +34,7 @@ abstract class RemoteProcessor // script out to a file or anything. We will start the SSH process then pass // these lines of output back to the parent callback for display purposes. else { + $delimeter = 'EOF-LARAVEL-ENVOY'; $process = new Process( "ssh $target 'bash -se' << $delimeter".PHP_EOL .'set -e'.PHP_EOL
bugfix, forgot to copy the delimeter variable line.
laravel_envoy
train
php
7a1ca811edcc66aa53c6f0cd146cfeced271dc85
diff --git a/openquake/baselib/parallel.py b/openquake/baselib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/parallel.py +++ b/openquake/baselib/parallel.py @@ -687,7 +687,7 @@ if OQ_DISTRIBUTE == 'celery': def _wakeup(sec): - """Waiting functions, used to wake up the process pool""" + """Waiting function, used to wake up the process pool""" setproctitle('oq-worker') try: import prctl
Renaming [skip CI]
gem_oq-engine
train
py
3f8a38343bef07df311c10887ae4e65d05a6ffba
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3511,21 +3511,23 @@ function make_table($table) { return $output; } -function print_recent_activity_note($time, $user, $isteacher, $text, $link, $return=false) { +function print_recent_activity_note($time, $user, $text, $link, $return=false) { static $strftimerecent; - $output = ''; + $context = get_context_instance(CONTEXT_SYSTEM, SITEID); + $viewfullnames = has_capability('moodle/site:viewfullnames', $context); + if (empty($strftimerecent)) { $strftimerecent = get_string('strftimerecent'); } $date = userdate($time, $strftimerecent); - $name = fullname($user, $isteacher); + $name = fullname($user, $viewfullnames); $output .= '<div class="head">'; $output .= '<div class="date">'.$date.'</div> '. - '<div class="name">'.fullname($user, $isteacher).'</div>'; + '<div class="name">'.fullname($user, $viewfullnames).'</div>'; $output .= '</div>'; $output .= '<div class="info"><a href="'.$link.'">'.format_string($text,true).'</a></div>';
Removed isteacher from function print_recent_activity_note()
moodle_moodle
train
php
299dacc823aafaebd7773bc26bf0deab041c129a
diff --git a/src/select.js b/src/select.js index <HASH>..<HASH> 100644 --- a/src/select.js +++ b/src/select.js @@ -321,7 +321,7 @@ // When the user clicks on an item inside the dropdown ctrl.select = function(item) { - if (!item._uiSelectChoiceDisabled) { + if (item === undefined || !item._uiSelectChoiceDisabled) { var locals = {}; locals[ctrl.parserResult.itemName] = item;
fix(match): prevent exception when resetting value with BACKSPACE
angular-ui_ui-select
train
js
6a084b98f9cf4459dc064c9b67588fa4c5fa2a1e
diff --git a/features/step_definitions/iterate_table.rb b/features/step_definitions/iterate_table.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/iterate_table.rb +++ b/features/step_definitions/iterate_table.rb @@ -5,7 +5,7 @@ end When /^I iterate through the table$/ do res = [] BioTable::TableLoader.emit(@lines, :in_format => :csv).each { |row| res << row } - res[3][5].should == "0.07" + res[2][5].should == "0.07" end diff --git a/lib/bio-table/tableload.rb b/lib/bio-table/tableload.rb index <HASH>..<HASH> 100644 --- a/lib/bio-table/tableload.rb +++ b/lib/bio-table/tableload.rb @@ -6,6 +6,8 @@ module BioTable # an 'each' method) and apply the filters etc. defined in options # # Note that this class does not hold data in memory(!) + # + # Note that you need to pass in :with_header to get the header row def TableLoader::emit generator, options table_apply = TableApply.new(options) column_index = nil, prev_line = nil
The header row is skipped by default
pjotrp_bioruby-table
train
rb,rb
325b94d8af9b4e2b875eb6985f5ce3b9615fe846
diff --git a/lib/vain.js b/lib/vain.js index <HASH>..<HASH> 100644 --- a/lib/vain.js +++ b/lib/vain.js @@ -136,10 +136,12 @@ exports.router = function(viewsFolder) { router = new express.Router(); router.get(/.*/, function(req, res, next) { - if (req.path === "/") - req.path = "/index" + var targetPath = req.path; - if (! fs.existsSync(viewsFolder + req.path + '.html')) { + if (targetPath === "/") + targetPath = "/index"; + + if (! fs.existsSync(viewsFolder + targetPath + '.html')) { res.send(404); return; }
Dafuq is access protection... Cannot set property path of #<IncomingMessage> which has only a getter
farmdawgnation_vain
train
js
5c32842b4f99668d179e7bdb516a5340daccf8b1
diff --git a/pygccxml/parser/declarations_cache.py b/pygccxml/parser/declarations_cache.py index <HASH>..<HASH> 100644 --- a/pygccxml/parser/declarations_cache.py +++ b/pygccxml/parser/declarations_cache.py @@ -9,7 +9,7 @@ import md5 import time import cPickle from pygccxml import utils - +import config as cxx_parsers_cfg def file_signature( filename ): if not os.path.isfile( filename ): @@ -33,9 +33,11 @@ def configuration_signature( config ): to be different between runs. """ sig = md5.new() - sig.update(str(config.gccxml_path)) + if isinstance( config, cxx_parsers_cfg.gccxml_configuration_t ): + sig.update(str(config.gccxml_path)) sig.update(str(config.working_directory)) - sig.update(str(config.cflags)) + if isinstance( config, cxx_parsers_cfg.gccxml_configuration_t ): + sig.update(str(config.cflags)) for p in config.include_paths: sig.update(str(p)) for s in config.define_symbols:
adjusting declarations cache to use right( gccxml ) configuration
gccxml_pygccxml
train
py
08a6f7430a2bf537d728e6d97e0a48e17665426a
diff --git a/topydo/lib/EditCommand.py b/topydo/lib/EditCommand.py index <HASH>..<HASH> 100644 --- a/topydo/lib/EditCommand.py +++ b/topydo/lib/EditCommand.py @@ -29,7 +29,10 @@ class EditCommand(Command): if not super(EditCommand, self).execute(): return False - editor = os.environ['EDITOR'] or 'vi' + try: + editor = os.environ['EDITOR'] or 'vi' + except(KeyError): + editor = 'vi' todo = config().todotxt() return call([editor, todo]) == 0
Try to edit todo file even if $EDITOR is unset. On some systems EDITOR is unset by default, so in such situation topydo would throw KeyError exception instead of opening todo.txt in vi.
bram85_topydo
train
py
753f9e68ea7bf3fd9c3243833c1f27d94300fe04
diff --git a/tests/system/CodeIgniterTest.php b/tests/system/CodeIgniterTest.php index <HASH>..<HASH> 100644 --- a/tests/system/CodeIgniterTest.php +++ b/tests/system/CodeIgniterTest.php @@ -424,6 +424,30 @@ final class CodeIgniterTest extends CIUnitTestCase $this->assertArrayNotHasKey('_ci_previous_url', $_SESSION); } + public function testNotStoresPreviousURLByCheckingContentType() + { + $_SERVER['argv'] = ['index.php', 'image']; + $_SERVER['argc'] = 2; + + $_SERVER['REQUEST_URI'] = '/image'; + + // Inject mock router. + $routes = Services::routes(); + $routes->add('image', static function () { + $response = Services::response(); + + return $response->setContentType('image/jpeg', ''); + }); + $router = Services::router($routes, Services::request()); + Services::injectMock('router', $router); + + ob_start(); + $this->codeigniter->useSafeOutput(true)->run(); + ob_get_clean(); + + $this->assertArrayNotHasKey('_ci_previous_url', $_SESSION); + } + /** * The method after all test, reset Servces:: config * Can't use static::tearDownAfterClass. This will cause a buffer exception
test: add test for storePreviousURL in case of non-HTML response
codeigniter4_CodeIgniter4
train
php
48f88019c310b3df6503586e6127bcb05451024c
diff --git a/console_win.go b/console_win.go index <HASH>..<HASH> 100644 --- a/console_win.go +++ b/console_win.go @@ -1,6 +1,6 @@ // +build windows -// Copyright 2016 The TCell Authors +// Copyright 2019 The TCell Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use file except in compliance with the License. @@ -788,7 +788,7 @@ func (s *cScreen) draw() { wcs = append(wcs, utf16.Encode(combc)...) } for dx := 0; dx < width; dx++ { - s.cells.SetDirty(x + dx, y, false) + s.cells.SetDirty(x+dx, y, false) } x += width - 1 } @@ -882,14 +882,14 @@ func (s *cScreen) resize() { s.w = w s.h = h + s.setBufferSize(w, h) + r := rect{0, 0, int16(w - 1), int16(h - 1)} procSetConsoleWindowInfo.Call( uintptr(s.out), uintptr(1), uintptr(unsafe.Pointer(&r))) - s.setBufferSize(w, h) - s.PostEvent(NewEventResize(w, h)) }
fixes #<I> Ordering of SetConsoleWindowInfo and SetConsoleScreenBufferSize
gdamore_tcell
train
go
43b7cff7a1833b1e6e2807f3124183b904571833
diff --git a/lwr/lwr_client/manager.py b/lwr/lwr_client/manager.py index <HASH>..<HASH> 100644 --- a/lwr/lwr_client/manager.py +++ b/lwr/lwr_client/manager.py @@ -27,7 +27,6 @@ class ClientManager(object): cache = kwds.get('cache', None) if cache is None: cache = _environ_default_int('LWR_CACHE_TRANSFERS') - if cache: log.info("Setting LWR client class to caching variant.") self.client_class = InputCachingClient @@ -43,7 +42,9 @@ class ClientManager(object): transfer_info = self.transfer_queue.get() try: self.__perform_transfer(transfer_info) - except: + except BaseException as e: + log.warn("Transfer failed.") + log.exception(e) pass self.transfer_queue.task_done()
Log exceptions for caching transfers.
galaxyproject_pulsar
train
py
a1cc266ee8b2386d58f631c6df11d7146beb46f0
diff --git a/src/views/log.blade.php b/src/views/log.blade.php index <HASH>..<HASH> 100644 --- a/src/views/log.blade.php +++ b/src/views/log.blade.php @@ -74,7 +74,7 @@ <tbody> @foreach($logs as $key => $log) -<tr> +<tr data-display="stack{{{$key}}}"> <td class="text-{{{$log['level_class']}}}"><span class="glyphicon glyphicon-{{{$log['level_img']}}}-sign" aria-hidden="true"></span> &nbsp;{{$log['level']}}</td> <td class="text">{{$log['context']}}</td> <td class="date">{{{$log['date']}}}</td> @@ -110,6 +110,9 @@ <script src="https://cdn.datatables.net/plug-ins/9dcbecd42ad/integration/bootstrap/3/dataTables.bootstrap.js"></script> <script> $(document).ready(function(){ + $('tr').on('click', function () { + $('#' + $(this).data('display')).toggle(); + }); $('#table-log').DataTable({ "order": [ 1, 'desc' ], "stateSave": true,
make whole row clickable to expand stack trace (#<I>)
rap2hpoutre_laravel-log-viewer
train
php
12aa3f63a57e207321f1815c2d84450c273a2288
diff --git a/allauth/account/views.py b/allauth/account/views.py index <HASH>..<HASH> 100644 --- a/allauth/account/views.py +++ b/allauth/account/views.py @@ -225,11 +225,11 @@ def email(request, **kwargs): # Slightly different variation, don't # require verified unless moving from a # verified address. Ignore constraint - # if previous, primary email address is + # if previous primary email address is # not verified. ).exists(): messages.add_message(request, messages.ERROR, - ugettext("Your primary email address must " + ugettext("Your primary e-mail address must " "be verified")) else: email_address.set_as_primary()
[deny_primary_email_switch] standardize 'e-mail' vs 'email' in error message.
pennersr_django-allauth
train
py
0658d042abf1186e59c04d200ea4de786675a8a8
diff --git a/s3pipeline/pipelines.py b/s3pipeline/pipelines.py index <HASH>..<HASH> 100644 --- a/s3pipeline/pipelines.py +++ b/s3pipeline/pipelines.py @@ -27,7 +27,7 @@ class S3Pipeline: self.object_key_template = o.path[1:] # Remove the first '/' self.max_chunk_size = settings.getint('S3PIPELINE_MAX_CHUNK_SIZE', 500) - self.use_gzip = settings.getbool('S3PIPELINE_GZIP', True) + self.use_gzip = settings.getbool('S3PIPELINE_GZIP', url.endswith('.gz')) self.s3 = boto3.client('s3') self.items = []
S3PIPELINE_GZIP is now deteced by suffix of S3PIPELINE_URL
orangain_scrapy-s3pipeline
train
py
6292e1d1d92b169325550c4db0759bca169c65ce
diff --git a/src/Http/Request.php b/src/Http/Request.php index <HASH>..<HASH> 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -125,11 +125,17 @@ function content_type(?string $default = null): ?string */ function headers(): array { + if (Container\has(SWOOLE_HTTP_REQUEST)) { + /** @var array<string, string> $headers */ + $headers = \Siler\Swoole\request()->header; + return $headers; + } + /** @var array<string> $server_keys */ $server_keys = array_keys($_SERVER); $http_headers = array_reduce( $server_keys, - function (array $headers, string $key): array { + static function (array $headers, string $key): array { if ($key === 'CONTENT_TYPE') { $headers[] = $key; }
Make Request\headers() aware about a Swoole request, closes #<I>
leocavalcante_siler
train
php
05faec29130a0043b75183bb51fe08439588e706
diff --git a/rbush.js b/rbush.js index <HASH>..<HASH> 100644 --- a/rbush.js +++ b/rbush.js @@ -68,6 +68,8 @@ rbush.prototype = { }, load: function (data) { + if (!(data && data.length)) { return this; } + // recursively build the tree with the given data from stratch using OMT algorithm this.data = this._build(data.slice(), 0); @@ -78,7 +80,9 @@ rbush.prototype = { }, insert: function (item) { - this._insert(item); + if (item) { + this._insert(item); + } return this; }, @@ -88,6 +92,8 @@ rbush.prototype = { }, remove: function (item) { + if (!item) { return this; } + var node = this.data, bbox = this._toBBox(item), path = [],
don't do anything with empty objects
mourner_rbush
train
js
95ce5339991114b03ffb262e50fcd22c4cd35bcc
diff --git a/Plugin/RuleCollectionPlugin.php b/Plugin/RuleCollectionPlugin.php index <HASH>..<HASH> 100644 --- a/Plugin/RuleCollectionPlugin.php +++ b/Plugin/RuleCollectionPlugin.php @@ -30,8 +30,8 @@ class RuleCollectionPlugin /** * @param \Magento\SalesRule\Model\ResourceModel\Rule\Collection $subject * @param mixed $result - * @param string|int $websiteId - * @param string|int $customerGroupId + * @param int $websiteId + * @param int $customerGroupId * @param string $couponCode * * @return mixed @@ -39,8 +39,8 @@ class RuleCollectionPlugin public function afterSetValidationFilter( \Magento\SalesRule\Model\ResourceModel\Rule\Collection $subject, $result, - $websiteId = '', - $customerGroupId = '', + $websiteId = 0, + $customerGroupId = 0, $couponCode = '' ) { $now = $this->date->date()->format('Y-m-d');
websiteid and customer group id is int
dotmailer_dotmailer-magento2-extension
train
php
50262acd7a352fdffbf461f9dd9c6995b98a7ba8
diff --git a/sample/jazz.js b/sample/jazz.js index <HASH>..<HASH> 100644 --- a/sample/jazz.js +++ b/sample/jazz.js @@ -160,6 +160,29 @@ var generateSequence = function (start, end) { console.log(); }; +var mostCommonGeneratedSequences = function (start, end, count) { + var counts = _.chain(count) + .range() + .map(function () { + var sequence = jzaAutomaton.generateSequenceFromStartAndEnd(start, end); + return _.pluck(sequence.getChordsCollapsed(), 'name').toString(); + }) + .countBy() + .pick(function (count) { + return count > 1; + }) + .pairs() + .sortBy(function (x) { + return -x[1]; + }) + .map(function (x) { + return x[0] + ': ' + x[1]; + }) + .value() + .join('\n'); + console.log(counts); +}; + // runTests(); // trainJzA(); var jzaAutomaton = jza.import('sample/model.json');
Added mostCommonGeneratedSequences() to sample/jazz
jsrmath_sharp11
train
js
c4cc89a85d7e89bdd42c325e53dc9fb2fbf9c030
diff --git a/deltas/__init__.py b/deltas/__init__.py index <HASH>..<HASH> 100644 --- a/deltas/__init__.py +++ b/deltas/__init__.py @@ -6,4 +6,4 @@ from .algorithms import sequence_matcher, SequenceMatcher from .tokenizers import Token, Tokenizer, RegexTokenizer, text_split, wikitext_split from .segmenters import Segmenter, Segment, MatchableSegment -__version__ = "0.3.3" +__version__ = "0.3.4" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def requirements(fname): setup( name = "deltas", - version = "0.3.3", + version = "0.3.4", author = "Aaron Halfaker", author_email = "[email protected]", description = "An experimental diff library for generating " + \
Increments version to <I>
halfak_deltas
train
py,py
6dd73b1a94a01299bc88d9c49cd170bc1f109d41
diff --git a/blockstack_resolver/server/config.py b/blockstack_resolver/server/config.py index <HASH>..<HASH> 100755 --- a/blockstack_resolver/server/config.py +++ b/blockstack_resolver/server/config.py @@ -34,10 +34,6 @@ DEFAULT_HOST = '0.0.0.0' MEMCACHED_PORT = 11211 MEMCACHED_SERVER = '127.0.0.1' -MEMCACHED_TIMEOUT = 12 * 60 * 60 -USERSTATS_TIMEOUT = 60 * 60 -MEMCACHED_ENABLED = False - RECENT_BLOCKS = 100 VALID_BLOCKS = 36000 REFRESH_BLOCKS = 25 @@ -50,6 +46,10 @@ except: log.debug('config_local.py not found, using default settings') + MEMCACHED_TIMEOUT = 12 * 60 * 60 + USERSTATS_TIMEOUT = 60 * 60 + MEMCACHED_ENABLED = False + try: MEMCACHED_USERNAME = os.environ['MEMCACHEDCLOUD_USERNAME'] MEMCACHED_PASSWORD = os.environ['MEMCACHEDCLOUD_PASSWORD']
moved memcached configs to local settings
blockstack_blockstack-core
train
py
fdfc9e2751e96c9fb5378389cf57e70e97caa43d
diff --git a/hipster-core/src/main/java/es/usc/citius/hipster/model/impl/HeuristicNodeImpl.java b/hipster-core/src/main/java/es/usc/citius/hipster/model/impl/HeuristicNodeImpl.java index <HASH>..<HASH> 100644 --- a/hipster-core/src/main/java/es/usc/citius/hipster/model/impl/HeuristicNodeImpl.java +++ b/hipster-core/src/main/java/es/usc/citius/hipster/model/impl/HeuristicNodeImpl.java @@ -59,7 +59,8 @@ public class HeuristicNodeImpl<A,S,C extends Comparable<C>> @Override public String toString() { return "HeuristicNodeImpl{" + - "cost=" + cost + + "state=" + this.state() + + ", cost=" + cost + ", estimation=" + estimation + ", score=" + score + '}';
HeuristicNodeImpl toString now includes the state string representation
citiususc_hipster
train
java
f30f453528d76329f9d6489ce75a7240aad25273
diff --git a/app/policies/profile_policy.rb b/app/policies/profile_policy.rb index <HASH>..<HASH> 100644 --- a/app/policies/profile_policy.rb +++ b/app/policies/profile_policy.rb @@ -4,7 +4,7 @@ class ProfilePolicy < ApplicationPolicy end def show? - case user.role.name + case user.role.try(:name) when 'Administrator' true when 'Librarian'
fix policy file next-l/enju_leaf#<I>
next-l_enju_leaf
train
rb
063e951fc67b34333bb12565ca05d6f780cee60f
diff --git a/lib/torquespec/torquespec.rb b/lib/torquespec/torquespec.rb index <HASH>..<HASH> 100644 --- a/lib/torquespec/torquespec.rb +++ b/lib/torquespec/torquespec.rb @@ -36,6 +36,6 @@ TorqueSpec.configure do |config| config.drb_port = 7772 config.knob_root = ".torquespec" config.jboss_home = ENV['JBOSS_HOME'] - config.jvm_args = "-Xms64m -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -Djruby_home.env.ignore=true -Dgem.path=default" + config.jvm_args = "-Xms64m -Xmx1024m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSClassUnloadingEnabled -Dgem.path=default" end
This option is obsolete now that TorqueBox can use an external JRuby
torquebox_torquespec
train
rb
748122d8e850a9b42dc8138b989e7de981063d9e
diff --git a/handlers/jobs.js b/handlers/jobs.js index <HASH>..<HASH> 100644 --- a/handlers/jobs.js +++ b/handlers/jobs.js @@ -287,6 +287,10 @@ export default { let path = result.filePath; agave.getFile(path, (err, resp) => { + // rename main output files + if (fileName.indexOf('.err') > -1 || fileName.indexOf('.out') > -1) { + fileName = 'main' + fileName.substr(fileName.length - 4); + } res.setHeader('Content-disposition', 'attachment; filename=' + fileName); res.setHeader('Content-type', resp.headers['content-type']); res.send(resp.body);
Setup up renaming of 'main' job output files for human readability
OpenNeuroOrg_openneuro
train
js
2fbd25e290c8970e36c1274236daa5b0ff0aa587
diff --git a/tests/src/FuelPHP/Fieldset/Input/SelectTest.php b/tests/src/FuelPHP/Fieldset/Input/SelectTest.php index <HASH>..<HASH> 100644 --- a/tests/src/FuelPHP/Fieldset/Input/SelectTest.php +++ b/tests/src/FuelPHP/Fieldset/Input/SelectTest.php @@ -60,4 +60,18 @@ class SelectTest extends \PHPUnit_Framework_TestCase $this->assertEquals(1, count($this->object)); } + /** + * @group Fieldset + */ + public function testSetValue() + { + $option = new Select\Option('test'); + $this->object[] = $option; + $this->object->setValue('test'); + + $this->assertEquals( + array('selected', 'value' => 'test'), + $option->getAttributes() + ); + } }
Adds repopulation to select
fuelphp_fieldset
train
php
665dfa53a5adffdf2d905212856ff7648ae6aa30
diff --git a/android/lib/JavaActivity.js b/android/lib/JavaActivity.js index <HASH>..<HASH> 100644 --- a/android/lib/JavaActivity.js +++ b/android/lib/JavaActivity.js @@ -77,7 +77,7 @@ function(zipEntry, packageId, activityClassName) { // Always load app from manifest instead of index.html templateData = templateData.replace('loadAppFromUrl("file:///android_asset/www/index.html")', - 'loadAppFromManifest("file:///android_asset/www/manifest.json")'); + 'loadAppFromManifest("app://' + packageId + '/manifest.json")'); // Do not overwrite activity file because it may contain app-specific code // FIXME we should be smarter about this:
Android: Always load app using app:// protocol (#<I>) We used to use file:// but that has security implications. BUG=APPTOOLS-<I>
crosswalk-project_crosswalk-app-tools
train
js
8400d282850e6321c68f055ff0c76b288837c445
diff --git a/sources/lib/Generator/ModelGenerator.php b/sources/lib/Generator/ModelGenerator.php index <HASH>..<HASH> 100644 --- a/sources/lib/Generator/ModelGenerator.php +++ b/sources/lib/Generator/ModelGenerator.php @@ -118,7 +118,7 @@ class {:entity:}Model extends Model public function __construct() { $this->structure = new {:entity:}Structure; - $this->flexible_entity_class = "\{:namespace:}\{:entity:}"; + $this->flexible_entity_class = '\{:namespace:}\{:entity:}'; } }
Strengthen model generator against bad ascaping.
pomm-project_ModelManager
train
php
672bd8bf4407b62a3425ed405190e3dfdc164c42
diff --git a/cartoview/app_manager/context_processors.py b/cartoview/app_manager/context_processors.py index <HASH>..<HASH> 100644 --- a/cartoview/app_manager/context_processors.py +++ b/cartoview/app_manager/context_processors.py @@ -37,7 +37,7 @@ def cartoview_processor(request): defaults = { 'apps': App.objects.all().order_by('order'), - 'CARTOVIEW_VERSION': get_version(__version__), + 'CARTOVIEW_VERSION': get_version(list(__version__)), 'APPS_MENU': settings.APPS_MENU, 'apps_instance_count': AppInstance.objects.all().count(), "cartoview_counters": cartoview_counters,
show cartoview version fix it was showing geonode version
cartologic_cartoview
train
py
549a81df6d47c892f9ee67cc16e5e91e9066f0e1
diff --git a/src/MUIDataTable.js b/src/MUIDataTable.js index <HASH>..<HASH> 100644 --- a/src/MUIDataTable.js +++ b/src/MUIDataTable.js @@ -876,19 +876,19 @@ class MUIDataTable extends React.Component { sortTable(data, col, order) { let dataSrc = this.options.customSort ? this.options.customSort(data, col, order || 'desc') : data; - + let sortedData = dataSrc.map((row, sIndex) => ({ data: row.data[col], rowData: row.data, position: sIndex, - rowSelected: this.state.selectedRows.lookup[sIndex] ? true : false, + rowSelected: this.state.selectedRows.lookup[row.index] ? true : false, })); if (!this.options.customSort) { sortedData.sort(sortCompare(order)); } - let tableData = []; + let tableData = []; let selectedRows = []; for (let i = 0; i < sortedData.length; i++) {
bugfix: sort issue (#<I>)
gregnb_mui-datatables
train
js
ecfac416ab677c9347705137e2d948fde6153e1a
diff --git a/inc/roots-cleanup.php b/inc/roots-cleanup.php index <HASH>..<HASH> 100644 --- a/inc/roots-cleanup.php +++ b/inc/roots-cleanup.php @@ -89,10 +89,16 @@ function roots_root_relative_attachment_urls() { add_action('pre_get_posts', 'roots_root_relative_attachment_urls'); -// remove dir and set lang="en" as default (rather than en-US) +// set lang="en" as default (rather than en-US) function roots_language_attributes() { $attributes = array(); $output = ''; + if (function_exists('is_rtl')) { + if (is_rtl() == 'rtl') { + $attributes[] = 'dir="rtl"'; + } + } + $lang = get_bloginfo('language'); if ($lang && $lang !== 'en-US') { $attributes[] = "lang=\"$lang\"";
Fixes #<I> - dir="rtl" will no longer be removed
roots_sage
train
php
ecdd43fe85161d8eed5cb9369faaa16f18a75829
diff --git a/salt/daemons/flo/core.py b/salt/daemons/flo/core.py index <HASH>..<HASH> 100644 --- a/salt/daemons/flo/core.py +++ b/salt/daemons/flo/core.py @@ -270,7 +270,7 @@ class Router(ioflo.base.deeding.Deed): except (ValueError, IndexError): log.error('Received invalid message: {0}'.format(msg)) return - if d_estate != self.udp_stack.value.estate: + if d_estate != self.udp_stack.value.estate.name: log.error( 'Received message for wrong estate: {0}'.format(d_estate)) return
track on estate name, not estate object
saltstack_salt
train
py
b3e7c7ed8a04f992be42477255df8c0db3602c89
diff --git a/planet/api/client.py b/planet/api/client.py index <HASH>..<HASH> 100644 --- a/planet/api/client.py +++ b/planet/api/client.py @@ -296,3 +296,15 @@ class ClientV1(_Base): return self.dispatcher.response(models.Request( self._url('data/v1/stats'), self.auth, body_type=models.JSON, data=body, method='POST')).get_body() + + def get_assets(self, item): + assets_url = item['_links']['assets'] + return self._get(assets_url).get_body() + + def activate(self, asset): + activate_url = asset['_links']['activate'] + return self._get(activate_url).get_body() + + def download(self, asset, callback=None): + download_url = asset['location'] + return self._get(download_url, models.Image, callback=callback)
add assets, activate, download to client
planetlabs_planet-client-python
train
py
bc78630c100d11c25bdb4be7059406605c86b240
diff --git a/js/runner.go b/js/runner.go index <HASH>..<HASH> 100644 --- a/js/runner.go +++ b/js/runner.go @@ -113,7 +113,7 @@ func (r *Runner) GetChecks() []*lib.Check { return r.Checks } -func (r Runner) GetOptions() lib.Options { +func (r *Runner) GetOptions() lib.Options { return r.Options }
[fix] Lint: This passed a mutex by value
loadimpact_k6
train
go
5b315cf3b146825a4c123e1dae35c4d35c5799b6
diff --git a/lurklib/core.py b/lurklib/core.py index <HASH>..<HASH> 100755 --- a/lurklib/core.py +++ b/lurklib/core.py @@ -146,7 +146,7 @@ class _Core(variables._Variables, exceptions._Exceptions, self._index += 1 return msg - def readable(self, timeout=3): + def readable(self, timeout=1): """ Checks whether self.recv() will block or not. Optional arguments:
Accidentally commit'ed a modification used purely for my own testing.
jamieleshaw_lurklib
train
py
2b658054bbccd0f9f78a89ee6deb3fe7826645bd
diff --git a/docs/session.go b/docs/session.go index <HASH>..<HASH> 100644 --- a/docs/session.go +++ b/docs/session.go @@ -20,12 +20,12 @@ import ( "time" "github.com/Sirupsen/logrus" - "github.com/docker/docker/api/types" "github.com/docker/docker/cliconfig" "github.com/docker/docker/pkg/httputils" "github.com/docker/docker/pkg/ioutils" "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/tarsum" + "github.com/docker/docker/utils" ) var ( @@ -425,7 +425,7 @@ func (r *Session) GetRepositoryData(remote string) (*RepositoryData, error) { // and return a non-obtuse error message for users // "Get https://index.docker.io/v1/repositories/library/busybox/images: i/o timeout" // was a top search on the docker user forum - if types.IsTimeout(err) { + if utils.IsTimeout(err) { return nil, fmt.Errorf("Network timed out while trying to connect to %s. You may want to check your internet connection or if you are behind a proxy.", repositoryTarget) } return nil, fmt.Errorf("Error while pulling image: %v", err)
Make RegistryConfig a typed value in the api. Remove possible circular dependency that prevented us from using a real type.
docker_distribution
train
go
180f19f7f38f747dbde9a46a9450e946b4bf18de
diff --git a/fireplace/card.py b/fireplace/card.py index <HASH>..<HASH> 100644 --- a/fireplace/card.py +++ b/fireplace/card.py @@ -171,8 +171,10 @@ class Card(Entity): def destroy(self): logging.info("%r dies" % (self)) + inPlay = self.zone == Zone.PLAY self.zone = Zone.GRAVEYARD - if self.hasDeathrattle: + if inPlay and self.hasDeathrattle: + # Should this be in an event? if not hasattr(self.data, "deathrattle"): logging.warning("Undefined deathrattle for %r", self) else:
Only trigger deathrattles from the PLAY Zone
jleclanche_fireplace
train
py
c984bcf9b4c5ecd599b54b2ff397c8cbaef79771
diff --git a/heron/tools/cli/src/python/submit.py b/heron/tools/cli/src/python/submit.py index <HASH>..<HASH> 100644 --- a/heron/tools/cli/src/python/submit.py +++ b/heron/tools/cli/src/python/submit.py @@ -424,8 +424,8 @@ def run(command, parser, cl_args, unknown_args): tar_type = topology_file.endswith(".tar") or topology_file.endswith(".tar.gz") pex_type = topology_file.endswith(".pex") cpp_type = topology_file.endswith(".dylib") or topology_file.endswith(".so") - if not jar_type and not tar_type and not pex_type and not cpp_type: - ext_name = os.path.splitext(topology_file) + if not (jar_type or tar_type or pex_type or cpp_type): + _, ext_name = os.path.splitext(topology_file) err_context = "Unknown file type '%s'. Please use .tar "\ "or .tar.gz or .jar or .pex or .dylib or .so file"\ % ext_name
Fix code when submitting a toplogy file without an known extension (#<I>)
apache_incubator-heron
train
py
c922e2e4866d74f763ebb14b341dc4d710fcd032
diff --git a/packages/cli/src/dirCommand.js b/packages/cli/src/dirCommand.js index <HASH>..<HASH> 100644 --- a/packages/cli/src/dirCommand.js +++ b/packages/cli/src/dirCommand.js @@ -4,7 +4,7 @@ import outputFileSync from 'output-file-sync' import readdir from 'recursive-readdir' import camelcase from 'camelcase' import dashify from 'dashify' -import { stat, convertFile } from './util' +import { convertFile, stat } from './util' const CASE = { KEBAB: 'kebab', // kebab-case @@ -50,7 +50,7 @@ async function dirCommand( if (!isCompilable(relative)) return false relative = rename(relative, ext, filenameCase) - const dest = path.join(program.outDir, relative) + const dest = path.resolve(program.outDir, relative); const code = await convertFile(src, options) outputFileSync(dest, code)
fix(cli): fix --out-dir usage with absolute path (#<I>)
smooth-code_svgr
train
js
7bab024e308e2a9c38a1ef85984cd8b821766ec0
diff --git a/Observer/Z/Register.php b/Observer/Z/Register.php index <HASH>..<HASH> 100644 --- a/Observer/Z/Register.php +++ b/Observer/Z/Register.php @@ -36,15 +36,11 @@ class Register */ public function accountPv(\Magento\Sales\Api\Data\OrderInterface $order) { - $state = $order->getState(); - if ($state == \Magento\Sales\Model\Order::STATE_PROCESSING) { - /* transfer PV if order is paid */ - $orderId = $order->getEntityId(); - /** @var \Praxigento\Pv\Api\Service\Sale\Account\Pv\Request $req */ - $req = new \Praxigento\Pv\Api\Service\Sale\Account\Pv\Request(); - $req->setSaleOrderId($orderId); - $this->servPvAccount->exec($req); - } + /* sale state validation should be performed before */ + $orderId = $order->getEntityId(); + $req = new \Praxigento\Pv\Api\Service\Sale\Account\Pv\Request(); + $req->setSaleOrderId($orderId); + $this->servPvAccount->exec($req); } /**
MOBI-<I> PV for referal and privileged customers
praxigento_mobi_mod_pv
train
php
a876ad78476a1fd0ab93858bc79340557f64d5b9
diff --git a/src/Rcm/Model/SiteFactory.php b/src/Rcm/Model/SiteFactory.php index <HASH>..<HASH> 100644 --- a/src/Rcm/Model/SiteFactory.php +++ b/src/Rcm/Model/SiteFactory.php @@ -23,8 +23,7 @@ namespace Rcm\Model; use Rcm\Entity\Domain, Rcm\Exception\LanguageNotFoundException, Rcm\Exception\SiteNotFoundException, - Rcm\Entity\Site, - Locale; + Rcm\Entity\Site; /** * Site Factory
removed locale use stmt per westins request
reliv_Rcm
train
php
b34fd2cca944d00d8cff455c4c3378164a8d59cb
diff --git a/user/index.php b/user/index.php index <HASH>..<HASH> 100644 --- a/user/index.php +++ b/user/index.php @@ -88,6 +88,13 @@ $PAGE->set_pagetype('course-view-' . $course->format); $PAGE->add_body_class('path-user'); // So we can style it independently. $PAGE->set_other_editing_capability('moodle/course:manageactivities'); +// Expand the users node in the settings navigation when it exists because those pages +// are related to this one. +$node = $PAGE->settingsnav->find('users', navigation_node::TYPE_CONTAINER); +if ($node) { + $node->forceopen(); +} + echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('participants'));
MDL-<I> users: Expand users node in settings nav When we are on the participants page...
moodle_moodle
train
php
0bd91fc2c8f67581918433157d67b9cadb1ae723
diff --git a/pipeline/finders.py b/pipeline/finders.py index <HASH>..<HASH> 100644 --- a/pipeline/finders.py +++ b/pipeline/finders.py @@ -10,6 +10,17 @@ from pipeline.conf import settings class PipelineFinder(BaseStorageFinder): storage = staticfiles_storage + def find(self, path, all=False): + if not settings.PIPELINE_ENABLED: + return super(PipelineFinder, self).find(path, all) + else: + return [] + + def list(self, ignore_patterns): + if not settings.PIPELINE_ENABLED: + return super(PipelineFinder, self).list(ignore_patterns) + else: + return [] class ManifestFinder(BaseFinder): def find(self, path, all=False):
Ensure the finders don't mess with collectstatic.
jazzband_django-pipeline
train
py
d38125f297db813c48b2304dd95482fb307269dc
diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -68,6 +68,7 @@ import java.util.logging.Logger; import java.nio.charset.Charset; import java.net.InetAddress; import java.net.NetworkInterface; +import java.net.Inet4Address; /** * Represents the running state of a remote computer that holds {@link Executor}s. @@ -598,6 +599,7 @@ public abstract class Computer extends AbstractModelObject implements AccessCont while (e.hasMoreElements()) { InetAddress ia = e.nextElement(); if(ia.isLoopbackAddress()) continue; + if(!(ia instanceof Inet4Address)) continue; names.add(ia.getHostAddress()); } }
only support IPv4 addresses for now, as I noticed a failure to connect when IPv6 address is used. git-svn-id: <URL>
jenkinsci_jenkins
train
java
23bcefbf741be17799880417c8900780ad659589
diff --git a/lib/canard/railtie.rb b/lib/canard/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/canard/railtie.rb +++ b/lib/canard/railtie.rb @@ -10,6 +10,9 @@ module Canard app.config.eager_load_paths = app.config.eager_load_paths.reject do |path| Canard.load_paths.include?(path) end + if app.config.respond_to?(:watchable_dirs) + app.config.watchable_dirs.merge! Hash[ Canard.load_paths.product([[:rb]]) ] + end end initializer "canard.active_record" do |app| @@ -20,7 +23,7 @@ module Canard Canard.find_abilities end end - + initializer "canard.mongoid" do |app| if defined?(Mongoid) require 'canard/adapters/mongoid'
Fixed reloading for Rails <I>.
james2m_canard
train
rb
9b33be4f5b5c4e002a56d93eda6c1c04948e3740
diff --git a/src/test/java/org/sakaiproject/nakamura/lite/content/AbstractContentManagerFinderTest.java b/src/test/java/org/sakaiproject/nakamura/lite/content/AbstractContentManagerFinderTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/sakaiproject/nakamura/lite/content/AbstractContentManagerFinderTest.java +++ b/src/test/java/org/sakaiproject/nakamura/lite/content/AbstractContentManagerFinderTest.java @@ -1149,7 +1149,7 @@ public abstract class AbstractContentManagerFinderTest { } private static class MV { - private static final String propKey = "sakai:tag-uuid"; + private static final String propKey = "sakai:category"; private static final String pathA = "/multi/pathA"; private static final String pathB = "/multi/pathB"; private static final String[] multiValueA = new String[] { "valueA", "valueB" };
Tests for array columns must use columns that are arrays.
ieb_sparsemapcontent
train
java
0e4c80b95360e39cef89bb2a4eaa5d3adf89ffe9
diff --git a/transport/src/main/java/io/netty/channel/ChannelHandlerAppender.java b/transport/src/main/java/io/netty/channel/ChannelHandlerAppender.java index <HASH>..<HASH> 100644 --- a/transport/src/main/java/io/netty/channel/ChannelHandlerAppender.java +++ b/transport/src/main/java/io/netty/channel/ChannelHandlerAppender.java @@ -181,9 +181,9 @@ public class ChannelHandlerAppender extends ChannelInboundHandlerAdapter { public void handlerAdded(ChannelHandlerContext ctx) throws Exception { added = true; - DefaultChannelPipeline pipeline = (DefaultChannelPipeline) ctx.pipeline(); - - String name = ctx.name(); + DefaultChannelHandlerContext dctx = (DefaultChannelHandlerContext) ctx; + DefaultChannelPipeline pipeline = (DefaultChannelPipeline) dctx.pipeline(); + String name = dctx.name(); try { for (Entry e: handlers) { String oldName = name; @@ -192,7 +192,7 @@ public class ChannelHandlerAppender extends ChannelInboundHandlerAdapter { } else { name = e.name; } - pipeline.addAfter(ctx.executor(), oldName, name, e.handler); + pipeline.addAfter(dctx.executor, oldName, name, e.handler); } } finally { if (selfRemoval) {
Fix IllegalStateException caused by ChannelHandlerAppender
netty_netty
train
java
6735c0bf6ed7a2c96fd689810e231690f9d52f7f
diff --git a/salt/cli/__init__.py b/salt/cli/__init__.py index <HASH>..<HASH> 100644 --- a/salt/cli/__init__.py +++ b/salt/cli/__init__.py @@ -446,10 +446,19 @@ class SaltRun(object): ''' parser = optparse.OptionParser() + parser.add_option('-c', + '--config', + dest='config', + default='/etc/salt/master', + help='Change the location of the master configuration;'\ + + ' default=/etc/salt/master') + options, args = parser.parse_args() opts = {} + opts['config'] = options.config + if len(args > 0): opts['fun'] = args[0] else:
Add config to the options on the salt runner
saltstack_salt
train
py
52b52f4e4a320cd2580d19a952589bd6f2f2144e
diff --git a/java/server/test/org/openqa/grid/internal/DefaultToFIFOPriorityTest.java b/java/server/test/org/openqa/grid/internal/DefaultToFIFOPriorityTest.java index <HASH>..<HASH> 100644 --- a/java/server/test/org/openqa/grid/internal/DefaultToFIFOPriorityTest.java +++ b/java/server/test/org/openqa/grid/internal/DefaultToFIFOPriorityTest.java @@ -49,8 +49,6 @@ public class DefaultToFIFOPriorityTest { private List<MockedRequestHandler> requests = Collections.synchronizedList(new ArrayList<MockedRequestHandler>()); - private volatile boolean reqDone = false; - /** * create a hub with 1 FF * @@ -105,9 +103,6 @@ public class DefaultToFIFOPriorityTest { // when release is executed, 1 slot is // freed.The iteration over the queue to sort + find the match isn't // instant. - while (!reqDone) { - Thread.sleep(20); - } int cpt = 0; while (cpt < 8) { try {
Reverting the changes to this test
SeleniumHQ_selenium
train
java
a1efa117f43baf58579bc1a46a20ceb5fca0089b
diff --git a/grip/app.py b/grip/app.py index <HASH>..<HASH> 100644 --- a/grip/app.py +++ b/grip/app.py @@ -10,6 +10,7 @@ import socket import sys import threading import time +import errno from traceback import format_exc try: from urlparse import urlparse @@ -71,9 +72,19 @@ class Grip(Flask): __name__, static_url_path=static_url_path, instance_path=instance_path, **kwargs) self.config.from_object('grip.settings') - self.config.from_pyfile('settings_local.py', silent=True) - self.config.from_pyfile( - os.path.join(instance_path, 'settings.py'), silent=True) + + try: + self.config.from_pyfile('settings_local.py', silent=True) + self.config.from_pyfile( + os.path.join(instance_path, 'settings.py'), silent=True) + except IOError as ex: + # workaround for pre-existing ~/.grip regular file from + # the cd-rom tool, and flask not silently ignoring those + if ex.errno in (errno.ENOTDIR,): + pass + else: + raise + # Defaults from settings if autorefresh is None:
[app.py] silently absorb ENOTDIR IOErrors when trying configfile paths. Fixes issue #<I>
joeyespo_grip
train
py
2342e1cfb813b6da7b2f6ecf2a5622501eba34b4
diff --git a/src/Common/Misc/ConvertProxyProperty/index.js b/src/Common/Misc/ConvertProxyProperty/index.js index <HASH>..<HASH> 100644 --- a/src/Common/Misc/ConvertProxyProperty/index.js +++ b/src/Common/Misc/ConvertProxyProperty/index.js @@ -4,6 +4,7 @@ const typeMapping = { 'list-n': 'Enum', 'list-1': 'Enum', checkbox: 'Checkbox', + textarea: 'Cell', }; function extractLayout(ui) {
fix(ConvertProxyProperty): Add mapping for textarea widget to Cell Not the best option yet but at least that allow the edior to work
Kitware_paraviewweb
train
js
3ac83d7bc58222c1f048aa70f435baae6b9b6cd5
diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -4749,6 +4749,8 @@ def get_password_data( ret[next(six.iterkeys(item))] = next(six.itervalues(item)) if not HAS_M2 and not HAS_PYCRYPTO: + if 'key' in kwargs or 'key_file' in kwargs: + log.warn("No crypto library is installed, can not decrypt password") return ret if 'key' not in kwargs:
Warn when password decrypton requested but not possible
saltstack_salt
train
py
ec53a3b2aca786751a12be606fd549e6b31ab8cb
diff --git a/minify.js b/minify.js index <HASH>..<HASH> 100644 --- a/minify.js +++ b/minify.js @@ -40,10 +40,9 @@ */ function optimize(files, options) { var i, - name = '', - lAllCSS = '', - /* varible contains all readed files count */ - lReadedFilesCount = 0, + name = '', + lAllCSS = '', + readedFilesCount = 0, /** * Processing of files @@ -56,7 +55,7 @@ lOptimizeParams; function isLastFile() { - return lReadedFilesCount === files.length; + return readedFilesCount === files.length; } if (Util.isObject(filename)) { @@ -78,15 +77,15 @@ data: data }); - Util.ifExec(lExt !== '.css', function(pOptData) { - var ret = Util.isString(pOptData); + Util.ifExec(lExt !== '.css', function(optimizedData) { + var ret = Util.isString(optimizedData); if (ret) { - data = pOptData; - lAllCSS += pOptData; + data = optimizedData; + lAllCSS += optimizedData; } - ++lReadedFilesCount; + ++readedFilesCount; if (isLastFile()) saveAllCSS(lOptimizeParams, lAllCSS);
chore(minify) optimize: lReadedFilesCount -> readedFilesCount, optimizedData
coderaiser_minify
train
js
c7cafcdfedc43fe1b79e49cb5e040d996d237612
diff --git a/ReText/highlighter.py b/ReText/highlighter.py index <HASH>..<HASH> 100644 --- a/ReText/highlighter.py +++ b/ReText/highlighter.py @@ -24,12 +24,14 @@ class ReTextHighlighter(QSyntaxHighlighter): ('^#.+', None, QFont.Black), # 10: Headers (r'(?<=\[)[^\[\]]*(?=\])', Qt.blue, QFont.Normal), # 11: Links and images (r'(?<=\]\()[^\(\)]*(?=\))', None, QFont.Normal, True, True), # 12: Link references - ('^ *>', Qt.darkGray, QFont.Bold) # 13: Blockquotes + ('^ *>', Qt.darkGray, QFont.Bold), # 13: Blockquotes + ('.. [a-z]+::', Qt.darkMagenta, QFont.Normal), # 14: reStructuredText directives + (':[a-z]+:', Qt.darkRed, QFont.Normal) # 15: reStructuredText roles ) patternsDict = { DOCTYPE_NONE: (), DOCTYPE_MARKDOWN: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13), - DOCTYPE_REST: (4, 6), + DOCTYPE_REST: (4, 6, 14, 15), DOCTYPE_HTML: (0, 1, 2, 3) } if self.docType in patternsDict:
Highlighter: highlight reStructuredText directives and roles
retext-project_retext
train
py
87754f6450ec0d118b710e76d475d8c9de401774
diff --git a/src/tabris/Promise.js b/src/tabris/Promise.js index <HASH>..<HASH> 100644 --- a/src/tabris/Promise.js +++ b/src/tabris/Promise.js @@ -86,7 +86,7 @@ function setStackTraceStack(value) { } export default function Promise(fn) { - const stackTraceStack = [new Error().stack].concat(getStackTraceStack()); + const stackTraceStack = [new Error().stack].concat(getStackTraceStack().slice(0, 10)); if (typeof this !== 'object') { throw new TypeError('Promises must be constructed via new'); } diff --git a/src/tabris/util.js b/src/tabris/util.js index <HASH>..<HASH> 100644 --- a/src/tabris/util.js +++ b/src/tabris/util.js @@ -240,7 +240,7 @@ export function getNativeObject(object) { * @param {any[]=} args */ export function createNativeCallback(cb, target, args) { - const stackTraceStack = [new Error().stack].concat(tabris._stackTraceStack); + const stackTraceStack = [new Error().stack].concat(tabris._stackTraceStack.slice(0, 10)); return function() { const oldStack = tabris._stackTraceStack; tabris._stackTraceStack = stackTraceStack;
Limit cached stack traces to <I> Timer and promises are keeping the stack trace from their creation and append them to any new stack traces generated within their callback. However, if a timer or promise is called recursively this causes the equivalent of an asynchronous stack overflow due to the stored stack is growing infinitely. Change-Id: I8d3caae<I>cd5cfe<I>a<I>f8c<I>c<I>e6
eclipsesource_tabris-js
train
js,js
9f7a7c9352f8d6b230fc7069990bfde10d900fe0
diff --git a/state.go b/state.go index <HASH>..<HASH> 100644 --- a/state.go +++ b/state.go @@ -308,8 +308,12 @@ func (s *State) ChannelAdd(channel *Channel) error { // If the channel exists, replace it if c, ok := s.channelMap[channel.ID]; ok { - channel.Messages = c.Messages - channel.PermissionOverwrites = c.PermissionOverwrites + if c.Messages != nil { + channel.Messages = c.Messages + } + if c.PermissionOverwrites != nil { + channel.PermissionOverwrites = c.PermissionOverwrites + } *c = *channel return nil
Don't stomp on messages or permission overrides on ChannelUpdate.
bwmarrin_discordgo
train
go
164b38652704187e9cb1df90b1e987fafc1abd44
diff --git a/amqp_client.js b/amqp_client.js index <HASH>..<HASH> 100644 --- a/amqp_client.js +++ b/amqp_client.js @@ -163,4 +163,16 @@ AMQPClient.prototype.receive = function(source, filter, cb) { } }; +AMQPClient.prototype.disconnect = function(cb) { + debug('Disconnecting'); + if (this._connection) { + this._connection.on(Connection.Disconnected, function() { + cb(); + }); + this._connection.close(); + this._connection = null; + this._session = null; + } +}; + module.exports = AMQPClient;
Add disconnect method to AMQPClient
noodlefrenzy_node-amqp10
train
js
9fa11afd05047e9a5f94782ae8096b8c5a0266ba
diff --git a/src/Filter/EntityFilter.php b/src/Filter/EntityFilter.php index <HASH>..<HASH> 100644 --- a/src/Filter/EntityFilter.php +++ b/src/Filter/EntityFilter.php @@ -128,8 +128,8 @@ final class EntityFilter implements FilterInterface $identifierValue = $entityManager->getUnitOfWork()->getSingleIdentifierValue($parameterValue); - if (('uuid' === $identifierType && $identifierValue instanceof Uuid) - || ('ulid' === $identifierType && $identifierValue instanceof Ulid)) { + if (('uuid' === $identifierType || $identifierValue instanceof Uuid) + || ('ulid' === $identifierType || $identifierValue instanceof Ulid)) { try { return Type::getType($identifierType)->convertToDatabaseValue($identifierValue, $entityManager->getConnection()->getDatabasePlatform()); } catch (\Throwable) {
Fix: Fixes EntityFilter for Ulid/Uuid with custom doctrine type
EasyCorp_EasyAdminBundle
train
php
459b52aa89a9fbad939fc0ca9ed501a6f81cecac
diff --git a/src/runez/convert.py b/src/runez/convert.py index <HASH>..<HASH> 100644 --- a/src/runez/convert.py +++ b/src/runez/convert.py @@ -205,7 +205,7 @@ class Anchored(object): Returns: (str): Short form, using '~' if applicable """ - if not path: + if path is None: return path path = str(path) diff --git a/tests/test_convert.py b/tests/test_convert.py index <HASH>..<HASH> 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -58,7 +58,8 @@ def test_flattened(): assert runez.represented_args(None) == "" assert runez.represented_args([]) == "" - assert runez.represented_args([1, 2], separator="+") == "1+2" + assert runez.represented_args([0, 1, 2], separator="+") == "0+1+2" + assert runez.represented_args(["foo", {}, 0, [1, 2], {3: 4}, 5]) == 'foo {} 0 "[1, 2]" "{3: 4}" 5' def test_formatted():
Corrected bug in `represented_args()`
zsimic_runez
train
py,py
3f59a54e0c00d88a20b7ed3aec58779eee6a8653
diff --git a/lib/adminlib.php b/lib/adminlib.php index <HASH>..<HASH> 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -110,12 +110,26 @@ function upgrade_plugins($type, $dir, $return) { $db->debug = false; /// Continue with the instalation, roles and other stuff if ($status) { - // OK so far, now update the plugins record + /// OK so far, now update the plugins record set_config($pluginversion, $plugin->version); + + /// Install capabilities if (!update_capabilities($type.'/'.$plug)) { - error('Could not set up the capabilities for '.$module->name.'!'); + error('Could not set up the capabilities for '.$plugin->name.'!'); } + /// Install events events_update_definition($type.'/'.$plug); + + /// Run local install function if there is one + if (is_readable($fullplug .'/lib.php')) { + include_once($fullplug .'/lib.php'); + $installfunction = $plugin->name.'_install'; + if (function_exists($installfunction)) { + if (! $installfunction() ) { + notify('Encountered a problem running install function for '.$module->name.'!'); + } + } + } notify(get_string('modulesuccess', '', $plugin->name), 'notifysuccess'); } else {
Added support for xxxxx_install() hooks for generic plugins too
moodle_moodle
train
php
294fc3f5c5cb573600aa608821860336a7e2f096
diff --git a/test/lawnchair-spec.js b/test/lawnchair-spec.js index <HASH>..<HASH> 100755 --- a/test/lawnchair-spec.js +++ b/test/lawnchair-spec.js @@ -44,24 +44,21 @@ test('independent data stores', function() { QUnit.stop(); QUnit.expect(2); - var store1 = new Lawnchair({name: "store1"}, function() {}); - - store1 .save({key: 'apple', quantity: 3}, function() { - - var store2 = new Lawnchair({name: "store2"}, function() {}); - - store1.all(function(r) { - equals(r.length, 1); - - store2.all(function(r) { - equals(r.length, 0); - QUnit.start(); - }); + new Lawnchair({name: "store1"}, function(store1) { + store1.nuke(function(){ + store1.save({key: 'apple', quantity: 3}, function() { + new Lawnchair({name: "store2"}, function(store2) { + store1.all(function(r) { + equals(r.length, 1); + store2.all(function(r) { + equals(r.length, 0); + QUnit.start(); + }); + }); + }); + }); }); - - }) - - + }); }) module('all()', {
make the independent data stores test work with adapters that have async constructors
brianleroux_lawnchair
train
js
fb3833d9d8f06826066b86204b278b970fa40751
diff --git a/app/ui/components/codemirror/code-editor.js b/app/ui/components/codemirror/code-editor.js index <HASH>..<HASH> 100644 --- a/app/ui/components/codemirror/code-editor.js +++ b/app/ui/components/codemirror/code-editor.js @@ -557,7 +557,8 @@ class CodeEditor extends PureComponent { } _codemirrorPreventWhenTypePassword (cm, e) { - if (this.props.type.toLowerCase() === 'password') { + const {type} = this.props; + if (type && type.toLowerCase() === 'password') { e.preventDefault(); } }
Fix copying of large text contents (Fixes #<I>)
getinsomnia_insomnia
train
js
36b8c82e0e6213ab1b9f7d571f0b3c73170b1110
diff --git a/ella/exports/managers.py b/ella/exports/managers.py index <HASH>..<HASH> 100644 --- a/ella/exports/managers.py +++ b/ella/exports/managers.py @@ -231,7 +231,6 @@ class ExportItemizer(object): # Assign positions of items (if position is overloaded via ExportPosition) self.__insert_to_position(fix_positions, objects) #log.debug(remove_diacritical('Export items (overloaded positions): %s' % objects)) - pre_out = objects[:max_items] else: # Get listed objects for category @@ -239,12 +238,10 @@ class ExportItemizer(object): objects.sort(cmp=cmp_listing_or_meta) pre_out = objects # extract Publishable objects from Listing/ExportPosition objects - out = list() + self.__items = list() for i in pre_out: pub = self.__get_overloaded_publishable(i, export=use_export) - out.append(pub) - # override title, photo, etc. via get_export_data? - self.__items = out + self.__items.append(pub) class ExportManager(models.Manager):
menaz modified, data appended directly to instance variable.
ella_ella
train
py
f0e78a7df2332afea80c774e88bc551158b404d7
diff --git a/src/directives/jf_tabs/jf_tabs.js b/src/directives/jf_tabs/jf_tabs.js index <HASH>..<HASH> 100644 --- a/src/directives/jf_tabs/jf_tabs.js +++ b/src/directives/jf_tabs/jf_tabs.js @@ -115,7 +115,7 @@ class jfTabsController { } hasClass(obj) { - if (obj.class) + if (obj && obj.class) return true; } }
jf-tabs: Safety check to prevent errors in some cases
jfrog_jfrog-ui-essentials
train
js
f490ad77cd1a368a9c5dfa02dac36a686d3c8b5a
diff --git a/src/Extensions/SiteTreeContentReview.php b/src/Extensions/SiteTreeContentReview.php index <HASH>..<HASH> 100644 --- a/src/Extensions/SiteTreeContentReview.php +++ b/src/Extensions/SiteTreeContentReview.php @@ -328,6 +328,10 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider */ public function updateSettingsFields(FieldList $fields) { + if ($this->owner->hasMethod('displayContentReview') && !$this->owner->displayContentReview()) { + return; + } + $module = ModuleLoader::getModule('silverstripe/contentreview'); Requirements::javascript($module->getRelativeResourcePath('client/dist/js/contentreview.js'));
Add a hook to updateSettingsFields so that devs can show/hide when desired.
silverstripe_silverstripe-contentreview
train
php
381e2ebfa98ae9d90de69e0fe3ab71d114aaeef9
diff --git a/sharepointAPI.php b/sharepointAPI.php index <HASH>..<HASH> 100644 --- a/sharepointAPI.php +++ b/sharepointAPI.php @@ -106,7 +106,7 @@ class sharepointAPI{ /** * Read List MetaData (Column configurtion) - * Return a full listing of columns and their configurtion options for a given sharepointList. + * Return a full listing of columns and their configurtion options for a given sharepoint list. * * @param $list Name or GUID of list to return metaData from. * @param $hideInternal true|false Attempt to hide none useful columns (internal data etc) @@ -134,8 +134,12 @@ class sharepointAPI{ //Format data in to array or object foreach($nodes as $counter => $node){ + //Empty inner_xml + $inner_xml =''; + //Attempt to hide none useful feilds (disable by setting second param to false) if($hideInternal) if($node->getAttribute('Type') == 'Lookup' || $node->getAttribute('Type') == 'Computed' || $node->getAttribute('Hidden')=='TRUE') {continue;} + //Get Attributes foreach($node->attributes as $attribute => $value){ $results[$counter][strtolower($attribute)] = $node->getAttribute($attribute);
Fix bug where readListMeta wasn't emptying $inner_xml results.
thybag_PHP-SharePoint-Lists-API
train
php
44e39acdad7f5220e2a07c1d560c5eb6c8a34940
diff --git a/classes/bors/forms/input.php b/classes/bors/forms/input.php index <HASH>..<HASH> 100644 --- a/classes/bors/forms/input.php +++ b/classes/bors/forms/input.php @@ -101,7 +101,7 @@ class bors_forms_input extends bors_forms_element if($has_versioning || $previous) $element_html .= "<br/><small>".ec("Предыдущее значение: ").$previous."</small>\n"; - if(defval($params, 'raw')) + if(defval($params, 'raw') || !$this->label()) return $element_html; $element_tpl = $form->templater()->get('form_element_html');
If label in form element not defined — this raw html.
Balancer_bors-core
train
php
0c95e16033a73510d8939152908ecc755f5463ad
diff --git a/lib/form.js b/lib/form.js index <HASH>..<HASH> 100644 --- a/lib/form.js +++ b/lib/form.js @@ -85,6 +85,9 @@ class Form { if (controller.isRetry()) { nextQuery.text = controller._retry; } + if (queryObj && typeof queryObj.choices === "function") { + queryObj.choices = queryObj.choices.call(controller); + } session.query = nextQuery.name; return done(null, session, nextQuery); });
Allow query.choices to be a function
forfuturellc_mau
train
js
e5b861b0c6957b859c5ab1c56dc31e3c6d59fd53
diff --git a/src/main/java/org/cactoos/proc/BiProcNoNulls.java b/src/main/java/org/cactoos/proc/BiProcNoNulls.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/cactoos/proc/BiProcNoNulls.java +++ b/src/main/java/org/cactoos/proc/BiProcNoNulls.java @@ -36,13 +36,13 @@ public final class BiProcNoNulls<X, Y> implements BiProc<X, Y> { /** * The proc. */ - private final BiProc<X, Y> origin; + private final BiProc<? super X, ? super Y> origin; /** * Ctor. * @param proc The function */ - public BiProcNoNulls(final BiProc<X, Y> proc) { + public BiProcNoNulls(final BiProc<? super X, ? super Y> proc) { this.origin = proc; }
(#<I>) Use `? super X` param type for BiProcNoNulls
yegor256_cactoos
train
java
af0bf453b24356b7f5bea251ce1f467f2f961427
diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index <HASH>..<HASH> 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -7,6 +7,13 @@ if(typeof(jQuery) != 'undefined') { $(document).ready(function() { window.onresize(true); }); + + //Turn off autocomplete to fix the access tab randomly switching radio buttons in Firefox when refresh the page + // with an anchor tag in the URL. E.g: /admin#Root_Access + //Autocomplete in the CMS also causes strangeness in other browsers, so this turns it off for all browsers. + //see the following for demo and explanation of the Firefox bug: + // http://www.ryancramer.com/journal/entries/radio_buttons_firefox/ + $("#Form_EditForm").attr("autocomplete", "off"); })(jQuery); }
BUGFIX: fixing random changing of access tab radio buttons when refreshing the CMS with a URL such as /admin#Root_Access in Firefox.
silverstripe_silverstripe-siteconfig
train
js
8242b4dfb57e8372875e9c7f770ed9eeeabf4333
diff --git a/unrouted_handler.go b/unrouted_handler.go index <HASH>..<HASH> 100644 --- a/unrouted_handler.go +++ b/unrouted_handler.go @@ -815,6 +815,13 @@ func (handler *UnroutedHandler) sendError(w http.ResponseWriter, r *http.Request err = errors.New("read tcp: i/o timeout") } + // Errors for connnection resets also contain TCP details, we don't need, e.g: + // read tcp 127.0.0.1:1080->127.0.0.1:10023: read: connection reset by peer + // Therefore, we also trim those down. + if strings.HasSuffix(err.Error(), "read: connection reset by peer") { + err = errors.New("read tcp: connection reset by peer") + } + statusErr, ok := err.(HTTPError) if !ok { statusErr = NewHTTPError(err, http.StatusInternalServerError)
core: Remove TCP details from connection reset message
tus_tusd
train
go
c6efb98eb4cbc4b7ceb992d2dd7a0c16a8dc4340
diff --git a/server/config.js b/server/config.js index <HASH>..<HASH> 100644 --- a/server/config.js +++ b/server/config.js @@ -2,7 +2,7 @@ exports.config = { protocol: 'http', host: 'local.dev', defaultUserName: 'me', - port: 9000, + port: 80, initialTokens: { '4eb4b398c36e62da87469133e2f0cb3f9574d5b3865051': [':rw'] }
set example server's default port to <I> (again)
remotestorage_remotestorage.js
train
js
eecac459b9ed0a5636ba66229b85813151409213
diff --git a/src/Extractors/PhpArray.php b/src/Extractors/PhpArray.php index <HASH>..<HASH> 100644 --- a/src/Extractors/PhpArray.php +++ b/src/Extractors/PhpArray.php @@ -19,7 +19,7 @@ class PhpArray extends Extractor implements ExtractorInterface public static function fromFile($file, Translations $translations, array $options = []) { foreach (static::getFiles($file) as $file) { - self::fromArray(include($file), $translations); + static::fromArray(include($file), $translations); } }
Use late static binding in `Extractors\PhpArray` This avoids extending classes unexpectedly breaking.
oscarotero_Gettext
train
php
8a2981746b7083bc60d75f4a4b9374936fffd50e
diff --git a/client/head-manager.js b/client/head-manager.js index <HASH>..<HASH> 100644 --- a/client/head-manager.js +++ b/client/head-manager.js @@ -3,7 +3,7 @@ import HTMLDOMPropertyConfig from 'react-dom/lib/HTMLDOMPropertyConfig' const DEFAULT_TITLE = '' export default class HeadManager { - constuctor () { + constructor () { this.requestId = null }
Fix constructor declaration in HeadManager (#<I>)
zeit_next.js
train
js
333d40a06e1faf4d74c42a036324bda2dd9f8a2d
diff --git a/lib/conjure/provision/docker_image.rb b/lib/conjure/provision/docker_image.rb index <HASH>..<HASH> 100644 --- a/lib/conjure/provision/docker_image.rb +++ b/lib/conjure/provision/docker_image.rb @@ -3,14 +3,15 @@ module Conjure class DockerImage attr_reader :image_name - def initialize(base_image_name) + def initialize(server, base_image_name) + @server = server @image_name = base_image_name end def start(shell_command, options = {}) - container_id = `docker run -d #{options[:run_options].to_s} #{image_name} #{shell_command}`.strip + container_id = @server.run("docker run -d #{options[:run_options].to_s} #{image_name} #{shell_command}").strip sleep 2 - ip_address = `docker inspect -format '{{ .NetworkSettings.IPAddress }}' #{container_id}`.strip + ip_address = @server.run("docker inspect -format '{{ .NetworkSettings.IPAddress }}' #{container_id}").strip raise "Container failed to start" unless ip_address.present? ip_address end
Support remote server operation in Provision::DockerImage
brianauton_conjure
train
rb
dbab9ab4fb86309ae812ea65c59bfb81ff08e02a
diff --git a/cmd/tar-split/asm.go b/cmd/tar-split/asm.go index <HASH>..<HASH> 100644 --- a/cmd/tar-split/asm.go +++ b/cmd/tar-split/asm.go @@ -37,6 +37,12 @@ func CommandAsm(c *cli.Context) { outputStream = fh } + if c.Bool("compress") { + zipper := gzip.NewWriter(outputStream) + defer zipper.Close() + outputStream = zipper + } + // Get the tar metadata reader mf, err := os.Open(c.String("input")) if err != nil { diff --git a/cmd/tar-split/main.go b/cmd/tar-split/main.go index <HASH>..<HASH> 100644 --- a/cmd/tar-split/main.go +++ b/cmd/tar-split/main.go @@ -69,6 +69,11 @@ func main() { Value: "", Usage: "relative path of extracted tar", }, + cli.BoolFlag{ + Name: "compress", + Usage: "gzip compress the output", + // defaults to false + }, }, }, {
Add --compress flag to tar-split asm The Go implementation of gzip is the only known to produce compressed layers with the expected digest hashes. This change allows compressed tar layer files to be produced, which is useful for exporting layers from non-Go tools.
vbatts_tar-split
train
go,go
61f38d52c07420413c48385b942b7eb5019ff023
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java index <HASH>..<HASH> 100644 --- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java +++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java @@ -207,11 +207,6 @@ public class DefaultPlan extends ValidatingConfig<StandaloneCatalog> implements return this; } - protected DefaultPlan setPlansAllowedInBundle(final int plansAllowedInBundle) { - this.plansAllowedInBundle = plansAllowedInBundle; - return this; - } - protected DefaultPlan setFinalPhase(final DefaultPlanPhase finalPhase) { this.finalPhase = finalPhase; return this;
catalog: remove duplicate method in DefaultPlan No need for both methods taking Integer and int, just rely on autoboxing. This was confusing Jackson during serialization. This is part of <URL>
killbill_killbill
train
java
7145888e0c79ffbacb560b5ad913ea453cedb16f
diff --git a/lib/plugins/inspect.js b/lib/plugins/inspect.js index <HASH>..<HASH> 100644 --- a/lib/plugins/inspect.js +++ b/lib/plugins/inspect.js @@ -6,8 +6,8 @@ var gutil = require('gulp-util'); var through = require('through2'); -var utils = require('../utils'); var _ = require('lodash'); +var utils = require('../utils'); module.exports = function inspect(options) { var opts = _.extend({}, this.options, options); @@ -16,9 +16,10 @@ module.exports = function inspect(options) { options = options || {}; return through.obj(function (file, encoding, cb) { - if (opts.debug) { - console.log('[debug-plugin]:', utils.debug(file)); + if (opts.inspect) { + console.log('inspect plugin: ', utils.inspect(file)); } + this.push(file); cb(); });
change `debug` plugin to `inspect` to avoid conflict with glob
assemble_assemble
train
js
1314f50d69a1bdb1cfcfaa8f5059ca899bd04cd9
diff --git a/blockstack_resolver/server/resolver.py b/blockstack_resolver/server/resolver.py index <HASH>..<HASH> 100755 --- a/blockstack_resolver/server/resolver.py +++ b/blockstack_resolver/server/resolver.py @@ -49,10 +49,6 @@ mc = pylibmc.Client(MEMCACHED_SERVERS, binary=True, "connect_timeout": 500}) -dht_client = Proxy(DHT_MIRROR, DHT_MIRROR_PORT) -blockstore_client = Proxy(BLOCKSTORED_SERVER, BLOCKSTORED_PORT) - - def username_is_valid(username): regrex = re.compile('^[a-z0-9_]{1,60}$') @@ -122,6 +118,7 @@ def get_user_profile(username, refresh=False): username = username.lower() + blockstore_client = Proxy(BLOCKSTORED_SERVER, BLOCKSTORED_PORT) resp = blockstore_client.lookup(username + ".id") resp = resp[0] @@ -139,6 +136,7 @@ def get_user_profile(username, refresh=False): info = {} + dht_client = Proxy(DHT_MIRROR, DHT_MIRROR_PORT) dht_resp = dht_client.get(profile_hash) dht_resp = dht_resp[0] profile = json.loads(dht_resp['value'])
don't share Proxy() connection across calls
blockstack_blockstack-core
train
py
fa5066c073c6b0e62fe77b22a8c50574cc3fe57e
diff --git a/cmd/kops/create_cluster.go b/cmd/kops/create_cluster.go index <HASH>..<HASH> 100644 --- a/cmd/kops/create_cluster.go +++ b/cmd/kops/create_cluster.go @@ -548,11 +548,13 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e bastionGroup := &api.InstanceGroup{} bastionGroup.Spec.Role = api.InstanceGroupRoleBastion bastionGroup.ObjectMeta.Name = "bastions" + bastionGroup.Spec.Image = c.Image instanceGroups = append(instanceGroups, bastionGroup) cluster.Spec.Topology.Bastion = &api.BastionSpec{ BastionPublicName: "bastion." + clusterName, } + } default:
Set bastion image when creating cluster Fix #<I>
kubernetes_kops
train
go
eff2d50141698627d4c2d60b031483d1909db6f4
diff --git a/lib/cexio.rb b/lib/cexio.rb index <HASH>..<HASH> 100644 --- a/lib/cexio.rb +++ b/lib/cexio.rb @@ -66,6 +66,26 @@ module CEX def place_order(ptype = 'buy', amount = 1, price =1, couple = 'GHS/BTC') self.api_call('place_order', {:type => ptype, :amount => amount.to_s, :price => price.to_s}, true, couple) end + + def archived_orders(couple = 'GHS/BTC', options = {}) + self.api_call('archived_orders', options, true, couple) + end + + def get_order(order_id) + self.api_call('get_order', {:id => order_id.to_s}, true, '',true) + end + + def get_order_tx(order_id) + self.api_call('get_order_tx', {:id => order_id.to_s}, true, '',true) + end + + def get_address(currency) + self.api_call('get_address', {:currency => currency}, true, '',true) + end + + def get_my_fee + self.api_call('my_fee', {}, true, '',true) + end def hashrate self.api_call('ghash.io', {}, true, 'hashrate')
archived_orders, get_order, get_order_tx, get_address, get_my_fee commands added
t0pep0_cex.io-api-ruby
train
rb