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
ec7fa504176d692b3425a9954114189e6428c03e
diff --git a/src/js/ui/counter-indicator.js b/src/js/ui/counter-indicator.js index <HASH>..<HASH> 100644 --- a/src/js/ui/counter-indicator.js +++ b/src/js/ui/counter-indicator.js @@ -3,7 +3,7 @@ export const counterIndicator = { order: 5, onInit: (counterElement, pswp) => { pswp.on('change', () => { - counterElement.innerHTML = (pswp.currIndex + 1) + counterElement.innerText = (pswp.currIndex + 1) + pswp.options.indexIndicatorSep + pswp.getNumItems(); });
Drop support of HTML for indexIndicatorSep option
dimsemenov_PhotoSwipe
train
js
a56ad4cd9bfae5306dbbdcbc40ce10e1f9a7a133
diff --git a/salt/returners/mysql.py b/salt/returners/mysql.py index <HASH>..<HASH> 100644 --- a/salt/returners/mysql.py +++ b/salt/returners/mysql.py @@ -10,7 +10,6 @@ config, these are the defaults:: mysql.pass: 'salt' mysql.db: 'salt' mysql.port: 3306 - mysql.unix_socket: '/var/lib/mysql/mysql.sock' Use the following mysql database schema:: @@ -78,7 +77,7 @@ def _get_serv(commit=False): passwd=__salt__['config.option']('mysql.pass'), db=__salt__['config.option']('mysql.db'), port=__salt__['config.option']('mysql.port'), - unix_socket=__salt__['config.option']('mysql.unix_socket')) + ) cursor = conn.cursor() try: yield cursor
Remove unix_socket option. Minions almost always return remotely
saltstack_salt
train
py
47087beff88e311ecd9432176d59edb4e76177c1
diff --git a/Integration/ClientIntegration.php b/Integration/ClientIntegration.php index <HASH>..<HASH> 100644 --- a/Integration/ClientIntegration.php +++ b/Integration/ClientIntegration.php @@ -867,6 +867,18 @@ class ClientIntegration extends AbstractIntegration } $this->setLogs($exception->getMessage(), 'error'); $this->setLogs($this->retry, 'retry'); + // Make an attempt to log the campaign and event with the error if not already there. + try { + if (!isset($this->logs['campaign'])) { + if ($this->getCampaign() instanceof Campaign) { + $this->setLogs($this->getCampaign()->getId(), 'campaign'); + } + + if (!empty($event['id'])) { + $this->setLogs($event['id'], 'campaignEventId'); + } + } + } catch (\Exception $exception) {} } /**
[ENG-<I>] Log campaign and event with duplicate/exclusive/limited errors. Should help us in debugging such issues.
TheDMSGroup_mautic-contact-client
train
php
12ebd6ed8e03a2070ddc8a7f58abc9c2e594334c
diff --git a/src/LdapLogic.php b/src/LdapLogic.php index <HASH>..<HASH> 100644 --- a/src/LdapLogic.php +++ b/src/LdapLogic.php @@ -64,6 +64,10 @@ trait LdapLogic $this->unbind(); + if (!$info) { + return false; + } + return new LdapUser($info); } } \ No newline at end of file diff --git a/tests/LdapTest.php b/tests/LdapTest.php index <HASH>..<HASH> 100644 --- a/tests/LdapTest.php +++ b/tests/LdapTest.php @@ -65,6 +65,16 @@ class LdapTest extends \Orchestra\Testbench\TestCase } /** @test */ + public function searching_for_an_invalid_user_returns_false() + { + $connection = new FakeLdapConnection('fake-server', 'fake-ou'); + $ldap = new LdapService($connection); + + $user = $ldap->findUser('invalid-user'); + + $this->assertFalse($user); + } + /** @test */ public function can_convert_an_ldap_user_to_an_array() { $user = new LdapUser([
Little fix of fake ldap service
ohnotnow_simple-ldap
train
php,php
3cbfbb15bbe5247fedc17abfb571c9e94a995dd1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,4 @@ /* eslint-disable import/no-commonjs */ -module.exports = require('./src/lib/main.js'); + +import docsearch from './src/lib/main.js'; +module.exports = docsearch;
fix(build): fix badly handled webpack upgrade
algolia_docsearch
train
js
cc35d588a74af08f41a328e55ccb7a10ff3fcbc2
diff --git a/pkg/kubelet/cadvisor/cadvisor_linux.go b/pkg/kubelet/cadvisor/cadvisor_linux.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/cadvisor/cadvisor_linux.go +++ b/pkg/kubelet/cadvisor/cadvisor_linux.go @@ -94,6 +94,7 @@ func New(imageFsInfoProvider ImageFsInfoProvider, rootPath string, cgroupRoots [ cadvisormetrics.NetworkUsageMetrics: struct{}{}, cadvisormetrics.AcceleratorUsageMetrics: struct{}{}, cadvisormetrics.AppMetrics: struct{}{}, + cadvisormetrics.ProcessMetrics: struct{}{}, } if usingLegacyStats { includedMetrics[cadvisormetrics.DiskUsageMetrics] = struct{}{}
Enable cAdvisor ProcessMetrics collecting
kubernetes_kubernetes
train
go
dcb904416af1c9c9f6cbadc4832c600614cade4d
diff --git a/py/makeqstrdefs.py b/py/makeqstrdefs.py index <HASH>..<HASH> 100644 --- a/py/makeqstrdefs.py +++ b/py/makeqstrdefs.py @@ -30,7 +30,7 @@ def process_file(f): m = re.match(r"#[line]*\s\d+\s\"([^\"]+)\"", line) assert m is not None fname = m.group(1) - if fname[0] == "/" or not fname.endswith(".c"): + if not fname.endswith(".c"): continue if fname != last_fname: write_out(last_fname, output)
py/makeqstrdefs.py: Remove restriction that source path can't be absolute. That's arbitrary restriction, in case of embedding, a source file path may be absolute. For the purpose of filtering out system includes, checking for ".c" suffix is enough.
micropython_micropython
train
py
e65dc38725de0ea7a3c6c1e1222681e275d7516e
diff --git a/lib/helpers/route-helper.js b/lib/helpers/route-helper.js index <HASH>..<HASH> 100644 --- a/lib/helpers/route-helper.js +++ b/lib/helpers/route-helper.js @@ -176,8 +176,6 @@ class RouteHelper { ** */ _validateRoute(route) { - // TODO: move these validations to respctive helpers - // path // REQUIRED if (!route.path) { @@ -185,7 +183,17 @@ class RouteHelper { error: `missing path.`, line : `Route { path: ${route.path}, method: ${route.method} }`, file : `routes.js`, - hint : `add a 'path'.` + hint : `add a 'path' property.` + }); + } + + // Should start with / + if (route.path.slice(0, 1) !== '/') { + errorHelper.throwError({ + error: `path should start with '/'`, + line : `Route { path: ${route.path}, method: ${route.method} }`, + file : `routes.js`, + hint : `prepend '/' to the path.` }); }
validating route path prefix (#<I>)
madhusudhand_donode
train
js
e7c9c675e76c6e303e9913c35d746a017e6320f3
diff --git a/static/lib/composer.js b/static/lib/composer.js index <HASH>..<HASH> 100644 --- a/static/lib/composer.js +++ b/static/lib/composer.js @@ -152,10 +152,6 @@ define('composer', [ post.save_id = ['composer', app.user.uid, 'pid', post.pid].join(':'); } - // Post is opened, save to list of opened drafts - drafts.updateVisibility('available', post.save_id, true); - drafts.updateVisibility('open', post.save_id, true); - composer.posts[uuid] = post; composer.load(uuid); } @@ -331,6 +327,10 @@ define('composer', [ postContainer.on('change', 'input, textarea', function() { composer.posts[post_uuid].modified = true; + + // Post is modified, save to list of opened drafts + drafts.updateVisibility('available', composer.posts[post_uuid].save_id, true); + drafts.updateVisibility('open', composer.posts[post_uuid].save_id, true); }); submitBtn.on('click', function(e) {
fix: overzealous draft handling
NodeBB_nodebb-plugin-composer-default
train
js
ea6fe797fb42d59a8998eae6ff7497932fec5565
diff --git a/examples/managing-audiences/test_audienceGroup.py b/examples/managing-audiences/test_audienceGroup.py index <HASH>..<HASH> 100644 --- a/examples/managing-audiences/test_audienceGroup.py +++ b/examples/managing-audiences/test_audienceGroup.py @@ -52,7 +52,7 @@ class LineBotApi(LineBotApi_ori): audience_groups = super(LineBotApi, self).get_audience_group_list( description=description, timeout=timeout) for audience_group in audience_groups: - if audience_group.description.encode('utf-8') == description: + if audience_group.description == description: return audience_group.audience_group_id else: return None
Remove unnecessary decode (#<I>)
line_line-bot-sdk-python
train
py
625bf25021a96bfc4471ada0671a115d42750656
diff --git a/routes/web/adminarea.php b/routes/web/adminarea.php index <HASH>..<HASH> 100644 --- a/routes/web/adminarea.php +++ b/routes/web/adminarea.php @@ -2,7 +2,7 @@ declare(strict_types=1); -Route::domain(domain())->group(function () { +Route::domain('{central_domain}')->group(function () { Route::name('adminarea.') ->namespace('Cortex\Tenants\Http\Controllers\Adminarea') ->middleware(['web', 'nohttpcache', 'can:access-adminarea']) diff --git a/routes/web/managerarea.php b/routes/web/managerarea.php index <HASH>..<HASH> 100755 --- a/routes/web/managerarea.php +++ b/routes/web/managerarea.php @@ -2,7 +2,7 @@ declare(strict_types=1); -Route::domain('{subdomain}.'.domain())->group(function () { +Route::domain('{tenant_domain}')->group(function () { Route::name('managerarea.') ->namespace('Cortex\Tenants\Http\Controllers\Managerarea') ->middleware(['web', 'nohttpcache', 'can:access-managerarea'])
Register routes to either central or tenant domains
rinvex_cortex-tenants
train
php,php
4dcf7ef7e777fe45bba4ceb0dd610577280b718c
diff --git a/shinken/db_sqlite.py b/shinken/db_sqlite.py index <HASH>..<HASH> 100644 --- a/shinken/db_sqlite.py +++ b/shinken/db_sqlite.py @@ -25,6 +25,7 @@ from db import DB +from shinken.log import logger import sqlite3 diff --git a/shinken/scheduler.py b/shinken/scheduler.py index <HASH>..<HASH> 100644 --- a/shinken/scheduler.py +++ b/shinken/scheduler.py @@ -353,7 +353,7 @@ class Scheduler: to_del_checks = [c for c in self.checks.values() if c.id < id_max - max_checks] nb_checks_drops = len(to_del_checks) if nb_checks_drops > 0: - log.logger("Info : I have to del some checks (%d)..., sorry" % nb_checks_drops) + logger.info("I have to del some checks (%d)..., sorry" % nb_checks_drops) for c in to_del_checks: i = c.id elt = c.ref
Fix call to logger #<I>
Alignak-monitoring_alignak
train
py,py
d6953cbfd3b6e06eceba715c60e288b6d7db0d49
diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb @@ -23,6 +23,7 @@ module HTML #:nodoc: # Create a new Tokenizer for the given text. def initialize(text) + text.encode! if text.encoding_aware? @scanner = StringScanner.new(text) @position = 0 @line = 0 diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -267,14 +267,12 @@ module ActionDispatch if match_with = equals[:text] matches.delete_if do |match| text = "" - text.force_encoding(match_with.encoding) if text.respond_to?(:force_encoding) stack = match.children.reverse while node = stack.pop if node.tag? stack.concat node.children.reverse else content = node.content - content.force_encoding(match_with.encoding) if content.respond_to?(:force_encoding) text << content end end
regular expressions are usually ASCII-encoded, so force_encoding the content of a Node to the encoding of the regular expression is wrong.
rails_rails
train
rb,rb
50f0fffdfe9dabfaa4edb0a6b20bcd0b7beb0edd
diff --git a/pac4j-oidc/src/main/java/org/pac4j/oidc/client/OidcClient.java b/pac4j-oidc/src/main/java/org/pac4j/oidc/client/OidcClient.java index <HASH>..<HASH> 100644 --- a/pac4j-oidc/src/main/java/org/pac4j/oidc/client/OidcClient.java +++ b/pac4j-oidc/src/main/java/org/pac4j/oidc/client/OidcClient.java @@ -326,6 +326,7 @@ public class OidcClient extends IndirectClient<OidcCredentials, OidcProfile> { // Return profile with Claims Set, User Info and Access Token OidcProfile profile = new OidcProfile(accessToken); profile.setId(claimsSet.getSubject()); + profile.setIdTokenString(tokenSuccessResponse.getIDTokenString()); profile.addAttributes(claimsSet.getAllClaims()); profile.addAttributes(userInfo.toJWTClaimsSet().getAllClaims());
Storing the string representation of the "ID Token" on the `OidcProfile`.
pac4j_pac4j
train
java
ad20847b5c99d17832732ce8ee7246e9e7bd7939
diff --git a/ftfy/streamtester/__init__.py b/ftfy/streamtester/__init__.py index <HASH>..<HASH> 100644 --- a/ftfy/streamtester/__init__.py +++ b/ftfy/streamtester/__init__.py @@ -29,10 +29,10 @@ class StreamTester: if encoding_only: fixed = fix_encoding(text) else: - fixed = fix_text(text, fix_character_width=False, uncurl_quotes=False) + fixed = fix_text(text, uncurl_quotes=False, fix_character_width=False) if text != fixed: # possibly filter common bots before printing - print(u'\nText:\t{text}\nFixed:\t{fixed}\n'.format( + print(u'\nText:\t{text!r}\nFixed:\t{fixed!r}\n'.format( text=text, fixed=fixed )) self.num_fixed += 1
show safer representations in streamtester
LuminosoInsight_python-ftfy
train
py
6db9e0fc1a767ec0c5cc541356651df0da154c23
diff --git a/pftree/pftree.py b/pftree/pftree.py index <HASH>..<HASH> 100755 --- a/pftree/pftree.py +++ b/pftree/pftree.py @@ -124,7 +124,6 @@ class pftree(object): f_percent = index/total*100 str_num = "[%3d/%3d: %6.2f%%] " % (index, total, f_percent) str_bar = "*" * int(f_percent) - pudb.set_trace() self.dp.qprint("%s%s%s" % (str_pretext, str_num, str_bar), stackDepth = 2) def tree_probe(self, **kwargs): @@ -201,7 +200,7 @@ class pftree(object): for l_series in l_files: str_path = os.path.dirname(l_series[0]) l_series = [ os.path.basename(i) for i in l_series] - self.simpleProgress_show(index, total, 'tree_construct') + self.simpleProgress_show(index, total) self.d_inputTree[str_path] = l_series if fn_constructCallback: kwargs['path'] = str_path
Improve simpleProgress_show reporting.
FNNDSC_pftree
train
py
222ef7454cad87468d2da86582567bda3af41ca8
diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java index <HASH>..<HASH> 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java @@ -222,11 +222,11 @@ public class RemoveGroupActionTest extends BasePermissionWsTest<RemoveGroupActio loginAsAdmin(db.getDefaultOrganization()); expectedException.expect(NotFoundException.class); - expectedException.expectMessage("No group with id '42'"); + expectedException.expectMessage("No group with id '999999'"); newRequest() .setParam(PARAM_PERMISSION, SYSTEM_ADMIN) - .setParam(PARAM_GROUP_ID, "42") + .setParam(PARAM_GROUP_ID, "999999") .execute(); }
Fix reliability of RemoveGroupActionTest Sometimes the test "fail_when_group_id_does_not_exist" fails with error: Expected test to throw (an instance of org.sonar.server.exceptions.NotFoundException and exception with message a string containing "No group with id '<I>'") That occurs when other tests have created at least <I> groups, so that the id sequence reached value <I>.
SonarSource_sonarqube
train
java
e878191622f46753ba1080f3bfd5a4a710722d04
diff --git a/mbed/mbed.py b/mbed/mbed.py index <HASH>..<HASH> 100755 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -19,6 +19,7 @@ # pylint: disable=invalid-name, missing-docstring, bad-continuation from __future__ import print_function +from past.builtins import basestring try: from urllib.parse import urlparse
Added basestring inclusion in py3
ARMmbed_mbed-cli
train
py
4f30ea4686969e984884161a7cd22fdf9a020fad
diff --git a/src/Database/Driver.php b/src/Database/Driver.php index <HASH>..<HASH> 100644 --- a/src/Database/Driver.php +++ b/src/Database/Driver.php @@ -14,6 +14,10 @@ */ namespace Cake\Database; +use Cake\Database\Query; +use Cake\Database\Querycompiler; +use Cake\Database\ValueBinder; + /** * Represents a database diver containing all specificities for * a database engine including its SQL dialect
Adding a few missing use statements
cakephp_cakephp
train
php
e025ddcd86ccfe34ea101f8790489f2c0e0319f3
diff --git a/collectors/overview.php b/collectors/overview.php index <HASH>..<HASH> 100644 --- a/collectors/overview.php +++ b/collectors/overview.php @@ -37,6 +37,10 @@ class QM_Collector_Overview extends QM_Collector { } public function process() { + if ( ! isset( $data['time_taken'] ) ) { + $this->process_timing(); + } + $this->data['time_limit'] = ini_get( 'max_execution_time' ); $this->data['time_start'] = $GLOBALS['timestart'];
Add a fallback for timing processing for requests that are dispatched prior to the shutdown hook (eg. Ajax).
johnbillion_query-monitor
train
php
5bdf73dfc133d192f92b551849882499687c1b1e
diff --git a/src/Store/SessionStore.php b/src/Store/SessionStore.php index <HASH>..<HASH> 100644 --- a/src/Store/SessionStore.php +++ b/src/Store/SessionStore.php @@ -104,7 +104,7 @@ final class SessionStore implements StoreInterface $session = $_SESSION; $prefix = $this->sessionPrefix . '_'; - while (current($session)) { + while (key($session)) { $sessionKey = key($session); if (is_string($sessionKey) && mb_substr($sessionKey, 0, strlen($prefix)) === $prefix) {
fix: Use key() instead of current() to iterate over PHP session store (#<I>)
auth0_auth0-PHP
train
php
157894979cb6214f679c05577df670a57dd63351
diff --git a/tests/integration/ApiTestCase.php b/tests/integration/ApiTestCase.php index <HASH>..<HASH> 100644 --- a/tests/integration/ApiTestCase.php +++ b/tests/integration/ApiTestCase.php @@ -228,15 +228,16 @@ class ApiTestCase extends TestCase $config->setThrowExceptions(true); $config->setOAuthClientOptions(['verify' => $this->getVerifySSL(), 'timeout' => '15']); + $maxRetries = 3; $clientOptions = [ 'verify' => $this->getVerifySSL(), 'timeout' => '15', 'middlewares' => [ - 'retry' => Middleware::retry(function ($retries, RequestInterface $request, ResponseInterface $response = null, $error = null) { + 'retry' => Middleware::retry(function ($retries, RequestInterface $request, ResponseInterface $response = null, $error = null) use ($maxRetries) { if ($response instanceof ResponseInterface && $response->getStatusCode() < 500) { return false; } - if ($retries > 2) { + if ($retries > $maxRetries) { return false; } if ($error instanceof ServiceUnavailableException) {
test(Integration): use variable for max retries
commercetools_commercetools-php-sdk
train
php
1247a9d564a9019db60aa8e49fb96cb943c4da82
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -80,6 +80,9 @@ var extend = function (dest) { return dest; }; +/** + * @constructor + */ var VMRun = function () {}; /** @@ -234,7 +237,7 @@ VMRun.prototype.start = function (vmxFile, gui) { * @param {String} vmxFile * @returns {Promise.<Boolean>} Promise resolved to whether the machine was on or not */ -VMRun.prototype.poweroff = function (vmxFile) { +VMRun.prototype.poweroff = VMRun.prototype.powerOff = function (vmxFile) { return this.vmrun('stop', [vmxFile, 'hard']) .then(function () { return true;
Support for powerOff spelling (vs. poweroff)
danielgindi_node-vmrun
train
js
9445b4cbda6e0b88140208b5a51f520852396a48
diff --git a/structurizr-core/src/com/structurizr/view/Styles.java b/structurizr-core/src/com/structurizr/view/Styles.java index <HASH>..<HASH> 100644 --- a/structurizr-core/src/com/structurizr/view/Styles.java +++ b/structurizr-core/src/com/structurizr/view/Styles.java @@ -2,6 +2,7 @@ package com.structurizr.view; import com.structurizr.model.Element; import com.structurizr.model.Relationship; +import com.structurizr.model.Tags; import com.structurizr.util.StringUtils; import java.util.Collection; @@ -58,6 +59,14 @@ public final class Styles { this.relationships = new LinkedList<>(); } + public void addDefaultStyles() { + addElementStyle(Tags.ELEMENT).shape(Shape.RoundedBox); + addElementStyle(Tags.SOFTWARE_SYSTEM).background("#1168bd").color("#ffffff"); + addElementStyle(Tags.CONTAINER).background("#438dd5").color("#ffffff"); + addElementStyle(Tags.COMPONENT).background("#85bbf0").color("#000000"); + addElementStyle(Tags.PERSON).background("#08427b").color("#ffffff").shape(Shape.Person); + } + public Collection<RelationshipStyle> getRelationships() { return relationships; }
Adds an "addDefaultStyles()" method to Styles.
structurizr_java
train
java
c8d070139701f0c0d3b1f5a0fadba26d8fc8c79d
diff --git a/raiden/transfer/identifiers.py b/raiden/transfer/identifiers.py index <HASH>..<HASH> 100644 --- a/raiden/transfer/identifiers.py +++ b/raiden/transfer/identifiers.py @@ -44,6 +44,14 @@ class QueueIdentifier: recipient: Address canonical_identifier: CanonicalIdentifier + def __str__(self) -> str: + return ( + "QueueIdentifier(" + f"recipient={to_checksum_address(self.recipient)}, " + f"canonical_identifier={self.canonical_identifier}" + ")" + ) + CANONICAL_IDENTIFIER_GLOBAL_QUEUE = CanonicalIdentifier( ChainID(0), TokenNetworkAddress(EMPTY_ADDRESS), ChannelID(0)
Added __str__ to QueueIdentifier
raiden-network_raiden
train
py
22f0796cab134352f988ffddf4c47253285ae2d4
diff --git a/dingos/templatetags/dingos_tags.py b/dingos/templatetags/dingos_tags.py index <HASH>..<HASH> 100644 --- a/dingos/templatetags/dingos_tags.py +++ b/dingos/templatetags/dingos_tags.py @@ -197,7 +197,7 @@ def insert_wbr(value,autoescape=None): esc = conditional_escape else: esc = lambda x:x - return mark_safe(esc("%s" % value).replace('/','/<wbr>').replace('0','0<wbr>')) + return mark_safe(esc("%s" % value).replace('/','/<wbr>').replace('0','0<wbr>').replace('_','_<wbr>')) @register.filter def sliceupto(value, upto):
Adding '_' as possible position for linebreak in html rendering.
siemens_django-dingos
train
py
440082d67f1dd2e2f78bbca3f6acb7b7a27072ae
diff --git a/lib/vestal_versions/options.rb b/lib/vestal_versions/options.rb index <HASH>..<HASH> 100644 --- a/lib/vestal_versions/options.rb +++ b/lib/vestal_versions/options.rb @@ -28,7 +28,7 @@ module VestalVersions # :order => "#{options[:class_name].constantize.table_name}.#{connection.quote_column_name('number')} ASC" # ) - class_inheritable_accessor :vestal_versions_options + class_attribute :vestal_versions_options self.vestal_versions_options = options.dup options.merge!(
Fixed deprec'd active-record call to class_inheritable_accessor
laserlemon_vestal_versions
train
rb
c7feaa46e5f2bfcfa217cb15817fef3c6b62f14f
diff --git a/tests/brightbox/requests/compute/helper.rb b/tests/brightbox/requests/compute/helper.rb index <HASH>..<HASH> 100644 --- a/tests/brightbox/requests/compute/helper.rb +++ b/tests/brightbox/requests/compute/helper.rb @@ -110,7 +110,8 @@ class Brightbox "description" => String, "source" => String, "status" => String, - "owner" => String + "owner" => String, + "username" => Fog::Nullable::String } INTERFACE = { @@ -232,6 +233,7 @@ class Brightbox "source_type" => String, "status" => String, "owner" => String, + "username" => Fog::Nullable::String, "public" => Fog::Boolean, "official" => Fog::Boolean, "compatibility_mode" => Fog::Boolean, @@ -415,6 +417,7 @@ class Brightbox "source_type" => String, "status" => String, "owner" => String, # Account ID not object + "username" => Fog::Nullable::String, "public" => Fog::Boolean, "official" => Fog::Boolean, "compatibility_mode" => Fog::Boolean,
[Brightbox] Updated Image format tests for username
fog_fog
train
rb
719b057687680d4c7c2768c9adfdfcf42de57e34
diff --git a/spec/cobweb/cobweb_spec.rb b/spec/cobweb/cobweb_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cobweb/cobweb_spec.rb +++ b/spec/cobweb/cobweb_spec.rb @@ -36,7 +36,10 @@ describe CobWeb do @mock_http_client.stub!(:request).with(@mock_http_request).and_return(@mock_http_response) @mock_http_client.stub!(:request).with(@mock_http_redirect_request).and_return(@mock_http_redirect_response) - @mock_http_client.stub!(:request).with(@mock_http_redirect_request2).and_return(@mock_http_redirect_response2) + @mock_http_client.stub!(:request).with(@mock_http_redirect_request2).and_return(@mock_http_redirect_response2) + @mock_http_client.stub!(:read_timeout=).and_return(nil) + @mock_http_client.stub!(:open_timeout=).and_return(nil) + @mock_http_client.stub!(:start).and_return(@mock_http_response) @mock_http_response.stub!(:code).and_return(200) @mock_http_response.stub!(:content_type).and_return("text/html")
added stubs for timeout methods
stewartmckee_cobweb
train
rb
96dc3a31746eb6ef2ac863a1a2f675994cfd935a
diff --git a/lib/ronin/cacheable/cacheable.rb b/lib/ronin/cacheable/cacheable.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/cacheable/cacheable.rb +++ b/lib/ronin/cacheable/cacheable.rb @@ -55,7 +55,7 @@ module Ronin # Loads all objects with the matching _attributes_. # def self.load_all(attributes={}) - self.all(attributes).map { |obj| obj.load_original! } + self.all(attributes).each { |obj| obj.load_original! } end #
Now that Cacheable#load_original! returns a Boolean, no longer use map in Cacheable.load_all.
ronin-ruby_ronin
train
rb
90ea847d12fedc79b3771849f435aa50b79b311e
diff --git a/libraries/lithium/template/helper/Form.php b/libraries/lithium/template/helper/Form.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/template/helper/Form.php +++ b/libraries/lithium/template/helper/Form.php @@ -391,6 +391,9 @@ class Form extends \lithium\template\Helper { case ($type == 'select'): $input = $this->select($name, $options['list'], $fieldOptions); break; + case ($type == 'radio'): + $input = $this->{'radio-field'}($name, $fieldOptions); + break; default: $input = $this->{$type}($name, $fieldOptions); break;
fixed special case of radio type through the field method
UnionOfRAD_framework
train
php
562dfaa5bc15f0e87e43fe4ce06d0f0bf2249a44
diff --git a/test/helpers/index.js b/test/helpers/index.js index <HASH>..<HASH> 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -6,20 +6,6 @@ var Stream = require('stream').Stream; var Readable = require('readable-stream').Readable; var Writable = require('readable-stream').Writable; -function adjustDateByOffset(d, offset) { - d = (d instanceof Date) ? d : new Date(); - - if (offset >= 1) { - d.setMinutes(d.getMinutes() - offset); - } else { - d.setMinutes(d.getMinutes() + Math.abs(offset)); - } - - return d; -} - -module.exports.adjustDateByOffset = adjustDateByOffset; - function binaryBuffer(n) { var buffer = new Buffer(n);
test: remove adjustDateByOffset now that we use universal time.
archiverjs_node-compress-commons
train
js
25045b12f4b38db47b42eea5281f746a4ce54ab4
diff --git a/spec/controllers/dashboard_controller_spec.rb b/spec/controllers/dashboard_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/dashboard_controller_spec.rb +++ b/spec/controllers/dashboard_controller_spec.rb @@ -63,6 +63,17 @@ describe DashboardController do describe "#index" do before (:each) do xhr :get, :index + # Make sure there are at least 3 files owned by @user. Otherwise, the tests aren't meaningful. + if assigns(:document_list).count < 3 + files_count = assigns(:document_list).count + until files_count == 3 + gf = GenericFile.new() + gf.apply_depositor_metadata(@user.user_key) + gf.save + files_count += 1 + end + xhr :get, :index + end end it "should be a success" do response.should be_success @@ -72,6 +83,14 @@ describe DashboardController do user_results = Blacklight.solr.get "select", :params=>{:fq=>["edit_access_group_ssim:public OR edit_access_person_ssim:#{@user.user_key}"]} assigns(:document_list).count.should eql(user_results["response"]["numFound"]) end + context "with render views" do + render_views + it "should paginate" do + xhr :get, :index, per_page: 2 + response.should be_success + response.should render_template('dashboard/index') + end + end end end describe "not logged in as a user" do
Test to confirm that pagination works -- fails because dashboard/pages routes are not properly inherited.
samvera_hyrax
train
rb
d4085781e760c9e8925302e2a7c47a4a01293073
diff --git a/src/Kris/LaravelFormBuilder/Fields/FormField.php b/src/Kris/LaravelFormBuilder/Fields/FormField.php index <HASH>..<HASH> 100644 --- a/src/Kris/LaravelFormBuilder/Fields/FormField.php +++ b/src/Kris/LaravelFormBuilder/Fields/FormField.php @@ -126,7 +126,7 @@ abstract class FormField */ protected function getViewTemplate() { - return $this->getOption('template', $this->template); + return $this->parent->getTemplatePrefix() . $this->getOption('template', $this->template); } /**
Add template prefix to FormField Add the template prefix generated by the form to the FormField as well. Again, the prefix is configured as an empty string by default. Because of that, it is fully backwards compatible.
kristijanhusak_laravel-form-builder
train
php
c74672ca8e135b770ce0d866a315422139a5bbf4
diff --git a/src/i18next.js b/src/i18next.js index <HASH>..<HASH> 100644 --- a/src/i18next.js +++ b/src/i18next.js @@ -154,14 +154,17 @@ class I18n extends EventEmitter { const deferred = defer(); const load = () => { - this.changeLanguage(this.options.lng, (err, t) => { + const finish = (err, t) => { this.isInitialized = true; if (!this.options.isClone) this.logger.log('initialized', this.options); this.emit('initialized', this.options); deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning) callback(err, t); - }); + }; + // fix for use cases when calling changeLanguage before finished to initialized (i.e. https://github.com/i18next/i18next/issues/1552) + if (this.languages && this.options.compatibilityAPI !== 'v1') return finish(null, this.t.bind(this)); + this.changeLanguage(this.options.lng, finish); }; if (this.options.resources || !this.options.initImmediate) {
fix for cases when calling changeLanguage before finished to initialized (#<I>)
i18next_i18next
train
js
1b7dbf6845f869ee23d16aca175c76d5fce968c6
diff --git a/gl-liftover-service-spark/src/main/java/org/nmdp/gl/liftover/spark/SparkLiftoverService.java b/gl-liftover-service-spark/src/main/java/org/nmdp/gl/liftover/spark/SparkLiftoverService.java index <HASH>..<HASH> 100644 --- a/gl-liftover-service-spark/src/main/java/org/nmdp/gl/liftover/spark/SparkLiftoverService.java +++ b/gl-liftover-service-spark/src/main/java/org/nmdp/gl/liftover/spark/SparkLiftoverService.java @@ -230,19 +230,11 @@ public final class SparkLiftoverService implements SparkApplication { try { JsonGenerator generator = jsonFactory.createJsonGenerator(writer); generator.writeStartObject(); - generator.writeStartObject(); generator.writeStringField("sourceNamespace", sourceNamespace); - generator.writeEndObject(); - generator.writeStartObject(); generator.writeStringField("sourceUri", sourceUri); - generator.writeEndObject(); - generator.writeStartObject(); generator.writeStringField("targetNamespace", targetNamespace); - generator.writeEndObject(); - generator.writeStartObject(); generator.writeStringField("targetUri", targetUri); generator.writeEndObject(); - generator.writeEndObject(); generator.close(); } catch (IOException e) {
Use single json object with fields for response.
nmdp-bioinformatics_genotype-list
train
java
7edc5586f6cd3b9c2b8cd9ea1ff565cd28f29fb5
diff --git a/src/worker.js b/src/worker.js index <HASH>..<HASH> 100644 --- a/src/worker.js +++ b/src/worker.js @@ -4,6 +4,13 @@ import invariant from 'assert' +export type PoolWorker$Serialized = { + active: boolean, + startIndex: number, + limitIndex: number, + currentIndex: number +} + export class PoolWorker { active: boolean; startIndex: number; @@ -23,13 +30,13 @@ export class PoolWorker { this.limitIndex = limitIndex this.currentIndex = this.startIndex } - serialize(): string { - return JSON.stringify({ + serialize(): PoolWorker$Serialized { + return { active: this.active, startIndex: this.startIndex, limitIndex: this.limitIndex, currentIndex: this.currentIndex, - }) + } } activate(): PoolWorker { this.active = true @@ -66,4 +73,10 @@ export class PoolWorker { dispose() { this.active = false } + static unserialize(serialized: PoolWorker$Serialized): PoolWorker { + const worker = new PoolWorker(serialized.startIndex, serialized.limitIndex) + worker.active = serialized.active + worker.currentIndex = serialized.currentIndex + return worker + } }
:new: Add unserialize to worker
steelbrain_range-pool
train
js
43ff72361378005b9e620ec730449ceaede2432c
diff --git a/resources/lang/ar-SA/cachet.php b/resources/lang/ar-SA/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/ar-SA/cachet.php +++ b/resources/lang/ar-SA/cachet.php @@ -23,6 +23,8 @@ return [ 'group' => [ 'other' => 'Other Components', ], + 'select_all' => 'Select All', + 'deselect_all' => 'Deselect All', ], // Incidents @@ -80,9 +82,12 @@ return [ 'button' => 'Subscribe', 'manage_subscription' => 'Manage subscription', 'manage' => [ - 'no_subscriptions' => 'You\'re currently subscribed to all updates.', - 'my_subscriptions' => 'You\'re currently subscribed to the following updates.', - 'manage_at_link' => 'Manage your subscriptions at :link', + 'notifications' => 'Notifications', + 'notifications_for' => 'Manage notifications for', + 'no_subscriptions' => 'You\'re currently subscribed to all updates.', + 'update_subscription' => 'Update Subscription', + 'my_subscriptions' => 'You\'re currently subscribed to the following updates.', + 'manage_at_link' => 'Manage your subscriptions at :link', ], 'email' => [ 'subscribe' => 'Subscribe to email updates.',
New translations cachet.php (Arabic)
CachetHQ_Cachet
train
php
b30c5ce87d86efb6c36d996f33922579e781315e
diff --git a/library/CM/Action/Abstract.php b/library/CM/Action/Abstract.php index <HASH>..<HASH> 100644 --- a/library/CM/Action/Abstract.php +++ b/library/CM/Action/Abstract.php @@ -304,7 +304,7 @@ abstract class CM_Action_Abstract extends CM_Class_Abstract implements CM_ArrayC $time = time(); foreach (array_reverse($intervals) as $interval) { $timeMin = CM_Db_Db::exec('SELECT MIN(`createStamp`) FROM `cm_action` WHERE `actionLimitType` IS NULL AND `interval` < ?', array($interval['interval']))->fetchColumn(); - if (false === $timeMin) { + if (null === $timeMin) { return; } $timeMin -= $timeMin % $interval['interval'];
Result of empty mysql aggregation is NULL not FALSE
cargomedia_cm
train
php
183792afc1d3b759ef7120438aedda43ca378e2f
diff --git a/cobe/brain.py b/cobe/brain.py index <HASH>..<HASH> 100644 --- a/cobe/brain.py +++ b/cobe/brain.py @@ -321,18 +321,13 @@ with its two nodes""" def _filter_pivots(self, pivots): # remove pivots that might not give good results - tokens = [] - for pivot in pivots: - if pivot is not None: - tokens.append(pivot) - - filtered = set() - filtered.update(self.graph.get_word_tokens(tokens)) + tokens = set(filter(None, pivots)) + filtered = self.graph.get_word_tokens(tokens) if len(filtered) == 0: - filtered.update(self.graph.get_tokens(tokens)) + filtered = self.graph.get_tokens(tokens) - return filtered + return set(filtered) def _choose_pivot(self, pivot_ids): pivot = random.choice(tuple(pivot_ids)) @@ -517,7 +512,9 @@ class Graph: # Format the sequence seq as (item1, item2, item2) as appropriate # for an IN () clause in SQL if len(seq) == 1: - return "(%s)" % seq[0] + # Grab the first item from seq. Use an iterator so this works + # with sets as well as lists. + return "(%s)" % iter(seq).next() return str(tuple(seq))
Optimize _filter_pivots By creating a set of potential pivots rather than passing the list to SQL directly, we minimize the number of values in the IN () clause. Between that change and moving the None filtering into filter(), this is more than twice as fast as before.
pteichman_cobe
train
py
0d92faa559215712a3c60faeabaed52df819cbad
diff --git a/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb b/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +++ b/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb @@ -12,6 +12,7 @@ module Fastlane credentials = CredentialsManager::AccountManager.new(user: params[:username]) Spaceship::Tunes.login(credentials.user, credentials.password) + ENV["FASTLANE_TEAM_ID"] = params[:team_id] Spaceship::Tunes.select_team app = Spaceship::Tunes::Application.find(params[:app_identifier]) @@ -75,8 +76,12 @@ module Fastlane env_name: "INTITIAL_BUILD_NUMBER", description: "sets the build number to given value if no build is in current train", optional: true, - is_string: false) - + is_string: false), + FastlaneCore::ConfigItem.new(key: :team_id, + env_name: "FASTLANE_TEAM_ID", + description: "Your team ID if you're in multiple teams", + default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id), + optional: true) ] end
[fastlane] Add new team_id option to latest_testflight_build_number (#<I>) * [fastlane] Add new team_id option to latest_testflight_build_number Fixes <URL>
fastlane_fastlane
train
rb
e868d7c2a5b80e504453b55ecdeb9f18fafd1cc9
diff --git a/psiturk/psiturk_shell.py b/psiturk/psiturk_shell.py index <HASH>..<HASH> 100644 --- a/psiturk/psiturk_shell.py +++ b/psiturk/psiturk_shell.py @@ -212,8 +212,10 @@ class PsiturkShell(Cmd): #+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+.+-+. def worker_list(self): workers = self.amt_services.get_workers() - if not workers: - print colorize('failed to get workers', 'red') + if workers==False: + print colorize('*** failed to get workers', 'red') + elif not len(workers): + print "*** no submitted workers" else: print json.dumps(self.amt_services.get_workers(), indent=4, separators=(',', ': '))
Improve "worker list" messages Now tells users if there are no workers to list rather than saying failed to get workers.
NYUCCL_psiTurk
train
py
1c0a5fbc513b367a735192bb33c8b2793ad25667
diff --git a/lib/ditty/controllers/component.rb b/lib/ditty/controllers/component.rb index <HASH>..<HASH> 100644 --- a/lib/ditty/controllers/component.rb +++ b/lib/ditty/controllers/component.rb @@ -16,7 +16,7 @@ module Ditty set heading: nil def read(id) - dataset.first(settings.model_class.primary_key => id) + dataset.with_pk(id) end def skip_verify!
fix: Use with_pk lookups instead of first in component
EagerELK_ditty
train
rb
0d5059c194d0497960c0b97040cf8bf1c2e3279a
diff --git a/php-binance-api.php b/php-binance-api.php index <HASH>..<HASH> 100644 --- a/php-binance-api.php +++ b/php-binance-api.php @@ -665,7 +665,7 @@ class API } return $this->httpRequest("v3/withdrawHistory.html", "GET", $params, true); } - + /** * withdrawFee get the withdrawal fee for an asset * @@ -679,7 +679,7 @@ class API { $params = [ "wapi" => true, - "asset" => $asset + "asset" => $asset, ]; return $this->httpRequest("v3/withdrawFee.html", "GET", $params, true); }
Fix formatting using phpfmt to satisfy build contraints
jaggedsoft_php-binance-api
train
php
5d31cac8ff7a8eb04feac202b3f01962fbd2cd55
diff --git a/instana/__init__.py b/instana/__init__.py index <HASH>..<HASH> 100644 --- a/instana/__init__.py +++ b/instana/__init__.py @@ -9,7 +9,7 @@ __author__ = 'Instana Inc.' __copyright__ = 'Copyright 2017 Instana Inc.' __credits__ = ['Pavlo Baron', 'Peter Giacomo Lombardo'] __license__ = 'MIT' -__version__ = '0.6.7' +__version__ = '0.6.8' __maintainer__ = 'Peter Giacomo Lombardo' __email__ = 'peter.lombardo@instana.com' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='instana', - version='0.6.7', + version='0.6.8', download_url='https://github.com/instana/python-sensor', url='https://www.instana.com/', license='MIT',
Bump package version to <I>
instana_python-sensor
train
py,py
be507824d03963bc4d6cd5bd7ec86cda1ab5bf79
diff --git a/code/solr/Solr.php b/code/solr/Solr.php index <HASH>..<HASH> 100644 --- a/code/solr/Solr.php +++ b/code/solr/Solr.php @@ -65,9 +65,9 @@ class Solr { static $included = false; if (!$included) { + set_include_path(get_include_path() . PATH_SEPARATOR . Director::baseFolder() . '/fulltextsearch/thirdparty/solr-php-client'); require_once('Apache/Solr/Service.php'); require_once('Apache/Solr/Document.php'); - set_include_path(get_include_path() . PATH_SEPARATOR . Director::baseFolder() . '/fulltextsearch/thirdparty/solr-php-client'); $included = true; }
Setting include_path *before* requiring paths relying on it
silverstripe_silverstripe-fulltextsearch
train
php
ae7de40fbcb197bba8eef08aee1de7d99e246bb3
diff --git a/src/Model/Response/Address.php b/src/Model/Response/Address.php index <HASH>..<HASH> 100644 --- a/src/Model/Response/Address.php +++ b/src/Model/Response/Address.php @@ -510,6 +510,15 @@ class Address extends AbstractModel */ protected $qcGeo; + /** + * @var string ISO-код страны (двухсимвольный) + */ + public $country_iso_code; + /** + * @var string ISO-код региона + */ + public $region_iso_code; + public function getPostalCode(): ?string { return $this->postalCode;
DADATA - added country and region ISO code properties
gietos_dadata
train
php
cea2457e54d21ec0139ae458477359cf01b059ff
diff --git a/nolearn/overfeat.py b/nolearn/overfeat.py index <HASH>..<HASH> 100644 --- a/nolearn/overfeat.py +++ b/nolearn/overfeat.py @@ -196,3 +196,10 @@ class OverFeatPy(ChunkedTransform, BaseEstimator): feat = self.merge(feat) features.append(feat) return np.vstack(features) + + def __getstate__(self): + return self.__dict__.copy() + + def __setstate__(self, state): + self.__dict__.update(state) + self.fit()
overfeat: Add pickle support
dnouri_nolearn
train
py
b70247dcb4ad8aaf3a071a95084442441a076059
diff --git a/dygraph.js b/dygraph.js index <HASH>..<HASH> 100644 --- a/dygraph.js +++ b/dygraph.js @@ -441,7 +441,8 @@ Dygraph.prototype.toDataYCoord = function(y, axis) { var area = this.plotter_.area; var yRange = this.yAxisRange(axis); - if (!axis.logscale) { + if (typeof(axis) == "undefined") axis = 0; + if (!this.axes_[axis].logscale) { return yRange[0] + (area.h - y) / area.h * (yRange[1] - yRange[0]); } else { // Computing the inverse of toDomCoord.
Zooming in log scale has been fixed, toDataCoordY was basically broken.
danvk_dygraphs
train
js
9fb49b706190d0858ca256624d4d19e72b0be9ca
diff --git a/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php b/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php index <HASH>..<HASH> 100644 --- a/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php +++ b/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php @@ -111,6 +111,10 @@ class PreparedSQLPlaceholdersSniff extends Sniff { $total_placeholders += $placeholders; } + if ( strpos( $content, '%' ) === false ) { + continue; + } + /* * Analyse the query for unsupported placeholders. */
PreparedSQLPlaceholders: minor efficiency fix Return early if no `%` signs are found at all in a text string.
WordPress-Coding-Standards_WordPress-Coding-Standards
train
php
8bd3309dd057f984fd451467796d0a46e853b452
diff --git a/core/src/main/java/org/testcontainers/containers/GenericContainer.java b/core/src/main/java/org/testcontainers/containers/GenericContainer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/testcontainers/containers/GenericContainer.java +++ b/core/src/main/java/org/testcontainers/containers/GenericContainer.java @@ -551,6 +551,8 @@ public class GenericContainer extends FailureDetectingExternalResource implement */ public Integer getMappedPort(final int originalPort) { + Preconditions.checkState(containerId != null, "Mapped port can only be obtained after the container is started"); + Ports.Binding[] binding = new Ports.Binding[0]; if (containerInfo != null) { binding = containerInfo.getNetworkSettings().getPorts().getBindings().get(new ExposedPort(originalPort)); @@ -559,7 +561,7 @@ public class GenericContainer extends FailureDetectingExternalResource implement if (binding != null && binding.length > 0 && binding[0] != null) { return binding[0].getHostPort(); } else { - return null; + throw new IllegalArgumentException("Requested port (" + originalPort +") is not mapped"); } }
Make getMappedPort fail fast if the container isn't started or does not have the requested port exposed. Refs #<I>
testcontainers_testcontainers-java
train
java
9fdd21ab1ff5bc38a372498bc1f4172a9a6653e2
diff --git a/fabric/runners.py b/fabric/runners.py index <HASH>..<HASH> 100644 --- a/fabric/runners.py +++ b/fabric/runners.py @@ -41,6 +41,9 @@ class Remote(Runner): # skipped all thread joining & cleanup; presumably regular interpreter # shutdown suffices to tie everything off well enough. if self.using_pty: + # Submit hex ASCII character 3, aka ETX, which most Unix PTYs + # interpret as a foreground SIGINT. + # TODO: is there anything else we can do here to be more portable? self.channel.send(u'\x03') else: raise interrupt
Enhance comment re: remote escape sequence
fabric_fabric
train
py
15b46c6a5ea8028ff782db90c9bb478392a3ca84
diff --git a/src/InputData/KeyValueIterator.php b/src/InputData/KeyValueIterator.php index <HASH>..<HASH> 100644 --- a/src/InputData/KeyValueIterator.php +++ b/src/InputData/KeyValueIterator.php @@ -29,7 +29,7 @@ trait KeyValueIterator { $keys = []; if(is_array($this->parameters)) { - $keys = $this->parameters; + $keys = array_keys($this->parameters); } else if($this->parameters instanceof InputData) { $keys = $this->parameters->getKeys();
Add missing call to array_keys
PhpGt_Input
train
php
d7351296602dd8004980096fe707e184046e5a4c
diff --git a/java/src/main/java/com/anaconda/skein/ApplicationMaster.java b/java/src/main/java/com/anaconda/skein/ApplicationMaster.java index <HASH>..<HASH> 100644 --- a/java/src/main/java/com/anaconda/skein/ApplicationMaster.java +++ b/java/src/main/java/com/anaconda/skein/ApplicationMaster.java @@ -101,6 +101,8 @@ public class ApplicationMaster { private NMClient nmClient; private ThreadPoolExecutor executor; private Thread allocatorThread; + private boolean shouldShutdown = false; + private UserGroupInformation ugi; private ByteBuffer tokens; @@ -154,7 +156,7 @@ public class ApplicationMaster { allocatorThread = new Thread() { public void run() { - while (true) { + while (!shouldShutdown) { try { long start = System.currentTimeMillis(); allocate(); @@ -177,7 +179,10 @@ public class ApplicationMaster { } private void stopAllocator() { - allocatorThread.interrupt(); + shouldShutdown = true; + if (!Thread.currentThread().equals(allocatorThread)) { + allocatorThread.interrupt(); + } } private void loadApplicationSpec() throws Exception {
Fix clean shutdown Previously there was a bug introduced that caused shutdown to error when all services exit cleanly, due to the allocator thread interrupting itself. We now handle shutdown smoothly in all cases.
jcrist_skein
train
java
18b1b773df1672188da4da3473fb0430d17dbabf
diff --git a/spec/unit/graph/simple_graph_spec.rb b/spec/unit/graph/simple_graph_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/graph/simple_graph_spec.rb +++ b/spec/unit/graph/simple_graph_spec.rb @@ -302,6 +302,13 @@ describe Puppet::Graph::SimpleGraph do end end + it "should report one-vertex loops" do + add_edges :a => :a + Puppet.expects(:err).with(regexp_matches(/Found 1 dependency cycle:\n\(Notify\[a\] => Notify\[a\]\)/)) + cycle = @graph.report_cycles_in_graph.first + expect_cycle_to_include(cycle, :a) + end + it "should report two-vertex loops" do add_edges :a => :b, :b => :a Puppet.expects(:err).with(regexp_matches(/Found 1 dependency cycle:\n\(Notify\[a\] => Notify\[b\] => Notify\[a\]\)/))
(maint) Add unit test for one vertex cycle
puppetlabs_puppet
train
rb
e57b4b819ee6bf0985a7912d5a5b204cab3dfff5
diff --git a/src/class-service-provider.php b/src/class-service-provider.php index <HASH>..<HASH> 100644 --- a/src/class-service-provider.php +++ b/src/class-service-provider.php @@ -30,6 +30,8 @@ abstract class Service_Provider { /** * Get the services provided by the provider. * + * @codeCoverageIgnore + * * @return array */ public function provides() {
Add codeCoverageIgnore to provides method
wpup_tank
train
php
74a847771ff35689ab4a98401ca83e0a0c4b0efa
diff --git a/actionpack/lib/action_dispatch/journey/visitors.rb b/actionpack/lib/action_dispatch/journey/visitors.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/journey/visitors.rb +++ b/actionpack/lib/action_dispatch/journey/visitors.rb @@ -1,14 +1,10 @@ # encoding: utf-8 -require 'thread_safe' - module ActionDispatch module Journey # :nodoc: module Visitors # :nodoc: class Visitor # :nodoc: - DISPATCH_CACHE = ThreadSafe::Cache.new { |h,k| - h[k] = :"visit_#{k}" - } + DISPATCH_CACHE = {} def accept(node) visit(node) @@ -38,8 +34,14 @@ module ActionDispatch def visit_STAR(n); unary(n); end def terminal(node); end - %w{ LITERAL SYMBOL SLASH DOT }.each do |t| - class_eval %{ def visit_#{t}(n); terminal(n); end }, __FILE__, __LINE__ + def visit_LITERAL(n); terminal(n); end + def visit_SYMBOL(n); terminal(n); end + def visit_SLASH(n); terminal(n); end + def visit_DOT(n); terminal(n); end + + private_instance_methods(false).each do |pim| + next unless pim =~ /^visit_(.*)$/ + DISPATCH_CACHE[$1.to_sym] = pim end end
prepopulate the dispatch cache so we don't need the ThreadSafe cache.
rails_rails
train
rb
e3d2430d3982ec9d96ee3cf821f5433ede79d8c0
diff --git a/pysndfx/sndfiles.py b/pysndfx/sndfiles.py index <HASH>..<HASH> 100644 --- a/pysndfx/sndfiles.py +++ b/pysndfx/sndfiles.py @@ -11,7 +11,8 @@ ENCODINGS_MAPPING = {np.int16: "s16", PIPE_CHAR = "-" -class SoxInput: + +class SoxInput(object): pipe = "-" def __init__(self):
Added object root class to fix super()-related problems
carlthome_python-audio-effects
train
py
b5b4ff83d52059533b2e7398504d7765430f001a
diff --git a/includes/customizer/class-fs-customizer-upsell-control.php b/includes/customizer/class-fs-customizer-upsell-control.php index <HASH>..<HASH> 100644 --- a/includes/customizer/class-fs-customizer-upsell-control.php +++ b/includes/customizer/class-fs-customizer-upsell-control.php @@ -78,7 +78,8 @@ continue; } - if ( ! is_array( $pricing->plans[ $i ]->features ) ) { + if ( ! isset( $pricing->plans[ $i ]->features ) || + ! is_array( $pricing->plans[ $i ]->features ) ) { $pricing->plans[$i]->features = array(); }
[theme] [customizer] [pricing] [plans] [features] Fixed an issue with the logic related to the loading of the plans' features.
Freemius_wordpress-sdk
train
php
a2c8616aab3a1f5bed6d32e4b77c77226cca58b7
diff --git a/lib/heroku/helpers.rb b/lib/heroku/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/helpers.rb +++ b/lib/heroku/helpers.rb @@ -22,8 +22,8 @@ module Heroku puts(msg) else print(msg) - $stdout.flush end + $stdout.flush end def redisplay(line, line_break = false)
ensure stdout is flushed whenever we want to display something
heroku_legacy-cli
train
rb
12d8dd35590de0bbb55be6497043fe1dc73ff9ec
diff --git a/servers/src/main/java/tachyon/UserInfo.java b/servers/src/main/java/tachyon/UserInfo.java index <HASH>..<HASH> 100644 --- a/servers/src/main/java/tachyon/UserInfo.java +++ b/servers/src/main/java/tachyon/UserInfo.java @@ -56,15 +56,15 @@ public class UserInfo { } @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - UserInfo userInfo = (UserInfo) o; - return mUserId == userInfo.mUserId; - } + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UserInfo userInfo = (UserInfo) o; + return mUserId == userInfo.mUserId; + } - @Override - public int hashCode() { - return (int) (mUserId ^ (mUserId >>> 32)); - } + @Override + public int hashCode() { + return (int) (mUserId ^ (mUserId >>> 32)); + } }
Update UserInfo.java fixed indentation.
Alluxio_alluxio
train
java
d87365494a87927ef32b4b43ada19ff67d3cddc3
diff --git a/pkg/kubelet/cm/devicemanager/manager.go b/pkg/kubelet/cm/devicemanager/manager.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/cm/devicemanager/manager.go +++ b/pkg/kubelet/cm/devicemanager/manager.go @@ -730,7 +730,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi // Then give the plugin the chance to influence the decision on any // remaining devices to allocate. - preferred, err := m.callGetPreferredAllocationIfAvailable(podUID, contName, resource, available.Union(devices), devices, required) + preferred, err := m.callGetPreferredAllocationIfAvailable(podUID, contName, resource, available.Union(allocated), allocated, required) if err != nil { return nil, err }
Fix bug in call to callGetPreferredAllocationIfAvailable() Previously, we were passing the variable 'devices' to this function, when we should have been passing 'allocated'. This bug crept in due to a variable name change that didn't propogate its way through the entire function. The tests added in the previous commit would have caught this.
kubernetes_kubernetes
train
go
6bd0f7c7cb34894a5ab99e3cdba2ace3eec299ae
diff --git a/tracing.go b/tracing.go index <HASH>..<HASH> 100644 --- a/tracing.go +++ b/tracing.go @@ -95,7 +95,10 @@ func setupTracing(rootSpanName string) (opentracing.Span, context.Context, error span.SetTag("source", "agent") span.SetTag("root-span", "true") - agentLog.Debugf("created root span %v", span) + // See comment in trace(). + if tracing { + agentLog.Debugf("created root span %v", span) + } // Associate the root span with the context ctx = opentracing.ContextWithSpan(ctx, span) @@ -134,7 +137,12 @@ func trace(ctx context.Context, subsystem, name string) (opentracing.Span, conte span.SetTag("subsystem", subsystem) - agentLog.Debugf("created span %v", span) + // This is slightly confusing: when tracing is disabled, trace spans + // are still created - but the tracer used is a NOP. Therefore, only + // display the message when tracing is really enabled. + if tracing { + agentLog.Debugf("created span %v", span) + } return span, ctx }
tracing: Hide trace messages unless tracing enabled Don't log trace-related messages unless tracing is actually enabled. If tracing is not enabled, trace spans are still created, but the tracer is a NOP. However, this is an implementation detail the user does not need to be aware of so hide trace logs unless the user has enabled tracing explicitly. Fixes #<I>.
kata-containers_agent
train
go
c34dee3206a0ac55e2aed8b474d351f32f631267
diff --git a/shared/reducers/search.js b/shared/reducers/search.js index <HASH>..<HASH> 100644 --- a/shared/reducers/search.js +++ b/shared/reducers/search.js @@ -77,6 +77,7 @@ export default function (state: State = initialState, action: SearchActions): St : state.selectedUsers.concat(maybeUpgradedUser), showUserGroup: true, searchHintText: 'Search for another user', + results: [], searchText: null, searchPlatform: null, } @@ -93,9 +94,11 @@ export default function (state: State = initialState, action: SearchActions): St case Constants.removeUserFromGroup: if (!action.error) { const user = action.payload.user + const nextSelectedUsers = state.selectedUsers.filter(u => u !== user) return { ...state, - selectedUsers: state.selectedUsers.filter(u => u !== user), + showUserGroup: nextSelectedUsers.length === 0 ? false : state.showUserGroup, + selectedUsers: nextSelectedUsers, } } break
Hide User Group if removing the last user from group (#<I>)
keybase_client
train
js
076ea08a819eebd56c45774ea3e68568bd19b6d4
diff --git a/frontend/components/panels/BaseClassPanel.js b/frontend/components/panels/BaseClassPanel.js index <HASH>..<HASH> 100644 --- a/frontend/components/panels/BaseClassPanel.js +++ b/frontend/components/panels/BaseClassPanel.js @@ -115,10 +115,11 @@ class BaseClassPanel extends React.Component { getCreditsString() { // Figure out the credits string - if (this.props.aClass.maxCredits === this.props.aClass.minCredits) { - return `${this.props.aClass.minCredits} credits`; + let retStr = ''; + if (this.props.aClass.maxCredits !== this.props.aClass.minCredits) { + retStr = `${this.props.aClass.minCredits} to `; } - return `${this.props.aClass.minCredits} to ${this.props.aClass.maxCredits} credits`; + return `${retStr}${this.props.aClass.maxCredits} credits`; } // The argument wrapper func is optional
removed redundant string from getCreditsString.
ryanhugh_searchneu
train
js
c1e263abcd545854a38c36ccfa2e40e699ed2fff
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from setuptools import setup, find_packages setup( name='lw12', - version='0.9.0', + version='0.9.1', description='Library to control the Lagute LW-12 WiFi LED controller.', url='https://github.com/jaypikay/python-lw12', author='Julian Knauer', @@ -20,14 +20,12 @@ setup( classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', - 'Topic :: Software Development :: Build Tools', - 'Topic :: Software Development :: Smart Home', - 'Topic :: Software Development :: Home Automation', - 'Topic :: Software Development :: Light', + 'Topic :: Home Automation', + 'Topic :: Internet', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', ], keywords='smarthome homeautomation lw12 lagute led light development', py_modules=['lw12'],
Added classifiers for pypi
jaypikay_python-lw12
train
py
4b84efa308238b271e53af14cd74fd0949021739
diff --git a/lib/guard/unicorn.rb b/lib/guard/unicorn.rb index <HASH>..<HASH> 100644 --- a/lib/guard/unicorn.rb +++ b/lib/guard/unicorn.rb @@ -17,8 +17,8 @@ module Guard @run_as_daemon = options.fetch(:daemonize, false) - @pid_path = File.join("tmp", "pids", "unicorn.pid") - @config_path = File.join("config", "unicorn.rb") + @pid_path = options.fetch(:pid_file) || File.join("tmp", "pids", "unicorn.pid") + @config_path = options.fetch(:config_file) || File.join("config", "unicorn.rb") super end
Actually support pid_file & config_file options
J3RN_guard-foreman
train
rb
1de2cf7e0d69eeaea5f007217becf1848ac05f4f
diff --git a/src/main/java/io/lettuce/core/RedisCommandBuilder.java b/src/main/java/io/lettuce/core/RedisCommandBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/lettuce/core/RedisCommandBuilder.java +++ b/src/main/java/io/lettuce/core/RedisCommandBuilder.java @@ -38,7 +38,6 @@ import io.lettuce.core.output.*; import io.lettuce.core.protocol.BaseRedisCommandBuilder; import io.lettuce.core.protocol.Command; import io.lettuce.core.protocol.CommandArgs; -import io.lettuce.core.protocol.CommandKeyword; import io.lettuce.core.protocol.CommandType; import io.lettuce.core.protocol.RedisCommand; @@ -2695,7 +2694,6 @@ class RedisCommandBuilder<K, V> extends BaseRedisCommandBuilder<K, V> { CommandArgs<K, V> args = new CommandArgs<>(codec); args.add(keys.length).addKeys(keys); - System.out.println(args); return createCommand(ZDIFF, new ValueListOutput<>(codec), args); }
Polishing #<I> Remove system.out call
lettuce-io_lettuce-core
train
java
9baf6079bdc78099a69c0aa180a5762baf511edb
diff --git a/safe/gui/tools/wizard/wizard_strings.py b/safe/gui/tools/wizard/wizard_strings.py index <HASH>..<HASH> 100644 --- a/safe/gui/tools/wizard/wizard_strings.py +++ b/safe/gui/tools/wizard/wizard_strings.py @@ -228,3 +228,17 @@ create_postGIS_connection_first = tr( 'You can manage connections under the ' '<i>Layer</i> > <i>Add Layer</i> > <i>Add PostGIS Layers</i> ' 'menu.</html>') +multiple_classified_hazard_classifications = tr( + 'You have selected <b>%s %s</b> and attribute <b>%s</b>.' + 'Please select hazard classifications for each exposure type.' + 'If you want to edit the value mapping, you can click edit button next to ' + 'each and you can do value mapping in the right panel.' + 'Do not forget to save the value mapping before you continue to the next ' + 'step.') # (subcategory, category, field) +multiple_continuous_hazard_classifications = tr( + 'You have selected <b>%s %s</b> and attribute <b>%s</b>.' + 'Please select hazard classifications for each exposure type.' + 'If you want to edit the thresholds, you can click edit button next to ' + 'each and you can edit the threshold in the right panel.' + 'Do not forget to save the thresholds before you continue to the next ' + 'step.') # (subcategory, category, field)
New wizard string for multiple hazard classifications.
inasafe_inasafe
train
py
c20a3717577c1ea27258c75c7bf8d71ef960c393
diff --git a/vendor/k8s.io/kubernetes/test/e2e/third-party.go b/vendor/k8s.io/kubernetes/test/e2e/third-party.go index <HASH>..<HASH> 100644 --- a/vendor/k8s.io/kubernetes/test/e2e/third-party.go +++ b/vendor/k8s.io/kubernetes/test/e2e/third-party.go @@ -72,7 +72,7 @@ var _ = Describe("ThirdParty resources [Flaky] [Disruptive]", func() { } Context("Simple Third Party", func() { - It("creating/deleting thirdparty objects works [Conformance]", func() { + It("creating/deleting thirdparty objects works", func() { defer func() { if err := f.ClientSet.Extensions().ThirdPartyResources().Delete(rsrc.Name, nil); err != nil { framework.Failf("failed to delete third party resource: %v", err)
UPSTREAM: <I>: Third party resources should not be part of conformance They are alpha and were sunset and replaced by CRD.
openshift_origin
train
go
367e8ad3bc40dd9be637ca36765ed8218a80c4f8
diff --git a/src/angular-ui-query-builder-tables.js b/src/angular-ui-query-builder-tables.js index <HASH>..<HASH> 100644 --- a/src/angular-ui-query-builder-tables.js +++ b/src/angular-ui-query-builder-tables.js @@ -363,7 +363,7 @@ angular.module('angular-ui-query-builder') if (qbTableSettings.pagination.showXOfY) { $scope.showRange = { start: ($scope.qbTable.query.skip || 0) + 1, - end: ($scope.qbTable.query.skip || 0) + $scope.qbTable.query.limit, + end: Math.min(($scope.qbTable.query.skip || 0) + $scope.qbTable.query.limit, $scope.qbTable.count), total: $scope.qbTable.count, }; }
BUGFIX: Limit calculation now actually makes sense (e.g. "1 of <I>" when only 2 records are available)
MomsFriendlyDevCo_angular-ui-query-builder
train
js
2180b8513da196d50f3779d719c521d4a50efbb0
diff --git a/src/Factory.php b/src/Factory.php index <HASH>..<HASH> 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -17,7 +17,10 @@ class Factory */ public static function setLocale( $locale ) { - static::$locale = strtolower( locale_get_primary_language( $locale ) ); + if( class_exists( 'Locale' ) ) { + $locale = strtolower( \Locale::getPrimaryLanguage( $locale ) ); + } + static::$locale = $locale; if( func_num_args() > 1 ) { static::$dir = func_get_arg(1); } diff --git a/src/Rules.php b/src/Rules.php index <HASH>..<HASH> 100644 --- a/src/Rules.php +++ b/src/Rules.php @@ -134,7 +134,10 @@ class Rules implements \ArrayAccess, \IteratorAggregate { static::$dir = $dir; if( !$locale ) return static::$locale; - static::$locale = strtolower( locale_get_primary_language( $locale ) ); + if( class_exists( 'Locale' ) ) { + $locale = strtolower( \Locale::getPrimaryLanguage( $locale ) ); + } + static::$locale = $locale; return static::$locale; }
in case Locale class is not present, use the $locale as is.
WScore_Validation
train
php,php
5fc26ecbc669e2f647f00de04b3082c4fc6be8bf
diff --git a/src/urh/util/Logger.py b/src/urh/util/Logger.py index <HASH>..<HASH> 100644 --- a/src/urh/util/Logger.py +++ b/src/urh/util/Logger.py @@ -1,7 +1,7 @@ import logging from urh.constants import color -logging.basicConfig(level=logging.WARNING, format='[%(levelname)s] %(message)s') +logging.basicConfig(level=logging.WARNING, format='[%(levelname)s::%(filename)s::%(funcName)s] %(message)s') logging_colors_per_level = { logging.WARNING: color.YELLOW,
add filename and method name to logs
jopohl_urh
train
py
c4387e1e8a8b22e1ed19980d1e997e1f601e78b3
diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicatorTests.java @@ -56,12 +56,14 @@ public class CouchbaseHealthIndicatorTests { @Test public void couchbaseIsDown() { CouchbaseOperations couchbaseOperations = mock(CouchbaseOperations.class); - given(couchbaseOperations.getCouchbaseClusterInfo()).willThrow(new NullPointerException()); + given(couchbaseOperations.getCouchbaseClusterInfo()).willThrow( + new IllegalStateException("test, expected")); CouchbaseHealthIndicator healthIndicator = new CouchbaseHealthIndicator( couchbaseOperations); Health health = healthIndicator.health(); assertThat(health.getStatus()).isEqualTo(Status.DOWN); - assertThat((String) health.getDetails().get("error")).contains("null"); + assertThat((String) health.getDetails().get("error")).contains("test, expected"); verify(couchbaseOperations).getCouchbaseClusterInfo(); } + }
Polish "Add CouchbaseHealthIndicatorTests" Closes gh-<I>
spring-projects_spring-boot
train
java
bbf35e5a7c7d4c8889317eacfda5475f69ce8647
diff --git a/vcardtools/vcardtool.py b/vcardtools/vcardtool.py index <HASH>..<HASH> 100755 --- a/vcardtools/vcardtool.py +++ b/vcardtools/vcardtool.py @@ -10,14 +10,14 @@ import argparse import sys try: - import vcf_merge - import vcf_splitter + from . import vcf_merge + from . import vcf_splitter except ImportError: print(sys.path) raise -if __name__ == '__main__': +def main(): parser = argparse.ArgumentParser(prog='vcardtool') sub_parsers = parser.add_subparsers(help='sub-command help') @@ -30,4 +30,12 @@ if __name__ == '__main__': parser_split.set_defaults(func=vcf_splitter.main) args = parser.parse_args(sys.argv[1:]) - args.func(args) + try: + args.func(args) + except AttributeError: + parser.print_usage() + sys.exit(1) + + +if __name__ == '__main__': + main()
Fix entry point for pip installation.
dmwilcox_vcard-tools
train
py
a9b40ee797f780f675f65dda61c39c7fd45a53ed
diff --git a/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php b/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php +++ b/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php @@ -100,7 +100,11 @@ abstract class AbstractCommand extends Command protected function getMigrationConfiguration(InputInterface $input, OutputInterface $output) { if (!$this->migrationConfiguration) { - $configHelper = new ConfigurationHelper($this->getConnection($input), $this->configuration); + if ($this->getHelperSet()->has('configuration')) { + $configHelper = $this->getHelperSet()->get('configuration'); + } else { + $configHelper = new ConfigurationHelper($this->getConnection($input), $this->configuration); + } $this->migrationConfiguration = $configHelper->getMigrationConfig($input, $this->getOutputWriter($output)); }
Made a configuration to also check for an existing comfiguration helper in HelperSet and use it.
doctrine_migrations
train
php
b13ec5fa28ac78356a3532c7a3d16d0505cbde93
diff --git a/commands/review/post/command.go b/commands/review/post/command.go index <HASH>..<HASH> 100644 --- a/commands/review/post/command.go +++ b/commands/review/post/command.go @@ -394,15 +394,14 @@ Please pick up the story to assign the commit to:`, commit.SHA, commit.MessageTi story = selectedStory } - // Amend the commit message to include Story-Id. - commit.Message += fmt.Sprintf("\nStory-Id: %v\n", story.ReadableId()) - commit.StoryId = story.ReadableId() + // Extend the commit message to include Story-Id. + commitMessage := fmt.Sprintf("%v\nStory-Id: %v\n", commit.Message, story.ReadableId()) // Amend the cherry-picked commit to include the new commit message. msg = "Amend the commit message for " + commit.SHA stderr = new(bytes.Buffer) cmd := exec.Command("git", "commit", "--amend", "-F", "-") - cmd.Stdin = bytes.NewBufferString(commit.Message) + cmd.Stdin = bytes.NewBufferString(commitMessage) cmd.Stderr = stderr if err := cmd.Run(); err != nil { return commits, errs.NewError(msg, stderr, err)
review post: Use new variable to keep commit msg When amending the commit message during review post, the new message is saved in the commit object that is being processes. But that is not the commit that is going to be created with the new commit message. It makes more sense to keep the value in a new variable, not changing the commit struct at all. Story-Id: SF-<I> Change-Id: <I>d5b<I>
salsaflow_salsaflow
train
go
f832ab7e754cd32bf743a7f9713bbc42337fc3af
diff --git a/tofu/openadas2tofu/_read_files.py b/tofu/openadas2tofu/_read_files.py index <HASH>..<HASH> 100644 --- a/tofu/openadas2tofu/_read_files.py +++ b/tofu/openadas2tofu/_read_files.py @@ -483,7 +483,9 @@ def _read_adf15(pfe, dout=None, func = scpRectSpl(np.log(ne)+6, np.log(te), np.log(pec).reshape((nne, nte))+6, kx=deg, ky=deg) - dout[key] = {'lamb': lamb, + dout[key] = {'lambda': lamb, + 'ION': '{}{}+'.format(elem, charge), + 'symbol': '{}{}-{}'.format(typ0, typ1, isoel), 'origin': pfe, 'type': typ[0], 'ne': ne, 'te': te, diff --git a/tofu/version.py b/tofu/version.py index <HASH>..<HASH> 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,2 +1,2 @@ # Do not edit, pipeline versioning governed by git tags! -__version__ = '1.4.2b4-90-g0d3af17c' +__version__ = '1.4.2b4-91-gb9a55dc7'
[Issue<I>] Improve consistency with Issue<I> for dlines dict out of _read_adf<I>()
ToFuProject_tofu
train
py,py
45da8f3905b03f92dd3f23e7ac9e08d5e05a0f31
diff --git a/lib/local/index.js b/lib/local/index.js index <HASH>..<HASH> 100644 --- a/lib/local/index.js +++ b/lib/local/index.js @@ -44,8 +44,7 @@ module.exports = function (settings, callback) { } var args = browser.args || []; - args.push(url); - instance.start(browser.command, args, settings, browser, function(err, instance) { + instance.start(browser.command, args.concat(url), settings, browser, function(err, instance) { if(err) { return callback(err); }
Modified args option not to retain url in memory. Fixes #<I>.
bitovi_launchpad
train
js
f3ad3a6bd69e5bc41eea74b8daebf661d4ac5a45
diff --git a/src/tagify.js b/src/tagify.js index <HASH>..<HASH> 100644 --- a/src/tagify.js +++ b/src/tagify.js @@ -100,7 +100,7 @@ Tagify.prototype = { var _s = this.settings = extend({}, DEFAULTS, settings) _s.disabled = input.hasAttribute('disabled') - _s.readonly = input.hasAttribute('readonly') // if "readonly" do not include an "input" element inside the Tags component + _s.readonly = _s.readonly || input.hasAttribute('readonly') _s.placeholder = input.getAttribute('placeholder') || _s.placeholder || "" _s.required = input.hasAttribute('required') @@ -960,7 +960,7 @@ Tagify.prototype = { setReadonly( toggle, attrribute ){ var _s = this.settings - document.activeElement.blur() // exists possible edit-mode + document.activeElement.blur() // exit possible edit-mode _s[attrribute || 'readonly'] = toggle this.DOM.scope[(toggle ? 'set' : 'remove') + 'Attribute'](attrribute || 'readonly', true)
added "readonly" to be able to be configured from the settings and not only as an attribute on the original input
yairEO_tagify
train
js
b619d679c5d8edf7a191b1b73908989b597ff5e9
diff --git a/foundations/parsers.py b/foundations/parsers.py index <HASH>..<HASH> 100644 --- a/foundations/parsers.py +++ b/foundations/parsers.py @@ -736,14 +736,14 @@ class SectionsFileParser(foundations.io.File): :type stripQuotationMarkers: bool :param raiseParsingErrors: Raise parsing errors. :type raiseParsingErrors: bool - :return: Method success. - :rtype: bool + :return: SectionFileParser instance. + :rtype: SectionFileParser """ LOGGER.debug("> Reading sections from: '{0}'.".format(self.path)) if not self.content: - return False + self.read() attributes = {} if not self.__preserveOrder else OrderedDict() section = self.__defaultsSection
Ensure "foundations.parsers.SectionsFileParser.parse" method reads current file content if no content has been previously set. Closes #<I>.
KelSolaar_Foundations
train
py
7bc01862361c43db05414c6167df5968de2c40b2
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,7 +22,7 @@ gulp.task('jscs-watch', function() { gulp.task('jshint', function() { return gulp.src(paths.filesToLint) .pipe($.jshint()) - .pipe($.jshint.reporter('default')); + .pipe($.jshint.reporter('jshint-stylish')); }); gulp.task('test', ['jshint', 'jscs'], function(){
use jshint-stylish reporter
approvals_Approvals.NodeJS
train
js
977eb462103f283977213cfb429703f5cb6a066b
diff --git a/tabular_validator/validators/schema.py b/tabular_validator/validators/schema.py index <HASH>..<HASH> 100644 --- a/tabular_validator/validators/schema.py +++ b/tabular_validator/validators/schema.py @@ -12,7 +12,7 @@ RESULTS = { 'incorrect_headers': { 'id': 'incorrect_headers', 'name': 'Incorrect Headers', - 'msg': 'The headers do not match the schema.' + 'msg': 'The headers do not match the schema. Data has {0}, but they should be {1}.' }, 'incorrect_dimensions': { 'id': 'incorrect_dimensions', @@ -85,7 +85,7 @@ class SchemaValidator(base.Validator): self.name, self.RESULT_CATEGORY_HEADER, self.RESULT_LEVEL_ERROR, - _type['msg'], + _type['msg'].format(headers, self.schema.headers), _type['id'], _type['name'], headers, @@ -106,7 +106,7 @@ class SchemaValidator(base.Validator): self.name, self.RESULT_CATEGORY_HEADER, self.RESULT_LEVEL_ERROR, - _type['msg'], + _type['msg'].format(headers, self.schema.headers), _type['id'], _type['name'], headers,
Sow header in error message when headers are not according to schema.
frictionlessdata_goodtables-py
train
py
bf562051593afd2c666ce67f2e31566837a9fafa
diff --git a/Testing/Fakes/MailFake.php b/Testing/Fakes/MailFake.php index <HASH>..<HASH> 100644 --- a/Testing/Fakes/MailFake.php +++ b/Testing/Fakes/MailFake.php @@ -86,7 +86,10 @@ class MailFake implements Mailer, MailQueue */ public function assertNothingSent() { - PHPUnit::assertEmpty($this->mailables, 'Mailables were sent unexpectedly.'); + $mailableNames = collect($this->mailables)->values()->map(function ($mailable) { + return get_class($mailable); + })->join(', '); + PHPUnit::assertEmpty($this->mailables, 'The following Mailables were sent unexpectedly: ' . $mailableNames); } /**
Show the names of any Mailables which were sent unexpectedly in tests
illuminate_support
train
php
875e126c32f8d37cf32f4b421673662d56d6d58d
diff --git a/src/org/openscience/cdk/fingerprint/Fingerprinter.java b/src/org/openscience/cdk/fingerprint/Fingerprinter.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/fingerprint/Fingerprinter.java +++ b/src/org/openscience/cdk/fingerprint/Fingerprinter.java @@ -54,6 +54,8 @@ import org.openscience.cdk.tools.LoggingTool; * BitSet fingerprint = Fingerprinter.getFingerprint(molecule);s * </pre> * + * <p>The FingerPrinter assumes that hydrogens are explicitely given! + * * @author steinbeck * @cdk.created 2002-02-24 *
Added comment about the requirement to have explicit hydrogens git-svn-id: <URL>
cdk_cdk
train
java
17079da3549ea62c92cd6d1998629630b7ca1e02
diff --git a/components/rack/rack-metadata/src/main/java/org/torquebox/rack/metadata/TorqueBoxYamlParser.java b/components/rack/rack-metadata/src/main/java/org/torquebox/rack/metadata/TorqueBoxYamlParser.java index <HASH>..<HASH> 100644 --- a/components/rack/rack-metadata/src/main/java/org/torquebox/rack/metadata/TorqueBoxYamlParser.java +++ b/components/rack/rack-metadata/src/main/java/org/torquebox/rack/metadata/TorqueBoxYamlParser.java @@ -58,7 +58,7 @@ public class TorqueBoxYamlParser { public RackApplicationMetaData getMetaData() { if (this.metaData == null) { - this.metaData = new RackApplicationMetaData(); + this.metaData = new WriteOnceRackApplicationMetaData(); } return this.metaData; }
Kinda critical. First setter wins!
torquebox_torquebox
train
java
f548c88357e8e50c0634d5f3ca6df319f747c1a8
diff --git a/lib/active_storage/service/upyun_service.rb b/lib/active_storage/service/upyun_service.rb index <HASH>..<HASH> 100644 --- a/lib/active_storage/service/upyun_service.rb +++ b/lib/active_storage/service/upyun_service.rb @@ -37,7 +37,7 @@ module ActiveStorage @upyun = Upyun::Rest.new(bucket, operator, password, options) end - def upload(key, io, checksum: nil) + def upload(key, io, checksum: nil, content_type: nil, disposition: nil, filename: nil) instrument :upload, key: key, checksum: checksum do begin result = @upyun.put(path_for(key), io) diff --git a/lib/activestorage_upyun/version.rb b/lib/activestorage_upyun/version.rb index <HASH>..<HASH> 100644 --- a/lib/activestorage_upyun/version.rb +++ b/lib/activestorage_upyun/version.rb @@ -1,3 +1,3 @@ module ActivestorageUpyun - VERSION = '0.4.0' + VERSION = '0.5.0' end
add other args for upload method
doabit_activestorage_upyun
train
rb,rb
d6996ebef59efbb3101bac0e2e049fbc9e676d2c
diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index <HASH>..<HASH> 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -188,8 +188,6 @@ begin # tests from chef-server as the user acls are not supported in chef-zero # at this time. "--skip-chef-zero-quirks", - - "--skip-status" ] # The knife tests are very slow and don't give us a lot of extra coverage,
remove --skip-status status endpoint was removed
chef_chef-zero
train
rb
15ac97d3ea158d6bf4ee951927de5df145c78ead
diff --git a/_tests/integration/version_test.go b/_tests/integration/version_test.go index <HASH>..<HASH> 100644 --- a/_tests/integration/version_test.go +++ b/_tests/integration/version_test.go @@ -14,7 +14,7 @@ func Test_VersionOutput(t *testing.T) { { out, err := command.RunCommandAndReturnCombinedStdoutAndStderr(binPath(), "version") require.NoError(t, err, out) - require.Equal(t, "0.12.0", out) + require.Equal(t, "0.12.1", out) } t.Log("Version --full") @@ -23,7 +23,7 @@ func Test_VersionOutput(t *testing.T) { require.NoError(t, err, out) expectedOSVersion := fmt.Sprintf("%s (%s)", runtime.GOOS, runtime.GOARCH) - expectedVersionOut := fmt.Sprintf(`version: 0.12.0 + expectedVersionOut := fmt.Sprintf(`version: 0.12.1 os: %s go: %s build_number: diff --git a/version/version.go b/version/version.go index <HASH>..<HASH> 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // VERSION ... -const VERSION = "0.12.0" +const VERSION = "0.12.1"
Version bump (#<I>)
bitrise-io_stepman
train
go,go
2010b8523e2276f5a2748830693442611e920a43
diff --git a/lib/functions/index.js b/lib/functions/index.js index <HASH>..<HASH> 100644 --- a/lib/functions/index.js +++ b/lib/functions/index.js @@ -549,6 +549,13 @@ exports['-adjust'] = function(color, prop, amount){ var hsl = color.hsla; prop = { hue: 'h', saturation: 's', lightness: 'l' }[prop.string]; if (!prop) throw new Error('invalid adjustment property'); + var value = amount.val; + switch (amount.type) { + case '%': + value = hsl[prop] * (value / 100); + default: + break; + } hsl[prop] = hsl[prop] + amount.val; return hsl.clone(); -}; \ No newline at end of file +};
added a way to use relative values in adjust function
stylus_stylus
train
js
2a7633f3de35492e475cc7c80e622b40128bfd43
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ setup( 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Intended Audience :: Developers', 'Topic :: Utilities' ]
Add Python <I> to the list of supported Python versions.
contains-io_rcli
train
py
98e46ac23cee85b3a7a51fd5f7ce013f7f0948b3
diff --git a/atrcopy/dos33.py b/atrcopy/dos33.py index <HASH>..<HASH> 100644 --- a/atrcopy/dos33.py +++ b/atrcopy/dos33.py @@ -659,16 +659,18 @@ class Dos33BinFile: if _xd: log.debug("Initial parsing: size=%d" % self.size) if len(b[pos:pos + 4]) == 4: start, count = b[pos:pos + 4].view(dtype='<u2') + if count != self.size - 4: + raise errors.InvalidBinaryFile(f"Extra data after BSAVE segment: file size {self.size}, header specifies {count} bytes") s[pos:pos + 4] = get_style_bits(data=True) data = b[pos + 4:pos + 4 + count] if len(data) == count: name = "BSAVE data" % start else: - name = "Incomplete data: expected %04x, loaded %04x" % (count, len(data)) + raise errors.InvalidBinaryFile(f"Incomplete BSAVE data: expected {count}, loaded {len(data)}") self.segments.append(ObjSegment(r[pos + 4:pos + 4 + count], pos, pos + 4, start, start + len(data), name)) else: - self.segments.append(ObjSegment(r[pos:pos + 4], 0, 0, 0, len(b[pos:pos + 4]), "Short Segment Header")) + raise errors.InvalidBinaryFile(f"Invalid BSAVE header") class ProdosHeader(Dos33Header):
Refs #1: BSAVE parser now much more strict on detecting valid file * size specified in header must now match exactly to the length of data in the file * i.e.: rejects incomplete files and files with extra data
robmcmullen_atrcopy
train
py
c9dfed37c222cf8bc5e831cbc63c4d2bf954018f
diff --git a/mod/quiz/questionlib.php b/mod/quiz/questionlib.php index <HASH>..<HASH> 100644 --- a/mod/quiz/questionlib.php +++ b/mod/quiz/questionlib.php @@ -529,7 +529,7 @@ function quiz_regrade_question_in_attempt($question, $attempt, $cmoptions, $verb } else { echo ' #'.$attempt->id; } - echo "\n"; flush(); ob_flush(); + echo "\n"; @flush(); @ob_flush(); } return true;
Silenced notices produced by flush() and ob_flush() in regrading code.
moodle_moodle
train
php
e35db8364e5fe9d204898f91da846787d5fcc18f
diff --git a/balebot/updater.py b/balebot/updater.py index <HASH>..<HASH> 100644 --- a/balebot/updater.py +++ b/balebot/updater.py @@ -59,9 +59,10 @@ class Updater: self.stop() def stop(self): - redis_db.set(self.token, pickle.dumps( - BotState(conversation_next_step_handlers=self.dispatcher.conversation_next_step_handlers, - conversation_data=self.dispatcher.conversation_data))) + if Config.state_holder: + redis_db.set(self.token, pickle.dumps( + BotState(conversation_next_step_handlers=self.dispatcher.conversation_next_step_handlers, + conversation_data=self.dispatcher.conversation_data))) self.dispatcher.bot.network.stop_network() self._stop_dispatcher() self._loop.stop()
fix: state holding problem at stop fixed
balemessenger_bale-bot-python
train
py
51876b0e0ac6e52e5b90502572fb1c6c1899836a
diff --git a/src/Models/Menu.php b/src/Models/Menu.php index <HASH>..<HASH> 100644 --- a/src/Models/Menu.php +++ b/src/Models/Menu.php @@ -107,6 +107,11 @@ class Menu extends Model private static function processItems($items) { + // Eagerload Translations + if (config('voyager.multilingual.enabled')) { + $items->load('translations'); + } + $items = $items->transform(function ($item) { // Translate title $item->title = $item->getTranslatedAttribute('title');
Eager load Menu Items translations (#<I>) * Eager load Menu Items translations When multilingual is enabled this PR removes one query for each menu item and adds one query for each nested group. * removed eagerload for non admin menu because it's already done inside the template -_-'
the-control-group_voyager
train
php
bfce38c87eeb917fba8967d832ebb72d965b26c3
diff --git a/lib/sensu/api.rb b/lib/sensu/api.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/api.rb +++ b/lib/sensu/api.rb @@ -446,6 +446,9 @@ module Sensu unless checks.empty? checks.each_with_index do |check_name, index| $redis.smembers('aggregates:' + check_name) do |aggregates| + aggregates.map! do |issued| + issued.to_i + end item = { :check => check_name, :issued => aggregates.sort.reverse @@ -465,12 +468,15 @@ module Sensu aget %r{/aggregates/([\w\.-]+)$} do |check_name| $redis.smembers('aggregates:' + check_name) do |aggregates| unless aggregates.empty? + aggregates.map! do |issued| + issued.to_i + end valid_request = true if params[:age] if params[:age] =~ /^[0-9]+$/ timestamp = Time.now.to_i - params[:age].to_i aggregates.reject! do |issued| - issued.to_i > timestamp + issued > timestamp end else valid_request = false
[api] fixed aggregate issued data type, string -> int
sensu_sensu
train
rb
228e1a6a00ff92a4f513a5390310c3a0526cc599
diff --git a/commands/WirelessCommand/connect/executor.js b/commands/WirelessCommand/connect/executor.js index <HASH>..<HASH> 100644 --- a/commands/WirelessCommand/connect/executor.js +++ b/commands/WirelessCommand/connect/executor.js @@ -1,3 +1,6 @@ + +var extend = require('xtend'); + /*** * Executes a command, collecting the output from stdout and stderr. * @param cmd @@ -5,6 +8,10 @@ * @param cb callback that receives (error, exitCode, stdout, stderr) */ function runCommand(cmd, args, cb) { + + // set locale so we can be sure of consistency of command execution + var env = extend(process.env, { LANG: "en", LC_ALL: "en", LC_MESSAGES: "en"}); + var argArray = Array.isArray(args) ? args : args.split(' '); var s = spawn(cmd, argArray, {
ensure the local is set so that command output is consistent and predictable
particle-iot_particle-cli
train
js
5492aad66c9f0fdfae928105b3721221f894f3b5
diff --git a/tests/__init__.py b/tests/__init__.py index <HASH>..<HASH> 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,4 @@ -# -*- coding: utf-8 -*- \ No newline at end of file +# -*- coding: utf-8 -*- +from .main import TestMain +from .config import TestConfig +from .django import TestDjango \ No newline at end of file
Import tests to allow segmented testing
nephila_djangocms-installer
train
py
0a73a67b17d8cc33c15df57c91997e0ffbbdc716
diff --git a/core-bundle/src/Resources/contao/modules/ModulePassword.php b/core-bundle/src/Resources/contao/modules/ModulePassword.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/modules/ModulePassword.php +++ b/core-bundle/src/Resources/contao/modules/ModulePassword.php @@ -238,6 +238,7 @@ class ModulePassword extends \Module $objMember->tstamp = time(); $objMember->activation = ''; + $objMember->locked = 0; // see #8545 $objMember->password = $objWidget->value; $objMember->save();
[Core] Unlock members after password change (see #<I>).
contao_contao
train
php
ffd9ddc36b91ed9c00ef8c4df1b3e3f2c8428650
diff --git a/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java b/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java index <HASH>..<HASH> 100644 --- a/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java +++ b/cdm/src/main/java/ucar/nc2/dt/RadialDatasetSweep.java @@ -48,6 +48,7 @@ public interface RadialDatasetSweep extends ucar.nc2.dt.TypedDataset { * Get the basic property of Radar * @return 0 if this is not a radial product */ + public void clearDatasetMemory(); // public boolean isRadial(); @@ -70,6 +71,10 @@ public interface RadialDatasetSweep extends ucar.nc2.dt.TypedDataset { /** @return data, of length getNumSweep() by getNumRadials() by getNumGates()*/ public float[] readAllData() throws java.io.IOException; + + public void clearVariableMemory(); + + } /** A sweep is 2D data using radial coordinate system (elevation, azimuth, radial distance) */ @@ -135,6 +140,9 @@ public interface RadialDatasetSweep extends ucar.nc2.dt.TypedDataset { /** @return the index of sweep */ public int getSweepIndex(); + + /** deallocated memory of sweep */ + public void clearSweepMemory(); } static public final class Type {
adding clear memory api as tmp fix for memory leak
Unidata_thredds
train
java