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
053a05eee8081e3306925448adbc64e2a6f0ac23
diff --git a/nianalysis/nodes.py b/nianalysis/nodes.py index <HASH>..<HASH> 100644 --- a/nianalysis/nodes.py +++ b/nianalysis/nodes.py @@ -186,8 +186,7 @@ class MapNode(NiAnalysisNodeMixin, NipypeMapNode): nipype_cls = NipypeMapNode -sbatch_template = """ -#!/bin/bash +sbatch_template = """#!/bin/bash # Set the partition to run the job on SBATCH --partition={partition}
removed white-space from sbatch template
MonashBI_arcana
train
py
55358f73aa477f401445a47620dea7e81b27bce9
diff --git a/test/extended/util/test.go b/test/extended/util/test.go index <HASH>..<HASH> 100644 --- a/test/extended/util/test.go +++ b/test/extended/util/test.go @@ -422,6 +422,8 @@ var ( `should be rejected when no endpoints exist`, // https://bugzilla.redhat.com/show_bug.cgi?id=1711605 `PreemptionExecutionPath runs ReplicaSets to verify preemption running path`, // https://bugzilla.redhat.com/show_bug.cgi?id=1711606 `TaintBasedEvictions`, // https://bugzilla.redhat.com/show_bug.cgi?id=1711608 + // TODO(workloads): reenable + `SchedulerPreemption`, `\[Driver: iscsi\]`, // https://bugzilla.redhat.com/show_bug.cgi?id=1711627
CHECK(workloads): extended: disable SchedulerPreemption tests again
openshift_origin
train
go
13ec6c22847770af9210bd97f3aefa66eed84843
diff --git a/jsonschema/compat.py b/jsonschema/compat.py index <HASH>..<HASH> 100644 --- a/jsonschema/compat.py +++ b/jsonschema/compat.py @@ -3,9 +3,9 @@ import sys try: - from collections import MutableMapping, Sequence # noqa -except ImportError: from collections.abc import MutableMapping, Sequence # noqa +except ImportError: + from collections import MutableMapping, Sequence # noqa PY3 = sys.version_info[0] >= 3
Prefer importing ABCs from collections.abc
Julian_jsonschema
train
py
8b59a66d04ff5d93bd5dbe2730efdaf8e2c1daea
diff --git a/tests/HTML5ValueTest.php b/tests/HTML5ValueTest.php index <HASH>..<HASH> 100644 --- a/tests/HTML5ValueTest.php +++ b/tests/HTML5ValueTest.php @@ -84,7 +84,7 @@ class HTML5ValueTest extends SapphireTest return 'bit of test shortcode output'; } ); - $content = DBHTMLText::create('Test', ['shortcodes'=>true]) + $content = DBHTMLText::create('Test', ['shortcodes' => true]) ->setValue('<p>Some content with a [test_shortcode] and a <br /> followed by an <hr> in it.</p>') ->forTemplate(); $this->assertContains(
We need more 0x<I> captain!
silverstripe_silverstripe-html5
train
php
b74e82ca4276f7e33806f51e9039f54c146e4c40
diff --git a/cumulusci/tasks/bulkdata/mapping_parser.py b/cumulusci/tasks/bulkdata/mapping_parser.py index <HASH>..<HASH> 100644 --- a/cumulusci/tasks/bulkdata/mapping_parser.py +++ b/cumulusci/tasks/bulkdata/mapping_parser.py @@ -195,7 +195,10 @@ class MappingStep(CCIDictModel): elif values["api"] == DataApi.SMART and v is not None: assert 0 < v < 200, "Max 200 batch_size for Smart loads" logger.warning( - "If you set a `batch_size` you should also set an `api` to `rest` or `bulk`." + "If you set a `batch_size` you should also set an `api` to `rest` or `bulk`. " + "`batch_size` means different things for `rest` and `bulk`. " + "Please see the documentation for further details." + "https://cumulusci.readthedocs.io/en/latest/data.html#api-selection" ) else: # pragma: no cover # should not happen
Coverage and warning for SMART API+batch_size
SFDO-Tooling_CumulusCI
train
py
56e5e0fcfa3077e9272be75a99e149f1da8e68bc
diff --git a/src/main/java/org/mariadb/jdbc/MariaDbConnection.java b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/mariadb/jdbc/MariaDbConnection.java +++ b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java @@ -1538,9 +1538,6 @@ public class MariaDbConnection implements Connection { if (securityManager != null && sqlPermission != null) { securityManager.checkPermission(sqlPermission); } - if (executor == null) { - throw ExceptionMapper.getSqlException("Cannot set the connection timeout: null executor passed"); - } try { protocol.setTimeout(milliseconds); } catch (SocketException se) {
[CONJ-<I>] Connection.setNetworkTimeout executor must not be mandatory
MariaDB_mariadb-connector-j
train
java
cdf89143edbb29767bf49300d59845f38b8db098
diff --git a/models/classes/notification/Notification.php b/models/classes/notification/Notification.php index <HASH>..<HASH> 100644 --- a/models/classes/notification/Notification.php +++ b/models/classes/notification/Notification.php @@ -52,9 +52,19 @@ class Notification implements NotificationInterface, JsonSerializable protected $updatedAt; /** - * AbstractNotification constructor. + * Notification constructor. + * + * @param string $userId + * @param string $title + * @param string $message + * @param string $senderId + * @param string $senderName + * @param string|null $id + * @param string|null $createdAt + * @param string|null $updatedAt + * @param int $status */ - public function __construct(string $userId, string $title, string $message, string $senderId, string $senderName, string $id = null, string $createdAt = null, string $updatedAt = null, int $status = 0) + public function __construct($userId, $title, $message, $senderId, $senderName, $id = null, $createdAt = null, $updatedAt = null, $status = 0) { $this->id = $id; $this->status = $status;
Removed param types to keep consistency of the class
oat-sa_tao-core
train
php
e89d95a800672980636eb6940a27ea89e878dba5
diff --git a/tests/cases/data/entity/DocumentTest.php b/tests/cases/data/entity/DocumentTest.php index <HASH>..<HASH> 100644 --- a/tests/cases/data/entity/DocumentTest.php +++ b/tests/cases/data/entity/DocumentTest.php @@ -655,6 +655,8 @@ class DocumentTest extends \lithium\test\Unit { } public function testArrayConversion() { + $this->skipIf(!MongoDb::enabled(), "MongoDB not enabled, skipping conversion tests."); + $doc = new Document(array('data' => array( 'id' => new MongoId(), 'date' => new MongoDate()
Skipping Mongo data conversion tests in `Document` if Mongo not installed.
UnionOfRAD_lithium
train
php
8aff92cbad3a6474bf0e2438ad42dde83cfc3e6f
diff --git a/luigi/task.py b/luigi/task.py index <HASH>..<HASH> 100644 --- a/luigi/task.py +++ b/luigi/task.py @@ -17,6 +17,7 @@ import logging import parameter import warnings import traceback +import itertools import pyparsing as pp Parameter = parameter.Parameter @@ -472,11 +473,7 @@ class Task(object): warnings.warn("Task %r without outputs has no custom complete() method" % self) return False - for output in outputs: - if not output.exists(): - return False - else: - return True + return all(itertools.imap(lambda output: output.exists(), outputs)) def output(self): """The output that this Task produces.
Simplify Task.complete() Just using standard functional tools. Note that it's necessary to use itertools to not change the semantics, in case one of the exists() methods have side effects.
spotify_luigi
train
py
6ac7357435998805db5c1d3665d96e8f1f42a785
diff --git a/scapy/automaton.py b/scapy/automaton.py index <HASH>..<HASH> 100644 --- a/scapy/automaton.py +++ b/scapy/automaton.py @@ -670,8 +670,6 @@ class Automaton(six.with_metaclass(Automaton_metaclass)): for stname in self.states: setattr(self, stname, _instance_state(getattr(self, stname))) - - self.parse_args(*args, **kargs) self.start()
Automaton: avoid a double call to parse_args First call was in __init__ Second call results from .run() call
secdev_scapy
train
py
91dcec3e791695335ecf562fb3fc383f91a2e208
diff --git a/course/jumpto.php b/course/jumpto.php index <HASH>..<HASH> 100644 --- a/course/jumpto.php +++ b/course/jumpto.php @@ -7,11 +7,12 @@ require('../config.php'); - $jump = optional_param('jump', ''); +//TODO: fix redirect before enabling - SC#189 +/* $jump = optional_param('jump', ''); if ($jump) { redirect(urldecode($jump)); - } + }*/ redirect($_SERVER['HTTP_REFERER']);
temporary fix for XSS SC#<I>; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
98ae03330bb730399ce5c051580e144c749667d2
diff --git a/simuvex/s_cc.py b/simuvex/s_cc.py index <HASH>..<HASH> 100644 --- a/simuvex/s_cc.py +++ b/simuvex/s_cc.py @@ -136,19 +136,24 @@ class SimCC(object): # Determine how many arguments this function has. # func = cfg.function_manager.function(function_address) - reg_args, stack_args = func.arguments + if func is not None: + reg_args, stack_args = func.arguments - for arg in reg_args: - a = SimRegArg(project.arch.register_names[arg]) - args.append(a) + for arg in reg_args: + a = SimRegArg(project.arch.register_names[arg]) + args.append(a) - for arg in stack_args: - a = SimStackArg(arg) - args.append(a) + for arg in stack_args: + a = SimStackArg(arg) + args.append(a) - for c in CC: - if c._match(project, args): - return c(project.arch, args, ret_vals) + for c in CC: + if c._match(project, args): + return c(project.arch, args, ret_vals) + + else: + # TODO: + pass # We cannot determine the calling convention of this function.
no panicking if the function does not exist in functionmanager.
angr_angr
train
py
cfc731db22c28516081f776f951f3a54dbfe1027
diff --git a/src/Gica/MongoDB/Selector/Filter/Logical/AndGroup.php b/src/Gica/MongoDB/Selector/Filter/Logical/AndGroup.php index <HASH>..<HASH> 100644 --- a/src/Gica/MongoDB/Selector/Filter/Logical/AndGroup.php +++ b/src/Gica/MongoDB/Selector/Filter/Logical/AndGroup.php @@ -19,6 +19,13 @@ class AndGroup implements Filter $this->filters = $filters; } + public function withAddedFilter(Filter $filter):self + { + $other = clone $this; + $other->filters[] = $filter; + return $other; + } + public function getFields():array { $filterExpressions = []; diff --git a/src/Gica/MongoDB/Selector/Filter/Logical/OrGroup.php b/src/Gica/MongoDB/Selector/Filter/Logical/OrGroup.php index <HASH>..<HASH> 100644 --- a/src/Gica/MongoDB/Selector/Filter/Logical/OrGroup.php +++ b/src/Gica/MongoDB/Selector/Filter/Logical/OrGroup.php @@ -19,6 +19,13 @@ class OrGroup implements Filter $this->filters = $filters; } + public function withAddedFilter(Filter $filter):self + { + $other = clone $this; + $other->filters[] = $filter; + return $other; + } + public function getFields():array { $filterExpressions = [];
added \Gica\MongoDB\Selector\Filter\Logical\OrGroup::withAddedFilter
xprt64_mongodb-selector
train
php,php
8f0d20169c591c4d0af11635f4eab4d4b4486cb7
diff --git a/fragments/apply.py b/fragments/apply.py index <HASH>..<HASH> 100644 --- a/fragments/apply.py +++ b/fragments/apply.py @@ -149,7 +149,7 @@ def apply(*args): if len(merge_result) == 1 and isinstance(merge_result[0], tuple): # total conflict, skip yield "Changes in '%s' cannot apply to '%s', skipping" % (os.path.relpath(changed_path), os.path.relpath(other_path)) - elif tuple in (type(mr) for mr in merge_result): + elif tuple in set(type(mr) for mr in merge_result): # some conflicts exist with file(other_path, 'w') as other_file: for line_or_conflict in merge_result:
make this a set for faster identification
glyphobet_fragments
train
py
9fd15ecb39f7c7d7da219e9b1de926a3577532c0
diff --git a/src/api.js b/src/api.js index <HASH>..<HASH> 100644 --- a/src/api.js +++ b/src/api.js @@ -72,11 +72,12 @@ class DialogFlowAPI_V2 { } else { try { const keyFile = require(config.keyFilename); - this.projectId = keyFile.project_id; + opts.projectId = keyFile.project_id; } catch (err) { throw new Error('projectId must be provided or available in the keyFile.'); } } + this.projectId = opts.projectId; if (config.credentials) { opts.credentials = config.credentials; }
Fix projectId not detected when passed in config This fixes the projectId option not being correctly detected when it is passed as a variable in the config object.
jschnurr_botkit-middleware-dialogflow
train
js
b97c3d2f59dc3d43c42a2043ecfb758ba59d7252
diff --git a/lib/miro/dominant_colors.rb b/lib/miro/dominant_colors.rb index <HASH>..<HASH> 100644 --- a/lib/miro/dominant_colors.rb +++ b/lib/miro/dominant_colors.rb @@ -63,7 +63,7 @@ module Miro def parse_result(hstring) hstring.scan(/(\d*):.*(#[0-9A-Fa-f]*)/).collect do |match| - [match[0].to_i, Object.const_get("Color::#{Miro.options[:quantize].upcase}").from_html(match[1])] + [match[0].to_i, eval("Color::#{Miro.options[:quantize].upcase}").from_html(match[1])] end end
Use eval instead of Object.const_get. Object.const_get does not function the same on the jruby platform as it does on MRI or rubinius.
jonbuda_miro
train
rb
47ac35c8e981afc155a14ddfe784587b0bd17e7f
diff --git a/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java b/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java index <HASH>..<HASH> 100644 --- a/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java +++ b/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerMachineConfigurator.java @@ -152,7 +152,13 @@ public class DockerMachineConfigurator implements MachineConfigurator { // Execute... try { - String containerName = this.scopedInstancePath.replaceFirst( "^/", "" ).replace( "/", "-" ).replaceAll( "\\s+", "_" ); + String containerName = this.scopedInstancePath + "_from_" + this.applicationName; + containerName = containerName.replaceFirst( "^/", "" ).replace( "/", "-" ).replaceAll( "\\s+", "_" ); + + // Prevent container names from being too long (see #480) + if( containerName.length() > 61 ) + containerName = containerName.substring( 0, 61 ); + CreateContainerCmd cmd = this.dockerClient.createContainerCmd( imageId ) .withName( containerName ) .withCmd( args.toArray( new String[ args.size()]));
#<I> Docker container names should include the application name
roboconf_roboconf-platform
train
java
24620483189eaf7bfe8c0ff6a98ce4fb89acd854
diff --git a/src/util/spawn-promise.js b/src/util/spawn-promise.js index <HASH>..<HASH> 100644 --- a/src/util/spawn-promise.js +++ b/src/util/spawn-promise.js @@ -2,10 +2,19 @@ const cp = require('child_process'), os = require('os'); module.exports = function spawnPromise(command, args, options, suppressOutput) { 'use strict'; - const actualCommand = os.platform() === 'win32' ? `"${command}"` : command, + const isWin = os.platform() === 'win32', + actualCommand = isWin ? `"${command}"` : command, normalDefaults = {env: process.env, cwd: process.cwd()}, windowsDefaults = Object.assign({shell: true}, normalDefaults), - defaultOptions = os.platform() === 'win32' ? windowsDefaults : normalDefaults; + defaultOptions = isWin ? windowsDefaults : normalDefaults; + + if (isWin) { + args.forEach((v, i) => { + if (/\s/.test(v)) { + args[i] = `"${v}"`; + } + }); + } return new Promise((resolve, reject) => { const subProcess = cp.spawn(actualCommand, args, Object.assign(defaultOptions, options)); if (!suppressOutput) {
spawn on windows fix for files with spaces
claudiajs_claudia
train
js
08cf764318bdfcf30bceae0073ee8f53430f604f
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/scoping/named_scoping_test.rb +++ b/activerecord/test/cases/scoping/named_scoping_test.rb @@ -590,7 +590,7 @@ class NamedScopingTest < ActiveRecord::TestCase [:destroy_all, :reset, :delete_all].each do |method| before = post.comments.containing_the_letter_e - post.association(:comments).send(method) + post.association(:comments).public_send(method) assert_not_same before, post.comments.containing_the_letter_e, "CollectionAssociation##{method} should reset the named scopes cache" end end
Association#destroy_all, reset, and delete_all are public methods
rails_rails
train
rb
b38a44080a0a208dccfb417500bbad9f15cd1470
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,8 @@ setup(name='dispatch', 'djangorestframework == 3.6.2', 'pillow', 'requests == 2.6.0', - 'jsonfield' + 'jsonfield', + 'phonenumber_field == 1.3.0' ], extras_require={ 'dev': [
Added 'phonenumber_field' to setup.py
ubyssey_dispatch
train
py
9d48683b0f8b946a181d470d97a7f21ab289c6d6
diff --git a/lib/em-synchrony.rb b/lib/em-synchrony.rb index <HASH>..<HASH> 100644 --- a/lib/em-synchrony.rb +++ b/lib/em-synchrony.rb @@ -18,14 +18,29 @@ require "em-synchrony/iterator" if EventMachine::VERSION > '0.12.10' module EventMachine - # A convenience method for wrapping EM.run body within + # A convenience method for wrapping a given block within # a Ruby Fiber such that async operations can be transparently # paused and resumed based on IO scheduling. - def self.synchrony(blk=nil, tail=nil, &block) - blk ||= block - context = Proc.new { Fiber.new { blk.call }.resume } + # It detects whether EM is running or not. + def self.synchrony(blk=nil, tail=nil) + # EM already running. + if reactor_running? + if block_given? + Fiber.new { yield }.resume + else + Fiber.new { blk.call }.resume + end + tail && add_shutdown_hook(tail) + + # EM not running. + else + if block_given? + run(nil, tail) { Fiber.new { yield }.resume } + else + run(Proc.new { Fiber.new { blk.call }.resume }, tail) + end - self.run(context, tail) + end end module Synchrony
EM.synchrony refactorized.
igrigorik_em-synchrony
train
rb
ad3e9461943ce200736b5178415a9a419f060f78
diff --git a/TYPO3.Media/Migrations/Postgresql/Version20150701113247.php b/TYPO3.Media/Migrations/Postgresql/Version20150701113247.php index <HASH>..<HASH> 100644 --- a/TYPO3.Media/Migrations/Postgresql/Version20150701113247.php +++ b/TYPO3.Media/Migrations/Postgresql/Version20150701113247.php @@ -31,7 +31,6 @@ class Version20150701113247 extends AbstractMigration { public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); - $this->addSql("CREATE SCHEMA public"); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER width SET NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_image ALTER height SET NOT NULL"); $this->addSql("ALTER TABLE typo3_media_domain_model_imagevariant ALTER width SET NOT NULL");
[BUGFIX] Fix a PostgreSQL down migration In cb<I>c7a<I>b<I>a0dd3b2b<I>fdb5c<I>c<I>ef<I> a missing migration was added. That migration works fine when migrating up, but in the down migration one line too much causes it to break.
neos_neos-development-collection
train
php
bface4fe3c13e4da35d2c777d2139ed3b6a50a00
diff --git a/lib/db/access.php b/lib/db/access.php index <HASH>..<HASH> 100644 --- a/lib/db/access.php +++ b/lib/db/access.php @@ -527,7 +527,6 @@ $moodle_capabilities = array( 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, 'legacy' => array( - 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'admin' => CAP_ALLOW
Merged fix for MDL-<I>
moodle_moodle
train
php
df31ff9bafedb79806c56f818f8ef6e62b6b77eb
diff --git a/PZFileReader/src/test/java/net/sf/pzfilereader/parserutils/ParserUtilsSplitLineTest.java b/PZFileReader/src/test/java/net/sf/pzfilereader/parserutils/ParserUtilsSplitLineTest.java index <HASH>..<HASH> 100644 --- a/PZFileReader/src/test/java/net/sf/pzfilereader/parserutils/ParserUtilsSplitLineTest.java +++ b/PZFileReader/src/test/java/net/sf/pzfilereader/parserutils/ParserUtilsSplitLineTest.java @@ -138,6 +138,9 @@ public class ParserUtilsSplitLineTest extends TestCase { check("one two three", ' ', '\u0000', new String[] {"one", "two", "three"}); check("\"one\" \"two\" three", ' ', '\"', new String[] {"one", "two", "three"}); check("\"one\" \"two\" three", ' ', '\"', new String[] {"one", "", "two", "", "three"}); + + check (" , , ", ',', '"', new String[] {"","",""}); + check (" \t \t ", '\t', '"', new String[] {"","",""}); } /**
added test for empty tabs which is currently failing Former-commit-id: ee4de<I>fb<I>cb0ec<I>eea6ecec4f<I>b7
Appendium_flatpack
train
java
604ef7f8cec40dcc8ee426e01d8eaffdc934a576
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/asyncTestWrapper.js b/bundles/org.eclipse.orion.client.core/web/orion/asyncTestWrapper.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/asyncTestWrapper.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/asyncTestWrapper.js @@ -61,12 +61,10 @@ orion.JSTestAdapter = (function() { } }); service.addEventListener("runDone", function(runName, obj) { - if (!runName) { - shutdown.then(function(noop) { - loaderPluginRegistry.shutdown(); - noop(); - }); - } + shutdown.then(function(noop) { + loaderPluginRegistry.shutdown(); + noop(); + }); }); console.log("Launching test suite: " + test);
temporary fix for async tests - still more to do.
eclipse_orion.client
train
js
3f66a402079caf8088a84184a7dd74746cd5ee75
diff --git a/salty/tests/test_data_manipulation.py b/salty/tests/test_data_manipulation.py index <HASH>..<HASH> 100644 --- a/salty/tests/test_data_manipulation.py +++ b/salty/tests/test_data_manipulation.py @@ -32,4 +32,4 @@ class data_manipulation_tests(unittest.TestCase): if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()
iss3 ready for deply
wesleybeckner_salty
train
py
6c6a0f95af79ea924a3fa638d115a4e50b1a7a0e
diff --git a/src/Model/Loggable/LoggableTrait.php b/src/Model/Loggable/LoggableTrait.php index <HASH>..<HASH> 100644 --- a/src/Model/Loggable/LoggableTrait.php +++ b/src/Model/Loggable/LoggableTrait.php @@ -34,18 +34,18 @@ trait LoggableTrait public function getCreateLogMessage(): string { - return sprintf('%s #%d created', self::class, $this->getId()); + return sprintf('%s #%s created', self::class, $this->getId()); } public function getRemoveLogMessage(): string { - return sprintf('%s #%d removed', self::class, $this->getId()); + return sprintf('%s #%s removed', self::class, $this->getId()); } private function createChangeSetMessage(string $property, array $changeSet): string { return sprintf( - '%s #%d : property "%s" changed from "%s" to "%s"', + '%s #%s : property "%s" changed from "%s" to "%s"', self::class, $this->getId(), $property,
Update LoggableTrait.php (#<I>)
KnpLabs_DoctrineBehaviors
train
php
829ced5ac59d76cfb2d465aec4105311a7a5831f
diff --git a/resources/assets/js/files.pathway.js b/resources/assets/js/files.pathway.js index <HASH>..<HASH> 100644 --- a/resources/assets/js/files.pathway.js +++ b/resources/assets/js/files.pathway.js @@ -74,14 +74,26 @@ return result; }; + var path = '', root_path = ''; - var root = wrap(app, '<span class="k-icon-home" aria-hidden="true"></span><span class="k-visually-hidden">'+app.container.title+'</span>', '', false) + // Check if we are rendering sub-trees + if (app.options.root_path) { + path = root_path = app.options.root_path; + } + + var root = wrap(app, '<span class="k-icon-home" aria-hidden="true"></span><span class="k-visually-hidden">'+app.container.title+'</span>', path, false) .addClass('k-breadcrumb__home') .getElement('a').getParent(); list.adopt(root); - var folders = app.getPath().split('/'), path = ''; + var base_path = app.getPath(); + + if (root_path) { + base_path = base_path.replace(root_path, ''); + } + + var folders = base_path.split('/'), path = root_path; folders.each(function(title){ if(title.trim()) {
#<I> Render pathways from root_path when available
joomlatools_joomlatools-framework
train
js
50a38bc3c7d6aa6b389a9d84fd59df9c53b92247
diff --git a/jgettext/src/test/java/org/fedorahosted/tennera/jgettext/DynamicRoundtripTests.java b/jgettext/src/test/java/org/fedorahosted/tennera/jgettext/DynamicRoundtripTests.java index <HASH>..<HASH> 100644 --- a/jgettext/src/test/java/org/fedorahosted/tennera/jgettext/DynamicRoundtripTests.java +++ b/jgettext/src/test/java/org/fedorahosted/tennera/jgettext/DynamicRoundtripTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -public class DynamicRoundtripTests { +public class DynamicRoundtripTests extends TestSuite{ public final static void generateTests(TestSuite ts) throws Throwable{ final Properties properties = new Properties(); @@ -44,7 +44,7 @@ public class DynamicRoundtripTests { final String key = (String) keys.nextElement(); final File rootDir = new File(properties.getProperty(key)); - TestCase test = new TestCase(key){ + TestCase test = new TestCase(key + " exists"){ @Override public void runTest() { assertTrue("No such file.", rootDir.exists()); @@ -150,7 +150,5 @@ public class DynamicRoundtripTests { } } } - - @Test - public void test(){} + }
avoid ugly hack from prvious commit to make dynamic test suite work in eclispe
zanata_jgettext
train
java
ebc876de3fe424af5a7cdd4943a2bfa1e50216d9
diff --git a/Core/src/Artax/Ioc/Provider.php b/Core/src/Artax/Ioc/Provider.php index <HASH>..<HASH> 100644 --- a/Core/src/Artax/Ioc/Provider.php +++ b/Core/src/Artax/Ioc/Provider.php @@ -457,7 +457,6 @@ class Provider implements ProviderInterface, ArrayAccess protected function getDepsSansDefinition($class, array $args) { $deps = []; - for ($i=0; $i<count($args); $i++) { if (!$param = $args[$i]->getClass()) { throw new InvalidArgumentException( @@ -465,11 +464,10 @@ class Provider implements ProviderInterface, ArrayAccess .'for argument' . $i+1 ); } else { - $deps[] = isset($this->shared[$class]) - ? $this->shared[$class] - : new $param->name; + $deps[] = $this->make($param->name); } } + return $deps; }
Fixed bug affecting shared dependencies of lazy class listeners
amphp_artax
train
php
3d90b7a716e26957dd51128c4ddde1dcd3135968
diff --git a/MatchMakingLobby/Lobby/Plugin.php b/MatchMakingLobby/Lobby/Plugin.php index <HASH>..<HASH> 100644 --- a/MatchMakingLobby/Lobby/Plugin.php +++ b/MatchMakingLobby/Lobby/Plugin.php @@ -239,7 +239,7 @@ class Plugin extends \ManiaLive\PluginHandler\Plugin function onPlayerDisconnect($login, $disconnectionReason) { - \ManiaLive\Utilities\Logger::debug(sprintf('Player disconnected: %s', $login)); + \ManiaLive\Utilities\Logger::debug(sprintf('Player disconnected: %s (%s)', $login, $disconnectionReason)); $player = Services\PlayerInfo::Get($login); $player->setAway();
Adding player disconnection reason in logger
maniaplanet_matchmaking-lobby
train
php
529ff03399ac2b90f75b25ca00359affd6afb904
diff --git a/tests/Assets/TestCodeGenerator.php b/tests/Assets/TestCodeGenerator.php index <HASH>..<HASH> 100644 --- a/tests/Assets/TestCodeGenerator.php +++ b/tests/Assets/TestCodeGenerator.php @@ -67,12 +67,12 @@ class TestCodeGenerator self::TEST_ENTITY_NAMESPACE_BASE . self::TEST_ENTITY_ATTRIBUTES_ADDRESS, false, ], - [ - self::TEST_ENTITY_NAMESPACE_BASE . self::TEST_ENTITY_PERSON, - RelationsGenerator::HAS_REQUIRED_ONE_TO_MANY, - self::TEST_ENTITY_NAMESPACE_BASE . self::TEST_ENTITY_ALL_ARCHETYPE_FIELDS, - false, - ], +// [ +// self::TEST_ENTITY_NAMESPACE_BASE . self::TEST_ENTITY_PERSON, +// RelationsGenerator::HAS_REQUIRED_ONE_TO_MANY, +// self::TEST_ENTITY_NAMESPACE_BASE . self::TEST_ENTITY_ALL_ARCHETYPE_FIELDS, +// false, +// ], [ self::TEST_ENTITY_NAMESPACE_BASE . self::TEST_ENTITY_PERSON, RelationsGenerator::HAS_REQUIRED_ONE_TO_MANY,
removing person to archetype fields relation
edmondscommerce_doctrine-static-meta
train
php
deecd392a1535b6111af01d0d6ff25d3f46eec50
diff --git a/libraries/joomla/client/http.php b/libraries/joomla/client/http.php index <HASH>..<HASH> 100644 --- a/libraries/joomla/client/http.php +++ b/libraries/joomla/client/http.php @@ -350,7 +350,7 @@ class JHttp $this->connections[$key] = fsockopen($host, $port, $errno, $err, $this->timeout); if ($this->connections[$key]) { - stream_settimeout($this->connections[$key], $this->timeout); + stream_set_timeout($this->connections[$key], $this->timeout); } return $this->connections[$key];
Fixed a typo in JHttp (stream_set_timeout vs stream_settimeout) as it caused a fatal error when using the class ;)
joomla_joomla-framework
train
php
c6971bd77a98257fd106967c0db88a36bc86391b
diff --git a/sqlpuzzle/_features/conditions.py b/sqlpuzzle/_features/conditions.py index <HASH>..<HASH> 100644 --- a/sqlpuzzle/_features/conditions.py +++ b/sqlpuzzle/_features/conditions.py @@ -90,7 +90,7 @@ class Conditions(sqlpuzzle._features.Features): 'allowList': True, 'allowedDataTypes': ( (str, unicode, sqlpuzzle._queries.select.Select), - (str, unicode, int, long, float, bool, list, tuple, datetime.date, datetime.datetime, sqlpuzzle.relations._RelationValue), + (str, unicode, int, long, float, bool, list, tuple, datetime.date, datetime.datetime, sqlpuzzle.relations._RelationValue, sqlpuzzle._queries.select.Select), (sqlpuzzle.relations._RelationValue,) ), },
allow subselect in right position in condition
horejsek_python-sqlpuzzle
train
py
8901a7d816a13d25d043c3bf74fa2e448f11deb1
diff --git a/lib/t/stream.rb b/lib/t/stream.rb index <HASH>..<HASH> 100644 --- a/lib/t/stream.rb +++ b/lib/t/stream.rb @@ -1,4 +1,3 @@ -require 't/cli' require 't/printable' require 't/rcfile' require 't/search'
Don't require the CLI class from the Stream class
sferik_t
train
rb
0588ed680e50cd973f99ab6d0982619c1acdbf28
diff --git a/chatterbot/adapters/plugins/evaluate_mathematically.py b/chatterbot/adapters/plugins/evaluate_mathematically.py index <HASH>..<HASH> 100644 --- a/chatterbot/adapters/plugins/evaluate_mathematically.py +++ b/chatterbot/adapters/plugins/evaluate_mathematically.py @@ -87,9 +87,9 @@ class EvaluateMathematically(PluginAdapter): it returns False. """ - if string.isdigit(): + try: return int( string ) - else: + except: return False @@ -100,7 +100,7 @@ class EvaluateMathematically(PluginAdapter): false. """ - if string in "+-/*^\(\)": + if string in "+-/*^()": return string else: return False
is_integer update & added additional tests
gunthercox_ChatterBot
train
py
0dfe74c45207473db604a4c7e5560be023f836cc
diff --git a/lib/source_route/tp_result.rb b/lib/source_route/tp_result.rb index <HASH>..<HASH> 100644 --- a/lib/source_route/tp_result.rb +++ b/lib/source_route/tp_result.rb @@ -20,11 +20,16 @@ module SourceRoute } def initialize(wrapper) + @logger = Logger.new(STDOUT) @wrapper = wrapper @output_config = @wrapper.condition.result_config @tp_events = @wrapper.condition.events + if @tp_events.length > 1 and @output_config[:selected_attrs] + @logger.warn 'selected_attrs was ignored, cause watched event was more than one ' + @output_config[:selected_attrs] = nil + end end def output_attributes(event)
set selected_attrs as nil when events length > 1, in this case, we prevent possible error of not supported by this event (RuntimeError)
raykin_source-route
train
rb
e4ba0b6566b81df9ffa5d40605832f2f3449a32d
diff --git a/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java b/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java index <HASH>..<HASH> 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/config/SingularityConfiguration.java @@ -45,7 +45,7 @@ public class SingularityConfiguration extends Configuration { private long killDecomissionedTasksAfterNewTasksSeconds = 300; @NotNull - private long deltaAfterWhichTasksAreLateMillis = 300; + private long deltaAfterWhichTasksAreLateMillis = 5000; public long getCloseWaitSeconds() { return closeWaitSeconds;
give tasks 5 seconds to be considered late.
HubSpot_Singularity
train
java
107998f54e8eb42bfad00e4767340d5e24440958
diff --git a/dev/com.ibm.ws.microprofile.metrics.monitor_fat/fat/src/com/ibm/ws/microprofile/metrics/monitor_fat/MetricsMonitorTest.java b/dev/com.ibm.ws.microprofile.metrics.monitor_fat/fat/src/com/ibm/ws/microprofile/metrics/monitor_fat/MetricsMonitorTest.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.microprofile.metrics.monitor_fat/fat/src/com/ibm/ws/microprofile/metrics/monitor_fat/MetricsMonitorTest.java +++ b/dev/com.ibm.ws.microprofile.metrics.monitor_fat/fat/src/com/ibm/ws/microprofile/metrics/monitor_fat/MetricsMonitorTest.java @@ -117,7 +117,7 @@ public class MetricsMonitorTest { Log.info(c, testName, "------- Enable mpMetrics-1.0 and monitor-1.0: vendor metrics should not be available ------"); server.setServerConfigurationFile("server_mpMetric10Monitor10.xml"); server.startServer(); - Log.info(c, testName, server.waitForStringInLog("defaultHttpEndpoint-ssl",60000)); + Log.info(c, testName, server.waitForStringInLog("SRVE9103I",60000)); Log.info(c, testName, "------- server started -----"); checkStrings(getHttpsServlet("/metrics"), new String[] { "base:" },
Update MetricsMonitorTest.java
OpenLiberty_open-liberty
train
java
8142eb860fa31c5cffd2564a79a6aede5c7cf1d7
diff --git a/spoon/src/main/java/com/squareup/spoon/Spoon.java b/spoon/src/main/java/com/squareup/spoon/Spoon.java index <HASH>..<HASH> 100644 --- a/spoon/src/main/java/com/squareup/spoon/Spoon.java +++ b/spoon/src/main/java/com/squareup/spoon/Spoon.java @@ -128,6 +128,12 @@ public final class Spoon { } } + // Clean up anything in the work directory. + try { + FileUtils.deleteDirectory(new File(output, SpoonDeviceRunner.TEMP_DIR)); + } catch (IOException ignored) { + } + return summary.end().build(); }
Clean up work directory after run completion.
square_spoon
train
java
5e4d5222834ece5fbff3228a6072c727bb1bf828
diff --git a/lib/twat/actions.rb b/lib/twat/actions.rb index <HASH>..<HASH> 100644 --- a/lib/twat/actions.rb +++ b/lib/twat/actions.rb @@ -176,7 +176,12 @@ module Twat end def account - @account = config.accounts[account_name] + @account ||= config.accounts[account_name] + unless @account + raise NoSuchAccount + else + return @account + end end def account_name
Fix a broken test for account validity
richo_twat
train
rb
950c7270664ad9a8ff39a174aa8a86fb9121a9d9
diff --git a/lib/itamae/resource/user.rb b/lib/itamae/resource/user.rb index <HASH>..<HASH> 100644 --- a/lib/itamae/resource/user.rb +++ b/lib/itamae/resource/user.rb @@ -11,6 +11,13 @@ module Itamae define_attribute :system_user, type: [TrueClass, FalseClass] define_attribute :uid, type: Integer + def pre_action + case @current_action + when :create + attributes.exist = true + end + end + def set_current_attributes current.exist = exist? @@ -74,4 +81,3 @@ module Itamae end end end -
Show difference of user resource when was created
itamae-kitchen_itamae
train
rb
56ec9745da71aeac864e5cb47b09fec3889cdd1a
diff --git a/tasks/dockerCompose.js b/tasks/dockerCompose.js index <HASH>..<HASH> 100644 --- a/tasks/dockerCompose.js +++ b/tasks/dockerCompose.js @@ -152,7 +152,7 @@ module.exports = function(grunt) { var cmd = buildCommandSkeleton(); cmd.push('docker-compose'); - if (grunt.option('baked', false) && grunt.option('debug', false)) { + if (!grunt.option('baked') && !grunt.option('debug')) { cmd.push('-f <%= dockerCompose.options.mappedComposeFile %>'); } else if (grunt.option('debug')) {
fix mapped command option, confusing boolean double negative
YogaGlo_grunt-docker-compose
train
js
0dd7a529088fe92e1f2100fd02d653b561aac5fb
diff --git a/src/main/java/org/ubercraft/statsd/StatsdLoggerImpl.java b/src/main/java/org/ubercraft/statsd/StatsdLoggerImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/ubercraft/statsd/StatsdLoggerImpl.java +++ b/src/main/java/org/ubercraft/statsd/StatsdLoggerImpl.java @@ -27,7 +27,7 @@ public class StatsdLoggerImpl implements StatsdLogger, Serializable { private static final long serialVersionUID = 6548797032077199054L; - private final Logger logger; + protected final Logger logger; public StatsdLoggerImpl(Logger logger) { this.logger = logger;
changed visibility of logger instance on StatsdLoggerImpl class to protected
nzjess_statsd-over-slf4j
train
java
f61dc26cb451967ff057875d2031f401b101e9e3
diff --git a/LiSE/LiSE/tests/test_load.py b/LiSE/LiSE/tests/test_load.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/tests/test_load.py +++ b/LiSE/LiSE/tests/test_load.py @@ -66,6 +66,7 @@ def test_multi_keyframe(tempdir): assert tick1 in eng._nodes_cache.keyframe['physical', ]['trunk'][1] assert eng._nodes_cache.keyframe['physical', ]['trunk'][0][tick0]\ != eng._nodes_cache.keyframe['physical', ]['trunk'][1][tick1] + eng.close() def test_keyframe_load_unload(tempdir):
Close engine properly at the end of test_multi_keyframe
LogicalDash_LiSE
train
py
eab605d708e4a3d7f019eaf3206669a30df9b337
diff --git a/tests/test_apps.py b/tests/test_apps.py index <HASH>..<HASH> 100644 --- a/tests/test_apps.py +++ b/tests/test_apps.py @@ -50,3 +50,7 @@ class ConfigTests(TestCase): expected_config_len = 1 actual = len(self.config) self.assertEqual(actual, expected_config_len) + + def test_failure_for_loading_config(self): + config = Config() + self.assertRaises(FileNotFoundError, config.load_from_pyfile, BASE_DIR, 'no_exists.py')
Refactor tests for load_from_pyfile
kobinpy_kobin
train
py
280b93ded6c522f634dc73d1b63f26d3c6d518ec
diff --git a/hydrachain/app.py b/hydrachain/app.py index <HASH>..<HASH> 100644 --- a/hydrachain/app.py +++ b/hydrachain/app.py @@ -237,7 +237,6 @@ def serve_until_stopped(*apps): evt = Event() gevent.signal(signal.SIGQUIT, evt.set) gevent.signal(signal.SIGTERM, evt.set) - gevent.signal(signal.SIGINT, evt.set) evt.wait() # finally stop for app in apps:
Remove unnecessary SIGINT handler The Console service already registers a SIGINT handler. Do so here again caused the app to exit instead of resume if console wasn't entered.
HydraChain_hydrachain
train
py
3c98356544e63f6c35176b86dc0b4196e3d7e1f3
diff --git a/synapse/lib/filepath.py b/synapse/lib/filepath.py index <HASH>..<HASH> 100644 --- a/synapse/lib/filepath.py +++ b/synapse/lib/filepath.py @@ -359,11 +359,13 @@ def _parse_path(*paths): return fpobj -def openfile(*paths, mode='r'): +# KILL2.7 kwargs instead of mode='r' here because of python2.7 +def openfile(*paths, **kwargs): ''' Returns a read-only file-like object even if the path terminates inside a container file. - If the path is a regular os accessible path mode is passed through. If the path terminates - in a container file mode is ignored. + + If the path is a regular os accessible path mode may be passed through as a keyword argument. + If the path terminates in a container file mode is ignored. If the path does not exist a NoSuchPath exception is raised. @@ -377,7 +379,7 @@ def openfile(*paths, mode='r'): path = genpath(*paths) raise s_exc.NoSuchPath(path=path) - fd = fpobj._open(mode=mode) + fd = fpobj._open(mode=kwargs.get('mode', 'r')) return fd def isfile(*paths):
updated openfile to take generic keyword args so that it is syntax compliant with python<I>
vertexproject_synapse
train
py
a27a0490364114f93e9777e6861003c532357d2e
diff --git a/lib/origen/application/release.rb b/lib/origen/application/release.rb index <HASH>..<HASH> 100644 --- a/lib/origen/application/release.rb +++ b/lib/origen/application/release.rb @@ -174,7 +174,7 @@ Your workspace has local modifications that are preventing the requested action # Pull the latest versions of the history and version ID files into the workspace def get_latest_version_files # Get the latest version of the version and history files - if Origen.app.rc.dssc? && !which('dssc').nil? + if Origen.app.rc.dssc? # Legacy code that makes use of the fact that DesignSync can handle different branch selectors # for individual files, this capability has not been abstracted by the newer object oriented # revision controllers since most others cannot do it
backed out conditional check using new which method to lower risk of PR
Origen-SDK_origen
train
rb
98287ccf35df0d2bf40413f21038badbd197e302
diff --git a/app/models/application.rb b/app/models/application.rb index <HASH>..<HASH> 100644 --- a/app/models/application.rb +++ b/app/models/application.rb @@ -14,7 +14,7 @@ class Application < ActiveRecord::Base before_validation :generate_uid, :generate_secret, :on => :create def self.authorized_for(resource_owner) - joins(:authorized_applications).where(:oauth_access_tokens => { :resource_owner_id => resource_owner.id }) + joins(:authorized_applications).where(:oauth_access_tokens => { :resource_owner_id => resource_owner.id }).uniq end def validate_redirect_uri
authorised applications' list should be unique in order to avoid repetitions in the authorised applications view.
doorkeeper-gem_doorkeeper
train
rb
5c73c306b516d32d8bdc2b0ab2cb19ef7435d8c2
diff --git a/tests/Gin/Foundation/ThemeTest.php b/tests/Gin/Foundation/ThemeTest.php index <HASH>..<HASH> 100644 --- a/tests/Gin/Foundation/ThemeTest.php +++ b/tests/Gin/Foundation/ThemeTest.php @@ -108,7 +108,7 @@ class ThemeTest extends TestCase /** * @test */ - public function it_should_return_same_object_on_factory_binding() + public function it_should_not_return_same_object_on_factory_binding() { $theme = Theme::getInstance(); @@ -153,4 +153,4 @@ class Stub { // } -} \ No newline at end of file +}
Fix test method name in ThemeTest
tonik_gin
train
php
80240cc47e98c3f96ef9cefaefa6b9228da56ae9
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -38,7 +38,7 @@ const JIB_VERSION = '3.2.1'; const JHIPSTER_DEPENDENCIES_VERSION = '7.8.2-SNAPSHOT'; // The spring-boot version should match the one managed by https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/JHIPSTER_DEPENDENCIES_VERSION const SPRING_BOOT_VERSION = '2.7.0-RC1'; -const LIQUIBASE_VERSION = '4.6.1'; +const LIQUIBASE_VERSION = '4.9.1'; const LIQUIBASE_DTD_VERSION = LIQUIBASE_VERSION.split('.', 3).slice(0, 2).join('.'); const HIBERNATE_VERSION = '5.6.8.Final';
Update liquibase version to <I>
jhipster_generator-jhipster
train
js
ee56618a8e5065c6d597cd05f2fd21eb15e39577
diff --git a/src/views/layouts/_angulardirectives.php b/src/views/layouts/_angulardirectives.php index <HASH>..<HASH> 100644 --- a/src/views/layouts/_angulardirectives.php +++ b/src/views/layouts/_angulardirectives.php @@ -284,7 +284,7 @@ use luya\admin\helpers\Angular; </div> <div class="filemanager-files-table"> <div class="table-responsive-wrapper"> - <table class="table table-hover table-responsive table-striped table-align-middle mt-4"> + <table class="table table-hover table-striped table-align-middle mt-4"> <thead class="thead-default"> <tr> <th>
remove class from table as defined in the wrapper
luyadev_luya-module-admin
train
php
8721bd34071865f358c3ea787e81bc47ea76a323
diff --git a/src/main.js b/src/main.js index <HASH>..<HASH> 100644 --- a/src/main.js +++ b/src/main.js @@ -5,9 +5,11 @@ var Player = require('./components/player') var IframePlayer = require('./components/iframe_player') var Mediator = require('mediator') +var version = require('../package.json').version global.DEBUG = false window.Clappr = { Player: Player, Mediator: Mediator, IframePlayer: IframePlayer } +window.Clappr.version = version module.exports = window.Clappr
main: add version attribute to Clappr (close #<I>)
clappr_clappr
train
js
073a32cfed11b0ba86d9dbcdb55d4af1f0068ae6
diff --git a/lib/chef/knife/serve_essentials.rb b/lib/chef/knife/serve_essentials.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/serve_essentials.rb +++ b/lib/chef/knife/serve_essentials.rb @@ -320,7 +320,7 @@ class Chef end def to_zero_path(entry) - path = entry.path.split('/') + path = entry.path.split('/')[1..-1] if path[0] == 'data' path = path.dup path[0] = 'data_bags'
Fix knife serve to return correct (non-.json) paths
jkeiser_knife-essentials
train
rb
ac04ffec0dfce1aab5e687e55cec4a72d922f308
diff --git a/client/lib/site/jetpack.js b/client/lib/site/jetpack.js index <HASH>..<HASH> 100644 --- a/client/lib/site/jetpack.js +++ b/client/lib/site/jetpack.js @@ -244,7 +244,7 @@ JetpackSite.prototype.deactivateModule = function( moduleId, callback ) { JetpackSite.prototype.toggleModule = function( moduleId, callback ) { const isActive = this.isModuleActive( moduleId ), method = isActive ? 'jetpackModulesDeactivate' : 'jetpackModulesActivate', - prevActiveModules = Object.assign( {}, this.modules ); + prevActiveModules = [ ...this.modules ]; if ( isActive ) { this.modules = this.modules.filter( module => module !== moduleId );
Modules: Remove js error when acivation of modules fails this.modules as incorrectly assigned to an Object instead of an Array which caused an error. When trying to figure out if a module is active or not. This PR fixes this by making sure that the module is ### Test Got to the security settings then visit your site jetpack dashboard on your jetpack site. And toggle the state of protect. This will cause the error because the module is already active for example. Notice that this there is no more JS error.
Automattic_wp-calypso
train
js
31eecc12e31ccb8a3cc32b3de6f722643c9d3a9a
diff --git a/lang/nl/lang.php b/lang/nl/lang.php index <HASH>..<HASH> 100644 --- a/lang/nl/lang.php +++ b/lang/nl/lang.php @@ -63,6 +63,8 @@ 'amount' => 'Amount', 'author' => 'Author', 'link' => 'Link', + 'is_default' => 'Is default', + 'symbol' => 'Symbol', 'sort_order' => 'Sorting', 'created_at' => 'Created',
New translations lang.php (Dutch)
lovata_oc-toolbox-plugin
train
php
69ef34ed8bf58bdbdcdf88af9386c84aeeec1eba
diff --git a/lib/active_scaffold/actions/field_search.rb b/lib/active_scaffold/actions/field_search.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/actions/field_search.rb +++ b/lib/active_scaffold/actions/field_search.rb @@ -20,6 +20,7 @@ module ActiveScaffold::Actions def store_search_params_into_session set_field_search_default_params(active_scaffold_config.field_search.default_params) unless active_scaffold_config.field_search.default_params.nil? super + active_scaffold_session_storage[:search] = nil if search_params.is_a?(String) end def set_field_search_default_params(default_params)
Bugfix: npe if resetting field_search with ruby <I>
activescaffold_active_scaffold
train
rb
6874da8d8ce6b6664ea65b551c491e99667b0e88
diff --git a/src/phpDocumentor/Application.php b/src/phpDocumentor/Application.php index <HASH>..<HASH> 100644 --- a/src/phpDocumentor/Application.php +++ b/src/phpDocumentor/Application.php @@ -22,6 +22,7 @@ use Monolog\Logger; use phpDocumentor\Command\Helper\LoggerHelper; use phpDocumentor\Configuration; use phpDocumentor\Console\Input\ArgvInput; +use phpDocumentor\Transformer\Writer\Collection; use phpDocumentor\Transformer\Writer\Exception\RequirementMissing; use Symfony\Component\Console\Application as ConsoleApplication; use Symfony\Component\Console\Shell; @@ -305,9 +306,13 @@ class Application extends Cilex protected function verifyWriterRequirementsAndExitIfBroken() { try { - $this['transformer.writer.collection']->checkRequirements(); + /** @var Collection $writerCollection */ + $writerCollection = $this['transformer.writer.collection']; + $writerCollection->checkRequirements(); } catch (RequirementMissing $e) { - $this['monolog']->emerg( + /** @var Logger $logger */ + $logger = $this['monolog']; + $logger->emerg( 'phpDocumentor detected that a requirement is missing in your system setup: ' . $e->getMessage() ); exit(1);
#<I>: Fix warnings in Application
phpDocumentor_phpDocumentor2
train
php
d80854aa1c65a0bc02ef422c5eb5a6130ef5a96b
diff --git a/src/state.js b/src/state.js index <HASH>..<HASH> 100644 --- a/src/state.js +++ b/src/state.js @@ -172,7 +172,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { var name = state.name; if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name"); - if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined"); + if (states.hasOwnProperty(name)) throw new Error("State '" + name + "' is already defined"); // Get parent name var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))
chore(state): remove unnecessary character - Remove unnecessary `'` character Closes #<I>
ui-router_angular
train
js
9f558aa5d90aed1b997c00902c1dda043b25d609
diff --git a/lib/Repository.js b/lib/Repository.js index <HASH>..<HASH> 100644 --- a/lib/Repository.js +++ b/lib/Repository.js @@ -187,8 +187,10 @@ class Repository extends Requestable { * @return {Promise} - the promise for the http request */ listCommits(options, cb) { - options = options || {}; - + if (typeof options === 'function') { + cb = options; + options = {}; + } options.since = this._dateToISO(options.since); options.until = this._dateToISO(options.until);
fix 'listCommits' when only callback is given
github-tools_github
train
js
8258dce13b225b02ce53994783c0471f5febf58d
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 @@ -1211,9 +1211,13 @@ module Discordrb alias_method :users, :members + # @param include_idle [true, false] Whether to count idle members as online. + # @param include_bots [true, false] Whether to include bot accounts in the count. # @return [Array<Member>] an array of online members on this server. - def online_members - @members.values.select(&:online?) + def online_members(include_idle: false, include_bots: true) + @members.values.select do |e| + ((include_idle ? e.idle? : false) || e.online?) && (include_bots ? true : !e.bot_account?) + end end # @return [Array<Channel>] an array of text channels on this server
Add include_idle and include_bots parameters to online_members
meew0_discordrb
train
rb
3751ae4b0de8bfd43609416b1d2d504754f6a923
diff --git a/lib/opal_hot_reloader/server.rb b/lib/opal_hot_reloader/server.rb index <HASH>..<HASH> 100644 --- a/lib/opal_hot_reloader/server.rb +++ b/lib/opal_hot_reloader/server.rb @@ -65,7 +65,7 @@ module OpalHotReloader def send_updated_file(modified_file) - if modified_file =~ /\.rb$/ + if modified_file =~ /\.rb(\.erb)?$/ file_contents = File.read(modified_file).force_encoding(Encoding::UTF_8) update = { type: 'ruby',
Add optional .erb to regex First step to also watching for ERB file changes.
fkchang_opal-hot-reloader
train
rb
b8833a7f0a193c17c722b10e3dab84af22421453
diff --git a/ajaxinclude.jquery.js b/ajaxinclude.jquery.js index <HASH>..<HASH> 100644 --- a/ajaxinclude.jquery.js +++ b/ajaxinclude.jquery.js @@ -43,7 +43,7 @@ if( url && method ){ - $(this) + el .data( "method", method ) .data( "url", url ) .data( "proxy", proxy ) @@ -65,7 +65,7 @@ } } - if( k === els.length-1 ){ + if( !proxy || k === els.length-1 ){ $.get( url, function( data ) { els.trigger( "ajaxInclude", [data] ); });
fixed up a bug in the non-proxied case
filamentgroup_Ajax-Include-Pattern
train
js
b4270f278b15ab1d3b2ce11b3fba54e1e3bac6b8
diff --git a/mbed/mbed.py b/mbed/mbed.py index <HASH>..<HASH> 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -1241,7 +1241,7 @@ class Repo(object): def write(self): up = urlparse(self.url) - url = up._replace(netloc=up.hostname).geturl() # strip auth string + url = up._replace(netloc=up.hostname + (':'+str(up.port) if up.port else '')).geturl() # strip auth string if os.path.isfile(self.lib): with open(self.lib) as f: @@ -1731,7 +1731,7 @@ def formaturl(url, format="default"): else: m = re.match(regex_repo_url, url) if m and m.group(1) == '': # no protocol specified, probably ssh string like "git@github.com:ARMmbed/mbed-os.git" - url = 'ssh://%s%s%s/%s.git' % (m.group(2) or 'git@', m.group(6), m.group(7) or '', m.group(8)) # convert to common ssh URL-like format + url = 'ssh://%s%s%s/%s' % (m.group(2) or 'git@', m.group(6), m.group(7) or '', m.group(8)) # convert to common ssh URL-like format m = re.match(regex_repo_url, url) if m:
Preserve port in repo URLs when striping out auth strings
ARMmbed_mbed-cli
train
py
86d61c196346886eca5545fa7bd0f272409d9f28
diff --git a/lib/hatchet/reaper.rb b/lib/hatchet/reaper.rb index <HASH>..<HASH> 100644 --- a/lib/hatchet/reaper.rb +++ b/lib/hatchet/reaper.rb @@ -35,6 +35,17 @@ module Hatchet else # do nothing end + + # If the app is already deleted an exception + # will be raised, if the app cannot be found + # assume it is already deleted and try again + rescue Excon::Error::NotFound => e + body = e.response.body + if body =~ /Couldn\'t find that app./ + puts "#{@message}, but looks like it was already deleted" + retry + end + raise e end def destroy_oldest @@ -50,7 +61,8 @@ module Hatchet end def destroy_by_id(name:, id:, details: "") - puts "Destroying #{name.inspect}: #{id}. #{details}" + @message = "Destroying #{name.inspect}: #{id}. #{details}" + puts @message @platform_api.app.delete(id) end
Fix double deletes When running multiple test workers against the same account it’s possible that two of them try to delete the same app, when this happens we should not be raising an error, but instead see if the user is under the “threshold”, if they are do nothing, if not the next app should be removed. Repeat until the user is under the threshold.
heroku_hatchet
train
rb
9d60245be6e9a185b90f44ae832b43a70a25cdf6
diff --git a/test/unit/isValidProxy.js b/test/unit/isValidProxy.js index <HASH>..<HASH> 100644 --- a/test/unit/isValidProxy.js +++ b/test/unit/isValidProxy.js @@ -46,7 +46,7 @@ describe('isValidProxy(proxy)', function() { { ipAddress: '127.0.0.1', port: 8888, - protocols: null + protocols: ['invalid'], }, { ipAddress: '127.0.0.1', @@ -63,7 +63,7 @@ describe('isValidProxy(proxy)', function() { { ipAddress: '127.0.0.1', port: 80, - anonymityLevel: null + anonymityLevel: 'invalid' } ];
Null values are not considered "set"
chill117_proxy-lists
train
js
9f35acfd45a19c44be98279c17e97e4f6b4cfd73
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,6 @@ module.exports = function(source) { } return source.replace(templateUrlRegex, function(match, url, ending) { - return 'template: require("' + path.posix.join(basePath, url) + '")' + ending; + return 'template: require(' + loaderUtils.stringifyRequest(this, path.posix.join(basePath, url)) + ')' + ending; }); };
Update index.js closes #1
maksim-tolo_angular-template-url-loader
train
js
3f770fe2b34ddbc980c127be595a26ef420cbd45
diff --git a/__tests__/config.test.js b/__tests__/config.test.js index <HASH>..<HASH> 100644 --- a/__tests__/config.test.js +++ b/__tests__/config.test.js @@ -84,6 +84,7 @@ describe('jest configuration', () => { afterAll(() => { process.chdir(process.env.PLUGIN_TEST_DIR); + jest.unmock('serverless/lib/classes/CLI'); }); it('passes the serverless jest config through to jest', async () => {
Make sure serverless CLI is unmocked after config test
SC5_serverless-jest-plugin
train
js
b59ff823c1eaf5434112786edcbc41c34417d44c
diff --git a/plugins/logger/index.js b/plugins/logger/index.js index <HASH>..<HASH> 100644 --- a/plugins/logger/index.js +++ b/plugins/logger/index.js @@ -1,8 +1,9 @@ var zlib = require('zlib'), fs = require('fs'); -var robohydra = require('robohydra'), - RoboHydraHead = robohydra.heads.RoboHydraHead, - Response = robohydra.Response; +var robohydra = require('robohydra'), + RoboHydraHead = robohydra.heads.RoboHydraHead, + Request = robohydra.Request, + Response = robohydra.Response; function printResponseBody(logFileFd, responseBody) { @@ -97,10 +98,13 @@ function getBodyParts(config) { name: 'logger', path: '/.*', handler: function(req, res, next) { + // Save the original request as it can be modified before + // the response object end callback gets executed + var origRequest = new Request(req); var fakeRes = new Response( function() { logRequestResponse(logFileFd, - req, + origRequest, fakeRes, function() { res.copyFrom(fakeRes);
Log the original request, not the possibly-modified
robohydra_robohydra
train
js
dbcdd03cdcd2758ef59e7b04efbe5d1f586f14eb
diff --git a/src/Filesystem/Command/FilesystemLsCommand.php b/src/Filesystem/Command/FilesystemLsCommand.php index <HASH>..<HASH> 100755 --- a/src/Filesystem/Command/FilesystemLsCommand.php +++ b/src/Filesystem/Command/FilesystemLsCommand.php @@ -119,7 +119,11 @@ class FilesystemLsCommand extends Command private function getFileMetadata($filesystem, $path) { if ('.' !== $path) { - $metaData = $filesystem->getMetadata($path); + try { + $metaData = $filesystem->getMetadata($path); + } catch (\Exception $e) { + // Do nothing. Assume this is a directory since some filesystems will not return metadata for directories + } } if (empty($metaData)) {
Added exception handling for file system which throw an exception when getting metadata for a directory
conductorphp_conductor-core
train
php
1a62cdbd9a5b9ba498763f107f58c7aa67e5514f
diff --git a/cmd/influxd/main.go b/cmd/influxd/main.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/main.go +++ b/cmd/influxd/main.go @@ -20,13 +20,16 @@ import ( // These variables are populated via the Go linker. var ( - version = "0.9" - commit string - branch string + version string + commit string + branch string ) func init() { // If commit, branch, or build time are not set, make that clear. + if version == "" { + version = "unknown" + } if commit == "" { commit = "unknown" } diff --git a/cmd/influxd/run/command.go b/cmd/influxd/run/command.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/run/command.go +++ b/cmd/influxd/run/command.go @@ -71,8 +71,8 @@ func (cmd *Command) Run(args ...string) error { runtime.GOMAXPROCS(runtime.NumCPU()) // Mark start-up in log. - log.Printf("InfluxDB starting, version %s, branch %s, commit %s, built %s", - cmd.Version, cmd.Branch, cmd.Commit, cmd.BuildTime) + log.Printf("InfluxDB starting, version %s, branch %s, commit %s", + cmd.Version, cmd.Branch, cmd.Commit) log.Printf("Go version %s, GOMAXPROCS set to %d", runtime.Version(), runtime.GOMAXPROCS(0)) // Write the PID file.
Removed builtTime reference from influxd. Removed default version information from influxd.
influxdata_influxdb
train
go,go
36786e8c86655a8715033961adc536e064234a7d
diff --git a/lib/webcomment_config.py b/lib/webcomment_config.py index <HASH>..<HASH> 100644 --- a/lib/webcomment_config.py +++ b/lib/webcomment_config.py @@ -17,7 +17,7 @@ ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# pylint: disable-msg=C0301 +# pylint: disable=C0301 """WebComment configuration parameters."""
kwalitee: adapt disable-msg to new pylint * Changed all codebase to adapt enable-msg/disable-msg pylint comments to a new pylint version that leaves -msg part out.
inveniosoftware-attic_invenio-comments
train
py
d86e43b2fb2fe16f5e7d63cd7a85cc5a6f4e8562
diff --git a/sh.py b/sh.py index <HASH>..<HASH> 100644 --- a/sh.py +++ b/sh.py @@ -668,8 +668,10 @@ class Command(object): #("fg", "bg", "Command can't be run in the foreground and background"), ("err", "err_to_out", "Stderr is already being redirected"), ("piped", "iter", "You cannot iterate when this command is being piped"), - ("piped", "no_pipe", "Using a pipe doesn't make sense if you've\ + ("piped", "no_pipe", "Using a pipe doesn't make sense if you've \ disabled the pipe"), + ("no_out", "iter", "You cannot iterate over output if there is no \ +output"), )
added new incompatible args, closes #<I>
amoffat_sh
train
py
50bec41726392b333610204e410a4d5a19f23eee
diff --git a/java-cloudbuild/synth.py b/java-cloudbuild/synth.py index <HASH>..<HASH> 100644 --- a/java-cloudbuild/synth.py +++ b/java-cloudbuild/synth.py @@ -17,6 +17,8 @@ import synthtool.gcp as gcp import synthtool.languages.java as java +AUTOSYNTH_MULTIPLE_COMMITS = True + gapic = gcp.GAPICGenerator() service='devtools-cloudbuild'
chore: enable context aware commits (#<I>)
googleapis_google-cloud-java
train
py
4bfbe8f26aa6d17563e5538dd3a7f0e8d2bc853c
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -28,11 +28,11 @@ class Configuration implements ConfigurationInterface{ ->end() ->end() ->arrayNode('parameters') - ->prototype('scalar')->end() + ->prototype('variable')->end() ->end() ->arrayNode('services') ->prototype('array') - ->prototype('scalar')->end() + ->prototype('variable')->end() ->end() ->end() ->end();
di/configuration: use 'variable' prototype for 'parameters' and 'services' to allow any type of values
tobymackenzie_sy-console
train
php
3f90fbd8c09fe342abcf41b57911fb7778d53a5c
diff --git a/test/requests.js b/test/requests.js index <HASH>..<HASH> 100644 --- a/test/requests.js +++ b/test/requests.js @@ -444,6 +444,26 @@ var tests = function(web3) { }) + it("should respond with correct txn hash", function(done) { + var provider = web3.currentProvider; + var transaction = new Transaction({ + "value": "0x00", + "gasLimit": "0x5208", + "from": accounts[0], + "to": accounts[1], + "nonce": "0x02" + }) + + var secretKeyBuffer = Buffer.from(secretKeys[0].substr(2), 'hex') + transaction.sign(secretKeyBuffer) + + web3.eth.sendSignedTransaction(transaction.serialize(), function(err, result) { + assert.equal(result, to.hex(transaction.hash())) + done(err) + }) + + }) + }) describe("contract scenario", function() {
Add test for eth_sendRawTransaction response with signature
trufflesuite_ganache-core
train
js
0c09ccc9c44d05132ca247eded1faf6397394d7e
diff --git a/lib/specinfra/version.rb b/lib/specinfra/version.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/version.rb +++ b/lib/specinfra/version.rb @@ -1,3 +1,3 @@ module Specinfra - VERSION = "2.34.2" + VERSION = "2.34.3" end
Bump up version [skip ci]
mizzy_specinfra
train
rb
30c36fc8d95b34b1d7f42f645b1e5d6eb852e062
diff --git a/cf/commands/securitygroup/security_groups.go b/cf/commands/securitygroup/security_groups.go index <HASH>..<HASH> 100644 --- a/cf/commands/securitygroup/security_groups.go +++ b/cf/commands/securitygroup/security_groups.go @@ -31,7 +31,7 @@ func (cmd SecurityGroups) Metadata() command_metadata.CommandMetadata { return command_metadata.CommandMetadata{ Name: "security-groups", Description: T("List all security groups"), - Usage: "CF_NAME security-group", + Usage: "CF_NAME security-groups", } }
Fix the Usage info in cf security-groups command
cloudfoundry_cli
train
go
8c3eca84db3b2feae44fac43fc918cc69fad07ec
diff --git a/tsdb/head_append.go b/tsdb/head_append.go index <HASH>..<HASH> 100644 --- a/tsdb/head_append.go +++ b/tsdb/head_append.go @@ -305,13 +305,21 @@ func (s *memSeries) appendable(t int64, v float64) error { // AppendExemplar for headAppender assumes the series ref already exists, and so it doesn't // use getOrCreate or make any of the lset sanity checks that Append does. -func (a *headAppender) AppendExemplar(ref uint64, _ labels.Labels, e exemplar.Exemplar) (uint64, error) { +func (a *headAppender) AppendExemplar(ref uint64, lset labels.Labels, e exemplar.Exemplar) (uint64, error) { // Check if exemplar storage is enabled. if !a.head.opts.EnableExemplarStorage || a.head.opts.MaxExemplars.Load() <= 0 { return 0, nil } + + // Get Series s := a.head.series.getByID(ref) if s == nil { + s = a.head.series.getByHash(lset.Hash(), lset) + if s != nil { + ref = s.ref + } + } + if s == nil { return 0, fmt.Errorf("unknown series ref. when trying to add exemplar: %d", ref) }
Fix remote write receiver endpoint for exemplars (#<I>)
prometheus_prometheus
train
go
0aadd84553986ba7f0ef9b62a224f9a718eb9ad9
diff --git a/polyfill/require.js b/polyfill/require.js index <HASH>..<HASH> 100644 --- a/polyfill/require.js +++ b/polyfill/require.js @@ -551,8 +551,6 @@ _register('requireDynamic', require); _register('requireLazy', requireLazy); - define.amd = {}; - global.define = define; global.require = require; global.requireDynamic = require;
Stop pretending we're AMD compatible
facebookarchive_react-page-middleware
train
js
fe8fdcfddf5c1e280d2198f8c05d5bea3ca73cf4
diff --git a/middleware/swagger-ui.js b/middleware/swagger-ui.js index <HASH>..<HASH> 100644 --- a/middleware/swagger-ui.js +++ b/middleware/swagger-ui.js @@ -130,7 +130,7 @@ exports = module.exports = function swaggerUIMiddleware (rlOrSO, apiDeclarations var isSwaggerUiPath = path === options.swaggerUi || path.indexOf(options.swaggerUi + '/') === 0; debug('%s %s', req.method, req.url); - debug(' Will process: %s', isApiDocsPath || isSwaggerUiPath ? 'no' : 'yes'); + debug(' Will process: %s', isApiDocsPath || isSwaggerUiPath ? 'yes' : 'no'); if (isApiDocsPath) { debug(' Serving API Docs');
Fixed issue with invalid debugging in swagger-ui
apigee-127_swagger-tools
train
js
61640b099a2bb764af2fc89f7411c3705dd62f6d
diff --git a/libcontainer/error.go b/libcontainer/error.go index <HASH>..<HASH> 100644 --- a/libcontainer/error.go +++ b/libcontainer/error.go @@ -60,9 +60,9 @@ func (c ErrorCode) String() string { type Error interface { error - // Returns a verbose string including the error message - // and a representation of the stack trace suitable for - // printing. + // Returns an error if it failed to write the detail of the Error to w. + // The detail of the Error may include the error message and a + // representation of the stack trace. Detail(w io.Writer) error // Returns the error code for this error.
Fix the outdated comment for Error interface
opencontainers_runc
train
go
65bde2951f58eb31307f9aedba3bace1c59106e0
diff --git a/packages/swagger2openapi/index.js b/packages/swagger2openapi/index.js index <HASH>..<HASH> 100644 --- a/packages/swagger2openapi/index.js +++ b/packages/swagger2openapi/index.js @@ -738,7 +738,7 @@ function processPaths(container, containerName, options, requestBodyCache, opena entry.refs = []; requestBodyCache[rbSha256] = entry; } - let ptr = '#/'+containerName+'/'+jptr.jpescape(p)+'/'+method+'/requestBody'; + let ptr = '#/'+containerName+'/'+encodeURIComponent(jptr.jpescape(p))+'/'+method+'/requestBody'; requestBodyCache[rbSha256].refs.push(ptr); }
Both escape and URI encode when creating JSON pointers
Mermade_oas-kit
train
js
be964e2e964285bb59ff9c005b2abc7c7387a168
diff --git a/travis-ci/urls.py b/travis-ci/urls.py index <HASH>..<HASH> 100644 --- a/travis-ci/urls.py +++ b/travis-ci/urls.py @@ -1,19 +1,5 @@ -import os +from django.conf.urls import include, url -version = os.environ.get("DJANGO_VERSION", "1.6") - -values = version.split(".") -major = values[0] -minor = values[1] - -if major == 1 and minor < 10: - from django.conf.urls import patterns, include, url - from django.contrib import admin - urlpatterns = patterns('', - # Examples: - # url(r'^$', 'project.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), - # url(r'^', include('userservice.urls')), - ) -else: - urlpatterns = [] +urlpatterns = [ + url(r'^rc/', include('restclients.urls')), +]
Include the urls for travis-ci
uw-it-aca_uw-restclients
train
py
3376c2ea1809f6ae73f9742cd6543acf57a9d247
diff --git a/lib/mustachio.rb b/lib/mustachio.rb index <HASH>..<HASH> 100644 --- a/lib/mustachio.rb +++ b/lib/mustachio.rb @@ -12,19 +12,23 @@ Magickly.dragonfly.configure do |c| c.analyser.add :face_data_as_px do |temp_object| data = Mustachio.face_client.faces_detect(:file => temp_object.file, :attributes => 'none')['photos'].first # TODO use #face_data - data['tags'].map! do |face| - Mustachio::FACE_POS_ATTRS.each do |pos_attr| - if face[pos_attr].nil? - puts "WARN: missing position attribute '#{pos_attr}'" - else + new_tags = [] + data['tags'].map do |face| + has_all_attrs = Mustachio::FACE_POS_ATTRS.all? do |pos_attr| + if face[pos_attr] face[pos_attr]['x'] *= (data['width'] / 100.0) face[pos_attr]['y'] *= (data['height'] / 100.0) + true + else + # face attribute missing + false end end - face + new_tags << face if has_all_attrs end + data['tags'] = new_tags data end
ignore faces that are missing a face attr
afeld_mustachio
train
rb
fb8621ca0da02d9dc998efce16aa637ea2eaa92d
diff --git a/test/TemplateWriterTest.js b/test/TemplateWriterTest.js index <HASH>..<HASH> 100644 --- a/test/TemplateWriterTest.js +++ b/test/TemplateWriterTest.js @@ -583,14 +583,20 @@ test.skip("JavaScript with alias", async t => { evf.init(); let files = await fastglob.async(evf.getFileGlobs()); - t.deepEqual(evf.getRawFiles(), [ - "./test/stubs/writeTestJS/**/*.11ty.js", - "./test/stubs/writeTestJS/**/*.js" - ]); - t.deepEqual(files, [ - "./test/stubs/writeTestJS/sample.js", - "./test/stubs/writeTestJS/test.11ty.js" - ]); + t.deepEqual( + evf.getRawFiles().sort(), + [ + "./test/stubs/writeTestJS/**/*.11ty.js", + "./test/stubs/writeTestJS/**/*.js" + ].sort() + ); + t.deepEqual( + files.sort(), + [ + "./test/stubs/writeTestJS/sample.js", + "./test/stubs/writeTestJS/test.11ty.js" + ].sort() + ); let tw = new TemplateWriter( "./test/stubs/writeTestJS",
Sort when comparing arrays because some versions of node... I don't really know why but order is different and it matters
11ty_eleventy
train
js
6b387614825528e0f7f57d7af2de3352bc8637c7
diff --git a/ecommerce_worker/configuration/base.py b/ecommerce_worker/configuration/base.py index <HASH>..<HASH> 100644 --- a/ecommerce_worker/configuration/base.py +++ b/ecommerce_worker/configuration/base.py @@ -70,7 +70,7 @@ SITE_OVERRIDES = None # .. toggle_use_cases: open_edx # .. toggle_creation_date: 2021-02-09 # .. toggle_target_removal_date: None -# .. toggle_warnings: None +# .. toggle_warning: None # .. toggle_tickets: ENT-4071 BRAZE = { 'BRAZE_ENABLE': False,
refactor: rename toggle_warnings to toggle_warning (#<I>) Rename toggle_warnings to toggle_warning for consistency with setting_warning.
edx_ecommerce-worker
train
py
d2e609e98be452002961748100f8bd6ff6235e9b
diff --git a/src/meta/dependency.js b/src/meta/dependency.js index <HASH>..<HASH> 100644 --- a/src/meta/dependency.js +++ b/src/meta/dependency.js @@ -29,7 +29,7 @@ return loadDependencies(manager, moduleMeta); } - if (moduleMeta.plugins) { + if (moduleMeta.plugins && moduleMeta.plugins.length) { return manager.pipelines.dependency .run(moduleMeta.plugins) .then(dependenciesFinished, Utils.forwardError); diff --git a/src/meta/transform.js b/src/meta/transform.js index <HASH>..<HASH> 100644 --- a/src/meta/transform.js +++ b/src/meta/transform.js @@ -21,7 +21,7 @@ return moduleMeta; } - if (moduleMeta.plugins) { + if (moduleMeta.plugins && moduleMeta.plugins.length) { return manager.pipelines.transform .run(moduleMeta.plugins) .then(transformationFinished, Utils.forwardError);
fixed issue with empty list of plugins keeping the rest of the middleware providers from executing
MiguelCastillo_bit-loader
train
js,js
b24e13772734ed00e7b5d9d43a173ff53bdb6e17
diff --git a/django_cryptography/__init__.py b/django_cryptography/__init__.py index <HASH>..<HASH> 100644 --- a/django_cryptography/__init__.py +++ b/django_cryptography/__init__.py @@ -1,5 +1,5 @@ from django_cryptography.utils.version import get_version -VERSION = (0, 1, 0, 'final', 0) +VERSION = (0, 2, 0, 'alpha', 0) __version__ = get_version(VERSION) diff --git a/docs/releases.rst b/docs/releases.rst index <HASH>..<HASH> 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -1,6 +1,9 @@ Releases ======== +0.2 - master_ +------------- + 0.1 - 2016-05-21 ---------------- diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -148,7 +148,7 @@ setup( author_email='george@georgemarshall.name', license='BSD', classifiers=[ - 'Development Status :: 5 - Production/Stable', + 'Development Status :: 2 - Pre-Alpha', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers',
Bumped version to <I> pre-alpha
georgemarshall_django-cryptography
train
py,rst,py
cd715bff28aefb46a4e1e24c03c49f9a874818eb
diff --git a/file_reader.go b/file_reader.go index <HASH>..<HASH> 100644 --- a/file_reader.go +++ b/file_reader.go @@ -187,14 +187,14 @@ func (f *FileReader) Read(b []byte) (int, error) { } } - if f.blockReader == nil { - err := f.getNewBlockReader() - if err != nil { - return 0, err + for { + if f.blockReader == nil { + err := f.getNewBlockReader() + if err != nil { + return 0, err + } } - } - for { n, err := f.blockReader.Read(b) f.offset += int64(n) @@ -204,9 +204,12 @@ func (f *FileReader) Read(b []byte) (int, error) { return n, err } else if n > 0 { return n, nil - } else { - f.blockReader.Close() - f.getNewBlockReader() + } + + err = f.blockReader.Close() + f.blockReader = nil + if err != nil { + return n, err } } }
Don't swallow errors from BlockReader.Close
colinmarc_hdfs
train
go
3d87eccf5c0df65a3b0d3ef9645fe22ae740c254
diff --git a/lib/fog/openstack.rb b/lib/fog/openstack.rb index <HASH>..<HASH> 100644 --- a/lib/fog/openstack.rb +++ b/lib/fog/openstack.rb @@ -1,5 +1,6 @@ require 'fog/openstack/compute' require 'fog/openstack/identity_v2' +require 'fog/openstack/identity_v3' require 'fog/openstack/image' require 'fog/openstack/metering' require 'fog/openstack/network'
Add missing require of identitty v3 Otherwise we get exception with missing Fog::Identity::OpenStack::V3
fog_fog
train
rb
844ce23b076830f4bd9c9e9d10beaf05ede75a11
diff --git a/pysparkling/sql/dataframe.py b/pysparkling/sql/dataframe.py index <HASH>..<HASH> 100644 --- a/pysparkling/sql/dataframe.py +++ b/pysparkling/sql/dataframe.py @@ -1233,6 +1233,9 @@ class DataFrame(object): assert isinstance(col, Column), "col should be Column" return DataFrame(self._jdf.withColumn(colName, col), self.sql_ctx) + def withColumnRenamed(self, existing, new): + return DataFrame(self._jdf.withColumnRenamed(existing, new), self.sql_ctx) + class DataFrameNaFunctions(object): def __init__(self, df):
Implement DataFrame.withColumnRenamed
svenkreiss_pysparkling
train
py
2a658fcac744bdcad444489ee339d0cf0dc190ca
diff --git a/helpers/translation/class.TranslationFile.php b/helpers/translation/class.TranslationFile.php index <HASH>..<HASH> 100644 --- a/helpers/translation/class.TranslationFile.php +++ b/helpers/translation/class.TranslationFile.php @@ -332,11 +332,17 @@ class tao_helpers_translation_TranslationFile // If the translation unit exists, we replace the target with the new one if it exists. foreach($this->getTranslationUnits() as $tu) { + if ($tu->getSource() == $translationUnit->getSource()) { - - $tu->setTarget($translationUnit->getTarget()); - $tu->setAnnotations($translationUnit->getAnnotations()); - + // If we are here, it means that this TU is being overriden by + // another one having the same source... + // + // Let's make sure we don't override the existing one with an empty target! + if ($translationUnit->getTarget() !== '') { + $tu->setTarget($translationUnit->getTarget()); + $tu->setAnnotations($translationUnit->getAnnotations()); + } + return; } }
Empty translations were overriding non-empty ones.
oat-sa_tao-core
train
php
8213ee7757df44e0c6d09977a83aaa775f4ea865
diff --git a/src/Content/Migration/Base.php b/src/Content/Migration/Base.php index <HASH>..<HASH> 100644 --- a/src/Content/Migration/Base.php +++ b/src/Content/Migration/Base.php @@ -493,7 +493,7 @@ class Base // Use the MySQL driver for this $database = \JDatabase::getInstance( array( - 'driver' => 'mysql', + 'driver' => \Config::get('dbtype', 'pdo'), 'host' => \Config::get('host'), 'user' => \Config::get('user'), 'password' => \Config::get('password'), @@ -1036,7 +1036,7 @@ class Base // Use the MySQL driver for this $database = \JDatabase::getInstance( array( - 'driver' => 'mysql', + 'driver' => \Config::get('dbtype', 'pdo'), 'host' => \Config::get('host'), 'user' => \Config::get('user'), 'password' => \Config::get('password'),
[fix] Honor configuration choice for database type (#<I>)
hubzero_framework
train
php
ce728615caba7e1634a9ab74113e7c6ca41d2e11
diff --git a/estimote-sticker/estimote-sticker.js b/estimote-sticker/estimote-sticker.js index <HASH>..<HASH> 100644 --- a/estimote-sticker/estimote-sticker.js +++ b/estimote-sticker/estimote-sticker.js @@ -50,10 +50,10 @@ EstimoteSticker.prototype.onDiscover = function(peripheral) { // id can be looked up: https://cloud.estimote.com/v1/stickers/<id>/info // response: {"identifier":"<id>","type":"shoe","color":"blueberry","category":"shoe"} - var id = manufacturerData.slice(3, 7).toString('hex'); + var id = manufacturerData.slice(3, 11).toString('hex'); var major = parseInt(manufacturerData.slice(7, 9).toString('hex'), 16); var minor = parseInt(manufacturerData.slice(9, 11).toString('hex'), 16); - var uuid = 'd0d3fa86ca7645ec9bd96af4' + id; + var uuid = 'd0d3fa86ca7645ec9bd96af4' + manufacturerData.slice(3, 7).toString('hex'); var type = (manufacturerData[11] === 0x4) ? 'SB0' : 'unknown'; var firmware = null;
fix id comparing to the estimate APP
sandeepmistry_node-bleacon
train
js
6bb82d987f4f6177634d86ac783ce989286e08be
diff --git a/lib/nano.js b/lib/nano.js index <HASH>..<HASH> 100644 --- a/lib/nano.js +++ b/lib/nano.js @@ -554,7 +554,7 @@ module.exports = exports = nano = function dbScope(cfg) { follows: true, length: Buffer.isBuffer(att.data) ? att.data.length : Buffer.byteLength(att.data), - content_type: att.contentType + 'content_type': att.contentType }; multipart.push({body: att.data}); });
Fixes codestyle from #<I>
cloudant_nodejs-cloudant
train
js
205ee9af677a0561cffc04529a36af1a18786b11
diff --git a/cumulusci/tasks/metadata_etl/tests/test_help_text.py b/cumulusci/tasks/metadata_etl/tests/test_help_text.py index <HASH>..<HASH> 100644 --- a/cumulusci/tasks/metadata_etl/tests/test_help_text.py +++ b/cumulusci/tasks/metadata_etl/tests/test_help_text.py @@ -408,4 +408,3 @@ class TestAddPicklistValues: assert test_elem is not None assert test_elem.inlineHelpText.text == "foo" -
Update task with suggested naming convention. Added overwrite flag to allow for a cautious approach to editing help text fields
SFDO-Tooling_CumulusCI
train
py
8cba5d06b5f73b9bf2f70019b9f71450cc7e40ac
diff --git a/config/build.js b/config/build.js index <HASH>..<HASH> 100644 --- a/config/build.js +++ b/config/build.js @@ -52,7 +52,9 @@ TYPES_TARGETS.forEach((target) => { const providersDir = path.join(process.cwd(), "/src/providers") -const files = fs.readdirSync(providersDir, "utf8") +const files = fs + .readdirSync(providersDir, "utf8") + .filter((file) => file !== "index.js") let importLines = "" let exportLines = `export default {\n`
build(provider): filter index.js to be more forgiving
iaincollins_next-auth
train
js
5c37e60363790b690ca94d16aed5e7a4083c0976
diff --git a/test/spec/modules/yieldmoBidAdapter_spec.js b/test/spec/modules/yieldmoBidAdapter_spec.js index <HASH>..<HASH> 100644 --- a/test/spec/modules/yieldmoBidAdapter_spec.js +++ b/test/spec/modules/yieldmoBidAdapter_spec.js @@ -145,8 +145,18 @@ describe('YieldmoAdapter', () => { }; it('should return a tracker with type and url as parameters', () => { - // not ios, so tracker will fail - expect(spec.getUserSync(options)).to.deep.equal([]); + if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) { + expect(spec.getUserSync(options)).to.deep.equal([{ + type: 'iframe', + url: SYNC_ENDPOINT + utils.getOrigin() + }]); + + options.iframeEnabled = false; + expect(spec.getUserSync(options)).to.deep.equal([]); + } else { + // not ios, so tracker will fail + expect(spec.getUserSync(options)).to.deep.equal([]); + } }); }); });
Fix getUserSync test for ios (#<I>)
prebid_Prebid.js
train
js