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
eb96a6d42a5beaa23b7ecb8fd2382f552e9f4e00
diff --git a/pyethereum/apiserver.py b/pyethereum/apiserver.py index <HASH>..<HASH> 100644 --- a/pyethereum/apiserver.py +++ b/pyethereum/apiserver.py @@ -117,16 +117,18 @@ def block(arg=None): # ######## Transactions ############ +def make_transaction_response(txs): + return dict(transactions = [tx.to_dict() for tx in txs]) + @app.put(base_url + '/transactions/') -def transactions(): +def add_transaction(): # request.json FIXME / post json encoded data? i.e. the representation of # a tx hex_data = bottle.request.body.read() logger.debug('PUT transactions/ %s', hex_data) tx = Transaction.hex_deserialize(hex_data) signals.local_transaction_received.send(sender=None, transaction=tx) - return '' - #return bottle.redirect(base_url + '/transactions/' + tx.hex_hash()) + return bottle.redirect(base_url + '/transactions/' + tx.hex_hash()) """ HTTP status code 200 OK for a successful PUT of an update to an existing resource. No response body needed. (Per Section 9.6, 204 No Content is even more appropriate.)
redirect PUT tx to tx view
ethereum_pyethereum
train
py
7ed912c2cd4eabb7dfacaf4b3020542e0061e895
diff --git a/client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java b/client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java index <HASH>..<HASH> 100644 --- a/client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java +++ b/client/src/main/java/com/opentable/jaxrs/JaxRsClientConfig.java @@ -20,10 +20,15 @@ import javax.ws.rs.client.Invocation; /** * JAX-RS Client tunables. * - * In your properties file, the config options are prefixed with &ldquo;{@code jaxrs.client.${clientName}}&rdquo;. - * Currently, the config values themselves are the same as the actual method names(!). + * <p> + * In your properties file, the config options are prefixed with &ldquo;{@code jaxrs.client.${clientName}.}&rdquo;. + * Currently, the config parameter names themselves are the {@link java.beans.PropertyDescriptor}-style names. * So, for example, you might include the following in your config file: - * {@code jaxrs.client.foo.getConnectionPoolSize=10} + * {@code jaxrs.client.foo.connectionPoolSize=10} + * + * <p> + * Confusingly, when printed out, the config parameter names will be the <em>method</em> names, + * such as {@code getConnectionPoolSize}. */ public interface JaxRsClientConfig {
client: Clarifies config documentation.
opentable_otj-jaxrs
train
java
13e7cc155149cf6e7c3789955e2d48be0a42cc26
diff --git a/ctypescrypto/cms.py b/ctypescrypto/cms.py index <HASH>..<HASH> 100644 --- a/ctypescrypto/cms.py +++ b/ctypescrypto/cms.py @@ -59,6 +59,8 @@ def CMS(data, format="PEM"): ptr = libcrypto.PEM_read_bio_CMS(bio.bio, None, None, None) else: ptr = libcrypto.d2i_CMS_bio(bio.bio, None) + if ptr is None: + raise CMSError("Error parsing CMS data") typeoid = Oid(libcrypto.OBJ_obj2nid(libcrypto.CMS_get0_type(ptr))) if typeoid.shortname() == "pkcs7-signedData": return SignedData(ptr)
Check for CMS parsing error and don't pass None to CMS_get0_type. Fixes #3
vbwagner_ctypescrypto
train
py
292dbc7b5d765c3c3528fe7c191f6eccab1397ba
diff --git a/survival/datasets.py b/survival/datasets.py index <HASH>..<HASH> 100644 --- a/survival/datasets.py +++ b/survival/datasets.py @@ -163,7 +163,7 @@ def load_arff_file(path_training, attr_labels, pos_label=None, path_testing=None attr_labels = None x_test, y_test = get_x_y(test_dataset, attr_labels, pos_label, survival) - if len(x_train.columns.sym_diff(x_test.columns)) > 0: + if len(x_train.columns.symmetric_difference(x_test.columns)) > 0: warnings.warn("Restricting columns to intersection between training and testing data", stacklevel=2)
Don't use deprecated Index.sym_diff()
sebp_scikit-survival
train
py
2066132d80089d042717f52eb528db092f16d2f2
diff --git a/lib/byebug/runner.rb b/lib/byebug/runner.rb index <HASH>..<HASH> 100644 --- a/lib/byebug/runner.rb +++ b/lib/byebug/runner.rb @@ -16,10 +16,12 @@ module Byebug # Debug a script only if syntax checks okay. # def debug_program(options) - output = `ruby -c "#{Byebug.debugged_program}" 2>&1` - if $CHILD_STATUS.exitstatus != 0 - Byebug.puts output - exit $CHILD_STATUS.exitstatus + unless File.executable?(Byebug.debugged_program) + output = `ruby -c "#{Byebug.debugged_program}" 2>&1` + if $CHILD_STATUS.exitstatus != 0 + Byebug.puts output + exit $CHILD_STATUS.exitstatus + end end status = Byebug.debug_load(Byebug.debugged_program, options[:stop])
Only check syntax if it's not a binary file
deivid-rodriguez_byebug
train
rb
48940954b8688c94fafe488794e3604b05d4cbe0
diff --git a/controllers/auth.php b/controllers/auth.php index <HASH>..<HASH> 100644 --- a/controllers/auth.php +++ b/controllers/auth.php @@ -83,14 +83,23 @@ class FluxBB_Auth_Controller extends Base public function post_register() { // TODO: Add agreement to rules here! - + + if(Config::enabled('o_regs_verify')) // If email confirmation is enabled + { + $email_rules = 'required|email|confirmed|unique:users,email'; + } + else + { + $email_rules = 'required|email|unique:users,email'; + } + $rules = array( // TODO: Reserved chars, BBCode, IP + case-insensitivity for "Guest", censored words, name doesn't exist 'req_user' => 'required|min:2|max:25|not_in:Guest,'.__('fluxbb::common.guest'), // TODO: No password if o_regs_verify == 1 'req_password' => 'required|min:4|confirmed', - // TODO: only check for confirmation if o_regs_verify == 1, also add check for banned email - 'req_email' => 'required|email|confirmed|unique:users,email', + // TODO: add check for banned email + 'req_email' => $email_rules, ); $validation = Validator::make(Input::all(), $rules);
fixes #<I> Make sure to empty your cache before testing out.
fluxbb_core
train
php
93f6d408224a266ad281577c8312d76c38cbc0b9
diff --git a/lib/hooks/IfStatement.js b/lib/hooks/IfStatement.js index <HASH>..<HASH> 100644 --- a/lib/hooks/IfStatement.js +++ b/lib/hooks/IfStatement.js @@ -79,6 +79,10 @@ exports.getIndentEdges = function(node) { // test (IfStatementConditional) edges.push(test); + function isExecutable(token) { + return _tk.isNotEmpty(token) && !_tk.isComment(token); + } + // consequent (body) edges.push({ startToken: ( @@ -86,7 +90,14 @@ exports.getIndentEdges = function(node) { consequent.startToken : test.endToken.next ), - endToken: consequent.endToken + // we have some special rules for comments just before the `else` statement + // because of jQuery style guide. maybe in the future we will add + // a setting to toggle this behavior (if someone asks for it) + endToken: ( + alt && _tk.isComment(_tk.findPrevNonEmpty(consequent.endToken)) ? + _tk.findPrev(consequent.endToken, isExecutable) : + consequent.endToken + ) }); // alt (else)
change IfStatement indent edges to avoid indenting comments that are just before `} else`. closes #<I>
millermedeiros_esformatter
train
js
d1e48c5808f09833910a71e42bdb7633344df4c7
diff --git a/lib/rspec-puppet/adapters.rb b/lib/rspec-puppet/adapters.rb index <HASH>..<HASH> 100644 --- a/lib/rspec-puppet/adapters.rb +++ b/lib/rspec-puppet/adapters.rb @@ -50,6 +50,11 @@ module RSpec::Puppet if Puppet.settings.respond_to?(:initialize_app_defaults) Puppet.settings.initialize_app_defaults(settings_hash) + + # Forcefully apply the environmentpath setting instead of relying on + # the application defaults as Puppet::Test::TestHelper automatically + # sets this value as well, overriding our application default + Puppet.settings[:environmentpath] = settings_hash[:environmentpath] if settings_hash.key?(:environmentpath) else # Set settings the old way for Puppet 2.x, because that's how # they're defaulted in that version of Puppet::Test::TestHelper and
Set environmentpath setting as an override
rodjek_rspec-puppet
train
rb
01129897f1b037745aeb84973824f991d56110f6
diff --git a/src/pusher.js b/src/pusher.js index <HASH>..<HASH> 100644 --- a/src/pusher.js +++ b/src/pusher.js @@ -28,11 +28,13 @@ self.sessionID, jsonp, { limit: 25 } ); - manager.bind("connected", function() { + var sendTimeline = function() { if (!timeline.isEmpty()) { timeline.send(function() {}); } - }); + }; + manager.bind("connected", sendTimeline); + setInterval(sendTimeline, 60000); return timeline; },
Store timeline every minute if it's not empty
pusher_pusher-js
train
js
6c7a12fa272f8f63f970fe4e3573b6e3bccfc365
diff --git a/spyder/plugins/completion/languageserver/__init__.py b/spyder/plugins/completion/languageserver/__init__.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/completion/languageserver/__init__.py +++ b/spyder/plugins/completion/languageserver/__init__.py @@ -574,39 +574,6 @@ class InsertTextFormat: PLAIN_TEXT = 1 SNIPPET = 2 - -# ----------------- DOCUMENT SYMBOL RELATED VALUES ------------------ - - -class SymbolKind: - FILE = 1 - MODULE = 2 - NAMESPACE = 3 - PACKAGE = 4 - CLASS = 5 - METHOD = 6 - PROPERTY = 7 - FIELD = 8 - CONSTRUCTOR = 9 - ENUM = 10 - INTERFACE = 11 - FUNCTION = 12 - VARIABLE = 13 - CONSTANT = 14 - STRING = 15 - NUMBER = 16 - BOOLEAN = 17 - ARRAY = 18 - OBJECT = 19 - KEY = 20 - NULL = 21 - ENUM_MEMBER = 22 - STRUCT = 23 - EVENT = 24 - OPERATOR = 25 - TYPE_PARAMETER = 26 - - # ----------------- SAVING REQUEST RELATED VALUES -------------------
LSP: Remove repeated SymbolKind enum
spyder-ide_spyder
train
py
868f43609af0048265c289efc8328d86ac4afe4a
diff --git a/src/javascript/runtime/html5/image/Image.js b/src/javascript/runtime/html5/image/Image.js index <HASH>..<HASH> 100644 --- a/src/javascript/runtime/html5/image/Image.js +++ b/src/javascript/runtime/html5/image/Image.js @@ -376,6 +376,12 @@ define("moxie/runtime/html5/image/Image", [ _imgInfo.purge(); _imgInfo = null; } + + // Memory issue for IE/Edge. They Keep a reference to image (because of the onload event) and the object not been collected by GC. + if (_img) { + _img.src = ''; + } + _binStr = _img = _canvas = _blob = null; _modified = false; }
Image, HTML5: Memory issue for IE/Edge.
moxiecode_moxie
train
js
96bd7202c109823eea3cfdea9989e6ffd507f0f8
diff --git a/qa_tests/risk/event_based/qatest_1/test.py b/qa_tests/risk/event_based/qatest_1/test.py index <HASH>..<HASH> 100644 --- a/qa_tests/risk/event_based/qatest_1/test.py +++ b/qa_tests/risk/event_based/qatest_1/test.py @@ -24,6 +24,7 @@ class EventBaseQATestCase1(risk.CompleteTestCase, risk.FixtureBasedQATestCase): @noseattr('qa', 'risk', 'event_based') def test(self): + self.skipTest("Missing expected data") self._run_test() def expected_output_data(self):
skip risk peb qa test as we are waiting for scientific input Former-commit-id: 3baebe8bd4fd3a<I>ab<I>d6eaedfd4
gem_oq-engine
train
py
94ef4c9115219c59ab8278c40c37550b98aaeaad
diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/Region.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/Region.java index <HASH>..<HASH> 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/Region.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/Region.java @@ -79,7 +79,9 @@ public class Region { if (Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers())) { field.setAccessible(true); try { - values.add((Region) field.get(null)); + if(field.get(null) != null) { + values.add((Region) field.get(null)); + } } catch (IllegalAccessException e) { throw new RuntimeException(e); }
fixing a bug in how Region values get initialized
Azure_azure-sdk-for-java
train
java
3f6dfe7c6494c2746bc748b4a05c57a6c227d57c
diff --git a/lib/cequel/model/associations.rb b/lib/cequel/model/associations.rb index <HASH>..<HASH> 100644 --- a/lib/cequel/model/associations.rb +++ b/lib/cequel/model/associations.rb @@ -29,14 +29,6 @@ module Cequel end end - def #{name}=(instance) - @_cequel.associations[#{name.inspect}] = instance - write_attribute( - #{association.foreign_key_name.inspect}, - instance.__send__(instance.class.key_alias) - ) - end - def #{association.foreign_key_name}=(key) @_cequel.associations.delete(#{name.inspect}) write_attribute(#{association.foreign_key_name.inspect}, key) diff --git a/spec/examples/model/associations_spec.rb b/spec/examples/model/associations_spec.rb index <HASH>..<HASH> 100644 --- a/spec/examples/model/associations_spec.rb +++ b/spec/examples/model/associations_spec.rb @@ -38,11 +38,6 @@ describe Cequel::Model::Associations do post.blog.name.should == 'Another Blog' end - it 'should provide setter for association' do - post.blog = Blog.new(:id => 3, :name => 'This blog') - post.blog_id.should == 3 - end - end describe '::has_many' do
belongs_to associations are read-only Prefer to keep this consistent
cequel_cequel
train
rb,rb
f75f46728b637647a2928d27bdc5158917d6af4f
diff --git a/lib/fakefs/file.rb b/lib/fakefs/file.rb index <HASH>..<HASH> 100644 --- a/lib/fakefs/file.rb +++ b/lib/fakefs/file.rb @@ -658,7 +658,7 @@ module FakeFS def self.write(filename, contents, offset = nil, open_args = {}) offset, open_args = nil, offset if offset.is_a?(Hash) - mode = offset ? 'a' : 'w' + mode = offset ? 'r+' : 'w' if open_args.any? if open_args[:open_args] args = [filename, *open_args[:open_args]] diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index <HASH>..<HASH> 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -4247,6 +4247,8 @@ class FakeFSTest < Minitest::Test File.write('foo', 'bar', 3) assert_equal File.read('foo'), 'foobar' + File.write('foo', 'baz', 3) + assert_equal File.read('foo'), 'foobaz' end def test_can_read_binary_data_in_binary_mode
Fix ::File.write incorrect opening mode When writing to an existing file at a specific offset the new content should replace the previous content instead of being appended to it. The former test was equivalent to an append so it missed this incorrect behavior.
fakefs_fakefs
train
rb,rb
3fa8c117aa613e1e8b40a446ceb6f945d6744067
diff --git a/shap/explainers/_explainer.py b/shap/explainers/_explainer.py index <HASH>..<HASH> 100644 --- a/shap/explainers/_explainer.py +++ b/shap/explainers/_explainer.py @@ -1,6 +1,7 @@ from .. import maskers from .. import links -from ..utils import safe_isinstance, show_progress +from ..utils import safe_isinstance, show_progress, MODELS_FOR_CAUSAL_LM, MODELS_FOR_SEQ_TO_SEQ_CAUSAL_LM +from ..models import TeacherForcingLogits from .._explanation import Explanation import numpy as np import scipy as sp @@ -79,6 +80,14 @@ class Explainer(): else: self.masker = masker + # wrap masker and model if output text explanation algorithm + if safe_isinstance(model,"transformers.PreTrainedModel") and safe_isinstance(model,MODELS_FOR_SEQ_TO_SEQ_CAUSAL_LM + MODELS_FOR_CAUSAL_LM): + self.masker = maskers.FixedComposite(self.masker) + self.model = TeacherForcingLogits(self.model, masker) + elif safe_isinstance(model, "shap.models.TeacherForcingLogits"): + self.masker = maskers.FixedComposite(self.masker) + + #self._brute_force_fallback = explainers.BruteForce(self.model, self.masker) # validate and save the link function
Added wrapper functionality to detect transformer model and create a teacher forcing logit wrapper model along with fixed composite masker wrapper masker
slundberg_shap
train
py
5a04df809dc6db278770c936aac3a1a4d25af6ee
diff --git a/es/index.go b/es/index.go index <HASH>..<HASH> 100644 --- a/es/index.go +++ b/es/index.go @@ -383,14 +383,14 @@ func (index *Index) DeleteByQuery(query string) (b []byte, e error) { return rsp.Body, nil } -func (index *Index) SearchRaw(req *Request) (*ResponseRaw, error) { +func (index *Index) SearchRaw(req interface{}) (*ResponseRaw, error) { rsp := &ResponseRaw{Response: &Response{}} rsp.Aggregations = aggregations.Aggregations{} e := index.loadSearch(req, rsp) return rsp, e } -func (index *Index) Search(req *Request) (*Response, error) { +func (index *Index) Search(req interface{}) (*Response, error) { rsp := &Response{} rsp.Aggregations = aggregations.Aggregations{} e := index.loadSearch(req, rsp) @@ -401,7 +401,7 @@ type Sharder interface { ShardsResponse() *ShardsResponse } -func (index *Index) loadSearch(req *Request, rsp Sharder) error { +func (index *Index) loadSearch(req interface{}, rsp Sharder) error { u := index.TypeUrl() if !strings.HasSuffix(u, "/") { u += "/"
change type of Request for search to interface{} Bring your own marshaler
dynport_dgtk
train
go
216a392efec7191c9d94408c005ea328f8e12e99
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -826,7 +826,7 @@ follow these steps, YOUR APP MAY BREAK.`); const clientPool = new ClientPool(MAX_CONCURRENT_REQUESTS_PER_CLIENT, () => { const gapicClient = - module.exports.v1beta1(this._initalizationOptions); + module.exports.v1beta1(this._initalizationSettings); Firestore.log( 'Firestore', null, 'Initialized Firestore GAPIC Client'); return gapicClient;
Fixing Client initialization (#<I>)
googleapis_nodejs-firestore
train
js
90c7948ced2d8cf555acaca810a158f9dd5891a4
diff --git a/graylog2-rest-models/src/main/java/org/graylog2/rest/models/system/inputs/responses/InputTypeInfo.java b/graylog2-rest-models/src/main/java/org/graylog2/rest/models/system/inputs/responses/InputTypeInfo.java index <HASH>..<HASH> 100644 --- a/graylog2-rest-models/src/main/java/org/graylog2/rest/models/system/inputs/responses/InputTypeInfo.java +++ b/graylog2-rest-models/src/main/java/org/graylog2/rest/models/system/inputs/responses/InputTypeInfo.java @@ -33,7 +33,7 @@ public abstract class InputTypeInfo { public abstract String type(); @JsonProperty public abstract String name(); - @JsonProperty + @JsonProperty("is_exclusive") public abstract boolean isExclusive(); @JsonProperty public abstract Map<String, Map<String, Object>> requestedConfiguration();
Overriding name of serialized field.
Graylog2_graylog2-server
train
java
130e60bd2c6dabcd1111127ecea8e8beb69ea371
diff --git a/src/directives/mobilegeolocation.js b/src/directives/mobilegeolocation.js index <HASH>..<HASH> 100644 --- a/src/directives/mobilegeolocation.js +++ b/src/directives/mobilegeolocation.js @@ -176,7 +176,7 @@ ngeo.MobileGeolocationController = function($scope, $element, ol.events.listen( this.geolocation_, - ol.Object.getChangeEventType(ol.Geolocation.Property.POSITION), + ol.Object.getChangeEventType(ol.GeolocationProperty.POSITION), function() { this.setPosition_(); },
Fix GeolocationProperty (was renamed in OL)
camptocamp_ngeo
train
js
e6ab17adfcf7ee85460a3a5fe0a48379169d0241
diff --git a/system/modules/facebook_js_sdk/FacebookJSSDK.php b/system/modules/facebook_js_sdk/FacebookJSSDK.php index <HASH>..<HASH> 100644 --- a/system/modules/facebook_js_sdk/FacebookJSSDK.php +++ b/system/modules/facebook_js_sdk/FacebookJSSDK.php @@ -129,8 +129,8 @@ class FacebookJSSDK $objTemplate = new FrontendTemplate('facebook-js-sdk'); // set data - $objTemplate->appId = $strAppId; - $objTemplate->version = $strAppVersion; + $objTemplate->appId = self::getAppId(); + $objTemplate->version = self::getAppVersion(); $objTemplate->lang = $lang; // search for body and inject template
fix empty appId and appVersion
fritzmg_contao-facebook-js-sdk
train
php
e922b93d351572b5c228cd36dab119508990be79
diff --git a/test/Message.js b/test/Message.js index <HASH>..<HASH> 100644 --- a/test/Message.js +++ b/test/Message.js @@ -54,6 +54,22 @@ var should = require('should'); _ = require('underscore'); var binary = require( }); + describe(".byteLength", function(){ + var fillBufferWithValidContents = function(buffer) { + buffer.writeUInt32BE(8, 0); // size + buffer.writeUInt8(1, 4); // magic + buffer.writeUInt8(1, 5); // compression + buffer.writeUInt32BE(755095536, 6); // checksum + buffer.write("foo", 10); + }; + it("should return the length of the Message object in bytes", function(){ + var expectedSize = 12; + var bytes = new Buffer(expectedSize); + fillBufferWithValidContents(bytes); + Message.fromBytes(bytes).byteLength().should.equal(expectedSize); + }); + }); + describe("#calculateChecksum", function(){ it("should calculate the checksum (crc32 of a given message)", function(){
<I>% coverage for Message
cainus_Prozess
train
js
308e481ce85b482cad4987f3fb67b007e4cc89c7
diff --git a/config-dist.php b/config-dist.php index <HASH>..<HASH> 100644 --- a/config-dist.php +++ b/config-dist.php @@ -507,7 +507,7 @@ $CFG->admin = 'admin'; // Uses lock files stored by default in the dataroot. Whether this // works on clusters depends on the file system used for the dataroot. // -// "\\core\\lock\\db_row_lock_factory" - DB locking based on table rows. +// "\\core\\lock\\db_record_lock_factory" - DB locking based on table rows. // // "\\core\\lock\\postgres_lock_factory" - DB locking based on postgres advisory locks. //
MDL-<I> lock: Fix typo on lock factory in config-dist
moodle_moodle
train
php
f72104c26784483f56dc9b1feafb00fbbd1108e1
diff --git a/BitLedMatrix.js b/BitLedMatrix.js index <HASH>..<HASH> 100644 --- a/BitLedMatrix.js +++ b/BitLedMatrix.js @@ -14,6 +14,7 @@ var sendAck = ''; var sendCallback; var Module = scope.Module; + var BoardEvent = scope.BoardEvent; var _backlight; function Matrix(board, pin, leds) { @@ -31,7 +32,7 @@ cmd = [0xF0, 0x04, 0x21, 0x4 /*init*/ , h6bit, l6bit, pin, 0xF7]; } board.send(cmd); - board.on(webduino.BoardEvent.SYSEX_MESSAGE, + board.on(BoardEvent.SYSEX_MESSAGE, function (event) { var m = event.message; });
Fixed that throws error when running in backend
webduinoio_webduino-bit-module-led-matrix
train
js
e518e4118fa356b08e659031d628f4770aa5b2c4
diff --git a/languagetool-language-modules/nl/src/test/java/org/languagetool/rules/nl/MorfologikDutchSpellerRuleTest.java b/languagetool-language-modules/nl/src/test/java/org/languagetool/rules/nl/MorfologikDutchSpellerRuleTest.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/nl/src/test/java/org/languagetool/rules/nl/MorfologikDutchSpellerRuleTest.java +++ b/languagetool-language-modules/nl/src/test/java/org/languagetool/rules/nl/MorfologikDutchSpellerRuleTest.java @@ -38,8 +38,8 @@ public class MorfologikDutchSpellerRuleTest { assertEquals(0, rule.match(langTool.getAnalyzedSentence("Amsterdam")).length); assertEquals(0, rule.match(langTool.getAnalyzedSentence("ipv")).length); // in ignore.txt assertEquals(0, rule.match(langTool.getAnalyzedSentence("voorzover")).length); // in ignore.txt - assertEquals(0, rule.match(langTool.getAnalyzedSentence("FoobarWrongxx")).length); // camel case is ignored - + + assertEquals(1, rule.match(langTool.getAnalyzedSentence("FoobarWrongxx")).length); // camel case is not ignored assertEquals(1, rule.match(langTool.getAnalyzedSentence("foobarwrong")).length); } }
[nl] camel case errors are not ignored anymore
languagetool-org_languagetool
train
java
082855d9844657a9f31fc2d596837764683fc4b8
diff --git a/lib/rules/commit-name.js b/lib/rules/commit-name.js index <HASH>..<HASH> 100644 --- a/lib/rules/commit-name.js +++ b/lib/rules/commit-name.js @@ -80,15 +80,16 @@ module.exports = { }; function users(cmt) { - const author = user(cmt, 'author'); - const committer = user(cmt, 'committer'); - if (author == committer) return author; - if (author && committer) return `${author} and ${committer}`; - return author || committer; + const a = user(cmt, 'author'); + const c = user(cmt, 'committer'); + if (a && c && a != c) return `${a} and ${c}`; + return a || c; } function user(cmt, userType) { - return cmt[userType] && cmt[userType].login && ('@' + cmt[userType].login) || cmt.commit[userType].name; + return cmt[userType] && cmt[userType].login + ? '@' + cmt[userType].login + : cmt.commit[userType].name; } function uniques(arr) {
refactor: rule commit-name
MailOnline_gh-lint
train
js
bd1d4b5503eeb7b3e2e6e11124020e7936e5fe4e
diff --git a/treeCl/parallel/utils.py b/treeCl/parallel/utils.py index <HASH>..<HASH> 100755 --- a/treeCl/parallel/utils.py +++ b/treeCl/parallel/utils.py @@ -26,7 +26,7 @@ def get_client(): return None -def parallel_map(client, task, args, message, batchsize=1): +def parallel_map(client, task, args, message, batchsize=1, background=False): """ Helper to map a function over a sequence of inputs, in parallel, with progress meter. :param client: IPython.parallel.Client instance @@ -43,8 +43,11 @@ def parallel_map(client, task, args, message, batchsize=1): view = client.load_balanced_view() message += ' ({} proc)'.format(nproc) pbar = setup_progressbar(message, njobs, simple_progress=True) - pbar.start() + if not background: + pbar.start() map_result = view.map(task, *list(zip(*args)), chunksize=batchsize) + if background: + return map_result while not map_result.ready(): map_result.wait(1) pbar.update(map_result.progress) @@ -72,4 +75,4 @@ def sequential_map(task, args, message): map_result.append(task(*arglist)) pbar.update(i) pbar.finish() - return map_result \ No newline at end of file + return map_result
Add writing results to disk as they are generated as an option to pll_task
kgori_treeCl
train
py
c8a944d9a695816880e7f7aec21b351aa7df6185
diff --git a/command/build_ext.py b/command/build_ext.py index <HASH>..<HASH> 100644 --- a/command/build_ext.py +++ b/command/build_ext.py @@ -113,7 +113,9 @@ class build_ext (Command): self.include_dirs = string.split (self.include_dirs, os.pathsep) - self.include_dirs.insert (0, py_include) + # Put the Python "system" include dir at the end, so that + # any local include dirs take precedence. + self.include_dirs.append (py_include) if exec_py_include != py_include: self.include_dirs.insert (0, exec_py_include)
Put the Python "system" include dir last, rather than first.
pypa_setuptools
train
py
e2a9126c715a6a1349b97e40ad607b76e0a39d07
diff --git a/src/components/GraphNode/GraphNode.js b/src/components/GraphNode/GraphNode.js index <HASH>..<HASH> 100644 --- a/src/components/GraphNode/GraphNode.js +++ b/src/components/GraphNode/GraphNode.js @@ -116,6 +116,10 @@ const LabelMinorStandard = LabelTemplate.extend` margin-top: -7px; `; + +/** + * A component for rendering labeled graph nodes. + */ class GraphNode extends React.Component { findFirstSearchMatch = text => { let match = {};
Added a description comment to GraphNode example.
weaveworks_ui-components
train
js
41278a62f2c459ac6407a4fee8f1b974e385f5da
diff --git a/packages/next-server/lib/constants.js b/packages/next-server/lib/constants.js index <HASH>..<HASH> 100644 --- a/packages/next-server/lib/constants.js +++ b/packages/next-server/lib/constants.js @@ -10,8 +10,7 @@ export const CONFIG_FILE = 'next.config.js' export const BUILD_ID_FILE = 'BUILD_ID' export const BLOCKED_PAGES = [ '/_document', - '/_app', - '/_error' + '/_app' ] export const CLIENT_STATIC_FILES_PATH = 'static' export const CLIENT_STATIC_FILES_RUNTIME = 'runtime' diff --git a/test/integration/production/test/index.test.js b/test/integration/production/test/index.test.js index <HASH>..<HASH> 100644 --- a/test/integration/production/test/index.test.js +++ b/test/integration/production/test/index.test.js @@ -132,7 +132,7 @@ describe('Production Usage', () => { }) it('should block special pages', async () => { - const urls = ['/_document', '/_error'] + const urls = ['/_document', '/_app'] for (const url of urls) { const html = await renderViaHTTP(appPort, url) expect(html).toMatch(/404/)
Remove _error page from blocked pages (#<I>)
zeit_next.js
train
js,js
79b196668fc5396f80dad59220bb526c09c5ae31
diff --git a/src/main/java/com/davfx/ninio/script/util/AllAvailableScriptRunner.java b/src/main/java/com/davfx/ninio/script/util/AllAvailableScriptRunner.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/davfx/ninio/script/util/AllAvailableScriptRunner.java +++ b/src/main/java/com/davfx/ninio/script/util/AllAvailableScriptRunner.java @@ -136,5 +136,7 @@ public class AllAvailableScriptRunner implements AutoCloseable { pingConfigurator.close(); scheduledExecutor.shutdown(); + + System.gc(); //TODO rm } }
Adding System.gc() to see what is going on with my memory
davidfauthoux_ninio
train
java
e1c3b9e9e7ab876abf4fb3458006b205709367c4
diff --git a/addon/lint/lint.js b/addon/lint/lint.js index <HASH>..<HASH> 100644 --- a/addon/lint/lint.js +++ b/addon/lint/lint.js @@ -226,7 +226,7 @@ var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter); if (state.options.lintOnChange !== false) cm.on("change", onChange); - if (state.options.tooltips != false) + if (state.options.tooltips != false && state.options.tooltips != "gutter") CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); startLinting(cm);
[lint addon] Provide a way to show tooltips only on the gutter Closes #<I>
codemirror_CodeMirror
train
js
00c67770a35cc3e44e06c13c150ad3a665f4177d
diff --git a/DependencyInjection/NelmioSecurityExtension.php b/DependencyInjection/NelmioSecurityExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/NelmioSecurityExtension.php +++ b/DependencyInjection/NelmioSecurityExtension.php @@ -84,6 +84,10 @@ class NelmioSecurityExtension extends Extension $container->setParameter('nelmio_security.external_redirects.abort', $config['external_redirects']['abort']); if ($config['external_redirects']['whitelist']) { $whitelist = array_map(function($el) { + if ($host = parse_url($el, PHP_URL_HOST)) { + return ltrim($host, '.'); + } + return ltrim($el, '.'); }, $config['external_redirects']['whitelist']); $whitelist = array_map('preg_quote', $whitelist);
external_redirects definition can now contains full URL
nelmio_NelmioSecurityBundle
train
php
da89ee5adc3de6190c8f802267480f6a7bb52f1f
diff --git a/src/filters.js b/src/filters.js index <HASH>..<HASH> 100644 --- a/src/filters.js +++ b/src/filters.js @@ -13,6 +13,7 @@ angular.module('angular.filter', [ 'a8m.strip-tags', 'a8m.stringular', 'a8m.truncate', + 'a8m.start-with', 'a8m.concat', 'a8m.unique',
fix(filter): register start-with module
a8m_angular-filter
train
js
135440503b00a3b080398e1679983f7acac50bb8
diff --git a/src/main/java/org/archive/format/gzip/zipnum/ZipNumCluster.java b/src/main/java/org/archive/format/gzip/zipnum/ZipNumCluster.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/archive/format/gzip/zipnum/ZipNumCluster.java +++ b/src/main/java/org/archive/format/gzip/zipnum/ZipNumCluster.java @@ -109,7 +109,11 @@ public class ZipNumCluster implements CDXInputSource { clusterRoot = this.summaryFile.substring(0, lastSlash + 1); } - return clusterRoot + partId + ".gz"; + if (!partId.endsWith(".gz")) { + partId += ".gz"; + } + + return clusterRoot + partId; } public int getNumLines(String[] blocks)
ZipNumCluster: don't add .gz to cluster part if already has .gz
iipc_webarchive-commons
train
java
0644e3f657cc3847a184ec4fb9da6d966d36170a
diff --git a/src/main/java/org/xerial/snappy/SnappyOutputStream.java b/src/main/java/org/xerial/snappy/SnappyOutputStream.java index <HASH>..<HASH> 100755 --- a/src/main/java/org/xerial/snappy/SnappyOutputStream.java +++ b/src/main/java/org/xerial/snappy/SnappyOutputStream.java @@ -42,7 +42,7 @@ import java.io.OutputStream; */ public class SnappyOutputStream extends OutputStream { - static final int DEFAULT_BLOCK_SIZE = 1 << 15; // use 2^15 = 32KB as block size + static final int DEFAULT_BLOCK_SIZE = 4 * 1024 * 1024; // Use 4 MB for the default block size protected final OutputStream out; private final int blockSize;
Use 4MB as the default block size
xerial_snappy-java
train
java
765771d65a205e52cee8331fbbe497c59a5ca43b
diff --git a/src/main/java/com/ning/billing/recurly/RecurlyClient.java b/src/main/java/com/ning/billing/recurly/RecurlyClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/ning/billing/recurly/RecurlyClient.java +++ b/src/main/java/com/ning/billing/recurly/RecurlyClient.java @@ -128,7 +128,7 @@ public class RecurlyClient { private static final Logger log = LoggerFactory.getLogger(RecurlyClient.class); public static final String RECURLY_DEBUG_KEY = "recurly.debug"; - public static final String RECURLY_API_VERSION = "2.26"; + public static final String RECURLY_API_VERSION = "2.27"; private static final String X_RATELIMIT_REMAINING_HEADER_NAME = "X-RateLimit-Remaining"; private static final String X_RECORDS_HEADER_NAME = "X-Records";
Bump API version to <I>
killbilling_recurly-java-library
train
java
467ddc5dba7c50cb828e67bfa7e2b580f8887360
diff --git a/lib/arjdbc/postgresql/adapter.rb b/lib/arjdbc/postgresql/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/postgresql/adapter.rb +++ b/lib/arjdbc/postgresql/adapter.rb @@ -239,12 +239,8 @@ module ArJdbc def supports_index_sort_order?; true end - def supports_migrations?; true end - def supports_partial_index?; true end - def supports_primary_key?; true end # Supports finding primary key on non-Active Record tables - def supports_savepoints?; true end def supports_transaction_isolation?(level = nil); true end @@ -624,6 +620,12 @@ module ArJdbc # Returns an array of indexes for the given table. def indexes(table_name, name = nil) + if name + ActiveSupport::Deprecation.warn(<<-MSG.squish) + Passing name to #indexes is deprecated without replacement. + MSG + end + # FIXME: AR version => table = Utils.extract_schema_qualified_name(table_name.to_s) schema, table = extract_schema_and_table(table_name.to_s)
Updated a couple postgres adapter methods so they correctly show as deprecated
jruby_activerecord-jdbc-adapter
train
rb
d03817707441f3eb912552193263fe586efee4ac
diff --git a/tests/connection.py b/tests/connection.py index <HASH>..<HASH> 100644 --- a/tests/connection.py +++ b/tests/connection.py @@ -851,7 +851,7 @@ class Connection_: # .assert_called_with()) stopped working, apparently triggered by # our code...somehow...after commit (roughly) 80906c7. # And yet, .call_args_list and its brethren work fine. Wha? - Remote.assert_any_call(c) + Remote.assert_any_call(c, inline_env=False) remote.run.assert_has_calls( [call("command"), call("command", warn=True, hide="stderr")] ) @@ -893,7 +893,10 @@ class Connection_: # None despite call_args_list being populated. WTF. (Also, # Remote.return_value is two different Mocks now, despite Remote's # own Mock having the same ID here and in code under test. WTF!!) - expected = [call(cxn), call().run(cmd, watchers=ANY)] + expected = [ + call(cxn, inline_env=False), + call().run(cmd, watchers=ANY), + ] assert Remote.mock_calls == expected # NOTE: we used to have a "sudo return value is literally the same # return value from Remote.run()" sanity check here, which is
Account for new Remote init kwarg in some unrelated tests This is not a great code smell but whatever
fabric_fabric
train
py
e07a437200815ef45a9f8e45d11e8b304900ae62
diff --git a/src/Commands/Install.php b/src/Commands/Install.php index <HASH>..<HASH> 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -1,6 +1,7 @@ <?php namespace TypiCMS\Modules\Core\Commands; +use Exception; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; use TypiCMS\Modules\Users\Services\Registrar; @@ -133,13 +134,14 @@ class Install extends Command 'activated' => 1, 'password' => $password, ]; - $user = $this->registrar->create($data); - if ($user) { + try { + $user = $this->registrar->create($data); $this->info('Superuser created.'); - } else { + } catch (Exception $e) { $this->error('User could not be created.'); } + $this->line('------------------'); } }
Continue installation when superuser could not be created
TypiCMS_Core
train
php
9a2418fc1d13f00a6e4359f56a8cd0067e596fb8
diff --git a/examples/dropdown_test.py b/examples/dropdown_test.py index <HASH>..<HASH> 100644 --- a/examples/dropdown_test.py +++ b/examples/dropdown_test.py @@ -14,8 +14,8 @@ class TestDropdown(KeymapMovementMixin, Dropdown): KEYMAP = { "dropdown": { - "up": "up", - "down": "down", + "k": "up", + "j": "down", "page up": "page up", "page down": "page down", "home": "home",
dropdown and KeymapMovementMixin shouldn't use same KEYMAP
tonycpsu_panwid
train
py
694c6881fef4594780356b44f77154a52cf441b9
diff --git a/lib/leeroy/version.rb b/lib/leeroy/version.rb index <HASH>..<HASH> 100644 --- a/lib/leeroy/version.rb +++ b/lib/leeroy/version.rb @@ -1,3 +1,3 @@ module Leeroy - VERSION = "0.0.1" + VERSION = "0.1.0" end
version <I>, first pipeline works
FitnessKeeper_leeroy
train
rb
57de33759c2baa7a6ece0c485d370d8ae0311d32
diff --git a/src/components/Editor/index.js b/src/components/Editor/index.js index <HASH>..<HASH> 100644 --- a/src/components/Editor/index.js +++ b/src/components/Editor/index.js @@ -16,10 +16,15 @@ class Editor extends Component { onChange = ({ plain, selection }, evt) => { const code = unescape(plain) const html = prism(code) - this.setState({ html, selection }) - if (this.props.onChange) { - this.props.onChange(code) + if (html !== this.state.html) { + this.setState({ html, selection }) + + if (this.props.onChange) { + this.props.onChange(code) + } + } else { + this.setState({ selection }) } }
Prevent onChange editor callback if code hasn't changed
FormidableLabs_react-live
train
js
562af942a86c3210c1d26627ca931c44761f5b0a
diff --git a/angr/analyses/decompiler/structurer.py b/angr/analyses/decompiler/structurer.py index <HASH>..<HASH> 100644 --- a/angr/analyses/decompiler/structurer.py +++ b/angr/analyses/decompiler/structurer.py @@ -1174,6 +1174,14 @@ class Structurer(Analysis): if ast.op == "And": queue += ast.args[1:] yield ast.args[0] + elif ast.op == "Or": + # get the common subexpr on both ends + subexprs_left = Structurer._get_reaching_condition_subexprs(ast.args[0]) + subexprs_right = Structurer._get_reaching_condition_subexprs(ast.args[1]) + left = set(subexprs_left) + left.intersection(subexprs_right) + for expr in left: + yield expr else: yield ast
Structurer: Support getting common subexprs for Or expressions.
angr_angr
train
py
52e4098e1e6038ef94a2cfb85b7894f9d80e72bd
diff --git a/test/geocoders/geocodefarm.py b/test/geocoders/geocodefarm.py index <HASH>..<HASH> 100644 --- a/test/geocoders/geocodefarm.py +++ b/test/geocoders/geocodefarm.py @@ -1,5 +1,4 @@ -import unittest - +import pytest from mock import patch from geopy import exc @@ -8,9 +7,11 @@ from geopy.point import Point from test.geocoders.util import GeocoderTestBase, env -@unittest.skipUnless( - not env.get('GEOCODEFARM_SKIP'), - "GEOCODEFARM_SKIP env variable is set" +@pytest.mark.xfail( + env.get('GEOCODEFARM_SKIP'), + reason=( + "geocodefarm service is unstable at times" + ) ) class GeocodeFarmTestCase(GeocoderTestBase):
GeocodeFarm tests: add xfail mark Their https certificate is currently expired. This is not the first time this service appears to be offline for a long period of time, see a6af<I>abc<I>a<I>f<I>acff<I>a<I>e3a<I>c
geopy_geopy
train
py
655cd32040f45d68292ed6bd3824e8e681eb22a7
diff --git a/lib/assistant.php b/lib/assistant.php index <HASH>..<HASH> 100644 --- a/lib/assistant.php +++ b/lib/assistant.php @@ -23,7 +23,7 @@ function app() * @param string $default * @return mixed */ -function get($key, $default = null) +function query($key, $default = null) { return App::self()->input->query($key, $default); } @@ -35,7 +35,7 @@ function get($key, $default = null) * @param string $default * @return mixed */ -function post($key, $default = null) +function data($key, $default = null) { return App::self()->input->data($key, $default); }
Change get and post to query and data
hfcorriez_pagon
train
php
28f78355614e21a48734ae643198cc20cfac6c82
diff --git a/src/tools/annotation/CircleRoiTool.js b/src/tools/annotation/CircleRoiTool.js index <HASH>..<HASH> 100644 --- a/src/tools/annotation/CircleRoiTool.js +++ b/src/tools/annotation/CircleRoiTool.js @@ -159,7 +159,7 @@ export default class CircleRoiTool extends BaseAnnotationTool { }; draw(newContext, context => { - // If we have tool data for this element - iterate over each set and draw it + // If we have tool data for this element, iterate over each set and draw it for (let i = 0; i < toolData.data.length; i++) { const data = toolData.data[i];
fix(ROI tools): Adds <I>px x-offset to ROI textboxes to avoid handle overlap The ROI textboxes are dangerously close to the handles if you draw a shape that is shorter in height than the textbox. This is very evident if the textboxes have a background color.
cornerstonejs_cornerstoneTools
train
js
8298fb8c5f40d5445b9807cffcd4943fd8b7c765
diff --git a/rocket/futures.py b/rocket/futures.py index <HASH>..<HASH> 100644 --- a/rocket/futures.py +++ b/rocket/futures.py @@ -99,3 +99,14 @@ class WSGIExecutor(ThreadPoolExecutor): return f else: return False + +class FuturesMiddleware(object): + "Futures middleware that adds a Futures Executor to the environment" + def __init__(self, app, threads=5): + self.app = app + self.executor = WSGIExecutor(threads) + + def __call__(self, environ, start_response): + environ["wsgiorg.executor"] = self.executor + environ["wsgiorg.futures"] = self.executor.futures + return self.app(environ, start_response)
Added a middleware class to futures.py
explorigin_Rocket
train
py
dcb9ed7801573ebc92f708233c9f0b5a940d64bb
diff --git a/libkbfs/modes.go b/libkbfs/modes.go index <HASH>..<HASH> 100644 --- a/libkbfs/modes.go +++ b/libkbfs/modes.go @@ -350,8 +350,7 @@ func (mc modeConstrained) TLFEditHistoryEnabled() bool { } func (mc modeConstrained) SendEditNotificationsEnabled() bool { - // TODO: turn this on once we allow mobile writes. - return false + return true } func (mc modeConstrained) LocalHTTPServerEnabled() bool {
modes: enable sending edit notifications on mobile
keybase_client
train
go
0d69540d395223991fcd6937d4b5a55588d0231f
diff --git a/core/model/src/main/java/it/unibz/inf/ontop/model/term/functionsymbol/db/impl/AbstractDBBooleanConnectorFunctionSymbol.java b/core/model/src/main/java/it/unibz/inf/ontop/model/term/functionsymbol/db/impl/AbstractDBBooleanConnectorFunctionSymbol.java index <HASH>..<HASH> 100644 --- a/core/model/src/main/java/it/unibz/inf/ontop/model/term/functionsymbol/db/impl/AbstractDBBooleanConnectorFunctionSymbol.java +++ b/core/model/src/main/java/it/unibz/inf/ontop/model/term/functionsymbol/db/impl/AbstractDBBooleanConnectorFunctionSymbol.java @@ -78,7 +78,7 @@ public abstract class AbstractDBBooleanConnectorFunctionSymbol extends DBBoolean .filter(t -> t instanceof ImmutableExpression) .map(t -> (ImmutableExpression) t) .filter(e -> (e.getFunctionSymbol() instanceof DBIsNullOrNotFunctionSymbol) - && (e.isNull() == lookForIsNull)) + && (((DBIsNullOrNotFunctionSymbol) e.getFunctionSymbol()).isTrueWhenNull() == lookForIsNull)) .map(e -> e.getTerm(0)))) .filter(e -> e.getValue().isPresent()) .collect(ImmutableCollectors.toMap(
Bugfix: wrong method called to distinguish IS_NULL from IS_NOT_NULL.
ontop_ontop
train
java
3eea0fe9d72daab2cd6bbcbb36bcf4a2bdf9afdb
diff --git a/views/default/components/list/list.js b/views/default/components/list/list.js index <HASH>..<HASH> 100644 --- a/views/default/components/list/list.js +++ b/views/default/components/list/list.js @@ -169,9 +169,11 @@ define(function (require) { if (self.timeout) { clearTimeout(self.timeout); } + + // We are adding a random offset of 0 to 10s so that multiple lists don't fire all at the same time self.timeout = setTimeout(function () { self.fetchNewItems.apply(self, []); - }, self.options.autoRefresh * 1000); + }, self.options.autoRefresh * 1000 + Math.round(Math.random() * 10000)); }, /** * Trigger init event
fix(ajax): throttle simulatenous ajax requests With too many autorefreshing lists on the page, ajax requests fire simultaneously freezing the page. This adds a bit of a random offset, so timeouts are randomized
hypeJunction_hypeLists
train
js
36f4daccbfbc3eca9db6beec4e371025fbc01120
diff --git a/calendar-bundle/src/Resources/contao/Calendar.php b/calendar-bundle/src/Resources/contao/Calendar.php index <HASH>..<HASH> 100644 --- a/calendar-bundle/src/Resources/contao/Calendar.php +++ b/calendar-bundle/src/Resources/contao/Calendar.php @@ -128,11 +128,16 @@ class Calendar extends Frontend $objArticle = $objArticleStmt->execute($arrArchive['id']); - // Get default URL + // Get the default URL $objParent = $this->Database->prepare("SELECT id, alias FROM tl_page WHERE id=?") ->limit(1) ->execute($arrArchive['jumpTo']); + if ($objParent->numRows < 1) + { + return; + } + $objParent = $this->getPageDetails($objParent->id); $strUrl = $strLink . $this->generateFrontendUrl($objParent->row(), ($GLOBALS['TL_CONFIG']['useAutoItem'] ? '/%s' : '/events/%s'), $objParent->language);
[Calendar] Do not generate news or calendar feeds if there is no target page (see #<I>)
contao_contao
train
php
dcb1b4295c0f064ad8a7c5f8437ccc6369229419
diff --git a/lib/amq/protocol/version.rb b/lib/amq/protocol/version.rb index <HASH>..<HASH> 100644 --- a/lib/amq/protocol/version.rb +++ b/lib/amq/protocol/version.rb @@ -1,5 +1,5 @@ module AMQ module Protocol - VERSION = "1.0.0.pre2" + VERSION = "1.0.0.pre3" end # Protocol end # AMQ
Now working on <I>.pre3
ruby-amqp_amq-protocol
train
rb
8faeb5ec6da4ae764dc62bd69a612e66096b8979
diff --git a/libre/settings.py b/libre/settings.py index <HASH>..<HASH> 100644 --- a/libre/settings.py +++ b/libre/settings.py @@ -215,7 +215,7 @@ LQL_DELIMITER = os.environ.get('LQL_DELIMITER', '_') CRISPY_TEMPLATE_PACK = 'bootstrap' # Scheduler -DATA_DRIVER_SCHEDULER_RESOLUTION = 5 # 5 seconds +DATA_DRIVER_SCHEDULER_RESOLUTION = 45 # 45 seconds # Overwrite defaults with local settings try:
Reduce the data source origin data check resolution to <I> seconds
commonwealth-of-puerto-rico_libre
train
py
262be40d177fe9b877d1c0d2ab04952350041d69
diff --git a/zk_shell/shell.py b/zk_shell/shell.py index <HASH>..<HASH> 100644 --- a/zk_shell/shell.py +++ b/zk_shell/shell.py @@ -1564,7 +1564,7 @@ child_watches=%s""" def color_outliers(group, delta, marker=lambda x: red(str(x))): colored = False - outliers = find_outliers(group[1:], 20) + outliers = find_outliers(group[1:], delta) for outlier in outliers: group[outlier + 1] = marker(group[outlier + 1]) colored = True
fix(chkzk): delta for outliers was hard-coded
rgs1_zk_shell
train
py
7f6c882395da0e3126b54599259a1f191a8a6b9e
diff --git a/test/PHPMailer/PunyencodeAddressTest.php b/test/PHPMailer/PunyencodeAddressTest.php index <HASH>..<HASH> 100644 --- a/test/PHPMailer/PunyencodeAddressTest.php +++ b/test/PHPMailer/PunyencodeAddressTest.php @@ -38,7 +38,10 @@ final class PunyencodeAddressTest extends TestCase { $this->Mail->CharSet = $charset; - $result = $this->Mail->punyencodeAddress(html_entity_decode($input, ENT_COMPAT, $charset)); + $input = html_entity_decode($input, ENT_COMPAT, $charset); + $expected = html_entity_decode($expected, ENT_COMPAT, $charset); + + $result = $this->Mail->punyencodeAddress($input); $this->assertSame($expected, $result); } @@ -62,6 +65,11 @@ final class PunyencodeAddressTest extends TestCase 'charset' => PHPMailer::CHARSET_ISO88591, 'expected' => 'test@xn--franois-xxa.ch', ], + 'Decode only domain' => [ + 'input' => 'fran&ccedil;ois@fran&ccedil;ois.ch', + 'charset' => PHPMailer::CHARSET_UTF8, + 'expected' => 'fran&ccedil;ois@xn--franois-xxa.ch', + ], ]; } }
PunyencodeAddressTest: add additional test case ... to ensure that the `PHPMailer::punyencodeAddress()` only acts on the domain.
PHPMailer_PHPMailer
train
php
797883087a32683ea24e3d9fde30bbc8c0005990
diff --git a/src/command/KeyBindingManager.js b/src/command/KeyBindingManager.js index <HASH>..<HASH> 100644 --- a/src/command/KeyBindingManager.js +++ b/src/command/KeyBindingManager.js @@ -86,10 +86,10 @@ define(function (require, exports, module) { if (hasCtrl) { // Windows display Ctrl first, Mac displays Command symbol last - if (brackets.platform === "win") { - keyDescriptor.unshift("Ctrl"); - } else { + if (brackets.platform === "mac") { keyDescriptor.push("Cmd"); + } else { + keyDescriptor.unshift("Ctrl"); } }
Explicitly check for mac platform before using Cmd key for Ctrl in shortcuts
adobe_brackets
train
js
07936f596d435854830e5b031eae75323984faea
diff --git a/lib/instrumentation/index.js b/lib/instrumentation/index.js index <HASH>..<HASH> 100644 --- a/lib/instrumentation/index.js +++ b/lib/instrumentation/index.js @@ -281,6 +281,8 @@ function transactionGroupingKey (trans) { } function traceGroupingKey (trace) { - var ancestors = trace.ancestors().map(function (trace) { return trace.signature }).join('|') - return groupingTs(trace.transaction._start) + '|' + trace.transaction.name + '|' + ancestors + '|' + trace.signature + return groupingTs(trace.transaction._start) + + '|' + trace.transaction.name + + '|' + trace.ancestors().join('|') + + '|' + trace.signature }
core: fix trace grouping key algorithm
opbeat_opbeat-node
train
js
420fc6c72aedd4661e605e5405e428f28398dd85
diff --git a/api/server/version.go b/api/server/version.go index <HASH>..<HASH> 100644 --- a/api/server/version.go +++ b/api/server/version.go @@ -7,7 +7,7 @@ import ( ) // Version of IronFunctions -var Version = "0.1.6" +var Version = "0.1.7" func handleVersion(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"version": Version})
functions: <I> release [skip ci]
iron-io_functions
train
go
abed126510acf41938cea4c9634cfa239c4371de
diff --git a/value-processor/src/org/immutables/value/processor/meta/Proto.java b/value-processor/src/org/immutables/value/processor/meta/Proto.java index <HASH>..<HASH> 100644 --- a/value-processor/src/org/immutables/value/processor/meta/Proto.java +++ b/value-processor/src/org/immutables/value/processor/meta/Proto.java @@ -244,8 +244,18 @@ public class Proto { public static MetaAnnotated from(AnnotationMirror mirror, Environment environment) { TypeElement element = (TypeElement) mirror.getAnnotationType().asElement(); String name = element.getQualifiedName().toString(); - return metaAnnotatedCache() - .computeIfAbsent(name, n -> ImmutableProto.MetaAnnotated.of(element, name, environment)); + + ConcurrentMap<String, MetaAnnotated> cache = metaAnnotatedCache(); + @Nullable MetaAnnotated metaAnnotated = cache.get(name); + if (metaAnnotated == null) { + metaAnnotated = ImmutableProto.MetaAnnotated.of(element, name, environment); + @Nullable MetaAnnotated existing = cache.putIfAbsent(name, metaAnnotated); + if (existing != null) { + metaAnnotated = existing; + } + } + + return metaAnnotated; } private static ConcurrentMap<String, MetaAnnotated> metaAnnotatedCache() {
potential deadlock with `computeIfAbsent` #<I>
immutables_immutables
train
java
0d37440a066ab377049806f1dde72a3f30305829
diff --git a/spec/unit/combine_streams_spec.rb b/spec/unit/combine_streams_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/combine_streams_spec.rb +++ b/spec/unit/combine_streams_spec.rb @@ -6,13 +6,6 @@ RSpec.describe Lab42::Stream do let(:integers){ iterate 0, :succ } let(:digits) {finite_stream 0..9} - let( :adder ){ - -> *args do - args.inject 0, :+ - end - } - - context 'needs a stream param' do it{ expect{ digits.combine_streams }.to raise_error(ArgumentError, %r{\AMissing stream parameters}) } end @@ -20,6 +13,7 @@ RSpec.describe Lab42::Stream do context :combine_streams do it "works with itself" do expect( combine_streams(digits, digits, :+).drop(6).take(5) ).to eq [12, 14, 16, 18] + expect( digits.combine_streams(:+, digits).drop(6).take(5) ).to eq [12, 14, 16, 18] end it "works with others" do
<I>% test coverage now
RobertDober_lab42_streams
train
rb
31f44a29d5e2b6581fa735cc99cccf672d33cd4b
diff --git a/openupgradelib/openupgrade.py b/openupgradelib/openupgrade.py index <HASH>..<HASH> 100644 --- a/openupgradelib/openupgrade.py +++ b/openupgradelib/openupgrade.py @@ -2456,6 +2456,9 @@ def update_module_moved_fields( """Update module for field definition in general tables that have been moved from one module to another. + No need to use this method: moving the XMLID is covered in + Odoo and OpenUpgrade natively. + :param cr: Database cursor :param model: model name :param moved_fields: list of moved fields
[UPD] update_module_moved_fields: unneeded since <I>
OCA_openupgradelib
train
py
7e69d27e6490adfc6300d314c60fa27f951c6c32
diff --git a/api/src/main/java/org/hawkular/inventory/api/model/Feed.java b/api/src/main/java/org/hawkular/inventory/api/model/Feed.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/hawkular/inventory/api/model/Feed.java +++ b/api/src/main/java/org/hawkular/inventory/api/model/Feed.java @@ -17,6 +17,10 @@ package org.hawkular.inventory.api.model; import javax.xml.bind.annotation.XmlRootElement; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.util.Map; /** @@ -42,7 +46,10 @@ public final class Feed extends EnvironmentalEntity<Feed.Blueprint, Feed.Update> super(tenantId, environmentId, id); } - public Feed(String tenantId, String environmentId, String id, Map<String, Object> properties) { + /** JSON serialization support */ + @JsonCreator + public Feed(@JsonProperty("tenant") String tenantId, @JsonProperty("environment") String environmentId, + @JsonProperty("id") String id, @JsonProperty("properties") Map<String, Object> properties) { super(tenantId, environmentId, id, properties); }
Added JSON serialization support for Feed entity
hawkular_hawkular-inventory
train
java
a6caf0caee86cffffba839d3e4032e36dee32fb6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -218,10 +218,10 @@ setup_args = { ("buildbot/test/unit/mail", testmsgs), ("buildbot/test/unit/subdir", ["buildbot/test/unit/subdir/emit.py"]), ("buildbot/test/runs", [ - 'www.w3.org..TR.xhtml1.DTD.xhtml-lat1.ent', - 'www.w3.org..TR.xhtml1.DTD.xhtml-special.ent', - 'www.w3.org..TR.xhtml1.DTD.xhtml-symbol.ent', - 'www.w3.org..TR.xhtml1.DTD.xhtml1-transitional.dtd', + 'buildbot/test/runs/www.w3.org..TR.xhtml1.DTD.xhtml-lat1.ent', + 'buildbot/test/runs/www.w3.org..TR.xhtml1.DTD.xhtml-special.ent', + 'buildbot/test/runs/www.w3.org..TR.xhtml1.DTD.xhtml-symbol.ent', + 'buildbot/test/runs/www.w3.org..TR.xhtml1.DTD.xhtml1-transitional.dtd', ]), ], 'scripts': scripts,
add path to DTD files in setup.py
buildbot_buildbot
train
py
eb838b8115e77c7a4a5dd2328ef918bfd8a1be90
diff --git a/app/models/version.rb b/app/models/version.rb index <HASH>..<HASH> 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -17,8 +17,8 @@ class Version < ActiveRecord::Base order("versions.built_at desc") scope :by_position, order('position') + scope :with_deps, includes(:dependencies) scope :latest, where(:latest => true ) - scope :with_deps, where(:dependencies => :rubygem ) scope :prerelease, where(:prerelease => true ) scope :release, where(:prerelease => false ) scope :indexed, where(:indexed => true )
Fix Version.with_deps
rubygems_rubygems.org
train
rb
5a15faf90ebe61368814b5448a77c831c01e4345
diff --git a/javascript/atoms/locators/xpath.js b/javascript/atoms/locators/xpath.js index <HASH>..<HASH> 100644 --- a/javascript/atoms/locators/xpath.js +++ b/javascript/atoms/locators/xpath.js @@ -122,9 +122,16 @@ bot.locators.xpath.evaluate_ = function(node, path, resultType) { docForEval = doc; } var resolver = doc.createNSResolver ? - doc.createNSResolver(doc.documentElement) : - bot.locators.xpath.DEFAULT_RESOLVER_; - return docForEval.evaluate(path, node, resolver, resultType, null); + doc.createNSResolver(doc.documentElement) : + bot.locators.xpath.DEFAULT_RESOLVER_; + if (goog.userAgent.IE && !goog.userAgent.isVersion(7)) { + // IE6, and only IE6, has an issue where calling a custom function + // directly attached to the document object does not correctly propagate + // thrown errors. So in that case *only* we will use apply(). + return docForEval.evaluate.apply(null, [path, node, resolver, resultType, null]); + } else { + return docForEval.evaluate(path, node, resolver, resultType, null); + } } catch (ex) { // The Firefox XPath evaluator can throw an exception if the document is // queried while it's in the midst of reloading, so we ignore it. In all
JimEvans: Fixing xpath locator for findElement atom for error conditions in IE6. r<I>
SeleniumHQ_selenium
train
js
62c3d45cb5e2c93726613f119b3cb87441bfc17c
diff --git a/playhouse/dataset.py b/playhouse/dataset.py index <HASH>..<HASH> 100644 --- a/playhouse/dataset.py +++ b/playhouse/dataset.py @@ -18,10 +18,11 @@ from playhouse.reflection import Introspector if sys.version_info[0] == 3: basestring = str from functools import reduce - - -def open_file(f, mode, encoding='utf8'): - return open(f, mode, encoding=encoding) + def open_file(f, mode, encoding='utf8'): + return open(f, mode, encoding=encoding) +else: + def open_file(f, mode, encoding='utf8'): + return open(f, mode) class DataSet(object):
<I> compat fix for open() change in dataset.
coleifer_peewee
train
py
4e260775b29387ef9ebf68263306f9c98de0b51f
diff --git a/core/commands/dns.go b/core/commands/dns.go index <HASH>..<HASH> 100644 --- a/core/commands/dns.go +++ b/core/commands/dns.go @@ -32,6 +32,10 @@ remember. To create memorable aliases for multihashes, DNS TXT records can point to other DNS links, IPFS objects, IPNS keys, etc. This command resolves those links to the referenced object. +Note: This command can only recursively resolve DNS links, +it will fail to recursively resolve through IPNS keys etc. +For general-purpose recursive resolution, use ipfs name resolve -r. + For example, with this DNS TXT record: > dig +short TXT _dnslink.ipfs.io
docs: add a note for dns command License: MIT
ipfs_go-ipfs
train
go
f7276d7146b74547eb04f7d985ca69bec8beec0a
diff --git a/spec/flow_control_spec.rb b/spec/flow_control_spec.rb index <HASH>..<HASH> 100644 --- a/spec/flow_control_spec.rb +++ b/spec/flow_control_spec.rb @@ -14,5 +14,8 @@ describe Context, "PartialRuby context" do end assert_ruby_expr "if true; true; else; false; end" + assert_ruby_expr "if true; true; else; true; end" + assert_ruby_expr "if true; false; else; true; end" + assert_ruby_expr "if true; false; else; false; end" end \ No newline at end of file
added more examples to the flow spec
tario_partialruby
train
rb
20f8c8e376aead8cc1b4b718ea7cab6aaa16dcff
diff --git a/pyecore/ecore.py b/pyecore/ecore.py index <HASH>..<HASH> 100644 --- a/pyecore/ecore.py +++ b/pyecore/ecore.py @@ -1103,6 +1103,7 @@ EByteArray = EDataType('EByteArray', bytearray) EChar = EDataType('EChar', str) ECharacterObject = EDataType('ECharacterObject', str) EShort = EDataType('EShort', int, from_string=int) +EShortObject = EDataType('EShortObject', int, from_string=int) EJavaClass = EDataType('EJavaClass', type)
Add missing EShortObject in ECore types
pyecore_pyecore
train
py
4f87674f3e636700c14b74ac3d1e9d94319df25f
diff --git a/luminoso_api/client.py b/luminoso_api/client.py index <HASH>..<HASH> 100644 --- a/luminoso_api/client.py +++ b/luminoso_api/client.py @@ -70,6 +70,11 @@ class LuminosoClient(object): If no URL is specified, or if the specified URL is a path such as '/projects' without a scheme and domain, the client will default to https://analytics.luminoso.com/api/v5/. + + If neither token nor token_file are specified, the client will look + for a token in $HOME/.luminoso/tokens.json. The file should contain + a single json dictionary of the format + `{'root_url': 'token', 'root_url2': 'token2', ...}`. """ if url is None: url = '/' @@ -85,7 +90,7 @@ class LuminosoClient(object): with open(token_file) as tf: token_dict = json.load(tf) try: - token = token_dict.get(urlparse(root_url).netloc) + token = token_dict[root_url] except KeyError: raise LuminosoAuthError('No token stored for %s' % root_url)
fix .luminoso/tokens.json support, keys are now root_urls.
LuminosoInsight_luminoso-api-client-python
train
py
14b8a0cb8b8931214429b5b9ef61e359ac8a95a4
diff --git a/fsoopify/paths.py b/fsoopify/paths.py index <HASH>..<HASH> 100644 --- a/fsoopify/paths.py +++ b/fsoopify/paths.py @@ -28,10 +28,6 @@ class PathPart(str): return self._normcased == os.path.normcase(other) -class DirectoryPart(PathPart): - pass - - class NamePart(PathPart): def __init__(self, val): super().__init__(val) @@ -76,11 +72,11 @@ class Path(PathPart): def __ensure_dirname(self): if self._dirname is None: dn, fn = os.path.split(self) - self._dirname = DirectoryPart(dn) + self._dirname = Path(dn) self._name = NamePart(fn) @property - def dirname(self) -> DirectoryPart: + def dirname(self): ''' get directory path from path. ''' self.__ensure_dirname() return self._dirname
feat: dirname should be a new Path.
Cologler_fsoopify-python
train
py
eadfb7f1fd7b16eaf932dfeea9e3b017485ac1f7
diff --git a/src/js/gestures/zoom-handler.js b/src/js/gestures/zoom-handler.js index <HASH>..<HASH> 100644 --- a/src/js/gestures/zoom-handler.js +++ b/src/js/gestures/zoom-handler.js @@ -171,6 +171,10 @@ class ZoomHandler { } if (!panNeedsChange && !currZoomLevelNeedsChange && !restoreBgOpacity) { + // update resolution after gesture + currSlide._setResolution(destinationZoomLevel); + currSlide.applyCurrentZoomPan(); + // nothing to animate return; } @@ -212,6 +216,11 @@ class ZoomHandler { )); } }, + onComplete: () => { + // update resolution after transition ends + currSlide._setResolution(destinationZoomLevel); + currSlide.applyCurrentZoomPan(); + } }); } }
Update resolution after zoom gesture, fix #<I>
dimsemenov_PhotoSwipe
train
js
f20cc70a12219aac94bea36c0c3ba8ae70d27a1f
diff --git a/src/system/modules/metamodelsattribute_tags/MetaModels/Attribute/Tags/Tags.php b/src/system/modules/metamodelsattribute_tags/MetaModels/Attribute/Tags/Tags.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodelsattribute_tags/MetaModels/Attribute/Tags/Tags.php +++ b/src/system/modules/metamodelsattribute_tags/MetaModels/Attribute/Tags/Tags.php @@ -148,6 +148,12 @@ class Tags extends BaseComplex */ public function widgetToValue($varValue, $intId) { + // If we are in tree mode, we got a comma separate list. + if ($this->isTreePicker() && !empty($varValue) && !is_array($varValue)) + { + $varValue = explode(',', $varValue); + } + if ((!is_array($varValue)) || empty($varValue)) { return array();
Extend the support for the treepicker. Now it should possible to save the data.
MetaModels_attribute_tags
train
php
4d198cca0efaba96f1d956e50447d6fdb657b813
diff --git a/src/component.js b/src/component.js index <HASH>..<HASH> 100644 --- a/src/component.js +++ b/src/component.js @@ -1,5 +1,5 @@ import cuid from 'cuid'; -import mapboxGL from 'mapbox-gl'; +const mapboxGL = require('mapbox-gl'); const defaultMapStyle = require('./map-style.json');
mapbox-gl doesn't export ES6 module
jesstelford_aframe-map
train
js
52990acbac79e2066cd2a08543bf15a173f85ddc
diff --git a/library/blur/deferrable.rb b/library/blur/deferrable.rb index <HASH>..<HASH> 100644 --- a/library/blur/deferrable.rb +++ b/library/blur/deferrable.rb @@ -22,11 +22,13 @@ module Blur def emit name, *args callbacks = self.callbacks[name] - return unless callbacks + return if callbacks.nil? or callbacks.empty? - callbacks.each do |callback| - callback.(*args) - end if callbacks.any? + EM.defer do + callbacks.each do |callback| + callback.(*args) + end + end end # Add a new event callback. diff --git a/specifications/blur/deferrable_spec.rb b/specifications/blur/deferrable_spec.rb index <HASH>..<HASH> 100644 --- a/specifications/blur/deferrable_spec.rb +++ b/specifications/blur/deferrable_spec.rb @@ -23,6 +23,7 @@ describe Blur::Deferrable do before do allow(subject).to receive(:callbacks).and_return callbacks + allow(EventMachine).to receive(:defer).and_yield end context "when there are no matching callbacks" do
Run callbacks as an EventMachine::Deferrable
mkroman_blur
train
rb,rb
7f3cc7a39355750aa7d897b6d66f335a2d1d1aba
diff --git a/launch_control/models/sw_image.py b/launch_control/models/sw_image.py index <HASH>..<HASH> 100644 --- a/launch_control/models/sw_image.py +++ b/launch_control/models/sw_image.py @@ -12,5 +12,5 @@ class SoftwareImage(PlainOldData): __slots__ = ('desc',) - def __init__(self, desc=None): + def __init__(self, desc): self.desc = desc
SoftwareImage should fail to construct without 'desc' argument
zyga_json-schema-validator
train
py
811e71810893f8796cc5dae2e1cf58e02225c318
diff --git a/azure-storage-common/src/Common/Internal/Utilities.php b/azure-storage-common/src/Common/Internal/Utilities.php index <HASH>..<HASH> 100644 --- a/azure-storage-common/src/Common/Internal/Utilities.php +++ b/azure-storage-common/src/Common/Internal/Utilities.php @@ -562,7 +562,7 @@ class Utilities mt_rand(0, 64) + 128, // 8 bits for "clock_seq_hi", with // the most significant 2 bits being 10, // required by version 4 GUIDs. - mt_rand(0, 256), // 8 bits for "clock_seq_low" + mt_rand(0, 255), // 8 bits for "clock_seq_low" mt_rand(0, 65535), // 16 bits for "node 0" and "node 1" mt_rand(0, 65535), // 16 bits for "node 2" and "node 3" mt_rand(0, 65535) // 16 bits for "node 4" and "node 5"
Fix random number range that might cause an overflow in the guid generation
Azure_azure-storage-php
train
php
ba01297cbbba1bbd76e49261d9b912ecd71890da
diff --git a/dusty/cli/setup.py b/dusty/cli/setup.py index <HASH>..<HASH> 100644 --- a/dusty/cli/setup.py +++ b/dusty/cli/setup.py @@ -20,8 +20,6 @@ from ..commands.setup import setup_dusty_config def main(argv): args = docopt(__doc__, argv) - payload = Payload(setup_dusty_config, mac_username=args['--mac_username'], + return setup_dusty_config(mac_username=args['--mac_username'], specs_repo=args['--default_specs_repo'], nginx_includes_dir=args['--nginx_includes_dir']) - payload.run_on_daemon = False - return payload
Take the Payload stuff out of setup
gamechanger_dusty
train
py
f85a12d089b8366e3bbb6c79c09fa40045c45aab
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-indonesia-regions', - version='1.0.0-rc.1', + version='1.0.1', packages=find_packages(), include_package_data=True, license='MIT License',
feature: finalize version <I>
Keda87_django-indonesia-regions
train
py
ca235f0c539f0e0d4c9e20378277c5aafe45671d
diff --git a/src/Driver/Drush9Driver.php b/src/Driver/Drush9Driver.php index <HASH>..<HASH> 100644 --- a/src/Driver/Drush9Driver.php +++ b/src/Driver/Drush9Driver.php @@ -24,4 +24,14 @@ class Drush9Driver extends DrushDriver { } return $this->__call('userInformation', $params); } + + public function stateGet($state) + { + $args = func_get_args(); + $data = $this->__call('stateGet', $args); + if (is_array($data) && isset($data[$state])) { + return $data[$state]; + } + return $data; + } }
Handle changes to state-get output in Drush 9
drutiny_drutiny
train
php
b57562313f65a83f152ef9bfc1c6b81e1bdd13c8
diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java +++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java @@ -509,7 +509,18 @@ public class LocalExecutionPlanner @Override public PhysicalOperation visitTableWriter(TableWriterNode node, LocalExecutionPlanContext context) { - PhysicalOperation query = node.getSource().accept(this, context); + LocalExecutionPlanner queryPlanner = new LocalExecutionPlanner(session, + nodeInfo, + metadata, + node.getInputTypes(), + operatorStats, + joinHashFactory, + maxOperatorMemoryUsage, + dataStreamProvider, + storageManager, + exchangeOperatorFactory); + + PhysicalOperation query = node.getSource().accept(queryPlanner.new Visitor(), context); // introduce a projection to match the expected output IdentityProjectionInfo mappings = computeIdentityMapping(node.getInputSymbols(), query.getLayout(), node.getInputTypes());
Revert LogicalExecutionPlanner changes The sub planner is required because it gets a different symbol/type map which is needed for the execution.
prestodb_presto
train
java
4af817de2e62e30a8ae6287c359fc760c867f54c
diff --git a/pkg/services/accesscontrol/manager/manager.go b/pkg/services/accesscontrol/manager/manager.go index <HASH>..<HASH> 100644 --- a/pkg/services/accesscontrol/manager/manager.go +++ b/pkg/services/accesscontrol/manager/manager.go @@ -14,10 +14,10 @@ import ( // Manager is the service implementing role based access control. type Manager struct { - Cfg *setting.Cfg `inject:""` - RouteRegister routing.RouteRegister `inject:""` - Log log.Logger - *database.AccessControlStore + Cfg *setting.Cfg `inject:""` + RouteRegister routing.RouteRegister `inject:""` + Log log.Logger + *database.AccessControlStore `inject:""` } func init() {
Fix access control store init (#<I>)
grafana_grafana
train
go
5d83a66d8da927cb71d1550bb51466a6501f13f8
diff --git a/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php b/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php +++ b/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php @@ -78,8 +78,8 @@ abstract class AbstractCommand extends Command return $output->writeln($message); }); - if ($this->getApplication()->getHelperSet()->has('db')) { - $conn = $this->getHelper('db')->getConnection(); + if ($this->getApplication()->getHelperSet()->has('connection')) { + $conn = $this->getHelper('connection')->getConnection(); } elseif ($input->getOption('db-configuration')) { if ( ! file_exists($input->getOption('db-configuration'))) { throw new \InvalidArgumentException("The specified connection file is not a valid file.");
Fix configuration via the console helper provided by Doctrine DBAL The helper provided by Doctrine DBAL is named `connection`, not `db`.
doctrine_migrations
train
php
a4b07e03e6b38a07a9197553c8eabc8c32d9fd42
diff --git a/xdataweb/web/NER/NER.js b/xdataweb/web/NER/NER.js index <HASH>..<HASH> 100644 --- a/xdataweb/web/NER/NER.js +++ b/xdataweb/web/NER/NER.js @@ -334,8 +334,6 @@ window.onload = function(){ // Copy the thresholded nodes over to the local array, and // record their index as we go. Also make a local copy of the // original, unfiltered data. - - //nodes = []; nodes.length = 0; var fixup = {}; $.each(orignodes, function(k,v){ @@ -350,8 +348,6 @@ window.onload = function(){ // fixup index translation array (i.e., that the node data is // actually present for this threshold value). Also make a // local copy of the origlinks, unfiltered link data. - - //links = []; links.length = 0; $.each(origlinks, function(k,vv){ var v = {};
removed incorrect 'emptying' of arrays
Kitware_tangelo
train
js
35b199bb59ff84f5d9f040613389a0aace189f6e
diff --git a/app/Http/Controllers/PlaceHierarchyController.php b/app/Http/Controllers/PlaceHierarchyController.php index <HASH>..<HASH> 100644 --- a/app/Http/Controllers/PlaceHierarchyController.php +++ b/app/Http/Controllers/PlaceHierarchyController.php @@ -89,9 +89,6 @@ class PlaceHierarchyController extends AbstractBaseController if ($showmap) { $note = true; $content .= view('place-map', [ - 'module' => self::MAP_MODULE, - 'ref' => $fqpn, - 'type' => 'placelist', 'data' => $this->mapData($tree, $fqpn), ]); }
Merge parts of #<I>
fisharebest_webtrees
train
php
a473ab90e2299bfee8f9184f1828e3b1cf39380f
diff --git a/src/engine/test/Tester.js b/src/engine/test/Tester.js index <HASH>..<HASH> 100644 --- a/src/engine/test/Tester.js +++ b/src/engine/test/Tester.js @@ -103,7 +103,7 @@ function Tester(engine) { return Program.fromFile(specFile) .then((p) => { program = p; - return BuiltinLoader.load(program); + return BuiltinLoader.load(engine, program); }) .then(() => { Observation.processDeclarations(engine, program);
update Tester to pass engine when loading test specifications
lps-js_lps.js
train
js
b26c865f537c9bfc36705d9e9c95d729f66560d1
diff --git a/lib/sass/importers/filesystem.rb b/lib/sass/importers/filesystem.rb index <HASH>..<HASH> 100644 --- a/lib/sass/importers/filesystem.rb +++ b/lib/sass/importers/filesystem.rb @@ -44,6 +44,16 @@ module Sass protected + # If a full uri is passed, this removes the root from it + # otherwise returns the name unchanged + def remove_root(name) + if name.index(@root) == 0 + name[@root.length..-1] + else + name + end + end + # A hash from file extensions to the syntaxes for those extensions. # The syntaxes must be `:sass` or `:scss`. # @@ -80,7 +90,7 @@ module Sass # @param name [String] The filename to search for. # @return [(String, Symbol)] A filename-syntax pair. def find_real_file(dir, name) - for (f,s) in possible_files(name) + for (f,s) in possible_files(remove_root(name)) path = (dir == ".") ? f : "#{dir}/#{f}" if full_path = Dir[path].first full_path.gsub!(REDUNDANT_DIRECTORY,File::SEPARATOR)
Don't fail to correctly determine the mtime of an absolute path passed to a filesystem importer
sass_ruby-sass
train
rb
b9ca0096faaa49dcb5ddf81f07fb6bebdc16fa84
diff --git a/src/Client/Room.php b/src/Client/Room.php index <HASH>..<HASH> 100644 --- a/src/Client/Room.php +++ b/src/Client/Room.php @@ -49,7 +49,7 @@ class Room extends Client * @param int $id * @return \Unirest\Response */ - public function get($id = 0) + public function get($id) { return parent::get($id); } @@ -62,7 +62,7 @@ class Room extends Client * @param string $code * @return \Unirest\Response */ - public function getFromCode($code = '') + public function getFromCode($code) { return parent::getFromCode($code); }
removed uneeded default values from Room client
OpenResourceManager_client-php
train
php
7414bb72415d8b5198ca952f1cbfb7a5b6046331
diff --git a/src/Storage/FileStorage.php b/src/Storage/FileStorage.php index <HASH>..<HASH> 100644 --- a/src/Storage/FileStorage.php +++ b/src/Storage/FileStorage.php @@ -56,7 +56,7 @@ class FileStorage implements TokenStorageInterface /** * @param $key string * - * @return void + * @return bool */ public function delete($key) {
Update FileStorage.php Fix PHPDoc
sendpulse_sendpulse-rest-api-php
train
php
c2b0108ce7060939d773de89614c7b15c08c8360
diff --git a/bugwarrior/config.py b/bugwarrior/config.py index <HASH>..<HASH> 100644 --- a/bugwarrior/config.py +++ b/bugwarrior/config.py @@ -313,7 +313,9 @@ class ServiceConfig(object): if to_type: return to_type(value) return value - except: + except configparser.NoSectionError: + return default + except configparser.NoOptionError: return default def _get_key(self, key): diff --git a/tests/base.py b/tests/base.py index <HASH>..<HASH> 100644 --- a/tests/base.py +++ b/tests/base.py @@ -3,6 +3,7 @@ import shutil import os.path import tempfile import unittest +import configparser from unittest import mock import responses @@ -88,7 +89,10 @@ class ServiceTest(ConfigTest): return False def get_option(section, name): - return options[section][name] + try: + return options[section][name] + except KeyError: + raise configparser.NoOptionError(section, name) def get_int(section, name): return int(get_option(section, name))
Be more specific in matching configparser errors in config parser In Python 3, ConfigParser is more exacting about the syntax it allows, and in particular it disallows bare `%` characters. This causes an error for URLs containing such characters, but the bare `except` just treated this error as a missing configuration and did not show it to the user.
ralphbean_bugwarrior
train
py,py
1d9f3cb5c20b4eeaf684745e7086bd4f68a61aea
diff --git a/generator/classes/propel/engine/builder/om/ClassTools.php b/generator/classes/propel/engine/builder/om/ClassTools.php index <HASH>..<HASH> 100644 --- a/generator/classes/propel/engine/builder/om/ClassTools.php +++ b/generator/classes/propel/engine/builder/om/ClassTools.php @@ -99,7 +99,7 @@ class ClassTools { */ public static function getInterface(Table $table) { $interface = $table->getInterface(); - if ($interface === null) { + if ($interface === null && !$table->isReadOnly()) { $interface = "propel.om.Persistent"; } return $interface;
Read-only tables (VIEWs) cannot implement the Persistent interface.
propelorm_Propel
train
php
f24c3d9e7374233b396b7dcd4d32bb362a392b20
diff --git a/test/inputs/collection_radio_buttons_input_test.rb b/test/inputs/collection_radio_buttons_input_test.rb index <HASH>..<HASH> 100644 --- a/test/inputs/collection_radio_buttons_input_test.rb +++ b/test/inputs/collection_radio_buttons_input_test.rb @@ -26,6 +26,14 @@ class CollectionRadioButtonsInputTest < ActionView::TestCase end end + test 'nested label should not duplicate input id' do + swap SimpleForm, boolean_style: :nested do + with_input_for @user, :active, :radio_buttons, id: 'nested_id' + assert_select 'input#user_active_true' + assert_no_select 'label#user_active_true' + end + end + test 'input as radio should use i18n to translate internal labels' do store_translations(:en, simple_form: { yes: 'Sim', no: 'Não' }) do with_input_for @user, :active, :radio_buttons
Add tests to make sure that nested radian style do not generate invalid html
plataformatec_simple_form
train
rb
00a7528d12298c226d49e3242a5a6f19edbb86d5
diff --git a/src/main/java/cz/vutbr/web/csskit/antlr4/CSSTokenRecovery.java b/src/main/java/cz/vutbr/web/csskit/antlr4/CSSTokenRecovery.java index <HASH>..<HASH> 100644 --- a/src/main/java/cz/vutbr/web/csskit/antlr4/CSSTokenRecovery.java +++ b/src/main/java/cz/vutbr/web/csskit/antlr4/CSSTokenRecovery.java @@ -161,14 +161,14 @@ public class CSSTokenRecovery { } ttype1 = lexer._token; - log.debug("return >" + ttype1.getText()+"<"); + log.trace("return tokent: >" + ttype1.getText()+"<"); return ttype1; } // recover from unexpected EOF if (!ls.isBalanced()) { return generateEOFRecover(); } - log.debug("is balanced so end"); + log.trace("lexer state is balanced - emitEOF"); lexer.emitEOF(); ttype1 = lexer._token; return ttype1;
CSSTokenRecovery - debug to trace
radkovo_jStyleParser
train
java
46f7950d837045bd88aedaeb77ff519b4c499342
diff --git a/alphafilter/templatetags/alphafilter.py b/alphafilter/templatetags/alphafilter.py index <HASH>..<HASH> 100644 --- a/alphafilter/templatetags/alphafilter.py +++ b/alphafilter/templatetags/alphafilter.py @@ -69,7 +69,7 @@ def alphabet(cl): 'active': letter == alpha_lookup, 'has_entries': letter in letters_used,} for letter in all_letters] all_letters = [{ - 'link': cl.get_query_string(None,alpha_field), + 'link': cl.get_query_string(None, [alpha_field]), 'title': _('All'), 'active': '' == alpha_lookup, 'has_entries': True
Fixed github issue #3. Thanks Fabian!
coordt_django-alphabetfilter
train
py
6563b457a5bdf44a050637fb402e9296f99edda8
diff --git a/marshal.go b/marshal.go index <HASH>..<HASH> 100644 --- a/marshal.go +++ b/marshal.go @@ -230,12 +230,11 @@ func unmarshalVarchar(info TypeInfo, data []byte, value interface{}) error { *v = string(data) return nil case *[]byte: - var dataCopy []byte if data != nil { - dataCopy = make([]byte, len(data)) - copy(dataCopy, data) + *v = copyBytes(data) + } else { + *v = nil } - *v = dataCopy return nil } rv := reflect.ValueOf(value) diff --git a/marshal_test.go b/marshal_test.go index <HASH>..<HASH> 100644 --- a/marshal_test.go +++ b/marshal_test.go @@ -851,6 +851,13 @@ var marshalTests = []struct { nil, nil, }, + { + NativeType{proto: 2, typ: TypeBlob}, + []byte(nil), + ([]byte)(nil), + nil, + nil, + }, } func decimalize(s string) *inf.Dec {
marshall: allow unmarshalling into nil byte slice (#<I>)
gocql_gocql
train
go,go
dd4af4a7b4bd7edd8747f9d8185fc9efd5ef2a82
diff --git a/iotilebuild/test/test_iotilebuild/test_scons.py b/iotilebuild/test/test_iotilebuild/test_scons.py index <HASH>..<HASH> 100644 --- a/iotilebuild/test/test_iotilebuild/test_scons.py +++ b/iotilebuild/test/test_iotilebuild/test_scons.py @@ -131,6 +131,7 @@ def test_bootstrap_file(tmpdir): assert err == 0 hexdata = IntelHex(os.path.join('build','output', 'test_final.hex')) - assert hexdata.segments() == [(0x1800, 0x8000), (0x10001014, 0x10001018)] + hexdata_dup = IntelHex(os.path.join('build','output', 'test_final_dup.hex')) + assert hexdata.segments() == hexdata_dup.segments() finally: os.chdir(olddir) \ No newline at end of file
Test checks both merged hex and duplicate
iotile_coretools
train
py
b47f623d2419af47f8c116028e0f58f754cb4adf
diff --git a/src/ZenodorusError.php b/src/ZenodorusError.php index <HASH>..<HASH> 100644 --- a/src/ZenodorusError.php +++ b/src/ZenodorusError.php @@ -12,7 +12,7 @@ class ZenodorusError { protected $description = null; protected $data = null; - public function __constuct(array $args) + public function __construct(array $args) { $this->code = $args['code']; $this->description = $args['description']; @@ -47,7 +47,7 @@ class ZenodorusError { protected function get($prop) { if (property_exists($this, $prop)) { - return $prop; + return $this->$prop; } else { return false; }
Code fixes to ZenodorusError. `construct` was misspelled, and `get()` was return the prop name, not its value.
zenodorus-tools_core
train
php
0ebec2571fa4c032ee898365038f37a2e6f1aba4
diff --git a/simple_manager/__init__.py b/simple_manager/__init__.py index <HASH>..<HASH> 100644 --- a/simple_manager/__init__.py +++ b/simple_manager/__init__.py @@ -2,5 +2,5 @@ from datetime import date -__version__ = "0.1.0" +__version__ = "0.2.0" __release_date__ = date(2013, 4, 13)
version <I> in init
victorpantoja_simple-dependencies-manager
train
py
672f8e97b53e9533eeb9a1fd24b0b256f0abd9a5
diff --git a/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java b/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java +++ b/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java @@ -548,10 +548,10 @@ public class ODefaultServerSecurity implements OSecurityFactory, OServerLifecycl public void run() { try { OClientConnectionManager ccm = server.getClientConnectionManager(); - if (ccm != null) { for (OClientConnection cc : ccm.getConnections()) { try { + cc.acquire(); ODatabaseDocumentInternal ccDB = cc.getDatabase(); if (ccDB != null) { ccDB.activateOnCurrentThread(); @@ -564,6 +564,9 @@ public class ODefaultServerSecurity implements OSecurityFactory, OServerLifecycl } catch (Exception ex) { OLogManager.instance().error(this, "securityRecordChange() Exception: ", ex); } + finally { + cc.release(); + } } } } catch (Exception ex) {
Added connection.acquire() when securityRecordChange is changed
orientechnologies_orientdb
train
java