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
ff8d9c7e4373f4f66c61f8a9514e892c0b25d368
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -507,7 +507,7 @@ module ActiveRecord raise NotImplementedError, "change_column_default is not implemented" end - # Sets or removes a +NOT NULL+ constraint on a column. The +null+ flag + # Sets or removes a <tt>NOT NULL</tt> constraint on a column. The +null+ flag # indicates whether the value can be +NULL+. For example # # change_column_null(:users, :nickname, false) @@ -519,7 +519,7 @@ module ActiveRecord # allows them to be +NULL+ (drops the constraint). # # The method accepts an optional fourth argument to replace existing - # +NULL+s with some other value. Use that one when enabling the + # <tt>NULL</tt>s with some other value. Use that one when enabling the # constraint if needed, since otherwise those rows would not be valid. # # Please note the fourth argument does not set a column's default.
Fix proper fonts in `change_column_null` method docs. [ci skip]
rails_rails
train
rb
1726c2212aac60f84860ecfd463aefdab996db58
diff --git a/Builder/FormContractor.php b/Builder/FormContractor.php index <HASH>..<HASH> 100644 --- a/Builder/FormContractor.php +++ b/Builder/FormContractor.php @@ -115,8 +115,9 @@ class FormContractor implements FormContractorInterface } } else if ($type == 'sonata_type_admin') { - // nothing here ... - + if (!$fieldDescription->getAssociationAdmin()) { + throw new \RuntimeException(sprintf('The current field `%s` is not linked to an admin. Please create one for the target entity : `%s`', $fieldDescription->getName(), $fieldDescription->getTargetEntity())); + } } else if ($type == 'sonata_type_collection') { throw new \RuntimeException('Type "sonata_type_collection" is not yet implemented.');
Exception for sonata_type_admin field without associated admin
sonata-project_SonataDoctrineMongoDBAdminBundle
train
php
50e3265b60a2be643f3d08c2e8b6098eeceba27f
diff --git a/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/ConsulDiscoveryClientCustomizedTests.java b/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/ConsulDiscoveryClientCustomizedTests.java index <HASH>..<HASH> 100644 --- a/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/ConsulDiscoveryClientCustomizedTests.java +++ b/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/ConsulDiscoveryClientCustomizedTests.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertNotNull; import java.util.List; +import org.apache.http.conn.util.InetAddressUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -57,7 +58,7 @@ public class ConsulDiscoveryClientCustomizedTests { } private void assertNotIpAddress(ServiceInstance instance) { - assertFalse("host is an ip address", Character.isDigit(instance.getHost().charAt(0))); + assertFalse("host is an ip address", InetAddressUtils.isIPv4Address(instance.getHost())); } @Test
fix tests if consul when docker with consul are used
spring-cloud_spring-cloud-consul
train
java
4693aeb8d08877253f4b11c9493eba9ff7a48a5d
diff --git a/code/GridFieldExtensions.php b/code/GridFieldExtensions.php index <HASH>..<HASH> 100644 --- a/code/GridFieldExtensions.php +++ b/code/GridFieldExtensions.php @@ -5,8 +5,13 @@ class GridFieldExtensions { public static function include_requirements() { - Requirements::css('gridfieldextensions/css/GridFieldExtensions.css'); - Requirements::javascript('gridfieldextensions/javascript/GridFieldExtensions.js'); + $moduleDir = self::get_module_dir(); + Requirements::css($moduleDir.'/css/GridFieldExtensions.css'); + Requirements::javascript($moduleDir.'/javascript/GridFieldExtensions.js'); + } + + public static function get_module_dir() { + return basename(dirname(__DIR__)); } }
Fix - Support for module to be named other than "gridfieldextensions"
symbiote_silverstripe-gridfieldextensions
train
php
24dfedb0fd54827fd46aa4335c564fcdc16a2529
diff --git a/lib/util/url.js b/lib/util/url.js index <HASH>..<HASH> 100644 --- a/lib/util/url.js +++ b/lib/util/url.js @@ -2,7 +2,7 @@ var isWindows = /^win/.test(process.platform), forwardSlashPattern = /\//g, - protocolPattern = /^([a-z0-9.+-]+):\/\//i, + protocolPattern = /^(\w{2,}):\/\//i, url = module.exports; // RegExp patterns to URL-encode special characters in local filesystem paths
Fixed a bug that caused absolute paths on Windows to incorrectly be mistaken for URLs. See <URL>
APIDevTools_json-schema-ref-parser
train
js
f6b9149d5479cab13b8f23a95df074412458af69
diff --git a/app/assets/javascripts/caboose/model/attribute.js b/app/assets/javascripts/caboose/model/attribute.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/caboose/model/attribute.js +++ b/app/assets/javascripts/caboose/model/attribute.js @@ -15,6 +15,7 @@ Attribute.prototype = { empty_text: 'empty', fixed_placeholder: true, align: 'left', + after_update: false, update_url: false, options_url: false, @@ -35,6 +36,7 @@ Attribute.prototype = { this2.value_clean = this2.value; } if (after) after(resp); + if (this2.after_update) this2.after_update(); }, error: function() { if (after) after(false); diff --git a/app/assets/javascripts/caboose/model/bound_text.js b/app/assets/javascripts/caboose/model/bound_text.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/caboose/model/bound_text.js +++ b/app/assets/javascripts/caboose/model/bound_text.js @@ -59,6 +59,7 @@ BoundText = BoundControl.extend({ this.show_loader(); var this2 = this; + this.model.save(this.attribute, function(resp) { this2.save_attempts = 0; if (resp.error)
Added after_update hook in model js
williambarry007_caboose-cms
train
js,js
f5c30fbfc1eece67b37f8301f327fbd14f037787
diff --git a/gosu-core/src/main/java/gw/internal/gosu/parser/ClassJavaClassInfo.java b/gosu-core/src/main/java/gw/internal/gosu/parser/ClassJavaClassInfo.java index <HASH>..<HASH> 100644 --- a/gosu-core/src/main/java/gw/internal/gosu/parser/ClassJavaClassInfo.java +++ b/gosu-core/src/main/java/gw/internal/gosu/parser/ClassJavaClassInfo.java @@ -68,6 +68,7 @@ public class ClassJavaClassInfo extends TypeJavaClassType implements IClassJavaC private String _namespace; private volatile Integer _modifiers; private Boolean _bArray; + private Boolean _bEnum; private Boolean _bInterface; private LocklessLazyVar<IType> _enclosingClass = new LocklessLazyVar<IType>() { protected IType init() { @@ -369,7 +370,7 @@ public class ClassJavaClassInfo extends TypeJavaClassType implements IClassJavaC @Override public boolean isEnum() { - return _class.isEnum(); + return _bEnum == null ? _bEnum = _class.isEnum() : _bEnum; } @Override
perf: cache "enum" modifier, otherwise expensive making native call to Class#isEnum()
gosu-lang_gosu-lang
train
java
5ebcc70dc949ef3a4d7c6997ac719c4ee4d1ea9c
diff --git a/src/main/java/org/dynjs/parser/ast/ArrayLiteralExpression.java b/src/main/java/org/dynjs/parser/ast/ArrayLiteralExpression.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dynjs/parser/ast/ArrayLiteralExpression.java +++ b/src/main/java/org/dynjs/parser/ast/ArrayLiteralExpression.java @@ -49,7 +49,9 @@ public class ArrayLiteralExpression extends AbstractExpression { if (!first) { buf.append(", "); } - buf.append(each.toString()); + if (each != null) { + buf.append(each.toString()); + } } buf.append("]"); return buf.toString();
Avoid NPE when toString'ing arrays with elided items.
dynjs_dynjs
train
java
b240dbda623ce84723bfffa9420f98271f15282f
diff --git a/lib/d3.js b/lib/d3.js index <HASH>..<HASH> 100644 --- a/lib/d3.js +++ b/lib/d3.js @@ -1,4 +1,2 @@ // Stub to get D3 either via NPM or from the global object -var d3; -try { d3 = require("d3"); } catch (e) { d3 = window.d3; } -module.exports = d3; +module.exports = window.d3;
Force getting d3 from the window global
dagrejs_dagre-d3
train
js
487701b1e2e87cb1a6e72043eaba7a0229439c2c
diff --git a/claripy/vsa/valueset.py b/claripy/vsa/valueset.py index <HASH>..<HASH> 100644 --- a/claripy/vsa/valueset.py +++ b/claripy/vsa/valueset.py @@ -19,6 +19,8 @@ class ValueSet(object): def __init__(self, region=None, bits=None, val=None): self._si_dict = {} + self._reversed = False + if region is not None and bits is not None and val is not None: self.set_si(region, StridedInterval(bits=bits, stride=0, lower_bound=val, upper_bound=val)) @@ -35,6 +37,9 @@ class ValueSet(object): def items(self): return self._si_dict.items() + def size(self): + return len(self) + @normalize_types def merge_si(self, region, si): if region not in self._si_dict: @@ -87,6 +92,20 @@ class ValueSet(object): return new_vs + def copy(self): + vs = ValueSet() + vs._si_dict = self._si_dict.copy() + vs._reversed = self._reversed + + return vs + + def reverse(self): + vs = self.copy() + + vs._reversed = not vs._reversed + + return vs + def is_empty(self): return (len(self._si_dict) == 0)
added size() and reverse() to ValueSet.
angr_claripy
train
py
7b0ade6368575f312185b09c02a6cb3f5984b822
diff --git a/src/main/java/com/github/terma/gigaspacesqlconsole/Counts.java b/src/main/java/com/github/terma/gigaspacesqlconsole/Counts.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/terma/gigaspacesqlconsole/Counts.java +++ b/src/main/java/com/github/terma/gigaspacesqlconsole/Counts.java @@ -99,7 +99,7 @@ public class Counts { item = new CacheItem(); item.admin = admin; item.space = space; - item.lastUsage = -1; + cache.put(request, item); } // update last usage
Fix GigaSpace admin cache for counts
terma_gigaspace-web-console
train
java
246b5558b6617dc40df4a8bd60da35442cdaab05
diff --git a/src/server/pps/server/api_server.go b/src/server/pps/server/api_server.go index <HASH>..<HASH> 100644 --- a/src/server/pps/server/api_server.go +++ b/src/server/pps/server/api_server.go @@ -1792,6 +1792,17 @@ func (a *apiServer) runPipeline(ctx context.Context, pipelineInfo *ppsclient.Pip if len(rawInputs) < len(rawInputRepos) { continue } + outCommitInfos, err := pfsAPIClient.ListCommit(ctx, &pfsclient.ListCommitRequest{ + Include: []*pfsclient.Commit{client.NewCommit(ppsserver.PipelineRepo(pipelineInfo.Pipeline).Name, "")}, + Provenance: rawInputs, + }) + if err != nil { + return err + } + if len(outCommitInfos.CommitInfo) > 0 { + // we've already processed this commit + continue + } trueInputs, err := a.trueInputs(ctx, rawInputs, pipelineInfo) if err != nil { if isCommitCancelledErr(err) {
Skip commits if we've already processed.
pachyderm_pachyderm
train
go
82470a723c4e64e4aa48f053e81843fed29d3e46
diff --git a/ghost/admin/app/helpers/currency-symbol.js b/ghost/admin/app/helpers/currency-symbol.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/helpers/currency-symbol.js +++ b/ghost/admin/app/helpers/currency-symbol.js @@ -6,6 +6,9 @@ export default class CurrencySymbolHelper extends Helper { @service feature; compute([currency]) { - return getSymbol(currency); + if (currency) { + return getSymbol(currency); + } + return ''; } }
Added guard for missing currency in currency symbol helper no refs
TryGhost_Ghost
train
js
13a5492c51bb40778711e86a911ea53ebfdf5bef
diff --git a/spec/by_star/by_fortnight_spec.rb b/spec/by_star/by_fortnight_spec.rb index <HASH>..<HASH> 100644 --- a/spec/by_star/by_fortnight_spec.rb +++ b/spec/by_star/by_fortnight_spec.rb @@ -25,8 +25,7 @@ describe "by fortnight" do end it "should be able to find posts for a fortnight ago" do - p find_posts(2.weeks.ago).to_sql - posts_count(2.weeks.ago).should eql(0) + posts_count(2.weeks.ago).should eql(3) end it "should be able to find posts if given a Date object" do
Posts from 2 weeks ago using by_fortnight are numbered three
radar_by_star
train
rb
73f8658c36f4d8e22b60f53f3b859a3c5234a659
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -473,7 +473,12 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL) { /// $format is one of the format constants, defined above switch ($format) { - case FORMAT_MOODLE: + case FORMAT_HTML: + $text = replace_smilies($text); + return $text; + break; + + default: // FORMAT_MOODLE or anything else if (!isset($options->smiley)) { $options->smiley=true; } @@ -482,11 +487,6 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL) { } return text_to_html($text, $options->smiley, $options->para); break; - - case FORMAT_HTML: - $text = replace_smilies($text); - return $text; - break; } }
Provide the possibility that the format of a text is not defined properly
moodle_moodle
train
php
e4da0a11151f4e37d78ce0f33ad9bb93a0a497af
diff --git a/flask_jwt_extended/utils.py b/flask_jwt_extended/utils.py index <HASH>..<HASH> 100644 --- a/flask_jwt_extended/utils.py +++ b/flask_jwt_extended/utils.py @@ -11,7 +11,7 @@ from flask_jwt_extended.config import config from flask_jwt_extended.internal_utils import get_jwt_manager # Proxy to access the current user -current_user = LocalProxy(lambda: get_current_user()) +current_user: Any = LocalProxy(lambda: get_current_user()) def get_jwt() -> dict:
Fix mypy errors with current_user (fixes #<I>)
vimalloc_flask-jwt-extended
train
py
e7e6dfc3e6e431aa7ffe581139ef25e19b8db0c5
diff --git a/core/server/index.js b/core/server/index.js index <HASH>..<HASH> 100644 --- a/core/server/index.js +++ b/core/server/index.js @@ -133,7 +133,7 @@ function ghostStartMessages() { ); // ensure that Ghost exits correctly on Ctrl+C - process.on('SIGINT', function () { + process.removeAllListeners('SIGINT').on('SIGINT', function () { console.log( "\nGhost has shut down".red, "\nYour blog is now offline" @@ -150,7 +150,7 @@ function ghostStartMessages() { "\nCtrl+C to shut down".grey ); // ensure that Ghost exits correctly on Ctrl+C - process.on('SIGINT', function () { + process.removeAllListeners('SIGINT').on('SIGINT', function () { console.log( "\nGhost has shutdown".red, "\nGhost was running for",
Clear any existing SIGINT listeners during startup No issue -remove any existing listeners on the SIGINT event during the ghost bootstrap process. handles an issue during testing where node was warning about too many listeners.
TryGhost_Ghost
train
js
e90d5c810c6ec2f1a386862a11480af0d9a13430
diff --git a/lib/implementation.js b/lib/implementation.js index <HASH>..<HASH> 100644 --- a/lib/implementation.js +++ b/lib/implementation.js @@ -372,7 +372,7 @@ module.exports = function(self, options) { } } } - ]).toArray(); + ], { allowDiskUse: true }).toArray(); }) .then(function(groups) { return Promise.mapSeries(groups, function(group) {
Handle workflowGuid index with many documents
apostrophecms_apostrophe-workflow
train
js
8d3894e9626392133b7ca18db4ad4baf149ea8be
diff --git a/lib/neek.js b/lib/neek.js index <HASH>..<HASH> 100644 --- a/lib/neek.js +++ b/lib/neek.js @@ -67,5 +67,5 @@ function isWriteStream(obj) { } function isStream(obj) { - return obj && typeof obj.pipe === 'function'; + return obj && (typeof obj.pipe === 'function' || typeof(obj) === 'string'); }
Add back 'string' check to allow for neek streams to be created just using string filenames
whitfin_neek
train
js
03f3d7d7eecb73d36ce46f33c260ae4f181fa8a2
diff --git a/src/Illuminate/Console/Command.php b/src/Illuminate/Console/Command.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Console/Command.php +++ b/src/Illuminate/Console/Command.php @@ -121,7 +121,7 @@ class Command extends SymfonyCommand { list($name, $arguments, $options) = Parser::parse($this->signature); - parent::__construct($name); + parent::__construct($this->name = $name); // After parsing the signature we will spin through the arguments and options // and set them on this command. These will already be changed into proper
Set $name in Console\Command because Symfony subclass $name is private for some reason. (#<I>)
laravel_framework
train
php
d2ceb7653edfb118dbfc97362574985faa2d1daa
diff --git a/src/vec2.js b/src/vec2.js index <HASH>..<HASH> 100644 --- a/src/vec2.js +++ b/src/vec2.js @@ -494,15 +494,7 @@ export function angle(a, b) { } let cosine = (x1 * x2 + y1 * y2) * len1 * len2; - - if(cosine > 1.0) { - return 0; - } - else if(cosine < -1.0) { - return Math.PI; - } else { - return Math.acos(cosine); - } + return Math.acos(cosine); } /**
Remove unreachable code from vec2.angle Because you're always calculating the inner angle cosine will never be greater than 1 or less than -1. The if statements could be updated with >= and <= to be reachable, but performance is better without the conditional branches.
toji_gl-matrix
train
js
f028a004adf955115cf87354a045350d7d147b3e
diff --git a/tests/unit/utils/warnings_test.py b/tests/unit/utils/warnings_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/utils/warnings_test.py +++ b/tests/unit/utils/warnings_test.py @@ -63,8 +63,8 @@ class WarnUntilTestCase(TestCase): RuntimeError, r'The warning triggered on filename \'(.*)warnings_test.py\', ' r'line number ([\d]+), is supposed to be shown until version ' - r'\'0.17\' is released. Current version is now \'0.17\'. Please ' - r'remove the warning.'): + r'\'0.17.0\' is released. Current version is now \'0.17.0\'. ' + r'Please remove the warning.'): raise_warning() # Even though we're calling warn_until, we pass _dont_call_warnings @@ -73,8 +73,8 @@ class WarnUntilTestCase(TestCase): RuntimeError, r'The warning triggered on filename \'(.*)warnings_test.py\', ' r'line number ([\d]+), is supposed to be shown until version ' - r'\'0.17\' is released. Current version is now \'0.17\'. Please ' - r'remove the warning.'): + r'\'0.17.0\' is released. Current version is now \'0.17.0\'. ' + r'Please remove the warning.'): warn_until( (0, 17), 'Foo', _dont_call_warnings=True )
Fix the warnings unit test. Since the `warn_until` function now parses and instantiates a `SaltStackVersion`, the `bugfix` part of the version info is always shown.
saltstack_salt
train
py
a5a08b8003a19af18a0a558fc1196654e357e2ae
diff --git a/lib/bibclassify_model.py b/lib/bibclassify_model.py index <HASH>..<HASH> 100644 --- a/lib/bibclassify_model.py +++ b/lib/bibclassify_model.py @@ -43,7 +43,7 @@ class ClsMETHOD(db.Model): description = db.Column(db.String(255), nullable=False, server_default='') last_updated = db.Column(db.DateTime, nullable=False, - server_default='0001-01-01 00:00:00') + server_default='1900-01-01 00:00:00') class CollectionClsMETHOD(db.Model):
installation: mysql default date value fix * Fixes problem while installing Invenio using fixtures where some dates were set with year=1, which is not accepted by mysql and this made the installation crash. Now, they are set to <I> which is the lowest value accepted by MySQL.
inveniosoftware-contrib_invenio-classifier
train
py
054a3027947eb50d192cc4050f5d9f6ea8dff01f
diff --git a/chef/lib/chef/search/query.rb b/chef/lib/chef/search/query.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/search/query.rb +++ b/chef/lib/chef/search/query.rb @@ -31,7 +31,7 @@ class Chef # Search Solr for objects of a given type, for a given query. If you give # it a block, it will handle the paging for you dynamically. - def search(type, query="*:*", sort=nil, start=0, rows=20, &block) + def search(type, query="*:*", sort='X_CHEF_id_CHEF_X asc', start=0, rows=1000, &block) raise ArgumentError, "Type must be a string or a symbol!" unless (type.kind_of?(String) || type.kind_of?(Symbol)) response = @rest.get_rest("search/#{type}?q=#{escape(query)}&sort=#{escape(sort)}&start=#{escape(start)}&rows=#{escape(rows)}")
apply the chef-<I> bandaid to the the other copy of the same code
chef_chef
train
rb
4bea24361a104b8caaf3ed850ce901e5576118b1
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDropClass.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDropClass.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDropClass.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLDropClass.java @@ -105,7 +105,8 @@ public class OCommandExecutorSQLDropClass extends OCommandExecutorSQLAbstract im @Override public long getDistributedTimeout() { if (className != null) - return 10 * getDatabase().countClass(className); + return OGlobalConfiguration.DISTRIBUTED_COMMAND_QUICK_TASK_SYNCH_TIMEOUT.getValueAsLong() + + (2 * getDatabase().countClass(className)); return OGlobalConfiguration.DISTRIBUTED_COMMAND_QUICK_TASK_SYNCH_TIMEOUT.getValueAsLong(); }
HA: fixed drop class variable timeout
orientechnologies_orientdb
train
java
0dcc862a5602677966d89c67c074a90c93a9e67d
diff --git a/_pytest/python.py b/_pytest/python.py index <HASH>..<HASH> 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1417,8 +1417,8 @@ class approx(object): If you're thinking about using ``approx``, then you might want to know how it compares to other good ways of comparing floating-point numbers. All of - these algorithms are based on relative and absolute tolerances, but they do - have meaningful differences: + these algorithms are based on relative and absolute tolerances and should + agree for the most part, but they do have meaningful differences: - ``math.isclose(a, b, rel_tol=1e-9, abs_tol=0.0)``: True if the relative tolerance is met w.r.t. either ``a`` or ``b`` or if the absolute @@ -1449,7 +1449,7 @@ class approx(object): __ https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual - ``a == pytest.approx(b, rel=1e-6, abs=1e-12)``: True if the relative - tolerance is met w.r.t. ``b`` or the if the absolute tolerance is met. + tolerance is met w.r.t. ``b`` or if the absolute tolerance is met. Because the relative tolerance is only calculated w.r.t. ``b``, this test is asymmetric and you can think of ``b`` as the reference value. In the special case that you explicitly specify an absolute tolerance but not a
Fix some typos in the documentation.
vmalloc_dessert
train
py
b628477af1226670eb2ef652106a9fe8df64dedb
diff --git a/lib/liquid/template.rb b/lib/liquid/template.rb index <HASH>..<HASH> 100644 --- a/lib/liquid/template.rb +++ b/lib/liquid/template.rb @@ -250,7 +250,7 @@ module Liquid def with_profiling if @profiling && !@options[:included] - raise "Profiler not loaded, require 'liquid/profiler' first" unless defined?(Profiler) + raise "Profiler not loaded, require 'liquid/profiler' first" unless defined?(Liquid::Profiler) @profiler = Profiler.new @profiler.start
Disambiguate checking if Liquid::Profiler is defined
Shopify_liquid
train
rb
08e3a5a969fe912e29bc84f759df617c027c365b
diff --git a/test/e2e/service.go b/test/e2e/service.go index <HASH>..<HASH> 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -256,6 +256,11 @@ var _ = Describe("Services", func() { }, 240.0) It("should be able to create a functioning external load balancer", func() { + if !providerIs("gce", "gke") { + By(fmt.Sprintf("Skipping service external load balancer test; uses createExternalLoadBalancer, a (gce|gke) feature")) + return + } + serviceName := "external-lb-test" ns := namespace0 labels := map[string]string{ @@ -347,6 +352,11 @@ var _ = Describe("Services", func() { }) It("should correctly serve identically named services in different namespaces on different external IP addresses", func() { + if !providerIs("gce", "gke") { + By(fmt.Sprintf("Skipping service namespace collision test; uses createExternalLoadBalancer, a (gce|gke) feature")) + return + } + serviceNames := []string{"s0"} // Could add more here, but then it takes longer. namespaces := []string{namespace0, namespace1} // As above. labels := map[string]string{
Add appropriate skips for E2Es that use createExternalLoadBalancer
kubernetes_kubernetes
train
go
34500d6d1fb7cafd43b16a5495400748e51be97c
diff --git a/runcommands/runners/remote.py b/runcommands/runners/remote.py index <HASH>..<HASH> 100644 --- a/runcommands/runners/remote.py +++ b/runcommands/runners/remote.py @@ -103,6 +103,8 @@ class RemoteRunner(Runner): channel.close() reset_stdin() except SSHException: + if debug: + raise raise RunError(-255, '', '', encoding) result_args = (return_code, out_buffer, err_buffer, encoding)
Improve handling of SSHException in RemoteRunner.run() When debugging, re-raise `SSHException`s so we can figure out what happened.
wylee_runcommands
train
py
efb6e4e11a6e133d464bbac116ba428adc030477
diff --git a/Kwc/Chained/Trl/GeneratorEvents/Table.php b/Kwc/Chained/Trl/GeneratorEvents/Table.php index <HASH>..<HASH> 100644 --- a/Kwc/Chained/Trl/GeneratorEvents/Table.php +++ b/Kwc/Chained/Trl/GeneratorEvents/Table.php @@ -97,9 +97,10 @@ class Kwc_Chained_Trl_GeneratorEvents_Table extends Kwc_Chained_Trl_GeneratorEve unset($dc['pos']); } if (isset($dc['component'])) { + $classes = $this->_getGenerator()->getChildComponentClasses(); foreach ($this->_getComponentsFromMasterRow($event->row, array('ignoreVisible'=>false)) as $c) { - $this->fireEvent(new Kwf_Component_Event_Component_RecursiveRemoved($this->_getClassFromMasterRow($event->row, true), $c)); - $this->fireEvent(new Kwf_Component_Event_Component_RecursiveAdded($this->_getClassFromMasterRow($event->row, false), $c)); + $this->fireEvent(new Kwf_Component_Event_Component_RecursiveRemoved($classes[$event->row->component], $c)); + $this->fireEvent(new Kwf_Component_Event_Component_RecursiveAdded($classes[$event->row->component], $c)); } unset($dc['component']); }
_getClassFromMasterRow function don't exists so the class for the master row is now searched in the generator
koala-framework_koala-framework
train
php
1e88318a20f1ad1762d561e5851434f4a5fa8383
diff --git a/src/Solidity.php b/src/Solidity.php index <HASH>..<HASH> 100644 --- a/src/Solidity.php +++ b/src/Solidity.php @@ -6,7 +6,7 @@ use BN\BN; final class Solidity { private const HASH_SIZE = 256; - private static function hex ($input): string { + public static function hex ($input): string { if ($input instanceof BN) { $input = $input->toString(); } elseif (is_bool($input)) { @@ -53,10 +53,4 @@ final class Solidity { $hex_glued = strtolower(implode('', $hex_array)); return '0x' . Keccak::hash(hex2bin($hex_glued), self::HASH_SIZE); } - - public static function sha256(...$args): string { - $hex_array = array_map(__CLASS__ . '::hex', $args); - $hex_glued = strtolower(implode('', $hex_array)); - return '0x' . hash('sha256', $hex_glued); - } }
make `hex()` public
kornrunner_php-solidity
train
php
a264f7a445abddeb7c71b1c9ded329fcc8cb8cd8
diff --git a/lxd/storage/drivers/driver_cephfs.go b/lxd/storage/drivers/driver_cephfs.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/driver_cephfs.go +++ b/lxd/storage/drivers/driver_cephfs.go @@ -987,3 +987,7 @@ func (d *cephfs) getConfig(clusterName string, userName string) ([]string, strin return cephMon, cephSecret, nil } + +func (d *cephfs) BackupVolume(vol Volume, targetPath string, optimized bool, snapshots bool, op *operations.Operation) error { + return ErrNotImplemented +}
lxd/storage/drivers/driver/cephfs: Adds BackupVolume placeholder
lxc_lxd
train
go
1723c1a2a066af19f13e201d092e7a36c48b10db
diff --git a/src/Two/GoogleProvider.php b/src/Two/GoogleProvider.php index <HASH>..<HASH> 100644 --- a/src/Two/GoogleProvider.php +++ b/src/Two/GoogleProvider.php @@ -19,9 +19,9 @@ class GoogleProvider extends AbstractProvider implements ProviderInterface * @var array */ protected $scopes = [ - 'https://www.googleapis.com/auth/plus.me', - 'https://www.googleapis.com/auth/plus.login', - 'https://www.googleapis.com/auth/plus.profile.emails.read', + 'openid', + 'profile', + 'email', ]; /**
Replaced G+ by OpenID in scopes No need to specify anything related to "Google +". Some Google Apps accounts may have it disabled or G+ may not be usefull for an account. I have checked the given changes for my own use (Google Apps) and they are working as expected (the mapping is correctly done).
laravel_socialite
train
php
661f31228c5185e51e9ceaffcb77953199ace955
diff --git a/docroot/modules/custom/ymca_groupex/src/Form/GroupexFormFull.php b/docroot/modules/custom/ymca_groupex/src/Form/GroupexFormFull.php index <HASH>..<HASH> 100644 --- a/docroot/modules/custom/ymca_groupex/src/Form/GroupexFormFull.php +++ b/docroot/modules/custom/ymca_groupex/src/Form/GroupexFormFull.php @@ -29,6 +29,8 @@ class GroupexFormFull extends GroupexFormBase { '#weight' => -100, ]; + $form['filter_length']['#description'] = t('Selecting more than one location limits your search to one day.'); + return $form; }
[YMCA-<I>] add text to group ex full form
ymcatwincities_openy
train
php
4cb91431559d487ed77d830e66ed0ef38e5d0435
diff --git a/landsat/__init__.py b/landsat/__init__.py index <HASH>..<HASH> 100644 --- a/landsat/__init__.py +++ b/landsat/__init__.py @@ -1 +1 @@ -__version__ = '0.10b1' +__version__ = '0.10b2'
bump up version to <I>b2
developmentseed_landsat-util
train
py
38b54b99104053be0833573c84cc2a545e17f995
diff --git a/src/Table.php b/src/Table.php index <HASH>..<HASH> 100644 --- a/src/Table.php +++ b/src/Table.php @@ -75,7 +75,7 @@ class Table extends BaseTable implements HasFieldsInterface } /** - * Set Table validation rules. + * Set Table validation rules if the validation is globally enabled. * * @param \Cake\Validation\Validator $validator Validator instance * @return \Cake\Validation\Validator @@ -84,9 +84,21 @@ class Table extends BaseTable implements HasFieldsInterface { // configurable in config/csv_migrations.php if (! Configure::read('CsvMigrations.tableValidation')) { + return $validator; } + return $this->validationEnabled($validator); + } + + /** + * Set Table validation rules. + * + * @param \Cake\Validation\Validator $validator Validator instance + * @return \Cake\Validation\Validator + */ + public function validationEnabled(Validator $validator) : Validator + { $className = App::shortName(get_class($this), 'Model/Table', 'Table'); $config = (new ModuleConfig(ConfigType::MIGRATION(), $className))->parse(); $config = json_encode($config);
Add validator which bypasses enabled check (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
dcbd8500645369f6a63f9b6f57867ef66b32bdc8
diff --git a/controllers/socket/lobbyHandlers.go b/controllers/socket/lobbyHandlers.go index <HASH>..<HASH> 100644 --- a/controllers/socket/lobbyHandlers.go +++ b/controllers/socket/lobbyHandlers.go @@ -336,6 +336,7 @@ func lobbyKickHandler(so socketio.Socket) func(string) string { } chelpers.AfterLobbyLeave(so, lob, player) + so.Emit("lobbyData", "{}") bytes, _ := chelpers.BuildSuccessJSON(simplejson.New()).Encode() return string(bytes) })
lobbyKickHandler(): Send {} as lobbyData once kicked.
TF2Stadium_Helen
train
go
6d135af2e1d3058c382f059705f9e7373cc4aa67
diff --git a/simuvex/plugins/unicorn_engine.py b/simuvex/plugins/unicorn_engine.py index <HASH>..<HASH> 100644 --- a/simuvex/plugins/unicorn_engine.py +++ b/simuvex/plugins/unicorn_engine.py @@ -1156,6 +1156,9 @@ class Unicorn(SimStatePlugin): self.countdown_symbolic_registers -= 1 self.countdown_symbolic_memory -= 1 + if self.state.regs.ip.symbolic: + l.info("symbolic IP!") + return False if self.countdown_symbolic_registers > 0: l.info("not enough blocks since symbolic registers (%d more)", self.countdown_symbolic_registers) return False
don't jump into unicorn on a symbolic IP
angr_angr
train
py
699c128373e1a0ca1e87907856665457d5db99f2
diff --git a/test/transforms/processImages.js b/test/transforms/processImages.js index <HASH>..<HASH> 100644 --- a/test/transforms/processImages.js +++ b/test/transforms/processImages.js @@ -318,13 +318,7 @@ describe('processImages', function() { } ]; - expect( - assetGraph.findAssets({ isImage: true }), - 'to be an array whose items satisfy', - function(img, idx) { - expect(img, 'to satisfy', outputs[idx]); - } - ); + expect(assetGraph.findAssets({ isImage: true }), 'to satisfy', outputs); }); });
Fix test so it works with Unexpected <I>
assetgraph_assetgraph-builder
train
js
2b19fe874d9e171c7ab5218034739887406c8230
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -38,21 +38,19 @@ module.exports = function(options, allDone) { var endpoints = _.map(components, function(component) { return component.endpoint.name; }); bower.commands.install(endpoints, {save: true, forceLatest: true}, bowerConfig) .on('end', function(installed) { - installed = _.map(installed, function(component) { - var name = component.pkgMeta.name; - var deps = data.dependencies[name]; - if (deps) { - return { + var updated = []; + _.each(installed, function(component) { + var name = component.endpoint.name; + var meta = data.dependencies[name]; + if (meta) { + updated.push({ name: name, - now: component.pkgMeta.version, - then: deps.update.target - }; - } - else { - return null; + now: meta.update.latest, + then: meta.update.target + }); } }); - done(null, installed); + done(null, updated); }) ; };
Fix display of number of updated components and latest version.
sapegin_bower-update
train
js
87cb8b3c8970040ddcb30cfdfc4de7bd5f1d8e37
diff --git a/src/main/menu.js b/src/main/menu.js index <HASH>..<HASH> 100644 --- a/src/main/menu.js +++ b/src/main/menu.js @@ -126,7 +126,6 @@ export const cell = { submenu: [ { label: 'Run All', - accelerator: 'Cmd+E', click: createSender('menu:run-all') }, ],
Don't set a keyboard shortcut for run all yet
nteract_nteract
train
js
8d8ac86049d0f82d5776bf82cfc114859bb200a0
diff --git a/core/src/main/java/io/minecloud/db/redis/RedisDatabase.java b/core/src/main/java/io/minecloud/db/redis/RedisDatabase.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/minecloud/db/redis/RedisDatabase.java +++ b/core/src/main/java/io/minecloud/db/redis/RedisDatabase.java @@ -87,18 +87,14 @@ public final class RedisDatabase implements Database { public boolean connected() { boolean connection; - Jedis jedis = null; - try { - jedis = grabResource(); - connection = true; + try (Jedis jedis = grabResource()) { + return true; } catch (JedisConnectionException e) { MineCloud.logger().warning("Redis connection had died, reconnecting."); connection = false; - this.setup(); //This should work, right? + this.setup(); //This should work, right? + // No, it returns the old resource to the new pool } - - this.pool.returnResource(jedis); - return connection; } }
Switch to try-with-resources This way, we won't be returning objects from the old pool to the new pool
mkotb_MineCloud
train
java
f8cad6ce6c1b7ecaee81ac45e14eee6ee346075a
diff --git a/shinken/modulesmanager.py b/shinken/modulesmanager.py index <HASH>..<HASH> 100644 --- a/shinken/modulesmanager.py +++ b/shinken/modulesmanager.py @@ -93,7 +93,7 @@ class ModulesManager(object): try: mod = importlib.import_module('.module', mod_name) - except ImportError as err: + except Exception as err: logger.warning('Cannot load %s as a package (%s), trying as module..', mod_name, err) load_it = (
Fix : Catch all exception on the first import try. Need to get a real exception list.
Alignak-monitoring_alignak
train
py
3b9e6e96fb02e95614bae1a54d435d3ac6831fa5
diff --git a/src/main/java/org/lastaflute/di/core/creator/AssistCreator.java b/src/main/java/org/lastaflute/di/core/creator/AssistCreator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/lastaflute/di/core/creator/AssistCreator.java +++ b/src/main/java/org/lastaflute/di/core/creator/AssistCreator.java @@ -30,11 +30,11 @@ public class AssistCreator extends ComponentCreatorImpl { setInstanceDef(InstanceDefFactory.PROTOTYPE); } - public ComponentCustomizer getHelperCustomizer() { + public ComponentCustomizer getAssistCustomizer() { return getCustomizer(); } - public void setHelperCustomizer(ComponentCustomizer customizer) { + public void setAssistCustomizer(ComponentCustomizer customizer) { setCustomizer(customizer); } } \ No newline at end of file
fix name, Helper to Assist
lastaflute_lasta-di
train
java
96f9311afbf190f80d4248c8152a9391f51ade1a
diff --git a/lib/featuresLoader.js b/lib/featuresLoader.js index <HASH>..<HASH> 100644 --- a/lib/featuresLoader.js +++ b/lib/featuresLoader.js @@ -59,7 +59,7 @@ const createCucumber = ( .join("\n")} `; -module.exports = function(_, filePath) { +module.exports = function(_, filePath = this.resourcePath) { log("compiling", filePath); const features = glob.sync(`${path.dirname(filePath)}/**/*.feature`);
feat(featuresloader): allow to use featuresLoader with Webpack
TheBrainFamily_cypress-cucumber-preprocessor
train
js
d9234e374d394971176709bdd4dee31b9b0b47ae
diff --git a/lib/util.js b/lib/util.js index <HASH>..<HASH> 100644 --- a/lib/util.js +++ b/lib/util.js @@ -36,7 +36,9 @@ function forcelink(src, dest, options, callback) { if (!options || !options.cache) throw new Error('options.cache not defined!'); if (!callback) throw new Error('callback not defined!'); // uses relative path if linking to cache dir - src = path.relative(options.cache, dest).slice(0, 2) !== '..' ? path.relative(path.dirname(dest), src) : src; + if (path.relative) { + src = path.relative(options.cache, dest).slice(0, 2) !== '..' ? path.relative(path.dirname(dest), src) : src; + } fs.lstat(dest, function(err, stat) { // Error. if (err && err.code !== 'ENOENT')
only try to relativize paths if node's path.relative function exists (node >= <I>) - closes #<I> and #<I>
tilemill-project_millstone
train
js
ba7d872199c140adacd28fd508f18213fb7c468c
diff --git a/src/org/openscience/cdk/test/io/cml/CMLIOTests.java b/src/org/openscience/cdk/test/io/cml/CMLIOTests.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/test/io/cml/CMLIOTests.java +++ b/src/org/openscience/cdk/test/io/cml/CMLIOTests.java @@ -47,9 +47,9 @@ public class CMLIOTests { suite.addTest(CMLFragmentsTest.suite()); suite.addTest(Jumbo46CMLFragmentsTest.suite()); - // the following classes require Java 1.4 - if (System.getProperty("java.version").startsWith("1.4")) { - System.out.println("Found required Java 1.4, so running CML2 tests."); + // the following classes require Java 1.5 + if (System.getProperty("java.version").startsWith("1.5")) { + System.out.println("Found required Java 1.5, so running the CML2 tests."); try { Class testClass = suite.getClass().getClassLoader().loadClass("org.openscience.cdk.test.io.cml.CML2Test"); suite.addTest(new TestSuite(testClass)); @@ -74,6 +74,8 @@ public class CMLIOTests { System.out.println("Could not load the CML Roundtrip test: " + exception.getMessage()); exception.printStackTrace(); } + } else { + System.out.println("Did not find the required Java 1.5, so not running the CML2 tests."); } return suite; }
Running tests if Java<I> is found, and also give feedback if the tests are not run. git-svn-id: <URL>
cdk_cdk
train
java
6201786da3000cc3f0fdd14652613d9a5791fc04
diff --git a/photutils/aperture.py b/photutils/aperture.py index <HASH>..<HASH> 100644 --- a/photutils/aperture.py +++ b/photutils/aperture.py @@ -324,9 +324,9 @@ class RectangularAperture(Aperture): Parameters ---------- w : float - The full width of the aperture (at `theta`=0, this is the "x" axis). + The full width of the aperture (at `theta` = 0, this is the "x" axis). h : float - The full height of the aperture (at `theta`=0, this is the "y" axis). + The full height of the aperture (at `theta` = 0, this is the "y" axis). theta : float The position angle of the semimajor axis in radians (counterclockwise).
fix for doc warnings due to RectangularAperture
astropy_photutils
train
py
9c38c261005119758dd776ceef57bb1f4b8de7fa
diff --git a/test/test_pghoard.py b/test/test_pghoard.py index <HASH>..<HASH> 100644 --- a/test/test_pghoard.py +++ b/test/test_pghoard.py @@ -747,6 +747,10 @@ class TestPGHoardWithPG: if pghoard.receivexlogs[pghoard.test_site].is_alive(): pghoard.receivexlogs[pghoard.test_site].join() del pghoard.receivexlogs[pghoard.test_site] + # stopping the thread is not enough, it's possible that killed receiver will leave incomplete partial files + # around, pghoard is capable of cleaning those up but needs to be restarted, for the test it should be OK + # just to call startup_walk_for_missed_files, so it takes care of cleaning up + pghoard.startup_walk_for_missed_files() n_xlogs = pghoard.transfer_agent_state[pghoard.test_site]["upload"]["xlog"]["xlogs_since_basebackup"]
Fix for receivewal hickup test When test stops receivexlogs thread, the subprocess of receivexlog after being killed might leave incomplete .partial files, which make the restarted receivexlog stop working. Usually those incomplete files are truncated by pghoard after restart, so this workaround should just make test less flaky. Ideally the receivexlogs thread should do that cleanup in case of this kind of problems.
aiven_pghoard
train
py
4a4469817c418773509141e5dae095dfdca2e3c7
diff --git a/esgfpid/rabbit/asynchronous/thread_builder.py b/esgfpid/rabbit/asynchronous/thread_builder.py index <HASH>..<HASH> 100644 --- a/esgfpid/rabbit/asynchronous/thread_builder.py +++ b/esgfpid/rabbit/asynchronous/thread_builder.py @@ -92,8 +92,9 @@ class ConnectionBuilder(object): logdebug(LOGGER_IOLOOP, 'Connection is ready. Ioloop about to be started.', show=True) self.thread._connection.ioloop.start() return True - except pika.exceptions.ProbableAuthenticationError: # TODO - logerror(LOGGER_IOLOOP, 'Caught Authentication Exception.') + except pika.exceptions.ProbableAuthenticationError as e: # TODO + LOGGER_IOLOOP.exception('Error when creating ioloop: '+e.message) + logerror(LOGGER_IOLOOP, 'Caught Authentication Exception: '+e.message) return True # If we return False, it will reconnect! except Exception as e: # TODO logerror(LOGGER_IOLOOP, 'Unexpected error: '+str(e.message))
More information is logged on AuthenticationException at Rabbit.
IS-ENES-Data_esgf-pid
train
py
6afbf3375df4c151c2ec8fa9f96ccc2a8ae7e781
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/type/mount.rb +++ b/lib/puppet/type/mount.rb @@ -168,11 +168,12 @@ module Puppet end newproperty(:options) do - desc "Mount options for the mounts, as they would - appear in the fstab." + desc "A single string containing options for the mount, as they would + appear in fstab. For many platforms this is a comma delimited string. + Consult the fstab(5) man page for system-specific details." validate do |value| - raise Puppet::Error, "option must not contain whitespace: #{value}" if value =~ /\s/ + raise Puppet::Error, "options must not contain whitespace: #{value}" if value =~ /\s/ end end
(PUP-<I>) Clarify docstring for mount options The docstring for the `options` parameter of the mount Type did not clarify that the parameter value should be a single string. Also noted that many operating systems use a comma-delimited list.
puppetlabs_puppet
train
rb
65d78e05cb5b4ddb04ef93e85a95efe92ae09988
diff --git a/src/core/services/gesture/gesture.js b/src/core/services/gesture/gesture.js index <HASH>..<HASH> 100644 --- a/src/core/services/gesture/gesture.js +++ b/src/core/services/gesture/gesture.js @@ -5,7 +5,8 @@ var HANDLERS = {}; * It contains normalized x and y coordinates from DOM events, * as well as other information abstracted from the DOM. */ -var pointer, lastPointer, forceSkipClickHijack = false, maxClickDistance = 6; +var pointer, lastPointer, maxClickDistance = 6; +var forceSkipClickHijack = false, disableAllGestures = false; /** * The position of the most recent click if that click was on a label element. @@ -57,6 +58,18 @@ function MdGestureProvider() { } MdGestureProvider.prototype = { + /** + * @ngdoc method + * @name $mdGestureProvider#disableAll + * + * @description + * Disable all gesture detection. This can be beneficial to application performance + * and memory usage. + */ + disableAll: function () { + disableAllGestures = true; + }, + // Publish access to setter to configure a variable BEFORE the // $mdGesture service is instantiated... /** @@ -531,6 +544,9 @@ function MdGestureHandler() { * @ngInject */ function attachToDocument( $mdGesture, $$MdGestureHandler ) { + if (disableAllGestures) { + return; + } // Polyfill document.contains for IE11. // TODO: move to util
feat(gestures): add ability to disable all gestures for perf (#<I>) Fixes #<I>. Relates to #<I>.
angular_material
train
js
3c822d8f0c4a0938fd6ec79dc9f3d044e0760121
diff --git a/lib/rfd.rb b/lib/rfd.rb index <HASH>..<HASH> 100644 --- a/lib/rfd.rb +++ b/lib/rfd.rb @@ -175,12 +175,10 @@ module Rfd cd_into_zip dir else target = expand_path dir - if File.readable? target - Dir.chdir target - @dir_history << current_dir if current_dir && pushd - @current_dir, @current_page, @current_row, @current_zip = target, 0, nil, nil - main.activate_pane 0 - end + Dir.chdir target + @dir_history << current_dir if current_dir && pushd + @current_dir, @current_page, @current_row, @current_zip = target, 0, nil, nil + main.activate_pane 0 end end
No need to check permission before cding The system would return a comprehensive error in such case.
amatsuda_rfd
train
rb
b056fe0c47cadd1e5e8a48f23a528948a353cefe
diff --git a/art/art.py b/art/art.py index <HASH>..<HASH> 100644 --- a/art/art.py +++ b/art/art.py @@ -483,8 +483,7 @@ def text2art(text, font=DEFAULT_FONT, decoration=None, chr_ignore=True): word_list = text_temp.split("\n") result = "" if decoration is not None: - decoration = indirect_decoration(decoration) - result += DECORATIONS_MAP[decoration] + result += decor(decoration) for word in word_list: if len(word) != 0: result = result + __word2art(word=word, @@ -492,7 +491,7 @@ def text2art(text, font=DEFAULT_FONT, decoration=None, chr_ignore=True): chr_ignore=chr_ignore, letters=letters) if decoration is not None: - result = result.strip() + DECORATIONS_MAP[decoration][::-1] + result = result.strip() + decor(decoration, reversed=True) return result
add : minor use of decor fucntion added.
sepandhaghighi_art
train
py
ac08e369b217543900d9dfae11f42ec4cc9ddbb2
diff --git a/src/main/java/org/wso2/carbon/transport/http/netty/internal/config/ListenerConfiguration.java b/src/main/java/org/wso2/carbon/transport/http/netty/internal/config/ListenerConfiguration.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/wso2/carbon/transport/http/netty/internal/config/ListenerConfiguration.java +++ b/src/main/java/org/wso2/carbon/transport/http/netty/internal/config/ListenerConfiguration.java @@ -21,8 +21,6 @@ package org.wso2.carbon.transport.http.netty.internal.config; import org.wso2.carbon.transport.http.netty.listener.ssl.SSLConfig; import java.io.File; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -41,11 +39,7 @@ public class ListenerConfiguration { public static ListenerConfiguration getDefault() { ListenerConfiguration defaultConfig; - try { - defaultConfig = new ListenerConfiguration(DEFAULT_KEY, InetAddress.getLocalHost().getHostAddress(), 8080); - } catch (UnknownHostException e) { - defaultConfig = new ListenerConfiguration(DEFAULT_KEY, "127.0.0.1", 8080); - } + defaultConfig = new ListenerConfiguration(DEFAULT_KEY, "0.0.0.0", 8080); return defaultConfig; }
Bind the transport on all interfaces by default
wso2_transport-http
train
java
5ae78f8696dbdc6ffd10f63b98cbc7b5a36bd308
diff --git a/test/test_cache.rb b/test/test_cache.rb index <HASH>..<HASH> 100644 --- a/test/test_cache.rb +++ b/test/test_cache.rb @@ -146,8 +146,8 @@ class TestCache < Test::Unit::TestCase def test_updates_dont_block_reads getters_count = 20 - key_struct = Struct.new(:key, :hash) - keys = [key_struct.new(1, 100), key_struct.new(2, 100), key_struct.new(3, 100)] # hash colliding keys + key_klass = ThreadSafe::Test::HashCollisionKey + keys = [key_klass.new(1, 100), key_klass.new(2, 100), key_klass.new(3, 100)] # hash colliding keys inserted_keys = [] keys.each do |key, i| diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -37,9 +37,9 @@ module ThreadSafe class HashCollisionKey attr_reader :hash, :key - def initialize(key) + def initialize(key, hash = key.hash % 8) @key = key - @hash = key.hash % 8 + @hash = hash end def eql?(other)
Use the HCK in the main test file.
ruby-concurrency_thread_safe
train
rb,rb
50b854513b04b53ca984e05a8ea572b48341a4f0
diff --git a/MANIFEST.in b/MANIFEST.in index <HASH>..<HASH> 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -global-include . *.py *.c *.h Makefile *.pyx +global-include . *.py *.c *.h Makefile *.pyx requirements.txt global-exclude chumpy/optional_test_performance.py prune dist diff --git a/chumpy/version.py b/chumpy/version.py index <HASH>..<HASH> 100644 --- a/chumpy/version.py +++ b/chumpy/version.py @@ -1,3 +1,3 @@ -version = '0.67.2' +version = '0.67.3' short_version = version full_version = version diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,10 +7,8 @@ See LICENCE.txt for licensing and contact information. from distutils.core import setup import importlib from pip.req import parse_requirements -from os.path import join, split -req_fname = join(split(__file__)[0], 'requirements.txt') -install_reqs = parse_requirements(req_fname, session=False) +install_reqs = parse_requirements('requirements.txt', session=False) install_requires = [str(ir.req) for ir in install_reqs] setup(name='chumpy',
Fixed problem with requirements.txt not being uploaded to pypi
mattloper_chumpy
train
in,py,py
8326f39628745a49df2e9981a812488bcb3c7062
diff --git a/bids/variables/tests/test_io.py b/bids/variables/tests/test_io.py index <HASH>..<HASH> 100644 --- a/bids/variables/tests/test_io.py +++ b/bids/variables/tests/test_io.py @@ -21,7 +21,8 @@ def synthetic(request): deriv = join(root, 'derivatives') if request.param == 'preproc': layout = BIDSLayout([root, (deriv, 'derivatives')]) - dataset = load_variables(layout, skip_empty=True, suffix='preproc') + dataset = load_variables(layout, skip_empty=True, suffix='preproc', + space='T1w') else: layout = BIDSLayout(root) dataset = load_variables(layout, skip_empty=True)
add explicit space constraint to derivatives dataset
bids-standard_pybids
train
py
bb2cceb10291ad39b16fc61e3644e037de4a34fb
diff --git a/src/Kunstmaan/SeoBundle/Entity/Seo.php b/src/Kunstmaan/SeoBundle/Entity/Seo.php index <HASH>..<HASH> 100644 --- a/src/Kunstmaan/SeoBundle/Entity/Seo.php +++ b/src/Kunstmaan/SeoBundle/Entity/Seo.php @@ -99,7 +99,7 @@ class Seo extends AbstractEntity * @ORM\Column(name="cim_keyword", type="string", length=24, nullable=true) * @Assert\Regex(pattern="/^[a-zA-Z0-9\/]*$/") */ - public $cimKeyword; + protected $cimKeyword; /** * @var int
properties should be private/protected
Kunstmaan_KunstmaanBundlesCMS
train
php
dd5cbf3a2b97833511797eadcf9223c2cefa03dd
diff --git a/luigi/process.py b/luigi/process.py index <HASH>..<HASH> 100644 --- a/luigi/process.py +++ b/luigi/process.py @@ -97,11 +97,20 @@ def daemonize(cmd, pidfile=None, logdir=None, api_port=8082, address=None, unix_ stdout_proxy = open(stdout_path, 'a+') stderr_proxy = open(stderr_path, 'a+') - ctx = daemon.DaemonContext( - stdout=stdout_proxy, - stderr=stderr_proxy, - working_directory='.' - ) + try: + ctx = daemon.DaemonContext( + stdout=stdout_proxy, + stderr=stderr_proxy, + working_directory='.', + initgroups=False, + ) + except TypeError: + # Older versions of python-daemon cannot deal with initgroups arg. + ctx = daemon.DaemonContext( + stdout=stdout_proxy, + stderr=stderr_proxy, + working_directory='.', + ) with ctx: loghandler = get_spool_handler(log_path)
Added initgroups to work with python-daemon >= <I>.
spotify_luigi
train
py
18024467ffb7c1a6f95eddd31d6d6f18b763b84c
diff --git a/testing/test_capture.py b/testing/test_capture.py index <HASH>..<HASH> 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -106,7 +106,7 @@ def test_capturing_unicode(testdir, method): obj = "u'\u00f6y'" testdir.makepyfile( """ - # coding=utf8 + # coding=utf-8 # taken from issue 227 from nosetests def test_unicode(): import sys
Fix invalid Python file encoding "utf8" Since Python 3 it must be "utf-8", which is the official name. This is backwards compatible with Python 2.
pytest-dev_pytest
train
py
d52710223ebac511187376cccceb07b4888c8224
diff --git a/lib/takuhai_status/japanpost.rb b/lib/takuhai_status/japanpost.rb index <HASH>..<HASH> 100644 --- a/lib/takuhai_status/japanpost.rb +++ b/lib/takuhai_status/japanpost.rb @@ -11,7 +11,7 @@ module TakuhaiStatus end def finish? - return !!(@state =~ /お届け先にお届け済み|コンビニエンスストアに引渡/) + return !!(@state =~ /お届け先にお届け済み|コンビニエンスストアに引渡|窓口でお渡し/) end private
add final state "窓口でお渡し" to japanpost
tdtds_takuhai_status
train
rb
dceaeadd5b2827ae961038d58432d867242df22f
diff --git a/test/integration/test_events.py b/test/integration/test_events.py index <HASH>..<HASH> 100644 --- a/test/integration/test_events.py +++ b/test/integration/test_events.py @@ -6,7 +6,6 @@ import pkg_resources import json import os import shutil -import stat from ansible_runner import run, run_async @@ -17,10 +16,6 @@ def test_basic_events(containerized, container_runtime_available, is_run_async=F if containerized and not container_runtime_available: pytest.skip('container runtime(s) not available') tdir = tempfile.mkdtemp() - if containerized: - # container unable to access tempdir because of - # mkdtemp()'s minimal permissions - os.chmod(tdir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) inventory = "localhost ansible_connection=local" playbook = [{'hosts': 'all', 'gather_facts': g_facts, 'tasks': [{'debug': {'msg': "test"}}]}]
don't chmod dir for containerized test
ansible_ansible-runner
train
py
824b25634979a26dcd28caf1df963b26af678ff2
diff --git a/test/bitcore.js b/test/bitcore.js index <HASH>..<HASH> 100644 --- a/test/bitcore.js +++ b/test/bitcore.js @@ -584,7 +584,7 @@ describe('bitcore', () => { }); it('streams error when bitcore turned off during action', function (done) { - this.timeout(60 * 1000); + this.timeout(10 * 60 * 1000); const addresses = [getAddress(), getAddress(), getAddress()]; testBlockchain(() => {
Longer time for one of the tests (locally)
trezor_hd-wallet
train
js
9601d88a430d34d4b26cd6459d7d47f30dbb4527
diff --git a/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java b/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java +++ b/src/main/java/org/jfrog/hudson/gradle/ArtifactoryGradleConfigurator.java @@ -81,6 +81,15 @@ public class ArtifactoryGradleConfigurator extends BuildWrapper { return username; } + + public String getRepositoryKey() { + return details != null ? details.repositoryKey : null; + } + + public String getDownloadRepositoryKey() { + return details != null ? details.downloadRepositoryKey : null; + } + public String getArtifactoryName() { return details != null ? details.artifactoryName : null; }
HAP-<I> - Hudson don't remember the selected Resolver repository and Target Upload repository
jenkinsci_artifactory-plugin
train
java
cf4918c6abec0065664a7bb44b34a503f65cd4a6
diff --git a/src/vendor/postcss-nested/index.js b/src/vendor/postcss-nested/index.js index <HASH>..<HASH> 100644 --- a/src/vendor/postcss-nested/index.js +++ b/src/vendor/postcss-nested/index.js @@ -67,7 +67,7 @@ function processRule(rule, bubble) { var bubble = ['media', 'supports', 'document']; -export default function (node) { +const process = node => { node.each(function (child) { if (child.type === 'rule') { processRule(child, bubble); @@ -76,3 +76,5 @@ export default function (node) { } }); }; + +export default process;
broke this when i forked postcss nested
styled-components_styled-components
train
js
d5e45e4c46c59503053bc854986f6080db9cbddd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -98,6 +98,7 @@ exports.natureFromLisp = function (src) { if (src[0] === '(') src = src.slice(1); src = src.trim(); src = src.split(' ')[0]; + src = src.split('(')[0]; exports.operations.forEach(function (operation) { if (src == operation) toReturn = operation; }); diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -108,6 +108,7 @@ describe('#natureFromLisp', function() { ['(Somme 1 1)', 'Somme'], [' (Somme 1 1)', 'Somme'], ['( Somme 1 1)', 'Somme'], + ['(Somme(', 'Somme'], [' ( Somme 1 1)', 'Somme'] ]; exprsAndNatures.forEach(function (exprAndNature) {
Nature: Allow the 2nd parens to stick to the cmd
ClubExpressions_node-clubexpr
train
js,js
c955c61654f4340a318fb45576e8680716149717
diff --git a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java index <HASH>..<HASH> 100644 --- a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java +++ b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java @@ -721,9 +721,18 @@ public class SingularityClient { * */ public Collection<SingularityRequestParent> getSingularityRequests() { + return getSingularityRequests(false); + } + + public Collection<SingularityRequestParent> getSingularityRequests(boolean includeFullRequestData) { final Function<String, String> requestUri = (host) -> String.format(REQUESTS_FORMAT, getApiBase(host)); - return getCollection(requestUri, "[ACTIVE, PAUSED, COOLDOWN] requests", REQUESTS_COLLECTION); + return getCollectionWithParams( + requestUri, + "[ACTIVE, PAUSED, COOLDOWN] requests", + Optional.of(ImmutableMap.of("includeFullRequestData", includeFullRequestData)), + REQUESTS_COLLECTION + ); } /**
Allow fetching full request data in SingularityClient
HubSpot_Singularity
train
java
2e2f998b9208dc6ec77ef57ed42386bcc0bcd6d1
diff --git a/util/reader.go b/util/reader.go index <HASH>..<HASH> 100644 --- a/util/reader.go +++ b/util/reader.go @@ -91,6 +91,16 @@ func (r *Reader) ReadTillDelims(delims []byte) ([]byte, error) { buf := make([]byte, 0) for { + read, err := r.ReadTillDelim(delims[0]) + if err != nil { + return buf, err + } + buf = append(buf, read...) + err = r.buf.UnreadByte() + if err != nil { + return buf, err + } + b, err := r.buf.ReadByte() if err != nil { return buf, err
Improve performance of reader.ReadTillDelims func
bogem_id3v2
train
go
dbe71e81bd82975b3013b92933ce4368db6b8b96
diff --git a/internal/ui/ui_mac.go b/internal/ui/ui_mac.go index <HASH>..<HASH> 100644 --- a/internal/ui/ui_mac.go +++ b/internal/ui/ui_mac.go @@ -24,7 +24,15 @@ package ui // #import <AppKit/AppKit.h> // // static void currentMonitorPos(int* x, int* y) { -// NSDictionary* screenDictionary = [[NSScreen mainScreen] deviceDescription]; +// NSScreen* screen = [NSScreen mainScreen]; +// NSWindow* window = [NSApp mainWindow]; +// if ([window isVisible]) { +// // When the window is visible, the window is already initialized. +// // [NSScreen mainScreen] sometimes tells a lie when the window is put across monitors (#703). +// // Use [[NSApp mainWindow] screen] instead. +// screen = [window screen]; +// } +// NSDictionary* screenDictionary = [screen deviceDescription]; // NSNumber* screenID = [screenDictionary objectForKey:@"NSScreenNumber"]; // CGDirectDisplayID aID = [screenID unsignedIntValue]; // const CGRect bounds = CGDisplayBounds(aID);
ui: Bug fix: currentMonitorPos returned wrong values on macOS [NSScreen mainScreen] sometimes returned a wrong screen for the window. Use [[NSApp mainWindow] screen] when possible. Fixes #<I>
hajimehoshi_ebiten
train
go
1b3bcc98f3ea8027748b8565fcec16fcdafd9f72
diff --git a/storage-authority.go b/storage-authority.go index <HASH>..<HASH> 100644 --- a/storage-authority.go +++ b/storage-authority.go @@ -173,7 +173,7 @@ func (ssa *SQLStorageAuthority) NewPendingAuthorization() (id string, err error) } func (ssa *SQLStorageAuthority) UpdatePendingAuthorization(authz Authorization) (err error) { - tx, err = ssa.db.Begin() + tx, err := ssa.db.Begin() if err != nil { return } @@ -209,6 +209,7 @@ func (ssa *SQLStorageAuthority) UpdatePendingAuthorization(authz Authorization) } err = tx.Commit() + return } func (ssa *SQLStorageAuthority) FinalizeAuthorization(authz Authorization) (err error) {
Typo fixes; should now build and pass tests
letsencrypt_boulder
train
go
199f2001a68dc7c8050ef47137de197cb18685b3
diff --git a/models/points.go b/models/points.go index <HASH>..<HASH> 100644 --- a/models/points.go +++ b/models/points.go @@ -186,6 +186,8 @@ func (t FieldType) String() string { return "String" case Empty: return "Empty" + case Unsigned: + return "Unsigned" default: return "<unknown>" }
fix(storage): add string representation of the Unsigned FieldType
influxdata_influxdb
train
go
eae4c3f01c5440dd684f55e48ec2b455bafdaf8a
diff --git a/app/classes/lib.php b/app/classes/lib.php index <HASH>..<HASH> 100644 --- a/app/classes/lib.php +++ b/app/classes/lib.php @@ -736,8 +736,8 @@ function getConfig() // Make sure the cookie_domain for the sessions is set properly. if (empty($config['general']['cookies_domain'])) { - // Don't set the domain for a cookie on a "TLD" - like 'localhost'. - if (strpos($_SERVER["SERVER_NAME"], ".") > 0) { + // Don't set the domain for a cookie on a "TLD" - like 'localhost', or if the server_name is an IP-address + if ((strpos($_SERVER["SERVER_NAME"], ".") > 0) && preg_match("/[a-z]/i", $_SERVER["SERVER_NAME"]) ) { if (preg_match("/^www./",$_SERVER["SERVER_NAME"])) { $config['general']['cookies_domain'] = "." . preg_replace("/^www./", "", $_SERVER["SERVER_NAME"]); } else {
Bugfix: Don't manually set cookiedomain for IP-addresses.
bolt_bolt
train
php
9ebcfa93af27d1be7cd656f45811a244819103af
diff --git a/lib/google_visualr/version.rb b/lib/google_visualr/version.rb index <HASH>..<HASH> 100644 --- a/lib/google_visualr/version.rb +++ b/lib/google_visualr/version.rb @@ -1,3 +1,3 @@ module GoogleVisualr - VERSION = "2.0.5" + VERSION = "2.0.6" end \ No newline at end of file
Version bump after the bug fix by lawso<I>.
winston_google_visualr
train
rb
4cb0c3f22879add23b15cc55f81530a19aeab9d9
diff --git a/tests/support/parser/__init__.py b/tests/support/parser/__init__.py index <HASH>..<HASH> 100644 --- a/tests/support/parser/__init__.py +++ b/tests/support/parser/__init__.py @@ -242,7 +242,7 @@ class SaltTestingParser(optparse.OptionParser): self, 'Output Options' ) self.output_options_group.add_option( - '-f', + '-F', '--fail-fast', dest='failfast', default=False, @@ -941,6 +941,8 @@ class SaltTestcaseParser(SaltTestingParser): width=self.options.output_columns) runner = TextTestRunner( - verbosity=self.options.verbosity, failfast=True).run(tests) + verbosity=self.options.verbosity, + failfast=self.options.failfast, + ).run(tests) self.testsuite_results.append((header, runner)) return runner.wasSuccessful()
Failfast will be '-F' instead of '-f' Avoid potential confusion with '-f' for '--force'
saltstack_salt
train
py
b18becf3e7af333c1a534fe3b290d8878f70596c
diff --git a/common/test/java/org/openqa/selenium/ElementAttributeTest.java b/common/test/java/org/openqa/selenium/ElementAttributeTest.java index <HASH>..<HASH> 100644 --- a/common/test/java/org/openqa/selenium/ElementAttributeTest.java +++ b/common/test/java/org/openqa/selenium/ElementAttributeTest.java @@ -241,6 +241,7 @@ public class ElementAttributeTest extends AbstractDriverTestCase { } // This is a test-case re-creating issue 900. + @Ignore(SELENESE) public void testShouldReturnValueOfOnClickAttribute() { driver.get(pages.javascriptPage);
SimonStewart: The onclick test doesn't pass with the selenese driver r<I>
SeleniumHQ_selenium
train
java
5f73b8963884532e98df027d8c494c3be7fb3f25
diff --git a/Services/Twilio.php b/Services/Twilio.php index <HASH>..<HASH> 100644 --- a/Services/Twilio.php +++ b/Services/Twilio.php @@ -23,7 +23,7 @@ spl_autoload_register('Services_Twilio_autoload'); */ abstract class Base_Services_Twilio extends Services_Twilio_Resource { - const USER_AGENT = 'twilio-php/3.13.1'; + const USER_AGENT = 'twilio-php/4.0.0'; protected $http; protected $last_response;
Bumping USER_AGENT to <I>
twilio_twilio-php
train
php
5e2023c1c4e34ff8becc0b80a9f790775d4c39f4
diff --git a/lawfactory_utils/urls.py b/lawfactory_utils/urls.py index <HASH>..<HASH> 100644 --- a/lawfactory_utils/urls.py +++ b/lawfactory_utils/urls.py @@ -198,7 +198,7 @@ def clean_url(url): legislature, slug = parse_national_assembly_url(url) if legislature and slug: template = AN_OLD_URL_TEMPLATE - if legislature > 14: + if legislature >= 14: template = AN_NEW_URL_TEMPLATE return template.format(legislature=legislature, slug=slug) @@ -235,7 +235,7 @@ def parse_national_assembly_url(url_an): slug = None slug_match = re.search(r"/([\w_\-]*)(?:\.asp)?(?:#([\w_\-]*))?$", url_an) - if legislature and legislature == 15: + if legislature and legislature in (14, 15): slug = slug_match.group(2) or slug_match.group(1) elif slug_match: slug = slug_match.group(1)
use the new doslegs for the <I>th legislature because the old pages for those doslegs now redirect to the new dosleg
regardscitoyens_lawfactory_utils
train
py
add93d0f7dc43011c401165bbc7ed345a93e082a
diff --git a/lib/chef/chef_fs/config.rb b/lib/chef/chef_fs/config.rb index <HASH>..<HASH> 100644 --- a/lib/chef/chef_fs/config.rb +++ b/lib/chef/chef_fs/config.rb @@ -66,7 +66,7 @@ class Chef # upgrade/migration of older Chef Servers, so they should be considered # frozen in time. - CHEF_11_OSS_STATIC_OBJECTS = %w{cookbooks cookbook_artifacts data_bags environments roles}.freeze + CHEF_11_OSS_STATIC_OBJECTS = %w{cookbooks data_bags environments roles}.freeze CHEF_11_OSS_DYNAMIC_OBJECTS = %w{clients nodes users}.freeze RBAC_OBJECT_NAMES = %w{acls containers groups }.freeze CHEF_12_OBJECTS = %w{ cookbook_artifacts policies policy_groups client_keys }.freeze
Remove cookbook_artifacts from CHEF_<I>_OSS_STATIC_OBJECTS
chef_chef
train
rb
24a289344342ffb4c0f5a2fc46edeaa68d196584
diff --git a/addon/router-ext.js b/addon/router-ext.js index <HASH>..<HASH> 100644 --- a/addon/router-ext.js +++ b/addon/router-ext.js @@ -1,7 +1,23 @@ import Ember from 'ember'; const { - Router + Router: EmberRouter, + RouterDSL: EmberRouterDSL, + get, + Logger, + getOwner } = Ember; -Router.reopen(); +EmberRouter.reopen({ + _buildDSL() { + let owner = getOwner(this); + let moduleBasedResolver = this._hasModuleBasedResolver(); + + return new EmberRouterDSL(null, { + enableLoadingSubstates: !!moduleBasedResolver, + resolveRouteMap(name) { + return owner._lookupFactory('route-map:' + name); + } + }); + } +});
Adds ability to provide `resolveRouteMap` to RouterDSL. This requires changes in Ember made in <URL>
ember-engines_ember-engines
train
js
f6f04e716454b3b7382342c53cd297a6e68be9b5
diff --git a/varify/migrations/0004_remove_sample_as_queryable.py b/varify/migrations/0004_remove_sample_as_queryable.py index <HASH>..<HASH> 100644 --- a/varify/migrations/0004_remove_sample_as_queryable.py +++ b/varify/migrations/0004_remove_sample_as_queryable.py @@ -8,12 +8,12 @@ class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." - orms['DataConcept'].objects.filter(name='Sample')\ + orm['avocado.DataConcept'].objects.filter(name='Sample')\ .update(queryable=False) def backwards(self, orm): "Write your backwards methods here." - orms['DataConcept'].objects.filter(name='Sample')\ + orm['avocado.DataConcept'].objects.filter(name='Sample')\ .update(queryable=True) models = {
Fix bad references and keys in sample queryable migration
chop-dbhi_varify
train
py
40df859c378a129d039412cb1a3703e513e386c6
diff --git a/src/Defender/Traits/Users/HasRoles.php b/src/Defender/Traits/Users/HasRoles.php index <HASH>..<HASH> 100644 --- a/src/Defender/Traits/Users/HasRoles.php +++ b/src/Defender/Traits/Users/HasRoles.php @@ -37,7 +37,7 @@ trait HasRoles public function hasRole($role) { return $this->roles - ->where('name', is_object($role) ? $role->name : $role) + ->where('name', $role) ->first() != null; } @@ -48,7 +48,7 @@ trait HasRoles */ public function attachRole($role) { - if (! $this->hasRole($role)) { + if (! $this->hasRole($role->name)) { $this->roles()->attach($role); } }
bugfix - revert 1st to change
artesaos_defender
train
php
6f526597536ac4d7e0ef763be929115cf8170564
diff --git a/framework/yii/BaseYii.php b/framework/yii/BaseYii.php index <HASH>..<HASH> 100644 --- a/framework/yii/BaseYii.php +++ b/framework/yii/BaseYii.php @@ -335,8 +335,7 @@ class BaseYii include($classFile); - if (YII_DEBUG && !class_exists($className, false) && !interface_exists($className, false) && - (!function_exists('trait_exists') || !trait_exists($className, false))) { + if (YII_DEBUG && !class_exists($className, false) && !interface_exists($className, false) && !trait_exists($className, false)) { throw new UnknownClassException("Unable to find '$className' in file: $classFile"); } }
no need to check for trait_exists in autoloader anymore
yiisoft_yii2-debug
train
php
45aa4988a3dffa9dfe39373e9f687dc746ab61eb
diff --git a/icalevents/icalparser.py b/icalevents/icalparser.py index <HASH>..<HASH> 100644 --- a/icalevents/icalparser.py +++ b/icalevents/icalparser.py @@ -225,8 +225,12 @@ def parse_rrule(component, tz=UTC): :return: extracted rrule or rruleset """ if component.get('rrule'): - # Parse the rrule, might return a rruleset instance, instead of rrule - rule = rrulestr(component['rrule'].to_ical().decode(), dtstart=normalize(component['dtstart'].dt, tz=tz)) + # component['rrule'] can be both a scalar and a list + rrules = component['rrule'] + if not isinstance(rrules, list): + rrules = [rrules] + # Parse the rrules, might return a rruleset instance, instead of rrule + rule = rrulestr('\n'.join(x.to_ical().decode() for x in rrules), dtstart=normalize(component['dtstart'].dt, tz=tz)) if component.get('exdate'): # Make sure, to work with a rruleset
Fixed parsing when multiple `rrule`s are present
irgangla_icalevents
train
py
5ad02c49476a9224edf606cb43946731d65abc82
diff --git a/src/main/groovy/util/FactoryBuilderSupport.java b/src/main/groovy/util/FactoryBuilderSupport.java index <HASH>..<HASH> 100644 --- a/src/main/groovy/util/FactoryBuilderSupport.java +++ b/src/main/groovy/util/FactoryBuilderSupport.java @@ -801,6 +801,14 @@ public abstract class FactoryBuilderSupport extends Binding { } } + /** + * Use {@link FactoryBuilderSupport#dispatchNodeCall(Object, Object)} instead. + */ + @Deprecated + protected Object dispathNodeCall(Object name, Object args) { + return dispathNodeCall(name, args); + } + protected Object dispatchNodeCall(Object name, Object args) { Object node; Closure closure = null;
Created deprecated version of the old method
apache_groovy
train
java
90bfaf908a64cb742421fe9d80d2cbf870d41c27
diff --git a/scanner.go b/scanner.go index <HASH>..<HASH> 100644 --- a/scanner.go +++ b/scanner.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "io" - "os" "strings" ) @@ -560,6 +559,3 @@ func assert(condition bool, msg string, v ...interface{}) { panic(fmt.Sprintf("assert failed: "+msg, v...)) } } - -func warn(v ...interface{}) { fmt.Fprintln(os.Stderr, v...) } -func warnf(msg string, v ...interface{}) { fmt.Fprintf(os.Stderr, msg+"\n", v...) }
Multi-node clustering. This commit adds the ability to cluster multiple nodes together to share the same metadata through raft consensus.
influxdata_influxql
train
go
e8f0d1806467edf70aea98df1a6f6716a2dc3cbb
diff --git a/full_conversation_test.go b/full_conversation_test.go index <HASH>..<HASH> 100644 --- a/full_conversation_test.go +++ b/full_conversation_test.go @@ -139,8 +139,6 @@ func Test_AKE_withVersion3ButWithoutVersion2InThePolicy(t *testing.T) { assertEquals(t, err, nil) assertEquals(t, bob.ake.state, authStateNone{}) - //TODO: They will never be at authStateNone{} again. - // "When starting a private Conversation [...], // generate two DH key pairs for yourself, and set our_keyid = 2" assertEquals(t, alice.keys.ourKeyID, uint32(2))
Solved by d7d<I>
coyim_otr3
train
go
766028ff3535a27ae9358710b4f8e7215c975543
diff --git a/src/Platform/OrchidServiceProvider.php b/src/Platform/OrchidServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Platform/OrchidServiceProvider.php +++ b/src/Platform/OrchidServiceProvider.php @@ -17,16 +17,19 @@ abstract class OrchidServiceProvider extends ServiceProvider public function boot(Dashboard $dashboard): void { View::composer('platform::dashboard', function () use ($dashboard) { - foreach ($this->registerMainMenu() as $element) { - $dashboard->registerMenuElement(Dashboard::MENU_MAIN, $element); + if ($dashboard->isEmptyMenu(Dashboard::MENU_MAIN)) { + foreach ($this->registerMainMenu() as $element) { + $dashboard->registerMenuElement(Dashboard::MENU_MAIN, $element); + } } - foreach ($this->registerProfileMenu() as $element) { - $dashboard->registerMenuElement(Dashboard::MENU_PROFILE, $element); + if ($dashboard->isEmptyMenu(Dashboard::MENU_PROFILE)) { + foreach ($this->registerProfileMenu() as $element) { + $dashboard->registerMenuElement(Dashboard::MENU_PROFILE, $element); + } } }); - foreach ($this->registerPermissions() as $permission) { $dashboard->registerPermissions($permission); }
Fix the menu state while using laravel octane (#<I>)
orchidsoftware_platform
train
php
570ba034e522e0a94a8f2e5483f5eaa9939354d4
diff --git a/src/Work/Application.php b/src/Work/Application.php index <HASH>..<HASH> 100644 --- a/src/Work/Application.php +++ b/src/Work/Application.php @@ -29,7 +29,7 @@ use EasyWeChat\Work\MiniProgram\Application as MiniProgram; * @property \EasyWeChat\Work\Message\Messenger $messenger * @property \EasyWeChat\Work\User\Client $user * @property \EasyWeChat\Work\User\TagClient $tag - * @property \EasyWeChat\Work\Server\ServiceProvider $server + * @property \EasyWeChat\Work\Server\Guard $server * @property \EasyWeChat\Work\Jssdk\Client $jssdk * @property \Overtrue\Socialite\Providers\WeWorkProvider $oauth * @property \EasyWeChat\Work\Invoice\Client $invoice
Fix work server annotation (#<I>)
overtrue_wechat
train
php
65394604a751ccfdc8124f1f29b85a33a3d1b217
diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index <HASH>..<HASH> 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -252,6 +252,10 @@ class PaginatorHelper extends AppHelper { * @return string A "previous" link or $disabledTitle text if the link is disabled. */ public function prev($title = '<< Previous', $options = array(), $disabledTitle = null, $disabledOptions = array()) { + $defaults = array( + 'rel' => 'prev' + ); + $options = array_merge($defaults, (array)$options); return $this->__pagingLink('Prev', $title, $options, $disabledTitle, $disabledOptions); } @@ -271,6 +275,10 @@ class PaginatorHelper extends AppHelper { * @return string A "next" link or or $disabledTitle text if the link is disabled. */ public function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array()) { + $defaults = array( + 'rel' => 'next' + ); + $options = array_merge($defaults, (array)$options); return $this->__pagingLink('Next', $title, $options, $disabledTitle, $disabledOptions); }
Give PaginatorHelper's next/prev links the correct 'rel' attribute It's a good idea to give links such as next/prev the 'rel' attribute. See the following pages for more information: <URL>
cakephp_cakephp
train
php
bf86d9196819264110f6b469e0c7a4886b0477fd
diff --git a/public/lib/main.js b/public/lib/main.js index <HASH>..<HASH> 100644 --- a/public/lib/main.js +++ b/public/lib/main.js @@ -21,17 +21,22 @@ }); socket.on('event:new_notification', function(data) { - if (!data || !data.text) { + if (!data) { return; } - - translator.translate(data.text, function(translated) { + var text = data.bodyShort || data.text; + if (!text) { + return; + } + translator.translate(text, function(translated) { require(['notify'], function(Notify) { var notification = new Notify(config.siteTitle, { body: translated.replace(/<strong>/g, '').replace(/<\/strong>/g, ''), icon: logo, notifyClick: function() { - ajaxify.go(data.path.substring(1)); + if (data.path) { + ajaxify.go(data.path.substring(1)); + } } }); notification.show();
data.text is deprecated
psychobunny_nodebb-plugin-desktop-notifications
train
js
5f63635eaac81e63e91c99802b0c025980e53f9f
diff --git a/loader.js b/loader.js index <HASH>..<HASH> 100644 --- a/loader.js +++ b/loader.js @@ -1,6 +1,6 @@ var crypto = require('crypto'); var container = {}; - +var _ = require('underscore'); var generateUniqueName = function(func) { var string = func; @@ -12,6 +12,16 @@ var generateUniqueName = function(func) { .digest('hex'); } +var hashObjectOfFunctions = function(_module) { + var hash_obj = {}; + var keys = _.keys(_module); + for (i = 0; i < keys.length; i++) { + key = keys[i]; + hash_obj[key] = _module[key].toString(); + } + var obj = JSON.stringify(hash_obj); + return generateUniqueName(obj); +} module.exports = function(_default, container) { if (container == undefined) container = {}; @@ -29,8 +39,8 @@ module.exports = function(_default, container) { } if (typeof _module == 'object') { - var obj = JSON.stringify(_module); - var _module = generateUniqueName(obj); + var obj = _module; + _module = hashObjectOfFunctions(_module); if (container[_module] == undefined) { container[_module] = obj; }
Making the loader support objects with functions.
ballantyne_node-paperclip
train
js
d489157f224bf5e5b20ad0f9c15eb5f42654aefc
diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index <HASH>..<HASH> 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. -__version__ = "1.0.2" +__version__ = "1.0.3" __license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)" __copyright__ = "Copyright (C) 2017-2020 Dan <https://github.com/delivrance>"
Update Pyrogram to <I>
pyrogram_pyrogram
train
py
6c1b3a71db5dd110506fe24151ab3201da5f21f7
diff --git a/raft/raft.go b/raft/raft.go index <HASH>..<HASH> 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -66,15 +66,16 @@ type Config struct { // peer is private and only used for testing right now. peers []uint64 - // ElectionTick is the election timeout. If a follower does not - // receive any message from the leader of current term during - // ElectionTick, it will become candidate and start an election. - // ElectionTick must be greater than HeartbeatTick. We suggest - // to use ElectionTick = 10 * HeartbeatTick to avoid unnecessary - // leader switching. + // ElectionTick is the number of Node.Tick invocations that must pass between + // elections. That is, if a follower does not receive any message from the + // leader of current term before ElectionTick has elapsed, it will become + // candidate and start an election. ElectionTick must be greater than + // HeartbeatTick. We suggest ElectionTick = 10 * HeartbeatTick to avoid + // unnecessary leader switching. ElectionTick int - // HeartbeatTick is the heartbeat interval. A leader sends heartbeat - // message to maintain the leadership every heartbeat interval. + // HeartbeatTick is the number of Node.Tick invocations that must pass between + // heartbeats. That is, a leader sends heartbeat messages to maintain its + // leadership every HeartbeatTick ticks. HeartbeatTick int // Storage is the storage for raft. raft generates entries and
raft: clarify Heartbeat/ElectionTick comments Avoid other, ambiguous interpretations.
etcd-io_etcd
train
go
7ed62086b07a7569f8afec44e7e70ae704f1c04a
diff --git a/shorty/http.go b/shorty/http.go index <HASH>..<HASH> 100644 --- a/shorty/http.go +++ b/shorty/http.go @@ -13,6 +13,7 @@ import ( "io/ioutil" "net/http" "net/url" + "os" "strings" "text/template" "time" @@ -868,6 +869,7 @@ func (this *ShortyEndPoint) CheckAppInstallInterstitialJSHandler(resp http.Respo glog.Infoln("Using matchedRule to generate from template", matchedRule) + deeplinkJsTemplate.Execute(os.Stdout, matchedRule) deeplinkJsTemplate.Execute(resp, matchedRule) return }
bad hack to dump out js
qorio_omni
train
go
4cf9facf12e398000539e6e2d8e9256cf4669f25
diff --git a/safe/utilities/test/test_keyword_io.py b/safe/utilities/test/test_keyword_io.py index <HASH>..<HASH> 100644 --- a/safe/utilities/test/test_keyword_io.py +++ b/safe/utilities/test/test_keyword_io.py @@ -45,9 +45,8 @@ class KeywordIOTest(unittest.TestCase): self.sqlite_layer = QgsVectorLayer( uri.uri(), 'OSM Buildings', 'spatialite') self.expected_sqlite_keywords = { - 'category': 'exposure', - 'datatype': 'OSM', - 'subcategory': 'building'} + 'datatype': 'OSM' + } # Raster Layer keywords hazard_path = test_data_path('hazard', 'tsunami_wgs84.tif')
Update expected value to make test pass.
inasafe_inasafe
train
py
dd56dc7da6970dbfff634b4115973ad278ab19d6
diff --git a/test/models/trackable_test.rb b/test/models/trackable_test.rb index <HASH>..<HASH> 100644 --- a/test/models/trackable_test.rb +++ b/test/models/trackable_test.rb @@ -10,4 +10,32 @@ class TrackableTest < ActiveSupport::TestCase :sign_in_count ] end + + test 'update_tracked_fields should only set attributes but not save the record' do + user = create_user + request = mock + request.stubs(:remote_ip).returns("127.0.0.1") + + assert_nil user.current_sign_in_ip + assert_nil user.last_sign_in_ip + assert_nil user.current_sign_in_at + assert_nil user.last_sign_in_at + assert_equal 0, user.sign_in_count + + user.update_tracked_fields(request) + + assert_equal "127.0.0.1", user.current_sign_in_ip + assert_equal "127.0.0.1", user.last_sign_in_ip + assert_not_nil user.current_sign_in_at + assert_not_nil user.last_sign_in_at + assert_equal 1, user.sign_in_count + + user.reload + + assert_nil user.current_sign_in_ip + assert_nil user.last_sign_in_ip + assert_nil user.current_sign_in_at + assert_nil user.last_sign_in_at + assert_equal 0, user.sign_in_count + end end
added test for update_tracked_fields method
plataformatec_devise
train
rb
d7fe462d05ce007d80533202fc72145885e405af
diff --git a/lib/components/src/addon_panel/index.js b/lib/components/src/addon_panel/index.js index <HASH>..<HASH> 100644 --- a/lib/components/src/addon_panel/index.js +++ b/lib/components/src/addon_panel/index.js @@ -21,7 +21,6 @@ const Wrapper = glamorous.div({ background: 'white', borderRadius: 4, border: 'solid 1px rgb(236, 236, 236)', - marginTop: 5, overflow: 'hidden', width: '100%', height: '100%', diff --git a/lib/components/src/layout/desktop.js b/lib/components/src/layout/desktop.js index <HASH>..<HASH> 100644 --- a/lib/components/src/layout/desktop.js +++ b/lib/components/src/layout/desktop.js @@ -33,7 +33,7 @@ const AddonPanelWrapper = glamorous.div(({ showAddonPanel, addonPanelInRight }) position: 'absolute', width: '100%', height: '100%', - padding: addonPanelInRight ? '5px 10px 10px 0' : '0px 10px 10px 0', + padding: addonPanelInRight ? '10px 10px 10px 0' : '0px 10px 10px 0', boxSizing: 'border-box', }));
FIX a minor alignment issue
storybooks_storybook
train
js,js
8847d9e98e88acc0e0fa65b558ecf5f7392a4e4f
diff --git a/gatt/gatt.py b/gatt/gatt.py index <HASH>..<HASH> 100644 --- a/gatt/gatt.py +++ b/gatt/gatt.py @@ -1,5 +1,13 @@ -import dbus -import dbus.mainloop.glib +try: + import dbus + import dbus.mainloop.glib +except ImportError: + import sys + print("Module 'dbus' not found") + print("Please run: sudo apt-get install python3-dbus") + print("See also: https://github.com/getsenic/gatt-python#installing-gatt-sdk-for-python") + sys.exit(1) + import re from gi.repository import GObject
Print error when module ‘dbus’ is not installed
getsenic_gatt-python
train
py
217f144d25f7670df23163397df4ce3e25a4c54c
diff --git a/commands.go b/commands.go index <HASH>..<HASH> 100644 --- a/commands.go +++ b/commands.go @@ -257,7 +257,7 @@ var Commands = []cli.Command{ }, Name: "rm", Usage: "Remove a machine", - Description: "Argument(s) are one or more machine names. Will use the active machine if none is provided.", + Description: "Argument(s) are one or more machine names.", Action: cmdRm, }, {
corrects the rm command line description
docker_machine
train
go