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
d9da5432b26cb17e6055bea9dc760524e2d6c852
diff --git a/lib/tinder/version.rb b/lib/tinder/version.rb index <HASH>..<HASH> 100644 --- a/lib/tinder/version.rb +++ b/lib/tinder/version.rb @@ -1,3 +1,3 @@ module Tinder - VERSION = '1.4.4' unless defined?(::Tinder::VERSION) + VERSION = '1.5.0' unless defined?(::Tinder::VERSION) end
Prep for release <I>
collectiveidea_tinder
train
rb
ec2de4927748042144b45458058711fccc03e3ab
diff --git a/session_security/tests/test_base.py b/session_security/tests/test_base.py index <HASH>..<HASH> 100644 --- a/session_security/tests/test_base.py +++ b/session_security/tests/test_base.py @@ -68,5 +68,5 @@ class BaseLiveServerTestCase(SettingsMixin, LiveServerTestCase): for win in self.browser.window_handles: self.browser.switch_to_window(win) - while self.warning_element() is False: + while self.browser.execute_script('window.sessionSecurity === undefined'): time.sleep(0.1)
Use a perhaps more stable page load waiter
yourlabs_django-session-security
train
py
2f3fc70514667ef7895735eb988af2cf88ba87ac
diff --git a/cmd/influx/cli/cli.go b/cmd/influx/cli/cli.go index <HASH>..<HASH> 100644 --- a/cmd/influx/cli/cli.go +++ b/cmd/influx/cli/cli.go @@ -83,6 +83,8 @@ func (c *CommandLine) Run() { c.Line = liner.NewLiner() defer c.Line.Close() + c.Line.SetMultiLineMode(true) + if promptForPassword { p, e := c.Line.PasswordPrompt("password: ") if e != nil {
FIX #<I> CLI support multiline
influxdata_influxdb
train
go
07b5fd9901bbe8ec5e641abdb10837075723c929
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["::Rails.env"] ||= 'test' +ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'factory_girl'
Reverting change that prevents specs from runnin
publify_publify
train
rb
17e77f149634edfe151c1c53332e315b4204dfdc
diff --git a/lib/dragonfly/job_definitions.rb b/lib/dragonfly/job_definitions.rb index <HASH>..<HASH> 100644 --- a/lib/dragonfly/job_definitions.rb +++ b/lib/dragonfly/job_definitions.rb @@ -17,6 +17,10 @@ module Dragonfly jd[name].build!(self, *args) end end + + def jobs + job_definitions.keys + end private diff --git a/spec/dragonfly/job_definitions_spec.rb b/spec/dragonfly/job_definitions_spec.rb index <HASH>..<HASH> 100644 --- a/spec/dragonfly/job_definitions_spec.rb +++ b/spec/dragonfly/job_definitions_spec.rb @@ -32,4 +32,30 @@ describe Dragonfly::JobDefinitions do end + + describe "#jobs" do + + before(:each) do + @job_definitions = Dragonfly::JobDefinitions.new + @object = Object.new + @object.extend @job_definitions + end + + it "should provide an empty list when no jobs have been definded" do + jobs = @job_definitions.jobs + jobs.should be_an Array + jobs.should be_empty + end + + it "should contain the job name when one is defined" do + job_name = :foo + @job_definitions.add job_name do |size| + process :thumb, size + end + + @job_definitions.jobs.should eq [job_name] + end + + end + end
add JobDefinitions#jobs to list the defined job methods
markevans_dragonfly
train
rb,rb
d85ea55990242557beaf076c84da2e58cd520989
diff --git a/serial_posix.go b/serial_posix.go index <HASH>..<HASH> 100644 --- a/serial_posix.go +++ b/serial_posix.go @@ -113,6 +113,7 @@ func openPort(name string, baud int, databits byte, parity Parity, stopbits Stop st.c_cflag |= C.PARODD case ParityEven: st.c_cflag |= C.PARENB + st.c_cflag &= ^C.tcflag_t(C.PARODD) default: return nil, ErrBadParity }
serial_posix: fix even parity Previously, when even parity was requested, PARODD was erroneously retained, and thus could actually result in odd parity being set (retained from what was set by tcgetattr)
tarm_serial
train
go
dc0225e2aabfcb32e03155859afb5a8fc7c39ee7
diff --git a/ci/setup_utils.py b/ci/setup_utils.py index <HASH>..<HASH> 100644 --- a/ci/setup_utils.py +++ b/ci/setup_utils.py @@ -643,8 +643,9 @@ def find_linked_dynamic_libraries(): else: log.fatal("Cannot locate dynamic library `%s`" % libname) else: - log.fatal("`locate` command returned the following error:\n%s" - % stderr.decode()) + print("%s :::: %d :::: %s" % (libname, proc.returncode, stdout.decode())) + log.fatal("`locate` command returned the following error while looking for %s:\n%s" + % (libname, stderr.decode())) return resolved
Add library name in locate command failure (#<I>) This helps in debugging when the locate command fails.
h2oai_datatable
train
py
59f48a356a6d9ada734e81c06bd6242d813e92ba
diff --git a/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpHandler.java b/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpHandler.java index <HASH>..<HASH> 100644 --- a/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpHandler.java +++ b/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpHandler.java @@ -345,8 +345,7 @@ public class HttpHandler implements Handler<HttpServerRequest> { s.setContext(context.vertxContext()); final Pump pump = Pump.pump(s, response); s.endHandler(event -> context.vertxContext().runOnContext(event1 -> { - LOGGER.debug("Ending chunked response for {} - {} bytes", - request.uri(), pump.numberPumped()); + LOGGER.debug("Ending chunked response for {}", request.uri()); response.end(); response.close(); cleanup(context);
Fix log message, as pump.numberPumped does not return the number of copied bytes.
wisdom-framework_wisdom
train
java
b2ec3c598efe5dcda90d1a65f3dee6743335ac6b
diff --git a/spec/shared_stripe_examples/charge_examples.rb b/spec/shared_stripe_examples/charge_examples.rb index <HASH>..<HASH> 100644 --- a/spec/shared_stripe_examples/charge_examples.rb +++ b/spec/shared_stripe_examples/charge_examples.rb @@ -184,7 +184,7 @@ shared_examples 'Charge API' do source: stripe_helper.generate_card_token }) bal_trans = Stripe::BalanceTransaction.retrieve(charge.balance_transaction) - expect(bal_trans.amount).to be > charge.amount + expect(bal_trans.amount).to eq(charge.amount * 1.2) expect(bal_trans.fee).to eq(39) expect(bal_trans.currency).to eq('usd') end
More precise spec for a conversion rate
rebelidealist_stripe-ruby-mock
train
rb
dd21fb378f03b8163e0308802e76ab653731021d
diff --git a/src/transformers/models/longformer/modeling_longformer.py b/src/transformers/models/longformer/modeling_longformer.py index <HASH>..<HASH> 100755 --- a/src/transformers/models/longformer/modeling_longformer.py +++ b/src/transformers/models/longformer/modeling_longformer.py @@ -1861,7 +1861,7 @@ class LongformerForSequenceClassification(LongformerPreTrainedModel): @add_start_docstrings_to_model_forward(LONGFORMER_INPUTS_DOCSTRING.format("batch_size, sequence_length")) @add_code_sample_docstrings( processor_class=_TOKENIZER_FOR_DOC, - checkpoint="jpelhaw/longformer-base-plagiarism-detection", + checkpoint="jpwahle/longformer-base-plagiarism-detection", output_type=LongformerSequenceClassifierOutput, config_class=_CONFIG_FOR_DOC, expected_output="'ORIGINAL'",
Fix the hub user name in a longformer doctest checkpoint (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
422b75a712926772a7f55bc3846183f8649edd81
diff --git a/lib/dml/simpletest/testdml.php b/lib/dml/simpletest/testdml.php index <HASH>..<HASH> 100755 --- a/lib/dml/simpletest/testdml.php +++ b/lib/dml/simpletest/testdml.php @@ -3056,6 +3056,9 @@ class dml_test extends UnitTestCase { $this->assertEqual(count($DB->get_records_sql($sql, array("1"))), 1); $this->assertEqual(count($DB->get_records_sql($sql, array(10))), 0); $this->assertEqual(count($DB->get_records_sql($sql, array("10"))), 0); + $DB->insert_record($tablename, array('course' => 7, 'content' => 'xx', 'name'=>'1abc')); + $this->assertEqual(count($DB->get_records_sql($sql, array(1))), 1); + $this->assertEqual(count($DB->get_records_sql($sql, array("1"))), 1); } function test_onelevel_commit() {
mysql comparison weirdness finally detected
moodle_moodle
train
php
176a9b1e5b8ef800f43257db1c0ca2985ad26a65
diff --git a/fastlane/lib/fastlane/documentation/docs_generator.rb b/fastlane/lib/fastlane/documentation/docs_generator.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/documentation/docs_generator.rb +++ b/fastlane/lib/fastlane/documentation/docs_generator.rb @@ -38,6 +38,7 @@ module Fastlane output << "This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run." output << "More information about fastlane can be found on [https://fastlane.tools](https://fastlane.tools)." output << "The documentation of fastlane can be found on [GitHub](https://github.com/fastlane/fastlane/tree/master/fastlane)." + output << "" File.write(output_path, output.join("\n")) UI.success "Successfully generated documentation at path '#{File.expand_path(output_path)}'" if $verbose
Add new line at end of file (#<I>)
fastlane_fastlane
train
rb
66dea1f66dbd59e888debc9bcd50a96f4619e469
diff --git a/jodd-core/src/main/java/jodd/util/NameValue.java b/jodd-core/src/main/java/jodd/util/NameValue.java index <HASH>..<HASH> 100644 --- a/jodd-core/src/main/java/jodd/util/NameValue.java +++ b/jodd-core/src/main/java/jodd/util/NameValue.java @@ -36,7 +36,7 @@ public class NameValue<N, V> { /** * Simple static constructor. */ - public static <T,R> NameValue of(T name, R value) { + public static <T,R> NameValue<T,R> of(T name, R value) { return new NameValue<>(name, value); } @@ -61,9 +61,14 @@ public class NameValue<N, V> { @Override public boolean equals(Object o) { - if (this.getClass() != o.getClass()) { + if (o == null || this.getClass() != o.getClass()) { return false; } + + if (this == o) { + return true; + } + NameValue that = (NameValue) o; Object n1 = name();
- method "of" -> Generic added - method "equals" -> null check and == check added
oblac_jodd
train
java
de8011adb2fb35497c0d081d8aba6c37d0c4467c
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -405,6 +405,14 @@ class State(object): arglen = len(aspec[0]) if isinstance(aspec[3], tuple): deflen = len(aspec[3]) + if aspec[2]: + # This state accepts kwargs + ret['kwargs'] = {} + for key in data: + # Passing kwargs the conflict with args == stack trace + if key in aspec[0]: + continue + ret['kwargs'][key] = data[key] kwargs = {} for ind in range(arglen - 1, 0, -1): minus = arglen - ind @@ -573,7 +581,10 @@ class State(object): if 'provider' in data: self.load_modules(data) cdata = self.format_call(data) - ret = self.states[cdata['full']](*cdata['args']) + if 'kwargs' in cdata: + ret = self.states[cdata['full']](*cdata['args'], **cdata['kwargs']) + else: + ret = self.states[cdata['full']](*cdata['args']) ret['__run_num__'] = self.__run_num self.__run_num += 1 format_log(ret)
Allow states to cleanly accept **kwargs This addition makes it so that ALL data in the low state chunk is passed to the state function via **kwargs. This means that by passing a **kwargs from states all the back to a module function will allow for very transparent additions of arguments to states that accept **kwargs
saltstack_salt
train
py
1c9d1f4ca8da450b37f3e0a20e86cfbdc4fb1cd9
diff --git a/src/transformers/pipelines/question_answering.py b/src/transformers/pipelines/question_answering.py index <HASH>..<HASH> 100644 --- a/src/transformers/pipelines/question_answering.py +++ b/src/transformers/pipelines/question_answering.py @@ -228,8 +228,8 @@ class QuestionAnsweringPipeline(ChunkPipeline): max_answer_len (`int`, *optional*, defaults to 15): The maximum length of predicted answers (e.g., only answers with a shorter length are considered). max_seq_len (`int`, *optional*, defaults to 384): - The maximum length of the total sentence (context + question) after tokenization. The context will be - split in several chunks (using `doc_stride`) if needed. + The maximum length of the total sentence (context + question) in tokens of each chunk passed to the + model. The context will be split in several chunks (using `doc_stride` as overlap) if needed. max_question_len (`int`, *optional*, defaults to 64): The maximum length of the question after tokenization. It will be truncated if needed. handle_impossible_answer (`bool`, *optional*, defaults to `False`):
Updating the docs for `max_seq_len` in QA pipeline (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
7fb898cd4f0b9914f160941eb5dd8433a0434adf
diff --git a/GameWindow.js b/GameWindow.js index <HASH>..<HASH> 100644 --- a/GameWindow.js +++ b/GameWindow.js @@ -337,7 +337,7 @@ GameWindow.prototype.populateRecipientSelector = function (toSelector, playerList) { - if (typeof(playerList) !== 'object' || typeof(toSelector) !== 'object') { + if ('object' !== typeof playerList || 'object' !== typeof toSelector) { return; } @@ -346,7 +346,7 @@ var opt; - var pl = new PlayerList(playerList); + var pl = new PlayerList({}, playerList); try { @@ -355,8 +355,7 @@ opt.value = p.id; opt.appendChild(document.createTextNode(p.name)); toSelector.appendChild(opt); - }, - toSelector); + }); } catch (e) { node.log('Bad Formatted Player List. Discarded. ' + p, 'ERR');
Fixed PlayerList but in GameWindow
nodeGame_nodegame-window
train
js
703ceef3399437d89638a9738b92a423595f8abc
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ var EventEmitter = require('events').EventEmitter, fmt = require('util').format var months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] -var days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'] +var days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] var dFmt = '%s-%s-%s' var dtFmt = '%s-%s-%s %s:%s' @@ -38,7 +38,7 @@ module.exports = function createDateEmitter (options) { year = now.getFullYear(), month = now.getMonth() + 1, date = now.getDate(), - weekday = now.getDay(), + weekday = now.getDay() + 1, hour = now.getHours(), minute = now.getMinutes()
day of week is now 1-7, corrected sunday position
jasonpincin_date-events
train
js
d580adb4dd9337ca4e3b6eaeaefffdf3f215ac19
diff --git a/horizon/templatetags/angular.py b/horizon/templatetags/angular.py index <HASH>..<HASH> 100644 --- a/horizon/templatetags/angular.py +++ b/horizon/templatetags/angular.py @@ -69,7 +69,8 @@ def angular_escapes(value): .replace('"', '\\"') \ .replace("'", "\\'") \ .replace("\n", "\\n") \ - .replace("\r", "\\r") + .replace("\r", "\\r") \ + .replace("\\", "\\\\") @register.inclusion_tag('angular/angular_templates.html', takes_context=True)
Escape blackslash in the angular_escapes filter
openstack_horizon
train
py
95895f3d029f5903ee5ea8b3a8a3317e14a23fb1
diff --git a/src/unexpected-react-shallow.js b/src/unexpected-react-shallow.js index <HASH>..<HASH> 100644 --- a/src/unexpected-react-shallow.js +++ b/src/unexpected-react-shallow.js @@ -1,15 +1,7 @@ -var React = require('react/addons'); -var ArrayChanges = require('array-changes'); - -var Element = require('./lib/element'); -var Write = require('./lib/write'); -var Equality = require('./lib/equality'); -var Diff = require('./lib/diff'); var ReactElement = require('./lib/ReactElement'); var ReactShallowRenderer = require('./lib/ReactShallowRenderer'); var Assertions = require('./lib/assertions'); - module.exports = { name: 'unexpected-react-shallow',
Remove unnecessary requires This was requiring `react/addons` which produces a warning in react <I>. We don't need it - it had been forgotten. Other requires were just taking up space.
bruderstein_unexpected-react-shallow
train
js
226bfbb59cd85ee2600b288fb556a2c4ba777232
diff --git a/authomatic/providers/__init__.py b/authomatic/providers/__init__.py index <HASH>..<HASH> 100644 --- a/authomatic/providers/__init__.py +++ b/authomatic/providers/__init__.py @@ -651,7 +651,8 @@ class AuthorisationProvider(BaseProvider): :class:`.UserInfoResponse` """ - return self._access_user_info() + if self.user_info_url: + return self._access_user_info() #===========================================================================
AuthorisationProvider._access_user_info() now fetches user info only if there is self.user_info_url.
authomatic_authomatic
train
py
9776b9d6c30e2b7fae2232b69b7526480b0f21f3
diff --git a/BimServer/src/org/bimserver/mail/EmailMessage.java b/BimServer/src/org/bimserver/mail/EmailMessage.java index <HASH>..<HASH> 100644 --- a/BimServer/src/org/bimserver/mail/EmailMessage.java +++ b/BimServer/src/org/bimserver/mail/EmailMessage.java @@ -55,7 +55,10 @@ public class EmailMessage { public void send() throws MessagingException { Properties props = new Properties(); ServerSettings serverSettings = bimServer.getServerSettingsCache().getServerSettings(); - props.put("mail.smtp.localhost", "bimserver.org"); + props.put("mail.smtp.localhost", "bimserver.org"); + String smtpProps = serverSettings.getSmtpProtocol() == SmtpProtocol.SMTPS ? "mail.smtps.port" : "mail.smtp.port"; + props.put(smtpProps, serverSettings.getSmtpPort()); + Session mailSession = Session.getDefaultInstance(props); Transport transport = null;
Use smtp/s port, backported from <I>
opensourceBIM_BIMserver
train
java
6fb1dfc83ad25f7a12caa9722e47c87572c34a9d
diff --git a/collection.js b/collection.js index <HASH>..<HASH> 100644 --- a/collection.js +++ b/collection.js @@ -8,20 +8,20 @@ module.exports = Backbone.Collection.extend({ if(_.isString(_collection.model)) { _collection.modelName = _collection.model; + if(app.models[_collection.model]) _collection.model = app.models[_collection.model]; - else { + else _collection.model = require('ridge/model').extend({ name: _collection.model }); - } } return _collection; }, parse: function(resp) { - if(_.isNumber(resp.totalCount)) { + if(_.isObject(resp)) { this.totalCount = resp.totalCount; return _.find(resp, _.isArray); @@ -29,5 +29,4 @@ module.exports = Backbone.Collection.extend({ return resp; } - });
Do parse logic if resp isObject, instead of it has totalCount.
thecodebureau_ridge
train
js
440d96852401fbe1787b84d4e5e4a6b74f024403
diff --git a/lib/gjp/git.rb b/lib/gjp/git.rb index <HASH>..<HASH> 100644 --- a/lib/gjp/git.rb +++ b/lib/gjp/git.rb @@ -79,6 +79,13 @@ module Gjp File.delete "#{path}.old_version" end end + + # deletes a tag + def delete_tag(tag) + Dir.chdir(@directory) do + `git tag -d gjp_#{tag}` + end + end end class GitAlreadyInitedException < Exception diff --git a/lib/gjp/project.rb b/lib/gjp/project.rb index <HASH>..<HASH> 100644 --- a/lib/gjp/project.rb +++ b/lib/gjp/project.rb @@ -83,6 +83,7 @@ module Gjp if is_dry_running if failed @git.revert_whole_directory(".", latest_tag(:dry_run_started)) + @git.delete_tag(latest_tag(:dry_run_started)) else take_snapshot "Changes during dry-run"
Bugfix: completely end dry-run in failed gjp finish
moio_tetra
train
rb,rb
8c9037f212689a9537012313f13ae98d5805c539
diff --git a/pythonwhat/Test.py b/pythonwhat/Test.py index <HASH>..<HASH> 100644 --- a/pythonwhat/Test.py +++ b/pythonwhat/Test.py @@ -96,7 +96,7 @@ class EqualTest(Test): """ Perform the actual test. result is set to False if the objects differ, True otherwise. """ - self.result = self.func(self.obj1, self.obj2) + self.result = np.all(self.func(self.obj1, self.obj2)) # Helpers for testing equality
Use numpy in equality test to reduce to boolean
datacamp_pythonwhat
train
py
851091fdf4210b28100057b1e00aad996a4f3c5f
diff --git a/conn.go b/conn.go index <HASH>..<HASH> 100644 --- a/conn.go +++ b/conn.go @@ -562,8 +562,12 @@ type QueryResultFormats []int16 // QueryResultFormatsByOID controls the result format (text=0, binary=1) of a query by the result column OID. type QueryResultFormatsByOID map[uint32]int16 -// Query executes sql with args. If there is an error the returned Rows will be returned in an error state. So it is -// allowed to ignore the error returned from Query and handle it in Rows. +// Query executes sql with args. It is safe to attempt to read from the returned Rows even if an error is returned. The +// error will be the available in rows.Err() after rows are closed. So it is allowed to ignore the error returned from +// Query and handle it in Rows. +// +// Err() on the returned Rows must be checked after the Rows is closed to determine if the query executed successfully +// as some errors can only be detected by reading the entire response. e.g. A divide by zero error on the last row. // // For extra control over how the query is executed, the types QuerySimpleProtocol, QueryResultFormats, and // QueryResultFormatsByOID may be used as the first args to control exactly how the query is executed. This is rarely
Improve Query docs regarding error detection
jackc_pgx
train
go
e2e2f3f07b2438237c2dd62638da5ef64dfdea4c
diff --git a/vcs/backends/git.py b/vcs/backends/git.py index <HASH>..<HASH> 100644 --- a/vcs/backends/git.py +++ b/vcs/backends/git.py @@ -191,11 +191,11 @@ class GitRepository(BaseRepository): def _get_url(self, url): """ Returns normalized url. If schema is not given, would fall to - filesystem (``file://``) schema. + filesystem (``file:///``) schema. """ url = str(url) if url != 'default' and not '://' in url: - url = '://'.join(('file', url)) + url = ':///'.join(('file', url)) return url @LazyProperty diff --git a/vcs/backends/hg.py b/vcs/backends/hg.py index <HASH>..<HASH> 100644 --- a/vcs/backends/hg.py +++ b/vcs/backends/hg.py @@ -392,11 +392,11 @@ class MercurialRepository(BaseRepository): """ Returns normalized url. If schema is not given, would fall to filesystem - (``file://``) schema. + (``file:///``) schema. """ url = str(url) if url != 'default' and not '://' in url: - url = '://'.join(('file', url)) + url = ':///'.join(('file', url)) return url def get_changeset(self, revision=None):
fixes issue with file:/// paths on windows
codeinn_vcs
train
py,py
3c14aa4ffdf1334d2ea3f92977e8b1ec8129f401
diff --git a/stacker/hooks/iam.py b/stacker/hooks/iam.py index <HASH>..<HASH> 100644 --- a/stacker/hooks/iam.py +++ b/stacker/hooks/iam.py @@ -46,6 +46,7 @@ def create_ecs_service_role(provider, context, **kwargs): raise policy = Policy( + Version='2012-10-17', Statement=[ Statement( Effect=Allow,
Fix IAM test errors due to missing version (#<I>) Moto is requiring policy documents to be at least version <I>-<I>-<I>, so add that property.
cloudtools_stacker
train
py
6b9fe859c06e1630cdb6cb10f1afd7c145e5ab6b
diff --git a/preferencesfx-demo/src/main/java/module-info.java b/preferencesfx-demo/src/main/java/module-info.java index <HASH>..<HASH> 100644 --- a/preferencesfx-demo/src/main/java/module-info.java +++ b/preferencesfx-demo/src/main/java/module-info.java @@ -1,6 +1,9 @@ module com.dlsc.preferencesfx.demo { requires com.dlsc.preferencesfx; + requires org.apache.logging.log4j; + requires org.apache.logging.log4j.core; + requires org.apache.logging.log4j.slf4j; exports com.dlsc.preferencesfx.demo;
Fixed an issue in demo module related to logging.
dlemmermann_PreferencesFX
train
java
2aabb30498c43681abed21c788d652e76780e20d
diff --git a/tests/integration/price/basketconstruct.php b/tests/integration/price/basketconstruct.php index <HASH>..<HASH> 100644 --- a/tests/integration/price/basketconstruct.php +++ b/tests/integration/price/basketconstruct.php @@ -138,7 +138,7 @@ class BasketConstruct foreach ( $aCategory['oxarticles'] as $sArticleId ) { $aData = array ( 'oxcatnid' => $oCat->getId(), - 'oxobjectid' => $aCategory['oxarticles'][$sArticleId] + 'oxobjectid' => $sArticleId ); $this->createObj2Obj( $aData, 'oxobject2category' ); }
Fixing basketConstructor's categories creation, assigning object2discount adding integration test case for <I>: Discounts don't work for variant articles assigned via category (cherry picked from commit dad<I>) (cherry picked from commit 1d1e7a4)
OXID-eSales_oxideshop_ce
train
php
b12acfc8f1bce76641ef2fb16dd683decd53ceca
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -36,16 +36,6 @@ require "spree/testing_support/authorization_helpers" FactoryGirl.definition_file_paths = %w{./spec/factories} FactoryGirl.find_definitions -module Spree - module Adyen - module TestHelper - def test_credentials - @tc ||= YAML::load_file(File.new("#{Engine.config.root}/config/credentials.yml")) - end - end - end -end - RSpec.configure do |config| RSpec::Matchers.define_negated_matcher :keep, :change @@ -60,8 +50,6 @@ RSpec.configure do |config| config.include Spree::TestingSupport::UrlHelpers config.filter_run_excluding :external => true - - config.include Spree::Adyen::TestHelper end VCR.configure do |c|
Remove adyen test helper We don't use the test credentials anymore
StemboltHQ_solidus-adyen
train
rb
bf3379a817809f7c9f92d158e2c3de186e06f358
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -5,7 +5,7 @@ describe('XmlParserMiddleware', function () { describe('#testMime', function () { - var regexp = /^(text\/xml|application\/([\w!#\$%&\*`\-\.\^~]+\+)?xml)$/i; + var regexp = xmlparser.regexp; it('should detect common XML mime-types', function () {
chore: use same regexp in tests as in module itself
macedigital_express-xml-bodyparser
train
js
86a215c442d3d4f3fd783eebc6de9383c7c0df7a
diff --git a/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java b/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java +++ b/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java @@ -387,6 +387,7 @@ public class MemcachedSessionService { public void shutdown() { _log.info( "Stopping services." ); + _manager.getContainer().getParent().getPipeline().removeValve(_trackingHostValve); _backupSessionService.shutdown(); if ( _lockingStrategy != null ) { _lockingStrategy.shutdown();
remove valve on shutdown, otherwise it will remain on the main container
magro_memcached-session-manager
train
java
f5be61340587f6ebc43f1bd9b998c672b40153b0
diff --git a/src/org/jgroups/protocols/pbcast/GMS.java b/src/org/jgroups/protocols/pbcast/GMS.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/protocols/pbcast/GMS.java +++ b/src/org/jgroups/protocols/pbcast/GMS.java @@ -705,12 +705,13 @@ public class GMS extends Protocol implements DiagnosticsHandler.ProbeHandler { if(validView && flushProtocolInStack) { int attemptCount = 0; while (attemptCount < maxAttempts) { + if (attemptCount > 0) + Util.sleepRandom(randomFloor, randomCeiling); try { up_prot.up(new Event(Event.SUSPEND, new ArrayList<Address>(new_view.getMembers()))); successfulFlush = true; break; } catch (Exception e) { - Util.sleepRandom(randomFloor, randomCeiling); attemptCount++; } } @@ -1396,4 +1397,4 @@ public class GMS extends Protocol implements DiagnosticsHandler.ProbeHandler { } -} \ No newline at end of file +}
No need to sleep once you've already decided that a flush has failed
belaban_JGroups
train
java
009b835fc4198ad07b68057df5736d7d67fe61dd
diff --git a/src/Annotations/Parameter.php b/src/Annotations/Parameter.php index <HASH>..<HASH> 100644 --- a/src/Annotations/Parameter.php +++ b/src/Annotations/Parameter.php @@ -274,7 +274,9 @@ if (\PHP_VERSION_ID >= 80100) { { public function __construct( array $properties = [], + string $parameter = Generator::UNDEFINED, string $name = Generator::UNDEFINED, + string $description = Generator::UNDEFINED, string $in = Generator::UNDEFINED, ?bool $required = null, string $ref = Generator::UNDEFINED, @@ -284,7 +286,9 @@ if (\PHP_VERSION_ID >= 80100) { ?array $attachables = null ) { parent::__construct($properties + [ + 'parameter' => $parameter, 'name' => $name, + 'description' => $description, 'in' => $this->in !== Generator::UNDEFINED ? $this->in : $in, 'required' => $this->required !== Generator::UNDEFINED ? $this->required : ($required ?? Generator::UNDEFINED), 'ref' => $ref,
Add missing parameter attribute args (#<I>) Merging as PRs are starting to pile up...
zircote_swagger-php
train
php
38e4bbbf2e3f736091515961b015c4b9bdbc9ab6
diff --git a/optlang/__init__.py b/optlang/__init__.py index <HASH>..<HASH> 100644 --- a/optlang/__init__.py +++ b/optlang/__init__.py @@ -16,6 +16,9 @@ __version__ = '0.0.1' +import logging +log = logging.getLogger(__name__) + from .util import list_available_solvers available_solvers = list_available_solvers() @@ -26,6 +29,11 @@ elif available_solvers['GUROBI']: elif available_solvers['CPLEX']: from .cplex_interface import Model, Variable, Constraint, Objective else: - raise Warning('No solvers available.') + log.error('No solvers available.') -__all__ = [] \ No newline at end of file +# __all__ = ( +# 'Model', +# 'Variable', +# 'Constraint', +# 'Objective', +# )
Log an error if no solvers are installed.
biosustain_optlang
train
py
4f46c040de0cf3f110129e9ecca2fd0284a30119
diff --git a/flubber/timeout.py b/flubber/timeout.py index <HASH>..<HASH> 100644 --- a/flubber/timeout.py +++ b/flubber/timeout.py @@ -32,7 +32,7 @@ class Timeout(BaseException): assert not self._timer, '%r is already started; to restart it, cancel it first' % self loop = flubber.current.loop current = flubber.current.task - if self.seconds is None: + if self.seconds is None or self.seconds < 0: # "fake" timeout (never expires) self._timer = None elif self.exception is None or isinstance(self.exception, bool): diff --git a/tests/test_timeout.py b/tests/test_timeout.py index <HASH>..<HASH> 100644 --- a/tests/test_timeout.py +++ b/tests/test_timeout.py @@ -29,6 +29,15 @@ class TimeoutTests(FlubberTestCase): flubber.spawn(func) self.loop.run() + def test_with_negative_timeout(self): + def sleep(): + with Timeout(-1): + flubber.sleep(0.01) + def func(): + sleep() + flubber.spawn(func) + self.loop.run() + def test_timeout_custom_exception(self): def sleep(): with Timeout(0.01, FooTimeout):
If seconds is negative, make Timeout objects infinite
saghul_evergreen
train
py,py
372525bfe68c909c7d7a8b5f92bdfc31ef361149
diff --git a/command/install_lib.py b/command/install_lib.py index <HASH>..<HASH> 100644 --- a/command/install_lib.py +++ b/command/install_lib.py @@ -7,6 +7,11 @@ from types import IntType from distutils.core import Command from distutils.errors import DistutilsOptionError + +# Extension for Python source files. +PYTHON_SOURCE_EXTENSION = os.extsep + "py" + + class install_lib (Command): description = "install all Python modules (extensions and pure Python)" @@ -155,6 +160,12 @@ class install_lib (Command): def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: + # Since build_py handles package data installation, the + # list of outputs can contain more than just .py files. + # Make sure we only report bytecode for the .py files. + ext = os.path.splitext(os.path.normcase(py_file))[1] + if ext != PYTHON_SOURCE_EXTENSION: + continue if self.compile: bytecode_files.append(py_file + "c") if self.optimize > 0:
Since build_py handles package data installation, the list of outputs can contain more than just .py files. Make sure we only report bytecode files for the .py files.
pypa_setuptools
train
py
53b20fd15eb0c16012364afed2a1cfaa7ca305b4
diff --git a/core-bundle/tests/Command/AutomatorCommandTest.php b/core-bundle/tests/Command/AutomatorCommandTest.php index <HASH>..<HASH> 100644 --- a/core-bundle/tests/Command/AutomatorCommandTest.php +++ b/core-bundle/tests/Command/AutomatorCommandTest.php @@ -62,6 +62,7 @@ class AutomatorCommandTest extends TestCase public function testToString() { $command = new AutomatorCommand('contao:automator'); + $command->setFramework($this->mockContaoFramework()); $this->assertContains('The name of the task:', $command->__toString()); }
[Core] Fix the AutomatorCommandTest class.
contao_contao
train
php
ba5b63556f654b71fa7612b4f83061b524311cc7
diff --git a/lib/swag_dev/project/sham/tasks/doc.rb b/lib/swag_dev/project/sham/tasks/doc.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/sham/tasks/doc.rb +++ b/lib/swag_dev/project/sham/tasks/doc.rb @@ -10,6 +10,9 @@ SwagDev::Project::Sham.define('tasks/doc') do |c| c.attributes do { yardopts: SwagDev.project.sham!(:yardopts), + dependencies: { + 'gem:gemspec' => 'swag_dev/project/tasks/gem' + }.to_a, ignored_patterns: [ %r{/\.#}, /_flymake\.rb$/,
sham/tasks/doc (lib) dependencies
SwagDevOps_kamaze-project
train
rb
cb3d757a83c652eccbbd50d27357ec2e733d85d0
diff --git a/main_test.go b/main_test.go index <HASH>..<HASH> 100644 --- a/main_test.go +++ b/main_test.go @@ -91,8 +91,8 @@ var _ = Describe("Converger", func() { task := models.Task{ Domain: "tests", - Guid: "task-guid", - Stack: "stack", + TaskGuid: "task-guid", + Stack: "stack", Actions: []models.ExecutorAction{ { Action: models.RunAction{ @@ -106,7 +106,7 @@ var _ = Describe("Converger", func() { err := bbs.DesireTask(task) Ω(err).ShouldNot(HaveOccurred()) - err = bbs.ClaimTask(task.Guid, "dead-executor") + err = bbs.ClaimTask(task.TaskGuid, "dead-executor") Ω(err).ShouldNot(HaveOccurred()) }
task.Guid -> task.TaskGuid
cloudfoundry_converger
train
go
ef73f98d79b2c0ca8349749d2bad5118c6e6ed68
diff --git a/dipper/sources/Source.py b/dipper/sources/Source.py index <HASH>..<HASH> 100644 --- a/dipper/sources/Source.py +++ b/dipper/sources/Source.py @@ -357,7 +357,7 @@ class Source: fd.write(chunk) logger.info("Finished. Wrote file to %s", localfile) - if self.compare_local_remote_bytes(remotefile, localfile): + if self.compare_local_remote_bytes(remotefile, localfile, headers): logger.debug( "local file is same size as remote after download") else: @@ -471,14 +471,15 @@ class Source: byte_size = os.stat(localfile) return byte_size[ST_SIZE] - def compare_local_remote_bytes(self, remotefile, localfile): + def compare_local_remote_bytes( + self, remotefile, localfile, remote_headers=None): """ test to see if fetched file is the same size as the remote file using information in the content-length field in the HTTP header :return: True or False """ is_equal = True - remote_size = self.get_remote_content_len(remotefile) + remote_size = self.get_remote_content_len(remotefile, remote_headers) local_size = self.get_local_file_size(localfile) if remote_size is not None and local_size != int(remote_size): is_equal = False
send request headers when checking response headers
monarch-initiative_dipper
train
py
bb5422822c17aeb5014d7a35ab2fbbc2576ecd74
diff --git a/src/model.js b/src/model.js index <HASH>..<HASH> 100644 --- a/src/model.js +++ b/src/model.js @@ -6,8 +6,14 @@ module.exports = function ($http, $q, ModelRelation, modelCacheFactory) { var internals = {}; - var BaseModel = function (attributes) { + var BaseModel = function (attributes, options) { angular.extend(this, attributes); + if (options && options.withRelated) { + var model = this; + options.withRelated.forEach(function (relation) { + model.related(relation); + }); + } return internals.cached(this); }; diff --git a/test/unit/model.js b/test/unit/model.js index <HASH>..<HASH> 100644 --- a/test/unit/model.js +++ b/test/unit/model.js @@ -68,6 +68,14 @@ describe('BaseModel', function () { expect(cached).to.have.property('id'); }); + it('instantiates specified relations', function () { + sinon.stub(Model.prototype, 'related'); + model = new Model({}, { + withRelated: ['relation'] + }); + expect(model.related).to.have.been.calledWith('relation'); + }); + }); describe('BaseModel#extend', function () {
allow model constructor to instantiate relations
bendrucker_convex
train
js,js
c99dd32cf1a7c74a36fd61b7e322bd1ba0c0934e
diff --git a/packages/material-ui/src/styles/createPalette.js b/packages/material-ui/src/styles/createPalette.js index <HASH>..<HASH> 100644 --- a/packages/material-ui/src/styles/createPalette.js +++ b/packages/material-ui/src/styles/createPalette.js @@ -119,16 +119,14 @@ export default function createPalette(palette) { if (process.env.NODE_ENV !== 'production') { const contrast = getContrastRatio(background, contrastText); - if (process.env.NODE_ENV !== 'production') { - if (contrast < 3) { - console.error( - [ - `Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, - 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', - 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast', - ].join('\n'), - ); - } + if (contrast < 3) { + console.error( + [ + `Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, + 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', + 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast', + ].join('\n'), + ); } }
[core] Remove redundant production check (#<I>) This extra if condition is redundant.
mui-org_material-ui
train
js
0e4f91fca2a0c957cae97704f639832a3d82f403
diff --git a/salt/modules/file.py b/salt/modules/file.py index <HASH>..<HASH> 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -1452,6 +1452,15 @@ def line(path, content, match=None, mode=None, location=None, :param indent Keep indentation with the previous line. + If an equal sign (``=``) appears in an argument to a Salt command, it is + interpreted as a keyword argument in the format of ``key=val``. That + processing can be bypassed in order to pass an equal sign through to the + remote shell command by manually specifying the kwarg: + + .. code-block:: bash + + salt '*' file.line /path/to/file content="CREATEMAIL_SPOOL=no" match="CREATE_MAIL_SPOOL=yes" mode="replace" + CLI Examples: .. code-block:: bash
Add warning about using "=" in file.line function Warnings for passing kwargs with equal signs as part of the value exist in other file.x functions, but was missing for the file.line execution module function. This adds the relevant warning. Fixes #<I>
saltstack_salt
train
py
9f362a39c48b2c2c94304b9d9af81d87e0c0e1b1
diff --git a/fritzhome/fritz.py b/fritzhome/fritz.py index <HASH>..<HASH> 100644 --- a/fritzhome/fritz.py +++ b/fritzhome/fritz.py @@ -16,7 +16,10 @@ from collections import namedtuple from xml.etree import ElementTree as ET from requests import Session -from bs4 import BeautifulSoup +try: + from bs4 import BeautifulSoup +except ImportError: + BeautifulSoup = None from .actor import Actor @@ -269,6 +272,8 @@ class FritzBox(object): """ Return the system logs since the last reboot. """ + assert BeautifulSoup, "Please install bs4 to use this method" + url = self.base_url + "/system/syslog.lua" response = self.session.get(url, params={ 'sid': self.sid,
Fix bs4 dependency in code
DerMitch_fritzbox-smarthome
train
py
1426a6e0428f385fe0b97d2a20bb05d5681da0a2
diff --git a/pymatgen/entries/compatibility.py b/pymatgen/entries/compatibility.py index <HASH>..<HASH> 100644 --- a/pymatgen/entries/compatibility.py +++ b/pymatgen/entries/compatibility.py @@ -865,8 +865,9 @@ class MaterialsProject2020Compatibility(Compatibility): # if config_file: # self.config_file = config_file # else: - self.config_file = os.path.join(MODULE_DIR, "MP2020Compatibility.yaml") - c = loadfn(self.config_file) + self.config_file = None + c = loadfn(os.path.join(MODULE_DIR, "MP2020Compatibility.yaml")) + self.name = c["Name"] self.comp_correction = c["Corrections"].get("CompositionCorrections", defaultdict(float)) self.comp_errors = c["Uncertainties"].get("CompositionCorrections", defaultdict(float))
fix: force path to None as a temp measure
materialsproject_pymatgen
train
py
d3ea6802b142b27bcabbc474ad739fa5d30019eb
diff --git a/lib/meter_cat/version.rb b/lib/meter_cat/version.rb index <HASH>..<HASH> 100644 --- a/lib/meter_cat/version.rb +++ b/lib/meter_cat/version.rb @@ -1,3 +1,3 @@ module MeterCat - VERSION = '0.0.5' + VERSION = '0.0.6' end
Bumping version to <I>
schrodingersbox_meter_cat
train
rb
fb26377a2b425dc4859f5c3e40fecba56bd5d7f5
diff --git a/sacred/utils.py b/sacred/utils.py index <HASH>..<HASH> 100644 --- a/sacred/utils.py +++ b/sacred/utils.py @@ -64,9 +64,9 @@ NO_LOGGER.disabled = 1 if sys.version_info[0] == 2: PYTHON2_RAISE = """ def raise_with_traceback(exc, traceback): - raise exc, None, traceback + raise exc, None, traceback.tb_next """ exec PYTHON2_RAISE else: def raise_with_traceback(exc, traceback): - raise exc.with_traceback(traceback) + raise exc.with_traceback(traceback.tb_next)
removed new raise_with_traceback function from traceback
IDSIA_sacred
train
py
06995e548978f1a8c51c138ad2290f9e98ed2c03
diff --git a/src/jsep.js b/src/jsep.js index <HASH>..<HASH> 100644 --- a/src/jsep.js +++ b/src/jsep.js @@ -103,8 +103,8 @@ // and move down from 3 to 2 to 1 character until a matching binary operation is found // then, return that binary operation gobbleBinaryOp = function() { - var biop, to_check = expr.substr(index, 3), tc_len = to_check.length; gobbleSpaces(); + var biop, to_check = expr.substr(index, 3), tc_len = to_check.length; while(tc_len > 0) { if(binary_ops.hasOwnProperty(to_check)) { index += tc_len;
Gobble spaces before looking for a binary op
soney_jsep
train
js
9ffe3c712d1c77d2f02da290945f4a560fd2b879
diff --git a/lib/jets/builders/reconfigure_rails/config/initializers/jets.rb b/lib/jets/builders/reconfigure_rails/config/initializers/jets.rb index <HASH>..<HASH> 100644 --- a/lib/jets/builders/reconfigure_rails/config/initializers/jets.rb +++ b/lib/jets/builders/reconfigure_rails/config/initializers/jets.rb @@ -9,3 +9,6 @@ Rails.application.config.action_controller.asset_host = asset_host Rails.application.config.assets.debug = false Rails.application.config.assets.compile = false Rails.application.config.public_file_server.enabled = true + +# Looks better without colorizatiion in CloudWatch logs +Rails.application.config.colorize_logging = false
disable config.colorize_logging = false for rails apps
tongueroo_jets
train
rb
f18a0b71ce0823ae9723c38a5ef85be2a35ea09e
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,7 +35,7 @@ import pkg_resources # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +needs_sphinx = '1.6.3' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. diff --git a/nox.py b/nox.py index <HASH>..<HASH> 100644 --- a/nox.py +++ b/nox.py @@ -29,7 +29,7 @@ def docs(session): # Install Sphinx and also all of the google-cloud-* packages. session.chdir(os.path.realpath(os.path.dirname(__file__))) - session.install('Sphinx >= 1.6.2', 'sphinx_rtd_theme') + session.install('Sphinx >= 1.6.3', 'sphinx_rtd_theme') session.install( 'core/', 'storage/',
Use Sphinx <I> on local and RTD. (#<I>)
googleapis_google-cloud-python
train
py,py
5c188b510f8dc5e3ab1f8bf5f9ecb975b10beb8c
diff --git a/mailchimp3/entities/campaigns.py b/mailchimp3/entities/campaigns.py index <HASH>..<HASH> 100755 --- a/mailchimp3/entities/campaigns.py +++ b/mailchimp3/entities/campaigns.py @@ -171,7 +171,7 @@ class Campaigns(BaseApi): raise KeyError('The campaign settings must have a subject_line') if 'from_name' not in data['settings']: raise KeyError('The campaign settings must have a from_name') - if 'reply_to' not in data['setting']: + if 'reply_to' not in data['settings']: raise KeyError('The campaign settings must have a reply_to') check_email(data['settings']['reply_to']) return self._mc_client._patch(url=self._build_path(campaign_id), data=data)
Fix incorrect key from issue <I>
VingtCinq_python-mailchimp
train
py
234b6bbba9096eb70eccd7f4d4fa1efd32c0bcca
diff --git a/superset/db_engine_specs/oracle.py b/superset/db_engine_specs/oracle.py index <HASH>..<HASH> 100644 --- a/superset/db_engine_specs/oracle.py +++ b/superset/db_engine_specs/oracle.py @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. from datetime import datetime -from typing import Optional +from typing import Any, List, Optional, Tuple from superset.db_engine_specs.base import BaseEngineSpec, LimitMethod from superset.utils import core as utils @@ -58,3 +58,16 @@ class OracleEngineSpec(BaseEngineSpec): @classmethod def epoch_ms_to_dttm(cls) -> str: return "TO_DATE('1970-01-01','YYYY-MM-DD')+(1/24/60/60/1000)*{col}" + + @classmethod + def fetch_data( + cls, cursor: Any, limit: Optional[int] = None + ) -> List[Tuple[Any, ...]]: + """ + :param cursor: Cursor instance + :param limit: Maximum number of rows to be returned by the cursor + :return: Result of query + """ + if not cursor.description: + return [] + return super().fetch_data(cursor, limit)
fix(db-engine-spec): execute oracle DML statement bug in sqllab (#<I>) * fix execute oracle DML statement bug in sqllab when i execute oracle sql statements like update in SQLLAB, get "oracle error: not a query" error. Refer <URL> method yet. * Apply suggestions from code review
apache_incubator-superset
train
py
102db8fa76e743d532175869723ff6d5f0e22742
diff --git a/src/Providers/MetadataBaseProvider.php b/src/Providers/MetadataBaseProvider.php index <HASH>..<HASH> 100644 --- a/src/Providers/MetadataBaseProvider.php +++ b/src/Providers/MetadataBaseProvider.php @@ -18,12 +18,12 @@ abstract class MetadataBaseProvider extends ServiceProvider } /** - * @param $isCaching - * @param $hasCache - * @param $key + * @param bool $isCaching + * @param bool|null $hasCache + * @param string $key * @param $meta */ - protected function handlePostBoot($isCaching, $hasCache, $key, $meta) + protected function handlePostBoot(bool $isCaching, $hasCache, string $key, $meta) { if (!$isCaching) { Cache::forget($key);
Type-hint non-public methods in MetadataBaseProvider
Algo-Web_POData-Laravel
train
php
2bf1c14b09367283fe89749a5c7b302e8d9632fa
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,7 @@ exports.attach = function (server) { else { var filePaths = [ // socket.io - '/node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js', + '/node_modules/socket.io/node_modules/socket.io-client/socket.io.js', // shotgun client '/client/shotgun.client.js', // cooltype
Updated path to socket.io client library.
chevex-archived_shotgun-client
train
js
ab3e38d96ad7a57680000bff22ca3be6f4b9daa6
diff --git a/Kwf_js/EyeCandy/Tabs/Tabs.js b/Kwf_js/EyeCandy/Tabs/Tabs.js index <HASH>..<HASH> 100644 --- a/Kwf_js/EyeCandy/Tabs/Tabs.js +++ b/Kwf_js/EyeCandy/Tabs/Tabs.js @@ -18,8 +18,8 @@ Kwf.Tabs = function(el) { this.el = el; this.el.addClass('kwfTabsFx'); this._activeTabIdx = null; - this.switchEls = Ext.query('.kwfTabsLink', this.el.dom); - this.contentEls = Ext.query('.kwfTabsContent', this.el.dom); + this.switchEls = Ext.query('> .kwfTabsLink', this.el.dom); + this.contentEls = Ext.query('> .kwfTabsContent', this.el.dom); this.fxDuration = .5; this.tabsContents = this.el.createChild({
fix tabs in tabs only search for direct children
koala-framework_koala-framework
train
js
6266f6e99acd6a3462caa8561bb2e9f689d7f6a1
diff --git a/pyman/Action.py b/pyman/Action.py index <HASH>..<HASH> 100644 --- a/pyman/Action.py +++ b/pyman/Action.py @@ -27,7 +27,7 @@ class Back( Action ): class Cmd( Action ): - def __init__( self, name, cmd ): + def __init__( self, name, cmd = "" ): super( Cmd, self ).__init__( name ) self.cmd = cmd diff --git a/pyman/Main.py b/pyman/Main.py index <HASH>..<HASH> 100644 --- a/pyman/Main.py +++ b/pyman/Main.py @@ -3,18 +3,21 @@ from . import Page class Main( Page ): - def __init__( self, title, chars = None ): + def __init__( self, title, actions = None, chars = None ): self.title = title self.chars = chars self.current = [ self ] self.current_title = "" - self.width, self.height = Screen.size() self.is_automated = False + self.width, self.height = Screen.size() + if self.chars is None: self.chars = [ "=", "-", ") " ] super( Main, self ).__init__( "Main Menu", menu = self, parent = self ) + if actions is not None: self.add( actions ) + def header( self ): Screen.clear() self.width, self.height = Screen.size()
Updated pyman.Main to include Actions on __init__ Updated pyman.Action.Cmd to have a default of "" for cmd
MarkLark_pyman
train
py,py
b1447d447e43fb03687b8d959ea0b4f2f0fa61f1
diff --git a/sos/report/plugins/python.py b/sos/report/plugins/python.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/python.py +++ b/sos/report/plugins/python.py @@ -9,7 +9,7 @@ # See the LICENSE file in the source distribution for further information. from sos.report.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -import sos.policies +from sos.policies.distros.redhat import RHELPolicy import os import json import hashlib @@ -42,7 +42,7 @@ class RedHatPython(Python, RedHatPlugin): def setup(self): self.add_cmd_output(['python2 -V', 'python3 -V']) - if isinstance(self.policy, sos.policies.redhat.RHELPolicy) and \ + if isinstance(self.policy, RHELPolicy) and \ self.policy.dist_version() > 7: self.python_version = "/usr/libexec/platform-python -V" super(RedHatPython, self).setup()
[python] Update import for RHELPolicy Updates the import of `RHELPolicy` for setting the python version checking command on RHEL systems. Related: #<I>
sosreport_sos
train
py
d2ff4a91898a8208afa526e26d21362dcfbe4fff
diff --git a/test/Creatable-test.js b/test/Creatable-test.js index <HASH>..<HASH> 100644 --- a/test/Creatable-test.js +++ b/test/Creatable-test.js @@ -232,4 +232,9 @@ describe('Creatable', () => { expect(test(188), 'to be', true); expect(test(1), 'to be', false); }); + + it('default :onInputKeyDown should run user provided handler.', (done) => { + createControl({ onInputKeyDown: event => done() }); + return creatableInstance.onInputKeyDown({ keyCode: 97 }); + }); });
Add unit test for fix - Creatable doesn't allow input key down handling. #<I>
HubSpot_react-select-plus
train
js
d52e5dd32df7f0caecb51812617a8bb4f1e3e666
diff --git a/lib/dataformatlib.php b/lib/dataformatlib.php index <HASH>..<HASH> 100644 --- a/lib/dataformatlib.php +++ b/lib/dataformatlib.php @@ -44,7 +44,7 @@ function download_as_dataformat($filename, $dataformat, $columns, $iterator, $ca $classname = 'dataformat_' . $dataformat . '\writer'; if (!class_exists($classname)) { - throw new coding_exception("Unable to locate dataformat/$type/classes/writer.php"); + throw new coding_exception("Unable to locate dataformat/$dataformat/classes/writer.php"); } $format = new $classname;
MDL-<I> dataformat lib: Change a wrong variable name The variable $type really is $dataformat. I have changed it for prevent the error and show a correct error message.
moodle_moodle
train
php
8d47bdc719bf83d6ce5bed8efede260dfa2165be
diff --git a/lib/generators/templates/effective_orders.rb b/lib/generators/templates/effective_orders.rb index <HASH>..<HASH> 100644 --- a/lib/generators/templates/effective_orders.rb +++ b/lib/generators/templates/effective_orders.rb @@ -28,7 +28,7 @@ EffectiveOrders.setup do |config| # # Or disable the check completely: # config.authorization_method = false - config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) } # CanCan gem + config.authorization_method = Proc.new { |controller, action, resource| true } # Register Effective::Order with ActiveAdmin if ActiveAdmin is present config.use_active_admin = true
Add back true to my authorization method template initializer
code-and-effect_effective_orders
train
rb
17e011617e06a2e69e1d1311c7daa429d1e22d1f
diff --git a/c7n/resources/ec2.py b/c7n/resources/ec2.py index <HASH>..<HASH> 100644 --- a/c7n/resources/ec2.py +++ b/c7n/resources/ec2.py @@ -275,7 +275,6 @@ class InstanceImage(ValueFilter, InstanceImageBase): # Match instead on empty skeleton? return False return self.match(image) - @filters.register('offhour') diff --git a/c7n/resources/s3.py b/c7n/resources/s3.py index <HASH>..<HASH> 100644 --- a/c7n/resources/s3.py +++ b/c7n/resources/s3.py @@ -1188,8 +1188,8 @@ class DeleteBucket(ScanBucket): self.manager.ctx.metrics.flush() log.info( - ("EmptyBucket bucket:%s Complete keys:%d rate:%0.2f/s time:%0.2fs"), - r['Bucket'], object_count, float(object_count) / run_time, run_time) + ("EmptyBucket buckets:%d Complete keys:%d rate:%0.2f/s time:%0.2fs"), + len(buckets), object_count, float(object_count) / run_time, run_time) return results def process_chunk(self, batch, bucket):
fix errant var in s3 delete (#<I>)
cloud-custodian_cloud-custodian
train
py,py
04744417eb97c9856c33892cc87476052ceb1e65
diff --git a/src/main/java/org/archive/util/binsearch/impl/http/ApacheHttp31SLR.java b/src/main/java/org/archive/util/binsearch/impl/http/ApacheHttp31SLR.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/archive/util/binsearch/impl/http/ApacheHttp31SLR.java +++ b/src/main/java/org/archive/util/binsearch/impl/http/ApacheHttp31SLR.java @@ -8,6 +8,7 @@ import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpMethod; +import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.HeadMethod; import org.apache.commons.io.input.CountingInputStream; @@ -121,6 +122,7 @@ public class ApacheHttp31SLR extends HTTPSeekableLineReader { } if (this.getCookie() != null) { + activeMethod.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); activeMethod.setRequestHeader("Cookie", this.getCookie()); }
FIX: ApacheSLR: turn off cookies when using manual cookie
iipc_webarchive-commons
train
java
f29711b9e8f87f6170a21816646a01038c958009
diff --git a/src/victory-container/victory-container.js b/src/victory-container/victory-container.js index <HASH>..<HASH> 100644 --- a/src/victory-container/victory-container.js +++ b/src/victory-container/victory-container.js @@ -13,6 +13,7 @@ export default class VictoryContainer extends React.Component { PropTypes.node ]), className: PropTypes.string, + containerId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), desc: PropTypes.string, events: PropTypes.object, height: PropTypes.number, @@ -45,7 +46,8 @@ export default class VictoryContainer extends React.Component { constructor(props) { super(props); this.getTimer = this.getTimer.bind(this); - this.containerId = uniqueId("victory-container-"); + this.containerId = typeof this.props.containerId === "undefined" ? + uniqueId("victory-container-") : this.props.containerId; } getChildContext() {
add containerId for victory-container
FormidableLabs_victory
train
js
defe668a85cc61785a2f7baa4aa1bbb3c9691362
diff --git a/client/response_test.go b/client/response_test.go index <HASH>..<HASH> 100644 --- a/client/response_test.go +++ b/client/response_test.go @@ -37,5 +37,6 @@ func TestResponse(t *testing.T) { assert.EqualValues(t, under.StatusCode, resp.Code()) assert.Equal(t, under.Status, resp.Message()) assert.Equal(t, "blah blah", resp.GetHeader("blah")) + assert.Equal(t, []string{"blah blah"}, resp.GetHeaders("blah")) assert.Equal(t, under.Body, resp.Body()) }
chore: add unit test for new method
go-openapi_runtime
train
go
2cdbabe32cdb05dadb43d5c65bca42118b36f135
diff --git a/benchbuild/environments/adapters/podman.py b/benchbuild/environments/adapters/podman.py index <HASH>..<HASH> 100644 --- a/benchbuild/environments/adapters/podman.py +++ b/benchbuild/environments/adapters/podman.py @@ -190,7 +190,7 @@ class PodmanRegistry(ContainerRegistry): create_cmd = create_cmd[ '--mount', f'type=bind,src={source},target={target}'] - container_id, err = run(create_cmd['--name', name, image.name, args]) + container_id, err = run(create_cmd['--name', name, image.name][args]) if err: raise ContainerCreateError( container_id, " ".join(err.argv)
fix(environments): supply args as dedicated subcommand args
PolyJIT_benchbuild
train
py
894949a3b1896fa1e92a1ecbb2e6e5a05a1b0377
diff --git a/src/support/startup/routes.js b/src/support/startup/routes.js index <HASH>..<HASH> 100644 --- a/src/support/startup/routes.js +++ b/src/support/startup/routes.js @@ -68,7 +68,7 @@ module.exports = function*(app) { _.each(routeFiles, function(routeFile) { debug('Loading ' + routeFile); - _.extend(app.routes, waigo.load(routeFile)); + _.merge(app.routes, waigo.load(routeFile)); }); waigo.load('support/routeMapper').map(app, app.routes);
use merge() instead of extend() for when collecting route definitions from source files
waigo_waigo
train
js
f43e48402657b62211afa6649f6f271bb752dded
diff --git a/Kwf/Model/Select/Expr/Parent.php b/Kwf/Model/Select/Expr/Parent.php index <HASH>..<HASH> 100644 --- a/Kwf/Model/Select/Expr/Parent.php +++ b/Kwf/Model/Select/Expr/Parent.php @@ -27,13 +27,13 @@ class Kwf_Model_Select_Expr_Parent implements Kwf_Model_Select_Expr_Interface public function validate() { if (!$this->_field) { - throw new Kwf_Exception("No Field set for '"+get_class($this)+"'"); + throw new Kwf_Exception("No Field set for '".get_class($this)."'"); } if (!is_string($this->_field)) { - throw new Kwf_Exception("Field must be of type string in '"+get_class($this)+"'"); + throw new Kwf_Exception("Field must be of type string in '".get_class($this)."'"); } if (!$this->_parent) { - throw new Kwf_Exception("No parent rule set for '"+get_class($this)+"'"); + throw new Kwf_Exception("No parent rule set for '".get_class($this)."'"); } }
Change to correct concatination operator
koala-framework_koala-framework
train
php
469f9c374600d42609401a41622f1a17616453ad
diff --git a/test/utilities.spec.js b/test/utilities.spec.js index <HASH>..<HASH> 100644 --- a/test/utilities.spec.js +++ b/test/utilities.spec.js @@ -122,7 +122,7 @@ describe('Test of the utilities functions', function() { }); it( - 'Strips away all non-alphanumeric chars when enabled and preserveExtension: true for a name without dots', + 'Strips away all non-alphanumeric chars when preserveExtension: true for a name without dots', () => { const opts = {safeFileNames: true, preserveExtension: true}; const name = 'my$Invalid#fileName';
More shorter<I> symbols it's very strict
richardgirges_express-fileupload
train
js
56838747a9545e9b2e0e9c10cd1ad3c4eb8cd633
diff --git a/core/codegen/javagen/src/test/java/org/overture/codegen/tests/utils/CompileTests.java b/core/codegen/javagen/src/test/java/org/overture/codegen/tests/utils/CompileTests.java index <HASH>..<HASH> 100644 --- a/core/codegen/javagen/src/test/java/org/overture/codegen/tests/utils/CompileTests.java +++ b/core/codegen/javagen/src/test/java/org/overture/codegen/tests/utils/CompileTests.java @@ -125,7 +125,7 @@ public class CompileTests if(RUN_SL_TESTS) { - runSlTests(); + runSlTests();//not moved to unit test } if (RUN_COMPLEX_EXP_TESTS) @@ -135,7 +135,7 @@ public class CompileTests if (RUN_NON_EXECUTING_VDM10_SPEC_TESTS) { - runNonExecutingVdm10Tests(); + runNonExecutingVdm10Tests();//not moved to unit test } if (RUN_FUNCTION_VALUE_TESTS)
added notes about which tests are converted to unit tests
overturetool_overture
train
java
da653d5e088d1a8c97f59049a54efea4014909fe
diff --git a/salt/log.py b/salt/log.py index <HASH>..<HASH> 100755 --- a/salt/log.py +++ b/salt/log.py @@ -13,6 +13,9 @@ import logging import logging.handlers +TRACE = 5 +GARBAGE = 1 + LOG_LEVELS = { "none": logging.NOTSET, "info": logging.INFO, @@ -21,8 +24,8 @@ LOG_LEVELS = { "error": logging.ERROR, "none": logging.CRITICAL, "debug": logging.DEBUG, - "trace": 5, - "garbage": 1 + "trace": TRACE, + "garbage": GARBAGE } LoggingLoggerClass = logging.getLoggerClass()
add symbolic log level constants for TRACE and GARBAGE
saltstack_salt
train
py
d86e62bee6d245e6acebbd7d162247a7f8e04d52
diff --git a/tests/Post/PostBodyTest.php b/tests/Post/PostBodyTest.php index <HASH>..<HASH> 100644 --- a/tests/Post/PostBodyTest.php +++ b/tests/Post/PostBodyTest.php @@ -130,7 +130,6 @@ class PostBodyTest extends \PHPUnit_Framework_TestCase $b->seek(0); $this->assertEquals('foo=bar&baz=123', $b->read(1000)); $this->assertEquals(15, $b->tell()); - $this->assertTrue($b->eof()); } public function testCanSpecifyQueryAggregator()
Removing extra check because PHP is broken
guzzle_guzzle
train
php
45864e49048ca4fcbb0a883fe6f130c41938ca90
diff --git a/latex2text.py b/latex2text.py index <HASH>..<HASH> 100644 --- a/latex2text.py +++ b/latex2text.py @@ -94,6 +94,8 @@ macro_list = [ ('ss', u'\u00df'), # s-z allemand ('L', u"\N{LATIN CAPITAL LETTER L WITH STROKE}"), ('l', u"\N{LATIN SMALL LETTER L WITH STROKE}"), + ('i', u"\N{LATIN SMALL LETTER DOTLESS I}"), + ('j', u"\N{LATIN SMALL LETTER DOTLESS J}"), ("~", "~" ), ("&", "\\&" ), # HACK, see below for text replacement of '&' @@ -338,7 +340,12 @@ def make_accented_char(node, combining): c = latexnodes2text([nodearg]).strip(); - return u"".join([unicodedata.normalize('NFC', unicode(ch) + combining) for ch in c]); + def trans(ch): + if (ch == u"\N{LATIN SMALL LETTER DOTLESS I}"): + return "i" + return ch + + return u"".join([unicodedata.normalize('NFC', unicode(trans(ch)) + combining) for ch in c]); for u in unicode_accents_list:
added support for accented \i
phfaist_pylatexenc
train
py
0528562f7e1d75a6dcd5737f5ee28814f28b6ac0
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100644 --- a/tests.py +++ b/tests.py @@ -22,15 +22,15 @@ d = 'foo' class TestAssert(unittest.TestCase): def __init__(self, statement, expected_message, *args, **kwargs): - super().__init__(*args, *kwargs) + super(TestAssert, self).__init__(*args, **kwargs) self.statement = statement self.expected_message = expected_message def runTest(self): with open(TEMPFILE, 'w') as f: f.write(SOURCE.format(statement=self.statement)) - result = subprocess.run([sys.executable, TEMPFILE], stderr=subprocess.PIPE) - assert_message = result.stderr.decode('utf8').splitlines()[-1] + result = subprocess.Popen([sys.executable, TEMPFILE], stderr=subprocess.PIPE) + assert_message = result.stderr.read().decode('utf8').splitlines()[-1] self.assertEqual(assert_message, self.expected_message) def __str__(self):
fixed tests to work for both Python 2 and 3
elifiner_affirm
train
py
263c0c0a9101aa11a0512d001223f30e49dcf8ac
diff --git a/config/bootstrap_cli.php b/config/bootstrap_cli.php index <HASH>..<HASH> 100644 --- a/config/bootstrap_cli.php +++ b/config/bootstrap_cli.php @@ -3,6 +3,6 @@ use Cake\Event\Event; use Cake\Event\EventManager; use Josegonzalez\Version\Event\VersionListener; -EventManager::instance()->attach(function (Event $event) { +EventManager::instance()->on('Bake.beforeRender', function (Event $event) { (new VersionListener($event))->execute(); -}, 'Bake.beforeRender'); +});
Update bootstrap_cli.php Changed from [deprecated method attach](<URL>)
josegonzalez_cakephp-version
train
php
cafede415fe97719cae49d41c9af2ff311dfb1ae
diff --git a/core/selection.js b/core/selection.js index <HASH>..<HASH> 100644 --- a/core/selection.js +++ b/core/selection.js @@ -43,8 +43,6 @@ class Selection { // TODO unclear if this has negative side effects this.emitter.once(Emitter.events.SCROLL_UPDATE, () => { try { - // Check crash condition in FF https://bugzilla.mozilla.org/show_bug.cgi?id=1270235 - if (native.start.node.parentNode == null || native.end.node.parentNode == null) return; this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); } catch (ignored) {} }); @@ -205,6 +203,9 @@ class Selection { setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset) { debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } let selection = document.getSelection(); if (selection == null) return; if (startNode != null) {
guard now generally applicable cursor.restore() now setTimeouts a setNativeRange which will cause error in tests since we are constantly creating/destroying Quill editors
quilljs_quill
train
js
d2f0eafa27e4aa0adaee2362ccc9bab8c658d955
diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index <HASH>..<HASH> 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -2808,8 +2808,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID); $liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID); - - return ($stageVersion && $stageVersion != $liveVersion); + + $isModified = ($stageVersion && $stageVersion != $liveVersion); + $this->extend('getIsModifiedOnStage', $isModified); + + return $isModified; } /**
Add an extension hook to the getIsModifiedOnStage method
silverstripe_silverstripe-siteconfig
train
php
d822e2f5cf8d32efd0008c967551e994046b2d73
diff --git a/src/node/src/client.js b/src/node/src/client.js index <HASH>..<HASH> 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -104,7 +104,7 @@ function _write(chunk, encoding, callback) { if (this.writeFailed) { /* Once a write fails, just call the callback immediately to let the caller flush any pending writes. */ - callback(); + setImmediate(callback); } try { message = this.serialize(chunk);
Change write callback to asynchronous to avoid recursion
grpc_grpc
train
js
1e17a8f0472740e2e6321891b242f88a400151fa
diff --git a/providers/Facebook.php b/providers/Facebook.php index <HASH>..<HASH> 100644 --- a/providers/Facebook.php +++ b/providers/Facebook.php @@ -56,7 +56,7 @@ class Facebook extends BaseProvider 'clientId' => $this->providerInfos->clientId, 'clientSecret' => $this->providerInfos->clientSecret, 'redirectUri' => $this->getRedirectUri(), - 'graphApiVersion' => 'v2.5' + 'graphApiVersion' => 'v2.8' ]; return new \League\OAuth2\Client\Provider\Facebook($config);
The plugin is now using Facebook API <I>
dukt_oauth
train
php
3e4fb022d56767133f2e2764d1c3893195e076f0
diff --git a/lib/nack/server.rb b/lib/nack/server.rb index <HASH>..<HASH> 100644 --- a/lib/nack/server.rb +++ b/lib/nack/server.rb @@ -13,7 +13,6 @@ module Nack end attr_accessor :app, :file, :pipe - attr_accessor :name, :request_count def initialize(app, options = {}) # Lazy require rack @@ -23,9 +22,6 @@ module Nack self.file = options[:file] self.pipe = options[:pipe] - - self.name = options[:name] || "app" - self.request_count = 0 end def open_server @@ -73,8 +69,6 @@ module Nack buffers = {} loop do - $0 = "nack worker [#{name}] (#{request_count})" - listeners = clients + [self_pipe] listeners << server unless server.closed? @@ -125,7 +119,6 @@ module Nack end def handle(sock, buf) - self.request_count += 1 debug "Accepted connection" status = 500 @@ -152,7 +145,6 @@ module Nack if env method, path = env['REQUEST_METHOD'], env['PATH_INFO'] debug "Received request: #{method} #{path}" - $0 = "nack worker [#{name}] (#{request_count}) #{method} #{path}" env = env.merge({ "rack.version" => Rack::VERSION,
Remove busted proctitle from worker
josh_nack
train
rb
b3dacb3988971cef67e82979dad13578b0f5de6f
diff --git a/lib/genealogy/query_methods.rb b/lib/genealogy/query_methods.rb index <HASH>..<HASH> 100644 --- a/lib/genealogy/query_methods.rb +++ b/lib/genealogy/query_methods.rb @@ -245,6 +245,10 @@ module Genealogy nieces_and_nephews(options.merge({sex: 'female'}), sibling_options) end + def cousins(options = {}, uncle_aunt_options = {}) + uncles_and_aunts(uncle_aunt_options).compact.inject([]){|memo,parent_sibling| memo |= parent_sibling.offspring} + end + def nieces_and_nephews(options = {}, sibling_options = {}) case options[:sex] when 'male'
added a cousins method that utilizes #uncles_and_aunts
masciugo_genealogy
train
rb
ff7e4760f2cb6146f46e532982a9eb27c67b61fa
diff --git a/generators/entity/prompts.js b/generators/entity/prompts.js index <HASH>..<HASH> 100644 --- a/generators/entity/prompts.js +++ b/generators/entity/prompts.js @@ -1114,6 +1114,8 @@ function askForRelationship(done) { if(props.otherEntityName.toLowerCase() === 'user') { relationship.ownerSide = true; + relationship.otherEntityField = 'login'; + relationship.otherEntityRelationshipName = _.lowerFirst(name); } fieldNamesUnderscored.push(_.snakeCase(props.relationshipName));
When doing a link to the “user” entity, use the “login” attribute Also set the “otherEntityRelationshipName”, which isn’t used (as the User doesn’t do the other side), it just removes a warning Fix #<I>
jhipster_generator-jhipster
train
js
418cbfbb5fb0acf5e90558027cc4e697208fb6f7
diff --git a/lib/factory_girl/aliases.rb b/lib/factory_girl/aliases.rb index <HASH>..<HASH> 100644 --- a/lib/factory_girl/aliases.rb +++ b/lib/factory_girl/aliases.rb @@ -4,7 +4,7 @@ module FactoryGirl attr_accessor :aliases #:nodoc: end self.aliases = [ - [/(.*)_id/, '\1'], + [/(.+)_id/, '\1'], [/(.*)/, '\1_id'] ] diff --git a/spec/factory_girl/aliases_spec.rb b/spec/factory_girl/aliases_spec.rb index <HASH>..<HASH> 100644 --- a/spec/factory_girl/aliases_spec.rb +++ b/spec/factory_girl/aliases_spec.rb @@ -14,6 +14,10 @@ describe Factory, "aliases" do FactoryGirl.aliases_for(:test).should include(:test_id) end + it "should NOT include an attribute as an alias when it starts with underscore" do + FactoryGirl.aliases_for(:_id).should_not include(:id) + end + describe "after adding an alias" do before do
Factory.aliases should not alias attributes like "_id"
thoughtbot_factory_bot
train
rb,rb
c69465d8107db9db59c4f404fa47206463be65fb
diff --git a/paymentintent.go b/paymentintent.go index <HASH>..<HASH> 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -317,7 +317,7 @@ type PaymentIntentPaymentMethodOptionsParams struct { Card *PaymentIntentPaymentMethodOptionsCardParams `form:"card"` OXXO *PaymentIntentPaymentMethodOptionsOXXOParams `form:"oxxo"` Sofort *PaymentIntentPaymentMethodOptionsSofortParams `form:"sofort"` - WechatPay *PaymentIntentPaymentMethodOptionsWechatPayParams `form:"sofort"` + WechatPay *PaymentIntentPaymentMethodOptionsWechatPayParams `form:"wechat_pay"` } // PaymentIntentTransferDataParams is the set of parameters allowed for the transfer hash.
Fix Typo (#<I>) This should be using `wechat_pay`
stripe_stripe-go
train
go
800503ea75ba4b95b8b673d15cbaef181a74d0bd
diff --git a/views/js/qtiCreator/widgets/interactions/extendedTextInteraction/states/Question.js b/views/js/qtiCreator/widgets/interactions/extendedTextInteraction/states/Question.js index <HASH>..<HASH> 100755 --- a/views/js/qtiCreator/widgets/interactions/extendedTextInteraction/states/Question.js +++ b/views/js/qtiCreator/widgets/interactions/extendedTextInteraction/states/Question.js @@ -147,6 +147,15 @@ define([ $constraintsBlock = $form.find('#constraints'); $recommendationsBlock = $form.find('#recommendations'); + if (format === 'xhtml') { + if (!features.isVisible('taoQtiItem/creator/interaction/extendedText/property/xhtmlConstraints')) { + $constraintsBlock.hide(); + } + if (!features.isVisible('taoQtiItem/creator/interaction/extendedText/property/xhtmlRecommendations')) { + $recommendationsBlock.hide(); + } + } + // init data change callbacks var callbacks = {};
fix: call feature hiding on item load
oat-sa_extension-tao-itemqti
train
js
c56d1a81b72563b7de6aec3558d1deaf8ae0d45b
diff --git a/src/stereotype_client.js b/src/stereotype_client.js index <HASH>..<HASH> 100644 --- a/src/stereotype_client.js +++ b/src/stereotype_client.js @@ -13,7 +13,9 @@ class StereotypeClient { * @param {string} idFulfiller Deprecated - this field is not used anymore but it's left as optional for backwards compatibility. */ constructor(accessToken, idFulfiller = null) { - this.accessToken = accessToken; + this.accessToken = String(accessToken); + // Strip any token prefix, e.g. 'Bearer '. If no prefix is found this code won't have any effect. + this.accessToken = this.accessToken.substring(this.accessToken.indexOf(' ') + 1); } /**
Allow auth tokens with prefixes (e.g. "Bearer ") to be used.
Cimpress_stereotype-client
train
js
50ba77983d79aaa84ec54d35347c0028c56ba573
diff --git a/models/classes/class.DeliveryAuthoringService.php b/models/classes/class.DeliveryAuthoringService.php index <HASH>..<HASH> 100644 --- a/models/classes/class.DeliveryAuthoringService.php +++ b/models/classes/class.DeliveryAuthoringService.php @@ -90,7 +90,7 @@ class taoDelivery_models_classes_DeliveryAuthoringService $deliveryClass = new core_kernel_classes_Class(TAO_DELIVERY_CLASS); $deliveries = $deliveryClass->searchInstances(array($propDeliveryProcess => $process->uriResource), array('like'=>false, 'recursive' => true)); if(!empty($deliveries)){ - $returnValue = $deliveries[0]; + $returnValue = array_pop($deliveries); } // section 10-13-1-39-5129ca57:1276133a327:-8000:0000000000002061 end
It was not possible to get the delivery from the process anymore. Search Instances now returns associative arrays ! git-svn-id: <URL>
oat-sa_extension-tao-delivery
train
php
3137ebcd8a398a6a8c49ae44c6cee51cb582fffb
diff --git a/django_tenants/tests/test_tenants.py b/django_tenants/tests/test_tenants.py index <HASH>..<HASH> 100644 --- a/django_tenants/tests/test_tenants.py +++ b/django_tenants/tests/test_tenants.py @@ -564,7 +564,7 @@ class TenantRenameSchemaTest(BaseTestCase): self.assertTrue(schema_exists(tenant.schema_name)) domain = get_tenant_domain_model()(tenant=tenant, domain='something.test.com') domain.save() - schema_rename(tenant=Client.objects.filter(pk=tenant.pk), new_schema_name='new_name') + schema_rename(tenant=Client.objects.filter(pk=tenant.pk).first(), new_schema_name='new_name') self.assertTrue(schema_exists('test')) self.assertFalse(schema_exists('new_name'))
Another fix for the rename test
tomturner_django-tenants
train
py
41475268ecb8cb7ec1009f7e8dd7dbed70c5c671
diff --git a/rah_backup.php b/rah_backup.php index <HASH>..<HASH> 100644 --- a/rah_backup.php +++ b/rah_backup.php @@ -125,6 +125,12 @@ class rah_backup { public $message = array(); /** + * @var array List of invoked announcements + */ + + private $announce = array(); + + /** * @var array List of invoked errors/notices */ @@ -397,6 +403,16 @@ class rah_backup { </script> EOF; } + + /** + * Announce message + * @return obj + */ + + public function announce($message) { + $this->announce[] = $message; + return $this; + } /** * The main listing @@ -495,6 +511,10 @@ EOF; $out = implode(n, $out); + if($this->announce) { + $message = $this->announce[0]; + } + if($app_mode == 'async') { send_script_response($theme->announce_async($message).n.'$("#rah_backup_list").html("'.escape_js($out).'");'); return;
Introduces rah_backup::announce(). Allows plugins to announce/override messages.
gocom_rah_backup
train
php
02212e156ba762a4c7abdb7e9a905969244bcd20
diff --git a/tests/test_concurrent.py b/tests/test_concurrent.py index <HASH>..<HASH> 100644 --- a/tests/test_concurrent.py +++ b/tests/test_concurrent.py @@ -23,7 +23,7 @@ def test_concurrent_fixture(testdir): def test_1(driver): print_('inside test_1') """) - result = testdir.runpytest( + result = testdir.runpytest_subprocess( '-s', '--tests-per-worker=2' )
For some reason (may be because we now always run tests in a subprocess), test_concurrent_fixture started to fail. Running pytest in a subprocess fixes some issues with capturing test stdout.
browsertron_pytest-parallel
train
py
6a4303120fbdcfd5ceb9438aaae62eacb8c41a73
diff --git a/conn.go b/conn.go index <HASH>..<HASH> 100644 --- a/conn.go +++ b/conn.go @@ -953,12 +953,14 @@ func configTLS(args configTLSArgs, cc *ConnConfig) error { return fmt.Errorf(`both "sslcert" and "sslkey" are required`) } - cert, err := tls.LoadX509KeyPair(sslcert, sslkey) - if err != nil { - return errors.Wrap(err, "unable to read cert") - } + if sslcert != "" && sslkey != "" { + cert, err := tls.LoadX509KeyPair(sslcert, sslkey) + if err != nil { + return errors.Wrap(err, "unable to read cert") + } - cc.TLSConfig.Certificates = []tls.Certificate{cert} + cc.TLSConfig.Certificates = []tls.Certificate{cert} + } return nil }
Only read in TLS certs when the key and cert are present.
jackc_pgx
train
go
075ba22d454ec73d100c62ab1dc49a7d90cc234e
diff --git a/src/dom_components/view/ComponentTextView.js b/src/dom_components/view/ComponentTextView.js index <HASH>..<HASH> 100644 --- a/src/dom_components/view/ComponentTextView.js +++ b/src/dom_components/view/ComponentTextView.js @@ -177,7 +177,10 @@ export default ComponentView.extend({ mixins.off(elDocs, 'mousedown', this.disableEditing); mixins[method](elDocs, 'mousedown', this.disableEditing); em[method]('toolbar:run:before', this.disableEditing); - model && model[method]('removed', this.disableEditing); + if (model) { + model[method]('removed', this.disableEditing); + model.trigger(`rte:${enable ? 'enable' : 'disable'}`); + } // Avoid closing edit mode on component click $el && $el.off('mousedown', this.disablePropagation);
Trigger rte state on components
artf_grapesjs
train
js
5946bc0c663b15d50f5a1236c75df95a390e7f30
diff --git a/symfit/core/printing.py b/symfit/core/printing.py index <HASH>..<HASH> 100644 --- a/symfit/core/printing.py +++ b/symfit/core/printing.py @@ -73,3 +73,10 @@ class SymfitNumPyPrinter(NumPyPrinter): Print ``Idx`` objects. """ return "{0}".format(self._print(expr.args[0])) + + def _print_MatPow(self, expr): + if expr.shape == (1, 1): + # Scalar, so we can take a normal power. + return self._print_Pow(expr) + else: + return super(SymfitNumPyPrinter, self)._print_MatPow(expr)
SymPy added better printing for MatPow, but this broke our sqrt of a (1, 1) matrix scalar. Fixed by checking the shape before taking the power, and take a standard power if we're dealing with a scalar.
tBuLi_symfit
train
py
439f8c3b1fcf47c32f01447e7a3b9a0cb97a28f0
diff --git a/lib/linked/item.rb b/lib/linked/item.rb index <HASH>..<HASH> 100644 --- a/lib/linked/item.rb +++ b/lib/linked/item.rb @@ -17,18 +17,20 @@ module Linked class Item - attr_accessor :list + attr_accessor :list, :value attr_writer :prev, :next protected :prev=, :next=, :list= # Creates a new item. If a list is given the item will be considered a part # of that list. # - # list - An object responding to #head and #tail. + # value - an arbitrary object to store with the item. + # list - an object responding to #head and #tail. # # Returns a new Item. - def initialize(list: nil) + def initialize(value = nil, list: nil) + @value = value @list = list if list @prev = list.head diff --git a/test/item_test.rb b/test/item_test.rb index <HASH>..<HASH> 100644 --- a/test/item_test.rb +++ b/test/item_test.rb @@ -23,7 +23,12 @@ describe Linked::Item do end describe '.new' do - it 'accepts an object responding to #head and #tail' do + it 'accepts a value' do + item = subject.new :value + assert_equal :value, item.value + end + + it 'accepts a list object responding to #head and #tail' do item = nil next_item = nil prev_item = nil
Items now optionally hold a value
seblindberg_ruby-linked
train
rb,rb
e3473371ecdbfe3e45d37797704f922a6b54f981
diff --git a/lib/bad_link_finder/link.rb b/lib/bad_link_finder/link.rb index <HASH>..<HASH> 100644 --- a/lib/bad_link_finder/link.rb +++ b/lib/bad_link_finder/link.rb @@ -53,7 +53,7 @@ module BadLinkFinder browser.keep_alive = false browser.history.max_size = 0 browser.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE - browser.agent.open_timeout = 30 + browser.agent.open_timeout = 15 if @head_unsupported browser.get(@url)
Reduce timeout to <I>s
alphagov_bad_link_finder
train
rb
7c0fe6a3df7fe486cc39a869d79d7eefef1fe3e4
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -153,12 +153,12 @@ class FrameworkExtension extends Extension 'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver', 'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', - 'Symfony\\Bundle\\FrameworkBundle\\ContainerAwareEventDispatcher', - 'Symfony\\Component\\EventDispatcher\\EventDispatcher', 'Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', 'Symfony\\Component\\EventDispatcher\\Event', 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface', + + 'Symfony\\Bundle\\FrameworkBundle\\ContainerAwareEventDispatcher', )); }
[FrameworkBundle] Fixed order of the classes to compile for EventDispatcher
symfony_symfony
train
php
99835038842319068b574f314283bc0919fa91d7
diff --git a/lib/deliver/upload_screenshots.rb b/lib/deliver/upload_screenshots.rb index <HASH>..<HASH> 100644 --- a/lib/deliver/upload_screenshots.rb +++ b/lib/deliver/upload_screenshots.rb @@ -70,10 +70,10 @@ module Deliver next end - files = Dir.glob(File.join(lng_folder, "*.#{extensions}")) + files = Dir.glob(File.join(lng_folder, "*.#{extensions}"), File::FNM_CASEFOLD) next if files.count == 0 - prefer_framed = Dir.glob(File.join(lng_folder, "*_framed.#{extensions}")).count > 0 + prefer_framed = Dir.glob(File.join(lng_folder, "*_framed.#{extensions}"), File::FNM_CASEFOLD).count > 0 language = File.basename(lng_folder) files.each do |file_path|
Fix case-sensitive discovery of screenshots on Ruby < <I>
fastlane_fastlane
train
rb
a4827d8df9647c8a2a891c1fcca2664b677073fa
diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb index <HASH>..<HASH> 100644 --- a/omnibus/config/projects/chef.rb +++ b/omnibus/config/projects/chef.rb @@ -33,7 +33,6 @@ else install_dir "#{default_root}/#{name}" end -override :bundler, version: "1.10.6" if windows? override :'ruby-windows', version: "2.0.0-p645" @@ -46,15 +45,8 @@ else override :ruby, version: "2.1.6" end -###### -# This points to jay's patched version for now to avoid a security -# vulnerability and to allow pry to get installed on windows builds. -# See the software definition for details. -if windows? - override :rubygems, version: "jdm/2.4.8-patched" -else - override :rubygems, version: "2.4.8" -end +override :bundler, version: "1.11.2" +override :rubygems, version: "2.5.2" # Chef Release version pinning override :chef, version: "local_source"
bump bunder + rubygems these versions pass in manhattan
chef_chef
train
rb
41745b704ee269478694a8fc747e0cc9855831a4
diff --git a/fastlane_core/lib/fastlane_core/version.rb b/fastlane_core/lib/fastlane_core/version.rb index <HASH>..<HASH> 100644 --- a/fastlane_core/lib/fastlane_core/version.rb +++ b/fastlane_core/lib/fastlane_core/version.rb @@ -1,3 +1,3 @@ module FastlaneCore - VERSION = "0.46.0".freeze + VERSION = "0.46.1".freeze end
[fastlane_core] Version bump (#<I>) * Fixed iTunes Transporter * Fix for CLI based actions with Integer params
fastlane_fastlane
train
rb
4fc9ab8f9c47b48e733ce867c5919f009a66d7c6
diff --git a/lib/meta_search.rb b/lib/meta_search.rb index <HASH>..<HASH> 100644 --- a/lib/meta_search.rb +++ b/lib/meta_search.rb @@ -36,7 +36,7 @@ module MetaSearch # Query construction :joins, :includes, :select, :order, :where, :having, :group, # Results, debug, array methods - :to_a, :all, :length, :size, :to_sql, :debug_sql, :paginate, + :to_a, :all, :length, :size, :to_sql, :debug_sql, :paginate, :page, :find_each, :first, :last, :each, :arel, :in_groups_of, :group_by, # Calculations :count, :average, :minimum, :maximum, :sum
Delegate #page to relation. [#<I> state:resolved]
activerecord-hackery_meta_search
train
rb