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
|
---|---|---|---|---|---|
3af7f805de9150c22b5bcf708f9c3440e25c9ff9 | diff --git a/datalake_common/tests/conftest.py b/datalake_common/tests/conftest.py
index <HASH>..<HASH> 100644
--- a/datalake_common/tests/conftest.py
+++ b/datalake_common/tests/conftest.py
@@ -23,10 +23,12 @@ def random_hex(length):
return ('%0' + str(length) + 'x') % random.randrange(16**length)
def random_interval():
- now = datetime.now()
- start = now - timedelta(days=random.randint(0, 365*3))
- end = start + timedelta(days=random.randint(1, 10))
- return start.isoformat(), end.isoformat()
+ year_2010 = 1262304000000
+ five_years = 5 * 365 * 24 * 60 * 60 * 1000
+ three_days = 3 * 24 * 60 * 60 * 1000
+ start = year_2010 + random.randint(0, five_years)
+ end = start + random.randint(0, three_days)
+ return start, end
def random_work_id():
if random.randint(0, 1): | make random start and end ms since epoch | planetlabs_datalake-common | train | py |
e9b8a20d7c489d8b52bf8d6ed87924638329e8f0 | diff --git a/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/application/ViewHandler.java b/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/application/ViewHandler.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/application/ViewHandler.java
+++ b/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/application/ViewHandler.java
@@ -98,7 +98,7 @@ public abstract class ViewHandler
@JSFWebConfigParam(since="2.2")
public static final java.lang.String DISABLE_FACELET_JSF_VIEWHANDLER_PARAM_NAME =
- "DISABLE_FACELET_JSF_VIEWHANDLER";
+ "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER";
/**
* Define the default buffer size value passed to ExternalContext.setResponseBufferResponse() and in a | Issue #<I>: rename ViewHandler DISABLE_FACELET_JSF_VIEWHANDLER property | OpenLiberty_open-liberty | train | java |
21a8c235fc5a26fe1da6d4dfaf1014f3ec6572a5 | diff --git a/eventkit/admin_forms.py b/eventkit/admin_forms.py
index <HASH>..<HASH> 100644
--- a/eventkit/admin_forms.py
+++ b/eventkit/admin_forms.py
@@ -5,11 +5,9 @@ Admin forms for ``eventkit`` app.
from django import forms
from eventkit import models
-from eventkit.forms import RecurrenceRuleField
class BaseEventForm(forms.ModelForm):
- recurrence_rule = RecurrenceRuleField()
propagate = forms.BooleanField(
help_text='Propagate changes to all future repeat events?',
required=False, | Don't redeclare `recurrence_rule` field on `BaseEventForm`.
This was making the field required even when it was not required by the model,
and seems to be redundant, anyway. | ic-labs_django-icekit | train | py |
c0ef8e542c3c74e5f89494ceb0fb1adf9369805e | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,3 +1,4 @@
export * from './Video';
export * from './Img';
export * from './Script';
+export * from './Audio'; | add Audio export
whoops, left this out | palmerhq_the-platform | train | js |
41b2ba5926ab01be517c8e8c51cc168b1cb00837 | diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -690,8 +690,8 @@ module ActiveRecord
# +to_table+ contains the referenced primary key.
#
# The foreign key will be named after the following pattern: <tt>fk_rails_<identifier></tt>.
- # +identifier+ is a 10 character long random string. A custom name can be specified with
- # the <tt>:name</tt> option.
+ # +identifier+ is a 10 character long string which is deterministically generated from the
+ # +from_table+ and +column+. A custom name can be specified with the <tt>:name</tt> option.
#
# ====== Creating a simple foreign key
# | fix documentation for SchemaStatements#add_foreign_key
The implementation of the generation of the foreign key name was changed
between Rails <I> and <I> from a random to a deterministic behavior,
however the documentation still describes the old randomized behavior. | rails_rails | train | rb |
48d65c6d9538a3053d14c0e5f6f7af84a3c22568 | diff --git a/core/commands2/diag.go b/core/commands2/diag.go
index <HASH>..<HASH> 100644
--- a/core/commands2/diag.go
+++ b/core/commands2/diag.go
@@ -28,6 +28,14 @@ type DiagnosticOutput struct {
}
var diagCmd = &cmds.Command{
+ // TODO UsageLine: "net-diag",
+ // TODO Short: "Generate a diagnostics report",
+ Help: `ipfs net-diag - Generate a diagnostics report.
+
+ Sends out a message to each node in the network recursively
+ requesting a listing of data about them including number of
+ connected peers and latencies between them.
+`,
Run: func(res cmds.Response, req cmds.Request) {
n := req.Context().Node
diff --git a/core/commands2/root.go b/core/commands2/root.go
index <HASH>..<HASH> 100644
--- a/core/commands2/root.go
+++ b/core/commands2/root.go
@@ -62,7 +62,7 @@ var rootSubcommands = map[string]*cmds.Command{
"name": nameCmd,
"add": addCmd,
"log": logCmd,
- "diag": diagCmd,
+ "net-diag": diagCmd,
"pin": pinCmd,
"unpin": unpinCmd,
"version": versionCmd, | docs(net-diag) help + name
@jbenet @whyrusleeping
Docs read net-diag. It seems the command was previously registered as
diag. Which do you prefer? | ipfs_go-ipfs | train | go,go |
85572d7b67829b3d1fd9fae2d5579830f4c3a8f8 | diff --git a/test/element.line.tests.js b/test/element.line.tests.js
index <HASH>..<HASH> 100644
--- a/test/element.line.tests.js
+++ b/test/element.line.tests.js
@@ -110,6 +110,9 @@ describe('Line element tests', function() {
name: 'moveTo',
args: [0, 0]
}, {
+ name: 'moveTo',
+ args: [0, 10]
+ }, {
name: 'lineTo',
args: [0, 10]
}, {
@@ -252,6 +255,9 @@ describe('Line element tests', function() {
name: 'moveTo',
args: [0, 2]
}, {
+ name: 'moveTo',
+ args: [0, 10]
+ }, {
name: 'lineTo',
args: [0, 10]
}, {
@@ -376,6 +382,9 @@ describe('Line element tests', function() {
name: 'moveTo',
args: [0, 0]
}, {
+ name: 'moveTo',
+ args: [0, 10]
+ }, {
name: 'lineTo',
args: [0, 10]
}, {
@@ -537,6 +546,9 @@ describe('Line element tests', function() {
name: 'moveTo',
args: [0, 2]
}, {
+ name: 'moveTo',
+ args: [0, 10]
+ }, {
name: 'lineTo',
args: [0, 10]
}, { | element.line.js now passes tests | chartjs_Chart.js | train | js |
a92d725cac8f81e85e13c8156f30e5280d7e742e | diff --git a/structr-core/src/main/java/org/structr/core/entity/SchemaLabel.java b/structr-core/src/main/java/org/structr/core/entity/SchemaLabel.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/core/entity/SchemaLabel.java
+++ b/structr-core/src/main/java/org/structr/core/entity/SchemaLabel.java
@@ -34,13 +34,12 @@ public class SchemaLabel extends AbstractNode {
public static final Property<List<SchemaProperty>> labeledProperties = new StartNodes<>("labeledProperties", SchemaPropertyLabel.class);
public static final Property<String> locale = new StringProperty("locale");
- public static final Property<String> label = new StringProperty("label");
public static final View defaultView = new View(SchemaLabel.class, PropertyView.Public,
- labeledProperties, locale, label
+ labeledProperties, locale, name
);
public static final View uiView = new View(SchemaLabel.class, PropertyView.Ui,
- labeledProperties, locale, label
+ labeledProperties, locale, name
);
} | removed property "label" in favor of simply using "name" | structr_structr | train | java |
4bb2eb13d4d0ee0f3869e52bf37e979a7c2abe11 | diff --git a/services.js b/services.js
index <HASH>..<HASH> 100644
--- a/services.js
+++ b/services.js
@@ -16,7 +16,7 @@ module.exports = {
_properties: function(service, selected, error) {
_.map(service.properties, function(prop) {
if (!_.get(selected, prop.name)) {
- var _default = _.get(prop.default);
+ var _default = _.get(prop, "default");
if (_.isFunction(_default)) {
_default = _default.call({ env: process.env, pkg: package });
}
@@ -49,8 +49,8 @@ module.exports = {
error("'"+ selected.type + "' is not supported.")
}
return {
- service: service, config:
- this._properties(service, selected)
+ service: service,
+ config: this._properties(service, selected, error)
};
}
} | Fixed error finding default property of service property | donejs_deploy | train | js |
213fc0ae5e4a16b01015df9b9310e64f500b6087 | diff --git a/lib/write_xlsx/worksheet.rb b/lib/write_xlsx/worksheet.rb
index <HASH>..<HASH> 100644
--- a/lib/write_xlsx/worksheet.rb
+++ b/lib/write_xlsx/worksheet.rb
@@ -1277,10 +1277,6 @@ module Writexlsx
@print_style.repeat_cols
end
- def print_area # :nodoc:
- @print_area.dup
- end
-
#
# :call-seq:
# print_area(first_row, first_col, last_row, last_col)
@@ -1294,7 +1290,7 @@ module Writexlsx
# worksheet2.print_area( 'A:H' ); # Columns A to H if rows have data
#
def print_area(*args)
- return @print_area if args.empty?
+ return @print_area.dup if args.empty?
row1, col1, row2, col2 = row_col_notation(args)
return if [row1, col1, row2, col2].include?(nil)
@@ -1305,6 +1301,7 @@ module Writexlsx
# Build up the print area range "=Sheet2!R1C1:R2C1"
@print_area = convert_name_area(row1, col1, row2, col2)
+ @print_area.dup
end
# | * Worksheet#print_area defined twice. | cxn03651_write_xlsx | train | rb |
58660bbd836709f466b70e9ef8ed6d80b1d470ec | diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -16,7 +16,7 @@ const (
VersionPatch = 0
// VersionDev indicates development branch. Releases will be empty string.
- VersionDev = "-dev"
+ VersionDev = ""
)
// Version is the specification version that the package types support. | version: make this <I> | vbatts_go-mtree | train | go |
91f12676629af1b1879c2312bbe217396a0100e1 | diff --git a/lib/components/client-factory.js b/lib/components/client-factory.js
index <HASH>..<HASH> 100644
--- a/lib/components/client-factory.js
+++ b/lib/components/client-factory.js
@@ -1,5 +1,4 @@
"use strict";
-var requestModule = require("request");
/**
* @constructor
@@ -36,6 +35,14 @@ function ClientFactory(opts) {
*/
ClientFactory.prototype.setLogFunction = function(func) {
if (func) {
+ /* It would be nice if could ask the sdk what its current request
+ * function is for wrapping purposes. Until such an API is invented for
+ * that this hack will do
+ */
+ var origRequest = this._sdk.createClient({
+ baseUrl: "dummy",
+ })._http.opts.request;
+
this._sdk.request(function(opts, callback) {
var logPrefix = (
(opts._matrix_opts && opts._matrix_opts._reqId ?
@@ -50,7 +57,7 @@ ClientFactory.prototype.setLogFunction = function(func) {
(opts.body ? JSON.stringify(opts.body).substring(0, 80) : "")
);
// Make the request
- requestModule(opts, function(err, response, body) {
+ origRequest(opts, function(err, response, body) {
// Response logging
var httpCode = response ? response.statusCode : null;
var responsePrefix = logPrefix + " HTTP " + httpCode; | IncrediblyDodgyHack to make ClientFactory's wrapping of js-sdk's request() respect other people who also wrap it | matrix-org_matrix-appservice-bridge | train | js |
d654fecae0df2fc3879fdd6833df82d82714ab1d | diff --git a/translator/package.go b/translator/package.go
index <HASH>..<HASH> 100644
--- a/translator/package.go
+++ b/translator/package.go
@@ -356,6 +356,7 @@ func (c *PkgContext) translateTypeSpec(s *ast.TypeSpec) {
c.Printf(`%s.prototype.Go$key = function() { return this.Go$id; };`, typeName)
c.Printf("%s.Go$NonPointer = function(v) { this.Go$val = v; };", typeName)
c.Printf("%s.Go$NonPointer.prototype.Go$uncomparable = true;", typeName)
+ c.Printf(`%s.prototype.Go$type = function() { return new Go$reflect.rtype(0, 0, 0, 0, 0, Go$reflect.Pointer, null, null, Go$newDataPointer("*%s.%s"), null, null); };`, typeName, obj.Pkg().Name(), obj.Name())
fields := make([]string, t.NumFields())
for i := range fields {
field := t.Field(i) | Reflection for pointers to structures. | gopherjs_gopherjs | train | go |
48a20ad6e02407c4e029d17a4b6ada7cf5714bdf | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -8,7 +8,7 @@ module.exports = function(kbox) {
var events = kbox.core.events;
var engine = kbox.engine;
- kbox.whenApp(function(app) {
+ kbox.ifApp(function(app) {
// Grab the clients
var Git = require('./lib/git.js'); | s/whenApp/ifApp/g | pirog_kalabox-plugin-git | train | js |
e150c757448ca80175fd9dc355d2fd402a9d3cbe | diff --git a/ftr/version.py b/ftr/version.py
index <HASH>..<HASH> 100644
--- a/ftr/version.py
+++ b/ftr/version.py
@@ -1,2 +1,2 @@
-version = '0.4.6'
+version = '0.5' | version bump for <I>. | 1flow_python-ftr | train | py |
3c9f031759077c4b0824bad308d3f31ffd5a76fa | diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java
index <HASH>..<HASH> 100644
--- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java
+++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java
@@ -105,7 +105,7 @@ public class RealtimePlumberSchool implements PlumberSchool
this.windowPeriod = windowPeriod;
this.basePersistDirectory = basePersistDirectory;
this.segmentGranularity = segmentGranularity;
- this.rejectionPolicyFactory = rejectionPolicyFactory;
+ this.rejectionPolicyFactory = rejectionPolicyFactory == null ? new ServerTimeRejectionPolicyFactory() : rejectionPolicyFactory;
Preconditions.checkNotNull(windowPeriod, "RealtimePlumberSchool requires a windowPeriod.");
Preconditions.checkNotNull(basePersistDirectory, "RealtimePlumberSchool requires a basePersistDirectory."); | 1) Default the rejectionPolicy to server time | apache_incubator-druid | train | java |
e4ced3e783cba8094239cc610bd15c766561cd48 | diff --git a/salt/payload.py b/salt/payload.py
index <HASH>..<HASH> 100644
--- a/salt/payload.py
+++ b/salt/payload.py
@@ -105,7 +105,8 @@ class Serial(object):
'''
data = fn_.read()
fn_.close()
- return self.loads(data)
+ if data:
+ return self.loads(data)
def dumps(self, msg):
''' | Avoid trying to deserialize empty files
This fixes errors encountered by the minion where an attempt to read an empty file from the cache will produce msgpack exceptions in the log. | saltstack_salt | train | py |
42c136f8c6f41f4d059827e0662e9b9d9de83792 | diff --git a/lib/Parser/XML.php b/lib/Parser/XML.php
index <HASH>..<HASH> 100644
--- a/lib/Parser/XML.php
+++ b/lib/Parser/XML.php
@@ -44,6 +44,25 @@ class XML extends Parser {
protected $root;
/**
+ * Creates the parser.
+ *
+ * Optionally, it's possible to parse the input stream here.
+ *
+ * @param mixed $input
+ * @param int $options Any parser options (OPTION constants).
+ * @return void
+ */
+ public function __construct($input = null, $options = 0) {
+
+ if(0 === $options) {
+ $options = parent::OPTION_FORGIVING;
+ }
+
+ parent::__construct($input, $options);
+
+ }
+
+ /**
* Parse xCal or xCard.
*
* @param resource|string $input | !xml Enable OPTION_FORGIVING by default. | sabre-io_vobject | train | php |
9397f66f932d156f59aa8fe267e577035afb8b65 | diff --git a/lib/rib/plugin.rb b/lib/rib/plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/rib/plugin.rb
+++ b/lib/rib/plugin.rb
@@ -1,6 +1,8 @@
module Rib; end
module Rib::Plugin
+ Rib::P = self
+
def self.included mod
mod.send(:include, Rib) | make Rib::P an alias of Rib::Plugin | godfat_rib | train | rb |
e915832e6e3c2f9af92298024d567e8c1b2d8bd5 | diff --git a/test/app.resolve.js b/test/app.resolve.js
index <HASH>..<HASH> 100644
--- a/test/app.resolve.js
+++ b/test/app.resolve.js
@@ -27,9 +27,9 @@ describe('.resolve', function() {
var fp = base.resolve(fixtures('a'));
assert.equal(typeof fp, 'string');
});
-
+
it('should resolve a generator path from a cwd', function() {
- assert(base.resolve('a', fixtures()));
+ assert(base.resolve('a', {cwd: fixtures()}));
});
it('should resolve a generator path from a generator name', function() { | pass fixtures path as cwd for cwd test | base_base-generators | train | js |
02ab912b74f4c4e57b91f0503faffcaa0b3f5d3d | diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js
index <HASH>..<HASH> 100644
--- a/src/pixi/primitives/Graphics.js
+++ b/src/pixi/primitives/Graphics.js
@@ -132,7 +132,7 @@ PIXI.Graphics.prototype.beginFill = function(color, alpha)
{
this.filling = true;
this.fillColor = color || 0;
- this.fillAlpha = alpha || 1;
+ this.fillAlpha = (alpha == undefined) ? 1 : alpha;
}
/** | fixed graphics fill alpha bug
Fixed issue where if beginfill alpha was set to 0 it would be stored as
1. | drkibitz_node-pixi | train | js |
7560f0d33af67a64dca8c3c4fe1ebd1cd0537823 | diff --git a/awesomplete.js b/awesomplete.js
index <HASH>..<HASH> 100644
--- a/awesomplete.js
+++ b/awesomplete.js
@@ -195,17 +195,12 @@ _.prototype = {
selected = selected || this.ul.children[this.index];
if (selected) {
- var prevented;
-
- $.fire(this.input, "awesomplete-select", {
+ var allowed = $.fire(this.input, "awesomplete-select", {
text: selected.textContent,
- preventDefault: function () {
- prevented = true;
- },
origin: origin || selected
});
- if (!prevented) {
+ if (allowed) {
this.replace(selected.textContent);
this.close();
$.fire(this.input, "awesomplete-selectcomplete");
@@ -349,7 +344,7 @@ $.fire = function(target, type, properties) {
evt[j] = properties[j];
}
- target.dispatchEvent(evt);
+ return target.dispatchEvent(evt);
};
$.regExpEscape = function (s) { | Use dispatchEvent return value to get defaultPrevented
Standard `element.dispatchEvent` already provides infromation of
wether event was prevented or not. From MDN:
The return value is false if at least one of the event handlers
which handled this event called Event.preventDefault(). Otherwise
it returns true.
Instead of implementing our own `preventDefault()` use existing. | LeaVerou_awesomplete | train | js |
efbf9e9227febd11bf883f5f3805fc696f767a2e | diff --git a/utils/src/main/java/org/owasp/dependencycheck/utils/search/FileContentSearch.java b/utils/src/main/java/org/owasp/dependencycheck/utils/search/FileContentSearch.java
index <HASH>..<HASH> 100644
--- a/utils/src/main/java/org/owasp/dependencycheck/utils/search/FileContentSearch.java
+++ b/utils/src/main/java/org/owasp/dependencycheck/utils/search/FileContentSearch.java
@@ -48,7 +48,7 @@ public final class FileContentSearch {
return false;
}
- public static boolean contains(File file, List<String> patterns) throws IOException {
+ public static boolean contains(File file, String[] patterns) throws IOException {
List<Pattern> regexes = new ArrayList<>();
for (String pattern : patterns) {
regexes.add(Pattern.compile(pattern)); | more robust storage of string arrays in settings | jeremylong_DependencyCheck | train | java |
15c75950daf063857d124762adcf23bb5738d851 | diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js
index <HASH>..<HASH> 100644
--- a/lib/helper/Puppeteer.js
+++ b/lib/helper/Puppeteer.js
@@ -59,7 +59,8 @@ const consoleLogStore = new Console();
*
* ```js
* "chrome": {
- * "executablePath" : "/path/to/Chrome"
+ * "executablePath" : "/path/to/Chrome",
+ * "browserWSEndpoint": "ws://localhost:3000"
* }
* ```
*
@@ -376,7 +377,7 @@ class Puppeteer extends Helper {
}
async _startBrowser() {
- this.browser = await puppeteer.launch(this.puppeteerOptions);
+ this.browser = this.puppeteerOptions.browserWSEndpoint ? await puppeteer.connect(this.puppeteerOptions) : await puppeteer.launch(this.puppeteerOptions);
this.browser.on('targetcreated', target => target.page().then(page => targetCreatedHandler.call(this, page)));
this.browser.on('targetchanged', (target) => {
this.debugSection('Url', target.url()); | Add support to use WSEndpoint on puppeter (#<I>) | Codeception_CodeceptJS | train | js |
91c3d6c30d75ce66228d52c74bf8a4d8e7628670 | diff --git a/hamper/plugins/roulette.py b/hamper/plugins/roulette.py
index <HASH>..<HASH> 100644
--- a/hamper/plugins/roulette.py
+++ b/hamper/plugins/roulette.py
@@ -1,4 +1,4 @@
-import random
+import random, datetime
from hamper.interfaces import ChatCommandPlugin, Command
@@ -22,7 +22,7 @@ class Roulette(ChatCommandPlugin):
if comm['pm']:
return False
- dice = random.randint(1, 6)
+ dice = random.randint(1,6)
if dice == 6:
bot.kick(comm["channel"], comm["user"], "You shot yourself!")
else: | This should break the flakes8 check on Travis | hamperbot_hamper | train | py |
af2569c2d852e20f1e6670d7e068fa4e9065500d | diff --git a/storage/kvstore_test.go b/storage/kvstore_test.go
index <HASH>..<HASH> 100644
--- a/storage/kvstore_test.go
+++ b/storage/kvstore_test.go
@@ -654,11 +654,11 @@ func TestRestoreContinueUnfinishedCompaction(t *testing.T) {
tx = s1.b.BatchTx()
tx.Lock()
ks, _ := tx.UnsafeRange(keyBucketName, revbytes, nil, 0)
+ tx.Unlock()
if len(ks) != 0 {
time.Sleep(100 * time.Millisecond)
continue
}
- tx.Unlock()
return
} | storage, test: unlock transaction in the retry loop | etcd-io_etcd | train | go |
e58f11683003ec1515113103895e18a8c9003aa3 | diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/timestamp_test.rb
+++ b/activerecord/test/cases/timestamp_test.rb
@@ -176,26 +176,6 @@ class TimestampTest < ActiveRecord::TestCase
assert_not_equal time, owner.updated_at
end
- def test_clearing_association_touches_the_old_record
- klass = Class.new(ActiveRecord::Base) do
- def self.name; 'Toy'; end
- belongs_to :pet, touch: true
- end
-
- toy = klass.find(1)
- pet = toy.pet
- time = 3.days.ago.at_beginning_of_hour
-
- pet.update_columns(updated_at: time)
-
- toy.pet = nil
- toy.save!
-
- pet.reload
-
- assert_not_equal time, pet.updated_at
- end
-
def test_timestamp_attributes_for_create
toy = Toy.first
assert_equal toy.send(:timestamp_attributes_for_create), [:created_at, :created_on] | Remove test case also related to the belongs_to touch feature | rails_rails | train | rb |
a28996d9fd6ea3d2dbcfaa40eb3efaec89053402 | diff --git a/gosu-core-api/src/main/java/gw/lang/reflect/FunctionType.java b/gosu-core-api/src/main/java/gw/lang/reflect/FunctionType.java
index <HASH>..<HASH> 100644
--- a/gosu-core-api/src/main/java/gw/lang/reflect/FunctionType.java
+++ b/gosu-core-api/src/main/java/gw/lang/reflect/FunctionType.java
@@ -866,6 +866,28 @@ public class FunctionType extends AbstractType implements IFunctionType, IGeneri
return false;
}
+ // Function Type Variables
+ if( isGenericType() != funcType.isGenericType() )
+ {
+ return false;
+ }
+ if( isGenericType() )
+ {
+ IGenericTypeVariable[] gtvs = getGenericTypeVariables();
+ IGenericTypeVariable[] thatGtvs = funcType.getGenericTypeVariables();
+ if( gtvs.length != thatGtvs.length )
+ {
+ return false;
+ }
+ for( int i = 0; i < gtvs.length; i++ )
+ {
+ if( !gtvs[i].equals( thatGtvs[i]) )
+ {
+ return false;
+ }
+ }
+ }
+
// Parameter Types
if( funcType.getParameterTypes().length != getParameterTypes().length )
{ | FunctionType equality must account for generic type variables | gosu-lang_gosu-lang | train | java |
b7e794cccf059e63f885762e8cee02340f8ddca3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@
from distutils.core import setup
-version = '2018.12.16'
+version = '2018.12.16.1'
setup(
name = 'strict_functions', | better tracing so you can look into libraries deeper | CodyKochmann_strict_functions | train | py |
5446ccbeed5fcb5493e951801417b6623771e171 | diff --git a/kubespawner/objects.py b/kubespawner/objects.py
index <HASH>..<HASH> 100644
--- a/kubespawner/objects.py
+++ b/kubespawner/objects.py
@@ -228,7 +228,7 @@ def make_pod(
)
pod.spec = V1PodSpec(containers=[])
- pod.spec.restartPolicy = 'Never'
+ pod.spec.restart_policy = 'OnFailure'
security_context = V1PodSecurityContext()
if fs_gid is not None: | Fix pod default restart_policy and set it to OnFailure | jupyterhub_kubespawner | train | py |
65e85be40af8e238b05118f01d13afe87e4764c2 | diff --git a/test/unit/gateways/moneris_test.rb b/test/unit/gateways/moneris_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/gateways/moneris_test.rb
+++ b/test/unit/gateways/moneris_test.rb
@@ -245,7 +245,7 @@ class MonerisTest < Test::Unit::TestCase
gateway = MonerisGateway.new(login: 'store1', password: 'yesguy', avs_enabled: true)
billing_address = address(address1: "1234 Anystreet", address2: "")
- stub_comms do
+ stub_comms(gateway) do
gateway.purchase(@amount, @credit_card, billing_address: billing_address, order_id: "1")
end.check_request do |endpoint, data, headers|
assert_match(%r{avs_street_number>1234<}, data)
@@ -257,7 +257,7 @@ class MonerisTest < Test::Unit::TestCase
def test_avs_enabled_but_not_provided
gateway = MonerisGateway.new(login: 'store1', password: 'yesguy', avs_enabled: true)
- stub_comms do
+ stub_comms(gateway) do
gateway.purchase(@amount, @credit_card, @options.tap { |x| x.delete(:billing_address) })
end.check_request do |endpoint, data, headers|
assert_no_match(%r{avs_street_number>}, data) | Moneris: Fix unit test stubs
Pass local gateway to `stub_comms` as needed, to override default @gateway.
Closes #<I> | activemerchant_active_merchant | train | rb |
4d05c6082b8da283fe430cbb81688961563113d3 | diff --git a/middleware/mw.invalid.path.js b/middleware/mw.invalid.path.js
index <HASH>..<HASH> 100644
--- a/middleware/mw.invalid.path.js
+++ b/middleware/mw.invalid.path.js
@@ -60,6 +60,10 @@ module.exports = function (Q) {
return reply('Invalid path').code(404);
}
+ if ( /\/search\//.test(url) && url.length > 500 ) { // otherwise we sometimes get a 500?
+ return reply().redirect('/search').permanent(true);
+ }
+
// todo: ask Jeff how to get these back to gh- don't belong here...
if (/\/problemsUrl$/i.test(url)) {
return reply().redirect('https://problems.gethuman.com').permanent(true); | protect from super long search urls causing <I> error | gethuman_pancakes-recipe | train | js |
e1fae0e244933c30ddcedac6a9652c7c0c4da0c6 | diff --git a/conn_windows.go b/conn_windows.go
index <HASH>..<HASH> 100644
--- a/conn_windows.go
+++ b/conn_windows.go
@@ -2,6 +2,7 @@
package dbus
+import "os"
const defaultSystemBusAddress = "tcp:host=127.0.0.1,port=12434"
@@ -11,4 +12,4 @@ func getSystemBusPlatformAddress() string {
return address
}
return defaultSystemBusAddress
-}
\ No newline at end of file
+} | Import "os" in conn_windows.go
Fixes build on windows. | godbus_dbus | train | go |
4106abbbd1f0af192ac02d361c075fec5046ed2f | diff --git a/jquery.cookie.js b/jquery.cookie.js
index <HASH>..<HASH> 100644
--- a/jquery.cookie.js
+++ b/jquery.cookie.js
@@ -7,7 +7,7 @@
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
-(function($) {
+(function($, document) {
$.cookie = function(key, value, options) {
// key and at least value given, set cookie...
@@ -49,4 +49,4 @@
$.cookie.defaults = {};
-})(jQuery);
+})(jQuery, document); | Pass document through the Immediately-Invoked Function Expression
UglifyJS <I> characters -> <I> characters | js-cookie_js-cookie | train | js |
d5f4a3ef9547a5a66c8afd765aa20e3909a2e8c5 | diff --git a/lib/http.js b/lib/http.js
index <HASH>..<HASH> 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -33,7 +33,6 @@ exports.listen = function (options, transportUtil) {
};
server = Https.createServer(httpsOptions);
}else{
- console.log('----> http');
server = Http.createServer();
} | Adding HTTPS functionality for the http/web seneca-transport type - removing comments | senecajs_seneca-transport | train | js |
bb37ef88e2c6b115d9b68d3b4cb7d423b43e4b8f | diff --git a/tests/test_alchemy.py b/tests/test_alchemy.py
index <HASH>..<HASH> 100644
--- a/tests/test_alchemy.py
+++ b/tests/test_alchemy.py
@@ -257,6 +257,7 @@ class SQLAlchemyNoSessionTestCase(unittest.TestCase):
NoSessionFactory.create()
def test_build_does_not_raises_exception_when_no_session_was_set(self):
+ NoSessionFactory.reset_sequence() # Make sure we start at test ID 0
inst0 = NoSessionFactory.build()
inst1 = NoSessionFactory.build()
self.assertEqual(inst0.id, 0) | testing: properly reset sequences
When tests assert a given sequence ID for the created instance, ensure
the factory's sequence counter is reset beforehand.
Closes #<I> | FactoryBoy_factory_boy | train | py |
fadbd770e4e401dc5fa02b0672186f096862e130 | diff --git a/lib/foundation_rails_helper/form_builder.rb b/lib/foundation_rails_helper/form_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/foundation_rails_helper/form_builder.rb
+++ b/lib/foundation_rails_helper/form_builder.rb
@@ -3,7 +3,7 @@ require 'action_view/helpers'
module FoundationRailsHelper
class FormBuilder < ActionView::Helpers::FormBuilder
include ActionView::Helpers::TagHelper
- %w(file_field email_field text_field text_area).each do |method_name|
+ %w(file_field email_field text_field text_area telephone_field phone_field url_field number_field).each do |method_name|
define_method(method_name) do |*args|
attribute = args[0]
options = args[1] || {} | support for more html5 input fields
telephone_field phone_field url_field number_field | sgruhier_foundation_rails_helper | train | rb |
9f857991694a23d2bd7455ee87c8ad07e41c7f93 | diff --git a/pysat/instruments/supermag_magnetometer.py b/pysat/instruments/supermag_magnetometer.py
index <HASH>..<HASH> 100644
--- a/pysat/instruments/supermag_magnetometer.py
+++ b/pysat/instruments/supermag_magnetometer.py
@@ -740,7 +740,7 @@ def download(date_array, tag, sat_id='', data_path=None, user=None,
out_data = out[0]
# Save the file data
- with open(fname, "w") as local_file:
+ with open(fname, "wb") as local_file:
local_file.write(out_data)
local_file.close()
del out_data | Attempt to fix python 3 issue, writing binary files | rstoneback_pysat | train | py |
c916bfa9f8a5946d737dcfd6d2c4206877089bb9 | diff --git a/lib/virtus/attributes/attribute.rb b/lib/virtus/attributes/attribute.rb
index <HASH>..<HASH> 100644
--- a/lib/virtus/attributes/attribute.rb
+++ b/lib/virtus/attributes/attribute.rb
@@ -6,7 +6,7 @@ module Virtus
OPTIONS = [ :primitive, :complex, :accessor, :reader, :writer ].freeze
- DEFAULT_ACCESSOR = :public.freeze
+ DEFAULT_ACCESSOR = :public
class << self
# Returns an array of valid options | A Symbol is immutable, #freeze doesn't really provide any benefit | solnic_virtus | train | rb |
c421d2f37095ec97858d9ec57f960ecaecb7bc7b | diff --git a/tmdbsimple/account.py b/tmdbsimple/account.py
index <HASH>..<HASH> 100644
--- a/tmdbsimple/account.py
+++ b/tmdbsimple/account.py
@@ -382,7 +382,6 @@ class Authentication(TMDB):
payload = {
'session_id': kwargs.pop('session_id', None),
}
- print('payload =', payload)
response = self._DELETE(path, kwargs, payload)
self._set_attrs_to_values(response) | Remove print from session_delete method | celiao_tmdbsimple | train | py |
96f087a2732cc99e3298560c4a2c02a4bf2e239b | diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Command/ConfigCommand.php
+++ b/src/Composer/Command/ConfigCommand.php
@@ -185,7 +185,7 @@ EOT
$authConfigFile = $input->getOption('global')
? ($this->config->get('home') . '/auth.json')
- : dirname(realpath($configFile)) . '/auth.json';
+ : dirname($configFile) . '/auth.json';
$this->authConfigFile = new JsonFile($authConfigFile, null, $io);
$this->authConfigSource = new JsonConfigSource($this->authConfigFile, true); | Remove unnecessary realpath which can fail, closes #<I> | composer_composer | train | php |
8c6dd66a95b744328a8ef5ea5fc50a2df3a53722 | diff --git a/Legobot/Connectors/Slack.py b/Legobot/Connectors/Slack.py
index <HASH>..<HASH> 100644
--- a/Legobot/Connectors/Slack.py
+++ b/Legobot/Connectors/Slack.py
@@ -400,7 +400,7 @@ class Slack(Lego):
return str(self.botThread) != str(message['metadata']['source'])
- def build_attachment(self, text, target, attachment):
+ def build_attachment(self, text, target, attachment, thread):
'''Builds a slack attachment.
Args:
@@ -421,6 +421,8 @@ class Slack(Lego):
}
]
}
+ if thread:
+ attachment['thread_ts'] = thread
return attachment
def handle(self, message):
@@ -477,7 +479,8 @@ class Slack(Lego):
attachment = message['metadata']['opts'].get('attachment')
if attachment:
text = message['metadata']['opts'].get('fallback')
- attachment = self.build_attachment(text, target, attachment)
+ attachment = self.build_attachment(
+ text, target, attachment, thread)
self.botThread.post_attachment(attachment)
else:
self.botThread.slack_client.rtm_send_message( | update attachment code to send attachments in threads if possible. | Legobot_Legobot | train | py |
58b131d5725210bd6294ffa9a37af7d7633a8ad7 | diff --git a/src/Core/InstanceConfigTrait.php b/src/Core/InstanceConfigTrait.php
index <HASH>..<HASH> 100644
--- a/src/Core/InstanceConfigTrait.php
+++ b/src/Core/InstanceConfigTrait.php
@@ -124,7 +124,7 @@ trait InstanceConfigTrait {
* @return void
* @throws Cake\Error\Exception if attempting to clobber existing config
*/
- protected function _configWrite($key, $value, $merge = null) {
+ protected function _configWrite($key, $value, $merge = false) {
if (is_string($key) && $value === null) {
return $this->_configDelete($key);
} | set better default value according to doc block | cakephp_cakephp | train | php |
19d932cd54bbba14602d29891b515bcd8ee92645 | diff --git a/lib/react/component.rb b/lib/react/component.rb
index <HASH>..<HASH> 100644
--- a/lib/react/component.rb
+++ b/lib/react/component.rb
@@ -10,6 +10,10 @@ module React
class_attribute :init_state, :validator
define_callback :before_mount
define_callback :after_mount
+ define_callback :before_receive_props
+ define_callback :before_update
+ define_callback :after_update
+ define_callback :before_unmount
end
base.extend(ClassMethods)
end
@@ -43,23 +47,23 @@ module React
end
def component_will_receive_props(next_props)
-
+ self.run_callback(:before_receive_props, next_props)
end
def should_component_update?(next_props, next_state)
-
+ self.respond_to?(:needs_update?) ? self.needs_update? : true
end
def component_will_update(next_props, next_state)
-
+ self.run_callback(:before_update, next_props, next_state)
end
def component_did_update(prev_props, prev_state)
-
+ self.run_callback(:after_update, prev_props, prev_state)
end
def component_will_unmount
-
+ self.run_callback(:before_unmount)
end
def method_missing(name, *args, &block) | Implement all the lifecyle hooks | zetachang_react.rb | train | rb |
11d23bafa906e1b2d207fde20d621d634c4742a0 | diff --git a/internal/devicescale/impl_windows.go b/internal/devicescale/impl_windows.go
index <HASH>..<HASH> 100644
--- a/internal/devicescale/impl_windows.go
+++ b/internal/devicescale/impl_windows.go
@@ -145,7 +145,6 @@ func getFromLogPixelSx() float64 {
if err != nil {
panic(err)
}
- defer releaseDC(0, dc)
// Note that GetDeviceCaps with LOGPIXELSX always returns a same value for any monitors
// even if multiple monitors are used.
@@ -154,6 +153,10 @@ func getFromLogPixelSx() float64 {
panic(err)
}
+ if err := releaseDC(0, dc); err != nil {
+ panic(err)
+ }
+
return float64(dpi) / 96
}
@@ -173,9 +176,9 @@ func impl() float64 {
}
// The window is not initialized yet when w == 0.
if w == 0 {
+ // TODO: Use the primary monitor instead.
return getFromLogPixelSx()
}
- defer releaseDC(0, w)
m, err := monitorFromWindow(w, monitorDefaultToNearest)
if err != nil { | devicescale: Bug fix: the active window can't be passed to ReleaseDC | hajimehoshi_ebiten | train | go |
4f4b2fca2ff03ee4c04e7d903fe05e879b5ee253 | diff --git a/test_content.js b/test_content.js
index <HASH>..<HASH> 100644
--- a/test_content.js
+++ b/test_content.js
@@ -144,7 +144,7 @@ module.exports = {
// console.log(JSON.stringify(_actualPixels, null, 2));
// console.log(JSON.stringify(_expectedPixels, null, 2));
_actualPixels.forEach(function (val, i) {
- if (_expectedPixels[i] !== val) {
+ if (Math.abs(_expectedPixels[i] - val) > 10) {
console.log('index "' + i + '" did not match values. Actual: ' + val + ' Expected: ' + _expectedPixels[i]);
}
}); | Moving to a +/- <I> threshold seems to work | twolfson_spritesmith-engine-test | train | js |
114435c795d2a0cb2914cf54c9571d22026c2138 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ for d in os.walk('appkit/'):
path_list = [str.join('/', os.path.join(d[0], x).split('/')[1:]) for x in d[2]]
data.extend(path_list)
-requires = ['flask', ]
+requires = ['flask', 'pygobject',]
requires.append('beautifulsoup4') # v0_2_4 backward compatibility
setup( | <I>: Add pygobject as dependency | nitipit_appkit | train | py |
8e4cf3179b6bcdfdcc381044ac39ff6f689508e2 | diff --git a/atomic_reactor/plugins/exit_remove_built_image.py b/atomic_reactor/plugins/exit_remove_built_image.py
index <HASH>..<HASH> 100644
--- a/atomic_reactor/plugins/exit_remove_built_image.py
+++ b/atomic_reactor/plugins/exit_remove_built_image.py
@@ -42,8 +42,6 @@ class GarbageCollectionPlugin(ExitPlugin):
image = self.workflow.builder.image_id
if image:
self.remove_image(image, force=True)
- else:
- self.log.error("no built image, nothing to remove")
if self.remove_base_image and self.workflow.pulled_base_images:
# FIXME: we may need to add force here, let's try it like this for now | don't log error when build image is already deleted | projectatomic_atomic-reactor | train | py |
792d69b473dac4f38b3b889df06b376dfc7f6084 | diff --git a/library/CM/Form/ExampleIcon.php b/library/CM/Form/ExampleIcon.php
index <HASH>..<HASH> 100644
--- a/library/CM/Form/ExampleIcon.php
+++ b/library/CM/Form/ExampleIcon.php
@@ -1,6 +1,7 @@
<?php
class CM_Form_ExampleIcon extends CM_Form_Abstract {
+
public function setup() {
$this->registerField(new CM_FormField_Integer('sizeSlider', 6, 120, 0));
@@ -12,7 +13,7 @@ class CM_Form_ExampleIcon extends CM_Form_Abstract {
$this->registerField(new CM_FormField_Integer('shadowBlur', 0, 20, 0));
}
- public function renderStart(array $params = null) {
+ public function _renderStart(CM_Params $params) {
$this->getField('sizeSlider')->setValue(18);
$this->getField('shadowColor')->setValue('#333');
$this->getField('colorBackground')->setValue('#fafafa'); | refactored CM_Form_ExampleIcon | cargomedia_cm | train | php |
415dd376b7703e86a755c768245cb0a465453499 | diff --git a/src/relay.js b/src/relay.js
index <HASH>..<HASH> 100644
--- a/src/relay.js
+++ b/src/relay.js
@@ -205,6 +205,11 @@ export function sequelizeConnection({name, nodeType, target, orderBy: orderByEnu
model.sequelize.literal('COUNT(*) OVER()'),
'full_count'
]);
+ } else if (model.sequelize.dialect.name === 'mssql' && options.limit) {
+ options.attributes.push([
+ model.sequelize.literal('COUNT(*) OVER(ORDER BY (SELECT NULL))'),
+ 'full_count'
+ ]);
}
options.where = argsToWhere(args); | inject full_count column for mssql dialect | mickhansen_graphql-sequelize | train | js |
83034fc987072bc3761d264e94ea50db7921e841 | diff --git a/packages/mangojuice-core/src/classes/Process.js b/packages/mangojuice-core/src/classes/Process.js
index <HASH>..<HASH> 100644
--- a/packages/mangojuice-core/src/classes/Process.js
+++ b/packages/mangojuice-core/src/classes/Process.js
@@ -729,7 +729,7 @@ extend(Process.prototype, {
for (let taskId in this.tasks) {
for (let execId in this.tasks[taskId]) {
const execution = this.tasks[taskId][execId].execution;
- if (execution) {
+ if (is.promise(execution)) {
promises.push(execution);
}
}
@@ -740,7 +740,7 @@ extend(Process.prototype, {
if (proc) {
const childFinished = proc.finished();
if (childFinished !== EMPTY_FINISHED) {
- promises.push(proc.finished());
+ promises.push(childFinished);
}
}
}); | fix(core): do not call finished two times for child process | mangojuicejs_mangojuice | train | js |
1e9531dc36af118db2e1b5f3b9b8926a7f7774fc | diff --git a/lib/puppetserver/ca/version.rb b/lib/puppetserver/ca/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppetserver/ca/version.rb
+++ b/lib/puppetserver/ca/version.rb
@@ -1,5 +1,5 @@
module Puppetserver
module Ca
- VERSION = "1.1.1"
+ VERSION = "1.1.2"
end
end | (GEM) update puppetserver-ca version to <I> | puppetlabs_puppetserver-ca-cli | train | rb |
2266cd157512c835191cddd370036840536caba7 | diff --git a/pysat/_instrument.py b/pysat/_instrument.py
index <HASH>..<HASH> 100644
--- a/pysat/_instrument.py
+++ b/pysat/_instrument.py
@@ -656,22 +656,7 @@ class Instrument(object):
except OSError as e:
if e.errno != errno.EEXIST:
raise
-
- #try:
- # os.mkdir(os.path.join(data_dir, self.platform))
- #except OSError as exception:
- # if exception.errno != errno.EEXIST:
- # raise
- #try:
- # os.mkdir(os.path.join(data_dir, self.platform, self.name))
- #except OSError as exception:
- # if exception.errno != errno.EEXIST:
- # raise
- #try:
- # os.mkdir(self.files.data_path)
- #except OSError as exception:
- # if exception.errno != errno.EEXIST:
- # raise
+ print('Downloading data to: ', self.files.data_path)
date_array = utils.season_date_range(start, stop, freq=freq)
if user is None:
self._download_rtn(date_array,
@@ -825,7 +810,7 @@ class Instrument(object):
stop = pysat.datetime(2009,1,31)
inst.bounds = (start,stop)
for inst in inst:
- print('Another day loaded', inst.date)
+ print('Another day loaded', inst.date)
""" | Added print statement for download directory when download method invoked. | rstoneback_pysat | train | py |
80736c229266fe994835a19177a158d03909b5d8 | diff --git a/lib/rbbt/workflow/accessor.rb b/lib/rbbt/workflow/accessor.rb
index <HASH>..<HASH> 100644
--- a/lib/rbbt/workflow/accessor.rb
+++ b/lib/rbbt/workflow/accessor.rb
@@ -1038,7 +1038,8 @@ module Workflow
when :hash
clean_inputs = Annotated.purge(inputs)
clean_inputs = clean_inputs.collect{|i| Symbol === i ? i.to_s : i }
- key_obj = {:inputs => clean_inputs, :dependencies => dependencies}
+ deps_str = dependencies.collect{|d| Step === d ? d.short_path : d }
+ key_obj = {:inputs => clean_inputs, :dependencies => deps_str }
key_str = Misc.obj2str(key_obj)
hash_str = Misc.digest(key_str)
#Log.debug "Hash for '#{[taskname, jobname] * "/"}' #{hash_str} for #{key_str}" | Consider only short name of dependency in name hash, to allow relocation | mikisvaz_rbbt-util | train | rb |
7b353caf9d4fd8fa6ad147344971b2b7dde77187 | diff --git a/plugins/environment.go b/plugins/environment.go
index <HASH>..<HASH> 100644
--- a/plugins/environment.go
+++ b/plugins/environment.go
@@ -105,7 +105,7 @@ When the -plugin option is specified, these flags are ignored.`)
env.Request.AddModel("openapi.v2.Document", documentv2)
// include experimental API surface model
surfaceModel, err := surface.NewModelFromOpenAPI2(documentv2)
- if err != nil {
+ if err == nil {
env.Request.AddModel("surface.v1.Model", surfaceModel)
}
return env, err
@@ -117,7 +117,7 @@ When the -plugin option is specified, these flags are ignored.`)
env.Request.AddModel("openapi.v3.Document", documentv3)
// include experimental API surface model
surfaceModel, err := surface.NewModelFromOpenAPI3(documentv3)
- if err != nil {
+ if err == nil {
env.Request.AddModel("surface.v1.Model", surfaceModel)
}
return env, err | Fix problem reported in GitHub issue <I>.
<URL> | googleapis_gnostic | train | go |
5d88d2765ab0f8dd6d750cdd7d531b912514af51 | diff --git a/profilelikelihood.py b/profilelikelihood.py
index <HASH>..<HASH> 100644
--- a/profilelikelihood.py
+++ b/profilelikelihood.py
@@ -147,7 +147,7 @@ class twoD:
ybin_index = np.floor((y[j]-self.ylimits[0])/self.ybin_widths[0])
if xbin_index > bins.shape[0] or ybin_index > bins.shape[1]:
- pass
+ continue
if l[j] < bins[ybin_index, xbin_index]:
bins[ybin_index, xbin_index] = l[j] | Actually skip the point if it outside the limits. | sliem_barrett | train | py |
46dfc43ef0fb9ad9f8cbc578904c6a78d60b8363 | diff --git a/modules/serverbidBidAdapter.js b/modules/serverbidBidAdapter.js
index <HASH>..<HASH> 100644
--- a/modules/serverbidBidAdapter.js
+++ b/modules/serverbidBidAdapter.js
@@ -176,6 +176,11 @@ const sizeMap = [
sizeMap[77] = '970x90';
sizeMap[123] = '970x250';
sizeMap[43] = '300x600';
+sizeMap[286] = '970x66';
+sizeMap[3230] = '970x280';
+sizeMap[429] = '486x60';
+sizeMap[374] = '700x500';
+sizeMap[934] = '300x1050';
function getSize(sizes) {
const result = []; | Serverbid Bid Adapter: Add new ad sizes (#<I>) | prebid_Prebid.js | train | js |
4a7d7455033a652232ef7b2457bbedebaa916013 | diff --git a/molo/core/api/importers.py b/molo/core/api/importers.py
index <HASH>..<HASH> 100644
--- a/molo/core/api/importers.py
+++ b/molo/core/api/importers.py
@@ -352,17 +352,6 @@ class SiteImporter(object):
self.record_section_tags(nested_fields, page.id)
self.record_nav_tags(nested_fields, page.id)
- # reaction_questions
- # list -> ["reaction_question"]["id"]
- # -> Need to fetch and create the reaction questions
- # THEN create the link between page and reaction question
- if (("reaction_questions" in nested_fields) and
- nested_fields["reaction_questions"]):
- self.reaction_questions[page.id] = []
- for reaction_question in nested_fields["reaction_questions"]:
- self.reaction_questions[page.id].append(
- reaction_question["reaction_question"]["id"])
-
self.record_recommended_articles(nested_fields, page.id)
# related_sections | Fail tests by removing recording nav_tag functionality | praekeltfoundation_molo | train | py |
a2a4848772fcd6d61b8b03bb5af1178b6d6ae2fd | diff --git a/lib/sfn/version.rb b/lib/sfn/version.rb
index <HASH>..<HASH> 100644
--- a/lib/sfn/version.rb
+++ b/lib/sfn/version.rb
@@ -1,4 +1,4 @@
module Sfn
# Current library version
- VERSION = Gem::Version.new('1.1.6')
+ VERSION = Gem::Version.new('1.1.7')
end | Update version for development <I> | sparkleformation_sfn | train | rb |
2db9444ecd6406a16460c896dee9207370ee9511 | diff --git a/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js b/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js
+++ b/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js
@@ -715,11 +715,6 @@ describe('plugin-meetings', () => {
assert.exists(meeting.setMeetingQuality);
});
- it('should set mediaProperty with the proper level', () => meeting.setMeetingQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
- assert.equal(meeting.mediaProperties.localQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
- assert.equal(meeting.mediaProperties.remoteQualityLevel, CONSTANTS.QUALITY_LEVELS.LOW);
- }));
-
it('should call setRemoteQualityLevel', () => meeting.setMeetingQuality(CONSTANTS.QUALITY_LEVELS.LOW).then(() => {
assert.calledOnce(meeting.setRemoteQualityLevel);
})); | chore(plugin-meetings): test meetingQuality flow | webex_spark-js-sdk | train | js |
6b0a756c9777e25ed58dcde9d4fe8052ae54be9d | diff --git a/Resources/contao/dca/tl_c4g_map_locstyles.php b/Resources/contao/dca/tl_c4g_map_locstyles.php
index <HASH>..<HASH> 100755
--- a/Resources/contao/dca/tl_c4g_map_locstyles.php
+++ b/Resources/contao/dca/tl_c4g_map_locstyles.php
@@ -267,7 +267,7 @@ $GLOBALS['TL_DCA']['tl_c4g_map_locstyles'] = array
'flag' => 1,
'inputType' => 'text',
'eval' => array('tl_class'=>'long', 'rgxp'=>'digit', 'mandatory'=>true),
- 'sql' => "float(3,3) NOT NULL default '1.000'"
+ 'sql' => "double(3,3) NOT NULL default '1.000'"
),
'icon_offset' => array
( | Change sql type of dca field | Kuestenschmiede_MapsBundle | train | php |
b7767eb9b19aa5082fbe1626e3cec76e0b0a2a0d | diff --git a/spec/stringProcessing/wordMatchSpec.js b/spec/stringProcessing/wordMatchSpec.js
index <HASH>..<HASH> 100644
--- a/spec/stringProcessing/wordMatchSpec.js
+++ b/spec/stringProcessing/wordMatchSpec.js
@@ -15,8 +15,9 @@ describe("Counts the occurences of a word in a string", function(){
expect( wordMatch( "<img width='100' />", "width" ) ).toBe( 0 );
});
- it( "should match apostrophes", function() {
+ it( "should match quotes", function() {
expect( wordMatch( "Yoast's analyzer", "Yoast's" ) ).toBe( 1 );
+ expect( wordMatch( "Yoast\"s analyzer", "Yoast\"s analyzer" ) ).toBe( 1 );
});
it( "should match special characters", function() { | Add test for double quotes in word matching | Yoast_YoastSEO.js | train | js |
97f63b4180f3a6d7e4fb7e4e3841f4a1beac1e98 | diff --git a/lib/ddl/database_manager.php b/lib/ddl/database_manager.php
index <HASH>..<HASH> 100644
--- a/lib/ddl/database_manager.php
+++ b/lib/ddl/database_manager.php
@@ -931,7 +931,7 @@ class database_manager {
$schema = new xmldb_structure('export');
$schema->setVersion($CFG->version);
- foreach ($this->get_install_xml_file_list() as $filename) {
+ foreach ($this->get_install_xml_files() as $filename) {
$xmldb_file = new xmldb_file($filename);
if (!$xmldb_file->loadXMLStructure()) {
continue; | MDL-<I> core: Fixed regression caused by MDL-<I> | moodle_moodle | train | php |
0b9b6c53a9ff72cfd2630f9adb832e15bccb0e55 | diff --git a/lib/ohai/plugins/linux/virtualization.rb b/lib/ohai/plugins/linux/virtualization.rb
index <HASH>..<HASH> 100644
--- a/lib/ohai/plugins/linux/virtualization.rb
+++ b/lib/ohai/plugins/linux/virtualization.rb
@@ -56,9 +56,6 @@ Ohai.plugin(:Virtualization) do
elsif modules =~ /^vboxdrv/
virtualization[:system] = "vbox"
virtualization[:role] = "host"
- elsif modules =~ /^vboxguest/
- virtualization[:system] = "vbox"
- virtualization[:role] = "guest"
end
end
@@ -103,6 +100,11 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = "xen"
virtualization[:role] = "guest"
end
+ when /Manufacturer: Oracle Corporation/
+ if so.stdout =~ /Product Name: VirtualBox/
+ virtualization[:system] = "vbox"
+ virtualization[:role] = "guest"
+ end
else
nil
end | Detect virtualbox guests via dmidecode so guest additions aren't
required | chef_ohai | train | rb |
ee666cd9eb35385ee1dce9fa44cf70636fc7605d | diff --git a/src/Admin/Model/UserAdmin.php b/src/Admin/Model/UserAdmin.php
index <HASH>..<HASH> 100644
--- a/src/Admin/Model/UserAdmin.php
+++ b/src/Admin/Model/UserAdmin.php
@@ -186,9 +186,7 @@ abstract class UserAdmin extends SonataUserAdmin
'label' => false,
]
)
- ->add('expired', null, ['required' => false], ['inline_block' => true])
->add('enabled', null, ['required' => false], ['inline_block' => true])
- ->add('credentialsExpired', null, ['required' => false], ['inline_block' => true])
->end();
} | removing expired and credentialsExpired | networking_init-cms-bundle | train | php |
da196a83eb176ff77c4e60204f30fbcd7da4eb91 | diff --git a/assertions/accessibility.js b/assertions/accessibility.js
index <HASH>..<HASH> 100644
--- a/assertions/accessibility.js
+++ b/assertions/accessibility.js
@@ -4,8 +4,12 @@ const script = function (context, options, done) {
window
.axe
.run(context, options)
- .then((results) => done({ results }))
- .catch((error) => done({ error: error.toString() }))
+ .then(function (results) {
+ done({ results: results })
+ })
+ .catch(function (error) {
+ done({ error: error.toString() })
+ })
}
module.exports.assertion = function (context, options, callback) { | fix(IE<I>): use old-school anonymous functions for ie<I> compatibility
* use old-school anonymous functions for ie<I> compatibility
* oops, fixing linting issues | ahmadnassri_nightwatch-accessibility | train | js |
defd8551420baef25e9d49bac5f1eda6625410ea | diff --git a/App/Bootstrap.php b/App/Bootstrap.php
index <HASH>..<HASH> 100644
--- a/App/Bootstrap.php
+++ b/App/Bootstrap.php
@@ -90,9 +90,6 @@ class Bootstrap
$this->app->url = 'https://' . $this->_server->needs('HTTP_HOST');
} else {
$this->app->url = 'http://' . $this->_server->needs('HTTP_HOST');
- if ($this->_server->get('SERVER_PORT') != 80){
- $this->app->url .= ':' . $this->_server->get('SERVER_PORT');
- }
}
if ($this->usesModRewrite) { | ! Bootstrap: App url has been constructed incorrect when using a port other than <I> | cyantree_grout | train | php |
c49a540a2484e91fa0459ed047808171f2a44e66 | diff --git a/lib/r6502/instr_table.rb b/lib/r6502/instr_table.rb
index <HASH>..<HASH> 100644
--- a/lib/r6502/instr_table.rb
+++ b/lib/r6502/instr_table.rb
@@ -123,7 +123,7 @@ module R6502
0xac => [:ldy, :abs],
0xbc => [:ldy, :absx],
#lsr,
- 0x4a => [:lsr, :imp],
+ 0x4a => [:lsr, :acc],
0x46 => [:lsr, :zp],
0x56 => [:lsr, :zpx],
0x4e => [:lsr, :abs],
@@ -156,13 +156,13 @@ module R6502
#iny,
0xc8 => [:iny, :imp],
#rol,
- 0x2a => [:rol, :imp],
+ 0x2a => [:rol, :acc],
0x26 => [:rol, :zp],
0x36 => [:rol, :zpx],
0x2e => [:rol, :abs],
0x3e => [:rol, :absx],
#ror,
- 0x6a => [:ror, :imp],
+ 0x6a => [:ror, :acc],
0x66 => [:ror, :zp],
0x76 => [:ror, :zpx],
0x6e => [:ror, :abs], | fix rol/ror/lsr with accumlator handled as immediate. | joelanders_r6502 | train | rb |
322ed65806f203c339e20bca27f07a2d38df3a38 | diff --git a/Services/Libravatar.php b/Services/Libravatar.php
index <HASH>..<HASH> 100644
--- a/Services/Libravatar.php
+++ b/Services/Libravatar.php
@@ -338,7 +338,7 @@ class Services_Libravatar
// order which is greater than or equal to the random number selected"
foreach ($pri as $k => $v) {
if ($k >= $random) {
- return $v;
+ return $v['target'];
}
}
} | Fix return value of srvGet (bug #<I>)
In the case of successful SRV lookups, the srvGet() function was
returning an array instead of a string (the hostname). | pear_Services_Libravatar | train | php |
3d0102a4b33c00bd60f34e44c261cfc1fa493e71 | diff --git a/Plugin/CouponPlugin.php b/Plugin/CouponPlugin.php
index <HASH>..<HASH> 100755
--- a/Plugin/CouponPlugin.php
+++ b/Plugin/CouponPlugin.php
@@ -29,12 +29,14 @@ class CouponPlugin
public function afterUpdateSpecificCoupons(
\Magento\SalesRule\Model\ResourceModel\Coupon $subject,
$result,
- \Magento\SalesRule\Model\Rule $rule
+ \Magento\SalesRule\Model\Rule $rule = null
) {
- //update the generated and the expiration date
- $rule->setData('expiration_date', null);
- $rule->setData('generated_by_dotmailer', '1');
- $subject->save($rule);
+ if ($rule) {
+ //update the generated and the expiration date
+ $rule->setData('expiration_date', null);
+ $rule->setData('generated_by_dotmailer', '1');
+ $subject->save($rule);
+ }
return $rule;
} | assign default value to rule for pre <I> | dotmailer_dotmailer-magento2-extension | train | php |
5577a3731da6f252d6160e940d919f45158d9428 | diff --git a/src/gluonnlp/data/stream.py b/src/gluonnlp/data/stream.py
index <HASH>..<HASH> 100644
--- a/src/gluonnlp/data/stream.py
+++ b/src/gluonnlp/data/stream.py
@@ -202,7 +202,6 @@ class SimpleDatasetStream(DatasetStream):
'a `gluon.data.Sampler`, but got %s'%(sampler))
def __iter__(self):
- file_sampler = self._get_sampler(self._file_sampler)
# generate file samples
for file_idx in iter(self._file_sampler):
filename = self._files[file_idx] | [FIX] Remove unused code (#<I>) | dmlc_gluon-nlp | train | py |
b89527b3d0993c312b276ba0b90ac59f9e8259aa | diff --git a/packages/ast/test/traverse.js b/packages/ast/test/traverse.js
index <HASH>..<HASH> 100644
--- a/packages/ast/test/traverse.js
+++ b/packages/ast/test/traverse.js
@@ -21,6 +21,32 @@ describe("AST traverse", () => {
assert.isTrue(called, "Module visitor has not been called");
});
+ it("should be called once per node", () => {
+ const node = t.module("test", []);
+ let nb = 0;
+
+ traverse(node, {
+ Module() {
+ nb++;
+ }
+ });
+
+ assert.equal(nb, 1);
+ });
+
+ it("should call the special Node visitor", () => {
+ const node = t.module("test", []);
+ let called = false;
+
+ traverse(node, {
+ Node() {
+ called = true;
+ }
+ });
+
+ assert.isTrue(called, "Module visitor has not been called");
+ });
+
describe("parent path", () => {
it("should retain the parent path", () => {
const root = t.module("test", [t.func(null, [], [], [])]); | feat(ast): add few traverse tests | xtuc_webassemblyjs | train | js |
6ae18be47bfee07cca9d0275ef264ede447bb687 | diff --git a/3rdparty/python/cpplint/cpplint.py b/3rdparty/python/cpplint/cpplint.py
index <HASH>..<HASH> 100755
--- a/3rdparty/python/cpplint/cpplint.py
+++ b/3rdparty/python/cpplint/cpplint.py
@@ -6207,7 +6207,8 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
Error(filename, linenum, 'whitespace/newline', 1,
'Unexpected \\r (^M) found; better to use only \\n')
- sys.stderr.write('Done processing %s\n' % filename)
+ # The following print out is commented out to reduce the amount of log
+ # sys.stderr.write('Done processing %s\n' % filename)
_RestoreFilters() | reduce cpp checkstyle logging (#<I>) | apache_incubator-heron | train | py |
302405c580603279f907de7e0ea65dced67ef122 | diff --git a/obdalib/obdalib-owlapi/src/main/java/inf/unibz/it/obda/owlapi/OBDAOWLReasonerFactory.java b/obdalib/obdalib-owlapi/src/main/java/inf/unibz/it/obda/owlapi/OBDAOWLReasonerFactory.java
index <HASH>..<HASH> 100644
--- a/obdalib/obdalib-owlapi/src/main/java/inf/unibz/it/obda/owlapi/OBDAOWLReasonerFactory.java
+++ b/obdalib/obdalib-owlapi/src/main/java/inf/unibz/it/obda/owlapi/OBDAOWLReasonerFactory.java
@@ -1,9 +1,9 @@
package inf.unibz.it.obda.owlapi;
-import org.semanticweb.owl.inference.OWLReasonerFactory;
-
import inf.unibz.it.obda.api.controller.APIController;
+import org.semanticweb.owl.inference.OWLReasonerFactory;
+
public interface OBDAOWLReasonerFactory extends OWLReasonerFactory {
public abstract void setOBDAController(APIController controller); | A minor change on the import link. | ontop_ontop | train | java |
a85ad90356ec449d4de8e8a1da03c9fb1c700331 | diff --git a/tests/test_plan_bdi.py b/tests/test_plan_bdi.py
index <HASH>..<HASH> 100644
--- a/tests/test_plan_bdi.py
+++ b/tests/test_plan_bdi.py
@@ -64,13 +64,17 @@ class PlanTest(unittest.TestCase):
thought = Thoughts('bizzare_type')
thought.add('I AM A BUS')
thought.add('No - you are a test case')
+ thought.list(True)
#print(str(thought))
self.assertEqual(len(str(thought)), 52)
+ def test_21_add_resource(self):
+ self.myplan.add_resource
+
def test_99(self):
""" prints the test to screen to make sure all is ok """
- #print(str(self.myplan))
- pass
+ import cls_plan_BDI
+ cls_plan_BDI.TEST()
if __name__ == '__main__':
unittest.main()
\ No newline at end of file | test for Plan BDI calls self TEST and other missed coverage tests | acutesoftware_AIKIF | train | py |
36141311df9e81012adf9d19c8118af5bd9aec06 | diff --git a/pi_results/class.tx_solr_pi_results_formcommand.php b/pi_results/class.tx_solr_pi_results_formcommand.php
index <HASH>..<HASH> 100644
--- a/pi_results/class.tx_solr_pi_results_formcommand.php
+++ b/pi_results/class.tx_solr_pi_results_formcommand.php
@@ -115,11 +115,6 @@ class tx_solr_pi_results_FormCommand implements tx_solr_Command {
$suggestUrl .= '&L=' . $GLOBALS['TSFE']->sys_language_uid;
}
- // adds the language parameter to the suggest URL
- if ($GLOBALS['TSFE']->sys_language_uid > 0) {
- $suggestUrl .= '&L=' . $GLOBALS['TSFE']->sys_language_uid;
- }
-
return $suggestUrl;
} | removed duplicate code, resolves issue #<I>
git-svn-id: <URL> | TYPO3-Solr_ext-solr | train | php |
ced2139645b0b10cb68e442d1af65eb71133eff2 | diff --git a/test/test-forked-actor.js b/test/test-forked-actor.js
index <HASH>..<HASH> 100644
--- a/test/test-forked-actor.js
+++ b/test/test-forked-actor.js
@@ -550,6 +550,35 @@ describe('ForkedActor', function() {
expect(response).to.be.equal('Hi there!');
}));
+
+ it('should be able to pass http.Server object as custom parameter to child actor', P.coroutine(function*() {
+ var server = http.createServer();
+
+ server.listen(8888);
+
+ yield rootActor.createChild({
+ initialize: function(selfActor) {
+ this.server = selfActor.getCustomParameters().server;
+
+ // Handle HTTP requests.
+ this.server.on('request', (req, res) => {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end('Hello!');
+ });
+ },
+
+ destroy: function() {
+ this.server && this.server.close();
+ }
+ }, { mode: 'forked', customParameters: { server: server } });
+
+ yield request('http://127.0.0.1:8888')
+ .get('/')
+ .expect(200)
+ .then(res => {
+ expect(res.text).to.be.equal('Hello!');
+ });
+ }));
});
describe('createChildren()', function() { | (saymon) comet-server-clustering: Added test for passing http.Server in custom parameters. | untu_comedy | train | js |
fa07a1cfacad74f19309ce44c5646b43c08e1369 | diff --git a/lib/clenver/project.rb b/lib/clenver/project.rb
index <HASH>..<HASH> 100644
--- a/lib/clenver/project.rb
+++ b/lib/clenver/project.rb
@@ -66,7 +66,7 @@ class Project
end
when String
begin
- unless @respo.nil?
+ unless @repos.nil?
@repos['links'].each do |s,d|
Link.new(s,d).create
end | fix typo in Project class (respo -> repos) | pietrushnic_clenver | train | rb |
4c95151cc8f14d627c70501f71c5bd0cdcd89e72 | diff --git a/angr/analyses/decompiler/structurer.py b/angr/analyses/decompiler/structurer.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/decompiler/structurer.py
+++ b/angr/analyses/decompiler/structurer.py
@@ -309,7 +309,7 @@ class Structurer(Analysis):
def _make_endless_loop(self, loop_head, loop_subgraph, loop_successors):
- # TODO: As this point, the loop body should be a SequenceNode
+ # TODO: At this point, the loop body should be a SequenceNode
loop_body = self._to_loop_body_sequence(loop_head, loop_subgraph, loop_successors)
# create a while(true) loop with sequence node being the loop body | Structurer: Typo fix in a comment. | angr_angr | train | py |
b16bfdeaa901a40a00aa17816482f17e265dbbca | diff --git a/staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go b/staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go
+++ b/staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go
@@ -214,6 +214,7 @@ func v1FuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{} {
if len(j.Finalizers) == 0 {
j.Finalizers = nil
}
+ j.Initializers = nil
},
func(j *metav1.Initializers, c fuzz.Continue) {
j = nil | Don't fuzz deprecated initializers field | kubernetes_kubernetes | train | go |
e54e9dd34f39c59dc50d338fdfc71c8714ce4757 | diff --git a/src/Laravel/Cashier/WebhookController.php b/src/Laravel/Cashier/WebhookController.php
index <HASH>..<HASH> 100644
--- a/src/Laravel/Cashier/WebhookController.php
+++ b/src/Laravel/Cashier/WebhookController.php
@@ -91,7 +91,7 @@ class WebhookController extends Controller
*/
protected function userIsSubscribedWithoutACard($billable)
{
- return ($billable & $billable->subscribed() &&
+ return ($billable && $billable->subscribed() &&
! $billable->onTrial() && is_null($billable->getLastFourCardDigits()));
} | Typo in userIsSubscribedWithoutACard()
Condition operator "And" should be : && instead of & | laravel_cashier | train | php |
dad0665d937ce100c32568102eb7844dc3d8aea6 | diff --git a/lib/Controller/MVCGrid.php b/lib/Controller/MVCGrid.php
index <HASH>..<HASH> 100644
--- a/lib/Controller/MVCGrid.php
+++ b/lib/Controller/MVCGrid.php
@@ -91,7 +91,9 @@ class Controller_MVCGrid extends AbstractController {
$column = $this->owner->addColumn($field_type,$field_name,$field_caption);
- if($field->sortable())$column->makeSortable();
+ if ($field->sortable() && $column->hasMethod('makeSortable')) {
+ $column->makeSortable();
+ }
return $column;
} | Controller_MVCGrid: make sure we have makeSortable method at all
Grid_Basic, for example, don't have one, but still use MVCGrid controller. | atk4_atk4 | train | php |
5ba32553b98b42d57583633a5edee25d031ef7d4 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -163,7 +163,7 @@ prot._write = function(chunk, encoding, callback) {
var length = chunk.length || chunk.byteLength || chunk.size;
var numChunks = Math.ceil(length / MAX_CHUNK_SIZE);
var _returned = false;
- debug('_write ' + length + ' in ' + numChunks + ' chunks');
+ // debug('_write ' + length + ' in ' + numChunks + ' chunks');
function progressiveCallback(e) {
if (_returned || !e) return; | Remove write debugging - far too verbose | rtc-io_rtc-dcstream | train | js |
0473b0dd9b46610c9e521bd852a93e3e091d7f37 | diff --git a/wallet/txdatabase.go b/wallet/txdatabase.go
index <HASH>..<HASH> 100644
--- a/wallet/txdatabase.go
+++ b/wallet/txdatabase.go
@@ -293,8 +293,7 @@ func (db *TXDatabaseOverlay) update() (string, error) {
// If the newest block in the tx cashe has a greater height than the newest
// fblock then clear the cashe and start from 0.
if start >= newestHeight {
- // TODO: we should clear all of the cashed fblocks at this time
- start = 0
+ return newestFBlock.GetKeyMR().String(), nil
}
db.DBO.StartMultiBatch() | revert change to wallet caching logic | FactomProject_factom | train | go |
72c56387ca4ab8dc3ca69c641f3ae8cb1054631b | diff --git a/website/config.rb b/website/config.rb
index <HASH>..<HASH> 100644
--- a/website/config.rb
+++ b/website/config.rb
@@ -2,7 +2,7 @@ set :base_url, "https://www.consul.io/"
activate :hashicorp do |h|
h.name = "consul"
- h.version = "1.3.1"
+ h.version = "1.4.0"
h.github_slug = "hashicorp/consul"
end | Bump website download version to <I> | hashicorp_consul | train | rb |
f11a29faa6bb898086bcf7eb02ad93f0a6548b6b | diff --git a/lib/custom/setup/unittest/CustomerAddFosUserTestData.php b/lib/custom/setup/unittest/CustomerAddFosUserTestData.php
index <HASH>..<HASH> 100644
--- a/lib/custom/setup/unittest/CustomerAddFosUserTestData.php
+++ b/lib/custom/setup/unittest/CustomerAddFosUserTestData.php
@@ -33,10 +33,15 @@ class CustomerAddFosUserTestData extends \Aimeos\MW\Setup\Task\CustomerAddTestDa
/**
* Returns the manager for the current setup task
*
+ * @param string $domain Domain name of the manager
* @return \Aimeos\MShop\Common\Manager\Iface Manager object
*/
- protected function getManager()
+ protected function getManager( $domain )
{
- return \Aimeos\MShop\Customer\Manager\Factory::create( $this->additional, 'FosUser' );
+ if( $domain === 'customer' ) {
+ return \Aimeos\MShop\Customer\Manager\Factory::create( $this->additional, 'FosUser' );
+ }
+
+ return parent::getManager( $domain );
}
} | Adapt to getManager() change in core setup | aimeos_ai-fosuser | train | php |
aa7f86c8cf941403484e1282b7185345ee885ea1 | diff --git a/src/components/Pagination/Pagination.js b/src/components/Pagination/Pagination.js
index <HASH>..<HASH> 100644
--- a/src/components/Pagination/Pagination.js
+++ b/src/components/Pagination/Pagination.js
@@ -19,7 +19,7 @@ export default class Pagination extends Component {
/**
* Number of total items that needs to be paginated
*/
- totalItems: PropTypes.number.isRequired,
+ totalItems: PropTypes.number,
/**
* Text shown before the page number (only mobile view) | removing isReuired from paganation on totalItems | tutti-ch_react-styleguide | train | js |
763c0cd84c253c904d59f3740d15754feaca3f30 | diff --git a/bokeh/session.py b/bokeh/session.py
index <HASH>..<HASH> 100644
--- a/bokeh/session.py
+++ b/bokeh/session.py
@@ -860,10 +860,6 @@ class NotebookSession(NotebookSessionMixin, HTMLFileSession):
def notebooksources(self):
import IPython.core.displaypub as displaypub
- # Normally this would call self.js_paths() to build a list of
- # scripts or get a reference to the unified/minified JS file,
- # but our static JS build process produces a single unified
- # bokehJS file for inclusion in the notebook.
js_paths = self.js_paths()
css_paths = self.css_paths()
html = self._load_template(self.html_template).render( | Remove an outdated comment from NotebookSession.notebooksources() | bokeh_bokeh | train | py |
09c90cf2f3c80ec2960fc1e4a4b9776ac0756207 | diff --git a/expect.go b/expect.go
index <HASH>..<HASH> 100644
--- a/expect.go
+++ b/expect.go
@@ -139,7 +139,7 @@ func (e *Expector) ExpectBranchesWithTimeout(timeout time.Duration, branches ...
func (e *Expector) FullOutput() []byte {
for {
- if e.closed {
+ if e.isClosed() {
return e.fullOutput()
}
@@ -165,7 +165,7 @@ func (e *Expector) matchOutput(stop chan bool, pattern *regexp.Regexp) bool {
return true
}
- if e.closed {
+ if e.isClosed() {
return false
}
@@ -200,7 +200,7 @@ func (e *Expector) monitor() {
}
}
- e.closed = true
+ e.setClosed()
}
func (e *Expector) addOutput(out []byte) {
@@ -231,3 +231,17 @@ func (e *Expector) fullOutput() []byte {
return e.fullBuffer.Bytes()
}
+
+func (e *Expector) isClosed() bool {
+ e.RLock()
+ defer e.RUnlock()
+
+ return e.closed
+}
+
+func (e *Expector) setClosed() {
+ e.Lock()
+ defer e.Unlock()
+
+ e.closed = true
+} | fix race on expector tracking closed state | vito_cmdtest | train | go |
cf7098d269102c04da7c349d233a22ea37f26f52 | diff --git a/lib/3scale_toolbox/commands/remote_command.rb b/lib/3scale_toolbox/commands/remote_command.rb
index <HASH>..<HASH> 100644
--- a/lib/3scale_toolbox/commands/remote_command.rb
+++ b/lib/3scale_toolbox/commands/remote_command.rb
@@ -19,9 +19,16 @@ module ThreeScaleToolbox
end
end
+ # list remotes
def run
- # list remotes
- puts "list remotes"
+ if ThreeScaleToolbox.configuration.remotes.empty?
+ puts 'Emtpy remote list.'
+ exit 0
+ end
+
+ ThreeScaleToolbox.configuration.remotes.each do |name, remote|
+ puts "#{name} #{remote}"
+ end
end
add_subcommand(RemoteAddSubcommand) | commands/remote_command: list 3scale remotes | 3scale_3scale_toolbox | train | rb |
c34d58f115b56ce534c6adf9768c6449ca9716d4 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -11,16 +11,20 @@ module.exports = function(grunt) {
},
markdown: {
all: {
- files: ['test/samples/*'],
- dest: 'test/out',
options: {
gfm: true,
highlight: 'manual'
- }
+ },
+ files: [
+ {
+ expand: true,
+ src: 'test/samples/*.md',
+ dest: 'test/out/',
+ ext: '.html'
+ }
+ ]
},
wrap:{
- files: ['test/samples/*'],
- dest: 'test/out',
options: {
gfm: true,
highlight: 'manual',
@@ -28,7 +32,15 @@ module.exports = function(grunt) {
before: '<span>',
after: '</span>'
}
- }
+ },
+ files: [
+ {
+ expand: true,
+ src: 'test/samples/*.md',
+ dest: 'test/out/',
+ ext: '.html'
+ }
+ ]
}
}, | Updated Grunt file so that markdown test works with new files format | treasonx_grunt-markdown | train | js |
b11cbeb6a81dbe17dd1f7bd07683bdc0b4810adf | diff --git a/aws-java-sdk-core/src/main/java/com/amazonaws/util/CollectionUtils.java b/aws-java-sdk-core/src/main/java/com/amazonaws/util/CollectionUtils.java
index <HASH>..<HASH> 100644
--- a/aws-java-sdk-core/src/main/java/com/amazonaws/util/CollectionUtils.java
+++ b/aws-java-sdk-core/src/main/java/com/amazonaws/util/CollectionUtils.java
@@ -46,7 +46,7 @@ public class CollectionUtils {
* @return Empty string if collection is null or empty. Otherwise joins all strings in the collection with the separator.
*/
public static String join(Collection<String> toJoin, String separator) {
- if (toJoin == null || toJoin.isEmpty()) {
+ if (isNullOrEmpty(toJoin)) {
return "";
} | Using isNullOrEmpty method
The method "isNullOrEmpty" is already there so why not to use it instead of writing the same code again ? | aws_aws-sdk-java | train | java |
058fc283bf9e9257acbff26c167548b0069f2335 | diff --git a/commonjs/view-ajax/view.js b/commonjs/view-ajax/view.js
index <HASH>..<HASH> 100644
--- a/commonjs/view-ajax/view.js
+++ b/commonjs/view-ajax/view.js
@@ -293,6 +293,7 @@ ViewAjax.prototype = {
for (var i=0; i<data.rows.length; i++) {
this.$el.append("<div class=\"kwfUp-kwfViewAjaxItem\">"+data.rows[i].content+"</div>");
}
+ this.$el.trigger('loadMore', data);
onReady.callOnContentReady(this.$el, { action: 'render' });
}).bind(this));
}, | Trigger "loadMore" event
This can be helpful for example when you want to manipulate only newly loaded items
or when you want to do something without reinitializing everything | koala-framework_koala-framework | train | js |
25ab2a39b03673827fb8f0e64bae33fcc8deb4fa | diff --git a/src/body/Composite.js b/src/body/Composite.js
index <HASH>..<HASH> 100644
--- a/src/body/Composite.js
+++ b/src/body/Composite.js
@@ -302,7 +302,7 @@ var Composite = {};
* Removes all bodies, constraints and composites from the given composite
* Optionally clearing its children recursively
* @method clear
- * @param {world} world
+ * @param {composite} composite
* @param {boolean} keepStatic
* @param {boolean} [deep=false]
*/
@@ -643,4 +643,4 @@ var Composite = {};
* @default []
*/
-})();
\ No newline at end of file
+})(); | Update JSDoc
This might need fixing later, I don't know if I did it right. | liabru_matter-js | train | js |
686958b30c598a09eb870cc51c297b8db9414665 | diff --git a/cmd/veneur/main.go b/cmd/veneur/main.go
index <HASH>..<HASH> 100644
--- a/cmd/veneur/main.go
+++ b/cmd/veneur/main.go
@@ -17,7 +17,7 @@ var (
type packet struct {
buf []byte
- ip string
+ ip net.IP
}
func main() {
@@ -95,7 +95,7 @@ func main() {
New: func() interface{} {
return packet{
buf: make([]byte, veneur.Config.MetricMaxLength),
- ip: "",
+ ip: nil,
}
},
}
@@ -126,7 +126,7 @@ func main() {
workers[uniqueSenderIPDigest%uint32(veneur.Config.NumWorkers)].WorkChan <- veneur.Metric{
Name: "veneur.unique_sender_ips",
Digest: uniqueSenderIPDigest,
- Value: packetbuf.ip,
+ Value: packetbuf.ip.String(),
SampleRate: 1.0,
Type: "set",
}
@@ -149,7 +149,7 @@ func main() {
continue
}
packetbuf.buf = packetbuf.buf[:n]
- packetbuf.ip = addr.IP.String()
+ packetbuf.ip = addr.IP
parserChan <- packetbuf
}
} | Stringify IP in parser loop
Turns out we're spending a significant amount of time doing this. Let's
do it in a parallel part of veneur rather than the synchronous one. | stripe_veneur | train | go |
cb5a116057cec8c6b164e1c410bd6df8e7a135d5 | diff --git a/web/concrete/single_pages/dashboard/users/groups.php b/web/concrete/single_pages/dashboard/users/groups.php
index <HASH>..<HASH> 100644
--- a/web/concrete/single_pages/dashboard/users/groups.php
+++ b/web/concrete/single_pages/dashboard/users/groups.php
@@ -59,6 +59,7 @@ $tp = new TaskPermission();
if ($tp->canAccessGroupSearch()) { ?>
<div class="ccm-pane-options">
+<a href="<?php echo View::url('/dashboard/users/add_group')?>" style="float: right" class="btn primary"><?php echo t("Add Group")?></a>
<div class="ccm-pane-options-permanent-search">
<form method="get" action="<?=$this->url('/dashboard/users/groups')?>">
<div class="span7"> | Added an "Add Group" button to Groups dashboard page
I think this should be consistent with the analogous "Add User" button on the Search Users dashboard page.
Former-commit-id: <I>b<I>c4d2fdf8fb<I>ec7df<I>a<I>dc<I> | concrete5_concrete5 | train | php |
cc2dcdfd580467bdc1c02932e5bbf9d2e008d54b | diff --git a/lib/govspeak.rb b/lib/govspeak.rb
index <HASH>..<HASH> 100644
--- a/lib/govspeak.rb
+++ b/lib/govspeak.rb
@@ -62,8 +62,8 @@ module Govspeak
def preprocess(source)
@@extensions.each do |title,regexp,block|
- source.gsub!(regexp) {|match|
- instance_exec($1, &block)
+ source.gsub!(regexp) {
+ instance_exec(*Regexp.last_match.captures, &block)
}
end
source | Allow extensions to use multiple capture groups. | alphagov_govspeak | train | rb |
9bb502a4675151e7b042ea2d099f14f924e73424 | diff --git a/app/helpers/carnival/base_admin_helper.rb b/app/helpers/carnival/base_admin_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/carnival/base_admin_helper.rb
+++ b/app/helpers/carnival/base_admin_helper.rb
@@ -106,10 +106,7 @@ module Carnival
end
def field_value_and_type(presenter, field_name, record)
- renderer = FieldRenderers::RendererCreator
- .create_field_renderer(presenter, field_name)
-
- renderer.render_field(record)
+ presenter.render_field(field_name, record)
end
def is_image?(field_type, value)
diff --git a/app/presenters/carnival/base_admin_presenter.rb b/app/presenters/carnival/base_admin_presenter.rb
index <HASH>..<HASH> 100644
--- a/app/presenters/carnival/base_admin_presenter.rb
+++ b/app/presenters/carnival/base_admin_presenter.rb
@@ -344,6 +344,14 @@ module Carnival
end
end
+ def render_field(field_name, record)
+ renderer_for(field_name).render_field(record)
+ end
+
+ def renderer_for(field_name)
+ FieldRenderers::RendererCreator.create_field_renderer(self, field_name)
+ end
+
protected
def make_relation_advanced_query_url_options(field, record) | Move render_field from helper to presenter
* This way presenter subtypes will have a chance to override this
behavior without monkey patching Carnival | Vizir_carnival | train | rb,rb |
c955799baf29f59b01a85af0ea47980ead3fa522 | diff --git a/consul/state/prepared_query.go b/consul/state/prepared_query.go
index <HASH>..<HASH> 100644
--- a/consul/state/prepared_query.go
+++ b/consul/state/prepared_query.go
@@ -243,7 +243,7 @@ func (s *StateStore) PreparedQueryList() (uint64, structs.PreparedQueries, error
}
// Go over all of the queries and build the response.
- var result structs.PreparedQueries
+ result := make(structs.PreparedQueries, 0)
for query := queries.Next(); query != nil; query = queries.Next() {
result = append(result, query.(*structs.PreparedQuery))
} | Makes an empty prepared query list an empty slice, not a nil one. | hashicorp_consul | train | go |
0adf90e5ef30d4918d1c3cf6000adb9bc32503cd | diff --git a/src/components/speed-dial/speed-dial.styles.js b/src/components/speed-dial/speed-dial.styles.js
index <HASH>..<HASH> 100644
--- a/src/components/speed-dial/speed-dial.styles.js
+++ b/src/components/speed-dial/speed-dial.styles.js
@@ -8,6 +8,7 @@ export default ({ baseTheme }) => {
position: 'fixed',
width: '100%',
left: 0,
+ zIndex: 9999,
},
inline: {
position: 'relative', | [bugfix] fix speedDial is above a list | smollweide_react-speed-dial | train | js |
Subsets and Splits