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
e6bc013e735cc1db33c7c345e31de7b23ca20ced
diff --git a/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java b/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java index <HASH>..<HASH> 100644 --- a/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java +++ b/preferencesfx/src/main/java/com/dlsc/preferencesfx/PreferencesFx.java @@ -249,7 +249,12 @@ public class PreferencesFx { return new PreferencesFxView(preferencesFxModel, navigationView, breadCrumbView, categoryController); } - public PreferencesFxModel getPreferencesFxModel() { - return preferencesFxModel; + public void saveSettings(){ + preferencesFxModel.saveSettings(); } + + public void discardChanges(){ + preferencesFxModel.discardChanges(); + } + }
delegate saveSettings and discardChanges
dlemmermann_PreferencesFX
train
java
3db84e457a3ce6747867943131ed38a293911c87
diff --git a/iis/datadog_checks/iis/iis.py b/iis/datadog_checks/iis/iis.py index <HASH>..<HASH> 100644 --- a/iis/datadog_checks/iis/iis.py +++ b/iis/datadog_checks/iis/iis.py @@ -93,6 +93,13 @@ class IIS(PDHBaseCheck): # Collect all if not selected and self._sites ): + self.log.debug( + "Skipping site metric %s: single instance: %s, site name: %s, counter: %s", + dd_name, + str(is_single_instance), + site_name, + str(counter), + ) continue tags = self._get_tags(namespace, site_name, is_single_instance) @@ -122,6 +129,13 @@ class IIS(PDHBaseCheck): # Collect all if not selected and self._app_pools ): + self.log.debug( + "Skipping app pool metric %s: single instance: %s, site name: %s, counter: %s", + dd_name, + str(is_single_instance), + app_pool_name, + str(counter), + ) continue tags = self._get_tags(namespace, app_pool_name, is_single_instance)
Add debug lines on skipped metrics (#<I>) * Add debug lines on skipped metrics
DataDog_integrations-core
train
py
d042a5d99bd59ab1e665c9bf8f8ed559439ebc59
diff --git a/lib/kindle_manager/adapters/base_adapter.rb b/lib/kindle_manager/adapters/base_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/kindle_manager/adapters/base_adapter.rb +++ b/lib/kindle_manager/adapters/base_adapter.rb @@ -2,7 +2,7 @@ module KindleManager class BaseAdapter include AmazonAuth::CommonExtension - attr_accessor :store, :session + attr_accessor :store, :session, :options def initialize(options) @options = options
Expose options of adapters to accept manual changes
kyamaguchi_kindle_manager
train
rb
ba90198a417fe095f8e05435d765f404fd2d25d9
diff --git a/lib/openscap/openscap.rb b/lib/openscap/openscap.rb index <HASH>..<HASH> 100644 --- a/lib/openscap/openscap.rb +++ b/lib/openscap/openscap.rb @@ -13,7 +13,7 @@ require 'ffi' module OpenSCAP extend FFI::Library - ffi_lib 'openscap' + ffi_lib ['libopenscap.so.8', 'openscap'] def self.error? return oscap_err()
Allow alternative libraries selection (do not depend on openscap-devel sub-package).
OpenSCAP_ruby-openscap
train
rb
5ef6297daa0de85dd2e0017dea2b6c2785ac2dbf
diff --git a/integration/consul_catalog_test.go b/integration/consul_catalog_test.go index <HASH>..<HASH> 100644 --- a/integration/consul_catalog_test.go +++ b/integration/consul_catalog_test.go @@ -482,10 +482,10 @@ func (s *ConsulCatalogSuite) TestSameServiceIDOnDifferentConsulAgent(c *check.C) s.composeProject.Container(c, "whoami2").NetworkSettings.IPAddress)) c.Assert(err, checker.IsNil) - err = s.deregisterService("whoami1", false) + err = s.deregisterService("whoami", false) c.Assert(err, checker.IsNil) - err = s.deregisterService("whoami2", true) + err = s.deregisterService("whoami", true) c.Assert(err, checker.IsNil) }
Fixed typo in consul catalog tests.
containous_traefik
train
go
4a794a327bbaec27a1c8fb5a554e6252d41c4542
diff --git a/lib/isono/node_modules/data_store.rb b/lib/isono/node_modules/data_store.rb index <HASH>..<HASH> 100644 --- a/lib/isono/node_modules/data_store.rb +++ b/lib/isono/node_modules/data_store.rb @@ -51,6 +51,15 @@ module Isono @db_writer_thread.shutdown @db.disconnect end + + # Runs RpcChannel::Dispatcher in the thread context of DataStore's worker. + class RpcDispatcher < RpcChannel::Dispatcher::Decorator + def dispatch(resctx, key, args) + DataStore.pass { + dispatcher.dispatch(resctx, key, args) + } + end + end end end
add rpc dispatcher to maintain database transaction within single request.
axsh_isono
train
rb
38d69f82a0d6e46cdc0f0e3834b7937a8efd38a3
diff --git a/scraperwiki/sql.py b/scraperwiki/sql.py index <HASH>..<HASH> 100644 --- a/scraperwiki/sql.py +++ b/scraperwiki/sql.py @@ -35,7 +35,7 @@ PYTHON_SQLITE_TYPE_MAP = { datetime.date: sqlalchemy.types.Date, datetime.datetime: sqlalchemy.types.DateTime, - Blob: sqlalchemy.types.LargeBinary + Blob: sqlalchemy.types.LargeBinary, }
add serial comma to please my OCD
scraperwiki_scraperwiki-python
train
py
0310a963b15e4aa965087d1272555e22572ae626
diff --git a/nomad/plan_apply.go b/nomad/plan_apply.go index <HASH>..<HASH> 100644 --- a/nomad/plan_apply.go +++ b/nomad/plan_apply.go @@ -486,7 +486,8 @@ func evaluatePlanPlacements(pool *EvaluatePool, snap *state.StateSnapshot, plan //monitor the disagreement between workers and //the plan applier. logger.Info("plan for node rejected, refer to https://www.nomadproject.io/s/port-plan-failure for more information", - "node_id", nodeID, "reason", reason, "eval_id", plan.EvalID) + "node_id", nodeID, "reason", reason, "eval_id", plan.EvalID, + "namespace", plan.Job.Namespace) } // Set that this is a partial commit partialCommit = true
core: add namespace to plan for node rejected log line. (#<I>)
hashicorp_nomad
train
go
7ada49e85feb6cee42a6fb203b872981bedf1417
diff --git a/lib/sinatra/irb.rb b/lib/sinatra/irb.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/irb.rb +++ b/lib/sinatra/irb.rb @@ -11,6 +11,18 @@ module Sinatra def reload! Loader.reload! end + + def show!(editor = nil) + editor = editor || ENV['EDITOR'] + IO.popen(editor, 'w') do |f| + f.puts "<!--" + f.puts result_info + f.puts "-->" + f.puts + f.puts body + end + end + alias :mate :show! end ARGV.clear # Avoid passing args to IRB diff --git a/lib/sinatra/test_methods.rb b/lib/sinatra/test_methods.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/test_methods.rb +++ b/lib/sinatra/test_methods.rb @@ -13,19 +13,7 @@ module Sinatra end end_eval end - - def show!(editor = nil) - editor = editor || ENV['EDITOR'] - IO.popen(editor, 'w') do |f| - f.puts "<!--" - f.puts result_info - f.puts "-->" - f.puts - f.puts body - end - end - alias :mate :show! - + def result_info info = <<-end_info # Status: #{status}
ERR: Irb only methods belong in irb only.
sinatra_sinatra
train
rb,rb
60a6284a461afda5911ecadf3a147d4da6ed5d22
diff --git a/activerecord/test/cases/pooled_connections_test.rb b/activerecord/test/cases/pooled_connections_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/pooled_connections_test.rb +++ b/activerecord/test/cases/pooled_connections_test.rb @@ -103,7 +103,7 @@ class PooledConnectionsTest < ActiveRecord::TestCase add_record('two') # Have another thread try to screw up the transaction Thread.new do - raise ActiveRecord::Rollback + ActiveRecord::Base.connection.rollback_db_transaction ActiveRecord::Base.connection_pool.release_connection end.join rescue nil add_record('three')
Tests should use ActiveRecord::Base.connection.rollback_db_transaction to rollback a transaction
rails_rails
train
rb
3ddae524a7974cd0a01709ea2abec4741ae258ec
diff --git a/templates/edit.php b/templates/edit.php index <HASH>..<HASH> 100644 --- a/templates/edit.php +++ b/templates/edit.php @@ -7,7 +7,7 @@ */ ?> <form method="post" class="form-horizontal"> - <input type="hidden" name="token" value="<?php echo $this->prop('token'); ?>"> + <input type="hidden" name="token" value="<?php echo $_token; ?>"> <div class="panel panel-default"> <div class="panel-body"> <div class="form-group<?php echo $this->error('content', ' has-error'); ?>">
Replace $this->prop('token') with $_token var
gplcart_editor
train
php
ea435fe2fef4465d2923c4dfb3e16235464fb6e4
diff --git a/question/qengine.js b/question/qengine.js index <HASH>..<HASH> 100644 --- a/question/qengine.js +++ b/question/qengine.js @@ -5,12 +5,17 @@ question_flag_changer = { flag_state_listeners: new Object(), init_flag: function(checkboxid, postdata) { - // Convert the checkbox to a hidden input. - var input = document.getElementById(checkboxid); - var state = input.checked; - input.ajaxpostdata = postdata; - input.value = state ? 1 : 0; + // Create a hidden input - you can't just repurpose the old checkbox, IE + // does not cope - and put it in place of the checkbox. + var checkbox = document.getElementById(checkboxid); + var input = document.createElement('input'); input.type = 'hidden'; + checkbox.parentNode.appendChild(input); + checkbox.parentNode.removeChild(checkbox); + input.id = checkbox.id; + input.name = checkbox.name; + input.value = checkbox.checked ? 1 : 0; + input.ajaxpostdata = postdata; // Create an image input to replace the img tag. var image = document.createElement('input'); @@ -19,7 +24,7 @@ question_flag_changer = { question_flag_changer.update_image(image); input.parentNode.appendChild(image); - // Remove the label element. + // Remove the label. var label = document.getElementById(checkboxid + 'label'); label.parentNode.removeChild(label);
JS does not work in IE. Grrrr!
moodle_moodle
train
js
1387c9f08b57896e2beaf43a056497b6eedb508a
diff --git a/src/java/com/threerings/util/DirectionUtil.java b/src/java/com/threerings/util/DirectionUtil.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/util/DirectionUtil.java +++ b/src/java/com/threerings/util/DirectionUtil.java @@ -1,5 +1,5 @@ // -// $Id: DirectionUtil.java,v 1.9 2003/05/07 19:41:57 ray Exp $ +// $Id: DirectionUtil.java,v 1.10 2003/05/07 19:47:02 ray Exp $ package com.threerings.util; @@ -196,8 +196,8 @@ public class DirectionUtil implements DirectionCodes } /** - * Move the specified point the specified number of logical - * pixels in the specified direction. Fine coordinates are + * Move the specified point in the specified screen direction, + * adjusting by the specified adjustments. Fine directions are * not supported. */ public static void moveDirection (Point p, int direction, int dx, int dy)
Clarified documentation somewhat. It's too hot today. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
58789a441188128f67329c35068779074107c5c1
diff --git a/comparators/path_road_changed.js b/comparators/path_road_changed.js index <HASH>..<HASH> 100644 --- a/comparators/path_road_changed.js +++ b/comparators/path_road_changed.js @@ -4,9 +4,7 @@ var PATH_ROAD_TYPES = [ 'pedestrian', 'footway', - 'cycleway', - 'track', - 'path' + 'cycleway' ]; function getHighwayType(feature) {
remove path and track from minor road comparator
mapbox_osm-compare
train
js
6f221a9f7d1bc644a6405749a50689bff351b00d
diff --git a/src/selectize.jquery.js b/src/selectize.jquery.js index <HASH>..<HASH> 100644 --- a/src/selectize.jquery.js +++ b/src/selectize.jquery.js @@ -23,10 +23,12 @@ $.fn.selectize = function(settings_user) { if (!data_raw) { var value = $.trim($input.val() || ''); if (!settings.allowEmptyOption && !value.length) return; - values = value.split(settings.delimiter); + var regexStr = '(".*?"|[^"' + settings.delimiter + '\s]+)(?=\s*' + settings.delimiter + '|\s*$)' + var regExDelimiter = new RegExp(regexStr,'g'); + values = value.match(regExDelimiter); for (i = 0, n = values.length; i < n; i++) { option = {}; - option[field_label] = values[i]; + option[field_label] = values[i].replace(/"/g,''); option[field_value] = values[i]; settings_element.options.push(option); }
added support to ignore delimiter inside double quotes on population from default values
selectize_selectize.js
train
js
b96f0a89e9db3fb2abecdf9e5a2fa46d79ae8b6e
diff --git a/tools/depsgen/globcmd.go b/tools/depsgen/globcmd.go index <HASH>..<HASH> 100644 --- a/tools/depsgen/globcmd.go +++ b/tools/depsgen/globcmd.go @@ -28,7 +28,10 @@ const ( globCmd = "glob" // globMakeFunction is a template for generating all files for // given set of wildcards. See globMakeWildcard. - globMakeFunction = `$(shell stat --format "%n: %F" !!!WILDCARDS!!! | grep -e 'regular file$$' | cut -f1 -d:)` + globMakeFunction = `$(strip \ + $(eval _DEPS_GEN_FG_ := $(strip !!!WILDCARDS!!!)) \ + $(if $(_DEPS_GEN_FG_),$(shell stat --format "%n: %F" $(_DEPS_GEN_FG_) | grep -e 'regular file$$' | cut -f1 -d:))) +` // globMakeWildcard is a template for call wildcard function // for in a given directory with a given suffix. This wildcard // is for normal files.
build: Fix the stat invocation error Sometimes wildcards may return an empty value - in this case we should not even try to call stat.
rkt_rkt
train
go
7cc7a0eb6ebe4fe70bf7535ead995f56b61c2639
diff --git a/src/ServiceManager.php b/src/ServiceManager.php index <HASH>..<HASH> 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -454,11 +454,7 @@ class ServiceManager implements ServiceLocatorInterface if (! empty($config['lazy_services'])) { $this->lazyServices = $config['lazy_services'] + $this->lazyServices; } - // @todo: Should that not be forbidden if allowOverride is false - // and the shareability of existing services is affected? - // To handle that case explicitely would be pro forma only - // (i.e. effort for nothing, but possibly better readability), because - // existing shared services remain shared regardless of this setting. + if (isset($config['shared_by_default'])) { $this->sharedByDefault = $config['shared_by_default']; }
It is a waste of time and effort to explicitely handle changes to sharedByDefault when allowOverride is false, because sharedServices remain shared anyway.
mxc-commons_mxc-servicemanager
train
php
576091f6eb714e1e5b9299da010c136dc7795c67
diff --git a/src/js/components/SkipLinks.js b/src/js/components/SkipLinks.js index <HASH>..<HASH> 100644 --- a/src/js/components/SkipLinks.js +++ b/src/js/components/SkipLinks.js @@ -26,6 +26,8 @@ export default class SkipLinks extends Component { KeyboardAccelerators.startListeningToKeyboard( this, this._keyboardHandlers ); + + document.addEventListener('DOMNodeInserted', this._updateAnchors); } componentWillReceiveProps () { @@ -42,6 +44,7 @@ export default class SkipLinks extends Component { KeyboardAccelerators.stopListeningToKeyboard( this, this._keyboardHandlers ); + document.removeEventListener('DOMNodeInserted', this._updateAnchors); } _updateAnchors () {
Fixed issue with missing skiplink on async loading.
grommet_grommet
train
js
59c6fe1b75922c4937e2a9078fcd8244631b04fa
diff --git a/app/actions/prottable.py b/app/actions/prottable.py index <HASH>..<HASH> 100644 --- a/app/actions/prottable.py +++ b/app/actions/prottable.py @@ -81,9 +81,25 @@ def get_header_with_proteindata(header): return header[:ix] + new_data + header[ix:] -def get_header_with_precursorarea(header): +def get_header_with_precursorarea(header, fns=False): ix = header.index(prottabledata.HEADER_PROTEIN) + 1 - return header[:ix] + [prottabledata.HEADER_AREA] + header[ix:] + if fns: + quant_fields = [build_quantchan_header_field(fn[0], prottabledata.HEADER_AREA) for fn in fns] + else: + quant_fields = [prottabledata.HEADER_AREA] + return header[:ix] + quant_fields + header[ix:] + + +def get_isobaric_quant(protein): + quantheadfield = build_quantchan_header_field(protein[2], protein[1]) + amntpsm_headfld = build_quantchan_header_field(protein[2], protein[3]) + return {quantheadfield: protein[4], amntpsm_headfld: protein[5]} + + +def get_precursor_quant(protein): + quantheadfield = build_quantchan_header_field(protein[-2], + prottabledata.HEADER_AREA) + return {quantheadfield: protein[-1]} def build_quanted_proteintable(pqdb, header, isobaric=False, precursor=False):
Methods to create a headerfield/quant value combination (and some header stuff)
glormph_msstitch
train
py
cb4bdd31c8eeac2f8ac174c636de7b068d38c781
diff --git a/lib/jsonapi/resource.rb b/lib/jsonapi/resource.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/resource.rb +++ b/lib/jsonapi/resource.rb @@ -520,6 +520,8 @@ module JSONAPI end def construct_order_options(sort_params) + return {} unless sort_params + sort_params.each_with_object({}) { |sort, order_hash| field = sort[:field] == 'id' ? _primary_key : sort[:field] order_hash[field] = sort[:direction]
Handle the case where sort params are omitted.
cerebris_jsonapi-resources
train
rb
8d3b543f83097593f6ccb285815810500d2f0af6
diff --git a/src/Illuminate/Support/MessageBag.php b/src/Illuminate/Support/MessageBag.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Support/MessageBag.php +++ b/src/Illuminate/Support/MessageBag.php @@ -105,6 +105,10 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me */ public function has($key) { + if ($this->isEmpty()) { + return false; + } + if (is_null($key)) { return $this->any(); } @@ -128,6 +132,10 @@ class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, Me */ public function hasAny($keys = []) { + if ($this->isEmpty()) { + return false; + } + $keys = is_array($keys) ? $keys : func_get_args(); foreach ($keys as $key) {
Check if MessageBag is empty before checking keys exist
laravel_framework
train
php
9b04c93ffe0b85923261b3c8ee9a8dd50924e9d2
diff --git a/src/pythonjsonlogger/jsonlogger.py b/src/pythonjsonlogger/jsonlogger.py index <HASH>..<HASH> 100644 --- a/src/pythonjsonlogger/jsonlogger.py +++ b/src/pythonjsonlogger/jsonlogger.py @@ -134,7 +134,7 @@ class JsonFormatter(logging.Formatter): return fn_as_str path, _, function = fn_as_str.rpartition('.') - module = importlib.import_module('.'.join(path)) + module = importlib.import_module(path) return getattr(module, function) def parse(self):
Fix bug from when .split() was used
madzak_python-json-logger
train
py
d85556a46a92bb4eaa1e629dde1fefd6378dc581
diff --git a/packages/core/parcel-bundler/src/HMRServer.js b/packages/core/parcel-bundler/src/HMRServer.js index <HASH>..<HASH> 100644 --- a/packages/core/parcel-bundler/src/HMRServer.js +++ b/packages/core/parcel-bundler/src/HMRServer.js @@ -81,11 +81,11 @@ class HMRServer { } handleSocketError(err) { - if (err.code === 'ECONNRESET') { + if (err.error.code === 'ECONNRESET') { // This gets triggered on page refresh, ignore this return; } - logger.log(err); + logger.warn(err); } broadcast(msg) {
Update HMRServer handleSocketError for ErrorEvent (#<I>)
parcel-bundler_parcel
train
js
5c781c0a4b3cbd43cd340606fc5fb889067294e1
diff --git a/alerta/views/users.py b/alerta/views/users.py index <HASH>..<HASH> 100644 --- a/alerta/views/users.py +++ b/alerta/views/users.py @@ -6,8 +6,7 @@ from flask_cors import cross_origin from alerta.app import qb from alerta.auth.decorators import permission -from alerta.auth.utils import (create_token, get_customers, not_authorized, - send_confirmation) +from alerta.auth.utils import create_token, get_customers, not_authorized from alerta.exceptions import ApiError from alerta.models.user import User from alerta.utils.api import jsonp @@ -39,9 +38,7 @@ def create_user(): # if email verification is enforced, deny login and send email if current_app.config['EMAIL_VERIFICATION'] and not user.email_verified: - hash = str(uuid4()) - send_confirmation(user) - user.set_email_hash(hash) + user.send_confirmation() raise ApiError('email not verified', 401) # check user is active
Fix send confirmation bug again (#<I>)
alerta_alerta
train
py
c4b770f3053a8a9794c5916281fc0517a590b0fa
diff --git a/internal/db/issue.go b/internal/db/issue.go index <HASH>..<HASH> 100644 --- a/internal/db/issue.go +++ b/internal/db/issue.go @@ -315,9 +315,7 @@ func (issue *Issue) clearLabels(e *xorm.Session) (err error) { // NOTE: issue.removeLabel slices issue.Labels, so we need to create another slice to be unaffected. labels := make([]*Label, len(issue.Labels)) - for i := range issue.Labels { - labels[i] = issue.Labels[i] - } + copy(labels, issue.Labels) for i := range labels { if err = issue.removeLabel(e, labels[i]); err != nil { return fmt.Errorf("removeLabel: %v", err) diff --git a/internal/form/form.go b/internal/form/form.go index <HASH>..<HASH> 100644 --- a/internal/form/form.go +++ b/internal/form/form.go @@ -99,11 +99,8 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro Assign(f, data) typ := reflect.TypeOf(f) - val := reflect.ValueOf(f) - if typ.Kind() == reflect.Ptr { typ = typ.Elem() - val = val.Elem() } for i := 0; i < typ.NumField(); i++ {
chore: fix lint errors (#<I>)
gogs_gogs
train
go,go
10ae00ab9d6ec2cfe66fcec5bc964dc9dbca50a6
diff --git a/web/web.go b/web/web.go index <HASH>..<HASH> 100644 --- a/web/web.go +++ b/web/web.go @@ -695,8 +695,12 @@ func (h *Handler) targets(w http.ResponseWriter, r *http.Request) { tps := h.scrapeManager.TargetsActive() for _, targets := range tps { sort.Slice(targets, func(i, j int) bool { - return targets[i].Labels().Get(model.JobLabel) < targets[j].Labels().Get(model.JobLabel) || - targets[i].Labels().Get(model.InstanceLabel) < targets[j].Labels().Get(model.InstanceLabel) + iJobLabel := targets[i].Labels().Get(model.JobLabel) + jJobLabel := targets[j].Labels().Get(model.JobLabel) + if iJobLabel == jJobLabel { + return targets[i].Labels().Get(model.InstanceLabel) < targets[j].Labels().Get(model.InstanceLabel) + } + return iJobLabel < jJobLabel }) }
Fix bug from #<I> (#<I>)
prometheus_prometheus
train
go
5c92d1b04c5123679b48778b53e4483dc27b50ac
diff --git a/js/kraken.js b/js/kraken.js index <HASH>..<HASH> 100644 --- a/js/kraken.js +++ b/js/kraken.js @@ -339,7 +339,7 @@ module.exports = class kraken extends Exchange { 'price': this.safeInteger (market, 'pair_decimals'), }; const minAmount = this.safeNumber (market, 'ordermin'); - const leverage_buy = this.safeValue (market, 'leverage_buy'); + const leverage_buy = this.safeValue (market, 'leverage_buy', [1]); result.push ({ 'id': id, 'symbol': symbol, @@ -369,7 +369,7 @@ module.exports = class kraken extends Exchange { }, 'leverage': { 'min': 1, - 'max': Math.max.apply ([1], leverage_buy), + 'max': Math.max (1, this.maxInArray (leverage_buy)), }, }, });
Fix kraken maxInArray issue
ccxt_ccxt
train
js
6ec7eeae33d9a4fb9df8129a93c850f92bb827e7
diff --git a/ghost/members-api/lib/stripe/index.js b/ghost/members-api/lib/stripe/index.js index <HASH>..<HASH> 100644 --- a/ghost/members-api/lib/stripe/index.js +++ b/ghost/members-api/lib/stripe/index.js @@ -34,6 +34,7 @@ module.exports = class StripePaymentProcessor { this._checkoutCancelUrl = config.checkoutCancelUrl; this._billingSuccessUrl = config.billingSuccessUrl; this._billingCancelUrl = config.billingCancelUrl; + this._enablePromoCodes = config.enablePromoCodes; try { this._product = await api.products.ensure(this._stripe, config.product); @@ -192,6 +193,7 @@ module.exports = class StripePaymentProcessor { cancel_url: options.cancelUrl || this._checkoutCancelUrl, customer: customer ? customer.id : undefined, customer_email: customerEmail, + allow_promotion_codes: this._enablePromoCodes, metadata, subscription_data: { trial_from_plan: true,
Added support for promo codes in Stripe Checkout (#<I>) no-issue This commit adds support for Stripe's newly-added promotional code parameter when creating a new Stripe Checkout session. ref: <URL>
TryGhost_Ghost
train
js
1ea8edd8081d88d06de9b415badc23b5247c2453
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,7 +5,7 @@ require 'securerandom' require 'socket' require 'minitest/autorun' -require 'mocha/mini_test' +require 'mocha/minitest' class BaseTest < Minitest::Test UNIX_SOCKET_NAME = File.join('/tmp', 'memcached')
Fix require of renamed mocha minitest integration file
arthurnn_memcached
train
rb
73228a262bb96d196f71aecfd89b36e0488e8423
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100755 --- a/src/index.js +++ b/src/index.js @@ -91,6 +91,10 @@ export const loadScript = function (id) { }) } +const isTrackable = (name) => { + return !(config.excludes.length && config.excludes.indexOf(name) !== -1) +} + /** * Vue installer * @param {Vue instance} Vue @@ -110,11 +114,22 @@ const install = function (Vue, options = {}) { Vue.track = Vue.ga = { event, page } Vue.prototype.$track = Vue.prototype.$ga = { event, page } - if (router) { - const { excludes } = config + // I don't like timeouts but apparently the currentRoute is not fully available yet + // so need to wait the famous 0 second. + // @todo: find a better way + setTimeout(() => { + const route = router.currentRoute + if (!isTrackable(route.name)) { + return + } + + Vue.track.page(route.path, route.name, window.location.href) + }, 0) + + if (router) { router.afterEach(({ path, name }) => { - if (excludes.length && excludes.indexOf(name) !== -1) { + if (!isTrackable(name)) { return }
feat(track): track first page loaded
MatteoGabriele_vue-analytics
train
js
89129fcf5d21d596cba726687b4b05202efe16c2
diff --git a/lib/graphql/relay/connection_resolve.rb b/lib/graphql/relay/connection_resolve.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/relay/connection_resolve.rb +++ b/lib/graphql/relay/connection_resolve.rb @@ -10,7 +10,7 @@ module GraphQL def call(obj, args, ctx) nodes = @underlying_resolve.call(obj, args, ctx) connection_class = GraphQL::Relay::BaseConnection.connection_for_nodes(nodes) - connection_class.new(nodes, args, max_page_size: @max_page_size, parent: obj) + connection_class.new(nodes, args, max_page_size: @max_page_size, field_name: @field_name, parent: obj) end end end
Pass `field_name` to `connection_class` resolver
rmosolgo_graphql-ruby
train
rb
5658e1a2f91ee693177dae2606131166a3ca4b20
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ setup( 'sqlalchemy >= 1.0.15, <= 1.1.4', 'geoalchemy2 >= 0.3.0, <=0.4.0', 'matplotlib >= 1.5.3, <=1.5.3', + 'tsam==0.9.9', 'shapely'], dependency_links=['git+https://github.com/openego/PyPSA.git@75b81175576e7b3472a6fc95c8842dd42d16954c#egg=pypsa-0.11.0fork'], extras_require={
Adapt setup.py with tsam pypi package and test functionality.
openego_eTraGo
train
py
751a8bc4c713042113ed6f9f45cf0453d65749d7
diff --git a/src/Compiler.php b/src/Compiler.php index <HASH>..<HASH> 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -1359,6 +1359,7 @@ class Compiler // after evaluating interpolates, we might need a second pass if ($this->shouldEvaluate) { + $selectors = $this->revertSelfSelector($selectors); $buffer = $this->collapseSelectors($selectors); $parser = $this->parserFactory(__METHOD__); @@ -1441,6 +1442,24 @@ class Compiler } /** + * Parse down the selector and revert [self] to "&" before a reparsing + * @param array $selectors + * @return array + */ + protected function revertSelfSelector($selectors) { + foreach ($selectors as &$part) { + if (is_array($part)) { + if ($part === [Type::T_SELF]) { + $part = '&'; + } else { + $part = $this->revertSelfSelector($part); + } + } + } + return $selectors; + } + + /** * Flatten selector single; joins together .classes and #ids * * @param array $single
Before reparsing a selector that need a double pass, you should revert [self] to & <URL>
leafo_scssphp
train
php
73e0a9ce50fd7a58c0ba4075e1b320d4bbc4923b
diff --git a/test/LineGraphCanvasItem_test.py b/test/LineGraphCanvasItem_test.py index <HASH>..<HASH> 100644 --- a/test/LineGraphCanvasItem_test.py +++ b/test/LineGraphCanvasItem_test.py @@ -30,10 +30,10 @@ class TestLineGraphCanvasItem(unittest.TestCase): for data_in, data_out in test_ranges: data_min, data_max = data_in expected_drawn_data_min, expected_drawn_data_max = data_out - drawn_data_min, drawn_data_max = LineGraphCanvasItem.get_drawn_data_limits(data_min, data_max) + drawn_data_min, drawn_data_max = LineGraphCanvasItem.get_drawn_data_limits(data_min, data_max, min_specified=False, max_specified=True) self.assertEqual(drawn_data_min, expected_drawn_data_min) self.assertEqual(drawn_data_max, expected_drawn_data_max) - drawn_data_min, drawn_data_max = LineGraphCanvasItem.get_drawn_data_limits(-data_min, -data_max) + drawn_data_min, drawn_data_max = LineGraphCanvasItem.get_drawn_data_limits(-data_min, -data_max, min_specified=True, max_specified=False) self.assertEqual(drawn_data_min, -expected_drawn_data_max) self.assertEqual(drawn_data_max, -expected_drawn_data_min)
Fix line graph test. svn r<I>
nion-software_nionswift
train
py
b9ab878dd8ade83048f52a23e8eddf8bf54b9d8b
diff --git a/future/utils/__init__.py b/future/utils/__init__.py index <HASH>..<HASH> 100644 --- a/future/utils/__init__.py +++ b/future/utils/__init__.py @@ -422,12 +422,16 @@ else: # exec(execstr, myglobals, mylocals) else: e = exc + e.__suppress_context__ = False if isinstance(cause, type) and issubclass(cause, Exception): e.__cause__ = cause() + e.__suppress_context__ = True elif cause is None: e.__cause__ = None + e.__suppress_context__ = True elif isinstance(cause, BaseException): e.__cause__ = cause + e.__suppress_context__ = True else: raise TypeError("exception causes must derive from BaseException") e.__context__ = sys.exc_info()[1]
raise_from(): set __suppress_context__ correctly as per PEP <I>.
PythonCharmers_python-future
train
py
2e294617b655987652b44f36fb7e48652e8d8829
diff --git a/lib/fastlane_core/simulator.rb b/lib/fastlane_core/simulator.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane_core/simulator.rb +++ b/lib/fastlane_core/simulator.rb @@ -10,7 +10,17 @@ module FastlaneCore @devices = [] os_type = 'unknown' os_version = 'unknown' - `xcrun simctl list devices`.split(/\n/).each do |line| + output = '' + Open3.popen3('xcrun simctl list devices') do |stdin, stdout, stderr, wait_thr| + output = stdout.read + end + + unless output.include?("== Devices ==") + Helper.log.error "xcrun simctl CLI broken, run `xcrun simctl list devices` and make sure it works".red + raise "xcrun simctl not working.".red + end + + output.split(/\n/).each do |line| next if line.match(/^== /) if line.match(/^-- /) (os_type, os_version) = line.gsub(/-- (.*) --/, '\1').split
Added error handling for when xcrun fails
fastlane_fastlane
train
rb
593609689956c9363bb6d358178ecc062083db48
diff --git a/nailgun/entities.py b/nailgun/entities.py index <HASH>..<HASH> 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -5539,7 +5539,7 @@ class Subscription( response, self._server_config, synchronous, - timeout=900, + timeout=1500, ) def manifest_history(self, synchronous=True, **kwargs): @@ -5594,7 +5594,7 @@ class Subscription( response, self._server_config, synchronous, - timeout=900, + timeout=1500, ) def upload(self, synchronous=True, **kwargs): @@ -5626,7 +5626,7 @@ class Subscription( response, self._server_config, synchronous, - timeout=900, + timeout=1500, )
Increase manifest functions timeout (#<I>)
SatelliteQE_nailgun
train
py
4d3621d524aee62830810f7a7e52205fac9cc7c4
diff --git a/lib/xml-stream.js b/lib/xml-stream.js index <HASH>..<HASH> 100644 --- a/lib/xml-stream.js +++ b/lib/xml-stream.js @@ -490,7 +490,7 @@ function parse() { preludeBuffers.push(data); prelude += data.toString(); if (/^\s*<[^>]+>/.test(prelude)) { - var matches = prelude.match(/^\s*<\?xml[^>]+encoding="(.*)"[^>]*\?>/); + var matches = prelude.match(/^\s*<\?xml[^>]+encoding="(.+)"[^>]*\?>/); self._encoding = matches ? matches[1] : 'utf8'; self._encoder = makeEncoder(self._encoding); for (var i = 0, n = preludeBuffers.length; i < n; i++) {
Expect encoding from XML declaration to have at least one symbol in its name
assistunion_xml-stream
train
js
bd8c8d539f8d1b8cb4493bcba902c83bf9a979bf
diff --git a/lib/transformers/ng.routing.transformer.js b/lib/transformers/ng.routing.transformer.js index <HASH>..<HASH> 100644 --- a/lib/transformers/ng.routing.transformer.js +++ b/lib/transformers/ng.routing.transformer.js @@ -51,6 +51,11 @@ function getResolveHandlers(appName, routes, options) { var me = this; _.each(routes, function (route) { + + // if no route name, don't do anything + if (!route.name) { return; } + + // else generate the UI part based on the name var uipart = me.getUIPart(appName, route); // if there is no model return without doing anything
Allowing routes without names for redirects
gethuman_pancakes-angular
train
js
f7c3ed6250cfbcf31879027afe041838947e8646
diff --git a/generators/client/utils.js b/generators/client/utils.js index <HASH>..<HASH> 100644 --- a/generators/client/utils.js +++ b/generators/client/utils.js @@ -30,16 +30,14 @@ module.exports = { }; function addLanguagesToApplication(generator) { - const fullPath = `${CLIENT_MAIN_SRC_DIR}app/shared/config.ts`; + const fullPath = `${CLIENT_MAIN_SRC_DIR}app/shared/config/config.ts`; try { - let content = '{\n'; + let content = ''; if (generator.enableTranslation) { generator.generateLanguageOptions(generator.languages, generator.clientFramework).forEach((ln, i) => { - content += ` ${ln}${i !== generator.languages.length - 1 ? ',' : ''}\n`; + content += ` ${ln}${i !== generator.languages.length - 1 ? ',\n' : ''}`; }); } - content += ' }'; - jhipsterUtils.rewriteFile( { file: fullPath,
Fix languages needle (#<I>)
jhipster_generator-jhipster
train
js
981c99650ba6b15b2e0f7e892193ef35e2a50ce1
diff --git a/src/CsvMigration.php b/src/CsvMigration.php index <HASH>..<HASH> 100644 --- a/src/CsvMigration.php +++ b/src/CsvMigration.php @@ -18,7 +18,7 @@ class CsvMigration extends AbstractMigration * Field parameters * @var array */ - protected $_fieldParams = ['name', 'type', 'limit', 'null']; + protected $_fieldParams = ['name', 'type', 'limit', 'required']; /** * Supported field types @@ -110,7 +110,7 @@ class CsvMigration extends AbstractMigration if ($this->_validateField($field)) { $this->_table->addColumn($field['name'], $field['type'], [ 'limit' => $field['limit'], - 'null' => $field['null'] + 'null' => (bool)$field['required'] ? false : true ]); } } @@ -149,7 +149,7 @@ class CsvMigration extends AbstractMigration $result = array_combine($this->_fieldParams, $csvData[$tableField['name']]); $this->_table->changeColumn($result['name'], $result['type'], [ 'limit' => $result['limit'], - 'null' => $result['null'] + 'null' => (bool)$result['required'] ? false : true ]); } }
fix reverse assignment of required fields (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
a3250beae507fe1ae96f57131c50b04711e56f2d
diff --git a/lib/Models/proxyCatalogItemUrl.js b/lib/Models/proxyCatalogItemUrl.js index <HASH>..<HASH> 100644 --- a/lib/Models/proxyCatalogItemUrl.js +++ b/lib/Models/proxyCatalogItemUrl.js @@ -19,7 +19,7 @@ var proxyCatalogItemUrl = function(catalogItem, url, cacheDuration) { return url; } - if (!corsProxy.shouldUseProxy(url)) { + if (!corsProxy.shouldUseProxy(url) && !catalogItem.forceProxy) { return url; }
added force property to `proxyCatalogItemUrl`
TerriaJS_terriajs
train
js
7484e17088b21497c44d8d3b2131eac3ddf00e03
diff --git a/Resources/Public/JavaScript/GridElementsDragDrop.js b/Resources/Public/JavaScript/GridElementsDragDrop.js index <HASH>..<HASH> 100644 --- a/Resources/Public/JavaScript/GridElementsDragDrop.js +++ b/Resources/Public/JavaScript/GridElementsDragDrop.js @@ -182,7 +182,7 @@ define(['jquery', 'jquery-ui/sortable', 'jquery-ui/droppable'], function ($) { // the negative value of the content element after where it should be moved targetPid = 0 - parseInt(targetFound); } - var container = parseInt($droppableElement.closest(DragDrop.contentIdentifier).data('container')); + var container = parseInt($droppableElement.closest(DragDrop.gridContainerIdentifier).closest(DragDrop.contentIdentifier).data('uid')); var language = parseInt($droppableElement.closest('[data-language-uid]').data('language-uid')); var colPos = 0; if (container > 0 && gridColumn !== false && gridColumn !== '') {
[BUGFIX] Use uid of container to be on the safe side Change-Id: Iaf9d<I>c<I>c<I>efd9c<I>e7d2b1eca<I> Resolves: #<I> Releases: 7-0, master Reviewed-on: <URL>
TYPO3-extensions_gridelements
train
js
d436de24040bc504ba66e3287076d775e154c82e
diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -789,7 +789,7 @@ class StopInstance(tables.BatchAction): def allowed(self, request, instance): return ((get_power_state(instance) - in ("RUNNING", "PAUSED", "SUSPENDED")) + in ("RUNNING", "SUSPENDED")) and not is_deleting(instance)) def action(self, request, obj_id):
Avoid shutting off a paused VM instance Currently, "Shut Off Instance" option is enabled even on a paused VM instance which results in an error that says "Error: Unable to shut off instance". With this commit, we are removing the option to shut off a paused VM instance. Change-Id: I<I>da<I>a<I>d<I>a4dbaf<I>b7c6a6f<I> Closes-Bug: #<I>
openstack_horizon
train
py
a8b2c47226f86d6227864ddd14bdaaec10e7a6c3
diff --git a/MC6809/example6809.py b/MC6809/example6809.py index <HASH>..<HASH> 100644 --- a/MC6809/example6809.py +++ b/MC6809/example6809.py @@ -24,6 +24,7 @@ import binascii import string import time +import sys from MC6809.components.cpu6809 import CPU from MC6809.components.memory import Memory @@ -126,6 +127,12 @@ class MC6809Example(object): return crc32 ^ 0xFFFFFFFF def compare_crc32(self, data): + + if sys.version_info > (3,): + data = bytes(data, encoding="ASCII") + + print("Compare CRC32 with: %r" % data) + print("\nCreate CRC32 with binascii:") start_time = time.time() excpected_crc32 = binascii.crc32(data) & 0xffffffff @@ -149,8 +156,7 @@ class MC6809Example(object): def run_example(): mc6809 = MC6809Example() - data = bytes(string.digits + string.ascii_letters + string.punctuation, encoding="ASCII") - print("Compare CRC32 with: %r" % data) + data = string.digits + string.ascii_letters + string.punctuation ok = mc6809.compare_crc32(data) return ok # Used in unittests ;)
bugfix example to run with py2 and py3
6809_MC6809
train
py
35815387abd1bbbc147a73a8161a99f7111e8691
diff --git a/script/create-dist.py b/script/create-dist.py index <HASH>..<HASH> 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -38,6 +38,7 @@ TARGET_BINARIES = { 'libGLESv2.dll', 'msvcp120.dll', 'msvcr120.dll', + 'ffmpeg.dll', 'node.dll', 'pdf.dll', 'content_resources_200_percent.pak', @@ -51,6 +52,7 @@ TARGET_BINARIES = { PROJECT_NAME, # 'electron' 'content_shell.pak', 'icudtl.dat', + 'libffmpeg.so', 'libnode.so', 'natives_blob.bin', 'snapshot_blob.bin',
Ship ffmpeg in dist, close #<I>
electron_electron
train
py
37fa13bc163892e5c066b517f17e9ea6284bb3e0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ /** * Wrap callbacks to prevent double execution. * + * @param {Function} fn Function that should only be called once. * @returns {Function} A wrapped callback which prevents execution. * @api public */ @@ -16,6 +17,7 @@ module.exports = function one(fn) { called = true; value = fn.apply(this, arguments); fn = null; + return value; }; };
[minor] Added missing JSDoc comment
3rd-Eden_one-time
train
js
84fe938e66f2db8142a7c1cc27fbaa48a48257c9
diff --git a/webapi_tests/runner.py b/webapi_tests/runner.py index <HASH>..<HASH> 100644 --- a/webapi_tests/runner.py +++ b/webapi_tests/runner.py @@ -11,11 +11,16 @@ import os import sys from fnmatch import fnmatch + +from mozdevice import DeviceManagerADB from mozlog.structured import commandline from webapi_tests import semiauto +adb = DeviceManagerADB() + + def iter_tests(start_dir, pattern="test_*.py"): """List available Web API tests and yield a tuple of (group, tests), where tests is a list of test names.""" @@ -99,6 +104,8 @@ def main(): print("%s.%s" % (group, test)) return 0 + adb.forward("tcp:2828", "tcp:2828") + test_loader = semiauto.TestLoader() tests = test_loader.loadTestsFromNames( map(lambda t: "webapi_tests.%s" % t, args.include or [g for g, _ in testgen]), None)
fixup! Bug <I> - Merge webapi_tests package into the fxos-certsuite package
mozilla-b2g_fxos-certsuite
train
py
5d58a26c9e165644a316a0529a6cbf0f1f9c2555
diff --git a/tests/DataTest.php b/tests/DataTest.php index <HASH>..<HASH> 100644 --- a/tests/DataTest.php +++ b/tests/DataTest.php @@ -191,10 +191,18 @@ class DataTest extends TestCase $data = $wrappedData->getData('wrapped.sampleData'); $this->runSampleDataTests($data); + } + + public function testGetDataOnNonArrayValue() + { + $data = new Data([ + 'foo' => 'bar', + ]); $this->expectException(DataException::class); + $this->expectExceptionMessageRegExp('/could not be represented as a DataInterface/'); - $data = $wrappedData->getData('wrapped.sampleData.a'); + $data->getData('foo'); } public function testImport()
Fix test not being executed The runSampleDataTests() call in testGetData() triggers an exception which prevents all subsequent tests from running. Moving this code into a separate tests ensures that this particual test runs instead of being skipped over.
dflydev_dflydev-dot-access-data
train
php
c4ac4e668a938d62d1e4ce7f0afcda25da3847b8
diff --git a/pkg/cmd/admin/policy/policy.go b/pkg/cmd/admin/policy/policy.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/admin/policy/policy.go +++ b/pkg/cmd/admin/policy/policy.go @@ -9,7 +9,6 @@ import ( "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" - "github.com/golang/glog" "github.com/spf13/cobra" authorizationapi "github.com/openshift/origin/pkg/authorization/api" @@ -98,14 +97,6 @@ func NewCmdPolicy(name, fullName string, f *clientcmd.Factory, out, errout io.Wr return cmds } -func getFlagString(cmd *cobra.Command, flag string) string { - f := cmd.Flags().Lookup(flag) - if f == nil { - glog.Fatalf("Flag accessed but not defined for command %s: %s", cmd.Name(), flag) - } - return f.Value.String() -} - func getUniqueName(basename string, existingNames *sets.String) string { if !existingNames.Has(basename) { return basename
delete a unused function in the 'pkg/cmd/admin/policy/policy.go' update
openshift_origin
train
go
8e778c02a742726afa86d8a949b49b6a11877ac6
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/searchAndReplace/textSearcher.js b/bundles/org.eclipse.orion.client.ui/web/orion/searchAndReplace/textSearcher.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/searchAndReplace/textSearcher.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/searchAndReplace/textSearcher.js @@ -54,9 +54,6 @@ define([ show: function(options) { mFind.Find.prototype.show.call(this, options); var findString = options.findString; - if(!this.isRangeSearch()){ - this._addRecentfind(findString); - } var replaceString = options.replaceString; var findDiv = document.getElementById("localSearchFindWith"); //$NON-NLS-0$ if (!findDiv) { @@ -73,6 +70,9 @@ define([ replaceDiv.value = replaceString; } this.setOptions({selectedLines: true, multipleLine: true}); + if(!this.isRangeSearch()){ + this._addRecentfind(findString); + } window.setTimeout(function() { findDiv.select(); findDiv.focus();
Bug <I> - CodeEdit: Support search/replaceAll within the editor selection range. - Do not add recent search keyword if multiple lines are selected.
eclipse_orion.client
train
js
37c90bc0ab312a892e3823f0c5518a74cf7db159
diff --git a/lib/resource/index.js b/lib/resource/index.js index <HASH>..<HASH> 100644 --- a/lib/resource/index.js +++ b/lib/resource/index.js @@ -300,14 +300,6 @@ Resource = new Class({ method = this[ httpmethod ]; methodsallowed = options[ util.format( '%sMethodsAllowed', action )] || {}; canDispatch = this.check( requestmethod, methodsallowed ); - if( !method ){ - bundle.data = { - message: util.format( "%s is not implemented ", httpmethod ), - request:util.format( requestmethod.toUpperCase(), req.path ), - statusCode:501 - } - return this.respond( bundle, http.notImplemented ) - } if( !canDispatch ){ bundle.data = { @@ -318,6 +310,15 @@ Resource = new Class({ return this.respond( bundle, http.methodNotAllowed ); } + if( !method ){ + bundle.data = { + message: util.format( "%s is not implemented ", httpmethod ), + request:util.format( requestmethod.toUpperCase(), req.path ), + statusCode:501 + } + return this.respond( bundle, http.notImplemented ) + } + if(this.throttle( bundle )){ bundle.data = { message: util.format( "Too Many Requests ", httpmethod ),
resources should return not allowed before implemented logically speaking we shouldn't be looking for a method if the action ust isn't allowed
node-tastypie_tastypie
train
js
73f0afd1d41aa6c3febcc2e93e4d19d9bf0f27dc
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index <HASH>..<HASH> 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -493,14 +493,18 @@ class BaseTest < ActiveSupport::TestCase end test "assets tags should use a Mailer's asset_host settings when available" do - ActionMailer::Base.config.asset_host = "global.com" - ActionMailer::Base.config.assets_dir = "global/" + begin + ActionMailer::Base.config.asset_host = "http://global.com" + ActionMailer::Base.config.assets_dir = "global/" - AssetMailer.asset_host = "http://local.com" + AssetMailer.asset_host = "http://local.com" - mail = AssetMailer.welcome + mail = AssetMailer.welcome - assert_equal(%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}, mail.body.to_s.strip) + assert_equal(%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}, mail.body.to_s.strip) + ensure + AssetMailer.asset_host = ActionMailer::Base.config.asset_host + end end # Before and After hooks
Fix ActionMailer tests that depend on run order
rails_rails
train
rb
811e3d4d7e9c599b4047accdba569a990b54ee78
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -271,8 +271,8 @@ def get_version_info(): # If this is a release or another kind of source distribution of PyCBC except: - version = '1.9.0dev' - release = 'False' + version = '1.8.2' + release = 'True' date = hash = branch = tag = author = committer = status = builder = build_date = ''
set to release (#<I>)
gwastro_pycbc
train
py
29a32243362f98d922e54747f3137f4c62fcd59d
diff --git a/Examples/basic/DummyProvider.php b/Examples/basic/DummyProvider.php index <HASH>..<HASH> 100644 --- a/Examples/basic/DummyProvider.php +++ b/Examples/basic/DummyProvider.php @@ -3,6 +3,8 @@ /** * @author Abed Halawi <[email protected]> */ + + // Provider's namespace is Vinelab\Minion\Provider class DummyProvider extends Provider { protected $prefix = 'com.example.';
Update DummyProvider.php
Vinelab_minion
train
php
4cc40105d38675928678f381ef5ba431c83660fe
diff --git a/vault/logical_system.go b/vault/logical_system.go index <HASH>..<HASH> 100644 --- a/vault/logical_system.go +++ b/vault/logical_system.go @@ -1211,7 +1211,7 @@ func (b *SystemBackend) handleAuditedHeaderRead(req *logical.Request, d *framewo } headerConfig := b.Core.AuditedHeadersConfig() - settings, ok := headerConfig.Headers[header] + settings, ok := headerConfig.Headers[strings.ToLower(header)] if !ok { return logical.ErrorResponse("Could not find header in config"), nil }
Fix audited request header lookup (#<I>) The headers are stored lowercased but the lookup function wasn't properly lowercasing when indexing in the header map. Fixes #<I>
hashicorp_vault
train
go
bc7576da215fe4baacaf910835cbcda7f1e89b7f
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java index <HASH>..<HASH> 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/db/AnalysisReportDaoTest.java @@ -88,9 +88,6 @@ public class AnalysisReportDaoTest { session.commit(); db.assertDbUnit(getClass(), "insert-result.xml", "analysis_reports"); - // update dto with generated id - assertThat(report1.getId()).isNotNull(); - assertThat(report2.getId()).isNotNull(); } @Test
Fix compatibility of test AnalysisReportDaoTest with Oracle
SonarSource_sonarqube
train
java
2e198829cc6c951b1dd5da447c0ca5d2fddcd0af
diff --git a/elasticspring-core/src/main/java/org/elasticspring/core/env/stack/StackResourceRegistry.java b/elasticspring-core/src/main/java/org/elasticspring/core/env/stack/StackResourceRegistry.java index <HASH>..<HASH> 100644 --- a/elasticspring-core/src/main/java/org/elasticspring/core/env/stack/StackResourceRegistry.java +++ b/elasticspring-core/src/main/java/org/elasticspring/core/env/stack/StackResourceRegistry.java @@ -11,7 +11,8 @@ public interface StackResourceRegistry { * Returns the physical id of the resource identified by the provided logical resource id. If no resource with the * provided logical id exists, null is returned. * - * @param logicalResourceId the logical id of the resource + * @param logicalResourceId + * the logical id of the resource * @return the physical id of the resource, or null, if no resource for the logical id exists in this stack. */ String lookupPhysicalResourceId(String logicalResourceId);
Reformatted javadoc according to configured code style settings
spring-cloud_spring-cloud-aws
train
java
f210b6eb640a0890434dc864b2b19b9efa07f64f
diff --git a/examples/storage/rackspace.js b/examples/storage/rackspace.js index <HASH>..<HASH> 100644 --- a/examples/storage/rackspace.js +++ b/examples/storage/rackspace.js @@ -71,7 +71,25 @@ rackspace.createContainer({ })); }); -// 4 -- to get a container, empty it, then finally destroying it +// 4 -- setup container as CDN +rackspace.getContainer('container-name', function (err, container) { + if(err){ + console.log('There was an error retrieving container:\n'); + console.dir(err); + return; + } + + container.enableCdn(function (error, cont) { + if (error) { + console.log('There was an error setting container as CDN:\n'); + console.dir(error); + return; + } + console.log('Successfully Created CDN Bucket'); + }); +}); + +// 5 -- to get a container, empty it, then finally destroying it rackspace.getContainer('sample-container', function (err, container) { if (err) { console.dir(err);
quashing commits Adding provisional docs for setting CloudFiles bucket as CDN Formatting to adhere to repo standards.
pkgcloud_pkgcloud
train
js
5cee1fc9c82d5e3bcab2862534e7252704455c6d
diff --git a/tests/test_config.py b/tests/test_config.py index <HASH>..<HASH> 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -35,3 +35,13 @@ class TestConfiguration (unittest.TestCase): def test_encoding_programs (self): self.assertEqual(set(patoolib.ArchiveEncodings), set(patoolib.EncodingPrograms.keys())) + + def test_encoding_mimes (self): + self.assertEqual(set(patoolib.ArchiveEncodings), + set(patoolib.util.Encoding2Mime.keys())) + for mime in patoolib.util.Encoding2Mime.values(): + self.assertTrue(mime in patoolib.ArchiveMimetypes) + + def test_filetext_mime (self): + for mime in patoolib.util.FileText2Mime.values(): + self.assertTrue(mime in patoolib.ArchiveMimetypes)
Test soundness of new configuration dictionaries.
wummel_patool
train
py
5eb32e23b4dcdccd3d8fe602707774eb661f79d3
diff --git a/lib/spaceship/provisioning_profile.rb b/lib/spaceship/provisioning_profile.rb index <HASH>..<HASH> 100644 --- a/lib/spaceship/provisioning_profile.rb +++ b/lib/spaceship/provisioning_profile.rb @@ -53,10 +53,10 @@ module Spaceship raise "Missing required parameter 'certificate'. e.g. use `Spaceship::Certificate::Production.all.first`" if certificate.to_s.empty? app = Spaceship::App.find(bundle_id) - # Fill in sensible default values name ||= [bundle_id, self.pretty_type].join(' ') - devices = [] if self.kind_of?AppStore # App Store Profiles MUST NOT have devices + devices = [] if self == AppStore # App Store Profiles MUST NOT have devices + devices ||= Spaceship.Devices.all unless self == AppStore # by default all devices profile = client.create_provisioning_profile!(name, self.type,
Automatic device correction to not convert profiles by mistake
fastlane_fastlane
train
rb
b43f803d36c9670208d46e01e15943c6df5c7d97
diff --git a/client/allocrunner/taskrunner/task_runner.go b/client/allocrunner/taskrunner/task_runner.go index <HASH>..<HASH> 100644 --- a/client/allocrunner/taskrunner/task_runner.go +++ b/client/allocrunner/taskrunner/task_runner.go @@ -797,9 +797,10 @@ func (tr *TaskRunner) buildTaskConfig() *drivers.TaskConfig { env := tr.envBuilder.Build() return &drivers.TaskConfig{ - ID: fmt.Sprintf("%s/%s/%s", alloc.ID, task.Name, invocationid), - Name: task.Name, - JobName: alloc.Job.Name, + ID: fmt.Sprintf("%s/%s/%s", alloc.ID, task.Name, invocationid), + Name: task.Name, + JobName: alloc.Job.Name, + TaskGroupName: alloc.TaskGroup, Resources: &drivers.Resources{ NomadResources: taskResources, LinuxResources: &drivers.LinuxResources{
set TaskGroupName in task_runner
hashicorp_nomad
train
go
30aeb1efe5cbe50a3cda7929e0d39095d418d1ce
diff --git a/src/AbstractRequester.php b/src/AbstractRequester.php index <HASH>..<HASH> 100644 --- a/src/AbstractRequester.php +++ b/src/AbstractRequester.php @@ -210,7 +210,7 @@ abstract class AbstractRequester // Assert results if ($this->statusExpected != $statusReturned) { throw new StatusCodeNotMatchedException( - "Status code not matched $statusReturned", + "Status code not matched: Expected {$this->statusExpected}, got {$statusReturned}", $responseBody ); }
mention received and expected response status code when failing
byjg_php-swagger-test
train
php
9f2a9aa44fdf217bcfb8c114cc1f1ffe9f78dcfe
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -16,5 +16,6 @@ module.exports = { 'highway_deleted': require('./comparators/highway_deleted'), 'new_mapper': require('./comparators/new_mapper'), 'feature_version': require('./comparators/feature_version'), - 'infrequent_key_value': require('./comparators/infrequent_key_value') + 'infrequent_key_value': require('./comparators/infrequent_key_value'), + 'low_zoom_features': require('./comparators/low_zoom_features') };
Export low_zoom_features from module
mapbox_osm-compare
train
js
fa9b12bfa2a39c6e51b367fc03fb74031c55d737
diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/MapContainer.java b/hazelcast/src/main/java/com/hazelcast/map/impl/MapContainer.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/impl/MapContainer.java +++ b/hazelcast/src/main/java/com/hazelcast/map/impl/MapContainer.java @@ -36,7 +36,6 @@ import com.hazelcast.nio.serialization.Data; import com.hazelcast.query.impl.IndexService; import com.hazelcast.spi.NodeEngine; import com.hazelcast.util.ExceptionUtil; -import com.hazelcast.util.UuidUtil; import com.hazelcast.wan.WanReplicationPublisher; import com.hazelcast.wan.WanReplicationService; @@ -246,13 +245,17 @@ public class MapContainer extends MapContainerSupport { } public String addInterceptor(MapInterceptor interceptor) { - String id = UuidUtil.buildRandomUuidString(); - interceptorMap.put(id, interceptor); - interceptors.add(interceptor); + String id = interceptor.getClass().getName(); + + addInterceptor(id, interceptor); + return id; } public void addInterceptor(String id, MapInterceptor interceptor) { + + removeInterceptor(id); + interceptorMap.put(id, interceptor); interceptors.add(interceptor); }
fix for issues #<I> and #<I>
hazelcast_hazelcast
train
java
c0e7f2dbf686fb892f800ab1da05d4ec7df0b90d
diff --git a/seed_control_interface_service/settings.py b/seed_control_interface_service/settings.py index <HASH>..<HASH> 100644 --- a/seed_control_interface_service/settings.py +++ b/seed_control_interface_service/settings.py @@ -41,6 +41,8 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + # documentation + 'rest_framework_docs', # 3rd party 'raven.contrib.django.raven_compat', 'rest_framework', diff --git a/seed_control_interface_service/urls.py b/seed_control_interface_service/urls.py index <HASH>..<HASH> 100644 --- a/seed_control_interface_service/urls.py +++ b/seed_control_interface_service/urls.py @@ -13,6 +13,7 @@ urlpatterns = patterns( include('rest_framework.urls', namespace='rest_framework')), url(r'^api/token-auth/', 'rest_framework.authtoken.views.obtain_auth_token'), + url(r'^docs/', include('rest_framework_docs.urls')), url(r'^', include('services.urls')), url(r'^', include('dashboards.urls')), )
Added support for the DRFDocs module to auto-generate HTTP API documentation and expose it on /docs.
praekeltfoundation_seed-control-interface-service
train
py,py
9beb5fb27487f37e219837b06620a69ea83a1d3e
diff --git a/Doctrineum/Scalar/EnumTrait.php b/Doctrineum/Scalar/EnumTrait.php index <HASH>..<HASH> 100644 --- a/Doctrineum/Scalar/EnumTrait.php +++ b/Doctrineum/Scalar/EnumTrait.php @@ -25,7 +25,7 @@ trait EnumTrait */ public function __toString() { - return (string)$this->enumValue; + return (string)$this->getEnumValue(); } /**
To string method uses value getter instead of dodgy direct property access
doctrineum_doctrineum-scalar
train
php
f58e23b325a3b1d6ac30771d2167f22ea95fe54f
diff --git a/src/js/captions.js b/src/js/captions.js index <HASH>..<HASH> 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -74,7 +74,7 @@ const captions = { // Watch changes to textTracks and update captions menu if (this.config.captions.update) { - utils.on(this.media.textTracks, 'change', captions.update.bind(this)); + utils.on(this.media.textTracks, 'addtrack removetrack', captions.update.bind(this)); } // Update available languages in list
Change to using addtrack and removetrack listeners since 'change' didn't trigger in firefox for embedded captions (may also be a hls.js issue)
sampotts_plyr
train
js
1ba41f640c870ddb670b600599d6cb6b9aded837
diff --git a/system/Test/FeatureResponse.php b/system/Test/FeatureResponse.php index <HASH>..<HASH> 100644 --- a/system/Test/FeatureResponse.php +++ b/system/Test/FeatureResponse.php @@ -15,6 +15,7 @@ use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\ResponseInterface; use Config\Services; use Exception; +use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; /** @@ -103,13 +104,12 @@ class FeatureResponse extends TestCase * and it was redirect to a specific URI. * * @param string $uri + * + * @throws \Exception */ public function assertRedirectTo(string $uri) { - if (! $this->isRedirect()) - { - return false; - } + $this->assertRedirect(); $uri = trim(strtolower($uri)); $redirectUri = strtolower($this->getRedirectUrl());
Don't return false from assertion.
codeigniter4_CodeIgniter4
train
php
11fb68095cdd1eb1ab7cfc8d4afd30ed63bd7b4c
diff --git a/test_path.py b/test_path.py index <HASH>..<HASH> 100644 --- a/test_path.py +++ b/test_path.py @@ -138,7 +138,7 @@ class TempDirTestCase(unittest.TestCase): subdir.makedirs() old_dir = os.getcwd() with subdir: - self.assertEquals(os.getcwd(), subdir) + self.assertEquals(os.getcwd(), os.path.realpath(subdir)) self.assertEquals(os.getcwd(), old_dir)
Add os.path.realpath in testContextManager - test was failing on OS X because os.path.realpath('/var/folders') == '/private/var/folders'
jaraco_path.py
train
py
ad22db8fa3c67a77b6629261b74b7490f69bd36c
diff --git a/lib/shirtsio/utils.rb b/lib/shirtsio/utils.rb index <HASH>..<HASH> 100644 --- a/lib/shirtsio/utils.rb +++ b/lib/shirtsio/utils.rb @@ -20,5 +20,18 @@ module Shirtsio def self.build_query(hash) Faraday::Utils.build_nested_query(hash) end + + def self.mime_type(path) + case path + when /\.jpe?g/i + 'image/jpeg' + when /\.eps$/i + 'image/eps' + when /\.png$/i + 'image/png' + else + 'application/octet-stream' + end + end end end
Added helper for retrieving mime types.
anthonator_shirtsio
train
rb
299b51b99891008f22eb810767b18b82da3c12e0
diff --git a/smop/core.py b/smop/core.py index <HASH>..<HASH> 100644 --- a/smop/core.py +++ b/smop/core.py @@ -361,8 +361,9 @@ def arange(start,stop,step=1,**kwargs): >>> size(a) matlabarray([[ 1, 10]]) """ + expand_value = 1 if step > 0 else -1 return matlabarray(np.arange(start, - stop+1, + stop+expand_value, step, **kwargs).reshape(1,-1),**kwargs) def cat(*args):
bug fix: arange (when step < 0) Previous arange function have bug when called like arange(<I>, 1, -1)
victorlei_smop
train
py
ce52713d60dfe70c307e1fcbe363ad4dea21e19d
diff --git a/pippo-test/src/main/java/ro/pippo/test/PippoRule.java b/pippo-test/src/main/java/ro/pippo/test/PippoRule.java index <HASH>..<HASH> 100644 --- a/pippo-test/src/main/java/ro/pippo/test/PippoRule.java +++ b/pippo-test/src/main/java/ro/pippo/test/PippoRule.java @@ -71,24 +71,24 @@ public class PippoRule implements TestRule { @Override public void evaluate() throws Throwable { - startPippo(pippo); + startPippo(); try { statement.evaluate(); } finally { - stopPippo(pippo); + stopPippo(); } } }; } - protected void startPippo(Pippo pippo) { + public void startPippo() { pippo.start(); initRestAssured(); } - protected void stopPippo(Pippo pippo) { + public void stopPippo() { pippo.stop(); }
Issue #<I> - Make some methods public in the PippoRule class (#<I>)
pippo-java_pippo
train
java
078cc3f0441dbaeebf3fbbfd2cf5e8f709877c6d
diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index <HASH>..<HASH> 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -1041,8 +1041,12 @@ class question_calculated_qtype extends default_questiontype { $answer->answer, $data, $answer->tolerance, $answer->tolerancetype, $answer->correctanswerlength, $answer->correctanswerformat, $unit); - eval('$answer->answer = '.$formula.';') ; - $virtualqtype->get_tolerance_interval($answer); + if ( $formula === '*'){ + $answer->min = '' ; + }else { + eval('$answer->answer = '.$formula.';') ; + $virtualqtype->get_tolerance_interval($answer); + } if ($answer->min === '') { // This should mean that something is wrong $stranswers .= " -$formattedanswer->answer".'<br/><br/>'; @@ -1161,6 +1165,8 @@ class question_calculated_qtype extends default_questiontype { /// Calculate the correct answer if (empty($formula)) { $str = ''; + } else if ($formula === '*'){ + $str = '*'; } else { eval('$str = '.$formula.';'); }
MDL-<I> implement the '*' convention as for other questiontypes
moodle_moodle
train
php
8ab1ffae177f09273b1790d1a86d3d61d111ed5a
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js index <HASH>..<HASH> 100644 --- a/lib/handlebars/runtime.js +++ b/lib/handlebars/runtime.js @@ -103,7 +103,7 @@ Handlebars.Runtime.prototype = { var data = idObj.data; - var type = toString.call(data); + var type = Object.prototype.toString.call(data); var functionType = (type === "[object Function]"); if(!functionType && params.length) { @@ -196,7 +196,7 @@ Handlebars.Runtime.prototype = { var context = this.wrapContext(); - if(toString.call(data) === "[object Function]") { + if(Object.prototype.toString.call(data) === "[object Function]") { params = this.evaluateParams(mustache.params); id = id.parts.join("/");
Use prototype toString method to avoid native types being returned. * For example, mozilla returns [xpconnect native prototype wrapper] vs [object Function]
wycats_handlebars.js
train
js
e45d97217c3c774e95510b63c6be92d654419939
diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/attribute_assignment.rb +++ b/activerecord/lib/active_record/attribute_assignment.rb @@ -134,7 +134,7 @@ module ActiveRecord elsif klass == Date read_date else - read_other(klass) + read_other end end @@ -181,7 +181,7 @@ module ActiveRecord end end - def read_other(klass) + def read_other max_position = extract_max_param positions = (1..max_position) validate_required_parameters!(positions)
Remove unused param 'klass' from AttributeAssignment#read_other
rails_rails
train
rb
266303115221f6a79e03731280f3676b22168d2c
diff --git a/patch_test.go b/patch_test.go index <HASH>..<HASH> 100644 --- a/patch_test.go +++ b/patch_test.go @@ -187,6 +187,11 @@ var Cases = []Case{ `{ "foo": [["bar"], "bar"]}`, }, { + `{ "foo": null}`, + `[{"op": "copy", "path": "/bar", "from": "/foo"}]`, + `{ "foo": null, "bar": null}`, + }, + { `{ "foo": ["bar","qux","baz"]}`, `[ { "op": "remove", "path": "/foo/-2"}]`, `{ "foo": ["bar", "baz"]}`,
Test for copying null-value key.
evanphx_json-patch
train
go
49f88f1bbfb09f35eda7604a514d9f5abb865088
diff --git a/h2o-algos/src/test/java/hex/deeplearning/DeepLearningProstateTest.java b/h2o-algos/src/test/java/hex/deeplearning/DeepLearningProstateTest.java index <HASH>..<HASH> 100755 --- a/h2o-algos/src/test/java/hex/deeplearning/DeepLearningProstateTest.java +++ b/h2o-algos/src/test/java/hex/deeplearning/DeepLearningProstateTest.java @@ -25,7 +25,7 @@ import static hex.deeplearning.DeepLearningModel.DeepLearningParameters; public class DeepLearningProstateTest extends TestUtil { @BeforeClass() public static void setup() { stall_till_cloudsize(1); } - @Test public void run() throws Exception { runFraction(0.0007f); } + @Test public void run() throws Exception { runFraction(0.0001f); } public void runFraction(float fraction) { long seed = 0xDECAF;
Speed up DLProstateTest.
h2oai_h2o-3
train
java
08adce9e22694aebcc276cbd8296437e1885a780
diff --git a/src/inputs/index.js b/src/inputs/index.js index <HASH>..<HASH> 100644 --- a/src/inputs/index.js +++ b/src/inputs/index.js @@ -2,11 +2,11 @@ export { default as BaseInput } from "inputs/BaseInput"; export { default as TextInput } from "inputs/TextInput"; export { default as MoneyInput } from "inputs/MoneyInput"; export { default as CheckInput } from "inputs/CheckInput"; +export { default as CheckBox } from "inputs/CheckBox"; export { default as RadioInput } from "inputs/RadioInput"; export { default as SelectInput } from "inputs/SelectInput"; export { default as PasswordInput } from "inputs/PasswordInput"; export { default as NumericInput } from "inputs/NumericInput"; export { default as DecimalInput } from "inputs/DecimalInput"; export { default as DateInput } from "inputs/DateInput"; -export { default as CheckboxList } from "inputs/checklist/CheckboxList"; export { default as HtmlEditor } from "./htmleditor"; \ No newline at end of file
- fixed CheckBox path problem.
robeio_robe-react-ui
train
js
0ffc055a9c5d02c3b1cabfec5a884c996cde7235
diff --git a/swagger-springmvc/src/main/java/com/mangofactory/swagger/readers/ApiDescriptionReader.java b/swagger-springmvc/src/main/java/com/mangofactory/swagger/readers/ApiDescriptionReader.java index <HASH>..<HASH> 100644 --- a/swagger-springmvc/src/main/java/com/mangofactory/swagger/readers/ApiDescriptionReader.java +++ b/swagger-springmvc/src/main/java/com/mangofactory/swagger/readers/ApiDescriptionReader.java @@ -59,7 +59,7 @@ public class ApiDescriptionReader implements Command<RequestMappingContext> { public String sanitizeRequestMappingPattern(String requestMappingPattern) { String result = requestMappingPattern; //remove regex portion '/{businessId:\\w+}' - result = result.replaceAll("\\{(.*?):.*?\\}", "{$1}"); + result = result.replaceAll("\\{([^}]*?):.*?\\}", "{$1}"); return result.isEmpty() ? "/" : result; } }
fixes problem when cleaning a path with spring regular expressions, it used to delete second colon separated param:{value} .
springfox_springfox
train
java
8edc9ed1ee7115eb06d1357d0669c04640c09b8c
diff --git a/src/Http/Controllers/ApiController.php b/src/Http/Controllers/ApiController.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/ApiController.php +++ b/src/Http/Controllers/ApiController.php @@ -208,13 +208,13 @@ class ApiController extends BaseController } } - public function postDelete($id) + public function postDelete($forum_id, $post_id) { if (!$this->canAdministrate() && !$this->canModerate()) { return Response::make('Unauthorised', 401); } - $post = $this->postExists($id); + $post = $this->postExists($post_id); if (!$post) { return Response::make('Post not found', 404); }
Fix params passed to post delete
taskforcedev_laravel-forum
train
php
ca06e0900b9c0abf6660cbb3c75d9ae9ce57b1f0
diff --git a/lib/zold/remotes.rb b/lib/zold/remotes.rb index <HASH>..<HASH> 100755 --- a/lib/zold/remotes.rb +++ b/lib/zold/remotes.rb @@ -237,7 +237,7 @@ in #{(Time.now - start).round}s; errors=#{errors}") private def modify - MUTEX.synchronize do + Remotes::MUTEX.synchronize do save(yield(load)) end end
Issue #<I> - Trying again with constant
zold-io_zold
train
rb
58efc7f09d7608017e201c8511b450add4735bfd
diff --git a/src/codeGen/processingHooksTemplate.js b/src/codeGen/processingHooksTemplate.js index <HASH>..<HASH> 100644 --- a/src/codeGen/processingHooksTemplate.js +++ b/src/codeGen/processingHooksTemplate.js @@ -6,6 +6,9 @@ export default { queryMiddleware(queryPacket, root, args, context, ast) { //Called after query filters are processed, which are passed in queryPacket }, + queryPreAggregate(aggregateItems, root, args, context, ast) { + //Called right before a Mongo aggregation is performed + }, beforeInsert(objToBeInserted, root, args, context, ast) { //Called before an insertion occurs. Return false to cancel it },
update sample hooks file to include pre-aggregation hook
arackaf_mongo-graphql-starter
train
js
1f2ddcfea52d966646258ddc691aaa9efcc12ff8
diff --git a/cucumber/frank_helper.rb b/cucumber/frank_helper.rb index <HASH>..<HASH> 100644 --- a/cucumber/frank_helper.rb +++ b/cucumber/frank_helper.rb @@ -16,12 +16,12 @@ module FrankHelper end def check_element_exists( query ) - puts "checking #{query} exists..." + #puts "checking #{query} exists..." element_exists( query ).should be_true end def check_element_does_not_exist( query ) - puts "checking #{query} does not exist..." + #puts "checking #{query} does not exist..." element_exists( query ).should be_false end
comment out puts noise in frank_helper
moredip_Frank
train
rb
115af2b201fb6039a2c4ba1d97be0921bdfb264a
diff --git a/examples/time-elapsed-example.py b/examples/time-elapsed-example.py index <HASH>..<HASH> 100644 --- a/examples/time-elapsed-example.py +++ b/examples/time-elapsed-example.py @@ -12,7 +12,7 @@ RPC.connect() # Make sure you are using the same name that you used when uploading the image -start_time=time.time() # start_time is equal to time.time +start_time=time.time() # Using the time that we imported at the start. start_time equals time. RPC.update(large_image="LARGE_IMAGE_HERE", large_text="Programming B)", small_image="SMALL_IMAGE_HERE", small_text="Hello!", start=start_time) # We want to apply start time when you run the presence.
Update time-elapsed-example.py
qwertyquerty_pypresence
train
py
300bf52e676288cf0338cea55d7e129caa4ab30c
diff --git a/lib/messaging/handle.rb b/lib/messaging/handle.rb index <HASH>..<HASH> 100644 --- a/lib/messaging/handle.rb +++ b/lib/messaging/handle.rb @@ -4,6 +4,8 @@ module Messaging def self.included(cls) cls.class_exec do + Dependency.activate(self) + dependency :handler_logger, ::Log extend Build diff --git a/lib/messaging/write.rb b/lib/messaging/write.rb index <HASH>..<HASH> 100644 --- a/lib/messaging/write.rb +++ b/lib/messaging/write.rb @@ -4,6 +4,8 @@ module Messaging def self.included(cls) cls.class_exec do + Dependency.activate(self) + include Log::Dependency dependency :message_writer
Dependency macro is no longer expected to have been loaded
eventide-project_messaging
train
rb,rb
7032e39982c8e6b2ab3c6524204532186de36e52
diff --git a/flex/pkg/volume/driver-call.go b/flex/pkg/volume/driver-call.go index <HASH>..<HASH> 100644 --- a/flex/pkg/volume/driver-call.go +++ b/flex/pkg/volume/driver-call.go @@ -20,8 +20,9 @@ import ( "encoding/json" "errors" "fmt" - "github.com/golang/glog" "time" + + "github.com/golang/glog" ) const ( @@ -180,6 +181,7 @@ func defaultCapabilities() *DriverCapabilities { func handleCmdResponse(cmd string, output []byte) (*DriverStatus, error) { status := DriverStatus{ Capabilities: defaultCapabilities(), + Message: "", } if err := json.Unmarshal(output, &status); err != nil { glog.Errorf("Failed to unmarshal output for command: %s, output: %q, error: %s", cmd, string(output), err.Error())
flex: Status.Message can be empty, that will lead to nil reference in glog
kubernetes-incubator_external-storage
train
go
4b6cd8bbdb9568a608fa8458d643a046c95b5f23
diff --git a/test/integration/dynode-test.js b/test/integration/dynode-test.js index <HASH>..<HASH> 100644 --- a/test/integration/dynode-test.js +++ b/test/integration/dynode-test.js @@ -135,7 +135,7 @@ describe('Dynode Integration Tests', function() { }); it('should update existing item by setting number to 0', function(done) { - dynode.updateItem(DynamoDB.TestTable, "update5" {age:0}, {ReturnValues: "UPDATED_NEW"}, function(err, resp) { + dynode.updateItem(DynamoDB.TestTable, "update5", {age:0}, {ReturnValues: "UPDATED_NEW"}, function(err, resp) { resp.Attributes.should.eql({ age: 0 }); done(err); }); @@ -194,7 +194,7 @@ describe('Dynode Integration Tests', function() { describe("Batch Write Item", function(){ before(function(done) { DynamoDB.createProducts([ - {id: "batch1", foo: "baz"}, + {id: "batch1", foo: "baz"}, {id: "batch2", nums: [1,2,3], age: 22}, {id: "batch3", foo: "bar", age: 22}, {id: "batch4", foo: "blah", age: 99, nums : [4,5,6], lname : 'tester'}
fixng syntax error in integration test from merged pull request
Wantworthy_dynode
train
js
e131f0f90e95fa4cabe70faf1d7d971db7b13776
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,6 @@ install_requires = [ "datapipelines>=1.0.6", "merakicommons>=1.0.6", "Pillow", - "pycurl", "arrow" ]
removed pycurl from setup.py. fixes #<I> closes #<I>
meraki-analytics_cassiopeia
train
py
0c75fe7c176229e10622a3ede6c03e07ef04000d
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index <HASH>..<HASH> 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -1377,13 +1377,13 @@ class GenJVM { protected void addScalaAttr(JClass cls, Pickle pickle) { pickles.add(cls); pickles.add(pickle); - JOtherAttribute scalaAttr = - fjbgContext.JOtherAttribute(cls, - cls, - SCALA_ATTR, - pickle.bytes, - pickle.size()); - cls.addAttribute(scalaAttr); +// JOtherAttribute scalaAttr = +// fjbgContext.JOtherAttribute(cls, +// cls, +// SCALA_ATTR, +// pickle.bytes, +// pickle.size()); +// cls.addAttribute(scalaAttr); } /// Names
- Removed generation of scala attribute in clas... - Removed generation of scala attribute in class files
scala_scala
train
java
08d8cfa00f2a1455bee2850a7a1afd9dc87e8651
diff --git a/libnetwork/network.go b/libnetwork/network.go index <HASH>..<HASH> 100644 --- a/libnetwork/network.go +++ b/libnetwork/network.go @@ -911,8 +911,8 @@ func (n *network) driver(load bool) (driverapi.Driver, error) { if n.scope == "" && cap != nil { n.scope = cap.DataScope } - if isAgent && n.dynamic { - // If we are running in agent mode and the network + if isAgent || n.dynamic { + // If we are running in agent mode or the network // is dynamic, then the networks are swarm scoped // regardless of the backing driver. n.scope = datastore.SwarmScope
Restore isAgent || n.dynamic check - This got mistakenly changed by <I>d<I>cc<I>b
moby_moby
train
go
a9fb9ec2466a92614609c5cb68d22d2b5a173e8e
diff --git a/www/MediaRecorder.js b/www/MediaRecorder.js index <HASH>..<HASH> 100644 --- a/www/MediaRecorder.js +++ b/www/MediaRecorder.js @@ -54,9 +54,12 @@ MediaRecorder.prototype.start = function (timeslice) { } var that = this; var typesSupported = ['audio/m4a', 'audio/wav']; - if (typesSupported.includes(this.mimeType)) { + var defaultType = 'm4a'; + if (this.mimeType !== '' && typesSupported.includes(this.mimeType)) { var arrTypes = this.mimeType.split('/'); this.src = this.src + arrTypes[1]; + } else { + this.src = this.src = defaultType; } // If we have a video stream pass in which camera to use var video = this.stream.getVideoTracks()[0] ? this.stream.getVideoTracks()[0].description : '';
:apple: Added default source for audio recording
phonegap_phonegap-plugin-media-recorder
train
js
4d3f88eca340ada7e8da2f9328dfc332f03ff05f
diff --git a/form/class.htmlform.php b/form/class.htmlform.php index <HASH>..<HASH> 100644 --- a/form/class.htmlform.php +++ b/form/class.htmlform.php @@ -1,7 +1,7 @@ <?php /** * Template Engine for Forms - * @version 1.1.4 2011-11-05 + * @version 1.1.5 2012-02-19 * @author Gregor Kofler * * @todo tie submit buttons to other elements of form; use $initFormValues? @@ -399,7 +399,10 @@ class HtmlForm { private function setElementRequestValue(FormElement $e) { $name = $e->getName(); - if($e instanceof CheckboxElement) { + // checkboxes are only affected by request, if request is set all + + if($e instanceof CheckboxElement && !empty($this->request)) { + $e->setChecked(isset($this->request[$name])); } else {
Initial values of checkboxes were not handled properly. Change-Id: I1a<I>c0c<I>b<I>c7e1f<I>eec<I>a0e<I>eab
Vectrex_vxPHP
train
php
d1255bbcae3d4002d7009b851fc9ffaad7002bad
diff --git a/client/api/index.js b/client/api/index.js index <HASH>..<HASH> 100644 --- a/client/api/index.js +++ b/client/api/index.js @@ -178,7 +178,6 @@ Deepword.prototype.sha = function() { }; Deepword.prototype._diff = function(value) { - this._value = this._story.getData(this._filename); return createPatch(this._value, value); };
fix(index) _diff: overwrite _value
cloudcmd_deepword
train
js
f5ec0cc7a1f5d0bddc89f9f0f3c1c3a8239fdeda
diff --git a/test/mountain_view/component_test.rb b/test/mountain_view/component_test.rb index <HASH>..<HASH> 100644 --- a/test/mountain_view/component_test.rb +++ b/test/mountain_view/component_test.rb @@ -21,11 +21,12 @@ class MountainViewComponentTest < ActiveSupport::TestCase stubs: [ { - id: 1, + id: 1, title: "20 Mountains you didn't know they even existed", subtitle: "Buzzfeed title" }, - { id: 2, + { + id: 2, title: "You won't believe what happened to this man at Aspen" } ]
Rubocop test/mountain_view/component_test.rb
devnacho_mountain_view
train
rb
595c34b392a662cea41d95269350ebbc9b547cd3
diff --git a/test.php b/test.php index <HASH>..<HASH> 100644 --- a/test.php +++ b/test.php @@ -33,7 +33,7 @@ try { echo $e->getMessage() . PHP_EOL; } -/* + echo 'DB Create' . PHP_EOL; try { //$result = $db_connect->DBCreate('name2', 'local');
Implemening config_get command #0 test improved
AntonTerekhov_OrientDB-PHP
train
php
f00d5788e5bd1ce695b4fb1a502ee93c6ef6cd52
diff --git a/scripts/npm-release.js b/scripts/npm-release.js index <HASH>..<HASH> 100644 --- a/scripts/npm-release.js +++ b/scripts/npm-release.js @@ -45,7 +45,6 @@ getPublishedVersions() shouldPublish(lernaJSON.version, publishedVersions) ) { // NOTE: use `private: false` to allow publish to npm - // https://github.com/wix-private/wix-ci/blob/master/ci-scripts/wix-agent-scripts/src/npmBuild.sh#L72 return writeFile( packageJSONPath, stringify(Object.assign({}, packageJSON, { private: false })),
Update npm-release.js
wix_okidoc
train
js
4f54becca9f2b229f00c398b5525e26eda77387d
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -866,7 +866,8 @@ describe('packet.generate', function () { Block1: 27, 'Proxy-Uri': 35, 'Proxy-Scheme': 39, - Size1: 60 + Size1: 60, + 'No-Response': 258 } Object.keys(longOptions).forEach(function (option) { @@ -921,8 +922,15 @@ describe('packet.generate', function () { }) }) - ;['560', '720'].forEach(function (option) { - const optionNum = '' + option + const evenLongerOptions = { + 560: 560, + 720: 720, + 'OCF-Accept-Content-Format-Version': 2049, + 'OCF-Content-Format-Version': 2053 + } + + Object.keys(evenLongerOptions).forEach(function (option) { + const optionNum = evenLongerOptions[option] it('should generate ' + option + ' option with unextended length', function () { packet = {
test: add tests for longer option codes
mcollina_coap-packet
train
js
a989c0e381a71ab7a5c338ad6010f9eccda99f9c
diff --git a/iquery/core.py b/iquery/core.py index <HASH>..<HASH> 100644 --- a/iquery/core.py +++ b/iquery/core.py @@ -28,6 +28,7 @@ except ImportError: def show_usage(): """Usage: + iquery -l <song> iquery (-m|电影) iquery -p <city> iquery -p <city> <hospital> @@ -43,6 +44,7 @@ def cli(): """Various information query via command line. Usage: + iquery -l <song> iquery (-m|电影) iquery -p <city> iquery -p <city> <hospital> @@ -54,6 +56,8 @@ Arguments: to 到达站 date 查询日期 + song 歌曲名称 + city 查询城市 show 演出的类型 days 查询近(几)天内的演出, 若省略, 默认15 @@ -69,6 +73,7 @@ Options: -m 热映电影查询 -p 莆田系医院查询 + -l 歌词查询 Show: 演唱会 音乐会 音乐剧 歌舞剧 儿童剧 话剧 @@ -85,6 +90,10 @@ Go to https://github.com/protream/tickets for usage examples. from .movies import query result = query() + elif args.is_querying_lyric: + from .lyrics import query + result = query(args.as_lyric_query_params) + elif args.is_querying_show: from .showes import query result = query(args.as_show_query_params)
[Feature] song lyric query.
protream_iquery
train
py
1f6247609f4eba1f321728c1ede8a7c827629d17
diff --git a/cheroot/test/test_conn.py b/cheroot/test/test_conn.py index <HASH>..<HASH> 100644 --- a/cheroot/test/test_conn.py +++ b/cheroot/test/test_conn.py @@ -1094,7 +1094,7 @@ class FaultyGetMap: def __call__(self): """Intercept the calls to selector.get_map.""" sabotage_targets = ( - conn for _, (*_, conn) in self.original_get_map().items() + conn for _, (_, _, _, conn) in self.original_get_map().items() if isinstance(conn, cheroot.server.HTTPConnection) ) if self.sabotage_conn else ()
Fix py2 tuple unpacking in gen expr @ test_conn
cherrypy_cheroot
train
py