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
98ab2f695d2b6768d803bd8cd574baf42ebd728b
diff --git a/src/toil/common.py b/src/toil/common.py index <HASH>..<HASH> 100644 --- a/src/toil/common.py +++ b/src/toil/common.py @@ -112,7 +112,7 @@ class Config(object): self.maxDisk = sys.maxsize #Retrying/rescuing jobs - self.retryCount = 0 + self.retryCount = 1 self.maxJobDuration = sys.maxsize self.rescueJobsFrequency = 3600 @@ -245,7 +245,7 @@ class Config(object): setOption("defaultPreemptable") #Retrying/rescuing jobs - setOption("retryCount", int, iC(0)) + setOption("retryCount", int, iC(1)) setOption("maxJobDuration", int, iC(1)) setOption("rescueJobsFrequency", int, iC(1))
change default retryCount to 1 (resolves #<I>)
DataBiosphere_toil
train
py
75765bf5f3421ba3545376f198bcb1d8d77563c1
diff --git a/src/components/editor/editor-utils.js b/src/components/editor/editor-utils.js index <HASH>..<HASH> 100644 --- a/src/components/editor/editor-utils.js +++ b/src/components/editor/editor-utils.js @@ -230,14 +230,18 @@ export function getContentObject (el) { attributes: {} } - Array.from(el.attributes, ({name, value}) => { - if (name === 'style') { + if (el.tagName === 'LI') { + console.log(getStyleObject(el)) + } + for (let i = 0, n = el.attributes.length, att = el.attributes; i < n; i++) { + const { nodeName, nodeValue } = att[i] + if (nodeName === 'style') { node.style = getStyleObject(el) } else { - node.attributes[name] = value + node.attributes[nodeName] = nodeValue } - }) + } const children = Array.from(el.childNodes, getContentObject) if (children.length === 1 && children[0].nodeType === Node.TEXT_NODE) {
feat: Updates for QEditor
quasarframework_quasar
train
js
6fd0a13f07cb14feff2856948112830738c237d1
diff --git a/src/Workers/AbstractWorker.php b/src/Workers/AbstractWorker.php index <HASH>..<HASH> 100644 --- a/src/Workers/AbstractWorker.php +++ b/src/Workers/AbstractWorker.php @@ -4,8 +4,8 @@ namespace Kir\View\Workers; abstract class AbstractWorker implements Worker { /** @var array */ private $vars = array(); - /** @var array|null */ - private $layout = null; + /** @var array */ + private $layout = [null, []]; /** @var array */ private $regions = array(); /** @var WorkerConfiguration */ @@ -111,10 +111,17 @@ abstract class AbstractWorker implements Worker { } /** - * @return array|null + * @return string|null */ public function getLayout() { - return $this->layout; + return $this->layout[0]; + } + + /** + * @return array + */ + public function getLayoutVars() { + return $this->layout[1]; } /** diff --git a/src/Workers/Worker.php b/src/Workers/Worker.php index <HASH>..<HASH> 100644 --- a/src/Workers/Worker.php +++ b/src/Workers/Worker.php @@ -58,6 +58,11 @@ interface Worker { public function getLayout(); /** + * @return array + */ + public function getLayoutVars(); + + /** * @param string $layout * @param array $vars * @return $this
Various bugfixes according to scrutinizer reports
rkrx_php-view
train
php,php
13ddaa86ac09b287998790c8bad9d4d2f0b5dfe0
diff --git a/restclients/cache_implementation.py b/restclients/cache_implementation.py index <HASH>..<HASH> 100644 --- a/restclients/cache_implementation.py +++ b/restclients/cache_implementation.py @@ -101,7 +101,7 @@ class FourHourCache(object): cache_entry = CacheEntryTimed() if len(query): - cache_entry = query[0] + query[0].delete() now = make_aware(datetime.now(), get_current_timezone()) cache_entry.service = service @@ -110,6 +110,7 @@ class FourHourCache(object): cache_entry.content = response.data cache_entry.headers = [] cache_entry.time_saved = now + cache_entry.save() return
Delete any existing cache entry, rather than try to replace them - fixes an integrity error on primary key - something's forcing an insert rather than update. MUWM-<I> git-svn-id: <URL>
uw-it-aca_uw-restclients
train
py
4ae840039c400b630ad8748c14d5f8217e9cbc15
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -9165,6 +9165,15 @@ const devices = [ await configureReporting.brightness(endpoint); }, }, + { + zigbeeModel: ['WL4200'], + model: 'WL4200', + vendor: 'Sinope', + description: 'Zigbee smart water leak detector', + supports: 'water leak', + fromZigbee: [fz.ias_water_leak_alarm_1], + toZigbee: [], + }, // Lutron {
Add support for Sinopé water leak detector (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
1f0dd9d19af29722edd20db555779f3dfc862440
diff --git a/salt/states/pkg.py b/salt/states/pkg.py index <HASH>..<HASH> 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -77,13 +77,16 @@ def latest(name, repo='', skip_verify=False): version = __salt__['pkg.version'](name) avail = __salt__['pkg.available_version'](name) - try: - has_newer = LooseVersion(avail) > LooseVersion(version) - except AttributeError: - # Not yet installed - if not version: - has_newer = True - else: + if not version: + # Net yet installed + has_newer = True + elif not avail: + # Already at latest + has_newer = False + else: + try: + has_newer = LooseVersion(avail) > LooseVersion(version) + except AttributeError: logger.debug("Error comparing versions for '%s' (%s > %s)", name, avail, version) ret['comment'] = "No version could be retrieved for '{0}'".format(name)
Added explicit check for both version and avail version in pkg.latest
saltstack_salt
train
py
fde08c6248eb0f299466eeb70ed35997431fb15b
diff --git a/ca/django_ca/management/commands/regenerate_ocsp_keys.py b/ca/django_ca/management/commands/regenerate_ocsp_keys.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/management/commands/regenerate_ocsp_keys.py +++ b/ca/django_ca/management/commands/regenerate_ocsp_keys.py @@ -17,6 +17,8 @@ from django.core.management.base import CommandError from ... import ca_settings from ...models import CertificateAuthority +from ...tasks import generate_ocsp_key +from ...tasks import run_task from ...utils import add_colons from ..base import BaseCommand from ..base import ExpiresAction @@ -74,7 +76,9 @@ class Command(BaseCommand): continue - ca.generate_ocsp_key( + run_task( + generate_ocsp_key, + ca.serial, profile=profile, expires=options['expires'], algorithm=options['algorithm'],
potentially use celery for regenerating OCSP keys
mathiasertl_django-ca
train
py
f0335707c60336c529f6b8b90779dd7a26ad7051
diff --git a/src/MessageBird/Objects/SignedRequest.php b/src/MessageBird/Objects/SignedRequest.php index <HASH>..<HASH> 100644 --- a/src/MessageBird/Objects/SignedRequest.php +++ b/src/MessageBird/Objects/SignedRequest.php @@ -51,8 +51,10 @@ class SignedRequest extends Base { $body = file_get_contents('php://input'); $queryParameters = $_GET; - $requestTimestamp = $_SERVER['HTTP_MESSAGEBIRD_REQUEST_TIMESTAMP']; - $signature = $_SERVER['HTTP_MESSAGEBIRD_SIGNATURE']; + $requestTimestamp = isset($_SERVER['HTTP_MESSAGEBIRD_REQUEST_TIMESTAMP']) ? + $_SERVER['HTTP_MESSAGEBIRD_REQUEST_TIMESTAMP'] : null; + $signature = isset($_SERVER['HTTP_MESSAGEBIRD_SIGNATURE']) ? + $_SERVER['HTTP_MESSAGEBIRD_SIGNATURE'] : null; $signedRequest = new SignedRequest(); $signedRequest->loadFromArray(compact('body', 'queryParameters', 'requestTimestamp', 'signature'));
Check to see if the SignedRequest headers are set before accessing PHP Notices were issued if the request doesn't contain the expected headers. Now, null values are passed to loadFromArray(), where the values will fail validation.
messagebird_php-rest-api
train
php
fa0b37376425e4d5cc1f9a3b4556cc6ff087075c
diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index <HASH>..<HASH> 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -2559,7 +2559,7 @@ function assignment_count_real_submissions($assignment, $groupid=0) { global $CFG; if ($groupid) { /// How many in a particular group? - return count_records_sql("SELECT COUNT(DISTINCT gm.userid, gm.groupid) + return count_records_sql("SELECT COUNT(DISTINCT g.userid, g.groupid) FROM {$CFG->prefix}assignment_submissions a, {$CFG->prefix}groups_members g WHERE a.assignment = $assignment->id
MDL-<I> Assignment count for groups not working - patch by Greg Humphreys; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
dbcf78a7b10c6ebe40a2af5d29df6bf0d82e0f4f
diff --git a/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php b/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php index <HASH>..<HASH> 100644 --- a/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php +++ b/modules/social_features/social_profile/src/Plugin/EntityReferenceSelection/UserSelection.php @@ -58,6 +58,7 @@ class UserSelection extends UserSelectionBase { $or->condition('uid', $ids, 'IN'); $query->condition($or); + $query->condition('uid', $this->currentUser->id(), '!='); return $query; }
DS-<I> by chmez: Exclude current user from the list of members of a new private message.
goalgorilla_open_social
train
php
bfc34fc0050ce61650701676dd45553aa82214c0
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -532,7 +532,7 @@ module ActionController #:nodoc: def variant if @variant.nil? - @variants[:none] + @variants[:none] || @variants[:any] elsif (@variants.keys & @variant).any? @variant.each do |v| return @variants[v] if @variants.key?(v) diff --git a/actionpack/test/controller/mime/respond_to_test.rb b/actionpack/test/controller/mime/respond_to_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/mime/respond_to_test.rb +++ b/actionpack/test/controller/mime/respond_to_test.rb @@ -671,6 +671,10 @@ class RespondToControllerTest < ActionController::TestCase end def test_variant_any_any + get :variant_any_any + assert_equal "text/html", @response.content_type + assert_equal "any", @response.body + @request.variant = :phone get :variant_any_any assert_equal "text/html", @response.content_type
No variant should also be picked up by variant.any if variant.none is not defined (just like any other variant)
rails_rails
train
rb,rb
877bba8bad5fa41e8982335be9ac4d17d922ce38
diff --git a/src/endpoints/pcm-variations-relationships.js b/src/endpoints/pcm-variations-relationships.js index <HASH>..<HASH> 100644 --- a/src/endpoints/pcm-variations-relationships.js +++ b/src/endpoints/pcm-variations-relationships.js @@ -41,7 +41,7 @@ class PCMVariationsRelationshipsEndpoint { } Update(productId, resources) { - const body = buildRelationshipDatabuildRelationshipData( + const body = buildRelationshipData( 'product-variation', resources, dasherize
fix: typo (#<I>)
moltin_js-sdk
train
js
4cdfaefea959325b4534ca7beafd370c7a17646a
diff --git a/cli/lib/kontena/cli/spinner.rb b/cli/lib/kontena/cli/spinner.rb index <HASH>..<HASH> 100644 --- a/cli/lib/kontena/cli/spinner.rb +++ b/cli/lib/kontena/cli/spinner.rb @@ -38,6 +38,11 @@ module Kontena CHARS_LENGTH = CHARS.length def self.spin_no_tty(msg, &block) + unless block_given? + Kernel.puts "\r [" + "done".colorize(:green) + "] #{msg}" + return + end + Kernel.puts "* #{msg}.. " result = nil status = nil @@ -68,6 +73,11 @@ module Kontena def self.spin(msg, &block) return spin_no_tty(msg, &block) unless $stdout.tty? + unless block_given? + Kernel.puts "\r [" + "done".colorize(:green) + "] #{msg}" + return + end + Thread.main['spinners'] ||= [] unless Thread.main['spinners'].empty? Thread.main['spinners'].each do |thread|
spinner "message" without block now says [done] message (#<I>)
kontena_kontena
train
rb
9a6bd09d80ecb1a3cda985db0fc97a5fe32b332b
diff --git a/lib/formats/swagger_2.js b/lib/formats/swagger_2.js index <HASH>..<HASH> 100644 --- a/lib/formats/swagger_2.js +++ b/lib/formats/swagger_2.js @@ -72,10 +72,12 @@ Swagger2.prototype.checkFormat = function (spec) { } Swagger2.prototype.validate = function (callback) { - var promise = sway.create({definition: this.spec}) + var promise = sway.create({definition: this.spec, jsonRefs: this.jsonRefs}) .then(function (swaggerObj) { var result = swaggerObj.validate(); + result.remotesResolved = swaggerObj.definitionRemotesResolved; + if (_.isEmpty(result.errors)) result.errors = null; if (_.isEmpty(result.warnings))
Allow passing jsonRefs options to Sway, and return resolved definition (#<I>)
LucyBot-Inc_api-spec-converter
train
js
176b66df0c8fd63f279898a9071467d8daedc180
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ from setuptools import setup setup( name="cocaine", - version="0.12.0.1-pre-rc7", + version="0.12.0.1rc8", author="Anton Tyurin", author_email="[email protected]", maintainer='Evgeny Safronov',
[setup.py] PEP <I> version naming
cocaine_cocaine-framework-python
train
py
4503712ae93929e99e873f66dccb8833ab0d291c
diff --git a/lib/router/index.js b/lib/router/index.js index <HASH>..<HASH> 100644 --- a/lib/router/index.js +++ b/lib/router/index.js @@ -49,6 +49,7 @@ proto.handle = function handle(context, event, nextAfterDone) { var stack = this.stack; var stack_unroll = []; + next.unroll = unroll; next(); function next(err, callback) { @@ -87,8 +88,6 @@ proto.handle = function handle(context, event, nextAfterDone) { route.handle_interaction(context, event, next); } - next.unroll = unroll; - function unroll(err) { if (stack_unroll.length === 0) { nextAfterDone(err);
Fixed a bug with next.unroll not getting attached properly
brianbrunner_yowl
train
js
f5dc13328c26f106d58757759354e0a6dced3884
diff --git a/assess_add_cloud.py b/assess_add_cloud.py index <HASH>..<HASH> 100755 --- a/assess_add_cloud.py +++ b/assess_add_cloud.py @@ -43,17 +43,17 @@ def iter_clouds(clouds): yield cloud_name, cloud_name, cloud for cloud_name, cloud in clouds.items(): - if 'endpoint' not in cloud: - continue - variant = deepcopy(cloud) - variant['endpoint'] = 'A' * 4096 - if variant['type'] == 'vsphere': - for region in variant['regions'].values(): - region['endpoint'] = variant['endpoint'] - variant_name = 'long-endpoint-{}'.format(cloud_name) - yield variant_name, cloud_name, variant yield 'long-name-{}'.format(cloud_name), 'A' * 4096, cloud + if 'endpoint' in cloud: + variant = deepcopy(cloud) + variant['endpoint'] = 'A' * 4096 + if variant['type'] == 'vsphere': + for region in variant['regions'].values(): + region['endpoint'] = variant['endpoint'] + variant_name = 'long-endpoint-{}'.format(cloud_name) + yield variant_name, cloud_name, variant + for region_name in variant.get('regions', {}).keys(): if variant['type'] != 'vsphere': variant = deepcopy(cloud)
Skip only endpoint tests due to lack of endpoint.
juju_juju
train
py
eca7e9c400086a6459dd81604f6a4da9e9644692
diff --git a/README.rst b/README.rst index <HASH>..<HASH> 100644 --- a/README.rst +++ b/README.rst @@ -586,6 +586,11 @@ or:: Changelog ========= +Version 3.0.2 +------------- +- `_send_bulk` now properly catches exceptions when preparing email messages. + + Version 3.0.1 ------------- - Fixed an infinite loop bug in `send_queued_mail` management command. diff --git a/post_office/__init__.py b/post_office/__init__.py index <HASH>..<HASH> 100644 --- a/post_office/__init__.py +++ b/post_office/__init__.py @@ -1,4 +1,4 @@ -VERSION = (3, 0, 1) +VERSION = (3, 0, 2) from .backends import EmailBackend diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ TESTS_REQUIRE = ['tox >= 2.3'] setup( name='django-post_office', - version='3.0.1', + version='3.0.2', author='Selwin Ong', author_email='[email protected]', packages=['post_office'],
Bump to version <I>
ui_django-post_office
train
rst,py,py
a535ad449e9886015a72a444c47648b186610e0b
diff --git a/abilian/services/audit/service.py b/abilian/services/audit/service.py index <HASH>..<HASH> 100644 --- a/abilian/services/audit/service.py +++ b/abilian/services/audit/service.py @@ -334,6 +334,7 @@ def format_large_value(value): pass return value + def get_model_changes(entity_type, year, month=None, day=None): """ Get models modified at the given date with the Audit service.
(minor) pylint
abilian_abilian-core
train
py
8f430150d69addaeb8904b302463355cc0e1d158
diff --git a/cache.go b/cache.go index <HASH>..<HASH> 100644 --- a/cache.go +++ b/cache.go @@ -99,7 +99,6 @@ type cache struct { type Item struct { Object interface{} - Expires bool Expiration *time.Time } @@ -115,19 +114,15 @@ func (c *cache) Set(k string, x interface{}, d time.Duration) { defer c.mu.Unlock() var e *time.Time - expires := true if d == 0 { d = c.DefaultExpiration } - if d == -1 { - expires = false - } else { + if d > 0 { t := time.Now().Add(d) e = &t } c.Items[k] = &Item{ Object: x, - Expires: expires, Expiration: e, } }
Expires bool is redundant with pointer to Time
patrickmn_go-cache
train
go
73981951ffafd146451bca748a7a6f7e7daa29f8
diff --git a/src/Scaffold.php b/src/Scaffold.php index <HASH>..<HASH> 100644 --- a/src/Scaffold.php +++ b/src/Scaffold.php @@ -65,7 +65,7 @@ class Scaffold * Scaffold Migration * */ - public function Migration() + public function migration() { $this->generator->migration(); @@ -76,7 +76,7 @@ class Scaffold * Scaffold Model * */ - public function Model() + public function model() { $this->generator->model(); @@ -87,7 +87,7 @@ class Scaffold * Scaffold Views * */ - public function Views() + public function views() { $this->generator->dir(); $this->generator->index(); @@ -102,7 +102,7 @@ class Scaffold * Scaffold Controller * */ - public function Controller() + public function controller() { $this->generator->controller(); @@ -113,7 +113,7 @@ class Scaffold * Scaffold Route * */ - public function Route() + public function route() { $this->generator->route();
Scaffold.php PSR-1
amranidev_scaffold-interface
train
php
08c62daaa5a798a6280dce37e50503dd6b541737
diff --git a/lib/puppet/provider/user/user_role_add.rb b/lib/puppet/provider/user/user_role_add.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/provider/user/user_role_add.rb +++ b/lib/puppet/provider/user/user_role_add.rb @@ -173,7 +173,8 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source => end def password_max_age - shadow_entry ? shadow_entry[4] : :absent + return :absent unless shadow_entry + shadow_entry[4] || -1 end # Read in /etc/shadow, find the line for our used and rewrite it with the
(#<I>) solaris: return "-1" for password_max_age when password aging is disabled If password aging is disabled for a user on Solaris, there is no artifact in the shadow file that indicates this. We need to get "-1" back to match functionality on other platforms.
puppetlabs_puppet
train
rb
f7b83361affd181fac9df736dc76f1ae4a6bed5a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ module.exports = function(){ - var options=arguments; - return function*(next){ + var options=arguments; + return function*(next){ yield less(this.req, this.res, options); yield next; - }; + }; }; function less(req, res, options){ - return function(callback){ - require('less-middleware').apply(this, options)(req, res, callback); - }; + return function(callback){ + require('less-middleware').apply(this, options)(req, res, callback); + }; }
again try to fix identation this github editor seens buggy
chosecz_koa-less
train
js
02139bd857664915ed18fd2916522d563e591323
diff --git a/src/views/layouts/sidebar.php b/src/views/layouts/sidebar.php index <HASH>..<HASH> 100644 --- a/src/views/layouts/sidebar.php +++ b/src/views/layouts/sidebar.php @@ -18,7 +18,8 @@ use yii\helpers\Url; </div> </div> <!-- search form --> - <form action="<?= Url::to(['@domain/check-domain']) ?>" method="get" class="sidebar-form"> + <?php $searchUrl = Yii::getAlias('@domain', false) ? Url::to('@domain/check-domain') : '/' ?> + <form action="<?= $searchUrl ?>" method="get" class="sidebar-form"> <div class="input-group"> <input type="text" name="Domain[domain]" class="form-control" placeholder="<?= Yii::t('app', 'Check domain') ?>..."/> <span class="input-group-btn">
search when no domains still to be done
hiqdev_yii2-theme-adminlte
train
php
b34efc9d83c6bbf4b418fdc12a50b4223c182fd0
diff --git a/demo/server.rb b/demo/server.rb index <HASH>..<HASH> 100644 --- a/demo/server.rb +++ b/demo/server.rb @@ -14,7 +14,7 @@ end logger = Logger.new STDOUT -logger.level = :info +logger.level = Logger::INFO HrrRbSsh::Logger.initialize logger
update demo/server.rb for compatibility for Ruby version < <I>
hirura_hrr_rb_ssh
train
rb
ce173e9dda434574b8cf18e3aacae687db8ed5f8
diff --git a/lib/Checkdomain/Comodo/Util.php b/lib/Checkdomain/Comodo/Util.php index <HASH>..<HASH> 100644 --- a/lib/Checkdomain/Comodo/Util.php +++ b/lib/Checkdomain/Comodo/Util.php @@ -54,6 +54,67 @@ class Util $this->imapHelper = $imapHelper; } + + /** + * @return CommunicationAdapter|null + */ + public function getCommunicationAdapter() + { + return $this->communicationAdapter; + } + + /** + * @param CommunicationAdapter|null $communicationAdapter + * + * @return Util + */ + public function setCommunicationAdapter($communicationAdapter) + { + $this->communicationAdapter = $communicationAdapter; + + return $this; + } + + /** + * @return ImapHelper|null + */ + public function getImapHelper() + { + return $this->imapHelper; + } + + /** + * @param ImapHelper|null $imapHelper + * + * @return Util + */ + public function setImapHelper($imapHelper) + { + $this->imapHelper = $imapHelper; + + return $this; + } + + /** + * @return ImapWithSearch|null + */ + public function getImapWithSearch() + { + return $this->imapWithSearch; + } + + /** + * @param ImapWithSearch|null $imapWithSearch + * + * @return Util + */ + public function setImapWithSearch($imapWithSearch) + { + $this->imapWithSearch = $imapWithSearch; + + return $this; + } + /** * Function apply for a certificate *
Fix: Add getter/setter to util
checkdomain_Comodo
train
php
c95c669c579465a8b91c6dbd6944a15608aa7153
diff --git a/test-complete/src/test/java/com/marklogic/client/datamovement/functionaltests/ExportListenerTest.java b/test-complete/src/test/java/com/marklogic/client/datamovement/functionaltests/ExportListenerTest.java index <HASH>..<HASH> 100644 --- a/test-complete/src/test/java/com/marklogic/client/datamovement/functionaltests/ExportListenerTest.java +++ b/test-complete/src/test/java/com/marklogic/client/datamovement/functionaltests/ExportListenerTest.java @@ -32,6 +32,7 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import com.fasterxml.jackson.databind.JsonNode; @@ -174,7 +175,7 @@ public class ExportListenerTest extends DmsdkJavaClientREST { * * Git Issue: */ - @Test + @Ignore public void readPointInTimeQuery() throws Exception{ Map<String, String> props = new HashMap<String, String>(); props.put("merge-timestamp","-6000000000");
Test to be changed when PointInTime feature is completed.
marklogic_java-client-api
train
java
596e567f93db88ad743a7d95226f1d01af721597
diff --git a/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/SQLOntopBindingSet.java b/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/SQLOntopBindingSet.java index <HASH>..<HASH> 100644 --- a/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/SQLOntopBindingSet.java +++ b/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/resultset/impl/SQLOntopBindingSet.java @@ -26,9 +26,9 @@ public class SQLOntopBindingSet extends AbstractOntopBindingSet implements Ontop @Override public ImmutableList<RDFConstant> computeValues() { - ImmutableSubstitution<ImmutableTerm> composition = SPARQLVar2Term.composeWith(SQLVar2DBConstant); + ImmutableSubstitution<ImmutableTerm> composition = SQLVar2DBConstant.composeWith(SPARQLVar2Term); return composition.getImmutableMap().values().stream() - .map(t -> evaluate(t)) + .map(this::evaluate) .collect(ImmutableCollectors.toList()); }
Bugfix: the composition was applied in the wrong direction
ontop_ontop
train
java
fcd622131e6d9f043353d3bdc83eb9c116b6cf6b
diff --git a/packages/cozy-konnector-libs/src/libs/BaseKonnector.js b/packages/cozy-konnector-libs/src/libs/BaseKonnector.js index <HASH>..<HASH> 100644 --- a/packages/cozy-konnector-libs/src/libs/BaseKonnector.js +++ b/packages/cozy-konnector-libs/src/libs/BaseKonnector.js @@ -267,6 +267,7 @@ class BaseKonnector { while (Date.now() < params.timeout && !account.twoFACode) { await sleep(params.heartBeat) account = await cozy.data.find('io.cozy.accounts', this.accountId) + log('info', `current accountState : ${account.state}`) log('info', `current twoFACode : ${account.twoFACode}`) }
feat: log account state when waiting for twofa code
konnectors_libs
train
js
783c2679f2a10c2353052ef626c013f99f2efecc
diff --git a/README.txt b/README.txt index <HASH>..<HASH> 100644 --- a/README.txt +++ b/README.txt @@ -37,7 +37,6 @@ In all cases the output is similar: Cottage Cheese ------------------------------ - TODO ---- diff --git a/pyroma/projectdata.py b/pyroma/projectdata.py index <HASH>..<HASH> 100644 --- a/pyroma/projectdata.py +++ b/pyroma/projectdata.py @@ -32,7 +32,8 @@ class SetupMonkey(object): self._setuptools_setup = None self._old_path = os.path.abspath(os.curdir) - sys.path.remove(self._old_path) + if self._old_path in sys.path: + sys.path.remove(self._old_path) os.chdir(self._path) if self._path not in sys.path: 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 import os -version = '1.0dev' +version = '0.9.1' setup(name='pyroma', version=version,
Fixed a big that only happened once you did a real-world install...
regebro_pyroma
train
txt,py,py
63531dd1dd3f5e6ebdd38c81c6d4574ad01b55d3
diff --git a/pyrogram/client/style/html.py b/pyrogram/client/style/html.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/style/html.py +++ b/pyrogram/client/style/html.py @@ -31,7 +31,7 @@ from . import utils class HTML: - HTML_RE = re.compile(r"<(\w+)(?: href=\"(.*)\")?>(.*)</\1>") + HTML_RE = re.compile(r"<(\w+)(?: href=([\"'])(.*)\2)?>(.*)</\1>") MENTION_RE = re.compile(r"tg://user\?id=(\d+)") def __init__(self, peers_by_id):
Fix regex pattern not matching single quotes
pyrogram_pyrogram
train
py
922e4c57a4a8efe5b045cf800692c487cbacb93c
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -35,11 +35,11 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase def test_belongs_to_with_primary_key_joins_on_correct_column sql = Client.joins(:firm_with_primary_key).to_sql if current_adapter?(:MysqlAdapter) - assert_no_match /`firm_with_primary_keys_companies`\.`id`/, sql - assert_match /`firm_with_primary_keys_companies`\.`name`/, sql + assert_no_match(/`firm_with_primary_keys_companies`\.`id`/, sql) + assert_match(/`firm_with_primary_keys_companies`\.`name`/, sql) else - assert_no_match /"firm_with_primary_keys_companies"\."id"/, sql - assert_match /"firm_with_primary_keys_companies"\."name"/, sql + assert_no_match(/"firm_with_primary_keys_companies"\."id"/, sql) + assert_match(/"firm_with_primary_keys_companies"\."name"/, sql) end end
kill warnings on <I> [#<I> state:resolved]
rails_rails
train
rb
68a760893ca32808509d090a3d683df949b019ab
diff --git a/spec/jekyll_redirect_from/redirect_page_spec.rb b/spec/jekyll_redirect_from/redirect_page_spec.rb index <HASH>..<HASH> 100644 --- a/spec/jekyll_redirect_from/redirect_page_spec.rb +++ b/spec/jekyll_redirect_from/redirect_page_spec.rb @@ -34,13 +34,15 @@ describe JekyllRedirectFrom::RedirectPage do let(:redirect_page) { new_redirect_page(permalink_dir) } it "knows to add the index.html if it's a folder" do - expect(redirect_page.destination("/")).to eql("/posts/1914798137981389/larry-had-a-little-lamb/index.html") + dest = @dest.join("posts/1914798137981389/larry-had-a-little-lamb/index.html").to_s + expect(redirect_page.destination("/")).to eql(dest) end end context "of a redirect page meant to be a file" do it "knows not to add the index.html if it's not a folder" do - expect(redirect_page.destination("/")).to eql("/posts/12435151125/larry-had-a-little-lamb") + dest = @dest.join("posts/12435151125/larry-had-a-little-lamb").to_s + expect(redirect_page.destination("/")).to eql(dest) end end end
This seems to fix the issue with Jekyll 3... hm.
jekyll_jekyll-redirect-from
train
rb
3cb7854737b3e326465e8b704623f1f829dda3d9
diff --git a/anharmonic/q2v.py b/anharmonic/q2v.py index <HASH>..<HASH> 100644 --- a/anharmonic/q2v.py +++ b/anharmonic/q2v.py @@ -171,11 +171,11 @@ class PhononPhonon: write_triplets(triplets_at_q, weights_at_q, mesh, t_filename) self._print_log("Ir-triplets at %d were written into %s.\n" % (gp, t_filename)) - - if self._log_level: g_filename = "grids-%d%d%d.dat" % tuple(mesh) write_grid_address(self._grid_address, mesh, g_filename) - self._print_log("Mesh points were written into %s.\n" % g_filename) + self._print_log("Mesh points were written into %s.\n" % + g_filename) + self._print_log("Grid point (%d): " % gp) self._print_log("[ %d %d %d ]\n" % tuple(self._grid_address[gp])) self._print_log("Number of ir triplets: %d\n" % len(weights_at_q))
Grid points are not written into file by default.
atztogo_phonopy
train
py
e3ef262d6b8be43e33a70e026fda01c5ac1d563b
diff --git a/test/test_checks.py b/test/test_checks.py index <HASH>..<HASH> 100644 --- a/test/test_checks.py +++ b/test/test_checks.py @@ -22,13 +22,13 @@ class TestFlake8Stdin(TestCase): stdout_lines = stdout.splitlines() self.assertEqual(stderr, b'') self.assertEqual(len(stdout_lines), 3) - self.assertRegexpMatches( + self.assertRegex( stdout_lines[0], b'stdin:1:(24|25): Q000 Double quotes found but single quotes preferred') - self.assertRegexpMatches( + self.assertRegex( stdout_lines[1], b'stdin:2:(24|25): Q000 Double quotes found but single quotes preferred') - self.assertRegexpMatches( + self.assertRegex( stdout_lines[2], b'stdin:3:(24|25): Q000 Double quotes found but single quotes preferred')
Use assertRegex instead of assertRegexpMatches for Python <I> compatibility. (#<I>)
zheller_flake8-quotes
train
py
b32367703c5f773ae50a1b11fcd566745674384b
diff --git a/gwpy/types/array2d.py b/gwpy/types/array2d.py index <HASH>..<HASH> 100644 --- a/gwpy/types/array2d.py +++ b/gwpy/types/array2d.py @@ -195,6 +195,11 @@ class Array2D(Series): if getattr(self, '_yindex', 0) is None: del self.yindex + def __iter__(self): + # astropy Quantity.__iter__ does something fancy that we don't need + # because we overload __getitem__ + return super(Quantity, self).__iter__() + # -- Array2d properties --------------------- # y0
Array2D.__iter__: don't use Quantity.__iter__ need to overload to just end up using __getitem__, since we overloaded that to return a custom column class
gwpy_gwpy
train
py
81856c7c3accaeef6faf449d1e4af8ebc64ffae2
diff --git a/restcomm/restcomm.ussd/src/main/java/org/restcomm/connect/ussd/telephony/UssdCallManager.java b/restcomm/restcomm.ussd/src/main/java/org/restcomm/connect/ussd/telephony/UssdCallManager.java index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.ussd/src/main/java/org/restcomm/connect/ussd/telephony/UssdCallManager.java +++ b/restcomm/restcomm.ussd/src/main/java/org/restcomm/connect/ussd/telephony/UssdCallManager.java @@ -282,7 +282,7 @@ public class UssdCallManager extends UntypedActor { SipURI to = (SipURI)sipFactory.createSipURI(request.to(), uri); String transport = (to.getTransportParam() != null) ? to.getTransportParam() : "udp"; - from = outboundInterface(transport); + #from = outboundInterface(transport); final ActorRef ussdCall = ussdCall(); final ActorRef self = self();
fix issue that sets From field to null in UssdCallManager.java
RestComm_Restcomm-Connect
train
java
3fb57e4d38fbb05a371f091b988fb2c7158fe25f
diff --git a/src/config/config.php b/src/config/config.php index <HASH>..<HASH> 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -57,4 +57,8 @@ return array( 'subject' => 'Website Enquiry', ), + 'page_title' => 'Contact Us', + 'meta_description' => 'Fill in this form to contact us', + 'meta_keywords' => 'Contact', + ); \ No newline at end of file diff --git a/src/views/contact.blade.php b/src/views/contact.blade.php index <HASH>..<HASH> 100644 --- a/src/views/contact.blade.php +++ b/src/views/contact.blade.php @@ -1,5 +1,17 @@ @extends('layouts.master') +@section('title') + {{ Config::get('laravel-contact-form::page_title') }} +@endsection + +@section('meta_description') + {{ Config::get('laravel-contact-form::meta_description') }} +@endsection + +@section('meta_keywords') + {{ Config::get('laravel-contact-form::meta_keywords') }} +@endsection + @section('content') @include('laravel-contact-form::form') @stop \ No newline at end of file
Adding in sample code for page title and meta description & keywords
FbF_Laravel-Contact-Form
train
php,php
03b4c3206360ee644bbc677d0a0416aec7eeb838
diff --git a/concrete/src/Marketplace/Marketplace.php b/concrete/src/Marketplace/Marketplace.php index <HASH>..<HASH> 100644 --- a/concrete/src/Marketplace/Marketplace.php +++ b/concrete/src/Marketplace/Marketplace.php @@ -7,6 +7,7 @@ use Concrete\Core\Support\Facade\Package; use TaskPermission; use URL; use Zend\Http\Client\Adapter\Exception\TimeoutException; +use Exception; class Marketplace { @@ -116,7 +117,7 @@ class Marketplace $em->flush(); } - public function getAvailableMarketplaceItems($filterInstalled = true) + public static function getAvailableMarketplaceItems($filterInstalled = true) { $fh = Core::make('helper/file'); if (!$fh) {
Mark Marketplace::getAvailableMarketplaceItems static It's called statically and does not contain any reference to $this
concrete5_concrete5
train
php
8aee79ae41cac82f8a5ee3421e84755519e2068f
diff --git a/backbone.js b/backbone.js index <HASH>..<HASH> 100644 --- a/backbone.js +++ b/backbone.js @@ -318,14 +318,14 @@ // Remove an attribute from the model, firing `"change"` unless you choose // to silence it. `unset` is a noop if the attribute doesn't exist. unset: function(attr, options) { - (options || (options = {})).unset = true; + options = _.extend({}, options, {unset: true}); return this.set(attr, null, options); }, // Clear all attributes on the model, firing `"change"` unless you choose // to silence it. clear: function(options) { - (options || (options = {})).unset = true; + options = _.extend({}, options, {unset: true}); return this.set(_.clone(this.attributes), options); }, @@ -394,7 +394,7 @@ options.error = Backbone.wrapError(options.error, model, options); var method = this.isNew() ? 'create' : 'update'; var xhr = (this.sync || Backbone.sync).call(this, method, this, options); - if (options.wait) this.set(current, silentOptions); + if (options.wait) this.clear(silentOptions).set(current, silentOptions); return xhr; },
Fixes #<I> -- new attributes left behind after a failed wait:true
jashkenas_backbone
train
js
c870811a20234271a110309c95d15ce5c788ad9f
diff --git a/transit/write_handlers.py b/transit/write_handlers.py index <HASH>..<HASH> 100644 --- a/transit/write_handlers.py +++ b/transit/write_handlers.py @@ -183,7 +183,7 @@ class DateTimeHandler(object): @staticmethod def rep(d): td = d - DateTimeHandler.epoch - return long((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 1e3) + return int((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 1e3) @staticmethod def verbose_handler(): return VerboseDateTimeHandler
Conversion to long when not needed breaks msgpack.
cognitect_transit-python
train
py
0a2e9b02d60ef3bf1ec1dc9d032d25aefc81987e
diff --git a/activesupport/lib/active_support/file_evented_update_checker.rb b/activesupport/lib/active_support/file_evented_update_checker.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/file_evented_update_checker.rb +++ b/activesupport/lib/active_support/file_evented_update_checker.rb @@ -107,9 +107,7 @@ module ActiveSupport lcsp = Pathname.new(paths[0]) paths[1..-1].each do |path| - loop do - break if lcsp.ascendant_of?(path) - + until lcsp.ascendant_of?(path) if lcsp.root? # If we get here a root directory is not an ascendant of path. # This may happen if there are paths in different drives on
rewrites bare loop as until
rails_rails
train
rb
92ae91c6c7301d534d47e4f20d5939ba8afc736d
diff --git a/stravalib/util/limiter.py b/stravalib/util/limiter.py index <HASH>..<HASH> 100644 --- a/stravalib/util/limiter.py +++ b/stravalib/util/limiter.py @@ -24,6 +24,15 @@ from datetime import datetime, timedelta from stravalib import exc + +def total_seconds(td): + """Alternative to datetime.timedelta.total_seconds + total_seconds() only available since Python 2.7 + https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds + """ + return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 + + class RateLimiter(object): def __init__(self): @@ -68,8 +77,10 @@ class RateLimitRule(object): raise exc.RateLimitExceeded("Rate limit exceeded (can try again in {0})".format(self.timeframe - delta)) else: # Wait the difference between timeframe and the oldest request. - self.log.debug("Rate limit triggered; sleeping for {0}".format(delta)) - time.sleep(self.timeframe - delta) + td = self.timeframe - delta + sleeptime = hasattr(td, 'total_seconds') and td.total_seconds() or total_seconds(td) + self.log.debug("Rate limit triggered; sleeping for {0}".format(sleeptime)) + time.sleep(sleeptime) self.tab.append(datetime.now()) class DefaultRateLimiter(RateLimiter):
time.sleep() expects a float Also handling case where python < <I> (datetime.timedelta.total_seconds is only available since Python >= <I>)
hozn_stravalib
train
py
904736419f651f5b7ee2e28d76800aa4baaf8f02
diff --git a/cider/_sh.py b/cider/_sh.py index <HASH>..<HASH> 100644 --- a/cider/_sh.py +++ b/cider/_sh.py @@ -127,7 +127,7 @@ class Defaults(object): } return next( - (k for t, k in key_types.items() if isinstance(value, t)), + (k for t, k in sorted(key_types.items()) if isinstance(value, t)), "-string" )
Fix for defaults.write The key_type dictionary was iterated over with no order. This causes a boolean and possibly other values to be identified as other types such as `int` should python match it first within the `isinstance()` return check. To correct this, the `sorted()` function was added to respect the order. This also should fix #<I>.
msanders_cider
train
py
652b6348d4d7a35f6b89c23271c39cea65262e1d
diff --git a/compiler/js.py b/compiler/js.py index <HASH>..<HASH> 100644 --- a/compiler/js.py +++ b/compiler/js.py @@ -240,7 +240,7 @@ class component_generator(object): r.append("%sthis.onChanged('%s', (function() %s ).bind(this));" %(ident, name, code)) for name, code in self.key_handlers.iteritems(): code = process(code, registry) - r.append("%sthis.onPressed('%s', (function() %s ).bind(this));" %(ident, name, code)) + r.append("%sthis.onPressed('%s', (function(key, event) %s ).bind(this));" %(ident, name, code)) r.append(self.generate_animations(registry, parent)) return "\n".join(r)
added key, event arguments to pressed event
pureqml_qmlcore
train
py
0a9dabf013f3beb1ac9e900f8ac1ebe15f4083f0
diff --git a/cell/task_test.go b/cell/task_test.go index <HASH>..<HASH> 100644 --- a/cell/task_test.go +++ b/cell/task_test.go @@ -203,10 +203,7 @@ exit 0 { Protocol: models.TCPProtocol, Destination: "0.0.0.0/0", - PortRange: &models.PortRange{ - Start: 80, - End: 80, - }, + Ports: []uint16{80, 443}, }, { Protocol: models.UDPProtocol,
Modify test to support Ports [#<I>]
cloudfoundry_inigo
train
go
b9d837183ad5bd186456d64c6a45d3151dde2540
diff --git a/server/etcdserver/api/capability.go b/server/etcdserver/api/capability.go index <HASH>..<HASH> 100644 --- a/server/etcdserver/api/capability.go +++ b/server/etcdserver/api/capability.go @@ -40,6 +40,7 @@ var ( "3.3.0": {AuthCapability: true, V3rpcCapability: true}, "3.4.0": {AuthCapability: true, V3rpcCapability: true}, "3.5.0": {AuthCapability: true, V3rpcCapability: true}, + "3.6.0": {AuthCapability: true, V3rpcCapability: true}, } enableMapMu sync.RWMutex diff --git a/server/etcdserver/api/rafthttp/stream.go b/server/etcdserver/api/rafthttp/stream.go index <HASH>..<HASH> 100644 --- a/server/etcdserver/api/rafthttp/stream.go +++ b/server/etcdserver/api/rafthttp/stream.go @@ -59,6 +59,7 @@ var ( "3.3.0": {streamTypeMsgAppV2, streamTypeMessage}, "3.4.0": {streamTypeMsgAppV2, streamTypeMessage}, "3.5.0": {streamTypeMsgAppV2, streamTypeMessage}, + "3.6.0": {streamTypeMsgAppV2, streamTypeMessage}, } )
server/etcdserver/api: Add <I> to supported version
etcd-io_etcd
train
go,go
97988b2365890bfffba609ad0cc23cc923c4aca8
diff --git a/paging.js b/paging.js index <HASH>..<HASH> 100644 --- a/paging.js +++ b/paging.js @@ -58,7 +58,7 @@ app.directive('paging', function () { var value = this.value; scope.page = value; - if (scope.scrollTop == true) { + if (scope.scrollTop) { scrollTo(0, 0); } }
Removed unnecessary comparer Removed the unnecessary comparer if scrollTop == true since we really only care if it exists or not
brantwills_Angular-Paging
train
js
5b61150167052555d18162b59ff301a7a8aed376
diff --git a/resty.go b/resty.go index <HASH>..<HASH> 100644 --- a/resty.go +++ b/resty.go @@ -6,4 +6,4 @@ package resty // Version # of resty -const Version = "1.2" +const Version = "1.3-edge"
version bump to <I>-edge for next dev iteration
go-resty_resty
train
go
f6e56f2890666c85046bb4997805aea41aceef9e
diff --git a/mod/wiki/lib.php b/mod/wiki/lib.php index <HASH>..<HASH> 100644 --- a/mod/wiki/lib.php +++ b/mod/wiki/lib.php @@ -48,7 +48,9 @@ function wiki_add_instance($wiki) { $wiki->timemodified = time(); # May have to add extra stuff in here # - + if (empty($wiki->forceformat)) { + $wiki->forceformat = 0; + } return $DB->insert_record('wiki', $wiki); }
[MDL-<I>] Fixing this issue at wiki creation.
moodle_moodle
train
php
05fa2dab6c70bfc608fa38916962eb062fd87856
diff --git a/lib/poise/helpers/inversion.rb b/lib/poise/helpers/inversion.rb index <HASH>..<HASH> 100644 --- a/lib/poise/helpers/inversion.rb +++ b/lib/poise/helpers/inversion.rb @@ -183,7 +183,7 @@ module Poise Chef::Log.debug("[#{self.name}] Setting inversion resource to #{val}") @poise_inversion_resource = val.to_sym end - @poise_inversion_resource + @poise_inversion_resource || (superclass.respond_to?(:inversion_resource) ? superclass.inversion_resource : nil) end # @overload inversion_attribute() @@ -202,7 +202,7 @@ module Poise val = Array(val).map {|name| name.to_s } @poise_inversion_attribute = val end - @poise_inversion_attribute + @poise_inversion_attribute || (superclass.respond_to?(:inversion_attribute) ? superclass.inversion_attribute : nil) end # Resolve the node attribute used as the base for inversion options
Check superclass on inversion params.
poise_poise
train
rb
e573a4d9b24e20ee202c22eebfb8b6b5079bcb42
diff --git a/example.py b/example.py index <HASH>..<HASH> 100644 --- a/example.py +++ b/example.py @@ -71,7 +71,12 @@ content_state = { 'offset': 16, 'length': 4, 'style': 'BOLD' - } + }, + { + 'offset': 16, + 'length': 4, + 'style': 'CODE' + }, ], 'entityRanges': [] },
Add example of inline ranges of same offset + length
springload_draftjs_exporter
train
py
cbf8fc6a5d31f2f4cdbf393acfb6379888d7f2b7
diff --git a/Utilities/Strings.php b/Utilities/Strings.php index <HASH>..<HASH> 100644 --- a/Utilities/Strings.php +++ b/Utilities/Strings.php @@ -151,6 +151,8 @@ class Strings */ public static function startsWith($string, $prefix) { + $prefix = is_int($prefix) ? "$prefix" : $prefix; + $string = is_int($string) ? "$string" : $string; return $string && $prefix && strpos($string, $prefix) === 0; } @@ -173,6 +175,8 @@ class Strings */ public static function endsWith($string, $suffix) { + $suffix = is_int($suffix) ? "$suffix" : $suffix; + $string = is_int($string) ? "$string" : $string; return $string && $suffix && substr($string, -strlen($suffix)) === $suffix; }
#<I> Strings::startWith() and Strings::endsWith() now casts integers to strings
letsdrink_ouzo-goodies
train
php
2a8106dced60419cbce6e0fe024e2fe23e4f4ae8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ requirements = [ # Protocol and data packages "pytmpdir >= 0.2.3", # A temporary directory, useful for extracting archives to "txhttputil >= 0.1.8", # Utility class for http requests - "vortexpy >= 0.6.5", # Data serialisation and transport layer, observable based + "vortexpy >= 0.7.0", # Data serialisation and transport layer, observable based # SOAP interface packages "SOAPpy-py3 >= 0.52.24", # See http://soappy.ooz.ie for tutorials
Bumped version requirement of VortexPY to <I> for RPC support
Synerty_peek-plugin-base
train
py
23bf1cd667cfb8fff746d04e04513fc6bf192130
diff --git a/pysatMagVect/_core.py b/pysatMagVect/_core.py index <HASH>..<HASH> 100644 --- a/pysatMagVect/_core.py +++ b/pysatMagVect/_core.py @@ -739,7 +739,8 @@ def calculate_mag_drift_unit_vectors_ecef(latitude, longitude, altitude, datetim doy = (time - datetime.datetime(time.year,1,1)).days # number of days in year, works for leap years num_doy_year = (datetime.datetime(time.year+1,1,1) - datetime.datetime(time.year,1,1)).days - date = time.year + float(doy)/float(num_doy_year) + (time.hour + time.minute/60. + time.second/3600.)/24. + date = time.year + float(doy)/float(num_doy_year+1) + date += (time.hour + time.minute/60. + time.second/3600.)/24./float(num_doy_year+1) # get IGRF field components # tbn, tbe, tbd, tbmag are in nT tbn, tbe, tbd, tbmag = igrf.igrf12syn(0, date, 2, alt, colat, elong)
BUG: Corrected date calculation
rstoneback_pysatMagVect
train
py
fcf740866356132a4509a9cd709adfa87c7efed6
diff --git a/tests/TestCase/I18n/TimeTest.php b/tests/TestCase/I18n/TimeTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/I18n/TimeTest.php +++ b/tests/TestCase/I18n/TimeTest.php @@ -174,7 +174,24 @@ class TimeTest extends TestCase ], ]; } - + /** + * test the timezone option for timeAgoInWords + * + * @return void + */ + public function testTimeAgoInWordsTimezone() + { + $time = new Time('1990-07-31 20:33:00 UTC'); + $result = $time->timeAgoInWords( + [ + 'timezone' => 'America/Vancouver', + 'end' => '+1month', + 'format' => 'dd-MM-YYYY HH:mm:ss' + ] + ); + $this->assertEquals('on 31-07-1990 13:33:00', $result); + } + /** * test the end option for timeAgoInWords *
Update TimeTest.php, add testTimeAgoInWordsTimezone Added a test case for the timezone option in function timeAgoInWords.
cakephp_cakephp
train
php
50ec0810f29018b5ba29d0f6e6958a1174925a4f
diff --git a/core/src/main/java/com/opentext/ia/sdk/configurer/YamlConfiguration.java b/core/src/main/java/com/opentext/ia/sdk/configurer/YamlConfiguration.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/opentext/ia/sdk/configurer/YamlConfiguration.java +++ b/core/src/main/java/com/opentext/ia/sdk/configurer/YamlConfiguration.java @@ -33,7 +33,11 @@ public class YamlConfiguration { @SuppressWarnings("unchecked") private void expand(InputStream input) { - expand((Map<String, Object>)new Yaml().load(input)); + Map<String, Object> source = new HashMap<>(); + for (Object data : new Yaml().loadAll(input)) { + source.putAll((Map<String, Object>)data); + } + expand(source); } @SuppressWarnings("PMD.UnusedFormalParameter")
Support multiple documents in single YAML file
Enterprise-Content-Management_infoarchive-sip-sdk
train
java
ab0e82b105baefcc72719b22af958abb648dd4b1
diff --git a/faker.go b/faker.go index <HASH>..<HASH> 100644 --- a/faker.go +++ b/faker.go @@ -206,6 +206,7 @@ var ( ErrMoreArguments = "Passed more arguments than is possible : (%d)" ErrNotSupportedPointer = "Use sample:=new(%s)\n faker.FakeData(sample) instead" ErrSmallerThanZero = "Size:%d is smaller than zero." + ErrSmallerThanOne = "Size:%d is smaller than one." ErrUniqueFailure = "Failed to generate a unique value for field \"%s\"" ErrStartValueBiggerThanEnd = "Start value can not be bigger than end value." @@ -245,8 +246,8 @@ func SetRandomStringLength(size int) error { // SetRandomMapAndSliceSize sets the size for maps and slices for random generation. func SetRandomMapAndSliceSize(size int) error { - if size < 0 { - return fmt.Errorf(ErrSmallerThanZero, size) + if size < 1 { + return fmt.Errorf(ErrSmallerThanOne, size) } randomSize = size return nil
fix: 0 not valid for random size #<I> logically invalid to as for a random number between 0 and 0 but more importantly, it panics on the Intn call with `panic: invalid argument to Intn`
bxcodec_faker
train
go
bf0175023feff4c14a7c4619f0cd2e9bae1b4e2f
diff --git a/core/server/master/src/main/java/alluxio/master/file/DefaultFileSystemMaster.java b/core/server/master/src/main/java/alluxio/master/file/DefaultFileSystemMaster.java index <HASH>..<HASH> 100644 --- a/core/server/master/src/main/java/alluxio/master/file/DefaultFileSystemMaster.java +++ b/core/server/master/src/main/java/alluxio/master/file/DefaultFileSystemMaster.java @@ -879,7 +879,7 @@ public final class DefaultFileSystemMaster extends CoreMaster ensureFullPathAndUpdateCache(inodePath); FileInfo fileInfo = getFileInfoInternal(inodePath); - if (!fileInfo.isCompleted()) { + if (!fileInfo.isFolder() && (!fileInfo.isCompleted())) { LOG.warn("File {} is not yet completed. getStatus will see incomplete metadata.", fileInfo.getPath()); }
Log when it is a file When we get status for an incomplete file, we should produce a logging message. Currently, we do not check if it is a file. pr-link: Alluxio/alluxio#<I> change-id: cid-8a<I>e7ee9f<I>cd<I>c<I>c<I>ee
Alluxio_alluxio
train
java
902c635f35f4cf43fb4191faa1056591bc6034de
diff --git a/tracer/runner.py b/tracer/runner.py index <HASH>..<HASH> 100644 --- a/tracer/runner.py +++ b/tracer/runner.py @@ -23,12 +23,13 @@ class Runner(object): """ def __init__(self, binary, input=None, pov_file=None, record_trace=False, record_stdout=False, record_magic=False, - seed=None, memory_limit="8G", bitflip=False): + seed=None, memory_limit="8G", bitflip=False, report_bad_args=False): """ :param binary: path to the binary to be traced :param input: concrete input string to feed to binary :param pov_file: CGC PoV describing the input to trace :param record_trace: whether or not to record the basic block trace + :param report_bad_arg: enable CGC QEMU's report bad args option """ self.binary = binary @@ -43,6 +44,7 @@ class Runner(object): self.seed = seed self.memory_limit = memory_limit self.bitflip = bitflip + self.report_bad_args = report_bad_args if self.pov_file is None and self.input is None: raise ValueError("must specify input or pov_file") @@ -207,6 +209,9 @@ class Runner(object): else: args += ["-enable_double_empty_exiting"] + if self.report_bad_args: + args += ["-report_bad_args"] + args += ["-m", self.memory_limit] args += [self.binary]
Allow the passing of 'report_bad_args' to the Runner
angr_angr
train
py
7323f4c2ab2eda54e91274a6e9281f0a98160850
diff --git a/superset/models.py b/superset/models.py index <HASH>..<HASH> 100644 --- a/superset/models.py +++ b/superset/models.py @@ -169,7 +169,7 @@ class AuditMixinNullable(AuditMixin): if not user: return '' url = '/superset/profile/{}/'.format(user.username) - return '<a href="{}">{}</a>'.format(url, escape(user) or '') + return Markup('<a href="{}">{}</a>'.format(url, escape(user) or '')) @renders('created_by') def creator(self): # noqa
Make up the user link string (#<I>) prevent the user link from being escaped
apache_incubator-superset
train
py
35580f44d2fc8eca32d519613a7b8293e01fca24
diff --git a/level_logger.go b/level_logger.go index <HASH>..<HASH> 100644 --- a/level_logger.go +++ b/level_logger.go @@ -1,5 +1,7 @@ package adaptlog +import "errors" + // LogLevel type type LogLevel uint8 @@ -46,17 +48,22 @@ func init() { initialized = false } -// Initialize leveled logger. Only once needed -func Initialize(logger LevelLogger) { +// InitializeLeveledLogger initializes a leveled logger. Only once needed +func InitializeLeveledLogger(logger LevelLogger) { leveledLogger = logger initialized = true } // NewLeveledLogger creates a new leveled logger -func NewLeveledLogger() *LeveledLogger { +func NewLeveledLogger() (*LeveledLogger, error) { + + if !initialized { + return nil, errors.New("text string") + } + return &LeveledLogger{ logger: leveledLogger, - } + }, nil } // LeveledLogger for logging with level support
added a=safe guard on creating a logger
mantzas_adaptlog
train
go
ca7a1db45d0604241b7b969bb0f73e5cfd42a3d2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ /* Breaks a Javascript string into individual user-perceived "characters" -called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 8.0.0 +called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0 Usage: var splitter = new GraphemeSplitter(); @@ -239,8 +239,8 @@ function GraphemeSplitter(){ //given a Unicode code point, determines this symbol's grapheme break property function getGraphemeBreakProperty(code){ - //grapheme break property for Unicode 8.0.0, - //taken from http://www.unicode.org/Public/8.0.0/ucd/auxiliary/GraphemeBreakProperty.txt + //grapheme break property for Unicode 10.0.0, + //taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt //and adapted to JavaScript rules if(
Updated comments to version <I>
orling_grapheme-splitter
train
js
ebe05dd9e2be8bdfafe9bf790d3d59846c5af670
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -303,8 +303,6 @@ if(_hooks.created) { _hooks.created(); } - var realEl = document.querySelector(_el); - realEl.parentNode.replaceChild(this.$el, realEl); this.compileComponents(); this.createVirtualDOM(this.$el); this.build(this.$dom.children);
don't waste time making new el
kbrsh_moon
train
js
8de59a7ecd3b2da14d74b70e35cd587bcf21c4d2
diff --git a/test/browser-tests/shuffling.js b/test/browser-tests/shuffling.js index <HASH>..<HASH> 100644 --- a/test/browser-tests/shuffling.js +++ b/test/browser-tests/shuffling.js @@ -59,7 +59,9 @@ export default function() { }); test( 'an appropriate error is thrown when shuffling a non-array keypath', t => { - const r = new Ractive({}); + const r = new Ractive({ + data: { foo: null } + }); t.throws( () => { r.push('foo', 1);
adjust invalid array shuffle test to use something other than undefined
ractivejs_ractive
train
js
067aa6fd5d148911bd38ae7d19d1fc43e2db94a9
diff --git a/translate.js b/translate.js index <HASH>..<HASH> 100644 --- a/translate.js +++ b/translate.js @@ -1,3 +1,5 @@ +var linker = require('./linker.js'); + /// Translate old style version numbers to semver. /// Old style: 0.3.6-3fc68da5/Release-Emscripten/clang /// 0.3.5-371690f0/Release-Emscripten/clang/Interpreter @@ -110,11 +112,13 @@ function translateJsonCompilerOutput (output) { 'bytecode': { 'object': contractInput['bytecode'], 'opcodes': contractInput['opcodes'], - 'sourceMap': contractInput['srcmap'] + 'sourceMap': contractInput['srcmap'], + 'linkReferences': linker.findLinkReferences(contractInput['bytecode']) }, 'deployedBytecode': { 'object': contractInput['runtimeBytecode'], - 'sourceMap': contractInput['srcmapRuntime'] + 'sourceMap': contractInput['srcmapRuntime'], + 'linkReferences': linker.findLinkReferences(contractInput['runtimeBytecode']) }, 'methodIdentifiers': contractInput['functionHashes'], 'gasEstimates': translatedGasEstimates
Export linkReferences in jsonio translator
dexon-foundation_dsolc-js
train
js
5f5c2ba02d867744b84475a0b0eaa00ee86f56f6
diff --git a/blockstack_cli_0.14.1/blockstack_registrar/tools/misc.py b/blockstack_cli_0.14.1/blockstack_registrar/tools/misc.py index <HASH>..<HASH> 100755 --- a/blockstack_cli_0.14.1/blockstack_registrar/tools/misc.py +++ b/blockstack_cli_0.14.1/blockstack_registrar/tools/misc.py @@ -54,6 +54,8 @@ from registrar.config import NAMECOIND_WALLET_PASSPHRASE from registrar.config import NAMECOIND_UPDATE_SERVER from commontools import get_json, log +from registrar.config import SERVER_FLEET +from pybitcoin.rpc.namecoind_cluster import pending_transactions remote_client = MongoClient(MONGODB_URI) @@ -79,6 +81,22 @@ def print_user(user): print key + " : " + str(value) +def check_pending_tx(): + + counter_total = 0 + + for server in SERVER_FLEET: + print server + try: + count = int(pending_transactions(server)) + print count + counter_total += count + except Exception as e: + print e + + return counter_total + + def cleanup_user(username): user = users.find_one({"username": username})
added func for measuring load on servers
blockstack_blockstack-core
train
py
e2d7e03a2f8b8a8fec67eae69d8a4bbdbbc7f268
diff --git a/sos/plugins/subscription_manager.py b/sos/plugins/subscription_manager.py index <HASH>..<HASH> 100644 --- a/sos/plugins/subscription_manager.py +++ b/sos/plugins/subscription_manager.py @@ -29,6 +29,7 @@ class SubscriptionManager(Plugin, RedHatPlugin): # rhsm config and logs self.add_copy_spec([ "/etc/rhsm/", + "/var/lib/rhsm/", "/var/log/rhsm/rhsm.log", "/var/log/rhsm/rhsmcertd.log"]) self.add_cmd_output([
[subscription_manager] collect /var/lib/rhsm/ The directory contains usefull info about subscription status and facts the RHSM server gets from this client. Resolves: #<I>
sosreport_sos
train
py
89b110d58c77bcd564b08567056ad7ce0c683e9f
diff --git a/Python/phate/logging.py b/Python/phate/logging.py index <HASH>..<HASH> 100644 --- a/Python/phate/logging.py +++ b/Python/phate/logging.py @@ -1,8 +1,9 @@ -from __future__ import absolute_import +from __future__ import absolute_import, print_function from builtins import super, bytes import os import logging import time +import sys __logger_name__ = "PHATE" @@ -14,11 +15,21 @@ class RSafeStdErr(object): This class writes directly to stderr to avoid this. """ - def write(self, msg): - os.write(2, bytes(msg, 'utf8')) + def __init__(self): + try: + __IPYTHON__ + self.write = self.write_ipython + except NameError: + self.write = self.write_r_safe + + def write_ipython(self, msg): + print(msg, end='', file=sys.stdout) + + def write_r_safe(self, msg): + os.write(1, bytes(msg, 'utf8')) def flush(self): - pass + sys.stdout.flush() class TaskLogger(object):
print output to ipython notebooks
KrishnaswamyLab_PHATE
train
py
a8c52437a7599326b8a221cdf8cd5edf894350c5
diff --git a/metric_tank/aggmetric.go b/metric_tank/aggmetric.go index <HASH>..<HASH> 100644 --- a/metric_tank/aggmetric.go +++ b/metric_tank/aggmetric.go @@ -366,6 +366,12 @@ func (a *AggMetric) persist(pos int) { previousChunk = a.Chunks[previousPos] } + if len(pending) > cap(a.writeQueue) { + // this can lead to a deadlock. so lets just write what we + // can and handle the rest next time. + pending = pending[len(pending)-cap(a.writeQueue):] + } + log.Debug("sending %d chunks to write queue", len(pending)) ticker := time.NewTicker(2 * time.Second)
limit number of old chunks that can be added to the writeQueue. fixes #<I> If we try and write more chunks to the writeQueue then the capacity of the writeQueue in one go while holding the lock, we can end up in a deadlock. This commit ensures that this never happens.
grafana_metrictank
train
go
7ee390d57b16577797d5961ac31c9ef922f58f60
diff --git a/src/Support/Period.php b/src/Support/Period.php index <HASH>..<HASH> 100644 --- a/src/Support/Period.php +++ b/src/Support/Period.php @@ -413,7 +413,7 @@ class Period */ public function setStartDateTime(DateTime $startDateTime) { - $this->startDateTime = $startDateTime; + $this->startDateTime = Carbon::instance($startDateTime); return $this; } @@ -426,7 +426,7 @@ class Period */ public function setEndDateTime(DateTime $endDateTime) { - $this->endDateTime = $endDateTime; + $this->endDateTime = Carbon::instance($endDateTime); return $this; }
feat: create Carbon instance from DateTime
cyrildewit_eloquent-viewable
train
php
b2e928eb58b15bafceeacf68507e7f3abc692833
diff --git a/www/src/py_exceptions.js b/www/src/py_exceptions.js index <HASH>..<HASH> 100644 --- a/www/src/py_exceptions.js +++ b/www/src/py_exceptions.js @@ -14,6 +14,10 @@ $B.set_exc = function(exc){ console.error(['Traceback (most recent call last):', $B.print_stack(exc.$stack), msg].join('\n')) + if($B.debug > 1){ + console.log(exc.args) + console.log(exc.stack) + } throw Error(msg) }else{ frame[1].$current_exception = $B.exception(exc) @@ -535,7 +539,7 @@ var $make_exc = $B.$make_exc = function(names, parent){ $make_exc(["SystemExit", "KeyboardInterrupt", "GeneratorExit", "Exception"], BaseException) -$make_exc([["StopIteration","err.value = arguments[0]"], +$make_exc([["StopIteration","err.value = arguments[0] || _b_.None"], ["StopAsyncIteration","err.value = arguments[0]"], "ArithmeticError", "AssertionError", "BufferError", "EOFError", ["ImportError", "err.name = arguments[0]"],
Set attribute .value of StopIteration to None if no argument is passed
brython-dev_brython
train
js
15e342612679e275024a05db0636543ec9076027
diff --git a/jqm-all/jqm-ws/src/main/webapp/controller/history.js b/jqm-all/jqm-ws/src/main/webapp/controller/history.js index <HASH>..<HASH> 100644 --- a/jqm-all/jqm-ws/src/main/webapp/controller/history.js +++ b/jqm-all/jqm-ws/src/main/webapp/controller/history.js @@ -244,9 +244,6 @@ jqmControllers.controller('µHistoryCtrl', function($scope, $http, $modal, µQue var ji = $scope.selected[0]; $http.post("ws/client/ji/" + ji.id).success($scope.getDataAsync); }; - - // Init data - $scope.getDataAsync(); }); jqmApp.controller('historyDetail', function($scope, $http, ji)
Bugfix: Auto resize plugin created double WS call Removed explicit data init. This caused the first init (the non explicit due to the plugin) to be done before filters/sort were initialized. And if it was longer than the second one, it won. So initial sort could be wrong. Fixes #<I>
enioka_jqm
train
js
93edcc8abcda1d7838a1333debbbc952403bd30e
diff --git a/generators/app/index.js b/generators/app/index.js index <HASH>..<HASH> 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -70,10 +70,10 @@ module.exports = fountain.Base.extend({ }, composing: function () { - this.composeWith('fountain-eslint', { options: this.props }); this.composeWith('fountain-browsersync', { options: this.props }); this.composeWith('fountain-karma', { options: this.props }); this.composeWith(`fountain-${this.props.modules}`, { options: this.props }); + this.composeWith('fountain-eslint', { options: this.props }); }, writing: function () {
move eslint at the end of the composition
FountainJS_generator-fountain-gulp
train
js
72a906b5c7c45743d289e6e224e81973b9e4ed79
diff --git a/hitagi.js b/hitagi.js index <HASH>..<HASH> 100644 --- a/hitagi.js +++ b/hitagi.js @@ -41311,6 +41311,7 @@ global.hitagi = require('./main.js'); this.register = function (system) { setupTracking(system); systems.push(system); + _.each(entities, that.rebuild); return system; }; diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hitagi.js", - "version": "0.5.5", + "version": "0.5.6", "description": "Simple game development framework", "main": "src/main.js", "scripts": { diff --git a/src/world.js b/src/world.js index <HASH>..<HASH> 100644 --- a/src/world.js +++ b/src/world.js @@ -37,6 +37,7 @@ this.register = function (system) { setupTracking(system); systems.push(system); + _.each(entities, that.rebuild); return system; };
Made registering a system cause a rebuild of all Entities, allowing Systems to be added dynamically
RoganMurley_hitagi.js
train
js,json,js
42ec900352e18ed8869f24dc05aad4315e072cf7
diff --git a/src/Neuron/GameServer/Credits.php b/src/Neuron/GameServer/Credits.php index <HASH>..<HASH> 100755 --- a/src/Neuron/GameServer/Credits.php +++ b/src/Neuron/GameServer/Credits.php @@ -264,6 +264,11 @@ class Neuron_GameServer_Credits return $this->getSignedUrl (TRACKER_URL, $parameters); */ + $this->objCredits = self::getPureCreditsObject (); + if (!$this->objCredits) { + return null; + } + if (!$this->objCredits->isValidData()) { return null; }
FIxing phpmailer? I hope?
CatLabInteractive_dolumar-engine
train
php
6a111815acdf59b3e2ba81b7f8e7e3fe1aca3813
diff --git a/lib/closeio/version.rb b/lib/closeio/version.rb index <HASH>..<HASH> 100644 --- a/lib/closeio/version.rb +++ b/lib/closeio/version.rb @@ -1,3 +1,3 @@ module Closeio - VERSION = "1.0.0" + VERSION = "1.0.1" end
Bumped version to <I>
taylorbrooks_closeio
train
rb
7b97b1f5a59bac662bb7134fccb7d0e074b84cb8
diff --git a/lib/contentstack/api.rb b/lib/contentstack/api.rb index <HASH>..<HASH> 100644 --- a/lib/contentstack/api.rb +++ b/lib/contentstack/api.rb @@ -133,7 +133,7 @@ module Contentstack elsif @proxy_details.present? && @proxy_details[:url].present? && @proxy_details[:port].present? && @proxy_details[:username].empty? && @proxy_details[:password].empty? proxy_uri = URI.parse("http://#{@proxy_details[:url]}:#{@proxy_details[:port]}/") - ActiveSupport::JSON.decode(open("#{preview_host}#{@api_version}#{path}#{query}", "proxy" => proxy_uri, "api_key" => @api_key, "authorization" => @live_preview[:management_token], "user_agent"=> "ruby-sdk/#{Contentstack::VERSION}", "x-user-agent" => "ruby-sdk/#{Contentstack::VERSION}").read) + ActiveSupport::JSON.decode(URI.open("#{preview_host}#{@api_version}#{path}#{query}", "proxy" => proxy_uri, "api_key" => @api_key, "authorization" => @live_preview[:management_token], "user_agent"=> "ruby-sdk/#{Contentstack::VERSION}", "x-user-agent" => "ruby-sdk/#{Contentstack::VERSION}").read) end end
Added URI.open in live preview method
contentstack_contentstack-ruby
train
rb
1d529adc9bed007b68e1adad1d6477c3df068c2a
diff --git a/src/frontend/org/voltdb/iv2/MpTransactionTaskQueue.java b/src/frontend/org/voltdb/iv2/MpTransactionTaskQueue.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/iv2/MpTransactionTaskQueue.java +++ b/src/frontend/org/voltdb/iv2/MpTransactionTaskQueue.java @@ -131,29 +131,10 @@ public class MpTransactionTaskQueue extends TransactionTaskQueue } m_backlog.removeFirst(); Iterator<TransactionTask> iter = m_backlog.iterator(); - while (iter.hasNext()) { + if (iter.hasNext()) { TransactionTask task = iter.next(); - long lastQueuedTxnId = task.getTxnId(); taskQueueOffer(task); ++offered; - if (task.getTransactionState().isSinglePartition()) { - // single part can be immediately removed and offered - iter.remove(); - continue; - } - else { - // leave the mp fragment at the head of the backlog but - // iterate and take care of the kooky case explained above. - while (iter.hasNext()) { - task = iter.next(); - if (task.getTxnId() == lastQueuedTxnId) { - iter.remove(); - taskQueueOffer(task); - ++offered; - } - } - break; - } } return offered; }
ENG-<I>: Don't need SP behavior on flush in MpTTQ. Don't need to look for fragments of the same TXN ID in MpTTQ.
VoltDB_voltdb
train
java
b2441158025df1ae0f4b94d4727391a16df1ee6d
diff --git a/models/classes/Lists/DataAccess/Repository/DependsOnPropertyRepository.php b/models/classes/Lists/DataAccess/Repository/DependsOnPropertyRepository.php index <HASH>..<HASH> 100644 --- a/models/classes/Lists/DataAccess/Repository/DependsOnPropertyRepository.php +++ b/models/classes/Lists/DataAccess/Repository/DependsOnPropertyRepository.php @@ -24,6 +24,7 @@ namespace oat\tao\model\Lists\DataAccess\Repository; use core_kernel_classes_Class; use core_kernel_classes_Property; +use oat\tao\model\Lists\Business\Contract\ParentPropertyListRepositoryInterface; use tao_helpers_form_GenerisFormFactory; use oat\oatbox\service\ConfigurableService; use oat\tao\model\Lists\Business\Domain\DependsOnProperty; @@ -142,8 +143,8 @@ class DependsOnPropertyRepository extends ConfigurableService implements Depends return $this->dependentPropertySpecification; } - private function getParentPropertyListUrisRepository(): ParentPropertyListRepository + private function getParentPropertyListUrisRepository(): ParentPropertyListRepositoryInterface { - return $this->getServiceLocator()->get(ParentPropertyListRepository::class); + return $this->getServiceLocator()->get(ParentPropertyListCachedRepository::class); } }
refactor: use cache repository instead
oat-sa_tao-core
train
php
b734bbdecf417f8ee0105a6d32705d82a0533717
diff --git a/src/Sylius/Component/Core/Model/Product.php b/src/Sylius/Component/Core/Model/Product.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Component/Core/Model/Product.php +++ b/src/Sylius/Component/Core/Model/Product.php @@ -182,7 +182,7 @@ class Product extends BaseProduct implements ProductInterface public function removeTaxon(BaseTaxonInterface $taxon) { if ($this->hasTaxon($taxon)) { - $this->taxons->remove($taxon); + $this->taxons->removeElement($taxon); } return $this;
[Core] Fix removing taxon from product
Sylius_Sylius
train
php
f460de1d237e02fdbc3006bc91813efe7837f576
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -208,10 +208,14 @@ module ActiveRecord # If an attribute name is passed, that attribute is updated along with # updated_at/on attributes. # - # Examples: - # # product.touch # updates updated_at/on # product.touch(:designed_at) # updates the designed_at attribute and updated_at/on + # + # If used along with +belongs_to+ then +touch+ will invoke +touch+ method on associated object. + # + # Brake.belongs_to :car, :touch => true + # Car.belongs_to :corporation, :touch => true + # @brake.touch #=> will also invoke @brake.car.touch and @brake.car.corporation.touch def touch(name = nil) attributes = timestamp_attributes_for_update_in_model attributes << name if name
touch operationg if used along with belongs_to will also be invoked on associated objects
rails_rails
train
rb
4ee345b698911887d1fcb95b69ef5dd84f07c29e
diff --git a/lib/hipchat/api_version.rb b/lib/hipchat/api_version.rb index <HASH>..<HASH> 100644 --- a/lib/hipchat/api_version.rb +++ b/lib/hipchat/api_version.rb @@ -226,7 +226,7 @@ module HipChat { :url => URI::escape("/#{user_id}/history/latest"), :body_format => :to_json, - :allowed_params => %i(max-results timezone not-before) + :allowed_params => [:'max-results', :timezone, :'not-before'] } end end
compatibility with ruby <I>
hipchat_hipchat-rb
train
rb
bc79da68945df853b1354c8bf22416133b34e89e
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -8,6 +8,7 @@ DATABASES = { } INSTALLED_APPS = ( + 'tests', 'tests.cases.south_tests', 'tests.cases.geneset_form', 'tests.cases.sample_load_process',
Add tests to INSTALLED_APPS in test settings
chop-dbhi_varify
train
py
03e497fef37b0bd545f9fe1ccd88a9101ccb731c
diff --git a/pkg/label/label.go b/pkg/label/label.go index <HASH>..<HASH> 100644 --- a/pkg/label/label.go +++ b/pkg/label/label.go @@ -24,10 +24,6 @@ func InitLabels(options []string) (string, string, error) { return "", "", nil } -func GenLabels(options string) (string, string, error) { - return "", "", nil -} - func FormatMountLabel(src string, mountLabel string) string { return src } diff --git a/pkg/label/label_selinux.go b/pkg/label/label_selinux.go index <HASH>..<HASH> 100644 --- a/pkg/label/label_selinux.go +++ b/pkg/label/label_selinux.go @@ -66,11 +66,6 @@ func InitLabels(options []string) (string, string, error) { return processLabel, mountLabel, nil } -// DEPRECATED: The GenLabels function is only to be used during the transition to the official API. -func GenLabels(options string) (string, string, error) { - return InitLabels(strings.Fields(options)) -} - // FormatMountLabel returns a string to be used by the mount command. // The format of this string will be used to alter the labeling of the mountpoint. // The string returned is suitable to be used as the options field of the mount command.
pkg/label: delete deprecated GenLabels() Nothing is using this, and it's an InitLabels() call-site which the next commit must update.
rkt_rkt
train
go,go
197325b4e7adfef3def5db187733c4530bd7dfed
diff --git a/lib/tire/index.rb b/lib/tire/index.rb index <HASH>..<HASH> 100644 --- a/lib/tire/index.rb +++ b/lib/tire/index.rb @@ -356,6 +356,9 @@ module Tire params_encoded = params.empty? ? '' : "?#{params.to_param}" @response = Configuration.client.get "#{url}#{params_encoded}" + if @response && @response.failure? && @response.code != 404 + raise RuntimeError, "#{@response.code} > #{@response.body}" + end h = MultiJson.decode(@response.body) wrapper = options[:wrapper] || Configuration.wrapper
Added, that Index#retrieve throws an exception on HTTP errors Closes #<I>
karmi_retire
train
rb
1fdf00c5c578f5a47ca3bc5b005ada5e8cfe3e59
diff --git a/fastlane/lib/fastlane/server/command_parser.rb b/fastlane/lib/fastlane/server/command_parser.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/server/command_parser.rb +++ b/fastlane/lib/fastlane/server/command_parser.rb @@ -5,7 +5,23 @@ require 'json' module Fastlane class CommandParser def self.parse(json: nil) + if json.strip == "done" + return intercept_old_done_command + end + command_json = JSON.parse(json) + command_type_json = command_json['commandType'] + + if command_type_json.nil? + # Old Swift style (needs upgrade) + return handle_old_style_action_command(command_json: command_json) + else + # New Swift command style + return handle_new_style_commands(command_json: command_json) + end + end + + def self.handle_new_style_commands(command_json: nil) command_type = command_json['commandType'].to_sym command = command_json['command'] @@ -16,5 +32,13 @@ module Fastlane return ControlCommand.new(json: command) end end + + def self.handle_old_style_action_command(command_json: nil) + return ActionCommand.new(json: command_json) + end + + def self.intercept_old_done_command + return ControlCommand.new(json: '{"command":"done"}') + end end end
Handle old Swift FastlaneRunner commands (#<I>)
fastlane_fastlane
train
rb
5769a3ca0a37f0bea8934518f5c7391d069ac973
diff --git a/lib/scholar/source.rb b/lib/scholar/source.rb index <HASH>..<HASH> 100644 --- a/lib/scholar/source.rb +++ b/lib/scholar/source.rb @@ -8,6 +8,14 @@ module Scholar self.class_variable_get(:@@sequence) end end + + def rules(*args) # This doesn't work, returns Array (should return Proc) + if args + self.class_variable_set(:@@rules, args) + else + self.class_variable_get(:@@rules) + end + end end end diff --git a/lib/scholar/sources/book.rb b/lib/scholar/sources/book.rb index <HASH>..<HASH> 100644 --- a/lib/scholar/sources/book.rb +++ b/lib/scholar/sources/book.rb @@ -5,6 +5,10 @@ module Scholar :foo, :bar ] + + rules do |r| + r.italicize("foo") + end end end end
non-functional rules method for sources.
noted_scholar
train
rb,rb
0c0b112cf6a8fc2303c23993802f772cc1da5329
diff --git a/Converters/Gd.php b/Converters/Gd.php index <HASH>..<HASH> 100644 --- a/Converters/Gd.php +++ b/Converters/Gd.php @@ -25,7 +25,7 @@ class Gd switch (self::getExtension($source)) { case 'png': if (defined('WEBPCONVERT_GD_PNG') && WEBPCONVERT_GD_PNG) { - return imagecreatefrompng($filePath); + $image = imagecreatefrompng($source); } else { throw new \Exception('PNG file conversion failed. Try forcing it with: define("WEBPCONVERT_GD_PNG", true);'); } @@ -43,7 +43,6 @@ class Gd } $success = imagewebp($image, $destination, $quality); - /* * This hack solves an `imagewebp` bug * See https://stackoverflow.com/questions/30078090/imagewebp-php-creates-corrupted-webp-files
GD was unable to convert PNGs. Fixes #<I>
rosell-dk_webp-convert
train
php
a25121e2f292b4d94a151896e7db9fcb7ee0d4f9
diff --git a/indra/tools/live_curation/live_curation.py b/indra/tools/live_curation/live_curation.py index <HASH>..<HASH> 100644 --- a/indra/tools/live_curation/live_curation.py +++ b/indra/tools/live_curation/live_curation.py @@ -166,6 +166,25 @@ def save_curations(): return jsonify({}) [email protected]('/notify') +def notify(): + if request.json is None: + abort(Response('Missing application/json header.', 415)) + + # Check validity of JSON + # { + # identity: string, # Name of the tool, e.g. "MyTool" + # version: string, # Version of the tool e.g. "3.1.4" + # document_id: string, # ID of the document, e.g. "qwerty1234" + # storage_key: string, # Storage key e.g. "uuid.ext" + # } + req_args = {'identity', 'version', 'document_id', 'storage_key'} + if all(k in req_args for k in request.json.keys()): + return Response('OK', 200) + return jsonify({'status': 400, + 'error_message': 'Bad Request: missing or invalid body'}) + + if __name__ == '__main__': # Process arguments parser = argparse.ArgumentParser(
Add notify endpoint doing <I> Response for now
sorgerlab_indra
train
py
e99456d9d3c478b7ef667d27da2e157c78e0edf4
diff --git a/query/control/controller_test.go b/query/control/controller_test.go index <HASH>..<HASH> 100644 --- a/query/control/controller_test.go +++ b/query/control/controller_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/influxdata/flux" + "github.com/influxdata/flux/arrow" _ "github.com/influxdata/flux/builtin" "github.com/influxdata/flux/codes" "github.com/influxdata/flux/execute" @@ -626,10 +627,16 @@ func TestController_PerQueryMemoryLimit(t *testing.T) { CompileFn: func(ctx context.Context) (flux.Program, error) { return &mock.Program{ ExecuteFn: func(ctx context.Context, q *mock.Query, alloc *memory.Allocator) { + defer func() { + if err, ok := recover().(error); ok && err != nil { + q.SetErr(err) + } + }() + // This is emulating the behavior of exceeding the memory limit at runtime - if err := alloc.Allocate(int(config.MemoryBytesQuotaPerQuery + 1)); err != nil { - q.SetErr(err) - } + mem := arrow.NewAllocator(alloc) + b := mem.Allocate(int(config.MemoryBytesQuotaPerQuery + 1)) + mem.Free(b) }, }, nil },
refactor(query/control): update a test to use the arrow allocator interface (#<I>) We are planning to change the allocator interface within flux to use the arrow allocator. To make the release easier, this updates the test in advance to use the arrow allocator instead of the to be changed memory allocator interface from flux.
influxdata_influxdb
train
go
c20343759108dfc508e47c197ab7301ce9cab417
diff --git a/plugins/karma.js b/plugins/karma.js index <HASH>..<HASH> 100644 --- a/plugins/karma.js +++ b/plugins/karma.js @@ -113,6 +113,13 @@ exports.hook_deny = function (next, connection, params) { return next(OK); }; +exports.hook_reset_transaction = function (next, connection) { + var plugin = this; + // collect any transaction results before they disappear + plugin.check_awards(connection); + return next(); +}; + exports.hook_unrecognized_command = function(next, connection, cmd) { var plugin = this;
karma: collect awards during reset_transaction (before they disappear)
haraka_Haraka
train
js
0967f8c5a10b86893c80d4a23dd2dbade1ca0a7a
diff --git a/src/shims/form-number-date-ui.js b/src/shims/form-number-date-ui.js index <HASH>..<HASH> 100644 --- a/src/shims/form-number-date-ui.js +++ b/src/shims/form-number-date-ui.js @@ -402,6 +402,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document, fVal[0] = tmp; } val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o); + } else if (fVal.length == 3) { + val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o); } return val; },
fix meridian parsing for datetime-local ( fixes issue #<I> | thx @terinjokes )
aFarkas_webshim
train
js
c36234f2ae10db74a4c13b019a2a6895ebd46d5d
diff --git a/lib/sidekiq-status/storage.rb b/lib/sidekiq-status/storage.rb index <HASH>..<HASH> 100644 --- a/lib/sidekiq-status/storage.rb +++ b/lib/sidekiq-status/storage.rb @@ -96,10 +96,10 @@ module Sidekiq::Status::Storage end # Yields redis connection. Uses redis pool if available. - # @param [ConnectionPool] redis_pool redis connection pool - def redis_connection(pool) - if pool - pool.with do |conn| + # @param [ConnectionPool] redis_pool optional redis connection pool + def redis_connection(redis_pool=nil) + if redis_pool + redis_pool.with do |conn| yield conn end else
rename pool arg to redis_pool
utgarda_sidekiq-status
train
rb
48ffa991fa26ce7e7d728978ffefe690ee2f691f
diff --git a/src/Common/ExceptionLogger.php b/src/Common/ExceptionLogger.php index <HASH>..<HASH> 100644 --- a/src/Common/ExceptionLogger.php +++ b/src/Common/ExceptionLogger.php @@ -45,7 +45,7 @@ class ExceptionLogger /** * @var mixed */ - protected $custom_closure; + protected $custom; /** * @var array
renamed property $custom_closure $custom
peakphp_framework
train
php
0aad2b6c89f83b00953c3e658c88f5502f3d6cee
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index <HASH>..<HASH> 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -18,8 +18,9 @@ Licensed under the terms of the MIT License import os try: # Test if IPython v0.11+ is installed - from IPython import deathrow #analysis:ignore - if os.environ.get('QT_API', 'pyqt') == 'pyqt': + import IPython + if IPython.__version__.startswith(('0.11', '0.12'))\ + and os.environ.get('QT_API', 'pyqt') == 'pyqt': # If PyQt is the selected GUI toolkit (at this stage, only the # bootstrap script has eventually set this option), # switch to PyQt API #2 by simply importing the IPython qt module
(Fixes Issue <I>) New IPython plugin is now working with PyQt4 and IPython <I>
spyder-ide_spyder
train
py
4bc39f72e8e9a6772f3d2eb9295809658c1793d7
diff --git a/cliff/interactive.py b/cliff/interactive.py index <HASH>..<HASH> 100644 --- a/cliff/interactive.py +++ b/cliff/interactive.py @@ -43,7 +43,7 @@ class InteractiveApp(cmd2.Cmd): # We send the message through our parent app, # since it already has the logic for executing # the subcommand. - line_parts = shlex.split(line) + line_parts = shlex.split(line.parsed.raw) self.parent_app.run_subcommand(line_parts) def completedefault(self, text, line, begidx, endidx): @@ -95,3 +95,18 @@ class InteractiveApp(cmd2.Cmd): for n in cmd2.Cmd.get_names(self) if not n.startswith('do__') ] + + def precmd(self, statement): + # Pre-process the parsed command in case it looks like one of + # our subcommands, since cmd2 does not handle multi-part + # command names by default. + line_parts = shlex.split(statement.parsed.raw) + try: + cmd_factory, cmd_name, sub_argv = self.command_manager.find_command(line_parts) + except ValueError: + # Not a plugin command + pass + else: + statement.parsed.command = cmd_name + statement.parsed.args = ' '.join(sub_argv) + return statement
fix interactive command processor to handle multi-part commands, including some that use the same first word as existing commands
dreamhost_cliff-tablib
train
py
4b921bd60460e6108cae98d82f8224388e0df854
diff --git a/nyt.js b/nyt.js index <HASH>..<HASH> 100644 --- a/nyt.js +++ b/nyt.js @@ -282,7 +282,20 @@ function nyt (keys) { get(path, callback, args); }, specific : function (args, callback) { + if (!callback) { + callback = args; + args = undefined; + } + var version = 'v3/'; + var format = '.json'; + var query = ''; + if (querystring.stringify(args)) { + query = querystring.stringify(args) + '&'; + } + var path = '/svc/news/' + version + 'content' + format + '?' + query + + 'api-key=' + myKeys['newswire']; + get(path, callback, args); } }
added specific news item to newswire api
czarlos_nyt
train
js
c164952516d0deb0200e48f18f9f9ef5aabc0207
diff --git a/src/components/bottomSheet/bottomSheet.js b/src/components/bottomSheet/bottomSheet.js index <HASH>..<HASH> 100644 --- a/src/components/bottomSheet/bottomSheet.js +++ b/src/components/bottomSheet/bottomSheet.js @@ -183,13 +183,14 @@ function MdBottomSheetProvider($$interimElementProvider) { function onRemove(scope, element, options) { var bottomSheet = options.bottomSheet; - if (options.disableParentScroll) { - options.parent.css('overflow', options.lastOverflow); - delete options.lastOverflow; - } $animate.leave(backdrop); return $animate.leave(bottomSheet.element).then(function() { + if (options.disableParentScroll) { + options.parent.css('overflow', options.lastOverflow); + delete options.lastOverflow; + } + bottomSheet.cleanup(); // Restore focus
fix(bottomSheet): unset overflow after leave animation completes as per discussion at <URL>
angular_material
train
js
420d0159e72db54efa94aa6cf4b0c02ecddabcc1
diff --git a/lib/tools/system-calls.js b/lib/tools/system-calls.js index <HASH>..<HASH> 100644 --- a/lib/tools/system-calls.js +++ b/lib/tools/system-calls.js @@ -434,6 +434,11 @@ systemCallMethods.launchAVD = async function (avdName, avdArgs, language, countr proc.on('output', (stdout, stderr) => { log.info(`[AVD OUTPUT] ${stdout || stderr}`); }); + proc.on('exit', (code, signal) => { + if (code !== 0) { + log.errorAndThrow(`Emulator avd ${avdName} exit with code ${code}, signal ${signal}`); + } + }); await retry(retryTimes, this.getRunningAVDWithRetry.bind(this), avdName, avdLaunchTimeout); await this.waitForEmulatorReady(avdReadyTimeout); return proc;
throw error on avd failing to launch (#<I>) * exit earlier when avd fails to launch * update avd exit message
appium_appium-adb
train
js