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 |
|---|---|---|---|---|---|
deb3db08bab57435101fb295a4a4b0d49d6fa56b | diff --git a/SoftLayer/tests/api_tests.py b/SoftLayer/tests/api_tests.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/tests/api_tests.py
+++ b/SoftLayer/tests/api_tests.py
@@ -283,6 +283,22 @@ class APITimedClient(unittest.TestCase):
'User-Agent': USER_AGENT,
})
+ @patch('SoftLayer.API.make_xml_rpc_api_call')
+ def test_call_compression_override(self, make_xml_rpc_api_call):
+ # raw_headers should override compress=False
+ self.client['SERVICE'].METHOD(
+ compress=False,
+ raw_headers={'Accept-Encoding': 'gzip'})
+ make_xml_rpc_api_call.assert_called_with(
+ 'ENDPOINT/SoftLayer_SERVICE', 'METHOD', (),
+ headers=ANY,
+ timeout=None,
+ http_headers={
+ 'Content-Type': 'application/xml',
+ 'User-Agent': USER_AGENT,
+ 'Accept-Encoding': 'gzip',
+ })
+
class UnauthenticatedAPIClient(unittest.TestCase):
def setUp(self): | Adds test to make sure raw_headers overrides compress=False | softlayer_softlayer-python | train | py |
f5dd201763bf88424155aa80fda9dee2d0c0171c | diff --git a/instance.go b/instance.go
index <HASH>..<HASH> 100644
--- a/instance.go
+++ b/instance.go
@@ -7,6 +7,7 @@ import (
"log"
"math/rand"
"net/http"
+ "strings"
"text/tabwriter"
"time"
@@ -336,7 +337,7 @@ func instanceFake(args []string, service *update.Service, out *tabwriter.Writer)
for i := 0; i < instanceFlags.clientsPerApp; i++ {
c := &Client{
- Id: uuid.New(),
+ Id: strings.Replace(uuid.New(), "-", "", -1),
SessionId: uuid.New(),
Version: instanceFlags.version,
AppId: instanceFlags.appId.String(), | instance: structure our machineid like a real machine id | coreos_updateservicectl | train | go |
18e80ea4dc00da6dde7d9050bdb0066e606f31de | diff --git a/components/list-date-picker/style/index.js b/components/list-date-picker/style/index.js
index <HASH>..<HASH> 100644
--- a/components/list-date-picker/style/index.js
+++ b/components/list-date-picker/style/index.js
@@ -1,5 +1,5 @@
import './index.less';
import 'rmc-picker/assets/index.css';
import 'rmc-date-picker/assets/index.css';
-import 'rmc-date-picker/assets/popup.css';
import 'rmc-modal/assets/index.css';
+import 'rmc-picker/assets/popup.css';
diff --git a/components/list-picker/style/index.js b/components/list-picker/style/index.js
index <HASH>..<HASH> 100644
--- a/components/list-picker/style/index.js
+++ b/components/list-picker/style/index.js
@@ -1,5 +1,6 @@
import './index.less';
import 'rmc-cascader/assets/index.css';
-import 'rmc-cascader/assets/popup.css';
import 'rmc-modal/assets/index.css';
import 'rmc-picker/assets/index.css';
+import 'rmc-picker/assets/popup.css';
+ | temp css modify for picker | ant-design_ant-design-mobile | train | js,js |
18e5f844fae86ffcc46f96332a853def32de4958 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -179,7 +179,7 @@ RSpec.configure do |config|
# This setting enables warnings. It's recommended, but in some cases may
# be too noisy due to issues in dependencies.
- #config.warnings = true # FIXME: Too noisy right now
+ config.warnings = true
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an | Enable printing of warnings during test suite execution
This is still a bit noisy, but most of the noise is due to repeated
warnings for the same things, rather than many different warnings, so
let's enable this by default hopefully this will motivate someone to fix
the remaining warnings :) | lsegal_yard | train | rb |
9c458ab453c5abd4308977961b358e96f5ea0c2a | diff --git a/src/php/Webforge/UserBundle/DependencyInjection/WebforgeUserExtension.php b/src/php/Webforge/UserBundle/DependencyInjection/WebforgeUserExtension.php
index <HASH>..<HASH> 100644
--- a/src/php/Webforge/UserBundle/DependencyInjection/WebforgeUserExtension.php
+++ b/src/php/Webforge/UserBundle/DependencyInjection/WebforgeUserExtension.php
@@ -10,14 +10,18 @@ class WebforgeUserExtension extends Extension implements PrependExtensionInterfa
{
public function load(array $configs, ContainerBuilder $container)
{
+ //$loader = $container->getDefinition('twig.loader.filesystem');
+ //$loader->addMethodCall('addPath', [__DIR__.'/../Resources/views','FOSUser'])
+
}
public function prepend(ContainerBuilder $container)
{
$container->prependExtensionConfig('twig', array(
- 'paths' => array(
- __DIR__.'/../Resources/views' => 'FOSUser',
- ),
- ));
+ 'paths' => array(
+ 'templates/bundles/FOSUserBundle/' => 'FOSUser',
+ __DIR__ . '/../Resources/views' => 'FOSUser',
+ ),
+ ));
}
} | allow to overwrite fosuser layout | webforge-labs_cms | train | php |
c2291cf7cce3e465a098c8705443377be0b95be0 | diff --git a/src/ReferencedValue.php b/src/ReferencedValue.php
index <HASH>..<HASH> 100644
--- a/src/ReferencedValue.php
+++ b/src/ReferencedValue.php
@@ -31,17 +31,25 @@ class ReferencedValue
{
if ($this->token == null) {
$this->owner = $value;
+
+ return $this;
}
$this->owner[$this->token] = $value;
+
+ return $this;
}
public function unsetValue()
{
if ($this->token == null) {
$this->owner = null;
+
+ return $this;
}
unset($this->owner[$this->token]);
+
+ return $this;
}
} | Fixed set() and unset() not stopping inside cond. | gamringer_JSONPatch | train | php |
29fd9e7598800de9a85d8de71fd0f8e058758719 | diff --git a/Database/Model.php b/Database/Model.php
index <HASH>..<HASH> 100644
--- a/Database/Model.php
+++ b/Database/Model.php
@@ -482,7 +482,9 @@ abstract class Model
*/
public function save(array $attributes = null)
{
- $this->fillProperties($attributes, false);
+ if ($attributes !== null) {
+ $this->fillProperties($attributes, false);
+ }
$this->doQuery($this->saveQuery($attributes));
} | fix bug: unable to Model::save() without param (just setted properties) | PHPColibri_framework | train | php |
cd25b0bbbfba395827ce8af805b963d334f6488e | diff --git a/lib/app.rb b/lib/app.rb
index <HASH>..<HASH> 100644
--- a/lib/app.rb
+++ b/lib/app.rb
@@ -4,6 +4,12 @@ module ErnieBrodeur
attr_accessor :banner
attr_accessor :long_description
+ # return the name of the app, for now this is just the cmd ran, later it will be
+ # something generated but more unique.
+ def name
+ $0.split("/").last
+ end
+
def initialize
@version = '0.0.0'
@banner = 'A bin snippet by Ernie Brodeur that does . . . something.' | Fixed a bug where the DB didn't work because the app name was an absolute path. | erniebrodeur_bini | train | rb |
b42bae4ffef1483f66b046e0f8dec1109c285e23 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -140,6 +140,13 @@ module.exports.stepping = function stepping(options) {
return effect;
};
+ var defaultLog = function log(effect) {
+ /* no logging */
+ };
+ var defaultFail = function fail(exception) {
+ throw exception;
+ };
+
/*
Dispatch events in a manner provided by `control`.
@@ -148,12 +155,8 @@ module.exports.stepping = function stepping(options) {
*/
var eventLoop = function eventLoop(control) {
control = control || {};
- control.log = control.log || function log(effect) {
- /* no logging */
- };
- control.fail = control.fail || function fail(exception) {
- throw exception;
- };
+ control.log = control.log || defaultLog;
+ control.fail = control.fail || defaultFail;
while ((control.count === undefined) || (--control.count >= 0)) {
var effect = options.stepping.dispatch();
control.log(effect); // log event | Avoid creating new log/fail for each call to eventLoop() | dalnefre_tart-stepping | train | js |
aa65bfcd3dc870e7e7266c5712ea21f72c79d71b | diff --git a/src/main/java/com/wiley/driver/factory/TeasyDriver.java b/src/main/java/com/wiley/driver/factory/TeasyDriver.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/wiley/driver/factory/TeasyDriver.java
+++ b/src/main/java/com/wiley/driver/factory/TeasyDriver.java
@@ -17,9 +17,9 @@ public class TeasyDriver {
URL gridUrl = getGridHubUrl();
boolean isHeadless = Configuration.headless;
if (Configuration.runWithGrid) {
- driverFactory = new RemoteDriverFactory(Configuration.browser, Configuration.platform, Configuration.customCaps.merge(extraCaps), isHeadless, gridUrl);
+ driverFactory = new RemoteDriverFactory(Configuration.browser, Configuration.platform, extraCaps.merge(Configuration.customCaps), isHeadless, gridUrl);
} else {
- driverFactory = new StandaloneDriverFactory(Configuration.browser, Configuration.platform, Configuration.customCaps.merge(extraCaps), isHeadless, gridUrl);
+ driverFactory = new StandaloneDriverFactory(Configuration.browser, Configuration.platform, extraCaps.merge(Configuration.customCaps), isHeadless, gridUrl);
}
return driverFactory.get(); | fix - customCaps from Configuration should not be changed | WileyLabs_teasy | train | java |
7fb12fce49ed36f5656a46bdee6f41834c98626f | diff --git a/django_q/tests/test_brokers.py b/django_q/tests/test_brokers.py
index <HASH>..<HASH> 100644
--- a/django_q/tests/test_brokers.py
+++ b/django_q/tests/test_brokers.py
@@ -96,13 +96,14 @@ def test_disque():
@pytest.mark.skipif(not os.getenv('IRON_MQ_TOKEN'),
reason="requires IronMQ credentials")
def test_ironmq():
- Conf.IRON_MQ = {'host': os.getenv('IRON_MQ_HOST'),
- 'token': os.getenv('IRON_MQ_TOKEN'),
+ Conf.IRON_MQ = {'token': os.getenv('IRON_MQ_TOKEN'),
'project_id': os.getenv('IRON_MQ_PROJECT_ID')}
# check broker
broker = get_broker(list_key='djangoQ')
assert broker.ping() is True
assert broker.info() is not None
+ # initialize the queue
+ broker.enqueue('test')
# clear before we start
broker.purge_queue()
# enqueue | fixes iron-mq test
purging a queue that never had a message in it raises a not found error. So we queue one message to initialize. | Koed00_django-q | train | py |
d39453c35e854161e6b66609637f6b43d7ee73b3 | diff --git a/test/e2e/scheduling/equivalence_cache_predicates.go b/test/e2e/scheduling/equivalence_cache_predicates.go
index <HASH>..<HASH> 100644
--- a/test/e2e/scheduling/equivalence_cache_predicates.go
+++ b/test/e2e/scheduling/equivalence_cache_predicates.go
@@ -172,6 +172,10 @@ var _ = framework.KubeDescribe("EquivalenceCache [Serial]", func() {
// This test verifies that MatchInterPodAffinity (anti-affinity) is respected as expected.
ginkgo.It("validates pod anti-affinity works properly when new replica pod is scheduled", func() {
+ // check if there are at least 2 worker nodes available, else skip this test.
+ if len(nodeList.Items) < 2 {
+ framework.Skipf("Skipping as the test requires at least two worker nodes, current number of nodes: %d", len(nodeList.Items))
+ }
ginkgo.By("Launching two pods on two distinct nodes to get two node names")
CreateHostPortPods(f, "host-port", 2, true)
defer framework.DeleteRCAndWaitForGC(f.ClientSet, ns, "host-port") | Adding an if statement to check the number of worker nodes available before running a test that needs 2 nodes.
Checking avoids error assertion in function 'CreateHostPortPods' to fail. | kubernetes_kubernetes | train | go |
39601186c9f4b4466b19420576adf1caf3a6a310 | diff --git a/lib/sinatra/assetpack/options.rb b/lib/sinatra/assetpack/options.rb
index <HASH>..<HASH> 100644
--- a/lib/sinatra/assetpack/options.rb
+++ b/lib/sinatra/assetpack/options.rb
@@ -49,6 +49,8 @@ module Sinatra
@js_compression = :jsmin
@css_compression = :simple
+ @reload_files_cache = true
+
begin
@output_path = app.public
rescue NoMethodError
@@ -82,12 +84,14 @@ module Sinatra
return unless File.directory?(File.join(app.root, options[:from]))
@served[path] = options[:from]
+ @reload_files_cache = true
end
# Undo defaults.
def reset!
@served = Hash.new
@packages = Hash.new
+ @reload_files_cache = true
end
# Ignores a given path spec.
@@ -284,6 +288,8 @@ module Sinatra
# Returns the files as a hash.
def files(match=nil)
+ return @files unless @reload_files_cache
+
# All
# A buncha tuples
tuples = @served.map { |prefix, local_path|
@@ -295,7 +301,9 @@ module Sinatra
}
}.flatten.compact
- Hash[*tuples]
+ @reload_files_cache = false
+ @files = Hash[*tuples]
+ @files
end
# Returns an array of URI paths of those matching given globs. | Cached files so they are only loaded once
`files` is an expensive method and is called a number of times. Added caching of the files and reload them in certain conditions | rstacruz_sinatra-assetpack | train | rb |
00f8fb794c85d4c080a1d58f9364b067511fc8aa | diff --git a/safe_qgis/test_dock.py b/safe_qgis/test_dock.py
index <HASH>..<HASH> 100644
--- a/safe_qgis/test_dock.py
+++ b/safe_qgis/test_dock.py
@@ -446,7 +446,7 @@ class DockTest(unittest.TestCase):
#FIXME (MB) this is actually wrong, when calling the test directly it works
# in nosetest it fails at the second assert
-# @expectedFailure
+ @expectedFailure
def test_cboAggregationToggle(self):
"""Aggregation Combobox toggles on and off as expected."""
#raster hazard | Redisable expected failure for cbo Aggregation toggle | inasafe_inasafe | train | py |
2082d13542b6ede19516c8b4fedf164f9c5d7a4d | diff --git a/src/L5SimpleFMBase.php b/src/L5SimpleFMBase.php
index <HASH>..<HASH> 100644
--- a/src/L5SimpleFMBase.php
+++ b/src/L5SimpleFMBase.php
@@ -39,7 +39,7 @@ abstract class L5SimpleFMBase
protected function primeCommandArray()
{
if (empty($this->layoutName)) {
- throw new LayoutNameIsMissingException;
+ throw new LayoutNameIsMissingException('You must specify a layout name.');
}
$this->commandArray['-db'] = $this->adapter->getHostConnection()->getDbName();
$this->commandArray['-lay'] = $this->layoutName;
@@ -95,7 +95,7 @@ abstract class L5SimpleFMBase
throw new NoResultReturnedException('The SimpleFM request did not return a result.');
}
if ($result->getErrorCode() == 401) {
- throw new RecordsNotFoundException($result->getErrorMessage());
+ throw new RecordsNotFoundException($result->getErrorMessage(), $result->getErrorCode(), $result);
}
if ($result->getErrorCode() !== 0) {
$message = $result->getErrorMessage() . ". Command used: " . json_encode($commandArrayUsed); | Adds details to existing exceptions. | chris-schmitz_L5SimpleFM | train | php |
8b2224c465ef70d2320985c57dc0b8ee1c0a3664 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -18,13 +18,13 @@ exports.parse = function (s) {
if (/^'/.test(s)) {
return s
.replace(/^'|'$/g, '')
- .replace(/\\(['\\])/g, '$1')
+ .replace(/\\(["'\\$`(){}!#&*|])/g, '$1');
;
}
else if (/^"/.test(s)) {
return s
.replace(/^"|"$/g, '')
- .replace(/\\(["\\])/g, '$1')
+ .replace(/\\(["'\\$`(){}!#&*|])/g, '$1');
;
}
else return s; | expand more escape sequences in parse() | substack_node-shell-quote | train | js |
0533c9328ef99555ad17c3c61573cce5481f35ac | diff --git a/steam/webauth.py b/steam/webauth.py
index <HASH>..<HASH> 100644
--- a/steam/webauth.py
+++ b/steam/webauth.py
@@ -2,7 +2,7 @@
"""
This module simplifies the process of obtaining an authenticated session for steam websites.
After authentication is complete, a :class:`requests.Session` is created containing the auth cookies.
-The session can be used to access ``steamcommunity.com`` and ``steampowered.com``.
+The session can be used to access ``steamcommunity.com``, ``store.steampowered.com``, and ``help.steampowered.com``.
Example usage:
@@ -162,7 +162,7 @@ class WebAuth(object):
self.steamid = SteamID(data['steamid'])
- for domain in ['.steampowered.com', '.steamcommunity.com']:
+ for domain in ['store.steampowered.com', 'help.steampowered.com', 'steamcommunity.com']:
self.session.cookies.set('steamLogin', '%s||%s' % (data['steamid'], data['token']),
domain=domain, secure=False)
self.session.cookies.set('steamLoginSecure', '%s||%s' % (data['steamid'], data['token_secure']), | webauth: limit the domains where cookies are used | ValvePython_steam | train | py |
4235f9a5a7c3d463342785ceea477508e972ebf1 | diff --git a/blockstore/lib/operations/preorder.py b/blockstore/lib/operations/preorder.py
index <HASH>..<HASH> 100644
--- a/blockstore/lib/operations/preorder.py
+++ b/blockstore/lib/operations/preorder.py
@@ -185,7 +185,8 @@ def parse(bin_payload):
return {
'opcode': 'NAME_PREORDER',
'preorder_name_hash': name_hash,
- 'consensus_hash': consensus_hash
+ 'consensus_hash': consensus_hash,
+ 'quantity': 1
} | Add implicit quantity field to preorder (= 1 for single preorder) | blockstack_blockstack-core | train | py |
8f73a4deb6cf922477e890113c3d03049c1f170f | diff --git a/src/components/checkout/component.js b/src/components/checkout/component.js
index <HASH>..<HASH> 100644
--- a/src/components/checkout/component.js
+++ b/src/components/checkout/component.js
@@ -108,7 +108,7 @@ export let PayPalCheckout = xcomponent.create({
let CLOSE_REASONS = xcomponent.CONSTANTS.CLOSE_REASONS;
- if (this.props.onPaymentCancel && [ CLOSE_REASONS.CLOSE_DETECTED, CLOSE_REASONS.USER_CLOSED ].indexOf(reason) !== -1) {
+ if (this.props.onPaymentCancel && this.paymentToken && this.cancelUrl && [ CLOSE_REASONS.CLOSE_DETECTED, CLOSE_REASONS.USER_CLOSED ].indexOf(reason) !== -1) {
return this.props.onPaymentCancel({
paymentToken: this.paymentToken,
cancelUrl: this.cancelUrl | Only call onPaymentCancel if we have been given a paymentToken and cancelUrl in init | paypal_paypal-checkout-components | train | js |
7455103e0f7747d5f16c5bb0499c2612e350fea1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -50,10 +50,14 @@ if sys.argv[1] in ('install', 'develop'):
for path in sys.path:
if (path.endswith('site-packages')) or (path.endswith('dist-packages') and 'local' in path):
path = os.path.join(path, PTH_FILE_NAME)
- pth_file = open(path, 'w')
- pth_file.write(PTH_FILE)
- pth_file.close()
- sys.stdout.write('\nWrote pth file for subprocess measurement to %s\n' % path)
- break
+ try:
+ pth_file = open(path, 'w')
+ pth_file.write(PTH_FILE)
+ pth_file.close()
+ except:
+ sys.stdout.write('\nFailed to write pth file for subprocess measurement to %s\n' % path)
+ else:
+ sys.stdout.write('\nWrote pth file for subprocess measurement to %s\n' % path)
+ break
else:
sys.stdout.write(UNKNOWN_SITE_PACKAGES_DIR) | handle failing to write to a path | pytest-dev_pytest-cov | train | py |
7006b7f0043aadbf9500f5c89b66864ca5d4bbe7 | diff --git a/src/doc/conf.py b/src/doc/conf.py
index <HASH>..<HASH> 100644
--- a/src/doc/conf.py
+++ b/src/doc/conf.py
@@ -25,8 +25,8 @@ if MOCK_MODULES and on_rtd:
project = 'Astral'
author = 'Simon Kennedy'
copyright = '2009-2015, %s' % author
-version = '0.8'
-release = '0.8.2'
+version = '0.9'
+release = '0.9'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | Bumper version number to <I> | sffjunkie_astral | train | py |
ccf95e31cabc0fccc18110c0e985dd868d992254 | diff --git a/helpers/DataTableHelper.php b/helpers/DataTableHelper.php
index <HASH>..<HASH> 100644
--- a/helpers/DataTableHelper.php
+++ b/helpers/DataTableHelper.php
@@ -60,7 +60,7 @@ class DataTableHelper
/**
* The keyword for a descending sort
*/
- const SORT_DESC = 'asc';
+ const SORT_DESC = 'desc';
/**
* The default sort order to use when none is provided | Fix constant value for SORT_DESC | oat-sa_extension-tao-proctoring | train | php |
db519c0c9a8d3d4f5afa2029408de5a860e037c1 | diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -247,7 +247,7 @@ module ActiveRecord
def empty?
return @records.empty? if loaded?
- c = count
+ c = count(:all)
c.respond_to?(:zero?) ? c.zero? : c.empty?
end | cleanup whitespace in relation.rb | rails_rails | train | rb |
6cd3f37da829d5fe1516602262ee9dacee455edc | diff --git a/tools/tracevis/lib/trace/dotify.js b/tools/tracevis/lib/trace/dotify.js
index <HASH>..<HASH> 100644
--- a/tools/tracevis/lib/trace/dotify.js
+++ b/tools/tracevis/lib/trace/dotify.js
@@ -61,6 +61,7 @@ function extractPotentialParents(graph) {
function rewriteNodes(g, parents) {
g.eachNode(function(u, value) { if (value === undefined) { g.node(u, {}); } });
+ //limit displayed name of nodes to 64 characters to avoid exploding graph size
g.eachNode(function(u, value) { if (value.name && value.name.length > 64) { value.name = value.name.substring(0, 61) + "..." } });
var minStartNanos = Math.min.apply(Math, g.nodes().map(function(u) { return g.node(u).startNanos; })); | Added comments to dotify.js. | linkedin_parseq | train | js |
8476cc6642beaa8336d9cfa97a1337cccb5744e5 | diff --git a/django_auth_kerberos/backends.py b/django_auth_kerberos/backends.py
index <HASH>..<HASH> 100644
--- a/django_auth_kerberos/backends.py
+++ b/django_auth_kerberos/backends.py
@@ -56,7 +56,7 @@ class KrbBackend(ModelBackend):
"""The actual password checking logic. Separated from the authenticate code from Django for easier updating"""
try:
if SUPPORTS_VERIFY:
- kerberos.checkPassword(username.lower(), password, getattr(settings, "KRB5_SERVICE", ""), getattr(settings, "KRB5_REALM", ""), getatttr(settings, "KRB5_VERIFY_KDC", True))
+ kerberos.checkPassword(username.lower(), password, getattr(settings, "KRB5_SERVICE", ""), getattr(settings, "KRB5_REALM", ""), getattr(settings, "KRB5_VERIFY_KDC", True))
else:
kerberos.checkPassword(username.lower(), password, getattr(settings, "KRB5_SERVICE", ""), getattr(settings, "KRB5_REALM", ""))
return True | Fixed a typo in password checking. | 02strich_django-auth-kerberos | train | py |
5f427ebb2a9677829a9717347802e66b5e789df0 | diff --git a/.eslintrc.js b/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -8,14 +8,14 @@ module.exports = {
},
"parserOptions": {
- "ecmaVersion": 6,
+ "ecmaVersion": 2017,
"sourceType": "module"
},
"globals": {
"Promise": "readonly",
"WebMidi": "readonly",
- "expect": "readonly",
+ "chai": "readonly",
"sinon": "readonly"
}, | Move to ES<I> to include support for async/await | djipco_webmidi | train | js |
31b82d116bf5e29d8ada8b4c5f5dde207f7e0fcf | diff --git a/helpers/convert.js b/helpers/convert.js
index <HASH>..<HASH> 100644
--- a/helpers/convert.js
+++ b/helpers/convert.js
@@ -76,36 +76,6 @@ var conversions = [
to: 'iot-unit:math.fraction.percent',
multiply: 100,
},
- {
- from: 'iot-unit:length.imperial.feet',
- to: 'iot-unit:length.imperial.inch',
- multiply: 12,
- },
- {
- from: 'iot-unit:length.imperial.yard',
- to: 'iot-unit:length.imperial.feet',
- multiply: 3,
- },
- {
- from: 'iot-unit:length.imperial.mile',
- to: 'iot-unit:length.imperial.feet',
- multiply: 5280,
- },
- {
- from: 'iot-unit:length.us.mile',
- to: 'iot-unit:length.imperial.mile',
- multiply: 0.999998,
- },
- {
- from: 'iot-unit:length.imperial.nautical-mile',
- to: 'iot-unit:length.si.meter',
- multiply: 1852,
- },
- {
- from: 'iot-unit:length.si.meter',
- to: 'iot-unit:length.imperial.inch',
- multiply: 39.3701,
- },
];
/** | remove imperial stuff (moved to uom-imperial) | dpjanes_node-iotdb | train | js |
8f70b95d8253ed21267e76ef24aae71eba7a04f5 | diff --git a/test/integration.spec.js b/test/integration.spec.js
index <HASH>..<HASH> 100644
--- a/test/integration.spec.js
+++ b/test/integration.spec.js
@@ -355,4 +355,14 @@ describe("(slow) Integration test", function() {
expect(testCont(distr)).to.be.below(0.2);
});
});
+ describe("for chi-squared", function() {
+ it("repeated test", function() {
+ var df, distr;
+ for (var i = 0; i < 5; i += 1) {
+ df = Math.random() * 60;
+ distr = main.chisq(df);
+ expect(testCont(distr)).to.be.below(0.2);
+ }
+ });
+ });
}); | Add chi-squared integration test. Close #<I> | PanthR_panthrMath | train | js |
3db20c5124d1c2d2ad1e24f4c32788260a39d80f | diff --git a/integration-tests/spec/durable_processor_spec.rb b/integration-tests/spec/durable_processor_spec.rb
index <HASH>..<HASH> 100644
--- a/integration-tests/spec/durable_processor_spec.rb
+++ b/integration-tests/spec/durable_processor_spec.rb
@@ -22,7 +22,7 @@ describe "messaging rack test" do
visit "/messaging-rack/?topic-ham-biscuit"
proc.start
end
- result = TorqueBox::Messaging::Queue.new('/queues/results').receive(:timeout => 30_000)
+ result = TorqueBox::Messaging::Queue.new('/queues/results').receive(:timeout => 60_000)
result.should == "TestTopicConsumer=topic-ham-biscuit"
end | Longer timeout for durable_processor_spec integ | torquebox_torquebox | train | rb |
1a6dfd0678fc28091b6e022a19231105f241b4c4 | diff --git a/lib/Conekta/Util.php b/lib/Conekta/Util.php
index <HASH>..<HASH> 100644
--- a/lib/Conekta/Util.php
+++ b/lib/Conekta/Util.php
@@ -31,7 +31,7 @@ abstract class Util
'shipping_contact' => '\Conekta\ShippingContact',
'line_item' => '\Conekta\LineItem',
'order' => '\Conekta\Order',
- 'fiscal_entity' => '\Conekta\FiscalEntity',
+ 'fiscal_entity' => '\Conekta\FiscalEntity'
);
public static function convertToConektaObject($resp) | add unsuccessful tests for new models
Fix url segment params on http request
Add Fiscal Entities model
add test for fiscal entity
add test for fiscal entity | conekta_conekta-php | train | php |
b2eb901b60d017955a4e9af43ee7cd61656e66da | diff --git a/app/helpers/rubygems_helper.rb b/app/helpers/rubygems_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/rubygems_helper.rb
+++ b/app/helpers/rubygems_helper.rb
@@ -65,7 +65,7 @@ module RubygemsHelper
def links_to_owners(rubygem)
rubygem.owners.sort_by(&:id).map do |owner|
- link_to gravatar(48, "gravatar-#{owner.id}", owner), profile_path(owner.display_id), :alt => owner.display_handle
+ link_to gravatar(48, "gravatar-#{owner.id}", owner), profile_path(owner.display_id), :alt => owner.display_handle, :title => owner.display_handle
end.join.html_safe
end | added :title to link_to_owners helper | rubygems_rubygems.org | train | rb |
fdc52666bd2f220475bb9bf8853ed0dcffc60da2 | diff --git a/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.js b/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.js
+++ b/packages/neos-ui-redux-store/src/UI/ContentCanvas/index.js
@@ -65,6 +65,17 @@ export const reducer = handleActions({
})
),
[SET_CONTEXT_PATH]: ({contextPath, siteNode}) => state => {
+ if ($get('ui.contentCanvas.contextPath', state) !== contextPath) {
+ // If context path changed, ensure to reset the "focused node". Otherwise, when switching
+ // to different Document nodes and having a (content) node selected previously, the Inspector
+ // does not properly refresh. We just need to ensure that everytime we switch pages, we
+ // reset the focused (content) node of the page.
+ state = $set('cr.nodes.focused', new Map({
+ contextPath: '',
+ fusionPath: ''
+ }), state);
+ }
+
state = $set('ui.contentCanvas.contextPath', contextPath, state);
if (siteNode) { | BUGFIX: when switching between document nodes, ensure the current (content) selection is properly reset | neos_neos-ui | train | js |
0cb4d1050438d4c42ec1c7609b4791f973dfa577 | diff --git a/plugin/math/math.js b/plugin/math/math.js
index <HASH>..<HASH> 100755
--- a/plugin/math/math.js
+++ b/plugin/math/math.js
@@ -14,7 +14,10 @@ var RevealMath = window.RevealMath || (function(){
MathJax.Hub.Config({
messageStyle: 'none',
- tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] },
+ tex2jax: {
+ inlineMath: [['$','$'],['\\(','\\)']] ,
+ skipTags: ['script','noscript','style','textarea','pre']
+ },
skipStartupTypeset: true
}); | Allow tex parsing in <code> tags
Just using $ as delimiter in markdown document fails since the markdown
parser unknown to the dollar syntax will try to interpret underscores.
Putting the $ delimented formula in backticks will cause the markdown
parser to put the tex-code with the $ delimiters into a code block.
The texcode will then be unchanged. This patch allows for mathJax to
interpret and automagically display the tex-formulas. | hakimel_reveal.js | train | js |
7a8e4fabcf283b2b50dd76a31ccc02d0cf081c5f | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -50,9 +50,9 @@ function lint(input, options, webpack, callback) {
if (emitter) {
emitter(messages);
if (options.failOnError && report.errorCount) {
- throw new Error('Module failed because of a sasslint error.');
+ throw new Error('Module failed because of a sasslint error.\n' + messages);
} else if (options.failOnWarning && report.warningCount) {
- throw new Error('Module failed because of a sasslint warning.');
+ throw new Error('Module failed because of a sasslint warning.\n' + messages);
}
} else {
throw new Error( | added formatted error messages to exeption | alleyinteractive_sasslint-webpack-plugin | train | js |
ac40b5dbb1d233a09c6b905ce8133c80a5a32264 | diff --git a/addons/storyshots/src/utils.js b/addons/storyshots/src/utils.js
index <HASH>..<HASH> 100644
--- a/addons/storyshots/src/utils.js
+++ b/addons/storyshots/src/utils.js
@@ -11,6 +11,8 @@ export function getPossibleStoriesFiles(storyshotFile) {
return [
path.format({ dir: path.dirname(dir), name, ext: '.js' }),
path.format({ dir: path.dirname(dir), name, ext: '.jsx' }),
+ path.format({ dir: path.dirname(dir), name, ext: '.ts' }),
+ path.format({ dir: path.dirname(dir), name, ext: '.tsx' }),
];
} | Merge pull request #<I> from storybooks/storyshots-ts-stories-compatibility
Add .ts compatibility to storyshots | storybooks_storybook | train | js |
bf1e696cf423921f1b7be0bb27e4fe6c33a56c17 | diff --git a/src/NSwag.Npm/bin/nswag.js b/src/NSwag.Npm/bin/nswag.js
index <HASH>..<HASH> 100644
--- a/src/NSwag.Npm/bin/nswag.js
+++ b/src/NSwag.Npm/bin/nswag.js
@@ -1,8 +1,8 @@
#!/usr/bin/env node
"use strict";
-var defaultCoreVersion = "21";
-var supportedCoreVersions = ["10", "11", "20", "21"];
+var defaultCoreVersion = "22";
+var supportedCoreVersions = ["10", "11", "20", "21", "22"];
// Initialize
process.title = 'nswag';
@@ -67,4 +67,4 @@ if (hasFullDotNet && args.toLowerCase().indexOf("/runtime:win") != -1) {
c.execSync(defaultCmd, { stdio: [0, 1, 2] });
return;
});
-}
\ No newline at end of file
+} | Fix for .net core <I> support in npm package
Adding .net core <I> as default runtime
Adding <I> to supportedCoreVersions array | RicoSuter_NSwag | train | js |
c2d7efd84582778e3d0b49192d01719ee058ff4f | diff --git a/aeron-client/src/main/java/io/aeron/Aeron.java b/aeron-client/src/main/java/io/aeron/Aeron.java
index <HASH>..<HASH> 100644
--- a/aeron-client/src/main/java/io/aeron/Aeron.java
+++ b/aeron-client/src/main/java/io/aeron/Aeron.java
@@ -62,7 +62,7 @@ public final class Aeron implements AutoCloseable
/**
* Duration in nanoseconds for which the client conductor will sleep between duty cycles.
*/
- public static final long IDLE_SLEEP_NS = TimeUnit.MILLISECONDS.toNanos(4);
+ public static final long IDLE_SLEEP_NS = TimeUnit.MILLISECONDS.toNanos(10);
/**
* Default interval between sending keepalive control messages to the driver. | [Java] Only run client conductor duty cycle one every <I>ms. | real-logic_aeron | train | java |
200ef443de60117613867d426a8e0241e0b4b3fc | diff --git a/src/main/java/org/springframework/hateoas/mediatype/hal/HalModelBuilder.java b/src/main/java/org/springframework/hateoas/mediatype/hal/HalModelBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/springframework/hateoas/mediatype/hal/HalModelBuilder.java
+++ b/src/main/java/org/springframework/hateoas/mediatype/hal/HalModelBuilder.java
@@ -45,8 +45,6 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped;
*/
public class HalModelBuilder {
- private static final LinkRelation NO_RELATION = LinkRelation.of("___norel___");
-
private final EmbeddedWrappers wrappers;
private Object model; | #<I> - Polishing. | spring-projects_spring-hateoas | train | java |
912b72f6fbae4df68be0a1453961c9000228e17d | diff --git a/pyani/scripts/subcommands/subcmd_fastani.py b/pyani/scripts/subcommands/subcmd_fastani.py
index <HASH>..<HASH> 100644
--- a/pyani/scripts/subcommands/subcmd_fastani.py
+++ b/pyani/scripts/subcommands/subcmd_fastani.py
@@ -393,7 +393,7 @@ def update_comparison_results(
# raise ValueError(
# f"fastANI output file {job.outfile} has more than one line"
# )
- logger.debug(f"Parsed fastANI file contents: {contents=}")
+ logger.debug(f"Parsed fastANI file contents: {contents}")
query, ref, ani, matches, num_frags = contents
ani = float(ani) # should be in the range 0–1
@@ -408,7 +408,6 @@ def update_comparison_results(
# pid = (1 - sim_errs) / int(aln_length)
# except ZeroDivisionError: # aln_length was zero (no alignment)
# pid = 0
- print(f"{job=}")
run.comparisons.append(
Comparison(
query=job.query, | Removed print statement and fixed error(?) in f-string | widdowquinn_pyani | train | py |
0ee9ab9d5357215af7f428e9f0154629e98e7f61 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -14,6 +14,8 @@ module.exports = function(grunt) {
'<%= dirs.src %>/core/Point.js',
'<%= dirs.src %>/core/Rectangle.js',
'<%= dirs.src %>/core/Polygon.js',
+ '<%= dirs.src %>/core/Circle.js',
+ '<%= dirs.src %>/core/Ellipse.js',
'<%= dirs.src %>/core/Matrix.js',
'<%= dirs.src %>/display/DisplayObject.js',
'<%= dirs.src %>/display/DisplayObjectContainer.js', | add circle and ellipse to the gruntfile | drkibitz_node-pixi | train | js |
791390d1eaf6376f829093d1fbe47dc8f63b0093 | diff --git a/src/configure-apollo.js b/src/configure-apollo.js
index <HASH>..<HASH> 100644
--- a/src/configure-apollo.js
+++ b/src/configure-apollo.js
@@ -17,7 +17,7 @@ import {
} from './apollo-links/';
const httpLink = createHttpLink({
- uri: `${window.app.protocol}://${window.app.host}/graphql`,
+ uri: `${window.app.protocol}://${window.app.backendHost}/graphql`,
credentials: 'include',
// manual polyfill for fetch to support older browsers like IE11
// for some reason that I wasn't able to figure out just importing | chore(app): use new host vars | commercetools_merchant-center-application-kit | train | js |
a447d604fb78397984ee1c1e295441c316b03ea7 | diff --git a/protowhat/Reporter.py b/protowhat/Reporter.py
index <HASH>..<HASH> 100644
--- a/protowhat/Reporter.py
+++ b/protowhat/Reporter.py
@@ -48,7 +48,8 @@ class TestRunnerProxy(TestRunner):
self.runner = runner
def do_test(self, test):
- self.tests.append(test)
+ if isinstance(test, Test):
+ self.tests.append(test)
return self.runner.do_test(test) | Only store Tests in TestRunnerProxy | datacamp_protowhat | train | py |
c9c03113dd3945f06abcad10899fc6b5f7d4bc6a | diff --git a/juicer/admin/JuicerAdmin.py b/juicer/admin/JuicerAdmin.py
index <HASH>..<HASH> 100644
--- a/juicer/admin/JuicerAdmin.py
+++ b/juicer/admin/JuicerAdmin.py
@@ -164,7 +164,7 @@ class JuicerAdmin(object):
if _r.status_code is Constants.PULP_GET_OK:
if len(juicer.utils.load_json_str(_r.content)) > 0:
__r = self.connectors[env].delete(orphan_query)
- if __r.status_code is Constants.PULP_DELETE_OK:
+ if __r.status_code is Constants.PULP_DELETE_ACCEPTED:
juicer.utils.Log.log_debug("deleted orphaned rpms in %s." % env)
else:
juicer.utils.Log.log_error("unable to delete orphaned rpms in %s. a %s error was returned", (env, __r.status_code)) | Change orphan okay code to accepted. #<I> | juicer_juicer | train | py |
5f97b77d04b7b8516cab3a50f28846511bc2b272 | diff --git a/lib/Dialog.js b/lib/Dialog.js
index <HASH>..<HASH> 100644
--- a/lib/Dialog.js
+++ b/lib/Dialog.js
@@ -26,7 +26,7 @@ export class Dialog extends Window {
bindEvents() {
const ownerDocument = this.ownerDocument
ownerDocument.on('click', this.onDocumentClick, this)
- ownerDocument.on('touchend', this.onDocumentClick, this)
+ // ownerDocument.on('touchend', this.onDocumentClick, this)
ownerDocument.on('keydown', this.onDocumentKeyDown, this)
if(this.modal) {
ownerDocument.on('focusin', this.onDocumentFocusIn, this)
@@ -39,7 +39,7 @@ export class Dialog extends Window {
unbindEvents() {
const ownerDocument = this.ownerDocument
ownerDocument.un('click', this.onDocumentClick, this)
- ownerDocument.un('touchend', this.onDocumentClick, this)
+ // ownerDocument.un('touchend', this.onDocumentClick, this)
ownerDocument.un('keydown', this.onDocumentKeyDown, this)
if(this.modal) {
ownerDocument.un('focusin', this.onDocumentFocusIn, this) | Dialog: comment touchend event handler bindings | aristov_ariamodule | train | js |
33b2683a12938847b5bd451f4aec68aef99d952d | diff --git a/Controller/Badge/BadgeController.php b/Controller/Badge/BadgeController.php
index <HASH>..<HASH> 100644
--- a/Controller/Badge/BadgeController.php
+++ b/Controller/Badge/BadgeController.php
@@ -34,6 +34,7 @@ class BadgeController extends Controller
$badgeClaimsWorkspace = $parameters['workspace'];
}
else {
+ $badgeQueryBuilder->andWhere('badge.workspace IS NULL');
$badgeClaimsWorkspace = null;
} | Don't display workspace badges on admin area | claroline_CoreBundle | train | php |
e9fa3cafba02ec2f9d35aecdca3633dcfce1b6c2 | diff --git a/test_twarc2.py b/test_twarc2.py
index <HASH>..<HASH> 100644
--- a/test_twarc2.py
+++ b/test_twarc2.py
@@ -198,7 +198,10 @@ def test_tweet_lookup():
# maybe this will go away since it used to work fine.
-@pytest.mark.skipif(os.environ.get("GITHUB_ACTIONS") != None)
+@pytest.mark.skipif(
+ os.environ.get("GITHUB_ACTIONS") != None,
+ reason="stream() seems to throw a 400 error under GitHub Actions?!",
+)
def test_stream():
# remove any active stream rules
rules = T.get_stream_rules() | A long December and there's reason to believe / Maybe this year will be better than the last. | DocNow_twarc | train | py |
d69003c789eda49d17f3802dbc76b19766fdd9af | diff --git a/src/ObjectMapper.php b/src/ObjectMapper.php
index <HASH>..<HASH> 100644
--- a/src/ObjectMapper.php
+++ b/src/ObjectMapper.php
@@ -275,6 +275,10 @@ class ObjectMapper
throw new PropertyNotAccessibleException($propertyName);
}
+ if ($field->name == null) {
+ $field->name = $propertyName;
+ }
+
$val = null;
if ($property->isPublic()) {
$val = $object->{$propertyName}; | fix: make @JsonField->name nullable | mintware-de_json-object-mapper | train | php |
331b961819b324c92ea13d6a12ec154117f2d513 | diff --git a/plugins/snowflake/dbt/adapters/snowflake/connections.py b/plugins/snowflake/dbt/adapters/snowflake/connections.py
index <HASH>..<HASH> 100644
--- a/plugins/snowflake/dbt/adapters/snowflake/connections.py
+++ b/plugins/snowflake/dbt/adapters/snowflake/connections.py
@@ -38,6 +38,7 @@ class SnowflakeCredentials(Credentials):
token: Optional[str]
oauth_client_id: Optional[str]
oauth_client_secret: Optional[str]
+ query_tag: Optional[str]
client_session_keep_alive: bool = False
def __post_init__(self):
@@ -211,6 +212,11 @@ class SnowflakeConnectionManager(SQLConnectionManager):
**creds.auth_args()
)
+ if creds.query_tag:
+ handle.cursor().execute(
+ ("alter session set query_tag = '{}'")
+ .format(creds.query_tag))
+
connection.handle = handle
connection.state = 'open'
except snowflake.connector.errors.Error as e: | add query tag to snoflake connection dataclass and set tag on new connection if query_tag value is present | fishtown-analytics_dbt | train | py |
f0248681f4253697e5d084a548fb0cc6a53ee5b0 | diff --git a/allegedb/allegedb/cache.py b/allegedb/allegedb/cache.py
index <HASH>..<HASH> 100644
--- a/allegedb/allegedb/cache.py
+++ b/allegedb/allegedb/cache.py
@@ -529,12 +529,24 @@ class Cache(object):
for (branc, trn, tck) in self.db._active_branches(branch, turn, tick):
if branch not in branches or turn not in branches[branch]:
continue
- try:
- if branches[branc][trn][tck] is not None:
- yield key
- except HistoryError as err:
- if err.deleted:
- break
+ turnd = branches[branc]
+ if turnd.has_exact_rev(trn):
+ try:
+ if turnd[trn][tck] is not None:
+ yield key
+ break
+ except HistoryError as ex:
+ if ex.deleted:
+ break
+ else:
+ tickd = turnd[trn]
+ try:
+ if tickd[tickd.end] is not None:
+ yield key
+ break
+ except HistoryError as ex:
+ if ex.deleted:
+ break
def store(self, *args, validate=False):
"""Put a value in various dictionaries for later .retrieve(...). | Fix Cache._slow_iter_keys to account for new time structure | LogicalDash_LiSE | train | py |
2f09e29d168aaf2730cdc50369dc89c9b7dcfcf2 | diff --git a/pynes/tests/sed_test.py b/pynes/tests/sed_test.py
index <HASH>..<HASH> 100644
--- a/pynes/tests/sed_test.py
+++ b/pynes/tests/sed_test.py
@@ -4,14 +4,15 @@ import unittest
from pynes.compiler import lexical, syntax, semantic
+
class SedTest(unittest.TestCase):
def test_sed_sngl(self):
tokens = lexical('SED')
- self.assertEquals(1 , len(tokens))
+ self.assertEquals(1, len(tokens))
self.assertEquals('T_INSTRUCTION', tokens[0]['type'])
ast = syntax(tokens)
- self.assertEquals(1 , len(ast))
+ self.assertEquals(1, len(ast))
self.assertEquals('S_IMPLIED', ast[0]['type'])
code = semantic(ast)
- self.assertEquals(code, [0xf8])
\ No newline at end of file
+ self.assertEquals(code, [0xf8]) | PEP8 fixes on tests/sed_test.py | gutomaia_nesasm_py | train | py |
b939020c0bf42be193c354ee54aec5219800f275 | diff --git a/src/App.php b/src/App.php
index <HASH>..<HASH> 100644
--- a/src/App.php
+++ b/src/App.php
@@ -482,7 +482,9 @@ class App
*/
public function dbConnect($dsn, $user = null, $password = null, $args = [])
{
- return $this->db = $this->add(\atk4\data\Persistence::connect($dsn, $user, $password, $args));
+ $this->db = \atk4\data\Persistence::connect($dsn, $user, $password, $args);
+ $this->db->app = $this;
+ return $this->db;
}
protected function getRequestURI() | Link persistence with APP but don't add into layout | atk4_ui | train | php |
f73fe84ad79a4b135bc53641841fde6daaad79e6 | diff --git a/lib/regentanz/template_compiler.rb b/lib/regentanz/template_compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/regentanz/template_compiler.rb
+++ b/lib/regentanz/template_compiler.rb
@@ -24,8 +24,8 @@ module Regentanz
options[:conditions] = load_top_level_file('conditions')
options[:outputs] = load_top_level_file('outputs')
resources = load_resources
+ compile_template(resources, options)
end
- compile_template(resources, options)
end
def compile_template(resources, options = {}) | Compile template inside chdir
For the new lambda inline function, we want to be able to resolve relative file names during compilation | burtcorp_regentanz | train | rb |
12ac9bff6aff2ea5aa391a01bcf66353b9ae6845 | diff --git a/onnx/backend/test/cmd_tools.py b/onnx/backend/test/cmd_tools.py
index <HASH>..<HASH> 100644
--- a/onnx/backend/test/cmd_tools.py
+++ b/onnx/backend/test/cmd_tools.py
@@ -42,7 +42,7 @@ def generate_data(args):
# model tests
model_cases = model_test.collect_testcases()
for case in model_cases:
- output_dir = os.path.join(args.output, 'model', case.name)
+ output_dir = os.path.join(args.output, 'model', 'real', case.name)
prepare_dir(output_dir)
with open(os.path.join(output_dir, 'data.json'), 'w') as f:
json.dump({ | Fix test data generation script for real models (#<I>) | onnx_onnx | train | py |
05343351e888f09548f5ef9654a4d1f104234db7 | diff --git a/src/core/disable.js b/src/core/disable.js
index <HASH>..<HASH> 100644
--- a/src/core/disable.js
+++ b/src/core/disable.js
@@ -2,7 +2,7 @@ PROTOTYPE.disable = function(state) {
if(this.destroyed) { return this; }
if('boolean' !== typeof state) {
- state = !(this.tooltip.hasClass(CLASS_DISABLED) || this.disabled);
+ state = !(this.rendered ? this.tooltip.hasClass(CLASS_DISABLED) : this.disabled);
}
if(this.rendered) { | Fix disable method for unrendered tooltips. Fixes #<I> | qTip2_qTip2 | train | js |
8726f6eb0bd65998564a8e7c0a115c5c6e37b75e | diff --git a/pythainlp/tokenize/newmm.py b/pythainlp/tokenize/newmm.py
index <HASH>..<HASH> 100644
--- a/pythainlp/tokenize/newmm.py
+++ b/pythainlp/tokenize/newmm.py
@@ -181,8 +181,8 @@ def segment(
else:
tokens = list(_onecut(sample, custom_dict))
token_max_idx = 0
+ token_max_len = 0
for i, token in enumerate(tokens):
- token_max_len = 0
if len(token) > token_max_len:
token_max_len = len(token)
token_max_idx = i | Fix token_max_len bug that makes it always zero | PyThaiNLP_pythainlp | train | py |
8db2be79241987879563069c9a9caa90a673e2d0 | diff --git a/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ClassInfo.js b/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ClassInfo.js
index <HASH>..<HASH> 100644
--- a/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ClassInfo.js
+++ b/scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ClassInfo.js
@@ -141,9 +141,7 @@ Jsonix.Model.ClassInfo = Jsonix
this.unmarshalProperty(context, input,
anyPropertyInfo, result);
} else {
- // TODO report a validation error that element
- // is not expected
-// throw new Error('Unexpected element [' + elementNameKey + '].');
+ // TODO optionally report a validation error that the element is not expected
et = input.skipElement();
}
} else if ((et === Jsonix.XML.Input.CHARACTERS || et === Jsonix.XML.Input.CDATA || et === Jsonix.XML.Input.ENTITY_REFERENCE) && Jsonix.Util.Type.exists(this.structure.mixed)) { | Issue #<I>. Small correction. | highsource_jsonix | train | js |
f4f6edc9ec7b8194cc54324dcbe7ee473474ff37 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -23,7 +23,7 @@ function init(options) {
if (history.pushState && options.updateUrl) {
history.pushState(null, null, link.hash || '#');
}
- scrollTo(link.hash || 'html');
+ scrollTo(link.hash || 'html', options);
}
}; | pass options to scroll-to-element | willhoag_anchor-scroll | train | js |
bd6a75e29e97576f12bed0c6d8f949d7bafcd9d7 | diff --git a/qunit/qunit.js b/qunit/qunit.js
index <HASH>..<HASH> 100644
--- a/qunit/qunit.js
+++ b/qunit/qunit.js
@@ -112,7 +112,7 @@ Test.prototype = {
// Restart the tests if they're blocking
if ( config.blocking ) {
- start();
+ QUnit.start();
}
}
}, | Using node-qunit port, the start/stop function are not exposed so we need to prefix any call to them with 'QUnit'. Aka: start() -> QUnit.start() | JamesMGreene_qunit-assert-html | train | js |
22c60566e41d04bb86eeb6b31c45e1b62c11e092 | diff --git a/devices/qmotion.js b/devices/qmotion.js
index <HASH>..<HASH> 100644
--- a/devices/qmotion.js
+++ b/devices/qmotion.js
@@ -3,6 +3,7 @@ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/lega
const tz = require('../converters/toZigbee');
const e = exposes.presets;
const ea = exposes.access;
+const reporting = require('../lib/reporting');
module.exports = [
{
@@ -19,8 +20,14 @@ module.exports = [
model: 'HDM40PV620',
vendor: 'Qmotion',
description: 'Motorized roller blind',
- fromZigbee: [fz.identify],
+ fromZigbee: [fz.identify, fz.cover_position_tilt, fz.battery],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
- exposes: [e.cover_position()],
+ exposes: [e.cover_position(), e.battery()],
+ configure: async (device, coordinatorEndpoint, logger) => {
+ const endpoint = device.getEndpoint(1);
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
+ await reporting.batteryPercentageRemaining(endpoint);
+ await reporting.currentPositionLiftPercentage(endpoint);
+ },
},
]; | position & battery for Qmotion HDM<I>PV<I> (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
6228e15f4ef9f0dc56802a2990449e254c13855c | diff --git a/js/lakebtc.js b/js/lakebtc.js
index <HASH>..<HASH> 100644
--- a/js/lakebtc.js
+++ b/js/lakebtc.js
@@ -46,6 +46,12 @@ module.exports = class lakebtc extends Exchange {
],
},
},
+ 'fees': {
+ 'trading': {
+ 'maker': 0.15 / 100,
+ 'taker': 0.2 / 100,
+ },
+ },
});
} | lakebtc: taker/maker fees added | ccxt_ccxt | train | js |
e79c8ed8eaf5ef083c50ea1ae162a9036faf20ac | diff --git a/lib/cache.js b/lib/cache.js
index <HASH>..<HASH> 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -51,26 +51,27 @@ module.exports = function(self) {
callback = lifetime;
lifetime = 0;
}
+ var action = {};
var set = {
name: name,
key: key,
value: value
};
+ action.$set = set;
var unset = {};
if (lifetime) {
set.expires = new Date(new Date().getTime() + lifetime * 1000);
} else {
unset.expires = 1;
+ action.$unset = unset;
}
return self._cache.update(
{
name: name,
key: key
},
+ action,
{
- $set: set,
- $unset: unset
- }, {
upsert: true
}, callback);
}, | never send an empty because mongodb baby's gotta have it | apostrophecms_apostrophe | train | js |
9ec11c973d06fe02c0e993e8bd99aedac35876f1 | diff --git a/lib/em-systemcommand.rb b/lib/em-systemcommand.rb
index <HASH>..<HASH> 100644
--- a/lib/em-systemcommand.rb
+++ b/lib/em-systemcommand.rb
@@ -1,7 +1,6 @@
require 'open3'
require "em-systemcommand/version"
-
require "em-systemcommand/pipe"
require "em-systemcommand/pipe_handler"
@@ -16,18 +15,16 @@ module EventMachine
attr_accessor :pipes, :stdin, :stdout, :stderr
- def initialize *arguments
-
+ def initialize *args, &block
@pipes = {}
- stdin, stdout, stderr, @wait_thr = Open3.popen3(*arguments)
+ stdin, stdout, stderr, @wait_thr = Open3.popen3 *args
@stdin = attach_pipe_handler :stdin, stdin
@stdout = attach_pipe_handler :stdout, stdout
@stderr = attach_pipe_handler :stderr, stderr
yield self if block_given?
-
end
def pid | added &block as argument for `SystemCommand.new` | leoc_em-systemcommand | train | rb |
6705e8a17ae8d1446bf7ed1725f8242028d94766 | diff --git a/packages/pouchdb-adapter-leveldb-core/src/index.js b/packages/pouchdb-adapter-leveldb-core/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/pouchdb-adapter-leveldb-core/src/index.js
+++ b/packages/pouchdb-adapter-leveldb-core/src/index.js
@@ -563,6 +563,7 @@ function LevelPouch(opts, callback) {
function finish() {
compact(stemmedRevs, function (error) {
+ /* istanbul ignore if */
if (error) {
complete(error);
} | (#<I>) - Follow up to fix coverage | pouchdb_pouchdb | train | js |
66c88f88dce063fb50eea7cea83aeb54c08965a0 | diff --git a/lexer/peek.go b/lexer/peek.go
index <HASH>..<HASH> 100644
--- a/lexer/peek.go
+++ b/lexer/peek.go
@@ -13,7 +13,7 @@ func Upgrade(lex Lexer) (*PeekingLexer, error) {
for {
t, err := lex.Next()
if err != nil {
- return nil, err
+ return r, err
}
if t.EOF() {
r.eof = t | Return peeking lexer on error to allow partial AST parsing | alecthomas_participle | train | go |
830bd9742ed536d002d469be9abbdd8effb29498 | diff --git a/src/helpers.php b/src/helpers.php
index <HASH>..<HASH> 100644
--- a/src/helpers.php
+++ b/src/helpers.php
@@ -74,10 +74,6 @@ namespace localizer {
$url = request()->getRequestUri();
}
- if ($prefix = Route::current()->getPrefix()) {
- $url = substr($url, strlen($prefix));
- }
-
if ($iso instanceof Locale) {
$iso = $iso->iso6391();
} | do not cut request's prefix | TerranetMD_localizer | train | php |
e9557e9dfa60a80dc4feaf8e899cad1731b39712 | diff --git a/src/Renderer/Translation/GettextTranslator.php b/src/Renderer/Translation/GettextTranslator.php
index <HASH>..<HASH> 100644
--- a/src/Renderer/Translation/GettextTranslator.php
+++ b/src/Renderer/Translation/GettextTranslator.php
@@ -40,9 +40,7 @@ class GettextTranslator implements Translator
*/
public function translate($string)
{
- putenv('LC_ALL=' . $this->localeCode);
setlocale(LC_ALL, $this->localeCode);
-
return dgettext($this->localeCode, $string);
} | Issue #<I>: Remove obsolete 'putenv' call | lizards-and-pumpkins_catalog | train | php |
005603a56150ed6dc4da08ca97b16b591b631824 | diff --git a/h2o-core/src/main/java/water/nbhm/NonBlockingHashSet.java b/h2o-core/src/main/java/water/nbhm/NonBlockingHashSet.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/nbhm/NonBlockingHashSet.java
+++ b/h2o-core/src/main/java/water/nbhm/NonBlockingHashSet.java
@@ -40,7 +40,7 @@ public class NonBlockingHashSet<E> extends AbstractSet<E> implements Serializabl
public boolean contains ( final Object o ) { return _map.containsKey(o); }
/** @return Returns the match for {@code o} if {@code o} is in the set. */
- public E get( final E o ) { return (E)_map.getk(o); }
+ public E get( final E o ) { return _map.getk(o); }
/** Remove {@code o} from the set.
* @return <tt>true</tt> if {@code o} was removed to the set, <tt>false</tt> | Remove extra cast & javac warning | h2oai_h2o-3 | train | java |
4b0052ecf7b17e259e63d0c17c3de73d441e38d8 | diff --git a/lib/session.js b/lib/session.js
index <HASH>..<HASH> 100644
--- a/lib/session.js
+++ b/lib/session.js
@@ -272,7 +272,7 @@ Incoming.prototype.on_transfer = function(frame, receiver) {
throw Error('frame sequence error: delivery ' + this.next_delivery_id + ' not complete, got ' + frame.performative.delivery_id);
}
current = last;
- data = Buffer.concat([current.data, frame.payload], current.data.size() + frame.payload.size());
+ data = Buffer.concat([current.data, frame.payload], current.data.length + frame.payload.length);
} else if (this.next_delivery_id === frame.performative.delivery_id) {
current = {'id':frame.performative.delivery_id,
'tag':frame.performative.delivery_tag, | Fix handling of incoming multi-frame messages.
This closes #<I>. (Automated test coming soon, requires some further development). | amqp_rhea | train | js |
f2c290abb3f67ec9c61dd01451d70752b3d888de | diff --git a/packages/blueprint-mongodb/app/sanitizers/toDate.js b/packages/blueprint-mongodb/app/sanitizers/toDate.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint-mongodb/app/sanitizers/toDate.js
+++ b/packages/blueprint-mongodb/app/sanitizers/toDate.js
@@ -8,6 +8,7 @@ module.exports = function (value, opts) {
if (value === undefined || value === null)
return value;
+ opts = opts || {};
let m = null;
if (validator.isNumeric (value)) {
diff --git a/packages/blueprint-mongodb/app/validators/isDate.js b/packages/blueprint-mongodb/app/validators/isDate.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint-mongodb/app/validators/isDate.js
+++ b/packages/blueprint-mongodb/app/validators/isDate.js
@@ -8,6 +8,7 @@ module.exports = function (value, opts) {
if (value === undefined || value === null)
return false;
+ opts = opts || {};
let m = null;
if (validator.isNumeric (value)) { | isDate/toDate failed if no options were present | onehilltech_blueprint | train | js,js |
f2ca102b1e6c00e0d82718d680a88ee767c248c9 | diff --git a/src/deprecated/platformSpecificDeprecated.android.js b/src/deprecated/platformSpecificDeprecated.android.js
index <HASH>..<HASH> 100644
--- a/src/deprecated/platformSpecificDeprecated.android.js
+++ b/src/deprecated/platformSpecificDeprecated.android.js
@@ -124,6 +124,9 @@ function convertStyleParams(originalStyleObject) {
titleBarDisabledButtonColor: originalStyleObject.titleBarDisabledButtonColor,
backButtonHidden: originalStyleObject.backButtonHidden,
topTabsHidden: originalStyleObject.topTabsHidden,
+ contextualMenuStatusBarColor: originalStyleObject.contextualMenuStatusBarColor,
+ contextualMenuBackgroundColor: originalStyleObject.contextualMenuBackgroundColor,
+ contextualMenuButtonsColor: originalStyleObject.contextualMenuButtonsColor,
drawBelowTopBar: !originalStyleObject.drawUnderNavBar, | Add ability the change ContextualMenu colors | wix_react-native-navigation | train | js |
b59899f89b0b87ea368c4d8d12e398a68c985af9 | diff --git a/src/MediaLibraryServiceProvider.php b/src/MediaLibraryServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/MediaLibraryServiceProvider.php
+++ b/src/MediaLibraryServiceProvider.php
@@ -22,7 +22,7 @@ class MediaLibraryServiceProvider extends ServiceProvider
if (! class_exists('CreateMediaTable')) {
$this->publishes([
- __DIR__ . '/../database/migrations/create_media_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_media_table.php'),
+ __DIR__ . '/../database/migrations/create_media_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_media_table.php'),
], 'migrations');
} | resolved styleci issue
Updated code to resolve styleci syntactical issue | spatie_laravel-medialibrary | train | php |
65e786bd0e791467c2e2c0128f3fa1b6edeec749 | diff --git a/lib/merb-core.rb b/lib/merb-core.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core.rb
+++ b/lib/merb-core.rb
@@ -18,6 +18,15 @@ module Merb
# OR
# A "staging" environment that runs like your "production"
#
+ # ==== Examples
+ # From any environment config file (ie, development.rb, custom.rb, localdev.rb, etc)
+ # staging.rb:
+ # Merb.merge_env "production" #We want to use all the settings production uses
+ # Merb::Config.use { |c|
+ # c[:log_level] = "debug" #except we want debug log level
+ # c[:exception_details] = true #and we want to see exception details
+ # }
+ #
# ==== Parameters
# env<~String>:: Environment to run like
# use_db<~Boolean>:: Should Merb use the merged environments DB connection | Updated docs on Merb#merge_env | wycats_merb | train | rb |
bfc8a0e09676077571164226a314be16cd405451 | diff --git a/lib/shopify_theme/cli.rb b/lib/shopify_theme/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/shopify_theme/cli.rb
+++ b/lib/shopify_theme/cli.rb
@@ -51,7 +51,9 @@ module ShopifyTheme
def replace(*keys)
say("Are you sure you want to completely replace your shop theme assets? This is not undoable.", :yellow)
if ask("Continue? (Y/N): ") == "Y"
- remote_assets = keys.empty? ? ShopifyTheme.asset_list : keys
+ # only delete files on remote that are not present locally
+ # files present on remote and present locally get overridden anyway
+ remote_assets = keys.empty? ? (ShopifyTheme.asset_list - local_assets_list) : keys
remote_assets.each do |asset|
delete_asset(asset, options['quiet'])
end | Only delete remote files when necessary with theme watch command
Because files that are present locally overwrite remote files anyway,
it is not necessary to delete all files on every execution of `theme
watch`.
Only files that are not present locally are deleted on the remote side.
Speeds up the command extraordinarily in projects with tons of assets
(-> nearly all projects). | Shopify_shopify_theme | train | rb |
3c5b90f05290e3a2367ac81be192c30997c74466 | diff --git a/packages/node_modules/@ciscospark/spark-core/test/integration/spec/credentials/token.js b/packages/node_modules/@ciscospark/spark-core/test/integration/spec/credentials/token.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@ciscospark/spark-core/test/integration/spec/credentials/token.js
+++ b/packages/node_modules/@ciscospark/spark-core/test/integration/spec/credentials/token.js
@@ -88,8 +88,6 @@ describe(`spark-core`, () => {
.then((details) => {
const detailScope = details.scope.sort();
const localScope = spark.credentials.config.scope.split(` `).sort();
- console.log(localScope);
- console.log(detailScope);
assert.sameMembers(detailScope, localScope);
assert.lengthOf(detailScope, localScope.length);
assert.equal(details.clientId, spark.credentials.config.client_id); | style(@ciscospark/spark-core): remove unneeded console statement | webex_spark-js-sdk | train | js |
a30ea8ca5c321eee277ef20690301b2fd1fe631f | diff --git a/src/js/pannellum.js b/src/js/pannellum.js
index <HASH>..<HASH> 100644
--- a/src/js/pannellum.js
+++ b/src/js/pannellum.js
@@ -1913,9 +1913,9 @@ function constrainHfov(hfov) {
if (config.type == 'multires' && renderer) {
minHfov = Math.min(minHfov, renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9));
}
- if (minHfov >= config.maxHfov) {
+ if (minHfov > config.maxHfov) {
// Don't change view if bounds don't make sense
- console.log('HFOV bounds do not make sense (minHfov >= maxHfov).')
+ console.log('HFOV bounds do not make sense (minHfov > maxHfov).')
return config.hfov;
} if (hfov < minHfov) {
return minHfov; | Allow minimum and maximum HFOV to be equal (fixes #<I>). | mpetroff_pannellum | train | js |
976db025be706fa0e5559cb528ab22e0714dc162 | diff --git a/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorCliOptions.java b/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorCliOptions.java
index <HASH>..<HASH> 100644
--- a/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorCliOptions.java
+++ b/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/cli/AsciidoctorCliOptions.java
@@ -113,7 +113,7 @@ public class AsciidoctorCliOptions {
@Parameter(names = { LOAD_PATHS, "--load-path" }, description = "add a directory to the $LOAD_PATH may be specified more than once")
private String loadPath;
- @Parameter(description = "input files")
+ @Parameter(description = "input files; use - to read from STDIN")
private List<String> parameters = new ArrayList<String>();
public boolean isQuiet() { | Document reading from STDIN with '-' file name | asciidoctor_asciidoctorj | train | java |
40e5469d0494df1ccbb33fa83a476bb273fdd446 | diff --git a/src/components/sticky/sticky.js b/src/components/sticky/sticky.js
index <HASH>..<HASH> 100644
--- a/src/components/sticky/sticky.js
+++ b/src/components/sticky/sticky.js
@@ -204,7 +204,7 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
}
// If the next item is close to the current one, pull the current one down into view
- if (self.next && scrollTop >= self.next.top - self.current.height) {
+ if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {
translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));
return;
} | fix(sticky): improve onScroll logic
resolve possible RTE with `self.current` | angular_material | train | js |
20dfc7a9ac75c921dd28cf1c73c83b6050cf4369 | diff --git a/code/checkout/PaymentProcessor.php b/code/checkout/PaymentProcessor.php
index <HASH>..<HASH> 100644
--- a/code/checkout/PaymentProcessor.php
+++ b/code/checkout/PaymentProcessor.php
@@ -8,7 +8,7 @@
namespace Broarm\EventTickets;
-use Object;
+use SS_Object;
use Payment;
use SilverStripe\Omnipay\Exception\Exception;
use SilverStripe\Omnipay\GatewayInfo;
@@ -20,7 +20,7 @@ use SilverStripe\Omnipay\Service\ServiceResponse;
*
* @package Broarm\EventTickets
*/
-class PaymentProcessor extends Object
+class PaymentProcessor extends SS_Object
{
/**
* @config | Make PaymentProcessor SS<I> compatible | TheBnl_event-tickets | train | php |
ca17d1fc16a65bdc61a8570f611054f0273f39d2 | diff --git a/bosh_aws_bootstrap/lib/bosh/cli/commands/aws.rb b/bosh_aws_bootstrap/lib/bosh/cli/commands/aws.rb
index <HASH>..<HASH> 100644
--- a/bosh_aws_bootstrap/lib/bosh/cli/commands/aws.rb
+++ b/bosh_aws_bootstrap/lib/bosh/cli/commands/aws.rb
@@ -191,7 +191,7 @@ module Bosh::Cli::Command
err "VPC #{vpc.vpc_id} was not available within 60 seconds, giving up"
end
ensure
- file_path = File.join(File.dirname(config_file), OUTPUT_VPC_FILE)
+ file_path = File.join(Dir.pwd, OUTPUT_VPC_FILE)
flush_output_state file_path
say "details in #{file_path}" | VPC receipt file outputs to current working directory | cloudfoundry_bosh | train | rb |
753484d07359bc00d93e5c16bc79ea161928702c | diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go
index <HASH>..<HASH> 100644
--- a/pkg/printers/internalversion/describe.go
+++ b/pkg/printers/internalversion/describe.go
@@ -553,7 +553,11 @@ func describePod(pod *api.Pod, events *api.EventList) (string, error) {
}
}
describeVolumes(pod.Spec.Volumes, w, "")
- w.Write(LEVEL_0, "QoS Class:\t%s\n", pod.Status.QOSClass)
+ if pod.Status.QOSClass != "" {
+ w.Write(LEVEL_0, "QoS Class:\t%s\n", pod.Status.QOSClass)
+ } else {
+ w.Write(LEVEL_0, "QoS Class:\t%s\n", qos.InternalGetPodQOS(pod))
+ }
printLabelsMultiline(w, "Node-Selectors", pod.Spec.NodeSelector)
printPodTolerationsMultiline(w, "Tolerations", pod.Spec.Tolerations)
if events != nil { | kubectl: fall back to computing QoS class if server does not populate | kubernetes_kubernetes | train | go |
07d68d153b53214fcee0266274ddd2a868c2e5c1 | diff --git a/lib/fog/compute.rb b/lib/fog/compute.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/compute.rb
+++ b/lib/fog/compute.rb
@@ -67,7 +67,7 @@ module Fog
end
def self.providers
- Fog.services[:compute] || []
+ Fog.services[:compute]
end
def self.servers | This should be done at a higher level in a separate PR. | fog_fog-core | train | rb |
4325008a5fdce6f8a1d67adf3faade3b6b84cfcf | diff --git a/libs/Tree/Content.php b/libs/Tree/Content.php
index <HASH>..<HASH> 100644
--- a/libs/Tree/Content.php
+++ b/libs/Tree/Content.php
@@ -32,6 +32,7 @@ class Content extends ContentAbstract
$frontMatter = new FrontMatter();
+ // Remove BOM if it's present
if (substr($content, 0, 3) == "\xef\xbb\xbf") {
$content = substr($content, 3);
}
@@ -44,7 +45,11 @@ class Content extends ContentAbstract
*/
public function getContent()
{
- return $this->getFrontMatter()->getContent();
+ if ($this->attributes === null) {
+ $this->parseAttributes();
+ }
+
+ return $this->content;
}
/**
@@ -115,6 +120,10 @@ class Content extends ContentAbstract
$document = $this->getFrontMatter();
$this->attributes = array_replace_recursive($this->attributes, $document->getData());
+
+ if (!$this->manuallySetContent) {
+ $this->content = $document->getContent();
+ }
}
public function setAttributes(array $attributes) | Improve performance by calculating. Fixes #<I> | dauxio_daux.io | train | php |
7bced72563e5446a04cdf124bea89ae57be6194b | diff --git a/test/timeout_test.js b/test/timeout_test.js
index <HASH>..<HASH> 100644
--- a/test/timeout_test.js
+++ b/test/timeout_test.js
@@ -61,6 +61,10 @@ describe("Timeouts", function(){
assert.ok(/setTimeout/.test(html),
"Includes the task name that failed");
+ var node = helpers.dom(html);
+ var debug = node.getElementById("done-ssr-debug");
+ assert.equal(debug.getAttribute("data-keep"), "", "This attribute was added");
+
done();
}));
});
diff --git a/zones/debug/index.js b/zones/debug/index.js
index <HASH>..<HASH> 100644
--- a/zones/debug/index.js
+++ b/zones/debug/index.js
@@ -13,6 +13,7 @@ module.exports = function(/*doc, */timeoutZone){
var div = doc.createElement("div");
div.setAttribute("id", "done-ssr-debug");
+ div.setAttribute("data-keep", "");
div.innerHTML = modal;
var modalBody; | Prevent done-autorender from removing the debug modal
This adds the `data-keep` attribute to the root debug node. This
prevents done-autorender from removing the element. Closes #<I> | donejs_done-ssr | train | js,js |
46bec1332d23166c06a71c9ce8ea8315734a7965 | diff --git a/backup/extract_encryption_key.go b/backup/extract_encryption_key.go
index <HASH>..<HASH> 100644
--- a/backup/extract_encryption_key.go
+++ b/backup/extract_encryption_key.go
@@ -2,16 +2,14 @@ package backup
import (
"fmt"
- "os"
"path"
"github.com/pivotalservices/cfops/command"
"github.com/pivotalservices/cfops/osutils"
)
-var ExtractEncryptionKey = func(backupDir, deploymentDir string, exec command.CmdExecuter) (err error) {
+func ExtractEncryptionKey(backupDir, deploymentDir string, exec command.CmdExecuter) (err error) {
backupFileName := path.Join(backupDir, "cc_db_encryption_key.txt")
- os.Remove(backupFileName)
b, err := osutils.SafeCreate(backupFileName)
defer b.Close() | [#<I>] feedback changes
making changes as per review
feedback | pivotalservices_cfops | train | go |
61eca24fa7d913b05ab0ce69aa9f7515cea1f9d9 | diff --git a/lib/Websocket/Endpoint.php b/lib/Websocket/Endpoint.php
index <HASH>..<HASH> 100644
--- a/lib/Websocket/Endpoint.php
+++ b/lib/Websocket/Endpoint.php
@@ -55,5 +55,9 @@ interface Endpoint {
* ]
*/
public function getInfo(int $clientId): array;
+
+ /**
+ * @return int[] Array of client IDs.
+ */
public function getClients(): array;
} | Add missed docblock for getClients() | amphp_http-server | train | php |
86bdc0b3c1c25512b4e124d037b4fd7b4832c0fd | diff --git a/src/main/java/com/wiley/autotest/selenium/AbstractSeleniumTest.java b/src/main/java/com/wiley/autotest/selenium/AbstractSeleniumTest.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/wiley/autotest/selenium/AbstractSeleniumTest.java
+++ b/src/main/java/com/wiley/autotest/selenium/AbstractSeleniumTest.java
@@ -132,8 +132,11 @@ public abstract class AbstractSeleniumTest extends AbstractTest implements ITest
public void doAfterMethods() {
//TODO VE: sometimes local data may be needed so it's worth to make it optional/configurable
cookiesService.deleteAllCookies();
- ((JavascriptExecutor)getWebDriver()).executeScript("window.localStorage.clear();");
- ((JavascriptExecutor)getWebDriver()).executeScript("window.sessionStorage.clear();");
+ try {
+ ((JavascriptExecutor) getWebDriver()).executeScript("window.localStorage.clear();");
+ ((JavascriptExecutor) getWebDriver()).executeScript("window.sessionStorage.clear();");
+ } catch (Exception ignored) {
+ }
methodsInvoker.invokeMethodsByAnnotation(this, OurAfterMethod.class);
} | Added local storage clearing after each test | WileyLabs_teasy | train | java |
872e1bb9b3bc5b210075e49b7c2d7fc8ac7210aa | diff --git a/facade/src/main/java/org/jboss/pnc/facade/impl/BrewPusherImpl.java b/facade/src/main/java/org/jboss/pnc/facade/impl/BrewPusherImpl.java
index <HASH>..<HASH> 100644
--- a/facade/src/main/java/org/jboss/pnc/facade/impl/BrewPusherImpl.java
+++ b/facade/src/main/java/org/jboss/pnc/facade/impl/BrewPusherImpl.java
@@ -163,7 +163,7 @@ public class BrewPusherImpl implements BrewPusher {
private String getCompleteCallbackUrl() {
try {
String pncBaseUrl = StringUtils.stripEndingSlash(configuration.getGlobalConfig().getPncUrl());
- return pncBaseUrl + "/builds/%d/brew-push/complete";
+ return pncBaseUrl + "/builds/%s/brew-push/complete";
} catch (ConfigurationParseException ex) {
throw new IllegalStateException("Could not construct callback url.", ex);
} | [NCL-<I>] fix NullPointerException in brewPush | project-ncl_pnc | train | java |
dbd5e25b89e4d42213f524f997708b0bc39af648 | diff --git a/internal/uidriver/mobile/ui.go b/internal/uidriver/mobile/ui.go
index <HASH>..<HASH> 100644
--- a/internal/uidriver/mobile/ui.go
+++ b/internal/uidriver/mobile/ui.go
@@ -67,9 +67,11 @@ func (u *UserInterface) Render(chError <-chan error) error {
select {
case err := <-chError:
return err
- case renderCh <- struct{}{}:
- return opengl.Get().DoWork(renderEndCh)
+ default:
}
+
+ renderCh <- struct{}{}
+ return opengl.Get().DoWork(renderEndCh)
}
type UserInterface struct { | uidriver/mobile: Bug fix: Error must be handled whenever possible
Updates #<I> | hajimehoshi_ebiten | train | go |
a46eede6fa45aedee0621ff1fe3e212dab17ee11 | diff --git a/cookiecutter/cli.py b/cookiecutter/cli.py
index <HASH>..<HASH> 100644
--- a/cookiecutter/cli.py
+++ b/cookiecutter/cli.py
@@ -75,7 +75,9 @@ def list_installed_templates(default_config, passed_config_file):
@click.option(
'--no-input',
is_flag=True,
- help='Do not prompt for parameters and only use cookiecutter.json file content',
+ help='Do not prompt for parameters and only use cookiecutter.json file content. '
+ 'Defaults to deleting any cached resources and redownloading them. '
+ 'Cannot be combined with the --replay flag.',
)
@click.option(
'-c', '--checkout', help='branch, tag or commit to checkout after git clone',
@@ -91,7 +93,8 @@ def list_installed_templates(default_config, passed_config_file):
@click.option(
'--replay',
is_flag=True,
- help='Do not prompt for parameters and only use information entered previously',
+ help='Do not prompt for parameters and only use information entered previously. '
+ 'Cannot be combined with the --no-input flag or with extra configuration passed.',
)
@click.option(
'--replay-file', | Expand cli documentation relating to the no-input flag (#<I>) | audreyr_cookiecutter | train | py |
ceb4dffe273d463ce3263603421cf3c320e1be54 | diff --git a/src/org/jgroups/jmx/JmxConfigurator.java b/src/org/jgroups/jmx/JmxConfigurator.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/jmx/JmxConfigurator.java
+++ b/src/org/jgroups/jmx/JmxConfigurator.java
@@ -16,7 +16,9 @@ import java.util.Set;
/**
* @author Bela Ban, Vladimir Blagojevic
+ * @deprecated JMX support will be removed in 5.3 or 5.4
*/
+@Deprecated(forRemoval=true,since="5.2")
public final class JmxConfigurator {
static final Log log = LogFactory.getLog(JmxConfigurator.class); | Markes JmxConfigurator as deprecated | belaban_JGroups | train | java |
30dca2b4e16445f2f0c0c168d3920c882386f510 | diff --git a/lib/renderer/init.js b/lib/renderer/init.js
index <HASH>..<HASH> 100644
--- a/lib/renderer/init.js
+++ b/lib/renderer/init.js
@@ -64,7 +64,7 @@ if (window.location.protocol === 'chrome-devtools:') {
} else if (window.location.protocol === 'chrome-extension:') {
// Add implementations of chrome API.
require('./chrome-api').injectTo(window.location.hostname, window)
- nodeIntegration = 'true'
+ nodeIntegration = 'false'
} else {
// Override default web functions.
require('./override') | Pages in chrome extension should not have node integration | electron_electron | train | js |
2c5410594a348ff89ce68e2e0d02fe30a8cbbd68 | diff --git a/src/Keboola/Syrup/Monolog/Handler/StorageApiHandler.php b/src/Keboola/Syrup/Monolog/Handler/StorageApiHandler.php
index <HASH>..<HASH> 100644
--- a/src/Keboola/Syrup/Monolog/Handler/StorageApiHandler.php
+++ b/src/Keboola/Syrup/Monolog/Handler/StorageApiHandler.php
@@ -7,6 +7,7 @@
namespace Keboola\Syrup\Monolog\Handler;
+use Keboola\StorageApi\Client;
use Keboola\StorageApi\Event;
use Monolog\Logger;
use Keboola\Syrup\Exception\NoRequestException; | fix: logging to SAPI events (fix typehint) | keboola_syrup | train | php |
a2387b10cf0c037b385e5e7cfbb98388c5fb5803 | diff --git a/test/e2e/ingress.go b/test/e2e/ingress.go
index <HASH>..<HASH> 100644
--- a/test/e2e/ingress.go
+++ b/test/e2e/ingress.go
@@ -393,7 +393,7 @@ var _ = framework.KubeDescribe("GCE L7 LoadBalancer Controller [Feature:Ingress]
var responseTimes, creationTimes []time.Duration
var ingController *IngressController
- f := framework.Framework{BaseName: "glbc"}
+ f := framework.NewDefaultFramework("glbc")
BeforeEach(func() {
// This test requires a GCE/GKE only cluster-addon | Call NewFramework constructor instead of hand creating framework. | kubernetes_kubernetes | train | go |
ba886e5b44fdad7f2bf1d90d4ee371620b02d6d4 | diff --git a/packages/plugin-logger/src/index.js b/packages/plugin-logger/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/plugin-logger/src/index.js
+++ b/packages/plugin-logger/src/index.js
@@ -9,7 +9,8 @@ import Logger from './logger';
import config from './config';
registerPlugin(`logger`, Logger, {
- config
+ config,
+ replace: true
});
export { | fix(plugin-logger): make sure plugin-logger replaces the core logger when specifed | webex_spark-js-sdk | train | js |
9640e68f29e732c7f3f707ca8981f1bb5c6b8b48 | diff --git a/src/input/pointerevent.js b/src/input/pointerevent.js
index <HASH>..<HASH> 100644
--- a/src/input/pointerevent.js
+++ b/src/input/pointerevent.js
@@ -52,16 +52,20 @@ inherit(PointerEventInput, Input, {
var isTouch = (pointerType == INPUT_TYPE_TOUCH);
+ // get index of the event in the store
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
+
// start and mouse must be down
if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
- store.push(ev);
+ if (storeIndex < 0) {
+ store.push(ev);
+ storeIndex = store.length - 1;
+ }
} else if (eventType & (INPUT_END | INPUT_CANCEL)) {
removePointer = true;
}
- // get index of the event in the store
// it not found, so the pointer hasn't been down (so it's probably a hover)
- var storeIndex = inArray(store, ev.pointerId, 'pointerId');
if (storeIndex < 0) {
return;
} | Fixing pointer events bug falsely detecting multiple pointers
It is possible for IE to fire a "down" event without a corresponding "up"
event. If this happens, a new "down" event will be falsely added as an
additional pointer. This commit first makes sure the pointer from the
down event is not already in the store before adding it (based on
pointerId).
Fixes #<I> | hammerjs_hammer.js | train | js |
d702568b8916e0dffabd6f474b6965338baf021e | diff --git a/featuretests/upgrade_test.go b/featuretests/upgrade_test.go
index <HASH>..<HASH> 100644
--- a/featuretests/upgrade_test.go
+++ b/featuretests/upgrade_test.go
@@ -22,6 +22,7 @@ import (
"github.com/juju/juju/agent"
"github.com/juju/juju/api"
"github.com/juju/juju/apiserver/params"
+ "github.com/juju/juju/cert"
agentcmd "github.com/juju/juju/cmd/jujud/agent"
"github.com/juju/juju/cmd/jujud/agent/agenttest"
cmdutil "github.com/juju/juju/cmd/jujud/util"
@@ -58,6 +59,12 @@ type upgradeSuite struct {
oldVersion version.Binary
}
+func (s *upgradeSuite) SetUpSuite(c *gc.C) {
+ s.AgentSuite.SetUpSuite(c)
+ s.PatchValue(&cert.NewCA, coretesting.NewCA)
+ s.PatchValue(&cert.NewLeafKeyBits, 512)
+}
+
func (s *upgradeSuite) SetUpTest(c *gc.C) {
s.AgentSuite.SetUpTest(c) | Speed up certs for upgrade featuretests. | juju_juju | train | go |
5a084df54a2403fcc5cd0b51e4938258fb6cef52 | diff --git a/aeron-test-support/src/main/java/io/aeron/test/cluster/TestCluster.java b/aeron-test-support/src/main/java/io/aeron/test/cluster/TestCluster.java
index <HASH>..<HASH> 100644
--- a/aeron-test-support/src/main/java/io/aeron/test/cluster/TestCluster.java
+++ b/aeron-test-support/src/main/java/io/aeron/test/cluster/TestCluster.java
@@ -73,7 +73,7 @@ public class TestCluster implements AutoCloseable
// private static final String LOG_CHANNEL =
// "aeron:udp?term-length=512k|endpoint=224.20.30.39:24326|interface=localhost";
private static final String ARCHIVE_CONTROL_REQUEST_CHANNEL = "aeron:udp?endpoint=localhost:8010";
- private static final String ARCHIVE_CONTROL_RESPONSE_CHANNEL = "aeron:udp?endpoint=localhost:8020";
+ private static final String ARCHIVE_CONTROL_RESPONSE_CHANNEL = "aeron:udp?endpoint=localhost:0";
private static final String REPLICATION_CHANNEL = "aeron:udp?endpoint=localhost:0";
private static final String ARCHIVE_LOCAL_CONTROL_CHANNEL = "aeron:ipc";
private static final String EGRESS_CHANNEL = "aeron:udp?term-length=128k|endpoint=localhost:0"; | [Java] Use system assigned port for archive response channel in cluster tests. | real-logic_aeron | train | java |
8e2a14ba502146acb94a51f67294aa2006d1b02b | diff --git a/moto/ec2/models.py b/moto/ec2/models.py
index <HASH>..<HASH> 100644
--- a/moto/ec2/models.py
+++ b/moto/ec2/models.py
@@ -1528,6 +1528,7 @@ class RegionsAndZonesBackend(object):
"ca-central-1",
"eu-central-1",
"eu-north-1",
+ "eu-south-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
@@ -1679,6 +1680,11 @@ class RegionsAndZonesBackend(object):
Zone(region_name="eu-central-1", name="eu-central-1b", zone_id="euc1-az3"),
Zone(region_name="eu-central-1", name="eu-central-1c", zone_id="euc1-az1"),
],
+ "eu-south-1": [
+ Zone(region_name="eu-south-1", name="eu-south-1a", zone_id="eus1-az1"),
+ Zone(region_name="eu-south-1", name="eu-south-1b", zone_id="eus1-az2"),
+ Zone(region_name="eu-south-1", name="eu-south-1c", zone_id="eus1-az3"),
+ ],
"us-east-1": [
Zone(region_name="us-east-1", name="us-east-1a", zone_id="use1-az6"),
Zone(region_name="us-east-1", name="us-east-1b", zone_id="use1-az1"), | Add eu-south-1 | spulec_moto | train | py |
fe5b4526ac01b2975ea72c8dd67c60a73ed41833 | diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -7,6 +7,8 @@
namespace DVDoug\BoxPacker;
+require_once __DIR__.'/../vendor/autoload.php';
+
class TestBox implements Box
{ | Pull in autoloader explicitly in test bootstrap so works without a vendor phpunit | dvdoug_BoxPacker | train | php |
9dac208330eac6a913afe6139825a20c96e66635 | diff --git a/lib/nominet-epp.rb b/lib/nominet-epp.rb
index <HASH>..<HASH> 100644
--- a/lib/nominet-epp.rb
+++ b/lib/nominet-epp.rb
@@ -37,6 +37,10 @@ module NominetEPP
def data_namespaces(data)
data.namespaces.definitions.map(&:to_s)
end
+ def node_value(node, xpath)
+ n = node.find(xpath, xpath, node.namespaces.namespace.to_s).first
+ n && n.content.strip
+ end
def new_node(name, ns_prefix, ns_href, schema_uri, &block)
node = XML::Node.new(name)
node.namespaces.namespace = XML::Namespace.new(node, ns_prefix, ns_uri) | Add method for grabbing the value of a node from an xpath query | m247_nominet-epp | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.