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
|
|---|---|---|---|---|---|
4e3a5fc7aa69c14673a73e694513edceb72e6967
|
diff --git a/src/input.js b/src/input.js
index <HASH>..<HASH> 100644
--- a/src/input.js
+++ b/src/input.js
@@ -60,9 +60,6 @@ const createInputCaret = (element, ctx) => {
const format = (val) => {
let value = val.replace(/<|>|`|"|&/g, '?')
.replace(/\r\n|\r|\n/g,'<br/>');
- if (/firefox/i.test(navigator.userAgent)) {
- value = value.replace(/\s/g, ' ');
- }
return value;
};
|
fix(firefox): do not convert space characters to nbsp
|
deshiknaves_caret-pos
|
train
|
js
|
049aa9cca04cae2cda134e9aa7c36214823ff43e
|
diff --git a/lib/tml_rails/version.rb b/lib/tml_rails/version.rb
index <HASH>..<HASH> 100644
--- a/lib/tml_rails/version.rb
+++ b/lib/tml_rails/version.rb
@@ -30,5 +30,5 @@
#++
module TmlRails
- VERSION = '5.7.2'
+ VERSION = '5.7.3'
end
|
Updated version to <I>
|
translationexchange_tml-rails
|
train
|
rb
|
71b0facf6d64a871a734bb41d8e21bae27d9e92b
|
diff --git a/packages/graphql-language-service-server/src/startServer.js b/packages/graphql-language-service-server/src/startServer.js
index <HASH>..<HASH> 100644
--- a/packages/graphql-language-service-server/src/startServer.js
+++ b/packages/graphql-language-service-server/src/startServer.js
@@ -37,6 +37,8 @@ export default (async function startServer(
const messageReader = new SocketMessageReader(socket);
const messageWriter = new SocketMessageWriter(socket);
+ socket.on('close', () => process.exit(0));
+
messageReader.listen(message => {
try {
if (message.id != null) {
|
prevent socket from hanging when the connection ends
|
graphql_graphiql
|
train
|
js
|
2870e7ac9125f2716728196d1ed6ac2628f369cf
|
diff --git a/app/components/validated-input-component.js b/app/components/validated-input-component.js
index <HASH>..<HASH> 100644
--- a/app/components/validated-input-component.js
+++ b/app/components/validated-input-component.js
@@ -12,8 +12,14 @@ App.ValidatedInputComponent = Ember.TextField.extend({
this.set('showError', this.get('isInvalid'));
},
- keyUp: function () {
+ keyUp: function (e) {
if (this.get('isValid')) this.set('showError', false);
+
+ // format card number with spaces
+ var $target = $(e.target);
+ if ( $target.attr('name') === 'number' ) {
+ $target.payment('formatCardNumber');
+ }
},
keyDown: function (e) {
|
Issue #<I> - credit card cvv and number validations and formatting
Conflicts:
app/components/validated-input-component.js
|
dollarshaveclub_ember-uni-form
|
train
|
js
|
65ebf2a19c99187c8afaf4ce5df31ee7743ba93c
|
diff --git a/gothic/gothic.go b/gothic/gothic.go
index <HASH>..<HASH> 100644
--- a/gothic/gothic.go
+++ b/gothic/gothic.go
@@ -247,8 +247,8 @@ func getProviderName(req *http.Request) (string, error) {
}
// try to get it from the go-context's value of "provider" key
- if p := req.Context().Value("provider"); p != nil {
- return p.(string), nil
+ if p, ok := req.Context().Value("provider").(string); ok {
+ return p, nil
}
// if not found then return an empty string with the corresponding error
|
string conversion in p,ok style to prevent panic if value of returned provder is not string
|
markbates_goth
|
train
|
go
|
d85ae8745e978c9409a03632094eb13c78b16f71
|
diff --git a/framework/core/js/lib/component.js b/framework/core/js/lib/component.js
index <HASH>..<HASH> 100644
--- a/framework/core/js/lib/component.js
+++ b/framework/core/js/lib/component.js
@@ -18,6 +18,14 @@ export default class Component {
return selector ? $(this.element()).find(selector) : $(this.element());
}
+ onload(element) {
+ this.element(element);
+ }
+
+ config() {
+
+ }
+
/**
*/
@@ -28,7 +36,18 @@ export default class Component {
}
var view = function(component) {
component.props = props;
- return component.view();
+ var vdom = component.view();
+ vdom.attrs = vdom.attrs || {};
+ if (!vdom.attrs.config) {
+ vdom.attrs.config = function() {
+ var args = [].slice.apply(arguments);
+ if (!args[1]) {
+ component.onload.apply(component, args);
+ }
+ component.config.apply(component, args);
+ }
+ }
+ return vdom;
};
view.$original = this.prototype.view;
var output = {
|
Automatically hook up onload/config functions
So that every component's DOM can be config'd by extensions
|
flarum_core
|
train
|
js
|
1f9a691a6cefd017878036b4e2c15bc2e48626f1
|
diff --git a/documentation/src/state/routing.js b/documentation/src/state/routing.js
index <HASH>..<HASH> 100644
--- a/documentation/src/state/routing.js
+++ b/documentation/src/state/routing.js
@@ -1,5 +1,12 @@
export const LOCATION_CHANGE = 'LOCATION_CHANGE';
+/**
+ * This is a simple plug-in replacement for react-router-redux until it supports
+ * react-router v4.
+ *
+ * @param {Object} location - the next location object on route change.
+ * @return {Object} the action
+ */
export function updateLocation(location) {
return { type: LOCATION_CHANGE, payload: { location } };
}
|
Updated documentaiton for the routing reducer
|
mlaursen_react-md
|
train
|
js
|
6be90ce05f9d8f062e78181f3c869e3774fc2723
|
diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -30,10 +30,10 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011110200.02; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2011111500.00; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
-$release = '2.2dev (Build: 20111102)'; // Human-friendly version name
+$release = '2.2beta (Build: 20111115)';// Human-friendly version name
-$maturity = MATURITY_ALPHA; // this version's maturity level
+$maturity = MATURITY_BETA; // this version's maturity level
|
Moodle release <I>beta
|
moodle_moodle
|
train
|
php
|
1629bd9f7cf118916806893d867d6abf9a392bc7
|
diff --git a/dwave/cloud/utils.py b/dwave/cloud/utils.py
index <HASH>..<HASH> 100644
--- a/dwave/cloud/utils.py
+++ b/dwave/cloud/utils.py
@@ -475,7 +475,9 @@ class cached:
"""@cached backed by an on-disk sqlite3-based cache."""
from dwave.cloud.config import get_cache_dir
directory = kwargs.pop('directory', get_cache_dir())
- cache = diskcache.Cache(directory=directory)
+ # NOTE: use pickle v4 to support <py38
+ # TODO: consider using `diskcache.JSONDisk` if we can serialize `api.models`
+ cache = diskcache.Cache(directory=directory, disk_pickle_protocol=4)
return cls(cache=cache, **kwargs)
|
Use pickle v4 for @cached.ondisk serialization, for compatibility (#<I>)
|
dwavesystems_dwave-cloud-client
|
train
|
py
|
17ac6b3a6bebd950e1c60bf7446ed1c3c13b5b06
|
diff --git a/Job/XingMessage.php b/Job/XingMessage.php
index <HASH>..<HASH> 100755
--- a/Job/XingMessage.php
+++ b/Job/XingMessage.php
@@ -32,6 +32,11 @@ class XingMessage implements JobActionInterface
throw new \Exception('No message found for an operation with ID: '.$operationId);
}
+ $ctaService = $this->container->get('campaignchain.core.cta');
+ $message->setMessage(
+ $ctaService->processCTAs($message->getMessage(), $message->getOperation(), CTAService::FORMAT_TXT)->getContent()
+ );
+
$oauthToken = $this->container->get('campaignchain.security.authentication.client.oauth.token');
$activity = $message->getOperation()->getActivity();
$identifier = $activity->getLocation()->getIdentifier();
|
CE-<I> Added CTA processing
|
CampaignChain_operation-xing
|
train
|
php
|
423b9957bafcd34273044b1b5d22d68459d46c61
|
diff --git a/lib/ecm/cms/version.rb b/lib/ecm/cms/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ecm/cms/version.rb
+++ b/lib/ecm/cms/version.rb
@@ -1,5 +1,5 @@
module Ecm
module Cms
- VERSION = "1.0.0"
+ VERSION = "1.0.1"
end
end
|
Bumped version to <I>
|
robotex82_ecm_cms2
|
train
|
rb
|
e2f3ff26a5e14c151d99621e9090914da404b3a4
|
diff --git a/services/hh/service.go b/services/hh/service.go
index <HASH>..<HASH> 100644
--- a/services/hh/service.go
+++ b/services/hh/service.go
@@ -70,7 +70,6 @@ func (s *Service) Close() error {
if s.closing != nil {
close(s.closing)
- s.closing = nil
}
return nil
}
|
Fix data race when close hinted handoff service
|
influxdata_influxdb
|
train
|
go
|
877383de3a518dd0dac56eba7337932dd55f59ec
|
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/AbstractMemoryHttpData.java b/codec-http/src/main/java/io/netty/handler/codec/http/AbstractMemoryHttpData.java
index <HASH>..<HASH> 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/AbstractMemoryHttpData.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/AbstractMemoryHttpData.java
@@ -212,8 +212,8 @@ public abstract class AbstractMemoryHttpData extends AbstractHttpData {
int written = 0;
while (written < length) {
written += fileChannel.write(byteBuffer);
- fileChannel.force(false);
}
+ fileChannel.force(false);
fileChannel.close();
isRenamed = true;
return written == length;
|
Move force() after multiple writes, not at every steps
|
netty_netty
|
train
|
java
|
a8b67ae409e4584d8ae2fa68ca6da8d7654a3116
|
diff --git a/jax/numpy/lax_numpy.py b/jax/numpy/lax_numpy.py
index <HASH>..<HASH> 100644
--- a/jax/numpy/lax_numpy.py
+++ b/jax/numpy/lax_numpy.py
@@ -1761,8 +1761,7 @@ isneginf = _wraps(np.isneginf)(lambda x: _isposneginf(-inf, x))
@_wraps(np.isnan)
def isnan(x):
_check_arraylike("isnan", x)
- return lax.bitwise_and(lax.bitwise_not(isfinite(x)),
- lax.bitwise_not(isinf(x)))
+ return lax.ne(x, x)
@_wraps(np.nan_to_num)
def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None):
|
Switch implementation of jnp.isnan(x) to x != x.
|
tensorflow_probability
|
train
|
py
|
e91dec8195273d8690421b1e4763808874f4b1eb
|
diff --git a/lib/jsdom/level2/style.js b/lib/jsdom/level2/style.js
index <HASH>..<HASH> 100644
--- a/lib/jsdom/level2/style.js
+++ b/lib/jsdom/level2/style.js
@@ -62,7 +62,7 @@ module.exports = core => {
StyleSheetList.prototype.__proto__ = Array.prototype;
StyleSheetList.prototype.item = function item(i) {
- return this[i];
+ return Object.prototype.hasOwnProperty.call(this, i) ? this[i] : null;
};
core.StyleSheetList = StyleSheetList;
diff --git a/test/level2/style.js b/test/level2/style.js
index <HASH>..<HASH> 100644
--- a/test/level2/style.js
+++ b/test/level2/style.js
@@ -475,6 +475,13 @@ exports.tests = {
t.done();
},
+ "StyleSheetList.prototype.item returns null on index out of bounds": t => {
+ const document = jsdom.jsdom();
+ t.strictEqual(document.styleSheets[0], undefined);
+ t.strictEqual(document.styleSheets.item(0), null);
+ t.done();
+ },
+
"setting background to null works correctly (GH-1499)": t => {
const document = jsdom.jsdom();
document.body.innerHTML = `<div id="ctrl" style="background:#111;border:1px"></div>`;
|
Make StyleSheetList.prototype.item correctly return null when appropriate
Per spec, "If there is no indexth object in the collection, then the method must return null."
|
jsdom_jsdom
|
train
|
js,js
|
22caf7c7328a4e18940b38f0b2b2723ace058ff9
|
diff --git a/Classes/Flowpack/SimpleSearch/Domain/Service/SqLiteIndex.php b/Classes/Flowpack/SimpleSearch/Domain/Service/SqLiteIndex.php
index <HASH>..<HASH> 100644
--- a/Classes/Flowpack/SimpleSearch/Domain/Service/SqLiteIndex.php
+++ b/Classes/Flowpack/SimpleSearch/Domain/Service/SqLiteIndex.php
@@ -39,6 +39,7 @@ class SqLiteIndex implements IndexInterface {
*/
public function __construct($indexName, $storageFolder) {
$this->indexName = $indexName;
+ $this->storageFolder = $storageFolder;
}
/**
|
BUGFIX: storageFolder is set again
The storage folder was not set since the las commit. This is fixed now.
|
Flowpack_Flowpack.SimpleSearch
|
train
|
php
|
84e2e141fc8edb19e0a2d27c14a2fa86705cf621
|
diff --git a/tests/HTMLPurifier/AttrTransform/NameSyncTest.php b/tests/HTMLPurifier/AttrTransform/NameSyncTest.php
index <HASH>..<HASH> 100644
--- a/tests/HTMLPurifier/AttrTransform/NameSyncTest.php
+++ b/tests/HTMLPurifier/AttrTransform/NameSyncTest.php
@@ -8,7 +8,7 @@ class HTMLPurifier_AttrTransform_NameSyncTest extends HTMLPurifier_AttrTransform
$this->obj = new HTMLPurifier_AttrTransform_NameSync();
$this->accumulator = new HTMLPurifier_IDAccumulator();
$this->context->register('IDAccumulator', $this->accumulator);
- $this->config->set('Attr', 'EnableID', true);
+ $this->config->set('Attr.EnableID', true);
}
function testEmpty() {
|
Fix bad configuration call in NameSyncTest.php.
|
Masterjoa_HTMLPurifier-standalone
|
train
|
php
|
1f42d45623ba1a9677595e6f55b45930bbc5b24d
|
diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/io/test_html.py
+++ b/pandas/tests/io/test_html.py
@@ -123,7 +123,7 @@ class TestReadHtml:
@tm.network
def test_banklist_url_positional_match(self):
- url = "http://www.fdic.gov/bank/individual/failed/banklist.html"
+ url = "https://www.fdic.gov/bank/individual/failed/banklist.html"
# Passing match argument as positional should cause a FutureWarning.
with tm.assert_produces_warning(FutureWarning):
df1 = self.read_html(
@@ -136,7 +136,7 @@ class TestReadHtml:
@tm.network
def test_banklist_url(self):
- url = "http://www.fdic.gov/bank/individual/failed/banklist.html"
+ url = "https://www.fdic.gov/bank/individual/failed/banklist.html"
df1 = self.read_html(
url, match="First Federal Bank of Florida", attrs={"id": "table"}
)
|
CI/TST: use https to avoid ResourceWarning in html tests (#<I>)
|
pandas-dev_pandas
|
train
|
py
|
48a904a1b574c6c5e98cf72bb68023bf66cdf3c6
|
diff --git a/spec/stream.spec.js b/spec/stream.spec.js
index <HASH>..<HASH> 100644
--- a/spec/stream.spec.js
+++ b/spec/stream.spec.js
@@ -97,7 +97,7 @@ describe("Streaming Queries", function() {
});
- it.skip("should return the initial result", function() {
+ it("should return the initial result", function() {
var received = [];
var promise = new Promise(function(success, error) {
stream = db[bucket].find().stream();
|
skipping streaming tests on ie9
|
Baqend_js-sdk
|
train
|
js
|
4729413fb1e4236b2eab0521f34a7fe867e8a887
|
diff --git a/javascript/firefox-driver/js/syntheticMouse.js b/javascript/firefox-driver/js/syntheticMouse.js
index <HASH>..<HASH> 100644
--- a/javascript/firefox-driver/js/syntheticMouse.js
+++ b/javascript/firefox-driver/js/syntheticMouse.js
@@ -312,7 +312,7 @@ SyntheticMouse.prototype.click = function(target) {
}
if (parent && parent.tagName.toLowerCase() == 'select' && !parent.multiple) {
- goog.log.info(SyntheticMouse.LOG_, 'About to do a bot.action.click on ' + element);
+ goog.log.info(SyntheticMouse.LOG_, 'About to do a bot.action.click on ' + parent);
bot.action.click(parent, undefined /* coords */);
}
|
firefox: fix log message to say we click on parent element first
|
SeleniumHQ_selenium
|
train
|
js
|
722133963dc2c762083b2d058a181eb90658eef4
|
diff --git a/src/edeposit/amqp/calibre/calibre.py b/src/edeposit/amqp/calibre/calibre.py
index <HASH>..<HASH> 100755
--- a/src/edeposit/amqp/calibre/calibre.py
+++ b/src/edeposit/amqp/calibre/calibre.py
@@ -51,7 +51,7 @@ def convert(input_format, output_format, b64_data):
Returns:
ConversionResponse: namedtuple structure with information about output
- ` `format``, data (``b64_data``) and protocol from
+ ``format``, data (``b64_data``) and protocol from
conversion (``protocol``). Structured is defined
in :class:`__init__.ConversionResponse`.
@@ -67,13 +67,12 @@ def convert(input_format, output_format, b64_data):
with NTFile(mode="wb", suffix="." + input_format, dir="/tmp") as ifile:
ofilename = ifile.name + "." + output_format
- print ifile.name
-
# save received data to the temporary file
ifile.write(
b64decode(b64_data)
)
+ # convert file
output = sh.ebook_convert(ifile.name, ofilename)
if "EPUB output written to" not in output:
|
Removed test output, added comment.
|
edeposit_edeposit.amqp.calibre
|
train
|
py
|
ee44c835cf53aeac4744974ce27fbc8341b9bd3b
|
diff --git a/rapidoid-commons/src/main/java/org/rapidoid/config/RapidoidInitializer.java b/rapidoid-commons/src/main/java/org/rapidoid/config/RapidoidInitializer.java
index <HASH>..<HASH> 100644
--- a/rapidoid-commons/src/main/java/org/rapidoid/config/RapidoidInitializer.java
+++ b/rapidoid-commons/src/main/java/org/rapidoid/config/RapidoidInitializer.java
@@ -26,17 +26,15 @@ import org.rapidoid.log.Log;
public class RapidoidInitializer {
- private static boolean initialized;
+ private static volatile boolean initialized;
public static synchronized void initialize() {
if (!initialized) {
- Log.info("Starting Rapidoid...", "version", RapidoidInfo.version());
+ initialized = true;
- Log.info("Working directory is: " + System.getProperty("user.dir"));
+ Log.info("Starting Rapidoid...", "version", RapidoidInfo.version(), "working dir", System.getProperty("user.dir"));
Cls.getClassIfExists("org.rapidoid.web.RapidoidWebModule");
-
- initialized = true;
}
}
|
Fixed synchronization bug in the initializer.
|
rapidoid_rapidoid
|
train
|
java
|
6fcd3d5a1eabc572615e17d8a6c7c2089938f4de
|
diff --git a/cloud_blobstore/gs.py b/cloud_blobstore/gs.py
index <HASH>..<HASH> 100644
--- a/cloud_blobstore/gs.py
+++ b/cloud_blobstore/gs.py
@@ -3,6 +3,7 @@ import binascii
import datetime
import typing
+from google.api_core.exceptions import NotFound
from google.cloud.exceptions import NotFound
from google.cloud.storage import Client
from google.cloud.storage.bucket import Bucket
@@ -169,11 +170,12 @@ class GSBlobStore(BlobStore):
:return: the data
"""
bucket_obj = self._ensure_bucket_loaded(bucket)
- blob_obj = bucket_obj.get_blob(key)
- if blob_obj is None:
- raise BlobNotFoundError(f"Could not find gs://{bucket}/{key}")
+ blob_obj = bucket_obj.blob(key)
- return blob_obj.download_as_string()
+ try:
+ return blob_obj.download_as_string()
+ except NotFound:
+ raise BlobNotFoundError(f"Could not find gs://{bucket}/{key}")
@CatchTimeouts
def get_cloud_checksum(
|
Bypass get_blob convenience wrapper
See <URL>) race conditions and 2) unnecessary API calls.
This just attempts to download the blob directly without two requests, and returns BlobNotFoundError if the download fails.
|
HumanCellAtlas_cloud-blobstore
|
train
|
py
|
d1f7582633827b53612746096d738b33697999de
|
diff --git a/src/react/get-children.js b/src/react/get-children.js
index <HASH>..<HASH> 100644
--- a/src/react/get-children.js
+++ b/src/react/get-children.js
@@ -1,9 +1,13 @@
import React from 'react';
+function isChildSwiperSlide(child) {
+ return child.type && child.type.displayName.includes('SwiperSlide');
+}
+
function processChildren(c) {
const slides = [];
React.Children.toArray(c).forEach((child) => {
- if (child.type && child.type.displayName === 'SwiperSlide') {
+ if (isChildSwiperSlide(child)) {
slides.push(child);
} else if (child.props && child.props.children) {
processChildren(child.props.children).forEach((slide) => slides.push(slide));
@@ -23,7 +27,7 @@ function getChildren(c) {
};
React.Children.toArray(c).forEach((child) => {
- if (child.type && child.type.displayName === 'SwiperSlide') {
+ if (isChildSwiperSlide(child)) {
slides.push(child);
} else if (child.props && child.props.slot && slots[child.props.slot]) {
slots[child.props.slot].push(child);
|
feat(react): Allow SwiperSlide children as long as displayName includes SwiperSlide (#<I>)
Refactor getChildren to return all child components whose names contains SwiperSlide to allow for custom components in Swiper that do not have a displayName of SwiperSlide.
Adds helper function isChildSwiperSlide(child) to check if react child is a child which contains SwiperSlide in its displayName.
|
nolimits4web_swiper
|
train
|
js
|
236b6854695a5c7a1c45b60fa46b77e6277a82d1
|
diff --git a/tests/MarkupAssertionsTraitTest.php b/tests/MarkupAssertionsTraitTest.php
index <HASH>..<HASH> 100644
--- a/tests/MarkupAssertionsTraitTest.php
+++ b/tests/MarkupAssertionsTraitTest.php
@@ -105,6 +105,15 @@ class MarkupAssertionsTraitTest extends TestCase
);
}
+ public function testAssertElementContainsMultipleSelectors()
+ {
+ $this->testcase->assertElementContains(
+ 'ipsum',
+ '#main .foo',
+ '<div id="main"><span class="foo">Lorem ipsum</span></div>'
+ );
+ }
+
public function testAssertElementContainsScopesToSelector()
{
$this->expectException(AssertionFailedError::class);
|
Add another selector test to see if #<I> impacts that as well (it doesn't)
|
stevegrunwell_phpunit-markup-assertions
|
train
|
php
|
c715408a313b63f219adc0893a0d3751726a2568
|
diff --git a/mobly/test_runner.py b/mobly/test_runner.py
index <HASH>..<HASH> 100644
--- a/mobly/test_runner.py
+++ b/mobly/test_runner.py
@@ -35,7 +35,7 @@ from mobly import signals
from mobly import utils
-def main():
+def main(argv=None):
"""Execute the test class in a test module.
This is the default entry point for running a test script file directly.
@@ -50,6 +50,10 @@ def main():
If you want to implement your own cli entry point, you could use function
execute_one_test_class(test_class, test_config, test_identifier)
+
+ Args:
+ argv: A list that is then parsed as cli args. If None, defaults to cli
+ input.
"""
# Parse cli args.
parser = argparse.ArgumentParser(description="Mobly Test Executable.")
@@ -74,7 +78,9 @@ def main():
type=str,
metavar="[<TEST BED NAME1> <TEST BED NAME2> ...]",
help="Specify which test beds to run tests on.")
- args = parser.parse_args(sys.argv[1:])
+ if not argv:
+ argv = sys.argv[1:]
+ args = parser.parse_args(argv)
# Load test config file.
test_configs = config_parser.load_test_config_file(args.config[0],
args.test_bed)
|
Allow passing argv to main directly. (#<I>)
* Allow passing argv to main directly.
|
google_mobly
|
train
|
py
|
3c7c3b78065f1fc85f655bb60b3dad4ed33854a0
|
diff --git a/src/main/java/org/junit/runners/model/InitializationError.java b/src/main/java/org/junit/runners/model/InitializationError.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/junit/runners/model/InitializationError.java
+++ b/src/main/java/org/junit/runners/model/InitializationError.java
@@ -36,4 +36,14 @@ public class InitializationError extends Exception {
public List<Throwable> getCauses() {
return fErrors;
}
+
+ @Override
+ public String getMessage() {
+ StringBuilder sb = new StringBuilder(
+ String.format("There were %d errors:", fErrors.size()));
+ for (Throwable e : fErrors) {
+ sb.append(String.format("\n %s(%s)", e.getClass().getName(), e.getMessage()));
+ }
+ return sb.toString();
+ }
}
|
Give InitializationError a useful message. JUnit itself does not use the message,
but having a useful message makes debugging runners easier.
|
junit-team_junit4
|
train
|
java
|
bfefc3e7f4cc0ca1896ac52f339d171a11ffdc9a
|
diff --git a/console/commands/migrate.php b/console/commands/migrate.php
index <HASH>..<HASH> 100644
--- a/console/commands/migrate.php
+++ b/console/commands/migrate.php
@@ -277,11 +277,10 @@ $console
$file = $input->getArgument('file');
$console->loadFramework();
$db = \KService::get('koowa:database.adapter.mysqli');
- //$dump = new MySQLDump($db->getConnection();
- print class_exists('MySQLDump');
-// if ( !is_readable($file) ) {
-// throw new \Exception('Invalid SQL data file');
-// }
+ $dump = new \MySQLDump($db->getConnection());
+ $file = fopen($file, 'w');
+ $dump->write($file);
+ fclose($file);
});
?>
\ No newline at end of file
|
added db:dump task
|
anahitasocial_anahita
|
train
|
php
|
b6f4b37d2c896f92f6b003994de111d06301dfe8
|
diff --git a/src/Canvas.js b/src/Canvas.js
index <HASH>..<HASH> 100644
--- a/src/Canvas.js
+++ b/src/Canvas.js
@@ -549,8 +549,8 @@ Canvas.prototype.drawImage = function( aSource, destX, destY, destWidth, destHei
destWidth = Math.min( this._canvasContext.canvas.width, destWidth );
destHeight = Math.min( this._canvasContext.canvas.height, destHeight );
- var xScale = destWidth / aOptSourceWidth;
- var yScale = destHeight / aOptSourceHeight;
+ const xScale = destWidth / aOptSourceWidth;
+ const yScale = destHeight / aOptSourceHeight;
// when clipping the source region should remain within the image dimensions
|
replaced var declaration with const declaration
|
igorski_zCanvas
|
train
|
js
|
eeb3dafb90957289ff8bb988e14c33a5800169b1
|
diff --git a/src/RendererPlugin.js b/src/RendererPlugin.js
index <HASH>..<HASH> 100644
--- a/src/RendererPlugin.js
+++ b/src/RendererPlugin.js
@@ -7,6 +7,12 @@
class RendererPlugin {
constructor() {
this._objects = [];
+
+ /**
+ * Используется для обозначения типа плагина
+ * @type {Number}
+ */
+ this.type = 0;
}
/**
|
Add type field to RendererPlugin for better understanding
|
2gis_2gl
|
train
|
js
|
81ddfd59c3ca193ec539039707a845886b93b538
|
diff --git a/pwnypack/shellcode/translate.py b/pwnypack/shellcode/translate.py
index <HASH>..<HASH> 100644
--- a/pwnypack/shellcode/translate.py
+++ b/pwnypack/shellcode/translate.py
@@ -128,6 +128,22 @@ def translate(env, func, *args, **kwargs):
else:
value[index] = new_value
+ elif op.name == 'INPLACE_ADD':
+ value = stack.pop()
+ reg = stack.pop()
+ if not isinstance(reg, Register):
+ raise TypeError('In-place addition is only supported on registers')
+ program.extend(env.reg_add(reg, value))
+ stack.append(reg)
+
+ elif op.name == 'INPLACE_SUBTRACT':
+ value = stack.pop()
+ reg = stack.pop()
+ if not isinstance(reg, Register):
+ raise TypeError('In-place subtraction is only supported on registers')
+ program.extend(env.reg_sub(reg, value))
+ stack.append(reg)
+
else:
raise RuntimeError('Unsupported opcode: %s' % op.name)
|
Support in-place add/subtract on registers.
|
edibledinos_pwnypack
|
train
|
py
|
0fb0dfcf450cf5815505aa7910d30477242775cc
|
diff --git a/libs/options.js b/libs/options.js
index <HASH>..<HASH> 100644
--- a/libs/options.js
+++ b/libs/options.js
@@ -24,8 +24,6 @@ function parseOptions(opts) {
opts = extend(defaults, opts);
- if (opts.verbose) console.log(opts);
-
if (os.platform() === 'win32') {
opts.pipeFileToMaster = path.join(
@@ -69,6 +67,8 @@ function parseOptions(opts) {
delete opts.pipeFileFromMaster;
}
+ if (opts.verbose) console.log(opts);
+
return opts;
}
|
we don't care of what we don't need
|
eviltik_evilevents
|
train
|
js
|
d2b1ab242bd38474e91ce42b42eba1616019b644
|
diff --git a/elasticsearch-transport/spec/spec_helper.rb b/elasticsearch-transport/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-transport/spec/spec_helper.rb
+++ b/elasticsearch-transport/spec/spec_helper.rb
@@ -18,16 +18,22 @@ def jruby?
RUBY_PLATFORM =~ /\bjava\b/
end
+# The names of the connected nodes.
+#
+# @return [ Array<String> ] The node names.
+#
+# @since 7.0.0
def node_names
$node_names ||= default_client.nodes.stats['nodes'].collect do |name, stats|
stats['name']
end
end
-def total_nodes
- ELASTICSEARCH_HOSTS.size
-end
-
+# The default client.
+#
+# @return [ Elasticsearch::Client ] The default client.
+#
+# @since 7.0.0
def default_client
$client ||= Elasticsearch::Client.new(hosts: ELASTICSEARCH_HOSTS)
end
|
[CLIENT] Add documentation to spec_helper methods
|
elastic_elasticsearch-ruby
|
train
|
rb
|
6696d92ed227a8e43ae949c296f05646cb977406
|
diff --git a/test/data/test_field.py b/test/data/test_field.py
index <HASH>..<HASH> 100644
--- a/test/data/test_field.py
+++ b/test/data/test_field.py
@@ -1,4 +1,6 @@
from unittest import TestCase
+
+import six
import torchtext.data as data
@@ -94,7 +96,7 @@ class TestField(TestCase):
assert data.get_tokenizer(str.split)(test_str) == str.split(test_str)
# Test SpaCy option, and verify it properly handles punctuation.
- assert data.get_tokenizer("spacy")(test_str) == [
+ assert data.get_tokenizer("spacy")(six.text_type(test_str)) == [
"A", "string", ",", "particularly", "one", "with", "slightly",
"complex", "punctuation", "."]
|
SpaCy tok only takes unicode, so convert with six
|
pytorch_text
|
train
|
py
|
621686c22ac5111d36e3d585d0065384fc7da505
|
diff --git a/src/DbalDataProvider.php b/src/DbalDataProvider.php
index <HASH>..<HASH> 100644
--- a/src/DbalDataProvider.php
+++ b/src/DbalDataProvider.php
@@ -158,6 +158,29 @@ class DbalDataProvider extends DataProvider
public function filter($fieldName, $operator, $value)
{
+ switch ($operator) {
+ case "eq":
+ $operator = '=';
+ break;
+ case "n_eq":
+ $operator = '<>';
+ break;
+ case "gt":
+ $operator = '>';
+ break;
+ case "lt":
+ $operator = '<';
+ break;
+ case "ls_e":
+ $operator = '<=';
+ break;
+ case "gt_e":
+ $operator = '>=';
+ break;
+ default:
+ $operator = 'like';
+ break;
+ }
$this->src->andWhere("$fieldName $operator :$fieldName");
$this->src->setParameter($fieldName, $value);
return $this;
|
Update DbalDataProvider.php
Convert operator strings to SQL
|
Nayjest_Grids
|
train
|
php
|
070d1e83d74d39160702c58003c2a7ed1df9395e
|
diff --git a/tests/test_tasker.py b/tests/test_tasker.py
index <HASH>..<HASH> 100644
--- a/tests/test_tasker.py
+++ b/tests/test_tasker.py
@@ -486,11 +486,11 @@ def test_retry_generator(exc, in_init, retry_times):
error_message = 'cmd_error'
if retry_times >= 0:
- with pytest.raises(RetryGeneratorException) as exc:
+ with pytest.raises(RetryGeneratorException) as ex:
t.retry_generator(lambda *args, **kwargs: simplegen(),
*my_args, **my_kwargs)
- assert repr(error_message) in repr(exc.value)
+ assert repr(error_message) in repr(ex.value)
else:
t.retry_generator(lambda *args, **kwargs: simplegen(),
*my_args, **my_kwargs)
|
Rename conflicting var in test context manager
|
projectatomic_atomic-reactor
|
train
|
py
|
6f08b28bd4c0ee7c67ac494643a3f73e9d4b61e8
|
diff --git a/bin/test-browser.js b/bin/test-browser.js
index <HASH>..<HASH> 100755
--- a/bin/test-browser.js
+++ b/bin/test-browser.js
@@ -166,7 +166,7 @@ function startTest() {
if (err) {
clearInterval(interval);
testError(err);
- } else if (results.completed) {
+ } else if (results.completed || results.failures.length) {
clearInterval(interval);
testComplete(results);
} else {
|
(#<I>) - Fail early when running browser tests on saucelabs
|
pouchdb_pouchdb
|
train
|
js
|
c91e4e48917c6503fc490e725da1574cb5c549fe
|
diff --git a/netdiff/parsers/olsr.py b/netdiff/parsers/olsr.py
index <HASH>..<HASH> 100644
--- a/netdiff/parsers/olsr.py
+++ b/netdiff/parsers/olsr.py
@@ -25,6 +25,8 @@ class OlsrParser(BaseParser):
cost = link["tcEdgeCost"]
except KeyError as e:
raise NetParserException('Parse error, "%s" key not found' % e)
+ # original olsrd cost (jsoninfo multiplies by 1024)
+ cost = float(cost / 1024)
# add link to Graph
graph.add_edge(source, dest, weight=cost)
self.graph = graph
diff --git a/tests/olsr/tests.py b/tests/olsr/tests.py
index <HASH>..<HASH> 100644
--- a/tests/olsr/tests.py
+++ b/tests/olsr/tests.py
@@ -125,3 +125,9 @@ class TestOlsrParser(TestCase):
links=result['removed'],
expected_links=[('10.150.0.5', '10.150.0.4')]
)
+
+ def test_weight(self):
+ parser = OlsrParser(links2)
+ graph = parser.json(dict=True)
+ self.assertEqual(str(graph['links'][0]['weight'])[0:3], '27.')
+ self.assertEqual(graph['links'][1]['weight'], 1.0)
|
Corrected weight in OlsrParser
|
openwisp_netdiff
|
train
|
py,py
|
13cf9fd520f9f2d93f51a268580c4df8508e962a
|
diff --git a/src/Decorator/JaegerConnectionDecorator.php b/src/Decorator/JaegerConnectionDecorator.php
index <HASH>..<HASH> 100644
--- a/src/Decorator/JaegerConnectionDecorator.php
+++ b/src/Decorator/JaegerConnectionDecorator.php
@@ -26,10 +26,10 @@ class JaegerConnectionDecorator extends AbstractConnectionDecorator
parent::__construct($connection);
}
- public function connect()
+ public function connect(): bool
{
if ($this->isConnected()) {
- return;
+ return false;
}
$span = $this->tracer
->start('dbal.connect')
@@ -38,7 +38,7 @@ class JaegerConnectionDecorator extends AbstractConnectionDecorator
->addTag(new DbalAutoCommitTag($this->isAutoCommit()))
->addTag(new DbalNestingLevelTag($this->getTransactionNestingLevel()));
try {
- parent::connect();
+ return parent::connect();
} catch (\Exception $e) {
$span->addTag(new DbalErrorCodeTag($e->getCode()))
->addTag(new ErrorTag());
|
Fix return type for Connection::connect()
Method must return `bool` according to phpdoc in `Doctrine\DBAL\Connection::connect()`
> @return bool TRUE if the connection was successfully established, FALSE if the connection is already open.
Missed return bool leads to type error while this package used with `doctrine/migrations:^2`
|
code-tool_doctrine-dbal-jaeger
|
train
|
php
|
29ab32a95f24cf7ec92e373cccb7ca921c114fdd
|
diff --git a/fructose/index.js b/fructose/index.js
index <HASH>..<HASH> 100644
--- a/fructose/index.js
+++ b/fructose/index.js
@@ -7,4 +7,4 @@ AppRegistry.registerComponent("storybooknative", () =>
Fructose(getStories, { platform: "native" })
);
-export default Fructose(getStories);
+export default Fructose(getStories, { platform: "native" });
|
fix: adding the relevant config to allow expo to work with fructose app (#<I>)
* fix: adding the relevant config to allow expo to work with fructose app
|
newsuk_times-components
|
train
|
js
|
eae60aff8937bdf5406778416f3d4dc2125b93ac
|
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/data.rb
+++ b/lib/discordrb/data.rb
@@ -222,6 +222,17 @@ module Discordrb
@server.role(role_id.to_i)
end
end
+
+ # Update this member's voice state
+ # @note For internal use only.
+ # @!visibility private
+ def update_voice_state(channel, mute, deaf, self_mute, self_deaf)
+ @voice_channel = channel
+ @mute = mute
+ @deaf = deaf
+ @self_mute = self_mute
+ @self_deaf = self_deaf
+ end
end
# This class is a special variant of User that represents the bot's user profile (things like email addresses and the avatar).
|
Create a caching method to update a user's voice state
|
meew0_discordrb
|
train
|
rb
|
400080987e24b4a28df3963cf11ac12bcc5481a6
|
diff --git a/lang/en/resource.php b/lang/en/resource.php
index <HASH>..<HASH> 100644
--- a/lang/en/resource.php
+++ b/lang/en/resource.php
@@ -85,6 +85,7 @@ $string['resourcetypedirectory'] = 'Display a directory';
$string['resourcetypefile'] = 'Link to a file or web site';
$string['resourcetypehtml'] = 'Compose a web page';
$string['resourcetypelabel'] = 'Insert a label';
+$string['resourcetyperepository'] = 'Link to a repository object';
$string['resourcetypetext'] = 'Compose a text page';
$string['searchweb'] = 'Search for web page';
$string['serverurl'] = 'Server URL ($a->wwwroot)';
|
Added string for adding links to repositories
|
moodle_moodle
|
train
|
php
|
ea42553e79e4e3b0bc8e06a6fd47e38c6bfbd240
|
diff --git a/bus/rabbitmq/correlator.js b/bus/rabbitmq/correlator.js
index <HASH>..<HASH> 100644
--- a/bus/rabbitmq/correlator.js
+++ b/bus/rabbitmq/correlator.js
@@ -5,12 +5,15 @@ var events = require('events'),
path = require('path'),
Promise = require('bluebird'),
util = require('util');
+var warn = require('debug')('servicebus:warn');
var queues = {};
function Correlator (options) {
var self = this;
// note: if you want to cluster servicebus, provide a 'queuesfile' option param when calling .bus(options). you'll likely do a mod of the cluster.worker.id in your cluster.js file when you call fork();
+ if (cluster.isWorker && options.queuesFile === undefined) warn('Warning, to use subscriptions in a clustered app, you should specify a queuesFile option when calling .bus(options). You may want to provide something like util.format(\'.queues.worker.%s\', (cluster.worker.id % cluster.workers.length)).');
+
this.filename =
(options && options.queuesFile) ? path.join(process.cwd(), options.queuesFile)
: (cluster.isWorker) ? path.join(process.cwd(), util.format('.queues.worker.%s', cluster.worker.id))
|
added warning to clarify how to use with cluster
|
mateodelnorte_servicebus
|
train
|
js
|
bf6fb156e131b3d3d7535f00dc313ebba05b2dfc
|
diff --git a/api/src/main/java/org/cache2k/EntryRefreshController.java b/api/src/main/java/org/cache2k/EntryRefreshController.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/cache2k/EntryRefreshController.java
+++ b/api/src/main/java/org/cache2k/EntryRefreshController.java
@@ -27,7 +27,7 @@ package org.cache2k;
*
* @deprecated
*/
-public class EntryRefreshController<T> {
+public class EntryRefreshController<T> implements RefreshController<T> {
public static final EntryRefreshController INSTANCE = new EntryRefreshController();
|
fix for API compatibility to <I>
|
cache2k_cache2k
|
train
|
java
|
aca841e779627f96d1bef4e13fba9d70364824f4
|
diff --git a/pymatgen/analysis/phase_diagram.py b/pymatgen/analysis/phase_diagram.py
index <HASH>..<HASH> 100644
--- a/pymatgen/analysis/phase_diagram.py
+++ b/pymatgen/analysis/phase_diagram.py
@@ -443,12 +443,10 @@ class BasePhaseDiagram(MSONable):
Returns:
The actual ndarray used to construct the convex hull.
"""
- data = []
- for entry in self.all_entries:
- comp = entry.composition
- row = [comp.get_atomic_fraction(el) for el in self.elements]
- row.append(entry.energy_per_atom)
- data.append(row)
+ data = [
+ [e.composition.get_atomic_fraction(el) for el in self.elements] + [e.energy_per_atom]
+ for e in self.all_entries
+ ]
return np.array(data)[:, 1:]
@property
|
clean: remove for-loop for list comp
|
materialsproject_pymatgen
|
train
|
py
|
b5a6dd13959066fdf6625404752b81e5add2c8a7
|
diff --git a/cmd/bucket-policy-parser.go b/cmd/bucket-policy-parser.go
index <HASH>..<HASH> 100644
--- a/cmd/bucket-policy-parser.go
+++ b/cmd/bucket-policy-parser.go
@@ -23,7 +23,6 @@ import (
"errors"
"fmt"
"io"
- "path"
"sort"
"strings"
@@ -224,7 +223,7 @@ func resourcePrefix(resource string) string {
if strings.HasSuffix(resource, "*") {
resource = strings.TrimSuffix(resource, "*")
}
- return path.Clean(resource)
+ return resource
}
// checkBucketPolicyResources validates Resources in unmarshalled bucket policy structure.
|
Avoid path-cleaning policy resources for a better compliance with S3 (#<I>)
|
minio_minio
|
train
|
go
|
8965335b8c7107321228e3e3702cab9832751bac
|
diff --git a/cast_test.go b/cast_test.go
index <HASH>..<HASH> 100644
--- a/cast_test.go
+++ b/cast_test.go
@@ -1006,9 +1006,12 @@ func TestToDurationSliceE(t *testing.T) {
{[]string{"1s", "1m"}, []time.Duration{time.Second, time.Minute}, false},
{[]int{1, 2}, []time.Duration{1, 2}, false},
{[]interface{}{1, 3}, []time.Duration{1, 3}, false},
+ {[]time.Duration{1, 3}, []time.Duration{1, 3}, false},
+
// errors
{nil, nil, true},
{testing.T{}, nil, true},
+ {[]string{"invalid"}, nil, true},
}
for i, test := range tests {
|
Add TestToDurationSliceE cases to reach <I>% coverage
|
spf13_cast
|
train
|
go
|
7960259001082b8790aa095981c8848cf96c760b
|
diff --git a/geomdl/_exchange.py b/geomdl/_exchange.py
index <HASH>..<HASH> 100644
--- a/geomdl/_exchange.py
+++ b/geomdl/_exchange.py
@@ -373,7 +373,7 @@ def export_dict_surf(obj):
# Trim curves
if obj.trims:
trim_data = dict(count=len(obj.trims))
- trim_curve_typemap = dict(spline=export_dict_crv, freeform=export_dict_ff)
+ trim_curve_typemap = dict(spline=export_dict_crv, freeform=export_dict_ff, analytic=export_dict_ff)
trim_curves = []
for trim in obj.trims:
if trim.type in trim_curve_typemap:
|
Add support for analytic geometry types
|
orbingol_NURBS-Python
|
train
|
py
|
f65137b5cd3d3af4570cd2ea6bc7c4b43897cb9c
|
diff --git a/sos/plugins/npm.py b/sos/plugins/npm.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/npm.py
+++ b/sos/plugins/npm.py
@@ -19,7 +19,6 @@ class Npm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, SuSEPlugin):
Get info about available npm modules
"""
- requires_root = False
plugin_name = 'npm'
profiles = ('system',)
option_list = [("project_path",
|
[npm] plugin to requires_root
Until our utils support commands execution for unpriviledged users,
we should disable requires_root = False.
Resolves: #<I>
|
sosreport_sos
|
train
|
py
|
906e0a899e64efa86c2204d5930968699a14363c
|
diff --git a/examples/asitvd.js b/examples/asitvd.js
index <HASH>..<HASH> 100644
--- a/examples/asitvd.js
+++ b/examples/asitvd.js
@@ -5,6 +5,7 @@ const exports = {};
import './asitvd.css';
import ngeoSourceAsitVD from 'ngeo/source/AsitVD.js';
+import EPSG21781 from 'ngeo/proj/EPSG21781.js';
import olMap from 'ol/Map.js';
import olView from 'ol/View.js';
@@ -37,6 +38,7 @@ exports.MainController = function() {
})
],
view: new olView({
+ projection: EPSG21781,
resolutions: [250, 100, 50, 20, 10, 5, 2.5, 2, 1.5, 1, 0.5],
center: [535000, 154000],
zoom: 0
|
Set projection to view in asitvd example
|
camptocamp_ngeo
|
train
|
js
|
7390afa875290b4b646fa83c31cec35bd70fa5e0
|
diff --git a/swiftwind/core/templatetags/banking.py b/swiftwind/core/templatetags/banking.py
index <HASH>..<HASH> 100644
--- a/swiftwind/core/templatetags/banking.py
+++ b/swiftwind/core/templatetags/banking.py
@@ -22,7 +22,7 @@ def currency(value):
locale_values = []
for money in value.monies():
locale_value = locale.currency(abs(money.amount), grouping=True, symbol=money.currency.code)
- locale_value = locale_value if value >= 0 else "({})".format(locale_value)
+ locale_value = locale_value if money.amount >= 0 else "({})".format(locale_value)
locale_values.append(locale_value)
else:
locale_value = locale.currency(abs(value), grouping=True)
|
Fixes for currency rendering (needs reworking down the line)
|
adamcharnock_swiftwind
|
train
|
py
|
219ef59e2402e48f012c7e11678c44a103100162
|
diff --git a/dbussy.py b/dbussy.py
index <HASH>..<HASH> 100644
--- a/dbussy.py
+++ b/dbussy.py
@@ -1361,6 +1361,7 @@ def _loop_attach(self, loop, dispatch) :
toggled_function = handle_timeout_toggled,
data = None
)
+ self = None # avoid circularity
#end _loop_attach
class Connection :
|
avoid memory leaks due to circular refs
|
ldo_dbussy
|
train
|
py
|
5b3186e27589e1432d1ca6a82aa60604059214b8
|
diff --git a/lib/ProMotion/table/extensions/longpressable.rb b/lib/ProMotion/table/extensions/longpressable.rb
index <HASH>..<HASH> 100644
--- a/lib/ProMotion/table/extensions/longpressable.rb
+++ b/lib/ProMotion/table/extensions/longpressable.rb
@@ -18,7 +18,7 @@ module ProMotion
gesture_point = gesture.locationInView(pressed_table_view)
index_path = pressed_table_view.indexPathForRowAtPoint(gesture_point)
return unless index_path
- data_cell = cell_at(index_path)
+ data_cell = cell_at(index_path: index_path)
return unless data_cell
trigger_action(data_cell[:long_press_action], data_cell[:arguments], index_path) if data_cell[:long_press_action]
end
|
Forgot this one cell_at index_path.
|
infinitered_ProMotion
|
train
|
rb
|
3fc55744db8a4fc76abb6f0cae8fa57cdc093825
|
diff --git a/velbus/controller.py b/velbus/controller.py
index <HASH>..<HASH> 100644
--- a/velbus/controller.py
+++ b/velbus/controller.py
@@ -102,8 +102,13 @@ class Controller(object):
"""
time.sleep(3)
logging.info('Scan finished')
- callback()
-
+ self._nb_of_modules_loaded = 0
+ def module_loaded():
+ self._nb_of_modules_loaded += 1
+ if self._nb_of_modules_loaded >= len(self._modules):
+ callback()
+ for module in self._modules:
+ self._modules[module].load(module_loaded)
for address in range(0, 256):
message = velbus.ModuleTypeRequestMessage(address)
if address == 255:
@@ -145,7 +150,6 @@ class Controller(object):
if name in velbus.ModuleRegistry:
module = velbus.ModuleRegistry[name](m_type, name, address, self)
self._modules[address] = module
- #module.load()
else:
self.logger.warning("Module " + name + " is not yet supported.")
for subscriber in self.__subscribers:
|
try to load all modules as part of scan
|
thomasdelaet_python-velbus
|
train
|
py
|
dedcc5f91f353dafcfcb436ca8aebdcb40db9672
|
diff --git a/lib/ronin/ui/command_line/engine_command.rb b/lib/ronin/ui/command_line/engine_command.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/ui/command_line/engine_command.rb
+++ b/lib/ronin/ui/command_line/engine_command.rb
@@ -43,30 +43,6 @@ module Ronin
:method => :licensed_under
#
- # Initializes the engine command.
- #
- # @param [Array] arguments
- # Command-line arguments.
- #
- # @param [Array] opts
- # Additional command-line options.
- #
- # @param [Hash] config
- # Additional configuration.
- #
- # @see Command#initialize
- #
- def initialize(arguments=[],opts={},config={})
- super(arguments,opts,config)
-
- unless self.class.engine_class
- raise(StandardError,"#{self.class} does not have a defined engine_class")
- end
-
- @engine_class = self.class.engine_class
- end
-
- #
# The class to load engines from.
#
# @return [Engine]
|
Removed an unneeded initialize.
|
ronin-ruby_ronin
|
train
|
rb
|
b2c3b107baa55530363d32c9db011ef4bea2b2c9
|
diff --git a/python/kmeans.py b/python/kmeans.py
index <HASH>..<HASH> 100644
--- a/python/kmeans.py
+++ b/python/kmeans.py
@@ -46,11 +46,12 @@ kPoints = array(X.take(k))
for i in range(len(kPoints)):
kPoints[i] = kPoints[i] - mean(kPoints[i])
-convergeDist = 0.001
+convergeDist = 0.01
tempDist = 1.0
iteration = 0
+mxIteration = 100
-while tempDist > convergeDist:
+while (tempDist > convergeDist) & (iteration < mxIteration):
logging.info("(kmeans) starting iteration " + str(iteration))
closest = X.map(
lambda p : (closestPoint(p, kPoints)[0], (p, 1)))
|
Added stop based on mxIterations
|
thunder-project_thunder
|
train
|
py
|
b7691cb9e8b76209cb8f5a5c08000a51f127f984
|
diff --git a/providers/nodebb/category.js b/providers/nodebb/category.js
index <HASH>..<HASH> 100644
--- a/providers/nodebb/category.js
+++ b/providers/nodebb/category.js
@@ -230,7 +230,7 @@ exports.bindCategory = function bindCategory(forum) {
* Add a topic to this category
*
* @public
- *
+ *
* @param {string} title The title of the topic
* @param {string} body The body of the first post of the topic
*
|
chore: Fix trailing space in jsdoc because eslint hates my jsdoc template
|
SockDrawer_SockBot
|
train
|
js
|
86d4832ff0f2d3e284caab3758b5816cee03a581
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,7 @@ setup(
name="paperwork-backend",
# if you change the version, don't forget to
# * update the ChangeLog file
+ # * update the download_url in this file
version="1.1.2",
description=(
"Paperwork's backend"
@@ -35,7 +36,7 @@ There is no GUI here. The GUI is https://github.com/jflesch/paperwork .
keywords="documents",
url="https://github.com/jflesch/paperwork-backend",
download_url=("https://github.com/jflesch/paperwork-backend"
- "/archive/unstable.tar.gz"),
+ "/archive/1.1.2.tar.gz"),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
|
setup.py: Update download url
|
openpaperwork_paperwork-backend
|
train
|
py
|
d9880c0270363d58a50a1b1f95a27571dfea19f4
|
diff --git a/bin/publish.js b/bin/publish.js
index <HASH>..<HASH> 100644
--- a/bin/publish.js
+++ b/bin/publish.js
@@ -98,9 +98,13 @@ function getNextBetaVersion(packageJson) {
process.exit(1);
}
const tag = 'beta';
- // const stableVersion = packageJson.version.split('.');
- // const nextStableVersion = `${stableVersion[0]}.${parseInt(stableVersion[1]) + 1}.0`;
- const nextStableVersion = `5.0.0`;
+ let nextStableVersion;
+ if (packageJson.name === 'xterm') {
+ nextStableVersion = `5.0.0`;
+ } else {
+ const stableVersion = packageJson.version.split('.');
+ nextStableVersion = `${stableVersion[0]}.${parseInt(stableVersion[1]) + 1}.0`;
+ }
const publishedVersions = getPublishedVersions(packageJson, nextStableVersion, tag);
if (publishedVersions.length === 0) {
return `${nextStableVersion}-${tag}.1`;
|
Fix publishing addons as xterm
|
xtermjs_xterm.js
|
train
|
js
|
4f078b21b3aeb2e109358d443a6e35741a283bd0
|
diff --git a/test/app/models/thing.rb b/test/app/models/thing.rb
index <HASH>..<HASH> 100644
--- a/test/app/models/thing.rb
+++ b/test/app/models/thing.rb
@@ -1,2 +1,3 @@
class Thing < ActiveRecord::Base
+ belongs_to :person
end
diff --git a/test/test/functional/things_controller_test.rb b/test/test/functional/things_controller_test.rb
index <HASH>..<HASH> 100644
--- a/test/test/functional/things_controller_test.rb
+++ b/test/test/functional/things_controller_test.rb
@@ -41,11 +41,11 @@ class ThingsControllerTest < Test::Unit::TestCase
:awesome => true
}
- assert assigns(:thing)
- assert assigns(:person)
+ assert_not_nil assigns(:thing)
+ assert_not_nil assigns(:person)
assert_not_nil (thing = Thing.find_by_name("nillawafer"))
- assert thing.person_id == 2
assert_redirect_to thing_path(thing.person, thing)
+ assert_equal 2, thing.person_id
end
end
|
Nicer, but still not passing, tests.
git-svn-id: <URL>
|
hcatlin_make_resourceful
|
train
|
rb,rb
|
a28bb3e5d6988747f1bcd7896be07a6afe56914f
|
diff --git a/it/it-tests/src/test/java/it/ui/UiTest.java b/it/it-tests/src/test/java/it/ui/UiTest.java
index <HASH>..<HASH> 100644
--- a/it/it-tests/src/test/java/it/ui/UiTest.java
+++ b/it/it-tests/src/test/java/it/ui/UiTest.java
@@ -23,6 +23,7 @@ import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.selenium.Selenese;
import it.Category4Suite;
import org.junit.ClassRule;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import util.QaOnly;
@@ -35,6 +36,7 @@ public class UiTest {
public static Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
@Test
+ @Ignore("Temporary disable to allow 5.6-RC1 to be released")
public void test_footer() {
new SeleneseTest(
Selenese.builder().setHtmlTestsInClasspath("ui-footer",
|
Temporary disable IT to allow <I>-RC1 to be released
|
SonarSource_sonarqube
|
train
|
java
|
7c6f878c6951a91692954bd61bc41ebcbfcbb722
|
diff --git a/test/integration/022_bigquery_test/test_simple_bigquery_view.py b/test/integration/022_bigquery_test/test_simple_bigquery_view.py
index <HASH>..<HASH> 100644
--- a/test/integration/022_bigquery_test/test_simple_bigquery_view.py
+++ b/test/integration/022_bigquery_test/test_simple_bigquery_view.py
@@ -52,7 +52,8 @@ class TestSimpleBigQueryRun(TestBaseBigQueryRun):
self.run_dbt(['seed'])
self.run_dbt(['seed', '--full-refresh'])
results = self.run_dbt()
- self.assertEqual(len(results), 6)
+ # Bump expected number of results when adding new model
+ self.assertEqual(len(results), 7)
self.assert_nondupes_pass()
@@ -63,7 +64,7 @@ class TestUnderscoreBigQueryRun(TestBaseBigQueryRun):
def test_bigquery_run_twice(self):
self.run_dbt(['seed'])
results = self.run_dbt()
- self.assertEqual(len(results), 6)
+ self.assertEqual(len(results), 7)
results = self.run_dbt()
- self.assertEqual(len(results), 6)
+ self.assertEqual(len(results), 7)
self.assert_nondupes_pass()
|
Update bq integration test's expected number of models
|
fishtown-analytics_dbt
|
train
|
py
|
68f3ee4bd4516777f94135ca8d5df830ea0012b6
|
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -24,6 +24,7 @@ describe('Hapi-Sequelized', function () {
pass: 'dbPass', // db password
dialect: 'sqlite', // database type
port: 8889, // database port #
+ storage: 'test.sqlite', // db filename for sqlite dialect
models: 'test/models', // path to models directory from project root
defaults: {
timestamps: false
@@ -81,6 +82,7 @@ describe('Hapi-Sequelized', function () {
expect(config.database).to.equal(options.database);
expect(config.username).to.equal(options.user);
expect(config.password).to.equal(options.pass);
+ expect(opt.storage).to.equal(options.storage);
done();
});
|
Updating test case for storage option
Updating the test case for storage option for sqlite dialect.
|
danecando_hapi-sequelize
|
train
|
js
|
39f82d7173d283f3bc31273089cb215533169f72
|
diff --git a/lib/ronin/wordlist.rb b/lib/ronin/wordlist.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/wordlist.rb
+++ b/lib/ronin/wordlist.rb
@@ -23,6 +23,8 @@ module Ronin
#
# An Enumerable class for iterating over wordlist files or lists of words.
#
+ # @since 0.4.0
+ #
class Wordlist
include Enumerable
|
Added a @since tag to Wordlist.
|
ronin-ruby_ronin-support
|
train
|
rb
|
f30955cb15eb234f874dd55819686832c960765b
|
diff --git a/okio/src/main/java/okio/Segment.java b/okio/src/main/java/okio/Segment.java
index <HASH>..<HASH> 100644
--- a/okio/src/main/java/okio/Segment.java
+++ b/okio/src/main/java/okio/Segment.java
@@ -32,7 +32,7 @@ package okio;
*/
final class Segment {
/** The size of all segments in bytes. */
- static final int SIZE = 2048;
+ static final int SIZE = 8192;
final byte[] data;
|
Try 8 KiB segments.
We've heard reports that this dramatically increases throughput
for some applications.
|
square_okio
|
train
|
java
|
304f36079bf244424d32115b9fc8eb20ed02e12f
|
diff --git a/wily/cache.py b/wily/cache.py
index <HASH>..<HASH> 100644
--- a/wily/cache.py
+++ b/wily/cache.py
@@ -106,6 +106,8 @@ def store(config, archiver, revision, stats):
logger.debug(f"Creating {revision.key} output")
filename = root / (revision.key + ".json")
+ if filename.exists():
+ raise RuntimeError(f"File {filename} already exists, index may be corrupt.")
with open(filename, "w") as out:
out.write(json.dumps(stats, indent=2))
return filename
|
put a guard against overwritting the cache files
|
tonybaloney_wily
|
train
|
py
|
7c7fc40fa46718165d6590bfb28fb49ccc83283e
|
diff --git a/src/Listener/EntityChangedListener.php b/src/Listener/EntityChangedListener.php
index <HASH>..<HASH> 100644
--- a/src/Listener/EntityChangedListener.php
+++ b/src/Listener/EntityChangedListener.php
@@ -97,7 +97,7 @@ class EntityChangedListener
$mutated_fields = $this->meta_mutation_provider->getMutatedFields($em, $entity, $original);
if (!empty($mutated_fields)) {
- $this->logger->info(
+ $this->logger->debug(
'Going to notify a change (preFlush) to {entity_class}, which has {mutated_fields}',
[
'entity_class' => get_class($entity),
@@ -133,7 +133,7 @@ class EntityChangedListener
$mutated_fields = $this->meta_mutation_provider->getMutatedFields($em, $entity, null);
- $this->logger->info(
+ $this->logger->debug(
'Going to notify a change (prePersist) to {entity_class}, which has {mutated_fields}',
[
'entity_class' => get_class($entity),
|
Changed info() logging to debug()
|
hostnet_entity-tracker-component
|
train
|
php
|
c9dcbf2f61f44760e71e0870abb866623a737aa1
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@ requires = []
setup(
name='skosprovider',
- version='0.2.1a1',
+ version='0.2.1',
description='Abstraction layer for SKOS vocabularies.',
long_description=open('README.rst').read() + '\n\n' +
open('HISTORY.rst').read(),
|
Bumpt to version <I>.
|
koenedaele_skosprovider
|
train
|
py
|
572f13e8837ff1dd21036ba33a14fb0242e8e6e9
|
diff --git a/tests/integration/deploy/test_deploy_command.py b/tests/integration/deploy/test_deploy_command.py
index <HASH>..<HASH> 100644
--- a/tests/integration/deploy/test_deploy_command.py
+++ b/tests/integration/deploy/test_deploy_command.py
@@ -639,7 +639,7 @@ to create a managed default bucket, or run sam deploy --guided",
else:
self.fail("Companion stack was created. This should not happen with specifying image repos.")
- self.stacks.append(SAM_CLI_STACK_NAME)
+ self.stacks.append({"name": SAM_CLI_STACK_NAME})
# Remove samconfig.toml
os.remove(self.test_data_path.joinpath(DEFAULT_CONFIG_FILE_NAME))
|
Fixed Stack Name (#<I>)
|
awslabs_aws-sam-cli
|
train
|
py
|
465e74622d91a8bf6e9046100e374556fbcef918
|
diff --git a/src/widgets/ForceVerificationBlock.php b/src/widgets/ForceVerificationBlock.php
index <HASH>..<HASH> 100644
--- a/src/widgets/ForceVerificationBlock.php
+++ b/src/widgets/ForceVerificationBlock.php
@@ -69,6 +69,10 @@ class ForceVerificationBlock extends Widget
return null;
}
+ if (Yii::$app->user->id === (int) $this->contact->client_id) {
+ return null;
+ }
+
return $this->render((new \ReflectionClass($this))->getShortName(), [
'widgets' => $this->widgets,
'title' => $this->title,
|
hide verification block if client is owner of object
|
hiqdev_hipanel-module-client
|
train
|
php
|
04c30d1ad224cea8d74a0ad17057b28964866bf1
|
diff --git a/gpiozero/input_devices.py b/gpiozero/input_devices.py
index <HASH>..<HASH> 100644
--- a/gpiozero/input_devices.py
+++ b/gpiozero/input_devices.py
@@ -149,8 +149,8 @@ class WaitableInputDevice(InputDevice):
This can be set to a function which accepts no (mandatory) parameters,
or a Python function which accepts a single mandatory parameter (with
as many optional parameters as you like). If the function accepts a
- single mandatory parameter, the device that activates will be passed as
- that parameter.
+ single mandatory parameter, the device that activated will be passed
+ as that parameter.
Set this property to `None` (the default) to disable the event.
@@ -169,10 +169,10 @@ class WaitableInputDevice(InputDevice):
inactive.
This can be set to a function which accepts no (mandatory) parameters,
- or a Python function which accepts a single mandatory parameter (which
+ or a Python function which accepts a single mandatory parameter (with
as many optional parameters as you like). If the function accepts a
- single mandatory parameter, the device the deactives will be passed as
- that parameter.
+ single mandatory parameter, the device that deactivated will be
+ passed as that parameter.
Set this property to `None` (the default) to disable the event.
|
Fix speling and grandma mistakes
Several in WaitableInputDevice's attribute docstrings.
|
RPi-Distro_python-gpiozero
|
train
|
py
|
59ab24264138c597b8b1017b842e0110f737002f
|
diff --git a/icekit/api/base_tests.py b/icekit/api/base_tests.py
index <HASH>..<HASH> 100644
--- a/icekit/api/base_tests.py
+++ b/icekit/api/base_tests.py
@@ -20,6 +20,7 @@ Image = apps.get_model('icekit_plugins_image.Image')
class _BaseAPITestCase(APITestCase):
API_NAME = None # Set to reverse-able name for API URLs
API_IS_PUBLIC_READ = False
+ BASE_DATA = {}
def __init__(self, *args, **kwargs):
if not self.API_NAME:
@@ -58,6 +59,11 @@ class _BaseAPITestCase(APITestCase):
""" Pretty-print data to stdout, to help debugging unit tests """
print(json.dumps(data, indent=indent))
+ def build_item_data(self, extend_data, base_data=None):
+ if base_data is None:
+ base_data = self.BASE_DATA
+ return dict(base_data, **extend_data)
+
def listing_url(self):
""" Return the listing URL endpoint for this class's API """
return reverse('api:%s-list' % self.API_NAME)
|
#<I> Add test utility method to populate JSON data
|
ic-labs_django-icekit
|
train
|
py
|
672cb51d19ae4e5dca469d745443df901d9e6c17
|
diff --git a/snapshot/lib/snapshot/version.rb b/snapshot/lib/snapshot/version.rb
index <HASH>..<HASH> 100644
--- a/snapshot/lib/snapshot/version.rb
+++ b/snapshot/lib/snapshot/version.rb
@@ -1,4 +1,4 @@
module Snapshot
- VERSION = "1.16.0".freeze
+ VERSION = "1.16.1".freeze
DESCRIPTION = "Automate taking localized screenshots of your iOS app on every device"
end
|
[snapshot] Version bump
- Updated xcpretty dependency
- Updated spelling of _fastlane_
|
fastlane_fastlane
|
train
|
rb
|
c099791498902f251bc5903fc5855c352e6d413a
|
diff --git a/docs/simongesture.py b/docs/simongesture.py
index <HASH>..<HASH> 100644
--- a/docs/simongesture.py
+++ b/docs/simongesture.py
@@ -10,6 +10,7 @@
import random, sys, time, pygame, math, moosegesture
from pygame.locals import *
+from moosegesture import UP, UPRIGHT, RIGHT, DOWNRIGHT, DOWN,DOWNLEFT, LEFT, UPLEFT
FPS = 30 # frames per second. Increase to speed up the game.
WINDOWWIDTH = 640
@@ -38,14 +39,6 @@ DOTRADIUS = 10 # size of dot
MAXGESTURES = 100 # max number of gestures (no way the player will be able to memorize this many)
# directional constants (made to be the same as moosegesture's
-UP = 8
-UPRIGHT = 9
-RIGHT = 6
-DOWNRIGHT = 3
-DOWN = 2
-DOWNLEFT = 1
-LEFT = 4
-UPLEFT = 7
DIRECTIONS = (UP, UPRIGHT, RIGHT, DOWNRIGHT, DOWN, DOWNLEFT, LEFT, UPLEFT)
# the blue hint arrow that shows what the most recent gesture the player made is.
|
Updated SimonGesture example to work with the moosegesture.py updates.
|
asweigart_moosegesture
|
train
|
py
|
e76ef9ac8df90b20e613426bddc30b1466d4c984
|
diff --git a/Renderer.js b/Renderer.js
index <HASH>..<HASH> 100644
--- a/Renderer.js
+++ b/Renderer.js
@@ -207,7 +207,7 @@ Renderer.prototype.initNode = function (node) {
node._globalTransform = Mat4.create()
node._prevPosition = Vec3.copy(node.position)
- if (node.mesh) {
+ if (node.mesh || node.vertexArray) {
var material = node.material
if (!material) { material = node.material = {} }
if (!material.baseColorMap && (material.baseColor === undefined)) { material.baseColor = [0.95, 0.95, 0.95, 1] }
@@ -218,8 +218,10 @@ Renderer.prototype.initNode = function (node) {
// TODO: don't create mesh draw commands every frame
node._drawCommand = cmdQueue.createDrawCommand({
- // TODO: implement vertex array support // vertexArray: isVertexArray ? meshNode.mesh : undefined,
mesh: node.mesh,
+ vertexArray: node.vertexArray,
+ count: node.count,
+ primitiveType: node.primitiveType,
modelMatrix: node._globalTransform,
program: null,
uniforms: material._uniforms,
|
Renderer added vertexArray rendering
|
pex-gl_pex-renderer
|
train
|
js
|
f71f7232f257d9f97c14195440d40c59e2865567
|
diff --git a/django_freeradius/tests/base/test_models.py b/django_freeradius/tests/base/test_models.py
index <HASH>..<HASH> 100644
--- a/django_freeradius/tests/base/test_models.py
+++ b/django_freeradius/tests/base/test_models.py
@@ -187,7 +187,7 @@ class BaseTestRadiusGroup(object):
self.fail('ProtectedError not raised')
def test_undefault_group(self):
- group = self.radius_group_model.objects.get(default=1)
+ group = self.radius_group_model.objects.get(default=True)
group.default = False
try:
group.full_clean()
|
[qa] Minor cleanup in test (1 > True)
|
openwisp_django-freeradius
|
train
|
py
|
523226a2e6f1effdb177431028d6816416c4c8eb
|
diff --git a/pyramid_webassets/__init__.py b/pyramid_webassets/__init__.py
index <HASH>..<HASH> 100644
--- a/pyramid_webassets/__init__.py
+++ b/pyramid_webassets/__init__.py
@@ -65,8 +65,15 @@ class PyramidResolver(Resolver):
except ValueError as e:
if ':' in item:
e.message += '(%s)' % item
-
raise BundleError(e)
+ except AttributeError as e: # pragma: no cover
+ if e.message == "'NoneType' object has no attribute 'static_url'":
+ # render() has been called outside of a request
+ # e.g., to compile assets before handling requests
+ # and so failure is acceptable
+ pass
+ else:
+ raise
class Environment(Environment):
resolver_class = PyramidResolver
|
Allow render() to be called on a bundle outside of a request
|
sontek_pyramid_webassets
|
train
|
py
|
4b099aeeca121a99b7ae1b0410665ab47cff2be9
|
diff --git a/src/cli/cms/editor/index.js b/src/cli/cms/editor/index.js
index <HASH>..<HASH> 100755
--- a/src/cli/cms/editor/index.js
+++ b/src/cli/cms/editor/index.js
@@ -20,6 +20,7 @@ import {
printInput,
getAttributes,
getLabel,
+ hint,
createInputSource,
createInputRich,
createInputFile,
@@ -58,6 +59,7 @@ export {
printInput,
getAttributes,
getLabel,
+ hint,
createInputSource,
createInputRich,
createInputFile,
|
enhancement: exposing the hint function to abe
|
abecms_abecms
|
train
|
js
|
e69f1bce166e50b1260715824bf2b5799fa62488
|
diff --git a/src/scripts/dataset/dataset.store.js b/src/scripts/dataset/dataset.store.js
index <HASH>..<HASH> 100644
--- a/src/scripts/dataset/dataset.store.js
+++ b/src/scripts/dataset/dataset.store.js
@@ -647,7 +647,7 @@ let datasetStore = Reflux.createStore({
this.updateDirectoryState(container._id, {children: children, loading: false});
});
} else {
- file.modifiedName = container.dirPath + file.name;
+ file.modifiedName = container.dirPath ? container.dirPath + file.name : file.name;
scitran.updateFile('projects', this.data.dataset._id, file, () => {
let children = container.children;
children.unshift({
|
Fix issue with adding files to base directory of a dataset.
|
OpenNeuroOrg_openneuro
|
train
|
js
|
39c7a79140fbf46f5966bfc1e1a0883719f6fd67
|
diff --git a/scripts/test-isolated.js b/scripts/test-isolated.js
index <HASH>..<HASH> 100755
--- a/scripts/test-isolated.js
+++ b/scripts/test-isolated.js
@@ -95,6 +95,7 @@ globby(patterns).then(paths => {
FORCE_COLOR: '1',
HOME: process.env.HOME,
PATH: process.env.PATH,
+ TMPDIR: process.env.TMPDIR,
USERPROFILE: process.env.USERPROFILE,
},
}).then(onFinally, error => {
|
Ensure to expose TMPDIR to nested processes
|
serverless_serverless
|
train
|
js
|
a0d30efa8846d13fba3922efcf4b8d59d0c515dc
|
diff --git a/lib/dynamic_image/model/dimensions.rb b/lib/dynamic_image/model/dimensions.rb
index <HASH>..<HASH> 100644
--- a/lib/dynamic_image/model/dimensions.rb
+++ b/lib/dynamic_image/model/dimensions.rb
@@ -21,17 +21,14 @@ module DynamicImage
private
- def null_vector
- Vector2d.new(0, 0)
- end
-
def valid_vector_string?(str)
(str && str =~ /^\d+x\d+$/) ? true : false
end
def vector(str)
- return nil unless valid_vector_string?(str)
- Vector2d.parse(str)
+ if valid_vector_string?(str)
+ Vector2d.parse(str)
+ end
end
end
end
|
Don't leave crap laying around
|
elektronaut_dynamic_image
|
train
|
rb
|
a3e2a051ad1a63db8475ecb2b13295b92cd92c54
|
diff --git a/bin/run.js b/bin/run.js
index <HASH>..<HASH> 100755
--- a/bin/run.js
+++ b/bin/run.js
@@ -178,6 +178,9 @@ const results = zip(pool, tests).pipe(
);
const emitter = new ResultsEmitter(results);
+emitter.on('fail', function () {
+ process.exitCode = 1;
+});
reporter(emitter, reporterOpts);
function printVersion() {
|
feat: set exitCode to 1 when a test fails
|
bterlson_test262-harness
|
train
|
js
|
91b1aa716812dcc7643402868b379c33a5997a21
|
diff --git a/src/vis/vis.js b/src/vis/vis.js
index <HASH>..<HASH> 100644
--- a/src/vis/vis.js
+++ b/src/vis/vis.js
@@ -428,19 +428,24 @@ var Vis = View.extend({
});
if (!options.skipMapInstantiation) {
- this.instantiateMap();
+ this._instantiateMap();
}
return this;
},
- instantiateMap: function (invalidateMapSize) {
+ /**
+ * Force a map instantiation.
+ * Only expected to be called if {skipMapInstantiation} flag is set to true when vis is created.
+ */
+ instantiateMap: function () {
+ this._instantiateMap();
+ this.mapView.invalidateSize();
+ },
+
+ _instantiateMap: function (invalidateMapSize) {
this._dataviewsCollection.on('add reset remove', _.debounce(this._invalidateSizeOnDataviewsChanges, 10), this);
this.map.instantiateMap();
-
- if (invalidateMapSize) {
- this.mapView.invalidateSize();
- }
},
_newLayerModels: function (vizjson, map) {
|
Improve map instantiation mechanism
Make the public method to not require any argument, and explain what
it’s intended for.
|
CartoDB_carto.js
|
train
|
js
|
044f8bdf625dae78e4e230b9c61d9881864e2def
|
diff --git a/activesupport/test/core_ext/kernel_test.rb b/activesupport/test/core_ext/kernel_test.rb
index <HASH>..<HASH> 100644
--- a/activesupport/test/core_ext/kernel_test.rb
+++ b/activesupport/test/core_ext/kernel_test.rb
@@ -49,19 +49,3 @@ class KernelSuppressTest < ActiveSupport::TestCase
suppress(LoadError, ArgumentError) { raise ArgumentError }
end
end
-
-class MockStdErr
- attr_reader :output
- def puts(message)
- @output ||= []
- @output << message
- end
-
- def info(message)
- puts(message)
- end
-
- def write(message)
- puts(message)
- end
-end
|
Unused class for testing since <I>da<I>d<I>f8cfa<I>b<I>b4a<I>
|
rails_rails
|
train
|
rb
|
a93afa1d7d4f4cc4687c247e2e00bc328feb0c94
|
diff --git a/src/Smf/Menu/Renderer/BootstrapNavRenderer.php b/src/Smf/Menu/Renderer/BootstrapNavRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Smf/Menu/Renderer/BootstrapNavRenderer.php
+++ b/src/Smf/Menu/Renderer/BootstrapNavRenderer.php
@@ -77,7 +77,8 @@ class BootstrapNavRenderer extends ListRenderer
if (!is_null($item)
&& $options['depth'] !== 0
&& $item->hasChildren()
- && $item->getDisplayChildren()) {
+ && $item->getDisplayChildren()
+ && !is_null($result)) {
$result->class = (array) $result->class;
if ($this->getRealLevel($item, $options) === 1) {
|
skipping null result, when the item should not be displayed
adding $result->class to null creates StdClass silently, yields error
later in the code
|
trunda_SmfMenu
|
train
|
php
|
5cab679872e7e1a29547d2f6cdda0910f891607e
|
diff --git a/src/qinfer/resamplers.py b/src/qinfer/resamplers.py
index <HASH>..<HASH> 100644
--- a/src/qinfer/resamplers.py
+++ b/src/qinfer/resamplers.py
@@ -203,6 +203,6 @@ class LiuWestResampler(object):
# particles represent the information that used to be stored in the
# weights. This is done by SMCUpdater, and so we simply need to return
# the new locations here.
- return new_locs
+ return np.ones((w.shape[0],)) / w.shape[0], new_locs
|
Fixed problem w/ most recent merge.
|
QInfer_python-qinfer
|
train
|
py
|
f875577197c307116f11c33be0d3f1f95594a500
|
diff --git a/hugolib/site.go b/hugolib/site.go
index <HASH>..<HASH> 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -81,10 +81,10 @@ func (site *Site) Render() {
site.timer.Step("render and write indexes")
site.RenderLists()
site.timer.Step("render and write lists")
- site.RenderPages()
- site.timer.Step("render pages")
site.ProcessShortcodes()
site.timer.Step("render shortcodes")
+ site.RenderPages()
+ site.timer.Step("render pages")
site.RenderHomePage()
site.timer.Step("render and write homepage")
}
@@ -178,9 +178,7 @@ func (s *Site) checkDirectories() {
func (s *Site) ProcessShortcodes() {
for i, _ := range s.Pages {
- var bb bytes.Buffer
- bb.WriteString(ShortcodesHandle(s.Pages[i].RenderedContent.String(), s.Pages[i], s.Tmpl))
- s.Pages[i].RenderedContent = &bb
+ s.Pages[i].Content = template.HTML(ShortcodesHandle(string(s.Pages[i].Content), s.Pages[i], s.Tmpl))
}
}
|
rendering shortcodes earlier for better performance
|
gohugoio_hugo
|
train
|
go
|
03b4e24c9d58620cc597a9c3857d61c3913dac9d
|
diff --git a/karma.conf.ci.js b/karma.conf.ci.js
index <HASH>..<HASH> 100644
--- a/karma.conf.ci.js
+++ b/karma.conf.ci.js
@@ -61,19 +61,19 @@ module.exports = function (config) {
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11'
- }
+ },
//slIE10: {
// base: 'SauceLabs',
// browserName: 'internet explorer',
// platform: 'Windows 8',
// version: '10'
//},
- //slIE9: {
- // base: 'SauceLabs',
- // browserName: 'internet explorer',
- // platform: 'Windows 7',
- // version: '9'
- //}
+ slIE9: {
+ base: 'SauceLabs',
+ browserName: 'internet explorer',
+ platform: 'Windows 7',
+ version: '9'
+ }
};
config.set({
|
Add IE9 to CI.
|
stacktracejs_stacktrace-gps
|
train
|
js
|
691223b222c03b442b2080ef681c8e348e5fa1b8
|
diff --git a/lib/curation_concerns/version.rb b/lib/curation_concerns/version.rb
index <HASH>..<HASH> 100644
--- a/lib/curation_concerns/version.rb
+++ b/lib/curation_concerns/version.rb
@@ -1,3 +1,3 @@
module CurationConcerns
- VERSION = "1.1.2".freeze
+ VERSION = "1.2.0".freeze
end
|
Bump to version <I>
|
samvera_hyrax
|
train
|
rb
|
a6bc31ed74b1bc85a36a5c77522b7e12dbf94af7
|
diff --git a/app/models/manager_refresh/inventory_collection_default.rb b/app/models/manager_refresh/inventory_collection_default.rb
index <HASH>..<HASH> 100644
--- a/app/models/manager_refresh/inventory_collection_default.rb
+++ b/app/models/manager_refresh/inventory_collection_default.rb
@@ -72,6 +72,24 @@ class ManagerRefresh::InventoryCollectionDefault
attributes.merge!(extra_attributes)
end
+ def operating_systems(extra_attributes = {})
+ attributes = {
+ :model_class => ::OperatingSystem,
+ :manager_ref => [:vm_or_template],
+ :association => :operating_systems,
+ :parent_inventory_collections => [:vms, :miq_templates],
+ }
+
+ attributes[:targeted_arel] = lambda do |inventory_collection|
+ manager_uuids = inventory_collection.parent_inventory_collections.flat_map { |c| c.manager_uuids.to_a }
+ inventory_collection.parent.operating_systems.joins(:vm_or_template).where(
+ 'vms' => {:ems_ref => manager_uuids}
+ )
+ end
+
+ attributes.merge!(extra_attributes)
+ end
+
def disks(extra_attributes = {})
attributes = {
:model_class => ::Disk,
|
Allowing OperatingSystem for CloudManager graph refresh
Allowing OperatingSystem for CloudManager graph refresh
Partially fixes BZ:
<URL>
|
ManageIQ_inventory_refresh
|
train
|
rb
|
e559daa2635aba589e8c5810942c4a2a17624b26
|
diff --git a/src/main/java/ca/jeb/common/gpb/ProtobufSerialization.java b/src/main/java/ca/jeb/common/gpb/ProtobufSerialization.java
index <HASH>..<HASH> 100644
--- a/src/main/java/ca/jeb/common/gpb/ProtobufSerialization.java
+++ b/src/main/java/ca/jeb/common/gpb/ProtobufSerialization.java
@@ -85,7 +85,7 @@ public class ProtobufSerialization<G extends GeneratedMessage, P extends Object>
}
// 2. Call recursively if this is a ProtobufEntity
- serializeProtobufEntity(value);
+ value = serializeProtobufEntity(value);
String setter = "set" + JStringUtils.upperCaseFirst(fieldName);
if (value instanceof Collection)
|
Assign value from the other serializer
Assign value from the other serializer
|
ebourgeois_common-java
|
train
|
java
|
04ba462dcfe0244fcf09c22102db4244f5b118bd
|
diff --git a/classes/Gems/Tracker/Respondent.php b/classes/Gems/Tracker/Respondent.php
index <HASH>..<HASH> 100644
--- a/classes/Gems/Tracker/Respondent.php
+++ b/classes/Gems/Tracker/Respondent.php
@@ -508,7 +508,11 @@ class Gems_Tracker_Respondent extends \Gems_Registry_TargetAbstract
$respTrack->setReceptionCode($newCode, null, $this->currentUser->getUserId());
$respTrack->restoreTokens($oldCode, $newCode);
$count++;
- }
+ } else {
+ // If the code was not assigned to the track, still try to restore tokens
+ $tmpCount = $respTrack->restoreTokens($oldCode, $newCode);
+ $count = $count + min($tmpCount, 1);
+ }
}
}
}
@@ -541,4 +545,4 @@ class Gems_Tracker_Respondent extends \Gems_Registry_TargetAbstract
$this->getReceptionCode()
);
}
-}
\ No newline at end of file
+}
|
Restore tokens with same code when restioring a respondent
When the respondent code was not assigned to a track, the tokens for that track were not restored when restoring the respondent.
|
GemsTracker_gemstracker-library
|
train
|
php
|
bb4cd50e629705a46292fd79aad3c22aca6072d9
|
diff --git a/Kwf/Validate/NoTags.php b/Kwf/Validate/NoTags.php
index <HASH>..<HASH> 100644
--- a/Kwf/Validate/NoTags.php
+++ b/Kwf/Validate/NoTags.php
@@ -10,16 +10,17 @@ class Kwf_Validate_NoTags extends Zend_Validate_Abstract
public function isValid($value)
{
- if (!$value) return true;
+ $ret = true;
if (!is_array($value)) {
- $value = array($value);
- }
- foreach ($value as $key => $val) {
- if (strip_tags($val) != $val || stripos($val, 'Content-Type:') !== false) {
+ if (strip_tags($value) != $value || stripos($value, 'Content-Type:') !== false) {
$this->_error(self::INVALID_TAGS);
- return false;
+ $ret = false;
+ }
+ } else {
+ foreach ($value as $val) {
+ $ret = $ret && $this->isValid($val);
}
}
- return true;
+ return $ret;
}
}
|
NoTagsValidator: recursively check value if array
This should also work for custom columnDEserialiser
|
koala-framework_koala-framework
|
train
|
php
|
97149bf387329c9421b6a86a21791c2d87c94449
|
diff --git a/Kwf/Auth/Adapter/Service.php b/Kwf/Auth/Adapter/Service.php
index <HASH>..<HASH> 100644
--- a/Kwf/Auth/Adapter/Service.php
+++ b/Kwf/Auth/Adapter/Service.php
@@ -117,7 +117,7 @@ class Kwf_Auth_Adapter_Service implements Zend_Auth_Adapter_Interface
private function _getCacheId()
{
- return 'login_brute_force_'.str_replace(array('.', ':'), array('_', '_'), $_SERVER['REMOTE_ADDR']);
+ return 'login_brute_force_'.preg_replace('/[^0-9a-z_]/', '_', $_SERVER['REMOTE_ADDR']);
}
private function _getCache()
|
Escape cacheId correctly
REMOTE_ADDR can contain multiple ip adresses separated with ', ' (if set by a proxy)
|
koala-framework_koala-framework
|
train
|
php
|
1ca27b052f02fdd3921152a9d399a874ce123f8d
|
diff --git a/lib/punchblock/call.rb b/lib/punchblock/call.rb
index <HASH>..<HASH> 100644
--- a/lib/punchblock/call.rb
+++ b/lib/punchblock/call.rb
@@ -4,12 +4,20 @@ module Punchblock
# This class represents an active Ozone call
#
class Call
- attr_accessor :id
+ attr_accessor :id, :to, :headers
def initialize(id, to, headers)
@id = id
@to = to
- @headers = headers
+ # Ensure all our headers have lowercase names and convert to symbols
+ @headers = headers.inject({}) {|headers,pair|
+ headers[pair.shift.downcase.to_sym] = pair.shift
+ headers
+ }
+ end
+
+ def to_s
+ "#<Punchblock::Call:#{@id}>"
end
end
end
|
Ensure all headers have lowercase symbols for names
|
adhearsion_punchblock
|
train
|
rb
|
bcf1967dd0893b36c56c8c9b87c84246916484a1
|
diff --git a/builder/builder-next/executor_unix.go b/builder/builder-next/executor_unix.go
index <HASH>..<HASH> 100644
--- a/builder/builder-next/executor_unix.go
+++ b/builder/builder-next/executor_unix.go
@@ -15,6 +15,7 @@ import (
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/network"
specs "github.com/opencontainers/runtime-spec/specs-go"
+ "github.com/sirupsen/logrus"
)
const networkName = "bridge"
@@ -100,10 +101,10 @@ func (iface *lnInterface) Set(s *specs.Spec) {
func (iface *lnInterface) Close() error {
<-iface.ready
- err := iface.sbx.Delete()
- if iface.err != nil {
- // iface.err takes precedence over cleanup errors
- return iface.err
- }
- return err
+ go func() {
+ if err := iface.sbx.Delete(); err != nil {
+ logrus.Errorf("failed to delete builder network sandbox: %v", err)
+ }
+ }()
+ return iface.err
}
|
builder: delete sandbox in a goroutine for performance
|
moby_moby
|
train
|
go
|
76cfebcbcbc89af41fbd7e2cb0ed7c896dc6af76
|
diff --git a/app/Gruntfile.js b/app/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/app/Gruntfile.js
+++ b/app/Gruntfile.js
@@ -124,7 +124,7 @@ module.exports = function (grunt) {
},
src: [
'<%= config.node %>/promise-polyfill/dist/polyfill.min.js',
- '<%= config.node %>/whatwg-fetch/fetch.js'
+ '<%= config.node %>/whatwg-fetch/dist/fetch.umd.js'
],
dest: '<%= config.public %>/js/polyfill.min.js'
},
|
JBEAP-<I>: Use 'fetch.umd.js' as polyfill
|
hal_console
|
train
|
js
|
00938f51cbc84c187034f53d56b5042165b73d49
|
diff --git a/lib/capybara/spec/session/has_current_path_spec.rb b/lib/capybara/spec/session/has_current_path_spec.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/spec/session/has_current_path_spec.rb
+++ b/lib/capybara/spec/session/has_current_path_spec.rb
@@ -37,8 +37,24 @@ Capybara::SpecHelper.spec '#has_current_path?' do
expect(@session).to have_current_path('/with_js?test=test')
end
- it "should compare the full url" do
+ it "should compare the full url if url: true is used" do
expect(@session).to have_current_path(%r{\Ahttp://[^/]*/with_js\Z}, url: true)
+ domain_port = if @session.respond_to?(:server) && @session.server
+ "#{@session.server.host}:#{@session.server.port}"
+ else
+ "www.example.com"
+ end
+ expect(@session).to have_current_path("http://#{domain_port}/with_js", url: true)
+ end
+
+ it "should not compare the full url if url: true is not passed" do
+ expect(@session).to have_current_path(%r{^/with_js\Z})
+ expect(@session).to have_current_path('/with_js')
+ end
+
+ it "should not compare the full url if url: false is passed" do
+ expect(@session).to have_current_path(%r{^/with_js\Z}, url: false)
+ expect(@session).to have_current_path('/with_js', url: false)
end
it "should ignore the query" do
|
Add tests for current_path matcher
|
teamcapybara_capybara
|
train
|
rb
|
45608919713cb8c32947be18f84177ec00ef1943
|
diff --git a/salt/states/environ.py b/salt/states/environ.py
index <HASH>..<HASH> 100644
--- a/salt/states/environ.py
+++ b/salt/states/environ.py
@@ -6,25 +6,24 @@ of the current salt process.
# Import python libs
import os
-import logging
# Import salt libs
from salt._compat import string_types
from salt.exceptions import SaltException
-log = logging.getLogger(__name__)
+__func_alias__ = {
+ 'set_': 'set'
+}
-# Define the module's virtual name
-__virtualname__ = 'environ'
def __virtual__():
'''
- No dependency checks, so just return the __virtualname__
+ No dependency checks, and not renaming, just return True
'''
- return __virtualname__
+ return True
-def set(name, value):
+def set_(name, value):
'''
Set the salt process environment variables.
@@ -51,7 +50,7 @@ def set(name, value):
- name: does_not_matter
- value:
foo: bar
- baz: quux
+ baz: quux
'''
ret = {'name': name,
@@ -93,4 +92,3 @@ def set(name, value):
ret['changes'] = environ_ret
ret['comment'] = 'Environ values were set'
return ret
-
|
Lint fixes.
* No need to define and return `__virtualname__` if not renaming the module. In this case, just return `True`.
* Don't shaddow the buil-in `set`
* Removed logging since it's not being used
|
saltstack_salt
|
train
|
py
|
6d19a61d93e71ae74519625ec60674453a746fc3
|
diff --git a/lib/init/javascript.js b/lib/init/javascript.js
index <HASH>..<HASH> 100644
--- a/lib/init/javascript.js
+++ b/lib/init/javascript.js
@@ -149,7 +149,7 @@ exportables.createSampleProgram = () => {
}
fs.copy(path.join(resources, filename), filename, () => {
- log.info('Wrote "Hello World" to index.js');
+ log.info('Created "index.js"');
resolve();
});
});
@@ -250,6 +250,8 @@ exportables.generateProject = (opts) => {
return ctx;
})
.then(exportables.createNpmrc)
+ .then(exportables.createTesselinclude)
+ .then(exportables.createSampleProgram)
.then(exportables.loadNpm)
.then(exportables.resolveNpmConfig)
.then(exportables.buildJSON)
@@ -259,8 +261,6 @@ exportables.generateProject = (opts) => {
.then(JSON.parse)
.then(exportables.getDependencies)
.then(exportables.npmInstall)
- .then(exportables.createTesselinclude)
- .then(exportables.createSampleProgram)
.catch(error => {
log.error(error);
});
|
Reorder t2 init to copy all of the pre-made files first.
|
tessel_t2-cli
|
train
|
js
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.