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 |
|---|---|---|---|---|---|
c1b93e9ee517491d26e198a300f2bd886c69f719 | diff --git a/assets/__pm.js b/assets/__pm.js
index <HASH>..<HASH> 100644
--- a/assets/__pm.js
+++ b/assets/__pm.js
@@ -4,7 +4,7 @@
var root = document.createElement('div');
var DOM;
- setInterval(applyTimeAgo, 1000);
+ setInterval(applyTimeAgo, 60000);
if (host.attachShadow) {
DOM = host.attachShadow({mode: 'open'});
@@ -252,7 +252,7 @@
var days = Math.round(hours / 24);
var months = Math.round(days / 30);
var years = Math.round(days / 365);
- if (seconds < 60) date.innerHTML = seconds+" seconds ago";
+ if (seconds < 60) date.innerHTML = "less than a minute ago";
else if (minutes < 2) date.innerHTML = minutes+" minute ago";
else if (minutes < 60) date.innerHTML = minutes+" minutes ago";
else if (hours < 2) date.innerHTML = hours+" hour ago"; | Reduces frequency of applyTimeAgo to only update every minute instead of every second. | jadencarver_superconductor | train | js |
ad612e093189d2f931f482906daf9e7bc71b3ef4 | diff --git a/test/support/app-runner.js b/test/support/app-runner.js
index <HASH>..<HASH> 100644
--- a/test/support/app-runner.js
+++ b/test/support/app-runner.js
@@ -70,9 +70,15 @@ AppRunner.prototype.start = function start (callback) {
}
AppRunner.prototype.stop = function stop (callback) {
- if (this.child) {
- kill(this.child.pid, 'SIGTERM', callback)
- } else {
+ if (!this.child) {
setImmediate(callback)
+ return
}
+
+ this.child.stderr.unpipe()
+ this.child.removeAllListeners('exit')
+
+ kill(this.child.pid, 'SIGTERM', callback)
+
+ this.child = null
} | tests: unpipe stderr when stopping app | expressjs_generator | train | js |
abccf184115129e7f4eb79af6c4fab0fc19ec1ea | diff --git a/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java b/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java
index <HASH>..<HASH> 100644
--- a/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java
+++ b/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java
@@ -130,7 +130,7 @@ public class LineBasedFrameDecoder extends ByteToMessageDecoder {
fail(ctx, length);
}
} else {
- discardedBytes = buffer.readableBytes();
+ discardedBytes += buffer.readableBytes();
buffer.readerIndex(buffer.writerIndex());
}
return null; | fix the discardedBytes counting on LineBasedFrameDecoder
Motivation:
The LineBasedFrameDecoder discardedBytes counting different compare to
DelimiterBasedFrameDecoder.
Modifications:
Add plus sign
Result:
DiscardedBytes counting correctly | netty_netty | train | java |
00c392b6dff8bbf3a84ca9c874e4047503a8203f | diff --git a/src/CheckIfDead.php b/src/CheckIfDead.php
index <HASH>..<HASH> 100644
--- a/src/CheckIfDead.php
+++ b/src/CheckIfDead.php
@@ -7,7 +7,7 @@
*/
namespace Wikimedia\DeadlinkChecker;
-define( 'CHECKIFDEADVERSION', '1.1.1' );
+define( 'CHECKIFDEADVERSION', '1.1.2' );
class CheckIfDead {
@@ -332,7 +332,7 @@ class CheckIfDead {
return true;
}
if ( $httpCode === 0 ) {
- $this->errors[$curlInfo['rawurl']] = "CONNECTION CLOSED UNEXPECTEDLY";
+ $this->errors[$curlInfo['rawurl']] = "NO RESPONSE FROM SERVER";
return true;
}
// Check for valid non-error codes for HTTP or FTP | Minor Tweak
Update version to <I> and change HTTP 0 response to NO RESPONSE FROM
SERVER | wikimedia_DeadlinkChecker | train | php |
0759900db9530d2bd2d36f74a5381c48f801b76a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ setup(
keywords='context manager shell command line repl',
scripts=['bin/with'],
install_requires=[
- 'appdirs==1.4.0',
+ 'appdirs==1.4.1',
'docopt==0.6.2',
'prompt-toolkit==1.0',
'python-slugify==1.2.1', | Upgrade dependency appdirs to ==<I> | renanivo_with | train | py |
f81164a210e670064cee9dd95fc7a2524db74fbe | diff --git a/tests/integ/__init__.py b/tests/integ/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/integ/__init__.py
+++ b/tests/integ/__init__.py
@@ -71,7 +71,7 @@ EI_SUPPORTED_REGIONS = [
NO_LDA_REGIONS = ["eu-west-3", "eu-north-1", "sa-east-1", "ap-east-1"]
NO_MARKET_PLACE_REGIONS = ["eu-west-3", "eu-north-1", "sa-east-1", "ap-east-1"]
-EFS_TEST_ENABLED_REGION = ["us-west-2"]
+EFS_TEST_ENABLED_REGION = []
logging.getLogger("boto3").setLevel(logging.INFO)
logging.getLogger("botocore").setLevel(logging.INFO) | fix: skip efs and fsx integ tests in all regions (#<I>) | aws_sagemaker-python-sdk | train | py |
d02fa40659f051f676eb5de317efcb873081ce92 | diff --git a/tensor2tensor/utils/trainer_lib.py b/tensor2tensor/utils/trainer_lib.py
index <HASH>..<HASH> 100644
--- a/tensor2tensor/utils/trainer_lib.py
+++ b/tensor2tensor/utils/trainer_lib.py
@@ -39,7 +39,7 @@ from tensorflow.core.protobuf import rewriter_config_pb2
from tensorflow.python import debug
-def next_checkpoint(model_dir, timeout_mins=120):
+def next_checkpoint(model_dir, timeout_mins=240):
"""Yields successive checkpoints from model_dir."""
last_ckpt = None
while True: | Wait longer for checkpoints.
PiperOrigin-RevId: <I> | tensorflow_tensor2tensor | train | py |
92942d10cf356c87099619f23c9135b67a47be34 | diff --git a/lib/http/cache.rb b/lib/http/cache.rb
index <HASH>..<HASH> 100644
--- a/lib/http/cache.rb
+++ b/lib/http/cache.rb
@@ -83,7 +83,14 @@ module HTTP
# Store response in cache
#
# @return [nil]
+ #
+ # ---
+ #
+ # We have to convert the response body in to a string body so
+ # that the cache store reading the body will not prevent the
+ # original requester from doing so.
def store_in_cache(request, response)
+ response.body = response.body.to_s
@cache_adapter.store(request, response)
nil
end
diff --git a/lib/http/response/io_body.rb b/lib/http/response/io_body.rb
index <HASH>..<HASH> 100644
--- a/lib/http/response/io_body.rb
+++ b/lib/http/response/io_body.rb
@@ -17,7 +17,7 @@ module HTTP
# Iterate over the body, allowing it to be enumerable
def each
- while part = readpartial # rubocop:disable Lint/AssignmentInCondition
+ while (part = readpartial)
yield part
end
end | allow both original requester and cache store to read response body | httprb_http | train | rb,rb |
1191a7216def7ae029774308260546dee3ec0f17 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,11 @@ setup(
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English', 'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.6', 'Topic :: Utilities',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.3',
+ 'Topic :: Utilities',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
'Topic :: Games/Entertainment'], | Update classifiers to reflect new python version compatibility. | chigby_mtg | train | py |
cc0e66088053a81b574c86cbc01502d39c6aa561 | diff --git a/mediasync/backends/s3.py b/mediasync/backends/s3.py
index <HASH>..<HASH> 100644
--- a/mediasync/backends/s3.py
+++ b/mediasync/backends/s3.py
@@ -72,7 +72,7 @@ class Client(BaseClient):
"x-amz-acl": "public-read",
"Content-Type": content_type,
"Expires": expires,
- "Cache-Control": 'max-age=%d' % (self.expiration_days * 24 * 3600),
+ "Cache-Control": 'max-age=%d, public' % (self.expiration_days * 24 * 3600),
}
key = self._bucket.get_key(remote_path) | Add public to S3 Cache-Control header | sunlightlabs_django-mediasync | train | py |
434dc6623c1622b0c4657993892a81514ad45f72 | diff --git a/src/Jasny/DB/Generator.php b/src/Jasny/DB/Generator.php
index <HASH>..<HASH> 100644
--- a/src/Jasny/DB/Generator.php
+++ b/src/Jasny/DB/Generator.php
@@ -226,13 +226,24 @@ $properties
/**
* Cast all properties to a type based on the field types.
*
- * @return Record \$this
+ * @return $classname \$this
*/
public function cast()
{
$cast
return \$this;
}
+
+ /**
+ * Set the table gateway.
+ * @ignore
+ *
+ * @param {$classname}Table \$table
+ */
+ public function _setDBTable(\$table)
+ {
+ if (!isset(\$this->_dbtable)) \$this->_dbtable = \$table;
+ }
}
PHP;
diff --git a/src/Jasny/DB/Record.php b/src/Jasny/DB/Record.php
index <HASH>..<HASH> 100644
--- a/src/Jasny/DB/Record.php
+++ b/src/Jasny/DB/Record.php
@@ -139,7 +139,10 @@ class Record
*/
public function _setDBTable($table)
{
- if (!isset($this->_dbtable)) $this->_dbtable = $table;
+ if (!isset($this->_dbtable)) {
+ $this->_dbtable = $table;
+ $this->cast();
+ }
}
/** | Cast directly instantiated Records when setting the table gateway. | jasny_db | train | php,php |
3fb7994dfd62c48b5a984b94b243f8df334607dc | diff --git a/src/shell_extension/extension.js b/src/shell_extension/extension.js
index <HASH>..<HASH> 100644
--- a/src/shell_extension/extension.js
+++ b/src/shell_extension/extension.js
@@ -10,6 +10,7 @@
*/
const DBus = imports.dbus;
+const GLib = imports.gi.GLib
const Lang = imports.lang;
const St = imports.gi.St;
const Shell = imports.gi.Shell;
@@ -113,6 +114,9 @@ HamsterButton.prototype = {
this.facts = null;
this.currentFact = null;
+ // refresh the label every 60 secs
+ GLib.timeout_add_seconds(0, 60,
+ Lang.bind(this, function () {this.refresh(); return true}))
this.refresh(); | refresh the panel every <I> seconds | projecthamster_hamster | train | js |
420287dc0d9ec30590077769dfde9161b12b569c | diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/ImportManager.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/ImportManager.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/ImportManager.java
+++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/ImportManager.java
@@ -50,6 +50,10 @@ public class ImportManager {
this(organizeImports, null, innerTypeSeparator);
}
+ public ImportManager() {
+ this(true, null);
+ }
+
public ImportManager(boolean organizeImports) {
this(organizeImports, null);
} | [ImportManager] added constructor (see #<I>) | eclipse_xtext-extras | train | java |
910beaac7ad2e84daedc235dd09245afb5f02d93 | diff --git a/test/support/utils.rb b/test/support/utils.rb
index <HASH>..<HASH> 100644
--- a/test/support/utils.rb
+++ b/test/support/utils.rb
@@ -1,5 +1,5 @@
-require_relative 'matchers'
-require_relative 'temporary'
+require 'support/matchers'
+require 'support/temporary'
module Byebug
# | Use `require` instead of `require_relative`
For consistency with the rest of the code. | deivid-rodriguez_byebug | train | rb |
02bc535e0efcf1943c78411ec8c37fe2a017c3bb | diff --git a/common/os.go b/common/os.go
index <HASH>..<HASH> 100644
--- a/common/os.go
+++ b/common/os.go
@@ -9,6 +9,7 @@ import (
func TrapSignal(cb func()) {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
+ signal.Notify(c, os.Kill)
go func() {
for sig := range c {
fmt.Printf("captured %v, exiting...\n", sig)
diff --git a/process/process.go b/process/process.go
index <HASH>..<HASH> 100644
--- a/process/process.go
+++ b/process/process.go
@@ -84,6 +84,7 @@ func Create(mode int, label string, execPath string, args []string, input string
}
func Stop(proc *Process, kill bool) error {
+ defer proc.OutputFile.Close()
if kill {
fmt.Printf("Killing process %v\n", proc.Cmd.Process)
return proc.Cmd.Process.Kill() | Close files upon stop. Still need to fix bash issues? | tendermint_tendermint | train | go,go |
a4b4add47eee6a3cdd2aa8d30e9a454b2e07fce1 | diff --git a/TYPO3.Media/Classes/TYPO3/Media/Domain/Service/ThumbnailService.php b/TYPO3.Media/Classes/TYPO3/Media/Domain/Service/ThumbnailService.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Media/Classes/TYPO3/Media/Domain/Service/ThumbnailService.php
+++ b/TYPO3.Media/Classes/TYPO3/Media/Domain/Service/ThumbnailService.php
@@ -121,7 +121,9 @@ class ThumbnailService
return null;
}
- $this->thumbnailRepository->add($thumbnail);
+ if (!$this->persistenceManager->isNewObject($asset)) {
+ $this->thumbnailRepository->add($thumbnail);
+ }
$asset->addThumbnail($thumbnail);
// Allow thumbnails to be persisted even if this is a "safe" HTTP request: | BUGFIX: Do not automatically persist thumbnails for new asset objects
Prevents issues with database constraints caused by new assets being added to persistence, since
the asset would be added through the thumbnail as a related object as well.
Due to the automatic creation of thumbnails on asset creation, this caused problems for the site import.
NEOS-<I> | neos_neos-development-collection | train | php |
755f3ba1103241c4cc7ba0c5c21d6599a5035a71 | diff --git a/lib/auto_increment/version.rb b/lib/auto_increment/version.rb
index <HASH>..<HASH> 100644
--- a/lib/auto_increment/version.rb
+++ b/lib/auto_increment/version.rb
@@ -1,3 +1,3 @@
module AutoIncrement
- VERSION = "1.1.0"
+ VERSION = "1.1.1"
end | Bump to version <I> | felipediesel_auto_increment | train | rb |
92a348eea82b7587f73b74c65ef71d3d9e5619d7 | diff --git a/lib/right_api_client/client.rb b/lib/right_api_client/client.rb
index <HASH>..<HASH> 100644
--- a/lib/right_api_client/client.rb
+++ b/lib/right_api_client/client.rb
@@ -146,7 +146,7 @@ module RightApi
end
end
- data = JSON.parse(body)
+ data = JSON.parse(body) # TODO: check type before parsing as JSON
[resource_type, path, data]
end | Added TODO, specifically meant for vnd.rightscale.text. | rightscale_right_api_client | train | rb |
1b060a88722013dae3531d7a9fbb457211bfa3be | diff --git a/redisson/src/main/java/org/redisson/connection/MasterSlaveConnectionManager.java b/redisson/src/main/java/org/redisson/connection/MasterSlaveConnectionManager.java
index <HASH>..<HASH> 100644
--- a/redisson/src/main/java/org/redisson/connection/MasterSlaveConnectionManager.java
+++ b/redisson/src/main/java/org/redisson/connection/MasterSlaveConnectionManager.java
@@ -275,7 +275,6 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
RFuture<RedisConnection> future = client.connectAsync();
future.onComplete((connection, e) -> {
if (e != null) {
- connection.closeAsync();
result.tryFailure(e);
return;
} | Fixed - Connection leak when redis cluster has "<I>" in its node list. #<I> | redisson_redisson | train | java |
6858713386578aebdf354208eb97eb7f61ae1beb | diff --git a/core/Log.php b/core/Log.php
index <HASH>..<HASH> 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -418,6 +418,13 @@ class Log extends Singleton
if (is_string($message)
&& !empty($sprintfParams)
) {
+ // handle array sprintf parameters
+ foreach ($sprintfParams as &$param) {
+ if (is_array($param)) {
+ $param = json_encode($param);
+ }
+ }
+
$message = vsprintf($message, $sprintfParams);
}
@@ -676,6 +683,8 @@ class Log extends Singleton
*/
Piwik::postEvent(self::FORMAT_FILE_MESSAGE_EVENT, array(&$message, $level, $tag, $datetime, $logger));
}
+
+ $message = str_replace("\n", "\n ", $message);
return $message . "\n";
}
} | Make sure arrays are formatted correctly in Log calls w/ sprintf params and indent message newlines so they can be more easily parsed. | matomo-org_matomo | train | php |
25da33acbd591b17ab253e46aebee229d291d57c | diff --git a/abot/dubtrack.py b/abot/dubtrack.py
index <HASH>..<HASH> 100644
--- a/abot/dubtrack.py
+++ b/abot/dubtrack.py
@@ -451,8 +451,8 @@ class DubtrackUserUpdate(DubtrackEvent):
class DubtrackBotBackend(Backend):
# Official Bot methods
- def __init__(self):
- self.dubtrackws = DubtrackWS()
+ def __init__(self, room):
+ self.dubtrackws = DubtrackWS(room)
self.dubtrack_channel = None
self.dubtrack_users = defaultdict(dict) # ID: user_session_info
self.dubtrack_entities = weakref.WeakValueDictionary()
@@ -578,7 +578,7 @@ class DubtrackWS:
PONG = '3'
DATA = '4'
- def __init__(self, room='master-of-soundtrack'):
+ def __init__(self, room):
self.room = room
self.heartbeat = None
self.ws_client_id = None | dubtrack: Dubtrack backend needs a room as argument (#6)
Moving towards a more agnostic backend | txomon_abot | train | py |
52174a4877e985ac98ace223f359d41e831f848e | diff --git a/packages/http/httpDataService.js b/packages/http/httpDataService.js
index <HASH>..<HASH> 100644
--- a/packages/http/httpDataService.js
+++ b/packages/http/httpDataService.js
@@ -9,18 +9,19 @@ HttpDataService.prototype.request = function(relativeUrl, httpConfig) {
var self = this;
return this.baseUrlPromise.then(function(baseUrl) {
httpConfig.url = baseUrl + relativeUrl;
- return Promise.resolve(self.$http(httpConfig)).then(function(response) {
- if (response.status !== 200) {
- console.error('Non-OK response with status ' + response.status);
- console.error(response);
- throw new Error(response);
- }
- return response.data;
+ return new Promise(function(resolve, reject) {
+ self.$http(httpConfig).then(function successCallback(response) {
+ if (response.status !== 200) {
+ console.error(response);
+ return reject(new Error("Network request failed with invalid status", response.status));
+ }
+ return resolve(response.data);
+ }, function errorCallback(error) {
+ console.error(error);
+ error = new Error(error);
+ return reject(error);
+ });
});
- }).catch(function(error) {
- error = new Error(error);
- console.error(error);
- throw error;
});
}; | Fix for network error handler (#<I>) | feedhenry-raincatcher_raincatcher-angularjs | train | js |
d5aa0d32a4161ce8c50bacdd846034575f287340 | diff --git a/test/scenario_test/lib/base.py b/test/scenario_test/lib/base.py
index <HASH>..<HASH> 100644
--- a/test/scenario_test/lib/base.py
+++ b/test/scenario_test/lib/base.py
@@ -82,7 +82,7 @@ def make_gobgp_ctn(tag='gobgp', local_gobgp_path=''):
class Bridge(object):
- def __init__(self, name, subnet='', with_ip=True):
+ def __init__(self, name, subnet='', with_ip=True, self_ip=False):
self.name = name
self.with_ip = with_ip
if with_ip:
@@ -101,7 +101,8 @@ class Bridge(object):
local("ip link add {0} type bridge".format(self.name), capture=True)
local("ip link set up dev {0}".format(self.name), capture=True)
- if with_ip:
+ self.self_ip = self_ip
+ if self_ip:
self.ip_addr = self.next_ip_address()
local("ip addr add {0} dev {1}".format(self.ip_addr, self.name),
capture=True) | test: don't give ip address to a bridge by default
now telnet to quagga occurs in quagga container's local network
namespace. we don't need to address a bridge | osrg_gobgp | train | py |
54267c0922ba943132211643bdf93775e8c92935 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -44,7 +44,7 @@ install_requires = [
extras_require = {
'testing': [
# third-party dependencies (versions should be flexible to allow for bug fixes)
- 'flake8>=4,<6',
+ 'flake8~=5.0',
'flake8-blind-except~=0.2.1',
'flake8-bugbear~=22.7',
'flake8-debugger~=4.1', | Update flake8 requirement to ~<I> | ministryofjustice_money-to-prisoners-common | train | py |
b265c9d4290fb9efb080feaaede47919214a6d39 | diff --git a/lib/how_is/report.rb b/lib/how_is/report.rb
index <HASH>..<HASH> 100644
--- a/lib/how_is/report.rb
+++ b/lib/how_is/report.rb
@@ -69,6 +69,8 @@ module HowIs
oldest_pull_date: @gh_pulls.oldest["createdAt"],
travis_builds: @travis.builds.to_h,
+
+ date: @end_date,
}
frontmatter = | *shakes head* damnit, past me. | duckinator_inq | train | rb |
0ad21af17364449fdfe572203adda957ce3053df | diff --git a/src/main/java/org/jcodec/containers/mxf/model/MXFMetadata.java b/src/main/java/org/jcodec/containers/mxf/model/MXFMetadata.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jcodec/containers/mxf/model/MXFMetadata.java
+++ b/src/main/java/org/jcodec/containers/mxf/model/MXFMetadata.java
@@ -71,7 +71,13 @@ public abstract class MXFMetadata {
}
protected String readUtf16String(ByteBuffer _bb) {
- return Platform.stringFromCharset(NIOUtils.toArray(_bb), Charset.forName("utf-16"));
+ byte[] array;
+ if (_bb.getShort(_bb.limit() - 2) != 0) {
+ array = NIOUtils.toArray(_bb);
+ } else {
+ array = NIOUtils.toArray((ByteBuffer) _bb.limit(_bb.limit() - 2));
+ }
+ return Platform.stringFromCharset(array, Charset.forName("utf-16"));
}
public UL getUl() { | readUtf<I>String support zero ended strings | jcodec_jcodec | train | java |
12b6e0718970bab0f8aa4d3405094e84bea02ac1 | diff --git a/examples/colors.py b/examples/colors.py
index <HASH>..<HASH> 100644
--- a/examples/colors.py
+++ b/examples/colors.py
@@ -12,7 +12,10 @@ from PIL import Image
def main():
img_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'images', 'balloon.png'))
- balloon = Image.open(img_path).convert("RGB")
+ balloon = Image.open(img_path) \
+ .transform((device.width, device.height), Image.AFFINE, (1, 0, 0, 0, 1, 0), Image.BILINEAR) \
+ .convert(device.mode)
+
while True:
# Image display
device.display(balloon) | Make colour demo agnostic of screen size | rm-hull_luma.oled | train | py |
10b5ca80c5ed817ae16608fc5175acbf326d63f1 | diff --git a/src/main/java/com/hp/autonomy/parametricvalues/ParametricRequest.java b/src/main/java/com/hp/autonomy/parametricvalues/ParametricRequest.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/hp/autonomy/parametricvalues/ParametricRequest.java
+++ b/src/main/java/com/hp/autonomy/parametricvalues/ParametricRequest.java
@@ -14,6 +14,7 @@ import lombok.Setter;
import lombok.experimental.Accessors;
import java.io.Serializable;
+import java.util.Collections;
import java.util.Set;
@Data
@@ -32,7 +33,7 @@ public class ParametricRequest implements Serializable {
this.databases = databases;
this.query = query;
this.fieldText = fieldText;
- this.fieldNames = fieldNames;
+ this.fieldNames = fieldNames == null ? Collections.<String>emptySet() : fieldNames;
}
@JsonPOJOBuilder(withPrefix = "set") | [CCUK-<I>] The fieldname parameter can be sent as null, so the parametric request replaces the field names with the empty set to prevent null pointer exceptions. [rev: alex.scown] | microfocus-idol_haven-search-components | train | java |
6fac016072d44746f9e9c34eb1666c62c49549ad | diff --git a/src/HelpScout/model/ref/PersonRef.php b/src/HelpScout/model/ref/PersonRef.php
index <HASH>..<HASH> 100644
--- a/src/HelpScout/model/ref/PersonRef.php
+++ b/src/HelpScout/model/ref/PersonRef.php
@@ -21,7 +21,11 @@ class PersonRef {
}
public function getObjectVars() {
- return get_object_vars($this);
+ $vars = get_object_vars($this);
+ if (isset($vars['id']) && $vars['id'] == false){
+ unset($vars['id']);
+ }
+ return $vars;
}
public function setEmail($email) { | Updated getObjectVars to unset the id if the value is false | helpscout_helpscout-api-php | train | php |
7863f14d79e9a9e42a7c04e9780b22f9ec00999c | diff --git a/cake/tests/cases/libs/all_configure.test.php b/cake/tests/cases/libs/all_configure.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/libs/all_configure.test.php
+++ b/cake/tests/cases/libs/all_configure.test.php
@@ -34,9 +34,10 @@ class AllConfigureTest extends PHPUnit_Framework_TestSuite {
* @return void
*/
public static function suite() {
- $suite = new PHPUnit_Framework_TestSuite('All Configure, App and ClassRegistry related tests');
+ $suite = new CakeTestSuite('All Configure, App and ClassRegistry related tests');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'configure.test.php');
+ $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'config');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'app.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'class_registry.test.php');
return $suite; | Adding new test cases into configure suite. | cakephp_cakephp | train | php |
f5432209487eb9fd3ba562c0f6835fc807a9fda0 | diff --git a/mpd.py b/mpd.py
index <HASH>..<HASH> 100644
--- a/mpd.py
+++ b/mpd.py
@@ -163,7 +163,7 @@ _commands = {
"sendmessage": "_fetch_nothing",
}
-class MPDClient():
+class MPDClient(object):
def __init__(self, use_unicode=False):
self.iterate = False
self.use_unicode = use_unicode | transform MPDClient to new style class. | Mic92_python-mpd2 | train | py |
5a4af4bb6eac6742f5a459f81afce3d0f29b767f | diff --git a/library/oosql/oosql.php b/library/oosql/oosql.php
index <HASH>..<HASH> 100644
--- a/library/oosql/oosql.php
+++ b/library/oosql/oosql.php
@@ -1117,6 +1117,7 @@ class oosql extends \PDO
$this->prepFetch();
$stmt = $this->oosql_stmt;
}
+
return $stmt;
} | core-<I> [core-<I>] Fix tests and add method comments for the new methods | ghousseyn_phiber | train | php |
b0cb87562d9c95163f53d3cd72e1ac1ee6f48d7a | diff --git a/casjobs.py b/casjobs.py
index <HASH>..<HASH> 100644
--- a/casjobs.py
+++ b/casjobs.py
@@ -264,6 +264,7 @@ class CasJobs(object):
* `job_id` (int): The id of the _output_ job.
* `outfn` (str): The file where the output should be stored.
+ May also be a file-like object with a 'write' method.
"""
job_info = self.job_info(jobid=job_id)[0]
@@ -285,9 +286,12 @@ class CasJobs(object):
%(remotefn, code))
# Save the data to a file.
- f = open(outfn, "wb")
- f.write(r.content)
- f.close()
+ try:
+ outfn.write(r.content)
+ except AttributeError:
+ f = open(outfn, "wb")
+ f.write(r.content)
+ f.close()
def request_and_get_output(self, table, outtype, outfn):
"""
@@ -303,6 +307,7 @@ class CasJobs(object):
FITS - Flexible Image Transfer System (FITS Binary)
VOTable - XML Virtual Observatory VOTABLE
* `outfn` (str): The file where the output should be stored.
+ May also be a file-like object with a 'write' method.
"""
job_id = self.request_output(table, outtype) | allow file-like object as parameter to get_output
If the outfn parameter to get_output has a write() method, that is used
for the output rather than opening a new file. This allows e.g. a
StringIO object to be passed in so that output can be captured in
memory rather than creating a temporary file. | dfm_casjobs | train | py |
41774c9454a871dd48f3fdcdcdab037754a3dab7 | diff --git a/core-bundle/contao/library/Contao/User.php b/core-bundle/contao/library/Contao/User.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/library/Contao/User.php
+++ b/core-bundle/contao/library/Contao/User.php
@@ -279,7 +279,7 @@ abstract class User extends \System
$this->save();
// Add a log entry and the error message, because checkAccountStatus() will not be called (see #4444)
- $this->log('The account has been locked for security reasons', __METHOD__, TL_ACCESS);
+ $this->log('User "' . $this->username . '" has been locked for ' . ceil($GLOBALS['TL_CONFIG']['lockPeriod'] / 60) . ' minutes', __METHOD__, TL_ACCESS);
\Message::addError(sprintf($GLOBALS['TL_LANG']['ERR']['accountLocked'], ceil((($this->locked + $GLOBALS['TL_CONFIG']['lockPeriod']) - $time) / 60)));
// Send admin notification | [Core] Add the username to the "account has been locked" log entry (see #<I>) | contao_contao | train | php |
9ad1147e14e663dcec89b039222b6bce0ee80e41 | diff --git a/lib/tty/progressbar.rb b/lib/tty/progressbar.rb
index <HASH>..<HASH> 100644
--- a/lib/tty/progressbar.rb
+++ b/lib/tty/progressbar.rb
@@ -258,6 +258,7 @@ module TTY
write(ECMA_CSI + DEC_TCEM + DEC_SET, false)
end
return if done?
+ render
clear ? clear_line : write("\n", false)
@meter.clear
@stopped = true
diff --git a/spec/unit/stop_spec.rb b/spec/unit/stop_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/stop_spec.rb
+++ b/spec/unit/stop_spec.rb
@@ -14,6 +14,7 @@ RSpec.describe TTY::ProgressBar, '#stop' do
expect(output.read).to eq([
"\e[1G[= ]",
"\e[1G[== ]",
+ "\e[1G[=== ]",
"\e[1G[=== ]\n"
].join)
end | Change stop call to rerender the bar so that configuration changes take effect | piotrmurach_tty-progressbar | train | rb,rb |
b800c7b7218d408d5a25c25fb02604def6e7c01d | diff --git a/molgenis-core/src/main/java/org/molgenis/framework/server/services/MolgenisGuiService.java b/molgenis-core/src/main/java/org/molgenis/framework/server/services/MolgenisGuiService.java
index <HASH>..<HASH> 100644
--- a/molgenis-core/src/main/java/org/molgenis/framework/server/services/MolgenisGuiService.java
+++ b/molgenis-core/src/main/java/org/molgenis/framework/server/services/MolgenisGuiService.java
@@ -51,8 +51,7 @@ public abstract class MolgenisGuiService
/**
* Handle use of molgenis GUI
*
- * TODO: this method is horrible and should be properly refactored,
- * documented and tested!
+ * TODO: this method is horrible and should be properly refactored, documented and tested!
*
* @param request
* @param response
@@ -232,7 +231,7 @@ public abstract class MolgenisGuiService
session.setAttribute("application", appController);
// prepare the response
- response.getResponse().setContentType("text/html");
+ response.getResponse().setContentType("text/html;charset=UTF-8");
// response.setBufferSize(10000);
PrintWriter writer = response.getResponse().getWriter(); | bug fix: do not rely on platform default encoding | molgenis_molgenis | train | java |
424d1621b38c15e6b391e3c8c968e64689e5426c | diff --git a/app/models/concerns/hyrax/collection_behavior.rb b/app/models/concerns/hyrax/collection_behavior.rb
index <HASH>..<HASH> 100644
--- a/app/models/concerns/hyrax/collection_behavior.rb
+++ b/app/models/concerns/hyrax/collection_behavior.rb
@@ -4,7 +4,6 @@ module Hyrax
extend ActiveSupport::Concern
include Hydra::AccessControls::WithAccessRight
include Hydra::WithDepositor # for access to apply_depositor_metadata
- include Hydra::AccessControls::Permissions
include Hyrax::CoreMetadata
include Hydra::Works::CollectionBehavior
include Hyrax::Noid | add Hydra::AccessControls::Permissions to CollectionBehavior once
`Hydra::AccessControls::WithAccessRight` already includes
`Hydra::AccessControls::Permissions` as its own dependency. avoid including it
explictly later. | samvera_hyrax | train | rb |
671080660493a1d191c4c25f7ca62833eb4b934d | diff --git a/lib/qonfig/version.rb b/lib/qonfig/version.rb
index <HASH>..<HASH> 100644
--- a/lib/qonfig/version.rb
+++ b/lib/qonfig/version.rb
@@ -5,5 +5,5 @@ module Qonfig
#
# @api public
# @since 0.1.0
- VERSION = '0.12.0'
+ VERSION = '0.13.0'
end | [gem] bumpt to <I> | 0exp_qonfig | train | rb |
62962ac99ec2c36a1e787648286ece4693478432 | diff --git a/sherlock/__version__.py b/sherlock/__version__.py
index <HASH>..<HASH> 100644
--- a/sherlock/__version__.py
+++ b/sherlock/__version__.py
@@ -1 +1 @@
-__version__ = '1.0.5'
+__version__ = '1.0.6' | fixing issue where the transientTable setting in the sherlock settings file wasn't being respected | thespacedoctor_sherlock | train | py |
2d056723e2067e976c039f160e27b5a89a5a7471 | diff --git a/csirtg_indicator/indicator.py b/csirtg_indicator/indicator.py
index <HASH>..<HASH> 100644
--- a/csirtg_indicator/indicator.py
+++ b/csirtg_indicator/indicator.py
@@ -55,6 +55,9 @@ class Indicator(object):
continue
if isinstance(kwargs[k], basestring):
+ # always stripe whitespace
+ kwargs[k] = kwargs[k].strip()
+
if self._lowercase is True:
kwargs[k] = kwargs[k].lower()
if k in ['tags', 'peers']:
@@ -75,7 +78,7 @@ class Indicator(object):
self._indicator = None
if indicator:
- self.indicator = indicator
+ self.indicator = indicator.strip()
self._confidence = 0
self.confidence = kwargs.get('confidence', 0) | Strip whitespace from str fields (#<I>)
If a source has tabs (\t) at the end of some fields, those currently make it into backend store. This should normalize removing those forms of spurious whitespace. | csirtgadgets_csirtg-indicator-py | train | py |
0cf6bea50fe4486fe1f6da689e7b69522aeb83ab | diff --git a/client/cli/ok.py b/client/cli/ok.py
index <HASH>..<HASH> 100644
--- a/client/cli/ok.py
+++ b/client/cli/ok.py
@@ -89,6 +89,9 @@ def main():
assign = None
try:
+ if args.authenticate:
+ auth.authenticate(True)
+
# Instantiating assignment
assign = assignment.load_config(args.config, args)
assign.load()
diff --git a/client/protocols/backup.py b/client/protocols/backup.py
index <HASH>..<HASH> 100644
--- a/client/protocols/backup.py
+++ b/client/protocols/backup.py
@@ -28,7 +28,7 @@ class BackupProtocol(models.Protocol):
self.check_ssl()
- access_token = auth.authenticate(self.args.authenticate)
+ access_token = auth.authenticate(False)
log.info('Authenticated with access token %s', access_token)
response = self.send_all_messages(access_token, message_list) | Allow --authenticate even without an assignment | okpy_ok-client | train | py,py |
aac95347853ce5a87670fe964cd5666710762799 | diff --git a/bin/cmd.js b/bin/cmd.js
index <HASH>..<HASH> 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -78,8 +78,26 @@ b.on('bundle', function (out) {
if (opts.watch) {
var w = watchify(b);
- w.on('update', function () {
- b.bundle();
+ var bundling = false;
+ var queued = false;
+
+ var bundle = function () {
+ if (!bundling) {
+ bundling = true;
+ b.bundle();
+ } else {
+ queued = true;
+ }
+ };
+ w.on('update', bundle);
+ b.on('bundle', function (out) {
+ out.on('end', function () {
+ bundling = false;
+ if (queued) {
+ queued = false;
+ setImmediate(bundle);
+ }
+ });
});
process.on('SIGINT', function () { | Avoid concurrent executions when using --watch | mantoni_mochify.js | train | js |
d9d9a6833e0f848c2a96b61e66c2acc9b5878c5b | diff --git a/less-watch-compiler.js b/less-watch-compiler.js
index <HASH>..<HASH> 100644
--- a/less-watch-compiler.js
+++ b/less-watch-compiler.js
@@ -144,7 +144,7 @@ function getFileExtension(string){
// Here's where we run the less compiler
function compileCSS(file){
var filename = getFilenameWithoutExtention(file);
- var command = 'lessc --yui-compress '+file.replace(/\s+/g,'\\ ')+' '+argvs[1]+'/'+filename.replace(/\s+/g,'\\ ')+'.css';
+ var command = 'lessc -x '+file.replace(/\s+/g,'\\ ')+' '+argvs[1]+'/'+filename.replace(/\s+/g,'\\ ')+'.css';
// Run the command
exec(command, function (error, stdout, stderr){
if (error !== null) | Update less-watch-compiler.js
--yui-compress seems to be deprecated, replacing with -x.
You can take or leave it, this is what I did to my copy. | jonycheung_deadsimple-less-watch-compiler | train | js |
1e72efde65ea7a3da065b556ad64ec90aa2d669a | diff --git a/react-native/react/tabs/devices/index.js b/react-native/react/tabs/devices/index.js
index <HASH>..<HASH> 100644
--- a/react-native/react/tabs/devices/index.js
+++ b/react-native/react/tabs/devices/index.js
@@ -50,21 +50,12 @@ export default class Devices extends Component {
}
render () {
- const {
- devices,
- waitingForServer,
- showRemoveDevicePage,
- showExistingDevicePage,
- showGenPaperKeyPage
- } = this.props
-
- return <DevicesRender {... {
- devices,
- waitingForServer,
- showRemoveDevicePage,
- showExistingDevicePage,
- showGenPaperKeyPage
- }}/>
+ return <DevicesRender
+ devices={this.props.devices}
+ waitingForServer={this.props.waitingForServer}
+ showRemoveDevicePage={this.props.showRemoveDevicePage}
+ showExistingDevicePage={this.props.showExistingDevicePage}
+ showGenPaperKeyPage={this.props.showGenPaperKeyPag}/>
}
} | Use other style for passing props in | keybase_client | train | js |
00de04c82d844b3bdf5162b2c78560f1b5656488 | diff --git a/dvc/command/remote.py b/dvc/command/remote.py
index <HASH>..<HASH> 100644
--- a/dvc/command/remote.py
+++ b/dvc/command/remote.py
@@ -18,7 +18,7 @@ class CmdRemote(CmdConfig):
def _check_exists(self, conf):
if self.args.name not in conf["remote"]:
- raise ConfigError(f"remote '{self.args.name}' doesn't exists.")
+ raise ConfigError(f"remote '{self.args.name}' doesn't exist.")
class CmdRemoteAdd(CmdRemote): | Fix typo in `dvc remote modify` output (#<I>) | iterative_dvc | train | py |
0112d47441ce18e70f3ba303e7b814acf4c67c31 | diff --git a/lib/jasmine-jquery.js b/lib/jasmine-jquery.js
index <HASH>..<HASH> 100644
--- a/lib/jasmine-jquery.js
+++ b/lib/jasmine-jquery.js
@@ -74,6 +74,7 @@ jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(url) {
var self = this;
$.ajax({
async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded
+ cache: false,
dataType: 'html',
url: url,
success: function(data) { | make sure fixtures aren't cached in browser cache | velesin_jasmine-jquery | train | js |
e9cebd7da58c0e5c44287ce8f75a922fa807e6f5 | diff --git a/cmd/oci-runtime-tool/generate.go b/cmd/oci-runtime-tool/generate.go
index <HASH>..<HASH> 100644
--- a/cmd/oci-runtime-tool/generate.go
+++ b/cmd/oci-runtime-tool/generate.go
@@ -384,6 +384,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
g.SetLinuxResourcesCPURealtimeRuntime(context.Uint64("linux-realtime-runtime"))
}
+ if context.IsSet("linux-pids-limit") {
+ g.SetLinuxResourcesPidsLimit(context.Int64("linux-pids-limit"))
+ }
+
if context.IsSet("linux-realtime-period") {
g.SetLinuxResourcesCPURealtimePeriod(context.Uint64("linux-realtime-period"))
} | Set pids limit when set through the CLI | opencontainers_runtime-tools | train | go |
a9300a43aed20342affdfe91c6848677b307eda5 | diff --git a/src/android/BackgroundExt.java b/src/android/BackgroundExt.java
index <HASH>..<HASH> 100644
--- a/src/android/BackgroundExt.java
+++ b/src/android/BackgroundExt.java
@@ -83,6 +83,8 @@ class BackgroundExt {
});
}
+ // codebeat:disable[ABC]
+
/**
* Executes the request.
*
@@ -113,6 +115,8 @@ class BackgroundExt {
}
}
+ // codebeat:enable[ABC]
+
/**
* Move app to background.
*/
diff --git a/src/android/BackgroundMode.java b/src/android/BackgroundMode.java
index <HASH>..<HASH> 100644
--- a/src/android/BackgroundMode.java
+++ b/src/android/BackgroundMode.java
@@ -77,6 +77,8 @@ public class BackgroundMode extends CordovaPlugin {
}
};
+ // codebeat:disable[ABC]
+
/**
* Executes the request.
*
@@ -115,6 +117,8 @@ public class BackgroundMode extends CordovaPlugin {
return true;
}
+ // codebeat:enable[ABC]
+
/**
* Called when the system is about to start resuming a previous activity.
* | Muting ABC issues [ci skip] | katzer_cordova-plugin-background-mode | train | java,java |
a8c862244d57836d4219433a4c0a3632e4281a78 | diff --git a/MenuItem.php b/MenuItem.php
index <HASH>..<HASH> 100644
--- a/MenuItem.php
+++ b/MenuItem.php
@@ -1160,9 +1160,15 @@ class MenuItem implements \ArrayAccess, \Countable, \IteratorAggregate
*/
public function getIsCurrent()
{
+ $currentUri = $this->getCurrentUri();
+
+ if(null === $currentUri) {
+ return false;
+ }
+
if ($this->isCurrent === null)
{
- $this->isCurrent = ($this->getUri() === $this->getCurrentUri());
+ $this->isCurrent = ($this->getUri() === $currentUri);
}
return $this->isCurrent; | No item is current if the current uri is not set | KnpLabs_KnpMenuBundle | train | php |
8bc90713f5efe4f827cb4af5aa558e170073ed27 | diff --git a/src/main/java/com/squareup/javapoet/TypeSpec.java b/src/main/java/com/squareup/javapoet/TypeSpec.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/squareup/javapoet/TypeSpec.java
+++ b/src/main/java/com/squareup/javapoet/TypeSpec.java
@@ -139,9 +139,7 @@ public final class TypeSpec {
}
public static Builder anonymousClassBuilder(String typeArgumentsFormat, Object... args) {
- return anonymousClassBuilder(CodeBlock.builder()
- .add(typeArgumentsFormat, args)
- .build());
+ return anonymousClassBuilder(CodeBlock.of(typeArgumentsFormat, args));
}
public static Builder anonymousClassBuilder(CodeBlock typeArguments) { | Nit: Simplify a CodeBlock | square_javapoet | train | java |
6d3edab458f558dbe425655bab2996e72fb1ecde | diff --git a/lib/adp-downloader/http_client.rb b/lib/adp-downloader/http_client.rb
index <HASH>..<HASH> 100644
--- a/lib/adp-downloader/http_client.rb
+++ b/lib/adp-downloader/http_client.rb
@@ -12,7 +12,7 @@ module ADPDownloader
res = agent.get(url)
_raise_on_error(res)
contents = res.body
- contents.body.to_s.empty? ? {} : JSON.parse(contents)
+ contents.to_s.empty? ? {} : JSON.parse(contents)
end
def post(url, data)
@@ -42,7 +42,8 @@ module ADPDownloader
def _raise_on_error(res)
uri = res.uri.to_s.downcase
- if not uri.start_with? TARGET_URL or uri.include? "login"
+ #if not uri.start_with? TARGET_URL or uri.include? "login"
+ if uri.include? "login"
#raise "Unable to authenticate: make sure your username and password are correct"
raise "Unable to authenticate: make sure the file cookie.txt is up to date"
end | Fix bug when displaying auth error messages
In order to properly display error messages, the original method had to
change a bit, otherwise, the app always displays the error message, even
when the request succeeded. | andersonvom_adp-downloader | train | rb |
1273b2d309685905dd1b497975cc9d40ed89b562 | diff --git a/components/chart.js b/components/chart.js
index <HASH>..<HASH> 100644
--- a/components/chart.js
+++ b/components/chart.js
@@ -4,6 +4,7 @@ const V = require('victory');
const d3Arr = require('d3-array');
const types = {
+ AREA: V.VictoryArea,
TIME: V.VictoryLine,
LINE: V.VictoryLine,
BAR: V.VictoryBar,
@@ -41,7 +42,11 @@ class Chart extends IdyllComponent {
<div className={this.props.className}>
{type !== 'PIE' ? (
<V.VictoryChart domainPadding={10} scale={scale}>
- <INNER_CHART data={data} x={this.props.x} y={this.props.y}>
+ <INNER_CHART
+ data={data}
+ x={this.props.x}
+ y={this.props.y}
+ interpolation={this.props.interpolation || 'linear'}>
</INNER_CHART>
</V.VictoryChart>
) : ( | Support area charts and custom interpolations | idyll-lang_idyll | train | js |
892130a08bd97dae52b4301d7892dc172c67ff48 | diff --git a/cmd/helm/version.go b/cmd/helm/version.go
index <HASH>..<HASH> 100644
--- a/cmd/helm/version.go
+++ b/cmd/helm/version.go
@@ -48,6 +48,8 @@ the template:
- .GitCommit is the git commit
- .GitTreeState is the state of the git tree when Helm was built
- .GoVersion contains the version of Go that Helm was compiled with
+
+For example, --template '{{.Version}}' outputs 'v3.2.1'. See [unit tests](https://github.com/helm/helm/blob/main/cmd/helm/version_test.go) for further examples.
`
type versionOptions struct { | Add example of --template usage
Current documentation list all available template vars, but does not provide an example of a template string that demonstrates template substitution. I had to look it up in the unit test. | helm_helm | train | go |
ef3d210cba80bbbc8af89fba7c82ba51721ee321 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-model-changes-py3',
- version='0.14.1',
+ version='0.15.1',
packages=find_packages(exclude=['tests']),
license='MIT License',
description='django-model-changes allows you to track model instance changes.',
@@ -24,7 +24,7 @@ setup(
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
diff --git a/tests/models.py b/tests/models.py
index <HASH>..<HASH> 100644
--- a/tests/models.py
+++ b/tests/models.py
@@ -9,4 +9,4 @@ class User(ChangesMixin, models.Model):
class Article(ChangesMixin, models.Model):
title = models.CharField(max_length=20)
- user = models.ForeignKey(User)
\ No newline at end of file
+ user = models.ForeignKey(User, on_delete=models.CASCADE) | Updated for Django<=<I> | iansprice_django-model-changes-py3 | train | py,py |
5098999737659fe419de9809fd1c18c96a87708e | diff --git a/skyfield/functions.py b/skyfield/functions.py
index <HASH>..<HASH> 100644
--- a/skyfield/functions.py
+++ b/skyfield/functions.py
@@ -1,5 +1,6 @@
"""Basic operations that are needed repeatedly throughout Skyfield."""
+import numpy as np
from numpy import (
arcsin, arctan2, array, cos, einsum, full_like,
float_, load, rollaxis, sin, sqrt,
@@ -7,6 +8,8 @@ from numpy import (
from pkgutil import get_data
from skyfield.constants import tau
+_tiny = np.finfo(np.float64).tiny
+
def dots(v, u):
"""Given one or more vectors in `v` and `u`, return their dot products.
@@ -74,7 +77,7 @@ def to_spherical(xyz):
"""
r = length_of(xyz)
x, y, z = xyz
- theta = arcsin(z / r)
+ theta = arcsin(z / (r + _tiny)) # "+ _tiny" avoids division by zero
phi = arctan2(y, x) % tau
return r, theta, phi | Fix #<I> with a very, very small number | skyfielders_python-skyfield | train | py |
bb5a2bcf452b6bc603d837fd0df51bd49b1cbfab | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -146,21 +146,6 @@ test('TXT record', function (dns, t) {
dns.query('hello-world', 'TXT')
})
-test('TXT record - empty', function (dns, t) {
- dns.once('query', function (packet) {
- dns.respond([{type: 'TXT', name: 'hello-world', ttl: 120}])
- })
-
- dns.once('response', function (packet) {
- t.same(packet.answers[0], {type: 'TXT', name: 'hello-world', ttl: 120, data: new Buffer('00', 'hex'), class: 1, flush: false})
- dns.destroy(function () {
- t.end()
- })
- })
-
- dns.query('hello-world', 'TXT')
-})
-
test('QU question bit', function (dns, t) {
dns.once('query', function (packet) {
t.same(packet.questions, [ | remove empty txt test as that should go in another module | mafintosh_multicast-dns | train | js |
fe11f07f77905fe3b3bcca270aee38292cb17b3c | diff --git a/Filter/Filter.php b/Filter/Filter.php
index <HASH>..<HASH> 100644
--- a/Filter/Filter.php
+++ b/Filter/Filter.php
@@ -54,7 +54,7 @@ abstract class Filter implements FilterInterface
get bound, the default dataMapper is a PropertyPathMapper).
So use this trick to avoid any issue.
*/
- return str_replace('.', '~', $this->name);
+ return str_replace('.', '__', $this->name);
}
/** | fixed filtering on sub-entities for sf <I> | sonata-project_SonataAdminBundle | train | php |
d62a22b756b2fe5df2d2212100341661f662b2aa | diff --git a/src/python/pants/backend/python/util_rules/pex_from_targets.py b/src/python/pants/backend/python/util_rules/pex_from_targets.py
index <HASH>..<HASH> 100644
--- a/src/python/pants/backend/python/util_rules/pex_from_targets.py
+++ b/src/python/pants/backend/python/util_rules/pex_from_targets.py
@@ -206,7 +206,7 @@ async def pex_from_targets(request: PexFromTargetsRequest, python_setup: PythonS
repository_pex: Pex | None = None
description = request.description
- if python_setup.requirement_constraints:
+ if python_setup.requirement_constraints and requirements:
constraints_file_contents = await Get(
DigestContents,
PathGlobs(
@@ -288,7 +288,7 @@ async def pex_from_targets(request: PexFromTargetsRequest, python_setup: PythonS
"`[python-setup].resolve_all_constraints` is enabled, so "
"`[python-setup].requirement_constraints` must also be set."
)
- elif python_setup.lockfile:
+ elif python_setup.lockfile and requirements:
# TODO(#12314): This does not handle the case where requirements are disjoint to the
# lockfile. We should likely regenerate the lockfile (or warn/error), as the inputs have
# changed. | Don't resolve constraints file / lockfile if no 3rd-party requirements used (#<I>)
This is an obvious performance improvement with no downsides.
[ci skip-rust]
[ci skip-build-wheels] | pantsbuild_pants | train | py |
5d9328aa07fdb2a55ffd2a7513c5a82c9791bd7f | diff --git a/tests/unit/services/websockets/on-test.js b/tests/unit/services/websockets/on-test.js
index <HASH>..<HASH> 100644
--- a/tests/unit/services/websockets/on-test.js
+++ b/tests/unit/services/websockets/on-test.js
@@ -25,6 +25,7 @@ module('Sockets Service - on(*) tests', {
},
teardown() {
window.WebSocket = originalWebSocket;
+ mockServer.close();
Ember.run(() => {
component.destroy(); | Fixing tests for upcoming mock-socket release | thoov_ember-websockets | train | js |
1b86da40670ec1d9d036a0c9381173a27738b841 | diff --git a/panoptes_client/collection.py b/panoptes_client/collection.py
index <HASH>..<HASH> 100644
--- a/panoptes_client/collection.py
+++ b/panoptes_client/collection.py
@@ -92,3 +92,29 @@ class Collection(PanoptesObject):
_subjects.append(_subject_id)
return _subjects
+
+ def add_default_subject(self, subject):
+ if not (
+ isinstance(subject, Subject)
+ or isinstance(subject, (int, str,))
+ ):
+ raise TypeError
+
+ _subject_id = subject.id if isinstance(subject, Subject) else str(subject)
+
+ self.http_post(
+ '{}/links/default_subject/{}'.format(self.id, _subject_id)
+ )
+
+ def link_to_project(self, project):
+ if not (
+ isinstance(project, Project)
+ or isinstance(project, (int, str))
+ ):
+ raise TypeError
+
+ _project_id = project.id if isinstance(project, Project) else str(project)
+
+ self.http_post(
+ '{}/links/project/{}'.format(self.id, _project_id)
+ ) | Add Collection class methods to update default subject and project links | zooniverse_panoptes-python-client | train | py |
22407fc8974f89b34b71b697bb5411db30e05b25 | diff --git a/pkg/metrics/counter.go b/pkg/metrics/counter.go
index <HASH>..<HASH> 100644
--- a/pkg/metrics/counter.go
+++ b/pkg/metrics/counter.go
@@ -29,9 +29,8 @@ func RegCounter(name string, tagStrings ...string) Counter {
// StandardCounter is the standard implementation of a Counter and uses the
// sync/atomic package to manage a single int64 value.
type StandardCounter struct {
+ count int64 //Due to a bug in golang the 64bit variable need to come first to be 64bit aligned. https://golang.org/pkg/sync/atomic/#pkg-note-BUG
*MetricMeta
-
- count int64
}
// Clear sets the counter to zero. | fix(metrics): <I>bit aligns standardcounter
Due to a bug in golang the <I>bit variable i
need to come first to be <I>bit aligned.
<URL> | grafana_grafana | train | go |
043ce8f21f7888d61c23615d44fd6614a5b1f7e5 | diff --git a/lib/bitcoin/tx_in.rb b/lib/bitcoin/tx_in.rb
index <HASH>..<HASH> 100644
--- a/lib/bitcoin/tx_in.rb
+++ b/lib/bitcoin/tx_in.rb
@@ -75,6 +75,12 @@ module Bitcoin
to_payload == other.to_payload
end
+ # return previous output hash (not txid)
+ def prev_hash
+ return nil unless out_point
+ out_point.hash
+ end
+
end
end | Add Bitcoin::TxIn#prev_hash which returns outpoint hash | chaintope_bitcoinrb | train | rb |
3d1cd6b0a8d23b04a09451ba83853f2f62a16cbe | diff --git a/timepiece/views.py b/timepiece/views.py
index <HASH>..<HASH> 100644
--- a/timepiece/views.py
+++ b/timepiece/views.py
@@ -538,6 +538,7 @@ def remove_contact_from_project(request, business, project, contact_id):
else:
return HttpResponseRedirect(reverse('view_project', business, project,))
+
@permission_required('timepiece.change_project')
@transaction.commit_on_success
@render_with('timepiece/project/relationship.html') | added space for pep8
--HG--
branch : feature/no-crm | caktus_django-timepiece | train | py |
6be271cc6a334d1bdef570e4019a41158568955c | diff --git a/allegedb/allegedb/query.py b/allegedb/allegedb/query.py
index <HASH>..<HASH> 100644
--- a/allegedb/allegedb/query.py
+++ b/allegedb/allegedb/query.py
@@ -66,7 +66,7 @@ class GlobalKeyValueStore(MutableMapping):
class QueryEngine(object):
"""Wrapper around either a DBAPI2.0 connection or an
- Alchemist. Provides functions to run queries using either.
+ Alchemist. Provides methods to run queries using either.
"""
json_path = xjpath | Correct function->method in docstring | LogicalDash_LiSE | train | py |
c9524bb0bc8265953868e288fae40d1e4811cc88 | diff --git a/src/org/opencms/ade/upload/CmsUploadBean.java b/src/org/opencms/ade/upload/CmsUploadBean.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/ade/upload/CmsUploadBean.java
+++ b/src/org/opencms/ade/upload/CmsUploadBean.java
@@ -292,6 +292,21 @@ public class CmsUploadBean extends CmsJspBean {
if (title.lastIndexOf('.') != -1) {
title = title.substring(0, title.lastIndexOf('.'));
}
+
+ // fileName really shouldn't contain the full path, but for some reason it does sometimes when the client is
+ // running on IE7, so we eliminate anything before and including the last slash or backslash in the title
+ // before setting it as a property.
+
+ int backslashIndex = title.lastIndexOf('\\');
+ if (backslashIndex != -1) {
+ title = title.substring(backslashIndex + 1);
+ }
+
+ int slashIndex = title.lastIndexOf('/');
+ if (slashIndex != -1) {
+ title = title.substring(slashIndex + 1);
+ }
+
List<CmsProperty> properties = new ArrayList<CmsProperty>(1);
CmsProperty titleProp = new CmsProperty();
titleProp.setName(CmsPropertyDefinition.PROPERTY_TITLE); | Fixed problem with full paths being set as title when uploading files. | alkacon_opencms-core | train | java |
30b57ca33bffedc31c43ae25982beb878904b40e | diff --git a/src/Models/Tenant.php b/src/Models/Tenant.php
index <HASH>..<HASH> 100644
--- a/src/Models/Tenant.php
+++ b/src/Models/Tenant.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Rinvex\Tenants\Models;
-use Spatie\Sluggable\HasSlug;
use Spatie\Sluggable\SlugOptions;
+use Rinvex\Support\Traits\HasSlug;
use Illuminate\Database\Eloquent\Model;
use Rinvex\Cacheable\CacheableEloquent;
use Illuminate\Database\Eloquent\Builder;
@@ -176,23 +176,6 @@ class Tenant extends Model implements TenantContract
}
/**
- * {@inheritdoc}
- */
- protected static function boot()
- {
- parent::boot();
-
- // Auto generate slugs early before validation
- static::validating(function (self $tenant) {
- if ($tenant->exists && $tenant->getSlugOptions()->generateSlugsOnUpdate) {
- $tenant->generateSlugOnUpdate();
- } elseif (! $tenant->exists && $tenant->getSlugOptions()->generateSlugsOnCreate) {
- $tenant->generateSlugOnCreate();
- }
- });
- }
-
- /**
* Get all attached models of the given class to the tenant.
*
* @param string $class | Move slug auto generation to the custom HasSlug trait | rinvex_laravel-tenants | train | php |
59bab1088b5061d4b8fb434740efcf36789a684f | diff --git a/tests/scripts/selenium/selenium_adapter.rb b/tests/scripts/selenium/selenium_adapter.rb
index <HASH>..<HASH> 100644
--- a/tests/scripts/selenium/selenium_adapter.rb
+++ b/tests/scripts/selenium/selenium_adapter.rb
@@ -22,23 +22,22 @@ class SeleniumAdapter
move_cursor(index)
type_text(op['value'])
break
- else
- if op['start'] > index
- move_cursor(index)
- delete_length = op['start'] - index
- delete(delete_length)
- break
- elsif !op['attributes'].empty?
- length = op['end'] - op['start']
- move_cursor(index)
- highlight(length)
- op['attributes'].each do |attr, val|
- format(attr, val)
- end
- break
- else
- index += op['end'] - op['start']
+ elsif op['start'] > index
+ debugger
+ move_cursor(index)
+ delete_length = op['start'] - index
+ delete(delete_length)
+ break
+ elsif !op['attributes'].empty?
+ length = op['end'] - op['start']
+ move_cursor(index)
+ highlight(length)
+ op['attributes'].each do |attr, val|
+ format(attr, val)
end
+ break
+ else
+ index += op['end'] - op['start']
end
end
end | Cleanup apply_delta logic. | quilljs_quill | train | rb |
034cbef66d93bda07db7a6271a8feb0155785427 | diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go
index <HASH>..<HASH> 100644
--- a/lnwallet/wallet.go
+++ b/lnwallet/wallet.go
@@ -993,8 +993,16 @@ func (l *LightningWallet) openChannelAfterConfirmations(res *ChannelReservation,
txid := res.partialState.FundingTx.TxSha()
l.chainNotifier.RegisterConfirmationsNotification(&txid, numConfs, trigger)
- // Wait until the specified number of confirmations has been reached.
- <-trigger.TriggerChan
+ // Wait until the specified number of confirmations has been reached,
+ // or the wallet signals a shutdown.
+out:
+ select {
+ case <-trigger.TriggerChan:
+ break out
+ case <-l.quit:
+ res.chanOpen <- nil
+ return
+ }
// Finally, create and officially open the payment channel!
// TODO(roasbeef): CreationTime once tx is 'open' | lnwallet: avoid goroutines waiting for channel open indefinitely blocking
Select over the quit channel in order to shutdown goroutines waiting
for funding txn confirmations. Without this we may leak goroutines
which are blocked forever if the process isn’t exiting when the walet
is signaled to shutdown. | lightningnetwork_lnd | train | go |
b92cc2543329e55089cb28435f4ba00234dcb4d6 | diff --git a/.eslintrc.js b/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -5,14 +5,10 @@ module.exports = {
'globals': {
'Promise': false,
- '__TEST__': true,
- '__MIN__': true,
- '__FILE_NAME__': true,
'__PAYPAL_CHECKOUT__': true,
'__paypal_checkout__': true,
'__sdk__': true,
'__LOCALE__': true,
- '__ENV__': true,
'__CLIENT_ID__': true,
'__MERCHANT_ID__': true
}, | Remove globals handled by grumbler-scripts | paypal_paypal-checkout-components | train | js |
b58f7d7d4bf612d2c0496665cb8f2f89d0ad888b | diff --git a/lib/site.php b/lib/site.php
index <HASH>..<HASH> 100644
--- a/lib/site.php
+++ b/lib/site.php
@@ -9,14 +9,10 @@ class Site extends \TimberSite
protected static $themeSupport = array();
protected $optionPages = array();
protected $editor;
- protected $currentUser;
public function __construct()
{
-
-
\Timber::$dirname = 'app/templates';
- $this->currentUser = new User();
self::addThemeSupport();
@@ -109,12 +105,6 @@ class Site extends \TimberSite
return $context;
}
- public function addCurrentUserToContext($context)
- {
- $context['current_user'] = $this->currentUser;
- return $context;
- }
-
public function addToTwig($twig)
{
/* this is where you can add your own fuctions to twig */ | Remove support for current user, it is getting refactored to a separate Auth class
Currently the Auth class is not in Understory, but implemented in the theme. | StoutLogic_understory | train | php |
bb44af2ccfe58874e3558a33b571ad3ebee12842 | diff --git a/moto/iam/responses.py b/moto/iam/responses.py
index <HASH>..<HASH> 100644
--- a/moto/iam/responses.py
+++ b/moto/iam/responses.py
@@ -1349,6 +1349,7 @@ LIST_GROUPS_FOR_USER_TEMPLATE = """<ListGroupsForUserResponse>
<GroupName>{{ group.name }}</GroupName>
<GroupId>{{ group.id }}</GroupId>
<Arn>{{ group.arn }}</Arn>
+ <CreateDate>{{ group.created_iso_8601 }}</CreateDate>
</member>
{% endfor %}
</Groups>
@@ -1651,6 +1652,7 @@ LIST_GROUPS_FOR_USER_TEMPLATE = """<ListGroupsForUserResponse>
<GroupName>{{ group.name }}</GroupName>
<GroupId>{{ group.id }}</GroupId>
<Arn>{{ group.arn }}</Arn>
+ <CreateDate>{{ group.created_iso_8601 }}</CreateDate>
</member>
{% endfor %}
</Groups> | Add CreateDate to iam list_groups_for_user.
Add the CreateDate field to the list_groups_for_user to match the
correct AWS response. Fixes #<I> | spulec_moto | train | py |
bec1bdaa2cf53bc6213a106edec1131287adc22d | diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py
index <HASH>..<HASH> 100644
--- a/src/_pytest/mark/structures.py
+++ b/src/_pytest/mark/structures.py
@@ -476,9 +476,9 @@ class MarkGenerator:
skip = _SkipMarkDecorator(Mark("skip", (), {}))
skipif = _SkipifMarkDecorator(Mark("skipif", (), {}))
xfail = _XfailMarkDecorator(Mark("xfail", (), {}))
- parametrize = _ParametrizeMarkDecorator(Mark("parametrize ", (), {}))
- usefixtures = _UsefixturesMarkDecorator(Mark("usefixtures ", (), {}))
- filterwarnings = _FilterwarningsMarkDecorator(Mark("filterwarnings ", (), {}))
+ parametrize = _ParametrizeMarkDecorator(Mark("parametrize", (), {}))
+ usefixtures = _UsefixturesMarkDecorator(Mark("usefixtures", (), {}))
+ filterwarnings = _FilterwarningsMarkDecorator(Mark("filterwarnings", (), {}))
def __getattr__(self, name: str) -> MarkDecorator:
if name[0] == "_": | mark: fix extraneous spaces in dummy type-checking marks
(cherry picked from commit <I>e<I>b<I>b0cddb1ec<I>c<I>cbd7f<I>) | pytest-dev_pytest | train | py |
f9090695b05f5aad455e7eee777baf588beaa067 | diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -10871,7 +10871,7 @@
* @return number[]
*/
private function get_plans_ids_associated_with_installs() {
- if ( ! $this->_is_network_active ) {
+ if ( ! is_multisite() ) {
if ( ! is_object( $this->_site ) ||
! FS_Plugin_Plan::is_valid_id( $this->_site->plan_id )
) { | [plans] Fixed an issue with the retrieving of plan IDs that are still associated with installs on a multisite environment. | Freemius_wordpress-sdk | train | php |
d306e3730192cc45c42a6cafd6d7d36b10ef4b35 | diff --git a/lib/launchy/descendant_tracker.rb b/lib/launchy/descendant_tracker.rb
index <HASH>..<HASH> 100644
--- a/lib/launchy/descendant_tracker.rb
+++ b/lib/launchy/descendant_tracker.rb
@@ -40,8 +40,9 @@ module Launchy
# and passing all the rest of the parameters to that method in
# each child
def find_child( method, *args )
- klass = children.find do |klass|
- klass.send( method, *args )
+ klass = children.find do |child|
+ Launchy.log "Checking if class #{child} is the one for #{method}(#{args.join(', ')})}"
+ child.send( method, *args )
end
end
end | Add in some debug output for finding children | copiousfreetime_launchy | train | rb |
e7de6c820dd50967c72506e7f65f869433860982 | diff --git a/tests/test_eval.py b/tests/test_eval.py
index <HASH>..<HASH> 100644
--- a/tests/test_eval.py
+++ b/tests/test_eval.py
@@ -44,6 +44,15 @@ class Test(unittest.TestCase):
self.assertEqual(c2.eval('(x)'), 2)
self.assertEqual(c3.eval('(x)'), 3)
+ @unittest.skip("Support for exception is not yet present")
+ def test_exception(self):
+ context = py_mini_racer.MiniRacer()
+
+ js_source = "var f = function() {throw 'error'};"
+
+ context.eval(js_source)
+ context.eval("f()")
+
if __name__ == '__main__':
import sys | Add a skipped test for exception handling | sqreen_PyMiniRacer | train | py |
913a9f57117fef0e310a693e24b506a6b5c0c2be | diff --git a/core-bundle/contao/elements/ContentTable.php b/core-bundle/contao/elements/ContentTable.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/elements/ContentTable.php
+++ b/core-bundle/contao/elements/ContentTable.php
@@ -115,12 +115,12 @@ class ContentTable extends \ContentElement
if ($j == 0)
{
- $class_tr = ' row_first';
+ $class_tr .= ' row_first';
}
if ($j == ($limit - 1))
{
- $class_tr = ' row_last';
+ $class_tr .= ' row_last';
}
$class_eo = (($j % 2) == 0) ? ' even' : ' odd';
@@ -131,12 +131,12 @@ class ContentTable extends \ContentElement
if ($i == 0)
{
- $class_td = ' col_first';
+ $class_td .= ' col_first';
}
if ($i == (count($rows[$j]) - 1))
{
- $class_td = ' col_last';
+ $class_td .= ' col_last';
}
$arrBody['row_' . $j . $class_tr . $class_eo][] = array | [Core] The table content element did not assign the correct CSS class names when there was only one row and one column (see #<I>) | contao_contao | train | php |
b9f226b64e95fe30b4b9b161ce1e9305695ac63b | diff --git a/publ/__init__.py b/publ/__init__.py
index <HASH>..<HASH> 100755
--- a/publ/__init__.py
+++ b/publ/__init__.py
@@ -10,7 +10,7 @@ import werkzeug.exceptions
from . import config, rendering, model, index, caching, view, utils
from . import maintenance, image
-__version__ = '0.3.22'
+__version__ = '0.3.22.1'
class _PublApp(flask.Flask):
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
"""Setup for Publ packaging"""
# Always prefer setuptools over distutils
-from setuptools import setup
+from setuptools import setup, find_packages
from os import path
import publ
@@ -52,7 +52,7 @@ setup(
keywords='website cms publishing blog photogallery sharing',
- packages=['publ'],
+ packages=find_packages(),
install_requires=[
'Flask', | Fix setup.py to include subdirs | PlaidWeb_Publ | train | py,py |
5957725975a4ad49d89125dec9ba02189f7bbca3 | diff --git a/lnwallet/interface_test.go b/lnwallet/interface_test.go
index <HASH>..<HASH> 100644
--- a/lnwallet/interface_test.go
+++ b/lnwallet/interface_test.go
@@ -1283,6 +1283,13 @@ func TestLightningWallet(t *testing.T) {
t.Fatalf("unable to set up mining node: %v", err)
}
+ // Next mine enough blocks in order for segwit and the CSV package
+ // soft-fork to activate on SimNet.
+ numBlocks := netParams.MinerConfirmationWindow * 2
+ if _, err := miningNode.Node.Generate(numBlocks); err != nil {
+ t.Fatalf("unable to generate blocks: %v", err)
+ }
+
rpcConfig := miningNode.RPCConfig()
chainNotifier, err := btcdnotify.New(&rpcConfig) | lnwallet: mine enough blocks to activate CSV+segwit in reservation tests | lightningnetwork_lnd | train | go |
ba9d9f89104a26a410e1eb9e371d366ef2702c35 | diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py
index <HASH>..<HASH> 100644
--- a/systemd/test/test_daemon.py
+++ b/systemd/test/test_daemon.py
@@ -353,7 +353,7 @@ def test_daemon_notify_memleak():
try:
notify('', True, 0, fds)
- except ConnectionRefusedError:
+ except connection_error:
pass
assert sys.getrefcount(fd) <= ref_cnt, 'leak' | tests: python2-compat in another place | systemd_python-systemd | train | py |
445b252bc4fad70f9f10591c04875abac5d4ba49 | diff --git a/packages/babel-core/src/config/option-manager.js b/packages/babel-core/src/config/option-manager.js
index <HASH>..<HASH> 100644
--- a/packages/babel-core/src/config/option-manager.js
+++ b/packages/babel-core/src/config/option-manager.js
@@ -303,7 +303,7 @@ const loadDescriptor = makeWeakCache(
});
try {
- item = value(api, options, { dirname });
+ item = value(api, options, dirname);
} catch (e) {
if (alias) {
e.message += ` (While processing: ${JSON.stringify(alias)})`; | Simplify dirname option in plugins/presets? (#<I>) | babel_babel | train | js |
1e253087ba58d65f213df37423930a1ab7a68a95 | diff --git a/lib/ezdb/classes/ezdbinterface.php b/lib/ezdb/classes/ezdbinterface.php
index <HASH>..<HASH> 100644
--- a/lib/ezdb/classes/ezdbinterface.php
+++ b/lib/ezdb/classes/ezdbinterface.php
@@ -104,7 +104,15 @@ class eZDBInterface
$this->OutputTextCodec = null;
$this->InputTextCodec = null;
- if ( $this->UseBuiltinEncoding )
+/*
+ This is pseudocode, there is no such function as
+ mysql_supports_charset() of course
+ if ( $this->UseBuiltinEncoding and mysql_supports_charset( $charset ) )
+ {
+ mysql_session_set_charset( $charset );
+ }
+ else
+*/
{
include_once( "lib/ezi18n/classes/eztextcodec.php" );
$this->OutputTextCodec =& eZTextCodec::instance( $charset, false, false ); | - Clarify code portion by adding pseudo code. Related to:
<URL> | ezsystems_ezpublish-legacy | train | php |
f2d447ea98755c882b53e76f60e54ec590db82fd | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -25,7 +25,6 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.ifconfig',
- 'sphinxcontrib.email',
]
# Add any paths that contain templates here, relative to this directory. | Remove sphinxcontrib.email extension | mcs07_PubChemPy | train | py |
5d7514722060d1f975c5aadc1e0d73c95c47a970 | diff --git a/graylog_hook.go b/graylog_hook.go
index <HASH>..<HASH> 100644
--- a/graylog_hook.go
+++ b/graylog_hook.go
@@ -1,4 +1,4 @@
-package graylog // import "gopkg.in/gemnasium/logrus-graylog-hook.v1"
+package graylog // import "github.com/raphyot/logrus-graylog-hook"
import (
"bytes" | Changed package def tobe usable | gemnasium_logrus-graylog-hook | train | go |
3c525ca2c7f27dfcc3a290433c21da468dd0d55d | diff --git a/lib/ooor/base.rb b/lib/ooor/base.rb
index <HASH>..<HASH> 100644
--- a/lib/ooor/base.rb
+++ b/lib/ooor/base.rb
@@ -289,7 +289,7 @@ module Ooor
self.class.object_service(:execute, object_db, object_uid, object_pass, self.class.openerp_model, method, *args)
end
- def load(attributes, remove_root=false)#an attribute might actually be a association too, will be determined here
+ def load(attributes, remove_root=false, persisted=false)#an attribute might actually be a association too, will be determined here
self.class.reload_fields_definition(false, object_session)
raise ArgumentError, "expected an attributes Hash, got #{attributes.inspect}" unless attributes.is_a?(Hash)
@prefix_options, attributes = split_options(attributes) | load API closer to ActiveResource one; should fix broken test | akretion_ooor | train | rb |
da4bc736b40e73872e3cbd252677f4aa1a9eea58 | diff --git a/salt/daemons/flo/core.py b/salt/daemons/flo/core.py
index <HASH>..<HASH> 100644
--- a/salt/daemons/flo/core.py
+++ b/salt/daemons/flo/core.py
@@ -403,6 +403,7 @@ class SaltManorLaneSetup(ioflo.base.deeding.Deed):
worker_seed.append('yard{0}'.format(ind + 1))
self.workers.value = itertools.cycle(worker_seed)
+
class SaltRaetLaneStackCloser(ioflo.base.deeding.Deed): # pylint: disable=W0232
'''
Closes lane stack server socket connection | Fix missing line lint issue | saltstack_salt | train | py |
290b39799a92adc92915d8e52010ae8ef86cfd8a | diff --git a/network.js b/network.js
index <HASH>..<HASH> 100644
--- a/network.js
+++ b/network.js
@@ -1631,7 +1631,7 @@ eventBus.on('aa_definition_saved', function (payload, unit) {
return;
storage.readJoint(db, unit, {
ifNotFound: function () {
- throw Error('recently saved unit ' + unit + ' not found');
+ console.log('recently saved unit ' + unit + ' not found');
},
ifFound: function (objJoint) {
arrWses.forEach(function (ws) { | fixed: error when executing dry_run_aa | byteball_ocore | train | js |
853153d26332b35f1fd6901da828cf4ac0ca9698 | diff --git a/src/Component/JsonSchema/Console/Loader/SchemaLoader.php b/src/Component/JsonSchema/Console/Loader/SchemaLoader.php
index <HASH>..<HASH> 100644
--- a/src/Component/JsonSchema/Console/Loader/SchemaLoader.php
+++ b/src/Component/JsonSchema/Console/Loader/SchemaLoader.php
@@ -40,6 +40,7 @@ class SchemaLoader implements SchemaLoaderInterface
'use-cacheable-supports-method',
'skip-null-values',
'skip-required-fields',
+ 'custom-string-format-mapping'
];
} | fix: missing declaration of new config option | janephp_janephp | train | php |
e2f5fdf5bd3fa78e5cd0e1e63cf3d8920f27cbe7 | diff --git a/lib/loglevel.js b/lib/loglevel.js
index <HASH>..<HASH> 100644
--- a/lib/loglevel.js
+++ b/lib/loglevel.js
@@ -19,7 +19,7 @@
// Slightly dubious tricks to cut down minimized file size
var noop = function() {};
var undefinedType = "undefined";
- var isIE = (
+ var isIE = (typeof window !== undefinedType) && (
window.navigator.userAgent.indexOf('Trident/') >= 0 ||
window.navigator.userAgent.indexOf('MSIE ') >= 0
); | Fix bug in IE test that breaks logging for node.js | pimterry_loglevel | train | js |
5649ef2ffcda79db9476c0964cf49a6350a8ffeb | diff --git a/admin/jqadm/templates/product/item-category-standard.php b/admin/jqadm/templates/product/item-category-standard.php
index <HASH>..<HASH> 100644
--- a/admin/jqadm/templates/product/item-category-standard.php
+++ b/admin/jqadm/templates/product/item-category-standard.php
@@ -55,6 +55,9 @@ $keys = [
<input class="item-listid" type="hidden" v-model="items['catalog.lists.id'][idx]"
name="<?= $enc->attr( $this->formparam( array( 'category', 'catalog.lists.id', '' ) ) ); ?>" />
+ <input class="item-label" type="hidden" v-model="items['catalog.code'][idx]"
+ name="<?= $enc->attr( $this->formparam( array( 'category', 'catalog.code', '' ) ) ); ?>" />
+
<input class="item-label" type="hidden" v-model="items['catalog.label'][idx]"
name="<?= $enc->attr( $this->formparam( array( 'category', 'catalog.label', '' ) ) ); ?>" /> | Bugfix for JS error if product couldn't be saved | aimeos_ai-admin-jqadm | train | php |
95658b59f2f8b25b875baa51a714b7732096cf04 | diff --git a/lib/cratus/group.rb b/lib/cratus/group.rb
index <HASH>..<HASH> 100644
--- a/lib/cratus/group.rb
+++ b/lib/cratus/group.rb
@@ -27,7 +27,7 @@ module Cratus
# TODO make this work with more things...
unless @raw_ldap_data
- puts "WARNING: Group '#{@name}' appears to be invalid or beyond the search scope!"
+ STDERR.puts "WARNING: Group '#{@name}' appears to be invalid or beyond the search scope!"
return []
end | Outputing group warning to STDERR | knuedge_cratus | train | rb |
8a367955773f9b428e7d4f99a2616b301cc20099 | diff --git a/workbench/workers/view_zip.py b/workbench/workers/view_zip.py
index <HASH>..<HASH> 100644
--- a/workbench/workers/view_zip.py
+++ b/workbench/workers/view_zip.py
@@ -6,7 +6,7 @@ import pprint
class ViewZip(object):
''' ViewZip: Generates a view for Zip files '''
- dependencies = ['meta', 'unzip']
+ dependencies = ['meta', 'unzip', 'yara_sigs']
def __init__(self):
self.workbench = zerorpc.Client(timeout=300, heartbeat=60)
@@ -21,6 +21,7 @@ class ViewZip(object):
view = {}
view['payload_md5s'] = input_data['unzip']['payload_md5s']
+ view['yara_sigs'] = input_data['yara_sigs']['matches'].keys()
view.update(input_data['meta'])
# Okay this view is going to also give the meta data about the payloads | adding yara_sigs to the zip view | SuperCowPowers_workbench | train | py |
8a4149d548e5086cf211ba4ba922304940d1fe74 | diff --git a/lib/ffi-geos/prepared_geometry.rb b/lib/ffi-geos/prepared_geometry.rb
index <HASH>..<HASH> 100644
--- a/lib/ffi-geos/prepared_geometry.rb
+++ b/lib/ffi-geos/prepared_geometry.rb
@@ -3,7 +3,7 @@ module Geos
class PreparedGeometry
include Geos::Tools
- attr_reader :ptr
+ attr_reader :ptr, :geometry
undef :clone, :dup
@@ -12,7 +12,7 @@ module Geos
FFIGeos.GEOSPrepare_r(Geos.current_handle, geom.ptr),
auto_free ? self.class.method(:release) : self.class.method(:no_release)
)
- @geom = geom
+ @geometry = geom
if !auto_free
@ptr.autorelease = false | Add an attr_reader to get to the geometry cmeiklejohn's patch. | dark-panda_ffi-geos | train | rb |
0dd6ebdc57bdd9c0bc5833daedc4bcfb5523e8aa | diff --git a/lib/autocomplete-manager.js b/lib/autocomplete-manager.js
index <HASH>..<HASH> 100644
--- a/lib/autocomplete-manager.js
+++ b/lib/autocomplete-manager.js
@@ -215,11 +215,11 @@ class AutocompleteManager {
this.findSuggestions(activatedManually)
},
'autocomplete-plus:navigate-to-description-more-link': () => {
- let suggestionListView = atom.views.getView(this.editor);
- let descriptionContainer = suggestionListView.querySelector('.suggestion-description');
+ let suggestionListView = atom.views.getView(this.editor)
+ let descriptionContainer = suggestionListView.querySelector('.suggestion-description')
if (descriptionContainer.style.display === 'block') {
- let descriptionMoreLink = descriptionContainer.querySelector('.suggestion-description-more-link');
- require('shell').openExternal(descriptionMoreLink.href);
+ let descriptionMoreLink = descriptionContainer.querySelector('.suggestion-description-more-link')
+ require('shell').openExternal(descriptionMoreLink.href)
}
}
})) | removed semicolons in autocomplete-manager.js | atom_autocomplete-plus | train | js |
1b06dee0cf5cf4f0c05a7ed7233a9c87bc8fbdf0 | diff --git a/imgaug/augmenters/size.py b/imgaug/augmenters/size.py
index <HASH>..<HASH> 100644
--- a/imgaug/augmenters/size.py
+++ b/imgaug/augmenters/size.py
@@ -1439,8 +1439,8 @@ class CropToFixedSize(Augmenter):
keypoints_on_image = keypoints_on_images[i]
ih, iw = keypoints_on_image.shape[:2]
- offset_x = int(offset_xs[i]*(iw-w+1)) if iw > w else 0
- offset_y = int(offset_ys[i]*(ih-h+1)) if ih > h else 0
+ offset_y = int(offset_ys[i] * (ih - h)) if ih > h else 0
+ offset_x = int(offset_xs[i] * (iw - w)) if iw > w else 0
keypoints_cropped = keypoints_on_image.shift(x=-offset_x, y=-offset_y)
keypoints_cropped.shape = (min(ih, h), min(iw, w)) + keypoints_cropped.shape[2:] | Fix off by one error in CropToFixedSize | aleju_imgaug | train | py |
d8b4101d2768c73ab4ed1a836d4416f7037cf9bb | diff --git a/openquake/commands/with_tiles.py b/openquake/commands/with_tiles.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/with_tiles.py
+++ b/openquake/commands/with_tiles.py
@@ -18,6 +18,7 @@
from __future__ import division
import os
import time
+import logging
from openquake.baselib import sap, general, parallel
from openquake.hazardlib import valid
from openquake.commonlib import readinput, datastore, logs
@@ -48,6 +49,8 @@ def with_tiles(num_tiles, job_ini, poolsize=0):
parent_child[0] = calc_id
parent_child[1] = calc_id
logs.dbcmd('update_parent_child', parent_child)
+ logging.warn('Finished calculation %d of %d',
+ len(calc_ids) + 1, num_tiles)
return calc_ids + [calc_id]
calc_ids = Starmap(engine.run_tile, task_args, poolsize).reduce(agg, [])
for calc_id in calc_ids: | Restored logging [skip CI]
Former-commit-id: <I>dc8e<I>ee<I>bec<I>e<I>fb<I>b | gem_oq-engine | train | py |
ecd8031486ae5b9648056d6cbf6c5fb61ac0591c | diff --git a/lib/chanko/invoker/function_finder.rb b/lib/chanko/invoker/function_finder.rb
index <HASH>..<HASH> 100644
--- a/lib/chanko/invoker/function_finder.rb
+++ b/lib/chanko/invoker/function_finder.rb
@@ -31,7 +31,11 @@ module Chanko
end
def active?
- unit.try(:active?, context, active_if_options)
+ if unit
+ unit.active?(context, active_if_options)
+ else
+ false
+ end
end
end
end | Fix problem that the unit may be false | cookpad_chanko | train | rb |
a133ef7eff791c46c47a0731d5af40978c9eea98 | diff --git a/ait/core/server/plugin.py b/ait/core/server/plugin.py
index <HASH>..<HASH> 100644
--- a/ait/core/server/plugin.py
+++ b/ait/core/server/plugin.py
@@ -140,10 +140,15 @@ class TelemetryLimitMonitor(Plugin):
log.info('Starting telemetry limit monitoring')
def process(self, input_data, topic=None, **kwargs):
- split = input_data[1:-1].split(',', 1)
- pkt_id, pkt_data = int(split[0]), split[1]
- packet = self.packet_dict[pkt_id]
- decoded = tlm.Packet(packet, data=bytearray(pkt_data))
+ try:
+ split = input_data[1:-1].split(',', 1)
+ pkt_id, pkt_data = int(split[0]), split[1]
+ packet = self.packet_dict[pkt_id]
+ decoded = tlm.Packet(packet, data=bytearray(pkt_data))
+ except Exception as e:
+ log.error('TelemetryLimitMonitor: {}'.format(e))
+ log.error('TelemetryLimitMonitor received input_data that it is unable to process. Skipping input ...')
+ return
if packet.name in self.limit_dict:
for field, defn in self.limit_dict[packet.name].iteritems(): | Make TelemetryLimitMonitor plugin robust to poorly formed input
Update the TelemetryLimitMonitor plugin so exceptions raised when
handling potentially malformed data are caught, logged, and ignored.
This ensures that the greenlet doesn't terminate when bad input is
received. | NASA-AMMOS_AIT-Core | train | py |
8847e9b873c475b032facb2494a592d37773a307 | diff --git a/drivers/python/rethinkdb.py b/drivers/python/rethinkdb.py
index <HASH>..<HASH> 100644
--- a/drivers/python/rethinkdb.py
+++ b/drivers/python/rethinkdb.py
@@ -213,6 +213,14 @@ def gt(*terms):
def gte(*terms):
return Comparison(list(terms), p.GE)
+def and_eq(_hash):
+ terms = []
+ for key in _hash.iterkeys():
+ val = _hash[key]
+ terms.append(eq(key, val))
+ return Conjunction(terms)
+
+
class Arithmetic(Term):
def __init__(self, terms, op_type):
if not terms: | Adding support for and_eq (to be used in filter later as sugar) | rethinkdb_rethinkdb | train | py |
515015a9cb5fa6e4d727d17eebcab423fbab74dd | diff --git a/prow/config/branch_protection.go b/prow/config/branch_protection.go
index <HASH>..<HASH> 100644
--- a/prow/config/branch_protection.go
+++ b/prow/config/branch_protection.go
@@ -362,10 +362,11 @@ func (c *Config) unprotectedBranches(presubmits map[string][]Presubmit) []string
// because any branches not explicitly specified in the configuration will be unprotected.
func (c *Config) BranchProtectionWarnings(logger *logrus.Entry, presubmits map[string][]Presubmit) {
if warnings := c.reposWithDisabledPolicy(); len(warnings) > 0 {
- logger.Warnf("The following repos define a policy, but have protect: false: %s", strings.Join(warnings, ","))
+
+ logger.WithField("repos", strings.Join(warnings, ",")).Warn("The following repos define a policy, but have protect: false")
}
if warnings := c.unprotectedBranches(presubmits); len(warnings) > 0 {
- logger.Warnf("The following repos define a policy or require context(s), but have one or more branches with protect: false: %s", strings.Join(warnings, ","))
+ logger.WithField("repos", strings.Join(warnings, ",")).Warn("The following repos define a policy or require context(s), but have one or more branches with protect: false")
}
} | Tide: Do not use printf logging for branchtotection warning | kubernetes_test-infra | train | go |
1526c4cd6d8c622602d2ec291796f8081c01ee77 | diff --git a/vm/src/jit.js b/vm/src/jit.js
index <HASH>..<HASH> 100644
--- a/vm/src/jit.js
+++ b/vm/src/jit.js
@@ -488,7 +488,7 @@
if (canLoop) {
loopVar = 'R[' + (a + 3) + ']';
- this.code[pc - 1] = 'for(' + loopVar + '=R[' + a + '],' + limitVar + '=' + limit + ';' + loopVar + (forward? '<' : '>') + '=' + limitVar + ';' + loopVar + '+=' + step +'){';
+ this.code[pc - 1] = 'for(' + loopVar + '=R[' + a + '],' + limitVar + '=' + limit + ';' + loopVar + (step > 0? '<' : '>') + '=' + limitVar + ';' + loopVar + '+=' + step +'){';
delete this.jumpDestinations[this.pc];
return '}';
} | Fixes JIT output for negative for-loops. | gamesys_moonshine | train | js |
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.