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
280c09415ea8114d8a128cd7c2583ae0e0aa480d
diff --git a/app/models/agents/imap_folder_agent.rb b/app/models/agents/imap_folder_agent.rb index <HASH>..<HASH> 100644 --- a/app/models/agents/imap_folder_agent.rb +++ b/app/models/agents/imap_folder_agent.rb @@ -302,9 +302,10 @@ module Agents def each_unread_mail host, port, ssl, username = interpolated.values_at(:host, :port, :ssl, :username) ssl = boolify(ssl) + port = (Integer(port) if port.present?) log "Connecting to #{host}#{':%d' % port if port}#{' via SSL' if ssl}" - Client.open(host, Integer(port), ssl) { |imap| + Client.open(host, port, ssl) { |imap| log "Logging in as #{username}" imap.login(username, interpolated[:password])
ImapFolderAgent: Do not fail when port is blank.
huginn_huginn
train
rb
13b73de505e7ea14db1023a3a40175ad72a5dbe0
diff --git a/src/Config/FastRoute.php b/src/Config/FastRoute.php index <HASH>..<HASH> 100644 --- a/src/Config/FastRoute.php +++ b/src/Config/FastRoute.php @@ -11,6 +11,7 @@ class FastRoute extends SingleValueDirectiveGroup const POST = 2; const PUT = 4; const DELETE = 8; + const RESTFUL = self::GET | self::POST | self::PUT | self::DELETE; /** * FastRoute constructor.
Add RESTFUL const to ease restful routes declaration
objective-php_fastroute-package
train
php
007406fcd250b7740f9a8dff9fc8664dca7f3298
diff --git a/src/LiveDevelopment/Agents/RemoteFunctions.js b/src/LiveDevelopment/Agents/RemoteFunctions.js index <HASH>..<HASH> 100644 --- a/src/LiveDevelopment/Agents/RemoteFunctions.js +++ b/src/LiveDevelopment/Agents/RemoteFunctions.js @@ -217,8 +217,8 @@ function RemoteFunctions(experimental) { highlight.style.setProperty("z-index", 2000000); highlight.style.setProperty("position", "absolute"); highlight.style.setProperty("pointer-events", "none"); - highlight.style.setProperty("background", "rgba(94,167,255, 0.2)"); - highlight.style.setProperty("box-shadow", "0 0 4px 2px rgba(94,167,255, 0.5)"); + highlight.style.setProperty("background","rgba(94,167,255, 0.1)"); + highlight.style.setProperty("box-shadow", "0 0 8px 2px rgba(94,167,255, 0.3), inset 0 0 4px 1px rgba(255,255,255,0.6)"); highlight.style.setProperty("border-top-left-radius", styles.borderTopLeftRadius); highlight.style.setProperty("border-top-right-radius", styles.borderTopRightRadius); highlight.style.setProperty("border-bottom-left-radius", styles.borderBottomLeftRadius);
Added light inset shadow for visibility on dark backgrounds, toned back some of the colors in general
adobe_brackets
train
js
f59e306ec177a48ed6263e9d1df7dd6f137a3c0a
diff --git a/niworkflows/utils/spaces.py b/niworkflows/utils/spaces.py index <HASH>..<HASH> 100644 --- a/niworkflows/utils/spaces.py +++ b/niworkflows/utils/spaces.py @@ -667,6 +667,9 @@ class OutputReferencesAction(argparse.Action): and ":resolution-" not in val ): # by default, explicitly set volumetric resolution to native + # relevant discussions: + # https://github.com/nipreps/niworkflows/pull/457#discussion_r375510227 + # https://github.com/nipreps/niworkflows/pull/494 val = ":".join((val, "res-native")) for sp in Reference.from_string(val): spaces.add(sp)
doc: insert urls to discussions [skip ci]
poldracklab_niworkflows
train
py
066ba919ad026b22e1701a7d079c3e58686d57da
diff --git a/lib/database_cleaner.rb b/lib/database_cleaner.rb index <HASH>..<HASH> 100644 --- a/lib/database_cleaner.rb +++ b/lib/database_cleaner.rb @@ -1,6 +1,3 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__))) require 'database_cleaner/configuration' -def DatabaseCleaner(*args) - DatabaseCleaner.create_strategy(*args) -end diff --git a/spec/database_cleaner/configuration_spec.rb b/spec/database_cleaner/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/database_cleaner/configuration_spec.rb +++ b/spec/database_cleaner/configuration_spec.rb @@ -21,10 +21,10 @@ describe DatabaseCleaner do DatabaseCleaner.orm = nil end - describe ".create_strategy ( DatabaseCleaner() )" do + describe ".create_strategy" do it "should initialize and return the appropirate strategy" do DatabaseCleaner::ActiveRecord::Transaction.should_receive(:new).with('options' => 'hash') - result = DatabaseCleaner(:transaction, {'options' => 'hash'}) + result = DatabaseCleaner.create_strategy(:transaction, {'options' => 'hash'}) result.should == @strategy end
DatabaseCleaner() method was cool, but really isn't needed...
DatabaseCleaner_database_cleaner
train
rb,rb
3da849a862241a4221e850f7ca4481e7d85f6016
diff --git a/src/Theme/HookManager.php b/src/Theme/HookManager.php index <HASH>..<HASH> 100644 --- a/src/Theme/HookManager.php +++ b/src/Theme/HookManager.php @@ -119,11 +119,10 @@ class HookManager } if (!array_key_exists($classarg, $this->instances)) { - if ($classarg instanceof WpBridgeAwareInterface) { - $class = new $classarg; + $class = new $classarg; + + if ($class instanceof WpBridgeAwareInterface) { $class->setWpBridge($this->getWpBridge()); - } else { - $class = new $classarg; } $this->instances[$classarg] = $class;
Added support for WpBridgeAwareInterface in HookManger.
gwa_zero-library
train
php
7c14d4fb31c66620d24260c1e8748269af1222b5
diff --git a/src/interface/button.js b/src/interface/button.js index <HASH>..<HASH> 100644 --- a/src/interface/button.js +++ b/src/interface/button.js @@ -52,6 +52,8 @@ export const destroyAll = { export function setup() { setupLogger(); + getButtonsComponent(); + getCheckoutComponent(); } export function destroy() {
Register button and checkout components in setup step
paypal_paypal-checkout-components
train
js
18fbd77aebedebcf78bec008528418249a2fc2a3
diff --git a/src/main/java/org/lmdbjava/ByteBufferProxy.java b/src/main/java/org/lmdbjava/ByteBufferProxy.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/lmdbjava/ByteBufferProxy.java +++ b/src/main/java/org/lmdbjava/ByteBufferProxy.java @@ -133,7 +133,7 @@ public final class ByteBufferProxy { final int minWords = minLength / Long.BYTES; final boolean reverse1 = o1.order() == LITTLE_ENDIAN; - final boolean reverse2 = o1.order() == LITTLE_ENDIAN; + final boolean reverse2 = o2.order() == LITTLE_ENDIAN; for (int i = 0; i < minWords * Long.BYTES; i += Long.BYTES) { final long lw = reverse1 ? reverseBytes(o1.getLong(i)) : o1.getLong(i); final long rw = reverse2 ? reverseBytes(o2.getLong(i)) : o2.getLong(i);
fix a typo in ByteBufferProxy (#<I>)
lmdbjava_lmdbjava
train
java
15b904cbb5ce41343623f2b43303aa166f406b8c
diff --git a/support/mocha-blanket.js b/support/mocha-blanket.js index <HASH>..<HASH> 100755 --- a/support/mocha-blanket.js +++ b/support/mocha-blanket.js @@ -59,9 +59,9 @@ }); //I dont know why these became global leaks - runner.globals(['stats', 'failures', 'runner']); + runner.globals(['stats', 'failures', 'runner', '_$blanket']); - originalReporter(runner); + originalReporter.apply(this, [runner]); }; // From mocha.js HTML reporter
call originalReporter with correct "this"
GruntBlanketMocha_grunt-blanket-mocha
train
js
196110e86cc3fe4d2ea9d3af52adb78d4db7c632
diff --git a/framework/directives/scrollable.js b/framework/directives/scrollable.js index <HASH>..<HASH> 100644 --- a/framework/directives/scrollable.js +++ b/framework/directives/scrollable.js @@ -38,7 +38,7 @@ limitations under the License. scrollWrapper = element[0]; - var offset = parseInt(attrs.threshold) || 0; + var offset = parseInt(attrs.threshold) || 10; scrollWrapper.addEventListener('scroll', function() { if (scope.infinitScrollEnable) {
make infinit scroll threshold more sensitive
OnsenUI_OnsenUI
train
js
35ecc097ff8677a9990a49876520fe32094d8d80
diff --git a/climb/config.py b/climb/config.py index <HASH>..<HASH> 100644 --- a/climb/config.py +++ b/climb/config.py @@ -17,9 +17,23 @@ def load_config(name): paths = [path.format(name=name) for path in DEFAULT_CONFIG_PATHS] for config_path in paths: - config_path = os.path.expanduser(config_path) - if os.path.isfile(config_path) and os.access(config_path, os.R_OK): - config.read(config_path) + if _read_config(config_path): break else: raise ConfigNotFound("Could not find {name}.conf".format(name)) + + +def load_config_file(path): + config.clear() + + if not _read_config(path): + raise ConfigNotFound("Could not load {}".format(path)) + + +def _read_config(path): + config_path = os.path.expanduser(path) + if os.path.isfile(config_path) and os.access(config_path, os.R_OK): + config.read(config_path) + return True + else: + return False
Add method for direct config loading.
m110_climb
train
py
c908a3f2d7ea8e28abaeb7207750f688a7ca23dc
diff --git a/lib/hamlit/doctype_compiler.rb b/lib/hamlit/doctype_compiler.rb index <HASH>..<HASH> 100644 --- a/lib/hamlit/doctype_compiler.rb +++ b/lib/hamlit/doctype_compiler.rb @@ -3,26 +3,37 @@ require 'hamlit/filter' module Hamlit class DoctypeCompiler < Hamlit::Filter def on_haml_doctype(format, type) - case type - when 'XML' - return [:static, "<?xml version='1.0' encoding='utf-8' ?>"] + if type == 'XML' + return xml_doctype_tag(format) + elsif type + return doctype_tag(type) end - [:html, :doctype, convert_format(format, type).to_s] + case format + when :html4 + doctype_tag(:transitional) + when :html5 + doctype_tag(:html) + when :xhtml + doctype_tag(:transitional) + else + doctype_tag(format) + end end private - def convert_format(format, type) + def xml_doctype_tag(format) case format when :html4, :html5 - :html - when :xhtml - return type if type - :transitional + [:newline] else - format + [:static, "<?xml version='1.0' encoding='utf-8' ?>"] end end + + def doctype_tag(type) + [:html, :doctype, type.to_s] + end end end
Pass doctype haml-spec
haml_haml
train
rb
44e517454ddcdf910952c5689b462967e22fdb75
diff --git a/modules/timestamp.js b/modules/timestamp.js index <HASH>..<HASH> 100644 --- a/modules/timestamp.js +++ b/modules/timestamp.js @@ -7,12 +7,12 @@ function updateTimestampEl(el) { } setInterval(function () { - var els = [].slice.call(document.querySelectorAll('.timestamp')) + var els = [].slice.call(document.querySelectorAll('.pw__timestamp')) els.forEach(updateTimestampEl) }, 60e3) exports.message_main_meta = function (msg) { - return updateTimestampEl(h('a.enter.timestamp', { + return updateTimestampEl(h('a.enter.pw__timestamp', { href: '#'+msg.key, timestamp: msg.value.timestamp, title: new Date(msg.value.timestamp)
stop patchbay timestamps from conflicting with patchwork-next ones (hack)
ssbc_patchwork
train
js
fea6192c9eb80ff98a3b9118989d29865ae46d78
diff --git a/client/src/main/java/io/pravega/client/stream/impl/ControllerResolverFactory.java b/client/src/main/java/io/pravega/client/stream/impl/ControllerResolverFactory.java index <HASH>..<HASH> 100644 --- a/client/src/main/java/io/pravega/client/stream/impl/ControllerResolverFactory.java +++ b/client/src/main/java/io/pravega/client/stream/impl/ControllerResolverFactory.java @@ -188,7 +188,9 @@ public class ControllerResolverFactory extends NameResolver.Factory { public void shutdown() { if (!shutdown) { log.info("Shutting down ControllerNameResolver"); - this.scheduledExecutor.shutdownNow(); + if (this.scheduledExecutor != null) { + this.scheduledExecutor.shutdownNow(); + } shutdown = true; } }
Issue <I>: NPE during shutdown of ControllerNameResolver (#<I>) * Checks for null before ControllerNameResolver#shutdown.
pravega_pravega
train
java
c989bf0843cea51068b3a7b3aa3b4113be00ca8d
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -57,7 +57,7 @@ function cftemplate( // Format markup for insertion at the current position. function format(form) { return formToMarkup(form) - // split lines + // Split lines. .split('\n') .map(function(line, index) { return ( @@ -163,7 +163,13 @@ function cftemplate( key = directive.substring(7) if (!context.hasOwnProperty(key) || !context[key]) { stringify(token.content, context, handler, callback) } - else { callback(null, '') } } }, + else { callback(null, '') } } + + else { + callback( + addPosition( + new Error(), + ( 'Invalid directive ' + directive ))) } }, // Plaintemplate directive tokens. { open: '((', close: '))', start: 'begin', end: 'end' })
Call back with an error for unrecognized directives
commonform_cftemplate
train
js
783f116fb388cb5832824407f59907b7a6ea9ec6
diff --git a/pkg/codegen/dotnet/gen.go b/pkg/codegen/dotnet/gen.go index <HASH>..<HASH> 100644 --- a/pkg/codegen/dotnet/gen.go +++ b/pkg/codegen/dotnet/gen.go @@ -105,6 +105,9 @@ func isImmutableArrayType(t schema.Type, wrapInput bool) bool { } func isValueType(t schema.Type) bool { + if _, ok := t.(*schema.EnumType); ok { + return true + } switch t { case schema.BoolType, schema.IntType, schema.NumberType: return true
[codegen/dotnet] - Fix isValueType to include enums (#<I>)
pulumi_pulumi
train
go
265c76db59bab0e546fbced08598d62d80e13188
diff --git a/core/src/main/java/com/google/bitcoin/core/Transaction.java b/core/src/main/java/com/google/bitcoin/core/Transaction.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/bitcoin/core/Transaction.java +++ b/core/src/main/java/com/google/bitcoin/core/Transaction.java @@ -491,6 +491,10 @@ public class Transaction extends ChildMessage implements Serializable { s.append(" "); s.append(getHashAsString()); s.append("\n"); + if (inputs.size() == 0) { + s.append(" INCOMPLETE: No inputs!\n"); + return s.toString(); + } if (isCoinBase()) { String script; String script2;
Don't crash if trying to print a transaction with no inputs
bitcoinj_bitcoinj
train
java
fa0d14166d2a8cd8b9eaf44d923d1978b0e35a11
diff --git a/lib/amee-data-abstraction/calculation.rb b/lib/amee-data-abstraction/calculation.rb index <HASH>..<HASH> 100644 --- a/lib/amee-data-abstraction/calculation.rb +++ b/lib/amee-data-abstraction/calculation.rb @@ -130,6 +130,7 @@ module AMEE def discover_url "http://discover.amee.com/categories#{path}" end + def explorer_url Rails.logger.info "#explorer_url method deprecated. Use #discover_url" if defined? Rails
change explorer_url mathod to discvoer
AMEE_amee-data-abstraction
train
rb
acdde576d0b2fed464243f2209fd2b11dcad65aa
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -37,12 +37,13 @@ Deployor.defaults = { Deployor.verbose = false; +sh.config.silent = !Deployor.verbose; var e = Deployor.exec = function (cmd) { if (Deployor.verbose) { console.log('$ ', cmd); } - return sh.exec(cmd + Deployor.verbose ? '' : ' &> /dev/null'); + return sh.exec(cmd); }; Deployor.cloneRepoBranch = function cloneRepoBranch(options) { @@ -131,7 +132,7 @@ Deployor.prototype = { if (res && res.code > 0) console.log('Can\'t tag failed, continuing !'); }, push: function () { - var res = e('git push --tags origin $BRANCH' + Deployor.verbose ? '' : ' &> /dev/null'); + var res = e('git push --tags origin $BRANCH'); if (res && res.code > 0) throw new Error(res.output); } };
feat(deploy): silent with shelljs.config
douglasduteil_node-git-deployor
train
js
9533b02a8ebfc912130843826901a7090932cd87
diff --git a/fseval_test.go b/fseval_test.go index <HASH>..<HASH> 100644 --- a/fseval_test.go +++ b/fseval_test.go @@ -1,6 +1,7 @@ package mtree import ( + "encoding/json" "io/ioutil" "os" "path/filepath" @@ -8,7 +9,7 @@ import ( "time" ) -var mockTime = time.Unix(1337888823, 88288518233) +var mockTime = time.Unix(1337888823, 0) // Here be some dodgy testing. In particular, we have to mess around with some // of the FsEval functions. In particular, we change all of the FileInfos to a @@ -155,6 +156,11 @@ func TestCheckFsEval(t *testing.T) { t.Fatal(err) } if len(res) > 0 { - t.Errorf("%#v", res) + buf, err := json.MarshalIndent(res, "", " ") + if err != nil { + t.Errorf("%#v", res) + } else { + t.Errorf("%s", buf) + } } }
fseval: not nanosecond for mock test while testing on osx, it seems that it doesn't support nanoseconds so it fails this check because the mockFsEval returns the nsec precision, but the actual expected results is: "old": "<I>" "new": "<I>" Ideally there will be a way to detect when the fs supports nsecs
vbatts_go-mtree
train
go
955c2206437642333366fb92031f4e64388c49be
diff --git a/parsl/dataflow/dflow.py b/parsl/dataflow/dflow.py index <HASH>..<HASH> 100644 --- a/parsl/dataflow/dflow.py +++ b/parsl/dataflow/dflow.py @@ -61,10 +61,13 @@ class DataFlowKernel(object): Returns: DataFlowKernel object """ - self.config = {"sites" : [], - "globals" : {}, - "controller" : {}} - self.config.update(config) + if config: + self.config = {"sites" : [], + "globals" : {}, + "controller" : {}} + self.config.update(config) + else: + self.config = config # Create run dirs for this run self.rundir = make_rundir(config=self.config, path=rundir)
Fixing issue with cases with no config
Parsl_parsl
train
py
920d393ae5d9c13acf7d845072e7ce2cf50a9ae4
diff --git a/fault/tester.py b/fault/tester.py index <HASH>..<HASH> 100644 --- a/fault/tester.py +++ b/fault/tester.py @@ -68,7 +68,7 @@ class Tester: self.clock = clock if reset is not None and not isinstance(reset, m.ResetType): raise TypeError(f"Expected reset port: {reset, type(reset)}") - self.reset = reset + self.reset_port = reset self.targets = {} # For public verilator modules self.verilator_includes = [] @@ -387,14 +387,14 @@ class Tester: def sync_reset(self, active_high=True, cycles=1): # assert reset and set clock to zero - self.poke(self.reset, 1 if active_high else 0) + self.poke(self.reset_port, 1 if active_high else 0) self.poke(self.clock, 0) # wait the desired number of clock cycles self.step(2 * cycles) # de-assert reset - self.poke(self.reset, 0 if active_high else 1) + self.poke(self.reset_port, 0 if active_high else 1) class LoopIndex:
rename reset variable to avoid conflict
leonardt_fault
train
py
0ec8ceae4fda740c6a3d990636491f6df0008728
diff --git a/samples/system-test/sample.test.js b/samples/system-test/sample.test.js index <HASH>..<HASH> 100644 --- a/samples/system-test/sample.test.js +++ b/samples/system-test/sample.test.js @@ -16,7 +16,9 @@ 'use strict'; const {assert} = require('chai'); -const {execSync} = require('child_process'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); describe('container samples', () => { it('should run the quickstart', async () => {
refactor: wrap execSync with encoding: utf-8 (#<I>)
googleapis_nodejs-cloud-container
train
js
81dc697914c1bf0d0be9f70e4807fcdfc4209250
diff --git a/pages/app/presenters/refinery/pages/title_section_presenter.rb b/pages/app/presenters/refinery/pages/title_section_presenter.rb index <HASH>..<HASH> 100644 --- a/pages/app/presenters/refinery/pages/title_section_presenter.rb +++ b/pages/app/presenters/refinery/pages/title_section_presenter.rb @@ -4,6 +4,8 @@ module Refinery # a title. These are much like normal sections except they are wrapped in # a h1 tag rather than a div. class TitleSectionPresenter < SectionPresenter + include ActionView::Helpers::SanitizeHelper + private def wrap_content_in_tag(content)
Add SanitizeHelper to TitleSectionPresenter
refinery_refinerycms
train
rb
c328f3b9723c78201211c89735592b281c147f0f
diff --git a/crawler/crawling/pipelines.py b/crawler/crawling/pipelines.py index <HASH>..<HASH> 100644 --- a/crawler/crawling/pipelines.py +++ b/crawler/crawling/pipelines.py @@ -59,7 +59,7 @@ class LoggingBeforePipeline(object): item_copy['action'] = 'emit' self.logger.info('Scraped page', extra=item_copy) return item - elif isinstance(item, ErrorResponseItem): + elif isinstance(item): item['logger'] = self.logger.name() self.logger.error('Scraper Retry', extra=item) return None
ErrorResponseItem no longer needed
istresearch_scrapy-cluster
train
py
21966f5257efbd397b12594e0fd9d3442ac42924
diff --git a/lib/discordrb/webhooks/client.rb b/lib/discordrb/webhooks/client.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/webhooks/client.rb +++ b/lib/discordrb/webhooks/client.rb @@ -8,6 +8,11 @@ module Discordrb::Webhooks # @param token [String] The webhook's authorisation token. Will only be used # if `url` is not set. def initialize(url: nil, id: nil, token: nil) + @url = if url + url + else + generate_url(id, token) + end end private
:anchor: Use generate_url to obtain a URL if none is given
meew0_discordrb
train
rb
7a970c9c871e4c5eefd2230662b2f72774da78a8
diff --git a/lib/instana/instrumentation/rack.rb b/lib/instana/instrumentation/rack.rb index <HASH>..<HASH> 100644 --- a/lib/instana/instrumentation/rack.rb +++ b/lib/instana/instrumentation/rack.rb @@ -5,11 +5,19 @@ module Instana end def call(env) - req = ::Rack::Request.new(env) kvs = { :http => {} } - kvs[:http][:method] = req.request_method - kvs[:http][:url] = ::CGI.unescape(req.path) - ::Instana.tracer.log_start_or_continue(:rack) + kvs[:http][:method] = env['REQUEST_METHOD'] + kvs[:http][:url] = ::CGI.unescape(env['PATH_INFO']) + + # Check incoming context + incoming_context = {} + if env.key?('HTTP_X_INSTANA_T') + incoming_context[:trace_id] = env['HTTP_X_INSTANA_T'] + incoming_context[:parent_id] = env['HTTP_X_INSTANA_S'] if env.key?('HTTP_X_INSTANA_S') + incoming_context[:level] = env['HTTP_X_INSTANA_L'] if env.key?('HTTP_X_INSTANA_L') + end + + ::Instana.tracer.log_start_or_continue(:rack, {}, incoming_context) status, headers, response = @app.call(env)
Pickup incoming context from HTTP headers.
instana_ruby-sensor
train
rb
4319254afb7b53e4f063767c5fec8c9a61f6fea7
diff --git a/pydevd_concurrency_analyser/pydevd_concurrency_logger.py b/pydevd_concurrency_analyser/pydevd_concurrency_logger.py index <HASH>..<HASH> 100644 --- a/pydevd_concurrency_analyser/pydevd_concurrency_logger.py +++ b/pydevd_concurrency_analyser/pydevd_concurrency_logger.py @@ -1,4 +1,3 @@ -import time from pydevd_concurrency_analyser.pydevd_thread_wrappers import ObjectWrapper, wrap_attr import pydevd_file_utils
Fix ImportError after refactoring (PY-<I>) (cherry picked from commit <I>d0f)
fabioz_PyDev.Debugger
train
py
94448d3972569d124da77e9eddc7e5569140d133
diff --git a/discord/http.py b/discord/http.py index <HASH>..<HASH> 100644 --- a/discord/http.py +++ b/discord/http.py @@ -463,7 +463,7 @@ class HTTPClient: def edit_member(self, guild_id, user_id, **fields): r = Route('PATCH', '/guilds/{guild_id}/members/{user_id}', guild_id=guild_id, user_id=user_id) - return self.request(r, json=fields, bucket=bucket) + return self.request(r, json=fields) # Channel management
Fix NameError inside HTTPClient.edit_member.
Rapptz_discord.py
train
py
db02545ef32b309a01fd465422226ca8c517c4e4
diff --git a/lib/db/schemaupdater.go b/lib/db/schemaupdater.go index <HASH>..<HASH> 100644 --- a/lib/db/schemaupdater.go +++ b/lib/db/schemaupdater.go @@ -452,7 +452,16 @@ func (db *schemaUpdater) updateSchemato9(prev int) error { metas := make(map[string]*metadataTracker) for it.Next() { intf, err := t.unmarshalTrunc(it.Value(), false) - if err != nil { + if backend.IsNotFound(err) { + // Unmarshal error due to missing parts (block list), probably + // due to a bad migration in a previous RC. Drop this key, as + // getFile would anyway return this as a "not found" in the + // normal flow of things. + if err := t.Delete(it.Key()); err != nil { + return err + } + continue + } else if err != nil { return err } fi := intf.(protocol.FileInfo)
lib/db: Be more lenient during migration (fixes #<I>) (#<I>)
syncthing_syncthing
train
go
2d5c91210c75bddb8a9ab064714de1151f442505
diff --git a/Configuration/TCA/tx_happyfeet_domain_model_footnote.php b/Configuration/TCA/tx_happyfeet_domain_model_footnote.php index <HASH>..<HASH> 100644 --- a/Configuration/TCA/tx_happyfeet_domain_model_footnote.php +++ b/Configuration/TCA/tx_happyfeet_domain_model_footnote.php @@ -34,6 +34,7 @@ return array( 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.language', 'config' => array( 'type' => 'select', + 'renderType' => 'selectSingle', 'foreign_table' => 'sys_language', 'foreign_table_where' => 'ORDER BY sys_language.title', 'items' => array( @@ -48,6 +49,7 @@ return array( 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent', 'config' => array( 'type' => 'select', + 'renderType' => 'selectSingle', 'items' => array( array('', 0), ),
[TASK] Upadte TCA configuration Add "renderType" configuration to "select" fields.
AOEpeople_happy_feet
train
php
69f596c4c1aea41dc7a05b5417b35f66193ad1db
diff --git a/src/test/java/guru/qas/martini/DefaultMixologistTest.java b/src/test/java/guru/qas/martini/DefaultMixologistTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/guru/qas/martini/DefaultMixologistTest.java +++ b/src/test/java/guru/qas/martini/DefaultMixologistTest.java @@ -65,7 +65,7 @@ public class DefaultMixologistTest { String expected = "Feature: Functionality of the Reporting Subsystem\n" + "Resource: " + path + "\n" + "Scenario: A Corner Case\n" + - "Line: 10"; + "Line: 25"; assertEquals(toString, expected, "wrong information returned through toString()"); }
Fixing failing tests due to line number change occurring with addition of license comments to test resource file.
qas-guru_martini-core
train
java
79aa9b546d11b9a1d5df0d66014a3fd6b085f918
diff --git a/lib/celluloid/version.rb b/lib/celluloid/version.rb index <HASH>..<HASH> 100644 --- a/lib/celluloid/version.rb +++ b/lib/celluloid/version.rb @@ -1,3 +1,3 @@ module Celluloid - VERSION = '0.17.0.pre4' + VERSION = '0.17.0.pre5' end
push another prerelease until this situtation is figured out so we can just use raw repositories again
celluloid_celluloid
train
rb
9c22fc33121d4b4fdd6ae6decd366b31a901b0e4
diff --git a/ehforwarderbot/__version__.py b/ehforwarderbot/__version__.py index <HASH>..<HASH> 100644 --- a/ehforwarderbot/__version__.py +++ b/ehforwarderbot/__version__.py @@ -1,3 +1,3 @@ # coding=utf-8 -__version__ = "2.0.1.dev1" +__version__ = "2.0.0"
fix: revert version number bump
blueset_ehForwarderBot
train
py
70d2fc8d3f97bce4f2b540600f410fc207dc5c13
diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index <HASH>..<HASH> 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -43,7 +43,8 @@ class Git < Output update type_repo, file, type_cfg unless type_cfg.empty? end - update repo, file, outputs.to_cfg + output = outputs.to_cfg + update repo, file, output unless output.empty? end
don't commit empty config in git output
ytti_oxidized
train
rb
cc539a71dcfd6777fa75f8de5c3ef4fcae59e954
diff --git a/framework/core/js/src/forum/components/Post.js b/framework/core/js/src/forum/components/Post.js index <HASH>..<HASH> 100644 --- a/framework/core/js/src/forum/components/Post.js +++ b/framework/core/js/src/forum/components/Post.js @@ -120,7 +120,7 @@ export default class Post extends Component { /** * Get the post's classes. * - * @param string classes + * @param existing string * @returns {string[]} */ classes(existing) { @@ -137,7 +137,7 @@ export default class Post extends Component { classes.push('Post--by-actor'); } - if (user && user === discussion.user()) { + if (user && user.id() === discussion.attribute('startUserId')) { classes.push('Post--by-start-user'); }
fix: `Post--by-actor` not showing when comparing user instances as `discussion.user()` is not loaded (#<I>)
flarum_core
train
js
025b94c7814b8461d75d0a02ca60af79e4e82b1a
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -19,12 +19,14 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Finder\Finder; use Throwable; use TJM\Component\Console\DependencyInjection\ConsoleExtension; use TJM\Component\DependencyInjection\Loader\MultiPathLoader; class Application extends Base implements ContainerAwareInterface{ + protected $dispatcher; public function __construct($config = null){ parent::__construct(); @@ -33,6 +35,11 @@ class Application extends Base implements ContainerAwareInterface{ } } + //--override to support use in `doRun` + public function setDispatcher(EventDispatcherInterface $dispatcher){ + $this->dispatcher = $dispatcher; + } + //--override to remove built in `-n` and `-q` short options protected function configureIO(InputInterface $input, OutputInterface $output){ //--determine decoration
fix: we must override dispatcher because it is private upstream
tobymackenzie_sy-console
train
php
9d4d96242f91cefd9d30067497aa1c84c895e136
diff --git a/app/models/alchemy/page/publisher.rb b/app/models/alchemy/page/publisher.rb index <HASH>..<HASH> 100644 --- a/app/models/alchemy/page/publisher.rb +++ b/app/models/alchemy/page/publisher.rb @@ -19,9 +19,11 @@ module Alchemy version = public_version(public_on) DeleteElements.new(version.elements).call - # We must not use .find_each here to not mess up the order of elements - page.draft_version.elements.not_nested.available.each do |element| - Element.copy(element, page_version_id: version.id) + repository = page.draft_version.element_repository + repository.visible.not_nested.each do |element| + Alchemy::DuplicateElement.new(element, repository: repository).call( + page_version_id: version.id, + ) end end end
Use page version element repo and duplicator in publisher This should speed up page publishing considerably. Specs are sufficient.
AlchemyCMS_alchemy_cms
train
rb
dd063adeac439edd828db5257d8bbcf40c529b28
diff --git a/models/classes/user/LtiUserService.php b/models/classes/user/LtiUserService.php index <HASH>..<HASH> 100755 --- a/models/classes/user/LtiUserService.php +++ b/models/classes/user/LtiUserService.php @@ -65,7 +65,7 @@ abstract class LtiUserService extends ConfigurableService */ public function findOrSpawnUser(LtiLaunchData $launchData) { - $lock = $this->createLock(__METHOD__ . $launchData->getUserID() . $launchData->getLtiConsumer(), 30); + $lock = $this->createLock(__METHOD__ . $launchData->getUserID() . $launchData->getLtiConsumer()->getUri(), 30); $lock->acquire(true); try {
Do not generate lock id based on label
oat-sa_extension-tao-lti
train
php
fa9e20e3af593d8906a1bd659338f488e9c02637
diff --git a/cluster/manager.go b/cluster/manager.go index <HASH>..<HASH> 100644 --- a/cluster/manager.go +++ b/cluster/manager.go @@ -1386,7 +1386,7 @@ func (c *ClusterManager) Enumerate() (api.Cluster, error) { config := api.FluentDConfig{} - if len(splits) > 0 { + if len(splits) > 1 { config.IP = splits[0] config.Port = splits[1] }
Fix potential panic - index out of range
libopenstorage_openstorage
train
go
b6cbbcbe0381881e25336acaa16f8e6122a91296
diff --git a/examples/cookie/main.go b/examples/cookie/main.go index <HASH>..<HASH> 100644 --- a/examples/cookie/main.go +++ b/examples/cookie/main.go @@ -72,8 +72,8 @@ func setcookies(host string, res *string) cdp.Tasks { return cdp.Tasks{ cdp.ActionFunc(func(ctxt context.Context, h cdptypes.Handler) error { expr := cdptypes.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour)) - success, err := network.SetCookie(host, "cookiename", "cookievalue"). - WithExpirationDate(&expr). + success, err := network.SetCookie("cookiename", "cookievalue"). + WithExpires(&expr). WithDomain("localhost"). WithHTTPOnly(true). Do(ctxt, h)
Updating cookie example for new changed API
chromedp_chromedp
train
go
25149791394d38e5b0411662bf85a2d764c61bed
diff --git a/carrot/backends/pyamqplib.py b/carrot/backends/pyamqplib.py index <HASH>..<HASH> 100644 --- a/carrot/backends/pyamqplib.py +++ b/carrot/backends/pyamqplib.py @@ -200,7 +200,7 @@ class Backend(BaseBackend): def close(self): """Close the channel if open.""" - if getattr(self, "channel") and self.channel.is_open: + if getattr(self, "_channel") and self.channel.is_open: self.channel.close() self._channel = None @@ -229,6 +229,7 @@ class Backend(BaseBackend): immediate=None): """Publish a message to a named exchange.""" return self.channel.basic_publish(message, exchange=exchange, - routing_key=routing_key, - mandatory=mandatory, - immediate=immediate) + routing_key=routing_key, + mandatory=mandatory, + immediate=immediate) +
pyamqplib backend close didn't work properly, typo channel -> _channel
ask_carrot
train
py
59d2df8590505760790c3be18ad314eb30c1b408
diff --git a/app/controllers/alchemy/admin/essence_pictures_controller.rb b/app/controllers/alchemy/admin/essence_pictures_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/alchemy/admin/essence_pictures_controller.rb +++ b/app/controllers/alchemy/admin/essence_pictures_controller.rb @@ -35,7 +35,7 @@ module Alchemy @essence_picture.update(essence_picture_params) end - # Assigns picture, but does not saves it. + # Assigns picture, but does not save it. # # When the user saves the element the content gets updated as well. # @@ -43,7 +43,6 @@ module Alchemy @picture = Picture.find_by(id: params[:picture_id]) @content.essence.picture = @picture @element = @content.element - @options = @options.merge(sortable: @options[:grouped]) # We need to update timestamp here because we don't save yet, # but the cache needs to be get invalid.
Remove superfluous options ivar from essence pictures controller The options ivar is already set by the before_action and we dont want to override the sortable option here, as it is already set in the params.
AlchemyCMS_alchemy_cms
train
rb
07d2866c975d032e3a784a9c4d055570fedd9930
diff --git a/lib/showdown.js b/lib/showdown.js index <HASH>..<HASH> 100644 --- a/lib/showdown.js +++ b/lib/showdown.js @@ -1026,6 +1026,8 @@ var _DoItalicsAndBold = function(text) { text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, "<strong>$2</strong>"); + text = text.replace(/(\w)_(\w)/g, "$1~E95E$2") // ** JT ** "~E95E" == escaped "_" + text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, "<em>$2</em>");
Another GFM thing: don't italicize a_b_c
brynbellomy_otis
train
js
192cd419e58bdf48b0dfc203e29ab89ef125191f
diff --git a/test/RoaveTest/DeveloperTools/Inspection/AggregateInspectionTest.php b/test/RoaveTest/DeveloperTools/Inspection/AggregateInspectionTest.php index <HASH>..<HASH> 100644 --- a/test/RoaveTest/DeveloperTools/Inspection/AggregateInspectionTest.php +++ b/test/RoaveTest/DeveloperTools/Inspection/AggregateInspectionTest.php @@ -20,6 +20,7 @@ namespace RoaveTest\DeveloperTools\Inspection; use ArrayObject; use Roave\DeveloperTools\Inspection\AggregateInspection; +use Roave\DeveloperTools\Inspection\InspectionInterface; use Roave\DeveloperTools\Inspection\TimeInspection; /** @@ -55,10 +56,10 @@ class AggregateInspectionTest extends AbstractInspectionTest */ public function testAllowsTraversableParameters() { - $timeInspection = new TimeInspection(123, 456); - $inspection = new AggregateInspection(new ArrayObject([$timeInspection])); + $mockInspection = $this->getMock(InspectionInterface::class); + $inspection = new AggregateInspection(new ArrayObject([$mockInspection])); - $this->assertEquals($timeInspection, $inspection->getInspectionData()[0]); + $this->assertEquals($mockInspection, $inspection->getInspectionData()[0]); } /**
Using mocks in inspection tests instead of concrede instances
Roave_RoaveDeveloperTools
train
php
e4bd860ddf47f5e38c0e9fb166267cbfd58eb030
diff --git a/lib/scientist/version.rb b/lib/scientist/version.rb index <HASH>..<HASH> 100644 --- a/lib/scientist/version.rb +++ b/lib/scientist/version.rb @@ -1,3 +1,3 @@ module Scientist - VERSION = "1.3.0" + VERSION = "1.4.0" end
Bump to <I> Incrementing minor version since MismatchException base class changes.
github_scientist
train
rb
935b5b19976ce09fab9c341247e60630df9dbd46
diff --git a/spec/tripod/predicates_spec.rb b/spec/tripod/predicates_spec.rb index <HASH>..<HASH> 100644 --- a/spec/tripod/predicates_spec.rb +++ b/spec/tripod/predicates_spec.rb @@ -23,6 +23,13 @@ describe Tripod::Predicates do stmt3.predicate = RDF::URI.new('http://name') stmt3.object = "ric" @graph << stmt3 + + # throw a random other statement (about name) in the mix! + stmt4 = RDF::Statement.new + stmt4.subject = RDF::URI.new('http://name') + stmt4.predicate = RDF::RDFS.label + stmt4.object = "name" + @graph << stmt4 end let(:person) do @@ -77,6 +84,8 @@ describe Tripod::Predicates do person.predicates.length.should == 2 person.predicates.should == [RDF::URI('http://blog'), RDF::URI('http://name')] end + + end end \ No newline at end of file
added test for predicates being polluted by other triples
Swirrl_tripod
train
rb
faa76977c193a422bec7c438ca35c34fc507b3d0
diff --git a/spring-cloud-bus/src/main/java/org/springframework/cloud/bus/BusEnvironmentPostProcessor.java b/spring-cloud-bus/src/main/java/org/springframework/cloud/bus/BusEnvironmentPostProcessor.java index <HASH>..<HASH> 100644 --- a/spring-cloud-bus/src/main/java/org/springframework/cloud/bus/BusEnvironmentPostProcessor.java +++ b/spring-cloud-bus/src/main/java/org/springframework/cloud/bus/BusEnvironmentPostProcessor.java @@ -46,6 +46,12 @@ public class BusEnvironmentPostProcessor implements EnvironmentPostProcessor { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { + if (environment.containsProperty(ConditionalOnBusEnabled.SPRING_CLOUD_BUS_ENABLED)) { + if (Boolean.FALSE.toString() + .equalsIgnoreCase(environment.getProperty(ConditionalOnBusEnabled.SPRING_CLOUD_BUS_ENABLED))) { + return; + } + } Map<String, Object> overrides = new HashMap<>(); String definition = BusConstants.BUS_CONSUMER; if (environment.containsProperty(FN_DEF_PROP)) {
Do not run post processor if bus is disabled
spring-cloud_spring-cloud-bus
train
java
c5f28dddf710ea5bbe1e61efec797b774b743d39
diff --git a/GPflow/tf_wraps.py b/GPflow/tf_wraps.py index <HASH>..<HASH> 100644 --- a/GPflow/tf_wraps.py +++ b/GPflow/tf_wraps.py @@ -25,7 +25,7 @@ from ._settings import settings import numpy as np -def eye(N): +def eye(N): # pragma: no cover """ An identitiy matrix """
removing deprecated functinos from coverage
GPflow_GPflow
train
py
a1a78850c9964d5aed38caa6817f8cd9a6a6b138
diff --git a/src/Node/File.php b/src/Node/File.php index <HASH>..<HASH> 100644 --- a/src/Node/File.php +++ b/src/Node/File.php @@ -26,7 +26,7 @@ class File implements FileInterface, GenericOperationInterface public function exists() { - return $this->filesystem->stat($this->filename); + return $this->stat(); } public function size()
Even making it simple and effectively degrading exists to a stat (maybe ditch exists all together?)
reactphp_filesystem
train
php
8e31fa8edb93b8235de4f62cf29675964d541bdb
diff --git a/src/armet/api.py b/src/armet/api.py index <HASH>..<HASH> 100755 --- a/src/armet/api.py +++ b/src/armet/api.py @@ -9,7 +9,12 @@ from django.conf.urls import patterns, url, include from armet import resources -class Api(resources.Resource, MutableSequence): +class DeclarativeApi(resources.DeclarativeResource, abc.ABCMeta): + pass + + +class Api(six.with_metaclass(DeclarativeApi, resources.Resource), + MutableSequence): """Implements an api registry used to make APIs visible. """
Fused the metaclasses.
armet_python-armet
train
py
f8f632198a1dc10a16c9160ec81ff905889c7722
diff --git a/lib/drafting/instance_methods.rb b/lib/drafting/instance_methods.rb index <HASH>..<HASH> 100644 --- a/lib/drafting/instance_methods.rb +++ b/lib/drafting/instance_methods.rb @@ -5,16 +5,7 @@ module Drafting draft = Draft.find_by_id(self.draft_id) || Draft.new - new_object = self.class.new - - attrs = self.attributes.select { |k,v| v != new_object.attributes[k] } - self.draft_extra_attributes.each do |name| - if (value = self.send(name)) != new_object.send(name) - attrs[name.to_s] = value - end - end - - draft.data = attrs + draft.data = attributes_to_store_for_draft draft.target_type = self.class.name draft.user = user draft.parent = self.send(self.class.draft_parent) if self.class.draft_parent @@ -38,5 +29,20 @@ module Drafting self.draft_id = nil if draft.destroy end end + + def attributes_to_store_for_draft + # First, select attributes with values different from default + new_object = self.class.new + attrs = self.attributes.select { |k,v| v != new_object.attributes[k] } + + # Second, add extra attributes with values different from default + self.draft_extra_attributes.each do |name| + if (value = self.send(name)) != new_object.send(name) + attrs[name.to_s] = value + end + end + + attrs + end end end
Refactor InstanceMethods (split method)
ledermann_drafting
train
rb
a8bc49c996934b0c31da7506bb855c0becce802d
diff --git a/src/Cookie/FileCookieJar.php b/src/Cookie/FileCookieJar.php index <HASH>..<HASH> 100644 --- a/src/Cookie/FileCookieJar.php +++ b/src/Cookie/FileCookieJar.php @@ -56,7 +56,7 @@ class FileCookieJar extends CookieJar } $jsonStr = \GuzzleHttp\json_encode($json); - if (false === file_put_contents($filename, $jsonStr)) { + if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) { throw new \RuntimeException("Unable to save file {$filename}"); } }
Prevent concurrent writes Concurrent writes might lead to invalid JSON being saved in the cookie jar.
guzzle_guzzle
train
php
41ba28ffb3f807c71634bc449f282e1b259a1c0a
diff --git a/src/select.js b/src/select.js index <HASH>..<HASH> 100644 --- a/src/select.js +++ b/src/select.js @@ -403,10 +403,12 @@ // ctrl.tagging pushes items to ctrl.items, so we only have empty val // for `item` if it is a detected duplicate if ( item === undefined ) return; + // create new item on the fly if we don't already have one; - // use tagging function if we have one, otherwise, push a string - if ( ctrl.tagging.fct !== undefined && item === undefined ) { + // use tagging function if we have one + if ( ctrl.tagging.fct !== undefined && typeof item === 'string' ) { item = ctrl.tagging.fct(ctrl.search); + // if item type is 'string', apply the tagging label } else if ( typeof item === 'string' ) { item = item.replace(ctrl.taggingLabel,''); }
make sure the tagging tranform function is called if available
angular-ui_ui-select
train
js
b0de3a16c4ef783c2941ebc4677472044019e525
diff --git a/test/fixtures/tasks/echo.js b/test/fixtures/tasks/echo.js index <HASH>..<HASH> 100644 --- a/test/fixtures/tasks/echo.js +++ b/test/fixtures/tasks/echo.js @@ -9,7 +9,7 @@ module.exports = function(grunt) { 'use strict'; grunt.registerMultiTask('echo', 'A task that echos a message.', function() { - var msg = this.data.message || 'I do absolutely nothing.'; - grunt.log.writeln(msg); + var msg = this.data.message || 'I do absolutely nothing.'; + grunt.log.writeln(msg); }); };
Fix indentation in echo task fixture
gruntjs_grunt-contrib-watch
train
js
db9817110809296d7abc5a857e53fdbe1d9800fe
diff --git a/clock/rfc822.go b/clock/rfc822.go index <HASH>..<HASH> 100644 --- a/clock/rfc822.go +++ b/clock/rfc822.go @@ -80,3 +80,7 @@ func (t *RFC822Time) UnmarshalJSON(s []byte) error { func (t RFC822Time) String() string { return t.Format(RFC1123) } + +func (t RFC822Time) StringWithOffset() string { + return t.Format(RFC1123Z) +} diff --git a/clock/rfc822_test.go b/clock/rfc822_test.go index <HASH>..<HASH> 100644 --- a/clock/rfc822_test.go +++ b/clock/rfc822_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "testing" + "time" "github.com/stretchr/testify/assert" ) @@ -162,3 +163,9 @@ func TestParseRFC822Time(t *testing.T) { }) } } + +func TestStringWithOffset(t *testing.T) { + now := time.Now().UTC() + r := NewRFC822Time(now) + assert.Equal(t, now.Format(time.RFC1123Z), r.StringWithOffset()) +}
add StringWithOffset method to RFC<I>Time struct
mailgun_holster
train
go,go
d5ec939022b5c8b46040dac10fff97d97db19511
diff --git a/plugins/commands/serve/service/provider_service.rb b/plugins/commands/serve/service/provider_service.rb index <HASH>..<HASH> 100644 --- a/plugins/commands/serve/service/provider_service.rb +++ b/plugins/commands/serve/service/provider_service.rb @@ -110,7 +110,7 @@ module VagrantPlugins def state_spec(*_) funcspec( args: [ - SDK::Args::Target::Machine + SDK::Args::Target ], result: SDK::Args::Target::Machine::State, )
Request target in spec and allow conversion to machine
hashicorp_vagrant
train
rb
4a2d7f00a9cdeb932f6b383a3f11bbd563fc9bfc
diff --git a/gomatic/go_cd_configurator.py b/gomatic/go_cd_configurator.py index <HASH>..<HASH> 100755 --- a/gomatic/go_cd_configurator.py +++ b/gomatic/go_cd_configurator.py @@ -291,7 +291,8 @@ class HostRestClient(object): return (self.__username, self.__password) if self.__username or self.__password else None def get(self, path): - result = requests.get(self.__path(path), auth=self.__auth(), verify=self.__verify_ssl) + header = {'Accept': 'application/vnd.go.cd.v1+json'} + result = requests.get(self.__path(path), auth=self.__auth(), verify=self.__verify_ssl, headers=header) count = 0 while ((result.status_code == 503) or (result.status_code == 504)) and (count < 5): result = requests.get(self.__path(path))
adding Accept header to allow reuse with API endpoints
gocd-contrib_gomatic
train
py
a769055698fbed67c44810d5af44316024fc2058
diff --git a/spec/lib/legato/query_spec.rb b/spec/lib/legato/query_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/legato/query_spec.rb +++ b/spec/lib/legato/query_spec.rb @@ -164,6 +164,14 @@ describe Legato::Query do @query.metrics.include?(:pageviews).should eq(true) @query.metrics.include?(:sessions).should eq(true) end + + it 'does not share metrics across queries' do + query1 = Legato::Query.new(@klass) + query2 = Legato::Query.new(@klass) + + query1.metrics << :pageviews + expect(query2.metrics).to_not include(:pageviews) + end end context 'when applying filters' do
add spec to check for sharing of metrics across query instances
tpitale_legato
train
rb
93fe5d5987549fc13c9fa0e8fe268bfa40024521
diff --git a/dosagelib/util.py b/dosagelib/util.py index <HASH>..<HASH> 100644 --- a/dosagelib/util.py +++ b/dosagelib/util.py @@ -305,7 +305,7 @@ def check_robotstxt(url, session): roboturl = get_roboturl(url) rp = get_robotstxt_parser(roboturl, session=session) if not rp.can_fetch(UserAgent, str(url)): - raise IOError("%s is disallowed by robots.txt" % url) + raise IOError("%s is disallowed by %s" % (url, roboturl)) @memoized @@ -329,10 +329,10 @@ def get_robotstxt_parser(url, session=None): def urlopen(url, session, referrer=None, max_content_bytes=None, timeout=ConnectionTimeoutSecs, raise_for_status=True, - stream=False, data=None): + stream=False, data=None, useragent=UserAgent): """Open an URL and return the response object.""" out.debug(u'Open URL %s' % url) - headers = {'User-Agent': UserAgent} + headers = {'User-Agent': useragent} if referrer: headers['Referer'] = referrer out.debug(u'Sending headers %s' % headers, level=3)
Minor useragent refactoring
wummel_dosage
train
py
51ec70a6ef3a6e4644d1d80263d08da29c5f9121
diff --git a/cloudplatform/service/device/src/main/java/io/rhiot/cloudplatform/service/device/spring/DeviceServiceConfiguration.java b/cloudplatform/service/device/src/main/java/io/rhiot/cloudplatform/service/device/spring/DeviceServiceConfiguration.java index <HASH>..<HASH> 100644 --- a/cloudplatform/service/device/src/main/java/io/rhiot/cloudplatform/service/device/spring/DeviceServiceConfiguration.java +++ b/cloudplatform/service/device/src/main/java/io/rhiot/cloudplatform/service/device/spring/DeviceServiceConfiguration.java @@ -22,17 +22,20 @@ import io.rhiot.cloudplatform.service.binding.ServiceBinding; import io.rhiot.cloudplatform.service.device.MongoDbDeviceRegistry; import org.eclipse.cloudplatform.service.device.api.DeviceRegistry; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class DeviceServiceConfiguration { + @ConditionalOnBean @Bean ServiceBinding deviceServiceBinding(PayloadEncoding payloadEncoding) { return new ServiceBinding(payloadEncoding, "device"); } + @ConditionalOnBean @Bean(name = "device") DeviceRegistry deviceRegistry(Mongo mongo, @Value("${device.metrics.mongodb.db:rhiot}") String db,
Device service components should be overridable.
rhiot_rhiot
train
java
1b975e0350a45ba10c878a65f716164bc967dc72
diff --git a/test/eth/AccountsService.spec.js b/test/eth/AccountsService.spec.js index <HASH>..<HASH> 100644 --- a/test/eth/AccountsService.spec.js +++ b/test/eth/AccountsService.spec.js @@ -134,6 +134,25 @@ test('useAccountWithAddress', async () => { expect(service.currentAddress()).toEqual(a2.address); }); +/* +test('add and use account with no name', async () => { + const service = new AccountsService(); + const engine = (service._engine = mockEngine()); + const a1 = TestAccountProvider.nextAccount(); + const a2 = TestAccountProvider.nextAccount(); + await service.addAccount('foo', { type: 'privateKey', key: a1.key }); + await service.addAccount(null, { type: 'privateKey', key: a2.key }); + service.useAccount('foo'); + service.useAccount(a2.address); + + expect(engine.stop).toBeCalled(); + expect(engine.removeProvider).toBeCalled(); + expect(engine.start).toBeCalled(); + expect(engine.addProvider).toBeCalled(); + expect(service.currentAddress()).toEqual(a2.address); +}); +*/ + test('providerAccountFactory', async () => { const rpc = new RpcSource({ rpcUrl: 'http://localhost:2000' }); const account = await providerAccountFactory(null, rpc);
add test for adding account with no name
makerdao_dai.js
train
js
de9214f98cc1c5f66637834fa956baf77972afde
diff --git a/lib/solargraph/source.rb b/lib/solargraph/source.rb index <HASH>..<HASH> 100644 --- a/lib/solargraph/source.rb +++ b/lib/solargraph/source.rb @@ -499,8 +499,15 @@ module Solargraph elsif c.type == :defs s_visi = visibility s_visi = :public if scope != :class - method_pins.push Solargraph::Pin::Method.new(source, c, fqn || '', :class, s_visi) - inner_map_node c, tree, scope, :class, fqn, stack + if c.children[0].is_a?(AST::Node) and c.children[0].type == :self + dfqn = fqn || '' + else + dfqn = unpack_name(c.children[0]) + end + unless dfqn.nil? + method_pins.push Solargraph::Pin::Method.new(source, c, dfqn, :class, s_visi) + inner_map_node c, tree, scope, :class, dfqn, stack + end next elsif c.type == :send and [:public, :protected, :private].include?(c.children[1]) visibility = c.children[1]
Resolve explicit namespaces in singleton method definitions.
castwide_solargraph
train
rb
843a6bbeff2f339e6f01ac8b138c2ecb985e7ad1
diff --git a/lib/Models/Leaflet.js b/lib/Models/Leaflet.js index <HASH>..<HASH> 100644 --- a/lib/Models/Leaflet.js +++ b/lib/Models/Leaflet.js @@ -226,7 +226,7 @@ Leaflet.prototype.captureScreenshot = function() { var deferred = when.defer(); // Temporarily hide the map credits. - this.map.attributionControl.removeFrom(this.map); + this.map.attributionControl.remove(); var that = this;
Modify code that uses a Leafelt 1 renamed function
TerriaJS_terriajs
train
js
cdd25ead021b20f90b9dbe02108845cebd254a9f
diff --git a/lib/guard/jasmine/cli.rb b/lib/guard/jasmine/cli.rb index <HASH>..<HASH> 100644 --- a/lib/guard/jasmine/cli.rb +++ b/lib/guard/jasmine/cli.rb @@ -105,13 +105,14 @@ module Guard runner_options[:jasmine_url] = options.url || "http://localhost:#{ runner_options[:port] }/jasmine" runner_options[:phantomjs_bin] = options.bin || CLI.which('phantomjs') runner_options[:timeout] = options.timeout + runner_options[:server] = options.server.to_sym runner_options[:server_env] = options.server_env runner_options[:server_timeout] = options.server_timeout + runner_options[:rackup_config] = options.rackup_config runner_options[:spec_dir] = options.spec_dir runner_options[:console] = [:always, :never, :failure].include?(options.console.to_sym) ? options.console.to_sym : :failure runner_options[:errors] = [:always, :never, :failure].include?(options.errors.to_sym) ? options.errors.to_sym : :failure runner_options[:specdoc] = [:always, :never, :failure].include?(options.specdoc.to_sym) ? options.specdoc.to_sym : :always - runner_options[:server] = options.server.to_sym runner_options[:focus] = options.focus
Allowed passing custom rackup config via CLI
guard_guard-jasmine
train
rb
2df904b547c7b4568d8786b7ed67a37bca593e3e
diff --git a/pkg/test/ginkgo/junit.go b/pkg/test/ginkgo/junit.go index <HASH>..<HASH> 100644 --- a/pkg/test/ginkgo/junit.go +++ b/pkg/test/ginkgo/junit.go @@ -145,7 +145,7 @@ func writeJUnitReport(filePrefix, name string, tests []*testCase, dir string, du }, }) case test.success: - s.NumFailed++ + s.NumTests++ s.TestCases = append(s.TestCases, &JUnitTestCase{ Name: test.name, Duration: test.duration.Seconds(),
Fix count of failures in JUnit output Don't count success as a failure.
openshift_origin
train
go
6cb6e26e2ca8b170d0918dc5be1c9ae94a0d942e
diff --git a/library/src/main/java/com/liulishuo/magicprogresswidget/MagicProgressCircle.java b/library/src/main/java/com/liulishuo/magicprogresswidget/MagicProgressCircle.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/liulishuo/magicprogresswidget/MagicProgressCircle.java +++ b/library/src/main/java/com/liulishuo/magicprogresswidget/MagicProgressCircle.java @@ -291,8 +291,10 @@ public class MagicProgressCircle extends View implements ISmoothTarget { * @param footOverHead Boolean */ public void setFootOverHead(boolean footOverHead) { - this.isFootOverHead = footOverHead; - invalidate(); + if (this.isFootOverHead != footOverHead) { + this.isFootOverHead = footOverHead; + invalidate(); + } } public boolean isFootOverHead() {
refactor(MagicProgressCircle): effective invalidate when update footOverHead
lingochamp_MagicProgressWidget
train
java
f4bd34fb9013c7ac2d44aa2c87803d3561c74b9f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,8 @@ install_requires = [ 'slumber>=0.7,<0.8', 'selenium>=3.11,<4', 'transifex-client>=0.14,<0.15', - 'cryptography>=3.2,<4', - 'PyJWT>=1.7,<2', + 'cryptography~=3.4', + 'PyJWT~=2.1.0', 'kubernetes>=17,<19', # corresponds to server version 1.17 or 1.18 'prometheus_client>=0.6,<1', 'sentry-sdk~=1.3.0',
Update PyJWT and cryptography libraries … this will lead to breaking changes: `jwt.encode/decode` method arguments and return types have changed
ministryofjustice_money-to-prisoners-common
train
py
6dfeab441961e01b0f38335b7ab08309bf1eec19
diff --git a/lib/larch/imap/mailbox.rb b/lib/larch/imap/mailbox.rb index <HASH>..<HASH> 100644 --- a/lib/larch/imap/mailbox.rb +++ b/lib/larch/imap/mailbox.rb @@ -17,7 +17,7 @@ class Mailbox @name = name @delim = delim @subscribed = subscribed - @attr = *attr.flatten # flatten is necessary for Ruby 1.9 + @attr = attr.flatten @ids = {} @last_id = 0
Ruby <I> didn't like that last <I> fix. Let's try that again.
rgrove_larch
train
rb
a6f9a2f2c1e1513f9d7a68d7788975e59b543414
diff --git a/examples/sevensegment_test.py b/examples/sevensegment_test.py index <HASH>..<HASH> 100644 --- a/examples/sevensegment_test.py +++ b/examples/sevensegment_test.py @@ -44,6 +44,10 @@ def clock(device, deviceId, seconds): device = led.sevensegment(cascaded=3) +# Alphabet Text +device.show_message("HELLO EVERYONE!") +device.show_message("0123456789 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ") + # Digit futzing date(device, 1) clock(device, 0, seconds=10)
Update 7-segment example
rm-hull_luma.led_matrix
train
py
b78baaad5ff4bcaf12e5de9e7e35f8fadba1c25b
diff --git a/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go b/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go +++ b/staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go @@ -476,9 +476,7 @@ func TestApfExecuteWatchRequestsWithInitializationSignal(t *testing.T) { onExecuteFunc := func() { firstRunning.Done() - firstRunning.Wait() - sendSignals() fakeFilter.wait() allRunning.Done() @@ -502,9 +500,10 @@ func TestApfExecuteWatchRequestsWithInitializationSignal(t *testing.T) { } firstRunning.Wait() + sendSignals() fakeFilter.wait() - firstRunning.Add(concurrentRequests) + for i := 0; i < concurrentRequests; i++ { go func() { defer wg.Done() @@ -513,6 +512,8 @@ func TestApfExecuteWatchRequestsWithInitializationSignal(t *testing.T) { } }() } + firstRunning.Wait() + sendSignals() wg.Wait() }
Remove race condition from TestApfExecuteWatchRequestsWithInitializationSignal
kubernetes_kubernetes
train
go
082ba5015fba2dbd54787885d3822122e0d91955
diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodePackage.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodePackage.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodePackage.java +++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodePackage.java @@ -178,7 +178,7 @@ public class LifecycleChaincodePackage { archiveOutputStream.write(mataDataBytes); archiveOutputStream.closeArchiveEntry(); - archiveEntry = new TarArchiveEntry(chaincodeType.toPackageName().toUpperCase() + "-Code-Package.tar.gz"); + archiveEntry = new TarArchiveEntry("code.tar.gz"); archiveEntry.setMode(0100644); archiveEntry.setSize(dataBytes.length); archiveOutputStream.putArchiveEntry(archiveEntry);
FAB-<I> Standardize _lifecycle code package name The name of the code package currently varies by SDK and is not enforced by the peer. This change is an attempt to homogenize the code package naming so that we may enforce and check for a particular name in the package parsing at the peer. Change-Id: I<I>d<I>b<I>c<I>c
hyperledger_fabric-sdk-java
train
java
897902d62e6e12b1df53b0f3ba041ee91cc85277
diff --git a/src/Mapper/DefaultMapper.php b/src/Mapper/DefaultMapper.php index <HASH>..<HASH> 100644 --- a/src/Mapper/DefaultMapper.php +++ b/src/Mapper/DefaultMapper.php @@ -14,16 +14,19 @@ class DefaultMapper implements MapperInterface { /** * @var string + * @psalm-suppress PropertyNotSetInConstructor */ public $table; /** * @var string + * @psalm-suppress PropertyNotSetInConstructor */ public $key; /** * @var string + * @psalm-suppress PropertyNotSetInConstructor */ protected $entity;
Suppresses PropertyNotSetInConstructor notices for properties set in child class
p810_mysql-helper
train
php
9b525e178922b8a2e6d91edcd4690aecbdbea064
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100755 --- a/lib/server.js +++ b/lib/server.js @@ -390,7 +390,7 @@ vantageServer.auth = function(middleware, options) { throw new Error("Invalid middleware string passed into Vantage.auth: " + middleware); } else { var fn = middleware.call(this.parent, this, options); - this._authFn = fn; + this.parent._authFn = fn; } };
fix(auth): Fix auth registration to the parent vantage, not the server
dthree_vantage
train
js
9e35d6a61d3f9bcc070f2bc373e9525921c19073
diff --git a/pypki2/__init__.py b/pypki2/__init__.py index <HASH>..<HASH> 100644 --- a/pypki2/__init__.py +++ b/pypki2/__init__.py @@ -424,15 +424,15 @@ def pick_loader(loaders): selected = None while selected is None: - print('Available PKI loaders are:') + print('Available PKI configuration loaders are:') for k in sorted(list(options.keys())): print('{0}) {1}'.format(k, options[k].name)) - num = input23('Enter the number of the loader you would like to use: ').strip() + num = input23('Which type of PKI do you want to configure: ').strip() if num in options: - selected = options[k] + selected = options[num] else: print('Invalid selection...') selection = None
Why k is even in scope is beyond me.
nbgallery_pypki2
train
py
a879d0750577a9b0565bd303a29e37cfdcfb3376
diff --git a/lib/discordrb/events/message.rb b/lib/discordrb/events/message.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/events/message.rb +++ b/lib/discordrb/events/message.rb @@ -64,6 +64,14 @@ module Discordrb::Events nil end + # Drains the currently saved message, which clears it out, resulting in everything being saved before being + # thrown away and nothing being sent to the channel (unless there is something saved after this). + # @see #<< + def drain + @saved_message = '' + nil + end + alias_method :user, :author alias_method :text, :content alias_method :send, :send_message
Add MessageEvent#drain to clear out the saved message
meew0_discordrb
train
rb
91b244fe53262c0d88ab7b2e3ef3b38b54f662be
diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js index <HASH>..<HASH> 100644 --- a/js/jquery.mapael.js +++ b/js/jquery.mapael.js @@ -221,6 +221,9 @@ // zoom TimeOut handler (used to set and clear) self.zoomTO = 0; + + // resize TimeOut handler (used to set and clear) + self.resizeTO = 0; // Panning: tell if panning action is in progress self.panning = false; @@ -266,7 +269,6 @@ init: function() { var self = this; var mapConf = {} // the map configuration from the user - , resizeTO = 0 , zoomCenterX = 0 , zoomCenterY = 0 , previousPinchDist = 0; @@ -692,8 +694,8 @@ self.createLegends("plot", self.plots, (self.options.map.width / mapConf.width)); } else { $(window).on("resize." + pluginName, function() { - clearTimeout(resizeTO); - resizeTO = setTimeout(function(){self.$map.trigger("resizeEnd." + pluginName);}, 150); + clearTimeout(self.resizeTO); + self.resizeTO = setTimeout(function(){self.$map.trigger("resizeEnd." + pluginName);}, 150); }); // Create the legends for plots taking into account the scale of the map
Refactor resizeTO in object
neveldo_jQuery-Mapael
train
js
ee6b96cc2297b1e320a7ce58c3f750e260057893
diff --git a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java index <HASH>..<HASH> 100644 --- a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java +++ b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java @@ -1755,7 +1755,6 @@ public class HttpRequest { return this; if (multipart) output.write("\r\n--" + BOUNDARY + "--\r\n"); - output.flush(); if (ignoreCloseExceptions) try { output.close();
Remove explicit flush() of request output stream Instead rely on close() calls calling flush() as documented
kevinsawicki_http-request
train
java
91dedf6f7e1e4e53b426a5fb2ed3b15349c6632c
diff --git a/code/fields/MultiValueTextField.php b/code/fields/MultiValueTextField.php index <HASH>..<HASH> 100644 --- a/code/fields/MultiValueTextField.php +++ b/code/fields/MultiValueTextField.php @@ -59,7 +59,8 @@ class MultiValueTextField extends FormField { } public function createInput($attributes, $value = null) { - return self::create_tag($this->tag, $attributes, $value); + $attributes['value'] = $value; + return self::create_tag($this->tag, $attributes); } public function performReadonlyTransformation() {
fix(MultiValueField) Better support for <I>+ which uses the 'value' field in attributes exclusively
symbiote_silverstripe-multivaluefield
train
php
1449770b0b46ed1d8bff4d4a1e5421d7f6846ac8
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -731,6 +731,27 @@ class MultiMinion(MinionBase): if HAS_ZMQ: zmq.eventloop.ioloop.install() self.io_loop = LOOP_CLASS.current() + self.process_manager = ProcessManager(name='MultiMinionProcessManager') + self.io_loop.spawn_callback(self.process_manager.run, async=True) + + def destroy(self): + ''' + Tear down the minion + ''' + self._running = False + if hasattr(self, 'schedule'): + del self.schedule + if hasattr(self, 'pub_channel'): + self.pub_channel.on_recv(None) + if hasattr(self.pub_channel, 'close'): + self.pub_channel.close() + del self.pub_channel + if hasattr(self, 'periodic_callbacks'): + for cb in six.itervalues(self.periodic_callbacks): + cb.stop() + + def __del__(self): + self.destroy() def _spawn_minions(self): '''
Give multimion a process manager and its own destroy method
saltstack_salt
train
py
61c1b86f4d0d3d8f7df6b54bea613a798f15edb0
diff --git a/fc/excel_ui.py b/fc/excel_ui.py index <HASH>..<HASH> 100644 --- a/fc/excel_ui.py +++ b/fc/excel_ui.py @@ -1,9 +1,5 @@ """Module containing the Microsoft Excel User Interface. -Authors: Sebastian M. Castillo-Hair ([email protected]) - -Last Modified: 10/30/2015 - """ import re
Removed author and date information from excel_ui module docstring.
taborlab_FlowCal
train
py
0a03123fcf69b355a7a3a07789c71480bab7c883
diff --git a/lib/ddl/sql_generator.php b/lib/ddl/sql_generator.php index <HASH>..<HASH> 100644 --- a/lib/ddl/sql_generator.php +++ b/lib/ddl/sql_generator.php @@ -1210,7 +1210,7 @@ abstract class sql_generator { public static function getAllReservedWords() { global $CFG; - $generators = array('mysql', 'postgres', 'oracle', 'mssql', 'sqlite'); + $generators = array('mysql', 'postgres', 'oracle', 'mssql'); $reserved_words = array(); foreach($generators as $generator) {
MDL-<I> removing sqlite because it is not maintained
moodle_moodle
train
php
7d5044466c4edee049e8882225189952b57a9e8a
diff --git a/packages/react-atlas-core/webpack.config.js b/packages/react-atlas-core/webpack.config.js index <HASH>..<HASH> 100644 --- a/packages/react-atlas-core/webpack.config.js +++ b/packages/react-atlas-core/webpack.config.js @@ -40,11 +40,6 @@ let config = { 'process.env': { 'NODE_ENV': JSON.stringify(process.env.NODE_ENV) } - }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - } }) ] };
Don't minimize source during dev builds.
DigitalRiver_react-atlas
train
js
d0a4dad4bd6776832726a432f1c246e1f5c28b02
diff --git a/modules/citrus-ws/src/main/java/com/consol/citrus/ws/actions/ReceiveSoapMessageAction.java b/modules/citrus-ws/src/main/java/com/consol/citrus/ws/actions/ReceiveSoapMessageAction.java index <HASH>..<HASH> 100644 --- a/modules/citrus-ws/src/main/java/com/consol/citrus/ws/actions/ReceiveSoapMessageAction.java +++ b/modules/citrus-ws/src/main/java/com/consol/citrus/ws/actions/ReceiveSoapMessageAction.java @@ -64,10 +64,17 @@ public class ReceiveSoapMessageAction extends ReceiveMessageAction { } else { return; //no attachment expected, no validation } + + // handle variables in content id if (controlAttachment.getContentId() != null) { controlAttachment.setContentId(context.replaceDynamicContentInString(controlAttachment.getContentId())); } + // handle variables in content type + if (controlAttachment.getContentType() != null) { + controlAttachment.setContentType(context.replaceDynamicContentInString(controlAttachment.getContentType())); + } + attachmentValidator.validateAttachment(receivedMessage, controlAttachment); } catch (IOException e) { throw new CitrusRuntimeException(e);
Handle variables in content type before SOAP attachment validation
citrusframework_citrus
train
java
40e48e6566d95e58dbd3e8eab42bbb616ef670f2
diff --git a/conllu/parser.py b/conllu/parser.py index <HASH>..<HASH> 100644 --- a/conllu/parser.py +++ b/conllu/parser.py @@ -22,7 +22,7 @@ def parse_tree(text): for token in sentence: head_indexed[token["head"]].append(token) - trees.append(create_tree(head_indexed)) + trees += create_tree(head_indexed) return trees diff --git a/tests/fixtures/data1_tree.py b/tests/fixtures/data1_tree.py index <HASH>..<HASH> 100644 --- a/tests/fixtures/data1_tree.py +++ b/tests/fixtures/data1_tree.py @@ -1,7 +1,7 @@ from collections import OrderedDict from conllu.tree_helpers import TreeNode -data1_expected = [[ +data1_expected = [ TreeNode( data=OrderedDict([ ('id', 5), @@ -160,4 +160,4 @@ data1_expected = [[ ) ] ) -]] +]
There's always just one root, no need for a list.
EmilStenstrom_conllu
train
py,py
1337674c8f11f3a9e02b2f847308a222d986b026
diff --git a/src/Symmetric/Crypto.php b/src/Symmetric/Crypto.php index <HASH>..<HASH> 100644 --- a/src/Symmetric/Crypto.php +++ b/src/Symmetric/Crypto.php @@ -210,13 +210,6 @@ final class Crypto (string) $nonce, (string) $encKey ); - if (!\is_string($plaintext)) { - // @codeCoverageIgnoreStart - throw new InvalidMessage( - 'Invalid message' - ); - // @codeCoverageIgnoreEnd - } \sodium_memzero($encrypted); \sodium_memzero($nonce); \sodium_memzero($encKey);
This condition will never happen, a fatal error will instead.
paragonie_halite
train
php
7142c883feade614ed3d36c667e7781cd278e327
diff --git a/tests/test_grid.py b/tests/test_grid.py index <HASH>..<HASH> 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -76,6 +76,7 @@ def test_grid_append_notdict(): assert False except TypeError as e: assert str(e) == 'value must be a dict' + assert len(g) == 1 def test_grid_append_v2_list_fail(): g = Grid(version='2.0') @@ -110,11 +111,12 @@ def test_grid_setitem_notdict(): g.append(row) try: - g.append('This is not a dict') + g[0] = 'This is not a dict' assert False, 'Accepted a string' except TypeError: pass assert len(g) == 1 + assert g[0]['test'] == 'This is a test' def test_grid_del(): g = Grid()
WC-<I>: grid tests: Tweak data type assertion tests.
vrtsystems_hszinc
train
py
f62c342bc5ff043093cc25e200505e8f999f3342
diff --git a/backtrader/feeds/ibdata.py b/backtrader/feeds/ibdata.py index <HASH>..<HASH> 100644 --- a/backtrader/feeds/ibdata.py +++ b/backtrader/feeds/ibdata.py @@ -333,6 +333,25 @@ class IBData(with_metaclass(MetaIBData, DataBase)): self.contract = None self.contractdetails = None + # Get the output timezone (if any) + self._tz = self._gettz() + # Lines have already been create, set the tz + self.lines.datetime._settz(self._tz) + + # This should probably be also called from an override-able method + self._tzinput = bt.utils.date.Localizer(self._gettzinput()) + + # Convert user input times to the output timezone (or min/max) + if self.p.fromdate is None: + self.fromdate = float('-inf') + else: + self.fromdate = self.date2num(self.p.fromdate) + + if self.p.todate is None: + self.todate = float('inf') + else: + self.todate = self.date2num(self.p.todate) + if self.p.backfill_from is not None: self._state = self._ST_FROM self.p.backfill_from._start()
Add initialization for timezone and todate (#<I>) IBData.start() needs to initialize timezone and todate in historical mode
backtrader_backtrader
train
py
9c6eb59f73a6be8e74060f42d280f400f3c03a94
diff --git a/runtests/mpi/tester.py b/runtests/mpi/tester.py index <HASH>..<HASH> 100644 --- a/runtests/mpi/tester.py +++ b/runtests/mpi/tester.py @@ -290,7 +290,7 @@ class Tester(BaseTester): parser.addoption("--mpisub-site-dir", default=None, help="site-dir in mpisub") - def __init__(self, *args, mpi_missing='fail', **kwargs): + def __init__(self, *args, **kwargs): """ Parameters ---------- @@ -301,8 +301,10 @@ class Tester(BaseTester): extra path : list of str extra paths to include on PATH when building """ + if 'mpi_missing' in kwargs: + self._mpi_missing = kwargs['mpi_missing'] + del kwargs['mpi_missing'] super(Tester, self).__init__(*args, **kwargs) - self._mpi_missing = mpi_missing @property def comm(self):
BUG: Extract 'mpi_missing' from kwargs
bccp_runtests
train
py
bbfb83cd009d41f3cbd9b644c8db1e25c4c82b6c
diff --git a/xlsxwriter.class.php b/xlsxwriter.class.php index <HASH>..<HASH> 100644 --- a/xlsxwriter.class.php +++ b/xlsxwriter.class.php @@ -43,12 +43,12 @@ class XLSXWriter } } } - + public function setTempDir($dir) { $this->temp_dir = $dir; } - + protected function tempFilename() { $temp_dir = is_null($this->temp_dir) ? sys_get_temp_dir() : $this->temp_dir; @@ -301,7 +301,7 @@ class XLSXWriter $sheet->file_writer->close(); $sheet->finalized=true; } - + public function markMergedCell($sheet_name, $start_cell_row, $start_cell_column, $end_cell_row, $end_cell_column) { if (empty($sheet_name) || $this->sheets[$sheet_name]->finalized) @@ -582,6 +582,7 @@ class XLSXWriter //------------------------------------------------------------------ public static function xmlspecialchars($val) { + $val=preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/u', '', $val); return str_replace("'", "&#39;", htmlspecialchars($val)); } //------------------------------------------------------------------
Fixed issue: Ctrl character in value strings break the final document
mk-j_PHP_XLSXWriter
train
php
711d654d9e87fc2adbf8ca275add47364647f751
diff --git a/bin/bootstrap.js b/bin/bootstrap.js index <HASH>..<HASH> 100755 --- a/bin/bootstrap.js +++ b/bin/bootstrap.js @@ -150,7 +150,7 @@ if (!phantom.casperLoaded) { } } // trick to locate source file location on error - scriptCode += ";var __fe__ = new Error('__sourceId__')"; + scriptCode += ";var __fe__ = new CasperError('__sourceId__')"; scriptCode += ";__fe__.fileName = '" + file + "'"; scriptCode += ";throw __fe__;"; return scriptCode; @@ -166,7 +166,7 @@ if (!phantom.casperLoaded) { if (typeof callback === "function") { callback(error, file); } else { - console.error(this.getErrorMessage(error)); + console.error(error.stack); this.exit(1); } }; diff --git a/modules/tester.js b/modules/tester.js index <HASH>..<HASH> 100644 --- a/modules/tester.js +++ b/modules/tester.js @@ -320,7 +320,7 @@ var Tester = function(casper, options) { phantom.processScriptError(e, file, function(error) { // do not abort the whole suite, just fail fast displaying the // caught error and process next suite - self.fail(phantom.getErrorMessage(e)); + self.fail(e); self.done(); }); }
better display of uncaught CasperError errors
casperjs_casperjs
train
js,js
cb0b08a820bc49492ec7c85f0949c9a4270ab95e
diff --git a/module/Core/public/scripts/library/codemirror-3.21/addon/search/search.js b/module/Core/public/scripts/library/codemirror-3.21/addon/search/search.js index <HASH>..<HASH> 100644 --- a/module/Core/public/scripts/library/codemirror-3.21/addon/search/search.js +++ b/module/Core/public/scripts/library/codemirror-3.21/addon/search/search.js @@ -47,11 +47,11 @@ return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); } function dialog(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, {value: deflt}); + if (cm.openDialog) cm.openDialog(text, f, {value: deflt, bottom: true}); else f(prompt(shortText, deflt)); } function confirmDialog(cm, text, shortText, fs) { - if (cm.openConfirm) cm.openConfirm(text, fs); + if (cm.openConopenDialogfirm) cm.openConfirm(text, fs, {bottom: true}); else if (confirm(shortText)) fs[0](); } function parseQuery(query) {
CodeMirror search addon: open dialogs at the bottom
webriq_core
train
js
ec4fdcf446e80c0f8a7d8c0f18c9c4e261a592e2
diff --git a/influxdb/__init__.py b/influxdb/__init__.py index <HASH>..<HASH> 100644 --- a/influxdb/__init__.py +++ b/influxdb/__init__.py @@ -11,4 +11,4 @@ __all__ = [ ] -__version__ = '2.0.0' +__version__ = '2.0.1' diff --git a/influxdb/resultset.py b/influxdb/resultset.py index <HASH>..<HASH> 100644 --- a/influxdb/resultset.py +++ b/influxdb/resultset.py @@ -7,16 +7,16 @@ class ResultSet(object): """A wrapper around series results """ def __init__(self, series): - self.raw = series + self._raw = series @property def raw(self): """Raw JSON from InfluxDB""" - return self.raw + return self._raw @raw.setter def raw(self, value): - self.raw = value + self._raw = value def __getitem__(self, key): """
Fixed recursion issue with raw attribute
influxdata_influxdb-python
train
py,py
8b927fd3d9eb27d12d9822b9597b98e0168d6e14
diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php index <HASH>..<HASH> 100644 --- a/Controller/ResourceController.php +++ b/Controller/ResourceController.php @@ -24,7 +24,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\Security\Core\Exception\AccessDeniedException; /** @@ -357,6 +356,10 @@ class ResourceController extends Controller $this->isGrantedOr403($configuration, ResourceActions::DELETE); $resource = $this->findOr404($configuration); + if (!$this->isCsrfTokenValid($resource->getId(), $request->request->get('_csrf_token'))) { + throw new HttpException(Response::HTTP_FORBIDDEN, 'Invalid csrf token.'); + } + $event = $this->eventDispatcher->dispatchPreEvent(ResourceActions::DELETE, $configuration, $resource); if ($event->isStopped() && !$configuration->isHtmlRequest()) {
[Resource] Use csrf protection in delete actions
Sylius_SyliusResourceBundle
train
php
75f57ca4fdeb68b4aa65113e6a2d600ed4fd9a11
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ except ImportError: from setuptools import setup, find_packages setup( - name='pymongo-orchestration', + name='mongo-orchestration', version='0.1', author='MongoDB, Inc.', author_email='[email protected]',
Change name of project in setup.py to "mongo-orchestration".
10gen_mongo-orchestration
train
py
d646d3ac2de98a2a3b7c0a284f747eca1ff6e18f
diff --git a/views/js/controller/items/action.js b/views/js/controller/items/action.js index <HASH>..<HASH> 100644 --- a/views/js/controller/items/action.js +++ b/views/js/controller/items/action.js @@ -3,12 +3,12 @@ define([ 'uri', 'jquery', 'context', - 'taoItems/preview/preview' -], function(binder, uri, $, context, preview){ + 'taoItems/preview/preview', + 'helpers' +], function(binder, uri, $, context, preview, helpers){ binder.register('itemPreview', function itemPreview(actionContext){ - console.log(context.root_url + context.shownExtension + '/ItemPreview/forwardMe?uri=' + actionContext.uri) - preview.init(context.root_url + context.shownExtension + '/ItemPreview/forwardMe?uri=' + actionContext.uri); + preview.init(helpers._url('forwardMe', 'ItemPreview', context.shownExtension, {uri : actionContext.id})); preview.show(); });
Use non-encoded uri for preview
oat-sa_extension-tao-item
train
js
3cdd3eb5183d14b352d078ccf2db6ec58ff6cb41
diff --git a/spacy/about.py b/spacy/about.py index <HASH>..<HASH> 100644 --- a/spacy/about.py +++ b/spacy/about.py @@ -4,13 +4,13 @@ # fmt: off __title__ = "spacy-nightly" -__version__ = "2.1.0a9.dev2" +__version__ = "2.1.0a9" __summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython" __uri__ = "https://spacy.io" __author__ = "Explosion AI" __email__ = "[email protected]" __license__ = "MIT" -__release__ = False +__release__ = True __download_url__ = "https://github.com/explosion/spacy-models/releases/download" __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
Set version to <I>a9
explosion_spaCy
train
py
73ce9e73d69b559d3121930d04f84ab23c3ecb73
diff --git a/test/unit/basic_test.rb b/test/unit/basic_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/basic_test.rb +++ b/test/unit/basic_test.rb @@ -19,14 +19,14 @@ class BasicTest < Test::Unit::TestCase client.use_oauth2_auth = use_auth %i[get delete head].each do |method| stub = stub_request(method, /feed-test/).to_timeout - assert_raise RestClient::RequestTimeout do + assert_raise(RestClient::RequestTimeout, RestClient::Exceptions::OpenTimeout) do client.send(method, stubbed_path, format_headers) assert_requested stub end end %i[post put patch].each do |method| stub = stub_request(method, /feed-test/).to_timeout - assert_raise RestClient::RequestTimeout do + assert_raise(RestClient::RequestTimeout, RestClient::Exceptions::OpenTimeout) do client.send(method, stubbed_path, FHIR::Patient.new, format_headers) assert_requested stub end
Test handles multiple exception types depending on version of RestClient.
fhir-crucible_fhir_client
train
rb
d4f4ac00be6e09bd71f8cc17f26f1d9e6fc7213f
diff --git a/coconut/command/util.py b/coconut/command/util.py index <HASH>..<HASH> 100644 --- a/coconut/command/util.py +++ b/coconut/command/util.py @@ -257,7 +257,8 @@ def stdin_readable(): return False try: return bool(select([sys.stdin], [], [], 0)[0]) - except OSError: + except Exception as err: + print(err) pass if not sys.stdout.isatty(): return False diff --git a/coconut/root.py b/coconut/root.py index <HASH>..<HASH> 100644 --- a/coconut/root.py +++ b/coconut/root.py @@ -26,7 +26,7 @@ import sys as _coconut_sys VERSION = "1.2.3" VERSION_NAME = "Colonel" # False for release, int >= 1 for develop -DEVELOP = 28 +DEVELOP = 29 #----------------------------------------------------------------------------------------------------------------------- # CONSTANTS:
Fix Cygwin error Resolves #<I>.
evhub_coconut
train
py,py
83d3909f2abd50792dd6bba538e5ba186a4df3ec
diff --git a/scripts/lateralus.component.model.js b/scripts/lateralus.component.model.js index <HASH>..<HASH> 100644 --- a/scripts/lateralus.component.model.js +++ b/scripts/lateralus.component.model.js @@ -81,6 +81,14 @@ define([ /** * This is the same as the `{{#crossLink + * "Lateralus.mixins/emit"}}{{/crossLink}}` mixin method. See the + * documentation for that. + * @method emit + */ + fn.emit = mixins.emit; + + /** + * This is the same as the `{{#crossLink * "Lateralus.mixins/listenFor"}}{{/crossLink}}` mixin method. See the * documentation for that. * @method listenFor
Add emit mixin method to Lateralus.Component.Model.
Jellyvision_lateralus
train
js