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
8a33c21a9893937d02c573c4a287d1e129fcc5c8
diff --git a/gwpy/timeseries/io/losc.py b/gwpy/timeseries/io/losc.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/io/losc.py +++ b/gwpy/timeseries/io/losc.py @@ -320,7 +320,7 @@ def read_losc_ascii(fobj): except KeyError: raise ValueError("Failed to parse data duration from LOSC ASCII file") - data = numpy.loadtxt(fobj, dtype=float, comments='#', usecols=0) + data = numpy.loadtxt(fobj, dtype=float, comments='#', usecols=(0,)) metadata['sample_rate'] = data.size / dur return TimeSeries(data, **metadata)
timeseries.io.losc: always provide usecols as list
gwpy_gwpy
train
py
e6560e39d712d7e7882284ff280f7b9a80cfe49d
diff --git a/admin/roles/assign.php b/admin/roles/assign.php index <HASH>..<HASH> 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -225,6 +225,8 @@ } } } + // force accessinfo refresh for users visiting this context... + mark_context_dirty($context->path); } else if ($remove and !empty($frm->removeselect) and confirm_sesskey()) { @@ -259,6 +261,8 @@ } } } + // force accessinfo refresh for users visiting this context... + mark_context_dirty($context->path); } else if ($showall) { $searchtext = ''; diff --git a/admin/roles/override.php b/admin/roles/override.php index <HASH>..<HASH> 100755 --- a/admin/roles/override.php +++ b/admin/roles/override.php @@ -112,6 +112,10 @@ } } } + + // force accessinfo refresh for users visiting this context... + mark_context_dirty($context->path); + redirect($baseurl); }
admin/roles: context-specific role changes mark the context as dirty And will force a reload of $USER->access for logged-in users that need to read _this_ context. Much lower impact - still not a great idea to edit assignments/caps on very busy courses, but impact should be low.
moodle_moodle
train
php,php
07d46d8a11ac14b0f94f6b2004dc07f788482f06
diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index <HASH>..<HASH> 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -313,7 +313,8 @@ define(function LiveDevelopment(require, exports, module) { DocumentManager.getDocumentForPath(_urlToPath(url)) .fail(function () { - stylesheetDeferred.reject(); + // A failure to open a related file is benign + stylesheetDeferred.resolve(); }) .done(function (doc) { if (!_liveDocument || (doc !== _liveDocument.doc)) { @@ -438,7 +439,7 @@ define(function LiveDevelopment(require, exports, module) { status = STATUS_ACTIVE; _openDocument(doc, editor) - .always(function () { + .done(function () { if (doc.isDirty && _classForDocument(doc) !== CSSDocument) { status = STATUS_OUT_OF_SYNC; } @@ -806,7 +807,7 @@ define(function LiveDevelopment(require, exports, module) { promise = _openDocument(doc, editor); } else { if (exports.config.experimental || _isHtmlFileExt(doc.extension)) { - promise = close().then(open); + promise = close().done(open); } else { promise = $.Deferred().resolve(); }
Address issues found by @gruehle and @WebsiteDeveloper. In particular: 1) use jQuery `done` instead of `when`; and 2) don't treat a failure to load a related stylesheet file as a catastrophic failure in `_openDocument`.
adobe_brackets
train
js
8292abec0e5f702841453b76aaa675f4d1dae7aa
diff --git a/app/representers/openstax/accounts/api/v1/account_representer.rb b/app/representers/openstax/accounts/api/v1/account_representer.rb index <HASH>..<HASH> 100644 --- a/app/representers/openstax/accounts/api/v1/account_representer.rb +++ b/app/representers/openstax/accounts/api/v1/account_representer.rb @@ -30,6 +30,12 @@ module OpenStax required: true } + property :is_administrator, + type: :boolean, + schema_info: { + description: 'Whether or not this user is an administrator on Accounts' + } + property :first_name, type: String, schema_info: {
Added is_administrator to API so field will sync
openstax_accounts-rails
train
rb
faa9f6fee3ad5e55915a65ee1e332dade7900cf4
diff --git a/cookiecutter/replay.py b/cookiecutter/replay.py index <HASH>..<HASH> 100644 --- a/cookiecutter/replay.py +++ b/cookiecutter/replay.py @@ -8,6 +8,8 @@ cookiecutter.replay from __future__ import unicode_literals from .compat import is_string +from .config import get_user_config +from .utils import make_sure_path_exists def dump(template_name, context): @@ -16,3 +18,8 @@ def dump(template_name, context): if not isinstance(context, dict): raise TypeError('Context is required to be of type dict') + + replay_dir = get_user_config()['replay_dir'] + + if not make_sure_path_exists(replay_dir): + raise IOError('Unable to create replay dir at {}'.format(replay_dir))
Retrieve replay_dir in replay.dump and create try to create it
audreyr_cookiecutter
train
py
7600fc4bf5e07ec9320e40be95fd978b275d8067
diff --git a/datadog_checks_dev/setup.py b/datadog_checks_dev/setup.py index <HASH>..<HASH> 100644 --- a/datadog_checks_dev/setup.py +++ b/datadog_checks_dev/setup.py @@ -26,7 +26,7 @@ REQUIRES = [ 'coverage>=4.5.1', 'mock', 'pytest', - 'pytest-benchmark>=3.2.0', + 'pytest-benchmark>=3.2.1', 'pytest-cov>=2.6.1', 'pytest-mock', 'requests>=2.20.0',
Upgrade pytest-benchmark (#<I>)
DataDog_integrations-core
train
py
0cf478131c67b69c262bc699379ae41aa9722fe0
diff --git a/test/commit-message.js b/test/commit-message.js index <HASH>..<HASH> 100644 --- a/test/commit-message.js +++ b/test/commit-message.js @@ -125,7 +125,7 @@ describe('CommitMessage', function() { assert.deepEqual(message._warnings, t.warnings, failMsg); }); - if (message.valid) { + if (message.valid && !t.errors.length) { it('should have the correct title', function() { // if (!message.valid) { // this.test.skip();
Fix condition for tests dependent of valid msg Modify condition so tests that are dependent of valid message run only if we're not expecting any errors, in addition to checking if message is valid.
clns_node-commit-msg
train
js
86713585e8896f5439e96461724f115e3b613c24
diff --git a/src/main/Api.js b/src/main/Api.js index <HASH>..<HASH> 100644 --- a/src/main/Api.js +++ b/src/main/Api.js @@ -38,13 +38,11 @@ var postal = { } _.each(sources, function(source){ var sourceTopic = source.topic || "*"; - console.log("SOURCE: " + source.exchange + " | " + sourceTopic); _.each(destinations, function(destination) { var destExchange = destination.exchange || DEFAULT_EXCHANGE; subscriptions.push( postal.subscribe(source.exchange || DEFAULT_EXCHANGE, source.topic || "*", function(msg, env) { var destTopic = _.isFunction(destination.topic) ? destination.topic(env.topic) : destination.topic || env.topic; - console.log("DESTINATION: " + destExchange + " | " + destTopic); postal.publish(destExchange, destTopic, msg); }) );
Removing console log statements from bindExchanges call
postaljs_postal.js
train
js
7dc4a5e419996f3bbe0a6c53ce000d322f171efc
diff --git a/doc/make_settings_doc.py b/doc/make_settings_doc.py index <HASH>..<HASH> 100755 --- a/doc/make_settings_doc.py +++ b/doc/make_settings_doc.py @@ -45,6 +45,13 @@ def default_string(setting): return u"``None``" return u"``{0!r}``".format(default) +def cmdline_string(setting): + option = setting.name.replace("_", "-") + if setting.type is bool: + return "--{0} | --no-{0}".format(option) + else: + return "--{0} {1}".format(option, setting.name.upper()) + def dump_settings_group(doc, index, settings): for setting in settings: print >> doc @@ -55,6 +62,9 @@ def dump_settings_group(doc, index, settings): print >> doc print >> doc, u" * Type: {0}".format(type_string(setting.type)) print >> doc, u" * Default: {0}".format(default_string(setting)) + if setting.cmdline_help: + print >> doc, u" * Command line: ``{0}``".format(cmdline_string( + setting)) print >> doc print >> doc, setting.doc print >> index, u'{0} setting\t#{1}'.format(
Command line options included in the settings doc
Jajcus_pyxmpp2
train
py
2f2acc8a1c3eba965a7b471f41e090b76c7c997c
diff --git a/js/aofex.js b/js/aofex.js index <HASH>..<HASH> 100644 --- a/js/aofex.js +++ b/js/aofex.js @@ -736,6 +736,10 @@ module.exports = class aofex extends Exchange { 'order': id, 'type': type, }); + let filled = undefined; + if ((type === 'limit') && (orderStatus === '3')) { + filled = amount; + } if (type === 'limit') { cost = totalPrice; } else if (side === 'buy') {
aofex safeOrder edit
ccxt_ccxt
train
js
65480498f68b65b576f0b4624327bb89f579c9b3
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index <HASH>..<HASH> 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -970,6 +970,15 @@ class OFPQueueDescPropExperimenter(OFPPropCommonExperimenter4ByteData): pass +class OFPRoleProp(OFPPropBase): + _TYPES = {} + + [email protected]_type(ofproto.OFPRPT_EXPERIMENTER) +class OFPRolePropExperimenter(OFPPropCommonExperimenter4ByteData): + pass + + class OFPMatchField(StringifyMixin): _FIELDS_HEADERS = {}
of<I>: Add OFPRoleProp This will be used by role status messages.
osrg_ryu
train
py
003ce89fba775254ddde692b7a63301ada9e7dbd
diff --git a/flask_crud/ext/sqlalchemy/filters.py b/flask_crud/ext/sqlalchemy/filters.py index <HASH>..<HASH> 100644 --- a/flask_crud/ext/sqlalchemy/filters.py +++ b/flask_crud/ext/sqlalchemy/filters.py @@ -40,7 +40,7 @@ class ColumnFilter(Filter): class JoinColumnFilter(ColumnFilter): - def __init__(self, column, *joined_tables): + def __init__(self, column, joined_tables): self.joined_tables = joined_tables super().__init__(column=column)
better readability if joined_colunms do not use star-args
hellupline_flask-manager
train
py
cf5bf8e5be4cf42754cb61d36ee5dee8530e9f35
diff --git a/packages/starrating/src/react/__specs__/storyshots.spec.js b/packages/starrating/src/react/__specs__/storyshots.spec.js index <HASH>..<HASH> 100644 --- a/packages/starrating/src/react/__specs__/storyshots.spec.js +++ b/packages/starrating/src/react/__specs__/storyshots.spec.js @@ -1,13 +1,3 @@ import initStoryshots from '@storybook/addon-storyshots' -jest.mock('react-dom', () => { - return { - render: () => null, - unmountComponentAtNode: () => null, - findDOMNode: () => { - return {} - } - } -}) - initStoryshots()
test(starrating): simplify test setup
pluralsight_design-system
train
js
b8f2cda65f45f82368deafb61d131609824068bc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name="tv_report", - version="1.1.5", + version="1.1.6", author="Justin Dray", author_email="[email protected]", url="https://github.com/justin8/tv_report", diff --git a/tv_report/__init__.py b/tv_report/__init__.py index <HASH>..<HASH> 100755 --- a/tv_report/__init__.py +++ b/tv_report/__init__.py @@ -221,7 +221,7 @@ def main(): elif args.verbose >= 2: logging.basicConfig(level=logging.DEBUG) - filemap = video_utils.getFileMap(directory, update=not args.output_only, useCache=not args.ignore_cache) + filemap = video_utils.getFileMap(args.directory, update=not args.output_only, useCache=not args.ignore_cache) log.debug("Complete map of files:") log.debug(filemap)
Fix missing args. for directory on filemap
justin8_tv_report
train
py,py
c0baf48c9256017f05f435965637f0872d7d33b4
diff --git a/salt/states/pkgrepo.py b/salt/states/pkgrepo.py index <HASH>..<HASH> 100644 --- a/salt/states/pkgrepo.py +++ b/salt/states/pkgrepo.py @@ -24,8 +24,7 @@ def __virtual__(): return 'pkgrepo' if 'pkg.mod_repo' in __salt__ else False -def managed(name, - **kwargs): +def managed(name, **kwargs): ''' This function manages the configuration on a system that points to the repositories for the system's package manager.
def line doesn't need to be split
saltstack_salt
train
py
43ba8f840b6eb7916b9f11dc0ceaac5bf53b1552
diff --git a/gpflow/likelihoods.py b/gpflow/likelihoods.py index <HASH>..<HASH> 100644 --- a/gpflow/likelihoods.py +++ b/gpflow/likelihoods.py @@ -492,7 +492,6 @@ class SwitchedLikelihood(Likelihood): # split up the arguments into chunks corresponding to the relevant likelihoods args = zip(*[tf.dynamic_partition(X, ind, self.num_likelihoods) for X in args]) - args = [a for a in args] # apply the likelihood-function to each section of the data with params_as_tensors_for(self, convert=False):
Revert changes in "likelihood.py"
GPflow_GPflow
train
py
f0a163ed6d8ef2a65968c12f7b01ad73ff050d93
diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js index <HASH>..<HASH> 100644 --- a/lib/form/filemanager.js +++ b/lib/form/filemanager.js @@ -450,7 +450,7 @@ M.form_filemanager.init = function(Y, options) { var scope = this; var menuitems = [ - {text: M.str.moodle.download, url:file.url} + {text: M.str.moodle.download, onclick:{fn:open_file_in_new_window, obj:file, scope:this}} ]; function setmainfile(type, ev, obj) { var file = obj[node.get('id')]; @@ -467,6 +467,11 @@ M.form_filemanager.init = function(Y, options) { } }); } + function open_file_in_new_window(type, ev, obj) { + // We open in a new window rather than changing the current windows URL as we don't + // want to navigate away from the page + window.open(obj.url, 'fm-download-file'); + } if (this.enablemainfile && (file.sortorder != 1)) { var mainid = '#id_'+this.enablemainfile; var menu = {text: M.str.repository.setmainfile, onclick:{fn: setmainfile, obj:data, scope:this}};
MDL-<I> Open files in a new window when downloading with the filemanager We need to open files in a new window rather than the existing window to prevent warning messages when files are uploaded and then downloaded without the form being saved first.
moodle_moodle
train
js
a142d0772a970ca15c6d30c858dff806b4f6f855
diff --git a/template.rb b/template.rb index <HASH>..<HASH> 100644 --- a/template.rb +++ b/template.rb @@ -2,3 +2,4 @@ gem 'hyrax' run 'bundle install' generate 'hyrax:install', '-f' rails_command 'db:migrate' +rails_command 'hyrax:default_collection_types:create'
Adding call to rake task for creation of collection types to Hyrax install template
samvera_hyrax
train
rb
eaefc4fe8e64d24ccde137ec05e4bc69e5756179
diff --git a/bigtable-hbase-parent/bigtable-hbase-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/test_env/MiniClusterEnv.java b/bigtable-hbase-parent/bigtable-hbase-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/test_env/MiniClusterEnv.java index <HASH>..<HASH> 100644 --- a/bigtable-hbase-parent/bigtable-hbase-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/test_env/MiniClusterEnv.java +++ b/bigtable-hbase-parent/bigtable-hbase-integration-tests/src/test/java/com/google/cloud/bigtable/hbase/test_env/MiniClusterEnv.java @@ -35,6 +35,7 @@ class MiniClusterEnv extends SharedTestEnv { @Override protected void teardown() throws IOException { helper.shutdownMiniHBaseCluster(); + helper.cleanupTestDir(); helper = null; }
make sure to cleanup after minicluster shutdown (#<I>)
googleapis_cloud-bigtable-client
train
java
41dcd11aa451a05c935b9f1112e6036c88d7498b
diff --git a/toolkits/golang.go b/toolkits/golang.go index <HASH>..<HASH> 100644 --- a/toolkits/golang.go +++ b/toolkits/golang.go @@ -25,7 +25,7 @@ import ( ) const ( - minGoVersionForToolkit = "1.8.3" + minGoVersionForToolkit = "1.9" ) // === Base Toolkit struct ===
go toolkit go version update to <I> (#<I>)
bitrise-io_bitrise
train
go
55d0371b92e3de9d636e63b47ca25eb6978d71ee
diff --git a/superset/db_engine_specs/gsheets.py b/superset/db_engine_specs/gsheets.py index <HASH>..<HASH> 100644 --- a/superset/db_engine_specs/gsheets.py +++ b/superset/db_engine_specs/gsheets.py @@ -32,7 +32,7 @@ class GSheetsEngineSpec(SqliteEngineSpec): engine = "gsheets" engine_name = "Google Sheets" - allows_joins = False + allows_joins = True allows_subqueries = True custom_errors: Dict[Pattern[str], Tuple[str, SupersetErrorType, Dict[str, Any]]] = {
fix: GSheets supports JOINs (#<I>)
apache_incubator-superset
train
py
6e2d3e58be680cb21beae43853eb7c4038d9db16
diff --git a/pytest-profiling/tests/integration/test_profile_integration.py b/pytest-profiling/tests/integration/test_profile_integration.py index <HASH>..<HASH> 100644 --- a/pytest-profiling/tests/integration/test_profile_integration.py +++ b/pytest-profiling/tests/integration/test_profile_integration.py @@ -12,9 +12,7 @@ def virtualenv(): with VirtualEnv() as venv: test_dir = resource_filename("pytest_profiling", "tests/integration/profile") - # HACK: pin more-itertools to 5.0.0 to keep tests working in PY27 as - # as that's a py3 only release - venv.install_package("more-itertools==5.0.0") + venv.install_package("more-itertools") # Keep pytest version the same as what's running this test to ensure P27 keeps working venv.install_package("pytest=={}".format(get_distribution("pytest").version))
Remove pinning of more-itertools
manahl_pytest-plugins
train
py
0ddc388a70cea96db0c2450505f56a655c770902
diff --git a/cassandra/decoder.py b/cassandra/decoder.py index <HASH>..<HASH> 100644 --- a/cassandra/decoder.py +++ b/cassandra/decoder.py @@ -428,7 +428,7 @@ class ResultMessage(_MessageType): @classmethod def recv_results_prepared(cls, f): - query_id = read_int(f) + query_id = read_short(f) column_metadata = cls.recv_results_metadata(f) return (query_id, column_metadata)
'prepared' response uses short, not int for query_id
datastax_python-driver
train
py
13f5c23f8cb4b77c196ce23809d81df1488b3285
diff --git a/vobject/__init__.py b/vobject/__init__.py index <HASH>..<HASH> 100644 --- a/vobject/__init__.py +++ b/vobject/__init__.py @@ -76,8 +76,11 @@ VObject Overview """ +from . import base +from . import icalendar, vcard from .base import readComponents, readOne, newFromBehavior + def iCalendar(): return newFromBehavior('vcalendar', '2.0')
working on py3 support still
eventable_vobject
train
py
a3db94e6c4b12241daadc775f00754b868267489
diff --git a/errors.js b/errors.js index <HASH>..<HASH> 100644 --- a/errors.js +++ b/errors.js @@ -630,7 +630,7 @@ Errors.UnknownConnectionReset = TypedError({ }); // utilities - +/*eslint-disable complexity*/ Errors.classify = function classify(err) { if (err.isErrorFrame) { return err.codeName; @@ -752,6 +752,7 @@ Errors.classify = function classify(err) { return null; } }; +/*eslint-enable complexity*/ // To determine whether a circuit should break for each response code. // TODO consider whether to keep a circuit healthy if a downstream circuit is
linting: [errors] comply with complexity rule
uber_tchannel-node
train
js
cd7664e1569c56f2b4eef401e82d75d328c5ac3b
diff --git a/libcentrifugo/conns/hubs.go b/libcentrifugo/conns/hubs.go index <HASH>..<HASH> 100644 --- a/libcentrifugo/conns/hubs.go +++ b/libcentrifugo/conns/hubs.go @@ -44,11 +44,17 @@ func NewClientHub() ClientHub { } } +var ( + ShutdownSemaphoreBufferSize = 1000 +) + // Shutdown unsubscribes users from all channels and disconnects them. func (h *clientHub) Shutdown() error { var wg sync.WaitGroup h.RLock() advice := &DisconnectAdvice{Reason: "shutting down", Reconnect: true} + // Limit concurrency here to ShutdownSemaphoreBufferSize to prevent memory burst on shutdown. + sem := make(chan struct{}, ShutdownSemaphoreBufferSize) for _, user := range h.users { wg.Add(len(user)) for uid := range user { @@ -57,7 +63,9 @@ func (h *clientHub) Shutdown() error { wg.Done() continue } + sem <- struct{}{} go func(cc ClientConn) { + defer func() { <-sem }() for _, ch := range cc.Channels() { cc.Unsubscribe(ch) }
limit concurrenccy when closing connections on shutdown
centrifugal_centrifugo
train
go
dab56292432bdf3943523df6a39cd429e270ece4
diff --git a/src/wormling/phparia/Api/Channels.php b/src/wormling/phparia/Api/Channels.php index <HASH>..<HASH> 100644 --- a/src/wormling/phparia/Api/Channels.php +++ b/src/wormling/phparia/Api/Channels.php @@ -56,7 +56,7 @@ class Channels extends MediaBase */ public function getChannels() { - $uri = '/channels'; + $uri = 'channels'; $response = $this->client->getEndpoint()->get($uri); $channels = [];
Refs issue #<I> URI should be channels not /channels
wormling_phparia
train
php
a309072982478c561bb85bc0567764fb383a2f25
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ setup(license="Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)", "hgvs", ], install_requires=[ + "attrs>=16.3.0", "biocommons.seqrepo", "biopython>=1.66", "bioutils>=0.2.2", @@ -52,16 +53,13 @@ setup(license="Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)", "ipython", # for hgvs-shell "parsley", "psycopg2!=2.7", # 2.7 bug: https://github.com/psycopg/psycopg2/issues/517 - "attrs>=16.3.0", "unicodecsv", ], setup_requires=[ - "setuptools_scm", "nose", + "setuptools_scm", "wheel", ], - tests_require=[ - ], ) # <LICENSE>
appeasing rtd: removed tests_require section in response to <URL>
biocommons_hgvs
train
py
4e197c9bbe221dd49807c2feb981073567fef43f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,8 @@ setup( 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Operating System :: POSIX', 'Topic :: Security', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', ], test_suite='seccure.tests', ),
setup: inform pip off the Python 3 support
bwesterb_py-seccure
train
py
e4a8b4100c8947aaa39774155ef181fe2e0b3d73
diff --git a/annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java b/annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java index <HASH>..<HASH> 100644 --- a/annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java +++ b/annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java @@ -216,8 +216,8 @@ public class CommonAnnotateWithClauseGenerator String distLeft = "min" + i + " - " - + tas.aliasedColumn(NODE_TABLE, "right_token"); - String distRight = tas.aliasedColumn(NODE_TABLE, "left_token") + + tas.aliasedColumn(NODE_TABLE, "left_token"); + String distRight = tas.aliasedColumn(NODE_TABLE, "right_token") + " - max" + i;
fixing nearest segmentation node search for getting the context
korpling_ANNIS
train
java
1d355a2143daf438b5a2f5185a7f60268ad7c686
diff --git a/tests/local_test.py b/tests/local_test.py index <HASH>..<HASH> 100644 --- a/tests/local_test.py +++ b/tests/local_test.py @@ -8,3 +8,8 @@ shell = LocalShell() def output_of_run_is_stored(): result = shell.run(["echo", "hello"]) assert_equal("hello\n", result.output) + +@istest +def cwd_of_run_can_be_set(): + result = shell.run(["pwd"], cwd="/") + assert_equal("/\n", result.output)
Add test for setting cwd in LocalShell.run
mwilliamson_spur.py
train
py
c93d7ebb27c43119054e19e258e58da56b575bf5
diff --git a/util/src/main/java/com/ning/billing/util/globallocker/MySqlGlobalLocker.java b/util/src/main/java/com/ning/billing/util/globallocker/MySqlGlobalLocker.java index <HASH>..<HASH> 100644 --- a/util/src/main/java/com/ning/billing/util/globallocker/MySqlGlobalLocker.java +++ b/util/src/main/java/com/ning/billing/util/globallocker/MySqlGlobalLocker.java @@ -58,7 +58,6 @@ public class MySqlGlobalLocker implements GlobalLocker { } private GlobalLock lock(final String lockName) throws LockFailedException { - final Handle h = dbi.open(); final MySqlGlobalLockerDao dao = h.attach(MySqlGlobalLockerDao.class); @@ -70,13 +69,13 @@ public class MySqlGlobalLocker implements GlobalLocker { try { dao.releaseLock(lockName); } finally { - if (h != null) { - h.close(); - } + h.close(); } } }; } else { + // Make sure to close the handle if we couldn't obtain the lock (otherwise we would leak connections) + h.close(); return null; } }
util: fix connection leak in MySqlGlobalLocker We were leaking db connections when the MySQL lock couldn't be acquired.
killbill_killbill
train
java
a7a675f0a036c9653f7ca91fb5b195d369cf47ed
diff --git a/spyder/plugins/editor/widgets/recover.py b/spyder/plugins/editor/widgets/recover.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor/widgets/recover.py +++ b/spyder/plugins/editor/widgets/recover.py @@ -127,8 +127,8 @@ class RecoveryDialog(QDialog): def add_label(self): """Add label with explanation at top of dialog window.""" txt = _('Autosave files found. What would you like to do?\n\n' - 'This will be shown each startup if autosave files are not ' - 'restored, moved or deleted.') + 'This dialog will be shown again on next startup if any ' + 'autosave files are not restored, moved or deleted.') label = QLabel(txt, self) label.setWordWrap(True) self.layout.addWidget(label)
Tweak text at top of recovery dialog window
spyder-ide_spyder
train
py
476eb54db116c1dc342e49c4087e0d07061ae76f
diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index <HASH>..<HASH> 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -217,12 +217,21 @@ } var $discussionContainer = this.$('.discussion-container'), - $bottomBar = this.$('.bottom-bar'); + $bottomBar = this.$('.bottom-bar'), + $messageList = this.$('.message-list'); + + var scrollPosition = $messageList.scrollTop() + $messageList.outerHeight(), + scrollHeight = $messageList[0].scrollHeight, + shouldStickToBottom = scrollPosition === scrollHeight; window.autosize(this.$messageField); $bottomBar.outerHeight(this.$messageField.outerHeight() + 1); var $bottomBarNewHeight = $bottomBar.outerHeight(); $discussionContainer.outerHeight(this.$el.outerHeight() - $bottomBarNewHeight - this.$('#header').outerHeight()); + + if (shouldStickToBottom) { + $messageList.scrollTop(scrollHeight); + } }, forceUpdateMessageFieldSize: function (event) {
Maintain bottom-most scroll position when resizing conversation area. Closes #<I>
ForstaLabs_librelay-node
train
js
26266bd46c3e80b97e16701d5ffb65590c653e9e
diff --git a/node.js b/node.js index <HASH>..<HASH> 100644 --- a/node.js +++ b/node.js @@ -142,7 +142,8 @@ export class Node { nodeAt(pos) { for (let node = this;;) { let index = findIndex(node.content, pos) - node = node.child(index) + node = node.maybeChild(index) + if (!node) return null if (foundOffset == pos || node.isText) return node pos -= foundOffset + 1 }
More slugging through tests Involving largely reverting how position map results work to the old style
ProseMirror_prosemirror-model
train
js
d4cb5b8172d8d01b68151340f357c0257e233be9
diff --git a/lib/smartware/interfaces/printer.rb b/lib/smartware/interfaces/printer.rb index <HASH>..<HASH> 100644 --- a/lib/smartware/interfaces/printer.rb +++ b/lib/smartware/interfaces/printer.rb @@ -43,6 +43,7 @@ EOS data = "".force_encoding("BINARY") data << @render.doc_header.force_encoding("BINARY") if @render.respond_to? :doc_header data << @render.normal_text(text, true).force_encoding("BINARY") if @render.respond_to? :normal_text + data << @render.linebreak.force_encoding("BINARY") if @render.respond_to? :linebreak data << @render.doc_footer.force_encoding("BINARY") if @render.respond_to? :doc_footer do_print data, max_time
Force linebreak after plaintext documents.
smartkiosk_smartware
train
rb
9d7c62c53e3c0ed9030725a7bff2495e3c798596
diff --git a/littlechef/runner.py b/littlechef/runner.py index <HASH>..<HASH> 100644 --- a/littlechef/runner.py +++ b/littlechef/runner.py @@ -93,7 +93,10 @@ def deploy_chef(gems="no", ask="yes", version="0.10"): if version not in chef_versions: abort('Wrong Chef version specified. Valid versions are {0}'.format( ", ".join(chef_versions))) - distro_type, distro = solo.check_distro() + if distro_type is None and distro is None: + distro_type, distro = solo.check_distro() + elif distro_type is None or distro is None: + abort('Must specify both or neither of distro_type and distro') if ask == "yes": message = '\nAre you sure you want to install Chef {0}'.format(version) message += ' at the node {0}'.format(env.host_string)
Allow user to override autodetection of distro_type/distro in deploy_chef. I need this because I'm testing out an unreleased version of Oneiric, but Opscode have no upstream repo for this yet, so I need to tell littlechef to pretend it's on Natty. Use like so: cook node:<I> deploy_chef:distro_type=debian,distro=natty
tobami_littlechef
train
py
713c93c3ffb49e57a4f89313ba715ace0f00c85b
diff --git a/i3pystatus/mpd.py b/i3pystatus/mpd.py index <HASH>..<HASH> 100644 --- a/i3pystatus/mpd.py +++ b/i3pystatus/mpd.py @@ -36,6 +36,21 @@ Emulates ``mpc toggle``. next``. * ``previous_song`` — Goes to previous track in the playlist. Emulates \ ``mpc prev``. + * ``mpd_command`` — Send a command directly to MPD's socket. The command \ +is the second element of the list. Documentation for available commands can \ +be found at https://www.musicpd.org/doc/protocol/command_reference.html + + Example module registration with callbacks: + + :: + + status.register("mpd", + on_leftclick="switch_playpause", + on_rightclick=["mpd_command", "stop"], + on_middleclick=["mpd_command", "shuffle"], + on_upscroll=["mpd_command", "seekcur -10"], + on_downscroll=["mpd_command", "seekcur +10"]) + """ interval = 1 @@ -187,3 +202,9 @@ cleartext to the server.)"), self._mpd_command(self.s, "previous") except Exception as e: pass + + def mpd_command(self, command): + try: + self._mpd_command(self.s, command) + except Exception as e: + pass
Implement and document mpd_command method.
enkore_i3pystatus
train
py
8d070ba63c77512f7a8f807a52a36f5004dfb570
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -202,7 +202,9 @@ setup_params = dict( 'https://pypi.python.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2', ], scripts = [], - # tests_require = "setuptools[ssl]", + tests_require = [ + 'setuptools[ssl]', + ], ) if __name__ == '__main__':
Enable commented code (requiring ssl extra for tests).
pypa_setuptools
train
py
ed50845fb57563cde974dda7707e7dacb094c5c6
diff --git a/lib/holepicker/scanner.rb b/lib/holepicker/scanner.rb index <HASH>..<HASH> 100644 --- a/lib/holepicker/scanner.rb +++ b/lib/holepicker/scanner.rb @@ -48,13 +48,14 @@ module HolePicker def find_gemfiles_in_configs(path) configs = run_and_read_lines("find -L #{path} -type f -or -type l") - configs.select! { |f| File.exist?(f) } # skip broken links + configs = select_existing(configs) directories = configs.map do |f| File.read(f).scan(%r{\b(?:root|DocumentRoot)\s+(.*)/public\b}) end - directories.flatten.map { |dir| "#{dir}/Gemfile.lock" } + gemfiles = directories.flatten.map { |dir| "#{dir}/Gemfile.lock" } + select_existing(gemfiles) end def read_gemfile(path) @@ -86,6 +87,10 @@ module HolePicker end end + def select_existing(files) + files.select { |f| File.exist?(f) } + end + def run_and_read_lines(command) %x(#{command}).lines.map(&:strip) end
fix for directories w/o gemfiles
mackuba_holepicker
train
rb
6d1a70ac83cb493bddb6162aa335af14ffb1d3ca
diff --git a/src/Factory/Email.php b/src/Factory/Email.php index <HASH>..<HASH> 100644 --- a/src/Factory/Email.php +++ b/src/Factory/Email.php @@ -501,8 +501,10 @@ abstract class Email $aData['to_email'] = $mUserIdOrEmail; } - $this->bLastEmailDidSend = $oEmailer->send($aData, $bGraceful); - $this->aEmailsGenerated[] = clone $oEmailer->getLastEmail(); + $this->bLastEmailDidSend = $oEmailer->send($aData, $bGraceful); + if ($this->bLastEmailDidSend) { + $this->aEmailsGenerated[] = clone $oEmailer->getLastEmail(); + } } return $this;
Fixes bug where email does not send
nails_module-email
train
php
b707be16b5e40c54b959cd1d41ff1c99472d5ffd
diff --git a/src/context.js b/src/context.js index <HASH>..<HASH> 100644 --- a/src/context.js +++ b/src/context.js @@ -68,8 +68,8 @@ Context.prototype.visitBundles = function(visitor) { var context = this; return Object.keys(context.shards).reduce(function(context, name) { - return context.setShard(name, visitor(context.shards[name], context.shards[name].dest, false)); - }, context.setBundle(visitor(context.bundle, context.bundle.dest, true))); + return context.setShard(name, visitor(context.shards[name])); + }, context.setBundle(visitor(context.bundle))); }; Context.prototype.setBundle = function(bundle) {
removed extra arguments in the visitor methods when visiting bundles. The data is available in the bundle itself.
MiguelCastillo_bit-bundler
train
js
20312989cf9e67f2ef2a461c1c8dd298b72b97c3
diff --git a/dispatch/modules/content/embeds.py b/dispatch/modules/content/embeds.py index <HASH>..<HASH> 100644 --- a/dispatch/modules/content/embeds.py +++ b/dispatch/modules/content/embeds.py @@ -26,12 +26,12 @@ embedlib = EmbedLibrary() def tag(tag, content): - return "<{tag}>{content}</{tag}>".format(tag=tag, content=content) + return u"<{tag}>{content}</{tag}>".format(tag=tag, content=content) def maptag(tagname, contents): """Returns the HTML produced from enclosing each item in `contents` in a tag of type `tagname`""" - return ''.join(tag(tagname, item) for item in contents) + return u"".join(tag(tagname, item) for item in contents) class AbstractController(object):
Change from str to unicode to avoid encoding errors
ubyssey_dispatch
train
py
7080a815d0e9d76ea28658874db45a93cf8b13c8
diff --git a/lib/charlotte.js b/lib/charlotte.js index <HASH>..<HASH> 100755 --- a/lib/charlotte.js +++ b/lib/charlotte.js @@ -1993,7 +1993,9 @@ if (page.onError && callback == defaultCallback) { page.onError(err, tab, function() {}); } - } else if (/*!viewLoaded && */page.type.match(/get/i) && !isReload) { + } if (isReload) { + self.stack[stack.length-1] = loadPage + } else if (/*!viewLoaded && */page.type.match(/get/i)) { pushOnStack(loadPage); } });
must replace current page in stack on reload()
danieldkim_charlotte
train
js
a4d6f62df0f4be0ca7f97571e7c3e83c4be5a69a
diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java index <HASH>..<HASH> 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java @@ -62,9 +62,9 @@ public class UserGroupService { /** * Returns the base search filter which should be used to retrieve user * groups which do not represent Guacamole connections. As excluding the - * guacConfigGroup object class may not work as expected (may always return - * zero results) if guacConfigGroup object class is not defined, it should - * only be explicitly excluded if it is expected to have been defined. + * guacConfigGroup object class may not work as expected if it is not + * defined (may always return zero results), it should only be explicitly + * excluded if it is expected to have been defined. * * @return * The base search filter which should be used to retrieve user groups.
GUACAMOLE-<I>: Reword description of getGroupSearchFilter() to be less brain-meltingly difficult to read.
glyptodon_guacamole-client
train
java
5c5ccbd8599c9c05f4338bbff4e9edc682d50960
diff --git a/bingraphvis/angr/factory.py b/bingraphvis/angr/factory.py index <HASH>..<HASH> 100644 --- a/bingraphvis/angr/factory.py +++ b/bingraphvis/angr/factory.py @@ -24,7 +24,7 @@ class AngrVisFactory(object): vis.add_edge_annotator(AngrColorEdgesVex()) elif asminst: if color_edges: - if project.arch.name == 'ARMEL': + if project.arch.name in ('ARM', 'ARMEL', 'ARMHF'): vis.add_edge_annotator(AngrColorEdgesAsmArm()) elif project.arch.name in ('X86', 'AMD64'): vis.add_edge_annotator(AngrColorEdgesAsmX86())
Add ARM and ARMHF arch to coloring
axt_bingraphvis
train
py
26041bef10e6633382704e7fa06839e286b358bd
diff --git a/inlineplz/interfaces/github.py b/inlineplz/interfaces/github.py index <HASH>..<HASH> 100644 --- a/inlineplz/interfaces/github.py +++ b/inlineplz/interfaces/github.py @@ -50,6 +50,10 @@ class GitHubInterface(InterfaceBase): self.pull_request_number = None if branch and not pr: for pull_request in self.github_repo.iter_pulls(): + print('Branch: {} - Pull Request Head Ref: {}'.format( + branch, + pull_request.to_json()['head']['ref'] + )) if pull_request.to_json()['head']['ref'] == branch: pr = pull_request.to_json()['number'] break
Add a bit of logging when matching branches to PRs (#<I>)
guykisel_inline-plz
train
py
c3b269d4de61afd33592a9fdb7f4fa161144a188
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -76,15 +76,14 @@ module.exports = function parseGitHubCalendarSvg (input) { data.current_streak_range[0] = obj.date; } - ++data.current_streak; - data.last_year += obj.count; - - if (!obj.count) { - updateLongestStreak(); - data.current_streak = 0; - } else { + if (obj.count) { + ++data.current_streak; + data.last_year += obj.count; data.last_contributed = obj.date; data.current_streak_range[1] = obj.date; + } else { + updateLongestStreak(); + data.current_streak = 0; } lastWeek.push(obj);
🐛 Fix current and longest streak counts.
IonicaBizau_github-calendar-parser
train
js
4e1d38b1a72f17a56cb04e68923d96f0eae23fbf
diff --git a/pwm/encoding.py b/pwm/encoding.py index <HASH>..<HASH> 100644 --- a/pwm/encoding.py +++ b/pwm/encoding.py @@ -20,8 +20,10 @@ except TypeError: DEFAULT_CHARSET = 'full' DEFAULT_LENGTH = 16 +# 'full' repeats digits twice, to increase the probablity of a digit appearing in a default 16 +# character password, for sites that suck at estimating entropy and requires digits to be present PRESETS = { - 'full': string.ascii_letters + string.digits + '!#$%&()*+,-./:;=?@[]^_|~', + 'full': string.ascii_letters + 2 * string.digits + '!#$%&()*+,-./:;=?@[]^_|~', 'alpha': string.ascii_letters, 'numeric': string.digits, 'alphanumeric': string.ascii_letters + string.digits,
Undo removal of double set of digits in default charset Having the double set increases odds of a digit present in the default charset password, lowering odds that it will be rejected by silly sites that put restrictions on what characters must and must not be included.
thusoy_pwm
train
py
dead70724e18e0e4b2265a9df4d9a1e481223063
diff --git a/test/test_static_file.rb b/test/test_static_file.rb index <HASH>..<HASH> 100644 --- a/test/test_static_file.rb +++ b/test/test_static_file.rb @@ -75,9 +75,9 @@ class TestStaticFile < JekyllUnitTest should "be able to convert to liquid" do expected = { - "path" => "/static_file.txt", - "modified_time" => @static_file.mtime.to_s, - "extname" => ".txt" + "extname" => ".txt", + "modified_time" => @static_file.modified_time, + "path" => "/static_file.txt", } assert_equal expected, @static_file.to_liquid end
Fix expectation for StaticFile#to_liquid in tests.
jekyll_jekyll
train
rb
f509870afbc05525d206212eec3f5797ef182039
diff --git a/lib/weechat/buffer.rb b/lib/weechat/buffer.rb index <HASH>..<HASH> 100644 --- a/lib/weechat/buffer.rb +++ b/lib/weechat/buffer.rb @@ -135,6 +135,7 @@ module Weechat PROCESSORS = { [:lines_hidden, :time_for_each_line, :text_search_exact, :text_search_found] => lambda {|v| Weechat.integer_to_bool(v) }, + [:highlight_words, :highlight_tags] => lambda {|v| v == "-" ? [] : v.split(",") } } # The processing procedures that get applied to values before they
added processing for highlight lists in Weechat::Buffer
dominikh_weechat-ruby
train
rb
997b04da0bc39b067a6fffe1428d310644b5b217
diff --git a/djcelery_model/__init__.py b/djcelery_model/__init__.py index <HASH>..<HASH> 100644 --- a/djcelery_model/__init__.py +++ b/djcelery_model/__init__.py @@ -6,7 +6,7 @@ support for tracking Celery tasks assigned to Django model instances. __version_info__ = { 'major': 0, 'minor': 0, - 'micro': 2, + 'micro': 3, 'releaselevel': 'dev', }
Bumped version to <I>dev during development
mback2k_django-celery-model
train
py
563026649bb1ef7676180d8ff8fa49bd6cb338e0
diff --git a/remoto/tests/test_process.py b/remoto/tests/test_process.py index <HASH>..<HASH> 100644 --- a/remoto/tests/test_process.py +++ b/remoto/tests/test_process.py @@ -1,6 +1,7 @@ from mock import Mock +from mock import patch from remoto import process - +import subprocess class TestExtendPath(object): @@ -38,3 +39,19 @@ class TestExtendPath(object): fake_conn.receive.return_value = {'PATH': '/home/alfredo/bin'} result = process.extend_env(fake_conn, {'extend_env': {'CEPH_VOLUME_DEBUG': '1'}}) assert result.get('extend_env') is None + + @patch('subprocess.Popen') + def test_remote_check_command_encoding_returns_bytes(self,fake_popen): + fake_conn = Mock() + fake_conn.gateway.remote_exec.return_value = fake_conn + fake_conn.receive.return_value = {} + + test_str = "test string" + fake_comm = Mock() + fake_comm.communicate.return_value = iter([test_str,'']) + fake_popen.return_value = fake_comm + + process._remote_check(fake_conn,cmd='', stdin=test_str) + + assert isinstance(fake_comm.communicate.call_args[0][0],bytes) +
Add unit test to ensure bytes are sent to process.communicate()
alfredodeza_remoto
train
py
d0a97a14721bef8d8577f8c50a4d6a02697413bc
diff --git a/src/Eth.php b/src/Eth.php index <HASH>..<HASH> 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -26,6 +26,7 @@ class Eth 'eth_syncing' => [], 'eth_coinbase' => [], 'eth_mining' => [], + 'eth_hashrate' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index <HASH>..<HASH> 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -116,6 +116,27 @@ class EthTest extends TestCase } /** + * testHashrate + * + * @return void + */ + public function testHashrate() + { + $eth = $this->web3->eth; + + $eth->hashrate(function ($err, $hashrate) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($hashrate->result)) { + $this->assertTrue(is_string($hashrate->result)); + } else { + $this->fail($hashrate->error->message); + } + }); + } + + /** * testUnallowedMethod * * @return void
eth_hashrate.
sc0Vu_web3.php
train
php,php
d20b383b6df11d791466bf1fbab28faa532e2b38
diff --git a/pyclustering/core/kmedoids_wrapper.py b/pyclustering/core/kmedoids_wrapper.py index <HASH>..<HASH> 100644 --- a/pyclustering/core/kmedoids_wrapper.py +++ b/pyclustering/core/kmedoids_wrapper.py @@ -24,7 +24,7 @@ """ -from ctypes import cdll, c_double, c_size_t, c_void_p, cast, POINTER; +from ctypes import cdll, c_double, c_size_t, c_void_p, cast, pointer, POINTER; from pyclustering.core.wrapper import PATH_DLL_CCORE_64, create_pointer_data, pyclustering_package, pyclustering_type_data, extract_pyclustering_package; @@ -41,9 +41,9 @@ def kmedoids(sample, medoids, tolerance): medoids_package.data = cast(c_medoids, POINTER(c_void_p)); ccore = cdll.LoadLibrary(PATH_DLL_CCORE_64); - package = ccore.kmedoids_algorithm(pointer_data, medoids_package, c_double(tolerance)); + package = ccore.kmedoids_algorithm(pointer_data, pointer(medoids_package), c_double(tolerance)); result = extract_pyclustering_package(package); ccore.free_pyclustering_package(package); - return result; \ No newline at end of file + return result;
[pyclustering.core] Correction for wrapper of K-Medoids.
annoviko_pyclustering
train
py
8798033ddea4b37cb68407007afd1363324480d1
diff --git a/src/umbra/engine.py b/src/umbra/engine.py index <HASH>..<HASH> 100644 --- a/src/umbra/engine.py +++ b/src/umbra/engine.py @@ -1253,7 +1253,7 @@ class Umbra(foundations.ui.common.QWidgetFactory(uiFile=RuntimeGlobals.uiFile)): self.setVisualStyle(fullScreenStyle=False) self.showNormal() # TODO: Remove hack that ensure toolBar is repainted. - self.resize(self.size().width() + 1, self.size().height() + 1) + platform.system() == "Darwin" and self.resize(self.size().width() + 1, self.size().height() + 1) else: self.setUnifiedTitleAndToolBarOnMac(False) self.setVisualStyle(fullScreenStyle=True)
Ensure toolBar hack is only affecting Darwin Os in "engine" module.
KelSolaar_Umbra
train
py
82337640da8217a8674ff61abfe65189eddfbb4d
diff --git a/src/cli/event.js b/src/cli/event.js index <HASH>..<HASH> 100644 --- a/src/cli/event.js +++ b/src/cli/event.js @@ -15,6 +15,15 @@ const event = { eventName = undefined; } + const eventLabel = eventName ? `"${eventName}"` : 'all events'; + if (!deviceIdOrName) { + log.success(`Subscribing to ${eventLabel} from the firehose (all devices)`); + } else if (deviceIdOrName === 'mine') { + log.success(`Subscribing to ${eventLabel} from your personal stream (your devices only)`); + } else { + log.success(`Subscribing to ${eventLabel} from ${deviceIdOrName}'s stream`); + } + return eventLib.subscribe(deviceIdOrName, eventName).then(req => { return when.promise((resolve, reject) => { req.on('event', e => { @@ -22,6 +31,10 @@ const event = { }); req.on('error', reject); }); + }).catch(err => { + const errors = err && err.body && err.body.info; + return when.reject(errors || err); + }); }, publish(opts) {
Add nice output for subscribe detailing scope. Fix error reporting
particle-iot_particle-cli
train
js
d9126a43aa9486988cce0b74937a1fa7cf88bde0
diff --git a/lib/beaker-hostgenerator/hypervisor/abs.rb b/lib/beaker-hostgenerator/hypervisor/abs.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-hostgenerator/hypervisor/abs.rb +++ b/lib/beaker-hostgenerator/hypervisor/abs.rb @@ -37,7 +37,7 @@ module BeakerHostGenerator when 'AARCH64' 'arm64' when 'POWER' - base_template = node_info['ostype'].sub(/ubuntu(\d\d)/, 'ubuntu-\1.') + base_template.sub!(/ubuntu-(\d\d)/, 'ubuntu-\1.') 'power8' else raise "Unknown bits '#{node_info['bits']}' for '#{node_info['ostype']}'"
Add dot between Ubuntu POWER major and minor versions This should accomplish the same functionality as before, but calls sub on the base_template variable instead of node_info which is also done on line <I>. The purpose of the initial sub is to add a dash between the platform name and version.
puppetlabs_beaker-hostgenerator
train
rb
e9feebfb650a59bdd70fbb1d1b7e12ffe36025fd
diff --git a/test/normalize-options.test.js b/test/normalize-options.test.js index <HASH>..<HASH> 100644 --- a/test/normalize-options.test.js +++ b/test/normalize-options.test.js @@ -570,7 +570,6 @@ describe("normalize options", () => { webpackConfig = require("./fixtures/multi-compiler-one-configuration/webpack.config"); if (Array.isArray(item.webpackConfig)) { - // eslint-disable-next-line no-shadow webpackConfig = item.webpackConfig.map((config, index) => { return { ...webpackConfig[index], ...config }; });
chore: fix lint warning (#<I>)
webpack_webpack-dev-server
train
js
a68c6e1cbfd2775861e2ce118d531475df2d06b4
diff --git a/pkg/chunked/storage_linux.go b/pkg/chunked/storage_linux.go index <HASH>..<HASH> 100644 --- a/pkg/chunked/storage_linux.go +++ b/pkg/chunked/storage_linux.go @@ -654,8 +654,14 @@ func (d *chunkedZstdDiffer) ApplyDiff(dest string, options *archive.TarOptions) return output, err } + const trueVal = "true" + + if value := storeOpts.PullOptions["enable_partial_images"]; strings.ToLower(value) != trueVal { + return output, errors.New("enable_partial_images not configured") + } + enableHostDedup := false - if value := storeOpts.PullOptions["enable_host_deduplication"]; strings.ToLower(value) == "true" { + if value := storeOpts.PullOptions["enable_host_deduplication"]; strings.ToLower(value) == trueVal { enableHostDedup = true }
chunked: allow to disable partial images feature enable partial pulls only when it is explicitely configured in the storage.conf file: [storage.options] pull_options = {enable_partial_images = "true"} This is to prevent the experimental feature to leak into CRI-O. The default value will change in future once the feature is stable.
containers_storage
train
go
b17906396c1fe680af4cd515230cbfab64829a65
diff --git a/src/EnvironmentConfigReader.php b/src/EnvironmentConfigReader.php index <HASH>..<HASH> 100644 --- a/src/EnvironmentConfigReader.php +++ b/src/EnvironmentConfigReader.php @@ -101,7 +101,7 @@ class EnvironmentConfigReader implements ConfigReader */ private function validateConfigKeyNotEmpty($configKey) { - if ('' === $configKey) { + if ('' === trim($configKey)) { $message = 'The given environment configuration key is empty.'; throw new EnvironmentConfigKeyIsEmptyException($message); }
Issue #<I>: Trim config key before checking if it is empty
lizards-and-pumpkins_catalog
train
php
3286d70092f4d6a019e0ca44e9d7c7654c31ec39
diff --git a/system/src/Grav/Common/Service/AccountsServiceProvider.php b/system/src/Grav/Common/Service/AccountsServiceProvider.php index <HASH>..<HASH> 100644 --- a/system/src/Grav/Common/Service/AccountsServiceProvider.php +++ b/system/src/Grav/Common/Service/AccountsServiceProvider.php @@ -27,9 +27,10 @@ class AccountsServiceProvider implements ServiceProviderInterface public function register(Container $container) { $container['accounts'] = function (Container $container) { - /** @var Debugger $debugger */ - $debugger = $container['debugger']; - if ($container['config']->get('system.accounts.type') === 'flex') { + $type = strtolower(defined('GRAV_USER_INSTANCE') ? GRAV_USER_INSTANCE : $container['config']->get('system.accounts.type', 'data')); + if ($type === 'flex') { + /** @var Debugger $debugger */ + $debugger = $container['debugger']; $debugger->addMessage('User Accounts: Flex Directory'); return $this->flexAccounts($container); }
Lock Grav user class once GRAV_USER_INSTANCE has been defined
getgrav_grav
train
php
02e0fa904fd0e16a277c96ebf4a16e1be31ec732
diff --git a/spec/rews/folder_spec.rb b/spec/rews/folder_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rews/folder_spec.rb +++ b/spec/rews/folder_spec.rb @@ -154,6 +154,19 @@ module Rews end + it "should parse a response with no folders" do + client = Object.new + folders = test_find_folder(client, + {:base_shape=>:IdOnly}, + nil, + nil, + {:includes_last_item_in_range=>false, + :indexed_paging_offset=>0, + :total_items_in_view=>0, + :folders=>nil}) + folders.result.should == [] + end + it "should generate xml with indexed_page_folder_view and parse a response with multiple folders" do client = Object.new folders = test_find_folder(client,
spec to check that find_folder results with no folders are parsed correctly
trampoline_rews
train
rb
91156c5836db7ea6da5942d0c000c53542b0decf
diff --git a/python/herald/transports/xmpp/transport.py b/python/herald/transports/xmpp/transport.py index <HASH>..<HASH> 100644 --- a/python/herald/transports/xmpp/transport.py +++ b/python/herald/transports/xmpp/transport.py @@ -54,6 +54,7 @@ import sleekxmpp # Pelix from pelix.ipopo.decorators import ComponentFactory, Requires, Provides, \ Property, Validate, Invalidate +import pelix.misc.jabsorb as jabsorb # Standard library import json @@ -196,7 +197,7 @@ class XmppTransport(object): sender_uid = "<unknown>" try: - content = json.loads(msg['body']) + content = jabsorb.from_jabsorb(json.loads(msg['body'])) except ValueError: # Content can't be decoded, use its string representation as is content = msg['body'] @@ -273,7 +274,8 @@ class XmppTransport(object): :param parent_uid: UID of the message this one replies to (optional) """ # Convert content to JSON - content = json.dumps(message.content, default=utils.json_converter) + content = json.dumps(jabsorb.to_jabsorb(message.content), + default=utils.json_converter) # Prepare an XMPP message, based on the Herald message xmpp_msg = self._bot.make_message(mto=target,
Use Jabsorb format in XMPP messages This allows communications with the Java implementation
cohorte_cohorte-herald
train
py
07a6dc7ac5d0d5f6d1525a9e5fd0d564d8c3ba0b
diff --git a/src/search/SearchResultsView.js b/src/search/SearchResultsView.js index <HASH>..<HASH> 100644 --- a/src/search/SearchResultsView.js +++ b/src/search/SearchResultsView.js @@ -361,7 +361,7 @@ define(function (require, exports, module) { ); this._$summary.html(Mustache.render(searchSummaryTemplate, { - query: (this._model.queryInfo.query && this._model.queryInfo.query.toString()) || "", + query: (this._model.queryInfo && this._model.queryInfo.query && this._model.queryInfo.query.toString()) || "", replaceWith: this._model.replaceText, titleLabel: this._model.isReplace ? Strings.FIND_REPLACE_TITLE_LABEL : Strings.FIND_TITLE_LABEL, scope: this._model.scope ? "&nbsp;" + FindUtils.labelForScope(this._model.scope) + "&nbsp;" : "",
fix null acces in some cases. usually observed in very large projects.
adobe_brackets
train
js
ffb959d794cab3f2abe2fbb5eae11568a1bd7252
diff --git a/lib/puppet/pops/parser/parser_support.rb b/lib/puppet/pops/parser/parser_support.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/pops/parser/parser_support.rb +++ b/lib/puppet/pops/parser/parser_support.rb @@ -118,7 +118,7 @@ class Parser if locator.is_a?(Puppet::Pops::Parser::Locator::SubLocator) # The error occurs when doing sub-parsing and the token must be transformed # Transpose the local offset, length to global "coordinates" - global_offset, global_length = locator.to_global(value.offset, value.length) + global_offset, _ = locator.to_global(value.offset, value.length) line = locator.locator.line_for_offset(global_offset) pos = locator.locator.pos_on_line(global_offset) else
(PUP-<I>) Get rid of warning that global_length is unused
puppetlabs_puppet
train
rb
ee9475e19eb0aa430c34b7b1fcd04690865dd20c
diff --git a/src/ControlMenuHandler.php b/src/ControlMenuHandler.php index <HASH>..<HASH> 100644 --- a/src/ControlMenuHandler.php +++ b/src/ControlMenuHandler.php @@ -22,7 +22,7 @@ class ControlMenuHandler extends MenuHandler * * @return string */ - protected function getPosition() + public function getPosition() { return $this->handler->has('extensions') ? '^:extensions' : '>:home'; }
Change getPosition visibility.
orchestral_control
train
php
8ce041d4b4f589ef14ceb8fca64ab6e1b425d357
diff --git a/src/Controller/Controller.php b/src/Controller/Controller.php index <HASH>..<HASH> 100644 --- a/src/Controller/Controller.php +++ b/src/Controller/Controller.php @@ -79,7 +79,6 @@ use ReflectionMethod; * @property \Cake\Controller\Component\PaginatorComponent $Paginator * @property \Cake\Controller\Component\RequestHandlerComponent $RequestHandler * @property \Cake\Controller\Component\SecurityComponent $Security - * @property \Cake\Controller\Component\SessionComponent $Session * @link http://book.cakephp.org/3.0/en/controllers.html */ class Controller implements EventListenerInterface
Remove doc block for SessionComponent. This component no longer exists, we shouldn't have an IDE tag for it either. Refs #<I>
cakephp_cakephp
train
php
63ffc788147add45d8701dd66228ffcd65f89584
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -63,7 +63,7 @@ function createServer (entryHandler, opts) { router.addRoute('/index.html', home) router.addRoute('/', home) router.addRoute('/favicon.ico', favicon) - router.addRoute('*.html', wildcard(true)) + router.addRoute('*.html?|*[^.]', wildcard(true)) router.addRoute('*', wildcard()) // allow user to toggle live reload integration
enable livereload on directories, not strictly files ending with `.html` (fixes #<I>)
mattdesl_budo
train
js
11e8662c1f7d93142a93209b50b7c265393d3d98
diff --git a/tests/frontend/org/voltdb/regressionsuites/LocalCluster.java b/tests/frontend/org/voltdb/regressionsuites/LocalCluster.java index <HASH>..<HASH> 100644 --- a/tests/frontend/org/voltdb/regressionsuites/LocalCluster.java +++ b/tests/frontend/org/voltdb/regressionsuites/LocalCluster.java @@ -964,7 +964,7 @@ public class LocalCluster implements VoltServerConfig { } else { if (m_cmdLines.size() > 0) { int portNoToRejoin = m_cmdLines.get(0).internalPort(); - cmdln.leader(":" + portNoToRejoin); + cmdln.coordinators(":" + portNoToRejoin); cmdln.enableAdd(true); } } @@ -986,7 +986,7 @@ public class LocalCluster implements VoltServerConfig { subroot = m_subRoots.get(hostId); } cmdln.voltFilePrefix(subroot.getPath()); - cmdln.voltRoot(subroot.getPath() + "/" + m_voltdbroot); + cmdln.voltRoot(subroot.getPath() + File.separator + m_voltdbroot); } if ((m_versionOverrides != null) && (m_versionOverrides.length > hostId)) {
Squashed commit of the following: commit 7fb<I>eae<I>d<I>cfc<I>c<I>cedefb
VoltDB_voltdb
train
java
0aee27c1865dd1f1cfaf8f977c4982a3192a0b20
diff --git a/src/Webfactory/Slimdump/Database/Dumper.php b/src/Webfactory/Slimdump/Database/Dumper.php index <HASH>..<HASH> 100644 --- a/src/Webfactory/Slimdump/Database/Dumper.php +++ b/src/Webfactory/Slimdump/Database/Dumper.php @@ -85,6 +85,11 @@ class Dumper $bufferSize = 0; $max = 100 * 1024 * 1024; // 100 MB $numRows = $db->fetchOne("SELECT COUNT(*) FROM $table"); + + if ($numRows == 0) { + // Fail fast: No data to dump. + return; + } $progress = new ProgressBar($this->output, $numRows); $progress->setFormat("Dumping data <fg=cyan>$table</>: <fg=yellow>%percent:3s%%</> %remaining%/%estimated%");
Bugfix: If the Table we want to dump contains no data, do nothing.
webfactory_slimdump
train
php
b336ff651c1d92bf6f796dfb98fcbe46a1a29e37
diff --git a/memote/suite/cli/runner.py b/memote/suite/cli/runner.py index <HASH>..<HASH> 100644 --- a/memote/suite/cli/runner.py +++ b/memote/suite/cli/runner.py @@ -258,7 +258,12 @@ def history(model, solver, location, pytest_args, commits, skip, history.build_branch_structure() for commit in history.iter_commits(): repo.git.checkout(commit) - # TODO: Skip this commit if model was not touched. + modified = {blob[0] for blob in repo.index.entries} + if model not in modified: + LOGGER.info( + "The model was not modified in commit '{}'. Skipping.".format( + commit)) + continue LOGGER.info( "Running the test suite for commit '{}'.".format(commit)) proc = Process(
feat: skip commits in history Commits in git history in which the model was not modified are uninteresting and will be skipped.
opencobra_memote
train
py
ca6baa2328f91e551ad259192f3ff7a21495d100
diff --git a/packages/workbox-build/src/index.js b/packages/workbox-build/src/index.js index <HASH>..<HASH> 100644 --- a/packages/workbox-build/src/index.js +++ b/packages/workbox-build/src/index.js @@ -55,7 +55,7 @@ const injectManifest = require('./lib/inject-manifest'); * globDirectory: './build/', * globPatterns: ['**\/*.{html,js,css}'], * globIgnores: ['service-worker.js','admin.html'], - * mainfestDest: './build/scripts/manifest.js', + * manifestDest: './build/scripts/manifest.js', * templatedUrls: { * '/shell': ['shell.hbs', 'main.css', 'shell.css'], * },
typo (#<I>) mainfest --> manifest
GoogleChrome_workbox
train
js
e213827ee946928f60ca097e2f02fd00977e790a
diff --git a/src/java/com/threerings/media/util/TimedPath.java b/src/java/com/threerings/media/util/TimedPath.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/media/util/TimedPath.java +++ b/src/java/com/threerings/media/util/TimedPath.java @@ -1,8 +1,10 @@ // -// $Id: TimedPath.java,v 1.3 2003/01/17 22:57:08 mdb Exp $ +// $Id: TimedPath.java,v 1.4 2003/12/15 20:06:09 mdb Exp $ package com.threerings.media.util; +import com.threerings.media.Log; + /** * A base class for path implementations that endeavor to move their * pathables along a path in a specified number of milliseconds. @@ -17,9 +19,10 @@ public abstract class TimedPath implements Path { // sanity check some things if (duration <= 0) { - String errmsg = "Requested path with illegal duration (<=0) " + - "[duration=" + duration + "]"; - throw new IllegalArgumentException(errmsg); + Log.warning("Requested path with illegal duration (<=0) " + + "[duration=" + duration + "]"); + Thread.dumpStack(); + duration = 1; // assume something short but non-zero } _duration = duration;
Let's just warn and cope rather than sticking a fork in things. 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
3fb7fdc2aca99c41342411d237c26c076afa8d0b
diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index <HASH>..<HASH> 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -161,13 +161,13 @@ class Mustache_Engine * @see Mustache_Template::render * * @param string $template - * @param mixed $data + * @param mixed $context (default: array()) * * @return string Rendered template */ - public function render($template, $data = array()) + public function render($template, $context = array()) { - return $this->loadTemplate($template)->render($data); + return $this->loadTemplate($template)->render($context); } /**
Update docs, variable name for render passthrough.
bobthecow_mustache.php
train
php
6a55034bdff893fc7fd6ee9de2c061f2a8b525cf
diff --git a/boombot.js b/boombot.js index <HASH>..<HASH> 100644 --- a/boombot.js +++ b/boombot.js @@ -287,6 +287,22 @@ bot.on('speak', function (data) { } }); } + //The below commands will modify the bots laptop. Set before he takes the stage. This command can be activated while the bot is DJ'ing, however, the laptop icon will not change until he leaves the stage and comes back. + //set the bots laptop to an iPhone + if (data.text.match(/phone up/i)) { + bot.speak('iPhone mode ready master.'); + bot.modifyLaptop('iphone'); + } + //set the bots laptop to a mac + if (data.text.match(/fruit up/i)) { + bot.speak('Apple mode ready master.'); + bot.modifyLaptop('mac'); + } + //set the bots laptop to linux + if (data.text.match(/nix up/i)) { + bot.speak('Ubuntu mode ready master.'); + bot.modifyLaptop('linux'); + } } });
added ability to change the bots laptop type
TerrordactylDesigns_boombot
train
js
fdf98f750ca94506f7cb175f1b78af3751088deb
diff --git a/nodeconductor/core/handlers.py b/nodeconductor/core/handlers.py index <HASH>..<HASH> 100644 --- a/nodeconductor/core/handlers.py +++ b/nodeconductor/core/handlers.py @@ -119,7 +119,6 @@ def log_ssh_key_delete(sender, instance, **kwargs): def log_token_create(sender, instance, created=False, **kwargs): if created: - event_logger.token.info( 'Token has been updated for {affected_user_username}', event_type='token_created',
Remove blank line [WAL-<I>]
opennode_waldur-core
train
py
dc85fbb53a1bfe9e89ad3e18dab219d65a9662bf
diff --git a/spec/lib/daemons/application_spec.rb b/spec/lib/daemons/application_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/daemons/application_spec.rb +++ b/spec/lib/daemons/application_spec.rb @@ -21,8 +21,12 @@ module Daemons before { application.instance_variable_set :@options, options } describe '#app_argv' do - subject { application.app_argv } - it { is_expected.to be_nil } + let(:app_argv) { "some value" } + + it 'allows an arbitrary value to be set' do + application.app_argv = app_argv + expect(application.app_argv).to eq app_argv + end end describe '#controller_argv' do
Include setters in the tests for app_argv
thuehlinger_daemons
train
rb
3ae5c97e3a039bcd2a46781da3adddff82ab3bb8
diff --git a/views/js/qtiCreator/editor/ckEditor/htmlEditor.js b/views/js/qtiCreator/editor/ckEditor/htmlEditor.js index <HASH>..<HASH> 100755 --- a/views/js/qtiCreator/editor/ckEditor/htmlEditor.js +++ b/views/js/qtiCreator/editor/ckEditor/htmlEditor.js @@ -83,6 +83,7 @@ define([ var ckConfig = { dtdMode : 'qti', autoParagraph : false, + removePlugins : options.removePlugins || '', enterMode : options.enterMode || CKEditor.ENTER_P, floatSpaceDockedOffsetY : 10, taoQtiItem : { diff --git a/views/js/qtiCreator/widgets/static/table/states/Active.js b/views/js/qtiCreator/widgets/static/table/states/Active.js index <HASH>..<HASH> 100644 --- a/views/js/qtiCreator/widgets/static/table/states/Active.js +++ b/views/js/qtiCreator/widgets/static/table/states/Active.js @@ -65,6 +65,7 @@ define([ htmlEditor.buildEditor($editableContainer, { placeholder: '', change : contentHelper.getChangeCallback(container), + removePlugins: 'taoqtitable,magicline', data : { container : container, widget : _widget
disable table creation and magic line plugin in table widget
oat-sa_extension-tao-itemqti
train
js,js
8c11fdb4d36dbea9fd46c4bde96fa17ca9e1914f
diff --git a/src/test/java/com/buschmais/jqassistant/plugin/maven3/test/rule/Maven3IT.java b/src/test/java/com/buschmais/jqassistant/plugin/maven3/test/rule/Maven3IT.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/buschmais/jqassistant/plugin/maven3/test/rule/Maven3IT.java +++ b/src/test/java/com/buschmais/jqassistant/plugin/maven3/test/rule/Maven3IT.java @@ -31,7 +31,7 @@ public class Maven3IT extends AbstractPluginIT { store.commitTransaction(); assertThat(validateConstraint("maven3:HierarchicalParentModuleRelation").getStatus(), equalTo(FAILURE)); store.beginTransaction(); - List<Result<Constraint>> constraintViolations = new ArrayList<>(reportWriter.getConstraintResults().values()); + List<Result<Constraint>> constraintViolations = new ArrayList<>(reportPlugin.getConstraintResults().values()); assertThat(constraintViolations.size(), equalTo(1)); Result<Constraint> result = constraintViolations.get(0); assertThat(result, result(constraint("maven3:HierarchicalParentModuleRelation")));
refactored reporting plugin API for better control of plugin selection
buschmais_jqa-maven3-plugin
train
java
7b5f81bd4774cdb442c7d2eae9c8b30b1803424a
diff --git a/lib/utils/runner.js b/lib/utils/runner.js index <HASH>..<HASH> 100755 --- a/lib/utils/runner.js +++ b/lib/utils/runner.js @@ -51,11 +51,16 @@ var run_command = function(command, args){ } +var safe_escape = function(str) { + return str.replace(/[\"\`\$\|]/g, "\\$&"); +} + try { process.setuid(run_as); // console.log('New uid: ' + process.getuid()); } catch (err) { if (process.platform != 'win32') { + args = args.map(function(a){ return safe_escape(a); }) command = ['"' + command].concat(args).join('" "') + '"'; args = ['-n', 'su', run_as, '-c', command]; command = sudo_bin;
Escape back ticks and $() in runner.js for safety.
prey_prey-node-client
train
js
798bc5465bbf4e97141b8b7be5a8658498bb6e2f
diff --git a/Executor/Executor.php b/Executor/Executor.php index <HASH>..<HASH> 100644 --- a/Executor/Executor.php +++ b/Executor/Executor.php @@ -96,7 +96,7 @@ class Executor implements ExecutorInterface $executor = $this; $data = $fixtureData->getData(); array_walk_recursive($data, function(&$value, $key) use ($executor, $fixtures) { - if (preg_match('/^@(\w*):(\w*)$/', $value, $hit)) { + if (preg_match('/^@(\w*):([\w-_]*)$/', $value, $hit)) { if(!$fixtures->has($hit[1]) || !$fixtures->get($hit[1])->getFixtureData($hit[2])) { throw new ReferenceNotFoundException($hit[1], $hit[2]); @@ -166,4 +166,4 @@ class Executor implements ExecutorInterface $fixtureData->setLoaded(); } -} \ No newline at end of file +}
Handle fixture names with - and _ in them
DavidBadura_FixturesBundle
train
php
f3c70ad17ca30a44f0aad4273df7dc5ebf71da3f
diff --git a/parsecsv.lib.php b/parsecsv.lib.php index <HASH>..<HASH> 100644 --- a/parsecsv.lib.php +++ b/parsecsv.lib.php @@ -463,6 +463,9 @@ class parseCSV { if ( $delimiter === null ) { $delimiter = $this->output_delimiter; } + else { + $this->output_delimiter = $delimiter; + } $data = $this->unparse($data, $fields, null, null, $delimiter);
Fix local/global delimiter bug between output() and _enclose_value() by setting global delimiter to local if not null
parsecsv_parsecsv-for-php
train
php
4ed9b26c15e39238eaadc673460ae7dc5a7089f8
diff --git a/lxd/main_forknet.go b/lxd/main_forknet.go index <HASH>..<HASH> 100644 --- a/lxd/main_forknet.go +++ b/lxd/main_forknet.go @@ -150,6 +150,9 @@ func (c *cmdForknet) Command() *cobra.Command { cmdDetach.RunE = c.RunDetach cmd.AddCommand(cmdDetach) + // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706 + cmd.Args = cobra.NoArgs + cmd.Run = func(cmd *cobra.Command, args []string) { cmd.Usage() } return cmd }
lxd/main/forknet: workaround for subcommand errors
lxc_lxd
train
go
7b4eb76822557a0f8c11739719d080d852598862
diff --git a/cli/github/tests/test_release_notes.py b/cli/github/tests/test_release_notes.py index <HASH>..<HASH> 100644 --- a/cli/github/tests/test_release_notes.py +++ b/cli/github/tests/test_release_notes.py @@ -49,6 +49,9 @@ class TestChangeNotesLinesParser(unittest.TestCase): def test_parse_start_line_no_end_line(self): pass + def test_parse_start_line_no_content_no_end_line(self): + pass + def test_parse_multiple_start_lines_without_end_lines(self): pass
added stub test for ChangeNotesLinesParser
SFDO-Tooling_CumulusCI
train
py
f84b19748d7d0dfda496b73ab365a2e64b377696
diff --git a/tests/languages/python_test.py b/tests/languages/python_test.py index <HASH>..<HASH> 100644 --- a/tests/languages/python_test.py +++ b/tests/languages/python_test.py @@ -7,7 +7,6 @@ import sys import mock import pytest -from pre_commit import parse_shebang from pre_commit.languages import python @@ -45,12 +44,7 @@ def test_sys_executable_matches_does_not_match(v): ), ) def test_find_by_sys_executable(exe, realpath, expected): - def mocked_find_executable(exe): - return exe.rpartition('/')[2] with mock.patch.object(sys, 'executable', exe): with mock.patch.object(os.path, 'realpath', return_value=realpath): - with mock.patch.object( - parse_shebang, 'find_executable', - side_effect=mocked_find_executable, - ): + with mock.patch.object(python, 'find_executable', lambda x: x): assert python._find_by_sys_executable() == expected
Patch the correct find_executable
pre-commit_pre-commit
train
py
2b65d651db220272f02ed1902d964a4ad4d01d51
diff --git a/spec/serf/builder_spec.rb b/spec/serf/builder_spec.rb index <HASH>..<HASH> 100644 --- a/spec/serf/builder_spec.rb +++ b/spec/serf/builder_spec.rb @@ -32,7 +32,6 @@ describe Serf::Builder do it 'runs the app' do response = subject.to_app.call request_parcel - puts response.to_hash response.message.should == request_parcel.message response.headers.kind.should == response_kind end
Remove 'puts' from builder_spec.rb Details: * Not needed puts debug output to stdout.
byu_serf
train
rb
2780af01f838879eecf0d527a3fab50d8626759a
diff --git a/Filter/FilterBuilderUpdater.php b/Filter/FilterBuilderUpdater.php index <HASH>..<HASH> 100644 --- a/Filter/FilterBuilderUpdater.php +++ b/Filter/FilterBuilderUpdater.php @@ -146,7 +146,20 @@ class FilterBuilderUpdater implements FilterBuilderUpdaterInterface } else if (is_callable($callable)) { call_user_func($callable, $filterQuery, $field, $values); } else { - $eventName = sprintf('lexik_form_filter.apply.%s.%s', $filterQuery->getEventPartName(), is_string($callable) ? $callable : $formType->getName()); + // build specific event name including all form parent names + $name = $form->getName(); + $parentForm = $form; + do { + $parentForm = $parentForm->getParent(); + $name = $parentForm->getName() . '.' . $name; + } while ( ! $parentForm->isRoot()); + + // trigger specific or global event name + $eventName = sprintf('lexik_form_filter.apply.%s.%s', $filterQuery->getEventPartName(), $name); + if ( ! $this->dispatcher->hasListeners($eventName)) { + $eventName = sprintf('lexik_form_filter.apply.%s.%s', $filterQuery->getEventPartName(), is_string($callable) ? $callable : $formType->getName()); + } + $event = new ApplyFilterEvent($filterQuery, $field, $values); $this->dispatcher->dispatch($eventName, $event);
use EventDispatcher to trigger specific event name to each forms
lexik_LexikFormFilterBundle
train
php
d89a9742f14a68f56ad356f199a511ee29a0364f
diff --git a/xod-espruino/nodes/espruino/button.js b/xod-espruino/nodes/espruino/button.js index <HASH>..<HASH> 100644 --- a/xod-espruino/nodes/espruino/button.js +++ b/xod-espruino/nodes/espruino/button.js @@ -3,7 +3,7 @@ module.exports.setup = function(e) { var pin = new Pin(e.props.pin); setWatch(function(evt) { - e.fire({ state: evt.state }); + e.fire({ state: !evt.state }); }, pin, { edge: 'both', repeat: true,
Make 'core/button' more user friendly ("true" when pressed)
xodio_xod
train
js
67fa0c526f0a21bb57680ebb8e49699d44b3fcc2
diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Functional/DocumentPersisterTest.php @@ -26,6 +26,21 @@ class DocumentPersisterTest extends \Doctrine\ODM\MongoDB\Tests\BaseTest $this->documentPersister = $this->uow->getDocumentPersister($this->class); } + public function testExecuteUpsertShouldNeverReplaceDocuments() + { + $originalData = $this->dm->getDocumentCollection($this->class)->findOne(); + + $document = new DocumentPersisterTestDocument(); + $document->id = $originalData['_id']; + + $this->dm->persist($document); + $this->dm->flush(); + + $updatedData = $this->dm->getDocumentCollection($this->class)->findOne(array('_id' => $originalData['_id'])); + + $this->assertEquals($originalData, $updatedData); + } + public function testLoadPreparesCriteriaAndSort() { $criteria = array('name' => array('$in' => array('a', 'b')));
Regression test so that upserts never replace document data
doctrine_mongodb-odm
train
php
4ff12b29a8f938219d17707810201d8473148564
diff --git a/mysql/toolkit/script/execute.py b/mysql/toolkit/script/execute.py index <HASH>..<HASH> 100644 --- a/mysql/toolkit/script/execute.py +++ b/mysql/toolkit/script/execute.py @@ -112,21 +112,23 @@ class SQLScript: commands = filter_commands(commands, 'DROP') # Execute list of commands + print('\t' + str(len(commands)), 'commands') fail, success = self._execute_commands(commands) # Dump failed commands to text files print('\t' + str(success), 'successful commands') if len(fail) > 1 and self._dump_fails: + # Dump failed commands self.dump_commands(fail) - # Execute failed commands - if execute_fails: - self._execute_failed_commands(fail) + # Execute failed commands + if execute_fails: + print('executing failed') + self._execute_failed_commands(fail) return fail, success def _execute_commands(self, commands): """Execute commands and get list of failed commands and count of successful commands""" - print('\t' + str(len(commands)), 'commands') fail, success = [], 0 for command in tqdm(commands, total=len(commands), desc='Executing SQL Commands'): # Attempt to execute command and skip command if error is raised
Only executing failed commands if there is at least 1 fail
mrstephenneal_mysql-toolkit
train
py
a6dce73e3399b5c50a0adf8be8fb77ac69fb5c07
diff --git a/ryu/lib/packet/packet.py b/ryu/lib/packet/packet.py index <HASH>..<HASH> 100644 --- a/ryu/lib/packet/packet.py +++ b/ryu/lib/packet/packet.py @@ -97,6 +97,15 @@ class Packet(object): assert issubclass(protocol, packet_base.PacketBase) return [p for p in self.protocols if isinstance(p, protocol)] + def get_protocol(self, protocol): + """Returns the firstly found protocol that matches to the + specified protocol. + """ + result = self.get_protocols(protocol) + if len(result) > 0: + return result[0] + return None + def next(self): try: p = self.protocols[self.protocol_idx]
packet lib: add get_protocol API get_protocols returns the list of protocols. This is useful for a packet including the same protocol multiple times (e.g. tunneling such GRE). However, it's a rare use case. Instead of 'get_protocols(hoge)[0]', let's do 'get_protocol(hoge)' simply.
osrg_ryu
train
py
03a3bcb2d7c1d9495ac9d06da75222df749848b7
diff --git a/core/charm/repository/charmhub_test.go b/core/charm/repository/charmhub_test.go index <HASH>..<HASH> 100644 --- a/core/charm/repository/charmhub_test.go +++ b/core/charm/repository/charmhub_test.go @@ -645,7 +645,6 @@ func (refreshConfigSuite) TestRefreshByID(c *gc.C) { Architecture: "amd64", }, }}, - //Fields:[]string{"bases", "download", "id", "revision", "version", "resources"}, }) }
remove commented out line of code, not needed
juju_juju
train
go
1f3fab4cadb3512820c455e343f3520a1b99b729
diff --git a/src/Psalm/Plugin/Hook/AfterMethodCallAnalysisInterface.php b/src/Psalm/Plugin/Hook/AfterMethodCallAnalysisInterface.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Plugin/Hook/AfterMethodCallAnalysisInterface.php +++ b/src/Psalm/Plugin/Hook/AfterMethodCallAnalysisInterface.php @@ -27,6 +27,6 @@ interface AfterMethodCallAnalysisInterface StatementsSource $statements_source, Codebase $codebase, array &$file_replacements = [], - Union $return_type_candidate = null + Union &$return_type_candidate = null ); }
Make sure method call return type is passed by ref
vimeo_psalm
train
php
28086101901350387ed9378e1b1c62811b44b410
diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index <HASH>..<HASH> 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -196,6 +196,12 @@ ParticleContainer.prototype.renderCanvas = function (renderer) var finalWidth = 0; var finalHeight = 0; + var compositeOperation = renderer.blendModes[this.blendMode]; + if (compositeOperation !== context.globalCompositeOperation) + { + context.globalCompositeOperation = compositeOperation; + } + context.globalAlpha = this.worldAlpha; this.displayObjectUpdateTransform();
Setting blend mode when using CanvasRenderer. When rendering on canvas, the blend mode of the previously rendered object was used. The blend mode of the particle container will now be set correctly.
pixijs_pixi.js
train
js
9ab98969dd3f87f1183ec6dd8e911dc192fa86c4
diff --git a/tensorboard.py b/tensorboard.py index <HASH>..<HASH> 100644 --- a/tensorboard.py +++ b/tensorboard.py @@ -140,7 +140,11 @@ def main(unused_argv=None): print('Starting TensorBoard %s on port %d' % (tag, FLAGS.port)) if FLAGS.host == "0.0.0.0": - print('(You can navigate to http://%s:%d)' % (socket.gethostbyname(socket.gethostname()), FLAGS.port)) + try: + host = socket.gethostbyname(socket.gethostname()) + print('(You can navigate to http://%s:%d)' % (socket.gethostbyname(socket.gethostname()), FLAGS.port)) + except socket.gaierror: + pass else: print('(You can navigate to http://%s:%d)' % (FLAGS.host, FLAGS.port))
Fix bug where TensorBoard may crash if it cannot resolve host ip address
tensorflow_tensorboard
train
py
72143bb7cc3286bfab616d2161cf840221c3a6d3
diff --git a/src/component/es2015.js b/src/component/es2015.js index <HASH>..<HASH> 100644 --- a/src/component/es2015.js +++ b/src/component/es2015.js @@ -42,7 +42,7 @@ function resetActiveNode(activeNode) { function queueStateChanges(component, newState, callback) { if (isFunction(newState)) { - newState = newState(); + newState = newState(component.state); } for (let stateKey in newState) { component._pendingState[stateKey] = newState[stateKey];
added state passing to functional setState
infernojs_inferno
train
js
b4f34aad432989d8bab1d46ea514f5048678b07d
diff --git a/ckanutils.py b/ckanutils.py index <HASH>..<HASH> 100644 --- a/ckanutils.py +++ b/ckanutils.py @@ -33,7 +33,7 @@ from ckanapi import NotFound, NotAuthorized, ValidationError from tabutils import ( process as pr, io, fntools as ft, convert as cv, typetools as tt) -__version__ = '0.14.1' +__version__ = '0.14.2' __title__ = 'ckanutils' __author__ = 'Reuben Cummings'
Bump to version <I>
reubano_ckanutils
train
py
31994258fb48dbbd689a7bbd2a839c479879577c
diff --git a/src/ocrmypdf/_pipeline.py b/src/ocrmypdf/_pipeline.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/_pipeline.py +++ b/src/ocrmypdf/_pipeline.py @@ -753,7 +753,9 @@ def metadata_fixup(working_file: Path, context: PdfContext): # Reverse this, because PDF/A TechNote 0003:Metadata in PDF/A-1 # and the XMP Spec do not make this recommendation. if meta.get('dc:title') == 'Untitled': - with original.open_metadata() as original_meta: + with original.open_metadata( + set_pikepdf_as_editor=False, update_docinfo=False + ) as original_meta: if 'dc:title' not in original_meta: del meta['dc:title']
metadata fixup: don't try to update original PDF's metadata with docinfo
jbarlow83_OCRmyPDF
train
py
e0fe8ee9a7476bf1daa903391b25a21155907349
diff --git a/public/js/replay.js b/public/js/replay.js index <HASH>..<HASH> 100644 --- a/public/js/replay.js +++ b/public/js/replay.js @@ -39,7 +39,7 @@ function Replay (params) { * Sets the everything to . */ this.setUp = function (callback) { - $.get ('/ops/' + this.room, function (operations) { + $.get ('ops/' + this.room, function (operations) { if (operations[0] && operations[0].create) { instance.current_v = 0; instance.operations = operations;
Fixing issue with non-relative /ops/ path. When integrated into another node application, the replay functionality was breaking because it was not using a relative path to retrieve the operations log.
VisionistInc_jibe
train
js