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 |
|---|---|---|---|---|---|
de40c91dc21bf7349a579678f8471af45d0d1647 | diff --git a/mechanicalsoup/form.py b/mechanicalsoup/form.py
index <HASH>..<HASH> 100644
--- a/mechanicalsoup/form.py
+++ b/mechanicalsoup/form.py
@@ -273,10 +273,10 @@ class Form(object):
self.form.append(control)
return control
- def choose_submit(self, el):
+ def choose_submit(self, submit):
"""Selects the input (or button) element to use for form submission.
- :param el: The bs4.element.Tag (or just its *name*-attribute) that
+ :param submit: The bs4.element.Tag (or just its *name*-attribute) that
identifies the submit element to use.
To simulate a normal web browser, only one submit element must be
@@ -298,10 +298,10 @@ class Form(object):
found = False
inps = self.form.select('input[type="submit"], button[type="submit"]')
for inp in inps:
- if inp == el or inp['name'] == el:
+ if inp == submit or inp['name'] == submit:
if found:
raise LinkNotFoundError(
- "Multiple submit elements match: {0}".format(el)
+ "Multiple submit elements match: {0}".format(submit)
)
found = True
continue
@@ -310,7 +310,7 @@ class Form(object):
if not found:
raise LinkNotFoundError(
- "Specified submit element not found: {0}".format(el)
+ "Specified submit element not found: {0}".format(submit)
)
def print_summary(self): | form.py: rename argument of choose_submit
The name `el` was not sufficiently descriptive or clear. Instead,
we name it `submit` because it is the Tag of the submit element
or its name-attribute. | MechanicalSoup_MechanicalSoup | train | py |
b1864369a3b7f0de1d87da603a8e1ffb0d8da34f | diff --git a/scdl/scdl.py b/scdl/scdl.py
index <HASH>..<HASH> 100755
--- a/scdl/scdl.py
+++ b/scdl/scdl.py
@@ -491,7 +491,7 @@ def download_track(track, playlist_name=None, playlist_file=None):
logger.info('{0} already Downloaded'.format(title))
return
else:
- logger.error('Music already exists ! (exiting)')
+ logger.error('Music already exists ! (use -c to continue)')
sys.exit(0)
logger.info('{0} Downloaded.\n'.format(filename)) | More meaningfull message when already music exits | flyingrub_scdl | train | py |
e9b09e161d20da8592847e5a4c80977adfdf7eb6 | diff --git a/bin/test.js b/bin/test.js
index <HASH>..<HASH> 100644
--- a/bin/test.js
+++ b/bin/test.js
@@ -46,7 +46,8 @@ test.config = {
name: 'test',
description: 'Runs test suite',
options: [
- ['u', 'updateSnapshot', 'Update snapshots'],
+ ['', 'coverage', 'Indicates that test coverage information should be collected and reported in the output.'],
+ ['u', 'updateSnapshot', 'Use this flag to re-record snapshots.'],
['', 'verbose', 'Display individual test results with the test suite hierarchy']
]
}; | KSBWI-<I> added --coverage param | kambi-sportsbook-widgets_widget-build-tools | train | js |
ece7c26727b28ea05feeeba3a9c2d1b4b7eb5c54 | diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py
index <HASH>..<HASH> 100644
--- a/sqlparse/keywords.py
+++ b/sqlparse/keywords.py
@@ -46,7 +46,11 @@ SQL_REGEX = {
(r'(CASE|IN|VALUES|USING)\b', tokens.Keyword),
(r'(@|##|#)[A-Z]\w+', tokens.Name),
- (r'[A-Z]\w*(?=\.)', tokens.Name), # see issue39
+
+ # see issue #39
+ # Spaces around period `schema . name` are valid identifier
+ # TODO: Spaces before period not implemented
+ (r'[A-Z]\w*(?=\s*\.)', tokens.Name), # 'Name' .
(r'(?<=\.)[A-Z]\w*', tokens.Name), # .'Name'
(r'[A-Z]\w*(?=\()', tokens.Name), # side effect: change kw to func | Rewrite regex to allow spaces between `name` and `.` | andialbrecht_sqlparse | train | py |
22b03a4209dd7dab6915dc01627f9cddc939ff04 | diff --git a/infra/azure/vm/helper.js b/infra/azure/vm/helper.js
index <HASH>..<HASH> 100644
--- a/infra/azure/vm/helper.js
+++ b/infra/azure/vm/helper.js
@@ -101,10 +101,30 @@ const helper = {
if (opts.vmSize.resourceDiskSizeInMB) record.resourceDiskSizeInMB = opts.vmSize.resourceDiskSizeInMB;
if (opts.vmSize.memoryInMB) record.memoryInMB = opts.vmSize.memoryInMB;
if (opts.vmSize.maxDataDiskCount) record.maxDataDiskCount = opts.vmSize.maxDataDiskCount;
+
+ record.label = record.name + ` / CPU: ${record.numberOfCores}`;
+ let memory = record.memoryInMB;
+ if(memory > 1024){
+ memory = memory / 1024;
+ record.label += ` / RAM: ${memory}GB`;
+ }
+ else{
+ record.label += ` / RAM: ${memory}MB`;
+ }
+
+ let hd = record.resourceDiskSizeInMB;
+ if(hd > 1024){
+ hd = hd / 1024;
+ record.label += ` / HD: ${hd}GB`;
+ }
+ else{
+ record.label += ` / HD: ${hd}MB`;
+ }
}
return record;
},
+
buildRunCommmand: function(opts){
let record ={}; | added label property to vmSize normalized response | soajs_soajs.core.drivers | train | js |
7f76df7edb96dfa30412e87e39a01c8b9fdc55c1 | diff --git a/src/streamify.js b/src/streamify.js
index <HASH>..<HASH> 100644
--- a/src/streamify.js
+++ b/src/streamify.js
@@ -77,7 +77,7 @@ function streamify (data, options) {
}
if (check.positive(options.space)) {
- space = Array(options.space).join(' ');
+ space = Array(options.space + 1).join(' ');
} else {
space = options.space;
} | Fix off-by-one error. | philbooth_bfj | train | js |
c11b23bbc1f46116407bdc10779c4cace639ee83 | diff --git a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
index <HASH>..<HASH> 100644
--- a/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
+++ b/handler/src/main/java/io/netty/handler/ssl/SslHandler.java
@@ -1527,6 +1527,7 @@ public class SslHandler extends ByteToMessageDecoder implements ChannelOutboundH
try {
// Release all resources such as internal buffers that SSLEngine
// is managing.
+ outboundClosed = true;
engine.closeOutbound();
if (closeInbound) {
@@ -1574,6 +1575,9 @@ public class SslHandler extends ByteToMessageDecoder implements ChannelOutboundH
private void closeOutboundAndChannel(
final ChannelHandlerContext ctx, final ChannelPromise promise, boolean disconnect) throws Exception {
+ outboundClosed = true;
+ engine.closeOutbound();
+
if (!ctx.channel().isActive()) {
if (disconnect) {
ctx.disconnect(promise);
@@ -1583,9 +1587,6 @@ public class SslHandler extends ByteToMessageDecoder implements ChannelOutboundH
return;
}
- outboundClosed = true;
- engine.closeOutbound();
-
ChannelPromise closeNotifyPromise = ctx.newPromise();
try {
flush(ctx, closeNotifyPromise); | Close SSLEngine when connection fails.
Motivation:
When using the JdkSslEngine, the ALPN class is used keep a reference
to the engine. In the event that the TCP connection fails, the
SSLEngine is not removed from the map, creating a memory leak.
Modification:
Always close the SSLEngine regardless of if the channel became
active. Also, record the SSLEngine was closed in all places.
Result:
Fixes: <URL> | netty_netty | train | java |
3acf940291a0c02382b7fcf61621239195192157 | diff --git a/jsonfield/__init__.py b/jsonfield/__init__.py
index <HASH>..<HASH> 100644
--- a/jsonfield/__init__.py
+++ b/jsonfield/__init__.py
@@ -0,0 +1 @@
+from fields import JSONField
\ No newline at end of file | Some existing apps expect this to be present.
For example Gargoyle does this "from jsonfield import JSONField", expecting this (older) version of django-jsonfield to be present:
<URL> | dmkoch_django-jsonfield | train | py |
e493b6afe0e3208b15ac1a71b8811fc834f52ea1 | diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py
index <HASH>..<HASH> 100644
--- a/adafruit_platformdetect/board.py
+++ b/adafruit_platformdetect/board.py
@@ -72,7 +72,7 @@ class Board:
board_id = None
if chip_id == chips.H3:
- board_id = self._armbian_id()
+ board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.BCM2XXX:
board_id = self._pi_id()
elif chip_id == chips.AM33XX: | Fix: Added requested support for allwinner variants | adafruit_Adafruit_Python_PlatformDetect | train | py |
a042ff1e06be43f84d88dc4c2e190fa7c225a622 | diff --git a/src/main/java/com/rackspace/cloud/api/docs/CalabashHelper.java b/src/main/java/com/rackspace/cloud/api/docs/CalabashHelper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/rackspace/cloud/api/docs/CalabashHelper.java
+++ b/src/main/java/com/rackspace/cloud/api/docs/CalabashHelper.java
@@ -51,9 +51,9 @@ public class CalabashHelper {
strBuff
.append("<c:param name=\"")
- .append(entry.getKey())
+ .append(escapeXmlAttribute(entry.getKey()))
.append("\" namespace=\"\" value=\"")
- .append(rawValue)
+ .append(escapeXmlAttribute(rawValue))
.append("\"/>");
}
}
@@ -74,6 +74,18 @@ public class CalabashHelper {
return sources.get(0);
}
+ private static String escapeXmlAttribute(String value) {
+ if (value == null) {
+ return "";
+ }
+
+ return value
+ .replace("&", "&")
+ .replace("\"", """)
+ .replace("'", "'")
+ .replace("%", "%");
+ }
+
/**
* Creates a {@link Source} for use in a Calabash pipeline.
* | Make sure to escape parameter values since they are pass as XML attributes | rackerlabs_clouddocs-maven-plugin | train | java |
f59d06e6075351796c051dc58b9334672c213d97 | diff --git a/influxdb/influxdb08/dataframe_client.py b/influxdb/influxdb08/dataframe_client.py
index <HASH>..<HASH> 100644
--- a/influxdb/influxdb08/dataframe_client.py
+++ b/influxdb/influxdb08/dataframe_client.py
@@ -96,9 +96,11 @@ class DataFrameClient(InfluxDBClient):
elif len(result) == 1:
return self._to_dataframe(result[0], time_precision)
else:
- return {time_series['name']: self._to_dataframe(time_series,
- time_precision)
- for time_series in result}
+ ret = {}
+ for time_series in result:
+ ret[time_series['name']] = self._to_dataframe(time_series,
+ time_precision)
+ return ret
def _to_dataframe(self, json_result, time_precision):
dataframe = pd.DataFrame(data=json_result['points'], | Remove dict comprehension for py<I> | influxdata_influxdb-python | train | py |
d5c5006501e5b06f6c89842f727c6ebe3d784db4 | diff --git a/example/ssd/benchmark_score.py b/example/ssd/benchmark_score.py
index <HASH>..<HASH> 100644
--- a/example/ssd/benchmark_score.py
+++ b/example/ssd/benchmark_score.py
@@ -29,7 +29,7 @@ from symbol.symbol_factory import get_symbol_train
from symbol import symbol_builder
-parser = argparse.ArgumentParser(description='MxNet SSD benchmark')
+parser = argparse.ArgumentParser(description='MXNet SSD benchmark')
parser.add_argument('--network', '-n', type=str, default='vgg16_reduced')
parser.add_argument('--batch_size', '-b', type=int, default=0)
parser.add_argument('--shape', '-w', type=int, default=300) | Update benchmark_score.py (#<I>) | apache_incubator-mxnet | train | py |
d1ebe1ce9aa46773e5a9182308f97dbac7b64e8f | diff --git a/filesystem/FileNameFilter.php b/filesystem/FileNameFilter.php
index <HASH>..<HASH> 100644
--- a/filesystem/FileNameFilter.php
+++ b/filesystem/FileNameFilter.php
@@ -97,7 +97,7 @@ class FileNameFilter {
* @return Transliterator|NULL
*/
function getTransliterator() {
- if(!$this->transliterator === null && self::$default_use_transliterator) {
+ if($this->transliterator === null && self::$default_use_transliterator) {
$this->transliterator = Object::create('Transliterator');
}
return $this->transliterator; | BUGFIX Fixed double negation of transliterator checks in FileNameFilter, which meant it wasn't used by default when filtering SiteTree->URLSegment | silverstripe_silverstripe-framework | train | php |
14339262bcf0472f59f11d2e8253952baceda409 | diff --git a/packages/core/src/batch/BatchRenderer.js b/packages/core/src/batch/BatchRenderer.js
index <HASH>..<HASH> 100644
--- a/packages/core/src/batch/BatchRenderer.js
+++ b/packages/core/src/batch/BatchRenderer.js
@@ -310,7 +310,7 @@ export default class BatchRenderer extends ObjectRenderer
this.packGeometry(sprite, float32View, uint32View, indexBuffer, index, indexCount);// argb, nextTexture._id, float32View, uint32View, indexBuffer, index, indexCount);
// push a graphics..
- index += (sprite.vertexData.length / 2) * 6;
+ index += (sprite.vertexData.length / 2) * this.vertSize;
indexCount += sprite.indices.length;
}
@@ -390,7 +390,7 @@ export default class BatchRenderer extends ObjectRenderer
packGeometry(element, float32View, uint32View, indexBuffer, index, indexCount)
{
- const p = index / 6;// float32View.length / 6 / 2;
+ const p = index / this.vertSize;// float32View.length / 6 / 2;
const uvs = element.uvs;
const indicies = element.indices;// geometry.getIndex().data;// indicies;
const vertexData = element.vertexData; | Fixes instances of hard-coded vertSize in BatchRenderer (#<I>) | pixijs_pixi.js | train | js |
6cf345ba0ae929ee8a8f843d14d5d22154946774 | diff --git a/render.js b/render.js
index <HASH>..<HASH> 100755
--- a/render.js
+++ b/render.js
@@ -9,8 +9,9 @@ var React = require('react');
var ReactDOMServer = require('react-dom/server');
var argv = require('yargs')
- .usage('Usage: $0 [--port NUM]')
+ .usage('Usage: $0 [--port NUM] [--host ADDRESS]')
.describe('port', 'The port to listen to')
+ .describe('host', 'The host address to bind to')
.describe('debug', 'Print stack traces on error').alias('debug', 'd')
.describe('watch', 'Watch the source for changes and reload')
.describe('whitelist', 'Whitelist a root directory where the javascript files can be')
@@ -91,7 +92,7 @@ app.use(function errorHandler(err, request, response, next) {
response.status(500).send(argv.debug ? err.stack : "An error occurred during rendering");
});
-var server = app.listen(argv.port || 63578, 'localhost', function() {
+var server = app.listen(argv.port || 63578, argv.host || 'localhost', function() {
console.log('Started server at http://%s:%s', server.address().address, server.address().port);
}); | Allow changing the bind address of the server. | mic159_react-render | train | js |
68034da8aab4f7f5ae2c827b4a0979ffc7741c95 | diff --git a/api/opentrons/containers/placeable.py b/api/opentrons/containers/placeable.py
index <HASH>..<HASH> 100644
--- a/api/opentrons/containers/placeable.py
+++ b/api/opentrons/containers/placeable.py
@@ -622,6 +622,8 @@ class Container(Placeable):
new_wells = WellSeries(self.get_children_list())
elif len(args) > 1:
new_wells = WellSeries([self.well(n) for n in args])
+ elif 'x' in kwargs or 'y' in kwargs:
+ new_wells = self._parse_wells_x_y(*args, **kwargs)
else:
new_wells = self._parse_wells_to_and_length(*args, **kwargs)
@@ -674,6 +676,11 @@ class Container(Placeable):
return WellSeries(
wrapped_wells[start + total_kids::step][:length])
+ def _parse_wells_x_y(self, *args, **kwargs):
+ x = kwargs.get('x', None)
+ y = kwargs.get('y', None)
+
+
class WellSeries(Container):
""" | adds placeholder for xy placeable method | Opentrons_opentrons | train | py |
bdd70cd541e6a0a04629e8dad26c34fa0271fee2 | diff --git a/npm.js b/npm.js
index <HASH>..<HASH> 100644
--- a/npm.js
+++ b/npm.js
@@ -10,6 +10,14 @@ var debug = require('debug')('licenses::npm');
*/
module.exports = require('./parser').extend({
/**
+ * The name of this parser.
+ *
+ * @type {String}
+ * @private
+ */
+ name: 'npm',
+
+ /**
* Parse the npm license information from the package.
*
* @param {Object} data The package.json or npm package contents.
@@ -81,15 +89,10 @@ module.exports = require('./parser').extend({
return parser.license(item);
}).filter(Boolean)
);
- }
-
- if ('object' === typeof data.licenses && Object.keys(data.licenses).length) {
+ } else if ('object' === typeof data.licenses) {
Array.prototype.push.apply(
matches,
- Object.keys(data.licenses).map(function map(key) {
- if (!parser.license(data.licenses[key])) return undefined;
- return data.licenses[key];
- }).filter(Boolean)
+ parser.license(data)
);
} | [fix] Correctly parse licenses objects from the package.json | 3rd-Eden_licenses | train | js |
5e1584fecf8c322abbc4b5220900d7921e734fcc | diff --git a/lib/consumers/email_consumer.rb b/lib/consumers/email_consumer.rb
index <HASH>..<HASH> 100644
--- a/lib/consumers/email_consumer.rb
+++ b/lib/consumers/email_consumer.rb
@@ -8,7 +8,7 @@ module Chatterbox
end
def process
- Chatterbox.logger.debug { "Sending notification #{notice.inspect}"}
+ Chatterbox.logger.debug { "Mailing notification #{notice[:summary]}"}
Mailer.deliver_exception_notification(notice)
end | Log the summary, not the whole notice | rsanheim_chatterbox | train | rb |
d1fc09b2cb8695999d4e2e9422764701010d2ccb | diff --git a/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb b/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb
+++ b/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb
@@ -32,6 +32,20 @@ module Semantic
end
def <=>(oth)
+ # Note that prior to ruby 2.3.0, if a <=> method threw an exception, ruby
+ # would silently rescue the exception and return nil from <=> (which causes
+ # the derived == comparison to return false). Starting in ruby 2.3.0, this
+ # behavior changed and the exception is actually thrown. Some comments at:
+ # https://bugs.ruby-lang.org/issues/7688
+ #
+ # So simply return nil here if any of the needed fields are not available,
+ # since attempting to access a missing field is one way to force an exception.
+ # This doesn't help if the <=> use below throws an exception, but it
+ # handles the most typical cause.
+ return nil if !oth.respond_to?(:priority) ||
+ !oth.respond_to?(:name) ||
+ !oth.respond_to?(:version)
+
our_key = [ priority, name, version ]
their_key = [ oth.priority, oth.name, oth.version ] | (PUP-<I>) Handle unexpected compares gracefully
This commit is part of adding ruby <I> support to puppet.
Note that prior to ruby <I>, if a <=> method threw an exception, ruby
would silently rescue the exception and return nil from <=> (which causes
the derived == comparison to return false). Starting in ruby <I>, this
behavior changed and the exception is actually thrown. Some comments at:
<URL> | puppetlabs_puppet | train | rb |
2ebd83283ecc1ff0e50c0b96c983864f5006abbc | diff --git a/TYPO3.Flow/Classes/Security/Controller/LoginController.php b/TYPO3.Flow/Classes/Security/Controller/LoginController.php
index <HASH>..<HASH> 100755
--- a/TYPO3.Flow/Classes/Security/Controller/LoginController.php
+++ b/TYPO3.Flow/Classes/Security/Controller/LoginController.php
@@ -36,8 +36,6 @@ namespace F3\FLOW3\Security\Controller;
* @version $Id: $
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser Public License, version 3 or later
*/
-use F3\FLOW3\MVC\Controller;
-
class LoginController extends \F3\FLOW3\MVC\Controller\ActionController {
/** | FLOW3:
* removed useless use uselessly added by PDT
* fixed copy-n-paste error in TYPO3CR Routes.yaml
Original-Commit-Hash: 6cc<I>b<I>cbb8e<I>f1ca<I>a<I>b<I>e2d | neos_flow-development-collection | train | php |
8dd0f2c997fed83cc9e01aae97d6010554a80cf1 | diff --git a/estnltk/taggers/syntax/conll_morph_tagger.py b/estnltk/taggers/syntax/conll_morph_tagger.py
index <HASH>..<HASH> 100644
--- a/estnltk/taggers/syntax/conll_morph_tagger.py
+++ b/estnltk/taggers/syntax/conll_morph_tagger.py
@@ -49,8 +49,7 @@ def get_values(id, text):
text.analyse('syntax_preprocessing')
res1 = export_CG3(text)
vislcgRulesDir = abs_path('taggers/syntax/files')
- vislcg_path = '/usr/bin/vislcg3'
- pipeline2 = VISLCG3Pipeline(rules_dir=vislcgRulesDir, vislcg_cmd=vislcg_path)
+ pipeline2 = VISLCG3Pipeline(rules_dir=vislcgRulesDir)
results2 = pipeline2.process_lines(res1)
for j, word in enumerate(list(filter(None, convert_cg3_to_conll(results2.split('\n'))))):
if word != '': | Bugfix in conll_morph_tagger: removed hardcoded vislcg_path (we assume that vislcg_path is inside system PATH) | estnltk_estnltk | train | py |
eeb08ca41fd07815a22afd77d80e7baa8f053c96 | diff --git a/porespy/filters/__funcs__.py b/porespy/filters/__funcs__.py
index <HASH>..<HASH> 100644
--- a/porespy/filters/__funcs__.py
+++ b/porespy/filters/__funcs__.py
@@ -1264,8 +1264,8 @@ def trim_disconnected_blobs(im, inlets):
temp = sp.zeros_like(im)
temp[inlets] = True
labels, N = spim.label(im + temp)
- im = im ^ (clear_border(labels=labels) > 0)
- return im
+ im2 = im ^ (clear_border(labels=labels) > 0)
+ return im2
def _get_axial_shifts(ndim=2, include_diagonals=False): | changing trim_disconnected_blobs to make a copy of input image | PMEAL_porespy | train | py |
f15b74ae541dcbdafa23ded65723eee3ef2219f4 | diff --git a/satpy/tests/writer_tests/test_cf.py b/satpy/tests/writer_tests/test_cf.py
index <HASH>..<HASH> 100644
--- a/satpy/tests/writer_tests/test_cf.py
+++ b/satpy/tests/writer_tests/test_cf.py
@@ -328,7 +328,6 @@ class TestCFWriter(unittest.TestCase):
scn.save_datasets(filename=filename,
header_attrs=header_attrs,
writer='cf')
- import netCDF4 as nc4
with xr.open_dataset(filename) as f:
self.assertTrue(f.attrs['sensor'] == 'SEVIRI')
self.assertTrue('sensor' in f.attrs.keys()) | Remove unused import in cf writer tests | pytroll_satpy | train | py |
6d3f9f3007f5f9d297ead17996b4c4cc1e78ef34 | diff --git a/pypureomapi.py b/pypureomapi.py
index <HASH>..<HASH> 100644
--- a/pypureomapi.py
+++ b/pypureomapi.py
@@ -1090,6 +1090,25 @@ class Omapi(object):
if response.opcode != OMAPI_OP_STATUS:
raise OmapiError("delete failed")
+ def lookup_ip_host(self, mac):
+ """Lookup a host object with with given mac address.
+
+ @type mac: str
+ @raises ValueError:
+ @raises OmapiError:
+ @raises socket.error:
+ """
+ msg = OmapiMessage.open(b"host")
+ msg.obj.append((b"hardware-address", pack_mac(mac)))
+ msg.obj.append((b"hardware-type", struct.pack("!I", 1)))
+ response = self.query_server(msg)
+ if response.opcode != OMAPI_OP_UPDATE:
+ raise OmapiErrorNotFound()
+ try:
+ return unpack_ip(dict(response.obj)[b"ip-address"])
+ except KeyError: # ip-address
+ raise OmapiErrorNotFound()
+
def lookup_ip(self, mac):
"""Look for a lease object with given mac address and return the
assigned ip address. | Added function 'lookup_ip_host' to lookup the IP address corresponding to a MAC address in a host entry | CygnusNetworks_pypureomapi | train | py |
091988e819a6cd5919a20104938ff3aafa73de2f | diff --git a/source/config/albus.php b/source/config/albus.php
index <HASH>..<HASH> 100644
--- a/source/config/albus.php
+++ b/source/config/albus.php
@@ -12,6 +12,7 @@ return [
* Controller associated with albus dashboard (homepage). Use controller alias, not class name.
*/
'defaultController' => '',
+
/*
* List of controller classes associated with their alias to be available for albus. No other
* controllers can be called. | Albus routing and HMVC core basemenet. | spiral_vault | train | php |
6e7e6d632cbe7dd85abe06617a1ccc91e2c115bb | diff --git a/snapshot-webapp/src/test/java/org/duracloud/snapshot/rest/SnapshotResourceTest.java b/snapshot-webapp/src/test/java/org/duracloud/snapshot/rest/SnapshotResourceTest.java
index <HASH>..<HASH> 100644
--- a/snapshot-webapp/src/test/java/org/duracloud/snapshot/rest/SnapshotResourceTest.java
+++ b/snapshot-webapp/src/test/java/org/duracloud/snapshot/rest/SnapshotResourceTest.java
@@ -45,10 +45,10 @@ public class SnapshotResourceTest extends SnapshotTestBase {
private String[] dpnEmailAddresses = {"dpn-email"};
private String duracloudUsername = "duracloud-username";
private String duracloudPassword = "duracloud-password";
- private File workDir = new File(System.getProperty("java.io.tmpdir")
- + "snapshot-work");
- private File contentDirRoot = new File(System.getProperty("java.io.tmpdir")
- + "snapshot-content");
+ private File workDir = new File(System.getProperty("java.io.tmpdir"),
+ "snapshot-work");
+ private File contentDirRoot = new File(System.getProperty("java.io.tmpdir"),
+ "snapshot-content");
private boolean clean = true; | Fixes broken unit test (on linux only) and likely resolves write permission detection anomaly. | duracloud_snapshot | train | java |
47d7f05859bf49fbc5145d9575ffa26098fe61bd | diff --git a/lib/transitions/machine.rb b/lib/transitions/machine.rb
index <HASH>..<HASH> 100644
--- a/lib/transitions/machine.rb
+++ b/lib/transitions/machine.rb
@@ -96,7 +96,7 @@ module Transitions
def include_scopes
@states.each do |state|
- @klass.scope state.name.to_sym, @klass.where(:state => state.name)
+ @klass.scope state.name.to_sym, @klass.where(:state => state.name.to_s)
end
end
end | Stringify state name
AR prefixes the state with the table name (i.e. "`traffic_lights`.`state` = `traffic_lights`.`red`") if we pass the name as symbol. We need to pass it as string, so that it works ("`traffic_lights`.`state` = 'red'") | troessner_transitions | train | rb |
ce1a69317e341f3c70f3a40b093deece133be552 | diff --git a/internal/service/keyspaces/table.go b/internal/service/keyspaces/table.go
index <HASH>..<HASH> 100644
--- a/internal/service/keyspaces/table.go
+++ b/internal/service/keyspaces/table.go
@@ -34,7 +34,7 @@ func ResourceTable() *schema.Resource {
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(10 * time.Minute),
- Update: schema.DefaultTimeout(10 * time.Minute),
+ Update: schema.DefaultTimeout(20 * time.Minute),
Delete: schema.DefaultTimeout(10 * time.Minute),
},
@@ -656,6 +656,7 @@ func waitTableUpdated(ctx context.Context, conn *keyspaces.Keyspaces, keyspaceNa
Target: []string{keyspaces.TableStatusActive},
Refresh: statusTable(ctx, conn, keyspaceName, tableName),
Timeout: timeout,
+ Delay: 10 * time.Second,
}
outputRaw, err := stateConf.WaitForStateContext(ctx) | r/aws_keyspaces_table: Add a <I>s delay before polling for status changes during Update. | terraform-providers_terraform-provider-aws | train | go |
474300f17e0ab5bb703ca9a051f29702426ff44f | diff --git a/resizer.go b/resizer.go
index <HASH>..<HASH> 100644
--- a/resizer.go
+++ b/resizer.go
@@ -39,8 +39,8 @@ func resizer(buf []byte, o Options) ([]byte, error) {
return nil, err
}
- // If JPEG image, retrieve the buffer
- if rotated && imageType == JPEG && !o.NoAutoRotate {
+ // If JPEG or HEIF image, retrieve the buffer
+ if rotated && (imageType == JPEG || imageType == HEIF) && !o.NoAutoRotate {
buf, err = getImageBuffer(image)
if err != nil {
return nil, err | Supporting auto rotate for HEIF/HEIC images. | h2non_bimg | train | go |
a05553cb6c41f4e795d1dcee62cc18bf20205501 | diff --git a/models/LoginForm.php b/models/LoginForm.php
index <HASH>..<HASH> 100644
--- a/models/LoginForm.php
+++ b/models/LoginForm.php
@@ -23,8 +23,8 @@ class LoginForm extends \yii\base\Model
public function attributeLabels()
{
return [
- 'email' => 'E-Mail',
- 'password' => 'Passwort',
+ 'email' => \admin\Module::t('model_loginform_email_label'),
+ 'password' => \admin\Module::t('model_loginform_password_label'),
];
}
@@ -33,7 +33,7 @@ class LoginForm extends \yii\base\Model
if (!$this->hasErrors()) {
$user = $this->getUser();
if (!$user || !$user->validatePassword($this->password)) {
- $this->addError($attribute, 'Falscher Benutzer oder Passwort.');
+ $this->addError($attribute, \admin\Module::t('model_loginform_wrong_user_or_password'));
}
}
} | Adding new translations and changing the structure to group translations by version | luyadev_luya-module-admin | train | php |
d3da353b24988503c1bc73f29b8ef3ab86d7b4da | diff --git a/app/View.php b/app/View.php
index <HASH>..<HASH> 100644
--- a/app/View.php
+++ b/app/View.php
@@ -28,6 +28,7 @@ use function extract;
use function implode;
use function is_file;
use function ob_end_clean;
+use function ob_get_level;
use function ob_start;
use function sha1;
@@ -191,7 +192,9 @@ class View
return ob_get_clean();
} catch (Throwable $ex) {
- ob_end_clean();
+ while (ob_get_level() > 0) {
+ ob_end_clean();
+ }
throw $ex;
}
} | Fix: errors in nested views not handled correctly | fisharebest_webtrees | train | php |
51a024b0242ff232cf12de10759f9fef0c478d22 | diff --git a/lib/files.js b/lib/files.js
index <HASH>..<HASH> 100644
--- a/lib/files.js
+++ b/lib/files.js
@@ -314,12 +314,21 @@ module.exports = {
// normally granted to all users in groups with the
// `edit` or `admin` permission.
+ // If you are allowing for public image uploading into
+ // the media library (perhaps using apostrophe-moderator),
+ // IE9 and below do not react properly to the json content
+ // type. Post images to '/apos/upload-files?html=1' and
+ // the server will respond with text/html instead.
+
self.app.post('/apos/upload-files', function(req, res) {
return self.acceptFiles(req, req.files.files, function(err, files) {
if (err) {
console.error(err);
return res.send({ files: [], status: 'err' });
}
+ if(req.query.html) {
+ res.setHeader('Content-Type', 'text/html');
+ }
return res.send({ files: files, status: 'ok' });
});
}); | added ?html=1 query option to apos/upload-files to allow for IE9 compatibility when allowing public image uploads | apostrophecms_apostrophe | train | js |
b962d0e91ac7d05f27768ffa3b5134ee7ff3940d | diff --git a/app/javascript/packs/fluent_log.js b/app/javascript/packs/fluent_log.js
index <HASH>..<HASH> 100644
--- a/app/javascript/packs/fluent_log.js
+++ b/app/javascript/packs/fluent_log.js
@@ -10,7 +10,7 @@ $(document).ready(()=> {
"processing": false
},
- compiled: function(){
+ mounted: function(){
this.fetchLogs();
var self = this; | Use mounted instead of compiled
Because compiled is removed. | fluent_fluentd-ui | train | js |
36ac3c8c31a1cf3b5c4d73c94d5572a3b226471a | diff --git a/pkg/controller/service/service_controller.go b/pkg/controller/service/service_controller.go
index <HASH>..<HASH> 100644
--- a/pkg/controller/service/service_controller.go
+++ b/pkg/controller/service/service_controller.go
@@ -107,6 +107,7 @@ func New(
broadcaster := record.NewBroadcaster()
broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubeClient.Core().RESTClient()).Events("")})
recorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "service-controller"})
+ broadcaster.StartLogging(glog.Infof)
if kubeClient != nil && kubeClient.Core().RESTClient().GetRateLimiter() != nil {
metrics.RegisterMetricAndTrackRateLimiterUsage("service_controller", kubeClient.Core().RESTClient().GetRateLimiter()) | Enable event logging in the service controller | kubernetes_kubernetes | train | go |
a1998673261e133945e7d977e438a996b78251c9 | diff --git a/Controller/Payment/Verify.php b/Controller/Payment/Verify.php
index <HASH>..<HASH> 100755
--- a/Controller/Payment/Verify.php
+++ b/Controller/Payment/Verify.php
@@ -158,6 +158,10 @@ class Verify extends AbstractAction {
// Debug info
$this->watchdog->bark($response);
+ if (isset($response['responseCode']) && (int) $response['responseCode'] >= 40000) {
+ throw new LocalizedException(__('There has been an error processing your transaction.'));
+ }
+
// If it's an alternative payment
if (isset($response['chargeMode']) && (int) $response['chargeMode'] == 3) {
if (isset($response['responseCode']) && (int) $response['responseCode'] == 10000 || (int) $response['responseCode'] == 10100) { | Response code handling
Improved the handling of blacklisted cards response. | checkout_checkout-magento2-plugin | train | php |
28ee3b092f495537b7d4778ef5844dfa4b367698 | diff --git a/code/gridfield/GridFieldImporter.php b/code/gridfield/GridFieldImporter.php
index <HASH>..<HASH> 100644
--- a/code/gridfield/GridFieldImporter.php
+++ b/code/gridfield/GridFieldImporter.php
@@ -29,9 +29,10 @@ class GridFieldImporter implements GridField_HTMLProvider, GridField_URLHandler
/**
* Set the bulk loader for this importer
- * @param BulkLoader
+ * @param BetterBulkLoader $loader
+ * @return GridFieldImporter
*/
- public function setLoader(BulkLoader $loader) {
+ public function setLoader(BetterBulkLoader $loader) {
$this->loader = $loader;
return $this;
@@ -39,7 +40,7 @@ class GridFieldImporter implements GridField_HTMLProvider, GridField_URLHandler
/**
* Get the BulkLoader
- * @return BulkLoader
+ * @return BetterBulkLoader
*/
public function getLoader(GridField $gridField) {
if(!$this->loader){
@@ -67,9 +68,9 @@ class GridFieldImporter implements GridField_HTMLProvider, GridField_URLHandler
}
/**
- * @param boolean $canclear
+ * @param boolean $canClearData
*/
- public function setCanClearData($canclear = true) {
+ public function setCanClearData($canClearData = true) {
$this->canClearData = $canClearData;
} | FIX for #<I>: Ensuring documentation and setters are utilizing correct type. Also minor fix to setter variable name. | burnbright_silverstripe-importexport | train | php |
a0dee8b8f9d8b8d7a3439513da7d1f1544a89e44 | diff --git a/src/FormElement/AbstractFormElement.php b/src/FormElement/AbstractFormElement.php
index <HASH>..<HASH> 100644
--- a/src/FormElement/AbstractFormElement.php
+++ b/src/FormElement/AbstractFormElement.php
@@ -177,7 +177,7 @@ abstract class AbstractFormElement
// Build input validator chain for element
$this->attachValidators($input, $element);
$this->attachValidatorsFromDataAttribute($input, $element);
- $this->attachFilters($input, $element->getAttribute('data-filters'));
+ $this->attachFilters($input, $element);
// Can't be empty if it has a required attribute
if ($element->hasAttribute('required')) {
@@ -217,8 +217,9 @@ abstract class AbstractFormElement
}
}
- public function attachFilters(InputInterface $input, $filters)
+ public function attachFilters(InputInterface $input, DOMElement $element)
{
+ $filters = $element->getAttribute('data-filters');
$filters = explode(',', $filters);
foreach ($filters as $filter) {
// TODO: Needs to fixed when zend-inputfilter 3 is released. | Make attach filters function consistent with other attach functions | xtreamwayz_html-form-validator | train | php |
bd030a4d32b58ce0a40d20e4e2e7397afa352356 | diff --git a/tests/WidgetTest/DbTest.php b/tests/WidgetTest/DbTest.php
index <HASH>..<HASH> 100644
--- a/tests/WidgetTest/DbTest.php
+++ b/tests/WidgetTest/DbTest.php
@@ -282,5 +282,15 @@ class DbTest extends TestCase
$this->assertEquals("SELECT * FROM users u WHERE id = ? AND group_id IN (?, ?)", $query->getSQL());
$this->assertEquals('1', $user->id);
+
+ // Order
+ $query = $this->db('users')->orderBy('id', 'ASC');
+ $user = $query->find();
+
+ $this->assertEquals("SELECT * FROM users u ORDER BY id ASC", $query->getSQL());
+ $this->assertEquals("1", $user->id);
+
+ // addOrder
+
}
}
\ No newline at end of file | added test for order by clause, ref #<I> | twinh_wei | train | php |
058c7a03d7e70e3fecbd2249c199d7511f377e0e | diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
index <HASH>..<HASH> 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java
@@ -353,13 +353,11 @@ public interface WebService extends Definable<WebService.Context> {
createParam(Param.PAGE)
.setDescription(PAGE_PARAM_DESCRIPTION)
.setExampleValue("42")
- .setDeprecatedKey("pageIndex", "5.2")
.setDefaultValue("1");
createParam(Param.PAGE_SIZE)
.setDescription("Page size. Must be greater than 0.")
.setExampleValue("20")
- .setDeprecatedKey("pageSize", "5.2")
.setDefaultValue(String.valueOf(defaultPageSize));
return this;
} | SONAR-<I> remove deprecated 'pageIndex' and 'pageSize' params from web services | SonarSource_sonarqube | train | java |
7bba24ca89196c72ef8c9b04fd61fc3c228771ea | diff --git a/stanza/server/client.py b/stanza/server/client.py
index <HASH>..<HASH> 100644
--- a/stanza/server/client.py
+++ b/stanza/server/client.py
@@ -615,6 +615,8 @@ class CoreNLPClient(RobustService):
timeout=(self.timeout*2)/1000,
)
r.raise_for_status()
+ if r.encoding is None:
+ r.encoding = "utf-8"
return json.loads(r.text)
except requests.HTTPError as e:
if r.text.startswith("Timeout"): | If the response encoding isn't set, assume utf-8. Helps on Windows | stanfordnlp_stanza | train | py |
a2ad2cc66c70220b6355e3e5ebf0c1060c250298 | diff --git a/server/engine.js b/server/engine.js
index <HASH>..<HASH> 100644
--- a/server/engine.js
+++ b/server/engine.js
@@ -1,8 +1,9 @@
'use strict';
-var torrentStream = require('torrent-stream');
+var torrentStream = require('torrent-stream'),
+ _ = require('lodash');
module.exports = function (magnetUri, opts) {
- var engine = torrentStream(magnetUri, opts);
+ var engine = torrentStream(magnetUri, _.clone(opts, true));
engine.once('verifying', function () {
console.log('verifying ' + magnetUri.infoHash);
@@ -11,7 +12,7 @@ module.exports = function (magnetUri, opts) {
});
});
- engine.on('ready', function () {
+ engine.once('ready', function () {
console.log('ready ' + magnetUri.infoHash);
//engine.swarm.pause();
});
diff --git a/server/store.js b/server/store.js
index <HASH>..<HASH> 100644
--- a/server/store.js
+++ b/server/store.js
@@ -48,6 +48,8 @@ var store = {
return infoHash;
}
+ console.log('adding ' + infoHash);
+
var torrent = engine(magnetUri, options);
socket.register(infoHash, torrent);
torrents[infoHash] = torrent; | clone the options for each torrent | asapach_peerflix-server | train | js,js |
a0a2f973288b98d0c59a622149264a5f0c33ca44 | diff --git a/lib/server/request.rb b/lib/server/request.rb
index <HASH>..<HASH> 100644
--- a/lib/server/request.rb
+++ b/lib/server/request.rb
@@ -14,7 +14,7 @@ module Server
end
def params
- return {} unless uri
+ query = URI(uri).query || ''
@params ||= CGI::parse(URI(uri).query)
end | fix param access when there are no params in uri | dennisvandehoef_easy-html-creator | train | rb |
5f51e2fdd83c1f0d96451f44c0b87278224d6301 | diff --git a/lib/quickbooks/service/reports.rb b/lib/quickbooks/service/reports.rb
index <HASH>..<HASH> 100644
--- a/lib/quickbooks/service/reports.rb
+++ b/lib/quickbooks/service/reports.rb
@@ -12,8 +12,9 @@ module Quickbooks
end
options_string = options_string[0..-2]
options_string.gsub!(/\s/,"%20")
- # finalURL = "#{url_for_resource(model::REST_RESOURCE)}/#{report_name}#{options_string}"
- return "#{url_for_base}/reports/#{which_report}?date_macro=#{URI.encode_www_form_component(date_macro)}&#{options_string}"
+ finalURL = "#{url_for_base}/reports/#{which_report}?date_macro=#{URI.encode_www_form_component(date_macro)}&#{options_string}"
+ puts finalURL
+ return finalURL
end
end | logging of URL for debugging | ruckus_quickbooks-ruby | train | rb |
90aa37122c2bb187c91dfaea0c652608dfd80514 | diff --git a/oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb b/oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
index <HASH>..<HASH> 100644
--- a/oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
+++ b/oa-enterprise/lib/omniauth/strategies/ldap/adaptor.rb
@@ -55,7 +55,7 @@ module OmniAuth
config = {
:host => host,
- :eport => port,
+ :port => port,
}
config[:encryption] = {:method => method} if method | fix typo which broke LDAP authentication | omniauth_omniauth | train | rb |
7a09b7e2f516da8296c854460c626ffcabb47c79 | diff --git a/lib/controller/controller.rb b/lib/controller/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/controller/controller.rb
+++ b/lib/controller/controller.rb
@@ -126,7 +126,7 @@ module Ava
def register_client(addr, key)
return "Your IP is not allowed: #{addr}" unless validate_ip(addr)
- return { status: 401, error: ArgumentError.new('Invalid secret key.') } unless @key == key
+ return { status: 401, error: ArgumentError.new('Invalid secret key.') } unless self.key == key
@connections[addr] = {
key: Digest::SHA1.hexdigest("#{addr}|#{@key}"),
iv: @cipher.random_iv, | Removed instance variable call and replaced with correct method. | bblack16_ava-ruby | train | rb |
e1f7aa85200a74cf0ee84fa9e92a728cfaf10d58 | diff --git a/lib/wavefile.rb b/lib/wavefile.rb
index <HASH>..<HASH> 100644
--- a/lib/wavefile.rb
+++ b/lib/wavefile.rb
@@ -7,7 +7,7 @@ require 'wavefile/unvalidated_format'
require 'wavefile/writer'
module WaveFile
- VERSION = "0.8.0"
+ VERSION = "0.8.1"
WAVEFILE_FORMAT_CODE = "WAVE" # :nodoc:
FORMAT_CODES = {:pcm => 1, :float => 3, :extensible => 65534} # :nodoc: | Bumping version from <I> -> <I> | jstrait_wavefile | train | rb |
8e75131a671e45f0ede900d15d5ced2a6730eb5b | diff --git a/basepath_test.go b/basepath_test.go
index <HASH>..<HASH> 100644
--- a/basepath_test.go
+++ b/basepath_test.go
@@ -119,7 +119,7 @@ func TestNestedBasePaths(t *testing.T) {
}
for _, s := range specs {
- if actualPath, err := s.BaseFs.(*BasePathFs).RealPath(s.FileName); err != nil {
+ if actualPath, err := s.BaseFs.(*BasePathFs).fullPath(s.FileName); err != nil {
t.Errorf("Got error %s", err.Error())
} else if actualPath != s.ExpectedPath {
t.Errorf("Expected \n%s got \n%s", s.ExpectedPath, actualPath) | Closes spf<I>/afero#<I>
Amendment to previous commit, fixed the related test | spf13_afero | train | go |
56504b50a9a98eedb687ca2ace01ca17fb2682df | diff --git a/js/reveal.js b/js/reveal.js
index <HASH>..<HASH> 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1292,7 +1292,7 @@
if( value === 'null' ) return null;
else if( value === 'true' ) return true;
else if( value === 'false' ) return false;
- else if( value.match( /^[\d\.]+$/ ) ) return parseFloat( value );
+ else if( value.match( /^-?[\d\.]+$/ ) ) return parseFloat( value );
}
return value; | support negative values in query config overrides | hakimel_reveal.js | train | js |
3d0ac00e1783941569d0f0f702710a48c5fdfe43 | diff --git a/src/Driver/Http2Driver.php b/src/Driver/Http2Driver.php
index <HASH>..<HASH> 100644
--- a/src/Driver/Http2Driver.php
+++ b/src/Driver/Http2Driver.php
@@ -959,20 +959,8 @@ final class Http2Driver implements HttpDriver
$error = \unpack("N", $buffer)[1];
- if (isset($this->bodyEmitters[$id], $this->trailerDeferreds[$id])) {
- $exception = new ClientException("Client ended stream", self::STREAM_CLOSED);
-
- $emitter = $this->bodyEmitters[$id];
- $deferred = $this->trailerDeferreds[$id];
-
- unset($this->bodyEmitters[$id], $this->trailerDeferreds[$id]);
-
- $emitter->fail($exception);
- $deferred->fail($exception);
- }
-
if (isset($this->streams[$id])) {
- $this->releaseStream($id);
+ $this->releaseStream($id, new ClientException("Client ended stream", $error));
}
$buffer = \substr($buffer, 4); | Send exception to releaseStream on RST_STREAM frame | amphp_http-server | train | php |
08d515f605a16f9ceb211a0c20f8f88d87de48d4 | diff --git a/core/src/main/java/de/bwaldvogel/mongo/wire/MongoWireEncoder.java b/core/src/main/java/de/bwaldvogel/mongo/wire/MongoWireEncoder.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/de/bwaldvogel/mongo/wire/MongoWireEncoder.java
+++ b/core/src/main/java/de/bwaldvogel/mongo/wire/MongoWireEncoder.java
@@ -17,8 +17,7 @@ public class MongoWireEncoder extends MessageToByteEncoder<MongoReply> {
private static final Logger log = LoggerFactory.getLogger(MongoWireEncoder.class);
@Override
- protected void encode(ChannelHandlerContext ctx, MongoReply reply, ByteBuf buf) throws Exception {
-
+ protected void encode(ChannelHandlerContext ctx, MongoReply reply, ByteBuf buf) {
buf.writeIntLE(0); // write length later
buf.writeIntLE(reply.getHeader().getRequestID()); | Cleanup MongoWireEncoder | bwaldvogel_mongo-java-server | train | java |
992265962d4359de49502888c779863bffe2f6e3 | diff --git a/lib/jobs/index.js b/lib/jobs/index.js
index <HASH>..<HASH> 100644
--- a/lib/jobs/index.js
+++ b/lib/jobs/index.js
@@ -8,7 +8,6 @@ module.exports = {
artifactsDestroy: require('./artifactsDestroy'),
artifactsGet: require('./artifactsGet'),
artifactsList: require('./artifactsList'),
- artifactsShare: require('./artifactsShare'),
clone: require('./clone'),
create: require('./create'),
destroy: require('./destroy'), | remove artifactsShare method from docs for this release | Paperspace_paperspace-node | train | js |
06683fde9710cac1351068ad295498b33855fb5a | diff --git a/media/boom/js/boom.assets.js b/media/boom/js/boom.assets.js
index <HASH>..<HASH> 100755
--- a/media/boom/js/boom.assets.js
+++ b/media/boom/js/boom.assets.js
@@ -44,19 +44,11 @@ $.extend($.boom.assets, {
height: 500,
title: 'Select an asset',
cache: false,
- buttons: {
- '✕': function() {
- cleanup();
- ( opts.deferred ) && opts.deferred.reject();
- return false;
- },
- '✔': function() {
- var asset_id = browser.browser_asset( 'get_asset' );
- cleanup();
- ( opts.deferred ) && opts.deferred.resolve();
- complete.resolve( asset_id );
- return false;
- }
+ callback: function() {
+ var asset_id = browser.browser_asset( 'get_asset' );
+ cleanup();
+ complete.resolve( asset_id );
+ return false;
},
open: function(){
$.boom.log( 'dialog open' ); | remove custom okay/cancel buttons from asset manager dialog | boomcms_boom-core | train | js |
9d560d01486cc164c8cd5f1a97985ea41a19eaa6 | diff --git a/gromacs/fileformats/xvg.py b/gromacs/fileformats/xvg.py
index <HASH>..<HASH> 100644
--- a/gromacs/fileformats/xvg.py
+++ b/gromacs/fileformats/xvg.py
@@ -527,6 +527,10 @@ class XVG(utilities.FileUtils):
finally:
del rows # try to clean up as well as possible as it can be massively big
+ def to_df(self):
+ import pandas as _pd
+ return _pd.DataFrame(self.array.T, columns=["X",]+self.names, dtype=float)
+
def set(self, a):
"""Set the *array* data from *a* (i.e. completely replace). | Convert the xvg file to a Pandas DataFrame
- unclear if this is desired, Oli may not want to add dependancies such as pandas | Becksteinlab_GromacsWrapper | train | py |
82cc3a9b94f99ec1d157ab3f1c22293d056ee745 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -262,7 +262,7 @@ def get_version_info():
# If this is a release or another kind of source distribution of PyCBC
except:
- version = '1.6.10'
+ version = '1.6.11'
release = 'True'
date = hash = branch = tag = author = committer = status = builder = build_date = '' | set to <I> to test deployment | gwastro_pycbc | train | py |
452da7c81ca59bd7868933f26ebe970b3e763d66 | diff --git a/cas-server-core/src/test/java/org/jasig/cas/authentication/FileTrustStoreSslSocketFactoryTests.java b/cas-server-core/src/test/java/org/jasig/cas/authentication/FileTrustStoreSslSocketFactoryTests.java
index <HASH>..<HASH> 100644
--- a/cas-server-core/src/test/java/org/jasig/cas/authentication/FileTrustStoreSslSocketFactoryTests.java
+++ b/cas-server-core/src/test/java/org/jasig/cas/authentication/FileTrustStoreSslSocketFactoryTests.java
@@ -48,7 +48,7 @@ public class FileTrustStoreSslSocketFactoryTests {
final ClassPathResource resource = new ClassPathResource("truststore.jks");
final FileTrustStoreSslSocketFactory factory = new FileTrustStoreSslSocketFactory(resource.getFile(), "changeit");
final SimpleHttpClient client = new SimpleHttpClient(factory);
- assertTrue(client.isValidEndPoint("https://www.cacert.org"));
+ assertTrue(client.isValidEndPoint("https://test.scaldingspoon.org/idp/shibboleth"));
} | Issue <I>: revert wrong change on cert tests | apereo_cas | train | java |
4bcc39604660d6384dfe5f7f0379e847d4cd0007 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import os
-from setuptools import setup
+from distutils.core import setup
from neo4jrestclient import constants | Switched back to distutils so it will actually be installable ;). | versae_neo4j-rest-client | train | py |
8e01224b8db00a47ea012299ac8c14fd924cbb63 | diff --git a/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java b/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java
index <HASH>..<HASH> 100644
--- a/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java
+++ b/pig/src/main/java/com/twitter/elephantbird/pig/util/ThriftToPig.java
@@ -91,7 +91,7 @@ public class ThriftToPig<M extends TBase<?, ?>> {
public static void setConversionProperties(Configuration conf) {
if (conf != null) {
useEnumId = conf.getBoolean(USE_ENUM_ID_CONF_KEY, false);
- LOG.info("useEnumId is set to " + useEnumId);
+ LOG.debug("useEnumId is set to " + useEnumId);
}
} | Change the log information for USE_ENUM_ID_CONF_KEY to debug level. | twitter_elephant-bird | train | java |
223d2175d5f58eb80838bc428fb93a6e2a0ea60d | diff --git a/src/js/bootstrap-datetimepicker.js b/src/js/bootstrap-datetimepicker.js
index <HASH>..<HASH> 100644
--- a/src/js/bootstrap-datetimepicker.js
+++ b/src/js/bootstrap-datetimepicker.js
@@ -110,7 +110,7 @@ THE SOFTWARE.
}
}
}
- picker.use24hours = (picker.format.toLowerCase().indexOf('a') < 1 && picker.format.indexOf('h') < 1);
+ picker.use24hours = (picker.format.toLowerCase().indexOf('a') < 0 && picker.format.indexOf('h') < 0);
if (picker.component) {
icon = picker.component.find('span'); | Fixed comparison
We're looking for cases where 'a', 'A' and 'h' are not in the format string. They can be in first position so need to check for 'not found', i.e. `<0` or `-1`. | Eonasdan_bootstrap-datetimepicker | train | js |
454eab720e04d5240139867d30068dd4d3ba3c4e | diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go
index <HASH>..<HASH> 100644
--- a/cmd/lncli/commands.go
+++ b/cmd/lncli/commands.go
@@ -1014,6 +1014,7 @@ func sendPayment(ctx *cli.Context) error {
if ctx.IsSet("pay_req") {
req = &lnrpc.SendRequest{
PaymentRequest: ctx.String("pay_req"),
+ Amt: ctx.Int64("amt"),
}
} else {
args := ctx.Args()
@@ -1138,6 +1139,11 @@ var payInvoiceCommand = cli.Command{
Name: "pay_req",
Usage: "a zpay32 encoded payment request to fulfill",
},
+ cli.Int64Flag{
+ Name: "amt",
+ Usage: "(optional) number of satoshis to fulfill the " +
+ "invoice",
+ },
},
Action: actionDecorator(payInvoice),
}
@@ -1158,6 +1164,7 @@ func payInvoice(ctx *cli.Context) error {
req := &lnrpc.SendRequest{
PaymentRequest: payReq,
+ Amt: ctx.Int64("amt"),
}
return sendPaymentRequest(ctx, req) | lncli: optionally include the amount in the payment request | lightningnetwork_lnd | train | go |
716e3fdb9424485cd483711a2028b3253fe63a86 | diff --git a/enabler/src/com/openxc/enabler/BootupReceiver.java b/enabler/src/com/openxc/enabler/BootupReceiver.java
index <HASH>..<HASH> 100644
--- a/enabler/src/com/openxc/enabler/BootupReceiver.java
+++ b/enabler/src/com/openxc/enabler/BootupReceiver.java
@@ -15,7 +15,7 @@ import android.util.Log;
* management.
*/
public class BootupReceiver extends BroadcastReceiver {
- private final static String TAG = "BootupReceiver";
+ private final static String TAG = BootupReceiver.class.getSimpleName();
// TODO what about when the device is already started? need an app to hit?
// or do we rely on it being started by the bind call? might get duplicate | Grab log TAG without a hard coded string. | openxc_openxc-android | train | java |
67e8019a3d7e8bd32fb85fdcdca7f6b98a044e15 | diff --git a/src/core/text/Text.js b/src/core/text/Text.js
index <HASH>..<HASH> 100644
--- a/src/core/text/Text.js
+++ b/src/core/text/Text.js
@@ -32,10 +32,11 @@ export default class Text extends Sprite
/**
* @param {string} text - The string that you would like the text to display
* @param {object|PIXI.TextStyle} [style] - The style parameters
+ * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text
*/
- constructor(text, style)
+ constructor(text, style, canvas)
{
- const canvas = document.createElement('canvas');
+ canvas = canvas || document.createElement('canvas');
canvas.width = 3;
canvas.height = 3; | The canvas could be passed into Text
This feature could help users to share canvas among two or more Text objects ( like Graphics._SPRITE_TEXTURE in Graphics).
In the game ,normally we need rebuild stage/scene when stage/scene changed , If Text supports passing canvas , we could avoid create and destroy HTMLCanvasElement often when game running.
e.g. create a canvas-pool cache some canvas for Text. | pixijs_pixi.js | train | js |
f8697ccb5506cf76b0baf81dd2aaff05a1f3b25e | diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
+++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -848,6 +848,7 @@ class CakeEmailTest extends CakeTestCase {
* @return void
*/
public function testSendRenderWithVarsJapanese() {
+ $this->skipIf(!function_exists('mb_convert_encoding'));
$this->CakeEmail->reset();
$this->CakeEmail->transport('debug'); | Added skip if mbstring not available | cakephp_cakephp | train | php |
9ec4f404d52a9a78d9860d7f561c7d58ab0fe458 | diff --git a/Classes/Command/HelpCommandController.php b/Classes/Command/HelpCommandController.php
index <HASH>..<HASH> 100644
--- a/Classes/Command/HelpCommandController.php
+++ b/Classes/Command/HelpCommandController.php
@@ -30,13 +30,14 @@ namespace Helhum\Typo3Console\Command;
use Helhum\Typo3Console\Core\Booting\RunLevel;
use Helhum\Typo3Console\Core\ConsoleBootstrap;
+use Helhum\Typo3Console\Mvc\Controller\CommandController;
/**
* A Command Controller which provides help for available commands
*
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
*/
-class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController {
+class HelpCommandController extends CommandController {
/**
* @var \Helhum\Typo3Console\Mvc\Cli\CommandManager | [BUGFIX] Fix help command for <I> TYPO3 branch | TYPO3-Console_TYPO3-Console | train | php |
5f1534a6005462613e8f9df89ae15c4c1479626c | diff --git a/config/database.php b/config/database.php
index <HASH>..<HASH> 100644
--- a/config/database.php
+++ b/config/database.php
@@ -64,15 +64,6 @@ $configuration["pluralizeTableName"] = true;
$configuration["tableNameStyle"] = BaseModel::TBL_NAME_CAMEL_LCFIRST;
/*
- * Model loader
- *
- * Available options are:
- * - PDO (if subcomponent database-pdo is installed)
- * - Illuminate (if subcomponent database-illuminate is installed)
- */
-$configuration["loader"] = "PHP";
-
-/*
* Model class namespace
*
* The namespace in which the Model classes are defined. | currently only one loader, removing config option | SlaxWeb_Database | train | php |
f9cb6746c6f06da39c2193545eebbb2bca9fd22a | diff --git a/trailblazer/mip/config.py b/trailblazer/mip/config.py
index <HASH>..<HASH> 100644
--- a/trailblazer/mip/config.py
+++ b/trailblazer/mip/config.py
@@ -29,10 +29,10 @@ class SampleSchema(Schema):
)
expected_coverage = fields.Float()
capture_kit = fields.Str(
- validate=validate.OneOf(choices=['Agilent_SureSelectCRE.V1',
- 'Agilent_SureSelect.V5',
- 'Agilent_SureSelectFocusedExome.V1']),
- default='Agilent_SureSelectCRE.V1'
+ validate=validate.OneOf(choices=['agilent_sureselect_cre.v1',
+ 'agilent_sureselect.v5',
+ 'agilent_sureselect_focusedexome.v1']),
+ default='agilent_sureselect_cre.v1',
) | update to MIP 5 capture kit keys | Clinical-Genomics_trailblazer | train | py |
a412d6c72b22d5bfea66aeda70d51381ec131932 | diff --git a/go/sqltypes/value_test.go b/go/sqltypes/value_test.go
index <HASH>..<HASH> 100644
--- a/go/sqltypes/value_test.go
+++ b/go/sqltypes/value_test.go
@@ -578,14 +578,14 @@ func TestParseNumbers(t *testing.T) {
t.Error(err)
}
if uval != 1 {
- t.Errorf("v.ParseInt64 = %d, want 1", uval)
+ t.Errorf("v.ParseUint64 = %d, want 1", uval)
}
fval, err := v.ParseFloat64()
if err != nil {
t.Error(err)
}
if fval != 1 {
- t.Errorf("v.ParseInt64 = %f, want 1", fval)
+ t.Errorf("v.ParseFloat64 = %f, want 1", fval)
}
} | fix method names in Errorf calls | vitessio_vitess | train | go |
31748ff27ca26454aac9d2e4bf3545018a12b8ef | diff --git a/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/dialect/sqlserver/sql/SQLServerSelectParser.java b/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/dialect/sqlserver/sql/SQLServerSelectParser.java
index <HASH>..<HASH> 100755
--- a/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/dialect/sqlserver/sql/SQLServerSelectParser.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/parsing/parser/dialect/sqlserver/sql/SQLServerSelectParser.java
@@ -45,7 +45,6 @@ public final class SQLServerSelectParser extends AbstractSelectParser {
@Override
protected void parseInternal(final SelectStatement selectStatement) {
- parseDistinct();
parseTop(selectStatement);
parseSelectList(selectStatement, getItems());
parseFrom(selectStatement); | delete parseDistinct(); | apache_incubator-shardingsphere | train | java |
3b54bc12757a744a42cb4442b38b474b74bbe965 | diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/bot.rb
+++ b/lib/discordrb/bot.rb
@@ -517,6 +517,11 @@ module Discordrb
handle_dispatch(type, data)
end
+ # Raises a heartbeat event. Called by the gateway connection handler used internally.
+ def raise_heartbeat_event(event)
+ raise_event(event)
+ end
+
private
# Throws a useful exception if there's currently no gateway connection
diff --git a/lib/discordrb/gateway.rb b/lib/discordrb/gateway.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/gateway.rb
+++ b/lib/discordrb/gateway.rb
@@ -353,6 +353,7 @@ module Discordrb
# suspended (e.g. after op7)
if (@session && !@session.suspended?) || !@session
sleep @heartbeat_interval
+ @bot.raise_heartbeat_event(Discordrb::Events::HeartbeatEvent.new(self))
heartbeat
else
sleep 1 | Reintroduces heartbeat events that were lost in the gateway update | meew0_discordrb | train | rb,rb |
e1ed9d5a2130edb64baf496b434b4c60e839a609 | diff --git a/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/RemoteContentRepository.java b/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/RemoteContentRepository.java
index <HASH>..<HASH> 100644
--- a/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/RemoteContentRepository.java
+++ b/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/RemoteContentRepository.java
@@ -262,7 +262,7 @@ public class RemoteContentRepository extends ContentRepository {
return contextRoot;
}
- private class ArquillianLaunchVariableResolver implements XPathVariableResolver {
+ private static class ArquillianLaunchVariableResolver implements XPathVariableResolver {
private final String qualifier; | fixed sonar issues (changed to static class) | inkstand-io_scribble | train | java |
1e61e92f59a2bd713cb7813aad56282d2a826bcb | diff --git a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/bytebuffered/OutgoingConnection.java b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/bytebuffered/OutgoingConnection.java
index <HASH>..<HASH> 100644
--- a/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/bytebuffered/OutgoingConnection.java
+++ b/nephele/nephele-server/src/main/java/eu/stratosphere/nephele/taskmanager/bytebuffered/OutgoingConnection.java
@@ -493,10 +493,10 @@ public class OutgoingConnection {
}
}
}
-
+
// Recycle buffer outside of queuedEnvelopes monitor, otherwise dead locks might occur
final Iterator<Buffer> it = buffersToRecycle.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
it.next().recycleBuffer();
}
} | Corrected code style of OutgoingConnection.java | apache_flink | train | java |
087f2cc28ff0f37c6fb74f1c52f51afa01714f65 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -44,7 +44,7 @@ function initializer(key, base_url, options) {
}
function parseResponse(err, response, body){
- let data;
+ var data;
if (!body) {
data = err;
} else {
@@ -67,7 +67,7 @@ function parseResponse(err, response, body){
err = new Error(err);
err.code = response.statusCode;
}
- return {err, response, data};
+ return {err: err, response: response, data: data};
}
initializer.prototype._request = function (method, path, params, body, callback){
@@ -96,13 +96,13 @@ initializer.prototype._request = function (method, path, params, body, callback)
//Initiate HTTP request
return callback
? request(options, function(err, response, body) {
- let parsed = parseResponse(err, response, body)
+ var parsed = parseResponse(err, response, body)
return callback(parsed.err, parsed.data, parsed.response)
})
: new Promise(function(resolve, reject) {
request(options, function(err, response, body) {
- let parsed = parseResponse(err, response, body)
+ var parsed = parseResponse(err, response, body)
return parsed.err
? reject(parsed.err) | Removed some ES6 syntax
- Follows style of other code
- Plus it was making the parser upset for the tests | zencoder_zencoder-node | train | js |
ce014a5ffc554553488a07fc956ae2423c71cca2 | diff --git a/android/src/com/google/zxing/client/android/ViewfinderView.java b/android/src/com/google/zxing/client/android/ViewfinderView.java
index <HASH>..<HASH> 100755
--- a/android/src/com/google/zxing/client/android/ViewfinderView.java
+++ b/android/src/com/google/zxing/client/android/ViewfinderView.java
@@ -155,7 +155,11 @@ public final class ViewfinderView extends View {
}
public void drawViewfinder() {
- resultBitmap = null;
+ Bitmap resultBitmap = this.resultBitmap;
+ this.resultBitmap = null;
+ if (resultBitmap != null) {
+ resultBitmap.recycle();
+ }
invalidate();
} | Fixed potential bug in not recycling bitmaps that I spied from BS+
git-svn-id: <URL> | zxing_zxing | train | java |
5eb9c23ec25fa38d35dbc12a6409a25a90a4e291 | diff --git a/foreverizer/foreverizer_windows.go b/foreverizer/foreverizer_windows.go
index <HASH>..<HASH> 100644
--- a/foreverizer/foreverizer_windows.go
+++ b/foreverizer/foreverizer_windows.go
@@ -8,13 +8,14 @@ import (
)
func userLoginInstall(opts Options) error {
+ ignitionPath := opts.IgnitionPath
key, err := registry.OpenKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Run`, registry.WRITE)
if err != nil {
return err
}
- ignitionPath := fmt.Sprintf("\"%s\"", opts.IgnitionPath)
+ quotedIgnitionPath := fmt.Sprintf("\"%s\"", ignitionPath)
debug("writing registry key...")
- key.SetStringValue(opts.ServiceName, ignitionPath)
+ key.SetStringValue(opts.ServiceName, quotedIgnitionPath)
key.Close()
cmd := exec.Command(ignitionPath)
diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -1,4 +1,4 @@
package main
// VERSION is the current application Version
-var VERSION = "15.0.3"
+var VERSION = "15.0.4" | <I> start unquoted path | octoblu_go-meshblu-connector-assembler | train | go,go |
d2e553bb5f1d3d25aef87e3343660f2746ceb0ff | diff --git a/spec/amount_spec.rb b/spec/amount_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/amount_spec.rb
+++ b/spec/amount_spec.rb
@@ -20,11 +20,11 @@ describe VirtualMerchant::Amount, "#amount" do
end
it "initializes with recurring data" do
- amount = VirtualMerchant::Amount.new(total: 10.99, next_payment_date: '10/30/13',
+ amount = VirtualMerchant::Amount.new(total: 10.99, next_payment_date: '10/30/2013',
billing_cycle: 'MONTHLY')
amount.total.should eq("10.99")
amount.tax.should eq("0.00")
- amount.next_payment_date.should eq("10/30/13")
+ amount.next_payment_date.should eq("10/30/2013")
amount.billing_cycle.should eq("MONTHLY")
amount.end_of_month.should eq("Y")
end | Changed date format in test to reflect correct format for billing_cycle | leequarella_VirtualMerchant-Ruby | train | rb |
21678316be19b54b52f195181383e7df5befd8e9 | diff --git a/lib/diarize/speaker.rb b/lib/diarize/speaker.rb
index <HASH>..<HASH> 100644
--- a/lib/diarize/speaker.rb
+++ b/lib/diarize/speaker.rb
@@ -59,9 +59,17 @@ module Diarize
fr.lium.spkDiarization.libModel.Distance.GDMAP(speaker1.model, speaker2.model)
end
+ def self.match_sets(speakers1, speakers2)
+ matches = []
+ speakers1.each do |s1|
+ speakers2.each do |s2|
+ matches << [ s1, s2 ] if s1.same_speaker_as(s2)
+ end
+ end
+ matches
+ end
+
def self.match(speakers)
- speakers.each { |s| s.normalize! }
- speakers = speakers.select { |s| s.mean_log_likelihood > @@log_likelihood_threshold }
speakers.combination(2).select { |s1, s2| s1.same_speaker_as(s2) }
end
@@ -86,6 +94,7 @@ module Diarize
def same_speaker_as(other)
# Detection score defined in Ben2005
+ return unless [ self.mean_log_likelihood, other.mean_log_likelihood ].min > @@log_likelihood_threshold
self.normalize!
other.normalize!
detection_score = 1.0 - Speaker.divergence(other, self) | Adding match_set method to the Speaker class | bbc_diarize-jruby | train | rb |
4fed7a5969c4f3c45585e6e5e72960779c6ad659 | diff --git a/lib/queue_classic/worker.rb b/lib/queue_classic/worker.rb
index <HASH>..<HASH> 100644
--- a/lib/queue_classic/worker.rb
+++ b/lib/queue_classic/worker.rb
@@ -31,9 +31,9 @@ module QC
# Define setup_child to hook into the forking process.
# Using setup_child is good for re-establishing database connections.
def fork_and_work
- @cpid = fork {setup_child; work}
- log(:at => :fork, :pid => @cpid)
- Process.wait(@cpid)
+ cpid = fork {setup_child; work}
+ log(:at => :fork, :pid => cpid)
+ Process.wait(cpid)
end
# This method will lock a job & process the job. | does not need to be ivar | QueueClassic_queue_classic | train | rb |
6c4002d48dda94ff5494a8fe54c8e7cd0f3ca91d | diff --git a/simple_rest/response.py b/simple_rest/response.py
index <HASH>..<HASH> 100644
--- a/simple_rest/response.py
+++ b/simple_rest/response.py
@@ -65,7 +65,7 @@ class RESTfulResponse(object):
results = view_func(request, *args, **kwargs)
except HttpError, e:
results = (
- hasattr(e, 'message') and {'error': e.message} or None,
+ e.message and {'error': e.message} or None,
e.status
) | Fixed a small bug with HttpError objects and content negotiation
If the user was using content negotiation and threw an HttpError and
did not provide a message, None would be returned to the client rather
than just an empty message body. This commit fixes that issue. | croach_django-simple-rest | train | py |
f4ec65d7bc55bbdeac39496b89fec969ed06af6f | diff --git a/src/Translation/TranslationFile.php b/src/Translation/TranslationFile.php
index <HASH>..<HASH> 100644
--- a/src/Translation/TranslationFile.php
+++ b/src/Translation/TranslationFile.php
@@ -512,6 +512,11 @@ class TranslationFile
} else {
if (isset($ctype[$getkey]) && $ctype[$getkey] !== '') {
$hinting[$key] = $ctype[$getkey];
+ } else {
+ $fallback = $this->app['translator']->trans($key, array(), 'contenttypes');
+ if ($fallback !== $key) {
+ $hinting[$key] = $fallback;
+ }
}
$newTranslations[$key] = '';
} | Use fallback language when no entry is found in contenttypes.yml | bolt_bolt | train | php |
769158fc3a24f19aa4181c3fec79104fd7a38a9c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,7 @@ setup(name='grs',
author_email='toomore0929@gmail.com',
url='https://github.com/toomore/grs',
packages=['grs'],
+ package_data={'grs': ['*.csv']},
include_package_data=True,
license='MIT',
keywords="Taiwan Stock Exchange taipei twse otc gretai " + \ | Add `package_data` include csv. | toomore_grs | train | py |
64af652a348c23ea1701d2133cd0718c27c48d2a | diff --git a/ibis/sql/postgres/tests/test_client.py b/ibis/sql/postgres/tests/test_client.py
index <HASH>..<HASH> 100644
--- a/ibis/sql/postgres/tests/test_client.py
+++ b/ibis/sql/postgres/tests/test_client.py
@@ -15,6 +15,7 @@
import os
import pandas as pd
+import pytest
from .common import PostgreSQLTests
from ibis.compat import unittest
@@ -85,11 +86,12 @@ class TestPostgreSQLClient(PostgreSQLTests, unittest.TestCase):
assert POSTGRES_TEST_DB in self.con.list_databases()
+@pytest.mark.postgresql
def test_metadata_is_per_table():
con = ibis.postgres.connect(host='localhost', database=POSTGRES_TEST_DB)
assert len(con.meta.tables) == 0
# assert that we reflect only when a table is requested
- t = con.table('functional_alltypes')
+ t = con.table('functional_alltypes') # noqa
assert 'functional_alltypes' in con.meta.tables
assert len(con.meta.tables) == 1 | BUG: fix failing test when psycopg2 not installed | ibis-project_ibis | train | py |
6bc04c4bef30dc0eebbcec1836f16f1d0f6a4816 | diff --git a/src/engine/blocks.js b/src/engine/blocks.js
index <HASH>..<HASH> 100644
--- a/src/engine/blocks.js
+++ b/src/engine/blocks.js
@@ -375,18 +375,14 @@ class Blocks {
const change = e.newContents_;
if (change.hasOwnProperty('minimized')) {
comment.minimized = change.minimized;
- break;
- } else if (change.hasOwnProperty('width') && change.hasOwnProperty('height')){
+ }
+ if (change.hasOwnProperty('width') && change.hasOwnProperty('height')){
comment.width = change.width;
comment.height = change.height;
- break;
- } else if (change.hasOwnProperty('text')) {
+ }
+ if (change.hasOwnProperty('text')) {
comment.text = change.text;
- break;
}
- log.warn(`Unrecognized comment change: ${
- JSON.stringify(change)} for comment with id: ${e.commentId}.`);
- return;
}
break;
case 'comment_move': | Let comment change event handler multitask. | LLK_scratch-vm | train | js |
86a8925bceaa0e8706ea7612956827e99b368168 | diff --git a/utils/gh2k.py b/utils/gh2k.py
index <HASH>..<HASH> 100755
--- a/utils/gh2k.py
+++ b/utils/gh2k.py
@@ -265,15 +265,16 @@ if __name__ == '__main__':
git_index = "github_git"
issues_index = "github_issues"
- logging.info("Creating new GitHub dashboard with %i repositores from %s" %
- (args.nrepos, args.org))
# The owner could be a org or an user.
(owner_url, owner) = get_owner_repos_url(args.org, args.token)
+ logging.info("Creating new GitHub dashboard with %i repositores from %s" %
+ (args.nrepos, owner)
+
# Generate redirect web page first so dashboard can be used
# with partial data during data retrieval
- create_redirect_web_page(args.web_dir, args.org, args.kibana_url)
+ create_redirect_web_page(args.web_dir, owner, args.kibana_url)
repos = get_repositores(owner_url, args.token, args.nrepos)
first_repo = True | [gh2k.py] Fix in redirect web pages for new owner logic. | chaoss_grimoirelab-elk | train | py |
dc0fea616507659ec7272203a8c2caae817aea08 | diff --git a/api/gw/gw.go b/api/gw/gw.go
index <HASH>..<HASH> 100644
--- a/api/gw/gw.go
+++ b/api/gw/gw.go
@@ -71,6 +71,7 @@ type GatewayStatsPacket struct {
Altitude float64 `json:"altitude"`
RXPacketsReceived int `json:"rxPacketsReceived"`
RXPacketsReceivedOK int `json:"rxPacketsReceivedOK"`
+ TXPacketsReceived int `json:"txPacketsReceived"`
TXPacketsEmitted int `json:"txPacketsEmitted"`
CustomData map[string]interface{} `json:"customData"` // custom fields defined by alternative packet_forwarder versions (e.g. TTN sends platform, contactEmail, and description)
} | Add TXPacketsReceived field to GatewayStatsPacket. | brocaar_loraserver | train | go |
00bbf4f52351280791fbc59761533d296b59861b | diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
@@ -122,7 +122,7 @@ class SimpleObjectHydrator extends AbstractHydrator
}
// Check if value is null before conversion (because some types convert null to something else)
- $valueIsNull = $value === null;
+ $valueIsNull = null === $value;
// Convert field to a valid PHP value
if (isset($cacheKeyInfo['type'])) { | Use yoda condition in the null check | doctrine_orm | train | php |
4d07130a513e94f4b970de252f271e3fdb570ddf | diff --git a/tools/debugging/matrix/generate_messages.py b/tools/debugging/matrix/generate_messages.py
index <HASH>..<HASH> 100755
--- a/tools/debugging/matrix/generate_messages.py
+++ b/tools/debugging/matrix/generate_messages.py
@@ -106,6 +106,8 @@ def logtime(msg: str, *args: Any, **kwargs: Any) -> Iterator[Dict[str, Any]]:
start = time.monotonic()
details: Dict[str, Any] = {}
+ log.info("Started: " + msg, *args, **kwargs, **details)
+
yield details
elapsed = time.monotonic() - start | Added started to logging
This is useful to count the number of concurrent requests that are
pending. | raiden-network_raiden | train | py |
67f8807fc8061de295aabe663b029e90576773e6 | diff --git a/lib/reducers/create-user-reducer.js b/lib/reducers/create-user-reducer.js
index <HASH>..<HASH> 100644
--- a/lib/reducers/create-user-reducer.js
+++ b/lib/reducers/create-user-reducer.js
@@ -2,7 +2,12 @@ import update from 'immutability-helper'
// TODO: port user-specific code from the otp reducer.
function createUserReducer () {
- const initialState = {}
+ const initialState = {
+ accessToken: null,
+ loggedInUser: null,
+ loggedInUserMonitoredTrips: null,
+ pathBeforeSignIn: null
+ }
return (state = initialState, action) => {
switch (action.type) { | refactor(createUserReducer): Add initial user redux state. | opentripplanner_otp-react-redux | train | js |
ac4b91bff98c4e73bbde7028ed683f5e062f5124 | diff --git a/cmd/juju/cloud/add_test.go b/cmd/juju/cloud/add_test.go
index <HASH>..<HASH> 100644
--- a/cmd/juju/cloud/add_test.go
+++ b/cmd/juju/cloud/add_test.go
@@ -312,6 +312,7 @@ func (*addSuite) TestInteractive(c *gc.C) {
c.Assert(out.String(), gc.Equals, ""+
"Cloud Types\n"+
+ " lxd\n"+
" maas\n"+
" manual\n"+
" openstack\n"+ | Fix the failing test
Potentially this should be behind a feature flag | juju_juju | train | go |
596162c26169d4d1a4ade0ef0703635e114308f5 | diff --git a/backend/servers/express-webrouter/app/src/render.js b/backend/servers/express-webrouter/app/src/render.js
index <HASH>..<HASH> 100644
--- a/backend/servers/express-webrouter/app/src/render.js
+++ b/backend/servers/express-webrouter/app/src/render.js
@@ -9,7 +9,7 @@ const packageConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, '../../package.json'))
.toString('utf-8')
)
-const { SITE_NAME } = process.env
+const { TRACKING_ID, SITE_NAME } = process.env
let TELEPORT_WELCOME = {}
const teleportDir = path.join(__dirname, '../../config/teleport_welcome.json')
if (fs.existsSync(teleportDir)) {
@@ -48,7 +48,8 @@ export function useRender(app, config = {}) {
app.set('context', Object.assign(app.get('context') || {}, {
SITE_NAME,
TELEPORT_WELCOME,
- TELEPORT_WELCOME_STRING
+ TELEPORT_WELCOME_STRING,
+ TRACKING_ID
}, extraContext))
// render
res.render(indexFileDir, app.get('context')) | removed TELEPORT_WELCOM_STRING in render | Ledoux_teleport-express-webrouter | train | js |
fad7d9b963f4ee2f34956ccb96877cea23fe8c72 | diff --git a/p2p/muxer/mplex/multiplex.go b/p2p/muxer/mplex/multiplex.go
index <HASH>..<HASH> 100644
--- a/p2p/muxer/mplex/multiplex.go
+++ b/p2p/muxer/mplex/multiplex.go
@@ -3,8 +3,8 @@ package peerstream_multiplex
import (
"net"
- smux "github.com/libp2p/go-stream-muxer" // Conn is a connection to a remote peer.
- mp "github.com/whyrusleeping/go-multiplex" // Conn is a connection to a remote peer.
+ mp "github.com/libp2p/go-mplex" // Conn is a connection to a remote peer.
+ smux "github.com/libp2p/go-stream-muxer" // Conn is a connection to a remote peer.
)
type conn struct { | switch to the correct mplex package | libp2p_go-libp2p | train | go |
4c2bfffcaa8991fdaf9403e36ef516abffc4ff1d | diff --git a/chef/lib/chef/provider/template.rb b/chef/lib/chef/provider/template.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/provider/template.rb
+++ b/chef/lib/chef/provider/template.rb
@@ -19,6 +19,7 @@
require 'chef/provider/file'
require 'chef/mixin/template'
require 'chef/mixin/checksum'
+require 'chef/mixin/find_preferred_file'
require 'chef/rest'
require 'chef/file_cache'
require 'uri'
@@ -30,6 +31,7 @@ class Chef
include Chef::Mixin::Checksum
include Chef::Mixin::Template
+ include Chef::Mixin::FindPreferredFile
def action_create
Chef::Log.debug(@node.run_state.inspect) | Adding missing Chef::Mixin::FindPreferredFile | chef_chef | train | rb |
dd415eec731c71d658390dde1dd3d171e8f168ac | diff --git a/lib/qiita/client/users.rb b/lib/qiita/client/users.rb
index <HASH>..<HASH> 100644
--- a/lib/qiita/client/users.rb
+++ b/lib/qiita/client/users.rb
@@ -10,6 +10,10 @@ module Qiita
path = url_name ? "/users/#{url_name}/stocks" : '/stocks'
get path, params
end
+
+ def user(url_name)
+ get "/users/#{url_name}"
+ end
end
end
end | Impl the method to get user data | increments_qiita-rb | train | rb |
a19081e4a2b5622fb4abdf2ef2e641e454ac64b5 | diff --git a/src/Google/Service/Bigquery.php b/src/Google/Service/Bigquery.php
index <HASH>..<HASH> 100644
--- a/src/Google/Service/Bigquery.php
+++ b/src/Google/Service/Bigquery.php
@@ -2876,6 +2876,7 @@ class Google_Service_Bigquery_Table extends Google_Model
public $id;
public $kind;
public $lastModifiedTime;
+ public $location;
public $numBytes;
public $numRows;
protected $schemaType = 'Google_Service_Bigquery_TableSchema';
@@ -2952,6 +2953,14 @@ class Google_Service_Bigquery_Table extends Google_Model
{
return $this->lastModifiedTime;
}
+ public function setLocation($location)
+ {
+ $this->location = $location;
+ }
+ public function getLocation()
+ {
+ return $this->location;
+ }
public function setNumBytes($numBytes)
{
$this->numBytes = $numBytes; | Updated Bigquery.php
This change has been generated by a script that has detected changes in the
discovery doc of the API.
Check <URL> | googleapis_google-api-php-client | train | php |
fb0048175ec34967389096f9441f21cfdea606cd | diff --git a/bin/extract_gene_seq.py b/bin/extract_gene_seq.py
index <HASH>..<HASH> 100755
--- a/bin/extract_gene_seq.py
+++ b/bin/extract_gene_seq.py
@@ -29,8 +29,7 @@ def start_logging(log_file='', log_level='INFO'):
if not log_file:
# create log directory if it doesn't exist
- file_dir = os.path.dirname(os.path.realpath(__file__))
- log_dir = os.path.join(file_dir, '../log/')
+ log_dir = os.path.abspath('log/')
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
diff --git a/bin/permutation_test.py b/bin/permutation_test.py
index <HASH>..<HASH> 100755
--- a/bin/permutation_test.py
+++ b/bin/permutation_test.py
@@ -38,8 +38,7 @@ def start_logging(log_file='', log_level='INFO'):
"""
if not log_file:
# create log directory if it doesn't exist
- file_dir = os.path.dirname(os.path.realpath(__file__))
- log_dir = os.path.join(file_dir, '../log/')
+ log_dir = os.path.abspath('log/')
if not os.path.isdir(log_dir):
os.mkdir(log_dir) | Create automatic log file relative to the directory where users run a script rather than where the script is actually located. This prevents scripts in the installed python bin directory from having log output where the user can't find it. | KarchinLab_probabilistic2020 | train | py,py |
ae6cf8827d6be37fd5da5285285a1202d0b01e82 | diff --git a/websocket_server/websocket_server.py b/websocket_server/websocket_server.py
index <HASH>..<HASH> 100644
--- a/websocket_server/websocket_server.py
+++ b/websocket_server/websocket_server.py
@@ -157,8 +157,10 @@ class WebSocketHandler(StreamRequestHandler):
return bytes
def read_next_message(self):
-
- b1, b2 = self.read_bytes(2)
+ try:
+ b1, b2 = self.read_bytes(2)
+ except ValueError as e:
+ b1, b2 = 0, 0
fin = b1 & FIN
opcode = b1 & OPCODE | fixed force close error
When a client force close(such as CTRL+C), websocket server will show error because can't get next message. | Pithikos_python-websocket-server | train | py |
229182159dabdc05820f560c9307b85db3a09843 | diff --git a/lib/sambal/client.rb b/lib/sambal/client.rb
index <HASH>..<HASH> 100644
--- a/lib/sambal/client.rb
+++ b/lib/sambal/client.rb
@@ -31,7 +31,9 @@ module Sambal
options = parsed_options(user_options)
@timeout = options[:timeout].to_i
- option_flags = "-W \"#{options[:domain]}\" -U \"#{options[:user]}\" -I #{options[:ip_address]} -p #{options[:port]} -s /dev/null"
+ option_flags = "-W \"#{options[:domain]}\" -U \"#{options[:user]}\""
+ option_flags = "#{option_flags} -I #{options[:ip_address]}" if options[:ip_address]
+ option_flags = "#{option_flags} -p #{options[:port]} -s /dev/null"
password = options[:password] ? "'#{options[:password]}'" : "--no-pass"
command = "COLUMNS=#{options[:columns]} smbclient \"//#{options[:host]}/#{options[:share]}\" #{password}" | Fix the client options to work with the ip address thing. | johnae_sambal | train | rb |
966ad9158fc0a2535e84d6d196df8a5acb0607d3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,9 @@ from distutils.core import setup
setup(
name = 'kem',
- packages = ['kem'],
+ packages=['kem'],
+ package_dir={'kem':'kem'},
+ package_data={'kem':['management/commands/*']},
version = '1.0',
description = 'A django App for kem',
author = ['davidtnfsh', 'theshaneyu'], | [Bug fix] add commands folder into package_dir | UDICatNCHU_KEM | train | py |
7a5636d152313cd635bde53d1e70be9a502848bf | diff --git a/lxd/operations/response.go b/lxd/operations/response.go
index <HASH>..<HASH> 100644
--- a/lxd/operations/response.go
+++ b/lxd/operations/response.go
@@ -96,9 +96,16 @@ func (r *forwardedOperationResponse) Render(w http.ResponseWriter) error {
}
w.Header().Set("Location", url)
- w.WriteHeader(202)
- return util.WriteJSON(w, body, debug)
+ code := 202
+ w.WriteHeader(code)
+
+ var debugLogger logger.Logger
+ if debug {
+ debugLogger = logging.AddContext(logger.Log, log.Ctx{"http_code": code})
+ }
+
+ return util.WriteJSON(w, body, debugLogger)
}
func (r *forwardedOperationResponse) String() string { | lxd/operations/response: Adds util.WriteJSON support to forwardedOperationResponse | lxc_lxd | train | go |
9653db780d82b7aaf67798bd09c99ceec6d22c98 | diff --git a/python/bigdl/dllib/nn/layer.py b/python/bigdl/dllib/nn/layer.py
index <HASH>..<HASH> 100644
--- a/python/bigdl/dllib/nn/layer.py
+++ b/python/bigdl/dllib/nn/layer.py
@@ -1648,6 +1648,27 @@ class CosineDistance(Layer):
bigdl_type="float"):
super(CosineDistance, self).__init__(None, bigdl_type)
+class Input(Node):
+
+ '''
+ Input layer do nothing to the input tensors, just passing them through. It is used as input to
+ the Graph container (add a link) when the first layer of the graph container accepts multiple
+ tensors as inputs.
+
+ Each input node of the graph container should accept one tensor as input. If you want a module
+ accepting multiple tensors as input, you should add some Input module before it and connect
+ the outputs of the Input nodes to it.
+
+ Please note that the return is not a layer but a Node containing input layer.
+
+ >>> input = Input()
+ creating: createInput
+ '''
+
+ def __init__(self,
+ bigdl_type="float"):
+ super(Input, self).__init__(None, bigdl_type)
+
class DotProduct(Layer): | Graph doc (#<I>)
* Add Input docs
* fix bugs
* meet code review | intel-analytics_BigDL | train | py |
d90e3e2e3a56ef9fa495187b0c33309a3d6ccf51 | diff --git a/tests/functional-sdk/conftest.py b/tests/functional-sdk/conftest.py
index <HASH>..<HASH> 100644
--- a/tests/functional-sdk/conftest.py
+++ b/tests/functional-sdk/conftest.py
@@ -8,12 +8,12 @@ from lago_fixtures import ( # noqa: F401
_local_config = {
'check_patch': {
- 'images': ['el7.5-base']
+ 'images': ['el7.6-base-2']
},
'check_merged':
{
'images': [
- 'el7.5-base',
+ 'el7.6-base-2',
'el6-base',
'fc28-base',
'fc29-base', | func-tests: Update Centos image to <I> | lago-project_lago | train | py |
fc6c797de4cb82d6df7470a3aa41bb1ca4541d31 | diff --git a/src/sos/step_executor.py b/src/sos/step_executor.py
index <HASH>..<HASH> 100755
--- a/src/sos/step_executor.py
+++ b/src/sos/step_executor.py
@@ -1136,6 +1136,8 @@ class Base_Step_Executor:
self.shared_vars[env.sos_dict['_index']].update(matched["vars"])
# complete case: local skip without task
env.controller_push_socket.send_pyobj(['progress', 'substep_ignored', env.sos_dict['step_id']])
+ # do not execute the rest of the statement
+ break
else:
sig.lock()
try: | Fix execution of statements after successful signature validation in one case. #<I> | vatlab_SoS | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.