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 |
|---|---|---|---|---|---|
cce901ccba73e1bab68c5970f8d7cd2b4cd4af5e | diff --git a/src/Common/Controller/Base.php b/src/Common/Controller/Base.php
index <HASH>..<HASH> 100644
--- a/src/Common/Controller/Base.php
+++ b/src/Common/Controller/Base.php
@@ -497,14 +497,8 @@ abstract class Base extends \MX_Controller
if (!$oRoutesService->update()) {
throw new NailsException('Failed to generate routes_app.php. ' . $oRoutesService->lastError(), 500);
} else {
-
- // Routes exist now, instruct the browser to try again
$oInput = Factory::service('Input');
- if ($oInput->post()) {
- redirect($oInput->server('REQUEST_URI'), 'Location', 307);
- } else {
- redirect($oInput->server('REQUEST_URI'));
- }
+ redirect($oInput->server('REQUEST_URI'), 'auto', 307);
}
}
} | Using <I> redirect for all route regeneration requests | nails_common | train | php |
43850d7b07d8eba9b42d3eafb2c6007c825fa732 | diff --git a/assets/js/addons-materialise/picker.js b/assets/js/addons-materialise/picker.js
index <HASH>..<HASH> 100644
--- a/assets/js/addons-materialise/picker.js
+++ b/assets/js/addons-materialise/picker.js
@@ -81,7 +81,7 @@
onStop : false,
selectMonths : false,
selectYears : false,
- today : 'Today',
+ today : '',
weekdaysFull : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
weekdaysShort : ['S', 'M', 'T', 'W', 'T', 'F', 'S']
} | Disable today button in picker by default | Daemonite_material | train | js |
fb8b17c720683fab62925f9765fc65c9e0a167c4 | diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -127,7 +127,7 @@ HEADER
end.compact
# find all migration keys used in this table
- keys = [:name, :limit, :precision, :scale, :default, :null] & column_specs.map(&:keys).flatten
+ keys = [:name, :limit, :precision, :scale, :default, :null]
# figure out the lengths for each column based on above keys
lengths = keys.map { |key| | just use the list of formatting keys we care about | rails_rails | train | rb |
0cf0561f65d51c33e3515ec984608ee06fbb6011 | diff --git a/gitignore.go b/gitignore.go
index <HASH>..<HASH> 100644
--- a/gitignore.go
+++ b/gitignore.go
@@ -47,6 +47,9 @@ func NewGitIgnoreFromReader(path string, r io.Reader) gitIgnore {
if len(line) == 0 || strings.HasPrefix(line, "#") {
continue
}
+ if strings.HasPrefix(line, `\#`) {
+ line = strings.TrimPrefix(line, `\`)
+ }
if strings.HasPrefix(line, "!") {
g.acceptPatterns.add(strings.TrimPrefix(line, "!"))
diff --git a/gitignore_test.go b/gitignore_test.go
index <HASH>..<HASH> 100644
--- a/gitignore_test.go
+++ b/gitignore_test.go
@@ -40,6 +40,7 @@ func TestMatch(t *testing.T) {
assert{[]string{"*.txt", "!b.txt"}, file{"dir/b.txt", false}, false},
assert{[]string{"dir/*.txt", "!dir/b.txt"}, file{"dir/b.txt", false}, false},
assert{[]string{"dir/*.txt", "!/b.txt"}, file{"dir/b.txt", false}, true},
+ assert{[]string{`\#a.txt`}, file{"#a.txt", false}, true},
}
for _, assert := range asserts { | Support escaped hash
gitignore document says
> A line starting with # serves as a comment. Put a backslash ("\") in front
> of the first hash for patterns that begin with a hash. | monochromegane_go-gitignore | train | go,go |
60e53cced50a83766f9ab90b1246bb5937074cee | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -39,8 +39,11 @@ function droonga(application, params) {
application.connectionPool = connectionPool;
if (params.syncHostNames &&
- typeof connectionPool.startSyncHostNamesFromCluster == 'function')
- connectionPool.startSyncHostNamesFromCluster();
+ typeof connectionPool.startSyncHostNamesFromCluster == 'function') {
+ params.server.on('listening', function() {
+ connectionPool.startSyncHostNamesFromCluster();
+ });
+ }
}
exports.initialize = droonga; | Start to connect the backend only when the server is correctly started | droonga_express-droonga | train | js |
98d18b43b327d214de5a654c12df08fe7c2443af | diff --git a/lib/raven/configuration.rb b/lib/raven/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/raven/configuration.rb
+++ b/lib/raven/configuration.rb
@@ -28,6 +28,9 @@ module Raven
# Which exceptions should never be sent
attr_accessor :excluded_exceptions
+ # Processors to run on data before sending upstream
+ attr_accessor :processors
+
attr_reader :current_environment
def initialize
@@ -37,6 +40,7 @@ module Raven
self.current_environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
self.send_modules = true
self.excluded_exceptions = []
+ self.processors = [Raven::Processor::SanitizeData]
end
def server=(value) | Allow processors to be registered, and install SanitizeData by default | getsentry_raven-ruby | train | rb |
9ac67acc94441274987b975b94aa09e9bb016bac | diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py
index <HASH>..<HASH> 100644
--- a/salt/states/saltmod.py
+++ b/salt/states/saltmod.py
@@ -349,11 +349,11 @@ def function(
ret['changes'] = {'ret': changes}
if fail:
ret['result'] = False
- ret['comment'] = 'Run failed on minions: {0}'.format(', '.join(fail))
+ ret['comment'] = 'Running function {0} failed on minions: {1}'.format(name, ', '.join(fail))
else:
- ret['comment'] = 'Functions ran successfully.'
+ ret['comment'] = 'Function ran successfully.'
if changes:
- ret['comment'] += ' Functions ran on {0}.'.format(', '.join(changes))
+ ret['comment'] += ' Function {0} ran on {1}.'.format(name, ', '.join(changes))
if failures:
ret['comment'] += '\nFailures:\n'
for minion, failure in failures.iteritems(): | a bit more verbose | saltstack_salt | train | py |
761c7fb1880ee9769a17abf9f900de9263d23c61 | diff --git a/coursera/__init__.py b/coursera/__init__.py
index <HASH>..<HASH> 100644
--- a/coursera/__init__.py
+++ b/coursera/__init__.py
@@ -1 +1 @@
-__version__ = '0.9.0'
+__version__ = '0.10.0' | coursera: Update version number.
[ci skip] | coursera-dl_coursera-dl | train | py |
89334dde66dd47476ffa6db0d639c5dbe39cba49 | diff --git a/gitreceive/receiver/flynn-receive.go b/gitreceive/receiver/flynn-receive.go
index <HASH>..<HASH> 100644
--- a/gitreceive/receiver/flynn-receive.go
+++ b/gitreceive/receiver/flynn-receive.go
@@ -31,7 +31,6 @@ func init() {
var typesPattern = regexp.MustCompile("types.* -> (.+)\n")
const blobstoreURL = "http://blobstore.discoverd"
-const scaleTimeout = 20 * time.Second
func parsePairs(args *docopt.Args, str string) (map[string]string, error) {
pairs := args.All[str].([]string)
@@ -224,7 +223,7 @@ Options:
}
fmt.Println("=====> Waiting for web job to start...")
- err = watcher.WaitFor(ct.JobEvents{"web": ct.JobUpEvents(1)}, scaleTimeout, func(e *ct.Job) error {
+ err = watcher.WaitFor(ct.JobEvents{"web": ct.JobUpEvents(1)}, time.Duration(app.DeployTimeout)*time.Second, func(e *ct.Job) error {
switch e.State {
case ct.JobStateUp:
fmt.Println("=====> Default web formation scaled to 1") | gitreceive/receiver: Use deploy timeout when waiting for web job
This typically happens on the first deploy of an app.
Closes #<I> | flynn_flynn | train | go |
59dd65004352461f7e3082b12eb850513dd588a9 | diff --git a/bcbio/structural/prioritize.py b/bcbio/structural/prioritize.py
index <HASH>..<HASH> 100644
--- a/bcbio/structural/prioritize.py
+++ b/bcbio/structural/prioritize.py
@@ -163,7 +163,10 @@ def _cnvkit_prioritize(sample, genes, allele_file, metrics_file):
adf = pd.read_table(allele_file)
if len(genes) > 0:
adf = adf[adf["gene"].str.contains("|".join(genes))]
- adf = adf[["chromosome", "start", "end", "cn", "cn1", "cn2"]]
+ if "cn1" in adf.columns and "cn2" in adf.columns:
+ adf = adf[["chromosome", "start", "end", "cn", "cn1", "cn2"]]
+ else:
+ adf = adf[["chromosome", "start", "end", "cn"]]
df = pd.merge(mdf, adf, on=["chromosome", "start", "end"])
df = df[df["cn"] != 2]
if len(df) > 0: | CNVkit: handle cases without allele copy numbers
Avoid failing if we could not use VCF input to infer allele specific
copy numbers. | bcbio_bcbio-nextgen | train | py |
b116df2554915f14398ea3f1ebb8ebefd65150e7 | diff --git a/src/main/java/hex/NeuralNet.java b/src/main/java/hex/NeuralNet.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hex/NeuralNet.java
+++ b/src/main/java/hex/NeuralNet.java
@@ -38,7 +38,7 @@ public class NeuralNet extends ValidatedJob {
public Activation activation = Activation.Tanh;
@API(help = "Input layer dropout ratio", filter = Default.class, dmin = 0, dmax = 1, json = true)
- public double input_dropout_ratio = 0.2;
+ public double input_dropout_ratio = 0.0;
@API(help = "Hidden layer sizes, e.g. 1000, 1000. Grid search: (100, 100), (200, 200)", filter = Default.class, json = true)
public int[] hidden = new int[] { 200, 200 };
@@ -125,11 +125,6 @@ public class NeuralNet extends ValidatedJob {
arg.disable("Regression is not currently supported.");
}
if (arg._name.equals("ignored_cols")) arg.disable("Not currently supported.");
- if (arg._name.equals("input_dropout_ratio") &&
- (activation != Activation.RectifierWithDropout && activation != Activation.TanhWithDropout)
- ) {
- arg.disable("Only with Dropout.", inputArgs);
- }
if(arg._name.equals("initial_weight_scale") &&
(initial_weight_distribution == InitialWeightDistribution.UniformAdaptive)
) { | Default input dropout ratio to zero for NeuralNet (which now also allows input
dropout without using Dropout). | h2oai_h2o-2 | train | java |
ae4f3b24d81a21e05b6e777aa5ba26b1ed61bba1 | diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/libs/view/view.test.php
+++ b/cake/tests/cases/libs/view/view.test.php
@@ -245,27 +245,6 @@ class ViewTest extends CakeTestCase {
$this->PostsController->viewPath = 'posts';
$this->PostsController->index();
$this->View = new View($this->PostsController);
- }
-
-/**
- * tearDown method
- *
- * @access public
- * @return void
- */
- function tearDown() {
- unset($this->View);
- unset($this->PostsController);
- unset($this->Controller);
- }
-
-/**
- * endTest
- *
- * @access public
- * @return void
- */
- function startTest() {
App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(
@@ -276,12 +255,15 @@ class ViewTest extends CakeTestCase {
}
/**
- * endTest
+ * tearDown method
*
* @access public
* @return void
*/
- function endTest() {
+ function tearDown() {
+ unset($this->View);
+ unset($this->PostsController);
+ unset($this->Controller);
App::build();
} | Moving logic from methods that will be probably deprecated | cakephp_cakephp | train | php |
6bba998945c0859907f64fe8f27195b54cd43bde | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ setup(
include_package_data = True,
- scripts = ['calloway/bin/generate_reqs',],
+ scripts = ['calloway/bin/generate_reqs','calloway/bin/check_for_updates'],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment', | Added the new script to the setup.py so it is installed. | callowayproject_Calloway | train | py |
d6b36fc8a941cc910af4466e896414dfe98650fe | diff --git a/cheroot/test/test_core.py b/cheroot/test/test_core.py
index <HASH>..<HASH> 100644
--- a/cheroot/test/test_core.py
+++ b/cheroot/test/test_core.py
@@ -282,8 +282,8 @@ def test_content_length_required(test_client):
def test_large_request(test_client_with_defaults):
"""Test GET query with maliciously large Content-Length."""
# If the server's max_request_body_size is not set (i.e. is set to 0)
- # then this will result in an `OverflowError: Python int too large to convert to C ssize_t`
- # in the server.
+ # then this will result in an `OverflowError: Python int too large to
+ # convert to C ssize_t` in the server.
# We expect that this should instead return that the request is too
# large.
c = test_client_with_defaults.get_connection() | Wrap a line that's too long in test_core
Hotfix of a typo from PR #<I> | cherrypy_cheroot | train | py |
a7fae43d6a6285c851309790bbe2f9206db39f7a | diff --git a/lib/driver.js b/lib/driver.js
index <HASH>..<HASH> 100644
--- a/lib/driver.js
+++ b/lib/driver.js
@@ -206,7 +206,7 @@ class IosDriver extends BaseDriver {
// if we have an ipa file, set it in opts
if (this.opts.app) {
- let ext = this.opts.app.substring(this.opts.app.length - 4).toLowerCase();
+ let ext = this.opts.app.substring(this.opts.app.length - 3).toLowerCase();
if (ext === 'ipa') {
this.opts.ipa = this.opts.app;
} | fix set in opts ipa file
fix incorrect substring | appium_appium-ios-driver | train | js |
b883d74982d24d0340814651125e68001c639c69 | diff --git a/src/article/shared/FigureLabelGenerator.js b/src/article/shared/FigureLabelGenerator.js
index <HASH>..<HASH> 100644
--- a/src/article/shared/FigureLabelGenerator.js
+++ b/src/article/shared/FigureLabelGenerator.js
@@ -20,7 +20,7 @@ export default class FigureLabelGenerator {
}
getLabel (...defs) {
- if (!defs || defs.length === 0) return this.config.invalid
+ if (defs.length === 0) return this.config.invalid
// Note: normalizing args so that every def is a tuple
defs = defs.map(d => {
if (!isArray(d)) return [d]
diff --git a/src/kit/shared/throwMethodIsAbstract.js b/src/kit/shared/throwMethodIsAbstract.js
index <HASH>..<HASH> 100644
--- a/src/kit/shared/throwMethodIsAbstract.js
+++ b/src/kit/shared/throwMethodIsAbstract.js
@@ -1,3 +1,3 @@
-export function throwMethodIsAbstract () {
+export default function throwMethodIsAbstract () {
throw new Error('This method is abstract.')
} | Fix issues detected by lgtm. | substance_texture | train | js,js |
b4796d5548aa514646d753eba5ca1efe6e99cfc8 | diff --git a/src/Client.js b/src/Client.js
index <HASH>..<HASH> 100644
--- a/src/Client.js
+++ b/src/Client.js
@@ -621,8 +621,10 @@ class Client extends EventEmitter {
callback(err);
reject(err);
} else {
- if (self.getServer("id", res.body.guild.id)) {
- resolve(self.getServer("id", res.body.guild.id));
+ var server = self.getServer("id", res.body.guild.id);
+ if (server) {
+ callback(null, server);
+ resolve(server);
} else {
self.serverCreateListener[res.body.guild.id] = [resolve, callback];
} | Fix callback not being called in Client.joinServer | discordjs_discord.js | train | js |
16ec05caf8608c164942c8dade0f5fd73f2d6f6c | diff --git a/closure/goog/debug/debug.js b/closure/goog/debug/debug.js
index <HASH>..<HASH> 100644
--- a/closure/goog/debug/debug.js
+++ b/closure/goog/debug/debug.js
@@ -399,7 +399,8 @@ goog.debug.getStacktraceHelper_ = function(fn, visited) {
} else if (fn && visited.length < goog.debug.MAX_STACK_DEPTH) {
sb.push(goog.debug.getFunctionName(fn) + '(');
var args = fn.arguments;
- for (var i = 0; i < args.length; i++) {
+ // Args may be null for some special functions such as host objects or eval.
+ for (var i = 0; args && i < args.length; i++) {
if (i > 0) {
sb.push(', ');
} | At least in newish Chromes eval does not have an arguments properties, so the loop that is being patched here fails with an NPE.
This breaks i.e. the module manager were syntax errors in late loaded code can't be reported correctly.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
f0ff6f027e4aa9e3faebcd5f192bd8781d47c5f1 | diff --git a/src/main/java/water/util/MRUtils.java b/src/main/java/water/util/MRUtils.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/util/MRUtils.java
+++ b/src/main/java/water/util/MRUtils.java
@@ -319,11 +319,11 @@ public class MRUtils {
return sampleFrameStratified(fr, label, sampling_ratios, seed+1, debug, ++count);
}
- // shuffle intra-chunk
- Frame shuffled = shuffleFramePerChunk(r, seed+0x580FF13);
- r.delete();
-
- return shuffled;
+// // shuffle intra-chunk
+// Frame shuffled = shuffleFramePerChunk(r, seed + 0x580FF13);
+// r.delete();
+// return shuffled;
+ return r;
}
/** | Don't shuffle intra-chunk after stratified sampling. | h2oai_h2o-2 | train | java |
8657902cae694470dc316b60a186a8dcc9f84f07 | diff --git a/lib/model.rb b/lib/model.rb
index <HASH>..<HASH> 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -22,6 +22,10 @@ module OpenTox
resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
end
+
+ def self.find_all
+ RestClient.get(@@config[:services]["opentox-model"]).chomp.split("\n")
+ end
=begin
include Owl
@@ -49,10 +53,6 @@ module OpenTox
lazar
end
- def self.find_all
- RestClient.get(@@config[:services]["opentox-model"]).split("\n")
- end
-
def self.find(uri)
yaml = RestClient.get(uri, :accept => "application/x-yaml")
OpenTox::Model::Lazar.from_yaml(yaml)
diff --git a/lib/task.rb b/lib/task.rb
index <HASH>..<HASH> 100644
--- a/lib/task.rb
+++ b/lib/task.rb
@@ -105,7 +105,7 @@ module OpenTox
def wait_for_completion
until self.completed? or self.failed?
- sleep 1
+ sleep 0.1
end
end | tests for yaml representation working | opentox_lazar | train | rb,rb |
6ea62569b38ab595cc424bacca4a01afb45b9738 | diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -214,6 +214,9 @@ class Client {
if (! is_resource($ch) || ! $ret)
return false;
+ if (array_key_exists(CURLOPT_PROXY, $this->options) && version_compare(curl_version()['version'], '7.30.0', '<'))
+ list($headers, $ret) = preg_split('/\r\n\r\n|\r\r|\n\n/', $ret, 2);
+
$headers_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
if (is_numeric($headers_size) && $headers_size > 0) {
$headers = trim(substr($ret, 0, $headers_size)); | Workaround for cURL < <I> bug with CURLINFO_HEADER_SIZE and proxies | jejem_http-client | train | php |
85e9fe54c7af573f4280a4265c3c88cdb5e3ffae | diff --git a/util/settings/settings.go b/util/settings/settings.go
index <HASH>..<HASH> 100644
--- a/util/settings/settings.go
+++ b/util/settings/settings.go
@@ -368,7 +368,7 @@ const (
kustomizePathPrefixKey = "kustomize.path"
// anonymousUserEnabledKey is the key which enables or disables anonymous user
anonymousUserEnabledKey = "users.anonymous.enabled"
- // anonymousUserEnabledKey is the key which specifies token expiration duration
+ // userSessionDurationKey is the key which specifies token expiration duration
userSessionDurationKey = "users.session.duration"
// diffOptions is the key where diff options are configured
resourceCompareOptionsKey = "resource.compareoptions" | chore: fix typo in godoc string (#<I>)
While investigating how to disable the new terminal feature introduced in version <I>, came across this accidental copy/paste. Figured would boyscout it in. | argoproj_argo-cd | train | go |
0e24ecabdd531284b9e5ecb5f5c0b65a7dbd3117 | diff --git a/exhale/__init__.py b/exhale/__init__.py
index <HASH>..<HASH> 100644
--- a/exhale/__init__.py
+++ b/exhale/__init__.py
@@ -8,7 +8,7 @@
from __future__ import unicode_literals
-__version__ = "0.2.1"
+__version__ = "0.2.2.dev"
def environment_ready(app): | there will be another minor release before 1.x | svenevs_exhale | train | py |
cccd821613618e449e308810f4349e76779364b8 | diff --git a/pyphi/distance.py b/pyphi/distance.py
index <HASH>..<HASH> 100644
--- a/pyphi/distance.py
+++ b/pyphi/distance.py
@@ -265,8 +265,8 @@ def intrinsic_difference(p, q):
*Sci Rep*, 10, 18803. https://doi.org/10.1038/s41598-020-75943-4
Args:
- p (float): The first probability distribution.
- q (float): The second probability distribution.
+ p (np.ndarray[float]): The first probability distribution.
+ q (np.ndarray[float]): The second probability distribution.
Returns:
float: The intrinsic difference.
@@ -289,8 +289,8 @@ def absolute_intrinsic_difference(p, q):
and references.
Args:
- p (float): The first probability distribution.
- q (float): The second probability distribution.
+ p (np.ndarray[float]): The first probability distribution.
+ q (np.ndarray[float]): The second probability distribution.
Returns:
float: The absolute intrinsic difference. | distance: Fix arg type in docstrings for ID | wmayner_pyphi | train | py |
aff3a39d4feb82a310c555753910ed21265760f5 | diff --git a/skpy/msg.py b/skpy/msg.py
index <HASH>..<HASH> 100644
--- a/skpy/msg.py
+++ b/skpy/msg.py
@@ -491,7 +491,16 @@ class SkypeCardMsg(SkypeMsg):
"text": self.body,
"buttons": [button.data for button in self.buttons]},
"contentType": "application/vnd.microsoft.card.hero"}],
- "type": "message/card"}
+ "type": "message/card",
+ "timestamp": datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%fZ")}
+ if self.chatId:
+ data["recipient"] = {"id": self.chatId}
+ userType, userId = self.chatId.split(":", 1)
+ if userType == "19":
+ # Cards haven't been seen in group conversations yet, so assuming a sensible behaviour.
+ data["recipient"]["name"] = self.chat.topic
+ elif self.skype:
+ data["recipient"]["name"] = str(self.skype.contacts[userId].name)
b64 = base64.b64encode(json.dumps(data, separators=(",", ":")).encode("utf-8")).decode("utf-8")
tag = makeTag("URIObject", "Card - access it on ", type="SWIFT.1",
url_thumbnail="https://urlp.asm.skype.com/v1/url/content?url=https://" | Add timestamp and recipient to card HTML
Part of #<I>. | Terrance_SkPy | train | py |
cf58139378d43af07da9b1aa6bb768a88e7f1916 | diff --git a/builtin/providers/aws/resource_aws_ecs_service.go b/builtin/providers/aws/resource_aws_ecs_service.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_ecs_service.go
+++ b/builtin/providers/aws/resource_aws_ecs_service.go
@@ -404,8 +404,7 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error
}
}
- // Retry due to AWS IAM policy eventual consistency
- // See https://github.com/hashicorp/terraform/issues/4375
+ // Retry due to IAM & ECS eventual consistency
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
out, err := conn.UpdateService(&input)
if err != nil {
@@ -414,6 +413,10 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error
log.Printf("[DEBUG] Trying to update ECS service again: %#v", err)
return resource.RetryableError(err)
}
+ if ok && awsErr.Code() == "ServiceNotFoundException" {
+ log.Printf("[DEBUG] Trying to update ECS service again: %#v", err)
+ return resource.RetryableError(err)
+ }
return resource.NonRetryableError(err)
} | provider/aws: Retry ECS svc update on ServiceNotFoundException (#<I>) | hashicorp_terraform | train | go |
67ecdb1e5e7ae25828f565b5bc70e5e0bafad860 | diff --git a/src/ApplicationBuilder.php b/src/ApplicationBuilder.php
index <HASH>..<HASH> 100644
--- a/src/ApplicationBuilder.php
+++ b/src/ApplicationBuilder.php
@@ -111,12 +111,14 @@ class ApplicationBuilder implements ApplicationBuilderInterface
*
* All the added global config paths will be merged in chronological order.
*
- * @param string $globalConfigPath
+ * @param string[] ...$globalConfigPaths
* @return ApplicationBuilder
*/
- public function addGlobalConfigPath(string $globalConfigPath): ApplicationBuilder
+ public function addGlobalConfigPath(string ...$globalConfigPaths): ApplicationBuilder
{
- $this->globalConfigPaths[] = $globalConfigPath;
+ foreach ($globalConfigPaths as $globalConfigPath) {
+ $this->globalConfigPaths[] = $globalConfigPath;
+ }
return $this;
}
@@ -124,12 +126,14 @@ class ApplicationBuilder implements ApplicationBuilderInterface
/**
* Add config loader.
*
- * @param LoaderInterface $loader
+ * @param LoaderInterface[] ...$loaders
* @return ApplicationBuilder
*/
- public function addConfig(LoaderInterface $loader): ApplicationBuilder
+ public function addConfig(LoaderInterface ...$loaders): ApplicationBuilder
{
- $this->configs[] = $loader;
+ foreach ($loaders as $loader) {
+ $this->configs[] = $loader;
+ }
return $this;
} | Added splat operator for config and global config path. | extendsframework_extends-application | train | php |
d1298d636d2597e297200a7c4d5c6695d9a302a2 | diff --git a/src/org/opencms/ui/login/CmsLoginController.java b/src/org/opencms/ui/login/CmsLoginController.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/ui/login/CmsLoginController.java
+++ b/src/org/opencms/ui/login/CmsLoginController.java
@@ -483,6 +483,9 @@ public class CmsLoginController {
return;
}
}
+ CmsObject cloneCms = OpenCms.initCmsObject(currentCms);
+ cloneCms.loginUser(realUser, password);
+
String messageToChange = "";
if (OpenCms.getLoginManager().isPasswordReset(currentCms, userObj)) {
messageToChange = CmsVaadinUtils.getMessageText(Messages.GUI_PWCHANGE_RESET_0);
@@ -502,9 +505,6 @@ public class CmsLoginController {
passwordDialog);
return;
}
- // do a provisional login first, to check the login target
- CmsObject cloneCms = OpenCms.initCmsObject(currentCms);
- cloneCms.loginUser(realUser, password);
CmsWorkplaceSettings settings = CmsLoginHelper.initSiteAndProject(cloneCms);
final String loginTarget = getLoginTarget(cloneCms, settings, m_params.getRequestedResource()); | Fixed password check order for users which have to reset their password. | alkacon_opencms-core | train | java |
b2e54f8b294d148e217d032e839cebc05a4c0e17 | diff --git a/test/m-thrift.js b/test/m-thrift.js
index <HASH>..<HASH> 100644
--- a/test/m-thrift.js
+++ b/test/m-thrift.js
@@ -49,12 +49,17 @@ describe('thrift', function()
{
system.keyspace = 'system';
conn = new scamandrios.ConnectionPool(system);
- var promise = conn.connect().should.be.fulfilled;
- return promise.should.eventually.have.property('definition').then(function(keyspace)
- {
- return keyspace.definition.name;
- }).should.become('system');
+ var promise = conn.connect();
+ return P.all(
+ [
+ promise.should.be.fulfilled,
+ promise.should.eventually.be.an.instanceof(scamandrios.Keyspace),
+ promise.then(function(keyspace)
+ {
+ return keyspace.definition.name;
+ }).should.become('system')
+ ]);
});
it('bad pool connect', function() | Clean up the `Pool#connect` test. | lyveminds_scamandrios | train | js |
1bd1feae2926e4e4ed657cc4236719e53fab700f | diff --git a/src/components/Arrow.js b/src/components/Arrow.js
index <HASH>..<HASH> 100644
--- a/src/components/Arrow.js
+++ b/src/components/Arrow.js
@@ -60,7 +60,7 @@ const defaultStyles = {
userSelect: 'none',
},
- // sizees
+ // sizes
arrow__size__medium: {
height: defaults.arrow.height,
marginTop: defaults.arrow.height / -2,
diff --git a/src/theme.js b/src/theme.js
index <HASH>..<HASH> 100644
--- a/src/theme.js
+++ b/src/theme.js
@@ -45,7 +45,7 @@ theme.thumbnail = {
// arrow
theme.arrow = {
- background: 'black',
+ background: 'none',
fill: 'white',
height: 120,
}; | default arrow bg to none and fix typo | jossmac_react-images | train | js,js |
c25f726a5eaef267239b6f1f7d6ab7b59d8994af | diff --git a/lib/hook_runner.rb b/lib/hook_runner.rb
index <HASH>..<HASH> 100755
--- a/lib/hook_runner.rb
+++ b/lib/hook_runner.rb
@@ -2,7 +2,7 @@
require 'pathname'
unless File.symlink?(__FILE__)
- STDERR.puts "This file is not meant to be called directly."
+ STDERR.puts 'This file is not meant to be called directly.'
exit 2
end | Convert double to single quotes
For speed.
Change-Id: I7d<I>a<I>be4b0f<I>fa8cf<I>c<I>b5
Reviewed-on: <URL> | sds_overcommit | train | rb |
d45d4db1c671679ce6b4cebb167620a1c1890bdf | diff --git a/lib/mongoid_fulltext.rb b/lib/mongoid_fulltext.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid_fulltext.rb
+++ b/lib/mongoid_fulltext.rb
@@ -67,8 +67,8 @@ module Mongoid::FullTextSearch
index_definition = [['ngram', Mongo::ASCENDING], ['score', Mongo::DESCENDING]].concat(filter_indexes)
end
- coll.ensure_index(index_definition, name: 'fts_index')
- coll.ensure_index([['document_id', Mongo::ASCENDING]]) # to make removes fast
+ coll.ensure_index(index_definition, { name: 'fts_index', background: true })
+ coll.ensure_index([['document_id', Mongo::ASCENDING]], { background: true }) # to make removes fast
end
def fulltext_search(query_string, options={}) | Changed ensure_index to index in the background, avoid blocking booting app. | mongoid_mongoid_fulltext | train | rb |
20e7a1bd04c6aaba77b79c494edb98f95c776597 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -57,18 +57,7 @@ function adminTasks() {
scss: pathto('stylesheets/scss/**/*.scss')
};
- gulp.task('jshint', function () {
- return gulp.src(scripts.all)
- .pipe(plugins.jshint())
- .pipe(plugins.jshint.reporter('default'));
- });
-
- gulp.task('jscs', function () {
- return gulp.src(scripts.all)
- .pipe(plugins.jscs());
- });
-
- gulp.task('qor', ['jshint', 'jscs'], function () {
+ gulp.task('qor', function () {
return gulp.src([scripts.qorInit,scripts.qor])
.pipe(plugins.concat('qor.js'))
.pipe(plugins.uglify()) | fix(gulp): remove jshint and jscs for adminTask | qor_qor | train | js |
693cb412a082802d3a96d4e52116d868ec99d214 | diff --git a/src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java b/src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java
+++ b/src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java
@@ -292,6 +292,7 @@ public class GraphQLGtfsSchema {
.field(newFieldDefinition()
.name("trips")
.type(new GraphQLList(tripType))
+ .argument(multiStringArg("service_id"))
.dataFetcher(new JDBCFetcher("trips", "pattern_id"))
.build())
.build(); | add service_id arg to filter trips | conveyal_gtfs-lib | train | java |
5d4de11fae4068c277dbc140c9d407ba4547faa0 | diff --git a/examples/books_collection/collection/views.py b/examples/books_collection/collection/views.py
index <HASH>..<HASH> 100644
--- a/examples/books_collection/collection/views.py
+++ b/examples/books_collection/collection/views.py
@@ -17,6 +17,12 @@ def list_books(page=1):
pagination = Book.query.paginate(page=page, per_page=5)
return render_template('/books/list.html', pagination=pagination)
+@app.route('/books/<letter>')
+@app.route('/books/<letter>/<int:page>')
+def list_books_filtering(letter, page=1):
+ pagination = Book.query.starting_with(letter).paginate(page=page, per_page=5)
+ return render_template('/books/list.html', pagination=pagination)
+
@app.route('/books/delete/<id>')
def delete_book(id):
book = Book.query.get_or_404(id) | Added a URL and view for get books by their first letter | cobrateam_flask-mongoalchemy | train | py |
f7f5bfa6112084986c7313638f56013caa6ad311 | diff --git a/src/cache.js b/src/cache.js
index <HASH>..<HASH> 100644
--- a/src/cache.js
+++ b/src/cache.js
@@ -38,6 +38,14 @@ module.exports.configure = function(options) {
reqBody.push(lastChunk);
}
+ reqBody = reqBody.map(function (chunk) {
+ if (!Buffer.isBuffer(chunk)) {
+ return new Buffer(chunk);
+ } else {
+ return chunk;
+ }
+ });
+
reqBody = Buffer.concat(reqBody);
var filename = sepiaUtil.constructFilename(options.method, reqUrl,
reqBody.toString(), options.headers); | Make fixture record work with non-Buffers | aneilbaboo_replayer | train | js |
0ff220b79aed2c6d03a6c72741c8d5ac6dff926d | diff --git a/test/schemaTest.js b/test/schemaTest.js
index <HASH>..<HASH> 100644
--- a/test/schemaTest.js
+++ b/test/schemaTest.js
@@ -36,7 +36,7 @@ var schema = {
var formats = {
foo: function foo(Faker, schema) {
- return Faker.Name.firstName();
+ return Faker.name.firstName();
},
Bar: function foo(Faker, schema) {
return 'BAR'; | Fixed Faker issue running test/schema.js | repocho_raml-mocker | train | js |
2a66a1d880694ae17d96b10edcb7db1992de9760 | diff --git a/src/main/java/com/lmax/disruptor/RingBuffer.java b/src/main/java/com/lmax/disruptor/RingBuffer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/lmax/disruptor/RingBuffer.java
+++ b/src/main/java/com/lmax/disruptor/RingBuffer.java
@@ -336,11 +336,16 @@ public final class RingBuffer<E> extends RingBufferFields<E> implements Cursored
}
/**
- * Determines if a particular entry has been published.
+ * Determines if a particular entry is available. Note that using this when not within a context that is
+ * maintaining a sequence barrier, it is likely that using this to determine if you can read a value is likely
+ * to result in a race condition and broken code.
*
* @param sequence The sequence to identify the entry.
- * @return If the value has been published or not.
+ * @return If the value can be read or not.
+ * @deprecated Please don't use this method. It probably won't
+ * do what you think that it does.
*/
+ @Deprecated
public boolean isPublished(long sequence)
{
return sequencer.isAvailable(sequence); | Make isPublished method as deprecated. | LMAX-Exchange_disruptor | train | java |
2c11a1aff1ca5da831c5a1306b5501f426bdadcc | diff --git a/rllib/agents/trainer.py b/rllib/agents/trainer.py
index <HASH>..<HASH> 100644
--- a/rllib/agents/trainer.py
+++ b/rllib/agents/trainer.py
@@ -1225,7 +1225,7 @@ class Trainer(Trainable):
"larger value.".format(config["evaluation_num_workers"]))
config["evaluation_interval"] = 1
elif config["evaluation_num_workers"] == 0 and \
- config["evaluation_parallel_to_training"]:
+ config.get("evaluation_parallel_to_training", False):
logger.warning(
"`evaluation_parallel_to_training` can only be done if "
"`evaluation_num_workers` > 0! Setting " | [RLlib] Evaluation parallel to training check, key-error hotfix (#<I>) | ray-project_ray | train | py |
7ce0ba93b86610c1538145c5124edf83afc95951 | diff --git a/functional/util.py b/functional/util.py
index <HASH>..<HASH> 100644
--- a/functional/util.py
+++ b/functional/util.py
@@ -18,7 +18,7 @@ if six.PY2:
PROTOCOL = 2
else:
CSV_WRITE_MODE = 'w'
- PROTOCOL = 4
+ PROTOCOL = serializer.HIGHEST_PROTOCOL
CPU_COUNT = cpu_count()
@@ -161,11 +161,12 @@ def lazy_parallelize(func, result, processes=None):
chunk_size = (len(result) // processes) or processes
except TypeError:
chunk_size = processes
- with Pool(processes=processes) as pool:
- chunks = split_every(chunk_size, iter(result))
- packed_chunks = (pack(func, (chunk, )) for chunk in chunks)
- for pool_result in pool.imap(unpack, packed_chunks):
- yield pool_result
+ pool = Pool(processes=processes)
+ chunks = split_every(chunk_size, iter(result))
+ packed_chunks = (pack(func, (chunk, )) for chunk in chunks)
+ for pool_result in pool.imap(unpack, packed_chunks):
+ yield pool_result
+ pool.terminate()
def compose(*functions): | Change pickling protocol to HIGHEST_PROTOCOL for Python3. Take out Pool from the context manager for Python2. | EntilZha_PyFunctional | train | py |
fde8a3516a2281283140d05cba5dbcc248dce29e | diff --git a/src/Spatie/GoogleSearch/GoogleSearch.php b/src/Spatie/GoogleSearch/GoogleSearch.php
index <HASH>..<HASH> 100644
--- a/src/Spatie/GoogleSearch/GoogleSearch.php
+++ b/src/Spatie/GoogleSearch/GoogleSearch.php
@@ -53,6 +53,10 @@ class GoogleSearch implements GoogleSearchInterface
$xml = simplexml_load_string($result->getBody());
+ if ($xml->ERROR) {
+ throw new Exception('XML indicated service error: '.$xml->ERROR);
+ }
+
if ($xml->RES->R) {
$i = 0;
foreach ($xml->RES->R as $item) { | Check XML for error condition. | spatie_googlesearch | train | php |
dd3ddc3af1248ed5e02a60fa9140aa0507e6a525 | diff --git a/src/lib/KevinGH/Box/Configuration.php b/src/lib/KevinGH/Box/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/lib/KevinGH/Box/Configuration.php
+++ b/src/lib/KevinGH/Box/Configuration.php
@@ -471,6 +471,10 @@ class Configuration
public function getMetadata()
{
if (isset($this->raw->metadata)) {
+ if (is_object($this->raw->metadata)) {
+ return (array) $this->raw->metadata;
+ }
+
return $this->raw->metadata;
}
} | Restoring <I> metadata behavior.
In <I>, the way JSON data is decoded has changed to keep objects as objects. In <I>, objects were converted to associative arrays. For backwards compatibility, this behavior is being brought back. | box-project_box2 | train | php |
86e5aab18a7729c1ad23a86672a14a97c66db3ed | diff --git a/client/js/KeyboardManager.js b/client/js/KeyboardManager.js
index <HASH>..<HASH> 100644
--- a/client/js/KeyboardManager.js
+++ b/client/js/KeyboardManager.js
@@ -103,11 +103,13 @@ define(['logManager'], function (logManager) {
if (this._listener !== l) {
this._listener = l;
- if (!this._listener.onKeyDown) {
- this._logger.warning('Listener is missing "onKeyDown"...');
- }
- if (!this._listener.onKeyUp) {
- this._logger.warning('Listener is missing "onKeyUp"...');
+ if (this._listener) {
+ if (!this._listener.onKeyDown) {
+ this._logger.warning('Listener is missing "onKeyDown"...');
+ }
+ if (!this._listener.onKeyUp) {
+ this._logger.warning('Listener is missing "onKeyUp"...');
+ }
}
}
}; | bugfix: don't call method on undefined listener
Former-commit-id: e<I>b<I>d5e<I>b9f6e<I>ecf<I>bd5f<I>c3d<I>adf | webgme_webgme-engine | train | js |
c6c5b71048018b59af8f65cd1582a9296f658b75 | diff --git a/bin/inline_forms_installer_core.rb b/bin/inline_forms_installer_core.rb
index <HASH>..<HASH> 100755
--- a/bin/inline_forms_installer_core.rb
+++ b/bin/inline_forms_installer_core.rb
@@ -508,7 +508,7 @@ copy_file File.join(GENERATOR_PATH,'lib/generators/templates/unicorn/production.
say "- adding and committing to git..."
git add: "."
-git commit: "-a -m Initial Commit"
+git commit: " -a -m 'Initial Commit'"
# example
if ENV['install_example'] == 'true' | upgrade Gemfile, gemspec and delete some files | acesuares_inline_forms | train | rb |
f99e2ecc86df6299430694006ed571b5507cba32 | diff --git a/lark/lark.py b/lark/lark.py
index <HASH>..<HASH> 100644
--- a/lark/lark.py
+++ b/lark/lark.py
@@ -202,7 +202,7 @@ class Lark:
if rel_to:
basepath = os.path.dirname(rel_to)
grammar_filename = os.path.join(basepath, grammar_filename)
- with open(grammar_filename) as f:
+ with open(grammar_filename, encoding='utf8') as f:
return cls(f, **options)
def __repr__(self): | Lark grammars are now utf8 by default (Issue #<I>) | lark-parser_lark | train | py |
3cbafac3a7056280fb58ac31bd14a113ee84ff64 | diff --git a/bundles/org.eclipse.orion.client.core/static/js/coding/coding.js b/bundles/org.eclipse.orion.client.core/static/js/coding/coding.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.core/static/js/coding/coding.js
+++ b/bundles/org.eclipse.orion.client.core/static/js/coding/coding.js
@@ -125,10 +125,6 @@ dojo.addOnLoad(function(){
});
};
- var contentAssistFactory = function(editor) {
- return new eclipse.ContentAssist(editor, "contentassist");
- };
-
var inputManager = {
lastFilePath: "", | Looks like I busted content assist while merging my multi-file client changes. This should fix it. | eclipse_orion.client | train | js |
51b0ec7953fa88ea03fd3689dc5e2109cfca7b5e | diff --git a/src/Route.php b/src/Route.php
index <HASH>..<HASH> 100644
--- a/src/Route.php
+++ b/src/Route.php
@@ -38,15 +38,19 @@ class Route implements IRouter
*
* @param \Nette\Http\IRequest $httpRequest
*
- * @return \Nette\Application\Request|NULL
+ * @return Request|NULL
*/
public function match(Nette\Http\IRequest $httpRequest)
{
+ $path = $httpRequest->getUrl()->getPath();
+
if (!$this->isHttpMethodSupported($httpRequest->getMethod())) {
return NULL;
}
-
- //TODO: route matching..
+
+ if ($path !== $this->route) {
+ return NULL;
+ }
return new Request(
$this->presenterClassName,
@@ -62,7 +66,11 @@ class Route implements IRouter
/**
* Constructs absolute URL from Request object.
*
- * @return string|NULL
+ * @param Request $appRequest
+ * @param \Nette\Http\Url $refUrl
+ *
+ * @return NULL|string
+ * @throws \Exception
*/
function constructUrl(Request $appRequest, Nette\Http\Url $refUrl)
{ | Added basic matching for urls | DeprecatedPackages_presenter-route | train | php |
778821bac452f8578bdbafd860c88c4215a6a326 | diff --git a/src/Google/Service/Logging.php b/src/Google/Service/Logging.php
index <HASH>..<HASH> 100644
--- a/src/Google/Service/Logging.php
+++ b/src/Google/Service/Logging.php
@@ -51,6 +51,7 @@ class Google_Service_Logging extends Google_Service
public function __construct(Google_Client $client)
{
parent::__construct($client);
+ $this->rootUrl = 'https://logging.googleapis.com/';
$this->servicePath = '';
$this->version = 'v1beta3';
$this->serviceName = 'logging'; | Updated Logging.php
This change has been generated by a script that has detected changes in the
discovery doc of the API.
Check <URL> | googleapis_google-api-php-client | train | php |
5a4090be723d2c67d716aa6b45c36d10d871808d | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -342,7 +342,7 @@ Mentions.split = function(input, isMarkdown, splitBlockquote, splitCode) {
return [];
}
- var matchers = [isMarkdown ? '\\[.*?\\]\\(.*?\\)' : '<a[\\s\\S]*?</a>'];
+ var matchers = [isMarkdown ? '\\[.*?\\]\\(.*?\\)' : '<a[\\s\\S]*?</a>|<[^>]+>'];
if (splitBlockquote) {
matchers.push(isMarkdown ? '^>.*$' : '^<blockquote>.*?</blockquote>');
} | Fix mentions being replaced within HTML attributes | julianlam_nodebb-plugin-mentions | train | js |
23a33a7f0d42a52d400fe56ec79d8abf426b5182 | diff --git a/tests/integ/test_horovod.py b/tests/integ/test_horovod.py
index <HASH>..<HASH> 100644
--- a/tests/integ/test_horovod.py
+++ b/tests/integ/test_horovod.py
@@ -30,7 +30,7 @@ horovod_dir = os.path.join(os.path.dirname(__file__), "..", "data", "horovod")
@pytest.fixture(scope="module")
def gpu_instance_type(request):
- return "ml.p3.2xlarge"
+ return "ml.p2.xlarge"
@pytest.mark.canary_quick
@@ -40,7 +40,7 @@ def test_hvd_cpu(sagemaker_session, cpu_instance_type, tmpdir):
@pytest.mark.canary_quick
@pytest.mark.skipif(
- integ.test_region() in integ.HOSTING_NO_P3_REGIONS, reason="no ml.p3 instances in this region"
+ integ.test_region() in integ.HOSTING_NO_P2_REGIONS, reason="no ml.p2 instances in this region"
)
def test_hvd_gpu(sagemaker_session, gpu_instance_type, tmpdir):
__create_and_fit_estimator(sagemaker_session, gpu_instance_type, tmpdir) | change: use p2 instead of p3 for the Horovod test (#<I>) | aws_sagemaker-python-sdk | train | py |
77423a5204e8dad5af0cab9acddd16ee84682508 | diff --git a/gui/src/main/java/org/jboss/as/console/client/core/message/MessageCenterView.java b/gui/src/main/java/org/jboss/as/console/client/core/message/MessageCenterView.java
index <HASH>..<HASH> 100644
--- a/gui/src/main/java/org/jboss/as/console/client/core/message/MessageCenterView.java
+++ b/gui/src/main/java/org/jboss/as/console/client/core/message/MessageCenterView.java
@@ -230,6 +230,7 @@ public class MessageCenterView implements MessageCenter.MessageListener, ReloadE
messageButton.addClickHandler(clickHandler);
messageDisplay = new HorizontalPanel();
+ messageDisplay.getElement().setAttribute("role", "alert");
layout.add(messageDisplay);
layout.add(messageButton); | provide aria alert role for notificiations | hal_core | train | java |
bc2d349ae688558255296e411257c4c1c94358b1 | diff --git a/dropwizard/src/main/java/com/yammer/dropwizard/json/JsonSnakeCase.java b/dropwizard/src/main/java/com/yammer/dropwizard/json/JsonSnakeCase.java
index <HASH>..<HASH> 100644
--- a/dropwizard/src/main/java/com/yammer/dropwizard/json/JsonSnakeCase.java
+++ b/dropwizard/src/main/java/com/yammer/dropwizard/json/JsonSnakeCase.java
@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
* serialized and deserialized using {@code snake_case} JSON field names instead
* of {@code camelCase} field names.
*/
-@Target({ElementType.TYPE})
+@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonSnakeCase { | Simplify annotation in JsonSnakeCase. | dropwizard_dropwizard | train | java |
43b1c3e3fa9bb0e3fbd9040b37e8add6223c211c | diff --git a/lib/helpers/async.js b/lib/helpers/async.js
index <HASH>..<HASH> 100644
--- a/lib/helpers/async.js
+++ b/lib/helpers/async.js
@@ -7,7 +7,6 @@ var helper = require('async-helper-base');
*/
module.exports = function async_(verb) {
- verb.asyncHelper('apidocs', require('template-helper-apidocs')(verb));
verb.asyncHelper('reflinks', require('helper-reflinks'));
verb.asyncHelper('related', require('helper-related')());
verb.asyncHelper('include', helper('include'));
diff --git a/lib/helpers/sync.js b/lib/helpers/sync.js
index <HASH>..<HASH> 100644
--- a/lib/helpers/sync.js
+++ b/lib/helpers/sync.js
@@ -5,6 +5,7 @@
*/
module.exports = function sync_(verb) {
+ verb.helper('apidocs', require('template-helper-apidocs'));
verb.helper('codelinks', require('verb-helper-codelinks'));
verb.helper('changelog', require('helper-changelog'));
verb.helper('copyright', require('helper-copyright')); | register apidocs as a sync helper | verbose_verb | train | js,js |
cbcad8e3bbd1b41ba2818d43db9b05d72458fcb0 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,3 +1 @@
-
-
module.exports = require('./inject')()
diff --git a/inject.js b/inject.js
index <HASH>..<HASH> 100644
--- a/inject.js
+++ b/inject.js
@@ -33,6 +33,14 @@ module.exports = function (name, override) {
gossip: {
connections: 3
},
+ connections: {
+ incoming: {
+ net: [{ port: 8008, host: "localhost", scope: "local", "transform": "shs" }]
+ },
+ outgoing: {
+ net: [{ transform: "shs" }]
+ }
+ },
path: path.join(HOME, '.' + name),
timers: {
connection: 0, | Add connections transport/transform selection used in secret-stack | ssbc_ssb-config | train | js,js |
9c2182885a50cb4c7afdf81ed5aae9a16ac0ec20 | diff --git a/tests/Work/User/ClientTest.php b/tests/Work/User/ClientTest.php
index <HASH>..<HASH> 100644
--- a/tests/Work/User/ClientTest.php
+++ b/tests/Work/User/ClientTest.php
@@ -50,7 +50,7 @@ class ClientTest extends TestCase
public function testBatchDelete()
{
$client = $this->mockApiClient(Client::class);
- $client->expects()->httpPost('cgi-bin/user/batchdelete', ['useridlist' => ['overtrue', 'foo']])->andReturn('mock-result')->once();
+ $client->expects()->httpPostJson('cgi-bin/user/batchdelete', ['useridlist' => ['overtrue', 'foo']])->andReturn('mock-result')->once();
$this->assertSame('mock-result', $client->batchDelete(['overtrue', 'foo']));
} | Fix test (#<I>) | overtrue_wechat | train | php |
45a8e13f731a9f1ed1081104049842a55a0dbf79 | diff --git a/src/ChrisKonnertz/DeepLy/Protocol/ProtocolInterface.php b/src/ChrisKonnertz/DeepLy/Protocol/ProtocolInterface.php
index <HASH>..<HASH> 100644
--- a/src/ChrisKonnertz/DeepLy/Protocol/ProtocolInterface.php
+++ b/src/ChrisKonnertz/DeepLy/Protocol/ProtocolInterface.php
@@ -18,5 +18,15 @@ interface ProtocolInterface
* @return string
*/
public function createRequestData(array $payload, $method);
-
+
+ /**
+ * Processes the data from an response from the server to an API call.
+ * Returns the payload (data) of the response or throws a ProtocolException.
+ *
+ * @param string $rawResponseData The data (payload) of the response as a stringified JSON string
+ * @return \stdClass The data (payload) of the response as an object structure
+ * @throws ProtocolException|\InvalidArgumentException
+ */
+ public function processResponseData($rawResponseData);
+
} | Adjusted interface so it also has the processResponseData() method | chriskonnertz_DeepLy | train | php |
32c8abecdc0d190a75c5b09463a64da4b2049573 | diff --git a/java/messaging/messaging-common/src/main/java/io/joynr/messaging/routing/RoutingTableImpl.java b/java/messaging/messaging-common/src/main/java/io/joynr/messaging/routing/RoutingTableImpl.java
index <HASH>..<HASH> 100644
--- a/java/messaging/messaging-common/src/main/java/io/joynr/messaging/routing/RoutingTableImpl.java
+++ b/java/messaging/messaging-common/src/main/java/io/joynr/messaging/routing/RoutingTableImpl.java
@@ -141,10 +141,10 @@ public class RoutingTableImpl implements RoutingTable {
participantId,
address,
isGloballyVisible,
- address,
- isGloballyVisible,
expiryDateMs,
- sticky);
+ sticky,
+ result.address,
+ result.isGloballyVisible);
} else {
// address and isGloballyVisible are identical | [Java] Fix log output in RoutingTable if routing entry already exists
Change-Id: I<I>f<I>f<I>df<I>ab<I>a<I>d6d8ccbf3c | bmwcarit_joynr | train | java |
01158c84d26cf7e03a9f1a3de146f768c0f3b7ee | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -113,6 +113,7 @@ module.exports = function (paths, opts) {
function listener(evt, evtPath) {
if (evt === 'create' || evt === 'update') {
fs.stat(evtPath, function(err, stat) {
+ if (err) { console.error(err); return; }
if (stat.isFile()) {
onFile(evtPath, stat);
} else if (stat.isDirectory() && evt === 'create') { //Do we even get "update" events for directories?
@@ -160,6 +161,7 @@ module.exports = function (paths, opts) {
path: baseFilePath,
listener: listener,
next: function(err, watcher) {
+ if (err) { throw err; }
watchers.push(watcher);
checkReady();
}, | Check a few more error params | isaacsimmons_cache-manifest-generator | train | js |
10dd55aa23bc84d2e4649aced222db699f4e1d41 | diff --git a/blockstore/lib/config.py b/blockstore/lib/config.py
index <HASH>..<HASH> 100644
--- a/blockstore/lib/config.py
+++ b/blockstore/lib/config.py
@@ -645,6 +645,7 @@ def default_bitcoind_opts( config_file=None ):
bitcoind_passwd = None
bitcoind_use_https = None
bitcoind_mock = False
+ bitcoind_timeout = 300
loaded = False
@@ -677,6 +678,9 @@ def default_bitcoind_opts( config_file=None ):
else:
mock = 'no'
+ if parser.has_option('bitcoind', 'timeout'):
+ bitcoind_timeout = parser.get('bitcoind', 'timeout')
+
if use_https.lower() in ["yes", "y", "true"]:
bitcoind_use_https = True
else:
@@ -711,7 +715,8 @@ def default_bitcoind_opts( config_file=None ):
"bitcoind_server": bitcoind_server,
"bitcoind_port": bitcoind_port,
"bitcoind_use_https": bitcoind_use_https,
- "bitcoind_mock": bitcoind_mock
+ "bitcoind_mock": bitcoind_mock,
+ "bitcoind_timeout": bitcoind_timeout
}
# strip None's | Read bitcoind timeout from config file | blockstack_blockstack-core | train | py |
f5e9cb1e9c2585655d17f8121f00cb5ae39d9fef | diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -537,7 +537,7 @@ function quiz_print_recent_mod_activity($activity, $course, $detail=false) {
}
- if (has_capability('mod/quiz:grade', get_context_instance(CONTEXT_MODULE, $course))) {
+ if (has_capability('mod/quiz:grade', get_context_instance(CONTEXT_MODULE, $activity->instance))) {
$grades = "(" . $activity->content->sumgrades . " / " . $activity->content->maxgrade . ") ";
echo "<a href=\"$CFG->wwwroot/mod/quiz/review.php?q="
. $activity->instance . "&attempt=" | MDL-<I> - Bogus get_context_instance call in quiz_print_recent_mod_activity. Merged from MOODLE_<I>_STABLE. | moodle_moodle | train | php |
0601bbc976712364168ab044d7b76d721574a9ed | diff --git a/SoftLayer/API.py b/SoftLayer/API.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/API.py
+++ b/SoftLayer/API.py
@@ -169,8 +169,8 @@ class Client(object):
'Content-Type': 'application/xml',
}
- if compress:
- http_headers['Accept-Encoding'] = 'deflate, compress, gzip'
+ if not compress:
+ http_headers['Accept-Encoding'] = ''
if raw_headers:
http_headers.update(raw_headers)
diff --git a/SoftLayer/transports.py b/SoftLayer/transports.py
index <HASH>..<HASH> 100644
--- a/SoftLayer/transports.py
+++ b/SoftLayer/transports.py
@@ -41,6 +41,8 @@ def make_xml_rpc_api_call(uri, method, args=None, headers=None,
response = requests.post(uri, data=payload,
headers=http_headers,
timeout=timeout)
+ log.debug(response.request.headers)
+ log.debug(response.headers)
log.debug(response.content)
response.raise_for_status()
result = xmlrpclib.loads(response.content,)[0][0] | Inverted compress flag behavior as requests compresses by default | softlayer_softlayer-python | train | py,py |
e543eed880b1f0a3bd9eb134814e2567cee726f7 | diff --git a/binance/client.py b/binance/client.py
index <HASH>..<HASH> 100755
--- a/binance/client.py
+++ b/binance/client.py
@@ -949,8 +949,6 @@ class Client(BaseClient):
:type end_str: None|str|int
:param limit: Default 500; max 1000.
:type limit: int
- :param limit: Default 500; max 1000.
- :type limit: int
:param klines_type: Historical klines type: SPOT or FUTURES
:type klines_type: HistoricalKlinesType | Update client.py
Typo in docstring of _historical_klines | sammchardy_python-binance | train | py |
7f33bb6a9bb8dfb9e1dc27a41852ff267a54382b | diff --git a/src/com/nexmo/verify/sdk/NexmoVerifyClient.java b/src/com/nexmo/verify/sdk/NexmoVerifyClient.java
index <HASH>..<HASH> 100644
--- a/src/com/nexmo/verify/sdk/NexmoVerifyClient.java
+++ b/src/com/nexmo/verify/sdk/NexmoVerifyClient.java
@@ -131,7 +131,15 @@ public class NexmoVerifyClient {
*/
private static final int MAX_SEARCH_REQUESTS = 10;
- private static final DateFormat sDateTimePattern = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ private static final ThreadLocal<SimpleDateFormat> sDateTimePattern = new ThreadLocal<SimpleDateFormat>() {
+ @Override
+ protected SimpleDateFormat initialValue() {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ sdf.setLenient(false);
+
+ return sdf;
+ }
+ };
private final DocumentBuilderFactory documentBuilderFactory;
private final DocumentBuilder documentBuilder;
@@ -767,7 +775,7 @@ public class NexmoVerifyClient {
}
private static Date parseDateTime(String str) throws ParseException {
- return sDateTimePattern.parse(str);
+ return sDateTimePattern.get().parse(str);
}
} | thread safety - use thread local for shared date format | Nexmo_nexmo-java | train | java |
0ce2ac843bd7a850c51c1a9c1127f24e8fccf976 | diff --git a/src/main/java/edu/washington/cs/knowitall/commonlib/logic/LogicExpression.java b/src/main/java/edu/washington/cs/knowitall/commonlib/logic/LogicExpression.java
index <HASH>..<HASH> 100644
--- a/src/main/java/edu/washington/cs/knowitall/commonlib/logic/LogicExpression.java
+++ b/src/main/java/edu/washington/cs/knowitall/commonlib/logic/LogicExpression.java
@@ -50,9 +50,17 @@ public class LogicExpression<E> implements Predicate<E> {
List<Tok> tokens = tokenize(input, factory);
expression = compile(tokens);
}
+
+ public boolean isEmpty() {
+ return this.expression.size() == 0;
+ }
@SuppressWarnings("unchecked")
public boolean apply(E target) {
+ if (this.isEmpty()) {
+ return true;
+ }
+
Stack<Tok> stack = new Stack<Tok>();
for (Tok tok : expression) {
if (tok instanceof Tok.Arg<?>) { | Added LogicExpression.isEmpty and made is so when empty LogicExpressions are applied the result is true. | knowitall_common-java | train | java |
8d323b74d8ab38ec27735efe5ba608f01cf28c36 | diff --git a/src/build/browser.js b/src/build/browser.js
index <HASH>..<HASH> 100644
--- a/src/build/browser.js
+++ b/src/build/browser.js
@@ -39,8 +39,8 @@ function minify (ctx, task) {
return fs.readFile(path.join(process.cwd(), 'dist', 'index.js'))
.then((code) => {
const result = Uglify.minify(code.toString(), {
- mangle: false,
- compress: false
+ mangle: true,
+ compress: { unused: false }
})
if (result.error) {
throw result.error | feat: enable uglify mangle and compress | ipfs_aegir | train | js |
8aeedb911bfc5334333a151542e1ab9772c5193d | diff --git a/lib/specinfra/version.rb b/lib/specinfra/version.rb
index <HASH>..<HASH> 100644
--- a/lib/specinfra/version.rb
+++ b/lib/specinfra/version.rb
@@ -1,3 +1,3 @@
module Specinfra
- VERSION = "2.27.0"
+ VERSION = "2.27.1"
end | Bump up version
[skip ci] | mizzy_specinfra | train | rb |
3c1f4c32d57ad4a654d6a9b8df10c9a8f07bda84 | diff --git a/addon/services/tour-manager.js b/addon/services/tour-manager.js
index <HASH>..<HASH> 100644
--- a/addon/services/tour-manager.js
+++ b/addon/services/tour-manager.js
@@ -189,7 +189,12 @@ export default Service.extend({
}
let lsKey = get(this, '_localStorageKey');
- let lsData = window.localStorage.getItem(lsKey);
+ let lsData = null;
+ try {
+ lsData = window.localStorage.getItem(lsKey);
+ } catch (e) {
+ console.error('Could not read from local storage.', e);
+ }
if (!lsData) {
return false;
}
@@ -219,7 +224,13 @@ export default Service.extend({
lsData = {};
}
lsData[id] = isRead;
- window.localStorage.setItem(lsKey, JSON.stringify(lsData));
+
+ try {
+ window.localStorage.setItem(lsKey, JSON.stringify(lsData));
+ } catch (e) {
+ console.error('Could not save to local storage.', e);
+ }
+
},
/** | Catch error if LocalStorage is not available | mydea_ember-site-tour | train | js |
690e84ef913d3f8f6584ec30d764eb05bf52b6cf | diff --git a/tests/FunctionalTestCase.php b/tests/FunctionalTestCase.php
index <HASH>..<HASH> 100644
--- a/tests/FunctionalTestCase.php
+++ b/tests/FunctionalTestCase.php
@@ -28,7 +28,7 @@ class FunctionalTestCase extends \Orchestra\Testbench\TestCase
/**
* {@inheritdoc}
*/
- public function setUp()
+ public function setUp(): void
{
parent::setUp(); | fix: FunctionalTestCase | cartalyst_tags | train | php |
9c19ecc2e8f9a843c3e2e3c4fb31d55bbbc777d9 | diff --git a/yii2instafeed.php b/yii2instafeed.php
index <HASH>..<HASH> 100644
--- a/yii2instafeed.php
+++ b/yii2instafeed.php
@@ -33,7 +33,7 @@ class yii2instafeed extends Widget
*/
public $clientOptions = array(
'get' => 'tagged',
- 'target' => '#instafeedid',
+ 'target' => '#instafeedtarget',
'tagName' => 'awesome',
'userId' => 'abcded',
'accessToken' => '123456_abcedef', | upgrade to correct target widget id | philippfrenzel_yii2instafeed | train | php |
ca78d2679687d0d3c9d8b23d62b2e5a905471b00 | diff --git a/lib/hare/runner.rb b/lib/hare/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/hare/runner.rb
+++ b/lib/hare/runner.rb
@@ -110,7 +110,7 @@ module Hare
exch = b.exchange(eopts[:name], :type => eopts[:type])
if @options[:publish]
- exch.publish(@arguments[0], :key => amqp[:key])
+ exch.publish(@arguments[0].rstrip + "\n", :key => amqp[:key])
else
q = b.queue(amqp[:queue])
q.bind(exch, :key => amqp[:key])
diff --git a/lib/hare/version.rb b/lib/hare/version.rb
index <HASH>..<HASH> 100644
--- a/lib/hare/version.rb
+++ b/lib/hare/version.rb
@@ -1,3 +1,3 @@
module Hare
- VERSION = "1.0.2"
+ VERSION = "1.0.3"
end | Cause hare to add a newline to payload messages.
If payloads are delivered to Unix programs through STDIN they will
expect a newline character to terminate the message. While the
originator of the payload might add a newline, it's not impossible
that they will fail to or not understand the need. hare strives to be
a good Unix tool, so the newline is added by default. | blt_hare | train | rb,rb |
7ee79cc8c20c337eeb3025c2280b257731ce696b | diff --git a/lib/challah.rb b/lib/challah.rb
index <HASH>..<HASH> 100644
--- a/lib/challah.rb
+++ b/lib/challah.rb
@@ -60,7 +60,7 @@ module Challah
end
def self.user
- @user ||= options[:user].to_s.safe_constantize
+ options[:user].to_s.safe_constantize
end
# Set up techniques engines | Remove caching on the user model
In development mode when the local User model is reloaded, it causes
the User reference to become stale. Only an issue in development, but
still annoying enough to fix. | jdtornow_challah | train | rb |
b5dc1727d2cf668211ee89c85b22ca32803df375 | diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go
index <HASH>..<HASH> 100644
--- a/pkg/services/sqlstore/sqlstore.go
+++ b/pkg/services/sqlstore/sqlstore.go
@@ -149,8 +149,13 @@ func getEngine() (*xorm.Engine, error) {
if len(fields) > 1 && len(strings.TrimSpace(fields[1])) > 0 {
port = fields[1]
}
- cnnstr = fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s",
- DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode)
+ if DbCfg.Pwd == "" {
+ DbCfg.Pwd = "''"
+ }
+ if DbCfg.User == "" {
+ DbCfg.User = "''"
+ }
+ cnnstr = fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s", DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode)
case "sqlite3":
if !filepath.IsAbs(DbCfg.Path) {
DbCfg.Path = filepath.Join(setting.DataPath, DbCfg.Path) | fix(postgres): If password or user is empty use empty quotes for connection string, #<I> | grafana_grafana | train | go |
01afdea32995b4196086e517f6ee4f50b8d62ba6 | diff --git a/src/main/java/net/kuujo/vertigo/util/Context.java b/src/main/java/net/kuujo/vertigo/util/Context.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/kuujo/vertigo/util/Context.java
+++ b/src/main/java/net/kuujo/vertigo/util/Context.java
@@ -58,7 +58,7 @@ public final class Context {
return InstanceContext.fromJson(contextInfo);
}
}
- throw new IllegalArgumentException("No context found.");
+ return null;
}
} | Return null if context is not found in verticle configuration. | kuujo_vertigo | train | java |
5da6e057f8a36aff75123cad8b7cfd023cb60eac | diff --git a/lib/ydim/invoice.rb b/lib/ydim/invoice.rb
index <HASH>..<HASH> 100644
--- a/lib/ydim/invoice.rb
+++ b/lib/ydim/invoice.rb
@@ -89,6 +89,11 @@ module YDIM
config = PdfInvoice.config.dup
config.formats['quantity'] = "%1.#{@precision}f"
config.formats['total'] = "#{@currency} %1.2f"
+ if(item = @items[0])
+ if((item.vat_rate - YDIM::Server.config.vat_rate).abs > 0.1)
+ config.texts['tax'] = "MwSt 7.6%"
+ end
+ end
invoice = PdfInvoice::Invoice.new(config)
invoice.date = @date
invoice.invoice_number = @unique_id | The Tax text of an exported PDF file becomes MwSt <I>% when vat_rate == <I> | zdavatz_ydim | train | rb |
2dd5a982e52f4676de40dd38ffef3dce43cba91e | diff --git a/command/build/command.go b/command/build/command.go
index <HASH>..<HASH> 100644
--- a/command/build/command.go
+++ b/command/build/command.go
@@ -115,11 +115,17 @@ func (c Command) Run(env packer.Environment, args []string) int {
}
// Handle signals
+ var interruptWg sync.WaitGroup
+ interrupted := false
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt)
go func() {
<-sigCh
+ interruptWg.Add(1)
+ defer interruptWg.Done()
+ interrupted = true
+
log.Println("Interrupted! Cancelling builds...")
var wg sync.WaitGroup
@@ -137,7 +143,15 @@ func (c Command) Run(env packer.Environment, args []string) int {
wg.Wait()
}()
+ // Wait for both the builds to complete and the interrupt handler,
+ // if it is interrupted.
wg.Wait()
+ interruptWg.Wait()
+
+ if interrupted {
+ env.Ui().Say("Cleanly cancelled builds after being interrupted.")
+ return 1
+ }
// Output all the artifacts
env.Ui().Say("\n==> The build completed! The artifacts created were:") | command/build: Cleanly exit after being interrupted | hashicorp_packer | train | go |
595f6b3f688aaee7fe0438ecd11ee94b92f24fbd | diff --git a/lib/punchblock/connection/xmpp.rb b/lib/punchblock/connection/xmpp.rb
index <HASH>..<HASH> 100644
--- a/lib/punchblock/connection/xmpp.rb
+++ b/lib/punchblock/connection/xmpp.rb
@@ -82,6 +82,7 @@ module Punchblock
# Preserve Punchblock native exceptions
raise e if e.class.to_s =~ /^Punchblock/
# Wrap everything else
+ # FIXME: We are losing valuable backtrace here...
raise ProtocolError.new(e.class.to_s, e.message)
end
end | Add a FIXME about lost backtrace | adhearsion_punchblock | train | rb |
88ff4b28b975b637d5a59367694dea23127a9342 | diff --git a/util/db/cluster.go b/util/db/cluster.go
index <HASH>..<HASH> 100644
--- a/util/db/cluster.go
+++ b/util/db/cluster.go
@@ -58,6 +58,7 @@ func (s *db) CreateCluster(ctx context.Context, c *appv1.Cluster) (*appv1.Cluste
},
}
clusterSecret.Data = clusterToData(c)
+ clusterSecret.Annotations = AnnotationsFromConnectionState(&c.ConnectionState)
clusterSecret, err = s.kubeclientset.CoreV1().Secrets(s.ns).Create(clusterSecret)
if err != nil {
if apierr.IsAlreadyExists(err) {
diff --git a/util/db/repository.go b/util/db/repository.go
index <HASH>..<HASH> 100644
--- a/util/db/repository.go
+++ b/util/db/repository.go
@@ -57,6 +57,7 @@ func (s *db) CreateRepository(ctx context.Context, r *appsv1.Repository) (*appsv
},
}
repoSecret.Data = repoToData(r)
+ repoSecret.Annotations = AnnotationsFromConnectionState(&r.ConnectionState)
repoSecret, err := s.kubeclientset.CoreV1().Secrets(s.ns).Create(repoSecret)
if err != nil {
if apierr.IsAlreadyExists(err) { | Issue #<I> - Fix saving default connection status for repos and clusters (#<I>) | argoproj_argo-cd | train | go,go |
a8f764c1612ab17eb99924ac2363c05110a1911d | diff --git a/sanic/request.py b/sanic/request.py
index <HASH>..<HASH> 100644
--- a/sanic/request.py
+++ b/sanic/request.py
@@ -69,10 +69,10 @@ class Request(dict):
self.stream = None
@property
- def json(self, loads=json_loads):
+ def json(self):
if self.parsed_json is None:
try:
- self.parsed_json = loads(self.body)
+ self.parsed_json = json_loads(self.body)
except Exception:
if not self.body:
return None
@@ -80,6 +80,16 @@ class Request(dict):
return self.parsed_json
+ def load_json(self, loads=json_loads):
+ try:
+ self.parsed_json = loads(self.body)
+ except Exception:
+ if not self.body:
+ return None
+ raise InvalidUsage("Failed when parsing body as json")
+
+ return self.parsed_json
+
@property
def token(self):
"""Attempt to return the auth header token. | make method instead of property for alternative json decoding of request | huge-success_sanic | train | py |
d89199d98ab601254bffb8247733aee42a093273 | diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java
+++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerMvcConfiguration.java
@@ -71,6 +71,11 @@ public class ConfigServerMvcConfiguration implements WebMvcConfigurer {
@Bean
public EnvironmentController environmentController(EnvironmentRepository envRepository,
ConfigServerProperties server) {
+ return delegateController(envRepository, server);
+ }
+
+ protected EnvironmentController delegateController(EnvironmentRepository envRepository,
+ ConfigServerProperties server) {
EnvironmentController controller = new EnvironmentController(encrypted(envRepository, server),
this.objectMapper);
controller.setStripDocumentFromYaml(server.isStripDocumentFromYaml());
@@ -107,7 +112,7 @@ public class ConfigServerMvcConfiguration implements WebMvcConfigurer {
@RefreshScope
public EnvironmentController environmentController(EnvironmentRepository envRepository,
ConfigServerProperties server) {
- return super.environmentController(envRepository, server);
+ return super.delegateController(envRepository, server);
}
} | Avoid triggering self-invocation warning inadvertently | spring-cloud_spring-cloud-config | train | java |
5f2ee99af3246948c8759806cb2d7eaa91cb2dfe | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ def readme():
return f.read()
setup(name = 'timeago',
- version = '1.0.11',
+ version = '1.0.12',
description = 'A very simple python library, used to format datetime with `*** time ago` statement. eg: "3 hours ago".',
long_description = readme(),
author = 'hustcc', | Release <I>. Related to #<I> and #<I> | hustcc_timeago | train | py |
b4ad3c116bdfe7b803fc0c30254b1e0b75bb7643 | diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -83,7 +83,7 @@ class Client implements ClientInterface
* @param string $resource The API resource to search for.
* @param array $filters Array of search criteria to use in request.
*
- * @return DataWrapperInterface|null
+ * @return null|DataWrapper
*
* @throws \InvalidArgumentException Thrown if $resource is empty or not a string.
*/
@@ -109,7 +109,7 @@ class Client implements ClientInterface
* @param string $resource The API resource to search for.
* @param integer $id The id of the API resource.
*
- * @return DataWrapperInterface|null
+ * @return null|DataWrapper
*/
final public function get(string $resource, int $id)
{ | Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL> | chadicus_marvel-api-client | train | php |
c33516789a4ae5bfeb2356e218e091ba428b1ae7 | diff --git a/lib/bullet.rb b/lib/bullet.rb
index <HASH>..<HASH> 100644
--- a/lib/bullet.rb
+++ b/lib/bullet.rb
@@ -190,17 +190,22 @@ module Bullet
end
def profile
+ return_value = nil
if Bullet.enable?
begin
Bullet.start_request
- yield
+ return_value = yield
Bullet.perform_out_of_channel_notifications if Bullet.notification?
ensure
Bullet.end_request
end
+ else
+ return_value = yield
end
+
+ return_value
end
private | Bullets' profile returns the return value of profiled code and runs the code even is bullet is disabled | flyerhzm_bullet | train | rb |
ca4363f50934c9fd233775dcd655166481f70073 | diff --git a/models/CommentModel.php b/models/CommentModel.php
index <HASH>..<HASH> 100644
--- a/models/CommentModel.php
+++ b/models/CommentModel.php
@@ -341,7 +341,8 @@ class CommentModel extends ActiveRecord
->alias('c')
->select(['c.createdBy', 'a.username'])
->joinWith('author a')
- ->groupBy('c.createdBy')
+ ->groupBy(['c.createdBy', 'a.username'])
+ ->orderBy('a.username')
->asArray()
->all(); | fix PostgreSQL group by clause #<I> | yii2mod_yii2-comments | train | php |
92d94b19fc333af247b7ef34b5ed3c3a07dc7b68 | diff --git a/lib/daybreak/queue.rb b/lib/daybreak/queue.rb
index <HASH>..<HASH> 100644
--- a/lib/daybreak/queue.rb
+++ b/lib/daybreak/queue.rb
@@ -6,6 +6,13 @@ module Daybreak
class Queue
def initialize
@queue, @full, @empty = [], [], []
+ # Wake up threads 10 times per second to avoid deadlocks
+ # since there is a race condition below
+ @heartbeat = Thread.new do
+ @full.each(&:run)
+ @empty.each(&:run)
+ sleep 0.1
+ end
end
def <<(x)
@@ -25,6 +32,7 @@ module Daybreak
def next
while @queue.empty?
begin
+ # If a push happens here, the thread won't be woken up
@full << Thread.current
Thread.stop
ensure
@@ -37,6 +45,7 @@ module Daybreak
def flush
until @queue.empty?
begin
+ # If a pop happens here, the thread won't be woken up
@empty << Thread.current
Thread.stop
ensure | add heartbeat thread to mri queue | propublica_daybreak | train | rb |
03db0262ee235195b624f01704db92318067edd8 | diff --git a/extended-statistics/src/test/java/org/infinispan/stats/BaseClusterTopKeyTest.java b/extended-statistics/src/test/java/org/infinispan/stats/BaseClusterTopKeyTest.java
index <HASH>..<HASH> 100644
--- a/extended-statistics/src/test/java/org/infinispan/stats/BaseClusterTopKeyTest.java
+++ b/extended-statistics/src/test/java/org/infinispan/stats/BaseClusterTopKeyTest.java
@@ -57,6 +57,10 @@ public abstract class BaseClusterTopKeyTest extends MultipleCacheManagersTest {
cache(0).put(key1, "value1");
cache(0).put(key2, "value2");
+
+ assertNoLocks(key1);
+ assertNoLocks(key2);
+
cache(1).put(key1, "value3");
cache(1).put(key2, "value4");
@@ -283,6 +287,12 @@ public abstract class BaseClusterTopKeyTest extends MultipleCacheManagersTest {
assertTopKeyLockFailed(cache, key, failed);
}
+ private void assertNoLocks(String key) {
+ for (Cache<?, ?> cache : caches()) {
+ assertEventuallyNotLocked(cache, key);
+ }
+ }
+
private PrepareCommandBlocker addPrepareBlockerIfAbsent(Cache<?, ?> cache) {
List<CommandInterceptor> chain = cache.getAdvancedCache().getInterceptorChain(); | ISPN-<I> DistTopKeyTest.testPut random failures
* make sure that no locks are acquired before performing the next put | infinispan_infinispan | train | java |
5c6bd93d2026026f28d108a0eed1fe2498a823b4 | diff --git a/core/src/main/java/com/meltmedia/cadmium/core/history/HistoryManager.java b/core/src/main/java/com/meltmedia/cadmium/core/history/HistoryManager.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/meltmedia/cadmium/core/history/HistoryManager.java
+++ b/core/src/main/java/com/meltmedia/cadmium/core/history/HistoryManager.java
@@ -37,8 +37,16 @@ public class HistoryManager {
pool = Executors.newSingleThreadExecutor();
}
-
+
+ public void logEvent(boolean maint, String openId, String comment) {
+ logEvent("", "", openId, "", comment, maint, false);
+ }
+
public void logEvent(String branch, String sha, String openId, String directory, String comment, boolean revertible) {
+ logEvent(branch, sha, openId, directory, comment, false, revertible);
+ }
+
+ public void logEvent(String branch, String sha, String openId, String directory, String comment, boolean maint, boolean revertible) {
HistoryEntry lastEntry = history.size() > 0 ? history.get(0) : null;
HistoryEntry newEntry = new HistoryEntry();
newEntry.setTimestamp(new Date()); | Added maintenance special logEvent Method | meltmedia_cadmium | train | java |
7685738344a27deeaa6148cd1cd117d69cb35967 | diff --git a/tests/test_advanced.py b/tests/test_advanced.py
index <HASH>..<HASH> 100644
--- a/tests/test_advanced.py
+++ b/tests/test_advanced.py
@@ -10,4 +10,4 @@ def test_code_with_tricky_content():
assert md('<code>></code>') == "`>`"
assert md('<code>/home/</code><b>username</b>') == "`/home/`**username**"
assert md('First line <code>blah blah<br />blah blah</code> second line') \
- == "First line `blah blah \nblah blah` second line"
+ == "First line `blah blah \nblah blah` second line" | Formatting tweak
Change indent of continuation line; squashes a flake8 warning. | matthewwithanm_python-markdownify | train | py |
dd031fb68508a569bd2bb67ed7813abb64beb27a | diff --git a/api/api.go b/api/api.go
index <HASH>..<HASH> 100644
--- a/api/api.go
+++ b/api/api.go
@@ -67,8 +67,12 @@ const (
// the VolumeSpec.force_unsupported_fs_type. When set to true it asks
// the driver to use an unsupported value of VolumeSpec.format if possible
SpecForceUnsupportedFsType = "force_unsupported_fs_type"
- SpecNodiscard = "nodiscard"
- StoragePolicy = "storagepolicy"
+ // SpecMatchSrcVolProvision defaults to false. Applicable to cloudbackup restores only.
+ // If set to "true", cloudbackup restore volume gets provisioned on same pools as
+ // backup, allowing for inplace restore after.
+ SpecMatchSrcVolProvision = "match_src_vol_provision"
+ SpecNodiscard = "nodiscard"
+ StoragePolicy = "storagepolicy"
)
// OptionKey specifies a set of recognized query params. | New label to support source volume based provision (#<I>) | libopenstorage_openstorage | train | go |
4e667b849608ea251371a8b96460568ed40f519e | 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
@@ -44,7 +44,6 @@ extensions = [
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
- 'IPython.sphinxext.ipython_console_highlighting', # see https://github.com/spatialaudio/nbsphinx/issues/24
"nbsphinx" # ipynb autodocs
] | Removed ipython extension from docs | exa-analytics_exa | train | py |
42bc4428d84bfab4fbf99ef186298b7cdb64cea0 | diff --git a/webapps/ui/cockpit/plugins/base/app/views/dashboard/processes.js b/webapps/ui/cockpit/plugins/base/app/views/dashboard/processes.js
index <HASH>..<HASH> 100644
--- a/webapps/ui/cockpit/plugins/base/app/views/dashboard/processes.js
+++ b/webapps/ui/cockpit/plugins/base/app/views/dashboard/processes.js
@@ -61,7 +61,7 @@ function (
'incident',
'incidents'
],
- link: ''
+ link: '#/processes?targetPlugin=search-process-instances&searchQuery=%5B%7B%22type%22:%22PIwithIncidents%22,%22operator%22:%22eq%22,%22value%22:%22%22,%22name%22:%22%22%7D%5D'
}
}; | improve(cockpit-dashboard): add link to processes with incidents
Related to CAM-<I> | camunda_camunda-bpm-platform | train | js |
5776905de6e0615f5afe24ae693628f8f504859b | diff --git a/phantom-driver.js b/phantom-driver.js
index <HASH>..<HASH> 100644
--- a/phantom-driver.js
+++ b/phantom-driver.js
@@ -179,8 +179,9 @@ RunAllAutoTests(function(num_failing, num_passing) {
if (num_failing !== 0) {
console.log('FAIL');
phantom.exit();
+ } else {
+ console.log('PASS');
}
- console.log('PASS');
phantom.exit();
// This is not yet reliable enough to be useful: | Only print PASS when failed test count == 0. Or is that === 0? | danvk_dygraphs | train | js |
99d17f2100a945fdae14c3faeab31a0016bd7c8b | diff --git a/test/models_sanity_test.rb b/test/models_sanity_test.rb
index <HASH>..<HASH> 100644
--- a/test/models_sanity_test.rb
+++ b/test/models_sanity_test.rb
@@ -10,10 +10,12 @@ class ModelsSanityTest < Test::Unit::TestCase
model_files = Dir[File.join(models_directory, '**', '*')]
model_files.each do |model_file|
filename = File.basename(model_file, File.extname(model_file))
- model_class = ActiveSupport::Inflector.constantize("Podio::" + filename.classify)
+ model_class = ActiveSupport::Inflector.constantize("Podio::" + filename.classify) rescue nil
- test "should instansiate #{model_class.name}" do
- assert_nothing_raised { model_class.new }
+ if model_class
+ test "should instansiate #{model_class.name}" do
+ assert_nothing_raised { model_class.new }
+ end
end
end
end
\ No newline at end of file | Dont test models ActiveSupport fails to classify correctly | podio_podio-rb | train | rb |
b734eb5c311a64436bfcc8a6ea2918ddc4cb6e52 | diff --git a/FlowCal/io.py b/FlowCal/io.py
index <HASH>..<HASH> 100644
--- a/FlowCal/io.py
+++ b/FlowCal/io.py
@@ -1527,8 +1527,16 @@ class FCSData(np.ndarray):
detector_voltage = tuple(detector_voltage)
# Amplifier gain: Stored in the keyword parameter $PnG for channel n.
- amplifier_gain = [fcs_file.text.get('$P{}G'.format(i))
- for i in range(1, num_channels + 1)]
+ # The FlowJo Collector's Edition software saves the amplifier gain in
+ # keyword parameters CytekP01G, CytekP02G, CytekP03G, ... for channels
+ # 1, 2, 3, ...
+ if 'CREATOR' in fcs_file.text and \
+ 'FlowJoCollectorsEdition' in fcs_file.text.get('CREATOR'):
+ amplifier_gain = [fcs_file.text.get('CytekP{:02d}G'.format(i))
+ for i in range(1, num_channels + 1)]
+ else:
+ amplifier_gain = [fcs_file.text.get('$P{}G'.format(i))
+ for i in range(1, num_channels + 1)]
amplifier_gain = [float(agi) if agi is not None else None
for agi in amplifier_gain]
amplifier_gain = tuple(amplifier_gain) | Added exception for reading linear amplifier gain from FlowJo FCS files.
See #<I>. | taborlab_FlowCal | train | py |
6ed9277f6f7970f6c2e1e9c84ed276889f731af7 | diff --git a/spec/support/silence_output.rb b/spec/support/silence_output.rb
index <HASH>..<HASH> 100644
--- a/spec/support/silence_output.rb
+++ b/spec/support/silence_output.rb
@@ -9,6 +9,10 @@ RSpec.shared_context 'silence output', :silence_output do
true
end
+ def respond_to_missing?(*)
+ true
+ end
+
def method_missing(*)
end
end | Fix Style/MissingRespondToMissing offense | yujinakayama_guard-rubocop | train | rb |
3c2ac9e331e295a4af76ccc0f78f0b583e4e3a83 | diff --git a/spec/support/actor_examples.rb b/spec/support/actor_examples.rb
index <HASH>..<HASH> 100644
--- a/spec/support/actor_examples.rb
+++ b/spec/support/actor_examples.rb
@@ -550,10 +550,8 @@ shared_context "a Celluloid Actor" do |included_module|
it "knows which tasks are waiting on calls to other actors" do
actor = @klass.new
- # an alias for Celluloid::Actor#waiting_tasks
tasks = actor.tasks
tasks.size.should == 1
- tasks.first.status.should == :running
future = actor.future(:blocking_call)
sleep 0.1 # hax! waiting for ^^^ call to actually start | Fix broken spec
This spec specified incorrect behavior before. The offending examples
have been removed. | celluloid_celluloid | train | rb |
c4c04991a80fa9db8c9c8caf74955b6795593a55 | diff --git a/src/sap.m/src/sap/m/VariantManagement.js b/src/sap.m/src/sap/m/VariantManagement.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/VariantManagement.js
+++ b/src/sap.m/src/sap/m/VariantManagement.js
@@ -1044,6 +1044,11 @@ sap.ui.define([
}
};
+ VariantManagement.prototype.setModified = function(bValue) {
+ this.setProperty("modified", bValue);
+ return this;
+ };
+
VariantManagement.prototype._openVariantList = function() {
var oItem;
@@ -1072,6 +1077,11 @@ sap.ui.define([
}
}
+ var oSelectedItem = this.oVariantList.getSelectedItem();
+ if (oSelectedItem) {
+ this.oVariantPopOver.setInitialFocus(oSelectedItem.getId());
+ }
+
var oControlRef = this._oCtrlRef ? this._oCtrlRef : this.oVariantLayout;
this._oCtrlRef = null;
this.oVariantPopOver.openBy(oControlRef); | [INTERNAL] m.VariantManagement: scroll to the selected item in 'My
Views'
Change-Id: Ic3fa<I>ec<I>b<I>f<I>e<I>c<I>a6a8b | SAP_openui5 | train | js |
85e10ff8d08eba69e944f92885a30927d964036e | diff --git a/tests/integration/BeanstalkTest.php b/tests/integration/BeanstalkTest.php
index <HASH>..<HASH> 100644
--- a/tests/integration/BeanstalkTest.php
+++ b/tests/integration/BeanstalkTest.php
@@ -1,7 +1,10 @@
<?php
-
+/**
+ * Class BeanstalkTest
+ * @coversNothing
+ */
class BeanstalkTest extends PHPUnit_Framework_TestCase
{
/** @var \Beanie\Beanie */
@@ -142,5 +145,6 @@ class BeanstalkTest extends PHPUnit_Framework_TestCase
$jobStats = $job->stats();
$this->assertEquals($jobStats['state'], 'ready');
+ $job->delete();
}
} | Mark beanstalkd integration test with @coversNothing, make reproducible | zwilias_beanie | train | php |
39859f7baea3ecb3918fa30e8eea40d31783d1aa | diff --git a/trunk/JLanguageTool/src/java/org/languagetool/language/Russian.java b/trunk/JLanguageTool/src/java/org/languagetool/language/Russian.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/java/org/languagetool/language/Russian.java
+++ b/trunk/JLanguageTool/src/java/org/languagetool/language/Russian.java
@@ -117,7 +117,7 @@ public class Russian extends Language {
DoublePunctuationRule.class,
UppercaseSentenceStartRule.class,
HunspellRule.class,
-// WordRepeatRule.class,
+ WordRepeatRule.class,
WhitespaceRule.class,
// specific to Russian :
RussianUnpairedBracketsRule.class, | [ru] enable general word repeat rule again | languagetool-org_languagetool | train | java |
d3a418719db11b603d26778f6a398e88e83816fe | diff --git a/spec/type/polymorphic_type_spec.rb b/spec/type/polymorphic_type_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/type/polymorphic_type_spec.rb
+++ b/spec/type/polymorphic_type_spec.rb
@@ -126,8 +126,11 @@ RSpec.describe AttrJson::Type::PolymorphicModel do
describe "assigning via json_attributes" do
it "allows assigning via raw hash object" do
instance.json_attributes = {
- "many_poly"=>[{"str"=>"str", "int"=>12}, {"str"=>"str", "bool"=>true}],
- "one_poly"=>{"str"=>"str", "int"=>12},
+ "one_poly": {"int": 12, "str": "str", "type": "Model1"},
+ "many_poly": [
+ {"int": 12, "str": "str", "type": "Model1"},
+ {"str": "str", "bool": true, "type": "Model2"}
+ ]
}
instance.save
# TODO: assert assignment worked correctly | make sure to pass in the "type" field on the hash | jrochkind_attr_json | train | rb |
1517a0a6307b477331c413523dd5688743b66729 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ def readme():
return f.read()
setup(name='zk_shell',
- version='0.1',
+ version='0.2',
description='A Python - Kazoo based - shell for ZooKeeper',
long_description=readme(),
classifiers=[ | Version bump since prev package didn't include data files | rgs1_zk_shell | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.