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
|
---|---|---|---|---|---|
478fa8fdb399c61acdbcc09d079aa4d6cecc2b60 | diff --git a/src/traversing.js b/src/traversing.js
index <HASH>..<HASH> 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -4,7 +4,6 @@ var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
- rchild = /(^|,)\s*>/g,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.POS; | Forgot to remove the child selector in the previous commit. | jquery_jquery | train | js |
66eee63c17463eeb6b4f1f02d7a36732871e9be7 | diff --git a/message.go b/message.go
index <HASH>..<HASH> 100644
--- a/message.go
+++ b/message.go
@@ -6,7 +6,7 @@ import (
)
type Message interface {
- String() string
+ Message() string
}
type message struct {
@@ -14,6 +14,10 @@ type message struct {
fields fields
}
+func (m *message) Message() string {
+ return m.String()
+}
+
func (m *message) String() string {
var buf [1024]byte
msg := bytes.NewBuffer(buf[:0]) | added Message() func to Message interface | amsokol_go-errors | train | go |
0e8d986efc47c6dbdc9b71adbad743217f3d75a0 | diff --git a/lib/mpv/_startStop.js b/lib/mpv/_startStop.js
index <HASH>..<HASH> 100644
--- a/lib/mpv/_startStop.js
+++ b/lib/mpv/_startStop.js
@@ -42,13 +42,13 @@ const startStop = {
const output = data.toString();
// "Listening to IPC socket" - message
- if(output.match(/Listening/)){
+ if(output.match(/Listening to IPC socket/)){
// remove the event listener on stdout
this.mpvPlayer.stdout.removeAllListeners('data');
resolve();
}
// "Could not bind IPC Socket" - message
- else if(output.match(/bind/)){
+ else if(output.match(/Could not bind IPC socket/)){
// remove the event listener on stdout
this.mpvPlayer.stdout.removeAllListeners('data');
reject(this.errorHandler.errorMessage(4, 'startStop()', [this.options.socket])); | Improved robustness of start()
The code matches for the expact verbose output to see if the IPC socket could be created | 00SteinsGate00_Node-MPV | train | js |
a596b2ee36c428e8e94a5a56b2c20fc1e3c3fada | diff --git a/packages/@uppy/dashboard/src/index.js b/packages/@uppy/dashboard/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/@uppy/dashboard/src/index.js
+++ b/packages/@uppy/dashboard/src/index.js
@@ -563,7 +563,6 @@ module.exports = class Dashboard extends Plugin {
}
const cancelUpload = (fileID) => {
- this.uppy.emit('upload-cancel', fileID)
this.uppy.removeFile(fileID)
}
diff --git a/packages/@uppy/xhr-upload/src/index.js b/packages/@uppy/xhr-upload/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/@uppy/xhr-upload/src/index.js
+++ b/packages/@uppy/xhr-upload/src/index.js
@@ -288,13 +288,6 @@ module.exports = class XHRUpload extends Plugin {
}
})
- this.uppy.on('upload-cancel', (fileID) => {
- if (fileID === file.id) {
- timer.done()
- xhr.abort()
- }
- })
-
this.uppy.on('cancel-all', () => {
timer.done()
xhr.abort() | remove `upload-cancel` event, `file-removed` should be enough
Seems like `upload-cancel` was emitted from dashboard and listed to in xhr-upload only | transloadit_uppy | train | js,js |
7fa716f0c606e45efd0e9d86c27af4318bcec9a3 | diff --git a/lib/xpose/exposed.rb b/lib/xpose/exposed.rb
index <HASH>..<HASH> 100644
--- a/lib/xpose/exposed.rb
+++ b/lib/xpose/exposed.rb
@@ -46,14 +46,14 @@ module Xpose
end
def infer_collection
- klass.send(scope)
+ klass.send(conf.scope)
end
def infer_record
source = if instance.respond_to?(conf.pluralized_name)
->{ instance.send(conf.pluralized_name) }
else
- ->{ klass.send(scope) }
+ ->{ klass.send(conf.scope) }
end
if instance.respond_to?(:params) && instance.params.has_key?(:id)
source.call.find(instance.params[:id]) | Bugfix: scope is accessible through conf | yoones_xpose | train | rb |
6d08dbac2ac0d2f8af27654a8d8e55d6036711d2 | diff --git a/File/MARC/List.php b/File/MARC/List.php
index <HASH>..<HASH> 100644
--- a/File/MARC/List.php
+++ b/File/MARC/List.php
@@ -9,7 +9,7 @@
* that is part of the Emilda Project (http://www.emilda.org). Christoffer
* Landtman generously agreed to make the "php-marc" code available under the
* GNU LGPL so it could be used as the basis of this PEAR package.
- *
+ *
* PHP version 5
*
* LICENSE: This program is free software; you can redistribute it and/or modify
@@ -43,7 +43,7 @@
*
* For the list of {@link File_MARC_Field} objects in a {@link File_MARC_Record}
* object, the key() method returns the tag name of the field.
- *
+ *
* For the list of {@link File_MARC_Subfield} objects in a {@link
* File_MARC_Data_Field} object, the key() method returns the code of
* the subfield.
@@ -133,11 +133,20 @@ class File_MARC_List extends SplDoublyLinkedList
if ($this->offsetExists($exist_pos + 1)) {
$this->add($exist_pos + 1, $new_node);
} else {
- $this->push($new_node);
+ $this->appendNode($new_node);
+ return true;
}
break;
}
+ // Fix positions
+ $this->rewind();
+ while ($n = $this->current()) {
+ $n->setPosition($pos);
+ $this->next();
+ $pos++;
+ }
+
return true;
}
// }}} | Fix positions when inserting nodes. The nodes did not get properly reindexed by the insertNode method. | pear_File_MARC | train | php |
fb0f0d0206ce6f91a66b1e68e646c6ad13d7467e | diff --git a/service/handler.go b/service/handler.go
index <HASH>..<HASH> 100644
--- a/service/handler.go
+++ b/service/handler.go
@@ -183,7 +183,10 @@ func (h *HandlerService) Handle(conn acceptor.PlayerConn) {
msg, err := conn.GetNextMessage()
if err != nil {
- logger.Log.Errorf("Error reading next available message: %s", err.Error())
+ if err != constants.ErrConnectionClosed {
+ logger.Log.Errorf("Error reading next available message: %s", err.Error())
+ }
+
return
} | refactor(service): do not log message as an error what it is only closed | topfreegames_pitaya | train | go |
de957a5e36680b8b55d71523f4e41ed3bb488c2b | diff --git a/src/SparkPlug.php b/src/SparkPlug.php
index <HASH>..<HASH> 100644
--- a/src/SparkPlug.php
+++ b/src/SparkPlug.php
@@ -216,6 +216,8 @@ class SparkPlug
load_class('Input', 'core');
load_class('Lang', 'core');
+
+ load_class('Output', 'core');
}
/** | Load Output class (#2) | rougin_spark-plug | train | php |
ab89c8acaa37fd4fcf90134abaaefc0435dbb522 | diff --git a/lib/fencepost/fencepost.rb b/lib/fencepost/fencepost.rb
index <HASH>..<HASH> 100644
--- a/lib/fencepost/fencepost.rb
+++ b/lib/fencepost/fencepost.rb
@@ -81,7 +81,7 @@ module Fencepost
end
def self.always_forbidden_attributes
- [:id, :created_at, :updated_at, :created_by, :updated_by]
+ []
end
def self.attribute_keys(model) | removes always forbidden attributes (this should be handled by manual config) | scotthelm_fencepost | train | rb |
f86a9efb92ef92dcb058fe93995861452f25c1d5 | diff --git a/lib/reporters/html/index.js b/lib/reporters/html/index.js
index <HASH>..<HASH> 100644
--- a/lib/reporters/html/index.js
+++ b/lib/reporters/html/index.js
@@ -76,7 +76,7 @@ PostmanHTMLReporter = function (newman, options) {
if (reducedExecution.response && _.isFunction(reducedExecution.response.toJSON)) {
reducedExecution.response = reducedExecution.response.toJSON();
- reducedExecution.response.body = reducedExecution.response.stream.toString();
+ reducedExecution.response.body = Buffer.from(reducedExecution.response.stream).toString();
}
// set sample request and response details for the current request | Update index.js
converted response.body to buffer otherwise toString of standard object is called returning [object Object] as a string. Refer to <URL> | postmanlabs_newman | train | js |
6728ed30a6c525d20241b622eff0c993debd0256 | diff --git a/log/logging.go b/log/logging.go
index <HASH>..<HASH> 100644
--- a/log/logging.go
+++ b/log/logging.go
@@ -301,7 +301,7 @@ func SanitizeFormat(format LogFormat) LogFormat {
} else {
// Whether it's explicitly a DefaultFormat, or it's an unrecognized value,
// try to take from env var.
- envFormat := os.Getenv("GOLOG_DEFAULT_ENCODING")
+ envFormat := os.Getenv("LOG_ENCODING")
if envFormat == string(JsonFormat) || envFormat == string(PlainTextFormat) {
return LogFormat(envFormat)
} | Rename encoding env to be consistent with others | timehop_golog | train | go |
ca38dd5e187fb17da0b31dd00f4ad87d84861453 | diff --git a/lib/hella-redis/version.rb b/lib/hella-redis/version.rb
index <HASH>..<HASH> 100644
--- a/lib/hella-redis/version.rb
+++ b/lib/hella-redis/version.rb
@@ -1,3 +1,3 @@
module HellaRedis
- VERSION = "0.2.1"
+ VERSION = "0.3.0"
end | version to <I>
* Update `ConnectionSpy`, handle `pipelined` and `multi` (#<I>)
/cc @kellyredding | redding_hella-redis | train | rb |
662ce6af089f89acc1a9cbd462839304479917ae | diff --git a/library/CM/Model/StorageAdapter/Database.php b/library/CM/Model/StorageAdapter/Database.php
index <HASH>..<HASH> 100644
--- a/library/CM/Model/StorageAdapter/Database.php
+++ b/library/CM/Model/StorageAdapter/Database.php
@@ -11,13 +11,16 @@ class CM_Model_StorageAdapter_Database extends CM_Model_StorageAdapter_AbstractA
foreach ($idTypeArray as $idType) {
$type = (int) $idType['type'];
$id = $idType['id'];
+ if (!is_array($id)) {
+ $id = array('id' => $id);
+ }
$types[$type][] = $id;
}
$resultSet = array();
foreach ($types as $type => $ids) {
$idColumnList = array_keys($ids[0]);
$whereArray = array();
- foreach ($ids as $id) { //id-array
+ foreach ($ids as $id) {
$where = array();
foreach ($id as $key => $value) {
$where[] = '`' . $key . '`=\'' . $value . '\''; | allow passing of scalar ids to Storage::loadMultiple() | cargomedia_cm | train | php |
d60abb4be60c8c9e23ce6fd1df8fc909fe42c979 | diff --git a/ui/src/side_nav/containers/SideNav.js b/ui/src/side_nav/containers/SideNav.js
index <HASH>..<HASH> 100644
--- a/ui/src/side_nav/containers/SideNav.js
+++ b/ui/src/side_nav/containers/SideNav.js
@@ -143,26 +143,20 @@ const SideNav = React.createClass({
>
<NavHeader
link={`${sourcePrefix}/admin-influxdb`}
- title="Admin"
+ title="InfluxDB Admin"
/>
</NavBlock>
}
>
<NavBlock
icon="crown2"
- link={`${sourcePrefix}/admin-chronograf`}
+ link={`${sourcePrefix}/admin-influxdb`}
location={location}
>
<NavHeader
- link={`${sourcePrefix}/admin-chronograf`}
- title="Admin"
+ link={`${sourcePrefix}/admin-influxdb`}
+ title="InfluxDB Admin"
/>
- <NavListItem link={`${sourcePrefix}/admin-chronograf`}>
- Chronograf
- </NavListItem>
- <NavListItem link={`${sourcePrefix}/admin-influxdb`}>
- InfluxDB
- </NavListItem>
</NavBlock>
</Authorized> | Remove Chronograf from Admin nav item and rename InfluxDB Admin | influxdata_influxdb | train | js |
4b450a5998cd10887dd7d014923239da47f5155b | diff --git a/v1.go b/v1.go
index <HASH>..<HASH> 100644
--- a/v1.go
+++ b/v1.go
@@ -41,13 +41,13 @@ func parseVersion1(reader *bufio.Reader) (*Header, error) {
transportProtocol = TCPv4
case "TCP6":
transportProtocol = TCPv6
- case "UNKNOWN": // no-op
+ case "UNKNOWN": // no-op as UNSPEC is set already
default:
return nil, ErrCantReadAddressFamilyAndProtocol
}
// Expect 6 tokens only when UNKNOWN is not present.
- if tokens[1] != "UNKNOWN" && len(tokens) < 6 {
+ if !transportProtocol.IsUnspec() && len(tokens) < 6 {
return nil, ErrCantReadAddressFamilyAndProtocol
}
} | v1: validate UNSPEC to show how it's used to signal UNKNOWN | pires_go-proxyproto | train | go |
5a4c490c7a408458fc6d4e33bf65d9ecc97f1879 | diff --git a/test/util.js b/test/util.js
index <HASH>..<HASH> 100644
--- a/test/util.js
+++ b/test/util.js
@@ -189,7 +189,7 @@ describe('utils', function() {
});
describe('dosDateTime(date, utc)', function() {
- it('should convert date to DOS representation', function() {
+ it.skip('should convert date to DOS representation', function() {
assert.deepEqual(utils.dosDateTime(testDate), testDateDos);
}); | test: skip dosDateTime without UTC for now due to issues with testing timezones. | archiverjs_node-archiver | train | js |
1aa943a39ca0d0da0130df4fb658b64c37efc1d8 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -11,7 +11,7 @@ return array(
'name' => 'taoSubjects',
'description' => 'TAO Subjects extension',
'version' => '2.4',
- 'author' => 'CRP Henri Tudor',
+ 'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'dependencies' => array('tao'),
'models' => array('http://www.tao.lu/Ontologies/TAOSubject.rdf',
'http://www.tao.lu/Ontologies/taoFuncACL.rdf'), | added/corrected Open Assessment Technologies as author
git-svn-id: <URL> | oat-sa_extension-tao-testtaker | train | php |
8ecfd255310afc4ee018decc9c001ffb7307efc8 | diff --git a/cr8/run_crate.py b/cr8/run_crate.py
index <HASH>..<HASH> 100644
--- a/cr8/run_crate.py
+++ b/cr8/run_crate.py
@@ -346,8 +346,8 @@ def get_crate(version, crate_root=None):
@argh.arg('version', help='Crate version to run. Concrete version like\
"0.55.0", an alias or an URI pointing to a Crate tarball. Supported\
aliases are: [{0}]'.format(', '.join(_version_lookups.keys())))
[email protected]('-e', '--env', nargs='*')
[email protected]('-s', '--setting', nargs='*')
[email protected]('-e', '--env', action='append')
[email protected]('-s', '--setting', action='append')
def run_crate(version, env=None, setting=None, crate_root=None):
"""Launch a crate instance"""
init_logging() | Change run-crate setting and env option to be repeatable
Instead of `-s s1=1 s2=2` they're now used as `-s s1=1 -s s2=2`
Fixes #<I> | mfussenegger_cr8 | train | py |
6667d6f64152c895fa6bf1f0bb6286eeb0d6cfd4 | diff --git a/lib/dm-core/query.rb b/lib/dm-core/query.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-core/query.rb
+++ b/lib/dm-core/query.rb
@@ -546,13 +546,9 @@ module DataMapper
# @api private
def condition_properties
properties = Set.new
- operands = conditions.operands.dup
- while operand = operands.pop
- case operand
- when Conditions::AbstractOperation then operands.concat(operand.operands)
- when Conditions::AbstractComparison then properties << operand.subject if operand.subject.kind_of?(Property)
- end
+ each_comparison do |comparison|
+ properties << comparison.subject if comparison.subject.kind_of?(Property)
end
properties
@@ -1202,5 +1198,19 @@ module DataMapper
property.get!(record)
end
end
+
+ # TODO: document
+ # @api private
+ def each_comparison
+ operands = conditions.operands.dup
+
+ while operand = operands.shift
+ if operand.respond_to?(:operands)
+ operands.concat(operand.operands)
+ else
+ yield operand
+ end
+ end
+ end
end # class Query
end # module DataMapper | Refactor Query#conditions_properties to use #each_comparison | datamapper_dm-core | train | rb |
8646e4761557f75afc688e15dfab713571bae723 | diff --git a/src/components/NotifyOnScrollThreshold.js b/src/components/NotifyOnScrollThreshold.js
index <HASH>..<HASH> 100644
--- a/src/components/NotifyOnScrollThreshold.js
+++ b/src/components/NotifyOnScrollThreshold.js
@@ -4,11 +4,13 @@ const _throttle = require('lodash/throttle');
const NotifyOnScrollThreshold = React.createClass({
propTypes: {
children: React.PropTypes.func.isRequired,
+ onThresholdMet: React.PropTypes.func,
threshold: React.PropTypes.number // Number between 0 and 1 representing 0 to 100%
},
getDefaultProps () {
return {
+ onThresholdMet: () => {},
threshold: 0.9
};
},
@@ -50,7 +52,7 @@ const NotifyOnScrollThreshold = React.createClass({
scrollHeight: element.scrollHeight,
scrollPosition: element.scrollTop,
thresholdMet
- });
+ }, this.props.onThresholdMet);
}
}, | Adds onThresholdMet prop to component | mxenabled_mx-react-components | train | js |
086a8b82b95fec4484477d18d0c6347a72a33c08 | diff --git a/app/state.js b/app/state.js
index <HASH>..<HASH> 100644
--- a/app/state.js
+++ b/app/state.js
@@ -47,8 +47,8 @@ const initialState = {
y: 380,
},
},
- 8: {
- id: 8,
+ 5: {
+ id: 5,
typeId: 5,
patchId: 1,
position: { | fix(tests): fix tests for merged version | xodio_xod | train | js |
aa42d17d6bc5d79bd7d18c310e2c0e3575702d8b | diff --git a/reactor-core/src/main/java/reactor/core/publisher/MonoProcessor.java b/reactor-core/src/main/java/reactor/core/publisher/MonoProcessor.java
index <HASH>..<HASH> 100644
--- a/reactor-core/src/main/java/reactor/core/publisher/MonoProcessor.java
+++ b/reactor-core/src/main/java/reactor/core/publisher/MonoProcessor.java
@@ -62,7 +62,7 @@ public abstract class MonoProcessor<O> extends Mono<O>
* @param <IN> the type of values that can be emitted by the sink
* @return a {@link MonoProcessor} with the same semantics as the {@link Sinks.One}
*/
- public static <IN> Processor<IN, IN> fromSink(Sinks.One<IN> sink) {
+ public static <IN> MonoProcessor<IN> fromSink(Sinks.One<IN> sink) {
if (sink instanceof MonoProcessor) {
@SuppressWarnings("unchecked")
final MonoProcessor<IN> processor = (MonoProcessor<IN>) sink; | [polish] Fix return type of MonoProcessor#fromSink (see #<I>, #<I>)
MonoProcessor.fromSink was mistakenly returning Processor. | reactor_reactor-core | train | java |
2472a647a41adfee9bbc591c2ed78bac0244610b | diff --git a/src/sku/components/SkuMessages.js b/src/sku/components/SkuMessages.js
index <HASH>..<HASH> 100644
--- a/src/sku/components/SkuMessages.js
+++ b/src/sku/components/SkuMessages.js
@@ -56,11 +56,7 @@ export default createComponent({
const messages = {};
this.messageValues.forEach((item, index) => {
- let { value } = item;
- if (this.messages[index].datetime > 0) {
- value = value.replace(/T/g, ' ');
- }
- messages[`message_${index}`] = value;
+ messages[`message_${index}`] = item.value;
});
return messages;
@@ -70,12 +66,8 @@ export default createComponent({
const messages = {};
this.messageValues.forEach((item, index) => {
- let { value } = item;
const message = this.messages[index];
- if (message.datetime > 0) {
- value = value.replace(/T/g, ' ');
- }
- messages[message.name] = value;
+ messages[message.name] = item.value;
});
return messages; | fix(Sku): delete unuse logic | youzan_vant | train | js |
f62e61c28f11a39c1fb4cfda5842bb648ee24eb9 | diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go
+++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go
@@ -1081,7 +1081,7 @@ func TestDispatchEventWillNotBeBlockedByTimedOutWatcher(t *testing.T) {
shouldContinue = false
}
}
- case <-time.After(2 * time.Second):
+ case <-time.After(wait.ForeverTestTimeout):
shouldContinue = false
w2.Stop()
} | Fix cacher test after bumping fakeBudget timeout to 2 seconds | kubernetes_kubernetes | train | go |
8acd6fe7284612e2d0289a84f12c09cb3afbb394 | diff --git a/carbonserver/carbonserver.go b/carbonserver/carbonserver.go
index <HASH>..<HASH> 100644
--- a/carbonserver/carbonserver.go
+++ b/carbonserver/carbonserver.go
@@ -776,10 +776,10 @@ func (listener *CarbonserverListener) expandGlobs(ctx context.Context, query str
var useGlob bool
- // // TODO: Find out why we have set 'useGlob' if 'star == -1'
- // if star := strings.IndexByte(query, '*'); strings.IndexByte(query, '[') == -1 && strings.IndexByte(query, '?') == -1 && (star == -1 || star == len(query)-1) {
- // useGlob = true
- // }
+ // TODO: Find out why we have set 'useGlob' if 'star == -1'
+ if star := strings.IndexByte(query, '*'); strings.IndexByte(query, '[') == -1 && strings.IndexByte(query, '?') == -1 && (star == -1 || star == len(query)-1) {
+ useGlob = true
+ }
logger = logger.With(zap.Bool("use_glob", useGlob))
/* things to glob: | trie: bring back useGlob control in expandGlobs (committed by accident) | lomik_go-carbon | train | go |
6cf30eae96d5d7aed4061c158e678197317a1c41 | diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php
index <HASH>..<HASH> 100644
--- a/enrol/authorize/authorizenetlib.php
+++ b/enrol/authorize/authorizenetlib.php
@@ -19,7 +19,6 @@ define('AN_REASON_NOACHTYPE2', 246);
require_once($CFG->dirroot.'/enrol/authorize/const.php');
require_once($CFG->dirroot.'/enrol/authorize/localfuncs.php');
-require_once($CFG->dirroot.'/enrol/authorize/enrol.php');
/**
* Gets settlement date and time | all static functions in enrolment_plugin_authorize moved to localfuncs.php. So, no need enrol.php. | moodle_moodle | train | php |
9c16795d00aca32297a9480df83670825d41e384 | diff --git a/test/org/opencms/importexport/AllTests.java b/test/org/opencms/importexport/AllTests.java
index <HASH>..<HASH> 100644
--- a/test/org/opencms/importexport/AllTests.java
+++ b/test/org/opencms/importexport/AllTests.java
@@ -1,7 +1,7 @@
/*
* File : $Source: /alkacon/cvs/opencms/test/org/opencms/importexport/AllTests.java,v $
- * Date : $Date: 2005/02/17 12:46:01 $
- * Version: $Revision: 1.10 $
+ * Date : $Date: 2005/04/27 14:07:59 $
+ * Version: $Revision: 1.11 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
@@ -38,7 +38,7 @@ import junit.framework.TestSuite;
/**
* @author Alexander Kandzior ([email protected])
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*
* @since 5.0
*/
@@ -62,6 +62,7 @@ public final class AllTests {
//$JUnit-BEGIN$
suite.addTestSuite(TestCmsImport.class);
suite.addTest(TestCmsImportExport.suite());
+ suite.addTest(TestCmsImportExportNonexistentUser.suite());
//$JUnit-END$
return suite;
} | Added test case for exporting VFS data with nonexistent user. | alkacon_opencms-core | train | java |
3a9fd93785ab44b16b9f28ba1ee02f24d52cb745 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -26,7 +26,7 @@ function Logsene (token, type, url) {
if (token === null || token === '') {
throw new Error('Logsene token not specified')
}
- this.url = (url || 'https://logsene-receiver.sematext.com/_bulk')
+ this.url = (url || process.env.LOGSENE_URL || 'https://logsene-receiver.sematext.com/_bulk')
this.token = token
this.type = type || 'logs'
this.hostname = os.hostname() | configurable Logsene Receiver via env variable LOGSENE_URL | sematext_logsene-js | train | js |
f182aaf1b52d0a58724a2bf9ae191ec9c7dbf912 | diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php
index <HASH>..<HASH> 100644
--- a/lib/db/postgres7.php
+++ b/lib/db/postgres7.php
@@ -1422,7 +1422,7 @@ function main_upgrade($oldversion=0) {
}
- if ($oldversion > 2006031000) {
+ if ($oldversion < 2006031000) {
modify_database("","CREATE TABLE prefix_post (
id SERIAL PRIMARY KEY, | Serious typo in postgres7 upgrade script | moodle_moodle | train | php |
1d07bbba0272d6eea143d5212d96d86bdcbc700d | diff --git a/bin/oref0-get-profile.js b/bin/oref0-get-profile.js
index <HASH>..<HASH> 100755
--- a/bin/oref0-get-profile.js
+++ b/bin/oref0-get-profile.js
@@ -47,8 +47,8 @@ if (!module.parent) {
var model_input = params.model;
if (params._.length > 6)
{
- model_input = params.model ? params.params._.slice(5, 6).pop() : false;
- var carbratio_input = params._.slice(6, 7).pop()
+ model_input = params.model ? params._.slice(5, 6).pop() : false;
+ carbratio_input = params._.slice(6, 7).pop()
}
if (!pumpsettings_input || !bgtargets_input || !isf_input || !basalprofile_input) { | Minor fixup, changed incorrect variable, scoping tidy up (#<I>) | openaps_oref0 | train | js |
ccd9ca494710cc77b100f89b3423ba99603fa030 | diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py
index <HASH>..<HASH> 100644
--- a/tests/integration/api_container_test.py
+++ b/tests/integration/api_container_test.py
@@ -1252,6 +1252,9 @@ class AttachContainerTest(BaseAPIIntegrationTest):
@pytest.mark.timeout(10)
@pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('ssh://'),
reason='No cancellable streams over SSH')
+ @pytest.mark.xfail(condition=os.environ.get('DOCKER_TLS_VERIFY') or
+ os.environ.get('DOCKER_CERT_PATH'),
+ reason='Flaky test on TLS')
def test_attach_stream_and_cancel(self):
container = self.client.create_container(
BUSYBOX, 'sh -c "sleep 2 && echo hello && sleep 60"', | Xfail test_attach_stream_and_cancel on TLS
This test is quite flaky on ssl integration test | docker_docker-py | train | py |
fe8084b3d5ea3870f367f3d7abb6d9a06c9c8d67 | diff --git a/rest_collector.go b/rest_collector.go
index <HASH>..<HASH> 100644
--- a/rest_collector.go
+++ b/rest_collector.go
@@ -36,7 +36,7 @@ type RestCollector struct {
UpdatedOn int64 `json:"updatedOn,omitempty"`
- AutomaticUpgradeInfo AutomaticUpgradeInfo `json:"automaticUpgradeInfo,omitempty"`
+ AutomaticUpgradeInfo *AutomaticUpgradeInfo `json:"automaticUpgradeInfo,omitempty"`
NumberOfHosts int32 `json:"numberOfHosts,omitempty"`
@@ -46,7 +46,7 @@ type RestCollector struct {
LastSentNotificationOnLocal string `json:"lastSentNotificationOnLocal,omitempty"`
- OnetimeUpgradeInfo OnetimeUpgradeInfo `json:"onetimeUpgradeInfo,omitempty"`
+ OnetimeUpgradeInfo *OnetimeUpgradeInfo `json:"onetimeUpgradeInfo,omitempty"`
WrapperConf string `json:"wrapperConf,omitempty"`
@@ -102,7 +102,7 @@ type RestCollector struct {
Acked bool `json:"acked,omitempty"`
- OnetimeDowngradeInfo DowngradeInfo `json:"onetimeDowngradeInfo,omitempty"`
+ OnetimeDowngradeInfo *DowngradeInfo `json:"onetimeDowngradeInfo,omitempty"`
UpTime int64 `json:"upTime,omitempty"` | Fix AddCollector by using pointers | logicmonitor_lm-sdk-go | train | go |
ac390ec8bd1f6e5c6483e2b2e02688193c91c2bc | diff --git a/property/wait.go b/property/wait.go
index <HASH>..<HASH> 100644
--- a/property/wait.go
+++ b/property/wait.go
@@ -71,6 +71,11 @@ func Wait(ctx context.Context, c *Collector, obj types.ManagedObjectReference, p
return err
}
+ // Retry if the result came back empty
+ if res == nil {
+ continue
+ }
+
version = res.Version
for _, fs := range res.FilterSet { | Retry on empty result from property collector | vmware_govmomi | train | go |
8c0741163eb177417b5f16c209238c97bc88e3eb | diff --git a/lib/url-prefixer.js b/lib/url-prefixer.js
index <HASH>..<HASH> 100644
--- a/lib/url-prefixer.js
+++ b/lib/url-prefixer.js
@@ -84,7 +84,7 @@ function urlPrefixer(config) {
// if we buffered a bit of text but we're now at the end of the data, then apparently
// it wasn't a url - send it along
if (chunk_remainder) {
- this.push(chunk_remainder);
+ this.push(rewriteUrls(chunk_remainder, uri, config.prefix));
chunk_remainder = undefined;
}
done(); | Fix for really short HTML responses
When HTML responses are short the flush function can sometimes get a chunk_remainder. Before the chunk_remainder is ignored. Now it parses the last piece to ensure that it will be parsed. | nfriedly_node-unblocker | train | js |
9380a74b70480068180725a06fd5aa6d2f131659 | diff --git a/go/bind/keybase.go b/go/bind/keybase.go
index <HASH>..<HASH> 100644
--- a/go/bind/keybase.go
+++ b/go/bind/keybase.go
@@ -29,7 +29,6 @@ import (
"github.com/keybase/kbfs/env"
"github.com/keybase/kbfs/fsrpc"
"github.com/keybase/kbfs/libgit"
- "github.com/keybase/kbfs/libhttpserver"
"github.com/keybase/kbfs/libkbfs"
"github.com/keybase/kbfs/simplefs"
)
@@ -166,7 +165,6 @@ func Init(homeDir string, logFile string, runModeStr string, accessGroupOverride
// before KBFS-on-mobile is ready.
kbfsParams.Debug = true // false
kbfsParams.Mode = libkbfs.InitConstrainedString // libkbfs.InitMinimalString
- kbfsParams.LocalHTTPServer = &libhttpserver.Server{}
kbfsConfig, _ = libkbfs.Init(
context.Background(), kbfsCtx, kbfsParams, serviceCn{}, func() {},
kbCtx.Log) | move libhttpserver initialization into SimpleFS (#<I>) | keybase_client | train | go |
5f226d97b09c811f9565432e741d8615460853eb | diff --git a/tests/integration/pypyr/utils/filesystem_int_test.py b/tests/integration/pypyr/utils/filesystem_int_test.py
index <HASH>..<HASH> 100644
--- a/tests/integration/pypyr/utils/filesystem_int_test.py
+++ b/tests/integration/pypyr/utils/filesystem_int_test.py
@@ -45,13 +45,18 @@ def temp_file_creator(temp_dir):
# this runs after the decorated test goes out of scope
for file in temp_files:
- file.unlink(missing_ok=True)
-
+ try:
+ # can't use missing_ok=True until py 3.8 the min ver.
+ file.unlink()
+ except FileNotFoundError:
+ # just clean-up, if file already been removed no probs
+ pass
# endregion setup/teardown/fixtures
# region FileRewriter
+
class ArbRewriter(filesystem.FileRewriter):
"""Derived FileRewriter useful for capturing test inputs.""" | fs integration test py<I> compat
filesystem integration test clean-up uses Pathlib.Path().unlink(missing_ok=True).
The missing_ok arg was only introduced in py <I>
Revert to using try/catch on FileNotFoundException until pypyr min supported py version is py<I>. | pypyr_pypyr-cli | train | py |
3ed21ceecba25a5265a407a8643f050d00df69f5 | diff --git a/lib/usps/test.rb b/lib/usps/test.rb
index <HASH>..<HASH> 100644
--- a/lib/usps/test.rb
+++ b/lib/usps/test.rb
@@ -14,13 +14,17 @@ module USPS
require 'usps/test/city_and_state_lookup'
require 'usps/test/tracking_lookup'
- #
- if(USPS.config.username.nil?)
+ if(ENV['USPS_USER'].nil?)
raise 'USPS_USER must be set in the environment to run these tests'
end
- # Set USPS_LIVE to anything to run against production
- USPS.testing = true unless ENV['USPS_LIVE']
+ USPS.configure do |config|
+ # Being explicit even though it's set in the configuration by default
+ config.username = ENV['USPS_USER']
+
+ # Set USPS_LIVE to anything to run against production
+ config.testing = true
+ end
include ZipCodeLookup
include CityAndStateLookup | Use the new configuration idiom and remove USPS_LIVE.
The test data was defined in <I> or before and isn't valid any more for
many of the tests. | gaffneyc_usps | train | rb |
1c85ea6bda4e31aa583e92327e107aae3c235ee7 | diff --git a/tasky/loop.py b/tasky/loop.py
index <HASH>..<HASH> 100644
--- a/tasky/loop.py
+++ b/tasky/loop.py
@@ -90,8 +90,8 @@ class Tasky(object):
async def init(self) -> None:
'''Initialize configuration and start tasks.'''
- self.configuration = await self.insert(self.configuration)
self.stats = await self.insert(self.stats)
+ self.configuration = await self.insert(self.configuration)
if not self.executor:
max_workers = self.config.get('executor_workers') | Start the stats task before the config task
This allows counters to be available for usage when the config task
is initialized. | jreese_tasky | train | py |
411bc24db9549d43c110b86a6947d94fe4a2cf6a | diff --git a/tests/shapes_unittest.py b/tests/shapes_unittest.py
index <HASH>..<HASH> 100644
--- a/tests/shapes_unittest.py
+++ b/tests/shapes_unittest.py
@@ -785,15 +785,20 @@ class FieldTestCase(unittest.TestCase):
class GridTestCase(unittest.TestCase):
+ def _test_expected_points(self, grid):
+ for i, point in enumerate(grid):
+ # check point iteration order
+ expected_row = int(i / grid.columns)
+ expected_column = i % grid.columns
+
+ self.assertEquals((expected_row, expected_column),
+ (point.row, point.column))
def test_grid_iterates_all_points(self):
constraint = shapes.RegionConstraint.from_simple(
(10.0, 10.0), (100.0, 100.0))
constraint.cell_size = 10.0
- grid = constraint.grid
- for point in grid:
- print "Point at %s and %s" % (point.row, point.column)
- # TODO(JMC): assert the sequence is correct
+ self._test_expected_points(constraint.grid)
class RegionTestCase(unittest.TestCase): | Check the sequence of points produced by the grid iterator. | gem_oq-engine | train | py |
6a322fc202960d648968f575ff25ec80009d8249 | diff --git a/tests/test_simple_document.py b/tests/test_simple_document.py
index <HASH>..<HASH> 100644
--- a/tests/test_simple_document.py
+++ b/tests/test_simple_document.py
@@ -84,6 +84,12 @@ class TestDocument(unittest.TestCase):
def test_contains(self):
now = datetime.now()
+ self.assertFalse('b' in self.model)
+ self.assertFalse('s' in self.model)
+ self.assertFalse('dt' in self.model)
+ self.assertFalse('d' in self.model)
+ self.assertFalse('i' in self.model)
+
self.model['b'] = True
self.model['s'] = 'a short string description'
self.model['dt'] = now | + assertions to *contains* Unit Test | mushkevych_synergy_odm | train | py |
bde1b7b3b8d65fcd27c4fbf15449dc053712adab | diff --git a/datalad_service/common/annex.py b/datalad_service/common/annex.py
index <HASH>..<HASH> 100644
--- a/datalad_service/common/annex.py
+++ b/datalad_service/common/annex.py
@@ -8,12 +8,16 @@ from datalad.support.exceptions import FileInGitError
SERVICE_EMAIL = '[email protected]'
SERVICE_USER = 'Git Worker'
+
def filter_git_files(files):
"""Remove any git/datalad files from a list of files."""
return [f for f in files if not (f.startswith('.datalad/') or f == '.gitattributes')]
def get_repo_files(dataset, branch='HEAD'):
+ # If we're on the right branch, use the fast path with branch=None
+ if branch == dataset.repo.get_active_branch():
+ branch = None
working_files = filter_git_files(dataset.repo.get_files(branch=branch))
files = []
for filename in working_files: | Speed up get_files if no branch change is required. | OpenNeuroOrg_openneuro | train | py |
28a5d7e53a05414183f14807576e0b051ea56214 | diff --git a/tests/e2e/kubetest2-kops/do/zones.go b/tests/e2e/kubetest2-kops/do/zones.go
index <HASH>..<HASH> 100644
--- a/tests/e2e/kubetest2-kops/do/zones.go
+++ b/tests/e2e/kubetest2-kops/do/zones.go
@@ -19,6 +19,7 @@ package do
import (
"errors"
"math/rand"
+ "time"
)
var allZones = []string{
@@ -46,7 +47,8 @@ func RandomZones(count int) ([]string, error) {
return nil, ErrMoreThanOneZone
}
- n := rand.Int() % len(allZones)
+ rand.Seed(time.Now().UnixNano())
+ n := rand.Intn(1000) % len(allZones)
chosenZone := allZones[n]
chosenZones := make([]string, 0) | Fix seeding for generating random zones | kubernetes_kops | train | go |
0ba7da46fdba60bca28f4f56a1cf861ced235678 | diff --git a/src/Exscript/AccountManager.py b/src/Exscript/AccountManager.py
index <HASH>..<HASH> 100644
--- a/src/Exscript/AccountManager.py
+++ b/src/Exscript/AccountManager.py
@@ -32,7 +32,7 @@ class AccountManager(object):
def reset(self):
self.default_pool.reset()
- for pool in self.pools:
+ for match, pool in self.pools:
pool.reset()
self.pools = []
@@ -120,7 +120,7 @@ class AccountManager(object):
@return: The account that was acquired.
"""
if account is not None:
- for pool in self.pools:
+ for match, pool in self.pools:
if pool.has_account(account):
return pool.acquire_account(account) | Exscript.AccountManager.reset(), .acquire_account(): fix: did not work for non-default pools. | knipknap_exscript | train | py |
ee4b5494412707b98b0874d7a08bdba30a8980ae | diff --git a/tcMenuGenerator/src/test/java/com/thecoderscorner/menu/editorui/generator/input/InputTypeTest.java b/tcMenuGenerator/src/test/java/com/thecoderscorner/menu/editorui/generator/input/InputTypeTest.java
index <HASH>..<HASH> 100644
--- a/tcMenuGenerator/src/test/java/com/thecoderscorner/menu/editorui/generator/input/InputTypeTest.java
+++ b/tcMenuGenerator/src/test/java/com/thecoderscorner/menu/editorui/generator/input/InputTypeTest.java
@@ -66,7 +66,7 @@ public class InputTypeTest {
"#define ENCODER_OK_PIN 3\n", creator.getExportDefinitions());
assertEquals(" switches.initialise(io8574, false);\n" +
- " menuMgr.initForUpDownOk(&renderer, &root, ENCODER_PIN_UP, ENCODER_PIN_DOWN, ENCODER_BUTTON_PIN);",
+ " menuMgr.initForUpDownOk(&renderer, &root, ENCODER_UP_PIN, ENCODER_DOWN_PIN, ENCODER_OK_PIN);",
creator.getSetupCode("root"));
assertEquals("", creator.getGlobalVariables());
assertThat(creator.getRequiredFiles()).isEmpty(); | Ensure that encoder for up/down matches define | davetcc_tcMenu | train | java |
dbd71edc70e74ce0efe130ece349fcea7c7356d3 | diff --git a/round.js b/round.js
index <HASH>..<HASH> 100644
--- a/round.js
+++ b/round.js
@@ -365,12 +365,12 @@ function getAllCoinbaseRatioByRoundIndex(conn, roundIndex, callback){
throw Error("wrong trustme unit exit ");
if(row.address === constants.FOUNDATION_ADDRESS) // except foundation supernode
continue;
- if(addressTrustMeWl[row.address] && row.witnessed_level - addressTrustMeWl[row.address] <= constants.MIN_INTERVAL_WL_OF_TRUSTME)
+ if(addressTrustMeWl[row.address] != null && row.witnessed_level - addressTrustMeWl[row.address] <= constants.MIN_INTERVAL_WL_OF_TRUSTME)
continue;
addressTrustMeWl[row.address] = row.witnessed_level;
totalCountOfTrustMe++;
- if(!witnessRatioOfTrustMe[row.address])
+ if(witnessRatioOfTrustMe[row.address] === null)
witnessRatioOfTrustMe[row.address]=1;
else
witnessRatioOfTrustMe[row.address]++; | fixed a bug of coinbase amount | trustnote_trustnote-pow-common | train | js |
86b0e730ab59f4e57f0443e09b32200a86e84ce6 | diff --git a/lib/primary.rb b/lib/primary.rb
index <HASH>..<HASH> 100644
--- a/lib/primary.rb
+++ b/lib/primary.rb
@@ -32,7 +32,7 @@ module Primary
end
def get_primary_scope(options)
- check = self.class.where("#{options[:on].to_s} = ?", true)
+ check = self.class.default_scoped.where("#{options[:on].to_s} = ?", true)
if options[:scope]
sc = options[:scope]
if sc.is_a?(Symbol) or sc.is_a?(String) | Add default_scoped call to prevent deprecation warnings | prograils_primary | train | rb |
c358425c2432fdbee47a9ada0d2023e40b4926cc | diff --git a/isort/api.py b/isort/api.py
index <HASH>..<HASH> 100644
--- a/isort/api.py
+++ b/isort/api.py
@@ -62,10 +62,10 @@ def check_imports(file_contents: str, show_diff: bool=False, extension: str = "p
if compare_out == compare_in:
if config.verbose:
- print(f"SUCCESS: {logging_file_path} Everything Looks Good!")
+ print(f"SUCCESS: {file_path} Everything Looks Good!")
return True
else:
- print(f"ERROR: {logging_file_path} Imports are incorrectly sorted.")
+ print(f"ERROR: {file_path} Imports are incorrectly sorted.")
if show_diff:
show_unified_diff(
file_input=file_contents, file_output=sorted_output, file_path=file_path | Fix logging statuments to include correct file path | timothycrosley_isort | train | py |
ebe9b7911ff3e1870df766ffb98b4f0c3b8e8822 | diff --git a/src/AuditableTrait.php b/src/AuditableTrait.php
index <HASH>..<HASH> 100644
--- a/src/AuditableTrait.php
+++ b/src/AuditableTrait.php
@@ -111,7 +111,7 @@ trait AuditableTrait
public function getCreatedByNameAttribute()
{
if ($this->{$this->getCreatedByColumn()}) {
- return $this->creator->first_name . ' ' . $this->creator->last_name;
+ return $this->creator->name;
}
return '';
@@ -125,7 +125,7 @@ trait AuditableTrait
public function getUpdatedByNameAttribute()
{
if ($this->{$this->getUpdatedByColumn()}) {
- return $this->updater->first_name . ' ' . $this->updater->last_name;
+ return $this->updater->name;
}
return '';
@@ -139,7 +139,7 @@ trait AuditableTrait
public function getDeletedByNameAttribute()
{
if ($this->{$this->getDeletedByColumn()}) {
- return $this->deleter->first_name . ' ' . $this->deleter->last_name;
+ return $this->deleter->name;
}
return ''; | Use name attribute.
Note: add name getter to present first & last name if needed. | yajra_laravel-auditable | train | php |
b7656686bd5379ecab544fc0ec1fd4e474057277 | diff --git a/core-bundle/src/Resources/contao/classes/Backend.php b/core-bundle/src/Resources/contao/classes/Backend.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/classes/Backend.php
+++ b/core-bundle/src/Resources/contao/classes/Backend.php
@@ -556,7 +556,10 @@ abstract class Backend extends \Controller
$this->Template->headline .= ' » ' . $objRow->name;
}
- $this->Template->headline .= ' » ' . $GLOBALS['TL_LANG']['MOD'][$strSecond];
+ if (isset($GLOBALS['TL_LANG']['MOD'][$strSecond]))
+ {
+ $this->Template->headline .= ' » ' . $GLOBALS['TL_LANG']['MOD'][$strSecond];
+ }
// Add the second level name
$objRow = $this->Database->prepare("SELECT * FROM $strSecond WHERE id=?") | [Core] Check the module name before adding it to the back end breadcrumb (see #<I>). | contao_contao | train | php |
2b9c55b3224ab46199612f99311b5007f69504b7 | diff --git a/tests/Cache/CacheFileStoreTest.php b/tests/Cache/CacheFileStoreTest.php
index <HASH>..<HASH> 100755
--- a/tests/Cache/CacheFileStoreTest.php
+++ b/tests/Cache/CacheFileStoreTest.php
@@ -74,6 +74,7 @@ class CacheFileStoreTest extends PHPUnit_Framework_TestCase {
$store->forever('foo', 'Hello World', 10);
}
+
public function testRemoveDeletesFileDoesntExist()
{
$files = $this->mockFilesystem();
@@ -84,6 +85,7 @@ class CacheFileStoreTest extends PHPUnit_Framework_TestCase {
$store->forget('foobull');
}
+
public function testRemoveDeletesFile()
{
$files = $this->mockFilesystem();
@@ -96,6 +98,7 @@ class CacheFileStoreTest extends PHPUnit_Framework_TestCase {
$store->forget('foobar');
}
+
public function testFlushCleansDirectory()
{
$files = $this->mockFilesystem(); | Double space methods for continuity :wink: | laravel_framework | train | php |
de51aa9e7deaaf0a3a039b4041225fd0e0513e3b | diff --git a/src/mixins/comparable.js b/src/mixins/comparable.js
index <HASH>..<HASH> 100644
--- a/src/mixins/comparable.js
+++ b/src/mixins/comparable.js
@@ -1,6 +1,7 @@
import { deepEqual } from '../util/helpers'
export default {
+ name: 'comparable',
props: {
valueComparator: {
type: Function, | chore(api): add name to comparable mixin | vuetifyjs_vuetify | train | js |
09af40b609b1cd85e5c4de167bcb723820de471c | diff --git a/lib/events/eventParser.js b/lib/events/eventParser.js
index <HASH>..<HASH> 100644
--- a/lib/events/eventParser.js
+++ b/lib/events/eventParser.js
@@ -119,7 +119,7 @@ EventParser._parseZoneGroupTopologyEvent = async function (body, device) {
eventData[firstKey] = element[firstKey]
}
}
- if (eventData.ZoneGroupState) {
+ if (eventData.ZoneGroupState) {
const zoneGroup = eventData.ZoneGroupState.ZoneGroups.ZoneGroup
if (Array.isArray(zoneGroup)) {
eventData.Zones = zoneGroup.map(zone => { return new SonosGroup(zone) }) | lint: Remove trailing spaces | bencevans_node-sonos | train | js |
4ba3a290b888593c76f7d7221636af594724c7e1 | diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Events.js
+++ b/lib/OpenLayers/Events.js
@@ -91,11 +91,11 @@ OpenLayers.Events.prototype = {
* methods of the Bounds object through the "this" variable. So our
* callback could execute something like:
*
- * alert("Left: " + this.left);
+ * leftStr = "Left: " + this.left;
*
* or
*
- * alert("Center: " + this.getCenterLonLat());
+ * centerStr = "Center: " + this.getCenterLonLat();
*
*/
register: function (type, obj, func) { | change these alerts so as not to confuse ourselves when grepping for alerts to remove debugging code. :-)
git-svn-id: <URL> | openlayers_openlayers | train | js |
852dd4e4d74e12c27f03f98773cd5e169bfa7952 | diff --git a/src/com/google/javascript/jscomp/testing/TypeSubject.java b/src/com/google/javascript/jscomp/testing/TypeSubject.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/testing/TypeSubject.java
+++ b/src/com/google/javascript/jscomp/testing/TypeSubject.java
@@ -95,6 +95,6 @@ public final class TypeSubject extends Subject<TypeSubject, TypeI> {
}
public void toStringIsEqualTo(String typeString) {
- assertEquals(actual().toString(), typeString);
+ assertEquals(typeString, actual().toString());
}
} | Switch order of toStringIsEqualTo in TypeSubject so that error messages makes
sense.
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
b28b98d4e689f35fe37e1f84302a10f863c8614c | diff --git a/spec/unit/memory_leak_spec.rb b/spec/unit/memory_leak_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/memory_leak_spec.rb
+++ b/spec/unit/memory_leak_spec.rb
@@ -1,11 +1,11 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
+require 'spec_helper'
describe "state machines" do
def number_of_objects(clazz)
ObjectSpace.each_object(clazz) {}
end
-
+
def machines
AASM::StateMachine.instance_variable_get("@machines")
end
@@ -27,6 +27,7 @@ describe "state machines" do
load File.expand_path(File.dirname(__FILE__) + '/../models/not_auto_loaded/process.rb')
machines.size.should == machines_count + 1 # + Process
number_of_objects(AASM::SupportingClasses::State).should == state_count + 3 # + Process
+ ObjectSpace.each_object(AASM::SupportingClasses::Event) {|o| puts o.inspect}
number_of_objects(AASM::SupportingClasses::Event).should == event_count + 2 # + Process
number_of_objects(AASM::SupportingClasses::StateTransition).should == transition_count + 2 # + Process
end | trying to understand, why Travis with Ruby <I> keeps failing | aasm_aasm | train | rb |
d8879066d191aabbc8d1b4c83db346ef4243a59c | diff --git a/examples/my-element/my-element.js b/examples/my-element/my-element.js
index <HASH>..<HASH> 100644
--- a/examples/my-element/my-element.js
+++ b/examples/my-element/my-element.js
@@ -22,7 +22,7 @@ window.customElements.define(componentName, class extends webComponentBaseClass
type: String, // (required) the type of the property, one of Array, Boolean, Number, Object, String
value: 'value', // (optional) default value for the property
reflectToAttribute: true, // (optional) indicate if you want the component attribute to always reflect the current property value
- observer: changeHandlerKey, // (optional) the name or symbol of a function in the class to be called when the value of the property is changed
+ observer: changeHandlerKey, // (optional) the name or symbol of a function or a function object in the class to be called when the value of the property is changed
},
// add as many properties as you need
}; | change example to use symbol to make handler more private | virtualcodewarrior_webComponentBaseClass | train | js |
89cff663a2f6e0c59a1a5d801a928f5daa6138a5 | diff --git a/steam/items.py b/steam/items.py
index <HASH>..<HASH> 100644
--- a/steam/items.py
+++ b/steam/items.py
@@ -453,8 +453,6 @@ class item(object):
finalres = []
ranktypes = self._schema.get_kill_types()
- if not ranktypes:
- return []
for attr in self:
for name, spec in eaterspecs.iteritems():
@@ -478,7 +476,7 @@ class item(object):
for k in sorted(eaters.keys()):
eater = eaters[k]
- rank = ranktypes[eater.get("type", 0)]
+ rank = ranktypes.get(eater.get("type", 0), {"level_data": "KillEaterRanks", "type_name": "Kills"})
finalres.append((rank["level_data"], rank["type_name"], eater.get("count"), eater["aid"]))
return finalres
@@ -501,7 +499,10 @@ class item(object):
else: eaterlines = eaterlines[0]
ranksets = self._schema.get_kill_ranks()
- rankset = ranksets[eaterlines[0]]
+ try:
+ rankset = ranksets[eaterlines[0]]
+ except KeyError:
+ rankset = [{"level": 0, "required_score": 0, "name": "Strange"}]
realranknum = eaterlines[2]
for rank in rankset:
self._rank = rank | Add default rank for kill eaters without associated types | Lagg_steamodd | train | py |
76ea9f9714ff08cfffec16fc3672480a9f46f5d9 | diff --git a/activerecord/test/cases/scoping/relation_scoping_test.rb b/activerecord/test/cases/scoping/relation_scoping_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/scoping/relation_scoping_test.rb
+++ b/activerecord/test/cases/scoping/relation_scoping_test.rb
@@ -11,6 +11,10 @@ require 'models/reference'
class RelationScopingTest < ActiveRecord::TestCase
fixtures :authors, :developers, :projects, :comments, :posts, :developers_projects
+ setup do
+ developers(:david)
+ end
+
def test_reverse_order
assert_equal Developer.order("id DESC").to_a.reverse, Developer.order("id DESC").reverse_order
end | Make sure that fixtures are loaded before finding | rails_rails | train | rb |
1267f17281227bdb181691ab90f4f39887bbe4bd | diff --git a/cluster_query.go b/cluster_query.go
index <HASH>..<HASH> 100644
--- a/cluster_query.go
+++ b/cluster_query.go
@@ -119,7 +119,9 @@ func (c *Cluster) executeN1qlQuery(n1qlEp string, opts map[string]interface{}, c
opts["timeout"] = timeout.String()
}
- opts["creds"] = creds
+ if len(creds) > 1 {
+ opts["creds"] = creds
+ }
reqJson, err := json.Marshal(opts)
if err != nil {
@@ -132,6 +134,10 @@ func (c *Cluster) executeN1qlQuery(n1qlEp string, opts map[string]interface{}, c
}
req.Header.Set("Content-Type", "application/json")
+ if len(creds) == 1 {
+ req.SetBasicAuth(creds[0].Username, creds[0].Password)
+ }
+
resp, err := doHttpWithTimeout(client, req, timeout)
if err != nil {
return nil, err | Use HTTP basic auth if only one credential is passed for N1QL querying.
There is a bug in the N1QL request parser which causes values
passed to the `creds` option to error when sent via POST.
Change-Id: Idd2a<I>fab<I>c<I>db3d<I>b1bbc8cc8d6ee
Reviewed-on: <URL> | couchbase_gocb | train | go |
58a263e82aba8be36c9b972733555d818c15e536 | diff --git a/src/pyiso/utils.py b/src/pyiso/utils.py
index <HASH>..<HASH> 100644
--- a/src/pyiso/utils.py
+++ b/src/pyiso/utils.py
@@ -167,8 +167,7 @@ def normpath(path):
for comp in comps:
if comp in (empty, dot):
continue
- if (comp != dotdot or (not initial_slashes and not new_comps) or
- (new_comps and new_comps[-1] == dotdot)):
+ if comp != dotdot or (not initial_slashes and not new_comps) or (new_comps and new_comps[-1] == dotdot):
new_comps.append(comp)
elif new_comps:
new_comps.pop() | Fix minor pylint issue. | clalancette_pycdlib | train | py |
261d0c9ca3988b5b843e99468e2b0ea7cefa01c8 | diff --git a/src/Robo/Commands/Setup/SettingsCommand.php b/src/Robo/Commands/Setup/SettingsCommand.php
index <HASH>..<HASH> 100644
--- a/src/Robo/Commands/Setup/SettingsCommand.php
+++ b/src/Robo/Commands/Setup/SettingsCommand.php
@@ -66,7 +66,6 @@ class SettingsCommand extends BltTasks {
$project_local_drush_file = "$multisite_dir/local.drushrc.php";
$copy_map = [
- $default_project_default_settings_file => $project_default_settings_file,
$blt_local_settings_file => $default_local_settings_file,
$default_local_settings_file => $project_local_settings_file,
$blt_local_drush_file => $default_local_drush_file,
@@ -74,9 +73,13 @@ class SettingsCommand extends BltTasks {
];
// Only add the settings file if the default exists.
- if (file_exists($project_default_settings_file)) {
+ if (file_exists($default_project_default_settings_file)) {
+ $copy_map[$default_project_default_settings_file] = $project_default_settings_file;
$copy_map[$project_default_settings_file] = $project_settings_file;
}
+ else {
+ $this->logger->warning("No $default_project_default_settings_file file found.");
+ }
$task = $this->taskFilesystemStack()
->stopOnFail() | Updating settings command. (#<I>)
* Updating settings command.
* Update to use logger instead of yell(). | acquia_blt | train | php |
38143eddd61d8f84321e6a1baf441d4b21fbeed6 | diff --git a/app/lib/quasar-config.js b/app/lib/quasar-config.js
index <HASH>..<HASH> 100644
--- a/app/lib/quasar-config.js
+++ b/app/lib/quasar-config.js
@@ -475,7 +475,7 @@ class QuasarConfig {
cfg.build.distDir = path.join(cfg.build.distDir, 'UnPackaged')
}
else if (this.ctx.mode.tauri) {
- cfg.build.distDir = appPaths.resolve.app('src-tauri/target/compiled-web')
+ cfg.build.distDir = appPaths.resolve.tauri('target/compiled-web')
}
cfg.build.publicPath = | chore(app) dont use src-tauri on path resolution | quasarframework_quasar | train | js |
bdc900079b3b4ff8c4c1cd60f675391771216ec2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -785,7 +785,6 @@ function _runNext(_runBucket) {
});
} else if (_runBucket.running <= 0) { // Empting bucket
_runBucket.callback.call(this);
- // _runBucket.callback();
}
}
@@ -802,8 +801,10 @@ function _runNextFinish(_runBucket, err) {
_runBucket.running = 0;
_runBucket.callback(err);
} else {
- this._runNext(_runBucket);
- // setImmediate(this._runNext);
+ var self = this;
+ setImmediate(function() {
+ self._runNext(_runBucket);
+ });
}
}
// }}} | _run now uses setImmediate to queue up large numbers of functions to run | hash-bang_async-chainable | train | js |
eefb4d42b84372ee1e0a4333c4220d93c7a3e8e3 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -49,7 +49,7 @@ export default {
deactivate(): void {
const helpers = require('atom-linter');
- console.log('deactivating... lintet-flow');
+ console.log('deactivating... linter-flow');
helpers.exec(this.pathToFlow, ['stop'], {}).catch(() => null);
this.subscriptions.dispose();
},
@@ -73,11 +73,7 @@ export default {
const fileText = TextEditor.buffer.cachedText;
// Is flow enabled for current file ?
- const firstComStart = fileText.indexOf('\/*');
- const firstComEnd = fileText.indexOf('*\/');
- if (firstComStart !== -1 &&
- firstComEnd !== -1 &&
- fileText.slice(firstComStart + 2, firstComEnd).indexOf('@flow') === -1) {
+ if (!fileText || fileText.indexOf('@flow') === -1) {
return Promise.resolve([]);
} | revert(flow-comment-detection): revert back to simple @flow detecting to fix regressions | AtomLinter_linter-flow | train | js |
75bc7ac6ded44339ae4a09618e4bf046b4b8fc91 | diff --git a/glue/LDBDWServer.py b/glue/LDBDWServer.py
index <HASH>..<HASH> 100644
--- a/glue/LDBDWServer.py
+++ b/glue/LDBDWServer.py
@@ -148,11 +148,11 @@ class Server(object):
self.configuration = configuration
# define dispatches
- mySelector.add('/LDBD/ping[.{format}]', POST=self.ping, GET=self.ping)
- mySelector.add('/LDBD/query[.{format}]', POST=self.query)
- mySelector.add('/LDBD/insert[.{format}]', POST=self.insert)
- mySelector.add('/LDBD/insertmap[.{format}]', POST=self.insertmap)
- mySelector.add('/LDBD/insertdmt[.{format}]', POST=self.insertdmt)
+ mySelector.add('/ldbd/ping[.{format}]', POST=self.ping, GET=self.ping)
+ mySelector.add('/ldbd/query[.{format}]', POST=self.query)
+ mySelector.add('/ldbd/insert[.{format}]', POST=self.insert)
+ mySelector.add('/ldbd/insertmap[.{format}]', POST=self.insertmap)
+ mySelector.add('/ldbd/insertdmt[.{format}]', POST=self.insertdmt)
def __call__(self, environ, start_response):
""" | make ldbdw server urls lower case | gwastro_pycbc-glue | train | py |
ebb24d91296f2be468a38867423df83472af8288 | diff --git a/lib/specinfra/command/module/ss.rb b/lib/specinfra/command/module/ss.rb
index <HASH>..<HASH> 100644
--- a/lib/specinfra/command/module/ss.rb
+++ b/lib/specinfra/command/module/ss.rb
@@ -24,10 +24,18 @@ module Specinfra
def command_options(protocol)
case protocol
- when /\Atcp/
- "-tnl"
+ when /\Atcp/
+ if protocol == 'tcp'
+ "-tnl4"
+ else
+ "-tnl6"
+ end
when /\Audp/
- "-unl"
+ if protocol == 'udp'
+ "-unl4"
+ else
+ "-unl6"
+ end
else
"-tunl"
end | Distinguish between IPv4 and IPv6 lookups | mizzy_specinfra | train | rb |
71b2b6ca1932f388fe435802a5f46d5b37d3bbb4 | diff --git a/push_notifications/gcm.py b/push_notifications/gcm.py
index <HASH>..<HASH> 100644
--- a/push_notifications/gcm.py
+++ b/push_notifications/gcm.py
@@ -141,6 +141,6 @@ def gcm_send_bulk_message(registration_ids, data, collapse_key=None, delay_while
ret = []
for chunk in _chunks(registration_ids, max_recipients):
ret.append(_gcm_send_json(chunk, *args))
- return "\n".join(ret)
+ return ret
return _gcm_send_json(registration_ids, *args) | fix return value when gcm bulk is split in batches | jazzband_django-push-notifications | train | py |
2966976bb44c4c0b27b31b0a526a711b47bb97cf | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1129,6 +1129,17 @@ function DiscordClient(options) {
});
});
}
+ self.queryInvite = function(inviteCode, callback) {
+ checkRS(function() {
+ request.get({
+ url: "https://discordapp.com/api/invite/" + inviteCode
+ }, function(err, res, body) {
+ if (err || !checkStatus(res)) console.log("Unable to get invite information: " + checkError(res, body));
+ try { body = JSON.parse(body) } catch(e) {};
+ if (typeof(callback) === 'function') return callback(body);
+ });
+ });
+ }
self.createChannel = function(input, callback) {
checkRS(function() { | Created 'queryInvite'
Gets immediate invite information | izy521_discord.io | train | js |
852ea7d8d84f15341ffd026915d4585ba1b0bb1f | diff --git a/modules/cms/twig/DebugExtension.php b/modules/cms/twig/DebugExtension.php
index <HASH>..<HASH> 100644
--- a/modules/cms/twig/DebugExtension.php
+++ b/modules/cms/twig/DebugExtension.php
@@ -1,5 +1,6 @@
<?php namespace Cms\Twig;
+use Twig_Template;
use Twig_Extension;
use Twig_Environment;
use Twig_SimpleFunction; | Added missing use statement (#<I>)
Credit to @tschallacka | octobercms_october | train | php |
ce56c879544da2ca34c51ce1a03d8f8eef7cb603 | diff --git a/test/09-vulnerable-dependencies.spec.js b/test/09-vulnerable-dependencies.spec.js
index <HASH>..<HASH> 100644
--- a/test/09-vulnerable-dependencies.spec.js
+++ b/test/09-vulnerable-dependencies.spec.js
@@ -449,7 +449,10 @@ describe('Vulnerability validation', () => {
})
.catch((err) => {
showValidationErrors(err);
- err.message.should.containEql(jsonParseErrorMessage);
+ err.message.should.containEql(jsonParseErrorMessage) ||
+ err.message.should.containEql(
+ 'Command failed: npm audit'
+ );
})
);
}); | test(vulnerable-dependencies): fix a weird side effect due to removal of 'ban-sensitive-files' and 'globby' dependencies | inikulin_publish-please | train | js |
a6152db84adfb7e9b64c16826aad73d5be91cb28 | diff --git a/src/_pytest/setuponly.py b/src/_pytest/setuponly.py
index <HASH>..<HASH> 100644
--- a/src/_pytest/setuponly.py
+++ b/src/_pytest/setuponly.py
@@ -22,8 +22,7 @@ def pytest_addoption(parser):
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_setup(fixturedef, request):
yield
- config = request.config
- if config.option.setupshow:
+ if request.config.option.setupshow:
if hasattr(request, "param"):
# Save the fixture parameter so ._show_fixture_action() can
# display it now and during the teardown (in .finish()). | setuponly: pytest_fixture_setup: use option directly | pytest-dev_pytest | train | py |
30487192ad84c9a6a60ac3bcf992c10c9b6177e0 | diff --git a/junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/servers/AbstractEmbeddedServer.java b/junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/servers/AbstractEmbeddedServer.java
index <HASH>..<HASH> 100644
--- a/junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/servers/AbstractEmbeddedServer.java
+++ b/junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/servers/AbstractEmbeddedServer.java
@@ -97,8 +97,8 @@ public abstract class AbstractEmbeddedServer<S extends Object, T extends Abstrac
synchronized (lock) {
if (status != ServerStatus.STOPPED) {
status = ServerStatus.STOPPING;
- doStop();
execHooks(false);
+ doStop();
destroyEnvironment();
status = ServerStatus.STOPPED;
} | According to javadoc Hook.post(EmbeddedServer) should be called before the server stops, but is called after. The execHooks(false) should be called before doStop(). | mjeanroy_junit-servers | train | java |
63c831f88c899fa746f10975330860f1be54ecc9 | diff --git a/lang/fr/admin.php b/lang/fr/admin.php
index <HASH>..<HASH> 100755
--- a/lang/fr/admin.php
+++ b/lang/fr/admin.php
@@ -3,8 +3,9 @@
$string['adminseesallevents'] = 'Les administrateurs voient tous les �v�nements';
$string['adminseesownevents'] = 'Les administrateurs sont comme tous les autres utilisateurs';
$string['backgroundcolour'] = 'Couleur transparente';
-$string['badwordsconfig'] = 'Taper ici votre liste de mots � censurer, s�par�s par des virgules';
-$string['badwordslist'] = 'Liste des mots � censurer';
+$string['badwordsconfig'] = 'Taper ici votre liste de mots � censurer, s�par�s par des virgules.';
+$string['badwordsdefault'] = 'Si votre liste de mots � censurer est vide, une liste de mots tir�e du fichier de langue sera utilis�e.';
+$string['badwordslist'] = 'Votre liste de mots � censurer';
$string['blockinstances'] = 'Instances';
$string['blockmultiple'] = 'Multiple';
$string['cachetext'] = 'Dur�e de vie du cache texte'; | New string (badwordsdefault) and couple of edits to do with censor filter. | moodle_moodle | train | php |
cd803d5a7a06c1afdb8abd739cbd980af2d6932a | diff --git a/progressbar/utils.py b/progressbar/utils.py
index <HASH>..<HASH> 100644
--- a/progressbar/utils.py
+++ b/progressbar/utils.py
@@ -26,10 +26,12 @@ class WrappingIO:
else:
self.target.write(value)
- def flush(self):
- self.target.write(self.buffer.getvalue())
- self.buffer.seek(0)
- self.buffer.truncate(0)
+ def _flush(self):
+ value = self.buffer.getvalue()
+ if value:
+ self.target.write(value)
+ self.buffer.seek(0)
+ self.buffer.truncate(0)
class StreamWrapper(object):
@@ -128,7 +130,7 @@ class StreamWrapper(object):
def flush(self):
if self.wrapped_stdout: # pragma: no branch
try:
- self.stdout.flush()
+ self.stdout._flush()
except (io.UnsupportedOperation,
AttributeError): # pragma: no cover
self.wrapped_stdout = False
@@ -137,7 +139,7 @@ class StreamWrapper(object):
if self.wrapped_stderr: # pragma: no branch
try:
- self.stderr.flush()
+ self.stderr._flush()
except (io.UnsupportedOperation,
AttributeError): # pragma: no cover
self.wrapped_stderr = False | fixed output redirection for the python logging. fixes #<I>, again | WoLpH_python-progressbar | train | py |
4a43ca2a1eeef94691e094e04133377817151043 | diff --git a/test/connection.test.js b/test/connection.test.js
index <HASH>..<HASH> 100644
--- a/test/connection.test.js
+++ b/test/connection.test.js
@@ -480,6 +480,11 @@ test('transaction', async () => {
result: 31,
},
]);
+ if (!mockRpcEnabled) {
+ // Credit-only account credits are committed at the end of every slot;
+ // this sleep is to ensure a full slot has elapsed
+ await sleep((1000 * DEFAULT_TICKS_PER_SLOT) / NUM_TICKS_PER_SECOND);
+ }
expect(await connection.getBalance(accountTo.publicKey)).toBe(31);
}); | fix: fix transaction live test for credit-only accounts (#<I>) | solana-labs_solana-web3.js | train | js |
61781784913e63327ae2a10d007de69575c0b7dd | diff --git a/tests/providers/test_python.py b/tests/providers/test_python.py
index <HASH>..<HASH> 100644
--- a/tests/providers/test_python.py
+++ b/tests/providers/test_python.py
@@ -54,7 +54,7 @@ class TestPyfloat(unittest.TestCase):
result = self.factory.pyfloat(right_digits=expected_right_digits)
- right_digits = len(str(result).split('.')[1])
+ right_digits = len(('%r' % result).split('.')[1])
self.assertGreaterEqual(expected_right_digits, right_digits)
def test_positive(self): | fix float test (#<I>) | joke2k_faker | train | py |
422ce5d5a950aa064b13929949b2365e2f70600d | diff --git a/spec/govuk_message_queue_consumer/test_helpers/mock_message_spec.rb b/spec/govuk_message_queue_consumer/test_helpers/mock_message_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/govuk_message_queue_consumer/test_helpers/mock_message_spec.rb
+++ b/spec/govuk_message_queue_consumer/test_helpers/mock_message_spec.rb
@@ -1,7 +1,7 @@
require "spec_helper"
require "govuk_message_queue_consumer/test_helpers"
-describe GovukMessageQueueConsumer::MockMessage do
+describe GovukMessageQueueConsumer::MockMessage do # rubocop:disable RSpec/FilePath
describe "#methods" do
it "implements the same methods as Message" do
mock = described_class.new | Ignore Rspec/FilePath violation
This violation is caused by Rubocop expecting this class to follow a
namespace that matches the class name, which would be the idiomatic way
to organise these files.
Unfortunately the decision was made a while ago to add the test_helpers
directory to lib without a corresponding namespace and changing this
would be a breaking change, which seems unnecessary to resolve for a
linting problem. | alphagov_govuk_message_queue_consumer | train | rb |
00bb5455363c52ec7fee0b9756fdaa015d8ef09e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,8 +31,10 @@ setup(
'requests',
'six',
'oauthlib',
- 'requests_oauthlib'
- ] + (['kerberos-sspi'] if "win32" in sys.platform else ['kerberos']),
+ 'requests_oauthlib',
+ 'kerberos-sspi;platform_system=="Windows"',
+ 'kerberos;platform_system!="Windows"'
+ ],
platforms='Platform Independent',
classifiers=[ | Update setup.py
Changed sys.platform to platform_system. | atlassian-api_atlassian-python-api | train | py |
7302c7cf0e4f3beb644cecdd2b7f59254ec76439 | diff --git a/lib/Drivers/DML/sqlite.js b/lib/Drivers/DML/sqlite.js
index <HASH>..<HASH> 100644
--- a/lib/Drivers/DML/sqlite.js
+++ b/lib/Drivers/DML/sqlite.js
@@ -14,7 +14,11 @@ function Driver(config, connection, opts) {
// on Windows, paths have a drive letter which is parsed by
// url.parse() as the hostname. If host is defined, assume
// it's the drive letter and add ":"
- this.db = new sqlite3.Database(((config.host ? config.host + ":" : "") + (config.pathname || "")) || ':memory:');
+ if (process.platform == "win32" && config.host.match(/^[a-z]$/i)) {
+ this.db = new sqlite3.Database(((config.host ? config.host + ":" : "") + (config.pathname || "")) || ':memory:');
+ } else {
+ this.db = new sqlite3.Database(((config.host ? config.host : "") + (config.pathname || "")) || ':memory:');
+ }
}
this.aggregate_functions = [ "ABS", "ROUND", | Changes the way ":" is added to sqlite db paths (#<I>)
1. Only add on win<I> platforms
2. Only add if host is a letter
The only case this can't avoid (right now) is realtive paths where the
first folder is a letter. Please avoid it. | dresende_node-orm2 | train | js |
0aa880e773aec77b1383f9df04cf40702a07919a | diff --git a/plugins/CoreConsole/Commands/SyncUITestScreenshots.php b/plugins/CoreConsole/Commands/SyncUITestScreenshots.php
index <HASH>..<HASH> 100644
--- a/plugins/CoreConsole/Commands/SyncUITestScreenshots.php
+++ b/plugins/CoreConsole/Commands/SyncUITestScreenshots.php
@@ -78,5 +78,31 @@ class SyncUITestScreenshots extends ConsoleCommand
PIWIK_DOCUMENT_ROOT . "/" . $downloadTo);
}
}
+
+ $this->displayGitInstructions($output);
+
+ }
+
+ /**
+ * @param OutputInterface $output
+ */
+ protected function displayGitInstructions(OutputInterface $output)
+ {
+ $output->writeln('');
+ $output->writeln('--------------');
+ $output->writeln('');
+ $output->writeln("If all downloaded screenshots are valid you may push them with these commands:");
+ $output->writeln('');
+ $commands = "cd tests/PHPUnit/UI/
+git add expected-ui-screenshots/
+git pull
+git commit -m'' # WRITE A COMMIT MESSAGE
+git push
+cd ..
+git add UI
+git commit -m'' #WRITE A COMMIT MESSAGE
+git pull
+git push";
+ $output->writeln($commands);
}
} | Display instructions on how to fix a UI tests build at the end of the console command output | matomo-org_matomo | train | php |
02ff05bcb481cc7b841d66ea7bcd83377373da03 | diff --git a/src/Transport/CurlerRequest.php b/src/Transport/CurlerRequest.php
index <HASH>..<HASH> 100644
--- a/src/Transport/CurlerRequest.php
+++ b/src/Transport/CurlerRequest.php
@@ -438,6 +438,12 @@ class CurlerRequest
return $this;
}
+ public function authByHeaders($username, $password)
+ {
+ $this->headers['X-ClickHouse-User'] = $username;
+ $this->headers['X-ClickHouse-Key'] = $password;
+ return $this;
+ }
/**
* @param array|string $data
* @return $this
diff --git a/src/Transport/Http.php b/src/Transport/Http.php
index <HASH>..<HASH> 100644
--- a/src/Transport/Http.php
+++ b/src/Transport/Http.php
@@ -191,7 +191,7 @@ class Http
private function newRequest($extendinfo)
{
$new = new CurlerRequest();
- $new->auth($this->_username, $this->_password)
+ $new->authByHeaders($this->_username, $this->_password)
->POST()
->setRequestExtendedInfo($extendinfo); | Use X-ClickHouse-User by headers | smi2_phpClickHouse | train | php,php |
a622bc1a96bf095b27416d210da64bdff7b85d41 | diff --git a/user/forum.php b/user/forum.php
index <HASH>..<HASH> 100644
--- a/user/forum.php
+++ b/user/forum.php
@@ -50,9 +50,16 @@ if ($forumform->is_cancelled()) {
$user->trackforums = $data->trackforums;
user_update_user($user, false, false);
+
// Trigger event.
\core\event\user_updated::create_from_userid($user->id)->trigger();
+ if ($USER->id == $user->id) {
+ $USER->maildigest = $data->maildigest;
+ $USER->autosubscribe = $data->autosubscribe;
+ $USER->trackforums = $data->trackforums;
+ }
+
redirect($redirect);
}
diff --git a/user/language.php b/user/language.php
index <HASH>..<HASH> 100644
--- a/user/language.php
+++ b/user/language.php
@@ -56,6 +56,10 @@ if ($languageform->is_cancelled()) {
// Trigger event.
\core\event\user_updated::create_from_userid($user->id)->trigger();
+ if ($USER->id == $user->id) {
+ $USER->lang = $lang;
+ }
+
redirect($redirect);
} | MDL-<I> core_user: Some preferences are not updated in $USER object | moodle_moodle | train | php,php |
853235b8df1bb49c4e1a1aff18010b9230e4b781 | diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -135,8 +135,8 @@ var SPDYProxy = function(options) {
console.log("%s:%s".yellow + " - %s - " + "stream ID: " + "%s".yellow + " - priority: " + "%s".yellow,
socket.connection ? socket.connection.socket.remoteAddress : socket.socket.remoteAddress,
socket.connection ? socket.connection.socket.remotePort : socket.socket.remotePort,
- req.method, res.id || socket._spdyState.id,
- res.priority || socket._spdyState.priority
+ req.method, res.id || (socket._spdyState && socket._spdyState.id) || "none",
+ res.priority || (socket._spdyState && socket._spdyState.priority) || "none"
);
// node-spdy forces chunked-encoding processing on inbound | Websocket request logging: tolerate absence of socket._spdyState. | igrigorik_node-spdyproxy | train | js |
33b927e682355d5b4e10f472f3254cf172bae8d9 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -168,7 +168,7 @@ function getImage (req, res, options) {
function buildReport (params) {
console.log('Sending to github')
- var markdownReport = JSON.parse(fs.readFileSync(process.env.REPORT_JSON_PATH))
+ var markdownReport = JSON.parse(fs.readFileSync('visual-acceptance-report/report.json'))
var markdownBody = '# Visual Acceptance Tests\n' + markdownReport.new + '\n' + markdownReport.changed
try {
if (process.env.REPORT_MARKDOWN_PATH) { | Change from env variable to string | ciena-blueplanet_ember-cli-visual-acceptance | train | js |
2764474dfd850f7c3170cc2bf6e5d59d756791b3 | diff --git a/client/src/index.js b/client/src/index.js
index <HASH>..<HASH> 100644
--- a/client/src/index.js
+++ b/client/src/index.js
@@ -384,7 +384,7 @@ class FindAll extends TermBase {
this._values = fieldValues
this._name = fieldName
this.query = Object.assign({}, query, {
- selection: {type: 'find', args: fieldValues},
+ selection: {type: 'find_all', args: fieldValues},
field_name: fieldName
})
}
@@ -412,7 +412,7 @@ class Find extends TermBase {
this._id = docId
this._fieldName = fieldName
this.query = Object.assign({}, query, {
- selection: {type: 'find_one', args: [docId]},
+ selection: {type: 'find', args: [docId]},
field_name: fieldName,
})
} | find_one -> find, find -> find_all in protocol | rethinkdb_horizon | train | js |
e33abde68dfa49723d24a0c1c332e78fe848043b | diff --git a/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisFreemarkerObjectWrapper.java b/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisFreemarkerObjectWrapper.java
index <HASH>..<HASH> 100644
--- a/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisFreemarkerObjectWrapper.java
+++ b/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisFreemarkerObjectWrapper.java
@@ -1,5 +1,7 @@
package org.molgenis.ui;
+import com.google.common.collect.Lists;
+
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
@@ -20,7 +22,7 @@ public class MolgenisFreemarkerObjectWrapper extends DefaultObjectWrapper
// Fix for https://github.com/molgenis/molgenis/issues/4227
// If a method returning an Iterable in some cases returns a List and in other cases a e.g. FluentIterable
// then it is unclear whether <#list iterable> or <#list iterable.iterator()> should be used.
- obj = ((Iterable<?>) obj).iterator();
+ obj = Lists.newArrayList(((Iterable<?>) obj));
}
return super.handleUnknownType(obj);
} | Store in list instead of passing along iterable | molgenis_molgenis | train | java |
94131516cf214ae885ff749f1cf674daf67f6966 | diff --git a/spec/notification_spec.rb b/spec/notification_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/notification_spec.rb
+++ b/spec/notification_spec.rb
@@ -684,7 +684,7 @@ describe Bugsnag::Notification do
begin
raise
rescue
- Bugsnag.notify($!, {context: invalid_data })
+ Bugsnag.notify($!, {:context => invalid_data })
end
expect(Bugsnag).to have_sent_notification do |payload|
@@ -746,8 +746,8 @@ describe Bugsnag::Notification do
Bugsnag.before_notify_callbacks << lambda do |notif|
notif.user = {
- email: "#{invalid_data}@foo.com",
- name: invalid_data
+ :email => "#{invalid_data}@foo.com",
+ :name => invalid_data
}
end | Use hash rocket for old rubies | bugsnag_bugsnag-ruby | train | rb |
cd07afdfbfa6b5d94f23137a8efd4f2970386a23 | diff --git a/service/dynamodb/dynamodbattribute/doc.go b/service/dynamodb/dynamodbattribute/doc.go
index <HASH>..<HASH> 100644
--- a/service/dynamodb/dynamodbattribute/doc.go
+++ b/service/dynamodb/dynamodbattribute/doc.go
@@ -57,4 +57,6 @@
// the json.Marshaler and json.Unmarshaler interfaces have been removed and
// replaced with have been replaced with dynamodbattribute.Marshaler and
// dynamodbattribute.Unmarshaler interfaces.
+//
+// `time.Time` is marshaled as RFC3339 format.
package dynamodbattribute | Updating docs to specify which time formats are supported. (#<I>) | aws_aws-sdk-go | train | go |
3fb76f3ebb659c4ea5d70708f2346fcf56cd9e82 | diff --git a/backend/local/backend_apply.go b/backend/local/backend_apply.go
index <HASH>..<HASH> 100644
--- a/backend/local/backend_apply.go
+++ b/backend/local/backend_apply.go
@@ -250,7 +250,8 @@ func (b *Local) opApply(
countHook.Removed)))
}
- if countHook.Added > 0 || countHook.Changed > 0 {
+ // only show the state file help message if the state is local.
+ if (countHook.Added > 0 || countHook.Changed > 0) && b.StateOutPath != "" {
b.CLI.Output(b.Colorize().Color(fmt.Sprintf(
"[reset]\n"+
"The state of your infrastructure has been saved to the path\n"+ | only show state path help if state is local | hashicorp_terraform | train | go |
259204fb893300451f3a23336741748eaebdb782 | diff --git a/test/tree_test.rb b/test/tree_test.rb
index <HASH>..<HASH> 100644
--- a/test/tree_test.rb
+++ b/test/tree_test.rb
@@ -2,8 +2,8 @@ require "test_helper"
context "Rugged::Tree tests" do
setup do
- path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
- @repo = Rugged::Repository.new(path)
+ @path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
+ @repo = Rugged::Repository.new(@path)
@oid = "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"
@tree = @repo.lookup(@oid)
end
@@ -65,6 +65,8 @@ context "Rugged::Tree tests" do
sha = builder.write(@repo)
obj = @repo.lookup(sha)
assert_equal 38, obj.read_raw.len
+
+ rm_loose(sha)
end
end | tree_test: remove loose tree left in the fixture
A tree with OID 7f<I>ea<I>ce<I>e<I>acaabf9e<I>c<I>b0
was present in the testrepo.git fixture after a test run.
Now the repo should remain in the same state as when the tests
started. | libgit2_rugged | train | rb |
fab51a19753cf8119bccfd6ae60a6314162ee317 | diff --git a/examples/bartlett1932/experiment.py b/examples/bartlett1932/experiment.py
index <HASH>..<HASH> 100644
--- a/examples/bartlett1932/experiment.py
+++ b/examples/bartlett1932/experiment.py
@@ -32,7 +32,7 @@ class Bartlett1932(Experiment):
net.add_source(source)
self.save()
- def add_node_to_network(self, participant_id, node, network):
+ def add_node_to_network(self, participant, node, network):
"""When an agent is created, add it to the network and take a step."""
network.add_node(node)
processes.random_walk(network) | bartlett: use the participant object, not its id | berkeley-cocosci_Wallace | train | py |
7b1a50f72e0c4b7dca817d9db36f54985312dc31 | diff --git a/src/extras/primitives/primitives/a-sky.js b/src/extras/primitives/primitives/a-sky.js
index <HASH>..<HASH> 100644
--- a/src/extras/primitives/primitives/a-sky.js
+++ b/src/extras/primitives/primitives/a-sky.js
@@ -7,7 +7,7 @@ registerPrimitive('a-sky', utils.extendDeep({}, getMeshMixin(), {
defaultComponents: {
geometry: {
primitive: 'sphere',
- radius: 5000,
+ radius: 500,
segmentsWidth: 64,
segmentsHeight: 32
},
diff --git a/src/extras/primitives/primitives/a-videosphere.js b/src/extras/primitives/primitives/a-videosphere.js
index <HASH>..<HASH> 100644
--- a/src/extras/primitives/primitives/a-videosphere.js
+++ b/src/extras/primitives/primitives/a-videosphere.js
@@ -6,7 +6,7 @@ registerPrimitive('a-videosphere', utils.extendDeep({}, getMeshMixin(), {
defaultComponents: {
geometry: {
primitive: 'sphere',
- radius: 5000,
+ radius: 500,
segmentsWidth: 64,
segmentsHeight: 32
}, | Reduce videosphere size to prevent far plane clipping in VR mode on Android devices (fix #<I>) | aframevr_aframe | train | js,js |
bac5bde38c7725990645cf9b2bf2c824594f3963 | diff --git a/docs_test.go b/docs_test.go
index <HASH>..<HASH> 100644
--- a/docs_test.go
+++ b/docs_test.go
@@ -53,6 +53,9 @@ func testApp() *App {
Usage: "retrieve generic information",
}, {
Name: "some-command",
+ }, {
+ Name: "hidden-command",
+ Hidden: true,
}}
app.UsageText = "app [first_arg] [second_arg]"
app.Usage = "Some app"
diff --git a/fish.go b/fish.go
index <HASH>..<HASH> 100644
--- a/fish.go
+++ b/fish.go
@@ -69,6 +69,10 @@ func (a *App) prepareFishCommands(commands []Command, allCommands *[]string, pre
for i := range commands {
command := &commands[i]
+ if command.Hidden {
+ continue
+ }
+
var completion strings.Builder
completion.WriteString(fmt.Sprintf(
"complete -r -c %s -n '%s' -a '%s'", | Don't generate fish completion for hidden commands
Added the missing test case as well. | urfave_cli | train | go,go |
fb264a4fb90e1199c7003a7c126151589193111c | diff --git a/src/arpa/models/simple.py b/src/arpa/models/simple.py
index <HASH>..<HASH> 100644
--- a/src/arpa/models/simple.py
+++ b/src/arpa/models/simple.py
@@ -16,7 +16,7 @@ class ARPAModelSimple(ARPAModel):
def add_entry(self, ngram, p, bo=None, order=None):
key = tuple(ngram)
self._ps[key] = p
- if bo:
+ if bo is not None:
self._bos[key] = bo
def counts(self): | fix: explicit 0 and <I> were dropped | sfischer13_python-arpa | train | py |
e6697e15b2876065daa9db513e24eacc5d5f7a94 | diff --git a/pyuploadcare/dj/conf.py b/pyuploadcare/dj/conf.py
index <HASH>..<HASH> 100644
--- a/pyuploadcare/dj/conf.py
+++ b/pyuploadcare/dj/conf.py
@@ -20,7 +20,7 @@ conf.pub_key = settings.UPLOADCARE['pub_key']
conf.secret = settings.UPLOADCARE['secret']
-widget_version = settings.UPLOADCARE.get('widget_version', '0.8')
+widget_version = settings.UPLOADCARE.get('widget_version', '0.8.1.2')
hosted_url = 'https://ucarecdn.com/widget/{version}/uploadcare/uploadcare-{version}.min.js'.format(
version=widget_version) | Update widget version in dj/conf | uploadcare_pyuploadcare | train | py |
b0003e2634c7c2962d0abe6ab9da464b401ef5c2 | diff --git a/python_modules/automation/automation/release/dagster_module.py b/python_modules/automation/automation/release/dagster_module.py
index <HASH>..<HASH> 100644
--- a/python_modules/automation/automation/release/dagster_module.py
+++ b/python_modules/automation/automation/release/dagster_module.py
@@ -106,7 +106,7 @@ class DagsterModule(namedtuple("_DagsterModule", "name is_library additional_ste
"""
assert isinstance(new_version, six.string_types)
- output = "__version__ = '{}'\n".format(new_version)
+ output = 'version = "{}"\n'.format(new_version)
version_file = self.version_file_path | Make release work with new black settings
Summary: quotes
Test Plan: none
Reviewers: nate, dgibson
Reviewed By: dgibson
Differential Revision: <URL> | dagster-io_dagster | train | py |
235bdf9a6623274c800c71453ac7f776af063609 | diff --git a/qiskit/validation/fields/containers.py b/qiskit/validation/fields/containers.py
index <HASH>..<HASH> 100644
--- a/qiskit/validation/fields/containers.py
+++ b/qiskit/validation/fields/containers.py
@@ -7,7 +7,7 @@
"""Container fields that represent nested/collections of schemas or types."""
-from collections import Iterable
+from collections.abc import Iterable
from marshmallow import fields as _fields
from marshmallow.utils import is_collection
diff --git a/qiskit/validation/fields/polymorphic.py b/qiskit/validation/fields/polymorphic.py
index <HASH>..<HASH> 100644
--- a/qiskit/validation/fields/polymorphic.py
+++ b/qiskit/validation/fields/polymorphic.py
@@ -7,7 +7,7 @@
"""Polymorphic fields that represent one of several schemas or types."""
-from collections import Iterable
+from collections.abc import Iterable
from functools import partial
from marshmallow.utils import is_collection | Fix deprecation warnings for abc on Python <I> (#<I>)
When running on Python <I> importing things from 'collections.abc' via
just 'collections' raises a deprecation warning because it'll be
removed in python <I>. This commit fixes this by updating the imports
to not use the alias. | Qiskit_qiskit-terra | train | py,py |
45925e9cb39041dbb93cfdf4644a83cca502cb63 | diff --git a/client/lib/media/utils.js b/client/lib/media/utils.js
index <HASH>..<HASH> 100644
--- a/client/lib/media/utils.js
+++ b/client/lib/media/utils.js
@@ -107,7 +107,8 @@ const MediaUtils = {
} else if ( media.extension ) {
extension = media.extension;
} else {
- extension = path.extname( url.parse( media.URL || media.file || media.guid || '' ).pathname ).slice( 1 );
+ const pathname = url.parse( media.URL || media.file || media.guid || '' ).pathname || '';
+ extension = path.extname( pathname ).slice( 1 );
}
return extension; | Media: path must be a string | Automattic_wp-calypso | train | js |
94a09f3fc26ee0c35e498ba108c0539489793e79 | diff --git a/src/SerializerAbstract.php b/src/SerializerAbstract.php
index <HASH>..<HASH> 100644
--- a/src/SerializerAbstract.php
+++ b/src/SerializerAbstract.php
@@ -106,12 +106,15 @@ abstract class SerializerAbstract implements SerializerInterface
foreach ($relationships[$type] as $name => $nested) {
$method = $this->getRelationshipFromMethod($name);
- $element = $method(
- $data,
- $include,
- isset($relationships['include'][$name]) ? $relationships['include'][$name] : [],
- isset($relationships['link'][$name]) ? $relationships['link'][$name] : []
- );
+
+ if ($method) {
+ $element = $method(
+ $data,
+ $include,
+ isset($relationships['include'][$name]) ? $relationships['include'][$name] : [],
+ isset($relationships['link'][$name]) ? $relationships['link'][$name] : []
+ );
+ }
if ($method && $element)
{ | Avoid creating element if method is not found | tobscure_json-api | train | php |
11cc8c015123c7e3a54e1c46c145fa64da950737 | diff --git a/lib/roxml/definition.rb b/lib/roxml/definition.rb
index <HASH>..<HASH> 100644
--- a/lib/roxml/definition.rb
+++ b/lib/roxml/definition.rb
@@ -235,7 +235,7 @@ module ROXML
@default = opts.delete(:else)
@to_xml = opts.delete(:to_xml)
- @name_explicit = opts.has_key?(:from)
+ @name_explicit = opts.has_key?(:from) && opts[:from].is_a?(String)
@cdata = opts.delete(:cdata)
@required = opts.delete(:required)
@frozen = opts.delete(:frozen)
diff --git a/spec/definition_spec.rb b/spec/definition_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/definition_spec.rb
+++ b/spec/definition_spec.rb
@@ -6,6 +6,11 @@ describe ROXML::Definition do
ROXML::Definition.new(:element, :from => 'somewhere').name_explicit?.should be_true
ROXML::Definition.new(:element).name_explicit?.should be_false
end
+
+ it "should not consider name proxies as explicit" do
+ ROXML::Definition.new(:element, :from => :attr).name_explicit?.should be_false
+ ROXML::Definition.new(:element, :from => :content).name_explicit?.should be_false
+ end
end
describe "hash options declaration", :shared => true do | :attr and :content declarations were not getting xml_convention applied | Empact_roxml | train | rb,rb |
Subsets and Splits