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
1b69740f3ab0076dc304fed7856b0b8f30c4b6bc
diff --git a/src/main/java/water/api/Tutorials.java b/src/main/java/water/api/Tutorials.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/api/Tutorials.java +++ b/src/main/java/water/api/Tutorials.java @@ -20,7 +20,7 @@ public class Tutorials extends HTMLOnlyRequest { + " p { font-size:16px; }" + "</style>" + "<h1>Learn H<sub>2</sub>O at <a href='http://learn.h2o.ai'>learn.h2o.ai</a></h1>" - + "<h1>Learn more <a href='https://www.gitbook.com/@h2o'>@gitbook</a></h1>" + + "<h1>Learn more <a href='https://leanpub.com/u/h2oai'>@learnpub</a></h1>" + "<blockquote><medium>A unique way to explore H<sub>2</sub>O</medium></blockquote>" + "</div>"
gitbook link changed to learnpub link
h2oai_h2o-2
train
java
36c429c30289cda93f5648eef58dc19095dc8f5b
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,7 @@ const ( defaultConfigFilename = "btcd.conf" defaultLogLevel = "info" defaultBtcnet = btcwire.MainNet - defaultMaxPeers = 8 + defaultMaxPeers = 125 defaultBanDuration = time.Hour * 24 defaultVerifyEnabled = false defaultDbType = "leveldb"
Bump maxpeers to <I> like bitcoind. It helps a lot if our max peers doesn't equal the max we'll try and open outbound.
btcsuite_btcd
train
go
4d9ac5e6efef019b52ce72e1e0defeef8143600a
diff --git a/spec/helper.rb b/spec/helper.rb index <HASH>..<HASH> 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -1,16 +1,9 @@ -begin - require 'bundler/setup' -rescue LoadError - puts 'although not required, its recommended you use bundler when running the tests' -end - +$:.unshift File.expand_path('..', __FILE__) +$:.unshift File.expand_path('../../lib', __FILE__) require 'simplecov' SimpleCov.start - -require 'rspec' - require 'faraday_middleware' - +require 'rspec' class DummyApp attr_accessor :env @@ -22,4 +15,4 @@ class DummyApp def reset @env = nil end -end \ No newline at end of file +end
Push spec and lib onto the
lostisland_faraday_middleware
train
rb
2dee46a1a2b433fd623069c104b3ef9ee7d5db7a
diff --git a/lib/producer.js b/lib/producer.js index <HASH>..<HASH> 100644 --- a/lib/producer.js +++ b/lib/producer.js @@ -27,7 +27,7 @@ let buffer4 = function (v) { function producer (opts, cb) { - let stripe = opts.stripe; + let stripe = opts.stripe.slice(0); stripe.unshift(prepend); stripe.push(append); let extra = new Buffer(stripe.join(''));
bugfix: stripe will be reused to make other targets. hence clone it
zeit_pkg
train
js
781b4dbe0ff148455c68e4e9e4c2264d7dfe8157
diff --git a/scripts/bcbio_setup_genome.py b/scripts/bcbio_setup_genome.py index <HASH>..<HASH> 100755 --- a/scripts/bcbio_setup_genome.py +++ b/scripts/bcbio_setup_genome.py @@ -2,6 +2,7 @@ """ Script to set up a custom genome for bcbio-nextgen """ +from __future__ import print_function from argparse import ArgumentParser import gzip @@ -26,8 +27,6 @@ import gffutils from gffutils.iterators import DataIterator import tempfile -from __future__ import print_function - SEQ_DIR = "seq" RNASEQ_DIR = "rnaseq" SRNASEQ_DIR = "srnaseq"
python3: Move __future__ statement to start of script
bcbio_bcbio-nextgen
train
py
038c6e20eadea7615477a452816f42f7b031b416
diff --git a/src/test/java/com/buschmais/jqassistant/plugin/common/test/AbstractPluginIT.java b/src/test/java/com/buschmais/jqassistant/plugin/common/test/AbstractPluginIT.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/buschmais/jqassistant/plugin/common/test/AbstractPluginIT.java +++ b/src/test/java/com/buschmais/jqassistant/plugin/common/test/AbstractPluginIT.java @@ -61,7 +61,15 @@ public abstract class AbstractPluginIT { protected void starting(Description description) { Class<?> testClass = description.getTestClass(); try { - testMethod = testClass.getDeclaredMethod(description.getMethodName()); + String methodName = description.getMethodName(); + + // Handles method names of parameterized JUnit tests + // They end with an index as "[0]" + if (methodName.matches(".*\\[\\d+\\]$")) { + methodName = methodName.replaceAll("\\[\\d+\\]", ""); + } + + testMethod = testClass.getDeclaredMethod(methodName); } catch (NoSuchMethodException e) { Assert.fail(e.getMessage()); }
Changed the lookup of the currently executed test method to support parameterized unit tests.
buschmais_jqa-plugin-common
train
java
6df294ca3eb7d710e43de0cf6edb948f92e473a9
diff --git a/pyqode/python/modes/document_analyser.py b/pyqode/python/modes/document_analyser.py index <HASH>..<HASH> 100644 --- a/pyqode/python/modes/document_analyser.py +++ b/pyqode/python/modes/document_analyser.py @@ -134,7 +134,7 @@ class DocumentAnalyserMode(pyqode.core.Mode, QtCore.QObject): def _onStateChanged(self, state): if state: - self.editor.keyPressed.connect(self._onKeyPressed) + self.editor.blockCountChanged.connect(self._onLineCountChanged) self.editor.newTextSet.connect(self._runAnalysis) try: srv = pyqode.core.CodeCompletionMode.SERVER @@ -152,9 +152,8 @@ class DocumentAnalyserMode(pyqode.core.Mode, QtCore.QObject): except TypeError: pass - def _onKeyPressed(self, e): - if e.text(): - self._jobRunner.requestJob(self._runAnalysis, False) + def _onLineCountChanged(self, e): + self._jobRunner.requestJob(self._runAnalysis, False) def _runAnalysis(self): try:
DocumentAnalyser: Use line count changed signal Most of the structures changes are performed on new line
pyQode_pyqode.python
train
py
8d35fdc3d5b3292ab51b9543b092d499d4548cdd
diff --git a/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBDataProvider.java b/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBDataProvider.java index <HASH>..<HASH> 100644 --- a/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBDataProvider.java +++ b/database-provider/src/main/java/org/jboss/pressgang/ccms/provider/DBDataProvider.java @@ -40,7 +40,7 @@ public class DBDataProvider extends DataProvider { try { final T entity = getEntityManager().find(clazz, id); if (entity == null) { - throw new NotFoundException(); + throw new NotFoundException("Unable to find " + clazz.getSimpleName() + " with id " + id); } else { return entity; }
Added an error message for when entities can't be found.
pressgang-ccms_PressGangCCMSDatasourceProviders
train
java
924e374832b30e38546fb0f7cb9c1fd36aef4950
diff --git a/salt/config.py b/salt/config.py index <HASH>..<HASH> 100644 --- a/salt/config.py +++ b/salt/config.py @@ -362,10 +362,6 @@ def minion_config(path, return apply_minion_config(overrides, check_dns, defaults) -def get_ec2_public_ip(private_ip): - return None - - def get_id(): ''' Guess the id of the minion. @@ -405,15 +401,8 @@ def get_id(): if not a.is_private: return a, True - # What about asking for the EC2 public IP? These change with machine restarts, - # but it's still a little better than a non-routable IP. if ip_addresses: - try: - # let's go with the default timeout for this. - response = urllib2.urlopen('http://169.254.169.254/latest/meta-data/public-ipv4') - return response.read(), True - except Exception: - return ip_addresses.pop(0), True + return ip_addresses.pop(0), True return 'localhost', False
Strip out ec2 specific calls pending a better more generic solution
saltstack_salt
train
py
e3b5446010a5a30dfe1b7e1a680bf3790909e70f
diff --git a/symphony/assets/js/src/symphony.js b/symphony/assets/js/src/symphony.js index <HASH>..<HASH> 100644 --- a/symphony/assets/js/src/symphony.js +++ b/symphony/assets/js/src/symphony.js @@ -36,7 +36,8 @@ var Symphony = (function($, crossroads) { // Get localised strings function translate(strings) { - var namespace = $.trim(Symphony.Context.get('env')['page-namespace']), + var env = Symphony.Context.get('env'); + var namespace = evn && $.trim(env['page-namespace']), data = { 'strings': strings };
Fix error when no env found This was causing a javascript error in the server side error template. Ouf.
symphonycms_symphony-2
train
js
7ff8b2396fa0dc440e68f50be55bd4c2881ad217
diff --git a/sources/scalac/symtab/classfile/UnPickle.java b/sources/scalac/symtab/classfile/UnPickle.java index <HASH>..<HASH> 100644 --- a/sources/scalac/symtab/classfile/UnPickle.java +++ b/sources/scalac/symtab/classfile/UnPickle.java @@ -86,7 +86,7 @@ public class UnPickle implements Kinds, Modifiers, EntryTags, TypeTags { if (isSymbolEntry(i)) getSymbol(i); } if (global.debug) global.log("unpickled " + root + ":" + root.rawInfo());//debug - if (!root.isInitialized()) + if (!classroot.isInitialized() && !moduleroot.isInitialized()) throw new BadSignature(this, "it does not define " + root); // the isModule test is needed because moduleroot may become // the case class factory method of classroot
- Improved the condition for when the unpicklin... - Improved the condition for when the unpickling was successful, namely at least one of the symbols (the class or the module) should be initialized
scala_scala
train
java
7b89374dcebe1a534f95a70885e56ac81399da23
diff --git a/lib/vagrant/box_collection.rb b/lib/vagrant/box_collection.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/box_collection.rb +++ b/lib/vagrant/box_collection.rb @@ -276,7 +276,7 @@ module Vagrant next if !versiondir.directory? next if versiondir.basename.to_s.start_with?(".") - version = versiondir.basename.to_s + version = Gem::Version.new(versiondir.basename.to_s) end.compact # Traverse through versions with the latest version first @@ -286,7 +286,7 @@ module Vagrant next end - versiondir = box_directory.join(v) + versiondir = box_directory.join(v.to_s) providers.each do |provider| provider_dir = versiondir.join(provider.to_s) next if !provider_dir.directory?
Fix version sorting in box_collection.rb
hashicorp_vagrant
train
rb
be9bb3a57ff06a6253613686d3abab6e63fbbbc5
diff --git a/lib/renderables/modelView.js b/lib/renderables/modelView.js index <HASH>..<HASH> 100644 --- a/lib/renderables/modelView.js +++ b/lib/renderables/modelView.js @@ -34,9 +34,9 @@ module.exports = function(config) { }, componentWillReceiveProps: function(nextProps) { - var routeParamId = this.getParams()[this.routeParamKey]; + var routeIdAttribute = this.getParams()[this.routeIdAttribute]; if (nextProps.id !== this.props.id || - routeParamId && routeParamId !== this.model.getId()) { + routeIdAttribute && routeIdAttribute !== this.model.getId()) { this._initialize(); } }, @@ -50,9 +50,9 @@ module.exports = function(config) { _initialize: function() { // TODO: wtf - var routeParamId = this.getParams()[this.routeParamKey]; - if (routeParamId) { - this.props.id = routeParamId; + var routeIdAttribute = this.getParams()[this.routeIdAttribute]; + if (routeIdAttribute) { + this.props.id = routeIdAttribute; } var model = constructModel(this.props.model, this.props);
change routeParamKey -> routeIdAttribute to be in line with model idAttribute field (req by @funkytek)`
fissionjs_fission
train
js
e73b673e60920e07bcc9f0c7a312609d0b1f6e33
diff --git a/lib/esl/connection.js b/lib/esl/connection.js index <HASH>..<HASH> 100644 --- a/lib/esl/connection.js +++ b/lib/esl/connection.js @@ -654,10 +654,15 @@ Connection.prototype.originate = function(profile, gateway, number, app, sync, c }; //send a SIP MESSAGE -Connection.prototype.message = function(to, from, profile, body, cb) { +Connection.prototype.message = function(to, from, profile, body, subject, deliveryConfirmation, cb) { if(typeof subject === 'function') { cb = subject; subject = ''; + deliveryConfirmation = false; + } + else if(typeof deliveryConfirmation === 'function') { + cb = deliveryConfirmation; + deliveryConfirmation = false; } var event = new esl.Event('custom', 'SMS::SEND_MESSAGE'); @@ -670,7 +675,11 @@ Connection.prototype.message = function(to, from, profile, body, cb) { event.addHeader('to', to); event.addHeader('sip_profile', profile); - event.addHeader('subject', 'SIMPLE MESSAGE'); + event.addHeader('subject', subject); + + if( deliveryConfirmation) { + event.addHeader('blocking', 'true'); + } event.addHeader('type', 'text/plain'); event.addHeader('Content-Type', 'text/plain');
Fixed: missing subject argument in esl.Connection.message. Added: deliveryConfirmation argument in esl.Connection.message
englercj_node-esl
train
js
7e18574264e7b91ae576b770254dc06450fef609
diff --git a/lib/Requestify.js b/lib/Requestify.js index <HASH>..<HASH> 100644 --- a/lib/Requestify.js +++ b/lib/Requestify.js @@ -22,7 +22,7 @@ var Requestify = (function() { /** * Module API */ - api; + api; /** * Returns http|s instance according to the given protocol @@ -83,7 +83,7 @@ var Requestify = (function() { headers: request.getHeaders() }; - /** + /** * Handle request callback */ httpRequest = http.request(options, function(res) { @@ -151,7 +151,7 @@ var Requestify = (function() { } defer.resolve(new Response(data.code, data.headers, data.body)); - }) + }) .fail(function() { call(request, defer); } @@ -203,6 +203,13 @@ var Requestify = (function() { }, /** + * Module core trasporters + */ + coreCacheTransporters: [ + redisTransporter + ], + + /** * Set cache transporter * @param {{ get: function, set: function, purge: function }} cacheTransporter */
Added core transporters array to public API
ranm8_requestify
train
js
6af37d855f690ceee1fc6595bd66b2d95898c641
diff --git a/src/Tools/StrawberryfieldJsonHelper.php b/src/Tools/StrawberryfieldJsonHelper.php index <HASH>..<HASH> 100644 --- a/src/Tools/StrawberryfieldJsonHelper.php +++ b/src/Tools/StrawberryfieldJsonHelper.php @@ -324,7 +324,7 @@ class StrawberryfieldJsonHelper { /** - * Array helper that checks if an array is associative or not + * Array helper that checks if an array is associative or not. * * @param array $sourcearray * @@ -336,6 +336,27 @@ class StrawberryfieldJsonHelper { } /** + * Array helper that checks if an array is associative with URN/URI keys. + * + * + * @param array $sourcearray + * + * @return bool + * TRUE if is associative and each key is an URI. Useful for detecging Object + * JSON type of Arrays with no repeating patterns like we use for + * as:images, etc + */ + public static function arrayIsMultiURIkeys(array $sourcearray = []) { + $keys = array_keys($sourcearray); + $keys_URIS = array_filter($keys, function ($value) { + if (filter_var($value, FILTER_VALIDATE_URL) || static::validateURN($value)) { + return TRUE; + } + }); + return (count($keys) > 0 && (count($keys) == count($keys_URIS))); + } + + /** * Another array helper that checks if an array is associative or not * * This is faster for large arrays than ::arrayIsMultiSimple()
New little thing to check if an array is array of URNs... cool
esmero_strawberryfield
train
php
576733fa59b383d0fdbff2163d03022bafc16670
diff --git a/salt/netapi/__init__.py b/salt/netapi/__init__.py index <HASH>..<HASH> 100644 --- a/salt/netapi/__init__.py +++ b/salt/netapi/__init__.py @@ -107,6 +107,17 @@ class NetapiClient(object): local = salt.client.get_local_client(mopts=self.opts) return local.cmd_batch(*args, **kwargs) + def local_subset(self, *args, **kwargs): + ''' + Run :ref:`execution modules <all-salt.modules>` against subsets of minions + + .. versionadded:: Boron + + Wraps :py:meth:`salt.client.LocalClient.cmd_subset` + ''' + local = salt.client.get_local_client(mopts=self.opts) + return local.cmd_subset(*args, **kwargs) + def ssh(self, *args, **kwargs): ''' Run salt-ssh commands synchronously
Add new netapi client that wraps LocalClient.cmd_subset
saltstack_salt
train
py
b90af4dae5b9ff37ab14351a55006a6a71cfdb98
diff --git a/python/ray/serve/tests/test_backend_state.py b/python/ray/serve/tests/test_backend_state.py index <HASH>..<HASH> 100644 --- a/python/ray/serve/tests/test_backend_state.py +++ b/python/ray/serve/tests/test_backend_state.py @@ -1,3 +1,4 @@ +import os import time from typing import Any, Dict, List, Optional, Tuple from unittest.mock import patch, Mock @@ -1859,6 +1860,7 @@ def mock_backend_state_manager( yield backend_state_manager, timer, goal_manager # Clear checkpoint at the end of each test kv_store.delete(CHECKPOINT_KEY) + os.remove("test_kv_store.db") def test_shutdown(mock_backend_state_manager):
[serve] Delete kv store local path after unit tests (#<I>)
ray-project_ray
train
py
a15cecd5234dee0a681c8fa8b2c81e0ed88b1f56
diff --git a/sundial/__init__.py b/sundial/__init__.py index <HASH>..<HASH> 100644 --- a/sundial/__init__.py +++ b/sundial/__init__.py @@ -5,6 +5,6 @@ from django.utils import version __all__ = ['VERSION', '__version__'] -VERSION = (1, 0, 3, 'final', 0) +VERSION = (1, 0, 4, 'alpha', 0) __version__ = version.get_version(VERSION)
Started <I> alpha development.
charettes_django-sundial
train
py
aae75fe0cf552078cae329313493840aff67c5fb
diff --git a/lib/pavlov/helpers.rb b/lib/pavlov/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/pavlov/helpers.rb +++ b/lib/pavlov/helpers.rb @@ -7,12 +7,12 @@ module Pavlov def query name, *args args = add_pavlov_options args - Pavlov.query name, *args, pavlov_options + Pavlov.query name, *args end def command name, *args args = add_pavlov_options args - Pavlov.command name, *args, pavlov_options + Pavlov.command name, *args end def pavlov_options
Bugfix Was giving double arguments to the queries and commands
Factlink_pavlov
train
rb
4a71a2d6651a8baa01bdffebc39d0bdc2b74c859
diff --git a/bin/codemods/src/config.js b/bin/codemods/src/config.js index <HASH>..<HASH> 100644 --- a/bin/codemods/src/config.js +++ b/bin/codemods/src/config.js @@ -13,6 +13,11 @@ const recastOptions = { objectCurlySpacing: true, quote: 'single', useTabs: true, + trailingComma: { + objects: true, + arrays: true, + parameters: false, + } }; const commonArgs = { '5to6': [
Update recast options for codemods to add trailing commas (#<I>)
Automattic_wp-calypso
train
js
641ac21a8d8b71f98e6c9651fd13b482f37a37d9
diff --git a/intranet/urls.py b/intranet/urls.py index <HASH>..<HASH> 100644 --- a/intranet/urls.py +++ b/intranet/urls.py @@ -18,7 +18,8 @@ urlpatterns = patterns("", url(r"^api/", include("intranet.apps.api.urls"), name="api_root"), url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")), ) -if settings.SHOW_DEBUG_TOOLAR: + +if settings.SHOW_DEBUG_TOOLBAR: import debug_toolbar urlpatterns += patterns("",
Fix typo in urls.py
tjcsl_ion
train
py
08999c56185951879a22da7948d7a264506b9b84
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,9 @@ var PORT_NOT_OPEN_ERRNO = "ECONNREFUSED"; var BAD_ADDRESS_MESSAGE = "Bad Client Address"; var BAD_ADDRESS_ERRNO = "ECONNREFUSED"; +var TRANSACTION_TIMED_OUT_MESSAGE = "Timed out"; +var TRANSACTION_TIMED_OUT_ERRNO = "ETIMEDOUT"; + var PortNotOpenError = function() { Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; @@ -41,6 +44,12 @@ var BadAddressError = function() { this.errno = BAD_ADDRESS_ERRNO; }; +var TransactionTimedOutError = function() { + this.name = this.constructor.name; + this.message = TRANSACTION_TIMED_OUT_MESSAGE; + this.errno = TRANSACTION_TIMED_OUT_ERRNO; +}; + /** * @fileoverview ModbusRTU module, exports the ModbusRTU class. * this class makes ModbusRTU calls fun and easy. @@ -169,7 +178,7 @@ function _startTimeout(duration, transaction) { return setTimeout(function() { transaction._timeoutFired = true; if (transaction.next) { - transaction.next(new Error("Timed out")); + transaction.next(new TransactionTimedOutError()); } }, duration); }
Fixes #<I> Added object for ETIMEDOUT
yaacov_node-modbus-serial
train
js
bc796f41a94e1b11afbb37c2139fdcfa15350bcd
diff --git a/src/remoteStorage.js b/src/remoteStorage.js index <HASH>..<HASH> 100644 --- a/src/remoteStorage.js +++ b/src/remoteStorage.js @@ -217,9 +217,12 @@ define([ // claim - permission to claim, either *r* (read-only) or *rw* (read-write) // // Example: - // > remoteStorage.claimAccess('contacts', 'r'); + // > remoteStorage.claimAccess('contacts', 'r').then(remoteStorage.displayWidget).then(initApp); // + // Returns: + // a Promise, fulfilled when the access has been claimed. // + // FIXME: this method is currently asynchronous due to internal design issues, but it doesn't need to be. // // Method: claimAccess(moduleClaimMap) // @@ -233,7 +236,12 @@ define([ // > contacts: 'r', // > documents: 'rw', // > money: 'r' - // > }); + // > }).then(remoteStorage.displayWidget).then(initApp); + // + // Returns: + // a Promise, fulfilled when the access has been claimed. + // + // FIXME: this method is currently asynchronous due to internal design issues, but it doesn't need to be. // claimAccess: function(moduleName, mode) {
remoteStorage doc: mention promises for claimAccess, updated examples to illustrate, added FIXME notice
remotestorage_remotestorage.js
train
js
78bf554eb2306b87abc426aa6e6c5e95975af3b2
diff --git a/src/mouse.js b/src/mouse.js index <HASH>..<HASH> 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -27,7 +27,11 @@ Snap.plugin(function (Snap, Element, Paper, glob) { }, getScroll = function (xy) { var name = xy == "y" ? "scrollTop" : "scrollLeft"; - return glob.doc.documentElement[name] || glob.doc.body[name]; + if (name in glob.doc.documentElement) { + return glob.doc.documentElement[name]; + } else { + return glob.doc.body[name]; + } }, preventDefault = function () { this.returnValue = false;
Correctly check for undefined in getScroll. Fixes #<I>
adobe-webplatform_Snap.svg
train
js
4823f2438ab435375c9f2b037311bfeb7cf46441
diff --git a/bindings/l20n/webl10n.js b/bindings/l20n/webl10n.js index <HASH>..<HASH> 100644 --- a/bindings/l20n/webl10n.js +++ b/bindings/l20n/webl10n.js @@ -47,12 +47,15 @@ define(function (require, exports, module) { function webL10nBridge() { if (!navigator.mozL10n) { navigator.mozL10n = { - get: function(id) { + get: function(id, args) { + // it would be better to use context here + // to deal with fallbacks and imitate client side l10n var entry = locales[curLocale].getEntry(id); if (!entry) { return null; } - return entry.get().value; + var val = entry.get(args); + return val.value; }, localize: function() {}, language: {
add args support to API/compiler
l20n_l20n.js
train
js
6609f8c4fee54ac3ce71f64e73552c3025cc2472
diff --git a/src/cosmic_ray/commands/new_config.py b/src/cosmic_ray/commands/new_config.py index <HASH>..<HASH> 100644 --- a/src/cosmic_ray/commands/new_config.py +++ b/src/cosmic_ray/commands/new_config.py @@ -95,6 +95,7 @@ def new_config(): config['interceptors'] = ConfigDict() config['interceptors']['enabled'] = ['spor', 'pragma_no_mutate', 'operators-filter'] + config['operators-filter'] = ConfigDict() config['operators-filter']['exclude-operators'] = [] return config
Fixes operators-filter issue in new-config. We weren't properly creating the config tree.
sixty-north_cosmic-ray
train
py
5d4ef399f79a7ba16e1c6fbc8157940fc33b5efe
diff --git a/src/main/java/com/aoindustries/servlet/filter/NotFoundFilter.java b/src/main/java/com/aoindustries/servlet/filter/NotFoundFilter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/aoindustries/servlet/filter/NotFoundFilter.java +++ b/src/main/java/com/aoindustries/servlet/filter/NotFoundFilter.java @@ -1,6 +1,6 @@ /* * ao-servlet-filter - Reusable Java library of servlet filters. - * Copyright (C) 2013, 2015, 2016 AO Industries, Inc. + * Copyright (C) 2013, 2015, 2016, 2017 AO Industries, Inc. * [email protected] * 7262 Bull Pen Cir * Mobile, AL 36695 @@ -46,7 +46,7 @@ import javax.servlet.http.HttpServletResponse; * </p> * <pre> * Init Parameters: - * patterns Commas-separated list of patterns (default to *) + * patterns Comma/space-separated list of patterns (default to *) * </pre> * * @see WildcardPatternMatcher for supported patterns
Clarified that is comma/space separated list of patterns.
aoindustries_ao-servlet-filter
train
java
77e1ca1e3099cafa3c72f681d5911b50b470c437
diff --git a/stagpy/parfile.py b/stagpy/parfile.py index <HASH>..<HASH> 100644 --- a/stagpy/parfile.py +++ b/stagpy/parfile.py @@ -607,13 +607,13 @@ PAR_DEFAULT = { def _write_default(): """create default par file""" if not PAR_DFLT_FILE.is_file(): - f90nml.write(PAR_DEFAULT, PAR_DFLT_FILE) + f90nml.write(PAR_DEFAULT, str(PAR_DFLT_FILE)) def _read_default(): """read default par file""" _write_default() - return f90nml.read(PAR_DFLT_FILE) + return f90nml.read(str(PAR_DFLT_FILE)) def readpar(path):
Convert PAR_DFLT_FILE to str for f<I>nml
StagPython_StagPy
train
py
ac9fd648d32dc5bf45518b8f88a74fe5ec39ee14
diff --git a/pkg/runtime/swagger_doc_generator.go b/pkg/runtime/swagger_doc_generator.go index <HASH>..<HASH> 100644 --- a/pkg/runtime/swagger_doc_generator.go +++ b/pkg/runtime/swagger_doc_generator.go @@ -65,11 +65,14 @@ func fmtRawDoc(rawDoc string) string { for _, line := range strings.Split(rawDoc, "\n") { line = strings.TrimRight(line, " ") - - if line == "" { // Keep paragraphs + leading := strings.TrimLeft(line, " ") + switch { + case len(line) == 0: // Keep paragraphs delPrevChar() buffer.WriteString("\n\n") - } else if !strings.HasPrefix(strings.TrimLeft(line, " "), "TODO") { // Ignore one line TODOs + case strings.HasPrefix(leading, "TODO"): // Ignore one line TODOs + case strings.HasPrefix(leading, "+"): // Ignore instructions to go2idl + default: if strings.HasPrefix(line, " ") || strings.HasPrefix(line, "\t") { delPrevChar() line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..."
Strip go2idl instructions from generated swagger doc Ignore doc lines starting with +
kubernetes_kubernetes
train
go
0b0c78efce8e2acae841d928138b56edd3f11f81
diff --git a/server/src/main/java/org/jboss/as/server/services/net/NetworkInterfaceService.java b/server/src/main/java/org/jboss/as/server/services/net/NetworkInterfaceService.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/jboss/as/server/services/net/NetworkInterfaceService.java +++ b/server/src/main/java/org/jboss/as/server/services/net/NetworkInterfaceService.java @@ -110,7 +110,7 @@ public class NetworkInterfaceService implements Service<NetworkInterfaceBinding> // Begin check for -b information (AS7-1668) String argBinding = ServerEnvironment.getNetworkBinding(name); - log.infof("The argument binding for logical interface %s is %s\n", name, argBinding); + log.debugf("The argument binding for logical interface %s is %s\n", name, argBinding); if (argBinding != null && !argBinding.trim().isEmpty()) { InetAddress address = InetAddress.getByName(argBinding); if (address.isAnyLocalAddress()) {
made arg binding log statement debug level
wildfly_wildfly
train
java
e55a1748e9c75c365d95bc9046a561fe667cbff8
diff --git a/contribs/gmf/src/controllers/AbstractDesktopController.js b/contribs/gmf/src/controllers/AbstractDesktopController.js index <HASH>..<HASH> 100644 --- a/contribs/gmf/src/controllers/AbstractDesktopController.js +++ b/contribs/gmf/src/controllers/AbstractDesktopController.js @@ -111,7 +111,7 @@ export class AbstractDesktopController extends AbstractAPIController { // deactivate tooltips on touch device body.on('touchstart.detectTouch', () => { - body.tooltip('destroy'); + body.tooltip('dispose'); body.off('touchstart.detectTouch'); }); diff --git a/src/message/popoverComponent.js b/src/message/popoverComponent.js index <HASH>..<HASH> 100644 --- a/src/message/popoverComponent.js +++ b/src/message/popoverComponent.js @@ -53,7 +53,7 @@ function component() { } scope.$on('$destroy', () => { - ngeoPopoverCtrl.anchorElm.popover('destroy'); + ngeoPopoverCtrl.anchorElm.popover('dispose'); ngeoPopoverCtrl.anchorElm.unbind('inserted.bs.popover'); ngeoPopoverCtrl.anchorElm.unbind('hidden.bs.popover'); });
Call dispose on tooltips and popovers The name was changed between version 3 and 4: <URL>
camptocamp_ngeo
train
js,js
c7486f816975676c9ab2ed4bdd1e3503e55a8357
diff --git a/lib/jitsu.js b/lib/jitsu.js index <HASH>..<HASH> 100644 --- a/lib/jitsu.js +++ b/lib/jitsu.js @@ -113,7 +113,7 @@ jitsu.welcome = function () { // var username = jitsu.config.get('username') || ''; jitsu.log.info('Welcome to ' + 'Nodejitsu'.grey + ' ' + username.magenta); - jitsu.log.info('jitsu v' + jitsu.version); + jitsu.log.info('jitsu v' + jitsu.version + ', node ' + process.version); jitsu.log.info('It worked if it ends with ' + 'Nodejitsu'.grey + ' ok'.green.bold); };
[ui] Display node version
nodejitsu_jitsu
train
js
040f41166c4e660b52c76b951584b01dcd6a6e99
diff --git a/src/Subfission/Cas/Middleware/RedirectCASAuthenticated.php b/src/Subfission/Cas/Middleware/RedirectCASAuthenticated.php index <HASH>..<HASH> 100644 --- a/src/Subfission/Cas/Middleware/RedirectCASAuthenticated.php +++ b/src/Subfission/Cas/Middleware/RedirectCASAuthenticated.php @@ -25,9 +25,9 @@ class RedirectCASAuthenticated { { if($this->cas->isAuthenticated()) { - return redirect(config('redirect_path', 'home')); + return redirect(config('cas.cas_redirect_path')); } return $next($request); } -} \ No newline at end of file +}
Typo in cas_redirect_path variable Also, removed default redirect override to "home" so default installs don't break on update.
subfission_cas
train
php
53f25ae348f7fdcae27c3d89369738f1e8b455d9
diff --git a/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb b/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb index <HASH>..<HASH> 100644 --- a/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb +++ b/actionview/lib/action_view/helpers/sanitize_helper/scrubbers.rb @@ -42,7 +42,6 @@ # See the documentation for Nokogiri::XML::Node to understand what's possible # with nodes: http://nokogiri.org/Nokogiri/XML/Node.html class PermitScrubber < Loofah::Scrubber - # :nodoc: attr_reader :tags, :attributes def initialize
Removed :nodoc: from PermitScrubber.
rails_rails
train
rb
a470664644994d4cc68a83714a06f53065c4896f
diff --git a/tests/agent_test.py b/tests/agent_test.py index <HASH>..<HASH> 100644 --- a/tests/agent_test.py +++ b/tests/agent_test.py @@ -27,7 +27,7 @@ class Agent_tests(unittest.TestCase): def test_test_echo(self): ''' test get_user_id_by_email ''' # register response - httpretty.register_uri(httpretty.GET, "http://fake.pod/agent/v1/util/echo", + httpretty.register_uri(httpretty.POST, "http://fake.pod/agent/v1/util/echo", body='{"message": "test string"}', status=200, content_type='text/json') @@ -41,7 +41,7 @@ class Agent_tests(unittest.TestCase): response = json.loads(response) # verify return assert status_code == 200 - # assert response['message'] == "test string" + assert response['message'] == "test string" @httpretty.activate def test_create_datafeed(self):
errm... yeah that is a POST method.
symphonyoss_python-symphony
train
py
194321289fad86b82a19071a793ac3ff7a216610
diff --git a/will/backends/pubsub/redis_pubsub.py b/will/backends/pubsub/redis_pubsub.py index <HASH>..<HASH> 100644 --- a/will/backends/pubsub/redis_pubsub.py +++ b/will/backends/pubsub/redis_pubsub.py @@ -24,7 +24,7 @@ class RedisPubSub(BasePubSub): db = url.path[1:] else: db = 0 - max_connections = getattr(settings, 'REDIS_MAX_CONNECTIONS', None) + max_connections = int(getattr(settings, 'REDIS_MAX_CONNECTIONS', None)) connection_pool = redis.ConnectionPool( max_connections=max_connections, host=url.hostname, port=url.port, db=db, password=url.password diff --git a/will/storage/redis_storage.py b/will/storage/redis_storage.py index <HASH>..<HASH> 100644 --- a/will/storage/redis_storage.py +++ b/will/storage/redis_storage.py @@ -20,7 +20,7 @@ class RedisStorage(object): db = url.path[1:] else: db = 0 - max_connections = getattr(settings, 'REDIS_MAX_CONNECTIONS', None) + max_connections = int(getattr(settings, 'REDIS_MAX_CONNECTIONS', None)) connection_pool = redis.ConnectionPool( max_connections=max_connections, host=url.hostname, port=url.port, db=db, password=url.password
if REDIS_MAX_CONNECTIONS set via env var this was generating an error
skoczen_will
train
py,py
7ff29ed2f2286e7f9a7c8ee8c6fe9609264443a9
diff --git a/src/Knp/ETL/Transformer/CallbackTransformer.php b/src/Knp/ETL/Transformer/CallbackTransformer.php index <HASH>..<HASH> 100644 --- a/src/Knp/ETL/Transformer/CallbackTransformer.php +++ b/src/Knp/ETL/Transformer/CallbackTransformer.php @@ -16,8 +16,6 @@ class CallbackTransformer implements TransformerInterface public function transform($data, ContextInterface $context) { - $target = $context->getTransformedData(); - - return call_user_func($this->callback, $data, $target); + return call_user_func($this->callback, $data, $context); } } \ No newline at end of file
[Transformer] Be more flexible by passing directly the whole context instead of only target
docteurklein_php-etl
train
php
c4d266f2f988ea8f55a5a500eb13dac1bb8d9c95
diff --git a/azure-storage-common/src/Common/Exceptions/ServiceException.php b/azure-storage-common/src/Common/Exceptions/ServiceException.php index <HASH>..<HASH> 100644 --- a/azure-storage-common/src/Common/Exceptions/ServiceException.php +++ b/azure-storage-common/src/Common/Exceptions/ServiceException.php @@ -168,7 +168,7 @@ class ServiceException extends \LogicException /** * Gets the response of the failue. * - * @return string + * @return ResponseInterface */ public function getResponse() {
Fix type hint for ServiceException::getResponse() Returned type is actually `ResponseInterface` and not a `string`
Azure_azure-storage-php
train
php
54daafa797a1e88e0f7bd8a28f4c719d105e8715
diff --git a/src/AppBuilder.php b/src/AppBuilder.php index <HASH>..<HASH> 100644 --- a/src/AppBuilder.php +++ b/src/AppBuilder.php @@ -357,7 +357,7 @@ final class AppBuilder { $info->cacheProvider = $config['cacheProvider']; $info->request = new HttpRequest(); $info->response = new HttpResponse(); - $info->session = $config['sessionProvider']; + $info->session = isset($config['sessionProvider']) ? $config['sessionProvider'] : null; $config['httpContext'] = new HttpContext($info); } @@ -1009,7 +1009,7 @@ final class AppBuilder { // create view $viewContext = InternalHelper::makeViewContext( - PHPMVC_CURRENT_VIEW_PATH, + (!empty($actionResult->viewFile) ? $actionResult->viewFile : PHPMVC_CURRENT_VIEW_PATH), $actionContext, $actionResult, null,
Fixed bug with missing sessionProvider in configuration.
php-mvc-project_php-mvc
train
php
b98aa3b4f169b1210e187d1ba6c402d052ad70c5
diff --git a/whisper/whisperv2/whisper.go b/whisper/whisperv2/whisper.go index <HASH>..<HASH> 100644 --- a/whisper/whisperv2/whisper.go +++ b/whisper/whisperv2/whisper.go @@ -262,7 +262,7 @@ func (self *Whisper) add(envelope *Envelope) error { // Insert the message into the tracked pool hash := envelope.Hash() if _, ok := self.messages[hash]; ok { - log.Trace(fmt.Sprintf("whisper envelope already cached: %x\n", envelope)) + log.Trace(fmt.Sprintf("whisper envelope already cached: %x\n", hash)) return nil } self.messages[hash] = envelope @@ -277,7 +277,7 @@ func (self *Whisper) add(envelope *Envelope) error { // Notify the local node of a message arrival go self.postEvent(envelope) } - log.Trace(fmt.Sprintf("cached whisper envelope %x\n", envelope)) + log.Trace(fmt.Sprintf("cached whisper envelope %x\n", hash)) return nil }
whisper/whisper2: fix Go <I> vet issues on type mismatches (#<I>)
ethereum_go-ethereum
train
go
2c9a1b984af085add5b1b822677a5414e9933cd8
diff --git a/mautrix/appservice/appservice.py b/mautrix/appservice/appservice.py index <HASH>..<HASH> 100644 --- a/mautrix/appservice/appservice.py +++ b/mautrix/appservice/appservice.py @@ -5,7 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Partly based on github.com/Cadair/python-appservice-framework (MIT license) from typing import Optional, Callable, Awaitable, Union, Iterator, List, Dict -from contextlib import contextmanager +from contextlib import asynccontextmanager from aiohttp import web import aiohttp import asyncio @@ -105,8 +105,8 @@ class AppService: else: return self._intent - @contextmanager - def run(self, host: str = "127.0.0.1", port: int = 8080) -> Iterator[asyncio.AbstractServer]: + @asynccontextmanager + async def run(self, host: str = "127.0.0.1", port: int = 8080) -> Iterator[asyncio.AbstractServer]: connector = None if self.server.startswith("https://") and not self.verify_ssl: connector = aiohttp.TCPConnector(verify_ssl=False) @@ -119,7 +119,7 @@ class AppService: yield self.loop.create_server(self.app.make_handler(), host, port) self._intent = None - self._http_session.close() + await self._http_session.close() self._http_session = None def _check_token(self, request: web.Request) -> bool:
Fix error about ClientSession.close not being awaited
tulir_mautrix-python
train
py
9d034031a84342d159af6547d6b1d21da4f4114b
diff --git a/Lib/fontbakery/specifications/general.py b/Lib/fontbakery/specifications/general.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/general.py +++ b/Lib/fontbakery/specifications/general.py @@ -2,6 +2,7 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) import os +from fontbakery.callable import check, condition from fontbakery.checkrunner import ERROR, FAIL, INFO, PASS, SKIP, WARN from fontbakery.constants import CRITICAL from fontbakery.message import Message
I deleted an import statement by mistake, sorry!
googlefonts_fontbakery
train
py
8116b01e766e4619d5af62a7dde33032e32d794c
diff --git a/lib/paho_mqtt/subscriber.rb b/lib/paho_mqtt/subscriber.rb index <HASH>..<HASH> 100644 --- a/lib/paho_mqtt/subscriber.rb +++ b/lib/paho_mqtt/subscriber.rb @@ -61,12 +61,12 @@ module PahoMqtt adjust_qos.delete(t) else - @logger.error("The QoS value is invalid in subscribe.") if PahoMqtt.logger? + PahoMqtt.logger.error("The QoS value is invalid in subscribe.") if PahoMqtt.logger? raise PacketException end end else - @logger.error("The packet id is invalid, already used.") if PahoMqtt.logger? + PahoMqtt.logger.error("The packet id is invalid, already used.") if PahoMqtt.logger? raise PacketException end @subscribed_mutex.synchronize do @@ -83,7 +83,7 @@ module PahoMqtt if to_unsub.length == 1 to_unsub = to_unsub.first[:packet].topics else - @logger.error("The packet id is invalid, already used.") if PahoMqtt.logger? + PahoMqtt.logger.error("The packet id is invalid, already used.") if PahoMqtt.logger? raise PacketException end
fix reference to global logger in subscriber class
RubyDevInc_paho.mqtt.ruby
train
rb
faf9ce0c3130ab590756caddb2751313828d9d6d
diff --git a/jacquard/translate.py b/jacquard/translate.py index <HASH>..<HASH> 100644 --- a/jacquard/translate.py +++ b/jacquard/translate.py @@ -173,9 +173,8 @@ def _claim_readers(args): return factory.claim(file_readers) def _log_unclaimed_readers(unclaimed_readers): - sorted_readers = sorted(unclaimed_readers) unclaimed_log_message = "The input file [{}] will not be translated" - for reader in sorted_readers: + for reader in sorted(unclaimed_readers): msg = unclaimed_log_message.format(reader.file_name) logger.warning(msg)
(jebene) attempt to make travis pass
umich-brcf-bioinf_Jacquard
train
py
876344549b222f32df737a091555ea148ba79645
diff --git a/nodeconductor/structure/tests/test_project.py b/nodeconductor/structure/tests/test_project.py index <HASH>..<HASH> 100644 --- a/nodeconductor/structure/tests/test_project.py +++ b/nodeconductor/structure/tests/test_project.py @@ -220,10 +220,13 @@ class ProjectCreateUpdateDeleteTest(test.APITransactionTestCase): self.client.force_authenticate(self.group_manager) data = _get_valid_project_payload(factories.ProjectFactory.create(customer=self.customer)) + data['name'] = 'unique project name' data['project_groups'] = [factories.ProjectGroupFactory.get_url(self.project_group)] response = self.client.post(factories.ProjectFactory.get_list_url(), data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertTrue(Project.objects.filter(name=data['name']).exists()) + self.assertItemsEqual( + Project.objects.get(name=data['name']).project_groups.all(), [self.project_group]) def test_group_manager_cannot_create_project_belonging_to_project_group_he_doesnt_manage(self): self.client.force_authenticate(self.group_manager)
test that project is created with given groups (nc-<I>)
opennode_waldur-core
train
py
9c09b0f9413ed85d01355af3e9fbd5257354bf0a
diff --git a/views/v3/partials/post/post-grid.blade.php b/views/v3/partials/post/post-grid.blade.php index <HASH>..<HASH> 100644 --- a/views/v3/partials/post/post-grid.blade.php +++ b/views/v3/partials/post/post-grid.blade.php @@ -5,7 +5,7 @@ @block([ 'link' => $post->permalink, 'heading' => $post->postTitle, - 'ratio' => $archiveProps->format == 'tall' ? '12:16' : '4:3', + 'ratio' => $archiveProps->format == 'tall' ? '12:16' : '1:1', 'meta' => $post->termsunlinked, 'filled' => true, 'image' => [
Use 1:1 ratio for square grids.
helsingborg-stad_Municipio
train
php
c8f72ca6d78da1e3d4ee2cc1467ce9a375af7117
diff --git a/lib/komenda/process.rb b/lib/komenda/process.rb index <HASH>..<HASH> 100644 --- a/lib/komenda/process.rb +++ b/lib/komenda/process.rb @@ -74,19 +74,19 @@ module Komenda # @param [ProcessBuilder] process_builder def run_process(process_builder) - if process_builder.cwd.nil? - run_popen3(process_builder) - else - Dir.chdir(process_builder.cwd) { run_popen3(process_builder) } - end + opts = {} + opts[:chdir] = process_builder.cwd unless process_builder.cwd.nil? + run_popen3(process_builder.env, process_builder.command, opts) rescue Exception => exception emit(:error, exception) raise exception end - # @param [ProcessBuilder] process_builder - def run_popen3(process_builder) - Open3.popen3(process_builder.env, *process_builder.command) do |stdin, stdout, stderr, wait_thr| + # @param [Hash] env + # @param [Array<String>] command + # @param [Hash] opts + def run_popen3(env, command, opts) + Open3.popen3(env, *command, opts) do |stdin, stdout, stderr, wait_thr| @pid = wait_thr.pid stdin.close read_streams([stdout, stderr]) do |data, stream|
Use Process.spawn "opts" for chdir
chocolateboy_komenda
train
rb
63b46aea679765a563b4e33386df2a4f2355a7cc
diff --git a/examples/hello_world.py b/examples/hello_world.py index <HASH>..<HASH> 100644 --- a/examples/hello_world.py +++ b/examples/hello_world.py @@ -17,18 +17,18 @@ def main(): # connect to pod try: agent, pod, symphony_sid = conn.connect() - print 'connected: %s' % symphony_sid - except: - print 'failed to connect!' + print ('connected: %s' % (symphony_sid)) + except Exception as err: + print ('failed to connect!: %s' % (err)) # main loop msgFormat = 'MESSAGEML' message = '<messageML> hello world. </messageML>' # send message try: status_code, retstring = agent.send_message(symphony_sid, msgFormat, message) - print "%s: %s" % (status_code, retstring) - except: - print(retstring) + print ("%s: %s" % (status_code, retstring)) + except Exception as err: + print(retstring, err) if __name__ == "__main__":
fix some more bad prints and some bad exceptions
symphonyoss_python-symphony-binding
train
py
3d61474b5da2ab4b7d33e8435a0c5a601a18ed33
diff --git a/build.go b/build.go index <HASH>..<HASH> 100644 --- a/build.go +++ b/build.go @@ -49,6 +49,10 @@ func BuildPackages(pkgs ...*Package) (*Action, error) { } for _, pkg := range pkgs { + if len(pkg.GoFiles)+len(pkg.Cgofiles) == 0 { + Debugf("skipping %v: no go files", pkg.ImportPath) + continue + } a, err := BuildPackage(targets, pkg) if err != nil { return nil, err @@ -122,7 +126,7 @@ func Compile(pkg *Package, deps ...*Action) (*Action, error) { if len(gofiles) == 0 { return nil, fmt.Errorf("compile %q: no go files supplied", pkg.ImportPath) } - + // step 2. compile all the go files for this package, including pkg.CgoFiles compile := Action{ Name: fmt.Sprintf("compile: %s", pkg.ImportPath),
Skip a package if it contains no Go files
constabulary_gb
train
go
b72040d76099219815da26916bbd648ba5644748
diff --git a/tilequeue/tile.py b/tilequeue/tile.py index <HASH>..<HASH> 100644 --- a/tilequeue/tile.py +++ b/tilequeue/tile.py @@ -267,8 +267,8 @@ def coord_children_range(coord, zoom_until): def tolerance_for_zoom(zoom): - assert zoom >= 0 and zoom <= 20 - tolerance = tolerances[zoom] + tol_idx = zoom if 0 <= zoom < len(tolerances) else -1 + tolerance = tolerances[tol_idx] return tolerance
Update tolerance zoom lookup Add support for zooms that are greater than <I>.
tilezen_tilequeue
train
py
b5531ba3de1cf0c49793cb52b8689745aa3937f4
diff --git a/lib/core/plugin/node.rb b/lib/core/plugin/node.rb index <HASH>..<HASH> 100644 --- a/lib/core/plugin/node.rb +++ b/lib/core/plugin/node.rb @@ -919,7 +919,6 @@ class Node < Nucleon.plugin_class(:nucleon, :base) codes :network_load_error config = Config.ensure(options).defaults({ - :log_level => Nucleon.log_level, :net_remote => :edit, :net_provider => network.plugin_provider }) @@ -929,7 +928,7 @@ class Node < Nucleon.plugin_class(:nucleon, :base) encoded_config = Util::CLI.encode(Util::Data.clean(config.export)) action_config = extended_config(:action, { :command => provider.to_s.gsub('_', ' '), - :data => { :encoded => encoded_config } + :data => { :log_level => Nucleon.log_level, :encoded => encoded_config } }) quiet = config.get(:quiet, false)
Separating the log_level option from the encoded args in the base node plugin action method.
coralnexus_corl
train
rb
06ad2ed0af91076cc1271f5e9cc3679a2165d6ec
diff --git a/splinter/cookie_manager.py b/splinter/cookie_manager.py index <HASH>..<HASH> 100644 --- a/splinter/cookie_manager.py +++ b/splinter/cookie_manager.py @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +from splinter.meta import InheritedDocs + class CookieManagerAPI(object): """ An API that specifies how a splinter driver deals with cookies. @@ -12,6 +15,7 @@ class CookieManagerAPI(object): >>> cookie_manager.add({ 'name' : 'Tony' }) >>> assert cookie_manager['name'] == 'Tony' """ + __metaclass__ = InheritedDocs def add(self, cookies): """
Inhritance on cookies docs
cobrateam_splinter
train
py
bd6eef4b6a4098775d1e1838bc093e8b469ef4e0
diff --git a/lib/appraisal/cli.rb b/lib/appraisal/cli.rb index <HASH>..<HASH> 100644 --- a/lib/appraisal/cli.rb +++ b/lib/appraisal/cli.rb @@ -36,8 +36,9 @@ module Appraisal end desc 'install', 'Resolve and install dependencies for each appraisal' - method_option 'jobs', aliases: 'j', type: :numeric, default: 1, banner: 'SIZE', - desc: 'Install gems in parallel using the given number of workers.' + method_option 'jobs', :aliases => 'j', :type => :numeric, :default => 1, + :banner => 'SIZE', + :desc => 'Install gems in parallel using the given number of workers.' def install invoke :generate, [], {}
Updating CLI for MRI <I> friendliness
thoughtbot_appraisal
train
rb
a1697b6d4b8ecf6dacf9594700e2554f0a9a88af
diff --git a/lib/coverband/integrations/resque.rb b/lib/coverband/integrations/resque.rb index <HASH>..<HASH> 100644 --- a/lib/coverband/integrations/resque.rb +++ b/lib/coverband/integrations/resque.rb @@ -2,9 +2,11 @@ Resque.after_fork do |job| Coverband.start + Coverband.runtime_coverage! end Resque.before_first_fork do + Coverband.eager_loading_coverage! Coverband.configuration.background_reporting_enabled = false Coverband::Background.stop Coverband::Collectors::Coverage.instance.report_coverage(true)
fix for resque boot storing runtime coverage
danmayer_coverband
train
rb
f4fa5698c1ff391ea44a85f5136fa2c480e37f23
diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java index <HASH>..<HASH> 100755 --- a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java @@ -1468,6 +1468,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { public ChannelBuf newOutboundBuffer(ChannelHandlerContext ctx) throws Exception { switch (channel.metadata().bufferType()) { case BYTE: + // TODO: Use a direct buffer once buffer pooling is implemented. return Unpooled.buffer(); case MESSAGE: return Unpooled.messageBuffer();
Add a TODO which should be done when buffer pool is implemented
netty_netty
train
java
a2b0ef551b51d17e2aa2e65c16477f2cc276124c
diff --git a/Auth/OpenID/Interface.php b/Auth/OpenID/Interface.php index <HASH>..<HASH> 100644 --- a/Auth/OpenID/Interface.php +++ b/Auth/OpenID/Interface.php @@ -165,8 +165,8 @@ class Auth_OpenID_OpenIDStore { * store. Unlike all other methods in this class, this one * provides a default implementation, which returns false. * - * In general, any custom subclass of Auth_OpenID_OpenIDStore won't - * override this method, as custom subclasses are only likely to + * In general, any custom subclass of {@link Auth_OpenID_OpenIDStore} + * won't override this method, as custom subclasses are only likely to * be created when the store is fully functional. * * @return bool true if the store works fully, false if the
[project @ Added link to Interface file]
openid_php-openid
train
php
fe5c029c04db4ec858d4e32d3d82e70d484891dd
diff --git a/lib/synvert/core/rewriter/instance.rb b/lib/synvert/core/rewriter/instance.rb index <HASH>..<HASH> 100644 --- a/lib/synvert/core/rewriter/instance.rb +++ b/lib/synvert/core/rewriter/instance.rb @@ -91,6 +91,7 @@ module Synvert::Core .glob(file_pattern) .each do |file_path| next if Configuration.instance.get(:skip_files).include? file_path + begin conflict_actions = [] source = +self.class.file_source(file_path)
Auto corrected by following Lint Ruby EmptyLine
xinminlabs_synvert-core
train
rb
6e88044e8793eb2a19c2da992adcd68360477be7
diff --git a/lib/tkellem/daemon.rb b/lib/tkellem/daemon.rb index <HASH>..<HASH> 100644 --- a/lib/tkellem/daemon.rb +++ b/lib/tkellem/daemon.rb @@ -37,7 +37,7 @@ class Tkellem::Daemon command = @args.shift case command when 'start' - running? + abort_if_running daemonize start when 'stop' @@ -138,7 +138,7 @@ class Tkellem::Daemon pid.to_i > 0 ? pid.to_i : nil end - def running? + def abort_if_running pid = File.read(pid_file) if File.file?(pid_file) if pid.to_i > 0 puts "tkellem already running, pid: #{pid}"
Rename running? to abort_if_running Follow ruby naming convention. This method originally returned a boolean, but I changed what the method did and forgot to rename the method appropriately.
codekitchen_tkellem
train
rb
14864453550579542db96be66c032fe141d29a16
diff --git a/lib/kaskara/spoon/backend/src/main/java/christimperley/kaskara/Main.java b/lib/kaskara/spoon/backend/src/main/java/christimperley/kaskara/Main.java index <HASH>..<HASH> 100644 --- a/lib/kaskara/spoon/backend/src/main/java/christimperley/kaskara/Main.java +++ b/lib/kaskara/spoon/backend/src/main/java/christimperley/kaskara/Main.java @@ -8,12 +8,8 @@ import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.Callable; import picocli.CommandLine; -import spoon.reflect.code.CtStatement; -import spoon.reflect.visitor.filter.AbstractFilter; @CommandLine.Command(name = "kaskara", mixinStandardHelpOptions = true)
removed dead imports from spoon backend
ChrisTimperley_Kaskara
train
java
f3d9c5df2b343a201b97ca8d647c778645fefb80
diff --git a/src/you_get/common.py b/src/you_get/common.py index <HASH>..<HASH> 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -1128,6 +1128,22 @@ def script_main(script_name, download, download_playlist, **kwargs): raise else: sys.exit(1) + except: + if not traceback: + log.e('[error] oops, something went wrong.') + log.e('don\'t panic, c\'est la vie. please try the following steps:') + log.e(' (1) Rule out any network problem.') + log.e(' (2) Make sure you-get is up-to-date.') + log.e(' (3) Check if the issue is already known, on') + log.e(' https://github.com/soimort/you-get/wiki/Known-Bugs') + log.e(' https://github.com/soimort/you-get/issues') + log.e(' (4) Run the command with \'--debug\' option,') + log.e(' and report this issue with the full output.') + else: + version() + log.i(args) + raise + sys.exit(1) def google_search(url): keywords = r1(r'https?://(.*)', url)
[common] improve error message, display a brief instruction to tell users what to do
soimort_you-get
train
py
c9ddd61b5e72af3561f1e1348f5db094764be6d4
diff --git a/pycbc/types/frequencyseries.py b/pycbc/types/frequencyseries.py index <HASH>..<HASH> 100644 --- a/pycbc/types/frequencyseries.py +++ b/pycbc/types/frequencyseries.py @@ -575,7 +575,7 @@ def load_frequencyseries(path, group=None): data = _numpy.loadtxt(path) elif ext == '.hdf': key = 'data' if group is None else group - f = h5py.File(path) + f = h5py.File(path, 'r') data = f[key][:] series = FrequencySeries(data, delta_f=f[key].attrs['delta_f'], epoch=f[key].attrs['epoch'])
Declare read-only file as read-only (#<I>)
gwastro_pycbc
train
py
ffe817fcababca46d4989ff3982807468645d2ea
diff --git a/staging/src/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go +++ b/staging/src/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go @@ -140,6 +140,7 @@ func newOpenstackAuthProvider(_ string, config map[string]string, persister rest var ttlDuration time.Duration var err error + glog.Warningf("WARNING: in-tree openstack auth plugin is now deprecated. please use the \"client-keystone-auth\" kubectl/client-go credential plugin instead") ttl, found := config["ttl"] if !found { ttlDuration = DefaultTTLDuration
Deprecate the in-tree keystone plugin We now have the `client-keystone-auth` in cloud-provider-openstack repository: <URL>
kubernetes_kubernetes
train
go
c269b9d4c5a4601f0279dbf469b5474a8e4bad13
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,5 +4,5 @@ require 'bundler/setup' require 'osrsgrabber' RSpec.configure do |config| - #stuff + config.mock_with :rspec end
Added rspec mocking to helper
sambooo_RsHighscores
train
rb
81ea704043bfcc15c41b0ba4921e595577ff051e
diff --git a/examples/kml.js b/examples/kml.js index <HASH>..<HASH> 100644 --- a/examples/kml.js +++ b/examples/kml.js @@ -23,7 +23,7 @@ var vector = new ol.layer.Vector({ var map = new ol.Map({ layers: [raster, vector], renderer: ol.RendererHint.CANVAS, - target: 'map', + target: document.getElementById('map'), view: new ol.View2D({ center: [876970.8463461736, 5859807.853963373], zoom: 10 @@ -41,9 +41,11 @@ var displayFeatureInfo = function(pixel) { for (i = 0, ii = features.length; i < ii; ++i) { info.push(features[i].get('name')); } - document.getElementById('info').innerHTML = info.join(', ') || '&nbsp'; + document.getElementById('info').innerHTML = info.join(', ') || '(unkown)'; + map.getTarget().style.cursor = 'pointer'; } else { document.getElementById('info').innerHTML = '&nbsp;'; + map.getTarget().style.cursor = ''; } };
Change cursor when over a feature in KML example
openlayers_openlayers
train
js
533a8dbfa820bf282e0bd07288714acb12f10340
diff --git a/examples/sinatra/app.rb b/examples/sinatra/app.rb index <HASH>..<HASH> 100755 --- a/examples/sinatra/app.rb +++ b/examples/sinatra/app.rb @@ -29,9 +29,9 @@ get '/dynamic-share' do .with_pin_auth .build ) - .with_callback_endpoint('/profile') - .with_extension(Yoti::DynamicSharingService::TransactionalFlowExtension.builder.with_content({}).build) - .build + .with_callback_endpoint('/profile') + .with_extension(Yoti::DynamicSharingService::TransactionalFlowExtension.builder.with_content({}).build) + .build share = Yoti::DynamicSharingService.create_share_url scenario erb :dynamic_share, locals: {
SDK-<I>: Manually correcting indentation in sinatra example project
getyoti_yoti-ruby-sdk
train
rb
c55f0e3029e800a4dd26eda50a8b4b672911b7ba
diff --git a/src/Repositories/EloquentTag.php b/src/Repositories/EloquentTag.php index <HASH>..<HASH> 100644 --- a/src/Repositories/EloquentTag.php +++ b/src/Repositories/EloquentTag.php @@ -3,6 +3,7 @@ namespace TypiCMS\Modules\Tags\Repositories; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Support\Str; use TypiCMS\Modules\Core\Repositories\EloquentRepository; use TypiCMS\Modules\Tags\Models\Tag; @@ -50,7 +51,7 @@ class EloquentTag extends EloquentRepository foreach ($tags as $tag) { $returnTags[] = $this->create([ 'tag' => $tag, - 'slug' => str_slug($tag), + 'slug' => Str::slug($tag), ]); }
Use of str and array helper removed
TypiCMS_Tags
train
php
10a4f7cce09248c30410c01dbc27dfbd0aca6144
diff --git a/generator/classes/propel/engine/database/model/Column.php b/generator/classes/propel/engine/database/model/Column.php index <HASH>..<HASH> 100644 --- a/generator/classes/propel/engine/database/model/Column.php +++ b/generator/classes/propel/engine/database/model/Column.php @@ -678,6 +678,13 @@ class Column extends XMLElement { . '"'; } + if ($this->isNodeKey()) { + $result .= " nodeKey=\"true\""; + if ($this->getNodeKeySep() !== null) { + $result .= " nodeKeySep=\"" . $this->nodeKeySep . '"'; + } + } + // Close the column. $result .= " />\n"; @@ -927,4 +934,4 @@ class Column extends XMLElement { $sb .= $this->getAutoIncrementString(); return $sb; } -} \ No newline at end of file +}
added isNodeKey and nodeKeySep to attributes generated by toString()
propelorm_Propel
train
php
3fbdc525bf2cdf8f78b5385ee36b27cb415d8658
diff --git a/nbt/region.py b/nbt/region.py index <HASH>..<HASH> 100644 --- a/nbt/region.py +++ b/nbt/region.py @@ -63,9 +63,13 @@ class RegionFile(object): compression = unpack(">B", self.file.read(1)) compression = compression[0] chunk = self.file.read(length-1) - chunk = zlib.decompress(chunk) - chunk = StringIO(chunk) - return NBTFile(buffer=chunk) + if (compression == 2): + chunk = zlib.decompress(chunk) + chunk = StringIO(chunk) + return NBTFile(buffer=chunk) #pass uncompressed + else: + chunk = StringIO(chunk) + return NBTFile(fileobj=chunk) #pass compressed; will be filtered through Gzip else: return None
The two compression methods ARE different (undo 5da<I>be<I>fe<I>dc<I>c<I>dbe<I>a<I>) Compression mode 1 (GZip: RFC<I>) needs the GzipFile parser, while mode 2 (Zlib: RFC<I>) needs the zlib.decompress() and zlib.compress() to parse.
twoolie_NBT
train
py
b71b64b2eacc842282b80c8c9382967d7244da7d
diff --git a/js/adapt/cfi.js b/js/adapt/cfi.js index <HASH>..<HASH> 100644 --- a/js/adapt/cfi.js +++ b/js/adapt/cfi.js @@ -413,6 +413,7 @@ adapt.cfi.Fragment.prototype.prependPathFromNode = function(node, offset, after, node = node.previousSibling; continue; case 8: // Comment Node + node = node.previousSibling; continue; } break;
Avoid infinite loop during EPUB CFI resolution when a comment node is specified
vivliostyle_vivliostyle.js
train
js
ffac3697644f128d2b2b777d5d6518cac3cc2250
diff --git a/opendata_transport/__init__.py b/opendata_transport/__init__.py index <HASH>..<HASH> 100644 --- a/opendata_transport/__init__.py +++ b/opendata_transport/__init__.py @@ -33,15 +33,19 @@ class OpendataTransport(object): try: with async_timeout.timeout(5, loop=self._loop): - response = await self._session.get(url) + response = await self._session.get(url, raise_for_status=True) _LOGGER.debug( "Response from transport.opendata.ch: %s", response.status) data = await response.json() _LOGGER.debug(data) - except (asyncio.TimeoutError, aiohttp.ClientError): + except (asyncio.TimeoutError): _LOGGER.error("Can not load data from transport.opendata.ch") raise exceptions.OpendataTransportConnectionError() + except (aiohttp.ClientError) as aiohttpClientError: + _LOGGER.error("Response from transport.opendata.ch: %s", + aiohttpClientError) + raise exceptions.OpendataTransportConnectionError() try: self.from_id = data['from']['id']
report client errors (#4) * report client errors python-opendata-transport#3 report client errors so that exceptions like ratelimiting (transport.opendata.ch proxies requests to timetable.search.ch which limits number f daily requests to <I> as in sep'<I> but can change) * Update style
fabaff_python-opendata-transport
train
py
7d65b508100f98a504528da2346a64ccdc80be12
diff --git a/writer.go b/writer.go index <HASH>..<HASH> 100644 --- a/writer.go +++ b/writer.go @@ -110,8 +110,12 @@ func (f *Frame) writeFrame(w *bufio.Writer, l string) error { return e } } - // Write the last Header LF and the frame Body - if _, e := fmt.Fprintf(w, "\n%s", f.Body); e != nil { + // Write the last Header LF + if _, e := fmt.Fprintf(w, "\n"); e != nil { + return e + } + // Write the body + if _, e := w.Write(f.Body); e != nil { return e } return nil
Try to avoid byte/string conversions.
gmallard_stompngo
train
go
147adc6e8796504da86c1914edf0d095c4d3af10
diff --git a/gnupg/gnupg.py b/gnupg/gnupg.py index <HASH>..<HASH> 100644 --- a/gnupg/gnupg.py +++ b/gnupg/gnupg.py @@ -1029,7 +1029,7 @@ generate keys. Please see >>> encrypted = str(gpg.encrypt(message, key.fingerprint)) >>> assert encrypted != message >>> assert not encrypted.isspace() - >>> decrypted = str(gpg.decrypt(encrypted)) + >>> decrypted = str(gpg.decrypt(encrypted, passphrase='foo')) >>> assert not decrypted.isspace() >>> decrypted 'The crow flies at midnight.'
documentation update for usage of `decrypt()` The sample in the doc wasn't able to decrypt the message without passing in the passphrase given earlier in the example.
isislovecruft_python-gnupg
train
py
6ee44b326a30b8b6519e3f16fc05f7d9c05a22ca
diff --git a/test/functional/storage_helper.rb b/test/functional/storage_helper.rb index <HASH>..<HASH> 100644 --- a/test/functional/storage_helper.rb +++ b/test/functional/storage_helper.rb @@ -8,9 +8,8 @@ require 'ruote/storage/hash_storage' -def locate_storage_impl(arg) +def locate_storage_impl(pers) - pers = arg[2..-1] glob = File.expand_path("../../../../ruote-#{pers}*", __FILE__) path = Dir[glob].first @@ -43,9 +42,15 @@ else uses the in-memory Ruote::Engine (fastest, but no persistence at all) ps = ARGV.select { |a| a.match(/^--[a-z]/) } ps.delete('--split') + if sto = ENV['RUOTE_STORAGE'] + ps = [ sto ] + end + + ps = ps.collect { |s| m = s.match(/^--(.+)$/); m ? m[1] : s } + persistent = opts.delete(:persistent) - if ps.include?('--fs') + if ps.include?('fs') require 'ruote/storage/fs_storage'
RUOTE_STORAGE env var for tests since <I>'s test/unit is not happy with -- --storage
jmettraux_ruote
train
rb
844727134080ba0533068170c070dbf4bb7b1eeb
diff --git a/state/statecmd/upgradecharm_test.go b/state/statecmd/upgradecharm_test.go index <HASH>..<HASH> 100644 --- a/state/statecmd/upgradecharm_test.go +++ b/state/statecmd/upgradecharm_test.go @@ -49,11 +49,7 @@ func (s *UpgradeCharmSuite) TestServiceUpgradeCharm(c *C) { Force: t.force, RepoPath: coretest.Charms.Path, }) - if t.err != "" { - c.Assert(err, ErrorMatches, t.err) - } else { - c.Assert(err, IsNil) - } + c.Assert(err, IsNil) err = svc.Destroy() c.Assert(err, IsNil) }
Missed a changed var.
juju_juju
train
go
472faa97c5ee7fac8b5c99657c4f5a3bb82dbabd
diff --git a/gns3server/utils/get_resource.py b/gns3server/utils/get_resource.py index <HASH>..<HASH> 100644 --- a/gns3server/utils/get_resource.py +++ b/gns3server/utils/get_resource.py @@ -49,8 +49,6 @@ def get_resource(resource_name): """ resource_path = None - if hasattr(sys, "frozen") and sys.platform.startswith("darwin"): - resource_name = os.path.join(os.path.dirname(sys.executable), "../Resources", resource_name) if hasattr(sys, "frozen") and os.path.exists(resource_name): resource_path = os.path.normpath(os.path.join(os.path.dirname(sys.executable), resource_name)) elif not hasattr(sys, "frozen") and pkg_resources.resource_exists("gns3server", resource_name):
Due to the migration to cx_freeze darwin and windows share the same path for resources
GNS3_gns3-server
train
py
a4657b56184375d374c71dd39b3d6a2531c95a32
diff --git a/memote/support/basic.py b/memote/support/basic.py index <HASH>..<HASH> 100644 --- a/memote/support/basic.py +++ b/memote/support/basic.py @@ -250,7 +250,6 @@ def find_oxygen_reactions(model): def find_unique_metabolites(model): """Return set of metabolite IDs without duplicates from compartments.""" - # TODO: BiGG specific (met_c). return set(met.id.split("_", 1)[0] for met in model.metabolites)
docs: remove wrong TODO comment.
opencobra_memote
train
py
0e4b458fe585f4d0650be7b2a4977e8512d1cdbf
diff --git a/src/main/java/org/junit/contrib/truth/subjects/Subject.java b/src/main/java/org/junit/contrib/truth/subjects/Subject.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/junit/contrib/truth/subjects/Subject.java +++ b/src/main/java/org/junit/contrib/truth/subjects/Subject.java @@ -99,7 +99,7 @@ public class Subject<S extends Subject<S,T>,T> { public And<S> isNotEqualTo(Object other) { if (getSubject() == null) { if(other == null) { - fail("is not equal to", other); + fail("is not equal to", (Object)null); } } else { if (getSubject().equals(other)) {
Per findbugs, don't pass a known null variable into a method, pass in null explicitly.
google_truth
train
java
498fbdd744db7bba0649c21aa646f17912293dca
diff --git a/src/Aura/Framework/Web/Controller/Front.php b/src/Aura/Framework/Web/Controller/Front.php index <HASH>..<HASH> 100644 --- a/src/Aura/Framework/Web/Controller/Front.php +++ b/src/Aura/Framework/Web/Controller/Front.php @@ -186,9 +186,19 @@ class Front */ public function request() { + // get the path, and make allowances for "index.php" in the path + $url = $this->context->getServer('REQUEST_URI', '/'); + $path = parse_url($url, PHP_URL_PATH); + $pos = strpos($path, '/index.php'); + if ($pos !== false) { + // read the path after /index.php + $path = substr($path, $pos + 10); + if (! $path) { + $path = '/'; + } + } + // match to a route - $url = $this->context->getServer('REQUEST_URI', '/'); - $path = parse_url($url, PHP_URL_PATH); $server = $this->context->getServer(); $route = $this->router->match($path, $server);
make allowances for index.php in the path
auraphp_Aura.Framework
train
php
54cb82617a9fea69d8fd103f33bcd8366e7a7d2d
diff --git a/models/behaviors/csv.php b/models/behaviors/csv.php index <HASH>..<HASH> 100644 --- a/models/behaviors/csv.php +++ b/models/behaviors/csv.php @@ -91,6 +91,9 @@ class CsvBehavior extends ModelBehavior { while ($row = fgetcsv($file, $options['length'], $options['delimiter'], $options['enclosure'])) { // for each header field foreach ($fields as $f => $field) { + if (!isset($row[$f])) { + $row[$f] = null; + } // get the data field from Model.field if (strpos($field,'.')) { $keys = explode('.',$field);
Added null values for columns that don't exist
ProLoser_CakePHP-CSV
train
php
acf0fd4b9a427773e8ac9b74cad54c1e9014fb16
diff --git a/test/g_object_test.rb b/test/g_object_test.rb index <HASH>..<HASH> 100644 --- a/test/g_object_test.rb +++ b/test/g_object_test.rb @@ -1,8 +1,8 @@ require File.expand_path('test_helper.rb', File.dirname(__FILE__)) require 'gir_ffi/g_object' -class HelperGObjectTypeTest < Test::Unit::TestCase - context "The GObject module" do +class GObjectTest < Test::Unit::TestCase + context "The GirFFI::GObject helper module" do should "have type_init as a public method" do assert GirFFI::GObject.respond_to?('type_init') end
Properly name test and explain what it tests.
mvz_gir_ffi
train
rb
0f116a1aee39e0ff041b45064919c7256ee57432
diff --git a/src/NaturalLanguage/NaturalLanguageClient.php b/src/NaturalLanguage/NaturalLanguageClient.php index <HASH>..<HASH> 100644 --- a/src/NaturalLanguage/NaturalLanguageClient.php +++ b/src/NaturalLanguage/NaturalLanguageClient.php @@ -128,7 +128,8 @@ class NaturalLanguageClient * `PLAIN_TEXT` or `HTML`. **Defaults to** `"PLAIN_TEXT"`. * @type string $language The language of the document. Both ISO * (e.g., en, es) and BCP-47 (e.g., en-US, es-ES) language codes - * are accepted. Defaults to `"en"` (English). + * are accepted. If no value is provided, the language will be + * detected by the service. * @type string $encodingType The text encoding type used by the API to * calculate offsets. Acceptable values are `"NONE"`, `"UTF8"`, * `"UTF16"` and `"UTF32"`. **Defaults to** `"UTF8"`.
correct doc string to represent the fact the service detects the language of the provided content (#<I>)
googleapis_google-cloud-php
train
php
6fd6514dbbd9bb30965d3191d4caaee9fafb16c0
diff --git a/gdown/download_folder.py b/gdown/download_folder.py index <HASH>..<HASH> 100644 --- a/gdown/download_folder.py +++ b/gdown/download_folder.py @@ -306,12 +306,11 @@ def download_folder( print("Retrieving folder list completed", file=sys.stderr) print("Building directory structure", file=sys.stderr) if output is None: - output = os.getcwd() + output = os.getcwd() + osp.sep + if output.endswith(osp.sep): + root_folder = osp.join(output, gdrive_file.name) else: - if output.endswith(osp.sep): - root_folder = osp.join(output, gdrive_file.name) - else: - root_folder = output + root_folder = output directory_structure = get_directory_structure(gdrive_file, root_folder) if not osp.exists(root_folder): os.makedirs(root_folder)
Fix root_folder with no output given
wkentaro_gdown
train
py
e93c11cff4c8115ba6227bd90f27387f6e3b473d
diff --git a/app.rb b/app.rb index <HASH>..<HASH> 100644 --- a/app.rb +++ b/app.rb @@ -3,17 +3,9 @@ require "sinatra" require "builder" require "haml" -def require_or_load(file) - if Sinatra::Application.environment == :development - load File.join(File.dirname(__FILE__), "#{file}.rb") - else - require file - end -end - -require_or_load "lib/cache" -require_or_load "lib/configuration" -require_or_load "lib/models" +require "lib/cache" +require "lib/configuration" +require "lib/models" set :cache_dir, "cache" set :cache_enabled, Nesta::Configuration.cache
Dropped require_or_load now reloading is no longer supported.
gma_nesta
train
rb
989d0b63a6982d02c5d806937ff5038a5f39eba3
diff --git a/tests/test_launchpad.py b/tests/test_launchpad.py index <HASH>..<HASH> 100644 --- a/tests/test_launchpad.py +++ b/tests/test_launchpad.py @@ -802,13 +802,23 @@ class TestLaunchpadClient(unittest.TestCase): def test_http_wrong_status_issue_collection(self): """Test if an empty collection is returned when the http status is not 200""" + httpretty.register_uri(httpretty.GET, + LAUNCHPAD_API_URL + "/bugs/100/attachments", + body="", + status=404) + client = LaunchpadClient("mydistribution", package="mypackage") with self.assertRaises(requests.exceptions.HTTPError): _ = next(client.issue_collection("100", "attachments")) @httpretty.activate def test_http_wrong_status_user(self): - """Test if an empty user is returned when the http status is not 200""" + """Test if an empty user is returned when the http status is not 200, 404, 410""" + + httpretty.register_uri(httpretty.GET, + LAUNCHPAD_API_URL + "/~user1", + body="", + status=500) client = LaunchpadClient("mydistribution", package="mypackage") with self.assertRaises(requests.exceptions.HTTPError):
[tests] Add mock http answers to tests launchpad This patch adds mocked http answers to two tests (test_http_wrong_status_issue_collection, test_http_wrong_status_user), thus enabling control over the response.
chaoss_grimoirelab-perceval
train
py
fdf68a98d99c8b90695ff54c84ba37368a322d30
diff --git a/src/Browscap/Command/BuildCommand.php b/src/Browscap/Command/BuildCommand.php index <HASH>..<HASH> 100644 --- a/src/Browscap/Command/BuildCommand.php +++ b/src/Browscap/Command/BuildCommand.php @@ -56,7 +56,6 @@ class BuildCommand extends Command ErrorHandler::register($logger); $buildGenerator = new BuildGenerator($resourceFolder, $buildFolder); - $buildGenerator->setOutput($output); $buildGenerator->setLogger($logger); $buildGenerator->generateBuilds($version);
Removed call to setOutput as is now deprecated
browscap_browscap
train
php
6691b087319af6f73e5cd0d41077889ab977e85a
diff --git a/pronto/parser/base.py b/pronto/parser/base.py index <HASH>..<HASH> 100644 --- a/pronto/parser/base.py +++ b/pronto/parser/base.py @@ -13,7 +13,8 @@ class BaseParser(object): _instances = {} - @abc.abstractclassmethod + @classmethod + @abc.abstractmethod def hook(cls, force=False, path=None, lookup=None): """Test whether this parser should be used. @@ -21,6 +22,7 @@ class BaseParser(object): and looking ahead a small buffer in the file object. """ + @classmethod @abc.abstractmethod def parse(self, stream): """
Remove `abstractclassmethod` decorators as they are deprecated
althonos_pronto
train
py
5c4e1025ce4a9afa1216d53b828637cd105f56f0
diff --git a/trollimage/xrimage.py b/trollimage/xrimage.py index <HASH>..<HASH> 100644 --- a/trollimage/xrimage.py +++ b/trollimage/xrimage.py @@ -1428,10 +1428,10 @@ class XRImage(object): Convert a mode "L" (or "LA") grayscale image to a mode "P" (or "PA") palette image and store the palette in the ``palette`` attribute. - Note that to store the subsequent image in mode "P", one needs to call - :meth:`~XRImage.save` with ``keep_palette=True`` (or the image will be stored - as RGB/RGBA) and again pass the colormap with ``cmap=colormap`` (or the - mapping between pixel values and colors will be missing). + To store this image in mode "P", call :meth:`~XRImage.save` with + ``keep_palette=True``. To include color information in the output + format (if supported), call :meth:`~XRImage.save` with + ``keep_palette=True`` *and* ``cmap=colormap``. To (directly) get an image in mode "RGB" or "RGBA", use :meth:`~XRImage.colorize`.
Clarify how to keep palette in image
pytroll_trollimage
train
py
22f7ad941861efbf0646d130d570ee79513d4b1f
diff --git a/jquery.peity.js b/jquery.peity.js index <HASH>..<HASH> 100644 --- a/jquery.peity.js +++ b/jquery.peity.js @@ -187,12 +187,14 @@ 'A', radius, radius, 0, 1, 1, x2, y1, 'L', x2, y2, 'A', innerRadius, innerRadius, 0, 1, 0, cx, y2 - ].join(' ') + ].join(' '), + 'data-value': value, }) } else { $node = svgElement('circle', { cx: cx, cy: cy, + 'data-value': value, r: radius }) } @@ -219,7 +221,8 @@ cumulative += value $node = svgElement('path', { - d: d.join(" ") + d: d.join(" "), + 'data-value': value, }) } @@ -370,6 +373,7 @@ $svg.append( svgElement('rect', { + 'data-value': value, fill: fill.call(this, value, i, values), x: x, y: y1,
Include an item's value on pie slices and bars - usable by tooltips for example.
benpickles_peity
train
js
08180232ef9bfaab87bc6055748b5dcf0dcd4d0d
diff --git a/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/AbstractHtml.java b/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/AbstractHtml.java index <HASH>..<HASH> 100644 --- a/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/AbstractHtml.java +++ b/wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/AbstractHtml.java @@ -7014,8 +7014,7 @@ public abstract non-sealed class AbstractHtml extends AbstractJsObject implement throw new InvalidValueException("There is no existing whenURI condition at this index"); } uriChangeContents.set(index, uriChangeContent); - } - lastURIPredicateTest = false; + } final URIChangeTagSupplier uriChangeTagSupplier = sharedObject.getURIChangeTagSupplier(ACCESS_OBJECT); applyURIChange(uriChangeTagSupplier, true);
Some unreleased improvement reverted
webfirmframework_wff
train
java
bea058f21ec3d6de7950d19a6607c2c64f7a3717
diff --git a/micawber/providers.py b/micawber/providers.py index <HASH>..<HASH> 100644 --- a/micawber/providers.py +++ b/micawber/providers.py @@ -2,6 +2,7 @@ import hashlib import pickle import re import socket +import ssl from .compat import get_charset from .compat import HTTPError from .compat import OrderedDict @@ -44,6 +45,8 @@ class Provider(object): return False except socket.timeout: return False + except ssl.SSLError: + return False return resp def encode_params(self, url, **extra_params):
Catch SSLError when fetching.
coleifer_micawber
train
py
a3b3332ab0c75d36920118ebbbf28cc3206235e7
diff --git a/rio_color/scripts/cli.py b/rio_color/scripts/cli.py index <HASH>..<HASH> 100755 --- a/rio_color/scripts/cli.py +++ b/rio_color/scripts/cli.py @@ -110,6 +110,8 @@ Example: arr = color_worker(rasters, window, ij, args) dest.write(arr, window=window) + dest.colorinterp = src.colorinterp + @click.command('atmos') @click.option('--atmo', '-a', type=click.FLOAT, default=0.03, diff --git a/tests/test_cli.py b/tests/test_cli.py index <HASH>..<HASH> 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -211,8 +211,7 @@ def test_color_cli_16bit_photointerp(tmpdir): with rasterio.open('tests/rgb16.tif') as src: with rasterio.open(output) as out: - for b in src.indexes: - assert out.colorinterp == src.colorinterp + assert out.colorinterp == src.colorinterp def test_color_empty_operations(tmpdir):
Explicitly set color interpretation (#<I>) Previously we were counting on creation keyword storage that is gone from Rasterio <I>. Resolves #<I>
mapbox_rio-color
train
py,py
574e74db583588e94627d4330bf8d5d3aa836507
diff --git a/salesforce/tests/test_integration.py b/salesforce/tests/test_integration.py index <HASH>..<HASH> 100644 --- a/salesforce/tests/test_integration.py +++ b/salesforce/tests/test_integration.py @@ -47,19 +47,19 @@ class BasicSOQLTest(TestCase): Get the first five account records. """ accounts = Account.objects.all()[0:5] - self.assertEqual(len(accounts), 5) + self.assertEqual(len(accounts), 2) def test_select_all(self): """ Get the first five account records. """ accounts = Account.objects.all()[0:5] - self.assertEqual(len(accounts), 5) + self.assertEqual(len(accounts), 2) def test_foreign_key(self): account = Account.objects.all()[0] user = account.Owner - self.assertEqual(user.Email, '[email protected]') + self.assertEqual(user.Email, '[email protected]') def test_update_date(self): """
some fixes to verify my tests are just shitty, not broken
django-salesforce_django-salesforce
train
py
13dc884a6b1ea191e378cdda1284668cd4d7c6d9
diff --git a/views/js/picCreator/dev/studentToolSample/creator/widget/Widget.js b/views/js/picCreator/dev/studentToolSample/creator/widget/Widget.js index <HASH>..<HASH> 100644 --- a/views/js/picCreator/dev/studentToolSample/creator/widget/Widget.js +++ b/views/js/picCreator/dev/studentToolSample/creator/widget/Widget.js @@ -1,5 +1,5 @@ define([ - 'taoQtiItem/qtiCreator/widgets/Widget', + 'taoQtiItem/qtiCreator/widgets/static/portableInfoControl/Widget', 'studentToolSample/creator/widget/states/states', 'css!studentToolSample/creator/css/studentToolSample' ], function(Widget, states){ @@ -7,17 +7,9 @@ define([ var StudentToolSampleWidget = Widget.clone(); StudentToolSampleWidget.initCreator = function(){ - this.registerStates(states); - Widget.initCreator.call(this); }; - - StudentToolSampleWidget.buildContainer = function(){ - - this.$container = this.$original; - this.$container.addClass('widget-box'); - }; - + return StudentToolSampleWidget; }); \ No newline at end of file
student tool creator widget extends pic widget
oat-sa_extension-tao-itemqti-pic
train
js
540c4c1871c56bc7bcb55dacc1f9e0068ecf3f51
diff --git a/protocols/raft/src/main/java/io/atomix/protocols/raft/proxy/impl/MemberSelector.java b/protocols/raft/src/main/java/io/atomix/protocols/raft/proxy/impl/MemberSelector.java index <HASH>..<HASH> 100644 --- a/protocols/raft/src/main/java/io/atomix/protocols/raft/proxy/impl/MemberSelector.java +++ b/protocols/raft/src/main/java/io/atomix/protocols/raft/proxy/impl/MemberSelector.java @@ -149,9 +149,9 @@ public final class MemberSelector implements Iterator<NodeId>, AutoCloseable { /** * Returns a boolean value indicating whether the selector state would be changed by the given members. */ - private boolean changed(NodeId leader, Collection<NodeId> servers) { - checkNotNull(members, "servers"); - checkArgument(!members.isEmpty(), "servers cannot be empty"); + private boolean changed(NodeId leader, Collection<NodeId> members) { + checkNotNull(members, "members"); + checkArgument(!members.isEmpty(), "members cannot be empty"); if (leader != null) { checkArgument(members.contains(leader), "leader must be present in members list"); }
Fix unused argument after cherry pick in MemberSelector.
atomix_atomix
train
java
3c7b0760a190e09a7aa1e6f95bb272325f6f19a2
diff --git a/classes/PodsAdmin.php b/classes/PodsAdmin.php index <HASH>..<HASH> 100644 --- a/classes/PodsAdmin.php +++ b/classes/PodsAdmin.php @@ -2944,6 +2944,9 @@ class PodsAdmin { $ui['views']['dev'] = __( 'Developer Preview', 'pods' ); } + // Add our custom callouts. + add_action( 'pods_ui_manage_after_container', array( $this, 'admin_manage_callouts' ) ); + pods_ui( $ui ); }
Add callouts to components page too
pods-framework_pods
train
php
e70dcbd8315c1261e98785a9573e7df3f753e2e8
diff --git a/lib/skittles/client/venue.rb b/lib/skittles/client/venue.rb index <HASH>..<HASH> 100644 --- a/lib/skittles/client/venue.rb +++ b/lib/skittles/client/venue.rb @@ -225,6 +225,9 @@ module Skittles # @option options [String] query A search term to be applied against titles. # @option options [Integer] limit Number of results to return, up to 50. # @option options [String] intent Indicates your intent in performing the search. + # @option options [Integer] radius Limit results to venues within this many meters of the specified location. + # @option options [Decimal] sw With ne, limits results to the bounding quadrangle defined by the latitude and longitude given by sw as its south-west corner, and ne as its north-east corner. + # @option options [Decimal] ne See sw # @option options [String] categoryId A category to limit the results to. (experimental) # @option options [String] url A third-party URL which is attempted to match against a map of venues to URLs. (experimental) # @option options [String] providerId Identifier for a known third party that is part of a map of venues to URLs, used in conjunction with linkedId. (experimental)
Added documentation for venue search params radius, sw and ne.
anthonator_skittles
train
rb
ad5bc23ba12388f4919c99ffdbf5fd0415c32af7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( version='0.4.3', description='A tiny library for creating wrappers around web APIs', long_description=long_description, - url='https://github.com/redodo/tortilla', + url='https://github.com/tortilla/tortilla', author='Hidde Bultsma', author_email='[email protected]', license='MIT',
Fix link to repo in setup.py
tortilla_tortilla
train
py
705f38ec6abcabd67f3620651b488ec96f691dc6
diff --git a/matchpy/expressions/functions.py b/matchpy/expressions/functions.py index <HASH>..<HASH> 100644 --- a/matchpy/expressions/functions.py +++ b/matchpy/expressions/functions.py @@ -7,7 +7,7 @@ from .expressions import ( __all__ = [ 'is_constant', 'is_syntactic', 'get_head', 'match_head', 'preorder_iter', 'preorder_iter_with_position', 'is_anonymous', 'contains_variables_from_set', 'register_operation_factory', 'create_operation_expression', - 'rename_variables' + 'rename_variables', 'op_iter', 'op_len', 'register_operation_iterator' ]
Updated __all__ of expressions/functions.py
HPAC_matchpy
train
py
82d7bde271c735022186dd3521bdc251c388c4ec
diff --git a/stats.go b/stats.go index <HASH>..<HASH> 100644 --- a/stats.go +++ b/stats.go @@ -52,7 +52,7 @@ func Sum(input []float64) (sum float64, err error) { // Add em up for _, n := range input { - sum += float64(n) + sum += n } return sum, nil
Remove unnecassary typecasting in sum func
montanaflynn_stats
train
go