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 |
|---|---|---|---|---|---|
05e077c6ef5e1aafaf5db46e76690bf79739fd7c | diff --git a/src/main/jquery.continuous-calendar.js b/src/main/jquery.continuous-calendar.js
index <HASH>..<HASH> 100755
--- a/src/main/jquery.continuous-calendar.js
+++ b/src/main/jquery.continuous-calendar.js
@@ -37,7 +37,7 @@
}
var params = $.extend(defaults, options)
var Status = {
- CREATE:'create',
+ CREATE_OR_RESIZE:'create',
MOVE:'move',
NONE:'none'
}
@@ -305,7 +305,7 @@
}
if (enabledCell(elem)) {
- status = Status.CREATE
+ status = Status.CREATE_OR_RESIZE
mouseDownDate = elem.date
if (mouseDownDate.equalsOnlyDate(selection.end)) {
mouseDownDate = selection.start
@@ -365,7 +365,7 @@
selection = movedSelection
}
break
- case Status.CREATE:
+ case Status.CREATE_OR_RESIZE:
var newSelection = new DateRange(mouseDownDate, date)
if(isPermittedRange(newSelection)) {
selection = newSelection | rename constant to more rescriptive | continuouscalendar_dateutils | train | js |
200f62c09f242659114058a924115fe24f4aa8da | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,6 +1,9 @@
import sys
import os
+sys.path.insert(0, os.path.abspath('..'))
+
+
from mo import __version__ | Add path to M-O in docs generation | thomasleese_mo | train | py |
53754ec1bfe895d07553cff60d59cc6fc2e7c98d | diff --git a/lib/rules/max-statements-per-line.js b/lib/rules/max-statements-per-line.js
index <HASH>..<HASH> 100644
--- a/lib/rules/max-statements-per-line.js
+++ b/lib/rules/max-statements-per-line.js
@@ -21,7 +21,8 @@ module.exports = {
type: "object",
properties: {
max: {
- type: "integer"
+ type: "integer",
+ minimum: 0
}
},
additionalProperties: false | Update: max in `max-statements-per-line` should be >=0 (fixes #<I>) (#<I>) | eslint_eslint | train | js |
4ddeeb84195fa29c964ef2e55661b669c310baeb | diff --git a/core/src/main/java/hudson/util/io/TarArchiver.java b/core/src/main/java/hudson/util/io/TarArchiver.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/util/io/TarArchiver.java
+++ b/core/src/main/java/hudson/util/io/TarArchiver.java
@@ -61,6 +61,7 @@ final class TarArchiver extends Archiver {
// so don't do anything in flush
}
});
+ tar.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_STAR);
tar.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
} | FIXED JENKINS-<I>] - Enable BigNumber mode to support archiving of files with size >8Gb
BIGNUMBER_STAR mode has been selected, because it utilizes GNU extensions (like LONGFILE_GNU does). | jenkinsci_jenkins | train | java |
7cb4d804e2657485c5345ad0a912c4dfe176f147 | diff --git a/mmcv/version.py b/mmcv/version.py
index <HASH>..<HASH> 100644
--- a/mmcv/version.py
+++ b/mmcv/version.py
@@ -1 +1 @@
-__version__ = '0.2.11'
+__version__ = '0.2.12' | update to <I> (#<I>) | open-mmlab_mmcv | train | py |
4c227131d01d9bfe447db577c5af1b7977f657f9 | diff --git a/src/Configuration.php b/src/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/Configuration.php
+++ b/src/Configuration.php
@@ -67,7 +67,7 @@ class Configuration
$match = array();
// Type matching
- if (preg_match('/^type:(.*)$/gi', $spec, $match)) {
+ if (preg_match('/^type:(.*)$/', $spec, $match)) {
$this->types[$match[1]] = $pattern;
} // Else it must be the package name.
else { | Fix preg_match call with removing unsupported/unneeded modifiers | davidbarratt_custom-installer | train | php |
4bc9dfc6f8ca63ec8b5f1500904b332539df9e55 | diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php
index <HASH>..<HASH> 100644
--- a/src/Executor/Executor.php
+++ b/src/Executor/Executor.php
@@ -6,6 +6,7 @@ namespace GraphQL\Executor;
use ArrayAccess;
use ArrayObject;
+use Closure;
use Exception;
use GraphQL\Error\Error;
use GraphQL\Error\InvariantViolation;
@@ -1523,6 +1524,7 @@ class Executor
}
}
- return is_callable($property) ? $property($source, $args, $context, $info) : $property;
+ // Using instanceof vs is_callable() because it is 2-10 times faster
+ return $property instanceof Closure ? $property($source, $args, $context, $info) : $property;
}
} | Reverted unneeded change in the defaultFieldResolver | webonyx_graphql-php | train | php |
0c5dc79f06034062283233f2c2d7d0a205c7cafe | diff --git a/tests/base_tests.py b/tests/base_tests.py
index <HASH>..<HASH> 100644
--- a/tests/base_tests.py
+++ b/tests/base_tests.py
@@ -109,7 +109,9 @@ class OrdbokPrivateConfigFileTestCase(unittest.TestCase):
self.private_config_file]
)
- @fudge.patch('ordbok.private.open_wrapper')
+ @unittest.skipIf(os.environ.get('SKIP_ENCRYPT_TEST'),
+ 'as env var to skip lengthy test')
+ @fudge.patch('ordbok.config_private.open_wrapper')
def test_ordbok_private_config(self, fudged_open):
fudged_config_files_with_private = deepcopy(fudged_config_files)
fudged_config_files_with_private.update({ | fix broken test, add script to run tests that skips the long running encrpytion test | eriktaubeneck_ordbok | train | py |
e2c996815c00a2f1ab7c4d5233bf7e84cbbcb11d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup
setup(
name='django-scheduler',
- version='0.7.3',
+ version='0.7.4',
description='A calendaring app for Django.',
author='Leonardo Lazzaro',
author_email='lazzaroleonardo@gmail.com', | update version for new pypi release | llazzaro_django-scheduler | train | py |
5750a4830481fbc6b76c66062cffdc462c28a1bc | diff --git a/src/Dflydev/Hawk/Header/HeaderFactory.php b/src/Dflydev/Hawk/Header/HeaderFactory.php
index <HASH>..<HASH> 100644
--- a/src/Dflydev/Hawk/Header/HeaderFactory.php
+++ b/src/Dflydev/Hawk/Header/HeaderFactory.php
@@ -30,16 +30,14 @@ class HeaderFactory
);
}
- public static function createFromHeaderObjectOrString($fieldName, $headerObjectOrString, callable $onError)
+ public static function createFromHeaderObjectOrString($fieldName, $headerObjectOrString, $onError)
{
if (is_string($headerObjectOrString)) {
return static::createFromString($fieldName, $headerObjectOrString);
} elseif ($headerObjectOrString instanceof Header) {
return $headerObjectOrString;
} else {
- throw new \InvalidArgumentException(
- 'Header must either be a string or an instance of "Dflydev\Hawk\Header\Header"'
- );
+ call_user_func($onError);
}
}
} | Remove callable for php <I> compat. | dflydev_dflydev-hawk | train | php |
ba3f7b2e2ab4100c94aeee4c2b539e070d47fb19 | diff --git a/lib/pronto/rubocop.rb b/lib/pronto/rubocop.rb
index <HASH>..<HASH> 100644
--- a/lib/pronto/rubocop.rb
+++ b/lib/pronto/rubocop.rb
@@ -21,11 +21,12 @@ module Pronto
offences.map do |offence|
patch.added_lines.select { |line| line.new_lineno == offence.line }
- .map { |line| new_message(patch, offence, line) }
+ .map { |line| new_message(offence, line) }
end
end
- def new_message(patch, offence, line)
+ def new_message(offence, line)
+ patch = line.hunk.owner
path = patch.delta.new_file[:path]
level = level(offence.severity) | Access patch from line instead of passing as parameter | prontolabs_pronto-rubocop | train | rb |
5bd77f547db6100b1e2f6e7d604c2f4be825441f | diff --git a/topology/probes/netlink.go b/topology/probes/netlink.go
index <HASH>..<HASH> 100644
--- a/topology/probes/netlink.go
+++ b/topology/probes/netlink.go
@@ -206,6 +206,9 @@ func (u *NetLinkProbe) addLinkToTopology(link netlink.Link) {
defer u.Graph.Unlock()
driver, _ := ethtool.DriverName(link.Attrs().Name)
+ if driver == "" && link.Type() == "bridge" {
+ driver = "bridge"
+ }
metadatas := graph.Metadatas{
"Name": link.Attrs().Name, | Force driver to bridge when link type is bridge
The link can be added without the driver set first and then updated to a
bridge which leads to have twice the same node in the graph. With this
patch a bridge is always seen as a bridge. | skydive-project_skydive | train | go |
8262ca60fb516aa94e96d983a97c408547bf3021 | diff --git a/modules/search-filter/js/search-filter_directive.js b/modules/search-filter/js/search-filter_directive.js
index <HASH>..<HASH> 100644
--- a/modules/search-filter/js/search-filter_directive.js
+++ b/modules/search-filter/js/search-filter_directive.js
@@ -86,9 +86,9 @@
}
}
- LxSearchFilterController.$inject = ['$element', '$scope', 'LxDropdownService', 'LxNotificationService', 'LxUtils'];
+ LxSearchFilterController.$inject = ['$element', '$scope', '$timeout', 'LxDropdownService', 'LxNotificationService', 'LxUtils'];
- function LxSearchFilterController($element, $scope, LxDropdownService, LxNotificationService, LxUtils)
+ function LxSearchFilterController($element, $scope, $timeout, LxDropdownService, LxNotificationService, LxUtils)
{
var lxSearchFilter = this;
var debouncedAutocomplete;
@@ -129,7 +129,9 @@
if (!input.val())
{
- lxSearchFilter.modelController.$setViewValue(undefined);
+ $timeout(function() {
+ lxSearchFilter.modelController.$setViewValue(undefined);
+ }, 500);
}
}
@@ -375,4 +377,4 @@
return _newValue;
}
}
-})();
\ No newline at end of file
+})(); | fix search-filter: wait before changing the view value
Otherwise, the lx-select with filter wasn't working fine when scrolling | lumapps_lumX | train | js |
8fa5dee1b1c749803c34f701565f81ee2196ba86 | diff --git a/src/Str.php b/src/Str.php
index <HASH>..<HASH> 100644
--- a/src/Str.php
+++ b/src/Str.php
@@ -100,7 +100,7 @@ final class Str implements \Countable {
public function endsWith($suffix) {
$other = new Str($suffix, $this->charset);
- return mb_strpos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());
+ return mb_strrpos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());
}
/**
@@ -114,7 +114,7 @@ final class Str implements \Countable {
public function endsWithIgnoreCase($suffix) {
$other = new Str($suffix, $this->charset);
- return mb_stripos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());
+ return mb_strripos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());
}
/** | Fix 'endsWith' and 'endsWithIgnoreCase' for duplicate occurrences | delight-im_PHP-Str | train | php |
5f7f68ff5b8f4fcf1b63776d643bce22accd2a7b | diff --git a/tests/integration/go_ethereum/common.py b/tests/integration/go_ethereum/common.py
index <HASH>..<HASH> 100644
--- a/tests/integration/go_ethereum/common.py
+++ b/tests/integration/go_ethereum/common.py
@@ -19,6 +19,9 @@ from web3._utils.module_testing import ( # noqa: F401
VersionModuleTest,
Web3ModuleTest,
)
+from web3.types import (
+ BlockData,
+)
if TYPE_CHECKING:
from web3 import ( # noqa: F401
@@ -82,6 +85,16 @@ class GoEthereumEthModuleTest(EthModuleTest):
) -> None:
super().test_eth_wait_for_transaction_receipt_unmined(w3, unlocked_account_dual_type)
+ @pytest.mark.xfail(reason='Inconsistently creating timeout issues.', strict=False)
+ def test_eth_get_raw_transaction_by_block(
+ self, w3: "Web3",
+ unlocked_account_dual_type: ChecksumAddress,
+ block_with_txn: BlockData,
+ ) -> None:
+ super().test_eth_get_raw_transaction_by_block(
+ w3, unlocked_account_dual_type, block_with_txn
+ )
+
class GoEthereumVersionModuleTest(VersionModuleTest):
@pytest.mark.xfail(reason='eth_protocolVersion was removed in Geth 1.10.0') | More flaky tests with timeouts added to loose xfail list | ethereum_web3.py | train | py |
954dc404c956666fc5f981a3ad58f5cf85edfd4f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,7 @@ setuptools.setup(
'sparqlwrapper',
'prefixcommons',
'marshmallow==3.0.0b11',
- 'scipy',
+ 'scipy==1.4.1',
'pandas==0.24.2',
'click==7.0',
'yamldown', | locking scipy to a version | biolink_ontobio | train | py |
26d74c238d2d44694150ebe3fc0b0a2bb5b5987c | diff --git a/bin/aws.rb b/bin/aws.rb
index <HASH>..<HASH> 100755
--- a/bin/aws.rb
+++ b/bin/aws.rb
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
-$:.unshift(File.join(File.dirname(File.dirname(__FILE__)), 'lib'))
+root = File.dirname(File.dirname(__FILE__))
+$:.unshift(File.join(root, 'lib'))
+$:.unshift(File.join(root, 'vendor', 'seahorse', 'lib'))
require 'rubygems'
require 'optparse' | Push seahorse onto load path in bin/aws.rb | aws_aws-sdk-ruby | train | rb |
984faa5d6073cf6c88f70c8285d06406820e1247 | diff --git a/controller.js b/controller.js
index <HASH>..<HASH> 100644
--- a/controller.js
+++ b/controller.js
@@ -3,11 +3,11 @@ const DARK_ICE = 'darkice';
var ctl = require('sysctlx');
function parseEnableResponse(raw) {
- return raw == '' || raw.match(/created symlink/i);
+ return raw === '' || raw.match(/created symlink/i) !== null;
}
function parseDisableResponse(raw) {
- return raw == '' || raw.match(/removed/i);
+ return raw == '' || raw.match(/removed/i) !== null;
}
exports.enableDarkIce = function (request, response) { | Fixed enable/disable response parsing | plesatejvlk_systemctl-rest | train | js |
a0c37632a4c0692121f49ed71bdcfdb27de024be | diff --git a/lib/installer.rb b/lib/installer.rb
index <HASH>..<HASH> 100644
--- a/lib/installer.rb
+++ b/lib/installer.rb
@@ -16,7 +16,7 @@ module CocoaPodsKeys
key_master = KeyMaster.new(keyring)
keys_folder = File.join(@sandbox_root, 'Keys')
- keys_headers_folder = File.join(@sandbox_root, 'Headers', 'CocoaPods-Keys')
+ keys_headers_folder = File.join(@sandbox_root, 'Headers', 'Public', 'CocoaPods-Keys')
interface_file = File.join(keys_headers_folder, key_master.name + '.h')
implementation_file = File.join(keys_folder, key_master.name + '.m')
Dir.mkdir keys_folder unless Dir.exists? keys_folder | Place the headers in the public header directory. | orta_cocoapods-keys | train | rb |
fa82133883198d5237cba6c5ac02cb0317e659e9 | diff --git a/lib/sem4r/ad_group_criterion/ad_group_criterion.rb b/lib/sem4r/ad_group_criterion/ad_group_criterion.rb
index <HASH>..<HASH> 100644
--- a/lib/sem4r/ad_group_criterion/ad_group_criterion.rb
+++ b/lib/sem4r/ad_group_criterion/ad_group_criterion.rb
@@ -38,10 +38,7 @@ module Sem4r
end
def self.from_element(ad_group, el)
- type = el.elements["AdGroupCriterion.Type"].text.strip
- #=======
- # type = el.at_xpath("AdGroupCriterion.Type").text.strip
- #>>>>>>> wordtracker/master
+ type = el.at_xpath("AdGroupCriterion.Type").text.strip
klass = Module::const_get(type)
klass.from_element(ad_group, el)
end | nokogiri (to be continued) | 26fe_sem4r | train | rb |
534bdb5be3ed03a1e640b60297adb878d07f7a7e | diff --git a/bin/publish.py b/bin/publish.py
index <HASH>..<HASH> 100755
--- a/bin/publish.py
+++ b/bin/publish.py
@@ -288,7 +288,7 @@ def commit_new_version(version):
stderr=subprocess.STDOUT,
)
subprocess.check_output(
- ['git', 'commit', '--no-verify', '-m', '\'{version}\''.format(version=version)],
+ ['git', 'commit', '--no-verify', '-m', '{version}'.format(version=version)],
stderr=subprocess.STDOUT,
)
except subprocess.CalledProcessError as exc_info: | Remove extraneous single quotes (#<I>) | dagster-io_dagster | train | py |
86abbb03260e584cbad78faa2cfaab7b2c56034c | diff --git a/redisson/src/main/java/org/redisson/RedissonMapCache.java b/redisson/src/main/java/org/redisson/RedissonMapCache.java
index <HASH>..<HASH> 100644
--- a/redisson/src/main/java/org/redisson/RedissonMapCache.java
+++ b/redisson/src/main/java/org/redisson/RedissonMapCache.java
@@ -1959,7 +1959,13 @@ public class RedissonMapCache<K, V> extends RedissonMap<K, V> implements RMapCac
List<Object> keys = Arrays.<Object>asList(getName(), getTimeoutSetName(), getIdleSetName(), getLastAccessTimeSetName(), getOptionsName());
return super.sizeInMemoryAsync(keys);
}
-
+
+ @Override
+ public void clear() {
+ RFuture<Boolean> future = deleteAsync(getName(), getTimeoutSetName(), getIdleSetName(), getLastAccessTimeSetName());
+ get(future);
+ }
+
@Override
public RFuture<Boolean> deleteAsync() {
return deleteAsync(getName(), getTimeoutSetName(), getIdleSetName(), getLastAccessTimeSetName(), getOptionsName()); | Fixed - RMapCache.clear() method shouldn't clear maxSize option #<I> | redisson_redisson | train | java |
e8594e1f055e0faf967cf843cfa2dad96b32e5a5 | diff --git a/Kwc/FulltextSearch/Search/Component.php b/Kwc/FulltextSearch/Search/Component.php
index <HASH>..<HASH> 100644
--- a/Kwc/FulltextSearch/Search/Component.php
+++ b/Kwc/FulltextSearch/Search/Component.php
@@ -24,7 +24,7 @@ class Kwc_FulltextSearch_Search_Component extends Kwc_Abstract_Composite_Compone
{
$index = Kwf_Util_Fulltext::getInstance();
- if (isset($postData['query'])) {
+ if (isset($postData['query']) && is_string($postData['query'])) {
$queryString = $postData['query'];
} else {
$queryString = ''; | fix error if query is passed as array | koala-framework_koala-framework | train | php |
8febf9d4812375fab59147c9380a06c70920ef7f | diff --git a/blaze/models.go b/blaze/models.go
index <HASH>..<HASH> 100644
--- a/blaze/models.go
+++ b/blaze/models.go
@@ -205,7 +205,9 @@ func (f *File) Validate() error {
return ValidateType(f.Type)
})
- if f.State != Uploading {
+ if f.State == Uploading {
+ v.Value("Size", false, stick.IsMinInt(0))
+ } else {
v.Value("Size", false, stick.IsMinInt(1))
} | blaze: ensure file size is not negative | 256dpi_fire | train | go |
fb8332ad293d13e24502d9be0f87bdcbe4fdd2f6 | diff --git a/dot_parser.py b/dot_parser.py
index <HASH>..<HASH> 100644
--- a/dot_parser.py
+++ b/dot_parser.py
@@ -1,4 +1,3 @@
-# -*- coding: Latin-1 -*-
"""Graphviz's dot language parser.
The dotparser parses graphviz files in
diff --git a/pydot.py b/pydot.py
index <HASH>..<HASH> 100644
--- a/pydot.py
+++ b/pydot.py
@@ -1,4 +1,3 @@
-# -*- coding: Latin-1 -*-
"""Graphviz's dot language Python interface.
This module provides with a full interface to
diff --git a/test/pydot_unittest.py b/test/pydot_unittest.py
index <HASH>..<HASH> 100644
--- a/test/pydot_unittest.py
+++ b/test/pydot_unittest.py
@@ -1,5 +1,3 @@
-# coding=iso-8859-1
-
# TODO:
# -test graph generation APIs (from adjacency, etc..)
# -test del_node, del_edge methods | MAI: rm outdated comments declaring encoding | pydot_pydot | train | py,py,py |
8a66acfc0981b15a321e6443d62969e96d11e778 | diff --git a/helpers/sentry.js b/helpers/sentry.js
index <HASH>..<HASH> 100644
--- a/helpers/sentry.js
+++ b/helpers/sentry.js
@@ -44,7 +44,7 @@ const setupSentry = function () {
const domain = getDomain()
const environment = getEnvironmentFromDomain(domain)
Raven.config(SENTRY_DSN, { release, environment }).install(afterFatalError)
- Raven.mergeContext({ extra: {domain} })
+ Raven.mergeContext({ tags: {domain} })
isRavenConfigured = true
log('info', 'Raven configured !')
} catch (e) { | ✨ feat: put domain as a tag in raven | konnectors_libs | train | js |
fc7c78b25b5a0e2122bea28240cad239bd7d0ba2 | diff --git a/redisCacheModule.js b/redisCacheModule.js
index <HASH>..<HASH> 100644
--- a/redisCacheModule.js
+++ b/redisCacheModule.js
@@ -120,6 +120,9 @@ function redisCacheModule(config){
if(!err && response){
refreshKeys[key] = {expiration: exp, lifeSpan: expiration, refresh: refresh};
}
+ else{
+ self.db.setex(key, expiration, value, cb);
+ }
});
}
else{
diff --git a/test/server/redis-cache-module.js b/test/server/redis-cache-module.js
index <HASH>..<HASH> 100644
--- a/test/server/redis-cache-module.js
+++ b/test/server/redis-cache-module.js
@@ -76,7 +76,7 @@ describe('redisCacheModule Tests', function () {
cb(null, 1);
}
redisCache.set(key, value, 1, function (){
- redisCache.set(key, value, 1, refresh, function (err, result){
+ redisCache.set(key, value, 1, refresh, function (err, result){
setTimeout(function(){
redisCache.get(key, function (err, response){
expect(response).toBe(null); | Falling back to setex when refresh is passed but rejected. | jpodwys_cache-service-redis | train | js,js |
0b3b8afc8488c222a8cd99b80fccc2ba0b01ecc9 | diff --git a/patch.go b/patch.go
index <HASH>..<HASH> 100644
--- a/patch.go
+++ b/patch.go
@@ -42,7 +42,7 @@ func newLazyNode(raw *json.RawMessage) *lazyNode {
func (n *lazyNode) MarshalJSON() ([]byte, error) {
switch n.which {
case eRaw:
- return *n.raw, nil
+ return json.Marshal(n.raw)
case eDoc:
return json.Marshal(n.doc)
case eAry:
diff --git a/patch_test.go b/patch_test.go
index <HASH>..<HASH> 100644
--- a/patch_test.go
+++ b/patch_test.go
@@ -132,6 +132,10 @@ var MutationTestCases = []BadCase{
`{ "foo": "bar", "qux": { "baz": 1, "bar": null } }`,
`[ { "op": "remove", "path": "/qux/bar" } ]`,
},
+ {
+ `{ "foo": "bar", "qux": { "baz": 1, "bar": null } }`,
+ `[ { "op": "replace", "path": "/qux/baz", "value": null } ]`,
+ },
}
var BadCases = []BadCase{ | Allow patching to a null value | evanphx_json-patch | train | go,go |
99ab9405fa51266d639f477f96fefe2e7229968f | diff --git a/lib/puppet/provider/nameservice/netinfo.rb b/lib/puppet/provider/nameservice/netinfo.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider/nameservice/netinfo.rb
+++ b/lib/puppet/provider/nameservice/netinfo.rb
@@ -1,5 +1,7 @@
-# Manage NetInfo POSIX objects. Probably only used on OS X, but I suppose
-# it could be used elsewhere.
+# Manage NetInfo POSIX objects.
+#
+# This provider has been deprecated. You should be using the directoryservice
+# nameservice provider instead.
require 'puppet'
require 'puppet/provider/nameservice'
@@ -46,6 +48,7 @@ class NetInfo < Puppet::Provider::NameService
end
def self.instances
+ warnonce "The NetInfo provider is deprecated; use directoryservice instead"
report(@resource_type.validproperties).collect do |hash|
self.new(hash)
end
@@ -131,6 +134,7 @@ class NetInfo < Puppet::Provider::NameService
end
def ensure=(arg)
+ warnonce "The NetInfo provider is deprecated; use directoryservice instead"
super
# Because our stupid type can't create the whole thing at once,
@@ -202,6 +206,7 @@ class NetInfo < Puppet::Provider::NameService
# Get a report for a single resource, not the whole table
def single_report(*properties)
+ warnonce "The NetInfo provider is deprecated; use directoryservice instead"
self.class.report(*properties).find do |hash| hash[:name] == self.name end
end | Warn that the NetInfo nameservice provider is deprecated. Use directoryservice instead | puppetlabs_puppet | train | rb |
787eff994d36f0e2a2c5c8f01ec6f6bc4b1388b9 | diff --git a/library/CM/Model/StorageAdapter/Database.php b/library/CM/Model/StorageAdapter/Database.php
index <HASH>..<HASH> 100644
--- a/library/CM/Model/StorageAdapter/Database.php
+++ b/library/CM/Model/StorageAdapter/Database.php
@@ -11,9 +11,6 @@ class CM_Model_StorageAdapter_Database extends CM_Model_StorageAdapter_AbstractA
foreach ($idTypeArray as $idType) {
$type = (int) $idType['type'];
$id = $idType['id'];
- if (!is_array($id)) {
- $id = array('id' => $id);
- }
$types[$type][] = $id;
}
$resultSet = array(); | disallow passing of scalar ids to StorageAdapter::loadMultiple(), transform scalar ids to arrays in Model::factoryGenericMultiple() | cargomedia_cm | train | php |
8ef67b9a73b5d5aa6d60440bfe82286fa3403df8 | diff --git a/servo-core/src/main/java/com/netflix/servo/publish/JvmMetricPoller.java b/servo-core/src/main/java/com/netflix/servo/publish/JvmMetricPoller.java
index <HASH>..<HASH> 100644
--- a/servo-core/src/main/java/com/netflix/servo/publish/JvmMetricPoller.java
+++ b/servo-core/src/main/java/com/netflix/servo/publish/JvmMetricPoller.java
@@ -190,7 +190,7 @@ public class JvmMetricPoller implements MetricPoller {
private static final Logger LOGGER = LoggerFactory.getLogger(JvmMetricPoller.class);
- JvmMetricPoller() {
+ public JvmMetricPoller() {
}
@Override | JvmMetricPoller() should be public | Netflix_servo | train | java |
daacc4fa9b2eb84161ffb33706e7b1ef59340686 | diff --git a/pymemcache/client/base.py b/pymemcache/client/base.py
index <HASH>..<HASH> 100644
--- a/pymemcache/client/base.py
+++ b/pymemcache/client/base.py
@@ -180,14 +180,14 @@ class Client(object):
All of the methods in this class that talk to memcached can throw one of
the following exceptions:
- * MemcacheUnknownCommandError
- * MemcacheClientError
- * MemcacheServerError
- * MemcacheUnknownError
- * MemcacheUnexpectedCloseError
- * MemcacheIllegalInputError
- * socket.timeout
- * socket.error
+ * :class:`pymemcache.exceptions.MemcacheUnknownCommandError`
+ * :class:`pymemcache.exceptions.MemcacheClientError`
+ * :class:`pymemcache.exceptions.MemcacheServerError`
+ * :class:`pymemcache.exceptions.MemcacheUnknownError`
+ * :class:`pymemcache.exceptions.MemcacheUnexpectedCloseError`
+ * :class:`pymemcache.exceptions.MemcacheIllegalInputError`
+ * :class:`socket.timeout`
+ * :class:`socket.error`
Instances of this class maintain a persistent connection to memcached
which is terminated when any of these exceptions are raised. The next | Add Sphinx links to the exception classes (#<I>) | pinterest_pymemcache | train | py |
59da97658478c46e78d14b6a1cfecff48fdcd8cb | diff --git a/pydroid_ipcam/__init__.py b/pydroid_ipcam/__init__.py
index <HASH>..<HASH> 100644
--- a/pydroid_ipcam/__init__.py
+++ b/pydroid_ipcam/__init__.py
@@ -164,8 +164,8 @@ class PyDroidIPCam:
container = self.sensor_data.get(sensor)
unit = container.get("unit")
data_point = container.get("data", [[0, [0.0]]])
- if data_point and data_point[0]:
- value = data_point[0][-1][0]
+ if data_point and data_point[-1]:
+ value = data_point[-1][-1][0]
except (ValueError, KeyError, AttributeError):
pass | Fix sensor value delay (#<I>)
* Use latest sensor value instead of oldest one when data contains multiple data points.
* change check index too to -1. | pvizeli_pydroid-ipcam | train | py |
738b71457dfac4d712c5cdbf9e1b63232c840ebb | diff --git a/editor/editor.py b/editor/editor.py
index <HASH>..<HASH> 100644
--- a/editor/editor.py
+++ b/editor/editor.py
@@ -925,7 +925,10 @@ class Editor(App):
self.configure_widget_for_editing(widget)
#widget.identifier = widget.attributes.get('editor_varname', widget.identifier)
- key = "root" if parent == self.project else widget.identifier
+ key = widget.identifier
+ if hasattr(widget, 'variable_name'):
+ key = widget.variable_name
+ key = "root" if parent == self.project else key
if root_tree_node:
parent.append(widget, key)
if self.selectedWidget == self.project: | Now editor widgets are appended by using their name as key. | dddomodossola_remi | train | py |
2bdb6afffe99d66503cfabe9a19a839ba8b1869a | diff --git a/src/Observer/SalesModelServiceQuoteSubmitSuccess.php b/src/Observer/SalesModelServiceQuoteSubmitSuccess.php
index <HASH>..<HASH> 100644
--- a/src/Observer/SalesModelServiceQuoteSubmitSuccess.php
+++ b/src/Observer/SalesModelServiceQuoteSubmitSuccess.php
@@ -27,6 +27,6 @@ class SalesModelServiceQuoteSubmitSuccess
$quote = $observer->getData('quote');
$orderId = $order->getId();
- $this->manOrderCust->create($orderId);
+ // $this->manOrderCust->create($orderId);
}
}
\ No newline at end of file | MOBI-<I> Auto registration for new customers | praxigento_mobi_mod_downline | train | php |
1976a6ebbc6c192f0024494f9646010cb1968d91 | diff --git a/queued_storage/backend.py b/queued_storage/backend.py
index <HASH>..<HASH> 100644
--- a/queued_storage/backend.py
+++ b/queued_storage/backend.py
@@ -3,7 +3,7 @@ import urllib
from django.core.cache import cache
from django.core.files.storage import get_storage_class, Storage
-from bishop.storages.tasks import SaveToRemoteTask
+from queued_storage.storages.tasks import SaveToRemoteTask
QUEUED_REMOTE_STORAGE_CACHE_KEY_PREFIX = 'queued_remote_storage_' | fixed import path that i forgot when i extracted this from an internal project | jazzband_django-queued-storage | train | py |
580ece6268e860356ff80ab60867329997d65a58 | diff --git a/github_release.py b/github_release.py
index <HASH>..<HASH> 100755
--- a/github_release.py
+++ b/github_release.py
@@ -322,7 +322,18 @@ def get_releases(repo_name, verbose=False):
return releases
+@backoff.on_predicate(backoff.expo, lambda x: x is None, max_time=5)
def get_release(repo_name, tag_name):
+ """Return release
+
+ .. note::
+
+ If the release is not found (e.g the release was just created and
+ the GitHub response is not yet updated), this function is called again by
+ leveraging the `backoff` decorator.
+
+ See https://github.com/j0057/github-release/issues/67
+ """
releases = get_releases(repo_name)
try:
release = next(r for r in releases if r['tag_name'] == tag_name) | Improve robustness of asset upload during release creation
Fix #<I> | j0057_github-release | train | py |
e389096ffc3673d95eec2cb27e349600f5f99798 | diff --git a/hazelcast-client/src/test/java/com/hazelcast/client/spi/properties/ClientPropertyTest.java b/hazelcast-client/src/test/java/com/hazelcast/client/spi/properties/ClientPropertyTest.java
index <HASH>..<HASH> 100644
--- a/hazelcast-client/src/test/java/com/hazelcast/client/spi/properties/ClientPropertyTest.java
+++ b/hazelcast-client/src/test/java/com/hazelcast/client/spi/properties/ClientPropertyTest.java
@@ -1,12 +1,19 @@
package com.hazelcast.client.spi.properties;
+import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.HazelcastTestSupport;
+import com.hazelcast.test.annotation.ParallelTest;
+import com.hazelcast.test.annotation.QuickTest;
import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+@RunWith(HazelcastParallelClassRunner.class)
+@Category({QuickTest.class, ParallelTest.class})
public class ClientPropertyTest extends HazelcastTestSupport {
@Test
- public void testConstructor() throws Exception {
+ public void testConstructor() {
assertUtilityConstructor(ClientProperty.class);
}
} | Added missing annotations to ClientPropertyTest. | hazelcast_hazelcast | train | java |
929302bb75230178ac9aa6fce44c6e0fccbd5f7a | diff --git a/src/ViewModels/WebFeatureServiceItemViewModel.js b/src/ViewModels/WebFeatureServiceItemViewModel.js
index <HASH>..<HASH> 100644
--- a/src/ViewModels/WebFeatureServiceItemViewModel.js
+++ b/src/ViewModels/WebFeatureServiceItemViewModel.js
@@ -306,7 +306,7 @@ function buildGeoJsonUrl(viewModel) {
service: 'WFS',
request: 'GetFeature',
typeName: viewModel.typeNames,
- version: '1.0.0',
+ version: '1.1.0',
outputFormat: 'JSON',
srsName: 'EPSG:4326'
});
@@ -318,7 +318,7 @@ function buildGmlUrl(viewModel) {
service: 'WFS',
request: 'GetFeature',
typeName: viewModel.typeNames,
- version: '1.0.0',
+ version: '1.1.0',
srsName: 'EPSG:4326'
});
} | Bump WFS version in GetFeature requests. | TerriaJS_terriajs | train | js |
f87a4b0388d8f69956229d741fd1ecf23c404788 | diff --git a/cluster/calcium/lambda.go b/cluster/calcium/lambda.go
index <HASH>..<HASH> 100644
--- a/cluster/calcium/lambda.go
+++ b/cluster/calcium/lambda.go
@@ -54,6 +54,13 @@ func (c *Calcium) RunAndWait(ctx context.Context, opts *types.DeployOptions, inC
continue
}
+ // first message to indicate the workload id
+ runMsgCh <- &types.AttachWorkloadMessage{
+ WorkloadID: message.WorkloadID,
+ Data: []byte(""),
+ StdStreamType: types.Stdout,
+ }
+
lambda := func(message *types.CreateWorkloadMessage) {
defer func() {
if err := c.doRemoveWorkloadSync(context.Background(), []string{message.WorkloadID}); err != nil { | workload id will be returned as the first message (#<I>)
* workload id will be returned as the first message
* revert go.sum | projecteru2_core | train | go |
a14247c67cd5eafd295bf04351c07bd8d96dd84c | diff --git a/easywebdav/client.py b/easywebdav/client.py
index <HASH>..<HASH> 100644
--- a/easywebdav/client.py
+++ b/easywebdav/client.py
@@ -137,5 +137,5 @@ class Client(object):
tree = xml.parse(StringIO(response.content))
return [elem2file(elem) for elem in tree.findall('{DAV:}response')]
def exists(self, remote_path):
- response = self._send('HEAD', remote_path, (200, 201, 404))
+ response = self._send('HEAD', remote_path, (200, 404))
return True if response.status_code != 404 else False | We should not expect <I> code | amnong_easywebdav | train | py |
bd2ff89bf127315f398f49c734cdb25eaf96bfdf | diff --git a/moto/sqs/models.py b/moto/sqs/models.py
index <HASH>..<HASH> 100644
--- a/moto/sqs/models.py
+++ b/moto/sqs/models.py
@@ -113,7 +113,7 @@ class Queue(BaseModel):
self.region = region
# wait_time_seconds will be set to immediate return messages
- self.wait_time_seconds = wait_time_seconds or 0
+ self.wait_time_seconds = int(wait_time_seconds) if wait_time_seconds else 0
self._messages = []
now = unix_time() | Ensure SQS property WaitTimeSeconds is an integer | spulec_moto | train | py |
eca03a7213bbed4f0e41617d40320aae9f0dc4bd | diff --git a/code/CarouselPage.php b/code/CarouselPage.php
index <HASH>..<HASH> 100644
--- a/code/CarouselPage.php
+++ b/code/CarouselPage.php
@@ -72,13 +72,15 @@ class CarouselPage extends Page {
public function getSettingsFields() {
$fields = parent::getSettingsFields();
- $fields->addFieldToTab('Root.Settings',
- FieldGroup::create(
- CheckboxField::create('Captions', _t('CarouselPage.db_Captions')),
- TextField::create('Width', _t('CarouselPage.db_Width')),
- TextField::create('Height', _t('CarouselPage.db_Height'))
- )->setTitle(_t('CarouselPage.SINGULARNAME'))
+ $field = FieldGroup::create(
+ CheckboxField::create('Captions', _t('CarouselPage.db_Captions')),
+ TextField::create('Width', _t('CarouselPage.db_Width')),
+ TextField::create('Height', _t('CarouselPage.db_Height'))
);
+ $field->setName('Carousel');
+ $field->setTitle(_t('CarouselPage.SINGULARNAME'));
+
+ $fields->addFieldToTab('Root.Settings', $field);
return $fields;
} | Name the group of fields in Settings
That group will be extended by silverstripe-gallery, so it should be
accessible from the outside in a viable way. | ntd_silverstripe-carousel | train | php |
bd3cb6e7d1c97ebf397d52829a3cc526e974814d | diff --git a/zk_shell/shell.py b/zk_shell/shell.py
index <HASH>..<HASH> 100644
--- a/zk_shell/shell.py
+++ b/zk_shell/shell.py
@@ -1245,22 +1245,23 @@ child_watches=%s"""
self.show_output(str(ex))
@connected
- @ensure_params(Required("path"))
- @check_paths_exists("path")
+ @ensure_params(Multi("paths"))
def do_rmr(self, params):
"""
Delete a path and all its children
- rmr <path>
+ rmr <path> [path] [path] ... [path]
- Example:
+ Examples:
> rmr /foo
+ > rmr /foo /bar
"""
- self._zk.delete(params.path, recursive=True)
+ for path in params.paths:
+ self._zk.delete(path, recursive=True)
- complete_rmr = _complete_path
+ complete_rmr = complete_rm
@connected
@ensure_params(Required("path")) | Allow rmr to take multiple paths | rgs1_zk_shell | train | py |
6005d6ecf5ec9b9ae4d3df64e09f24912c84a216 | diff --git a/deployutils/templatetags/deployutils_tags.py b/deployutils/templatetags/deployutils_tags.py
index <HASH>..<HASH> 100644
--- a/deployutils/templatetags/deployutils_tags.py
+++ b/deployutils/templatetags/deployutils_tags.py
@@ -66,6 +66,8 @@ def site_prefixed(path):
if not path:
return '/%s' % settings.APP_NAME
return urljoin('/%s/' % settings.APP_NAME, path)
+ if not path:
+ return ''
return urljoin('/', path) | fix: empty str special case in production as well | djaodjin_djaodjin-deployutils | train | py |
bbbdd95eb1d079b4bbd3b9c83aea8b140695b7a1 | diff --git a/py3status/argparsers.py b/py3status/argparsers.py
index <HASH>..<HASH> 100644
--- a/py3status/argparsers.py
+++ b/py3status/argparsers.py
@@ -86,7 +86,7 @@ def parse_cli_args():
"-d",
"--debug",
action="store_true",
- help="enable debug logging in syslog and --log-file",
+ help="enable debug logging in syslog or log file if --log-file option is passed",
)
parser.add_argument(
"-g",
@@ -109,7 +109,7 @@ def parse_cli_args():
"--log-file",
action="store",
dest="log_file",
- help="enable logging to FILE",
+ help="enable logging to FILE (this option is not set by default)",
metavar="FILE",
type=Path,
) | help: clarify connection between --debug and --log-file options (#<I>) | ultrabug_py3status | train | py |
9b4f134808068c68bcd27d08a2b4ad3070d28c8f | diff --git a/packages/ra-core/src/actions/dataActions.js b/packages/ra-core/src/actions/dataActions.js
index <HASH>..<HASH> 100644
--- a/packages/ra-core/src/actions/dataActions.js
+++ b/packages/ra-core/src/actions/dataActions.js
@@ -26,7 +26,6 @@ export const crudGetList = (resource, pagination, sort, filter) => ({
body: 'ra.notification.http_error',
level: 'warning',
},
- refresh: true,
},
},
});
@@ -258,7 +257,6 @@ export const crudGetMany = (resource, ids) => ({
body: 'ra.notification.http_error',
level: 'warning',
},
- refresh: true,
},
},
});
@@ -286,7 +284,6 @@ export const crudGetMatching = (
body: 'ra.notification.http_error',
level: 'warning',
},
- refresh: true,
},
},
});
@@ -320,7 +317,6 @@ export const crudGetManyReference = (
body: 'ra.notification.http_error',
level: 'warning',
},
- refresh: true,
},
},
}); | Fix infinite loading loop in case of HTTP error
Closes #<I> | marmelab_react-admin | train | js |
e7e3831677b93c54ee56ab1e4e88fdeff3ce190c | diff --git a/somber/base.py b/somber/base.py
index <HASH>..<HASH> 100644
--- a/somber/base.py
+++ b/somber/base.py
@@ -6,7 +6,7 @@ import types
import json
from tqdm import tqdm
-from .components.utilities import Scaler, shuffle
+from .components.utilities import shuffle
from .components.initializers import range_initialization
from collections import Counter, defaultdict | Removed lissom source, not finished. | stephantul_somber | train | py |
9d7a7437ba702af477548d93739cdce42843708d | diff --git a/blockstore/tests/scenarios/name_preorder_register_revoke.py b/blockstore/tests/scenarios/name_preorder_register_revoke.py
index <HASH>..<HASH> 100644
--- a/blockstore/tests/scenarios/name_preorder_register_revoke.py
+++ b/blockstore/tests/scenarios/name_preorder_register_revoke.py
@@ -59,6 +59,10 @@ def check( state_engine ):
if name_rec is None:
return False
+ # owned by
+ if name_rec['address'] != wallets[3].addr or name_rec['sender'] != pybitcoin.make_pay_to_address_script(wallets[3].addr):
+ return False
+
# revoked
if not name_rec['revoked']:
return False | Verify that we can revoke a registered name | blockstack_blockstack-core | train | py |
e33f547c6ef0ee663cf288f2b1b95cde4f870908 | diff --git a/android/src/main/java/com/bugsnag/BugsnagReactNative.java b/android/src/main/java/com/bugsnag/BugsnagReactNative.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/bugsnag/BugsnagReactNative.java
+++ b/android/src/main/java/com/bugsnag/BugsnagReactNative.java
@@ -212,6 +212,9 @@ public class BugsnagReactNative extends ReactContextBaseJavaModule {
class BugsnagPackage implements ReactPackage {
+ public List<Class<? extends JavaScriptModule>> createJSModules() {
+ return Collections.emptyList();
+ }
@Override
public List<ViewManager> createViewManagers( | only remove override annotation, maintaining backwards compat | bugsnag_bugsnag-react-native | train | java |
5160431d56407880a64dbc8a9f5d26ca5cf48d20 | diff --git a/tagging_autocomplete/views.py b/tagging_autocomplete/views.py
index <HASH>..<HASH> 100644
--- a/tagging_autocomplete/views.py
+++ b/tagging_autocomplete/views.py
@@ -11,10 +11,14 @@ except ImportError:
def list_tags(request):
max_results = getattr(settings, 'MAX_NUMBER_OF_RESULTS', 100)
+ search_contains = getattr(settings, 'TAGGING_AUTOCOMPLETE_SEARCH_CONTAINS', False)
try:
- tags = [{'id': tag.id, 'label': tag.name, 'value': tag.name}
- for tag in Tag.objects.filter(name__istartswith=request.GET['term'])[:max_results]]
+ term = request.GET['term']
except MultiValueDictKeyError:
raise Http404
-
+ if search_contains:
+ objects = Tag.objects.filter(name__icontains=term)
+ else:
+ objects = Tag.objects.filter(name__istartswith=term)
+ tags = [{'id': tag.id, 'label': tag.name, 'value': tag.name} for tag in objects[:max_results]]
return HttpResponse(json.dumps(tags), content_type='text/json') | Added ability to suggest tags that contain given term. | ludwiktrammer_django-tagging-autocomplete | train | py |
7455801408059b62f847d2e006517455ed2c0e3e | diff --git a/src/component/form-association.js b/src/component/form-association.js
index <HASH>..<HASH> 100644
--- a/src/component/form-association.js
+++ b/src/component/form-association.js
@@ -6,6 +6,8 @@ import {resolvedView} from 'aurelia-view-manager';
export class FormAssociation {
@bindable({defaultBindingMode: bindingMode.twoWay}) value;
+ @bindable name;
+
@bindable options;
@bindable disabled; | chore(form-association): add name property | SpoonX_aurelia-form | train | js |
96fd8b2c6e6c23d47c7a015e318a66992f76d91a | diff --git a/Demo/src/main/java/com/braintreepayments/demo/DemoApplication.java b/Demo/src/main/java/com/braintreepayments/demo/DemoApplication.java
index <HASH>..<HASH> 100644
--- a/Demo/src/main/java/com/braintreepayments/demo/DemoApplication.java
+++ b/Demo/src/main/java/com/braintreepayments/demo/DemoApplication.java
@@ -25,7 +25,6 @@ public class DemoApplication extends Application implements UncaughtExceptionHan
.detectCustomSlowCalls()
.detectNetwork()
.penaltyLog()
- .penaltyDeath()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects() | VisaCheckout throws a strict mode violation so we can't use penaltyDeath() | braintree_braintree_android | train | java |
44b55dbd6653cebcf280822156cff8b850bdae00 | diff --git a/Twig/Extension/MinifyExtension.php b/Twig/Extension/MinifyExtension.php
index <HASH>..<HASH> 100644
--- a/Twig/Extension/MinifyExtension.php
+++ b/Twig/Extension/MinifyExtension.php
@@ -35,9 +35,9 @@ class MinifyExtension extends \Twig_Extension
*/
public function getFunctions()
{
- return array(
- 'minify' => new \Twig_Function_Method($this, 'getMinifyUrl'),
- );
+ return [
+ new \Twig_SimpleFunction('minify', array($this, 'getMinifyUrl'))
+ ];
}
/** | Refactored deprecated Twig extension class | rednose-public_RednoseComboHandlerBundle | train | php |
e6a25206ee35937aa21423d6a12a62f3118cbc21 | diff --git a/jaydebeapi/__init__.py b/jaydebeapi/__init__.py
index <HASH>..<HASH> 100644
--- a/jaydebeapi/__init__.py
+++ b/jaydebeapi/__init__.py
@@ -156,7 +156,7 @@ def _handle_sql_exception_jpype():
else:
exc_type = InterfaceError
reraise(exc_type, exc_info[1], exc_info[2])
-
+
def _jdbc_connect_jpype(jclassname, url, driver_args, jars, libs):
import jpype
if not jpype.isJVMStarted():
@@ -441,6 +441,12 @@ class Connection(object):
def cursor(self):
return Cursor(self, self._converters)
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
# DB-API 2.0 Cursor Object
class Cursor(object):
@@ -594,6 +600,12 @@ class Cursor(object):
def setoutputsize(self, size, column=None):
pass
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
def _unknownSqlTypeConverter(rs, col):
return rs.getObject(col) | Support with statement by adding __enter__ and __exit__ to Cursor and Connection classes | baztian_jaydebeapi | train | py |
017e6771ce786a72618c66def7c95afcc8f4e5c4 | diff --git a/pkg/api/annotations.go b/pkg/api/annotations.go
index <HASH>..<HASH> 100644
--- a/pkg/api/annotations.go
+++ b/pkg/api/annotations.go
@@ -52,7 +52,7 @@ func (hs *HTTPServer) GetAnnotations(c *models.ReqContext) response.Response {
if err != nil {
return response.Error(http.StatusBadRequest, "Invalid dashboard UID in the request", err)
}
- query.DashboardId = dq.Id
+ query.DashboardId = dq.Result.Id
}
repo := annotations.GetRepository() | fix the issue of annotation endpoint (#<I>) | grafana_grafana | train | go |
f436906bf12fd31d738076f7ed5b408e184d6372 | diff --git a/dom/test/browser/render.js b/dom/test/browser/render.js
index <HASH>..<HASH> 100644
--- a/dom/test/browser/render.js
+++ b/dom/test/browser/render.js
@@ -440,6 +440,7 @@ describe('Rendering', function () {
wrongElement.click();
setTimeout(() => correctElement.click(), 5);
});
+ done();
});
}); | test(render): add `done()` to test timing out
Add `done()` to *should have the same effect as DOM.select()* test. | cyclejs_cyclejs | train | js |
5417e297e34b3dff32f540373e66f85758983584 | diff --git a/materialloadingprogressbar/src/main/java/com/lsjwzh/widget/materialloadingprogressbar/CircleProgressBar.java b/materialloadingprogressbar/src/main/java/com/lsjwzh/widget/materialloadingprogressbar/CircleProgressBar.java
index <HASH>..<HASH> 100644
--- a/materialloadingprogressbar/src/main/java/com/lsjwzh/widget/materialloadingprogressbar/CircleProgressBar.java
+++ b/materialloadingprogressbar/src/main/java/com/lsjwzh/widget/materialloadingprogressbar/CircleProgressBar.java
@@ -365,8 +365,10 @@ import android.widget.ImageView;
if (mProgressDrawable != null) {
if(visibility!=VISIBLE) {
mProgressDrawable.stop();
+ }else{
+ mProgressDrawable.start();
+ mProgressDrawable.setVisible(visibility == VISIBLE, false);
}
- mProgressDrawable.setVisible(visibility == VISIBLE, false);
}
} | finx bug:Restarting Progress bar does not animate #5 | lsjwzh_MaterialLoadingProgressBar | train | java |
6cd14e4e1f5b7640176441b9ffbd1a0ac3d3478b | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -141,20 +141,20 @@
* Set the cursor inside of an editable block.
*
* @method createCursor
- * @param position 'start', 'end', 'before', 'after'
+ * @param position 'beginning', 'end', 'before', 'after'
* @static
*/
createCursor: function(element, position) {
var cursor;
var $host = $(element).closest(editableSelector);
- position = position || 'start';
+ position = position || 'beginning';
if ($host.length) {
var range = rangy.createRange();
- if (position === 'start' || position === 'end') {
+ if (position === 'beginning' || position === 'end') {
range.selectNodeContents(element);
- range.collapse(position === 'start' ? true : false);
+ range.collapse(position === 'beginning' ? true : false);
} else if (element !== $host[0]) {
if (position === 'before') {
range.setStartBefore(element);
@@ -173,8 +173,8 @@
return cursor;
},
- createCursorAtStart: function(element) {
- this.createCursor(element, 'start');
+ createCursorAtBeginning: function(element) {
+ this.createCursor(element, 'beginning');
},
createCursorAtEnd: function(element) { | Rename start to beginning in core#createCursor | livingdocsIO_editable.js | train | js |
b66b332cfae24148bbe62ba5d67cb5408e6ef28d | diff --git a/genmai.go b/genmai.go
index <HASH>..<HASH> 100644
--- a/genmai.go
+++ b/genmai.go
@@ -67,7 +67,12 @@ func (db *DB) Select(output interface{}, args ...interface{}) (err error) {
queries = append(queries, q...)
values = append(values, a...)
}
- rows, err := db.db.Query(strings.Join(queries, " "), values...)
+ stmt, err := db.db.Prepare(strings.Join(queries, " "))
+ if err != nil {
+ return err
+ }
+ defer stmt.Close()
+ rows, err := stmt.Query(values...)
if err != nil {
return err
} | Change to use sql.Stmt instead of sql.DB.Query
For concurrent use by multiple goroutines.
See also <URL> | naoina_genmai | train | go |
8566daa2f5ced41aa939c2d8a7f4622565af330d | diff --git a/test/http-server-test.js b/test/http-server-test.js
index <HASH>..<HASH> 100644
--- a/test/http-server-test.js
+++ b/test/http-server-test.js
@@ -10,11 +10,11 @@ var root = path.join(__dirname, 'fixtures', 'root');
vows.describe('http-server').addBatch({
'When http-server is listening on 8080': {
topic: function () {
- new httpServer({
- port: 8080,
+ var server = httpServer.createServer({
root: root
- }).start();
- this.callback(null, httpServer);
+ });
+ server.listen(8080);
+ this.callback(null, server);
},
'it should serve files from root directory': {
topic: function () { | [test] Use new API in tests | cubbles_cubx-http-server | train | js |
5a893f2ab9e1d38a006f5038ea62bffe4cf948ef | diff --git a/master/buildbot/test/unit/test_util.py b/master/buildbot/test/unit/test_util.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_util.py
+++ b/master/buildbot/test/unit/test_util.py
@@ -378,7 +378,7 @@ class JoinList(unittest.TestCase):
self.assertEqual(util.join_list(u'abc'), u'abc')
def test_nonascii(self):
- self.assertRaises(UnicodeDecodeError, lambda: util.join_list(['\xff']))
+ self.assertRaises(UnicodeDecodeError, lambda: util.join_list([b'\xff']))
class CommandToString(unittest.TestCase): | Change to bytes
join_list([foo]) calls ascii2unicode(foo), which calls foo.decode(),
so we need to provide bytes input for this test to work on Python 3. | buildbot_buildbot | train | py |
70641d376d6cd4d6837b2a1acbf542cee4f08495 | diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -33,7 +33,7 @@ const JIB_VERSION = '2.2.0';
// Libraries version
const JHIPSTER_DEPENDENCIES_VERSION = '3.8.0-SB2.3-SNAPSHOT';
// The spring-boot version should match the one managed by https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/JHIPSTER_DEPENDENCIES_VERSION
-const SPRING_BOOT_VERSION = '2.3.0.RELEASE';
+const SPRING_BOOT_VERSION = '2.3.1.RELEASE';
const LIQUIBASE_VERSION = '3.9.0';
const liquibaseSemVer = semver.parse(LIQUIBASE_VERSION);
const LIQUIBASE_DTD_VERSION = `${liquibaseSemVer.major}.${liquibaseSemVer.minor}`; | Update Spring Boot version to <I> | jhipster_generator-jhipster | train | js |
d8ad5a5d445eae5f4a2e8634d10ed54fa0ed99c7 | diff --git a/src/Javascript/Webpack/Webpack.js b/src/Javascript/Webpack/Webpack.js
index <HASH>..<HASH> 100644
--- a/src/Javascript/Webpack/Webpack.js
+++ b/src/Javascript/Webpack/Webpack.js
@@ -89,6 +89,7 @@ const getRules = (include, options) => {
const rules = [{
test: /\.jsx?$/,
include: include,
+ exclude: /(node_modules|bower_components)/,
use: [
{
loader: 'babel-loader', | Added exlusion param inside the babel-loader block | LIN3S_Distribution | train | js |
9c682b16f635389646577ad03bb5b9ed0c98f33d | diff --git a/future.js b/future.js
index <HASH>..<HASH> 100644
--- a/future.js
+++ b/future.js
@@ -2,10 +2,14 @@
var Fiber = require('./fibers');
var util = require('util');
module.exports = Future;
-Function.prototype.future = function() {
+Function.prototype.future = function(detach) {
var fn = this;
var ret = function() {
- return new FiberFuture(fn, this, arguments);
+ var future = new FiberFuture(fn, this, arguments);
+ if (detach) {
+ future.detach();
+ }
+ return future;
};
ret.toString = function() {
return '<<Future '+ fn+ '.future()>>'; | Add option to auto-detach on Function.prototype.future()
This is useful for running fibers in events.
Fixes #<I> | laverdet_node-fibers | train | js |
47c5c05932937172918ab9c97d2e7021027886e8 | diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py
index <HASH>..<HASH> 100644
--- a/src/transformers/modeling_utils.py
+++ b/src/transformers/modeling_utils.py
@@ -1823,7 +1823,6 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
if is_sharded:
loaded_state_dict_keys = sharded_metadata["all_checkpoint_keys"]
else:
- state_dict = load_state_dict(resolved_archive_file)
loaded_state_dict_keys = [k for k in state_dict.keys()]
del state_dict # free CPU memory - will reload again later | don't load state_dict twice when using low_cpu_mem_usage in from_pretrained (#<I>) | huggingface_pytorch-pretrained-BERT | train | py |
c50c04a4e9e9ebc2a83850a25560711a6ec80478 | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
@@ -1513,6 +1513,8 @@ class ConsensusModuleAgent implements Agent, MemberStatusListener
private void enterElection(final long nowMs)
{
+ commitPosition.proposeMaxOrdered(followerCommitPosition);
+
election = new Election(
false,
leadershipTermId, | [Java] Update commit position to be the max of it or the follower commit position when entering an election as follower. | real-logic_aeron | train | java |
abbe5eb519e38067c9a3a814d7f6dbcf7d758e18 | diff --git a/lib/pseudohiki/markdownformat.rb b/lib/pseudohiki/markdownformat.rb
index <HASH>..<HASH> 100644
--- a/lib/pseudohiki/markdownformat.rb
+++ b/lib/pseudohiki/markdownformat.rb
@@ -100,12 +100,16 @@ module PseudoHiki
end
end
+ def heading_to_gfm_id(heading)
+ heading_text = PlainTextFormat.format(heading).strip
+ MarkDownFormat.convert_into_gfm_id_format(heading_text)
+ end
+
def prepare_id_conv_table(tree)
{}.tap do |table|
collect_headings(tree).each do |heading|
if node_id = heading.node_id
- heading_text = PlainTextFormat.format(heading).strip
- table[node_id] = MarkDownFormat.convert_into_gfm_id_format(heading_text)
+ table[node_id] = heading_to_gfm_id(heading)
end
end
end | refactoring of MarkDownFormat#prepare_id_conv_table(): extacted method #heading_to_gfm_id() | nico-hn_PseudoHikiParser | train | rb |
cf97c4b11136a886dd163185792d7f92387aef66 | diff --git a/holoviews/plotting/seaborn.py b/holoviews/plotting/seaborn.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/seaborn.py
+++ b/holoviews/plotting/seaborn.py
@@ -312,6 +312,7 @@ class SNSFramePlot(DFrameViewPlot):
for opt, args in map_opts:
plot_fn = getattr(sns, args[0]) if hasattr(sns, args[0]) else getattr(plt, args[0])
getattr(g, opt)(plot_fn, *args[1:])
+ plt.close(self.handles['fig'])
self.handles['fig'] = plt.gcf()
else:
super(SNSFramePlot, self)._update_plot(axis, view) | Closing figures for complex Seaborn plot types | pyviz_holoviews | train | py |
43feae565f10a80bee2c898547cbe36434acf94e | diff --git a/sos/plugins/snappy.py b/sos/plugins/snappy.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/snappy.py
+++ b/sos/plugins/snappy.py
@@ -24,6 +24,7 @@ class Snappy(Plugin, UbuntuPlugin, DebianPlugin, RedHatPlugin):
"snap --version",
"snap changes"
])
+ self.add_cmd_output("snap debug connectivity", timeout=10)
self.add_service_status("snapd")
self.add_journal(units="snapd") | [snappy] check for connectivity to the snap store
Check for connectivity to the snap store "api.snapcraft.io".
Will be very useful to have as customers start upgrading to
release where snaps are mandatory.
Resolves: #<I> | sosreport_sos | train | py |
2bbf6147e5b790e078edc017e69d5936b3e9929d | diff --git a/src/Component.php b/src/Component.php
index <HASH>..<HASH> 100644
--- a/src/Component.php
+++ b/src/Component.php
@@ -46,7 +46,7 @@ class Component extends \yii\base\Component {
*/
public function url($pipeline, $src)
{
- $src = ltrim($src, '/');
+ $src = ltrim(is_array($src) ? $src[0] : $src, '/');
$version = $this->getPipelineVersion($pipeline);
return \Yii::getAlias('@web')
. "/$this->path/$pipeline/$version/$src?" | Fix error when routes (i.e. arrays) are used to generate URLs | flaviovs_yii2-imagefilter | train | php |
c25ae8ec261171bb1c5d9acfe7c139bb9b6eb44a | diff --git a/tests/unit/algorithms/TransientReactiveTransportTest.py b/tests/unit/algorithms/TransientReactiveTransportTest.py
index <HASH>..<HASH> 100644
--- a/tests/unit/algorithms/TransientReactiveTransportTest.py
+++ b/tests/unit/algorithms/TransientReactiveTransportTest.py
@@ -36,8 +36,8 @@ class TransientImplicitReactiveTransportTest:
conductance='throat.diffusive_conductance',
t_initial=0, t_final=1, t_step=0.1, t_tolerance=1e-7,
t_precision=10, rxn_tolerance=1e-6)
- self.alg.set_value_BC(pores=self.net.pores('left'), values=2)
- self.alg.set_source(propname='pore.reaction', pores=self.net.pores('right'))
+ self.alg.set_value_BC(pores=self.net.pores('back'), values=2)
+ self.alg.set_source(propname='pore.reaction', pores=self.net.pores('front'))
self.alg.set_IC(0)
def test_transient_implicit_reactive_transport(self): | [ci skip] changed BC pores | PMEAL_OpenPNM | train | py |
4a399ac7f99634c56dfbb52693c868d456ec8c67 | diff --git a/docs/CodeExample.js b/docs/CodeExample.js
index <HASH>..<HASH> 100644
--- a/docs/CodeExample.js
+++ b/docs/CodeExample.js
@@ -35,7 +35,7 @@ export default function CodeExample(props) {
return (
<LiveProvider {...liveProps}>
<BorderBox {...rest}>
- <BorderBox bg="white" p={3} border={0} borderBottom={1} borderRadius={0}>
+ <BorderBox bg="white" border={0} borderBottom={1} borderRadius={0}>
<Frame>
<LivePreview />
</Frame>
diff --git a/docs/Frame.js b/docs/Frame.js
index <HASH>..<HASH> 100644
--- a/docs/Frame.js
+++ b/docs/Frame.js
@@ -41,7 +41,7 @@ export default class Frame extends React.Component {
return (
<Measure bounds onResize={rect => this.setHeight(rect.bounds.height)}>
{({measureRef}) => (
- <div ref={measureRef} style={{overflow: 'auto'}}>
+ <div ref={measureRef} class="p-3 overflow-auto">
{children}
</div>
)} | Move default padding inside iframe
This allows things like the focus ring to not get cut off. | primer_css | train | js,js |
608d200aebfc56fddbf0aac951e2e2cddb2e293e | diff --git a/lib/weechat/properties.rb b/lib/weechat/properties.rb
index <HASH>..<HASH> 100644
--- a/lib/weechat/properties.rb
+++ b/lib/weechat/properties.rb
@@ -1,6 +1,6 @@
module Weechat
module Properties
- module CLASS_METHODS
+ module ClassMethods
# Returns all known properties.
#
# @return [Array<Symbol>] The properties
@@ -63,8 +63,8 @@ module Weechat
end
- INSTANCE_METHODS.alias_methods(@type)
- include INSTANCE_METHODS
+ InstanceMethods.alias_methods(@type)
+ include InstanceMethods
end
def apply_transformation(property, value)
@@ -72,7 +72,7 @@ module Weechat
end
end
- module INSTANCE_METHODS
+ module InstanceMethods
# Get a property. Transformations, if appropriate, will be applied to the value
# before returning it. This means that e.g. 0 and 1 might be turned into false and true.
#
@@ -270,6 +270,6 @@ module Weechat
end
end
- include CLASS_METHODS
+ include ClassMethods
end
end | changed names of instance/classmethods modules to conform to ruby standards | dominikh_weechat-ruby | train | rb |
cff1601395b9e9660c29ee6ab2052e367ff1ff3d | diff --git a/packages/node_modules/@webex/internal-plugin-encryption/src/index.js b/packages/node_modules/@webex/internal-plugin-encryption/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@webex/internal-plugin-encryption/src/index.js
+++ b/packages/node_modules/@webex/internal-plugin-encryption/src/index.js
@@ -9,11 +9,12 @@
// specific action, accept whichever one completes first).
import {registerInternalPlugin} from '@webex/webex-core';
+import {has, isObject, isString} from 'lodash';
+
import Encryption from './encryption';
import config from './config';
-import {has, isObject, isString} from 'lodash';
import {DryError} from './kms-errors';
-import '@webex/internal-plugin-wdm';
+import '@webex/internal-plugin-device';
import '@webex/internal-plugin-mercury';
import KmsDryErrorInterceptor from './kms-dry-error-interceptor'; | refactor(internal-plugin-encryption): migrate to device
Migrate from internal-plugin-wdm to internal-plugin-device. | webex_spark-js-sdk | train | js |
5d0a38336fe9926e4559b6c18a8728e094f7bf3f | diff --git a/opal/clearwater/component.rb b/opal/clearwater/component.rb
index <HASH>..<HASH> 100644
--- a/opal/clearwater/component.rb
+++ b/opal/clearwater/component.rb
@@ -10,7 +10,7 @@ module Clearwater
end
def self.sanitize_attributes attributes
- return attributes unless `attributes.$$is_hash`
+ return attributes unless `!!attributes.$$is_hash`
attributes.each do |key, value|
if `key.slice(0, 2)` == 'on' | Cast property from undefined
Opal doesn't treat undefined as falsy. | clearwater-rb_clearwater | train | rb |
966d6ceed033984a82dc229d75eb72ad3439c25f | diff --git a/salmon/apps/metrics/models.py b/salmon/apps/metrics/models.py
index <HASH>..<HASH> 100644
--- a/salmon/apps/metrics/models.py
+++ b/salmon/apps/metrics/models.py
@@ -18,12 +18,12 @@ class Source(models.Model):
class Metric(models.Model):
OPERATOR_CHOICES = (
- ('lt', 'less than'),
- ('le', 'less than or equal to'),
- ('eq', 'equals'),
- ('ne', 'not equal to'),
- ('ge', 'greater than or equal to'),
- ('gt', 'greater than'),
+ ('lt', 'value < alert'),
+ ('le', 'value <= alert'),
+ ('eq', 'value == alert'),
+ ('ne', 'value != alert'),
+ ('ge', 'value >= alert'),
+ ('gt', 'value > alert'),
)
DISPLAY_CHOICES = (
('float', 'Number'), | Removes ambiguity from alerts | lincolnloop_salmon | train | py |
c549e413a286b491de7b5e886a0acd87da8dc7f4 | diff --git a/model_puller.go b/model_puller.go
index <HASH>..<HASH> 100644
--- a/model_puller.go
+++ b/model_puller.go
@@ -50,13 +50,13 @@ func (m *Model) pullFile(name string) error {
if err != nil {
return err
}
- defer tmpFile.Close()
contentChan := make(chan content, 32)
var applyDone sync.WaitGroup
applyDone.Add(1)
go func() {
applyContent(contentChan, tmpFile)
+ tmpFile.Close()
applyDone.Done()
}()
@@ -196,10 +196,10 @@ func applyContent(cc <-chan content, dst io.WriterAt) error {
for c := range cc {
_, err = dst.WriteAt(c.data, c.offset)
+ buffers.Put(c.data)
if err != nil {
return err
}
- buffers.Put(c.data)
}
return nil | Close tmpfiles earlier (ref #2) | syncthing_syncthing | train | go |
f983933d88ee7979bb6176a94365d037272e3360 | diff --git a/http.go b/http.go
index <HASH>..<HASH> 100644
--- a/http.go
+++ b/http.go
@@ -5,7 +5,6 @@ import (
"log"
"net"
"net/http"
- "net/url"
"strings"
"time"
)
@@ -24,19 +23,24 @@ func (s *Server) ListenAndServe() {
}
func (s *Server) ServeHTTP() {
- u, err := url.Parse(s.Opts.HttpAddress)
- if err != nil {
- log.Fatalf("FATAL: could not parse %#v: %v", s.Opts.HttpAddress, err)
+ httpAddress := s.Opts.HttpAddress
+ scheme := ""
+
+ i := strings.Index(httpAddress, "://")
+ if i > -1 {
+ scheme = httpAddress[0:i]
}
var networkType string
- switch u.Scheme {
+ switch scheme {
case "", "http":
networkType = "tcp"
default:
- networkType = u.Scheme
+ networkType = scheme
}
- listenAddr := strings.TrimPrefix(u.String(), u.Scheme+"://")
+
+ slice := strings.SplitN(httpAddress, "//", 2)
+ listenAddr := slice[len(slice)-1]
listener, err := net.Listen(networkType, listenAddr)
if err != nil { | Parse http address without url | bitly_oauth2_proxy | train | go |
2a0b467bc4f520865a520cf634043c848f1a5989 | diff --git a/ceph_deploy/rgw.py b/ceph_deploy/rgw.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/rgw.py
+++ b/ceph_deploy/rgw.py
@@ -34,7 +34,7 @@ def create_rgw(distro, name, cluster, init):
name=name
)
- conn.remote_module.safe_mkdir(path)
+ conn.remote_module.safe_makedirs(path)
bootstrap_keyring = '/var/lib/ceph/bootstrap-rgw/{cluster}.keyring'.format(
cluster=cluster | Recursively create /var/lib/ceph/radosgw/... path
Previously we would fail if /var/lib/ceph/radosgw didn't already
exist. Go ahead and make that directory if needed. | ceph_ceph-deploy | train | py |
1cb8de929b8700263f84753c739c49065898c081 | diff --git a/tests/test_argparse_completer.py b/tests/test_argparse_completer.py
index <HASH>..<HASH> 100644
--- a/tests/test_argparse_completer.py
+++ b/tests/test_argparse_completer.py
@@ -535,11 +535,11 @@ def test_autocomp_blank_token(ac_app):
def test_completion_items(ac_app, num_aliases, show_description):
# Create aliases
for i in range(0, num_aliases):
- run_cmd(ac_app, 'alias create fake{} help'.format(i))
+ run_cmd(ac_app, 'alias create fake_alias{} help'.format(i))
assert len(ac_app.aliases) == num_aliases
- text = 'fake'
+ text = 'fake_alias'
line = 'alias list {}'.format(text)
endidx = len(line)
begidx = endidx - len(text) | Increased code coverage in argparse_completer.py back to <I>% | python-cmd2_cmd2 | train | py |
e1de2707beb8448b99cbd324d02601ade4e4d288 | diff --git a/lib/generators/spark_plugs/install_generator.rb b/lib/generators/spark_plugs/install_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/spark_plugs/install_generator.rb
+++ b/lib/generators/spark_plugs/install_generator.rb
@@ -9,7 +9,7 @@ module SparkPlugs
def install
namespace = "pages"
namespace ||= ask("Where would you like to mount spark_plugs? [pages] is default")
- route("mount SparkPlugs::Engine => '/#{namespace}, as: 'spark_plugs'")
+ route("mount SparkPlugs::Engine => '/#{namespace}', as: 'spark_plugs'")
rake("db:migrate")
#template 'initializer.erb', 'config/initializers/spark_plugs.rb'
end
diff --git a/lib/spark_plugs/version.rb b/lib/spark_plugs/version.rb
index <HASH>..<HASH> 100644
--- a/lib/spark_plugs/version.rb
+++ b/lib/spark_plugs/version.rb
@@ -1,3 +1,3 @@
module SparkPlugs
- VERSION = "0.0.10"
+ VERSION = "0.0.11"
end | quotes, always with the quotes. Fixed issue with generators and quotes | whatisinternet_spark_plugs | train | rb,rb |
01ca9270bb411a47cafad3cc502d87c2c078e9a9 | diff --git a/app/Controllers/AdminPageController.php b/app/Controllers/AdminPageController.php
index <HASH>..<HASH> 100644
--- a/app/Controllers/AdminPageController.php
+++ b/app/Controllers/AdminPageController.php
@@ -62,7 +62,7 @@ class AdminPageController extends AdminBaseController
$PageElement = $mapper('PageElementMapper');
// Fetch pages
- $pages = $Page->findPages(false);
+ $pages = $Page->findPages(true);
// Fetch all block elements for each page
if ($pages) {
diff --git a/app/Models/PageMapper.php b/app/Models/PageMapper.php
index <HASH>..<HASH> 100644
--- a/app/Models/PageMapper.php
+++ b/app/Models/PageMapper.php
@@ -59,15 +59,15 @@ class PageMapper extends DataMapperAbstract
*
* Finds all pages, does not include element data
* Does not include collections
- * @param bool $published Filter on published pages
- * @return mixed Array | null
+ * @param bool $unpublished Filter on published pages
+ * @return mixed Array | null
*/
- public function findPages($published = true)
+ public function findPages($unpublished = false)
{
$this->makeSelect();
$this->sql .= " and collection_id is null";
- if ($published) {
+ if (!$unpublished) {
$this->sql .= " and published_date <= '{$this->today()}'";
} | Reversed flag on Page->findPages($unpublished = false), so getting all pages makes more semantic sense. | PitonCMS_Engine | train | php,php |
ca0adb232237b8d7139e3c2d5cd3f9ba2e24193b | diff --git a/assets/configs/webserver.php b/assets/configs/webserver.php
index <HASH>..<HASH> 100644
--- a/assets/configs/webserver.php
+++ b/assets/configs/webserver.php
@@ -110,7 +110,7 @@ return [
/**
* The php sock to be used.
*/
- 'php-sock' => 'unix:/var/run/php/php7.1-fpm.sock',
+ 'php-sock' => 'unix:/var/run/php/php7.3-fpm.sock',
/**
* Define the ports of your nginx service. | [Skip CI] Quick Webserver Config Fix
Simply because the config references a PHP version that we don't support anymore.
Updated the config to a more recent version. | tenancy_multi-tenant | train | php |
c8ccee21ac4ad8968740b46b5c28fa17cea9374d | diff --git a/pluginmanager/plugin_interface.py b/pluginmanager/plugin_interface.py
index <HASH>..<HASH> 100644
--- a/pluginmanager/plugin_interface.py
+++ b/pluginmanager/plugin_interface.py
@@ -17,10 +17,6 @@ class PluginInterface(object):
self.file_manager = kwargs.get('file_manager', FileManager())
self.module_manager = kwargs.get('module_manager', ModuleManager())
self.plugin_manager = kwargs.get('plugin_manager', PluginManager())
- self._managers = {'directory_manager': self.directory_manager,
- 'file_manager': self.file_manager,
- 'module_manager': self.module_manager,
- 'plugin_manager': self.plugin_manager}
def track_site_package_paths(self):
return self.directory_manager.add_site_packages_paths() | removed unused _managers variable from plugin interface | benhoff_pluginmanager | train | py |
10c043832ee4ffacee585e62bf73d9c40968edf5 | diff --git a/lang/zh/lang.php b/lang/zh/lang.php
index <HASH>..<HASH> 100644
--- a/lang/zh/lang.php
+++ b/lang/zh/lang.php
@@ -50,6 +50,7 @@
'price' => 'Prices',
'permissions' => 'Shopaholic',
'settings' => 'Catalog configuration',
+ 'taxes' => 'Taxes',
],
'category' => [
'name' => 'category', | New translations lang.php (Chinese Simplified) | lovata_oc-shopaholic-plugin | train | php |
9513ddef8c2eb240b8567e01563fe782b9563da8 | diff --git a/src/cobra/test/test_core/test_core_reaction.py b/src/cobra/test/test_core/test_core_reaction.py
index <HASH>..<HASH> 100644
--- a/src/cobra/test/test_core/test_core_reaction.py
+++ b/src/cobra/test/test_core/test_core_reaction.py
@@ -43,7 +43,7 @@ def test_gpr() -> None:
assert reaction_gene is model_gene
-def test_gpr_uppercase():
+def test_gpr_uppercase() -> None:
"""Test ability to handle uppercase AND/OR."""
reaction = Reaction("test")
with pytest.warns(SyntaxWarning):
@@ -53,7 +53,7 @@ def test_gpr_uppercase():
@pytest.mark.parametrize("input_gpr", ["(a1 or a2", "(forT or "])
-def test_gpr_malformed(input_gpr):
+def test_gpr_malformed(input_gpr: str) -> None:
"""Test ability to deal with malformed GPR.
Malformed GPR strings will lead to empty GPRs with no genes. | applied code review suggestions to test_core_reaction.py | opencobra_cobrapy | train | py |
5a29d7a7f923aa5c52a5c6f3f7c2db28c2133f69 | diff --git a/pythonforandroid/toolchain.py b/pythonforandroid/toolchain.py
index <HASH>..<HASH> 100755
--- a/pythonforandroid/toolchain.py
+++ b/pythonforandroid/toolchain.py
@@ -83,7 +83,7 @@ def shprint(command, *args, **kwargs):
command_string = command_path[-1]
# if len(command_path) > 1:
# command_string = '.../' + command_string
- string = ' '.join(['running', Style.DIM, command_string] + list(args))
+ string = ' '.join(['running', command_string] + list(args))
# If logging is not in DEBUG mode, trim the command if necessary
if logger.level > logging.DEBUG:
@@ -1776,7 +1776,8 @@ class CythonRecipe(PythonRecipe):
env['LIBLINK'] = 'NOTNONE'
env['NDKPLATFORM'] = self.ctx.ndk_platform
- # Every recipe uses its own liblink path, object files are collected and biglinked later
+ # Every recipe uses its own liblink path, object files are
+ # collected and biglinked later
liblink_path = join(self.get_build_container_dir(arch.arch), 'objects_{}'.format(self.name))
env['LIBLINK_PATH'] = liblink_path
ensure_dir(liblink_path) | Removed DIM from sh output print | kivy_python-for-android | train | py |
18c4c178f6f0df4bde914a3c44e1d547c714a7f6 | diff --git a/public/js/tools/melis-core-gdpr-tool.js b/public/js/tools/melis-core-gdpr-tool.js
index <HASH>..<HASH> 100644
--- a/public/js/tools/melis-core-gdpr-tool.js
+++ b/public/js/tools/melis-core-gdpr-tool.js
@@ -259,7 +259,7 @@ $(document).ready(function() {
}).success(function (data) {
if (data.success) {
$.each(modules, function (key, value) {
- var moduleName = key
+ var moduleName = key;
//remove selected rows in data table
$('#' + moduleName).DataTable().rows('.checked').remove().draw();
@@ -281,7 +281,7 @@ $(document).ready(function() {
} else {
melisHelper.melisKoNotification(
translations.tr_melis_core_gdpr_notif_delete_user,
- translations.tr_melis_core_gdpr_notif_error_on_deleting_data,
+ translations.tr_melis_core_gdpr_notif_error_on_deleting_data
);
}
}).error(function () { | added missing semi colon and removed comma | melisplatform_melis-core | train | js |
ed6b33e98b024137f17274dc0cbd5f87ea17307d | diff --git a/lib/discordrb/light/data.rb b/lib/discordrb/light/data.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/light/data.rb
+++ b/lib/discordrb/light/data.rb
@@ -3,6 +3,7 @@ require 'discordrb/data'
module Discordrb::Light
# Represents the bot account used for the light bot, but without any methods to change anything.
class LightProfile
+ include Discordrb::IDObject
include Discordrb::UserAttributes
# @!visibility private | Also include IDObject so you can check created time | meew0_discordrb | train | rb |
f0b8d8eea58c0d4375c8161c3cd58c3fbc41f07c | diff --git a/src/Generators/CsvDictionary.php b/src/Generators/CsvDictionary.php
index <HASH>..<HASH> 100644
--- a/src/Generators/CsvDictionary.php
+++ b/src/Generators/CsvDictionary.php
@@ -26,8 +26,8 @@ class CsvDictionary extends Generator implements GeneratorInterface
$options += static::$options;
$handle = fopen('php://memory', 'w');
- foreach (self::toArray($translations, $options['includeHeaders']) as $original => $translation) {
- self::fputcsv($handle, [$original, $translation], $options);
+ foreach (static::toArray($translations, $options['includeHeaders']) as $original => $translation) {
+ static::fputcsv($handle, [$original, $translation], $options);
}
rewind($handle); | Use late static binding in `Generators\CsvDictionary`
This avoids extending classes unexpectedly breaking. | oscarotero_Gettext | train | php |
d4dbbcef22e3aadf25dad811a9faa988a50a0df4 | diff --git a/mode/dart/dart.js b/mode/dart/dart.js
index <HASH>..<HASH> 100644
--- a/mode/dart/dart.js
+++ b/mode/dart/dart.js
@@ -72,6 +72,12 @@
return null;
}
return false;
+ },
+
+ "/": function(stream, state) {
+ if (!stream.eat("*")) return false
+ state.tokenize = tokenNestedComment(1)
+ return state.tokenize(stream, state)
}
}
});
@@ -121,6 +127,27 @@
return "variable";
}
+ function tokenNestedComment(depth) {
+ return function (stream, state) {
+ var ch
+ while (ch = stream.next()) {
+ if (ch == "*" && stream.eat("/")) {
+ if (depth == 1) {
+ state.tokenize = null
+ break
+ } else {
+ state.tokenize = tokenNestedComment(depth - 1)
+ return state.tokenize(stream, state)
+ }
+ } else if (ch == "/" && stream.eat("*")) {
+ state.tokenize = tokenNestedComment(depth + 1)
+ return state.tokenize(stream, state)
+ }
+ }
+ return "comment"
+ }
+ }
+
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
// This is needed to make loading through meta.js work. | [dart mode] Support nested block comments
Closes #<I> | codemirror_CodeMirror | train | js |
6f2f9213ab210173dc18e63abcae1e8c5dde4518 | diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py
index <HASH>..<HASH> 100644
--- a/torchvision/models/inception.py
+++ b/torchvision/models/inception.py
@@ -67,9 +67,10 @@ class Inception3(nn.Module):
import scipy.stats as stats
stddev = m.stddev if hasattr(m, 'stddev') else 0.1
X = stats.truncnorm(-2, 2, scale=stddev)
- values = torch.Tensor(X.rvs(m.weight.numel()))
+ values = torch.as_tensor(X.rvs(m.weight.numel()), dtype=m.weight.dtype)
values = values.view(m.weight.size())
- m.weight.data.copy_(values)
+ with torch.no_grad():
+ m.weight.copy_(values)
elif isinstance(m, nn.BatchNorm2d):
nn.init.constant_(m.weight, 1)
nn.init.constant_(m.bias, 0) | update code (#<I>) | pytorch_vision | train | py |
bdf8328a0595c35b18efcd6f238bfc962267968e | diff --git a/lib/fog/ecloud/compute.rb b/lib/fog/ecloud/compute.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/ecloud/compute.rb
+++ b/lib/fog/ecloud/compute.rb
@@ -1184,7 +1184,7 @@ module Fog
end
def supporting_versions
- ["v0.8b-ext2.6", "0.8b-ext2.6"]
+ ["v0.8b-ext2.6", "0.8b-ext2.6", "v0.8b-ext2.8" , "0.8b-ext2.8"]
end
private | Add Ecloud version <I> as supported
The difference between <I> and <I> are a few additional api calls but the
existing calls are still backwards compatible, and we need the version bump
to be able to continue to use. | fog_fog | train | rb |
b22008bae03fd53956cd120fea9562d5c53de095 | diff --git a/backup/backuplib.php b/backup/backuplib.php
index <HASH>..<HASH> 100644
--- a/backup/backuplib.php
+++ b/backup/backuplib.php
@@ -463,9 +463,7 @@
//If enabled, we strip all the control chars from the text but tabs, newlines and returns
//because they are forbiden in XML 1.0 specs. The expression below seems to be
//UTF-8 safe too because it simply ignores the rest of characters.
- if (!empty($CFG->backup_strip_controlchars)) {
- $content = preg_replace("/(?(?=[[:cntrl:]])[^\n\r\t])/is","",$content);
- }
+ $content = preg_replace("/(?(?=[[:cntrl:]])[^\n\r\t])/is","",$content);
if (!empty($CFG->unicodedb)) {
// Don't perform the conversion. Contents are Unicode.
$content = preg_replace("/\r\n|\r/", "\n", htmlspecialchars($content)); | after discussion with Eloy: Always strip controlchars in xml_tag_safe_content | moodle_moodle | train | php |
2145ea251465904637158c90868204e170f0c900 | diff --git a/quilt/utils.py b/quilt/utils.py
index <HASH>..<HASH> 100644
--- a/quilt/utils.py
+++ b/quilt/utils.py
@@ -86,7 +86,8 @@ class Directory(object):
def create(self):
""" Creates the directory and all its parent directories """
- os.makedirs(self.dirname)
+ if not os.path.exists(self.dirname):
+ os.makedirs(self.dirname)
def _content(self, startdir, dirname=None):
files = [] | Only create directories if they don't exists yet | bjoernricks_python-quilt | train | py |
bde5f345de919fc44a48082c732121f80768f045 | diff --git a/railties/lib/rails/tasks.rb b/railties/lib/rails/tasks.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/tasks.rb
+++ b/railties/lib/rails/tasks.rb
@@ -3,7 +3,6 @@ require 'rake'
# Load Rails Rakefile extensions
%w(
annotations
- documentation
framework
log
middleware | Remove reference to the now done documentation.rake | rails_rails | train | rb |
d4f5b30c9fbce3fc21b69e1b2630ab37f01b3a88 | diff --git a/packages/Todos/src/site/components/com_todos/controllers/toolbars/todo.php b/packages/Todos/src/site/components/com_todos/controllers/toolbars/todo.php
index <HASH>..<HASH> 100644
--- a/packages/Todos/src/site/components/com_todos/controllers/toolbars/todo.php
+++ b/packages/Todos/src/site/components/com_todos/controllers/toolbars/todo.php
@@ -107,7 +107,7 @@ class ComTodosControllerToolbarTodo extends ComMediumControllerToolbarDefault
protected function _commandNew($command)
{
$command
- ->append(array('label'=>$label))
+ ->append(array('label' => JText::_('COM-TODOS-TOOLBAR-TODO-NEW') ))
->href('#')
->setAttribute('data-trigger', 'ReadForm');
} | todos action button didn't have label | anahitasocial_anahita | train | php |
2e7a4e406b7a3ff4c93a9ed94fffaa89badee1fb | diff --git a/daemon/daemon.go b/daemon/daemon.go
index <HASH>..<HASH> 100644
--- a/daemon/daemon.go
+++ b/daemon/daemon.go
@@ -717,7 +717,7 @@ func NewDaemon(dp datapath.Datapath) (*Daemon, *endpointRestoreState, error) {
authKeySize, err := setupIPSec()
if err != nil {
- return nil, nil, err
+ return nil, nil, fmt.Errorf("unable to setup encryption: %s", err)
}
mtuConfig := mtu.NewConfiguration(authKeySize, option.Config.EnableIPSec, option.Config.Tunnel != option.TunnelDisabled, configuredMTU) | agent: Provide better error message when ipsec setup fails
This error was not useful:
```
level=fatal msg="Error while creating daemon" error="open : no such file or directory" subsys=daemon
``` | cilium_cilium | train | go |
04c4f3d5b23a05b323388a1e9c690a378dc85dbd | diff --git a/lib/cucumber/multiline_argument/data_table.rb b/lib/cucumber/multiline_argument/data_table.rb
index <HASH>..<HASH> 100644
--- a/lib/cucumber/multiline_argument/data_table.rb
+++ b/lib/cucumber/multiline_argument/data_table.rb
@@ -504,7 +504,7 @@ module Cucumber
end
@header_mappings.each_pair do |pre, post|
- mapped_cells = header_cells.select { |cell| cell.value.match? pre }
+ mapped_cells = header_cells.reject { |cell| cell.value.match(pre).nil? }
raise "No headers matched #{pre.inspect}" if mapped_cells.empty?
raise "#{mapped_cells.length} headers matched #{pre.inspect}: #{mapped_cells.map(&:value).inspect}" if mapped_cells.length > 1
mapped_cells[0].value = post | Do not use string#match? as it only exist in >= Ruby <I>
Use string#match instead. | cucumber_cucumber-ruby | train | rb |
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.