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 |
|---|---|---|---|---|---|
7c2930766c4d19db0959d14434b9470f902fab37 | diff --git a/lib/document_builder/collection.rb b/lib/document_builder/collection.rb
index <HASH>..<HASH> 100644
--- a/lib/document_builder/collection.rb
+++ b/lib/document_builder/collection.rb
@@ -20,5 +20,21 @@ module DocumentBuilder
yield type.new(element)
end
end
+
+ def to_s(*args)
+ JSON.pretty_generate(to_hash)
+ end
+
+ def inspect
+ "#<#{self.class}:0x#{self.object_id.to_s(16)}> Attributes: " + JSON.pretty_generate(to_hash)
+ end
+
+ def to_json(*args)
+ JSON.generate(to_hash)
+ end
+
+ def to_hash
+ entries.map(&:to_hash)
+ end
end
end | Add coercions and inspect to collection | bullfight_document_builder | train | rb |
d71c0019190dc609987e1ec6c9d1ebb982c6a2cc | diff --git a/pysnmp/hlapi/asyncore/cmdgen.py b/pysnmp/hlapi/asyncore/cmdgen.py
index <HASH>..<HASH> 100644
--- a/pysnmp/hlapi/asyncore/cmdgen.py
+++ b/pysnmp/hlapi/asyncore/cmdgen.py
@@ -222,6 +222,8 @@ class CmdGen(AsynCmdGen):
varBindTable=varBindTotalTable
)
else:
+ varBindTotalTable.extend(varBindTable) # XXX out of table
+ # rows possible
varBindTableRow = varBindTable[-1]
for idx in range(len(varBindTableRow)):
name, val = varBindTableRow[idx]
@@ -235,7 +237,6 @@ class CmdGen(AsynCmdGen):
varBinds=varBindTable[-1],
varBindTable=varBindTotalTable
)
- varBindTotalTable.extend(varBindTable)
head = map(lambda x,self=self: univ.ObjectIdentifier(mibvar.instanceNameToOid(self.mibView, x)), varNames) | report possibly out-of-table rows in getbulk. otherwise, in-scope rows
may not be reported. this is yet to be fixed somehow... | etingof_pysnmp | train | py |
cd5ae17e8df2cf8975b545008b7a7376e49b9176 | diff --git a/salt/modules/file.py b/salt/modules/file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -3431,7 +3431,7 @@ def apply_template_on_contents(
to_str=True,
context=context_dict,
saltenv=saltenv,
- grains=__grains__,
+ grains=__opts__['grains'],
pillar=__pillar__,
salt=__salt__,
opts=__opts__)['data'].encode('utf-8')
@@ -3615,7 +3615,7 @@ def get_managed(
context=context_dict,
salt=__salt__,
pillar=__pillar__,
- grains=__grains__,
+ grains=__opts__['grains'],
opts=__opts__,
**kwargs)
else: | fxd missed proper grains dictionary | saltstack_salt | train | py |
5acc3598adb3231e5c12728e3b78e3a661db1fba | diff --git a/kombine/sampler.py b/kombine/sampler.py
index <HASH>..<HASH> 100644
--- a/kombine/sampler.py
+++ b/kombine/sampler.py
@@ -123,6 +123,8 @@ class Sampler(object):
"""
if p0 is not None:
p0 = np.atleast_2d(p0)
+ else:
+ p0 = self.draw(self.nwalkers)
# Start the K-S testing interval at the update interval length
test_interval = update_interval | If p0 not given in burnin, draw from the current KDE | bfarr_kombine | train | py |
bec86f91f4ff645c6b07336e2a71da5aae6a98ea | diff --git a/src/GitElephant/Objects/Diff/DiffChunk.php b/src/GitElephant/Objects/Diff/DiffChunk.php
index <HASH>..<HASH> 100644
--- a/src/GitElephant/Objects/Diff/DiffChunk.php
+++ b/src/GitElephant/Objects/Diff/DiffChunk.php
@@ -105,11 +105,11 @@ class DiffChunk implements \ArrayAccess, \Countable, \Iterator
$new = $this->destStartLine;
foreach ($lines as $line) {
if (preg_match('/^\+(.*)/', $line)) {
- $this->lines[] = new DiffChunkLineAdded($new++, preg_replace('/\+(.*)/', '$1', $line));
+ $this->lines[] = new DiffChunkLineAdded($new++, preg_replace('/\+(.*)/', ' $1', $line));
$destUnchanged++;
} else {
if (preg_match('/^-(.*)/', $line)) {
- $this->lines[] = new DiffChunkLineDeleted($deleted++, preg_replace('/-(.*)/', '$1', $line));
+ $this->lines[] = new DiffChunkLineDeleted($deleted++, preg_replace('/-(.*)/', ' $1', $line));
$originUnchanged++;
} else {
if (preg_match('/^ (.*)/', $line) || $line == '') { | added a space to replace + and - in the diff | matteosister_GitElephant | train | php |
d2d9c4e3e1eb9c6e7733a044665f9683aec170de | diff --git a/client/components/social-buttons/apple.js b/client/components/social-buttons/apple.js
index <HASH>..<HASH> 100644
--- a/client/components/social-buttons/apple.js
+++ b/client/components/social-buttons/apple.js
@@ -27,6 +27,20 @@ const appleClientUrl =
const connectUrlPopupFLow =
'https://public-api.wordpress.com/connect/?magic=keyring&service=apple&action=request&for=connect';
+// polyfill for CustomEvent otherwise Apple login breaks on IE 11
+// see: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
+( function() {
+ if ( typeof window === 'undefined' || typeof window.CustomEvent === 'function' ) return false;
+ function CustomEvent( event, params ) {
+ params = params || { bubbles: false, cancelable: false, detail: null };
+ const evt = document.createEvent( 'CustomEvent' );
+ evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
+ return evt;
+ }
+
+ window.CustomEvent = CustomEvent;
+} )();
+
class AppleLoginButton extends Component {
static propTypes = {
clientId: PropTypes.string.isRequired, | Polyfill CustomEvent on IE <I> for Apple login (#<I>) | Automattic_wp-calypso | train | js |
d56656001394389a757a1c5afe14165e50c616e3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -50,5 +50,6 @@ setup(
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
]
) | Added trove classifiers for Python <I> to setup.setup() | olucurious_PyFCM | train | py |
f4eefdb39f241390dd00f777cf4153087ac5f620 | diff --git a/src/Authenticator/JwtAuthenticator.php b/src/Authenticator/JwtAuthenticator.php
index <HASH>..<HASH> 100644
--- a/src/Authenticator/JwtAuthenticator.php
+++ b/src/Authenticator/JwtAuthenticator.php
@@ -14,6 +14,7 @@ namespace Authentication\Authenticator;
use ArrayObject;
use Authentication\Identifier\IdentifierCollection;
+use Authentication\Identifier\IdentifierInterface;
use Exception;
use Firebase\JWT\JWT;
use Psr\Http\Message\ResponseInterface;
@@ -87,7 +88,8 @@ class JwtAuthenticator extends TokenAuthenticator
$result = json_decode(json_encode($result), true);
- if (empty($result)) {
+ $key = IdentifierInterface::CREDENTIAL_JWT_SUBJECT;
+ if (empty($result[$key])) {
return new Result(null, Result::FAILURE_CREDENTIALS_NOT_FOUND);
}
@@ -97,7 +99,9 @@ class JwtAuthenticator extends TokenAuthenticator
return new Result($user, Result::SUCCESS);
}
- $user = $this->identifiers()->identify($result);
+ $user = $this->identifiers()->identify([
+ $key => $result[$key]
+ ]);
if (empty($user)) {
return new Result(null, Result::FAILURE_IDENTITY_NOT_FOUND, $this->identifiers()->getErrors()); | Fix JWT authenticators so only `sub` is passed to identifiers. | cakephp_authentication | train | php |
6202d0bc4e63846eccca990bbdb6bbe52942ed00 | diff --git a/upload/admin/language/english/common/header.php b/upload/admin/language/english/common/header.php
index <HASH>..<HASH> 100644
--- a/upload/admin/language/english/common/header.php
+++ b/upload/admin/language/english/common/header.php
@@ -48,6 +48,7 @@ $_['text_opencart'] = 'Homepage';
$_['text_payment'] = 'Payments';
$_['text_product'] = 'Products';
$_['text_profile'] = 'Profile';
+$_['text_product_profile'] = 'Product Profiles';
$_['text_reports'] = 'Reports';
$_['text_report_sale_order'] = 'Orders';
$_['text_report_sale_tax'] = 'Tax'; | Fix menu language string for product profile. | opencart_opencart | train | php |
053c9d6b1b455530bca267e7419a9f63bf51cddf | diff --git a/_pydev_bundle/pydev_monkey.py b/_pydev_bundle/pydev_monkey.py
index <HASH>..<HASH> 100644
--- a/_pydev_bundle/pydev_monkey.py
+++ b/_pydev_bundle/pydev_monkey.py
@@ -126,7 +126,7 @@ def patch_args(args):
break
i += 1
- if i < len(args) and _is_managed_arg(args[i]): # no need to add pydevd twice
+ if i >= len(args) and _is_managed_arg(args[i]): # no need to add pydevd twice
return args
for x in original: # @UndefinedVariable | IndexError in pydev_monkey.py when debugging (PY-<I>)
We shouldn't attach to debugger if there are only options in a new python process command line | fabioz_PyDev.Debugger | train | py |
ca9a45ac9c16cbe43f6c49a1a1ec535e7d36cead | diff --git a/activejdbc/src/main/java/activejdbc/Base.java b/activejdbc/src/main/java/activejdbc/Base.java
index <HASH>..<HASH> 100644
--- a/activejdbc/src/main/java/activejdbc/Base.java
+++ b/activejdbc/src/main/java/activejdbc/Base.java
@@ -42,7 +42,6 @@ public class Base {
}
public static void open(String jndiName) {
- Base.rollbackTransaction();
new DB(DEFAULT_DB_NAME).open(jndiName);
} | removed rollbackTransaction - this was added by accident - surprized did not come up in tests! | javalite_activejdbc | train | java |
92d15169fc0c19391ddced74d7e30178e7f12f74 | diff --git a/cmd/tsdb/main.go b/cmd/tsdb/main.go
index <HASH>..<HASH> 100644
--- a/cmd/tsdb/main.go
+++ b/cmd/tsdb/main.go
@@ -508,6 +508,30 @@ func analyzeBlock(b *tsdb.Block, limit int) {
postingInfos = postingInfos[:0]
for _, n := range allLabelNames {
+ values, err := ir.LabelValues(n)
+ if err != nil {
+ exitWithError(err)
+ }
+ var cumulativeLength uint64
+
+ for i := 0; i < values.Len(); i++ {
+ value, _ := values.At(i)
+ if err != nil {
+ exitWithError(err)
+ }
+ for _, str := range value {
+ cumulativeLength += uint64(len(str))
+ }
+ }
+
+ postingInfos = append(postingInfos, postingInfo{n, cumulativeLength})
+ }
+
+ fmt.Printf("\nLabel names with highest cumulative label value length:\n")
+ printInfo(postingInfos)
+
+ postingInfos = postingInfos[:0]
+ for _, n := range allLabelNames {
lv, err := ir.LabelValues(n)
if err != nil {
exitWithError(err) | Print label names with highest cumulative label value length during tsdb analyze (#<I>) | prometheus_prometheus | train | go |
d933c72628184020bcea6dfea7ce8e900994c434 | diff --git a/src/history.js b/src/history.js
index <HASH>..<HASH> 100644
--- a/src/history.js
+++ b/src/history.js
@@ -123,7 +123,7 @@ class Branch {
return new Branch(this.items.append(array.map(map => new Item(map))), this.eventCount)
}
- // : ([PosMap], Transform, [number])
+ // : ([StepMap], Transform, [number])
// When the collab module receives remote changes, the history has
// to know about those, so that it can adjust the steps that were
// rebased on top of the remote changes, and include the position
@@ -184,7 +184,7 @@ class Branch {
if (i >= upto) {
items.push(item)
} else if (item.step) {
- let step = item.step.map(remap.slice(mapFrom)), map = step && step.posMap()
+ let step = item.step.map(remap.slice(mapFrom)), map = step && step.getMap()
mapFrom--
if (map) remap.appendMap(map, mapFrom)
if (step) {
@@ -228,7 +228,7 @@ class Item {
merge(other) {
if (this.step && other.step && !other.selection) {
let step = other.step.merge(this.step)
- if (step) return new Item(step.posMap().invert(), step, this.selection)
+ if (step) return new Item(step.getMap().invert(), step, this.selection)
}
}
} | Rename PosMap to StepMap
To make it more obvious what it is. | ProseMirror_prosemirror-history | train | js |
574885febc4e968e2f5560eaebae54fd7700ebad | diff --git a/path.py b/path.py
index <HASH>..<HASH> 100644
--- a/path.py
+++ b/path.py
@@ -921,9 +921,11 @@ class path(unicode):
def rename(self, new):
os.rename(self, new)
+ return self.__class__(new)
def renames(self, new):
os.renames(self, new)
+ return self.__class__(new)
#
# --- Create/delete operations on directories | Implemented rename and rename_s return self | jaraco_path.py | train | py |
892999dfe577ea6b4d7ffbd9e4c627a21d3c263b | diff --git a/src/nu/validator/servlet/VerifierServletTransaction.java b/src/nu/validator/servlet/VerifierServletTransaction.java
index <HASH>..<HASH> 100644
--- a/src/nu/validator/servlet/VerifierServletTransaction.java
+++ b/src/nu/validator/servlet/VerifierServletTransaction.java
@@ -687,7 +687,7 @@ class VerifierServletTransaction implements DocumentModeHandler, SchemaResolver
document = ("".equals(document)) ? null : document;
- if (document.contains("www.metaescort.com")) {
+ if (document != null && document.contains("www.metaescort.com")) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST,
"No input document");
return; | Prevent NPE from change in previous commit | validator_validator | train | java |
8c6dd005eca6e1e37c9c29667fd842468b15c5bf | diff --git a/openquake/hazardlib/nrml.py b/openquake/hazardlib/nrml.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/nrml.py
+++ b/openquake/hazardlib/nrml.py
@@ -74,13 +74,12 @@ supplemented by a dictionary of validators.
import io
import re
import sys
-import logging
import operator
import collections.abc
import numpy
-from openquake.baselib import hdf5, performance
+from openquake.baselib import hdf5
from openquake.baselib.general import CallableDict, groupby
from openquake.baselib.node import (
node_to_xml, Node, striptag, ValidatingXmlParser, floatformat) | Removed unused imports [skip CI] | gem_oq-engine | train | py |
2094e7f76b65af33a3afbc61cdd398a3ff358047 | diff --git a/awacs/__init__.py b/awacs/__init__.py
index <HASH>..<HASH> 100644
--- a/awacs/__init__.py
+++ b/awacs/__init__.py
@@ -8,7 +8,7 @@ import json
import re
import types
-__version__ = "0.3.0"
+__version__ = "0.3.1"
valid_names = re.compile(r'^[a-zA-Z0-9]+$')
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='awacs',
- version='0.3.0',
+ version='0.3.1',
description="AWS Access Policy Language creation library",
author="Mark Peek",
author_email="mark@peek.org", | Bump to version <I> | cloudtools_awacs | train | py,py |
28817e62ef4b283df9d948455c71cd97e9cdd061 | diff --git a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadExchangeConverter.java b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadExchangeConverter.java
index <HASH>..<HASH> 100644
--- a/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadExchangeConverter.java
+++ b/rsocket/src/main/java/org/springframework/security/rsocket/authentication/AuthenticationPayloadExchangeConverter.java
@@ -21,9 +21,9 @@ import java.util.Map;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
-import io.rsocket.metadata.WellKnownMimeType;
import io.rsocket.metadata.AuthMetadataCodec;
-import io.rsocket.metadata.security.WellKnownAuthType;
+import io.rsocket.metadata.WellKnownAuthType;
+import io.rsocket.metadata.WellKnownMimeType;
import reactor.core.publisher.Mono;
import org.springframework.core.codec.ByteArrayDecoder; | Fix imports of AuthenticationPayloadExchangeConverter
Issue gh-<I> | spring-projects_spring-security | train | java |
dd5d8628b5e73ca322e804fab83d892545fae110 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.'''
-VERSION = '1.0.41'
+VERSION = '1.0.42'
setup(name='cloud-utils',
version=VERSION,
description='Python Cloud Utilities', | Update setup.py
increment version number , required to build new version after changes | google_python-cloud-utils | train | py |
0cfe2e0d6bc98af040a903e3eb13bf07b18f47b9 | diff --git a/src/User/Util.php b/src/User/Util.php
index <HASH>..<HASH> 100644
--- a/src/User/Util.php
+++ b/src/User/Util.php
@@ -69,7 +69,7 @@ class Util {
*/
public static function isAvailableEmail($email) {
- return !count(Application::getInstance()->getDb()->doPreparedQuery('SELECT adminID FROM admin WHERE email = ?', array((string) $email)));
+ return !count(Application::getInstance()->getDb()->doPreparedQuery('SELECT adminID FROM admin WHERE LOWER(email) = ?', array(strtolower($email))));
} | Bugfix: Made check for availability of user email case insensitive | Vectrex_vxPHP | train | php |
2ad5d81a88fdad460b4e7729be74ec3283463eff | diff --git a/sys/parsoid.js b/sys/parsoid.js
index <HASH>..<HASH> 100644
--- a/sys/parsoid.js
+++ b/sys/parsoid.js
@@ -390,6 +390,7 @@ class ParsoidService {
}
getSections(hyper, req) {
+ hyper.logger.log('warn/parsoid/sections', 'getSections() called');
const rp = req.params;
const sections = req.query.sections.split(',').map((id) => id.trim());
delete req.query.sections;
@@ -604,6 +605,7 @@ class ParsoidService {
original
};
if (from === 'changes') {
+ hyper.logger.log('warn/parsoid/sections', 'transformChangesToWikitext called');
body2.html = replaceSections(original, req.body.changes);
from = 'html';
} else { | [Temp] Log all requests for Parsoid sections
We are sunsetting the section retrieval and editing portion of the REST
API. The first step is to record the requests that do come in for
sections.
Bug: T<I> | wikimedia_restbase | train | js |
23a2013095d8b1cf75f10605a1cf0dd91d0bb2a0 | diff --git a/core-test/src/test/java/com/microsoft/windowsazure/ManagementResourceStepdefs.java b/core-test/src/test/java/com/microsoft/windowsazure/ManagementResourceStepdefs.java
index <HASH>..<HASH> 100644
--- a/core-test/src/test/java/com/microsoft/windowsazure/ManagementResourceStepdefs.java
+++ b/core-test/src/test/java/com/microsoft/windowsazure/ManagementResourceStepdefs.java
@@ -231,9 +231,9 @@ public class ManagementResourceStepdefs
protected static Configuration createConfiguration() throws Exception
{
return ManagementConfiguration.configure(
- "db1ab6f0-4769-4b27-930e-01e2ef9c123c",
- "C:\\sources\\certificates\\WindowsAzureKeyStore.jks",
- "test123"
+ System.getenv(ManagementConfiguration.SUBSCRIPTION_ID),
+ System.getenv(ManagementConfiguration.KEYSTORE_PATH),
+ System.getenv(ManagementConfiguration.KEYSTORE_PASSWORD)
);
}
}
\ No newline at end of file | Using env variables for credentials | Azure_azure-sdk-for-java | train | java |
664c788b2655964c8a987be7336e3680b9f95edf | diff --git a/builtin/providers/aws/data_source_aws_ami.go b/builtin/providers/aws/data_source_aws_ami.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/data_source_aws_ami.go
+++ b/builtin/providers/aws/data_source_aws_ami.go
@@ -270,11 +270,12 @@ func dataSourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Your query returned more than one result. Please try a more " +
"specific search criteria, or set `most_recent` attribute to true.")
}
+ } else {
+ // Query returned single result.
+ image = filteredImages[0]
}
- image = filteredImages[0]
log.Printf("[DEBUG] aws_ami - Single AMI found: %s", *image.ImageId)
-
return amiDescriptionAttributes(d, image)
} | Fix. Return correct AMI image when `most_recent` is set to `true`.
This commit resolves a regression introduced in #<I> that caused an
unfiltered image to be returned despite a search criteria being set
accordingly. | hashicorp_terraform | train | go |
8169274e678f9296f73a86fbf5b4c3c686636ca8 | diff --git a/src/ns.viewCollection.js b/src/ns.viewCollection.js
index <HASH>..<HASH> 100644
--- a/src/ns.viewCollection.js
+++ b/src/ns.viewCollection.js
@@ -271,7 +271,7 @@ ns.ViewCollection.prototype._getViewTree = function(layout, params) {
ns.ViewCollection.prototype._updateHTML = function(node, layout, params, updateOptions, events) {
// Для VC нам всегда прийдёт новая нода
- var newNode = ns.byClass('ns-view-' + this.id, node)[0];
+ var newNode = this._extractNode(node);
var isOuterPlaceholder = $(newNode).hasClass('ns-view-placeholder');
var viewWasInvalid = !this.isValid(); | Use _extractNode to take proper subview node | yandex-ui_noscript | train | js |
2010ab4a2f7819049ba48b2ca8647ff9b4e683bf | diff --git a/wily/commands/diff.py b/wily/commands/diff.py
index <HASH>..<HASH> 100644
--- a/wily/commands/diff.py
+++ b/wily/commands/diff.py
@@ -8,7 +8,7 @@ from wily.operators import resolve_metric, resolve_operator, get_metric
import tabulate
-def diff(config, files, metrics):
+def diff(config, files, metrics, changes_only=True):
"""
Show the differences in metrics for each of the files. | add changes_only flag to diff command | tonybaloney_wily | train | py |
506bc7234eb0f75b2300996a079feb204c91f2bc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
from distutils.core import setup
from setuptools import find_packages
-_version = "0.2.3"
+_version = "0.2.4"
_packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
_short_description = "Utilities and helpers for writing Pylint plugins"
@@ -17,6 +17,7 @@ _classifiers = (
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
)
setup( | Bumping version for hotfix release | PyCQA_pylint-plugin-utils | train | py |
6302a7c47d5c17bd2b2b51e4e604e2c3dc9378c9 | diff --git a/__init__.py b/__init__.py
index <HASH>..<HASH> 100644
--- a/__init__.py
+++ b/__init__.py
@@ -13,5 +13,5 @@ used from a setup script as
# Updated automatically by the Python release process.
#
#--start constants--
-__version__ = "3.3.2"
+__version__ = "3.3.3rc1"
#--end constants-- | Bump to <I>rc1. | pypa_setuptools | train | py |
8022056f1dc7c34a01d3f7b48152de9e8516f2c4 | diff --git a/output/html/block_editor.php b/output/html/block_editor.php
index <HASH>..<HASH> 100644
--- a/output/html/block_editor.php
+++ b/output/html/block_editor.php
@@ -72,7 +72,7 @@ class QM_Output_Html_Block_Editor extends QM_Output_Html {
}
protected static function render_block( $i, array $block, array $data ) {
- $block_error = ( empty( $block['blockName'] ) && trim( $block['innerHTML'] ) );
+ $block_error = false;
$row_class = '';
$referenced_post = null;
$referenced_type = null;
@@ -147,7 +147,7 @@ class QM_Output_Html_Block_Editor extends QM_Output_Html {
if ( $block['blockName'] ) {
echo esc_html( $block['blockName'] );
} else {
- echo '<em>' . esc_html__( 'None', 'query-monitor' ) . '</em>';
+ echo '<em>' . esc_html__( 'None (Classic block)', 'query-monitor' ) . '</em>';
}
if ( $error_message ) { | Downgrade a Classic block instance so it's no longer an error. | johnbillion_query-monitor | train | php |
2c3a64a142bb92eb1e9a8bc584f6745afa8c878c | diff --git a/spinoff/component/util.py b/spinoff/component/util.py
index <HASH>..<HASH> 100644
--- a/spinoff/component/util.py
+++ b/spinoff/component/util.py
@@ -4,7 +4,7 @@ from zope.interface import implements
from spinoff.component.component import IComponent
-class CompositeComponentBase(object):
+class ComponentCollection(object):
implements(IComponent)
def __init__(self, *members):
@@ -17,31 +17,20 @@ class CompositeComponentBase(object):
def add(self, component):
self._members.append(component)
self._connect([component], self._connections)
- self._set_parent([component])
def connect(self, *args, **kwargs):
connection = (args, kwargs)
self._connections.append(connection)
self._connect(self._members, [connection])
- def setServiceParent(self, parent):
- assert not self._parent
- self._parent = parent
- self._set_parent(self._members)
-
def _connect(self, components, connections):
for connection in connections:
args, kwargs = connection
for component in components:
component.connect(*args, **kwargs)
- def _set_parent(self, components):
- if self._parent:
- for component in components:
- component.setServiceParent(self._parent)
-
-class Filter(CompositeComponentBase):
+class Filter(ComponentCollection):
"""Filters messages based on `routing_key`.
The function that maps members to routing key values needs to be provided in the constructor. | Removed setServiceParent functionality from CompositeComponentBase and renamed it to ComponentCollection | eallik_spinoff | train | py |
1f1553a4258eb56caf5d1c6138cc0a662d5ed60f | diff --git a/scraper/code_gov/models.py b/scraper/code_gov/models.py
index <HASH>..<HASH> 100644
--- a/scraper/code_gov/models.py
+++ b/scraper/code_gov/models.py
@@ -264,7 +264,11 @@ class Project(dict):
project = klass()
- logger.debug('GitLab: repository=%s', repository)
+ logger.debug(
+ 'GitLab: repository_id=%d path_with_namespace=%s',
+ repository.id,
+ repository.path_with_namespace,
+ )
# -- REQUIRED FIELDS --
@@ -338,7 +342,11 @@ class Project(dict):
project = klass()
- logger.debug('Stashy: repository=%s', repository)
+ logger.debug(
+ 'Stashy: project_key=%s repository_slug=%s',
+ repository['name'],
+ repository['project']['key'],
+ )
# -- REQUIRED FIELDS -- | Improved logging messages for per-repo messages | LLNL_scraper | train | py |
12aadacf74b19b75ff9cac152803cad5bd3b7c6c | diff --git a/Eloquent/Relations/BelongsToMany.php b/Eloquent/Relations/BelongsToMany.php
index <HASH>..<HASH> 100755
--- a/Eloquent/Relations/BelongsToMany.php
+++ b/Eloquent/Relations/BelongsToMany.php
@@ -596,7 +596,11 @@ class BelongsToMany extends Relation {
$changes, $this->attachNew($records, $current, false)
);
- $this->touchIfTouching();
+ // Only going to touch if something was attached or updated
+ if (count($changes['attached']) || count($changes['updated']))
+ {
+ $this->touchIfTouching();
+ }
return $changes;
} | Fixed bug that triggers relationship timestamp touch, even when nothing on the pivot has changed. | illuminate_database | train | php |
17e1820b2e1c26a38909dd90a5e95548f344506c | diff --git a/lib/Configuration.js b/lib/Configuration.js
index <HASH>..<HASH> 100644
--- a/lib/Configuration.js
+++ b/lib/Configuration.js
@@ -292,19 +292,11 @@ export default class Configuration {
return undefined;
}
- const relativeFilePath = normalizePath(
- requireResolve(path.join(importPath, this.workingDirectory)));
-
const jsModule = new JsModule({
importPath,
hasNamedExports: true,
variableName,
});
- if (this.get('useRelativePaths', { pathToImportedModule: relativeFilePath }) &&
- !relativeFilePath.startsWith('./meteor/') &&
- !relativeFilePath.startsWith('./node_modules')) {
- jsModule.makeRelativeTo(this.pathToCurrentFile);
- }
return jsModule;
}
} | Don't make named exports relative
Now that we have a mechanism to automatically find named exports, the
need for namedExports configuration is not as important. One tricky
thing about namedExports is that we want to make them relative to the
current file, if they need to be. I'm removing that in favor of relying
on regular auto-named exports. | Galooshi_import-js | train | js |
1daf37ee6b987ed03854856cd6fa42b558b9d7ac | diff --git a/src/Jobs/Repository/Filter/PaginationQuery.php b/src/Jobs/Repository/Filter/PaginationQuery.php
index <HASH>..<HASH> 100644
--- a/src/Jobs/Repository/Filter/PaginationQuery.php
+++ b/src/Jobs/Repository/Filter/PaginationQuery.php
@@ -20,7 +20,6 @@ use Auth\Entity\UserInterface;
* maps query parameters to entity attributes
*
* @author Carsten Bleek <bleek@cross-solution.de>
- *
*/
class PaginationQuery extends AbstractPaginationQuery
{ | [Cv] provided feature to make CVs searchable | yawik_jobs | train | php |
7950b87bfcb63dfb88fb389525cfa4fe6cf94969 | diff --git a/lib/frozenplague/by_month.rb b/lib/frozenplague/by_month.rb
index <HASH>..<HASH> 100644
--- a/lib/frozenplague/by_month.rb
+++ b/lib/frozenplague/by_month.rb
@@ -35,7 +35,7 @@ module Frozenplague
end_of_month = beginning_of_month.end_of_month
# And since timestamps in the database are UTC by default, assume noone's changed it.
# Merging in conditions
- with_scope(["{#self.table_name}.#{field} >= ? AND #{self.table_name}#{field} <= ?", beginning_of_month.utc, end_of_month.utc]) do
+ with_scope(:find => :conditions => ["{#self.table_name}.#{field} >= ? AND #{self.table_name}#{field} <= ?", beginning_of_month.utc, end_of_month.utc]) do
block.call
end
end | So looks like I was wrong about not needing conditions. | radar_by_star | train | rb |
c7816b62e41fdf5db0932cfeeb7299ff81b17778 | diff --git a/src/Common/CodeIgniter/Core/Hooks.php b/src/Common/CodeIgniter/Core/Hooks.php
index <HASH>..<HASH> 100644
--- a/src/Common/CodeIgniter/Core/Hooks.php
+++ b/src/Common/CodeIgniter/Core/Hooks.php
@@ -88,8 +88,10 @@ class Hooks extends CI_Hooks
foreach ($this->aCustomHooks[$sWhich] as $aCustomHook) {
$this->runCustomHook($aCustomHook);
}
+ return true;
} else {
$this->runCustomHook($this->aCustomHooks[$sWhich]);
+ return true;
}
return parent::call_hook($sWhich); | fix: Cusotm hooks should return true if something is found | nails_common | train | php |
de0dd599bd0b27e2b80fb8f0ce0500bb7f4b791d | diff --git a/lib/html_mockup/release.rb b/lib/html_mockup/release.rb
index <HASH>..<HASH> 100644
--- a/lib/html_mockup/release.rb
+++ b/lib/html_mockup/release.rb
@@ -251,7 +251,7 @@ module HtmlMockup
if callable.respond_to?(:call)
callable
else
- raise ArgumentError, "Callable must be an object that responds to #call or a symbol that resolve to such an object or a class with a #call instance method."
+ raise ArgumentError, "Could not resolve #{callable.inspect}. Callable must be an object that responds to #call or a symbol that resolve to such an object or a class with a #call instance method."
end
end | Better error message tells which callable can't be resolved | DigitPaint_roger | train | rb |
dc12deb7f20532a4c6dfd182d1f709c711a7f26c | diff --git a/src/com/frostwire/jlibtorrent/Session.java b/src/com/frostwire/jlibtorrent/Session.java
index <HASH>..<HASH> 100644
--- a/src/com/frostwire/jlibtorrent/Session.java
+++ b/src/com/frostwire/jlibtorrent/Session.java
@@ -376,7 +376,38 @@ public final class Session {
}
}
- //public TorrentHandle
+ /**
+ * Looks for a torrent with the given info-hash. In
+ * case there is such a torrent in the session, a torrent_handle to that
+ * torrent is returned.
+ *
+ * @param infoHash
+ * @return
+ */
+ public TorrentHandle findTorrent(Sha1Hash infoHash) {
+ torrent_handle th = s.find_torrent(infoHash.getSwig());
+
+ return th.is_valid() ? new TorrentHandle(th) : null;
+ }
+
+ /**
+ * Returns a list of torrent handles to all the
+ * torrents currently in the session.
+ *
+ * @return
+ */
+ public List<TorrentHandle> getTorrents() {
+ torrent_handle_vector v = s.get_torrents();
+ long size = v.size();
+
+ List<TorrentHandle> l = new ArrayList<TorrentHandle>((int) size);
+
+ for (int i = 0; i < size; i++) {
+ l.add(new TorrentHandle(v.get(i)));
+ }
+
+ return l;
+ }
@Override
protected void finalize() throws Throwable { | Added lookup torrents methods to session. | frostwire_frostwire-jlibtorrent | train | java |
7099091c28d7da54f6811ef4ee73161cd4590786 | diff --git a/core/server.js b/core/server.js
index <HASH>..<HASH> 100644
--- a/core/server.js
+++ b/core/server.js
@@ -111,7 +111,7 @@ function ghostLocals(req, res, next) {
res.locals = res.locals || {};
res.locals.version = packageInfo.version;
res.locals.path = req.path;
- res.locals.csrfToken = req.session._csrf;
+ res.locals.csrfToken = req.csrfToken();
if (res.isAdmin) {
_.extend(res.locals, { | Fix CSRF deprecated warning | TryGhost_Ghost | train | js |
fea6056dedbc688b76fb8ef5cf10b17feb907355 | diff --git a/salt/cloud/clouds/vmware.py b/salt/cloud/clouds/vmware.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/vmware.py
+++ b/salt/cloud/clouds/vmware.py
@@ -3356,12 +3356,12 @@ def remove_host(kwargs=None, call=None):
)
try:
- if isinstance(host_ref.parent, vim.ComputeResource):
- # This is a standalone host system
- task = host_ref.parent.Destroy_Task()
- else:
+ if isinstance(host_ref.parent, vim.ClusterComputeResource):
# This is a host system that is part of a Cluster
task = host_ref.Destroy_Task()
+ else:
+ # This is a standalone host system
+ task = host_ref.parent.Destroy_Task()
salt.utils.vmware.wait_for_task(task, host_name, 'remove host', log_level='info')
except Exception as exc:
log.error( | Fixing critical bug to remove only the specified Host instead of the entire Host cluster (#<I>) | saltstack_salt | train | py |
5ffa896b9a5c41edcb3563c46804a41983b41044 | diff --git a/orderer/common/server/main.go b/orderer/common/server/main.go
index <HASH>..<HASH> 100644
--- a/orderer/common/server/main.go
+++ b/orderer/common/server/main.go
@@ -203,7 +203,7 @@ func Main() {
},
}))
- if !reuseGrpcListener {
+ if !reuseGrpcListener && clusterType {
logger.Info("Starting cluster listener on", clusterGRPCServer.Address())
go clusterGRPCServer.Start()
} | [FAB-<I>] Fix listener reuse for non clusters
This change set fixes a bug that crashes the orderer
in case it's a non cluster type.
For non cluster orderers, their gRPC server might
be started twice and also before being registered.
Change-Id: Ia9bc<I>d0a5ac3ba<I>eab<I>f4dd<I>a<I>e3 | hyperledger_fabric | train | go |
136cfd9b835ff53a213fce2e761475e1aca6d1a7 | diff --git a/lib/chef/knife/azurerm_server_create.rb b/lib/chef/knife/azurerm_server_create.rb
index <HASH>..<HASH> 100755
--- a/lib/chef/knife/azurerm_server_create.rb
+++ b/lib/chef/knife/azurerm_server_create.rb
@@ -91,7 +91,7 @@ class Chef
:short => "-m LOCATION",
:long => "--azure-service-location LOCATION",
:description => "Required if not using an Affinity Group. Specifies the geographic location - the name of the data center location that is valid for your subscription.
- Eg: West US, East US, East Asia, Southeast Asia, North Europe, West Europe",
+ Eg: westus, eastus, eastasia, southeastasia, northeurope, westeurope",
:proc => Proc.new { |lo| Chef::Config[:knife][:azure_service_location] = lo }
option :azure_os_disk_name, | Added the actual names of the sites otherwise:
```
ERROR: {
"error": {
"code": "InvalidLocationInRequestUri",
"message": "Location in request URI 'East US' does not match location of the service 'eastus'"
}
}
``` | chef_knife-azure | train | rb |
5301b76239400070931d4c358d2093afcea3f5ab | diff --git a/src/orb/backends/sql/postgresql/connection.py b/src/orb/backends/sql/postgresql/connection.py
index <HASH>..<HASH> 100644
--- a/src/orb/backends/sql/postgresql/connection.py
+++ b/src/orb/backends/sql/postgresql/connection.py
@@ -104,6 +104,9 @@ class PSQLConnection(SQLConnection):
db.rollback()
except StandardError as err:
log.error('Rollback error: {0}'.format(err))
+ log.critical(command)
+ if data:
+ log.critical(str(data))
raise errors.Interruption()
# look for a disconnection error | added some more logging if a query times out | orb-framework_orb | train | py |
9afe9f0c5c4815b96b986db8d9a60c32b59894f6 | diff --git a/advanced/slf4j/slf4j-backwardcompat/src/main/java/org/slf4j/impl/StaticGateway.java b/advanced/slf4j/slf4j-backwardcompat/src/main/java/org/slf4j/impl/StaticGateway.java
index <HASH>..<HASH> 100644
--- a/advanced/slf4j/slf4j-backwardcompat/src/main/java/org/slf4j/impl/StaticGateway.java
+++ b/advanced/slf4j/slf4j-backwardcompat/src/main/java/org/slf4j/impl/StaticGateway.java
@@ -51,7 +51,7 @@ class StaticGateway {
protected SLF4JServiceProvider getServiceProvider() {
if (this.provider == null) {
try {
- final Method meth = LoggerFactory.class.getMethod("getProvider"); //$NON-NLS-1$
+ final Method meth = LoggerFactory.class.getDeclaredMethod("getProvider"); //$NON-NLS-1$
meth.setAccessible(true);
this.provider = (SLF4JServiceProvider) meth.invoke(null);
} catch (Throwable exception) { | [slf4j] Fixing invalid access to the loger provider class. | gallandarakhneorg_afc | train | java |
8c695df9da2977e93918fc5ec6b832b7a9f89004 | diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Page/Page.php
+++ b/system/src/Grav/Common/Page/Page.php
@@ -139,6 +139,7 @@ class Page
}
}
$this->published();
+ $this->extension();
// $this->setupLanguage();
}
@@ -619,6 +620,15 @@ class Page
return null;
}
+ public function extension()
+ {
+ if (empty($this->extension)) {
+ $language = self::getGrav()['language'];
+ $this->extension = $language->getPageExtension();
+ }
+ return $this->extension;
+ }
+
/**
* Save page if there's a file assigned to it.
* @param bool $reorder Internal use.
@@ -822,7 +832,7 @@ class Page
$this->template = $var;
}
if (empty($this->template)) {
- $this->template = ($this->modular() ? 'modular/' : '') . str_replace(CONTENT_EXT, '', $this->name());
+ $this->template = ($this->modular() ? 'modular/' : '') . str_replace($this->extension, '', $this->name());
}
return $this->template;
} | fixed template name based on current lang | getgrav_grav | train | php |
1812d8bed560edcc0e8af93ec566c5f626bd5963 | diff --git a/lib/capybara/spec/session/headers.rb b/lib/capybara/spec/session/headers.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/spec/session/headers.rb
+++ b/lib/capybara/spec/session/headers.rb
@@ -1,8 +1,8 @@
shared_examples_for "session with headers support" do
describe '#response_headers' do
it "should return response headers" do
- @session.visit('/with_simple_html')
- @session.response_headers['Content-Type'].should == 'text/html'
+ @session.visit('/with_simple_html')
+ @session.response_headers['Content-Type'].should =~ %r(text/html)
end
end
end | Be less restrictive in session spec wrt content-type | teamcapybara_capybara | train | rb |
fde1b2f755fe489bdea22d91fc739955a3060952 | diff --git a/src/bundle/Controller/ContentTypeController.php b/src/bundle/Controller/ContentTypeController.php
index <HASH>..<HASH> 100644
--- a/src/bundle/Controller/ContentTypeController.php
+++ b/src/bundle/Controller/ContentTypeController.php
@@ -404,7 +404,7 @@ class ContentTypeController extends Controller
$languageCode = reset($this->languages);
foreach ($this->languages as $prioritizedLanguage) {
- if (isset($contentType->names[$prioritizedLanguage])) {
+ if (isset($contentTypeDraft->names[$prioritizedLanguage])) {
$languageCode = $prioritizedLanguage;
break;
} | EZP-<I>: Cannot edit Content Type after changing the main language of the "admin" siteaccess | ezsystems_ezplatform-admin-ui | train | php |
59fe8f69bbf3b1772d289174d9098e46ede813f9 | diff --git a/lib/config-mock-builder.js b/lib/config-mock-builder.js
index <HASH>..<HASH> 100644
--- a/lib/config-mock-builder.js
+++ b/lib/config-mock-builder.js
@@ -17,6 +17,9 @@ class ConfigMockBuilder {
}
this._mock = {
get: function() {},
+ _addProperties: (props) => {
+ return this.addProperties(props).mock;
+ },
_props: _clone(props)
};
_sinon.stub(this._mock, 'get', (propPath) => {
@@ -26,6 +29,25 @@ class ConfigMockBuilder {
return propPath.split('.').reduce(reducer, this._mock._props);
});
}
+ /**
+ * Adds additional config properties to the existing config store.
+ * These properties can then be retrieved as if they were a part
+ * of the config object ex: config.get('prop.path.name'). Any existing
+ * properties with the same name/path will be overwritten.
+ *
+ * @param {Object} props The properties to add to the config
+ *
+ * @return {Object} A reference to the builder - can be used for
+ * chaining.
+ */
+ addProperties(props) {
+ if(!props || (props instanceof Array) || typeof props !== 'object') {
+ throw new Error('Invalid properties specified (arg #1)');
+ }
+ this.mock._props = Object.assign(this.mock._props, props);
+
+ return this;
+ }
/**
* Gets a reference to the mock object represented by this class. | Add utility method to set config properties | vamship_wysknd-test | train | js |
4e3576e6bf2a18c0f1ecb54d951317679b2415a1 | diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php
index <HASH>..<HASH> 100644
--- a/src/View/Helper/FormHelper.php
+++ b/src/View/Helper/FormHelper.php
@@ -14,6 +14,8 @@ class FormHelper extends CakeFormHelper {
'error' => '<div class="text-danger">{{content}}</div>',
'inputContainer' => '<div class="form-group {{type}}{{required}}">{{content}}</div>',
'inputContainerError' => '<div class="form-group {{type}}{{required}} error">{{content}}{{error}}</div>',
+ 'formStart' => '<form{{attrs}}><div class="box-body">',
+ 'formEnd' => '</div></form>'
];
private $templates_horizontal = [ | FormHelper implements templates for biggest integration with theme | maiconpinto_cakephp-adminlte-theme | train | php |
34f7583f3f70b3e453fa67ed99a1f4ca3755ac57 | diff --git a/ngrest/PluginAbstract.php b/ngrest/PluginAbstract.php
index <HASH>..<HASH> 100644
--- a/ngrest/PluginAbstract.php
+++ b/ngrest/PluginAbstract.php
@@ -11,6 +11,36 @@ abstract class PluginAbstract
protected $ngModel = null;
+ public $options = [];
+
+ public function __construct(array $options = [])
+ {
+ foreach ($options as $key => $value) {
+ $this->options[$key] = $value;
+ }
+
+ $this->init();
+ }
+
+ public function init()
+ {
+
+ }
+
+ public function getOption($key)
+ {
+ return (isset($this->options[$key])) ? $this->options[$key] : false;
+ }
+
+ public function setOption($key, $value)
+ {
+ if (!$this->getOption($key)) {
+ throw new \Exception("The requested set key does not exists in options list");
+ }
+
+ $this->options[$key] = $value;
+ }
+
public function setConfig($id, $name, $ngModel, $alias)
{
$this->id = $id; | [*] moved ngrest plugin method into the abstraction class. | luyadev_luya-module-admin | train | php |
d05a889c966e48b33af609e06b14364bdc00b69b | diff --git a/drivers/exoscale/exoscale.go b/drivers/exoscale/exoscale.go
index <HASH>..<HASH> 100644
--- a/drivers/exoscale/exoscale.go
+++ b/drivers/exoscale/exoscale.go
@@ -367,8 +367,7 @@ func (d *Driver) Stop() error {
if err != nil {
return err
}
- _, err = d.waitForVM(client, svmresp)
- if err != nil {
+ if _, err = d.waitForVM(client, svmresp); err != nil {
return err
}
return nil
@@ -378,8 +377,7 @@ func (d *Driver) Remove() error {
client := egoscale.NewClient(d.URL, d.ApiKey, d.ApiSecretKey)
// Destroy the SSH key
- _, err := client.DeleteKeypair(d.KeyPair)
- if err != nil {
+ if _, err := client.DeleteKeypair(d.KeyPair); err != nil {
return err
}
@@ -409,8 +407,7 @@ func (d *Driver) Restart() error {
if err != nil {
return err
}
- _, err = d.waitForVM(client, svmresp)
- if err != nil {
+ if _, err = d.waitForVM(client, svmresp); err != nil {
return err
} | exoscale: simplify if/err pattern
Compact the if/err forms that can be compacted. | docker_machine | train | go |
9dd878d42d6a559cd0f94db79414f86a7d7550f2 | diff --git a/javascript/webdriver/webdriver.js b/javascript/webdriver/webdriver.js
index <HASH>..<HASH> 100644
--- a/javascript/webdriver/webdriver.js
+++ b/javascript/webdriver/webdriver.js
@@ -766,7 +766,7 @@ webdriver.WebDriver.prototype.getAllWindowHandles = function() {
webdriver.WebDriver.prototype.getPageSource = function() {
return this.schedule(
new webdriver.Command(webdriver.CommandName.GET_PAGE_SOURCE),
- 'WebDriver.getAllWindowHandles()');
+ 'WebDriver.getPageSource()');
}; | Fix tracing for `WebDriver#getPageSource`
The tracing for sending the `getPageSource` command instead identified the command as `getAllWindowHandles` | SeleniumHQ_selenium | train | js |
e9b106fe49e4c13a5e13bebd9094e8c69143a128 | diff --git a/lib/selectors/optimizers/advanced.js b/lib/selectors/optimizers/advanced.js
index <HASH>..<HASH> 100644
--- a/lib/selectors/optimizers/advanced.js
+++ b/lib/selectors/optimizers/advanced.js
@@ -97,10 +97,11 @@ AdvancedOptimizer.prototype.reduceNonAdjacent = function (tokens) {
if (token[0] != 'selector')
continue;
- var isComplexAndNotSpecial = token[1].length > 1 && !this.isSpecial(stringifySelector(token[1]));
+ var selectorAsString = stringifySelector(token[1]);
+ var isComplexAndNotSpecial = token[1].length > 1 && !this.isSpecial(selectorAsString);
var selectors = isComplexAndNotSpecial ?
- [stringifySelector(token[1])].concat(token[1]) :
- [stringifySelector(token[1])];
+ [selectorAsString].concat(token[1]) :
+ [selectorAsString];
for (var j = 0, m = selectors.length; j < m; j++) {
var selector = selectors[j]; | Adds small improvements to `reduceNonAdjacent` optimizer. | jakubpawlowicz_clean-css | train | js |
881f2502f93af46ff9f9fb018bf4a72e4adb7c6c | diff --git a/lib/chatwork/incoming_request.rb b/lib/chatwork/incoming_request.rb
index <HASH>..<HASH> 100644
--- a/lib/chatwork/incoming_request.rb
+++ b/lib/chatwork/incoming_request.rb
@@ -59,5 +59,10 @@ module ChatWork
def self.destroy(request_id:)
_delete("/incoming_requests/#{request_id}")
end
+
+ class << self
+ alias_method :approve, :update
+ alias_method :decline, :destroy
+ end
end
end | Add alias to IncomingRequest | asonas_chatwork-ruby | train | rb |
929c068637edaf93bfaa4858ccf579e323b9ba98 | diff --git a/www/src/py_import.js b/www/src/py_import.js
index <HASH>..<HASH> 100644
--- a/www/src/py_import.js
+++ b/www/src/py_import.js
@@ -562,6 +562,9 @@ finder_path.$dict = {
$B.path_importer_cache[path_entry] = _b_.None;
}
}
+ // Skip this path entry if finder turns out to be None
+ if (is_none(finder))
+ continue;
var spec = _b_.getattr(_b_.getattr(finder, 'find_spec'),
'__call__')(fullname, prev_module);
if (!is_none(spec)) { | [import] refs #<I> - Skip entries in python_importer_cache bound to None
... which is consistent with the scenario when sys.path_hooks iteration ends with no path entry finder being returned , see <URL> | brython-dev_brython | train | js |
4197243a23e07f0aafcd20b434d96a0d460e052b | diff --git a/tensorflow_probability/python/math/linalg.py b/tensorflow_probability/python/math/linalg.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/math/linalg.py
+++ b/tensorflow_probability/python/math/linalg.py
@@ -548,7 +548,7 @@ def lu_matrix_inverse(lower_upper, perm, validate_args=False, name=None):
This op is conceptually identical to,
- ````python
+ ```python
inv_X = tf.lu_matrix_inverse(*tf.linalg.lu(X))
tf.assert_near(tf.matrix_inverse(X), inv_X)
# ==> True | Fix documentation of lu_matrix_inverse, by fixing the number of backticks.
PiperOrigin-RevId: <I> | tensorflow_probability | train | py |
e23580d65dc84f417564c67f25f2fcb4c703dee7 | diff --git a/scsocket.js b/scsocket.js
index <HASH>..<HASH> 100644
--- a/scsocket.js
+++ b/scsocket.js
@@ -185,6 +185,7 @@ SCSocket.prototype._onSCClose = function (code, data) {
SCEmitter.prototype.emit.call(this, 'disconnect', code, data);
if (!SCSocket.ignoreStatuses[code]) {
+ var failureMessage;
if (data) {
failureMessage = 'Socket connection failed: ' + data;
} else { | Define `failureMessage` to comply with `strict` mode | SocketCluster_socketcluster-server | train | js |
3216ec9d47bbdf8d4fc27d22169ea86a6688bc15 | diff --git a/util.go b/util.go
index <HASH>..<HASH> 100644
--- a/util.go
+++ b/util.go
@@ -19,10 +19,10 @@ func BinaryBytes(o interface{}) []byte {
return w.Bytes()
}
-// o: a pointer to the object to be filled
-func ReadBinaryBytes(d []byte, o interface{}) error {
+// ptr: a pointer to the object to be filled
+func ReadBinaryBytes(d []byte, ptr interface{}) error {
r, n, err := bytes.NewBuffer(d), new(int), new(error)
- ReadBinaryPtr(o, r, 0, n, err)
+ ReadBinaryPtr(ptr, r, 0, n, err)
return *err
}
@@ -50,9 +50,9 @@ func JSONBytesPretty(o interface{}) []byte {
return jsonBytes
}
-// o: a pointer to the object to be filled
-func ReadJSONBytes(d []byte, o interface{}) (err error) {
- ReadJSONPtr(o, d, &err)
+// ptr: a pointer to the object to be filled
+func ReadJSONBytes(d []byte, ptr interface{}) (err error) {
+ ReadJSONPtr(ptr, d, &err)
return
} | Make arg be clear that it's ptr | tendermint_go-amino | train | go |
e205ca40f1476f8dce943693b85b4cce979fd78e | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -35,7 +35,7 @@ module.exports = {
if (err) { return callback(err) }
conn.getPeerInfo((err, peerInfo) => {
- encryptedConnection.setInnerConn(state.secure)
+ encryptedConnection.setInnerConn(new Connection(state.secure, conn))
if (err) { // no peerInfo yet, means I'm the receiver
encryptedConnection.setPeerInfo(new PeerInfo(state.id.remote)) | fix: cascading connection from encrypted connection to parent connection | libp2p_js-libp2p-secio | train | js |
03644249a8083ef9adb16eff4927cdf185671339 | diff --git a/models/classes/class.HttpBasicAuthAdapter.php b/models/classes/class.HttpBasicAuthAdapter.php
index <HASH>..<HASH> 100755
--- a/models/classes/class.HttpBasicAuthAdapter.php
+++ b/models/classes/class.HttpBasicAuthAdapter.php
@@ -1,4 +1,5 @@
<?php
+use oat\oatbox\user\LoginService;
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -56,7 +57,6 @@ class tao_models_classes_HttpBasicAuthAdapter
throw new common_Exception('Rest (Basic) login failed for user (missing login/password)');
}
- $authAdapter = new core_kernel_users_AuthAdapter($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
- return $authAdapter->authenticate();
+ return LoginService::authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
}
}
\ No newline at end of file | Connected httpAuthenticate to authentication service | oat-sa_tao-core | train | php |
0bab59d0eee318b52b32722668c42daf1aea63c4 | diff --git a/code/model/EventTicket.php b/code/model/EventTicket.php
index <HASH>..<HASH> 100644
--- a/code/model/EventTicket.php
+++ b/code/model/EventTicket.php
@@ -38,6 +38,9 @@ class EventTicket extends DataObject {
'Type'
);
+ private static $singular_name = "Ticket";
+ private static $plural_name = "Tickets";
+
public function getCMSFields() {
$fields = parent::getCMSFields(); | Added singular and plural names to EventTickets | registripe_registripe-core | train | php |
ee5ffbdcdcae444d2d3bc8c313e10f4c486f7ca9 | diff --git a/lib/enchanted_quill/label.rb b/lib/enchanted_quill/label.rb
index <HASH>..<HASH> 100644
--- a/lib/enchanted_quill/label.rb
+++ b/lib/enchanted_quill/label.rb
@@ -74,7 +74,12 @@ module EnchantedQuill
end
avoid_super_call = true
when UITouchPhaseCancelled
- @selected_element = nil
+ Dispatch::Queue.concurrent.after(0.1) do
+ Dispatch::Queue.main.async do
+ update_attributed_when_selected(false)
+ @selected_element = nil
+ end
+ end
when UITouchPhaseStationary
end | Fix uitouch cancellation bug
- The selected elements color would not change back to
the default color after a touch event had been cancelled. | sight-labs_enchanted_quill | train | rb |
a352c887bdcf146afa9a651539ca788a74777f49 | diff --git a/RestService/Server.php b/RestService/Server.php
index <HASH>..<HASH> 100644
--- a/RestService/Server.php
+++ b/RestService/Server.php
@@ -598,7 +598,7 @@ class Server
if (get_parent_class($this->controller) == '\RestService\Server') {
$this->controller->setClient($this->getClient());
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
throw new Exception('Error during initialisation of '.$pClassName.': '.$e);
}
} else { | Fixed typo `Exception` to `\Exception` | marcj_php-rest-service | train | php |
ab1b1b8de7663682acaf2ae872089aa8ed6d9673 | diff --git a/packages/styled-components/src/models/ThemeProvider.js b/packages/styled-components/src/models/ThemeProvider.js
index <HASH>..<HASH> 100644
--- a/packages/styled-components/src/models/ThemeProvider.js
+++ b/packages/styled-components/src/models/ThemeProvider.js
@@ -52,7 +52,7 @@ export default function ThemeProvider(props: Props) {
return (
<ThemeContext.Provider value={themeContext}>
- {React.Children.only(props.children)}
+ {props.children}
</ThemeContext.Provider>
);
} | Get rid of the ThemeProvider single child context restriction (#<I>)
We can get rid of that restriction because ThemeProvider uses
stable React Context API and children cannot be top-level element.
Fixes #<I>. | styled-components_styled-components | train | js |
5f96a8f7c8c01f300a2e0d465292a052166e3c4b | diff --git a/framework/widgets/LinkPager.php b/framework/widgets/LinkPager.php
index <HASH>..<HASH> 100644
--- a/framework/widgets/LinkPager.php
+++ b/framework/widgets/LinkPager.php
@@ -45,6 +45,7 @@ class LinkPager extends Widget
public $linkOptions = [];
/**
* @var string the CSS class for the each page button.
+ * @since 2.0.7
*/
public $pageCssClass = null;
/** | Update LinkPager.php
added missing `@since` annotation. | yiisoft_yii-core | train | php |
193bf25001ee325c985b7ae219e5626647e86a1a | diff --git a/interact.js b/interact.js
index <HASH>..<HASH> 100644
--- a/interact.js
+++ b/interact.js
@@ -51,7 +51,7 @@
selectors = {}, // all css selector interactables
selectorDZs = [], // all dropzone selector interactables
matches = [], // all selectors that are matched by target element
- delegatedEvents = {}, // { type: { selector: [listener1, listener2] } }
+ delegatedEvents = {}, // { type: { selector: [[listener, useCapture]} }
target = null, // current interactable being interacted with
dropTarget = null, // the dropzone a drag target might be dropped into | Fix comment describing delegatedEvents variable | taye_interact.js | train | js |
3f51459d38cb57e0f55ac4d679bd8b467ab62fe9 | diff --git a/lib/resque/job.rb b/lib/resque/job.rb
index <HASH>..<HASH> 100644
--- a/lib/resque/job.rb
+++ b/lib/resque/job.rb
@@ -80,15 +80,14 @@ module Resque
queue = "queue:#{queue}"
destroyed = 0
- redis.lrange(queue, 0, -1).each do |string|
- json = decode(string)
-
- match = json['class'] == klass
- match &= json['args'] == args unless args.empty?
-
- if match
- destroyed += redis.lrem(queue, 0, string).to_i
+ if args.empty?
+ redis.lrange(queue, 0, -1).each do |string|
+ if decode(string)['class'] == klass
+ destroyed += redis.lrem(queue, 0, string).to_i
+ end
end
+ else
+ destroyed += redis.lrem(queue, 0, encode(:class => klass, :args => args))
end
destroyed | This version of Job.destroy just uses LREM in the case that arguments are passed. In this case, the whole queue does not need to be passed to the client via LRANGE. | resque_resque | train | rb |
2730417e3aa8a8a8d93b122e165046ba7c3d997a | diff --git a/Kwf/Media/Output.php b/Kwf/Media/Output.php
index <HASH>..<HASH> 100644
--- a/Kwf/Media/Output.php
+++ b/Kwf/Media/Output.php
@@ -190,7 +190,7 @@ class Kwf_Media_Output
if (isset($headers['Range'])) {
$range = explode('=', $headers['Range']);
$range = explode('-', $range[1]);
- $ret['contents'] = self::getPartialFileContent($file['file'], $range);
+ $ret['contents'] = self::_getPartialFileContent($file['file'], $range);
$ret['contentLength'] = strlen($ret['contents']);
$ret['headers'][] = 'Content-Length: ' . $ret['contentLength'];
$ret['headers'][] = 'Content-Range: bytes ' . $range[0] . '-'
@@ -217,7 +217,7 @@ class Kwf_Media_Output
}
// returns the partial content from a file
- protected function getPartialFileContent($file, $range)
+ private static function _getPartialFileContent($file, $range)
{
$length = $range[1]-$range[0]+1; | make the function static and prefix it with _ | koala-framework_koala-framework | train | php |
dec7489f8a2ec7957a6703cadca4334deecf5071 | diff --git a/packages/app-forms/src/components/Form/FormRender.js b/packages/app-forms/src/components/Form/FormRender.js
index <HASH>..<HASH> 100644
--- a/packages/app-forms/src/components/Form/FormRender.js
+++ b/packages/app-forms/src/components/Form/FormRender.js
@@ -137,6 +137,7 @@ const FormRender = (props: FormRenderComponentPropsType) => {
}
const formSubmission = await createFormSubmission({
+ client,
props,
data,
reCaptchaResponseToken: reCaptchaResponseToken.current
diff --git a/packages/app-forms/src/components/Form/functions/createFormSubmission.js b/packages/app-forms/src/components/Form/functions/createFormSubmission.js
index <HASH>..<HASH> 100644
--- a/packages/app-forms/src/components/Form/functions/createFormSubmission.js
+++ b/packages/app-forms/src/components/Form/functions/createFormSubmission.js
@@ -11,7 +11,8 @@ type Args = {
};
export default async ({
- props: { data: form, client, preview },
+ client,
+ props: { data: form, preview },
data: rawData,
reCaptchaResponseToken
}: Args): Promise<FormSubmitResponseType> => { | fix: send client into createFormSubmission function | Webiny_webiny-js | train | js,js |
cd1958ee72c3b205ad67165de9470e55049f7781 | diff --git a/c7n/filters/iamaccess.py b/c7n/filters/iamaccess.py
index <HASH>..<HASH> 100644
--- a/c7n/filters/iamaccess.py
+++ b/c7n/filters/iamaccess.py
@@ -37,7 +37,7 @@ log = logging.getLogger('custodian.iamaccess')
def _account(arn):
# we could try except but some minor runtime cost, basically flag
# invalids values
- if ':' not in arn:
+ if arn.count(":") < 4:
return arn
return arn.split(':', 5)[4] | aws - cross-account filter - fix for non arn principals when determining account (#<I>) | cloud-custodian_cloud-custodian | train | py |
f14c11f1ccb1ad28771d1e40945c08abb2fda8b6 | diff --git a/src/samples/java/ex/FII_Sample.java b/src/samples/java/ex/FII_Sample.java
index <HASH>..<HASH> 100644
--- a/src/samples/java/ex/FII_Sample.java
+++ b/src/samples/java/ex/FII_Sample.java
@@ -41,6 +41,10 @@ public class FII_Sample {
return baubles.stream().map(Bauble::getName).filter(n -> n.equals(name)).findFirst().isPresent();
}
+ public Bauble get0OnCollect(List<Bauble> baubles) {
+ return baubles.stream().collect(Collectors.toList()).get(0);
+ }
+
public static class Bauble {
public String getName() { | add sample for calling get(0) on a collect | mebigfatguy_fb-contrib | train | java |
8d142d98f0a20db3de396203f0a1aebf619ae2a4 | diff --git a/examples/list_presence.py b/examples/list_presence.py
index <HASH>..<HASH> 100644
--- a/examples/list_presence.py
+++ b/examples/list_presence.py
@@ -69,7 +69,7 @@ def main(jid, password):
)
)
client.on_stream_established.connect(connected)
- client.on_stream_destroyed.connect(disconnected)
+ client.on_stopped.connect(disconnected)
collector = PresenceCollector()
diff --git a/examples/roster.py b/examples/roster.py
index <HASH>..<HASH> 100644
--- a/examples/roster.py
+++ b/examples/roster.py
@@ -46,7 +46,7 @@ def main(jid, password):
)
)
client.on_stream_established.connect(connected)
- client.on_stream_destroyed.connect(disconnected)
+ client.on_stopped.connect(disconnected)
fut = asyncio.Future()
diff --git a/examples/server_info.py b/examples/server_info.py
index <HASH>..<HASH> 100644
--- a/examples/server_info.py
+++ b/examples/server_info.py
@@ -46,7 +46,7 @@ def main(jid, password):
)
)
client.on_stream_established.connect(connected)
- client.on_stream_destroyed.connect(disconnected)
+ client.on_stopped.connect(disconnected)
disco = client.summon(aioxmpp.disco.Service) | Make use of synchronous shutdown in examples | horazont_aioxmpp | train | py,py,py |
21553c8a5aff8524608b283572955649d25a32b4 | diff --git a/controller.go b/controller.go
index <HASH>..<HASH> 100644
--- a/controller.go
+++ b/controller.go
@@ -738,7 +738,6 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
if network.configOnly {
network.scope = datastore.LocalScope
network.networkType = "null"
- network.ipamType = ""
goto addToStore
}
diff --git a/network.go b/network.go
index <HASH>..<HASH> 100644
--- a/network.go
+++ b/network.go
@@ -412,6 +412,9 @@ func (n *network) applyConfigurationTo(to *network) error {
}
}
}
+ if len(n.ipamType) != 0 {
+ to.ipamType = n.ipamType
+ }
if len(n.ipamOptions) > 0 {
to.ipamOptions = make(map[string]string, len(n.ipamOptions))
for k, v := range n.ipamOptions { | Removing the override for ipamdriver for local scope networks
The commit contains fix for the issue reported in
<URL> | docker_libnetwork | train | go,go |
4be00fbdb546d9edf83afb6c72c8e590ee4dbefa | diff --git a/keep/commands/cmd_pull.py b/keep/commands/cmd_pull.py
index <HASH>..<HASH> 100644
--- a/keep/commands/cmd_pull.py
+++ b/keep/commands/cmd_pull.py
@@ -20,7 +20,7 @@ def cli(ctx):
gist_url = f"https://gist.github.com/{token['gist']}"
prompt_str = f"[CRITICAL] Replace local commands with GitHub gist\nGist URL : {gist_url} ?"
if click.confirm(prompt_str, abort=True):
- os.remove(commands_file_path)
+ pass
"""Using `w+` so it create the file if doesn't exist (Issue #64)"""
with open(commands_file_path, 'w+') as commands_file: | hot-fix(pull) don’t remove the file just overwrite it
The bug in #<I> was in `os.remove` because the file didn’t exist so it couldn’t be removed, so I removed the `remove` because we overwrite the file anyway | OrkoHunter_keep | train | py |
4754121e1b2489cab128576bb788ee35d2e2b424 | diff --git a/src/python/pants/backend/project_info/tasks/export_dep_as_jar.py b/src/python/pants/backend/project_info/tasks/export_dep_as_jar.py
index <HASH>..<HASH> 100644
--- a/src/python/pants/backend/project_info/tasks/export_dep_as_jar.py
+++ b/src/python/pants/backend/project_info/tasks/export_dep_as_jar.py
@@ -168,7 +168,7 @@ class ExportDepAsJar(ConsoleTask):
predicate=lambda dep: dep not in modulizable_target_set,
work=lambda dep: dependencies_to_include.add(dep),
)
- return dependencies_to_include
+ return list(sorted(dependencies_to_include))
def _extract_arguments_with_prefix_from_zinc_args(self, args, prefix):
return [option[len(prefix):] for option in args if option.startswith(prefix)] | [export-dep-as-jar] Make library ordering deterministic (#<I>)
### Problem
The ordering of the `libraries` field in individual targets was not deterministic, causing flakiness.
### Solution
Replace the implementation of the field from a `set` to a `list`. Since this depends on a deterministic graph traversal, it should be deterministic now. | pantsbuild_pants | train | py |
aa8799cff847d2e5b258261c461dcb6413fcbac0 | diff --git a/python/bigdl/dllib/optim/optimizer.py b/python/bigdl/dllib/optim/optimizer.py
index <HASH>..<HASH> 100644
--- a/python/bigdl/dllib/optim/optimizer.py
+++ b/python/bigdl/dllib/optim/optimizer.py
@@ -135,6 +135,22 @@ class Poly(JavaValue):
JavaValue.__init__(self, None, bigdl_type, power, max_iteration)
+class Exponential(JavaValue):
+ """
+ [[Exponential]] is a learning rate schedule, which rescale the learning rate by
+ lr_{n + 1} = lr * decayRate `^` (iter / decayStep)
+ :param decay_step the inteval for lr decay
+ :param decay_rate decay rate
+ :param stair_case if true, iter / decayStep is an integer division
+ and the decayed learning rate follows a staircase function.
+
+ >>> exponential = Exponential(100, 0.1)
+ creating: createExponential
+ """
+ def __init__(self, decay_step, decay_rate, stair_case=False, bigdl_type="float"):
+ JavaValue.__init__(self, None, bigdl_type, decay_step, decay_rate, stair_case)
+
+
class Step(JavaValue):
"""
A learning rate decay policy, where the effective learning rate is | add Exponential learning rate decay (#<I>)
* add Exponential learning rate decay
* fix unit test | intel-analytics_BigDL | train | py |
67fce295a3fc769a41d6e95c1587f999e7af0f4b | diff --git a/lib/S2S/Router.js b/lib/S2S/Router.js
index <HASH>..<HASH> 100644
--- a/lib/S2S/Router.js
+++ b/lib/S2S/Router.js
@@ -79,6 +79,18 @@ Router.prototype.acceptConnection = function (socket) {
socket: socket
})
+ // send features supported by this domain
+ inStream.on('streamStart', function (attrs) {
+ inStream.fromDomain = nameprep(attrs.from)
+ inStream.toDomain = nameprep(attrs.to)
+ var credentials = self.getContext(inStream.toDomain).credentials
+ if (credentials) {
+ inStream.opts.tls = true
+ inStream.credentials = credentials
+ }
+ inStream.sendFeatures()
+ })
+
// incoming server wants to verify an outgoing connection of ours
inStream.on('dialbackVerify', function (from, to, id, key) {
from = nameprep(from)
diff --git a/lib/S2S/session/incoming.js b/lib/S2S/session/incoming.js
index <HASH>..<HASH> 100644
--- a/lib/S2S/session/incoming.js
+++ b/lib/S2S/session/incoming.js
@@ -35,8 +35,6 @@ util.inherits(IncomingServer, Server)
IncomingServer.prototype.streamStart = function (attrs) {
// call parent implementation
Server.prototype.streamStart.call(this, attrs)
-
- this.sendFeatures()
}
// overwrite onStanza from Server | Responds to incoming connections with TLS feature if credentials are provided for that domain | xmppjs_xmpp.js | train | js,js |
d37944f6a393a569047e0a2960a3429a158fa99a | diff --git a/lib/flor/unit/scheduler.rb b/lib/flor/unit/scheduler.rb
index <HASH>..<HASH> 100644
--- a/lib/flor/unit/scheduler.rb
+++ b/lib/flor/unit/scheduler.rb
@@ -508,8 +508,11 @@ module Flor
notify(nil, make_idle_message)
end
- sleep [ @heart_rate - (Time.now - t0), 0 ].max #\
- #unless should_wake_up?
+ if @idle_count < 1
+ sleep 0.001
+ else
+ sleep([ @heart_rate - (Time.now - t0), 0.001 ].max)
+ end
rescue Exception => ex | Let scheduler sleep only <I>s if @idle_count < 1
full suite:
4m <I>s ->
2m <I>s | floraison_flor | train | rb |
966da2f8715c82ba979003dad06aa01c0b59036b | diff --git a/widgets/SimpleNav.php b/widgets/SimpleNav.php
index <HASH>..<HASH> 100644
--- a/widgets/SimpleNav.php
+++ b/widgets/SimpleNav.php
@@ -23,10 +23,8 @@ class SimpleNav extends \yii\bootstrap\Widget
* - label: string, required, the nav item label.
* - url: optional, the item's URL. Defaults to "#".
* - visible: boolean, optional, whether this menu item is visible. Defaults to true.
- * - linkOptions: array, optional, the HTML attributes of the item's link.
- * - options: array, optional, the HTML attributes of the item container (LI).
+ * - options: array, optional, the HTML attributes of the item container (li).
* - active: boolean, optional, whether the item should be on active state or not.
- * - dropDownOptions: array, optional, the HTML options that will passed to the [[Dropdown]] widget.
* - items: array|string, optional, the configuration array for creating a [[Dropdown]] widget,
* or a string representing the dropdown menu. Note that Bootstrap does not support sub-dropdown menus.
*
@@ -94,6 +92,9 @@ class SimpleNav extends \yii\bootstrap\Widget
*/
protected function renderItem($item, $depth=0)
{
+ //visibility
+ if (isset($item['visible']) && $item['visible'] === false) return '';
+
//prepare options
$options = isset($item['options']) ? $item['options'] : [];
Html::addCssClass($options, 'depth-' . $depth); | minor extensions in SimpleNav-widget | asinfotrack_yii2-toolbox | train | php |
f267d3c0d45eb64fa4d11f83fd784fc9ef91ff4e | diff --git a/src/EventListener/ExceptionListener.php b/src/EventListener/ExceptionListener.php
index <HASH>..<HASH> 100644
--- a/src/EventListener/ExceptionListener.php
+++ b/src/EventListener/ExceptionListener.php
@@ -142,7 +142,7 @@ class ExceptionListener implements SentryExceptionListenerInterface
$this->client->captureException($exception, $data);
}
- private function shouldExceptionCaptureBeSkipped(\Exception $exception)
+ protected function shouldExceptionCaptureBeSkipped(\Exception $exception)
{
foreach ($this->skipCapture as $className) {
if ($exception instanceof $className) { | shouldExceptionCaptureBeSkipped method visibilty
Since `skipCapture` property is protected method `shouldExceptionCaptureBeSkipped` should also be protected.
Otherwise sometimes if class is extended it must be implemented by copy&paste. | getsentry_sentry-symfony | train | php |
8a2e737b88f897c86508c190eaad11a39e024126 | diff --git a/reflex.go b/reflex.go
index <HASH>..<HASH> 100644
--- a/reflex.go
+++ b/reflex.go
@@ -34,7 +34,7 @@ var (
globalConfig = &Config{}
reflexID = 0
- stdout = make(chan OutMsg, 100)
+ stdout = make(chan OutMsg, 1)
cleanupMut = &sync.Mutex{}
) | Avoid magic buffered chan size | cespare_reflex | train | go |
ec73c67d4d74fb407331e0302e78617f25ae79e1 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -30,6 +30,7 @@ use oat\taoQtiTest\scripts\install\SetSynchronisationService;
use oat\taoQtiTest\scripts\install\SetupEventListeners;
use oat\taoQtiTest\scripts\install\SyncChannelInstaller;
use oat\taoQtiTest\scripts\install\SetLinearNextItemWarningConfig;
+use oat\taoQtiTest\scripts\install\RegisterFrontendPaths;
$extpath = dirname(__FILE__).DIRECTORY_SEPARATOR;
$taopath = dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'tao'.DIRECTORY_SEPARATOR;
@@ -78,7 +79,7 @@ return array(
RegisterTestContainer::class,
SetUpQueueTasks::class,
SetLinearNextItemWarningConfig::class,
- \oat\taoQtiTest\scripts\install\RegisterFrontendPaths::class
+ RegisterFrontendPaths::class
)
),
'update' => 'oat\\taoQtiTest\\scripts\\update\\Updater', | include namespace of registerFrontendPath | oat-sa_extension-tao-testqti | train | php |
618a8622b57ed6fff246e900a881fe9bb2f127c9 | diff --git a/src/Resources/contao/DompdfIgniter.php b/src/Resources/contao/DompdfIgniter.php
index <HASH>..<HASH> 100755
--- a/src/Resources/contao/DompdfIgniter.php
+++ b/src/Resources/contao/DompdfIgniter.php
@@ -118,6 +118,7 @@ class DompdfIgniter extends \Frontend
// Generate DOMPDF object
$options = new Options();
$options->set('isRemoteEnabled', true);
+ $options->set('isHtml5ParserEnabled', true);
$dompdf = new Dompdf($options);
$dompdf->setPaper('A4', 'portrait');
$dompdf->loadHtml($strHtml); | Fix less than symbol problem
see <URL> | w3scout_contao-dompdf-bundle | train | php |
c782ac809c3f907046c80338f55083576c079e42 | diff --git a/storage/sql/migrate.go b/storage/sql/migrate.go
index <HASH>..<HASH> 100644
--- a/storage/sql/migrate.go
+++ b/storage/sql/migrate.go
@@ -205,7 +205,7 @@ var migrations = []migration{
{
stmts: []string{`
alter table offline_session
- add column connector_data bytea not null default '';
+ add column connector_data bytea;
`,
},
}, | Remove defaulting from connector_data column | dexidp_dex | train | go |
e540fa824b01f5e809d988a4585c628b71574d77 | diff --git a/util/watcher.go b/util/watcher.go
index <HASH>..<HASH> 100644
--- a/util/watcher.go
+++ b/util/watcher.go
@@ -155,6 +155,18 @@ func (wd *WatchData) poll(w *Watcher) {
continue
}
+ // If the query metadata is nil, return an error instead of panicing. See
+ // (GH-72) for more information. This does not actually "fix" the issue,
+ // which appears to be a bug in armon/consul-api, but will at least give a
+ // nicer error message to the user and help us better trace this issue.
+ if qm == nil {
+ err := fmt.Errorf("consul returned nil qm; this should never happen" +
+ "and is probably a bug in consul-template or consulapi")
+ log.Printf("[ERR] (%s) %s", wd.Display(), err)
+ w.ErrCh <- err
+ continue
+ }
+
// Consul is allowed to return even if there's no new data. Ignore data if
// the index is the same. For files, the data is fake, index is always 0
if qm.LastIndex == wd.lastIndex { | Do not panic if qm is nil | hashicorp_consul-template | train | go |
cef2e5c28ac8e278d4cbd843e4ddbaf2542e1ce3 | diff --git a/perception/image.py b/perception/image.py
index <HASH>..<HASH> 100644
--- a/perception/image.py
+++ b/perception/image.py
@@ -80,8 +80,11 @@ def imresize(image, size, interp="nearest"):
else:
raise ValueError("Invalid type for size \"{}\".".format(type(size)))
- return skt.resize(image, output_shape, order=skt_interp_map[interp])
-
+ return skt.resize(image,
+ output_shape,
+ order=skt_interp_map[interp],
+ anti_aliasing=False,
+ mode="constant")
class Image(object):
"""Abstract wrapper class for images. | Added anti-aliasing and mode based on ambi-core. | BerkeleyAutomation_perception | train | py |
3be779e0a133446aaf752e8e64099622968fcbe8 | diff --git a/src/crypto/crypto.js b/src/crypto/crypto.js
index <HASH>..<HASH> 100644
--- a/src/crypto/crypto.js
+++ b/src/crypto/crypto.js
@@ -101,7 +101,7 @@ export default {
/**
* Decrypts data using specified algorithm and private key parameters.
- * See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms.
+ * See {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 5.5.3}
* @param {module:enums.publicKey} algo Public key algorithm
* @param {Array<module:type/mpi|
module:type/oid|
@@ -123,7 +123,7 @@ export default {
const d = key_params[2].toBN(); // de = 1 mod (p-1)(q-1)
const p = key_params[3].toBN();
const q = key_params[4].toBN();
- const u = key_params[5].toBN(); // q^-1 mod p
+ const u = key_params[5].toBN(); // p^-1 mod q
return publicKey.rsa.decrypt(c, n, e, d, p, q, u);
}
case enums.publicKey.elgamal: { | Fix comment describing RSA coefficient u (#<I>) | openpgpjs_openpgpjs | train | js |
ff2b98f73851abaa93d28550841e4ce0d3a1d072 | diff --git a/lib/specjour/formatter.rb b/lib/specjour/formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/specjour/formatter.rb
+++ b/lib/specjour/formatter.rb
@@ -3,7 +3,7 @@ module Specjour
include Colors
# description, status [pending,failed,passed] file_path, line_number, exception => [class, message, backtrace]
- STATUSES = Hash.new({char: "?", color: :white}).merge!(
+ STATUSES = Hash.new({char: "?", color: :cyan}).merge!(
"passed" => {char: ".", color: :green},
"failed" => {char: "F", color: :red},
"error" => {char: "E", color: :magenta}, | Change white default color for cyan
Cyan has a higher chance of showing up on a light or dark background | sandro_specjour | train | rb |
7217868bf9f4c02d820c23334b8582cb86b3d3e2 | diff --git a/src/main/resources/META-INF/resources/primefaces/core/core.js b/src/main/resources/META-INF/resources/primefaces/core/core.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/META-INF/resources/primefaces/core/core.js
+++ b/src/main/resources/META-INF/resources/primefaces/core/core.js
@@ -231,6 +231,9 @@ PrimeFaces.ajax.AjaxRequest = function(cfg, ext) {
return; //cancel request
}
}
+
+ //block ui
+ $('body').append('<div class="ui-block" style="background-color:transparent;margin:0;position:absolute;top:0;left:0;height:100%;width:100%;z-index:1000"></div>');
var form = null;
if(cfg.formId) {
@@ -358,6 +361,9 @@ PrimeFaces.ajax.AjaxRequest = function(cfg, ext) {
cfg.oncomplete.call(this, xhr, status, this.args);
}
+ //unblock
+ $('body').children('.ui-block').remove();
+
PrimeFaces.debug('Response completed.');
PrimeFaces.ajax.RequestManager.poll(); | Block UI with an invisible mask during ajax requests | primefaces_primefaces | train | js |
388d6cb9833cbdc4a3e5c75e950ba83d9d062694 | diff --git a/pkg/build/builder/dockerutil.go b/pkg/build/builder/dockerutil.go
index <HASH>..<HASH> 100644
--- a/pkg/build/builder/dockerutil.go
+++ b/pkg/build/builder/dockerutil.go
@@ -46,6 +46,7 @@ var (
"no route to host",
"unexpected end of JSON input",
"i/o timeout",
+ "TLS handshake timeout",
}
) | Add TLS timeout to build image operations retriable errors | openshift_origin | train | go |
03c5fd083328d342b535c94ce48948d2c39decce | diff --git a/src/main/com/mongodb/MongoOptions.java b/src/main/com/mongodb/MongoOptions.java
index <HASH>..<HASH> 100644
--- a/src/main/com/mongodb/MongoOptions.java
+++ b/src/main/com/mongodb/MongoOptions.java
@@ -34,7 +34,7 @@ public class MongoOptions {
connectionsPerHost = Bytes.CONNECTIONS_PER_HOST;
threadsAllowedToBlockForConnectionMultiplier = 5;
maxWaitTime = 1000 * 60 * 2;
- connectTimeout = 0;
+ connectTimeout = 1000 * 10;
socketTimeout = 0;
socketKeepAlive = false;
autoConnectRetry = false;
@@ -118,9 +118,9 @@ public class MongoOptions {
public int maxWaitTime;
/**
- * The connection timeout in milliseconds.
+ * The connection timeout in milliseconds. A value of 0 means no timeout.
* It is used solely when establishing a new connection {@link java.net.Socket#connect(java.net.SocketAddress, int) }
- * Default is 0 and means no timeout.
+ * Default is 10,000.
*/
public int connectTimeout; | JAVA-<I> change connection timeout default from unlimited to <I> sec. | mongodb_mongo-java-driver | train | java |
8f8ff3f4463f08dbff7bb2f213c8f6fd156e515a | diff --git a/rapidoid-web/src/main/java/org/rapidoid/goodies/discovery/DiscoveryRegistrationHandler.java b/rapidoid-web/src/main/java/org/rapidoid/goodies/discovery/DiscoveryRegistrationHandler.java
index <HASH>..<HASH> 100644
--- a/rapidoid-web/src/main/java/org/rapidoid/goodies/discovery/DiscoveryRegistrationHandler.java
+++ b/rapidoid-web/src/main/java/org/rapidoid/goodies/discovery/DiscoveryRegistrationHandler.java
@@ -23,6 +23,7 @@ package org.rapidoid.goodies.discovery;
import org.rapidoid.RapidoidThing;
import org.rapidoid.annotation.Authors;
import org.rapidoid.annotation.Since;
+import org.rapidoid.http.NiceResponse;
import org.rapidoid.http.Req;
import org.rapidoid.http.ReqHandler;
@@ -43,7 +44,7 @@ public class DiscoveryRegistrationHandler extends RapidoidThing implements ReqHa
PeerDiscoveryInfo info = new PeerDiscoveryInfo(req.clientIpAddress(), req.realIpAddress());
state.clients.get(scope).add(info);
- return "OK";
+ return NiceResponse.ok(req, "Successfully registered for discovery");
}
} | Returning appropriate response upon registration in discovery. | rapidoid_rapidoid | train | java |
fb049b2a2306dcb305caa29907efad5ab7a37adf | diff --git a/pkg/fab/chconfig/chconfig.go b/pkg/fab/chconfig/chconfig.go
index <HASH>..<HASH> 100644
--- a/pkg/fab/chconfig/chconfig.go
+++ b/pkg/fab/chconfig/chconfig.go
@@ -381,6 +381,9 @@ func loadConfig(configItems *ChannelCfg, versionsGroup *common.ConfigGroup, grou
return nil
}
+ versionsGroup.Version = group.Version
+ versionsGroup.ModPolicy = group.ModPolicy
+
groups := group.GetGroups()
if groups != nil {
versionsGroup.Groups = make(map[string]*common.ConfigGroup) | [FABG-<I>] copy more fields when extract chConf
Version/ModPolicy are ignored when extracting channel config and building
response. Fields initialized with default values. | hyperledger_fabric-sdk-go | train | go |
faeb58a18163dbcd8da9ac3944f8533c1581db4a | diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js
@@ -92,7 +92,9 @@ define([
}
}
window.removeEventListener("message", _messageHandler, false); //$NON-NLS-0$
- iframe.parentNode.removeChild(iframe);
+ if (delegatedParent.parentNode) {
+ delegatedParent.parentNode.removeChild(delegatedParent);
+ }
}
}
}, false); | Bug <I> - Edit command delegated UI leaves behind div's that can cause extra scroll bars | eclipse_orion.client | train | js |
1f4d6cf8d5b1ca8ac235a4abf20507ac19abbfa4 | diff --git a/src/main/java/com/googlecode/lanterna/gui/component/TextArea.java b/src/main/java/com/googlecode/lanterna/gui/component/TextArea.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/googlecode/lanterna/gui/component/TextArea.java
+++ b/src/main/java/com/googlecode/lanterna/gui/component/TextArea.java
@@ -218,7 +218,7 @@ public class TextArea extends AbstractInteractableComponent
break;
case End:
- scrollTopIndex = lines.size() - lastSize.getRows();
+ scrollTopIndex = Math.max(0, lines.size() - lastSize.getRows());
break;
default: | Issue <I> fix, contributed by dboitnot, "If the text area does not have enough lines to fill itself and the user presses the End key, repaint() will fail with ArrayIndexOutOfBoundsException" | mabe02_lanterna | train | java |
809d2383642c0751c7abc8fc224f9090a0c7745d | diff --git a/lntest/itest/lnd_channel_backup_test.go b/lntest/itest/lnd_channel_backup_test.go
index <HASH>..<HASH> 100644
--- a/lntest/itest/lnd_channel_backup_test.go
+++ b/lntest/itest/lnd_channel_backup_test.go
@@ -987,6 +987,33 @@ func testChanRestoreScenario(t *harnessTest, net *lntest.NetworkHarness,
)
require.NoError(t.t, err)
+ // We now need to make sure the server is fully started before we can
+ // actually close the channel. This is the first check in CloseChannel
+ // so we can try with a nil channel point until we get the correct error
+ // to find out if Dave is fully started.
+ err = wait.Predicate(func() bool {
+ const expectedErr = "must specify channel point"
+ ctxc, cancel := context.WithCancel(ctxt)
+ defer cancel()
+
+ resp, err := dave.CloseChannel(
+ ctxc, &lnrpc.CloseChannelRequest{},
+ )
+ if err != nil {
+ return false
+ }
+
+ defer func() { _ = resp.CloseSend() }()
+
+ _, err = resp.Recv()
+ if err != nil && strings.Contains(err.Error(), expectedErr) {
+ return true
+ }
+
+ return false
+ }, defaultTimeout)
+ require.NoError(t.t, err)
+
// We also want to make sure we cannot force close in this state. That
// would get the state machine in a weird state.
chanPointParts := strings.Split( | itest: wait for server to start when restoring
To avoid running into the "server is still starting" error when trying
to close a channel, we first wait for the error to disappear before we
try closing the actual channel. | lightningnetwork_lnd | train | go |
5a4c2757133f4b3460904625f5b625f8159090f9 | diff --git a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/annotation/SleuthSpanCreatorAspectMonoTests.java b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/annotation/SleuthSpanCreatorAspectMonoTests.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/annotation/SleuthSpanCreatorAspectMonoTests.java
+++ b/spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/annotation/SleuthSpanCreatorAspectMonoTests.java
@@ -48,7 +48,7 @@ import static reactor.core.publisher.Mono.just;
@SpringBootTest(classes = SleuthSpanCreatorAspectMonoTests.TestConfiguration.class)
@RunWith(SpringRunner.class)
-@DirtiesContext
+@DirtiesContext(methodMode = DirtiesContext.MethodMode.BEFORE_METHOD)
public class SleuthSpanCreatorAspectMonoTests {
@Autowired | Trying to make tests less brittle | spring-cloud_spring-cloud-sleuth | train | java |
09a353f33158eaf9bcc0474bf45b5fb6177b2402 | diff --git a/holoviews/core/options.py b/holoviews/core/options.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/options.py
+++ b/holoviews/core/options.py
@@ -795,7 +795,7 @@ class StoreOptions(object):
A collection of utilities for advanced users for creating and
setting customized option tress on the Store. Designed for use by
either advanced users or the %opts line and cell magics which use
- this machinery to operate.
+ this machinery.
"""
@classmethod
@@ -868,6 +868,23 @@ class StoreOptions(object):
" a tree with id %d" % new_id)
obj.traverse(lambda o: setattr(o, 'id', new_id), specs=set(applied_keys))
+ @classmethod
+ def capture_ids(cls, obj):
+ """
+ Given an list of ids, capture a list of ids that can be
+ restored using the restore_ids.
+ """
+ return obj.traverse(lambda o: getattr(o, 'id'))
+
+ @classmethod
+ def restore_ids(cls, obj, ids):
+ """
+ Given an list of ids as captured with capture_ids, restore the
+ ids. Note the structure of an object must not change between
+ the calls to capture_ids and restore_ids.
+ """
+ ids = iter(ids)
+ obj.traverse(lambda o: setattr(o, 'id', ids.next())) | Added capture_ids and restore_ids methods to StoreOptions | pyviz_holoviews | train | py |
b460a7a00d91e3ad95f80b575d206f3fab0a1d07 | diff --git a/savepagenow/__init__.py b/savepagenow/__init__.py
index <HASH>..<HASH> 100644
--- a/savepagenow/__init__.py
+++ b/savepagenow/__init__.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-from api import capture, capture_or_cache, CachedPage
+from .api import capture, capture_or_cache, CachedPage
__version__ = "0.0.6" | . on the import might help Py3 | pastpages_savepagenow | train | py |
664674a966b0e315d7a96321dcee5971e0219dd6 | diff --git a/core/renderMiddleware.js b/core/renderMiddleware.js
index <HASH>..<HASH> 100644
--- a/core/renderMiddleware.js
+++ b/core/renderMiddleware.js
@@ -649,7 +649,23 @@ function writeBody(req, res, context, start, page) {
Q.all(dfds.map(dfd => dfd.promise)).then(retval.resolve);
- setTimeout(() => retval.reject("Timed out rendering"), timeRemaining);
+ setTimeout(() => {
+ // give some additional information when we time out
+ retval.reject({
+ message: "Timed out rendering.",
+ // `timeRemaining` is how long we waited before timing out
+ timeWaited: timeRemaining,
+ elements: rendered.map(val => {
+ if (val === ELEMENT_ALREADY_WRITTEN) {
+ return 'W'; // written
+ } else if (val === ELEMENT_PENDING) {
+ return 'P'; // not rendered
+ } else {
+ return 'R'; // rendered, not yet written
+ }
+ }),
+ });
+ }, timeRemaining);
return retval.promise;
} | Fixed: PLAT-<I> - add more information when render timeout occurs
(cherry picked from commit e<I>dbfcf<I>df0fa<I>eadb<I>d1a<I>) | redfin_react-server | train | js |
1cae191d6c06f21015e8e08f24ccc4f091e36cb1 | diff --git a/core/src/test/java/com/orientechnologies/orient/core/storage/index/sbtree/multivalue/v3/CellBTreeMultiValueV3TestIT.java b/core/src/test/java/com/orientechnologies/orient/core/storage/index/sbtree/multivalue/v3/CellBTreeMultiValueV3TestIT.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/com/orientechnologies/orient/core/storage/index/sbtree/multivalue/v3/CellBTreeMultiValueV3TestIT.java
+++ b/core/src/test/java/com/orientechnologies/orient/core/storage/index/sbtree/multivalue/v3/CellBTreeMultiValueV3TestIT.java
@@ -48,8 +48,8 @@ public class CellBTreeMultiValueV3TestIT {
@After
public void afterMethod() {
-// orientDB.drop(DB_NAME);
-// orientDB.close();
+ orientDB.drop(DB_NAME);
+ orientDB.close();
}
@Test | Issue #<I>: small fixes of CellBTreeMultiValueV3 IT test | orientechnologies_orientdb | train | java |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.