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 |
|---|---|---|---|---|---|
47db963800649bdd609d619bbc5f08052fe5520a | diff --git a/hubconf.py b/hubconf.py
index <HASH>..<HASH> 100644
--- a/hubconf.py
+++ b/hubconf.py
@@ -4,6 +4,11 @@ dependencies = ['torch']
from torchvision.models.alexnet import alexnet
from torchvision.models.densenet import densenet121, densenet169, densenet201, densenet161
from torchvision.models.inception import inception_v3
-from torchvision.models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152
+from torchvision.models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152,\
+ resnext50_32x4d, resnext101_32x8d
from torchvision.models.squeezenet import squeezenet1_0, squeezenet1_1
from torchvision.models.vgg import vgg11, vgg13, vgg16, vgg19, vgg11_bn, vgg13_bn, vgg16_bn, vgg19_bn
+from torchvision.models.segmentation import fcn_resnet101, deeplabv3_resnet101
+from torchvision.models.googlenet import googlenet
+from torchvision.models.shufflenetv2 import shufflenet_v2_x0_5, shufflenet_v2_x1_0
+from torchvision.models.mobilenet import mobilenet_v2 | add more hub models (#<I>)
* add more hub models
* fix lint | pytorch_vision | train | py |
de34320b766cad35903a8037e3b8afe3a9b43f5e | diff --git a/src/main/java/com/smartsheet/api/internal/json/FormatDeserializer.java b/src/main/java/com/smartsheet/api/internal/json/FormatDeserializer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/smartsheet/api/internal/json/FormatDeserializer.java
+++ b/src/main/java/com/smartsheet/api/internal/json/FormatDeserializer.java
@@ -1,5 +1,25 @@
package com.smartsheet.api.internal.json;
+/*
+ * #[license]
+ * Smartsheet Java SDK
+ * %%
+ * Copyright (C) 2014 Smartsheet
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ * %[license]
+ */
+
import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser; | Added license to top of java files | smartsheet-platform_smartsheet-java-sdk | train | java |
169f9d22e6841032c83e3e5eedef3f6f6ae94b78 | diff --git a/builder/azure/arm/builder_acc_test.go b/builder/azure/arm/builder_acc_test.go
index <HASH>..<HASH> 100644
--- a/builder/azure/arm/builder_acc_test.go
+++ b/builder/azure/arm/builder_acc_test.go
@@ -16,7 +16,7 @@ package arm
//
// In addition, the PACKER_ACC variable should also be set to
// a non-empty value to enable Packer acceptance tests and the
-// options "-v -timeout 30m" should be provided to the test
+// options "-v -timeout 90m" should be provided to the test
// command, e.g.:
// go test -v -timeout 90m -run TestBuilderAcc_.* | Update 'the other place' too | hashicorp_packer | train | go |
e522938192ada852a058dccf3742beee6ed2afd7 | diff --git a/test/contrib/esindex_test.py b/test/contrib/esindex_test.py
index <HASH>..<HASH> 100644
--- a/test/contrib/esindex_test.py
+++ b/test/contrib/esindex_test.py
@@ -61,10 +61,6 @@ try:
except Exception:
raise unittest.SkipTest('Unable to connect to ElasticSearch')
-target = ElasticsearchTarget(HOST, PORT, INDEX, DOC_TYPE, 'update_id', http_auth=HTTP_AUTH)
-target.marker_index = MARKER_INDEX
-target.marker_doc_type = MARKER_DOC_TYPE
-
class ElasticsearchTargetTest(unittest.TestCase):
@@ -72,6 +68,10 @@ class ElasticsearchTargetTest(unittest.TestCase):
def test_touch_and_exists(self):
""" Basic test. """
+ target = ElasticsearchTarget(HOST, PORT, INDEX, DOC_TYPE, 'update_id', http_auth=HTTP_AUTH)
+ target.marker_index = MARKER_INDEX
+ target.marker_doc_type = MARKER_DOC_TYPE
+
delete()
self.assertFalse(target.exists(),
'Target should not exist before touching it') | don't create Target in global scope | spotify_luigi | train | py |
d960d042d87b8ee6d4edb0bd5e4550f2a7d9257d | diff --git a/src/mcfedr/AWSPushBundle/Message/Message.php b/src/mcfedr/AWSPushBundle/Message/Message.php
index <HASH>..<HASH> 100644
--- a/src/mcfedr/AWSPushBundle/Message/Message.php
+++ b/src/mcfedr/AWSPushBundle/Message/Message.php
@@ -260,7 +260,7 @@ class Message implements \JsonSerializable
//Note that strlen returns the byte length of the string
$textLength = strlen($this->text);
if ($textLength > $cut) {
- $apnsData = $this->getApnsJson(mb_strcut($this->text, 0, $textLength - $cut, 'utf8'));
+ $apnsData = $this->getApnsJson(mb_strcut($this->text, 0, $textLength - $cut - 3, 'utf8') . '...');
} else {
throw new MessageTooLongException("You message for APNS is too long $apnsData");
} | use elispses when cutting pushes | mcfedr_awspushbundle | train | php |
b028dc810320b1b3ee64fb3a0cd536b82010a91d | diff --git a/src/lib/helpText.js b/src/lib/helpText.js
index <HASH>..<HASH> 100644
--- a/src/lib/helpText.js
+++ b/src/lib/helpText.js
@@ -23,6 +23,6 @@ function showMissing404Text () {
logger.info(` ${filename("import RouteNotFound from \"../containers/RouteNotFound\";")}`);
logger.info(` ${filename("import { ROUTE_NAME_404_NOT_FOUND } from \"gluestick-shared\";")}`);
logger.info("3. Add a new route that uses this constant and container as your very last route.");
- logger.info(" " + filename(`<Route name={${info("ROUTE_NAME_404_NOT_FOUND")} path="${info("*")}" component={${info("RouteNotFound")}} />`));
+ logger.info(" " + filename(`<Route name={${info("ROUTE_NAME_404_NOT_FOUND")}} path="${info("*")}" component={${info("RouteNotFound")}} />`));
} | Found a typo in our help text which causes a JS error if you use it | TrueCar_gluestick | train | js |
fc3a7d5c613f9564d9c8abbcfc93b1b624d5e74f | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -401,7 +401,9 @@ module.exports = function (grunt) {
mochaSetup: {
default: {
- files: { src: helper.watchFiles(['[Ss]pec.js'], ['./app/addons/**/*[Ss]pec.js', './app/addons/**/*[Ss]pec.react.js'])},
+ files: {
+ src: helper.watchFiles(['[Ss]pec.js'], ['./app/addons/**/*[Ss]pec.js', './app/addons/**/*[Ss]pec.react.js', './app/core/**/*[Ss]pec.js'])
+ },
template: 'test/test.config.underscore',
config: './app/config.js'
} | tests: run all tests
even those in `./app/core`
PR: #<I>
PR-URL: <URL> | apache_couchdb-fauxton | train | js |
a159f5cf16d4b5e32d10bcd4799b4a140ab22412 | diff --git a/dist/firenze.full.config.js b/dist/firenze.full.config.js
index <HASH>..<HASH> 100644
--- a/dist/firenze.full.config.js
+++ b/dist/firenze.full.config.js
@@ -1,7 +1,7 @@
var filename = __filename.split('/').pop().replace(/\.config\.js/, '.js');
module.exports = {
- entry: __dirname + '/../lib',
+ entry: __dirname + '/../',
output: {
path: __dirname,
filename: filename, | update webpack config for dists. | fahad19_firenze | train | js |
45a0eefecf3cfda76be0836ab7554f58abb6ea23 | diff --git a/samcli/__init__.py b/samcli/__init__.py
index <HASH>..<HASH> 100644
--- a/samcli/__init__.py
+++ b/samcli/__init__.py
@@ -2,4 +2,4 @@
SAM CLI version
"""
-__version__ = "0.47.0"
+__version__ = "0.48.0" | chore: version to <I> (#<I>)
Why is this change necessary?
* Needed for new release | awslabs_aws-sam-cli | train | py |
9c31686f3fa25719b95a62fcc08beb2afa5b4790 | diff --git a/dom/create.js b/dom/create.js
index <HASH>..<HASH> 100644
--- a/dom/create.js
+++ b/dom/create.js
@@ -3,11 +3,8 @@ var each = require('../each'),
module.exports = function create(tag, properties, doc) {
var element = (doc || document).createElement(tag)
- each(properties, function(val, key) {
- if (key == 'class') { key = 'className' }
- else if (key == 'html') { key = 'innerHTML' }
- else if (key == 'style') { style(element, val); return }
- element[key] = val
- })
+ if (properties.html) { element.innerHTML = properties.html; delete properties.html }
+ if (properties.style) { style(element, properties.style); delete properties.style }
+ each(properties, function(val, key) { element[key] = val })
return element
} | better property key special handling for innerHTML and style in create | marcuswestin_std.js | train | js |
f6ba969114cf621b3f631f8163439211806a21f9 | diff --git a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/DevTest.java b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/DevTest.java
index <HASH>..<HASH> 100644
--- a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/DevTest.java
+++ b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/DevTest.java
@@ -291,7 +291,8 @@ public class DevTest extends BaseDevTest {
assertTrue(verifyLogMessageExists(NEW_FILE_INFO_MESSAGE, 10000, newFeatureFile));
assertTrue(verifyLogMessageExists(SERVER_XML_COMMENT, 10000, serverXmlFile));
// "CWWKF0012I: The server installed the following features:" assume batch-1.0 is in there
- assertTrue(verifyLogMessageExists(SERVER_INSTALLED_FEATURES, 10000, ++installedFeaturesCount));
+ // batch-1.0 pulls in other features that can take a long time to download.
+ assertTrue(verifyLogMessageExists(SERVER_INSTALLED_FEATURES, 123000, ++installedFeaturesCount));
// When there is a compilation error the generate features process should not run
final String goodCode = "import javax.ws.rs.GET;"; | Greatly increase the time for install features to download the features pulled in by batch-<I>. | WASdev_ci.maven | train | java |
8404389a31ae8b737a016d70fda344890c0cd0dd | diff --git a/script/upload.py b/script/upload.py
index <HASH>..<HASH> 100755
--- a/script/upload.py
+++ b/script/upload.py
@@ -51,7 +51,7 @@ def main():
release_id = create_or_get_release_draft(github, args.version)
upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME))
upload_atom_shell(github, release_id, os.path.join(DIST_DIR, SYMBOLS_NAME))
- if not args.no_publish_release:
+ if args.publish_release:
publish_release(github, release_id)
# Upload node's headers to S3.
@@ -63,9 +63,9 @@ def parse_args():
parser = argparse.ArgumentParser(description='upload distribution file')
parser.add_argument('-v', '--version', help='Specify the version',
default=ATOM_SHELL_VRESION)
- parser.add_argument('-n', '--no-publish-release',
- help='Do not publish the release',
- action='store_false')
+ parser.add_argument('-p', '--publish-release',
+ help='Publish the release',
+ action='store_true')
return parser.parse_args() | Rename no-publish-release to publish-release. | electron_electron | train | py |
beb1a013db3b31498f479854c9bbfe6fc4a9b98f | diff --git a/api/tasks.go b/api/tasks.go
index <HASH>..<HASH> 100644
--- a/api/tasks.go
+++ b/api/tasks.go
@@ -103,6 +103,9 @@ type ReschedulePolicy struct {
}
func (r *ReschedulePolicy) Merge(rp *ReschedulePolicy) {
+ if rp == nil {
+ return
+ }
if rp.Interval != nil {
r.Interval = rp.Interval
}
@@ -432,7 +435,7 @@ func (g *TaskGroup) Canonicalize(job *Job) {
}
}
- if defaultReschedulePolicy != nil && g.ReschedulePolicy != nil {
+ if defaultReschedulePolicy != nil {
defaultReschedulePolicy.Merge(g.ReschedulePolicy)
g.ReschedulePolicy = defaultReschedulePolicy
} | Always merge with default reschedule policy if its not nil | hashicorp_nomad | train | go |
1edcb92bc7ff24c3332fad4cc1c603a02d83242b | diff --git a/piwik/indico_piwik/__init__.py b/piwik/indico_piwik/__init__.py
index <HASH>..<HASH> 100644
--- a/piwik/indico_piwik/__init__.py
+++ b/piwik/indico_piwik/__init__.py
@@ -32,10 +32,9 @@ from .queries.tracking import PiwikQueryTrackDownload
class PiwikPlugin(IndicoPlugin):
- """Piwik statistics plugin
+ """Piwik statistics
- Piwik statistics plugin provides statistics of conferences, meetings
- and contributions.
+ Retrieves piwik statistics for conferences, meetings and contributions.
"""
settings_form = SettingsForm | Remove redundancy from the plugin title/description | indico_indico-plugins | train | py |
5a5354a39b7b30dd7ac15ad70b660ce3ec85622d | diff --git a/packages/base.js b/packages/base.js
index <HASH>..<HASH> 100644
--- a/packages/base.js
+++ b/packages/base.js
@@ -60,18 +60,14 @@ exports.Class = function(parent, proto) {
var cls = function() { if (this.init) { return this.init.apply(this, arguments); }},
supr = parent ? function(context, method, args) {
- var args = args || [];
- var target = proto;
- while (target = target.prototype) {
- if (target[method]) {
- return target[method].apply(context, args);
- }
- }
- throw new Error('method ' + method + ' does not exist');
+ var f = parent.prototype[method];
+ if (!f) { throw new Error('method ' + method + ' does not exist'); }
+ return f.apply(context, args || []);
} : null;
cls.prototype = new proto(logger || supr, logger && supr);
cls.prototype.constructor = cls;
+ cls.prototype.__parentClass__ = parent;
if (name) { cls.prototype.__class__ = name; }
return cls;
} | add references in the class prototypes to parent classes for traversing up a constructor | gameclosure_js.io | train | js |
c5aff4ad15147cb09fe5fb0074a35a3d2b070b7d | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -109,7 +109,7 @@ SettingsFile.prototype.set = function (contents, cb) {
return cb(err);
}
- _.assign(fileContents.global, contents);
+ _.merge(fileContents.global, contents);
self._writeFile(fileContents, cb);
}); | Fixed set to use merge and not assign | nachos_settings-file | train | js |
1b8955fabf4cc091e3ebb538f4d7e5a493c377c7 | diff --git a/src/PHPoole.php b/src/PHPoole.php
index <HASH>..<HASH> 100644
--- a/src/PHPoole.php
+++ b/src/PHPoole.php
@@ -753,7 +753,7 @@ class PHPoole implements EventsCapableInterface
* Render a page.
*
* @param Page $page
- * @param $dir
+ * @param string $dir
*
* @throws \Exception
*
@@ -875,7 +875,7 @@ class PHPoole implements EventsCapableInterface
*
* @param $page
*
- * @return array
+ * @return string[]
*
* @see layoutFinder()
*/ | Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL> | Cecilapp_PHPoole | train | php |
e52512cedbd72a0be48c2a02ea30753fb964c854 | diff --git a/test/unit/utils-tests.js b/test/unit/utils-tests.js
index <HASH>..<HASH> 100644
--- a/test/unit/utils-tests.js
+++ b/test/unit/utils-tests.js
@@ -127,8 +127,8 @@ test('prepareValue: date array prepared properly', function() {
});
test('prepareValue: buffer array prepared properly', function() {
- var buffer1 = Buffer.from('dead', 'hex');
- var buffer2 = Buffer.from('beef', 'hex');
+ var buffer1 = Buffer.from ? Buffer.from('dead', 'hex') : new Buffer('dead', 'hex');
+ var buffer2 = Buffer.from ? Buffer.from('beef', 'hex') : new Buffer('beef', 'hex');
var out = utils.prepareValue([buffer1, buffer2]);
assert.strictEqual(out, '{\\\\xdead,\\\\xbeef}');
}); | Adjust the test for arrays of buffers to work across all node versions. | brianc_node-postgres | train | js |
fd9862b2d88cabcda67e669ec43c61a66723f3cf | diff --git a/link.py b/link.py
index <HASH>..<HASH> 100644
--- a/link.py
+++ b/link.py
@@ -1,5 +1,4 @@
import re
-import controller
from markdown import convert
import importlib | Remove explicit import of controller in link.py | albert12132_templar | train | py |
6f8ee6677a042d53d9251ecf7b1c7431c23d2416 | diff --git a/api-put-object.go b/api-put-object.go
index <HASH>..<HASH> 100644
--- a/api-put-object.go
+++ b/api-put-object.go
@@ -28,7 +28,7 @@ import (
"github.com/minio/minio-go/pkg/encrypt"
"github.com/minio/minio-go/pkg/s3utils"
- "golang.org/x/net/lex/httplex"
+ "golang.org/x/net/http/httpguts"
)
// PutObjectOptions represents options specified by user for PutObject call
@@ -101,10 +101,10 @@ func (opts PutObjectOptions) Header() (header http.Header) {
// validate() checks if the UserMetadata map has standard headers or and raises an error if so.
func (opts PutObjectOptions) validate() (err error) {
for k, v := range opts.UserMetadata {
- if !httplex.ValidHeaderFieldName(k) || isStandardHeader(k) || isSSEHeader(k) || isStorageClassHeader(k) {
+ if !httpguts.ValidHeaderFieldName(k) || isStandardHeader(k) || isSSEHeader(k) || isStorageClassHeader(k) {
return ErrInvalidArgument(k + " unsupported user defined metadata name")
}
- if !httplex.ValidHeaderFieldValue(v) {
+ if !httpguts.ValidHeaderFieldValue(v) {
return ErrInvalidArgument(v + " unsupported user defined metadata value")
}
} | Change import httplex to httpguts. (#<I>) | minio_minio-go | train | go |
239bf39960840998f269d51df33b186e0d7f6543 | diff --git a/lib/discordrb/events/generic.rb b/lib/discordrb/events/generic.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/events/generic.rb
+++ b/lib/discordrb/events/generic.rb
@@ -57,7 +57,7 @@ module Discordrb::Events
end
end
- # Event handler that matches all events
+ # Event handler that matches all events. Only useful for making an event that has no attributes, such as {ReadyEvent}.
class TrueEventHandler < EventHandler
# Always returns true.
# @return [true] | Add some more information on TrueEventHandler | meew0_discordrb | train | rb |
49963f91f2dce9b7c3e32fda3d2eb81843cc4ecc | diff --git a/trafaret/__init__.py b/trafaret/__init__.py
index <HASH>..<HASH> 100644
--- a/trafaret/__init__.py
+++ b/trafaret/__init__.py
@@ -1516,7 +1516,10 @@ def guard(trafaret=None, **kwargs):
trafaret = Dict(**kwargs)
def wrapper(fn):
- argspec = inspect.getargspec(fn)
+ if py3:
+ argspec = inspect.getfullargspec(fn)
+ else:
+ argspec = inspect.getargspec(fn)
@functools.wraps(fn)
def decor(*args, **kwargs): | guard: support keyword-only and annotated functions (Py3) | Deepwalker_trafaret | train | py |
d92762bbeb3d096ae7f98e87e5b8de7a04988d46 | diff --git a/compiler/util.py b/compiler/util.py
index <HASH>..<HASH> 100644
--- a/compiler/util.py
+++ b/compiler/util.py
@@ -31,8 +31,7 @@ _ESCAPES = {'\t': r'\t', '\r': r'\r', '\n': r'\n', '"': r'\"', '\\': r'\\'}
# This is the max length of a direct allocation tuple supported by the runtime.
-# This should match the number of specializations found in
-# runtime/tuple_direct.go.
+# This should match the number of specializations found in tuple.go.
MAX_DIRECT_TUPLE = 6 | Fix inaccurate comment. (#<I>) | google_grumpy | train | py |
515b0ea08d1d39bbc4c1846d1d6988cc9ab6c6b6 | diff --git a/src/Application/Modules/Admin/Controllers/Traits/AuthenticationTrait.php b/src/Application/Modules/Admin/Controllers/Traits/AuthenticationTrait.php
index <HASH>..<HASH> 100644
--- a/src/Application/Modules/Admin/Controllers/Traits/AuthenticationTrait.php
+++ b/src/Application/Modules/Admin/Controllers/Traits/AuthenticationTrait.php
@@ -25,6 +25,9 @@ trait AuthenticationTrait
return ModelLocator::get('administrators');
}
+ /**
+ * @return mixed
+ */
protected function getNonAuthRedirectURL()
{
return $this->Url()->get('admin.login');
diff --git a/src/Controllers/Traits/HasUser.php b/src/Controllers/Traits/HasUser.php
index <HASH>..<HASH> 100644
--- a/src/Controllers/Traits/HasUser.php
+++ b/src/Controllers/Traits/HasUser.php
@@ -12,14 +12,14 @@ use Nip\Records\Locator\ModelLocator;
*/
trait HasUser
{
- protected $user;
+ protected $user = null;
/**
* @return User
*/
protected function _getUser()
{
- if (!$this->user) {
+ if ($this->user === null) {
$this->initUser();
} | fix reference to Admin in authenticated TraitController | bytic_Common | train | php,php |
c5d5d4d35b359e819acaffb8e0b0ac8a74348217 | diff --git a/android/app/src/main/java/com/reactnativenavigation/screens/Screen.java b/android/app/src/main/java/com/reactnativenavigation/screens/Screen.java
index <HASH>..<HASH> 100644
--- a/android/app/src/main/java/com/reactnativenavigation/screens/Screen.java
+++ b/android/app/src/main/java/com/reactnativenavigation/screens/Screen.java
@@ -189,6 +189,7 @@ public abstract class Screen extends RelativeLayout implements Subscriber {
public void setTitleBarLeftButton(String navigatorEventId, LeftButtonOnClickListener backButtonListener,
TitleBarLeftButtonParams titleBarLeftButtonParams) {
+ titleBarLeftButtonParams.setColorFromScreenStyle(styleParams.titleBarButtonColor);
topBar.setTitleBarLeftButton(navigatorEventId,
backButtonListener,
titleBarLeftButtonParams, | Set LeftButton color from screen (#<I>) | wix_react-native-navigation | train | java |
f9c4f8467473d0d9e4e64ef39a0fbf2c1da5833c | diff --git a/src/main/java/org/killbill/billing/client/model/PhasePriceOverride.java b/src/main/java/org/killbill/billing/client/model/PhasePriceOverride.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/killbill/billing/client/model/PhasePriceOverride.java
+++ b/src/main/java/org/killbill/billing/client/model/PhasePriceOverride.java
@@ -76,11 +76,13 @@ public class PhasePriceOverride {
if (phaseType != null ? !phaseType.equals(that.phaseType) : that.phaseType != null) {
return false;
}
- if (fixedPrice != null ? !fixedPrice.equals(that.fixedPrice) : that.fixedPrice != null) {
+ if (fixedPrice != null ? fixedPrice.compareTo(that.fixedPrice) != 0 : that.fixedPrice != null) {
return false;
}
- return recurringPrice != null ? recurringPrice.equals(that.recurringPrice) : that.recurringPrice == null;
-
+ if (recurringPrice != null ? recurringPrice.compareTo(that.recurringPrice) != 0 : that.recurringPrice != null) {
+ return false;
+ }
+ return true;
}
@Override | Fix equals method for PhasePriceOverride Resource | killbill_killbill-client-java | train | java |
19812428d36460ce108bc224758d96059954eaf2 | diff --git a/account-management-app/src/main/java/org/duracloud/account/util/StorageProviderTypeUtil.java b/account-management-app/src/main/java/org/duracloud/account/util/StorageProviderTypeUtil.java
index <HASH>..<HASH> 100644
--- a/account-management-app/src/main/java/org/duracloud/account/util/StorageProviderTypeUtil.java
+++ b/account-management-app/src/main/java/org/duracloud/account/util/StorageProviderTypeUtil.java
@@ -16,6 +16,6 @@ public class StorageProviderTypeUtil {
}
public static List<StorageProviderType> getAvailableSecondaryTypes() {
- return SECONDARY_PROVIDER_TYPES;
+ return new ArrayList<StorageProviderType>(SECONDARY_PROVIDER_TYPES);
}
} | This update resolves issue #<I> specified in <URL> | duracloud_management-console | train | java |
e7f55a24c42444b5b9995eb84821c2e55a0417cb | diff --git a/pcap.go b/pcap.go
index <HASH>..<HASH> 100644
--- a/pcap.go
+++ b/pcap.go
@@ -7,7 +7,6 @@ struct pcap { int dummy; };
*/
import "C";
import (
- "syscall";
"unsafe";
)
@@ -47,7 +46,7 @@ type Pcap struct {
}
type Packet struct {
- Time syscall.Timeval;
+ Time struct { Sec int32; Usec int32 };
Caplen uint32;
Len uint32;
Data []byte;
@@ -105,8 +104,8 @@ func(p *Pcap) Next() (pkt *Packet) {
return nil;
}
pkt = new(Packet);
- pkt.Time.Sec = int64(pkthdr.ts.tv_sec);
- pkt.Time.Usec = int64(pkthdr.ts.tv_usec);
+ pkt.Time.Sec = int32(pkthdr.ts.tv_sec);
+ pkt.Time.Usec = int32(pkthdr.ts.tv_usec);
pkt.Caplen = uint32(pkthdr.caplen);
pkt.Len = uint32(pkthdr.len);
pkt.Data = make([]byte, pkthdr.caplen); | make gopcap work on <I> bit systems (patch by spennig) | akrennmair_gopcap | train | go |
87abfd307fc96ee0c091ad6f0aeb80d5187263d1 | diff --git a/salt/runners/state.py b/salt/runners/state.py
index <HASH>..<HASH> 100644
--- a/salt/runners/state.py
+++ b/salt/runners/state.py
@@ -46,9 +46,6 @@ def over(saltenv='base', os_fn=None):
'removed in Salt Boron. Please migrate to state.orchestrate.'
)
- print('The state.over runner is on a deprecation path and will be '
- 'removed in Salt Boron. Please migrate to state.orchestrate.')
-
stage_num = 0
try:
overstate = salt.overstate.OverState(__opts__, saltenv, os_fn) | Don't need the additional print, it will log to the CLI | saltstack_salt | train | py |
2f1e0c6be264878da2688e20102822a6ad803e01 | diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Assets.php
+++ b/system/src/Grav/Common/Assets.php
@@ -628,6 +628,10 @@ class Assets
function($matches) use ($relative_path) {
$old_url = $matches[1];
+
+ // ensure this is not a data url
+ if (strpos($old_url, 'data:') === 0) return $matches[0];
+
$newpath = array();
$paths = explode('/', $old_url); | Fix for data urls in CSS | getgrav_grav | train | php |
ee571e8e116cae68548b0f13d32e83926aeb92d8 | diff --git a/lib/sqlite-store.js b/lib/sqlite-store.js
index <HASH>..<HASH> 100755
--- a/lib/sqlite-store.js
+++ b/lib/sqlite-store.js
@@ -240,7 +240,7 @@ module.exports = function (options) {
if (q.sort$) {
for (var sf in q.sort$) break
- var sd = q.sort$[sf] < 0 ? 'ASC' : 'DESC'
+ var sd = q.sort$[sf] > 0 ? 'ASC' : 'DESC'
mq.push('ORDER BY ' + sf + ' ' + sd)
} | Fixed sorting error where list is sorted in descending order when ascending order is specified and vice versa | senecajs-labs_seneca-sqlite-store | train | js |
94ae8ffb36d0a7bbaf402573eff560da1997f84f | diff --git a/paramiko/channel.py b/paramiko/channel.py
index <HASH>..<HASH> 100644
--- a/paramiko/channel.py
+++ b/paramiko/channel.py
@@ -887,6 +887,12 @@ class Channel (ClosingContextManager):
"""
self.shutdown(1)
+ @property
+ def _closed(self):
+ # Concession to Python 3's socket API, which has a private ._closed
+ # attribute instead of a semipublic .closed attribute.
+ return self.closed
+
### calls from Transport
def _set_transport(self, transport): | Give Channel ._closed as alias to .closed.
Fixes #<I>. | paramiko_paramiko | train | py |
008f14c0e721824ba10847d074025bd862ba7cd5 | diff --git a/graphistry/vgraph.py b/graphistry/vgraph.py
index <HASH>..<HASH> 100644
--- a/graphistry/vgraph.py
+++ b/graphistry/vgraph.py
@@ -93,7 +93,7 @@ def storeValueVector(vg, df, col, dtype, target):
'datetime64[ns]': datetimeEncoder,
}
(vec, info) = encoders[dtype.name](vg, df[col], dtype)
- vec.name = col
+ vec.name = str(col)
vec.target = target
if 'distinct' not in info: | Bugfix(etl2): Don't crash when column names are not string (such as integers) | graphistry_pygraphistry | train | py |
6a269dde07a3812e7560e85842d9fa4f59358ac5 | diff --git a/lib/discourse_api/api/topics.rb b/lib/discourse_api/api/topics.rb
index <HASH>..<HASH> 100644
--- a/lib/discourse_api/api/topics.rb
+++ b/lib/discourse_api/api/topics.rb
@@ -42,6 +42,18 @@ module DiscourseApi
def delete_topic(id)
delete("/t/#{id}.json")
end
+
+ def topic_posts(topic_id, post_ids=[])
+ url = "/t/#{topic_id}/posts.json"
+ if posts_ids.count > 0
+ url << '?'
+ post_ids.each do |id|
+ url << "post_ids[]=#{id}&"
+ end
+ end
+ response = get(url)
+ response[:body]
+ end
end
end
end | fetch a group of posts that belong to a topic
Added new method for fetching a chunk of posts that belong to a topic.
Currently if you called `client.topic('topic_id')` you would only get
back ~<I> posts.
Now you can call `client.topic_posts('topic_id', post_ids)` to get all
the posts you specify in the `post_ids` array. | discourse_discourse_api | train | rb |
94cf5319d63331e1550d8292bd10a3eacade589e | diff --git a/src/nicoSWD/Rules/Tokens/BaseToken.php b/src/nicoSWD/Rules/Tokens/BaseToken.php
index <HASH>..<HASH> 100644
--- a/src/nicoSWD/Rules/Tokens/BaseToken.php
+++ b/src/nicoSWD/Rules/Tokens/BaseToken.php
@@ -49,7 +49,7 @@ abstract class BaseToken
abstract public function getGroup();
/**
- * @return string
+ * @return mixed
*/
public function getValue()
{ | Fix scrutinizer issue (return type) | nicoSWD_php-rule-parser | train | php |
f0e004ffa27e2d0e8b6cde4a1e669c75910c440a | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -32,11 +32,6 @@ extensions = [
'sphinx_issues',
]
-releases_unstable_prehistory = True
-releases_document_name = ["history"]
-releases_issue_uri = "https://github.com/tmux-python/libtmux/issues/%s"
-releases_release_uri = "https://github.com/tmux-python/libtmux/tree/v%s"
-
issues_github_path = about['__github__'].replace('https://github.com/', '')
templates_path = ['_templates'] | build(docs): Remove settings leftover from sphinx-releases | tmux-python_libtmux | train | py |
5349ca09b735e16bea2c3ba3438804a499a0fc7d | diff --git a/views/default/page/components/interactions.js b/views/default/page/components/interactions.js
index <HASH>..<HASH> 100644
--- a/views/default/page/components/interactions.js
+++ b/views/default/page/components/interactions.js
@@ -108,9 +108,9 @@ define(function (require) {
$form.trigger('reset');
}
// Hide edit form
- if ($form.find('[name="comment_guid"]').val()) {
+ if ($form.is('.elgg-form-edit')) {
if (response.status >= 0) {
- $form.siblings().first().replaceWith(response.output.view);
+ $form.siblings().replaceWith(response.output.view);
}
$form.siblings().show();
$form.remove();
@@ -132,7 +132,8 @@ define(function (require) {
$item.append($form);
$form.trigger('initialize');
$form.siblings().hide();
- $form.find('[name="generic_comment"]').focus().trigger('click');
+ $form.find('textrea,input[type="text"]').first().focus().trigger('click');
+ $form.addClass('elgg-form-edit')
$form.find('.elgg-button-cancel').on('click', function () {
$form.siblings().show();
$form.remove(); | fix(js): fix form bugs | hypeJunction_hypeInteractions | train | js |
d03007cfcd87e6c0ad855a82cc4b583f8dcf534b | diff --git a/lib/sup/mode.rb b/lib/sup/mode.rb
index <HASH>..<HASH> 100644
--- a/lib/sup/mode.rb
+++ b/lib/sup/mode.rb
@@ -46,7 +46,7 @@ class Mode
end
def resolve_input c
- ancestors.each do |klass| # try all keymaps in order of ancestry
+ self.class.ancestors.each do |klass| # try all keymaps in order of ancestry
next unless @@keymaps.member?(klass)
action = BufferManager.resolve_input_with_keymap c, @@keymaps[klass]
return action if action
@@ -62,7 +62,7 @@ class Mode
def help_text
used_keys = {}
- ancestors.map do |klass|
+ self.class.ancestors.map do |klass|
km = @@keymaps[klass] or next
title = "Keybindings from #{Mode.make_name klass.name}"
s = <<EOS
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index <HASH>..<HASH> 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -182,17 +182,6 @@ class Module
end
class Object
- def ancestors
- ret = []
- klass = self.class
-
- until klass == Object
- ret << klass
- klass = klass.superclass
- end
- ret
- end
-
## "k combinator"
def returning x; yield x; x; end | ancestors are built in, now also checks Kernel and BasicObject for keymaps | sup-heliotrope_sup | train | rb,rb |
8f8f5eaf75e4dfdac9365ec18e87b42d5929c659 | diff --git a/index.php b/index.php
index <HASH>..<HASH> 100644
--- a/index.php
+++ b/index.php
@@ -44,4 +44,4 @@ function bootstrap() {
add_filter( 'wp_nav_menu', [ $cache, 'cache_menu' ], PHP_INT_MAX - 1, 2 );
}
-add_action( 'plugins_loaded', __NAMESPACE__ . '\\bootstrap' );
+add_action( 'plugins_loaded', __NAMESPACE__ . '\\bootstrap', 0 ); | Bootstrap the plugin earlier. #5 | inpsyde_menu-cache | train | php |
bccc21de9e68bdbee210c11072aae26c76ffcf6a | diff --git a/lib/lifx/routing_manager.rb b/lib/lifx/routing_manager.rb
index <HASH>..<HASH> 100644
--- a/lib/lifx/routing_manager.rb
+++ b/lib/lifx/routing_manager.rb
@@ -53,6 +53,7 @@ module LIFX
def tags_for_device_id(device_id)
entry = @routing_table.entry_for_device_id(device_id)
+ return [] if entry.nil?
entry.tag_ids.map do |tag_id|
tag = @tag_table.entry_with(site_id: entry.site_id, tag_id: tag_id)
tag && tag.label | It's possible there's no routing table for a device yet | LIFX_lifx-gem | train | rb |
d94e45f3d6eb85333a433ef8d0155e740411740d | diff --git a/starlette/authentication.py b/starlette/authentication.py
index <HASH>..<HASH> 100644
--- a/starlette/authentication.py
+++ b/starlette/authentication.py
@@ -62,7 +62,9 @@ def requires(
if not has_required_scope(request, scopes_list):
if redirect is not None:
- return RedirectResponse(url=request.url_for(redirect))
+ return RedirectResponse(
+ url=request.url_for(redirect), status_code=303
+ )
raise HTTPException(status_code=status_code)
return await func(*args, **kwargs)
@@ -77,7 +79,9 @@ def requires(
if not has_required_scope(request, scopes_list):
if redirect is not None:
- return RedirectResponse(url=request.url_for(redirect))
+ return RedirectResponse(
+ url=request.url_for(redirect), status_code=303
+ )
raise HTTPException(status_code=status_code)
return func(*args, **kwargs) | Requires decorator redirects with <I> status_code instead of <I> #<I> (#<I>) | encode_starlette | train | py |
8ea508f79bc85714b75bb517a48ba7a17a50236b | diff --git a/file.go b/file.go
index <HASH>..<HASH> 100644
--- a/file.go
+++ b/file.go
@@ -207,9 +207,9 @@ func newBufferedSectionWriter(w io.WriterAt, begPos, maxBytes int64,
if ok {
buf, pos = req.buf, req.pos
if len(buf) > 0 {
- _, err = w.WriteAt(buf, pos)
+ nBytes, err := w.WriteAt(buf, pos)
if err == nil && s != nil {
- s.reportBytesWritten(uint64(len(buf)))
+ s.reportBytesWritten(uint64(nBytes))
}
}
} | MB-<I> - Improving the compaction related stats
Switching from an ever-increasing compaction stats to a
compaction cycle specific stats by reseting the stats
after every compaction
Moving back to ever increasing stat and some clean up
Change-Id: Iea<I>e<I>e9bcc<I>a4f<I>fad<I>bbb<I>c<I>a
Reviewed-on: <URL> | couchbase_moss | train | go |
b9ead472a55719c3e6fd295df9b165450c44642d | diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js
index <HASH>..<HASH> 100644
--- a/spec/api-ipc-spec.js
+++ b/spec/api-ipc-spec.js
@@ -149,6 +149,13 @@ describe('ipc module', function () {
assert(!proto.hasOwnProperty('method'))
assert(Object.getPrototypeOf(proto).hasOwnProperty('method'))
})
+
+ it('is referenced by methods in prototype chain', function () {
+ let method = derived.method
+ derived = null
+ gc()
+ assert.equal(method(), 'method')
+ });
})
describe('ipc.sender.send', function () { | spec: Remote object should be referenced by methods in its prototype chain | electron_electron | train | js |
993a837639998bb82019eba021750a377b4724e6 | diff --git a/malcolm/modules/scanning/parts/shutterpart.py b/malcolm/modules/scanning/parts/shutterpart.py
index <HASH>..<HASH> 100644
--- a/malcolm/modules/scanning/parts/shutterpart.py
+++ b/malcolm/modules/scanning/parts/shutterpart.py
@@ -34,8 +34,8 @@ class ShutterPart(CAChoicePart):
config=True # type: util.AConfig
):
# type: (...) -> None
- super(ShutterPart, self).__init__(name, description, pv, rbv, rbv_suffix, min_delta, timeout, sink_port,
- widget, group, config)
+ super(ShutterPart, self).__init__(name, description, pv, rbv, rbv_suffix, min_delta,
+ timeout, sink_port, widget, group, config)
self.open_value = open_value
self.close_value = close_value | ShutterPart: breaking up call to super line to reduce length | dls-controls_pymalcolm | train | py |
5b863ce4bb7a78187dc70e313886c377e6143182 | diff --git a/.rubocop-todo.yml b/.rubocop-todo.yml
index <HASH>..<HASH> 100644
--- a/.rubocop-todo.yml
+++ b/.rubocop-todo.yml
@@ -29,9 +29,6 @@ Documentation:
DotPosition:
Enabled: false
-EmptyLines:
- Enabled: false
-
Encoding:
Enabled: false
diff --git a/lib/pacto/rake_task.rb b/lib/pacto/rake_task.rb
index <HASH>..<HASH> 100644
--- a/lib/pacto/rake_task.rb
+++ b/lib/pacto/rake_task.rb
@@ -87,7 +87,6 @@ module Pacto
contracts = Dir[File.join(dir, '*{.json.erb,.json}')]
fail "No contracts found in directory #{dir}".colorize(:yellow) if contracts.empty?
-
contracts.sort.each do |contract_file|
yield contract_file
end
diff --git a/spec/unit/pacto/stubs/built_in_spec.rb b/spec/unit/pacto/stubs/built_in_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/pacto/stubs/built_in_spec.rb
+++ b/spec/unit/pacto/stubs/built_in_spec.rb
@@ -51,7 +51,6 @@ module Pacto
})
end
-
context 'when the response body is an object' do
let(:body) do
{'message' => 'foo'} | Fix problem with "Extra blank line detected" (#<I>) | thoughtworks_pacto | train | yml,rb,rb |
d6a5e85632245a6624dfc2fa99623697fc3cec2d | diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py
index <HASH>..<HASH> 100644
--- a/salt/modules/dockermod.py
+++ b/salt/modules/dockermod.py
@@ -3843,7 +3843,6 @@ def save(name,
if os.path.exists(path) and not overwrite:
raise CommandExecutionError('{0} already exists'.format(path))
- compression = kwargs.get('compression')
if compression is None:
if path.endswith('.tar.gz') or path.endswith('.tgz'):
compression = 'gzip' | Small cleanup to dockermod.save
Removes the call to get ``compression`` out of the kwargs dict as
``compression`` is already listed in the list of positional kwargs. | saltstack_salt | train | py |
378532a5b4a6ee40512c623f9cbb49dbdff5cd2c | diff --git a/test/functional/mirror_operations_test.rb b/test/functional/mirror_operations_test.rb
index <HASH>..<HASH> 100644
--- a/test/functional/mirror_operations_test.rb
+++ b/test/functional/mirror_operations_test.rb
@@ -71,12 +71,15 @@ class MirrorOperationsTest < ActionController::TestCase
rec = GlobalRecord.find_by_title("Important Announcement")
rec.title = "Very Important Announcement"
rec.save
-
+
+ assert_equal 3, Group.find_by_name("Test Group").group_owned_records.size
+
post :upload_up_mirror, "id" => Group.find_by_name("Test Group").id, "mirror_data" => mirror_data
assert_nil Group.find_by_name("Test Group")
assert_not_nil Group.find_by_name("Renamed Group")
+ assert_equal 2, Group.find_by_name("Renamed Group").group_owned_records.size
assert_nil GroupOwnedRecord.find_by_description("First Item")
assert_not_nil GroupOwnedRecord.find_by_description("Absolutely The First Item")
assert_nil GroupOwnedRecord.find_by_description("Second Item") | Slightly more stringent functional test | DavidMikeSimon_offroad | train | rb |
5934d66268102c87bcb8d050c926943cf80cddec | diff --git a/src/sos/step_executor.py b/src/sos/step_executor.py
index <HASH>..<HASH> 100755
--- a/src/sos/step_executor.py
+++ b/src/sos/step_executor.py
@@ -1730,6 +1730,7 @@ class Base_Step_Executor:
else:
return [str(x) for x in targets._targets if isinstance(x, file_target)]
step_info = {
+ 'step_id': self.step.md5,
'start_time': self.start_time,
'stepname': self.step.step_name(True),
'substeps': len(self._substeps), | Passing step_id to report | vatlab_SoS | train | py |
53023feefd5566643cb998800a6463cecfc77ac6 | diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js
index <HASH>..<HASH> 100644
--- a/js/bootstrap-select.js
+++ b/js/bootstrap-select.js
@@ -406,7 +406,7 @@
title = typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText;
}
- this.$button.attr('title', htmlEscape(title));
+ this.$button.attr('title', htmlEscape($.trim(title)));
this.$newElement.find('.filter-option').html(title);
}, | Run a trim on the title before setting the title attribute on the button
Fixes problems with strangely formatted title boxes. | snapappointments_bootstrap-select | train | js |
df93865477294e9dae360ab775c85792b302be52 | diff --git a/txtorcon/endpoints.py b/txtorcon/endpoints.py
index <HASH>..<HASH> 100644
--- a/txtorcon/endpoints.py
+++ b/txtorcon/endpoints.py
@@ -693,9 +693,16 @@ class TorClientEndpoint(object):
@defer.inlineCallbacks
def connect(self, protocolfactory):
last_error = None
+
+ kwargs = dict()
+ if self.socks_username is not None and self.socks_password is not None:
+ kwargs['methods'] = dict(
+ login=(self.socks_username, self.socks_password),
+ )
+
+
if self.socks_endpoint is not None:
args = (self.host, self.port, self.socks_endpoint)
- kwargs = dict()
socks_ep = SOCKS5ClientEndpoint(*args, **kwargs)
proto = yield socks_ep.connect(protocolfactory)
defer.returnValue(proto)
@@ -707,14 +714,7 @@ class TorClientEndpoint(object):
self.socks_hostname,
self.socks_port,
)
-
args = (self.host, self.port, tor_ep)
- kwargs = dict()
- if self.socks_username is not None and self.socks_password is not None:
- kwargs['methods'] = dict(
- login=(self.socks_username, self.socks_password),
- )
-
socks_ep = SOCKS5ClientEndpoint(*args, **kwargs)
try: | Define kwargs once before the conditional | meejah_txtorcon | train | py |
2893248404bc36cd523d6ee6a2b39fac2a909a9d | diff --git a/integration/experimental/v3_restart_app_instance_command_test.go b/integration/experimental/v3_restart_app_instance_command_test.go
index <HASH>..<HASH> 100644
--- a/integration/experimental/v3_restart_app_instance_command_test.go
+++ b/integration/experimental/v3_restart_app_instance_command_test.go
@@ -275,7 +275,7 @@ var _ = Describe("v3-restart-app-instance command", func() {
restartedAppTableConsoleProcess, found = findConsoleProcess(restartedAppTable)
Expect(found).To(BeTrue())
- return fmt.Sprintf("%s, %s", firstAppTableConsoleProcess.Type, firstAppTableConsoleProcess.InstanceCount)
+ return fmt.Sprintf("%s, %s", restartedAppTableConsoleProcess.Type, restartedAppTableConsoleProcess.InstanceCount)
}).Should(MatchRegexp(`console, 1/1`))
return restartedAppTableConsoleProcess.Instances[0].Since | fix bad integration test assertion
[#<I>] | cloudfoundry_cli | train | go |
d1b335da47cc3d95a7b9ea7795cb9877cb22cd79 | diff --git a/SoftLayer/CLI/__init__.py b/SoftLayer/CLI/__init__.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/CLI/__init__.py
+++ b/SoftLayer/CLI/__init__.py
@@ -177,7 +177,8 @@ def parse_primary_args(argv):
execute_action(module_name, None, client=None, args=args)
sys.exit(0)
- return module_name, args, args.aux + aux_args
+ aux_args = args.aux + ["--format=%s" % args.fmt] + aux_args
+ return module_name, args, aux_args
def parse_module_args(module_name, argv): | Fixes --format not being injected to 2nd Parser
CLI: The issue here is that both the first parser and second parser want the --format
option. This seems like a hack. I wish to come up with a way to handle
multidimensional argument parsing to allow for sub-commands. | softlayer_softlayer-python | train | py |
cab75b4bf047429e663b1823ad8c079c47d94338 | diff --git a/src/react-spring/index.js b/src/react-spring/index.js
index <HASH>..<HASH> 100644
--- a/src/react-spring/index.js
+++ b/src/react-spring/index.js
@@ -1,10 +1,9 @@
-import spring from '@react-spring/animated'
import { TYPES } from '../utils/element'
import { applyDefaultProps } from '../utils/props'
const primitives = Object.keys(TYPES)
-const host = spring.createHost(primitives, {
+const host = require('@react-spring/animated').createHost(primitives, {
applyAnimatedValues(instance, props) {
if (!(instance.nodeType || instance.pluginName)) {
return false | Fix import of react-spring/animated in tests and build | inlet_react-pixi | train | js |
9ba04da008267009335e09a84d59f72448dd9d80 | diff --git a/lib/appsignal/version.rb b/lib/appsignal/version.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/version.rb
+++ b/lib/appsignal/version.rb
@@ -1,4 +1,4 @@
module Appsignal
- VERSION = '0.12.beta.6'
+ VERSION = '0.12.beta.7'
AGENT_VERSION = 'fc00f64'
end | Bump to <I>.beta<I> [ci skip] | appsignal_appsignal-ruby | train | rb |
6aa21815327f2fd034972dfba392da4b33f4ae70 | diff --git a/src/nu/validator/messages/MessageEmitterAdapter.java b/src/nu/validator/messages/MessageEmitterAdapter.java
index <HASH>..<HASH> 100644
--- a/src/nu/validator/messages/MessageEmitterAdapter.java
+++ b/src/nu/validator/messages/MessageEmitterAdapter.java
@@ -390,6 +390,8 @@ public class MessageEmitterAdapter implements ErrorHandler {
".*Unknown pseudo-element or pseudo-class \u201C:focus-within\u201D.*", //
".*leader(.+)is not a \u201Ccontent\u201D value.*", //
".*Property \u201Cfont-display\u201D doesn't exist.*", //
+ ".*Property \u201Crow-gap\u201D doesn't exist.*", //
+ ".*\u201Cstart\u201D is not a \u201Calign-content\u201D value.*", //
};
protected static final Pattern DEFAULT_FILTER_PATTERN = Pattern.compile( | Drop CSS row-gap and "align-content: start" errors
This change is a hack to work around the fact the CSS-checking backend
doesn’t yet have support for recognizing the CSS row-gap property
and the "start" value for the align-content property. So rather than
continuing to emit error messages for those (which is wrong, because
they’re not errors...), this change causes the checker to filter out
(drop/ignore/suppress) error messages about those.
Addresses <URL> | validator_validator | train | java |
f107a4bc33ce9c07023e901cdab621921768225c | diff --git a/addrs/provider_config.go b/addrs/provider_config.go
index <HASH>..<HASH> 100644
--- a/addrs/provider_config.go
+++ b/addrs/provider_config.go
@@ -84,6 +84,11 @@ func (pc ProviderConfig) Absolute(module ModuleInstance) AbsProviderConfig {
}
func (pc ProviderConfig) String() string {
+ if pc.Type == "" {
+ // Should never happen; always indicates a bug
+ return "provider.<invalid>"
+ }
+
if pc.Alias != "" {
return fmt.Sprintf("provider.%s.%s", pc.Type, pc.Alias)
} | addrs: Generate special string for invalid ProviderConfig
The zero value of ProviderConfig is not a valid provider config address,
so we'll generate a special string for that in order to make that clear
in case one sneaks in somewhere. This can happen, for example, in the
core flow of resolving provider inheritance during the ProviderTransformer
if a caller attempts to access the resolved provider before that
transformer has run. | hashicorp_terraform | train | go |
d67fef28d27b23baebc72ba268fd4b8d92596690 | diff --git a/unleash/plugins/docs.py b/unleash/plugins/docs.py
index <HASH>..<HASH> 100644
--- a/unleash/plugins/docs.py
+++ b/unleash/plugins/docs.py
@@ -58,6 +58,8 @@ def _get_doc_conf(ctx):
def _set_doc_version(ctx, version, version_short):
info = ctx['info']
conf = _get_doc_conf(ctx)
+ if not conf:
+ return
conf = replace_assign(conf, 'version', version_short)
conf = replace_assign(conf, 'release', version)
@@ -80,6 +82,8 @@ def lint_release(ctx):
theme_pkgs = ctx['opts']['sphinx_styles']
conf = _get_doc_conf(ctx)
+ if not conf:
+ return
# create doc virtualenv
with VirtualEnv.temporary() as ve: | Do not proceed with docs if no docs folder found. Otherwise, packages without documentation cannot be released. | mbr_unleash | train | py |
ff0ebc62fd7593ba933baa47b03622a5463a0a61 | diff --git a/lib/tdiff.rb b/lib/tdiff.rb
index <HASH>..<HASH> 100644
--- a/lib/tdiff.rb
+++ b/lib/tdiff.rb
@@ -115,14 +115,14 @@ module TDiff
# explicitly discard the c matrix
c = nil
- # recurse down through unchanged nodes
- unchanged.each { |x,y| x.tdiff(y,&block) }
- unchanged = nil
-
# sequentially iterate over the changed nodes
changes.each(&block)
changes = nil
+ # recurse down through unchanged nodes
+ unchanged.each { |x,y| x.tdiff(y,&block) }
+ unchanged = nil
+
return self
end
end | yield the changes before recursing. | postmodern_tdiff | train | rb |
6431622881deba607e3bdcb640c3e3817c0be0f0 | diff --git a/examples/reprojection.js b/examples/reprojection.js
index <HASH>..<HASH> 100644
--- a/examples/reprojection.js
+++ b/examples/reprojection.js
@@ -58,10 +58,9 @@ var layers = [];
layers['bng'] = new ol.layer.Tile({
source: new ol.source.XYZ({
projection: 'EPSG:27700',
- url: 'https://googledrive.com/host/0B0bm2WdRuvICflNqUmxEdUNOV0ZRUFQ3cXNXR' +
- 'FlOTm9MWmJxSDAxM2V5M1ZJX2lITE9oejA/{z}/{x}/{y}.png',
+ url: 'http://tileserver.maptiler.com/miniscale/{z}/{x}/{y}.png',
crossOrigin: '',
- maxZoom: 3
+ maxZoom: 6
})
}); | Use better URL for BNG tiles in reprojection example | openlayers_openlayers | train | js |
61beb8c5044af93fe6ea2a6431cc5cbed17e17ef | diff --git a/openapi_spec_validator/decorators.py b/openapi_spec_validator/decorators.py
index <HASH>..<HASH> 100644
--- a/openapi_spec_validator/decorators.py
+++ b/openapi_spec_validator/decorators.py
@@ -18,7 +18,8 @@ class DerefValidatorDecorator:
def __call__(self, func):
def wrapped(validator, schema_element, instance, schema):
- if not isinstance(instance, dict) or '$ref' not in instance:
+ if (not isinstance(instance, dict) or '$ref' not in instance
+ or not instance['$ref'].__hash__):
for res in func(validator, schema_element, instance, schema):
yield res
return | A `$ref` may be a property name and in such cases it's not hashable
This is not a "proper fix" as the proper fix should check if `$ref`
is used as a name of the property, but this works for the purposes of #<I>
fixes #<I> | p1c2u_openapi-spec-validator | train | py |
aa5daa1b82261417fd858cb8519e6290c42e4f03 | diff --git a/python/ray/dataframe/groupby.py b/python/ray/dataframe/groupby.py
index <HASH>..<HASH> 100644
--- a/python/ray/dataframe/groupby.py
+++ b/python/ray/dataframe/groupby.py
@@ -62,6 +62,25 @@ class DataFrameGroupBy(object):
else:
self._grouped_partitions = [df._row_partitions]
+ def __getattr__(self, key):
+ """Afer regular attribute access, looks up the name in the columns
+
+ Args:
+ key (str): Attribute name.
+
+ Returns:
+ The value of the attribute.
+ """
+ try:
+ return object.__getattribute__(self, key)
+ except AttributeError as e:
+ if key in self._columns:
+ raise NotImplementedError(
+ "SeriesGroupBy is not implemented."
+ "To contribute to Pandas on Ray, please visit "
+ "github.com/ray-project/ray.")
+ raise e
+
@property
def _iter(self):
from .dataframe import DataFrame | fixing zero length partitions (#<I>)
fixing bugs to fully handle zero len parts
resolve comments
renaming imports
Add getattr to groupby
testing | ray-project_ray | train | py |
361fa68f5e907a3d580942822683d89b62979f25 | diff --git a/lib/sigh/developer_center.rb b/lib/sigh/developer_center.rb
index <HASH>..<HASH> 100644
--- a/lib/sigh/developer_center.rb
+++ b/lib/sigh/developer_center.rb
@@ -244,7 +244,16 @@ module Sigh
# 2) Select the App ID
while not page.has_content?"Select App ID" do sleep 1 end
# example: <option value="RGAWZGXSY4">ABP (5A997XSHK2.net.sunapps.34)</option>
- first(:xpath, "//option[contains(text(), '.#{app_identifier})')]").select_option
+ identifiers = all(:xpath, "//option[contains(text(), '.#{app_identifier})')]")
+ if identifiers.count == 0
+ puts "Couldn't find App ID '#{app_identifier}'\nonly found:".red
+ all(:xpath, "//option").each do |current|
+ puts "\t- #{current.text}".yellow
+ end
+ raise "Could not find Apple ID '#{app_identifier}'.".red
+ else
+ identifiers.first.select_option
+ end
click_next
# 3) Select the certificate | Show nice error message if app identifier could not be found | fastlane_fastlane | train | rb |
c77e3062bb0583e7a89bfdb393ce0bc6a98c30c0 | diff --git a/src/main/java/com/synopsys/integration/blackduck/service/ProjectService.java b/src/main/java/com/synopsys/integration/blackduck/service/ProjectService.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/synopsys/integration/blackduck/service/ProjectService.java
+++ b/src/main/java/com/synopsys/integration/blackduck/service/ProjectService.java
@@ -189,6 +189,23 @@ public class ProjectService extends DataService {
}
}
+ /**
+ * If the project exists, it will be updated, otherwise, it will be created.
+ * If the version exists, it will be updated, otherwise, it will be created.
+ */
+ public ProjectVersionWrapper syncProjectVersion(final ProjectRequest projectRequest) {
+
+ }
+
+ public ProjectRequest createProjectRequest(final ProjectView projectView) {
+ final ProjectRequest projectRequest = new ProjectRequest();
+
+ projectRequest.name = projectView.name;
+ projectRequest.description = projectView.description;
+ projectRequest.
+ return projectRequest;
+ }
+
public void updateProjectAndVersion(final String projectUri, final ProjectRequest projectRequest) throws IntegrationException {
updateProjectAndVersion(hubService.getResponse(projectUri, ProjectView.class), projectRequest);
} | adding new sync method to project service | blackducksoftware_blackduck-common | train | java |
a84b7ab3b102ed1c34b31e5c030c268af3049885 | diff --git a/src/joint.dia.paper.js b/src/joint.dia.paper.js
index <HASH>..<HASH> 100644
--- a/src/joint.dia.paper.js
+++ b/src/joint.dia.paper.js
@@ -1150,10 +1150,15 @@ joint.dia.Paper = joint.mvc.View.extend({
return this;
},
+ clearGrid: function() {
+
+ this.el.style.backgroundImage = 'none';
+ return this;
+ },
+
drawGrid: function(opt) {
- opt = opt || {};
- _.defaults(opt, this.options.drawGrid, {
+ opt = _.defaults(opt || {}, this.options.drawGrid, {
color: '#aaa',
thickness: 1
});
@@ -1161,8 +1166,7 @@ joint.dia.Paper = joint.mvc.View.extend({
var gridSize = this.options.gridSize;
if (gridSize <= 1) {
- this.el.style.backgroundImage = 'none';
- return;
+ return this.clearGrid();
}
var currentScale = V(this.viewport).scale();
@@ -1189,6 +1193,8 @@ joint.dia.Paper = joint.mvc.View.extend({
var backgroundImage = canvas.toDataURL('image/png');
this.el.style.backgroundImage = 'url("' + backgroundImage + '")';
+
+ return this;
},
setInteractivity: function(value) { | dia.Paper: expose clearGrid() method (#<I>) | clientIO_joint | train | js |
5dfcb8994d8894b14cf5300755821b334f95c92c | diff --git a/sort.go b/sort.go
index <HASH>..<HASH> 100644
--- a/sort.go
+++ b/sort.go
@@ -39,13 +39,12 @@ func (s *sorter) Push(val interface{}) {
s.sl = reflect.Append(s.sl, reflect.ValueOf(val))
}
-func Sort(sl interface{}, less interface{}) interface{} {
+func SortSlice(sl interface{}, less interface{}) {
sorter := sorter{
sl: reflect.ValueOf(sl),
less: reflect.ValueOf(less),
}
sort.Sort(&sorter)
- return sorter.sl.Interface()
}
func addressableSlice(slice interface{}) reflect.Value { | Rename Sort->SortSlice, and don't return the slice | anacrolix_missinggo | train | go |
90984b6611dd48676760983debf9077e9af74dc9 | diff --git a/lib/amazon_auth/client.rb b/lib/amazon_auth/client.rb
index <HASH>..<HASH> 100644
--- a/lib/amazon_auth/client.rb
+++ b/lib/amazon_auth/client.rb
@@ -44,12 +44,15 @@ module AmazonAuth
end
def retry_signin_form_with_image_recognition
+ return true unless session.has_selector?('#signInSubmit')
session.fill_in 'ap_password', with: @password
if image_recognition_displayed?
input = ask "Got the prompt. Read characters from the image: "
session.fill_in 'auth-captcha-guess', with: input
end
+ sleep 1
session.click_on('signInSubmit')
+ sleep 2
end
def alert_displayed? | Improve the experience with captcha image | kyamaguchi_amazon_auth | train | rb |
33aee0a7de6ad50ee6cb0fe05c49bb81bdcafac1 | diff --git a/src/PatternLab/Watcher.php b/src/PatternLab/Watcher.php
index <HASH>..<HASH> 100644
--- a/src/PatternLab/Watcher.php
+++ b/src/PatternLab/Watcher.php
@@ -195,7 +195,7 @@ class Watcher extends Builder {
if (($fileName[0] != "_") && (!in_array($object->getExtension(),$ignoreExts)) && (!in_array($object->getFilename(),$ignoreDirs))) {
// catch directories that have the ignored dir in their path
- $ignoreDir = $this->ignoreDir($fileName);
+ $ignoreDir = FileUtil::ignoreDir($fileName);
// check to see if it's a new directory
if (!$ignoreDir && $object->isDir() && !isset($o->$fileName) && !is_dir($publicDir."/".$fileName)) { | setting the correct class for ignoreDir method | pattern-lab_patternlab-php-core | train | php |
24bb7936f972dcc11fd01f37d14129e528181648 | diff --git a/config-annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/WebClassesFinder.java b/config-annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/WebClassesFinder.java
index <HASH>..<HASH> 100644
--- a/config-annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/WebClassesFinder.java
+++ b/config-annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/WebClassesFinder.java
@@ -118,6 +118,12 @@ public class WebClassesFinder extends AbstractClassFinder
// get full URL for this entry
URL entryUrl = servletContext.getResource(relativePath.toString());
+ // Embedded Jetty bug?
+ if (entryUrl == null) {
+ log.warn("Unable to obtain URL for relative path: " + relativePath.toString());
+ continue;
+ }
+
// if this URL ends with .class it is a Java class
if (entryUrl.getPath().endsWith(".class"))
{ | Fixed NPE that appears when running Arquillian tests on embedded Jetty | ocpsoft_rewrite | train | java |
0a942a9b76c76c2618a5522fe67fdf319dd7d9d6 | diff --git a/tests/parser/syntax/test_code_size.py b/tests/parser/syntax/test_code_size.py
index <HASH>..<HASH> 100644
--- a/tests/parser/syntax/test_code_size.py
+++ b/tests/parser/syntax/test_code_size.py
@@ -23,10 +23,15 @@ def test_block_fail(bad_code):
valid_list = [
"""
@external
-def foo() -> int128:
+def foo() -> uint256:
x: address = 0x1234567890123456789012345678901234567890
return x.codesize
+ """,
"""
+@external
+def foo() -> uint256:
+ return self.codesize
+ """,
] | test: update address.codesize tests | ethereum_vyper | train | py |
daffd87200a0be5cfd67692356a7d391f978b9a6 | diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/plugin/v2/trigger.rb
+++ b/lib/vagrant/plugin/v2/trigger.rb
@@ -81,7 +81,7 @@ module Vagrant
match = false
if trigger.only_on
trigger.only_on.each do |o|
- if o.match?(guest_name)
+ if o.match(guest_name)
# trigger matches on current guest, so we're fine to use it
match = true
break | Use match over match? for Ruby <I> | hashicorp_vagrant | train | rb |
578fe1569d4182889abf3997815a3f383bf53538 | diff --git a/httprunner/client.py b/httprunner/client.py
index <HASH>..<HASH> 100644
--- a/httprunner/client.py
+++ b/httprunner/client.py
@@ -169,6 +169,8 @@ class HttpSession(requests.Session):
:param cert: (optional)
if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
"""
+ self.init_meta_data()
+
# record test name
self.meta_data["name"] = name
diff --git a/httprunner/runner.py b/httprunner/runner.py
index <HASH>..<HASH> 100644
--- a/httprunner/runner.py
+++ b/httprunner/runner.py
@@ -282,11 +282,9 @@ class Runner(object):
"""
self.meta_datas = []
config = testcase_dict.get("config", {})
- base_url = config.get("base_url")
- # each testcase should have individual session.
- http_client_session = self.http_client_session.__class__(base_url)
- test_runner = Runner(config, self.functions, http_client_session)
+ # each teststeps in one testcase (YAML/JSON) share the same session.
+ test_runner = Runner(config, self.functions, self.http_client_session)
tests = testcase_dict.get("teststeps", []) | each teststeps in one testcase share the same session. | HttpRunner_HttpRunner | train | py,py |
e95a01a94a8be0d327e3e9a837671913d9b064e7 | diff --git a/test/integration/10-cluster-broker-dynamic.js b/test/integration/10-cluster-broker-dynamic.js
index <HASH>..<HASH> 100644
--- a/test/integration/10-cluster-broker-dynamic.js
+++ b/test/integration/10-cluster-broker-dynamic.js
@@ -226,7 +226,7 @@ describe(require('../_lib/test-helper').testName(__filename, 3), function () {
});
}
- it.only('starts the cluster internal first, connects a client to the local instance, and is able to access the remote component via the broker, check we cannot access denied methods', function(done) {
+ it('starts the cluster internal first, connects a client to the local instance, and is able to access the remote component via the broker, check we cannot access denied methods', function(done) {
var thisClient; | test: removed only from test <I> | happner_happner-cluster | train | js |
e203d41944d9bbdc5a284f88c606424513bf2d70 | diff --git a/test/read_test.py b/test/read_test.py
index <HASH>..<HASH> 100644
--- a/test/read_test.py
+++ b/test/read_test.py
@@ -124,4 +124,29 @@ async def test_streaming_read(event_loop):
assert events_read == 3
+@pytest.mark.asyncio
+async def test_async_comprehension(event_loop):
+
+
+ async def embiggen(e):
+ data = e.json()
+ data['Height'] *= 10
+ data['Distance'] *= 10
+
+ stream_name = str(uuid.uuid4())
+
+ async with connect(loop=event_loop) as c:
+
+ await given_a_stream_with_three_events(c, stream_name)
+
+ jumps = (e async for e in c.iter(stream_name, batch_size=2) if e.type =='pony_jumped')
+ big_jumps = (embiggen(e) async for e in jumps)
+
+ events_read = 0
+
+ async for event in big_jumps:
+ events_read += 1
+
+ assert events_read == 3
+ | added test for async generators | madedotcom_photon-pump | train | py |
01efbac5a3e3fd9256546c886593c4611595940a | diff --git a/dvc/scm.py b/dvc/scm.py
index <HASH>..<HASH> 100644
--- a/dvc/scm.py
+++ b/dvc/scm.py
@@ -45,6 +45,10 @@ class Base(object):
pass
def brancher(self, branches=None, all_branches=False):
+ if not branches and not all_branches:
+ yield ''
+ return
+
saved = self.active_branch()
if not branches:
branches = self.list_branches() if all_branches else [saved] | brancher: don't checkout if no branches is specified | iterative_dvc | train | py |
b2c2c74e8cacf9ebe1a62ed918e4b831a45ed76b | diff --git a/src/org/jgroups/protocols/TP.java b/src/org/jgroups/protocols/TP.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/protocols/TP.java
+++ b/src/org/jgroups/protocols/TP.java
@@ -47,7 +47,7 @@ import java.util.concurrent.locks.ReentrantLock;
* The {@link #receive(Address, byte[], int, int)} method must
* be called by subclasses when a unicast or multicast message has been received.
* @author Bela Ban
- * @version $Id: TP.java,v 1.316 2010/07/29 09:29:51 belaban Exp $
+ * @version $Id: TP.java,v 1.317 2010/08/03 14:01:54 belaban Exp $
*/
@MBean(description="Transport protocol")
@DeprecatedProperty(names={"bind_to_all_interfaces", "use_incoming_packet_handler", "use_outgoing_packet_handler",
@@ -1463,6 +1463,7 @@ public abstract class TP extends Protocol {
pool.setThreadFactory(factory);
RejectedExecutionHandler handler=parseRejectionPolicy(rejection_policy);
pool.setRejectedExecutionHandler(new ShutdownRejectedExecutionHandler(handler));
+ pool.allowCoreThreadTimeOut(true);
return pool;
} | allow core thread in the default and OOB pools to time out | belaban_JGroups | train | java |
55bb85f7fdb619138c0a9d0bc3234bcf4bf20037 | diff --git a/spec/main-spec.js b/spec/main-spec.js
index <HASH>..<HASH> 100644
--- a/spec/main-spec.js
+++ b/spec/main-spec.js
@@ -28,4 +28,34 @@ describe('Promisify', function() {
})
})
})
+ it('works when Array.from is available', function() {
+ const _ = Array.from
+ Array.from = function(array) {
+ return Array.prototype.slice.call(array)
+ }
+ const callback = function(arg1, arg2) {
+ expect(arg1).toBe('something')
+ arg2(null, 'wow')
+ }
+ waitsForPromise(function() {
+ return promisify(callback)('something').then(function(retVal) {
+ expect(retVal).toBe(retVal)
+ Array.from = _
+ })
+ })
+ })
+ it('works when Array.from is not available', function() {
+ const _ = Array.from
+ Array.from = null
+ const callback = function(arg1, arg2) {
+ expect(arg1).toBe('something')
+ arg2(null, 'wow')
+ }
+ waitsForPromise(function() {
+ return promisify(callback)('something').then(function(retVal) {
+ expect(retVal).toBe(retVal)
+ Array.from = _
+ })
+ })
+ })
}) | :new: Add specs for both envs | steelbrain_promisify | train | js |
60b3a96cea4a07e2084567f2a0a657aebf4860da | diff --git a/lib/perpetuity/postgres/table/attribute.rb b/lib/perpetuity/postgres/table/attribute.rb
index <HASH>..<HASH> 100644
--- a/lib/perpetuity/postgres/table/attribute.rb
+++ b/lib/perpetuity/postgres/table/attribute.rb
@@ -1,3 +1,5 @@
+require "bigdecimal"
+
module Perpetuity
class Postgres
class Table | Require bigdecimal library to avoid undefined constant error | jgaskins_perpetuity-postgres | train | rb |
cec447212e398b9a4df8b2aab817b7961b383cfa | diff --git a/src/ObjectManager.php b/src/ObjectManager.php
index <HASH>..<HASH> 100755
--- a/src/ObjectManager.php
+++ b/src/ObjectManager.php
@@ -66,6 +66,7 @@ class ObjectManager
if (isset($this->objectsRepository[$oid])) {
$repository = $this->objectsRepository[$oid];
$data = $repository->getHydrator()->unhydrate($object);
+ $repository->removeObjectCache($object);
}
$id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid; | Fix clear of repository on unpersist | JoffreyPoreeCoding_MongoDB-ODM | train | php |
2ceef0f07c6529696eea6551ea7f87f77776662d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup
setup(
name='trezor',
- version='0.5.3',
+ version='0.5.4',
author='Bitcoin TREZOR',
author_email='info@bitcointrezor.com',
description='Python library for communicating with TREZOR Bitcoin Hardware Wallet',
@@ -27,7 +27,7 @@ setup(
'trezorlib.types_pb2',
],
test_suite='tests',
- install_requires=['ecdsa>=0.9', 'protobuf', 'mnemonic>=0.8', 'hidapi>=0.7.99'],
+ install_requires=['ecdsa>=0.9', 'protobuf==2.5.0', 'mnemonic>=0.8', 'hidapi>=0.7.99'],
include_package_data=True,
zip_safe=False,
classifiers=[ | pin protobuf dependency to <I> | trezor_python-trezor | train | py |
58fe557a9fe1723f5990f45379ea2d573f24ebbc | diff --git a/terraform/context_import_test.go b/terraform/context_import_test.go
index <HASH>..<HASH> 100644
--- a/terraform/context_import_test.go
+++ b/terraform/context_import_test.go
@@ -39,6 +39,33 @@ func TestContextImport_basic(t *testing.T) {
}
}
+func TestContextImport_missingType(t *testing.T) {
+ p := testProvider("aws")
+ ctx := testContext2(t, &ContextOpts{
+ Providers: map[string]ResourceProviderFactory{
+ "aws": testProviderFuncFixed(p),
+ },
+ })
+
+ p.ImportStateReturn = []*InstanceState{
+ &InstanceState{
+ ID: "foo",
+ },
+ }
+
+ _, err := ctx.Import(&ImportOpts{
+ Targets: []*ImportTarget{
+ &ImportTarget{
+ Addr: "aws_instance.foo",
+ ID: "bar",
+ },
+ },
+ })
+ if err == nil {
+ t.Fatal("should error")
+ }
+}
+
func TestContextImport_refresh(t *testing.T) {
p := testProvider("aws")
ctx := testContext2(t, &ContextOpts{ | terraform: test that missing type results in error on import | hashicorp_terraform | train | go |
fec84460bcbff9fdebd68341b2b389b20a781fa4 | diff --git a/src/Patchwork/Controller/FrontController.php b/src/Patchwork/Controller/FrontController.php
index <HASH>..<HASH> 100644
--- a/src/Patchwork/Controller/FrontController.php
+++ b/src/Patchwork/Controller/FrontController.php
@@ -43,7 +43,7 @@ class FrontController extends AbstractController
function () use ($app) {
$root = str_replace('index.php/', '', $app['url_generator']->generate('home'));
- if ($_SERVER['REQUEST_URI'] != $root) {
+ if ($app['request']->getRequestURI() != $root) {
return $app->redirect($root, 301);
} | got rid of native request uri check | neemzy_patchwork-core | train | php |
d77c8738505bc2234f5fcb24b0a66283072f6c79 | diff --git a/pyspider/database/mongodb/taskdb.py b/pyspider/database/mongodb/taskdb.py
index <HASH>..<HASH> 100644
--- a/pyspider/database/mongodb/taskdb.py
+++ b/pyspider/database/mongodb/taskdb.py
@@ -86,10 +86,10 @@ class TaskDB(SplitTableMixin, BaseTaskDB):
}
}])
result = {}
- if ret.get('result'):
- for each in ret['result']:
- result[each['_id']] = each['total']
- return result
+ if isinstance(ret, dict):
+ ret = ret.get('result', [])
+ for each in ret:
+ result[each['_id']] = each['total']
return result
def insert(self, project, taskid, obj={}): | fix aggregate for pymongo | binux_pyspider | train | py |
9abcec51128f3eeb2579741612b0a11defb3b28c | diff --git a/core/src/jlibs/core/util/i18n/I18N.java b/core/src/jlibs/core/util/i18n/I18N.java
index <HASH>..<HASH> 100644
--- a/core/src/jlibs/core/util/i18n/I18N.java
+++ b/core/src/jlibs/core/util/i18n/I18N.java
@@ -22,7 +22,7 @@ import jlibs.core.lang.model.ModelUtil;
*/
public class I18N{
@SuppressWarnings({"unchecked"})
- public static <T> T newInstance(Class<T> bundleClass){
+ public static <T> T getImplementation(Class<T> bundleClass){
try{
return (T)ModelUtil.findClass(bundleClass, BundleAnnotationProcessor.FORMAT).getDeclaredField("INSTANCE").get(null);
}catch(Exception ex){ | changed newInstance() to getImplementation() | santhosh-tekuri_jlibs | train | java |
df20f4f704a3803e7711c82bacd4d119ed2809a3 | diff --git a/src/jquery.slotmachine.js b/src/jquery.slotmachine.js
index <HASH>..<HASH> 100644
--- a/src/jquery.slotmachine.js
+++ b/src/jquery.slotmachine.js
@@ -422,7 +422,7 @@
*/
function _isVisible(){
if(self.settings.stopHidden === false){
- return false;
+ return true;
}
//Stop animation if element is [above||below] screen, best for performance
var above = $slot.offset().top > $(window).scrollTop() + $(window).height(),
@@ -598,4 +598,4 @@
}
};
-})( jQuery, window, document );
\ No newline at end of file
+})( jQuery, window, document ); | Fixing bug with stopHidden option.
The logic around the 'stopHidden' option was reversed — if stopHidden is false, we don't want it to stop when it's hidden, thus _isVisible() should return true even though it's not, since we want the animation to continue. It's a bit confusing semantically, which could be improved by changing some function names... | josex2r_jQuery-SlotMachine | train | js |
2a6db12efe0bafdc804e140f09132227b2d16416 | diff --git a/lib/mongoid/contextual/mongo.rb b/lib/mongoid/contextual/mongo.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid/contextual/mongo.rb
+++ b/lib/mongoid/contextual/mongo.rb
@@ -337,7 +337,7 @@ module Mongoid
# @since 3.1.0
def pluck(field)
normalized = klass.database_field_name(field)
- query.select(normalized => 1).map{ |doc| doc[normalized] }.compact
+ query.dup.select(normalized => 1).map{ |doc| doc[normalized] }.compact
end
# Skips the provided number of documents. | dup the query so the existing query is not modified | mongodb_mongoid | train | rb |
e19f676e937d968480e845df0292bc0a202df3c7 | diff --git a/bika/lims/content/bikasetup.py b/bika/lims/content/bikasetup.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/bikasetup.py
+++ b/bika/lims/content/bikasetup.py
@@ -24,7 +24,7 @@ class PrefixesField(RecordsField):
'prefix': 'Prefix',
'padding': 'Padding',
},
- 'subfield_readonly':{'portal_type': True,
+ 'subfield_readonly':{'portal_type': False,
'prefix': False,
'padding': False,
},
@@ -224,7 +224,7 @@ schema = BikaFolderSchema.copy() + Schema((
),
PrefixesField('Prefixes',
schemata = _("ID Server"),
- fixedSize=8,
+# fixedSize=8,
widget=RecordsWidget(
label = _("Prefixes"),
description = _("Prefixes description",
@@ -291,7 +291,6 @@ schema['title'].widget.visible = False
# Update the validation layer after change the validator in runtime
schema['title']._validationLayer()
-
class BikaSetup(folder.ATFolder):
security = ClassSecurityInfo()
schema = schema | Allow Prefixes to be edited. | senaite_senaite.core | train | py |
eb8b1f8c7f883be7cf70a8a3027f7e0c6aa05a1d | diff --git a/src/Exception/ConnectionException.php b/src/Exception/ConnectionException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/ConnectionException.php
+++ b/src/Exception/ConnectionException.php
@@ -2,4 +2,4 @@
namespace PHPFastCGI\FastCGIDaemon\Exception;
-class ConnectionException extends \Exception { }
+class ConnectionException extends \RuntimeException { }
diff --git a/src/Exception/ProtocolException.php b/src/Exception/ProtocolException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/ProtocolException.php
+++ b/src/Exception/ProtocolException.php
@@ -2,4 +2,4 @@
namespace PHPFastCGI\FastCGIDaemon\Exception;
-class ProtocolException extends \Exception { }
+class ProtocolException extends \RuntimeException { } | Extended RuntimeException rather than Exception | PHPFastCGI_FastCGIDaemon | train | php,php |
0b10f94a0663185a4bfdaae65d73e4977bca65a0 | diff --git a/oidc_provider/models.py b/oidc_provider/models.py
index <HASH>..<HASH> 100644
--- a/oidc_provider/models.py
+++ b/oidc_provider/models.py
@@ -90,6 +90,11 @@ class UserInfo(models.Model):
family_name = models.CharField(max_length=255, blank=True, null=True)
middle_name = models.CharField(max_length=255, blank=True, null=True)
nickname = models.CharField(max_length=255, blank=True, null=True)
+ gender = models.CharField(max_length=100, default='', blank=True, null=True)
+ birthdate = models.DateField(null=True)
+ zoneinfo = models.CharField(max_length=100, default='', blank=True,
+ null=True)
+ locale = models.CharField(max_length=100, default='', blank=True, null=True)
preferred_username = models.CharField(max_length=255, blank=True, null=True)
profile = models.URLField(default='', null=True, blank=True)
picture = models.URLField(default='', null=True, blank=True) | Adding removed fields that are required by the specs | juanifioren_django-oidc-provider | train | py |
323b1aed6055a6ecfb12ab17a861253ff5c8bd43 | diff --git a/library/client.js b/library/client.js
index <HASH>..<HASH> 100644
--- a/library/client.js
+++ b/library/client.js
@@ -961,10 +961,19 @@ for(var methodName in databaseMethods) {
client.prototype[methodName]=databaseMethods[methodName];
}
-var twitchMethods = require('./api/twitch');
-for(var methodName in twitchMethods) {
- client.prototype[methodName]=twitchMethods[methodName];
-}
+var fs = require("fs");
+fs.readdirSync(__dirname+'/api').forEach(function(file) {
+ var apiMethods = require(__dirname+'/api/' + file);
+ for(var methodName in apiMethods) {
+ client.prototype[methodName]=apiMethods[methodName];
+ }
+});
+fs.readdirSync(__dirname+'/utils').forEach(function(file) {
+ var utilsMethods = require(__dirname+'/utils/' + file);
+ for(var methodName in utilsMethods) {
+ client.prototype[methodName]=utilsMethods[methodName];
+ }
+});
exports.getDatabase = function() {
if (Database === null) { | Load api and utils directories. | twitch-irc_twitch-irc | train | js |
18b0dde7e13b2ffed86fc7a4b0012965adcd5f43 | diff --git a/lib/appy.js b/lib/appy.js
index <HASH>..<HASH> 100644
--- a/lib/appy.js
+++ b/lib/appy.js
@@ -58,9 +58,13 @@ module.exports = function(self) {
// of req and res to be able to do i18n magic
passReq: true,
// Set the redirect for after login passing req.user from Appy l.~208
- redirect: function(user){
+ redirect: function(req, callback) {
if (options.redirect) {
- return options.redirect(user);
+ if (options.redirect.length === 1) {
+ // bc
+ return callback(options.redirect(req.user));
+ }
+ return options.redirect(req, callback);
} else {
// This feels like overkill, because we're checking in Appy as well.
return '/'; | redirect option takes req, callback | apostrophecms_apostrophe | train | js |
fe4aef8198c057836c4826608d80d368f4c6e141 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@ setup(
'tqdm',
'array_split',
'pytrax',
- 'pyevtk',
+# 'pyevtk',
'numba',
'openpnm'],
author='Jeff Gostick', | removing pyevtk from setup temporarily | PMEAL_porespy | train | py |
284b923a6aca55ffdc199a439acabd25c6715a61 | diff --git a/test/phantom-test.js b/test/phantom-test.js
index <HASH>..<HASH> 100644
--- a/test/phantom-test.js
+++ b/test/phantom-test.js
@@ -13,7 +13,7 @@ var run = require('./fixture/run');
describe('phantom', function () {
- this.timeout(3000);
+ this.timeout(5000);
it('passes', function (done) {
run('passes', ['-R', 'tap'], function (code, stdout) { | Increase timeout for travis builds | mantoni_mochify.js | train | js |
0d5302dddcb9b1ba9f6a61efb43e3e79e25e3a53 | diff --git a/src/sap.m/src/sap/m/Token.js b/src/sap.m/src/sap/m/Token.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/Token.js
+++ b/src/sap.m/src/sap/m/Token.js
@@ -129,8 +129,11 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control'],
*/
Token.prototype.ontouchstart = function(oEvent) {
this.$().toggleClass("sapMTokenActive", true);
- if (sap.ui.Device.system.desktop && oEvent.originalEvent.button !== 0) {
- return; // only on left mouse button
+ if (sap.ui.Device.system.desktop && oEvent.originalEvent.button) {
+ /* there are two cases that should fire touch start event:
+ left button click in desktop, where value of button event is 0;
+ touch event in combi device, where value of button event is undefined.*/
+ return;
}
this._oSrcStartId = oEvent.target.id; | [FIX] sap.m.Token: token delete in combi device is fixed
Change-Id: I9de3bb<I>d5de7f9ec<I>f<I>b<I>e<I>d0af1
BCP: <I> | SAP_openui5 | train | js |
c1acf89cdf88f0de57b2a148f0f909603873cdcc | diff --git a/hypervisor/vm.go b/hypervisor/vm.go
index <HASH>..<HASH> 100644
--- a/hypervisor/vm.go
+++ b/hypervisor/vm.go
@@ -645,11 +645,13 @@ func (vm *Vm) Stats() *types.PodStats {
ctx := vm.ctx
if ctx.current != StateRunning {
+ vm.ctx.Log(WARNING, "could not get stats from non-running pod")
return nil
}
stats, err := ctx.DCtx.Stats(ctx)
if err != nil {
+ vm.ctx.Log(WARNING, "failed to get stats: %v", err)
return nil
}
return stats | print log if get vm stats failed | hyperhq_runv | train | go |
0f8bfe2dcaa79b2657fdddd2d38907f40467cd64 | diff --git a/src/message.js b/src/message.js
index <HASH>..<HASH> 100644
--- a/src/message.js
+++ b/src/message.js
@@ -240,19 +240,19 @@ Message.prototype.encrypt = function(keys, passwords) {
* @param {(Array<String>|String)} password(s) for message encryption
* @return {Array<module:message~Message>} new message with encrypted content
*/
-export function encryptSessionKey(sessionKey, symAlgo, keys, passwords) {
+export function encryptSessionKey(sessionKey, symAlgo, publicKeys, passwords) {
/** Convert to arrays if necessary */
- if (keys && !Array.prototype.isPrototypeOf(keys)) {
- keys = [keys];
+ if (publicKeys && !Array.prototype.isPrototypeOf(publicKeys)) {
+ publicKeys = [publicKeys];
}
if (passwords && !Array.prototype.isPrototypeOf(passwords)) {
passwords = [passwords];
}
var packetlist = new packet.List();
- if (keys) {
- keys.forEach(function(key) {
+ if (publicKeys) {
+ publicKeys.forEach(function(key) {
var encryptionKeyPacket = key.getEncryptionKeyPacket();
if (encryptionKeyPacket) {
var pkESKeyPacket = new packet.PublicKeyEncryptedSessionKey(); | Rename keys to publicKeys in message.encrypt() | openpgpjs_openpgpjs | train | js |
cd55d6e0e27387b90961f983266472aa9f8b8155 | diff --git a/src/BoomCMS/Database/Models/URL.php b/src/BoomCMS/Database/Models/URL.php
index <HASH>..<HASH> 100644
--- a/src/BoomCMS/Database/Models/URL.php
+++ b/src/BoomCMS/Database/Models/URL.php
@@ -71,7 +71,7 @@ class URL extends Model implements URLInterface
public function getPage()
{
if ($this->page === null) {
- $this->page = $this->belongsTo(Page::class, 'page_id')->first();
+ $this->page = $this->belongsTo(Page::class, 'page_id')->withTrashed()->first();
}
return $this->page;
diff --git a/tests/Database/Models/URLTest.php b/tests/Database/Models/URLTest.php
index <HASH>..<HASH> 100755
--- a/tests/Database/Models/URLTest.php
+++ b/tests/Database/Models/URLTest.php
@@ -27,6 +27,7 @@ class URLTest extends AbstractModelTestCase
$query = m::mock(Builder::class);
$query->shouldReceive('first')->andReturn($page);
+ $query->shouldReceive('withTrashed')->once()->andReturn($query);
$url = m::mock(URL::class)->makePartial();
$url->shouldReceive('belongsTo') | Bugfix: URL::getPage() needs to return trashed pages for moving a URL to work | boomcms_boom-core | train | php,php |
e76dc30ddb8120d78f8c1586984953b4b32c5e33 | diff --git a/src/wordcloud2.js b/src/wordcloud2.js
index <HASH>..<HASH> 100644
--- a/src/wordcloud2.js
+++ b/src/wordcloud2.js
@@ -544,7 +544,7 @@ if (!window.clearImmediate) {
};
/* Actually draw the text on the grid */
- var fillText = function fillText(gx, gy, info, word, weight,
+ var drawText = function drawText(gx, gy, info, word, weight,
distance, theta, rotate) {
var fontSize = info.fontSize;
var mu = info.mu;
@@ -673,7 +673,7 @@ if (!window.clearImmediate) {
return false;
// Actually put the text on the canvas
- fillText(gx, gy, info, word, weight,
+ drawText(gx, gy, info, word, weight,
(maxRadius - r), gxy[2], rotate);
// Mark the spaces on the grid as filled | fillText() -> drawText() | timdream_wordcloud2.js | train | js |
1355a069040dac21c408cdda61a5ef8d7fa6b3b3 | diff --git a/test/util.js b/test/util.js
index <HASH>..<HASH> 100644
--- a/test/util.js
+++ b/test/util.js
@@ -5,12 +5,10 @@ const chai = require('chai');
const assert = chai.assert;
function testRender(template, data, expected) {
- return done => {
+ return () =>
mustachio.string(template).render(data).string().then(actual => {
assert.equal(expected, actual);
- done();
- }).catch(done);
- };
+ });
}
function expectError(template, data) { | Cleanup. Give promises directly to Mocha | maghoff_mustachio | train | js |
d8af9cd81afcfcd6904f60e9a669ec17470352a4 | diff --git a/trustroot.py b/trustroot.py
index <HASH>..<HASH> 100644
--- a/trustroot.py
+++ b/trustroot.py
@@ -214,6 +214,7 @@ def _test():
assertValid('http://*.b.foo.com', 'http://b.foo.com', True)
assertValid('http://*.b.foo.com', 'http://x.b.foo.com', True)
assertValid('http://*.bar.co.uk', 'http://www.bar.co.uk', True)
+ assertValid('http://*.uoregon.edu', 'http://*.cs.uoregon.edu', True)
assertValid('http://*.com', 'http://foo.com', False)
assertValid('http://*.foo.com', 'http://bar.com', False) | [project @ added a test to trustroot] | openid_python-openid | train | py |
159f85d413987d88730bffad7abfc5617d4721ab | diff --git a/src/Anonym/Bootstrap/AliasNotFoundException.php b/src/Anonym/Bootstrap/AliasNotFoundException.php
index <HASH>..<HASH> 100644
--- a/src/Anonym/Bootstrap/AliasNotFoundException.php
+++ b/src/Anonym/Bootstrap/AliasNotFoundException.php
@@ -15,6 +15,11 @@ use Exception;
class AliasNotFoundException extends Exception
{
+ /**
+ * throw the exception
+ *
+ * @param string $message the message of exception
+ */
public function __construct($message = '')
{
$this->message = $message; | added comment lines to __construct method | AnonymPHP_Anonym-Library | train | php |
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.