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 |
|---|---|---|---|---|---|
b9438da40263e368977355c09dbebd3b913bdaef | diff --git a/livelossplot/core.py b/livelossplot/core.py
index <HASH>..<HASH> 100644
--- a/livelossplot/core.py
+++ b/livelossplot/core.py
@@ -67,7 +67,7 @@ def draw_plot(logs, metrics, figsize=None, max_epoch=None,
plt.tight_layout()
if fig_path is not None:
- plt.savefig(fig_path)
+ plt.savefig(fig_path.format(i=len(logs)))
plt.show()
def print_extrema(logs, | saved figure names can be paremetrized | stared_livelossplot | train | py |
675ae1e370cdb2da00da05d8c07106f1a7c049c7 | diff --git a/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java b/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java
+++ b/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java
@@ -50,6 +50,11 @@ public class SauceBackedDriverSupplier implements Supplier<WebDriver> {
} catch (UnreachableBrowserException ex) {
System.out.println("Session is not started " + ex.getMessage());
lastException = ex;
+ // wait a bit before the next attempt
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ }
}
} | Adding a sleep between attempts to set connection to sauce | SeleniumHQ_selenium | train | java |
7910a139ca67a6c5a00db65c4d2257a0ea580780 | diff --git a/src/math/matrix2.js b/src/math/matrix2.js
index <HASH>..<HASH> 100644
--- a/src/math/matrix2.js
+++ b/src/math/matrix2.js
@@ -93,7 +93,7 @@
* @return {me.Matrix2d} Reference to this object for method chaining
*/
copy : function (b) {
- this.val.setTransform(b.val);
+ this.val.set(b.val);
return this;
}, | fix a regression in the copy function (this calls set on the Array object and not me.Matrix2D) | melonjs_melonJS | train | js |
71b6960cd5113cf8b4b1313098f13913745d883d | diff --git a/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java b/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java
index <HASH>..<HASH> 100644
--- a/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java
+++ b/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java
@@ -103,7 +103,7 @@ public class Modal extends Div implements IsClosable {
public Modal() {
setStyleName(Styles.MODAL);
-
+
// We make this the default behavior in order to avoid issues like
// https://github.com/gwtbootstrap3/gwtbootstrap3/issues/394
setRemoveOnHide(true);
@@ -130,6 +130,12 @@ public class Modal extends Div implements IsClosable {
}
@Override
+ protected void onUnload() {
+ super.onUnload();
+ unbindAllHandlers(getElement());
+ }
+
+ @Override
public void add(final Widget w) {
// User can supply own ModalHeader
if (w instanceof ModalHeader) {
@@ -182,7 +188,7 @@ public class Modal extends Div implements IsClosable {
removeOnHideHandlerReg = addHiddenHandler(new ModalHiddenHandler() {
@Override
public void onHidden(final ModalHiddenEvent evt) {
- unbindAllHandlers(getElement());
+ // Do logical detach
removeFromParent();
}
}); | ref #<I>: Moved unbindAllHandlers call into onunload method. | gwtbootstrap3_gwtbootstrap3 | train | java |
8037d5d1ace42556ccb73e372dd7bf97e5a43263 | diff --git a/tangelo/tangelo/__init__.py b/tangelo/tangelo/__init__.py
index <HASH>..<HASH> 100644
--- a/tangelo/tangelo/__init__.py
+++ b/tangelo/tangelo/__init__.py
@@ -60,7 +60,7 @@ def log_warning(section, message=None):
def log_info(section, message=None):
- log(section, message, color="\033[1;35m")
+ log(section, message, color="\033[35m")
def request_path(): | Using non-bolded magenta for info statements | Kitware_tangelo | train | py |
9efbe94ee6fe802d101f81e880962841ec29afe5 | diff --git a/pyemma/util/annotators.py b/pyemma/util/annotators.py
index <HASH>..<HASH> 100644
--- a/pyemma/util/annotators.py
+++ b/pyemma/util/annotators.py
@@ -204,6 +204,7 @@ def deprecated(*optional_message):
# skip callee frames if they are other decorators or this file(func)
if 'decorator' in filename or __file__ in filename:
continue
+ else: break
lineno = frame[2]
user_msg = 'Call to deprecated function "%s". Called from %s line %i. %s' \ | [annotators/deprecated] only skip decorators and self.__file__ | markovmodel_PyEMMA | train | py |
1e31f6a73d64f8b8758a0e67480de2b0ae791b0f | diff --git a/lib/module.js b/lib/module.js
index <HASH>..<HASH> 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -321,7 +321,7 @@
// Helpers
Module.prototype.log = function() {
- if(this.snoozeConfig.silent === false) {
+ if(this.snoozeConfig.silent !== true) {
var log = Function.prototype.bind.call(console.log, console);
if(this.logging === true) {
log.apply(console, arguments);
@@ -333,7 +333,7 @@
Module.prototype.warn = function() {
arguments[0] = (arguments[0]+'').red;
- if(this.snoozeConfig.silent === false || this.snoozeConfig.silent === 'log') {
+ if(this.snoozeConfig.silent !== true) {
var log = Function.prototype.bind.call(console.log, console);
if(this.logging === true) {
log.apply(console, arguments); | logs if silent is undefined | iamchairs_snooze | train | js |
209d56851b374f55161b8ec8739b5e1abf12e144 | diff --git a/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java b/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java
+++ b/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java
@@ -166,7 +166,7 @@ public class SyncRequest extends AbstractRequest {
* @return The sync request builder.
*/
public Builder withLeader(String leader) {
- request.leader = Assert.isNotNull(leader, "leader");
+ request.leader = leader;
return this;
} | Allow null leaders in SyncRequest. | atomix_atomix | train | java |
00b8b50d71a7e2512ef49f81f3985843c6ee99ce | diff --git a/delphi/utils.py b/delphi/utils.py
index <HASH>..<HASH> 100644
--- a/delphi/utils.py
+++ b/delphi/utils.py
@@ -2,7 +2,7 @@
from indra.statements import Influence
from indra.sources import eidos
-from itertools import repeat, accumulate, islice, chain, starmap
+from itertools import repeat, accumulate, islice, chain, starmap, zip_longest
from functools import reduce
from tqdm import tqdm
from future.utils import lmap
@@ -289,3 +289,18 @@ def get_indra_statements_from_directory(directory: str) -> Iterable[Influence]:
)
)
+
+def grouper(iterable, n, fillvalue=None):
+ "Collect data into fixed-length chunks or blocks"
+ # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
+ args = [iter(iterable)] * n
+ return zip_longest(*args, fillvalue=fillvalue)
+
+def _insert_line_breaks(label: str, max_str_length=20) -> str:
+ words = label.split()
+ if len(label) > max_str_length:
+ n_groups = len(label)//max_str_length
+ n = len(words)// n_groups
+ return '\n'.join([' '.join(word_group) for word_group in grouper(words, n, '')])
+ else:
+ return label | added grouper and line break utils | ml4ai_delphi | train | py |
ebaa473b3f72caa2872cb71df49efb1bdbb2285b | diff --git a/src/Http/Request/Params.php b/src/Http/Request/Params.php
index <HASH>..<HASH> 100644
--- a/src/Http/Request/Params.php
+++ b/src/Http/Request/Params.php
@@ -71,7 +71,7 @@ trait Params
'files' => []
];
- if (in_array(self::$__method, ['PUT', 'PATCH', 'DELETE'])) {
+ if (in_array(self::$__method, ['PUT', 'PATCH'])) {
$rawInput = file_get_contents('php://input'); | Removing DELETE from method check | softberg_quantum-core | train | php |
d0f9f278a40485151b1746f96b72f67ca08c060c | diff --git a/tests/test_hgvs_validator.py b/tests/test_hgvs_validator.py
index <HASH>..<HASH> 100644
--- a/tests/test_hgvs_validator.py
+++ b/tests/test_hgvs_validator.py
@@ -73,7 +73,7 @@ class Test_HGVSIntrinsicValidator(unittest.TestCase):
self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.76_78delACT')))
self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.123+54_123+55delTA')))
self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.76_78del')))
- self.validate_int.validate(self.hp.parse_hgvs_variant('NM_000030.2:c.679_680+2delAAGT'))
+ self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('NM_000030.2:c.679_680+2delAAGT')))
with self.assertRaises(HGVSValidationError):
self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.76_78delACTACAT')) | Add the forgetten assertion in the test for validating del length | biocommons_hgvs | train | py |
62c3275c3ffd77114e15c0e24c9b3678a4580e23 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os | Restore deleted python env path at the top of the setup script | FPGAwars_apio | train | py |
b3b09cb8d88c9376a6c6f91ea182423d33c1b344 | diff --git a/progression/progress.py b/progression/progress.py
index <HASH>..<HASH> 100644
--- a/progression/progress.py
+++ b/progression/progress.py
@@ -265,6 +265,7 @@ class Loop(object):
try:
b = self.conn_recv.recv()
print(b, end='')
+ print(len(b), [ord(bi) for bi in b])
except EOFError:
break | try to pipe loop output further, to implement ipython widgets progress | cimatosa_progression | train | py |
0c5e2b033caab90db3b2250a41631a032aa87f5c | diff --git a/lxd/images.go b/lxd/images.go
index <HASH>..<HASH> 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -2305,7 +2305,7 @@ func imageValidSecret(d *Daemon, projectName string, fingerprint string, secret
// Token is single-use, so cancel it now.
err = operationCancel(d, projectName, op)
if err != nil {
- return nil, errors.Wrapf(err, "Failed to cancel operation")
+ return nil, errors.Wrapf(err, "Failed to cancel operation %q", op.ID)
}
return op, nil | lxd/images: Include operation ID in error in imageValidSecret | lxc_lxd | train | go |
26a2ab5a8da5bdea9031b4e8d9eca8bb28d8944d | diff --git a/lib/aasm/core/state.rb b/lib/aasm/core/state.rb
index <HASH>..<HASH> 100644
--- a/lib/aasm/core/state.rb
+++ b/lib/aasm/core/state.rb
@@ -54,8 +54,10 @@ module AASM::Core
end
def display_name
- @display_name ||= begin
- if Module.const_defined?(:I18n)
+ @display_name = begin
+ if @fixed_display_name
+ @fixed_display_name
+ elsif Module.const_defined?(:I18n)
localized_name
else
name.to_s.gsub(/_/, ' ').capitalize
@@ -75,8 +77,8 @@ module AASM::Core
private
def update(options = {})
- if options.key?(:display) then
- @display_name = options.delete(:display)
+ if options.key?(:display)
+ @fixed_display_name = options.delete(:display)
end
@options = options
self | Fixes #<I>
Remove memoization to avoid stale localized state name | aasm_aasm | train | rb |
885cbbfc27fddcbc5f3063aea29dd0b5cc4891bb | diff --git a/lib/dimples/writeable.rb b/lib/dimples/writeable.rb
index <HASH>..<HASH> 100644
--- a/lib/dimples/writeable.rb
+++ b/lib/dimples/writeable.rb
@@ -11,7 +11,7 @@ module Dimples
file.write(output)
end
rescue SystemCallError => e
- raise Errors::PublishingError.new(path, e.message)
+ raise Errors::PublishingError.new("Failed to write #{path}")
end
end
end | Switched to the simplified PublishingError class. | waferbaby_dimples | train | rb |
280726de2ec9d484e93fddb778e86666a1fb822e | diff --git a/UIUtils/conform/index.js b/UIUtils/conform/index.js
index <HASH>..<HASH> 100644
--- a/UIUtils/conform/index.js
+++ b/UIUtils/conform/index.js
@@ -1,5 +1,6 @@
import React from 'react';
import {findDOMNode} from 'react-dom';
+import {get} from 'lodash';
/**
* A testing module to verify that arbitrary React-supported attributes are passed
@@ -35,9 +36,9 @@ export default function verifyConformance(render, Constructor, baseProps, key) {
);
if (key) {
- return element[key] instanceof HTMLElement
- ? element[key]
- : findDOMNode(element[key]);
+ return get(element, key) instanceof HTMLElement
+ ? get(element, key)
+ : findDOMNode(get(element, key));
}
return findDOMNode(element); | Make UIUtils/conform use lodash.get() under the hood | enigma-io_boundless | train | js |
3a5ad2e966a4071d74fbf439873bf1f1f7669078 | diff --git a/src/Runtime/ClientRuntimeContext.php b/src/Runtime/ClientRuntimeContext.php
index <HASH>..<HASH> 100644
--- a/src/Runtime/ClientRuntimeContext.php
+++ b/src/Runtime/ClientRuntimeContext.php
@@ -196,6 +196,17 @@ class ClientRuntimeContext
}
/**
+ * Removes the pending request.
+ */
+ public function removePendingRequest()
+ {
+ if (!isset($this->pendingRequest)) {
+ return;
+ }
+ unset($this->pendingRequest);
+ }
+
+ /**
* @return Version
*/
public function getServerLibraryVersion(){ | Add method to remove the pending request of the client | vgrem_phpSPO | train | php |
1d3c167bfed70647e878e6b5449ff2712d300780 | diff --git a/release/ml_user_tests/tune_rllib/run_connect_tests.py b/release/ml_user_tests/tune_rllib/run_connect_tests.py
index <HASH>..<HASH> 100644
--- a/release/ml_user_tests/tune_rllib/run_connect_tests.py
+++ b/release/ml_user_tests/tune_rllib/run_connect_tests.py
@@ -19,7 +19,8 @@ if __name__ == "__main__":
ray.init(address="auto")
start_time = time.time()
- exp_analysis = run()
+ results = run()
+ exp_analysis = results._experiment_analysis
end_time = time.time()
result = {
diff --git a/rllib/examples/tune/framework.py b/rllib/examples/tune/framework.py
index <HASH>..<HASH> 100644
--- a/rllib/examples/tune/framework.py
+++ b/rllib/examples/tune/framework.py
@@ -38,7 +38,7 @@ def run(smoke_test=False):
# Run the experiment.
# TODO(jungong) : maybe add checkpointing.
- tune.Tuner(
+ return tune.Tuner(
"APPO",
param_space=config,
run_config=air.RunConfig( | [rllib/release] Fix rllib connect test with Tuner() API (#<I>)
Currently failing because the Tune framework example does not return fitting results. | ray-project_ray | train | py,py |
4155618bb89684ddab1816aba07f5f3fba56b81a | diff --git a/static/term.js b/static/term.js
index <HASH>..<HASH> 100644
--- a/static/term.js
+++ b/static/term.js
@@ -1184,7 +1184,8 @@ Terminal.prototype.write = function(data) {
case 1:
case 2:
if (this.params[1]) {
- this.handleTitle(this.params[1]);
+ this.title = this.params[1];
+ this.handleTitle(this.title);
}
break;
case 3: | have term.js set title. | IonicaBizau_web-term | train | js |
7394e9400bc82dd17f706fb375016052865f89a7 | diff --git a/test/test_shebang.rb b/test/test_shebang.rb
index <HASH>..<HASH> 100644
--- a/test/test_shebang.rb
+++ b/test/test_shebang.rb
@@ -38,6 +38,7 @@ class TestShebang < Minitest::Test
assert_interpreter "perl", "#! perl"
assert_interpreter "ruby", "#!/bin/sh\n\n\nexec ruby $0 $@"
- end
+ assert_interpreter "sh", "#! /usr/bin/env A=003 B=149 C=150 D=xzd E=base64 F=tar G=gz H=head I=tail sh"
+ end
end | Adding explicit test for new shebang parsing | github_linguist | train | rb |
99745943a3cfec664b4336c347b9ec29e9898f7c | diff --git a/tests/test_command_line.py b/tests/test_command_line.py
index <HASH>..<HASH> 100644
--- a/tests/test_command_line.py
+++ b/tests/test_command_line.py
@@ -225,7 +225,7 @@ class TestDebugCommand(object):
deployment.assert_called_once()
-@pytest.mark.usefixtures("bartlett_dir")
+@pytest.mark.usefixtures("bartlett_dir", "reset_sys_modules")
@pytest.mark.slow
class TestSandboxAndDeploy(object):
@pytest.fixture | Also reset sysmodules for sandbox deployment ftests | Dallinger_Dallinger | train | py |
38dfc10c88ece3448bb5a9f640b617e0f0209098 | diff --git a/lib/passenger/utils.rb b/lib/passenger/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/passenger/utils.rb
+++ b/lib/passenger/utils.rb
@@ -359,7 +359,7 @@ protected
"app_spawner_timeout" => -1
}
options = defaults.merge(options)
- options["lower_privilege"] = options["lower_privilege"] == "true"
+ options["lower_privilege"] = options["lower_privilege"].to_s == "true"
options["framework_spawner_timeout"] = options["framework_spawner_timeout"].to_i
options["app_spawner_timeout"] = options["app_spawner_timeout"].to_i
return options | Fix a security typo which causes all apps to be spawned as root. | phusion_passenger | train | rb |
f823f1c5a315cac71d207337b614161e6ca87bc6 | diff --git a/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js b/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js
+++ b/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js
@@ -228,7 +228,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery"],
that.clearSelection();
var _aSelectedContexts = this._aSelectedContexts;
jQuery.each(this.aContexts, function(iIndex, oContext) {
- if (((_aSelectedContexts ? this.aContexts.indexOf(oContext) : -1)) >= 0) {
+ if (((_aSelectedContexts ? _aSelectedContexts.indexOf(oContext) : -1)) >= 0) {
that.addSelectionInterval(iIndex, iIndex);
}
}); | [FIX] TreeBindingCompatibilityAdapter: Safe Array indexOf
The indexOf call for restoring the selction was previously done
on the wrong array, which was not defined in this function's scope.
Change-Id: I4c<I>a7d5e<I>ed<I>adce5bb8e7f<I>e<I>
BCP: <I> | SAP_openui5 | train | js |
62ae80eeaec37f1fe2f4c87d426198129d4f3526 | diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js
index <HASH>..<HASH> 100644
--- a/public/app/plugins/datasource/opentsdb/datasource.js
+++ b/public/app/plugins/datasource/opentsdb/datasource.js
@@ -97,7 +97,9 @@ function (angular, _, kbn) {
result = result.data.results;
var tagvs = [];
_.each(result, function(r) {
- tagvs.push(r.tags[key]);
+ if (tagvs.indexOf(r.tags[key]) === -1) {
+ tagvs.push(r.tags[key]);
+ }
});
return tagvs;
}); | deduplicate tag value suggestions for OpenTSDB | grafana_grafana | train | js |
7bf664497c225e965fc03ae6e0d40fa86c77b63c | diff --git a/src/private/utils.js b/src/private/utils.js
index <HASH>..<HASH> 100644
--- a/src/private/utils.js
+++ b/src/private/utils.js
@@ -5,8 +5,8 @@ export function isDescriptor(desc) {
const keys = ['value', 'get', 'set'];
- for (const key of keys) {
- if (desc.hasOwnProperty(key)) {
+ for (let i = 0, l = keys.length; i < l; i++) {
+ if (desc.hasOwnProperty(keys[i])) {
return true;
}
}
@@ -23,3 +23,20 @@ export function decorate(handleDescriptor, entryArgs) {
};
}
}
+
+class Meta {
+ debounceTimeoutIds = {};
+}
+
+const { defineProperty } = Object;
+
+export function metaFor(obj) {
+ if (obj.hasOwnProperty('__core_decorators__') === false) {
+ defineProperty(obj, '__core_decorators__', {
+ // Defaults: NOT enumerable, configurable, or writable
+ value: new Meta()
+ });
+ }
+
+ return obj.__core_decorators__;
+} | Don't use , fixes #<I>. Also includes new Meta/metaFor for per-instance state | jayphelps_core-decorators | train | js |
cb088ebd6b8b0ea3e10208252dd218b81ec072a7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
setup(
name='liveboxplaytv',
- version='1.5.1',
+ version='1.5.2',
license='GPL3',
description='Python bindings for the Orange Livebox Play TV appliance',
long_description=open('README.rst').read(),
@@ -11,7 +11,7 @@ setup(
author_email='philipp@schmitt.co',
url='https://github.com/pschmitt/python-liveboxplaytv',
packages=find_packages(),
- install_requires=['fuzzywuzzy', 'python-Levenshtein', 'pyteleloisirs',
+ install_requires=['fuzzywuzzy', 'python-Levenshtein', 'pyteleloisirs>=1.4',
'requests', 'wikipedia'],
entry_points={
'console_scripts': ['liveboxplaytv=liveboxplaytv.cli:main'] | Require an up to date version of pyteleloisirs | pschmitt_python-liveboxplaytv | train | py |
89a9ce7592df925fba1381c3fe67ec1c21e0ccd8 | diff --git a/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java b/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java
+++ b/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java
@@ -77,6 +77,12 @@ public class LanguageTest {
assertFalse(Language.getLanguageForShortName("de-CH").hasVariant());
assertFalse(Language.getLanguageForShortName("ast").hasVariant());
assertFalse(Language.getLanguageForShortName("pl").hasVariant());
+
+ for (Language language : Language.LANGUAGES) {
+ if (language.hasVariant()) {
+ assertNotNull("Language " + language + " needs a default variant", language.getDefaultVariant());
+ }
+ }
}
@Test | new test that asserts a default variant for languages with variants | languagetool-org_languagetool | train | java |
940015e67db004642df2bdf823e000eaa9ae0de9 | diff --git a/pmag_basic_dialogs.py b/pmag_basic_dialogs.py
index <HASH>..<HASH> 100755
--- a/pmag_basic_dialogs.py
+++ b/pmag_basic_dialogs.py
@@ -2717,7 +2717,14 @@ class check(wx.Frame):
except:
pass
# only use sites that are associated with actual samples/specimens
- ages_data_dict = {k: v for k, v in self.ErMagic.data_er_ages.items() if k in self.sites}
+
+
+ #ages_data_dict = {k: v for k, v in self.ErMagic.data_er_ages.items() if k in self.sites} # fails in Python 2.6
+ ages_data_dict = {}
+ for k, v in self.ErMagic.data_er_ages.items():
+ if k in self.sites:
+ ages_data_dict[k] = v
+
self.age_grid = self.make_simple_table(col_labels, ages_data_dict, "age")
#
# make it impossible to edit the 1st and 3rd columns | pmag_basic_dialogs: fix backwards compatibility problem from using dictionary comprehension | PmagPy_PmagPy | train | py |
9df56a831cc11f674af2eedb38b00807b42651a0 | diff --git a/auto_ml/_version.py b/auto_ml/_version.py
index <HASH>..<HASH> 100644
--- a/auto_ml/_version.py
+++ b/auto_ml/_version.py
@@ -1 +1 @@
-__version__ = "2.9.9"
+__version__ = "2.9.10" | <I> for training_features, and more flexibility in column_descriptions | ClimbsRocks_auto_ml | train | py |
6bda0a482cef0f195e6c661ef290d1d7ae835a9a | diff --git a/server/types/types.go b/server/types/types.go
index <HASH>..<HASH> 100644
--- a/server/types/types.go
+++ b/server/types/types.go
@@ -45,7 +45,7 @@ func NewErrorV1(code, f string, a ...interface{}) *ErrorV1 {
// This shall only used for debugging purpose.
func (e *ErrorV1) Error() string {
- return fmt.Sprintf("Code: %s, Message: %s", e.Code, e.Message)
+ return fmt.Sprintf("%s: %s", e.Code, e.Message)
}
// WithError updates e to include a detailed error. | server: Tweak server error string format
This just tweaks the error string format introduced in #<I> to be
consistent with other error strings in OPA (e.g., topdown, ast, etc.) | open-policy-agent_opa | train | go |
114aa4d95cee4d787b57f04e0e5b109d116e22f7 | diff --git a/src/heartbeat.js b/src/heartbeat.js
index <HASH>..<HASH> 100644
--- a/src/heartbeat.js
+++ b/src/heartbeat.js
@@ -32,6 +32,19 @@ function cpuUsage() {
};
}
+function getIPAddresses() {
+ const nets = os.networkInterfaces();
+ const addresses = []
+ for (const name in nets) {
+ for (const net of nets[name]) {
+ if (net.family === 'IPv4' && !net.internal) {
+ addresses.push(net.address);
+ }
+ }
+ }
+ return addresses;
+}
+
function getHeartBeatIndexName(queueName, consumerId) {
const ns = redisKeys.getNamespace();
return `${ns}|${queueName}|${consumerId}`;
@@ -59,6 +72,8 @@ function heartBeat(dispatcher) {
function beat() {
if (state === states.UP) {
const usage = {
+ ipAddress: getIPAddresses(),
+ hostname: os.hostname(),
pid: process.pid,
ram: {
usage: process.memoryUsage(), | Include hostname and IP address in consumer stats | weyoss_redis-smq | train | js |
8ec490daca978e077726d41a7cb8a4f57d04be01 | diff --git a/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java b/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
+++ b/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
@@ -354,10 +354,8 @@ public class ExtensionForcedUser extends ExtensionAdaptor implements ContextPane
// Note: Do not persist whether the 'Forced User Mode' is enabled as there's no need
// for this and the mode can be easily enabled/disabled directly
} else {
- // If we don't have a forced user, set an 'empty' list to force deletion of any
- // previous values
- session.setContextData(context.getIndex(), RecordContext.TYPE_FORCED_USER_ID,
- Collections.<String> emptyList());
+ // If we don't have a forced user, force deletion of any previous values
+ session.clearContextDataForType(context.getIndex(), RecordContext.TYPE_FORCED_USER_ID);
}
} catch (Exception e) {
log.error("Unable to persist forced user.", e); | Proper deletion of existing context data for ForcedUserExtension. | zaproxy_zaproxy | train | java |
6f8bc2de0b384144ee44a6ea5f05b82e38226b57 | diff --git a/app/models/effective/resources/relation.rb b/app/models/effective/resources/relation.rb
index <HASH>..<HASH> 100644
--- a/app/models/effective/resources/relation.rb
+++ b/app/models/effective/resources/relation.rb
@@ -209,15 +209,23 @@ module Effective
fuzzy = true unless fuzzy == false
- conditions = (
- if fuzzy
- columns.map { |name| "#{sql_column(name)} #{ilike} :fuzzy" }
- else
- columns.map { |name| "#{sql_column(name)} = :value" }
- end
- ).join(' OR ')
+ # Retval
+ searched = relation
+ terms = value.split(' ') - [nil, '']
+
+ terms.each do |term|
+ conditions = (
+ if fuzzy
+ columns.map { |name| "#{sql_column(name)} #{ilike} :fuzzy" }
+ else
+ columns.map { |name| "#{sql_column(name)} = :term" }
+ end
+ ).join(' OR ')
+
+ searched = searched.where(conditions, fuzzy: "%#{term}%", term: term)
+ end
- relation.where(conditions, fuzzy: "%#{value}%", value: value)
+ searched
end
private | Search by all terms in search_any | code-and-effect_effective_resources | train | rb |
4de29dca1c71468c293dd132b17f2bcb7a06c537 | diff --git a/src/shapes/poly.js b/src/shapes/poly.js
index <HASH>..<HASH> 100644
--- a/src/shapes/poly.js
+++ b/src/shapes/poly.js
@@ -111,7 +111,7 @@
// Calculate the edges/normals
for (i = 0; i < len; i++) {
var p1 = points[i];
- var p2 = i < len - 1 ? points[i + 1] : points[0];
+ var p2 = points[(i + 1) % len];
var e = new me.Vector2d().copy(p2).sub(p1);
var n = new me.Vector2d().copy(e).perp().normalize();
edges.push(e); | Small optimization in me.PolyShape.recalc() | melonjs_melonJS | train | js |
7a115785b73a17b8b07c4fcbb91d6b26a5083ba5 | diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java
index <HASH>..<HASH> 100644
--- a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java
+++ b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java
@@ -19,6 +19,7 @@ import com.google.gson.webservice.definition.ContentBodySpec;
import com.google.gson.webservice.definition.HeaderMap;
import com.google.gson.webservice.definition.HttpMethod;
import com.google.gson.webservice.definition.RequestBody;
+import com.google.gson.webservice.definition.TypedKey;
/**
* The data associated with a Web service request. This includes HTTP request header parameters
@@ -63,7 +64,11 @@ public final class RestRequest<R> {
public String getContentType() {
return ContentBodySpec.JSON_CONTENT_TYPE;
}
-
+
+ public <T> T getHeader(TypedKey<T> key) {
+ return headers.get(key);
+ }
+
@SuppressWarnings("unchecked")
public <T> T getHeader(String headerName) {
return (T) headers.get(headerName); | Added a getHeader method with a TypedKey in RestRequest. | google_gson | train | java |
998c65d2e2606a28e8df0f8cefcc3c44d306ef15 | diff --git a/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java b/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java
index <HASH>..<HASH> 100644
--- a/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java
+++ b/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java
@@ -99,6 +99,9 @@ public class OERPollingMarketDataService extends BasePollingExchangeService impl
// Request data
cachedOERTickers = openExchangeRates.getTickers(exchangeSpecification.getApiKey());
+ if (cachedOERTickers == null) {
+ throw new ExchangeException("Null response returned from Open Exchange Rates!");
+ }
}
Rates rates = cachedOERTickers.getRates(); | issue # <I>, added null check and throw ExchangeException | knowm_XChange | train | java |
3b385d8d9157952d8cb082e67bf955f49f8d62ed | diff --git a/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php b/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php
index <HASH>..<HASH> 100644
--- a/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php
+++ b/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php
@@ -276,7 +276,7 @@ class Workspace
*/
public function isInternalWorkspace()
{
- return $this->owner === null;
+ return $this->baseWorkspace !== null && $this->owner === null;
}
/** | Add additional check to isInternalWorkspace() | neos_neos-development-collection | train | php |
ebebce64838e6961906ecc325249d70076691514 | diff --git a/EventListener/StopwatchListener.php b/EventListener/StopwatchListener.php
index <HASH>..<HASH> 100644
--- a/EventListener/StopwatchListener.php
+++ b/EventListener/StopwatchListener.php
@@ -72,6 +72,8 @@ class StopwatchListener implements EventSubscriberInterface
*/
private function setHeader(Response $response, $stage, $duration)
{
+ // disallow non-alphanumeric characters in the header
+ $stage = preg_replace('/[^\d\w]/', '', $stage);
$headerName = 'X-API-RESPONSE-'.strtoupper($stage);
$response->headers->set($headerName, $duration);
} | Disallow non-alphanumeric characters in the header when adding stopwatch data | MovingImage24_VMProApiBundle | train | php |
712b38accbb4c75cfe0cce37a821c672e644d075 | diff --git a/Form/Type/BaseType.php b/Form/Type/BaseType.php
index <HASH>..<HASH> 100644
--- a/Form/Type/BaseType.php
+++ b/Form/Type/BaseType.php
@@ -65,7 +65,7 @@ class BaseType extends AbstractType
continue;
}
- $fieldOptions = $attr['options'];
+ $fieldOptions = $this->resolveFieldOptionValues($attr['options']);
if (!array_key_exists('label', $fieldOptions)) {
$fieldOptions['label'] = $translationPrefix.$field;
@@ -94,4 +94,29 @@ class BaseType extends AbstractType
{
return $this->meta->getFormTypeName();
}
+
+ /**
+ * @param array $options Field options
+ *
+ * @return array
+ */
+ private function resolveFieldOptionValues(array $options)
+ {
+ foreach ($options as &$value) {
+ if (!is_array($value)) {
+ continue;
+ }
+ if (is_callable($value)) {
+ $value = $value();
+
+ continue;
+ }
+
+ $value = $this->resolveFieldOptionValues($value);
+ }
+
+ unset($value);
+
+ return $options;
+ }
} | Base form field option now can be callable. | DarvinStudio_DarvinAdminBundle | train | php |
8d3a51d7c0fc0a2bbf80ec0c62831729a1397a49 | diff --git a/ayrton/tests/test_remote.py b/ayrton/tests/test_remote.py
index <HASH>..<HASH> 100644
--- a/ayrton/tests/test_remote.py
+++ b/ayrton/tests/test_remote.py
@@ -89,7 +89,7 @@ class DebugRemoteTests (RemoteTests):
server= socket (AF_INET, SOCK_STREAM)
server.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
- server.settimeout (3)
+ server.settimeout (1)
server.bind (('127.0.0.1', 2233))
server.listen () | [*] timeout down to 1s, so we can fail <I>% faster! | StyXman_ayrton | train | py |
dbf38aa61239b53dc53b88ea7428cd43b878135a | diff --git a/identify/extensions.py b/identify/extensions.py
index <HASH>..<HASH> 100644
--- a/identify/extensions.py
+++ b/identify/extensions.py
@@ -45,6 +45,7 @@ EXTENSIONS = {
'eyaml': {'text', 'yaml'},
'feature': {'text', 'gherkin'},
'fish': {'text', 'fish'},
+ 'gd': {'text', 'gdscript'},
'gemspec': {'text', 'ruby'},
'gif': {'binary', 'image', 'gif'},
'go': {'text', 'go'}, | Add gd extension for GDScript from Godot | chriskuehl_identify | train | py |
e2ec298912f096ebdbca4950dfde8b72ec399bc2 | diff --git a/src/Viewable.php b/src/Viewable.php
index <HASH>..<HASH> 100644
--- a/src/Viewable.php
+++ b/src/Viewable.php
@@ -90,16 +90,6 @@ trait Viewable
}
/**
- * Get the total number of views.
- *
- * @return void
- */
- public function removeViews()
- {
- app(ViewableService::class)->removeModelViews($this);
- }
-
- /**
* Retrieve records sorted by views.
*
* @param \Illuminate\Database\Eloquent\Builder $query | refactor: remove removeViews method from Viewable trait | cyrildewit_eloquent-viewable | train | php |
cd96993b38b419575e8e5bc600cde16eaa42ed00 | diff --git a/amino/data/list.py b/amino/data/list.py
index <HASH>..<HASH> 100644
--- a/amino/data/list.py
+++ b/amino/data/list.py
@@ -121,9 +121,11 @@ class List(Generic[A], typing.List[A], Implicits, implicits=True, metaclass=List
return maybe.Empty() if self.empty else maybe.Just(self[1:])
@property
- def detach_head(self) -> 'maybe.Maybe[Tuple[A, List[A]]]':
+ def uncons(self) -> 'maybe.Maybe[Tuple[A, List[A]]]':
return self.head.product(self.tail)
+ detach_head = uncons
+
@property
def detach_last(self) -> 'maybe.Maybe[Tuple[A, List[A]]]':
return self.last.product(self.init) | alias `List.detach_head` to `uncons` | tek_amino | train | py |
e02d99ebff576011599ba94f29b4cb2a51f90d8b | diff --git a/collector/interrupts_common.go b/collector/interrupts_common.go
index <HASH>..<HASH> 100644
--- a/collector/interrupts_common.go
+++ b/collector/interrupts_common.go
@@ -13,6 +13,7 @@
// +build !nointerrupts
// +build !darwin
+// +build !freebsd
package collector | Fix compilation on FreeBSD. Refs #<I>
There is no interrupts_freebsd.go implementation yet. | prometheus_node_exporter | train | go |
d0a55eed0c54917da8ed5fed18d1d5666d63d5a5 | diff --git a/modules/backend/lang/ro/lang.php b/modules/backend/lang/ro/lang.php
index <HASH>..<HASH> 100644
--- a/modules/backend/lang/ro/lang.php
+++ b/modules/backend/lang/ro/lang.php
@@ -191,6 +191,7 @@ return [
'code_folding' => 'Code folding',
'word_wrap' => 'Word wrap',
'highlight_active_line' => 'Evidentiere linie activa',
+ 'auto_closing' => 'Inchide automat tag-uri si caractere speciale',
'show_invisibles' => 'Arata caractere invizibile',
'show_gutter' => 'Afiseaza panou',
'theme' => 'Schema culori', | Auto closing option translation in Romanian
Translation for pull request #<I> | octobercms_october | train | php |
a38b5a8b2dc1acf54366c7a89caf7d27f45f2ab5 | diff --git a/common/src/main/java/tachyon/util/io/BufferUtils.java b/common/src/main/java/tachyon/util/io/BufferUtils.java
index <HASH>..<HASH> 100644
--- a/common/src/main/java/tachyon/util/io/BufferUtils.java
+++ b/common/src/main/java/tachyon/util/io/BufferUtils.java
@@ -15,6 +15,10 @@
package tachyon.util.io;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import tachyon.Constants;
+
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
@@ -26,6 +30,7 @@ import java.util.List;
* Utilities related to buffers, not only ByteBuffer.
*/
public class BufferUtils {
+ private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);
/**
* Force to unmap direct buffer if the buffer is no longer used. It is unsafe operation and
* currently a walk-around to avoid huge memory occupation caused by memory map.
@@ -45,6 +50,7 @@ public class BufferUtils {
cleaner.getClass().getMethod("clean").invoke(cleaner);
}
} catch (Exception e) {
+ LOG.warn("Fail to unmap direct buffer due to ", e);
buffer = null;
}
} | add log warning for non-oracle jvms that don't have a direct byte buffer cleaner implementation. | Alluxio_alluxio | train | java |
bc8742792cde5be62e22add01686a9c539e0f465 | diff --git a/python/ray/tune/checkpoint_manager.py b/python/ray/tune/checkpoint_manager.py
index <HASH>..<HASH> 100644
--- a/python/ray/tune/checkpoint_manager.py
+++ b/python/ray/tune/checkpoint_manager.py
@@ -188,8 +188,10 @@ class CheckpointManager:
except KeyError:
logger.error(
"Result dict has no key: {}. "
- "checkpoint_score_attr must be set to a key in the "
- "result dict.".format(self._checkpoint_score_attr)
+ "checkpoint_score_attr must be set to a key of the "
+ "result dict. Valid keys are {}".format(
+ self._checkpoint_score_attr, list(checkpoint.result.keys())
+ )
)
return
diff --git a/python/ray/tune/trial.py b/python/ray/tune/trial.py
index <HASH>..<HASH> 100644
--- a/python/ray/tune/trial.py
+++ b/python/ray/tune/trial.py
@@ -618,9 +618,8 @@ class Trial:
for criteria, stop_value in self.stopping_criterion.items():
if criteria not in result:
raise TuneError(
- "Stopping criteria {} not provided in result {}.".format(
- criteria, result
- )
+ "Stopping criteria {} not provided in result dict. Keys "
+ "are {}.".format(criteria, list(result.keys()))
)
elif isinstance(criteria, dict):
raise ValueError( | [Tune] Logging of bad results dict keys (#<I>)
[User complains](<URL>) about logging on failure of locating `checkpoint_score_attr ` in results dict not being informative.
I propose that we log the actual results dict keys and extended stopping criteria, which imho should not log the whole result dict as this might contain tensors.
Maybe there are other similar cases in tune library, in which I don't know my way around that good. | ray-project_ray | train | py,py |
07585392abc08fa1000828e6d120c0550bcbf350 | diff --git a/src/ResizableDraggableDialog/index.js b/src/ResizableDraggableDialog/index.js
index <HASH>..<HASH> 100644
--- a/src/ResizableDraggableDialog/index.js
+++ b/src/ResizableDraggableDialog/index.js
@@ -27,6 +27,7 @@ export default function ResizableDraggableDialog({
topLeft: true,
topRight: true
}}
+ bounds={"body"}
default={{
x: Math.max((windowWidth - defaultDialogWidth) / 2, 0),
y: Math.max((windowHeight - defaultDialogHeight) / 2, 0), | fixing bounds of ResizableDraggableDialog | TeselaGen_teselagen-react-components | train | js |
0eb542c742e7b0b417a0d51cda08e427f7e06790 | diff --git a/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php b/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php
index <HASH>..<HASH> 100644
--- a/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php
+++ b/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php
@@ -97,7 +97,7 @@ class Kwc_Basic_ImageEnlarge_EnlargeTag_Trl_Component extends Kwc_Chained_Trl_Co
return null;
}
- private function _getImageEnlargeComponent()
+ protected function _getImageEnlargeComponent()
{
$d = $this->getData();
while (!is_instance_of($d->componentClass, 'Kwc_Basic_ImageEnlarge_Trl_Component')) { | Change getImageEnlargeComponent function to protected
this is needed to override this function to provide a different
image | koala-framework_koala-framework | train | php |
330bf8c3f7d9fb664b1080b24cda64b9406038cb | diff --git a/myfitnesspal/meal.py b/myfitnesspal/meal.py
index <HASH>..<HASH> 100644
--- a/myfitnesspal/meal.py
+++ b/myfitnesspal/meal.py
@@ -28,8 +28,9 @@ class Meal(MFPBase):
for entry in self.entries:
for k, v in entry.nutrition_information.items():
if k not in nutrition:
- nutrition[k] = 0
- nutrition[k] += v
+ nutrition[k] = v
+ else:
+ nutrition[k] += v
return nutrition | Fixing nutrition totals per-day. | coddingtonbear_python-myfitnesspal | train | py |
eaa9452bb6f3466a95cc5905b4e4b904695240e7 | diff --git a/lib/fileSystem.js b/lib/fileSystem.js
index <HASH>..<HASH> 100755
--- a/lib/fileSystem.js
+++ b/lib/fileSystem.js
@@ -343,13 +343,9 @@ module.exports.copy = function(sourcePath, destinationSourcePath, callback) {
* @param {Function} callback The function to call when done
* - **Error** The error if an error occurred, null otherwise
* - **String** The file content or null if an error occurred
- * @throws {Error} An error if callback is not speficied
+ * @throws {TypeError} An error if callback is not speficied
*/
module.exports.getJSONFileContent = function(filePath, callback) {
- callback = callback || function(error) {
- throw error || new Error('Missing getJSONFileContent callback');
- };
-
if (!filePath)
return callback(new TypeError('Invalid file path, expected a string'));
@@ -383,7 +379,6 @@ module.exports.getJSONFileContent = function(filePath, callback) {
callback(new Error('Missing file ' + filePath));
});
-
};
/** | Remove default callback on fileSystem.getJSONFileConent method
A default callback implementation was handling errors and throwing an exception according to the error given to the callback function. It may be confusing to throw different exceptions, it now let NodeJS throw a TypeError in case the callback is not defined. | veo-labs_openveo-api | train | js |
1bee071241ba89684555840ab248ff2b50054604 | diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -27,6 +27,7 @@ public class BasicTest {
new IntegratedVariableByte()),
new JustCopy(),
new VariableByte(),
+ new GroupSimple9(),
new IntegratedVariableByte(),
new Composition(new BinaryPacking(), new VariableByte()),
new Composition(new NewPFD(), new VariableByte()), | Adding GroupSimple9 to tests. | lemire_JavaFastPFOR | train | java |
b8cab527c83dd2df4897bcc6db8e7f04d0dcd874 | diff --git a/Kwc/Form/Decorator/Label.php b/Kwc/Form/Decorator/Label.php
index <HASH>..<HASH> 100644
--- a/Kwc/Form/Decorator/Label.php
+++ b/Kwc/Form/Decorator/Label.php
@@ -64,8 +64,10 @@ class Kwc_Form_Decorator_Label extends Kwc_Form_Decorator_Abstract
}
if ($item['item']->getFieldLabel()) {
$preHtml .= $item['item']->getLabelSeparator();
+ } else {
+ $preHtml .= ' ';
}
- $preHtml .= ' </label>';
+ $preHtml .= '</label>';
}
$postHtml = '';
if ($item['item'] && $item['item']->getComment()) { | form label decorator: insert nbsp; only when there is no label | koala-framework_koala-framework | train | php |
f223101539f9e815cfc7595e4a160f83d35187a3 | diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Format/KML.js
+++ b/lib/OpenLayers/Format/KML.js
@@ -214,7 +214,8 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
"coordinates");
var line = null;
if(nodeList.length > 0) {
- var coordString = nodeList[0].firstChild.nodeValue;
+ var coordString = this.concatChildValues(nodeList[0]);
+
coordString = coordString.replace(this.regExes.trimSpace,
"");
coordString = coordString.replace(this.regExes.trimComma, | Apply a fix to KML format to support > 4k characters in a linestring.
(Closes #<I>)
git-svn-id: <URL> | openlayers_openlayers | train | js |
053439ca702d45551003a16f75188387330af564 | diff --git a/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php b/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php
index <HASH>..<HASH> 100644
--- a/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php
+++ b/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php
@@ -47,8 +47,8 @@ class ExpressCompletePurchaseRequest extends AbstractRequest
unset($params['sign']);
unset($params['sign_type']);
unset($params['notify_id']);
- ksort($data);
- reset($data);
+ ksort($params);
+ reset($params);
return $params;
} | rename data to params | lokielse_omnipay-alipay | train | php |
aa4dade4affb201a36a9e4d74f86f4dd4e2eb3cf | diff --git a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
index <HASH>..<HASH> 100644
--- a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
+++ b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
@@ -470,7 +470,6 @@ public class HttpRequest {
*/
public static class HttpRequestException extends RuntimeException {
- /** serialVersionUID */
private static final long serialVersionUID = -1170466989781746231L;
/** | Remove comment on private serialization constant
This comment previously just repeated the variable name | kevinsawicki_http-request | train | java |
a13945e42933aa7e82c8e976e3d91aa1ae2d7596 | diff --git a/src/Opulence/Sessions/Handlers/FileSessionHandler.php b/src/Opulence/Sessions/Handlers/FileSessionHandler.php
index <HASH>..<HASH> 100644
--- a/src/Opulence/Sessions/Handlers/FileSessionHandler.php
+++ b/src/Opulence/Sessions/Handlers/FileSessionHandler.php
@@ -51,10 +51,10 @@ class FileSessionHandler extends SessionHandler
{
$sessionFiles = glob($this->path . "/*");
+ $limit = time() - $maxLifetime;
foreach ($sessionFiles as $sessionFile) {
- $lastModified = DateTime::createFromFormat("U", filemtime($sessionFile));
-
- if (new DateTime("$maxLifetime seconds ago") > $lastModified) {
+ $lastModified = filemtime($sessionFile);
+ if ($lastModified < $limit) {
@unlink($sessionFile);
}
} | Optimize session GC
Constructing two datetime objects for a couple ten thousand session
files is extremely expensive, to the point where it dominates
execution time.
Use a simple unix timestamp comparison instead. | opulencephp_Opulence | train | php |
cda4a7080e236b837383d1ffb8c13b46dae87e2c | diff --git a/tasks/bump.js b/tasks/bump.js
index <HASH>..<HASH> 100644
--- a/tasks/bump.js
+++ b/tasks/bump.js
@@ -1,11 +1,3 @@
-/*
- * grunt-contrib-bump
- * http://gruntjs.com/
- *
- * Copyright (c) 2013 "Cowboy" Ben Alman, contributors
- * Licensed under the MIT license.
- */
-
'use strict';
var semver = require('semver');
@@ -47,7 +39,7 @@ module.exports = function(grunt) {
tagName: 'v{%= version %}',
tagMessage: 'Version {%= version %}',
tagPrerelease: false,
- updateDate: true,
+ updateDate: true
});
// Normalize filepaths to array.
var filepaths = Array.isArray(options.filepaths) ? options.filepaths : [options.filepaths];
@@ -130,7 +122,7 @@ module.exports = function(grunt) {
function processTemplate(message, data) {
return grunt.template.process(message, {
delimiters: 'bump',
- data: data,
+ data: data
});
} | chore: Remove old boilerplate headers
New headers coming soon! | iVantage_grunt-svn-bump | train | js |
cf9d7c0e62c4c50148c38a9c9a1fa9e81fab577b | diff --git a/lib/util/index.js b/lib/util/index.js
index <HASH>..<HASH> 100644
--- a/lib/util/index.js
+++ b/lib/util/index.js
@@ -538,8 +538,8 @@ var interfaceData = [hostname, os.platform(), os.release(),
})();
var clientId = crypto.createHmac('sha256', 'x-whistle-client-id')
- .update(interfaceData.join('\r\n')).digest('hex')
- + Math.floor(Math.random() * 1000000).toString(16);
+ .update(interfaceData.join('\r\n')).digest('hex');
+
exports.setClientId = function(headers, enable) {
if (enable && (enable.clientId || enable.clientID || enable.clientid)) {
headers['x-whistle-client-id'] = clientId; | refactor: generate client id by os.networkInterfaces() | avwo_whistle | train | js |
c29451542d9752af6690b0440595f08783f20d3a | diff --git a/txmongo/collection.py b/txmongo/collection.py
index <HASH>..<HASH> 100644
--- a/txmongo/collection.py
+++ b/txmongo/collection.py
@@ -158,6 +158,14 @@ class Collection(object):
defer.returnValue([d.decode(as_class=as_class) for d in documents])
def find_with_cursor(self, spec=None, skip=0, limit=0, fields=None, filter=None, **kwargs):
+ ''' find method that uses the cursor to only return a block of
+ results at a time.
+ Arguments are the same as with find()
+ returns deferred that results in a tuple: (docs, deferred) where
+ docs are the current page of results and deferred results in the next
+ tuple. When the cursor is exhausted, it will return the tuple
+ ([], None)
+ '''
if spec is None:
spec = SON() | Added docstring to the find_with_cursor method | twisted_txmongo | train | py |
469d0b093c69ea542c0a63a499b5395b7d8544d6 | diff --git a/lib/neo4j/extensions/rest/rest_mixin.rb b/lib/neo4j/extensions/rest/rest_mixin.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/extensions/rest/rest_mixin.rb
+++ b/lib/neo4j/extensions/rest/rest_mixin.rb
@@ -49,7 +49,8 @@ module Neo4j
# Explicitly index the classname of a node (required for <code>GET /nodes/MyClass</code>
# Lucene search to work).
self.class.indexer.on_property_changed(self, 'classname') # TODO reuse the event_handler instead !
- Neo4j.event_handler.property_changed(self, 'classname', '', self.class.to_s)
+ # This caused the replication_spec.rb to fail
+ # Neo4j.event_handler.property_changed(self, 'classname', '', self.class.to_s)
end
# Called by the REST API if this node is accessed directly by ID. Any query parameters | Merged with ept/neo4j/master branch
Should not send out events on classname changed.
This caused the replication_spec.rb to fail | neo4jrb_neo4j | train | rb |
48d2a35034983e8463935240c4079649e7e8241c | diff --git a/state/migration_import.go b/state/migration_import.go
index <HASH>..<HASH> 100644
--- a/state/migration_import.go
+++ b/state/migration_import.go
@@ -568,19 +568,16 @@ func (i *importer) machinePortsOp(m description.Machine) txn.Op {
func (i *importer) machineInstanceOp(mdoc *machineDoc, inst description.CloudInstance) txn.Op {
doc := &instanceData{
- DocID: mdoc.DocID,
- MachineId: mdoc.Id,
- InstanceId: instance.Id(inst.InstanceId()),
- ModelUUID: mdoc.ModelUUID,
+ DocID: mdoc.DocID,
+ MachineId: mdoc.Id,
+ InstanceId: instance.Id(inst.InstanceId()),
+ DisplayName: inst.DisplayName(),
+ ModelUUID: mdoc.ModelUUID,
}
if arch := inst.Architecture(); arch != "" {
doc.Arch = &arch
}
- if displayName := inst.DisplayName(); displayName != "" {
- doc.DisplayName = displayName
- }
-
if mem := inst.Memory(); mem != 0 {
doc.Mem = &mem
} | Optimize code a bit
DisplayName field is not a pointer, nor omitempty, so no need to check
creating extra variables | juju_juju | train | go |
980f777ca4afc2fffc48f54ef2f0a9b76abc868e | diff --git a/db/seeds.rb b/db/seeds.rb
index <HASH>..<HASH> 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -42,14 +42,14 @@ throw "Are you sure you cleared candlepin! unable to create first org!" if first
#create a provider
if Provider.count == 0
porkchop = Provider.create!({
- :name => 'porkchop',
+ :name => 'Custom Provider 1',
:organization => first_org,
:repository_url => 'http://download.fedoraproject.org/pub/fedora/linux/releases/',
:provider_type => Provider::CUSTOM
})
Provider.create!({
- :name => 'redhat',
+ :name => 'Red Hat',
:organization => first_org,
:repository_url => 'https://somehost.example.com/content/',
:provider_type => Provider::REDHAT | renaming the 2 providers to something more useful
no reason to call the custom provider 'porkchop' anymore. has no
meaning to our users. | Katello_katello | train | rb |
31ddeb8c3af2dba5b357fea4da67d99274f51c65 | diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php
index <HASH>..<HASH> 100755
--- a/tests/TestCase/View/Helper/FormHelperTest.php
+++ b/tests/TestCase/View/Helper/FormHelperTest.php
@@ -4098,7 +4098,7 @@ class FormHelperTest extends TestCase {
array('select' => array('name' => 'Contact[date][hour]')),
$hoursRegex,
array('option' => array('value' => date('H', $now), 'selected' => 'selected')),
- date('H', $now),
+ date('G', $now),
'/option',
'*/select', | Hours should not include leading 0s. | cakephp_cakephp | train | php |
35e82ceae764048aab3a92c92e4fcfebb624e4fd | diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -44,7 +44,7 @@ def setup():
if PROJECT_NAME in projlist:
logger.warn('The test database existed already. We have to clean it up.')
- PROJECT.delete()
+ ROOT_CLIENT.delete(USERNAME + '/projects', project=PROJECT_NAME)
# create the project
logger.info("Creating project: "+PROJECT_NAME)
@@ -123,7 +123,7 @@ def teardown():
Pack everything up, we're done.
"""
if ROOT_CLIENT is not None:
- ROOT_CLIENT.delete(USERNAME + '/projects/' + PROJECT_NAME)
+ ROOT_CLIENT.delete(USERNAME + '/projects', project=PROJECT_NAME)
PROJECT = ROOT_CLIENT.change_path(USERNAME + '/projects/' + PROJECT_NAME)
try:
got = PROJECT.get() | use the new delete endpoint in client testing | LuminosoInsight_luminoso-api-client-python | train | py |
cab3192384bc7605a6f8f11b90d687e2750020db | diff --git a/psphere/managedobjects.py b/psphere/managedobjects.py
index <HASH>..<HASH> 100644
--- a/psphere/managedobjects.py
+++ b/psphere/managedobjects.py
@@ -362,7 +362,8 @@ class ManagedEntity(ExtensibleManagedObject):
:returns: A list of ManagedEntity's matching the filter or None
:rtype: list
"""
- return server.find_entity_views(view_type=cls.__name__, filter=filter)
+ # TODO: Implement filter for this find method
+ return server.find_entity_views(view_type=cls.__name__)
@classmethod
def find_one(cls, server, filter=None): | Don't pass filter to find_entity_views as it isn't implemented yet. | psphere-project_psphere | train | py |
d49061e10d3baf9b7b2b051ade338bc2daf29c0f | diff --git a/turnstile/control.py b/turnstile/control.py
index <HASH>..<HASH> 100644
--- a/turnstile/control.py
+++ b/turnstile/control.py
@@ -196,7 +196,7 @@ class ControlDaemon(object):
continue
# Execute the desired command
- arglist = args.split(':')
+ arglist = args.split(':') if args else []
try:
func(self, *arglist)
except Exception: | Correct a long-standing bug
Commands with no arguments would still receive an empty argument.
Corrected this by setting arglist to [] if args is unset. | klmitch_turnstile | train | py |
36114e1847ff524d62eab15dfccd822de53753e7 | diff --git a/osx/versions.go b/osx/versions.go
index <HASH>..<HASH> 100644
--- a/osx/versions.go
+++ b/osx/versions.go
@@ -1,6 +1,11 @@
package osx
var versions = map[string]map[string]string{
+ "16.1.0": map[string]string{
+ "name": "Sierra",
+ "version": "10.12.1",
+ },
+
"16.0.0": map[string]string{
"name": "Sierra",
"version": "10.12.0", | Add support for Sierra <I> | markelog_release | train | go |
1baaa9caff6578e246cec0234821b6587563e97d | diff --git a/flask_uwsgi_websocket/websocket.py b/flask_uwsgi_websocket/websocket.py
index <HASH>..<HASH> 100644
--- a/flask_uwsgi_websocket/websocket.py
+++ b/flask_uwsgi_websocket/websocket.py
@@ -87,13 +87,12 @@ class WebSocket(object):
uwsgi_args = ' '.join(['--{0} {1}'.format(k,v) for k,v in kwargs.items()])
args = 'uwsgi --http {0}:{1} --http-websockets {2} --wsgi {3}'.format(host, port, uwsgi_args, app)
- print(args)
-
# set enviromental variable to trigger adding debug middleware
if self.app.debug or debug:
args = 'FLASK_UWSGI_DEBUG=true {0} --python-autoreload 1'.format(args)
# run uwsgi with our args
+ print('Running: {0}'.format(args))
sys.exit(os.system(args))
def init_app(self, app): | Move print to include ENV & autoreload | zeekay_flask-uwsgi-websocket | train | py |
aa48ae2296069ee13f6efa6290c682e88fd4c17c | diff --git a/test/root-no-tests.js b/test/root-no-tests.js
index <HASH>..<HASH> 100644
--- a/test/root-no-tests.js
+++ b/test/root-no-tests.js
@@ -1,6 +1,6 @@
// verify that just loading tap doesn't cause it to
// print out some TAP stuff, unless an actual thing happens.
-var t = require('tap')
+var t = require('../')
var spawn = require('child_process').spawn
switch (process.argv[2]) { | test: don't require('tap'), require('../')
For CI | tapjs_node-tap | train | js |
0c9b917371498c5c60ecd2d55832efd82480b722 | diff --git a/packages/embark/src/cmd/cmd_controller.js b/packages/embark/src/cmd/cmd_controller.js
index <HASH>..<HASH> 100644
--- a/packages/embark/src/cmd/cmd_controller.js
+++ b/packages/embark/src/cmd/cmd_controller.js
@@ -303,7 +303,6 @@ class EmbarkController {
if (!options.onlyCompile) {
engine.registerModulePackage('embark-ganache');
- engine.registerModuleGroup("pipeline");
engine.registerModuleGroup("namesystem");
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
} | fix(@embark/cmd_controller): don't try to load pipeline module group in build cmd
We've made the `basic-pipeline` optional in <URL> | embark-framework_embark | train | js |
92344a7c270e567f454bec287899ab1362befdba | diff --git a/d1_common_python/src/d1_common/util.py b/d1_common_python/src/d1_common/util.py
index <HASH>..<HASH> 100644
--- a/d1_common_python/src/d1_common/util.py
+++ b/d1_common_python/src/d1_common/util.py
@@ -20,9 +20,35 @@
# limitations under the License.
import email.message
+from urllib import quote
+import const
def get_content_type(content_type):
m = email.message.Message()
m['Content-Type'] = content_type
return m.get_content_type()
+
+
+def encodePathElement(element):
+ '''Encodes a URL path element according to RFC3986.
+
+ :param element: The path element to encode for transmission in a URL.
+ :type element: Unicode
+ :return: URL encoded path element
+ :return type: UTF-8 encoded string.
+ '''
+ return quote(element.encode('utf-8'), \
+ safe=const.URL_PATHELEMENT_SAFE_CHARS)
+
+
+def encodeQueryElement(element):
+ '''Encodes a URL query element according to RFC3986.
+
+ :param element: The query element to encode for transmission in a URL.
+ :type element: Unicode
+ :return: URL encoded query element
+ :return type: UTF-8 encoded string.
+ '''
+ return quote(element.encode('utf-8'), \
+ safe=const.URL_QUERYELEMENT_SAFE_CHARS) | added encodePathElement and encodeQueryElement to d1_common.utils as these should be widely used for all encoding operations in the DataONE python code. | DataONEorg_d1_python | train | py |
6c8c5b2f21af6f13729936465ada4d1ceaa2f99c | diff --git a/lib/sawyer/relation.rb b/lib/sawyer/relation.rb
index <HASH>..<HASH> 100644
--- a/lib/sawyer/relation.rb
+++ b/lib/sawyer/relation.rb
@@ -82,7 +82,12 @@ module Sawyer
#
# Returns a Relation.
def self.from_link(agent, name, options)
- new agent, name, options[:href], options[:method]
+ case options
+ when Hash
+ new agent, name, options[:href], options[:method]
+ when String
+ new agent, name, options
+ end
end
# A Relation represents an available next action for a resource.
diff --git a/test/relation_test.rb b/test/relation_test.rb
index <HASH>..<HASH> 100644
--- a/test/relation_test.rb
+++ b/test/relation_test.rb
@@ -28,6 +28,23 @@ module Sawyer
assert_kind_of URITemplate, rel.href_template
end
+ def test_builds_rels_from_hash
+ index = {
+ 'self' => '/users/1'
+ }
+
+ rels = Sawyer::Relation.from_links(nil, index)
+
+ assert_equal 1, rels.size
+ assert_equal [:self], rels.keys
+ assert rel = rels[:self]
+ assert_equal :self, rel.name
+ assert_equal '/users/1', rel.href
+ assert_equal :get, rel.method
+ assert_equal [:get], rel.available_methods.to_a
+ assert_kind_of URITemplate, rel.href_template
+ end
+
def test_builds_rels_from_hash_index
index = {
'self' => {:href => '/users/1'} | Handle simplified HAL link hashes | lostisland_sawyer | train | rb,rb |
8c5e5d5025e447e8784e923750c23357daae686a | diff --git a/ginga/canvas/types/astro.py b/ginga/canvas/types/astro.py
index <HASH>..<HASH> 100644
--- a/ginga/canvas/types/astro.py
+++ b/ginga/canvas/types/astro.py
@@ -500,10 +500,18 @@ class Crosshair(OnePointMixin, CanvasObjectBase):
# NOTE: x, y are assumed to be in data coordinates
info = image.info_xy(self.x, self.y, viewer.get_settings())
if self.format == 'coords':
- text = "%s:%s, %s:%s" % (info.ra_lbl, info.ra_txt,
- info.dec_lbl, info.dec_txt)
+ if not 'ra_lbl' in info:
+ text = 'No WCS'
+ else:
+ text = "%s:%s, %s:%s" % (info.ra_lbl, info.ra_txt,
+ info.dec_lbl, info.dec_txt)
else:
- text = "V: %f" % (info.value)
+ if len(info.value) > 1:
+ values = ', '.join(["%d" % info.value[i]
+ for i in range(len(info.value))])
+ text = "V: [%s]" % (str(values))
+ else:
+ text = "V: %f" % (info.value)
else:
text = self.text | Fix for Crosshair canvas type for images with bad WCS | ejeschke_ginga | train | py |
08ebdf42036178c3fd833ae3c0ede41e03bcfde1 | diff --git a/simulator/src/test/java/com/hazelcast/simulator/coordinator/CoordinatorCliTest.java b/simulator/src/test/java/com/hazelcast/simulator/coordinator/CoordinatorCliTest.java
index <HASH>..<HASH> 100644
--- a/simulator/src/test/java/com/hazelcast/simulator/coordinator/CoordinatorCliTest.java
+++ b/simulator/src/test/java/com/hazelcast/simulator/coordinator/CoordinatorCliTest.java
@@ -52,7 +52,7 @@ public class CoordinatorCliTest {
private static File propertiesFile;
private final List<String> args = new ArrayList<String>();
- private String testSuiteId;
+ private String sessionId;
@BeforeClass
public static void beforeClass() throws Exception {
@@ -68,8 +68,8 @@ public class CoordinatorCliTest {
@Before
public void before(){
args.add("--sessionId");
- testSuiteId = "CoordinatorCliTest-" + System.currentTimeMillis();
- args.add(testSuiteId);
+ sessionId = "CoordinatorCliTest-" + System.currentTimeMillis();
+ args.add(sessionId);
}
@AfterClass
@@ -83,7 +83,7 @@ public class CoordinatorCliTest {
@After
public void after() {
- deleteQuiet(new File(testSuiteId).getAbsoluteFile());
+ deleteQuiet(new File(sessionId).getAbsoluteFile());
}
@Test | Fixed forgotten renaming in CoordinatorCliTest. | hazelcast_hazelcast-simulator | train | java |
c7e609084e38470987eb9debf08c4bc5ebea0ffa | diff --git a/lib/ddplugin/registry.rb b/lib/ddplugin/registry.rb
index <HASH>..<HASH> 100644
--- a/lib/ddplugin/registry.rb
+++ b/lib/ddplugin/registry.rb
@@ -64,7 +64,7 @@ module DDPlugin
# @return [Enumerable<Class>] A collection of registered classes
def find_all(root_class)
@identifiers_to_classes[root_class] ||= {}
- @identifiers_to_classes[root_class].values
+ @identifiers_to_classes[root_class].values.uniq
end
end
end
diff --git a/test/test_plugin.rb b/test/test_plugin.rb
index <HASH>..<HASH> 100644
--- a/test/test_plugin.rb
+++ b/test/test_plugin.rb
@@ -73,4 +73,17 @@ class DDPlugin::PluginTest < Minitest::Test
assert_equal [klass1, klass2], AllSample.all
end
+
+ def test_all_with_multiple_identifiers
+ parent_class = Class.new { extend DDPlugin::Plugin }
+
+ klass1 = Class.new(parent_class)
+ klass1.identifier :one_a
+ klass1.identifier :one_b
+
+ klass2 = Class.new(parent_class)
+ klass2.identifier :two
+
+ assert_equal [klass1, klass2], parent_class.all
+ end
end | Prevent #find_all from returning duplicates | ddfreyne_ddplugin | train | rb,rb |
292bcaf636a964c2b0abd60091d745d532a49918 | diff --git a/go/libkb/api.go b/go/libkb/api.go
index <HASH>..<HASH> 100644
--- a/go/libkb/api.go
+++ b/go/libkb/api.go
@@ -13,6 +13,7 @@ import (
"net/http"
"net/url"
"runtime"
+ "runtime/debug"
"strings"
"sync"
"time"
@@ -231,6 +232,7 @@ func doRequestShared(api Requester, arg APIArg, req *http.Request, wantJSONRes b
}
ctx = WithLogTag(ctx, "API")
api.G().Log.CDebugf(ctx, "+ API %s %s", req.Method, req.URL)
+ debug.PrintStack()
var jsonBytes int
var status string | WIP print stack on api calls | keybase_client | train | go |
091b03748ddbed10f271c176863e78cb8c323e6e | diff --git a/py/selenium/webdriver/remote/webdriver.py b/py/selenium/webdriver/remote/webdriver.py
index <HASH>..<HASH> 100755
--- a/py/selenium/webdriver/remote/webdriver.py
+++ b/py/selenium/webdriver/remote/webdriver.py
@@ -455,7 +455,7 @@ class WebDriver(object):
:Usage:
driver.page_source
"""
- return self.execute(Command.GET_PAGE_SOURCE)['value']
+ return self.execute_script("return document.documentElement.outerHTML;")
def close(self):
""" | Switch getPageSource to use executeScript as discussed on W3C WebDriver mailing list | SeleniumHQ_selenium | train | py |
08cd2e4357a6c947e7a6c285d8e742fee74ec5b4 | diff --git a/lib/god/simple_logger.rb b/lib/god/simple_logger.rb
index <HASH>..<HASH> 100644
--- a/lib/god/simple_logger.rb
+++ b/lib/god/simple_logger.rb
@@ -26,7 +26,7 @@ module God
time = Time.now.strftime(self.datetime_format)
label = SEV_LABEL[level]
- @io.print("#{label[0..0]} [#{time}] #{label.rjust(5)}: #{msg}\n")
+ @io.print(label[0..0], ' [', time, '] ', label.rjust(5), ': ', msg, "\n")
end
def fatal(msg)
@@ -50,4 +50,4 @@ module God
end
end
-end
\ No newline at end of file
+end | Changing the @io.print call in SimpleLogger to not concatenate
the formatted results before printing. | mojombo_god | train | rb |
ae6a4c16c71fce1a33b45929bfe8b442fed5082c | diff --git a/src/utils/Sorter.js b/src/utils/Sorter.js
index <HASH>..<HASH> 100644
--- a/src/utils/Sorter.js
+++ b/src/utils/Sorter.js
@@ -905,7 +905,7 @@ module.exports = Backbone.View.extend({
* */
endMove(e) {
var created;
- const moved = [];
+ const moved = [null];
const docs = this.getDocuments();
const container = this.getContainerEl();
const onEndMove = this.onEndMove; | Make sure to always execute onEndMove in Sorter | artf_grapesjs | train | js |
8f107d3c6d6eafffb29218c2d880f0bd99f39b88 | diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -452,7 +452,7 @@ module Puppet
a file (such as manifests or templates) has changed on disk. #{AS_DURATION}",
},
:environment_timeout => {
- :default => "3m",
+ :default => "0",
:type => :ttl,
:desc => "The time to live for a cached environment.
#{AS_DURATION} | (PUP-<I>) Set the default environment timeout to 0
This sets the default environment timeout to 0 as per decision
made in PUP-<I>. | puppetlabs_puppet | train | rb |
8cf98fee6c2b6df476a743ac0e2508c8b092ecf7 | diff --git a/chef/lib/chef/file_access_control.rb b/chef/lib/chef/file_access_control.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/file_access_control.rb
+++ b/chef/lib/chef/file_access_control.rb
@@ -25,7 +25,7 @@ class Chef
# the values specified by a value object, usually a Chef::Resource.
class FileAccessControl
UINT = (1 << 32)
- UID_MAX = (1 << 30)
+ UID_MAX = (1 << 31)
attr_reader :resource | Only UIDs above 2^<I> are considered negative, not those over 2^<I> | chef_chef | train | rb |
eb9a755fff5de708b3230bc999e053769e343544 | diff --git a/erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js b/erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js
index <HASH>..<HASH> 100644
--- a/erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js
+++ b/erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js
@@ -255,7 +255,7 @@ const BaseStack = (specInput) => {
return sdpInput;
};
- that.setSimulcastLayerBitrate = () => {
+ that.setSimulcastLayersBitrate = () => {
Logger.error('Simulcast not implemented');
}; | Minor typo issue (#<I>) | lynckia_licode | train | js |
b2c254edc2fbae850a612c0175798533fadafec5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,7 @@ setup(
"ukpostcodeparser>=1.1.1",
"mock",
"pytest>=3.8.0,<3.9",
- "more-itertools<6.0.0",
+ "more-itertools<6.0.0 ; python_version < '3.0'",
"random2==1.0.1",
"freezegun==0.3.11",
], | Pin more-itertools only for python < <I> (#<I>) | joke2k_faker | train | py |
4fbbe20d813ba5fd82a39ff6f2d01d70a23cc8d4 | diff --git a/test/tools/javadoc/api/basic/APITest.java b/test/tools/javadoc/api/basic/APITest.java
index <HASH>..<HASH> 100644
--- a/test/tools/javadoc/api/basic/APITest.java
+++ b/test/tools/javadoc/api/basic/APITest.java
@@ -202,6 +202,12 @@ class APITest {
"pkg/package-frame.html",
"pkg/package-summary.html",
"pkg/package-tree.html",
+ "resources/background.gif",
+ "resources/tab.gif",
+ "resources/activetitlebar_end.gif",
+ "resources/activetitlebar.gif",
+ "resources/titlebar_end.gif",
+ "resources/titlebar.gif",
"script.js",
"stylesheet.css"
)); | Sync with jdk9/dev: adapt expected javadoc files. | wmdietl_jsr308-langtools | train | java |
f432ec44a78c4871a48a669c2aa81b33350ff41a | diff --git a/hyperv/neutron/security_groups_driver.py b/hyperv/neutron/security_groups_driver.py
index <HASH>..<HASH> 100644
--- a/hyperv/neutron/security_groups_driver.py
+++ b/hyperv/neutron/security_groups_driver.py
@@ -135,6 +135,10 @@ class HyperVSecurityGroupsDriverMixin(object):
self._security_ports.pop(port['device'], None)
self._sec_group_rules.pop(port['id'], None)
+ def security_group_updated(self, action_type, sec_group_ids,
+ device_id=None):
+ pass
+
@property
def ports(self):
return self._security_ports | Adds security_group_updated method in HyperVSecurityGroupDriver
With the changes introduced in securitygroups_rpc with the
below commit hyperv code breaks.
<URL> | openstack_networking-hyperv | train | py |
3c6e15edc6eb6a9cd03153b8c5913706744223b7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -88,6 +88,7 @@ entry_points = {
"jenkins=fedmsg_meta_fedora_infrastructure.jenkins:JenkinsProcessor",
"github=fedmsg_meta_fedora_infrastructure.github:GithubProcessor",
"bugzilla=fedmsg_meta_fedora_infrastructure.bz:BugzillaProcessor",
+ "elections=fedmsg_meta_fedora_infrastructure.bz:ElectionsProcessor",
]
} | Adjust the setup.py file to include the elections processor | fedora-infra_fedmsg_meta_fedora_infrastructure | train | py |
82f541a25b69eee668573bea11de0095c32f330d | diff --git a/src/CornerstoneViewport/CornerstoneViewport.js b/src/CornerstoneViewport/CornerstoneViewport.js
index <HASH>..<HASH> 100644
--- a/src/CornerstoneViewport/CornerstoneViewport.js
+++ b/src/CornerstoneViewport/CornerstoneViewport.js
@@ -232,9 +232,9 @@ class CornerstoneViewport extends Component {
// Handle the case where the imageId isn't loaded correctly and the
// imagePromise returns undefined
// To test, uncomment the next line
- let imageId = 'AfileThatDoesntWork'; // For testing only!
+ //let imageId = 'AfileThatDoesntWork'; // For testing only!
- //const { imageId } = this.state;
+ const { imageId } = this.state;
let imagePromise;
try {
imagePromise = cornerstone.loadAndCacheImage(imageId); | fix(error-handling): Fix code commented while testing | cornerstonejs_react-cornerstone-viewport | train | js |
26067d48cc790d070d34e3436d3ecb988930c33d | diff --git a/lib/support/cli.js b/lib/support/cli.js
index <HASH>..<HASH> 100644
--- a/lib/support/cli.js
+++ b/lib/support/cli.js
@@ -11,7 +11,7 @@ const hasbin = require('hasbin');
const videoDefaults = require('../video/defaults');
const screenshotDefaults = require('../screenshot/defaults');
-const configPath = findUp.sync(['.myapprc', '.browsertime.json']);
+const configPath = findUp.sync(['.browsertime.json']);
const config = configPath ? JSON.parse(fs.readFileSync(configPath)) : {};
function validateInput(argv) { | removed faulty/copy/paste rc name | sitespeedio_browsertime | train | js |
1e1706d741eece66e8ff0ea8ae6781aaeb52d11d | diff --git a/superset/migrations/versions/301362411006_add_execution_id_to_report_execution_.py b/superset/migrations/versions/301362411006_add_execution_id_to_report_execution_.py
index <HASH>..<HASH> 100644
--- a/superset/migrations/versions/301362411006_add_execution_id_to_report_execution_.py
+++ b/superset/migrations/versions/301362411006_add_execution_id_to_report_execution_.py
@@ -36,4 +36,4 @@ def upgrade():
def downgrade():
- op.drop_column("report_execution_log", "execution_id")
+ op.drop_column("report_execution_log", "uuid") | fix: migration downgrade references wrong column (#<I>) | apache_incubator-superset | train | py |
aaad9f877d26b1a44a3a23d4b1a58e26c1d97b9e | diff --git a/api/src/opentrons/protocol_api/instrument_context.py b/api/src/opentrons/protocol_api/instrument_context.py
index <HASH>..<HASH> 100644
--- a/api/src/opentrons/protocol_api/instrument_context.py
+++ b/api/src/opentrons/protocol_api/instrument_context.py
@@ -234,8 +234,8 @@ class InstrumentContext(CommandPublisher):
aspirated into the pipette will be dispensed (this volume is accessible
through :py:attr:`current_volume`).
- :param volume: The volume of liquid to dispense, in microliters. If not
- specified, defaults to :py:attr:`current_volume`.
+ :param volume: The volume of liquid to dispense, in microliters. If 0
+ or unspecified, defaults to :py:attr:`current_volume`.
:type volume: int or float
:param location: Where to dispense into. If `location` is a | docs(api): Explain dispense(volume=0) dispenses the entire current volume (#<I>) | Opentrons_opentrons | train | py |
59740fe3e9e295c69bfd5f04261ed66eb6629ce9 | diff --git a/src/Maker/Migrator.php b/src/Maker/Migrator.php
index <HASH>..<HASH> 100644
--- a/src/Maker/Migrator.php
+++ b/src/Maker/Migrator.php
@@ -272,8 +272,12 @@ final class Migrator
$methodArguments[] = $fieldLabel;
}
+ // needed to turn 'foo' into '$foo' and 'foo.bar.baz' into '$fooBarBaz'
+ $fieldVariableName = u($fieldName)->replace('.', ' ')->camel()->collapseWhitespace()->toString();
+ $renamedFieldNames[$fieldName] = $fieldVariableName;
+
$code = $code->_use($fieldFqcn);
- $code = $code->_variableName($fieldName)->equals()->_staticCall($fieldClassName, 'new', $methodArguments);
+ $code = $code->_variableName($fieldVariableName)->equals()->_staticCall($fieldClassName, 'new', $methodArguments);
if ($this->isCustomTemplate($fieldConfig['template'])) {
$code = $code->_methodCall('setTemplatePath', [$fieldConfig['template']]); | Improved the migration command when using field names with dots | EasyCorp_EasyAdminBundle | train | php |
2b52492e8002a534e647495ff55d592589a7d930 | diff --git a/allennlp/common/util.py b/allennlp/common/util.py
index <HASH>..<HASH> 100644
--- a/allennlp/common/util.py
+++ b/allennlp/common/util.py
@@ -305,6 +305,11 @@ def import_submodules(package_name: str) -> None:
"""
importlib.invalidate_caches()
+ # For some reason, python doesn't always add this by default to your path, but you pretty much
+ # always want it when using `--include-package`. And if it's already there, adding it again at
+ # the end won't hurt anything.
+ sys.path.append('.')
+
# Import at top level
module = importlib.import_module(package_name)
path = getattr(module, '__path__', []) | Fix path issue for certain cases when using --include-package (#<I>) | allenai_allennlp | train | py |
638a018f22777716079f5bbb57c8d9967448f3a3 | diff --git a/src/Link.js b/src/Link.js
index <HASH>..<HASH> 100644
--- a/src/Link.js
+++ b/src/Link.js
@@ -2,7 +2,7 @@ import styled from 'styled-components'
const Link = styled.a`
text-decoration: none;
- ${props => props.theme ? `color: ${props.theme.colors.blue};` : null}
+ color: ${props => props.theme.colors.blue};
&:hover {
text-decoration: underline;
} | Refactor the default color of Link component | jrs-innovation-center_design-system | train | js |
976fd328ea58670688b43ed8c14ce216461355d9 | diff --git a/views/fcrtCurrencyRate/_search.php b/views/fcrtCurrencyRate/_search.php
index <HASH>..<HASH> 100644
--- a/views/fcrtCurrencyRate/_search.php
+++ b/views/fcrtCurrencyRate/_search.php
@@ -21,7 +21,7 @@
array(
'model'=>$model,
'attribute'=>'fcrt_date',
- 'language'=> substr(Yii::app()->language,0,strpos(Yii::app()->language,'_')),
+ 'language' => strstr(Yii::app()->language . '_', '_', true),
'htmlOptions'=>array('size'=>10),
'options'=>array(
'showButtonPanel'=>true, | Fixed bug in usage of datepicker | DBRisinajumi_fcrn | train | php |
851b6dc26f63c4898beec670340ae418844b39df | diff --git a/src/log/Target.php b/src/log/Target.php
index <HASH>..<HASH> 100644
--- a/src/log/Target.php
+++ b/src/log/Target.php
@@ -53,7 +53,7 @@ abstract class Target extends Object implements HandlerInterface
public function isHandling(array $message)
{
- return $this->getUnderlyingHandler()->isHandling($message);
+ return $this->enabled && $this->getUnderlyingHandler()->isHandling($message);
}
public function handle(array $message) | Fixed \blink\log\Target::$enabled is not working | bixuehujin_blink | train | php |
d45aaf5a7e3aad0d76f2fa21530f839ea78689cb | diff --git a/lib/engines/icomoon-phantomjs.js b/lib/engines/icomoon-phantomjs.js
index <HASH>..<HASH> 100644
--- a/lib/engines/icomoon-phantomjs.js
+++ b/lib/engines/icomoon-phantomjs.js
@@ -28,6 +28,11 @@ IcoMoonPhantomJsEngine.prototype = {
namespace,
retObj = {};
+ // If there are no files, exit early
+ if (files.length === 0) {
+ return callback(new Error('No files were provided to `fontsmith`. Exiting early.'));
+ }
+
// In series
async.waterfall([
// Write paths to file
@@ -138,4 +143,4 @@ function createPalette(options, cb) {
module.exports = {
create: createPalette,
IcoMoonPhantomJsEngine: IcoMoonPhantomJsEngine
-};
\ No newline at end of file
+};
diff --git a/test/fontsmith_test_content.js b/test/fontsmith_test_content.js
index <HASH>..<HASH> 100644
--- a/test/fontsmith_test_content.js
+++ b/test/fontsmith_test_content.js
@@ -66,5 +66,8 @@ module.exports = {
assert(map.building_block >= 57344);
assert(map.moon >= 57344);
assert(map.eye >= 57344);
+ },
+ "notifies the user that there we no fonts found": function () {
+ assert(this.err.message.match('No files were provided'));
}
}; | Added check for empty files and fixed up assertion | twolfson_fontsmith | train | js,js |
e016d08325eaca0db2b6f23dff3cc87a61ab4e6b | diff --git a/csv_ical/convert.py b/csv_ical/convert.py
index <HASH>..<HASH> 100644
--- a/csv_ical/convert.py
+++ b/csv_ical/convert.py
@@ -6,7 +6,7 @@ There are a bunch of configurable variables
import csv
import datetime
from platform import uname
-from typing import Dict, List # NOQA
+from typing import Dict, List
from uuid import uuid4
from icalendar import Calendar, Event | Remove NOQA lint ignore from type imports | albertyw_csv-ical | train | py |
9ae0d483ead93c0832142e5dc85959ae3c8f73ea | diff --git a/datasette/utils/__init__.py b/datasette/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/datasette/utils/__init__.py
+++ b/datasette/utils/__init__.py
@@ -911,6 +911,8 @@ def resolve_env_secrets(config, environ):
if isinstance(config, dict):
if list(config.keys()) == ["$env"]:
return environ.get(list(config.values())[0])
+ elif list(config.keys()) == ["$file"]:
+ return open(list(config.values())[0]).read()
else:
return {
key: resolve_env_secrets(value, environ) | Get "$file": "../path" mechanism working again, closes #<I> | simonw_datasette | train | py |
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.