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
|
---|---|---|---|---|---|
343448192e8c25e19c5381c603833114d3d5c4b3 | diff --git a/src/Storage/Field/Type/RepeaterType.php b/src/Storage/Field/Type/RepeaterType.php
index <HASH>..<HASH> 100644
--- a/src/Storage/Field/Type/RepeaterType.php
+++ b/src/Storage/Field/Type/RepeaterType.php
@@ -83,7 +83,7 @@ class RepeaterType extends FieldTypeBase
{
$key = $this->mapping['fieldname'];
if ($this->isJson($data[$key])) {
- $originalMapping[$key]['fields'] = $this->mapping['fields'];
+ $originalMapping[$key]['fields'] = $this->mapping['data']['fields'];
$originalMapping[$key]['type'] = 'repeater';
$mapping = $this->em->getMapper()->getRepeaterMapping($originalMapping); | Fix for Notice and subsequent warning related to repeater fields
Notice: Undefined index: fields in C:\MAMP\htdocs\nuffieldtrust.org.uk\vendor\bolt\bolt\src\Storage\Field\Type\RepeaterType.php on line <I> | bolt_bolt | train | php |
ae46b94e7496e0e29e1e56abaa015d5f510b9f4e | diff --git a/src/playbacks/hls/hls.js b/src/playbacks/hls/hls.js
index <HASH>..<HASH> 100644
--- a/src/playbacks/hls/hls.js
+++ b/src/playbacks/hls/hls.js
@@ -30,9 +30,9 @@ class HLS extends UIPlugin {
this.setupVisibility()
this.highDefinition = false
this.autoPlay = options.autoPlay
- this.settings = {
- left: ["playstop", "volume"],
- default: ["position", "seekbar", "duration"],
+ this.defaultSettings = {
+ left: ["playstop"],
+ default: [],
right: ["fullscreen", "volume", "hd"]
}
this.settings = _.extend({}, this.defaultSettings) | hls playback: fix default settings on initialization | clappr_clappr | train | js |
e40d25473a039fcd6b69dbebf6839ea3a8ae57d2 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -38,7 +38,7 @@ function tunnelProxy(server, proxy) {
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
server.on('connect', function(req, reqSocket, head) {//ws, wss, https proxy
- var tunnelUrl = req.fullUrl = util.setProtocol(/^[^:\/]+:\d+$/ ? req.url : req.headers.host, true);
+ var tunnelUrl = req.fullUrl = util.setProtocol(/^[^:\/]+:\d+$/.test(req.url) ? req.url : req.headers.host, true);
var options = parseUrl();
var tunnelUrl = req.fullUrl = 'tunnel://' + options.host;
var resSocket, proxySocket, responsed; | refactor: Priority handling req.url | avwo_whistle | train | js |
b958b855df5d217d57f10003f5bbcfe3576cfc89 | diff --git a/src/axelitus/Base/String.php b/src/axelitus/Base/String.php
index <HASH>..<HASH> 100644
--- a/src/axelitus/Base/String.php
+++ b/src/axelitus/Base/String.php
@@ -779,7 +779,7 @@ class String extends PrimitiveString
$string = '';
for ($i = 0; $i < $length; $i++) {
- $string .= $chars[mt_rand(0, static::length($chars) - 1)];
+ $string .= $chars[Int::random(0, static::length($chars) - 1)];
}
return $string;
@@ -802,14 +802,11 @@ class String extends PrimitiveString
public static function trandom($type = 'alnum', $length = 16, $shuffle = false)
{
switch ($type) {
- case 'basic':
- return mt_rand();
- break;
case 'unique':
- return md5(uniqid(mt_rand()));
+ return md5(uniqid(Int::random()));
break;
case 'sha1':
- return sha1(uniqid(mt_rand(), true));
+ return sha1(uniqid(Int::random(), true));
break;
case 'alpha':
$pool = self::ALPHA; | Changed the calls to mt_rand to the random functions of the primitives. | axelitus_php-base | train | php |
d508b2c9528a7d06d367f7aedeb8c5c03b26a56f | diff --git a/Source/garnish.js b/Source/garnish.js
index <HASH>..<HASH> 100644
--- a/Source/garnish.js
+++ b/Source/garnish.js
@@ -278,8 +278,21 @@ Garnish = $.extend(Garnish, {
*/
scrollContainerToElement: function(container, elem)
{
- var $container = $(container),
- $elem = $(elem);
+ if (typeof elem === typeof undefined)
+ {
+ var $elem = $(container);
+ $container = $elem.scrollParent();
+ }
+ else
+ {
+ var $container = $(container),
+ $elem = $(elem);
+ }
+
+ if ($container.prop('nodeName') === 'HTML')
+ {
+ $container = Garnish.$win;
+ }
var scrollTop = $container.scrollTop(),
elemOffset = $elem.offset().top; | Make it possible to just pass the element into scrollContainerToElement() | pixelandtonic_garnishjs | train | js |
69ae2faab4a3c5b700504060e54fb9179db75c52 | diff --git a/web/vhost.go b/web/vhost.go
index <HASH>..<HASH> 100644
--- a/web/vhost.go
+++ b/web/vhost.go
@@ -154,7 +154,7 @@ func (h *VHostHandler) Handle(useTLS bool, w http.ResponseWriter, r *http.Reques
// Set up the X-Forwarded-Proto header so that downstream servers know
// the request originated as HTTPS.
if _, found := r.Header["X-Forwarded-Proto"]; !found {
- r.Header.Set("X-Forwarded-Proto", "tcp")
+ r.Header.Set("X-Forwarded-Proto", "https")
}
rp.ServeHTTP(w, r) | set X-Forwarded-Proto https Header in vhost.go | control-center_serviced | train | go |
127c3e180f2e98fb3856bc6b1d872f4c5b9bb484 | diff --git a/examples/index.php b/examples/index.php
index <HASH>..<HASH> 100644
--- a/examples/index.php
+++ b/examples/index.php
@@ -160,17 +160,21 @@ if($_SERVER['REQUEST_METHOD'] === 'POST') {
<script>
var reg = localStorage.getItem('u2fregistration');
+var auth = document.getElementById('startAuthenticate');
if(reg == null) {
- var auth = document.getElementById('startAuthenticate');
auth.disabled = true;
} else {
var regs = document.getElementById('registrations');
- regs.value = reg;
- console.log("set the registrations to : ", reg);
-
- var regged = document.getElementById('registered');
decoded = JSON.parse(reg);
- regged.innerHTML = decoded.length;
+ if(!Array.isArray(decoded)) {
+ auth.disabled = true;
+ } else {
+ regs.value = reg;
+ console.log("set the registrations to : ", reg);
+
+ var regged = document.getElementById('registered');
+ regged.innerHTML = decoded.length;
+ }
}
</script>
</body> | try to cleanup from broken keyhandles in storage | Yubico_php-u2flib-server | train | php |
d61d2226bc149bf6a1fcffed8501607a9b3bb9a8 | diff --git a/ocrd_models/ocrd_models/ocrd_page.py b/ocrd_models/ocrd_models/ocrd_page.py
index <HASH>..<HASH> 100644
--- a/ocrd_models/ocrd_models/ocrd_page.py
+++ b/ocrd_models/ocrd_models/ocrd_page.py
@@ -5,6 +5,7 @@ from io import StringIO
__all__ = [
'parse',
+ 'parseEtree',
'parseString',
"AdvertRegionType",
@@ -67,6 +68,7 @@ __all__ = [
from .ocrd_page_generateds import (
parse,
+ parseEtree,
parseString,
AdvertRegionType, | ocrd_page: export parseEtree as well | OCR-D_core | train | py |
c19a6c4137741c852fe65fc6b60dfb774d850c2c | diff --git a/core/src/main/java/io/undertow/server/DirectByteBufferDeallocator.java b/core/src/main/java/io/undertow/server/DirectByteBufferDeallocator.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/undertow/server/DirectByteBufferDeallocator.java
+++ b/core/src/main/java/io/undertow/server/DirectByteBufferDeallocator.java
@@ -20,7 +20,11 @@ public final class DirectByteBufferDeallocator {
static {
- int version = Integer.getInteger("java.specification.version");
+ String versionString = System.getProperty("java.specification.version");
+ if(versionString.startsWith("1.")) {
+ versionString = versionString.substring(2);
+ }
+ int version = Integer.parseInt(versionString);
Method tmpCleaner = null;
Method tmpCleanerClean = null; | Fix issue with byte buffer dealocator | undertow-io_undertow | train | java |
186aa71b93d47e2915f7ec7e61bcc2d573f47f93 | diff --git a/state/machine.go b/state/machine.go
index <HASH>..<HASH> 100644
--- a/state/machine.go
+++ b/state/machine.go
@@ -906,7 +906,7 @@ func (original *Machine) advanceLifecycle(life Life, force, dyingAllowContainers
}
if canDie && !dyingAllowContainers {
- if err := m.evaulateContainersAdvanceLifecycle(); !IsHasContainersError(err) {
+ if err := m.evaulateContainersAdvanceLifecycle(); err != nil && !IsHasContainersError(err) {
return nil, err
} else if IsHasContainersError(err) {
canDie = false | Don't return if err is nil, causes destroy container to fail. | juju_juju | train | go |
7e7a5b198ba7632dc7e783c53ad88e1e592030d0 | diff --git a/lib/yap/shell/execution/shell_command_execution.rb b/lib/yap/shell/execution/shell_command_execution.rb
index <HASH>..<HASH> 100644
--- a/lib/yap/shell/execution/shell_command_execution.rb
+++ b/lib/yap/shell/execution/shell_command_execution.rb
@@ -20,14 +20,11 @@ module Yap::Shell::Execution
end
Treefell['shell'].puts "shell command executing with params: #{params.inspect} $stdout=#{$stdout.inspect} $stderr=#{$stderr.inspect}"
- pid = fork { func.call(**params) }
-
- if wait
- pid, status = Process.wait2(pid, Process::WUNTRACED)
- end
+ func.call(**params)
@stdout.close if @stdout != $stdout && [email protected]?
@stderr.close if @stderr != $stderr && [email protected]?
+ @stdin.close if @stdin != $stdin && [email protected]?
end
end
end | Revert forking for shell functions, but keep closing non-standard stdin/out/err.
E.g. the following work where upcase is a shell function:
ls | upcase | sort | zdennis_yap-shell-core | train | rb |
f7a0459082596ba2431bac193a1e605cc4e30ecd | diff --git a/generate.go b/generate.go
index <HASH>..<HASH> 100644
--- a/generate.go
+++ b/generate.go
@@ -19,6 +19,7 @@
//go:generate glow generate -out=./v4.5-compatibility/gl/ -api=gl -version=4.5 -profile=compatibility -xml=../glow/xml/ -tmpl=../glow/tmpl/
//go:generate glow generate -out=./v4.6-compatibility/gl/ -api=gl -version=4.6 -profile=compatibility -xml=../glow/xml/ -tmpl=../glow/tmpl/
//go:generate glow generate -out=./v3.1/gles2/ -api=gles2 -version=3.1 -xml=../glow/xml/ -tmpl=../glow/tmpl/
+//go:generate glow generate -out=./v3.0/gles2/ -api=gles2 -version=3.0 -xml=../glow/xml/ -tmpl=../glow/tmpl/
// This is an empty pseudo-package with the sole purpose of containing go generate directives
// that generate all gl binding packages inside this repository. | generate gles <I> (#<I>)
iOS devices only support gles <I> | go-gl_gl | train | go |
f8b0fdd04d5ad27d6eb1117054d54d084a739ec3 | diff --git a/tests/risk/writers_test.py b/tests/risk/writers_test.py
index <HASH>..<HASH> 100644
--- a/tests/risk/writers_test.py
+++ b/tests/risk/writers_test.py
@@ -36,8 +36,7 @@ class Point(object):
@property
def wkt(self):
- # dummy implementation, just for testing.
- return str(self.x) + str(self.y)
+ return "POINT(%s %s)" % (self.x, self.y)
class LossCurveXMLWriterTestCase(unittest.TestCase): | Updated .wkt test implementation | gem_oq-engine | train | py |
321a13a108f85530991bd5498018e5a7dee47d6e | diff --git a/invenio_records_rest/query.py b/invenio_records_rest/query.py
index <HASH>..<HASH> 100644
--- a/invenio_records_rest/query.py
+++ b/invenio_records_rest/query.py
@@ -44,7 +44,7 @@ def default_search_factory(self, search, query_parser=None):
exc_info=True)
raise InvalidQueryRESTError()
- search_index = search._index[0]
+ search_index = getattr(search, '_original_index', search._index)[0]
search, urlkwargs = default_facets_factory(search, search_index)
search, sortkwargs = default_sorter_factory(search, search_index)
for key, value in sortkwargs.items(): | query: fix facets and sort for prefixed indices | inveniosoftware_invenio-records-rest | train | py |
566d616963054faf1c5e01f7814bc537b3ceb38a | diff --git a/scope.js b/scope.js
index <HASH>..<HASH> 100644
--- a/scope.js
+++ b/scope.js
@@ -91,7 +91,8 @@ function authorize(action, restrictions, user) {
Scope.prototype.headers = function(res, list) {
if (list == null) list = [];
- else if (!Array.isArray(list)) list = [list];
+ else if (typeof list == "string") list = [list];
+ else if (typeof list == "object" && !Array.isArray(list)) list = Object.keys(list);
var cur = res.get(Scope.headerScope);
if (cur) cur = cur.split(',').map(function(str) {
return str.trim(); | scope.headers allows an object to get the list of keys | kapouer_upcache | train | js |
8213f9fd85e463c994538392e1eec89591ad6435 | diff --git a/dom-selection.js b/dom-selection.js
index <HASH>..<HASH> 100644
--- a/dom-selection.js
+++ b/dom-selection.js
@@ -241,6 +241,28 @@
return range.collapsed;
}
+ /**
+ * Force the Selection to include entire/expanded Words.
+ * @see http://stackoverflow.com/questions/7380190/select-whole-word-with-getselection
+ * @param {Selection} sel
+ */
+ function forceInclude(sel) {
+ sel = sel || win.getSelection();
+ if (isCollapsed(sel)) return;
+
+ var dir = ['forward', 'backward'];
+ isBackwards(sel) && dir.reverse();
+
+ // modify() works on the focus of the selection
+ sel.collapse(sel.anchorNode, sel.anchorOffset);
+
+ sel.modify('move', dir[0], 'character');
+ sel.modify('move', dir[1], 'word');
+ sel.extend(sel.focusNode, sel.focusOffset);
+ sel.modify('extend', dir[1], 'character');
+ sel.modify('extend', dir[0], 'word');
+ }
+
return {
getRange: getRange,
setRange: setRange,
@@ -253,9 +275,9 @@
collapseEnd: collapseEnd,
isWithin: isWithin,
forceWithin: forceWithin,
- // snapToWord: snapToWord,
expandToWord: expandToWord,
getCaretWord: getCaretWord,
+ forceInclude: forceInclude,
version: ver,
};
})); | add forceInclude func: snaps to entire word | lukeed_dom-selection | train | js |
6c800c64770d0b1e9f07f517c58f58460512fbf4 | diff --git a/reporter/kafka/kafka.go b/reporter/kafka/kafka.go
index <HASH>..<HASH> 100644
--- a/reporter/kafka/kafka.go
+++ b/reporter/kafka/kafka.go
@@ -51,7 +51,9 @@ func Logger(logger *log.Logger) ReporterOption {
}
}
-// Producer sets the producer used to produce to Kafka.
+// Producer sets the producer used to produce to Kafka. For tweaking
+// the reporting settings (e.g. reporting timeout or authentication)
+// check the sarama.Config struct.
func Producer(p sarama.AsyncProducer) ReporterOption {
return func(c *kafkaReporter) {
c.producer = p | docs(reporter/kafka): adds more information about tweaking the producer. (#<I>) | openzipkin_zipkin-go | train | go |
1ab780b4221d6b14b214a518261604c2930ea079 | diff --git a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessDefinitionRestServiceInteractionTest.java b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessDefinitionRestServiceInteractionTest.java
index <HASH>..<HASH> 100644
--- a/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessDefinitionRestServiceInteractionTest.java
+++ b/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/ProcessDefinitionRestServiceInteractionTest.java
@@ -2810,6 +2810,16 @@ public class ProcessDefinitionRestServiceInteractionTest extends AbstractRestSer
}
@Test
+ public void testSimpleProcessInstantiationWithoutBody_ByKey() {
+ given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY)
+ .contentType(POST_JSON_CONTENT_TYPE)
+ .then().expect()
+ .statusCode(Status.OK.getStatusCode())
+ .body("id", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))
+ .when().post(START_PROCESS_INSTANCE_BY_KEY_URL);
+ }
+
+ @Test
public void testProcessInstantiationWithParameters_ByKey() throws IOException {
Map<String, Object> parameters = VariablesBuilder.create()
.variable("aBoolean", Boolean.TRUE) | test(engine-rest): start a process instance on post with an empty body
related to #CAM-<I> | camunda_camunda-bpm-platform | train | java |
6736d4ef296b960b5157155515ef949a1c3524be | diff --git a/lib/renderer/web-view/web-view.js b/lib/renderer/web-view/web-view.js
index <HASH>..<HASH> 100644
--- a/lib/renderer/web-view/web-view.js
+++ b/lib/renderer/web-view/web-view.js
@@ -131,7 +131,7 @@ class WebViewImpl {
}
onElementResize () {
- const resizeEvent = new Event('resize', { bubbles: true })
+ const resizeEvent = new Event('resize')
resizeEvent.newWidth = this.webviewNode.clientWidth
resizeEvent.newHeight = this.webviewNode.clientHeight
this.dispatchEvent(resizeEvent) | fix: do not bubble up resize event from webview (#<I>) | electron_electron | train | js |
963cbfd275ad5932f849e41c6e1f4fbce0bc215e | diff --git a/influxql/ast.go b/influxql/ast.go
index <HASH>..<HASH> 100644
--- a/influxql/ast.go
+++ b/influxql/ast.go
@@ -4117,6 +4117,8 @@ func EvalType(expr Expr, sources Sources, typmap TypeMapper) DataType {
return Float
case *IntegerLiteral:
return Integer
+ case *UnsignedLiteral:
+ return Unsigned
case *StringLiteral:
return String
case *BooleanLiteral:
@@ -4124,13 +4126,7 @@ func EvalType(expr Expr, sources Sources, typmap TypeMapper) DataType {
case *BinaryExpr:
lhs := EvalType(expr.LHS, sources, typmap)
rhs := EvalType(expr.RHS, sources, typmap)
- if lhs != Unknown && rhs != Unknown {
- if lhs < rhs {
- return lhs
- } else {
- return rhs
- }
- } else if lhs != Unknown {
+ if rhs.LessThan(lhs) {
return lhs
} else {
return rhs | Update eval type for unsigned | influxdata_influxdb | train | go |
d6f2f6726a154784189cb3a8259c8fa31b465ae3 | diff --git a/src/lib/async-command.js b/src/lib/async-command.js
index <HASH>..<HASH> 100644
--- a/src/lib/async-command.js
+++ b/src/lib/async-command.js
@@ -1,5 +1,6 @@
-/* eslint-disable unicorn/no-process-exit */
+/* eslint-disable unicorn/no-process-exit */
+/* eslint-disable promise/prefer-await-to-then */
const done = (err, result) => {
return err ?
diff --git a/src/lib/which.js b/src/lib/which.js
index <HASH>..<HASH> 100644
--- a/src/lib/which.js
+++ b/src/lib/which.js
@@ -3,4 +3,7 @@ import which from 'which';
const pWhich = promisify(which);
-export default program => pWhich(program).then(res => Boolean(res));
+export default async program => {
+ const res = await pWhich(program);
+ return Boolean(res);
+}; | chore: fix async await missing | PolymerX_polymerx-cli | train | js,js |
d7de7a79c5a0c24373f90dcc569816c80501d456 | diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -652,7 +652,7 @@ module Rails
root = File.exist?("#{root_path}/#{flag}") ? root_path : default
raise "Could not find root path for #{self}" unless root
- File.realpath root
+ Pathname.new File.realpath root
end
def default_middleware_stack | I guess we have to return a pathname object. o_O | rails_rails | train | rb |
329b00861ce77d20dd5d78c9b6db31453a485820 | diff --git a/huawei_lte_api/api/User.py b/huawei_lte_api/api/User.py
index <HASH>..<HASH> 100644
--- a/huawei_lte_api/api/User.py
+++ b/huawei_lte_api/api/User.py
@@ -10,7 +10,8 @@ from huawei_lte_api.exceptions import ResponseErrorException, \
LoginErrorUsernamePasswordOverrunException, \
LoginErrorUsernamePasswordWrongException, \
LoginErrorUsernameWrongException, \
- LoginErrorPasswordWrongException
+ LoginErrorPasswordWrongException, \
+ ResponseErrorNotSupportedException
class User(ApiGroup):
@@ -71,7 +72,11 @@ class User(ApiGroup):
return result == ResponseEnum.OK.value
def login(self, force_new_login: bool=False) -> bool:
- state_login = self.state_login()
+ try:
+ state_login = self.state_login()
+ except ResponseErrorNotSupportedException:
+ return True
+
if LoginStateEnum(int(state_login['State'])) == LoginStateEnum.LOGGED_IN and not force_new_login:
return True | Add support for modems, without user login | Salamek_huawei-lte-api | train | py |
2833e051570a35c6f20d3e0873e0a8b6bdc1b9b9 | diff --git a/cursor.js b/cursor.js
index <HASH>..<HASH> 100644
--- a/cursor.js
+++ b/cursor.js
@@ -575,6 +575,12 @@ var nextFunction = function(self, callback) {
// Topology was destroyed, so don't try to wait for it to reconnect
return callback(new MongoError('Topology was destroyed'));
}
+
+ if (!self.s.topologyOptions.reconnect) {
+ // Reconnect is disabled, so we'll never reconnect
+ return callback(new MongoError('no connection available'));
+ }
+
return self.disconnectHandler.addObjectAndMethod(
'cursor',
self, | fix(cursor): avoid waiting for reconnect if reconnect disabled | mongodb_node-mongodb-native | train | js |
f11fa4cbfe9670c719d4b623c2039012a1739753 | diff --git a/src/components/treemenu/treemenu.js b/src/components/treemenu/treemenu.js
index <HASH>..<HASH> 100644
--- a/src/components/treemenu/treemenu.js
+++ b/src/components/treemenu/treemenu.js
@@ -1109,6 +1109,8 @@ var TreeMenu = Component.extend({
if(!useDataFiltered) {
var pointer = "_default";
if(allowedIDs.indexOf(this.model.marker[markerID].which) > -1) pointer = this.model.marker[markerID].which;
+ if(!indicatorsDB[pointer]) utils.error("Concept properties of " + pointer + " are missing from the set, or the set is empty. Put a breakpoint here and check what you have in indicatorsDB");
+
if(!indicatorsDB[pointer].scales) {
this.element.select('.' + css.scaletypes).classed(css.hidden, true);
return true; | Add diagnostic message for the common case, this should help #<I> | vizabi_vizabi | train | js |
f492c5db4fe4f9aa0175925d27f44fc65df7c620 | diff --git a/get-supported-locale.js b/get-supported-locale.js
index <HASH>..<HASH> 100644
--- a/get-supported-locale.js
+++ b/get-supported-locale.js
@@ -1,14 +1,14 @@
-const supportedLocales = ['en', 'de'];
+const supportedLanguages = ['en', 'de'];
// This function is reponsible of passing the fallback language "en"
// in case the given language is not supported by the application yet
-export function getSupportedLocale(locale) {
- return supportedLocales.includes(locale) ? locale : 'en';
+export function getSupportedLanguage(language) {
+ return supportedLanguages.includes(language) ? language : 'en';
}
-/* This function is needed in order to parse the locale + region that we allow in the user
-* settings. Because we only have messages for `en` and `de`, we need to always get just the
-* first part of the locale (`en-GB` would be `en`) so the app does not break.
+/* This function is needed in order to parse the locale (<language-code>-<country-code>) that we allow in the user
+* we allow in the user settings. Because we only have messages for `en` and `de`, we need to always get just the
+* first part of the locale, the language, (`en-GB` would be `en`) so the app does not break.
*/
export function extractLanguageFromLocale(locale) {
return locale.includes('-') ? locale.split('-')[0] : locale; | refactor(locale): rename variables and functions to be consistent with the difference between language vs locale | commercetools_merchant-center-application-kit | train | js |
c74ac9af92411a0a8d6037925fd1a2ef8dd6e89b | diff --git a/library/CM/RenderAdapter/Layout.php b/library/CM/RenderAdapter/Layout.php
index <HASH>..<HASH> 100644
--- a/library/CM/RenderAdapter/Layout.php
+++ b/library/CM/RenderAdapter/Layout.php
@@ -15,10 +15,10 @@ class CM_RenderAdapter_Layout extends CM_RenderAdapter_Abstract {
}
/**
- * @param CM_Site_Abstract $site
* @return string
*/
- public function fetch(CM_Site_Abstract $site) {
+ public function fetch() {
+ $site = $this->getRender()->getSite();
$page = $this->_getPage();
$layout = $page->getLayout($site);
diff --git a/library/CM/Response/Page.php b/library/CM/Response/Page.php
index <HASH>..<HASH> 100644
--- a/library/CM/Response/Page.php
+++ b/library/CM/Response/Page.php
@@ -84,7 +84,7 @@ class CM_Response_Page extends CM_Response_Abstract {
*/
protected function _renderPage(CM_Page_Abstract $page) {
$renderAdapterLayout = new CM_RenderAdapter_Layout($this->getRender(), $page);
- return $renderAdapterLayout->fetch($this->getSite());
+ return $renderAdapterLayout->fetch();
}
protected function _process() { | Do not pass site to layout->fetch, but use render's one | cargomedia_cm | train | php,php |
bfc83bd16a9dff813fa5dff0adfbc9ba1ea2c67e | diff --git a/commands/request.go b/commands/request.go
index <HASH>..<HASH> 100644
--- a/commands/request.go
+++ b/commands/request.go
@@ -62,7 +62,9 @@ type Request interface {
Options() optMap
SetOption(name string, val interface{})
Arguments() []interface{}
+ SetArguments([]interface{})
Files() File
+ SetFiles(File)
Context() *Context
SetContext(Context)
Command() *Command
@@ -147,10 +149,18 @@ func (r *request) Arguments() []interface{} {
return r.arguments
}
+func (r *request) SetArguments(args []interface{}) {
+ r.arguments = args
+}
+
func (r *request) Files() File {
return r.files
}
+func (r *request) SetFiles(f File) {
+ r.files = f
+}
+
func (r *request) Context() *Context {
return &r.ctx
} | commands: Added SetArguments/SetFiles to Request | ipfs_go-ipfs | train | go |
31f619a911b3dcf98bb7e206368c3e4b2bc43d7f | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -161,8 +161,7 @@ class Test::Unit::TestCase
update = options.delete(:update) || false
ruby_version = options.delete(:ruby_version) || (JRUBY_JARS_VERSION.to_s[0..0] == '9' ? 2.1 : 1.9)
multi_dex = options.has_key?(:multi_dex) ? options.delete(:multi_dex) :
- (standalone && !example && JRUBY_JARS_VERSION >= Gem::Version.new('9000.dev') &&
- ANDROID_TARGET >= 16)
+ (standalone && !example && ANDROID_TARGET >= 16)
raise "Unknown options: #{options.inspect}" unless options.empty?
raise 'Inclusion/exclusion of libs requires standalone mode.' if (included_stdlibs || excluded_stdlibs) && !standalone | * Turn on multi-dex for older JRuby versions also. | ruboto_ruboto | train | rb |
84d19640f6a75347b7ef1e1df7585c4bdb382900 | diff --git a/result.go b/result.go
index <HASH>..<HASH> 100644
--- a/result.go
+++ b/result.go
@@ -48,6 +48,7 @@ type (
Value() interface{}
SetDetails(ErrorDetails)
Details() ErrorDetails
+ String() string
}
// ResultErrorFields holds the fields for each ResultError implementation. | Add String() to ResultError interface | xeipuuv_gojsonschema | train | go |
33588ba8f10ae8ebe71542df595bf22b7a614dd1 | diff --git a/lib/unidom/visitor/version.rb b/lib/unidom/visitor/version.rb
index <HASH>..<HASH> 100644
--- a/lib/unidom/visitor/version.rb
+++ b/lib/unidom/visitor/version.rb
@@ -1,5 +1,5 @@
module Unidom
module Visitor
- VERSION = '1.9'.freeze
+ VERSION = '1.10'.freeze
end
end | 1, Migrate the version from <I> to <I>. | topbitdu_unidom-visitor | train | rb |
5b8a640ee21d698a6fc936bb6e0b885676624c8e | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -16,6 +16,7 @@ export type DotModel = {
uvCoordinates: number[],
normalCoordinates: number[],
numVerticesPerFace: number,
+ numCoordinatesPerVertex: number,
};
function parseIndices(streamReader: StreamReader): number[] { | Fix the exported `dotModel` flow type | PatriceVignola_load-dot-model | train | js |
0c24b46fcc31cceb8562890bfcd4e3e91945869d | diff --git a/core/src/main/java/com/digitalpebble/storm/crawler/persistence/StdOutStatusUpdater.java b/core/src/main/java/com/digitalpebble/storm/crawler/persistence/StdOutStatusUpdater.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/digitalpebble/storm/crawler/persistence/StdOutStatusUpdater.java
+++ b/core/src/main/java/com/digitalpebble/storm/crawler/persistence/StdOutStatusUpdater.java
@@ -18,13 +18,9 @@
package com.digitalpebble.storm.crawler.persistence;
import java.util.Date;
-import java.util.Map;
import com.digitalpebble.storm.crawler.Metadata;
-import backtype.storm.task.OutputCollector;
-import backtype.storm.task.TopologyContext;
-
/**
* Dummy status updater which dumps the content of the incoming tuples to the
* standard output. Useful for debugging and as an illustration of what
@@ -32,15 +28,6 @@ import backtype.storm.task.TopologyContext;
*/
@SuppressWarnings("serial")
public class StdOutStatusUpdater extends AbstractStatusUpdaterBolt {
- OutputCollector _collector;
-
- @SuppressWarnings("rawtypes")
- @Override
- public void prepare(Map conf, TopologyContext context,
- OutputCollector collector) {
- super.prepare(conf, context, collector);
- _collector = collector;
- }
@Override
public void store(String url, Status status, Metadata metadata, | StdOutStatusUpdater does not need collector | DigitalPebble_storm-crawler | train | java |
ecf934d85d8f4edce2506a05c2a5e61aa2261919 | diff --git a/src/Module.php b/src/Module.php
index <HASH>..<HASH> 100644
--- a/src/Module.php
+++ b/src/Module.php
@@ -447,9 +447,12 @@ class Module {
} else {
- if (!$deleteAll && $object === $slug . '.php') {
+ if (!$deleteAll) {
- continue;
+ if ($object == $slug.'.php' || $object == $slug.'.png') {
+
+ continue;
+ }
}
unlink($modulePath . App::DS . $object);
@@ -462,7 +465,7 @@ class Module {
$folder = array_pop($path);
- if ($folder === $slug) {
+ if ($folder === $slug || $folder === 'images') {
return true;
} | The module path was added to the getModulesInfo method | eliasis-framework_complement | train | php |
952969952b835896e69f842aee711a58dc14a379 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,7 @@
from distutils.core import setup
+version = '1.0.2'
+
# If sphinx is installed, enable the command
try:
from sphinx.setup_command import BuildDoc
@@ -14,8 +16,6 @@ except ImportError:
cmdclass = {}
command_options = {}
-version = '1.0.2'
-
setup(name='simplemediawiki',
version=version,
description='Extremely low-level wrapper to the MediaWiki API', | Make sphinx building actually work | iliana_python-simplemediawiki | train | py |
8d1474aa0022eac51928ae514c1b8e6cc207f7df | diff --git a/charmhelpers/core/host_factory/ubuntu.py b/charmhelpers/core/host_factory/ubuntu.py
index <HASH>..<HASH> 100644
--- a/charmhelpers/core/host_factory/ubuntu.py
+++ b/charmhelpers/core/host_factory/ubuntu.py
@@ -28,6 +28,7 @@ UBUNTU_RELEASES = (
'focal',
'groovy',
'hirsute',
+ 'impish',
) | Add impish to the list of Ubuntu releases. | juju_charm-helpers | train | py |
5cfe5cf1cfa99a83c3610b0a2fcd1c252aea7769 | diff --git a/lib/ronin/engine/class_methods.rb b/lib/ronin/engine/class_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/engine/class_methods.rb
+++ b/lib/ronin/engine/class_methods.rb
@@ -45,7 +45,7 @@ module Ronin
# @since 0.4.0
#
def load_all(options={})
- return custom_query(options).all(options).each do |resource|
+ return custom_query(options).each do |resource|
resource.load_original!
end
end
@@ -74,7 +74,7 @@ module Ronin
# @since 0.4.0
#
def load_first(options={})
- if (resource = custom_query(options).first(options))
+ if (resource = custom_query(options).first)
resource.load_original!
end
@@ -125,7 +125,7 @@ module Ronin
query = query.licensed_under(options.delete(:license))
end
- return query
+ return query.all(options)
end
end
end | Add any extra options into the query returned by Engine::ClassMethods#custom_query. | ronin-ruby_ronin | train | rb |
82b6e303cf6bcc76f16c7e7d6456b9ebe4069be4 | diff --git a/src/tinymce.js b/src/tinymce.js
index <HASH>..<HASH> 100644
--- a/src/tinymce.js
+++ b/src/tinymce.js
@@ -7,8 +7,8 @@ angular.module('ui.tinymce', [])
uiTinymceConfig = uiTinymceConfig || {};
var generatedIds = 0;
return {
+ priority: 10,
require: 'ngModel',
- priority: 1,
link: function (scope, elm, attrs, ngModel) {
var expression, options, tinyInstance,
updateView = function () { | adding priority for ngmodel re-rendering's sake
Remove old priority to give users more control over priority order | angular-ui_ui-tinymce | train | js |
8b5b0e6d9c882271bde2413d95f23a38d7c7730f | diff --git a/lib/io.js b/lib/io.js
index <HASH>..<HASH> 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -52,6 +52,7 @@ function RajaServer(opts) {
io.to('*').to(msg.url).emit('message', msg);
});
socket.on('join', function(msg) {
+ if (msg.mtime) socket.joinArgs = msg.mtime;
socket.join(msg.room, function(err) {
if (err) console.error(err)
}); | Will pass some option mtime to backlog adapter | kapouer_raja | train | js |
c592ab44478c6ee97325503f34bf405a430a0a9d | diff --git a/controllers/components/uploader.php b/controllers/components/uploader.php
index <HASH>..<HASH> 100644
--- a/controllers/components/uploader.php
+++ b/controllers/components/uploader.php
@@ -964,16 +964,14 @@ class UploaderComponent extends Object {
foreach ($mimes as $mimeExt => $mimeType) {
if (($currType == $mimeType) || (is_array($mimeType) && in_array($currType, $mimeType))) {
$validMime = true;
- break;
+ break 2;
}
}
-
- if ($validExt === true && $validMime === true) {
- $this->__data[$this->__current]['group'] = $grouping;
- }
}
-
- if (($validExt === false) || ($validMime === false)) {
+
+ if ($validExt === true && $validMime === true) {
+ $this->__data[$this->__current]['group'] = $grouping;
+ } else {
return false;
} | Uploaded file associated with incorrect mimetype group. | milesj_uploader | train | php |
30a93524e5a70f2882fac7d8cf2c061e97b50981 | diff --git a/Classes/TypoScript/Condition/CoreVersionCondition.php b/Classes/TypoScript/Condition/CoreVersionCondition.php
index <HASH>..<HASH> 100644
--- a/Classes/TypoScript/Condition/CoreVersionCondition.php
+++ b/Classes/TypoScript/Condition/CoreVersionCondition.php
@@ -62,7 +62,8 @@ class CoreVersionCondition extends AbstractCondition
protected function compareNumber($test, $leftValue)
{
if (preg_match('/^(!?=+|<=?|>=?)\\s*([^\\s]*)\\s*$/', $test, $matches)) {
- list($operator, $rightValue) = $matches;
+ $operator = $matches[1];
+ $rightValue = $matches[2];
switch ($operator) {
case '>=':
return $leftValue >= VersionNumberUtility::convertVersionNumberToInteger($rightValue); | [BUGFIX] Ensure condition matching assigns correct matches | benjaminkott_bootstrap_package | train | php |
3dcf0aada09c7bab924974fad6c9f5d3a37bc8d3 | diff --git a/giddy/directional.py b/giddy/directional.py
index <HASH>..<HASH> 100644
--- a/giddy/directional.py
+++ b/giddy/directional.py
@@ -387,6 +387,7 @@ class Rose(object):
except ImportError:
warnings.warn('This method relies on importing `splot` in future',
DeprecationWarning)
+ use_splot = False
if use_splot:
fig, ax = splot.giddy.dynamic_lisa_rose(self, attribute=attribute,
@@ -420,7 +421,7 @@ class Rose(object):
plt.xlim(xlim)
plt.ylim(ylim)
- def plot_vectors(self, arrows=True): # TODO add attribute option to color vectors
+ def plot_vectors(self, arrows=True):
"""
Plot vectors of positional transition of LISA values
witin quadrant in scatterplot in a polar plot.
@@ -485,6 +486,7 @@ class Rose(object):
except ImportError:
warnings.warn('This method relies on importing `splot` in future',
DeprecationWarning)
+ use_splot = False
if use_splot:
fig, ax = splot.giddy.dynamic_lisa_vectors(self, arrows=arrows) | add `use_splot = False` to run old `.plot()` method | pysal_giddy | train | py |
59e9bf518ea84750947cf4b7cf689540249aa83e | diff --git a/src/Http/Controllers/AdminController.php b/src/Http/Controllers/AdminController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/AdminController.php
+++ b/src/Http/Controllers/AdminController.php
@@ -83,6 +83,7 @@ class AdminController extends BaseAdminController
$data['parent_id'] = $data['parent_id'] ?: null;
$this->repository->update($page->id, $data);
event('page.resetChildrenUri', [$page]);
+ Menulinks::forgetCache();
return $this->redirect($request, $page);
} | Menulinks::forgetCache | TypiCMS_Pages | train | php |
df45bb03d3904055c9d0156c10e9b125cf3a65d8 | diff --git a/tests/guinea-pigs/pytest/xfail_test.py b/tests/guinea-pigs/pytest/xfail_test.py
index <HASH>..<HASH> 100644
--- a/tests/guinea-pigs/pytest/xfail_test.py
+++ b/tests/guinea-pigs/pytest/xfail_test.py
@@ -1,7 +1,7 @@
import pytest
[email protected]("True", reason="xfail reason")
[email protected]("True", reason="xfail reason", strict=True)
def test_unexpectedly_passing():
pass | fix xfail in tests | JetBrains_teamcity-messages | train | py |
492e3b70f106941abf2cda628a4eab3cc052d617 | diff --git a/src/Base/AbstractController.php b/src/Base/AbstractController.php
index <HASH>..<HASH> 100644
--- a/src/Base/AbstractController.php
+++ b/src/Base/AbstractController.php
@@ -155,13 +155,25 @@ abstract class AbstractController implements ControllerInterface
}
$this->myActionName = $action;
+ $result = $this->myInvokeActionMethod($actionMethod, $parameters);
+ return true;
+ }
+
+ /**
+ * Invoke action method.
+ *
+ * @param \ReflectionMethod $actionMethod The action method.
+ * @param array $parameters The parameters.
+ *
+ * @return mixed|null The result.
+ */
+ private function myInvokeActionMethod(\ReflectionMethod $actionMethod, array $parameters)
+ {
// Handle pre-action event.
$preActionResult = $this->onPreActionEvent();
if ($preActionResult !== null) {
- $result = $preActionResult;
-
- return true;
+ return $preActionResult;
}
// Handle action method.
@@ -170,12 +182,10 @@ abstract class AbstractController implements ControllerInterface
// Handle post-action event.
$postActionResult = $this->onPostActionEvent();
if ($postActionResult !== null) {
- $result = $postActionResult;
-
- return true;
+ return $postActionResult;
}
- return true;
+ return $result;
}
/** | Refactor action method invocation in AbstractController class | themichaelhall_bluemvc-core | train | php |
6261cc26693fa1697bcbbd671f18f4902bef07bc | diff --git a/src/Symfony/Framework/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Framework/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php
+++ b/src/Symfony/Framework/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php
@@ -45,11 +45,11 @@ The above would generate entity classes for all bundles.
You can also optionally limit generation to entities within an individual bundle:
- <info>./symfony doctrine:generate:entities --bundle="Bundle\MyCustomBundle"</info>
+ <info>./symfony doctrine:generate:entities --bundle="Bundle/MyCustomBundle"</info>
Alternatively, you can limit generation to a single entity within a bundle:
- <info>./symfony doctrine:generate:entities --bundle="Bundle\MyCustomBundle" --entity="User"</info>
+ <info>./symfony doctrine:generate:entities --bundle="Bundle/MyCustomBundle" --entity="User"</info>
EOT
);
} | Fixed bad examples in doctrine:generate:entities help output. | symfony_symfony | train | php |
28d2fcf5215c069e380193e84b8492186d069854 | diff --git a/src/org/parboiled/MatcherContext.java b/src/org/parboiled/MatcherContext.java
index <HASH>..<HASH> 100644
--- a/src/org/parboiled/MatcherContext.java
+++ b/src/org/parboiled/MatcherContext.java
@@ -21,11 +21,10 @@ import org.parboiled.common.ImmutableList;
import org.parboiled.common.Preconditions;
import org.parboiled.matchers.*;
import org.parboiled.support.*;
-import static org.parboiled.support.ParseTreeUtils.findNodeByPath;
import static org.parboiled.support.ParseTreeUtils.findNode;
+import static org.parboiled.support.ParseTreeUtils.findNodeByPath;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
/**
@@ -120,7 +119,7 @@ public class MatcherContext<V> implements Context<V> {
@NotNull
public List<ParseError> getParseErrors() {
- return Collections.unmodifiableList(invariables.parseErrors);
+ return invariables.parseErrors;
}
@NotNull | Enabled writing access to list of parse error returned by Context.getParseErrors() | sirthias_parboiled | train | java |
e81b2390ddaca8b003691ec2df33337aec70e3db | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100755
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -45,7 +45,7 @@ module.exports = function(grunt) {
tasks: ['jshint:theme', 'concat:js', 'uglify:js', 'assets_version']
},
less: {
- files: 'less/*.less',
+ files: 'less/**/*.less',
tasks: ['less', 'assets_version']
},
}, | WATCH ALL THE LESS FILES! | sitecrafting_groot | train | js |
7237fa67f82693326a8017bf06893e4f3a63c53e | diff --git a/lib/avocado/example.rb b/lib/avocado/example.rb
index <HASH>..<HASH> 100644
--- a/lib/avocado/example.rb
+++ b/lib/avocado/example.rb
@@ -16,8 +16,9 @@ module Avocado
protected
def resource_name_from_url(path, method)
- Rails.application.routes.recognize_path(path, method: method)[:controller].
- partition('/').last.titleize.split('/').last
+ controller = Rails.application.routes.recognize_path(path, method: method)[:controller]
+ name = controller.partition('/').reject(&:blank?).last
+ name.titleize.split('/').last
rescue ActionController::RoutingError
nil
end
diff --git a/lib/avocado/rspec.rb b/lib/avocado/rspec.rb
index <HASH>..<HASH> 100644
--- a/lib/avocado/rspec.rb
+++ b/lib/avocado/rspec.rb
@@ -2,8 +2,15 @@ require 'avocado'
require 'avocado/rspec/spec'
require 'rack/test'
+module AvocadoHelper
+ def app
+ Rails.application
+ end
+end
+
RSpec.configure do |config|
+ config.include AvocadoHelper
config.include Rack::Test::Methods
config.after(:each) do | RSpec will be able to parse the name even if the controller name doesn't have a slash (for non-namespaced APIs) | metova_avocado | train | rb,rb |
4697d051bf6ea8ec3e16a9d54be7545bb7952172 | diff --git a/Demo_Img_Viewer.py b/Demo_Img_Viewer.py
index <HASH>..<HASH> 100644
--- a/Demo_Img_Viewer.py
+++ b/Demo_Img_Viewer.py
@@ -71,7 +71,7 @@ file_num_display_elem = sg.Text('File 1 of {}'.format(num_files), size=(15,1))
col = [[filename_display_elem],
[image_elem]]
-col_files = [[sg.Listbox(values = fnames, select_submits=True, size=(60,30), key='listbox')],
+col_files = [[sg.Listbox(values = fnames, change_submits=True, size=(60, 30), key='listbox')],
[sg.ReadFormButton('Next', size=(8,2)), sg.ReadFormButton('Prev',
size=(8,2)), file_num_display_elem]]
@@ -111,3 +111,5 @@ while True:
filename_display_elem.Update(filename)
# update page display
file_num_display_elem.Update('File {} of {}'.format(i+1, num_files))
+
+ | changed select_submits to change_submits | PySimpleGUI_PySimpleGUI | train | py |
e46465d4171f681774301d187ad614a6b32ce708 | diff --git a/scripts/get-latest-platform-tests.js b/scripts/get-latest-platform-tests.js
index <HASH>..<HASH> 100644
--- a/scripts/get-latest-platform-tests.js
+++ b/scripts/get-latest-platform-tests.js
@@ -14,7 +14,7 @@ const request = require("request");
// 1. Go to https://github.com/w3c/web-platform-tests/tree/master/url
// 2. Press "y" on your keyboard to get a permalink
// 3. Copy the commit hash
-const commitHash = "e8aa61d80e3971489ace4355ee970d30c09b615e";
+const commitHash = "5de931eafc9ca8d6de6a138015311812943755ac";
const sourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/urltestdata.json`;
const setterSourceURL = `https://raw.githubusercontent.com/w3c/web-platform-tests/${commitHash}/url/setters_tests.json`; | Update to include the latest web platform tests
Includes <URL> | jsdom_whatwg-url | train | js |
fa1ce31d24e357f3687f9ccf0a21d76fd1a36dab | 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
@@ -93,7 +93,7 @@ module Minitest
def assert_tick(actual_duration, clock)
first = clock.tick
second = clock.tick
- assert_equal second, first + actual_duration
+ assert_equal second.change(usec: 0), (first + actual_duration).change(usec: 0)
end
end
end | Ensure clock tick spec matcher zeros out microseconds | rossta_montrose | train | rb |
68aaffac8d57e5c75b8ae8299b622c0765c63049 | diff --git a/config/sub/TwigViewsConfig.php b/config/sub/TwigViewsConfig.php
index <HASH>..<HASH> 100644
--- a/config/sub/TwigViewsConfig.php
+++ b/config/sub/TwigViewsConfig.php
@@ -3,14 +3,14 @@
namespace config\sub;
use Valkyrja\Config\Sub\TwigViewsConfig as ValkyrjaTwigViewsConfig;
-use Valkyrja\Application;
+use Valkyrja\Contracts\Application;
class TwigViewsConfig extends ValkyrjaTwigViewsConfig
{
/**
* TwigViewsConfig constructor.
*
- * @param \Valkyrja\Application $app
+ * @param \Valkyrja\Contracts\Application $app
*/
public function __construct(Application $app)
{
diff --git a/config/sub/ViewsConfig.php b/config/sub/ViewsConfig.php
index <HASH>..<HASH> 100644
--- a/config/sub/ViewsConfig.php
+++ b/config/sub/ViewsConfig.php
@@ -15,5 +15,7 @@ class ViewsConfig extends ValkyrjaViewsConfig
public function __construct(Application $app)
{
parent::__construct($app);
+
+ $this->twig = new TwigViewsConfig($app);
}
} | Fixing twig override in views config. | valkyrjaio_valkyrja | train | php,php |
9012b11101805c9810745f049363223f110bc93e | diff --git a/caravel/views.py b/caravel/views.py
index <HASH>..<HASH> 100755
--- a/caravel/views.py
+++ b/caravel/views.py
@@ -27,6 +27,7 @@ from flask_appbuilder.models.sqla.filters import BaseFilter
from sqlalchemy import create_engine
from werkzeug.routing import BaseConverter
+from werkzeug.datastructures import ImmutableMultiDict
from wtforms.validators import ValidationError
import caravel | add ImmutableMultiDict back to views.py (#<I>) | apache_incubator-superset | train | py |
c40b9753542ab8a3cce8bd949a3dea67b5a38b70 | diff --git a/user.go b/user.go
index <HASH>..<HASH> 100644
--- a/user.go
+++ b/user.go
@@ -1,7 +1,5 @@
package discordgo
-import "fmt"
-
// A User stores all data for an individual Discord user.
type User struct {
ID string `json:"id"`
@@ -17,10 +15,10 @@ type User struct {
// String returns a unique identifier of the form username#discriminator
func (u *User) String() string {
- return fmt.Sprintf("%s#%s", u.Username, u.Discriminator)
+ return u.Username + "#" + u.Discriminator
}
// Mention return a string which mentions the user
func (u *User) Mention() string {
- return fmt.Sprintf("<@%s>", u.ID)
+ return "<@" + u.ID + ">"
} | STOP USING PRINTF PLS | bwmarrin_discordgo | train | go |
ef4ccbfbfa30b0286e22ecf8713ea3ef6aadcb68 | diff --git a/pygubu/builder.py b/pygubu/builder.py
index <HASH>..<HASH> 100644
--- a/pygubu/builder.py
+++ b/pygubu/builder.py
@@ -61,7 +61,7 @@ class BuilderObject:
def __init__(self, builder, wdescr):
self.builder = builder
- self.objetid = wdescr['id']
+ self.objectid = wdescr['id']
self.descr = wdescr
self.properties = wdescr.get('properties', {})
self.layout_properties = wdescr.get('layout', {}) | Fix typo causing bug on menuitems. | alejandroautalan_pygubu | train | py |
e60ff975ca36547de2762408abb6024fa1cc40ff | diff --git a/src/main/java/org/jfrog/hudson/pipeline/common/executors/GradleExecutor.java b/src/main/java/org/jfrog/hudson/pipeline/common/executors/GradleExecutor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jfrog/hudson/pipeline/common/executors/GradleExecutor.java
+++ b/src/main/java/org/jfrog/hudson/pipeline/common/executors/GradleExecutor.java
@@ -74,7 +74,7 @@ public class GradleExecutor implements Executor {
org.jfrog.build.api.Build generatedBuild = Utils.getGeneratedBuildInfo(build, listener, launcher, generatedBuildPath);
// Add action only if artifacts were actually deployed and the build info was generated.
// The build info gets generated only after running the "artifactoryPublish" task.
- if (deployer.isDeployArtifacts() && CollectionUtils.isNotEmpty(generatedBuild.getModules())) {
+ if (deployer.isDeployArtifacts() && !deployer.isEmpty() && CollectionUtils.isNotEmpty(generatedBuild.getModules())) {
addDeployedArtifactsActionFromModules(this.build, deployer.getArtifactoryServer().getArtifactoryUrl(), generatedBuild.getModules(), DeployDetails.PackageType.GRADLE);
}
buildInfo.append(generatedBuild); | Bugfix - NPE in Gradle jobs when deployer is empty (#<I>) | jenkinsci_artifactory-plugin | train | java |
1f129823c8b206c948b14b517362ef95b376b38f | diff --git a/server/src/main/java/org/jboss/as/server/operations/DumpServicesHandler.java b/server/src/main/java/org/jboss/as/server/operations/DumpServicesHandler.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/jboss/as/server/operations/DumpServicesHandler.java
+++ b/server/src/main/java/org/jboss/as/server/operations/DumpServicesHandler.java
@@ -54,7 +54,7 @@ public class DumpServicesHandler implements OperationStepHandler, DescriptionPro
context.addStep(new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
- ServiceController<?> service = context.getServiceRegistry(true).getRequiredService(Services.JBOSS_AS);
+ ServiceController<?> service = context.getServiceRegistry(false).getRequiredService(Services.JBOSS_AS);
ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream print = new PrintStream(out);
service.getServiceContainer().dumpServices(print); | DumpServicesHandler doesn't need the controller lock
was: 4f4b<I>f7cd<I>e<I>af<I>b6f<I>a<I>bd | wildfly_wildfly-core | train | java |
49a6035096a5562553296acb1be5b02467b77c27 | diff --git a/test/associated-model.js b/test/associated-model.js
index <HASH>..<HASH> 100644
--- a/test/associated-model.js
+++ b/test/associated-model.js
@@ -1150,7 +1150,9 @@ $(document).ready(function () {
{
type:Backbone.One,
key:'type',
- relatedModel:FieldInputType,
+ relatedModel:function () {
+ return FieldInputType;
+ },
map:function (id) {
return store.findWhere({type:id});
} | Update a test case to use both map and function for `relatedModel` | dhruvaray_backbone-associations | train | js |
401155865b13b3daedcc95a67c78197dbb965ead | diff --git a/Connection.php b/Connection.php
index <HASH>..<HASH> 100755
--- a/Connection.php
+++ b/Connection.php
@@ -504,7 +504,7 @@ class Connection implements ConnectionInterface
}
$this->recordsHaveBeenModified(
- $change = ($this->getPdo()->exec($query) === false ? false : true)
+ $change = $this->getPdo()->exec($query) !== false
);
return $change; | [<I>] Unnecessary ternary expression (#<I>) | illuminate_database | train | php |
eaa92114888733678f02c40b572201f971423732 | diff --git a/lib/util/data-server.js b/lib/util/data-server.js
index <HASH>..<HASH> 100644
--- a/lib/util/data-server.js
+++ b/lib/util/data-server.js
@@ -154,30 +154,16 @@ function getFrames(curReqId, lastFrameId) {
}
var result = [];
var count = 16;
- var len = frames.length;
- var i, frame;
- if (!lastFrameId) {
- for (i = 0; i < len; i++) {
- frame = frames[i];
- if (frame.reqId === curReqId) {
- result.push(decodeData(frame));
- if (--count <= 0) {
- return result;
- }
- }
- }
- return result;
- }
- for (i = len - 1; i >= 0; i--) {
- frame = frames[i];
- if (frame.reqId === curReqId && frame.frameId > lastFrameId) {
+ for (var i = 0, len = frames.length; i < len; i++) {
+ var frame = frames[i];
+ if (frame.reqId === curReqId && (lastFrameId ? frame.frameId > lastFrameId : count > 0)) {
result.push(decodeData(frame));
if (--count <= 0) {
break;
}
}
}
- return result.reverse();
+ return result;
}
function getLastFrameId(curReqId) { | fix: loss frames when open for first time | avwo_whistle | train | js |
53571578d3ce8062d4b8cbfc5445b3679942df29 | diff --git a/djsupervisor/config.py b/djsupervisor/config.py
index <HASH>..<HASH> 100644
--- a/djsupervisor/config.py
+++ b/djsupervisor/config.py
@@ -274,6 +274,7 @@ def rerender_options(options):
"""
args = []
for name,value in options.iteritems():
+ name = name.replace("_","-")
if value is None:
pass
elif isinstance(value,bool): | Fix rerender_options to turn "project_dir" into "--project-dir" | rfk_django-supervisor | train | py |
5645c79c31379d589dcdba12aeded9da6997a242 | diff --git a/framework/core/js/admin/Gulpfile.js b/framework/core/js/admin/Gulpfile.js
index <HASH>..<HASH> 100644
--- a/framework/core/js/admin/Gulpfile.js
+++ b/framework/core/js/admin/Gulpfile.js
@@ -29,6 +29,5 @@ gulp({
'../lib/**/*.js'
]
},
- externalHelpers: true,
outputFile: 'dist/app.js'
});
diff --git a/framework/core/js/forum/Gulpfile.js b/framework/core/js/forum/Gulpfile.js
index <HASH>..<HASH> 100644
--- a/framework/core/js/forum/Gulpfile.js
+++ b/framework/core/js/forum/Gulpfile.js
@@ -33,6 +33,5 @@ gulp({
'../lib/**/*.js'
]
},
- externalHelpers: true,
outputFile: 'dist/app.js'
}); | External helpers are included by default now | flarum_core | train | js,js |
009ea69451df6b0f4cabc7070f8da011ffd47296 | diff --git a/lib/fitgem/body_measurements.rb b/lib/fitgem/body_measurements.rb
index <HASH>..<HASH> 100644
--- a/lib/fitgem/body_measurements.rb
+++ b/lib/fitgem/body_measurements.rb
@@ -1,7 +1,7 @@
module Fitgem
class Client
# ==========================================
- # Body Measurements Update Methods
+ # Body Measurements Methods
# ==========================================
# Get the body measurements logged on a specified date | These aren't actually update methods, they're retrieval methods. | whazzmaster_fitgem | train | rb |
8b87fb6d9266f6397e391bf23642d57ecce23244 | diff --git a/mri_meta_extract/dicom_import.py b/mri_meta_extract/dicom_import.py
index <HASH>..<HASH> 100644
--- a/mri_meta_extract/dicom_import.py
+++ b/mri_meta_extract/dicom_import.py
@@ -29,7 +29,7 @@ conn = None
# FUNCTIONS - DICOM
##########################################################################
-def dicom2db(folder, files_pattern='/**/MR.*', db_url=None):
+def dicom2db(folder, files_pattern='**/MR.*', db_url=None):
"""
Extract some meta-data from DICOM files and store them into a DB
:param folder: root folder
@@ -72,7 +72,7 @@ def dicom2db(folder, files_pattern='/**/MR.*', db_url=None):
conn.close()
-def visit_info(folder, files_pattern='/**/MR.*', db_url=None):
+def visit_info(folder, files_pattern='**/MR.*', db_url=None):
"""
Get visit meta-data from DICOM files (participant ID and scan date)
:param folder: root folder | fix files_pattern for dicom (same fix was previously done for nifti) | LREN-CHUV_data-tracking | train | py |
7d03fae6d816556e5830addd80820866485f3e3f | diff --git a/lib/browser/index.js b/lib/browser/index.js
index <HASH>..<HASH> 100644
--- a/lib/browser/index.js
+++ b/lib/browser/index.js
@@ -105,6 +105,7 @@ exports.browserAugmentation = function(dom) {
for (var i in element.style) {
if (!styleIgnore[i]) {
var use = true;
+ //sys.puts('Style: ' + i + ' :: ' + element.style[i] );
if (i === 'position' && element.style[i] === 'static') {
use = false;
}
@@ -112,7 +113,6 @@ exports.browserAugmentation = function(dom) {
use = false;
}
if (use) {
- //sys.puts('Style: ' + i + ' :: ' + element.style[i] );
styleAttrs.push(i + ': ' + element.style[i]);
}
} | Removed a sys call | jsdom_jsdom | train | js |
40802abfab681ff10986781d2f9323b74f30f1cd | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -257,7 +257,7 @@ module.exports = function(Sequelize) {
var tableName = defineOptions.freezeTableName ? modelName : (Utils.pluralize(modelName1) + Utils.pluralize(defineOptions.camelThrough ? Utils.uppercaseFirst(modelName2) : modelName2));
var throughOptions = {tableName: tableName, labels: false};
- _.defaultNoUndef(throughOptions, 'skipFields', options.skipFields, defineOptions.skipFieldsOnThrough);
+ utils.defaultNoUndef(throughOptions, 'skipFields', options.skipFields, defineOptions.skipFieldsOnThrough);
options.through = defineOne(modelName, {fields: fields, options: throughOptions});
} | Bug fix - refactor skipFields option code | overlookmotel_sequelize-definer | train | js |
46655b62367d1eaf6d52ca2d4efa9697c2b75689 | diff --git a/loompy/loompy.py b/loompy/loompy.py
index <HASH>..<HASH> 100644
--- a/loompy/loompy.py
+++ b/loompy/loompy.py
@@ -417,7 +417,7 @@ class LoomConnection:
# Add the columns layerwise
for key in self.layer.keys():
self.layer[key].resize(n_cols, axis=1)
- self.layer[key][:, self.shape[1]:n_cols] = submatrix[key].astype(self.layer[key].dtype)
+ self.layer[key][:, self.shape[1]:n_cols] = submatrix_dict[key].astype(self.layer[key].dtype)
self._file.flush()
def add_loom(self, other_file: str, key: str = None, fill_values: Dict[str, np.ndarray] = None) -> None: | bug in layer-handling during add_columns | linnarsson-lab_loompy | train | py |
39a799a463c25867ad83593290c9d3abd0cddbf8 | diff --git a/materializecssform/templatetags/materializecss.py b/materializecssform/templatetags/materializecss.py
index <HASH>..<HASH> 100644
--- a/materializecssform/templatetags/materializecss.py
+++ b/materializecssform/templatetags/materializecss.py
@@ -34,7 +34,7 @@ def render(element, markup_classes):
if element_type == 'boundfield':
add_input_classes(element)
template = get_template("materializecssform/field.html")
- context = Context({'field': element, 'classes': markup_classes})
+ context = {'field': element, 'classes': markup_classes}
else:
has_management = getattr(element, 'management_form', None)
if has_management:
@@ -43,13 +43,13 @@ def render(element, markup_classes):
add_input_classes(field)
template = get_template("materializecssform/formset.html")
- context = Context({'formset': element, 'classes': markup_classes})
+ context = {'formset': element, 'classes': markup_classes}
else:
for field in element.visible_fields():
add_input_classes(field)
template = get_template("materializecssform/form.html")
- context = Context({'form': element, 'classes': markup_classes})
+ context = {'form': element, 'classes': markup_classes}
return template.render(context) | Replace Context to dict for Django <I> compatibility | kalwalkden_django-materializecss-form | train | py |
03a118fe8482b256c531403c95d005f34a56b1fa | diff --git a/slack-api-client/src/test/java/util/sample_json_generation/JsonDataRecorder.java b/slack-api-client/src/test/java/util/sample_json_generation/JsonDataRecorder.java
index <HASH>..<HASH> 100644
--- a/slack-api-client/src/test/java/util/sample_json_generation/JsonDataRecorder.java
+++ b/slack-api-client/src/test/java/util/sample_json_generation/JsonDataRecorder.java
@@ -117,8 +117,11 @@ public class JsonDataRecorder {
existingSampleJson = Files.readAllLines(jsonFilePath, UTF_8).stream().collect(Collectors.joining());
} catch (NoSuchFileException e) {
}
+ if (existingSampleJson == null) {
+ existingSampleJson = "{}";
+ }
JsonObject mergedJsonObj = rawJsonObj;
- if (existingSampleJson != null || existingSampleJson.trim().isEmpty()) {
+ if (existingSampleJson.trim().isEmpty()) {
JsonElement existingSampleJsonElem = JsonParser.parseString(existingSampleJson);
JsonObject sampleJsonObj = existingSampleJsonElem.isJsonObject() ? existingSampleJsonElem.getAsJsonObject() : null;
if (sampleJsonObj != null && sampleJsonObj.isJsonObject()) { | Fix a bug in the sample JSON generator | seratch_jslack | train | java |
82b946078040525a0cd57ab61728509e29ce2589 | diff --git a/src/js/TextFields/TextField.js b/src/js/TextFields/TextField.js
index <HASH>..<HASH> 100644
--- a/src/js/TextFields/TextField.js
+++ b/src/js/TextFields/TextField.js
@@ -53,7 +53,6 @@ export default class TextField extends Component {
static defaultProps = {
type: 'text',
- defaultValue: '',
floatingLabel: true,
lineDirection: 'left',
}; | Removed defaultValue from text field for react-<I> happiness | mlaursen_react-md | train | js |
99e40eb6324d29c9f1ff7e61c26792ff69c067d4 | diff --git a/code/KickAssets.php b/code/KickAssets.php
index <HASH>..<HASH> 100644
--- a/code/KickAssets.php
+++ b/code/KickAssets.php
@@ -433,7 +433,7 @@ class KickAssets extends LeftAndMain {
$types = explode(',',$r->getVar('allowedTypes'));
return Convert::array2json(array(
- 'baseRoute' => $this->Link(),
+ 'baseRoute' => Controller::join_links(Director::baseURL(), $this->Link()),
'maxFilesize' => FileAttachmentField::get_filesize_from_ini(),
'allowedExtensions' => implode(',', $exts),
'thumbnailsDir' => DROPZONE_DIR.'/images/file-icons', | Fix for issue #<I>
Prefix baseRoute with baseURL to resolve issue #<I> | unclecheese_silverstripe-kickassets | train | php |
d910a59dbd4298b9c9d7129856925050ac49fb7e | diff --git a/lib/futures_pipeline/client.rb b/lib/futures_pipeline/client.rb
index <HASH>..<HASH> 100644
--- a/lib/futures_pipeline/client.rb
+++ b/lib/futures_pipeline/client.rb
@@ -18,6 +18,14 @@ module FuturesPipeline
get("/api/v1/careers.json", options)
end
+ # Get a single career using O*NET code.
+ #
+ # @param onet_soc_code [String] The O*NET code
+ # @param options [Hash] A customizable set of options.
+ # @return [Hashie::Mash]
+ # @example
+ # @client = FuturesPipeline.new
+ # @client.career("11-1011.00")
def career(onet_soc_code, options={})
api_safe_onet_soc_code = onet_soc_code.tr(".", "-")
get("/api/v1/careers/#{api_safe_onet_soc_code}.json", options) | Added documenntation for career method | codeforamerica_futures_pipeline | train | rb |
17a9ad16e9ba13c68cde26a732204d44e63c1146 | diff --git a/lib/puppet.rb b/lib/puppet.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -23,7 +23,7 @@ require 'puppet/util/suidmanager'
# it's also a place to find top-level commands like 'debug'
module Puppet
- PUPPETVERSION = '0.25.5'
+ PUPPETVERSION = '2.6.0'
def Puppet.version
return PUPPETVERSION | Updated version to <I> | puppetlabs_puppet | train | rb |
d99ec0ee1229a2f9351e696a91f53d3f24b2b503 | diff --git a/src/extensions/default/CSSCodeHints/main.js b/src/extensions/default/CSSCodeHints/main.js
index <HASH>..<HASH> 100644
--- a/src/extensions/default/CSSCodeHints/main.js
+++ b/src/extensions/default/CSSCodeHints/main.js
@@ -174,10 +174,9 @@ define(function (require, exports, module) {
}
if (TokenUtils.moveSkippingWhitespace(TokenUtils.moveNextToken, ctx) && ctx.token.string === ":") {
adjustCursor = true;
- newCursor = cursor;
- newCursor.ch = cursor.ch + (hint.length - this.info.name.length);
- }
- if (!adjustCursor) {
+ newCursor = { line: cursor.line,
+ ch: cursor.ch + (hint.length - this.info.name.length) };
+ } else {
hint += ":";
end.ch++; // Add one for the colon that we're appending.
} | Explicitly making a new cursor from the current cursor. | adobe_brackets | train | js |
48d8ff5daabbbc2f27d241e367ad418389ff36f4 | diff --git a/parsl/providers/grid_engine/grid_engine.py b/parsl/providers/grid_engine/grid_engine.py
index <HASH>..<HASH> 100644
--- a/parsl/providers/grid_engine/grid_engine.py
+++ b/parsl/providers/grid_engine/grid_engine.py
@@ -7,7 +7,7 @@ from parsl.providers.cluster_provider import ClusterProvider
from parsl.providers.grid_engine.template import template_string
from parsl.launchers import SingleNodeLauncher
from parsl.providers.provider_base import JobState, JobStatus
-from parsl.utils import RepresentationMixin, wtime_to_minutes
+from parsl.utils import RepresentationMixin
logger = logging.getLogger(__name__)
@@ -99,7 +99,7 @@ class GridEngineProvider(ClusterProvider, RepresentationMixin):
job_config = {}
job_config["submit_script_dir"] = self.channel.script_dir
job_config["nodes"] = self.nodes_per_block
- job_config["walltime"] = wtime_to_minutes(self.walltime)
+ job_config["walltime"] = self.walltime
job_config["scheduler_options"] = self.scheduler_options
job_config["worker_init"] = self.worker_init
job_config["user_script"] = command | Fix walltime format for GridEngineProvider
GridEngine takes a h_rt attribute that expects HH:MM:SS format or seconds. (#<I>)
Previously we incorrectly passed it walltime in minutes.
Fixes #<I> | Parsl_parsl | train | py |
5ad66e809f57a2bfba0b8b629e0c23bb904e8039 | diff --git a/java/src/main/java/cucumber/runtime/java/Java8StepDefinition.java b/java/src/main/java/cucumber/runtime/java/Java8StepDefinition.java
index <HASH>..<HASH> 100644
--- a/java/src/main/java/cucumber/runtime/java/Java8StepDefinition.java
+++ b/java/src/main/java/cucumber/runtime/java/Java8StepDefinition.java
@@ -65,7 +65,7 @@ public class Java8StepDefinition implements StepDefinition {
@Override
public Integer getParameterCount() {
- return pattern.matcher("").groupCount();
+ return parameterInfos.size();
}
@Override | Update Java8StepDefinition.java
I have Arity mismatch error when using Java8 step definitions.
Looking at class Java8StepDefinition, I saw that could be solved by returning parameterCounter like JavaStepDefinition actually does. Simple: return parameterInfos.size(); | cucumber_cucumber-jvm | train | java |
9d685e41c9ef1dfeb5ffd51ddb45139631d1a518 | diff --git a/lib/hawkular/base_client.rb b/lib/hawkular/base_client.rb
index <HASH>..<HASH> 100644
--- a/lib/hawkular/base_client.rb
+++ b/lib/hawkular/base_client.rb
@@ -146,14 +146,9 @@ module Hawkular
end
def tenant_header
- if @options[:tenant].nil?
- { 'Hawkular-Tenant' => 'hawkular' }
- elsif @options[:tenant].empty?
- {}
- else
- { :'Hawkular-Tenant' => @options[:tenant],
- 'tenantId' => @options[:tenant] }
- end
+ headers = {}
+ headers[:'Hawkular-Tenant'] = @options[:tenant] unless @options[:tenant].nil?
+ headers
end
def handle_fault(f) | If the tenant is not passed in the options no default value is used. (#<I>) | hawkular_hawkular-client-ruby | train | rb |
06653db8a039519ad7d620debee7c05639bbe757 | diff --git a/django_performance_testing/queries.py b/django_performance_testing/queries.py
index <HASH>..<HASH> 100644
--- a/django_performance_testing/queries.py
+++ b/django_performance_testing/queries.py
@@ -81,7 +81,8 @@ class QueryCollector(object):
self.queries_about_to_be_reset_handler)
return self
- def queries_about_to_be_reset_handler(self, signal, sender, queries):
+ def queries_about_to_be_reset_handler(self,
+ signal, sender, queries, **kwargs):
self.store_queries()
self.nr_of_queries_when_entering = 0 | signal handles must accept kwargs :( | PaesslerAG_django-performance-testing | train | py |
f5206a0d5748211fe5fa6e0a540587dd13b0d6c7 | diff --git a/modernrpc/tests/test_rpc_method_object.py b/modernrpc/tests/test_rpc_method_object.py
index <HASH>..<HASH> 100644
--- a/modernrpc/tests/test_rpc_method_object.py
+++ b/modernrpc/tests/test_rpc_method_object.py
@@ -144,6 +144,20 @@ def multi_line_documented_2():
return "abc"
+def test_html_documentation_simple():
+
+ settings.MODERNRPC_DOC_FORMAT = ''
+
+ rpc_method(single_line_documented, 'dummy_name')
+ method = RPCMethod(single_line_documented)
+ assert '*italic*, **strong**, normal text' in method.html_doc
+
+ rpc_method(multi_line_documented_1, 'dummy_name_2')
+ method = RPCMethod(multi_line_documented_1)
+ # We ensure no <br/> is added to the text when the original docstring contained single \n characters
+ assert 'attribute function is read. The indentation should not' in method.html_doc
+
+
def test_html_documentation_markdown(settings):
settings.MODERNRPC_DOC_FORMAT = 'md' | Add a test related to PR #7 | alorence_django-modern-rpc | train | py |
d914bbad0db1525439d44ae0cbc8821b78058369 | diff --git a/visidata/plugins.py b/visidata/plugins.py
index <HASH>..<HASH> 100644
--- a/visidata/plugins.py
+++ b/visidata/plugins.py
@@ -140,8 +140,10 @@ class PluginsSheet(JsonLinesSheet):
stderr=subprocess.PIPE)
out, err = p.communicate()
vd.status(out.decode())
+ if err:
+ vd.warning(err.decode())
if p.returncode != 0:
- vd.fail('pip install failed:%s' % err.decode())
+ vd.fail('pip install failed')
else:
with vd.urlcache(plugin.url, days=0).open_text(encoding='utf-8') as pyfp:
contents = pyfp.read() | [plugins] pip stderr in warning
but only fail if returncode is non-zero | saulpw_visidata | train | py |
bfceeb56e5f64e634339115b3a94821e73a4308b | diff --git a/tests/test_decimal_fields.py b/tests/test_decimal_fields.py
index <HASH>..<HASH> 100644
--- a/tests/test_decimal_fields.py
+++ b/tests/test_decimal_fields.py
@@ -13,7 +13,7 @@ class DecimalFieldsTest(unittest.TestCase):
def setUp(self):
self.database = Database('test-db')
- self.database.add_setting('allow_experimental_decimal_typez', 1)
+ self.database.add_setting('allow_experimental_decimal_type', 1)
try:
self.database.create_table(DecimalModel)
except ServerError as e: | re-enable decimals tests | Infinidat_infi.clickhouse_orm | train | py |
79d0d4cac404d4c3218b635c143921fcf2293f58 | diff --git a/src/Leevel/Support/Fn.php b/src/Leevel/Support/Fn.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Support/Fn.php
+++ b/src/Leevel/Support/Fn.php
@@ -49,7 +49,7 @@ class Fn
try {
return $fn(...$args);
} catch (Error $th) {
- $fnName = is_string($fn) ? $fn : $this->normalizeFn($th);
+ $fnName = $this->normalizeFn($fn, $th);
if ($this->match($fnName)) {
return $fn(...$args);
@@ -94,22 +94,25 @@ class Fn
/**
* 整理函数名字.
*
+ * @param string $fn
* @param \Error $th
*
* @return string
*/
- protected function normalizeFn(Error $th): string
+ protected function normalizeFn(string $fn, Error $th): string
{
$message = $th->getMessage();
- $fnMessage = 'Call to undefined function ';
+ $undefinedFn = 'Call to undefined function ';
- if (0 !== strpos($message, $fnMessage)) {
+ if (0 !== strpos($message, $undefinedFn)) {
throw $th;
}
- $fn = substr($message, strlen($fnMessage), -2);
+ if (is_string($fn)) {
+ return $fn;
+ }
- return $fn;
+ return substr($message, strlen($undefinedFn), -2);
}
/** | fix: fix Leevel\Support\Fn | hunzhiwange_framework | train | php |
1094009d30bc752ca39461d8267f5e39f3259531 | diff --git a/client/my-sites/plans/current-plan/current-plan-thank-you-card/free-plan-thank-you-card.js b/client/my-sites/plans/current-plan/current-plan-thank-you-card/free-plan-thank-you-card.js
index <HASH>..<HASH> 100644
--- a/client/my-sites/plans/current-plan/current-plan-thank-you-card/free-plan-thank-you-card.js
+++ b/client/my-sites/plans/current-plan/current-plan-thank-you-card/free-plan-thank-you-card.js
@@ -19,6 +19,7 @@ const FreePlanThankYouCard = ( { translate } ) => (
src="/calypso/images/illustrations/security.svg"
/>
}
+ showContinueButton
title={ translate( 'Welcome to Jetpack Free!' ) }
>
<p> | Fix showing continue button for free sites on jetpack connect-flow (#<I>) | Automattic_wp-calypso | train | js |
187e8e16e93bafb34d1bcd12e70b8d94d40954e9 | diff --git a/eulfedora/models.py b/eulfedora/models.py
index <HASH>..<HASH> 100644
--- a/eulfedora/models.py
+++ b/eulfedora/models.py
@@ -63,7 +63,7 @@ class DatastreamObject(object):
is set, it takes precedence over :attr:`content`.'''
def __init__(self, obj, id, label, mimetype=None, versionable=False,
- state='A', format=None, control_group='M', checksum=None, checksum_type="SHA-1"):
+ state='A', format=None, control_group='M', checksum=None, checksum_type="MD5"):
self.obj = obj
self.id = id | restore former default checksum type of MD5 | emory-libraries_eulfedora | train | py |
fd42df175cef57276b5ef3fad3ea8ea5af7c0ca7 | diff --git a/optaplanner-core/src/main/java/org/optaplanner/core/score/holder/AbstractScoreHolder.java b/optaplanner-core/src/main/java/org/optaplanner/core/score/holder/AbstractScoreHolder.java
index <HASH>..<HASH> 100644
--- a/optaplanner-core/src/main/java/org/optaplanner/core/score/holder/AbstractScoreHolder.java
+++ b/optaplanner-core/src/main/java/org/optaplanner/core/score/holder/AbstractScoreHolder.java
@@ -18,7 +18,7 @@ package org.optaplanner.core.score.holder;
import java.io.Serializable;
-import org.drools.common.AgendaItem;
+import org.drools.core.common.AgendaItem;
import org.kie.event.rule.ActivationUnMatchListener;
import org.kie.runtime.rule.RuleContext;
import org.kie.runtime.rule.Session; | Resolve split-packages: move everything from drools-core under org.drools.core: move org.drools.common | kiegroup_optaplanner | train | java |
28bdf4ce8235d2f80356de6e69f3ea1ef7729406 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -104,7 +104,10 @@ module.exports = function (settings = {}) {
.filter(isNotInExtensions));
neutrino.use(eslint({
test: lintExtensions,
- eslint: { baseConfig }
+ eslint: {
+ baseConfig,
+ resolvePluginsRelativeTo: path.resolve(__dirname, '../node_modules/.pnpm')
+ }
}));
};
};
\ No newline at end of file | Better integration with symlinked environment | atomspace_atomspace-eslint | train | js |
0210a5cbb083c61623ea4ecbc6008a1a2bc87f5a | diff --git a/framework/db/sqlite/QueryBuilder.php b/framework/db/sqlite/QueryBuilder.php
index <HASH>..<HASH> 100644
--- a/framework/db/sqlite/QueryBuilder.php
+++ b/framework/db/sqlite/QueryBuilder.php
@@ -29,9 +29,9 @@ class QueryBuilder extends \yii\db\QueryBuilder
*/
public $typeMap = [
Schema::TYPE_PK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
- Schema::TYPE_UPK => 'integer UNSIGNED PRIMARY KEY AUTOINCREMENT NOT NULL',
+ Schema::TYPE_UPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
Schema::TYPE_BIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
- Schema::TYPE_UBIGPK => 'integer UNSIGNED PRIMARY KEY AUTOINCREMENT NOT NULL',
+ Schema::TYPE_UBIGPK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
Schema::TYPE_CHAR => 'char(1)',
Schema::TYPE_STRING => 'varchar(255)',
Schema::TYPE_TEXT => 'text', | Removed UNSIGNED from primary keys mapping | yiisoft_yii2 | train | php |
cba5a182a4f386eabf34d1af2e3b9fe6be7c28d4 | diff --git a/index.php b/index.php
index <HASH>..<HASH> 100644
--- a/index.php
+++ b/index.php
@@ -48,7 +48,10 @@ try {
$default_tree_name = $previous_tree_name ?: Site::getPreference('DEFAULT_GEDCOM');
$tree_name = $request->get('ged', $default_tree_name);
$tree = Tree::findByName($tree_name);
- Session::put('GEDCOM', $tree_name);
+
+ if ($tree_name) {
+ Session::put('GEDCOM', $tree_name);
+ }
$request->attributes->set('tree', $tree);
$request->attributes->set('user', Auth::user()); | Fixes #<I> (#<I>)
* Prevent NOTICE about missing "title" attribute
* Fixed admin only login with private tree
* Fixed reading GEDCOM session parameter
* Check tree before storing it in the session | fisharebest_webtrees | train | php |
d88d2365e8295b3b95e948f53019f399d55800e9 | diff --git a/src/YamlUpdater.php b/src/YamlUpdater.php
index <HASH>..<HASH> 100644
--- a/src/YamlUpdater.php
+++ b/src/YamlUpdater.php
@@ -16,11 +16,6 @@ use Symfony\Component\Yaml\Parser;
class YamlUpdater
{
/**
- * @var $app Silex\Application
- */
- private $app;
-
- /**
* @var Symfony\Component\Yaml\Parser
*/
private $parser;
@@ -61,7 +56,6 @@ class YamlUpdater
*/
public function __construct(Application $app, $filename = '')
{
- $this->app = $app;
$this->changed = false;
$this->filename = $filename;
$this->file = new File($app['filesystem']->getManager('config'), $filename); | Remove unneeded $app as a class variable | bolt_bolt | train | php |
13498dc076860293423b78bc319a0b602371d2fc | diff --git a/Controller/Crud/CrudController.php b/Controller/Crud/CrudController.php
index <HASH>..<HASH> 100644
--- a/Controller/Crud/CrudController.php
+++ b/Controller/Crud/CrudController.php
@@ -795,7 +795,7 @@ class CrudController extends Controller
$action = $this->actions[$name];
$action->configure(new ActionConfig($this->entityClass));
- return call_user_func_array([$action, 'run'], $args);
+ return $action->{'run'}(...$args);
} | Move CRUD show action to separate service. | DarvinStudio_DarvinAdminBundle | train | php |
cdb74a75f2e0853a86595ab659447f913867f675 | diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js
index <HASH>..<HASH> 100644
--- a/src/structures/GuildChannel.js
+++ b/src/structures/GuildChannel.js
@@ -33,9 +33,11 @@ class GuildChannel extends Channel {
super.setup(data);
/**
* The type of the Guild Channel
- * @type {Number}
+ * @type {String}
*/
- this.type = data.type;
+ if (data.type === 0) this.type = 'text';
+ else if (data.type === 2) this.type = 'voice';
+ else this.type = data.type.toString();
/**
* The topic of the Guild Channel, if there is one.
* @type {?String} | Indev rewrite - Changed GuildChannel type (#<I>)
* Altered GuildChannel.type to return a string containing either "text",
"voice" or the id of the channel type.
* Fixed typo
* Altered code to pass ESLint test (Functionality Unchanged).
* Third times the charm. | discordjs_discord.js | train | js |
642adc2e184cb039fdf69acffbc85ae5740a5532 | diff --git a/app/models/shipit/task.rb b/app/models/shipit/task.rb
index <HASH>..<HASH> 100644
--- a/app/models/shipit/task.rb
+++ b/app/models/shipit/task.rb
@@ -13,7 +13,7 @@ module Shipit
belongs_to :until_commit, class_name: 'Commit'
belongs_to :since_commit, class_name: 'Commit'
- has_many :chunks, -> { order(:id) }, class_name: 'OutputChunk', dependent: :destroy
+ has_many :chunks, -> { order(:id) }, class_name: 'OutputChunk', dependent: :delete_all
serialize :definition, TaskDefinition
serialize :env, Hash | Use :delete_all instead of :destroy for Task#output_chunks
- Tasks with huge output were basically undestroyable without rolling them up first
- OutputChunk is a very lightweight record anyway, so it's unlikely to have any kind of callbacks in the future. | Shopify_shipit-engine | train | rb |
be395fde14c453f1fd4be90eee37042464fc21d6 | diff --git a/linebot/models/filter.py b/linebot/models/filter.py
index <HASH>..<HASH> 100644
--- a/linebot/models/filter.py
+++ b/linebot/models/filter.py
@@ -36,8 +36,8 @@ class Filter(with_metaclass(ABCMeta, Base)):
:param demographic: Combination of different criteria using logical
operator objects.
- :type demographic: :py:class:`linebot.model.DemographicFilter` |
- :py:class:`linebot.model.Operator`
+ :type demographic: :py:class:`linebot.model.filter.DemographicFilter` |
+ :py:class:`linebot.model.operator.Operator`
:param kwargs:
"""
super(Filter, self).__init__(**kwargs) | modify class names (#<I>) | line_line-bot-sdk-python | train | py |
28b5a6210ea16c259a89c8bf241215fe04c1a030 | diff --git a/lib/filter_factory/active_record/condition.rb b/lib/filter_factory/active_record/condition.rb
index <HASH>..<HASH> 100644
--- a/lib/filter_factory/active_record/condition.rb
+++ b/lib/filter_factory/active_record/condition.rb
@@ -26,7 +26,7 @@ module FilterFactory
end
def all(_obj)
- fail NotImplementedError, "all operator is not available for ActiveRecord"
+ fail NotImplementedError, 'all operator is not available for ActiveRecord'
end
def is_in(obj)
@@ -42,7 +42,7 @@ module FilterFactory
end
def exists(_obj)
- fail NotImplementedError, "exists operator is not available for ActiveRecord"
+ fail NotImplementedError, 'exists operator is not available for ActiveRecord'
end
def presents(obj) | Use single-quoted strings without interpolation. | hck_filter_factory | train | rb |
cce4052954ca88dc185161c706113fdec685d96f | diff --git a/daemon/pod/exec.go b/daemon/pod/exec.go
index <HASH>..<HASH> 100644
--- a/daemon/pod/exec.go
+++ b/daemon/pod/exec.go
@@ -81,11 +81,7 @@ func (wc *waitClose) Close() error {
type writeCloser struct {
io.Writer
- closer io.Closer
-}
-
-func (wc *writeCloser) Close() error {
- return wc.closer.Close()
+ io.Closer
}
func (p *XPod) StartExec(stdin io.ReadCloser, stdout io.WriteCloser, containerId, execId string) error { | simplify writeCloser
Embedded types are enough here. | hyperhq_hyperd | train | go |
96c6ac3ccb5a5ae589aadfe1457edefac2db33b6 | diff --git a/concrete/src/Block/BlockType/BlockTypeList.php b/concrete/src/Block/BlockType/BlockTypeList.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Block/BlockType/BlockTypeList.php
+++ b/concrete/src/Block/BlockType/BlockTypeList.php
@@ -2,6 +2,7 @@
namespace Concrete\Core\Block\BlockType;
use Concrete\Core\Entity\Block\BlockType\BlockType as BlockTypeEntity;
+use Concrete\Core\Support\Facade\Application;
use Core;
use Loader;
use Package;
@@ -88,7 +89,7 @@ class BlockTypeList extends DatabaseItemList
$bt = new BlockTypeEntity();
$bt->setBlockTypeHandle($file);
$class = $bt->getBlockTypeClass();
- $bta = new $class();
+ $bta = Application::getFacadeRoot()->make($class);
$bt->setBlockTypeName($bta->getBlockTypeName());
$bt->setBlockTypeDescription($bta->getBlockTypeDescription());
$bt->hasCustomViewTemplate = file_exists(DIR_FILES_BLOCK_TYPES . '/' . $file . '/' . FILENAME_BLOCK_VIEW); | Update BlockTypeList.php
The block object isn't created the correct way. The error popped up when creating a new BlockType with additional constructor parameters. | concrete5_concrete5 | train | php |
5ff4710dfd7d80562564044a32b5f9f5477c76fc | diff --git a/lib/bank_scrap/banks/ing.rb b/lib/bank_scrap/banks/ing.rb
index <HASH>..<HASH> 100644
--- a/lib/bank_scrap/banks/ing.rb
+++ b/lib/bank_scrap/banks/ing.rb
@@ -18,7 +18,7 @@ module BankScrap
def initialize(user, password, log: false, debug: false, extra_args:)
@dni = user
@password = password.to_s
- @birthday = extra_args['birthday']
+ @birthday = extra_args.with_indifferent_access['birthday']
@log = log
@debug = debug | ING: Allow both symbols and strings as key for extra_args | bankscrap_bankscrap | train | rb |
606392b4c6c5a6d7f05ec656c8849901200da63e | diff --git a/pkg/plugins/dashboard_importer.go b/pkg/plugins/dashboard_importer.go
index <HASH>..<HASH> 100644
--- a/pkg/plugins/dashboard_importer.go
+++ b/pkg/plugins/dashboard_importer.go
@@ -97,6 +97,8 @@ func ImportDashboard(cmd *ImportDashboardCommand) error {
ImportedUrl: savedDash.GetUrl(),
ImportedRevision: dashboard.Data.Get("revision").MustInt64(1),
Imported: true,
+ DashboardId: savedDash.Id,
+ Slug: savedDash.Slug,
}
return nil | API: added dashboardId and slug in response after import (#<I>) | grafana_grafana | train | go |
10e692615a71defef475e738f336e6ef0ce8de87 | diff --git a/src/QueryBuilders/Postgres/PostgresQuery.php b/src/QueryBuilders/Postgres/PostgresQuery.php
index <HASH>..<HASH> 100644
--- a/src/QueryBuilders/Postgres/PostgresQuery.php
+++ b/src/QueryBuilders/Postgres/PostgresQuery.php
@@ -129,7 +129,9 @@ class PostgresQuery implements QueryInterface
$query = $this->type . ' INTO ';
$query .= '"' . $this->table . '" ';
if (!empty($this->columns)) {
- $query .= '(' . $this->compileColumns() . ') ';
+ $columns = $this->compileColumns();
+ $columns = str_replace('"' . $this->table . '".','', $columns);
+ $query .= '(' . $columns . ') ';
}
$query .= 'VALUES ';
$query .= $this->compileRecords(); | Fixed an issue with column compilation for Postgres | sypherlev_blueprint | train | php |
Subsets and Splits