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
4174a76875cdc5de675b145904156179b18acecb
diff --git a/src/Silex/Controller.php b/src/Silex/Controller.php index <HASH>..<HASH> 100644 --- a/src/Silex/Controller.php +++ b/src/Silex/Controller.php @@ -16,6 +16,17 @@ use Silex\Exception\ControllerFrozenException; /** * A wrapper for a controller, mapped to a route. * + * __call() forwards method-calls to Route, but returns instance of Controller + * listing Route's methods below, so that IDEs know they are valid + * + * @method \Silex\Controller assert(string $variable, string $regexp) + * @method \Silex\Controller value(string $variable, mixed $default) + * @method \Silex\Controller convert(string $variable, mixed $callback) + * @method \Silex\Controller method(string $method) + * @method \Silex\Controller requireHttp() + * @method \Silex\Controller requireHttps() + * @method \Silex\Controller before(mixed $callback) + * @method \Silex\Controller after(mixed $callback) * @author Igor Wiedler <igor@wiedler.ch> */ class Controller
Define "magic" methods of \Silex\Controller This makes IDEs (PHPStorm, in particular) a bit happier about route-definitions. see <URL>
silexphp_Silex
train
php
594d5f90d7d831a94d63371dd9515c457a35ec42
diff --git a/aemsync.js b/aemsync.js index <HASH>..<HASH> 100644 --- a/aemsync.js +++ b/aemsync.js @@ -308,8 +308,8 @@ function Pusher(targets, interval, sync) { // Add NT_FOLDER if needed. var contentXml = subItem + "/.content.xml"; var hasContentXml = fs.existsSync(contentXml); - var isContentFolder = path.basename(subItem) === '_jcr_content'; - if (!isContentFolder && !hasContentXml) { + var hasContentFolder = subItem.indexOf('/_jcr_content') !== -1; + if (!hasContentFolder && !hasContentXml) { pack.zip.addLocalFile(NT_FOLDER, getZipPath(contentXml)); debug(" Added as nt:folder.") }
Updated _jcr_content folder handling.
gavoja_aemsync
train
js
29bd896693bcbc103790ae0cf95e0a4c63daf9ca
diff --git a/app/controllers/garage/docs/resources_controller.rb b/app/controllers/garage/docs/resources_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/garage/docs/resources_controller.rb +++ b/app/controllers/garage/docs/resources_controller.rb @@ -40,20 +40,20 @@ class Garage::Docs::ResourcesController < Garage::ApplicationController def authenticate session[:platform_return_to] = params[:return_to] - redirect_to oauth2_client(@app).auth_code.authorize_url( + client = oauth2_client(@app) + + # TODO: because it authenticates against self host provider, use + # Implicit Grant flow to prevent the callback app accessing itself + # and blocks with a single process server i.e. Webrick + redirect_to client.implicit.authorize_url( :redirect_uri => garage_docs.callback_resources_url, :scope => params[:scopes].join(' ') ) end def callback - if params[:code] - client = oauth2_client(@app) - - # This will block if your API server runs on the same process (e.g. Webrick) - token = client.auth_code.get_token(params[:code], redirect_uri: garage_docs.callback_resources_url) - session[:access_token] = token.token - + if params[:access_token] + session[:access_token] = params[:access_token] redirect_to session[:platform_return_to] || garage_docs.console_resources_path else render :layout => false
Revert the code auth flow and use Implicit Grant.
cookpad_garage
train
rb
2fe9ef682f416973f517c9ada0b896e111d33e7f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,7 @@ extras_require = { 'cluster': ["python-pam", "django-pam", "gunicorn", - "python-prctl ==1.6.1", + "python-prctl", "setproctitle"], 'osgeo': [ 'GDAL >= 2.4',
remove specific version of python-prctl inside setup.py
gem_oq-engine
train
py
7a911e36933f3b92569fbaacce3dd1bf804bbf68
diff --git a/src/neon.js b/src/neon.js index <HASH>..<HASH> 100644 --- a/src/neon.js +++ b/src/neon.js @@ -20,5 +20,5 @@ module.exports.Entity = require('./entity'); module.exports.Map = require('./map'); module.exports.CHAIN = DecoderClass.CHAIN; module.exports.BLOCK = EncoderClass.BLOCK; -module.exports.dumper = require('./dumper'); +module.exports.Dumper = require('./dumper'); module.exports.Error = require('./error');
api: dumper renamed to Dumper
matej21_neon-js
train
js
ac1e9fa397f57daec0c01790420ceea757d84dd4
diff --git a/lib/vimrunner/client.rb b/lib/vimrunner/client.rb index <HASH>..<HASH> 100644 --- a/lib/vimrunner/client.rb +++ b/lib/vimrunner/client.rb @@ -198,5 +198,12 @@ module Vimrunner def kill server.kill end + + # Bring the server to foreground + def foreground + server.remote_expr("foreground()") + end + + end end
Add client.foreground to Bring the server to foreground
AndrewRadev_vimrunner
train
rb
81974e25446951dfa105465bd832030e6140f23c
diff --git a/mythril/ethereum/util.py b/mythril/ethereum/util.py index <HASH>..<HASH> 100644 --- a/mythril/ethereum/util.py +++ b/mythril/ethereum/util.py @@ -78,9 +78,11 @@ def solc_exists(version): os.environ.get("HOME", str(Path.home())), ".py-solc/solc-v" + version, "bin/solc", - ), # py-solc setup - #"/usr/bin/solc", # Ubuntu PPA setup + ) # py-solc setup ] + if version.startswith("0.5"): + # Temporary fix to support v0.5.x with Ubuntu PPA setup + solc_binaries.append("/usr/bin/solc") for solc_path in solc_binaries: if os.path.exists(solc_path): return solc_path
updated with temp fix for solc <I>.x
ConsenSys_mythril-classic
train
py
4d2278e2fb5c365f2cf61ac56204f6e2fcbef09e
diff --git a/spec/lib/protobuf/rpc/stat_spec.rb b/spec/lib/protobuf/rpc/stat_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/protobuf/rpc/stat_spec.rb +++ b/spec/lib/protobuf/rpc/stat_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' require 'timecop' -require 'active_support/core_ext/numeric/time' +require 'active_support/all' RSpec.describe ::Protobuf::Rpc::Stat do
Use activesupport/all in tests (>= 6 causes load errors)
ruby-protobuf_protobuf
train
rb
420be7208d93f2ce0cc67c4e64144205d2789f00
diff --git a/tofu/data/_class1_Diagnostic.py b/tofu/data/_class1_Diagnostic.py index <HASH>..<HASH> 100644 --- a/tofu/data/_class1_Diagnostic.py +++ b/tofu/data/_class1_Diagnostic.py @@ -35,6 +35,20 @@ class Diagnostic(_class0_Plasma2D.Plasma2D): # _show_in_summary_core = ['shape', 'ref', 'group'] _show_in_summary = 'all' + _dshow = { + 'aperture': [ + 'planar', 'area', + 'outline', 'poly', + 'cent', + ], + 'camera': [ + 'parallel', '2d', + 'area', 'outline', + 'cent', 'cents', + 'qeff', + ], + } + def add_aperture( self,
[#<I>] added _dshow for aperture and camera
ToFuProject_tofu
train
py
926cb3dcad3de906fa35380426d4bc8f51d1c6fc
diff --git a/test/plugins_test.rb b/test/plugins_test.rb index <HASH>..<HASH> 100644 --- a/test/plugins_test.rb +++ b/test/plugins_test.rb @@ -33,7 +33,7 @@ class PluginsTest < MiniTest::Test suffix = '... #lolcommits' Lolcommits::LolTwitter.send(:define_method, :max_tweet_size, Proc.new { max_tweet_size }) - assert_match "#{long_commit_message[0..(max_tweet_size - suffix.length)]}#{suffix}", plugin.build_tweet(long_commit_message) + assert_equal "#{long_commit_message[0..(max_tweet_size - suffix.length)]}#{suffix}", plugin.build_tweet(long_commit_message) end def test_lol_twitter_prefix_suffix @@ -46,6 +46,6 @@ class PluginsTest < MiniTest::Test 'suffix' => '#suffixing!' } Lolcommits::LolTwitter.send(:define_method, :configuration, Proc.new { plugin_config }) - assert_match '@prefixing! commit msg #suffixing!', plugin.build_tweet('commit msg') + assert_equal '@prefixing! commit msg #suffixing!', plugin.build_tweet('commit msg') end end
switch to assert_equal to see fail condition
lolcommits_lolcommits
train
rb
e68672a8ae450ea956d2734ca1d89986404a2ff5
diff --git a/src/createReduxForm.js b/src/createReduxForm.js index <HASH>..<HASH> 100755 --- a/src/createReduxForm.js +++ b/src/createReduxForm.js @@ -646,7 +646,7 @@ const createReduxForm = (structure: Structure<*, *>) => { submitFailed = (error: any): void => { delete this.submitPromise - throw error + return error } listenToSubmit = (promise: any) => {
fix of the uncaught exception in promise within asyncValidation (#<I>)
erikras_redux-form
train
js
0d6011f6df5a42b7bb7bbb9fb06dc045aca52f7f
diff --git a/src/widgets/form/Select.php b/src/widgets/form/Select.php index <HASH>..<HASH> 100755 --- a/src/widgets/form/Select.php +++ b/src/widgets/form/Select.php @@ -90,6 +90,8 @@ class Select extends BaseInputWidget * @var boolean whether the select shall allow multiple selections. * * Please note: this options takes precedence over the 'multiple' key in [[$options]] + * + * @since 1.2.1 */ public $multiple = false; @@ -108,7 +110,7 @@ class Select extends BaseInputWidget if (!isset($this->options['options'])) { $this->options['options'] = []; } - + $this->options['multiple'] = $this->multiple; $this->parseItems();
added since doc to property multiple on Select
MacGyer_yii2-materializecss
train
php
a00f5a510e5cc8387b0e835861dbde43c4a7a974
diff --git a/src/main/java/io/iron/ironmq/Message.java b/src/main/java/io/iron/ironmq/Message.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/iron/ironmq/Message.java +++ b/src/main/java/io/iron/ironmq/Message.java @@ -17,6 +17,7 @@ public class Message implements Serializable { // it. @SerializedName("expires_in") private Long expiresIn; @SerializedName("reserved_count") private long reservedCount; + @SerializedName("reservation_id") private String reservationId; public Message() {} @@ -67,13 +68,18 @@ public class Message implements Serializable { * @param delay The new delay. */ public void setDelay(long delay) { this.delay = delay; } - + /** - * Returns the number of times the message has been reserved. - */ + * Returns the number of times the message has been reserved. + */ public long getReservedCount() { return reservedCount; } /** + * Returns the reservation id if the message has been reserved. + */ + public String getReservationId() { return reservationId; } + + /** * Returns the number of seconds in which the Message will be removed from the * queue. If the server default of 7 days will be used, 0 is returned. */
Add reservation_id to message model
iron-io_iron_mq_java
train
java
63949ae0122afcad084c01b56dd0c1640322c75d
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -36,7 +36,7 @@ module ActiveSupport # string. # # If passed an optional +locale+ parameter, the word will be - # pluralized using rules defined for that language. By default, + # singularized using rules defined for that language. By default, # this parameter is set to <tt>:en</tt>. # # 'posts'.singularize # => "post"
Fix doc for singularize - `pluralized` => `singularized`
rails_rails
train
rb
7a04d2589c2fabe43011ddf18ee612db777d0ff2
diff --git a/tidb-server/main.go b/tidb-server/main.go index <HASH>..<HASH> 100644 --- a/tidb-server/main.go +++ b/tidb-server/main.go @@ -419,7 +419,7 @@ func overrideConfig(cfg *config.Config) { if actualFlags[nmAdvertiseAddress] { cfg.AdvertiseAddress = *advertiseAddress } - if len(cfg.AdvertiseAddress) == 0 { + if len(cfg.AdvertiseAddress) == 0 && cfg.Host == "0.0.0.0" { cfg.AdvertiseAddress = util.GetLocalIP() } if len(cfg.AdvertiseAddress) == 0 { diff --git a/util/misc.go b/util/misc.go index <HASH>..<HASH> 100644 --- a/util/misc.go +++ b/util/misc.go @@ -440,7 +440,8 @@ type SequenceSchema interface { SequenceByName(schema, sequence model.CIStr) (SequenceTable, error) } -// SequenceTable is implemented by tableCommon, and it is specialised in handling sequence operation. +// SequenceTable is implemented by tableCommon, +// and it is specialised in handling sequence operation. // Otherwise calling table will cause import cycle problem. type SequenceTable interface { GetSequenceID() int64
*:Bug fix/Sign in failed: Failed to connect to TiDB in tiup dashboard (#<I>)
pingcap_tidb
train
go,go
6b318703f105835ee478656a2b88f82e7f04fe9a
diff --git a/src/assets/js/core.js b/src/assets/js/core.js index <HASH>..<HASH> 100644 --- a/src/assets/js/core.js +++ b/src/assets/js/core.js @@ -50,6 +50,11 @@ class Core { if ('select2' in $.fn) { $('.inside .papi-table tr .papi-component-select2').select2(); + + // Fix issue with browsers where selected attribute is not removed correct. + $(document.body).on('change', 'select.papi-component-select2', function () { + $(this).find('option[selected]').removeAttr('selected'); + }); } $('.papi-meta-type-term button.handlediv').on('click', this.handlediv);
Fix issue with browsers where selected attribute is not removed correct
wp-papi_papi
train
js
d8ee2d021c7be9a93de023e6628b3866ef223ab4
diff --git a/lib/trestle/evaluation_context.rb b/lib/trestle/evaluation_context.rb index <HASH>..<HASH> 100644 --- a/lib/trestle/evaluation_context.rb +++ b/lib/trestle/evaluation_context.rb @@ -9,9 +9,9 @@ module Trestle # # We include private methods as methods such as current_user # are usually declared as private or protected. - def method_missing(name, *args, &block) + def method_missing(name, *args, **kwargs, &block) if @context && @context.respond_to?(name, true) - @context.send(name, *args, &block) + @context.send(name, *args, **kwargs, &block) else super end
Forward keyword arguments in `method_missing` This is a breaking change introduced in Ruby <I>
TrestleAdmin_trestle
train
rb
5ee3663101f224a30ec95f6dab4b02a4a922eb2f
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -117,6 +117,12 @@ module ActiveRecord # Clears out the association cache. def clear_association_cache #:nodoc: self.class.reflect_on_all_associations.to_a.each do |assoc| + if IdentityMap.enabled? && instance_variable_defined?("@#{assoc.name}") + targets = [*instance_variable_get("@#{assoc.name}")] + targets.map! { |t| t.respond_to?(:target) ? t.target : t } + targets.compact! + targets.each { |r| IdentityMap.remove r } + end instance_variable_set "@#{assoc.name}", nil end if self.persisted? end
Remove associated objects from IM when clearing them from association cache.
rails_rails
train
rb
bd30ac8b55d104d3e444882309af30d2e2048e1c
diff --git a/codequality/main.py b/codequality/main.py index <HASH>..<HASH> 100755 --- a/codequality/main.py +++ b/codequality/main.py @@ -89,6 +89,9 @@ class CodeQuality(object): for filename, location in scmhandler.srcs_to_check( paths, rev=self.options.rev): + if self._should_ignore(filename): + continue + checker_classes = self._relevant_checkers(filename) for checker_class in checker_classes: loc_to_filename = checker_to_loc_to_filename.setdefault(
Fix ignore not applying to paths generated by SCM
jenanwise_codequality
train
py
3273dc46d123daadccf34a04d6f48584427b92be
diff --git a/spec/cleaner_spec.rb b/spec/cleaner_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cleaner_spec.rb +++ b/spec/cleaner_spec.rb @@ -6,6 +6,8 @@ describe Bugsnag::Cleaner do subject { described_class.new(nil) } describe "#clean_object" do + is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' + it "cleans up recursive hashes" do a = {:a => {}} a[:a][:b] = a @@ -13,6 +15,8 @@ describe Bugsnag::Cleaner do end it "cleans up hashes when keys infinitely recurse in to_s" do + skip "JRuby doesn't allow recovery from SystemStackErrors" if is_jruby + class RecursiveHashKey def to_s to_s @@ -79,6 +83,8 @@ describe Bugsnag::Cleaner do end it "cleans custom objects when they infinitely recurse" do + skip "JRuby doesn't allow recovery from SystemStackErrors" if is_jruby + class RecursiveObject def to_s to_s
Skip infinite recursion tests on JRuby We can't recover from stack overflows so there's not much we can do here other than skip these tests
bugsnag_bugsnag-ruby
train
rb
ea63b60feb53d0306055d51b52d04b5e21892b6e
diff --git a/test/03-lib/migrationManager.js b/test/03-lib/migrationManager.js index <HASH>..<HASH> 100644 --- a/test/03-lib/migrationManager.js +++ b/test/03-lib/migrationManager.js @@ -12,7 +12,7 @@ describe('MigrationManager', () => { expect(MigrationManager.prototype).ok(); }); - const publicMethodNames = [ + const allowedPublicMethodNames = [ 'configure', 'getParams', 'init', @@ -26,9 +26,24 @@ describe('MigrationManager', () => { 'disconnect' ]; - _(publicMethodNames).each((publicMethodName) => { + _(allowedPublicMethodNames).each((publicMethodName) => { it(`should have "${publicMethodName}" public method`, () => { expect(MigrationManager.prototype).have.keys(publicMethodName); }); }); + + it('should not have other public methods', () => { + const allPublicMethodNames = _(MigrationManager.prototype) + .chain() + .functions() + .filter((methodName) => _(MigrationManager.prototype).has(methodName)) + .reject((methodName) => methodName.charAt(0) === '_') + .value(); + + const difference = _(allPublicMethodNames).difference( + allowedPublicMethodNames + ); + + expect(difference).eql([]); + }); });
check at tests that migrator should not contain any other public methods
okv_east
train
js
c2304f8c6ec2b3b4adae5d937ec369233141ce61
diff --git a/lib/logstasher/active_job/log_subscriber.rb b/lib/logstasher/active_job/log_subscriber.rb index <HASH>..<HASH> 100644 --- a/lib/logstasher/active_job/log_subscriber.rb +++ b/lib/logstasher/active_job/log_subscriber.rb @@ -1,7 +1,8 @@ -if ActiveJob::VERSION::MAJOR >= 6 && ActiveJob::VERSION::MINOR >= 1 - require 'active_job/log_subscriber' -else +# For Rails 6.0 or below, require the logging module which contains LogSubscriber +if ActiveJob::VERSION::MAJOR < 6 || (ActiveJob::VERSION::MAJOR == 6 && ActiveJob::VERSION::MINOR == 0) require 'active_job/logging' +else + require 'active_job/log_subscriber' end module LogStasher
Fix potential issue for Rails 7 in require (#<I>) The older condition wouldn't require the newer location for Rails 7 in the future. Caught by @petergoldstein
shadabahmed_logstasher
train
rb
4f44be48aa99368bba4d391a501ced482677c7e5
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -53,7 +53,7 @@ module Dummy # This will create an empty whitelist of attributes available for mass-assignment for all models # in your app. As such, your models will need to explicitly whitelist or blacklist accessible # parameters by using an attr_accessible or attr_protected declaration. - config.active_record.whitelist_attributes = true + #config.active_record.whitelist_attributes = true # Enable the asset pipeline config.assets.enabled = true
turn off whitelist-attributes in spec dummy (not used in Rails 4)
bespokepost_questionable
train
rb
75d4ad5643791f701997ff8b7848cef8b7591a18
diff --git a/python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/event_log_storage.py b/python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/event_log_storage.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/event_log_storage.py +++ b/python_modules/dagster/dagster_tests/core_tests/storage_tests/utils/event_log_storage.py @@ -1048,6 +1048,9 @@ class TestEventLogStorage: assert step_stats[0].end_time > step_stats[0].start_time assert step_stats[0].attempts == 4 + # After adding the IN_PROGRESS field to the StepEventStatus enum, tests in internal fail + # Temporarily skipping this test + @pytest.mark.skip def test_run_step_stats_with_in_progress(self, storage): def _in_progress_run_records(run_id): now = time.time()
skipping test (#<I>)
dagster-io_dagster
train
py
cb69710d6ff8e2214882fa9f016ac400bd269317
diff --git a/spec/models/twitter_review.rb b/spec/models/twitter_review.rb index <HASH>..<HASH> 100644 --- a/spec/models/twitter_review.rb +++ b/spec/models/twitter_review.rb @@ -1,6 +1,6 @@ class TwitterReview < Review counter_culture :product, column_name: 'twitter_reviews_count' - counter_culture :user, column_name: 'review_value_sum', delta_magnitude: Proc.new {|model| model.weight} + counter_culture :user, column_name: 'review_value_sum', delta_magnitude: proc {|model| model.weight} counter_culture [:manages_company]
replace test code which use Proc.new
magnusvk_counter_culture
train
rb
f74e14c033a6a9c51b50e06299c1a264fe594a23
diff --git a/blockstack/lib/operations/revoke.py b/blockstack/lib/operations/revoke.py index <HASH>..<HASH> 100644 --- a/blockstack/lib/operations/revoke.py +++ b/blockstack/lib/operations/revoke.py @@ -85,11 +85,16 @@ def check( state_engine, nameop, block_id, checked_ops ): log.debug("Name '%s' is revoked" % name) return False - # name must not be expired + # name must not be expired as of *this* block if state_engine.is_name_expired( name, block_id ): log.debug("Name '%s' is expired" % name) return False + # name must not be in grace period in this block + if state_engine.is_name_in_grace_period(name, block_id): + log.debug("Name '{}' is in the renewal grace period. It can only be renewed at this time.".format(name)) + return False + # the name must be registered if not state_engine.is_name_registered( name ): log.debug("Name '%s' is not registered" % name )
don't allow revoke if we're in the name renewal grace period
blockstack_blockstack-core
train
py
0beb9f70407bed715e67dc28eaf6e6eb3c3263e1
diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index <HASH>..<HASH> 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -304,7 +304,7 @@ kind: ServiceAccount metadata: name: {{ include "<CHARTNAME>.serviceAccountName" . }} labels: -{{ include "<CHARTNAME>.labels" . | nindent 4 }} + {{- include "<CHARTNAME>.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -405,7 +405,7 @@ kind: Pod metadata: name: "{{ include "<CHARTNAME>.fullname" . }}-test-connection" labels: -{{ include "<CHARTNAME>.labels" . | nindent 4 }} + {{- include "<CHARTNAME>.labels" . | nindent 4 }} annotations: "helm.sh/hook": test-success spec: @@ -413,7 +413,7 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "<CHARTNAME>.fullname" . }}:{{ .Values.service.port }}'] + args: ['{{ include "<CHARTNAME>.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never `
fix(chartutil): remove empty lines and a space from rendered chart templates (#<I>)
helm_helm
train
go
dbeedf3ec56b9b8344f95fb26611213dc30f8f22
diff --git a/bin/php/updateniceurls.php b/bin/php/updateniceurls.php index <HASH>..<HASH> 100755 --- a/bin/php/updateniceurls.php +++ b/bin/php/updateniceurls.php @@ -742,7 +742,7 @@ if ( $urlCount > 0 ) list( $actionType, $actionValue ) = explode( ":", $action, 2 ); $aliases = eZURLAliasML::fetchByAction( $actionType, $actionValue ); - if ( $aliases && $actionType = 'eznode' ) + if ( $aliases && $actionType == 'eznode' ) { // This is a user-entered URL so lets make it an alias of the found dupe. $linkID = (int)$aliases[0]->attribute( 'id' );
- Fix typo introduced in commit #<I>, '=' -> '=='.
ezsystems_ezpublish-legacy
train
php
7270fbdfd850d56f133e4187223f22a2c27ca18d
diff --git a/lib/awesome_bot/check.rb b/lib/awesome_bot/check.rb index <HASH>..<HASH> 100644 --- a/lib/awesome_bot/check.rb +++ b/lib/awesome_bot/check.rb @@ -22,13 +22,11 @@ module AwesomeBot log.add "> White list: #{white_listed.join ', '}" if r.white_listing - r.dupes = r.links.select { |e| r.links.count(e) > 1 } unless skip_dupe + r.dupes = r.links.select { |e| r.links.count(e) > 1 } log.addp "Links found: #{r.links.count}" log.addp ", #{r.links_white_listed.count} white listed" if r.white_listing - unless skip_dupe - log.addp ", #{r.links.uniq.count} unique" if r.dupes.count > 0 - end + log.addp ", #{r.links.uniq.count} unique" if r.dupes.count > 0 log.add '' r.links.uniq.each_with_index { |u, j| log.add " #{j + 1}. #{u}" }
[output] always display unique links
dkhamsing_awesome_bot
train
rb
fc45c50ff89e41aa1f473f661d3d97c047270b9b
diff --git a/dist/index.js b/dist/index.js index <HASH>..<HASH> 100644 --- a/dist/index.js +++ b/dist/index.js @@ -98,9 +98,12 @@ module.exports = { body: JSON.stringify(params || {}) }); }, - raw: function raw(url, options) { + raw: function raw(url, options, deleteContentType) { options.credentials = options.credentials || 'same-origin'; options.headers = Object.assign({}, headers, options.headers || {}); + if (deleteContentType) { + delete options.headers['Content-Type']; + } return customFetch(url, options); }, setGlobalHeaders: function setGlobalHeaders(newHeaders) { diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -92,9 +92,12 @@ module.exports = { body: JSON.stringify(params || {}) }); }, - raw: function(url, options) { + raw: function(url, options, deleteContentType) { options.credentials = options.credentials || 'same-origin'; options.headers = Object.assign({}, headers, options.headers || {}); + if(deleteContentType) { + delete options.headers['Content-Type']; + } return customFetch(url, options); }, setGlobalHeaders: function(newHeaders) {
Add deleteContentType param to raw
alarner_howhap-fetch
train
js,js
1587b3a35164ecec06cb1b784e11277eb68d0e62
diff --git a/alot/db/utils.py b/alot/db/utils.py index <HASH>..<HASH> 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -132,8 +132,12 @@ def decode_header(header, normalize=False): except UnicodeEncodeError: return value + # some mailers send out incorrectly escaped headers + # and double quote the escaped realname part again. remove those + value = re.sub(r'\"(.*?=\?.*?.*?)\"', r'\1', value) + # otherwise we interpret RFC2822 encoding escape sequences - valuelist = email.header.decode_header(header) + valuelist = email.header.decode_header(value) decoded_list = [] for v, enc in valuelist: v = string_decode(v, enc)
fix: be more relaxed wrt non-rfc-compliant headers this makes db.utils.decode_header remove superflous double quotes around header values before decoding them
pazz_alot
train
py
4ee5e3033be5744ecc28bf4f4a70a5f618c3e3e5
diff --git a/nion/instrumentation/camera_base.py b/nion/instrumentation/camera_base.py index <HASH>..<HASH> 100644 --- a/nion/instrumentation/camera_base.py +++ b/nion/instrumentation/camera_base.py @@ -856,7 +856,7 @@ def update_intensity_calibration(data_element, stem_controller, camera): calibration_controls = camera.calibration_controls counts_per_electron = get_stem_control(stem_controller, calibration_controls, "counts_per_electron") if counts_per_electron: - data_element["counts_per_electron"] = counts_per_electron + data_element["properties"]["counts_per_electron"] = counts_per_electron def update_autostem_properties(data_element, stem_controller, camera):
Fix issue in calibration control for counts per electron.
nion-software_nionswift-instrumentation-kit
train
py
7cdb32f642d5cb6b1aca059b78dec375b4da6885
diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/plugin/v2/trigger.rb +++ b/lib/vagrant/plugin/v2/trigger.rb @@ -36,11 +36,11 @@ module Vagrant triggers = [] if stage == :before triggers = config.before_triggers.select do |t| - t.command == action || (t.command == :all && !t.ignore.any?(action)) + t.command == action || (t.command == :all && !t.ignore.include?(action)) end elsif stage == :after triggers = config.after_triggers.select do |t| - t.command == action || (t.command == :all && !t.ignore.any?(action)) + t.command == action || (t.command == :all && !t.ignore.include?(action)) end else raise Errors::TriggersNoStageGiven,
Use inclunde? instead of any? for ruby <I>
hashicorp_vagrant
train
rb
221e11861f5be9cc57ece28f3aa79ef66264482b
diff --git a/worker/agent.go b/worker/agent.go index <HASH>..<HASH> 100644 --- a/worker/agent.go +++ b/worker/agent.go @@ -74,6 +74,7 @@ func (a *agent) work() { } if inpack, l, err = decodeInPack(data); err != nil { a.worker.err(err) + leftdata = data continue } leftdata = nil
keep already received data if not enough to decode
mikespook_gearman-go
train
go
35772c3e90c0a03ae695e50e4a54c51e924f5bdf
diff --git a/tests/integration.test.js b/tests/integration.test.js index <HASH>..<HASH> 100644 --- a/tests/integration.test.js +++ b/tests/integration.test.js @@ -48,6 +48,7 @@ describe('integration tests', () => { // the implementation of each of the specific classes via conditionals. if (testcase.cache && testcase.published) { await expect(redis.get(key)).resolves.toEqual(JSON.stringify(val)); + await expect(redis.client.ttl(key)).resolves.toBeGreaterThan(-1); } else { await expect(redis.get(key)).rejects.toThrow(); } @@ -85,6 +86,7 @@ describe('integration tests', () => { await expect(db.get(key, testcase.cache)).resolves.toEqual(val); if (testcase.cache && (testcase.published || expectStr)) { await expect(redis.get(key)).resolves.toEqual(expectStr ? val : JSON.stringify(val)); + await expect(redis.client.ttl(key)).resolves.toBeGreaterThan(-1); } else { await expect(redis.get(key)).rejects.toThrow(); }
verifies that TTLs are set in integration tests
clay_amphora-storage-postgres
train
js
46212ec1bc4e15ef7b452a1bacd9593311816431
diff --git a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/UnpairedQuotesBracketsRule.java b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/UnpairedQuotesBracketsRule.java index <HASH>..<HASH> 100644 --- a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/UnpairedQuotesBracketsRule.java +++ b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/rules/UnpairedQuotesBracketsRule.java @@ -21,8 +21,8 @@ public class UnpairedQuotesBracketsRule extends Rule { private final String[] startSymbols; private final String[] endSymbols; - private static final String[] EN_START_SYMBOLS = {"[", "(", "{", "‘", "“"}; - private static final String[] EN_END_SYMBOLS = {"]", ")", "}", "’", "”"}; + private static final String[] EN_START_SYMBOLS = {"[", "(", "{","“"}; + private static final String[] EN_END_SYMBOLS = {"]", ")", "}", "”"}; private static final String[] PL_START_SYMBOLS = {"[", "(", "{", "„", "»"}; private static final String[] PL_END_SYMBOLS = {"]", ")", "}", "”", "«"};
small update to English quotation marks (conflict with typographical apostrophe)
languagetool-org_languagetool
train
java
9efc2eab5d1e4d87201fd63f5200f18ad571c789
diff --git a/bundle/Templating/Twig/Extension/SiteExtension.php b/bundle/Templating/Twig/Extension/SiteExtension.php index <HASH>..<HASH> 100644 --- a/bundle/Templating/Twig/Extension/SiteExtension.php +++ b/bundle/Templating/Twig/Extension/SiteExtension.php @@ -33,6 +33,10 @@ class SiteExtension extends AbstractExtension 'ngsite_image_url', [SiteRuntime::class, 'getImageUrl'], ), + new TwigFunction( + 'ngsite_reading_time', + [SiteRuntime::class, 'calculateReadingTime'], + ), ]; } } diff --git a/bundle/Templating/Twig/Extension/SiteRuntime.php b/bundle/Templating/Twig/Extension/SiteRuntime.php index <HASH>..<HASH> 100644 --- a/bundle/Templating/Twig/Extension/SiteRuntime.php +++ b/bundle/Templating/Twig/Extension/SiteRuntime.php @@ -21,6 +21,8 @@ use function ucwords; class SiteRuntime { + private const WORDS_PER_MINUTE = 230; + protected PathHelper $pathHelper; protected LocaleConverterInterface $localeConverter; @@ -117,4 +119,12 @@ class SiteRuntime return '/'; } + + public function calculateReadingTime(string $text): float + { + $wordCount = str_word_count($text); + $readingTime = floor($wordCount / self::WORDS_PER_MINUTE); + + return $readingTime === false || $readingTime < 1 ? 1 : $readingTime; + } }
NGSTACK-<I> implement reading time twig function
netgen_site-bundle
train
php,php
8d81ea9f57836ec701ac707da49e90c399c82c2f
diff --git a/examples/idle.py b/examples/idle.py index <HASH>..<HASH> 100644 --- a/examples/idle.py +++ b/examples/idle.py @@ -4,10 +4,15 @@ # #http://www.musicpd.org/doc/protocol/ch02.html#id525963 #Example +from select import select client.send_idle() -select([client], [], []) -changed = client.fetch_idle() +# do this periodically, e.g. in event loop +canRead = select([client], [], [], 0)[0] +if canRead: + changes = client.fetch_idle() + print(changes) # handle changes + client.send_idle() # continue idling #You can also poll the socket FD (returned by client.fileno(), which is called by default by select, poll, etc.) using other tools too.
Improved the idle.py example. It now becomes clear what to do with the output of select(), and how to call that function properly.
Mic92_python-mpd2
train
py
bfbff180da1a9b6783f498e5110630ab462193ef
diff --git a/lib/Model.js b/lib/Model.js index <HASH>..<HASH> 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -220,19 +220,6 @@ Model.prototype.invalidate = function invalidate() { Model.prototype.deref = require("./deref"); /** - * Synchronously returns a clone of the {@link Model} bound to a location within the {@link JSONGraph}. Unlike bind or bindSync, softBind never optimizes its path. Soft bind is ideal if you want to retrieve the bound path every time, rather than retrieve the optimized path once and then always retrieve paths from that object in the JSON Graph. For example, if you always wanted to retrieve the name from the first item in a list you could softBind to the path "list[0]". - * @param {Path} path - The path prefix to retrieve every time an operation is executed on a Model. - * @return {Model} - */ -Model.prototype.softDeref = function softDeref(path) { - path = pathSyntax.fromPath(path); - if(Array.isArray(path) === false) { - throw new Error("Model#softDeref must be called with an Array path."); - } - return this.clone({ _path: path }); -}; - -/** * Get data for a single {@link Path} * @param {Path} path - The path to retrieve * @return {Observable.<*>} - The value for the path
Removing softDeref/bind
Netflix_falcor
train
js
9ba0d77d2b92e0b0976ebbf6d70a3e4a8236cb57
diff --git a/src/Str.php b/src/Str.php index <HASH>..<HASH> 100644 --- a/src/Str.php +++ b/src/Str.php @@ -525,6 +525,7 @@ final class Str implements \Countable { * Returns whether this string is entirely lowercase * * @return bool + * @deprecated use `equals` and `toLowerCase` instead */ public function isLowerCase() { return $this->equals($this->toLowerCase());
Deprecate method 'isLowerCase'
delight-im_PHP-Str
train
php
c52792b988088fc78b262ff0a99a15dafb8e31d3
diff --git a/spec/build-url-spec.js b/spec/build-url-spec.js index <HASH>..<HASH> 100644 --- a/spec/build-url-spec.js +++ b/spec/build-url-spec.js @@ -294,4 +294,19 @@ describe('buildUrl', function () { })).toEqual('http://example.com?foo=bar&bar=one%2Ctwo%2Cthree'); }); + it('should maintain trailing slash if no options provided', function () { + expect(buildUrl('http://example.com/api/v2/')).toEqual('http://example.com/api/v2/'); + }); + + it('should maintain trailing slash if empty path is provided', function () { + expect(buildUrl('http://example.com/api/v2/', { path: '' })).toEqual('http://example.com/api/v2/'); + }); + + it('should maintain no trailing slash if one is not present in the url argument', function () { + expect(buildUrl('http://example.com/api/v2')).toEqual('http://example.com/api/v2'); + }); + + it('should maintain trailing slash if provided in path', function () { + expect(buildUrl('http://example.com/api/v2', { path: '/' })).toEqual('http://example.com/api/v2/'); + }); });
Add tests for trailing slash bug
steverydz_build-url
train
js
157fad921115055a5d955434831f940c183c6f0e
diff --git a/lib/sensu/api.rb b/lib/sensu/api.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/api.rb +++ b/lib/sensu/api.rb @@ -443,11 +443,12 @@ module Sensu response = Array.new $redis.smembers('aggregates').callback do |checks| unless checks.empty? + params[:last] ? last = params[:last].to_i : last = 10 checks.each_with_index do |check_name, index| $redis.smembers('aggregates:' + check_name).callback do |aggregates| collection = { :check => check_name, - :issued => aggregates.sort.reverse.take(10) + :issued => aggregates.sort.reverse.take(last) } response.push(collection) if index == checks.size - 1 @@ -463,7 +464,12 @@ module Sensu aget %r{/aggregates/([\w\.-]+)$} do |check_name| $redis.smembers('aggregates:' + check_name).callback do |aggregates| - body aggregates.sort.reverse.take(10).to_json + unless aggregates.empty? + params[:last] ? last = params[:last].to_i : last = 10 + body aggregates.sort.reverse.take(last).to_json + else + not_found! + end end end
return only ?last=N aggregates + return not found instead of empty set for non exising check aggregates
sensu_sensu
train
rb
018405b9c06bc644a14777cd6243c4422c55d79f
diff --git a/logagg/nsqsender.py b/logagg/nsqsender.py index <HASH>..<HASH> 100644 --- a/logagg/nsqsender.py +++ b/logagg/nsqsender.py @@ -17,7 +17,7 @@ class NSQSender(object): self.nsq_max_depth = nsq_max_depth self.log = log - self.session = requests.Session() + self.session = requests self._ensure_topic(self.topic_name) self._ensure_topic(self.HEARTBEAT_TOPIC) @@ -27,7 +27,7 @@ class NSQSender(object): def _ensure_topic(self, topic_name): u = 'http://%s/topic/create?topic=%s' % (self.nsqd_http_address, topic_name) try: - self.session.post(u) + self.session.post(u, timeout=1) except requests.exceptions.RequestException as e: self.log.exception('could_not_create_topic,retrying....', topic=topic_name) raise
fixed logagg creating multiple connections when nsq is down
deep-compute_logagg
train
py
ffbf2114d3c17ab269e9eb7801e44b72f04b4709
diff --git a/src/OAuth2/GrantType/RefreshToken.php b/src/OAuth2/GrantType/RefreshToken.php index <HASH>..<HASH> 100644 --- a/src/OAuth2/GrantType/RefreshToken.php +++ b/src/OAuth2/GrantType/RefreshToken.php @@ -60,7 +60,7 @@ class RefreshToken implements GrantTypeInterface public function getUserId() { - return $this->refreshToken['user_id']; + return isset($this->refreshToken['user_id']) ? $this->refreshToken['user_id'] : null; } public function getScope()
make user_id not required for refresh_token grant
bshaffer_oauth2-server-php
train
php
d73f48a26b807944bb0bb095b58316b8c284b094
diff --git a/src/WP/ScriptsAndStyles.php b/src/WP/ScriptsAndStyles.php index <HASH>..<HASH> 100644 --- a/src/WP/ScriptsAndStyles.php +++ b/src/WP/ScriptsAndStyles.php @@ -81,7 +81,7 @@ class ScriptsAndStyles */ public function hospitalRegisterStyle($file) { - wp_register_style('hospital_admin_style' . $file, $this->path . '/css/' . $file, array(), '1', 'screen'); + wp_register_style('hospital_admin_style' . $file, $this->path . '/css/' . $file, array(), '1', 'all'); wp_enqueue_style('hospital_admin_style' . $file); }
'all' for wp register styles
amarcinkowski_hospitalplugin
train
php
25c7ed80ea9414fb4073e24587db1bb0be1c8cbe
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ data_files=[ ('cherrypy/scaffold', ['cherrypy/scaffold/example.conf', 'cherrypy/scaffold/site.conf', ]), - ('cherrypy/scaffold/static', ['made_with_cherrypy_small.png', + ('cherrypy/scaffold/static', ['cherrypy/scaffold/static/made_with_cherrypy_small.png', ]), ('cherrypy/test', ['cherrypy/test/style.css', 'cherrypy/test/test.pem',
Oops. Buglet in setup.py.
cherrypy_cheroot
train
py
9c4c3d2a155277ff87c2bfc8abae7dcc2ffc39c2
diff --git a/mrq/dashboard/app.py b/mrq/dashboard/app.py index <HASH>..<HASH> 100644 --- a/mrq/dashboard/app.py +++ b/mrq/dashboard/app.py @@ -180,7 +180,7 @@ def api_datatables(unit): if with_mongodb_size: jobs = connections.mongodb_jobs.mrq_jobs.count({ "queue": name, - "status": "queued" + "status": request.args.get("status") or "queued" }) q = {
Allow querying jobs with a different status than "queued"
pricingassistant_mrq
train
py
2ca29a6f248995f0b4825bf24cedeb7ebd12e871
diff --git a/ColonyDSL/GlobalConfig.py b/ColonyDSL/GlobalConfig.py index <HASH>..<HASH> 100644 --- a/ColonyDSL/GlobalConfig.py +++ b/ColonyDSL/GlobalConfig.py @@ -41,15 +41,6 @@ def generate_memory_list() -> list: result.append(ProcedureFileLibrary("/usr/share/ColonyDSL/lib_contrib/procedure/")) result.append(FileTypeDictLibrary("/usr/share/ColonyDSL/lib_contrib/dict/filetype.dict")) result.append(SchemeFileLibrary("/usr/share/ColonyDSL/lib_contrib/scheme/")) - try: - result.append(GrammarFileLibrary("./lib_contrib/grammar/")) - result.append(SchemeFileLibrary("./lib_contrib/scheme/")) - result.append(FileTypeDictLibrary("./lib_contrib/dict/filetype.dict")) - result.append(ProcedureFileLibrary("./lib_contrib/procedure/")) - result.append(TransformerDirLibrary("./lib_contrib/transformer/")) - result.append(BoardFileLibrary("./lib_contrib/board/")) - except IOError: - pass result.append(RegexpDictLibrary("/usr/share/ColonyDSL/lib_contrib/dict/regexp.dict")) return result
library is no longer loaded from WD
nesaro_pydsl
train
py
6693f291ce203169641952f5bafea6263f2909c3
diff --git a/dispatch/static/manager/src/js/components/ContentEditor/ContentStateHelper.js b/dispatch/static/manager/src/js/components/ContentEditor/ContentStateHelper.js index <HASH>..<HASH> 100644 --- a/dispatch/static/manager/src/js/components/ContentEditor/ContentStateHelper.js +++ b/dispatch/static/manager/src/js/components/ContentEditor/ContentStateHelper.js @@ -63,15 +63,10 @@ function createBlock(acc, block) { let blocksFromJSON - switch (block.type) { - case 'paragraph': + if (block.type === 'paragraph') { blocksFromJSON = createParagraphBlock(block) - break - case 'image': - case 'video': - case 'quote': + } else { blocksFromJSON = createEntityBlock(block) - break } if (blocksFromJSON) {
refactor switch statement in content editor
ubyssey_dispatch
train
js
799000ae7e075b4a6a4783780e73e42498b63bfe
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( ], keywords="PEP 287, pep287, docstrings, rst, reStructuredText", py_modules=["flake8_rst_docstrings"], - python_requires=">=3.6", + python_requires=">=3.7", install_requires=[ "flake8 >= 3.0.0", "restructuredtext_lint",
Require Python <I> or later
peterjc_flake8-rst-docstrings
train
py
53fc5409509a169cadfd8f2418edb8c20f580dd7
diff --git a/lib/fog/aws/requests/rds/modify_db_instance.rb b/lib/fog/aws/requests/rds/modify_db_instance.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/requests/rds/modify_db_instance.rb +++ b/lib/fog/aws/requests/rds/modify_db_instance.rb @@ -24,6 +24,7 @@ module Fog # * MultiAZ <~Boolean> Specifies if the DB Instance is a Multi-AZ deployment # * PreferredBackupWindow <~String> The daily time range during which automated backups are created if automated backups are enabled # * PreferredMaintenanceWindow <~String> The weekly time range (in UTC) during which system maintenance can occur, which may result in an outage + # * VpcSecurityGroups <~Array> A list of VPC Security Group IDs to authorize on this DB instance # ==== Returns # * response<~Excon::Response>: # * body<~Hash>: @@ -33,6 +34,10 @@ module Fog options.merge!(Fog::AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups])) end + if vpc_security_groups = options.delete('VpcSecurityGroups') + options.merge!(Fog::AWS.indexed_param('VpcSecurityGroupIds.member.%d', [*vpc_security_groups])) + end + request({ 'Action' => 'ModifyDBInstance', 'DBInstanceIdentifier' => db_name,
Support VPC security group modifictions for RDS
fog_fog
train
rb
0ab5088dd39a3436d5ae2bdcba5cb4b48e80fd1f
diff --git a/scout/models/case/case.py b/scout/models/case/case.py index <HASH>..<HASH> 100644 --- a/scout/models/case/case.py +++ b/scout/models/case/case.py @@ -83,7 +83,7 @@ class Case(Document): distinct_genes = set() for panel in self.default_panels: for gene in panel.gene_objects.values(): - distinct_genes.add(gene.hgnc_id) + distinct_genes.add(gene.hgnc_gene.hgnc_id) return distinct_genes @property diff --git a/scout/models/case/gene_list.py b/scout/models/case/gene_list.py index <HASH>..<HASH> 100644 --- a/scout/models/case/gene_list.py +++ b/scout/models/case/gene_list.py @@ -37,7 +37,7 @@ class GenePanel(Document): @property def gene_ids(self): for gene in self.gene_objects.values(): - yield gene.hgnc_id + yield gene.hgnc_gene.hgnc_id @property def name_and_version(self):
correct getting hgnc id
Clinical-Genomics_scout
train
py,py
d6d7e60ef578ef49e2ca611a006093b063c0fabb
diff --git a/oidc_provider/admin.py b/oidc_provider/admin.py index <HASH>..<HASH> 100644 --- a/oidc_provider/admin.py +++ b/oidc_provider/admin.py @@ -1,9 +1,8 @@ from django.contrib import admin -from oidc_provider.models import Client, Code, Token, UserInfo +from oidc_provider.models import Client, Code, Token admin.site.register(Client) admin.site.register(Code) admin.site.register(Token) -admin.site.register(UserInfo) \ No newline at end of file
Remove UserInfo from admin.py.
juanifioren_django-oidc-provider
train
py
5f21b5f387e895a9af2ac8481bd495f2dacd6cdf
diff --git a/carbonate/util.py b/carbonate/util.py index <HASH>..<HASH> 100644 --- a/carbonate/util.py +++ b/carbonate/util.py @@ -14,14 +14,18 @@ def common_parser(description='untitled'): description=description, formatter_class=argparse.ArgumentDefaultsHelpFormatter) + config_file = os.environ.get('CARBONATE_CONFIG', + '/opt/graphite/conf/carbonate.conf') + cluster = os.environ.get('CARBONATE_CLUSTER', 'main') + parser.add_argument( '-c', '--config-file', - default='/opt/graphite/conf/carbonate.conf', + default=config_file, help='Config file to use') parser.add_argument( '-C', '--cluster', - default='main', + default=cluster, help='Cluster name') return parser
Read config-file and cluster options from environ This would make it DRY in scripts/wrappers with non-default values.
graphite-project_carbonate
train
py
7310c5a9a9b5e6638c4494593c516a549c0a9399
diff --git a/Spreadsheet.php b/Spreadsheet.php index <HASH>..<HASH> 100644 --- a/Spreadsheet.php +++ b/Spreadsheet.php @@ -497,6 +497,8 @@ class Spreadsheet extends Base case 'h2': case 'h3': case 'h4': + case 'h5': + case 'h6': $currentFormats[] = static::FORMAT_BOLD; break; case 'a': @@ -536,6 +538,12 @@ class Spreadsheet extends Base 'formattings' => [static::FORMAT_LINEBREAK], ]; } + if (in_array($child->nodeName, ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])) { + $return[] = [ + 'text' => '', + 'formattings' => [static::FORMAT_LINEBREAK, static::FORMAT_BOLD], + ]; + } break; case XML_TEXT_NODE: /** @var \DOMText $child */ diff --git a/Text.php b/Text.php index <HASH>..<HASH> 100644 --- a/Text.php +++ b/Text.php @@ -215,6 +215,8 @@ class Text extends Base $inP = true; break; case 'h4': + case 'h5': + case 'h6': $dstEl = $this->createNodeWithBaseStyle('p', $lineNumbered); $dstEl->setAttribute('text:style-name', 'Antragsgrün_20_H4'); $inP = true;
Improve support for H1-H6
CatoTH_html2opendocument
train
php,php
fd9bcb2e11a5299a4e63e8a7017c435d098b1fec
diff --git a/tornado/autoreload.py b/tornado/autoreload.py index <HASH>..<HASH> 100644 --- a/tornado/autoreload.py +++ b/tornado/autoreload.py @@ -71,6 +71,7 @@ import logging import os import pkgutil import sys +import traceback import types import subprocess @@ -275,7 +276,16 @@ def main(): logging.info("Script exited with status %s", e.code) except Exception, e: logging.warning("Script exited with uncaught exception", exc_info=True) + # If an exception occurred at import time, the file with the error + # never made it into sys.modules and so we won't know to watch it. + # Just to make sure we've covered everything, walk the stack trace + # from the exception and watch every file. + for (filename, lineno, name, line) in traceback.extract_tb(sys.exc_info()[2]): + watch(filename) if isinstance(e, SyntaxError): + # SyntaxErrors are special: their innermost stack frame is fake + # so extract_tb won't see it and we have to get the filename + # from the exception object. watch(e.filename) else: logging.info("Script exited normally")
Improve autoreload for import-time errors. We already had a special case for SyntaxErrors, but NameErrors and other import-time errors could leave a file unwatched.
tornadoweb_tornado
train
py
f0876b86f4142736a495480e1fd26f77e759f002
diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php @@ -35,7 +35,10 @@ class CoalesceAnalyzer ) { $left_var_id = '$<tmp coalesce var>' . (int) $left_expr->getAttribute('startFilePos'); - ExpressionAnalyzer::analyze($statements_analyzer, $left_expr, clone $context); + $cloned = clone $context; + $cloned->inside_isset = true; + + ExpressionAnalyzer::analyze($statements_analyzer, $left_expr, $cloned); $condition_type = $statements_analyzer->node_data->getType($left_expr) ?: Type::getMixed();
Avoid false-positives while analysing memoised coalesce
vimeo_psalm
train
php
230c6d47ce8d6b498fd9f0099d68e3f0b80130e4
diff --git a/src/Tooltip.js b/src/Tooltip.js index <HASH>..<HASH> 100644 --- a/src/Tooltip.js +++ b/src/Tooltip.js @@ -150,6 +150,10 @@ Titon.Tooltip = new Class({ * Hide the tooltip and set all relevant values to null. */ hide: function() { + if (!this.isVisible) { + return; + } + this.isVisible = false; this.node.removeEvents('mousemove'); @@ -357,7 +361,7 @@ Titon.Tooltip = new Class({ Titon.Tooltip.instances = {}; /** - * Easily create multiple instances. + * Easily create multiple Tooltip instances. * * @param query * @param options @@ -368,4 +372,13 @@ Titon.Tooltip.factory = function(query, options) { Titon.Tooltip.instances[query] = instance; return instance; -}; \ No newline at end of file +}; + +/** + * Hide all Tooltip instances. + */ +Titon.Tooltip.hide = function() { + Object.each(Titon.Tooltip.instances, function(tooltip) { + tooltip.hide(); + }); +};
<I> Added a static top level hide() method that will hide all instances on the page
titon_toolkit
train
js
5bab2123e1495b234a223f5f5fc4e905c65b830b
diff --git a/src/main/java/com/cloudbees/jenkins/GitHubWebHook.java b/src/main/java/com/cloudbees/jenkins/GitHubWebHook.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/cloudbees/jenkins/GitHubWebHook.java +++ b/src/main/java/com/cloudbees/jenkins/GitHubWebHook.java @@ -153,7 +153,7 @@ public class GitHubWebHook implements UnprotectedRootAction { Matcher matcher = REPOSITORY_NAME_PATTERN.matcher(repoUrl); if (matcher.matches()) { GitHubRepositoryName changedRepository = new GitHubRepositoryName(matcher.group(1), ownerName, repoName); - for (AbstractProject<?,?> job : Hudson.getInstance().getItems(AbstractProject.class)) { + for (AbstractProject<?,?> job : Hudson.getInstance().getAllItems(AbstractProject.class)) { GitHubPushTrigger trigger = job.getTrigger(GitHubPushTrigger.class); if (trigger!=null) { LOGGER.fine("Considering to poke "+job.getFullDisplayName());
Needs to look for all the projects recursively.
jenkinsci_github-plugin
train
java
edc21feb66a371c3a425fa284ba1a529f40736e1
diff --git a/core/lib/refinery/crud.rb b/core/lib/refinery/crud.rb index <HASH>..<HASH> 100644 --- a/core/lib/refinery/crud.rb +++ b/core/lib/refinery/crud.rb @@ -18,16 +18,16 @@ module Refinery this_class = class_name.constantize.base_class { - :title_attribute => "title", - :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')), :conditions => '', - :sortable => true, - :searchable => true, + :order => ('position ASC' if this_class.table_exists? and this_class.column_names.include?('position')), :include => [], :paging => true, - :search_conditions => '', + :per_page => false, :redirect_to_url => "admin_#{plural_name}_url", - :per_page => false + :searchable => true, + :search_conditions => '', + :sortable => true, + :title_attribute => "title" } end
Ordered the default attributes in crudify alphabetically.
refinery_refinerycms
train
rb
c10bb2996a441f602ca264a84607692cb3e833c7
diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb index <HASH>..<HASH> 100644 --- a/actionview/lib/action_view/template/types.rb +++ b/actionview/lib/action_view/template/types.rb @@ -6,13 +6,7 @@ module ActionView class Types class Type cattr_accessor :types - self.types = Set.new - - def self.register(*t) - types.merge(t.map(&:to_s)) - end - - register :html, :text, :js, :css, :xml, :json + self.types = Set.new([ :html, :text, :js, :css, :xml, :json ]) def self.[](type) return type if type.is_a?(self)
Remove register abstraction. The template types is a private abstraction to fill in basic blanks from Action Dispatch's mime types. As such we can modify the data structure ourselves.
rails_rails
train
rb
290be0ee8092aa5d88b53ab2b871e535258a22cf
diff --git a/lib/alchemy/essence.rb b/lib/alchemy/essence.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/essence.rb +++ b/lib/alchemy/essence.rb @@ -61,7 +61,7 @@ module Alchemy #:nodoc: delegate :restricted?, to: :page, allow_nil: true delegate :public?, to: :element, allow_nil: true - after_save :touch_element + after_update :touch_element def acts_as_essence_class #{name}
Performance: Only touch element after update When creating an element, we do not need to touch it for every time it creates a content.
AlchemyCMS_alchemy_cms
train
rb
5be6e1c92e6b127fb0295d75d4d50dc921892cfc
diff --git a/mobile/bindings.go b/mobile/bindings.go index <HASH>..<HASH> 100644 --- a/mobile/bindings.go +++ b/mobile/bindings.go @@ -79,6 +79,19 @@ func Start(extraArgs string, unlockerReady, rpcReady Callback) { go func() { <-rpcListening + + // Now that the RPC server is ready, we can get the needed + // authentication options, and add them to the global dial + // options. + auth, err := lnd.AdminAuthOptions() + if err != nil { + rpcReady.OnError(err) + return + } + + // Add the auth options to the listener's dial options. + addLightningLisDialOption(auth...) + rpcReady.OnResponse([]byte{}) }() }
mobile: authenticate with rpc server This makes the mobile bindings work with TLS and macaroons enabled, which is supported from falafel <I>.
lightningnetwork_lnd
train
go
6b3a9965e2d3074ea6f15f2553c419f6fd382fed
diff --git a/test/test_audio.rb b/test/test_audio.rb index <HASH>..<HASH> 100644 --- a/test/test_audio.rb +++ b/test/test_audio.rb @@ -41,7 +41,7 @@ class TestAudio < Test::Unit::TestCase end def test_analyze - # We don't test the full ESTER2 algorithm for now + # TODO - We don't test the full ESTER2 algorithm for now end def test_set_uri_and_type_uri
Changing message as a TODO
bbc_diarize-jruby
train
rb
ba21bbc04e1c39b41ff25c5ddcd22ffe7059f4d8
diff --git a/libraries/lithium/test/Unit.php b/libraries/lithium/test/Unit.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/test/Unit.php +++ b/libraries/lithium/test/Unit.php @@ -543,6 +543,9 @@ class Unit extends \lithium\core\Object { $data[] = $compare; } } + if (empty($data)) { + return compact('trace', 'expected', 'result'); + } return $data; }
return all data if unit compare can not figure out differences
UnionOfRAD_framework
train
php
ac78583dad52f9026d08738a94812f76a396c31d
diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index <HASH>..<HASH> 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -368,6 +368,7 @@ class UsersController extends BackendAppController if (!$this->request->isAll(['ajax', 'post'])) { throw new MethodNotAllowedException(); } + $this->viewClass = null; $this->request->session()->renew(); $this->set([ 'status' => 200,
set viewclass to null in heartbeat action
wasabi-cms_core
train
php
4f2fcf8493567ef84f2fcb34342cac30cad3da89
diff --git a/test/test_job.py b/test/test_job.py index <HASH>..<HASH> 100644 --- a/test/test_job.py +++ b/test/test_job.py @@ -1,5 +1,7 @@ '''Basic tests about the Job class''' +import sys + from common import TestQless from qless.job import Job, BaseJob @@ -188,7 +190,10 @@ class TestJob(TestQless): self.client.queues['nonstatic'].pop().process() job = self.client.jobs['jid'] self.assertEqual(job.state, 'failed') - self.assertEqual(job.failure['group'], 'nonstatic-method-type') + if sys.version_info[0] >= 3: + self.assertEqual(job.failure['group'], 'nonstatic-TypeError') + else: + self.assertEqual(job.failure['group'], 'nonstatic-method-type') def test_reload(self): '''Ensure that nothing blows up if we reload a class'''
Python3 cannot distinguish functions from class instances
seomoz_qless-py
train
py
ba0fd22c660ef194de444991143fce80192eacc1
diff --git a/framework/db/ColumnSchema.php b/framework/db/ColumnSchema.php index <HASH>..<HASH> 100644 --- a/framework/db/ColumnSchema.php +++ b/framework/db/ColumnSchema.php @@ -126,6 +126,7 @@ class ColumnSchema extends Object return $value; } if (is_float($value)) { + // ensure type cast always has . as decimal separator in all locales return str_replace(',', '.', (string)$value); } return (string)$value;
Update ColumnSchema.php added comment
yiisoft_yii2
train
php
e64fbb87512735c90ffd8c4014f3776f331d0fa5
diff --git a/spec/unit/lib/itamae/resource/remote_file_spec.rb b/spec/unit/lib/itamae/resource/remote_file_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/lib/itamae/resource/remote_file_spec.rb +++ b/spec/unit/lib/itamae/resource/remote_file_spec.rb @@ -27,6 +27,7 @@ module Itamae expect(subject).to receive(:run_specinfra).with(:check_file_is_file, "/path/to/dst").and_return(true) expect(subject).to receive(:run_command).with(["cp", "/path/to/dst", "/path/to/dst.bak"]) expect(subject).to receive(:run_command).with(["mv", %r{/tmp/itamae/[\d\.]+}, "/path/to/dst"]) + subject.pre_action subject.create_action end end
Fix remote_file_spec.rb If pre_action is not executed, @temppath is not set and spec fails.
itamae-kitchen_itamae
train
rb
5a2f621e533f91e5c6d88e3366b4416ab7169f0a
diff --git a/ioc_writer/ioc_api.py b/ioc_writer/ioc_api.py index <HASH>..<HASH> 100644 --- a/ioc_writer/ioc_api.py +++ b/ioc_writer/ioc_api.py @@ -47,7 +47,7 @@ date_regex = r'^[12][9012][0-9]{2}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[ class IOCParseError(Exception): pass -class IOC(): +class IOC(object): """ Class for easy creation and manipulation of IOCs.
IOC class should inherit from object.
mandiant_ioc_writer
train
py
06fa948ea119d9ac9e80c4c9d83ebabfa9492805
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -63,6 +63,7 @@ func (c *Client) Subscribe(stream string, handler func(msg *Event)) error { func (c *Client) SubscribeChan(stream string, ch chan *Event) error { resp, err := c.request(stream) if err != nil { + close(ch) return err } defer resp.Body.Close()
Consistently close channel on error
r3labs_sse
train
go
f130f7853e9c4e2bcb255e49106e0ccab3c945f7
diff --git a/lib/perform_later/args_parser.rb b/lib/perform_later/args_parser.rb index <HASH>..<HASH> 100644 --- a/lib/perform_later/args_parser.rb +++ b/lib/perform_later/args_parser.rb @@ -18,10 +18,14 @@ module PerformLater if o o = args_from_resque(o) if o.is_a?(Array) case o - when CLASS_STRING_FORMAT then $1.constantize - when AR_STRING_FORMAT then $1.constantize.find_by_id($2) - when YAML_STRING_FORMAT then YAML.load(o) - else o + when CLASS_STRING_FORMAT + $1.constantize + when AR_STRING_FORMAT + $1.constantize.find_by_id($2) + when YAML_STRING_FORMAT + YAML.load(o) + else + o end end } if args
Formatting of the args_finder
KensoDev_perform_later
train
rb
3431f363dae3cf0728f0d854f22f21ab97b94d50
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -97,7 +97,7 @@ class ExtensionBuilder(distutils.command.build_ext.build_ext, build_ext_options) if processor == 'x86_64': return 'x86_64' # Best guess? else: - return 'reference' + return 'x86_64' def get_compiler_name(self): if 'BLIS_COMPILER' in os.environ:
Force build for x<I>_<I>
explosion_cython-blis
train
py
36451aef82af349e59c2fef5448a4c2063818e14
diff --git a/test/tools/javac/T6725036.java b/test/tools/javac/T6725036.java index <HASH>..<HASH> 100644 --- a/test/tools/javac/T6725036.java +++ b/test/tools/javac/T6725036.java @@ -23,8 +23,7 @@ /* * @test - * @bug 6725036 - * @ignore 8016760: failure of regression test langtools/tools/javac/T6725036.java + * @bug 6725036 8016760 * @summary javac returns incorrect value for lastModifiedTime() when * source is a zip file archive */
<I>: Remove @ignore from tools/javac/T<I>.java Reviewed-by: jjg
google_error-prone-javac
train
java
b61e9e2ace0cbd547e5da3224f7ec87784b41443
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -38,7 +38,7 @@ module ActiveRecord delegate :to_xml, :encode_with, :length, :collect, :map, :each, :all?, :include?, :to_ary, :join, :[], :&, :|, :+, :-, :sample, :reverse, :compact, :in_groups, :in_groups_of, - :shuffle, :split, to: :records + :shuffle, :split, :index, to: :records delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key, :connection, :columns_hash, :to => :klass
add index to array methods so we can call it on relations
rails_rails
train
rb
85a93831ddf98632d8156bcebee92069b634ef06
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index <HASH>..<HASH> 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -111,8 +111,7 @@ class CSharpLanguage: return {} def unimplemented_test_cases(self): - # TODO: status_code_and_message doesn't work against node_server - return _SKIP_COMPRESSION + ['status_code_and_message'] + return _SKIP_COMPRESSION def unimplemented_test_cases_server(self): return _SKIP_COMPRESSION
run all implemented C# interop tests
grpc_grpc
train
py
8fb759c738a89f337e2b1512cc10fd9b88775d5b
diff --git a/packages/cozy-scripts/config/webpack.config.pictures.js b/packages/cozy-scripts/config/webpack.config.pictures.js index <HASH>..<HASH> 100644 --- a/packages/cozy-scripts/config/webpack.config.pictures.js +++ b/packages/cozy-scripts/config/webpack.config.pictures.js @@ -2,7 +2,7 @@ const { environment, target } = require('./webpack.vars') const SpriteLoaderPlugin = require('svg-sprite-loader/plugin') -const isMobileApp = target === 'mobile' ? true : false +const isMobileApp = target === 'mobile' module.exports = { module: { rules: [
Update packages/cozy-scripts/config/webpack.config.pictures.js
CPatchane_create-cozy-app
train
js
5aef6028e45f4a7361b0d1da1990c5688d072379
diff --git a/code/libraries/koowa/components/com_activities/model/entity/activity.php b/code/libraries/koowa/components/com_activities/model/entity/activity.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/components/com_activities/model/entity/activity.php +++ b/code/libraries/koowa/components/com_activities/model/entity/activity.php @@ -442,13 +442,13 @@ class ComActivitiesModelEntityActivity extends KModelEntityRow implements ComAct if ($value = $object->{ 'object' . ucfirst($property)}) { - $config = array('objectName' => $value, 'internal' => true); + $config = $this->_getConfig($parts[0].ucfirst($parts[1])); + + $config->append(array('objectName' => $value, 'internal' => true)); // If display property is set use it and disable properties translations. - if ($value = $object->{'display' . ucfirst($property)}) - { - $config['displayName'] = $value; - $config['translate'] = false; + if ($value = $object->{'display' . ucfirst($property)}) { + $config->append(array('displayName' => $value, 'translate' => false)); } // Create a new basic and minimal format token object.
Allow dot notation internal objects to be configurable. This allows for dot notation tokens to be fully configurable, i.e. making them linkable, etc.
joomlatools_joomlatools-framework
train
php
f94bd4d48900b1e1e5a11c78cce82f1a2b6d3fc7
diff --git a/classes/Boom/Page/Creator.php b/classes/Boom/Page/Creator.php index <HASH>..<HASH> 100644 --- a/classes/Boom/Page/Creator.php +++ b/classes/Boom/Page/Creator.php @@ -2,6 +2,8 @@ namespace Boom\Page; +use \Boom\Page as Page; + class Creator { /** @@ -19,7 +21,7 @@ class Creator protected $_templateId; protected $_title = 'Untitled'; - public function __construct(\Model_Page $parent, \Model_Person $creator) + public function __construct(Page $parent, \Model_Person $creator) { $this->_parent = $parent; $this->_creator = $creator;
Fixed bug in page creator by updating type hints
boomcms_boom-core
train
php
63aa61ca81211ec5e47725b3050f2760038c8bec
diff --git a/test/extended/authorization/authorization.go b/test/extended/authorization/authorization.go index <HASH>..<HASH> 100644 --- a/test/extended/authorization/authorization.go +++ b/test/extended/authorization/authorization.go @@ -335,6 +335,10 @@ func (test localResourceAccessReviewTest) run() { if strings.HasPrefix(curr, "system:serviceaccount:openshift-") { continue } + // skip the ci provisioner to pass gcp: ci-provisioner@openshift-gce-devel-ci.iam.gserviceaccount.com + if strings.HasPrefix(curr, "ci-provisioner@") { + continue + } actualUsersToCheck.Insert(curr) } if !reflect.DeepEqual(actualUsersToCheck, sets.NewString(test.response.UsersSlice...)) {
relax RAR check to pass GCP
openshift_origin
train
go
935f23087ea3ff55fa74d7207d4090b73710f717
diff --git a/src/replace.js b/src/replace.js index <HASH>..<HASH> 100644 --- a/src/replace.js +++ b/src/replace.js @@ -18,8 +18,7 @@ export class Slice { // Create a slice. When specifying a non-zero open depth, you must // make sure that there are nodes of at least that depth at the // appropriate side of the fragment—i.e. if the fragment is an empty - // paragraph node, `openStart` and `openEnd` can't be greater than - // 1. + // paragraph node, `openStart` and `openEnd` can't be greater than 1. // // It is not necessary for the content of open nodes to conform to // the schema's content constraints, though it should be a valid
Slice markdown: do not start line with 1.
ProseMirror_prosemirror-model
train
js
8d052b9dc512e4e1e4e2b08b79a00dfb0c977788
diff --git a/workshift/tests.py b/workshift/tests.py index <HASH>..<HASH> 100644 --- a/workshift/tests.py +++ b/workshift/tests.py @@ -1323,10 +1323,22 @@ class TestInteractForms(TestCase): self.assertEqual(["Not signed into workshift."], form.errors["pk"]) def test_missing_shift(self): - pass + self.assertTrue(self.client.login(username="u", password="pwd")) + + form = SignOutForm({"pk": -1}, profile=self.up) + self.assertFalse(form.is_valid()) + + form = SignOutForm({"pk": 100}, profile=self.up) + self.assertFalse(form.is_valid()) + + form = SignOutForm({"pk": "a"}, profile=self.up) + self.assertFalse(form.is_valid()) def test_closed_shift(self): - pass + self.once.closed = True + self.once.save() + form = SignOutForm({"pk": self.once.pk}, profile=self.up) + self.assertFalse(form.is_valid()) class TestPermissions(TestCase): """
Filled in test_closed_shift and test_missing_shift
knagra_farnsworth
train
py
9c66eeffae978e55a5a2c75a3185cffe2e5671a2
diff --git a/spec/authority_spec.rb b/spec/authority_spec.rb index <HASH>..<HASH> 100644 --- a/spec/authority_spec.rb +++ b/spec/authority_spec.rb @@ -14,7 +14,7 @@ describe Authority do end it "has a convenience accessor for the ability verbs" do - expect(Authority.verbs.sort).to eq([:create, :delete, :read, :update]) + expect(Authority.verbs.map(&:to_s).sort).to eq(%w[create delete read update]) end it "has a convenience accessor for the ability adjectives" do
Fix this test for <I>
nathanl_authority
train
rb
e5151180a35455f04b50c35982279ebed45f8d7e
diff --git a/bootstrap.js b/bootstrap.js index <HASH>..<HASH> 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -59,6 +59,8 @@ module.exports = function(grunt) { tasksDefault.push('scaffold'); if (grunt.file.exists('./composer.lock') && grunt.config.get(['composer', 'install'])) { + // Manually run `composer drupal-scaffold` since this is only automatically run on update. + tasksDefault.unshift('composer:drupal-scaffold'); // Run `composer install` if there is already a lock file. Updates should be explicit once this file exists. tasksDefault.unshift('composer:install'); } diff --git a/tasks/composer.js b/tasks/composer.js index <HASH>..<HASH> 100644 --- a/tasks/composer.js +++ b/tasks/composer.js @@ -29,6 +29,7 @@ module.exports = function(grunt) { ], } }); + grunt.config(['composer', 'drupal-scaffold'], {}); Help.add({ task: 'composer',
Run `composer drupal-scaffold` after `composer install`
phase2_grunt-drupal-tasks
train
js,js
2f2040c8e4e44dec713bf72e62168f6b6f973eb3
diff --git a/lib/magic_pipe/metrics.rb b/lib/magic_pipe/metrics.rb index <HASH>..<HASH> 100644 --- a/lib/magic_pipe/metrics.rb +++ b/lib/magic_pipe/metrics.rb @@ -2,7 +2,7 @@ module MagicPipe module Metrics class << self def client - Config.instance.metrics_client + MagicPipe.config.metrics_client end def method_missing(name, *args, &block)
don't reference the Config module directly
tompave_magic_pipe
train
rb
17df66208bfb316c7e1332dd92b17b60c18d8915
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -39,7 +39,7 @@ string will be the contents of the managed file. For example: def run(): lines = ('foo', 'bar', 'baz') - return '\n\n'.join(lines) + return '\\n\\n'.join(lines) .. note::
Fixing the doc and escaping newline char
saltstack_salt
train
py
674d789123054f44fe5759aa40c68a1af28610cb
diff --git a/tests/test_mock_submission.py b/tests/test_mock_submission.py index <HASH>..<HASH> 100644 --- a/tests/test_mock_submission.py +++ b/tests/test_mock_submission.py @@ -339,8 +339,8 @@ class MockSubmission(_QueryTest): future = solver.sample_qubo({}) future.result() - # after third poll, back-off interval should be 4 - self.assertEqual(future._poll_backoff, 4) + # after third poll, back-off interval should be 4 x initial back-off + self.assertEqual(future._poll_backoff, Client._POLL_BACKOFF_MIN * 2**2) @mock.patch.object(Client, "_POLL_THREAD_COUNT", 1) @mock.patch.object(Client, "_SUBMISSION_THREAD_COUNT", 1)
Generalize exp back-test to account for initial back-off
dwavesystems_dwave-cloud-client
train
py
4672a6e502969c7c19f1405c04ac8a78df752ccd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -202,7 +202,9 @@ VMRun.vmrunWithOptions = function (command, args, options) { child_process.exec('vmrun' + ' ' + runArgs.join(' '), {}, function (err, stdout, stderr) { if (err) { - err.stderr = stderr; + if (/^Error: /.test(stderr || stdout)) { + err.message = ((stderr || stdout).substr(7)).trim() + '\n cmd: ' + err.cmd; + } return reject(err); }
Improved error formatting from vmrun output
danielgindi_node-vmrun
train
js
bed70bd15f6d000ce6a7bfeec4c82e616d0c43b8
diff --git a/bcbio/distributed/manage.py b/bcbio/distributed/manage.py index <HASH>..<HASH> 100644 --- a/bcbio/distributed/manage.py +++ b/bcbio/distributed/manage.py @@ -61,8 +61,9 @@ def start_analysis_manager(cluster, args, config): program_cl = [config["analysis"]["process_program"]] + args job_id = cluster.submit_job(cluster_args, program_cl) # wait for job to start - while not(cluster.are_running([job_id])): - time.sleep(5) + # Avoid this for systems where everything queues as batches + #while not(cluster.are_running([job_id])): + # time.sleep(5) return job_id def monitor_analysis(cluster, job_id):
Queue manager and work nodes concurrently; fixes issue <I> reported by @vals
bcbio_bcbio-nextgen
train
py
8d3c1d37c78209dd8b4ec71cd0574538075b3ac3
diff --git a/code/extensions/BlocksSiteTreeExtension.php b/code/extensions/BlocksSiteTreeExtension.php index <HASH>..<HASH> 100644 --- a/code/extensions/BlocksSiteTreeExtension.php +++ b/code/extensions/BlocksSiteTreeExtension.php @@ -31,8 +31,11 @@ class BlocksSiteTreeExtension extends SiteTreeExtension{ * Block manager for Pages **/ public function updateCMSFields(FieldList $fields) { + $fields->addFieldToTab('Root.Blocks', LiteralField::create('PreviewLink', "<p><a href='" . $this->blockPreviewLink() . "' target='_blank'>Preview Block Areas for this page</a></p>")); if(count($this->blockManager->getAreasForPageType($this->owner->ClassName))){ - + + + // Blocks related directly to this Page $gridConfig = GridFieldConfig_BlockManager::create() ->addExisting($this->owner->class) @@ -342,4 +345,9 @@ class BlocksSiteTreeExtension extends SiteTreeExtension{ return $blocks; } + + + public function blockPreviewLink(){ + return Controller::join_links($this->owner->Link(), '?block_preview=1'); + } } \ No newline at end of file
ADDED link to preview blocks in cms
sheadawson_silverstripe-blocks
train
php
9ff095384be78845914f4e729c25b1756ae73ad6
diff --git a/lhc/binf/loci/tools/query.py b/lhc/binf/loci/tools/query.py index <HASH>..<HASH> 100644 --- a/lhc/binf/loci/tools/query.py +++ b/lhc/binf/loci/tools/query.py @@ -7,9 +7,13 @@ from lhc.io.loci import open_loci_file def query(query_loci: Iterable[GenomicInterval], loci: pysam.TabixFile, *, direction: str = 'left', tolerance=0) -> Iterator[GenomicInterval]: + missing_chromosomes = set() for locus in query_loci: query_locus = GenomicInterval(max(locus.start - tolerance, 0), locus.stop + tolerance, chromosome=locus.chromosome) - found_loci = loci.fetch(query_locus) + try: + found_loci = loci.fetch(query_locus) + except ValueError: + missing_chromosomes.add(str(locus.chromosome)) if direction == 'left': if next(found_loci, None) is not None: yield locus
improve track missing chromosome in loci query
childsish_lhc-python
train
py
bf571c0b0182354d1b9d44e40ecaf426f6c93b61
diff --git a/arch/zx48k/translator.py b/arch/zx48k/translator.py index <HASH>..<HASH> 100644 --- a/arch/zx48k/translator.py +++ b/arch/zx48k/translator.py @@ -473,18 +473,18 @@ class Translator(TranslatorVisitor): continue_loop = backend.tmp_label() if node.token == 'WHILE_DO': - self.emit('jump', continue_loop) + self.ic_jump(continue_loop) - self.emit('label', loop_label) + self.ic_label(loop_label) self.LOOPS.append(('DO', end_loop, continue_loop)) # Saves which labels to jump upon EXIT or CONTINUE if len(node.children) > 1: yield node.children[1] - self.emit('label', continue_loop) + self.ic_label(continue_loop) yield node.children[0] - self.emit('jnzero' + self.TSUFFIX(node.children[0].type_), node.children[0].t, loop_label) - self.emit('label', end_loop) + self.ic_jnzero(node.children[0].type_, node.children[0].t, loop_label) + self.ic_label(end_loop) self.LOOPS.pop() # del loop_label, end_loop, continue_loop
Refactorize DO WHILE visit
boriel_zxbasic
train
py
330139b7d8c6e4142627156efe9fdcb69ef88670
diff --git a/features/step_definitions/cucumber_rails_steps.rb b/features/step_definitions/cucumber_rails_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/cucumber_rails_steps.rb +++ b/features/step_definitions/cucumber_rails_steps.rb @@ -37,7 +37,7 @@ module CucumberRailsHelper end World(CucumberRailsHelper) -Given /^I have created a new Rails 3 app and installed cucumber\-rails, accidentally outside of the test group in my Gemfile$/ do +Given /^I have created a new Rails app and installed cucumber\-rails, accidentally outside of the test group in my Gemfile$/ do rails_new install_cucumber_rails :not_in_test_group create_web_steps @@ -58,7 +58,7 @@ Given /^I have created a new Rails app and installed cucumber\-rails$/ do prepare_aruba_report end -Given /^I have created a new Rails 3 app with no database and installed cucumber-rails$/ do +Given /^I have created a new Rails app with no database and installed cucumber-rails$/ do rails_new :args => '--skip-active-record' install_cucumber_rails :no_database_cleaner, :no_factory_girl overwrite_file('features/support/env.rb', "require 'cucumber/rails'\n") @@ -72,4 +72,4 @@ end When /^I run the cukes$/ do run_simple('bundle exec cucumber') -end +end \ No newline at end of file
Changed references to Rails 3 app to Rails app
cucumber_cucumber-rails
train
rb
9b70f80f6edff24a461ef7afc876bf00a5df47c4
diff --git a/src/Analyse/Callback/Iterate/ThroughGetter.php b/src/Analyse/Callback/Iterate/ThroughGetter.php index <HASH>..<HASH> 100644 --- a/src/Analyse/Callback/Iterate/ThroughGetter.php +++ b/src/Analyse/Callback/Iterate/ThroughGetter.php @@ -374,6 +374,11 @@ class ThroughGetter extends AbstractCallback */ protected function getReflectionPropertyDeep(ReflectionClass $classReflection, ReflectionMethod $reflectionMethod) { + if ($reflectionMethod->isInternal() === true) { + // Early return for internal stuff. + return null; + } + // Read the sourcecode into a string. $sourcecode = $this->pool->fileService->readFile( $reflectionMethod->getFileName(),
Added an early return to the getter iteration, in case of a predefined internal class.
brainworxx_kreXX
train
php
2ad786ac32fca6de669c4677d1036cd3b2567235
diff --git a/lib/te3270/emulators/quick3270.rb b/lib/te3270/emulators/quick3270.rb index <HASH>..<HASH> 100644 --- a/lib/te3270/emulators/quick3270.rb +++ b/lib/te3270/emulators/quick3270.rb @@ -11,10 +11,14 @@ module TE3270 def connect start_quick_system yield self if block_given? - establish_session end + def disconnect + session.Disconnect + system.Application.Quit + end + private def visible diff --git a/spec/lib/te3270/emulators/quick3270_spec.rb b/spec/lib/te3270/emulators/quick3270_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/te3270/emulators/quick3270_spec.rb +++ b/spec/lib/te3270/emulators/quick3270_spec.rb @@ -46,5 +46,14 @@ describe TE3270::Emulators::Quick3270 do quick_session.should_receive(:Connect) quick.connect end + + it 'should disconnect from a session' do + application = double('application') + quick_session.should_receive(:Disconnect) + quick_system.should_receive(:Application).and_return(application) + application.should_receive(:Quit) + quick.connect + quick.disconnect + end end end \ No newline at end of file
added disconnect method to quick<I>
cheezy_te3270
train
rb,rb
5e779d1768dd8028e2a953eb171a91c2e1efb208
diff --git a/lib/debug.js b/lib/debug.js index <HASH>..<HASH> 100644 --- a/lib/debug.js +++ b/lib/debug.js @@ -36,6 +36,14 @@ var colors = [6, 2, 3, 4, 5, 1]; var prevColor = 0; /** + * Is stderr a TTY? Colored output is disabled when `true`. + */ + +var isTTY = 'isTTY' in process.stderr + ? process.stderr.isTTY + : process.binding('stdio').isatty(process.stderr.fd || 2) + +/** * Select a color. * * @return {Number} @@ -57,8 +65,13 @@ function color() { function debug(name) { if (!~names.indexOf(name)) return function(){}; var c = color(); - return function(fmt){ + return isTTY ? + function(fmt){ fmt = ' \033[3' + c + 'm' + name + '\033[90m ' + fmt + '\033[0m'; console.error.apply(this, arguments); + } : + function(fmt){ + fmt = ' ' + name + ' ' + fmt; + console.error.apply(this, arguments); } -} \ No newline at end of file +}
Don't output colors when stderr is *not* a TTY.
visionmedia_debug
train
js
20f51c62eef71dd81836e6dc5c3e77cca2e800e2
diff --git a/lib/tumblr.rb b/lib/tumblr.rb index <HASH>..<HASH> 100644 --- a/lib/tumblr.rb +++ b/lib/tumblr.rb @@ -42,6 +42,14 @@ class Tumblr Authenticator.new(@credentials[:email],@credentials[:password]).authenticate(params) end + def pages(username) + reader.pages(username) + end + + def all_pages(username) + reader.all_pages(username) + end + def reader if @credentials.blank? Reader.new
Tumblr convenience methods for Reader#pages and all_pages
mwunsch_tumblr
train
rb
ca28716cab5c5d6cead98a34de16e15514e7537a
diff --git a/compliance_checker/cf/cf_1_6.py b/compliance_checker/cf/cf_1_6.py index <HASH>..<HASH> 100644 --- a/compliance_checker/cf/cf_1_6.py +++ b/compliance_checker/cf/cf_1_6.py @@ -146,7 +146,8 @@ class CF1_6Check(CFNCCheck): att.dtype == variable.dtype ) or ( # will short-circuit or if first condition is true isinstance(att, (np.float, np.double, float)) - and variable.dtype in (np.byte, np.short, np.int, int)) + and variable.dtype in (np.byte, np.short, np.int16, np.int, + int)) if not val: msgs.append(error_msg)
Add int<I> in addition to short for scale_factor/add_offset comparison
ioos_compliance-checker
train
py
0a93cfbd9dba74e44570857ab9ef215993060f64
diff --git a/src/Exceptions.php b/src/Exceptions.php index <HASH>..<HASH> 100644 --- a/src/Exceptions.php +++ b/src/Exceptions.php @@ -93,7 +93,7 @@ class Exceptions { if (self::$depth === null) { self::$depth = 0; - self::$fatalErrorHandlers = array(); + self::$fatalErrorHandlers = []; register_shutdown_function(__CLASS__ . '::fatalErrorHandler'); } }
Adopted the PHP <I> short array syntax
spencer-mortensen_exceptions
train
php
49b173166f1eeb3cf076819d19fd00fc1b8d20ed
diff --git a/Tone/source/OscillatorNode.js b/Tone/source/OscillatorNode.js index <HASH>..<HASH> 100644 --- a/Tone/source/OscillatorNode.js +++ b/Tone/source/OscillatorNode.js @@ -3,7 +3,8 @@ define(["Tone/core/Tone", "Tone/core/Buffer", "Tone/source/Source", "Tone/core/G /** * @class Wrapper around the native fire-and-forget OscillatorNode. Adds the - * ability to reschedule the stop method. + * ability to reschedule the stop method. ***[Tone.Oscillator](Oscillator) is better + * for most use-cases*** * @extends {Tone.AudioNode} * @param {AudioBuffer|Tone.Buffer} buffer The buffer to play * @param {Function} onload The callback to invoke when the
noting that Oscillator is better for most cases
Tonejs_Tone.js
train
js