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 |
|---|---|---|---|---|---|
3cd0b7c65f3d3da69a48cba00d660f5f07dede92 | diff --git a/components/elation/elation.php b/components/elation/elation.php
index <HASH>..<HASH> 100644
--- a/components/elation/elation.php
+++ b/components/elation/elation.php
@@ -42,7 +42,7 @@ class Component_elation extends Component {
$diff_curr = array_diff_assoc_recursive($args["settings"], $this->root->cfg->FlattenConfig($this->root->cfg->servers));
$vars["tfdev"]["serveroverrides"] = $diff_orig;
- setcookie("tf-dev", json_encode($vars["tfdev"]), 0, "/");
+ setcookie("tf-dev", json_encode($vars["tfdev"]), time() + 86400*365, "/"); // dev cookie persists for a year
if (!empty($diff_curr)) {
foreach ($diff_curr as $setting=>$value) { | - Persistent dev cookie (why hasn't anyone complained about this?) | jbaicoianu_elation | train | php |
ad54e3f280e1feee87abaaaaea4c06ec264a57e8 | diff --git a/src/data-tier.js b/src/data-tier.js
index <HASH>..<HASH> 100644
--- a/src/data-tier.js
+++ b/src/data-tier.js
@@ -570,7 +570,7 @@
rulesService.add('tieText', 'textContent');
rulesService.add('tiePlaceholder', 'placeholder');
rulesService.add('tieTooltip', 'title');
- rulesService.add('tieImage', 'scr');
+ rulesService.add('tieImage', 'src');
rulesService.add('tieDateValue', {
dataToView: function (view, tieValue) {
view.value = tieValue.data.toLocaleString(); | fixing the default rule param of the image element | gullerya_data-tier | train | js |
68d48c96658ab5f724bc0cd47d9462670a5f39a9 | diff --git a/src/Model.php b/src/Model.php
index <HASH>..<HASH> 100644
--- a/src/Model.php
+++ b/src/Model.php
@@ -387,13 +387,13 @@ abstract class Model
*/
protected function updateForeign($column, $value)
{
- static::testForeign($column);
- $foreign = static::FOREIGN_KEYS[$column][1];
+ $foreign = $this->getForeign($column);
+ $foreign_column = static::FOREIGN_KEYS[$column][1];
if ($value === null) {
- /** @todo reset foreign model */
+ $foreign->reset();
return;
}
- if (!$this->foreign[$column]->load([$foreign => $value])) {
+ if (!$foreign->load([$foreign_column => $value])) {
throw new ForeignConstraintException(static::class, $column);
}
} | Update Model::updateForeign()
It now handles setting foreign columns to null.
Notice: PHP (and many other languages) implements
member visibility at class level, not at object level. | aryelgois_Medools | train | php |
536daae7c845d1bb552aa0bb954796b1cab6b1d0 | diff --git a/tests/Charcoal/App/Action/AbstractActionTest.php b/tests/Charcoal/App/Action/AbstractActionTest.php
index <HASH>..<HASH> 100644
--- a/tests/Charcoal/App/Action/AbstractActionTest.php
+++ b/tests/Charcoal/App/Action/AbstractActionTest.php
@@ -26,13 +26,13 @@ class AbstractActionTest extends \PHPUnit_Framework_TestCase
public function testSetLang()
{
- $this->assertNull($this->obj->lang());
- $ret = $this->obj->set_lang('fr');
+ $this->assertNull($this->obj->language());
+ $ret = $this->obj->set_language('fr');
$this->assertSame($ret, $this->obj);
- $this->assertEquals('fr', $this->obj->lang());
+ $this->assertEquals('fr', $this->obj->language());
$this->setExpectedException('\InvalidArgumentException');
- $this->obj->set_lang(false);
+ $this->obj->set_language(false);
}
public function testSetMode() | Amend 3b3d<I>: Fixed test to be aware of LanguageAwareInterface. | locomotivemtl_charcoal-app | train | php |
18ea37e172c251172aaf0317eb1840d15e135403 | diff --git a/cf/app_files/app_files_test.go b/cf/app_files/app_files_test.go
index <HASH>..<HASH> 100644
--- a/cf/app_files/app_files_test.go
+++ b/cf/app_files/app_files_test.go
@@ -4,7 +4,7 @@ import (
"os"
"path/filepath"
- . "github.com/cloudfoundry/cli/cf/app_files"
+ "github.com/cloudfoundry/cli/cf/app_files"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cloudfoundry/gofileutils/fileutils"
@@ -14,8 +14,13 @@ import (
)
var _ = Describe("AppFiles", func() {
- var appFiles = ApplicationFiles{}
- fixturePath := filepath.Join("..", "..", "fixtures", "applications")
+ var appFiles app_files.ApplicationFiles
+ var fixturePath string
+
+ BeforeEach(func() {
+ appFiles = app_files.ApplicationFiles{}
+ fixturePath = filepath.Join("..", "..", "fixtures", "applications")
+ })
Describe("AppFilesInDir", func() {
It("all files have '/' path separators", func() { | Don't dot import app_files in test | cloudfoundry_cli | train | go |
118f92e33cfd0ee25883c9a173926393cc84b329 | diff --git a/js/impress.js b/js/impress.js
index <HASH>..<HASH> 100644
--- a/js/impress.js
+++ b/js/impress.js
@@ -192,15 +192,16 @@
// EVENTS
document.addEventListener("keydown", function ( event ) {
- if( event.keyCode == 32 || (event.keyCode >= 37 && event.keyCode <= 40) ) {
- var next = null;
+ if ( event.keyCode == 9 || event.keyCode == 32 || (event.keyCode >= 37 && event.keyCode <= 40) ) {
var active = $(".step.active", impress);
+ var next = active;
switch( event.keyCode ) {
case 37: ; // left
case 38: // up
next = steps.indexOf( active ) - 1;
next = next >= 0 ? steps[ next ] : steps[ steps.length-1 ];
- break;
+ break;
+ case 9: ; // tab
case 32: ; // space
case 39: ; // right
case 40: // down | tab key can now also be used to move to next presentation step (to prevent default focus behavior that breaks zoom), impressive, isn't it? | impress_impress.js | train | js |
dfff626ca798cce2585c7818e828b16d3080284e | diff --git a/core/scheduler/chore.go b/core/scheduler/chore.go
index <HASH>..<HASH> 100644
--- a/core/scheduler/chore.go
+++ b/core/scheduler/chore.go
@@ -151,7 +151,7 @@ func (w *Worker) Execute(chore Chore) {
}
if v.Key == "" {
- panic(fmt.Errorf("no restore key detected in %s operation output", chore, task.Op))
+ panic(fmt.Errorf("%s: no restore key detected in %s operation output", chore, task.Op))
}
if v.Compression == "" { | Fix go warnings about missing Errorf() positionals | starkandwayne_shield | train | go |
b3a9459de226cbfdd84ca123f1e55de115572b0d | diff --git a/go/vt/topo/consultopo/election.go b/go/vt/topo/consultopo/election.go
index <HASH>..<HASH> 100644
--- a/go/vt/topo/consultopo/election.go
+++ b/go/vt/topo/consultopo/election.go
@@ -94,8 +94,11 @@ func (mp *consulMasterParticipation) WaitForMastership() (context.Context, error
go func() {
select {
case <-lost:
- // We lost the lock, nothing to do but lockCancel().
lockCancel()
+ // We could have lost the lock. Per consul API, explicitly call Unlock to make sure that session will not be renewed.
+ if err := l.Unlock(); err != nil {
+ log.Errorf("master election(%v) Unlock failed: %v", mp.name, err)
+ }
case <-mp.stop:
// Stop was called. We stop the context first,
// so the running process is not thinking it | Calls Unlock explicitly after potetiantly losing it | vitessio_vitess | train | go |
8f2e1d06943907f13cc9fd0850c12ae79adc37b9 | diff --git a/src/Api.php b/src/Api.php
index <HASH>..<HASH> 100644
--- a/src/Api.php
+++ b/src/Api.php
@@ -46,7 +46,20 @@ Class Api {
* Convert an array to a defined format
*/
protected function format($data) {
- $result = Formatter::make($data, 'array');
+ $result = NULL;
+
+ if(is_array($data)){
+ $result = Formatter::make($data, 'array');
+ }
+
+ if(is_object($data)){
+ $result = Formatter::make($data, 'object');
+ }
+
+ if(is_null($result)) {
+ $result = Formatter::make(array($data), 'array');
+ }
+
return call_user_func(array($result, 'to' . ucfirst($this->format)));
}
@@ -61,11 +74,15 @@ Class Api {
* Retrieve the format parameter and override the default format
*/
protected function determineFormat(){
+ $format = NULL;
+
// Get the current route
$route = Route::getCurrentRoute();
- // Get the format parameter
- $format = $route->getParameter('format');
+ if($route){
+ // Get the format parameter
+ $format = $route->getParameter('format');
+ }
// Check if it's a valid format
if(in_array($format, $this->valid_format)){ | Improve determine format, to handle correctly the response | DevFactoryCH_api | train | php |
3d2e370ab94e2ae59a85c2753a6bc8d8374a2bca | diff --git a/lib/mollie/payment.rb b/lib/mollie/payment.rb
index <HASH>..<HASH> 100644
--- a/lib/mollie/payment.rb
+++ b/lib/mollie/payment.rb
@@ -25,6 +25,7 @@ module Mollie
:failed_at,
:amount,
:amount_captured,
+ :amount_charged_back,
:amount_refunded,
:amount_remaining,
:description,
@@ -171,6 +172,10 @@ module Mollie
@amount_captured = Mollie::Amount.new(amount_captured)
end
+ def amount_charged_back=(amount_charged_back)
+ @amount_charged_back = Mollie::Amount.new(amount_charged_back)
+ end
+
def amount_remaining=(amount_remaining)
@amount_remaining = Mollie::Amount.new(amount_remaining)
end | Payment: add `amount_charged_back` attribute | mollie_mollie-api-ruby | train | rb |
249cace0341f7510d7788d721fc49b77efc26170 | diff --git a/lib/Controller/MVCGrid.php b/lib/Controller/MVCGrid.php
index <HASH>..<HASH> 100644
--- a/lib/Controller/MVCGrid.php
+++ b/lib/Controller/MVCGrid.php
@@ -79,7 +79,7 @@ class Controller_MVCGrid extends AbstractController
$field_name = $field->short_name;
- if ($field instanceof Model_Field_Reference) {
+ if ($field instanceof Field_Reference) {
$field_name = $field->getDereferenced();
} | fix bug in Controller_MVCGrid | atk4_atk4 | train | php |
55a9044dda564e535ecbf0d7a7857cd564afc992 | diff --git a/lib/app.js b/lib/app.js
index <HASH>..<HASH> 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -23,6 +23,14 @@ app.templates = {};
app.PRODUCTION = 'production';
app.DEVELOPMENT = 'development';
+// Set the NODE_ENV variable as this is used by Express, we want the
+// environment to take precedence but allow it to be set using the config file
+// too.
+if (process.env.NODE_ENV) {
+ options.env = process.env.NODE_ENV;
+}
+process.env.NODE_ENV = options.env;
+
// Sort out the port.
(function (url) {
var port = ''; //process.env.PORT; | Set NODE_ENV from the config file unless already defined | jsbin_jsbin | train | js |
b724da3e2a146a5cba2d292ab13d601e101808d9 | diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
index <HASH>..<HASH> 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java
@@ -52,6 +52,7 @@ public class GremlinProcessRunner extends BlockJUnit4ClassRunner {
} catch (Throwable e) {
if (isComputerVerificationException(e)) {
eachNotifier.fireTestIgnored();
+ System.err.println(e.getMessage());
ignored = true;
} else
eachNotifier.addFailure(e); | added a System.err message for tests that are ignored due to ComputerVerificationException | apache_tinkerpop | train | java |
0fb9ac9dc6fac335a6801110854e688652f14800 | diff --git a/angr/analyses/ddg.py b/angr/analyses/ddg.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/ddg.py
+++ b/angr/analyses/ddg.py
@@ -1561,12 +1561,23 @@ class DDG(Analysis):
return []
consumers = []
- out_edges = graph.out_edges(var_def, data=True)
- for _, dst, data in out_edges:
- if 'type' in data and data['type'] == 'kill':
- # skip killing edges
- continue
- consumers.append(dst)
+ srcs = [var_def]
+ traversed = set()
+
+ while srcs:
+ src = srcs.pop()
+ out_edges = graph.out_edges(src, data=True)
+ for _, dst, data in out_edges:
+ if 'type' in data and data['type'] == 'kill':
+ # skip killing edges
+ continue
+ if isinstance(dst.variable, SimTemporaryVariable):
+ if dst not in traversed:
+ srcs.append(dst)
+ traversed.add(dst)
+ else:
+ if dst not in consumers:
+ consumers.append(dst)
return consumers | DDG: Handling tmp chaining like in find_sources (#<I>) | angr_angr | train | py |
f7ff483291579679a2128c9508b785494a45f73a | diff --git a/mautrix/client/syncer.py b/mautrix/client/syncer.py
index <HASH>..<HASH> 100644
--- a/mautrix/client/syncer.py
+++ b/mautrix/client/syncer.py
@@ -403,7 +403,8 @@ class Syncer(ABC):
raise
except Exception as e:
self.log.warning(
- f"Sync request errored: {e}, waiting {fail_sleep} seconds before continuing"
+ f"Sync request errored: {type(e).__name__}: {e}, waiting {fail_sleep}"
+ " seconds before continuing"
)
await self.run_internal_event(
InternalEventType.SYNC_ERRORED, error=e, sleep_for=fail_sleep | Include error type in sync error log | tulir_mautrix-python | train | py |
b5da30415c8e8e2d566f3120c589648a3614db2a | diff --git a/lib/rom/compat/schema/dsl.rb b/lib/rom/compat/schema/dsl.rb
index <HASH>..<HASH> 100644
--- a/lib/rom/compat/schema/dsl.rb
+++ b/lib/rom/compat/schema/dsl.rb
@@ -50,7 +50,7 @@ module ROM
# @!attribute [r] definition
# @return [Class] An optional block that will be evaluated as part of this DSL
- option :definition, type: Types.Instance(Proc), default: -> { Proc.new {} }
+ option :definition, type: Types.Instance(Proc), default: -> { proc {} }
# @!attribute [r] plugins
# @return [Array<Plugin>] | [rubocop] address Style/Proc | rom-rb_rom | train | rb |
c9752b076ed53795c463108b9622ad742700d608 | diff --git a/lib/deployml/utils.rb b/lib/deployml/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/deployml/utils.rb
+++ b/lib/deployml/utils.rb
@@ -148,16 +148,7 @@ module DeploYML
# Additional arguments to pass to the rake task.
#
def remote_task(name,*args)
- name = name.to_s
-
- unless args.empty?
- name << ('[' + args.join(',') + ']')
- end
-
- options = [name]
- options << '--trace' if config.debug
-
- remote_ssh('rake',*options)
+ remote_sh { |shell| shell.rake(name,*args) }
end
# | Have remote_task call remote_sh with a block. | postmodern_deployml | train | rb |
f9cfe39ea5b321e99bd48ebcdaebd438716b2534 | diff --git a/lib/rubocop/cop/registry.rb b/lib/rubocop/cop/registry.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/cop/registry.rb
+++ b/lib/rubocop/cop/registry.rb
@@ -22,6 +22,8 @@ module RuboCop
# Registry that tracks all cops by their badge and department.
class Registry
+ include Enumerable
+
def initialize(cops = [], options = {})
@registry = {}
@departments = {} | [Fix #<I>] Make Registry enumerable (#<I>) | rubocop-hq_rubocop | train | rb |
685b3e3ddf283b7dac8102af82ac26585edb4152 | diff --git a/js/bitfinex.js b/js/bitfinex.js
index <HASH>..<HASH> 100644
--- a/js/bitfinex.js
+++ b/js/bitfinex.js
@@ -263,9 +263,10 @@ module.exports = class bitfinex extends Exchange {
'baseId': baseId,
'quoteId': quoteId,
'active': true,
- 'info': market,
'precision': precision,
'limits': limits,
+ 'lot': Math.pow (10, -precision['amount']),
+ 'info': market,
}));
}
return result; | bitfinex: markets: lots added | ccxt_ccxt | train | js |
b50e7d3f4cf2688b954fadf9e864abfde9919e2b | diff --git a/lib/thinking_sphinx/search/context.rb b/lib/thinking_sphinx/search/context.rb
index <HASH>..<HASH> 100644
--- a/lib/thinking_sphinx/search/context.rb
+++ b/lib/thinking_sphinx/search/context.rb
@@ -6,7 +6,7 @@ class ThinkingSphinx::Search::Context
@configuration = configuration || ThinkingSphinx::Configuration.instance
@memory = {
:results => [],
- :panes => ThinkingSphinx::Configuration::Defaults::PANES
+ :panes => ThinkingSphinx::Configuration::Defaults::PANES.clone
}
end | Don't modify default pane collection - always copy. | pat_thinking-sphinx | train | rb |
6a9f13e78095b512f9b9381a0365a97b0b5cf123 | diff --git a/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterTest.java b/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterTest.java
index <HASH>..<HASH> 100644
--- a/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterTest.java
+++ b/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterTest.java
@@ -140,6 +140,10 @@ class ClusterTest
final TestNode leader = cluster.awaitLeader();
+ TestCluster.awaitElectionClosed(leader);
+ TestCluster.awaitElectionClosed(cluster.followers().get(0));
+ TestCluster.awaitElectionClosed(cluster.followers().get(1));
+
cluster.terminationsExpected(true);
cluster.connectClient();
cluster.sendTerminateMessage(); | [Java] Wait for election to close before shutting down nodes in test. | real-logic_aeron | train | java |
518ba4cc2a3487f509d717ac952a8557cf31a75d | diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb
index <HASH>..<HASH> 100644
--- a/lib/haml/exec.rb
+++ b/lib/haml/exec.rb
@@ -1,5 +1,6 @@
require 'optparse'
require 'fileutils'
+require 'rbconfig'
module Haml
# This module handles the various Haml executables (`haml`, `sass`, `css2sass`, etc).
@@ -67,6 +68,12 @@ module Haml
@options[:trace] = true
end
+ if RbConfig::CONFIG['host_os'] =~ /mswin|windows/i
+ opts.on('--unix-newlines', 'Use Unix-style newlines in written files.') do
+ @options[:unix_newlines] = true
+ end
+ end
+
opts.on_tail("-?", "-h", "--help", "Show this message") do
puts opts
exit
@@ -105,6 +112,7 @@ module Haml
def open_file(filename, flag = 'r')
return if filename.nil?
+ flag = 'wb' if @options[:unix_newlines] && flag == 'w'
File.open(filename, flag)
end
end | Add a command-line option for writing files in binary mode on Windows. | sass_ruby-sass | train | rb |
d5131ef4bbbb118662477c3f28f68c648a16124a | diff --git a/lib/core.js b/lib/core.js
index <HASH>..<HASH> 100644
--- a/lib/core.js
+++ b/lib/core.js
@@ -12,6 +12,8 @@ var util = require('./util');
var inherits = require('util').inherits;
var Transform = require('readable-stream').Transform;
+var win32 = process.platform === 'win32';
+
var Archiver = module.exports = function(format, options) {
if (!(this instanceof Archiver)) {
return new Archiver(format, options);
@@ -196,11 +198,16 @@ Archiver.prototype._normalizeEntryData = function(data, stats) {
}
}
- // 511 === 0777; 493 === 0755; 420 === 0644
+ // 511 === 0777; 493 === 0755; 438 === 0666; 420 === 0644
if (typeof data.mode === 'number') {
data.mode &= 511;
} else if (data.stats && data.mode === null) {
data.mode = data.stats.mode & 511;
+
+ // stat isn't reliable on windows; force 0755 for dir
+ if (win32 && isDir) {
+ data.mode = 493;
+ }
} else if (data.mode === null) {
data.mode = isDir ? 493 : 420;
} | stat isn't reliable on windows; force <I> for directories when sourced from stats. closes #<I> #<I>. props @Tim-B. | archiverjs_node-archiver | train | js |
49875e14d7eb5fdb74168c48794906730898dd02 | diff --git a/Kwf_js/EyeCandy/List/Plugins/ActiveListener/LargeContentAjax.js b/Kwf_js/EyeCandy/List/Plugins/ActiveListener/LargeContentAjax.js
index <HASH>..<HASH> 100644
--- a/Kwf_js/EyeCandy/List/Plugins/ActiveListener/LargeContentAjax.js
+++ b/Kwf_js/EyeCandy/List/Plugins/ActiveListener/LargeContentAjax.js
@@ -110,6 +110,8 @@ Kwf.EyeCandy.List.Plugins.ActiveListener.LargeContentAjax = Ext.extend(Kwf.EyeCa
activeEl.dom.style.zIndex = 1;
nextEl.dom.style.zIndex = 2;
+ activeEl.stopFx();
+ nextEl.stopFx();
nextEl.fadeIn(Ext.applyIf({
useDisplay: true,
callback: function() { | stopFx before animating, improves behaviour when clicking fast | koala-framework_koala-framework | train | js |
4498f93e68bfdc0a02285f683b0c7cdc016f5898 | diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -1234,4 +1234,23 @@ class RelationTest < ActiveRecord::TestCase
scope = Post.order('foo(comments.body)')
assert_equal [], scope.references_values
end
+
+ def test_presence
+ topics = Topic.scoped
+
+ assert_queries(1) do
+ #checking if there are topics is used before you actually display them,
+ #thus it shouldn't invoke an extra count query
+ assert topics.present?
+ assert !topics.blank?
+
+ #shows count of topics and loops after loading the query should not trigger extra queries either
+ assert_no_queries topics.size
+ assert_no_queries topics.count
+ assert_no_queries topics.length
+ assert_no_queries topics.each
+ end
+
+ assert topics.loaded?
+ end
end | tests for Relation .present? and .blank? are check cases and shouldn't force sql-count | rails_rails | train | rb |
c4200e199b39bf521f32a04615edfa801a7221e6 | diff --git a/src/module-elasticsuite-core/Api/Search/Request/Container/FilterInterface.php b/src/module-elasticsuite-core/Api/Search/Request/Container/FilterInterface.php
index <HASH>..<HASH> 100644
--- a/src/module-elasticsuite-core/Api/Search/Request/Container/FilterInterface.php
+++ b/src/module-elasticsuite-core/Api/Search/Request/Container/FilterInterface.php
@@ -24,11 +24,11 @@ namespace Smile\ElasticsuiteCore\Api\Search\Request\Container;
interface FilterInterface
{
/**
- * Get filter query according to current search context.
+ * Get filter query according to current search context. Return null to unset filter query.
*
* @param \Smile\ElasticsuiteCore\Api\Search\ContextInterface $searchContext Search Context
*
- * @return \Smile\ElasticsuiteCore\Search\Request\QueryInterface
+ * @return \Smile\ElasticsuiteCore\Search\Request\QueryInterface|null
*/
public function getFilterQuery(\Smile\ElasticsuiteCore\Api\Search\ContextInterface $searchContext);
} | Extend the doc block to explain the possibility to return null to unset filter
Basically an extension due to the discussion in #<I>. Since one does not
need to return a \Smile\ElasticsuiteCore\Search\Request\QueryInterface the
doc block comment should indicate that. | Smile-SA_elasticsuite | train | php |
0bed4b0da15dd277be6d5fa7b7c76275bd697f47 | diff --git a/androguard/decompiler/dad/decompile.py b/androguard/decompiler/dad/decompile.py
index <HASH>..<HASH> 100644
--- a/androguard/decompiler/dad/decompile.py
+++ b/androguard/decompiler/dad/decompile.py
@@ -265,7 +265,10 @@ class DvClass(object):
def process(self, doAST=False):
for i in range(len(self.methods)):
- self.process_method(i, doAST=doAST)
+ try:
+ self.process_method(i, doAST=doAST)
+ except Exception as e:
+ logger.warning('Error decompiling method %s: %s', self.methods[i], e)
def get_ast(self):
fields = [get_field_ast(f) for f in self.fields] | add the handler back in, might cause trouble | androguard_androguard | train | py |
6f134e1fc18b079b35fb3a89118423d667723842 | diff --git a/lib/Bootstrapper.php b/lib/Bootstrapper.php
index <HASH>..<HASH> 100644
--- a/lib/Bootstrapper.php
+++ b/lib/Bootstrapper.php
@@ -45,9 +45,16 @@ class Bootstrapper {
* @return Watcher
*/
public function bootWatcher(array $options) {
- $this->bootServer($options);
- $watcherClass = $options['debug'] ? 'Aerys\DebugWatcher' : 'Aerys\WorkerWatcher';
- $watcher = $this->injector->make($watcherClass);
+ if ($options['debug']) {
+ // The debug watcher doesn't spawn any worker processes so we
+ // need to go ahead and boot up a running server now.
+ $this->bootServer($options);
+ $watcher = $this->injector->make('Aerys\DebugWatcher');
+ } else {
+ // Worker processes are in charge of booting up their own
+ // servers. DO NOT boot a server here or cthulu will be summoned.
+ $watcher = $this->injector->make('Aerys\WorkerWatcher');
+ }
return $watcher;
} | Don't bind sockets in the main process, you moron. | amphp_http-server | train | php |
76ef41806b2f7897d7dd0047a44382d5f4c38762 | diff --git a/core/src/main/java/org/testcontainers/utility/MountableFile.java b/core/src/main/java/org/testcontainers/utility/MountableFile.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/testcontainers/utility/MountableFile.java
+++ b/core/src/main/java/org/testcontainers/utility/MountableFile.java
@@ -183,8 +183,8 @@ public class MountableFile implements Transferable {
if (!entry.isDirectory()) {
// Create parent directories
- newFile.mkdirs();
- newFile.delete();
+ Path parent = newFile.getAbsoluteFile().toPath().getParent();
+ parent.toFile().mkdirs();
newFile.deleteOnExit();
try (InputStream is = jarFile.getInputStream(entry)) { | Stop creation of temporary directory prior to creating temporary file. (#<I>) | testcontainers_testcontainers-java | train | java |
66afc4885036a31d1645319178626221ea7eba82 | diff --git a/ExRouter.js b/ExRouter.js
index <HASH>..<HASH> 100644
--- a/ExRouter.js
+++ b/ExRouter.js
@@ -294,7 +294,7 @@ export default class ExRouter extends React.Component {
{header}
<ExNavigator ref="nav" initialRouteStack={router.stack.map(route => new ExRouteAdapter(router.routes[route]))}
style={styles.transparent}
- sceneStyle={{ paddingTop: 0 }}
+ sceneStyle={{ paddingTop: 0, backgroundColor:'transparent' }}
renderNavigationBar={props=><ExNavigationBar {...props} router={router}/>}
{...this.props}
/> | get rid off white flickering line that appears underneath router header
there is an open issue for that in RN <URL> | aksonov_react-native-router-flux | train | js |
ffac63045e3b470d8df8d6588aaa92197635f270 | diff --git a/lib/OpenLayers/Renderer/Canvas.js b/lib/OpenLayers/Renderer/Canvas.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Renderer/Canvas.js
+++ b/lib/OpenLayers/Renderer/Canvas.js
@@ -435,28 +435,6 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
},
/**
- * Method: setCanvasStyle
- * Prepare the canvas for drawing by setting various global settings.
- *
- * Parameters:
- * type - {String} one of 'stroke', 'fill', or 'reset'
- * style - {Object} Symbolizer hash
- */
- setCanvasStyle: function(type, style) {
- if (type === "fill") {
- this.canvas.globalAlpha = style['fillOpacity'];
- this.canvas.fillStyle = style['fillColor'];
- } else if (type === "stroke") {
- this.canvas.globalAlpha = style['strokeOpacity'];
- this.canvas.strokeStyle = style['strokeColor'];
- this.canvas.lineWidth = style['strokeWidth'];
- } else {
- this.canvas.globalAlpha = 0;
- this.canvas.lineWidth = 1;
- }
- },
-
- /**
* Method: featureIdToHex
* Convert a feature ID string into an RGB hex string.
* | Removing duplicate setCanvasStyle method.
Thanks @jorix for catching this (see #<I>). | openlayers_openlayers | train | js |
b0f36566b0dac148e3a04228901d6c5dafc047fd | diff --git a/test/lang.spec.js b/test/lang.spec.js
index <HASH>..<HASH> 100644
--- a/test/lang.spec.js
+++ b/test/lang.spec.js
@@ -47,6 +47,9 @@ describe('Lang Functions', () => {
expect(f.isBlank({})).to.be.true
})
it('should isBlankDeep', () => {
+ expect(f.isBlankDeep(_.every)(1)).to.be.false
+ expect(f.isBlankDeep(_.every)(false)).to.be.false
+ expect(f.isBlankDeep(_.every)('')).to.be.true
expect(f.isBlankDeep(_.every)({
a: 1,
b: 'as' | add isBlankDeep tests showing it works shallow | smartprocure_futil-js | train | js |
52a26ff90b046e2dadc2fb4110fb904e17523c13 | diff --git a/src/Network/Common/HttpClient.php b/src/Network/Common/HttpClient.php
index <HASH>..<HASH> 100644
--- a/src/Network/Common/HttpClient.php
+++ b/src/Network/Common/HttpClient.php
@@ -251,6 +251,7 @@ class HttpClient implements Async
}
$response = new Response($cli->statusCode, $cli->headers, $cli->body);
call_user_func($this->callback, $response);
+ $this->client->close();
}
public function whenHostNotFound($host) | add httpclient close when client::call receive response | youzan_zanphp | train | php |
86271f6ad01f1a8e5876f5c3372887c5be6bdb5a | diff --git a/src/client.js b/src/client.js
index <HASH>..<HASH> 100644
--- a/src/client.js
+++ b/src/client.js
@@ -72,10 +72,11 @@ Client.prototype.find = function(id) {
Client.prototype.connect = function(args) {
var client = this;
- var server = {
- host: args.host || "irc.freenode.org",
- port: args.port || 6667
- };
+ var server = _.defaults(_.pick(args, ['host', 'port', 'rejectUnauthorized']), {
+ host: "irc.freenode.org",
+ port: 6667,
+ rejectUnauthorized: true
+ });
var stream = args.tls ? tls.connect(server) : net.connect(server);
stream.on("error", function(e) {
@@ -86,6 +87,11 @@ Client.prototype.connect = function(args) {
var realname = args.realname || "Shout User";
var irc = slate(stream);
+
+ if (args.password) {
+ irc.pass(args.password);
+ }
+
irc.me = nick;
irc.nick(nick);
irc.user(nick, realname); | Add server password. Add rejectUnauthorized to disable SSL verification | erming_shout | train | js |
b1a1fc20e0d239b29fe51470ef5d6b537721deef | diff --git a/lib/Client.js b/lib/Client.js
index <HASH>..<HASH> 100644
--- a/lib/Client.js
+++ b/lib/Client.js
@@ -139,7 +139,8 @@ class Client extends events {
// collect topics that have subscriptions
const topics = Object.keys(topicSubscriptions).map(topicName => ({
topicName,
- lockDuration: topicSubscriptions[topicName].lockDuration
+ lockDuration: topicSubscriptions[topicName].lockDuration,
+ variables: topicSubscriptions[topicName].variables,
}));
const requestBody = { ...pollingOptions, topics }; | feat(client): Add variable subset to fetch&lock request
related to CAM-<I> | camunda_camunda-external-task-client-js | train | js |
f0378d4594cf57873cb9ba2a6209d18b58fdd246 | diff --git a/jetty-7-and-8/src/main/java/org/httpobjects/jetty/HttpObjectsJettyHandler.java b/jetty-7-and-8/src/main/java/org/httpobjects/jetty/HttpObjectsJettyHandler.java
index <HASH>..<HASH> 100644
--- a/jetty-7-and-8/src/main/java/org/httpobjects/jetty/HttpObjectsJettyHandler.java
+++ b/jetty-7-and-8/src/main/java/org/httpobjects/jetty/HttpObjectsJettyHandler.java
@@ -95,7 +95,7 @@ public class HttpObjectsJettyHandler extends org.eclipse.jetty.server.handler.Ab
return s;
} catch (Exception e) {
- throw new RuntimeException(e);
+ throw new RuntimeException("" + e.getMessage() + " (port = " + port + ")", e);
}
}
} | Include port in error message when unable to start server | cjdev_httpobjects | train | java |
948106051c3a7fed941b5306a8203351ed3f6e56 | diff --git a/pep8radius.py b/pep8radius.py
index <HASH>..<HASH> 100644
--- a/pep8radius.py
+++ b/pep8radius.py
@@ -222,7 +222,7 @@ def _split_comma_separated(string):
return set(filter(None, string.split(',')))
-class Radius:
+class Radius(object):
def __init__(self, rev=None, options=None):
# pep8radius specific options
@@ -417,6 +417,17 @@ class Radius:
else:
return self.merge_base(rev, current)
+ # abstract methods
+ # TODO something with these to appease landscape
+ # with_metaclass http://stackoverflow.com/a/18513858/1240268 ?
+ # six is a rather heavy dependency however
+ # def file_diff_cmd(self, file_name): pass
+ # def filenames_diff_cmd(self): pass
+ # def parse_diff_filenames(self, diff_files): pass
+ # def root_dir(self): pass
+ # def current_branch(self): pass
+ # def merge_base(self): pass
+
# ##### udiff parsing #####
# ############################# | CLN make Radius new style object | hayd_pep8radius | train | py |
2df367638543756eca6c0e7463a9f5544adf2a2d | diff --git a/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java b/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java
+++ b/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java
@@ -151,6 +151,7 @@ public class AdverbFilter extends RuleFilter {
put("predominantly", "predominant");
put("quietly", "quiet");
put("slightly", "slight");
+ put("cleverly", "clever");
// TODO: add more or maybe use https://github.com/simplenlg/simplenlg?
//put("", ""); | [en] add adverb | languagetool-org_languagetool | train | java |
64adcb0910815995faaa18ef93e717ea82a72fd4 | diff --git a/command/core.py b/command/core.py
index <HASH>..<HASH> 100644
--- a/command/core.py
+++ b/command/core.py
@@ -61,7 +61,7 @@ class Command(object):
line = thefile.readline()
if not line:
- time.sleep(0.001)
+ time.sleep(0.00001)
continue
yield line | Check for data more often. Python 3 seems to need it | helgi_python-command | train | py |
75956bcadc9d8c51dd5db90ba4323cf8d7c9bda6 | diff --git a/tests/test_subcmd_08_anib.py b/tests/test_subcmd_08_anib.py
index <HASH>..<HASH> 100644
--- a/tests/test_subcmd_08_anib.py
+++ b/tests/test_subcmd_08_anib.py
@@ -58,10 +58,11 @@ import logging
import os
import unittest
+from argparse import Namespace
from collections import namedtuple
from pathlib import Path
-from argparse import Namespace
+import pytest
from pyani.scripts import subcommands
@@ -76,6 +77,7 @@ DirPaths = namedtuple("DirPaths", "indir outdir")
LabelPaths = namedtuple("LabelPaths", "classes labels")
+@pytest.mark.xfail(reason="ANIb is not currently fully implemented")
class TestANIbsubcommand(unittest.TestCase):
"""Class defining tests of the pyani anib subcommand.""" | mark ANIb test as XFAIL while it's being developed | widdowquinn_pyani | train | py |
ed86f60077ad8b06ccb225df741c50d886da6190 | diff --git a/lib/bx/pwm/pwm_tests.py b/lib/bx/pwm/pwm_tests.py
index <HASH>..<HASH> 100644
--- a/lib/bx/pwm/pwm_tests.py
+++ b/lib/bx/pwm/pwm_tests.py
@@ -4,8 +4,7 @@ import bx.pwm.position_weight_matrix as pwm
from StringIO import StringIO
basicPwm = \
-"""
->MA0101 c-REL REL
+""">MA0101 c-REL REL
0 5 8 4
0 1 15 1
1 0 15 1
@@ -19,8 +18,7 @@ basicPwm = \
"""
transfacPwm = \
-"""
-ID TATA
+"""ID TATA
XX
P0 A C G T
01 33 73 78 16 S | changed test matrices to sidestep problem with blank lines in matrix files | bxlab_bx-python | train | py |
e7a365a766ea44fff1165ef5b2adc2611586659c | diff --git a/test/db/postgresql/types_test.rb b/test/db/postgresql/types_test.rb
index <HASH>..<HASH> 100644
--- a/test/db/postgresql/types_test.rb
+++ b/test/db/postgresql/types_test.rb
@@ -246,8 +246,13 @@ _SQL
def test_data_type_of_array_types
omit_unless @first_array
- assert_equal :integer, @first_array.column_for_attribute(:commission_by_quarter).type
- assert_equal :text, @first_array.column_for_attribute(:nicknames).type
+ if ar_version('4.0')
+ assert_equal :integer, @first_array.column_for_attribute(:commission_by_quarter).type
+ assert_equal :text, @first_array.column_for_attribute(:nicknames).type
+ else
+ assert_equal :string, @first_array.column_for_attribute(:commission_by_quarter).type
+ # assert_equal :string, @first_array.column_for_attribute(:nicknames).type
+ end
end
def test_data_type_of_range_types | array detection for columns now only happens on AR >= <I> | jruby_activerecord-jdbc-adapter | train | rb |
3f62b5c05a8341a545bdac19f64e079498b6a2db | diff --git a/torchvision/models/detection/faster_rcnn.py b/torchvision/models/detection/faster_rcnn.py
index <HASH>..<HASH> 100644
--- a/torchvision/models/detection/faster_rcnn.py
+++ b/torchvision/models/detection/faster_rcnn.py
@@ -393,7 +393,18 @@ class FasterRCNN_ResNet50_FPN_Weights(WeightsEnum):
class FasterRCNN_ResNet50_FPN_V2_Weights(WeightsEnum):
- pass
+ COCO_V1 = Weights(
+ url="https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_v2_coco-dd69338a.pth",
+ transforms=ObjectDetection,
+ meta={
+ **_COMMON_META,
+ "publication_year": 2021,
+ "num_params": 43712278,
+ "recipe": "https://github.com/pytorch/vision/pull/5763",
+ "map": 46.7,
+ },
+ )
+ DEFAULT = COCO_V1
class FasterRCNN_MobileNet_V3_Large_FPN_Weights(WeightsEnum): | Add FasterRCNN improved weights (#<I>)
* Add FasterRCNN improved weights
* Add recipe URL
* Update publication_year field | pytorch_vision | train | py |
5dd16accb37da739a08b2be2931dc1da86541e5d | diff --git a/core/src/main/java/io/opencensus/stats/NoopStats.java b/core/src/main/java/io/opencensus/stats/NoopStats.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/opencensus/stats/NoopStats.java
+++ b/core/src/main/java/io/opencensus/stats/NoopStats.java
@@ -129,7 +129,6 @@ final class NoopStats {
existing
.getWindow()
.match(
- // TODO(sebright): Should we use the zero timestamp or the current time?
Functions.<AggregationWindowData>returnConstant(
CumulativeData.create(ZERO_TIMESTAMP, ZERO_TIMESTAMP)),
Functions.<AggregationWindowData>returnConstant( | Remove an unnecessary TODO.
Using a zero timestamp for empty views is fine for now. | census-instrumentation_opencensus-java | train | java |
e77fb4888ba1aa6f656d00030d96954aaa673acf | diff --git a/website/siteConfig.js b/website/siteConfig.js
index <HASH>..<HASH> 100644
--- a/website/siteConfig.js
+++ b/website/siteConfig.js
@@ -42,7 +42,7 @@ const siteConfig = {
/* path to images for header/footer */
headerIcon: 'img/bottender.svg',
footerIcon: '',
- favicon: 'img/favicon.ico',
+ favicon: 'img/favicon-192x192.png',
/* Colors for website */
colors: { | chore(website): use <I>x<I> favicon | Yoctol_bottender | train | js |
cbadfc48f1cf548bef0db43ead2ee489fb10a0e0 | diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js
index <HASH>..<HASH> 100644
--- a/src/search/FindInFiles.js
+++ b/src/search/FindInFiles.js
@@ -358,7 +358,7 @@ define(function (require, exports, module) {
height = Math.max(height, MIN_HEIGHT);
$searchResults.height(height);
- $searchContent.height(height - $searchToolbar);
+ $searchContent.height(height - $searchToolbar.height());
prefs.setValue("height", height);
EditorManager.resizeEditor(); | Fix bug in search panel resize with toolbar height | adobe_brackets | train | js |
fedc1f6fe4d325a86b9b61dbd62577b6ead3fc0b | diff --git a/framework/core/src/Api/Controller/ClearCacheController.php b/framework/core/src/Api/Controller/ClearCacheController.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Api/Controller/ClearCacheController.php
+++ b/framework/core/src/Api/Controller/ClearCacheController.php
@@ -11,12 +11,8 @@
namespace Flarum\Api\Controller;
-use Flarum\Foundation\Application;
use Flarum\Foundation\Console\CacheClearCommand;
-use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\AssertPermissionTrait;
-use League\Flysystem\Adapter\Local;
-use League\Flysystem\Filesystem;
use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput; | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | flarum_core | train | php |
4d531bef8d6c483ee73d8eeab7a850fa7a5724e1 | diff --git a/src/Security/SecurityVoter.php b/src/Security/SecurityVoter.php
index <HASH>..<HASH> 100644
--- a/src/Security/SecurityVoter.php
+++ b/src/Security/SecurityVoter.php
@@ -60,7 +60,7 @@ final class SecurityVoter extends Voter
private function voteOnViewMenuItemPermission(MenuItemDto $menuItemDto): bool
{
// users can see the menu item if they have the permission required by the menu item
- return $this->authorizationChecker->isGranted($menuItemDto->getPermission());
+ return $this->authorizationChecker->isGranted($menuItemDto->getPermission(), $menuItemDto);
}
/**
@@ -88,7 +88,7 @@ final class SecurityVoter extends Voter
private function voteOnViewPropertyPermission(FieldDto $field): bool
{
// users can see the field if they have the permission required by the field
- return $this->authorizationChecker->isGranted($field->getPermission());
+ return $this->authorizationChecker->isGranted($field->getPermission(), $field);
}
private function voteOnViewEntityPermission(EntityDto $entityDto): bool | Add some missing subjects to some isGranted calls in the security voter | EasyCorp_EasyAdminBundle | train | php |
1f989a79d186ce37f6463099f4986dfe9a9a9bc9 | diff --git a/rawdisk/util/rawstruct.py b/rawdisk/util/rawstruct.py
index <HASH>..<HASH> 100644
--- a/rawdisk/util/rawstruct.py
+++ b/rawdisk/util/rawstruct.py
@@ -10,6 +10,10 @@ class RawStruct(object):
def data(self):
return self._data
+ @property
+ def size(self):
+ return len(self._data)
+
@data.setter
def data(self, value):
self._data = value | Added size property to RawStruct | dariusbakunas_rawdisk | train | py |
155587dde6ca5c37ff41e976152e4607a3f41c63 | diff --git a/stacker/blueprints/empire/policies.py b/stacker/blueprints/empire/policies.py
index <HASH>..<HASH> 100644
--- a/stacker/blueprints/empire/policies.py
+++ b/stacker/blueprints/empire/policies.py
@@ -17,7 +17,7 @@ def ecs_agent_policy():
Action=[ecs.CreateCluster, ecs.RegisterContainerInstance,
ecs.DeregisterContainerInstance,
ecs.DiscoverPollEndpoint, ecs.ECSAction("Submit*"),
- ecs.Poll]
+ ecs.Poll, ecs.ECSAction("StartTelemetrySession")]
)
]
) | Fixes ECS Agent stats for Empire | cloudtools_stacker | train | py |
e30e3e1a946ecf11708c0905deda80e092b0a74a | diff --git a/client/components/domains/use-my-domain/utilities/get-availability-error-message.js b/client/components/domains/use-my-domain/utilities/get-availability-error-message.js
index <HASH>..<HASH> 100644
--- a/client/components/domains/use-my-domain/utilities/get-availability-error-message.js
+++ b/client/components/domains/use-my-domain/utilities/get-availability-error-message.js
@@ -35,13 +35,18 @@ export function getAvailabilityErrorMessage( { availabilityData, domainName, sel
return null;
}
- const availabilityStatus = [
+ let availabilityStatus = [
domainAvailability.MAPPABLE,
domainAvailability.MAPPED,
domainAvailability.TRANSFER_PENDING,
].includes( mappable )
? status
: mappable;
+
+ if ( domainAvailability.MAPPED === mappable && domainAvailability.MAPPABLE === status ) {
+ availabilityStatus = mappable;
+ }
+
const maintenanceEndTime = maintenance_end_time ?? null;
const site = other_site_domain ?? selectedSite?.slug; | Show an error message when trying to connect an already connected subdomain (#<I>) | Automattic_wp-calypso | train | js |
f8d2322f829f576bc9f372be1a668490bb689d25 | diff --git a/salt/modules/rabbitmq.py b/salt/modules/rabbitmq.py
index <HASH>..<HASH> 100644
--- a/salt/modules/rabbitmq.py
+++ b/salt/modules/rabbitmq.py
@@ -134,7 +134,8 @@ def list_users(runas=None):
python_shell=False)
# func to get tags from string such as "[admin, monitoring]"
- func = lambda string: set([x.strip() for x in string[1:-1].split(',')])
+ func = lambda string: [x.strip() for x in string[1:-1].split(',')] if ',' in string else [x for x in
+ string[1:-1].split(' ')]
return _output_to_dict(res, func) | fix difference between tag output of rabbitmq 2 and 3 | saltstack_salt | train | py |
3984ca017f62e18e4e3e2a3b93305e2f1cb63f68 | diff --git a/brozzler/__init__.py b/brozzler/__init__.py
index <HASH>..<HASH> 100644
--- a/brozzler/__init__.py
+++ b/brozzler/__init__.py
@@ -77,8 +77,8 @@ def behaviors(behaviors_dir=None):
import os, yaml, string
global _behaviors
if _behaviors is None:
- cwd = behaviors_dir or os.path.dirname(__file__)
- behaviors_yaml = os.path.join(cwd, 'behaviors.yaml')
+ d = behaviors_dir or os.path.dirname(__file__)
+ behaviors_yaml = os.path.join(d, 'behaviors.yaml')
with open(behaviors_yaml) as fin:
_behaviors = yaml.load(fin)
return _behaviors | Replace cwd var with d | internetarchive_brozzler | train | py |
69c03985caf7efec742e305aadecf1fe0229c87c | diff --git a/test/cluster/cluster.go b/test/cluster/cluster.go
index <HASH>..<HASH> 100644
--- a/test/cluster/cluster.go
+++ b/test/cluster/cluster.go
@@ -72,7 +72,7 @@ func (c *Cluster) BuildFlynn(rootFS, commit string) (string, error) {
Kernel: c.bc.Kernel,
User: uid,
Group: gid,
- Memory: "512",
+ Memory: "2048",
Cores: 8,
Drives: map[string]*VMDrive{
"hda": {FS: rootFS, COW: true, Temp: false}, | test: Use 2GB RAM when building Flynn | flynn_flynn | train | go |
235d6a0366d6fa24cffb424bd38ddedb73ede553 | diff --git a/core/server/web/shared/middlewares/labs.js b/core/server/web/shared/middlewares/labs.js
index <HASH>..<HASH> 100644
--- a/core/server/web/shared/middlewares/labs.js
+++ b/core/server/web/shared/middlewares/labs.js
@@ -1,21 +1,15 @@
const labsUtil = require('../../../services/labs');
const common = require('../../../lib/common');
-const labs = {
- subscribers(req, res, next) {
- if (labsUtil.isSet('subscribers') === true) {
- return next();
- } else {
- return next(new common.errors.NotFoundError());
- }
- },
- members(req, res, next) {
- if (labsUtil.isSet('members') === true) {
- return next();
- } else {
- return next(new common.errors.NotFoundError());
- }
+const labs = flag => (req, res, next) => {
+ if (labsUtil.isSet(flag) === true) {
+ return next();
+ } else {
+ return next(new common.errors.NotFoundError());
}
};
+labs.subscribers = labs('subscribers');
+labs.members = labs('members');
+
module.exports = labs; | Refactored labs middleware to remove duplication
no-issue
Also exposes a generic interface now. | TryGhost_Ghost | train | js |
f1b11866fde8ccd3a4945e426f3b790e2e681e01 | diff --git a/src/ol/map.js b/src/ol/map.js
index <HASH>..<HASH> 100644
--- a/src/ol/map.js
+++ b/src/ol/map.js
@@ -8,7 +8,6 @@ goog.provide('ol.RendererHint');
goog.provide('ol.RendererHints');
goog.require('goog.Uri.QueryData');
-goog.require('goog.array');
goog.require('goog.async.AnimationDelay');
goog.require('goog.debug.Logger');
goog.require('goog.dispose'); | Remove dependency on goog.array | openlayers_openlayers | train | js |
96404a34cb4d2944cbbed9bb24b495b4f7c8952e | diff --git a/webapps/webapp/src/test/js/e2e/cockpit/specs/decision-definition-spec.js b/webapps/webapp/src/test/js/e2e/cockpit/specs/decision-definition-spec.js
index <HASH>..<HASH> 100644
--- a/webapps/webapp/src/test/js/e2e/cockpit/specs/decision-definition-spec.js
+++ b/webapps/webapp/src/test/js/e2e/cockpit/specs/decision-definition-spec.js
@@ -109,7 +109,7 @@ describe('Cockpit Decision Definition Spec', function() {
it('should load the requested version on selection', function() {
// when
- definitionPage.version.getDropdownOption(0).click();
+ definitionPage.version.getDropdownOption(1).click();
// then
expect(definitionPage.version.getVersion()).to.eventually.eql('1'); | chore(e2e): fix decision definition test
related to CAM-<I> | camunda_camunda-bpm-platform | train | js |
4ccc0de961f6ae01faf0befd1422137d9df06ccd | diff --git a/lib/dry/struct/compiler.rb b/lib/dry/struct/compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/dry/struct/compiler.rb
+++ b/lib/dry/struct/compiler.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "dry/types/compiler"
-
module Dry
class Struct
class Compiler < Types::Compiler
diff --git a/lib/dry/struct/sum.rb b/lib/dry/struct/sum.rb
index <HASH>..<HASH> 100644
--- a/lib/dry/struct/sum.rb
+++ b/lib/dry/struct/sum.rb
@@ -1,8 +1,5 @@
# frozen_string_literal: true
-require "dry/types/sum"
-require "dry/types/printer"
-
module Dry
class Struct
# A sum type of two or more structs
diff --git a/project.yml b/project.yml
index <HASH>..<HASH> 100644
--- a/project.yml
+++ b/project.yml
@@ -12,5 +12,5 @@ gemspec:
runtime_dependencies:
- [zeitwerk, "~> 2.6"]
- [dry-core, ">= 0.9"]
- - [dry-types, "~> 1.5"]
+ - [dry-types, "~> 1.6"]
- [ice_nine, "~> 0.11"] | Rely on autoloading in dry-types | dry-rb_dry-struct | train | rb,rb,yml |
b2dc10a1fdff58e5e27aeae7e67281ab6fcf7cde | diff --git a/tests/Exscript/util/ttyTest.py b/tests/Exscript/util/ttyTest.py
index <HASH>..<HASH> 100644
--- a/tests/Exscript/util/ttyTest.py
+++ b/tests/Exscript/util/ttyTest.py
@@ -58,8 +58,7 @@ class ttyTest(unittest.TestCase):
# If the stty program exists, it should be used.
os.environ['PATH'] = oldpath
try:
- with Popen(['stty', 'size'], stdout=PIPE, stderr=PIPE,
- close_fds=True):
+ with Popen(['stty', 'size'], stdout=PIPE, stderr=PIPE):
self.assertNotEqual(get_terminal_size(), (1000, 1000))
self.assertNotEqual(get_terminal_size(10, 10), (1000, 1000))
except OSError: | another fix for ttytest | knipknap_exscript | train | py |
02b121817cb6169cacf38577e45e8c4f1cc2bebf | diff --git a/ui/tests/integration/components/scale-events-accordion-test.js b/ui/tests/integration/components/scale-events-accordion-test.js
index <HASH>..<HASH> 100644
--- a/ui/tests/integration/components/scale-events-accordion-test.js
+++ b/ui/tests/integration/components/scale-events-accordion-test.js
@@ -26,6 +26,10 @@ module('Integration | Component | scale-events-accordion', function(hooks) {
};
});
+ hooks.afterEach(function() {
+ this.server.shutdown();
+ });
+
const commonTemplate = hbs`<ScaleEventsAccordion @events={{this.events}} />`;
test('it shows an accordion with an entry for each event', async function(assert) { | Add missing server shutdown (#<I>)
This removes repeated instances of this warning from test logs:
You created a second Pretender instance while there was already one running. | hashicorp_nomad | train | js |
6e924ecc97d53263740b7c3f19a634a244b7bbe2 | diff --git a/netmiko/cisco/cisco_xr.py b/netmiko/cisco/cisco_xr.py
index <HASH>..<HASH> 100644
--- a/netmiko/cisco/cisco_xr.py
+++ b/netmiko/cisco/cisco_xr.py
@@ -68,12 +68,6 @@ class CiscoXrBase(CiscoBaseConnection):
if comment and confirm:
raise ValueError("Invalid arguments supplied to XR commit")
- # wrap the comment in quotes
- if comment:
- if '"' in comment:
- raise ValueError("Invalid comment contains double quote")
- comment = f'"{comment}"'
-
label = str(label)
error_marker = "Failed to"
alt_error_marker = "One or more commits have occurred from other" | XR commit comment change (#<I>) | ktbyers_netmiko | train | py |
fdf0a5e787116ace1af0272acb9ece243b135cd5 | diff --git a/lib/ronin/ui/console/commands.rb b/lib/ronin/ui/console/commands.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/ui/console/commands.rb
+++ b/lib/ronin/ui/console/commands.rb
@@ -20,6 +20,7 @@
require 'ronin/config'
require 'set'
+require 'shellwords'
require 'tempfile'
module Ronin
@@ -90,7 +91,7 @@ module Ronin
# @since 1.5.0
#
def Commands.exec(*arguments)
- system(arguments.join(' '))
+ system(Shellwords.shelljoin(arguments))
end
#
@@ -175,20 +176,14 @@ module Ronin
# @since 1.5.0
#
def parse_command(command)
- name, arguments = command.split(' ',2)
- arguments = if arguments
- arguments.split(' ')
- else
- []
- end
-
- arguments.each do |argument|
- # evaluate embedded Ruby expressions
- argument.gsub!(/\#\{[^\s\}]*\}/) do |expression|
- eval(expression[2..-2],Ripl.config[:binding]).to_s
- end
+ # evaluate embedded Ruby expressions
+ command = command.gsub(/\#\{[^\}]*\}/) do |expression|
+ eval(expression[2..-2],Ripl.config[:binding]).to_s.dump
end
+ arguments = Shellwords.shellsplit(command)
+ name = arguments.shift
+
return name, arguments
end | Use Shellwords to properly parse Console commands.
* Use shelljoin to properly convert parsed Console commands back into
Shell commands.
* Closes Issue <I>. | ronin-ruby_ronin | train | rb |
7a7c03a47d1dbdbf309dd33a3093b1498de8f7dd | diff --git a/src/Html/Editor/Editor.php b/src/Html/Editor/Editor.php
index <HASH>..<HASH> 100644
--- a/src/Html/Editor/Editor.php
+++ b/src/Html/Editor/Editor.php
@@ -44,6 +44,14 @@ class Editor {
public static $defaultStylesheets = [];
/**
+ * Include editor scripts if it will be displayed on the page.
+ *
+ * @var boolean
+ */
+
+ public static $includeScripts = false;
+
+ /**
* Name of the code editor.
*
* @var string
@@ -164,6 +172,8 @@ class Editor {
*/
public function getCreateScript() {
+ static::$includeScripts = true;
+
$text = '<script>';
$text .= 'editors = ( typeof editors != "undefined" && editors instanceof Array ) ? editors : [];';
$text .= 'editors.push({';
@@ -179,4 +189,4 @@ class Editor {
return $text;
}
-}
\ No newline at end of file
+} | Added lazy loading for editor scripts | oxygen-cms_core | train | php |
e37230e47462ade22174ab0d0ee60228b0980bb2 | diff --git a/drivers/pax-exam-player/src/main/java/org/ops4j/pax/exam/player/Player.java b/drivers/pax-exam-player/src/main/java/org/ops4j/pax/exam/player/Player.java
index <HASH>..<HASH> 100644
--- a/drivers/pax-exam-player/src/main/java/org/ops4j/pax/exam/player/Player.java
+++ b/drivers/pax-exam-player/src/main/java/org/ops4j/pax/exam/player/Player.java
@@ -114,5 +114,6 @@ public class Player {
fail( t.getMessage() );
}
}
+ stagedReactor.tearDown();
}
} | PAXEXAM-<I> Bugfixed missing tearDown call. | ops4j_org.ops4j.pax.exam2 | train | java |
490e04ea0636118e5f28eeff4fc5f761cb0a57b1 | diff --git a/lib/gn-constants.js b/lib/gn-constants.js
index <HASH>..<HASH> 100644
--- a/lib/gn-constants.js
+++ b/lib/gn-constants.js
@@ -11,7 +11,7 @@ module.exports = {
detailCharge: '/charge/detail',
customer: '/customer',
pay: '/payment/pay',
- paymentMethods: '/payment/methods',
+ paymentData: '/payment/data',
notification: '/notification',
updateNotification: '/notification/update',
detailSubscription: '/subscription/detail',
diff --git a/lib/gn-sdk.js b/lib/gn-sdk.js
index <HASH>..<HASH> 100644
--- a/lib/gn-sdk.js
+++ b/lib/gn-sdk.js
@@ -38,8 +38,8 @@ GnSdk.prototype.createPayment = function (payment) {
return this.endpoints.run('pay', payment);
};
-GnSdk.prototype.getPaymentMethods = function (options) {
- return this.endpoints.run('paymentMethods', options);
+GnSdk.prototype.getPaymentData = function (options) {
+ return this.endpoints.run('paymentData', options);
};
module.exports = GnSdk;
\ No newline at end of file | Update paymentMethod to paymentData | gerencianet_gn-api-sdk-node | train | js,js |
ce66c2353dd59d77f9266a9b30274623a89a3d38 | diff --git a/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js b/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js
index <HASH>..<HASH> 100644
--- a/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js
+++ b/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js
@@ -927,7 +927,7 @@ declare module "lodash" {
random(lower?: number, upper?: number, floating?: boolean): number;
// Object
- assign(object?: ?Object, ...sources?: Array<Object>): Object;
+ assign(object?: ?Object, ...sources?: Array<?Object>): Object;
assignIn(): {};
assignIn<A, B>(a: A, b: B): A & B;
assignIn<A, B, C>(a: A, b: B, c: C): A & B & C; | lodash: assign can receive null further arguments (#<I>) | flow-typed_flow-typed | train | js |
683e8d83a62e1306724f070bf81e03fd73da954a | diff --git a/generators/aws/lib/rds.js b/generators/aws/lib/rds.js
index <HASH>..<HASH> 100644
--- a/generators/aws/lib/rds.js
+++ b/generators/aws/lib/rds.js
@@ -88,7 +88,7 @@ function authorizeSecurityGroupIngress(params, callback) {
var securityGroupParams = {
GroupId: params.rdsSecurityGroupId,
- IpProtocol: 'TCP',
+ IpProtocol: 'tcp',
FromPort: 0,
ToPort: 65535,
CidrIp: '0.0.0.0/0' | Changed TCP to tcp | jhipster_generator-jhipster | train | js |
44d6ba18dc9c0986f30dcee054fc3ef2d15237e0 | diff --git a/src/Controller.php b/src/Controller.php
index <HASH>..<HASH> 100644
--- a/src/Controller.php
+++ b/src/Controller.php
@@ -115,7 +115,7 @@ abstract class Controller implements ContainerAccessInterface, ControllerInterfa
return $this->getResultEncoder()->encode(call_user_func([&$this, $action], $request, $arguments), $request, $response);
} catch (Exception $e) {
if ($this->container->has('logger')) {
- $this->container->get('logger')->warning("Exception is caught with message {exception_message}", [
+ $this->container->get('logger')->warning("Controller action aborted with an exception: {exception_message}", [
'exception_message' => $e->getMessage(),
'exception' => $e,
]); | Log that action aborted due to an exception | activecollab_controller | train | php |
c25ee7035a0f1940173c630b282cc3f294808df0 | diff --git a/framework/core/src/Core/Models/Post.php b/framework/core/src/Core/Models/Post.php
index <HASH>..<HASH> 100755
--- a/framework/core/src/Core/Models/Post.php
+++ b/framework/core/src/Core/Models/Post.php
@@ -3,7 +3,7 @@
use Tobscure\Permissible\Permissible;
use Flarum\Core\Events\PostWasDeleted;
-abstract class Post extends Model
+class Post extends Model
{
use Permissible; | Post can't be abstract because it needs to be instantiable for querying | flarum_core | train | php |
ade0fc90f793c97554d26478432e779a7fa873b6 | diff --git a/json.go b/json.go
index <HASH>..<HASH> 100644
--- a/json.go
+++ b/json.go
@@ -38,7 +38,7 @@ func ReadJSON(c *Conn, v interface{}) error {
// ReadJSON reads the next JSON-encoded message from the connection and stores
// it in the value pointed to by v.
//
-// See the documentation for the encoding/json Marshal function for details
+// See the documentation for the encoding/json Unmarshal function for details
// about the conversion of JSON to a Go value.
func (c *Conn) ReadJSON(v interface{}) error {
_, r, err := c.NextReader() | Correct documentation, the "ReadJSON" function depends on "Unmarshal", not "Marshal" | gorilla_websocket | train | go |
9c4dfa544e85e00d636beb0026a08e40dcdb6404 | diff --git a/allennlp/data/tokenizers/pretrained_transformer_tokenizer.py b/allennlp/data/tokenizers/pretrained_transformer_tokenizer.py
index <HASH>..<HASH> 100644
--- a/allennlp/data/tokenizers/pretrained_transformer_tokenizer.py
+++ b/allennlp/data/tokenizers/pretrained_transformer_tokenizer.py
@@ -1,3 +1,4 @@
+import copy
import logging
from typing import Any, Dict, List, Optional, Tuple, Iterable
@@ -417,16 +418,11 @@ class PretrainedTransformerTokenizer(Tokenizer):
self, tokens1: List[Token], tokens2: Optional[List[Token]] = None
) -> List[Token]:
# Make sure we don't change the input parameters
- import copy
-
tokens1 = copy.deepcopy(tokens1)
tokens2 = copy.deepcopy(tokens2)
# We add special tokens and also set token type ids.
if tokens2 is None:
- import copy
-
- tokens1 = copy.deepcopy(tokens1)
for token in tokens1:
token.type_id = self.single_sequence_token_type_id
return self.single_sequence_start_tokens + tokens1 + self.single_sequence_end_tokens | small fix to pretrained transformer tokenizer (#<I>) | allenai_allennlp | train | py |
d4928c5a22bbd7d915c2cd6354a59cdb7414113d | diff --git a/tests/buildpackage.py b/tests/buildpackage.py
index <HASH>..<HASH> 100644
--- a/tests/buildpackage.py
+++ b/tests/buildpackage.py
@@ -233,6 +233,8 @@ def build_centos(opts):
if major_release == 5:
python_bin = 'python26'
define_opts.extend(['--define', 'dist .el5'])
+ if os.path.exists('/etc/yum.repos.d/saltstack.repo'):
+ build_reqs.extend(['--enablerepo=saltstack'])
build_reqs.extend(['python26-devel'])
elif major_release == 6:
build_reqs.extend(['python-devel']) | Use saltstack repo in buildpackage.py on CentOS 5 (#<I>) | saltstack_salt | train | py |
d0c9443e1e197f573df955ef36528b65073b26d1 | diff --git a/SailsRest.js b/SailsRest.js
index <HASH>..<HASH> 100644
--- a/SailsRest.js
+++ b/SailsRest.js
@@ -255,6 +255,7 @@ module.exports = (function() {
protocol: 'http',
hostname: 'localhost',
port: 80,
+ rejectUnauthorized: true,
pathname: '',
resource: null,
action: null,
@@ -295,7 +296,8 @@ module.exports = (function() {
host: config.host,
port: config.port
}),
- headers: config.headers
+ headers: config.headers,
+ rejectUnauthorized: config.rejectUnauthorized
})
}; | Allow `rejectUnauthorized` restify flag to be set in config. | zohararad_sails-rest | train | js |
fdf37bd75168e0f73355030c31e215e097cb8646 | diff --git a/forms.py b/forms.py
index <HASH>..<HASH> 100644
--- a/forms.py
+++ b/forms.py
@@ -129,8 +129,10 @@ class ContactForm(forms.Form):
pass silently, unless explicitly silenced").
"""
- def __init__(self, request, *args, **kwargs):
- super(ContactForm, self).__init__(*args, **kwargs)
+ def __init__(self, data=None, request=None, *args, **kwargs):
+ if request is None:
+ raise TypeError("Keyword argument 'request' must be supplied")
+ super(ContactForm, self).__init__(data, *args, **kwargs)
self.request = request
name = forms.CharField(max_length=100, | Work around the need to accept 'data' as a possibly-absent positional argument | ubernostrum_django-contact-form | train | py |
a50c953742c0ed69fe6de39764787b24630ca4c0 | diff --git a/src/main/java/com/semanticcms/core/taglib/DoViewTag.java b/src/main/java/com/semanticcms/core/taglib/DoViewTag.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/semanticcms/core/taglib/DoViewTag.java
+++ b/src/main/java/com/semanticcms/core/taglib/DoViewTag.java
@@ -60,7 +60,6 @@ public class DoViewTag extends SimpleTagSupport {
// TODO: Just pass writer to avoid all this craziness
}
};
- if(pw.checkError()) throw new IOException("Check 0");
view.doView(
pageContext.getServletContext(),
(HttpServletRequest)pageContext.getRequest(), | Working on how themes and views will be defined and interact. | aoindustries_semanticcms-core-taglib | train | java |
b2593f2e22432eb6ba3e9aad7df70c6f34abb22d | diff --git a/lib/aws.js b/lib/aws.js
index <HASH>..<HASH> 100644
--- a/lib/aws.js
+++ b/lib/aws.js
@@ -29,7 +29,7 @@ AWS.CredentialProviderChain.defaultProviders = [
function () { return new AWS.EnvironmentCredentials('AMAZON'); },
function () { return new AWS.SharedIniFileCredentials(); },
function () {
- if (AWS.ECSCredentials.prototype.getECSRelativeUri() !== undefined) {
+ if (AWS.ECSCredentials.getECSRelativeUri() !== undefined) {
return new AWS.ECSCredentials();
}
return new AWS.EC2MetadataCredentials();
diff --git a/lib/credentials/ecs_credentials.js b/lib/credentials/ecs_credentials.js
index <HASH>..<HASH> 100644
--- a/lib/credentials/ecs_credentials.js
+++ b/lib/credentials/ecs_credentials.js
@@ -140,3 +140,8 @@ AWS.ECSCredentials = AWS.util.inherit(AWS.Credentials, {
});
}
});
+
+/**
+ * @api private
+ */
+AWS.ECSCredentials.getECSRelativeUri = AWS.ECSCredentials.prototype.getECSRelativeUri; | Adds reference to getECSRelativeUri function on the ECSCredentials constructor | aws_aws-sdk-js | train | js,js |
0b6aee7d173a5d4106fcac559cd9da6e0be5e19e | diff --git a/modules/sovrnBidAdapter.js b/modules/sovrnBidAdapter.js
index <HASH>..<HASH> 100644
--- a/modules/sovrnBidAdapter.js
+++ b/modules/sovrnBidAdapter.js
@@ -90,7 +90,7 @@ export const spec = {
netRevenue: true,
mediaType: BANNER,
ad: decodeURIComponent(`${sovrnBid.adm}<img src="${sovrnBid.nurl}">`),
- ttl: 60000
+ ttl: 60
});
});
} | Update sovrnBidAdapter.js (#<I>)
Fix Issue #<I> | prebid_Prebid.js | train | js |
1c1100c2a656a78b2edc78ff5f7595183d5b75d5 | diff --git a/zinnia/models/entry.py b/zinnia/models/entry.py
index <HASH>..<HASH> 100644
--- a/zinnia/models/entry.py
+++ b/zinnia/models/entry.py
@@ -102,6 +102,10 @@ class EntryAbstractClass(models.Model):
ENTRY_TEMPLATES,
help_text=_('template used to display the entry'))
+ comment_count = models.IntegerField(_('comment count'), default=0)
+ pingback_count = models.IntegerField(_('pingback count'), default=0)
+ trackback_count = models.IntegerField(_('trackback count'), default=0)
+
objects = models.Manager()
published = EntryPublishedManager() | adding count of the different discussion directly on the entry model | Fantomas42_django-blog-zinnia | train | py |
f266956a5d4345f31e12efbdf57f8b37c23a896e | diff --git a/command/013_config_upgrade.go b/command/013_config_upgrade.go
index <HASH>..<HASH> 100644
--- a/command/013_config_upgrade.go
+++ b/command/013_config_upgrade.go
@@ -689,6 +689,16 @@ Usage: terraform 0.13upgrade [module-dir]
Updates module configuration files to add provider source attributes and
merge multiple required_providers blocks into one.
+
+ By default, 0.13upgrade rewrites the files in the current working directory.
+ However, a path to a different directory can be provided. The command will
+ prompt for confirmation interactively unless the -yes option is given.
+
+Options:
+
+ -yes Skip the initial introduction messages and interactive
+ confirmation. This can be used to run this command in
+ batch from a script.
`
return strings.TrimSpace(helpText)
} | Add `-yes` flag to <I>upgrade help message
It seems to be implemented but not shown in help message.
FYI: A help message for <I>upgrade command on the <I> branch.
<URL> | hashicorp_terraform | train | go |
845271aff1a6321807833546ac979a11320f96c3 | diff --git a/src/directives/mobilequery.js b/src/directives/mobilequery.js
index <HASH>..<HASH> 100644
--- a/src/directives/mobilequery.js
+++ b/src/directives/mobilequery.js
@@ -2,6 +2,7 @@ goog.provide('ngeo.MobileQueryController');
goog.provide('ngeo.mobileQueryDirective');
goog.require('ngeo');
+goog.require('ngeo.Query');
/** | Add ngeo.Query service requirement in mobilequery directive | camptocamp_ngeo | train | js |
2c276748badde9a700ab8dc1703a4e0c4e291bea | diff --git a/bcbio/variation/effects.py b/bcbio/variation/effects.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/effects.py
+++ b/bcbio/variation/effects.py
@@ -276,7 +276,7 @@ def get_db(data):
snpeff_base_dir = None
if snpeff_db:
snpeff_base_dir = utils.get_in(data, ("reference", "snpeff"))
- if not isinstance(snpeff_base_dir, basestring) and os.path.isdir(snpeff_base_dir):
+ if not (isinstance(snpeff_base_dir, basestring) and os.path.isdir(snpeff_base_dir)):
snpeff_base_dir = utils.get_in(data, ("reference", "snpeff", snpeff_db))
if not snpeff_base_dir:
# We need to mask '.' characters for CWL/WDL processing, check for them here | effects: avoid lookup issues with non-CWL snpEff | bcbio_bcbio-nextgen | train | py |
ae2023e94c6f84905524f0e67aa2a9ed973d7980 | diff --git a/lib/uaa/cli/client_reg.rb b/lib/uaa/cli/client_reg.rb
index <HASH>..<HASH> 100644
--- a/lib/uaa/cli/client_reg.rb
+++ b/lib/uaa/cli/client_reg.rb
@@ -28,6 +28,7 @@ class ClientCli < CommonCli
:refresh_token_validity => 'seconds',
:redirect_uri => 'list',
:autoapprove => 'list',
+ :allowpublic => 'list',
:allowedproviders => 'list',
:'signup_redirect_url' => 'url'
}
@@ -46,7 +47,7 @@ class ClientCli < CommonCli
info[k] = opts[:interact] ?
info[k] = askd("#{k.to_s.gsub('_', ' ')} (#{p})", default): default
end
- if k == :autoapprove && (info[k] == 'true' || info[k] == 'false')
+ if (k == :autoapprove || k == :allowpublic) && (info[k] == 'true' || info[k] == 'false')
info[k] = !!(info[k] == 'true')
else
info[k] = Util.arglist(info[k]) if p == 'list' | add allowpublic option to client (#<I>) | cloudfoundry_cf-uaac | train | rb |
cb56111720bc3f943616e79ef2a912259967966e | diff --git a/lib/prawndown/version.rb b/lib/prawndown/version.rb
index <HASH>..<HASH> 100644
--- a/lib/prawndown/version.rb
+++ b/lib/prawndown/version.rb
@@ -1,3 +1,3 @@
module Prawndown
- VERSION = "0.1.0"
+ VERSION = "0.0.1"
end | Use patch-level versions until a stable API is complete | kaspermeyer_prawndown | train | rb |
c3c09f65a630ded2d09c6e7921c3b3e310e89cc6 | diff --git a/steam/__init__.py b/steam/__init__.py
index <HASH>..<HASH> 100644
--- a/steam/__init__.py
+++ b/steam/__init__.py
@@ -46,6 +46,24 @@ def get_config_dir():
return _config_dir
+def set_cache_dir(dirs):
+ """ Set the cache directory. """
+ global _cache_dir
+
+ if not os.path.exists(dirs):
+ os.makedirs(dirs)
+
+ _cache_dir = dirs
+
+def set_config_dir(dirs):
+ """ Set the config file directory (your API key would be read from here) """
+ global _config_dir
+
+ if not os.path.exists(dirs):
+ os.makedirs(dirs)
+
+ _config_dir = dirs
+
def load_config_file(basename):
""" Returns the configuration dict in basename
from the config directory if available. """ | Add config & cache dir setters
This is starting to get crufty. Need to write a better
system for caching, config is mostly useless since no one will want
steamodd to take care of storing their values for them (except me) | Lagg_steamodd | train | py |
9633806a208b47429248559eeb1b28972512e2ea | diff --git a/tests/unit/test_proxy_minion.py b/tests/unit/test_proxy_minion.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_proxy_minion.py
+++ b/tests/unit/test_proxy_minion.py
@@ -104,7 +104,6 @@ class ProxyMinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
finally:
proxy_minion.destroy()
- @slowTest
def test_proxy_config_default_include(self):
"""
Tests that when the proxy_config function is called, | No reason for this test to be a slow test. | saltstack_salt | train | py |
39ee0ee61a489193a574a3001631e285f359f39e | diff --git a/src/dom.js b/src/dom.js
index <HASH>..<HASH> 100644
--- a/src/dom.js
+++ b/src/dom.js
@@ -68,13 +68,19 @@ const onClick = event => {
export default function initDomListeners(container) {
const root = container || doc
- add(win, WINDOW_EVENTS, onWindowEvent)
- add(root, CLICK_EVENT, onClick)
+ if (win) {
+ add(win, WINDOW_EVENTS, onWindowEvent)
+ add(root, CLICK_EVENT, onClick)
+ }
+
router.on.value(onRouterPush)
return () => {
- remove(win, WINDOW_EVENTS, onWindowEvent)
- remove(root, CLICK_EVENT, onClick)
+ if (win) {
+ remove(win, WINDOW_EVENTS, onWindowEvent)
+ remove(root, CLICK_EVENT, onClick)
+ }
+
router.off.value(onRouterPush)
}
}
\ No newline at end of file | updated: avoid adding dom events in a node environement | riot_route | train | js |
19c61178a983748c03435dd3a508e943dd2190cf | diff --git a/actor-sdk/sdk-core/runtime/runtime-shared/src/template/java/im/actor/runtime/WebRTCRuntimeProvider.java b/actor-sdk/sdk-core/runtime/runtime-shared/src/template/java/im/actor/runtime/WebRTCRuntimeProvider.java
index <HASH>..<HASH> 100644
--- a/actor-sdk/sdk-core/runtime/runtime-shared/src/template/java/im/actor/runtime/WebRTCRuntimeProvider.java
+++ b/actor-sdk/sdk-core/runtime/runtime-shared/src/template/java/im/actor/runtime/WebRTCRuntimeProvider.java
@@ -19,7 +19,7 @@ public class WebRTCRuntimeProvider implements WebRTCRuntime {
@NotNull
@Override
- public Promise<WebRTCMediaStream> getUserAudio() {
+ public Promise<WebRTCMediaStream> getUserMedia(boolean isVideoEnabled) {
return Promise.failure(new RuntimeException("Dumb"));
} | fix(runtime): update shared WebRTCRuntimeProvider | actorapp_actor-platform | train | java |
521b75f879ec7fe9fe224593189365b2c469b6ff | diff --git a/marshmallow/schema.py b/marshmallow/schema.py
index <HASH>..<HASH> 100644
--- a/marshmallow/schema.py
+++ b/marshmallow/schema.py
@@ -766,6 +766,8 @@ class BaseSchema(base.SchemaABC):
try:
field_obj = self.fields[field_name]
except KeyError:
+ if field_name in self.declared_fields:
+ return
raise ValueError('"{0}" field does not exist.'.format(field_name))
if many: | Ignore field validator if field is declared but not in "only" | marshmallow-code_marshmallow | train | py |
03c0ebafec69f01dbaa8515f2bb6c60ba4602ea8 | diff --git a/charm/actions.go b/charm/actions.go
index <HASH>..<HASH> 100644
--- a/charm/actions.go
+++ b/charm/actions.go
@@ -38,7 +38,7 @@ func ReadActionsYaml(r io.Reader) (*Actions, error) {
if actionsSpec == nil {
return nil, fmt.Errorf("empty actions definition")
}
- if data != []byte{} && reflect.DeepEqual(actionsSpec, &Actions{}) {
+ if !reflect.DeepEqual(data, []byte{}) && reflect.DeepEqual(actionsSpec, &Actions{}) {
return nil, fmt.Errorf("actions.yaml failed to unmarshal -- key mismatch")
}
diff --git a/charm/actions_test.go b/charm/actions_test.go
index <HASH>..<HASH> 100644
--- a/charm/actions_test.go
+++ b/charm/actions_test.go
@@ -42,11 +42,11 @@ func TestReadGoodActionsYaml(c *gc.C) {
"type": "string",
"default": "foo.bz2"}}}}}},
- {
- "A more complex schema with hyphenated names and multiple parameters.",
- "placeholder",
- nil,
- },
+ //{
+ // "A more complex schema with hyphenated names and multiple parameters.",
+ // "placeholder",
+ // nil,
+ //},
{
"A schema with an empty \"params\" key, implying no options.", | Fixed syntax in charm/actions.go | juju_juju | train | go,go |
27ddd19e9b07101b712b4b7d82443b3c9d53fa69 | diff --git a/handler/oauth2/flow_refresh.go b/handler/oauth2/flow_refresh.go
index <HASH>..<HASH> 100644
--- a/handler/oauth2/flow_refresh.go
+++ b/handler/oauth2/flow_refresh.go
@@ -24,7 +24,7 @@ type RefreshTokenGrantHandler struct {
// HandleTokenEndpointRequest implements https://tools.ietf.org/html/rfc6749#section-6
func (c *RefreshTokenGrantHandler) HandleTokenEndpointRequest(ctx context.Context, req *http.Request, request fosite.AccessRequester) error {
// grant_type REQUIRED.
- // Value MUST be set to "client_credentials".
+ // Value MUST be set to "refresh_token".
if !request.GetGrantTypes().Exact("refresh_token") {
return errors.Wrap(fosite.ErrUnknownRequest, "")
} | oauth2: corrected grant type in comment (#<I>) | ory_fosite | train | go |
28b5c55d6a5c069f993ce03df5b9dfac2915e1b5 | diff --git a/flake8_assertive.py b/flake8_assertive.py
index <HASH>..<HASH> 100644
--- a/flake8_assertive.py
+++ b/flake8_assertive.py
@@ -4,6 +4,7 @@ import ast
import fnmatch
import re
+__all__ = ['Checker']
__author__ = 'Jon Parise'
__version__ = '0.1.0' | Define __all__ to export just the Checker symbol | jparise_flake8-assertive | train | py |
e75403f4794044fb3bbffe0c67db32380e80ef5e | diff --git a/kaminari-core/lib/kaminari/models/page_scope_methods.rb b/kaminari-core/lib/kaminari/models/page_scope_methods.rb
index <HASH>..<HASH> 100644
--- a/kaminari-core/lib/kaminari/models/page_scope_methods.rb
+++ b/kaminari-core/lib/kaminari/models/page_scope_methods.rb
@@ -25,8 +25,8 @@ module Kaminari
end
def padding(num)
- @_padding = num
- offset(offset_value + num.to_i)
+ @_padding = num.to_i
+ offset(offset_value + @_padding)
end
# Total number of pages
diff --git a/kaminari-core/test/models/active_record/scopes_test.rb b/kaminari-core/test/models/active_record/scopes_test.rb
index <HASH>..<HASH> 100644
--- a/kaminari-core/test/models/active_record/scopes_test.rb
+++ b/kaminari-core/test/models/active_record/scopes_test.rb
@@ -190,6 +190,13 @@ if defined? ActiveRecord
assert_equal 'user002', relation.first.name
end
+ test 'page 1 per 5 padding "1" (as string)' do
+ relation = model_class.page(1).per(5).padding('1')
+
+ assert_equal 5, relation.count
+ assert_equal 'user002', relation.first.name
+ end
+
test 'page 19 per 5 padding 5' do
relation = model_class.page(19).per(5).padding(5) | Coerce num param to int and assign to @_padding
This avoids code failing when calling "Model.padding(params[:padding] || 0)" since params[:padding] is a string. | kaminari_kaminari | train | rb,rb |
81e25bc6a4d1b2e73dca938616c2bf0dc32cae24 | diff --git a/ntlm3/des.py b/ntlm3/des.py
index <HASH>..<HASH> 100644
--- a/ntlm3/des.py
+++ b/ntlm3/des.py
@@ -48,7 +48,7 @@ DESException = 'DESException'
def str_to_key56(key_str):
if not type(key_str) == six.binary_type:
- log.warn("I was called with a non-bytestring: %s" % key_str)
+ # TODO rsanders high - figure out how to make this not necessary
key_str = key_str.encode('ascii')
if len(key_str) < 7: | Removing warning - it appears to work either way and this warning will log passwords in cleartext. | trustrachel_python-ntlm3 | train | py |
cbfb9ace95013bda59e980f90194459959026e88 | diff --git a/variant/mixins.py b/variant/mixins.py
index <HASH>..<HASH> 100644
--- a/variant/mixins.py
+++ b/variant/mixins.py
@@ -1,3 +1,4 @@
+from collections import defaultdict
from .utils import get_experiment_variant
@@ -6,7 +7,7 @@ class VariantTestMixin(object):
def __init__(self, *args, **kwargs):
super(VariantTestMixin, self).__init__(*args, **kwargs)
- self.variants = {}
+ self.variants = defaultdict(lambda: None)
def dispatch(self, request, *args, **kwargs):
self.set_variants()
diff --git a/variant/tests/mixin_tests.py b/variant/tests/mixin_tests.py
index <HASH>..<HASH> 100644
--- a/variant/tests/mixin_tests.py
+++ b/variant/tests/mixin_tests.py
@@ -14,6 +14,7 @@ class VariantTestMixinTest(TestCase):
def test_init(self):
self.assertEqual(self.view.variants, {})
+ self.assertIs(self.view.variants['dne'], None)
def test_dispatch(self):
request = mock.MagicMock() | use default dict variants cache on view mixin | jsatt_django-variant | train | py,py |
398e4ce8761e1b4f99a0c998719dd56ff77b35ac | diff --git a/lib/obsolete.rb b/lib/obsolete.rb
index <HASH>..<HASH> 100644
--- a/lib/obsolete.rb
+++ b/lib/obsolete.rb
@@ -55,6 +55,7 @@ module Magick
deprecate_constant 'ConstantVirtualPixelMethod'
deprecate_constant 'FlattenAlphaChannel'
+ deprecate_constant 'IntegerPixel'
deprecate_constant 'MatteChannel'
deprecate_constant 'Rec601LumaColorspace'
deprecate_constant 'Rec709LumaColorspace' | Deprecated IntegerPixel because this will be removed in ImageMagick 7. (#<I>) | rmagick_rmagick | train | rb |
5614c0e3e17918ac04fd1a4f281a3dbb0b89a75c | diff --git a/scripts/devel/catkin_make_isolated_and_install.py b/scripts/devel/catkin_make_isolated_and_install.py
index <HASH>..<HASH> 100755
--- a/scripts/devel/catkin_make_isolated_and_install.py
+++ b/scripts/devel/catkin_make_isolated_and_install.py
@@ -42,7 +42,7 @@ def main(argv=sys.argv[1:]):
test_results_dir = os.path.join(args.workspace_root, 'test_results')
rc = call_catkin_make_isolated(
args.rosdistro_name, args.workspace_root,
- ['--install', '--cmake-args', '-DCATKIN_ENABLE_TESTING=0',
+ ['--install', '--cmake-args', '-DCATKIN_SKIP_TESTING=1',
'-DCATKIN_TEST_RESULTS_DIR=%s' % test_results_dir])
finally:
if args.clean_after: | use skip testing instead of disabling testing | ros-infrastructure_ros_buildfarm | train | py |
b94ce6999eda6f202046c3ede1130267d1a3dfd8 | diff --git a/shared/chat/conversation/messages/wrapper/shared.js b/shared/chat/conversation/messages/wrapper/shared.js
index <HASH>..<HASH> 100644
--- a/shared/chat/conversation/messages/wrapper/shared.js
+++ b/shared/chat/conversation/messages/wrapper/shared.js
@@ -57,7 +57,7 @@ const MessageWrapper = (props: Props) => (
<Username includeHeader={props.includeHeader} author={props.author} isYou={props.isYou} isFollowing={props.isFollowing} isBroken={props.isBroken} />
<Box style={_textContainerStyle} className='message' data-message-key={props.messageKey}>
<Box style={_flexOneColumn}>
- <props.innerClass messageKey={props.messageKey} onAction={props.onAction} />
+ <props.innerClass messageKey={props.messageKey} measure={props.measure} onAction={props.onAction} />
<EditedMark isEdited={props.isEdited} />
</Box>
<ActionButton isRevoked={props.isRevoked} onAction={props.onAction} /> | Pass measure callback down to inner message component | keybase_client | train | js |
6955185277522af8bb602e9b9dd2316195ee9781 | diff --git a/src/Ray/Di/Injector.php b/src/Ray/Di/Injector.php
index <HASH>..<HASH> 100644
--- a/src/Ray/Di/Injector.php
+++ b/src/Ray/Di/Injector.php
@@ -128,9 +128,10 @@ class Injector implements InjectorInterface
*
* @return Injector
*/
- public static function create(array $modules = [], array $annotations = [])
+ public static function create(array $modules = [], $useApcConfig = true)
{
- $injector = new self(new Container(new Forge(new Config(new Annotation(new Definition, $annotations)))));
+ $config = $useApcConfig ? __NAMESPACE__ . '\ApcConfig' : __NAMESPACE__ . '\Config';
+ $injector = new self(new Container(new Forge(new $config(new Annotation(new Definition, [])))));
if (count($modules) > 0) {
$module = array_shift($modules);
foreach ($modules as $extraModule) { | Change Injector::create() | ray-di_Ray.Di | train | php |
9d9d650ca8ee89f9a25eaed5ddb8e5bbdf8737f3 | diff --git a/test/delocalize_test.rb b/test/delocalize_test.rb
index <HASH>..<HASH> 100644
--- a/test/delocalize_test.rb
+++ b/test/delocalize_test.rb
@@ -14,16 +14,20 @@ class DelocalizeActiveRecordTest < ActiveRecord::TestCase
assert_equal -1299.99, @product.price
end
- test "delocalizes localized date" do
+ test "delocalizes localized date with year" do
date = Date.civil(2009, 10, 19)
@product.released_on = '19. Oktober 2009'
assert_equal date, @product.released_on
- @product.released_on = '19. Okt'
+ @product.released_on = '19.10.2009'
assert_equal date, @product.released_on
+ end
- @product.released_on = '19.10.2009'
+ test "delocalizes localized date without year" do
+ date = Date.civil(Date.today.year, 10, 19)
+
+ @product.released_on = '19. Okt'
assert_equal date, @product.released_on
end | extracted test of delocalization of dates without year: was expecting <I> | clemens_delocalize | train | rb |
a6144190aade72495b7cc26a6ecfaa252cd9b9dd | diff --git a/pyinfra/modules/pacman.py b/pyinfra/modules/pacman.py
index <HASH>..<HASH> 100644
--- a/pyinfra/modules/pacman.py
+++ b/pyinfra/modules/pacman.py
@@ -13,7 +13,7 @@ def upgrade(state, host):
Upgrades all pacman packages.
'''
- yield 'pacman -Syu'
+ yield 'pacman --noconfirm -Su'
_upgrade = upgrade # noqa: E305
@@ -55,6 +55,6 @@ def packages(
yield ensure_packages(
packages, host.fact.pacman_packages, present,
- install_command='pacman -S',
- uninstall_command='pacman -R',
+ install_command='pacman --noconfirm -S',
+ uninstall_command='pacman --noconfirm -R',
) | Add `--noconfirm` to pacman commands. | Fizzadar_pyinfra | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.