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
db82e4afaa92c1029020dd4ba0047566f1303255
diff --git a/haphilipsjs/__init__.py b/haphilipsjs/__init__.py index <HASH>..<HASH> 100644 --- a/haphilipsjs/__init__.py +++ b/haphilipsjs/__init__.py @@ -1,6 +1,7 @@ import requests import logging + LOG = logging.getLogger(__name__) BASE_URL = 'http://{0}:1925/{1}/{2}' TIMEOUT = 5.0 @@ -25,11 +26,13 @@ class PhilipsTV(object): self.source_id = None self.channels = None self.channel_id = None + self.session = requests.Session() + self.session.mount("http://", requests.sessions.HTTPAdapter(pool_connections=1, pool_maxsize=1)) def _getReq(self, path): try: - with requests.get(BASE_URL.format(self._host, self.api_version, path), timeout=TIMEOUT) as resp: + with self.session.get(BASE_URL.format(self._host, self.api_version, path), timeout=TIMEOUT) as resp: if resp.status_code != 200: return None return resp.json() @@ -38,7 +41,7 @@ class PhilipsTV(object): def _postReq(self, path, data): try: - with requests.post(BASE_URL.format(self._host, self.api_version, path), json=data, timeout=TIMEOUT) as resp: + with self.session.post(BASE_URL.format(self._host, self.api_version, path), json=data, timeout=TIMEOUT) as resp: if resp.status_code == 200: return True else:
Reuse a session with a single cached connection
danielperna84_ha-philipsjs
train
py
6b41eaefc25097e7a897190eae3e115c217608d1
diff --git a/src/resizilla.src.js b/src/resizilla.src.js index <HASH>..<HASH> 100644 --- a/src/resizilla.src.js +++ b/src/resizilla.src.js @@ -38,12 +38,12 @@ function handlerCallback(handler, delay, incept) { /** - * [resizilla description] + * resizilla function * @public - * @param {[type]} optionsHandler [description] - * @param {[type]} delay [description] - * @param {[type]} incept [description] - * @return {[type]} [description] + * @param {Function | Object} optionsHandler The handler or options as an + * object literal. + * @param {Number} delay Delay in MS + * @param {Boolean} incept Incept from start of delay or till the end. */ function resizilla(optionsHandler, delay, incept) { var options = {}; @@ -103,6 +103,10 @@ function resizilla(optionsHandler, delay, incept) { } +/** + * Remove all or one of the event listeners + * @param {String} type. + */ resizilla.destroy = function(type) { if(!type || type === 'all'){ window.removeEventListener('resize', this.options.handler, this.options.useCapture);
Added comments to remaning outer functions and destroy method
julienetie_resizilla
train
js
de127131c5f6c4a87e8f751ae4f0e98a0546e074
diff --git a/core/Version.php b/core/Version.php index <HASH>..<HASH> 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Matomo version. * @var string */ - const VERSION = '4.0.4'; + const VERSION = '4.0.4-b1'; const MAJOR_VERSION = 4; public function isStableVersion($version)
Set version to <I>-b1 (#<I>)
matomo-org_matomo
train
php
92b8178a6dae2fc94bd6a7dcd56e22281432f643
diff --git a/src/angular-intro.js b/src/angular-intro.js index <HASH>..<HASH> 100644 --- a/src/angular-intro.js +++ b/src/angular-intro.js @@ -38,7 +38,7 @@ ngIntroHintsMethod: "=?", ngIntroOnhintsadded: "=", - ngIntroOnhintsclicked: "=?", + ngIntroOnhintclick: "=?", ngIntroOnhintclose: "=?", ngIntroShowHint: "=?", ngIntroShowHints: "=?",
fixed scope property name ngIntroOnhintclick replaced scope property "ngIntroOnhintsclicked" with ngIntroOnhintclick
mendhak_angular-intro.js
train
js
f5f15dbab7f1903155ed2d439c4193e635de5548
diff --git a/test/slop_test.rb b/test/slop_test.rb index <HASH>..<HASH> 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -90,4 +90,13 @@ class SlopTest < TestCase refute slop[:debug] refute slop.debug? end + + test 'raises if an option expects an argument and none is given' do + slop = Slop.new + slop.opt :name, true + slop.opt :age, :optional => true + + assert_raises(Slop::MissingArgumentError, /name/) { slop.parse %w/--name/ } + assert slop.parse %w/--name 'foo'/ + end end
added tests for raising if no option is given when one is expected
leejarvis_slop
train
rb
8591a3b5f4ef7d0d10128708f10c1df96363aecc
diff --git a/qiskit/pulse/instructions/call.py b/qiskit/pulse/instructions/call.py index <HASH>..<HASH> 100644 --- a/qiskit/pulse/instructions/call.py +++ b/qiskit/pulse/instructions/call.py @@ -222,3 +222,6 @@ class Call(instruction.Instruction): return False return True + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.assigned_subroutine()}, name='{self.name}')"
fix call instruction representation (reflect assigned parameters) (#<I>)
Qiskit_qiskit-terra
train
py
5d46c5835a35d15e57d89a39fcefbbce39b892d5
diff --git a/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/display/context/CommerceSubscriptionEntryDisplayContext.java b/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/display/context/CommerceSubscriptionEntryDisplayContext.java index <HASH>..<HASH> 100644 --- a/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/display/context/CommerceSubscriptionEntryDisplayContext.java +++ b/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/display/context/CommerceSubscriptionEntryDisplayContext.java @@ -386,7 +386,7 @@ public class CommerceSubscriptionEntryDisplayContext { BaseModelSearchResult<CommerceSubscriptionEntry> commerceSubscriptionBaseModelSearchResult = _commerceSubscriptionEntryService. - getCommerceSubscriptionEntries( + searchCommerceSubscriptionEntries( _cpRequestHelper.getCompanyId(), _cpRequestHelper.getScopeGroupId(), maxSubscriptionCycles, active, getKeywords(),
COMMERCE-<I> Renamed method
liferay_com-liferay-commerce
train
java
537e0259fa64f712ab8105788ff9cf65434937f7
diff --git a/findbugs/test/OpenStream.java b/findbugs/test/OpenStream.java index <HASH>..<HASH> 100644 --- a/findbugs/test/OpenStream.java +++ b/findbugs/test/OpenStream.java @@ -2,10 +2,23 @@ import java.io.*; public class OpenStream { public static void main(String[] argv) throws Exception { - FileInputStream in = new FileInputStream(argv[0]); + FileInputStream in = null; - if (Boolean.getBoolean("foobar")) { - in.close(); + try { + in = new FileInputStream(argv[0]); + } finally { + // Not guaranteed to be closed here! + if (Boolean.getBoolean("inscrutable")) + in.close(); + } + + FileInputStream in2 = null; + try { + in2 = new FileInputStream(argv[1]); + } finally { + // This one will be closed + if (in2 != null) + in2.close(); } // oops! exiting the method without closing the stream
Two streams, one closed and the other not git-svn-id: <URL>
spotbugs_spotbugs
train
java
36a8127ec21b5b1b807308c41be8c3342fcf9b6c
diff --git a/commands/build.js b/commands/build.js index <HASH>..<HASH> 100644 --- a/commands/build.js +++ b/commands/build.js @@ -2,12 +2,13 @@ var logger = require('./../lib/logger'); var shell = require('shelljs'); var path = require('path'); -shell.config.verbose = true; //Tasks required by this command var html = require('./../tasks/html'); exports.execute = function() { + shell.config.verbose = global.config.project.debug; + var dest_path = path.join(global.config.project_root, global.config.project.dest); // Clean destination Folder diff --git a/tasks/scripts.js b/tasks/scripts.js index <HASH>..<HASH> 100644 --- a/tasks/scripts.js +++ b/tasks/scripts.js @@ -1,9 +0,0 @@ -var config = require('./config.json'); -var gulp = require('gulp'); - -/** - * Connect Scripts - */ -gulp.task('scripts', function () { - return; -}); \ No newline at end of file
Removing un-implemented script
kunruch_mmpilot
train
js,js
3b9fbe163a46567ae28734e4e37395983da15a94
diff --git a/nolds/measures.py b/nolds/measures.py index <HASH>..<HASH> 100644 --- a/nolds/measures.py +++ b/nolds/measures.py @@ -1067,7 +1067,8 @@ def hurst_rs(data, nvals=None, fit="RANSAC", debug_plot=False, Kwargs: nvals (iterable of int): sizes of subseries to use - (default: `logarithmic_n(max(4, int(0.01* total_N)), 0.1*len(data), 1.1)`) + (default: 3 to 16 logarithmically spaced values, using only values + greater than 50 if possible) fit (str): the fitting method to use for the line fit, either 'poly' for normal least squares polynomial fitting or 'RANSAC' for RANSAC-fitting which @@ -1102,6 +1103,8 @@ def hurst_rs(data, nvals=None, fit="RANSAC", debug_plot=False, # spaced datapoints leaning towards larger n (since smaller n often give # misleading values, at least for white noise) nvals = logarithmic_n(max(4, int(0.01* total_N)), 0.1 * total_N, 1.15) + # only take n that are larger than 50 (but always take the largest three) + nvals = [x for x in nvals[:-3] if x > 50] + nvals[-3:] # get individual values for (R/S)_n rsvals = np.array([rs(data, n) for n in nvals]) # filter NaNs (zeros should not be possible, because if R is 0 then
updates default value for nvals to lean even more heavily towars larger values of n
CSchoel_nolds
train
py
e93cad6d1ed5f44fb1a1a9ec6a29afe00a42a287
diff --git a/chrome/src/extension/background.js b/chrome/src/extension/background.js index <HASH>..<HASH> 100644 --- a/chrome/src/extension/background.js +++ b/chrome/src/extension/background.js @@ -815,8 +815,12 @@ function getUrl(url) { chrome.tabs.update(ChromeDriver.activeTabId, {url: url, selected: true}, getUrlCallback); } else { - chrome.tabs.remove(ChromeDriver.activeTabId); + // we need to create the new tab before deleting the old one + // in order to avoid hanging on OS X + var oldId = ChromeDriver.activeTabId; + ChromeDriver.activeTabId = undefined; chrome.tabs.create({url: url, selected: true}, getUrlCallback); + chrome.tabs.remove(oldId); } } }
SimonStewart: Working through issues with the ChromeDriver on OS X. There's still plenty of the The Strange left to deal with r<I>
SeleniumHQ_selenium
train
js
f84857818d8217ebd166062f7dadc3cd919832f5
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -91,7 +91,7 @@ export default class Base extends EventEmitter { backHandler: partialApplyId(screen, "backHandler"), badgeLink: "https://auth0.com/?utm_source=lock&utm_campaign=badge&utm_medium=widget", closeHandler: l.ui.closable(m) - ? partialApplyId(screen, "closeHandler") + ? (...args) => closeLock(l.id(m), ...args) : undefined, contentRender: ::screen.render, error: l.globalError(m), diff --git a/src/lock/screen.js b/src/lock/screen.js index <HASH>..<HASH> 100644 --- a/src/lock/screen.js +++ b/src/lock/screen.js @@ -1,4 +1,3 @@ -import { closeLock } from './actions'; import * as l from './index'; export default class Screen { @@ -10,10 +9,6 @@ export default class Screen { return null; } - closeHandler() { - return closeLock; - } - escHandler() { return null; }
Remove closeHandler method from Screen
auth0_lock
train
js,js
882af973d38f267ae1a4dbca71cd46bb96bb63d7
diff --git a/.gitignore b/.gitignore index <HASH>..<HASH> 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist raygun_django_middleware.egg-info .DS_Store *.pyc +build diff --git a/raygun_django_middleware/__init__.py b/raygun_django_middleware/__init__.py index <HASH>..<HASH> 100644 --- a/raygun_django_middleware/__init__.py +++ b/raygun_django_middleware/__init__.py @@ -60,6 +60,7 @@ class RaygunMiddleware(object): 'queryString': dict((key, request.GET[key]) for key in request.GET), # F. Henard - 2/19/18 - bad practice to access request.POST in middleware - see https://stackoverflow.com/a/28641930 # 'form': dict((key, request.POST[key]) for key in request.POST), + 'form': {}, 'headers': _headers, 'rawData': raw_data, } diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="raygun-django-middleware", - version="1.0.7", + version="1.0.8", description="Raygun Django Middleware", author="Mirus Research", author_email="frank@mirusresearch.com",
need form for raygun4py
mirusresearch_raygun-django-middleware
train
gitignore,py,py
5cdba8165a21ce92da1a89e69942e9a68c19256f
diff --git a/oauth2/__init__.py b/oauth2/__init__.py index <HASH>..<HASH> 100644 --- a/oauth2/__init__.py +++ b/oauth2/__init__.py @@ -122,7 +122,7 @@ class Client(object): """ def __init__(self, identifier, secret, redirect_uris=[]): self.identifier = identifier - self.secret = secret, + self.secret = secret self.redirect_uris = redirect_uris def has_redirect_uri(self, uri): diff --git a/oauth2/store.py b/oauth2/store.py index <HASH>..<HASH> 100644 --- a/oauth2/store.py +++ b/oauth2/store.py @@ -2,7 +2,7 @@ Store adapters to persist data during the OAuth 2.0 process. """ from oauth2.error import ClientNotFoundError, AuthCodeNotFound -from oauth2 import AuthorizationCode +from oauth2 import AuthorizationCode, Client class AccessTokenStore(object): """ @@ -76,9 +76,9 @@ class LocalClientStore(ClientStore): :param redirect_uris: A list of URIs to redirect to. """ - self.clients[client_id] = {"client_id": client_id, - "client_secret": client_secret, - "redirect_uris": redirect_uris} + self.clients[client_id] = Client(identifier=client_id, + secret=client_secret, + redirect_uris=redirect_uris) return True
Fixed a bug during Client init
wndhydrnt_python-oauth2
train
py,py
45e44819c9e67c44adb9ee9b7146198082b29fb0
diff --git a/tests/Util/ExtraData/DataEntryConverterTest.php b/tests/Util/ExtraData/DataEntryConverterTest.php index <HASH>..<HASH> 100644 --- a/tests/Util/ExtraData/DataEntryConverterTest.php +++ b/tests/Util/ExtraData/DataEntryConverterTest.php @@ -67,11 +67,9 @@ class DataEntryConverterTest extends TestCase */ public function testConvertValueUnknown() { - $thirdPartyAttribute = DataEntryConverter::convertValue( + DataEntryConverter::convertValue( 'Some unknown type', 'Some value' ); - - $this->assertNull($thirdPartyAttribute); } }
SDK-<I>: Remove redundant assertion
getyoti_yoti-php-sdk
train
php
ca874ccc8502d83b30d22f2d5bf20affe32791d2
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -1542,7 +1542,7 @@ class Builder */ public function pluck($column, $key = null) { - $results = $this->get(func_get_args()); + $results = $this->get(is_null($key) ? [$column] : [$column, $key]); // If the columns are qualified with a table or have an alias, we cannot use // those directly in the "pluck" operations since the results from the DB
Allow null to be passed to pluck explicitely
laravel_framework
train
php
3d0fb674dfedd80f3955f26926a1af561da3f796
diff --git a/lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb b/lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb index <HASH>..<HASH> 100644 --- a/lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb +++ b/lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb @@ -148,7 +148,7 @@ module Hoodoo # around somewhere. @wrapping_session = session - @wrapped_endpoint.session_id = session.session_id + @wrapped_endpoint.session_id = session.session_id unless session.nil? return nil end end
Survive session-less attempts to make inter-resource calls
LoyaltyNZ_hoodoo
train
rb
5463823df38310d392a3f87d633dce9b4150259a
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index <HASH>..<HASH> 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1541,12 +1541,12 @@ module ActiveRecord #:nodoc: end def reverse_sql_order(order_query) - reversed_query = order_query.to_s.split(/,/).each { |s| + order_query.to_s.split(/,/).each { |s| if s.match(/\s(asc|ASC)$/) s.gsub!(/\s(asc|ASC)$/, ' DESC') elsif s.match(/\s(desc|DESC)$/) s.gsub!(/\s(desc|DESC)$/, ' ASC') - elsif !s.match(/\s(asc|ASC|desc|DESC)$/) + else s.concat(' DESC') end }.join(',')
Remove unnecessary condition and local variable [#<I> state:resolved]
rails_rails
train
rb
6fb6a730d26aaf929691775c4166914f31b79400
diff --git a/conda_manager/widgets/dialogs/channels.py b/conda_manager/widgets/dialogs/channels.py index <HASH>..<HASH> 100644 --- a/conda_manager/widgets/dialogs/channels.py +++ b/conda_manager/widgets/dialogs/channels.py @@ -186,10 +186,16 @@ class DialogChannels(QDialog): else: url = "{0}/{1}".format(self._conda_url, channel) - worker = self.api.download_is_valid_url(url) + if url[-1] == '/': + url = url[:-1] + plat = self.api.conda_platform() + repodata_url = "{0}/{1}/{2}".format(url, plat, 'repodata.json') + + worker = self.api.download_is_valid_url(repodata_url) worker.sig_finished.connect(self._url_validated) worker.item = item worker.url = url + worker.repodata_url = repodata_url self.list.itemChanged.disconnect() item.setFlags(Qt.ItemIsUserCheckable | Qt.ItemIsSelectable)
Check that is a valid conda channel and not just a valid url
spyder-ide_conda-manager
train
py
9864a72c689006b243397c565ae7d39946f3f042
diff --git a/deployment/appserver.py b/deployment/appserver.py index <HASH>..<HASH> 100644 --- a/deployment/appserver.py +++ b/deployment/appserver.py @@ -75,7 +75,7 @@ def briefkasten_ctl(action='restart'): @task -def update_backend(index='dev', build=False, user=None, version=None): +def update_backend(index='dev', build=True, user=None, version=None): """ Install the backend from the given devpi index at the given version on the target host and restart the service.
build by default afterall, the whole point of this task is to install the very latest version
ZeitOnline_briefkasten
train
py
97905388b70a4662bd5b0a9655cef65a7d0adb61
diff --git a/src/cli.js b/src/cli.js index <HASH>..<HASH> 100755 --- a/src/cli.js +++ b/src/cli.js @@ -70,12 +70,12 @@ program.command('build') buildTailwind(inputFile, loadConfig(program.config), writeStrategy(program)) }) -const subCmd = _.head(program.args); +program.parse(process.argv) + +const subCmd = _.get(_.head(program.args), '_name'); const cmds = _.map(program.commands, '_name'); if (!_.includes(cmds, subCmd)) { program.help(); process.exit() } - -program.parse(process.argv)
Fix bug where help was output even if matching command was found
tailwindcss_tailwindcss
train
js
d0b2a5bd41ac5288b5a3137e2ef17f5f4c881f50
diff --git a/openquake/baselib/parallel.py b/openquake/baselib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/parallel.py +++ b/openquake/baselib/parallel.py @@ -480,7 +480,7 @@ def safely_call(func, args, task_no=0, mon=dummy_mon): assert not isgenfunc, func return Result.new(func, args, mon) - if mon.operation.startswith(func.__name__): + if mon.operation.endswith('_split'): name = mon.operation else: name = func.__name__
Fixed task name [ci skip]
gem_oq-engine
train
py
78acd5f39a3054f05e782471de83257067d144e6
diff --git a/src/Rocketeer/Commands/DeployCommand.php b/src/Rocketeer/Commands/DeployCommand.php index <HASH>..<HASH> 100644 --- a/src/Rocketeer/Commands/DeployCommand.php +++ b/src/Rocketeer/Commands/DeployCommand.php @@ -1,13 +1,12 @@ <?php namespace Rocketeer\Commands; -use Illuminate\Console\Command; use Rocketeer\Rocketeer; /** * Your interface to deploying your projects */ -class DeployCommand extends Command +class DeployCommand extends BaseDeployCommand { /**
Make DeployCommand extends BaseDeployCommand now that it's lighter
rocketeers_rocketeer
train
php
c742eea3ca81ba38a4ba205d669697850c496d1b
diff --git a/http/consumer.go b/http/consumer.go index <HASH>..<HASH> 100644 --- a/http/consumer.go +++ b/http/consumer.go @@ -15,7 +15,7 @@ func newConsumer(resp http.ResponseWriter) (*consumer, error) { if err != nil { return nil, err } - conn.Write([]byte("HTTP/1.1 200 OK\nContent-Type: text/event-stream\n\n")) + conn.Write([]byte("HTTP/1.1 200 OK\nContent-Type: text/event-stream\nX-Accel-Buffering: no\n\n")) return &consumer{conn, make(chan bool)}, nil }
Turn off nginx buffering (closes #2)
antage_eventsource
train
go
8c70fc1f54846adc1ff21d1b5e2533ac97b5a4d3
diff --git a/src/main/java/no/finn/unleash/repository/ToggleCollection.java b/src/main/java/no/finn/unleash/repository/ToggleCollection.java index <HASH>..<HASH> 100644 --- a/src/main/java/no/finn/unleash/repository/ToggleCollection.java +++ b/src/main/java/no/finn/unleash/repository/ToggleCollection.java @@ -12,7 +12,7 @@ public final class ToggleCollection { private final int version = 1; // required for serialization private final transient Map<String, FeatureToggle> cache; - ToggleCollection(final Collection<FeatureToggle> features) { + public ToggleCollection(final Collection<FeatureToggle> features) { this.features = ensureNotNull(features); this.cache = new ConcurrentHashMap<>(); for(FeatureToggle featureToggle : this.features) {
fix: Make ToggleCollection constructor public (#<I>)
Unleash_unleash-client-java
train
java
dca6cf727cd7d990081decb57f4efda3bb5cdbc1
diff --git a/js/src/Map.js b/js/src/Map.js index <HASH>..<HASH> 100644 --- a/js/src/Map.js +++ b/js/src/Map.js @@ -82,18 +82,18 @@ export class LeafletMapModel extends widgets.DOMWidgetModel { style: null, default_style: null, dragging_style: null, - _dragging: false }; } initialize(attributes, options) { super.initialize(attributes, options); this.set('window_url', window.location.href); + this._dragging = false } update_style() { var new_style; - if (!this.get('_dragging')) { + if (!this._dragging) { new_style = this.get('default_style'); } else { new_style = this.get('dragging_style'); @@ -264,12 +264,12 @@ export class LeafletMapView extends utils.LeafletDOMWidgetView { this.model.update_bounds().then(() => { this.touch(); }); - this.model.set('_dragging', false); + this.model._dragging = false; this.model.update_style(); }); this.obj.on('movestart', () => { - this.model.set('_dragging', true); + this.model._dragging = true; this.model.update_style(); });
Move _dragging from model value to attribute (#<I>) * move _dragging from model value to attribute * initialize _dragging at initialize() * nit
jupyter-widgets_ipyleaflet
train
js
010fa977cf8a0885297407ec05def33c986ec398
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -49,7 +49,7 @@ func decodeConfig(r io.Reader, c *config) error { func (c *config) Discover() error { // If we are already inside a plugin process we should not need to // discover anything. - if os.Getenv(plugin.MagicCookieKey) != "" { + if os.Getenv(plugin.MagicCookieKey) == plugin.MagicCookieValue { return nil }
Change to explicit comparison with MagicCookieValue
hashicorp_packer
train
go
f14dbce168f74fe63e8b895405e375e6d05916c9
diff --git a/src/shogun2-core/shogun2-service/src/main/java/de/terrestris/shogun2/service/FileService.java b/src/shogun2-core/shogun2-service/src/main/java/de/terrestris/shogun2/service/FileService.java index <HASH>..<HASH> 100644 --- a/src/shogun2-core/shogun2-service/src/main/java/de/terrestris/shogun2/service/FileService.java +++ b/src/shogun2-core/shogun2-service/src/main/java/de/terrestris/shogun2/service/FileService.java @@ -59,12 +59,11 @@ public class FileService<E extends File, D extends FileDao<E>> * @return * @throws Exception */ - @SuppressWarnings("unchecked") - public File uploadFile(MultipartFile file) throws Exception { + public E uploadFile(MultipartFile file) throws Exception { InputStream is = null; byte[] fileByteArray = null; - File fileToPersist = getEntityClass().newInstance(); + E fileToPersist = getEntityClass().newInstance(); try { is = file.getInputStream();
addresses note of @buehner
terrestris_shogun-core
train
java
2ae1a45f2017fbaf945103912b368621e1969fc8
diff --git a/src/js/mixin/slider-autoplay.js b/src/js/mixin/slider-autoplay.js index <HASH>..<HASH> 100644 --- a/src/js/mixin/slider-autoplay.js +++ b/src/js/mixin/slider-autoplay.js @@ -35,7 +35,7 @@ export default { if (document.hidden) { this.stopAutoplay(); } else { - this.startAutoplay(); + !this.userInteracted && this.startAutoplay(); } } @@ -87,7 +87,7 @@ export default { this.stopAutoplay(); - if (this.autoplay && !this.userInteracted) { + if (this.autoplay) { this.interval = setInterval( () => !(this.isHovering && this.pauseOnHover) && !this.stack.length && this.show('next'), this.autoplayInterval
fix: autoplay in slider-drag after userinteraction
uikit_uikit
train
js
2c50d5c2c7bf34f26b2f6e605673a78cc3602602
diff --git a/client/deis.py b/client/deis.py index <HASH>..<HASH> 100755 --- a/client/deis.py +++ b/client/deis.py @@ -658,10 +658,13 @@ class DeisClient(object): -a --app=<app> the uniquely identifiable name for the application. """ + command = ' '.join(args.get('<command>')) + self._logger.info('Running `{}`...'.format(command)) + app = args.get('--app') if not app: app = self._session.app - body = {'command': ' '.join(args.get('<command>'))} + body = {'command': command} response = self._dispatch('post', "/api/apps/{}/run".format(app), json.dumps(body))
feat(client): add loading info msg to run command
deis_deis
train
py
50f9028106cfd8321186f3beead450980eaafbac
diff --git a/upup/pkg/kutil/delete_cluster.go b/upup/pkg/kutil/delete_cluster.go index <HASH>..<HASH> 100644 --- a/upup/pkg/kutil/delete_cluster.go +++ b/upup/pkg/kutil/delete_cluster.go @@ -35,7 +35,6 @@ import ( "strings" "sync" "time" - "os" ) const ( @@ -1313,14 +1312,6 @@ func ListAutoScalingGroups(cloud fi.Cloud, clusterName string) ([]*ResourceTrack return trackers, nil } -//func ListBastionLaunchConfigurations(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error) { -// c := cloud.(awsup.AWSCloud) -// -// glog.V(2).Infof("Listing all Autoscaling LaunchConfigurations for cluster %q", clusterName) -// var trackers []*ResourceTracker -// request := &autoscaling.DescribeLaunchConfigurationsInput{} -//} - func ListAutoScalingLaunchConfigurations(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error) { c := cloud.(awsup.AWSCloud)
Fixing for tests, removing old function
kubernetes_kops
train
go
0aa44073aafa725a8d83428140f15eb8c22f4814
diff --git a/addon/components/affinity-engine-stage.js b/addon/components/affinity-engine-stage.js index <HASH>..<HASH> 100644 --- a/addon/components/affinity-engine-stage.js +++ b/addon/components/affinity-engine-stage.js @@ -49,11 +49,11 @@ export default Component.extend({ window } = getProperties(this, 'initialScene', 'eBus', 'esBus', 'stageId', 'window'); - esBus.subscribe('shouldLoadScene', this, this._loadScene); esBus.subscribe('shouldStartScene', this, this._startScene); esBus.subscribe('shouldChangeScene', this, this._changeScene); if (stageId === 'main') { + eBus.subscribe('shouldLoadScene', this, this._loadScene); eBus.subscribe('restartingEngine', this, this._toInitialScene); eBus.subscribe('shouldLoadSceneFromPoint', this, this._loadSceneFromPoint);
put `shouldLoadScene` on eBus
affinity-engine_affinity-engine-stage
train
js
c4f04515c7ec1b2867dd1a7c69447c36bf749494
diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb @@ -991,6 +991,8 @@ module ActiveRecord case @connection.error_code(exception) when 1 RecordNotUnique.new(message) + when 942, 955 + ActiveRecord::StatementInvalid.new(message) when 2291 InvalidForeignKey.new(message) when 12899
Handle ORA-<I> and ORA-<I> as `ActiveRecord::StatementInvalid` not `NativeException` by JRuby <I>, <I>, "table or view does not exist" <I>, <I>, "name is already used by an existing object" Since rails/rails#<I> changes `translate_exception` to handle `RuntimeError` as exception
rsim_oracle-enhanced
train
rb
093354e23130741e6e4493a931d8b3641f6c4971
diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java index <HASH>..<HASH> 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.java @@ -93,7 +93,13 @@ public class EurekaClientAutoConfiguration { @Bean @ConditionalOnMissingBean(value = EurekaClientConfig.class, search = SearchStrategy.CURRENT) public EurekaClientConfigBean eurekaClientConfigBean() { - return new EurekaClientConfigBean(); + EurekaClientConfigBean client = new EurekaClientConfigBean(); + if ("bootstrap".equals(this.env.getProperty("spring.config.name"))) { + // We don't register during bootstrap by default, but there will be another + // chance later. + client.setRegisterWithEureka(false); + } + return client; } @Bean
Check if client is in bootstrap and default to not register Eureka now has the option (maybe always there) to not register and that's a sensible default in the bootstrap phase (when we might not know the port yet).
spring-cloud_spring-cloud-netflix
train
java
973d61490c01d785fbdeac7cd27254a8f45c92ad
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ def read(fname): setup( name = "reload", - version = "0.5", + version = "0.6", author = "Jarek Lipski", author_email = "pub@loomchild.net", description = ("Reload a program if any file in current directory changes."),
Bump to <I> due to packaging
loomchild_reload
train
py
ec73873cf7bfeeb7b4b2412468ad372fb16914a8
diff --git a/src/directives/glControls.js b/src/directives/glControls.js index <HASH>..<HASH> 100644 --- a/src/directives/glControls.js +++ b/src/directives/glControls.js @@ -12,6 +12,10 @@ angular.module('mapboxgl-directive').directive('glControls', [function () { navigation: { enabled: true | false, position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' + }, + scale: { + enabled: true | false, + position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' } @@ -44,6 +48,15 @@ angular.module('mapboxgl-directive').directive('glControls', [function () { map.addControl(mapboxGlControls.navigation); } + + // Scale Control + if (angular.isDefined(controls.scale) && angular.isDefined(controls.scale.enabled) && controls.scale.enabled) { + mapboxGlControls.scale = new mapboxgl.Scale({ + position: controls.scale.position || 'bottom-right' + }); + + map.addControl(mapboxGlControls.scale); + } }, true); }); }
Added support for Navigation and Scale controls
Naimikan_angular-mapboxgl-directive
train
js
7705dcf011279ea70b983fa9a18fec6c21adc2cf
diff --git a/src/main/java/org/openqa/selenium/WebDriver.java b/src/main/java/org/openqa/selenium/WebDriver.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/openqa/selenium/WebDriver.java +++ b/src/main/java/org/openqa/selenium/WebDriver.java @@ -84,12 +84,9 @@ public interface WebDriver extends SearchContext { /** * Find all elements within the current page using the given mechanism. - * This method is affected by the 'implicit wait' times in force at the time of execution. - * For example, that is 5 seconds, the findElements(..) after its first attempt to collect - * matching WebElements if there is at least one. If there were no matching WebElements - * after the first attempt, then the method will wait in line with the interval specified, - * then try again. It will keep going until it finds at least one WebElement in a pass, - * or the configured timeout is reached. + * This method is affected by the 'implicit wait' times in force at the time of execution. When + * implicitly waiting, this method will return as soon as there are more than 0 items in the + * found collection, or will return an empty list if the timeout is reached. * * @param by The locating mechanism to use * @return A list of all {@link WebElement}s, or an empty list if nothing matches
SimonStewart: Rewording some of the docs for findElements r<I>
appium_java-client
train
java
ae92fab74bdbe7b6eb508cd14aa26b8929eb725b
diff --git a/hearthstone/entities.py b/hearthstone/entities.py index <HASH>..<HASH> 100644 --- a/hearthstone/entities.py +++ b/hearthstone/entities.py @@ -61,6 +61,7 @@ class Game(Entity): self.initial_entities = [] self.initial_state = State.INVALID self.initial_step = Step.INVALID + self.initial_hero_entity_id = 0 @property def current_player(self): @@ -186,9 +187,14 @@ class Player(Entity): @property def starting_hero(self): + if self.initial_hero_entity_id: + return self.game.find_entity_by_id(self.initial_hero_entity_id) + + # Fallback heroes = list(self.heroes) if not heroes: return + return heroes[0] @property
entities: Implement Player.initial_hero_entity_id
HearthSim_python-hearthstone
train
py
056e2ffe1c75393d1e53c907a3baf36b3cc0f00f
diff --git a/lib/multirepo/branch.rb b/lib/multirepo/branch.rb index <HASH>..<HASH> 100644 --- a/lib/multirepo/branch.rb +++ b/lib/multirepo/branch.rb @@ -8,7 +8,9 @@ module MultiRepo end def exists? - return true + lines = Git.run(@repo.working_copy, "branch", false).split("\n") + branches = lines.map { |line| line.tr("* ", "")} + return branches.include?(@name) end def create @@ -17,7 +19,7 @@ module MultiRepo end def checkout - Git.run(@repo.working_copy, "checkout #{@name}", false) + Git.run(@repo.working_copy, "checkout #{@name}", false) return $?.exitstatus == 0 end end diff --git a/lib/multirepo/repo.rb b/lib/multirepo/repo.rb index <HASH>..<HASH> 100644 --- a/lib/multirepo/repo.rb +++ b/lib/multirepo/repo.rb @@ -39,8 +39,10 @@ module MultiRepo end end - # Create and switch to the appropriate branch - @branch.create unless @branch.exists? + unless @branch.exists? + if @branch.create then Console.log_info("Created branch #{branch.name}") end + end + if @branch.checkout Console.log_info("Checked out branch #{branch.name}") else
Implemented Branch.exists? and logging when we create a branch that didn't exist.
fortinmike_git-multirepo
train
rb,rb
4c93c12210bf9db9c3b506a1127fa0d10270aaa7
diff --git a/src/__tests__/bin.js b/src/__tests__/bin.js index <HASH>..<HASH> 100644 --- a/src/__tests__/bin.js +++ b/src/__tests__/bin.js @@ -3,7 +3,7 @@ const os = require("os"); const path = require("path"); const { bin } = require(".."); -const output = path.join(__dirname, "__output__"); +const output = path.join(__dirname, "..", "__output__"); const output1 = path.join(output, "1"); const output2 = path.join(output, "2"); diff --git a/src/bin.js b/src/bin.js index <HASH>..<HASH> 100644 --- a/src/bin.js +++ b/src/bin.js @@ -9,11 +9,7 @@ const optDefault = { conartist: [], description: "", name: "", - options: { - cwd: { - description: "Set the cwd." - } - }, + options: {}, version: "0.0.0" };
Remove cwd option. Move __output__ to dir that doesn't run tests.
treshugart_conartist
train
js,js
d4f4b8a7511d6e5e5ffb5f81c8cd52e7430820d8
diff --git a/src/wizard.js b/src/wizard.js index <HASH>..<HASH> 100644 --- a/src/wizard.js +++ b/src/wizard.js @@ -55,6 +55,13 @@ angular.module('mgo-angular-wizard').directive('wizard', function() { _.each($scope.getEnabledSteps(), function(step) { step.completed = true; }); + } else { + var completedStepsIndex = $scope.currentStepNumber() - 1; + angular.forEach($scope.getEnabledSteps(), function(step, stepIndex) { + if(stepIndex >= completedStepsIndex) { + step.completed = false; + } + }); } }, true);
corrected issue that only allowed edit mode to toggle once
angular-wizard_angular-wizard
train
js
da3092e6952d13d2e8c10ba028979a1da78fe591
diff --git a/src/main/java/redis/clients/jedis/ShardedJedisPool.java b/src/main/java/redis/clients/jedis/ShardedJedisPool.java index <HASH>..<HASH> 100644 --- a/src/main/java/redis/clients/jedis/ShardedJedisPool.java +++ b/src/main/java/redis/clients/jedis/ShardedJedisPool.java @@ -61,7 +61,17 @@ public class ShardedJedisPool extends Pool<ShardedJedis> { } public boolean validateObject(final Object obj) { - return true; + try { + ShardedJedis jedis = (ShardedJedis) obj; + for (Jedis shard : jedis.getAllShards()) { + if (!shard.isConnected() || !shard.ping().equals("PONG")) { + return false; + } + } + return true; + } catch (Exception ex) { + return false; + } } } } \ No newline at end of file
reverted back vetify() as connection checks could be disabled in pool config
xetorthio_jedis
train
java
6cd3cb9887668bdbe764719c789c9814f53a3aa2
diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index <HASH>..<HASH> 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -69,6 +69,7 @@ More detail and specific examples can be found in the included HTML file. var canvas = null, target = null, + options = null, maxRadius = null, centerLeft = null, centerTop = null,
Prevent options from becoming global. The pie plugin was a little too clever in its use of closures. In processDatapoints it set canvas, target, and options for use in other functions. Since options was not declared this meant that it became global. Pages containing multiple pie plots therefore saw a range of weird effects resulting from earlier plots receiving some of the options set by later ones. Resolves #<I>, resolves #<I>, resolves #<I>.
ni-kismet_engineering-flot
train
js
816fe5139829c7a29fb33d0d52e95e4343fea3ca
diff --git a/lib/sp/duh/sharding/sharded_namespace.rb b/lib/sp/duh/sharding/sharded_namespace.rb index <HASH>..<HASH> 100644 --- a/lib/sp/duh/sharding/sharded_namespace.rb +++ b/lib/sp/duh/sharding/sharded_namespace.rb @@ -25,15 +25,7 @@ module SP add_sharder(sharder) end - def get_table(shard_ids, table_name) - name = table_name - ids = shard_ids.reverse - sharders.reverse.each_with_index do |sharder, i| - name = sharder.get_table(ids[i], name) - end - name - end - + def get_sharded_table(shard_ids, table_name) ; sharders.any? ? sharders.last.get_sharded_table(shard_ids, table_name) : table_name ; end end end
Implement a get_sharded_table method in the ShardedNamespace that uses the last sharder to get the table name
vpfpinho_sp-duh
train
rb
b05f46a0500349dadda6886178c043d3b72fc392
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -582,7 +582,7 @@ class Builder /** * Add an "or where" clause to the query. * - * @param string|\Closure $column + * @param \Closure|string $column * @param string $operator * @param mixed $value * @return \Illuminate\Database\Query\Builder|static diff --git a/src/Illuminate/View/Factory.php b/src/Illuminate/View/Factory.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/View/Factory.php +++ b/src/Illuminate/View/Factory.php @@ -792,7 +792,7 @@ class Factory implements FactoryContract /** * Add new loop to the stack. * - * @param array|\Countable $data + * @param \Countable|array $data * @return void */ public function addLoop($data)
Fix some phpdoc inconsistencies
laravel_framework
train
php,php
f8bf5cb52cd08e3d76695b94446fb4ee5adbd64b
diff --git a/src/ServiceContainer/WordpressBehatExtension.php b/src/ServiceContainer/WordpressBehatExtension.php index <HASH>..<HASH> 100644 --- a/src/ServiceContainer/WordpressBehatExtension.php +++ b/src/ServiceContainer/WordpressBehatExtension.php @@ -69,7 +69,7 @@ class WordpressBehatExtension implements ExtensionInterface $builder ->children() ->enumNode('default_driver') - ->values(['wpcli']) + ->values(['wpcli', 'wpapi', 'blackbox']) ->defaultValue('wpcli') ->end()
Add all 3 drivers to YAML whitelist.
paulgibbs_behat-wordpress-extension
train
php
a67069b1656fefb629e962bdfc2ab836ff5bd6d2
diff --git a/lib/glimr_api_client/api.rb b/lib/glimr_api_client/api.rb index <HASH>..<HASH> 100644 --- a/lib/glimr_api_client/api.rb +++ b/lib/glimr_api_client/api.rb @@ -4,7 +4,6 @@ require 'active_support/core_ext/object/to_query' module GlimrApiClient module Api - def post @post ||= client.post(path: endpoint, body: request_body.to_query).tap { |resp| @@ -45,8 +44,7 @@ module GlimrApiClient 'Content-Type' => 'application/json', 'Accept' => 'application/json' }, - persistent: true, - connect_timeout: 15 + persistent: true ) end end diff --git a/lib/glimr_api_client/version.rb b/lib/glimr_api_client/version.rb index <HASH>..<HASH> 100644 --- a/lib/glimr_api_client/version.rb +++ b/lib/glimr_api_client/version.rb @@ -1,3 +1,3 @@ module GlimrApiClient - VERSION = '0.1.4' + VERSION = '0.1.5' end
Stop mutation tests from breaking for now I need to properly stub out the connection_timeout to keep it from being susceptible to mutation. However, the higher priority at the moment is getting the CI working again so that master branch protection can be turned on on github. This resolves the problem by going back to the default timeout. I'll redo this again in a feature branch at a future date.
ministryofjustice_glimr-api-client
train
rb,rb
d9890e7694ecdde2750e2279eeff8a6b6d824c69
diff --git a/src/edeposit/amqp/harvester/autoparser/path_patterns.py b/src/edeposit/amqp/harvester/autoparser/path_patterns.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/harvester/autoparser/path_patterns.py +++ b/src/edeposit/amqp/harvester/autoparser/path_patterns.py @@ -46,9 +46,16 @@ def neighbours_pattern(element): #TODO: test return [] parent = element.parent - neighbours = parent.childs - element_index = neighbours.index(element) + # filter only visible tags/neighbours + neighbours = filter( + lambda x: x.isTag() or x.getContent().strip() or x is element, + parent.childs + ) + if len(neighbours) <= 1: + return [] + + element_index = neighbours.index(element) output = [] # pick left neighbour @@ -58,9 +65,9 @@ def neighbours_pattern(element): #TODO: test ) # pick right neighbour - if element_index < len(neighbours) - 2: + if element_index + 2 < len(neighbours): output.append( - neighbour_to_path_call("right", neighbours[element_index + 1]) + neighbour_to_path_call("right", neighbours[element_index + 2]) ) return output
#<I>: Fixed few bugs in path_patterns.py / neighbours_pattern()
edeposit_edeposit.amqp.harvester
train
py
212b4ecba6bfe8016528cfe115bafc805a49b2e1
diff --git a/nodeshot/interop/sync/tests.py b/nodeshot/interop/sync/tests.py index <HASH>..<HASH> 100755 --- a/nodeshot/interop/sync/tests.py +++ b/nodeshot/interop/sync/tests.py @@ -623,11 +623,7 @@ class SyncTest(TestCase): # limit pagination to 1 in geojson view url = reverse('api_layer_nodes_geojson', args=[layer.slug]) response = self.client.get('%s?limit=1&page=2' % url) - self.assertEqual(len(response.data['results']), 1) - self.assertIn(settings.SITE_URL, response.data['previous']) - self.assertIn(url, response.data['previous']) - self.assertIn(settings.SITE_URL, response.data['next']) - self.assertIn(url, response.data['next']) + self.assertEqual(len(response.data['features']), 1) def test_nodeshot_sync_exceptions(self): layer = Layer.objects.external()[0]
interop.sync: updated failing test introduced with <I>a<I>a
ninuxorg_nodeshot
train
py
aee5adeb3871b1758036688ae54d2bd89602007f
diff --git a/astrobase/lcproc.py b/astrobase/lcproc.py index <HASH>..<HASH> 100644 --- a/astrobase/lcproc.py +++ b/astrobase/lcproc.py @@ -1154,6 +1154,7 @@ def timebinlc_worker(task): def parallel_timebin_lclist(lclist, binsizesec, + maxobjects=None, outdir=None, lcformat='hat-sql', timecols=None, @@ -1170,6 +1171,9 @@ def parallel_timebin_lclist(lclist, if outdir and not os.path.exists(outdir): os.mkdir(outdir) + if maxobjects is not None: + lclist = lclist[:maxobjects] + tasks = [(x, binsizesec, {'outdir':outdir, 'lcformat':lcformat, 'timecols':timecols, @@ -1190,6 +1194,7 @@ def parallel_timebin_lclist(lclist, def parallel_timebin_lcdir(lcdir, binsizesec, + maxobjects=None, outdir=None, lcformat='hat-sql', timecols=None, @@ -1215,6 +1220,7 @@ def parallel_timebin_lcdir(lcdir, return parallel_timebin_lclist(lclist, binsizesec, + maxobjects=maxobjects, outdir=outdir, lcformat=lcformat, timecols=timecols,
lcproc: add parallel LC binning functions
waqasbhatti_astrobase
train
py
aed603cb42b9347d929744c8c8b2a29c9c1aa2a5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,6 @@ if sys.version_info < (2, 6): print >> sys.stderr, error sys.exit(1) -extra = dict() - try: from setuptools import setup, find_packages from setuptools.command.test import test as testcommand @@ -120,6 +118,8 @@ except ImportError as err: print "Proceeding anyway with manual replacements for setuptools.find_packages." print "Try installing setuptools if you continue to have problems.\n\n" + extra = dict() + VERSION = __import__('pylti').VERSION README = open('README.rst').read()
Moved extra declaration to line <I> per iceraj's request.
mitodl_pylti
train
py
496ffd49aae375bc7ad95a63e91d1008e6dc4f01
diff --git a/core-bundle/src/Resources/contao/library/Contao/Model.php b/core-bundle/src/Resources/contao/library/Contao/Model.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Model.php +++ b/core-bundle/src/Resources/contao/library/Contao/Model.php @@ -96,10 +96,10 @@ abstract class Model if ($objResult !== null) { $arrRelated = array(); - $this->setRow($objResult->row()); // see #5439 + $arrData = $objResult->row(); // Look for joined fields - foreach ($this->arrData as $k=>$v) + foreach ($arrData as $k=>$v) { if (strpos($k, '__') !== false) { @@ -111,7 +111,7 @@ abstract class Model } $arrRelated[$key][$field] = $v; - unset($this->arrData[$k]); + unset($arrData[$k]); } } @@ -132,6 +132,8 @@ abstract class Model $this->arrRelated[$key]->setRow($row); } } + + $this->setRow($arrData); // see #5439 } $this->objResult = $objResult;
[Core] Strip the related fields before passing a DB result to `Model::setRow()` (see #<I>)
contao_contao
train
php
d04725e272d747481baaa35a3bc9e6b752ba4198
diff --git a/spec/cases/helper.rb b/spec/cases/helper.rb index <HASH>..<HASH> 100644 --- a/spec/cases/helper.rb +++ b/spec/cases/helper.rb @@ -2,7 +2,7 @@ require 'bundler/setup' require 'parallel' def process_diff - cmd = "ps uaxw|grep ruby|wc -l" + cmd = "ps uxw|grep ruby|wc -l" processes_before = `#{cmd}`.to_i
only check for our processes by @simcha I got no errors on my local run and travis got different errors on my copy of same tree: <URL>
grosser_parallel
train
rb
e3a77e54f6b4201c2c744e604d1c05097ae48656
diff --git a/java/core/libjoynr/src/main/java/io/joynr/pubsub/publication/PublicationManagerImpl.java b/java/core/libjoynr/src/main/java/io/joynr/pubsub/publication/PublicationManagerImpl.java index <HASH>..<HASH> 100644 --- a/java/core/libjoynr/src/main/java/io/joynr/pubsub/publication/PublicationManagerImpl.java +++ b/java/core/libjoynr/src/main/java/io/joynr/pubsub/publication/PublicationManagerImpl.java @@ -229,6 +229,9 @@ public class PublicationManagerImpl implements PublicationManager { BroadcastSubscriptionRequest subscriptionRequest, RequestCaller requestCaller) { logger.info("adding broadcast publication: " + subscriptionRequest.toString()); + BroadcastListener broadcastListener = new BroadcastListenerImpl(subscriptionRequest.getSubscriptionId(), this); + String broadcastName = subscriptionRequest.getSubscribedToName(); + requestCaller.registerBroadcastListener(broadcastName, broadcastListener); }
java: broadcasts: register broadcastListener at provider register broadcastListener in publication Manager on the provider side. Change-Id: I<I>bc<I>b<I>dbab<I>ac2ca4b9fd8f<I>afdb
bmwcarit_joynr
train
java
8d0595a73cebb9660e952e2b96684032a73a880e
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -244,10 +244,6 @@ var config = require('./core/server/config'), 'yarn; git submodule foreach "git checkout master && git pull ' + upstream + ' master"'; } - }, - - dbhealth: { - command: 'knex-migrator health' } }, @@ -715,7 +711,7 @@ var config = require('./core/server/config'), // `grunt master` [`upstream` is the default upstream to pull from] // `grunt master --upstream=parent` grunt.registerTask('master', 'Update your current working folder to latest master.', - ['shell:master', 'subgrunt:init', 'shell:dbhealth'] + ['shell:master', 'subgrunt:init'] ); // ### Release
Removed `shell:dbhealth` from `grunt master` no issue - since Ghost <I>, the Ghost server takes care of executing `knex-migrator migrate` if needed
TryGhost_Ghost
train
js
9f2371ee91a5c2c6b3c0a80df543d4078565d4da
diff --git a/test/unit/deletion_test.rb b/test/unit/deletion_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/deletion_test.rb +++ b/test/unit/deletion_test.rb @@ -11,7 +11,7 @@ class DeletionTest < ActiveSupport::TestCase @version = Version.last end - should "must be indexed" do + should "be indexed" do @version.indexed = false assert Deletion.new(version: @version, user: @user).invalid?, "Deletion should only work on indexed gems"
use should 'be indexed' phrase instead of should 'must be indexed'
rubygems_rubygems.org
train
rb
4260b0c765f956f13553c1ca56368b4b010523c2
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java index <HASH>..<HASH> 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java @@ -36,7 +36,7 @@ import org.springframework.util.StringUtils; * @author Dave Syer * @author Andy Wilkinson */ -@ConfigurationProperties(prefix = "security", ignoreUnknownFields = false) +@ConfigurationProperties(prefix = "security") public class SecurityProperties implements SecurityPrerequisite { /**
Remove ignoreUnknownFields accidentally added in <I>a<I>
spring-projects_spring-boot
train
java
bf5bb717a528767550be9a9d963acea797f7cab9
diff --git a/aeron-system-tests/src/test/java/io/aeron/DriverNameResolverTest.java b/aeron-system-tests/src/test/java/io/aeron/DriverNameResolverTest.java index <HASH>..<HASH> 100644 --- a/aeron-system-tests/src/test/java/io/aeron/DriverNameResolverTest.java +++ b/aeron-system-tests/src/test/java/io/aeron/DriverNameResolverTest.java @@ -238,7 +238,7 @@ public class DriverNameResolverTest @SlowTest @Test - @Timeout(20) + @Timeout(30) public void shouldTimeoutNeighborsAndCacheEntriesThatAreSeenViaGossip() { drivers.add(TestMediaDriver.launch(setDefaults(new MediaDriver.Context())
[Java] Increase timeout on shouldTimeoutNeighborsAndCacheEntriesThatAreSeenViaGossip test as occasionally a second timeout cycle within the name resolver is required to remove a neighbor.
real-logic_aeron
train
java
b7d7066a124445b7a0b12e31a9d9c48988cba7cb
diff --git a/pixiedust/display/templates/pd_executeDisplay.js b/pixiedust/display/templates/pd_executeDisplay.js index <HASH>..<HASH> 100644 --- a/pixiedust/display/templates/pd_executeDisplay.js +++ b/pixiedust/display/templates/pd_executeDisplay.js @@ -112,7 +112,20 @@ } var query = groups.join("&") if (query){ - window.history.pushState("PixieApp", "", "?" + query); + var queryPos = window.location.href.indexOf("?"); + newUrl = "?" + query; + if (queryPos > 0){ + var existingQuery = window.location.href.substring(queryPos+1); + var args = existingQuery.split("&"); + {#Keep only the token argument#} + for (i in args){ + var parts = args[i].split("="); + if (parts.length > 1 && parts[0] == "token"){ + newUrl += "&token=" + parts[1]; + } + } + } + window.history.pushState("PixieApp", "", newUrl); } {%else%} if (curCell){
Correctly handle token urls when state is pushed to the location
pixiedust_pixiedust
train
js
e19d82aa035b7f3b6519c0986fb39258062376a5
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -150,6 +150,27 @@ class TestRequestsPost(unittest.TestCase): def test_cached_post_response_text(self): self.assertEqual(self.unmolested_response.text, self.cached_response.text) +class TestRequestsHTTPS(unittest.TestCase): + def setUp(self): + self.unmolested_response = requests.get('https://github.com') + with vcr.use_cassette(TEST_CASSETTE_FILE): + self.initial_response = requests.get('https://github.com') + self.cached_response = requests.get('https://github.com') + + def tearDown(self): + try: + os.remove(TEST_CASSETTE_FILE) + except OSError: + pass + + def test_initial_https_response_text(self): + self.assertEqual(self.unmolested_response.text, self.initial_response.text) + + def test_cached_https_response_text(self): + self.assertEqual(self.unmolested_response.text, self.cached_response.text) + + + if __name__ == '__main__': unittest.main()
Add failing test for HTTPS requests to shame me into fixing this bug
kevin1024_vcrpy
train
py
e90fda3bd26ea5ef73f596a5ac5aa9eccd46ee66
diff --git a/jquery.fullscreen.js b/jquery.fullscreen.js index <HASH>..<HASH> 100644 --- a/jquery.fullscreen.js +++ b/jquery.fullscreen.js @@ -88,10 +88,7 @@ function fullScreen(state) || (/** @type {?Function} */ e["mozRequestFullScreen"]); if (func) { - if (Element["ALLOW_KEYBOARD_INPUT"]) - func.call(e, Element["ALLOW_KEYBOARD_INPUT"]); - else - func.call(e); + func.call(e); } return this; }
Stop using ALLOW_KEYBOARD_INPUT. In Chrome it no longer makes a difference and in Safari it doesn't help anyway (Fullscreen forms are always read-only). In older Safari the code didn't work at all so I hope this is now better.
kayahr_jquery-fullscreen-plugin
train
js
195c16e06ab32fc90c8c450c10006e886f49eb81
diff --git a/src/java/com/samskivert/swing/MultiLineLabel.java b/src/java/com/samskivert/swing/MultiLineLabel.java index <HASH>..<HASH> 100644 --- a/src/java/com/samskivert/swing/MultiLineLabel.java +++ b/src/java/com/samskivert/swing/MultiLineLabel.java @@ -3,7 +3,7 @@ // // samskivert library - useful routines for java programs // Copyright (C) 2001-2007 Michael Bayne -// +// // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 2.1 of the License, or @@ -30,6 +30,8 @@ import javax.swing.JComponent; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; +import com.samskivert.swing.util.SwingUtil; + /** * A Swing component that displays a {@link Label}. */ @@ -248,7 +250,14 @@ public class MultiLineLabel extends JComponent } // draw the label + Object oalias = null; + if (_antialiased) { + oalias = SwingUtil.activateAntiAliasing(gfx); + } _label.render(gfx, dx, dy); + if (_antialiased) { + SwingUtil.restoreAntiAliasing(gfx, oalias); + } } // documentation inherited
It used to be that if you created a TextLayout with a font render context that indicated the use of antialiasing, rendering that TextLayout would render with antialiasing. However, it seems that some JVMs don't do that, so we need to manually enable antialiasing before rendering the TextLayout. Such are the millions of tiny inconsistencies that undermine write once run anywhere. git-svn-id: <URL>
samskivert_samskivert
train
java
76ccaf37d92f760ed812b84ecb1301d3d09e9d63
diff --git a/examples/FloatTest.php b/examples/FloatTest.php index <HASH>..<HASH> 100644 --- a/examples/FloatTest.php +++ b/examples/FloatTest.php @@ -17,4 +17,17 @@ class FloatTest extends \PHPUnit_Framework_TestCase ); }); } + + public function testAPropertyHoldingOnlyForPositiveNumbers() + { + $this->forAll([ + Generator\float(-10.0, 100.0), + ]) + ->then(function($number) { + $this->assertTrue( + $number >= 0, + "$number is not a (loosely) positive number" + ); + }); + } } diff --git a/test/Eris/ExampleEnd2EndTest.php b/test/Eris/ExampleEnd2EndTest.php index <HASH>..<HASH> 100644 --- a/test/Eris/ExampleEnd2EndTest.php +++ b/test/Eris/ExampleEnd2EndTest.php @@ -47,7 +47,7 @@ class ExampleEnd2EndTest extends \PHPUnit_Framework_TestCase public function testFloatTests() { $this->runExample('FloatTest.php'); - $this->assertAllTestsArePassing(); + $this->assertTestsAreFailing(1); } public function testSumTests()
Added a failing test to explore float shrinking
giorgiosironi_eris
train
php,php
65d9e5084af00e35a1f5184700f13be978c0b4ab
diff --git a/src/Message/PurchaseRequest.php b/src/Message/PurchaseRequest.php index <HASH>..<HASH> 100644 --- a/src/Message/PurchaseRequest.php +++ b/src/Message/PurchaseRequest.php @@ -94,10 +94,10 @@ class PurchaseRequest extends AbstractRequest public function getData() { $this->validate('amount', 'card'); - // FIXME -- this won't work if there is no card. - $data['email'] = $this->getCard()->getEmail(); $data = array(); + // FIXME -- this won't work if there is no card. + $data['email'] = $this->getCard()->getEmail(); $data['amount'] = $this->getAmountInteger(); $data['currency'] = strtolower($this->getCurrency()); $data['description'] = $this->getDescription();
Update PurchaseRequest.php Create $data before setting email. Email was not being passed to gateway.
thephpleague_omnipay-pin
train
php
a303c1197a2bfc5308f05d07811c56c3dd74bed3
diff --git a/src/main/java/net/openhft/compiler/MyJavaFileManager.java b/src/main/java/net/openhft/compiler/MyJavaFileManager.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/openhft/compiler/MyJavaFileManager.java +++ b/src/main/java/net/openhft/compiler/MyJavaFileManager.java @@ -99,7 +99,7 @@ class MyJavaFileManager implements JavaFileManager { return fileManager.isSameFile(a, b); } - public boolean handleOption(String current, Iterator<String> remaining) { + public synchronized boolean handleOption(String current, Iterator<String> remaining) { return fileManager.handleOption(current, remaining); }
Fixed ConcurrentModificationException when compiling lots of method readers under Java <I>, closes #<I> (#<I>)
OpenHFT_Java-Runtime-Compiler
train
java
6db8d7918dbb2c769858c0e89c2f027e3ee33757
diff --git a/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/main.js b/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/main.js index <HASH>..<HASH> 100644 --- a/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/main.js +++ b/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain, shell } = require('electron') +const { app, BrowserWindow, ipcMain, shell, dialog } = require('electron') const path = require('path') let mainWindow;
fix: dialog is not defined (#<I>) Corrects the following error in Electron Fiddle: ``` Uncaught Exception: ReferenceError: dialog is not defined ... ```
electron_electron
train
js
54409cf3f9c5c51acd35881a41f1657a12cff1f1
diff --git a/Socket/Client.php b/Socket/Client.php index <HASH>..<HASH> 100644 --- a/Socket/Client.php +++ b/Socket/Client.php @@ -102,7 +102,7 @@ class sb_Socket_Client { * @return boolean */ public function write($data) { - $this->log('write to socket'); + return fwrite($this->socket, $data); } @@ -140,7 +140,7 @@ class sb_Socket_Client { /** * Logs what is doing - * @param <type> $message + * @param string $message * @todo convert to sb_Logger */ protected function log($message) {
no longer writes WRITING TO SOCKET for every write
surebert_surebert-framework
train
php
ac8f1d16f294313cad13123147c56ffbd0e27a95
diff --git a/core/Columns/Updater.php b/core/Columns/Updater.php index <HASH>..<HASH> 100644 --- a/core/Columns/Updater.php +++ b/core/Columns/Updater.php @@ -200,7 +200,7 @@ class Updater extends \Piwik\Updates $component = $componentPrefix . $columnName; $version = $dimension->getVersion(); - if (in_array($columnName, $columns) + if (array_key_exists($columnName, $columns) && false === PiwikUpdater::getCurrentRecordedComponentVersion($component) && self::wasDimensionMovedFromCoreToPlugin($component, $version)) { PiwikUpdater::recordComponentSuccessfullyUpdated($component, $version);
we actually need to check whether key exists, not in_array...
matomo-org_matomo
train
php
475907500b27fcc51508651f12b23dc93cd93791
diff --git a/src/streamcorpus_pipeline/_get_name_info.py b/src/streamcorpus_pipeline/_get_name_info.py index <HASH>..<HASH> 100644 --- a/src/streamcorpus_pipeline/_get_name_info.py +++ b/src/streamcorpus_pipeline/_get_name_info.py @@ -29,8 +29,11 @@ def get_name_info(chunk_path, assert_one_date_hour=False, i_str=None): date_hours = set() target_names = set() doc_ids = set() + epoch_ticks = None count = 0 for si in ch: + if epoch_ticks is None: + epoch_ticks = si.stream_time.epoch_ticks date_hours.add( si.stream_time.zulu_timestamp[:13] ) doc_ids.add( si.doc_id ) for annotator_id, ratings in si.ratings.items(): @@ -42,6 +45,7 @@ def get_name_info(chunk_path, assert_one_date_hour=False, i_str=None): ## create the md5 property, so we can use it in the filename name_info['md5'] = ch.md5_hexdigest name_info['num'] = count + name_info['epoch_ticks'] = epoch_ticks name_info['target_names'] = '-'.join( target_names ) name_info['doc_ids_8'] = '-'.join( [di[:8] for di in doc_ids] )
Output filenames can include the epoch_ticks of the first stream item
trec-kba_streamcorpus-pipeline
train
py
a00c352ebf7c726507da18c95a0d32ab743eda40
diff --git a/pliers/filters/__init__.py b/pliers/filters/__init__.py index <HASH>..<HASH> 100644 --- a/pliers/filters/__init__.py +++ b/pliers/filters/__init__.py @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod from pliers.transformers import Transformer from six import with_metaclass +from pliers.utils import memory __all__ = [] @@ -9,12 +10,20 @@ __all__ = [] class Filter(with_metaclass(ABCMeta, Transformer)): ''' Base class for Filters.''' + def __init__(self): + super(Filter, self).__init__() + self.filter = memory.cache(self.filter) + def filter(self, stim, *args, **kwargs): - return self._filter(stim, *args, **kwargs) + new_stim = self._filter(stim, *args, **kwargs) + if not isinstance(new_stim, stim.__class__): + raise ValueError("Filter must return a Stim of the same type as " + "its input.") + return new_stim @abstractmethod def _filter(self, stim): pass def _transform(self, stim, *args, **kwargs): - return self.filter(stim, *args, **kwargs) \ No newline at end of file + return self.filter(stim, *args, **kwargs)
cache Filter results and ensure type matching
tyarkoni_pliers
train
py
e55408624db2d2633460d350279dc049f37086fa
diff --git a/peewee.py b/peewee.py index <HASH>..<HASH> 100644 --- a/peewee.py +++ b/peewee.py @@ -555,13 +555,13 @@ class ForeignKeyField(IntegerField): class BaseModel(type): def __new__(cls, name, bases, attrs): cls = super(BaseModel, cls).__new__(cls, name, bases, attrs) - + class Meta(object): fields = {} def __init__(self, model_class): self.model_class = model_class - self.database = database + self.database = self.model_class.database def get_field_by_name(self, name): if name in self.fields: @@ -637,6 +637,7 @@ class BaseModel(type): class Model(object): __metaclass__ = BaseModel + database = database def __init__(self, *args, **kwargs): for k, v in kwargs.items():
Allow a db to be specified on the model
coleifer_peewee
train
py
9bf2e4e37a58924944940f78b593928f5f9aae79
diff --git a/src/lib/componentloader.js b/src/lib/componentloader.js index <HASH>..<HASH> 100644 --- a/src/lib/componentloader.js +++ b/src/lib/componentloader.js @@ -7,7 +7,7 @@ const registryBaseUrl = 'https://aframe.io/aframe-registry/build/'; * Asynchronously load and register components from the registry. */ function ComponentLoader () { - this.components = null; + this.components = []; this.loadFromRegistry(); } @@ -22,8 +22,12 @@ ComponentLoader.prototype = { xhr.open('GET', registryBaseUrl + getMajorVersion(AFRAME.version) + '.json'); xhr.onload = () => { - this.components = JSON.parse(xhr.responseText).components; - console.info('Components in registry:', Object.keys(this.components).length); + if (xhr.status === 404) { + console.error('Error loading registry file: 404'); + } else { + this.components = JSON.parse(xhr.responseText).components; + console.info('Components in registry:', Object.keys(this.components).length); + } }; xhr.onerror = () => { console.error('Error loading registry file.'); }; xhr.send();
Fixes #<I> - Inspector panel doesnt works if registry build fails
aframevr_aframe-inspector
train
js
89c9febdf945484e2a65dcceb0c8fc69540a1e30
diff --git a/lib/traject/solr_json_writer.rb b/lib/traject/solr_json_writer.rb index <HASH>..<HASH> 100644 --- a/lib/traject/solr_json_writer.rb +++ b/lib/traject/solr_json_writer.rb @@ -167,9 +167,11 @@ class Traject::SolrJsonWriter end # Returns MARC 001, then a slash, then output_hash["id"] -- if both - # are present. Otherwise may return just one, or even an empty string. + # are present. Otherwise may return just one, or even an empty string. def record_id_from_context(context) - marc_id = context.source_record && context.source_record['001'] && context.source_record['001'].value + marc_id = if context.source_record && context.source_record.kind_of?(MARC::Record) + context.source_record['001'].value + end output_id = context.output_hash["id"] return [marc_id, output_id].compact.join("/")
SolrJsonWriter, guard marc-specific in record_id_from_context
traject_traject
train
rb
08e7c07b04775f9db6e03cad6011565248c5eb81
diff --git a/lib/filterlib.php b/lib/filterlib.php index <HASH>..<HASH> 100644 --- a/lib/filterlib.php +++ b/lib/filterlib.php @@ -397,6 +397,8 @@ class legacy_filter extends moodle_text_filter { if ($this->courseid) { // old filters are called only when inside courses return call_user_func($this->filterfunction, $this->courseid, $text); + } else { + return $text; } } }
"MDL-<I>, legacy_filter should return text even courseid is null, all text in user context will be empty"
moodle_moodle
train
php
d7ee0049928e7131a7fc64bdb3891f5d3e0e282a
diff --git a/lib/chatterbot/search.rb b/lib/chatterbot/search.rb index <HASH>..<HASH> 100644 --- a/lib/chatterbot/search.rb +++ b/lib/chatterbot/search.rb @@ -8,7 +8,8 @@ module Chatterbot # modify a query string to exclude retweets from searches # def exclude_retweets(q) - q.include?("include:retweets") ? q : q += " -include:retweets" + q + #q.include?("include:retweets") ? q : q += " -include:retweets" end # internal search code
disable exclude_retweets for the moment -- this is a breaking change
muffinista_chatterbot
train
rb
ea27cc5f4e9b463b51cddb0fc1c4690401cadd78
diff --git a/es5-persistence/src/test/java/com/netflix/conductor/dao/es5/index/TestElasticSearchRestDAOV5.java b/es5-persistence/src/test/java/com/netflix/conductor/dao/es5/index/TestElasticSearchRestDAOV5.java index <HASH>..<HASH> 100644 --- a/es5-persistence/src/test/java/com/netflix/conductor/dao/es5/index/TestElasticSearchRestDAOV5.java +++ b/es5-persistence/src/test/java/com/netflix/conductor/dao/es5/index/TestElasticSearchRestDAOV5.java @@ -292,7 +292,7 @@ public class TestElasticSearchRestDAOV5 { @Test public void testSearchArchivableWorkflows() throws IOException { String workflowId = "search-workflow-id"; - Long time = DateTime.now().minusDays(2).toDate().getTime(); + Long time = DateTime.now().minusDays(7).toDate().getTime(); workflow.setWorkflowId(workflowId); workflow.setStatus(Workflow.WorkflowStatus.COMPLETED); @@ -305,7 +305,7 @@ public class TestElasticSearchRestDAOV5 { assertTrue(indexExists("conductor")); await() - .atMost(3, TimeUnit.SECONDS) + .atMost(5, TimeUnit.SECONDS) .untilAsserted( () -> { List<String> searchIds = indexDAO.searchArchivableWorkflows("conductor",1);
Trying to increase timeouts for the search to be successful.
Netflix_conductor
train
java
83f43ae25937bddf838996ffbea3f24848b5f878
diff --git a/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb b/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb index <HASH>..<HASH> 100644 --- a/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb +++ b/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb @@ -9,13 +9,13 @@ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. -require_relative '../c7000/logical_interconnect_group' +require_relative '../../api500/synergy/logical_interconnect_group' module OneviewSDK module API600 module Synergy # Logical interconnect group resource implementation for API600 Synergy - class LogicalInterconnectGroup < OneviewSDK::API600::C7000::LogicalInterconnectGroup + class LogicalInterconnectGroup < OneviewSDK::API500::Synergy::LogicalInterconnectGroup end end end
resource to API <I> Synergy The resource was set to C<I>, but most of the Logical Interconnect Group functionality for the Synergy are build in '../../api<I>/synergy'. The recource for api<I> is also set to api<I>.
HewlettPackard_oneview-sdk-ruby
train
rb
f900f55913ad9b0a85167e98b19bc71ce3c8a598
diff --git a/protocol-designer/src/components/BatchEditForm/index.js b/protocol-designer/src/components/BatchEditForm/index.js index <HASH>..<HASH> 100644 --- a/protocol-designer/src/components/BatchEditForm/index.js +++ b/protocol-designer/src/components/BatchEditForm/index.js @@ -190,8 +190,14 @@ export const BatchEditMoveLiquid = ( props: BatchEditMoveLiquidProps ): React.Node => { const { propsForFields, handleCancel, handleSave } = props - const [cancelButtonTargetProps, cancelButtonTooltipProps] = useHoverTooltip() - const [saveButtonTargetProps, saveButtonTooltipProps] = useHoverTooltip() + const [cancelButtonTargetProps, cancelButtonTooltipProps] = useHoverTooltip({ + placement: 'top', + strategy: 'fixed', + }) + const [saveButtonTargetProps, saveButtonTooltipProps] = useHoverTooltip({ + placement: 'top', + strategy: 'fixed', + }) const disableSave = !props.batchEditFormHasChanges return (
fix(protocol-designer): Update tooltip placement to avoid deckmap conflict (#<I>)
Opentrons_opentrons
train
js
74bcb95ad7900e0a6ab4202c60b8cce557de0275
diff --git a/lib/eldritch/safe.rb b/lib/eldritch/safe.rb index <HASH>..<HASH> 100644 --- a/lib/eldritch/safe.rb +++ b/lib/eldritch/safe.rb @@ -20,6 +20,6 @@ module Eldritch # extend Eldritch::DSL # for async method declaration # end def self.inject_dsl - Object.include Eldritch::DSL + Object.send :include, Eldritch::DSL end end
made inject_dsl <I> compatible Apparently include used to be private
dotboris_eldritch
train
rb
bc348bc3bd2fa7c3cf1dcebdd997d4dd704909f1
diff --git a/bin/bootstrap.js b/bin/bootstrap.js index <HASH>..<HASH> 100755 --- a/bin/bootstrap.js +++ b/bin/bootstrap.js @@ -189,9 +189,9 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); var extensions = ['js', 'coffee', 'json']; var basenames = [path, path + '/index']; var paths = []; - extensions.forEach(function(extension) { - basenames.forEach(function(basename) { - paths.push(fs.pathJoin(dir, basename)); + basenames.forEach(function(basename) { + paths.push(fs.pathJoin(dir, basename)); + extensions.forEach(function(extension) { paths.push(fs.pathJoin(dir, [basename, extension].join('.'))); }); });
Refactor to remove unnecessary entries in paths array
casperjs_casperjs
train
js
125e54db53796dd20a662cefdff5d7596dda55fb
diff --git a/lib/targetStore.js b/lib/targetStore.js index <HASH>..<HASH> 100644 --- a/lib/targetStore.js +++ b/lib/targetStore.js @@ -24,6 +24,8 @@ module.exports = function(options) { req.errorEventKey = 'error::' + nextRequestId(); var respond = function(filePath) { + //remove error event since it is no longer needed + eventDispatcher.removeAllListeners(req.errorEventKey); // logger.debug('responding with: ', filePath); clearTimeout(clientRequestTimeout); sendResponseToClient(req, res, filePath);
Fix: removing error callbacks on success
berlinonline_converjon
train
js
b0bfc80ab7ebf5f47d28930ad5f0a5d6d0c17405
diff --git a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/tunnel/TunnelRESTService.java b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/tunnel/TunnelRESTService.java index <HASH>..<HASH> 100644 --- a/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/tunnel/TunnelRESTService.java +++ b/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/rest/tunnel/TunnelRESTService.java @@ -109,8 +109,11 @@ public class TunnelRESTService { } /** - * Deletes the tunnels having the given UUIDs, effectively closing the - * tunnels and killing the associated connections. + * Applies the given tunnel patches. This operation currently only supports + * deletion of tunnels through the "remove" patch operation. Deleting a + * tunnel effectively closing the tunnel and kills the associated + * connection. The path of each patch operation is of the form "/UUID" + * where UUID is the UUID of the tunnel being modified. * * @param authToken * The authentication token that is used to authenticate the user
GUAC-<I>: Fix patchTunnels() documentation - it's not technically purely deletion anymore.
glyptodon_guacamole-client
train
java
e8f4366f03efafeec3c1558e5241b6e6e5fbe6a5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ module.exports = { return path.relative(this.project.root, require.resolve(npmCompilerPath)); }, included: function (app) { - this._super.included(app); + this._super.included.apply(this, arguments); if (app.env === 'production' || app.env === 'test') { return;
fix: apply included function with arguments instead of app This is the "recommended" way as seen in <URL>` it causes some issues with ember-decorators and the next ember-cli-typescript version. This will prevent others from having to dive in on why this happens if you try to port your addon to use these addons.
adopted-ember-addons_ember-cli-hot-loader
train
js
45c2582d7a941ccb181b7ca4be9036ffea926a84
diff --git a/textplot/text.py b/textplot/text.py index <HASH>..<HASH> 100644 --- a/textplot/text.py +++ b/textplot/text.py @@ -162,7 +162,8 @@ class Text(object): signals = [] for term in query_text.terms: - signals.append(self.kde(term, **kwargs)) + if term in self.terms: + signals.append(self.kde(term, **kwargs)) result = np.zeros(signals[0].size) for signal in signals: result += signal
When running a KDE query, check that a term is present in the base text before trying to generate the estimate.
davidmcclure_textplot
train
py
c91a5e37d4c581213fb1e4c8e7be160e3c85677f
diff --git a/web/concrete/config/app.php b/web/concrete/config/app.php index <HASH>..<HASH> 100644 --- a/web/concrete/config/app.php +++ b/web/concrete/config/app.php @@ -864,4 +864,3 @@ return array( ) ) ); -
Added some functionality for asset groups, and moved all the asset groups into the app file Former-commit-id: 6e3d<I>b<I>e<I>ea7c8e<I>adb<I>c<I>b<I>c<I>f
concrete5_concrete5
train
php
4d4e345e985715381fbc9d324131321b04f959d6
diff --git a/root_cgo_darwin.go b/root_cgo_darwin.go index <HASH>..<HASH> 100644 --- a/root_cgo_darwin.go +++ b/root_cgo_darwin.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build cgo,!arm,!arm64,!ios +// +build cgo,darwin,!arm,!arm64,!ios package syscerts @@ -60,6 +60,8 @@ int FetchPEMRootsC(CFDataRef *pemRoots) { return 0; } */ + +/* import "C" import ( "crypto/x509" @@ -80,3 +82,4 @@ func initSystemRoots() { roots.AppendCertsFromPEM(buf) systemRoots = roots } +*/ diff --git a/root_darwin.go b/root_darwin.go index <HASH>..<HASH> 100644 --- a/root_darwin.go +++ b/root_darwin.go @@ -33,3 +33,7 @@ func execSecurityRoots() (*x509.CertPool, error) { return roots, nil } + +func initSystemRoots() { + systemRoots, _ = execSecurityRoots() +}
remove cgo darwin root for now
jackspirou_syscerts
train
go,go
acf1ef823b12ffbb0ad55edfb2fc31749fc791bc
diff --git a/django_pandas/utils.py b/django_pandas/utils.py index <HASH>..<HASH> 100644 --- a/django_pandas/utils.py +++ b/django_pandas/utils.py @@ -11,7 +11,7 @@ def replace_from_choices(choices): def get_base_cache_key(model): - return 'pandas_%s_%s_%%d_rendering' % ( + return 'pandas_%s_%s_%%s_rendering' % ( model._meta.app_label, model._meta.module_name)
The primary key of a model can be a string --> changed syntax for base_cache_key
chrisdev_django-pandas
train
py
d644e2cf7185ee57274c966938a12f790c5aef46
diff --git a/src/server/pps/pretty/pretty.go b/src/server/pps/pretty/pretty.go index <HASH>..<HASH> 100644 --- a/src/server/pps/pretty/pretty.go +++ b/src/server/pps/pretty/pretty.go @@ -87,7 +87,7 @@ func PrintPipelineInputHeader(w io.Writer) { func PrintPipelineInput(w io.Writer, pipelineInput *ppsclient.PipelineInput) { fmt.Fprintf(w, "%s\t", pipelineInput.Repo.Name) fmt.Fprintf(w, "%s\t", pipelineInput.Method.Partition) - fmt.Fprintf(w, "%t\t\n", pipelineInput.Method.Incremental) + fmt.Fprintf(w, "%s\t\n", pipelineInput.Method.Incremental) } // PrintJobCountsHeader prints a job counts header.
Incremental isn't a bool anymore.
pachyderm_pachyderm
train
go
8d562245ec572b2d74719f9b4af8d10ce6fe5272
diff --git a/src/engine/Engine.js b/src/engine/Engine.js index <HASH>..<HASH> 100644 --- a/src/engine/Engine.js +++ b/src/engine/Engine.js @@ -217,7 +217,7 @@ function Engine(nodes) { throw new Error('Time given to observe/2 must be a value.'); } try { - builtInProcessors['observe/3'].apply(null, [fluent, time, time]); + builtInProcessors['observe/3'].apply(null, [fluent, time, time + 1]); } catch (_) { throw new Error('Invalid fluent value given for observe/2.'); }
update observe/2 to give third arg + 1
lps-js_lps.js
train
js
37592863802c106d086202e11cdd3ee83aa4104e
diff --git a/angular-tree-control.js b/angular-tree-control.js index <HASH>..<HASH> 100644 --- a/angular-tree-control.js +++ b/angular-tree-control.js @@ -110,9 +110,9 @@ if (typeof module !== "undefined" && typeof exports !== "undefined" && module.ex selectedNode: "=?", selectedNodes: "=?", expandedNodes: "=?", - onSelection: "&", - onNodeToggle: "&", - onRightClick: "&", + onSelection: "&?", + onNodeToggle: "&?", + onRightClick: "&?", menuId: "@", options: "=?", orderBy: "=?",
Change function bindings to optional bindings. - They are all covered by individual `if` statements anyway (#L<I>, #L<I>, #L<I>). - Fixes right click triggering a selection, even if no external function is specified (Tree template no longer includes tree-right-click for an empty angular `parentGet` function).
wix_angular-tree-control
train
js
aa16dac909368ff84d51247da038205919880efa
diff --git a/src/Offer/Offer.php b/src/Offer/Offer.php index <HASH>..<HASH> 100644 --- a/src/Offer/Offer.php +++ b/src/Offer/Offer.php @@ -659,7 +659,7 @@ abstract class Offer extends EventSourcedAggregateRoot implements LabelAwareAggr */ public function selectMainImage(Image $image) { - if (!$this->images->contains($image)) { + if (!$this->images->findImageByUUID($image->getMediaObjectId())) { throw new \InvalidArgumentException('You can not select a random image to be main, it has to be added to the item.'); }
III-<I> Search image based on uuid.
cultuurnet_udb3-php
train
php
ec0fcc4a378ec152f80511f05bcb8db6a8bcd6f6
diff --git a/helpers.php b/helpers.php index <HASH>..<HASH> 100755 --- a/helpers.php +++ b/helpers.php @@ -1,5 +1,6 @@ <?php +use Illuminate\Contracts\Support\DeferringDisplayableValue; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Support\Arr; use Illuminate\Support\Collection; @@ -250,6 +251,10 @@ if (! function_exists('e')) { */ function e($value, $doubleEncode = true) { + if ($value instanceof DeferringDisplayableValue) { + $value = $value->resolveDisplayableValue(); + } + if ($value instanceof Htmlable) { return $value->toHtml(); }
support echoing parameterless component methods with parens and without
illuminate_support
train
php
b2f84a6c314d18fb35a3af25ce01662213a4889d
diff --git a/mailchimp3/baseapi.py b/mailchimp3/baseapi.py index <HASH>..<HASH> 100644 --- a/mailchimp3/baseapi.py +++ b/mailchimp3/baseapi.py @@ -48,7 +48,8 @@ class BaseApi(object): if kwargs.get('fields') is None: kwargs['fields'] = 'total_items' else: # assume well formed string, just missing 'total_items' - kwargs['fields'] += ',total_items' + if not 'total_items' in kwargs['fields'].split(','): + kwargs['fields'] += ',total_items' #Fetch results from mailchmimp, up to first 100 result = self._mc_client._get(url=url, offset=0, count=100, **kwargs)
adjusted _iterate to provide a check for inclusion of total_items in fields kwarg
VingtCinq_python-mailchimp
train
py
4b97060a905c10b9c26cef6d88a04b7a4e971c9c
diff --git a/lib/appsignal/version.rb b/lib/appsignal/version.rb index <HASH>..<HASH> 100644 --- a/lib/appsignal/version.rb +++ b/lib/appsignal/version.rb @@ -1,3 +1,3 @@ module Appsignal - VERSION = '0.5.1' + VERSION = '0.5.2' end
Bump to <I> [ci skip]
appsignal_appsignal-ruby
train
rb
572905b3c555c0227f063b91101536279d4dd039
diff --git a/pyemma/util/config.py b/pyemma/util/config.py index <HASH>..<HASH> 100644 --- a/pyemma/util/config.py +++ b/pyemma/util/config.py @@ -181,7 +181,12 @@ False @property def show_progress_bars(self): - return bool(self._conf_values['pyemma']['show_progress_bars']) + cfg_val = self._conf_values['pyemma']['show_progress_bars'] + if isinstance(cfg_val, bool): + return cfg_val + # TODO: think about a professional type checking/converting lib + parsed = True if cfg_val.lower() == 'true' else False + return parsed @show_progress_bars.setter def show_progress_bars(self, val):
[config] fix type detection because of the hillarious bool('False') is True truth.
markovmodel_PyEMMA
train
py
c2c5e16ef232049061e1353dad20337395a86a9e
diff --git a/piwik.php b/piwik.php index <HASH>..<HASH> 100644 --- a/piwik.php +++ b/piwik.php @@ -12,6 +12,9 @@ use Piwik\Common; use Piwik\Timer; use Piwik\Tracker; +// Note: if you wish to debug the Tracking API please see this documentation: +// http://developer.piwik.org/api-reference/tracking-api#debugging-the-tracker + $GLOBALS['PIWIK_TRACKER_DEBUG_FORCE_SCHEDULED_TASKS'] = false; define('PIWIK_ENABLE_TRACKING', true);
Adding comment to point users to "how to debug" documentation
matomo-org_matomo
train
php
a4c6e92d41507e9b1494e1ca68235c20bb96bf3c
diff --git a/wpull/protocol/http/web.py b/wpull/protocol/http/web.py index <HASH>..<HASH> 100644 --- a/wpull/protocol/http/web.py +++ b/wpull/protocol/http/web.py @@ -82,8 +82,15 @@ class WebSession(object): def __exit__(self, exc_type, exc_val, exc_tb): if self._current_session: if not isinstance(exc_val, StopIteration): + _logger.debug('Early close session.') + error = True self._current_session.abort() + else: + error = False + self._current_session.recycle() + self._current_session.event_dispatcher.notify( + self._current_session.SessionEvent.end_session, error=error) @asyncio.coroutine def start(self):
Fix issue whereby WebSession never fires SessionEvent.end_session in its __exit__, thereby causing --warc-max-size to be ignored
ArchiveTeam_wpull
train
py
b0aa8412ab67c964e83d5956e2ac8af9d78833af
diff --git a/lib/octopusci/worker_launcher.rb b/lib/octopusci/worker_launcher.rb index <HASH>..<HASH> 100644 --- a/lib/octopusci/worker_launcher.rb +++ b/lib/octopusci/worker_launcher.rb @@ -27,10 +27,21 @@ module Octopusci if Octopusci::Config['general']['tentacles_user'] != nil require 'etc' - chosen_uid = Etc.getpwnam(Octopusci::Config['general']['tentacles_user']).uid - if chosen_uid - Process.uid = chosen_uid - Process.euid = chosen_uid + chosen_user = Etc.getpwnam(Octopusci::Config['general']['tentacles_user']) + if chosen_user + # Switch the effective and real uid to the specified user + Process.uid = chosen_user.uid + Process.euid = chosen_user.uid + + # Set the USER, HOME, and SHELL environment variables to those found in /etc/passwd for the specified user. + # This is important for some applications/scripts like RVM so that they can find things relative to the users home directory. + ENV['USER'] = chosen_user.name + ENV['SHELL'] = chosen_user.shell + ENV['HOME'] = chosen_user.dir + + # Set the OCTOPUSCI environment variable applications to true so that programs instantiated by ocotpusci jobs could determine if + # they are being run by octopusci or not. + ENV['OCTOPUSCI'] = 'true' end end
Added environment variable setting for specified daemon user. I modified octopusci-tentacles so that it sets its HOME, SHELL, and USER environment variables based on the info it finds in /etc/passwd for the specified tentacles_user in the config.yml. I have also modified it to define the OCTOPUSCI environment variable so that when commands are executed by the jobs they can determine if they are being executed by Octopusci or not.
drewdeponte_octopusci
train
rb
8ebbf9bf26f0f9dd9c7e7e692ff57ce6b600c883
diff --git a/timber.php b/timber.php index <HASH>..<HASH> 100644 --- a/timber.php +++ b/timber.php @@ -373,18 +373,22 @@ class Timber { public function load_template($template, $query = false) { $template = locate_template($template); - add_action('send_headers', function () { - header('HTTP/1.1 200 OK'); - }); - add_action('wp_loaded', function ($template) use ( $template, $query ) { - if ($query) { - query_posts( $query ); - } - if ($template) { + + if ($query) { + add_action('do_parse_request',function() use ($query) { + global $wp; + $wp->query_vars = $query; + return false; + }); + } + if ($template) { + add_action('wp_loaded', function() use ($template) { + wp(); + do_action('template_redirect'); load_template($template); die; - } - }, 10, 1); + }); + } } /* Pagination
Use wp() instead of manually querying posts in Timber::load_template
timber_timber
train
php
1e815509a5c1e5468a57029d4fe75983763ad318
diff --git a/generator/classes/propel/phing/PropelConvertConfTask.php b/generator/classes/propel/phing/PropelConvertConfTask.php index <HASH>..<HASH> 100644 --- a/generator/classes/propel/phing/PropelConvertConfTask.php +++ b/generator/classes/propel/phing/PropelConvertConfTask.php @@ -91,6 +91,8 @@ class PropelConvertConfTask extends AbstractPropelDataModelTask { // Create a map of all PHP classes and their filepaths for this data model + DataModelBuilder::setBuildProperties($this->getPropelProperties()); + foreach ($this->getDataModels() as $dataModel) { foreach ($dataModel->getDatabases() as $database) {
ticket:<I> - Set the build properties in !DataModelBuilder, so that the task does not depend on OM or SQL task to have already run.
propelorm_Propel
train
php