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
e8ce9b09c709b09f875a1dc24353b4e39af841c2
diff --git a/tests/pytests/unit/modules/test_restconf.py b/tests/pytests/unit/modules/test_restconf.py index <HASH>..<HASH> 100644 --- a/tests/pytests/unit/modules/test_restconf.py +++ b/tests/pytests/unit/modules/test_restconf.py @@ -4,11 +4,9 @@ from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch -@pytest.fixture(autouse=True) -def setup_loader(): - setup_loader_modules = {restconf: {}} - with pytest.helpers.loader_mock(setup_loader_modules) as loader_mock: - yield loader_mock +@pytest.fixture +def configure_loader_modules(): + return {restconf: {}} @pytest.fixture
Update tests/pytests/unit/modules/test_restconf.py
saltstack_salt
train
py
b635b81ae511e8ff65c7f54a804b3416fbebc17e
diff --git a/app/models/post.rb b/app/models/post.rb index <HASH>..<HASH> 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -5,7 +5,7 @@ class Post < ActiveRecord::Base include FindByTenant default_scope -> { includes(:categories, :media, :industries) } - scope :published, -> { where('published_at <= ? and draft = ?', DateTime.now, false) } + scope :published, -> { where('published_at <= ? and draft = ? and (expired_at >= ? OR expired_at is null)', DateTime.now, false, DateTime.now) } scope :published_last_updated_at, -> { published.order(updated_at: :desc).select('updated_at').first.updated_at } acts_as_taggable
Include expired_at check in the model
cortex-cms_cortex
train
rb
36b0a248a25c694d79e5d0d9acbd6fb22f2faa27
diff --git a/actions/class.ClientConfig.php b/actions/class.ClientConfig.php index <HASH>..<HASH> 100755 --- a/actions/class.ClientConfig.php +++ b/actions/class.ClientConfig.php @@ -24,6 +24,7 @@ use oat\tao\model\ThemeRegistry; use oat\tao\model\asset\AssetService; use oat\tao\model\clientConfig\ClientConfigService; use oat\tao\model\routing\Resolver; +use tao_helpers_Mode; /** * Generates client side configuration. @@ -88,6 +89,7 @@ class tao_actions_ClientConfig extends tao_actions_CommonModule { 'action' => $resolver->getMethodName(), 'shownExtension' => $this->getShownExtension(), 'shownStructure' => $this->getShownStructure(), + 'bundle' => tao_helpers_Mode::is(tao_helpers_Mode::PRODUCTION) ])); $this->setView('client_config.tpl');
let client know if we are in bundle/prod mode
oat-sa_tao-core
train
php
449c7fc98b25d4c7f10783264c7b1fdde3edb752
diff --git a/js/bin.js b/js/bin.js index <HASH>..<HASH> 100644 --- a/js/bin.js +++ b/js/bin.js @@ -113,7 +113,6 @@ URLFetchable.prototype.fetchAsText = function(callback) { var length; var url = this.url; if (isSafari || this.opts.salt) { - url = saltURL(url); url = url + '?salt=' + b64_sha1('' + Date.now() + ',' + (++seed)); } req.open('GET', url, true); diff --git a/js/version.js b/js/version.js index <HASH>..<HASH> 100644 --- a/js/version.js +++ b/js/version.js @@ -13,7 +13,7 @@ var VERSION = { CONFIG: 5, MAJOR: 0, MINOR: 12, - MICRO: 5, + MICRO: 6, PATCH: '', BRANCH: '' } diff --git a/package.json b/package.json index <HASH>..<HASH> 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dalliance", - "version:": "0.12.5", + "version:": "0.12.6", "description": "Fast, embeddable genome visualization", "homepage": "https://www.biodalliance.org/", "repository": {
Fix for trix-search on Safari bug (thanks @yimen)
dasmoth_dalliance
train
js,js,json
e49e632a05d6196cb04583161463db93efe3204f
diff --git a/src/Uecode/Bundle/ApiKeyBundle/Security/Firewall/ApiKeyListener.php b/src/Uecode/Bundle/ApiKeyBundle/Security/Firewall/ApiKeyListener.php index <HASH>..<HASH> 100644 --- a/src/Uecode/Bundle/ApiKeyBundle/Security/Firewall/ApiKeyListener.php +++ b/src/Uecode/Bundle/ApiKeyBundle/Security/Firewall/ApiKeyListener.php @@ -19,17 +19,17 @@ class ApiKeyListener implements ListenerInterface /** * @var TokenStorageInterface */ - protected $tokenStorage; + private $tokenStorage; /** * @var AuthenticationManagerInterface */ - protected $authenticationManager; + private $authenticationManager; /** * @var KeyExtractor */ - protected $keyExtractor; + private $keyExtractor; public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $manager, KeyExtractor $keyExtractor) {
Make listener fields private - there are not reason to override here
uecode_api-key-bundle
train
php
f5f0aefa513bb9ca71dd703501187cc315369505
diff --git a/test/testing/test_waiting.py b/test/testing/test_waiting.py index <HASH>..<HASH> 100644 --- a/test/testing/test_waiting.py +++ b/test/testing/test_waiting.py @@ -36,7 +36,6 @@ class TestPatchWaitUseCases(object): def cb(args, kwargs, res, exc_info): if res == 10: return True - return False with wait_for_call(counter, 'count', callback=cb) as result: Thread(target=count_forever).start() @@ -66,7 +65,6 @@ class TestPatchWaitUseCases(object): def cb(args, kwargs, res, exc_info): if args == (10,): return True - return False with wait_for_call(counter, 'skip_to', callback=cb) as result: Thread(target=increment_forever).start() @@ -100,7 +98,6 @@ class TestPatchWaitUseCases(object): def cb(args, kwargs, res, exc_info): if exc_info is not None: return True - return False with wait_for_call(counter, 'count', callback=cb) as result: Thread(target=count_forever).start() @@ -139,7 +136,6 @@ class TestPatchWaitUseCases(object): def cb(args, kwargs, res, exc_info): if exc_info is not None: return False - return True with wait_for_call(counter, 'count', callback=cb) as result: Thread(target=count_forever).start()
don't need these lines, implicit return is falsy
nameko_nameko
train
py
468ba05e9ae19d69011d6152b1e58d5bf5e20122
diff --git a/synctool/src/test/java/org/duracloud/sync/endpoint/DuraStoreChunkSyncEndpointTest.java b/synctool/src/test/java/org/duracloud/sync/endpoint/DuraStoreChunkSyncEndpointTest.java index <HASH>..<HASH> 100644 --- a/synctool/src/test/java/org/duracloud/sync/endpoint/DuraStoreChunkSyncEndpointTest.java +++ b/synctool/src/test/java/org/duracloud/sync/endpoint/DuraStoreChunkSyncEndpointTest.java @@ -166,7 +166,7 @@ public class DuraStoreChunkSyncEndpointTest { @Test public void testAddUpdate3MBFileWith1MBChunks() throws Exception { - testAddChunkedFile(3, 1000 * 1000 * 1000); + testAddChunkedFile(3, 10 * 1000 * 1000); } // /**
Reduces chunk size for test in DuraStoreChunkSyncEndpointTest
duracloud_duracloud
train
java
f1b89b645d8aadf657fbc89c507845116c3a02d0
diff --git a/app/models/renalware/event.rb b/app/models/renalware/event.rb index <HASH>..<HASH> 100644 --- a/app/models/renalware/event.rb +++ b/app/models/renalware/event.rb @@ -1,9 +1,9 @@ module Renalware class Event < ActiveRecord::Base - belongs_to :patients + belongs_to :patient belongs_to :event_type - validates :event_type_id, :date_time, + validates :patient_id, :event_type_id, :date_time, :description, :notes, :presence => true def self.policy_class
Made corrections to 'event' model association and validations.
airslie_renalware-core
train
rb
7d4ae338a2e4cd07ff10ea14479b4a519e0890e5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,8 @@ Qh.deepWhen = x => { x = Array.from(x); } + // TODO: This can be made much more efficient if we avoid + // calling Q.when / Q.all on non-promises. return Q.when(x).then(x => { if(Array.isArray(x)) { let nx = [];
Add efficiency to-do note to deepWhen function.
n2liquid_qhell
train
js
1d2d2f29911eb2243194752b83da13cc996ad749
diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index <HASH>..<HASH> 100644 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -1117,7 +1117,7 @@ $lis = this.findLis().eq(this.liObj[index]); } - $lis.toggleClass('selected', selected); + $lis.toggleClass('selected', selected).find('a').attr('aria-selected', selected); }, /** @@ -1240,7 +1240,7 @@ if (!that.multiple) { // Deselect all others if not multi select box $options.prop('selected', false); $option.prop('selected', true); - that.$menuInner.find('.selected').removeClass('selected'); + that.$menuInner.find('.selected').removeClass('selected').find('a').attr('aria-selected', false); that.setSelected(clickedIndex, true); } else { // Toggle the one we have chosen if we are multi select. $option.prop('selected', !state);
toggle aria-selected attribute (#<I>)
snapappointments_bootstrap-select
train
js
ecee3be65042c3684be0add9c24bfb9c6e2282a2
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -81,7 +81,7 @@ const {unproject} = (function unprojectFunction() { initialized = initialized || initialize(THREE); - vector.applyProjection(matrix.getInverse(threeCamera.projectionMatrix)); + vector.applyMatrix4(matrix.getInverse(threeCamera.projectionMatrix)); return localToWorld(THREE, threeCamera, vector);
Fix ".applyProjection() has been removed."
jesstelford_aframe-click-drag-component
train
js
2012c93879699516ab9ee79b2bfdac03ace4ae82
diff --git a/src/Relationships/IRelationshipCollection.php b/src/Relationships/IRelationshipCollection.php index <HASH>..<HASH> 100644 --- a/src/Relationships/IRelationshipCollection.php +++ b/src/Relationships/IRelationshipCollection.php @@ -80,6 +80,13 @@ interface IRelationshipCollection extends IProperty, IteratorAggregate, Countabl /** + * Returns true if relationship is modified. + * @return bool + */ + public function isModified(); + + + /** * Counts collection entities without fetching them from storage. * @return int */ diff --git a/src/Relationships/IRelationshipContainer.php b/src/Relationships/IRelationshipContainer.php index <HASH>..<HASH> 100644 --- a/src/Relationships/IRelationshipContainer.php +++ b/src/Relationships/IRelationshipContainer.php @@ -37,4 +37,11 @@ interface IRelationshipContainer extends IPropertyContainer */ public function isLoaded(); + + /** + * Returns true if relationship is modified. + * @return bool + */ + public function isModified(); + }
relationships: added missing getModified() method into interface
nextras_orm
train
php,php
a4b05f59e411e42c4c1045fb50af25134ab2b309
diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -11,13 +11,6 @@ use Illuminate\Support\ServiceProvider as BaseServiceProvider; class ServiceProvider extends BaseServiceProvider { /** - * Indicates if loading of the provider is deferred. - * - * @var bool - */ - protected $defer = false; - - /** * Bootstrap the application events. */ public function boot() @@ -45,7 +38,7 @@ class ServiceProvider extends BaseServiceProvider // Map any routes $this->mapLaraBugApiRoutes(); - + // Create an alias to the larabug-js-client.blade.php include Blade::include('larabug::larabug-js-client', 'larabugJavaScriptClient'); }
the defer boolean property was deprecated in <I> and removed in <I> +, so lets remove it
LaraBug_LaraBug
train
php
91bb1c6c72a2713704141353aaf9160cbbf18ee3
diff --git a/src/Checksum_Base_Command.php b/src/Checksum_Base_Command.php index <HASH>..<HASH> 100644 --- a/src/Checksum_Base_Command.php +++ b/src/Checksum_Base_Command.php @@ -44,7 +44,7 @@ class Checksum_Base_Command extends WP_CLI_Command { foreach ( $files as $file_info ) { $pathname = substr( $file_info->getPathname(), strlen( $path ) ); if ( $file_info->isFile() && $this->filter_file( $pathname ) ) { - $filtered_files[] = str_replace( $path, '', $file_info->getPathname() ); + $filtered_files[] = $pathname; } } } catch ( Exception $e ) {
Replace redundant str_replace() with direct variable reference.
wp-cli_checksum-command
train
php
f5acadb527517cde77426f150bb810f0539215ac
diff --git a/lib/jets/commands/build.rb b/lib/jets/commands/build.rb index <HASH>..<HASH> 100644 --- a/lib/jets/commands/build.rb +++ b/lib/jets/commands/build.rb @@ -141,12 +141,29 @@ module Jets::Commands # In this case, we can skip a lot of the ruby related building and speed up the # deploy process. def self.poly_only? + !app_has_ruby? && !shared_has_ruby? + end + + def self.app_has_ruby? has_ruby = app_files.detect do |path| app_class = Jets::Klass.from_path(path) # IE: PostsController, Jets::PublicController langs = app_class.tasks.map(&:lang) langs.include?(:ruby) end - !has_ruby + !!has_ruby + end + + def self.shared_has_ruby? + has_ruby = false + Jets::Stack.subclasses.each do |klass| + klass.functions.each do |fun| + if fun.lang == :ruby + has_ruby = true + break + end + end + end + has_ruby end # Add internal Jets controllers if they are being used
fix has_poly? check to account for shared functions
tongueroo_jets
train
rb
1d8dd7d5d444f778b6dd224c9e95f622fa36d8f1
diff --git a/source/rafcon/gui/mygaphas/tools.py b/source/rafcon/gui/mygaphas/tools.py index <HASH>..<HASH> 100644 --- a/source/rafcon/gui/mygaphas/tools.py +++ b/source/rafcon/gui/mygaphas/tools.py @@ -240,10 +240,13 @@ class HoverItemTool(gaphas.tool.HoverTool): return [] def _filter_library_state(self, items): - """Filters our child elements of library state when they cannot be hovered + """Filters out child elements of library state when they cannot be hovered - Checks if hovered item is within a LibraryState and, if so, sets the hovered item to the LibraryState or - upper most LibraryState + Checks if hovered item is within a LibraryState + * if not, the list is returned unfiltered + * if so, STATE_SELECTION_INSIDE_LIBRARY_STATE_ENABLED is checked + * if enabled, the library is selected (instead of the state copy) + * if not, the upper most library is selected :param list items: Sorted list of items beneath the cursor :return: filtered items
docs(mygaphas.tools): Extend docstring of _filter_library_state
DLR-RM_RAFCON
train
py
7c9de0f677ec90144cf71baa2dffcf2a25b88ec5
diff --git a/lib/cacheable.rb b/lib/cacheable.rb index <HASH>..<HASH> 100644 --- a/lib/cacheable.rb +++ b/lib/cacheable.rb @@ -29,8 +29,8 @@ module Cacheable key.length < MEMCACHED_MAXIMUM_KEY_LENGTH ? key : key[0..MEMCACHED_MAXIMUM_KEY_LENGTH-11] + Zlib.crc32(key).to_s end - def self.sanitize_args(args) - Array.wrap(args).map do |x| + def self.sanitize_array(ary) + ary.map do |x| if x.nil? 'nil' elsif x.is_a? String @@ -160,7 +160,7 @@ module Cacheable end else def #{symbol}(*args) - sanitized_args = ::Cacheable.sanitize_args args + sanitized_args = ::Cacheable.sanitize_array args hash_args = sanitized_args[sanitized_args.length] result = ::Cacheable.cas(self, #{symbol.inspect}, #{options[:ttl]}) do |current_hash|
Array.wrap is just totally unnecessary here (and not included in later versions of active_support anyway).
seamusabshere_cacheable
train
rb
0ad71a5e07555714999b3af945efebfe6e892f64
diff --git a/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/simple/DefaultSimpleModel.java b/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/simple/DefaultSimpleModel.java index <HASH>..<HASH> 100644 --- a/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/simple/DefaultSimpleModel.java +++ b/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/simple/DefaultSimpleModel.java @@ -86,14 +86,6 @@ public class DefaultSimpleModel<N extends Node> extends AbstractSimpleModel<N> { * {@inheritDoc} */ @Override - protected void bindInternal() { - // Nothing to do yet - } - - /** - * {@inheritDoc} - */ - @Override protected void bind() { // Nothing to do yet }
Fix call of bind method for SimpleModel (wrong override)
JRebirth_JRebirth
train
java
6be1d5d691bfc3f8ea38b1c6fe5dc741a5b09591
diff --git a/codebase/db_common.php b/codebase/db_common.php index <HASH>..<HASH> 100644 --- a/codebase/db_common.php +++ b/codebase/db_common.php @@ -1060,6 +1060,7 @@ class ArrayDBDataWrapper extends DBDataWrapper{ } $relation_id = $this->config->relation_id["db_name"]; + $result = array(); for ($i = 0; $i < count($this->connection); $i++) { $item = $this->connection[$i];
[fix] incorrect processing of render_array with relation id
DHTMLX_connector-php
train
php
cea86adb39e36acfab4fcfab9f40b7d97d53dcfa
diff --git a/bitshares/asset.py b/bitshares/asset.py index <HASH>..<HASH> 100644 --- a/bitshares/asset.py +++ b/bitshares/asset.py @@ -128,7 +128,7 @@ class Asset(dict): @property def calls(self): - return self.get_call_positions(10) + return self.get_call_orders(10) def get_call_orders(self, limit=100): from .price import Price
Fix method call in Asset.calls property
bitshares_python-bitshares
train
py
ca2f9aa71f77fd9bb3ee2fac6fd77b85129f6377
diff --git a/src/ListComboBox.js b/src/ListComboBox.js index <HASH>..<HASH> 100644 --- a/src/ListComboBox.js +++ b/src/ListComboBox.js @@ -73,8 +73,12 @@ class ListComboBox extends Base { // We do our own handling of the Up and Down arrow keys, rather than relying // on KeyboardDirectionMixin. The latter supports Home and End, and we don't // want to handle those -- we want to let the text input handle them. + // We also need to forward PageDown/PageUp to the list element. [symbols.keydown](event) { + let handled; + /** @type {any} */ + const list = this.$.list; switch (event.key) { @@ -100,6 +104,13 @@ class ListComboBox extends Base { // Don't mark as handled. } + case 'PageDown': + handled = list.pageDown && list.pageDown(); + break; + + case 'PageUp': + handled = list.pageUp && list.pageUp(); + break; } // Prefer mixin result if it's defined, otherwise use base result.
Forward Page Up/Page Down keys to list.
elix_elix
train
js
9aae67f92b6e0b011fb3923ea2913773b57680c3
diff --git a/test/test_crypto_box.js b/test/test_crypto_box.js index <HASH>..<HASH> 100755 --- a/test/test_crypto_box.js +++ b/test/test_crypto_box.js @@ -109,7 +109,7 @@ var bobpk = new Buffer(bobpkA); var cipherText = new Buffer(cipherTextA); var secret = new Buffer(secretA); -describe('Box', function() { +describe('crypto_box', function() { it('crypto_box should encrypt to known cipher text', function(done) { var cipherMsg = sodium.crypto_box(plainText,nonce, bobpk, alicesk); if( !cipherMsg ) { @@ -120,7 +120,7 @@ describe('Box', function() { }); // Test bad params - it('should fail on bad param 1 string', function(done) { + it('should fail on bad param 1', function(done) { var p = ""; var n = nonce; var pk = bobpk @@ -310,7 +310,7 @@ describe('Box', function() { }); }); -describe('BoxOpen', function() { +describe('crypto_box_open', function() { var sender = sodium.crypto_box_keypair(); var receiver = sodium.crypto_box_keypair();
changed test names to be consistent with the rest
paixaop_node-sodium
train
js
24090497dcffe8b5ac186f0ffcfb1627680ca2c5
diff --git a/core/common/src/main/java/alluxio/underfs/UnderFileSystem.java b/core/common/src/main/java/alluxio/underfs/UnderFileSystem.java index <HASH>..<HASH> 100644 --- a/core/common/src/main/java/alluxio/underfs/UnderFileSystem.java +++ b/core/common/src/main/java/alluxio/underfs/UnderFileSystem.java @@ -53,7 +53,7 @@ public abstract class UnderFileSystem { */ private boolean mProvidesStorage = true; - private static final Cache CACHE = new Cache(); + private static final Cache UFS_CACHE = new Cache(); /** * The different types of space indicate the total space, the free space and the space used in the @@ -187,7 +187,7 @@ public abstract class UnderFileSystem { Preconditions.checkNotNull(path); Preconditions.checkNotNull(configuration); - return CACHE.get(path, ufsConf, configuration); + return UFS_CACHE.get(path, ufsConf, configuration); } /**
rename CACHE to UFS_CACHE
Alluxio_alluxio
train
java
a78401343621b1fe81bdb7a83cd4054ea17d0617
diff --git a/test/activity-test.js b/test/activity-test.js index <HASH>..<HASH> 100644 --- a/test/activity-test.js +++ b/test/activity-test.js @@ -318,6 +318,30 @@ suite.addBatch({ assert.ifError(err); assert.isArray(edges); assert.lengthOf(edges, 1); + }, + 'and we apply() a stop-following activity': { + topic: function(edges, users, Activity) { + var act = new Activity({actor: users.alice.profile, + verb: "stop-following", + object: users.bob.profile}); + act.apply(users.alice.profile, this); + }, + 'it works': function(err) { + assert.ifError(err); + }, + 'and we check for the resulting edge again': { + topic: function(edges, users, Activity) { + var Edge = require('../lib/model/edge').Edge; + Edge.search({"from.id": users.alice.profile.id, + "to.id": users.bob.profile.id}, + this.callback); + }, + 'it does not exist': function(err, edges) { + assert.ifError(err); + assert.isArray(edges); + assert.lengthOf(edges, 0); + } + } } } }
Do a stop-following activity too
pump-io_pump.io
train
js
8e72f5d3db9cf0d6dce3f1afa5da642ec63d1105
diff --git a/bsdploy/tests/test_roles.py b/bsdploy/tests/test_roles.py index <HASH>..<HASH> 100644 --- a/bsdploy/tests/test_roles.py +++ b/bsdploy/tests/test_roles.py @@ -70,6 +70,7 @@ def test_roles(ctrl, monkeypatch): 'Setup cloned interfaces', 'Enable security.jail.allow_raw_sockets', 'Enable security.jail.sysvipc_allowed', + 'Ensure helper packages are installed (using http proxy)', 'Ensure helper packages are installed', 'Set default jail interface', 'Set default jail parameters',
Updated test_roles.py for tasks in jail_hosts.
ployground_bsdploy
train
py
11adff42327e8132d0fc3a12ff183d69833c438b
diff --git a/tohu/v6/custom_generator/utils.py b/tohu/v6/custom_generator/utils.py index <HASH>..<HASH> 100644 --- a/tohu/v6/custom_generator/utils.py +++ b/tohu/v6/custom_generator/utils.py @@ -19,7 +19,7 @@ def make_tohu_items_class(clsname, attr_names): Names of the attributes of the class to be created """ - item_cls = attr.make_class(clsname, {name: attr.ib() for name in attr_names}, repr=False, cmp=True) + item_cls = attr.make_class(clsname, {name: attr.ib() for name in attr_names}, repr=False, cmp=True, frozen=True) def new_repr(self): all_fields = ', '.join([f'{name}={repr(value)}' for name, value in attr.asdict(self).items()])
Ensure items generated by custom generators are hashable so that they can be used as keys in a dictionary
maxalbert_tohu
train
py
5363ca94c4c4de2add8306e642d421b8f6679de7
diff --git a/lib/nearley.js b/lib/nearley.js index <HASH>..<HASH> 100644 --- a/lib/nearley.js +++ b/lib/nearley.js @@ -59,13 +59,6 @@ State.prototype.consumeTerminal = function(inp) { return val; }; -State.prototype.consumeNonTerminal = function(inp) { - if (this.rule.symbols[this.dot] === inp) { - return this.nextState(inp); - } - return false; -}; - State.prototype.finish = function() { if (this.rule.postprocess) { this.data = this.rule.postprocess(this.data, this.reference, Parser.fail); @@ -109,6 +102,7 @@ Column.prototype.process = function(nextColumn) { } } else { + // predict var exp = state.rule.symbols[state.dot]; if (typeof exp !== 'string') { continue; } @@ -142,9 +136,9 @@ Column.prototype.predict = function(exp) { } Column.prototype.complete = function(left, right) { - var copy = left.consumeNonTerminal(right.rule.name); - if (copy) { - copy.data[copy.data.length - 1] = right.data; + var inp = right.rule.name; + if (left.rule.symbols[left.dot] === inp) { + var copy = left.nextState(right.data); this.states.push(copy); } }
micro-optimise: inline consumeNonTerminal * this lets us remove an assignment
kach_nearley
train
js
07396215f5ef4cd39c6d6710934506114b72161d
diff --git a/examples/zmqserver.py b/examples/zmqserver.py index <HASH>..<HASH> 100644 --- a/examples/zmqserver.py +++ b/examples/zmqserver.py @@ -19,7 +19,7 @@ def get_logger(name, pid): return log -def router_main(pidx, args): +def router_main(_, pidx, args): log = get_logger('examples.zmqserver.extra', pidx) ctx = zmq.Context() ctx.linger = 0 @@ -30,7 +30,7 @@ def router_main(pidx, args): try: log.info('router proxy started') zmq.proxy(in_sock, out_sock) - except zmq.ContextTerminated: + except KeyboardInterrupt: pass except: log.exception('unexpected error')
Update ZeroMQ server example to work with latest version
achimnol_aiotools
train
py
407c0ae5c73400cd9fd2b3515311f9026aaecb9f
diff --git a/system/Autoloader/FileLocator.php b/system/Autoloader/FileLocator.php index <HASH>..<HASH> 100644 --- a/system/Autoloader/FileLocator.php +++ b/system/Autoloader/FileLocator.php @@ -144,7 +144,7 @@ class FileLocator // or 'libraries'. if (! empty($folder) && strpos($path . $filename, '/' . $folder . '/') === false) { - $path .= $folder; + $path .= trim($folder, '/') . '/'; } $path .= $filename;
Add one more trailing slash check
codeigniter4_CodeIgniter4
train
php
57440509434d7a5b513c76c802483e5cd23c6c02
diff --git a/api/handler/event/event.go b/api/handler/event/event.go index <HASH>..<HASH> 100644 --- a/api/handler/event/event.go +++ b/api/handler/event/event.go @@ -2,6 +2,7 @@ package event import ( + "encoding/json" "fmt" "io/ioutil" "net/http" @@ -91,12 +92,17 @@ func (e *event) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // set body - b, err := ioutil.ReadAll(r.Body) - if err != nil { - http.Error(w, err.Error(), 500) - return + if r.Method == "GET" { + bytes, _ := json.Marshal(r.URL.Query()) + ev.Data = string(bytes) + } else { + b, err := ioutil.ReadAll(r.Body) + if err != nil { + http.Error(w, err.Error(), 500) + return + } + ev.Data = string(b) } - ev.Data = string(b) // get client c := e.options.Service.Client()
api event supports for GET url params (#<I>)
micro_go-micro
train
go
82ff6df393a7dcd58a9dd202da9127fb8f276e22
diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php @@ -179,17 +179,6 @@ class ClassMetadata extends ClassMetadataInfo $reflField->setAccessible(true); $this->reflFields[$field] = $reflField; } - - foreach ($this->fieldMappings as $field => $mapping) { - if (isset($mapping['declared'])) { - $reflField = new \ReflectionProperty($mapping['declared'], $field); - } else { - $reflField = $this->reflClass->getProperty($field); - } - - $reflField->setAccessible(true); - $this->reflFields[$field] = $reflField; - } } /**
Removed duplicated code that does nothing
doctrine_mongodb-odm
train
php
f69542656a40a0040568df3f17388dd3da99fca7
diff --git a/src/Composer/Action/BaseAction.php b/src/Composer/Action/BaseAction.php index <HASH>..<HASH> 100644 --- a/src/Composer/Action/BaseAction.php +++ b/src/Composer/Action/BaseAction.php @@ -6,6 +6,8 @@ use Bolt\Exception\PackageManagerException; use Composer\DependencyResolver\Pool; use Composer\Factory; use Composer\Package\Version\VersionSelector; +use Composer\Repository\ComposerRepository; +use Composer\Repository\ConfigurableRepositoryInterface; use Silex\Application; abstract class BaseAction @@ -149,7 +151,11 @@ abstract class BaseAction { $repos = $this->getComposer()->getRepositoryManager()->getRepositories(); + /** @var ConfigurableRepositoryInterface $repo */ foreach ($repos as $repo) { + if (!$repo instanceof ComposerRepository) { + continue; + } $reflection = new \ReflectionClass($repo); $allowSslDowngrade = $reflection->getProperty('allowSslDowngrade'); $allowSslDowngrade->setAccessible(true);
Only set allowSslDowngrade on a ComposerRepository object
bolt_bolt
train
php
5f6fc25b43d2849373a935344d119a6533be6e05
diff --git a/mod/forum/post.php b/mod/forum/post.php index <HASH>..<HASH> 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -115,9 +115,15 @@ $realpost = new object; $realpost->userid = -1; } - - if ( !(($realpost->userid == $USER->id && has_capability('mod/forum:replypost', $modcontext)) || - has_capability('mod/forum:editanypost', $modcontext)) ) { + + + // if user has edit any post capability + // or has either startnewdiscussion or reply capability and is editting own post + // then he can proceed + // MDL-7066 + if ( !(($realpost->userid == $USER->id && (has_capability('mod/forum:replypost', $modcontext) + || has_capability('mod/forum:startdiscussion', $modcontext))) || + has_capability('mod/forum:editanypost', $modcontext)) ) { error("You can not update this post"); }
merged fix for MDL-<I>, users will replypost set to prohit can not edit own post
moodle_moodle
train
php
843b4f5fb37071f0e80bc306dc0aedd0d4f9839f
diff --git a/commands/score.py b/commands/score.py index <HASH>..<HASH> 100755 --- a/commands/score.py +++ b/commands/score.py @@ -21,7 +21,7 @@ def cmd(send, msg, args): sorted_data = sorted(data, key=data.get) if match.group(1) == 'high': send('High Scores:') - for x in reversed(range(0, 3)): + for x in [-1, -2, -3]: try: name = sorted_data[x] send("%s: %s" % (name, data[name]))
!score --high now works. Fixes #<I>
tjcsl_cslbot
train
py
ef6998015f9e566d4f6c5c535cb31d167ec8c68a
diff --git a/auth/shibboleth/auth.php b/auth/shibboleth/auth.php index <HASH>..<HASH> 100644 --- a/auth/shibboleth/auth.php +++ b/auth/shibboleth/auth.php @@ -210,7 +210,8 @@ class auth_plugin_shibboleth extends auth_plugin_base { } // Overwrite redirect in order to send user to Shibboleth logout page and let him return back - $redirect = $this->config->logout_handler.'?return='.urlencode($temp_redirect); + $redirecturl = new moodle_url($this->config->logout_handler, array('return' => $temp_redirect)); + $redirect = $redirecturl->out(); } }
MDL-<I> auth_shibboleth: fix logout handler url generation This patch fixes the shibboleth redirect url generation, that can create invalid url if the shibboleth logout_handler setting has a parameter generating two parameters with (?) instead of (&). Thanks to Matteo Boni for the proposed solution.
moodle_moodle
train
php
cbd3d3003db37e7f3451d7b3f61bf2050257f21e
diff --git a/lib/EntityManager.js b/lib/EntityManager.js index <HASH>..<HASH> 100644 --- a/lib/EntityManager.js +++ b/lib/EntityManager.js @@ -311,7 +311,7 @@ exports.EntityManager = EntityManager = Object.inherit(/** @lends jspa.EntityMan } }.bind(this)); } else { - return entity; + return Q(entity); } }.bind(this)); },
save returns promise when entity is cached
Baqend_js-sdk
train
js
4f9fcd863bb20522b5e39f454b718b6d684b7939
diff --git a/fluent/fluent_test.go b/fluent/fluent_test.go index <HASH>..<HASH> 100644 --- a/fluent/fluent_test.go +++ b/fluent/fluent_test.go @@ -175,6 +175,22 @@ func Benchmark_PostWithShortMessage(b *testing.B) { } } +func Benchmark_PostWithShortMessageMarshalAsJSON(b *testing.B) { + b.StopTimer() + f, err := New(Config{MarshalAsJSON: true}) + if err != nil { + panic(err) + } + + b.StartTimer() + data := map[string]string{"message": "Hello World"} + for i := 0; i < b.N; i++ { + if err := f.Post("tag", data); err != nil { + panic(err) + } + } +} + func Benchmark_LogWithChunks(b *testing.B) { b.StopTimer() f, err := New(Config{})
test: Add benchmack test case for marshal as json instead of msgpack
fluent_fluent-logger-golang
train
go
c2f9cb7f920c73a9d7fbb857727961904805f197
diff --git a/spec/cases/oauth_spec.rb b/spec/cases/oauth_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cases/oauth_spec.rb +++ b/spec/cases/oauth_spec.rb @@ -190,7 +190,7 @@ describe "Koala::Facebook::OAuth" do end it "does not uses get_user_info_from_cookies to parse the cookies" do - @oauth.should_not_receive(:get_user_info_from_cookies).with(@cookie).and_return({}) + @oauth.should_not_receive(:get_user_info_from_cookies).with(@cookie) @oauth.get_user_from_cookies(@cookie) end
Clean code generating a deprecation warning should_not_receive can't be used with and_return See <URL>
arsduo_koala
train
rb
ee960a37bf97ccbc348e997b0a3794f93fb830bc
diff --git a/mailer/smtp_mailer.go b/mailer/smtp_mailer.go index <HASH>..<HASH> 100644 --- a/mailer/smtp_mailer.go +++ b/mailer/smtp_mailer.go @@ -54,7 +54,16 @@ func NewSMTPMailer(port string, host string, user string, password string) (SMTP return SMTPMailer{}, errors.New("invalid port for the SMTP mailer") } - dialer := gomail.NewDialer(host, iport, user, password) + dialer := &gomail.Dialer{ + Host: host, + Port: iport, + } + + if user != "" { + dialer.Username = user + dialer.Password = password + } + return SMTPMailer{ Dialer: dialer, }, nil
setting the Username and Password of the dialer only if the passed user is not empty
gobuffalo_x
train
go
18328da5856b4a5273201008f1587646017c4dd8
diff --git a/lib/Page/Tester.php b/lib/Page/Tester.php index <HASH>..<HASH> 100644 --- a/lib/Page/Tester.php +++ b/lib/Page/Tester.php @@ -81,9 +81,26 @@ class Page_Tester extends Page { try{ $result=(string)$test_obj->$test_func($input[0],$input[1]); }catch (Exception $e){ + + if($_GET['tester_details']==$row['name'] && $_GET['vari']==$vari){ + throw $e; + } + + $result='Exception: '.(method_exists($e,'getText')? $e->getText(): $e->getMessage()); + + $ll=$this->add('P'); + $v=$ll->add('View') + ->setElement('a') + ->setAttr('href','#') + ->set('More details') + ->js('click')->univ()->frameURL('Exception Details for test '.$row['name'], + $this->api->url(null,array('tester_details'=>$row['name'],'vari'=>$vari))) + ; + + $result.=$ll->getHTML(); } //$this->$method($vari); /*
Tester will show "Mode Details" link for tests causing exception
atk4_atk4
train
php
405d61613b27bce348887d9c52ae87baa76c652a
diff --git a/applications/default/extensions/rest/rest.js b/applications/default/extensions/rest/rest.js index <HASH>..<HASH> 100644 --- a/applications/default/extensions/rest/rest.js +++ b/applications/default/extensions/rest/rest.js @@ -103,11 +103,22 @@ rest.route = function(routes, callback) { return typeModel.validateAndSave(request.body, validationResponseCallback(callback)); } if (request.method == 'POST' || request.method == 'PATCH') { - return typeModel.load(request.params[paramName], function(err, item) { + return typeModel.load(request.params[paramName], function(error, item) { + if (error) { + return callback(error); + } + + // Remove key property from incoming data to prevent updating the + // wrong item. + if (type.keyProperty in request.body) { + delete request.body[type.keyProperty]; + } + if (item) { utils.extend(item, request.body); request.body = item; } + typeModel.validateAndSave(request.body, validationResponseCallback(callback)); }); }
Making sure no one is able to update a different item by passing a different key. #<I>
recidive_choko
train
js
1bfcb827e1eaee0e68e4b6ab10850e74bff924a8
diff --git a/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java b/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java +++ b/core/src/main/java/org/bitcoinj/wallet/WalletProtobufSerializer.java @@ -93,13 +93,14 @@ public class WalletProtobufSerializer { public interface WalletFactory { Wallet create(NetworkParameters params, KeyChainGroup keyChainGroup); + WalletFactory DEFAULT = Wallet::new; } private final WalletFactory factory; private KeyChainFactory keyChainFactory; public WalletProtobufSerializer() { - this(Wallet::new); + this(WalletFactory.DEFAULT); } public WalletProtobufSerializer(WalletFactory factory) {
WalletProtobufSerializer: extract wallet constructor reference to WalletFactory::DEFAULT This makes the default implementation more obvious and easier to reference. It will also will help us make the WalletFactory member of WalletAppKit `@Nonnull` in a dependent PR.
bitcoinj_bitcoinj
train
java
2242b54f5c404dea92851b392cbd20788811ba0e
diff --git a/presto-main/src/main/java/com/facebook/presto/operator/SyntheticAddress.java b/presto-main/src/main/java/com/facebook/presto/operator/SyntheticAddress.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/operator/SyntheticAddress.java +++ b/presto-main/src/main/java/com/facebook/presto/operator/SyntheticAddress.java @@ -17,7 +17,7 @@ package com.facebook.presto.operator; * Methods for creating and decoding synthetic addresses. * A synthetic address is a physical position within an array of Slices. The address is encoded * as a long with the high 32 bits containing the index of the slice in the array and the low 32 - * bits containing an offset with the slice. + * bits containing an offset within the slice. */ public final class SyntheticAddress {
Fix typo in SyntheticAddress comments
prestodb_presto
train
java
09242054f90c614b3f9135950270cdd6ab7e4239
diff --git a/metric.go b/metric.go index <HASH>..<HASH> 100644 --- a/metric.go +++ b/metric.go @@ -180,7 +180,9 @@ func (met *Metrics) NewRate(baseMetric string, name string, interval time.Durati met.rates[name] = newRate go func() { - for isRunning := true; isRunning; _, isRunning = <-newRate.ticker.C { + isRunning := true + for isRunning { + _, isRunning = <-newRate.ticker.C met.updateRate(newRate) } }()
Metric rates wait for interval for first update
trivago_tgo
train
go
b1788e60109e1298fd275094318cf3878f89d188
diff --git a/grimoire/elk/gerrit.py b/grimoire/elk/gerrit.py index <HASH>..<HASH> 100644 --- a/grimoire/elk/gerrit.py +++ b/grimoire/elk/gerrit.py @@ -75,20 +75,22 @@ class GerritElastic(object): logging.info("Uploading reviews to Elastic Search: %s" % (self.elastic.index_url)) - for item in self.gerrit.get_reviews(): - logging.info("Uploading review") + bulk_json = "" + url = self.elastic.index_url+'/'+elasticsearch_type+'/_bulk' + + for item in self.gerrit.get_reviews(): self._fix_review_dates(item) data_json = json.dumps(item) - url = self.elastic.index_url - url += "/"+elasticsearch_type - url += "/"+str(item["id"]) - requests.put(url, data=data_json) + bulk_json += '{"index" : {"_id" : "%s" } }\n' % (item['id']) + bulk_json += data_json +"\n" # Bulk document - logging.info("Uploading review changes") self.fetch_events(item) + requests.put(url, data=bulk_json) + + @classmethod def get_elastic_mappings(cls):
Use bulk API for uploading reviews to Elastic.
chaoss_grimoirelab-elk
train
py
66b655ef65bef9add71b54e9e0a2a476eee15610
diff --git a/lib/dm-validations/generic_validator.rb b/lib/dm-validations/generic_validator.rb index <HASH>..<HASH> 100644 --- a/lib/dm-validations/generic_validator.rb +++ b/lib/dm-validations/generic_validator.rb @@ -87,6 +87,13 @@ module DataMapper return true end + def ==(other) + self.field_name == other.field_name && + self.if_clause == other.if_clause && + self.unless_clause == other.unless_clause && + self.instance_variable_get(:@options) == other.instance_variable_get(:@options) + end + end # class GenericValidator end # module Validate end # module DataMapper
Added == method to generic validator to prevent exact duplicate validations from getting added.
emmanuel_aequitas
train
rb
e8b667b25d7940bef739c5539debbf3cca154900
diff --git a/ravel.py b/ravel.py index <HASH>..<HASH> 100644 --- a/ravel.py +++ b/ravel.py @@ -1289,7 +1289,7 @@ def def_proxy_interface(kind, introspected, is_async) : proxy._iface_name = introspected.name proxy.__doc__ = \ ( - "proxy for a D-Bus interface named %(iname)s. Instantiate as\n" + "proxy for a %(kind)s D-Bus interface named %(iname)s. Instantiate as\n" "\n" " %(cname)s(conn = «conn»[, dest = «dest»[, timeout = «timeout»]])\n" "\n" @@ -1297,7 +1297,16 @@ def def_proxy_interface(kind, introspected, is_async) : " messages and receiving replies, and «dest» is the destination" \ " bus name for sending method calls (not needed for sending signals)." % - {"iname" : introspected.name, "cname" : class_name} + { + "cname" : class_name, + "iname" : introspected.name, + "kind" : + { + INTERFACE.CLIENT : "client-side", + INTERFACE.SERVER : "server-side", + INTERFACE.CLIENT_AND_SERVER : "client-and-server-side", + }[kind] + } ) if kind != INTERFACE.SERVER : for method in introspected.methods :
mention interface kind in created class docstring
ldo_dbussy
train
py
12d92364591bfee75d477945bf2acd6651916e11
diff --git a/lib/xlsx/xform/simple/date-xform.js b/lib/xlsx/xform/simple/date-xform.js index <HASH>..<HASH> 100644 --- a/lib/xlsx/xform/simple/date-xform.js +++ b/lib/xlsx/xform/simple/date-xform.js @@ -13,7 +13,13 @@ var DateXform = module.exports = function(options) { this.tag = options.tag; this.attr = options.attr; this.attrs = options.attrs; - this._format = options.format || function(dt) { return dt.toISOString(); }; + this._format = options.format || function (dt) { + try { + return dt.toISOString(); + } catch(e) { + return ''; + } + }; this._parse = options.parse || function(str) { return new Date(str); }; };
Issue #<I> Fix Issue #<I> where dt is an invalid time format, catch the exception and return blank string.
exceljs_exceljs
train
js
79d069269b6c17664e31ff92c8e2e8d111982480
diff --git a/sllurp/llrp.py b/sllurp/llrp.py index <HASH>..<HASH> 100644 --- a/sllurp/llrp.py +++ b/sllurp/llrp.py @@ -503,9 +503,15 @@ class LLRPClient (LineReceiver): while data: # parse the message header to grab its length - msg_type, msg_len, message_id = \ - struct.unpack(LLRPMessage.full_hdr_fmt, - data[:LLRPMessage.full_hdr_len]) + try: + msg_type, msg_len, message_id = \ + struct.unpack(LLRPMessage.full_hdr_fmt, + data[:LLRPMessage.full_hdr_len]) + except struct.error as ae: + logger.warning('Too few bytes ({}) to unpack LLRP message' \ + 'header'.format(len(data))) + break + logger.debug('expect {} bytes (have {})'.format(msg_len, len(data))) if len(data) < msg_len:
potentially solve #<I> with an extra check
ransford_sllurp
train
py
8d87584e4074d904e19c67b1350f86f8603ee341
diff --git a/lib/github/ldap/membership_validators/classic.rb b/lib/github/ldap/membership_validators/classic.rb index <HASH>..<HASH> 100644 --- a/lib/github/ldap/membership_validators/classic.rb +++ b/lib/github/ldap/membership_validators/classic.rb @@ -23,8 +23,6 @@ module GitHub # Internal: the group names to look up membership for. # - # FIXME: Hardcoded to CN. - # # Returns an Array of String group names (CNs). def group_names @group_names ||= groups.map { |g| g[:cn].first }
CNs are hardcoded elsewhere
github_github-ldap
train
rb
623f08ed63dd03e277b0d64ce3453b538c7135f4
diff --git a/src/Facades/Helper.php b/src/Facades/Helper.php index <HASH>..<HASH> 100644 --- a/src/Facades/Helper.php +++ b/src/Facades/Helper.php @@ -18,7 +18,7 @@ use Illuminate\Support\Facades\Facade; * * @package Enea\Authorization\Facades * - * @method static \Enea\Authorization\Contracts\Authorizable authenticated(?string $guard = null) + * @method static \Enea\Authorization\Contracts\Authorizable|\Illuminate\Database\Eloquent\Model authenticated(?string $guard = null) * @method static \Enea\Authorization\Authorizer authorizer() * @method static \Illuminate\Support\Collection except(\Illuminate\Support\Collection $grantableCollection, array $exceptNames) *
docs: update phpdocs in Helper facade
eneav_laravel-authorization
train
php
520d9240ddc7fd3a96f289cf4cfa6c8bf3911cba
diff --git a/src/flaskext/assets.py b/src/flaskext/assets.py index <HASH>..<HASH> 100644 --- a/src/flaskext/assets.py +++ b/src/flaskext/assets.py @@ -167,7 +167,7 @@ else: if not self.env: from flask import current_app - self.env = current_app.jinja_env + self.env = current_app.jinja_env.assets_environment from webassets import script return script.main(args, env=self.env)
Fixed command line script support by attempting to guess what the intention of the author was. Abusing jinja_env instead of just picking an attribute name for the assets on the flask instance still seems dirty though.
miracle2k_flask-assets
train
py
d44c28fba0f01bb703b1e32a7cec418508efa818
diff --git a/src/pythonjsonlogger/jsonlogger.py b/src/pythonjsonlogger/jsonlogger.py index <HASH>..<HASH> 100644 --- a/src/pythonjsonlogger/jsonlogger.py +++ b/src/pythonjsonlogger/jsonlogger.py @@ -19,7 +19,7 @@ RESERVED_ATTRS = ( 'args', 'asctime', 'created', 'exc_info', 'exc_text', 'filename', 'funcName', 'levelname', 'levelno', 'lineno', 'module', 'msecs', 'message', 'msg', 'name', 'pathname', 'process', - 'processName', 'relativeCreated', 'thread', 'threadName') + 'processName', 'relativeCreated', 'stack_info', 'thread', 'threadName') RESERVED_ATTR_HASH = dict(zip(RESERVED_ATTRS, RESERVED_ATTRS))
Added "stack_info" as reserved attribute (introduced in Python <I>)
madzak_python-json-logger
train
py
24c92b68ec7b0cbd0a4ad42cf3183c517a0187e9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const store = require('store') const STORE_KEY = 'ipfs-api-address' const defaultState = { - apiAddress: '/ip4/127.0.0.1/tcp/5001' || store.get(STORE_KEY), + apiAddress: store.get(STORE_KEY) || '/ip4/127.0.0.1/tcp/5001', identity: null, error: null, ready: false
store value 1st License: MIT
ipfs-shipyard_ipfs-redux-bundle
train
js
b47c74698a91b2e7b5f4393de25c8e92ed586eac
diff --git a/internal/provider/resource_pet.go b/internal/provider/resource_pet.go index <HASH>..<HASH> 100644 --- a/internal/provider/resource_pet.go +++ b/internal/provider/resource_pet.go @@ -26,7 +26,7 @@ func resourcePet() *schema.Resource { "and new resources exist concurrently.", CreateContext: CreatePet, ReadContext: schema.NoopContext, - Delete: schema.RemoveFromState, + DeleteContext: DeletePet, Schema: map[string]*schema.Schema{ "keepers": { @@ -84,3 +84,8 @@ func CreatePet(_ context.Context, d *schema.ResourceData, meta interface{}) diag return nil } + +func DeletePet(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics { + d.SetId("") + return nil +}
Replace usage of Delete field with DeleteContext in resource_pet (#<I>)
terraform-providers_terraform-provider-random
train
go
21e76106a0b4b41dabbeffb7d0d75c99600d0c4a
diff --git a/tests/HttpExceptionTest.php b/tests/HttpExceptionTest.php index <HASH>..<HASH> 100644 --- a/tests/HttpExceptionTest.php +++ b/tests/HttpExceptionTest.php @@ -42,4 +42,10 @@ class HttpExceptionTest extends \PHPUnit_Framework_TestCase { $httpException = new HttpException($message); $this->assertEquals($message, $httpException->getResponse()->getBody()); } + + public function testCreatesHttpResponseWithCodePassed() + { + $httpException = new HttpException('', HttpCode::BAD_GATEWAY); + $this->assertSame(HttpCode::BAD_GATEWAY, $httpException->getResponse()->getCode()); + } }
Added test for creating HttpResponse with given code in HttpException.
kiler129_CherryHttp
train
php
7d197d41f784a28d7436325478f28947c7a58392
diff --git a/src/Exception/ParseException.php b/src/Exception/ParseException.php index <HASH>..<HASH> 100644 --- a/src/Exception/ParseException.php +++ b/src/Exception/ParseException.php @@ -66,7 +66,7 @@ class ParseException extends \RuntimeException $message = 'JSON parsing failed: ' . $message; - return new static($message, $line, $snippet, JSON_ERROR_SYNTAX, $exception); + return new static($message, $line, $snippet, JSON_ERROR_SYNTAX); } /**
Removed passing jsonlint's exception to ours as previous, it is superfluous.
bolt_common
train
php
7ec9a1f5d2caa437251fafdc5cf764a77ab49ad2
diff --git a/upup/pkg/fi/cloudup/dns.go b/upup/pkg/fi/cloudup/dns.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/cloudup/dns.go +++ b/upup/pkg/fi/cloudup/dns.go @@ -262,6 +262,9 @@ func buildPrecreateDNSHostnames(cluster *kops.Cluster) []string { } for _, etcdCluster := range cluster.Spec.EtcdClusters { + if etcdCluster.Provider == kops.EtcdProviderTypeManager { + continue + } etcClusterName := "etcd-" + etcdCluster.Name if etcdCluster.Name == "main" { // Special case
Dont precreate etcd DNS records if we're using etcd-manager
kubernetes_kops
train
go
b62b5b6c65af63590dee86fd6e6f8be6c3bceea4
diff --git a/src/system/modules/metamodelsattribute_translatedfile/MetaModelAttributeTranslatedFile.php b/src/system/modules/metamodelsattribute_translatedfile/MetaModelAttributeTranslatedFile.php index <HASH>..<HASH> 100644 --- a/src/system/modules/metamodelsattribute_translatedfile/MetaModelAttributeTranslatedFile.php +++ b/src/system/modules/metamodelsattribute_translatedfile/MetaModelAttributeTranslatedFile.php @@ -50,7 +50,7 @@ class MetaModelAttributeTranslatedFile extends MetaModelAttributeTranslatedRefer $objToolbox->setFallbackLanguage($this->getMetaModel()->getFallbackLanguage()); - $objToolbox->setLightboxId($this->getMetaModel()->getTableName() . '.' . $arrRowData['id']); + $objToolbox->setLightboxId($this->getMetaModel()->getTableName() . '.' . $objSettings->id . '.' . $arrRowData['id']); if (strlen($this->get('file_validFileTypes'))) {
Set lightbox link unique, see #4
MetaModels_attribute_translatedfile
train
php
794437e921c8bbafd106aa99819af69293e61574
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -746,7 +746,7 @@ module Sinatra # Load embeded templates from the file; uses the caller's __FILE__ # when no file is specified. def inline_templates=(file=nil) - file = (file.nil? || file == true) ? caller_files.first : file + file = (file.nil? || file == true) ? (caller_files.first || File.expand_path($0)) : file begin app, data =
use $0 for inline templates if caller_files is empty That way sinatra will at least run if you use a file name matching CALLERS_TO_IGNORE as the main app_file.
sinatra_sinatra
train
rb
73b62331f24232718c03617f86718d9925360b58
diff --git a/web/src/test/java/uk/ac/ebi/atlas/acceptance/selenium/pages/HeatmapTablePage.java b/web/src/test/java/uk/ac/ebi/atlas/acceptance/selenium/pages/HeatmapTablePage.java index <HASH>..<HASH> 100755 --- a/web/src/test/java/uk/ac/ebi/atlas/acceptance/selenium/pages/HeatmapTablePage.java +++ b/web/src/test/java/uk/ac/ebi/atlas/acceptance/selenium/pages/HeatmapTablePage.java @@ -101,7 +101,7 @@ public class HeatmapTablePage extends TablePage { @FindBy(id = "anatomogram") private WebElement anatomogram; - @FindBy(css = "#gxaExperimentPageHeatmapCountAndLegend > div > div") + @FindBy(css = ".gxaHeatmapCountAndLegend > div > div") private WebElement diffHeatmapTableLegend; @FindBy(xpath = "id('heatmap-table')/thead/tr[2]/th")
Access heatmap legend by class, not by id
ebi-gene-expression-group_atlas
train
java
8c695c4cfcbc8d6ac4c5a432c3483592f06ad396
diff --git a/src/Pdo/Oci8/Statement.php b/src/Pdo/Oci8/Statement.php index <HASH>..<HASH> 100644 --- a/src/Pdo/Oci8/Statement.php +++ b/src/Pdo/Oci8/Statement.php @@ -334,15 +334,12 @@ class Statement extends PDOStatement $ctorargs = []; } else { $className = $this->fetchClassName; - $ctorargs = $this->fetchCtorArgs; + $ctorargs = $this->fetchCtorArgs ? array_values($this->fetchCtorArgs) : []; } - if ($ctorargs) { - $reflectionClass = new \ReflectionClass($className); - $object = $reflectionClass->newInstanceArgs($ctorargs); - } else { - $object = new $className(); - } + $object = $fetchMode === PDO::FETCH_CLASS + ? (new \ReflectionClass($className))->newInstanceWithoutConstructor() + : new $className(...$ctorargs); } // Format recordsets values depending on options @@ -371,6 +368,10 @@ class Statement extends PDOStatement } } + if ($fetchMode === PDO::FETCH_CLASS && method_exists($object, '__construct')) { + $object->__construct(...$ctorargs); + } + return $object; }
Call constructor after properties set with FETCH_CLASS
yajra_pdo-via-oci8
train
php
560b073d5573b7579456d35d20914e0fee659876
diff --git a/lib/blockdevice.js b/lib/blockdevice.js index <HASH>..<HASH> 100644 --- a/lib/blockdevice.js +++ b/lib/blockdevice.js @@ -22,9 +22,9 @@ function BlockDevice( options ) { this.size = options.size || -1 // Heads per Track (for CHS addressing) - this.hpt = -1 + this.headsPerTrack = -1 // Sectors per Track (for CHS addressing) - this.spt = -1 + this.sectorsPerTrack = -1 // Make 'this.fs' non-enumerable Object.defineProperty( this, 'fs', { @@ -249,11 +249,11 @@ BlockDevice.prototype = { */ getLBA: function( cylinder, head, sector ) { - if( this.hpt < 0 || this.spt < 0 ) + if( this.headsPerTrack < 0 || this.sectorsPerTrack < 0 ) throw new Error( 'Unspecified device geometry' ) - return ( cylinder * this.hpt + head ) * - this.spt + ( sector - 1 ) + return ( cylinder * this.headsPerTrack + head ) * + this.sectorsPerTrack + ( sector - 1 ) },
Updated lib/blockdevice: descriptive prop names - Renamed .hpt -> .headsPerTrack - Renamed .spt -> .sectorsPerTrack
jhermsmeier_node-blockdevice
train
js
75a65fcfd7e4aa5d2dc01d996362eea7a526a637
diff --git a/lib/strongholds.js b/lib/strongholds.js index <HASH>..<HASH> 100644 --- a/lib/strongholds.js +++ b/lib/strongholds.js @@ -267,11 +267,3 @@ module.exports.containerRewards = [ C.RESOURCE_CRYSTAL, C.RESOURCE_LIQUID ]; - -module.exports.upgradePowers = [ - [1],// lvl1 - [1, 1], //lvl2 - [2, 450, 1], //lvl3 - [3, 675, 2025, 1], //lvl4 - [4, 900, 2700, 8100, 1], //lvl5 -];
refact: remove upgrading by invaderCore
screeps_common
train
js
3918b12f7527e12852d33b89211dd58876b395be
diff --git a/hydpy/core/devicetools.py b/hydpy/core/devicetools.py index <HASH>..<HASH> 100644 --- a/hydpy/core/devicetools.py +++ b/hydpy/core/devicetools.py @@ -2235,6 +2235,7 @@ Attribute timegrids of module `pub` is not defined at the moment. for sequence, label, color, linestyle, linewidth in zip( sequences, labels, colors, linestyles, linewidths ): + label_ = label if label else " ".join((self.name, sequence.name)) if stepsize is None: index = _get_pandasindex() ps = pandas.Series(sequence.evalseries, index=index[idx0:idx1]) @@ -2246,11 +2247,13 @@ Attribute timegrids of module `pub` is not defined at the moment. ) period = "15d" if stepsize.startswith("m") else "12h" ps.index += timetools.Period(period).timedelta + ps = ps.rename(columns=dict(series=label_)) ps.plot( - label=label if label else " ".join((self.name, sequence.name)), + label=label_, color=color, linestyle=linestyle, linewidth=linewidth, + ax=pyplot.gca(), ) pyplot.legend() if not focus:
Fix the plotting methods of class `Node` of module `devicetools` (e.g. `plot_allseries`) for the new kind of series returned by function `aggregate_series` of module `seriestools` after commit f6b<I>a<I>e<I>c5c<I>e7eeaf<I>a2aaddac7cdf.
hydpy-dev_hydpy
train
py
898ba6add9ef06bd774ec7849980e79f0d1e7ebb
diff --git a/routing.go b/routing.go index <HASH>..<HASH> 100644 --- a/routing.go +++ b/routing.go @@ -1,6 +1,7 @@ package dht import ( + "math" "sync" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" @@ -127,6 +128,15 @@ func (dht *IpfsDHT) Provide(ctx context.Context, key u.Key) error { return nil } +// FindProviders searches until the context expires. +func (dht *IpfsDHT) FindProviders(ctx context.Context, key u.Key) ([]peer.PeerInfo, error) { + var providers []peer.PeerInfo + for p := range dht.FindProvidersAsync(ctx, key, math.MaxInt32) { + providers = append(providers, p) + } + return providers, nil +} + // FindProvidersAsync is the same thing as FindProviders, but returns a channel. // Peers will be returned on the channel as soon as they are found, even before // the search query completes.
wip with DHT @whyrusleeping @jbenet this is a WIP with the DHT. wip License: MIT
libp2p_go-libp2p-kad-dht
train
go
1fe09ad765676e11c2fecc36d4869e431e5ed181
diff --git a/js/fcoin.js b/js/fcoin.js index <HASH>..<HASH> 100644 --- a/js/fcoin.js +++ b/js/fcoin.js @@ -123,6 +123,7 @@ module.exports = class fcoin extends Exchange { }, 'commonCurrencies': { 'DAG': 'DAGX', + 'PAI': 'PCHAIN', }, }); }
PAI is PCHAIN in fcoin
ccxt_ccxt
train
js
d81763fd73de8e85c793b195c6abee82b372f40e
diff --git a/lib/rfd.rb b/lib/rfd.rb index <HASH>..<HASH> 100644 --- a/lib/rfd.rb +++ b/lib/rfd.rb @@ -178,7 +178,7 @@ module Rfd # Fetch files from current directory. # Then update each windows reflecting the newest information. def ls - fetch_items_from_filesystem + fetch_items_from_filesystem_or_zip sort_items_according_to_current_direction @current_page ||= 0 @@ -238,8 +238,8 @@ module Rfd ls end - # Fetch files from current directory. - def fetch_items_from_filesystem + # Fetch files from current directory or current .zip file. + def fetch_items_from_filesystem_or_zip if in_zip? @items = [Item.new(dir: current_dir, name: '.', stat: File.stat(current_dir), window_width: maxx), Item.new(dir: current_dir, name: '..', stat: File.stat(File.dirname(current_dir)), window_width: maxx)] @@ -330,7 +330,7 @@ module Rfd # .*\.pdf$ : Search PDF files def grep(pattern = '.*') regexp = Regexp.new(pattern) - fetch_items_from_filesystem + fetch_items_from_filesystem_or_zip @items = items.shift(2) + items.select {|i| i.name =~ regexp} sort_items_according_to_current_direction switch_page 0
fetch_items_from_filesystem actually fetches also from .zip file
amatsuda_rfd
train
rb
8e5c9a3979c6f5a41d9307865063db75ec5168f8
diff --git a/Migrations/Migrator.php b/Migrations/Migrator.php index <HASH>..<HASH> 100755 --- a/Migrations/Migrator.php +++ b/Migrations/Migrator.php @@ -20,6 +20,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Collection; use Illuminate\Support\Str; use ReflectionClass; +use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\OutputInterface; class Migrator @@ -726,9 +727,9 @@ class Migrator */ protected function write($component, ...$arguments) { - if ($this->output) { - with(new $component($this->output))->render(...$arguments); - } + with(new $component( + $this->output ?: new NullOutput() + ))->render(...$arguments); } /**
Fixes usage of Migrator without output (#<I>)
illuminate_database
train
php
411be25abaf6dcdcd26a43f3b86a308f245a2500
diff --git a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -99,7 +99,7 @@ class YamlDumper extends Dumper } if ($definition->isDeprecated()) { - $code .= sprintf(" deprecated: %s\n", $definition->getDeprecationMessage('%service_id%')); + $code .= sprintf(" deprecated: %s\n", $this->dumper->dump($definition->getDeprecationMessage('%service_id%'))); } if ($definition->isAutowired()) {
[DI] fix dumping deprecated service in yaml
symfony_symfony
train
php
25da9e207ff096dc5d5762af028a6f36b93164b2
diff --git a/pymc3/smc/smc.py b/pymc3/smc/smc.py index <HASH>..<HASH> 100644 --- a/pymc3/smc/smc.py +++ b/pymc3/smc/smc.py @@ -307,7 +307,7 @@ def logp_forw(point, out_vars, vars, shared): f = aesara_function([inarray0], out_list[0], allow_input_downcast=True) else: f = aesara_function([inarray0], out_list[0]) - f.trust_input = False + f.trust_input = True return f
Reenable trust_input in SMC
pymc-devs_pymc
train
py
8a59f2a459306b779b74a6975568094861706444
diff --git a/test/types.js b/test/types.js index <HASH>..<HASH> 100644 --- a/test/types.js +++ b/test/types.js @@ -7,7 +7,6 @@ describe('All Example Types', function() { it('should load', () => { let types = Types() expect(_.keys(types)).to.have.members([ - '__all', 'bool', 'cardinality', 'date',
__all should not include itself
smartprocure_contexture-elasticsearch
train
js
f5d404cac605f5961b46d665b2be98c2b953b255
diff --git a/src/helpers/ariaAppHider.js b/src/helpers/ariaAppHider.js index <HASH>..<HASH> 100644 --- a/src/helpers/ariaAppHider.js +++ b/src/helpers/ariaAppHider.js @@ -22,11 +22,12 @@ export function resetState() { /* istanbul ignore next */ export function log() { - if (process.env.NODE_ENV === "production") return; - const check = globalElement || {}; - console.log("ariaAppHider ----------"); - console.log(check.nodeName, check.className, check.id); - console.log("end ariaAppHider ----------"); + if (process.env.NODE_ENV !== "production") { + var check = globalElement || {}; + console.log("ariaAppHider ----------"); + console.log(check.nodeName, check.className, check.id); + console.log("end ariaAppHider ----------"); + } } /* eslint-enable no-console */
Wrap NODE_ENV conditional code in block
reactjs_react-modal
train
js
585a2eb0c488dec1a146e665963a617eb9bfc754
diff --git a/src/collectors/processresources/processresources.py b/src/collectors/processresources/processresources.py index <HASH>..<HASH> 100644 --- a/src/collectors/processresources/processresources.py +++ b/src/collectors/processresources/processresources.py @@ -154,10 +154,10 @@ class ProcessResourcesCollector(diamond.collector.Collector): def collect_process_info(self, process): try: pid = process.pid - name = process.name - cmdline = process.cmdline + name = process.name() + cmdline = process.cmdline() try: - exe = process.exe + exe = process.exe() except psutil.AccessDenied: exe = "" for pg_name, cfg in self.processes.items():
BUGFIX: they are functions, not data attributes
python-diamond_Diamond
train
py
0547bed1a591b99c0f7aaef1e919208d110b7c47
diff --git a/mod/forum/backup/moodle2/backup_forum_stepslib.php b/mod/forum/backup/moodle2/backup_forum_stepslib.php index <HASH>..<HASH> 100644 --- a/mod/forum/backup/moodle2/backup_forum_stepslib.php +++ b/mod/forum/backup/moodle2/backup_forum_stepslib.php @@ -51,7 +51,7 @@ class backup_forum_activity_structure_step extends backup_activity_structure_ste $discussion = new backup_nested_element('discussion', array('id'), array( 'name', 'firstpost', 'userid', 'groupid', 'assessed', 'timemodified', 'usermodified', 'timestart', - 'timeend', 'pinned')); + 'timeend', 'pinned', 'timelocked')); $posts = new backup_nested_element('posts');
MDL-<I> mod_forum: Add locked column to the backup table.
moodle_moodle
train
php
da35710bef06c7c3bb530505e481c5c86b5cdf1a
diff --git a/liquibase-core/src/main/java/liquibase/hub/HubUpdater.java b/liquibase-core/src/main/java/liquibase/hub/HubUpdater.java index <HASH>..<HASH> 100644 --- a/liquibase-core/src/main/java/liquibase/hub/HubUpdater.java +++ b/liquibase-core/src/main/java/liquibase/hub/HubUpdater.java @@ -229,8 +229,9 @@ public class HubUpdater { // // Capture the current log level to use for filtering // - java.util.logging.Logger liquibaseLogger = java.util.logging.Logger.getLogger("liquibase"); - Level currentLevel = liquibaseLogger.getLevel(); + HubConfiguration hubConfiguration = LiquibaseConfiguration.getInstance().getConfiguration(HubConfiguration.class); + Level currentLevel = Level.parse(hubConfiguration.getLiquibaseHubLogLevel()); + final HubService hubService = Scope.getCurrentScope().getSingleton(HubServiceFactory.class).getService(); hubService.sendOperationEvent(updateOperation, new OperationEvent() .setEventType("COMPLETE")
Fix one additional call for the logging filter level DAT-<I>
liquibase_liquibase
train
java
d719a2640632014b1687b388c75a0d6261af1675
diff --git a/lib/Predis.php b/lib/Predis.php index <HASH>..<HASH> 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -813,7 +813,7 @@ abstract class RedisServerProfile { } class RedisServer__V1_0 extends RedisServerProfile { - public function getVersion() { return 1.0; } + public function getVersion() { return '1.0'; } public function getSupportedCommands() { return array( /* miscellaneous commands */ @@ -943,7 +943,7 @@ class RedisServer__V1_0 extends RedisServerProfile { } class RedisServer__V1_2 extends RedisServer__V1_0 { - public function getVersion() { return 1.2; } + public function getVersion() { return '1.2'; } public function getSupportedCommands() { return array_merge(parent::getSupportedCommands(), array( /* commands operating on string values */ @@ -980,7 +980,7 @@ class RedisServer__V1_2 extends RedisServer__V1_0 { } class RedisServer__Futures extends RedisServer__V1_2 { - public function getVersion() { return 0; } + public function getVersion() { return 'DEV'; } public function getSupportedCommands() { return array_merge(parent::getSupportedCommands(), array( 'multi' => '\Predis\Commands\Multi',
Switch to string-based versions for RedisServerProfile classes.
imcj_predis
train
php
5e3c5ab6fc9629c5b2acb26901be812c530084e9
diff --git a/src/Navbar.js b/src/Navbar.js index <HASH>..<HASH> 100644 --- a/src/Navbar.js +++ b/src/Navbar.js @@ -46,7 +46,7 @@ class Navbar extends Component { const sidenavLinks = Children.map(children, (link, index) => { const clonedLink = - link.props && link.props.id + link && link.props && link.props.id ? React.cloneElement(link, { ...link.props, id: `sidenav-${link.props.id}`
pre React docs also properly deal with null (which cant be cloned)
react-materialize_react-materialize
train
js
7b7bf14789e018ba6d691d31ec1f7439e04f80ec
diff --git a/runtests.py b/runtests.py index <HASH>..<HASH> 100755 --- a/runtests.py +++ b/runtests.py @@ -3,6 +3,15 @@ import sys import django from django.conf import settings, global_settings as default_settings from django.core.management import execute_from_command_line +from os import path + + +# Give feedback on used versions +sys.stderr.write('Using Python version {0} from {1}\n'.format(sys.version[:5], sys.executable)) +sys.stderr.write('Using Django version {0} from {1}\n'.format( + django.get_version(), + path.dirname(path.abspath(django.__file__))) +) if not settings.configured: if django.VERSION >= (1, 8): @@ -43,6 +52,7 @@ if not settings.configured: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': ':memory:' } }, INSTALLED_APPS = (
Improve runtests to report actual Django/Python versions
django-fluent_django-fluent-contents
train
py
a868bc1ef5a5be147189a309d1cd04215354ea5e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,6 @@ with open(init_path) as read_file: pattern = re.compile(r"^__version__ = ['\"]([^'\"]*)['\"]", re.MULTILINE) version = pattern.search(text).group(1) -# long_description -readme_path = os.path.join(directory, 'README.rst') setuptools.setup( name='ontobio', @@ -23,7 +21,7 @@ setuptools.setup( author_email='cmungall@gmail.com', url='https://github.com/biolink/ontobio', description='Library for working with OBO Library Ontologies and associations', - long_description=long_description, + long_description=open("README.rst").read(), license='BSD', #packages=['ontobio'], packages=setuptools.find_packages(),
get desc from readme.rst
biolink_ontobio
train
py
d835cb690aa4551d92207e572b093bad3ba48948
diff --git a/nodeup/pkg/model/docker.go b/nodeup/pkg/model/docker.go index <HASH>..<HASH> 100644 --- a/nodeup/pkg/model/docker.go +++ b/nodeup/pkg/model/docker.go @@ -472,12 +472,15 @@ func (b *DockerBuilder) Build(c *fi.ModelBuilderContext) error { // Add packages { + count := 0 for i := range dockerVersions { dv := &dockerVersions[i] if !dv.matches(b.Architecture, dockerVersion, b.Distribution) { continue } + count++ + c.AddTask(&nodetasks.Package{ Name: dv.Name, Version: s(dv.Version), @@ -494,6 +497,10 @@ func (b *DockerBuilder) Build(c *fi.ModelBuilderContext) error { // Note we do _not_ stop looping... centos/rhel comprises multiple packages } + + if count == 0 { + glog.Warningf("Did not find docker package for %s %s %s", b.Distribution, b.Architecture, dockerVersion) + } } dockerSemver, err := semver.ParseTolerant(dockerVersion)
nodeup: warn if no docker version matched Helps to understand what went wrong if something went wrong.
kubernetes_kops
train
go
ed37b6840963225628fb9a509e11a3a0f297d897
diff --git a/tests/test_pandas_dataset_distributional_expectations.py b/tests/test_pandas_dataset_distributional_expectations.py index <HASH>..<HASH> 100644 --- a/tests/test_pandas_dataset_distributional_expectations.py +++ b/tests/test_pandas_dataset_distributional_expectations.py @@ -386,6 +386,11 @@ class TestDistributionalExpectations(unittest.TestCase): self.assertDictEqual(out['summary_obj']['observed_partition'], summary_observed_partition) self.assertDictEqual(out['summary_obj']['expected_partition'], summary_expected_partition) + self.assertEqual( + json.dumps(test_df.get_expectations_config()['expectations']), + '[{"expectation_type": "expect_column_to_exist", "kwargs": {"column": "x"}}, {"expectation_type": "expect_column_kl_divergence_to_be_less_than", "kwargs": {"column": "x", "partition_object": {"weights": [0.1, 0.2, 0.4, 0.2, 0.1], "bins": [-Infinity, 0, 1, 2, 3, Infinity]}, "threshold": 0.5}}]' + ) + def test_expect_column_kl_divergence_to_be_less_than_continuous(self): T = [ {
Add check for serialized output from expectations config including Infinity as partition endpoints.
great-expectations_great_expectations
train
py
c159975d6d5a8285b74fcca81590836b1d3306e4
diff --git a/src/renderField.js b/src/renderField.js index <HASH>..<HASH> 100644 --- a/src/renderField.js +++ b/src/renderField.js @@ -8,10 +8,13 @@ export const isRequired = (schema, fieldName) => { } const guessWidget = (fieldSchema) => { - if (fieldSchema.hasOwnProperty('enum')) { + if (fieldSchema.widget) { + return fieldSchema.widget; + } + else if (fieldSchema.hasOwnProperty('enum')) { return 'choice' } - return fieldSchema.widget || fieldSchema.type || 'object' + return fieldSchema.type || 'object' } const renderField = (fieldSchema, fieldName, theme, prefix = '') => {
If widget is specified, it takes prevalence over choice
Limenius_liform-react
train
js
d8d8472528c1542a0aa004a5cb670a43847ddd84
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -109,7 +109,9 @@ gulp.task('styles', function() { // Concatenate And Minify JavaScript gulp.task('scripts', function() { - return gulp.src(['app/scripts/**/*.js', 'app/styleguide/**/*.js']) + var sources = ['app/scripts/**/*.js', + 'app/styleguide/wskComponentHandler.js', 'app/styleguide/**/*.js']; + return gulp.src(sources) .pipe($.concat('main.min.js')) .pipe($.uglify({preserveComments: 'some'})) // Output Files
Ensuring that wskComponentHandler.js comes first in the sources. Fixes a compilation issue.
material-components_material-components-web
train
js
f10cdc8115ce92591479a780890745f44f6dca61
diff --git a/test/openshift-client-test.js b/test/openshift-client-test.js index <HASH>..<HASH> 100644 --- a/test/openshift-client-test.js +++ b/test/openshift-client-test.js @@ -21,6 +21,7 @@ test('openshift client tests', (t) => { t.ok(client.buildconfigs, 'client object should have a buildconfigs object'); t.ok(client.services, 'client object should have a services object'); t.ok(client.deploymentconfigs, 'client object should have a deploymentconfigs object'); + t.ok(client.persistentvolumeclaims, 'client object should have a persistentvolumeclaims object'); t.ok(client.routes, 'client object should have a routes object'); t.end(); });
fix(tests): missing PVC test
nodeshift_openshift-rest-client
train
js
259e586e06c360d3b1615cdf729859e06033a314
diff --git a/nodeconductor/core/routers.py b/nodeconductor/core/routers.py index <HASH>..<HASH> 100644 --- a/nodeconductor/core/routers.py +++ b/nodeconductor/core/routers.py @@ -40,3 +40,16 @@ class SortedDefaultRouter(DefaultRouter): return Response(ret) return APIRoot.as_view() + + def get_default_base_name(self, viewset): + """ + Attempt to automatically determine base name using `get_url_name`. + """ + queryset = getattr(viewset, 'queryset', None) + + if queryset is not None: + get_url_name = getattr(queryset.model, 'get_url_name', None) + if get_url_name is not None: + return get_url_name() + + return super(SortedDefaultRouter, self).get_default_base_name(viewset)
Attempt to automatically determine base name using get_url_name (NC-<I>)
opennode_waldur-core
train
py
254222ab09c04fca54a1541d741fec1838a35813
diff --git a/adapt/engine.py b/adapt/engine.py index <HASH>..<HASH> 100644 --- a/adapt/engine.py +++ b/adapt/engine.py @@ -30,7 +30,7 @@ class IntentDeterminationEngine(pyee.EventEmitter): The IntentDeterminationEngine is a greedy and naive implementation of intent determination. Given an utterance, it uses the Adapt parsing tools to come up with a sorted collection of tagged parses. A valid parse result contains - no overlapping tagged entities, and it's confidence is the sum of the tagged entity confidences, which are + no overlapping tagged entities, and its confidence is the sum of the tagged entity confidences, which are weighted based on the percentage of the utterance (per character) that the entity match represents. This system makes heavy use of generators to enable greedy algorithms to short circuit large portions of @@ -175,7 +175,7 @@ class DomainIntentDeterminationEngine(object): The DomainIntentDeterminationEngine is a greedy and naive implementation of intent determination. Given an utterance, it uses the Adapt parsing tools to come up with a sorted collection of tagged parses. A valid parse result contains no overlapping - tagged entities in a single domain, and it's confidence is the sum of the tagged + tagged entities in a single domain, and its confidence is the sum of the tagged entity confidences, which are weighted based on the percentage of the utterance (per character) that the entity match represents.
Update engine.py (fix typos in docstring)
MycroftAI_adapt
train
py
9c75cf6be1ec2af3e73f96e1b91f435cff9258f0
diff --git a/lib/all.js b/lib/all.js index <HASH>..<HASH> 100644 --- a/lib/all.js +++ b/lib/all.js @@ -11,15 +11,20 @@ module.exports = function(Promise) { return Promise.resolve(result); } return new Promise(function(resolve, reject) { - util.forEach(array, function(promised, index) { - promised.then(function(value) { + util.forEach(array, function(p, index) { + if (p instanceof Promise) { + p._queue.resolve(callResolve); + p._queue.catch(reject); + p._resume(); + } else { + p.then(callResolve, reject); + } + function callResolve(value) { result[index] = value; if (--size === 0) { resolve(result); } - }, function(reason) { - reject(reason); - }); + } }); }); }; diff --git a/test/lib/test.all.js b/test/lib/test.all.js index <HASH>..<HASH> 100644 --- a/test/lib/test.all.js +++ b/test/lib/test.all.js @@ -69,7 +69,7 @@ parallel('#Promise#all', () => { }, DELAY * (limit - n)); }); }); - return Promise.all(tasks) + return global.Promise.all(tasks) .then(res => { assert.deepEqual(res, [0, 1, 2, 3, 4]); assert.deepEqual(order, [4, 3, 2, 1, 0]);
perf(all): improve performance
suguru03_aigle
train
js,js
e91bac16594cd14edf49c11cf4a523d6bc920fa5
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -5,9 +5,9 @@ import ( "fmt" log "github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus/hooks/syslog" + "github.com/SpringerPE/firehose-to-syslog/token" "github.com/cloudfoundry/noaa" "github.com/cloudfoundry/noaa/events" - "github.com/malston/firehose-to-syslog/token" "gopkg.in/alecthomas/kingpin.v1" "io/ioutil" "log/syslog" @@ -142,7 +142,7 @@ func CounterEvents(in chan *events.Envelope) { "delta": evt.GetDelta(), "total": evt.GetTotal(), "event_type": "CounterEvent", - }).Info(evt.String()) + }).Info("") } }
Changed import back to use SpringerPE
cloudfoundry-community_firehose-to-syslog
train
go
798c3c59897664cde2963602d94fec70e37ddd8d
diff --git a/Validator/Constraints/Enum.php b/Validator/Constraints/Enum.php index <HASH>..<HASH> 100644 --- a/Validator/Constraints/Enum.php +++ b/Validator/Constraints/Enum.php @@ -22,9 +22,7 @@ use Symfony\Component\Validator\Constraints\Choice; */ class Enum extends Choice { - /** - * @var string - */ + /** @var string */ public $entity; /** @@ -32,6 +30,8 @@ class Enum extends Choice */ public function __construct($options = null) { + $this->strict = true; + if (isset($options['entity'])) { /** @var AbstractEnumType $entity */ $entity = $options['entity'];
Set `strict` option of Enum constraint to true
fre5h_DoctrineEnumBundle
train
php
081db9386da14cbdc03979361b964d32824dd7cc
diff --git a/lib/initializeAcl.js b/lib/initializeAcl.js index <HASH>..<HASH> 100644 --- a/lib/initializeAcl.js +++ b/lib/initializeAcl.js @@ -52,7 +52,7 @@ module.exports = function AclInitialiser() { const AclUserModel = mongoose.model("TransomAclUser"); const newUser = new AclUserModel({ - email: server.registry.get('transom-options.administrator_email', 'administrator@localhost'), + email: server.registry.get('transom-config.administrator_email', 'administrator@localhost'), username: 'administrator', display_name: 'Administrator', groups: [sysAdminGroup],
renamed options to config
transomjs_transom-mongoose-localuser
train
js
eab1a93a4e0a416b8962ad0a10b5f3ecd7a4ed7f
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/explorerNavHandler.js b/bundles/org.eclipse.orion.client.core/web/orion/explorerNavHandler.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/explorerNavHandler.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/explorerNavHandler.js @@ -504,6 +504,7 @@ exports.ExplorerNavHandler = (function() { } if(!this._modelIterator.topLevel(curModel)){ this.cursorOn(curModel.parent); + this.setSelection(curModel.parent, false); //The cursor is now on a top level item which is collapsed. We need to ask the explorer is it wants to scope up. } else if (this.explorer.scopeUp && typeof this.explorer.scopeUp === "function"){ //$NON-NLS-0$ this.explorer.scopeUp();
Selection model: left arrow key not only set curosor but also set selection.
eclipse_orion.client
train
js
c4c72db9c998a30441c5f48e5863d5765cead8ba
diff --git a/modules/custom/activity_basics/src/Plugin/ActivityContext/ProfileActivityContext.php b/modules/custom/activity_basics/src/Plugin/ActivityContext/ProfileActivityContext.php index <HASH>..<HASH> 100644 --- a/modules/custom/activity_basics/src/Plugin/ActivityContext/ProfileActivityContext.php +++ b/modules/custom/activity_basics/src/Plugin/ActivityContext/ProfileActivityContext.php @@ -40,6 +40,8 @@ class ProfileActivityContext extends ActivityContextBase { public function isValidEntity($entity) { // Special cases for comments. if ($entity->getEntityTypeId() === 'comment') { + $comment_owner_id = $entity->getOwnerId(); + // Returns the entity to which the comment is attached. $entity = $entity->getCommentedEntity(); } @@ -57,6 +59,10 @@ class ProfileActivityContext extends ActivityContextBase { return FALSE; } elseif (!empty($entity->get('field_recipient_user')->getValue())) { + if (isset($comment_owner_id)) { + return $comment_owner_id !== $entity->field_recipient_user->target_id; + } + return TRUE; } }
Issue #<I> by chmez: Check if comment owner and post recipient are the same.
goalgorilla_open_social
train
php
b15814e3533348a98bbc8403e816ad531fe0a79a
diff --git a/grimoire_elk/enriched/utils.py b/grimoire_elk/enriched/utils.py index <HASH>..<HASH> 100755 --- a/grimoire_elk/enriched/utils.py +++ b/grimoire_elk/enriched/utils.py @@ -54,7 +54,7 @@ def get_repository_filter(perceval_backend, perceval_backend_name, term=False): return filter_ field = 'origin' - value = perceval_backend.origin + value = anonymize_url(perceval_backend.origin) if perceval_backend_name in ["meetup", "nntp", "stackexchange", "jira"]: # Until tag is supported in all raw and enriched indexes
[enriched-utils] Remove credentials for repository filter This code omits the credentials that may appear on the repo origin (e.g., git private repos) when creating the filter to get the data from the corresponding raw index.
chaoss_grimoirelab-elk
train
py
6079e83400f81277efae89515be55fccd9696a2a
diff --git a/test/totalMemory-test.js b/test/totalMemory-test.js index <HASH>..<HASH> 100644 --- a/test/totalMemory-test.js +++ b/test/totalMemory-test.js @@ -2,7 +2,9 @@ var tape = require("tape"); var jsdom = require("./jsdom"); var d3_graphviz = require("../"); -tape("totalMemory() sets the total memory available to Viz.js.", function(test) { +// Remove when decided if the totalMemory option is needed with @hpcc-js-wasm or not +//tape("totalMemory() sets the total memory available to Viz.js.", function(test) { +tape.skip("totalMemory() sets the total memory available to Viz.js.", function(test) { var window = global.window = jsdom('<div id="graph"></div>'); var document = global.document = window.document; var graphviz = d3_graphviz.graphviz("#graph");
Temporarliy skip totalMemory test until decided if needed or not
magjac_d3-graphviz
train
js
6fe63a217fc650be5b6d3b65d143d0449f90bd15
diff --git a/framework/web/View.php b/framework/web/View.php index <HASH>..<HASH> 100644 --- a/framework/web/View.php +++ b/framework/web/View.php @@ -373,7 +373,7 @@ class View extends \yii\base\View if (empty($depends)) { $this->cssFiles[$key] = Html::cssFile($url, $options); } else { - $am = Yii::$app->getAssetManager(); + $am = $this->getAssetManager(); $am->bundles[$key] = new AssetBundle([ 'css' => [Url::to($url)], 'cssOptions' => $options, @@ -435,7 +435,7 @@ class View extends \yii\base\View unset($options['position']); $this->jsFiles[$position][$key] = Html::jsFile($url, $options); } else { - $am = Yii::$app->getAssetManager(); + $am = $this->getAssetManager(); $am->bundles[$key] = new AssetBundle([ 'js' => [Url::to($url)], 'jsOptions' => $options,
view did not use the correct assetmanager
yiisoft_yii2
train
php
d7da3bd17fc32b9057ed039abd05c5f2faf68b6c
diff --git a/master/buildbot/www/service.py b/master/buildbot/www/service.py index <HASH>..<HASH> 100644 --- a/master/buildbot/www/service.py +++ b/master/buildbot/www/service.py @@ -14,6 +14,7 @@ # Copyright Buildbot Team Members from __future__ import absolute_import +from __future__ import division from __future__ import print_function from future.utils import iteritems @@ -350,7 +351,7 @@ class WWWService(service.ReconfigurableServiceMixin, service.AsyncMultiService): # and other runs of this master # we encode that in hex for db storage convenience - return hexlify(os.urandom(SESSION_SECRET_LENGTH / 8)) + return hexlify(os.urandom(int(SESSION_SECRET_LENGTH / 8))) session_secret = yield state.atomicCreateState(objectid, "session_secret", create_session_secret) self.site.setSessionSecret(session_secret)
In Python 3, division returns a float, but os.urandom() needs an int.
buildbot_buildbot
train
py
a9522e0366811af239274c6f6f3bddd608b56a1f
diff --git a/client/lib/discounts/active-discounts.js b/client/lib/discounts/active-discounts.js index <HASH>..<HASH> 100644 --- a/client/lib/discounts/active-discounts.js +++ b/client/lib/discounts/active-discounts.js @@ -56,20 +56,16 @@ export default [ 'Improve your SEO, branding, credibility, and even word-of-mouth marketing with a custom domain. All plan upgrades include a free domain name of your choice.', }, { - name: 'september20', - startsAt: new Date( 2018, 8, 6, 0, 0, 0 ), - endsAt: new Date( 2018, 8, 21, 0, 0, 0 ), - nudgeText: translate( '%(discount)d%% Off All Plans', { - args: { - discount: 20, - }, - } ), + name: 'october10', + startsAt: new Date( 2018, 9, 6, 0, 0, 0 ), + endsAt: new Date( 2018, 9, 11, 0, 0, 0 ), + nudgeText: 'One-Day Flash Sale 20% Off', ctaText: translate( 'Upgrade' ), plansPageNoticeText: translate( 'Enter coupon code “%(coupon)s” during checkout to claim your %(discount)d%% discount.', { args: { - coupon: 'SEPTEMBER20', + coupon: 'OCTOBERFLASH', discount: 20, }, }
[Marketing discounts] Add October<I> flash sale discount (#<I>)
Automattic_wp-calypso
train
js
99a27164a0f49b51020510aabfe1a08be747ac75
diff --git a/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java b/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java index <HASH>..<HASH> 100644 --- a/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java +++ b/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java @@ -74,7 +74,8 @@ public class NavigationReactGateway implements ReactGateway { } public void onActivityResult(int requestCode, int resultCode, Intent data) { - getReactInstanceManager().onActivityResult(requestCode, resultCode, data); + Activity currentActivity = getReactInstanceManager().getCurrentReactContext().getCurrentActivity(); + getReactInstanceManager().onActivityResult(currentActivity, requestCode, resultCode, data); } public ReactNativeHost getReactNativeHost() {
Retrieve current activity from reactInstanceManager in order to listen to onActivityResult interface change in RN<I> or above.
wix_react-native-navigation
train
java
5d556ac309db22b5d68cd7e3a89caf0673f7092a
diff --git a/lib/active_shipping/rate_estimate.rb b/lib/active_shipping/rate_estimate.rb index <HASH>..<HASH> 100644 --- a/lib/active_shipping/rate_estimate.rb +++ b/lib/active_shipping/rate_estimate.rb @@ -101,7 +101,7 @@ module ActiveShipping self.delivery_date = @delivery_range.last self.insurance_price = options[:insurance_price] self.delivery_category = options[:delivery_category] - self.shipment_options = options[:shipment_options] + self.shipment_options = options[:shipment_options] || [] end # The total price of the shipments in cents.
default shipment_options to empty array
Shopify_active_shipping
train
rb