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
dae008cf9d75a54de9ec0c54f81dfcb648260257
diff --git a/src/mixins/helper.js b/src/mixins/helper.js index <HASH>..<HASH> 100644 --- a/src/mixins/helper.js +++ b/src/mixins/helper.js @@ -1,14 +1,8 @@ -const blockies = require('ethereum-blockies-png') const unit = require('ethjs-unit') const numeral = require('numeral') export default { methods: { - blockie (address) { - return blockies.createDataURL({ - seed: address - }) - }, forwardEvent (event) { this.$emit(event.type, event) },
Remove unused "blockie" helper
aeternity_aepp-components
train
js
3bf3fa576d29d026aa1b0bf7f6e5f9110fca36dc
diff --git a/wallet/wallet.go b/wallet/wallet.go index <HASH>..<HASH> 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -612,6 +612,9 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs // nextMultiSigKey... // TODO(roasbeef): on shutdown, write state of pending keys, then read back? func (l *LightningWallet) getNextMultiSigKey() (*btcec.PrivateKey, error) { + l.lmtx.Lock() + defer l.lmtx.Unlock() + nextAddr, err := l.wallet.Manager.NextExternalAddresses(waddrmgr.DefaultAccountNum, 1) if err != nil { return nil, err
make getNextMultiSigKey concurrent-safe
lightningnetwork_lnd
train
go
893d4e47f580f45fb4c8994166bfa5ae2cce7584
diff --git a/Suggester/Context/CategoryContext.php b/Suggester/Context/CategoryContext.php index <HASH>..<HASH> 100644 --- a/Suggester/Context/CategoryContext.php +++ b/Suggester/Context/CategoryContext.php @@ -18,6 +18,8 @@ class CategoryContext extends AbstractContext { /** * {@inheritdoc} + * + * @return array|string */ public function toArray() {
Updated toArray doc comment in CategoryContext class
ongr-io_ElasticsearchDSL
train
php
a97e733892335f0b145722d207e7f8954bc85151
diff --git a/lib/right_amqp/mq.rb b/lib/right_amqp/mq.rb index <HASH>..<HASH> 100644 --- a/lib/right_amqp/mq.rb +++ b/lib/right_amqp/mq.rb @@ -146,6 +146,7 @@ class MQ } end attr_reader :channel, :connection + alias :conn :connection # May raise a MQ::Error exception when the frame payload contains a # Protocol::Channel::Close object. @@ -838,9 +839,6 @@ class MQ pp args puts end - - attr_reader :connection - alias :conn :connection end #-- convenience wrapper (read: HACK) for thread-local MQ object
Fixed issue with exception: Caught exception in EventMachine: #<NoMethodError: private method 'connection' called for #<MQ:0x<I>f8f<I>a8c<I>>>
rightscale_right_amqp
train
rb
442733600e2308d035489f4565d87987e537bea5
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java @@ -39,7 +39,7 @@ import org.springframework.boot.gradle.testkit.GradleBuildExtension; public final class GradleCompatibilityExtension implements TestTemplateInvocationContextProvider { private static final List<String> GRADLE_VERSIONS = Arrays.asList("default", "5.0", "5.1.1", "5.2.1", "5.3.1", - "5.4.1", "5.5.1", "5.6.4", "6.0.1", "6.1.1", "6.2"); + "5.4.1", "5.5.1", "5.6.4", "6.0.1", "6.1.1", "6.2.1"); @Override public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) {
Test the Gradle plugin against Gradle <I> See gh-<I>
spring-projects_spring-boot
train
java
30291485e2791c6910793cb2ef6a0d15c55d69ac
diff --git a/lib/scribd_fu.rb b/lib/scribd_fu.rb index <HASH>..<HASH> 100644 --- a/lib/scribd_fu.rb +++ b/lib/scribd_fu.rb @@ -12,7 +12,16 @@ module ScribdFu 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.sun.xml.writer', - 'application/vnd.sun.xml.impress'] + 'application/vnd.sun.xml.impress', + # OOXML, AKA `the MIME types from hell'. Seriously, these are long enough to + # start their own dictionary... + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'] def self.included(base) base.extend ActsAsScribdDocument
Added OOXML MIME types.
mdarby_scribd_fu
train
rb
f922112fecd9a1fc512ade19e37c1b4581504eb2
diff --git a/archetype-itests/src/test/java/io/fabric8/tooling/archetype/generator/ArchetypeTest.java b/archetype-itests/src/test/java/io/fabric8/tooling/archetype/generator/ArchetypeTest.java index <HASH>..<HASH> 100644 --- a/archetype-itests/src/test/java/io/fabric8/tooling/archetype/generator/ArchetypeTest.java +++ b/archetype-itests/src/test/java/io/fabric8/tooling/archetype/generator/ArchetypeTest.java @@ -94,7 +94,11 @@ public class ArchetypeTest { "infinispan-client-archetype", // TODO https://github.com/fabric8io/ipaas-quickstarts/issues/1364 - "spring-boot-ribbon-archetype" + "spring-boot-ribbon-archetype", + + // TODO https://github.com/fabric8io/ipaas-quickstarts/issues/1466 + "vertx-web-archetype" + )); private boolean verbose = true;
#<I>: Disable test as we need a new archetype release
fabric8io_ipaas-quickstarts
train
java
4604472ef3d820399145e3010b70cb7ac09b604d
diff --git a/heartbeat/heartbeat.py b/heartbeat/heartbeat.py index <HASH>..<HASH> 100644 --- a/heartbeat/heartbeat.py +++ b/heartbeat/heartbeat.py @@ -64,7 +64,7 @@ class Heartbeat(object): """ # Generate a series of seeds - seeds = self.gen_seeds(num, root_seed) + seeds = self.generate_seeds(num, root_seed) blocks = self.pick_blocks(num, root_seed) # List of 2-tuples (seed, hash_response)
use new more descriptive generate_seeds call
StorjOld_heartbeat
train
py
1328f12f4987429869c3ceec55334cf695ab3bf7
diff --git a/src/HookFactory.php b/src/HookFactory.php index <HASH>..<HASH> 100644 --- a/src/HookFactory.php +++ b/src/HookFactory.php @@ -132,7 +132,7 @@ END $programName = $programName ?: $programPath; if ($multiple) { - $completionCommand = '${1} _completion'; + $completionCommand = '$1 _completion'; } else { $completionCommand = $programPath . ' _completion'; }
Fix --multiple option generating ZSH hook that resolves with the program '' {$1} works under BASH, but doesn't resolve to anything under ZSH. Just using $1 works correctly on both BASH and ZSH.
stecman_symfony-console-completion
train
php
0ffbe2bd67928aac2f51657a683faff99bf3f929
diff --git a/test/belongs_to_test.rb b/test/belongs_to_test.rb index <HASH>..<HASH> 100644 --- a/test/belongs_to_test.rb +++ b/test/belongs_to_test.rb @@ -15,6 +15,7 @@ end class BelongsToTest < ActionController::TestCase tests CommentsController + # TODO: look into the failures as this should run randomly def self.test_order # version 5 defaults to random, which fails... MiniTest::Unit::VERSION.to_i >= 5 ? :alpha : super
Add note to fix test so it runs in random order
activeadmin_inherited_resources
train
rb
3e6010f5ad774a9699b3293606f4f711236c3e19
diff --git a/libkbfs/block_retrieval_worker_test.go b/libkbfs/block_retrieval_worker_test.go index <HASH>..<HASH> 100644 --- a/libkbfs/block_retrieval_worker_test.go +++ b/libkbfs/block_retrieval_worker_test.go @@ -260,7 +260,7 @@ func TestBlockRetrievalWorkerShutdown(t *testing.T) { } func TestBlockRetrievalWorkerMultipleBlockTypes(t *testing.T) { - t.Log("Test the ability of a worker and queue to work correctly together.") + t.Log("Test that we can retrieve the same block into different block types.") codec := kbfscodec.NewMsgpack() q := newBlockRetrievalQueue(1, codec) require.NotNil(t, q)
block_retrieval_worker_test: fix the test description
keybase_client
train
go
3125a54ab5b3e08b09195858dd0e74e5ebfa728d
diff --git a/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/shaperepository.js b/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/shaperepository.js index <HASH>..<HASH> 100644 --- a/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/shaperepository.js +++ b/jbpm-designer-client/src/main/resources/org/jbpm/designer/public/js/Plugins/shaperepository.js @@ -228,10 +228,10 @@ ORYX.Plugins.ShapeRepository = { var IdParts = stencil.id().split("#"); var textTitle = ORYX.I18N.propertyNames[IdParts[1]]; if(!textTitle) { - textTitle = IdParts[1]; + textTitle = stencil.title(); } else { if(textTitle.length <= 0) { - textTitle = IdParts[1]; + textTitle = stencil.title(); } } var newElement = new Ext.tree.TreeNode({
BZ <I> - Object library shows incorrect name of Custom Task
kiegroup_jbpm-designer
train
js
e18198d861069faf0d885ca1bbe98d0fd6820df4
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 @@ -1354,7 +1354,9 @@ public final class DefaultFileSystemMaster extends CoreMaster } else { String ufsFingerprint = Fingerprint.create(ufs.getUnderFSType(), ufsStatus).serialize(); return ufsStatus.isFile() - && (ufsFingerprint.equals(inode.asFile().getUfsFingerprint())); + && (ufsFingerprint.equals(inode.asFile().getUfsFingerprint())) + && ufsStatus instanceof UfsFileStatus + && ((UfsFileStatus) ufsStatus).getContentLength() == inode.asFile().getLength(); } } }
Check consistency should check file length pr-link: Alluxio/alluxio#<I> change-id: cid-6b<I>aa<I>bb4c<I>ff0b7d<I>cbc<I>cbec6ae
Alluxio_alluxio
train
java
1571aa844dcd264966644bf4bb1973da5adc111a
diff --git a/src/TokenIterator.php b/src/TokenIterator.php index <HASH>..<HASH> 100644 --- a/src/TokenIterator.php +++ b/src/TokenIterator.php @@ -73,7 +73,7 @@ class TokenIterator { * @return bool */ public function hasNext() { - return $this->position < $this->length; + return $this->position + 1 < $this->length; } /** diff --git a/tests/TokenIteratorTest.php b/tests/TokenIteratorTest.php index <HASH>..<HASH> 100644 --- a/tests/TokenIteratorTest.php +++ b/tests/TokenIteratorTest.php @@ -9,6 +9,7 @@ class TokenIteratorTest extends \PHPUnit_Framework_TestCase { $this->assertSame($test, $peek); $this->assertNull($iterator->peek(1)); + $this->assertFalse($iterator->hasNext()); $this->assertNull($iterator->next()); $this->assertEquals(1, $iterator->getLineNumber()); $this->assertEquals(5, $iterator->getColumnNumber());
Fixed bug with TokenIterator::hasNext
grom358_pharborist
train
php,php
81577516bcffcd9eef9ff7c49ebd14f09c6aeab4
diff --git a/components/link-ng/link-ng.js b/components/link-ng/link-ng.js index <HASH>..<HASH> 100644 --- a/components/link-ng/link-ng.js +++ b/components/link-ng/link-ng.js @@ -34,9 +34,8 @@ function rgLinkDirective() { transclude: true, replace: true, template: ` -<a class="${styles.link} ${styles.compatibilityUnderlineMode}"> - <span class="${styles.inner}" ng-transclude></span> -</a> +<a class="${styles.link} ${styles.compatibilityUnderlineMode}" +><span class="${styles.inner}" ng-transclude></span></a> ` }; }
RG-<I> remove unnecessary space from link-ng component
JetBrains_ring-ui
train
js
eff78cdc53d509685f75f8e91942e65c2e81753c
diff --git a/src/deep-core/lib/AWS/Region.js b/src/deep-core/lib/AWS/Region.js index <HASH>..<HASH> 100644 --- a/src/deep-core/lib/AWS/Region.js +++ b/src/deep-core/lib/AWS/Region.js @@ -60,6 +60,13 @@ export class Region { /** * @returns {String} */ + static get EU_LONDON() { + return 'eu-west-2'; + } + + /** + * @returns {String} + */ static get SOUTH_AMERICA_SAO_PAULO() { return 'sa-east-1'; } @@ -112,6 +119,7 @@ export class Region { Region.ASIA_PACIFIC_SINGAPORE, Region.EU_FRANKFURT, Region.EU_IRELAND, + Region.EU_LONDON, Region.SOUTH_AMERICA_SAO_PAULO, Region.US_EAST_N_VIRGINIA, Region.US_EAST_OHIO,
# Add London region in deep-core
MitocGroup_deep-framework
train
js
5ce6d55c76c2f32b605623b67f2f70428174cdfd
diff --git a/hydra_base/lib/units.py b/hydra_base/lib/units.py index <HASH>..<HASH> 100644 --- a/hydra_base/lib/units.py +++ b/hydra_base/lib/units.py @@ -393,7 +393,7 @@ def bulk_add_dimensions(dimension_list, **kwargs): added_dimensions.append(add_dimension(dimension, **kwargs)) log.info("hydra-base.units.bulk_add_dimensions - 2 ") - return JSONObject({"dimensions": added_dimensions) + return JSONObject({"dimensions": added_dimensions}) """ +----------------------------------+
now the bulk add returns the added dimensions
hydraplatform_hydra-base
train
py
5303ffe1f8460dc0eabc15f22f142e7449764195
diff --git a/modules/citrus-core/src/main/java/com/consol/citrus/validation/json/report/GraciousProcessingReport.java b/modules/citrus-core/src/main/java/com/consol/citrus/validation/json/report/GraciousProcessingReport.java index <HASH>..<HASH> 100644 --- a/modules/citrus-core/src/main/java/com/consol/citrus/validation/json/report/GraciousProcessingReport.java +++ b/modules/citrus-core/src/main/java/com/consol/citrus/validation/json/report/GraciousProcessingReport.java @@ -61,8 +61,8 @@ public class GraciousProcessingReport implements ProcessingReport{ } /** - * TODO: Add documentation - * @param processingReports + * Creates a GraciousProcessingReport while preserving the information from the given list of ProcessingReports + * @param processingReports The list of reports to merge with the new GraciousProcessingReport */ public GraciousProcessingReport(List<ProcessingReport> processingReports) { this(false);
(#<I>) Added missing javadoc
citrusframework_citrus
train
java
b3754a756c9d8309c64c2a12645805b0b14c61b2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -9,12 +9,18 @@ INSTALL_REQUIRES = [ 'psutil', ] +# HACK: Please remove someday +import utool +ext_modules = utool.find_ext_modules() + + if __name__ == '__main__': setup( name='utool', version='1.0.0.dev1', description='Univerally useful utility tools for you!', url='https://github.com/Erotemic/utool', + ext_modules=ext_modules, packages=[ 'utool', 'utool._internal',
commiting hack for cyth
Erotemic_utool
train
py
6c2b539dd39a5fa250ba3a422b2d97a279afee21
diff --git a/azurerm/resource_arm_mysql_server.go b/azurerm/resource_arm_mysql_server.go index <HASH>..<HASH> 100644 --- a/azurerm/resource_arm_mysql_server.go +++ b/azurerm/resource_arm_mysql_server.go @@ -172,6 +172,18 @@ func resourceArmMySqlServer() *schema.Resource { "tags": tagsSchema(), }, + + CustomizeDiff: func(diff *schema.ResourceDiff, v interface{}) error { + + tier, _ := diff.GetOk("sku.0.tier") + storageMB, _ := diff.GetOk("storage_profile.0.storage_mb") + + if strings.ToLower(tier.(string)) == "basic" && storageMB.(int) > 1048576 { + return fmt.Errorf("basic pricing tier only supports upto 1,048,576 MB (1TB) of storage") + } + + return nil + }, } }
Added sku validation Validated configuration since basic sku only supports up to 1 TB of storage.
terraform-providers_terraform-provider-azurerm
train
go
d2a3446af54eca356be26c997903138e3eb8baea
diff --git a/src/grid/AccountColumn.php b/src/grid/AccountColumn.php index <HASH>..<HASH> 100644 --- a/src/grid/AccountColumn.php +++ b/src/grid/AccountColumn.php @@ -8,16 +8,10 @@ * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) */ -/** - * @see http://hiqdev.com/hipanel-module-hosting - * @license http://hiqdev.com/hipanel-module-hosting/license - * @copyright Copyright (c) 2015 HiQDev - */ - namespace hipanel\modules\hosting\grid; -use hipanel\grid\DataColumn; use hipanel\modules\hosting\widgets\combo\AccountCombo; +use hiqdev\higrid\DataColumn; use yii\helpers\Html; class AccountColumn extends DataColumn
removed use of `hipanel\grid\DataColumn` in favour of `hiqdev\higrid\DataColumn`
hiqdev_hipanel-module-hosting
train
php
da91eb4071cd91a09a1e987c71c523322f62ea35
diff --git a/test/generated_gio_test.rb b/test/generated_gio_test.rb index <HASH>..<HASH> 100644 --- a/test/generated_gio_test.rb +++ b/test/generated_gio_test.rb @@ -31,10 +31,10 @@ class GeneratedGioTest < MiniTest::Spec assert_equal Gio::File, anc[1] assert_equal GObject::Object, anc[2] refute_includes Gio::File.instance_methods.map(&:to_s), - 'get_property' + 'get_qdata' assert_includes GObject::Object.instance_methods.map(&:to_s), - 'get_property' - @it.setup_and_call :get_property, 'foo', GObject::Value.wrap_ruby_value(0) + 'get_qdata' + @it.setup_and_call :get_qdata, 1 end end
Use #get_qdata instead of #get_property for testing, to avoid warning. The method #get_property prints a warning if the property does not exist, but #get_qdata just returns nil.
mvz_gir_ffi
train
rb
4910c7dbf72d83b341359424a1c05a3d440d98a1
diff --git a/lib/app/helper_datasource/00-nosql_datasource.js b/lib/app/helper_datasource/00-nosql_datasource.js index <HASH>..<HASH> 100644 --- a/lib/app/helper_datasource/00-nosql_datasource.js +++ b/lib/app/helper_datasource/00-nosql_datasource.js @@ -766,7 +766,20 @@ NoSQL.setMethod(function compileCriteria(criteria, group) { name = entry.association + '.' + name; } - field_entry[name] = obj; + // Temporary fix to actually query translatable field contents + if (entry.field.is_translatable) { + let $or = []; + + for (let key in Prefix.all()) { + let temp = {}; + temp[name + '.' + key] = obj; + $or.push(temp) + } + + field_entry.$or = $or; + } else { + field_entry[name] = obj; + } result.push(field_entry); }
Add temporary solution for querying translated field contents
skerit_alchemy
train
js
478a05d832f13e45b92ffbc3ce7bb1898b8a0f1d
diff --git a/code/template/helper/listbox.php b/code/template/helper/listbox.php index <HASH>..<HASH> 100644 --- a/code/template/helper/listbox.php +++ b/code/template/helper/listbox.php @@ -84,7 +84,7 @@ class TemplateHelperListbox extends TemplateHelperSelect $config->append(array( 'prompt' => '- '.$translator->translate('Select').' -', 'options' => array(), - 'select2' => false, + 'select2' => true, 'attribs' => array(), ));
Issue #<I>: Make listboxes use select2 by default
timble_kodekit
train
php
2ac13e9a72d7c75b171682ccd3dd5a45e0bdaedd
diff --git a/lib/chunky_png/color.rb b/lib/chunky_png/color.rb index <HASH>..<HASH> 100644 --- a/lib/chunky_png/color.rb +++ b/lib/chunky_png/color.rb @@ -540,8 +540,8 @@ module ChunkyPNG # Delta E in Lab colorspace, this method should serve many use-cases while # avoiding the overhead of converting RGBA to Lab. # - # @param color_a [Integer] - # @param color_b [Integer] + # @param pixel_after [Integer] + # @param pixel_before [Integer] # @return [Float] def euclidean_distance_rgba(pixel_after, pixel_before) Math.sqrt(
Fix tags for Color#euclidean_distance_rgba When I implemented this method, I accidentally left an older variable name I was using in the YARD tags. Although these colors are interchangeable due to the math involved (i.e. the before and after aspect doesn't actually matter), the documentation should at least reflect the actual code.
wvanbergen_chunky_png
train
rb
8465b0656d74669e0d08a46874d8466fad0675da
diff --git a/lib/bower-rails/dsl.rb b/lib/bower-rails/dsl.rb index <HASH>..<HASH> 100644 --- a/lib/bower-rails/dsl.rb +++ b/lib/bower-rails/dsl.rb @@ -56,13 +56,14 @@ module BowerRails def generate_dotbowerrc contents = JSON.parse(File.read(File.join(@root_path, '.bowerrc'))) rescue {} contents["directory"] = "bower_components" + JSON.pretty_generate(contents) end def write_dotbowerrc groups.map do |g| g_norm = normalize_location_path(g.first, group_assets_path(g)) File.open(File.join(g_norm, ".bowerrc"), "w") do |f| - f.write(JSON.pretty_generate(generate_dotbowerrc)) + f.write(generate_dotbowerrc) end end end
fix 'only generation of JSON objects or arrays' allowed error
rharriso_bower-rails
train
rb
8e46769284f31c52dd577cf11bf92c32da492340
diff --git a/audio/audio.go b/audio/audio.go index <HASH>..<HASH> 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -321,11 +321,8 @@ func (p *playerImpl) Close() error { } // Play plays the stream. -// -// Play always returns nil. -func (p *Player) Play() error { +func (p *Player) Play() { p.p.Play() - return nil } func (p *playerImpl) Play() { @@ -501,11 +498,8 @@ func (p *playerImpl) Seek(offset time.Duration) error { } // Pause pauses the playing. -// -// Pause always returns nil. -func (p *Player) Pause() error { +func (p *Player) Pause() { p.p.Pause() - return nil } func (p *playerImpl) Pause() {
audio: Remove returning values from Play/Pause
hajimehoshi_ebiten
train
go
a638fb79b61712fba27fefc070f401d756f4308f
diff --git a/lib/Pheasant.php b/lib/Pheasant.php index <HASH>..<HASH> 100755 --- a/lib/Pheasant.php +++ b/lib/Pheasant.php @@ -26,6 +26,15 @@ class Pheasant } /** + * Returns a the connection manager + * @return object + */ + public function connections() + { + return $this->_connections; + } + + /** * Returns a connection by name * @return object */
Added a connections() method get the ConnectionManager.
lox_pheasant
train
php
aa21b3a90a0f905b4787d9f5444ff4d9bf57edc2
diff --git a/Classes/Typo3/Hook/LinkWizzard.php b/Classes/Typo3/Hook/LinkWizzard.php index <HASH>..<HASH> 100644 --- a/Classes/Typo3/Hook/LinkWizzard.php +++ b/Classes/Typo3/Hook/LinkWizzard.php @@ -84,7 +84,7 @@ class LinkWizzard extends AbstractLinkHandler implements LinkHandlerInterface, L */ public function canHandleLink(array $linkParts): bool { - if (strcmp($linkParts['type'], 'happy_feet') !== 0) { + if ($linkParts['type'] === null || strcmp($linkParts['type'], 'happy_feet') !== 0) { return false; } if (!$linkParts['url']) {
[FIX] Avoid Oops on opening linkwizard on empty links.
AOEpeople_happy_feet
train
php
27640f777cc435d6c7ed42a39de0ac9b1529c089
diff --git a/lib/history.js b/lib/history.js index <HASH>..<HASH> 100755 --- a/lib/history.js +++ b/lib/history.js @@ -2,10 +2,11 @@ var _ = require('lodash'); var LocalStorage = require('node-localstorage').LocalStorage; +var path = require('path'); // Number of command histories kept in persistent storage -var HISTORY_SIZE = 50; -var DEFAULT_STORAGE_PATH = './.cmd_history'; +var HISTORY_SIZE = 500; +var DEFAULT_STORAGE_PATH = path.normalize(process.cwd() + '/.cmd_history'); var History = function () { this._storageKey = undefined;
persistent history cwd() patch
dthree_vorpal
train
js
a9baf7025517b92088b867d7f142d6e63ad627c0
diff --git a/tests/nlp/unit/hierarchical_clustering_test.py b/tests/nlp/unit/hierarchical_clustering_test.py index <HASH>..<HASH> 100755 --- a/tests/nlp/unit/hierarchical_clustering_test.py +++ b/tests/nlp/unit/hierarchical_clustering_test.py @@ -68,7 +68,10 @@ class TestHierarchicalClustering(unittest.TestCase): # Extract vectors from KNN sparseDataMatrix = HierarchicalClustering._extractVectorsFromKNN(knn) - self.assertEqual(sparseDataMatrix.todense().tolist(), vectors.tolist()) + self.assertEqual( + sorted(sparseDataMatrix.todense().tolist()), + sorted(vectors.tolist()) + ) def testCondensedIndex(self):
Modified unit test for _extractVectorsFromKNN to be invariant to order vectors are returned, which is not part of the function contract.
numenta_htmresearch
train
py
be89d96078b50225654a303de9037facdd94e645
diff --git a/cli/drivers/ValetDriver.php b/cli/drivers/ValetDriver.php index <HASH>..<HASH> 100644 --- a/cli/drivers/ValetDriver.php +++ b/cli/drivers/ValetDriver.php @@ -137,10 +137,7 @@ abstract class ValetDriver header('Content-Type: text/html'); header_remove('Content-Type'); - /** - * Tell Caddy to handle the static file itself, using it's `internal` feature. - */ - header('X-Accel-Redirect: ' . $staticFilePath); + header('X-Accel-Redirect: /static' . $staticFilePath); } /**
Send empty Content-Type header to force nginx to determine on it's own
laravel_valet
train
php
b8cb59091cb71a76ca862c9e093f359c270b3e61
diff --git a/lib/jsduck/renderer.rb b/lib/jsduck/renderer.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/renderer.rb +++ b/lib/jsduck/renderer.rb @@ -321,6 +321,7 @@ module JsDuck end def render_return(ret) + return if ret[:type] == "undefined" return [ "<h3 class='pa'>Returns</h3>", "<ul>",
Hide "Returns" section if undefined is returned.
senchalabs_jsduck
train
rb
1cf75132a78515ab1e42af871dd004065a7bb48e
diff --git a/async_messages/__init__.py b/async_messages/__init__.py index <HASH>..<HASH> 100644 --- a/async_messages/__init__.py +++ b/async_messages/__init__.py @@ -45,4 +45,4 @@ def get_messages(user): def _user_key(user): - return '_async_message_%d' % user.id + return '_async_message_%d' % user.pk
Fixed getting the primary key of the custom user model
codeinthehole_django-async-messages
train
py
9c90c7892462c7a6e9c1b38d449c20511fed11c9
diff --git a/tests/Support/SupportTappableTest.php b/tests/Support/SupportTappableTest.php index <HASH>..<HASH> 100644 --- a/tests/Support/SupportTappableTest.php +++ b/tests/Support/SupportTappableTest.php @@ -2,8 +2,8 @@ namespace Illuminate\Tests\Support; -use Illuminate\Support\Traits\Tappable; use PHPUnit\Framework\TestCase; +use Illuminate\Support\Traits\Tappable; class SupportTappableTest extends TestCase {
Update SupportTappableTest.php
laravel_framework
train
php
b158114a6ffddf37de64f9a736b769b6241be703
diff --git a/frontend/dockerfile/dockerfile2llb/convert.go b/frontend/dockerfile/dockerfile2llb/convert.go index <HASH>..<HASH> 100644 --- a/frontend/dockerfile/dockerfile2llb/convert.go +++ b/frontend/dockerfile/dockerfile2llb/convert.go @@ -333,6 +333,9 @@ func dispatchCopy(d *dispatchState, c instructions.SourcesAndDest, sourceState l img := llb.Image("tonistiigi/copy@sha256:260a4355be76e0609518ebd7c0e026831c80b8908d4afd3f8e8c942645b1e5cf") dest := path.Join("/dest", pathRelativeToWorkingDir(d.state, c.Dest())) + if c.Dest() == "." || c.Dest()[len(c.Dest())-1] == filepath.Separator { + dest += string(filepath.Separator) + } args := []string{"copy"} mounts := make([]llb.RunOption, 0, len(c.Sources())) for i, src := range c.Sources() {
dockerfile: fix copy to non-existing working dir
moby_buildkit
train
go
76b5cf3da76c0d73227a34219dcca5d451444533
diff --git a/src/main/java/org/pac4j/vertx/VertxWebContext.java b/src/main/java/org/pac4j/vertx/VertxWebContext.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/pac4j/vertx/VertxWebContext.java +++ b/src/main/java/org/pac4j/vertx/VertxWebContext.java @@ -190,17 +190,11 @@ public class VertxWebContext implements WebContext { routingContext.response().putHeader(name, value); } -// @Override public Map<String, String> getResponseHeaders() { return routingContext.response().headers().entries().stream() .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } -// -// @Override -// public String getResponseLocation() { -// return getResponseHeaders().get(HttpConstants.LOCATION_HEADER); -// } @Override public void setResponseContentType(String s) {
Issue #<I> Update to pac4j <I> Remove commented-out code which should have been removed before the PR was submitted
pac4j_vertx-pac4j
train
java
a74cb4b7ea4d02198f94b9c0caea85de1a3658fc
diff --git a/app/models/configurable.rb b/app/models/configurable.rb index <HASH>..<HASH> 100644 --- a/app/models/configurable.rb +++ b/app/models/configurable.rb @@ -61,7 +61,11 @@ class Configurable < ActiveRecord::Base if found value else - parse_value key, defaults[key][:default] + parse_value(key, defaults[key][:default]).tap do |val| + if ConfigurableEngine::Engine.config.use_cache + Rails.cache.write cache_key(key), val + end + end end end
Cache default values Previously, if caching was turned on but a key was not yet in the persisted database, the engine returned the default value without caching it. Therefore, the next time the key was requested, the engine attempted once more to find the value with a database call. This commit makes the engine cache the default value so that the engine does not continue to query the database every time the value is requested.
paulca_configurable_engine
train
rb
3d0b3f7a598c979f3c66d538395e614abfc2bb09
diff --git a/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/db/variation/VariantAnnotationMongoDBAdaptor.java b/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/db/variation/VariantAnnotationMongoDBAdaptor.java index <HASH>..<HASH> 100644 --- a/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/db/variation/VariantAnnotationMongoDBAdaptor.java +++ b/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/db/variation/VariantAnnotationMongoDBAdaptor.java @@ -1036,6 +1036,13 @@ public class VariantAnnotationMongoDBAdaptor extends MongoDBAdaptor implements variantStart = variant.getPosition(); } + if(variant.getReference().equalsIgnoreCase("<INS>") || variant.getReference().equalsIgnoreCase("<DEL>")) { + queryResult.setErrorMsg("INS and DEL are not yet implemented"); + queryResult.setNumResults(1); + queryResult.setResult(consequenceTypeList); + return queryResult; + } + // builderGene = QueryBuilder.start("chromosome").is(variant.getChromosome()).and("end") // .greaterThanEquals(variant.getPosition() - 5000).and("start").lessThanEquals(variantEnd + 5000); // variantEnd is used rather than variant.getPosition() to account for deletions which end falls within the 5kb left area of the gene
annotator: INS and DEL are skkiped, this will be implemented soon
opencb_cellbase
train
java
966eed15e0e2c3596636e56faff7a5748be9704d
diff --git a/web/js/landingPage.js b/web/js/landingPage.js index <HASH>..<HASH> 100644 --- a/web/js/landingPage.js +++ b/web/js/landingPage.js @@ -61,7 +61,7 @@ app = apps[i]; col.append("a") - .attr("href", "/app/" + app.path + "/") + .attr("href", app.path) .append("h4") .html(app.name); col.append("p")
Making landing page stuff more general - no longer assumes a particular shape for application URLs.
Kitware_tangelo
train
js
d1a9d577af427b4e0ca9d0112fd840ff2e4b7cb7
diff --git a/django_deployer/paas_templates/appengine/settings_appengine.py b/django_deployer/paas_templates/appengine/settings_appengine.py index <HASH>..<HASH> 100644 --- a/django_deployer/paas_templates/appengine/settings_appengine.py +++ b/django_deployer/paas_templates/appengine/settings_appengine.py @@ -4,7 +4,6 @@ try: except: pass -from settings import * import os import sys @@ -19,6 +18,9 @@ REQUIRE_LIB_PATH = os.path.join(os.path.dirname(__file__), '..', 'env/lib/python lib_to_insert = [REQUIRE_LIB_PATH] map(lambda path: sys.path.insert(0, path), lib_to_insert) +# settings need to be after insertion of libraries' location +from settings import * + # use cloudsql while on the production if (on_appengine or os.getenv('SETTINGS_MODE') == 'prod'):
fixed ordering of import settings and inserting lib path
natea_django-deployer
train
py
9514a119a35b71a2d49e14b19d14542a201191fb
diff --git a/bugzoo/core/coverage.py b/bugzoo/core/coverage.py index <HASH>..<HASH> 100644 --- a/bugzoo/core/coverage.py +++ b/bugzoo/core/coverage.py @@ -196,3 +196,14 @@ class TestSuiteCoverage(object): within this coverage report. """ return len(self.__test_coverage) + + @property + def lines(self) -> FileLineSet: + """ + Returns the set of all file lines that were covered. + """ + assert len(self) > 0 + output = FileLineSet() + for coverage in self.__test_coverage.values(): + output = output.union(coverage.lines) + return output
feature: added lines property to TestSuiteCoverage
squaresLab_BugZoo
train
py
85893b107b33844b5400d3a7aba70e558c3dfb57
diff --git a/library/Public.php b/library/Public.php index <HASH>..<HASH> 100644 --- a/library/Public.php +++ b/library/Public.php @@ -68,6 +68,17 @@ if (!function_exists('municipio_get_logotype')) { 'negative' => get_field('logotype_negative', 'option') ); + foreach ($logotype as &$logo) { + if (!is_int($logo)) { + continue; + } + + $logoinfo = array(); + $logoinfo['id'] = $logo; + $logoinfo['url'] = wp_get_attachment_url($logoinfo['id']); + $logo = $logoinfo; + } + // Get the symbol to use (blog name or image) $symbol = '<span class="h1 no-margin no-padding">' . $siteName . '</span>';
Get url for logos if only attachment url
helsingborg-stad_Municipio
train
php
6be7b0946ddbf334fe1a1e62a9be6abe149ef4ff
diff --git a/Model/Content.php b/Model/Content.php index <HASH>..<HASH> 100644 --- a/Model/Content.php +++ b/Model/Content.php @@ -167,16 +167,6 @@ class Content implements ContentInterface, EntityInterface, Nestable } /** - * For purpose of entity cloning - */ - public function __clone() - { - if ($this->id) { - $this->setId(null); - }; - } - - /** * Set id * @param integer $id Id of choice * @return integer
_clone removed due to Doctrine's implementation of the same
Opifer_Cms
train
php
86e854186a2d1c69cdacffe1b9ce07bc8c2c703d
diff --git a/WellCommerceAvailabilityBundle.php b/WellCommerceAvailabilityBundle.php index <HASH>..<HASH> 100644 --- a/WellCommerceAvailabilityBundle.php +++ b/WellCommerceAvailabilityBundle.php @@ -12,7 +12,9 @@ namespace WellCommerce\Bundle\AvailabilityBundle; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; +use WellCommerce\Bundle\AvailabilityBundle\DependencyInjection\Compiler; /** * Class WellCommerceAvailabilityBundle @@ -21,4 +23,10 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; */ class WellCommerceAvailabilityBundle extends Bundle { + public function build(ContainerBuilder $container) + { + parent::build($container); + $container->addCompilerPass(new Compiler\AutoRegisterServicesPass()); + $container->addCompilerPass(new Compiler\MappingCompilerPass()); + } }
Added compiler passes to all bundles (cherry picked from commit <I>ebd<I>a7aa0b9c6be3c<I>f<I>a7ce<I>bc<I>f)
WellCommerce_WishlistBundle
train
php
ad94225170240cacaa189992b46afdd8b68d1bba
diff --git a/Shipment/Transformer/ShipmentAddressTransformer.php b/Shipment/Transformer/ShipmentAddressTransformer.php index <HASH>..<HASH> 100644 --- a/Shipment/Transformer/ShipmentAddressTransformer.php +++ b/Shipment/Transformer/ShipmentAddressTransformer.php @@ -32,8 +32,25 @@ class ShipmentAddressTransformer * @var array */ private $fields = [ - 'company', 'gender', 'firstName', 'lastName', 'street', 'supplement', - 'postalCode', 'city', 'country', 'state', 'phone', 'mobile' + 'company', + 'gender', + 'firstName', + 'lastName', + 'street', + 'supplement', + 'complement', + 'extra', + 'postalCode', + 'city', + 'country', + 'state', + 'phone', + 'mobile', + 'digicode1', + 'digicode2', + 'intercom', + 'latitude', + 'longitude', ]; /**
[Commerce] Fixed shipment address transformer (missing fields)
ekyna_Commerce
train
php
0dc80dcbf770083aed9f25df5242f20995e78ce0
diff --git a/tellive/livemessage.py b/tellive/livemessage.py index <HASH>..<HASH> 100644 --- a/tellive/livemessage.py +++ b/tellive/livemessage.py @@ -56,10 +56,17 @@ class LiveMessageToken(object): @staticmethod def deserialize(data): + def _find(data, needle): + needle = ord(needle) + index = 0 + while index < len(data): + if data[index] == needle: + return index + index += 1 + raise ValueError + def deserialize_int(data): - end = data.find(ord('s')) - if end == -1: - raise ValueError + end = _find(data, 's') return (LiveMessageToken(int(data[:end], 16)), data[end + 1:]) def deserialize_list(data): @@ -78,9 +85,7 @@ class LiveMessageToken(object): return (LiveMessageToken(result), data[1:]) def deserialize_string(data, is_base64=False): - end = data.find(ord(':')) - if end == -1: - raise ValueError + end = _find(data, ':') value_end = end + 1 + int(data[:end], 16) value = data[end + 1:value_end] if is_base64: @@ -141,7 +146,7 @@ class LiveMessage(object): def deserialize(data): message = LiveMessage() while data: - (token, data) = LiveMessageToken.deserialize(data) + token, data = LiveMessageToken.deserialize(data) if not token: break message.append(token.value)
Fix problems with python <I>
erijo_tellive-py
train
py
2d3b9a6c591ef14e8c9208a3f049a1630c993d84
diff --git a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java +++ b/src/com/google/javascript/jscomp/AbstractCommandLineRunner.java @@ -730,7 +730,7 @@ abstract class AbstractCommandLineRunner<A extends Compiler, OUTPUT_WRAPPER_MARKER); // Output the source map if requested. - outputSourceMap(options); + outputSourceMap(options, options.jsOutputFile); } else { String moduleFilePrefix = config.moduleOutputPathPrefix; maybeCreateDirsForPath(moduleFilePrefix); @@ -963,7 +963,7 @@ abstract class AbstractCommandLineRunner<A extends Compiler, * * @param options The options to the Compiler. */ - private void outputSourceMap(B options) + private void outputSourceMap(B options, String associatedName) throws IOException { if (Strings.isEmpty(options.sourceMapOutputPath)) { return; @@ -971,7 +971,7 @@ abstract class AbstractCommandLineRunner<A extends Compiler, String outName = expandSourceMapPath(options, null); Writer out = fileNameToOutputWriter(outName); - compiler.getSourceMap().appendTo(out, outName); + compiler.getSourceMap().appendTo(out, associatedName); out.close(); }
Cosmetic change: put the proper name of the associate js file in the source maps when building without modules. R=acleung DELTA=3 (0 added, 0 deleted, 3 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
java
8cb4691e832bedbafa1e2beb18d580e8cb886040
diff --git a/examples/swagger_config_3.py b/examples/swagger_config_3.py index <HASH>..<HASH> 100644 --- a/examples/swagger_config_3.py +++ b/examples/swagger_config_3.py @@ -21,6 +21,16 @@ swagger_config = { } }, }, + "servers": [ + { + "url": "https://api.example.com/v1", + "description": "Production server (uses live data)" + }, + { + "url": "https://sandbox-api.example.com:8443/v1", + "description": "Sandbox server (uses test data)" + } + ], "specs": [ { "endpoint": "swagger", @@ -131,6 +141,8 @@ def test_swag(client, specs_data): assert 'securitySchemes' in spec['components'] assert 'oAuthSample' in spec['components']['securitySchemes'] + assert 'servers' in spec # See issue #366 + if __name__ == '__main__': app.run(debug=True)
Add test case for issue #<I>
rochacbruno_flasgger
train
py
c09489bbda8884bd1496d0c4ed1119fef641f8b8
diff --git a/ospd/ospd.py b/ospd/ospd.py index <HASH>..<HASH> 100644 --- a/ospd/ospd.py +++ b/ospd/ospd.py @@ -1220,10 +1220,7 @@ class OSPDaemon: ) return - if ( - self.min_free_mem_scan_queue - and not self.is_enough_free_memory() - ): + if not self.is_enough_free_memory(): logger.debug( 'Not possible to run a new scan. Not enough free memory.' ) @@ -1262,6 +1259,9 @@ class OSPDaemon: Return: True if there is enough memory for a new scan. """ + if not self.min_free_mem_scan_queue: + return True + free_mem = psutil.virtual_memory().free if (free_mem / (1024 * 1024)) > self.min_free_mem_scan_queue:
Check for min_free_mem_scan_queue inside is_enough_free_memory()
greenbone_ospd
train
py
177ab3a4335c0447f317cd03825b3840ea70579b
diff --git a/actions/class.PropertiesAuthoring.php b/actions/class.PropertiesAuthoring.php index <HASH>..<HASH> 100644 --- a/actions/class.PropertiesAuthoring.php +++ b/actions/class.PropertiesAuthoring.php @@ -561,15 +561,19 @@ class tao_actions_PropertiesAuthoring extends tao_actions_CommonModule FeatureFlagChecker::FEATURE_FLAG_LISTS_DEPENDENCY_ENABLED ); - if ($isListsDependencyEnabled) { - if ($dependsOnPropertyUri === null) { - $property->removePropertyValues( - $this->getProperty(RemoteSourcedListOntology::PROPERTY_DEPENDS_ON_PROPERTY) - ); - } else { - $property->setDependsOnProperty($this->getProperty($dependsOnPropertyUri)); - } + if (!$isListsDependencyEnabled) { + return; } + + if ($dependsOnPropertyUri === null) { + $property->removePropertyValues( + $this->getProperty(RemoteSourcedListOntology::PROPERTY_DEPENDS_ON_PROPERTY) + ); + + return; + } + + $property->setDependsOnProperty($this->getProperty($dependsOnPropertyUri)); } private function isElasticSearchEnabled(): bool
refactor: remove if-statement multilevel
oat-sa_tao-core
train
php
55bf6333af150f6d1504fa7cb467d9a7620b5def
diff --git a/src/Psalm/Internal/Stubs/Generator/StubsGenerator.php b/src/Psalm/Internal/Stubs/Generator/StubsGenerator.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/Stubs/Generator/StubsGenerator.php +++ b/src/Psalm/Internal/Stubs/Generator/StubsGenerator.php @@ -21,7 +21,7 @@ class StubsGenerator $psalm_base = dirname(__DIR__, 5); foreach ($all_class_storage as $storage) { - if (strpos($storage->name, 'Psalm\\')) { + if (\strpos($storage->name, 'Psalm\\') === 0) { continue; }
Fix addition of Psalm classes
vimeo_psalm
train
php
67444ea205ddd077958e4b84901da66fb28cdc75
diff --git a/cirq/study/resolver.py b/cirq/study/resolver.py index <HASH>..<HASH> 100644 --- a/cirq/study/resolver.py +++ b/cirq/study/resolver.py @@ -17,6 +17,7 @@ import numbers from typing import Any, Dict, Iterator, Optional, TYPE_CHECKING, Union, cast import numpy as np import sympy +from sympy.core import numbers as sympy_numbers from cirq._compat import proper_repr from cirq._doc import document @@ -198,9 +199,9 @@ class ParamResolver: def _sympy_pass_through(val: Any) -> Optional[Any]: if isinstance(val, numbers.Number) and not isinstance(val, sympy.Basic): return val - if isinstance(val, sympy.core.numbers.IntegerConstant): + if isinstance(val, sympy_numbers.IntegerConstant): return val.p - if isinstance(val, sympy.core.numbers.RationalConstant): + if isinstance(val, sympy_numbers.RationalConstant): return val.p / val.q if val == sympy.pi: return np.pi
Fixing sympy imports (#<I>) Fixing sympy imports. This fixes breakages on sympy <I>.
quantumlib_Cirq
train
py
f34493733247a0cc72de834ea0b86bedadd5e02a
diff --git a/tests/core/test_drill.py b/tests/core/test_drill.py index <HASH>..<HASH> 100644 --- a/tests/core/test_drill.py +++ b/tests/core/test_drill.py @@ -1,6 +1,12 @@ from aguaclara.core import drills -print("Imperial drill bit diameters: \n" + - repr(drills.DRILL_BITS_D_IMPERIAL) + "\n") -print("Metric drill bit diameters: \n" + - repr(drills.DRILL_BITS_D_METRIC) + "\n") + +def test_drill(): + print( + "Imperial drill bit diameters: \n" + + repr(drills.DRILL_BITS_D_IMPERIAL) + "\n" + ) + print( + "Metric drill bit diameters: \n" + + repr(drills.DRILL_BITS_D_METRIC) + "\n" + )
Put tests.core.test_drill functionality into function test_drill()
AguaClara_aguaclara
train
py
4391a566f0167736666f1d053533d1ab2bd244e3
diff --git a/lib/heroku/command/help.rb b/lib/heroku/command/help.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/command/help.rb +++ b/lib/heroku/command/help.rb @@ -119,7 +119,7 @@ module Heroku::Command unless namespace_commands.empty? size = longest(namespace_commands.map { |c| c[:banner] }) - namespace_commands.sort_by { |c| c[:method] }.each do |command| + namespace_commands.sort_by { |c| c[:method].to_s }.each do |command| next if command[:help] =~ /DEPRECATED/ command[:summary] ||= legacy_help_for_command(command[:command]) puts " %-#{size}s # %s" % [ command[:banner], command[:summary] ]
make sure we're sorting with strings
heroku_legacy-cli
train
rb
48c73a2fea53ee31a3e841aba028ca17948d691f
diff --git a/lib/puppet/pops/types/types.rb b/lib/puppet/pops/types/types.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/pops/types/types.rb +++ b/lib/puppet/pops/types/types.rb @@ -329,4 +329,20 @@ module Puppet::Pops::Types end end + # Represents a type that accept PNilType instead of the type parameter + # required_type - is a short hand for Variant[T, Undef] + # + class POptionalType < PAbstractType + contains_one_uni 'optional_type', PAbstractType + module ClassModule + def hash + [self.class, optional_type].hash + end + + def ==(o) + self.class == o.class && optional_type == o.optional_type + end + end + end + end
(maint) Add Optional Type To be able to more easily deal with undef (not matched by default except by Data) the convenience type Optional is introduced with the same semantics as Variant[T, Undef] (i.e. undef/nil) is accepted instead of real type).
puppetlabs_puppet
train
rb
283492441fe1cde22464e118e4c9ac13b9f25a46
diff --git a/core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java b/core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java +++ b/core/src/main/java/org/owasp/dependencycheck/analyzer/CPEAnalyzer.java @@ -565,7 +565,9 @@ public class CPEAnalyzer extends AbstractAnalyzer { if (boostTerm != null) { sb.append("^").append(weighting + WEIGHTING_BOOST); if (!boostTerm.equals(word)) { - boostedTerms.append(" ").append(boostTerm).append("^").append(weighting + WEIGHTING_BOOST); + boostedTerms.append(" "); + LuceneUtils.appendEscapedLuceneQuery(boostedTerms, boostTerm); + boostedTerms.append("^").append(weighting + WEIGHTING_BOOST); } } else if (weighting > 1) { sb.append("^").append(weighting);
correctly escape boosted terms to resolve #<I>
jeremylong_DependencyCheck
train
java
53bbf5a602ed2c8bb395c945fe3df1470f31a52c
diff --git a/hagelslag/processing/EnhancedWatershedSegmenter.py b/hagelslag/processing/EnhancedWatershedSegmenter.py index <HASH>..<HASH> 100644 --- a/hagelslag/processing/EnhancedWatershedSegmenter.py +++ b/hagelslag/processing/EnhancedWatershedSegmenter.py @@ -277,4 +277,4 @@ def rescale_data(data, data_min, data_max, out_min=0.0, out_max=100.0): Returns: Linearly scaled ndarray """ - return (out_max - out_min) / (data_max - data_min) * (data - data_min) + out_min + return (out_max - out_min) / (data_max - data_min) * (data - data_min) + out_min \ No newline at end of file
removed eol character at end
djgagne_hagelslag
train
py
65e80beb9dd665d598eabcdba5dda5a9e4801ed0
diff --git a/TYPO3.Neos/Resources/Public/JavaScript/neos/content/controller.js b/TYPO3.Neos/Resources/Public/JavaScript/neos/content/controller.js index <HASH>..<HASH> 100644 --- a/TYPO3.Neos/Resources/Public/JavaScript/neos/content/controller.js +++ b/TYPO3.Neos/Resources/Public/JavaScript/neos/content/controller.js @@ -412,6 +412,7 @@ function($, CreateJS, Entity) { }); model.set('typo3:_removed', true); model.save(null); + T3.Content.Model.NodeSelection.updateSelection(); } }, $handle); },
[BUGFIX] Clear inspector after deleting an element Change-Id: I<I>e<I>be9cc<I>a9e<I>ee<I>e<I>e<I>eec3a Original-Commit-Hash: d<I>e<I>e<I>da5bc<I>d6a<I>bac0b<I>e7be7dbf
neos_neos-development-collection
train
js
e2d833c3d592aa1c729b29b59298ff7569d1a594
diff --git a/alphafilter/templatetags/alphafilter.py b/alphafilter/templatetags/alphafilter.py index <HASH>..<HASH> 100644 --- a/alphafilter/templatetags/alphafilter.py +++ b/alphafilter/templatetags/alphafilter.py @@ -113,6 +113,10 @@ class AlphabetFilterNode(Node): qstring_items = request.GET.copy() if alpha_field in qstring_items: qstring_items.pop(alpha_field) + # Don't extend pagination to new alphafilters, it should start + # always from the beginning + if 'page' in qstring_items: + qstring_items.pop('page') qstring = "&amp;".join(["%s=%s" % (k, v) for k, v in qstring_items.iteritems()]) else: alpha_lookup = ''
Don't extend pagination to new alphafilters, it should start always from the beginning
coordt_django-alphabetfilter
train
py
339105c945ef94f3c509b168cf7bede4397027ce
diff --git a/test/DICTest.php b/test/DICTest.php index <HASH>..<HASH> 100644 --- a/test/DICTest.php +++ b/test/DICTest.php @@ -13,8 +13,8 @@ use justso\justapi\Bootstrap; use justso\justapi\DependencyContainer; use justso\justapi\testutil\FileSystemSandbox; -require (dirname(__DIR__) . '/testutil/MockClass.php'); -require (dirname(__DIR__) . '/testutil/MockClass2.php'); +require_once(dirname(__DIR__) . '/testutil/MockClass.php'); +require_once(dirname(__DIR__) . '/testutil/MockClass2.php'); /** * Class DICTest
Make sure that Mock classes are included only once.
JustsoSoftware_JustAPI
train
php
3f55d82bf70b89f3de3fcf4e3cd63b6c8e3ff844
diff --git a/test/common.js b/test/common.js index <HASH>..<HASH> 100644 --- a/test/common.js +++ b/test/common.js @@ -91,6 +91,13 @@ HTTPClient.prototype.request = function (path, opts, fn) { */ HTTPClient.prototype.end = function () { + // node <v0.5 compat + if (this.agent.sockets.forEach) { + this.agent.sockets.forEach(function (socket) { + if (socket.end) socket.end(); + }); + } + // node >=v0.5 compat var self = this; Object.keys(this.agent.sockets).forEach(function (socket) { for (var i = 0, l = self.agent.sockets[socket].length; i < l; ++i) {
added node v4 client closing compatibility
socketio_socket.io
train
js
0b16dc6779b7c0423b3933ffd8a6d5cf3f1590ae
diff --git a/lib/rules/parameters/attribute.rb b/lib/rules/parameters/attribute.rb index <HASH>..<HASH> 100644 --- a/lib/rules/parameters/attribute.rb +++ b/lib/rules/parameters/attribute.rb @@ -1,33 +1,17 @@ module Rules::Parameters class Attribute - attr_reader :context, :method_chain + attr_reader :attribute def initialize(options = {}) - @method_chain = options[:attributes] || Array.wrap(options[:attribute]) - @context = options[:context] - raise 'Attribute parameters must define a context and attributes' unless @context && @method_chain + @attribute = options[:attribute] end def evaluate(context = {}) - raise 'Must specify an attribute to evaluate on the object' if @method_chain.blank? - object = context[@context] - raise 'Invalid context given' unless object - @method_chain.each do |method| - raise 'Object does not respond to method' unless object.respond_to?(method.to_sym) - object = object.send(method.to_sym) - end - object + context[@attribute] end def cast raise NotImplementedError end - - def as_json(options = nil) - { - context: context, - method_chain: method_chain - } - end end end
Remove attribute functionality in prep for model changes
azach_rules
train
rb
f82277c2e28014a1b59403eb0e36aa21e468c7d9
diff --git a/lib/db-opener.js b/lib/db-opener.js index <HASH>..<HASH> 100644 --- a/lib/db-opener.js +++ b/lib/db-opener.js @@ -62,7 +62,9 @@ module.exports = function (db) { stream.once('end' , onReady) emitter.once('dispose', function () { - stream.destroy() + //levelup/read-stream throws if the stream has already ended + //but it's just a user error, not a serious problem. + try { stream.destroy() } catch (_) { } }) //write the update twice,
ignore if levelup/read-stream throws becasue we called stream.destroy() twice
dominictarr_level-scuttlebutt
train
js
417e4f905cf3f21080a465e601139b8ce272aa30
diff --git a/lib/jss/version.rb b/lib/jss/version.rb index <HASH>..<HASH> 100644 --- a/lib/jss/version.rb +++ b/lib/jss/version.rb @@ -27,6 +27,6 @@ module JSS ### The version of the JSS ruby gem - VERSION = '1.0.5b2'.freeze + VERSION = '1.1.0b1'.freeze end # module
Bump According to Semantic Versioning, bump the minor version for compatible additions, - so we're at <I>. The patch gets bumped when the only changes are compatible fixes
PixarAnimationStudios_ruby-jss
train
rb
d3137524307e73123a4b9eb28fef240a883ff92e
diff --git a/jmx/src/main/java/org/jboss/as/jmx/JmxMessages.java b/jmx/src/main/java/org/jboss/as/jmx/JmxMessages.java index <HASH>..<HASH> 100644 --- a/jmx/src/main/java/org/jboss/as/jmx/JmxMessages.java +++ b/jmx/src/main/java/org/jboss/as/jmx/JmxMessages.java @@ -390,7 +390,7 @@ public interface JmxMessages { @Message(id = 11361, value = "Not authorized to write attribute: '%s'") JMRuntimeException notAuthorizedToWriteAttribute(String attributeName); - @Message(id = 11362, value = "Not authorized to write attribute: '%s'") + @Message(id = 11362, value = "Not authorized to read attribute: '%s'") JMRuntimeException notAuthorizedToReadAttribute(String attributeName); @Message(id = 11363, value = "Not authorized to invoke operation: '%s'")
[WFLY-<I>] [WFLY-<I>] fix some test failures; note that there are still failures was: cfa8eba2d2d6b3d<I>b2e<I>a1f<I>bf<I>ebc<I>
wildfly_wildfly-core
train
java
333bb702ed3e776fd2be9ddd84cc72c1d04ee31c
diff --git a/extensions/suspend/bootstrap.php b/extensions/suspend/bootstrap.php index <HASH>..<HASH> 100644 --- a/extensions/suspend/bootstrap.php +++ b/extensions/suspend/bootstrap.php @@ -16,10 +16,12 @@ use Illuminate\Contracts\Events\Dispatcher; return [ (new Extend\Assets('forum')) - ->defaultAssets(__DIR__) + ->asset(__DIR__.'/js/forum/dist/extension.js') + ->asset(__DIR__.'/less/forum/extension.less') ->bootstrapper('flarum/suspend/main'), (new Extend\Assets('admin')) - ->defaultAssets(__DIR__) + ->asset(__DIR__.'/js/admin/dist/extension.js') + ->asset(__DIR__.'/less/admin/extension.less') ->bootstrapper('flarum/suspend/main'), function (Dispatcher $events) { $events->subscribe(Listener\AddUserSuspendAttributes::class);
Extender: List all assets explicitly
flarum_core
train
php
f878e0117916a2f65de4d2a1ba3e0758b6f9b1b9
diff --git a/lib/http_monkey/version.rb b/lib/http_monkey/version.rb index <HASH>..<HASH> 100644 --- a/lib/http_monkey/version.rb +++ b/lib/http_monkey/version.rb @@ -1,3 +1,3 @@ module HttpMonkey - VERSION = "0.0.3" + VERSION = "0.0.4pre" end
Bumping version to <I>pre
rogerleite_http_monkey
train
rb
bdb41571d674e9e15f13dba99d90679ca12f6b7e
diff --git a/tests/unit/traits/IssetInvokerTraitTest.php b/tests/unit/traits/IssetInvokerTraitTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/traits/IssetInvokerTraitTest.php +++ b/tests/unit/traits/IssetInvokerTraitTest.php @@ -67,6 +67,8 @@ class IssetInvokerTraitTest extends \Codeception\TestCase\Test /** * Dummy class for given trait + * + * @property string $name */ class IssetDummy { diff --git a/tests/unit/traits/UnsetInvokerTraitTest.php b/tests/unit/traits/UnsetInvokerTraitTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/traits/UnsetInvokerTraitTest.php +++ b/tests/unit/traits/UnsetInvokerTraitTest.php @@ -59,6 +59,8 @@ class UnsetInvokerTraitTest extends \Codeception\TestCase\Test /** * Dummy class that uses given trait + * + * @property string $name */ class UnsetDummy {
PHPDoc added for inaccessible properties on dummy classes
aedart_overload
train
php,php
ab37529592d31ac700e3d5e013f7cad63178f48c
diff --git a/src/Connections/Ldap.php b/src/Connections/Ldap.php index <HASH>..<HASH> 100644 --- a/src/Connections/Ldap.php +++ b/src/Connections/Ldap.php @@ -238,14 +238,6 @@ class Ldap implements ConnectionInterface /** * {@inheritdoc} */ - public function sort($result, $attribute) - { - return ldap_sort($this->getConnection(), $result, $attribute); - } - - /** - * {@inheritdoc} - */ public function bind($username, $password, $sasl = false) { if ($this->isUsingTLS()) { diff --git a/src/Contracts/Connections/ConnectionInterface.php b/src/Contracts/Connections/ConnectionInterface.php index <HASH>..<HASH> 100644 --- a/src/Contracts/Connections/ConnectionInterface.php +++ b/src/Contracts/Connections/ConnectionInterface.php @@ -297,16 +297,6 @@ interface ConnectionInterface public function listing($dn, $filter, array $attributes); /** - * Sorts an AD search result by the specified attribute. - * - * @param resource $result - * @param string $attribute - * - * @return bool - */ - public function sort($result, $attribute); - - /** * Adds an entry to the current connection. * * @param string $dn
Removed depreciated ldap sort method.
Adldap2_Adldap2
train
php,php
4ce8172a2e11f05ea83236b81465dfb4ac03e165
diff --git a/src/test/java/airbrake/BacktraceLineTest.java b/src/test/java/airbrake/BacktraceLineTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/airbrake/BacktraceLineTest.java +++ b/src/test/java/airbrake/BacktraceLineTest.java @@ -28,7 +28,7 @@ public class BacktraceLineTest { backtraceLine.toXml()); } - @Test + @Test @Ignore public void testEscapeSpecialCharsInXml() { BacktraceLine backtraceLine = new BacktraceLine("at com.company.Foo$$FastClassByCGLIB$$b505b4f2.invoke(<generated'\">:-1)"); assertEquals("<line method=\"com.company.Foo$$FastClassByCGLIB$$b505b4f2.invoke\" file=\"&lt;generated&apos;&quot;&gt;\" number=\"-1\"/>",
update README with new groupId io.airbrake; removed test about special characters in xml attributes, we need to cleanup this in different way
airbrake_airbrake-java
train
java
c0f69816a187aa6f7277cf813c1e5ff22fe34574
diff --git a/lib/accounting/booking.rb b/lib/accounting/booking.rb index <HASH>..<HASH> 100644 --- a/lib/accounting/booking.rb +++ b/lib/accounting/booking.rb @@ -1,5 +1,7 @@ module Accounting class Booking < ActiveRecord::Base + validates_presence_of :debit_account, :credit_account, :amount, :value_date + belongs_to :debit_account, :foreign_key => 'debit_account_id', :class_name => "Account" belongs_to :credit_account, :foreign_key => 'credit_account_id', :class_name => "Account"
Validate some booking fields on presence.
huerlisi_has_accounts
train
rb
3abc89b9e7c0d5749ce2894a685d35fba23d470b
diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaHealthCheckHandler.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaHealthCheckHandler.java index <HASH>..<HASH> 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaHealthCheckHandler.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaHealthCheckHandler.java @@ -100,7 +100,7 @@ public class EurekaHealthCheckHandler implements HealthCheckHandler, Application } protected InstanceStatus getHealthStatus() { - final Status status = healthIndicator.health().getStatus(); + final Status status = getHealthIndicator().health().getStatus(); return mapToInstanceStatus(status); } @@ -110,4 +110,8 @@ public class EurekaHealthCheckHandler implements HealthCheckHandler, Application } return STATUS_MAPPING.get(status); } + + protected CompositeHealthIndicator getHealthIndicator() { + return healthIndicator; + } }
EurekaHealthCheckHandler: Added protected getter to obtain CompositeHealthIndicator (#<I>) * Adding protected getter to obtain CompositeHealthIndicator. This allows subclasses to obtain this indicator's health details map which is useful for error reporting.
spring-cloud_spring-cloud-netflix
train
java
e397d7c9a5b4a36877c3dd1f46619f8075499c09
diff --git a/src/Client/ResponseTrait.php b/src/Client/ResponseTrait.php index <HASH>..<HASH> 100644 --- a/src/Client/ResponseTrait.php +++ b/src/Client/ResponseTrait.php @@ -28,17 +28,17 @@ trait ResponseTrait case 400: case 405: $returnArray = json_decode($body, true); - throw new ApiSyntaxException($this->getFirstError($returnArray)); + throw new ApiSyntaxException($this->getFirstError($returnArray), $status); case 401: case 403: $returnArray = json_decode($body, true); - throw new ApiAuthenticationException($this->getFirstError($returnArray, 'Invalid credentials')); + throw new ApiAuthenticationException($this->getFirstError($returnArray, 'Invalid credentials'), $status); case 410: case 404: - throw new ApiNotFoundException($url); + throw new ApiNotFoundException($url, $status); default: $returnArray = json_decode($body, true); - throw new ApiGeneralException($this->generalExceptionMessage($returnArray ?? [], $headers)); + throw new ApiGeneralException($this->generalExceptionMessage($returnArray ?? [], $headers), $status); } }
fix: include status codes in exceptions
bookboon_api-php
train
php
f12e077425daeaa8d84ac39ec893b063c1e15a4c
diff --git a/misc.go b/misc.go index <HASH>..<HASH> 100644 --- a/misc.go +++ b/misc.go @@ -57,3 +57,10 @@ func randIntRange(min, max int) int { } return rand.Intn((max+1)-min) + min } + +func randFloatRange(min, max float64) float64 { + if min == max { + return min + } + return rand.Float64()*(max-min) + min +} diff --git a/misc_test.go b/misc_test.go index <HASH>..<HASH> 100644 --- a/misc_test.go +++ b/misc_test.go @@ -13,3 +13,9 @@ func TestGetRandValueFail(t *testing.T) { t.Error("You should have gotten no value back") } } + +func TestRandFloatRangeSame(t *testing.T) { + if randFloatRange(5.0, 5.0) != 5.0 { + t.Error("You should have gotten 5.0 back") + } +}
misc - added float range
brianvoe_gofakeit
train
go,go
76e9f93ed54f82056bdaa0bb6435ff73fe349368
diff --git a/helpers.php b/helpers.php index <HASH>..<HASH> 100644 --- a/helpers.php +++ b/helpers.php @@ -3,7 +3,7 @@ if (!function_exists('encode')) { function encode(array $body) { - $json = utf8_encode(json_encode($body, JSON_UNESCAPED_SLASHES)); + $json = json_encode($body, JSON_UNESCAPED_SLASHES); return $json; } diff --git a/src/JSONClient.php b/src/JSONClient.php index <HASH>..<HASH> 100644 --- a/src/JSONClient.php +++ b/src/JSONClient.php @@ -16,7 +16,7 @@ use GuzzleHttp\Exception\BadResponseException; class JSONClient { - protected static $version = '0.0.8'; + protected static $version = '0.0.9'; /** * Holds the root Guzzle client we work on top of.
We do not specifically utf8 encode strings anymore
Duffleman_json-client
train
php,php
b903f1ff6f5f112ab20f1ec7e4aee3a11c16fe13
diff --git a/applications/default/extensions/form/form.js b/applications/default/extensions/form/form.js index <HASH>..<HASH> 100644 --- a/applications/default/extensions/form/form.js +++ b/applications/default/extensions/form/form.js @@ -89,6 +89,12 @@ form.form = function(forms, callback) { if (fieldSettings.internal) { return next(); } + // By pass not 'inline' fields with 'via' set. + // @todo: eventually we may want to edit this kind of fields when editing + // the main item too. + if (fieldSettings.type == 'reference' && 'reference' in fieldSettings && 'via' in fieldSettings.reference) { + return next(); + } var element = { name: fieldName, title: fieldSettings.title || null, diff --git a/lib/storage.js b/lib/storage.js index <HASH>..<HASH> 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -177,6 +177,13 @@ Storage.prototype.processReferenceField = function(schema, settings, fieldName, required: fieldSettings.required }; } + else if (fieldSettings.reference.via) { + schema.attributes[fieldName] = { + type: fieldSettings.reference.multiple ? 'collection' : 'model', + via: fieldSettings.reference.via, + required: fieldSettings.required + }; + } else { if (fieldSettings.reference.multiple) { var attribute = schema.attributes[fieldName] = {
Adding one-to-may relationship for non embedded documents via the 'via' property in waterline. Now all fields that set a 'via' property on reference settings for a reference field, will tell this is an external one-to-many association.
recidive_choko
train
js,js
1cd7e79eee016426b8086d54864ce4d8bae8787c
diff --git a/client_side_validations.gemspec b/client_side_validations.gemspec index <HASH>..<HASH> 100644 --- a/client_side_validations.gemspec +++ b/client_side_validations.gemspec @@ -1,4 +1,3 @@ -# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'client_side_validations/version' diff --git a/test/action_view/cases/test_helpers.rb b/test/action_view/cases/test_helpers.rb index <HASH>..<HASH> 100644 --- a/test/action_view/cases/test_helpers.rb +++ b/test/action_view/cases/test_helpers.rb @@ -1,5 +1,3 @@ -# coding: utf-8 - require 'action_view/cases/helper' module ClientSideValidations diff --git a/test/action_view/models/format_thing.rb b/test/action_view/models/format_thing.rb index <HASH>..<HASH> 100644 --- a/test/action_view/models/format_thing.rb +++ b/test/action_view/models/format_thing.rb @@ -1,5 +1,3 @@ -# coding: utf-8 - class FormatThing extend ActiveModel::Naming extend ActiveModel::Translation
Remove encoding magic comments UTF-8 is the default Ruby <I> encoding and we only support Ruby >= <I>
DavyJonesLocker_client_side_validations
train
gemspec,rb,rb
cf873f59f686bfe50c2e240e4ff5f3c4ac1556b6
diff --git a/p2p/net/swarm/testing/testing.go b/p2p/net/swarm/testing/testing.go index <HASH>..<HASH> 100644 --- a/p2p/net/swarm/testing/testing.go +++ b/p2p/net/swarm/testing/testing.go @@ -11,10 +11,10 @@ import ( pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" secio "github.com/libp2p/go-libp2p-secio" tptu "github.com/libp2p/go-libp2p-transport-upgrader" + yamux "github.com/libp2p/go-libp2p-yamux" + msmux "github.com/libp2p/go-stream-muxer-multistream" tcp "github.com/libp2p/go-tcp-transport" tu "github.com/libp2p/go-testutil" - msmux "github.com/whyrusleeping/go-smux-multistream" - yamux "github.com/whyrusleeping/go-smux-yamux" swarm "github.com/libp2p/go-libp2p-swarm" )
dep: import go-smux-* into the libp2p org
libp2p_go-libp2p
train
go
9e960f1a8b9ede4233d3e7c2efc2cda6a742c69f
diff --git a/test/functional/ft_20_storage_participant.rb b/test/functional/ft_20_storage_participant.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_20_storage_participant.rb +++ b/test/functional/ft_20_storage_participant.rb @@ -195,6 +195,29 @@ class FtStorageParticipantTest < Test::Unit::TestCase 2, @part.query('place' => 'heiankyou', :participant => 'alpha').size) end + # Issue reported in + # http://groups.google.com/group/openwferu-users/browse_thread/thread/d0557c58f8636c9 + # + def test_query_and_limit + + n = 7 + + n.times do |i| + @engine.storage.put( + 'type' => 'workitems', + '_id' => "0_#{i}!ffffff!20101219-yamamba", + 'participant_name' => 'alpha', + 'wfid' => '20101219-yamamba', + 'fields' => {}) + end + + sp = @engine.storage_participant + + assert_equal n, sp.query({}).size + assert_equal n, sp.query(:offset => 0, :limit => 100).size + assert_equal n, sp.query(:skip => 0, :limit => 100).size + end + def test_initialize_engine_then_opts @engine.register_participant :alpha, Ruote::StorageParticipant
added test for query_workitems with :skip (Thanks Eric Smith)
jmettraux_ruote
train
rb
dd3dd9f1b1ed27d0663949365e67d9e1a5c5dd71
diff --git a/src/Validate/Test.php b/src/Validate/Test.php index <HASH>..<HASH> 100644 --- a/src/Validate/Test.php +++ b/src/Validate/Test.php @@ -4,8 +4,6 @@ namespace Formulaic\Validate; trait Test { - private $tests = []; - public function addTest($name, callable $fn) { $this->tests[$name] = function ($value) use ($name, $fn) {
this can go here (i guess...)
monolyth-php_formulaic
train
php
d3e58e1356d507452d4f995bce2f3f01e35a2f45
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -163,18 +163,24 @@ if any(s in cmdline for s in ['clean', 'sdist']): print('removing', egg_info) shutil.rmtree(egg_info, ignore_errors=True) -try: - from Cython.Build import cythonize -except ImportError: +pyx_path = '_lensfun.pyx' +c_path = '_lensfun.c' +if not os.path.exists(pyx_path): + # we are running from a source dist which doesn't include the .pyx use_cython = False else: - use_cython = True + try: + from Cython.Build import cythonize + except ImportError: + use_cython = False + else: + use_cython = True -ext = '.pyx' if use_cython else '.c' +source_path = pyx_path if use_cython else c_path extensions = [Extension("lensfunpy._lensfun", include_dirs=include_dirs, - sources=['_lensfun' + ext], + sources=[source_path], libraries=libraries, library_dirs=library_dirs, extra_compile_args=extra_compile_args,
fix Linux install from sdist when cython is also available
letmaik_lensfunpy
train
py
25f647d67abb4c0ea6ef161f58ed6eab4107a22c
diff --git a/lib/backend/receiver.js b/lib/backend/receiver.js index <HASH>..<HASH> 100644 --- a/lib/backend/receiver.js +++ b/lib/backend/receiver.js @@ -1,4 +1,5 @@ var debug = require('../debug'); +var util = require('util'); var net = require('net'); var EventEmitter = require('events').EventEmitter; var msgpack = require('msgpack'); @@ -8,7 +9,7 @@ function MsgPackReceiver(port) { this._init(); } -MsgPackReceiver.prototype = Object.create(EventEmitter.prototype); +util.inherits(MsgPackReceiver, EventEmitter); MsgPackReceiver.prototype._init = function() { this._id = Date.now(); @@ -66,7 +67,7 @@ function FluentReceiver(port) { MsgPackReceiver.apply(this, arguments); } -FluentReceiver.prototype = Object.create(MsgPackReceiver.prototype); +util.inherits(FluentReceiver, MsgPackReceiver); FluentReceiver.prototype._onMessageReceive = function(packet) { MsgPackReceiver.prototype._onMessageReceive.call(this, packet);
receiver: use util.inherits to inheritance
droonga_express-droonga
train
js
43eebe577ddb7e9a5cfbea45fc0617cd839f20a8
diff --git a/tests/specs/blocked-events.js b/tests/specs/blocked-events.js index <HASH>..<HASH> 100644 --- a/tests/specs/blocked-events.js +++ b/tests/specs/blocked-events.js @@ -102,12 +102,15 @@ it('should receive blocked events (on database delete) and be able to resume after unblocking', function (done) { // We do not close the prior beforeEach connection, so a blocking error is expected var spec = this; + var caught = false; db.delete(dbName).catch(function (err) { expect(err.oldVersion).toEqual(initialVersion); // Problem in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=1220279 expect(err.newVersion).toEqual(null); spec.server.close(); // Ensure the last connection is closed so we can resume + caught = true; return err.resume; }).then(function (ev) { // Successful deletion so no FF bug here + expect(caught).toBe(true); expect(ev.oldVersion).toEqual(initialVersion); expect(ev.newVersion).toEqual(null); done();
Blocking test: Ensure operation blocking delete passes through catch condition
aaronpowell_db.js
train
js
bae820b3dcbe1cb7059aff7d06dcf0f186338619
diff --git a/deltas/about.py b/deltas/about.py index <HASH>..<HASH> 100644 --- a/deltas/about.py +++ b/deltas/about.py @@ -1,5 +1,5 @@ __name__ = "deltas" -__version__ = "0.4.5" +__version__ = "0.4.6" __author__ = "Aaron Halfaker" __author_email__ = "aaron.halfaker@gmail.com" __description__ = "An experimental diff library for generating " + \
Increments version to <I>
halfak_deltas
train
py
e07cee0b46697c3733de8e4e00392056ebc2ab55
diff --git a/tests/system/Database/Live/DbUtilsTest.php b/tests/system/Database/Live/DbUtilsTest.php index <HASH>..<HASH> 100644 --- a/tests/system/Database/Live/DbUtilsTest.php +++ b/tests/system/Database/Live/DbUtilsTest.php @@ -92,7 +92,7 @@ final class DbUtilsTest extends CIUnitTestCase { $util = (new Database())->loadUtils($this->db); - if (in_array($this->db->DBDriver, ['MySQLi', 'Postgre', 'SQLSRV'], true)) { + if (in_array($this->db->DBDriver, ['MySQLi', 'Postgre', 'SQLSRV', 'OCI8'], true)) { $exist = $util->databaseExists($this->db->getDatabase()); $this->assertTrue($exist);
test: add databaseExists test for oci8.
codeigniter4_CodeIgniter4
train
php
7d3ba34a582b8c3da5a17d06b1877fcea2b33273
diff --git a/lib/twitter/core_ext/enumerable.rb b/lib/twitter/core_ext/enumerable.rb index <HASH>..<HASH> 100644 --- a/lib/twitter/core_ext/enumerable.rb +++ b/lib/twitter/core_ext/enumerable.rb @@ -1,15 +1,23 @@ module Enumerable def threaded_map + abort_on_exception do + threads = [] + each do |object| + threads << Thread.new { yield object } + end + threads.map(&:value) + end + end + + private + + def abort_on_exception initial_abort_on_exception = Thread.abort_on_exception Thread.abort_on_exception ||= true - threads = [] - each do |object| - threads << Thread.new { yield object } - end - values = threads.map(&:value) + value = yield Thread.abort_on_exception = initial_abort_on_exception - values + value end end
Refactor abort_on_exception into a block
sferik_twitter
train
rb
c50af89d9c5311a0631345b93742849148b80f47
diff --git a/commands.py b/commands.py index <HASH>..<HASH> 100644 --- a/commands.py +++ b/commands.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # This file is part of Invenio. -# Copyright (C) 2012, 2013, 2014 CERN. +# Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -56,6 +56,8 @@ from invenio.modules.upgrader.api import op from invenio.utils.text import wait_for_user %(imports)s +# Important: Below is only a best guess. You MUST validate which previous +# upgrade you depend on. depends_on = %(depends_on)s
upgrader: documentation improvement * BETTER Clarifies that the upgrade dependency is only a best guess. (closes #<I>)
inveniosoftware-attic_invenio-upgrader
train
py
20ebbbd03e4f6966b5a679c4736e08ddb712c811
diff --git a/sawtooth_battleship/txn_family.py b/sawtooth_battleship/txn_family.py index <HASH>..<HASH> 100644 --- a/sawtooth_battleship/txn_family.py +++ b/sawtooth_battleship/txn_family.py @@ -150,12 +150,17 @@ class BattleshipTransaction(transaction.Transaction): LOGGER.error("in check_valid, CREATE is not fully implemented") elif self._action == 'JOIN': - # TODO: Check that the game can be joined (the state is 'NEW') # Check that self._name is in the store (to verify # that the game exists (see FIRE below). + state = store[self._name]['State'] + LOGGER.info("state: %s" % state) if self._name not in store: raise BattleshipException('Trying to join a game that does not exist') + elif (state != "NEW"): + # Check that the game can be joined (the state is 'NEW') + raise BattleshipException('The game cannot accept any new participant') + # TODO: Validate that self._board is a valid board (right size, # right content.
Check that the game can be joined (the state is 'NEW')
hyperledger_sawtooth-core
train
py
665860281d1e14125ff0ed21385ecf99481d5e5d
diff --git a/lib/consul/controller.rb b/lib/consul/controller.rb index <HASH>..<HASH> 100644 --- a/lib/consul/controller.rb +++ b/lib/consul/controller.rb @@ -5,11 +5,7 @@ module Consul base.send :include, InstanceMethods base.send :extend, ClassMethods if ensure_power_initializer_present? - if Rails.version.to_i < 4 - base.before_filter :ensure_power_initializer_present - else - base.before_action :ensure_power_initializer_present - end + Util.before_action(base, :ensure_power_initializer_present) end end
Move one more version switch to Util
makandra_consul
train
rb
cf769e72308cbf92952ee4c0dac926a3895722b4
diff --git a/python_modules/dagster-graphql/dagster_graphql/schema/config_types.py b/python_modules/dagster-graphql/dagster_graphql/schema/config_types.py index <HASH>..<HASH> 100644 --- a/python_modules/dagster-graphql/dagster_graphql/schema/config_types.py +++ b/python_modules/dagster-graphql/dagster_graphql/schema/config_types.py @@ -302,7 +302,7 @@ class DauphinConfigTypeField(dauphin.ObjectType): is_optional = dauphin.NonNull(dauphin.Boolean) def resolve_config_type_key(self, _): - return self._field.config_type.key + return self._field_meta.type_key def __init__(self, field_meta, config_schema_snapshot): check.inst_param(field_meta, 'field_meta', ConfigFieldMeta)
Fix master because of uncovered GraphQL Summary: I made a booboo and forgot to load dagit after one change and paid for it. This codepath is apparently uncovered by BK tests. Test Plan: Load dagit. No errors Reviewers: nate Reviewed By: nate Differential Revision: <URL>
dagster-io_dagster
train
py
44c4464d2aedfc5942a72a477132b9337464d17a
diff --git a/Bridge/Symfony/Validator/Constraints/ShipmentItemValidator.php b/Bridge/Symfony/Validator/Constraints/ShipmentItemValidator.php index <HASH>..<HASH> 100644 --- a/Bridge/Symfony/Validator/Constraints/ShipmentItemValidator.php +++ b/Bridge/Symfony/Validator/Constraints/ShipmentItemValidator.php @@ -52,7 +52,9 @@ class ShipmentItemValidator extends ConstraintValidator $saleItem = $item->getSaleItem(); if ($saleItem->isPrivate()) { // TODO use packaging format - if (0 !== bccomp(fmod((float)$item->getQuantity(), (float)$saleItem->getQuantity()), 0, 5)) { + $iQty = round(5 * (float)$item->getQuantity()); + $siQty = round(5 * (float)$saleItem->getQuantity()); + if (0 !== $iQty % $siQty) { $this ->context ->buildViolation($constraint->quantity_must_be_multiple_of_parent, [
[Commerce] Fixed shipment item validator.
ekyna_Commerce
train
php
35b9b646c03caaf2f75a5d1bf16972b4c3618210
diff --git a/Command/ListOrphanImagesCommand.php b/Command/ListOrphanImagesCommand.php index <HASH>..<HASH> 100644 --- a/Command/ListOrphanImagesCommand.php +++ b/Command/ListOrphanImagesCommand.php @@ -121,12 +121,16 @@ class ListOrphanImagesCommand extends Command $filesystemOrphans[$pathname] = $pathname; } } - foreach ($databaseOrphans as $pathname) { - $io->writeln(sprintf('Image "%s" exists in database but not in filesystem.', $pathname)); - } - foreach ($filesystemOrphans as $pathname) { - $io->writeln(sprintf('Image "%s" exists in filesystem but not in database.', $pathname)); - } + + $io->title('In database but not in filesystem'); + $io->table(['Pathname'], array_map(function (string $pathname): array { + return [$pathname]; + }, $databaseOrphans)); + + $io->title('In filesystem but not in database'); + $io->table(['Pathname'], array_map(function (string $pathname): array { + return [$pathname]; + }, $filesystemOrphans)); return 0; }
Refactor list orphans command.
DarvinStudio_DarvinImageBundle
train
php
bbbd779282a4b06103fa237b460c2982764f20d7
diff --git a/lib/svtplay_dl/service/__init__.py b/lib/svtplay_dl/service/__init__.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/service/__init__.py +++ b/lib/svtplay_dl/service/__init__.py @@ -51,9 +51,10 @@ class Service(object): pass def exclude(self, options): - for i in options.exclude: - if i in options.output: - return True + if options.exclude: + for i in options.exclude: + if i in options.output: + return True return False # the options parameter is unused, but is part of the
service.exclude: check options.exclude is not empty
spaam_svtplay-dl
train
py
fa12e66f975537227beee4b3f26159d77f1b30e8
diff --git a/lib/extractors.js b/lib/extractors.js index <HASH>..<HASH> 100644 --- a/lib/extractors.js +++ b/lib/extractors.js @@ -10,7 +10,7 @@ var cache = {}; // correctly queue up file extractions for after their path has been created, // avoid trying to create the path twice and still be async. var mkdir = function (dir) { - dir = path.normalize(dir + path.sep); + dir = path.normalize(path.resolve(process.cwd(), dir) + path.sep); if (!cache[dir]) { var parent;
New mkdir method needs to work with relative paths too
bower_decompress-zip
train
js
5334a0f24c7a785126c9c7129dd543fcdee311c0
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,7 @@ import sys, os sys.path.append(os.path.dirname(__file__)) sys.path.append(os.path.dirname(os.path.dirname(__file__))) sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) -sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))) +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))) print '\n'.join(sys.path) import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
Added path for docs again
theiviaxx_Frog
train
py
e913e41503e924db8bedc2bb0bfc3c2f96bfb589
diff --git a/resources/lang/pt-PT/cachet.php b/resources/lang/pt-PT/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/pt-PT/cachet.php +++ b/resources/lang/pt-PT/cachet.php @@ -75,10 +75,11 @@ return [ // Subscriber 'subscriber' => [ - 'subscribe' => 'Inscreva-se para obter as atualizações mais recentes', - 'unsubscribe' => 'Subscrição cancelada em :link', - 'button' => 'Subscrever', - 'manage' => [ + 'subscribe' => 'Inscreva-se para obter as atualizações mais recentes', + 'unsubscribe' => 'Unsubscribe', + 'button' => 'Subscrever', + 'manage_subscription' => 'Manage subscription', + 'manage' => [ 'no_subscriptions' => 'Actualmente está subscrito para todas as actualizações.', 'my_subscriptions' => 'Actualmente está subscrito para as seguintes actualizações.', 'manage_at_link' => 'Edite as suas subscrições aqui :link',
New translations cachet.php (Portuguese)
CachetHQ_Cachet
train
php
fcd1ac13a6404ecb281f1d127ce0c1d69dff1e4a
diff --git a/test/com/opera/core/systems/OperaDriverTestRunner.java b/test/com/opera/core/systems/OperaDriverTestRunner.java index <HASH>..<HASH> 100644 --- a/test/com/opera/core/systems/OperaDriverTestRunner.java +++ b/test/com/opera/core/systems/OperaDriverTestRunner.java @@ -90,7 +90,7 @@ public class OperaDriverTestRunner extends BlockJUnit4ClassRunner { for (OperaProduct product : ignoreAnnotation.products()) { if (product.is(OperaProduct.ALL)) { - return false; + break; } else if (product.is(OperaDriverTestCase.currentProduct)) { return true; } @@ -98,7 +98,7 @@ public class OperaDriverTestRunner extends BlockJUnit4ClassRunner { for (Platform platform : ignoreAnnotation.platforms()) { if (platform.is(Platform.ANY)) { - return false; + break; //} else if (OperaDriverTestCase.currentPlatform.is(platform)) { } else if (platform.is(OperaDriverTestCase.currentPlatform)) { return true;
Returning means we'll miss platform check
operasoftware_operaprestodriver
train
java
94c5e59863b93ac12d49bf1ec4f62691d7c2ef49
diff --git a/janome/__init__.py b/janome/__init__.py index <HASH>..<HASH> 100644 --- a/janome/__init__.py +++ b/janome/__init__.py @@ -0,0 +1,5 @@ +from janome.version import JANOME_VERSION as __version__ + +__all__ = [ + "__version__", +]
add version info (#<I>)
mocobeta_janome
train
py
fcdf5afa0339b709f641a61d0d53d21b4a3e2307
diff --git a/client/executor/exec_linux_test.go b/client/executor/exec_linux_test.go index <HASH>..<HASH> 100644 --- a/client/executor/exec_linux_test.go +++ b/client/executor/exec_linux_test.go @@ -104,8 +104,8 @@ func TestExecutorLinux_Start_Kill(t *testing.T) { filePath := filepath.Join(path, "test") e := Command("/bin/bash", "-c", "sleep 1 ; echo \"failure\" > "+filePath) - // This test can only be run if we are root. - if !e.(*LinuxExecutor).root { + // This test can only be run if cgroups are enabled. + if !e.(*LinuxExecutor).cgroupEnabled { t.SkipNow() } @@ -142,8 +142,8 @@ func TestExecutorLinux_Open(t *testing.T) { filePath := filepath.Join(path, "test") e := Command("/bin/bash", "-c", "sleep 1 ; echo \"failure\" > "+filePath) - // This test can only be run if we are root. - if !e.(*LinuxExecutor).root { + // This test can only be run if cgroups are enabled. + if !e.(*LinuxExecutor).cgroupEnabled { t.SkipNow() }
Tests skip based on cgroups, not root
hashicorp_nomad
train
go