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
fe3af0f030e7fe222a1427b4bdfb3ea7389e121b
diff --git a/eppy/runner/run_functions.py b/eppy/runner/run_functions.py index <HASH>..<HASH> 100644 --- a/eppy/runner/run_functions.py +++ b/eppy/runner/run_functions.py @@ -87,7 +87,7 @@ def multirunner(args): run(*args[0], **args[1]) -def run(idf=None, weather=None, output_directory='run_outputs', annual=False, +def run(idf=None, weather=None, output_directory='', annual=False, design_day=False, idd=None, epmacro=False, expandobjects=False, readvars=False, output_prefix=None, output_suffix=None, version=False, verbose='v'): @@ -103,7 +103,8 @@ def run(idf=None, weather=None, output_directory='run_outputs', annual=False, Full or relative path to the weather file. output_directory : str, optional - Full or relative path to an output directory (default: 'run_outputs) + Full or relative path to an output directory (default: current + directory) annual : bool, optional If True then force annual simulation (default: False)
Default output folder for IDF5.run() is current directory This is to match the behaviour of the CLI.
santoshphilip_eppy
train
py
db240b270d3ec5d5591bace9fecba30034c1fec6
diff --git a/src/main/java/io/github/bonigarcia/wdm/WdmHttpClient.java b/src/main/java/io/github/bonigarcia/wdm/WdmHttpClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/wdm/WdmHttpClient.java +++ b/src/main/java/io/github/bonigarcia/wdm/WdmHttpClient.java @@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory; public class WdmHttpClient implements Closeable { protected static final Logger log = LoggerFactory - .getLogger(BrowserManager.class); + .getLogger(WdmHttpClient.class); private final CloseableHttpClient httpClient;
Fix WebHttpClient logger to refer to WebHttpClient
bonigarcia_webdrivermanager
train
java
90d80d07035fe724271d12c69cfa4b97aa41e7d7
diff --git a/state/watcher.go b/state/watcher.go index <HASH>..<HASH> 100644 --- a/state/watcher.go +++ b/state/watcher.go @@ -1563,17 +1563,15 @@ func (w *actionWatcher) Changes() <-chan []string { func (w *actionWatcher) loop() error { var ( - initial set.Strings changes set.Strings in <-chan watcher.Change = w.source out chan<- []string = w.sink - err error ) w.st.watcher.WatchCollectionWithFilter(w.st.actions.Name, w.source, w.filterFn) defer w.st.watcher.UnwatchCollection(w.st.actions.Name, w.source) - initial, err = w.initial() + initial, err := w.initial() if err != nil { return err }
use short decl for initial and err per code review comments
juju_juju
train
go
dd34cc5d67afa9a0999c3ec1768399ed69715228
diff --git a/select2.js b/select2.js index <HASH>..<HASH> 100644 --- a/select2.js +++ b/select2.js @@ -1356,8 +1356,6 @@ the specific language governing permissions and limitations under the Apache Lic return; } - search.addClass("select2-active"); - function postRender() { results.scrollTop(0); search.removeClass("select2-active"); @@ -1386,9 +1384,6 @@ the specific language governing permissions and limitations under the Apache Lic } return; } - else if (opts.formatSearching() && initial===true) { - render("<li class='select2-searching'>" + opts.formatSearching() + "</li>"); - } if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) { if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) { @@ -1399,6 +1394,12 @@ the specific language governing permissions and limitations under the Apache Lic return; } + if (opts.formatSearching && this.findHighlightableChoices().length === 0) { + render("<li class='select2-searching'>" + opts.formatSearching() + "</li>"); + } + + search.addClass("select2-active"); + // give the tokenizer a chance to pre-process the input input = this.tokenize(); if (input != undefined && input != null) {
always show spinner during searching. fixes #<I> fixes #<I>
select2_select2
train
js
5a9c6220359850d3d1105c9f27f16f488dc4d29e
diff --git a/example.js b/example.js index <HASH>..<HASH> 100644 --- a/example.js +++ b/example.js @@ -1,8 +1,8 @@ -var sys = require('sys'), +var util = require('util'), Calais = require('./lib/calais').Calais var calais = new Calais('your_api_key') calais.set('content', 'The Federal Reserve is the enemy of Ron Paul.') calais.fetch(function(result) { - sys.puts(sys.inspect(result)) + util.puts(util.inspect(result)) })
[fix] Changed require('sys') to require('util') for compatibility with node <I>
mcantelon_node-calais
train
js
0caf41e4ace813b9cdf3fac4ef72aa6ac069fe83
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -104,9 +104,11 @@ module.exports.loadRestifyRoutes = function () { var swagger = spec.swagger || {}; var mySwaggerPathParts = swagger.docPath || url.split(path.sep)[1]; var mySwaggerPath = '/swagger/' + mySwaggerPathParts; + + var models = spec.models || {}; if (!_.contains(self.options.blacklist, mySwaggerPathParts)) { - var swaggerDoc = self.findOrCreateResource(mySwaggerPath); + var swaggerDoc = self.findOrCreateResource(mySwaggerPath, { models: models }); var parameters = []; var modelName = name; var model = { properties: { } };
Include Models (from Spec) into Swagger server.get({ url: '/foo', models: FooModels, swagger: { summary: 'xxx', notes: 'xxx', nickname: 'xxx', responseClass: "FooModel", // is defined inside FooModels }, validation: { } } ....
z0mt3c_node-restify-swagger
train
js
42651babd86e16a4a9a9329edd781d70783d3566
diff --git a/salt/modules/zcbuildout.py b/salt/modules/zcbuildout.py index <HASH>..<HASH> 100644 --- a/salt/modules/zcbuildout.py +++ b/salt/modules/zcbuildout.py @@ -33,13 +33,14 @@ def __virtual__(): return __virtualname__ return False - +# Import python libs import os import re import sys import traceback import urllib2 +# Import salt libs from salt.exceptions import CommandExecutionError from salt._compat import string_types @@ -102,7 +103,7 @@ def _salt_callback(func): return _call_callback -class Logger(): +class _Logger(): levels = ('info', 'warn', 'debug', 'error') def __init__(self): @@ -147,7 +148,7 @@ class Logger(): return self._by_level -LOG = Logger() +LOG = _Logger() def _set_status(m,
don't expose the Logger class to the loader
saltstack_salt
train
py
65bdbc0e20496cf6b4e91402c51ea45b182fe0c9
diff --git a/buffalo/cmd/new.go b/buffalo/cmd/new.go index <HASH>..<HASH> 100644 --- a/buffalo/cmd/new.go +++ b/buffalo/cmd/new.go @@ -36,6 +36,10 @@ var newCmd = &cobra.Command{ return fmt.Errorf("Name %s is not allowed, try a different application name", app.Name) } + if nameHasIllegalCharacter() { + return fmt.Errorf("Name %s is not allowed, application name should not have slashes or dots", app.Name) + } + if app.Name == "." { app.Name = filepath.Base(app.RootPath) } else { @@ -78,6 +82,20 @@ func forbiddenName() bool { return contains(forbiddenAppNames, strings.ToLower(app.Name)) } +func nameHasIllegalCharacter() bool { + illegal := []string{ + "/", "\\", ".", + } + + for _, ch := range illegal { + if strings.Contains(app.Name, ch) { + return true + } + } + + return false +} + func validateInGoPath() error { gpMultiple := envy.GoPaths()
validating name doesn't have special characters
gobuffalo_buffalo
train
go
88ea0182d0d598607c3c055eb28f9a559d9a7012
diff --git a/dashboard_app/view_mixins.py b/dashboard_app/view_mixins.py index <HASH>..<HASH> 100644 --- a/dashboard_app/view_mixins.py +++ b/dashboard_app/view_mixins.py @@ -1,6 +1,6 @@ """Useful mixins for views.""" from django import http -from django.utils import simplejson as json +import json from django.utils.decorators import method_decorator from .decorators import permission_required
Compatibility with Django <I>
bitlabstudio_django-dashboard-app
train
py
6d32f79da5cc4307ce58f86539fb7c0d5b2879f2
diff --git a/closure/goog/labs/testing/matcher.js b/closure/goog/labs/testing/matcher.js index <HASH>..<HASH> 100644 --- a/closure/goog/labs/testing/matcher.js +++ b/closure/goog/labs/testing/matcher.js @@ -49,3 +49,31 @@ goog.labs.testing.Matcher.prototype.matches = function(value) {}; */ goog.labs.testing.Matcher.prototype.describe = function(value, opt_description) {}; + + +/** + * Generates a Matcher from the ‘matches’ and ‘describe’ functions passed in. + * + * @param {!Function} matchesFunction The ‘matches’ function. + * @param {Function=} opt_describeFunction The ‘describe’ function. + * @return {Function} The custom matcher. + */ +goog.labs.testing.Matcher.makeMatcher = + function(matchesFunction, opt_describeFunction) { + + /** + * @constructor + * @implements {goog.labs.testing.Matcher} + */ + var matcherConstructor = function() {}; + + /** @override */ + matcherConstructor.prototype.matches = matchesFunction; + + if (opt_describeFunction) { + /** @override */ + matcherConstructor.prototype.describe = opt_describeFunction; + } + + return matcherConstructor; +};
Added the makeMatcher function from the sample implementation in the design doc. ------------- Created by MOE: <URL>
google_closure-library
train
js
0be17dec6b12909517c9079ff4a3c5a56d640704
diff --git a/demoapp/setup.py b/demoapp/setup.py index <HASH>..<HASH> 100644 --- a/demoapp/setup.py +++ b/demoapp/setup.py @@ -64,8 +64,10 @@ setup( 'simple = cliffdemo.simple:Simple', 'two_part = cliffdemo.simple:Simple', 'error = cliffdemo.simple:Error', + 'list files = cliffdemo.list:Files', 'files = cliffdemo.list:Files', 'file = cliffdemo.show:File', + 'show file = cliffdemo.show:File', ], },
declare a couple of commands that use builtin command names but use multiple words
dreamhost_cliff-tablib
train
py
c9e2079ab82901c6f9345337d1b1a577fdc58a23
diff --git a/model/storage/RdsStorage.php b/model/storage/RdsStorage.php index <HASH>..<HASH> 100644 --- a/model/storage/RdsStorage.php +++ b/model/storage/RdsStorage.php @@ -244,7 +244,7 @@ class RdsStorage extends ConfigurableService implements RevisionStorageInterface [self::DATA_RESOURCE], $query, $options, - $predicate, + $predicate ); $resourcesUri = []; @@ -260,7 +260,7 @@ class RdsStorage extends ConfigurableService implements RevisionStorageInterface [self::DATA_RESOURCE, self::DATA_OBJECT], $query, $options, - $predicate, + $predicate ); $resourcesData= [];
fix: compatibility with php <I>
oat-sa_extension-tao-revision
train
php
56e046b33933963464544a1d3ba6191958bc069c
diff --git a/src/python/pants/backend/jvm/tasks/junit_run.py b/src/python/pants/backend/jvm/tasks/junit_run.py index <HASH>..<HASH> 100644 --- a/src/python/pants/backend/jvm/tasks/junit_run.py +++ b/src/python/pants/backend/jvm/tasks/junit_run.py @@ -243,7 +243,7 @@ class _JUnitRunner(object): for test, target in tests_and_targets.items(): if target is None: - self._context.log.warning('Unknown target for test %{0}'.format(test)) + self._context.log.warn('Unknown target for test %{0}'.format(test)) filename = get_test_filename(test)
Fix bad log statement in junit_run.py. Reviewed at <URL>
pantsbuild_pants
train
py
a97bfc58e5b17a265492371f0daade71b5a6d570
diff --git a/addon/components/md-select.js b/addon/components/md-select.js index <HASH>..<HASH> 100644 --- a/addon/components/md-select.js +++ b/addon/components/md-select.js @@ -27,15 +27,17 @@ export default MaterializeInputField.extend({ errorsDidChange: Ember.observer('errors', function() { var inputSelector = this.$('input'); // monitor the select's validity and copy the appropriate validation class to the materialize input element. - Ember.run.later(this, function() { - var isValid = this.$('select').hasClass('valid'); - if (isValid) { - inputSelector.removeClass('invalid'); - inputSelector.addClass('valid'); - } else { - inputSelector.removeClass('valid'); - inputSelector.addClass('invalid'); - } - }, 150); + if (!Ember.isNone(inputSelector)) { + Ember.run.later(this, function() { + var isValid = this.$('select').hasClass('valid'); + if (isValid) { + inputSelector.removeClass('invalid'); + inputSelector.addClass('valid'); + } else { + inputSelector.removeClass('valid'); + inputSelector.addClass('invalid'); + } + }, 150); + } }) });
Observer was causing timing issues - check for presence of element before using it.
mike-north_ember-cli-materialize
train
js
3d22ae32a1a0c0f6779c65204cee6fb6326ec11d
diff --git a/init.js b/init.js index <HASH>..<HASH> 100644 --- a/init.js +++ b/init.js @@ -13,7 +13,7 @@ const replace = require('replace'), prompt = require('prompt'); exports.themeInfo = () => { - prompt.start(); + //prompt.start(); prompt.get(['Theme_Name', 'Theme_URI', 'Author', 'Author_URI', 'Description', 'License', 'License_URI', 'Text_Domain'], function (err, result) { let themeName = result.Theme_Name,
One more test before bailing on modules
factor1_prelude-wp
train
js
77598c2cc6f069a2acee6b667219051fecdec1c3
diff --git a/server/server.go b/server/server.go index <HASH>..<HASH> 100644 --- a/server/server.go +++ b/server/server.go @@ -176,14 +176,18 @@ func (m *Command) Wait() error { // setupLogger sets up the logger based on the configuration. func (m *Command) setupLogger() error { - var err error if m.Config.LogPath == "" { m.logOutput = m.Stderr } else { - m.logOutput, err = os.OpenFile(m.Config.LogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600) + f, err := os.OpenFile(m.Config.LogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600) if err != nil { return errors.Wrap(err, "opening file") } + m.logOutput = f + err = syscall.Dup2(int(f.Fd()), int(os.Stderr.Fd())) + if err != nil { + return errors.Wrap(err, "dup2ing stderr onto logfile") + } } if m.Config.Verbose {
dup log output onto stderr to catch panics in log file
pilosa_pilosa
train
go
e3c9f78b1be8a7752c061a4e97c14ffae4999c23
diff --git a/esteid/middleware.py b/esteid/middleware.py index <HASH>..<HASH> 100644 --- a/esteid/middleware.py +++ b/esteid/middleware.py @@ -1,4 +1,5 @@ import logging +import warnings from django.utils.cache import patch_vary_headers @@ -154,3 +155,10 @@ class NginxIdCardMiddleware(BaseIdCardMiddleware): class IdCardMiddleware(NginxIdCardMiddleware): """ Deprecated - use ApacheIdCardMiddleware or NginxIdCardMiddleware """ + + def __init__(self, *args, **kwargs): + warnings.warn( + "IdCardMiddleware is deprecated - use ApacheIdCardMiddleware or NginxIdCardMiddleware", + DeprecationWarning, stacklevel=2 + ) + super().__init__(*args, **kwargs)
Add runtime deprecation warning to IdCardMiddleware
thorgate_django-esteid
train
py
f275d0fad1d97680e89e87111979fe06086be9bd
diff --git a/test/protractorConf.js b/test/protractorConf.js index <HASH>..<HASH> 100644 --- a/test/protractorConf.js +++ b/test/protractorConf.js @@ -50,7 +50,8 @@ exports.config = { // // Spec patterns are relative to the location of this config. specs: [ - 'test/protractor/*.spec.js' + 'test/protractor/*.spec.js', + '!**/exclude.spec.js' ], // ----- Capabilities to be passed to the webdriver instance ----
Adding dummy spec to test exclusion
r3b_grunt-protractor-coverage
train
js
44cb1e843ca93eac343e976bf6e55328bb4d6849
diff --git a/lib/cuke_modeler/version.rb b/lib/cuke_modeler/version.rb index <HASH>..<HASH> 100644 --- a/lib/cuke_modeler/version.rb +++ b/lib/cuke_modeler/version.rb @@ -1,4 +1,4 @@ module CukeModeler # The gem version - VERSION = "1.0.1" + VERSION = "1.0.2" end
Version bump. Incrementing the gem version to <I> in preparation for the upcoming release.
enkessler_cuke_modeler
train
rb
c19b48dc196218c0e07f08ea89c81303220171a8
diff --git a/userena/models.py b/userena/models.py index <HASH>..<HASH> 100644 --- a/userena/models.py +++ b/userena/models.py @@ -10,15 +10,14 @@ from django.utils.translation import ugettext_lazy as _ from easy_thumbnails.fields import ThumbnailerImageField from guardian.shortcuts import get_perms from userena import settings as userena_settings -from userena.managers import UserenaManager, UserenaBaseProfileManager +from userena.managers import UserenaManager, UserenaBaseProfileManager, \ + ASSIGNED_PERMISSIONS from userena.utils import get_gravatar, generate_sha1, get_protocol, \ get_datetime_now import datetime -PROFILE_PERMISSIONS = ( - ('view_profile', 'Can view profile'), -) +PROFILE_PERMISSIONS = ASSIGNED_PERMISSIONS['profile'] def upload_to_mugshot(instance, filename):
adds the permissions defined in managers.py to the models, this way 'manage.py migrate' should be able to create the right permissions
bread-and-pepper_django-userena
train
py
efe62900c82a696172f75ae5f3fd0873ad317f47
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -696,9 +696,9 @@ module ActiveRecord def extended_type_map(default_timezone:) # :nodoc: Type::TypeMap.new(self::TYPE_MAP).tap do |m| - register_class_with_precision m, %r(time)i, Type::Time, timezone: default_timezone - register_class_with_precision m, %r(datetime)i, Type::DateTime, timezone: default_timezone - m.alias_type %r(timestamp)i, "datetime" + register_class_with_precision m, %r(\A[^\(]*time)i, Type::Time, timezone: default_timezone + register_class_with_precision m, %r(\A[^\(]*datetime)i, Type::DateTime, timezone: default_timezone + m.alias_type %r(\A[^\(]*timestamp)i, "datetime" end end
Don't match "time" inside SET()/ENUM() We previously relied upon definition order to prevent this, but now we're defining these types in a child TypeMap, so that won't work. The loose patterns we define here seem like they'd be in general danger of this sort of issue, but for now we can just address the immediately affected ones.
rails_rails
train
rb
985668470b223043e94b543654dd96e531f3fec9
diff --git a/lib/haml/temple_engine.rb b/lib/haml/temple_engine.rb index <HASH>..<HASH> 100644 --- a/lib/haml/temple_engine.rb +++ b/lib/haml/temple_engine.rb @@ -54,7 +54,7 @@ module Haml end def precompiled_with_return_value - "#{precompiled};#{precompiled_method_return_value}" + "#{precompiled};#{precompiled_method_return_value}".dup end # The source code that is evaluated to produce the Haml document. @@ -77,7 +77,7 @@ ensure @haml_buffer = @haml_buffer.upper if @haml_buffer end END - "#{preamble}#{locals_code(local_names)}#{precompiled}#{postamble}" + "#{preamble}#{locals_code(local_names)}#{precompiled}#{postamble}".dup end private
unfreeze TempleEngine precompiled string literals (#<I>) Maintain backwards-compatibility in public API.
haml_haml
train
rb
a5e21cbe8f135596e66dbf95616a43ce7eb56499
diff --git a/env.py b/env.py index <HASH>..<HASH> 100644 --- a/env.py +++ b/env.py @@ -56,13 +56,13 @@ def prefix(prefix): def map(**kwargs): """Returns a dictionary of the given keyword arguments mapped to their - values from the environment. + values from the environment, with input and output keys lower cased. """ d = {} e = lower_dict(environ.copy()) for k, v in kwargs.iteritems(): - d[k] = e.get(v) + d[k.lower()] = e.get(v.lower()) return d
Modified map to input and output lower cased keys.
kennethreitz_env
train
py
5546391f5fb45fd56b5bc23addf2620a0dde75d8
diff --git a/lib/plugins.js b/lib/plugins.js index <HASH>..<HASH> 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -83,12 +83,12 @@ exports.redirect = function(page, settings, request, response) { }; exports.referrer = function(page, settings, request) { - var ref = request.get('Referer'); - if (!ref) return; + var ref = request.get('Referer') || ""; settings.scripts.push({ fn: function(ref) { Object.defineProperty(document, "referrer", { - get: function() { return "prerender"; } + configurable: true, + get: function() { return ref; } }); }, args: [ref]
Update referrer and let it configurable
kapouer_express-dom
train
js
a697b70526dac1896a46d3e5de84c5e239b4ad07
diff --git a/refract/json.py b/refract/json.py index <HASH>..<HASH> 100644 --- a/refract/json.py +++ b/refract/json.py @@ -46,7 +46,7 @@ class JSONSerialiser: for (k, v) in element.attributes.items()] ) - if element.content or element.element == "null": + if element.content is not None or element.element == "null": if isinstance(element.content, KeyValuePair): content = {}
fix(json serialiser): Serialise empty array as `[]`
kylef_refract.py
train
py
f2a826b1b9654bf3f028989231f2d3c53fda674c
diff --git a/queue/queue.go b/queue/queue.go index <HASH>..<HASH> 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -89,9 +89,9 @@ func Queue() (monsterqueue.Queue, error) { if queueData.instance != nil { return queueData.instance, nil } - queueMongoUrl, _ := config.GetString("queue:mongo-url") - if queueMongoUrl == "" { - queueMongoUrl = "localhost:27017" + queueMongoURL, _ := config.GetString("queue:mongo-url") + if queueMongoURL == "" { + queueMongoURL = "localhost:27017" } queueMongoDB, _ := config.GetString("queue:mongo-database") pollingInterval, _ := config.GetFloat("queue:mongo-polling-interval") @@ -100,7 +100,7 @@ func Queue() (monsterqueue.Queue, error) { } conf := mongodb.QueueConfig{ CollectionPrefix: "tsuru", - Url: queueMongoUrl, + Url: queueMongoURL, Database: queueMongoDB, PollingInterval: time.Duration(pollingInterval * float64(time.Second)), }
lint: transforms queueMongoUrl into queueMongoURL
tsuru_tsuru
train
go
d77da037234af7e7420701fb23f68c94bace4cf1
diff --git a/source/rafcon/gui/resave_state_machines.py b/source/rafcon/gui/resave_state_machines.py index <HASH>..<HASH> 100755 --- a/source/rafcon/gui/resave_state_machines.py +++ b/source/rafcon/gui/resave_state_machines.py @@ -62,9 +62,7 @@ def trigger_gui_signals(*args): menubar_ctrl = main_window_controller.get_controller('menu_bar_controller') try: sm_manager_model.selected_state_machine_id = state_machine.state_machine_id - gui_helper_state_machine.save_state_machine_as(path=setup_config['target_path'][0]) - while state_machine.marked_dirty: - time.sleep(0.1) + call_gui_callback(gui_helper_state_machine.save_state_machine_as, path=setup_config['target_path'][0]) except: logger.exception("Could not save state machine") finally: @@ -161,7 +159,6 @@ def convert_libraries_in_path(config_path, lib_path, target_path=None, gui_confi logger.debug("lib_root_path/lib_path .*-folder are ignored if within lib_path, " "e.g. -> {0} -> full path is {1}".format(lib, child_lib_path)) - if __name__ == '__main__': import sys if len(sys.argv) < 3:
fix(resave_state_machines): synced call of save_state_machine_as
DLR-RM_RAFCON
train
py
cb3936b34449c7eb9ce639cff2723fa70605a4dc
diff --git a/raiden/settings.py b/raiden/settings.py index <HASH>..<HASH> 100644 --- a/raiden/settings.py +++ b/raiden/settings.py @@ -46,6 +46,6 @@ ORACLE_BLOCKNUMBER_DRIFT_TOLERANCE = 3 ETHERSCAN_API = 'https://{network}.etherscan.io/api?module=proxy&action={action}' RED_EYES_CONTRACT_VERSION = '0.4.0' -DEVELOPMENT_CONTRACT_VERSION = None +DEVELOPMENT_CONTRACT_VERSION = '0.9.0' SUPPORTED_ETH_CLIENTS = ('geth', 'parity')
None is not useful if comparing against contract_manager.contracts_version
raiden-network_raiden
train
py
fcf986241d55242f73ce00c258e4f3f9661a20ba
diff --git a/werkzeug/_internal.py b/werkzeug/_internal.py index <HASH>..<HASH> 100644 --- a/werkzeug/_internal.py +++ b/werkzeug/_internal.py @@ -82,10 +82,11 @@ def _log(type, message, *args, **kwargs): global _logger if _logger is None: import logging - handler = logging.StreamHandler() _logger = logging.getLogger('werkzeug') - _logger.addHandler(handler) - _logger.setLevel(logging.INFO) + if _logger.getEffectiveLevel() == logging.NOTSET: + _logger.setLevel(logging.INFO) + handler = logging.StreamHandler() + _logger.addHandler(handler) getattr(_logger, type)(message.rstrip(), *args, **kwargs)
allow logging configuration from manage scripts
pallets_werkzeug
train
py
887be4fdd4f6d2e38eb226a3ec70e264426ae3da
diff --git a/classes/phing/filters/StripLineBreaks.php b/classes/phing/filters/StripLineBreaks.php index <HASH>..<HASH> 100755 --- a/classes/phing/filters/StripLineBreaks.php +++ b/classes/phing/filters/StripLineBreaks.php @@ -140,7 +140,7 @@ class StripLineBreaks extends BaseParamFilterReader implements ChainableReader $params = $this->getParameters(); if ($params !== null) { for ($i = 0; $i < count($params); $i++) { - if (self::LINE_BREAKS_KEY === $params[$i]->getName()) { + if (self::LINES_BREAKS_KEY === $params[$i]->getName()) { $userDefinedLineBreaks = $params[$i]->getValue(); break; }
Fixed call to undefined class constant.
phingofficial_phing
train
php
19479ebdfb3a658e1e959f6cc779c6b3166a0d75
diff --git a/backup/restorelib.php b/backup/restorelib.php index <HASH>..<HASH> 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -551,6 +551,16 @@ $course->hiddensections = addslashes($course_header->course_hiddensections); $course->timecreated = addslashes($course_header->course_timecreated); $course->timemodified = addslashes($course_header->course_timemodified); + //Calculate sortorder field + $sortmax = get_record_sql('SELECT MAX(sortorder) AS max + FROM ' . $CFG->prefix . 'course + WHERE category=' . $course->category); + if (!empty($sortmax->max)) { + $course->sortorder = $sortmax->max + 1; + unset($sortmax); + } else { + $course->sortorder = 100; + } //Now insert the record $newid = insert_record("course",$course); if ($newid) {
Calculate NEXT course->sortorder in restore to avoid sortorder grown always (by fix_course_sortorder()). Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
09019e417e1ffc92e2ef77794f7fa4bbced227a7
diff --git a/examples/index.js b/examples/index.js index <HASH>..<HASH> 100644 --- a/examples/index.js +++ b/examples/index.js @@ -126,15 +126,6 @@ hunt.extendApp(function (core) { */ hunt.extendController('/', function (core, router) { - if (core.config.env === 'production') { - router.use(function (req, res, next) { - if (req.protocol === 'http') { - res.redirect(core.config.hostUrl); - } else { - next(); - } - }); - } /* * Setting middleware to irritate user who have not verified his account
remove http->https middleware in example, because it causes errors with socket.io
vodolaz095_hunt
train
js
da93dc6416852cfdbee2ef6775e43f0552769806
diff --git a/cherrypy/_cprequest.py b/cherrypy/_cprequest.py index <HASH>..<HASH> 100644 --- a/cherrypy/_cprequest.py +++ b/cherrypy/_cprequest.py @@ -35,6 +35,7 @@ class Request(object): self.hooks = tools.HookMap(pts) self.hooks.failsafe = ['on_start_resource', 'on_end_resource', 'on_end_request'] + self.redirections = [] def close(self): if not self.closed: @@ -110,6 +111,7 @@ class Request(object): break except cherrypy.InternalRedirect, ir: pi = ir.path + self.redirections.append(pi) except (KeyboardInterrupt, SystemExit): raise except: @@ -144,9 +146,6 @@ class Request(object): self.hooks.run('before_finalize') cherrypy.response.finalize() except (cherrypy.HTTPRedirect, cherrypy.HTTPError), inst: - # For an HTTPRedirect or HTTPError (including NotFound), - # we don't go through the regular mechanism: - # we return the redirect or error page immediately inst.set_response() self.hooks.run('before_finalize') cherrypy.response.finalize()
Might as well keep track of InternalRedirects.
cherrypy_cheroot
train
py
2c9e4e5b5091b43d766b3fbd8e68224614eab1f7
diff --git a/paramiko_expect.py b/paramiko_expect.py index <HASH>..<HASH> 100755 --- a/paramiko_expect.py +++ b/paramiko_expect.py @@ -368,6 +368,10 @@ class SSHClientInteraction(object): # Restore the attributes of the shell you were in termios.tcsetattr(sys.stdin, termios.TCSADRAIN, original_tty) else: + # We must set the timeout to None so that we can bypass times when + # there is no available text to receive + self.channel.settimeout(None) + def writeall(sock): while True: buffer = sock.recv(self.buffer_size)
Apply timeout removal on Windows when going interactive
fgimian_paramiko-expect
train
py
69cce5770cc91a7ac783a7c383c6b990202b6c42
diff --git a/src/drawer.js b/src/drawer.js index <HASH>..<HASH> 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -384,7 +384,7 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ this.context.save(); this.context.globalAlpha = opacity; - if (compositeOperation !== undefined && compositeOperation !== null) { + if (compositeOperation) { this.context.globalCompositeOperation = compositeOperation; } this.context.drawImage( diff --git a/src/tiledimage.js b/src/tiledimage.js index <HASH>..<HASH> 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1330,7 +1330,7 @@ function drawTiles( tiledImage, lastDrawn ) { return; } var useSketch = tiledImage.opacity < 1 || - (tiledImage.compositeOperation !== null && tiledImage.compositeOperation !== 'source-over'); + (tiledImage.compositeOperation && tiledImage.compositeOperation !== 'source-over'); var sketchScale; var sketchTranslate;
simplify the checks on compositeOperation
openseadragon_openseadragon
train
js,js
d6074c9b670dccd7e9159a63924f60170179a869
diff --git a/O365/message.py b/O365/message.py index <HASH>..<HASH> 100644 --- a/O365/message.py +++ b/O365/message.py @@ -296,7 +296,15 @@ class Message(ApiComponent, AttachableMixin, HandleRecipientsMixin): @body.setter def body(self, value): - self.__body = value + if self.__body: + if not value: + self.__body = '' + else: + soup = bs(self.__body, 'html.parser') + soup.body.insert(0, value) + self.__body = str(soup) + else: + self.__body = value self._track_changes.add('body') @property diff --git a/tests/test_mailbox.py b/tests/test_mailbox.py index <HASH>..<HASH> 100644 --- a/tests/test_mailbox.py +++ b/tests/test_mailbox.py @@ -53,6 +53,10 @@ class TestMailBox: message = messages[0] if messages else None if message: reply = message.reply() + reply.body = 'Y bien que lo sé. España es lo máximo.' + reply.save_draft() + reply.send() + print(reply.body) assert reply is not None
Message: Fixed body trail lost on reply and forward messages. Now the contents of the body are preserved. Also now setting the body will stack the changes one on top of the other. To avoid this just set the body to '' or None.
O365_python-o365
train
py,py
14dfbf60927054c6323a7f869659cd5ead205b4b
diff --git a/basil/dut.py b/basil/dut.py index <HASH>..<HASH> 100644 --- a/basil/dut.py +++ b/basil/dut.py @@ -125,12 +125,19 @@ class Dut(Base): catch_exception_on_init(item) def close(self): + def catch_exception_on_close(mod): + if not mod.is_initialized(): + try: + mod.close() + except: + pass + for item in self._registers.itervalues(): - item.close() + catch_exception_on_close(item) for item in self._hardware_layer.itervalues(): - item.close() + catch_exception_on_close(item) for item in self._transfer_layer.itervalues(): - item.close() + catch_exception_on_close(item) def set_configuration(self, conf): conf = self._open_conf(conf)
ENH: do not close when not initialized, catch exception and give other devices a chance to close properly
SiLab-Bonn_basil
train
py
c0c6460bafe1553acde6826005037aa3509d5944
diff --git a/bebop/connection.py b/bebop/connection.py index <HASH>..<HASH> 100644 --- a/bebop/connection.py +++ b/bebop/connection.py @@ -6,15 +6,6 @@ Created on Feb 18, 2011 #@todo: rewrite pysolr import pysolr -try: - from gevent import monkey - monkey.patch_all() -except ImportError: - try: - import eventlet - eventlet.monkey_patch() - except ImportError: - pass class SolrConn(object): def __init__(self, conn, id='main'):
[fix] being a good neighbor and not monkey patching socket, doesn't work when you have gevent installed but are using a threaded server
albarrentine_bebop
train
py
2fe63165c3c5e3b00e8bc5d4f288d1373755388f
diff --git a/commands/SerialCommand.js b/commands/SerialCommand.js index <HASH>..<HASH> 100644 --- a/commands/SerialCommand.js +++ b/commands/SerialCommand.js @@ -332,6 +332,15 @@ SerialCommand.prototype = extend(BaseCommand.prototype, { return wifi.promise; }, + _removePhotonNetworks: function(ssids) { + return ssids.filter(function (ap) { + if (ap.indexOf('Photon-') === 0) { + return false; + } + return true; + }); + }, + _getWifiInformation: function(device, networks) { var wifiInfo = when.defer(); var self = this; @@ -340,13 +349,16 @@ SerialCommand.prototype = extend(BaseCommand.prototype, { networks = networks || []; var networkMap = _.indexBy(networks, 'ssid'); + var ssids = _.pluck(networks, 'ssid'); + ssids = this._removePhotonNetworks(ssids); + inquirer.prompt([ { type: 'list', name: 'ap', message: chalk.bold.white('Select the Wi-Fi network with which you wish to connect your device:'), choices: function () { - var ns = _.pluck(networks, 'ssid'); + var ns = ssids.slice(); ns.unshift(new inquirer.Separator()); ns.unshift(rescanLabel); ns.unshift(new inquirer.Separator());
Filter Photon networks from serial wifi config Fixes #<I>
particle-iot_particle-cli
train
js
b48f071b2224eb51e12a989bb722cf678e046e4c
diff --git a/nodeserver/src/client/js/Client/ClientMaster.js b/nodeserver/src/client/js/Client/ClientMaster.js index <HASH>..<HASH> 100644 --- a/nodeserver/src/client/js/Client/ClientMaster.js +++ b/nodeserver/src/client/js/Client/ClientMaster.js @@ -75,11 +75,11 @@ define([ //and create actor for all started branches... //if there is none, then we simply collects the projects from the server and waits for a selection from user interface... var init = function () { - var proxy = parameters.proxy; - if( proxy.substring(0, 7) !== "http://" ) { - proxy = "http://" + proxy; + var xproxy = parameters.proxy; + if( xproxy.substring(0, 7) !== "http://" ) { + xproxy = "http://" + xproxy; } - var tempproxy = io.connect(proxy, parameters.options); + var tempproxy = io.connect(xproxy, parameters.options); var firstproject = null; tempproxy.on('connect', function () { proxy = tempproxy;
nodeserver: fix bug introduced in previous commit Former-commit-id: <I>d9ef0eb<I>dfa<I>d<I>d<I>f8c4ea<I>c0ed
webgme_webgme-engine
train
js
03a02d58d4560c8a72ab269bef8ed48cc944e810
diff --git a/src/Framework/Application/Factory/ApplicationFactory.php b/src/Framework/Application/Factory/ApplicationFactory.php index <HASH>..<HASH> 100644 --- a/src/Framework/Application/Factory/ApplicationFactory.php +++ b/src/Framework/Application/Factory/ApplicationFactory.php @@ -56,6 +56,10 @@ final class ApplicationFactory implements FactoryInterface } }; - return new Application($routeGenerator()); + return new Application( + $routeGenerator(), + $container->has(RequestHandlerInterface::class) ? + $container->get(RequestHandlerInterface::class) : null + ); } }
Update factory to pass RequestHandlerInterface if available
phOnion_framework
train
php
a4d21f85ece031bc6df52230045771be9764488e
diff --git a/app/controllers/katello/api/v2/content_views_controller.rb b/app/controllers/katello/api/v2/content_views_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/katello/api/v2/content_views_controller.rb +++ b/app/controllers/katello/api/v2/content_views_controller.rb @@ -83,10 +83,8 @@ module Katello param :minor, :number, :desc => N_("Override the minor version number"), :required => false param :repos_units, Array, :desc => N_("Specify the list of units in each repo"), :required => false do - param :repo_units, Hash, :desc => N_("a hash containing a repo label and list of units"), :required => true do - param :label, String, :desc => N_("repo label"), :required => true - param :rpm_filenames, Array, :desc => N_("list of rpm filename strings to include in published version"), :required => true - end + param :label, String, :desc => N_("repo label"), :required => true + param :rpm_filenames, Array, of: String, :desc => N_("list of rpm filename strings to include in published version"), :required => true end def publish if params[:repos_units].present? && @view.composite?
Refs #<I> - apipie fixup for new CV publish api The previous apipie definition was incorrect and caused problems with hammer. The Hash definition is implicit and only the keys inside need to be defined.
Katello_katello
train
rb
c86114ce9cd2fe2e796a98dad837ecab8b956c76
diff --git a/update-db.js b/update-db.js index <HASH>..<HASH> 100644 --- a/update-db.js +++ b/update-db.js @@ -256,6 +256,10 @@ module.exports = function updateDB (print) { var lock = detectLockfile() var latest = getLatestInfo(lock) + if (latest.version.indexOf(',') > -1) { + latest.version = latest.version.split(',')[0].trim() + } + var browsersListRetrievalError var oldBrowsersList try {
Try to fix pnpm use case
browserslist_browserslist
train
js
2128f753bcbed448dfabacbd8f3a1fd58f87e7d6
diff --git a/js/coinbasepro.js b/js/coinbasepro.js index <HASH>..<HASH> 100644 --- a/js/coinbasepro.js +++ b/js/coinbasepro.js @@ -680,13 +680,6 @@ module.exports = class coinbasepro extends Exchange { // "epoch":1589270451.504 // } // - // coinbase can send a float epoch value with - // a decimal a dot followed by no decimal digits like 1589270451. - // in that case the underlying json parser will return a string - // - if (typeof response === 'string') { - response = JSON.parse (response); - } return this.safeTimestamp (response, 'epoch'); }
coinbasepro fetchTime json fix reverted
ccxt_ccxt
train
js
dd47afa94f36ca06d614df3f580b63f0f3694766
diff --git a/classes/Boom/Core.php b/classes/Boom/Core.php index <HASH>..<HASH> 100755 --- a/classes/Boom/Core.php +++ b/classes/Boom/Core.php @@ -74,7 +74,7 @@ abstract class Boom_Core $page = ORM::factory('Page') ->with_current_version(Editor::instance(), FALSE) - ->where('id', '=', $page_id) + ->where('page.id', '=', $page_id) ->find(); } else
Bugfix with finding page by short url when not logged in
boomcms_boom-core
train
php
6d9fa3de398f1f9749b55a360b2891c8c8f04340
diff --git a/server/sonar-web/src/main/js/coding-rules/facets/quality-profile-facet.js b/server/sonar-web/src/main/js/coding-rules/facets/quality-profile-facet.js index <HASH>..<HASH> 100644 --- a/server/sonar-web/src/main/js/coding-rules/facets/quality-profile-facet.js +++ b/server/sonar-web/src/main/js/coding-rules/facets/quality-profile-facet.js @@ -17,13 +17,20 @@ define([ getValues: function () { var that = this, - values = this.options.app.qualityProfiles.map(function (profile) { - return { - label: profile.name, - extra: that.options.app.languages[profile.lang], - val: profile.key - }; - }); + languagesQuery = this.options.app.state.get('query').languages, + languages = languagesQuery != null ? languagesQuery.split(',') : [], + lang = languages.length === 1 ? languages[0] : null, + values = this.options.app.qualityProfiles + .filter(function (profile) { + return lang != null ? profile.lang === lang : true; + }) + .map(function (profile) { + return { + label: profile.name, + extra: that.options.app.languages[profile.lang], + val: profile.key + }; + }); return _.sortBy(values, 'label'); },
SONAR-<I> show only profiles that match the selected language
SonarSource_sonarqube
train
js
c5859c7254448d2cdbc877b00580bd95fa6e7e2e
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index <HASH>..<HASH> 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -726,13 +726,13 @@ class DruidDatasource(Model, BaseDatasource): orderby=None, extras=None, # noqa select=None, # noqa - columns=None, phase=2): + columns=None, phase=2, client=None): """Runs a query against Druid and returns a dataframe. This query interface is common to SqlAlchemy and Druid """ # TODO refactor into using a TBD Query object - client = self.cluster.get_pydruid_client() + client = client or self.cluster.get_pydruid_client() if not is_timeseries: granularity = 'all' inner_from_dttm = inner_from_dttm or from_dttm @@ -933,7 +933,7 @@ class DruidDatasource(Model, BaseDatasource): def query(self, query_obj): qry_start_dttm = datetime.now() client = self.cluster.get_pydruid_client() - query_str = self.get_query_str(**query_obj) + query_str = self.get_query_str(client=client, **query_obj) df = client.export_pandas() if df is None or df.size == 0:
[hotfix] druid queries 'There was no query executed' issue
apache_incubator-superset
train
py
368e04dc7a47569d883ae049e86f8632dfdf8f86
diff --git a/mod/data/view.php b/mod/data/view.php index <HASH>..<HASH> 100644 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -572,7 +572,7 @@ if ($showactivity) { AND r.dataid = :dataid AND r.userid = u.id '; $params['dataid'] = $data->id; - $sortorder = ' ORDER BY '.$ordering.', r.id ASC '; + $sortorder = " ORDER BY $ordering, r.id $order"; $searchselect = ''; // If requiredentries is not reached, only show current user's entries
MDL-<I>: mod_data: Simultaneously added entries do not sort correctly This was picked up by behat on a fast machine, when using shorter polling interval.
moodle_moodle
train
php
ef641dc3c9ebbd0ad820e2a78213994c9d82b8a6
diff --git a/src/jump/__init__.py b/src/jump/__init__.py index <HASH>..<HASH> 100644 --- a/src/jump/__init__.py +++ b/src/jump/__init__.py @@ -28,7 +28,7 @@ def py_hash(key, num_buckets): Raises: ValueError: If `num_buckets` is not a positive number. """ - b, j = -1, 0 + b, j = -1, 0.0 if num_buckets < 1: raise ValueError(
ci(mypy): fix incompatible types in assignment src/jump/__init__.py:<I>:<I>: error: Incompatible types in assignment (expression has type "float", variable has type "int") j = float(b + 1) * (float(1 << <I>) / float((key >> <I>) + 1)) ^
lithammer_python-jump-consistent-hash
train
py
a43bfd9fdf23b67fbcba68ec01978026457c7235
diff --git a/internal/services/kusto/kusto_cluster_resource.go b/internal/services/kusto/kusto_cluster_resource.go index <HASH>..<HASH> 100644 --- a/internal/services/kusto/kusto_cluster_resource.go +++ b/internal/services/kusto/kusto_cluster_resource.go @@ -245,7 +245,7 @@ func resourceKustoCluster() *pluginsdk.Resource { Type: pluginsdk.TypeBool, Optional: true, Computed: true, - Deprecated: "This property has been renamed to auto_stop_enabled to be more consistent with the rest of the provider and will be removed in v3.0 of the provider", + Deprecated: "This property has been renamed to disk_encryption_enabled to be more consistent with the rest of the provider and will be removed in v3.0 of the provider", ConflictsWith: []string{"disk_encryption_enabled"}, }
Fix wrong deprecation warning for enable_disk_encryption (#<I>)
terraform-providers_terraform-provider-azurerm
train
go
eaa5e6947daf7256c5f68025c5b4a1ddc6eca4ef
diff --git a/raiden/network/proxies/token_network.py b/raiden/network/proxies/token_network.py index <HASH>..<HASH> 100644 --- a/raiden/network/proxies/token_network.py +++ b/raiden/network/proxies/token_network.py @@ -1114,7 +1114,7 @@ class TokenNetwork: 'Channel cannot be settled before settlement window is over', ) - raise RaidenRecoverableError( + raise RaidenUnrecoverableError( "Settling this channel failed although the channel's current state " - "is closed. Maybe it was already settled by the other participant?", + "is closed.", )
fix exception type If the channel is closed, and the settlement window is over, then settle is allowed, if the transaction failled then there is a bug with the settlement or the code which calls the smart contract. [ci integration]
raiden-network_raiden
train
py
65d30618878fe90dbc4e1e85b15fd31cd7bb2b0c
diff --git a/test/format_test.rb b/test/format_test.rb index <HASH>..<HASH> 100644 --- a/test/format_test.rb +++ b/test/format_test.rb @@ -60,6 +60,9 @@ class FormatTest < Test::Unit::TestCase format = Format.new(one_channel, 16, 44100) assert_equal(2, format.block_align) + + format = Format.new(one_channel, 32, 44100) + assert_equal(4, format.block_align) end [2, :stereo].each do |two_channels| @@ -68,6 +71,9 @@ class FormatTest < Test::Unit::TestCase format = Format.new(two_channels, 16, 44100) assert_equal(4, format.block_align) + + format = Format.new(two_channels, 32, 44100) + assert_equal(8, format.block_align) end end
Adding more tests for Format.block_align
jstrait_wavefile
train
rb
747ae8a38d334ea18d8f36d7149dcaab69b3b826
diff --git a/Twig/EasyAdminTwigExtension.php b/Twig/EasyAdminTwigExtension.php index <HASH>..<HASH> 100644 --- a/Twig/EasyAdminTwigExtension.php +++ b/Twig/EasyAdminTwigExtension.php @@ -183,8 +183,6 @@ class EasyAdminTwigExtension extends \Twig_Extension } catch (\Exception $e) { return $twig->render($entityConfiguration['templates']['label_undefined'], array('view' => $view)); } - - return $twig->render($entityConfiguration['templates']['label_undefined'], array('view' => $view)); } /**
Removed an unreachable code
EasyCorp_EasyAdminBundle
train
php
bbfa7bfaccff368dd3666f32fb47773f863ec242
diff --git a/lib/adapters/http.js b/lib/adapters/http.js index <HASH>..<HASH> 100644 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -128,6 +128,10 @@ module.exports = function httpAdapter(config) { transport = isHttps ? httpsFollow : httpFollow; } + if (config.maxContentLength) { + options.maxBodyLength = config.maxContentLength; + } + // Create the request var req = transport.request(options, function handleResponse(res) { if (req.aborted) return;
Fixing maxBodyLength exceeded error form follow-redirects when axios's maxContentLength is not exceeded
axios_axios
train
js
e1884a46a9fffe295deaaf0eeca04034d5a1d34e
diff --git a/eZ/Publish/API/Repository/Tests/SetupFactory/LegacySolr.php b/eZ/Publish/API/Repository/Tests/SetupFactory/LegacySolr.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Tests/SetupFactory/LegacySolr.php +++ b/eZ/Publish/API/Repository/Tests/SetupFactory/LegacySolr.php @@ -148,9 +148,9 @@ class LegacySolr extends Legacy // @TODO: Is there a nicer way to get access to all content objects? We // require this to run a full index here. - $getDatabaseMethod = new \ReflectionMethod( $persistenceHandler, 'getDatabase' ); - $getDatabaseMethod->setAccessible( true ); - $db = $getDatabaseMethod->invoke( $persistenceHandler ); + $dbHandlerProperty = new \ReflectionProperty( $persistenceHandler, 'dbHandler' ); + $dbHandlerProperty->setAccessible( true ); + $db = $dbHandlerProperty->getValue( $persistenceHandler ); $query = $db->createSelectQuery() ->select( 'id', 'current_version' )
Refactored access to internal DB handler
ezsystems_ezpublish-kernel
train
php
e99e30604af8a7688576723a41ab036502c8d16c
diff --git a/java/server/test/org/openqa/selenium/netty/server/RequestConverterTest.java b/java/server/test/org/openqa/selenium/netty/server/RequestConverterTest.java index <HASH>..<HASH> 100644 --- a/java/server/test/org/openqa/selenium/netty/server/RequestConverterTest.java +++ b/java/server/test/org/openqa/selenium/netty/server/RequestConverterTest.java @@ -56,7 +56,7 @@ public class RequestConverterTest { EmbeddedChannel channel = new EmbeddedChannel(converter); FullHttpRequest httpRequest = new DefaultFullHttpRequest( - HttpVersion.HTTP_1_1, HttpMethod.OPTIONS, "/cheese"); + HttpVersion.HTTP_1_1, HttpMethod.PATCH, "/cheese"); assertThat(channel.writeInbound(httpRequest)).isFalse(); FullHttpResponse res = channel.readOutbound();
[java] Using an actually unsupported method in tests, OPTIONS method support was added by commit 4d4eed0f<I>d7d<I>c<I>baf1c<I>e1e<I>
SeleniumHQ_selenium
train
java
e5242c55cd6e4999f0b16567f2250fc7b420141a
diff --git a/driver/src/test/acceptance/org/mongodb/acceptancetest/crud/QueryAcceptanceTest.java b/driver/src/test/acceptance/org/mongodb/acceptancetest/crud/QueryAcceptanceTest.java index <HASH>..<HASH> 100644 --- a/driver/src/test/acceptance/org/mongodb/acceptancetest/crud/QueryAcceptanceTest.java +++ b/driver/src/test/acceptance/org/mongodb/acceptancetest/crud/QueryAcceptanceTest.java @@ -17,7 +17,6 @@ package org.mongodb.acceptancetest.crud; import org.bson.BSONReader; -import org.bson.BSONType; import org.bson.BSONWriter; import org.bson.types.ObjectId; import org.junit.Ignore; @@ -26,7 +25,6 @@ import org.mongodb.ConvertibleToDocument; import org.mongodb.Document; import org.mongodb.MongoCollection; import org.mongodb.MongoCursor; -import org.mongodb.Sort; import org.mongodb.acceptancetest.AcceptanceTestCase; import org.mongodb.serialization.CollectibleSerializer;
Updated query test for new bson positions
mongodb_mongo-java-driver
train
java
1ea778567248db554e90f16d7c04700a046ffa2d
diff --git a/zxbparser.py b/zxbparser.py index <HASH>..<HASH> 100755 --- a/zxbparser.py +++ b/zxbparser.py @@ -2757,7 +2757,7 @@ def p_if_elseif_else(p): p[0] = make_block(p[6], p[7]) return - p[5][1].next.append(make_block(p[6], p[7])) + p[5][1].next[-1].next.append(make_block(p[6], p[7])) p[0] = p[5] return @@ -2765,7 +2765,7 @@ def p_if_elseif_else(p): p[0] = make_sentence('IF', p[2], p[4], make_block(p[6], p[7])) return - p[5][1].next[0].next.append(make_block(p[6], p[7])) + p[5][1].next[-1].next.append(make_block(p[6], p[7])) p[0] = make_sentence('IF', p[2], p[4], p[5][0])
Better this way, as the programmer might introduce unusual labels
boriel_zxbasic
train
py
671772aa93c5cc25822c1e485051445a515c42dd
diff --git a/lib/jets/core.rb b/lib/jets/core.rb index <HASH>..<HASH> 100644 --- a/lib/jets/core.rb +++ b/lib/jets/core.rb @@ -77,5 +77,19 @@ module Jets::Core def version Jets::VERSION end + + def eager_load! + Dir.glob("#{Jets.root}app/**/*.rb").select do |path| + next if !File.file?(path) or path =~ /javascript/ or path =~ %r{/views/} + + class_name = path + .sub(/\.rb$/,'') # remove .rb + .sub(/^\.\//,'') # remove ./ + .sub(/app\/\w+\//,'') # remove app/controllers or app/jobs etc + .classify + puts "eager_load! loading path: #{path} class_name: #{class_name}" if ENV['DEBUG'] + class_name.constantize # dont have to worry about order. + end + end end diff --git a/lib/jets/ruby_server.rb b/lib/jets/ruby_server.rb index <HASH>..<HASH> 100644 --- a/lib/jets/ruby_server.rb +++ b/lib/jets/ruby_server.rb @@ -17,6 +17,7 @@ module Jets def run $stdout.sync = true Jets.boot # outside of child process for COW + Jets.eager_load! # INT - ^C trap('INT') do
call Jets.eager_load as part of warmup
tongueroo_jets
train
rb,rb
a4d6eb717296b3b3ea728093a7a01c152612beab
diff --git a/src/python/pants/backend/codegen/tasks/scrooge_gen.py b/src/python/pants/backend/codegen/tasks/scrooge_gen.py index <HASH>..<HASH> 100644 --- a/src/python/pants/backend/codegen/tasks/scrooge_gen.py +++ b/src/python/pants/backend/codegen/tasks/scrooge_gen.py @@ -257,10 +257,11 @@ class ScroogeGen(NailgunTask, JvmToolTaskMixin): try: dependencies.update(self.context.resolve(depspec)) except AddressLookupError as e: - raise self.DepLookupError("{message}\n referenced from [{section}] key: {key}" \ - "in pants.ini" .format(message=e, section='thrift-gen', - key="gen->deps->{category}" - .format(cateegory=category))) + raise self.DepLookupError("{message}\n referenced from [{section}] key: " \ + "gen->deps->{category} in pants.ini".format( + message=e, section='thrift-gen', + key="{category}" + )) return self.GenInfo(gen, deps) return self._inject_target(gentarget, dependees,
Fix error in string formatting 1. Fix mis-spelled key "cateegory". 2. Simplify complicated format-within-format. Testing Done: Manual testing. Reviewed at <URL>
pantsbuild_pants
train
py
072e10e11ebaeda60f012c07cd9a5e5024f445a1
diff --git a/application/modules/g/views/helpers/SpawnJs.php b/application/modules/g/views/helpers/SpawnJs.php index <HASH>..<HASH> 100755 --- a/application/modules/g/views/helpers/SpawnJs.php +++ b/application/modules/g/views/helpers/SpawnJs.php @@ -203,6 +203,7 @@ class G_View_Helper_SpawnJs extends Zend_View_Helper_Abstract { $this->quoteIfNecessary($field->type, $field->default) : ( ( + $field->multilingual || !$field->required || $field->primary || $field->type === 'datetime' || $field->type === 'date' || $field->type === 'time' || $field->type === 'enum'
multilingual fields have null as defaultvalue
grrr-amsterdam_garp3
train
php
9191f149d08cfde3d044ec7f5a63a3b971a8c190
diff --git a/lib/comfortable_mexican_sofa/has_revisions.rb b/lib/comfortable_mexican_sofa/has_revisions.rb index <HASH>..<HASH> 100644 --- a/lib/comfortable_mexican_sofa/has_revisions.rb +++ b/lib/comfortable_mexican_sofa/has_revisions.rb @@ -2,13 +2,14 @@ module ComfortableMexicanSofa::HasRevisions def self.included(base) base.send :extend, ClassMethods - base.send :include, InstanceMethods end module ClassMethods def has_revisions_for(*fields) + include ComfortableMexicanSofa::HasRevisions::InstanceMethods + attr_accessor :revision_data has_many :revisions,
no need to inject instance methods right away
comfy_comfortable-mexican-sofa
train
rb
4a1b054b096450debf7fe3b5a2d94e0411c7aff3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( license='BSD', # Package info - packages=find_packages(exclude=('test',)), + packages=find_packages(exclude=('tests',)), zip_safe=True, install_requires=requirements,
Update setup.py (#<I>) Fix typo
pytorch_ignite
train
py
af73c55189c99cd1367e494cc608586a7da5ccb4
diff --git a/Swat/SwatNoteBook.php b/Swat/SwatNoteBook.php index <HASH>..<HASH> 100644 --- a/Swat/SwatNoteBook.php +++ b/Swat/SwatNoteBook.php @@ -210,9 +210,11 @@ class SwatNoteBook extends SwatWidget implements SwatUIParent $li_counter++; $li_tag = new SwatHtmlTag('li'); - if (($this->selected_page=== null && $li_counter == 1) || + $li_tag->class = 'tab'.$li_counter; + + if (($this->selected_page === null && $li_counter == 1) || ($page->id == $this->selected_page)) - $li_tag->class = 'selected'; + $li_tag->class.= ' selected'; $anchor_tag = new SwatHtmlTag('a'); $anchor_tag->href = '#'.$page->id;
Fix spacing, and add a class name to tabs so they can be styled svn commit r<I>
silverorange_swat
train
php
a5594c1710da9c9acf8a15b867978bc5a61631fc
diff --git a/tests/lib/rules/jsx-key.js b/tests/lib/rules/jsx-key.js index <HASH>..<HASH> 100644 --- a/tests/lib/rules/jsx-key.js +++ b/tests/lib/rules/jsx-key.js @@ -34,7 +34,8 @@ ruleTester.run('jsx-key', rule, { {code: '[1, 2, 3].map(x => { return <App key={x} /> });', parserOptions: parserOptions}, {code: '[1, 2, 3].foo(x => <App />);', parserOptions: parserOptions}, {code: 'var App = () => <div />;', parserOptions: parserOptions}, - {code: '[1, 2, 3].map(function(x) { return; });', parserOptions: parserOptions} + {code: '[1, 2, 3].map(function(x) { return; });', parserOptions: parserOptions}, + {code: 'foo(() => <div />);', parserOptions: parserOptions} ], invalid: [ {code: '[<App />];',
Added failing test for false positive result
ytanruengsri_eslint-plugin-react-ssr
train
js
52fd274a16f0a1c7e57789940e216048ee21bcde
diff --git a/bin/pa11y-ci.js b/bin/pa11y-ci.js index <HASH>..<HASH> 100755 --- a/bin/pa11y-ci.js +++ b/bin/pa11y-ci.js @@ -149,7 +149,7 @@ function loadConfig(configPath) { function resolveConfigPath(configPath) { // Specify a default configPath = configPath || '.pa11yci'; - if (configPath[0] !== '/') { + if (!path.isAbsolute(configPath)) { configPath = path.join(process.cwd(), configPath); } if (/\.js(on)?$/.test(configPath)) {
Fix error with absolute paths on Windows (#<I>) Leverage native path function to perform os-independent check.
pa11y_pa11y-ci
train
js
b4fb295a377b353b1de27dc7bea4294c27b29cee
diff --git a/code/MemberTableField.php b/code/MemberTableField.php index <HASH>..<HASH> 100755 --- a/code/MemberTableField.php +++ b/code/MemberTableField.php @@ -121,10 +121,6 @@ class MemberTableField extends ComplexTableField { // TODO Not implemented yet if(isset($_REQUEST['ctf'][$this->Name()]['GroupID']) && is_numeric($_REQUEST['ctf'][$this->Name()]['GroupID'])) { $this->sourceFilter[] = "`GroupID`='{$_REQUEST['ctf'][$this->Name()]['GroupID']}'"; - } elseif($this->group) { - //$this->sourceFilter[] = "`GroupID`='{$this->group->ID}'"; - // If the table is not clean (without duplication), the total and navigation wil not work well, so uncheck the big line below - $this->sourceFilter[] = "`Group_Members`.`ID` IN (SELECT `ID` FROM `Group_Members` WHERE `GroupID`='{$this->group->ID}' GROUP BY `MemberID` HAVING MIN(`ID`))"; } $this->sourceJoin = " INNER JOIN `Group_Members` ON `MemberID`=`Member`.`ID`";
BUGFIX Removed query that was causing issues displaying members in the security groups. Open ticket #<I> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-siteconfig
train
php
9190af79d25b24400c3b3d52e5c322ef1e3379f8
diff --git a/tools/check-masters-valid.php b/tools/check-masters-valid.php index <HASH>..<HASH> 100755 --- a/tools/check-masters-valid.php +++ b/tools/check-masters-valid.php @@ -117,6 +117,11 @@ function check_valid_network($netname, $data) { $version_keys = ['bip32', 'private', 'public', 'scripthash' ]; $version_keys_warn = ['bip44' ]; + switch($data['unit']) { + case 'XMR': + array_remove($version_keys, 'scripthash'); + break; + } foreach($version_keys as $k) { if( @$data['versions'][$k] === null ) { err( "key ['$netname']['versions']['$k'] is unset" ); @@ -145,6 +150,12 @@ function check_valid_network($netname, $data) { } +function array_remove(&$arr, $val) { + if (($key = array_search($val, $arr)) !== false) { + unset($arr[$key]); + } +} + function err($msg) { fprintf(STDERR, " |- error : $msg\n\n" ); }
prelim support to special case certain coins, eg XMR
dan-da_coinparams
train
php
ef2c96094aba6eae3f70ea1df1664d0531936389
diff --git a/lib/coveralls/version.rb b/lib/coveralls/version.rb index <HASH>..<HASH> 100644 --- a/lib/coveralls/version.rb +++ b/lib/coveralls/version.rb @@ -1,3 +1,3 @@ module Coveralls - VERSION = "0.7.2" + VERSION = "0.7.3" end
Version bump Please release <I> so that I can get your relaxed bundler dependencies without referencing a Github commit. Thanks.
lemurheavy_coveralls-ruby
train
rb
82abcae95df7cfa5fdb3bb2cc1f57d0e03ca5e26
diff --git a/src/Payload/Type/PayloadType.php b/src/Payload/Type/PayloadType.php index <HASH>..<HASH> 100644 --- a/src/Payload/Type/PayloadType.php +++ b/src/Payload/Type/PayloadType.php @@ -30,6 +30,7 @@ class PayloadType implements PayloadTypeInterface */ public function getName(): string { + /** @noinspection PhpUnhandledExceptionInspection */ $class = new ReflectionClass($this->getPayload()); return $class->getShortName();
Added @noinspection for exception that won't happen.
extendsframework_extends-message
train
php
e8dc487e70fab2c360874c35bb33c3c1e9f0f314
diff --git a/sources/scalac/symtab/classfile/ClassfileParser.java b/sources/scalac/symtab/classfile/ClassfileParser.java index <HASH>..<HASH> 100644 --- a/sources/scalac/symtab/classfile/ClassfileParser.java +++ b/sources/scalac/symtab/classfile/ClassfileParser.java @@ -229,7 +229,7 @@ public class ClassfileParser implements ClassfileConstants { transFlags(flags)); s.setInfo(type, phaseId); attrib.readAttributes(s, type, METH_ATTR); - if ((flags & 0x0002) == 0) // Don't include PRIVATE methods + if (!s.isPrivate()) // Don't include PRIVATE methods ((flags & 0x0008) != 0 ? statics : locals).enterOrOverload(s); } }
- Fixed code that avoids private methods
scala_scala
train
java
079725321d7a540c58e970815a757fe4298f4cd2
diff --git a/addon/components/lt-infinity.js b/addon/components/lt-infinity.js index <HASH>..<HASH> 100644 --- a/addon/components/lt-infinity.js +++ b/addon/components/lt-infinity.js @@ -20,6 +20,7 @@ export default Component.extend(InViewportMixin, { this.setProperties({ viewportSpy: true, + viewportUseIntersectionObserver: false, viewportTolerance: { left: width, right: width,
fix(lt-infinity): disable intersection observer
offirgolan_ember-light-table
train
js
e9f7e8a7d0777561a9772842ee91afd5cf4f526c
diff --git a/WebPConvert.php b/WebPConvert.php index <HASH>..<HASH> 100755 --- a/WebPConvert.php +++ b/WebPConvert.php @@ -134,6 +134,8 @@ class WebPConvert public static function convert($source, $destination, $quality = 85, $stripMetadata = true) { + $success = false; + try { self::isValidTarget($source); self::isAllowedExtension($source);
$success should be defined before the loop, for the hypothetical case, that there are no converters
rosell-dk_webp-convert
train
php
5739f95d82b779cc3cf8c21b9d0e89068c162b41
diff --git a/lib/unparser/cli/preprocessor.rb b/lib/unparser/cli/preprocessor.rb index <HASH>..<HASH> 100644 --- a/lib/unparser/cli/preprocessor.rb +++ b/lib/unparser/cli/preprocessor.rb @@ -15,13 +15,14 @@ module Unparser # Run preprocessor for node # - # @param + # @param [Parser::AST::Node, nil] node # - # @return [Parser::AST::Node] + # @return [Parser::AST::Node, nil] # # @api private # def self.run(node) + return if node.nil? REGISTRY.fetch(node.type, Noop).new(node).result end
Allow to pass nil nodes from CLI preprocessor nil is a valid output of parser. So it must also be a valid input.
mbj_unparser
train
rb
c11d6917c6803deb7b7687862050fc2e6231d84d
diff --git a/aliyun/log/pulllog_response.py b/aliyun/log/pulllog_response.py index <HASH>..<HASH> 100755 --- a/aliyun/log/pulllog_response.py +++ b/aliyun/log/pulllog_response.py @@ -9,7 +9,7 @@ from .logresponse import LogResponse from .util import Util from .util import base64_encodestring as b64e -from .log_logs_pb2 import LogGroupList +from .log_logs_raw_pb2 import LogGroupListRaw as LogGroupList class PullLogResponse(LogResponse):
try to use raw parsing for binary case (may break compatibility, need further test)
aliyun_aliyun-log-python-sdk
train
py
475aa24ca828fb9b1a258cd67e4f34cca1be4444
diff --git a/ansibleci/helper.py b/ansibleci/helper.py index <HASH>..<HASH> 100644 --- a/ansibleci/helper.py +++ b/ansibleci/helper.py @@ -10,7 +10,7 @@ import os import yaml -class Helper: +class Helper(object): ''' Helper class which provides some helper methods. ''' diff --git a/ansibleci/logger.py b/ansibleci/logger.py index <HASH>..<HASH> 100644 --- a/ansibleci/logger.py +++ b/ansibleci/logger.py @@ -10,7 +10,7 @@ import os import sys -class Logger: +class Logger(object): ''' Logger class which is used to print log messages to stdout and stderr. ''' diff --git a/ansibleci/runner.py b/ansibleci/runner.py index <HASH>..<HASH> 100644 --- a/ansibleci/runner.py +++ b/ansibleci/runner.py @@ -11,7 +11,7 @@ from ansibleci.logger import Logger from ansibleci.helper import Helper -class Runner: +class Runner(object): ''' Runner class which executes all tests. '''
REFACTOR: Switched to new style objects
confirm_ansibleci
train
py,py,py
c0ad56685566acf2b18aa2c4ca653e7bd19fe8b2
diff --git a/lib/dry/view/part.rb b/lib/dry/view/part.rb index <HASH>..<HASH> 100644 --- a/lib/dry/view/part.rb +++ b/lib/dry/view/part.rb @@ -61,6 +61,10 @@ module Dry ) end + def inspect + %(#<#{self.class.name} name=#{_name.inspect} value=#{_value.inspect}>) + end + private def _context diff --git a/spec/unit/part_spec.rb b/spec/unit/part_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/part_spec.rb +++ b/spec/unit/part_spec.rb @@ -63,6 +63,12 @@ RSpec.describe Dry::View::Part do end end + describe "#inspect" do + it "includes the clsas name, name, and value only" do + expect(part.inspect).to eq "#<Dry::View::Part name=:user value=#<Double :value>>" + end + end + describe '#method_missing' do let(:value) { double(greeting: 'hello from value') } @@ -82,7 +88,7 @@ RSpec.describe Dry::View::Part do end end - describe '#respond_to_missing?' do + describe '#respond_to' do let(:value) { double(greeting: 'hello from value') } it 'handles convenience methods' do
Add custom Part#inspect including only name and value The output of Rendering#inspect may grow very large with both the context and inflector objects, so hide it from Part#inspect output, making parts easier to understand at a glance.
dry-rb_dry-view
train
rb,rb
1ca42f8e585daad87973279904bd8e894f91109d
diff --git a/src/Foundation/Routes/Api/post.php b/src/Foundation/Routes/Api/post.php index <HASH>..<HASH> 100644 --- a/src/Foundation/Routes/Api/post.php +++ b/src/Foundation/Routes/Api/post.php @@ -11,8 +11,8 @@ $this->group([ 'middleware' => ['api'], - 'prefix'=> 'api', - 'namespace' => 'Orchid\Foundation\Http\Controllers\Api' + 'prefix' => 'api', + 'namespace' => 'Orchid\Foundation\Http\Controllers\Api', ], function ($router) { // Route::post('route', 'PostApiController@store'); });
Apply fixes from StyleCI (#<I>) [ci skip] [skip ci]
orchidsoftware_platform
train
php
656e593668c24a7cb2021ab0c0cd8c0b5b1186bf
diff --git a/spec/kamaze/project/version_spec.rb b/spec/kamaze/project/version_spec.rb index <HASH>..<HASH> 100644 --- a/spec/kamaze/project/version_spec.rb +++ b/spec/kamaze/project/version_spec.rb @@ -58,7 +58,10 @@ describe Kamaze::Project::Version, :version do end context '#to_h' do - it { expect(subject.to_h).to be_empty } + it do + expect(subject.to_h).to be_a(Hash) + expect(subject.to_h).to be_empty + end end context '#to_s' do @@ -133,6 +136,13 @@ describe Kamaze::Project::Version, :version do it { expect(subject.valid?).to be(false) } end + context '#to_h' do + it do + expect(subject.to_h).to be_a(Hash) + expect(subject.to_h).to be_empty + end + end + context '#to_s' do it do regexp = /undefined local variable or method `major'/
version (spec) examples added + minor changes
SwagDevOps_kamaze-project
train
rb
32e07fd96e37f5237efad5686d478ab5eaf54daf
diff --git a/src/uki-more/more/view/select.js b/src/uki-more/more/view/select.js index <HASH>..<HASH> 100644 --- a/src/uki-more/more/view/select.js +++ b/src/uki-more/more/view/select.js @@ -168,7 +168,7 @@ uki.view.declare('uki.more.view.Select', uki.view.Checkbox, function(Base) { .data(uki.map(o, 'text')) .selectedIndex(0); - if (this._selectFirst) this.text(o[0].text); + if (this._selectFirst && (o.length > 0)) this.text(o[0].text); this._longestText = ''; uki.each(o, function(i, row) { if (row.text.length > this._longestText.length) this._longestText = row.text;
bugfix to allow setting options to [] when selectFirst is enabled
voloko_uki
train
js
2b975b926a86c336fbd128b43306f8e3a95751e6
diff --git a/test/countries/test_venezuela.py b/test/countries/test_venezuela.py index <HASH>..<HASH> 100644 --- a/test/countries/test_venezuela.py +++ b/test/countries/test_venezuela.py @@ -59,7 +59,8 @@ class TestVenezuela(unittest.TestCase): self.holidays[date(2019, 10, 12)], "Día de la Resistencia Indígena" ) self.assertIn("2019-12-17", self.holidays) - self.assertEqual(self.holidays[date(2019, 12, 17)], "Muerte del Libertador Simón Bolívar") + self.assertEqual(self.holidays[date(2019, 12, 17)], + "Muerte del Libertador Simón Bolívar") self.assertIn("2019-12-24", self.holidays) self.assertEqual(self.holidays[date(2019, 12, 24)], "Nochebuena") self.assertIn("2019-12-25", self.holidays)
Update test_venezuela.py Added a correction to pass the pull request test
dr-prodigy_python-holidays
train
py
072958796a64c2175de9e4cb0de10a8025f0dc7c
diff --git a/src/components/slider/slider.js b/src/components/slider/slider.js index <HASH>..<HASH> 100644 --- a/src/components/slider/slider.js +++ b/src/components/slider/slider.js @@ -111,9 +111,9 @@ function SliderDirective($$rAF, $window, $mdAria, $mdUtil, $mdConstant, $mdThemi var throttledRefreshDimensions = $mdUtil.throttle(refreshSliderDimensions, 5000); // Default values, overridable by attrs - attr.min ? attr.$observe('min', updateMin) : updateMin(0); - attr.max ? attr.$observe('max', updateMax) : updateMax(100); - attr.step ? attr.$observe('step', updateStep) : updateStep(1); + angular.isDefined(attr.min) ? attr.$observe('min', updateMin) : updateMin(0); + angular.isDefined(attr.max) ? attr.$observe('max', updateMax) : updateMax(100); + angular.isDefined(attr.step)? attr.$observe('step', updateStep) : updateStep(1); // We have to manually stop the $watch on ngDisabled because it exists // on the parent scope, and won't be automatically destroyed when
fix(slider): fix for attributes being ignored fix for changes to attributes on the slider element being ignored if their value is initally falsy. Now observes attributes regardless of initial value, as long as attributes are present closes #<I>. closes #<I>.
angular_material
train
js
52c631774c0cf95caceece9ccc80ca8109c430a8
diff --git a/src/KuiKui/MemcacheServiceProvider/AbstractWrapper.php b/src/KuiKui/MemcacheServiceProvider/AbstractWrapper.php index <HASH>..<HASH> 100644 --- a/src/KuiKui/MemcacheServiceProvider/AbstractWrapper.php +++ b/src/KuiKui/MemcacheServiceProvider/AbstractWrapper.php @@ -10,7 +10,7 @@ namespace KuiKui\MemcacheServiceProvider; -use Pimple\Container as Application; +use Silex\Application; /** * Memcache wrapper interface.
fix issues based on Silex <I> service providers: - restore Silex\Application on AbstractWrapper Constructor
KuiKui_MemcacheServiceProvider
train
php
8589b33e4fb07d7b806d2c869f4e644b95a45d68
diff --git a/ffpyplayer/__init__.py b/ffpyplayer/__init__.py index <HASH>..<HASH> 100644 --- a/ffpyplayer/__init__.py +++ b/ffpyplayer/__init__.py @@ -9,7 +9,7 @@ import platform __all__ = ('dep_bins', ) -__version__ = '4.3.1' +__version__ = '4.3.2.dev0' version = __version__ # the ffmpeg src git version tested and upto date with,
Bump to <I>.dev0.
matham_ffpyplayer
train
py
7a2c5794097dba18a3bf9e170e8c0b2ff4a916d7
diff --git a/staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go b/staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -218,7 +218,7 @@ func (le *LeaderElector) renew(ctx context.Context) { le.config.Lock.RecordEvent("stopped leading") glog.Infof("failed to renew lease %v: %v", desc, err) cancel() - }, 0, ctx.Done()) + }, le.config.RetryPeriod, ctx.Done()) } // tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired,
bug fix: dead loop leaderelection
kubernetes_kubernetes
train
go
2b6a543e7ce9e3ac20556f7fc0462a45654d9900
diff --git a/public/js/mypicos.js b/public/js/mypicos.js index <HASH>..<HASH> 100644 --- a/public/js/mypicos.js +++ b/public/js/mypicos.js @@ -294,8 +294,8 @@ $.getJSON("/api/db-dump", function(db_dump){ function(pico,dNumber,dLeft,dTop){ pico.dname = getV(pico,"dname",dNumber?"Child "+dNumber:"Owner Pico"); var width = getV(pico,"width",undefined); - var left = getV(pico,"left",dLeft); - var top = getV(pico,"top",dTop); + var left = Math.floor(parseFloat(getV(pico,"left",dLeft))); + var top = Math.floor(parseFloat(getV(pico,"top",dTop))); var color = getV(pico,"color",dNumber?"aquamarine":"lightskyblue"); pico.style = getV(pico,"style", (width?"width:"+width+"px;":"") @@ -311,7 +311,7 @@ $.getJSON("/api/db-dump", function(db_dump){ walkPico(cp,dNumber*10+i+1,left+(i*10)+20,top+20); } } - walkPico(ownerPico,0,300,50); + walkPico(ownerPico,0,"300","50"); renderGraph(db_graph); } });
left and top offsets stored as string but used in calculations
Picolab_pico-engine
train
js
34f494f5f4bb3f9d43a6ae7f8751e340772d3f77
diff --git a/lib/hessian-decode.js b/lib/hessian-decode.js index <HASH>..<HASH> 100644 --- a/lib/hessian-decode.js +++ b/lib/hessian-decode.js @@ -133,7 +133,11 @@ function read_object(buf, c) { } } -function read_call(buf) { +function read_call(buf, c) { + c = c || buf.readChar(); + + expect(c, 'c'); + expect(buf.readUInt8(), 0x00); expect(buf.readUInt8(), 0x01); @@ -168,7 +172,7 @@ HessianParser.prototype.decode = function(buf) { var c = buf.readChar(); switch (c) { case 'c' : // Call - var obj = read_call(buf); + var obj = read_call(buf, c); this.emit('call', obj, buf.offset ); break;
Made the read_call() method consistant with others.
bramp_hessian.js
train
js
6657d6744ec54fc359af86b3f8f4016bbc683d1e
diff --git a/omrdatasettools/converters/ImageInverter.py b/omrdatasettools/converters/ImageInverter.py index <HASH>..<HASH> 100644 --- a/omrdatasettools/converters/ImageInverter.py +++ b/omrdatasettools/converters/ImageInverter.py @@ -19,13 +19,11 @@ class ImageInverter: :param image_directory: The directory, that contains the images :param image_file_ending: The pattern for finding files in the image_directory """ - print("Converting all images in directory {0}...".format(image_directory)) - image_paths = [y for x in os.walk(image_directory) for y in glob(os.path.join(x[0], image_file_ending))] - for image_path in tqdm(image_paths): + for image_path in tqdm(image_paths, desc="Inverting all images in directory {0}".format(image_directory)): white_on_black_image = Image.open(image_path).convert("L") black_on_white_image = ImageOps.invert(white_on_black_image) - black_on_white_image.save(image_path[:-4] + ".png") + black_on_white_image.save(os.path.splitext(image_path)[0] + ".png") if __name__ == "__main__":
Improved description while inverting and using splitext instead of manually splitting extension.
apacha_OMR-Datasets
train
py
ace6bf08b2ef0e957bc8aaf88d48787cb5767fcc
diff --git a/config/ember-try.js b/config/ember-try.js index <HASH>..<HASH> 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -137,7 +137,7 @@ module.exports = function() { name: 'ember-canary', npm: { devDependencies: { - 'ember-data': 'emberjs/data#master', + 'ember-data': 'canary', 'ember-source': urls[2] } }
ember-data canary builds from npm
mharris717_ember-cli-pagination
train
js
ca1d5a295a1173f1842515ff605adb3741c72e15
diff --git a/dragula.js b/dragula.js index <HASH>..<HASH> 100644 --- a/dragula.js +++ b/dragula.js @@ -272,10 +272,14 @@ function dragula (initialContainers, options) { } var item = _copy || _item; var immediate = getImmediateChild(dropTarget, elementBehindCursor); - if (immediate === null) { + if (immediate !== null) { + var reference = getReference(dropTarget, immediate, clientX, clientY); + } else if (o.revertOnSpill === true) { + var reference = _initialSibling; + dropTarget = _source; + } else { return; } - var reference = getReference(dropTarget, immediate, clientX, clientY); if (reference === null || reference !== item && reference !== nextEl(item)) { _currentSibling = reference; dropTarget.insertBefore(item, reference);
Show shadow in original position when revertOnSpill === true
bevacqua_dragula
train
js
73281243f7270da9c39f16427961ae691e3262c9
diff --git a/tests/markdown/header_tests.py b/tests/markdown/header_tests.py index <HASH>..<HASH> 100644 --- a/tests/markdown/header_tests.py +++ b/tests/markdown/header_tests.py @@ -117,7 +117,7 @@ class SetextTest(TemplarTest): expect = """ <p>This should be one paragraph</p> - <h1>Header here</h1> + <h1 id="header-here">Header here</h1> <p>This should be another paragraph</p> """ @@ -132,7 +132,7 @@ class SetextTest(TemplarTest): expect = """ <p>This should be one paragraph</p> - <h2>Header here</h2> + <h2 id="header-here">Header here</h2> <p>This should be another paragraph</p> """ @@ -207,7 +207,7 @@ class AtxHeaders(TemplarTest): expect = """ <p>This should be one paragraph</p> - <h3>Header here</h3> + <h3 id="header-here">Header here</h3> <p>This should be another paragraph</p> """
Add some missing slugs to header_tests
albert12132_templar
train
py
c80c1e02eca43ddabd43a4154e718680ea4a94b4
diff --git a/Preset/Handbrake/BasePreset.php b/Preset/Handbrake/BasePreset.php index <HASH>..<HASH> 100644 --- a/Preset/Handbrake/BasePreset.php +++ b/Preset/Handbrake/BasePreset.php @@ -13,7 +13,7 @@ abstract class BasePreset extends Preset protected function buildInputDefinition() { $allowedMimeTypes = array(); - $extensions_to_check = array('mp4','mov','asf','avi','flv','rm','swf','wmv'); + $extensions_to_check = array('mp4','mov','asf','avi','flv','rm','wmv'); //No swf or 3gp $mime_map = new MimeMap(); $mime_map->setExtension('flv','video/x-flv'); $ext_map = $mime_map->getExtensionToMimeTypes();
took out .swf as an accepted input file
AmericanCouncils_Transcoding
train
php
286edf6d63348b4f51d68169234494b21a467b7d
diff --git a/dmutex.go b/dmutex.go index <HASH>..<HASH> 100644 --- a/dmutex.go +++ b/dmutex.go @@ -40,7 +40,7 @@ func (dm *DMutex) Lock() { // We timed out on the previous lock, wait for random time, // and try again afterwards - time.Sleep(time.Duration(/*rand.Float32() * */ 1000) * time.Millisecond) + time.Sleep(time.Duration(200+(rand.Float32()*800)) * time.Millisecond) } }
Change timeout to re-acquire locks to fixed portion and random portion
minio_dsync
train
go
942db8ba8cddb547da0c7419a381335870cc5969
diff --git a/lib/amp-core.rb b/lib/amp-core.rb index <HASH>..<HASH> 100644 --- a/lib/amp-core.rb +++ b/lib/amp-core.rb @@ -1,4 +1,6 @@ module Amp + module Core + end module Support end end
Whoops; fixed another issue with autoloading amp-core repository classes.
michaeledgar_amp-core
train
rb
19a5800b2f81cda2d7a0ef5240d70bfe763e5d4c
diff --git a/src/python/pants/backend/codegen/protobuf/python/grpc_python_plugin.py b/src/python/pants/backend/codegen/protobuf/python/grpc_python_plugin.py index <HASH>..<HASH> 100644 --- a/src/python/pants/backend/codegen/protobuf/python/grpc_python_plugin.py +++ b/src/python/pants/backend/codegen/protobuf/python/grpc_python_plugin.py @@ -7,8 +7,6 @@ from pants.core.util_rules.external_tool import TemplatedExternalTool class GrpcPythonPlugin(TemplatedExternalTool): options_scope = "grpc-python-plugin" help = "The gRPC Protobuf plugin for Python." - deprecated_options_scope = "grpc_python_plugin" - deprecated_options_scope_removal_version = "2.8.0.dev0" default_version = "1.32.0" default_known_versions = [
Remove deprecated `[grpc_python_plugin]` in favor of `[grpc-python-plugin]` (#<I>) Now we can enforce that subsystems use `-` instead of `_`. This is a useful heuristic because both targets and individual options use `_`. [ci skip-rust] [ci skip-build-wheels]
pantsbuild_pants
train
py
33b9bc02ed7f08959c33acfef44323fadc1eb23a
diff --git a/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java b/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java index <HASH>..<HASH> 100644 --- a/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java +++ b/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheDecoder.java @@ -200,8 +200,8 @@ public abstract class AbstractBinaryMemcacheDecoder<M extends BinaryMemcacheMess public void channelInactive(ChannelHandlerContext ctx) throws Exception { super.channelInactive(ctx); - if (currentMessage != null && currentMessage.extras() != null) { - currentMessage.extras().release(); + if (currentMessage != null) { + currentMessage.release(); } resetDecoder();
Fix potential buffer leak in AbstractBinaryMemcacheDecoder If a connection is closed unexpectedly while AbstractBinaryMemcacheDecoder decodes a message, the half-constructed message's content might not be released.
netty_netty
train
java
5f9d00049b3017e6af2ce8d727faa972e75b50bf
diff --git a/Controller/Badge/AdminController.php b/Controller/Badge/AdminController.php index <HASH>..<HASH> 100644 --- a/Controller/Badge/AdminController.php +++ b/Controller/Badge/AdminController.php @@ -248,7 +248,7 @@ class AdminController extends Controller } } elseif (null !== $userName) { list($firstName, $lastName) = explode(' ', $userName); - $user = $doctrine->getRepository('ClarolineCoreBundle:User')->findOneByUsername($firstName . $lastName); + $user = $doctrine->getRepository('ClarolineCoreBundle:User')->findOneBy(array('firstName' => $firstName, 'lastName' => $lastName)); if (null !== $user) { $users[] = $user; @@ -259,7 +259,7 @@ class AdminController extends Controller $badgeManager = $this->get('claroline.manager.badge'); $awardedBadge = $badgeManager->addBadgeToUsers($badge, $users); - $flashMessageType = 'alert'; + $flashMessageType = 'error'; if (0 < $awardedBadge) { $flashMessageType = 'success';
[CoreBundle] Correct way to retrieve user for awarding
claroline_Distribution
train
php
087a1f5b2962738b7bb634b01d9509911bc6732d
diff --git a/src/documentation/helpers/toCliOption.js b/src/documentation/helpers/toCliOption.js index <HASH>..<HASH> 100644 --- a/src/documentation/helpers/toCliOption.js +++ b/src/documentation/helpers/toCliOption.js @@ -6,10 +6,5 @@ * @returns {string} - The cli option to set the given configuration option. */ export default function toCliOption(configPaths) { - // Runtime should be added directly - const paths = configPaths[0] === 'runtime' ? - configPaths.slice(1) : - configPaths; - - return '--' + paths.join('-'); + return '--' + configPaths.join('-'); }
Removed the special handling for the runtime group in settings This means that user will now be required to write out the complete path to a setting even for runtime settings.
rocjs_roc
train
js
fb993340ac039fa3a96b714a749b327c8e39b7d3
diff --git a/src/Mathielen/ImportEngine/Storage/ServiceStorage.php b/src/Mathielen/ImportEngine/Storage/ServiceStorage.php index <HASH>..<HASH> 100644 --- a/src/Mathielen/ImportEngine/Storage/ServiceStorage.php +++ b/src/Mathielen/ImportEngine/Storage/ServiceStorage.php @@ -28,6 +28,14 @@ class ServiceStorage implements StorageInterface $this->setObjectTransformer($objectMapper); } + /** + * @return callable + */ + public function getCallable() + { + return $this->callable; + } + public function isCalledService($serviceOrClassname) { return is_a($this->callable[0], is_object($serviceOrClassname) ? get_class($serviceOrClassname) : $serviceOrClassname);
getter for servicestorage callable
mathielen_import-engine
train
php
ea7246255230914a63f602835da75487ced8b559
diff --git a/twilio/rest/resources/imports.py b/twilio/rest/resources/imports.py index <HASH>..<HASH> 100644 --- a/twilio/rest/resources/imports.py +++ b/twilio/rest/resources/imports.py @@ -20,12 +20,10 @@ import httplib2 try: from httplib2 import socks from httplib2.socks import PROXY_TYPE_HTTP - from httplib2.socks import PROXY_TYPE_HTTP_NO_TUNNEL from httplib2.socks import PROXY_TYPE_SOCKS4 from httplib2.socks import PROXY_TYPE_SOCKS5 except ImportError: import socks from socks import PROXY_TYPE_HTTP - from socks import PROXY_TYPE_HTTP_NO_TUNNEL from socks import PROXY_TYPE_SOCKS4 from socks import PROXY_TYPE_SOCKS5
Python 3 doesn't have HTTP_NO_TUNNEL, fine
twilio_twilio-python
train
py