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 |
|---|---|---|---|---|---|
6c4e83a4cc382210e073bdfddbe2fe40cb87e183 | diff --git a/lib/gherkin/formatter/model.rb b/lib/gherkin/formatter/model.rb
index <HASH>..<HASH> 100644
--- a/lib/gherkin/formatter/model.rb
+++ b/lib/gherkin/formatter/model.rb
@@ -116,7 +116,7 @@ module Gherkin
def row(comments, cells, line)
@rows ||= []
- @rows << Row.new(comments, cells, line)
+ @rows << ExamplesTableRow.new(comments, cells, line)
end
def replay(formatter)
@@ -166,7 +166,7 @@ module Gherkin
def row(comments, cells, line)
@rows ||= []
- @rows << Row.new(comments, cells, line)
+ @rows << DataTableRow.new(comments, cells, line)
end
def doc_string(string, content_type, line)
@@ -223,8 +223,6 @@ module Gherkin
end
class Row < Hashable
- native_impl('gherkin')
-
attr_reader :comments, :cells, :line
def initialize(comments, cells, line)
@@ -232,6 +230,14 @@ module Gherkin
end
end
+ class DataTableRow < Row
+ native_impl('gherkin')
+ end
+
+ class ExamplesTableRow < Row
+ native_impl('gherkin')
+ end
+
class Match < Hashable
native_impl('gherkin') | Use different types for examples tables and data tables. | cucumber-attic_gherkin2 | train | rb |
c2a89b8af8fb3177ab45ac642cc69a22096877e7 | diff --git a/testapp/models.py b/testapp/models.py
index <HASH>..<HASH> 100644
--- a/testapp/models.py
+++ b/testapp/models.py
@@ -63,3 +63,10 @@ class PsychoChild(models.Model):
class AdoptedChild(Child):
birth_origin = models.CharField(max_length=100)
+
+
+class LongName(models.Model):
+ name = models.CharField(max_length=200)
+
+class ShortName(models.Model):
+ name = models.CharField(max_length=100)
diff --git a/testapp/tests.py b/testapp/tests.py
index <HASH>..<HASH> 100644
--- a/testapp/tests.py
+++ b/testapp/tests.py
@@ -180,3 +180,9 @@ class FieldValueGeneratorTest(unittest.TestCase):
times = v.split(':')
self.assertEquals(len(times), 3)
+ def test_field_name_clash(self):
+ milkman.deliver(LongName)
+ short_name = milkman.deliver(ShortName)
+
+ self.assertEqual(len(short_name.name), 100)
+ | add failing unit test for [ccollins/milkman#<I>] | ccollins_milkman | train | py,py |
153a7286a8d8aae91e5d045d84128d8de0b4eb4c | diff --git a/session.go b/session.go
index <HASH>..<HASH> 100644
--- a/session.go
+++ b/session.go
@@ -821,6 +821,7 @@ func (q *Query) attempt(keyspace string, end, start time.Time, iter *Iter, host
Rows: iter.numRows,
Host: host,
Err: iter.err,
+ Attempt: q.attempts,
})
}
}
@@ -1544,8 +1545,9 @@ func (b *Batch) attempt(keyspace string, end, start time.Time, iter *Iter, host
Start: start,
End: end,
// Rows not used in batch observations // TODO - might be able to support it when using BatchCAS
- Host: host,
- Err: iter.err,
+ Host: host,
+ Err: iter.err,
+ Attempt: b.attempts,
})
}
@@ -1700,6 +1702,9 @@ type ObservedQuery struct {
// Err is the error in the query.
// It only tracks network errors or errors of bad cassandra syntax, in particular selects with no match return nil error
Err error
+
+ // Attempt contains the number of times the query has been attempted so far.
+ Attempt int
}
// QueryObserver is the interface implemented by query observers / stat collectors.
@@ -1725,6 +1730,9 @@ type ObservedBatch struct {
// Err is the error in the batch query.
// It only tracks network errors or errors of bad cassandra syntax, in particular selects with no match return nil error
Err error
+
+ // Attempt contains the number of times the query has been attempted so far.
+ Attempt int
}
// BatchObserver is the interface implemented by batch observers / stat collectors. | Add attempt to query observer (#<I>) | gocql_gocql | train | go |
9c9b0edf92bbfb8c8c176a83c3420fd1b61714a2 | diff --git a/src/Audit/Drupal/LargeDrupalFiles.php b/src/Audit/Drupal/LargeDrupalFiles.php
index <HASH>..<HASH> 100644
--- a/src/Audit/Drupal/LargeDrupalFiles.php
+++ b/src/Audit/Drupal/LargeDrupalFiles.php
@@ -71,6 +71,10 @@ class LargeDrupalFiles extends Audit {
];
}
$totalRows = count($rows);
+
+ if ($totalRows < 1) {
+ return TRUE;
+ }
$sandbox->setParameter('total', $totalRows);
// Reduce the number of rows to 10 | Extra check for false negative in large Drupal files | drutiny_drutiny | train | php |
85d15430f87d05ca5bbf7320b419d7b209477bcd | diff --git a/src/input/pointer.js b/src/input/pointer.js
index <HASH>..<HASH> 100644
--- a/src/input/pointer.js
+++ b/src/input/pointer.js
@@ -607,9 +607,6 @@
* melonJS currently support <b>['pointermove','pointerdown','pointerup','mousewheel']</b>
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} region a shape representing the region to register on
* @param {Function} callback methods to be called when the event occurs.
- * @param {Boolean} [floating] specify if the object is a floating object
- * (if yes, screen coordinates are used, if not mouse/touch coordinates will
- * be converted to world coordinates)
* @example
* // register on the 'pointerdown' event
* me.input.registerPointerEvent('pointerdown', this, this.pointerDown.bind(this)); | Updated docs on registerPointerEvent | melonjs_melonJS | train | js |
13bdebb587a53d6cbc20c6ecdfc794f7161958c0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ setup(name = "pyuv",
author_email = "saghul@gmail.com",
url = "http://github.com/saghul/pyuv",
description = "Python interface for libuv",
- long_description = open("README").read(),
+ long_description = open("README.rst").read(),
platforms = ["POSIX", "Microsoft Windows"],
classifiers = [
"Development Status :: 4 - Beta", | Fixed reading README file from setup.py | saghul_pyuv | train | py |
8288d4e526f9f32c972e99af2f42cd5f3c5ab621 | diff --git a/lib/neuron/mod-manager/core.js b/lib/neuron/mod-manager/core.js
index <HASH>..<HASH> 100755
--- a/lib/neuron/mod-manager/core.js
+++ b/lib/neuron/mod-manager/core.js
@@ -448,7 +448,7 @@ function realpath(path, envModID, namespace) {
* @public
* ---------------------------------------------------------------------------------- */
-
+// event support
NR.mix(loader, NR.Class.EXTS.events);
// use extend method to add public methods, | neuron/mod-manager: event support, fix #5 | kaelzhang_neuron.js | train | js |
077fb8fbb00eaad7a2046e3fb6749809dd90c795 | diff --git a/dev-server/server.js b/dev-server/server.js
index <HASH>..<HASH> 100644
--- a/dev-server/server.js
+++ b/dev-server/server.js
@@ -3,15 +3,16 @@ var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('../config/');
+var ip = '0.0.0.0';
new WebpackDevServer(webpack(config), {
contentBase: __dirname,
publicPath: config.output.publicPath,
hot: true
-}).listen(config.port, '0.0.0.0', function(err) {
+}).listen(config.port, ip, function(err) {
if (err) {
return console.log(err);
}
- console.log('Listening at 0.0.0.0:' + config.port);
+ console.log('Listening at ' + ip + ':' + config.port);
}); | Push dev server ip to higher level | Stupidism_stupid-rc-starter | train | js |
8e9e168142c38a8c81545e7f6573aa792069a982 | diff --git a/hazelcast/src/test/java/com/hazelcast/internal/ascii/RestCPSubsystemTest.java b/hazelcast/src/test/java/com/hazelcast/internal/ascii/RestCPSubsystemTest.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/test/java/com/hazelcast/internal/ascii/RestCPSubsystemTest.java
+++ b/hazelcast/src/test/java/com/hazelcast/internal/ascii/RestCPSubsystemTest.java
@@ -74,7 +74,7 @@ public class RestCPSubsystemTest extends HazelcastTestSupport {
public void setup() {
RestApiConfig restApiConfig = new RestApiConfig()
.setEnabled(true)
- .enableGroups(RestEndpointGroup.CLUSTER_WRITE);
+ .enableGroups(RestEndpointGroup.CP);
config.getNetworkConfig().setRestApiConfig(restApiConfig);
JoinConfig join = config.getNetworkConfig().getJoin(); | Use CP RestEndpointGroup in RestCPSubsystemTest
CP subsystem was using `CLUSTER_WRITE_ group before
but a new `CP` group is added by <URL> | hazelcast_hazelcast | train | java |
3df1ba4118da306f22a5a7480f3a860036e6eb0a | diff --git a/topic_consumer.go b/topic_consumer.go
index <HASH>..<HASH> 100644
--- a/topic_consumer.go
+++ b/topic_consumer.go
@@ -12,7 +12,7 @@ import (
)
const (
- DefaultKafkaTopic = "nginx.multitrack"
+ DefaultKafkaTopics = "nginx.multitrack,checkout"
DefaultConsumerGroup = "topic_consumer.go"
)
@@ -24,7 +24,7 @@ var (
func init() {
consumerGroup = *flag.String("group", DefaultConsumerGroup, "The name of the consumer group, used for coordination and load balancing")
- kafkaTopicsCSV := flag.String("topics", DefaultKafkaTopic, "The comma-separated list of topics to consume")
+ kafkaTopicsCSV := flag.String("topics", DefaultKafkaTopics, "The comma-separated list of topics to consume")
zookeeperCSV := flag.String("zookeeper", "", "A comma-separated Zookeeper connection string (e.g. `zookeeper1.local:2181,zookeeper2.local:2181,zookeeper3.local:2181`)")
flag.Parse() | Consume more than one topic in example app. | wvanbergen_kafka | train | go |
34218a44aebde8d2c837d58f14e9abc4ed7fb264 | diff --git a/lib/pirata/config.rb b/lib/pirata/config.rb
index <HASH>..<HASH> 100644
--- a/lib/pirata/config.rb
+++ b/lib/pirata/config.rb
@@ -10,7 +10,7 @@ module Pirata
# to pick a mirror that is closest to your application server for best
# results though.
- BASE_URL = "http://thepiratebay.si"
+ BASE_URL = "http://thepiratebay.mn"
end
-end
\ No newline at end of file
+end | Fix pirate bay URL
The domain got ceised recently | strong-code_pirata | train | rb |
c776826c8e25d5afbed92c7d95596511937c5b59 | diff --git a/library/src/com/manuelpeinado/fadingactionbar/FadingActionBarHelper.java b/library/src/com/manuelpeinado/fadingactionbar/FadingActionBarHelper.java
index <HASH>..<HASH> 100644
--- a/library/src/com/manuelpeinado/fadingactionbar/FadingActionBarHelper.java
+++ b/library/src/com/manuelpeinado/fadingactionbar/FadingActionBarHelper.java
@@ -294,8 +294,10 @@ public class FadingActionBarHelper {
mListViewBackgroundView.offsetTopAndBottom(offset);
}
- mLastScrollPosition = scrollPosition;
- mLastDampedScroll = dampedScroll;
+ if (mFirstGlobalLayoutPerformed) {
+ mLastScrollPosition = scrollPosition;
+ mLastDampedScroll = dampedScroll;
+ }
}
private void updateHeaderHeight(int headerHeight) { | Fixed bug in handling of ListView when orientation changed | ManuelPeinado_FadingActionBar | train | java |
88719db5d0fa069197eae4585411f7ba42893389 | diff --git a/examples/website/mesh/app.js b/examples/website/mesh/app.js
index <HASH>..<HASH> 100644
--- a/examples/website/mesh/app.js
+++ b/examples/website/mesh/app.js
@@ -8,7 +8,7 @@ import {
LightingEffect,
AmbientLight
} from '@deck.gl/core';
-import {SolidPolygonLayer} from 'deck.gl/layers';
+import {SolidPolygonLayer} from '@deck.gl/layers';
import {SimpleMeshLayer} from '@deck.gl/mesh-layers';
import {OBJLoader} from '@loaders.gl/obj'; | Fix meshlayer exmaple (#<I>) | uber_deck.gl | train | js |
914ee72b8bc0d1bef53d88f0268a1bd75d62f743 | diff --git a/flowcraft/generator/engine.py b/flowcraft/generator/engine.py
index <HASH>..<HASH> 100644
--- a/flowcraft/generator/engine.py
+++ b/flowcraft/generator/engine.py
@@ -1168,6 +1168,10 @@ class NextflowGenerator:
# Skip init process
if p.template == "init":
+ for param, val in p.params.items():
+ help_list.append("--{:25} {} (default: {})".format(
+ param, val["description"],
+ str(val["default"]).replace('"', "'")))
continue
# Add component header and a line break | Added init params to help message | assemblerflow_flowcraft | train | py |
4dfbba1a7756b04ec47cbcf08ea9dfcd353aa3a7 | diff --git a/tests/porting/hybrid/runPipelineStage.php b/tests/porting/hybrid/runPipelineStage.php
index <HASH>..<HASH> 100644
--- a/tests/porting/hybrid/runPipelineStage.php
+++ b/tests/porting/hybrid/runPipelineStage.php
@@ -125,6 +125,9 @@ switch ( $stageName ) {
$opts['pipeline'], null, $phaseEndRank, "Sync $phaseEndRank" );
$ttm->setPipelineId( $opts['pipelineId'] );
foreach ( $opts['transformers'] as $t ) {
+ if ( $t === 'SanitizerHandler' ) {
+ $t = 'Sanitizer';
+ }
$t = "Parsoid\Wt2Html\TT\\" . $t;
$ttm->addTransformer( new $t( $ttm, $opts['pipeline'] ) );
} | Hybrid testing: Patch over Sanitizer handler name mismatches
* On the JS side, there is the Sanitizer and the SanitizerHandler.
* On the PHP side, there is just the Sanitizer that does both.
Change-Id: Ia5c<I>ec8df7b<I>db<I>f5a7f<I> | wikimedia_parsoid | train | php |
f489471fadfced016870e54709700af4c4f31ad3 | diff --git a/tests/test_parsing.py b/tests/test_parsing.py
index <HASH>..<HASH> 100644
--- a/tests/test_parsing.py
+++ b/tests/test_parsing.py
@@ -198,3 +198,14 @@ end"""
expr = -x + maybe(y) + -x # type: Parser[Text, Optional[Text]]
self.assertEqual(expr.parse("xyx"), "y")
self.assertEqual(expr.parse("xx"), None)
+
+ def test_compare_token_with_none(self):
+ # type: () -> None
+ # https://github.com/vlasovskikh/funcparserlib/pull/58
+ specs = [
+ ("id", (r"\w+",)),
+ ]
+ tokenize = make_tokenizer(specs)
+ tokens = list(tokenize("foo"))
+ expr = maybe(a(None))
+ self.assertEqual(expr.parse(tokens), None) # type: ignore | Added a test for #<I> | vlasovskikh_funcparserlib | train | py |
3ca9e224699a8b34b94d87a8813e7edd2173d5d8 | diff --git a/CrashReport/src/org/acra/ErrorReporter.java b/CrashReport/src/org/acra/ErrorReporter.java
index <HASH>..<HASH> 100644
--- a/CrashReport/src/org/acra/ErrorReporter.java
+++ b/CrashReport/src/org/acra/ErrorReporter.java
@@ -282,7 +282,7 @@ public class ErrorReporter implements Thread.UncaughtExceptionHandler {
pi = pm.getPackageInfo(context.getPackageName(), 0);
if (pi != null) {
// Application Version
- mCrashProperties.put(VERSION_NAME_KEY, pi.versionName);
+ mCrashProperties.put(VERSION_NAME_KEY, pi.versionName != null ? pi.versionName : "not set");
} else {
// Could not retrieve package info...
mCrashProperties.put(PACKAGE_NAME_KEY, "Package info unavailable"); | Fixed issue #2 : NPE if versionName is not set in the AndroidManifest.xml | ACRA_acra | train | java |
78356d7f6646a6a8d12111b727db70a9b0ca5b41 | diff --git a/wdb_over_pdb/pdb.py b/wdb_over_pdb/pdb.py
index <HASH>..<HASH> 100644
--- a/wdb_over_pdb/pdb.py
+++ b/wdb_over_pdb/pdb.py
@@ -1,4 +1,4 @@
-from wdb import Wdb, set_trace
+from wdb import *
class Pdb(Wdb): | Import everything from wdb in wdb_over_pdb | Kozea_wdb | train | py |
683b1614817e3c5c3c80bbf52bbe9e59bf5525d6 | diff --git a/bpf/lxcmap/lxcmap.go b/bpf/lxcmap/lxcmap.go
index <HASH>..<HASH> 100644
--- a/bpf/lxcmap/lxcmap.go
+++ b/bpf/lxcmap/lxcmap.go
@@ -29,9 +29,7 @@ type LXCMap struct {
const (
// MaxKeys represents the maximum number of keys in the LXCMap.
- // TODO: bump this number to 0xffff
- // Or at least make it dependent on the number of containers per node)
- MaxKeys = 1024
+ MaxKeys = common.EndpointsPerHost
// PortMapMax represents the maximum number of Ports Mapping per container.
PortMapMax = 16
diff --git a/common/const.go b/common/const.go
index <HASH>..<HASH> 100644
--- a/common/const.go
+++ b/common/const.go
@@ -57,6 +57,9 @@ const (
CiliumLabelSource = "cilium"
// K8sLabelSource is the default label source for the labels read from kubernetes.
K8sLabelSource = "k8s"
+ // EndpointsPerHost is the maximum number of endpoints allowed per host. It should
+ // represent the same number of IPv6 addresses supported on each node.
+ EndpointsPerHost = 0xFFFF
// Endpoint prefixes | Bumped MaxKeys to be the same as EndpointsPerHost | cilium_cilium | train | go,go |
50171edfab62c580b90b01a82b85fbf0c7abe920 | diff --git a/src/Scripts/jquery.fileDownload.js b/src/Scripts/jquery.fileDownload.js
index <HASH>..<HASH> 100644
--- a/src/Scripts/jquery.fileDownload.js
+++ b/src/Scripts/jquery.fileDownload.js
@@ -114,6 +114,12 @@ $.extend({
cookiePath: "/",
//
+ //if specified it will be used when attempting to clear the above name value pair
+ //useful for when downloads are being served on a subdomain (e.g. downloads.example.com)
+ //
+ cookieDomain: null,
+
+ //
//the title for the popup second window as a download is processing in the case of a mobile browser
//
popupWindowTitle: "Initiating file download...",
@@ -321,16 +327,18 @@ $.extend({
function checkFileDownloadComplete() {
-
//has the cookie been written due to a file download occuring?
if (document.cookie.indexOf(settings.cookieName + "=" + settings.cookieValue) != -1) {
//execute specified callback
internalCallbacks.onSuccess(fileUrl);
- //remove the cookie and iframe
- document.cookie = settings.cookieName + "=; expires=" + new Date(1000).toUTCString() + "; path=" + settings.cookiePath;
+ //remove cookie
+ var cookieData = settings.cookieName + "=; path=" + settings.cookiePath + "; expires=" + new Date(0).toUTCString() + ";";
+ if (settings.cookieDomain) cookieData += " domain=" + settings.cookieDomain + ";";
+ document.cookie = cookieData;
+ //remove iframe
cleanUp(false);
return; | Added support for working for working with cookies set on a subdomain | johnculviner_jquery.fileDownload | train | js |
5baccadd69a1976e80bd4d94363b3694b32a3761 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -1505,7 +1505,8 @@ def managed(name,
except Exception as exc:
ret['changes'] = {}
log.debug(traceback.format_exc())
- os.remove(tmp_filename)
+ if os.path.isfile(tmp_filename):
+ os.remove(tmp_filename)
return _error(ret, 'Unable to check_cmd file: {0}'.format(exc))
# file being updated to verify using check_cmd
@@ -1523,7 +1524,8 @@ def managed(name,
cret = mod_run_check_cmd(check_cmd, tmp_filename, **check_cmd_opts)
if isinstance(cret, dict):
ret.update(cret)
- os.remove(tmp_filename)
+ if os.path.isfile(tmp_filename):
+ os.remove(tmp_filename)
return ret
# Since we generated a new tempfile and we are not returning here
# lets change the original sfn to the new tempfile or else we will
@@ -1561,7 +1563,7 @@ def managed(name,
log.debug(traceback.format_exc())
return _error(ret, 'Unable to manage file: {0}'.format(exc))
finally:
- if tmp_filename:
+ if tmp_filename and os.path.isfile(tmp_filename):
os.remove(tmp_filename) | file.managed: wrap os.remove in if isfile, don't remove on success
module file.manage removes the file tmp_filename on success, so we
don't need to remove it in that case. in the other cases it's
uncertain if the file exists or not, so wrap it in some if checks. | saltstack_salt | train | py |
108a4531fdb63c33e77fc98145a4520acb1af980 | diff --git a/lib/arel/algebra/relations/operations/alias.rb b/lib/arel/algebra/relations/operations/alias.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/algebra/relations/operations/alias.rb
+++ b/lib/arel/algebra/relations/operations/alias.rb
@@ -1,7 +1,4 @@
module Arel
class Alias < Compound
- attributes :relation
- deriving :initialize
- alias_method :==, :equal?
end
end
diff --git a/lib/arel/algebra/relations/utilities/compound.rb b/lib/arel/algebra/relations/utilities/compound.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/algebra/relations/utilities/compound.rb
+++ b/lib/arel/algebra/relations/utilities/compound.rb
@@ -13,6 +13,10 @@ module Arel
@requires
end
+ def initialize relation
+ @relation = relation
+ end
+
[:wheres, :groupings, :orders, :havings, :projections].each do |operation_name|
class_eval <<-OPERATION, __FILE__, __LINE__
def #{operation_name} | inheritence meow meow meow | rails_rails | train | rb,rb |
d2aa63d0610d5fadabc7057916f772fa3af7d007 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -26,7 +26,7 @@ function proxy(callback) {
.concat(require('./inspectors'))
.concat(config.middlewares)
.concat(require('./handlers'));
- server.timeout = config.idleTimeout;
+ server.timeout = server.keepAliveTimeout = config.idleTimeout;
proxyEvents.config = config;
app.logger = logger;
middlewares.forEach(function(mw) { | refactor: Reset server.keepAliveTimeout | avwo_whistle | train | js |
94d55ce19a7ac66d44a922435988acda3c5a83c8 | diff --git a/lib/rspotify/base.rb b/lib/rspotify/base.rb
index <HASH>..<HASH> 100644
--- a/lib/rspotify/base.rb
+++ b/lib/rspotify/base.rb
@@ -9,6 +9,10 @@ module RSpotify
case ids.class.to_s
when 'Array'
+ if type == 'user'
+ warn 'Spotify API does not support finding several users simultaneously'
+ return false
+ end
path << "?ids=#{ids.join ','}"
json = RSpotify.get path
json[pluralized_type].map { |t| type_class.new t }
diff --git a/lib/rspotify/user.rb b/lib/rspotify/user.rb
index <HASH>..<HASH> 100644
--- a/lib/rspotify/user.rb
+++ b/lib/rspotify/user.rb
@@ -2,12 +2,8 @@ module RSpotify
class User < Base
- def self.find(id)
- if id.is_a? Array
- warn 'Spotify API does not support finding several users simultaneously'
- return false
- end
- super(id, 'user')
+ def self.find(ids)
+ super(ids, 'user')
end
def self.search | Base::find should not accept array of User ids | guilhermesad_rspotify | train | rb,rb |
7404799d57845334ca4db84f390eb4f81eb72e3c | diff --git a/src/Transaction/TransactionFactory.php b/src/Transaction/TransactionFactory.php
index <HASH>..<HASH> 100644
--- a/src/Transaction/TransactionFactory.php
+++ b/src/Transaction/TransactionFactory.php
@@ -166,6 +166,33 @@ final class TransactionFactory
}
/**
+ * Retrieve a pre-populated Transaction instance for creating a market order for an asset.
+ *
+ * @param string $assetId
+ * @param float $price
+ * @param float $assetAmount
+ * @param int $orderType
+ * @param bool $isCancelable
+ *
+ * @return Transaction
+ */
+ public static function makeAssetMarketInstance(
+ string $assetId,
+ float $price,
+ float $assetAmount,
+ int $orderType,
+ bool $isCancelable
+ ): Transaction {
+ $transaction = new Transaction();
+
+ $transaction->changeVersion(Version::ASSET_MARKET);
+ $transaction->changeMessage(json_encode([$assetId, $price, $assetAmount, $isCancelable, $orderType]));
+ $transaction->changeValue(0.00000001);
+
+ return $transaction;
+ }
+
+ /**
* Set the default fee and value for masternode commands.
*
* @param string $address | Add a new 'makeAssetMarketInstance' method | pxgamer_arionum-php | train | php |
b941241026fb92a7364c9f5dc4780fac8dca8ff4 | diff --git a/securimage_show.php b/securimage_show.php
index <HASH>..<HASH> 100644
--- a/securimage_show.php
+++ b/securimage_show.php
@@ -56,8 +56,8 @@ $img = new Securimage();
//$img->ttf_file = './Quiff.ttf';
//$img->captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC; // show a simple math problem instead of text
//$img->case_sensitive = true; // true to use case sensitve codes - not recommended
-//$img->image_height = 90; // width in pixels of the image
-//$img->image_width = $img->image_height * M_E; // a good formula for image size
+//$img->image_height = 90; // height in pixels of the image
+//$img->image_width = $img->image_height * M_E; // a good formula for image size based on the height
//$img->perturbation = .75; // 1.0 = high distortion, higher numbers = more distortion
//$img->image_bg_color = new Securimage_Color("#0099CC"); // image background color
//$img->text_color = new Securimage_Color("#EAEAEA"); // captcha text color | Fix typo in comment and expand second comment | dapphp_securimage | train | php |
0344aa50717ba43e44797220c5647cfb5b49f5be | diff --git a/tests/unit/test_cubepart.py b/tests/unit/test_cubepart.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_cubepart.py
+++ b/tests/unit/test_cubepart.py
@@ -189,9 +189,9 @@ class Describe_Strand(object):
def it_knows_the_population_fraction(self, cube_):
cube_.population_fraction = 0.5
- slice_ = _Strand(cube_, None, None, None, None, None)
+ strand_ = _Strand(cube_, None, None, None, None, None)
- population_fraction = slice_.population_fraction
+ population_fraction = strand_.population_fraction
assert population_fraction == 0.5 | rfctr: fixing crufty name in cubepart test | Crunch-io_crunch-cube | train | py |
38036c6422883a67bd8c510ee732748a046feb94 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -2,6 +2,7 @@
const fs = require('fs');
const path = require('path');
+const isJSON = require('is-json');
const posthtml = require('posthtml');
const render = require('posthtml-render');
const match = require('posthtml-match-helper');
@@ -67,7 +68,17 @@ function parse(options) {
})
.then(tree => {
// Remove <content> tags and replace them with node's content
- const content = tree.match(match('content'), () => node.content || '');
+ const content = tree.match(match('content'), () => {
+ if (
+ node.content &&
+ node.attrs &&
+ isJSON(node.attrs.locals)
+ ) {
+ return parseLocals(node.attrs.locals)(node.content);
+ }
+
+ return node.content || '';
+ });
// Remove <module> tag and set inner content
node.tag = false;
node.content = content; | fix: fails to parse expressions in <content>, close #<I> | posthtml_posthtml-modules | train | js |
f7f7cd9d3810ccedfb4779f308ee1374edf9c4e4 | diff --git a/src/directives/formBuilderDnd.js b/src/directives/formBuilderDnd.js
index <HASH>..<HASH> 100644
--- a/src/directives/formBuilderDnd.js
+++ b/src/directives/formBuilderDnd.js
@@ -38,7 +38,7 @@ module.exports = [
$scope.addComponent = function(component, index) {
// Only edit immediately for components that are not resource comps.
- if (!component.lockConfiguration && (!component.key || (component.key.indexOf('.') === -1))) {
+ if (component.isNew && !component.lockConfiguration && (!component.key || (component.key.indexOf('.') === -1))) {
// Force the component to be flagged as new.
component.isNew = true; | fix: only edit newly-added components
If component has been added before, don’t open the edit modal again.
That should fix this issues/<I> | formio_ngFormBuilder | train | js |
e39f836eaf872d7e1278e08ab367fb6b40c5ef19 | diff --git a/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java b/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java
index <HASH>..<HASH> 100644
--- a/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java
+++ b/rapidoid-u/src/test/java/org/rapidoid/util/UTest.java
@@ -476,7 +476,14 @@ public class UTest extends TestCommons {
@Test
public void testMapKVKVKVKV() {
- fail("Not yet implemented");
+ Map<String, Integer> map = U.map("a", 1, "b", 2, "c", 3, "d", 4);
+
+ eq((map.size()), 4);
+
+ eq((map.get("a").intValue()), 1);
+ eq((map.get("b").intValue()), 2);
+ eq((map.get("c").intValue()), 3);
+ eq((map.get("d").intValue()), 4);
}
@Test | Implemented test for U.map (4 entries). | rapidoid_rapidoid | train | java |
83ac11caa7bd2ebfa478f481f3e96e68a43c37db | diff --git a/app/controllers/neighborly/admin/users_controller.rb b/app/controllers/neighborly/admin/users_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/neighborly/admin/users_controller.rb
+++ b/app/controllers/neighborly/admin/users_controller.rb
@@ -20,7 +20,7 @@ module Neighborly::Admin
end
def collection
- @users ||= apply_scopes(end_of_association_chain).order_by(params[:order_by] || 'coalesce(user_totals.sum, 0) DESC').joins(:user_total).page(params[:page])
+ @users ||= apply_scopes(end_of_association_chain).order_by(params[:order_by] || 'created_at DESC').includes(:user_total).page(params[:page])
end
end
end | Remove join from users_total on users page
It was filtering for users that was a user_total record. | FromUte_dune-admin | train | rb |
2e0c9ebc59456182e7d3cd08187d800bd5103364 | diff --git a/cumulusci/tasks/salesforce/Deploy.py b/cumulusci/tasks/salesforce/Deploy.py
index <HASH>..<HASH> 100644
--- a/cumulusci/tasks/salesforce/Deploy.py
+++ b/cumulusci/tasks/salesforce/Deploy.py
@@ -85,7 +85,7 @@ class Deploy(BaseSalesforceMetadataApiTask):
def _has_namespaced_package(self, ns):
if "unmanaged" in self.options:
- return process_bool_arg(self.options.get("unmanaged", True))
+ return not process_bool_arg(self.options.get("unmanaged", True))
return ns in self.org_config.installed_packages
def _is_namespaced_org(self, ns): | fix backwards compatibility for old unmanaged option | SFDO-Tooling_CumulusCI | train | py |
42a4326de153f35c090945f3f4ebe26d247c0776 | diff --git a/source/application/controllers/newsletter.php b/source/application/controllers/newsletter.php
index <HASH>..<HASH> 100644
--- a/source/application/controllers/newsletter.php
+++ b/source/application/controllers/newsletter.php
@@ -203,9 +203,7 @@ class Newsletter extends oxUBase
$oUser->getNewsSubscription()->setOptInStatus( 0 );
// removing from group ..
- if ( !$this->getConfig()->getConfigParam( 'blOrderOptInEmail' ) ) {
- $oUser->removeFromGroup( 'oxidnewsletter' );
- }
+ $oUser->removeFromGroup( 'oxidnewsletter' );
$this->_iNewsletterStatus = 3;
} | <I>: superfluous if statement in Newsletter::removeme()
unsubscribe user from newsletter group from newsletter link | OXID-eSales_oxideshop_ce | train | php |
bf008a1bee20f8b57a6cea3ef32fad0f390f2c5d | diff --git a/src/store/indexeddb.js b/src/store/indexeddb.js
index <HASH>..<HASH> 100644
--- a/src/store/indexeddb.js
+++ b/src/store/indexeddb.js
@@ -16,7 +16,7 @@ limitations under the License.
"use strict";
import q from "q";
-import MatrixInMemoryStore from "./memory";
+import {MatrixInMemoryStore} from "./memory";
import utils from "../utils";
/**
@@ -161,6 +161,13 @@ const IndexedDBStore = function IndexedDBStore(backend, opts) {
};
utils.inherits(IndexedDBStore, MatrixInMemoryStore);
+/**
+ * @return {Promise} Resolved when loaded from indexed db.
+ */
+IndexedDBStore.prototype.startup = function() {
+ return q();
+};
+
function createDatabase(db) {
// Make room store, clobber based on room ID. (roomId property of Room objects)
db.createObjectStore("rooms", { keyPath: ["roomId"] }); | Fix build and add stub store connect() | matrix-org_matrix-js-sdk | train | js |
a05b6cb900bec1abba009b568196d7821e7a0a22 | diff --git a/src/main/java/backend/session/Neo4jSessionFactory.java b/src/main/java/backend/session/Neo4jSessionFactory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/backend/session/Neo4jSessionFactory.java
+++ b/src/main/java/backend/session/Neo4jSessionFactory.java
@@ -19,19 +19,10 @@ public class Neo4jSessionFactory {
private final SessionFactory sessionFactory;
private Neo4jSessionFactory() {
- sessionFactory = new SessionFactory(getConfiguration(), "db");
- }
-
- private Configuration getConfiguration() {
- // if app isTest() && isLocal()
- try {
- return new Configuration("ogm.properties");
- } catch (Exception ex) {
- Configuration configuration = new Configuration();
- configuration.driverConfiguration().setURI(System.getenv("GRAPHENEDB_URL"));
- configuration.autoIndexConfiguration().setAutoIndex("assert");
- return configuration;
- }
+ Configuration configuration = new Configuration();
+ configuration.driverConfiguration().setURI(System.getenv("GRAPHENEDB_URL"));
+ configuration.autoIndexConfiguration().setAutoIndex("assert");
+ sessionFactory = new SessionFactory(configuration, "db");
}
public static Neo4jSessionFactory getInstance() { | Local tests need local db. | zuacaldeira_flex-app-backend | train | java |
a399789ed9d879f33cea6525c5ceb09d71dd18e4 | diff --git a/src/Graviton/SchemaBundle/SchemaUtils.php b/src/Graviton/SchemaBundle/SchemaUtils.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/SchemaBundle/SchemaUtils.php
+++ b/src/Graviton/SchemaBundle/SchemaUtils.php
@@ -177,7 +177,7 @@ class SchemaUtils
// exposed events..
$classShortName = $documentReflection->getShortName();
if (isset($this->eventMap[$classShortName])) {
- $schema->setEventNames($this->eventMap[$classShortName]['events']);
+ $schema->setEventNames(array_unique($this->eventMap[$classShortName]['events']));
}
foreach ($meta->getFieldNames() as $field) { | fix to test expectation, we shall not have duplicate event names in schema.. | libgraviton_graviton | train | php |
811bcbcf4daf6a1118eb898e4e55320c68ec5159 | diff --git a/pandas/conftest.py b/pandas/conftest.py
index <HASH>..<HASH> 100644
--- a/pandas/conftest.py
+++ b/pandas/conftest.py
@@ -29,7 +29,7 @@ def pytest_runtest_setup(item):
if 'high_memory' in item.keywords and not item.config.getoption(
"--run-high-memory"):
pytest.skip(
- "skipping high memory test since --run-highmemory was not set")
+ "skipping high memory test since --run-high-memory was not set")
# Configurations for all tests and all test modules | MAINT: Add dash in high memory message
Follow-up to gh-<I>. | pandas-dev_pandas | train | py |
f12510e4ff1873059e9753e5c44c851853d82a9a | diff --git a/src/Driver/Element/Wpphp/UserElement.php b/src/Driver/Element/Wpphp/UserElement.php
index <HASH>..<HASH> 100644
--- a/src/Driver/Element/Wpphp/UserElement.php
+++ b/src/Driver/Element/Wpphp/UserElement.php
@@ -27,7 +27,7 @@ class UserElement extends BaseElement
throw new UnexpectedValueException(sprintf('Failed creating new user: %s', $user->get_error_message()));
}
- return $this->get($user->ID);
+ return $this->get($user);
}
/** | Fix WPPHP #<I> temporarily so that builds pass | paulgibbs_behat-wordpress-extension | train | php |
86aa2246674ecdb850327d5adf8e4017bdb9f9d2 | diff --git a/test/indexer/macros_marc21_semantics_test.rb b/test/indexer/macros_marc21_semantics_test.rb
index <HASH>..<HASH> 100644
--- a/test/indexer/macros_marc21_semantics_test.rb
+++ b/test/indexer/macros_marc21_semantics_test.rb
@@ -157,6 +157,18 @@ describe "Traject::Macros::Marc21Semantics" do
@record = MARC::Reader.new(support_file_path "date_type_r_missing_date2.marc").to_a.first
assert_equal 1957, Marc21Semantics.publication_date(@record)
end
+
+ it "works correctly with date type 'q'" do
+ val = @record['008'].value
+ val[6] = 'q'
+ val[7..10] = '191u'
+ val[11..14] = '192u'
+ @record['008'].value = val
+
+ # Date should be date1 + date2 / 2 = (1910 + 1929) / 2 = 1919
+ estimate_tolerance = 30
+ assert_equal 1919, Marc21Semantics.publication_date(@record, estimate_tolerance)
+ end
end
describe "marc_lcc_to_broad_category" do | Added date type = q test | traject_traject | train | rb |
d91e8ca358e468857494d19277d420b7da4ddbb5 | diff --git a/demo/common/assets.js b/demo/common/assets.js
index <HASH>..<HASH> 100644
--- a/demo/common/assets.js
+++ b/demo/common/assets.js
@@ -754,7 +754,7 @@ shakaAssets.testAssets = [
new ShakaDemoAssetInfo(
/* name= */ 'Low Latency DASH Live',
/* iconUri= */ 'https://storage.googleapis.com/shaka-asset-icons/dash_if_test_pattern.png',
- /* manifestUri= */ 'https://vm2.dashif.org/livesim-chunked/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd',
+ /* manifestUri= */ 'https://livesim.dashif.org/livesim-chunked/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd',
/* source= */ shakaAssets.Source.SHAKA)
.addFeature(shakaAssets.Feature.DASH)
.addFeature(shakaAssets.Feature.LIVE) | fix: Update low latency dash manifest url
Issue #<I>
Change-Id: I<I>ce<I>cc<I>b<I>fbf<I>b<I>d<I>fa<I>ab | google_shaka-player | train | js |
44a4c29e16ca2b82e8e86b4625d514278a255172 | diff --git a/FileSystem.php b/FileSystem.php
index <HASH>..<HASH> 100644
--- a/FileSystem.php
+++ b/FileSystem.php
@@ -45,4 +45,9 @@ class FileSystem implements FileSystemInterface
{
return glob($pattern);
}
+
+ public function getRealPath($path)
+ {
+ return $path;
+ }
}
diff --git a/FileSystemInterface.php b/FileSystemInterface.php
index <HASH>..<HASH> 100644
--- a/FileSystemInterface.php
+++ b/FileSystemInterface.php
@@ -23,4 +23,6 @@ interface FileSystemInterface
public function fileExists($fileName);
public function glob($pattern);
+
+ public function getRealPath($path);
}
\ No newline at end of file
diff --git a/test/FileSystemSandbox.php b/test/FileSystemSandbox.php
index <HASH>..<HASH> 100644
--- a/test/FileSystemSandbox.php
+++ b/test/FileSystemSandbox.php
@@ -164,4 +164,9 @@ class FileSystemSandbox implements FileSystemInterface
{
$this->putFile($destination ?: $fileName, $this->realFileSystem->getFile($fileName));
}
+
+ public function getRealPath($path)
+ {
+ return $this->path . $path;
+ }
} | Added a method to get the real path of a file. This is needed for modules which doesn't use the FileSystem but are used by a module that uses it and is tested by a sandboxed FileSystem. | JustsoSoftware_JustAPI | train | php,php,php |
a5a840b80fcbcf420bce3d95bb1f1e0c5f7148f3 | diff --git a/lib/reddit_bot.rb b/lib/reddit_bot.rb
index <HASH>..<HASH> 100644
--- a/lib/reddit_bot.rb
+++ b/lib/reddit_bot.rb
@@ -99,6 +99,31 @@ module RedditBot
}["flair_template_id"]
end
+ def leave_a_comment thing_id, text
+ puts "leaving a comment on '#{thing_id}'"
+ json(:post, "/api/comment",
+ thing_id: thing_id,
+ text: text,
+ ).tap do |result|
+ fail result["json"]["errors"].to_s unless result["json"]["errors"].empty?
+ end
+ end
+
+ def each_comment_of_the_post_thread article
+ Enumerator.new do |e|
+ f = lambda do |smth|
+ smth["data"]["children"].each do |child|
+ f[child["data"]["replies"]] if child["data"]["replies"].is_a? Hash
+ fail "unknown type child['kind']: #{child["kind"]}" unless child["kind"] == "t1"
+ e << [child["data"]["name"], child["data"]]
+ end
+ end
+ f[ json(:get, "/comments/#{article}", depth: 100500, limit: 100500).tap do |t|
+ fail "smth weird about /comments/<id> response" unless t.size == 2
+ end[1] ]
+ end
+ end
+
private
def token | implemented leave_a_comment action and each_comment_of_the_post_thread enumerator | Nakilon_reddit_bot | train | rb |
0b2c72cb48ac99c49b79a5835caecf61ce8bb860 | diff --git a/spellbook.py b/spellbook.py
index <HASH>..<HASH> 100644
--- a/spellbook.py
+++ b/spellbook.py
@@ -69,7 +69,7 @@ def prepare_argparse():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command_name')
- parser_search = subparsers.add_parser('search')
+ parser_search = subparsers.add_parser('search', aliases=['s'])
parser_search.set_defaults(func=command_search)
parser_search.add_argument('data', nargs='*')
@@ -77,7 +77,7 @@ def prepare_argparse():
parser_add.set_defaults(func=command_add)
parser_add.add_argument('data', nargs='*')
- parser_search = subparsers.add_parser('list')
+ parser_search = subparsers.add_parser('list', aliases=['l'])
parser_search.set_defaults(func=command_list)
return parser | FEAT add aliases to commands | donpiekarz_spellbook | train | py |
129edfb5c49da5c9ed0fc9f813053d6dad6e7004 | diff --git a/CHANGELOG b/CHANGELOG
index <HASH>..<HASH> 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,12 @@
+v0.9
+----
++ Added support for tree and tree item admin models overriding (see #43).
++ Added Foundation CSS Framework menu basic templates (see #41).
++ Added Bootstrap CSS Framework menu and breadcrumbs basic templates (see #41).
+* Fixed sorting tree items by parent ID instead of parent sort order (see #55).
+* Fixed crashes when using sitetreeload command with colored terminal (fixes #61).
+
+
v0.8
----
+ Added 'title' field for Tree models.
diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -48,9 +48,9 @@ copyright = u'2011-2012, Igor \'idle sign\' Starikov'
# built documents.
#
# The short X.Y version.
-version = '0.8'
+version = '0.9'
# The full version, including alpha/beta/rc tags.
-release = '0.8'
+release = '0.9'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/sitetree/__init__.py b/sitetree/__init__.py
index <HASH>..<HASH> 100644
--- a/sitetree/__init__.py
+++ b/sitetree/__init__.py
@@ -1 +1 @@
-VERSION = (0, 8)
+VERSION = (0, 9) | Version number is bumped up.
CHANGELOG is updated. | idlesign_django-sitetree | train | CHANGELOG,py,py |
79ff13b833b5f7b6e640d75233b8ab9be5e01749 | diff --git a/app/models/effective/datatable.rb b/app/models/effective/datatable.rb
index <HASH>..<HASH> 100644
--- a/app/models/effective/datatable.rb
+++ b/app/models/effective/datatable.rb
@@ -24,6 +24,10 @@ module Effective
raise "Unsupported collection type. Should be ActiveRecord class, ActiveRecord relation, or an Array of Arrays [[1, 'something'], [2, 'something else']]"
end
+ if @default_order.present? && !table_columns.key?((@default_order.keys.first rescue nil))
+ raise "default_order :#{(@default_order.keys.first rescue 'nil')} must exist as a table_column or array_column"
+ end
+
# Any pre-selected search terms should be assigned now
search_terms.each { |column, term| self.send("#{column}=", term) }
end | Add warning about default_order without that column name | code-and-effect_effective_datatables | train | rb |
744ec400061e61f07ff51647ab245c56a5063fe3 | diff --git a/errors/helper.js b/errors/helper.js
index <HASH>..<HASH> 100644
--- a/errors/helper.js
+++ b/errors/helper.js
@@ -82,6 +82,11 @@ module.exports = {
'. Make sure you are using the correct mobile context. See mob.setNativeContext and mob.setWebViewContext.');
}
+ if (err.message && err.message.includes('Unable to automate Chrome version')) {
+ const originalError = err.message.substring(err.message.indexOf(ORIGINAL_ERROR_MESSAGE) + ORIGINAL_ERROR_MESSAGE.length);
+ return new OxError(ERROR_CODES.CHROMEDRIVER_ERROR, originalError);
+ }
+
// handle various types of 'Original error'
if (err.message.indexOf(ORIGINAL_ERROR_MESSAGE) > -1) {
const originalError = err.message.substring(err.message.indexOf(ORIGINAL_ERROR_MESSAGE) + ORIGINAL_ERROR_MESSAGE.length); | Produce proper error on chromedriver version mismatch during context switch | oxygenhq_oxygen | train | js |
5e4f1958ca81aa6adfa2423bd58254eb3c7a1a7d | diff --git a/src/Extensions.php b/src/Extensions.php
index <HASH>..<HASH> 100644
--- a/src/Extensions.php
+++ b/src/Extensions.php
@@ -211,6 +211,8 @@ class Extensions
}
}
+ // Ensure the namespace is valid for PSR-4
+ $namespace = rtrim($namespace, '\\') . '\\';
$psr4[$namespace] = $paths;
} | Catch missing \\ for local extension composer.json | bolt_bolt | train | php |
d897e2d9b557d320ec8d48a3782a80ab6ae9d6e4 | diff --git a/core/src/main/java/org/infinispan/commands/remote/recovery/TxCompletionNotificationCommand.java b/core/src/main/java/org/infinispan/commands/remote/recovery/TxCompletionNotificationCommand.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/commands/remote/recovery/TxCompletionNotificationCommand.java
+++ b/core/src/main/java/org/infinispan/commands/remote/recovery/TxCompletionNotificationCommand.java
@@ -54,7 +54,7 @@ public class TxCompletionNotificationCommand extends RecoveryCommand implements
private TransactionTable txTable;
private LockManager lockManager;
private StateTransferManager stateTransferManager;
- private int topologyId;
+ private int topologyId = -1;
private TxCompletionNotificationCommand() {
super(null); // For command id uniqueness test | ISPN-<I> Unnecessary forwarding for TxCompletionCommands
The topologyId field was initialized with 0, so RpcManagerImpl wasn't
setting the correct value. | infinispan_infinispan | train | java |
5d4e4a484212fbae6680af45c3c6efd4e4d269b5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -173,7 +173,10 @@ setup(
packages=find_packages(exclude=["compiler*"]),
zip_safe=False,
install_requires=read("requirements.txt"),
- extras_require={"tgcrypto": ["tgcrypto==1.1.1"]},
+ extras_require={
+ "tgcrypto": ["tgcrypto==1.1.1"], # TODO: Remove soon
+ "fast": ["tgcrypto==1.1.1"],
+ },
cmdclass={
"clean": Clean,
"generate": Generate | Add "fast" keyword as extra requirement
To be used instead of "tgcrypto" | pyrogram_pyrogram | train | py |
d521e1594db4b149f1321b5d9fdda486c3bea2da | diff --git a/server/client.go b/server/client.go
index <HASH>..<HASH> 100644
--- a/server/client.go
+++ b/server/client.go
@@ -1694,6 +1694,7 @@ func (c *client) sendPing() {
// Assume lock is held.
func (c *client) generateClientInfoJSON(info Info) []byte {
info.CID = c.cid
+ info.ClientHost = c.host
info.MaxPayload = c.mpay
// Generate the info json
b, _ := json.Marshal(info)
diff --git a/server/server.go b/server/server.go
index <HASH>..<HASH> 100644
--- a/server/server.go
+++ b/server/server.go
@@ -72,6 +72,7 @@ type Info struct {
MaxPayload int32 `json:"max_payload"`
IP string `json:"ip,omitempty"`
CID uint64 `json:"client_id,omitempty"`
+ ClientHost string `json:"client_ip,omitempty"`
Nonce string `json:"nonce,omitempty"`
Cluster string `json:"cluster,omitempty"`
ClientConnectURLs []string `json:"connect_urls,omitempty"` // Contains URLs a client can connect to. | Place server's version of client IP in INFO | nats-io_gnatsd | train | go,go |
99d48937020402c13ee9eaa6974acaa01fc1335f | diff --git a/tests/CardTest.php b/tests/CardTest.php
index <HASH>..<HASH> 100644
--- a/tests/CardTest.php
+++ b/tests/CardTest.php
@@ -61,7 +61,7 @@ class CardTest extends TestCase
VCR::insertCassette('legendary_elf_warriors.yaml');
$cards = Card::where(['supertypes' => 'legendary'])->where(['subtypes' => 'elf,warrior'])->all();
- $this->assertCount(15, $cards);
+ $this->assertCount(18, $cards);
}
public function test_all_with_page_returns_cards() | There are now <I> legendary elf warriors... (brittle integration test) | MagicTheGathering_mtg-sdk-php | train | php |
f71c45a182b5ac2092079b4b1b4cc193647b09e3 | diff --git a/lib/barista/compiler.rb b/lib/barista/compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/barista/compiler.rb
+++ b/lib/barista/compiler.rb
@@ -12,7 +12,7 @@ module Barista
def self.check_availability!(silence = false)
available?.tap do |available|
- if Barista.exception_on_error? && !silence
+ if !available && Barista.exception_on_error? && !silence
raise CompilerUnavailableError, "The coffeescript compiler '#{self.bin_path}' could not be found."
end
end
diff --git a/lib/barista/version.rb b/lib/barista/version.rb
index <HASH>..<HASH> 100644
--- a/lib/barista/version.rb
+++ b/lib/barista/version.rb
@@ -2,7 +2,7 @@ module Barista
module Version
MAJOR = 0
MINOR = 4
- PATCH = 1
+ PATCH = 2
STRING = [MAJOR, MINOR, PATCH].join(".")
end
end | Update check to do what it's actually expected | Sutto_barista | train | rb,rb |
db4c99175814f0218ce999dda649cfea63da12eb | diff --git a/lib/neo4j/rails/callbacks.rb b/lib/neo4j/rails/callbacks.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/rails/callbacks.rb
+++ b/lib/neo4j/rails/callbacks.rb
@@ -10,7 +10,7 @@ module Neo4j
extend ActiveModel::Callbacks
- define_model_callbacks :create, :save, :update, :destroy
+ define_model_callbacks :create, :save, :update, :destroy, :validation
end
def destroy_with_callbacks #:nodoc: | Added :validation to define_model_callbacks. Now works with newest devise. | neo4jrb_neo4j | train | rb |
f26f2209cd5ae3e990cc787033af7326f3f43462 | diff --git a/src/Auth.php b/src/Auth.php
index <HASH>..<HASH> 100644
--- a/src/Auth.php
+++ b/src/Auth.php
@@ -774,7 +774,7 @@ class Auth {
try {
$userData = $this->db->selectRow(
- 'SELECT id, password, verified, username FROM users WHERE email = ?',
+ 'SELECT id, email, password, verified, username FROM users WHERE email = ?',
[ $email ]
);
}
@@ -793,7 +793,7 @@ class Auth {
}
if ($userData['verified'] === 1) {
- $this->onLoginSuccessful($userData['id'], $email, $userData['username'], false);
+ $this->onLoginSuccessful($userData['id'], $userData['email'], $userData['username'], false);
// continue to support the old parameter format
if ($rememberDuration === true) { | Store email address in session data as found in the database | delight-im_PHP-Auth | train | php |
10e7c1b0bf5544bf71453373f2d4ac09b35cc74b | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -23,7 +23,7 @@ begin
class CreateAllTables < ActiveRecord::Migration
def self.up
- create_table(:users) {|t| t.string :first_name; t.integer :last_name }
+ create_table(:users) {|t| t.string :first_name }
end
end
ActiveRecord::Migration.verbose = false | Remove last_name column from User table
We are not using it.
<URL> | yuki24_did_you_mean | train | rb |
78f74c57aebe2a61969cd37c159a37c5390eb116 | diff --git a/client/driver/environment/vars.go b/client/driver/environment/vars.go
index <HASH>..<HASH> 100644
--- a/client/driver/environment/vars.go
+++ b/client/driver/environment/vars.go
@@ -99,6 +99,6 @@ func (t TaskEnvironment) SetMeta(m map[string]string) {
func (t TaskEnvironment) SetEnvvars(m map[string]string) {
for k, v := range m {
- t[strings.ToUpper(k)] = v
+ t[k] = v
}
} | Removed capitalization of user-defined envvars. | hashicorp_nomad | train | go |
3100ec226c3c5de98c876102f7f8858b34c8f3d6 | diff --git a/src/B2BApiServiceProvider.php b/src/B2BApiServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/B2BApiServiceProvider.php
+++ b/src/B2BApiServiceProvider.php
@@ -18,13 +18,6 @@ use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
class B2BApiServiceProvider extends IlluminateServiceProvider
{
/**
- * Indicates if loading of the provider is deferred.
- *
- * @var bool
- */
- protected $defer = true;
-
- /**
* Register any application services.
*
* @return void | Remove "$defer = true" from service provider | avto-dev_b2b-api-php-laravel | train | php |
1ea9e944b90931fa8e759b981c354b5a4236ef36 | diff --git a/modules/wyc/src/wyc/io/NewWhileyFileParser.java b/modules/wyc/src/wyc/io/NewWhileyFileParser.java
index <HASH>..<HASH> 100644
--- a/modules/wyc/src/wyc/io/NewWhileyFileParser.java
+++ b/modules/wyc/src/wyc/io/NewWhileyFileParser.java
@@ -348,10 +348,11 @@ public class NewWhileyFileParser {
/**
* Parse a given statement. There are essentially two forms of statement:
* <code>simple</code> and <code>compound</code>. Simple statements (e.g.
- * assignment, <code>print</code>, etc) are always occupy a single line and
- * are terminated by a <code>NewLine</code> token. Compound statements (e.g.
- * <code>if</code>, <code>while</code>, etc) themselves contain blocks of
- * statements and are not (generally) terminated by a <code>NewLine</code>.
+ * assignment, <code>debug</code>, etc) are terminated by a
+ * <code>NewLine</code> token, although they may span multiple lines if an
+ * expression does. Compound statements (e.g. <code>if</code>,
+ * <code>while</code>, etc) themselves contain blocks of statements and are
+ * not (generally) terminated by a <code>NewLine</code>.
*
* @param indent
* The indent level for the current statement. This is needed in | WyC: very nice work on the documentation. | Whiley_WhileyCompiler | train | java |
0eaa7bf92152aca5c8398712af6f4ba0a445fcf4 | diff --git a/tests/test_faz.py b/tests/test_faz.py
index <HASH>..<HASH> 100755
--- a/tests/test_faz.py
+++ b/tests/test_faz.py
@@ -154,7 +154,7 @@ touch file3 file4
"""
-class TestYamt(unittest.TestCase):
+class TestFaz(unittest.TestCase):
def setUp(self):
pass
@@ -238,7 +238,7 @@ class TestMissingInputs(unittest.TestCase):
os.unlink(fname)
-class TestYAMTFileInDir(unittest.TestCase):
+class TestFazFileInDir(unittest.TestCase):
def setUp(self):
for fname in glob.glob(".faz/tmp*"): | reverting devel to a sane state. | hmartiniano_faz | train | py |
d0d6717d96f3af442f1636905fc4cbae55821a67 | diff --git a/broker.go b/broker.go
index <HASH>..<HASH> 100644
--- a/broker.go
+++ b/broker.go
@@ -85,7 +85,7 @@ func (b *Broker) Open(conf *Config) error {
b.conf = conf
if conf.Net.SASL.Enable {
- b.connErr = b.doSASLPlainAuth()
+ b.connErr = b.sendAndReceiveSASLPlainAuth()
if b.connErr != nil {
err = b.conn.Close()
if err == nil {
@@ -490,7 +490,7 @@ func (b *Broker) responseReceiver() {
// When credentials are valid, Kafka returns a 4 byte array of null characters.
// When credentials are invalid, Kafka closes the connection. This does not seem to be the ideal way
// of responding to bad credentials but thats how its being done today.
-func (b *Broker) doSASLPlainAuth() error {
+func (b *Broker) sendAndReceiveSASLPlainAuth() error {
length := 1 + len(b.conf.Net.SASL.User) + 1 + len(b.conf.Net.SASL.Password)
authBytes := make([]byte, length+4) //4 byte length header + auth data
binary.BigEndian.PutUint32(authBytes, uint32(length)) | rename doSASLPlainAuth to sendAndReceiveSASLPlainAuth | Shopify_sarama | train | go |
1b1d63d79c7789ac87160c37d17abd2f1a06c7f8 | diff --git a/packages/slate-cli/src/commands/theme.js b/packages/slate-cli/src/commands/theme.js
index <HASH>..<HASH> 100644
--- a/packages/slate-cli/src/commands/theme.js
+++ b/packages/slate-cli/src/commands/theme.js
@@ -62,7 +62,7 @@ export default function(program) {
writePackageJsonSync(pkg, dirName);
- return startProcess('npm', ['install', '@shopify/slate-tools', '-D'], {
+ return startProcess('npm', ['install', '@shopify/slate-tools', '--save-dev', '--save-exact'], {
cwd: root,
});
}) | save exact version of slate tools on theme gen (#<I>) | Shopify_slate | train | js |
d698a6f0884a043ae31ac43c1e0bee29c7e6bc09 | diff --git a/raiden/tests/utils/smoketest.py b/raiden/tests/utils/smoketest.py
index <HASH>..<HASH> 100644
--- a/raiden/tests/utils/smoketest.py
+++ b/raiden/tests/utils/smoketest.py
@@ -100,11 +100,10 @@ TEST_ACCOUNT_ADDRESS = privatekey_to_address(TEST_PRIVKEY)
def ensure_executable(cmd):
"""look for the given command and make sure it can be executed"""
if not shutil.which(cmd):
- print(
+ raise ValueError(
"Error: unable to locate %s binary.\n"
"Make sure it is installed and added to the PATH variable." % cmd
)
- sys.exit(1)
def deploy_smoketest_contracts( | Remove sys.exit() from inside the smoketest | raiden-network_raiden | train | py |
bbb66d027aa38721a257211c8569c4f7c463cc06 | diff --git a/trollimage/tests/test_image.py b/trollimage/tests/test_image.py
index <HASH>..<HASH> 100644
--- a/trollimage/tests/test_image.py
+++ b/trollimage/tests/test_image.py
@@ -758,7 +758,6 @@ class TestXRImage:
"""
import xarray as xr
- import numpy as np
from trollimage import xrimage
data = xr.DataArray([[0, 0.5, 0.5], [0.5, 0.25, 0.25]], dims=['y', 'x'])
img = xrimage.XRImage(data) | Remove reimport of numpy in test_image.py | pytroll_trollimage | train | py |
caf5e0346c9bd4bdaa62a3e0553e0e478fc8f791 | diff --git a/src/Bartlett/Reflect.php b/src/Bartlett/Reflect.php
index <HASH>..<HASH> 100644
--- a/src/Bartlett/Reflect.php
+++ b/src/Bartlett/Reflect.php
@@ -320,6 +320,8 @@ class Reflect extends AbstractDispatcher implements ManagerInterface
} elseif (strcasecmp($text, 'yield') == 0) {
$tokenName = 'T_YIELD';
}
+ $token[0] = $tokenName;
+ $tokenStack[$id] = $token;
}
$context = array( | fix PHP <I>+ compatibility with tokens came later | llaville_php-reflect | train | php |
1395ffdaa3301d2a2561b1605684f4b46a3f4209 | diff --git a/test/activity/constants_activity.rb b/test/activity/constants_activity.rb
index <HASH>..<HASH> 100644
--- a/test/activity/constants_activity.rb
+++ b/test/activity/constants_activity.rb
@@ -40,7 +40,7 @@ class ConstantsActivity
text_view id: i += 1, hint: 'anim.fade_in', tag: '17432576', text: android.R.anim.fade_in.to_s
# FIXME(uwe): Remove condition when we stop testing Android 2.3
- if android.os.Build::VERSION::SDK_INT >= 10
+ if android.os.Build::VERSION::SDK_INT > 10
text_view id: i += 1, hint: 'attr.actionBarSize', tag: '16843499', text: android.R.attr.actionBarSize.to_s
text_view id: i += 1, hint: 'color.holo_green', tag: '17170452', text: android.R.color.holo_green_light.to_s
end | * Only check for actionBarHeight on Android 4 and newer. | ruboto_ruboto | train | rb |
8972e74b406b3f045c2b172a213a284795b108cc | diff --git a/spyder/preferences/configdialog.py b/spyder/preferences/configdialog.py
index <HASH>..<HASH> 100644
--- a/spyder/preferences/configdialog.py
+++ b/spyder/preferences/configdialog.py
@@ -1051,7 +1051,7 @@ class MainConfigPage(GeneralConfigPage):
tabs = QTabWidget()
tabs.addTab(self.create_tab(screen_resolution_group, interface_group),
- _("Appearance"))
+ _("Interface"))
tabs.addTab(self.create_tab(general_group, sbar_group),
_("Advanced Settings")) | Preferences: Change general config tab from Appearance to Interface | spyder-ide_spyder | train | py |
e5ae0a09c2f2339740371a0c95606c8153458d6e | diff --git a/models/models.go b/models/models.go
index <HASH>..<HASH> 100644
--- a/models/models.go
+++ b/models/models.go
@@ -57,10 +57,17 @@ type GoStepToolkitModel struct {
PackageName string `json:"package_name" yaml:"package_name"`
}
+// SwiftStepToolkitModel ...
+type SwiftStepToolkitModel struct {
+ BinaryLocation string `json:"binary_location,omitempty" yaml:"binary_location,omitempty"`
+ ExecutableName string `json:"executable_name,omitempty" yaml:"executable_name,omitempty"`
+}
+
// StepToolkitModel ...
type StepToolkitModel struct {
- Bash *BashStepToolkitModel `json:"bash,omitempty" yaml:"bash,omitempty"`
- Go *GoStepToolkitModel `json:"go,omitempty" yaml:"go,omitempty"`
+ Bash *BashStepToolkitModel `json:"bash,omitempty" yaml:"bash,omitempty"`
+ Go *GoStepToolkitModel `json:"go,omitempty" yaml:"go,omitempty"`
+ Swift *SwiftStepToolkitModel `json:"swift,omitempty" yaml:"swift,omitempty"`
}
// StepModel ... | Added new swift models. (#<I>) | bitrise-io_stepman | train | go |
e193343fca82bd66b42714238b2f81ba040c7939 | diff --git a/src/widget/note/notewidget.js b/src/widget/note/notewidget.js
index <HASH>..<HASH> 100644
--- a/src/widget/note/notewidget.js
+++ b/src/widget/note/notewidget.js
@@ -43,7 +43,7 @@ define( [ 'enketo-js/Widget', 'jquery', 'enketo-js/plugins' ], function( Widget,
$( this.element ).parent( 'label' ).each( function() {
console.log( 'converting readonly to trigger', $( this ) );
var relevant = $( this ).find( 'input' ).attr( 'data-relevant' ),
- classes = $( this ).attr( 'class' ) ? ' ' + $( this ).attr( 'class' ) : '',
+ classes = $( this ).removeClass( 'question' ).attr( 'class' ) ? ' ' + $( this ).attr( 'class' ) : '',
branch = ( relevant ) ? ' or-branch pre-init' : '',
name = 'name="' + $( this ).find( 'input' ).attr( 'name' ) + '"',
attributes = ( typeof relevant !== 'undefined' ) ? 'data-relevant="' + relevant + '" ' + name : name, | remove question class when transforming to a note | enketo_enketo-core | train | js |
1e1a7c72be1687c2d176795b8fb93402dab181c9 | diff --git a/Block/Menu.php b/Block/Menu.php
index <HASH>..<HASH> 100644
--- a/Block/Menu.php
+++ b/Block/Menu.php
@@ -37,6 +37,11 @@ class Menu extends Template implements IdentityInterface
*/
private $filterGroupBuilder;
+ /**
+ * @var string
+ */
+ private $submenuTemplate = 'menu/sub_menu.phtml';
+
public function __construct(
Template\Context $context,
MenuRepositoryInterface $menuRepository,
@@ -198,7 +203,7 @@ class Menu extends Template implements IdentityInterface
return $this->nodeTypeProvider->getProvider($nodeType);
}
- private function getNodes($level = 0, $parent = null)
+ public function getNodes($level = 0, $parent = null)
{
if (empty($this->nodes)) {
$this->fetchData(); | Add changes that were missed in previous commit | SnowdogApps_magento2-menu | train | php |
36947455ecd1376bbd652670547887e600ae3b9a | diff --git a/lib/y2r/parser.rb b/lib/y2r/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/y2r/parser.rb
+++ b/lib/y2r/parser.rb
@@ -501,11 +501,14 @@ module Y2R
end
if @options[:comments]
- if element["comment_before"]
- node.comment_before = element["comment_before"]
+ comment_before = element["comment_before"]
+ if comment_before && comment_before !~ /\A[ \t]*\z/
+ node.comment_before = comment_before
end
- if element["comment_after"]
- node.comment_after = element["comment_after"]
+
+ comment_after = element["comment_after"]
+ if comment_after && comment_after !~ /\A[ \t]*$\z/
+ node.comment_after = comment_after
end
end | Ignore comments consisting only of whitespace (without newlines)
These comments do not contribute any meaningful information and we don't
want to use them for formatting. | yast_y2r | train | rb |
45292a949dfe0f3f9ee9f5de6a60017b1ac82e9b | diff --git a/dropwizard-db/src/main/java/io/dropwizard/db/DataSourceFactory.java b/dropwizard-db/src/main/java/io/dropwizard/db/DataSourceFactory.java
index <HASH>..<HASH> 100644
--- a/dropwizard-db/src/main/java/io/dropwizard/db/DataSourceFactory.java
+++ b/dropwizard-db/src/main/java/io/dropwizard/db/DataSourceFactory.java
@@ -128,7 +128,7 @@ import java.util.concurrent.TimeUnit;
* </tr>
* <tr>
* <td>{@code maxSize}</td>
- * <td>10</td>
+ * <td>100</td>
* <td>
* The maximum size of the connection pool.
* </td> | Update DataSourceFactory.maxSize api docs
* maxSize is initialized to <I>, not <I> | dropwizard_dropwizard | train | java |
80f1155590331a1d48dc0341d4bef56823070244 | diff --git a/ghost/members-api/lib/stripe/index.js b/ghost/members-api/lib/stripe/index.js
index <HASH>..<HASH> 100644
--- a/ghost/members-api/lib/stripe/index.js
+++ b/ghost/members-api/lib/stripe/index.js
@@ -1,4 +1,5 @@
-const {retrieve, create} = require('./api/stripeRequests');
+const debug = require('ghost-ignition').debug('stripe');
+const {retrieve, list, create, del} = require('./api/stripeRequests');
const api = require('./api');
const STRIPE_API_VERSION = '2019-09-09';
@@ -36,8 +37,19 @@ module.exports = class StripePaymentProcessor {
this._plans.push(plan);
}
+ const webhooks = await list(this._stripe, 'webhookEndpoints', {
+ limit: 100
+ });
+
+ const webhookToDelete = webhooks.data.find((webhook) => {
+ return webhook.url === this._webhookHandlerUrl;
+ });
+
+ if (webhookToDelete) {
+ await del(this._stripe, 'webhookEndpoints', webhookToDelete.id);
+ }
+
try {
- // @TODO Need to somehow not duplicate this every time we boot
const webhook = await create(this._stripe, 'webhookEndpoints', {
url: this._webhookHandlerUrl,
api_version: STRIPE_API_VERSION, | Ensured we do not create multiple webhooks on boot
no-issue
This updates the initialisation logic to fetch all webhooks (we use
limit: <I>, and there are currently a max of <I> webhooks in stripe) and
find one with the corrct url. Once found, delete that webhook. We then
attempt to create a new one, and log out any errors (this is to allow
for local development, creating a webhook with a local url is expected
to fail) | TryGhost_Ghost | train | js |
321de84e6e4612ef82db79b39de2ff5e1ac66b68 | diff --git a/spec/register.js b/spec/register.js
index <HASH>..<HASH> 100644
--- a/spec/register.js
+++ b/spec/register.js
@@ -29,17 +29,21 @@ describe('register a custom validation rule', function() {
expect(validator.passes()).to.be.true;
});
- it('should fail the custom telephone rule registration with a default error message', function() {
- Validator.register('telephone', function(val) {
- return val.match(/^\d{3}-\d{3}-\d{4}$/);
+ it('should override custom rules', function() {
+ Validator.register('string', function(val) {
+ return true;
});
var validator = new Validator({
- phone: '4213-454-9988'
+ field: ['not a string']
}, {
- phone: 'telephone'
+ field: 'string'
});
- expect(validator.passes()).to.be.false;
- expect(validator.fails()).to.be.true;
+
+ expect(validator.passes()).to.be.true;
+ expect(validator.fails()).to.be.false;
+ Validator.register('string', function(val) {
+ return typeof val === 'string';
+ }, 'The :attribute must be a string.');
});
}); | adds test to show that custom rules override provided rules | skaterdav85_validatorjs | train | js |
7aae681cd0656ab2a34a25a8355e632de374580b | diff --git a/Mesh.js b/Mesh.js
index <HASH>..<HASH> 100644
--- a/Mesh.js
+++ b/Mesh.js
@@ -24,6 +24,7 @@ function Mesh(ctx, attributes, indicesInfo, primitiveType) {
this._attributes = [];
this._attributesMap = [];
+ this._hasDivisor = false;
var vertexCount = 0;
@@ -60,7 +61,7 @@ function Mesh(ctx, attributes, indicesInfo, primitiveType) {
buffer: buffer,
location : location,
size: attributeInfo.size || elementSize,
- divisor: attributeInfo.divisor
+ divisor: attributeInfo.divisor || null
}
var attribute = { | Mesh fixed default divisor values
undefined !== null was returning true | pex-gl_pex-context | train | js |
33d9efa1748ed605f16b25d557d7004b74117dfb | diff --git a/crossref/restful.py b/crossref/restful.py
index <HASH>..<HASH> 100644
--- a/crossref/restful.py
+++ b/crossref/restful.py
@@ -295,7 +295,7 @@ class Works(Endpoint):
'content-domain': None,
'directory': validators.directory,
'doi': None,
- 'from-accepted_date': validators.is_date,
+ 'from-accepted-date': validators.is_date,
'from-created-date': validators.is_date,
'from-deposit-date': validators.is_date,
'from-event-end-date': validators.is_date, | Fixed from-accepted-date filter validator
`from-accepted-date` was incorrectly named `from-accepted_date` | fabiobatalha_crossrefapi | train | py |
e15784eb562801f1b5ef6284842dae9e26bc68a1 | diff --git a/txkoji/task.py b/txkoji/task.py
index <HASH>..<HASH> 100644
--- a/txkoji/task.py
+++ b/txkoji/task.py
@@ -15,6 +15,19 @@ except ImportError:
class Task(Munch):
@property
+ def arch(self):
+ """
+ Return an architecture for this task.
+
+ :returns: an arch string (eg "noarch", or "ppc64le"), or None this task
+ has no architecture associated with it.
+ """
+ if self.method == 'buildArch':
+ return self.params[2]
+ if self.method == 'createrepo':
+ return self.params[1]
+
+ @property
def completed(self):
"""
Return a parsed completion datetime for a task. | task: add .arch property
createrepo and buildArch tasks have "arch" in .params. Provide a
property method to access these. | ktdreyer_txkoji | train | py |
ecec454e92537c9c5e6969e589e7ffcf40e4c8e8 | diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go
index <HASH>..<HASH> 100644
--- a/cmd/bootnode/main.go
+++ b/cmd/bootnode/main.go
@@ -68,6 +68,7 @@ func main() {
if err = crypto.SaveECDSA(*genKey, nodeKey); err != nil {
utils.Fatalf("%v", err)
}
+ return
case *nodeKeyFile == "" && *nodeKeyHex == "":
utils.Fatalf("Use -nodekey or -nodekeyhex to specify a private key")
case *nodeKeyFile != "" && *nodeKeyHex != "": | cmd/bootnode: stop after generating/writing nodekey | ethereum_go-ethereum | train | go |
ba64c56a298e2af4b74f3e0f4bc870278fffc665 | diff --git a/service.js b/service.js
index <HASH>..<HASH> 100755
--- a/service.js
+++ b/service.js
@@ -262,7 +262,7 @@ class ServiceConsul extends service.Service {
timeoutForTransition(transition) {
if (transition.name === 'start') {
- return this.startTimeout * 1000; // 600000;
+ return this.startTimeout * 1000;
}
return super.timeoutForTransition(transition);
@@ -309,8 +309,8 @@ class ServiceConsul extends service.Service {
return Promise.resolve();
}), {
- maxAttempts: 5,
- minTimeout: 1000,
+ maxAttempts: 10,
+ minTimeout: 5000,
maxTimeout: this.startTimeout * 1000,
throttle: 1000,
boolRetryFn(e, options) { | fix: increase minTimout slightly | Kronos-Integration_kronos-service-consul | train | js |
ed9e761d8ac1e968b71715eb521b13e1cd35bc42 | diff --git a/lib/multiprocess.js b/lib/multiprocess.js
index <HASH>..<HASH> 100644
--- a/lib/multiprocess.js
+++ b/lib/multiprocess.js
@@ -159,7 +159,7 @@ module.exports = function (opts) {
if (res.error) {
var err = new Error(res.error)
err.notFound = res.notFound
- res.cb(err)
+ req.cb(err)
} else {
req.cb(null, res.value)
} | fix #<I> with this one weird trick | maxogden_dat-core | train | js |
61114cbcc7d981ae1f4cf575907076010f7b5a82 | diff --git a/structr-core/src/main/java/org/structr/core/Services.java b/structr-core/src/main/java/org/structr/core/Services.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/core/Services.java
+++ b/structr-core/src/main/java/org/structr/core/Services.java
@@ -517,7 +517,7 @@ public class Services implements StructrServices {
if (retryCount > 0) {
- logger.warn("Retrying in {} seconds..", (retryDelay * 1000));
+ logger.warn("Retrying in {} seconds..", retryDelay);
Thread.sleep(retryDelay * 1000);
} else { | Minor: corrected logging of retry timeout | structr_structr | train | java |
a5f2639314624ff9b39893db222d0b8f0b0e922e | diff --git a/lib/core/mixin/machine/ssh.rb b/lib/core/mixin/machine/ssh.rb
index <HASH>..<HASH> 100644
--- a/lib/core/mixin/machine/ssh.rb
+++ b/lib/core/mixin/machine/ssh.rb
@@ -44,7 +44,23 @@ module SSH
end
rescue => error
- warn(error, { :i18n => false })
+ if error.is_a?(Net::SSH::AuthenticationFailed) && ssh_config[:keypair]
+ key_file_base = File.join(ssh_config[:key_dir], "#{ssh_config[:key_name]}_#{ssh_config[:keypair].type}")
+
+ Util::Disk.delete(key_file_base)
+ Util::Disk.delete("#{key_file_base}.pub")
+
+ node.keypair = nil
+ ssh_config[:keypair] = nil
+ ssh_config[:reset_conn] = true
+ retry
+ else
+ message = error.message
+ if message.include?("Neither PUB key nor PRIV key")
+ message = "Authentication failed for #{user}@#{public_ip} on port #{ssh_port} (most likely wrong password entered)"
+ end
+ warn(message, { :i18n => false })
+ end
success = false
end
success | Fixing SSH stale key auth issues in the SSH machine mixin. | coralnexus_corl | train | rb |
c8bc9a403b1475a31464d39b21e49c3a9a60dcb0 | diff --git a/txkoji/tests/util.py b/txkoji/tests/util.py
index <HASH>..<HASH> 100644
--- a/txkoji/tests/util.py
+++ b/txkoji/tests/util.py
@@ -35,7 +35,7 @@ class FakeSSLLoginResponse(object):
if self.code == 200:
filename = 'ssllogin/sslLogin.xml'
fixture = os.path.join(FIXTURES_DIR, 'requests', filename)
- with open(fixture) as fp:
+ with open(fixture, 'rb') as fp:
result = fp.read()
return defer.succeed(result)
- return defer.succeed('HTTP error')
+ return defer.succeed(b'HTTP error') | tests: return bytes from FakeSSLLoginResponse content()
treq returns bytes from content(). Do the same in our fixture.
This helps run down an encoding bug on Python 3. | ktdreyer_txkoji | train | py |
87463b4fad3b1434e7c24b100a240f9a29af4dd0 | diff --git a/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java b/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java
index <HASH>..<HASH> 100644
--- a/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java
+++ b/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java
@@ -36,11 +36,15 @@ public class SeleneseTestCase extends TestCase {
}
protected void setUp(String url) throws Exception {
+ setUp(url, "*iexplore");
+ }
+
+ protected void setUp(String url, String browserMode) throws Exception {
super.setUp();
if (url==null) {
url = "http://localhost:" + SeleniumServer.DEFAULT_PORT;
}
- selenium = new DefaultSelenium("localhost", SeleniumServer.DEFAULT_PORT, "*iexplore", url);
+ selenium = new DefaultSelenium("localhost", SeleniumServer.DEFAULT_PORT, browserMode, url);
selenium.start();
} | support passing down browser launcher directive
r<I> | SeleniumHQ_selenium | train | java |
6b3e5932e82c1f1119b9ca2c150ee9a0fb3ab0d3 | diff --git a/bonobo/execution/base.py b/bonobo/execution/base.py
index <HASH>..<HASH> 100644
--- a/bonobo/execution/base.py
+++ b/bonobo/execution/base.py
@@ -81,10 +81,12 @@ class LoopingExecutionContext(Wrapper):
if self._stopped:
return
- self._stopped = True
+ try:
+ with unrecoverable(self.handle_error):
+ self._stack.teardown()
+ finally:
+ self._stopped = True
- with unrecoverable(self.handle_error):
- self._stack.teardown()
def handle_error(self, exc, trace):
return print_error(exc, trace, context=self.wrapped)
diff --git a/bonobo/execution/node.py b/bonobo/execution/node.py
index <HASH>..<HASH> 100644
--- a/bonobo/execution/node.py
+++ b/bonobo/execution/node.py
@@ -22,7 +22,7 @@ class NodeExecutionContext(WithStatistics, LoopingExecutionContext):
@property
def alive(self):
"""todo check if this is right, and where it is used"""
- return self.input.alive and self._started and not self._stopped
+ return self._started and not self._stopped
@property
def alive_str(self): | Do not display transformations as finished before the teardown phase has completed. | python-bonobo_bonobo | train | py,py |
d95563c39245c4a3667903bbf08a4fe550cbbe99 | diff --git a/util/src/main/java/io/kubernetes/client/util/WebSockets.java b/util/src/main/java/io/kubernetes/client/util/WebSockets.java
index <HASH>..<HASH> 100644
--- a/util/src/main/java/io/kubernetes/client/util/WebSockets.java
+++ b/util/src/main/java/io/kubernetes/client/util/WebSockets.java
@@ -93,6 +93,7 @@ public class WebSockets {
headers.put(STREAM_PROTOCOL_HEADER, allProtocols);
headers.put(HttpHeaders.CONNECTION, HttpHeaders.UPGRADE);
headers.put(HttpHeaders.UPGRADE, SPDY_3_1);
+ String[] localVarAuthNames = new String[] {"BearerToken"};
Request request =
client.buildRequest(
@@ -103,7 +104,7 @@ public class WebSockets {
null,
headers,
new HashMap<String, Object>(),
- new String[0],
+ localVarAuthNames,
null);
streamRequest(request, client, listener);
} | set BearerToken in buildRequest fixes #<I> | kubernetes-client_java | train | java |
220be738a279be5da8d968cb7238c9f93b0a30d0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,7 @@
-from distutils.core import setup
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
import os
@@ -25,6 +28,7 @@ setup(
download_url='https://github.com/dresiu/compressor_requirejs/tarball/1.2',
keywords=['compressor_requirejs', 'django_compressor', 'django', 'compressor', 'requirejs'],
requires=['django_compressor', 'PyExecJs'],
+ install_requires=['django_compressor>=1.3', 'PyExecJs>=1.0.4'],
classifiers=["Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers", | install_requires added to setup | dresiu_compressor_requirejs | train | py |
cee751798c6f8d027ee33acda107a32d03b32031 | diff --git a/compilers/es6.js b/compilers/es6.js
index <HASH>..<HASH> 100644
--- a/compilers/es6.js
+++ b/compilers/es6.js
@@ -38,7 +38,8 @@ exports.compile = function(load, opts, loader) {
if (loader.parser == '6to5') {
options = loader.to5Options || {};
options.modules = 'system';
- options.sourceMap = true;
+ if (opts.sourceMaps)
+ options.sourceMap = true;
options.filename = load.address;
options.filenameRelative = load.name;
options.code = true;
@@ -54,8 +55,9 @@ exports.compile = function(load, opts, loader) {
var output = to5.transform(source, options);
source = output.code;
- if (output.map)
+ if (output.map) {
load.metadata.sourceMap = output.map;
+ }
}
// NB todo - create an inline 6to5 transformer to do import normalization | only compute source map if option is set | systemjs_builder | train | js |
e1a0b7204ec1c591ed80ae047d3982ea97504d3a | diff --git a/cmd/backup/main.go b/cmd/backup/main.go
index <HASH>..<HASH> 100644
--- a/cmd/backup/main.go
+++ b/cmd/backup/main.go
@@ -7,6 +7,7 @@ import (
"log"
"os"
"path/filepath"
+ "strings"
"time"
"github.com/mitchellh/goamz/aws"
@@ -41,7 +42,7 @@ func main() {
backupErrors := []error{}
for _, instanceDir := range instanceDirs {
- if instanceDir.Name()[0] == '.' {
+ if strings.HasPrefix(instanceDir.Name(), ".") {
continue
}
err = backupInstance(instanceDir, config, bucket) | tiny readability improvement in backup/main.go | pivotal-cf_cf-redis-broker | train | go |
d89992321004355e8fa4e65b39edc97a28e7013e | diff --git a/core/frontend/services/themes/middleware.js b/core/frontend/services/themes/middleware.js
index <HASH>..<HASH> 100644
--- a/core/frontend/services/themes/middleware.js
+++ b/core/frontend/services/themes/middleware.js
@@ -82,7 +82,7 @@ function updateLocalTemplateOptions(req, res, next) {
email: req.member.email,
name: req.member.name,
subscriptions: req.member.stripe.subscriptions,
- subscribed: req.member.stripe.subscriptions.length !== 0
+ paid: req.member.stripe.subscriptions.length !== 0
} : null;
hbs.updateLocalTemplateOptions(res.locals, _.merge({}, localTemplateOptions, { | Renamed @member.subscribed to @member.paid
no-issue
To match the content gating terminology | TryGhost_Ghost | train | js |
bd29dab0d8c191c944588acc2822ffb9786a05b8 | diff --git a/baton/static/baton/app/src/core/ChangeList.js b/baton/static/baton/app/src/core/ChangeList.js
index <HASH>..<HASH> 100644
--- a/baton/static/baton/app/src/core/ChangeList.js
+++ b/baton/static/baton/app/src/core/ChangeList.js
@@ -58,7 +58,7 @@ let ChangeList = {
.click(() => {
self.modal.toggle()
})
- }, 100)
+ }, 200)
} else {
_filtersToggler
.click(() => { | adds more delay in prev commit | otto-torino_django-baton | train | js |
2f5b191e03f1648c062579b70e006245aae25396 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,6 +27,6 @@ setup(name='scikit-dsp-comm',
test_suite='nose.collector',
tests_require=['nose','numpy', 'tox'],
extras_require={
- 'helpers': ['pyaudio', 'pyrtlsdr']
+ 'helpers': ['pyaudio', 'pyrtlsdr', 'ipywidgets']
}
) | Adding ipywidgets in support of pyaudio_helper | mwickert_scikit-dsp-comm | train | py |
0c3a7379d1854dc949f04334e2cf1b6950fa495f | diff --git a/Throw/TerminalInterface.py b/Throw/TerminalInterface.py
index <HASH>..<HASH> 100644
--- a/Throw/TerminalInterface.py
+++ b/Throw/TerminalInterface.py
@@ -108,7 +108,10 @@ class TerminalInterface(object):
def __init__(self, stream=sys.stdout):
# Try to import curses and setup a terminal if our output is a TTY.
if stream.isatty() and _has_curses:
- self._backend = TerminalInterface.CursesBackend(stream)
+ try:
+ self._backend = TerminalInterface.CursesBackend(stream)
+ except curses.error:
+ self._backend = TerminalInterface.DumbBackend(stream)
else:
# By default, use a dumb terminal backend
self._backend = TerminalInterface.DumbBackend(stream) | fail gracefully if curses can't get the terminal info | rjw57_throw | train | py |
c2e2d1e79d3b66e7b9af7a85874b77c64f01f0d6 | diff --git a/src/Entities/Products/Product.php b/src/Entities/Products/Product.php
index <HASH>..<HASH> 100644
--- a/src/Entities/Products/Product.php
+++ b/src/Entities/Products/Product.php
@@ -274,6 +274,14 @@ class Product
}
/**
+ * @return bool
+ */
+ public function hasImages()
+ {
+ return sizeof($this->getImages()) > 0;
+ }
+
+ /**
* @return array|Product[]
*/
public function getGroupItems() | Added hasImages helper method on Product | ordercloud_ordercloud-php | train | php |
dff922ab2d7acb46e287b75ab165e0d88441990a | diff --git a/examples/simple_loop.rb b/examples/simple_loop.rb
index <HASH>..<HASH> 100644
--- a/examples/simple_loop.rb
+++ b/examples/simple_loop.rb
@@ -1,3 +1,12 @@
+# Simple Loop
+#
+# Run this file to create a SimpleLoop.class file.
+# It takes one argument and prints it out in a loop
+# until you stop the process.
+#
+# ruby examples/simple_loop.rb
+# java SimpleLoop repeatMe
+#
require 'bitescript'
include BiteScript | Added a note about the simple loop example explaining how it works. | headius_bitescript | train | rb |
320c22e7e88c234521ae43c15eb722cd13a74a25 | diff --git a/client/core/app.js b/client/core/app.js
index <HASH>..<HASH> 100644
--- a/client/core/app.js
+++ b/client/core/app.js
@@ -84,9 +84,14 @@ box, session, addons, box, files, commands, menu, statusbar, palette, tabs, pane
hr.Offline.on("state", function(state) {
if (!state) {
alerts.show("Caution: Connection lost, Workspace is now in Offline mode", 5000);
+ if (!localfs.isSyncEnabled()) {
+ dialogs.alert("Caution: Connection lost", "Offline file synchronization is not enabled for this workspace, enable it first when online.");
+ }
} else {
- alerts.show("Connection detected. Switching to Codebox online", 5000);
- location.reload();
+ dialogs.confirm("Connection detected", "Save changes before refreshing. Do you want to refresh now (unsaved changes will be lost) ?")
+ .then(function() {
+ location.reload();
+ });
}
});
hr.Offline.on("update", function() {
diff --git a/client/core/localfs.js b/client/core/localfs.js
index <HASH>..<HASH> 100644
--- a/client/core/localfs.js
+++ b/client/core/localfs.js
@@ -511,6 +511,7 @@ define([
return autoSync();
},
'enableSync': enableSync,
+ 'isSyncEnabled': function() { return _syncIsEnable; },
'filer': filer,
'syncDuration': syncDuration,
'setIgnoredFiles': setIgnoredFiles | Add alerts when switching from offline/online | CodeboxIDE_codebox | train | js,js |
b0f807d11d2aea98a4b6bfb71e06d848f304ec2e | diff --git a/source/Yandex/Geo/GeoObject.php b/source/Yandex/Geo/GeoObject.php
index <HASH>..<HASH> 100644
--- a/source/Yandex/Geo/GeoObject.php
+++ b/source/Yandex/Geo/GeoObject.php
@@ -131,6 +131,9 @@ class GeoObject
if (isset($this->_data['metaDataProperty']['GeocoderMetaData']['AddressDetails']['Country']['AdministrativeArea']['SubAdministrativeArea']['Locality']['LocalityName'])) {
$result = $this->_data['metaDataProperty']['GeocoderMetaData']['AddressDetails']['Country']['AdministrativeArea']['SubAdministrativeArea']['Locality']['LocalityName'];
}
+ elseif(isset($this->_data['metaDataProperty']['GeocoderMetaData']['AddressDetails']['Country']['Locality']['LocalityName'])) {
+ $result = $this->_data['metaDataProperty']['GeocoderMetaData']['AddressDetails']['Country']['Locality']['LocalityName'];
+ }
return $result;
} | Not return the name of the city, of the city with federal status | yandex-php_php-yandex-geo | train | php |
ec341b02c8a3efb74e1a87e5806abd9bf87e3ef2 | diff --git a/pyradio/radio.py b/pyradio/radio.py
index <HASH>..<HASH> 100644
--- a/pyradio/radio.py
+++ b/pyradio/radio.py
@@ -229,7 +229,7 @@ class PyRadio(object):
self.setupAndDrawScreen()
return
- if char == ord(' '):
+ if char == ord(' ') or char == curses.KEY_LEFT or char == ord('h'):
if self.player.isPlaying():
self.player.close()
self.log.write('Playback stopped')
@@ -239,6 +239,14 @@ class PyRadio(object):
self.refreshBody()
return
+ if char == curses.KEY_RIGHT or char == ord('l'):
+ if self.player.isPlaying():
+ self.player.close()
+ self.log.write('Playback stopped')
+ self.playSelection()
+ self.refreshBody()
+ return
+
if char == curses.KEY_DOWN or char == ord('j'):
self.setStation(self.selection + 1)
self.refreshBody() | adding keys, left arrow, h: stop playing / right arrow, l: stop playing and start with current selection | coderholic_pyradio | train | py |
ee7b04103e04bfaa36e530e8b6866612d0907a32 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -48,6 +48,12 @@ extensions = [
'recommonmark',
]
+# Hack to make sphinx_js work with python 3.10
+import collections
+import collections.abc
+if not hasattr(collections, 'Mapping'):
+ collections.Mapping = collections.abc.Mapping
+
try:
import sphinxcontrib.spelling
except ImportError: | Copy back collections.Mapping to make sphinx_js work | Dallinger_Dallinger | train | py |
d733e93787e1c094bedf8bb9901a12cc1ac0ede5 | diff --git a/backtrader/analyzer.py b/backtrader/analyzer.py
index <HASH>..<HASH> 100644
--- a/backtrader/analyzer.py
+++ b/backtrader/analyzer.py
@@ -78,6 +78,8 @@ class MetaAnalyzer(MetaParams):
class Analyzer(six.with_metaclass(MetaAnalyzer, object)):
+ csv = True
+
def __len__(self):
return len(self.strategy)
@@ -114,6 +116,12 @@ class Analyzer(six.with_metaclass(MetaAnalyzer, object)):
self.stop()
+ def notify_order(self, order):
+ pass
+
+ def notify_trade(self, trade):
+ pass
+
def next(self):
pass | Analyzer receives new hook methods notify_trade and notify_order for better analysis during next phases | backtrader_backtrader | train | py |
42347c23342e46f54480d69f22c6a720acfcc793 | diff --git a/lib/fb_graph/event.rb b/lib/fb_graph/event.rb
index <HASH>..<HASH> 100644
--- a/lib/fb_graph/event.rb
+++ b/lib/fb_graph/event.rb
@@ -31,9 +31,9 @@ module FbGraph
if (end_time = attributes[:end_time])
@end_time = case end_time
when String
- Time.parse(end_time).utc
+ Time.parse(end_time)
when Fixnum
- Time.at(end_time).utc
+ Time.at(end_time)
end
end
if attributes[:venue] | event.end_time shouldn't be converted to utc | nov_fb_graph | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.