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 |
|---|---|---|---|---|---|
0050448e9f18d2d344e440cb71c03daae6b42c9e | diff --git a/gspread/worksheet.py b/gspread/worksheet.py
index <HASH>..<HASH> 100644
--- a/gspread/worksheet.py
+++ b/gspread/worksheet.py
@@ -1414,6 +1414,26 @@ class Worksheet:
return self.spreadsheet.batch_update(body)
+ def delete_protected_range(self, id):
+ """Delete protected range identified by the ID ``id``.
+
+ To retrieve the ID of a protected range use the following method
+ to list them all:
+ :func:`~gspread.Spreadsheet.list_protected_ranges`
+ """
+
+ body = {
+ "requests": [
+ {
+ "deleteProtectedRange": {
+ "protectedRangeId": id,
+ }
+ }
+ ]
+ }
+
+ return self.spreadsheet.batch_update(body)
+
def delete_dimension(self, dimension, start_index, end_index=None):
"""Deletes multi rows from the worksheet at the specified index. | Add method to delete a protected range
Add a new method to delete a protected range.
In order to retrieve the `ID` of a protected range, use the method
`gspread.Spreadsheet.list_protected_ranges`.
closes #<I> | burnash_gspread | train | py |
80f6b84204dfd3cd3b6ac80a2c817ab3fdc46e63 | diff --git a/lib/pragmater/formatter.rb b/lib/pragmater/formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/pragmater/formatter.rb
+++ b/lib/pragmater/formatter.rb
@@ -27,6 +27,10 @@ module Pragmater
/x
end
+ def self.valid_formats
+ Regexp.union shebang_format, pragma_format
+ end
+
def initialize comment
@comment = comment
end
diff --git a/spec/lib/pragmater/formatter_spec.rb b/spec/lib/pragmater/formatter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/pragmater/formatter_spec.rb
+++ b/spec/lib/pragmater/formatter_spec.rb
@@ -55,6 +55,20 @@ RSpec.describe Pragmater::Formatter do
end
end
+ describe ".valid_formats" do
+ it "match shebang format" do
+ expect(described_class.valid_formats).to match("#! /usr/bin/ruby")
+ end
+
+ it "match frozen string literal format" do
+ expect(described_class.valid_formats).to match("# frozen_string_literal: true")
+ end
+
+ it "does not match general comments" do
+ expect(described_class.valid_formats).to_not match("# A example comment.")
+ end
+ end
+
describe "#format_shebang" do
subject { described_class.new comment } | Added valid formats to Formatter.
- Provides a convenience method for answering all
possible valid comment formats. | bkuhlmann_pragmater | train | rb,rb |
5ff754756f48bde24e8a8a727a0f4aa21d562386 | diff --git a/src/Models/Corporation/CorporationMemberTracking.php b/src/Models/Corporation/CorporationMemberTracking.php
index <HASH>..<HASH> 100644
--- a/src/Models/Corporation/CorporationMemberTracking.php
+++ b/src/Models/Corporation/CorporationMemberTracking.php
@@ -23,12 +23,12 @@
namespace Seat\Eveapi\Models\Corporation;
use Illuminate\Database\Eloquent\Model;
+use Seat\Eveapi\Models\RefreshToken;
use Seat\Eveapi\Models\Sde\InvType;
use Seat\Eveapi\Models\Sde\MapDenormalize;
use Seat\Eveapi\Models\Sde\StaStation;
use Seat\Eveapi\Models\Universe\UniverseName;
use Seat\Eveapi\Models\Universe\UniverseStructure;
-use Seat\Web\Models\User;
/**
* Class CorporationMemberTracking.
@@ -196,10 +196,10 @@ class CorporationMemberTracking extends Model
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
* @deprecated
*/
- public function user()
+ public function refresh_token()
{
- return $this->belongsTo(User::class, 'character_id', 'id');
+ return $this->belongsTo(RefreshToken::class, 'character_id', 'character_id');
}
/** | fix(relations): Update relation for CorporationMemberTracking model from User to RefreshToken | eveseat_eveapi | train | php |
b4926b532c87a23c264545b7bf756952b7dfce35 | diff --git a/framework/core/js/lib/helpers/username.js b/framework/core/js/lib/helpers/username.js
index <HASH>..<HASH> 100644
--- a/framework/core/js/lib/helpers/username.js
+++ b/framework/core/js/lib/helpers/username.js
@@ -6,7 +6,7 @@
* @return {Object}
*/
export default function username(user) {
- const name = (user && user.username()) || app.translator.trans('core.lib.deleted_user_text');
+ const name = (user && user.username()) || app.translator.trans('core.lib.username.deleted_text');
return <span className="username">{name}</span>;
} | Add third-level namespacing to deleted_user_text | flarum_core | train | js |
2e10e354d64b26b54732ce86fdcf0a6cd8f8dc92 | diff --git a/lib/write_xlsx/workbook.rb b/lib/write_xlsx/workbook.rb
index <HASH>..<HASH> 100644
--- a/lib/write_xlsx/workbook.rb
+++ b/lib/write_xlsx/workbook.rb
@@ -164,6 +164,30 @@ module Writexlsx
end
#
+ # Set the date system: false = 1900 (the default), true = 1904
+ #
+ # Excel stores dates as real numbers where the integer part stores
+ # the number of days since the epoch and the fractional part stores
+ # the percentage of the day. The epoch can be either 1900 or 1904.
+ # Excel for Windows uses 1900 and Excel for Macintosh uses 1904.
+ # However, Excel on either platform will convert automatically between
+ # one system and the other.
+ #
+ # WriteXLSX stores dates in the 1900 format by default. If you wish to
+ # change this you can call the set_1904() workbook method.
+ # You can query the current value by calling the get_1904() workbook method.
+ # This returns 0 for 1900 and 1 for 1904.
+ #
+ # In general you probably won't need to use set_1904().
+ #
+ def set_1904(mode = true)
+ unless sheets.empty?
+ raise "set_1904() must be called before add_worksheet()"
+ end
+ @date_1904 = (!mode || mode == 0) ? false : true
+ end
+
+ #
# user must not use. it is internal method.
#
def set_xml_writer(filename) #:nodoc: | * Workbook#set_<I> added. | cxn03651_write_xlsx | train | rb |
70859e99e3abff5e479ce6030449ee7051418fbb | diff --git a/lib/ruote/exp/fe_participant.rb b/lib/ruote/exp/fe_participant.rb
index <HASH>..<HASH> 100644
--- a/lib/ruote/exp/fe_participant.rb
+++ b/lib/ruote/exp/fe_participant.rb
@@ -103,11 +103,12 @@ module Ruote
def do_dispatch (participant)
- participant.consume(@applied_workitem)
+ wi = @applied_workitem.dup
+
+ participant.consume(wi)
wqueue.emit(
- :workitems, :dispatched,
- :workitem => @applied_workitem, :pname => @participant_name)
+ :workitems, :dispatched, :workitem => wi, :pname => @participant_name)
end
end
end | handing a copy of the workitem to participant | jmettraux_ruote | train | rb |
3e26d1a503b4421ca79250b92b1f8484ddd563ce | diff --git a/examples/sampleserver.py b/examples/sampleserver.py
index <HASH>..<HASH> 100644
--- a/examples/sampleserver.py
+++ b/examples/sampleserver.py
@@ -47,6 +47,7 @@ class ConcreteServer(OpenIDServer):
raise ProtocolError('Unknown assoc_type: %r' % assoc_type)
def lookup_secret(self, assoc_handle):
+ print (assoc_handle, self.assoc_store)
return self.assoc_store.get(assoc_handle)
def get_server_secret(self): | [project @ Added debugging] | openid_python-openid | train | py |
d2a799e833de941b3e82385765f16987fb75a2fb | diff --git a/plugins/Eav/src/Model/Behavior/EavBehavior.php b/plugins/Eav/src/Model/Behavior/EavBehavior.php
index <HASH>..<HASH> 100644
--- a/plugins/Eav/src/Model/Behavior/EavBehavior.php
+++ b/plugins/Eav/src/Model/Behavior/EavBehavior.php
@@ -490,13 +490,21 @@ class EavBehavior extends Behavior
*/
public function hydrateEntity(EntityInterface $entity, array $values)
{
+ $virtualProperties = (array)$entity->virtualProperties();
+
foreach ($values as $value) {
if (!$this->_toolbox->propertyExists($entity, $value['property_name'])) {
+ if (!in_array($value['property_name'], $virtualProperties)) {
+ $virtualProperties[] = $value['property_name'];
+ }
+
$entity->set($value['property_name'], $value['value']);
$entity->dirty($value['property_name'], false);
}
}
+ $entity->virtualProperties($virtualProperties);
+
// force cache-columns to be of the proper type as they might be NULL if
// entity has not been updated yet.
if ($this->config('cacheMap')) { | Expose eav columns as virtual properties | quickapps_cms | train | php |
42fad81e0b107d3ba386b0bfe09f84a8e51e562a | diff --git a/concrete/elements/page_types/composer/controls/core_page_property/url_slug.php b/concrete/elements/page_types/composer/controls/core_page_property/url_slug.php
index <HASH>..<HASH> 100644
--- a/concrete/elements/page_types/composer/controls/core_page_property/url_slug.php
+++ b/concrete/elements/page_types/composer/controls/core_page_property/url_slug.php
@@ -73,7 +73,6 @@ $resolverManager = app(ResolverManagerInterface::class);
$('.ccm-composer-url-slug-loading').show();
$.post(
<?= json_encode((string) $resolverManager->resolve(['/ccm/system/page/url_slug'])) ?>,
- '<?=REL_DIR_FILES_TOOLS_REQUIRED?>/pages/url_slug',
send,
function(r) {
$('.ccm-composer-url-slug-loading').hide(); | Fix bug introduced in <I>e7b<I>ffb<I>edbda0a8b<I>e<I> | concrete5_concrete5 | train | php |
08fde574df8e736ed52f000e11e02b506b49b666 | diff --git a/upload/catalog/model/account/reward.php b/upload/catalog/model/account/reward.php
index <HASH>..<HASH> 100644
--- a/upload/catalog/model/account/reward.php
+++ b/upload/catalog/model/account/reward.php
@@ -42,14 +42,14 @@ class Reward extends \Opencart\System\Engine\Model {
public function getTotalRewards(): int {
$query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "customer_reward` WHERE `customer_id` = '" . (int)$this->customer->getId() . "'");
- return $query->row['total'];
+ return (int)$query->row['total'];
}
public function getTotalPoints(): int {
$query = $this->db->query("SELECT SUM(`points`) AS `total` FROM `" . DB_PREFIX . "customer_reward` WHERE `customer_id` = '" . (int)$this->customer->getId() . "' GROUP BY `customer_id`");
if ($query->num_rows) {
- return $query->row['total'];
+ return (int)$query->row['total'];
} else {
return 0;
} | Added sanitized int on total | opencart_opencart | train | php |
9c43d7416260d05d1a5f8039dc2c87c57d68cb94 | diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js
index <HASH>..<HASH> 100644
--- a/lib/workers/pr/index.js
+++ b/lib/workers/pr/index.js
@@ -129,8 +129,7 @@ async function ensurePr(prConfig) {
let prBody;
async function trimPrBody() {
let prBodyMarkdown = handlebars.compile(config.prBody)(config);
- const atUserRe = /[^`]@([a-z]+\/[a-z]+)/g;
- prBodyMarkdown = prBodyMarkdown.replace(atUserRe, '@​$1');
+ prBodyMarkdown = prBodyMarkdown.replace('@', '@​');
prBody = converter.makeHtml(prBodyMarkdown);
// Public GitHub repos need links prevented - see #489
prBody = prBody.replace(issueRe, '$1#​$2$3'); | fix: escape every @ in pr body with zero width space (#<I>) | renovatebot_renovate | train | js |
8c617c761d4976bb717384df0de40a9505fa43de | diff --git a/mockServerClient.js b/mockServerClient.js
index <HASH>..<HASH> 100644
--- a/mockServerClient.js
+++ b/mockServerClient.js
@@ -384,11 +384,17 @@ var mockServerClient;
if (Array.isArray(expectation)) {
for (var i = 0; i < expectation.length; i++) {
expectation[i].httpRequest = addDefaultRequestMatcherHeaders(expectation[i].httpRequest);
- expectation[i].httpResponse = addDefaultResponseMatcherHeaders(expectation[i].httpResponse);
+ if(!expectation[i].httpForward) {
+ expectation[i].httpResponse = addDefaultResponseMatcherHeaders(
+ expectation[i].httpResponse);
+ }
}
} else {
expectation.httpRequest = addDefaultRequestMatcherHeaders(expectation.httpRequest);
- expectation.httpResponse = addDefaultResponseMatcherHeaders(expectation.httpResponse);
+ if(!expectation.httpForward) {
+ expectation.httpResponse = addDefaultResponseMatcherHeaders(
+ expectation.httpResponse);
+ }
}
return expectation;
}; | Fix header for httpForward
Issue related: <URL> | jamesdbloom_mockserver-client-node | train | js |
30c859499e24ba6255508cd664c09cf4c1731bbe | diff --git a/shared/logging/log_posix.go b/shared/logging/log_posix.go
index <HASH>..<HASH> 100644
--- a/shared/logging/log_posix.go
+++ b/shared/logging/log_posix.go
@@ -3,6 +3,8 @@
package logging
import (
+ slog "log/syslog"
+
log "gopkg.in/inconshreveable/log15.v2"
)
@@ -13,11 +15,11 @@ func getSystemHandler(syslog string, debug bool, format log.Format) log.Handler
if !debug {
return log.LvlFilterHandler(
log.LvlInfo,
- log.Must.SyslogHandler(syslog, format),
+ log.Must.SyslogHandler(slog.LOG_INFO, syslog, format),
)
}
- return log.Must.SyslogHandler(syslog, format)
+ return log.Must.SyslogHandler(slog.LOG_INFO, syslog, format)
}
return nil | Temporary workaround for log<I> API breakage
log<I> broke their v2 API earlier today, this change should get things
building again until upstream log<I> fixes the API breakage.
Related: <URL> | lxc_lxd | train | go |
018797557cf448efcc637d5fbc8e82244ec359d7 | diff --git a/test/adapter.spec.js b/test/adapter.spec.js
index <HASH>..<HASH> 100644
--- a/test/adapter.spec.js
+++ b/test/adapter.spec.js
@@ -59,7 +59,8 @@ describe('mocha adapter', () => {
let adapter, load, send, sendInternal, originalCWD
let cid = 1
- let config = { framework: 'mocha' }
+ const title = 'mocha-tests'
+ let config = { framework: 'mocha', title: title }
let specs = ['fileA.js', 'fileB.js']
let caps = { browserName: 'chrome' }
@@ -117,6 +118,7 @@ describe('mocha adapter', () => {
let msg = send.firstCall.args[0]
msg.type.should.be.exactly('suite:start')
msg.cid.should.be.exactly(cid)
+ msg.uid.should.be.equal(title)
msg.specs.should.be.exactly(specs)
msg.runner[cid].should.be.exactly(caps)
msg.err.should.not.have.property('unAllowedProp')
@@ -135,6 +137,7 @@ describe('mocha adapter', () => {
let msg = sendInternal.firstCall.args[1]
msg.cid.should.be.exactly(cid)
+ msg.uid.should.be.equal(title)
msg.specs.should.be.exactly(specs)
msg.runner[cid].should.be.exactly(caps)
}) | Added check for uid to the test scenario’s | webdriverio-boneyard_wdio-mocha-framework | train | js |
2b0851081486255215a5c1c52160bf1283738dbf | diff --git a/compliance_checker/cf/cf.py b/compliance_checker/cf/cf.py
index <HASH>..<HASH> 100644
--- a/compliance_checker/cf/cf.py
+++ b/compliance_checker/cf/cf.py
@@ -2462,8 +2462,8 @@ class CFBaseCheck(BaseCheck):
expected_std_names = grid_mapping[2]
for expected_std_name in expected_std_names:
found_vars = ds.get_variables_by_attributes(standard_name=expected_std_name)
- valid_grid_mapping.assert_true(len(found_vars) == 1,
- "grid mapping {} requires exactly ".format(grid_mapping_name)+\
+ valid_grid_mapping.assert_true(len(found_vars) >= 1,
+ "grid mapping {} requires at least ".format(grid_mapping_name)+\
"one variable with standard_name "+\
"{} to be defined".format(expected_std_name)) | mod. check of req. vars with std.name for grid map; fixed #<I>
Modified the checking of the number of variables with spezific
attributes required by a grid mapping. Previously `==1` was checked (are
variable with a specific required standard name was allowed to exist
only once). Now, `>=1` is checked (the variable has to exist at least
once). The user output was updated accordingly. | ioos_compliance-checker | train | py |
e7bc64ac2b91df758f2e702415fd1bdeee40a168 | diff --git a/src/utils/services/call.js b/src/utils/services/call.js
index <HASH>..<HASH> 100644
--- a/src/utils/services/call.js
+++ b/src/utils/services/call.js
@@ -12,10 +12,12 @@ var rpcClient = new JsonRpc2Client()
// TODO: add api.onMethod('methodName')
// TODO: add api.onNotification('methodName')
-export default function callService (methodName, params, secretKey) {
+export default function callService (methodName, params, options) {
// API
params = params || {}
+ options = options || {}
+ var secretKey = options.secretKey
// try cache
// var cacheKey | Updated services API to be more specific and extendable | archilogic-com_3dio-js | train | js |
800598900ab46d8a771dc123a4c1dd14d1ca4cd4 | diff --git a/sorl/thumbnail/admin/compat.py b/sorl/thumbnail/admin/compat.py
index <HASH>..<HASH> 100644
--- a/sorl/thumbnail/admin/compat.py
+++ b/sorl/thumbnail/admin/compat.py
@@ -75,6 +75,8 @@ class AdminImageMixin(object):
"""
def formfield_for_dbfield(self, db_field, **kwargs):
if isinstance(db_field, ImageField):
+ if not db_field.blank:
+ return db_field.formfield(widget=AdminImageWidget)
return db_field.formfield(
form_class=ClearableImageFormField,
widget=AdminClearableImageWidget, | fixed bug for reuired images in admin < <I> | jazzband_sorl-thumbnail | train | py |
69a86dc5b6f8984fbd1b0ec8ed7b445a40134b5d | diff --git a/src/PlaceService.php b/src/PlaceService.php
index <HASH>..<HASH> 100644
--- a/src/PlaceService.php
+++ b/src/PlaceService.php
@@ -4,6 +4,11 @@
*/
namespace CultuurNet\UDB3;
+/**
+ * Class PlaceService
+ * @package CultuurNet\UDB3
+ * @deprecated use LocalPlaceService instead
+ */
class PlaceService extends LocalEntityService
{
} | III-<I> Marked PlaceService as obsolete and should use LocalPlaceService instead. | cultuurnet_udb3-php | train | php |
9e598dd439b9481cd40549fed86a034a8a440213 | diff --git a/two_factor/management/commands/two_factor_disable.py b/two_factor/management/commands/two_factor_disable.py
index <HASH>..<HASH> 100644
--- a/two_factor/management/commands/two_factor_disable.py
+++ b/two_factor/management/commands/two_factor_disable.py
@@ -12,7 +12,7 @@ class Command(BaseCommand):
Example usage::
- manage.py disable bouke steve
+ manage.py two_factor_disable bouke steve
"""
help = 'Disables two-factor authentication for the given users'
diff --git a/two_factor/management/commands/two_factor_status.py b/two_factor/management/commands/two_factor_status.py
index <HASH>..<HASH> 100644
--- a/two_factor/management/commands/two_factor_status.py
+++ b/two_factor/management/commands/two_factor_status.py
@@ -13,7 +13,7 @@ class Command(BaseCommand):
Example usage::
- manage.py status bouke steve
+ manage.py two_factor_status bouke steve
bouke: enabled
steve: disabled
""" | Update management cmd doc strings to reflect the actual command (#<I>)
* update doc string for two_factor_disable command
* update doc string for two_factor_status command | Bouke_django-two-factor-auth | train | py,py |
6b8ed4916928244f253928fc541fb68bd31eeba3 | diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/widgets/editor.py
+++ b/spyder/plugins/editor/widgets/editor.py
@@ -1344,19 +1344,16 @@ class EditorStack(QWidget):
# Regular actions
actions = [MENU_SEPARATOR, self.versplit_action,
self.horsplit_action, self.close_action]
- if plugin is not None:
- actions += [MENU_SEPARATOR, self.new_window_action,
- plugin.undock_action, plugin.close_plugin_action]
- # Actions when the stack is part of an undocked window
if self.new_window:
- actions = [MENU_SEPARATOR, self.versplit_action,
- self.horsplit_action, self.close_action]
- if plugin is not None:
- if plugin.undocked_window:
- actions += [MENU_SEPARATOR, plugin.dock_action]
- else:
- actions += [MENU_SEPARATOR, self.new_window_action]
+ actions += [MENU_SEPARATOR, self.new_window_action]
+ elif plugin is not None:
+ if plugin.undocked_window is not None:
+ actions += [MENU_SEPARATOR, plugin.dock_action]
+ else:
+ actions += [MENU_SEPARATOR, self.new_window_action,
+ plugin.undock_action, plugin.close_plugin_action]
+
return actions
def reset_orientation(self): | Editor: Fix actions shown in its Options menu for undocked and new windows | spyder-ide_spyder | train | py |
24e0af86da73dc23672bd2e7eb4ff205516e8d0c | diff --git a/openfisca_web_api/controllers/simulate.py b/openfisca_web_api/controllers/simulate.py
index <HASH>..<HASH> 100644
--- a/openfisca_web_api/controllers/simulate.py
+++ b/openfisca_web_api/controllers/simulate.py
@@ -228,6 +228,8 @@ def api1_simulate(req):
).iteritems())),
headers = headers,
)
+ except ValueError as exc:
+ wsgihelpers.handle_error(exc, ctx, headers)
if data['reforms'] is not None:
reform_decomposition_json = model.get_cached_or_new_decomposition_json(reform_tax_benefit_system)
@@ -254,6 +256,8 @@ def api1_simulate(req):
).iteritems())),
headers = headers,
)
+ except ValueError as exc:
+ wsgihelpers.handle_error(exc, ctx, headers)
if data['trace']:
simulations_variables_json = [] | Return nice errors to user during decomposition calculation | openfisca_openfisca-web-api | train | py |
e7dfb91055a758e68aaea8a6da63ba6699e9f08d | diff --git a/datastore.go b/datastore.go
index <HASH>..<HASH> 100644
--- a/datastore.go
+++ b/datastore.go
@@ -73,6 +73,7 @@ func (d *datastore) QueryNew(q dsq.Query) (dsq.Results, error) {
return d.QueryOrig(q)
}
+ prefix := []byte(q.Prefix)
opt := badger.DefaultIteratorOptions
opt.FetchValues = !q.KeysOnly
it := d.DB.NewIterator(opt)
@@ -82,7 +83,7 @@ func (d *datastore) QueryNew(q dsq.Query) (dsq.Results, error) {
return dsq.ResultsFromIterator(q, dsq.Iterator{
Next: func() (dsq.Result, bool) {
- if !it.ValidForPrefix(q.Prefix) {
+ if !it.ValidForPrefix(prefix) {
return dsq.Result{}, false
}
item := it.Item() | fix: cast prefix to bytes | ipfs_go-ds-badger | train | go |
605605b4190b84a24261d36d2c545ed07d8c95f9 | diff --git a/keyring_windows.go b/keyring_windows.go
index <HASH>..<HASH> 100644
--- a/keyring_windows.go
+++ b/keyring_windows.go
@@ -1,8 +1,9 @@
package keyring
-import "github.com/danieljoos/wincred"
-
-const errNotFound = "Element not found."
+import (
+ "github.com/danieljoos/wincred"
+ "syscall"
+)
type windowsKeychain struct{}
@@ -10,7 +11,7 @@ type windowsKeychain struct{}
func (k windowsKeychain) Get(service, username string) (string, error) {
cred, err := wincred.GetGenericCredential(k.credName(service, username))
if err != nil {
- if err.Error() == errNotFound {
+ if err == syscall.ERROR_NOT_FOUND {
return "", ErrNotFound
}
return "", err
@@ -32,7 +33,7 @@ func (k windowsKeychain) Set(service, username, password string) error {
func (k windowsKeychain) Delete(service, username string) error {
cred, err := wincred.GetGenericCredential(k.credName(service, username))
if err != nil {
- if err.Error() == errNotFound {
+ if err == syscall.ERROR_NOT_FOUND {
return ErrNotFound
}
return err | "Element not found." does not work on non-english machines | zalando_go-keyring | train | go |
4319774383cd9284bc7ceee4e026f180293673d0 | diff --git a/src/rasterstats/io.py b/src/rasterstats/io.py
index <HASH>..<HASH> 100644
--- a/src/rasterstats/io.py
+++ b/src/rasterstats/io.py
@@ -154,8 +154,8 @@ def bounds_window(bounds, affine):
def window_bounds(window, affine):
(row_start, row_stop), (col_start, col_stop) = window
- w, s = (col_start, row_stop) * affine
- e, n = (col_stop, row_start) * affine
+ w, s = affine * (col_start, row_stop)
+ e, n = affine * (col_stop, row_start)
return w, s, e, n | chore: left multiplication for rasterio | perrygeo_python-rasterstats | train | py |
cfb8b809c1bdd814ce211d9a5dc409e7b6013960 | diff --git a/tornado/web.py b/tornado/web.py
index <HASH>..<HASH> 100644
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -70,6 +70,7 @@ import stat
import sys
import time
import tornado
+import traceback
import types
import urllib
import urlparse
@@ -663,11 +664,16 @@ class RequestHandler(object):
If this error was caused by an uncaught exception, the
exception object can be found in kwargs e.g. kwargs['exception']
"""
- return "<html><title>%(code)d: %(message)s</title>" \
- "<body>%(code)d: %(message)s</body></html>" % {
- "code": status_code,
- "message": httplib.responses[status_code],
- }
+ if self.settings.get("debug"):
+ # in debug mode, try to send a traceback
+ self.set_header('Content-Type', 'text/plain')
+ return traceback.format_exc()
+ else:
+ return "<html><title>%(code)d: %(message)s</title>" \
+ "<body>%(code)d: %(message)s</body></html>" % {
+ "code": status_code,
+ "message": httplib.responses[status_code],
+ }
@property
def locale(self): | add text tracebacks on <I>s when in debug mode | tornadoweb_tornado | train | py |
04344479d107b3f39dc2855b787462d78a85e7b8 | diff --git a/mongodb/mongodb.js b/mongodb/mongodb.js
index <HASH>..<HASH> 100644
--- a/mongodb/mongodb.js
+++ b/mongodb/mongodb.js
@@ -296,6 +296,13 @@ module.exports = function(RED) {
delete response.result.connection;
}
}
+ // `response` is an instance of CommandResult, and does not seem to have the standard Object methods,
+ // which means that some props are not correctly being forwarded to msg.payload (eg "ops" ouputted from `insertOne`)
+ // cloning the object fixes that.
+ response = Object.assign({}, response);
+ // response.message includes info about the DB op, but is large and never used (like the connection)
+ delete response.message;
+
// send msg (when err == forEachEnd, this is just a forEach completion).
if (forEachIteration == err) {
// Clone, so we can send the same message again with a different payload | preserve all response props in message.payload
`response` is an instance of CommandResult, and does not seem to have the standard Object methods, which means that some props are not correctly being forwarded to msg.payload (eg "ops" outputted from `insertOne`) - only the "result" property is being saved as payload. Cloning the object fixes that.
(<URL>)
fixes <URL> | ozomer_node-red-contrib-mongodb2 | train | js |
9f689684f4bf797a8a0b8631ff41eee7e3795fdb | diff --git a/lib/reel/mixins.rb b/lib/reel/mixins.rb
index <HASH>..<HASH> 100644
--- a/lib/reel/mixins.rb
+++ b/lib/reel/mixins.rb
@@ -66,8 +66,8 @@ module Reel
# optimizations possible, depending on OS:
# TCP_NODELAY: prevent TCP packets from being buffered
- # TCP_CORK: yet to be tersely described
- # SO_REUSEADDR: yet to be tersely described
+ # TCP_CORK: TODO: tersely describe
+ # SO_REUSEADDR: TODO: tersely describe
if RUBY_PLATFORM =~ /linux/
# Only Linux supports the mix of socket behaviors given in these optimizations. | Change to TODO versus implied TODO | celluloid_reel | train | rb |
b74d1c92479bc6df61e7283f7639b02837bfb5f3 | diff --git a/container.go b/container.go
index <HASH>..<HASH> 100644
--- a/container.go
+++ b/container.go
@@ -80,7 +80,7 @@ func ParseRun(args []string, stdout io.Writer) (*Config, error) {
flMemory := cmd.Int64("m", 0, "Memory limit (in bytes)")
var flPorts ports
- cmd.Var(&flPorts, "p", "Map a network port to the container")
+ cmd.Var(&flPorts, "p", "Expose a container's port to the host (use 'docker port' to see the actual mapping)")
var flEnv ListOpts
cmd.Var(&flEnv, "e", "Set environment variables") | change option description to reflect the semantics
At least, for me, 'map' means that there are two values and one is "mapped" to
another.
In this case, just one value is provided (container's port), the other value is
automatically obtained (host's port) and the actual mapping can be seen using
``docker port`` command. | moby_moby | train | go |
6aa6a0c2082bd9a8206b40f0191509f487c3366e | diff --git a/dvc/__init__.py b/dvc/__init__.py
index <HASH>..<HASH> 100644
--- a/dvc/__init__.py
+++ b/dvc/__init__.py
@@ -5,7 +5,7 @@ Make your data science projects reproducible and shareable.
"""
import os
-VERSION_BASE = '0.14.0'
+VERSION_BASE = '0.14.1'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__)) | dvc: bump to <I> | iterative_dvc | train | py |
b242f7465fc446d15af3d9f6fc9c93b085a08f18 | diff --git a/admin/__init__.py b/admin/__init__.py
index <HASH>..<HASH> 100644
--- a/admin/__init__.py
+++ b/admin/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of Invenio.
-# Copyright (C) 2014 CERN.
+# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -18,7 +18,7 @@
"""Administrative views."""
-from __future__ import absolute_import
+from __future__ import absolute_import, unicode_literals
from invenio.ext.admin.views import ModelView
from invenio.ext.sqlalchemy import db | global: unicode literal for admin views
* Forces unicode literals on all admin pages. (addresses #<I>)
* PEP8/<I> code style improvements. | inveniosoftware_invenio-communities | train | py |
40585d7e7d67532bc9480b3588121b57a3769fff | diff --git a/src/Enhavo/Bundle/MediaBundle/Service/FileService.php b/src/Enhavo/Bundle/MediaBundle/Service/FileService.php
index <HASH>..<HASH> 100644
--- a/src/Enhavo/Bundle/MediaBundle/Service/FileService.php
+++ b/src/Enhavo/Bundle/MediaBundle/Service/FileService.php
@@ -196,11 +196,11 @@ class FileService
* unknown type.
* @return EnhavoFile The generated doctrine entity object (already persisted).
*/
- public function addFile($file, $mimeType = null, $fileExtension = null, $title = null, $fileName = null, $order = null, $garbage = false)
+ public function storeFile($file, $mimeType = null, $fileExtension = null, $title = null, $fileName = null, $order = null, $garbage = false)
{
$fileInfo = $this->getFileInformation($file);
if (!$fileInfo) {
- throw new \InvalidArgumentException("Invalid format on file parameter");
+ throw new \InvalidArgumentException("Invalid format on file parameter; possible formats: Symfony\\Component\\HttpFoundation\\File\\UploadedFile, Symfony\\Component\\HttpFoundation\\File\\File, \\SplFileInfo or string (absolute path + filename)");
}
$slugifier = new Slugifier; | Renamed addFile to storeFile, added additional information to Exception thrown on invalid format for file parameter | enhavo_enhavo | train | php |
5116cf7d75967d9fa58a9a52a2724c2a52cab353 | diff --git a/framework/core/src/Api/Serializer/PostSerializer.php b/framework/core/src/Api/Serializer/PostSerializer.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Api/Serializer/PostSerializer.php
+++ b/framework/core/src/Api/Serializer/PostSerializer.php
@@ -85,7 +85,7 @@ class PostSerializer extends PostBasicSerializer
*/
protected function discussion($post)
{
- return $this->hasOne($post, 'Flarum\Api\Serializer\DiscussionSerializer');
+ return $this->hasOne($post, 'Flarum\Api\Serializer\DiscussionBasicSerializer');
}
/**
@@ -93,7 +93,7 @@ class PostSerializer extends PostBasicSerializer
*/
protected function editUser($post)
{
- return $this->hasOne($post, 'Flarum\Api\Serializer\UserSerializer');
+ return $this->hasOne($post, 'Flarum\Api\Serializer\UserBasicSerializer');
}
/**
@@ -101,6 +101,6 @@ class PostSerializer extends PostBasicSerializer
*/
protected function hideUser($post)
{
- return $this->hasOne($post, 'Flarum\Api\Serializer\UserSerializer');
+ return $this->hasOne($post, 'Flarum\Api\Serializer\UserBasicSerializer');
}
} | Performance: Load only basic information about post discussion/users | flarum_core | train | php |
7c91a680a5e6ca59bd3a67547e9fe1b6cb29e468 | diff --git a/lib/ezutils/classes/ezmoduleoperationinfo.php b/lib/ezutils/classes/ezmoduleoperationinfo.php
index <HASH>..<HASH> 100644
--- a/lib/ezutils/classes/ezmoduleoperationinfo.php
+++ b/lib/ezutils/classes/ezmoduleoperationinfo.php
@@ -750,11 +750,12 @@ class eZModuleOperationInfo
if ( !class_exists( $className ) )
{
include_once( $includeFile );
- }
- if ( !class_exists( $className ) )
- {
- return array( 'internal_error' => eZModuleOperationInfo::ERROR_NO_CLASS,
- 'internal_error_class_name' => $className );
+
+ if ( !class_exists( $className, false ) )
+ {
+ return array( 'internal_error' => eZModuleOperationInfo::ERROR_NO_CLASS,
+ 'internal_error_class_name' => $className );
+ }
}
$classObject = $this->objectForClass( $className );
if ( $classObject === null ) | EZP-<I> : no need to trigger autoload on second class_exists | ezsystems_ezpublish-legacy | train | php |
634b89b0bef3123bbf49480050b68d7fb7ef49c4 | diff --git a/lib/requestMethods.js b/lib/requestMethods.js
index <HASH>..<HASH> 100644
--- a/lib/requestMethods.js
+++ b/lib/requestMethods.js
@@ -47,8 +47,11 @@ module.exports.authenticate= function(strategy, opts, callback, strategyExecutor
}
// Choose the first strategy defined if no strategy provided
- if( !strategy && strategyExecutor.strategies.length >0 ) {
- strategy= [strategyExecutor.strategies[0].name];
+ if( !strategy && strategyExecutor.strategies ) {
+ for( var k in strategyExecutor.strategies ) {
+ strategy= [strategyExecutor.strategies[k].name];
+ break;
+ }
}
trace( "Authenticating ("+this.headers.host + this.url+")", scope, ">>>" ); | Support object literals as well as arrays for auto-selecting strategies | ciaranj_connect-auth | train | js |
e612da04890844fc319a68529e0a1947e57f5307 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -66,6 +66,12 @@ end
OAUTH_TOKEN = 'bafec72922f31fe86aacc8aca4261117f3bd62cf'
+def reset_authentication_for(object)
+ ['basic_auth', 'oauth_token', 'login', 'password' ].each do |item|
+ object.send("#{item}=", nil)
+ end
+end
+
class Hash
def except(*keys)
cpy = self.dup | Add helper method for authentication params resetting. | piotrmurach_github | train | rb |
0b736c1a47c52214b4441340db8ad19ae4e69628 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,7 +2,7 @@ module.exports = function(grunt) {
grunt.initConfig({
eslint: {
- src: ['speck.js', 'Gruntfile.js']
+ src: ['speck.js', 'Gruntfile.js', 'parsing/**/*.js’]
},
watch: {
files: ['<%= eslint.src %>'], | Added parsing subdirectory to Gruntfile | speckjs_speckjs | train | js |
4870ce9d1f23509701def8e99afe9a8eb6a818f7 | diff --git a/python/mxnet/rnn/io.py b/python/mxnet/rnn/io.py
index <HASH>..<HASH> 100644
--- a/python/mxnet/rnn/io.py
+++ b/python/mxnet/rnn/io.py
@@ -162,7 +162,7 @@ class BucketSentenceIter(DataIter):
data = self.nddata[i][j:j+self.batch_size]
label = self.ndlabel[i][j:j+self.batch_size]
- return DataBatch([data], [label],
+ return DataBatch([data], [label], pad=0,
bucket_key=self.buckets[i],
provide_data=[(self.data_name, data.shape)],
provide_label=[(self.label_name, label.shape)]) | Add pad param to DataBatch returned by BucketSentenceIter (#<I>) | apache_incubator-mxnet | train | py |
9714d8a4547811e83fe06fe35cbbddd9e61b92de | diff --git a/sub.js b/sub.js
index <HASH>..<HASH> 100644
--- a/sub.js
+++ b/sub.js
@@ -1,6 +1,10 @@
var inherits = require('inherits')
var Stream = require('./stream')
+function isError (end) {
+ return end && end !== true
+}
+
module.exports = Sub
inherits(Sub, Stream)
@@ -9,14 +13,16 @@ function Sub (parent, id) {
this.parent = parent
this.id = id
Stream.call(this)
+ this.paused = false
}
Sub.prototype.write = function (data) {
this.parent._write({req: this.id, value: data, stream: true, end: false})
+ this.paused = !this.parent.sink || this.parent.sink.paused
}
Sub.prototype.end = function (err) {
- this.parent._write({req: this.id, value: data, stream: true, end: true})
+ this.parent._write({req: this.id, value: err, stream: true, end: true})
delete this.parent.subs[this.id]
//if we errored this stream, kill it immediately.
if(isError(this.ended)) this._end(err)
@@ -26,5 +32,3 @@ Sub.prototype.end = function (err) {
-
- | sub should pause if the parent's sink is paused, or there is no sink! | push-stream_push-mux | train | js |
3fffd347d3a88c1fe33f67caae711a64307ac416 | diff --git a/library/Services/ShopInstaller/ShopInstaller.php b/library/Services/ShopInstaller/ShopInstaller.php
index <HASH>..<HASH> 100644
--- a/library/Services/ShopInstaller/ShopInstaller.php
+++ b/library/Services/ShopInstaller/ShopInstaller.php
@@ -22,6 +22,9 @@
include_once LIBRARY_PATH .'/DbHandler.php';
require_once LIBRARY_PATH .'/Cache.php';
+/** Class is used to stop autoloading in oxsetup as it breaks shop installation. */
+class Conf{}
+
/**
* Class for shop installation.
*/ | Define class Conf
Class is used to stop autoloading in oxsetup as it breaks shop installation. | OXID-eSales_testing_library | train | php |
1b6b20f4b9cbd9d39be29e8012b6163e9ae7bf73 | diff --git a/prow/plank/controller.go b/prow/plank/controller.go
index <HASH>..<HASH> 100644
--- a/prow/plank/controller.go
+++ b/prow/plank/controller.go
@@ -405,9 +405,10 @@ func (c *Controller) syncPendingJob(pj kube.ProwJob, pm map[string]kube.Pod, rep
var b bytes.Buffer
if err := c.ca.Config().Plank.JobURLTemplate.Execute(&b, &pj); err != nil {
- return fmt.Errorf("error executing URL template: %v", err)
+ c.log.Errorf("error executing URL template: %v", err)
+ } else {
+ pj.Status.URL = b.String()
}
- pj.Status.URL = b.String()
reports <- pj
if prevState != pj.Status.State {
c.log.WithFields(pjutil.ProwJobFields(&pj)). | Prevent template errors from blocking ProwJob state transition. | kubernetes_test-infra | train | go |
ae43defa72eda3ed469fb6044ed3e6a7151a4d82 | diff --git a/properties/base.py b/properties/base.py
index <HASH>..<HASH> 100644
--- a/properties/base.py
+++ b/properties/base.py
@@ -184,15 +184,11 @@ class HasProperties(with_metaclass(PropertyMetaclass, object)):
def _set(self, name, value):
change = dict(name=name, value=value, mode='validate')
self._notify(change)
- if change['name'] != name:
- warn('Specified Property for assignment changed during '
- 'validation. Setting original property {}'.format(name),
- RuntimeWarning)
if change['value'] is utils.undefined and name in self._backend:
self._backend.pop(name)
else:
self._backend[name] = change['value']
- change.update(mode='observe')
+ change.update(name=name, mode='observe')
self._notify(change)
def validate(self): | Remove warning if 'name' is modified on change validation
Instead, any change to name is disregarded, only updated values are used | seequent_properties | train | py |
1b741669e7fc1a64afdc342cdb4bb7359c995b94 | diff --git a/boon/src/main/java/org/boon/core/Sys.java b/boon/src/main/java/org/boon/core/Sys.java
index <HASH>..<HASH> 100644
--- a/boon/src/main/java/org/boon/core/Sys.java
+++ b/boon/src/main/java/org/boon/core/Sys.java
@@ -214,7 +214,7 @@ public class Sys {
Class.forName ( "javax.servlet.http.HttpServlet" );
_inContainer = true;
- } catch ( ClassNotFoundException e ) {
+ } catch ( Throwable e ) {
_inContainer = false;
}
if ( !_inContainer ) {
@@ -222,7 +222,7 @@ public class Sys {
Class.forName ( "javax.ejb.EJBContext" );
_inContainer = true;
- } catch ( ClassNotFoundException e ) {
+ } catch ( Throwable e ) {
_inContainer = false;
} | Protect against unloadable classes, close #<I> | boonproject_boon | train | java |
68289693f723f7a11ab13014a784d0a95abfd6ed | diff --git a/actionpack/lib/action_view/template_handlers/builder.rb b/actionpack/lib/action_view/template_handlers/builder.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/template_handlers/builder.rb
+++ b/actionpack/lib/action_view/template_handlers/builder.rb
@@ -6,7 +6,8 @@ module ActionView
include Compilable
def compile(template)
- "controller.response.content_type ||= Mime::XML;" +
+ # ActionMailer does not have a response
+ "controller.respond_to?(:response) && controller.response.content_type ||= Mime::XML;" +
"xml = ::Builder::XmlMarkup.new(:indent => 2);" +
template.source +
";xml.target!;" | Check for response in builder template since ActionMailer does not have one | rails_rails | train | rb |
8ad0f4a8ae987cc16357bb1aa95338318a8791bd | diff --git a/library/CM/Mail.php b/library/CM/Mail.php
index <HASH>..<HASH> 100644
--- a/library/CM/Mail.php
+++ b/library/CM/Mail.php
@@ -364,7 +364,6 @@ class CM_Mail extends CM_View_Abstract implements CM_Typed {
/**
* @throws CM_Exception_Invalid
- * @throws CM_Exception_NotAllowed
* @throws phpmailerException
*/
protected function _send($subject, $text, $html = null) { | Reworked docu according to review | cargomedia_cm | train | php |
0eb1f01aa80cfc27087035f86d539223191c8999 | diff --git a/ca/django_ca/management/commands/sign_cert.py b/ca/django_ca/management/commands/sign_cert.py
index <HASH>..<HASH> 100644
--- a/ca/django_ca/management/commands/sign_cert.py
+++ b/ca/django_ca/management/commands/sign_cert.py
@@ -87,7 +87,7 @@ the default values, options like --key-usage still override the profile.""")
if options['cn_in_san'] is not None:
kwargs['cn_in_san'] = options['cn_in_san']
if options['key_usage']:
- kwargs['keyUsage'] = self.parse_extension(options['key_usage'])
+ kwargs['keyUsage'] = options['key_usage']
if options['ext_key_usage']:
kwargs['extendedKeyUsage'] = self.parse_extension(options['ext_key_usage'])
if options['tls_features']: | pass keyUsage verbatim (should be a django_ca.extensions.KeyUsage by now) | mathiasertl_django-ca | train | py |
234391388748eae5b00b941ed696c7763792d9a9 | diff --git a/src/edit/methods.js b/src/edit/methods.js
index <HASH>..<HASH> 100644
--- a/src/edit/methods.js
+++ b/src/edit/methods.js
@@ -480,7 +480,7 @@ function findPosH(doc, pos, dir, unit, visually) {
next = moveVisually(doc.cm, lineObj, pos, dir)
} else {
let ch = moveLogically(lineObj, pos, dir)
- next = ch == null ? null : new Pos(pos.line, ch, dir < 0 ? "after" : "before")
+ next = ch == null ? null : new Pos(pos.line, ch, dir < 0 ? "after" : "before")
}
if (next == null) {
if (!boundToLine && findNextLine())
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -34,7 +34,6 @@ var opera = /Opera\/\./.test(navigator.userAgent);
var opera_version = opera && navigator.userAgent.match(/Version\/(\d+\.\d+)/);
if (opera_version) opera_version = Number(opera_version);
var opera_lt10 = opera && (!opera_version || opera_version < 10);
-var webkit = /WebKit\//.test(navigator.userAgent);
namespace = "core_"; | Remove unused variable and duplicate white space | codemirror_CodeMirror | train | js,js |
f25ccec85643b50781493375e733de33c4b39849 | diff --git a/ella/polls/models.py b/ella/polls/models.py
index <HASH>..<HASH> 100644
--- a/ella/polls/models.py
+++ b/ella/polls/models.py
@@ -88,7 +88,8 @@ class Choice(models.Model):
return self.choice
class Meta:
- order_with_respect_to = 'question'
+ #order_with_respect_to = 'question'
+ order = ('question',)
verbose_name = _('Choice')
verbose_name_plural = _('Choices') | Choice option Order with respect to question temporary disabled
git-svn-id: <URL> | ella_ella | train | py |
6bb3c9bff72da01d9cdb8c21257cc4bfd67358d2 | diff --git a/src/Stream/Stream.php b/src/Stream/Stream.php
index <HASH>..<HASH> 100644
--- a/src/Stream/Stream.php
+++ b/src/Stream/Stream.php
@@ -26,7 +26,12 @@ final class Stream implements StreamInterface
}
$this->resource = $resource;
- $this->rewind();
+ $meta = stream_get_meta_data($resource);
+
+ if ($meta['seekable']) {
+ $this->rewind();
+ }
+
$stats = fstat($resource);
if (isset($stats['size'])) { | only rewind if the stream is seekable | Innmind_Stream | train | php |
1c309c7c4e41bc483ea1f659661979086f064f26 | diff --git a/salt/states/ipset.py b/salt/states/ipset.py
index <HASH>..<HASH> 100644
--- a/salt/states/ipset.py
+++ b/salt/states/ipset.py
@@ -293,7 +293,7 @@ def absent(name, entry=None, entries=None, family='ipv4', **kwargs):
kwargs['set_name'],
family)
else:
- command = __salt__['ipset.delete'](kwargs['set_name'], _entry, family, **kwargs)
+ command = __salt__['ipset.delete'](kwargs['set_name'], entry, family, **kwargs)
if 'Error' not in command:
ret['changes'] = {'locale': name}
ret['result'] = True | Fix state absent broken by ipset-add-new-options PR | saltstack_salt | train | py |
f6c45ae4a819c18f645242957e91882f3913b7bb | diff --git a/test/emmett.test.js b/test/emmett.test.js
index <HASH>..<HASH> 100644
--- a/test/emmett.test.js
+++ b/test/emmett.test.js
@@ -150,6 +150,23 @@ describe('Emitter', function() {
assert.strictEqual(count, 3);
});
+
+ it('onces should be unbound in the correct order.', function() {
+ var count = 0,
+ ne = new emitter(),
+ callback = function() { count++; };
+
+ ne.once('event', callback);
+ ne.once('event', callback);
+
+ ne.emit('event');
+
+ assert.strictEqual(count, 2);
+
+ ne.emit('event');
+
+ assert.strictEqual(count, 2);
+ });
});
describe('api', function() { | Adding test to ensure several onces unbinding | jacomyal_emmett | train | js |
fb48ade000dcc3321f392edeabc99f45fc491434 | diff --git a/src/Tenant/Setting.php b/src/Tenant/Setting.php
index <HASH>..<HASH> 100644
--- a/src/Tenant/Setting.php
+++ b/src/Tenant/Setting.php
@@ -96,11 +96,10 @@ class Tenant_Setting extends Pluf_Model
);
$this->_a['idx'] = array(
'mod_key_idx' => array(
- 'type' => 'unique',
- 'col' => 'mod, key'
+ 'col' => 'mode, key'
),
'key_idx' => array(
- 'type' => 'unique',
+ 'type' => 'index',
'col' => 'key'
)
);
diff --git a/tests/conf/config.php b/tests/conf/config.php
index <HASH>..<HASH> 100644
--- a/tests/conf/config.php
+++ b/tests/conf/config.php
@@ -1,5 +1,5 @@
<?php
-// $cfg = include 'mysql.config.php';
-$cfg = include 'sqlite.config.php';
+$cfg = include 'mysql.config.php';
+// $cfg = include 'sqlite.config.php';
return $cfg; | key,mode is not a unique index. | pluf_tenant | train | php,php |
f8046db4338e4f5be53f4fda529500a15e6a6cb1 | diff --git a/service/managedinstance/providers/aws/aws.go b/service/managedinstance/providers/aws/aws.go
index <HASH>..<HASH> 100644
--- a/service/managedinstance/providers/aws/aws.go
+++ b/service/managedinstance/providers/aws/aws.go
@@ -184,6 +184,7 @@ type Strategy struct {
UtilizeReservedInstances *bool `json:"utilizeReservedInstances,omitempty"`
OptimizationWindows []string `json:"optimizationWindows,omitempty"`
RevertToSpot *RevertToSpot `json:"revertToSpot,omitempty"`
+ MinimumInstanceLifetime *int `json:"minimumInstanceLifetime,omitempty"`
forceSendFields []string
nullFields []string
@@ -1337,6 +1338,13 @@ func (o *Strategy) SetLifeCycle(v *string) *Strategy {
return o
}
+func (o *Strategy) SetMinimumInstanceLifetime(v *int) *Strategy {
+ if o.MinimumInstanceLifetime = v; o.MinimumInstanceLifetime == nil {
+ o.nullFields = append(o.nullFields, "MinimumInstanceLifetime")
+ }
+ return o
+}
+
// endregion
// region RevertToSpot | feat(managedinstance/aws): add support for minimum instance lifetime (#<I>) | spotinst_spotinst-sdk-go | train | go |
bfa761471da03d2d87251bc4519178d1b935282e | diff --git a/src/Components/ExcelExport.php b/src/Components/ExcelExport.php
index <HASH>..<HASH> 100644
--- a/src/Components/ExcelExport.php
+++ b/src/Components/ExcelExport.php
@@ -3,7 +3,7 @@
namespace Nayjest\Grids\Components;
use Event;
-use Paginator;
+use Illuminate\Pagination\Paginator;
use Illuminate\Foundation\Application;
use Maatwebsite\Excel\Classes\LaravelExcelWorksheet;
use Maatwebsite\Excel\Excel; | Excel export bugfix for L5+ | Nayjest_Grids | train | php |
4d92a6947c160b2ff5e978628e2d05e1ac6cbb53 | diff --git a/tests/dummy/app/controllers/demos/sl-grid.js b/tests/dummy/app/controllers/demos/sl-grid.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/app/controllers/demos/sl-grid.js
+++ b/tests/dummy/app/controllers/demos/sl-grid.js
@@ -28,7 +28,7 @@ export default Ember.ArrayController.extend({
size : 'small',
sortable : true,
title : 'Hex Code',
- valuePath : 'test'
+ valuePath : 'hexCode'
}
]),
diff --git a/tests/dummy/app/controllers/demos/sl-grid/detail.js b/tests/dummy/app/controllers/demos/sl-grid/detail.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/app/controllers/demos/sl-grid/detail.js
+++ b/tests/dummy/app/controllers/demos/sl-grid/detail.js
@@ -24,12 +24,6 @@ export default Ember.Controller.extend({
action : 'sendLog',
label : 'Log'
}
- ]),
-
- test: Ember.computed( function() {
- return Math.random();
- }),
-
- testValue: 'Okay'
+ ])
}); | Remove temporary test data from sl-grid demo | softlayer_sl-ember-components | train | js,js |
ba82e4f0c4984d26febbfb156f78f1125159e623 | diff --git a/lib/spark/worker/master.rb b/lib/spark/worker/master.rb
index <HASH>..<HASH> 100755
--- a/lib/spark/worker/master.rb
+++ b/lib/spark/worker/master.rb
@@ -129,7 +129,8 @@ module Master
::Thread.abort_on_exception = true
# For synchronous access to socket IO
- $mutex = Mutex.new
+ $mutex_for_command = Mutex.new
+ $mutex_for_iterator = Mutex.new
super
end
diff --git a/lib/spark/worker/worker.rb b/lib/spark/worker/worker.rb
index <HASH>..<HASH> 100644
--- a/lib/spark/worker/worker.rb
+++ b/lib/spark/worker/worker.rb
@@ -134,6 +134,10 @@ module Worker
private
+ def load_command
+ $mutex_for_command.synchronize { super }
+ end
+
# Threads changing for reading is very slow
# Faster way is do it one by one
def load_iterator
@@ -144,7 +148,7 @@ module Worker
client_socket.wait_readable
end
- $mutex.synchronize { super }
+ $mutex_for_iterator.synchronize { super }
end
end | fix: thread worker for mri | ondra-m_ruby-spark | train | rb,rb |
1022a8d3a76eb29a941d79a110991facbb2ceef4 | diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommitExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommitExplorer.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommitExplorer.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommitExplorer.js
@@ -171,7 +171,7 @@ define(['dojo', 'orion/explorer', 'orion/util', 'orion/compare/diff-provider', '
var commitMessage1 = commit.Message.substring(commitMessage0.length, commit.Message.length);
- if (commitMessage1.length > 0){
+ if (commitMessage1.trim().length > 0){
div = dojo.create( "pre", null, detailsView );
dojo.place(document.createTextNode(cut ? "..." + commitMessage1 : commitMessage1.trim()), div);
dojo.create( "div", {"style":"padding-top:15px"}, detailsView ); | Do not show an empty box when the commit message ends with
the end-line character | eclipse_orion.client | train | js |
d90c373edaba342060df27dd7d88cf6a96c5f2df | diff --git a/health.go b/health.go
index <HASH>..<HASH> 100644
--- a/health.go
+++ b/health.go
@@ -24,7 +24,7 @@ type HealthCheck struct {
GracePeriodSeconds int `json:"gracePeriodSeconds,omitempty"`
IntervalSeconds int `json:"intervalSeconds,omitempty"`
PortIndex int `json:"portIndex,omitempty"`
- MaxConsecutiveFailures int `json:"maxConsecutiveFailures,omitempty"`
+ MaxConsecutiveFailures int `json:"maxConsecutiveFailures"`
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
} | remove omitempty on MaxConsecutiveFailures as 0 ok | gambol99_go-marathon | train | go |
8393b7c5a1c4faeb07b03e93ce4387106cd57ac3 | diff --git a/js/plugins/legend.js b/js/plugins/legend.js
index <HASH>..<HASH> 100644
--- a/js/plugins/legend.js
+++ b/js/plugins/legend.js
@@ -22,6 +22,13 @@ Flotr.addPlugin('legend', {
callbacks: {
'flotr:afterinit': function() {
this.legend.insertLegend();
+ },
+ 'flotr:destroy': function() {
+ var markup = this.legend.markup;
+ if (markup) {
+ this.legend.markup = null;
+ D.remove(markup);
+ }
}
},
/**
@@ -139,7 +146,8 @@ Flotr.addPlugin('legend', {
if(fragments.length > 0){
var table = '<table style="font-size:smaller;color:' + options.grid.color + '">' + fragments.join('') + '</table>';
if(legend.container){
- D.empty(legend.container);
+ table = D.node(table);
+ this.legend.markup = table;
D.insert(legend.container, table);
}
else { | Do not empty container div and cleanup markup when done. | HumbleSoftware_Flotr2 | train | js |
bd201df78baade62fa3d0a09d913881f6773d99e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -318,6 +318,12 @@ setup(
author='Victor M. Alvarez',
author_email='plusvic@gmail.com, vmalvarez@virustotal.com',
url='https://github.com/VirusTotal/yara-python',
+ classifiers=[
+ 'Programming Language :: Python',
+ 'License :: OSI Approved :: Apache Software License',
+ 'Operating System :: OS Independent',
+ 'Development Status :: 5 - Production/Stable',
+ ],
zip_safe=False,
cmdclass={
'build': BuildCommand, | Add trove classifiers to setup.py. | VirusTotal_yara-python | train | py |
88b769731d3cf10634dd86c7153ea4ed71230a11 | diff --git a/app/assets/javascripts/releaf/include/sortable.js b/app/assets/javascripts/releaf/include/sortable.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/releaf/include/sortable.js
+++ b/app/assets/javascripts/releaf/include/sortable.js
@@ -1,7 +1,6 @@
jQuery(document).ready(function() {
jQuery(document.body).on('initsortable', function(e) {
- console.debug("test");
jQuery(e.target).find('.list[data-sortable]').sortable({
axis: "y",
ontainment: "parent", | Remove debuging from js | cubesystems_releaf | train | js |
69cf3ab5a5a5fdc9cd09be3bc149dcc9d5207994 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -98,27 +98,34 @@ function SerialPort(path, options, openImmediately, callback) {
return;
}
+ options.rtscts = _options.rtscts;
+
if (options.flowControl || options.flowcontrol) {
var fc = options.flowControl || options.flowcontrol;
if (typeof fc === 'boolean') {
options.rtscts = true;
} else {
- fc.forEach(function (flowControl) {
+ var clean = fc.every(function (flowControl) {
var fcup = flowControl.toUpperCase();
var idx = FLOWCONTROLS.indexOf(fcup);
if (idx < 0) {
- var err = new Error('Invalid "flowControl": ' + fcup + ". Valid options: " + FLOWCONTROLS.join(", "));
+ var err = new Error('Invalid "flowControl": ' + fcup + '. Valid options: ' + FLOWCONTROLS.join(', '));
callback(err);
- return;
+ return false;
} else {
// "XON", "XOFF", "XANY", "DTRDTS", "RTSCTS"
switch (idx) {
case 0: options.rtscts = true; break;
}
+ return true;
}
});
+ console.log(clean);
+ if(!clean){
+ return;
+ }
}
} | flow control thought it was returning and halting execution from inside a foreach, it was not | garrows_browser-serialport | train | js |
a3278448391b074eab1df31040a55841f9c2f729 | diff --git a/lib/request.js b/lib/request.js
index <HASH>..<HASH> 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -250,14 +250,13 @@ class Request extends AsyncResource {
assert(!this.upgrade && this.method !== 'CONNECT')
if (this.aborted) {
- return null
+ return
}
try {
return this.runInAsyncScope(this._onData, this, chunk.slice(offset, offset + length))
} catch (err) {
this.onError(err)
- return null
}
} | refactor: undefined is nully | mcollina_undici | train | js |
dcbc63aaf3fcb1e6ce7bb8b55caf4433f59af9a8 | diff --git a/pycbc/future.py b/pycbc/future.py
index <HASH>..<HASH> 100644
--- a/pycbc/future.py
+++ b/pycbc/future.py
@@ -23,7 +23,7 @@
#
# =============================================================================
#
-"""This file contains backported functionality from future versions of librarays.
+"""This file contains backported functionality from future versions of libraries.
Mostly done with monkey-patching.
""" | Fix typo in pycbc.futures module docstring. | gwastro_pycbc | train | py |
ff3d7cad5bbd6a771ed2bc1a6a596ad1e8ff614c | diff --git a/src/Parser.php b/src/Parser.php
index <HASH>..<HASH> 100644
--- a/src/Parser.php
+++ b/src/Parser.php
@@ -47,7 +47,7 @@ abstract class Parser {
final function __clone()
{
- $this->onCommit = null;
+ $this->onCommit = $this->onTry = null;
}
function parse(TokenStream $ts) /*: Result|null*/ | fix potential state leak on parser::__clone operation | marcioAlmada_yay | train | php |
5287da8bd85b5cc761c5e49e7fb3d1708b642db0 | diff --git a/integration/lifecycle/rlimit_test.go b/integration/lifecycle/rlimit_test.go
index <HASH>..<HASH> 100644
--- a/integration/lifecycle/rlimit_test.go
+++ b/integration/lifecycle/rlimit_test.go
@@ -32,7 +32,7 @@ var _ = Describe("Resource limits", func() {
})
Context("when setting all rlimits to minimum values", func() {
- It("succeeds", func(done Done) {
+ PIt("succeeds", func(done Done) {
// Experimental minimum values tend to produce flakes.
fudgeFactor := 1.50 | Set the failing minimum rlimits test to pending
[#<I>] | cloudfoundry-attic_garden-linux | train | go |
4cc4f2e3cd954c103968570c91e277789ef72f27 | diff --git a/lib/timerizer.rb b/lib/timerizer.rb
index <HASH>..<HASH> 100644
--- a/lib/timerizer.rb
+++ b/lib/timerizer.rb
@@ -5,7 +5,7 @@ class RelativeTime
:second => 1,
:minute => 60,
:hour => 3600,
- :day => 864000,
+ :day => 86400,
:week => 604800
} | fix number of seconds in a day | kylewlacy_timerizer | train | rb |
ce5970b5c18f35a13ce348e1b7d6971b5d704503 | diff --git a/integration_tests/androidx_test/src/test/java/org/robolectric/integration_tests/axt/ActivityScenarioTest.java b/integration_tests/androidx_test/src/test/java/org/robolectric/integration_tests/axt/ActivityScenarioTest.java
index <HASH>..<HASH> 100644
--- a/integration_tests/androidx_test/src/test/java/org/robolectric/integration_tests/axt/ActivityScenarioTest.java
+++ b/integration_tests/androidx_test/src/test/java/org/robolectric/integration_tests/axt/ActivityScenarioTest.java
@@ -106,6 +106,19 @@ public class ActivityScenarioTest {
}
@Test
+ public void launch_pauseAndResume_callbackSequence() {
+ ActivityScenario<TranscriptActivity> activityScenario =
+ ActivityScenario.launch(TranscriptActivity.class);
+ assertThat(activityScenario).isNotNull();
+ activityScenario.moveToState(State.STARTED);
+ activityScenario.moveToState(State.RESUMED);
+ assertThat(callbacks)
+ .containsExactly(
+ "onCreate", "onStart", "onPostCreate", "onResume", "onWindowFocusChanged true",
+ "onPause", "onResume");
+ }
+
+ @Test
public void launch_lifecycleOwnerActivity() {
ActivityScenario<LifecycleOwnerActivity> activityScenario =
ActivityScenario.launch(LifecycleOwnerActivity.class); | Add test that verify calling only onPause and onResume when pause/resume Activity | robolectric_robolectric | train | java |
760b4f9acc586a81d99c1e083f61cf1241fb14c8 | diff --git a/python/dllib/src/bigdl/dllib/nn/layer.py b/python/dllib/src/bigdl/dllib/nn/layer.py
index <HASH>..<HASH> 100644
--- a/python/dllib/src/bigdl/dllib/nn/layer.py
+++ b/python/dllib/src/bigdl/dllib/nn/layer.py
@@ -4034,11 +4034,12 @@ class SequenceBeamSearch(Layer):
:param alpha: defining the strength of length normalization
:param decode_length: maximum length to decoded sequence
:param eos_id: id of eos token, used to determine when a sequence has finished
+ :param padding_value
:param num_hidden_layers: number of hidden layers
:param hidden_size: size of hidden layer
- >>> sequenceBeamSearch = SequenceBeamSearch(4, 3, 0.0, 10, 1.0, 2, 5)
+ >>> sequenceBeamSearch = SequenceBeamSearch(4, 3, 0.0, 10, 2.0, 1.0, 2, 5)
creating: createSequenceBeamSearch
'''
@@ -4048,6 +4049,7 @@ class SequenceBeamSearch(Layer):
alpha,
decode_length,
eos_id,
+ padding_value,
num_hidden_layers,
hidden_size,
bigdl_type="float"):
@@ -4057,6 +4059,7 @@ class SequenceBeamSearch(Layer):
alpha,
decode_length,
eos_id,
+ padding_value,
num_hidden_layers,
hidden_size) | update beam search feature for interface with transformer model (#<I>)
* update beam search for padding value and cache structure
* update python API for beam search
* add comments and update python layer
* modify comments format
* modify comments format | intel-analytics_BigDL | train | py |
5b5319ff627f0cd830ce52e8da2a70b48029284b | diff --git a/src/Illuminate/Redis/Connections/PhpRedisConnection.php b/src/Illuminate/Redis/Connections/PhpRedisConnection.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Redis/Connections/PhpRedisConnection.php
+++ b/src/Illuminate/Redis/Connections/PhpRedisConnection.php
@@ -140,7 +140,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract
*/
public function hsetnx($hash, $key, $value)
{
- return (int) $this->client->hsetnx($hash, $key, $value);
+ return (int) $this->client->hSetNx($hash, $key, $value);
}
/** | Use hSetNx with valid case (#<I>) | laravel_framework | train | php |
0f095211810d02dd82eecc3ea6c300339d1d03b7 | diff --git a/lib/NewtifryPro.js b/lib/NewtifryPro.js
index <HASH>..<HASH> 100644
--- a/lib/NewtifryPro.js
+++ b/lib/NewtifryPro.js
@@ -331,7 +331,7 @@ function sendMessage(message, senderKey, registrationIds, callback) {
body[Constants.PARAM_PAYLOAD_KEY] = message.data;
body[Constants.JSON_REGISTRATION_IDS] = registrationIds;
if (message.priority == 3) {
- body[Constants.PARAM_PRIORITY_KEY] = 'high';
+ //body[Constants.PARAM_PRIORITY_KEY] = 'high';
}
requestBody = JSON.stringify(body);
var toSend = JSON.stringify(message.data);
@@ -392,7 +392,7 @@ function sendMessageToTopic(message, senderKey, topic, callback) {
body[Constants.PARAM_PAYLOAD_KEY] = message.data;
body[Constants.PARAM_TOPIC_KEY] = '/topics/' + topic;
if (message.priority == 3) {
- body[Constants.PARAM_PRIORITY_KEY] = 'high';
+ //body[Constants.PARAM_PRIORITY_KEY] = 'high';
}
requestBody = JSON.stringify(body);
var toSend = JSON.stringify(message.data); | remove high FCM priority (bring NP to front on API >= Oreo | thunderace_NewtifryPro-node | train | js |
ab8945cf1055adfd4d76d93319666f5a727dd584 | diff --git a/Classes/Service/SolrServiceProvider.php b/Classes/Service/SolrServiceProvider.php
index <HASH>..<HASH> 100644
--- a/Classes/Service/SolrServiceProvider.php
+++ b/Classes/Service/SolrServiceProvider.php
@@ -93,7 +93,7 @@ class SolrServiceProvider extends AbstractServiceProvider implements ServiceProv
$this->query = $this->getConnection()->createSuggester();
$results = [];
if (array_key_exists('q', $arguments)) {
- $this->query->setQuery($arguments);
+ $this->query->setQuery($arguments['q']);
if ($arguments['dictionary']) {
$this->query->setDictionary($arguments['dictionary']);
} | Fixed suggester (#<I>)
The property q was missing and so the wrong solr query was exported. Now it works fine. Tested in our test page <URL> | subugoe_typo3-find | train | php |
de1dafc5a0fb62fae036f3a958a79fa2321d9cce | diff --git a/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java b/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java
index <HASH>..<HASH> 100644
--- a/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java
+++ b/src/main/org/codehaus/groovy/vmplugin/v7/Selector.java
@@ -354,6 +354,7 @@ public abstract class Selector {
mc = ((MetaClassRegistryImpl) GroovySystem.getMetaClassRegistry()).getMetaClass(receiver);
this.cache &= !ClassInfo.getClassInfo(receiver.getClass()).hasPerInstanceMetaClasses();
}
+ mc.initialize();
}
/** | ensure meta class is initialized before doing a call or requesting class members | apache_groovy | train | java |
f2c1e5d8aea6e3ed6745497fb6b77c17e756328d | diff --git a/src/main/java/org/jdbdt/Log.java b/src/main/java/org/jdbdt/Log.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jdbdt/Log.java
+++ b/src/main/java/org/jdbdt/Log.java
@@ -111,9 +111,9 @@ final class Log {
* @param data Data set.
*/
void write(CallInfo callInfo, DataSet data) {
- Element rootNode = root(),
- dsNode = createNode(rootNode, DATA_SET_TAG);
- write(rootNode, callInfo);
+ Element rootNode = root();
+ write(rootNode, callInfo);
+ Element dsNode = createNode(rootNode, DATA_SET_TAG);
write(dsNode, data.getSource().getMetaData());
write(dsNode, ROWS_TAG, data.getSource().getMetaData().columns(), data.getRows().iterator());
flush(rootNode); | Log: fixed position of <context> node for data set logging | JDBDT_jdbdt | train | java |
50d41cd195593f032cb2f1b7dd3159226046eb31 | diff --git a/demo/src/main/java/com/liulishuo/filedownloader/demo/Constant.java b/demo/src/main/java/com/liulishuo/filedownloader/demo/Constant.java
index <HASH>..<HASH> 100644
--- a/demo/src/main/java/com/liulishuo/filedownloader/demo/Constant.java
+++ b/demo/src/main/java/com/liulishuo/filedownloader/demo/Constant.java
@@ -9,8 +9,8 @@ public interface Constant {
"http://www.httpwatch.com/httpgallery/chunked/chunkedimage.aspx?0.04400023248109086",
};
- String LIULISHUO_APK_URL = "http://cdn.llsapp.com/android/LLS-v3.6.2-584-20160808-111006.apk";
- String LIULISHUO_CONTENT_DISPOSITION_FILENAME = "LLS-v3.6.2-584-20160808-111006.apk";
+ String LIULISHUO_APK_URL = "http://cdn.llsapp.com/android/LLS-v4.0-595-20160908-143200.apk";
+ String LIULISHUO_CONTENT_DISPOSITION_FILENAME = "LLS-v4.0-595-20160908-143200.apk";
String[] BIG_FILE_URLS = {
// 5m | demo(Urls): replace the Urls for the single task test | lingochamp_FileDownloader | train | java |
9ff871400aea3fba25abe3ea3891bf01a3e71bb7 | diff --git a/ucms_site/src/NodeManager.php b/ucms_site/src/NodeManager.php
index <HASH>..<HASH> 100644
--- a/ucms_site/src/NodeManager.php
+++ b/ucms_site/src/NodeManager.php
@@ -294,10 +294,12 @@ class NodeManager
/*
* The right and only working query for this.
*
- SELECT sa.site_id
+ SELECT DISTINCT(sa.site_id)
FROM ucms_site_access sa
+ JOIN ucms_site_node sn ON sn.site_id = sa.site_id
WHERE
sa.uid = 13 -- current user
+ AND sn.
AND sa.role = 1 -- webmaster
AND sa.site_id <> 2 -- node current site
AND NOT EXISTS (
@@ -330,6 +332,9 @@ class NodeManager
->condition('sa.role', Access::ROLE_WEBMASTER)
;
+ $q->join('ucms_site_node', 'sn', 'sn.site_id = sa.site_id');
+ $q->condition('sn.nid', $node->id());
+
// The node might not be attached to any site if it is a global content
if ($node->site_id) {
$q->condition('sa.site_id', $node->site_id, '<>'); | contrib: when cloning a node, site candidates should only be sites where references exist | makinacorpus_drupal-ucms | train | php |
2026fc3c2adede6e8240d5ef79ab6eea3fbfabb5 | diff --git a/lib/terminal-table/import.rb b/lib/terminal-table/import.rb
index <HASH>..<HASH> 100644
--- a/lib/terminal-table/import.rb
+++ b/lib/terminal-table/import.rb
@@ -48,6 +48,6 @@ module Kernel
#
def table headings = [], *rows, &block
- Terminal::Table.new :headings => headings, :rows => rows, &block
+ Terminal::Table.new :headings => headings.to_a, :rows => rows, &block
end
end
\ No newline at end of file | Allowing nil to be passed to table for headings | tj_terminal-table | train | rb |
c2a897b0440d406a2c669ea168078729c043276a | diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php
index <HASH>..<HASH> 100644
--- a/lib/grade/grade_item.php
+++ b/lib/grade/grade_item.php
@@ -779,24 +779,6 @@ class grade_item extends grade_object {
}
/**
- * Returns an array of values (NOT objects) standardised from the final grades of this grade_item. They are indexed by userid.
- * @return array integers
- */
- function get_standardised_final() {
- $standardised_finals = array();
-
- $final_grades = $this->load_final();
-
- if (!empty($final_grades)) {
- foreach ($final_grades as $userid => $final) {
- $standardised_finals[$userid] = standardise_score($final->gradevalue, $this->grademin, $this->grademax, 0, 1);
- }
- }
-
- return $standardised_finals;
- }
-
- /**
* Returns the grade_category object this grade_item belongs to (if any).
* This category object may be the parent (referenced by categoryid) or the associated category
* (referenced by iteminstance). | MDL-<I> removing obsoleted function, finals now processed only by update_final_grade() | moodle_moodle | train | php |
cf61b91369d5091206b4798d9d6bd009c7c186b7 | diff --git a/synchro/synchrotest.py b/synchro/synchrotest.py
index <HASH>..<HASH> 100644
--- a/synchro/synchrotest.py
+++ b/synchro/synchrotest.py
@@ -22,7 +22,6 @@ of a larger test suite.
"""
import sys
-import synchro
import nose
from nose.config import Config
@@ -32,6 +31,7 @@ from nose.plugins.skip import Skip
from nose.plugins.xunit import Xunit
from nose.selector import Selector
+import synchro
from motor.motor_py3_compat import PY3
excluded_modules = [ | Order synchrotest's imports. | mongodb_motor | train | py |
e9e1f32712f5d7bf6098ccb089e21e555f13e8e0 | diff --git a/code/Shortcodable.php b/code/Shortcodable.php
index <HASH>..<HASH> 100644
--- a/code/Shortcodable.php
+++ b/code/Shortcodable.php
@@ -24,7 +24,7 @@ class Shortcodable extends Object
if (!singleton($class)->hasMethod('parse_shortcode')) {
user_error("Failed to register \"$class\" with shortcodable. $class must have the method parse_shortcode(). See /shortcodable/README.md", E_USER_ERROR);
}
- ShortcodeParser::get('default')->register($class, array(singleton($class), 'parse_shortcode'));
+ ShortcodeParser::get('default')->register($class, array($class, 'parse_shortcode'));
singleton('ShortcodableParser')->register($class);
}
} | Tweak: Only class name needs to be registered | sheadawson_silverstripe-shortcodable | train | php |
f0283649c38f904813a81b72b10e82c6982b6504 | diff --git a/tests/Commando/CommandTest.php b/tests/Commando/CommandTest.php
index <HASH>..<HASH> 100755
--- a/tests/Commando/CommandTest.php
+++ b/tests/Commando/CommandTest.php
@@ -152,4 +152,34 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('a' => 'v1', 'b' => 'v2'), $cmd->getFlagValues());
}
+ /**
+ * Ensure that requirements are resolved correctly
+ */
+ public function testRequirementsOnOptionsValid()
+ {
+ $tokens = array('filename', '-a', 'v1', '-b', 'v2');
+ $cmd = new Command($tokens);
+
+ $cmd->option('b');
+ $cmd->option('a')
+ ->requires('b');
+
+ $this->assertEquals($cmd['a'], 'v1');
+ }
+
+ /**
+ * Test that an exception is thrown when an option isn't set
+ * @expectedException \InvalidArgumentException
+ */
+ public function testRequirementsOnOptionsMissing()
+ {
+ $tokens = array('filename', '-a', 'v1');
+ $cmd = new Command($tokens);
+
+ $cmd->trapErrors(false)
+ ->beepOnError(false);
+ $cmd->option('a')
+ ->requires('b');
+ }
+
}
\ No newline at end of file | Adding tests for new "required" handling to Command class | nategood_commando | train | php |
4855abf92675d3e64c31156bab953c2d71276271 | diff --git a/sdk/src/main/java/com/wonderpush/sdk/WonderPush.java b/sdk/src/main/java/com/wonderpush/sdk/WonderPush.java
index <HASH>..<HASH> 100644
--- a/sdk/src/main/java/com/wonderpush/sdk/WonderPush.java
+++ b/sdk/src/main/java/com/wonderpush/sdk/WonderPush.java
@@ -91,7 +91,7 @@ public class WonderPush {
protected static final int API_INT = 1; // reset SDK_VERSION when bumping this
protected static final String API_VERSION = "v" + API_INT;
- protected static final String SDK_SHORT_VERSION = "2.4.0"; // reset to .1.0.0 when bumping API_INT
+ protected static final String SDK_SHORT_VERSION = "2.4.1-SNAPSHOT"; // reset to .1.0.0 when bumping API_INT
protected static final String SDK_VERSION = "Android-" + API_INT + "." + SDK_SHORT_VERSION;
private static final String PRODUCTION_API_URL = "https://api.wonderpush.com/" + API_VERSION; | Bump to <I>-SNAPSHOT | wonderpush_wonderpush-android-sdk | train | java |
6ad1303e1274ce1073c7d99d1474012c5977cdcf | diff --git a/lib/volt/reactive/reactive_value.rb b/lib/volt/reactive/reactive_value.rb
index <HASH>..<HASH> 100644
--- a/lib/volt/reactive/reactive_value.rb
+++ b/lib/volt/reactive/reactive_value.rb
@@ -136,10 +136,6 @@ class ReactiveValue < BasicObject
end
end
end
- #
- # def respond_to?(name, include_private=false)
- # [:event_added, :event_removed].include?(name) || super
- # end
def respond_to_missing?(name, include_private=false)
cur.respond_to?(name)
@@ -428,5 +424,4 @@ class ReactiveManager
def setter!(setter=nil, &block)
@setter = setter || block
end
-
end | Some cleanup
1. No need to have respond_to when respond_to_missing is defined
2. Whitespace
I'll help you better once I get on my machine.
Cheers | voltrb_volt | train | rb |
b1164aa7782895b4a9365fb1b347c75ab4f68e22 | diff --git a/runtime-management/runtime-management-impl/src/main/resources/eval.py b/runtime-management/runtime-management-impl/src/main/resources/eval.py
index <HASH>..<HASH> 100644
--- a/runtime-management/runtime-management-impl/src/main/resources/eval.py
+++ b/runtime-management/runtime-management-impl/src/main/resources/eval.py
@@ -155,10 +155,13 @@ class PythonAgentExecutor(object):
'returnType': return_type}
finally:
self.__enable_standard_io(old_io)
+
+ final_result = json.dumps(final_result)
+
except Exception as e:
final_result = {'exception': str(e)}
- print(json.dumps(final_result))
+ print(final_result)
class AccessAwareDict(dict): | catch any exception which might occur when converting result to json | CloudSlang_score | train | py |
2b065de0a16e006ac354b5e924fbf3ab002fea20 | diff --git a/client/js/button.js b/client/js/button.js
index <HASH>..<HASH> 100644
--- a/client/js/button.js
+++ b/client/js/button.js
@@ -119,13 +119,6 @@ qq.UploadButton = function(o) {
qq(options.element).removeClass(options.focusClass);
});
- // IE and Opera, unfortunately have 2 tab stops on file input
- // which is unacceptable in our case, disable keyboard access
- if (window.attachEvent) {
- // it is IE or Opera
- input.setAttribute("tabIndex", "-1");
- }
-
return input;
} | feat(a<I>y): allow tab to focus file input
Previously disabled in IE since two tabs are required to
navigate past the file input. I think disabling keyboard
access in IE is a more harmful solution, so I've removed this
condition.
#<I> | FineUploader_fine-uploader | train | js |
62af754d6d0ffb52eac1fdc1385216198b3b269c | diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/CalendarTimer.java b/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/CalendarTimer.java
index <HASH>..<HASH> 100644
--- a/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/CalendarTimer.java
+++ b/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/CalendarTimer.java
@@ -365,4 +365,14 @@ public class CalendarTimer extends TimerImpl {
// no match found
return null;
}
+
+ /**
+ * {@inheritDoc}. For calendar-based timer, the string output also includes its schedule expression value.
+ *
+ * @return a string representation of calendar-based timer
+ */
+ @Override
+ public String toString() {
+ return super.toString() + " " + getScheduleExpression();
+ }
} | WFLY-<I> Need to include the schedule expression value in the toString() output of a calendar-based timer. | wildfly_wildfly | train | java |
9479de4e3a7dc29f85827aca7f41dc9edc8f0806 | diff --git a/lib/lolcommits/capturer/capture_linux_video.rb b/lib/lolcommits/capturer/capture_linux_video.rb
index <HASH>..<HASH> 100644
--- a/lib/lolcommits/capturer/capture_linux_video.rb
+++ b/lib/lolcommits/capturer/capture_linux_video.rb
@@ -3,7 +3,7 @@
module Lolcommits
class CaptureLinuxVideo < Capturer
def capture
- system_call "ffmpeg -nostats -v quiet -y -f video4linux2 -video_size 640x480 -i #{capture_device_string} -t #{capture_duration} \"#{capture_path}\" > /dev/null"
+ system_call "ffmpeg -nostats -v quiet -y -f video4linux2 -video_size 640x480 -i #{capture_device_string} -t #{capture_duration} -ss #{capture_delay || 0} \"#{capture_path}\" > /dev/null"
end
private | Support delays w/ Linux animated GIFs | lolcommits_lolcommits | train | rb |
e74f06fc00f4901ae76b9bb94b4789af5576ffb9 | diff --git a/DependencyInjection/BazingaGeocoderExtension.php b/DependencyInjection/BazingaGeocoderExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/BazingaGeocoderExtension.php
+++ b/DependencyInjection/BazingaGeocoderExtension.php
@@ -151,10 +151,6 @@ class BazingaGeocoderExtension extends Extension
$this->addProvider('maxmind', array($maxmindParams['api_key']));
}
- if (isset($config['provider']['cache'])) {
- $params = $config['provider']['cache'];
- }
-
if (isset($config['providers']['cache'])) {
$params = $config['providers']['cache'];
$cache = new Reference($params['adapter']); | [Extension] Remove duplicated cache lines | geocoder-php_BazingaGeocoderBundle | train | php |
cdd895cbb6d1a75d4e86570c2532f413edae863c | diff --git a/lib/crabfarm/live/controller.rb b/lib/crabfarm/live/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/crabfarm/live/controller.rb
+++ b/lib/crabfarm/live/controller.rb
@@ -105,11 +105,17 @@ module Crabfarm
end
def load_web_ui
- Helpers.inject_script @manager.primary_driver, 'https://www.crabtrap.io/selectorgadget_combined.js'
Helpers.inject_style @manager.primary_driver, 'https://www.crabtrap.io/selectorgadget_combined.css'
- Helpers.inject_script @manager.primary_driver, 'https://www.crabtrap.io/tools.js'
Helpers.inject_style @manager.primary_driver, 'https://www.crabtrap.io/tools.css'
+ Helpers.inject_script @manager.primary_driver, 'https://www.crabtrap.io/selectorgadget_combined.js'
+ Helpers.inject_script @manager.primary_driver, 'https://www.crabtrap.io/tools.js'
+ wait_for_injection
+ end
+ def wait_for_injection
+ while @manager.primary_driver.execute_script "return (typeof window.crabfarm === 'undefined');"
+ sleep 1.0
+ end
end
def memento_path(_name) | fix(live.controller): adds wait to script injection so it works with chrome | platanus_crabfarm-gem | train | rb |
a74679c4d3bc295773cc7d0f0cbd78a488be2dca | diff --git a/app/controllers/user_import_files_controller.rb b/app/controllers/user_import_files_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/user_import_files_controller.rb
+++ b/app/controllers/user_import_files_controller.rb
@@ -57,6 +57,9 @@ class UserImportFilesController < ApplicationController
respond_to do |format|
if @user_import_file.save
+ if @user_import_file.mode == 'import'
+ Resque.enqueue(UserImportFileQueue, @user_import_file.id)
+ end
format.html { redirect_to @user_import_file, :notice => t('controller.successfully_created', :model => t('activerecord.models.user_import_file')) }
format.json { render :json => @user_import_file, :status => :created, :location => @user_import_file }
else | start import when a file is uploaded | next-l_enju_leaf | train | rb |
bddd06ceab0a2a72d68e26cce181048045f4a29b | diff --git a/misc/cron/archive.php b/misc/cron/archive.php
index <HASH>..<HASH> 100644
--- a/misc/cron/archive.php
+++ b/misc/cron/archive.php
@@ -110,6 +110,8 @@ class CronArchive
// Since weeks are not used in yearly archives, we make sure that all possible weeks are processed
const DEFAULT_DATE_LAST_WEEKS = 520;
+ const DEFAULT_DATE_LAST_YEARS = 2;
+
// Flag to know when the archive cron is calling the API
const PREPEND_TO_API_REQUEST = '&trigger=archivephp';
@@ -447,7 +449,12 @@ class CronArchive
*/
private function getVisitsRequestUrl($idsite, $period, $lastTimestampWebsiteProcessed = false)
{
- $dateLastMax = $period == 'week' ? self::DEFAULT_DATE_LAST_WEEKS : self::DEFAULT_DATE_LAST;
+ $dateLastMax = self::DEFAULT_DATE_LAST;
+ if($period=='year') {
+ $dateLastMax = self::DEFAULT_DATE_LAST_YEARS;
+ } elseif($period == 'week') {
+ $dateLastMax = self::DEFAULT_DATE_LAST_WEEKS;
+ }
if (empty($lastTimestampWebsiteProcessed)) {
$dateLast = $dateLastMax;
} else { | Trying to make yearly archiving less intense which may help fix the travis failure... | matomo-org_matomo | train | php |
31ca6dade4d5c9e961f0ee9dced599a04305abcc | diff --git a/lib/rest-core/event_source.rb b/lib/rest-core/event_source.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-core/event_source.rb
+++ b/lib/rest-core/event_source.rb
@@ -65,9 +65,10 @@ class RestCore::EventSource < Struct.new(:client, :path, :query, :opts,
else
begin
@onerror.call(error, sock) if @onerror
- onreconnect(error, sock) if closed?
- ensure
- condv.signal # should never deadlock someone
+ onreconnect(error, sock)
+ rescue
+ condv.signal # so we can't be reconnecting, need to try to unblock
+ raise
end
end
self
@@ -78,8 +79,10 @@ class RestCore::EventSource < Struct.new(:client, :path, :query, :opts,
def onreconnect error=nil, sock=nil, &cb
if block_given?
@onreconnect = cb
- elsif @onreconnect && @onreconnect.call(error, sock)
+ elsif closed? && @onreconnect && @onreconnect.call(error, sock)
reconnect
+ else
+ condv.signal # we could be closing, let's try to unblock it
end
self
end | properly signal so `wait' would work properly | godfat_rest-core | train | rb |
fee6efdd86b09ec86d9bc7529dc4d5ef11c39e65 | diff --git a/sigal/video.py b/sigal/video.py
index <HASH>..<HASH> 100644
--- a/sigal/video.py
+++ b/sigal/video.py
@@ -63,7 +63,7 @@ def check_subprocess(cmd, source, outname=None):
def video_size(source, converter='ffmpeg'):
"""Return the dimensions of the video."""
res = subprocess.run([converter, '-i', source], stderr=subprocess.PIPE)
- stderr = res.stderr.decode('utf8')
+ stderr = res.stderr.decode('utf8', errors='ignore')
pattern = re.compile(r'Stream.*Video.* ([0-9]+)x([0-9]+)')
match = pattern.search(stderr)
rot_pattern = re.compile(r'rotate\s*:\s*-?(90|270)') | Fix encoding issue with ffmpeg output (fix #<I>) | saimn_sigal | train | py |
978541d8c3a66236249b4c94da9fbd6c5946ae02 | diff --git a/packages/react/src/components/FileUploader/FileUploaderButton.js b/packages/react/src/components/FileUploader/FileUploaderButton.js
index <HASH>..<HASH> 100644
--- a/packages/react/src/components/FileUploader/FileUploaderButton.js
+++ b/packages/react/src/components/FileUploader/FileUploaderButton.js
@@ -79,12 +79,13 @@ function FileUploaderButton({
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
<label
tabIndex={disabled ? -1 : tabIndex || 0}
- aria-disabled={disabled}
className={classes}
onKeyDown={onKeyDown}
htmlFor={inputId}
{...other}>
- <span role={role}>{labelText}</span>
+ <span role={role} aria-disabled={disabled}>
+ {labelText}
+ </span>
</label>
<input
className={`${prefix}--visually-hidden`} | fix(FileUploader): aria disabled placed on button instead of label (#<I>)
* fix(FileUploader): button aria disabled
* fix: htmlfor placement | carbon-design-system_carbon-components | train | js |
d35673b0ff0d0764e5c4b66c1694a2ae760f8458 | diff --git a/example_project/urls.py b/example_project/urls.py
index <HASH>..<HASH> 100644
--- a/example_project/urls.py
+++ b/example_project/urls.py
@@ -4,7 +4,9 @@ from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
- (r'^activity/', include('actstream.urls')),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
+ (r'^comments/', include('django.contrib.comments.urls')),
+ (r'^accounts/', include('registration.backends.default.urls')),
+ (r'', include('actstream.urls')),
) | activities at base, added comments and accounts | justquick_django-activity-stream | train | py |
a78021ad76c7e8b48cc72ab0f32419d64b758521 | diff --git a/gosu-core/src/main/java/gw/internal/gosu/parser/FileSystemGosuClassRepository.java b/gosu-core/src/main/java/gw/internal/gosu/parser/FileSystemGosuClassRepository.java
index <HASH>..<HASH> 100644
--- a/gosu-core/src/main/java/gw/internal/gosu/parser/FileSystemGosuClassRepository.java
+++ b/gosu-core/src/main/java/gw/internal/gosu/parser/FileSystemGosuClassRepository.java
@@ -759,7 +759,7 @@ public class FileSystemGosuClassRepository implements IFileSystemGosuClassReposi
if( content == null ) {
Stream<String> lines = null;
try {
- if( _file.isJavaFile() ) {
+ if( _file.isJavaFile() && _classType != ClassType.JavaClass ) {
lines = Files.lines( _file.toJavaFile().toPath() );
}
else {
@@ -779,7 +779,7 @@ public class FileSystemGosuClassRepository implements IFileSystemGosuClassReposi
finally {
lines.close();
}
- _content = new SoftReference<>( content );
+ _content = _classType == ClassType.JavaClass ? new SoftReference<>( null ) : new SoftReference<>(content);
}
return content;
} | Don't cache Java files and always read them through the BufferReader | gosu-lang_gosu-lang | train | java |
eb52701396702a5fb722151acf0258801264cbfb | diff --git a/test/backend-connection.test.js b/test/backend-connection.test.js
index <HASH>..<HASH> 100644
--- a/test/backend-connection.test.js
+++ b/test/backend-connection.test.js
@@ -301,20 +301,14 @@ suite('Connection, basic features', function() {
callback.takes(Connection.ERROR_GATEWAY_TIMEOUT, null);
message = connection.emitMessage('testRequest', { command: 'foobar' }, callback, {
timeout: 1,
- delay: 1000
+ delay: 10
});
assert.envelopeEqual(message,
createExpectedEnvelope('testRequest', { command: 'foobar' }));
})
- .wait(0.01)
- .next(function() {
- assert.equal(backend.received.length, 1);
- assert.deepEqual(backend.received[0][2], message);
- assert.equal(connection.listeners('inReplyTo:' + message.id).length, 1);
-
- })
- .wait(0.01)
+ .wait(0.05)
.next(function() {
+ assert.equal(backend.received.length, 0);
assert.equal(connection.listeners('inReplyTo:' + message.id).length, 0);
callback.assert();
done(); | test: When the connection is timed out, no message should be sent | droonga_express-droonga | train | js |
b9d6663aebf1386231dffa296ee110596f627cec | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -76,7 +76,7 @@ BaseError.prototype = Object.create(Error.prototype, {
// -------------------------------------------------------------------
function makeError (constructor, super_) {
- if (!super_ || super_ === Error) {
+ if (super_ == null || super_ === Error) {
super_ = BaseError
} else if (typeof super_ !== 'function') {
throw new TypeError('super_ should be a function')
diff --git a/index.spec.js b/index.spec.js
index <HASH>..<HASH> 100644
--- a/index.spec.js
+++ b/index.spec.js
@@ -43,6 +43,15 @@ function splitLines (str) {
// ===================================================================
describe('makeError()', function () {
+ it('throws on invalid arguments', function () {
+ expect(function () {
+ makeError(42)
+ }).to.throw(TypeError)
+ expect(function () {
+ makeError('MyError', 42)
+ }).to.throw(TypeError)
+ })
+
it('creates a new error class', function () {
var constructorCalled | Better UX: throws on invalid arguments. | JsCommunity_make-error | train | js,js |
8057e3f8cbc7c34d9f2354c220dc78e4cb8649b8 | diff --git a/robotframework-faker/FakerLibrary/FakerLibrary.py b/robotframework-faker/FakerLibrary/FakerLibrary.py
index <HASH>..<HASH> 100644
--- a/robotframework-faker/FakerLibrary/FakerLibrary.py
+++ b/robotframework-faker/FakerLibrary/FakerLibrary.py
@@ -9,12 +9,14 @@ via FakerLibrary calls in Robot Framework.
class FakerLibrary(object):
- def __init__(self, **kwargs):
+
+ def __new__(cls, *args, **kwargs):
# create our faker
- self._fake = faker.Factory.create(**kwargs)
+ cls._fake = faker.Factory.create(**kwargs)
# set all of the faker's public methods to be our methods
- for method_name, method in self._fake.__dict__.items():
+ for method_name, method in cls._fake.__dict__.items():
if not method_name[0] == '_':
- setattr(self, method_name, method)
+ setattr(cls, method_name, method)
+ | Set up faker methods in __new__ instead of __init__ | guykisel_robotframework-faker | train | py |
fcaa6d5f692b0f2aad616e80f342a1da590b4570 | diff --git a/EventListener/LoginListener.php b/EventListener/LoginListener.php
index <HASH>..<HASH> 100755
--- a/EventListener/LoginListener.php
+++ b/EventListener/LoginListener.php
@@ -74,7 +74,7 @@ class LoginListener
public function setLocale(GetResponseEvent $event)
{
// Execute only if the user is logged in.
- if( $this->tokenStorage->getToken() && $this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED') ){
+ if( $this->tokenStorage->getToken() && $this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED') && $this->tokenStorage->getToken()->getUser() ){
// authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return; | add the check for the user object, as for the API endpoints there are
no user contexts | CampaignChain_core | train | php |
1a2360571cdedea4b800bffac2a50fea161ccd0d | diff --git a/integration_test.go b/integration_test.go
index <HASH>..<HASH> 100644
--- a/integration_test.go
+++ b/integration_test.go
@@ -839,6 +839,25 @@ func TestIntegrationConfirm(t *testing.T) {
}
}
+// Declares a queue with the x-message-ttl extension to exercise integer
+// serialization.
+//
+// Relates to https://github.com/streadway/amqp/issues/60
+//
+func TestDeclareArgsXMessageTTL(t *testing.T) {
+ if conn := integrationConnection(t, "declareTTL"); conn != nil {
+ defer conn.Close()
+
+ ch, _ := conn.Channel()
+ args := Table{"x-message-ttl": int32(9000000)}
+
+ // should not drop the connection
+ if _, err := ch.QueueDeclare("declareWithTTL", false, true, false, false, args); err != nil {
+ t.Fatalf("cannot declare with TTL: got: %v", err)
+ }
+ }
+}
+
// Sets up the topology where rejected messages will be forwarded
// to a fanout exchange, with a single queue bound.
// | Show that int<I> for x-message-ttl arguments works
Declaring with uint<I> for the x-message-ttl argument will cause a
connection reset with rabbitmq-server <I>
Relates to #<I> | streadway_amqp | train | go |
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.