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
bea38e19454478115bdf7a552cf5d6cd42b074a8
diff --git a/openpnm/models/misc/basic_math.py b/openpnm/models/misc/basic_math.py index <HASH>..<HASH> 100644 --- a/openpnm/models/misc/basic_math.py +++ b/openpnm/models/misc/basic_math.py @@ -143,7 +143,7 @@ def constant(target, value): return value -def product(target, prop1, prop2, **kwargs): +def product(target, props): r""" Calculates the product of multiple property values @@ -154,26 +154,16 @@ def product(target, prop1, prop2, **kwargs): length of the calculated array, and also provides access to other necessary properties. - prop1 : string - The name of the first argument - - prop2 : string - The name of the second argument + props : Array of string + The name of the arguments to be used for the product. Returns ------- value : NumPy ndarray - Array containing product values of ``target[prop1]``, ``target[prop2]`` - - Notes - ----- - Additional properties can be specified beyond just ``prop1`` and ``prop2`` - by including additional arguments in the function call (i.e. ``prop3 = - 'pore.foo'``). - + Array containing product values of ``target[props[0]]``, ``target[props[1]], etc`` """ - value = target[prop1]*target[prop2] - for item in kwargs.values(): + value = 1 + for item in props: value *= target[item] return value
changed misc.product function so that it accepts the props in an array of strings [ci skip]
PMEAL_OpenPNM
train
py
6c997fc64f5a6e8c11d7491341e6dd0256183729
diff --git a/lib/app/helper_model/document.js b/lib/app/helper_model/document.js index <HASH>..<HASH> 100644 --- a/lib/app/helper_model/document.js +++ b/lib/app/helper_model/document.js @@ -715,16 +715,8 @@ Document.setMethod(function save(data, options, callback) { save_result = save_result[0]; - // `saveResult` is actually the `toDatasource` value - // We can't assign that again, because it's sometimes normalized! - // @TODO: make save & update return non-normalized data - //Object.assign(main, saveResult[0][that.modelName]); - - // While we're waiting for past me to finish the todo above, - // we really need an _id value - if (pk_name == '_id') { - main._id = alchemy.castObjectId(save_result[that.$model_alias]._id); - } + // Use the saved data from now on + that.$main = save_result.$main; // Unset the changed-status that.$attributes.original_record = undefined;
Replace Document $main property with save result
skerit_alchemy
train
js
b00f43e524bf9ab37c15ec9dc26b8b2a34c4e71b
diff --git a/make/build.js b/make/build.js index <HASH>..<HASH> 100644 --- a/make/build.js +++ b/make/build.js @@ -96,13 +96,15 @@ class Builder { build () { this._debug("Building library"); - let ARGUMENTS = "arguments", - resultAst, + const + ARGUMENTS = "arguments", + FIRST = 0; + let resultAst, name; // Generate UMD AST resultAst = clone(this._toAst("UMD")); // Grab the final placeholder - this._placeholder = resultAst.body[0].expression[ARGUMENTS][0].body.body; + this._placeholder = resultAst.body[FIRST].expression[ARGUMENTS][FIRST].body.body; this._placeholder.pop(); // remove __gpf__ // Generate all ASTs and aggregate to the final result this._addAst("boot");
no-magic-numbers (#<I>)
ArnaudBuchholz_gpf-js
train
js
5b3990e5e30630b9a2950fa846ef3e906c86d743
diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -580,6 +580,10 @@ public abstract class PluginManager extends AbstractModelObject { } public FormValidation doCheckProxyPort(@QueryParameter String value) { + value = Util.fixEmptyAndTrim(value); + if (value == null) { + return FormValidation.ok(); + } int port; try { port = Integer.parseInt(value);
[JENKINS-<I>] Do not check if port is not entered.
jenkinsci_jenkins
train
java
3505efbe4b030161320a80c5953f901014909461
diff --git a/isort/isort.py b/isort/isort.py index <HASH>..<HASH> 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -228,7 +228,7 @@ class SortImports(object): while map(unicode.strip, output[-1:]) == [""]: output.pop() - self.out_lines[self.import_index:1] = output + self.out_lines[self.import_index:0] = output imports_tail = self.import_index + len(output) while map(unicode.strip, self.out_lines[imports_tail: imports_tail + 1]) == [""]: @@ -238,9 +238,9 @@ class SortImports(object): next_construct = self.out_lines[imports_tail] if next_construct.startswith("def") or next_construct.startswith("class") or \ next_construct.startswith("@"): - self.out_lines[imports_tail:1] = ["", ""] + self.out_lines[imports_tail:0] = ["", ""] else: - self.out_lines[imports_tail:1] = [""] + self.out_lines[imports_tail:0] = [""] @staticmethod def _strip_comments(line):
Don't remove code! Incorrect method of inserting into list location used which caused issue.
timothycrosley_isort
train
py
8ff71cc73697b645048f62354446934c47b43d83
diff --git a/flask_praetorian/decorators.py b/flask_praetorian/decorators.py index <HASH>..<HASH> 100644 --- a/flask_praetorian/decorators.py +++ b/flask_praetorian/decorators.py @@ -41,8 +41,6 @@ def roles_required(*required_rolenames): def roles_accepted(*accepted_rolenames): - # TODO: add docs about order of decorations - # TODO: add error checks for jwt decorator being present already def decorator(method): @functools.wraps(method) def wrapper(*args, **kwargs):
Converted two TODO comments to issues
dusktreader_flask-praetorian
train
py
fef5741dedd16b496310026295efd1a476dbc82d
diff --git a/builtin/providers/aws/resource_aws_security_group_rule.go b/builtin/providers/aws/resource_aws_security_group_rule.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_security_group_rule.go +++ b/builtin/providers/aws/resource_aws_security_group_rule.go @@ -257,7 +257,7 @@ func findResourceSecurityGroup(conn *ec2.EC2, id string) (*ec2.SecurityGroup, er if err != nil { return nil, err } - if resp == nil || len(resp.SecurityGroups) != 1 { + if resp == nil || len(resp.SecurityGroups) != 1 || resp.SecurityGroups[0] == nil { return nil, fmt.Errorf( "Expected to find one security group with ID %q, got: %#v", id, resp.SecurityGroups)
providers/aws: fix another crash case
hashicorp_terraform
train
go
d7532a13543d406d7c2a8ffd86c2ba36fdc1f6e4
diff --git a/src/Urls/PermissionAwareUrlGenerator.php b/src/Urls/PermissionAwareUrlGenerator.php index <HASH>..<HASH> 100644 --- a/src/Urls/PermissionAwareUrlGenerator.php +++ b/src/Urls/PermissionAwareUrlGenerator.php @@ -5,7 +5,7 @@ namespace Digbang\Security\Urls; use Digbang\Security\Contracts\SecurityApi; use Digbang\Security\Exceptions\Unauthorized; use Digbang\Security\Permissions\Permissible; -use Illuminate\Routing\UrlGenerator; +use Illuminate\Contracts\Routing\UrlGenerator; class PermissionAwareUrlGenerator implements UrlGenerator {
Laravel 9 | Whoops! Reverted from last commit
digbang_security
train
php
672523168de2bdffba002346467582dabcef47ed
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ testing_requires = [ ] long_description = """ -This package provides generic support for event sourcing in Python. +A library for event sourcing in Python. `Package documentation is now available <http://eventsourcing.readthedocs.io/>`_.
Adjusted long_description in setup.py.
johnbywater_eventsourcing
train
py
fcfa755be997f8499a41f3c9b0c18fda5c484c9c
diff --git a/server/src/test/java/com/orientechnologies/orient/server/OServerShutdownMainTest.java b/server/src/test/java/com/orientechnologies/orient/server/OServerShutdownMainTest.java index <HASH>..<HASH> 100644 --- a/server/src/test/java/com/orientechnologies/orient/server/OServerShutdownMainTest.java +++ b/server/src/test/java/com/orientechnologies/orient/server/OServerShutdownMainTest.java @@ -1,6 +1,7 @@ package com.orientechnologies.orient.server; import com.orientechnologies.common.log.OLogManager; +import com.orientechnologies.orient.core.Orient; import com.orientechnologies.orient.core.config.OGlobalConfiguration; import com.orientechnologies.orient.server.config.OServerConfiguration; import com.orientechnologies.orient.server.config.OServerNetworkConfiguration; @@ -68,6 +69,7 @@ public class OServerShutdownMainTest { if (prevPassword != null) System.setProperty("ORIENTDB_ROOT_PASSWORD", prevPassword); + Orient.instance().startup(); } @Test(enabled = true)
fixed orient engine shutdonw in case of server shutdown test.
orientechnologies_orientdb
train
java
8cee87515fc447a8a5c1f3e852667b3e62ce91c5
diff --git a/src/Composer/Job/Migrate/Migrate.php b/src/Composer/Job/Migrate/Migrate.php index <HASH>..<HASH> 100644 --- a/src/Composer/Job/Migrate/Migrate.php +++ b/src/Composer/Job/Migrate/Migrate.php @@ -35,12 +35,13 @@ abstract class Migrate extends Job */ protected function getMigrationsConfig() { + $dir = $this->getPackageDir(); + // specific location if ($migrations = $this->getPackageOptionFile('anime-db-migrations')) { - return $migrations; + return $dir.$migrations; } - $dir = $this->getPackageDir(); if (file_exists($dir.'migrations.yml')) { return $dir.'migrations.yml'; } elseif (file_exists($dir.'migrations.xml')) { @@ -65,6 +66,7 @@ abstract class Migrate extends Job $config = file_get_contents($file); switch (pathinfo($file, PATHINFO_EXTENSION)) { case 'yml': + case 'yaml': $config = Yaml::parse($config); if (isset($config['migrations_namespace'])) { $namespace = $config['migrations_namespace'];
correct path for package migrations config
anime-db_anime-db
train
php
aa9b2297136c8f4f40d527fd0e7b5f6aef79ae61
diff --git a/barf/arch/x86/x86translator.py b/barf/arch/x86/x86translator.py index <HASH>..<HASH> 100644 --- a/barf/arch/x86/x86translator.py +++ b/barf/arch/x86/x86translator.py @@ -160,7 +160,7 @@ class X86TranslationBuilder(TranslationBuilder): if mem_operand.segment in ["gs", "fs"]: seg_base_addr_map = { "gs": "gs_base_addr", - "fs": "gs_base_addr", + "fs": "fs_base_addr", } seg_base = ReilRegisterOperand(seg_base_addr_map[mem_operand.segment], size)
Fix reference to fs segment in the x<I> translator
programa-stic_barf-project
train
py
a2eb365a70e8824df279fd733c24b6ccf70e054b
diff --git a/Curl/Wrapper.php b/Curl/Wrapper.php index <HASH>..<HASH> 100644 --- a/Curl/Wrapper.php +++ b/Curl/Wrapper.php @@ -171,7 +171,7 @@ class Wrapper return $this->fopenRequest($method, $url, $params, $headers); } else { - return $this->curlRequest($method, $url, $params, $data = null, $headers, $options); + return $this->curlRequest($method, $url, $params, $headers, $options); } }
fopen alternative, proper response object with headers POST confirmed to be working, response constructor updated
synaq_SynaqCurlBundle
train
php
2d4e4e527c5f961348649f84515a2346ead415a8
diff --git a/features/public/public-express.js b/features/public/public-express.js index <HASH>..<HASH> 100644 --- a/features/public/public-express.js +++ b/features/public/public-express.js @@ -1,6 +1,6 @@ 'use strict'; -module.exports = ['$server', function($server) { +module.exports = function($server) { if (process.env.PUBLIC_ENABLED && process.env.PUBLIC_ENABLED == 'false') { return; } @@ -47,4 +47,4 @@ module.exports = ['$server', function($server) { _sendFile(req, res, filename); }); -}]; +};
refactor(public express): replace DI array to direct function
CodeCorico_allons-y-public
train
js
30a7d100fac8df3db7d384f09b692fa3fd30a804
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -28,17 +28,25 @@ const VueStorage = { switch(_options.storage) { // eslint-disable-line case 'local': - store = 'localStorage' in _global - ? _global.localStorage - : null - ; + try { + store = 'localStorage' in _global + ? _global.localStorage + : null + ; + } catch (e) { + // In some situations the browser will throw a security exception when attempting to access + } break; case 'session': - store = 'sessionStorage' in _global - ? _global.sessionStorage - : null - ; + try { + store = 'sessionStorage' in _global + ? _global.sessionStorage + : null + ; + } catch (e) { + // In some situations the browser will throw a security exception when attempting to access + } break; case 'memory': store = MemoryStorage;
Handle security exception thrown when accessing store
RobinCK_vue-ls
train
js
3174f99165450aa98b5b1bf4c4ae27bc810da473
diff --git a/prosaic_contract.js b/prosaic_contract.js index <HASH>..<HASH> 100644 --- a/prosaic_contract.js +++ b/prosaic_contract.js @@ -71,7 +71,7 @@ function respond(objContract, status, signedMessageBase64, signer, cb) { cb(); } if (status === "accepted") { - composer.composeAuthorsAndMciForAddresses(db, [objContract.address], signer, function(err, authors) { + composer.composeAuthorsAndMciForAddresses(db, [objContract.my_address], signer, function(err, authors) { if (err) return cb(err); send(authors);
Prosaic contract: attempt to fix 'definition not found' on accepting the contract
byteball_ocore
train
js
13ea6aaae443a7a04f24fb440de53f4986876da7
diff --git a/src/Qiniu/Auth.php b/src/Qiniu/Auth.php index <HASH>..<HASH> 100644 --- a/src/Qiniu/Auth.php +++ b/src/Qiniu/Auth.php @@ -38,8 +38,7 @@ final class Auth } $data .= "\n"; - if ($body !== null && - in_array((string) $contentType, array('application/x-www-form-urlencoded', 'application/json'), true)) { + if ($body !== null && $contentType === 'application/x-www-form-urlencoded') { $data .= $body; } return $this->sign($data);
rm application/json request auth
qiniu_php-sdk
train
php
63b9897861ab8f72453f09c476da704a93e8b2e4
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 @@ -7,11 +7,11 @@ require "ethon" require 'rspec' if defined? require_relative - require_relative 'support/localhost_server.rb' - require_relative 'support/server.rb' + require_relative 'support/localhost_server' + require_relative 'support/server' else - require 'support/localhost_server.rb' - require 'support/server.rb' + require 'support/localhost_server' + require 'support/server' end # Ethon.logger = Logger.new($stdout).tap do |log|
Remove unneeded .rb from some requires
typhoeus_ethon
train
rb
4746361659cccc4fc1e309aaece78ec68bdcf50e
diff --git a/src/test/java/org/redline_rpm/ant/RedlineTaskTest.java b/src/test/java/org/redline_rpm/ant/RedlineTaskTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/redline_rpm/ant/RedlineTaskTest.java +++ b/src/test/java/org/redline_rpm/ant/RedlineTaskTest.java @@ -404,7 +404,7 @@ public class RedlineTaskTest extends TestBase { private void assertHeaderEquals(String expected, Format format, AbstractHeader.Tag tag) { assertNotNull("null format", format); - AbstractHeader.Entry entry = format.getHeader().getEntry(tag); + AbstractHeader.Entry< ?> entry = format.getHeader().getEntry(tag); assertNotNull("Entry not found : " + tag.getName(), entry); assertEquals("Entry type : " + tag.getName(), 6, entry.getType()); @@ -417,7 +417,7 @@ public class RedlineTaskTest extends TestBase { private void assertInt32EntryHeaderEquals(int[] expected, Format format, AbstractHeader.Tag tag) { assertNotNull("null format", format); - AbstractHeader.Entry entry = format.getHeader().getEntry(tag); + AbstractHeader.Entry< ?> entry = format.getHeader().getEntry(tag); assertNotNull("Entry not found : " + tag.getName(), entry); assertEquals("Entry type : " + tag.getName(), 4, entry.getType());
Fix generics related warnings in RedlineTaskTest.
craigwblake_redline
train
java
231002d1518fcbf981c628ab71bbae6a7b6fe6a6
diff --git a/lib/watir-webdriver/wait.rb b/lib/watir-webdriver/wait.rb index <HASH>..<HASH> 100644 --- a/lib/watir-webdriver/wait.rb +++ b/lib/watir-webdriver/wait.rb @@ -1,4 +1,6 @@ # encoding: utf-8 +require 'forwardable' + module Watir module Wait @@ -80,6 +82,10 @@ module Watir # class WhenPresentDecorator + extend Forwardable + + def_delegator :@element, :present? + def initialize(element, timeout, message = nil) @element = element @timeout = timeout diff --git a/spec/wait_spec.rb b/spec/wait_spec.rb index <HASH>..<HASH> 100644 --- a/spec/wait_spec.rb +++ b/spec/wait_spec.rb @@ -83,6 +83,16 @@ not_compliant_on [:webdriver, :safari] do decorator.should respond_to(:present?) decorator.should respond_to(:click) end + + it "delegates present? to element" do + Object.class_eval do + def present? + false + end + end + element = browser.a(:id, "show_bar").when_present(1) + element.should be_present + end end describe "#wait_until_present" do
Delegate #present? to Element. Closes #<I>
watir_watir
train
rb,rb
4c6e167c4fcf833804446889612d898f94ae3c32
diff --git a/gentools/types.py b/gentools/types.py index <HASH>..<HASH> 100644 --- a/gentools/types.py +++ b/gentools/types.py @@ -69,7 +69,7 @@ class GeneratorCallable(t.Generic[T_yield, T_send, T_return]): raise NotImplementedError() -class ReusableGeneratorMeta(CallableAsMethod, t.GenericMeta): +class ReusableGeneratorMeta(CallableAsMethod, type(Generable)): pass
make generic metaclass lookup more robust
ariebovenberg_gentools
train
py
18ce71df5f31d189400b2210091dc8b361760e71
diff --git a/logdog/server/cmd/logdog_archivist/main.go b/logdog/server/cmd/logdog_archivist/main.go index <HASH>..<HASH> 100644 --- a/logdog/server/cmd/logdog_archivist/main.go +++ b/logdog/server/cmd/logdog_archivist/main.go @@ -150,6 +150,9 @@ func runForever(ctx context.Context, taskConcurrency int, ar archivist.Archivist batch.Meta = req } _, err := ar.Service.DeleteArchiveTasks(ctx, req) + if err == nil { + tsAckCount.Add(ctx, int64(len(req.Tasks))) + } return transient.Tag.Apply(err) }) if err != nil { @@ -180,6 +183,7 @@ func runForever(ctx context.Context, taskConcurrency int, ar archivist.Archivist logging.Errorf(ctx, "Failed to ACK task %v due to context: %s", job.task, ctx.Err()) } } else { + tsNackCount.Add(ctx, 1) logging.Errorf(ctx, "Failed to archive task %v: %s", job.task, err) } @@ -230,6 +234,7 @@ func runForever(ctx context.Context, taskConcurrency int, ar archivist.Archivist previousCycle = time.Time{} continue } else { + tsLeaseCount.Add(ctx, int64(len(tasks.Tasks))) sleepTime = 1 }
[logdog] Re-add missing metrics to archivist. These were lost in the recent pipeline CLs. R=<EMAIL>, <EMAIL>, <EMAIL> Bug: <I> Change-Id: I<I>bd4ed<I>db<I>a<I>a<I>a<I>be<I>c<I>c0ea<I> Reviewed-on: <URL>
luci_luci-go
train
go
5f2945de7b7e61be72f13a9215ce6e677518d290
diff --git a/tools/voltdb-install.py b/tools/voltdb-install.py index <HASH>..<HASH> 100755 --- a/tools/voltdb-install.py +++ b/tools/voltdb-install.py @@ -78,7 +78,7 @@ def error(*msgs): def abort(*msgs): error(*msgs) - _message(sys.stdout, 'FATAL', 'Errors are fatal, aborting execution') + _message(sys.stderr, 'FATAL', 'Errors are fatal, aborting execution') sys.exit(1) def get_dst_path(*dirs): @@ -462,7 +462,7 @@ def debian(): def clean(): info('Cleaning package building output in "%s"...' % Global.debian_output_root) - if Global.options.dryrun: + if not Global.options.dryrun: shutil.rmtree(Global.debian_output_root) #### Command line main
ENG-<I> - Fixed voltdb-install.py clean function with inverted dry run check.
VoltDB_voltdb
train
py
b481d88f5c0ec2f64b068107d7bd21ed03b202f6
diff --git a/src/Controllers/Backend.php b/src/Controllers/Backend.php index <HASH>..<HASH> 100644 --- a/src/Controllers/Backend.php +++ b/src/Controllers/Backend.php @@ -988,6 +988,12 @@ class Backend implements ControllerProviderInterface $users = $app['users']->getUsers(); $sessions = $app['users']->getActiveSessions(); + foreach ($users as $name => $user) { + if (($key = array_search(Permissions::ROLE_EVERYONE, $user['roles'], true)) !== false) { + unset($users[$name]['roles'][$key]); + } + } + $context = array( 'currentuser' => $currentuser, 'users' => $users,
Do not display "everyone" in user's roles
bolt_bolt
train
php
2a40c1f91253bfd771e89d7f8ce895cb0d46a995
diff --git a/drivers/docker/driver_linux_test.go b/drivers/docker/driver_linux_test.go index <HASH>..<HASH> 100644 --- a/drivers/docker/driver_linux_test.go +++ b/drivers/docker/driver_linux_test.go @@ -42,7 +42,7 @@ func TestDockerDriver_authFromHelper(t *testing.T) { } content, err := ioutil.ReadFile(filepath.Join(dir, "helper-get.out")) require.NoError(t, err) - require.Equal(t, []byte("https://registry.local:5000"), content) + require.Equal(t, "registry.local:5000", string(content)) } func TestDockerDriver_PidsLimit(t *testing.T) { diff --git a/drivers/docker/utils.go b/drivers/docker/utils.go index <HASH>..<HASH> 100644 --- a/drivers/docker/utils.go +++ b/drivers/docker/utils.go @@ -153,10 +153,7 @@ func authFromHelper(helperName string) authBackend { return nil, err } - // Ensure that the HTTPs prefix exists - repoAddr := fmt.Sprintf("https://%s", repoInfo.Index.Name) - - cmd.Stdin = strings.NewReader(repoAddr) + cmd.Stdin = strings.NewReader(repoInfo.Index.Name) output, err := cmd.Output() if err != nil { switch err.(type) {
Don't prepend https to docker cred helper call (#<I>) Some credential helpers, like the ECR helper, will strip the protocol if given. Others, like the linux "pass" helper, do not.
hashicorp_nomad
train
go,go
962a56d407d5e58f1dfc65f14b033cc21d21feb0
diff --git a/pykechain/client.py b/pykechain/client.py index <HASH>..<HASH> 100644 --- a/pykechain/client.py +++ b/pykechain/client.py @@ -211,7 +211,7 @@ class Client(object): return obj.__class__(data['results'][0], client=self) def scopes(self, name=None, pk=None, status=ScopeStatus.ACTIVE, **kwargs): - # type: (Optional[str], Optional[str], Optional[str]) -> List[Scope] + # type: (Optional[str], Optional[str], Optional[str], **Any) -> List[Scope] """Return all scopes visible / accessible for the logged in user. :param name: if provided, filter the search for a scope/project by name @@ -282,7 +282,7 @@ class Client(object): 'name': name, 'scope': scope } - + if kwargs: request_params.update(**kwargs)
fixed arguments of scope for mypy (failed due to erge confluct)
KE-works_pykechain
train
py
2009a505350fffc0c41a2c0721a82f7acd7e535b
diff --git a/src/DI/FormsExtension.php b/src/DI/FormsExtension.php index <HASH>..<HASH> 100644 --- a/src/DI/FormsExtension.php +++ b/src/DI/FormsExtension.php @@ -217,7 +217,9 @@ class FormsExtension extends CompilerExtension { $twigExtension = $this->getExtension('Arachne\Twig\DI\TwigExtension', false); if ($twigExtension) { - $twigExtension->addPath(dirname((new ReflectionClass('Symfony\Bridge\Twig\AppVariable'))->getFileName()) . '/Resources/views/Form'); + $twigExtension->addPaths([ + dirname((new ReflectionClass('Symfony\Bridge\Twig\AppVariable'))->getFileName()) . '/Resources/views/Form', + ]); } $builder = $this->getContainerBuilder();
Fix compatibility with arachne/twig
Arachne_Forms
train
php
1e91cf816b2269a327c24ba6ab823f9ed8e6d15b
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -86,7 +86,7 @@ function buildTask() { " }\n"+ "}(this || window, function(<%= param %>) {\n"+ "<%= contents %>\n"+ - "return <%= exports %>;\n"+ + "return this.<%= exports %>;\n"+ "}));\n", dependencies: function() { return ['moment']
Update gulpfile.js root can be either window, globals but without this, JS will not lookup in globals object
chartjs_Chart.js
train
js
326c2aed1ca9317f3d11e9d04a1fdae78c6e3270
diff --git a/src/sandbox/http/index.js b/src/sandbox/http/index.js index <HASH>..<HASH> 100644 --- a/src/sandbox/http/index.js +++ b/src/sandbox/http/index.js @@ -14,12 +14,12 @@ let public = require('./public-middleware') let fallback = require('./fallback') // config arcana -let jsonTypes = ['application/json', 'application/vnd.api+json'] +let jsonTypes = /^application\/.*json/ let limit = '6mb'; let app = Router({mergeparams: true}) app.use(body.json({ limit, - type: req => jsonTypes.includes(req.headers['content-type']) + type: req => jsonTypes.test(req.headers['content-type']) })) app.use(body.urlencoded({ extended: false,
fixed sandbox/http/index.js to work properly when content-type has charset assignment
architect_architect
train
js
6dccbb8bf41f851f56a2160c9ce152658119d6a9
diff --git a/WrightTools/__version__.py b/WrightTools/__version__.py index <HASH>..<HASH> 100644 --- a/WrightTools/__version__.py +++ b/WrightTools/__version__.py @@ -30,6 +30,6 @@ if os.path.isfile(p): with open(p) as f: __branch__ = f.readline().rstrip().split(r'/')[-1] if __branch__ != 'master': - __version__ += '-' + __branch__ + __version__ += '+' + __branch__ else: __branch__ = None
__version__ complient with pep<I> (#<I>)
wright-group_WrightTools
train
py
39dbc5dc3cd15de377206aa78afc5f636ac0d515
diff --git a/src/guake.py b/src/guake.py index <HASH>..<HASH> 100644 --- a/src/guake.py +++ b/src/guake.py @@ -1124,7 +1124,7 @@ def main(): remote_object.quit() called_with_param = True - if not called_with_param: + if not called_with_param and already_running: # here we know that guake was called without any parameter and # it is already running, so, lets toggle its visibility. remote_object.show_hide()
Making guake not be shown when running on first time.
Guake_guake
train
py
fe0b046e0a983894f456149e1d4048634542d9af
diff --git a/lib/base_controller.js b/lib/base_controller.js index <HASH>..<HASH> 100644 --- a/lib/base_controller.js +++ b/lib/base_controller.js @@ -243,7 +243,7 @@ controller.formatters = new (function () { }; })(); -BaseController.prototype = new (function () { +controller.BaseController.prototype = new (function () { // Private methods, utility methods // -------------------
Fixed up base-controller stuff into namespace for docs.
mde_ejs
train
js
ff1dea5f44f617814f58ad2aea8799e5b6fde263
diff --git a/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java b/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java index <HASH>..<HASH> 100644 --- a/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java +++ b/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/IntlPhoneInput.java @@ -205,7 +205,11 @@ public class IntlPhoneInput extends RelativeLayout { */ public void setNumber(String number) { try { - Phonenumber.PhoneNumber phoneNumber = mPhoneUtil.parse(number, mSelectedCountry.getIso()); + String iso = null; + if(mSelectedCountry != null) { + iso = mSelectedCountry.getIso(); + } + Phonenumber.PhoneNumber phoneNumber = mPhoneUtil.parse(number, iso); mPhoneEdit.setText(mPhoneUtil.format(phoneNumber, PhoneNumberUtil.PhoneNumberFormat.NATIONAL)); int countryIdx = mCountries.indexOfIso(mPhoneUtil.getRegionCodeForNumber(phoneNumber));
fixes critical bug with initial setting of number
AlmogBaku_IntlPhoneInput
train
java
52eb4a089a1dcced2a6bbf8f104399b57e752d4a
diff --git a/generators/server/files.js b/generators/server/files.js index <HASH>..<HASH> 100644 --- a/generators/server/files.js +++ b/generators/server/files.js @@ -319,6 +319,10 @@ function writeFiles() { this.template(`${SERVER_MAIN_SRC_DIR}package/security/oauth2/OAuth2TokenEndpointClientAdapter.java.ejs`, `${javaDir}security/oauth2/OAuth2TokenEndpointClientAdapter.java`); this.template(`${SERVER_MAIN_SRC_DIR}package/security/oauth2/UaaTokenEndpointClient.java.ejs`, `${javaDir}security/oauth2/UaaTokenEndpointClient.java`); } + if (this.authenticationType === 'oauth2') { + this.template(`${SERVER_MAIN_SRC_DIR}package/config/OAuth2Configuration.java.ejs`, `${javaDir}config/OAuth2Configuration.java`); + this.template(`${SERVER_MAIN_SRC_DIR}package/security/OAuth2AuthenticationSuccessHandler.java.ejs`, `${javaDir}security/OAuth2AuthenticationSuccessHandler.java`); + } }, writeServerMicroserviceFiles() {
Make redirect back to :<I> work on gateway
jhipster_generator-jhipster
train
js
fbc71900400356e7fa578082f0f9778320e1c32c
diff --git a/Model/Menu/NodeRepository.php b/Model/Menu/NodeRepository.php index <HASH>..<HASH> 100644 --- a/Model/Menu/NodeRepository.php +++ b/Model/Menu/NodeRepository.php @@ -78,7 +78,6 @@ class NodeRepository implements NodeRepositoryInterface { try { $object->delete(); - $this->cache->invalidatePageCache(); } catch (Exception $exception) { throw new CouldNotDeleteException(__($exception->getMessage())); }
[<I>] Remove page cache invalidation from menu node repository delete method
SnowdogApps_magento2-menu
train
php
656978193ff0359cdefb6bb8260c8add20cd9b3a
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -10,7 +10,6 @@ require 'discordrb/api/channel' require 'discordrb/api/server' require 'discordrb/api/invite' require 'discordrb/api/user' -require 'discordrb/events/message' require 'time' require 'base64'
Remove a circular require in data.rb
meew0_discordrb
train
rb
55b78774c5959582d41985c532fd173def57fc74
diff --git a/test/remote/correios_test.rb b/test/remote/correios_test.rb index <HASH>..<HASH> 100644 --- a/test/remote/correios_test.rb +++ b/test/remote/correios_test.rb @@ -41,6 +41,7 @@ class RemoteCorreiosTest < Minitest::Test end def test_book_request_with_specific_services + skip("Service unavailable for the informed route") response = @carrier.find_rates(@saopaulo, @riodejaneiro, [@book], :services => [41106, 40010, 40215]) assert response.is_a?(RateResponse)
Skip remote Correios test, service unavailable for the informed route.
Shopify_active_shipping
train
rb
7ef8eb52fa52d87633e95d82daebae6968540f7c
diff --git a/scope/config.py b/scope/config.py index <HASH>..<HASH> 100644 --- a/scope/config.py +++ b/scope/config.py @@ -7,6 +7,7 @@ from __future__ import division, print_function __author__ = "Andy Casey <acasey@mso.anu.edu.au>" # Standard library +import json import logging import os from random import choice @@ -19,7 +20,7 @@ import yaml import models def load(configuration_filename): - """Loads a YAML-style configuration filename. + """Loads a configuration filename (either YAML or JSON) Inputs ------ @@ -31,8 +32,10 @@ def load(configuration_filename): raise IOError("no configuration filename '{filename}' exists".format( filename=configuration_filename)) + module = json if configuration_filename.endswith(".json") else yaml + with open(configuration_filename, 'r') as fp: - configuration = yaml.load(fp) + configuration = module.load(fp) return configuration
Load configuration files as YAML (preferred) or JSON
andycasey_sick
train
py
969bb0c4c64465ac7122e1ec61f720359904e2ba
diff --git a/src/main/java/act/app/DbServiceManager.java b/src/main/java/act/app/DbServiceManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/act/app/DbServiceManager.java +++ b/src/main/java/act/app/DbServiceManager.java @@ -87,9 +87,11 @@ public class DbServiceManager extends AppServiceBase<DbServiceManager> implement Dao dao = modelDaoMap.get(modelClass); if (null == dao) { String svcId = DEFAULT; - DB db = modelClass.getDeclaredAnnotation(DB.class); - if (null != db) { - svcId = db.value(); + Annotation[] aa = modelClass.getDeclaredAnnotations(); + for (Annotation a : aa) { + if (a instanceof DB) { + svcId = ((DB)a).value(); + } } DbService dbService = dbService(svcId); dao = dbService.defaultDao(modelClass);
DbServiceManager: take out the java8 specific method call
actframework_actframework
train
java
7b1288438fd32934bbe4c451111fdeed0b9f011b
diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb index <HASH>..<HASH> 100644 --- a/lib/haml/exec.rb +++ b/lib/haml/exec.rb @@ -168,6 +168,7 @@ END def initialize(args) super @name = "Sass" + @options[:for_engine][:load_paths] = ['.'] + (ENV['SASSPATH'] || '').split(File::PATH_SEPARATOR) end def set_opts(opts) @@ -185,6 +186,9 @@ END 'Run an interactive SassScript shell.') do @options[:interactive] = true end + opts.on('-I', '--load-path PATH', 'Add a sass import path.') do |path| + @options[:for_engine][:load_paths] << path + end end def process_result
Support for passing an import path to the sass command-line.
sass_ruby-sass
train
rb
b7bad8ec539d52cd0535f9f25c764aae79f9a958
diff --git a/src/mg/Ding/Cache/Impl/FileCacheImpl.php b/src/mg/Ding/Cache/Impl/FileCacheImpl.php index <HASH>..<HASH> 100644 --- a/src/mg/Ding/Cache/Impl/FileCacheImpl.php +++ b/src/mg/Ding/Cache/Impl/FileCacheImpl.php @@ -68,6 +68,7 @@ class FileCacheImpl implements ICache { $result = false; $filename = $this->_directory . $this->_sanitize($name); + clearstatcache(false, $filename); if (!@file_exists($filename)) { return false; }
when hitting the file cache, the stat cache is cleared for the given path
marcelog_Ding
train
php
171a6d8af9e8d7bf482302d2d27bef017dff2ce6
diff --git a/lib/poise_service/service_providers/systemd.rb b/lib/poise_service/service_providers/systemd.rb index <HASH>..<HASH> 100644 --- a/lib/poise_service/service_providers/systemd.rb +++ b/lib/poise_service/service_providers/systemd.rb @@ -27,8 +27,6 @@ module PoiseService # @api private def self.provides_auto?(node, resource) - # Don't allow systemd under docker, it won't work in most cases. - return false if node['virtualization'] && %w{docker lxc}.include?(node['virtualization']['system']) service_resource_hints.include?(:systemd) end diff --git a/lib/poise_service/service_providers/upstart.rb b/lib/poise_service/service_providers/upstart.rb index <HASH>..<HASH> 100644 --- a/lib/poise_service/service_providers/upstart.rb +++ b/lib/poise_service/service_providers/upstart.rb @@ -30,8 +30,6 @@ module PoiseService provides(:upstart) def self.provides_auto?(node, resource) - # Don't allow upstart under docker, it won't work. - return false if node['virtualization'] && %w{docker lxc}.include?(node['virtualization']['system']) service_resource_hints.include?(:upstart) end
Remove the auto-disable for the Upstart and systemd providers under Docker. We are all the masters of our own destiny, and specifically for systemd it has become a lot more common to use it via kitchen-dokken. If you want to force the `:dummy` provider, do it via node attributes. Fixes #<I>.
poise_poise-service
train
rb,rb
61742d5307882be1e0aec36daf837a5c6d92e161
diff --git a/core/common/src/main/java/alluxio/util/io/BufferUtils.java b/core/common/src/main/java/alluxio/util/io/BufferUtils.java index <HASH>..<HASH> 100644 --- a/core/common/src/main/java/alluxio/util/io/BufferUtils.java +++ b/core/common/src/main/java/alluxio/util/io/BufferUtils.java @@ -26,13 +26,12 @@ import java.nio.channels.WritableByteChannel; import java.util.ArrayList; import java.util.List; -import javax.annotation.concurrent.NotThreadSafe; +import javax.annotation.concurrent.ThreadSafe; /** * Utilities related to buffers, not only {@link ByteBuffer}. */ -@NotThreadSafe -// TODO(jsimsa): Make this class thread-safe. +@ThreadSafe public final class BufferUtils { private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE); private static Method sCleanerCleanMethod; @@ -62,7 +61,7 @@ public final class BufferUtils { * * @param buffer the byte buffer to be unmapped, this must be a direct buffer */ - public static void cleanDirectBuffer(ByteBuffer buffer) { + public static synchronized void cleanDirectBuffer(ByteBuffer buffer) { Preconditions.checkNotNull(buffer); Preconditions.checkArgument(buffer.isDirect(), "buffer isn't a DirectByteBuffer"); try {
Making BufferUtils thread safe.
Alluxio_alluxio
train
java
06362ded5749de406b01dbf51ea5670a5f88174a
diff --git a/features/step_definitions/ci_steps.rb b/features/step_definitions/ci_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/ci_steps.rb +++ b/features/step_definitions/ci_steps.rb @@ -91,11 +91,11 @@ When /^I push to git$/ do end When /^I start the server$/ do - system! "cd testapp && rake ci:server_start" + system! "cd testapp && bundle exec rake ci:server_start" end When /^I bootstrap$/ do - system! "cd testapp && cap ci bootstrap" + system! "cd testapp && bundle exec cap ci bootstrap" end When /^I deploy$/ do @@ -104,12 +104,12 @@ end Then /^CI is green$/ do Timeout::timeout(300) do - until system("cd testapp && rake ci:status") + until system("cd testapp && bundle exec rake ci:status") sleep 5 end end end Then /^rake reports ci tasks as being available$/ do - `cd testapp && rake -T`.should include("ci:start") + `cd testapp && bundle exec rake -T`.should include("ci:start") end
Use bundle exec during ci steps that invoke rake tasks in testapp
pivotal-legacy_lobot
train
rb
bb2d890e4c2d153fea2eb625ba3d689b98e91f8b
diff --git a/default.js b/default.js index <HASH>..<HASH> 100644 --- a/default.js +++ b/default.js @@ -10,6 +10,9 @@ module.exports = validate({ 'main': ['./src/index.js'] }, module: { + preLoaders: [ + { test: /.js$/, exclude: /node_modules/, loader: 'eslint-loader' } + ], loaders: [ {test: /\.svg/, loader: 'svg-url-loader'}, {test: /.js$/, exclude: /node_modules/, loader: 'babel-loader', query: {presets: ['es2015']}}, @@ -38,7 +41,6 @@ module.exports = validate({ }),*/ new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.AggressiveMergingPlugin(), -// new HtmlWebpackPlugin({ template: 'src/index.html'}), new CopyWebpackPlugin([{ from: './src/i18n', to: 'i18n'
Added eslint-loader
kambi-sportsbook-widgets_widget-build-tools
train
js
4757a7cd04a1b0e9b2e1f72d65b9919bfc934e2d
diff --git a/lib/tty/command/process_runner.rb b/lib/tty/command/process_runner.rb index <HASH>..<HASH> 100644 --- a/lib/tty/command/process_runner.rb +++ b/lib/tty/command/process_runner.rb @@ -185,12 +185,15 @@ module TTY runtime = Time.now - Thread.current[:cmd_start] handle_timeout(runtime) rescue Errno::EAGAIN, Errno::EINTR - rescue Errno::EIO - # GNU/Linux `gets` raises when PTY slave is closed rescue EOFError, Errno::EPIPE, Errno::EIO readers.delete(reader) reader.close end + + unless alive?(@pid) + readers.delete(reader) + reader.close + end end end puts "READER THREAD DEAD!"
Change to ensure if child process died reader is closed
piotrmurach_tty-command
train
rb
3c88f7d27819a4814808afd0fed3a409e82e74e2
diff --git a/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java b/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java +++ b/src/main/java/com/smartsheet/api/internal/FolderResourcesImpl.java @@ -69,13 +69,10 @@ public class FolderResourcesImpl extends AbstractResources implements FolderReso */ public Folder getFolder(long folderId, EnumSet<SourceInclusion> includes) throws SmartsheetException { String path = "folders/" + folderId; - HashMap<String, String> parameters = new HashMap<String, String>(); - - if (includes != null) { - parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); - } - + HashMap<String, Object> parameters = new HashMap<String, Object>(); + parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); path += QueryUtil.generateUrl(null, parameters); + return this.getResource(path, Folder.class); }
Implemented query util changes to Hashmap<String, Object> instead of Hashmap<String, String>
smartsheet-platform_smartsheet-java-sdk
train
java
f799ff6b4859c57276912e27f0f30b14c630c4ab
diff --git a/src/CrazyCodr/Pdo/Oci8.php b/src/CrazyCodr/Pdo/Oci8.php index <HASH>..<HASH> 100644 --- a/src/CrazyCodr/Pdo/Oci8.php +++ b/src/CrazyCodr/Pdo/Oci8.php @@ -456,6 +456,7 @@ class Oci8 $returnParams['hostname'] = $hostname; $returnParams['port'] = $port; $returnParams['dbname'] = $dbname; + if(isset($sidValue)) $returnParams['sid'] = $sidValue; //Return the resulting configuration return $returnParams;
Bugfix - forgot to return SID from dsn!
yajra_pdo-via-oci8
train
php
edd3cffc2608b5de3a59f7b3238f482d24858219
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -128,5 +128,5 @@ attach.local = function(stream, opts, callback) { opts = {}; } - attach(stream, extend({ muted: true }, opts), callback); + attach(stream, extend({ muted: true, mirror: true }, opts), callback); };
attach.local mirrors by default - closes #1
rtc-io_rtc-attach
train
js
7c36249e19f8354ceb2191053b883c661c86e39d
diff --git a/bokeh/server/models/user.py b/bokeh/server/models/user.py index <HASH>..<HASH> 100644 --- a/bokeh/server/models/user.py +++ b/bokeh/server/models/user.py @@ -15,6 +15,8 @@ def apiuser_from_request(app, request): return None username = request.headers['BOKEHUSER'] bokehuser = User.load(app.servermodel_storage, username) + if bokehuser is None: + return None if bokehuser.apikey == apikey: return bokehuser else:
should return none if user does not exist
bokeh_bokeh
train
py
2a37f21f9505ded4631a8f64300e81248ffcdcf1
diff --git a/core-bundle/contao/drivers/DC_Table.php b/core-bundle/contao/drivers/DC_Table.php index <HASH>..<HASH> 100644 --- a/core-bundle/contao/drivers/DC_Table.php +++ b/core-bundle/contao/drivers/DC_Table.php @@ -4302,7 +4302,7 @@ Backend.makeParentViewSortable("ul_' . CURRENT_ID . '"); // call the panelLayout_callbacck default: - $arrCallback = $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['panelLayout_callback'][$strSubPanelKey]; + $arrCallback = $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['panel_callback'][$strSubPanelKey]; if (is_array($arrCallback)) { $this->import($arrCallback[0]);
[Core] the callback is now named "panel_callback"
contao_contao
train
php
3085161a1ef0468179378513d5e79472a8cdd517
diff --git a/packages/helix-shared-bounce/src/bounce.js b/packages/helix-shared-bounce/src/bounce.js index <HASH>..<HASH> 100644 --- a/packages/helix-shared-bounce/src/bounce.js +++ b/packages/helix-shared-bounce/src/bounce.js @@ -68,6 +68,8 @@ function bounce(func, { responder, timeout = 500 }) { // we acted as a gateway, but there was an error with the network connection status: 502, }); + } finally { + signal.clear(); } })();
fix(bounce): prevent the process from hanging
adobe_helix-shared
train
js
ca842e82de28a2c5ff6b9cb63368598b53263e5e
diff --git a/lib/ProMotion/classes/Screen.rb b/lib/ProMotion/classes/Screen.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/classes/Screen.rb +++ b/lib/ProMotion/classes/Screen.rb @@ -1,6 +1,6 @@ module ProMotion # Instance methods - class Screen + class Screen > UIViewController include ProMotion::ScreenNavigation include ProMotion::ScreenElements include ProMotion::SystemHelper @@ -29,7 +29,7 @@ module ProMotion # Note: this is overridden in TableScreen def load_view_controller - self.view_controller ||= ViewController + self.view_controller ||= self end def set_tab_bar_item(args = {}) @@ -127,6 +127,10 @@ module ProMotion self.view_controller end + def view_controller + self + end + def should_rotate(orientation) case orientation when UIInterfaceOrientationPortrait diff --git a/lib/ProMotion/classes/TableScreen.rb b/lib/ProMotion/classes/TableScreen.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/classes/TableScreen.rb +++ b/lib/ProMotion/classes/TableScreen.rb @@ -4,9 +4,6 @@ module ProMotion include MotionTable::PlainTable include MotionTable::SearchableTable - def view - self.view_controller.view - end def load_view_controller check_table_data_method
Changed screen to extend UIViewController
infinitered_ProMotion
train
rb,rb
f18d0c3bffff494349cd7099667a8fb0fc167ed2
diff --git a/src/term/noun/noun.js b/src/term/noun/noun.js index <HASH>..<HASH> 100644 --- a/src/term/noun/noun.js +++ b/src/term/noun/noun.js @@ -20,6 +20,9 @@ class Noun extends Term { if (tag) { this.pos[tag] = true; } + if (this.is_plural()) { + this.pos['Plural'] = true; + } } //noun methods article() {
pluralize nouns on init
spencermountain_compromise
train
js
627658b9490df1252afe8321a7594fed20136af1
diff --git a/test/BasicServerTest.php b/test/BasicServerTest.php index <HASH>..<HASH> 100644 --- a/test/BasicServerTest.php +++ b/test/BasicServerTest.php @@ -2,6 +2,8 @@ namespace Wrench; +use Psr\Log\NullLogger; + /** * Tests the BasicServer class */ @@ -16,7 +18,7 @@ class BasicServerTest extends ServerTest { $server = $this->getInstance('ws://localhost:8000', [ 'allowed_origins' => $allowed, - 'logger' => [$this, 'log'], + 'logger' => new NullLogger(), ]); $connection = $this->getMockBuilder(Connection::class) @@ -43,7 +45,7 @@ class BasicServerTest extends ServerTest { $server = $this->getInstance('ws://localhost:8000', [ 'allowed_origins' => $allowed, - 'logger' => [$this, 'log'], + 'logger' => new NullLogger(), ]); $connection = $this->getMockBuilder(Connection::class) @@ -69,8 +71,7 @@ class BasicServerTest extends ServerTest return array_merge(parent::getValidConstructorArguments(), [ [ 'ws://localhost:8000', - ['logger' => function () { - }], + ['logger' => new NullLogger()], ], ]); }
fix: tests failed on "new" logging monolog (not closure) logger
varspool_Wrench
train
php
ed61bacec5d8f1feee05f4850aae1bca502c9414
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -236,7 +236,11 @@ editor, Python console, etc.""", platforms=['any'], packages=get_packages(), package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST), - 'spyplugins': get_package_data('spyplugins', EXTLIST), + 'spyder_breakpoints': get_package_data('spyder_breakpoints', EXTLIST), + 'spyder_profiler': get_package_data('spyder_profiler', EXTLIST), + 'spyder_pylint': get_package_data('spyder_pylint', EXTLIST), + 'spyderio_dcm': get_package_data('spyderio_dcm', EXTLIST), + 'spyderio_hdf5': get_package_data('spyderio_hdf5', EXTLIST), }, scripts=[osp.join('scripts', fname) for fname in SCRIPTS], data_files=get_data_files(),
Update setup.py for new plugin structure
spyder-ide_spyder
train
py
633d0c9edd76d22e2a19785e9ccdc4edc3b46ef6
diff --git a/src/Config/console.config.php b/src/Config/console.config.php index <HASH>..<HASH> 100644 --- a/src/Config/console.config.php +++ b/src/Config/console.config.php @@ -22,6 +22,6 @@ return [ - 'version' => '3.0.0-beta1', + 'version' => '3.0.0-beta2', ];
<I>-beta2
eveseat_console
train
php
a794000bf9d3358378cff183208d876ab6259583
diff --git a/bika/lims/browser/bika_listing.py b/bika/lims/browser/bika_listing.py index <HASH>..<HASH> 100644 --- a/bika/lims/browser/bika_listing.py +++ b/bika/lims/browser/bika_listing.py @@ -440,7 +440,7 @@ class BikaListingView(BrowserView): return toggle_cols def GET_url(self, **kwargs): - url = self.context.absolute_url() + url = self.request['URL'].split("?")[0] query = {} for x in "pagenumber", "pagesize", "review_state": if str(getattr(self, x)) != 'None':
issue #<I>: bad url in listing views the url for review state selectors was incorrectly set to context.absolute_url() instead of the actual URL.
senaite_senaite.core
train
py
491415b086568829f47752b66108d9f71df0ae49
diff --git a/src/Bkwld/Decoy/Helpers.php b/src/Bkwld/Decoy/Helpers.php index <HASH>..<HASH> 100644 --- a/src/Bkwld/Decoy/Helpers.php +++ b/src/Bkwld/Decoy/Helpers.php @@ -500,4 +500,13 @@ class Helpers { return $this->is_handling; } + /** + * Force Decoy to believe that it's handling or not handling the request + * @param boolean $bool + * @return void + */ + public function forceHandling($bool) { + $this->is_handling = $bool; + } + }
Adding a method to force decoy into believing it's not handling a request Needed this on a project where I was calling FE route renderers from an admin controller
BKWLD_decoy
train
php
4e3a2620bc37b27425dc2a88906428b746d13751
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -168,7 +168,8 @@ function CommandError(err) { this.stack = err.stack, this.buffer = err.buffer, this.status = err.status + Error.captureStackTrace(this, CommandError); } -CommandError.prototype = new Error(); +CommandError.prototype = Object.create(Error.prototype); CommandError.prototype.constructor = CommandError;
update `CommandError` - correct inheritance
tunnckoCore_async-exec-cmd
train
js
5d697d7e23c4eeecfecb0c264a7f6c50f4992ff6
diff --git a/demo/MINDCUB3R/rubiks.py b/demo/MINDCUB3R/rubiks.py index <HASH>..<HASH> 100755 --- a/demo/MINDCUB3R/rubiks.py +++ b/demo/MINDCUB3R/rubiks.py @@ -31,6 +31,8 @@ class Rubiks(object): hold_cube_pos = 85 rotate_speed = 400 + flip_speed = 300 + flip_speed_push = 400 corner_to_edge_diff = 60 def __init__(self): @@ -208,7 +210,7 @@ class Rubiks(object): self.flipper.run_to_abs_pos(position_sp=190, # ramp_up_sp=200, # ramp_down_sp=0, - speed_sp=400) + speed_sp=self.flip_speed) self.flipper.wait_for_running() self.flipper.wait_for_position(180, stall_ok=True) @@ -217,7 +219,7 @@ class Rubiks(object): self.flipper.run_to_abs_pos(position_sp=Rubiks.hold_cube_pos, # ramp_up_sp=200, # ramp_down_sp=400, - speed_sp=600) + speed_sp=self.flip_speed_push) self.flipper.wait_for_running() self.flipper.wait_for_position(Rubiks.hold_cube_pos, stall_ok=True)
MINDCUB3R added flip_speed and flip_speed_push
ev3dev_ev3dev-lang-python
train
py
a17f17139b76304920e0ed15e724fa52cb2ad3a0
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/SecurityExtension.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/SecurityExtension.php @@ -138,7 +138,7 @@ class SecurityExtension extends Extension $loader->load('security_templates.xml'); foreach ($this->fixConfig($config, 'template') as $template) { - $loader->load($container->getParameterBag()->resolveValue($template)); + $loader->load($c->getParameterBag()->resolveValue($template)); } $container->merge($c);
[FrameworkBundle] fixed typo
symfony_symfony
train
php
f6aacf02df37562b2fa5940c322195769ef98baa
diff --git a/lib/loglevel.js b/lib/loglevel.js index <HASH>..<HASH> 100644 --- a/lib/loglevel.js +++ b/lib/loglevel.js @@ -9,7 +9,7 @@ var undefinedType = "undefined"; (function (name, definition) { - if (typeof module !== 'undefined') { + if (typeof module === 'object' && module.exports && typeof require === 'function') { module.exports = definition(); } else if (typeof define === 'function' && typeof define.amd === 'object') { define(definition);
Reduce false positives when detecting CommonsJS Some environments, like QUnit, provide a 'module' object that can trick loglevel into thinking it's running within CommonsJS. Be more strict by checking that module is an object, it has an exports property, and the require function is defined.
pimterry_loglevel
train
js
bf03d3dc3bcb4e5a96c3dca3a18b97166658dee1
diff --git a/ykman/cli/piv.py b/ykman/cli/piv.py index <HASH>..<HASH> 100644 --- a/ykman/cli/piv.py +++ b/ykman/cli/piv.py @@ -73,11 +73,11 @@ def click_parse_management_key(ctx, param, val): try: key = a2b_hex(val) if key and len(key) != 24: - return ValueError('Management key must be exactly 24 bytes ' - '(48 hexadecimal digits) long.') + raise ValueError('Management key must be exactly 24 bytes ' + '(48 hexadecimal digits) long.') return key except Exception: - return ValueError(val) + raise ValueError(val) click_slot_argument = click.argument('slot', callback=click_parse_piv_slot)
Raise parse errors instead of returning them
Yubico_yubikey-manager
train
py
08a2e05a36f1b24f1494356bf26512b2778c6ba3
diff --git a/include/dependencymanager_class.php b/include/dependencymanager_class.php index <HASH>..<HASH> 100644 --- a/include/dependencymanager_class.php +++ b/include/dependencymanager_class.php @@ -1,4 +1,4 @@ -<? +<?php /** * class DependencyManager * Singleton class for managing dependencies as templates render @@ -27,7 +27,7 @@ class DependencyManager { } static function display() { $ret = ""; -//print_pre(self::$dependencies); + //print_pre(self::$dependencies); foreach (self::$dependencies as $priority=>$browsers) { foreach ($browsers as $browser=>$types) { // FIXME - we're not actually wrapping the per-browser dependencies in their proper conditional comments yet @@ -106,7 +106,6 @@ abstract class Dependency { $ret = new DependencyMeta($args); break; case 'jstemplate': - print_pre('JSTEMPLATE'); $ret = new DependencyJSTemplate($args); break; default: @@ -237,7 +236,7 @@ class DependencyOnload extends Dependency { function Display($locations, $extras=NULL) { if (!empty($this->code)) - $ret = sprintf('<script type="text/javascript">thefind.onloads.add(%s);</script>'."\n", json_encode($this->code)); + $ret = sprintf('<script type="text/javascript">elation.onloads.add(%s);</script>'."\n", json_encode($this->code)); return $ret; } }
Merge branch 'master' of git://github.com/jbaicoianu/elation Conflicts: include/dependencymanager_class.php
jbaicoianu_elation
train
php
21e0d1ae620e0b9984f5e1acebb62735ff737716
diff --git a/service/systemd/service.go b/service/systemd/service.go index <HASH>..<HASH> 100644 --- a/service/systemd/service.go +++ b/service/systemd/service.go @@ -231,7 +231,6 @@ func (s *Service) Start() error { return errors.Trace(err) } - // TODO(ericsnow) Add timeout support? status := <-statusCh if status != "done" { return errors.Errorf("failed to start service %s", s.Service.Name) @@ -258,7 +257,6 @@ func (s *Service) Stop() error { return errors.Trace(err) } - // TODO(ericsnow) Add timeout support? status := <-statusCh if status != "done" { return errors.Errorf("failed to stop service %s", s.Service.Name)
Drop the timeout-related TODOs.
juju_juju
train
go
de262543aeed6cd40ce3f2cb62c306ec9ee71143
diff --git a/scripts/homestead.rb b/scripts/homestead.rb index <HASH>..<HASH> 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -105,6 +105,7 @@ class Homestead 4040 => 4040, 5432 => 54320, 8025 => 8025, + 9600 => 9600, 27017 => 27017 }
Update homestead.rb to include <I> port forward (#<I>) The docs indicate that <I> is included in the default port forwards for MinIo. Updated homestead.rb to reflect this.
laravel_homestead
train
rb
76f246ae6a5a543c2b302b1a1f61a4223be177eb
diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -158,7 +158,7 @@ module Fluent if tw tw.unwatched = unwatched if immediate - close_watcher(tw) + close_watcher(tw, false) else close_watcher_after_rotate_wait(tw) end @@ -173,8 +173,12 @@ module Fluent close_watcher_after_rotate_wait(rotated_tw) if rotated_tw end - def close_watcher(tw) - tw.close + # TailWatcher#close is called by another thread at shutdown phase. + # It causes 'can't modify string; temporarily locked' error in IOHandler + # so adding close_io argument to avoid this problem. + # At shutdown, IOHandler's io will be released automatically after detached the event loop + def close_watcher(tw, close_io = true) + tw.close(close_io) flush_buffer(tw) if tw.unwatched && @pf @pf[tw.path].update_pos(PositionFile::UNWATCHED_POSITION) @@ -314,8 +318,8 @@ module Fluent @stat_trigger.detach if @stat_trigger.attached? end - def close - if @io_handler + def close(close_io = true) + if close_io && @io_handler @io_handler.on_notify @io_handler.close end
Fix in_tail shutdown race condition problem
fluent_fluentd
train
rb
f7f0c818f415d5ebb1e660e6f61592ca735704ae
diff --git a/Task/Collect/PluginTypesCollector.php b/Task/Collect/PluginTypesCollector.php index <HASH>..<HASH> 100644 --- a/Task/Collect/PluginTypesCollector.php +++ b/Task/Collect/PluginTypesCollector.php @@ -3,7 +3,7 @@ namespace DrupalCodeBuilder\Task\Collect; use DrupalCodeBuilder\Environment\EnvironmentInterface; -use Exception; +use Throwable; /** * Task helper for collecting data on plugin types. @@ -602,8 +602,9 @@ class PluginTypesCollector extends CollectorBase { $service = \Drupal::service($data['service_id']); try { $definitions = $service->getDefinitions(); - } - catch (Exception $e) { + } + // Catch errors as well as exceptions; some contrib plugin managers crash! + catch (Throwable $e) { return FALSE; }
Fixed plugin types collector to catch errors from plugin managers as well as exceptions. Fixes #<I>.
drupal-code-builder_drupal-code-builder
train
php
65e4efed801039551098e3c9029b758545ddc79e
diff --git a/openquake/server/tests/tests.py b/openquake/server/tests/tests.py index <HASH>..<HASH> 100644 --- a/openquake/server/tests/tests.py +++ b/openquake/server/tests/tests.py @@ -115,8 +115,8 @@ class EngineServerTestCase(unittest.TestCase): def setUp(self): if sys.version_info[0] == 2: # Python 2 - # for mysterious reasons the tests hang on Python 2 but the - # WebUI works correctly + # in Python 2 the tests fail when doing _lgeos = load_dll( + # 'geos_c', fallbacks=['libgeos_c.so.1', 'libgeos_c.so']) raise unittest.SkipTest('Python 2') # tests
Updated comment [skip CI]
gem_oq-engine
train
py
6395c5c0c1a6a6da02eb0ce5ae73423467fbe8b2
diff --git a/packages/orbit-components/src/Icon/Icon.stories.js b/packages/orbit-components/src/Icon/Icon.stories.js index <HASH>..<HASH> 100644 --- a/packages/orbit-components/src/Icon/Icon.stories.js +++ b/packages/orbit-components/src/Icon/Icon.stories.js @@ -8,6 +8,10 @@ import * as Icons from "../icons"; import { ICON_SIZES, ICON_COLORS } from "./consts"; import RenderInRtl from "../utils/rtl/RenderInRtl"; +export default { + title: "Icon", +}; + export const Default = () => { const size = select("Size", [null, ...Object.values(ICON_SIZES)]); const color = select("Color", [null, ...Object.values(ICON_COLORS)]);
fix: add default export for Icon stories (#<I>)
kiwicom_orbit-components
train
js
d55e614940a4fd793718ec183f3c5597803b8b78
diff --git a/lib/chef/resource/sudo.rb b/lib/chef/resource/sudo.rb index <HASH>..<HASH> 100644 --- a/lib/chef/resource/sudo.rb +++ b/lib/chef/resource/sudo.rb @@ -171,7 +171,6 @@ class Chef end else declare_resource(:template, "#{target}#{new_resource.filename}") do - source "sudoer.erb" source ::File.expand_path("../support/sudoer.erb", __FILE__) local true mode "0440"
Remove duplicate source property in the sudo resource This was just a typo that came in from the sudo cookbook
chef_chef
train
rb
ae1a878231fa361e6898477dce4cc9f153f675ee
diff --git a/lib/locomotive/steam/initializers/dragonfly.rb b/lib/locomotive/steam/initializers/dragonfly.rb index <HASH>..<HASH> 100644 --- a/lib/locomotive/steam/initializers/dragonfly.rb +++ b/lib/locomotive/steam/initializers/dragonfly.rb @@ -26,7 +26,9 @@ module Locomotive fetch_url_whitelist /.+/ end - ::Dragonfly.logger = Locomotive::Common::Logger.instance + if ::Dragonfly.logger.nil? + ::Dragonfly.logger = Locomotive::Common::Logger.instance + end end def find_imagemagick_commands diff --git a/lib/locomotive/steam/middlewares/site.rb b/lib/locomotive/steam/middlewares/site.rb index <HASH>..<HASH> 100644 --- a/lib/locomotive/steam/middlewares/site.rb +++ b/lib/locomotive/steam/middlewares/site.rb @@ -6,8 +6,8 @@ module Locomotive::Steam class Site < ThreadSafe def _call - site = services.site_finder.find - env['steam.site'] = services.repositories.current_site = site + env['steam.site'] ||= services.site_finder.find + services.repositories.current_site = env['steam.site'] end end
do not change the Dragonfly logger if already present + use the current site from rack env if present
locomotivecms_steam
train
rb,rb
ddd8db99555ad5edcbfd02c80bd2db7f0a29d34f
diff --git a/src/test/java/one/util/streamex/StreamExTest.java b/src/test/java/one/util/streamex/StreamExTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/one/util/streamex/StreamExTest.java +++ b/src/test/java/one/util/streamex/StreamExTest.java @@ -1669,10 +1669,11 @@ public class StreamExTest { } // reimplemented filter operation (TCO) - @SuppressWarnings("unchecked") private static <T> StreamEx<T> filter(StreamEx<T> input, Predicate<T> predicate) { - return input.<T>headTail((head, tail) -> filter(tail, predicate).prepend( - (T[]) (predicate.test(head) ? new Object[] { head } : new Object[0]))); + return input.<T>headTail((head, tail) -> { + StreamEx<T> filtered = filter(tail, predicate); + return predicate.test(head) ? filtered.prepend(head) : filtered; + }); } @Test
[#<I>] Cosmetic changes in tests
amaembo_streamex
train
java
53fdb65d8ab5a1ba949c31ef0ac1d0c439949d93
diff --git a/src/main/java/org/craftercms/deployer/impl/processors/FileOutputProcessor.java b/src/main/java/org/craftercms/deployer/impl/processors/FileOutputProcessor.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/craftercms/deployer/impl/processors/FileOutputProcessor.java +++ b/src/main/java/org/craftercms/deployer/impl/processors/FileOutputProcessor.java @@ -104,8 +104,8 @@ public class FileOutputProcessor extends AbstractPostDeploymentProcessor { protected File getOutputFile(Deployment deployment) { String targetId = deployment.getTarget().getId(); - String outputFilename = targetId + "-deployments"; - File outputFile = new File(outputFolder, outputFilename + ".csv"); + String outputFilename = targetId + "-deployments.csv"; + File outputFile = new File(outputFolder, outputFilename); return outputFile; }
Minor fix after removing timestamp from file name
craftercms_deployer
train
java
22718380287ceae312603c52ddd59315bd146571
diff --git a/src/streamcorpus_pipeline/_pipeline.py b/src/streamcorpus_pipeline/_pipeline.py index <HASH>..<HASH> 100644 --- a/src/streamcorpus_pipeline/_pipeline.py +++ b/src/streamcorpus_pipeline/_pipeline.py @@ -130,6 +130,8 @@ class Pipeline(object): self._writers = [] for name in config['writers']: _writer_config = config.get(name, {}) + if _writer_config is None: + _writer_config = dict() _writer_config['tmp_dir_path'] = config.get('tmp_dir_path') self._writers.append( _init_stage(name, _writer_config, external_stages))
allowing a writer to have an empty config block
trec-kba_streamcorpus-pipeline
train
py
edadefdb8a6fc6590b418dce704beee10a9541e7
diff --git a/lib/podio.rb b/lib/podio.rb index <HASH>..<HASH> 100644 --- a/lib/podio.rb +++ b/lib/podio.rb @@ -25,7 +25,7 @@ module Podio end def with_client - old_client = Podio.client.dup + old_client = Podio.client.try(:dup) yield ensure Podio.client = old_client
With client should work even when there is no previous client
podio_podio-rb
train
rb
c9cd44f84d09408ca51715f5ca0c79e8e590fc5a
diff --git a/oceansdb/utils.py b/oceansdb/utils.py index <HASH>..<HASH> 100644 --- a/oceansdb/utils.py +++ b/oceansdb/utils.py @@ -94,10 +94,10 @@ def dbsource(dbname, var, resolution=None, tscale=None): filename = os.path.join(dbpath, os.path.basename(urlparse(c['url']).path)) - if 'varnames' in cfg['vars'][var][resolution]: - datafiles.append(Dataset_flex(filename, - aliases=cfg['vars'][var][resolution]['varnames'])) - else: - datafiles.append(Dataset_flex(filename)) + if 'varnames' in cfg['vars'][var][resolution]: + datafiles.append(Dataset_flex(filename, + aliases=cfg['vars'][var][resolution]['varnames'])) + else: + datafiles.append(Dataset_flex(filename)) return datafiles
BUGFIX. Was loading only one time step. Wrong identation level when loading the sequence of timesteps of netCDFs.
castelao_oceansdb
train
py
fcca183d19507514dc79008b7d65fcccca361335
diff --git a/lib/savon/client.rb b/lib/savon/client.rb index <HASH>..<HASH> 100644 --- a/lib/savon/client.rb +++ b/lib/savon/client.rb @@ -50,7 +50,7 @@ module Savon super if wsdl? && !@wsdl.respond_to?(method) setup operation_from(method), &block - dispatch method + Response.new @request.soap(@soap) end # Returns a SOAP operation Hash containing the SOAP action and input @@ -81,11 +81,5 @@ module Savon end end - # Dispatches a given +soap_action+ and returns a Savon::Response instance. - def dispatch(soap_action) - response = @request.soap @soap - Response.new response - end - end end
moved single-line dispatch method to method_missing
savonrb_savon
train
rb
88c69f430949329e1e9fec42c70a99fe9cb0cb6e
diff --git a/lib/pseudohiki/htmlformat.rb b/lib/pseudohiki/htmlformat.rb index <HASH>..<HASH> 100644 --- a/lib/pseudohiki/htmlformat.rb +++ b/lib/pseudohiki/htmlformat.rb @@ -51,7 +51,7 @@ module PseudoHiki end def visited_result(element) - visitor = @formatter[element.class]||@formatter[PlainNode] + visitor = @formatter[element.class] || @formatter[PlainNode] element.accept(visitor) end @@ -144,7 +144,7 @@ module PseudoHiki htmlelement = create_self_element url = ref.join htmlelement[HREF] = url.start_with?("#".freeze) ? url.upcase : url - htmlelement.push caption||url + htmlelement.push caption || url end htmlelement end @@ -152,7 +152,7 @@ module PseudoHiki def caption_and_ref(tree) caption, ref = split_into_parts(tree, LinkSep) caption = ref ? caption.map {|token| visited_result(token) } : nil - return caption, ref||tree + return caption, ref || tree end def ref_tail(tree, caption)
added spaces for the consistency of coding style
nico-hn_PseudoHikiParser
train
rb
6d82416c48978a9475ae389643730d537f392d03
diff --git a/pycons3rt/awsapi/metadata.py b/pycons3rt/awsapi/metadata.py index <HASH>..<HASH> 100644 --- a/pycons3rt/awsapi/metadata.py +++ b/pycons3rt/awsapi/metadata.py @@ -35,16 +35,16 @@ metadata_url = 'http://169.254.169.254/latest/meta-data/' def is_aws(): """Determines if this system is on AWS - :return: bool + :return: bool True if this system is running on AWS """ log = logging.getLogger(mod_logger + '.is_aws') - log.info('Querying URL: %s', metadata_url) + log.info('Querying AWS meta data URL: {u}'.format(u=metadata_url)) + # Query the AWS meta data URL try: response = urllib.urlopen(metadata_url) except(IOError, OSError) as ex: - log.info('Unable to query URL: {u}, assuming this is NOT AWS\{e}'.format( - u=metadata_url, e=ex)) + log.info('Unable to query the AWS meta data URL, this system is NOT running on AWS') return False # Check the code
Fixed logging in the is_aws method
cons3rt_pycons3rt
train
py
6e00fea46b860f19be8d736e87038b6c31146c53
diff --git a/lib/gcloud/search/api_client.rb b/lib/gcloud/search/api_client.rb index <HASH>..<HASH> 100644 --- a/lib/gcloud/search/api_client.rb +++ b/lib/gcloud/search/api_client.rb @@ -28,7 +28,8 @@ module Gcloud ## # Creates a new APIClient instance. def initialize _options - @connection = Faraday.default_connection + @connection = Faraday.new request: { + params_encoder: Faraday::FlatParamsEncoder } end def discovered_api name, version
Call Cloud Search API with multiple querystring values Faraday re-parses the URI provided to it, so make sure it is using the flat parameters setting. [fixes #<I>]
googleapis_google-cloud-ruby
train
rb
c129dc9c7f99915d5280fd9a85299b04cb3bcc41
diff --git a/javascript/node/selenium-webdriver/lib/by.js b/javascript/node/selenium-webdriver/lib/by.js index <HASH>..<HASH> 100644 --- a/javascript/node/selenium-webdriver/lib/by.js +++ b/javascript/node/selenium-webdriver/lib/by.js @@ -429,4 +429,5 @@ module.exports = { withTagName: withTagName, locateWith: locateWith, checkedLocator: check, + escapeCss: escapeCss } diff --git a/javascript/node/selenium-webdriver/lib/webdriver.js b/javascript/node/selenium-webdriver/lib/webdriver.js index <HASH>..<HASH> 100644 --- a/javascript/node/selenium-webdriver/lib/webdriver.js +++ b/javascript/node/selenium-webdriver/lib/webdriver.js @@ -1472,7 +1472,7 @@ class WebDriver { if (params.method === 'Runtime.bindingCalled') { let payload = JSON.parse(params['params']['payload']) let elements = await this.findElements({ - css: '*[data-__webdriver_id=' + payload['target'], + css: '*[data-__webdriver_id=' + by.escapeCss(payload['target']) + ']', }) if (elements.length === 0) {
[js] Fix flaky CDP dom mutation (#<I>)
SeleniumHQ_selenium
train
js,js
bb98ac761fad08204cb7ad9fac9e6b22e283f5e0
diff --git a/lib/Cake/Console/ConsoleInput.php b/lib/Cake/Console/ConsoleInput.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Console/ConsoleInput.php +++ b/lib/Cake/Console/ConsoleInput.php @@ -41,7 +41,7 @@ class ConsoleInput { * * @var bool */ - private $__canReadline; + protected $_canReadline; /** * Constructor @@ -49,7 +49,7 @@ class ConsoleInput { * @param string $handle The location of the stream to use as input. */ public function __construct($handle = 'php://stdin') { - $this->__canReadline = extension_loaded('readline') && $handle == 'php://stdin' ? true : false; + $this->_canReadline = extension_loaded('readline') && $handle == 'php://stdin' ? true : false; $this->_input = fopen($handle, 'r'); } @@ -59,7 +59,7 @@ class ConsoleInput { * @return mixed The value of the stream */ public function read() { - if ($this->__canReadline) { + if ($this->_canReadline) { $line = readline(''); if (!empty($line)) { readline_add_history($line);
ConsoleInput::_canReadLine change from private -> protected
cakephp_cakephp
train
php
073ed5a714ea838973606b19f650f9aed1ee3b00
diff --git a/blueocean-web/gulpfile.js b/blueocean-web/gulpfile.js index <HASH>..<HASH> 100644 --- a/blueocean-web/gulpfile.js +++ b/blueocean-web/gulpfile.js @@ -11,7 +11,7 @@ fs.writeFile('target/classes/io/jenkins/blueocean/revisionInfo.js', revisionInfo if (err) throw err; }); gi(function (err, result) { - if (err) throw err; + if (err) return console.log(err); result.timestamp = new Date().toISOString(); const revisionInfo = '/* eslint-disable */\n// Do not edit, it is generated and will be on each build.\nexport default ' + JSON.stringify(result); fs.writeFile('target/classes/io/jenkins/blueocean/revisionInfo.js', revisionInfo, err => {
[hotfix/UX-<I>] We do not need to leave the build, we only will not show the footer neither
jenkinsci_blueocean-plugin
train
js
a39133179197e9b9f9bbc5ae3ad9d32209410f2c
diff --git a/.github/build-packages.php b/.github/build-packages.php index <HASH>..<HASH> 100644 --- a/.github/build-packages.php +++ b/.github/build-packages.php @@ -14,7 +14,7 @@ $packages = array(); $flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0; foreach ($dirs as $k => $dir) { - if (!system("git diff --name-only $mergeBase -- $dir", $exitStatus)) { + if (!system("git diff --name-only \"$mergeBase\" -- $dir", $exitStatus)) { if ($exitStatus) { exit($exitStatus); }
[appveyor] minor CI fix
symfony_symfony
train
php
0bf66564cf7be587be7f12d78e4d8a2fda2b73b0
diff --git a/interact.js b/interact.js index <HASH>..<HASH> 100644 --- a/interact.js +++ b/interact.js @@ -1645,7 +1645,7 @@ * action must be enabled for the target Interactable and an appropriate number * of pointers must be held down – 1 for drag/resize, 2 for gesture. * - * Use it with interactable.<action>able({ manualStart: false }) to always + * Use it with `interactable.<action>able({ manualStart: false })` to always * [start actions manually](https://github.com/taye/interact.js/issues/114) * - action (object) The action to be performed - drag, resize, etc. @@ -1667,7 +1667,7 @@ | event.interactable, | event.currentTarget); | } - }); + | }); \*/ start: function (action, interactable, element) { if (this.interacting()
Fix jsdoc comments for Interaction.start()
taye_interact.js
train
js
9e3a6cfd381899b3a03a5830b9978e8eb1de465b
diff --git a/h2o-bindings/bin/custom/R/gen_rulefit.py b/h2o-bindings/bin/custom/R/gen_rulefit.py index <HASH>..<HASH> 100644 --- a/h2o-bindings/bin/custom/R/gen_rulefit.py +++ b/h2o-bindings/bin/custom/R/gen_rulefit.py @@ -41,6 +41,6 @@ predictors <- c("age", "sibsp", "parch", "fare", "sex", "pclass") titanic[,response] <- as.factor(titanic[,response]) titanic[,"pclass"] <- as.factor(titanic[,"pclass"]) rfit <- h2o.rulefit(y = response, x = predictors, training_frame = titanic, max_rule_length = 10, -max_num_rules=100, seed=1234, model_type="rules") +max_num_rules = 100, seed = 1, model_type = "rules") """ )
Update h2o-bindings/bin/custom/R/gen_rulefit.py
h2oai_h2o-3
train
py
64d14ebead562dedbdf1a561c389eb9bea1eff8b
diff --git a/apio/__init__.py b/apio/__init__.py index <HASH>..<HASH> 100644 --- a/apio/__init__.py +++ b/apio/__init__.py @@ -4,7 +4,7 @@ # -- Author Jesús Arroyo # -- Licence GPLv2 -VERSION = (0, 3, 2) +VERSION = (0, 4, '0b1') __version__ = ".".join([str(s) for s in VERSION]) __title__ = 'apio' diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,9 +54,9 @@ author = u'Jesús Arroyo Torrens' # built documents. # # The short X.Y version. -version = u'0.3.2' +version = u'0.4.0' # The full version, including alpha/beta/rc tags. -release = u'0.3.2' +release = u'0.4.0b1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Bump to version <I>b1
FPGAwars_apio
train
py,py
11fd7a07e246ce2396d6ee03311945f940188fcb
diff --git a/fastaggregation.go b/fastaggregation.go index <HASH>..<HASH> 100644 --- a/fastaggregation.go +++ b/fastaggregation.go @@ -301,9 +301,6 @@ func (x1 *Bitmap) AndAny(bitmaps ...*Bitmap) { tmpBitmap = newBitmapContainer() } tmpBitmap.resetTo(keyContainers[0]) - for _, c := range keyContainers[1:] { - tmpBitmap.ior(c) - } ored = tmpBitmap } else { if tmpArray == nil { @@ -311,11 +308,11 @@ func (x1 *Bitmap) AndAny(bitmaps ...*Bitmap) { } tmpArray.realloc(maxPossibleOr) tmpArray.resetTo(keyContainers[0]) - for _, c := range keyContainers[1:] { - tmpArray.ior(c) - } ored = tmpArray } + for _, c := range keyContainers[1:] { + ored = ored.ior(c) + } } result := x1.highlowcontainer.getWritableContainerAtIndex(basePos).iand(ored)
Stop assuming ior is in-place for AndAny.
RoaringBitmap_roaring
train
go
37defdde4f0623dabc5ef54467afc21ba069632f
diff --git a/lib/visitor/evaluator.js b/lib/visitor/evaluator.js index <HASH>..<HASH> 100644 --- a/lib/visitor/evaluator.js +++ b/lib/visitor/evaluator.js @@ -339,7 +339,7 @@ Evaluator.prototype.visitBinOp = function(binop){ Evaluator.prototype.visitUnaryOp = function(unary){ var op = unary.op - , node = this.visit(unary.expr).first; + , node = this.visit(unary.expr).first.clone(); if ('!' != op) utils.assertType(node, 'unit');
Fixed mutation of units when using unary ops. Closes #<I>
stylus_stylus
train
js
a7253a7193ef16977b52bacfc3846a9cdd953491
diff --git a/lib/rubocop/cop/hash_syntax.rb b/lib/rubocop/cop/hash_syntax.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/hash_syntax.rb +++ b/lib/rubocop/cop/hash_syntax.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + module Rubocop module Cop class HashSyntax < Cop diff --git a/spec/rubocop/cops/hash_syntax_spec.rb b/spec/rubocop/cops/hash_syntax_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/cops/hash_syntax_spec.rb +++ b/spec/rubocop/cops/hash_syntax_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper' module Rubocop
Added utf-8 encoding comment.
rubocop-hq_rubocop
train
rb,rb
222afbd97f94eb5165f2b0e5f955e47f23cc07ef
diff --git a/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java b/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java index <HASH>..<HASH> 100644 --- a/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java +++ b/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java @@ -115,8 +115,6 @@ public class MaterialWindow extends MaterialPanel implements HasCloseHandlers<Bo public MaterialWindow() { super(AddinsCssName.WINDOW); content.setStyleName(AddinsCssName.CONTENT); - - initialize(); } public MaterialWindow(String title) { @@ -135,6 +133,13 @@ public class MaterialWindow extends MaterialPanel implements HasCloseHandlers<Bo setToolbarColor(toolbarColor); } + @Override + protected void onLoad() { + super.onLoad(); + + initialize(); + } + /** * Builds the toolbar */
MaterialWindow - Moved initialize() method to onLoad() - Fixed issues on initialization
GwtMaterialDesign_gwt-material-addins
train
java
3f86b023efec62b5e0d1ea6eaeb8d5a9882b243f
diff --git a/lib/tests/cronlib_test.php b/lib/tests/cronlib_test.php index <HASH>..<HASH> 100644 --- a/lib/tests/cronlib_test.php +++ b/lib/tests/cronlib_test.php @@ -39,7 +39,8 @@ class cronlib_testcase extends basic_testcase { global $CFG; $tmpdir = realpath($CFG->tempdir); - $time = time(); + // This is a relative time. + $time = 0; // Relative time stamps. Did you know data providers get executed during phpunit init? $lastweekstime = -(7 * 24 * 60 * 60);
MDL-<I> Cron: Fix for unit test that was causing integer overflow in <I> bit php
moodle_moodle
train
php
c7e5427200f591b49ba976079df90d66ac1f3000
diff --git a/src/commands/deploy/latest.js b/src/commands/deploy/latest.js index <HASH>..<HASH> 100644 --- a/src/commands/deploy/latest.js +++ b/src/commands/deploy/latest.js @@ -550,7 +550,7 @@ export default async function main( if (buildsCompleted) { const deploymentResponse = await now.fetch(deploymentUrl); - if (isDone(deploymentResponse) && isAliasReady(deploymentResponse)) { + if ((isReady(deploymentResponse) && isAliasReady(deploymentResponse)) || isFailed(deploymentResponse)) { deployment = deploymentResponse; if (typeof deploymentSpinner === 'function') {
Only block deployment exit if not error (#<I>)
zeit_now-cli
train
js
970e961f4db5a5ecda1ae76b5d60c6451af9ae0e
diff --git a/test/array.builders.js b/test/array.builders.js index <HASH>..<HASH> 100644 --- a/test/array.builders.js +++ b/test/array.builders.js @@ -87,4 +87,18 @@ $(document).ready(function() { deepEqual(_.mapcat(a, commaize), [1, ",", 2, ",", 3, ","], 'should return an array with all intermediate mapped arrays concatenated'); }); + + test("interpose", function() { + var a = [1,2,3]; + var b = [1,2]; + var c = [1]; + + deepEqual(_.interpose(a, 0), [1,0,2,0,3], 'should put the 2nd arg between the elements of the array given'); + deepEqual(_.interpose(b, 0), [1,0,2], 'should put the 2nd arg between the elements of the array given'); + deepEqual(_.interpose(c, 0), [1], 'should return the array given if nothing to interpose'); + deepEqual(_.interpose([], 0), [], 'should return an empty array given an empty array'); + + var result = _.interpose(b,0); + deepEqual(b, [1,2], 'should not modify the original array'); + }); });
Initial tests for _.interpose in place
documentcloud_underscore-contrib
train
js
ccc736b3fc7e1c0075ac0b9a890d0d0008cf473f
diff --git a/spec/pcapng/unknown_block_spec.rb b/spec/pcapng/unknown_block_spec.rb index <HASH>..<HASH> 100644 --- a/spec/pcapng/unknown_block_spec.rb +++ b/spec/pcapng/unknown_block_spec.rb @@ -37,7 +37,6 @@ module PacketGen @ub.body = '123' str = "\x2a\x00\x00\x00\x10\x00\x00\x00123\x00\x10\x00\x00\x00" - p @ub.fields expect(@ub.to_s).to eq(PacketGen.force_binary(str)) end end
Remove a debug print in specs
sdaubert_packetgen
train
rb
14ca81c4aa8cd4768a04a834bcdc3ce2e9454cd7
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -367,31 +367,12 @@ class App extends Container /* 1. Global Routes */ $routed = Router::route($this->routes, $this, $req, $res); - /* 2. Module Routes */ - if (!$routed) { - // check if the first part of the path is a controller - $module = $req->params('module'); - if (!$module) { - $module = $req->paths(0); - } - - $controller = '\\app\\'.$module.'\\Controller'; - - if (class_exists($controller) && property_exists($controller, 'properties')) { - $moduleRoutes = (array) U::array_value($controller::$properties, 'routes'); - - $req->setParams([ 'controller' => $module.'\\Controller' ]); - - $routed = Router::route($moduleRoutes, $this, $req, $res); - } - } - - /* 3. Not Found */ + /* 2. Not Found */ if (!$routed) { $res->setCode(404); } - /* 4. HTML Error Pages for 4xx and 5xx responses */ + /* 3. HTML Error Pages for 4xx and 5xx responses */ $code = $res->getCode(); if ($req->isHtml() && $code >= 400) { $body = $res->getBody();
remove support for dynamic module routes (breaks BC)
infusephp_infuse
train
php
19d2ed0daae01bfb30790cdae222b5378571f6f2
diff --git a/hca/full_upload.py b/hca/full_upload.py index <HASH>..<HASH> 100644 --- a/hca/full_upload.py +++ b/hca/full_upload.py @@ -68,6 +68,9 @@ class FullUpload: files_to_upload.append(open(path, "rb")) file_uuids, uploaded_keys = upload_to_cloud(files_to_upload, staging_bucket, args['replica'], from_cloud) + # Close file handles in files_to_upload. s3 paths are strings, so don't count those. + for file_handle in filter(lambda x: not isinstance(x, str), files_to_upload): + file_handle.close() filenames = list(map(os.path.basename, uploaded_keys)) # Print to stderr, upload the files to s3 and return a list of tuples: (filename, filekey) diff --git a/hca/upload_to_cloud.py b/hca/upload_to_cloud.py index <HASH>..<HASH> 100755 --- a/hca/upload_to_cloud.py +++ b/hca/upload_to_cloud.py @@ -89,8 +89,6 @@ def upload_to_cloud(file_handles, staging_bucket, replica, from_cloud=False): "hca-dss-content-type": _mime_type(fh.raw.name) } - raw_fh.close() - s3.meta.client.put_object_tagging(Bucket=destination_bucket.name, Key=key_name, Tagging=dict(TagSet=encode_tags(metadata))
Close file handles where they're opened
HumanCellAtlas_dcp-cli
train
py,py
ac32993a3330e9bb87277f9517901d09b6556325
diff --git a/push_notifications/gcm.py b/push_notifications/gcm.py index <HASH>..<HASH> 100644 --- a/push_notifications/gcm.py +++ b/push_notifications/gcm.py @@ -199,6 +199,8 @@ def send_message(registration_ids, data, cloud_type, **kwargs): for chunk in _chunks(registration_ids, max_recipients): ret.append(_cm_send_request(chunk, data, cloud_type=cloud_type, **kwargs)) return ret[0] if len(ret) == 1 else ret + else: + return _cm_send_request(None, data, cloud_type=cloud_type, **kwargs) send_bulk_message = send_message
Fix fcm/gcm send_message method. The refactored send_message method required a registration_id thus breaking the ability to send messages to topics. Fixes #<I>
jazzband_django-push-notifications
train
py