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 |
|---|---|---|---|---|---|
0edccb3b558a52b08d5259a2fa2234bbc1ab4681 | diff --git a/examples/26-new-order.php b/examples/26-new-order.php
index <HASH>..<HASH> 100644
--- a/examples/26-new-order.php
+++ b/examples/26-new-order.php
@@ -46,7 +46,7 @@ try {
"orderNumber" => "1337",
"redirectUrl" => "https://example.org/redirect",
"webhookUrl" => "https://example.org/webhook",
- "method" => "klarnapaylater",
+ "method" => "ideal",
"lines" => [
[
"sku" => "5702016116977", | Switched method to default supported ideal | mollie_mollie-api-php | train | php |
51419a7e1870fd3cd1c508b156c5827ff8171165 | diff --git a/src/Enum/CurrencyCode.php b/src/Enum/CurrencyCode.php
index <HASH>..<HASH> 100644
--- a/src/Enum/CurrencyCode.php
+++ b/src/Enum/CurrencyCode.php
@@ -94,6 +94,7 @@ class CurrencyCode
const LKR = 'LKR';
const LRD = 'LRD';
const LSL = 'LSL';
+ const LTC = 'LTC';
const LTL = 'LTL';
const LVL = 'LVL';
const LYD = 'LYD'; | Added missing code for LTC currency. | coinbase_coinbase-php | train | php |
68b4cd63bb020b135b8440d52bbf585bb5005efd | diff --git a/bin/tools/utils.js b/bin/tools/utils.js
index <HASH>..<HASH> 100644
--- a/bin/tools/utils.js
+++ b/bin/tools/utils.js
@@ -199,13 +199,13 @@ fs.copyFileSync("bin/build/qx.cmd", "tmp/qx.cmd");
if (result.exitCode) {
process.exit(result.exitCode);
}
-
- console.log("Compiling and deploy build version");
- result = await runCommand(".", "node", "./tmp/qx", "deploy", "--target=build", "--clean", "-M");
+
+ console.log("Compiling build version");
+ result = await runCommand(".", "node", "./tmp/qx", "compile", "--target=build", "--clean", "-M");
if (result.exitCode) {
process.exit(result.exitCode);
}
-
+
console.log("Compiler successfully bootstrapped");
} | back to just compile instead of deploy | qooxdoo_qooxdoo-compiler | train | js |
477f236c71b4892e876337c79f1b88be1ad9f570 | diff --git a/docker/version.py b/docker/version.py
index <HASH>..<HASH> 100644
--- a/docker/version.py
+++ b/docker/version.py
@@ -1,2 +1,2 @@
-version = "2.5.0"
+version = "2.6.0-dev"
version_info = tuple([int(d) for d in version.split("-")[0].split(".")]) | Bump <I>-dev | docker_docker-py | train | py |
790bb25c47390a7eb683ab47e0efa4c855980409 | diff --git a/src/uiSelectController.js b/src/uiSelectController.js
index <HASH>..<HASH> 100644
--- a/src/uiSelectController.js
+++ b/src/uiSelectController.js
@@ -149,7 +149,7 @@ uis.controller('uiSelectCtrl',
ctrl.setItemsFn(data);
}else{
if ( data !== undefined ) {
- var filteredItems = data.filter(function(i) {return selectedItems.indexOf(i) < 0;});
+ var filteredItems = data.filter(function(i) {return selectedItems && selectedItems.indexOf(i) < 0;});
ctrl.setItemsFn(filteredItems);
}
}
diff --git a/src/uiSelectMultipleDirective.js b/src/uiSelectMultipleDirective.js
index <HASH>..<HASH> 100644
--- a/src/uiSelectMultipleDirective.js
+++ b/src/uiSelectMultipleDirective.js
@@ -56,7 +56,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
ctrl.getPlaceholder = function(){
//Refactor single?
- if($select.selected.length) return;
+ if($select.selected && $select.selected.length) return;
return $select.placeholder;
}; | Solving bug when selectItems is undefined. | angular-ui_ui-select | train | js,js |
12df1c5949b983e4c4b7c193f876230541819a6f | diff --git a/agrona/src/test/java/org/agrona/concurrent/AgentInvokerTest.java b/agrona/src/test/java/org/agrona/concurrent/AgentInvokerTest.java
index <HASH>..<HASH> 100644
--- a/agrona/src/test/java/org/agrona/concurrent/AgentInvokerTest.java
+++ b/agrona/src/test/java/org/agrona/concurrent/AgentInvokerTest.java
@@ -146,6 +146,7 @@ public class AgentInvokerTest
when(mockAgent.doWork()).thenThrow(new ClosedByInterruptException());
assertExceptionNotReported();
+ assertTrue(Thread.interrupted()); // by throwing ClosedByInterruptException
}
@Test
@@ -167,6 +168,7 @@ public class AgentInvokerTest
});
assertExceptionNotReported();
+ assertTrue(Thread.interrupted()); // by throwing ClosedByInterruptException
}
private void assertExceptionNotReported() | [Java] Clear the interrupted flag on the main thread to ensure that further tests will not be affected | real-logic_agrona | train | java |
bc6dfb31d1ae35d12c46736bd42462d4b883fe43 | diff --git a/lib/featuresLoader.js b/lib/featuresLoader.js
index <HASH>..<HASH> 100644
--- a/lib/featuresLoader.js
+++ b/lib/featuresLoader.js
@@ -23,7 +23,7 @@ const createCucumber = (
window.cucumberJson = ${JSON.stringify(cucumberJson)};
var moduleCache = arguments[5];
-
+
function clearFromCache(moduleId, instance){
if(isWebpack()){
delete require.cache[moduleId];
@@ -31,7 +31,7 @@ const createCucumber = (
clearFromCacheBrowserify(instance);
}
}
-
+
function isWebpack(){
return !!require.cache
}
@@ -60,10 +60,10 @@ const createCucumber = (
nonGlobalToRequire
.find(fileSteps => fileSteps[filePath])
[filePath].join("\n")}
-
- createTestsFromFeature('${path.basename(filePath)}', \`${jsStringEscape(
+
+ createTestsFromFeature('${path.basename(filePath)}', '${jsStringEscape(
spec
- )}\`);
+ )}');
})
`
) | fix(featuresloader.js): pass spec as string to createTestsFromFeature fn
All test cases now passing
fix #<I> | TheBrainFamily_cypress-cucumber-preprocessor | train | js |
15e709d8ec1e99bee3c23523d3ff7f2b25e57191 | diff --git a/src/Propel/Generator/Reverse/MysqlSchemaParser.php b/src/Propel/Generator/Reverse/MysqlSchemaParser.php
index <HASH>..<HASH> 100644
--- a/src/Propel/Generator/Reverse/MysqlSchemaParser.php
+++ b/src/Propel/Generator/Reverse/MysqlSchemaParser.php
@@ -17,7 +17,10 @@ use Task;
use PDO;
use Propel\Generator\Model\Column;
use Propel\Generator\Model\Database;
+use Propel\Generator\Model\ForeignKey;
+use Propel\Generator\Model\Index;
use Propel\Generator\Model\Table;
+use Propel\Generator\Model\Unique;
use Propel\Generator\Model\PropelTypes;
use Propel\Generator\Model\ColumnDefaultValue; | [Generator] [Reverse] Added missing use statements | propelorm_Propel2 | train | php |
e994243978088fa0c83618f7ee4b84890f254cc9 | diff --git a/lib/deep_cover/custom_requirer.rb b/lib/deep_cover/custom_requirer.rb
index <HASH>..<HASH> 100644
--- a/lib/deep_cover/custom_requirer.rb
+++ b/lib/deep_cover/custom_requirer.rb
@@ -133,11 +133,14 @@ module DeepCover
found_path = resolve_path(path)
- DeepCover.autoload_tracker.wrap_require(path, found_path) do
- return yield(:not_found) unless found_path
-
+ if found_path
return false if @loaded_features.include?(found_path)
return false if @paths_being_required.include?(found_path)
+ end
+
+ DeepCover.autoload_tracker.wrap_require(path, found_path) do
+ # Either a problem with resolve_path, or a gem that will be added to the load_path by RubyGems
+ return yield(:not_found) unless found_path
begin
@paths_being_required.add(found_path) | Avoid wrap_require for already loaded paths | deep-cover_deep-cover | train | rb |
5e9bf5cfb5196a8b20b395e7ed6659e5a1bad3cc | diff --git a/ghost/release-utils/lib/releases.js b/ghost/release-utils/lib/releases.js
index <HASH>..<HASH> 100644
--- a/ghost/release-utils/lib/releases.js
+++ b/ghost/release-utils/lib/releases.js
@@ -108,6 +108,7 @@ module.exports.uploadZip = (options = {}) => {
return new Promise((resolve, reject) => {
fs.createReadStream(options.zipPath)
+ .on('error', reject)
.pipe(request.post(reqOptions, (err, res) => {
if (err) {
return reject(err); | Added error handling to filestream
This would have probably rejected the promise anyway because uncaught
error, but it's better to be explicit | TryGhost_Ghost | train | js |
752e77df4533c6f9483a084d3fe87dbfc33c1e01 | diff --git a/www/src/Lib/turtle.py b/www/src/Lib/turtle.py
index <HASH>..<HASH> 100644
--- a/www/src/Lib/turtle.py
+++ b/www/src/Lib/turtle.py
@@ -241,7 +241,7 @@ class TurtleScreenBase:
_turtle = _svg.polygon(points=" ".join(_shape),
transform="rotate(%s)" % (lineitem.heading() - 90),
style={'stroke': fill, 'fill': fill,
- 'stroke-width': width, 'display': 'none'})
+ 'stroke-width': 1, 'display': 'none'})
_turtle <= _svg.animateMotion(From="%s,%s" % (_x0*self.xscale, _y0*self.yscale),
to="%s,%s" % (_x1*self.xscale, _y1*self.yscale), | fixed sub-issue <I> of issue #<I>: turtle drawing is drawn the same regardless of width setting | brython-dev_brython | train | py |
4e8a015d25bc6f5f8a29a9b6be354b3b096dd6b6 | diff --git a/basiccache.gemspec b/basiccache.gemspec
index <HASH>..<HASH> 100644
--- a/basiccache.gemspec
+++ b/basiccache.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'basiccache'
- s.version = '0.2.1'
+ s.version = '0.2.2'
s.date = Time.now.strftime("%Y-%m-%d")
s.summary = 'Provides a minimal key/value caching layer'
s.description = "Allows an application to dynamically cache values and retrieve them later"
diff --git a/lib/basiccache/stores/nullstore.rb b/lib/basiccache/stores/nullstore.rb
index <HASH>..<HASH> 100644
--- a/lib/basiccache/stores/nullstore.rb
+++ b/lib/basiccache/stores/nullstore.rb
@@ -7,7 +7,7 @@ module BasicCache
##
# Generate an empty store
- def initialize
+ def initialize(_ = {})
@raw = nil
end
diff --git a/lib/basiccache/stores/store.rb b/lib/basiccache/stores/store.rb
index <HASH>..<HASH> 100644
--- a/lib/basiccache/stores/store.rb
+++ b/lib/basiccache/stores/store.rb
@@ -7,7 +7,7 @@ module BasicCache
##
# Generate an empty store
- def initialize
+ def initialize(_ = {})
@raw = {}
end | standardize that stores accept a hash | akerl_basiccache | train | gemspec,rb,rb |
127d0480b26011fa9672e3f5340d035917e4cdf0 | diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -31,7 +31,7 @@ module.exports = {
devtool: BUILD ? false : 'source-map',
plugins: BUILD ? [
new webpack.optimize.UglifyJsPlugin({compress: {warnings: true}}),
- new webpack.BannerPlugin({raw: true,
- banner: `/*! ${PKG.title || PKG.name} v${PKG.version} (c) ${PKG.author.name} ${PKG.homepage} */`})
+ new webpack.BannerPlugin(
+ `${PKG.title || PKG.name} v${PKG.version} (c) ${PKG.author.name} ${PKG.homepage}`)
] : []
}; | Change option for webpack.BannerPlugin | anseki_cssprefix | train | js |
fd1b165407f105d9cdaeac8d9661e4c4b786acf9 | diff --git a/lib/CharacteristicDelegate.js b/lib/CharacteristicDelegate.js
index <HASH>..<HASH> 100644
--- a/lib/CharacteristicDelegate.js
+++ b/lib/CharacteristicDelegate.js
@@ -208,7 +208,7 @@ class CharacteristicDelegate extends homebridgeLib.Delegate {
)
if (value !== this.value) {
this._serviceDelegate._context[this._key] = value
- this.emit('didSet', value)
+ this.emit('didSet', value, false)
}
callback(null, value)
} catch (error) { | Update CharacteristicDelegate.js
Bug fix: missing `fromHomeKit` parameneter to `didSet` event. | ebaauw_homebridge-lib | train | js |
dc702fbc2d577c3fc45564f38144eb0ce20e4b8c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ setup(name='dotenv',
description='Handle .env files',
author='Pedro Burón',
author_email='pedro@witoi.com',
- url='http://witoi.github.com',
+ url='https://github.com/pedroburon/dotenv',
test_suite='nose.collector',
packages=['dotenv'],
tests_require=['nose'], | setup.py: Update url | pedroburon_dotenv | train | py |
5d5648122eea3203e2477cabb896d39c2e92cb54 | diff --git a/lib/quorum.rb b/lib/quorum.rb
index <HASH>..<HASH> 100644
--- a/lib/quorum.rb
+++ b/lib/quorum.rb
@@ -1,6 +1,7 @@
require "quorum/engine"
require "quorum/helpers"
require "quorum/sequence"
+require "quorum/version"
require "resque"
require "resque/server"
require "resque-result" | Added require quorum version. | ncgr_quorum | train | rb |
64dedc099752703c652e72fcbef194fb67064169 | diff --git a/salt/utils/http.py b/salt/utils/http.py
index <HASH>..<HASH> 100644
--- a/salt/utils/http.py
+++ b/salt/utils/http.py
@@ -170,6 +170,7 @@ def query(url,
data_file, data_render, data_renderer, template_dict, opts
)
+ log.debug('Using {0} Method'.format(method))
if method == 'POST':
log.trace('POST Data: {0}'.format(pprint.pformat(data)))
@@ -272,7 +273,6 @@ def query(url,
log.error('The client-side certificate path that was passed is '
'not valid: {0}'.format(cert))
- log.debug('data type {0}'.format(type(data)))
result = sess.request(
method, url, params=params, data=data, **req_kwargs
)
@@ -281,7 +281,6 @@ def query(url,
return {'handle': result}
log.debug(result.url)
- log.debug(result.request.__dict__)
log.trace(data)
result_status_code = result.status_code | Removing unneeded logging statements. Adding log statement that was mistakenly removed. | saltstack_salt | train | py |
bfd17015b74f32c2bb2f769d75235bb2e97209ec | diff --git a/test/k8sT/Tunnels.go b/test/k8sT/Tunnels.go
index <HASH>..<HASH> 100644
--- a/test/k8sT/Tunnels.go
+++ b/test/k8sT/Tunnels.go
@@ -39,7 +39,6 @@ var _ = Describe("K8sValidatedTunnelTest", func() {
demoDSPath = helpers.ManifestGet("demo_ds.yaml")
kubectl.Exec("kubectl -n kube-system delete ds cilium")
- // Expect(res.Correct()).Should(BeTrue())
waitToDeleteCilium(kubectl, logger)
})
@@ -50,10 +49,7 @@ var _ = Describe("K8sValidatedTunnelTest", func() {
})
AfterEach(func() {
- _ = kubectl.Delete(demoDSPath)
- })
-
- AfterAll(func() {
+ kubectl.Delete(demoDSPath)
ExpectAllPodsTerminated(kubectl)
}) | Test: K8s/Tunnels wait until all pods terminate
Have seen in a PR that the pods are deleted on the `AfterEach` but never
wait until it was terminated, the next test started installing the pods
and it was still present.
With this change test waits until all pods are being termintated
correctly. | cilium_cilium | train | go |
9afb96bf16dbe24ab9a58e39633f78315b9a5213 | diff --git a/extensions/gedit3-plugin/shoebotit/__init__.py b/extensions/gedit3-plugin/shoebotit/__init__.py
index <HASH>..<HASH> 100644
--- a/extensions/gedit3-plugin/shoebotit/__init__.py
+++ b/extensions/gedit3-plugin/shoebotit/__init__.py
@@ -101,8 +101,6 @@ class ShoebotThread(threading.Thread):
try:
if proc.returncode != 0:
panel.set_property("visible", True)
- else:
- textbuffer.insert(textbuffer.get_end_iter(), "Shoebot finished.")
except Exception, e:
textbuffer.insert(textbuffer.get_end_iter(), str(e))
@@ -288,8 +286,11 @@ class ShoebotPlugin(GObject.Object, Gedit.WindowActivatable):
image = Gtk.Image()
image.set_from_stock(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON)
+ scrolled_window = Gtk.ScrolledWindow()
+ scrolled_window.add(self.text)
+ scrolled_window.show_all()
- self.panel.add_item(self.text, 'Shoebot', 'Shoebot', image)
+ self.panel.add_item(scrolled_window, 'Shoebot', 'Shoebot', image)
self.instances[self.window] = ShoebotWindowHelper(self, self.window) | Gedit plugin output gains scrollbars. | shoebot_shoebot | train | py |
8c138933b262f09c43cba57ce64010d877d7d203 | diff --git a/lib/scorpio/model.rb b/lib/scorpio/model.rb
index <HASH>..<HASH> 100644
--- a/lib/scorpio/model.rb
+++ b/lib/scorpio/model.rb
@@ -206,7 +206,7 @@ module Scorpio
end ||
schema['additionalProperties']
{key => response_object_to_instances(value, schema_for_value)}
- end.inject({}, &:update)
+ end.inject(object.class.new, &:update)
elsif schema['type'] == 'array' && MODULES_FOR_JSON_SCHEMA_TYPES['array'].any? { |m| object.is_a?(m) }
object.map do |element|
response_object_to_instances(element, schema['items']) | m fixes for response_object_to_instances with object schema | notEthan_jsi | train | rb |
1ca0b7ddb74bf4ae640372e64bea8f2ec90ae26b | diff --git a/konch.py b/konch.py
index <HASH>..<HASH> 100644
--- a/konch.py
+++ b/konch.py
@@ -356,10 +356,18 @@ def use_file(filename):
logger.info('Using {0}'.format(config_file))
# Ensure that relative imports are possible
__ensure_directory_in_path(config_file)
+ mod = None
try:
- return imp.load_source('konchrc', config_file)
+ mod = imp.load_source('konchrc', config_file)
except UnboundLocalError: # File not found
pass
+ else:
+ try:
+ # Clean up bytecode file on PY2
+ os.remove(config_file + 'c')
+ except FileNotFoundError:
+ pass
+ return mod
if not config_file:
warnings.warn('No config file found.')
else: | Clean up bytecode file on PY2 | sloria_konch | train | py |
b0328d37e8a4aeb50aa7ed848f1070a98535262c | diff --git a/src/filesystem/impls/appshell/AppshellFileSystem.js b/src/filesystem/impls/appshell/AppshellFileSystem.js
index <HASH>..<HASH> 100644
--- a/src/filesystem/impls/appshell/AppshellFileSystem.js
+++ b/src/filesystem/impls/appshell/AppshellFileSystem.js
@@ -35,6 +35,9 @@ define(function (require, exports, module) {
var FILE_WATCHER_BATCH_TIMEOUT = 200; // 200ms - granularity of file watcher changes
+ /** exclude .git files from warnings as they appear and disappear very quickly and pollute the console */
+ var warningBlacklist = /\/\.git\//;
+
/**
* Callback to notify FileSystem of watcher changes
* @type {?function(string, FileSystemStats=)}
@@ -91,7 +94,9 @@ define(function (require, exports, module) {
if (needsStats) {
exports.stat(path, function (err, stats) {
if (err) {
- console.warn("Unable to stat changed path: ", path, err);
+ if (!warningBlacklist.test(path)) {
+ console.warn("Unable to stat changed path: ", path, err);
+ }
return;
}
_changeCallback(path, stats); | Exclude .git files from console warnings | adobe_brackets | train | js |
2c7195f510a552ff0a6253a3650f58a5a4794faa | diff --git a/escpos/impl/epson.py b/escpos/impl/epson.py
index <HASH>..<HASH> 100644
--- a/escpos/impl/epson.py
+++ b/escpos/impl/epson.py
@@ -178,6 +178,17 @@ class GenericESCPOS(object):
self.device.write('\x1B\x61\x02')
+ def set_code_page(self, code_page):
+ """Set code page for character printing. This can be used in combination
+ with bytearray to convert encoding. For example:
+
+ for char in bytearray(unicode_text, 'cp1251'):
+ printer.device.write(chr(char))
+ """
+ assert code_page >= 0 and code_page <= 255
+ self.device.write('\x1B\x74' + chr(code_page))
+
+
def set_text_size(self, width, height):
if (0 <= width <= 7) and (0 <= height <= 7):
size = 16 * width + height | Base: Implemented code page setting. | base4sistemas_pyescpos | train | py |
395c0ada44a1ceeaca2bcf2696c79c6dd4834a5b | diff --git a/src/TestBootstrap.php b/src/TestBootstrap.php
index <HASH>..<HASH> 100644
--- a/src/TestBootstrap.php
+++ b/src/TestBootstrap.php
@@ -1,7 +1,5 @@
<?php
-require_once 'App.php';
-
use infuse\Util;
use app\search\libs\SearchableModel; | do not require app in test bootstrap | infusephp_infuse | train | php |
25d3c12933017c47c9d63de939b559846b23fca5 | diff --git a/oauthlib/__init__.py b/oauthlib/__init__.py
index <HASH>..<HASH> 100644
--- a/oauthlib/__init__.py
+++ b/oauthlib/__init__.py
@@ -10,7 +10,7 @@
"""
__author__ = 'Idan Gazit <idan@gazit.me>'
-__version__ = '1.1.0'
+__version__ = '1.1.1'
import logging | Bumped version to <I>. | oauthlib_oauthlib | train | py |
d247cead09e6b9050e7a138582ade4628a58fc5f | diff --git a/src/Psalm/Checker/StatementsChecker.php b/src/Psalm/Checker/StatementsChecker.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Checker/StatementsChecker.php
+++ b/src/Psalm/Checker/StatementsChecker.php
@@ -1795,7 +1795,7 @@ class StatementsChecker
// Hack has a similar issue: https://github.com/facebook/hhvm/issues/5164
if ($lhs_type_part->isObject() || in_array(strtolower($lhs_type_part->value), ['stdclass', 'simplexmlelement', 'dateinterval', 'domdocument', 'domnode'])) {
$context->vars_in_scope[$var_id] = Type::getMixed();
- continue;
+ return;
}
if (self::isMock($lhs_type_part->value)) { | Exit properly when encountering classes we cannot deal with | vimeo_psalm | train | php |
7db9e613dd6fd31b32c3daabb149f3c12c623ec5 | diff --git a/hadoopy/__init__.py b/hadoopy/__init__.py
index <HASH>..<HASH> 100644
--- a/hadoopy/__init__.py
+++ b/hadoopy/__init__.py
@@ -24,3 +24,4 @@ from _reporter import status, counter
from _test import Test
import _typedbytes as typedbytes
import _main
+from _main import GroupedValues | Made the value iterator public as the user gets an instance in the reducer | bwhite_hadoopy | train | py |
00fec00ac927911563286621dac76be352f2bc52 | diff --git a/lib/fast_find.rb b/lib/fast_find.rb
index <HASH>..<HASH> 100644
--- a/lib/fast_find.rb
+++ b/lib/fast_find.rb
@@ -99,7 +99,7 @@ module FastFind
[path, path.encoding]
end
- def one_shot?() !!@one_shot end
+ def one_shot?() @one_shot end
def yield_entry(entry, block)
if block.arity == 2 | I really don't care if this is actually a Boolean. | Freaky_fast_find | train | rb |
ec7dc171f7d46359c4eee1ad283d368373b5c7e4 | diff --git a/src/combinators/delay.js b/src/combinators/delay.js
index <HASH>..<HASH> 100644
--- a/src/combinators/delay.js
+++ b/src/combinators/delay.js
@@ -71,9 +71,12 @@ export const debounce = curry((n, s) => {
emit.complete()
}
- s.subscribe({ ...emit, next, complete })
+ const subscription = s.subscribe({ ...emit, next, complete })
- return () => clearTimeout(id)
+ return () => {
+ clearTimeout(id)
+ subscription.unsubscribe()
+ }
})
})
diff --git a/src/combinators/delay.test.js b/src/combinators/delay.test.js
index <HASH>..<HASH> 100644
--- a/src/combinators/delay.test.js
+++ b/src/combinators/delay.test.js
@@ -78,6 +78,16 @@ describe('delay', () => {
debounce(1000)(s).subscribe({ error: errorSpy })
expect(errorSpy).toHaveBeenCalledTimes(1)
})
+
+ it('unmounts the original signal when it is unsubscribed', () => {
+ const unmount = jest.fn()
+ const s = new Signal(() => unmount)
+ const a = debounce(1000)(s).subscribe()
+
+ a.unsubscribe()
+
+ expect(unmount).toHaveBeenCalledTimes(1)
+ })
})
describe('#throttle', () => { | Fix issue where debounced signals weren't unmounted properly | nullobject_bulb | train | js,js |
3a6d80b37a0e9c2ebc967bb7afb66c3cf7d7c7c3 | diff --git a/mackup/appsdb.py b/mackup/appsdb.py
index <HASH>..<HASH> 100644
--- a/mackup/appsdb.py
+++ b/mackup/appsdb.py
@@ -98,7 +98,7 @@ class ApplicationsDatabase(object):
name (str)
Returns:
- set(str)
+ set of str.
"""
return self.apps[name]['configuration_files']
@@ -107,7 +107,7 @@ class ApplicationsDatabase(object):
Return the list of application names that are available in the database
Returns:
- set of str
+ set of str.
"""
app_names = set()
for name in self.apps:
@@ -120,10 +120,10 @@ class ApplicationsDatabase(object):
Return the list of pretty app names that are available in the database
Returns:
- list(str)
+ set of str.
"""
- pretty_app_names = []
+ pretty_app_names = set()
for app_name in self.get_app_names():
- pretty_app_names.append(self.get_name(app_name))
+ pretty_app_names.add(self.get_name(app_name))
return pretty_app_names | Let's use a set here too | lra_mackup | train | py |
71e38b128e6b54589e531b02b3d8face26c1aab6 | diff --git a/files/tests/externallib_test.php b/files/tests/externallib_test.php
index <HASH>..<HASH> 100644
--- a/files/tests/externallib_test.php
+++ b/files/tests/externallib_test.php
@@ -147,4 +147,27 @@ class test_external_files extends advanced_testcase {
$filename, $filecontent, $contextlevel, $instanceid);
}
+ /*
+ * Make sure core_files_external::upload() works without new parameters.
+ */
+ public function test_upload_without_new_param() {
+ global $USER;
+
+ $this->resetAfterTest();
+ $this->setAdminUser();
+ $context = context_user::instance($USER->id);
+ $contextid = $context->id;
+ $component = "user";
+ $filearea = "private";
+ $itemid = 0;
+ $filepath = "/";
+ $filename = "Simple4.txt";
+ $filecontent = base64_encode("Let us create a nice simple file");
+
+ // Make sure the file is created.
+ @core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath, $filename, $filecontent);
+ $browser = get_file_browser();
+ $file = $browser->get_file_info($context, $component, $filearea, $itemid, $filepath, $filename);
+ $this->assertNotEmpty($file);
+ }
}
\ No newline at end of file | MDL-<I> phpunit: Test core_files_external::upload() without the new params | moodle_moodle | train | php |
3e646799a18aa87924c6654d052f41022e452c78 | diff --git a/superset/datasets/commands/create.py b/superset/datasets/commands/create.py
index <HASH>..<HASH> 100644
--- a/superset/datasets/commands/create.py
+++ b/superset/datasets/commands/create.py
@@ -61,7 +61,7 @@ class CreateDatasetCommand(BaseCommand):
)
db.session.commit()
except (SQLAlchemyError, DAOCreateFailedError) as ex:
- logger.exception(ex)
+ logger.warning(ex, exc_info=True)
db.session.rollback()
raise DatasetCreateFailedError()
return dataset | fix(datasets): log create exceptions as warning (#<I>) | apache_incubator-superset | train | py |
7de16b1a397aac4327cf80faea839a87a3999eef | diff --git a/api/response.go b/api/response.go
index <HASH>..<HASH> 100644
--- a/api/response.go
+++ b/api/response.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/Sirupsen/logrus"
+ "runtime/debug"
"strings"
)
@@ -68,6 +69,9 @@ func ResponseLogAndError(v interface{}) {
} else if e, ok := v.(error); ok {
logrus.Errorf(fmt.Sprint(e))
ResponseError(fmt.Sprint(e))
+ } else {
+ logrus.Fatalf("%s: %s", v, debug.Stack())
+ ResponseError("Caught FATAL error: %s", v)
}
} | Expose system error from go
It was covered by accident before. | rancher_convoy | train | go |
ff77811fb6f668bd9988abc4951ae0c105aca3d3 | diff --git a/pkg/sti/docker/docker.go b/pkg/sti/docker/docker.go
index <HASH>..<HASH> 100644
--- a/pkg/sti/docker/docker.go
+++ b/pkg/sti/docker/docker.go
@@ -99,6 +99,7 @@ func (d *stiDocker) IsImageInLocalRegistry(imageName string) (bool, error) {
func (d *stiDocker) CheckAndPull(imageName string) (image *docker.Image, err error) {
if image, err = d.client.InspectImage(imageName); err != nil &&
err != docker.ErrNoSuchImage {
+ log.Printf("Error: Unable to get image metadata for %s: %v", imageName, err)
return nil, errors.ErrPullImageFailed
} | print image name on failure to get scripts | openshift_source-to-image | train | go |
05d9b23ec78a21cab74f34141f2e3fe0bea2ada2 | diff --git a/functions/timber-menu.php b/functions/timber-menu.php
index <HASH>..<HASH> 100644
--- a/functions/timber-menu.php
+++ b/functions/timber-menu.php
@@ -38,16 +38,18 @@ class TimberMenu extends TimberCore {
*/
private function init($menu_id) {
$menu = wp_get_nav_menu_items($menu_id);
- _wp_menu_item_classes_by_context($menu);
- if (is_array($menu)){
- $menu = self::order_children($menu);
+ if ($menu) {
+ _wp_menu_item_classes_by_context($menu);
+ if (is_array($menu)){
+ $menu = self::order_children($menu);
+ }
+ $this->items = $menu;
+ $menu_info = wp_get_nav_menu_object($menu_id);
+ $this->import($menu_info);
+ $this->ID = $this->term_id;
+ $this->id = $this->term_id;
+ $this->title = $this->name;
}
- $this->items = $menu;
- $menu_info = wp_get_nav_menu_object($menu_id);
- $this->import($menu_info);
- $this->ID = $this->term_id;
- $this->id = $this->term_id;
- $this->title = $this->name;
}
/** | added a sanity check so that we don't send blank menus to WP for processing | timber_timber | train | php |
31b5250751ac0f0ad288c1794eee3574a841ecc9 | diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js
index <HASH>..<HASH> 100644
--- a/src/nls/root/strings.js
+++ b/src/nls/root/strings.js
@@ -852,7 +852,6 @@ define({
"WARNING_TYPE" : "Warning!",
"CLICK_RESTART_TO_UPDATE" : "Click Restart to update Brackets.",
"UPDATE_ON_NEXT_LAUNCH" : "The update will be applied on relaunch.",
- "VALIDATE_EXTENSIONS" : "Please validate all your extensions.",
"GO_TO_SITE" : "Go to <a href = \"http://brackets.io/\"> brackets.io </a> to retry.",
"INTERNET_UNAVAILABLE" : "No Internet connection available.",
"UPDATEDIR_READ_FAILED" : "Update directory could not be read.",
@@ -863,6 +862,8 @@ define({
"CHECKSUM_DID_NOT_MATCH" : "Checksum didn't match.",
"INSTALLER_NOT_FOUND" : "Installer not found.",
"DOWNLOAD_ERROR" : "Error occurred while downloading.",
+ "RESTART_BUTTON" : "Restart",
+ "LATER_BUTTON" : "Later",
// Strings for Related Files
"CMD_FIND_RELATED_FILES" : "Find Related Files" | Adding remaining strings for Auto Update feature (#<I>)
* Adding strings for AutoUpdate and Related Files features
* Addressing spacing issues
* Normalizing whitespaces with spaces:4
Normalizing whitespaces with spaces:4
* Adding remaining strings for AutoUpdate feature
* Removing unused string | adobe_brackets | train | js |
4642833facc4dadf696256339e056f91b80e3e7a | diff --git a/androguard/core/analysis/analysis.py b/androguard/core/analysis/analysis.py
index <HASH>..<HASH> 100644
--- a/androguard/core/analysis/analysis.py
+++ b/androguard/core/analysis/analysis.py
@@ -17,7 +17,8 @@
import re, random, cPickle
-from androguard.core.androconf import error, warning, debug, is_ascii_problem
+from androguard.core.androconf import error, warning, debug, is_ascii_problem,\
+ load_api_specific_resource_module
from androguard.core.bytecodes import dvm
from androguard.core.bytecodes.api_permissions import DVM_PERMISSIONS_BY_PERMISSION, DVM_PERMISSIONS_BY_ELEMENT
@@ -945,6 +946,9 @@ class TaintedPackages(object):
self.__vm = _vm
self.__packages = {}
self.__methods = {}
+
+ self.AOSP_PERMISSIONS_MODULE = load_api_specific_resource_module("aosp_permissions", self.__vm.get_api_version())
+ self.API_PERMISSION_MAPPINGS_MODULE = load_api_specific_resource_module("api_permission_mappings", self.__vm.get_api_version())
def _add_pkg(self, name):
if name not in self.__packages: | Added functionality to load api specific resources to TaintedPackages | androguard_androguard | train | py |
6de804c0c6df3483d3a8e9b75c9409f66970d0d9 | diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -23,7 +23,7 @@ class Client
*/
private $options = array(
'base_url' => 'https://secure.eloqua.com/API/REST',
- 'version' => '1.0',
+ 'version' => '2.0',
'user_agent' => 'Elomentary (http://github.com/tableau-mkt/elomentary)',
'timeout' => 10,
'count' => 100,
diff --git a/src/HttpClient/HttpClient.php b/src/HttpClient/HttpClient.php
index <HASH>..<HASH> 100644
--- a/src/HttpClient/HttpClient.php
+++ b/src/HttpClient/HttpClient.php
@@ -23,7 +23,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class HttpClient implements HttpClientInterface {
protected $options = array(
'base_url' => 'https://secure.eloqua.com/API/REST',
- 'version' => '1.0',
+ 'version' => '2.0',
'user_agent' => 'Elomentary (http://github.com/tableau-mkt/elomentary)',
'timeout' => 10,
'count' => 100, | Default to the <I> REST API. | tableau-mkt_elomentary | train | php,php |
33b2afe15a45094dd0539d80d778dd1afc4938bc | diff --git a/lib/attrtastic/semantic_attributes_builder.rb b/lib/attrtastic/semantic_attributes_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/attrtastic/semantic_attributes_builder.rb
+++ b/lib/attrtastic/semantic_attributes_builder.rb
@@ -193,7 +193,7 @@ module Attrtastic
value_options[:html][:class] = [ options[:html][:class], value.class.to_s.underscore ].compact.join(" ")
attributes_for(value, args, options, &block)
- end.join
+ end.join.html_safe
end
end
diff --git a/lib/attrtastic/version.rb b/lib/attrtastic/version.rb
index <HASH>..<HASH> 100644
--- a/lib/attrtastic/version.rb
+++ b/lib/attrtastic/version.rb
@@ -1,3 +1,3 @@
module Attrtastic
- VERSION = "0.3.1"
+ VERSION = "0.3.2"
end | Fix problem with attributes :for and not safe join on attributes | MBO_attrtastic | train | rb,rb |
5d29ab1d428c6ea96d89093b32a75b54c18ed642 | diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js
index <HASH>..<HASH> 100644
--- a/cmd/cmd_controller.js
+++ b/cmd/cmd_controller.js
@@ -14,7 +14,7 @@ class EmbarkController {
// set a default context. should be overwritten by an action
// method before being used
- this.context = [constants.contexts.any];
+ this.context = {};
}
initConfig(env, options) {
diff --git a/embark-ui/src/reducers/selectors.js b/embark-ui/src/reducers/selectors.js
index <HASH>..<HASH> 100644
--- a/embark-ui/src/reducers/selectors.js
+++ b/embark-ui/src/reducers/selectors.js
@@ -53,7 +53,6 @@ export function getProcesses(state) {
}
export function getProcessLogs(state) {
- if(!state.entities.processLogs.length) return [];
const processLogsObj = state.entities.processLogs.reduce((processLogs, processLog) => {
const existingProcessLog = processLogs[processLog.process];
if(!existingProcessLog || processLog.timestamp > existingProcessLog.timestamp){ | Minor PR comments
Removed a null check and intialised `this.context` to an empty object. | embark-framework_embark | train | js,js |
6e1dc3c288ad895534e3770d02a8ce8d54a7b69f | diff --git a/lib/wavefile/chunk_readers/smpl_chunk_reader.rb b/lib/wavefile/chunk_readers/smpl_chunk_reader.rb
index <HASH>..<HASH> 100644
--- a/lib/wavefile/chunk_readers/smpl_chunk_reader.rb
+++ b/lib/wavefile/chunk_readers/smpl_chunk_reader.rb
@@ -93,13 +93,13 @@ module WaveFile
def loop_type(loop_type_id)
case loop_type_id
when 0
- 'Forward'
+ :forward
when 1
- 'Alternating'
+ :alternating
when 2
- 'Backward'
+ :backward
else
- 'Unknown'
+ :unknown
end
end | Using symbols instead of strings, to match style of rest of code | jstrait_wavefile | train | rb |
b3c155430965280ab59b1dd70c020c6da3396fc9 | diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -87,6 +87,10 @@ class Puppet::Parser::Scope
@compiler.node.name
end
+ def include?(name)
+ self[name] != :undefined
+ end
+
# Is the value true? This allows us to control the definition of truth
# in one place.
def self.true?(value)
diff --git a/spec/unit/parser/scope_spec.rb b/spec/unit/parser/scope_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/parser/scope_spec.rb
+++ b/spec/unit/parser/scope_spec.rb
@@ -113,6 +113,15 @@ describe Puppet::Parser::Scope do
@scope["var"].should == "childval"
end
+ it "should be able to detect when variables are set" do
+ @scope["var"] = "childval"
+ @scope.should be_include("var")
+ end
+
+ it "should be able to detect when variables are not set" do
+ @scope.should_not be_include("var")
+ end
+
describe "and the variable is qualified" do
before do
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("foonode")) | Adding Scope#include? method
This is primarily for Hiera/DataLibrary support,
but is a decent idea regardless. | puppetlabs_puppet | train | rb,rb |
9778dae374b10a825b8e500e36958b92a6b4e9ad | diff --git a/index.php b/index.php
index <HASH>..<HASH> 100644
--- a/index.php
+++ b/index.php
@@ -88,6 +88,9 @@
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
+ //TODO: remove this notice once admins know they need to switch CVS and git branches, the reason is once we start changing DB there will not be any way back!
+ echo $OUTPUT->box('WARNING: this site is using 2.1dev codebase, please make sure this is is not a production server!!!', 'errorbox');
+
/// Print Section
if ($SITE->numsections > 0) { | MDL-<I> make sure admins do not upgrade to <I>dev accidentally
We already have the new maturity warning in the upgrade page but we are not changing versions yet, we should better give admins one extra chance to go back to latest <I>+ stable. | moodle_moodle | train | php |
45dae8cee7edbb493e4408a0462206fe31a0a392 | diff --git a/config/bugsnag.php b/config/bugsnag.php
index <HASH>..<HASH> 100644
--- a/config/bugsnag.php
+++ b/config/bugsnag.php
@@ -46,8 +46,8 @@ return [
| Set to true to send the errors through to Bugsnag when the PHP process
| shuts down, in order to prevent your app waiting on HTTP requests.
|
- | Setting this to false will mean the we send an HTTP request straight away
- | for each error.
+ | Setting this to false will send an HTTP request straight away for each
+ | error.
|
*/ | Documentation update regarding the 'Batch Sending' option (#<I>) | bugsnag_bugsnag-laravel | train | php |
41dddd5fd7109799876c766443219e53377f94e5 | diff --git a/src/components/user-profile-personal-settings-subform/user-profile-personal-settings-subform.js b/src/components/user-profile-personal-settings-subform/user-profile-personal-settings-subform.js
index <HASH>..<HASH> 100644
--- a/src/components/user-profile-personal-settings-subform/user-profile-personal-settings-subform.js
+++ b/src/components/user-profile-personal-settings-subform/user-profile-personal-settings-subform.js
@@ -37,12 +37,12 @@ export const timeZonesToOptions = defaultMemoize(timeZones =>
*/
export const mapLocalesToOptions = defaultMemoize(locales =>
Object.entries(locales)
- .filter(([code]) => code.startsWith('en') || code.startsWith('de'))
- .map(([code, value]) => ({
- value: code,
+ .filter(([locale]) => locale.startsWith('en') || locale.startsWith('de'))
+ .map(([locale, value]) => ({
+ value: locale,
label: value.country
- ? `${value.language} (${value.country}) (${code})`
- : `${value.language} (${code})`,
+ ? `${value.language} (${value.country}) (${locale})`
+ : `${value.language} (${locale})`,
}))
); | refactor(user-profile): rename code to locale to be more descriptive | commercetools_merchant-center-application-kit | train | js |
15b2e8e12a67c70474bf8631df2e98287ef39612 | diff --git a/nbdiff/notebook_diff.py b/nbdiff/notebook_diff.py
index <HASH>..<HASH> 100644
--- a/nbdiff/notebook_diff.py
+++ b/nbdiff/notebook_diff.py
@@ -11,9 +11,7 @@ def notebook_diff(nb1, nb2):
cell_list = list()
for item in diffed_nb:
- state = item['state']
- cell = copy.deepcopy(diff_result_to_cell(item))
- cell['metadata']['state'] = state
+ cell = diff_result_to_cell(item)
cell_list.append(cell)
nb1['worksheets'][0]['cells'] = cell_list | Some small changes to notebook_diff.py | tarmstrong_nbdiff | train | py |
f57b0751bb02b3e0b33e7510f2f7e9495efb2f50 | diff --git a/word2vec/wordvectors.py b/word2vec/wordvectors.py
index <HASH>..<HASH> 100644
--- a/word2vec/wordvectors.py
+++ b/word2vec/wordvectors.py
@@ -41,6 +41,21 @@ class WordVectors(object):
"""
return self.vocab_hash[word]
+ def word(self, ix):
+ """Returns the word that corresponds to the index.
+
+ Parameters
+ -------
+ ix : int
+ The index of the word
+
+ Returns
+ -------
+ str
+ The word that corresponds to the index
+ """
+ return self.vocab[ix]
+
def __getitem__(self, word):
return self.get_vector(word)
@@ -54,6 +69,22 @@ class WordVectors(object):
idx = self.ix(word)
return self.vectors[idx]
+ def get_word(self, vector):
+ """Returns the word according to the vector
+
+ Parameters
+ -------
+ vector : numpy.core.multiarray.array
+ The representing vector of the word
+
+ Returns
+ -------
+ str or None
+ The word according to the specified vector if found, else None
+ """
+ word_index = np.where(np.all(self.vectors == vector, axis=1))[0]
+ return self.word(word_index[0]) if word_index.size else None
+
def cosine(self, word, n=10):
"""
Cosine similarity. | Added methods for retrieving words according to index and input vector. (#<I>)
* Added methods for retrieving words according to index and input vector.
* Reformatted comments according to numpy style. | danielfrg_word2vec | train | py |
1936e2517f4148579640dd41395662bb806829b2 | diff --git a/scrapelib/tests/test_cache.py b/scrapelib/tests/test_cache.py
index <HASH>..<HASH> 100644
--- a/scrapelib/tests/test_cache.py
+++ b/scrapelib/tests/test_cache.py
@@ -1,4 +1,4 @@
-from nose.tools import assert_equal, assert_in, assert_is_none
+from nose.tools import assert_equal, assert_true, assert_is_none
import requests
from ..cache import CachingSession, MemoryCache, FileCache
@@ -52,7 +52,7 @@ def test_simple_cache_request():
resp = cs.request('get', url)
assert_equal(resp.fromcache, False)
- assert_in(url, cs.cache_storage.cache)
+ assert_true(url in cs.cache_storage.cache)
# second response comes from cache
cached_resp = cs.request('get', url) | Py<I> doesn't have assert_in? | jamesturk_scrapelib | train | py |
04ac9d5b1ff31d7c16ead43c2909f0535ec72824 | diff --git a/index/scorch/persister.go b/index/scorch/persister.go
index <HASH>..<HASH> 100644
--- a/index/scorch/persister.go
+++ b/index/scorch/persister.go
@@ -450,20 +450,23 @@ func (s *Scorch) removeOldBoltSnapshots() (numRemoved int, err error) {
}
defer func() {
if err == nil {
- err = s.rootBolt.Sync()
- }
- }()
- defer func() {
- if err == nil {
err = tx.Commit()
} else {
_ = tx.Rollback()
}
+ if err == nil {
+ err = s.rootBolt.Sync()
+ }
}()
+ snapshots := tx.Bucket(boltSnapshotsBucket)
+ if snapshots == nil {
+ return 0, nil
+ }
+
for _, epochToRemove := range epochsToRemove {
k := segment.EncodeUvarintAscending(nil, epochToRemove)
- err = tx.DeleteBucket(k)
+ err = snapshots.DeleteBucket(k)
if err == bolt.ErrBucketNotFound {
err = nil
} | scorch removeOldBoltSnapshots() deletes from correct bucket | blevesearch_bleve | train | go |
3407dcd223d35f219854f30db9181caaae2065d6 | diff --git a/kie-internal/src/main/java/org/kie/internal/command/ExtendedKieCommands.java b/kie-internal/src/main/java/org/kie/internal/command/ExtendedKieCommands.java
index <HASH>..<HASH> 100644
--- a/kie-internal/src/main/java/org/kie/internal/command/ExtendedKieCommands.java
+++ b/kie-internal/src/main/java/org/kie/internal/command/ExtendedKieCommands.java
@@ -9,4 +9,11 @@ public interface ExtendedKieCommands extends KieCommands {
public Command newEnableAuditLog( String filename );
+ public Command newClearActivationGroup(String name);
+
+ public Command newClearAgenda();
+
+ public Command newClearAgendaGroup(String name);
+
+ public Command newClearRuleFlowGroup(String name);
} | Adding possibility to create Clear commands using CommandFactory | kiegroup_drools | train | java |
b543e016c6a2b906a0d65cd072283642c82eb394 | diff --git a/src/Client/Channel/Basic/Consumer/Consumer.php b/src/Client/Channel/Basic/Consumer/Consumer.php
index <HASH>..<HASH> 100644
--- a/src/Client/Channel/Basic/Consumer/Consumer.php
+++ b/src/Client/Channel/Basic/Consumer/Consumer.php
@@ -217,6 +217,7 @@ final class Consumer implements ConsumerInterface
$frame->type() === Type::method() &&
$frame->method()->equals($deliver)
) {
+ //requeue all the messages sent right before the cancel method
$message = ($this->read)($this->connection);
$this->requeue($frame->values()->get(1)->original()->value());
} | add comment to explain the requeue | Innmind_AMQP | train | php |
dab5687c30bb3588640cf6de0b6fd930b5a36743 | diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -42,12 +42,14 @@ class Configuration implements ConfigurationInterface
->end()
->arrayNode('persistence')
+ ->addDefaultsIfNotSet()
->children()
->scalarNode('class')
->isRequired()
->defaultValue('Liip\TranslationBundle\Persistence\YamlFilePersistence')
->end()
->arrayNode('options')
+ ->addDefaultsIfNotSet()
->children()
->scalarNode('folder')
->defaultValue("%kernel.root_dir%/data/translations") | The persistence options are required by the LiipTranslationExtension. Fixes an "undefined index" issue when clearing the cache. | liip_LiipTranslationBundle | train | php |
67d45635a414b3a003e3914069f26d2acb27e584 | diff --git a/src/MetaModels/DcGeneral/Dca/Builder/Builder.php b/src/MetaModels/DcGeneral/Dca/Builder/Builder.php
index <HASH>..<HASH> 100644
--- a/src/MetaModels/DcGeneral/Dca/Builder/Builder.php
+++ b/src/MetaModels/DcGeneral/Dca/Builder/Builder.php
@@ -1451,10 +1451,14 @@ class Builder
foreach ($inputScreen->getLegends() as $legendName => $legend) {
$paletteLegend = new Legend($legendName);
- $paletteLegend->setInitialVisibility((bool) $legend['visible']);
+ $paletteLegend->setInitialVisibility(isset($legend['visible']) && (bool) $legend['visible']);
$palette->addLegend($paletteLegend);
- $this->translator->setValue($legendName . '_legend', $legend['name'], $container->getName());
+ $this->translator->setValue(
+ $legendName . '_legend',
+ isset($legend['name']) ? $legend['name'] : '',
+ $container->getName()
+ );
foreach ($legend['properties'] as $propertyName) {
$property = new Property($propertyName); | Fix some notices in Builder class. | MetaModels_core | train | php |
f8b3d95604327228c4b16b055f714ec9c7a0d653 | diff --git a/src/Domain/Model/ValueObject/StringValueObject.php b/src/Domain/Model/ValueObject/StringValueObject.php
index <HASH>..<HASH> 100644
--- a/src/Domain/Model/ValueObject/StringValueObject.php
+++ b/src/Domain/Model/ValueObject/StringValueObject.php
@@ -34,4 +34,9 @@ abstract class StringValueObject implements ValueObject
{
return new static($value);
}
+
+ public function __toString(): string
+ {
+ return $this->value;
+ }
} | Added _toString to StringValueObject for generic use | PcComponentes_ddd | train | php |
ecddf86a830567003bb9b746843cf2a5dcb24ea5 | diff --git a/pyvista/utilities/geometric_objects.py b/pyvista/utilities/geometric_objects.py
index <HASH>..<HASH> 100644
--- a/pyvista/utilities/geometric_objects.py
+++ b/pyvista/utilities/geometric_objects.py
@@ -544,7 +544,6 @@ def Disc(center=(0.,0.,0.), inner=0.25, outer=0.5, normal=(0,0,1), r_res=1,
np.clip(np.dot(normal, default_normal), -1, 1)))
transform = vtk.vtkTransform()
- transform.Translate(-center)
transform.RotateWXYZ(angle, axis)
transform.Translate(center)
diff --git a/tests/test_geometric_objects.py b/tests/test_geometric_objects.py
index <HASH>..<HASH> 100644
--- a/tests/test_geometric_objects.py
+++ b/tests/test_geometric_objects.py
@@ -96,6 +96,13 @@ def test_disc():
normals = geom.compute_normals()['Normals']
assert np.allclose(np.dot(normals, unit_normal), 1)
+ center = (1.2, 3.4, 5.6)
+ geom = pyvista.Disc(center=center)
+
+ assert np.allclose(
+ geom.bounds, pyvista.Disc().bounds + np.array([1.2, 1.2, 3.4, 3.4, 5.6, 5.6])
+ )
+
# def test_supertoroid():
# geom = pyvista.SuperToroid() | :bug: fix #<I> (#<I>) | vtkiorg_vtki | train | py,py |
3a8fb9f1e2cf9976ce4cd450a367f0a1efbcb5c0 | diff --git a/tests/test_baseapi.py b/tests/test_baseapi.py
index <HASH>..<HASH> 100644
--- a/tests/test_baseapi.py
+++ b/tests/test_baseapi.py
@@ -366,6 +366,25 @@ class TesteAPIQuery(object):
httpretty.disable()
httpretty.reset()
+ def test_query_with_post_body(self, baseapi):
+ httpretty.reset()
+ httpretty.enable()
+ query = '["certname", "=", "node1"]'
+ stub_request('http://localhost:8080/pdb/query/v4/nodes',
+ method=httpretty.POST)
+ baseapi._query('nodes',
+ query=query,
+ count_by=1,
+ request_method='POST',
+ post_as_body=True)
+ last_request = httpretty.last_request()
+ assert last_request.querystring == {}
+ assert last_request.headers['Content-Type'] == 'application/json'
+ assert last_request.method == httpretty.POST
+ assert last_request.body == json.dumps({'query': query, 'count_by': 1})
+ httpretty.disable()
+ httpretty.reset()
+
class TestAPIMethods(object):
def test_metric(self, baseapi): | tests/test_baseapi.py: test POST w/ query in body
When a POST request is sent with the query in the body,
instead of as a querystring, then:
- the querystring should be empty
- the body be the JSON encoded dictionary with the query and
other specifiers
- the Content-Type should be 'application/json' | voxpupuli_pypuppetdb | train | py |
4409eabb83e76675fdf49dd403e4fa9b779fffc5 | diff --git a/salt/cloud/clouds/lxc.py b/salt/cloud/clouds/lxc.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/lxc.py
+++ b/salt/cloud/clouds/lxc.py
@@ -423,8 +423,7 @@ def create(vm_, call=None):
kwarg['host'] = prov['target']
cret = _runner().cmd('lxc.cloud_init', [vm_['name']], kwarg=kwarg)
ret['runner_return'] = cret
- if cret['result']:
- ret['result'] = False
+ ret['result'] = cret['result']
if not ret['result']:
ret['Error'] = 'Error while creating {0},'.format(vm_['name'])
return ret | Return correct result when creating cloud LXC container
At the end of call chain lxc.init returns boolean result, exactly what
we need and not vice verse. | saltstack_salt | train | py |
2ccc8c5bddbd0a8620148581b5a5a12fe54c7f3e | diff --git a/br/pkg/pdutil/pd_serial_test.go b/br/pkg/pdutil/pd_serial_test.go
index <HASH>..<HASH> 100644
--- a/br/pkg/pdutil/pd_serial_test.go
+++ b/br/pkg/pdutil/pd_serial_test.go
@@ -35,6 +35,8 @@ func TestScheduler(t *testing.T) {
}
schedulerPauseCh := make(chan struct{})
pdController := &PdController{addrs: []string{"", ""}, schedulerPauseCh: schedulerPauseCh}
+ // As pdController.Client is nil, (*pdController).Close() can not be called directly.
+ defer close(schedulerPauseCh)
_, err := pdController.pauseSchedulersAndConfigWith(ctx, []string{scheduler}, nil, mock)
require.EqualError(t, err, "failed")
@@ -70,9 +72,7 @@ func TestScheduler(t *testing.T) {
_, err = pdController.pauseSchedulersAndConfigWith(ctx, []string{scheduler}, cfg, mock)
require.NoError(t, err)
- go func() {
- <-schedulerPauseCh
- }()
+ // pauseSchedulersAndConfigWith will wait on chan schedulerPauseCh
err = pdController.resumeSchedulerWith(ctx, []string{scheduler}, mock)
require.NoError(t, err) | br: fix leak in pdutil.TestScheduler (#<I>) | pingcap_tidb | train | go |
240ec5c8d90ff93f9a68fe9f42d2135451625ba3 | diff --git a/vault/audit.go b/vault/audit.go
index <HASH>..<HASH> 100644
--- a/vault/audit.go
+++ b/vault/audit.go
@@ -259,7 +259,7 @@ func (c *Core) loadAudits(ctx context.Context) error {
entry.namespace = ns
}
- if !needPersist {
+ if !needPersist || c.perfStandby {
return nil
} | perf-standby: Fix audit table upgrade on standbys (#<I>) | hashicorp_vault | train | go |
38332e37a4613dad721d36f90d225ad7e27c9fa5 | diff --git a/src/test/com/mongodb/JavaClientTest.java b/src/test/com/mongodb/JavaClientTest.java
index <HASH>..<HASH> 100644
--- a/src/test/com/mongodb/JavaClientTest.java
+++ b/src/test/com/mongodb/JavaClientTest.java
@@ -492,7 +492,7 @@ public class JavaClientTest extends TestCase {
@Test
@SuppressWarnings("deprecation")
public void testMapReduceInlineSecondary() throws Exception {
- Mongo mongo = new Mongo(Arrays.asList(new ServerAddress("127.0.0.1"), new ServerAddress("127.0.0.1", 27020)));
+ Mongo mongo = new Mongo(Arrays.asList(new ServerAddress("127.0.0.1", 27017), new ServerAddress("127.0.0.1", 27018)));
if (isStandalone(mongo)) {
return; | using sane ports for the replica set test | mongodb_mongo-java-driver | train | java |
9b938141695d4a1e4c666b0137401a06d11587f6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ with open("README.md") as infile:
setup(
name='halo',
packages=find_packages(exclude=('tests', 'examples')),
- version='0.0.22',
+ version='0.0.23',
license='MIT',
description='Beautiful terminal spinners in Python',
long_description=long_description, | Version: Bumped to <I> | manrajgrover_halo | train | py |
be5e1afb2d5d4d5a256833b98693d53136414684 | diff --git a/pygtkhelpers/objectlist.py b/pygtkhelpers/objectlist.py
index <HASH>..<HASH> 100644
--- a/pygtkhelpers/objectlist.py
+++ b/pygtkhelpers/objectlist.py
@@ -24,6 +24,7 @@ class Cell(object):
cell.set_property('text', self.format_data(data))
def make_viewcell(self):
+ #XXX: extend to more types
return gtk.CellRendererText()
class Column(object):
@@ -41,9 +42,9 @@ class Column(object):
def make_viewcolumn(self):
col = gtk.TreeViewColumn(self.title)
- #XXX: extend to more types
for cell in self.cells:
view_cell = cell.make_viewcell()
+ #XXX: better controll over packing
col.pack_start(view_cell)
col.set_cell_data_func(view_cell, cell._data_func)
return col | shuffle some todo comments | sci-bots_pygtkhelpers | train | py |
d0daf377189990261977b0e7d799bb6cfea1b45e | diff --git a/indices/clearCache.go b/indices/clearCache.go
index <HASH>..<HASH> 100644
--- a/indices/clearCache.go
+++ b/indices/clearCache.go
@@ -8,6 +8,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+
package indices
import (
diff --git a/indices/snapshot.go b/indices/snapshot.go
index <HASH>..<HASH> 100644
--- a/indices/snapshot.go
+++ b/indices/snapshot.go
@@ -8,6 +8,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+
package indices
import (
diff --git a/indices/status.go b/indices/status.go
index <HASH>..<HASH> 100644
--- a/indices/status.go
+++ b/indices/status.go
@@ -8,6 +8,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+
package indices
import ( | make license not mess up godoc (put space before package decl) | mattbaird_elastigo | train | go,go,go |
965eb25da2a27291d877bfbc00d55f4b0d5772e0 | diff --git a/tests/dummy/mirage/fixtures/view.js b/tests/dummy/mirage/fixtures/view.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/mirage/fixtures/view.js
+++ b/tests/dummy/mirage/fixtures/view.js
@@ -985,7 +985,7 @@ export default [
{
id: 'conditional-prop-select-form',
label: 'Conditional With Select',
- modelIds: ['conditional-properties'],
+ modelIds: ['conditions', 'conditional-properties'],
view: {
version: '1.0',
type: 'form', | Add additional valid model for conditionals view | ciena-frost_ember-frost-bunsen | train | js |
0a3d16480607bbc0def1e752e8cfe2e72efce3f9 | diff --git a/telethon/tl/custom/conversation.py b/telethon/tl/custom/conversation.py
index <HASH>..<HASH> 100644
--- a/telethon/tl/custom/conversation.py
+++ b/telethon/tl/custom/conversation.py
@@ -333,6 +333,12 @@ class Conversation(ChatGetter):
if message.chat_id != self.chat_id or message.out:
return
+ # We have to update our incoming messages with the new edit date
+ for i, m in enumerate(self._incoming):
+ if m.id == message.id:
+ self._incoming[i] = message
+ break
+
for msg_id, future in list(self._pending_edits.items()):
if msg_id < message.id:
edit_ts = message.edit_date.timestamp() | Fix handling of early edits in Conversation
The incoming messages were never updated, so of course their
edit_date wasn't either. This would cause the library to be
stuck until it timed out, because the event had already
arrived before we waited for it. As an example:
await conv.send_message('foo')
await sleep(1) # bot has plenty of time to respond+edit
await conv.get_edit() | LonamiWebs_Telethon | train | py |
215d3293e223702aaa3faa13814b5d0243792680 | diff --git a/pycbc/filter/zpk.py b/pycbc/filter/zpk.py
index <HASH>..<HASH> 100644
--- a/pycbc/filter/zpk.py
+++ b/pycbc/filter/zpk.py
@@ -28,22 +28,21 @@ import scipy.signal
from pycbc.types import TimeSeries
def filter_zpk(timeseries, z, p, k):
- """Return a new timeseries that is filter with zpk (zeros, poles, gain)
- parameters.
+ """Return a new timeseries that was filtered with a zero-pole-gain filter.
Parameters
----------
timeseries: TimeSeries
The time series to be filtered.
z: array
- Array of zeros to include in zpk filter design, eg. 3 zeroes at 1Hz
- would be array([1., 1., 1.])
+ Array of zeros to include in zero-pole-gain filter design.
+ In units of Hz.
p: array
- Array of poles to include in zpk filter design, eg. 3 poles at 100Hz
- would be array([-100., -100., -100.])
+ Array of poles to include in zero-pole-gain filter design.
+ In units of Hz.
k: float
- Gain to include in zpk filter design. This gain is a contast
- multiplied to the transfer function.
+ Gain to include in zero-pole-gain filter design. This gain is a
+ constant multiplied to the transfer function.
Returns
------- | Updated docstring for zpk_filter. | gwastro_pycbc | train | py |
0720538b1b3348a82c960fb0974effe27d69262a | diff --git a/lib/parallel_calabash/version.rb b/lib/parallel_calabash/version.rb
index <HASH>..<HASH> 100644
--- a/lib/parallel_calabash/version.rb
+++ b/lib/parallel_calabash/version.rb
@@ -1,3 +1,3 @@
module ParallelCalabash
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end | bumping up version to <I> | rajdeepv_parallel_calabash | train | rb |
bd8d04450769c0bf550abf2789934bfed4b899e0 | diff --git a/spec/faraday/adapter/net_http_persistent_spec.rb b/spec/faraday/adapter/net_http_persistent_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/faraday/adapter/net_http_persistent_spec.rb
+++ b/spec/faraday/adapter/net_http_persistent_spec.rb
@@ -42,21 +42,13 @@ RSpec.describe Faraday::Adapter::NetHttpPersistent do
end
context 'min_version' do
- let(:conn_options) do
- {
- headers: { 'X-Faraday-Adapter' => adapter },
- ssl: {
- min_version: :TLS1_2
- }
- }
- end
-
it 'allows to set min_version in SSL settings' do
url = URI('https://example.com')
adapter = described_class.new(nil)
http = adapter.send(:net_http_connection, url: url, request: {})
+ adapter.send(:configure_ssl, http, { min_version: :TLS1_2 })
# `min_version` is only present in net_http_persistent >= 3.1 (UNRELEASED)
expect(http.min_version).to eq(:TLS1_2) if http.respond_to?(:min_version) | Fixes test not working with Net::HTTP::Persistent <I> | lostisland_faraday | train | rb |
51b6c2edaad3c0f32e1bebdff351b7dec2696814 | diff --git a/src/Model/Table/PermissionsTable.php b/src/Model/Table/PermissionsTable.php
index <HASH>..<HASH> 100644
--- a/src/Model/Table/PermissionsTable.php
+++ b/src/Model/Table/PermissionsTable.php
@@ -106,7 +106,7 @@ class PermissionsTable extends Table
}
/**
- * Retrieves current lead view permission for specified user.
+ * Retrieves view permission for specified user.
*
* @param string $modelName Model name
* @param string $foreignKey Foreign key | Adjust docblock (task #<I>) | QoboLtd_cakephp-roles-capabilities | train | php |
c4a46a7df2858904db25b7eaabaf5a75458bea3f | diff --git a/app.go b/app.go
index <HASH>..<HASH> 100644
--- a/app.go
+++ b/app.go
@@ -42,6 +42,8 @@ type App struct {
ArgsUsage string
// Version of the program
Version string
+ // Description of the program
+ Description string
// List of commands to execute
Commands []Command
// List of flags to parse
diff --git a/help.go b/help.go
index <HASH>..<HASH> 100644
--- a/help.go
+++ b/help.go
@@ -20,7 +20,10 @@ USAGE:
{{if .Version}}{{if not .HideVersion}}
VERSION:
{{.Version}}
- {{end}}{{end}}{{if len .Authors}}
+ {{end}}{{end}}{{if .Description}}
+DESCRIPTION:
+ {{.Description}}
+{{end}}{{if len .Authors}}
AUTHOR(S):
{{range .Authors}}{{.}}{{end}}
{{end}}{{if .VisibleCommands}} | app: Add App.Description
So you can describe what the application is for without requiring
users to drill down into a particular command. | urfave_cli | train | go,go |
cd8e8c7b03c1d2bf86db325a8f91a43e3e75abc5 | diff --git a/thrift/transport.go b/thrift/transport.go
index <HASH>..<HASH> 100644
--- a/thrift/transport.go
+++ b/thrift/transport.go
@@ -34,6 +34,7 @@ type readWriterTransport struct {
io.Reader
readBuf [1]byte
writeBuf [1]byte
+ strBuf []byte
}
var errNoBytesRead = errors.New("no bytes read")
@@ -82,7 +83,22 @@ func (t *readWriterTransport) WriteByte(b byte) error {
}
func (t *readWriterTransport) WriteString(s string) (int, error) {
- return io.WriteString(t.Writer, s)
+ // TODO switch to io.StringWriter once we don't need to support < 1.12
+ type stringWriter interface{ WriteString(string) (int, error) }
+
+ if sw, ok := t.Writer.(stringWriter); ok {
+ return sw.WriteString(s)
+ }
+
+ // This path frequently taken since thrift.TBinaryProtocol calls
+ // WriteString a lot, but fragmentingWriter does not implement WriteString;
+ // furthermore it is difficult to add a dual WriteString path to
+ // fragmentingWriter, since hash checksumming does not accept strings.
+ //
+ // Without this, io.WriteString ends up allocating every time.
+ b := append(t.strBuf[:0], s...)
+ t.strBuf = b[:0]
+ return t.Writer.Write(b)
}
// RemainingBytes returns the max number of bytes (same as Thrift's StreamTransport) as we | Eliminate []byte(string) allocation under thrift transport | uber_tchannel-go | train | go |
4415ca309cddd2ed0ebe0695246cb02c33c4d70c | diff --git a/app/src/main/java/io/appium/uiautomator2/model/XPathFinder.java b/app/src/main/java/io/appium/uiautomator2/model/XPathFinder.java
index <HASH>..<HASH> 100644
--- a/app/src/main/java/io/appium/uiautomator2/model/XPathFinder.java
+++ b/app/src/main/java/io/appium/uiautomator2/model/XPathFinder.java
@@ -231,7 +231,7 @@ public class XPathFinder implements Finder {
public static AccessibilityNodeInfo getRootAccessibilityNode() throws UiAutomator2Exception {
final long timeoutMillis = 10000;
- Device.waitForIdle(timeoutMillis);
+ Device.waitForIdle();
long end = SystemClock.uptimeMillis() + timeoutMillis;
while (true) { | Shouln't use hardcoded timeout for `waitForIdle()`. (#<I>) | appium_appium-uiautomator2-server | train | java |
779b3035799483e4de21bd2bbdc298ca1746878a | diff --git a/analyzers/MISP/mispclient.py b/analyzers/MISP/mispclient.py
index <HASH>..<HASH> 100755
--- a/analyzers/MISP/mispclient.py
+++ b/analyzers/MISP/mispclient.py
@@ -57,9 +57,9 @@ class MISPClient:
elif isinstance(ssl, bool):
verify = ssl
self.misp_connections.append(pymisp.ExpandedPyMISP(url=server,
- key=key[idx],
- ssl=verify,
- proxies=proxies))
+ key=key[idx],
+ ssl=verify,
+ proxies=proxies))
else:
verify = True
if isinstance(ssl, str) and os.path.isfile(ssl):
@@ -68,10 +68,10 @@ class MISPClient:
raise CertificateNotFoundError('Certificate not found under {}.'.format(ssl))
elif isinstance(ssl, bool):
verify = ssl
- self.misp_connections.append(pymisp.PyMISP(url=url,
- key=key,
- ssl=verify,
- proxies=proxies))
+ self.misp_connections.append(pymisp.ExpandedPyMISP(url=url,
+ key=key,
+ ssl=verify,
+ proxies=proxies))
self.misp_name = name
@staticmethod | [#<I>] Use ExpandedPyMISP in case of a single MISP connection also | TheHive-Project_Cortex-Analyzers | train | py |
4d14a073d89a9faf8577bd6c19664eb8a0ed0a58 | diff --git a/lib/active_admin/csv_builder.rb b/lib/active_admin/csv_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/csv_builder.rb
+++ b/lib/active_admin/csv_builder.rb
@@ -47,9 +47,13 @@ module ActiveAdmin
receiver << CSV.generate_line(columns.map{ |c| encode c.name, options }, options)
- view_context.send(:collection).find_each do |resource|
- resource = view_context.send :apply_decorator, resource
- receiver << CSV.generate_line(build_row(resource, columns, options), options)
+ collection = view_context.send(:collection)
+ total_pages = collection.public_send(Kaminari.config.page_method_name, 1).per(batch_size).total_pages
+ (1..total_pages).each do |page_no|
+ collection.public_send(Kaminari.config.page_method_name, page_no).per(batch_size).each do |resource|
+ resource = view_context.send :apply_decorator, resource
+ receiver << CSV.generate_line(build_row(resource, columns, options), options)
+ end
end
end
@@ -107,5 +111,9 @@ module ActiveAdmin
def column_transitive_options
@column_transitive_options ||= @options.slice(*COLUMN_TRANSITIVE_OPTIONS)
end
+
+ def batch_size
+ 1000
+ end
end
end | added ability to use sort order in CSV | activeadmin_activeadmin | train | rb |
e64c7be90a7a0231c75bfef7363495969a9ac07b | diff --git a/src/main/java/biz/paluch/logging/gelf/jboss7/JBoss7GelfLogHandler.java b/src/main/java/biz/paluch/logging/gelf/jboss7/JBoss7GelfLogHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/biz/paluch/logging/gelf/jboss7/JBoss7GelfLogHandler.java
+++ b/src/main/java/biz/paluch/logging/gelf/jboss7/JBoss7GelfLogHandler.java
@@ -102,7 +102,7 @@ public class JBoss7GelfLogHandler extends biz.paluch.logging.gelf.jul.GelfLogHan
}
public void setDynamicMdcFields(String fieldSpec) {
- super.setMdcFields(fieldSpec);
+ super.setDynamicMdcFields(fieldSpec);
}
public boolean isMdcProfiling() { | Use correct setting in MDC names (fixes bug introduced with #<I>) | mp911de_logstash-gelf | train | java |
6b1507a0ca60371e0ac7706ee3ac5527009fde77 | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -81,7 +81,7 @@ copyright = u'2015–2018, SKA South Africa'
def get_version():
globals_ = {}
root = os.path.dirname(os.path.dirname(__file__))
- with open(os.path.join(root, 'spead2', '_version.py')) as f:
+ with open(os.path.join(root, 'src', 'spead2', '_version.py')) as f:
code = f.read()
exec(code, globals_)
release = globals_['__version__'] | Fix doc build to get _version.py from new location | ska-sa_spead2 | train | py |
cac36879546f2a349c514517133b0c3d3c23ca93 | diff --git a/pkg/datapath/loader/loader.go b/pkg/datapath/loader/loader.go
index <HASH>..<HASH> 100644
--- a/pkg/datapath/loader/loader.go
+++ b/pkg/datapath/loader/loader.go
@@ -364,7 +364,7 @@ func (l *Loader) replaceNetworkDatapath(ctx context.Context, interfaces []string
}
for _, iface := range option.Config.EncryptInterface {
if err := replaceDatapath(ctx, iface, networkObj, symbolFromNetwork, dirIngress, false, ""); err != nil {
- log.WithField(logfields.Interface, iface).Fatal("Load encryption network failed")
+ log.WithField(logfields.Interface, iface).WithError(err).Fatal("Load encryption network failed")
}
}
return nil | Add missing error reporting in replaceNetworkDatapath | cilium_cilium | train | go |
5d67ac5504beb860001c3d27273a8cbb46a5dbab | diff --git a/tests/CityDataTest.php b/tests/CityDataTest.php
index <HASH>..<HASH> 100644
--- a/tests/CityDataTest.php
+++ b/tests/CityDataTest.php
@@ -146,6 +146,7 @@ final class CityDataTest extends \PHPUnit\Framework\TestCase
public function testExtendedClassV2()
{
+ $this->expectException(\TypeError::class);
$this->expectExceptionMessageRegExp('#Invalid type: expected "plz" to be of type {string}, instead got value "NULL"#');
$modelMeta = BigCityData::meta(); | [+]: search for PhpDoc @property in parent classes <I> | voku_Arrayy | train | php |
5d9d1efb727f47125244d11de14b4314ed03cf60 | diff --git a/lib/countly.js b/lib/countly.js
index <HASH>..<HASH> 100644
--- a/lib/countly.js
+++ b/lib/countly.js
@@ -2382,7 +2382,7 @@
// set feedback widget family as ratings and load related style file when type is ratings
if (presentableFeedback.type === "rating") {
feedbackWidgetFamily = "ratings";
- loadCSS(`${this.url}/star-rating/stylesheets/ratings-sdk.css`);
+ loadCSS(`${this.url}/star-rating/stylesheets/countly-feedback-web.css`);
}
// if it's not ratings, it means we need to name it as surveys and load related style file
// (at least until we add new type in future) | [ratings-css-rename] renamed css file name for backward compatability. (#<I>)
also I made a server-side change related this. | Countly_countly-sdk-web | train | js |
1dc4bcc67dec50e2f58436ffbc7d61ca9da5b943 | diff --git a/messenger.go b/messenger.go
index <HASH>..<HASH> 100644
--- a/messenger.go
+++ b/messenger.go
@@ -23,7 +23,7 @@ type Options struct {
VerifyToken string
// Token is the access token of the Facebook page to send messages from.
Token string
- // WebhookURL is where the Messenger client should listen for webhook events.
+ // WebhookURL is where the Messenger client should listen for webhook events. Leaving the string blank implies a path of "/".
WebhookURL string
}
@@ -53,6 +53,10 @@ func New(mo Options) *Messenger {
token: mo.Token,
}
+ if mo.WebhookURL == "" {
+ mo.WebhookURL = "/"
+ }
+
m.verifyHandler = newVerifyHandler(mo.VerifyToken)
m.mux.HandleFunc(mo.WebhookURL, m.handle)
@@ -113,7 +117,7 @@ func (m *Messenger) handle(w http.ResponseWriter, r *http.Request) {
err := json.NewDecoder(r.Body).Decode(&rec)
if err != nil {
- fmt.Println(err)
+ fmt.Println("could not decode response:", err)
fmt.Fprintln(w, `{status: 'not ok'}`)
return
} | Add "/" as default WebhookURL
This is because an empty string is *invalid* in net/http and will yield
a panic. | paked_messenger | train | go |
c3aa04d3ea6e9984d447d1a454a7f22770822f31 | diff --git a/test/unit/process_runner_test.rb b/test/unit/process_runner_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/process_runner_test.rb
+++ b/test/unit/process_runner_test.rb
@@ -92,8 +92,8 @@ class ProcessRunnerTest < Test::Unit::TestCase
def execute_with_open4_and_bad_mode(command, options="")
assert !File.stat(command).executable?, "File should not be executable to begin"
+ @runner.expects(:update_executable_mode)
@runner.execute_open4 command, options
- assert File.stat(command).executable?, "File should be converted to become executable"
assert_matches /^Hello World/, @runner.read
end | Updated process runner test to work on Windoze | lukebayes_project-sprouts | train | rb |
cc7717036e34aad4411dfc569fbdcf351e15d6aa | diff --git a/lib/rack/timeout.rb b/lib/rack/timeout.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/timeout.rb
+++ b/lib/rack/timeout.rb
@@ -44,7 +44,7 @@ module Rack
timeout_thread = Thread.start do
loop do
info.duration = Time.now - ready_time
- sleep_seconds = [1, info.timeout - info.duration].min
+ sleep_seconds = [1 - (info.duration % 1), info.timeout - info.duration].min
break if sleep_seconds <= 0
Rack::Timeout._set_state! env, :active
sleep(sleep_seconds) | try to ensure steps between logging active state in debug mode are exactly 1s, by accounting for accumulated processing time from previous iteration | heroku_rack-timeout | train | rb |
cac8f8c8c0161b681b1e258edcffa829fb7a2b04 | diff --git a/pixiedust/utils/environment.py b/pixiedust/utils/environment.py
index <HASH>..<HASH> 100644
--- a/pixiedust/utils/environment.py
+++ b/pixiedust/utils/environment.py
@@ -34,7 +34,7 @@ class Environment(with_metaclass(
scala_out = subprocess.check_output([scala, "-version"], stderr=subprocess.STDOUT).decode("utf-8")
except subprocess.CalledProcessError as cpe:
scala_out = cpe.output
- match = re.search(b'.*version[^0-9]*([0-9]*[^.])\.([0-9]*[^.])\.([0-9]*[^.]).*', scala_out)
+ match = re.search(".*version[^0-9]*([0-9]*[^.])\.([0-9]*[^.])\.([0-9]*[^.]).*", scala_out)
if match and len(match.groups()) > 2:
return int(match.group(1)), int(match.group(2))
else: | Change regex search to support Python <I> and Python <I> | pixiedust_pixiedust | train | py |
a840a2905aef18525710121b9a7fdaefa1986562 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,8 @@ if not USE_CYTHON:
assert os.path.exists(os.path.join("pypolyagamma", "parallel.cpp"))
# download GSL if we don't have it in deps
-assert os.path.exists('deps')
+if not os.path.exists('deps'):
+ os.makedirs('deps')
gslurl = 'http://open-source-box.org/gsl/gsl-latest.tar.gz'
gsltarpath = os.path.join('deps', 'gsl-latest.tar.gz')
gslpath = os.path.join('deps', 'gsl') | if deps/ dir doesn't exist make it | slinderman_pypolyagamma | train | py |
8ba40a606bc062d2e7f791e9a8a7e9dc6cef4666 | diff --git a/lib/shopify_app/configuration.rb b/lib/shopify_app/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/shopify_app/configuration.rb
+++ b/lib/shopify_app/configuration.rb
@@ -5,7 +5,7 @@ module ShopifyApp
# for the app in your Shopify Partners page. Change your settings in
# `config/initializers/shopify_app.rb`
attr_accessor :application_name
- attr_accessor :api_key
+ attr_writer :api_key
attr_accessor :secret
attr_accessor :old_secret
attr_accessor :scope
@@ -65,6 +65,11 @@ module ShopifyApp
scripttags.present?
end
+ def api_key
+ raise 'API Key is required and is being returned nil. Are you loading your enviroment variables?' if @api_key.nil?
+ @api_key
+ end
+
def enable_same_site_none
!Rails.env.test? && (@enable_same_site_none.nil? ? embedded_app? : @enable_same_site_none)
end | raises if you do not have our api_key set | Shopify_shopify_app | train | rb |
9cfd590c2e43f43e095559511dc12b7ae84f6f63 | diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js
index <HASH>..<HASH> 100644
--- a/src/extensions/default/QuickView/main.js
+++ b/src/extensions/default/QuickView/main.js
@@ -371,11 +371,16 @@ define(function (require, exports, module) {
editor;
for (i = 0; i < inlines.length; i++) {
- var $inlineDiv = inlines[i].$editorsDiv; // see MultiRangeInlineEditor
+ var $inlineDiv = inlines[i].$editorsDiv, // see MultiRangeInlineEditor
+ $otherDiv = inlines[i].$htmlContent;
if ($inlineDiv && divContainsMouse($inlineDiv, event)) {
editor = inlines[i].editors[0];
break;
+ } else if ($otherDiv && divContainsMouse($otherDiv, event)) {
+ // Mouse inside unsupported inline editor like Quick Docs or Color Editor
+ hidePreview();
+ return;
}
} | Hide Quick View when hovering in unsuported inline editors. | adobe_brackets | train | js |
38c60b8dd47a1e8c4b270efedc7d72de82a50639 | diff --git a/spyder/widgets/variableexplorer/utils.py b/spyder/widgets/variableexplorer/utils.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/variableexplorer/utils.py
+++ b/spyder/widgets/variableexplorer/utils.py
@@ -397,10 +397,10 @@ def value_to_display(value, minmax=False, level=0):
except:
display = default_display(value)
- # Truncate display at 80 chars to avoid freezing Spyder
+ # Truncate display at 70 chars to avoid freezing Spyder
# because of large displays
- if len(display) > 80:
- display = display[:80].rstrip() + ' ...'
+ if len(display) > 70:
+ display = display[:70].rstrip() + ' ...'
# Restore Numpy threshold
if np_threshold is not FakeObject: | Variable Explorer: Reduce number of characters shown in display | spyder-ide_spyder-kernels | train | py |
ba39f805f506a8fddbe36e957849de623e73fafb | diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
+++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
@@ -442,7 +442,7 @@ trait ValidatesAttributes
foreach ($parameters as $parameter) {
if (Arr::has($this->data, $parameter)) {
$other = Arr::get($this->data, $parameter);
-
+
if ($value === $other) {
return false;
} | Apply fixes from StyleCI (#<I>) | laravel_framework | train | php |
664af1adc2e23bf558f0e743e6fcaca4e3db94d9 | diff --git a/domain/core-api/src/main/java/io/motown/domain/api/chargingstation/CorrelationToken.java b/domain/core-api/src/main/java/io/motown/domain/api/chargingstation/CorrelationToken.java
index <HASH>..<HASH> 100644
--- a/domain/core-api/src/main/java/io/motown/domain/api/chargingstation/CorrelationToken.java
+++ b/domain/core-api/src/main/java/io/motown/domain/api/chargingstation/CorrelationToken.java
@@ -53,7 +53,9 @@ public final class CorrelationToken {
}
/**
- * {@inheritDoc}
+ * Gets the token.
+ *
+ * @return the token.
*/
public String getToken() {
return token; | Fixed the CorrelationToken's getToken JavaDoc | motown-io_motown | train | java |
82a5d726c0a15e5f2821ddc728d5d05e75aaa0ad | diff --git a/djangocms_text_ckeditor/cms_plugins.py b/djangocms_text_ckeditor/cms_plugins.py
index <HASH>..<HASH> 100644
--- a/djangocms_text_ckeditor/cms_plugins.py
+++ b/djangocms_text_ckeditor/cms_plugins.py
@@ -46,6 +46,15 @@ class TextPlugin(CMSPluginBase):
kwargs['form'] = form # override standard form
return super(TextPlugin, self).get_form(request, obj, **kwargs)
+ def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
+ """
+ We override the change form template path
+ to provide backwards compatibility with CMS 2.x
+ """
+ if cms_version.startswith('2'):
+ context['change_form_template'] = "admin/cms/page/plugin_change_form.html"
+ return super(TextPlugin, self).render_change_form(request, context, add, change, form_url, obj)
+
def render(self, context, instance, placeholder):
context.update({
'body': plugin_tags_to_user_html(
@@ -56,9 +65,6 @@ class TextPlugin(CMSPluginBase):
'placeholder': placeholder,
'object': instance
})
- # Support for Django CMS 2.x
- if cms_version.startswith('2'):
- context['change_form_template'] = "admin/cms/page/plugin_change_form.html"
return context
def save_model(self, request, obj, form, change): | Provide extra context variable to override template path. | divio_djangocms-text-ckeditor | train | py |
f25f53fd84978d4cadd676237b61bb891275bed5 | diff --git a/pavement.py b/pavement.py
index <HASH>..<HASH> 100644
--- a/pavement.py
+++ b/pavement.py
@@ -122,6 +122,8 @@ options(
docs=Bunch(docs_dir="docs/apidocs"),
)
+setup(**project)
+
#
# Build | optional tools not installed upfront; fixed pyrocore pavement | pyroscope_pyrocore | train | py |
c46f551d2eec3a841ac7b6ab795610940ae8db39 | diff --git a/jest/src/test/java/io/searchbox/cluster/UpdateSettingsIntegrationTest.java b/jest/src/test/java/io/searchbox/cluster/UpdateSettingsIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/jest/src/test/java/io/searchbox/cluster/UpdateSettingsIntegrationTest.java
+++ b/jest/src/test/java/io/searchbox/cluster/UpdateSettingsIntegrationTest.java
@@ -26,7 +26,7 @@ public class UpdateSettingsIntegrationTest extends AbstractIntegrationTest {
public void transientSettingShouldBeUpdated() throws IOException {
String source = "{\n" +
" \"transient\" : {\n" +
- " \"discovery.zen.publish_timeout\" : 10\n" +
+ " \"indices.store.throttle.max_bytes_per_sec\" : \"50mb\"\n" +
" }\n" +
"}"; | using a different setting name to test if transient settings change as expected - the other one must be missing. | searchbox-io_Jest | train | java |
3758c0aa83725d5c40be3aea7f8d7724444a8b16 | diff --git a/discord/member.py b/discord/member.py
index <HASH>..<HASH> 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -125,3 +125,11 @@ class Member(User):
return Colour.default()
color = colour
+
+ @property
+ def mention(self):
+ if self.nick:
+ return '<@!{}>'.format(self.id)
+ return '<@{}>'.format(self.id)
+
+ mention.__doc__ = User.mention.__doc__ | Member.mention now uses nickname hint if needed. | Rapptz_discord.py | train | py |
d1d2165838c70fd8074b0096f9363380f9fb9bc6 | diff --git a/Bridges/HttpKernel.php b/Bridges/HttpKernel.php
index <HASH>..<HASH> 100644
--- a/Bridges/HttpKernel.php
+++ b/Bridges/HttpKernel.php
@@ -11,6 +11,7 @@ use React\Http\Request as ReactRequest;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
+use Symfony\Component\HttpFoundation\StreamedResponse as SymfonyStreamedResponse;
use Symfony\Component\HttpKernel\TerminableInterface;
class HttpKernel implements BridgeInterface
@@ -171,6 +172,9 @@ class HttpKernel implements BridgeInterface
}
$content = $syResponse->getContent();
+ if ($syResponse instanceof SymfonyStreamedResponse) {
+ $syResponse->sendContent();
+ }
$nativeHeaders = []; | Readd simplistic StreamedResponse support | php-pm_php-pm-httpkernel | train | php |
7e059fb9d2b9527b76c1baf282dce65913471886 | diff --git a/lib/jsonapi/error_codes.rb b/lib/jsonapi/error_codes.rb
index <HASH>..<HASH> 100644
--- a/lib/jsonapi/error_codes.rb
+++ b/lib/jsonapi/error_codes.rb
@@ -17,7 +17,7 @@ module JSONAPI
TYPE_MISMATCH = 116
INVALID_PAGE_OBJECT = 117
INVALID_PAGE_VALUE = 118
- INVALID_FIELD_FORMAT = 120
+ INVALID_FIELD_FORMAT = 119
FORBIDDEN = 403
RECORD_NOT_FOUND = 404
UNSUPPORTED_MEDIA_TYPE = 415 | Shift INVALID_FIELD_FORMAT value from <I> to <I> | cerebris_jsonapi-resources | train | rb |
b9f6fd919a6fca42d384fab0d0543e9abb114b4f | diff --git a/src/svg.js b/src/svg.js
index <HASH>..<HASH> 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -1943,6 +1943,8 @@ function arrayFirstValue(arr) {
p.node.appendChild(this.node);
return p;
};
+// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.
+// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values?
/*\
* Element.marker
[ method ]
@@ -1957,7 +1959,7 @@ function arrayFirstValue(arr) {
- refX (number)
- refY (number)
= (Element) `<marker>` element
- * You can use pattern later on as an argument for `marker-start` or `marker-end` attributes.
+ * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.
\*/
// TODO add usage for markers
elproto.marker = function (x, y, width, height, refX, refY) { | EDIT & COMMENT Element.marker | adobe-webplatform_Snap.svg | train | js |
963f1ca4493667877825eabb8971c4a6e19dc1fb | diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Utility/Validation.php
+++ b/lib/Cake/Utility/Validation.php
@@ -467,7 +467,7 @@ class Validation {
*/
public static function ip($check, $type = 'both') {
$type = strtolower($type);
- $flags = null;
+ $flags = 0;
if ($type === 'ipv4' || $type === 'both') {
$flags |= FILTER_FLAG_IPV4;
} | Don't |= with null. | cakephp_cakephp | train | php |
635535c131036de36a8bc276d343db7d6a2577c0 | diff --git a/gruvi/jsonrpc.py b/gruvi/jsonrpc.py
index <HASH>..<HASH> 100644
--- a/gruvi/jsonrpc.py
+++ b/gruvi/jsonrpc.py
@@ -208,7 +208,7 @@ def create_error(request, code=None, message=None, data=None, error=None):
"""Create a JSON-RPC error response message."""
if code is None and error is None:
raise ValueError('either "code" or "error" must be set')
- msg = {'id': request['id']}
+ msg = {'id': request and request.get('id')}
if code:
error = {'code': code}
error['message'] = message or strerror(code) | [jsonrpc] create_error(): allow null id
This allows you to call create_error() with a message argument that is
either None, or a notification. The JSON-RPC spec allows erros with a
null ID in case it is not clear where the error belongs to. | geertj_gruvi | train | py |
bd4ae32344a3a68ce27b1ad27c992687613b3182 | diff --git a/sshtunnel.py b/sshtunnel.py
index <HASH>..<HASH> 100644
--- a/sshtunnel.py
+++ b/sshtunnel.py
@@ -1620,7 +1620,7 @@ def open_tunnel(*args, **kwargs):
kwargs
)
- ssh_port = kwargs.pop('ssh_port', None)
+ ssh_port = kwargs.pop('ssh_port', 22)
skip_tunnel_checkup = kwargs.pop('skip_tunnel_checkup', True)
block_on_close = kwargs.pop('block_on_close', _DAEMON)
if not args: | Fix #<I> (#<I>) | pahaz_sshtunnel | train | py |
6ad31be1682f911e3577d98d1d0ff6e7ed450bd0 | diff --git a/src/Resources/ElasticSearch/ElasticSearchResource.php b/src/Resources/ElasticSearch/ElasticSearchResource.php
index <HASH>..<HASH> 100644
--- a/src/Resources/ElasticSearch/ElasticSearchResource.php
+++ b/src/Resources/ElasticSearch/ElasticSearchResource.php
@@ -144,7 +144,7 @@ class ElasticSearchResource extends Resource
}
unset($params['body']['from'], $params['body']['size']);
} else {
- $where = json_decode($params['where'], true);
+ $where = json_decode($params['where'] ?? '', true);
}
} | don't throw exception when filter is not set | SphereMall_PHP-MS-Client | train | php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.