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
1574c8d2a77270cf4c8ed835510e820b9be5d5dc
diff --git a/public_html/profiles/social/modules/social_features/social_post/src/Form/PostForm.php b/public_html/profiles/social/modules/social_features/social_post/src/Form/PostForm.php index <HASH>..<HASH> 100644 --- a/public_html/profiles/social/modules/social_features/social_post/src/Form/PostForm.php +++ b/public_html/profiles/social/modules/social_features/social_post/src/Form/PostForm.php @@ -8,6 +8,7 @@ namespace Drupal\social_post\Form; use Drupal\Core\Entity\ContentEntityForm; +use Drupal\Core\Entity\Entity\EntityFormDisplay; use Drupal\Core\Form\FormStateInterface; /** @@ -31,6 +32,14 @@ class PostForm extends ContentEntityForm { if (isset($display)) { $this->setFormDisplay($display, $form_state); } + else { + $visibility_value = $this->entity->get('field_visibility')->value; + $display_id = ($visibility_value === '0') ? 'post.post.profile' : 'post.post.default'; + $display = EntityFormDisplay::load($display_id); + // Set the custom display in the form. + $this->setFormDisplay($display, $form_state); + } + if (isset($display) && ($display_id = $display->get('id'))) { if ($display_id === 'post.post.default') { // Set default value to community.
DS-<I> by jochemvn: Set display id for visibility settings and fetch display from EntityFormDisplay
goalgorilla_open_social
train
php
2b0404d0b358275cded52e7a78411e53e840ef27
diff --git a/analyzere/resources.py b/analyzere/resources.py index <HASH>..<HASH> 100644 --- a/analyzere/resources.py +++ b/analyzere/resources.py @@ -66,8 +66,7 @@ class Treaty(EmbeddedResource): # Layers class Fee(EmbeddedResource): - def ref(self): - return {'ref': ['layer', 'fees', self.name]} + pass class FeeReference(EmbeddedResource): @@ -79,10 +78,6 @@ class FeeReference(EmbeddedResource): LOSSES = {'ref': ['layer', 'losses']} @staticmethod - def from_fee_name(fee_name): - return {'ref': ['layer', 'fees', fee_name]} - - @staticmethod def from_fee(fee): return {'ref': ['layer', 'fees', fee.name]}
Remove helper functions other than FeeReference.from_fee
analyzere_analyzere-python
train
py
933b28f94efc7a24a79ebd48b65fc066c4a47786
diff --git a/message.go b/message.go index <HASH>..<HASH> 100644 --- a/message.go +++ b/message.go @@ -220,7 +220,7 @@ func (m *Message) LastEdited() time.Time { // IsForwarded says whether message is forwarded copy of another // message or not. func (m *Message) IsForwarded() bool { - return m.OriginalChat != nil + return m.OriginalSender != nil || m.OriginalChat != nil } // IsReply says whether message is a reply to another message.
fixed IsForwarded() reverts a tiny change from dbc2cd7f6, we need to check both fields because: - m.OriginalChat is nil when message is not forwarded from a channel - m.OriginalSender can be nil if the message is forwarded from a channel (doc: <URL>)
tucnak_telebot
train
go
c35e4d4f6a87e879f96739f7209d550e21c46e07
diff --git a/werkzeug/debug/shared/debugger.js b/werkzeug/debug/shared/debugger.js index <HASH>..<HASH> 100644 --- a/werkzeug/debug/shared/debugger.js +++ b/werkzeug/debug/shared/debugger.js @@ -185,11 +185,12 @@ function openShell(consoleNode, target, frameID) { var command = $('<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">') .appendTo(form) .keydown(function(e) { - if (e.charCode == 100 && e.ctrlKey) { + if (e.key == 'l' && e.ctrlKey) { output.text('--- screen cleared ---'); return false; } else if (e.charCode == 0 && (e.keyCode == 38 || e.keyCode == 40)) { + // handle up arrow and down arrow if (e.keyCode == 38 && historyPos > 0) historyPos--; else if (e.keyCode == 40 && historyPos < history.length)
Clear Console with CtrlL
pallets_werkzeug
train
js
a146986632a2ba902fc0e938fa4619ca3edfe92d
diff --git a/lib/statistrano/deployment/branches.rb b/lib/statistrano/deployment/branches.rb index <HASH>..<HASH> 100644 --- a/lib/statistrano/deployment/branches.rb +++ b/lib/statistrano/deployment/branches.rb @@ -24,13 +24,6 @@ module Statistrano config.post_deploy_task = "#{@name}:generate_index" end - # define certain things that an action - # depends on - # @return [Void] - def prepare_for_action - super - end - # output a list of the releases in manifest # @return [Void] def list_releases
rm redundant method in Deployment::Branches
mailchimp_statistrano
train
rb
bd19262562af0816747944c239c86c4e944de72f
diff --git a/src/main/java/com/phonedeck/gcm4j/DefaultGcm.java b/src/main/java/com/phonedeck/gcm4j/DefaultGcm.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/phonedeck/gcm4j/DefaultGcm.java +++ b/src/main/java/com/phonedeck/gcm4j/DefaultGcm.java @@ -92,7 +92,6 @@ public class DefaultGcm implements Gcm { private static ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(Include.NON_DEFAULT); - objectMapper.enable(SerializationFeature.INDENT_OUTPUT); return objectMapper; }
Ensure whitespace is removed when marshalling to send to Gcm.
phonedeck_gcm4j
train
java
ca8df95546ba04c45678d6fb764927baaa05e32f
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php index <HASH>..<HASH> 100644 --- a/core/Plugin/Visualization.php +++ b/core/Plugin/Visualization.php @@ -445,12 +445,18 @@ class Visualization extends ViewDataTable continue; } + $valueToConvert = false; + if (property_exists($this->requestConfig, $name)) { - $javascriptVariablesToSet[$name] = $this->convertForJson($this->requestConfig->$name); + $valueToConvert = $this->requestConfig->$name; } else if (property_exists($this->config, $name)) { - $javascriptVariablesToSet[$name] = $this->convertForJson($this->config->$name); + $valueToConvert = $this->config->$name; } else if (property_exists($this, $name)) { - $javascriptVariablesToSet[$name] = $this->convertForJson($this->$name); + $valueToConvert = $this->$name; + } + + if (false !== $valueToConvert) { + $javascriptVariablesToSet[$name] = $this->convertForJson($valueToConvert); } }
do not send variables to client having value false
matomo-org_matomo
train
php
bf39fba083ff71430ac6a204b4edf3ade1b92194
diff --git a/src/component/entity-form.js b/src/component/entity-form.js index <HASH>..<HASH> 100644 --- a/src/component/entity-form.js +++ b/src/component/entity-form.js @@ -1,5 +1,6 @@ -import {customElement, bindable} from 'aurelia-framework'; +import {customElement, bindable, computedFrom} from 'aurelia-framework'; import {resolvedView} from 'aurelia-view-manager'; +import {Metadata} from '../Metadata'; @resolvedView('spoonx/form', 'entity-form') @customElement('entity-form') @@ -11,18 +12,21 @@ export class EntityForm { @bindable skip = []; - attached() { - let types = this.entity.getMeta().metadata.types; + @computedFrom('entity') + get elements() { + let types = this.entity.getMeta().metadata.types; + let fields = Metadata.forTarget(this.entity).fetch('fields'); - this.elements = Object.keys(types).map(field => { + return Object.keys(types).map(field => { return { element: types[field], - field : field + field : field, + meta : fields[field] } }); } - isVisible (fieldName) { + isVisible(fieldName) { return this.skip.indexOf(fieldName) === -1; } }
refactor(entity-form): use metadata in form generation
SpoonX_aurelia-form
train
js
e8df79c3c2e4f1a72ba035691fd786fb87e139e1
diff --git a/lib/node.js b/lib/node.js index <HASH>..<HASH> 100644 --- a/lib/node.js +++ b/lib/node.js @@ -328,6 +328,24 @@ var node = module.exports = { }); }, + removeLabel: function(node, label, callback) { + if (Array.isArray(node)) { + var txn = this._safeBatch(); + async.map(node, naan.ncurry(txn.removeLabel, label, 1), callback); + return this._safeBatchCommit(txn); + } + + var id = this._getId(node); + if (!this._isValidId(id)) return callback(new Error("Invalid ID")); + + var endpoint = util.format('%s/labels/%s', this._nodeRoot(id), label); + var op = this.operation(endpoint, 'DELETE'); + this.call(op, function(err) { + if (err) callback(err); + else callback(); + }); + }, + nodesWithLabel: function(label, callback) { var endpoint = util.format('label/%s/nodes', label); var op = this.operation(endpoint, 'GET');
labels: implemented removing a label from a node
brikteknologier_seraph
train
js
4b45a47a5fe04616b30c649a82379ceca63416f6
diff --git a/go/vt/vttest/vtprocess.go b/go/vt/vttest/vtprocess.go index <HASH>..<HASH> 100644 --- a/go/vt/vttest/vtprocess.go +++ b/go/vt/vttest/vtprocess.go @@ -221,6 +221,7 @@ func VtcomboProcess(env Environment, args *Config, mysql MySQLManager) *VtProces "-mycnf_server_id", "1", "-mycnf_socket_file", socket, "-normalize_queries", + "-enable_query_plan_field_caching=false", }...) vt.ExtraArgs = append(vt.ExtraArgs, QueryServerArgs...)
disable field caching in vttestserver
vitessio_vitess
train
go
b0cd95be6096bb4ae1c38f2e0909c773599f6143
diff --git a/inotify_test.go b/inotify_test.go index <HASH>..<HASH> 100644 --- a/inotify_test.go +++ b/inotify_test.go @@ -332,6 +332,8 @@ func TestInotifyInnerMapLength(t *testing.T) { _ = <-w.Events // consume Remove event <-time.After(50 * time.Millisecond) // wait IN_IGNORE propagated + w.mu.Lock() + defer w.mu.Unlock() if len(w.watches) != 0 { t.Fatalf("Expected watches len is 0, but got: %d, %v", len(w.watches), w.watches) }
inotify: fix race in test
fsnotify_fsnotify
train
go
b53a910edc66120b84378bff624e7bfcebc18a15
diff --git a/paginationlinks/templatetags/pagination_links.py b/paginationlinks/templatetags/pagination_links.py index <HASH>..<HASH> 100644 --- a/paginationlinks/templatetags/pagination_links.py +++ b/paginationlinks/templatetags/pagination_links.py @@ -1,8 +1,15 @@ +import django from django import template register = template.Library() +if django.VERSION >= (1, 9): + assignment_tag = register.simple_tag +else: + assignment_tag = register.assignment_tag + + class PageNumber(object): def __init__(self, number, current): # We're given zero indexed numbers @@ -20,7 +27,7 @@ class PageNumber(object): return self.number is None -@register.assignment_tag +@assignment_tag def get_pagination_links(paginator, page_obj, on_each_side=1, on_ends=1): page_num = page_obj.number - 1
Avoid assignment_tag warning in Django <I>
developersociety_django-paginationlinks
train
py
9c28e6146a6eb1572e631309fdfa431bbcf9a318
diff --git a/src/mesh/geometry/Geometry.js b/src/mesh/geometry/Geometry.js index <HASH>..<HASH> 100644 --- a/src/mesh/geometry/Geometry.js +++ b/src/mesh/geometry/Geometry.js @@ -1,4 +1,5 @@ import Attribute from './Attribute'; +import Buffer from './Buffer'; import GeometryStyle from './GeometryStyle'; import GeometryData from './GeometryData'; @@ -16,14 +17,32 @@ class Geometry addAttribute(id, buffer, size = 2, stride = 0, start = 0, normalised = false) { + // check if this is a buffer! + if(!buffer.data) + { + // its an array! + buffer = new Buffer(buffer); + } + this.style.addAttribute(id, new Attribute(buffer.id, size, stride, start, normalised)); this.data.add(buffer.id, buffer); return this; } + getAttribute(id) + { + return this.data[ this.style.attributes[id].buffer ]; + } + addIndex(buffer) { + if(!buffer.data) + { + // its an array! + buffer = new Buffer(buffer); + } + this.data.addIndex(buffer); return this;
create the buffer automatically is an array is passed
pixijs_pixi.js
train
js
94bd114fc5848ec130497d0e40ef7c96e7f14696
diff --git a/src/Result/AllPlayersResult.php b/src/Result/AllPlayersResult.php index <HASH>..<HASH> 100644 --- a/src/Result/AllPlayersResult.php +++ b/src/Result/AllPlayersResult.php @@ -1,6 +1,8 @@ <?php namespace MiniGame\Result; -interface AllPlayersResult +use MiniGame\GameResult; + +interface AllPlayersResult extends GameResult { }
all players result is a game result
remi-san_mini-game
train
php
cde96083f0fbfe439bfef1c22ca78dcd10f4728d
diff --git a/settings.py b/settings.py index <HASH>..<HASH> 100644 --- a/settings.py +++ b/settings.py @@ -27,4 +27,4 @@ class git(): repo_prefix = 'git@github.com:' repo_suffix = 'mit-probabilistic-computing-project/tabular-predDB.git' repo = repo_prefix + repo_suffix - branch = 'multinomial-integration' + branch = 'master'
default branch to user on server is master
probcomp_crosscat
train
py
a19eff0c573d808fed867f31b506f385b0c7e2cc
diff --git a/src/ui.js b/src/ui.js index <HASH>..<HASH> 100644 --- a/src/ui.js +++ b/src/ui.js @@ -105,10 +105,15 @@ base.exportTo('ui', function() { return el; } - // f.name is not directly writable. So make it writable anyway. - Object.defineProperty( - f, 'name', - {value: tagName, writable: false, configurable: false}); + try { + // f.name is not directly writable. So make it writable anyway. + Object.defineProperty( + f, 'name', + {value: tagName, writable: false, configurable: false}); + } catch (e) { + // defineProperty throws a TypeError about name already being defined + // although, it also correctly sets the value to tagName. + } /** * Decorates an element as a UI element class.
Handle type error on Object.defineProperty. Calling the defineProperty for f.name is causing a 'TypeError: Cannot redefine property: name' error to be thrown when running chrome://tracing. This CL catches and ignores the error as it appears that the value is correclty begin set. BUG= R=<EMAIL> Review URL: <URL>
catapult-project_catapult
train
js
79b5e81ffe4e298ced53b2a127723b9c73ad2c78
diff --git a/purell.go b/purell.go index <HASH>..<HASH> 100644 --- a/purell.go +++ b/purell.go @@ -43,7 +43,7 @@ const ( FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah (not included in any convenience set at the moment) + // submitted by jehiah FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147
fix comment for newer flags, now included in FlagsAll*
PuerkitoBio_purell
train
go
c59b189bfac0c1442f8143c0d4151ad59fff08e9
diff --git a/test/hobo/env_test.rb b/test/hobo/env_test.rb index <HASH>..<HASH> 100644 --- a/test/hobo/env_test.rb +++ b/test/hobo/env_test.rb @@ -24,16 +24,17 @@ class EnvTest < Test::Unit::TestCase assert_equal file, Hobo::Env::CONFIG.keys.first { :setting => 1 } end - assert_equal Hobo::Config.settings.setting, 1 + assert_equal Hobo::Config.settings.setting, 1 end end - #TODO Expectations will fail if .hobo dir is present def dir_expectations + File.expects(:exists?).times(Hobo::Env::ENSURE[:dirs].length).returns(false) Dir.expects(:mkdir).times(Hobo::Env::ENSURE[:dirs].length).returns nil end def file_expectations + File.expects(:exists?).times(Hobo::Env::ENSURE[:files].length).returns(false) File.expects(:copy).times(Hobo::Env::ENSURE[:files].length) end end
Fixed hobo dir tests to work even if the dir is already present
hashicorp_vagrant
train
rb
4011ca382041bdf11644d578665e4f5bf2e8d571
diff --git a/code/RegistryImportFeed.php b/code/RegistryImportFeed.php index <HASH>..<HASH> 100644 --- a/code/RegistryImportFeed.php +++ b/code/RegistryImportFeed.php @@ -67,6 +67,10 @@ class RegistryImportFeed_Entry extends ViewableData { } class RegistryImportFeed_Controller extends Controller { + private static $allowed_actions = array( + 'latest' + ); + public static $url_handlers = array( '$Action/$ModelClass' => 'handleAction', );
BUGFIX: Add allowed_actions to RegistryImportFeed_Controller (fixes CWPBUG-<I>)
silverstripe_silverstripe-registry
train
php
31387a61a3d9c111ed7dc8b282493ee93a52b4d8
diff --git a/cmd/format/format.go b/cmd/format/format.go index <HASH>..<HASH> 100644 --- a/cmd/format/format.go +++ b/cmd/format/format.go @@ -29,6 +29,9 @@ var directory = new(string) // map holds all of the filenames and a count to account for duplicates var filenameCount = make(map[string]int) +// characters to strip from the output file name (these are mostly non-permitted windows chars) +var stripChars = [9]string{"\\", "\"", "/", ":", "*", "?","<",">","|"} + // Parse arguments from the command line. // To run the script: "go run format.go -f filename -d directory" func parseArgs() int { @@ -81,6 +84,11 @@ func applyNamingConv(file []byte, filename string) error { name += "_" + strconv.Itoa(filenameCount[name]) } + //Strip any invalid chars from the name + for _,char := range stripChars { + name = strings.Replace(name, char, "_", -1) + } + // Finally, rename the file err = os.Rename(*directory+"/"+filename, *directory+"/"+name+".crt") if err != nil {
Strip chars from the filename for certs that are not allowed on windows
cloudflare_cfssl_trust
train
go
a223f24cd69c9c0a403b18cc03b3ab56891c125b
diff --git a/impact_functions/core.py b/impact_functions/core.py index <HASH>..<HASH> 100644 --- a/impact_functions/core.py +++ b/impact_functions/core.py @@ -178,7 +178,7 @@ def requirement_check(params, require_str, verbose=False): msg = ('Error in plugin requirements' 'Must not use Python keywords as params: %s' % (key)) #print msg - logger.error(msg) + #logger.error(msg) return False if key in excluded_keywords: @@ -205,7 +205,7 @@ def requirement_check(params, require_str, verbose=False): msg = ('Requirements header could not compiled: %s. ' 'Original message: %s' % (execstr, e)) #print msg - logger.error(msg) + #logger.error(msg) return False
Commented logging out - until we get it to work properly
inasafe_inasafe
train
py
f5feb3ab70cc478c848631d0dce59f7bacd57747
diff --git a/kernel/classes/eznodeviewfunctions.php b/kernel/classes/eznodeviewfunctions.php index <HASH>..<HASH> 100644 --- a/kernel/classes/eznodeviewfunctions.php +++ b/kernel/classes/eznodeviewfunctions.php @@ -320,7 +320,16 @@ class eZNodeviewfunctions { // $contents = $cacheFile->fetchContents(); $contents = file_get_contents( $file ); - $Result = unserialize( $contents ); + $Result = @unserialize( $contents ); + + // This should only happen when : + // - the node does not exists + // - the object does not exists + // - the node / object are not readable / invisible + if( !$Result ) + { + $cacheExpired = true; + } // Check if cache has expired when cache_ttl is set $cacheTTL = isset( $Result['cache_ttl'] ) ? $Result['cache_ttl'] : -1; @@ -459,4 +468,4 @@ class eZNodeviewfunctions } } -?> \ No newline at end of file +?>
- Fixed a bug with ezfs2 and permission system # When we access a node that is not readable the cache # file generation was lost git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
6a14a9814e383b8a10d80ac1c8877b6c3048ed53
diff --git a/packages/ember-runtime/lib/mixins/promise_proxy.js b/packages/ember-runtime/lib/mixins/promise_proxy.js index <HASH>..<HASH> 100644 --- a/packages/ember-runtime/lib/mixins/promise_proxy.js +++ b/packages/ember-runtime/lib/mixins/promise_proxy.js @@ -34,7 +34,7 @@ function tap(proxy, promise) { } /** - A low level mixin making ObjectProxy, ObjectController or ArrayController's promise aware. + A low level mixin making ObjectProxy, ObjectController or ArrayControllers promise-aware. ```javascript var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin);
[DOC release] Fix tiny grammar mistakes in Ember.PromiseProxy docs
emberjs_ember.js
train
js
c44c4f02086f8687de6673d965cc920332eb510d
diff --git a/heron/statemgrs/src/python/zkstatemanager.py b/heron/statemgrs/src/python/zkstatemanager.py index <HASH>..<HASH> 100644 --- a/heron/statemgrs/src/python/zkstatemanager.py +++ b/heron/statemgrs/src/python/zkstatemanager.py @@ -93,6 +93,11 @@ class ZkStateManager(StateManager): ret["result"] = data try: + # Ensure the topology path exists. If a topology has never been deployed + # then the path will not exist so create it and don't crash. + # (fixme) add a watch instead of creating the path? + self.client.ensure_path(self.get_topologies_path()) + self._get_topologies_with_watch(callback, isWatching) except NoNodeError: self.client.stop()
[ISSUE-<I>] fix tracker crash when zk root topologies path does not … (#<I>) * [ISSUE-<I>] fix tracker crash when zk root topologies path does not exist. * Fix checksytle.
apache_incubator-heron
train
py
5e09da1298f59825ea8ab745bd6f99f14b825673
diff --git a/image.go b/image.go index <HASH>..<HASH> 100644 --- a/image.go +++ b/image.go @@ -310,7 +310,7 @@ func (i *Image) drawImage(img *Image, options *DrawImageOptions) { } vs := src.QuadVertices(0, 0, w, h, 0.5, 0, 0, 0.5, 0, 0, 1, 1, 1, 1) is := graphicsutil.QuadIndices() - s.DrawImage(src, vs, is, options.ColorM.impl, opengl.CompositeModeCopy, graphics.FilterLinear) + s.DrawImage(src, vs, is, nil, opengl.CompositeModeCopy, graphics.FilterLinear) img.shareableImages = append(img.shareableImages, s) w = w2 h = h2
graphics: Bug fix: don't apply color matrix when creating mipmap images TODO: Add tests. Fixes #<I>
hajimehoshi_ebiten
train
go
6672b398ea1f988921983ac3b757357c1f95b002
diff --git a/src/test/java/net/snowflake/client/jdbc/PreparedStatementIT.java b/src/test/java/net/snowflake/client/jdbc/PreparedStatementIT.java index <HASH>..<HASH> 100644 --- a/src/test/java/net/snowflake/client/jdbc/PreparedStatementIT.java +++ b/src/test/java/net/snowflake/client/jdbc/PreparedStatementIT.java @@ -1462,12 +1462,7 @@ public class PreparedStatementIT extends BaseJDBCTest connection.close(); } - /** - * Ensures binding a string type with TIMESTAMP_TZ works. The customer - * has to use the specific timestamp format: - * YYYY-MM-DD HH24:MI:SS.FF9 TZH:TZM - */ - //@Test + @Test public void testTableFuncBindInput() throws SQLException { int[] countResult; @@ -1479,6 +1474,11 @@ public class PreparedStatementIT extends BaseJDBCTest connection.close(); } + /** + * Ensures binding a string type with TIMESTAMP_TZ works. The customer + * has to use the specific timestamp format: + * YYYY-MM-DD HH24:MI:SS.FF9 TZH:TZM + */ @Test @ConditionalIgnore(condition = RunningOnTravisCI.class) public void testBindTimestampTZViaStringBatch() throws SQLException
SNOW-<I>: Test for Support bind variable in row generator table function. The fix is in the server
snowflakedb_snowflake-jdbc
train
java
88393df6a6687750bf47761a7cf4763682a2c68a
diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py index <HASH>..<HASH> 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py @@ -29,7 +29,7 @@ class MetricsQueryClient(object): """MetricsQueryClient :param credential: The credential to authenticate the client - :type credential: ~azure.core.credentials.TokenCredential + :type credential: ~azure.core.credentials_async.AsyncTokenCredential :keyword endpoint: The endpoint to connect to. Defaults to 'https://management.azure.com'. :paramtype endpoint: str """
Replace TokenCredential reference with AsyncTokenCredential (#<I>)
Azure_azure-sdk-for-python
train
py
7d209354119a8d5d273def3a7f5c6d011c4baa0a
diff --git a/lib/kaminari/helpers/paginator.rb b/lib/kaminari/helpers/paginator.rb index <HASH>..<HASH> 100644 --- a/lib/kaminari/helpers/paginator.rb +++ b/lib/kaminari/helpers/paginator.rb @@ -80,8 +80,8 @@ module Kaminari # It is threadsafe, but might not repress logging # consistently in a high-load environment if subscriber - class << subscriber - unless defined?(render_partial_with_logging) + unless defined? subscriber.render_partial_with_logging + class << subscriber alias_method :render_partial_with_logging, :render_partial attr_accessor :render_without_logging # ugly hack to make a renderer where @@ -100,7 +100,6 @@ module Kaminari else super @window_options.merge(@options).merge :paginator => self end - end # Wraps a "page number" and provides some utility methods
Ask if defined? against the instance. And don't open it if doing nothing
kaminari_kaminari
train
rb
d0d063a15588926bd6e7e1410eaa656a1b31d274
diff --git a/packages/blueprint/lib/Application.js b/packages/blueprint/lib/Application.js index <HASH>..<HASH> 100644 --- a/packages/blueprint/lib/Application.js +++ b/packages/blueprint/lib/Application.js @@ -248,6 +248,7 @@ Application.prototype.start = function (callback) { * @param callback */ Application.prototype.restart = function (callback) { + this._messaging.emit ('app.restart', this); this._appRestart.signalAndWait (callback); };
Forgot to emit app.restart event
onehilltech_blueprint
train
js
ceda0a79c2eec62c1a0c4e7c8a6e78e16b06895c
diff --git a/src/Monarkee/Bumble/BumbleServiceProvider.php b/src/Monarkee/Bumble/BumbleServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Monarkee/Bumble/BumbleServiceProvider.php +++ b/src/Monarkee/Bumble/BumbleServiceProvider.php @@ -20,10 +20,19 @@ class BumbleServiceProvider extends ServiceProvider { */ public function boot() { + // Register the default configuration config(['bumble' => require __DIR__.'/../../config/config.php']); + // Publish the config files and public assets + $this->publishes([ + __DIR__.'/../../config/config.php' => config_path('bumble.php'), + __DIR__.'/../../../public/' => public_path().'/packages/monarkee/bumble', + ]); + + // Register the default views $this->loadViewsFrom('bumble', __DIR__ . '/../../views/'); + // Include custom Bumble configuration include __DIR__ . '/../../filters.php'; include __DIR__ . '/../../validation.php'; include __DIR__ . '/../../helpers.php';
Update service provider to publish config and public assets
monarkee_bumble
train
php
c0cc26021bf4dc5be40e1eff987fc8eb25b767df
diff --git a/sanic/base.py b/sanic/base.py index <HASH>..<HASH> 100644 --- a/sanic/base.py +++ b/sanic/base.py @@ -11,7 +11,7 @@ from sanic.mixins.routes import RouteMixin from sanic.mixins.signals import SignalMixin -VALID_NAME = re.compile(r"^[a-zA-Z][a-zA-Z0-9_\-]*$") +VALID_NAME = re.compile(r"^[a-zA-Z_][a-zA-Z0-9_\-]*$") class BaseSanic(
Allow underscore to start instance names (#<I>)
huge-success_sanic
train
py
61fd7cd9ed24a72717cd3f2dd23a7dbe26ba35fe
diff --git a/activesupport/test/ts_isolated.rb b/activesupport/test/ts_isolated.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/ts_isolated.rb +++ b/activesupport/test/ts_isolated.rb @@ -1,6 +1,7 @@ $:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib') require 'test/unit' +require 'active_support/test_case' require 'rbconfig' require 'active_support/core_ext/kernel/reporting'
Require ActiveSupport::TestCase form ActiveSupport isolation tests
rails_rails
train
rb
73139e1b1672205c4fa61b40e82749b3a64c98b5
diff --git a/lib/terraforming/cli.rb b/lib/terraforming/cli.rb index <HASH>..<HASH> 100644 --- a/lib/terraforming/cli.rb +++ b/lib/terraforming/cli.rb @@ -28,6 +28,11 @@ module Terraforming execute(Terraforming::Resource::ElastiCacheCluster, options) end + desc "ecsn", "ElastiCache Subnet Group" + def ecsn + execute(Terraforming::Resource::ElastiCacheSubnetGroup, options) + end + desc "elb", "ELB" def elb execute(Terraforming::Resource::ELB, options) diff --git a/spec/lib/terraforming/cli_spec.rb b/spec/lib/terraforming/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/terraforming/cli_spec.rb +++ b/spec/lib/terraforming/cli_spec.rb @@ -60,6 +60,13 @@ module Terraforming it_behaves_like "CLI examples" end + describe "ecsn" do + let(:klass) { Terraforming::Resource::ElastiCacheSubnetGroup } + let(:command) { :ecsn } + + it_behaves_like "CLI examples" + end + describe "elb" do let(:klass) { Terraforming::Resource::ELB } let(:command) { :elb }
Define CLI command ecsn for ElastiCacheSubnetGroup
dtan4_terraforming
train
rb,rb
3cec71fec57231e29272ff5aed19539a25fbae6d
diff --git a/wfdb/io/download.py b/wfdb/io/download.py index <HASH>..<HASH> 100644 --- a/wfdb/io/download.py +++ b/wfdb/io/download.py @@ -300,12 +300,13 @@ def get_record_list(db_dir, records='all'): # Check for a RECORDS file if records == 'all': - response = requests.get(posixpath.join(db_url, 'RECORDS')) - if response.status_code == 404: + try: + content = _get_url(posixpath.join(db_url, 'RECORDS')) + except FileNotFoundError: raise ValueError('The database %s has no WFDB files to download' % db_url) # Get each line as a string - record_list = response.content.decode('ascii').splitlines() + record_list = content.decode('ascii').splitlines() # Otherwise the records are input manually else: record_list = records
get_record_list: use _get_url in place of requests.get. Note that this will handle errors (e.g. a file that we are not authorized to access) and raise an exception, rather than trying to parse the error document. Previously, <I> errors were handled, but other types of errors were not.
MIT-LCP_wfdb-python
train
py
f1f9de960cbe0a7b055c66d86ef2b624b28e3659
diff --git a/Command/GenerateRepositoriesDoctrineODMCommand.php b/Command/GenerateRepositoriesDoctrineODMCommand.php index <HASH>..<HASH> 100644 --- a/Command/GenerateRepositoriesDoctrineODMCommand.php +++ b/Command/GenerateRepositoriesDoctrineODMCommand.php @@ -51,7 +51,7 @@ EOT if ($metadatas = $this->getBundleMetadatas($foundBundle)) { $output->writeln(sprintf('Generating document repositories for "<info>%s</info>"', $foundBundle->getName())); $generator = new DocumentRepositoryGenerator(); - + foreach ($metadatas as $metadata) { if ($filterDocument && $filterDocument !== $metadata->reflClass->getShortname()) { continue; diff --git a/DataCollector/DoctrineMongoDBDataCollector.php b/DataCollector/DoctrineMongoDBDataCollector.php index <HASH>..<HASH> 100644 --- a/DataCollector/DoctrineMongoDBDataCollector.php +++ b/DataCollector/DoctrineMongoDBDataCollector.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Response; /** * Data collector for the Doctrine MongoDB ODM. - * + * * @author Kris Wallsmith <kris.wallsmith@symfony.com> */ class DoctrineMongoDBDataCollector extends DataCollector
removed empty lines/trailing spaces
doctrine_DoctrineMongoDBBundle
train
php,php
fdc54f2a99617932cd971078772038982d188d70
diff --git a/src/main/java/org/camunda/bpm/model/xml/test/AbstractModelElementInstanceTest.java b/src/main/java/org/camunda/bpm/model/xml/test/AbstractModelElementInstanceTest.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/camunda/bpm/model/xml/test/AbstractModelElementInstanceTest.java +++ b/src/main/java/org/camunda/bpm/model/xml/test/AbstractModelElementInstanceTest.java @@ -146,6 +146,9 @@ public abstract class AbstractModelElementInstanceTest { modelInstance = modelElementTypeRule.getModelInstance(); model = modelElementTypeRule.getModel(); modelElementType = modelElementTypeRule.getModelElementType(); + assertThat(modelInstance).isNotNull(); + assertThat(model).isNotNull(); + assertThat(modelElementType).isNotNull(); } public abstract String getDefaultNamespace();
chore(test): ensure model element instance test was correctly setup
camunda_camunda-xml-model
train
java
d52ae2e6bd3ea7d5a5cbc396b35148b2bee96f10
diff --git a/src/components/TransactionalBehavior.php b/src/components/TransactionalBehavior.php index <HASH>..<HASH> 100644 --- a/src/components/TransactionalBehavior.php +++ b/src/components/TransactionalBehavior.php @@ -13,7 +13,8 @@ use yii\db\Transaction; /** * Class TransactionalBehavior - * @package vr\core\components + * @package vr\core\components] + * @deprecated */ class TransactionalBehavior extends ActionFilter {
Make TransactionalBehavior deprecated because it was moved to voodoo-rocks/yii2-api
voodoo-rocks_yii2-core
train
php
678ed6e5da4fe38a3fa06b4af1fb6e1a6446474d
diff --git a/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/logging/Log4jAppenderTestCase.java b/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/logging/Log4jAppenderTestCase.java index <HASH>..<HASH> 100644 --- a/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/logging/Log4jAppenderTestCase.java +++ b/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/logging/Log4jAppenderTestCase.java @@ -55,13 +55,15 @@ public class Log4jAppenderTestCase extends AbstractLoggingTestCase { private static final ModelNode CUSTOM_HANDLER_ADDRESS = createAddress("custom-handler", CUSTOM_HANDLER_NAME); private static final ModelNode ROOT_LOGGER_ADDRESS = createAddress("root-logger", "ROOT"); - private final Path logFile = getAbsoluteLogFilePath(FILE_NAME); + private Path logFile; @Before public void startContainer() throws Exception { // Start the server container.start(); + logFile = getAbsoluteLogFilePath(FILE_NAME); + final CompositeOperationBuilder builder = CompositeOperationBuilder.create(); // Create the custom handler
[WFCORE-<I>] Ensure the server has been started before executing operations.
wildfly_wildfly-core
train
java
64f1588595b1a03e3844fc1ddc458eb45d45f0c0
diff --git a/lib/config/babel.js b/lib/config/babel.js index <HASH>..<HASH> 100644 --- a/lib/config/babel.js +++ b/lib/config/babel.js @@ -6,10 +6,10 @@ module.exports = function (webpackConfig) { let babelConfig = { cacheDirectory: tmpDir, presets: [ + // https://segmentfault.com/a/1190000006930013 // http://leonshi.com/2016/03/16/babel6-es6-inherit-issue-in-ie10/ [require.resolve('babel-preset-es2015'), { - loose: true, - modules: false // tree-shaking优化, http://imweb.io/topic/5868e1abb3ce6d8e3f9f99bb + //modules: false // tree-shaking优化, http://imweb.io/topic/5868e1abb3ce6d8e3f9f99bb }], require.resolve('babel-preset-react'), require.resolve('babel-preset-stage-1')
refactor: improve babel config No longer support ie8
zuzucheFE_guido
train
js
84704e03f1b49a295ab1e931904746faf83dc26b
diff --git a/raiden/ui/cli.py b/raiden/ui/cli.py index <HASH>..<HASH> 100644 --- a/raiden/ui/cli.py +++ b/raiden/ui/cli.py @@ -290,12 +290,13 @@ def run(ctx, **kwargs): app_ = ctx.invoke(app, **kwargs) - app_.discovery.register( + # spawn address registration to avoid block while waiting for the next block + registry_event = gevent.spawn( + app_.discovery.register, app_.raiden.address, mapped_socket.external_ip, mapped_socket.external_port, ) - app_.raiden.register_registry(app_.raiden.chain.default_registry.address) domain_list = [] @@ -330,6 +331,7 @@ def run(ctx, **kwargs): console = Console(app_) console.start() + registry_event.join() # wait for interrupt event = gevent.event.Event() gevent.signal(signal.SIGQUIT, event.set)
Do not block during startup (#<I>) As address/socket pair registration requires confirmation of the tx, polling until it appears in the next block introduces a delay until other services/cli can be started. This fix spawns a separate gevent for the registration to speed up the startup.
raiden-network_raiden
train
py
5e242a1cd119a4a103121e4105e755bc6748abe8
diff --git a/CHANGES.txt b/CHANGES.txt index <HASH>..<HASH> 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,2 +1,7 @@ Change Log ========== + +v0.1 (2014-02-17) +----------------- + +* Initial release. diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,7 @@ copyright = '2014, Thomas Roten' # The short X.Y version. version = '0.1' # The full version, including alpha/beta/rc tags. -release = '0.1dev' +release = '0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open('README.rst') as f: setup( name='dragonmapper', - version='0.1dev', + version='0.1', author='Thomas Roten', author_email='thomas@roten.us', url='https://github.com/tsroten/dragonmapper',
Bumps version to <I>.
tsroten_dragonmapper
train
txt,py,py
dae591e8b48ec64d106dd9b6b6ce5733a49268ed
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup script from setuptools import setup, find_packages -_VERSION = '0.1.3' +_VERSION = '0.2' setup( name='jut-tools',
bumping to <I> to see if pypi and pip behave correctly
jut-io_jut-python-tools
train
py
7d893e9e44bb56d70117d2fdabdf9acedb050837
diff --git a/src/Drivers/Baidu/BaiduResponse.php b/src/Drivers/Baidu/BaiduResponse.php index <HASH>..<HASH> 100644 --- a/src/Drivers/Baidu/BaiduResponse.php +++ b/src/Drivers/Baidu/BaiduResponse.php @@ -31,9 +31,16 @@ class BaiduResponse implements ResponseInterface */ public function __get($name) { + + if (array_key_exists($name, $this->data)) { return $this->data[$name]; } + + if (array_key_exists($name, $this->data['result'])) { + return $this->data['result'][$name]; + } + throw new Exception('property not exist'); } @@ -66,6 +73,9 @@ class BaiduResponse implements ResponseInterface */ public function toArray() { + if (isset($this->data['result'])) { + $this->data['result']; + } return $this->data; }
add a knid access to response
crisenchou_ai
train
php
a5134251fa6d8869067eb7dd0c0e906b7a010e2c
diff --git a/app_generators/ahn/ahn_generator.rb b/app_generators/ahn/ahn_generator.rb index <HASH>..<HASH> 100644 --- a/app_generators/ahn/ahn_generator.rb +++ b/app_generators/ahn/ahn_generator.rb @@ -37,6 +37,9 @@ class AhnGenerator < RubiGen::Base m.file *["components/disabled/restful_rpc/example-client.rb"]*2 m.file *["components/disabled/restful_rpc/spec/restful_rpc_spec.rb"]*2 + m.file *["components/disabled/sandbox/config.yml"]*2 + m.file *["components/disabled/sandbox/sandbox.rb"]*2 + m.file *["config/startup.rb"]*2 m.file *["dialplan.rb"]*2 m.file *["events.rb"]*2 @@ -80,6 +83,7 @@ EOS BASEDIRS = %w( components/simon_game components/disabled/stomp_gateway + components/disabled/sandbox components/ami_remote components/disabled/restful_rpc/spec config
Adding the sandbox component to all new Adhearsion apps (initially disabled)
adhearsion_adhearsion
train
rb
27ee54b0080deb6d861e3ad5d1a06da6a0d05527
diff --git a/image.go b/image.go index <HASH>..<HASH> 100644 --- a/image.go +++ b/image.go @@ -494,6 +494,9 @@ func (i *Image) DrawTriangles(vertices []Vertex, indices []uint16, img *Image, o } // TODO: Implement this. + if img.isSubImage() { + panic("using a subimage at DrawTriangles is not implemented") + } if i.isSubimage() { panic("render to a subimage is not implemented") }
graphics: Forbid using a subimage at DrawTriangles (#<I>)
hajimehoshi_ebiten
train
go
618138eaac7463b9e2afd6e8d28c2e27cf294f87
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ setup( "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3 :: Only", ], python_requires='>=3.7',
Add official support for Python <I>
hsluv_hsluv-python
train
py
be00914816247914ebd9c5f1948218f6d32068c0
diff --git a/lib/hyrax/transactions/transaction.rb b/lib/hyrax/transactions/transaction.rb index <HASH>..<HASH> 100644 --- a/lib/hyrax/transactions/transaction.rb +++ b/lib/hyrax/transactions/transaction.rb @@ -42,6 +42,9 @@ module Hyrax # @example unwapping values safely with handling for failures # tx.call(change_set).value_or { |failure| "uh oh: #{failure} } # + # @example when there is no need to unwrap the value, handle errors with `#or` + # tx.call(change_set).or { |failure| "uh oh: #{failure} } + # # @example a pattern for subclassing to create new transactions # class CustomTransaction < Transaction # DEFAULT_STEPS = ['step.1', 'step.2', 'step.3'].freeze
Add documentation for `Result#or` to transaction This use of `#or` is likely to be a common pattern in controllers, where we often won't care to unwrap a newly saved value (instead redirecting to an index-driven page), but want to handle errors carefully.
samvera_hyrax
train
rb
ee2191c79f6f1afc9638e3bbb8e414d0a519a0c2
diff --git a/server_status/__init__.py b/server_status/__init__.py index <HASH>..<HASH> 100644 --- a/server_status/__init__.py +++ b/server_status/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- # pylint: disable=missing-docstring -__version__ = '0.3.0' # pragma: no cover +__version__ = '0.3.1' # pragma: no cover diff --git a/server_status/views.py b/server_status/views.py index <HASH>..<HASH> 100644 --- a/server_status/views.py +++ b/server_status/views.py @@ -138,7 +138,7 @@ def get_celery_info(): if not celery_stats: log.error("No running Celery workers were found.") return {"status": DOWN, "message": "No running Celery workers"} - except IOError as exp: + except Exception as exp: # pylint: disable=broad-except log.error("Error connecting to the backend: %s", exp) return {"status": DOWN, "message": "Error connecting to the backend"} return {"status": UP, "response_microseconds": (datetime.now() - start).microseconds}
Catch all exceptions during celery requests.
mitodl_django-server-status
train
py,py
f1855e79872647f16b7e1fd73141200a32795d1f
diff --git a/visidata/sheets.py b/visidata/sheets.py index <HASH>..<HASH> 100644 --- a/visidata/sheets.py +++ b/visidata/sheets.py @@ -236,7 +236,7 @@ class TableSheet(BaseSheet): return type(self)._rowtype() def openRow(self, row): - k = self.rowkey(row) or [self.cursorRowIndex] + k = self.keystr(row) or [self.cursorRowIndex] name = f'{self.name}[{k}]' return vd.load_pyobj(name, tuple(c.getTypedValue(row) for c in self.visibleCols))
[openrow-] fix missed parm
saulpw_visidata
train
py
e034b4f60548a7aa8c85240598aa6979e81e45ee
diff --git a/structr-ui/src/main/resources/structr/js/command.js b/structr-ui/src/main/resources/structr/js/command.js index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/resources/structr/js/command.js +++ b/structr-ui/src/main/resources/structr/js/command.js @@ -474,7 +474,7 @@ var Command = { var data = {}; data.localStorageString = JSON.stringify(localStorage); obj.data = data; - log('saveLocalStorage()', obj); + //log('saveLocalStorage()', obj); return sendObj(obj, callback); }, /**
Don't log localStorage for performance reasons.
structr_structr
train
js
c7ba3307637a3e29c3a98bee6e681ae8ab8102e2
diff --git a/cloudvolume/storage/storage.py b/cloudvolume/storage/storage.py index <HASH>..<HASH> 100644 --- a/cloudvolume/storage/storage.py +++ b/cloudvolume/storage/storage.py @@ -13,7 +13,7 @@ from tqdm import tqdm from cloudvolume import compression from cloudvolume.exceptions import UnsupportedProtocolError -from cloudvolume.lib import mkdir, scatter, jsonify, duplicates, yellow +from cloudvolume.lib import mkdir, scatter, jsonify, duplicates, yellow, red from cloudvolume.threaded_queue import ThreadedQueue, DEFAULT_THREADS from cloudvolume.scheduler import schedule_green_jobs @@ -56,8 +56,10 @@ class StorageBase(object): self._interface_cls = get_interface_class(self._path.protocol) if not WARNING_PRINTED: - print(yellow( - "Storage is deprecated. Please use CloudFiles instead. See https://github.com/seung-lab/cloud-files" + print(red( + "Storage is obsolete and will be removed soon! " + "Update your code to use CloudFiles instead. " + "See https://github.com/seung-lab/cloud-files" )) WARNING_PRINTED = True
deprecate: mark storage as obsolete
seung-lab_cloud-volume
train
py
6e0a9525a14587019bc69808656fc8f3edf7a89e
diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/XmlParserR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/XmlParserR4Test.java index <HASH>..<HASH> 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/XmlParserR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/parser/XmlParserR4Test.java @@ -195,13 +195,6 @@ public class XmlParserR4Test { String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(o); ourLog.info(encoded); - FhirContext - .forR4() - .newRestfulGenericClient("http://hapi.fhir.org/baseR4") - .create() - .resource(o) - .execute(); - assertThat(encoded, containsString("<comment value=\"123&#xa;456\"/>")); o = ourCtx.newXmlParser().parseResource(Observation.class, encoded);
Remove dependency on public test server in unit test
jamesagnew_hapi-fhir
train
java
c3a324f5a5c186c1ead3f7f80af09733e8cb2168
diff --git a/woocommerce/api.py b/woocommerce/api.py index <HASH>..<HASH> 100644 --- a/woocommerce/api.py +++ b/woocommerce/api.py @@ -56,7 +56,7 @@ class API(object): url = self.__get_url(endpoint) auth = None headers = { - "user-agent": "WooCommerce API Client-Node.js/%s" % __version__, + "user-agent": "WooCommerce API Client-Python/%s" % __version__, "content-type": "application/json;charset=utf-8", "accept": "application/json" }
Changed user-agent from Node.js to Python
woocommerce_wc-api-python
train
py
5e19a0da63d578dd0638cba9b112076eed530fa8
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/SessionClusterEntrypoint.java b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/SessionClusterEntrypoint.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/SessionClusterEntrypoint.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/SessionClusterEntrypoint.java @@ -60,6 +60,7 @@ public abstract class SessionClusterEntrypoint extends ClusterEntrypoint { this); dispatcher = createDispatcher( + configuration, rpcService, highAvailabilityServices, blobServer, @@ -106,6 +107,7 @@ public abstract class SessionClusterEntrypoint extends ClusterEntrypoint { } protected Dispatcher createDispatcher( + Configuration configuration, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, BlobServer blobServer, @@ -117,6 +119,7 @@ public abstract class SessionClusterEntrypoint extends ClusterEntrypoint { return new StandaloneDispatcher( rpcService, Dispatcher.DISPATCHER_NAME, + configuration, highAvailabilityServices, blobServer, heartbeatServices,
[FLINK-<I>] [flip-6] Pass in proper configuration to Dispatcher component This closes #<I>.
apache_flink
train
java
3d6c5f9c4aa9e5d7afbfc95e97d81b3510f13898
diff --git a/tests/src/Phossa2/Storage/StorageTest.php b/tests/src/Phossa2/Storage/StorageTest.php index <HASH>..<HASH> 100644 --- a/tests/src/Phossa2/Storage/StorageTest.php +++ b/tests/src/Phossa2/Storage/StorageTest.php @@ -551,11 +551,10 @@ class StorageTest extends \PHPUnit_Framework_TestCase // put $this->assertTrue($this->object->put('/b1/bingo1', 'wow1')); $this->assertTrue($this->object->put('/b1/b2/bingo2', 'wow2')); - $this->assertTrue($this->object->put('/b3', 'wow3')); + //$this->assertTrue($this->object->put('/b3', 'wow3')); // move, directory overwrite file is ok $this->assertTrue($this->object->move('/b1', '/b3')); - usleep(20000); $this->assertFalse($this->object->has('/b1/bingo1')); $this->assertFalse($this->object->has('/b1/b2/bingo2'));
rename a dir to a file is not OK
phossa2_storage
train
php
75e36813d6765c9725262fec954f6c3f221011b0
diff --git a/lib/ghtorrent/command.rb b/lib/ghtorrent/command.rb index <HASH>..<HASH> 100644 --- a/lib/ghtorrent/command.rb +++ b/lib/ghtorrent/command.rb @@ -52,7 +52,11 @@ class Command command.go rescue => e STDERR.puts e.message - STDERR.puts e.backtrace.join("\n") if command.options.verbose + if command.options.verbose + STDERR.puts e.backtrace.join("\n") + else + STDERR.puts e.backtrace[0] + end exit 1 end end
Print error location when not in verbose mode
gousiosg_github-mirror
train
rb
8a73f57081b36ea72050050ee81be85fde37bfd6
diff --git a/lang/en/moodle.php b/lang/en/moodle.php index <HASH>..<HASH> 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1398,6 +1398,7 @@ $string['rss'] = 'RSS'; $string['rssarticles'] = 'Number of RSS recent articles'; $string['rsserror'] = 'Error reading RSS data'; $string['rsserrorauth'] = 'Your RSS link does not contain a valid authentication token.'; +$string['rsserrorguest'] = 'This feed uses guest access to access the data, but guest does not have permission to read the data. Visit the original location that this feed comes from (URL) as a valid user and get a new RSS link from there.'; $string['rsstype'] = 'RSS feed for this activity'; $string['saveandnext'] = 'Save and show next'; $string['savedat'] = 'Saved at:';
rss MDL-<I> added some support for <I> rss feed requests
moodle_moodle
train
php
d40d024711c5444056e08bb3f762f9f5db4f91c4
diff --git a/test/suite.js b/test/suite.js index <HASH>..<HASH> 100644 --- a/test/suite.js +++ b/test/suite.js @@ -21,13 +21,25 @@ describe('new Client()', function() { }); describe('#_uploadGeneratePath()', function() { - it('should return an avaiable path', function(done) { + it('should return avaiable path', function(done) { + client._uploadPathIsAvailable = function(path, cb) { return cb(null, true); }; client._uploadGeneratePath(function(err, path) { assert.ifError(err); assert(/^[A-Za-z0-9]{2}\/[A-Za-z0-9]{2}\/[A-Za-z0-9]{2}$/.test(path)); done(); }); }); + + it('should retry if selected path is not avaiable', function(done) { + var i = 0; + client._uploadPathIsAvailable = function(path, cb) { return cb(null, (++i === 5)); }; + client._uploadGeneratePath(function(err, path) { + assert.ifError(err); + assert.equal(i, 5); + assert(/^[A-Za-z0-9]{2}\/[A-Za-z0-9]{2}\/[A-Za-z0-9]{2}$/.test(path)); + done(); + }); + }); }); });
Add test spies and test retry functionality
Turistforeningen_node-s3-uploader
train
js
ee16f6ee0479b0f96dea255a87bcdecd83660487
diff --git a/arctic/generics.py b/arctic/generics.py index <HASH>..<HASH> 100755 --- a/arctic/generics.py +++ b/arctic/generics.py @@ -273,10 +273,16 @@ class ListView(View, base.ListView): else: name = field_name try: - item['label'] = find_field_meta( + field_meta = find_field_meta( model, field_name - ).verbose_name + ) + if field_meta._verbose_name: # noqa + # explicitly set on the model, so don't change + item['label'] = field_meta._verbose_name # noqa + else: + # title-case the field name (issue #80) + item['label'] = field_meta.verbose_name.title() # item['label'] = model._meta.get_field(field_name).\ # verbose_name
Title-case field names in headers, unless a verbose name is set explicitly.
sanoma_django-arctic
train
py
32ab77c2039bf0b27426cb2cdc61b5a6c9b8c5f3
diff --git a/i3pystatus/core/modules.py b/i3pystatus/core/modules.py index <HASH>..<HASH> 100644 --- a/i3pystatus/core/modules.py +++ b/i3pystatus/core/modules.py @@ -107,7 +107,7 @@ class Module(SettingsBase): if cb is not "run": getattr(self, cb)(*args) else: - execute(cb, *args) + execute(cb, detach=True) return True def move(self, position):
Module: External programs are launched in detached mode.
enkore_i3pystatus
train
py
fecaa8a7fe8835a2806c02c879d22c83827d1572
diff --git a/mungers/submit-queue.go b/mungers/submit-queue.go index <HASH>..<HASH> 100644 --- a/mungers/submit-queue.go +++ b/mungers/submit-queue.go @@ -394,6 +394,7 @@ func (sq *SubmitQueue) AddFlags(cmd *cobra.Command, config *github.Config) { "kubernetes-e2e-gce", "kubernetes-e2e-gce-slow", "kubernetes-e2e-gce-serial", + "kubernetes-e2e-gke-serial", "kubernetes-e2e-gke", "kubernetes-e2e-gke-slow", "kubernetes-e2e-gce-scalability",
add gke-serial into the list
kubernetes_test-infra
train
go
76edfcb13dfd6a8ce1b4df3a64f1dd1bc61cde11
diff --git a/lib/command/CommandClient.js b/lib/command/CommandClient.js index <HASH>..<HASH> 100644 --- a/lib/command/CommandClient.js +++ b/lib/command/CommandClient.js @@ -230,6 +230,7 @@ class CommandClient extends Client { throw new Error("You have already registered a command for " + label); } options = options || {}; + label = options.caseInsensitive === true ? label.toLowerCase() : label; for(var key in this.commandOptions.defaultCommandOptions) { if(options[key] === undefined) { options[key] = this.commandOptions.defaultCommandOptions[key];
Fix insensitive command label option (#<I>)
abalabahaha_eris
train
js
6477f25676b58636e72d6be839ad603271db4c5a
diff --git a/src/components/TabbedCard/TabbedCard.react.js b/src/components/TabbedCard/TabbedCard.react.js index <HASH>..<HASH> 100644 --- a/src/components/TabbedCard/TabbedCard.react.js +++ b/src/components/TabbedCard/TabbedCard.react.js @@ -1 +1,17 @@ // @flow + +import * as React from "react"; + +import Card from "../Card/Card.react"; + +type Props = {||}; + +type State = {||}; + +class TabbedCard extends React.PureComponent<Props, State> { + render(): React.Node { + return <Card />; + } +} + +export default TabbedCard;
Added default TabbedCard as basic card.
tabler_tabler-react
train
js
126fd0e7fde0f6dc0bf6b1290794294b1311c4fb
diff --git a/hagelslag/processing/TrackModeler.py b/hagelslag/processing/TrackModeler.py index <HASH>..<HASH> 100644 --- a/hagelslag/processing/TrackModeler.py +++ b/hagelslag/processing/TrackModeler.py @@ -86,8 +86,8 @@ class TrackModeler(object): self.data[mode]["step"] = self.data[mode]["step"].fillna(value=0) self.data[mode]["step"] = self.data[mode]["step"].replace([np.inf, -np.inf], 0) - if mode == "forecast": - self.data[mode]["step"] = self.data[mode]["step"].drop_duplicates("Step_ID") + if mode == "forecast": + self.data[mode]["step"] = self.data[mode]["step"].drop_duplicates("Step_ID") self.data[mode]["member"] = pd.read_csv(self.member_files[mode]) self.data[mode]["combo"] = pd.merge(self.data[mode]["step"], self.data[mode]["total"],
Changed "train" mode to create "member"
djgagne_hagelslag
train
py
d6707465793e79933c146d535991dac4f7a01b23
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -35,7 +35,6 @@ var ErrAlreadyConnecting = errors.New("already connecting") var ErrNotConnected = errors.New("not connected") var ErrMissingClientID = errors.New("missing client id") var ErrConnectionDenied = errors.New("connection denied") -var ErrInvalidPacketType = errors.New("invalid packet type") var ErrMissingPong = errors.New("missing pong") var ErrUnexpectedClose = errors.New("unexpected close") @@ -427,8 +426,7 @@ func (c *Client) processor() error { case packet.PUBREL: err = c.processPubrel(pkt.(*packet.PubrelPacket).PacketID) default: - // die on an invalid packet type - return c.die(ErrInvalidPacketType, true) + // ignore unsupported packet types } // return eventual error
do not raise error if there was an unsupported packet type
256dpi_gomqtt
train
go
2b729be91332650d81fb6541f86f45de7adfcaaf
diff --git a/src/de/triplet/simpleprovider/AbstractProvider.java b/src/de/triplet/simpleprovider/AbstractProvider.java index <HASH>..<HASH> 100644 --- a/src/de/triplet/simpleprovider/AbstractProvider.java +++ b/src/de/triplet/simpleprovider/AbstractProvider.java @@ -73,7 +73,11 @@ public abstract class AbstractProvider extends ContentProvider { public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { final SelectionBuilder builder = buildBaseQuery(uri); - return builder.where(selection, selectionArgs).query(mDatabase, projection, sortOrder); + final Cursor cursor = builder.where(selection, selectionArgs).query(mDatabase, projection, sortOrder); + if (cursor != null) { + cursor.setNotificationUri(getContext().getContentResolver(), uri); + } + return cursor; } private final SelectionBuilder buildBaseQuery(Uri uri) {
Set notification uri before returning the cursor to get notified about changes
Triple-T_simpleprovider
train
java
e10060e8ece479a4dfc1860af144b287cf59d421
diff --git a/devassistant/command_helpers.py b/devassistant/command_helpers.py index <HASH>..<HASH> 100644 --- a/devassistant/command_helpers.py +++ b/devassistant/command_helpers.py @@ -179,7 +179,7 @@ class ZenityHelper(object): c_zenity = 'zenity' @classmethod - def ask_for_password(cls, title, text='Enter password:', input_type='entry', options=[]): + def ask_for_password(cls, title, text='\"Enter password:\"', input_type='entry', options=["--hide-text"]): return cls.ask_for_custom_input(title, text, input_type, options) @classmethod
Text in case of password has not to be visible
devassistant_devassistant
train
py
7062a6e55d4d7c964fda19fc9b4d08a601cffcce
diff --git a/script/prerelease.js b/script/prerelease.js index <HASH>..<HASH> 100755 --- a/script/prerelease.js +++ b/script/prerelease.js @@ -24,7 +24,6 @@ github.repos.getReleases({owner: 'electron', repo: 'electron'}) const draft = drafts[0] check(draft.tag_name === `v${pkg.version}`, `draft release version matches local package.json (v${pkg.version})`) - check(draft.prerelease, 'draft is a prerelease') check(draft.body.length > 50 && !draft.body.includes('(placeholder)'), 'draft has release notes') const requiredAssets = assetsForVersion(draft.tag_name).sort()
remove the condition where release draft has to have a `prerelease` flag
electron_electron
train
js
da39fa1fa3c1fe323900b5653d8d1d2d4aad3ffa
diff --git a/chef/lib/chef/provider/deploy.rb b/chef/lib/chef/provider/deploy.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/provider/deploy.rb +++ b/chef/lib/chef/provider/deploy.rb @@ -273,7 +273,6 @@ class Chef links_info = @new_resource.symlinks.map { |src, dst| "#{src} => #{dst}" }.join(", ") @new_resource.symlinks.each do |src, dest| - create_dir_unless_exists(::File.join(@new_resource.shared_path, src)) begin FileUtils.ln_sf(::File.join(@new_resource.shared_path, src), ::File.join(release_path, dest)) rescue => e
CHEF-<I>: do not create directories for links
chef_chef
train
rb
7dacdb9c9a302725f99daf4ac34045f552c2a51c
diff --git a/classes/meta_box.class.php b/classes/meta_box.class.php index <HASH>..<HASH> 100644 --- a/classes/meta_box.class.php +++ b/classes/meta_box.class.php @@ -153,7 +153,7 @@ class Cuztom_Meta_Box extends Cuztom_Meta if( $field->show_column ) $columns[$id_name] = $field->label; } - $columns['date'] = __( 'Date', 'cuztom' ); + $columns['date'] = __( 'Date' ); return $columns; }
Removes cuztom text domain from 'Date' WordPress already 'Date' already.
gizburdt_cuztom
train
php
e36e4f62049d96cb27c2771e79733e81ed78e012
diff --git a/motor/core.py b/motor/core.py index <HASH>..<HASH> 100644 --- a/motor/core.py +++ b/motor/core.py @@ -129,8 +129,7 @@ class AgnosticClient(AgnosticBaseProperties): else: io_loop = self._framework.get_event_loop() - # For Synchro's sake, add undocumented "_connect" option, default False. - kwargs['connect'] = kwargs.pop('_connect', False) + kwargs.setdefault('connect', False) delegate = self.__delegate_class__(*args, **kwargs) super(AgnosticBaseProperties, self).__init__(delegate) diff --git a/synchro/__init__.py b/synchro/__init__.py index <HASH>..<HASH> 100644 --- a/synchro/__init__.py +++ b/synchro/__init__.py @@ -291,7 +291,7 @@ class MongoClient(Synchro): self.delegate = kwargs.pop('delegate', None) # Motor passes connect=False by default. - kwargs.setdefault('_connect', True) + kwargs.setdefault('connect', True) if not self.delegate: self.delegate = self.__delegate_class__(host, port, *args, **kwargs)
PyMongo 3 renamed _connect to connect.
mongodb_motor
train
py,py
9ea4b03363e908c7aeb3ca00dc73a5748e138a55
diff --git a/src/Product/Product.php b/src/Product/Product.php index <HASH>..<HASH> 100644 --- a/src/Product/Product.php +++ b/src/Product/Product.php @@ -8,7 +8,7 @@ class Product * @var ProductId */ private $productId; - + /** * @var ProductAttributeList */ @@ -45,18 +45,14 @@ class Product */ public function getAllValuesOfAttribute($attributeCode) { - $values = []; - try { - $productAttributes = $this->attributeList->getAttributesWithCode($attributeCode); - foreach ($productAttributes as $productAttribute) { - $values[] = $productAttribute->getValue(); - } + return array_map(function (ProductAttribute $productAttribute) { + return $productAttribute->getValue(); + }, $this->attributeList->getAttributesWithCode($attributeCode)); + } catch (ProductAttributeNotFoundException $e) { /* TODO: Log */ return ['']; } - - return $values; } }
Issue #<I>: Make loop code more declarative using array_map
lizards-and-pumpkins_catalog
train
php
f1c2cf416077797b7a3f28a826490e7da1be4e92
diff --git a/galois_amd64.go b/galois_amd64.go index <HASH>..<HASH> 100644 --- a/galois_amd64.go +++ b/galois_amd64.go @@ -1,4 +1,5 @@ //+build !noasm +//+build !appengine // Copyright 2015, Klaus Post, see LICENSE for details. diff --git a/galois_amd64.s b/galois_amd64.s index <HASH>..<HASH> 100644 --- a/galois_amd64.s +++ b/galois_amd64.s @@ -1,4 +1,4 @@ -//+build !noasm +//+build !noasm !appengine // Copyright 2015, Klaus Post, see LICENSE for details. diff --git a/galois_noasm.go b/galois_noasm.go index <HASH>..<HASH> 100644 --- a/galois_noasm.go +++ b/galois_noasm.go @@ -1,4 +1,4 @@ -//+build !amd64 noasm +//+build !amd64 noasm appengine // Copyright 2015, Klaus Post, see LICENSE for details.
Don't use assembler on app engine.
klauspost_reedsolomon
train
go,s,go
8ef48574cd9392cb036fb352f4f82af9ef7face2
diff --git a/ELiDE/ELiDE/board/board.py b/ELiDE/ELiDE/board/board.py index <HASH>..<HASH> 100644 --- a/ELiDE/ELiDE/board/board.py +++ b/ELiDE/ELiDE/board/board.py @@ -258,7 +258,7 @@ class Board(RelativeLayout): self.selection = None self.keep_selection = False touch.ungrab(self) - return True + return def on_parent(self, *args): if not self.parent or hasattr(self, '_parented'):
Make Board let scrolling happen if it doesn't have a reason to stop it
LogicalDash_LiSE
train
py
ab0b01a8e8e0a7e1fb78f89f7fb91f80e40f14dc
diff --git a/lib/kuniri/core/configuration/language_available.rb b/lib/kuniri/core/configuration/language_available.rb index <HASH>..<HASH> 100644 --- a/lib/kuniri/core/configuration/language_available.rb +++ b/lib/kuniri/core/configuration/language_available.rb @@ -7,6 +7,6 @@ module Configuration # Handling the languages available in the system. class LanguageAvailable - LANGUAGES = %w(ruby python cplusplus c).freeze # Put here new language. + LANGUAGES = %w[ruby python cplusplus c].freeze # Put here new language. end end diff --git a/lib/kuniri/core/configuration/log_available.rb b/lib/kuniri/core/configuration/log_available.rb index <HASH>..<HASH> 100644 --- a/lib/kuniri/core/configuration/log_available.rb +++ b/lib/kuniri/core/configuration/log_available.rb @@ -7,6 +7,6 @@ module Configuration # Configuration for the monitor available. class LogAvailable - LOG = %w(html txt).freeze # List with log types. + LOG = %w[html txt].freeze # List with log types. end end
use [] instead of () in %w-literals
Kuniri_kuniri
train
rb,rb
4fa201245d75d0bd72e8f2472938fb7ae7ba186f
diff --git a/django_fsm/signals.py b/django_fsm/signals.py index <HASH>..<HASH> 100644 --- a/django_fsm/signals.py +++ b/django_fsm/signals.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- from django.dispatch import Signal -pre_transition = Signal(providing_args=['instance', 'name', 'source', 'target']) -post_transition = Signal(providing_args=['instance', 'name', 'source', 'target', 'exception']) +pre_transition = Signal() +post_transition = Signal()
mRemoved providing_args kwarg from Signal constructor.
viewflow_django-fsm
train
py
2a560eb050e786512a8c808150cfbd8a1d61c09a
diff --git a/lib/perfectqueue/engine.rb b/lib/perfectqueue/engine.rb index <HASH>..<HASH> 100644 --- a/lib/perfectqueue/engine.rb +++ b/lib/perfectqueue/engine.rb @@ -56,7 +56,7 @@ module PerfectQueue @processors << @processor_class.new(@runner, @processors.size+1, config) end elsif extra < 0 - -extra.times do + (-extra).times do c = @processors.shift c.stop(immediate) c.join
- is weaker than .; needs parenthesis
treasure-data_perfectqueue
train
rb
0511cdc1c4096044bb59ec33e8e2fa411630dbc0
diff --git a/test/callback.js b/test/callback.js index <HASH>..<HASH> 100644 --- a/test/callback.js +++ b/test/callback.js @@ -181,7 +181,12 @@ describe('Callback', function () { process.removeAllListeners('uncaughtException') process.once('uncaughtException', function (e) { assert(/ffi/.test(e.message)) - listeners.forEach(process.emit.bind(process, 'uncaughtException')) + + // re-add Mocha's listeners + listeners.forEach(function (fn) { + process.on('uncaughtException', fn) + }) + done() })
test: properly re-add Mocha's uncaught listeners
node-ffi-napi_node-ffi-napi
train
js
4361574b7ab725f2e36b4eeb7fcc087748563a0c
diff --git a/bin/eg-generator.js b/bin/eg-generator.js index <HASH>..<HASH> 100644 --- a/bin/eg-generator.js +++ b/bin/eg-generator.js @@ -1,10 +1,6 @@ const Generator = require('yeoman-generator'); const config = require('../lib/config'); -Generator.prototype.stdout = function () { - // eslint-disable-next-line no-console - console.log.apply(arguments); -}; module.exports = class EgGenerator extends Generator { constructor (args, opts) { super(args, opts); @@ -33,6 +29,11 @@ module.exports = class EgGenerator extends Generator { this._configuration = configuration; } + stdout (...args) { + // eslint-disable-next-line no-console + console.log.apply(console, args); + } + createSubCommand (name) { const generatorName = `${this.constructor.namespace}:${name}`; return this.env.create(generatorName)._configuration;
Fixing stdout on CLI generators. (#<I>)
ExpressGateway_express-gateway
train
js
7d25c7f3a64fd77127f49dfd3244e5d91c3ed033
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -8,6 +8,8 @@ const { createCompiledModule, Module } = require("./compiler/compile/module"); const { Memory } = require("./interpreter/runtime/values/memory"); const { Table } = require("./interpreter/runtime/values/table"); const { checkEndianness } = require("./check-endianness"); +const { traverse } = require("./compiler/AST/traverse"); +const t = require("./compiler/AST/index"); const _debug = { parseWATF(content: string, cb: (ast: Program) => void) { @@ -24,7 +26,10 @@ const _debug = { const ast = parseBinary(content); cb(ast); - } + }, + + traverse, + t }; const WebAssembly = {
feat: expose ast types and traverse
xtuc_webassemblyjs
train
js
ad146a3eb6c13de400817a611ebd3af66982fcbb
diff --git a/plugins/net.js b/plugins/net.js index <HASH>..<HASH> 100644 --- a/plugins/net.js +++ b/plugins/net.js @@ -89,7 +89,7 @@ module.exports = function (opts) { stringify: function (scope) { scope = scope || 'device' if(!isScoped(scope)) return - var _host = (scope == 'public' && opts.external) || scopes.host(scope) + var _host = opts.host || (scope == 'public' && opts.external) || scopes.host(scope) if(!_host) return null return ['net', _host, port].join(':') } diff --git a/plugins/ws.js b/plugins/ws.js index <HASH>..<HASH> 100644 --- a/plugins/ws.js +++ b/plugins/ws.js @@ -109,7 +109,7 @@ module.exports = function (opts) { else port = opts.port - var host = (scope == 'public' && opts.external) || scopes.host(scope) + var host = opts.host || (scope == 'public' && opts.external) || scopes.host(scope) //if a public scope was requested, but a public ip is not available, return if(!host) return null
Fix `stringify()` in net and ws to respect host Previously we were disregarding the `host` setting for all configs except in cases where `scope === 'public' && `opts.external != null`. This resolves the error by first checking whether `opts.host` is defined before falling back to automatic detection methods.
ssbc_multiserver
train
js,js
ab4fbb9553889a93e2c8368f207033812261e4ba
diff --git a/quilt/cli/parser.py b/quilt/cli/parser.py index <HASH>..<HASH> 100644 --- a/quilt/cli/parser.py +++ b/quilt/cli/parser.py @@ -43,8 +43,8 @@ import six def get_declared_instances_list(bases, attrs, collect_cls, instance_attr): - instances = [(name, attrs.pop(name)) for name, obj in attrs.items() if - isinstance(obj, collect_cls)] + instances = [(name, attrs.pop(name)) for name, obj in attrs.copy().items() + if isinstance(obj, collect_cls)] instances.sort(key=lambda x: x[1].creation_counter) for base in bases[::-1]: if hasattr(base, instance_attr):
Fix iterating over attrs in python 3 It's not possible to change attrs in iteration loop with python3.
bjoernricks_python-quilt
train
py
cf886a78d3c34a8ef34f1e5149b4208281a927da
diff --git a/h2o-algos/src/main/java/hex/tree/DRealHistogram.java b/h2o-algos/src/main/java/hex/tree/DRealHistogram.java index <HASH>..<HASH> 100644 --- a/h2o-algos/src/main/java/hex/tree/DRealHistogram.java +++ b/h2o-algos/src/main/java/hex/tree/DRealHistogram.java @@ -25,7 +25,7 @@ public class DRealHistogram extends DHistogram<DRealHistogram> { } @Override public double var (int b) { double n = _bins[b]; - if( n==0 ) return 0; + if( n<=1 ) return 0; return (_ssqs[b] - _sums[b]*_sums[b]/n)/(n-1); }
PUBDEV-<I>: Fix variance computation for DRealHistogram when there's only 1 count (N=1), was dividing by 0 during 1/N * 1/(N-1)
h2oai_h2o-3
train
java
eb888c49c06444d944ecfcf64fab406664b52206
diff --git a/src/rezplugins/shell/_utils/powershell_base.py b/src/rezplugins/shell/_utils/powershell_base.py index <HASH>..<HASH> 100644 --- a/src/rezplugins/shell/_utils/powershell_base.py +++ b/src/rezplugins/shell/_utils/powershell_base.py @@ -3,11 +3,13 @@ import re from subprocess import PIPE from rez.config import config +from rez.vendor.six import six from rez.rex import RexExecutor, OutputStyle, EscapedString from rez.shells import Shell from rez.system import system from rez.utils.platform_ import platform_ from rez.utils.execution import Popen +from rez.util import shlex_join class PowerShellBase(Shell): @@ -305,3 +307,11 @@ class PowerShellBase(Shell): @classmethod def line_terminator(cls): return "\n" + + @classmethod + def join(cls, command): + if isinstance(command, six.string_types): + return command + + # add call operator in case executable gets quotes applied + return "& " + shlex_join(command)
fix for powershell in cases where the executable command string gets quoted
nerdvegas_rez
train
py
df3c3847c96627c38f9060957fc3fe20427aa6eb
diff --git a/plugin.php b/plugin.php index <HASH>..<HASH> 100644 --- a/plugin.php +++ b/plugin.php @@ -4,7 +4,7 @@ * Description: JSON-based REST API for WordPress, developed as part of GSoC 2013. * Author: WP REST API Team * Author URI: http://wp-api.org - * Version: 2.0-beta1.1 + * Version: 2.0-beta2 * Plugin URI: https://github.com/WP-API/WP-API * License: GPL2+ */ @@ -14,7 +14,7 @@ * * @var string */ -define( 'REST_API_VERSION', '2.0-beta1.1' ); +define( 'REST_API_VERSION', '2.0-beta2' ); /** * Include our files for the API.
Bump plugin version to <I>-beta2
WP-API_WP-API
train
php
d4a1367f26940e70d580b51a245892c59c250588
diff --git a/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php b/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php index <HASH>..<HASH> 100644 --- a/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php +++ b/tests/phpunit/Parsoid/Html2Wt/DOMDiffTest.php @@ -54,7 +54,7 @@ class DOMDiffTest extends TestCase { // precisely here. And, we need to revisit whether that // page id comparison is still needed / useful. $data = DOMDataUtils::getNodeData( $node ); - $markers = $data->parsoid_diff->diff; + $markers = $data->parsoid_diff->diff ?? []; $this->assertCount( count( $spec['markers'] ), $markers, 'number of markers does not match' ); @@ -80,7 +80,9 @@ class DOMDiffTest extends TestCase { 'desc' => 'ignore attribute order in a node', 'orig' => '<font size="1" class="x">foo</font>', 'edit' => '<font class="x" size="1">foo</font>', - 'specs' => [] + 'specs' => [ + [ 'selector' => 'font', 'markers' => [] ], + ] ] ], [
Fix complaint that test did not perform any assertions Change-Id: I<I>c<I>edcc3a0c5cda5dc<I>c8c<I>d1
wikimedia_parsoid
train
php
4478238ff673cdc9c5024dc8d989ba9b8d48f1a8
diff --git a/command/agent/agent.go b/command/agent/agent.go index <HASH>..<HASH> 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -199,8 +199,8 @@ func (a *Agent) clientConfig() (*clientconfig.Config, error) { } conf.MaxKillTimeout = dur } - conf.ClientMaxPort = a.config.Client.ClientMaxPort - conf.ClientMinPort = a.config.Client.ClientMinPort + conf.ClientMaxPort = uint(a.config.Client.ClientMaxPort) + conf.ClientMinPort = uint(a.config.Client.ClientMinPort) // Setup the node conf.Node = new(structs.Node) diff --git a/command/agent/config.go b/command/agent/config.go index <HASH>..<HASH> 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -162,11 +162,11 @@ type ClientConfig struct { // ClientMaxPort is the upper range of the ports that the client uses for // communicating with plugin subsystems - ClientMaxPort uint `hcl:"client_max_port"` + ClientMaxPort int `hcl:"client_max_port"` // ClientMinPort is the lower range of the ports that the client uses for // communicating with plugin subsystems - ClientMinPort uint `hcl:"client_min_port"` + ClientMinPort int `hcl:"client_min_port"` } // ServerConfig is configuration specific to the server mode
Fixed an issue around parsing client max and min ports
hashicorp_nomad
train
go,go
8a0595c80e10da639734556deb9f85cb08925803
diff --git a/xkcd.py b/xkcd.py index <HASH>..<HASH> 100644 --- a/xkcd.py +++ b/xkcd.py @@ -91,7 +91,6 @@ class WhatIfArchiveParser(HTMLParser.HTMLParser): for pair in attrs: if pair[0] == "href": link = pair[1] - print link # If we fail to find a link for whatever reason or if the parsing fails, # fail to generate a comic. try: @@ -99,15 +98,12 @@ class WhatIfArchiveParser(HTMLParser.HTMLParser): num = int(num) except: num = -1 - print num self.currentWhatIf.number = num self.currentWhatIf.link = "http:" + link def handle_data(self, data): # Some cruder parsing to pick out the data. if self.parsingWhatIf: - if self.seenATag == 1: - print(data) if self.seenATag == 2: self.currentWhatIf.title = data
Remove some debugging print statements.
TC01_python-xkcd
train
py
b7a0f62f0f9079d0d628a284a77af0c474eb9375
diff --git a/utils/jsonmessage.go b/utils/jsonmessage.go index <HASH>..<HASH> 100644 --- a/utils/jsonmessage.go +++ b/utils/jsonmessage.go @@ -52,7 +52,7 @@ func (p *JSONProgress) String() string { } numbersBox = fmt.Sprintf("%8v/%v", current, total) - if p.Start > 0 && percentage < 50 { + if p.Current > 0 && p.Start > 0 && percentage < 50 { fromStart := time.Now().UTC().Sub(time.Unix(int64(p.Start), 0)) perEntry := fromStart / time.Duration(p.Current) left := time.Duration(p.Total-p.Current) * perEntry
fix divide by zero error Docker-DCO-<I>-
moby_moby
train
go
270c5c3e0f05d8c349aff408f13029832d93028a
diff --git a/angr/analyses/sse.py b/angr/analyses/sse.py index <HASH>..<HASH> 100644 --- a/angr/analyses/sse.py +++ b/angr/analyses/sse.py @@ -47,7 +47,7 @@ class CallTracingFilter(object): addr = call_target_state.se.exactly_int(ip) except (SimValueError, SimSolverModeError): self._skipped_targets.add(-1) - l.debug('Rejecting target 0x%x', addr) + l.debug('Rejecting target %s - cannot be concretized', ip) return True # Is it in our blacklist? @@ -300,9 +300,7 @@ class SSE(Analysis): # Stash all possible paths that we should merge later for merge_point_addr, merge_point_looping_times in merge_points: - path_group.stash(filter_func= - lambda p: (p.addr == merge_point_addr), # and - # p.addr_backtrace.count(merge_point_addr) == self._loop_unrolling_limit + 1), + path_group.stash_addr(merge_point_addr, to_stash="_merge_%x_%d" % (merge_point_addr, merge_point_looping_times) )
Better logging. Switch to PathGrou.stash_addr().
angr_angr
train
py
55bb73125d7db4f1636918d61724967e5df91da5
diff --git a/tests/Go/Core/GoAspectContainerTest.php b/tests/Go/Core/GoAspectContainerTest.php index <HASH>..<HASH> 100644 --- a/tests/Go/Core/GoAspectContainerTest.php +++ b/tests/Go/Core/GoAspectContainerTest.php @@ -16,8 +16,9 @@ class GoAspectContainerTest extends TestCase protected function setUp() { - //$this->markTestIncomplete("Temporary disabled"); $this->container = new GoAspectContainer(); + $this->container->set('kernel.options', array()); + $this->container->set('kernel.interceptFunctions', false); } /**
Fix test by injecting system options into container
goaop_framework
train
php
1da9f7bad007c2b3f5a3ea8fd5bdf7efd962315d
diff --git a/glitch/glitch.py b/glitch/glitch.py index <HASH>..<HASH> 100644 --- a/glitch/glitch.py +++ b/glitch/glitch.py @@ -32,6 +32,7 @@ import base64 import random import string import docopt +import os class Glitch: def __init__(self): @@ -58,6 +59,8 @@ class Glitch: with open(glitchfile, 'wb') as f: g = self.machine(mode, graphictext, hard) f.write(g) + if os.path.getsize(glitchfile) == 0: + os.remove(glitchfile) def prepare_glitchfile(self, infile, mode, times, maximum): mode = self.glitch_mode[mode] @@ -112,7 +115,10 @@ class Glitch: '''Decrease: 任意の箇所のバイト列を 削除する ''' gf = infile[31:] - index = random.randint(len(gf)-1, 31) + try: + index = random.randint(len(gf)-1, 31) + except ValueError: + return infile gf = gf[:index] + gf[index+1:] return infile[:31] + gf
Add: Remove realy break image file and support of decrease error.
trsqxyz_glitch
train
py
072e11b3bbf24fa624ada1b8e02ec0d85a6fdcfe
diff --git a/src/schema.js b/src/schema.js index <HASH>..<HASH> 100644 --- a/src/schema.js +++ b/src/schema.js @@ -194,8 +194,6 @@ class Attribute { // Marks -let warnedAboutInclusive = false - // ::- Like nodes, marks (which are associated with nodes to signify // things like emphasis or being part of a link) are tagged with type // objects, which are instantiated once per `Schema`. @@ -213,14 +211,6 @@ class MarkType { // The spec on which the type is based. this.spec = spec - if (spec.inclusiveRight === false && spec.inclusive == null) { - spec.inclusive = false - if (!warnedAboutInclusive && typeof console != "undefined" && console.warn) { - warnedAboutInclusive = true - console.warn("MarkSpec.inclusiveRight is now called MarkSpec.inclusive") - } - } - this.attrs = initAttrs(spec.attrs) this.rank = rank
Drop backwards-compat support for inclusiveRight
ProseMirror_prosemirror-model
train
js
f3cc40eeab3056bf93de96f01d4f16322664b46b
diff --git a/lib/grit.rb b/lib/grit.rb index <HASH>..<HASH> 100644 --- a/lib/grit.rb +++ b/lib/grit.rb @@ -7,6 +7,7 @@ require 'time' # stdlib require 'timeout' require 'logger' +require 'digest/sha1' if defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby' require 'open3' @@ -17,7 +18,6 @@ end # third party require 'rubygems' require 'mime/types' -require 'digest/sha1' # internal requires require 'grit/lazy'
digest is in stdlib
mojombo_grit
train
rb
4b58456e9cb4defb3bd73a33cff93a9b8046cb89
diff --git a/src/OData/Client.php b/src/OData/Client.php index <HASH>..<HASH> 100644 --- a/src/OData/Client.php +++ b/src/OData/Client.php @@ -3,7 +3,7 @@ namespace Kily\Tools1C\OData; use Psr\Http\Message\ResponseInterface; -use GuzzleHttp\Exception\TransferException; +use GuzzleHttp\Exception\BadResponseException; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Client as Guzzle; @@ -193,8 +193,8 @@ class Client implements \ArrayAccess try { $resp = $this->client->request($method,$request_str,$options); $this->request_ok = true; - } catch(TransferException $e) { - if($e instanceof TransferException) { + } catch(BadResponseException $e) { + if($e instanceof BadResponseException) { if($e->hasResponse() && ($resp = $e->getResponse()) ) { $this->http_code = $resp->getStatusCode(); $this->http_message = $resp->getReasonPhrase();
fix(guzzle): that fixes #<I> issue
kilylabs_odata-1c
train
php
f6412775f836f4a2b3bb8ec4b61d5aaeeff3a983
diff --git a/src/collectors/memcached/test/testmemcached.py b/src/collectors/memcached/test/testmemcached.py index <HASH>..<HASH> 100644 --- a/src/collectors/memcached/test/testmemcached.py +++ b/src/collectors/memcached/test/testmemcached.py @@ -5,6 +5,7 @@ from test import CollectorTestCase from test import get_collector_config from test import unittest +from mock import MagicMock from mock import Mock from mock import patch @@ -27,6 +28,15 @@ class TestMemcachedCollector(CollectorTestCase): def test_import(self): self.assertTrue(MemcachedCollector) + @patch('socket.socket') + def test_get_raw_stats_works_across_packet_boundaries(self, socket_mock): + socket_instance = MagicMock() + socket_mock.return_value = socket_instance + stats_packets = ['stat foo 1\r\n', 'END\r\n'] + socket_instance.recv.side_effect = stats_packets + stats = self.collector.get_raw_stats('', None) + self.assertEqual(stats, ''.join(stats_packets)) + @patch.object(Collector, 'publish') def test_should_work_with_real_data(self, publish_mock): patch_raw_stats = patch.object(
Add test for stats packets across boundaries.
python-diamond_Diamond
train
py
8a8d9c8a8d0f3452d5de67cd760297bb5759f637
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -41,3 +41,4 @@ setup(name="untwisted", +
Fixing setup.py version.
untwisted_untwisted
train
py
d99641f31e64d63623c7cf58d4355dccea7e80d0
diff --git a/cmd/init.go b/cmd/init.go index <HASH>..<HASH> 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -40,7 +40,7 @@ func newInitCmd() *initCmd { return err } defer gitignore.Close() - if _, err := gitignore.WriteString("dist/\n"); err != nil { + if _, err := gitignore.WriteString("\ndist/\n"); err != nil { return err } diff --git a/cmd/init_test.go b/cmd/init_test.go index <HASH>..<HASH> 100644 --- a/cmd/init_test.go +++ b/cmd/init_test.go @@ -32,7 +32,7 @@ func TestInitGitIgnoreExists(t *testing.T) { bts, err := os.ReadFile(".gitignore") require.NoError(t, err) - require.Equal(t, "mybinary\ndist/\n", string(bts)) + require.Equal(t, "mybinary\n\ndist/\n", string(bts)) } func TestInitFileExists(t *testing.T) {
fix: gitignore patching needs leading newline (#<I>)
goreleaser_goreleaser
train
go,go
85bf9f9928272a0c3c95b964413c4a83677d1ac1
diff --git a/pylast/__init__.py b/pylast/__init__.py index <HASH>..<HASH> 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -2052,11 +2052,6 @@ class Track(_Opus): self._request(self.ws_prefix + '.unlove') - def ban(self): - """Ban this track from ever playing on the radio. """ - - self._request(self.ws_prefix + '.ban') - def get_similar(self): """ Returns similar tracks for this track on the network,
Remove dead Last.fm track ban
pylast_pylast
train
py
f621023c0d93b3d175ac92957e18a2d240dcaa8d
diff --git a/hwt/pyUtils/arrayQuery.py b/hwt/pyUtils/arrayQuery.py index <HASH>..<HASH> 100755 --- a/hwt/pyUtils/arrayQuery.py +++ b/hwt/pyUtils/arrayQuery.py @@ -1,4 +1,5 @@ # select = map, groupBy = itertools.groupby +from collections import deque from itertools import zip_longest from math import inf from types import GeneratorType @@ -117,7 +118,7 @@ def flatten(iterables, level=inf): :param level: maximum depth of flattening """ if level >= 0 and isinstance(iterables, (list, tuple, GeneratorType, - map, zip)): + map, zip, set, deque)): level -= 1 for i in iterables: yield from flatten(i, level=level)
arrayQuery.flatten support for set, deque
Nic30_hwt
train
py