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
|
---|---|---|---|---|---|
6a5fcdf92e20e75b4cbf213913ba76210d40efe4 | diff --git a/src/main/java/water/api/ImportS3.java b/src/main/java/water/api/ImportS3.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/api/ImportS3.java
+++ b/src/main/java/water/api/ImportS3.java
@@ -65,17 +65,9 @@ public class ImportS3 extends Request {
}
}
- boolean isBareS3BucketWithoutTrailingSlash(String s) {
- Pattern p = Pattern.compile("s3://[^/]*");
- Matcher m = p.matcher(s);
- boolean b = m.matches();
- return b;
- }
-
@Override
protected Response serve() {
String bucket = _bucket.value();
- if (isBareS3BucketWithoutTrailingSlash(bucket)) { bucket = bucket + "/"; }
Log.info("ImportS3 processing (" + bucket + ")");
JsonObject json = new JsonObject();
JsonArray succ = new JsonArray(); | Interesting, it turns out we only want to add the trailing slash
for S3N, not for S3.
So remove that last change for the S3 case. | h2oai_h2o-2 | train | java |
e038b080385b37eb3cbd9cc324f1e11aa0a10066 | diff --git a/glue/pipeline.py b/glue/pipeline.py
index <HASH>..<HASH> 100644
--- a/glue/pipeline.py
+++ b/glue/pipeline.py
@@ -880,6 +880,8 @@ class CondorDAG:
for node in self.__nodes:
if isinstance(node, LSCDataFindNode):
pass
+ elif ( len(node._CondorDAGNode__parents) == 1 ) and isinstance(node._CondorDAGNode__parents[0], LSCDataFindNode):
+ pass
else:
child_id = node_name_id_dict[str(node)]
if node._CondorDAGNode__parents: | don't add empty lscdatafind parent relationships to the dax | gwastro_pycbc-glue | train | py |
29bc40833a14fb02bfc049714d6899093473eb7b | diff --git a/lib/bliss.rb b/lib/bliss.rb
index <HASH>..<HASH> 100644
--- a/lib/bliss.rb
+++ b/lib/bliss.rb
@@ -11,4 +11,5 @@ require 'bliss/format'
require 'bliss/encoding_error'
require 'bliss/parser_machine'
+require 'bliss/parser_machine_builder'
require 'bliss/parser' | Added require line for ParserMachineBuilder | krakatoa_bliss | train | rb |
7235091496c93c1a455925f6c14c1460f28f1a6a | diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/zaxxer/hikari/HikariConfig.java
+++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java
@@ -416,6 +416,10 @@ public final class HikariConfig implements HikariConfigMBean
logger.error("one of either dataSource or dataSourceClassName must be specified");
throw new IllegalStateException("one of either dataSource or dataSourceClassName must be specified");
}
+ else if (dataSource != null && dataSourceClassName != null)
+ {
+ logger.warn("both dataSource and dataSourceClassName are specified, ignoring dataSourceClassName");
+ }
if (idleTimeout < 0)
{ | Comment #<I> added additional warning if both dataSource and dataSourceClassName are specified. | brettwooldridge_HikariCP | train | java |
5ee721424620db14646f2883fa2f3fab972f298c | diff --git a/src/OpenCartTest.php b/src/OpenCartTest.php
index <HASH>..<HASH> 100644
--- a/src/OpenCartTest.php
+++ b/src/OpenCartTest.php
@@ -40,16 +40,16 @@ class OpenCartTest extends TestCase
public static function loadConfiguration()
{
- if (!isset($_ENV['OC_ROOT'])) {
+ if (!getenv('OC_ROOT')) {
throw new \Exception('OC_ROOT environment variable needs to be set');
}
// Path needs / at the end
- if (substr($_ENV['OC_ROOT'], -1) != DIRECTORY_SEPARATOR) {
- $_ENV['OC_ROOT'] .= DIRECTORY_SEPARATOR;
+ if (substr(getenv('OC_ROOT'), -1) != DIRECTORY_SEPARATOR) {
+ putenv('OC_ROOT='.DIRECTORY_SEPARATOR);
}
- $config_path = $_ENV['OC_ROOT'] . (self::isAdmin() === false ? '' : 'admin/') . 'config.php';
+ $config_path = getenv('OC_ROOT') . (self::isAdmin() === false ? '' : 'admin/') . 'config.php';
if (file_exists($config_path)) {
require_once($config_path); | Removed directly access to $_ENV | beyondit_opencart-test-suite | train | php |
d27b2dd7402b2b6d39ae1f2218f7e5869c67496a | diff --git a/lib/caracal/document.rb b/lib/caracal/document.rb
index <HASH>..<HASH> 100644
--- a/lib/caracal/document.rb
+++ b/lib/caracal/document.rb
@@ -98,7 +98,7 @@ module Caracal
render_settings(zip)
render_styles(zip)
render_document(zip)
- render_relationships(zip) # do this last: document renderer registers relationships
+ render_relationships(zip) # do this last: DocumentRenderer registers relationships
end
end | Moved render_relationships to wait for all relationships to be registered. | trade-informatics_caracal | train | rb |
d8247de17cfd9cdea0a3bef572fa2d89410adada | diff --git a/chess/svg.py b/chess/svg.py
index <HASH>..<HASH> 100644
--- a/chess/svg.py
+++ b/chess/svg.py
@@ -146,7 +146,7 @@ def board(board: Optional[chess.BaseBoard] = None, *,
coordinates: bool = True,
lastmove: Optional[chess.Move] = None,
check: Optional[chess.Square] = None,
- arrows: Iterable[Union[Arrow, Tuple[chess.Square, chess.Square]]] = (),
+ arrows: Iterable[Union[Arrow, Tuple[chess.Square, chess.Square]]] = [],
size: Optional[int] = None,
style: Optional[str] = None) -> str:
""" | Fix default value from () to []
The default value of the 'arrows' argument of chess.svg.board() function can not be an empty tuple, it must be an empty list, since the 'arrows' argument accepts a list of tuples. So, I think, we should fix that. | niklasf_python-chess | train | py |
7b4e193ba6da8627ceb25a1c3dde0ec8c55b8a19 | diff --git a/lib/module.js b/lib/module.js
index <HASH>..<HASH> 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -219,7 +219,8 @@ function require(path) {
exists: function (request) {
var paths = this.filePaths;
for (var i = 0; i < paths.length; i++) {
- if (Module._files[paths[i] + request] !== undefined) {
+ //if (Module._files[paths[i] + request] !== undefined) {
+ if (Module._findFile(paths[i] + request)) {
return true;
}
}
@@ -227,10 +228,14 @@ function require(path) {
},
getFilename: function (request) {
- var paths = this.filePaths;
+ var filename, paths = this.filePaths;
for (var i = 0; i < paths.length; i++) {
- if (Module._files[paths[i] + request] !== undefined) {
- return (paths[i] + request);
+ //if (Module._files[paths[i] + request] !== undefined) {
+ // return (paths[i] + request);
+ //}
+ filename = Module._findFile(paths[i] + request);
+ if (filename) {
+ return filename;
}
}
return null; | Change _NativeModule.exists/getFilename to call _findFile (to handle .js file and module directory). | tyskdm_codegs | train | js |
79d7c24b0a89911a72772140945e77f13f70b2f4 | diff --git a/test/functional/regression_missing_module_type.py b/test/functional/regression_missing_module_type.py
index <HASH>..<HASH> 100644
--- a/test/functional/regression_missing_module_type.py
+++ b/test/functional/regression_missing_module_type.py
@@ -6,7 +6,7 @@ def decor(trop):
""" decorator """
return trop
-class Foo:
+class Foo(object):
""" Class """
@decor
def prop(self): | Avoid old-style-class for Python 2. | PyCQA_pylint | train | py |
dd0c53158f1be446c9be3c9d5996af1a22dec69b | diff --git a/superset/cli.py b/superset/cli.py
index <HASH>..<HASH> 100755
--- a/superset/cli.py
+++ b/superset/cli.py
@@ -46,7 +46,12 @@ feature_flags.update(config.FEATURE_FLAGS)
feature_flags_func = config.GET_FEATURE_FLAGS_FUNC
if feature_flags_func:
# pylint: disable=not-callable
- feature_flags = feature_flags_func(feature_flags)
+ try:
+ feature_flags = feature_flags_func(feature_flags)
+ except Exception: # pylint: disable=broad-except
+ # bypass any feature flags that depend on context
+ # that's not available
+ pass
def normalize_token(token_name: str) -> str: | fix: handle context-dependent feature flags in CLI (#<I>) | apache_incubator-superset | train | py |
a874f34ef439cf2f76fc193ade7cb530f5d00e79 | diff --git a/spyderlib/widgets/qscieditor.py b/spyderlib/widgets/qscieditor.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/qscieditor.py
+++ b/spyderlib/widgets/qscieditor.py
@@ -1436,12 +1436,18 @@ class QsciEditor(TextEditBaseWidget):
def dragEnterEvent(self, event):
"""Reimplement Qt method
Inform Qt about the types of data that the widget accepts"""
- event.ignore()
+ if event.mimeData().hasText():
+ super(QsciEditor, self).dragEnterEvent(event)
+ else:
+ event.ignore()
def dropEvent(self, event):
"""Reimplement Qt method
Unpack dropped data and handle it"""
- event.ignore()
+ if event.mimeData().hasText():
+ super(QsciEditor, self).dropEvent(event)
+ else:
+ event.ignore()
#=============================================================================== | Editor widget/bugfix: Drag'n drop inside a QsciEditor was not working following recent change (to fix bad behaviour on GNU/Linux) | spyder-ide_spyder | train | py |
bb337dc7783ddb03efeaeffa693160c97cf73511 | diff --git a/lib/authtrail.rb b/lib/authtrail.rb
index <HASH>..<HASH> 100644
--- a/lib/authtrail.rb
+++ b/lib/authtrail.rb
@@ -29,12 +29,15 @@ module AuthTrail
success: success,
failure_reason: failure_reason,
user: user,
- context: "#{request.params[:controller]}##{request.params[:action]}",
ip: request.remote_ip,
user_agent: request.user_agent,
referrer: request.referrer
}
+ if request.params[:controller]
+ info[:context] = "#{request.params[:controller]}##{request.params[:action]}"
+ end
+
# if exclude_method throws an exception, default to not excluding
exclude = AuthTrail.exclude_method && AuthTrail.safely(default: false) { AuthTrail.exclude_method.call(info) } | Handle missing controller better [skip ci] | ankane_authtrail | train | rb |
383bdad7ddcb6e5bdf43d1b15876756d7871534e | diff --git a/restapi.go b/restapi.go
index <HASH>..<HASH> 100644
--- a/restapi.go
+++ b/restapi.go
@@ -776,12 +776,17 @@ func (s *Session) GuildMemberMove(guildID, userID, channelID string) (err error)
// GuildMemberNickname updates the nickname of a guild member
// guildID : The ID of a guild
// userID : The ID of a user
+// userID : The ID of a user or "@me" which is a shortcut of the current user ID
func (s *Session) GuildMemberNickname(guildID, userID, nickname string) (err error) {
data := struct {
Nick string `json:"nick"`
}{nickname}
+ if userID == "@me" {
+ userID += "/nick"
+ }
+
_, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, ""))
return
} | Add support for @me in GuildMemberNickname (#<I>) | bwmarrin_discordgo | train | go |
c9df3d59eabf9955fd73756ffbb1ee2b76a0b18e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -78,7 +78,7 @@ setup(
url=AUTHOR_URL,
platforms=['any'],
license='MIT License',
- packages=find_packages(exclude=['tests', 'tests.*', 'docs', 'docs.*']),
+ packages=find_packages(exclude=['test', 'test.*', 'docs', 'docs.*']),
include_package_data=True,
zip_safe=False,
install_requires=install_requires, | -Fix: Typo in setup.py was causing unwanted files to be installed.
We really don't need our tests to be installed when we install libzfs... | Xaroth_libzfs-python | train | py |
6a89fb8e35ccc030769151c35a84eaa5b98c4dda | diff --git a/edelphi/src/main/typescript/webpack.config.js b/edelphi/src/main/typescript/webpack.config.js
index <HASH>..<HASH> 100644
--- a/edelphi/src/main/typescript/webpack.config.js
+++ b/edelphi/src/main/typescript/webpack.config.js
@@ -28,7 +28,15 @@ module.exports = {
use: ['style-loader', 'css-loader', 'less-loader']
},
{
- test: /\.jpe?g$|\.gif$|\.png$|\.ttf$|\.eot$|\.svg$/,
+ test: /\.scss$/,
+ use: [ "style-loader", "css-loader", "sass-loader"]
+ },
+ {
+ test: /\.png$/,
+ loader: "url-loader?mimetype=image/png"
+ },
+ {
+ test: /\.jpe?g$|\.gif$|\.ttf$|\.eot$|\.svg$/,
use: 'file-loader?name=[name].[ext]?[hash]'
},
{ | Added support for png and scss files into webpack | Metatavu_edelphi | train | js |
bd6a9bf487f1d6086a704c97fad465c16827aa8d | diff --git a/lib/Doctrine/Common/Version.php b/lib/Doctrine/Common/Version.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Common/Version.php
+++ b/lib/Doctrine/Common/Version.php
@@ -34,7 +34,7 @@ class Version
/**
* Current Doctrine Version.
*/
- const VERSION = '2.5.0-BETA1';
+ const VERSION = '2.5.0-DEV';
/**
* Compares a Doctrine version with the current one. | Bumping version to <I>-DEV | doctrine_common | train | php |
f1503b9b29a32b00dce74d0cf4bf96f4e2b510ce | diff --git a/src/RemoteServiceProvider.php b/src/RemoteServiceProvider.php
index <HASH>..<HASH> 100755
--- a/src/RemoteServiceProvider.php
+++ b/src/RemoteServiceProvider.php
@@ -23,6 +23,9 @@ class RemoteServiceProvider extends ServiceProvider
*/
protected $defer = true;
+ /**
+ * Boot the Service Provider
+ */
public function boot()
{
$this->publishes([
@@ -39,7 +42,7 @@ class RemoteServiceProvider extends ServiceProvider
*/
public function register()
{
- $this->app->bindShared('remote', function ($app) {
+ $this->app->singleton('remote', function ($app) {
return new RemoteManager($app);
});
} | Fixing deprecated method calls | LaravelCollective_remote | train | php |
e723f0736f13c9eb8bbab507b4aaf633666812ef | diff --git a/controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java b/controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java
index <HASH>..<HASH> 100644
--- a/controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java
+++ b/controller-client/src/main/java/org/jboss/as/controller/client/helpers/Operations.java
@@ -231,7 +231,7 @@ public class Operations {
* @return the operation
*/
public static ModelNode createReadResourceOperation(final ModelNode address) {
- return createReadResourceOperation(address, false);
+ return createOperation(READ_RESOURCE_OPERATION, address);
}
/** | [WFCORE-<I>] Do not set the recursive attribute on the read-resource operation if not explicitly defined. | wildfly_wildfly-core | train | java |
8ae92d5b2045549dbdf2f812c64e7dff7a627aee | diff --git a/tests/test_core.py b/tests/test_core.py
index <HASH>..<HASH> 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -983,6 +983,8 @@ def test_dict2schema():
assert schema.fields["id"].required
if MARSHMALLOW_VERSION_INFO[0] < 3:
assert schema.opts.strict is True
+ else:
+ assert schema.opts.register is False
# Regression test for https://github.com/marshmallow-code/webargs/issues/101
diff --git a/webargs/core.py b/webargs/core.py
index <HASH>..<HASH> 100755
--- a/webargs/core.py
+++ b/webargs/core.py
@@ -51,12 +51,14 @@ def dict2schema(dct):
`Fields <marshmallow.fields.Field>`.
"""
attrs = dct.copy()
- if MARSHMALLOW_VERSION_INFO[0] < 3:
- class Meta(object):
+ class Meta(object):
+ if MARSHMALLOW_VERSION_INFO[0] < 3:
strict = True
+ else:
+ register = False
- attrs["Meta"] = Meta
+ attrs["Meta"] = Meta
return type(str(""), (ma.Schema,), attrs) | Pass register=False on marshmallow 3 | marshmallow-code_webargs | train | py,py |
fb906e39644a0fb3b981ac53fab2fff3f50f782f | diff --git a/lib/linux_admin/version.rb b/lib/linux_admin/version.rb
index <HASH>..<HASH> 100644
--- a/lib/linux_admin/version.rb
+++ b/lib/linux_admin/version.rb
@@ -1,3 +1,3 @@
class LinuxAdmin
- VERSION = "0.5.5"
+ VERSION = "0.5.6"
end | Bumping version to <I> | ManageIQ_linux_admin | train | rb |
664a8c94235f56ecea327c981195e5c8a12e0152 | diff --git a/src/Entity/DateTimeType.php b/src/Entity/DateTimeType.php
index <HASH>..<HASH> 100644
--- a/src/Entity/DateTimeType.php
+++ b/src/Entity/DateTimeType.php
@@ -47,7 +47,7 @@ final class DateTimeType extends AbstractType implements DatabaseTypeInterface,
*/
public function __toString()
{
- return $this->value()->format('c');
+ return ($this->value() === null) ? null : $this->value()->format('c');
}
/**
diff --git a/src/Entity/DateType.php b/src/Entity/DateType.php
index <HASH>..<HASH> 100644
--- a/src/Entity/DateType.php
+++ b/src/Entity/DateType.php
@@ -47,7 +47,7 @@ final class DateType extends AbstractType implements DatabaseTypeInterface, Sche
*/
public function __toString()
{
- return $this->value()->format('Y-m-d');
+ return ($this->value() === null) ? null : $this->value()->format('Y-m-d');
}
/** | add null check in __toString for Date types | ixocreate_type-package | train | php,php |
c56c1422ca7e9e77dc422a2dd3628c28fc75c977 | diff --git a/js/southxchange.js b/js/southxchange.js
index <HASH>..<HASH> 100644
--- a/js/southxchange.js
+++ b/js/southxchange.js
@@ -71,9 +71,10 @@ module.exports = class southxchange extends Exchange {
},
},
'commonCurrencies': {
- 'SMT': 'SmartNode',
- 'MTC': 'Marinecoin',
'BHD': 'Bithold',
+ 'GHOST': 'GHOSTPRISM',
+ 'MTC': 'Marinecoin',
+ 'SMT': 'SmartNode',
},
});
} | southxchange GHOSTPRISM mapping | ccxt_ccxt | train | js |
5a988822f5bdba985f7ac37f1d6d864680e87d82 | diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/globalCommands.js
@@ -755,7 +755,7 @@ define([
tooltip: messages["System Config Tooltip"],
id: "orion.configDetailsPage", //$NON-NLS-0$
hrefCallback: function () {
- return require.toUrl("help/about.html"); //$NON-NLS-0$
+ return require.toUrl("about/about.html"); //$NON-NLS-0$
}
}); | change /help/about.html to about/about.html | eclipse_orion.client | train | js |
26ad025705cb0be7ab7ac0429b53f07bb2b3b6fc | diff --git a/pkg/metrics/publish.go b/pkg/metrics/publish.go
index <HASH>..<HASH> 100644
--- a/pkg/metrics/publish.go
+++ b/pkg/metrics/publish.go
@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"net/http"
+ "runtime"
"strings"
"time"
@@ -86,6 +87,8 @@ func sendUsageStats() {
report := map[string]interface{}{
"version": version,
"metrics": metrics,
+ "os": runtime.GOOS,
+ "arch": runtime.GOARCH,
}
statsQuery := m.GetSystemStatsQuery{} | feat: added os to stats | grafana_grafana | train | go |
004bb96bd9ec02caa5c02fca813aea48ee8838f5 | diff --git a/tests/utils/helpers.py b/tests/utils/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/utils/helpers.py
+++ b/tests/utils/helpers.py
@@ -960,6 +960,7 @@ def get_hazard_job(cfg, username=None):
def random_location_generator(min_x=-180, max_x=180, min_y=-90, max_y=90):
+ rnd = random.Random()
return shapely.geometry.Point(
- (min_x + random.random() * (max_x - min_x),
- min_y + random.random() * (max_y - min_y)))
+ rnd.randint(min_x, max_x),
+ rnd.randint(min_y, max_y)) | tests/utils/helpers:
Random locations sometimes cause test failures, because WKB is not
a good way to compare location. At a certain level of precision, two
different numbers will have the same WKB.
This random data causes _random_ test failures. This should stabilize
it.
Former-commit-id: c<I>b<I>fe2b<I>af5b6c<I>bc<I>c5e7e8d<I>a5 | gem_oq-engine | train | py |
bbac9b5c3a6c6dd8bd6dc1c9c325636dbb285982 | diff --git a/vendor/k8s.io/kubernetes/test/e2e/common/pods.go b/vendor/k8s.io/kubernetes/test/e2e/common/pods.go
index <HASH>..<HASH> 100644
--- a/vendor/k8s.io/kubernetes/test/e2e/common/pods.go
+++ b/vendor/k8s.io/kubernetes/test/e2e/common/pods.go
@@ -523,7 +523,13 @@ var _ = framework.KubeDescribe("Pods", func() {
continue
}
if msg[0] != 1 {
- framework.Failf("Got message from server that didn't start with channel 1 (STDOUT): %v", msg)
+ if len(msg) == 1 {
+ // skip an empty message on stream other than stdout
+ continue
+ } else {
+ framework.Failf("Got message from server that didn't start with channel 1 (STDOUT): %v", msg)
+ }
+
}
buf.Write(msg[1:])
} | UPSTREAM: <I>: tests: e2e: empty msg from channel other than stdout should be non-fatal | openshift_origin | train | go |
256bc7c8a289c47e839ae6f277bedaec8b66bd45 | diff --git a/monitors.go b/monitors.go
index <HASH>..<HASH> 100644
--- a/monitors.go
+++ b/monitors.go
@@ -66,6 +66,7 @@ type Monitor struct {
Query *string `json:"query,omitempty"`
Name *string `json:"name,omitempty"`
Message *string `json:"message,omitempty"`
+ State *string `json:"overall_state,omitempty"`
Tags []string `json:"tags"`
Options *Options `json:"options,omitempty"`
} | Add monitor state to monitor results
This allows one to use the api to trigger actions based on a monitor in
'Alert' status, as an example | zorkian_go-datadog-api | train | go |
5900f04399c512ff05eb5eb81fa026ce67e32371 | diff --git a/packages/ember-testing/lib/adapters/qunit.js b/packages/ember-testing/lib/adapters/qunit.js
index <HASH>..<HASH> 100644
--- a/packages/ember-testing/lib/adapters/qunit.js
+++ b/packages/ember-testing/lib/adapters/qunit.js
@@ -1,5 +1,5 @@
+import { inspect } from 'ember-utils';
import Adapter from './adapter';
-import { inspect } from 'ember-metal';
/**
This class implements the methods defined by Ember.Test.Adapter for the | Refactor ember-utils imports in ember-testing package. | emberjs_ember.js | train | js |
7ed8bd553b9ee0508c6a29b21367bda9ee9aa9b0 | diff --git a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php
index <HASH>..<HASH> 100644
--- a/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php
+++ b/tests/ProxyManagerTest/Functional/LazyLoadingGhostFunctionalTest.php
@@ -325,6 +325,10 @@ class LazyLoadingGhostFunctionalTest extends PHPUnit_Framework_TestCase
$this->assertSame('property0', $reflectionProperty->getValue($proxy));
}
+ /**
+ * @group 159
+ * @group 192
+ */
public function testMultiLevelPrivatePropertiesDefaultsWillBePreserved()
{
$instance = new ClassWithCollidingPrivateInheritedProperties();
@@ -343,6 +347,10 @@ class LazyLoadingGhostFunctionalTest extends PHPUnit_Framework_TestCase
$this->assertSame('property0', $parentProperty->getValue($proxy));
}
+ /**
+ * @group 159
+ * @group 192
+ */
public function testMultiLevelPrivatePropertiesByRefInitialization()
{
$class = ClassWithCollidingPrivateInheritedProperties::class; | Adding missing `@group` annotations | Ocramius_ProxyManager | train | php |
f9e3531ec2c9fa412009ce56ba4cd6df6cd8e7fc | diff --git a/src/cnczPush.py b/src/cnczPush.py
index <HASH>..<HASH> 100644
--- a/src/cnczPush.py
+++ b/src/cnczPush.py
@@ -44,17 +44,24 @@ class CnczPushRH(BaseHTTPRequestHandler):
data = json.loads(raw_data)
occ = {}
for pc, state in data['data'].iteritems():
+ expect_session = False
if state['status'] == 'offline':
s = 'o'
elif state['status'] == 'free':
s = 'f'
+ expect_session = True
+ elif state['status'] == 'used':
+ s = 'u'
+ expect_session = True
elif state['status'] == 'unknown':
- s = '?'
+ s = 'x'
if hasattr(state, 'session'):
if state['session'] == 'windows':
s = 'w' + s
elif state['session'] == 'linux':
s = 'l' + s
+ elif expect_session:
+ s = 'w' + s # XXX
occ[pc] = s
self.server._push(occ, data.get('datasource', 'unknown'))
self.l.info("Pushed %s entries; source %s" % (len(data['data']), | cnczPush: fix the transformation of state | bwesterb_tkbd | train | py |
aba4a7c7ea118c8ee07671c51cbae6d2ea07ee70 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,6 @@ exts = [
include_dirs=includes),
Extension("spacy.lexeme", ["spacy/lexeme.pyx"], language="c++",
include_dirs=includes),
- Extension("spacy.ptb3", ["spacy/ptb3.pyx"], language="c++", include_dirs=includes),
Extension("spacy.en", ["spacy/en.pyx"], language="c++",
include_dirs=includes),
Extension("spacy.tokens", ["spacy/tokens.pyx"], language="c++", | * Remove ptb3 file from setup | explosion_spaCy | train | py |
48cdaccf6fc235a0901f6230143fc720245f8704 | diff --git a/lib/quadrigacx/client/private.rb b/lib/quadrigacx/client/private.rb
index <HASH>..<HASH> 100644
--- a/lib/quadrigacx/client/private.rb
+++ b/lib/quadrigacx/client/private.rb
@@ -58,7 +58,7 @@ module QuadrigaCX
# Returns JSON list of details about 1 or more orders.
#
- # id – a single or array of 64 characters long hexadecimal string taken from the list of orders
+ # id – a single or array of 64 characters long hexadecimal string taken from the list of orders.
def lookup_order params={}
request(:post, '/lookup_order', params)
end | add period to be consistent with other docs | mhluska_quadrigacx | train | rb |
4b3b7dae10edca5242b2fd78546e1b8d178524ae | diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Validator/Constraint.php
+++ b/src/Symfony/Component/Validator/Constraint.php
@@ -69,7 +69,7 @@ abstract class Constraint
/**
* Returns the name of the given error code.
*
- * @param int $errorCode The error code
+ * @param string $errorCode The error code
*
* @return string The name of the error code
* | [Validator] Fixing inaccurate typehint in docblock
As of Symfony <I>, constraint errors are now string UUIDs rather than integers. The corresponding docblock typehint in getErrorName() should reflect this change. | symfony_symfony | train | php |
affeff4f0e134ed1175f9a950c2ba72477b44778 | diff --git a/src/Dashboard/UpdateDashboard.php b/src/Dashboard/UpdateDashboard.php
index <HASH>..<HASH> 100644
--- a/src/Dashboard/UpdateDashboard.php
+++ b/src/Dashboard/UpdateDashboard.php
@@ -431,6 +431,10 @@ class UpdateDashboard
{
$ext = pathinfo($dados['favicon'], PATHINFO_EXTENSION);
$name = pathinfo($dados['favicon'], PATHINFO_FILENAME);
+
+ Helper::createFolderIfNoExist(PATH_HOME . "uploads");
+ Helper::createFolderIfNoExist(PATH_HOME . "uploads/site");
+
$fav = \WideImage\WideImage::load(PATH_HOME . $dados['favicon']);
$fav->resize(256, 256)->saveToFile(PATH_HOME . "uploads/site/{$name}-256.{$ext}");
$fav->resize(192, 192)->saveToFile(PATH_HOME . "uploads/site/{$name}-192.{$ext}"); | create folder uploads/site if not exist | edineibauer_dashboard | train | php |
bbba9f486a7e7a8e1b72f0f0e7b220a4d8cb12f3 | diff --git a/examples.py b/examples.py
index <HASH>..<HASH> 100644
--- a/examples.py
+++ b/examples.py
@@ -196,7 +196,7 @@ def animated_marker():
@example
def counter_and_timer():
- widgets = ['Processed: ', progressbar.Counter(),
+ widgets = ['Processed: ', progressbar.Counter('Counter: %(value)05d'),
' lines (', progressbar.Timer(), ')']
bar = progressbar.ProgressBar(widgets=widgets)
for i in bar((i for i in range(15))): | explained #<I> a bit | WoLpH_python-progressbar | train | py |
c066762ddf03ffb010d5c11ae5efa0900312e7ec | diff --git a/src/Repository/BaseRepository.php b/src/Repository/BaseRepository.php
index <HASH>..<HASH> 100644
--- a/src/Repository/BaseRepository.php
+++ b/src/Repository/BaseRepository.php
@@ -3,7 +3,7 @@
namespace GraphAware\Neo4j\OGM\Repository;
use Doctrine\Common\Collections\ArrayCollection;
-use GraphAware\Common\Result\RecordViewInterface;
+use GraphAware\Common\Result\Record;
use GraphAware\Common\Type\Node;
use GraphAware\Common\Result\Result;
use GraphAware\Neo4j\OGM\Manager;
@@ -154,10 +154,10 @@ class BaseRepository
return $entities;
}
- public function hydrate(RecordViewInterface $record)
+ public function hydrate(Record $record)
{
$reflClass = new \ReflectionClass($this->className);
- $baseInstance = $this->hydrateNode($record->value('n'));
+ $baseInstance = $this->hydrateNode($record->get('n'));
foreach ($this->classMetadata->getAssociations() as $key => $association) {
if (null !== $record->value($key)) {
if ($association->getCollection()) { | reflected last changes from client interfaces | graphaware_neo4j-php-ogm | train | php |
f9d4055fe8a82c6f400923e91ad3c446d78daf77 | diff --git a/app/lib/staypuft/seeder.rb b/app/lib/staypuft/seeder.rb
index <HASH>..<HASH> 100644
--- a/app/lib/staypuft/seeder.rb
+++ b/app/lib/staypuft/seeder.rb
@@ -145,11 +145,11 @@ module Staypuft
:services => [:neutron_networker] },
{ :name => 'Cinder Block Storage',
:class => [],
- :layouts => [[:ha_nova, 2], [:ha_neutron, 2], [:non_ha_nova, 2], [:non_ha_neutron, 2]],
+ :layouts => [],
:services => [:cinder_node] },
{ :name => 'Swift Storage Node',
:class => [],
- :layouts => [[:ha_nova, 5], [:ha_neutron, 5], [:non_ha_nova, 5], [:non_ha_neutron, 5]],
+ :layouts => [],
:services => [:swift] },
{ :name => 'HA Controller',
:class => [], | removed cinder/swift nodes from the layouts | theforeman_staypuft | train | rb |
42c07ff71f6cbcdccbd6eeb116fc023e251f073a | diff --git a/lib/howitzer/utils/capybara_settings.rb b/lib/howitzer/utils/capybara_settings.rb
index <HASH>..<HASH> 100644
--- a/lib/howitzer/utils/capybara_settings.rb
+++ b/lib/howitzer/utils/capybara_settings.rb
@@ -26,7 +26,7 @@ module CapybaraSettings
when :selenium_dev
Capybara.register_driver :selenium_dev do |app|
profile = base_ff_profile_settings
- vendor_dir = ENV['HOWITZER_VENDOR_DIR'] || File.join(File.dirname(__FILE__), '..', 'vendor')
+ vendor_dir = settings.custom_vendor_dir || File.join(File.dirname(__FILE__), '..', 'vendor')
raise "Vendor directory was not found('#{vendor_dir}')." unless Dir.exist?(vendor_dir)
%w(firebug.xpi firepath.xpi).each do |file_name|
full_path = File.expand_path(file_name, vendor_dir) | Replaced env variable with sexy_settings | strongqa_howitzer | train | rb |
ddcfd8b5baa1436735160e7d8e961f27fb43d816 | diff --git a/pypodio2/transport.py b/pypodio2/transport.py
index <HASH>..<HASH> 100644
--- a/pypodio2/transport.py
+++ b/pypodio2/transport.py
@@ -62,8 +62,7 @@ class OAuthAppAuthorization(object):
headers = {'content-type': 'application/x-www-form-urlencoded'}
response, data = h.request(domain + "/oauth/token", "POST",
urlencode(body), headers=headers)
- if response['status'] == '200':
- self.token = OAuthToken(_handle_response(response, data))
+ self.token = OAuthToken(_handle_response(response, data))
def __call__(self):
return self.token.to_headers() | Fixed OAuthAppAuthorization not throwing TransportException on bad credentials | podio_podio-py | train | py |
675f551123dd4c08683f8d9540174f6045120315 | diff --git a/wct.conf.js b/wct.conf.js
index <HASH>..<HASH> 100644
--- a/wct.conf.js
+++ b/wct.conf.js
@@ -33,17 +33,17 @@ module.exports = {
registerHooks: function(context) {
const saucelabsPlatformsMobile = [
- 'iOS Simulator/[email protected]',
- 'iOS Simulator/[email protected]'
+ 'iOS Simulator/[email protected]',
+ 'iOS Simulator/[email protected]'
];
const saucelabsPlatformsMicrosoft = [
- 'Windows 10/microsoftedge@17',
+ 'Windows 10/microsoftedge@18',
'Windows 10/internet explorer@11'
];
const saucelabsPlatformsDesktop = [
- 'macOS 10.13/[email protected]'
+ 'macOS 10.13/safari@latest'
];
const saucelabsPlatforms = [
@@ -56,14 +56,15 @@ module.exports = {
{
deviceName: 'Android GoogleAPI Emulator',
platformName: 'Android',
- platformVersion: '7.1',
+ platformVersion: '8.1',
browserName: 'chrome'
},
- 'iOS Simulator/[email protected]',
+ 'iOS Simulator/[email protected]',
'iOS Simulator/[email protected]',
'Windows 10/chrome@latest',
'Windows 10/firefox@latest'
];
+
if (env === 'saucelabs') {
context.options.plugins.sauce.browsers = saucelabsPlatforms;
} else if (env === 'saucelabs-cron') { | Update browser versions (#<I>)
- Align it with element skeleton
- Sauce labs dropped Safari 9 | vaadin_vaadin-app-layout | train | js |
cfe81dbf97b39b6fd649b098036164a27b56b46e | diff --git a/cts/index/settings_test.go b/cts/index/settings_test.go
index <HASH>..<HASH> 100644
--- a/cts/index/settings_test.go
+++ b/cts/index/settings_test.go
@@ -73,6 +73,7 @@ func TestSettings(t *testing.T) {
ResponseFields: opt.ResponseFields("hits", "hitsPerPage"),
MaxFacetHits: opt.MaxFacetHits(100),
IndexLanguages: opt.IndexLanguages("ja"),
+ UserData: opt.UserData(map[string]interface{}{"customUserData": 42.0}),
}
{ | test: set Settings.UserData field in Settings integration test | algolia_algoliasearch-client-go | train | go |
b804e1ab526c2ed6086f1382b29200e614f0d4ca | diff --git a/command/agent/user_event.go b/command/agent/user_event.go
index <HASH>..<HASH> 100644
--- a/command/agent/user_event.go
+++ b/command/agent/user_event.go
@@ -157,6 +157,11 @@ func (a *Agent) shouldProcessUserEvent(msg *UserEvent) bool {
}
if msg.ServiceFilter != "" {
+ // Handle "consul" service on server nodes
+ if a.server != nil && msg.ServiceFilter == "consul" {
+ return true
+ }
+
re, err := regexp.Compile(msg.ServiceFilter)
if err != nil {
a.logger.Printf("[ERR] agent: Failed to parse service filter '%s' for event '%s': %v", | agent: Allow 'consul' service to be targeted for events. Fixes #<I> | hashicorp_consul | train | go |
ab8b6ed75f27820ce2711d597838584fe68e62ef | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,13 +3,18 @@
import os
from distutils.core import setup
+description = 'Cmdlet provides pipe-like mechanism to cascade functions and generators.'
filepath = os.path.dirname(__file__)
readme_file = os.path.join(filepath, 'README.md')
-try:
- import pypandoc
- long_description = pypandoc.convert(readme_file, 'rst')
-except(IOError, ImportError):
- long_description = open(readme_file).read()
+
+if not os.path.exist(readme_file):
+ long_description = description
+else:
+ try:
+ import pypandoc
+ long_description = pypandoc.convert(readme_file, 'rst')
+ except(IOError, ImportError):
+ long_description = open(readme_file).read()
def extract_version(filename):
import re
@@ -31,7 +36,7 @@ setup(
name = 'cmdlet',
packages = ['cmdlet'],
version = version,
- description = 'Cmdlet provides pipe-like mechanism to cascade functions and generators.',
+ description = description,
long_description=long_description,
author = 'Gary Lee',
author_email = '[email protected]', | Use short description if README.md not found. | GaryLee_cmdlet | train | py |
9a6c6bcd987a0a1cdf057d738d406cfc8b14ae3c | diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js
index <HASH>..<HASH> 100644
--- a/js/views/inbox_view.js
+++ b/js/views/inbox_view.js
@@ -53,8 +53,8 @@
showCompose: function() {
this.$fab.hide();
this.$contacts.hide();
- this.newConversationView.$el.show();
this.newConversationView.reset();
+ this.newConversationView.$el.show();
this.$back.show();
},
hideCompose: function() { | Reset the typahead before showing it | ForstaLabs_librelay-node | train | js |
68684f94e604dd5b097b6dbb5e9732186b73862e | diff --git a/src/pivot.js b/src/pivot.js
index <HASH>..<HASH> 100644
--- a/src/pivot.js
+++ b/src/pivot.js
@@ -14,7 +14,7 @@ var root = module.exports = function(yasr) {
if (options.useD3Chart) {
try {
var d3 = require('d3');
- if (d3) require('../node_modules/pivottable/dist/d3_renderers.js');
+ if (d3) require('pivottable/dist/d3_renderers.js');
} catch (e) {
//do nothing. just make sure we don't use this renderer
}
@@ -166,7 +166,7 @@ var root = module.exports = function(yasr) {
require('./gChartLoader.js')
.on('done', function() {
try {
- require('../node_modules/pivottable/dist/gchart_renderers.js');
+ require('pivottable/dist/gchart_renderers.js');
$.extend(true, $.pivotUtilities.renderers, $.pivotUtilities.gchart_renderers);
} catch (e) {
//hmm, still something went wrong. forget about it;
@@ -277,4 +277,4 @@ root.defaults = {
root.version = {
"YASR-rawResponse": require("../package.json").version,
"jquery": $.fn.jquery,
-};
\ No newline at end of file
+}; | fixed relative path include to included lib | OpenTriply_YASGUI.YASR | train | js |
1bb2f18e031d5b3481b1381d7264e6ddd6df7cd7 | diff --git a/lib/tus/info.rb b/lib/tus/info.rb
index <HASH>..<HASH> 100644
--- a/lib/tus/info.rb
+++ b/lib/tus/info.rb
@@ -74,7 +74,7 @@ module Tus
hash = Hash[pairs]
hash.each do |key, value|
- hash[key] = Base64.decode64(value)
+ hash[key] = value && Base64.decode64(value) || ''
end
hash
diff --git a/lib/tus/server.rb b/lib/tus/server.rb
index <HASH>..<HASH> 100644
--- a/lib/tus/server.rb
+++ b/lib/tus/server.rb
@@ -228,7 +228,7 @@ module Tus
upload_metadata.split(",").each do |string|
key, value = string.split(" ")
- error!(400, "Invalid Upload-Metadata header") if key.nil? || value.nil?
+ error!(400, "Invalid Upload-Metadata header") if key.nil?
error!(400, "Invalid Upload-Metadata header") if key.ord > 127
error!(400, "Invalid Upload-Metadata header") if key =~ /,| / | It allows to pass empty string as metadata value | janko_tus-ruby-server | train | rb,rb |
00797b612b56a129200d9b74fbe4397ec5e27b92 | diff --git a/tests/Maker/MakeEntityTest.php b/tests/Maker/MakeEntityTest.php
index <HASH>..<HASH> 100644
--- a/tests/Maker/MakeEntityTest.php
+++ b/tests/Maker/MakeEntityTest.php
@@ -32,13 +32,15 @@ class MakeEntityTest extends MakerTestCase
->preRun(function (MakerTestRunner $runner) use ($withDatabase) {
$config = $runner->readYaml('config/packages/doctrine.yaml');
- if (isset($config['doctrine']['orm']['mappings']['App']['type']) && $this->useAttributes($runner)) {
- // use attributes
- $runner->replaceInFile(
- 'config/packages/doctrine.yaml',
- 'type: annotation',
- 'type: attribute'
- );
+ /* @legacy Refactor when annotations are no longer supported. */
+ if (isset($config['doctrine']['orm']['mappings']['App']) && !$this->useAttributes($runner)) {
+ // Attributes are only supported w/ PHP 8, FrameworkBundle >=5.2,
+ // ORM >=2.9, & DoctrineBundle >=2.4
+ $runner->modifyYamlFile('config/packages/doctrine.yaml', function (array $data) {
+ $data['doctrine']['orm']['mappings']['App']['type'] = 'annotation';
+
+ return $data;
+ });
}
if ($withDatabase) { | [ci] use annotations when attributes are not supported | symfony_maker-bundle | train | php |
7d1abe0086332c2b10e8c1357d2c612887aa606d | diff --git a/src/Http/ApiResponse.php b/src/Http/ApiResponse.php
index <HASH>..<HASH> 100644
--- a/src/Http/ApiResponse.php
+++ b/src/Http/ApiResponse.php
@@ -143,7 +143,7 @@ class ApiResponse
$parts = explode('--' . $boundary . '', $this->text()); //TODO Handle as stream
- if (empty($parts[0])) {
+ if (empty(trim($parts[0]))) {
array_shift($parts);
}
@@ -273,4 +273,4 @@ class ApiResponse
}
-}
\ No newline at end of file
+} | Multipart issue with newlines (#<I>)
When the multipart response has a new line (\n) or tab (\t) character on the first line of the response an exception will be thrown.
```Invalid message: Missing header delimiter``` | ringcentral_ringcentral-php | train | php |
14100189c526435a162f1fe2df54456c3d460789 | diff --git a/firebirdsql/wireprotocol.py b/firebirdsql/wireprotocol.py
index <HASH>..<HASH> 100644
--- a/firebirdsql/wireprotocol.py
+++ b/firebirdsql/wireprotocol.py
@@ -225,6 +225,8 @@ class WireProtocol:
if select.select([self.sock], [], [], self.timeout)[0] == []:
break
b = self.sock.recv(n)
+ if not b:
+ break
r += b
n -= len(b)
if len(r) < nbytes: | raise if can't recv packets. | nakagami_pyfirebirdsql | train | py |
7a8b004078d8ea83fc9d47e510373311fdd8d91d | diff --git a/test/tests.js b/test/tests.js
index <HASH>..<HASH> 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -79,7 +79,8 @@ module.exports = function (matchAll, regexMatchAll, t) {
define(regex, { global: true }, { global: function () { return true; } });
s2t.equal(regex.global, true);
} catch (e) {
- // in node < 6, `global` is not configurable on regexes.
+ s2t.comment('# SKIP in node < 6, `global` is not configurable on regexes');
+ return s2t.end();
}
s2t.equal(regex.flags, 'ig');
var expectedResults = [
@@ -89,7 +90,7 @@ module.exports = function (matchAll, regexMatchAll, t) {
{ value: null, done: true }
];
testResults(s2t, matchAll(str, regex), expectedResults);
- s2t.end();
+ return s2t.end();
});
st.test('respects flags', function (s2t) { | [Tests] Skip static flags test on node < 6, due to configurability | ljharb_String.prototype.matchAll | train | js |
b2aff1f73657532ce3da2dd61c52d75651a5cfe2 | diff --git a/treebeard/forms.py b/treebeard/forms.py
index <HASH>..<HASH> 100644
--- a/treebeard/forms.py
+++ b/treebeard/forms.py
@@ -83,7 +83,7 @@ class MoveNodeForm(forms.ModelForm):
def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
initial=None, error_class=ErrorList, label_suffix=':',
- empty_permitted=False, instance=None):
+ empty_permitted=False, instance=None, **kwargs):
opts = self._meta
if opts.model is None:
raise ValueError('ModelForm has no model class specified')
@@ -113,7 +113,7 @@ class MoveNodeForm(forms.ModelForm):
super(MoveNodeForm, self).__init__(
data, files, auto_id, prefix, initial_, error_class, label_suffix,
- empty_permitted, instance)
+ empty_permitted, instance, **kwargs)
def _clean_cleaned_data(self):
""" delete auxilary fields not belonging to node model """ | Django <I> compat. Error on MoveNodeForm render. Pass through additional kwargs to support new `use_required_attribute` ModelForm argument. | django-treebeard_django-treebeard | train | py |
fa01503fd50781665a88143b6ef611b90bdd11ec | diff --git a/app/src/scripts/dataset/dataset.store.js b/app/src/scripts/dataset/dataset.store.js
index <HASH>..<HASH> 100644
--- a/app/src/scripts/dataset/dataset.store.js
+++ b/app/src/scripts/dataset/dataset.store.js
@@ -513,12 +513,6 @@ let datasetStore = Reflux.createStore({
modals[name] = !modals[name]
update.modals = modals
- // don't display the follow modal if the user is already following
- if (name === 'subscribe' && this.data.dataset.subscribed) {
- update.modals[name] = false
- }
- this.update(update)
-
// callback
if (callback && typeof callback === 'function') {
callback() | update dataset store to treat subscription modal the same | OpenNeuroOrg_openneuro | train | js |
46256963d316fca482b5fc6a769e25ebe8b03216 | diff --git a/lib/kamerling/logging.rb b/lib/kamerling/logging.rb
index <HASH>..<HASH> 100644
--- a/lib/kamerling/logging.rb
+++ b/lib/kamerling/logging.rb
@@ -21,6 +21,9 @@ module Kamerling class Logging
Server::UDP.before :start do |*, server|
logger.info "start #{server.addr}"
end
+ Server::UDP.before :handle do |input, client_addr|
+ logger.info "connect #{client_addr}"
+ end
Server::UDP.after :stop do |*, server|
logger.info "stop #{server.addr}"
end
diff --git a/spec/kamerling/logging_spec.rb b/spec/kamerling/logging_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/kamerling/logging_spec.rb
+++ b/spec/kamerling/logging_spec.rb
@@ -53,5 +53,13 @@ module Kamerling describe Logging do
udp_server.stop
logged.must_include 'stop localhost:1979 (UDP)'
end
+
+ it 'logs UDP server connects' do
+ udp_client = UDPSocket.new
+ udp_client.send 'PING', 0, *udp_server.addr
+ udp_addr = Addr['127.0.0.1', udp_client.addr[1], :UDP]
+ run_all_threads
+ logged.must_include "connect #{udp_addr}"
+ end
end
end end | Logging: log Server::UDP connects | chastell_kamerling | train | rb,rb |
4391dfdbc483ad0fb7fc3edff707459952fd0375 | diff --git a/pandas/util/testing.py b/pandas/util/testing.py
index <HASH>..<HASH> 100644
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -136,8 +136,8 @@ def assert_almost_equal(a, b, check_less_precise = False):
# deal with differing dtypes
if check_less_precise:
- dtype_a = np.dtype(a)
- dtype_b = np.dtype(b)
+ dtype_a = np.dtype(type(a))
+ dtype_b = np.dtype(type(b))
if dtype_a.kind == 'i' and dtype_b == 'i':
pass
if dtype_a.kind == 'f' and dtype_b == 'f': | BUG: check_less_precise in assert_almost_equal with val=float throws exception | pandas-dev_pandas | train | py |
d038ee70b87cf47a48208cdc26ff84d94fa98068 | diff --git a/annis-widgets/src/main/java/annis/gui/widgets/gwt/client/ui/VSimpleCanvas.java b/annis-widgets/src/main/java/annis/gui/widgets/gwt/client/ui/VSimpleCanvas.java
index <HASH>..<HASH> 100644
--- a/annis-widgets/src/main/java/annis/gui/widgets/gwt/client/ui/VSimpleCanvas.java
+++ b/annis-widgets/src/main/java/annis/gui/widgets/gwt/client/ui/VSimpleCanvas.java
@@ -34,7 +34,7 @@ public class VSimpleCanvas extends Composite implements Paintable
/** Set the CSS class name to allow styling. */
public static final String CLASSNAME = "v-simplecanvas";
/** The client side widget identifier */
- protected String paintableId;
+ //protected String paintableId;
/** Reference to the server connection object. */
//ApplicationConnection gClient;
@@ -99,7 +99,7 @@ public class VSimpleCanvas extends Composite implements Paintable
//this.gClient = client;
// Save the client side identifier (paintable id) for the widget
- paintableId = uidl.getId();
+ //paintableId = uidl.getId();
if(context != null)
{ | don't store unused field in VSimpleCanvas | korpling_ANNIS | train | java |
3f44b3e43f62630493975c022934ea8df0fd7383 | diff --git a/spacy/tests/serialize/test_packer.py b/spacy/tests/serialize/test_packer.py
index <HASH>..<HASH> 100644
--- a/spacy/tests/serialize/test_packer.py
+++ b/spacy/tests/serialize/test_packer.py
@@ -64,6 +64,7 @@ def test_packer_unannotated(tokenizer):
assert result.string == 'the dog jumped'
[email protected]
def test_packer_annotated(tokenizer):
vocab = tokenizer.vocab
nn = vocab.strings['NN'] | * Mark serializer test as requiring models | explosion_spaCy | train | py |
6bf21fcc9dec21357c95da5e041138f0e272789f | diff --git a/lxd/network/driver_bridge.go b/lxd/network/driver_bridge.go
index <HASH>..<HASH> 100644
--- a/lxd/network/driver_bridge.go
+++ b/lxd/network/driver_bridge.go
@@ -1468,7 +1468,7 @@ func (n *bridge) setup(oldConfig map[string]string) error {
if shared.PathExists(leasesPath) {
err := os.Remove(leasesPath)
if err != nil {
- return errors.Wrapf(err, "Failed to remove old dnsmasq leases file '%s'", leasesPath)
+ return errors.Wrapf(err, "Failed to remove old dnsmasq leases file %q", leasesPath)
}
}
@@ -1477,7 +1477,7 @@ func (n *bridge) setup(oldConfig map[string]string) error {
if shared.PathExists(pidPath) {
err := os.Remove(pidPath)
if err != nil {
- return errors.Wrapf(err, "Failed to remove old dnsmasq pid file '%s'", pidPath)
+ return errors.Wrapf(err, "Failed to remove old dnsmasq pid file %q", pidPath)
}
}
} | lxd/network/driver/bridge: Error quoting | lxc_lxd | train | go |
14cca60ab75c5c27c2f7fe9f55c2dcd4a50e4a2b | diff --git a/src/Tev/Post/Model/AbstractPost.php b/src/Tev/Post/Model/AbstractPost.php
index <HASH>..<HASH> 100644
--- a/src/Tev/Post/Model/AbstractPost.php
+++ b/src/Tev/Post/Model/AbstractPost.php
@@ -224,6 +224,16 @@ abstract class AbstractPost implements WordpressWrapperInterface
}
/**
+ * Check if this post has a manually set excerpt.
+ *
+ * @return boolean True if has excerpt, false if not
+ */
+ public function hasExcerpt()
+ {
+ return (boolean) strlen($this->base->post_excerpt);
+ }
+
+ /**
* Get the post excerpt.
*
* Adapted from wp_trim_excerpt() in wp-includes/formatting.php. | Add 'hasExcerpt' method to posts | 3ev_wordpress-core | train | php |
888b705f019304f650fef167621107d402c3a62f | diff --git a/lib/tomlrb/handler.rb b/lib/tomlrb/handler.rb
index <HASH>..<HASH> 100644
--- a/lib/tomlrb/handler.rb
+++ b/lib/tomlrb/handler.rb
@@ -75,6 +75,7 @@ module Tomlrb
current = merged_inline
value = inline_array.pop
inline_array.each_with_index do |inline_key, inline_index|
+ inline_key = inline_key.to_sym if @symbolize_keys
last_key = inline_index == inline_array.size - 1
if last_key
diff --git a/test/test_tomlrb.rb b/test/test_tomlrb.rb
index <HASH>..<HASH> 100644
--- a/test/test_tomlrb.rb
+++ b/test/test_tomlrb.rb
@@ -43,6 +43,11 @@ describe Tomlrb::Parser do
.must_equal({"table"=>[{"name"=>"name1", "visible"=>true}, {"name"=>"name2", "visible"=>false}]})
end
+ it "symbolizes keys in a inline table if symbolize_keys: true" do
+ _( Tomlrb.parse("table={a=1, b=2}", symbolize_keys: true) )
+ .must_equal({:table=>{:a=>1, :b=>2}})
+ end
+
it "raises an error when parsing a float with leading underscore" do
_{ Tomlrb.parse('x = _1.0') }.must_raise(Tomlrb::ParseError)
end | Enable `symbolize_keys: true` for inline tables
Keys in a inline table have not been symbolized even when
`symbolize_keys: true` since <I>ade<I>d<I>cef1ba0ecb8cd5eaf<I>afe<I>a<I>.
This commit fixes it and adds the test case. | fbernier_tomlrb | train | rb,rb |
46a3d10e8a54af89a6ce8f56550f7220bb43fbdb | diff --git a/src/dagre-wrapper/nodes.js b/src/dagre-wrapper/nodes.js
index <HASH>..<HASH> 100644
--- a/src/dagre-wrapper/nodes.js
+++ b/src/dagre-wrapper/nodes.js
@@ -648,7 +648,11 @@ const class_box = (parent, node) => {
let classTitleString = node.classData.id;
if (node.classData.type !== undefined && node.classData.type !== '') {
- classTitleString += '<' + node.classData.type + '>';
+ if (getConfig().flowchart.htmlLabels) {
+ classTitleString += '<' + node.classData.type + '>';
+ } else {
+ classTitleString += '<' + node.classData.type + '>';
+ }
}
const classTitleLabel = labelContainer
.node() | Fix for classDiagram-v2 support for generics using '~' | knsv_mermaid | train | js |
42d998ca3bae7ed4494fde1c50e9004ca446eb44 | diff --git a/cake/tests/cases/console/console_error_handler.test.php b/cake/tests/cases/console/console_error_handler.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/console/console_error_handler.test.php
+++ b/cake/tests/cases/console/console_error_handler.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ConsoleErrorHandler');
+require CAKE . 'console' . DS . 'console_error_handler.php';
class TestConsoleErrorHandler extends ConsoleErrorHandler {
public $output = array();
@@ -100,4 +100,16 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
$this->assertEquals(1, count($result));
$this->assertEquals('dont use me in cli.', $result[0]);
}
+
+/**
+ * test that ConsoleErrorHandler has a stderr file handle.
+ *
+ * @return void
+ */
+ function testStdErrFilehandle() {
+ $exception = new Error500Exception('dont use me in cli.');
+ $error = new TestConsoleErrorHandler($exception);
+
+ $this->assertTrue(is_resource($error->stderr), 'No handle.');
+ }
}
\ No newline at end of file | Fixing up the include for the console error handler, and adding a test for stderr handle. | cakephp_cakephp | train | php |
bd492e76ccd9469deff55fbd731b344d3c0e5f0e | diff --git a/ml-agents/mlagents/learn.py b/ml-agents/mlagents/learn.py
index <HASH>..<HASH> 100755
--- a/ml-agents/mlagents/learn.py
+++ b/ml-agents/mlagents/learn.py
@@ -100,15 +100,16 @@ def main():
num_runs = int(options['--num-runs'])
seed = int(options['--seed'])
- if options['--env'] != 'None' and num_runs > 1:
+ if options['--env'] == 'None' and num_runs > 1:
raise TrainerError('It is not possible to launch more than one concurrent training session '
'when training from the editor.')
jobs = []
+ run_seed = seed
for i in range(num_runs):
if seed == -1:
- seed = np.random.randint(0, 9999)
- p = multiprocessing.Process(target=run_training, args=(i, seed, options))
+ run_seed = np.random.randint(0, 10000)
+ p = multiprocessing.Process(target=run_training, args=(i, run_seed, options))
jobs.append(p)
p.start() | Fix seed with multiple runs (#<I>)
* Fix seed with multiple runs
* addressed comments | Unity-Technologies_ml-agents | train | py |
46631e94579767185c71e9fbe4ef7193863b6c2d | diff --git a/cassiopeia/cassiopeia.py b/cassiopeia/cassiopeia.py
index <HASH>..<HASH> 100644
--- a/cassiopeia/cassiopeia.py
+++ b/cassiopeia/cassiopeia.py
@@ -69,7 +69,7 @@ def get_challenger_league(queue: Union[Queue, int, str], region: Union[Region, s
def get_match_history(summoner: Summoner, begin_index: int = None, end_index: int = None, begin_time: arrow.Arrow = None, end_time: arrow.Arrow = None, queues: Set[Queue] = None, seasons: Set[Season] = None, champions: Set[Champion] = None):
return MatchHistory(summoner=summoner, begin_index=begin_index, end_index=end_index, begin_time=begin_time, end_time=end_time, queues=queues, seasons=seasons, champions=champions)
-def get_match(id, region: Union[Region, str] = None) -> Match:
+def get_match(id : int, region: Union[Region, str] = None) -> Match:
return Match(id=id, region=region) | Added type hint for get_match() so the documentation (when regenerated) will show that you can get a match via a match ID (was previously unclear via docs) | meraki-analytics_cassiopeia | train | py |
5e1ef2a8a9d2f68e155a13711c864261da2940f1 | diff --git a/yasi.py b/yasi.py
index <HASH>..<HASH> 100644
--- a/yasi.py
+++ b/yasi.py
@@ -798,17 +798,16 @@ def indent_code(original_code, fpath=None):
bracket_locations = pop_from_list(curr_char, bracket_locations[:], fname, line_number, real_position, offset)
if bracket_locations and curr_char in [' ', '\t'] and bracket_locations[-1]['func_name'] in IF_LIKE:
- """ This part changes the indentation level of a then clause so that
- we can achieve something like:
- (if (= this that)
- 'then-form
- 'else-form)
- This is done by keeping track of the number of spaces found. If
- you find two spaces it means that, for example that we have just
- passed the then-form and hence should decrease the indentation
- level by 2.(I shamelessly copied this algorithm from Dorai's
- indenter)
- """
+ # This part changes the indentation level of a then clause so that
+ # we can achieve something like:
+ # (if (= this that)
+ # 'then-form
+ # 'else-form)
+ # This is done by keeping track of the number of spaces found. If
+ # you find two spaces it means that, for example that we have just
+ # passed the then-form and hence should decrease the indentation
+ # level by 2.(I shamelessly copied this algorithm from Dorai's
+ # indenter)
if prev_char not in [' ', '\t', ''] or not \
re.search('^[ \t]*(;|#\||$|\r)', curr_line):
# The level shouldn't be decreased if the line is a comment | Fix 'pointless-string-statement' warning by pylint | nkmathew_yasi-sexp-indenter | train | py |
ecc7c244675c1054e89f7b2efef2e5b0c0fcc45e | diff --git a/moto/dynamodb2/comparisons.py b/moto/dynamodb2/comparisons.py
index <HASH>..<HASH> 100644
--- a/moto/dynamodb2/comparisons.py
+++ b/moto/dynamodb2/comparisons.py
@@ -383,7 +383,7 @@ class OpNotEqual(Op):
def expr(self, item):
lhs = self._lhs(item)
rhs = self._rhs(item)
- return lhs == rhs
+ return lhs != rhs
class OpLessThanOrEqual(Op): | simple fix for not equals in dynamodb filter expressions. i suspect this was just a typo | spulec_moto | train | py |
6949a007e5939ae99036447de020a576d65d7fd3 | diff --git a/src/Exception/UniqueTokenIdentifierConstraintViolationException.php b/src/Exception/UniqueTokenIdentifierConstraintViolationException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/UniqueTokenIdentifierConstraintViolationException.php
+++ b/src/Exception/UniqueTokenIdentifierConstraintViolationException.php
@@ -11,6 +11,9 @@ namespace League\OAuth2\Server\Exception;
class UniqueTokenIdentifierConstraintViolationException extends OAuthServerException
{
+ /**
+ * @return UniqueTokenIdentifierConstraintViolationException
+ */
public static function create()
{
$errorMessage = 'Could not create unique access token identifier'; | Added docbloc to UniqueTokenIdentifierConstraintViolationException | thephpleague_oauth2-server | train | php |
aebf6dbeb6c87de708907626925a8eaf24d55d5a | diff --git a/slack_sdk/version.py b/slack_sdk/version.py
index <HASH>..<HASH> 100644
--- a/slack_sdk/version.py
+++ b/slack_sdk/version.py
@@ -1,2 +1,2 @@
"""Check the latest version at https://pypi.org/project/slack-sdk/"""
-__version__ = "3.4.2"
+__version__ = "3.5.0rc1" | version <I>rc1 (#<I>) | slackapi_python-slackclient | train | py |
57b08764f1739ef8a80dccbb5f8099d02cb6fd6b | diff --git a/backbone.layoutmanager.js b/backbone.layoutmanager.js
index <HASH>..<HASH> 100644
--- a/backbone.layoutmanager.js
+++ b/backbone.layoutmanager.js
@@ -258,10 +258,11 @@ var LayoutManager = Backbone.View.extend({
});
}, this);
+ // Disable the ability for any new sub-views to be added.
+ root.__manager__.renderDeferred = viewDeferred;
+
// Wait until this View has rendered before dealing with nested Views.
this._render(LayoutManager._viewRender).fetch.then(function() {
- // Disable the ability for any new sub-views to be added.
- root.__manager__.renderDeferred = viewDeferred;
// Create a list of promises to wait on until rendering is done. Since
// this method will run on all children as well, its sufficient for a | moved render deferred to before fetch | tbranyen_backbone.layoutmanager | train | js |
bbc066c7490fea0bfa552383bbfdd774b2eadd3c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -100,6 +100,7 @@ setup(
'colorized logger with search tools. Includes a Splunk sandbox '
'running in docker.'
''),
+ long_description_content_type='text/x-rst',
long_description=long_description,
author='Jay Johnson',
author_email='[email protected]', | fix for field from new twine warnings | jay-johnson_spylunking | train | py |
fc2ab98cd2678c5b725733f6294acefeaa0c4cc8 | diff --git a/lib/superapi/api.js b/lib/superapi/api.js
index <HASH>..<HASH> 100644
--- a/lib/superapi/api.js
+++ b/lib/superapi/api.js
@@ -4,14 +4,20 @@ function Api(config) {
this.config = config;
var self = this;
+ // closure
+ var serviceHandler = function (service) {
+ return function (data, fn) {
+ var req = self.request(service, data).end(fn ? fn : function (res) {
+ req.emit(res.ok ? "success" : "error", res);
+ });
+ return req;
+ };
+ };
for (var name in config.services) {
if (!this.hasOwnProperty(name)) {
- this[name] = function (data, fn) {
- var req = self.request(name, data).end(fn ? fn : function (res) {
- req.emit(res.ok ? "success" : "error", res);
- });
- return req;
- };
+ // syntatic sugar: install a service handler available on
+ // the api instance with service name
+ self[name] = serviceHandler(name);
}
}
} | fix(api): service handlers are now set in a closure
before closure the *name* variable was the same for each callback. Doh! | stephanebachelier_superapi | train | js |
03353c49be80f2d10ee03ae054ada8ca5cb80aee | diff --git a/src/gogoutils/generator.py b/src/gogoutils/generator.py
index <HASH>..<HASH> 100644
--- a/src/gogoutils/generator.py
+++ b/src/gogoutils/generator.py
@@ -11,7 +11,7 @@ class Generator(object):
"""Generate application name"""
return self.app
- def dns(self):
+ def dns_elb(self):
"""Generate dns domain"""
dns = '{0}.{1}.{2}.example.com'.format(
self.repo,
@@ -21,6 +21,14 @@ class Generator(object):
return dns
+ def dns(self):
+ """Combined dns details"""
+ dns = {
+ 'elb': self.dns_elb(),
+ }
+
+ return dns
+
def archaius(self):
"""Generate archaius bucket path"""
archaius = {}
diff --git a/tests/test_generator.py b/tests/test_generator.py
index <HASH>..<HASH> 100644
--- a/tests/test_generator.py
+++ b/tests/test_generator.py
@@ -39,7 +39,7 @@ def test_generate_dns():
PROJECTS[project]['project'],
PROJECTS[project]['env'],
)
- assert dns == g.dns()
+ assert dns == g.dns()['elb']
def test_generate_app(): | Split up dns() into multiple sub-parts | foremast_gogo-utils | train | py,py |
ca0b53848493ca79bdd6b9125f4e9c2cc08d7637 | diff --git a/code/dataobjects/WorkflowAction.php b/code/dataobjects/WorkflowAction.php
index <HASH>..<HASH> 100755
--- a/code/dataobjects/WorkflowAction.php
+++ b/code/dataobjects/WorkflowAction.php
@@ -37,6 +37,23 @@ class WorkflowAction extends DataObject {
public static $allowed_children = array('WorkflowTransition');
/**
+ * Returns an array of possible action classes to action title, suitable for use in a dropdown.
+ *
+ * @return array
+ */
+ public static function get_dropdown_map() {
+ $classes = ClassInfo::subclassesFor(__CLASS__);
+ $actions = array();
+
+ array_shift($classes);
+ foreach($classes as $class) {
+ $actions[$class] = singleton($class)->getActionTitle();
+ }
+
+ return $actions;
+ }
+
+ /**
* Returns the action title that describes all instances of this action - default to the singular name.
*
* @return string | ENHANCEMENT: Added WorkflowAction::get_dropdown_map() to get a map of workflow action classes to action title, suitable for use in a dropdown. | symbiote_silverstripe-advancedworkflow | train | php |
667b34c6f41e5dd499c9d74517a19ccdc07f0176 | diff --git a/test/functional/client_side_encryption/prose.test.js b/test/functional/client_side_encryption/prose.test.js
index <HASH>..<HASH> 100644
--- a/test/functional/client_side_encryption/prose.test.js
+++ b/test/functional/client_side_encryption/prose.test.js
@@ -288,7 +288,7 @@ describe('Client Side Encryption Prose Tests', function() {
algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
})
)
- .then(encrypted => {
+ .then(encrypted =>
this.clientEncrypted
.db(dataDbName)
.collection(dataCollName)
@@ -300,8 +300,8 @@ describe('Client Side Encryption Prose Tests', function() {
err => {
expect(err).to.be.an.instanceOf(Error);
}
- );
- });
+ )
+ );
});
}); | test: fix failure to return promise in CSFLE prose test | mongodb_node-mongodb-native | train | js |
41148bdad507655242364de429af49c6df462347 | diff --git a/lib/virtualbox.js b/lib/virtualbox.js
index <HASH>..<HASH> 100644
--- a/lib/virtualbox.js
+++ b/lib/virtualbox.js
@@ -403,7 +403,7 @@ var guestproperty = {
guestproperty.os(vm, getOSTypeCallback);
- function gvboxmanageetOSTypeCallback(os_type) {
+ function getOSTypeCallback(os_type) {
vboxmanage(['guestproperty', 'get', vm, key], function(error, stdout) {
if (error) {
throw error; | Fix callback name on execFile change. | Node-Virtualization_node-virtualbox | train | js |
e5395a5fd532dd3370ce69f29dfbd5b5448649c1 | diff --git a/mod/quiz/report/responses/responses_table.php b/mod/quiz/report/responses/responses_table.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/report/responses/responses_table.php
+++ b/mod/quiz/report/responses/responses_table.php
@@ -148,7 +148,8 @@ class quiz_report_responses_table extends table_sql {
$question = $this->questions[$questionid];
$responses = get_question_actual_response($question, $statesforattempt[$questionid]);
$response = (!empty($responses)? implode(', ',$responses) : '-');
- $grade = $statesforattempt[$questionid]->last_graded->grade;
+ $grade = $statesforattempt[$questionid]->last_graded->grade
+ / $this->questions[$questionid]->maxgrade;
if (!$this->is_downloading()) {
$format_options = new stdClass;
$format_options->para = false; | MDL-<I> "in detailled report : scale grade to a fraction of the max grade and THEN use it for calculating whether this is a correct / partially correct / or wrong answer" | moodle_moodle | train | php |
834382763b28e5f2094b971009612f9d1d8bac71 | diff --git a/src/main/java/org/jbake/app/Oven.java b/src/main/java/org/jbake/app/Oven.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jbake/app/Oven.java
+++ b/src/main/java/org/jbake/app/Oven.java
@@ -76,7 +76,7 @@ public class Oven {
private void ensureDestination() throws Exception {
if (null == destination) {
- destination = new File(config.getString(Keys.DESTINATION_FOLDER));
+ destination = new File(source, config.getString(Keys.DESTINATION_FOLDER));
}
if (!destination.exists()) {
destination.mkdirs(); | Merged in #<I>. | jbake-org_jbake | train | java |
867a194afdc8f1c2cfcde8336732d908b3723076 | diff --git a/lib/mongoid/changeable.rb b/lib/mongoid/changeable.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/changeable.rb
+++ b/lib/mongoid/changeable.rb
@@ -84,7 +84,6 @@ module Mongoid
#
# @since 2.1.0
def move_changes
- @__children = nil
@previous_changes = changes
Atomic::UPDATES.each do |update|
send(update).clear
diff --git a/lib/mongoid/traversable.rb b/lib/mongoid/traversable.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/traversable.rb
+++ b/lib/mongoid/traversable.rb
@@ -120,6 +120,7 @@ module Mongoid
child.move_changes
child.new_record = false
end
+ @__children = nil
end
# Return the root document in the object graph. If the current document | Move @__children cleanup to reset_persisted_children | mongodb_mongoid | train | rb,rb |
9b899d9326ed11edfb9f31ed49d2f7db942b5c31 | diff --git a/photutils/background/tests/test_background_2d.py b/photutils/background/tests/test_background_2d.py
index <HASH>..<HASH> 100644
--- a/photutils/background/tests/test_background_2d.py
+++ b/photutils/background/tests/test_background_2d.py
@@ -17,6 +17,13 @@ try:
except ImportError:
HAS_SCIPY = False
+try:
+ import matplotlib
+ HAS_MATPLOTLIB = True
+except ImportError:
+ HAS_MATPLOTLIB = False
+
+
DATA = np.ones((100, 100))
BKG_RMS = np.zeros((100, 100))
@@ -194,6 +201,7 @@ class TestBackground2D(object):
bkg = Background2D(DATA, (25, 25), filter_size=(1, 1))
bkg._make_2d_array(np.arange(3))
+ @pytest.mark.skipif('not HAS_MATPLOTLIB')
def test_plot_meshes(self):
"""
This test should run without any errors, but there is no return | Skip background test if matplotlib is not installed | astropy_photutils | train | py |
13d6a1bb679285ac6501125c8f0d9bcf722f13ef | diff --git a/docker.go b/docker.go
index <HASH>..<HASH> 100644
--- a/docker.go
+++ b/docker.go
@@ -126,8 +126,10 @@ func dockerPreRun(opts *cliflags.ClientOptions) {
func hideUnsupportedFeatures(cmd *cobra.Command, clientVersion string, hasExperimental bool) {
cmd.Flags().VisitAll(func(f *pflag.Flag) {
// hide experimental flags
- if _, ok := f.Annotations["experimental"]; ok {
- f.Hidden = true
+ if !hasExperimental {
+ if _, ok := f.Annotations["experimental"]; ok {
+ f.Hidden = true
+ }
}
// hide flags not supported by the server
@@ -139,8 +141,10 @@ func hideUnsupportedFeatures(cmd *cobra.Command, clientVersion string, hasExperi
for _, subcmd := range cmd.Commands() {
// hide experimental subcommands
- if _, ok := subcmd.Tags["experimental"]; ok {
- subcmd.Hidden = true
+ if !hasExperimental {
+ if _, ok := subcmd.Tags["experimental"]; ok {
+ subcmd.Hidden = true
+ }
}
// hide subcommands not supported by the server | Show experimental flags and subcommands if enabled | docker_cli | train | go |
e44ebe97a71714f6961c5e1fe0f9da7921033a7f | diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -310,7 +310,13 @@ class Request {
const method = options.method
if (this.form && (method === 'POST' || method === 'PUT' || method === 'PATCH')) {
+ let alreadyHandled = false
this.form.submit(options, (err, res) => {
+ if (alreadyHandled) {
+ return
+ }
+ alreadyHandled = true
+
if (err) {
return this.callback(err)
} | Fix #<I>: Error callback called twice | bojand_mailgun-js | train | js |
12cd6dc134dfab6b4e030803be808ee050b92897 | diff --git a/src/main/QafooLabs/Profiler.php b/src/main/QafooLabs/Profiler.php
index <HASH>..<HASH> 100644
--- a/src/main/QafooLabs/Profiler.php
+++ b/src/main/QafooLabs/Profiler.php
@@ -488,7 +488,7 @@ class Profiler
"op" => $operationName,
"data" => $data,
"custom" => $customTimers,
- "vars" => self::$customVars,
+ "vars" => self::$customVars ?: null,
"apiKey" => self::$apiKey,
"ot" => $operationType,
"mem" => round(memory_get_peak_usage() / 1024), | Bugfix for Go JSON decoding. | tideways_profiler | train | php |
7667b73c49653bfff4dc01ae07cf3f6e68d35e2c | diff --git a/ntfy/config.py b/ntfy/config.py
index <HASH>..<HASH> 100644
--- a/ntfy/config.py
+++ b/ntfy/config.py
@@ -25,9 +25,6 @@ def load_config(config_path=DEFAULT_CONFIG):
config = yaml.load(open(expanduser(config_path)))
except IOError as e:
if e.errno == errno.ENOENT and config_path == DEFAULT_CONFIG:
- if isfile(expanduser('~/.ntfy.json')):
- logger.error('~/.ntfy.json no longer supported, use {}'.format(
- DEFAULT_CONFIG))
logger.info('{} not found'.format(config_path))
config = {}
else: | no json config since pre <I> | dschep_ntfy | train | py |
44bab7d0ae0bc9dd091efa8eba665eb9e331f1ef | diff --git a/rabbithole_test.go b/rabbithole_test.go
index <HASH>..<HASH> 100644
--- a/rabbithole_test.go
+++ b/rabbithole_test.go
@@ -513,9 +513,9 @@ var _ = Describe("Client", func() {
xs, err := rmqc.ListVhosts()
Ω(err).Should(BeNil())
- defaultVhost := xs[0]
- Ω(defaultVhost.Name).Should(BeEquivalentTo("/"))
- Ω(defaultVhost.Tracing).Should(Equal(false))
+ x := xs[0]
+ Ω(x.Name).ShouldNot(BeNil())
+ Ω(x.Tracing).ShouldNot(BeNil())
})
})
}) | Don't assume vhosts[0] is guaranteed to be / | michaelklishin_rabbit-hole | train | go |
88ca61e7c756cc0904ddab3073478a56f97fc98a | diff --git a/lib/raven/transports/http.rb b/lib/raven/transports/http.rb
index <HASH>..<HASH> 100644
--- a/lib/raven/transports/http.rb
+++ b/lib/raven/transports/http.rb
@@ -39,7 +39,9 @@ module Raven
def set_conn
configuration.logger.debug "Raven HTTP Transport connecting to #{configuration.server}"
- Faraday.new(configuration.server, :ssl => ssl_configuration) do |builder|
+ proxy = configuration.public_send(:proxy)
+
+ Faraday.new(configuration.server, :ssl => ssl_configuration, :proxy => proxy) do |builder|
configuration.faraday_builder.call(builder) if configuration.faraday_builder
builder.response :raise_error
builder.options.merge! faraday_opts
@@ -50,7 +52,7 @@ module Raven
# TODO: deprecate and replace where possible w/Faraday Builder
def faraday_opts
- [:proxy, :timeout, :open_timeout].each_with_object({}) do |opt, memo|
+ [:timeout, :open_timeout].each_with_object({}) do |opt, memo|
memo[opt] = configuration.public_send(opt) if configuration.public_send(opt)
end
end | Fix proxy (#<I>) | getsentry_raven-ruby | train | rb |
7e2669f11d13f01b3cdb753c69954c0d4ab77a98 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ class PyTest(TestCommand):
sys.exit(error_number)
-global_requirements = ['astroid', 'pylint', 'pyyaml', 'psutil']
+global_requirements = ['astroid', 'pylint', 'pyyaml', 'psutil', 'jsonconversion']
setup(
name='RAFCON', | Add jsonconversion to setup.py requirements
The package is now on PyPi and can be installed from there | DLR-RM_RAFCON | train | py |
f87f4b02b77c8975bab6d5c420207e7c33a66d67 | diff --git a/instrumentation/instrumentation.go b/instrumentation/instrumentation.go
index <HASH>..<HASH> 100644
--- a/instrumentation/instrumentation.go
+++ b/instrumentation/instrumentation.go
@@ -8,15 +8,24 @@ import (
)
type SystemStats struct {
- NumGoRoutines int
- UserTime float64
- SystemTime float64
- BytesAlloc uint64
- BytesFromSystem uint64
- GCPauseTimesNs float64
- GCPauseTimeMax float64
+ // Number of goroutines currently running.
+ NumGoRoutines int
+ // Seconds in userland.
+ UserTime float64
+ // Seconds in system time.
+ SystemTime float64
+ // Number of bytes currently allocated.
+ BytesAlloc uint64
+ // Number of bytes obtained from system.
+ BytesFromSystem uint64
+ // How long the last GC pause time took in milliseconds.
+ GCPauseTimeLast float64
+ // Maximum recent GC pause time in milliseconds.
+ GCPauseTimeMax float64
+ // Total GC pause time in milliseconds.
GCPauseTimeTotal float64
- GCPauseSince float64
+ // Seconds since last GC pause.
+ GCPauseSince float64
}
func GetSystemStats() SystemStats {
@@ -60,8 +69,8 @@ func GetStackTrace(all bool) string {
}
}
-// Return a map of goroutines to string Slice of their
-// respective stack trace.
+// GetStackTraces returns a map of goroutines to string
+// Slice of their respective stack trace.
func GetStackTraces() map[string][]string {
stack := GetStackTrace(true) | Add comments for SystemStats. | fastly_go-utils | train | go |
05db84498f3513dac6879143eb7c3bc3401e037d | diff --git a/src/pyctools/tools/editor.py b/src/pyctools/tools/editor.py
index <HASH>..<HASH> 100644
--- a/src/pyctools/tools/editor.py
+++ b/src/pyctools/tools/editor.py
@@ -916,6 +916,9 @@ class ComponentList(QtWidgets.QTreeView):
# try to find out if module needs Qt
self.needs_qt[name] = False
for item in dir(mod):
+ if item in ('QtEventLoop', 'QtThreadEventLoop'):
+ self.needs_qt[name] = True
+ break
if not 'Qt' in item:
continue
item = getattr(mod, item) | Improved test for component PyQt dependency | jim-easterbrook_pyctools | train | py |
8f81471d5d0b9d3db424d1ad7ef35c79aa4b0beb | diff --git a/compiler.go b/compiler.go
index <HASH>..<HASH> 100644
--- a/compiler.go
+++ b/compiler.go
@@ -476,6 +476,8 @@ func (s *scope) finaliseVarAlloc(stackOffset int) (stashSize, stackSize int) {
*ap = initStash(idx)
case *loadMixed:
i.idx = idx
+ case *loadMixedLex:
+ i.idx = idx
case *resolveMixed:
i.idx = idx
}
diff --git a/compiler_test.go b/compiler_test.go
index <HASH>..<HASH> 100644
--- a/compiler_test.go
+++ b/compiler_test.go
@@ -3462,6 +3462,23 @@ func TestArgAccessFromDynamicStash(t *testing.T) {
testScript1(SCRIPT, valueTrue, t)
}
+func TestLoadMixedLex(t *testing.T) {
+ const SCRIPT = `
+ function f() {
+ let a = 1;
+ {
+ function inner() {
+ eval("var a = true");
+ return a;
+ }
+ return inner();
+ }
+ }
+ f();
+ `
+ testScript1(SCRIPT, valueTrue, t)
+}
+
/*
func TestBabel(t *testing.T) {
src, err := ioutil.ReadFile("babel7.js") | Fixed dynamic variable resolution when a parent lexical binding exists | dop251_goja | train | go,go |
4acd11f1f221e4d7435b005cd4990c6854fc22ee | diff --git a/lib/mime.js b/lib/mime.js
index <HASH>..<HASH> 100644
--- a/lib/mime.js
+++ b/lib/mime.js
@@ -141,7 +141,7 @@ MIME.prototype = {
input = input.replace( /_/g, ' ' )
}
- input.replace( /[=]([A-F0-9]{2})|(.)/g, function( match, hex, chr ) {
+ input.replace( /[=]([A-F0-9]{2})|(.|[\u0000-\uFFFF])/g, function( match, hex, chr ) {
bytes.push( hex ? parseInt( hex, 16 ) : chr.charCodeAt( 0 ) )
}) | Update lib/mime: Fix regex to include newlines & everything
Ref jhermsmeier/node-envelope#<I> | jhermsmeier_node-mime-lib | train | js |
ff4f2daccd1acdfddcea7139d4dd6490b55129db | diff --git a/lib/twitter/base.rb b/lib/twitter/base.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter/base.rb
+++ b/lib/twitter/base.rb
@@ -93,7 +93,9 @@ module Twitter
#
# @return [Hash]
def attrs
- @attrs
+ @attrs.inject({}) do |attrs, (key, value)|
+ attrs.merge!(key => respond_to?(key) ? send(key) : value)
+ end
end
alias to_hash attrs | Make #attrs call methods if they exist
Closes #<I>. | sferik_twitter | train | rb |
e528ec90bfd15a183bd7db275d2ee5f60c7f4e79 | diff --git a/byml/byml.py b/byml/byml.py
index <HASH>..<HASH> 100644
--- a/byml/byml.py
+++ b/byml/byml.py
@@ -317,7 +317,8 @@ class Writer:
elif isinstance(data, dict):
stream.write(self._u8(NodeType.HASH))
stream.write(self._u24(len(data)))
- for (key, value) in data.items():
+ for key in sorted(data.keys()):
+ value = data[key]
stream.write(self._u24(self._hash_key_table[key]))
node_type = self._to_byml_type(value)
stream.write(self._u8(node_type)) | writer: Fix hash entries not being sorted
Keys were being sorted correctly but not the hash entries themselves...
This is required to avoid generating invalid documents as the official
BYML library performs binary searches. | zeldamods_byml-v2 | train | py |
4d3e484e860ba4ac129fe97f3f13f67315a6c34e | diff --git a/src/sap.m/src/sap/m/MessageView.js b/src/sap.m/src/sap/m/MessageView.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/MessageView.js
+++ b/src/sap.m/src/sap/m/MessageView.js
@@ -106,6 +106,9 @@ sap.ui.define([
* If needed the navigation between the message item and the source of the error can be created by the application.
* This can be done by setting the <code>activeTitle</code> property to true and providing a handler for the <code>activeTitlePress</code> event.</li>
* </ul>
+ * <h3>Responsive Behavior</h3>
+ * The responsiveness of the <code>MessageView</code> is determined by the container in which it is embedded. For that reason the control could not be visualized if the
+ * container’s sizes are not defined.
* @author SAP SE
* @version ${version}
* | [INTERNAL][FIX] sap.m.MessageView: Documentation updated
- Added "Responsive Behaviour" in the documentation.
BCP: <I>
Change-Id: I<I>a<I>d<I>f<I>c9e3f<I>c7eb8 | SAP_openui5 | train | js |
c8e2b91fa712f508db4657218056ba0204efae8b | diff --git a/lib/url.js b/lib/url.js
index <HASH>..<HASH> 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -406,9 +406,9 @@ URLStateMachine.prototype["parse" + STATES.RELATIVE_PATH] = function parseScheme
(!isASCIIHex(this.input.codePointAt(this.pointer + 1)) ||
!isASCIIHex(this.input.codePointAt(this.pointer + 2)))) {
this.parse_error = true;
- } else if (c !== undefined && c !== 0x9 && c !== 0xA && c !== 0xD) {
- this.buffer += defaultEncode(c);
}
+
+ this.buffer += defaultEncode(c);
}
}; | The string must be appended in any case | jsdom_whatwg-url | train | js |
b780240e84cf975f553e8bc344217b3fdca56b6a | diff --git a/lib/kaiser_ruby/parser.rb b/lib/kaiser_ruby/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/kaiser_ruby/parser.rb
+++ b/lib/kaiser_ruby/parser.rb
@@ -69,7 +69,7 @@ module KaiserRuby
def initialize(input)
@raw_input = input
- @lines = input.gsub(/\(\n.*?\n+\)/m, "\n").split(/\n/) # eat multiline comments
+ @lines = input.gsub(/\(\n.*?\)/m, "\n").split(/\n/) # eat multiline comments
end
def parse | bit better version of multiline comment handling | marcinruszkiewicz_kaiser-ruby | train | rb |
9e3e366c80f31cd62b1e3fd3236778171ec7563b | diff --git a/account.go b/account.go
index <HASH>..<HASH> 100644
--- a/account.go
+++ b/account.go
@@ -10,6 +10,14 @@ import (
// Allowed values are "individual", "company".
type LegalEntityType string
+// IdentityVerificationDetailsCode is a machine-readable code specifying the
+// verification state of a legal entity. Allowed values are
+// "failed_keyed_identity", "failed_other", "scan_corrupt",
+// "scan_failed_greyscale", "scan_failed_other",
+// "scan_id_country_not_supported", "scan_id_type_not_supported",
+// "scan_name_mismatch", "scan_not_readable", "scan_not_uploaded".
+type IdentityVerificationDetailsCode string
+
// IdentityVerificationStatus describes the different statuses for identity verification.
// Allowed values are "pending", "verified", "unverified".
type IdentityVerificationStatus string
@@ -302,9 +310,10 @@ type Owner struct {
// IdentityVerification is the structure for an account's verification.
type IdentityVerification struct {
- Status IdentityVerificationStatus `json:"status"`
- Document *IdentityDocument `json:"document"`
- Details *string `json:"details"`
+ DetailsCode IdentityVerificationDetailsCode `json:"details_code"`
+ Status IdentityVerificationStatus `json:"status"`
+ Document *IdentityDocument `json:"document"`
+ Details *string `json:"details"`
}
// IdentityDocument is the structure for an identity document. | Add DetailsCode to IdentifyVerification
Adds DetailsCode to IdentityVerification because it's missing and
is expected to be there.
Fixes #<I>. | stripe_stripe-go | train | go |
24fab528f876d8d459d4dedcbdb70abf370a4f24 | diff --git a/builtin/credential/app-id/backend.go b/builtin/credential/app-id/backend.go
index <HASH>..<HASH> 100644
--- a/builtin/credential/app-id/backend.go
+++ b/builtin/credential/app-id/backend.go
@@ -76,6 +76,9 @@ func Backend(conf *logical.BackendConfig) (*framework.Backend, error) {
b.view = conf.StorageView
+ b.MapAppId.SaltFunc = b.Salt
+ b.MapUserId.SaltFunc = b.Salt
+
return b.Backend, nil
}
@@ -109,9 +112,6 @@ func (b *backend) Salt() (*salt.Salt, error) {
return nil, err
}
b.salt = salt
- b.MapAppId.SaltFunc = b.Salt
- b.MapUserId.SaltFunc = b.Salt
-
return salt, nil
} | Fix instantiation of salt funcs in app-id structs | hashicorp_vault | train | go |
dc8a1e35d7030d183e602bdcb2ba9dec2b39dda5 | diff --git a/src/main/java/io/druid/segment/loading/DataSegmentPusherUtil.java b/src/main/java/io/druid/segment/loading/DataSegmentPusherUtil.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/druid/segment/loading/DataSegmentPusherUtil.java
+++ b/src/main/java/io/druid/segment/loading/DataSegmentPusherUtil.java
@@ -29,6 +29,10 @@ public class DataSegmentPusherUtil
{
private static final Joiner JOINER = Joiner.on("/").skipNulls();
+ // Note: storage directory structure format = .../dataSource/interval/version/partitionNumber/
+ // If above format is ever changed, make sure to change it appropriately in other places
+ // e.g. HDFSDataSegmentKiller uses this information to clean the version, interval and dataSource directories
+ // on segment deletion if segment being deleted was the only segment
public static String getStorageDir(DataSegment segment)
{
return JOINER.join( | adding comment regarding assumption of segment storage directory structure in other places | druid-io_druid-api | train | java |
7ddf7bb787cc8cf05387c222914d927bca1732e2 | diff --git a/opencv/goimage.go b/opencv/goimage.go
index <HASH>..<HASH> 100644
--- a/opencv/goimage.go
+++ b/opencv/goimage.go
@@ -10,6 +10,7 @@ import (
func DecodeImageMem(data []byte) *IplImage {
buf := CreateMatHeader(1, len(data), CV_8U)
buf.SetData(unsafe.Pointer(&data[0]), CV_AUTOSTEP)
+ defer buf.Release()
return DecodeImage(unsafe.Pointer(buf), CV_LOAD_IMAGE_UNCHANGED)
} | DecodeImageMem was leaking memory because the mat header wasn't being deallocated. | go-opencv_go-opencv | train | go |
503f5ed3b05019f03db206e4995f2ab2c0f314d9 | diff --git a/presto-verifier/src/main/java/com/facebook/presto/verifier/QueryRewriter.java b/presto-verifier/src/main/java/com/facebook/presto/verifier/QueryRewriter.java
index <HASH>..<HASH> 100644
--- a/presto-verifier/src/main/java/com/facebook/presto/verifier/QueryRewriter.java
+++ b/presto-verifier/src/main/java/com/facebook/presto/verifier/QueryRewriter.java
@@ -36,6 +36,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.SimpleTimeLimiter;
import com.google.common.util.concurrent.TimeLimiter;
+import com.google.common.util.concurrent.UncheckedTimeoutException;
import io.airlift.units.Duration;
import java.sql.Connection;
@@ -223,6 +224,9 @@ public class QueryRewriter
columns.add(new Column(name, APPROXIMATE_TYPES.contains(type)));
}
}
+ catch (UncheckedTimeoutException e) {
+ throw new SQLException("SQL statement execution timed out", e);
+ }
finally {
executor.shutdownNow();
} | Handle SQL execution timeouts for verifier rewrite | prestodb_presto | train | java |
9cb89f07ca03c6a28d1e237ba033bc6a29422fd6 | diff --git a/mux_test.go b/mux_test.go
index <HASH>..<HASH> 100644
--- a/mux_test.go
+++ b/mux_test.go
@@ -562,6 +562,15 @@ func TestQueries(t *testing.T) {
shouldMatch: true,
},
{
+ title: "Queries route with regexp pattern with quantifier, additional variable in query string, match",
+ route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
+ request: newRequest("GET", "http://localhost?bar=2&foo=1"),
+ vars: map[string]string{"v1": "1"},
+ host: "",
+ path: "",
+ shouldMatch: true,
+ },
+ {
title: "Queries route with regexp pattern with quantifier, regexp does not match",
route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
request: newRequest("GET", "http://localhost?foo=12"),
@@ -570,6 +579,15 @@ func TestQueries(t *testing.T) {
path: "",
shouldMatch: false,
},
+ {
+ title: "Queries route with regexp pattern with quantifier, additional variable in query string, regexp does not match",
+ route: new(Route).Queries("foo", "{v1:[0-9]{1}}"),
+ request: newRequest("GET", "http://localhost?foo=12"),
+ vars: map[string]string{},
+ host: "",
+ path: "",
+ shouldMatch: false,
+ },
}
for _, test := range tests { | Add a couple of additional tests for query strings. | gorilla_mux | train | go |
Subsets and Splits