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
20299a6e9041a6496cc3c0ea098b0e44be610a36
diff --git a/ui/src/admin/constants/chronografTableSizing.js b/ui/src/admin/constants/chronografTableSizing.js index <HASH>..<HASH> 100644 --- a/ui/src/admin/constants/chronografTableSizing.js +++ b/ui/src/admin/constants/chronografTableSizing.js @@ -3,5 +3,5 @@ export const USERS_TABLE = { colSuperAdmin: 90, colProvider: 170, colScheme: 90, - colActions: 70, + colActions: 80, }
Adjust Users table DeleteConfirmButtons column width to avoid jitter
influxdata_influxdb
train
js
86844cf93cb1b282c25329bf39c13492d8f06d29
diff --git a/detox/proc.py b/detox/proc.py index <HASH>..<HASH> 100644 --- a/detox/proc.py +++ b/detox/proc.py @@ -136,11 +136,16 @@ class Detox: if self.toxsession.config.option.sdistonly: self._sdistpath = self.getresources("sdist") return - venv, sdist = self.getresources("venv:%s" % venvname, "sdist") - self._sdistpath = sdist - if venv and sdist: - if self.toxsession.installpkg(venv, sdist): + if self.toxsession.config.skipsdist: + venv = self.getresources("venv:%s" % venvname)[0] + if venv: self.toxsession.runtestenv(venv, redirect=True) + else: + venv, sdist = self.getresources("venv:%s" % venvname, "sdist") + self._sdistpath = sdist + if venv and sdist: + if self.toxsession.installpkg(venv, sdist): + self.toxsession.runtestenv(venv, redirect=True) def runtestsmulti(self, envlist): pool = GreenPool()
make detox honor skipsdist value in toxini
tox-dev_detox
train
py
ab22ffafee17b5f937507cdd41c8d427748f7d4d
diff --git a/lib/zookeeper/continuation.rb b/lib/zookeeper/continuation.rb index <HASH>..<HASH> 100644 --- a/lib/zookeeper/continuation.rb +++ b/lib/zookeeper/continuation.rb @@ -78,9 +78,11 @@ module Zookeeper attr_accessor :meth, :block, :rval + attr_reader :args + def initialize(meth, *args) @meth = meth - @args = args + @args = args.freeze @mutex = Monitor.new @cond = @mutex.new_cond @rval = nil @@ -110,7 +112,7 @@ module Zookeeper end if (now > time_to_stop) and !@rval and !@error - raise Exceptions::ContinuationTimeoutError, "response for meth: #{meth.inspect}, args: #{args.inspect}, not received within #{OPERATION_TIMEOUT} seconds" + raise Exceptions::ContinuationTimeoutError, "response for meth: #{meth.inspect}, args: #{@args.inspect}, not received within #{OPERATION_TIMEOUT} seconds" end case @error
Fix bug in timeout case for Continuation
zk-ruby_zookeeper
train
rb
808fe92950eee8a09e2f00865e455cae3e9cdf2a
diff --git a/imgaug/augmenters/blur.py b/imgaug/augmenters/blur.py index <HASH>..<HASH> 100644 --- a/imgaug/augmenters/blur.py +++ b/imgaug/augmenters/blur.py @@ -390,6 +390,7 @@ class BilateralBlur(Augmenter): samples_sigma_color = self.sigma_color.draw_samples((nb_images,), random_state=ia.new_random_state(seed+1)) samples_sigma_space = self.sigma_space.draw_samples((nb_images,), random_state=ia.new_random_state(seed+2)) for i in sm.xrange(nb_images): + assert images[i].shape[2] == 3, "BilateralBlur can currently only be applied to images with 3 channels." di = samples_d[i] sigma_color_i = samples_sigma_color[i] sigma_space_i = samples_sigma_space[i]
Add assert to BilateralBlur
aleju_imgaug
train
py
e3ead5df06d2209346b30b4f9a3b1307e63d913e
diff --git a/src/ol/events/condition.js b/src/ol/events/condition.js index <HASH>..<HASH> 100644 --- a/src/ol/events/condition.js +++ b/src/ol/events/condition.js @@ -112,6 +112,18 @@ ol.events.condition.singleClick = function(mapBrowserEvent) { /** + * Return `true` if the event is a map `dblclick` event, `false` otherwise. + * + * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. + * @return {boolean} True if the event is a map `dblclick` event. + * @api stable + */ +ol.events.condition.doubleClick = function(mapBrowserEvent) { + return mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DBLCLICK; +}; + + +/** * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is * pressed. *
events/condition: Add doubleClick condition
openlayers_openlayers
train
js
a1d8475ef3f8981eb59522ab5d40b6e38844725c
diff --git a/kite-morphlines/kite-morphlines-solr-core/src/main/java/org/kitesdk/morphline/solr/SolrServerDocumentLoader.java b/kite-morphlines/kite-morphlines-solr-core/src/main/java/org/kitesdk/morphline/solr/SolrServerDocumentLoader.java index <HASH>..<HASH> 100644 --- a/kite-morphlines/kite-morphlines-solr-core/src/main/java/org/kitesdk/morphline/solr/SolrServerDocumentLoader.java +++ b/kite-morphlines/kite-morphlines-solr-core/src/main/java/org/kitesdk/morphline/solr/SolrServerDocumentLoader.java @@ -142,7 +142,7 @@ public class SolrServerDocumentLoader implements DocumentLoader { } } - private void sendDeletes(List<String> deletes) throws SolrServerException, IOException { + private void sendDeletes(List deletes) throws SolrServerException, IOException { if (deletes.size() > 0) { UpdateRequest req = new UpdateRequest(); for (Object delete : deletes) {
CDK-<I>: cleanup
kite-sdk_kite
train
java
9fb3aa901b0066ee80d26fe4f40c1b79f854ee07
diff --git a/lib/ducalis/adapters/circle_ci.rb b/lib/ducalis/adapters/circle_ci.rb index <HASH>..<HASH> 100644 --- a/lib/ducalis/adapters/circle_ci.rb +++ b/lib/ducalis/adapters/circle_ci.rb @@ -6,6 +6,7 @@ module Ducalis def repo @repo ||= ENV.fetch('CIRCLE_REPOSITORY_URL') .sub('https://github.com/', '') + .sub('[email protected]:', '') end def id
Fix for CircleCI with git source
ignat-z_ducalis
train
rb
21704e9d5e53a9f5e7e82d8b7592b573da6a1875
diff --git a/src/streamlink/plugins/ine.py b/src/streamlink/plugins/ine.py index <HASH>..<HASH> 100644 --- a/src/streamlink/plugins/ine.py +++ b/src/streamlink/plugins/ine.py @@ -23,7 +23,7 @@ class INE(Plugin): validate.all( validate.get(1), validate.transform(json.loads), - {"playlist": str}, + {"playlist": validate.text}, validate.get("playlist") ) )
Update ine.py (#<I>) * Update ine.py Fix #<I> * Update ine.py
streamlink_streamlink
train
py
abd3b13cc688ebdc87567004ed3d4d7bcf62b47d
diff --git a/src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php b/src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php +++ b/src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php @@ -40,8 +40,6 @@ class AuthorizationChecker implements AuthorizationCheckerInterface /** * {@inheritdoc} - * - * @throws AuthenticationCredentialsNotFoundException when the token storage has no authentication token and $exceptionOnNoToken is set to true */ final public function isGranted(mixed $attribute, mixed $subject = null): bool {
Remove wrong PHPDoc isGranted doesn't throw anymore an exception when there is no token in the storage
symfony_symfony
train
php
f3e6f7b8c210184f30aaf3024ed72ab16b961588
diff --git a/python/orca/src/setup.py b/python/orca/src/setup.py index <HASH>..<HASH> 100644 --- a/python/orca/src/setup.py +++ b/python/orca/src/setup.py @@ -97,7 +97,7 @@ def setup_package(): packages=get_bigdl_packages(), install_requires=['packaging', 'filelock', 'bigdl-tf==0.14.0.dev1', 'bigdl-math==0.14.0.dev1', - 'bigdl-dllib=='+VERSION, 'pyzmq'], + 'bigdl-dllib=='+VERSION, 'pyzmq', 'pyarrow'], extras_require={'ray': RAY_DEP, 'automl': AUTOML_DEP, },
Orca: add pyarrow dependency (#<I>) * fix: add pyarrow package in setup.py * refactor: update code style
intel-analytics_BigDL
train
py
a9b13c98a0aa6812dbdbbf6687d88ad5ff003f9f
diff --git a/client/deis.py b/client/deis.py index <HASH>..<HASH> 100755 --- a/client/deis.py +++ b/client/deis.py @@ -784,7 +784,8 @@ class DeisClient(object): def builds_create(self, args): """ - Creates a new build of an application. + Creates a new build of an application. Imports an <image> and deploys it to Deis + as a new release. Usage: deis builds:create <image> [--app=<app>]
docs(client): elaborate upon builds:create
deis_deis
train
py
6d2f42891122bddca8b916fd0f7a7aa01ff97e17
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php @@ -503,7 +503,11 @@ abstract class ControllerTraitTest extends TestCase public function testCreateForm() { - $form = new Form($this->createMock(FormConfigInterface::class)); + $config = $this->createMock(FormConfigInterface::class); + $config->method('getInheritData')->willReturn(false); + $config->method('getName')->willReturn(''); + + $form = new Form($config); $formFactory = $this->createMock(FormFactoryInterface::class); $formFactory->expects($this->once())->method('create')->willReturn($form);
[FrameworkBundle] Fix broken mock
symfony_symfony
train
php
a8d7e93d666d2b0dcdc8e1af2ddbb72de60be7a1
diff --git a/test/e2e_node/e2e_service.go b/test/e2e_node/e2e_service.go index <HASH>..<HASH> 100644 --- a/test/e2e_node/e2e_service.go +++ b/test/e2e_node/e2e_service.go @@ -361,7 +361,10 @@ func (k *killCmd) Kill() error { const timeout = 10 * time.Second for _, signal := range []string{"-TERM", "-KILL"} { glog.V(2).Infof("Killing process %d (%s) with %s", pid, name, signal) - _, err := exec.Command("sudo", "kill", signal, strconv.Itoa(pid)).Output() + cmd := exec.Command("sudo", "kill", signal, strconv.Itoa(pid)) + // Run the 'kill' command in a separate process group so sudo doesn't ignore it + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} + _, err := cmd.Output() if err != nil { glog.Errorf("Error signaling process %d (%s) with %s: %v", pid, name, signal, err) continue
Change process group when sending kill signal Otherwise when the target process is running sudo it ignores the signal.
kubernetes_kubernetes
train
go
25cd42acbb16f5c4ba7a37089b6c1d921fd9320e
diff --git a/integration/fake-registry/fake-registry.go b/integration/fake-registry/fake-registry.go index <HASH>..<HASH> 100644 --- a/integration/fake-registry/fake-registry.go +++ b/integration/fake-registry/fake-registry.go @@ -3,10 +3,11 @@ package main import ( "flag" "fmt" - boshlog "github.com/cloudfoundry/bosh-agent/logger" - bmregistry "github.com/cloudfoundry/bosh-micro-cli/registry" "net/http" "strings" + + boshlog "github.com/cloudfoundry/bosh-agent/logger" + bmregistry "github.com/cloudfoundry/bosh-micro-cli/registry" ) func main() { @@ -22,12 +23,10 @@ func main() { logger := boshlog.NewLogger(boshlog.LevelDebug) serverManager := bmregistry.NewServerManager(logger) - go func() { - _, err := serverManager.Start(*user, *password, *host, *port) - if err != nil { - panic("Error starting registry") - } - }() + _, err := serverManager.Start(*user, *password, *host, *port) + if err != nil { + panic("Error starting registry") + } if *instance != "" && *settings != "" { request, err := http.NewRequest(
Starting registry is a blocking call now
cloudfoundry_bosh-agent
train
go
cee47fb86197710892e9d23cbdc35813f51845f7
diff --git a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessor.java b/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessor.java index <HASH>..<HASH> 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessor.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/taskprocessor/CeTaskProcessor.java @@ -21,6 +21,7 @@ package org.sonar.ce.taskprocessor; import java.util.Set; import javax.annotation.CheckForNull; +import org.sonar.api.ce.ComputeEngineSide; import org.sonar.ce.queue.CeTask; import org.sonar.ce.queue.CeTaskResult; @@ -28,6 +29,7 @@ import org.sonar.ce.queue.CeTaskResult; * This interface is used to provide the processing code for {@link CeTask}s of one or more type to be called by the * Compute Engine. */ +@ComputeEngineSide public interface CeTaskProcessor { /**
SONAR-<I> CeTaskProcessor must have annotation @ComputeEngineSide
SonarSource_sonarqube
train
java
115165d46a67dbc9296afccafa26c93e32b3811d
diff --git a/src/main/java/net/jodah/lyra/ConnectionOptions.java b/src/main/java/net/jodah/lyra/ConnectionOptions.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/jodah/lyra/ConnectionOptions.java +++ b/src/main/java/net/jodah/lyra/ConnectionOptions.java @@ -225,7 +225,7 @@ public class ConnectionOptions { * @throws NullPointerException if {@code requestedHeartbeat} is null */ public ConnectionOptions withRequestedHeartbeat(Duration requestedHeartbeat) { - factory.setRequestedHeartbeat((int) requestedHeartbeat.toMillis()); + factory.setRequestedHeartbeat((int) requestedHeartbeat.toSeconds()); return this; }
Requested heartbeat should be in seconds - Fixes issue #<I>
jhalterman_lyra
train
java
3a07abe53d6c75552c2dde3262f9325db97959f9
diff --git a/core/src/com/google/inject/internal/Errors.java b/core/src/com/google/inject/internal/Errors.java index <HASH>..<HASH> 100644 --- a/core/src/com/google/inject/internal/Errors.java +++ b/core/src/com/google/inject/internal/Errors.java @@ -115,7 +115,7 @@ public final class Errors implements Serializable { * Returns an instance that uses {@code source} as a reference point for newly added errors. */ public Errors withSource(Object source) { - return source == SourceProvider.UNKNOWN_SOURCE + return source == this.source || source == SourceProvider.UNKNOWN_SOURCE ? this : new Errors(this, source); } diff --git a/core/src/com/google/inject/spi/Elements.java b/core/src/com/google/inject/spi/Elements.java index <HASH>..<HASH> 100644 --- a/core/src/com/google/inject/spi/Elements.java +++ b/core/src/com/google/inject/spi/Elements.java @@ -325,7 +325,7 @@ public final class Elements { } public RecordingBinder withSource(final Object source) { - return new RecordingBinder(this, source, null); + return source == this.source ? this : new RecordingBinder(this, source, null); } public RecordingBinder skipSources(Class... classesToSkip) {
Avoid unnecessary object creation if .withSource doesn't change the source
sonatype_sisu-guice
train
java,java
1cd0170b588ae0988fdc8b650ceda5c5b4ed5400
diff --git a/src/faker/placeholdit.js b/src/faker/placeholdit.js index <HASH>..<HASH> 100644 --- a/src/faker/placeholdit.js +++ b/src/faker/placeholdit.js @@ -37,7 +37,7 @@ function isSupportedFormat(format) { function isValidColorValue(color) { if (color) { - return new RegExp(/(?:^[0-9a-f]{3}$)|(?:^[0-9a-f]{6}$)/, 'i').test(color); + return new RegExp(/(?:^[0-9a-f]{3}$)|(?:^[0-9a-f]{6}$)/.source, 'i').test(color); } return true; }
Fixed issue when building regex with flags.
mrstebo_fakergem
train
js
cbfcd9a1a2c761a878f530993e02b172548dea1a
diff --git a/test/4_DEPRECATED/external_task_api_client/handle_bpmn_error.js b/test/4_DEPRECATED/external_task_api_client/handle_bpmn_error.js index <HASH>..<HASH> 100644 --- a/test/4_DEPRECATED/external_task_api_client/handle_bpmn_error.js +++ b/test/4_DEPRECATED/external_task_api_client/handle_bpmn_error.js @@ -20,6 +20,7 @@ describe('DEPRECATED - ExternalTask API Client: ExternalTask BPMN Error', () => const workerId = 'handle_bpmn_error_sample_worker'; const topicName = 'external_task_sample_topic'; const errorCode = 'Red alert'; + const errorMessage = 'Red alert'; before(async () => { testFixtureProvider = new TestFixtureProvider(); @@ -45,7 +46,7 @@ describe('DEPRECATED - ExternalTask API Client: ExternalTask BPMN Error', () => await testFixtureProvider .externalTaskApiClient - .handleBpmnError(defaultIdentity, workerId, externalTaskHappyPathTest.id, errorCode); + .handleBpmnError(defaultIdentity, workerId, externalTaskHappyPathTest.id, errorCode, errorMessage); await assertThatErrorHandlingWasSuccessful(externalTaskHappyPathTest.id, errorCode); });
:white_check_mark: Update ExternalTaskClient tests
process-engine_process_engine_runtime
train
js
477a1ec73bad3d4d002ebbed129c356e5e838890
diff --git a/test_aversion.py b/test_aversion.py index <HASH>..<HASH> 100644 --- a/test_aversion.py +++ b/test_aversion.py @@ -1245,6 +1245,8 @@ class FunctionalTest(unittest2.TestCase): self.assertEqual(resp.status_int, 500) self.assertIn("Cannot determine application to serve request", resp.body) + self.assertEqual(req.script_name, '') + self.assertEqual(req.path_info, '/') self.assertPartialDict(req.environ, { 'aversion.config': { 'versions': { @@ -1291,6 +1293,8 @@ class FunctionalTest(unittest2.TestCase): self.assertEqual(resp.status_int, 200) self.assertEqual("version", resp.body) + self.assertEqual(req.script_name, '') + self.assertEqual(req.path_info, '/') self.assertPartialDict(req.environ, { 'aversion.config': { 'versions': {
Test the script_name and path_info are as expected, too.
klmitch_aversion
train
py
a77055ea83cf35629fa0ecab08f594cbe25e46f9
diff --git a/admin/Controller/Update.php b/admin/Controller/Update.php index <HASH>..<HASH> 100644 --- a/admin/Controller/Update.php +++ b/admin/Controller/Update.php @@ -33,7 +33,7 @@ class Update_Controller extends Scaffold_Controller }, $fn ); - $this->$propname = is_array($inlines[$fn]) ? + $this->$propname = !is_object($inlines[$fn]) ? $inlines[$fn][0] : $inlines[$fn]; } diff --git a/core/Finder.php b/core/Finder.php index <HASH>..<HASH> 100644 --- a/core/Finder.php +++ b/core/Finder.php @@ -14,8 +14,21 @@ abstract class Finder implements monolyth\Finder public $view = 'monad\admin\slice/table'; public $stripTags = true; - public abstract function all($size, $page, array $where = [], - array $options = []); + public abstract function all($s, $p, array $w = [], array $o = []); + + public function models($m, $s, $p, array $w = [], array $o = []) + { + $list = []; + $model = isset($m) ? + $m : + str_replace('_Finder', '_Model', get_class($this)); + if ($all = $this->all($s, $p, $w, $o)) { + foreach ($all as $one) { + $list[] = (new $model)->load($one); + } + } + return $list ? $list : new $model; + } public function filters() {
Squashed commit of the following: commit c<I>eca<I>b<I>a2df5f<I>b<I>dd1a8b<I>ec7c<I>a
monomelodies_monad
train
php,php
d3bcf17cdaa6c022446c7efef0b6c0452d331bf1
diff --git a/firebirdsql/fbcore.py b/firebirdsql/fbcore.py index <HASH>..<HASH> 100755 --- a/firebirdsql/fbcore.py +++ b/firebirdsql/fbcore.py @@ -433,7 +433,7 @@ class PreparedStatement: self._xsqlda = parse_xsqlda(buf[i:], self.cur.connection, self.stmt_handle) # TODO: implement later - self.n_input_params = 0 + self.n_input_params = None def __getattr__(self, attrname): if attrname == 'description':
temporary set None to n_input_params (means not implement)
nakagami_pyfirebirdsql
train
py
cd1e6bbe44f6f72d8a45b7b8db976ea1aef31fd1
diff --git a/packages/core/src/textures/Texture.js b/packages/core/src/textures/Texture.js index <HASH>..<HASH> 100644 --- a/packages/core/src/textures/Texture.js +++ b/packages/core/src/textures/Texture.js @@ -286,8 +286,8 @@ export default class Texture extends EventEmitter * The source can be - frame id, image url, video url, canvas element, video element, base texture * * @static - * @param {number|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} - * source - Source to create texture from + * @param {number|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source + * Source to create texture from * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options. * @return {PIXI.Texture} The newly created texture */ diff --git a/packages/text/src/Text.js b/packages/text/src/Text.js index <HASH>..<HASH> 100644 --- a/packages/text/src/Text.js +++ b/packages/text/src/Text.js @@ -43,7 +43,7 @@ export default class Text extends Sprite canvas.width = 3; canvas.height = 3; - const texture = Texture.from(canvas, settings.SCALE_MODE, 'text'); + const texture = Texture.from(canvas); texture.orig = new Rectangle(); texture.trim = new Rectangle();
Fixes texture construction in Text (#<I>)
pixijs_pixi.js
train
js,js
ed2589b3a4064cd81b6f0233c75dcf1c5fde3826
diff --git a/src/controllers/UserAjax.php b/src/controllers/UserAjax.php index <HASH>..<HASH> 100755 --- a/src/controllers/UserAjax.php +++ b/src/controllers/UserAjax.php @@ -102,6 +102,7 @@ class UserAjax extends \erdiko\core\AjaxController if ($this->checkAuth("write", $var)) { // load action based off of naming conventions + header('Content-Type: application/json'); return $this->_autoaction($var, 'post'); } else { return $this->getForbbiden($var); @@ -349,7 +350,10 @@ class UserAjax extends \erdiko\core\AjaxController ); try { - $params = json_decode(file_get_contents("php://input")); + $params = json_decode(file_get_contents("php://input")); + if(empty($params)) { + $params = (object) $_REQUEST; + } // Check required fields if((empty($this->id) || ($this->id < 1)) && (empty($params->id) || ($params->id < 1))){
update POST response ; make sure we get POST params
Erdiko_users
train
php
e75d648e21a18385d03a10bfb5a45fb85b09c5ab
diff --git a/coconut/command.py b/coconut/command.py index <HASH>..<HASH> 100644 --- a/coconut/command.py +++ b/coconut/command.py @@ -517,7 +517,15 @@ class cli(object): print(compiled) if isolate: # isolate means header is included, and thus encoding must be removed compiled = rem_encoding(compiled) - self.runner.run(compiled, error) + + try: + result = self.runner.run(compiled, True, run_func = eval) + if result != None: + self.console.print(result) + except SyntaxError: + self.runner.run(compiled,error) + except: + traceback.print_exc() def check_runner(self, path=None, isolate=False): """Makes sure there is a runner."""
Made the REPL print expressions to the console, I hope, and I hope git didn't goof up. (By the way, it's Defiantly gits fault and not mine \s)
evhub_coconut
train
py
edacd5eb57ea13accab3097649690ae5f48f421a
diff --git a/lib/faraday/response.rb b/lib/faraday/response.rb index <HASH>..<HASH> 100644 --- a/lib/faraday/response.rb +++ b/lib/faraday/response.rb @@ -61,8 +61,8 @@ module Faraday def finish(env) raise "response already finished" if finished? - @env = Env.from(env) @on_complete_callbacks.each { |callback| callback.call(env) } + @env = Env.from(env) return self end diff --git a/test/env_test.rb b/test/env_test.rb index <HASH>..<HASH> 100644 --- a/test/env_test.rb +++ b/test/env_test.rb @@ -166,6 +166,14 @@ class ResponseTest < Faraday::TestCase end end + def test_body_is_parsed_on_finish + response = Faraday::Response.new + response.on_complete { |env| env[:body] = env[:body].upcase } + response.finish(@env) + + assert_equal "YIKES", response.body + end + def test_not_success assert [email protected]? end
Fix response not changing with parallel requests In this order the @env would not be changed by the "on complete" callbacks, meaning that the response would not change after parallel requests finish (e.g. JSON would not be parsed). This would work def on_complete(env) env[:body].upcase! end But this wouldn't def on_complete(env) env[:body] = env[:body].upcase end
lostisland_faraday
train
rb,rb
9742625718ad651113ed5f2858a318a1521a1a19
diff --git a/stripe/__init__.py b/stripe/__init__.py index <HASH>..<HASH> 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -42,7 +42,7 @@ if not _httplib: # Require version 0.8.8, but don't want to depend on distutils version = requests.__version__ major, minor, patch = [int(i) for i in version.split('.')] - except: + except Exception: # Probably some new-fangled version, so it should support verify pass else:
Fix too-broad except clause. This is Python best-practice. It's important not to catch things like KeyboardInterrupt (Ctrl-C).
stripe_stripe-python
train
py
5eca0d58a3777d3c8432bddfc71c38e36ae0eb56
diff --git a/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js b/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js +++ b/src/frontend/org/voltdb/dbmonitor/js/voltdb.admin.ui.js @@ -1610,8 +1610,8 @@ function loadAdminPage() { } } - adminDOMObjects.queryTimeout.text(adminConfigValues.queryTimeout != "" ? adminConfigValues.queryTimeout : ""); - adminDOMObjects.queryTimeoutLabel.text(adminConfigValues.queryTimeout != "" ? "ms" : ""); + adminDOMObjects.queryTimeout.text(adminConfigValues.queryTimeout != null ? adminConfigValues.queryTimeout : ""); + adminDOMObjects.queryTimeoutLabel.text(adminConfigValues.queryTimeout != null ? "ms" : ""); adminEditObjects.tBoxQueryTimeoutValue = adminConfigValues.queryTimeout; };
Modified code to display zero value of "Query time out".
VoltDB_voltdb
train
js
c10f2e0426323d68c2347d10aa365a59a53bbee4
diff --git a/Entity/User.php b/Entity/User.php index <HASH>..<HASH> 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -169,7 +169,7 @@ class User implements \Serializable, AdvancedUserInterface $this->id, $this->email, $this->password, - $this->salt, + $this->salt ) = unserialize($serialized); }
Remove trailing comma in User::unserialize().
DarvinStudio_DarvinUserBundle
train
php
96f7c79d8ae69aa8025c5ee715361133e134959b
diff --git a/lib/models/bin.js b/lib/models/bin.js index <HASH>..<HASH> 100644 --- a/lib/models/bin.js +++ b/lib/models/bin.js @@ -83,7 +83,7 @@ module.exports = Observable.extend({ this.store.getVisibility(bin, fn); }, getBinMetadata: function(bin, fn) { - this.store.getBinOwner(bin, fn); + this.store.getBinMetadata(bin, fn); }, setBinVisibility: function(bin, value, fn) { this.store.setBinVisibility(bin, value, fn);
Updating reference to getBinOwner
jsbin_jsbin
train
js
338ab76c9ada8a42c50482b0dfef80007b967158
diff --git a/interact.js b/interact.js index <HASH>..<HASH> 100644 --- a/interact.js +++ b/interact.js @@ -4127,7 +4127,7 @@ * Gets or sets the function used to check action to be performed on * pointerDown * - - checker (function | null) #optional A function which takes a pointer event, defaultAction string and an interactable as parameters and returns an object with name property 'drag' 'resize' or 'gesture' and optionally an axis 'x', 'y', or 'xy'; or null. + - checker (function | null) #optional A function which takes a pointer event, defaultAction string, interactable, element and interaction as parameters and returns an object with name property 'drag' 'resize' or 'gesture' and optionally an axis 'x', 'y', or 'xy'; or null. = (Function | Interactable) The checker function or this Interactable * | interact('.resize-horiz').actionChecker(function (defaultAction, interactable) {
Update Interactable#actionChecker doc comments
taye_interact.js
train
js
a2a0e079c599c1170383a484c4d01f70adddf8d8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( license='ISC', packages=find_packages(), include_package_data=True, - # long_description=open('README.rst').read(), + long_description=open('README.rst').read(), install_requires=open('requirements.txt').read().splitlines()[:-1] + ['suds-py3==1.0.0.0'], dependency_links=(
Use README as long_description
WhyNotHugo_django-afip
train
py
ba2b83abeb2348b01e6d0a574ad7270053530e6d
diff --git a/test/src/test/java/io/atomix/copycat/test/ClusterTest.java b/test/src/test/java/io/atomix/copycat/test/ClusterTest.java index <HASH>..<HASH> 100644 --- a/test/src/test/java/io/atomix/copycat/test/ClusterTest.java +++ b/test/src/test/java/io/atomix/copycat/test/ClusterTest.java @@ -82,7 +82,7 @@ public class ClusterTest extends ConcurrentTestCase { } await(30000, 1000); - // Sleep for 10 seconds to allow log compaction to take place. + // Sleep for 5 seconds to allow log compaction to take place. Thread.sleep(5000); // Verify that all values are present. @@ -103,6 +103,9 @@ public class ClusterTest extends ConcurrentTestCase { Member m3 = nextMember(); createServer(members, m3).open().get(); + // Sleep for 5 seconds to allow clients to locate the new servers. + Thread.sleep(5000); + // Iterate through the old servers and shut them down one by one. for (CopycatServer server : servers) { server.close().join();
Ensure clients have time to locate new servers in cluster tests.
atomix_copycat
train
java
9853705ed69eb3433006e4635a27c90d7217335f
diff --git a/spec/parsi-date/constants_spec.rb b/spec/parsi-date/constants_spec.rb index <HASH>..<HASH> 100644 --- a/spec/parsi-date/constants_spec.rb +++ b/spec/parsi-date/constants_spec.rb @@ -14,7 +14,7 @@ describe "Date constants" do it "defines ABBR_MONTHNAMES" do Parsi::Date::ABBR_MONTHNAMES.should == [nil] + - %w(far ord kho tir mor sha meh abn azr dey bah esf) + %w(far ord kho tir mor sha meh abn azr day bah esf) end it "defines DAYNAMES" do
fixed a typo in short name of <I>th month
hzamani_parsi-date
train
rb
125074ab6e69ce983d629f5284733d765cd7ed2e
diff --git a/store/store.go b/store/store.go index <HASH>..<HASH> 100644 --- a/store/store.go +++ b/store/store.go @@ -293,15 +293,16 @@ func (s *Store) Close(wait bool) error { if err := s.db.Close(); err != nil { return err } - if err := s.boltStore.Close(); err != nil { - return err - } f := s.raft.Shutdown() if wait { if e := f.(raft.Future); e.Error() != nil { return e.Error() } } + // Only shutdown Bolt when Raft is done with it. + if err := s.boltStore.Close(); err != nil { + return err + } return nil }
Only shutdown BoltDB when Raft is done with it
rqlite_rqlite
train
go
58b1fe20f6c58e46fd528c037c0a2888c56ef024
diff --git a/js/src/files-mfs.js b/js/src/files-mfs.js index <HASH>..<HASH> 100644 --- a/js/src/files-mfs.js +++ b/js/src/files-mfs.js @@ -331,7 +331,7 @@ module.exports = (common) => { }) // TODO enable this test when this feature gets released on go-ipfs - it('stat withLocal dir', function (done) { + it.skip('stat withLocal dir', function (done) { if (!withGo) { console.log('Not supported in js-ipfs yet') this.skip()
fix: go-ipfs has not shipped withLocal yet
ipfs_interface-js-ipfs-core
train
js
89f968b96a728d3119eb125270f434a73a1979bc
diff --git a/test/coverage.spec.js b/test/coverage.spec.js index <HASH>..<HASH> 100644 --- a/test/coverage.spec.js +++ b/test/coverage.spec.js @@ -22,7 +22,7 @@ module.exports.addTests = function({testRunner, expect}) { describe('JSCoverage', function() { it('should work', async function({page, server}) { await page.coverage.startJSCoverage(); - await page.goto(server.PREFIX + '/jscoverage/simple.html'); + await page.goto(server.PREFIX + '/jscoverage/simple.html', {waitUntil: 'networkidle0'}); const coverage = await page.coverage.stopJSCoverage(); expect(coverage.length).toBe(1); expect(coverage[0].url).toContain('/jscoverage/simple.html');
test: try to fix CSS coverage flakes on win (#<I>)
GoogleChrome_puppeteer
train
js
891a9fa47fa08a5541fc3d733324aac81c45e898
diff --git a/logfile-grunt.js b/logfile-grunt.js index <HASH>..<HASH> 100644 --- a/logfile-grunt.js +++ b/logfile-grunt.js @@ -11,17 +11,27 @@ module.exports = function (grunt, options) { var fs = require('fs'); var hooker = require('hooker'); + + // Help to correct Windows paths. + var unixifyPath = function (filepath) { + if (process.platform === 'win32') { + return filepath.replace(/\\/g, '/'); + } else { + return filepath; + } + }; + // Honor the no-write option. var nowrite = grunt.option('no-write'); // Validate parameters and set to defaults. options = options || {}; - options.filePath = options.filePath || './logs/grunt.log'; + options.filePath = unixifyPath(options.filePath || './logs/grunt.log'); options.clearLogFile = !!options.clearLogFile || false; if (!nowrite) { - grunt.log.writeln('Grunt task output will also be logged to ' + options.filePath); + grunt.log.writeln('Grunt and task output will also be logged to ' + options.filePath); // Create the file if it does not exist, Grunt creates the directories and everything for us. if (!grunt.file.exists(options.filePath)) {
Better handling of Windows paths Stole function from the contrib projects to correct paths when using Windows separators.
brutaldev_logfile-grunt
train
js
c07d457cac35405f8946c83e41df34a29f280a74
diff --git a/core/toolbox.js b/core/toolbox.js index <HASH>..<HASH> 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -372,6 +372,9 @@ Blockly.Toolbox.CategoryMenu.prototype.populate = function(domTree) { return; } + // Remove old categories + this.dispose(); + this.createDom(); var categories = []; // Find actual categories from the DOM tree. for (var i = 0, child; child = domTree.childNodes[i]; i++) { diff --git a/core/workspace_svg.js b/core/workspace_svg.js index <HASH>..<HASH> 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -1438,7 +1438,6 @@ Blockly.WorkspaceSvg.prototype.updateToolbox = function(tree) { } this.options.languageTree = tree; this.toolbox_.populate_(tree); - this.toolbox_.addColour_(); } else { if (!this.flyout_) { throw 'Existing toolbox has categories. Can\'t change mode.'; @@ -1446,6 +1445,7 @@ Blockly.WorkspaceSvg.prototype.updateToolbox = function(tree) { this.options.languageTree = tree; this.flyout_.show(tree.childNodes); } + this.toolbox_.position(); }; /**
Fix updateToolbox I think this method broke in a merge. We are recreating the category DOM element on init, but this seems to be the simplest solution for now.
LLK_scratch-blocks
train
js,js
3ac1126ee5988222244f0844c2e8ca7ca72c478f
diff --git a/indra/tests/test_trips.py b/indra/tests/test_trips.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_trips.py +++ b/indra/tests/test_trips.py @@ -223,3 +223,17 @@ def test_simple_decrease(): assert_if_hgnc_then_up(st) assert_grounding_value_or_none(st) assert st.evidence + + +@attr('webservice', 'slow') +def test_no_shared_objects(): + """Make sure shared objects are not being created between statements""" + texts = ('MEK binds ERK and RAF', + 'HEDGEHOG activates GLI1 and BCL2', + 'RAF phosphorylates MEK and ALG-2') + for text in texts: + tp = trips.process_text(text) + stmts = tp.statements + assert len(stmts) == 2 + stmt1, stmt2 = stmts + assert stmt1.evidence[0] is not stmt2.evidence[0]
added test documenting that trips processor can create shared objects
sorgerlab_indra
train
py
c8d0eadc8040ddbe87cfd9eab3cb8e8dd458c682
diff --git a/src/adapters/local.js b/src/adapters/local.js index <HASH>..<HASH> 100644 --- a/src/adapters/local.js +++ b/src/adapters/local.js @@ -4,6 +4,7 @@ var junk = require('junk'); var BaseAdapter = require(__dirname + '/../base_adapter'); var LocalAdapter = function(config, fs, glob, md5) { + BaseAdapter.apply(this, arguments); this.uploadPath = config.retrieve().options.uploadPath; this.fs = fs; this.glob = glob;
Update local adapter to call the pseudo parent constructor.
bitbinio_bitbin
train
js
331f16a55c2300a63a23ddee39b49f166ec7dcdd
diff --git a/lib/docker-sync/sync_manager.rb b/lib/docker-sync/sync_manager.rb index <HASH>..<HASH> 100644 --- a/lib/docker-sync/sync_manager.rb +++ b/lib/docker-sync/sync_manager.rb @@ -45,7 +45,7 @@ module Docker_Rsync @config_syncs.each do |name, config| @config_syncs[name]['config_path'] = @config_path # expand the sync source to remove ~ and similar expressions in the path - @config_syncs[name]['src'] = File.expand_path(@config_syncs[name]['src']) + @config_syncs[name]['src'] = File.expand_path(@config_syncs[name]['src'], File.dirname(DockerSyncConfig::project_config_path)) # set the global verbose setting, if the sync-endpoint does not define a own one unless config.key?('verbose')
[BUGFIX] Relative path should be from config file
EugenMayer_docker-sync
train
rb
c73dd8dc0cc942dc28ee64f9264e630092cf3a2b
diff --git a/src/data/parser.js b/src/data/parser.js index <HASH>..<HASH> 100644 --- a/src/data/parser.js +++ b/src/data/parser.js @@ -27,8 +27,10 @@ function groupsFactory() { list.push(groups) } if (group) { - groups.add(group) + group._list = groups group.resolve() + + groups.add(group) } }, groups: function() {
Resolve elements on parse
spirit_spirit
train
js
f76086c1900bce156291e2180827570477342f70
diff --git a/tweepy/error.py b/tweepy/error.py index <HASH>..<HASH> 100644 --- a/tweepy/error.py +++ b/tweepy/error.py @@ -13,7 +13,7 @@ class TweepError(Exception): self.reason = six.text_type(reason) self.response = response self.api_code = api_code - Exception.__init__(self, reason) + super(TweepError, self).__init__(self, reason) def __str__(self): return self.reason
Use super in TweepError initialization
tweepy_tweepy
train
py
3aef18e2f07a2a20ad29dcec347045832a85e9d0
diff --git a/lib/http/compat/curb.rb b/lib/http/compat/curb.rb index <HASH>..<HASH> 100644 --- a/lib/http/compat/curb.rb +++ b/lib/http/compat/curb.rb @@ -78,7 +78,7 @@ module Curl return if @done @clients.map do |client| - Thread.new { client.http_get } + Thread.new { client.perform } end.each(&:join) @done = true
Just perform the request in a thread
httprb_http
train
rb
1f2bc93c56135a5966cb500c01c4a7f09fe33b7e
diff --git a/openquake/calculators/tests/event_based_risk_test.py b/openquake/calculators/tests/event_based_risk_test.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/tests/event_based_risk_test.py +++ b/openquake/calculators/tests/event_based_risk_test.py @@ -144,7 +144,7 @@ class EventBasedRiskTestCase(CalculatorTestCase): check_platform('xenial') self.assert_stats_ok(case_master, 'job.ini') fname = writetmp(view('portfolio_loss', self.calc.datastore)) - self.assertEqualFiles('expected/portfolio_loss.txt', fname) + self.assertEqualFiles('expected/portfolio_loss.txt', fname, delta=1E-5) @attr('qa', 'risk', 'event_based_risk') def test_case_miriam(self): @@ -196,4 +196,5 @@ class EventBasedRiskTestCase(CalculatorTestCase): self.assertEqualFiles('expected/%s' % strip_calc_id(fname), fname) fname = writetmp(view('portfolio_loss', self.calc.datastore)) - self.assertEqualFiles('expected/portfolio_loss_ebr.txt', fname) + self.assertEqualFiles( + 'expected/portfolio_loss_ebr.txt', fname, delta=1E-5)
Relaxed the case_master tests with a delta of 1E-5
gem_oq-engine
train
py
8921d8bfffec070d20fd11660cb7f0c0f66775d0
diff --git a/src/frontend/org/voltdb/dtxn/SimpleDtxnInitiator.java b/src/frontend/org/voltdb/dtxn/SimpleDtxnInitiator.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/dtxn/SimpleDtxnInitiator.java +++ b/src/frontend/org/voltdb/dtxn/SimpleDtxnInitiator.java @@ -176,7 +176,13 @@ public class SimpleDtxnInitiator extends TransactionInitiator { if (invocation.getType() == ProcedureInvocationType.REPLICATED) { - if (invocation.getOriginalTxnId() <= m_lastSeenOriginalTxnId) + /* + * Ning - @LoadSinglepartTable and @LoadMultipartTable always have + * the same txnId which is the txnId of the snapshot. + */ + if (!(invocation.getProcName().equalsIgnoreCase("@LoadSinglepartitionTable") || + invocation.getProcName().equalsIgnoreCase("@LoadMultipartitionTable")) && + invocation.getOriginalTxnId() <= m_lastSeenOriginalTxnId) { hostLog.info("Dropping duplicate replicated transaction, txnid: " + invocation.getOriginalTxnId() + ", last seen: " + m_lastSeenOriginalTxnId); return false;
Allow @LoadSinglepartTable and @LoadMultipartTable with the same txnId on the secondary. They'll all have the same txnId, which is the snapshot txnId.
VoltDB_voltdb
train
java
6b0884a6c6e6a82e3b6cef67a337291809d5ba68
diff --git a/chef/spec/unit/cache/checksum_spec.rb b/chef/spec/unit/cache/checksum_spec.rb index <HASH>..<HASH> 100644 --- a/chef/spec/unit/cache/checksum_spec.rb +++ b/chef/spec/unit/cache/checksum_spec.rb @@ -70,4 +70,22 @@ describe Chef::Cache::Checksum do @cache.checksum_for_file(fixture_file).should == expected end + it "generates a key from a file name" do + file = "/this/is/a/test/random.rb" + @cache.generate_key(file).should == "chef-file--this-is-a-test-random-rb" + end + + it "generates a key from a file name and group" do + file = "/this/is/a/test/random.rb" + @cache.generate_key(file, "spec").should == "spec-file--this-is-a-test-random-rb" + end + + it "returns a cached checksum value using a user defined key" do + key = @cache.generate_key("riseofthemachines", "specs") + @cache.moneta[key] = {"mtime" => "12345", "checksum" => "123abc"} + fstat = mock("File.stat('riseofthemachines')", :mtime => Time.at(12345)) + File.should_receive(:stat).with("riseofthemachines").and_return(fstat) + @cache.checksum_for_file("riseofthemachines", key).should == "123abc" + end + end
CHEF-<I>: Add specs covering changes to checksum.
chef_chef
train
rb
bd004bfa3265b28aa833cd951e0c47ca37d80f7b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,10 @@ version = '0.3.2' classifiers = ["Development Status :: 4 - Beta", "Environment :: Plugins", "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", "License :: OSI Approved :: Apache Software License", "Topic :: Software Development :: Testing"]
Note Python 3 support in setup.py
codecov_codecov-python
train
py
01102edf916db87817ec6474c2030735448733d1
diff --git a/lib/db/indexing_db_mock.js b/lib/db/indexing_db_mock.js index <HASH>..<HASH> 100644 --- a/lib/db/indexing_db_mock.js +++ b/lib/db/indexing_db_mock.js @@ -46,6 +46,7 @@ _.extend(IndexingTestDb.prototype, Db.prototype, { readFromIndex: function(collection, options, cb) { this.store().getItem(options.indexKey, function(err, items) { + if (err) return cb(err); if (!items) { return cb(null, []); } @@ -61,7 +62,7 @@ _.extend(IndexingTestDb.prototype, Db.prototype, { }); }); collection.set(models, options); - return cb(err, models); + return cb(null, models); }); },
IndexingTestDb: cleaner error propagation in readFromIndex This should not matter with the mock store, but just to be sure.
Everyplay_serverbone
train
js
4b1cc42872b8a0b2edea73fec3b0d3581bee9f22
diff --git a/spec/request_spec.js b/spec/request_spec.js index <HASH>..<HASH> 100644 --- a/spec/request_spec.js +++ b/spec/request_spec.js @@ -75,11 +75,11 @@ describe('Request', function () { subject = navigator.getRequest('/snap', queryString, route); }); - it('handles it gracefully', function () { + it('includes the valid params', function () { expect( subject.queryParams['bros'] ).toBe( 'keith' ); }); - it('handles it gracefully', function () { + it('does not include invalid params', function () { expect( Object.keys(subject.queryParams).length ).toBe( 1 ); }); });
better name for specs checking invalid query param strings
swipely_aviator
train
js
99228937a8f1498d9a286e4a9443755931d5a2aa
diff --git a/test/02_platform.js b/test/02_platform.js index <HASH>..<HASH> 100644 --- a/test/02_platform.js +++ b/test/02_platform.js @@ -178,7 +178,7 @@ describe('WirelessTagPlatform:', function() { // skip this if we don't have connection information if (credentialsMissing) return this.skip(); - expect(Date.now() - startTime).to.be.above(60); + expect(Date.now() - startTime).to.be.above(35); }); it('should emit \'discover\' event when not cached', function() { // skip this if we don't have connection information
Lowers expected minimum duration for API call Apparently on some hosting platforms the minimum time for a call to the Wireless Tag JSON API is much less than on others. Perhaps it is for those hosted in the same cloud as the API server, i.e., AWS.
hlapp_wirelesstags-js
train
js
5eb4631936ab775e96a83fd1a7486803d0a16edc
diff --git a/src/Guzzle/Http/QueryString.php b/src/Guzzle/Http/QueryString.php index <HASH>..<HASH> 100644 --- a/src/Guzzle/Http/QueryString.php +++ b/src/Guzzle/Http/QueryString.php @@ -46,7 +46,7 @@ class QueryString extends Collection { $q = new static(); - if (0 !== strlen($query)) { + if ($query || $query === '0') { if ($query[0] == '?') { $query = substr($query, 1); } @@ -54,12 +54,11 @@ class QueryString extends Collection $parts = explode('=', $kvp, 2); $key = rawurldecode($parts[0]); - $paramIsPhpStyleArray = substr($key, -2) == '[]'; - if ($paramIsPhpStyleArray) { + if ($paramIsPhpStyleArray = substr($key, -2) == '[]') { $key = substr($key, 0, -2); } - if (array_key_exists(1, $parts)) { + if (isset($parts[1])) { $value = rawurldecode(str_replace('+', '%20', $parts[1])); if ($paramIsPhpStyleArray && !$q->hasKey($key)) { $value = array($value);
Minor tweaks to QueryString::fromString
guzzle_guzzle3
train
php
cf7351f9d3e2602bb6ba9d735b85a2722b1abfe2
diff --git a/src/query.js b/src/query.js index <HASH>..<HASH> 100644 --- a/src/query.js +++ b/src/query.js @@ -291,8 +291,10 @@ module.exports = function(AV) { * scan a Query. masterKey required. * * @since 2.1.0 - * @param {String} orderedBy - * @param {Number} batchSize + * @param {object} [options] + * @param {string} [options.orderedBy] specify the key to sort + * @param {number} [options.batchSize] specify the batch size for each request + * @param {AuthOptions} [authOptions] * @return {AsyncIterator.<AV.Object>} * @example const scan = new AV.Query(TestClass).scan({ * orderedBy: 'objectId',
docs(Query): fix the params for #scan
leancloud_javascript-sdk
train
js
f481743d34c20ac6a5a239fc994dcecdffa890fa
diff --git a/app/controllers/google_sign_in/authorizations_controller.rb b/app/controllers/google_sign_in/authorizations_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/google_sign_in/authorizations_controller.rb +++ b/app/controllers/google_sign_in/authorizations_controller.rb @@ -1,6 +1,8 @@ require 'securerandom' class GoogleSignIn::AuthorizationsController < GoogleSignIn::BaseController + skip_forgery_protection only: :create + def create redirect_to login_url(scope: 'openid profile email', state: state), flash: { proceed_to: params.require(:proceed_to), state: state }
Skip forgery protection on POST /authorization Due to some issues with Rails sessions expiry time and browsers restoring open pages/tabs with stale CSRF tokens but expired sessions (see <URL>), posting to /authorization fails for some users due to failed CSRF checks. Since this endpoint simply redirects to initiate the Google OAuth flow, there's nothing to be compromised by forging that request. It's similar to disabling CSRF protection on login.
basecamp_google_sign_in
train
rb
090f01bd60209252c57ec76cbbe8b3168e455ddd
diff --git a/wkhtmltopdf.go b/wkhtmltopdf.go index <HASH>..<HASH> 100644 --- a/wkhtmltopdf.go +++ b/wkhtmltopdf.go @@ -254,7 +254,11 @@ func (pdfg *PDFGenerator) run() error { err := cmd.Run() if err != nil { - return errors.New(errbuf.String()) + errStr := errbuf.String() + if strings.TrimSpace(errStr) == "" { + errStr = err.Error() + } + return errors.New(errStr) } return nil }
also check for cmd.Run errors
SebastiaanKlippert_go-wkhtmltopdf
train
go
c308d39a1cf67d8def196cf1a01e9f3cbb443e61
diff --git a/plenum/server/node.py b/plenum/server/node.py index <HASH>..<HASH> 100644 --- a/plenum/server/node.py +++ b/plenum/server/node.py @@ -1312,8 +1312,10 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage, *reqKey, self.reasonForClientFromException( message.reason)) - self.transmitToClient(reject, self.requestSender[reqKey]) - self.doneProcessingReq(*reqKey) + # TODO: What the case when reqKey will be not in requestSender dict + if reqKey in self.requestSender: + self.transmitToClient(reject, self.requestSender[reqKey]) + self.doneProcessingReq(*reqKey) elif isinstance(message, Exception): self.processEscalatedException(message) else:
[INDY-<I>] Hot fix for KeyError exception (#<I>)
hyperledger_indy-plenum
train
py
2f7f31e39244c63c9f62a47456b882d1f5fdaf17
diff --git a/multiqc/modules/custom_content/custom_content.py b/multiqc/modules/custom_content/custom_content.py index <HASH>..<HASH> 100644 --- a/multiqc/modules/custom_content/custom_content.py +++ b/multiqc/modules/custom_content/custom_content.py @@ -279,8 +279,9 @@ def _find_file_header(f): hconfig = None try: hconfig = yaml.load("\n".join(hlines)) - except yaml.YAMLError: - log.debug("Could not parse comment file header for MultiQC custom content: {}".format(f['fn'])) + except yaml.YAMLError as e: + log.warn("Could not parse comment file header for MultiQC custom content: {}".format(f['fn'])) + log.debug(e) return hconfig def _guess_file_format(f):
Custom Content: Throw warning log when YAML parsing doesn't work.
ewels_MultiQC
train
py
34c02692f4a3b07154f5bbda19bdbd68a6651a4f
diff --git a/lib/dekiru/version.rb b/lib/dekiru/version.rb index <HASH>..<HASH> 100644 --- a/lib/dekiru/version.rb +++ b/lib/dekiru/version.rb @@ -1,3 +1,3 @@ module Dekiru - VERSION = '0.1.2' + VERSION = '0.1.3' end
bumped to <I>
mataki_dekiru
train
rb
df8ccb46964269ef26096244517666fc9cd5bb48
diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerManager.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerManager.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerManager.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerManager.php @@ -6,6 +6,7 @@ use Symfony\Components\HttpKernel\LoggerInterface; use Symfony\Components\HttpKernel\Controller\ControllerManagerInterface; use Symfony\Components\HttpKernel\HttpKernelInterface; use Symfony\Components\HttpFoundation\Request; +use Symfony\Components\EventDispatcher\Event; use Symfony\Components\DependencyInjection\ContainerInterface; /* @@ -191,7 +192,8 @@ class ControllerManager implements ControllerManagerInterface */ public function getMethodArguments(Request $request, $controller) { - $path = $request->path->all(); + $event = $this->container->get('event_dispatcher')->filter(new Event($this, 'controller_manager.filter_controller_arguments', array('controller' => $controller, 'request' => $request)), $request->path->all()); + $path = $event->getReturnValue(); list($controller, $method) = $controller;
[FrameworkBundle] added an event to filter the controller arguments
symfony_symfony
train
php
df1b4947f1fd81acf5bd8a8a2d33fa1dcbd2a249
diff --git a/lib/normalizer.js b/lib/normalizer.js index <HASH>..<HASH> 100644 --- a/lib/normalizer.js +++ b/lib/normalizer.js @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 -let _ = require('lodash'); -let FieldError = require('./field-error'); +const _ = require('lodash'); +const FieldError = require('./field-error'); /** * Class containing handlers to normalize an object according to a schema. Instantiated in @@ -16,7 +16,7 @@ let FieldError = require('./field-error'); */ class Normalizer { - constructor(schema, options) { + constructor(schema, options = {}) { this.schema = schema; this.options = options; this.fieldErrors = [];
Nits are pickles, too.
zipscene_common-schema
train
js
d4c180376e019a6662f3dedc049ab2d800a25800
diff --git a/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java b/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java index <HASH>..<HASH> 100644 --- a/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java +++ b/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java @@ -585,8 +585,11 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig TimerStartEventJobHandler timerStartEvent = new TimerStartEventJobHandler(); jobHandlers.put(timerStartEvent.getType(), timerStartEvent); - for (JobHandler customJobHandler : getCustomJobHandlers()) { - jobHandlers.put(customJobHandler.getType(), customJobHandler); + // if we have custom job handlers, register them + if (getCustomJobHandlers()!=null) { + for (JobHandler customJobHandler : getCustomJobHandlers()) { + jobHandlers.put(customJobHandler.getType(), customJobHandler); + } } jobExecutor.setCommandExecutor(commandExecutorTxRequired);
fixed NPE with custom job handlers
camunda_camunda-bpm-platform
train
java
f35f43de421de455c6a650525cd3cec45bfe4573
diff --git a/respite/urls.py b/respite/urls.py index <HASH>..<HASH> 100644 --- a/respite/urls.py +++ b/respite/urls.py @@ -34,7 +34,7 @@ def resource(prefix, views, actions=['index', 'show', 'edit', 'update', 'new', ' """ # Return HTTP 405 Method Not Allowed if no function is mapped to the request method - if not locals()[request.method]: + if not request.method in locals(): allowed_methods = [] if GET:
Fix a bug that caused a KeyError upon receiving requests whose methods were not GET, POST, PUT or DELETE
jgorset_django-respite
train
py
4561fe6d305e6a39a10bb9d06710edff1db74a42
diff --git a/packages/openneuro-server/src/graphql/resolvers/snapshots.js b/packages/openneuro-server/src/graphql/resolvers/snapshots.js index <HASH>..<HASH> 100644 --- a/packages/openneuro-server/src/graphql/resolvers/snapshots.js +++ b/packages/openneuro-server/src/graphql/resolvers/snapshots.js @@ -32,7 +32,7 @@ export const snapshot = (obj, { datasetId, tag }, context) => { ) } -export const participantCount = async () => { +export const participantCount = async (obj, { modality }) => { const aggregateResult = await DatasetModel.aggregate([ { $match: {
Confirm modality param in participantCount.
OpenNeuroOrg_openneuro
train
js
2441961a3432584fba879d87310ea9d8c27042eb
diff --git a/lib/vagrant/communication/ssh.rb b/lib/vagrant/communication/ssh.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/communication/ssh.rb +++ b/lib/vagrant/communication/ssh.rb @@ -172,7 +172,8 @@ module Vagrant # Determine the shell to execute. If we are using `sudo` then we # need to wrap the shell in a `sudo` call. - shell = "sudo -H #{@vm.config.ssh.shell}" if sudo + shell = @vm.config.ssh.shell + shell = "sudo -H #{shell}" if sudo # Open the channel so we can execute or command channel = connection.open_channel do |ch|
Fix bug where SSH didn't work properly Forgot to set the `shell` variable properly
hashicorp_vagrant
train
rb
8f0d0ddc12ca04d6e93a0bc9556ed9e8cb139eb6
diff --git a/src/Chip/Chip.js b/src/Chip/Chip.js index <HASH>..<HASH> 100644 --- a/src/Chip/Chip.js +++ b/src/Chip/Chip.js @@ -12,6 +12,7 @@ export const styles = (theme: Object) => { const height = 32; const backgroundColor = emphasize(theme.palette.background.default, 0.12); const deleteIconColor = fade(theme.palette.text.primary, 0.26); + return { root: { fontFamily: theme.typography.fontFamily, @@ -33,6 +34,8 @@ export const styles = (theme: Object) => { padding: 0, // Remove `button` padding }, clickable: { + // Remove grey highlight + WebkitTapHighlightColor: theme.palette.common.transparent, cursor: 'pointer', '&:hover, &:focus': { backgroundColor: emphasize(backgroundColor, 0.08), @@ -67,6 +70,8 @@ export const styles = (theme: Object) => { cursor: 'inherit', }, deleteIcon: { + // Remove grey highlight + WebkitTapHighlightColor: theme.palette.common.transparent, color: deleteIconColor, cursor: 'pointer', height: 'auto',
[Chip] Remove highlight on Android and iOS (#<I>)
mui-org_material-ui
train
js
80ec8cf4e92cabb42013fbbddb42dd53e7265855
diff --git a/masonite/request.py b/masonite/request.py index <HASH>..<HASH> 100644 --- a/masonite/request.py +++ b/masonite/request.py @@ -215,9 +215,12 @@ class Request(Extendable): if isinstance(variables, str): variables = parse_qs(variables) - for name in variables.keys(): - value = self._get_standardized_value(variables[name]) - self.request_variables[name.replace('[]', '')] = value + try: + for name in variables.keys(): + value = self._get_standardized_value(variables[name]) + self.request_variables[name.replace('[]', '')] = value + except TypeError: + self.request_variables = {} def _get_standardized_value(self, value): """Get the standardized value based on the type of the value parameter
fixed issue where an exception was thrown is request had no request variables
MasoniteFramework_masonite
train
py
1ac3807782a5d0993882d45a8fe9504f7feb6c04
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -49,6 +49,10 @@ type ServerCtx struct { // Start time for the request processing. Time time.Time + // Cache for arbitrary data, which may be used by RequestHandler. + // Cache contents may survive across requests. + Cache interface{} + logger ctxLogger s *Server c remoteAddrer
Added cache for RequestHandler data into ServerCtx
valyala_fasthttp
train
go
b23e98327f2e1202ba25f0845c45ca4259d403bb
diff --git a/lib/rubocop/cop/correctors/alignment_corrector.rb b/lib/rubocop/cop/correctors/alignment_corrector.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/correctors/alignment_corrector.rb +++ b/lib/rubocop/cop/correctors/alignment_corrector.rb @@ -19,10 +19,12 @@ module RuboCop expr = node.respond_to?(:loc) ? node.loc.expression : node return if block_comment_within?(expr) + heredoc_ranges = heredoc_ranges(node) + lambda do |corrector| each_line(expr) do |line_begin_pos| autocorrect_line(corrector, line_begin_pos, expr, column_delta, - heredoc_ranges(node)) + heredoc_ranges) end end end @@ -74,13 +76,12 @@ module RuboCop starts_with_space = expr.source_buffer.source[line_begin_pos].start_with?(' ') - pos_to_remove = if column_delta.positive? || starts_with_space - line_begin_pos - else - line_begin_pos - column_delta.abs - end - range_between(pos_to_remove, pos_to_remove + column_delta.abs) + if starts_with_space + range_between(line_begin_pos, line_begin_pos + column_delta.abs) + else + range_between(line_begin_pos - column_delta.abs, line_begin_pos) + end end def remove(range, corrector)
Refactor Refactor calculate_range; call heredoc_ranges outside of loop
rubocop-hq_rubocop
train
rb
cb1fac88380abef7345ef0ed2e7515e74d0d2dec
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/ErroneousThreadPoolConstructorChecker.java b/core/src/main/java/com/google/errorprone/bugpatterns/ErroneousThreadPoolConstructorChecker.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/ErroneousThreadPoolConstructorChecker.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/ErroneousThreadPoolConstructorChecker.java @@ -64,6 +64,9 @@ public final class ErroneousThreadPoolConstructorChecker extends BugChecker return Description.NO_MATCH; } List<? extends ExpressionTree> arguments = tree.getArguments(); + if (arguments.size() < 2) { + return Description.NO_MATCH; + } Integer corePoolSize = ASTHelpers.constValue(arguments.get(0), Integer.class); Integer maximumPoolSize = ASTHelpers.constValue(arguments.get(1), Integer.class); if (corePoolSize == null || maximumPoolSize == null || corePoolSize.equals(maximumPoolSize)) {
Fix a crash on a test-only redefinition of ThreadPoolExecutor that doesn't have any parameters PiperOrigin-RevId: <I>
google_error-prone
train
java
c1733f0ee979d2866b6296c9c902ff6ad59a23c8
diff --git a/test/python/test_quantumprogram.py b/test/python/test_quantumprogram.py index <HASH>..<HASH> 100644 --- a/test/python/test_quantumprogram.py +++ b/test/python/test_quantumprogram.py @@ -58,7 +58,8 @@ except ImportError: QE_URL = os.environ["QE_URL"] TRAVIS_FORK_PULL_REQUEST = False -if 'TRAVIS_PULL_REQUEST_SLUG' in os.environ: +if ('TRAVIS_PULL_REQUEST_SLUG' in os.environ + and os.environ['TRAVIS_PULL_REQUEST_SLUG']): if os.environ['TRAVIS_REPO_SLUG'] != os.environ['TRAVIS_PULL_REQUEST_SLUG']: TRAVIS_FORK_PULL_REQUEST = True
fix skip test logic (#<I>)
Qiskit_qiskit-terra
train
py
ffe8aa5fe053f595bab3b994576e7e1843c5acf4
diff --git a/lang/fr/moodle.php b/lang/fr/moodle.php index <HASH>..<HASH> 100644 --- a/lang/fr/moodle.php +++ b/lang/fr/moodle.php @@ -442,9 +442,9 @@ $string['helptext'] = 'Comment r $string['helpwiki'] = 'Comment r�diger un texte Wiki'; $string['helpwriting'] = '�crire soigneusement'; $string['hide'] = 'Cacher'; -$string['hiddentopics'] = 'Th�mes cach�s'; -$string['hiddentopicscollapsed'] = 'Th�mes cach�s affich�s sous forme condens�e'; -$string['hiddentopicsinvisible'] = 'Th�mes cach�s invisibles'; +$string['hiddensections'] = 'Sections cach�es'; +$string['hiddensectionscollapsed'] = 'Sections cach�es affich�s sous forme condens�e'; +$string['hiddensectionsinvisible'] = 'Sections cach�es invisibles'; $string['hidepicture'] = 'Cacher l\'image'; $string['hits'] = 'Requ�tes'; $string['hitsoncourse'] = 'Nombre de requ�tes de $a->username sur $a->coursename';
Changed hiddentopics to hiddensections
moodle_moodle
train
php
6c5f4c4d4de36e34b6e86acf92cf0237954edcf6
diff --git a/lxd/daemon.go b/lxd/daemon.go index <HASH>..<HASH> 100644 --- a/lxd/daemon.go +++ b/lxd/daemon.go @@ -484,12 +484,6 @@ func (d *Daemon) Init() error { logger.Warnf("CGroup memory swap accounting is disabled, swap limits will be ignored.") } - /* Initialize the operating system facade */ - err = d.os.Init() - if err != nil { - return err - } - /* Make sure all our directories are available */ if err := os.MkdirAll(shared.VarPath(), 0711); err != nil { return err @@ -531,6 +525,12 @@ func (d *Daemon) Init() error { return err } + /* Initialize the operating system facade */ + err = d.os.Init() + if err != nil { + return err + } + /* Initialize the database */ err = initializeDbObject(d, shared.VarPath("lxd.db")) if err != nil {
d.os.Init must be run after all paths are created
lxc_lxd
train
go
8addfe4d5973dea96e5a6092035026b33413a8b8
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Gateway/EzcDatabase.php b/eZ/Publish/Core/Persistence/Legacy/Content/Gateway/EzcDatabase.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Gateway/EzcDatabase.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Gateway/EzcDatabase.php @@ -140,10 +140,10 @@ class EzcDatabase extends Gateway $q->bindValue( $struct->remoteId ) )->set( $this->dbHandler->quoteColumn( 'modified' ), - $q->bindValue( $struct->modified, null, \PDO::PARAM_INT ) + $q->bindValue( 0, null, \PDO::PARAM_INT ) )->set( $this->dbHandler->quoteColumn( 'published' ), - $q->bindValue( $struct->published, null, \PDO::PARAM_INT ) + $q->bindValue( 0, null, \PDO::PARAM_INT ) )->set( $this->dbHandler->quoteColumn( 'status' ), $q->bindValue( ContentInfo::STATUS_DRAFT, null, \PDO::PARAM_INT )
Fixed: contentobject published and modified for drafts is 0
ezsystems_ezpublish-kernel
train
php
b96bb549c390b0280a131e5a606d490cd049c2f7
diff --git a/uw_sws/enrollment.py b/uw_sws/enrollment.py index <HASH>..<HASH> 100644 --- a/uw_sws/enrollment.py +++ b/uw_sws/enrollment.py @@ -103,14 +103,12 @@ def _json_to_enrollment(json_data, term): ENROLLMENT_SOURCE_PCE) enrollment.unf_pce_courses = {} # dictionary {section_label: UnfinishedPceCourse} - if json_data.get('Registrations') is not None and\ - len(json_data['Registrations']) > 0: - for registration in json_data['Registrations']: - if is_unfinished_pce_course(registration): - unf_pce_course = _json_to_unfinished_pce_course(registration, - term) - key = unf_pce_course.section_ref.section_label() - enrollment.unf_pce_courses[key] = unf_pce_course + for registration in json_data.get('Registrations', []): + if is_unfinished_pce_course(registration): + unf_pce_course = _json_to_unfinished_pce_course(registration, + term) + key = unf_pce_course.section_ref.section_label() + enrollment.unf_pce_courses[key] = unf_pce_course enrollment.majors = [] if json_data.get('Majors') is not None and len(json_data['Majors']) > 0:
refactor: combine if and for statements
uw-it-aca_uw-restclients-sws
train
py
d7801c644cd3e441e2a898339c0b7654936f93a9
diff --git a/packages/babel-node/src/babel-node.js b/packages/babel-node/src/babel-node.js index <HASH>..<HASH> 100755 --- a/packages/babel-node/src/babel-node.js +++ b/packages/babel-node/src/babel-node.js @@ -73,7 +73,12 @@ getV8Flags(function(err, v8Flags) { const kexec = require("kexec"); kexec(process.argv[0], args); } catch (err) { - if (err.code !== "MODULE_NOT_FOUND") throw err; + if ( + err.code !== "MODULE_NOT_FOUND" && + err.code !== "UNDECLARED_DEPENDENCY" + ) { + throw err; + } const child_process = require("child_process"); const proc = child_process.spawn(process.argv[0], args, {
Prevents exception on PnP (#<I>)
babel_babel
train
js
0fa1bbd9dffe0bf71aa94e7a77b34ad6a6039ea7
diff --git a/extended_choices/helpers.py b/extended_choices/helpers.py index <HASH>..<HASH> 100644 --- a/extended_choices/helpers.py +++ b/extended_choices/helpers.py @@ -12,6 +12,10 @@ The documentation format in this file is numpydoc_. from __future__ import unicode_literals from builtins import object # pylint: disable=redefined-builtin +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping from django.utils.functional import Promise @@ -283,6 +287,7 @@ class ChoiceEntry(tuple): # Add additional attributes. if len(tuple_) == 4: + assert isinstance(tuple_[3], Mapping), 'Last argument must be a dict-like object in %s' % (tuple_,) for key, value in tuple_[3].items(): setattr(obj, key, value)
Assert than fourth argument is a dict-like
twidi_django-extended-choices
train
py
7be993b33cac8a0ce31f715903591b182f026eef
diff --git a/gsh/main.py b/gsh/main.py index <HASH>..<HASH> 100644 --- a/gsh/main.py +++ b/gsh/main.py @@ -65,7 +65,7 @@ def parse_cmdline(): parser.add_option('--quick-sh', action='store_true', dest='quick_sh', help='Do not launch a full ssh session') parser.add_option('--abort-errors', action='store_true', dest='abort_error', - help='abort if hosts are failing [by default ignore]') + help='abort if some shell fails to initialize [ignore]') parser.add_option('--debug', action='store_true', dest='debug', help='fill the logs with debug informations') parser.add_option('--profile', action='store_true', dest='profile', diff --git a/gsh/remote_dispatcher.py b/gsh/remote_dispatcher.py index <HASH>..<HASH> 100644 --- a/gsh/remote_dispatcher.py +++ b/gsh/remote_dispatcher.py @@ -206,7 +206,7 @@ class remote_dispatcher(buffered_dispatcher): self.write_buffer = '' self.active = False self.set_enabled(False) - if self.options.abort_error: + if self.options.abort_error and self.state is STATE_NOT_STARTED: raise asyncore.ExitNow def reconnect(self):
Fix --abort-error: exiting after running the command is OK.
innogames_polysh
train
py,py
a0b58990cb1185865bb6a4c3d7eeccb653d946c4
diff --git a/pmml-evaluator/src/main/java/org/jpmml/evaluator/MiningModelEvaluator.java b/pmml-evaluator/src/main/java/org/jpmml/evaluator/MiningModelEvaluator.java index <HASH>..<HASH> 100644 --- a/pmml-evaluator/src/main/java/org/jpmml/evaluator/MiningModelEvaluator.java +++ b/pmml-evaluator/src/main/java/org/jpmml/evaluator/MiningModelEvaluator.java @@ -266,11 +266,17 @@ public class MiningModelEvaluator extends ModelEvaluator<MiningModel> implements } break; case MAX: + { + // The max aggregation function yields a non-probability distribution + result = new ClassificationMap<String>(ClassificationMap.Type.VOTE); + result.putAll(aggregateProbabilities(segmentation, segmentResults)); + } + break; case AVERAGE: case WEIGHTED_AVERAGE: { - // The aggregation operation implicitly converts from probabilities to votes - result = new ClassificationMap<String>(ClassificationMap.Type.VOTE); + // The average and weighted average (with weights summing to 1) aggregation functions yield probability distributions + result = new ProbabilityClassificationMap(); result.putAll(aggregateProbabilities(segmentation, segmentResults)); } break;
Improved the aggregation of classification results. HT: Ryan Riegel <URL>
jpmml_jpmml-evaluator
train
java
9db166e28ed44d01c4c5b64dd8b5b70df14f13f5
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1 @@ -require 'rubygems' -require 'rspec' -require 'bundler/setup' - -$LOAD_PATH.unshift(File.dirname(__FILE__)) -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) - require 'upyun'
Update: kick out useless code in spec_helper
upyun_ruby-sdk
train
rb
e156a58b9543d84ae37adf300819125e4e22ee50
diff --git a/consul/state/tombstone_gc_test.go b/consul/state/tombstone_gc_test.go index <HASH>..<HASH> 100644 --- a/consul/state/tombstone_gc_test.go +++ b/consul/state/tombstone_gc_test.go @@ -27,7 +27,7 @@ func TestTombstoneGC(t *testing.T) { gran := 5 * time.Millisecond gc, err := NewTombstoneGC(ttl, gran) if err != nil { - t.Fatalf("should fail") + t.Fatalf("err: %v", err) } gc.SetEnabled(true) @@ -81,7 +81,7 @@ func TestTombstoneGC_Expire(t *testing.T) { gran := 5 * time.Millisecond gc, err := NewTombstoneGC(ttl, gran) if err != nil { - t.Fatalf("should fail") + t.Fatalf("err: %v", err) } gc.SetEnabled(true)
Cleans up some bad unit test failure cases.
hashicorp_consul
train
go
3da59bc0fb2b0ad0c639b7acc0695c07e6a89eb5
diff --git a/tests/src/test/java/alluxio/security/ClusterInitializationIntegrationTest.java b/tests/src/test/java/alluxio/security/ClusterInitializationIntegrationTest.java index <HASH>..<HASH> 100644 --- a/tests/src/test/java/alluxio/security/ClusterInitializationIntegrationTest.java +++ b/tests/src/test/java/alluxio/security/ClusterInitializationIntegrationTest.java @@ -33,7 +33,7 @@ import org.junit.rules.ExpectedException; /** * Unit tests for starting a cluster when security is enabled. */ -public final class ClusterInitializationTest extends BaseIntegrationTest { +public final class ClusterInitializationIntegrationTest extends BaseIntegrationTest { @Rule public ExpectedException mThrown = ExpectedException.none();
[SMALLFIX] Rename class
Alluxio_alluxio
train
java
61f039ce4b7e4da048b21899bad9131e66010e65
diff --git a/badges/recipients.php b/badges/recipients.php index <HASH>..<HASH> 100644 --- a/badges/recipients.php +++ b/badges/recipients.php @@ -84,7 +84,8 @@ if ($badge->has_manual_award_criteria() && has_capability('moodle/badges:awardba echo $OUTPUT->box($OUTPUT->single_button($url, get_string('award', 'badges')), 'clearfix mdl-align'); } -$sql = "SELECT b.userid, b.dateissued, b.uniquehash, u.firstname, u.lastname +$namefields = get_all_user_name_fields(true, 'u'); +$sql = "SELECT b.userid, b.dateissued, b.uniquehash, $namefields FROM {badge_issued} b INNER JOIN {user} u ON b.userid = u.id WHERE b.badgeid = :badgeid
MDL-<I> badges: retrieve all the name fields when viewing the recipient list
moodle_moodle
train
php
bf493dbc0f9ca279f9190ec2373dd419756907f6
diff --git a/test/test_excel_ui.py b/test/test_excel_ui.py index <HASH>..<HASH> 100644 --- a/test/test_excel_ui.py +++ b/test/test_excel_ui.py @@ -9,7 +9,10 @@ import unittest import numpy as np import pandas as pd -import pandas.util.testing as tm +try: + import pandas.testing as tm # for pandas >= 0.20.1 +except ImportError: + import pandas.util.testing as tm # for pandas <= 0.19.2 import FlowCal
Addressed pandas deprecation.
taborlab_FlowCal
train
py
e623e48538adec5ffd55d1e6a93278af3f37a5cc
diff --git a/lib/sprockets/base.rb b/lib/sprockets/base.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets/base.rb +++ b/lib/sprockets/base.rb @@ -113,8 +113,8 @@ module Sprockets def each_file return to_enum(__method__) unless block_given? paths.each do |base_path| - Dir["#{base_path}/**/*"].each do |filename| - yield filename unless File.directory?(filename) + each_file_in_directory(base_path) do |path| + yield path end end nil @@ -159,5 +159,18 @@ module Sprockets StaticAsset.new(self, logical_path, pathname) end end + + def each_file_in_directory(base, &block) + base = Pathname.new(base) unless base.is_a?(Pathname) + entries(base).each do |filename| + path = base.join(filename) + stats = stat(path) + if stats.directory? + each_file_in_directory(path, &block) + else + yield path + end + end + end end end
Use cached entries and stats helpers for traversing directories
rails_sprockets
train
rb
a9ac57bfad1f42fbb87b342e72a310fc0a416ca9
diff --git a/benchkv/main.go b/benchkv/main.go index <HASH>..<HASH> 100644 --- a/benchkv/main.go +++ b/benchkv/main.go @@ -72,8 +72,9 @@ func Init() { prometheus.MustRegister(txnCounter) prometheus.MustRegister(txnRolledbackCounter) prometheus.MustRegister(txnDurations) + http.Handle("/metrics", prometheus.Handler()) - go http.ListenAndServe(":9191", prometheus.Handler()) + go http.ListenAndServe(":9191", nil) } // without conflict
benchkv: just register metrics handler (#<I>)
pingcap_tidb
train
go
62e129c0d4693abe8e7f24ecb8668bbe05517d69
diff --git a/lib/xcode/install.rb b/lib/xcode/install.rb index <HASH>..<HASH> 100644 --- a/lib/xcode/install.rb +++ b/lib/xcode/install.rb @@ -277,7 +277,7 @@ HELP fail Informative, "Failed to download Xcode #{version}." if dmg_path.nil? if install - install_dmg(dmg_path, "-#{version.to_s.split(' ')[0]}", switch, clean) + install_dmg(dmg_path, "-#{version.to_s.split(' ').join('.')}", switch, clean) else puts "Downloaded Xcode #{version} to '#{dmg_path}'" end
Fix xcversion fails to install a new Xcode beta to the same location Currently all Xcode betas are installed under the name `Xcode-beta.app`. If you have Xcode <I> beta 5 installed, and you install Xcode <I> beta 6, the installation will fail when it copies the new app to the same location. The downloaded `.xip` file also gets deleted even the installation fails, so you end up having to download it again.
xcpretty_xcode-install
train
rb
889fc04eabda69854cdc3d2059d62b6c30520d75
diff --git a/src/system/modules/metamodelsattribute_translatedtags/MetaModelAttributeTranslatedTags.php b/src/system/modules/metamodelsattribute_translatedtags/MetaModelAttributeTranslatedTags.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodelsattribute_translatedtags/MetaModelAttributeTranslatedTags.php +++ b/src/system/modules/metamodelsattribute_translatedtags/MetaModelAttributeTranslatedTags.php @@ -116,8 +116,8 @@ class MetaModelAttributeTranslatedTags extends MetaModelAttributeTags implements FROM tl_metamodel_tag_relation RIGHT JOIN %3$s ON(tl_metamodel_tag_relation.value_id=%3$s.%1$s) %7$s - WHERE att_id=? %4$s - GROUP BY value_id + WHERE tl_metamodel_tag_relation.att_id=? %4$s + GROUP BY tl_metamodel_tag_relation.value_id ORDER BY %6$s %3$s.%2$s', $this->get('tag_id'), //1 $this->get('tag_sorting'), //2
Fix issue #6 - Column 'att_id' in where clause is ambiguous.
MetaModels_attribute_translatedtags
train
php
5f24e3ccc21c71164047d5db27b2b28bd8035619
diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/MissingCommaRelativeClauseRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/MissingCommaRelativeClauseRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/MissingCommaRelativeClauseRule.java +++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/MissingCommaRelativeClauseRule.java @@ -129,13 +129,6 @@ public class MissingCommaRelativeClauseRule extends Rule { regex("haben?|hatten?"), posRegex("VER:EIZ.*"), pos("PKT") - ), - // Der Beitrag, den Sie versucht haben aufzurufen, existiert nicht mehr oder wurde verschoben. - Arrays.asList( - pos("PA2:PRD:GRU:VER"), - regex("haben?|hatten?"), - posRegex("VER:EIZ.*"), - pos("PKT") ) ), GERMAN);
[de] remove duplicated antipattern
languagetool-org_languagetool
train
java
92d20c4c87ca7a617e36c8ca5b837ec0bacba5eb
diff --git a/lib/analist/checker.rb b/lib/analist/checker.rb index <HASH>..<HASH> 100644 --- a/lib/analist/checker.rb +++ b/lib/analist/checker.rb @@ -27,7 +27,7 @@ module Analist Analist::ResolveLookup::Hint::Decorate receiver, _method_name, *args = node.children - errors = [check(receiver), args.flat_map { |arg| check(arg) }].compact.flatten + errors = [check(receiver), args.map { |arg| check(arg) }].compact.flatten return errors if node.annotation.return_type[:type] == Analist::AnnotationTypeUnknown
Remove flat_map as error list is flattened anyway (#<I>)
tcoenraad_analist
train
rb
86b885b4daa83bc1fedd76178c0b66d5792a0952
diff --git a/library/CM/App.js b/library/CM/App.js index <HASH>..<HASH> 100644 --- a/library/CM/App.js +++ b/library/CM/App.js @@ -1065,13 +1065,11 @@ var CM_App = CM_Class_Abstract.extend({ ready: function() { var router = this; - //Fixes Safari 8 double 'popstate' fire on initial load. - $(window).on('load', function() { - setTimeout(function() { - $(window).on('popstate', function(event) { - router._handleLocationChange(router._getFragment()); - }); - }, 0); + $(window).on('popstate', function(event) { + //Fixes double 'popstate' fire on initial load. + if (window.history.ready || event.originalEvent.state) { + router._handleLocationChange(router._getFragment()); + } }); var urlBase = cm.getUrl(); @@ -1120,6 +1118,7 @@ var CM_App = CM_Class_Abstract.extend({ * @param {String|Null} [url] Absolute or relative URL */ pushState: function(url) { + window.history.ready = true;//Fixes double 'popstate' fire on initial load. window.history.pushState(null, null, url); },
Fix of double 'popstate' fire in Safari8.
cargomedia_cm
train
js
f133b7deb38b94a36f96551dfadaf004a12246ff
diff --git a/gitlab_registry_usage/_version.py b/gitlab_registry_usage/_version.py index <HASH>..<HASH> 100644 --- a/gitlab_registry_usage/_version.py +++ b/gitlab_registry_usage/_version.py @@ -1,2 +1,2 @@ -__version_info__ = (0, 0, 0) +__version_info__ = (0, 1, 0) __version__ = '.'.join(map(str, __version_info__))
Increased the version number to <I>
sciapp_gitlab-registry-usage
train
py
4783b6508e69d34d65dc32db30e85842ba0d4985
diff --git a/common/download_test.go b/common/download_test.go index <HASH>..<HASH> 100644 --- a/common/download_test.go +++ b/common/download_test.go @@ -452,7 +452,10 @@ func TestFileUriTransforms(t *testing.T) { cwd = filepath.ToSlash(cwd) volume = filepath.VolumeName(cwd) share = volume - if share[len(share)-1] == ':' { + + // if a volume was found (on windows), replace the ':' from + // C: to C$ to convert it into a hidden windows share. + if len(share) > 1 && share[len(share)-1] == ':' { share = share[:len(share)-1] + "$" } cwd = cwd[len(volume):]
Fix common/download_test.go to avoid formatting the volume name to a hidden windows share when not on windows.
hashicorp_packer
train
go
cc559ca4ae655fa41e09f916642a0a5d43fb0cf5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,9 +27,11 @@ if os.path.exists(readme_filename): else: long_description = None +exec(open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'x10_any', '_version.py')).read()) + setup( name='x10_any', - version=x10_any.__version__, + version=__version__, author='clach04', url='https://github.com/clach04/x10_any', description='Issue x10 commands via CM17A Firecracker or Mochad (CM15A RF/PL and CM19A RF)',
Read __version__ from file This way if module is not importable, still have version string
clach04_x10_any
train
py
a4893575af425201e077e6378178e8e3031312df
diff --git a/lib/rubocop/cop/style/each_with_object.rb b/lib/rubocop/cop/style/each_with_object.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/style/each_with_object.rb +++ b/lib/rubocop/cop/style/each_with_object.rb @@ -19,6 +19,10 @@ module RuboCop def on_block(node) method, args, body = *node + + # filter out super and zsuper nodes + return unless method.type == :send + _, method_name, method_args = *method return unless METHODS.include? method_name
Guard against super and zsuper nodes in EachWithObject
rubocop-hq_rubocop
train
rb
425f20e5940a90fe052e0ff033089bdb4c4b6e74
diff --git a/lib/twilio-ruby/security/request_validator.rb b/lib/twilio-ruby/security/request_validator.rb index <HASH>..<HASH> 100644 --- a/lib/twilio-ruby/security/request_validator.rb +++ b/lib/twilio-ruby/security/request_validator.rb @@ -58,7 +58,7 @@ module Twilio def build_signature_for(url, params) data = url + params.sort.join digest = OpenSSL::Digest.new('sha1') - Base64.encode64(OpenSSL::HMAC.digest(digest, @auth_token, data)).strip + Base64.strict_encode64(OpenSSL::HMAC.digest(digest, @auth_token, data)) end private
Update encode<I> to strict_encode<I> in RequestValidator#build_signature_for (#<I>) Base<I>#strict_encode<I> takes care of removing line feeds so no character stripping is required at the end
twilio_twilio-ruby
train
rb
97046233c5e185b6904d98f2ae4081ab579fa08b
diff --git a/spec/keychain_spec.rb b/spec/keychain_spec.rb index <HASH>..<HASH> 100644 --- a/spec/keychain_spec.rb +++ b/spec/keychain_spec.rb @@ -45,14 +45,21 @@ describe Keychain do context 'no password supplied' do #we have to stub this out as it would trigger a dialog box prompting for a password + let(:result) do + instance_double(Keychain::Keychain) + end + it 'should create a keychain by prompting the user' do #we can't just use a kind_of matcher becaue FFI::Pointer#== raises an exception #when compared to non pointer values - mock_pointer = double(FFI::MemoryPointer, :read_pointer => 0) + mock_pointer = double(FFI::MemoryPointer, :read_pointer => 123456) allow(FFI::MemoryPointer).to receive(:new).with(:pointer).and_return(mock_pointer) expect(Sec).to receive('SecKeychainCreate').with('akeychain', 0, nil, 1, nil,mock_pointer).and_return(0) - Keychain.create('akeychain') + + expect(Keychain::Keychain).to receive(:new).with(mock_pointer.read_pointer).and_return(result) + expect(result).to receive(:release_on_gc).and_return(result) + expect(Keychain.create('akeychain')).to eq(result) end end end
fix stubbing of SecKeychainCreate the cf gem's changes to how finalizers are setup ment that our stub on FFI::MemoryPointer.new was being used in there (unintentional) as well as in Keychain.create (intentional)
fcheung_keychain
train
rb
73853c1d0ca04ff05c99feee12cdb039bddc4d60
diff --git a/data.go b/data.go index <HASH>..<HASH> 100644 --- a/data.go +++ b/data.go @@ -733,8 +733,16 @@ func (user *User) SaveSetting(key string, value interface{}) error { // AuthTempToken returns Auth token used in OAuth process to associate TG user with OAuth creditianals func (user *User) AuthTempToken() string { + host := user.ctx.ServiceBaseURL.Host - fmt.Println("host:" + host) + if host == "" { + host = user.ctx.Service().DefaultBaseURL.Host + } + + serviceBaseURL := user.ctx.ServiceBaseURL.String() + if serviceBaseURL == "" { + serviceBaseURL = user.ctx.Service().DefaultBaseURL.String() + } ps, _ := user.protectedSettings() if ps.AuthTempToken != "" { @@ -742,7 +750,7 @@ func (user *User) AuthTempToken() string { oAuthIDCacheFound := oAuthIDCacheVal{} if exists := user.Cache("auth_"+ps.AuthTempToken, &oAuthIDCacheFound); !exists { - oAuthIDCacheFound = oAuthIDCacheVal{BaseURL: user.ctx.ServiceBaseURL.String()} + oAuthIDCacheFound = oAuthIDCacheVal{BaseURL: serviceBaseURL} user.SetCache("auth_"+ps.AuthTempToken, oAuthIDCacheFound, time.Hour*24) }
authTempToken custom domain services handling imprv
requilence_integram
train
go
01fb035da3080e95a509b3d75a34a2bc53120f98
diff --git a/examples/diary.py b/examples/diary.py index <HASH>..<HASH> 100755 --- a/examples/diary.py +++ b/examples/diary.py @@ -79,6 +79,10 @@ if __name__ == '__main__': sys.stderr.write('Passphrase required to access diary.\n') sys.stderr.flush() sys.exit(1) + elif len(passphrase) < 8: + sys.stderr.write('Passphrase must be at least 8 characters.\n') + sys.stderr.flush() + sys.exit(1) # Initialize the database. initialize(passphrase)
Display error about passphrase length in diary example.
coleifer_peewee
train
py
d2c89c322a3b9cd7e544cbc4747dd5f38a7d0da4
diff --git a/bin/config/karma.conf.js b/bin/config/karma.conf.js index <HASH>..<HASH> 100644 --- a/bin/config/karma.conf.js +++ b/bin/config/karma.conf.js @@ -39,13 +39,18 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ + // Src files + {pattern: projectRoot + '/src/**/*.js', watched: autoWatch}, + {pattern: projectRoot + '/src/**/*.vue', watched: autoWatch}, // Test files {pattern: testPath + '/specs/**/*.js', watched: autoWatch} ], - // Preprocess files + // Preprocess src/test files preprocessors: { - [testPath + '/specs/**/*.js']: ['webpack'] + [projectRoot + '/src/**/*.js']: ['webpack', 'sourcemap'], + [projectRoot + '/src/**/*.vue']: ['webpack', 'sourcemap'], + [testPath + '/specs/**/*.js']: ['webpack', 'sourcemap'] }, webpack: webpackTestConfig,
karma - updated to include src files as well
brianvoe_vue-build
train
js