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 |
|---|---|---|---|---|---|
5ad14170fbd64cce64886623428a7a1348525763 | diff --git a/va/gsb.go b/va/gsb.go
index <HASH>..<HASH> 100644
--- a/va/gsb.go
+++ b/va/gsb.go
@@ -6,6 +6,7 @@ import (
safebrowsingv4 "github.com/google/safebrowsing"
"golang.org/x/net/context"
+ "github.com/letsencrypt/boulder/canceled"
bgrpc "github.com/letsencrypt/boulder/grpc"
vaPB "github.com/letsencrypt/boulder/va/proto"
)
@@ -48,6 +49,12 @@ func (va *ValidationAuthorityImpl) isSafeDomain(ctx context.Context, domain stri
}
list, err := va.safeBrowsing.IsListed(ctx, domain)
+ if canceled.Is(err) {
+ // Sometimes an IsListed request will be canceled because the main
+ // validation failed, causing the parent context to be canceled.
+ stats.Inc("IsSafeDomain.Canceled", 1)
+ return true
+ }
if err != nil {
stats.Inc("IsSafeDomain.Errors", 1)
// In the event of an error checking the GSB status we allow the domain in | Ignore canceled IsSafeDomain calls. (#<I>)
Fixes #<I>. | letsencrypt_boulder | train | go |
497c953c67c982089e08f289690554d9bb28d600 | diff --git a/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java b/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java
index <HASH>..<HASH> 100644
--- a/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java
+++ b/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java
@@ -185,9 +185,9 @@ public class FileStorage extends Component {
registerAsGenerator();
(new FileOpened(connection, event.getPath(),
event.getOptions())).fire();
- ioChannel.read(buffer.getBacking(), offset, buffer,
- readCompletionHandler);
synchronized (ioChannel) {
+ ioChannel.read(buffer.getBacking(), offset, buffer,
+ readCompletionHandler);
outstandingAsyncs += 1;
}
}
@@ -236,10 +236,9 @@ public class FileStorage extends Component {
try {
ManagedByteBuffer nextBuffer = ioBuffers.acquire();
nextBuffer.clear();
- ioChannel.read(nextBuffer.getBacking(), offset,
- nextBuffer,
- readCompletionHandler);
synchronized (ioChannel) {
+ ioChannel.read(nextBuffer.getBacking(), offset,
+ nextBuffer, readCompletionHandler);
outstandingAsyncs += 1;
}
} catch (InterruptedException e) { | Straighten sync'd blocks. | mnlipp_jgrapes | train | java |
e03894784ac5293199b205aaabd722801e4bc74c | diff --git a/lib/dpl/version.rb b/lib/dpl/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/version.rb
+++ b/lib/dpl/version.rb
@@ -1,3 +1,3 @@
module DPL
- VERSION = '1.8.47'
+ VERSION = '1.9.0'
end | Bump to version <I> (again) | travis-ci_dpl | train | rb |
b3bc4c977ccb5b06fdf41ea2bd415229e95ba525 | diff --git a/examples/testmessagebox.rb b/examples/testmessagebox.rb
index <HASH>..<HASH> 100644
--- a/examples/testmessagebox.rb
+++ b/examples/testmessagebox.rb
@@ -74,7 +74,7 @@ if $0 == __FILE__
$log.debug "XXX: got #{@mb.widget(1).text} "
when 4
mb = MessageBox.new :title => "HTTP Configuration" , :width => 50 do
- add Field.new :label => 'User', :name => "user", :width => 30, :bgcolor => :cyan
+ add LabeledField.new :label => 'User', :name => "user", :width => 30, :bgcolor => :cyan
add CheckBox.new :text => "No &frames", :onvalue => "Selected", :offvalue => "UNselected"
add CheckBox.new :text => "Use &HTTP/1.0", :value => true
add CheckBox.new :text => "Use &passive FTP" | changed Field to LabeledField | mare-imbrium_canis | train | rb |
5001083b93f922b8b6e5e42011a79138617b4c1b | diff --git a/src/Select.js b/src/Select.js
index <HASH>..<HASH> 100644
--- a/src/Select.js
+++ b/src/Select.js
@@ -171,8 +171,6 @@ const Select = React.createClass({
if (this.props.autofocus) {
this.focus();
}
-
- document.addEventListener('touchstart', this.handleTouchOutside);
},
componentWillReceiveProps(nextProps) {
@@ -187,6 +185,7 @@ const Select = React.createClass({
componentWillUpdate (nextProps, nextState) {
if (nextState.isOpen !== this.state.isOpen) {
+ this.toggleTouchOutsideEvent(nextState.isOpen);
const handler = nextState.isOpen ? nextProps.onOpen : nextProps.onClose;
handler && handler();
}
@@ -225,6 +224,18 @@ const Select = React.createClass({
}
},
+ componentWillUnmount() {
+ document.removeEventListener('touchstart', this.handleTouchOutside);
+ },
+
+ toggleTouchOutsideEvent(enabled) {
+ if (enabled) {
+ document.addEventListener('touchstart', this.handleTouchOutside);
+ } else {
+ document.removeEventListener('touchstart', this.handleTouchOutside);
+ }
+ },
+
handleTouchOutside(event) {
// handle touch outside on ios to dismiss menu
if (this.wrapper && !this.wrapper.contains(event.target)) { | Made it only trigger one event for multiple selects on the screen | HubSpot_react-select-plus | train | js |
7942b21def39731496fc503c15a3e344ddec9db3 | diff --git a/src/test/java/com/librato/metrics/SourceInformationTest.java b/src/test/java/com/librato/metrics/SourceInformationTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/librato/metrics/SourceInformationTest.java
+++ b/src/test/java/com/librato/metrics/SourceInformationTest.java
@@ -33,4 +33,11 @@ public class SourceInformationTest extends TestCase {
Assert.assertNull(info.source);
Assert.assertEquals("foo-bar", info.name);
}
+
+ public void testExtractsGroupingInTheMiddleOfAnExpression() throws Exception {
+ Pattern pattern = Pattern.compile("^--(.*?)--");
+ SourceInformation info = SourceInformation.from(pattern, "--foo--bar.baz");
+ Assert.assertEquals("foo", info.source);
+ Assert.assertEquals("bar.baz", info.name);
+ }
} | Test for discarding text before and after the source match | librato_metrics-librato | train | java |
6cf3ba46ba1171bce3c3f7c8eb79861f29cd2cf2 | diff --git a/examples/omega2.py b/examples/omega2.py
index <HASH>..<HASH> 100644
--- a/examples/omega2.py
+++ b/examples/omega2.py
@@ -38,7 +38,7 @@ def RGB_control(led, value):
def RGB_check(led):
- return 'LOW' in subprocess.check_output(["gpioctl", "get", RGB[led]])
+ return 'LOW' in str(subprocess.check_output(["gpioctl", "get", RGB[led]]))
def RED_control(val): | pylint
unsupported-membership-test, emitted when value to the right of the ‘in’ operator doesn’t support membership test protocol (i.e. doesn’t define __contains__/__iter__/__getitem__) | cloud4rpi_cloud4rpi | train | py |
0f79efb0c2b7017059487c3b354cda18f115e226 | diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/indirector/facts/facter.rb
+++ b/lib/puppet/indirector/facts/facter.rb
@@ -28,7 +28,7 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
private
- def self.setup_search_paths(request)
+ def self.setup_search_paths(request)
# Add any per-module fact directories to facter's search path
dirs = request.environment.modulepath.collect do |dir|
['lib', 'plugins'].map do |subdirectory|
@@ -38,7 +38,16 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
dirs = dirs.select do |dir|
next false unless FileTest.directory?(dir)
- Puppet.info "Loading facts from #{dir}"
+
+ # Even through we no longer directly load facts in the terminus,
+ # print out each .rb in the facts directory as module
+ # developers may find that information useful for debugging purposes
+ if Puppet::Util::Log.sendlevel?(:info)
+ Dir.glob("#{dir}/*.rb").each do |file|
+ Puppet.info "Loading facts from #{file}"
+ end
+ end
+
true
end | (PUP-<I>) Fix facter terminus to print out fact files.
Prior to the refactoring of the facter terminus, the terminus loaded
module facts directly. This is no longer the case and instead facter
always loads the facts itself.
The previous implementation logged an informational message displaying
the path to each fact script it found. The new behavior only printed
the directory that would be searched for facts.
Given that this information may be useful to module developers and to
maintain existing output behavior, this change restores the previous
output behavior but still relies on facter to load the facts. | puppetlabs_puppet | train | rb |
2141c36dce7ede04c0e181249d518ca57ed9b817 | diff --git a/hrepr/textgen.py b/hrepr/textgen.py
index <HASH>..<HASH> 100644
--- a/hrepr/textgen.py
+++ b/hrepr/textgen.py
@@ -66,7 +66,11 @@ class TextFormatter:
def to_string(self, **config):
value, offset = self.format(
Context(
- tabsize=4, max_col=80, offset=0, line_offset=0, max_indent=None
+ tabsize=4,
+ max_col=None,
+ offset=0,
+ line_offset=0,
+ max_indent=None,
).replace(**config),
)
return value | Set max_col=None by default in textgen | breuleux_hrepr | train | py |
b38de3667eef4ba61fa38922f28d137f438a1dc7 | diff --git a/lib/smart_proxy_dynflow_core/api.rb b/lib/smart_proxy_dynflow_core/api.rb
index <HASH>..<HASH> 100644
--- a/lib/smart_proxy_dynflow_core/api.rb
+++ b/lib/smart_proxy_dynflow_core/api.rb
@@ -11,6 +11,16 @@ module SmartProxyDynflowCore
content_type :json
end
+ post "/tasks/status" do
+ params = MultiJson.load(request.body.read)
+ ids = params.fetch('task_ids', [])
+ result = world.persistence
+ .find_execution_plans(:filters => { :uuid => ids }).reduce({}) do |acc, plan|
+ acc.update(plan.id => { 'state' => plan.state, 'result' => plan.result })
+ end
+ MultiJson.dump(result)
+ end
+
post "/tasks/?" do
params = MultiJson.load(request.body.read)
trigger_task(::Dynflow::Utils.constantize(params['action_name']), | * Refs #<I> - Add API for bulk querying task states | theforeman_smart_proxy_dynflow | train | rb |
c43e53ab886e538b3caa3dd81722f29960c2567d | diff --git a/src/main/java/org/web3j/quorum/tx/ClientTransactionManager.java b/src/main/java/org/web3j/quorum/tx/ClientTransactionManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/web3j/quorum/tx/ClientTransactionManager.java
+++ b/src/main/java/org/web3j/quorum/tx/ClientTransactionManager.java
@@ -25,7 +25,7 @@ public class ClientTransactionManager extends TransactionManager {
public ClientTransactionManager(
Web3j web3j, String fromAddress, List<String> privateFor,
int attempts, int sleepDuration) {
- super(web3j, attempts, sleepDuration);
+ super(web3j, attempts, sleepDuration, fromAddress);
if (!(web3j instanceof Quorum)) {
throw new UnsupportedOperationException("Quorum quorum instance must be used");
}
@@ -48,11 +48,6 @@ public class ClientTransactionManager extends TransactionManager {
}
@Override
- public String getFromAddress() {
- return fromAddress;
- }
-
- @Override
public EthSendTransaction sendTransaction(
BigInteger gasPrice, BigInteger gasLimit, String to,
String data, BigInteger value) | Removed getFromAddress from ClientTransactionManager. | web3j_quorum | train | java |
bb96620e842ab301c736b85d34d33d17be926e82 | diff --git a/router.go b/router.go
index <HASH>..<HASH> 100644
--- a/router.go
+++ b/router.go
@@ -114,7 +114,7 @@ func (r *router) deleteRoute(topic string) {
r.Lock()
defer r.Unlock()
for e := r.routes.Front(); e != nil; e = e.Next() {
- if e.Value.(*route).match(topic) {
+ if e.Value.(*route).topic == topic {
r.routes.Remove(e)
return
} | Change match in deleteRoute to match addRoute | eclipse_paho.mqtt.golang | train | go |
616b46a24590362b943a40b2fc721ecaf2d394fe | diff --git a/modin/data_management/query_compiler/pandas_query_compiler.py b/modin/data_management/query_compiler/pandas_query_compiler.py
index <HASH>..<HASH> 100644
--- a/modin/data_management/query_compiler/pandas_query_compiler.py
+++ b/modin/data_management/query_compiler/pandas_query_compiler.py
@@ -1593,7 +1593,10 @@ class PandasQueryCompiler(object):
new_columns = self.columns
def describe_builder(df, **kwargs):
- return pandas.DataFrame.describe(df, **kwargs)
+ try:
+ return pandas.DataFrame.describe(df, **kwargs)
+ except ValueError:
+ return pandas.DataFrame(index=df.index)
# Apply describe and update indices, columns, and dtypes
func = self._prepare_method(describe_builder, **kwargs) | Adding try-except block to internal partition computation for describe (#<I>)
* This allows the partition to return a valid DataFrame and not an
Exception
* In the future, additional post-processing may be needed to throw the
pandas error that gets thrown if no data of that type exists. | modin-project_modin | train | py |
0260b4f72a1b652180387e1a44d4dd9c161d9c42 | diff --git a/tests/test_main.py b/tests/test_main.py
index <HASH>..<HASH> 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -41,6 +41,8 @@ def test_qt_api():
elif QT_API == 'pyqt5':
assert_pyqt5()
else:
+ # If the tests are run locally, USE_QT_API and QT_API may not be
+ # defined, but we still want to make sure qtpy is behaving sensibly.
# We should then be loading, in order of decreasing preference, PyQt5,
# PyQt4, and PySide.
try: | Added comment to explain why we consider the case where USE_QT_API and QT_API are not defined. | spyder-ide_qtpy | train | py |
8a60d3c19aefbb99ac6247a6cc698e02528dca0f | diff --git a/modules/backend/behaviors/ImportExportController.php b/modules/backend/behaviors/ImportExportController.php
index <HASH>..<HASH> 100644
--- a/modules/backend/behaviors/ImportExportController.php
+++ b/modules/backend/behaviors/ImportExportController.php
@@ -629,6 +629,11 @@ class ImportExportController extends ControllerBehavior
$query = $widget->prepareQuery();
$results = $query->get();
+
+ if ($event = $widget->fireSystemEvent('backend.list.extendRecords', [&$results])) {
+ $results = $event;
+ }
+
foreach ($results as $result) {
$record = [];
foreach ($columns as $column) { | Fire backend.list.extendRecords event during export useList (#<I>)
Provides an opportunity to modify and / or return the $results collection object before the controller exports it. Credit to @fansaien | octobercms_october | train | php |
0aaca38359d25b6bfb982d7a3d610a1ec1bdee7a | diff --git a/lib/sodium/secret_buffer.rb b/lib/sodium/secret_buffer.rb
index <HASH>..<HASH> 100644
--- a/lib/sodium/secret_buffer.rb
+++ b/lib/sodium/secret_buffer.rb
@@ -14,7 +14,7 @@ module Sodium
def initialize(size, primitive = nil)
@size = Utils.get_int(size)
@primitive = primitive
- @buffer = Sodium.malloc(size)
+ @buffer = Sodium.malloc(self.size)
setup_finalizer
end | Update secret_buffer.rb | Asmod4n_ruby-ffi-libsodium | train | rb |
7742cca322c83056d59bebab79c68bca16e3840e | diff --git a/src/bot.js b/src/bot.js
index <HASH>..<HASH> 100644
--- a/src/bot.js
+++ b/src/bot.js
@@ -94,8 +94,9 @@ class Bot {
case 'test':
return new TestAdapter(this);
case 'shell':
- default:
return new ShellAdapter(this);
+ default:
+ throw new AdapterError({ message: `'${adapter}' not found!` });
}
} | Throw AdapterError when adapter is unknown instead of using shell | Botfuel_botfuel-dialog | train | js |
1436c5188d267ad9c7988ecf62152d48791c2724 | diff --git a/js/bleutrade.js b/js/bleutrade.js
index <HASH>..<HASH> 100644
--- a/js/bleutrade.js
+++ b/js/bleutrade.js
@@ -33,7 +33,7 @@ module.exports = class bleutrade extends bittrex {
'CORS': true,
'fetchTickers': true,
'fetchOrders': false,
- 'fetchOrders': false,
+ 'fetchWithdrawals': true,
'fetchClosedOrders': false,
'fetchOrderTrades': false,
'fetchLedger': true, | [bluetrade] fix fetchWithdrawals | ccxt_ccxt | train | js |
c653d90ad45c14987daa1db66327b8ddcd6497e7 | diff --git a/salt/states/mount.py b/salt/states/mount.py
index <HASH>..<HASH> 100644
--- a/salt/states/mount.py
+++ b/salt/states/mount.py
@@ -168,16 +168,19 @@ def mounted(name,
'comment',
'defaults',
'delay_connect',
+ 'intr',
'nobootwait',
'nofail',
'password',
'reconnect',
- 'soft'
+ 'retry',
+ 'soft',
]
# options which are provided as key=value (e.g. password=Zohp5ohb)
mount_invisible_keys = [
'comment',
- 'password'
+ 'password',
+ 'retry',
]
for opt in opts:
keyval_option = opt.split('=')[0] | Add 'intr' and 'retry' to the invisible mount options | saltstack_salt | train | py |
3d86ebc60d122c46f47429c29047b38cf8b84c32 | diff --git a/lib/heroku/command/ssl.rb b/lib/heroku/command/ssl.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/command/ssl.rb
+++ b/lib/heroku/command/ssl.rb
@@ -22,11 +22,11 @@ module Heroku::Command
# ssl:add PEM KEY
#
- # deprecated, see `heroku certs:add` instead
+ # DEPRECATED: see `heroku certs:add` instead
#
def add
- display "`heroku ssl:add` has been deprecated. Please use the SSL Endpoint add-on and the `heroku certs` commands instead."
- display "SSL Endpoint documentation is available at: https://devcenter.heroku.com/articles/ssl-endpoint"
+ $stderr.puts " ! `heroku ssl:add` has been deprecated. Please use the SSL Endpoint add-on and the `heroku certs` commands instead."
+ $stderr.puts " ! SSL Endpoint documentation is available at: https://devcenter.heroku.com/articles/ssl-endpoint"
end
# ssl:clear | ssl:add deprecation: update formatting to be more in line with pre-existing stuff | heroku_legacy-cli | train | rb |
26004138980f660a3238e40e3cbffa1cee1f0566 | diff --git a/lib/json_api_resource/resource.rb b/lib/json_api_resource/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/json_api_resource/resource.rb
+++ b/lib/json_api_resource/resource.rb
@@ -81,11 +81,22 @@ module JsonApiResource
def self.method_missing(method, *args, &block)
if match = method.to_s.match(/^(.*)=$/)
self.client_klass.send(match[1], args.first)
+
elsif self.client_klass.respond_to?(method.to_sym)
- self.client_klass.send(method, *args)
+ results = self.client_klass.send(method, *args)
+
+ if results.is_a? JsonApiClient::ResultSet
+ results.map! do |result|
+ self.new(:client => result)
+ end
+ end
+ results
else
super
end
+
+ rescue JsonApiClient::Errors::ServerError => e
+ pretty_error e
end
end
end
\ No newline at end of file | adding result parsing and Resourcifying to method_missing calls | avvo_json_api_resource | train | rb |
d16c10e4e976d2d5b9a8dcb9c2642f90ea088d6c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -5,11 +5,10 @@ var superagent = require('superagent');
module.exports = function (remoteUrl, callback) {
superagent.get(remoteUrl).buffer().end(function (err, resp) {
if (err) {
- callback(err);
+ return callback(err);
} else if (resp.ok) {
- callback(null, resp.text);
- } else {
- callback(new Error('GET ' + remoteUrl + ' ' + resp.status));
+ return callback(null, resp.text);
}
+ callback(new Error('GET ' + remoteUrl + ' ' + resp.status));
});
}; | Fix eslint issues. | jonkemp_remote-content | train | js |
fb1335c64def9035cc33139973b4ee3f91c62e6e | diff --git a/example.py b/example.py
index <HASH>..<HASH> 100644
--- a/example.py
+++ b/example.py
@@ -1,3 +1,6 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
# Copyright (c) 2010, SoftLayer Technologies, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without | Added interpreter and encoding lines to the example script. (Thanks, mahmoudimus!) | softlayer_softlayer-python | train | py |
be3dae0c971ab536d5902d0a78318ac5f07069fb | diff --git a/knights/loader.py b/knights/loader.py
index <HASH>..<HASH> 100644
--- a/knights/loader.py
+++ b/knights/loader.py
@@ -20,6 +20,8 @@ def add_path(path):
def load_template(name, paths=None, raw=False):
if paths is None:
paths = PATHS[:]
+ else:
+ paths = [os.path.abspath(path) for path in paths]
for path in paths:
full_name = os.path.abspath(os.path.join(path, name)) | abspath paths passed to load_template | funkybob_knights-templater | train | py |
d6ee225f8171c5772c07347bede67e31c2b1d517 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,8 @@ setup(name='DPark',
install_requires=[
'setuptools',
'pyzmq',
+ 'msgpack-python',
+ 'protobuf',
],
tests_require=[
'nose', | add dependence of msgpack-python and protobuf | douban_dpark | train | py |
5f16ec56ae23894c0cb7b0f5888f63af540653ba | diff --git a/src/test/java/org/fuin/objects4j/vo/LocaleStrValidatorTest.java b/src/test/java/org/fuin/objects4j/vo/LocaleStrValidatorTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/fuin/objects4j/vo/LocaleStrValidatorTest.java
+++ b/src/test/java/org/fuin/objects4j/vo/LocaleStrValidatorTest.java
@@ -52,8 +52,11 @@ public final class LocaleStrValidatorTest {
final Locale[] locales = Locale.getAvailableLocales();
for (final Locale locale : locales) {
final String value = locale.toString();
- assertThat(testee.isValid(value, CONTEXT)).isTrue();
- assertThat(LocaleStrValidator.parseArg("a", value)).isEqualTo(locale);
+ // Skip locales like ja_JP_JP_#u-ca-japanese as we cannot handle it
+ if (!value.contains("#")) {
+ assertThat(testee.isValid(value, CONTEXT)).describedAs(value).isTrue();
+ assertThat(LocaleStrValidator.parseArg("a", value)).describedAs(value).isEqualTo(locale);
+ }
}
} | Fixed problem with locales that do not fit the Locale constructor | fuinorg_objects4j | train | java |
e2c7cda4ba29fdf77b885bb497e249e93f9e59ce | diff --git a/phil/_version.py b/phil/_version.py
index <HASH>..<HASH> 100644
--- a/phil/_version.py
+++ b/phil/_version.py
@@ -17,5 +17,5 @@
# along with phil. If not, see <http://www.gnu.org/licenses/>.
#######################################################################
-__version__ = '1.0.1'
-__releasedate__ = '2011-12-12'
+__version__ = '1.1'
+__releasedate__ = '2011-12-30' | Update version for <I> release | willkg_phil | train | py |
0dd377388350328574563fba7a7db4d4bae18f42 | diff --git a/handkerchief.py b/handkerchief.py
index <HASH>..<HASH> 100755
--- a/handkerchief.py
+++ b/handkerchief.py
@@ -131,6 +131,8 @@ parser.add_argument("-o",dest="outname",default=None,
help="filename of output HTML file")
parser.add_argument("-l",dest="layout",default="default",
help="name of a layout to use")
+parser.add_argument("-q",dest="verbose",default="store_false",
+ help="suppress output to stdout")
parser.add_argument("--local",dest="local",action="store_true",
help="use local layouts instead, useful during development")
parser.add_argument("-a",dest="auth",action="store_true",
@@ -150,6 +152,8 @@ else:
auth = None
#request data from api
+if args.verbose:
+ print "Fetching data from GitHub ..."
data = {}
try:
data['issues']= [] | print status to stdout while fetching data | jreinhardt_handkerchief | train | py |
860398fdcc6a99ef7dc320e69fb961eeae08d4fa | diff --git a/parse.go b/parse.go
index <HASH>..<HASH> 100644
--- a/parse.go
+++ b/parse.go
@@ -203,12 +203,11 @@ func (p *parser) next() {
if p.tok == EOF {
return
}
- p.lpos, p.pos = p.pos, p.npos
+ p.lpos = p.pos
p.spaced, p.newLine = false, false
var b byte
for {
if !p.quoted(DQUOTE) && p.readOnly("\\\n") {
- p.pos = p.npos
continue
}
var err error
@@ -224,7 +223,6 @@ func (p *parser) next() {
break
}
p.consumeByte()
- p.pos = p.npos
p.spaced = true
if b == '\n' {
p.newLine = true
@@ -234,6 +232,7 @@ func (p *parser) next() {
}
}
}
+ p.pos = p.npos
switch {
case p.quotedAny(RBRACE, LBRACE, QUO) && p.readOnlyTok(RBRACE):
p.advanceTok(RBRACE) | parse: only need to set p.pos once
Setting it multiple times inside the loop is unnecessary. | mvdan_sh | train | go |
35c8fd373965ab1b06d63e5c3bbc5d9f2c356ec4 | diff --git a/src/main/java/org/junit/runners/model/MultipleFailureException.java b/src/main/java/org/junit/runners/model/MultipleFailureException.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/junit/runners/model/MultipleFailureException.java
+++ b/src/main/java/org/junit/runners/model/MultipleFailureException.java
@@ -1,5 +1,7 @@
package org.junit.runners.model;
+import java.io.PrintStream;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -39,6 +41,27 @@ public class MultipleFailureException extends Exception {
return sb.toString();
}
+ @Override
+ public void printStackTrace() {
+ for (Throwable e: fErrors) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void printStackTrace(PrintStream s) {
+ for (Throwable e: fErrors) {
+ e.printStackTrace(s);
+ }
+ }
+
+ @Override
+ public void printStackTrace(PrintWriter s) {
+ for (Throwable e: fErrors) {
+ e.printStackTrace(s);
+ }
+ }
+
/**
* Asserts that a list of throwables is empty. If it isn't empty,
* will throw {@link MultipleFailureException} (if there are | Fix StackTrace printing when multiple exceptions occur (#<I>) (#<I>) | junit-team_junit4 | train | java |
b1a15310d77260c4377b368647a8d704351b9f5e | diff --git a/AdvancedHTTPServer.py b/AdvancedHTTPServer.py
index <HASH>..<HASH> 100755
--- a/AdvancedHTTPServer.py
+++ b/AdvancedHTTPServer.py
@@ -67,7 +67,7 @@ ExecStop=/bin/kill -INT $MAINPID
WantedBy=multi-user.target
"""
-__version__ = '1.2.0'
+__version__ = '1.2.1'
__all__ = [
'AdvancedHTTPServer',
'AdvancedHTTPServerRegisterPath',
@@ -935,8 +935,11 @@ class AdvancedHTTPServerRequestHandler(http.server.BaseHTTPRequestHandler, objec
self.cookies = http.cookies.SimpleCookie(self.headers.get('cookie', ''))
for (path_regex, handler) in self.handler_map.items():
if re.match(path_regex, self.path):
+ self_handler = None
+ if hasattr(handler, '__name__'):
+ self_handler = getattr(self, handler.__name__, None)
try:
- if hasattr(self, handler.__name__) and (handler == getattr(self, handler.__name__).__func__ or handler == getattr(self, handler.__name__)):
+ if self_handler is not None and (handler == self_handler.__func__ or handler == self_handler):
getattr(self, handler.__name__)(query)
else:
handler(self, query) | Update the way that handler methonds are identified | zeroSteiner_AdvancedHTTPServer | train | py |
4eb298af6131c6747c8053b3ed7ddf9058fc23a6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,14 @@
from setuptools import setup, find_packages
-from Cython.Build import cythonize
+try:
+ from Cython.Build import cythonize
+ ext_modules = cythonize("wallpaper/*.pyx")
+except ImportError:
+ ext_modules = []
+
setup(
name='python-wallpaper',
- version='0.2.2',
+ version='0.2.3',
url='https://github.com/ondergetekende/python-wallpaper',
description=(
'python-wallpaper generates pseudorandom abstract wallpapers'
@@ -11,7 +16,7 @@ setup(
author='Koert van der Veer',
author_email='koert@ondergetekende.nl',
packages=find_packages(),
- ext_modules=cythonize("wallpaper/*.pyx"),
+ ext_modules=ext_modules,
install_requires=["cython"],
classifiers=[
'Intended Audience :: Developers', | Allow setup.py to work when cython is not available | ondergetekende_python-panavatar | train | py |
3fb3c13275fa7139170b4f1da9848ea447fb81f7 | diff --git a/lib/nrser/types/is.rb b/lib/nrser/types/is.rb
index <HASH>..<HASH> 100644
--- a/lib/nrser/types/is.rb
+++ b/lib/nrser/types/is.rb
@@ -21,7 +21,9 @@ module NRSER::Types
end
def == other
- equal?(other) || @value === other.value
+ equal?(other) ||
+ ( self.class == other.class &&
+ @value == other.value )
end
# @return [String] | Fix a bug in NRSER::Types::Is#== | nrser_nrser.rb | train | rb |
2529baa064fa562ad5651b64b1ec30b5f2869382 | diff --git a/src/lib/CollectStore.js b/src/lib/CollectStore.js
index <HASH>..<HASH> 100644
--- a/src/lib/CollectStore.js
+++ b/src/lib/CollectStore.js
@@ -3,6 +3,8 @@ import * as accounts from './accounts'
import * as konnectors from './konnectors'
import * as jobs from './jobs'
+import { createConnection } from '../ducks/connections'
+
const AUTHORIZED_CATEGORIES = require('config/categories')
const isValidCategory = (cat) => AUTHORIZED_CATEGORIES.includes(cat)
@@ -318,6 +320,7 @@ export default class CollectStore {
})
// 4. Add account to konnector
.then(installedkonnector => {
+ this.dispatch(createConnection(installedkonnector, connection.account, connection.folderId))
return konnectors.addAccount(cozy.client, installedkonnector, connection.account)
})
// 5. Add permissions to folder for konnector if folder created | feat: dispatch createConnection action from CollectStore :pencil: | cozy_cozy-home | train | js |
0dd3e124873cc63f9e888a14a25f2875b0adc9b3 | diff --git a/core/kernel/persistence/hardsql/class.Resource.php b/core/kernel/persistence/hardsql/class.Resource.php
index <HASH>..<HASH> 100644
--- a/core/kernel/persistence/hardsql/class.Resource.php
+++ b/core/kernel/persistence/hardsql/class.Resource.php
@@ -464,7 +464,8 @@ class core_kernel_persistence_hardsql_Resource
// Get the table name
$tableName = core_kernel_persistence_hardapi_ResourceReferencer::singleton()->resourceLocation ($resource);
- if ($property->isMultiple() || $property->isLgDependent()){
+ if ($property->isMultiple() || $property->isLgDependent()
+ || !core_kernel_persistence_hardapi_ResourceReferencer::singleton()->isPropertyReferenced($property)){
$query = "DELETE `{$tableName}Props`.* FROM `{$tableName}`, `{$tableName}Props`
WHERE `{$tableName}`.uri = '{$resource->uriResource}' | * Remove properties that are not referenced in the Hard Api into the Props table
git-svn-id: <URL> | oat-sa_generis | train | php |
2ec5a83b712a4f96c7177e34f2f9dcd39b23945e | diff --git a/molgenis-dataexplorer/src/main/resources/js/dataexplorer.js b/molgenis-dataexplorer/src/main/resources/js/dataexplorer.js
index <HASH>..<HASH> 100644
--- a/molgenis-dataexplorer/src/main/resources/js/dataexplorer.js
+++ b/molgenis-dataexplorer/src/main/resources/js/dataexplorer.js
@@ -429,7 +429,9 @@ function($, molgenis, settingsXhr) {
attributeFilters = {};
selectedAttributes = [];
searchQuery = null;
- React.unmountComponentAtNode($('#data-table-container')[0]); // must occur before mod-data is loaded
+ if($('#data-table-container').length > 0) {
+ React.unmountComponentAtNode($('#data-table-container')[0]); // must occur before mod-data is loaded
+ }
$('#feature-filters p').remove();
$("#observationset-search").val("");
$('#data-table-pager').empty(); | Fix #<I> React error changing data set after selecting invalid data set | molgenis_molgenis | train | js |
103d2500e5602d4331a94fc42c3c9366828267f2 | diff --git a/src/frontend/org/voltdb/dtxn/TransactionState.java b/src/frontend/org/voltdb/dtxn/TransactionState.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/dtxn/TransactionState.java
+++ b/src/frontend/org/voltdb/dtxn/TransactionState.java
@@ -69,6 +69,11 @@ public abstract class TransactionState extends OrderableTransaction {
m_beginUndoToken = ExecutionSite.kInvalidUndoToken;
}
+ // Assume that done-ness is a latch.
+ public void setDone() {
+ m_done = true;
+ }
+
final public boolean isDone() {
return m_done;
}
@@ -119,6 +124,12 @@ public abstract class TransactionState extends OrderableTransaction {
return m_beginUndoToken;
}
+ // Assume that rollback-ness is a latch.
+ public void setNeedsRollback()
+ {
+ m_needsRollback = true;
+ }
+
public boolean needsRollback()
{
return m_needsRollback; | Add two setters for TransactionState state for IV2 | VoltDB_voltdb | train | java |
4bda77f8c2d62d11a918d4c4fdd6d9923cc03a8d | diff --git a/src/python/setup.py b/src/python/setup.py
index <HASH>..<HASH> 100755
--- a/src/python/setup.py
+++ b/src/python/setup.py
@@ -86,7 +86,7 @@ setup(
description='DNAnexus Platform API bindings for Python',
long_description=readme_content,
long_description_content_type="text/markdown",
- author='Aleksandra Zalcman, Andrey Kislyuk, Anurag Biyani, Geet Duggal, Katherine Lai, Kurt Jensen, Ohad Rodeh, Phil Sung',
+ author='Aleksandra Zalcman, Andrey Kislyuk, Anurag Biyani, Geet Duggal, Katherine Lai, Kurt Jensen, Marek Hrvol, Ohad Rodeh, Phil Sung',
author_email='support@dnanexus.com',
url='https://github.com/dnanexus/dx-toolkit',
zip_safe=False, | Update setup.py to include a developer (#<I>) | dnanexus_dx-toolkit | train | py |
529209534e73383462d6e4ea07823007d09a54df | diff --git a/functional/platform/nspawn.go b/functional/platform/nspawn.go
index <HASH>..<HASH> 100644
--- a/functional/platform/nspawn.go
+++ b/functional/platform/nspawn.go
@@ -16,7 +16,6 @@ package platform
import (
"bytes"
- "errors"
"fmt"
"io"
"io/ioutil"
@@ -472,7 +471,7 @@ func (nc *nspawnCluster) ReplaceMember(m Member) (Member, error) {
// the nspawn container, so we must use systemctl
cmd := fmt.Sprintf("systemctl -M %s poweroff", label)
if _, stderr, _ := run(cmd); !strings.Contains(stderr, "Success") {
- return nil, errors.New("poweroff failed")
+ return nil, fmt.Errorf("poweroff failed: %s", stderr)
}
var nm nspawnMember | nspawn: report error message from poweroff
Intermittently systemctl is reporting the following error during
poweroff:
Warning! D-Bus connection terminated.
Failed to wait for response: Connection reset by peer
This seems harmless but don't have a solution yet. For now at least
report the error to make the issue more obvious. | coreos_fleet | train | go |
47258efb4efa4460f33b44c39bd34ceee6e81fa6 | diff --git a/addons/depgraph/common/src/main/java/org/commonjava/aprox/depgraph/rest/RenderingController.java b/addons/depgraph/common/src/main/java/org/commonjava/aprox/depgraph/rest/RenderingController.java
index <HASH>..<HASH> 100644
--- a/addons/depgraph/common/src/main/java/org/commonjava/aprox/depgraph/rest/RenderingController.java
+++ b/addons/depgraph/common/src/main/java/org/commonjava/aprox/depgraph/rest/RenderingController.java
@@ -109,7 +109,7 @@ public class RenderingController
FileWriter w = null;
try
{
- w = new FileWriter( dtoJson );
+ w = new FileWriter( out );
ops.depTree( comp, false, new PrintWriter( w ) );
}
catch ( final CartoDataException e ) | fixing filename problem...stupid coding error | Commonjava_indy | train | java |
bf6f59ecfb693f92e8af8708746b86fe718db857 | diff --git a/lib/classy_enum/active_record.rb b/lib/classy_enum/active_record.rb
index <HASH>..<HASH> 100644
--- a/lib/classy_enum/active_record.rb
+++ b/lib/classy_enum/active_record.rb
@@ -53,7 +53,7 @@ module ClassyEnum
# # Specifying a default enum value
# classy_enum_attr :priority, :default => 'low'
def classy_enum_attr(attribute, options={})
- enum = (options[:enum] || attribute).to_s.camelize.constantize
+ enum = (options[:enum] || options[:class_name] || attribute).to_s.camelize.constantize
allow_blank = options[:allow_blank] || false
allow_nil = options[:allow_nil] || false
serialize_as_json = options[:serialize_as_json] || false
diff --git a/spec/classy_enum/active_record_spec.rb b/spec/classy_enum/active_record_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/classy_enum/active_record_spec.rb
+++ b/spec/classy_enum/active_record_spec.rb
@@ -53,7 +53,7 @@ class AllowNilBreedDog < Dog
end
class OtherDog < Dog
- classy_enum_attr :other_breed, :enum => 'Breed'
+ classy_enum_attr :other_breed, :class_name => 'Breed'
end
describe DefaultDog do | Add class_name as an option to #classy_enum_attr | beerlington_classy_enum | train | rb,rb |
3ed1538c740f9134f72610efd1cc07e1f1c8e726 | diff --git a/pages/linker.js b/pages/linker.js
index <HASH>..<HASH> 100644
--- a/pages/linker.js
+++ b/pages/linker.js
@@ -91,7 +91,7 @@ export default class Page extends React.Component {
this.setState({
error: `There was a problem getting scene data.\nTry to re-initialize the project with dcl init.`
})
- closeServer(false, 'scene metadata error')
+ closeServer(false, 'There was a problem getting scene data.\nTry to re-initialize the project with dcl init.')
return
}
@@ -103,7 +103,7 @@ export default class Page extends React.Component {
this.setState({
error: `There was a problem getting IPNS hash of your scene.\nTry to re-upload with dcl upload.`
})
- closeServer(false, 'ipns error')
+ closeServer(false, 'There was a problem getting IPNS hash of your scene.\nTry to re-upload with dcl upload.')
return
}
@@ -147,7 +147,7 @@ export default class Page extends React.Component {
this.setState({ tx, transactionLoading: true })
} catch (err) {
this.setState({ loading: false, error: 'Transaction Rejected' })
- closeServer(false, 'transaction rejected')
+ closeServer(false, 'Transaction rejected')
}
} catch (err) {
this.setState({ loading: false, error: err.message }) | chore: manually merged <I>cc8a<I>d3bc6d<I>f6c<I>a<I>bce | decentraland_cli | train | js |
1c2785a86ae12c1b41c92cc27f73799ba4eb82b5 | diff --git a/app/sqlite.py b/app/sqlite.py
index <HASH>..<HASH> 100644
--- a/app/sqlite.py
+++ b/app/sqlite.py
@@ -264,6 +264,7 @@ class ProteinGroupDB(DatabaseConnection):
sql = ('INSERT INTO protein_coverage(protein_acc, coverage) '
'VALUES(?, ?)')
cursor.executemany(sql, coverage)
+ self.conn.commit()
def store_protein_group_content(self, protein_groups):
cursor = self.get_cursor() | Always commit to DB after storing. Idiot | glormph_msstitch | train | py |
9795e12ef2eae822733e5add1300bdd37caf5d7c | diff --git a/rpc/lib/server/http_server.go b/rpc/lib/server/http_server.go
index <HASH>..<HASH> 100644
--- a/rpc/lib/server/http_server.go
+++ b/rpc/lib/server/http_server.go
@@ -173,8 +173,7 @@ func RecoverAndLogHandler(handler http.Handler, logger log.Logger) http.Handler
"Panic in RPC HTTP handler", "err", e, "stack",
string(debug.Stack()),
)
- rww.WriteHeader(http.StatusInternalServerError)
- WriteRPCResponseHTTP(rww, types.RPCInternalError("", e.(error)))
+ WriteRPCResponseHTTPError(rww, http.StatusInternalServerError, types.RPCInternalError("", e.(error)))
}
} | fix `RecoverAndLogHandler` not to call multiple writeheader (#<I>) | tendermint_tendermint | train | go |
49e1159b54b1fdbcf20e616e40cfc8cdac5c4301 | diff --git a/structr-ui/src/main/resources/structr/js/schema.js b/structr-ui/src/main/resources/structr/js/schema.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/schema.js
+++ b/structr-ui/src/main/resources/structr/js/schema.js
@@ -296,8 +296,11 @@ var _Schema = {
}
});
instance.bind('connectionDetached', function(info) {
- _Schema.askDeleteRelationship(info.connection.scope);
- _Schema.reload();
+
+ if (info.sourceId.indexOf('id_') === 0 && info.targetId.indexOf('id_') === 0) {
+ _Schema.askDeleteRelationship(info.connection.scope);
+ _Schema.reload();
+ }
});
reload = false; | Bugfix: Only ask if relationship should be deleted if it actually exists | structr_structr | train | js |
a0e5d04a53ea2e0d59069a945957e4cbf07a8ace | diff --git a/src/HipChat/HipChat.php b/src/HipChat/HipChat.php
index <HASH>..<HASH> 100755
--- a/src/HipChat/HipChat.php
+++ b/src/HipChat/HipChat.php
@@ -51,6 +51,7 @@ class HipChat {
private $auth_token;
private $verify_ssl = true;
private $proxy;
+ private $request_timeout = 15;
/**
* Creates a new API interaction object.
@@ -364,7 +365,7 @@ class HipChat {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 15);
+ curl_setopt($ch, CURLOPT_TIMEOUT, $this->request_timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl);
if (isset($this->proxy)) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
@@ -477,6 +478,18 @@ class HipChat {
$this->proxy = $proxy;
}
+ /**
+ * Change CURL request timeout.
+ * You can change this value if you want to change request timeout toleration.
+ *
+ * @param int $timeout
+ *
+ * @return int
+ */
+ public function set_request_timeout($timeout = 15) {
+ $this->request_timeout = (int)$timeout;
+ return $this->request_timeout;
+ }
} | Add the possibility to change the request timeout via an option | hipchat_hipchat-php | train | php |
5bcfee4f869a7baa4916fa53f39f49490f69524b | diff --git a/docs/assets/js/main.js b/docs/assets/js/main.js
index <HASH>..<HASH> 100644
--- a/docs/assets/js/main.js
+++ b/docs/assets/js/main.js
@@ -43,10 +43,10 @@ var browser=function(){"use strict";var e={name:null,version:null,os:null,osVers
});
$('.glider-next,.glider-prev').on('click',function(){
- ga && ga('send','event','Arrow Click', $(this).parents('.glider-contain').data('name'), $(this).hasClass('glider-prev') ? 'Previous' : 'Next')
+ typeof ga !== 'undefined' && ga('send','event','Arrow Click', $(this).parents('.glider-contain').data('name'), $(this).hasClass('glider-prev') ? 'Previous' : 'Next')
});
$('.glider-dot').on('click',function(){
- ga && ga('send','event','Dot Click', $(this).parents('.glider-contain').data('name'), $(this).data('index'))
+ typeof ga !== 'undefined' && ga('send','event','Dot Click', $(this).parents('.glider-contain').data('name'), $(this).data('index'))
});
})($); | Add explicit undefined check to GA
#Please enter the commit message for your changes. Lines starting | NickPiscitelli_Glider.js | train | js |
71e2d6137781db6d047ee43e8f7b699539937a71 | diff --git a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java
+++ b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java
@@ -288,9 +288,11 @@ final class S3ProxyHandler extends AbstractHandler {
}
}
- // anonymous request
- if ((method.equals("GET") || method.equals("HEAD") ||
- method.equals("POST")) &&
+ // when access information is not provided in request header,
+ // treat it as anonymous, return all public accessible information
+ if (!anonymousIdentity &&
+ (method.equals("GET") || method.equals("HEAD") ||
+ method.equals("POST")) &&
request.getHeader(HttpHeaders.AUTHORIZATION) == null &&
request.getParameter("AWSAccessKeyId") == null &&
defaultBlobStore != null) { | Allow anonymous access mode to use private buckets
Fixes #<I>. | gaul_s3proxy | train | java |
d7547abecab3ac9d1b91f5e4c5e15e04883299f1 | diff --git a/scripts/build/generateChangelog.php b/scripts/build/generateChangelog.php
index <HASH>..<HASH> 100644
--- a/scripts/build/generateChangelog.php
+++ b/scripts/build/generateChangelog.php
@@ -8,7 +8,7 @@ $entries = [];
$lines = explode("\n", trim(file_get_contents('php://stdin')));
$types = [
- 'Ignore' => '((?:#ignore|ci skip|: added \w*\s*test|(?:build|release|travis) script))i',
+ 'Ignore' => '((?:#ignore|#tests|ci skip|: added \w*\s*test|(?:build|release|travis) script))i',
'Added' => '(\\bAdded\\b)i',
'Fixed' => '(\\bFixed\\b)i',
'Removed' => '(\\bRemoved\\b)i', | Updated build script [ci skip] | s9e_TextFormatter | train | php |
42093cca5cee80619e8ea31ff7e1a914792c8e93 | diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php
index <HASH>..<HASH> 100644
--- a/admin/settings/appearance.php
+++ b/admin/settings/appearance.php
@@ -34,6 +34,7 @@ $temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnum
'10' => '10 ' . get_string('newsitems'))));
$temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
$temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
+$temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), '20', PARAM_INT));
$ADMIN->add('appearance', $temp);
diff --git a/version.php b/version.php
index <HASH>..<HASH> 100644
--- a/version.php
+++ b/version.php
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2006090300; // YYYYMMDD = date
+ $version = 2006090400; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.7 dev'; // Human-friendly version name | Added coursesperpage so paging can be controlled | moodle_moodle | train | php,php |
b52036a65296d10edc8e524c68fcd4c138c96489 | diff --git a/image_obj_parse.go b/image_obj_parse.go
index <HASH>..<HASH> 100644
--- a/image_obj_parse.go
+++ b/image_obj_parse.go
@@ -384,12 +384,12 @@ func paesePng(f *bytes.Reader, info *imgInfo, imgConfig image.Config) error {
}
func compress(data []byte) ([]byte, error) {
- buff := GetBuffer()
- defer PutBuffer(buff)
+ var results []byte
+ var buff bytes.Buffer
+ zwr, err := zlib.NewWriterLevel(&buff, zlib.BestSpeed)
- zwr, err := zlib.NewWriterLevel(buff, zlib.BestSpeed)
if err != nil {
- return nil, err
+ return results, err
}
_, err = zwr.Write(data)
if err != nil { | Revert use of byte pool for img compression
Returning .Bytes() from pooled buffer causes corruption | signintech_gopdf | train | go |
b06e2b6b4119b3c989d771744245e0ea432cb66c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -135,7 +135,7 @@ function streamCompareInternal(stream1, stream2, options, callback) {
}
// Note: Add event listeners before endListeners so end/error is recorded
- options.events.forEach(function(eventName) {
+ Array.prototype.forEach.call(options.events, function(eventName) {
if (listeners1[eventName]) {
return;
}
@@ -444,8 +444,10 @@ function streamCompare(stream1, stream2, optionsOrCompare, callback) {
if (typeof options.compare !== 'function') {
throw new TypeError('options.compare must be a function');
}
- if (!(options.events instanceof Array)) {
- throw new TypeError('options.events must be an Array');
+ if (!options.events ||
+ typeof options.events !== 'object' ||
+ options.events.length !== options.events.length | 0) {
+ throw new TypeError('options.events must be Array-like');
}
if (options.incremental && typeof options.incremental !== 'function') {
throw new TypeError('options.incremental must be a function'); | Accept an Array-like options.events
The `instanceof Array` check was bugging me. Be a bit more lax about
this. | kevinoid_stream-compare | train | js |
3d276f1d939e3a3b02240e8508cf5c2b3b84993b | diff --git a/src/main/java/org/aerogear/connectivity/rest/MobileApplicationInstanceEndpoint.java b/src/main/java/org/aerogear/connectivity/rest/MobileApplicationInstanceEndpoint.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/aerogear/connectivity/rest/MobileApplicationInstanceEndpoint.java
+++ b/src/main/java/org/aerogear/connectivity/rest/MobileApplicationInstanceEndpoint.java
@@ -82,7 +82,7 @@ public class MobileApplicationInstanceEndpoint
@PUT
- @Path("/registry/device/{token}")
+ @Path("{token}")
@Consumes("application/json")
public MobileApplicationInstance updateInstance(
@HeaderParam("ag-mobile-app") String mobileVariantID,
@@ -109,7 +109,7 @@ public class MobileApplicationInstanceEndpoint
}
@DELETE
- @Path("/registry/device/{token}")
+ @Path("{token}")
@Consumes("application/json")
public void unregisterInstallations(
@HeaderParam("ag-mobile-app") String mobileVariantID, | Fix PUT and DELETE paths | aerogear_aerogear-unifiedpush-server | train | java |
c78e8b6f6fd7b37a26f0dea2bbc09725538a6300 | diff --git a/hsreplay/__init__.py b/hsreplay/__init__.py
index <HASH>..<HASH> 100644
--- a/hsreplay/__init__.py
+++ b/hsreplay/__init__.py
@@ -3,5 +3,5 @@ import pkg_resources
__version__ = pkg_resources.require("hsreplay")[0].version
-DTD_VERSION = "1.4"
+DTD_VERSION = "1.5"
SYSTEM_DTD = "https://hearthsim.info/hsreplay/dtd/hsreplay-%s.dtd" % (DTD_VERSION) | Update DTD version to <I> | HearthSim_python-hsreplay | train | py |
4a00603b5a31ea5edc8b8a980924681cdbce907e | diff --git a/docs/_plugins/highlight_alt.rb b/docs/_plugins/highlight_alt.rb
index <HASH>..<HASH> 100644
--- a/docs/_plugins/highlight_alt.rb
+++ b/docs/_plugins/highlight_alt.rb
@@ -27,7 +27,7 @@ module Jekyll
@options[key.to_sym] = value || true
end
end
- @options[:linenos] = "inline" if @options.key?(:linenos) and @options[:linenos] == true
+ @options[:linenos] = false
else
raise SyntaxError.new <<-eos
Syntax Error in tag 'example' while parsing the following markup: | docs/_plugins/highlight_alt.rb: Ignore linenos option since it's broken
Refs #<I>
[skip sauce] | twbs_bootstrap | train | rb |
824b58a2a7bc0066695c5369b48c9dcdeeb86ffe | diff --git a/src/program/types/TemplateLiteral.js b/src/program/types/TemplateLiteral.js
index <HASH>..<HASH> 100644
--- a/src/program/types/TemplateLiteral.js
+++ b/src/program/types/TemplateLiteral.js
@@ -74,7 +74,7 @@ export default class TemplateLiteral extends Node {
});
if (parenthesise) code.appendLeft(lastIndex, ')');
- code.remove(lastIndex, this.end);
+ code.overwrite(lastIndex, this.end, "", { contentOnly: true } );
}
}
}
diff --git a/test/samples/spread-operator.js b/test/samples/spread-operator.js
index <HASH>..<HASH> 100644
--- a/test/samples/spread-operator.js
+++ b/test/samples/spread-operator.js
@@ -585,5 +585,21 @@ module.exports = [
}; }
}
`
+ },
+
+ {
+ description: 'transpiles spread with template literal afterwards',
+
+ input: `
+ [...f(b), "n"];
+ [...f(b), 'n'];
+ [...f(b), \`n\`];
+ `,
+
+ output: `
+ f(b).concat( ["n"]);
+ f(b).concat( ['n']);
+ f(b).concat( ["n"]);
+ `
}
]; | Correctly transpile array spread followed by template literal
Closes #<I>. | bublejs_buble | train | js,js |
998d21c7ecb523d07cef17e5b466b5755067adea | diff --git a/Load.php b/Load.php
index <HASH>..<HASH> 100644
--- a/Load.php
+++ b/Load.php
@@ -34,7 +34,7 @@ class Load
*
* @var string
*/
- protected $i18n = 'zh-cn';
+ protected $i18n = 'zh-CN';
/**
* 载入路径 | i<I>n extend to register is done | hunzhiwange_framework | train | php |
d282a07deb7c001346722acfe089729b6d784a97 | diff --git a/lib/rnes/ppu.rb b/lib/rnes/ppu.rb
index <HASH>..<HASH> 100644
--- a/lib/rnes/ppu.rb
+++ b/lib/rnes/ppu.rb
@@ -48,6 +48,7 @@ module Rnes
# @return [Array<Rnes::Image>]
attr_reader :image
+ # @note For debug use.
# @return [Rnes::PpuRegisters]
attr_reader :registers | Add comment about debug-use method | r7kamura_rnes | train | rb |
8879458faab9ed1122cc1f00c15680bfd82705dd | diff --git a/api/server/profiler.go b/api/server/profiler.go
index <HASH>..<HASH> 100644
--- a/api/server/profiler.go
+++ b/api/server/profiler.go
@@ -18,6 +18,7 @@ func profilerSetup(mainRouter *mux.Router) {
r.HandleFunc("/pprof/cmdline", pprof.Cmdline)
r.HandleFunc("/pprof/profile", pprof.Profile)
r.HandleFunc("/pprof/symbol", pprof.Symbol)
+ r.HandleFunc("/pprof/trace", pprof.Trace)
r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP)
r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP)
r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP) | add trace in docker engine's pprof to show execution trace in binary form | moby_moby | train | go |
a32410ad517c398aff9b97cc08dfd7a50bfe6b01 | diff --git a/lib/endpoints/class-wp-rest-comments-controller.php b/lib/endpoints/class-wp-rest-comments-controller.php
index <HASH>..<HASH> 100755
--- a/lib/endpoints/class-wp-rest-comments-controller.php
+++ b/lib/endpoints/class-wp-rest-comments-controller.php
@@ -755,7 +755,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
if ( current_user_can( 'unfiltered_html' ) && isset( $prepared_comment['comment_content'] ) ) {
$prepared_comment['comment_content'] = wp_kses_post( $prepared_comment['comment_content'] );
} elseif ( isset( $prepared_comment['comment_content'] ) ) {
- $prepared_comment['comment_content'] = wp_filter_kses( $prepared_comment['comment_content'] );
+ $prepared_comment['comment_content'] = wp_kses( $prepared_comment['comment_content'], 'pre_comment_content' );
}
if ( isset( $request['post'] ) ) { | Pass current filter into wp_kses | WP-API_WP-API | train | php |
a969e2d7cad37684f655d0da86683be142e4b41e | diff --git a/js/coinmarketcap.js b/js/coinmarketcap.js
index <HASH>..<HASH> 100644
--- a/js/coinmarketcap.js
+++ b/js/coinmarketcap.js
@@ -105,7 +105,7 @@ module.exports = class coinmarketcap extends Exchange {
'Cubits': 'Cubits', // conflict with QBT (Qbao)
'DAO.Casino': 'DAO.Casino', // conflict with BET (BetaCoin)
'ENTCash': 'ENTCash', // conflict with ENT (Eternity)
- 'FairGame': 'FairGame',
+ 'FairGame': 'FairGame',
'GET Protocol': 'GET Protocol',
'Global Tour Coin': 'Global Tour Coin', // conflict with GTC (Game.com)
'GuccioneCoin': 'GuccioneCoin', // conflict with GCC (Global Cryptocurrency)
@@ -119,6 +119,7 @@ module.exports = class coinmarketcap extends Exchange {
'Maggie': 'Maggie',
'IOTA': 'IOTA', // a special case, most exchanges list it as IOTA, therefore we change just the Coinmarketcap instead of changing them all
'NetCoin': 'NetCoin',
+ 'PCHAIN': 'PCHAIN', // conflict with PAI (Project Pai)
'Polcoin': 'Polcoin',
'PutinCoin': 'PutinCoin', // conflict with PUT (Profile Utility Token)
'Rcoin': 'Rcoin', // conflict with RCN (Ripio Credit Network) | coinmarketcap PAI Project Pai vs PCHAIN conflict | ccxt_ccxt | train | js |
d19340c20c31fb87986da9ce002bb2a09b0c4d7c | diff --git a/library/Imbo/Image/Transformation/Watermark.php b/library/Imbo/Image/Transformation/Watermark.php
index <HASH>..<HASH> 100644
--- a/library/Imbo/Image/Transformation/Watermark.php
+++ b/library/Imbo/Image/Transformation/Watermark.php
@@ -93,6 +93,7 @@ class Watermark extends Transformation implements ListenerInterface {
$position = !empty($params['position']) ? $params['position'] : $this->position;
$x = !empty($params['x']) ? (int) $params['x'] : $this->x;
$y = !empty($params['y']) ? (int) $params['y'] : $this->y;
+ $opacity = (!empty($params['opacity']) ? (int) $params['opacity'] : 100)/100;
if (empty($imageIdentifier)) {
throw new TransformationException(
@@ -111,6 +112,7 @@ class Watermark extends Transformation implements ListenerInterface {
$watermark = new Imagick();
$watermark->readImageBlob($watermarkData);
$watermarkSize = $watermark->getImageGeometry();
+ $watermark->setImageOpacity($opacity);
} catch (StorageException $e) {
if ($e->getCode() == 404) {
throw new TransformationException('Watermark image not found', 400); | Added opacity to watermark image | imbo_imbo | train | php |
e3f0c38c3edf171d79eb105a03d3675b61e6e2f9 | diff --git a/src/Name.php b/src/Name.php
index <HASH>..<HASH> 100644
--- a/src/Name.php
+++ b/src/Name.php
@@ -58,7 +58,7 @@ class Name {
$env = App::get('Environment');
$env = strtoupper(substr($env,0,1));
$id = App::get('id');
- return "{$name}_{$env}_{$id}";
+ return $name."_$env$id";
}
public function __toString(){ | update name to meet <I> char username limit | jpuck_qdbp | train | php |
5cf74fba45fe5474499b239738302489be02668d | diff --git a/salt/states/boto3_elasticsearch.py b/salt/states/boto3_elasticsearch.py
index <HASH>..<HASH> 100644
--- a/salt/states/boto3_elasticsearch.py
+++ b/salt/states/boto3_elasticsearch.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
Manage Elasticsearch Service
============================
@@ -44,17 +43,12 @@ Manage Elasticsearch Service
:depends: boto3
"""
-# Import Python libs
-from __future__ import absolute_import, print_function, unicode_literals
import logging
-# Import Salt libs
import salt.utils.json
from salt.utils.versions import LooseVersion
-# Import 3rd-party libs
-
log = logging.getLogger(__name__)
__virtualname__ = "boto3_elasticsearch" | Drop Py2 and six on salt/states/boto3_elasticsearch.py | saltstack_salt | train | py |
f9ed84a5c9a1573c425508e3382df742eddada50 | diff --git a/packages/now-cli/src/commands/teams.js b/packages/now-cli/src/commands/teams.js
index <HASH>..<HASH> 100644
--- a/packages/now-cli/src/commands/teams.js
+++ b/packages/now-cli/src/commands/teams.js
@@ -140,6 +140,7 @@ async function run({ token, config, output }) {
apiUrl,
token,
debug,
+ output,
});
break;
} | [cli] Pass the `output` object to `vercel switch` command (#<I>)
Fixes error: `Cannot read property 'spinner' of undefined` | zeit_now-cli | train | js |
1d404f227253545710546fda8b708848c24a9d09 | diff --git a/ext/java/PsychEmitter.java b/ext/java/PsychEmitter.java
index <HASH>..<HASH> 100644
--- a/ext/java/PsychEmitter.java
+++ b/ext/java/PsychEmitter.java
@@ -101,7 +101,7 @@ public class PsychEmitter extends RubyObject {
options.setCanonical(canonical.isTrue());
options.setIndent((int)level.convertToInteger().getLongValue());
- options.setWidth((int)width.convertToInteger().getLongValue());
+ line_width_set(context, width);
this.io = io;
@@ -296,7 +296,9 @@ public class PsychEmitter extends RubyObject {
@JRubyMethod(name = "line_width=")
public IRubyObject line_width_set(ThreadContext context, IRubyObject width) {
- options.setWidth((int)width.convertToInteger().getLongValue());
+ int newWidth = (int)width.convertToInteger().getLongValue();
+ if (newWidth <= 0) newWidth = Integer.MAX_VALUE;
+ options.setWidth(newWidth);
return width;
} | Treat negative or zero-width as max possible width.
Not sure why snakeyaml doesn't follow libyaml here. I'll follow
up with them. | ruby_psych | train | java |
d7c3cc485cb15191e34721a39720f09222d2d6c7 | diff --git a/tests/Collection/CrudSpecFunctionalTest.php b/tests/Collection/CrudSpecFunctionalTest.php
index <HASH>..<HASH> 100644
--- a/tests/Collection/CrudSpecFunctionalTest.php
+++ b/tests/Collection/CrudSpecFunctionalTest.php
@@ -263,10 +263,10 @@ class CrudSpecFunctionalTest extends FunctionalTestCase
$this->assertSame($expectedResult['upsertedCount'], $actualResult->getUpsertedCount());
}
- if (array_key_exists('upsertedId', $expectedResult)) {
+ if (isset($expectedResult['upsertedIds'])) {
$this->assertSameDocument(
- ['upsertedId' => $expectedResult['upsertedId']],
- ['upsertedId' => $actualResult->getUpsertedId()]
+ ['upsertedIds' => $expectedResult['upsertedIds']],
+ ['upsertedIds' => $actualResult->getUpsertedIds()]
);
}
break; | PHPLIB-<I>: Assert upsertedIds field in bulkWrite CRUD spec tests | mongodb_mongo-php-library | train | php |
456ab9ee3002d8aa9b8c8c194ed1a5138afbd98c | diff --git a/holoviews/core/io.py b/holoviews/core/io.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/io.py
+++ b/holoviews/core/io.py
@@ -310,8 +310,9 @@ class FileArchive(Archive):
"""
ext = '' if ext is None else ext
if isinstance(existing, str):
- existing = [os.path.splitext(el)
- for el in os.listdir(os.path.abspath(existing))]
+ split = [os.path.splitext(el)
+ for el in os.listdir(os.path.abspath(existing))]
+ existing = [(n, ex if not ex else ex[1:]) for (n, ex) in split]
new_name, counter = basename, 1
while (new_name, ext) in existing:
new_name = basename+'-'+str(counter) | Fixed bug in FileArchive _unique_name method | pyviz_holoviews | train | py |
2a8904f844f2b11972ab0976c8ebba49ec7aadf4 | diff --git a/public/app/plugins/datasource/opentsdb/queryCtrl.js b/public/app/plugins/datasource/opentsdb/queryCtrl.js
index <HASH>..<HASH> 100644
--- a/public/app/plugins/datasource/opentsdb/queryCtrl.js
+++ b/public/app/plugins/datasource/opentsdb/queryCtrl.js
@@ -48,13 +48,13 @@ function (angular, _, kbn) {
};
$scope.suggestTagKeys = function(query, callback) {
- $scope.datasource.metricFindQuery('tag_names(' + $scope.target.metric + ')')
+ $scope.datasource.metricFindQuery('suggest_tagk(' + query + ')')
.then($scope.getTextValues)
.then(callback);
};
$scope.suggestTagValues = function(query, callback) {
- $scope.datasource.metricFindQuery('tag_values(' + $scope.target.metric + ',' + $scope.target.currentTagKey + ')')
+ $scope.datasource.metricFindQuery('suggest_tagv(' + query + ')')
.then($scope.getTextValues)
.then(callback);
}; | Fixed queryCtrl to use suggest API | grafana_grafana | train | js |
90c42e2a50cf563d084f98db01684f81f10d9ef1 | diff --git a/qgrid/datagrid.filterbase.js b/qgrid/datagrid.filterbase.js
index <HASH>..<HASH> 100644
--- a/qgrid/datagrid.filterbase.js
+++ b/qgrid/datagrid.filterbase.js
@@ -72,6 +72,9 @@ define([
var filter_width = this.filter_elem.width();
var elem_right = left + filter_width;
var container = $('#notebook-container');
+ if (container.length == 0){
+ container = $('body');
+ }
if (elem_right > container.outerWidth() + (parseInt(container.css("margin-right"), 10) * 2)){
left = (this.filter_btn.offset().left + this.filter_btn.width()) - filter_width;
} | Make filter dropdown placement work in nbviewer also. | quantopian_qgrid | train | js |
cd417bfb9adf289ff97cea47e7ada86fd3ff2c46 | diff --git a/addon/hint/tern/tern-extension.js b/addon/hint/tern/tern-extension.js
index <HASH>..<HASH> 100644
--- a/addon/hint/tern/tern-extension.js
+++ b/addon/hint/tern/tern-extension.js
@@ -221,10 +221,10 @@
var list, argTypes = guessType && guessType.args && guessType.args[nbVar++];
if (argTypes) {
list = [];
- for (var i = 0; i < argTypes.length; i++) {
- for(var arg in guessType) {
- list = list.concat(guessType[arg]);
- }
+ var names = argTypes.split("|");
+ for (var j = 0; j < names.length; j++) {
+ var l = guessType[names[j]];
+ if (l) list = list.concat(l);
}
}
tokens.push({variable: currentParam, list: list}); | Support for multy type tern guess types. | angelozerr_CodeMirror-JavaScript | train | js |
643cecf7c80576c03c6170d6928b78c80419d0c1 | diff --git a/eventsourcing/infrastructure/pythonobjectsrepo.py b/eventsourcing/infrastructure/pythonobjectsrepo.py
index <HASH>..<HASH> 100644
--- a/eventsourcing/infrastructure/pythonobjectsrepo.py
+++ b/eventsourcing/infrastructure/pythonobjectsrepo.py
@@ -25,8 +25,8 @@
# # Put the event in the various dicts.
# stored_entity_id = new_stored_event.entity_id
# if self.always_write_originator_version and new_version_number is not None:
-# versions = self._originator___version__s[stored_entity_id]
-# if next(__version__s[new_version_number]) != 0:
+# versions = self._originator_versions[stored_entity_id]
+# if next(versions[new_version_number]) != 0:
# raise ConcurrencyError("New version {} for entity {} already exists"
# "".format(new_version_number, stored_entity_id))
# originator_version_id = self.make_originator_version_id(stored_entity_id, new_version_number) | Reverted stray edits. | johnbywater_eventsourcing | train | py |
bcb7b5f2b36af5c9d9dc11c99aec8e1177d5c6ca | diff --git a/js/core/Bindable.js b/js/core/Bindable.js
index <HASH>..<HASH> 100644
--- a/js/core/Bindable.js
+++ b/js/core/Bindable.js
@@ -266,7 +266,16 @@ define(["js/core/EventDispatcher", "js/lib/parser", "js/core/Binding", "undersco
if (injection) {
for (var name in inject) {
if (inject.hasOwnProperty(name)) {
- this.$[name] = injection.getInstance(inject[name]);
+ try {
+ this.$[name] = injection.getInstance(inject[name]);
+ } catch (e) {
+
+ if (_.isString(e)) {
+ e = new Error(e + " for key '" + name + "'");
+ }
+
+ throw e;
+ }
}
}
} else { | better debug output for request injection type not found | rappid_rAppid.js | train | js |
2f3e9418bcba6df8db2786e1d8011174317abaf8 | diff --git a/tests/multiple.spec.js b/tests/multiple.spec.js
index <HASH>..<HASH> 100644
--- a/tests/multiple.spec.js
+++ b/tests/multiple.spec.js
@@ -143,6 +143,7 @@ describe('Animate', () => {
ReactDOM.render(
<Animate>
{undefined}
+ {null}
<div key="test"></div>
</Animate>,
container, | Added a test for null children too | react-component_animate | train | js |
1a71d30fb8fad17ea44de635d52e858f066ef308 | diff --git a/tests/micropython/heapalloc_bytesio.py b/tests/micropython/heapalloc_bytesio.py
index <HASH>..<HASH> 100644
--- a/tests/micropython/heapalloc_bytesio.py
+++ b/tests/micropython/heapalloc_bytesio.py
@@ -1,4 +1,10 @@
-import uio
+try:
+ import uio
+except ImportError:
+ import sys
+ print("SKIP")
+ sys.exit()
+
import micropython
data = b"1234" * 16
diff --git a/tests/micropython/heapalloc_traceback.py b/tests/micropython/heapalloc_traceback.py
index <HASH>..<HASH> 100644
--- a/tests/micropython/heapalloc_traceback.py
+++ b/tests/micropython/heapalloc_traceback.py
@@ -2,7 +2,12 @@
import micropython
import sys
-import uio
+try:
+ import uio
+except ImportError:
+ import sys
+ print("SKIP")
+ sys.exit()
# preallocate exception instance with some room for a traceback
global_exc = StopIteration() | tests/micropython: Make uio-using tests skippable. | micropython_micropython | train | py,py |
96e9feca9accd2ecbf776f08afa77045a67312d2 | diff --git a/main.js b/main.js
index <HASH>..<HASH> 100644
--- a/main.js
+++ b/main.js
@@ -2,9 +2,11 @@
var Medya = function(audioContext,callback,bufferSize=256){
var node = audioContext.createScriptProcessor(bufferSize, 1, 1);
node.onaudioprocess = function(e) {
+ // type float32Array
var input = e.inputBuffer.getChannelData(0);
- var output = e.outputBuffer.getChannelData(0);
- console.log("isArray"+input.isArray())
+
+ // Convert from float32Array to Array
+ input = Array.prototype.slice.call(input);
callback(Math.sqrt(input.reduce(function(last,current){
return Math.pow(current,2);
},0)/bufferSize)) | made reduce work, lengthens time it works for | meyda_meyda | train | js |
812f0a7bbf92ae735241eaae4b1dc653153d6d4c | diff --git a/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java b/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java
index <HASH>..<HASH> 100644
--- a/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java
+++ b/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java
@@ -187,8 +187,6 @@ public class BaragonRequestWorker implements Runnable {
if (configuration.getEdgeCacheConfiguration().isEnabled() &&
edgeCache.invalidateIfNecessary(request)) {
LOG.info("Invalidated edge cache for {}", request);
- } else {
- LOG.error("Unable to fully invalidate edge cache for {}", request);
}
} | There are non-error reasons we'd return false here. | HubSpot_Baragon | train | java |
0ecd29b050edbe1c812883ce75ec2637b70ec590 | diff --git a/worker/uniter/runner/jujuc/status-get.go b/worker/uniter/runner/jujuc/status-get.go
index <HASH>..<HASH> 100644
--- a/worker/uniter/runner/jujuc/status-get.go
+++ b/worker/uniter/runner/jujuc/status-get.go
@@ -92,6 +92,7 @@ func (c *StatusGetCommand) ApplicationStatus(ctx *cmd.Context) error {
units := make(map[string]interface{}, len(applicationStatus.Units))
for _, unit := range applicationStatus.Units {
+ // NOTE: unit.Tag is a unit name, not a unit tag.
units[unit.Tag] = toDetails(unit, c.includeData)
}
details["units"] = units | Just adding a NOTE to help the reader. | juju_juju | train | go |
cd5d3c0ab6b379a24c02bb5d4770037870580996 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -9936,7 +9936,7 @@ const devices = [
vendor: 'eWeLink',
description: 'Motion sensor',
supports: 'occupancy',
- fromZigbee: [fz.ias_occupancy_alarm_1_with_timeout, fz.battery_3V],
+ fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery_3V],
toZigbee: [],
meta: {configureKey: 1},
configure: async (device, coordinatorEndpoint) => { | eWeLink / Sonoff Motion sensor no need occupancy timeout (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
9e4c62c304b5396e1c232033f3b0d4765e54ef9f | diff --git a/lib/cli.js b/lib/cli.js
index <HASH>..<HASH> 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -39,7 +39,7 @@
help: 'Display JSON to console only. this option will ignore output-file options.'
})
.option('version', {
- abbr: 'V',
+ abbr: 'v',
flag: true,
help: 'print version and exit',
callback: function() { | Fixed version command to lower-case 'v' | cwdoh_cssparser.js | train | js |
db45093550925ab416b085d85e4fa8090c975c61 | diff --git a/test/test.consumerGroupStream.js b/test/test.consumerGroupStream.js
index <HASH>..<HASH> 100644
--- a/test/test.consumerGroupStream.js
+++ b/test/test.consumerGroupStream.js
@@ -45,6 +45,7 @@ describe('ConsumerGroupStream', function () {
},
function (callback) {
+ callback = _.once(callback);
const messagesToRead = _.clone(messages);
consumerGroupStream = createConsumerGroupStream(topic, { autoCommit: true, groupId: groupId });
consumerGroupStream.on('data', function (message) { | Only allow callback to be called once fixes #<I> (#<I>) | SOHU-Co_kafka-node | train | js |
e1aec40d5a68f8dc18649a77c4cf3361498b113c | diff --git a/src/pyctools/components/qt/qtdisplay.py b/src/pyctools/components/qt/qtdisplay.py
index <HASH>..<HASH> 100644
--- a/src/pyctools/components/qt/qtdisplay.py
+++ b/src/pyctools/components/qt/qtdisplay.py
@@ -36,14 +36,15 @@ from guild.actor import *
from guild.qtactor import ActorSignal, QtActorMixin
import numpy
from PyQt4 import QtGui, QtCore
+from PyQt4.QtCore import Qt
from ...core import ConfigMixin
class QtDisplay(QtActorMixin, QtGui.QLabel, ConfigMixin):
def __init__(self):
- super(QtDisplay, self).__init__(None, QtCore.Qt.Window)
+ super(QtDisplay, self).__init__(
+ None, Qt.Window | Qt.WindowStaysOnTopHint)
ConfigMixin.__init__(self)
- self.show()
@actor_method
def input(self, frame):
@@ -51,6 +52,8 @@ class QtDisplay(QtActorMixin, QtGui.QLabel, ConfigMixin):
self.close()
self.stop()
return
+ if not self.isVisible():
+ self.show()
numpy_image = frame.as_numpy()[0]
if numpy_image.dtype != numpy.uint8:
numpy_image = numpy_image.clip(0, 255).astype(numpy.uint8) | Delay making window visible until input arrives | jim-easterbrook_pyctools | train | py |
a7ed7778bbe799af49f9ead971eb84bd58499c3f | diff --git a/tests/fixtures/array_of_strings_validator.php b/tests/fixtures/array_of_strings_validator.php
index <HASH>..<HASH> 100644
--- a/tests/fixtures/array_of_strings_validator.php
+++ b/tests/fixtures/array_of_strings_validator.php
@@ -12,12 +12,23 @@ class array_of_strings_validator extends AbstractValidator
public function isValid($nodeData)
{
- foreach($nodeData as $value) {
- if (!is_string($value)) {
- return false;
+ $returnValue = true;
+
+
+ if(!is_array($nodeData)) {
+
+ $this->setErrorDescription('Value supposed to be an array');
+ $returnValue = false;
+
+ } else {
+
+ foreach ($nodeData as $value) {
+ if (!is_string($value)) {
+ $returnValue = false;
+ }
}
}
- return true;
+ return $returnValue;
}
} | Add setErrorDescription to fixture class | serkin_volan | train | php |
a7a7eb91dc0c39570a7bd4355e52ae46cc63c2cd | diff --git a/src/Modules/Rollback.php b/src/Modules/Rollback.php
index <HASH>..<HASH> 100644
--- a/src/Modules/Rollback.php
+++ b/src/Modules/Rollback.php
@@ -167,7 +167,7 @@ class Rollback extends Abstract_Module {
return '';
}
- return sprintf( '%slicense/versions/%s/%s/%s/%s', Product::API_URL, urlencode( $this->product->get_name() ), $license, urlencode( get_site_url() ), $this->product->get_version() );
+ return sprintf( '%slicense/versions/%s/%s/%s/%s', Product::API_URL, rawurlencode( $this->product->get_name() ), $license, urlencode( get_site_url() ), $this->product->get_version() );
}
/** | fix: use rawurlencode on all version urls | Codeinwp_themeisle-sdk | train | php |
91a83d6ba55b18a15faad58c90f7fc13b94810ea | diff --git a/library/src/pivotal-ui-react/autocomplete/autocomplete.js b/library/src/pivotal-ui-react/autocomplete/autocomplete.js
index <HASH>..<HASH> 100644
--- a/library/src/pivotal-ui-react/autocomplete/autocomplete.js
+++ b/library/src/pivotal-ui-react/autocomplete/autocomplete.js
@@ -116,7 +116,7 @@ class Autocomplete extends mixin(React.Component).with(Scrim) {
var {scrollIntoView, onPick, onSearch} = this;
input = React.cloneElement(input, {$autocomplete, onPick, scrollIntoView, onSearch, disabled, onFocus, onClick, placeholder});
return (
- <div className={classnames('autocomplete', 'mhs', className)} {...props} >
+ <div className={classnames('autocomplete', className)} {...props} >
{input}
<AutocompleteList {...{$autocomplete, onPick, maxItems, selectedSuggestion}}>{children}</AutocompleteList>
</div> | fix(autocomplete): remove small horizontal margin from autocomplete | pivotal-cf_pivotal-ui | train | js |
469269bb47f967913488286286f7b424c48385c5 | diff --git a/teneto/neuroimagingtools/fmriutils.py b/teneto/neuroimagingtools/fmriutils.py
index <HASH>..<HASH> 100644
--- a/teneto/neuroimagingtools/fmriutils.py
+++ b/teneto/neuroimagingtools/fmriutils.py
@@ -8,7 +8,7 @@ from ..utils import check_packages
# import templateflow.api as tf
# from nilearn.input_data import NiftiLabelsMasker
-@check_packages(["nilearn", "templateflow"], import_into_backend=False)
+@check_packages(["nilearn", "templateflow"])
def make_parcellation(data_path, atlas, template='MNI152NLin2009cAsym', atlas_desc=None, resolution=2, parc_params=None, return_meta=False):
"""
Performs a parcellation which reduces voxel space to regions of interest (brain data).
@@ -41,7 +41,7 @@ def make_parcellation(data_path, atlas, template='MNI152NLin2009cAsym', atlas_de
----
These functions make use of nilearn. Please cite templateflow and nilearn if used in a publicaiton.
"""
-
+
import templateflow.api as tf
from nilearn.input_data import NiftiLabelsMasker | removing backend import variable that is now reoved | wiheto_teneto | train | py |
eb112298f243e605d87d5592ee1666265e56bc25 | diff --git a/easybatch-tutorials/src/main/java/org/easybatch/tutorials/intermediate/load/DatabaseUtil.java b/easybatch-tutorials/src/main/java/org/easybatch/tutorials/intermediate/load/DatabaseUtil.java
index <HASH>..<HASH> 100644
--- a/easybatch-tutorials/src/main/java/org/easybatch/tutorials/intermediate/load/DatabaseUtil.java
+++ b/easybatch-tutorials/src/main/java/org/easybatch/tutorials/intermediate/load/DatabaseUtil.java
@@ -28,6 +28,7 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
+import java.io.File;
import java.sql.*;
/**
@@ -58,6 +59,12 @@ public class DatabaseUtil {
public static void closeSessionFactory() {
sessionFactory.close();
+
+ //delete hsqldb tmp files
+ new File("mem.log").delete();
+ new File("mem.properties").delete();
+ new File("mem.script").delete();
+ new File("mem.tmp").delete();
}
/* | remove tmp files after database shutdown | j-easy_easy-batch | train | java |
7a8b754cada398241fc2d58d63ce58551f6c734c | diff --git a/commands/server.go b/commands/server.go
index <HASH>..<HASH> 100644
--- a/commands/server.go
+++ b/commands/server.go
@@ -83,6 +83,8 @@ func server(cmd *cobra.Command, args []string) {
serverPort = sp.Port
}
+ viper.Set("port", serverPort)
+
if serverAppend {
viper.Set("BaseUrl", strings.TrimSuffix(BaseUrl, "/")+":"+strconv.Itoa(serverPort))
} else {
diff --git a/transform/livereloadinject.go b/transform/livereloadinject.go
index <HASH>..<HASH> 100644
--- a/transform/livereloadinject.go
+++ b/transform/livereloadinject.go
@@ -1,12 +1,17 @@
package transform
-import "bytes"
+import (
+ "bytes"
+
+ "github.com/spf13/viper"
+)
func LiveReloadInject(content []byte) []byte {
match := []byte("</body>")
+ port := viper.GetString("port")
replace := []byte(`<script>document.write('<script src="http://'
+ (location.host || 'localhost').split(':')[0]
- + ':1313/livereload.js?mindelay=10"></'
+ + ':` + port + `/livereload.js?mindelay=10"></'
+ 'script>')</script></body>`)
newcontent := bytes.Replace(content, match, replace, -1) | Fixed #<I>. LiveReload works on any port now. | gohugoio_hugo | train | go,go |
cecbcda162121f92cbea1f2e2af44951f658ced7 | diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/service/svtplay.py
+++ b/lib/svtplay_dl/service/svtplay.py
@@ -108,7 +108,7 @@ class Svtplay(Service, OpenGraphThumbMixin):
def find_all_episodes(self, options):
match = re.search(r'<link rel="alternate" type="application/rss\+xml" [^>]*href="([^"]+)"',
- self.get_urldata())
+ self.get_urldata()[1])
if match is None:
log.error("Couldn't retrieve episode list")
return | svtplay_dl: we want to see the data not the error code.. | spaam_svtplay-dl | train | py |
4bfebf8705d06d8568619cc0c6b83fd3d4fad95e | diff --git a/mapillary_tools/upload.py b/mapillary_tools/upload.py
index <HASH>..<HASH> 100644
--- a/mapillary_tools/upload.py
+++ b/mapillary_tools/upload.py
@@ -629,7 +629,7 @@ def upload(
elif file_type == "blackvue":
video_paths = [
path
- for path in utils.iterate_files(import_path)
+ for path in utils.iterate_files(import_path, recursive=True)
if os.path.splitext(path)[1].lower() in [".mp4"]
]
_upload_blackvues(
@@ -641,7 +641,7 @@ def upload(
elif file_type == "zip":
zip_paths = [
path
- for path in utils.iterate_files(import_path)
+ for path in utils.iterate_files(import_path, recursive=True)
if os.path.splitext(path)[1].lower() in [".zip"]
]
_upload_zipfiles( | fix: upload blackvue in subfolders (#<I>) | mapillary_mapillary_tools | train | py |
3313f3ddea224f3b80806eec66c91063f4a6f297 | diff --git a/src/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java b/src/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java
index <HASH>..<HASH> 100644
--- a/src/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java
+++ b/src/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java
@@ -862,9 +862,10 @@ public class XLogPDescriptor implements Descriptor {
//System.out.println("XLOGP: p-amino sulphonic acid -0.501");
}
- AtomContainer salicilic = sp.parseSmiles("O=C(O)c1ccccc1O");
+
// salicylic acid
if (salicylFlag){
+ AtomContainer salicilic = sp.parseSmiles("O=C(O)c1ccccc1O");
if (UniversalIsomorphismTester.isSubgraph((org.openscience.cdk.AtomContainer)ac, salicilic)) {
xlogP += 0.554;
//System.out.println("XLOGP: salicylic acid 0.554"); | Only parse salicylic acid when it is really needed.
git-svn-id: <URL> | cdk_cdk | train | java |
9b60d1d55ed92334f934ba048f21de7d049bb239 | diff --git a/comment.rb b/comment.rb
index <HASH>..<HASH> 100644
--- a/comment.rb
+++ b/comment.rb
@@ -1,9 +1,9 @@
+require 'ticket_sharing/base'
+
module TicketSharing
- class Comment
+ class Comment < Base
- def initialize(hash)
- @hash = hash
- end
+ fields :uuid, :author, :body, :created_at
end
end | TS::Comment extends TS::Base. | zendesk_ticket_sharing | train | rb |
ed953e3dabae3cf02aa421e419e929b8eb8972b4 | diff --git a/src/iframe/visit-failure.js b/src/iframe/visit-failure.js
index <HASH>..<HASH> 100644
--- a/src/iframe/visit-failure.js
+++ b/src/iframe/visit-failure.js
@@ -1,12 +1,21 @@
export default (props) => {
+ const { status, statusText, contentType } = props
+
+ const getContentType = () => {
+ if (!contentType) {
+ return ''
+ }
+
+ return '(${contentType})'
+ }
+
const getStatus = () => {
- const { status, statusText, contentType } = props
if (!status) {
return ''
}
- return `<p>${status} - ${statusText} (${contentType})</p>`
+ return `<p>${status} - ${statusText} ${getContentType()}</p>`
}
return ` | only display content type when we have it | cypress-io_cypress | train | js |
cf3270b87655dc31f63ddbdd120337004be4735f | diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Support/Collection.php
+++ b/src/Illuminate/Support/Collection.php
@@ -312,7 +312,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
/**
* Dump the collection and end the script.
*
- * @param mixed ...$args
+ * @param mixed ...$args
* @return void
*/
public function dd(...$args) | Added two spaces after @param | laravel_framework | train | php |
41353c8e74ab25b92b9c670e4ee3d421faf122f9 | diff --git a/safe-api/src/main/java/au/edu/usq/fascinator/redbox/SecureStorage.java b/safe-api/src/main/java/au/edu/usq/fascinator/redbox/SecureStorage.java
index <HASH>..<HASH> 100644
--- a/safe-api/src/main/java/au/edu/usq/fascinator/redbox/SecureStorage.java
+++ b/safe-api/src/main/java/au/edu/usq/fascinator/redbox/SecureStorage.java
@@ -67,9 +67,7 @@ public class SecureStorage implements Storage {
this.indexer = indexer;
this.securityManager = securityManager;
this.state = state;
- username = null;
- rolesList = new ArrayList<String>();
- rolesList.add("guest");
+ setGuestAccess();
}
@Override
@@ -137,10 +135,19 @@ public class SecureStorage implements Storage {
rolesList = Arrays.asList(securityManager.getRolesList(state, user));
} catch (AuthenticationException ae) {
log.error("Failed to get user access, assuming guest access", ae);
+ setGuestAccess();
}
+ } else {
+ setGuestAccess();
}
}
+ private void setGuestAccess() {
+ username = "guest";
+ rolesList = new ArrayList();
+ rolesList.add("guest");
+ }
+
/**
* This calls the Solr indexer to check if the current user is allowed to
* access the specified object. This access is based on the following rules: | fixed bug with the secure storage api not caching guest access properly | redbox-mint_redbox | train | java |
5c192afcdb03d08d62c5a3e59840ddf526351964 | diff --git a/lib/plugins/helper/date.js b/lib/plugins/helper/date.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/helper/date.js
+++ b/lib/plugins/helper/date.js
@@ -5,7 +5,7 @@ var isMoment = moment.isMoment;
var isDate = require('util').isDate;
function output(date, format, lang, timezone){
- if (date === null) date = moment();
+ if (typeof myVar === 'undefined' || date === null) date = moment();
if (!isMoment(date)) date = moment(isDate(date) ? date : new Date(date));
if (lang) date = date.locale(lang);
@@ -19,7 +19,7 @@ function output(date, format, lang, timezone){
}
function toISOString(date){
- if (date === null){
+ if (typeof myVar === 'undefined' || date === null){
return new Date().toISOString();
} | Do not compare undefined with null, explicit the cas instead | hexojs_hexo | train | js |
1f0edb19da7ef1bc7e68a34c109e876f87b6ccdf | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -121,7 +121,7 @@ class Apsis {
.pipe(gulp.dest(config.paths.root));
}, {
options: {
- 'bump': 'what bump to perform. [ patch, minor, major]',
+ 'bump [type]': 'what bump to perform. [patch, minor, major]',
},
});
} | docs: update help for bump task | ApsisInternational_gulp-config-apsis | train | js |
f08c8ecc732fc574aff8aa3ec98e29ce39aa1769 | diff --git a/bw-util-calendar/src/main/java/org/bedework/util/calendar/PropertyIndex.java b/bw-util-calendar/src/main/java/org/bedework/util/calendar/PropertyIndex.java
index <HASH>..<HASH> 100644
--- a/bw-util-calendar/src/main/java/org/bedework/util/calendar/PropertyIndex.java
+++ b/bw-util-calendar/src/main/java/org/bedework/util/calendar/PropertyIndex.java
@@ -993,7 +993,9 @@ public class PropertyIndex implements Serializable {
IS_MULTI, allComponents),
/** Href for category */
- CATEGORY_PATH(XcalTags.categories, "CATEGORY_PATH", CategoriesPropType.class,
+ CATEGORY_PATH(XcalTags.categories,
+ "CATEGORY_PATH", "categoryPath",
+ CategoriesPropType.class,
IS_MULTI, allComponents),
/** non ical */ | Refactor indexer to separate out building of entities and indexer docs.
Try to align property names better | Bedework_bw-util | train | java |
3ec870dc3c96ec2de164182870738be9f4cd7c88 | diff --git a/msg_reader.go b/msg_reader.go
index <HASH>..<HASH> 100644
--- a/msg_reader.go
+++ b/msg_reader.go
@@ -36,11 +36,10 @@ func (r *msgReader) rxMsg() (t byte, err error) {
io.CopyN(ioutil.Discard, r.reader, int64(r.msgBytesRemaining))
}
- t, err = r.reader.ReadByte()
- b := r.buf[0:4]
+ b := r.buf[0:5]
_, err = io.ReadFull(r.reader, b)
- r.msgBytesRemaining = int32(binary.BigEndian.Uint32(b)) - 4
- return t, err
+ r.msgBytesRemaining = int32(binary.BigEndian.Uint32(b[1:])) - 4
+ return b[0], err
}
func (r *msgReader) readByte() byte { | combine two small reads into one
There's no need to read 1 byte and then immediately read 4 more, rather
than just reading 5 bytes to begin with. Also, with this change rxMsg is
no longer swallowing an error from ReadByte. | jackc_pgx | train | go |
91e0f858b563b196ec1e89d0cf4f81e331d244d3 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -67,7 +67,7 @@ function testRequest (url, config, cb) {
}
function getUrl (config) {
- return 'http://' + config.test + '-dot-' + projectId + '.appspot.com';
+ return 'http://' + config.test + '-dot-' + projectId + '.appspot-preview.com';
}
// Delete an App Engine version
@@ -279,8 +279,7 @@ exports.testDeploy = function (config, done) {
// Give apps time to start
setTimeout(function () {
// Test versioned url of "default" module
- var demoUrl = 'http://' + config.test + '-dot-' + projectId +
- '.appspot.com';
+ var demoUrl = getUrl(config);
if (config.demoUrl) {
demoUrl = config.demoUrl; | Redirect appspot.com to appspot-preview.com | GoogleCloudPlatform_nodejs-repo-tools | 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.