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
2048476cd061113bf6199e5cbec1012439d8d9e4
diff --git a/docs/icons.stories.js b/docs/icons.stories.js index <HASH>..<HASH> 100644 --- a/docs/icons.stories.js +++ b/docs/icons.stories.js @@ -11,6 +11,7 @@ stories.add('icon', () => { 'icon twitter': 'icon twitter', 'icon facebook': 'icon facebook', 'icon github': 'icon github', + 'icon google': 'icon google', 'icon youtube': 'icon youtube', 'icon close': 'icon close', 'octocat animate': 'octocat animate',
feat: add google icon to storybook's icon story
nostalgic-css_NES.css
train
js
94893e79c0458d41e3e2209f928a3a6a7f0cc268
diff --git a/openquake/engine/engine.py b/openquake/engine/engine.py index <HASH>..<HASH> 100644 --- a/openquake/engine/engine.py +++ b/openquake/engine/engine.py @@ -55,8 +55,7 @@ UNABLE_TO_DEL_HC_FMT = 'Unable to delete hazard calculation: %s' UNABLE_TO_DEL_RC_FMT = 'Unable to delete risk calculation: %s' LOG_FORMAT = ('[%(asctime)s %(calc_domain)s #%(calc_id)s %(hostname)s ' - '%(levelname)s %(processName)s/%(process)s %(name)s] ' - '%(message)s') + '%(levelname)s %(processName)s/%(process)s] %(message)s') TERMINATE = str2bool(config.get('celery', 'terminate_workers_on_revoke')) @@ -94,11 +93,6 @@ def _update_log_record(self, record): record.calc_domain = self.calc_domain if not hasattr(record, 'calc_id'): record.calc_id = self.calc.id - logger_name_prefix = 'oq.%s.%s' % (record.calc_domain, record.calc_id) - if record.name.startswith(logger_name_prefix): - record.name = record.name[len(logger_name_prefix):].lstrip('.') - if not record.name: - record.name = 'root' class LogStreamHandler(logging.StreamHandler):
Simplified the LOG_FORMAT by removing the name Former-commit-id: 2bafce0e<I>e<I>cedad5d9a<I>f<I>c8a3a<I>
gem_oq-engine
train
py
bcf0302a8356f14b48f5755c015f723ba74fb506
diff --git a/lib/cuke_slicer/version.rb b/lib/cuke_slicer/version.rb index <HASH>..<HASH> 100644 --- a/lib/cuke_slicer/version.rb +++ b/lib/cuke_slicer/version.rb @@ -1,4 +1,4 @@ module CukeSlicer # The current version for the gem. - VERSION = "2.0.3" + VERSION = "2.0.2" end
Restoring version number Reducing the version number back to the last released version because no significant code changes have actually occurred.
grange-insurance_cuke_slicer
train
rb
d24c3e573241ad1cdfa628424ec18f859168e2e3
diff --git a/scripts/build/babel.js b/scripts/build/babel.js index <HASH>..<HASH> 100644 --- a/scripts/build/babel.js +++ b/scripts/build/babel.js @@ -8,7 +8,7 @@ const babelConfig = require("./babel.config") const Packaging = require("./packaging") const { asyncMkDirP } = require("./utils") -const ignorePatterns = [/\.test.js$/] +const ignorePatterns = [/\.test.js$/, /\/fixtures\//] function walk(base, relativePath = "") { let files = []
wip: ignore fixtures in babel
lingui_js-lingui
train
js
02a07d011de893303bedd3da9511dbb03a528d23
diff --git a/gorequest.go b/gorequest.go index <HASH>..<HASH> 100644 --- a/gorequest.go +++ b/gorequest.go @@ -906,7 +906,7 @@ func changeMapToURLValues(data map[string]interface{}) url.Values { // For example: // // resp, body, errs := gorequest.New().Get("http://www.google.com").End() -// if (errs != nil) { +// if errs != nil { // fmt.Println(errs) // } // fmt.Println(resp, body)
Fix typo in doc Parenthesis are not required around the condition in a if-statement in Go
parnurzeal_gorequest
train
go
517c2353cbb2b3a864b58826d321069da61212b3
diff --git a/client/pages/datasets.js b/client/pages/datasets.js index <HASH>..<HASH> 100644 --- a/client/pages/datasets.js +++ b/client/pages/datasets.js @@ -102,7 +102,13 @@ module.exports = PageView.extend({ }); reader.onload = function (ev) { - csv.parse(ev.target.result, function (err, data) { + var options = { + columns: true, // treat first line as header with column names + relax_column_count: false, // accept malformed lines + comment: '' // Treat all the characters after this one as a comment. + }; + + csv.parse(ev.target.result, options, function (err, data) { if (err) { console.warn(err.message); app.message({
Treat first line in CSV file as header with column names Closes #<I>
NLeSC_spot
train
js
733168dbc07a91397691847f284aef1af8a283c8
diff --git a/gameserver/php/Neuron/GameServer/Mappers/PlayerMapper.php b/gameserver/php/Neuron/GameServer/Mappers/PlayerMapper.php index <HASH>..<HASH> 100644 --- a/gameserver/php/Neuron/GameServer/Mappers/PlayerMapper.php +++ b/gameserver/php/Neuron/GameServer/Mappers/PlayerMapper.php @@ -380,7 +380,7 @@ class Neuron_GameServer_Mappers_PlayerMapper } else { - $total = count ($total) > 0 ? $total[0]['total'] : 1; + $rank = self::countAll (); } $rank = $rank + 1;
Fixing tiny error in ranking of PlayerMapper.
CatLabInteractive_dolumar-engine
train
php
031b8ee310d8ae4a687d8254dd0f703ea10c7230
diff --git a/migrate.go b/migrate.go index <HASH>..<HASH> 100644 --- a/migrate.go +++ b/migrate.go @@ -33,7 +33,9 @@ type MigrationSet struct { // SchemaName schema that the migration table be referenced. SchemaName string // IgnoreUnknown skips the check to see if there is a migration - // ran in the database that is not in MigrationSource + // ran in the database that is not in MigrationSource. + // + // This should be used sparingly as it is removing a saftey check. IgnoreUnknown bool } @@ -106,6 +108,8 @@ func SetSchema(name string) { // SetIgnoreUnknown sets the flag that skips database check to see if there is a // migration in the database that is not in migration source. +// +// This should be used sparingly as it is removing a saftey check. func SetIgnoreUnknown(v bool) { migSet.IgnoreUnknown = v }
Add a comment to iterate that IgnoreUnknown should be used sparingly
rubenv_sql-migrate
train
go
a3002aafd81862345834735c7724d8557c156e2a
diff --git a/tuf/utils/role_sort.go b/tuf/utils/role_sort.go index <HASH>..<HASH> 100644 --- a/tuf/utils/role_sort.go +++ b/tuf/utils/role_sort.go @@ -19,6 +19,9 @@ func (r RoleList) Len() int { func (r RoleList) Less(i, j int) bool { segsI := strings.Split(r[i], "/") segsJ := strings.Split(r[j], "/") + if len(segsI) == len(segsJ) { + return strings.Compare(r[i], r[j]) == -1 + } return len(segsI) < len(segsJ) }
make roles sort alphabetically when equivalent number of segments
theupdateframework_notary
train
go
e56c88f80a093bd431aa0bfc8c552d70230effbf
diff --git a/language/phpmailer.lang-sk.php b/language/phpmailer.lang-sk.php index <HASH>..<HASH> 100644 --- a/language/phpmailer.lang-sk.php +++ b/language/phpmailer.lang-sk.php @@ -3,6 +3,7 @@ * Slovak PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Michal Tinka <michaltinka@gmail.com> + * @author Peter Orlický <pcmanik91@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; @@ -23,4 +24,4 @@ $PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; $PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; $PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: ';
Update Slovak translation (#<I>)
PHPMailer_PHPMailer
train
php
11b3812ad24078064083fd972cbafdb5b0db8bdc
diff --git a/webdriver/test/com/googlecode/jmeter/plugins/webdriver/config/RemoteDriverConfigTest.java b/webdriver/test/com/googlecode/jmeter/plugins/webdriver/config/RemoteDriverConfigTest.java index <HASH>..<HASH> 100644 --- a/webdriver/test/com/googlecode/jmeter/plugins/webdriver/config/RemoteDriverConfigTest.java +++ b/webdriver/test/com/googlecode/jmeter/plugins/webdriver/config/RemoteDriverConfigTest.java @@ -60,6 +60,8 @@ public class RemoteDriverConfigTest { assertThat(config.getCapability(), is(RemoteCapability.FIREFOX)); config.setCapability(RemoteCapability.INTERNET_EXPLORER); assertThat(config.getCapability(), is(RemoteCapability.INTERNET_EXPLORER)); + config.setCapability(RemoteCapability.PHANTOMJS); + assertThat(config.getCapability(), is(RemoteCapability.PHANTOMJS)); } @Test
Add tests to PhantomJS (GhostDriver) capability Test PhantomJS (GhostDriver) capability
undera_jmeter-plugins
train
java
069792f67f3c4f3d944becff6a4c585a0b4798f9
diff --git a/src/language/HTMLInstrumentation.js b/src/language/HTMLInstrumentation.js index <HASH>..<HASH> 100644 --- a/src/language/HTMLInstrumentation.js +++ b/src/language/HTMLInstrumentation.js @@ -884,6 +884,10 @@ define(function (require, exports, module) { textAfterID; /** + * We initially put new edit objects into the `newEdits` array so that we + * can fix them up with proper positioning information. This function is + * responsible for doing that fixup. + * * The `beforeID` that appears in many edits tells the browser to make the * change before the element with the given ID. In other words, an * elementInsert with a `beforeID` of 32 would result in something like @@ -899,7 +903,7 @@ define(function (require, exports, module) { * * @param {int} beforeID ID to set on the pending edits */ - var addBeforeID = function (beforeID) { + var finalizeNewEdits = function (beforeID) { newEdits.forEach(function (edit) { // elementDeletes don't need any positioning information if (edit.type !== "elementDelete") { @@ -1182,7 +1186,7 @@ define(function (require, exports, module) { } else { // Since this element hasn't moved, it is a suitable "beforeID" // for the edits we've logged. - addBeforeID(oldChild.tagID); + finalizeNewEdits(oldChild.tagID); currentIndex++; oldIndex++; }
Renamed addBeforeID to finalizeNewEdits
adobe_brackets
train
js
25be29099f2a32af92d3531491c804193ce4ec31
diff --git a/src/ol/tilequeue.js b/src/ol/tilequeue.js index <HASH>..<HASH> 100644 --- a/src/ol/tilequeue.js +++ b/src/ol/tilequeue.js @@ -105,11 +105,12 @@ ol.TileQueue.prototype.loadMoreTiles = function() { */ ol.TileQueue.prototype.reprioritize = function() { if (!this.queue_.isEmpty()) { - var queue = this.queue_; - this.queue_ = new goog.structs.PriorityQueue(); + var values = /** @type {Array.<Array>} */ this.queue_.getValues(); + this.queue_.clear(); this.queuedTileKeys_ = {}; - while (!queue.isEmpty()) { - this.enqueue.apply(this, /** @type {Array} */ (queue.remove())); + var i; + for (i = 0; i < values.length; ++i) { + this.enqueue.apply(this, values[i]); } } };
Improved reprioritization
openlayers_openlayers
train
js
6ca3f72b62c8e0b6d2a2e3354e313687e2c4181e
diff --git a/p2p/host/peerstore/pstoremem/peerstore.go b/p2p/host/peerstore/pstoremem/peerstore.go index <HASH>..<HASH> 100644 --- a/p2p/host/peerstore/pstoremem/peerstore.go +++ b/p2p/host/peerstore/pstoremem/peerstore.go @@ -11,20 +11,20 @@ import ( type pstoremem struct { peerstore.Metrics - memoryKeyBook - memoryAddrBook - memoryProtoBook - memoryPeerMetadata + *memoryKeyBook + *memoryAddrBook + *memoryProtoBook + *memoryPeerMetadata } // NewPeerstore creates an in-memory threadsafe collection of peers. func NewPeerstore() *pstoremem { return &pstoremem{ Metrics: pstore.NewMetrics(), - memoryKeyBook: *NewKeyBook(), - memoryAddrBook: *NewAddrBook(), - memoryProtoBook: *NewProtoBook(), - memoryPeerMetadata: *NewPeerMetadata(), + memoryKeyBook: NewKeyBook(), + memoryAddrBook: NewAddrBook(), + memoryProtoBook: NewProtoBook(), + memoryPeerMetadata: NewPeerMetadata(), } }
fix: make close work again Reference pstoremem components by pointer to: 1. Avoid copying locks around on construction. 2. Avoid copying these around when calling `weakClose`. 3. Ensures that they all implement the `io.Closer` interface (it's implemented on the pointer, not the value). Technically, we could have just taken a reference when calling `weakClose`, but this is cleaner.
libp2p_go-libp2p
train
go
fcd1d66b6e7be6848070729514119364ac31754b
diff --git a/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java b/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java index <HASH>..<HASH> 100644 --- a/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java +++ b/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java @@ -309,8 +309,7 @@ public class Environment extends AbstractLifeCycle { * @param value the value of the Jersey property * @see ResourceConfig */ - public void setJerseyProperty(String name, - @Nullable Object value) { + public void setJerseyProperty(String name, @Nullable Object value) { config.getProperties().put(checkNotNull(name), value); } @@ -535,7 +534,7 @@ public class Environment extends AbstractLifeCycle { } public void setJerseyServletContainer(ServletContainer jerseyServletContainer) { - this.jerseyServletContainer = jerseyServletContainer; + this.jerseyServletContainer = checkNotNull(jerseyServletContainer); } public String getName() {
Enforce the existence of a replacement Jersey container. Fixes #<I>.
dropwizard_dropwizard
train
java
6c45edb2814f1e01da2feefa4c6e4c7850c31855
diff --git a/lib/Widget/Resource/i18n/zh-CN/validator.php b/lib/Widget/Resource/i18n/zh-CN/validator.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Resource/i18n/zh-CN/validator.php +++ b/lib/Widget/Resource/i18n/zh-CN/validator.php @@ -167,6 +167,9 @@ return array( '%name% must be valid phone number' => '%name%必须是有效的电话号码', '%name% must not be phone number' => '%name%不能是电话号码', + '%name% must be valid Chinese plate number' => '%name%必须是正确的车牌格式', + '%name% must not be valid Chinese plate number' => '%name%不能是正确的车牌格式', + // postcode '%name% must be six length of digit' => '%name%必须是6位长度的数字', '%name% must not be postcode' => '%name%必须是6位长度的数字',
added zh-CN messages for plate number validator
twinh_wei
train
php
c8b45ff00f9d9bc496d53685ede7d2d9573457cc
diff --git a/lib/vagrant-vbguest/installers/linux.rb b/lib/vagrant-vbguest/installers/linux.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant-vbguest/installers/linux.rb +++ b/lib/vagrant-vbguest/installers/linux.rb @@ -78,7 +78,7 @@ module VagrantVbguest opts = { :sudo => true }.merge(opts || {}) - communicate.test('lsmod | grep vboxguest && test -e /lib/modules/`uname -r`/misc/vboxsf.ko', opts, &block) + communicate.test('grep -qE "^vboxguest\s.+\s\([^\s]*O[^\s]*\)$" /proc/modules && test -e /lib/modules/`uname -r`/misc/vboxsf.ko', opts, &block) end # This overrides {VagrantVbguest::Installers::Base#guest_version}
Better detection of "running" guest additions Avoid detecting the guest additions as running when the in-kernel module is loaded and the additions have just been built.
dotless-de_vagrant-vbguest
train
rb
6d1f1e82c5b82878f771725cc356cc301bbed985
diff --git a/lib/svg/__init__.py b/lib/svg/__init__.py index <HASH>..<HASH> 100644 --- a/lib/svg/__init__.py +++ b/lib/svg/__init__.py @@ -420,7 +420,7 @@ def parse_transform(e, path): from nodebox.graphics import Transform t = Transform() if mode == "matrix": - t._set_matrix(v) + t.set_matrix(v) elif mode == "translate": t.translate(*v) path = t.transformBezierPath(path) diff --git a/shoebot/data/transforms.py b/shoebot/data/transforms.py index <HASH>..<HASH> 100644 --- a/shoebot/data/transforms.py +++ b/shoebot/data/transforms.py @@ -31,6 +31,9 @@ class Transform: ''' def __init__(self, transform=None): self.stack = [] + self.set_matrix(transform) + + def set_matrix(self, transform=None): if transform is None: pass elif isinstance(transform, Transform):
Use a set_matrix method in Transforms Originally meant to play nice with the SVG lib, but it's better to have it as a dedicated method instead of only in __init__
shoebot_shoebot
train
py,py
14aaa2d75bd8acd44bf4f7e584bb50fd5f47dac7
diff --git a/admin/cli/upgrade.php b/admin/cli/upgrade.php index <HASH>..<HASH> 100644 --- a/admin/cli/upgrade.php +++ b/admin/cli/upgrade.php @@ -49,13 +49,21 @@ list($options, $unrecognized) = cli_get_params( array( 'non-interactive' => false, 'allow-unstable' => false, - 'help' => false + 'help' => false, + 'lang' => 'en' ), array( 'h' => 'help' ) ); +global $SESSION; +if ($options['lang']) { + $SESSION->lang = $options['lang']; +} else { + $SESSION->lang = 'en'; +} + $interactive = empty($options['non-interactive']); if ($unrecognized) { @@ -74,6 +82,7 @@ Options: --non-interactive No interactive questions or confirmations --allow-unstable Upgrade even if the version is not marked as stable yet, required in non-interactive mode. +--lang=CODE Set preferred language for CLI output, during upgrade process (default:en). -h, --help Print out this help Example:
MDL-<I> upgrade: Option to display CLI upgrade messages in English
moodle_moodle
train
php
d9b664b65163056a3784dbd583e4bbba6144f5b2
diff --git a/wooey/backend/utils.py b/wooey/backend/utils.py index <HASH>..<HASH> 100644 --- a/wooey/backend/utils.py +++ b/wooey/backend/utils.py @@ -248,7 +248,7 @@ def add_wooey_script(script_version=None, script_path=None, group=None, script_n checksum=checksum, script__script_name=script_name ).order_by('script_version', 'script_iteration').last() - if existing_version is not None: + if existing_version is not None and (script_version is not None and existing_version != script_version): return { 'valid': True, 'errors': None,
Add in a check if the existing version is the script currently being added
wooey_Wooey
train
py
5f40cfe37e72cbfa12381c37ac7c49be0a06d1f2
diff --git a/ford/__init__.py b/ford/__init__.py index <HASH>..<HASH> 100644 --- a/ford/__init__.py +++ b/ford/__init__.py @@ -48,7 +48,7 @@ __appname__ = "FORD" __author__ = "Chris MacMackin" __credits__ = ["Balint Aradi", "Iain Barrass", "Izaak Beekman", "Jérémie Burgalat", "David Dickinson", - "Gavin Huttley", "Harald Klimach", "Ibarrass-qmul", + "Gavin Huttley", "Harald Klimach", "Nick R. Papior", "Marco Restelli", "Schildkroete23", "Stephen J. Turnbull", "Jacob Williams", "Stefano Zhagi"] __license__ = "GPLv3"
"Ibarrass-qmul" is "Iain Barrass"
Fortran-FOSS-Programmers_ford
train
py
5ba077050d60791f1d20825a1bf20caab05af6de
diff --git a/lib/rack/gc_tracer.rb b/lib/rack/gc_tracer.rb index <HASH>..<HASH> 100644 --- a/lib/rack/gc_tracer.rb +++ b/lib/rack/gc_tracer.rb @@ -6,10 +6,10 @@ require 'gc_tracer' module Rack class GCTracerMiddleware - def initialize app, view_page_path: nil, filename: nil, **kw + def initialize app, view_page_path: nil, filename: nil, logging_filename: nil, **kw @app = app @view_page_path = view_page_path - @logging_filename = filename || GC::Tracer.env_logging_filename + @logging_filename = filename || logging_filename || GC::Tracer.env_logging_filename if @logging_filename && view_page_path @view_page_pattern = /\A#{view_page_path}/
add logging_filename for backword compatibility
ko1_gc_tracer
train
rb
24f9e3e1bf015d53261078e921c48ef7deaac366
diff --git a/src/module/Max7219.js b/src/module/Max7219.js index <HASH>..<HASH> 100644 --- a/src/module/Max7219.js +++ b/src/module/Max7219.js @@ -62,5 +62,38 @@ this._board.send([0xf0, 4, 8, 2, 0xf7]); }; + proto.animate = function(data, times, duration, callback) { + var p = 0; + + if (typeof arguments[arguments.length - 1] === 'function') { + callback = arguments[arguments.length - 1]; + } else { + callback = function() {}; + } + + var run = function() { + this.on(data[p++ % data.length]); + this._timer = setTimeout(run, times); + }.bind(this); + + var stop = function() { + clearTimeout(this._timer); + callback(); + }.bind(this); + + if (times && times > 0) { + run(); + } + + if (duration && duration > 0) { + this._timerDuration = setTimeout(stop, duration); + } + }; + + proto.animateStop = function() { + clearTimeout(this._timer); + clearTimeout(this._timerDuration); + }; + scope.module.Max7219 = Max7219; })); \ No newline at end of file
Fixed bug: animate of max<I>.
webduinoio_webduino-js
train
js
96bf97755eaf21b51562b279498eec07f9236f44
diff --git a/.bumpversion.cfg b/.bumpversion.cfg index <HASH>..<HASH> 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.13.1 +current_version = 1.13.2 commit = False tag = False diff --git a/microcosm_flask/fields/enum_field.py b/microcosm_flask/fields/enum_field.py index <HASH>..<HASH> 100644 --- a/microcosm_flask/fields/enum_field.py +++ b/microcosm_flask/fields/enum_field.py @@ -4,6 +4,8 @@ Enum-valued field. Supports both by name (preferred) and by value (discouraged) encoding. """ +from enum import Enum + from marshmallow.fields import Field @@ -28,7 +30,7 @@ class EnumField(Field): def _serialize(self, value, attr, obj): if value is None: return value - elif isinstance(value, str): + elif isinstance(value, str) and not isinstance(value, Enum): return value elif self.by_value: return value.value diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup project = "microcosm-flask" -version = "1.13.1" +version = "1.13.2" setup( name=project,
Handle enums that are both string and enum.
globality-corp_microcosm-flask
train
cfg,py,py
85cefce056e6eb1c02dac1fadf1cf4c97d0b74ed
diff --git a/aws/data_source_aws_outposts_outposts.go b/aws/data_source_aws_outposts_outposts.go index <HASH>..<HASH> 100644 --- a/aws/data_source_aws_outposts_outposts.go +++ b/aws/data_source_aws_outposts_outposts.go @@ -38,6 +38,11 @@ func dataSourceAwsOutpostsOutposts() *schema.Resource { Optional: true, Computed: true, }, + "owner_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, }, } } @@ -71,6 +76,10 @@ func dataSourceAwsOutpostsOutpostsRead(d *schema.ResourceData, meta interface{}) continue } + if v, ok := d.GetOk("owner_id"); ok && v.(string) != aws.StringValue(outpost.OwnerId) { + continue + } + arns = append(arns, aws.StringValue(outpost.OutpostArn)) ids = append(ids, aws.StringValue(outpost.OutpostId)) }
Added owner_id argument in outposts data source.
terraform-providers_terraform-provider-aws
train
go
698fbddc8dc6af2a3de32024d07da23642dd855a
diff --git a/bin/traceur.js b/bin/traceur.js index <HASH>..<HASH> 100644 --- a/bin/traceur.js +++ b/bin/traceur.js @@ -5963,9 +5963,6 @@ var $__src_syntax_Parser_js =(function() { this.eatPossibleImplicitSemiColon_(); return new ExportMappingList(this.getTreeLocation_(start), mappings); }, - peekExportMapping_: function() { - return this.peek_(TokenType.OPEN_CURLY) || this.peekId_(); - }, parseExportMapping_: function(load) { var start = this.getTreeStartLocation_(); var specifierSet, expression; diff --git a/src/syntax/Parser.js b/src/syntax/Parser.js index <HASH>..<HASH> 100644 --- a/src/syntax/Parser.js +++ b/src/syntax/Parser.js @@ -474,10 +474,6 @@ export class Parser { return new ExportMappingList(this.getTreeLocation_(start), mappings); } - peekExportMapping_() { - return this.peek_(TokenType.OPEN_CURLY) || this.peekId_(); - } - parseExportMapping_(load) { // ExportMapping ::= // Identifier ("from" ModuleExpression(load))?
Remove dead code (peekExportMapping_) from parser
google_traceur-compiler
train
js,js
9f0144b782d245b588da7a1a6156da337135b673
diff --git a/src/ConnectionInterface.php b/src/ConnectionInterface.php index <HASH>..<HASH> 100644 --- a/src/ConnectionInterface.php +++ b/src/ConnectionInterface.php @@ -21,4 +21,11 @@ interface ConnectionInterface * @return ConnectionInterface */ public static function getDb($dbname = null); + + /** + * Creates API command. + * @param array $config + * @return mixed response + */ + public function createCommand(array $config = []); }
+ createCommand to ConnectionInterface
hiqdev_yii2-hiart
train
php
3d50f5ef5286c2c1c55d5f4d9bf1713041121a82
diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/article_spec.rb +++ b/spec/models/article_spec.rb @@ -171,6 +171,11 @@ describe Article, type: :model do allow(mock_pinger).to receive(:send_pingback_or_trackback) article.save! + + 10.times do + break if Thread.list.count == 1 + sleep 0.1 + end end it 'lets a Ping::Pinger object send pingback to the external URLs' do @@ -178,13 +183,6 @@ describe Article, type: :model do with(article.permalink_url, Ping) expect(mock_pinger).to have_received :send_pingback_or_trackback end - - after do - 10.times do - break if Thread.list.count == 1 - sleep 0.1 - end - end end end
Ensure threads are done before checking calls
publify_publify
train
rb
ebed73332757351735b1c54d899334b144c0254d
diff --git a/lib/OpenLayers/Format/SLD/v1.js b/lib/OpenLayers/Format/SLD/v1.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Format/SLD/v1.js +++ b/lib/OpenLayers/Format/SLD/v1.js @@ -667,8 +667,16 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.XML, { }, "PolygonSymbolizer": function(symbolizer) { var node = this.createElementNSPlus("PolygonSymbolizer"); - this.writeNode(node, "Fill", symbolizer); - this.writeNode(node, "Stroke", symbolizer); + if(symbolizer.fillColor != undefined || + symbolizer.fillOpacity != undefined) { + this.writeNode(node, "Fill", symbolizer); + } + if(symbolizer.strokeWidth != undefined || + symbolizer.strokeColor != undefined || + symbolizer.strokeOpacity != undefined || + symbolizer.strokeDashstyle != undefined) { + this.writeNode(node, "Stroke", symbolizer); + } return node; }, "Fill": function(symbolizer) {
Create Fill and Stroke nodes only for PolygonSymbolizers that actually have fill and stroke symbolizer properties. r=tschaub (closes #<I>) git-svn-id: <URL>
openlayers_openlayers
train
js
9dd33b204b883e9fff9c936fb7ffbe34081e305b
diff --git a/tofu/geom/_core.py b/tofu/geom/_core.py index <HASH>..<HASH> 100644 --- a/tofu/geom/_core.py +++ b/tofu/geom/_core.py @@ -2025,7 +2025,7 @@ class CoilPF(StructOut): def set_current(self, current=None): """ Set the current circulating on the coil (A) """ - C0 = I is None + C0 = current is None C1 = type(current) in [int, float, np.int64, np.float64] C2 = type(current) in [list, tuple, np.ndarray] msg = "Arg current must be None, a float or an 1D np.ndarray !"
[quick-bf] I variable name was left un-refactored
ToFuProject_tofu
train
py
b740dd981dd4a00731774273655259a9d4f2e021
diff --git a/src/Xavrsl/Cas/Sso.php b/src/Xavrsl/Cas/Sso.php index <HASH>..<HASH> 100644 --- a/src/Xavrsl/Cas/Sso.php +++ b/src/Xavrsl/Cas/Sso.php @@ -85,11 +85,7 @@ class Sso { private function configureSslValidation() { // set SSL validation for the CAS server - if ($this->config['cas_validation'] == 'self') - { - phpCAS::setCasServerCert($this->config['cas_cert']); - } - else if ($this->config['cas_validation'] == 'ca') + if ($this->config['cas_validation'] == 'ca' || $this->config['cas_validation'] == 'self') { phpCAS::setCasServerCACert($this->config['cas_cert']); } diff --git a/src/config/cas.php b/src/config/cas.php index <HASH>..<HASH> 100644 --- a/src/config/cas.php +++ b/src/config/cas.php @@ -55,8 +55,8 @@ return [ | CAS Validation |-------------------------------------------------------------------------- | - | CAS server SSL validation: 'self' for self-signed certificate, 'ca' for - | certificate from a CA, empty for no SSL validation. + | CAS server SSL validation: 'ca' for certificate from a CA or self-signed + | certificate, empty for no SSL validation. | */
Remove self signed cert option the "bogus setCasServerCert() function" has been removed from phpCAS. Use setCasServerCACert() for self-signed certs. configureSslValidation() still checks for 'self' as_validation option and uses setCasServerCACert() for backwards compatibility.
XavRsl_Cas
train
php,php
b766b2dab5b34c323782b3d14513f3c862e65ac2
diff --git a/src/ResourceBase.js b/src/ResourceBase.js index <HASH>..<HASH> 100644 --- a/src/ResourceBase.js +++ b/src/ResourceBase.js @@ -25,6 +25,7 @@ class ResourceBase { // Setup options const opts = Object.assign(options, {}) // clone options opts.from = await this.contractService.currentAccount() + opts.gas = options.gas || 50000 // Default gas // Get contract and run trasaction const contractDefinition = this.contractDefinition const contract = await contractDefinition.at(address) diff --git a/src/resources/purchases.js b/src/resources/purchases.js index <HASH>..<HASH> 100644 --- a/src/resources/purchases.js +++ b/src/resources/purchases.js @@ -40,7 +40,7 @@ class Purchases extends ResourceBase{ } async sellerConfirmShipped(address) { - return await this.contractFn(address, "sellerConfirmShipped") + return await this.contractFn(address, "sellerConfirmShipped",[], {gas: 80000}) } async buyerConfirmReceipt(address) {
Metamask's gas estimates/defaults are sometimes too low. Metamask and web3's default gas sent values change from release to release. What worked before can be too low later. We'll set a default gas amount of <I> for origin.js transactions. (This is about <I> cents in at current gas prices.) As before, and individual origin.js API contract transactions can set their own gas to be sent.
OriginProtocol_origin-js
train
js,js
48ee87ce9c90340f5111e9b7a0bef22e81ce9032
diff --git a/lib/capistrano/configuration/server.rb b/lib/capistrano/configuration/server.rb index <HASH>..<HASH> 100644 --- a/lib/capistrano/configuration/server.rb +++ b/lib/capistrano/configuration/server.rb @@ -27,14 +27,15 @@ module Capistrano def select?(options) options.each do |k,v| callable = v.respond_to?(:call) ? v: ->(server){server.fetch(v)} - result = case k - when :filter, :select - callable.call(self) - when :exclude - !callable.call(self) - else - self.fetch(k) == v - end + result = \ + case k + when :filter, :select + callable.call(self) + when :exclude + !callable.call(self) + else + self.fetch(k) == v + end return false unless result end return true diff --git a/spec/lib/capistrano/application_spec.rb b/spec/lib/capistrano/application_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/capistrano/application_spec.rb +++ b/spec/lib/capistrano/application_spec.rb @@ -51,7 +51,7 @@ describe Capistrano::Application do def command_line(*options) options.each { |opt| ARGV << opt } - def subject.exit(*_args) + subject.define_singleton_method(:exit) do |*_args| throw(:system_exit, :exit) end subject.run
Fix lint warnings identified by RuboCop
capistrano_capistrano
train
rb,rb
4e0be28cbda6980385694d3dd37e93bc386348cb
diff --git a/lib/active_record/connection_adapters/sqlserver_adapter.rb b/lib/active_record/connection_adapters/sqlserver_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -97,7 +97,11 @@ module ActiveRecord end def table_klass - @table_klass ||= table_name.classify.constantize rescue nil + @table_klass ||= begin + table_name.classify.constantize + rescue StandardError, NameError, LoadError + nil + end (@table_klass && @table_klass < ActiveRecord::Base) ? @table_klass : nil end
Column reflection on table name rescues LoadError and a few others.
rails-sqlserver_activerecord-sqlserver-adapter
train
rb
9343928d972d1b4bff02b6a0b032f2a2925ccc28
diff --git a/src/Mcfedr/QueueManagerBundle/Command/RunnerCommand.php b/src/Mcfedr/QueueManagerBundle/Command/RunnerCommand.php index <HASH>..<HASH> 100644 --- a/src/Mcfedr/QueueManagerBundle/Command/RunnerCommand.php +++ b/src/Mcfedr/QueueManagerBundle/Command/RunnerCommand.php @@ -150,6 +150,8 @@ abstract class RunnerCommand extends Command implements ContainerAwareInterface if (isset($handle)) { pcntl_signal_dispatch(); } + + gc_collect_cycles(); } while ($running && ($ignoreLimit || $limit > 0)); }
add call to gc_collect Seems like this shouldn’t be needed. But it helps keep the amount of memory used down. Php doesn’t seem to be very clever about calling this itself
mcfedr_queue-manager-bundle
train
php
846d890b7c1857f294de6241e8ca148ecca51e2e
diff --git a/test/main.js b/test/main.js index <HASH>..<HASH> 100755 --- a/test/main.js +++ b/test/main.js @@ -160,7 +160,7 @@ describe('gulp-twig', function () { }, }); - var fakeFile = new gutil.File({ + var fakeFile = new Vinyl({ base: 'test/', cwd: 'test/', path: path.join(__dirname, '/templates/file.twig'),
Fixed tests for #<I> (#<I>)
zimmen_gulp-twig
train
js
b016149fbfd62e9112986a1bb6e790129b6eaed2
diff --git a/pyairtable/__init__.py b/pyairtable/__init__.py index <HASH>..<HASH> 100644 --- a/pyairtable/__init__.py +++ b/pyairtable/__init__.py @@ -1,3 +1,3 @@ -__version__ = "1.0.1" +__version__ = "1.1.0" from .api import Api, Base, Table # noqa
Publish Version: <I>
gtalarico_airtable-python-wrapper
train
py
9612e7bac87d3b5447a9ebba1a61584a3ca3bf48
diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js index <HASH>..<HASH> 100644 --- a/lib/determine-basal/determine-basal.js +++ b/lib/determine-basal/determine-basal.js @@ -477,7 +477,9 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ minPredBG = Math.min(minPredBG, maxCOBPredBG); } // set snoozeBG to minPredBG if it's higher - snoozeBG = round(Math.max(snoozeBG,minPredBG)); + if (minPredBG < 400) { + snoozeBG = round(Math.max(snoozeBG,minPredBG)); + } rT.snoozeBG = snoozeBG; //console.error(minPredBG, minIOBPredBG, minUAMPredBG, minCOBPredBG, maxCOBPredBG, snoozeBG);
don't set snoozeBG if minPredBG >= <I>
openaps_oref0
train
js
df9d618a3698c72a9274be7d8c05de90b6200c57
diff --git a/tests/inc/TestCase.php b/tests/inc/TestCase.php index <HASH>..<HASH> 100644 --- a/tests/inc/TestCase.php +++ b/tests/inc/TestCase.php @@ -44,7 +44,7 @@ class TestCase extends Tester\TestCase $configurator = new Configurator(); if (!Helper::isRunByRunner()) { - $configurator->enableDebugger(__DIR__ . '/log'); + $configurator->enableDebugger(__DIR__ . '/../log'); } $hashData = json_encode($dbConfig);
tests: fix log dir when simply run with debugger
nextras_orm
train
php
5fe448a1a66f84236eea8cbca445b108ae96f8ef
diff --git a/lib/closure_tree/support_attributes.rb b/lib/closure_tree/support_attributes.rb index <HASH>..<HASH> 100644 --- a/lib/closure_tree/support_attributes.rb +++ b/lib/closure_tree/support_attributes.rb @@ -1,12 +1,11 @@ require 'forwardable' module ClosureTree module SupportAttributes - extend Forwardable def_delegators :model_class, :connection, :transaction, :table_name, :base_class, :inheritance_column, :column_names def advisory_lock_name - "ClosureTree::#{base_class.name}" + Digest::SHA1.hexdigest("ClosureTree::#{base_class.name}")[0..32] end def quoted_table_name
use first <I> chars from Digest::SHA1 of class
ClosureTree_closure_tree
train
rb
0bb147275d6f188c45803bb49b71858f0f4cc8e6
diff --git a/lib/torrent.js b/lib/torrent.js index <HASH>..<HASH> 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -362,7 +362,10 @@ Torrent.prototype.destroy = function (cb) { clearInterval(self._rechokeIntervalId) self._rechokeIntervalId = null } - + + self.files.forEach(function (file) { + if (file._blobURL) window.URL.revokeObjectURL(file._blobURL) + }) if (self._torrentFileURL) window.URL.revokeObjectURL(self._torrentFileURL) var tasks = []
fixed #<I> blobURL cleanup Couldn't find tests to go along with the changes
webtorrent_webtorrent
train
js
184647063b525e371fb7fe2d50dfcf1b47eda9cc
diff --git a/lib/prerender_rails.rb b/lib/prerender_rails.rb index <HASH>..<HASH> 100644 --- a/lib/prerender_rails.rb +++ b/lib/prerender_rails.rb @@ -2,7 +2,7 @@ module Rack class Prerender require 'net/http' - DISALLOW_PHANTOMJS_HEADERS = %w( + DISALLOWED_PHANTOMJS_HEADERS = %w( cache-control content-length content-type @@ -154,7 +154,7 @@ module Rack # Pass through only applicable prerendered_response.each do |name, val| - next if DISALLOW_PHANTOMJS_HEADERS.include? name + next if DISALLOWED_PHANTOMJS_HEADERS.include? name Rails.logger.debug "Prerender response header: #{name} #{val}" response[name] = val end
Better naming for phantomjs filtered headers constant.
prerender_prerender_rails
train
rb
2e4fc961b03aade8c6d167a71a3d25d390d53a7b
diff --git a/src/main/java/org/jongo/Insert.java b/src/main/java/org/jongo/Insert.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jongo/Insert.java +++ b/src/main/java/org/jongo/Insert.java @@ -80,9 +80,7 @@ class Insert { private DBObject convertToDBObject(Object pojo, Object id) { BsonDocument document = marshallDocument(pojo); - DBObject dbo = new AlreadyCheckedDBObject(document.toByteArray(), id); - dbo.put("_id", id); - return dbo; + return new AlreadyCheckedDBObject(document.toByteArray(), id); } private BsonDocument marshallDocument(Object pojo) {
No longer put _id into DBObject during insert
bguerout_jongo
train
java
0b625831972ea9f88f90ef942aed0a71f0cf04a7
diff --git a/gulpfile.babel.js b/gulpfile.babel.js index <HASH>..<HASH> 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -41,6 +41,7 @@ const bs = browserSync.create(), exclude: [ './node_modules/process-es6/browser.js', './node_modules/rollup-plugin-node-globals/src/global.js', + './node_modules/symbol-observable/es/index.js' ] }), babel(),
ignore symbol-observable in rollup, throws import / export failure
simplajs_simpla
train
js
165c09fc6386f1376a922c465f1ba6ec02031f28
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -152,6 +152,11 @@ player.use(localfile); player.use(youtube); player.use(transcode); +player.use(function(ctx, next) { + if (!ctx.options.type) ctx.options.type = 'video/mp4'; + next(); +}); + if (!opts.path) { player.attach(opts, ctrl); } else {
always use 'video/mp4' as mime-type if nothing else was specified
xat_castnow
train
js
def7f1473ea82f817713c06164cec429c9016d55
diff --git a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/annotations/SipAnnotationProcessor.java b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/annotations/SipAnnotationProcessor.java index <HASH>..<HASH> 100644 --- a/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/annotations/SipAnnotationProcessor.java +++ b/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/annotations/SipAnnotationProcessor.java @@ -65,8 +65,10 @@ public class SipAnnotationProcessor extends DefaultAnnotationProcessor { protected boolean lookupResourceInServletContext(Object instance, Field field, String annotationName) { String typeName = field.getType().getCanonicalName(); + if(annotationName == null || annotationName.equals("")) annotationName = typeName; Object objectToInject = sipContext.getServletContext().getAttribute(typeName); - if(objectToInject != null && field.getType().isAssignableFrom(objectToInject.getClass())) { + if(objectToInject != null && + field.getType().isAssignableFrom(objectToInject.getClass())) { boolean accessibility = false; accessibility = field.isAccessible(); field.setAccessible(true);
Geeralized lookup - any matching name found in the servlet context would be injected. Date: <I>-<I>-<I> <I>:<I>:<I> git-svn-id: <URL>
RestComm_sip-servlets
train
java
68b6847767c5f6914efd1891df957f7db0efdc1e
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,7 @@ github_sponsors_url = f'{github_url}/sponsors' extensions = [ 'sphinx.ext.extlinks', # allows to create custom roles easily + 'sphinx.ext.intersphinx', # allows interlinking external docs sites 'jaraco.packaging.sphinx', 'rst.linker', ] @@ -155,3 +156,10 @@ nitpicky = True # Ref: https://github.com/python-attrs/attrs/pull/571/files\ # #diff-85987f48f1258d9ee486e3191495582dR82 default_role = 'any' + + +# Allow linking objects on other Sphinx sites seamlessly: +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), + 'python2': ('https://docs.python.org/2', None), +}
Enable intersphinx to link against CPython docs
pypa_setuptools
train
py
8a27d949a7095017f2700e1aaa098bf5f06cb462
diff --git a/km3pipe/io/hdf5.py b/km3pipe/io/hdf5.py index <HASH>..<HASH> 100644 --- a/km3pipe/io/hdf5.py +++ b/km3pipe/io/hdf5.py @@ -339,7 +339,7 @@ class HDF5Sink(Module): if arr.dtype != tab.dtype: try: - arr = Table(arr, tab.dtype) + arr = Table(arr.astype(tab.dtype)) except ValueError: self.log.critical( "Cannot write a table to '%s' since its dtype is "
Try to change dtypes on the fly
tamasgal_km3pipe
train
py
d52f46c356cc53e648492771809f09d38d4719e9
diff --git a/packages/mip/src/components/mip-fixed.js b/packages/mip/src/components/mip-fixed.js index <HASH>..<HASH> 100644 --- a/packages/mip/src/components/mip-fixed.js +++ b/packages/mip/src/components/mip-fixed.js @@ -10,6 +10,12 @@ class MipFixed extends CustomElement { const viewer = window.MIP.viewer const platform = window.MIP.util.platform + // Hack: mip1 站点强制重写 mip-layout-container display,导致无法隐藏 loading + // 针对 mip-fixed 先把 mip-layout-container 去掉,这个不会对现有样式造成影响 + // TODO: 1. 考虑针对 mip-fixed 统一不使用 layout 处理 2. 推动下游去掉这个 class 的重写 + // 站点 http://mip.cntrades.com/15995352952/sell/itemid-170607633.html + this.element.classList.remove('mip-layout-container') + if (this.element.getAttribute('mipdata-fixedidx')) { return }
fix: hide loading in mip1 site (#<I>)
mipengine_mip2
train
js
4f6986fe0a173fc7dc6f1c54c51528898f8d41a1
diff --git a/spec/runner.rb b/spec/runner.rb index <HASH>..<HASH> 100755 --- a/spec/runner.rb +++ b/spec/runner.rb @@ -4,19 +4,25 @@ require 'rest_client' require 'json' # setup tunnel +retries = 30 begin + `rm -f BrowserStackLocal.zip BrowserStackLocal` `curl https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip > BrowserStackLocal.zip` `unzip BrowserStackLocal.zip` `chmod a+x BrowserStackLocal` - tunnel = IO.popen './BrowserStackTunnel --key $BS_AUTHKEY --local-proxy-port 9292 --local-identifier $TRAVIS_JOB_ID' + tunnel = IO.popen './BrowserStackLocal --key $BS_AUTHKEY --only localhost,9292,0 --local-identifier $TRAVIS_JOB_ID' loop do break if tunnel.gets.start_with? 'You can now access' end rescue => e - puts "Error while using a BrowserStackTunnel: #{e.inspect}" - retry + puts "Error while using a BrowserStackLocal: #{e.inspect}" + sleep 5 + retries -= 1 + retry if retries > 0 + puts "No retries left" + exit end # configure based on environment variables
Try replacing BrowserStackTunnel again
opal_opal-browser
train
rb
224cd0855bccd5ad0effaa664e155e0ef0443e60
diff --git a/xapian_backend.py b/xapian_backend.py index <HASH>..<HASH> 100644 --- a/xapian_backend.py +++ b/xapian_backend.py @@ -195,8 +195,7 @@ class SearchBackend(BaseSearchBackend): database = self._open_database(readwrite=True) if not models: query = xapian.Query('') # Empty query matches all - enquire = xapian.Enquire(database) - enquire.set_query(query) + enquire = self._get_enquire(database, query) for match in enquire.get_mset(0, DEFAULT_MAX_RESULTS): database.delete_document(match.get_docid()) else:
Changed clear to use private _get_enquire method
notanumber_xapian-haystack
train
py
062116f10b1c766fa904c1a6bfcb8186ba638c20
diff --git a/src/mappers/waterfall-svg/index.js b/src/mappers/waterfall-svg/index.js index <HASH>..<HASH> 100644 --- a/src/mappers/waterfall-svg/index.js +++ b/src/mappers/waterfall-svg/index.js @@ -171,7 +171,7 @@ function customiseSvgSettings (settings, resources) { barPadding: settings.padding / 2, barHeight: settings.barHeight, padding: settings.padding, - resources: resources.map(mapSvgResource.bind(null, settings) + resources: resources.map(mapSvgResource.bind(null, settings)) }; }
Add missing parenthesis to function call.
springernature_boomcatch
train
js
c99f5ada2a95a4feb06f08cde3aeac1e592ddff1
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/BadImport.java b/core/src/main/java/com/google/errorprone/bugpatterns/BadImport.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/BadImport.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/BadImport.java @@ -70,7 +70,8 @@ public class BadImport extends BugChecker implements ImportTreeMatcher { "Entry", "Enum", "Type", - "Key"); + "Key", + "Id"); private static final ImmutableSet<String> BAD_STATIC_IDENTIFIERS = ImmutableSet.of( "builder",
Add "Id" to list of excluded import names for nested classes. ------------- Created by MOE: <URL>
google_error-prone
train
java
0f6549646b3d94ace85c256910f91e27b43ec3f4
diff --git a/modal.go b/modal.go index <HASH>..<HASH> 100644 --- a/modal.go +++ b/modal.go @@ -126,6 +126,12 @@ func (m *Modal) ClearButtons() *Modal { return m } +// SetFocus shifts the focus to the button with the given index. +func (m *Modal) SetFocus(index int) *Modal { + m.form.SetFocus(index) + return m +} + // Focus is called when this primitive receives focus. func (m *Modal) Focus(delegate func(p Primitive)) { delegate(m.form) diff --git a/textview.go b/textview.go index <HASH>..<HASH> 100644 --- a/textview.go +++ b/textview.go @@ -298,8 +298,9 @@ func (t *TextView) SetRegions(regions bool) *TextView { // SetChangedFunc sets a handler function which is called when the text of the // text view has changed. This is useful when text is written to this io.Writer -// in a separate goroutine. This does not automatically cause the screen to be -// refreshed so you may want to use the "changed" handler to redraw the screen. +// in a separate goroutine. Doing so does not automatically cause the screen to +// be refreshed so you may want to use the "changed" handler to redraw the +// screen. // // Note that to avoid race conditions or deadlocks, there are a few rules you // should follow:
Added SetFocus() to Modal, focuses on the provided button. Resolves #<I>
rivo_tview
train
go,go
cf188bc5e477e0b5c7b188bfee54bbaa80630a74
diff --git a/src/serialization/sb3.js b/src/serialization/sb3.js index <HASH>..<HASH> 100644 --- a/src/serialization/sb3.js +++ b/src/serialization/sb3.js @@ -21,7 +21,7 @@ const loadSound = require('../import/load-sound.js'); const serialize = function (runtime) { // Fetch targets const obj = Object.create(null); - obj.targets = runtime.targets; + obj.targets = runtime.targets.filter(target => target.isOriginal); // Assemble metadata const meta = Object.create(null);
Don't serialize clones when saving
LLK_scratch-vm
train
js
f9466a38c9b9e2dd8853b92fd60b045693b78f26
diff --git a/cmd/converger/main_test.go b/cmd/converger/main_test.go index <HASH>..<HASH> 100644 --- a/cmd/converger/main_test.go +++ b/cmd/converger/main_test.go @@ -105,8 +105,9 @@ var _ = Describe("Converger", func() { } bbsArgs = bbsrunner.Args{ - Address: fmt.Sprintf("127.0.0.1:%d", 13000+GinkgoParallelNode()), - EtcdCluster: etcdCluster, + Address: fmt.Sprintf("127.0.0.1:%d", 13000+GinkgoParallelNode()), + AuctioneerAddress: "some-address", + EtcdCluster: etcdCluster, } })
Add auctioneer address to BBS start command [#<I>]
cloudfoundry_converger
train
go
150aabfbf0b432acf0582f0f9f02fb3a3e62b925
diff --git a/Classes/Validation/Validator/ClassExistsValidator.php b/Classes/Validation/Validator/ClassExistsValidator.php index <HASH>..<HASH> 100644 --- a/Classes/Validation/Validator/ClassExistsValidator.php +++ b/Classes/Validation/Validator/ClassExistsValidator.php @@ -14,10 +14,9 @@ namespace Romm\ConfigurationObject\Validation\Validator; use Romm\ConfigurationObject\Core\Core; -use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator; -class ClassExistsValidator extends AbstractValidator implements SingletonInterface +class ClassExistsValidator extends AbstractValidator { /**
[BUGFIX] Remove `SingletonInterface` from validator A class using arguments in constructor can't be a singleton.
romm_configuration_object
train
php
2c0ba36725dcea5172813f8f2d79d3b719a086da
diff --git a/src/Phinx/Db/Adapter/AdapterWrapper.php b/src/Phinx/Db/Adapter/AdapterWrapper.php index <HASH>..<HASH> 100644 --- a/src/Phinx/Db/Adapter/AdapterWrapper.php +++ b/src/Phinx/Db/Adapter/AdapterWrapper.php @@ -536,4 +536,12 @@ abstract class AdapterWrapper implements AdapterInterface, WrapperInterface { return $this->getAdapter()->castToBool($value); } + + /** + * {@inheritdoc} + */ + public function getConnection() + { + return $this->getAdapter()->getConnection(); + } }
Missing function in AdapterWrapper (#<I>) * Missing function in AdapterWrapper * Missing function in AdapterWrapper
cakephp_phinx
train
php
dc130984758481e2f79771dd004e0aa3d1f24f13
diff --git a/packages/text/src/Text.js b/packages/text/src/Text.js index <HASH>..<HASH> 100644 --- a/packages/text/src/Text.js +++ b/packages/text/src/Text.js @@ -476,6 +476,13 @@ export class Text extends Sprite // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875 totalIterations = (fill.length + 1) * lines.length; currentIteration = 0; + + // There's potential for floating point precision issues at the seams between gradient repeats. + // The loop below generates the stops in order, so track the last generated one to prevent + // floating point precision from making us go the teeniest bit backwards, resulting in + // the first and last colors getting swapped. + let lastIterationStop = 0; + for (let i = 0; i < lines.length; i++) { currentIteration += 1; @@ -489,8 +496,14 @@ export class Text extends Sprite { stop = currentIteration / totalIterations; } - gradient.addColorStop(stop, fill[j]); + + // Prevent color stop generation going backwards from floating point imprecision + let clampedStop = Math.max(lastIterationStop, stop); + + clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw. + gradient.addColorStop(clampedStop, fill[j]); currentIteration++; + lastIterationStop = clampedStop; } } }
Fix floating point imprecision could break vertical text gradient generation (#<I>)
pixijs_pixi.js
train
js
a9a29b04722e850207c36f4821110e2542bd9d6a
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index <HASH>..<HASH> 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -198,7 +198,7 @@ class GroupBy(object): for name, raveled in name_list: factor = Factor.fromarray(raveled) levels.append(factor.levels) - labels.append(factor.labels) + labels.append(factor.labels[mask]) index = MultiIndex(levels=levels, labels=labels) return DataFrame(output, index=index)
BUG: need to mask out aggregated levels
pandas-dev_pandas
train
py
6d9ff9fcdcc3c5a79331d5536ad7c659912a06be
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -251,7 +251,14 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator */ public function offsetSet($key, $value) { - $this->items[$key] = $value; + if(is_null($key)) + { + $this->items[] = $value; + } + else + { + $this->items[$key] = $value; + } } /**
Allow incrementing offsets in a collection.
illuminate_support
train
php
214a746b1d531cdacdcc0aa4039da119d4002837
diff --git a/context_test.go b/context_test.go index <HASH>..<HASH> 100644 --- a/context_test.go +++ b/context_test.go @@ -384,12 +384,21 @@ func TestContextSetCookie(t *testing.T) { assert.Equal(t, c.Writer.Header().Get("Set-Cookie"), "user=gin; Path=/; Domain=localhost; Max-Age=1; HttpOnly; Secure") } +func TestContextSetCookiePathEmpty(t *testing.T) { + c, _ := CreateTestContext(httptest.NewRecorder()) + c.SetCookie("user", "gin", 1, "", "localhost", true, true) + assert.Equal(t, c.Writer.Header().Get("Set-Cookie"), "user=gin; Path=/; Domain=localhost; Max-Age=1; HttpOnly; Secure") +} + func TestContextGetCookie(t *testing.T) { c, _ := CreateTestContext(httptest.NewRecorder()) c.Request, _ = http.NewRequest("GET", "/get", nil) c.Request.Header.Set("Cookie", "user=gin") cookie, _ := c.Cookie("user") assert.Equal(t, cookie, "gin") + + _, err := c.Cookie("nokey") + assert.Error(t, err) } func TestContextBodyAllowedForStatus(t *testing.T) {
Improve cookie tests code coverage (#<I>)
gin-gonic_gin
train
go
f882bc2a838d6e336d82e2bccefe8d8d469978d6
diff --git a/addon/spaniel-engines/ember-spaniel-engine.js b/addon/spaniel-engines/ember-spaniel-engine.js index <HASH>..<HASH> 100644 --- a/addon/spaniel-engines/ember-spaniel-engine.js +++ b/addon/spaniel-engines/ember-spaniel-engine.js @@ -1,5 +1,5 @@ import Ember from 'ember'; -const rAF = (typeof window === 'object') && typeof window.requestAnimationFrame === 'function' ? window.requestAnimationFrame : () => {}; +const rAF = (typeof window === 'object') && typeof window.requestAnimationFrame === 'function' ? window.requestAnimationFrame : (callback) => callback(); export default { reads: [],
Execute work even if rAF doesn't exist Fixes memory leak <URL>
asakusuma_ember-spaniel
train
js
e8c64038acaf0703d9add619ceb67f4adc7d0d8a
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,7 +11,13 @@ module.exports = function (grunt) { } }, concat: { - banner: "Some information", + options: { + stripBanners: { + 'block': true, + 'line': true + }, + banner: '/*\n<%= pkg.name %> <%= pkg.version %> - <%= pkg.description %> \n(C) 2013 - <%= pkg.author %> \nLicense: <%= pkg.license %> \nSource: <%= pkg.url %> \nDate Compiled: <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n' + }, dist: { src: ['src/provider.js', 'src/directive.js', 'src/module.js'], dest: 'ngProgress.js'
Strip banners from src and place new banner
victorb_ngProgress
train
js
29c5b70b9185c5a390cfdf684f64d5532b44420d
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,7 +20,7 @@ def next_available_tcp_port $current_tcp_port += 1 begin - sock = Timeout.timeout(0.1) { TCPSocket.new("localhost", $current_tcp_port) } + sock = Timeout.timeout(1) { TCPSocket.new("localhost", $current_tcp_port) } rescue Errno::ECONNREFUSED break $current_tcp_port end
specs: Increase sanity timeout on port connect test It actually failed in practice on JRuby: <URL>
socketry_nio4r
train
rb
e59e0431e4b17f3238416b0be42270e788b10652
diff --git a/core/control/Director.php b/core/control/Director.php index <HASH>..<HASH> 100755 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -329,10 +329,6 @@ class Director { * @deprecated 2.4 Use {@link Director::get_current_page()}. */ static function currentPage() { - user_error ( - 'Director::currentPage() is deprecated, please use Director::get_current_page()', E_USER_NOTICE - ); - return self::get_current_page(); }
MINOR: Director::currentPage() is deprecated but shouldn't throw a notice-level error until the next major release. (from r<I>) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
524081f4cf488ebeadd10ce20397d137ddeb7817
diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -218,7 +218,6 @@ class Finder implements \IteratorAggregate, \Countable * * $finder->notContains('Lorem ipsum') * $finder->notContains('/Lorem ipsum/i') - * * @param string $pattern A pattern (string or regexp) *
fix CS into Finder fix CS into Finder
symfony_symfony
train
php
e810a7913eee474576be809f542d57bdd74f595e
diff --git a/src/Composer/Command/RemoveCommand.php b/src/Composer/Command/RemoveCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/RemoveCommand.php +++ b/src/Composer/Command/RemoveCommand.php @@ -75,7 +75,7 @@ EOT } elseif (isset($composer[$altType][$package])) { $this->getIO()->writeError('<warning>'.$package.' could not be found in '.$type.' but it is present in '.$altType.'</warning>'); if ($this->getIO()->isInteractive()) { - if ($this->getIO()->askConfirmation('Do you want to remove it from '.$altType.' [<comment>yes</comment>]?', true)) { + if ($this->getIO()->askConfirmation('Do you want to remove it from '.$altType.' [<comment>yes</comment>]? ', true)) { $json->removeLink($altType, $package); } }
Space after ? (so it doesnt glue answer to ?)
mothership-ec_composer
train
php
45f36b8ed9cf78bc35b448413950f89334b1a4dd
diff --git a/spec/webrat/core/configuration_spec.rb b/spec/webrat/core/configuration_spec.rb index <HASH>..<HASH> 100755 --- a/spec/webrat/core/configuration_spec.rb +++ b/spec/webrat/core/configuration_spec.rb @@ -25,13 +25,23 @@ describe Webrat::Configuration do config.should open_error_files end + it "should have selenium setting defaults" do + config = Webrat::Configuration.new + config.selenium_environment.should == :selenium + config.selenium_port.should == 3001 + end + it "should be configurable with a block" do Webrat.configure do |config| config.open_error_files = false + config.selenium_environment = :test + config.selenium_port = 4000 end config = Webrat.configuration config.should_not open_error_files + config.selenium_environment.should == :test + config.selenium_port.should == 4000 end [:rails,
adding specs for the selenium environment/port settings
brynary_webrat
train
rb
7003a062b5d9c916b6f93e23dee1f6f0978b3bcf
diff --git a/pyspectral/utils.py b/pyspectral/utils.py index <HASH>..<HASH> 100644 --- a/pyspectral/utils.py +++ b/pyspectral/utils.py @@ -123,9 +123,10 @@ INSTRUMENTS = {'NOAA-19': 'avhrr/3', 'Feng-Yun 3D': 'mersi-2' } -HTTP_PYSPECTRAL_RSR = "https://zenodo.org/record/2617441/files/pyspectral_rsr_data.tgz" +HTTP_PYSPECTRAL_RSR = "https://zenodo.org/record/2653487/files/pyspectral_rsr_data.tgz" RSR_DATA_VERSION_FILENAME = "PYSPECTRAL_RSR_VERSION" -RSR_DATA_VERSION = "v1.0.5" +RSR_DATA_VERSION = "v1.0.6" + ATM_CORRECTION_LUT_VERSION = {} ATM_CORRECTION_LUT_VERSION['antarctic_aerosol'] = {'version': 'v1.0.1',
Point to the new dataset on zenodo with updated MetImage rsr
pytroll_pyspectral
train
py
172a0f1fd986f5ab4b4a5f2f8cf98655ae65318d
diff --git a/salt/modules/aliases.py b/salt/modules/aliases.py index <HASH>..<HASH> 100644 --- a/salt/modules/aliases.py +++ b/salt/modules/aliases.py @@ -17,6 +17,8 @@ def __get_aliases_filename(): ''' if 'aliases.file' in __opts__: return __opts__['aliases.file'] + elif 'aliases.file' in __pillar__: + return __pillar__['aliases.file'] else: return '/etc/aliases'
Allow aliases file to be defined in pillar
saltstack_salt
train
py
028920fae2303cb615682b64e30de20475a17a36
diff --git a/lib/route53.rb b/lib/route53.rb index <HASH>..<HASH> 100644 --- a/lib/route53.rb +++ b/lib/route53.rb @@ -305,7 +305,7 @@ module Route53 @name += "." end @type = type - @ttl = ttl + @ttl = ttl.upcase @values = values @zone = zone end
Upcasing type as per suggestion from electrum for Issue: 3.
pcorliss_ruby_route_53
train
rb
b67b8bc50c427a82d1b1bfa2b06faad1bd593cbd
diff --git a/lib/rib/zore/rails.rb b/lib/rib/zore/rails.rb index <HASH>..<HASH> 100644 --- a/lib/rib/zore/rails.rb +++ b/lib/rib/zore/rails.rb @@ -12,9 +12,9 @@ module Rib::Rails module_function def load_rails - require "#{Dir.pwd}/config/boot" + require './config/boot' - if File.exist?("#{Dir.pwd}/config/application.rb") + if File.exist?('./config/application.rb') Rib::Rails.load_rails3 else Rib::Rails.load_rails2 @@ -27,14 +27,14 @@ module Rib::Rails end def load_rails2 - ["#{Dir.pwd}/config/environment", - 'console_app', + ['./config/environment', + 'console_app' , 'console_with_helpers'].each{ |f| require f } end def load_rails3 - ["#{Dir.pwd}/config/application", - 'rails/console/app', + ['./config/application', + 'rails/console/app' , 'rails/console/helpers'].each{ |f| require f } ::Rails.application.require_environment!
rails.rb: easier to read
godfat_rib
train
rb
6224f7b551a4de38d3fe1fcc23ec11046e747869
diff --git a/tests/support/helpers.py b/tests/support/helpers.py index <HASH>..<HASH> 100644 --- a/tests/support/helpers.py +++ b/tests/support/helpers.py @@ -201,7 +201,7 @@ def flaky(caller=None, condition=True): try: return caller(cls) except Exception as exc: - if attempt == 4: + if attempt >= 3: raise exc backoff_time = attempt ** 2 log.info('Found Exception. Waiting %s seconds to retry.', backoff_time)
calling range is going up to the upper limit but not including it
saltstack_salt
train
py
a6ffc4cd13d81de42aca57ee5f40563aa359ebab
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb @@ -46,6 +46,7 @@ class ManualMeasuresController < ApplicationController end @measure.typed_value=params[:val] @measure.description=params[:desc] + @measure.user_login=current_user.login if @measure.valid? @measure.save if (params[:redirect_to_new]=='true')
SONAR-<I> Save last user who edited a manual measure => On manual measures, "Last change by" field is never updated
SonarSource_sonarqube
train
rb
b20f3c953d21540ed6846feb060638f36cb48cac
diff --git a/lib/esm-utils.js b/lib/esm-utils.js index <HASH>..<HASH> 100644 --- a/lib/esm-utils.js +++ b/lib/esm-utils.js @@ -34,7 +34,9 @@ const hasStableEsmImplementation = (() => { const [major, minor] = process.version.split('.'); // ESM is stable from v12.22.0 onward // https://nodejs.org/api/esm.html#esm_modules_ecmascript_modules - return parseInt(major.slice(1), 10) > 12 || parseInt(minor, 10) >= 22; + const majorNumber = parseInt(major.slice(1), 10); + const minorNumber = parseInt(minor, 10); + return majorNumber > 12 || (majorNumber === 12 && minorNumber >= 22); })(); exports.requireOrImport = hasStableEsmImplementation
ESM: proper version check in hasStableEsmImplementation (#<I>)
mochajs_mocha
train
js
7ca77dd55963cf3c2c74201c529b8b9b6dcf8811
diff --git a/acceptance/lifecycle_test.go b/acceptance/lifecycle_test.go index <HASH>..<HASH> 100644 --- a/acceptance/lifecycle_test.go +++ b/acceptance/lifecycle_test.go @@ -329,7 +329,7 @@ var _ = Describe("bosh-micro", func() { println("#################################################") stdout = deploy() - Expect(stdout).To(ContainSubstring("No deployment, stemcell or cpi release changes. Skipping deploy.")) + Expect(stdout).To(ContainSubstring("No deployment, stemcell or release changes. Skipping deploy.")) Expect(stdout).ToNot(ContainSubstring("Started installing CPI jobs")) Expect(stdout).ToNot(ContainSubstring("Started deploying"))
Fixes acceptance test for duplicate deployment failure message. [Fixes #<I>]
cloudfoundry_bosh-cli
train
go
a1965099c1fa5e94a5fca578da317b7e7d03a3a9
diff --git a/lib/RMagick.rb b/lib/RMagick.rb index <HASH>..<HASH> 100644 --- a/lib/RMagick.rb +++ b/lib/RMagick.rb @@ -1,4 +1,4 @@ -# $Id: RMagick.rb,v 1.75 2008/09/28 00:24:41 rmagick Exp $ +# $Id: RMagick.rb,v 1.76 2008/10/27 22:17:54 rmagick Exp $ #============================================================================== # Copyright (C) 2008 by Timothy P. Hunter # Name: RMagick.rb @@ -1576,11 +1576,11 @@ public end # Initialize new instances - def initialize(*filenames) + def initialize(*filenames, &block) @images = [] @scene = nil filenames.each { |f| - Magick::Image.read(f).each { |n| @images << n } + Magick::Image.read(f, &block).each { |n| @images << n } } if length > 0 @scene = length - 1 # last image in array
Let ImageList::new accept a block which is passes on to Image::read.
rmagick_rmagick
train
rb
f50d43eb0d9826362d1c9a80c9c5cdee6e78d307
diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index <HASH>..<HASH> 100644 --- a/core/corehttp/metrics_test.go +++ b/core/corehttp/metrics_test.go @@ -46,7 +46,7 @@ func TestPeersTotal(t *testing.T) { collector := IpfsNodeCollector{Node: node} actual := collector.PeersTotalValues() if len(actual) != 1 { - t.Fatalf("expected 1 peers transport, got %d", len(actual)) + t.Fatalf("expected 1 peers transport, got %d, transport map %v", len(actual), actual) } if actual["/ip4/tcp"] != float64(3) { t.Fatalf("expected 3 peers, got %f", actual["/ip4/tcp"])
add more logging to flaky TestPeersTotal Cannot reproduce the flakiness at the moment. The report suggests that connections are established on different transports. Adding logging to show what these transports are.
ipfs_go-ipfs
train
go
edefdde823c681a9ad99feb4cccb41bc98565a66
diff --git a/isambard_dev/ampal/non_canonical.py b/isambard_dev/ampal/non_canonical.py index <HASH>..<HASH> 100644 --- a/isambard_dev/ampal/non_canonical.py +++ b/isambard_dev/ampal/non_canonical.py @@ -8,7 +8,8 @@ import numpy from tools.geometry import dihedral, find_transformations -REF_PATH = pathlib.Path('reference_ampals', 'non_canonical_amino_acids') +FILE_PATH = pathlib.Path(__file__).parent +REF_PATH = FILE_PATH / 'reference_ampals' / 'non_canonical_amino_acids' def convert_pro_to_hyp(pro): @@ -23,7 +24,7 @@ def convert_pro_to_hyp(pro): pro: ampal.Residue The proline residue to be mutated to hydroxyproline. """ - with open(REF_PATH + 'hydroxyproline_ref_1bkv_0_6.pickle', 'rb') as inf: + with open(REF_PATH / 'hydroxyproline_ref_1bkv_0_6.pickle', 'rb') as inf: hyp_ref = pickle.load(inf) align_nab(hyp_ref, pro) to_remove = ['CB', 'CG', 'CD']
Fixes paths for reference files.
woolfson-group_isambard
train
py
df590606ec843008db67f9eecf5c90dcac122b04
diff --git a/ldap_sync/management/commands/syncldap.py b/ldap_sync/management/commands/syncldap.py index <HASH>..<HASH> 100644 --- a/ldap_sync/management/commands/syncldap.py +++ b/ldap_sync/management/commands/syncldap.py @@ -11,6 +11,7 @@ from django.contrib.auth.models import Group from django.core.exceptions import ImproperlyConfigured from django.db import DataError from django.db import IntegrityError +from django.utils.module_loading import import_string logger = logging.getLogger(__name__) @@ -100,6 +101,12 @@ class Command(BaseCommand): updated = True if updated: logger.debug("Updated user %s" % username) + + callbacks = list(getattr(settings, 'LDAP_SYNC_USER_CALLBACKS', [])) + for path in callbacks: + callback = import_string(path) + user = callback(user, created, updated) + user.save() if removed_user_action in ['DEACTIVATE', 'DELETE']:
Add custom callbacks for each processed user
jbittel_django-ldap-sync
train
py
0abc55fe127d82fa4feea5da53155425e517d5ba
diff --git a/proso_user/api_test.py b/proso_user/api_test.py index <HASH>..<HASH> 100644 --- a/proso_user/api_test.py +++ b/proso_user/api_test.py @@ -32,8 +32,11 @@ class UserAPITest(TestCase): "id": 1, "public": False } + response = json.loads(response.content)['data'] + expected_profile["user"]["id"] = response["user"]["id"] + expected_profile["id"] = response["id"] self.assertEqual( - json.loads(response.content)['data'], expected_profile, + response, expected_profile, 'The given profile has been created.' ) # check profile
fix user api test - ignore user id and profile id
adaptive-learning_proso-apps
train
py
413bdd32538939c0e4d6a80f999a7b9bbca55fee
diff --git a/client/base.js b/client/base.js index <HASH>..<HASH> 100644 --- a/client/base.js +++ b/client/base.js @@ -145,6 +145,14 @@ var Client = Class.extend({ } function end(err) { + if (!err && params.defer) { + return params.defer(result, function (e, r) { + params.defer = null; + result = r || result; + end(e); + }); + } + if (err && params.error) { params.error(err, xhr); }
Allows a defer callback for a request
gabrielhurley_js-openclient
train
js
fb71204910f39780f1c07d62c5d12a89736090d0
diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php @@ -20,7 +20,7 @@ namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Tools\SchemaTool; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -53,7 +53,7 @@ abstract class AbstractCommand extends Command $emHelper = $this->getHelper('em'); $em = $emHelper->getEntityManager(); - assert($em instanceof EntityManager); + assert($em instanceof EntityManagerInterface); $metadatas = $em->getMetadataFactory()->getAllMetadata();
Relax assertion (#<I>) EntityManager is too restrictive, any implementation can actually be returned here. Closes #<I>
doctrine_orm
train
php
5cfaa5a4168e8563ccbcfa067bc041786a5aa286
diff --git a/lib/mongo_mapper/plugins/querying.rb b/lib/mongo_mapper/plugins/querying.rb index <HASH>..<HASH> 100644 --- a/lib/mongo_mapper/plugins/querying.rb +++ b/lib/mongo_mapper/plugins/querying.rb @@ -54,6 +54,7 @@ module MongoMapper query.model(self) query end + alias_method :scoped, :query # @api private for now def criteria_hash(criteria={}) diff --git a/spec/functional/querying_spec.rb b/spec/functional/querying_spec.rb index <HASH>..<HASH> 100644 --- a/spec/functional/querying_spec.rb +++ b/spec/functional/querying_spec.rb @@ -993,4 +993,11 @@ describe "Querying" do user.first_name.should == "John" end end + + context "#scoped" do + it "should return a Query" do + document.scoped.should be_a MongoMapper::Plugins::Querying::DecoratedPluckyQuery + document.scoped.criteria_hash.should be_empty + end + end end
Add #scoped for AR 3.x parity
mongomapper_mongomapper
train
rb,rb
541ef80780b99b7a6c6bfc4f32180b1c220693fe
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -108,7 +108,7 @@ function runTest(responseText, expectedEvents, expectedError) { const expectedHeaders = { // "content-type": "application/json", // there's no request body, so no content-type - "authorization": "JWT foo" + "authorization": "Bearer foo" }; assertEquals(JSON.stringify(createdXMLHttpRequest.headers), JSON.stringify(expectedHeaders), "should send json request with auth token");
update test to expect Bearer, not JWT, in Authorization header
pusher_pusher-platform-js
train
js
f71497b7e2a213317fe12972f81ce0bad7103a7b
diff --git a/bcloud/MimeProvider.py b/bcloud/MimeProvider.py index <HASH>..<HASH> 100644 --- a/bcloud/MimeProvider.py +++ b/bcloud/MimeProvider.py @@ -74,6 +74,8 @@ class MimeProvider: def get_app_img(self, app_info): themed_icon = app_info.get_icon() + if isinstance(themed_icon, Gio.FileIcon): + return None icon_names = themed_icon.get_names() if icon_names: img = Gtk.Image.new_from_icon_name(
Fixed: AttributeError: 'FileIcon' object has no attribute 'get_names'; reported by @ahwad
XuShaohua_bcloud
train
py
cf9ee928b012bb2af24372ab180bacdb02cf7c74
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java index <HASH>..<HASH> 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentEncoder.java @@ -123,15 +123,13 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpReque // If unable to encode, pass through. if (result == null) { if (isFull) { - // As an unchunked response + // Set the content length. res.headers().remove(Names.TRANSFER_ENCODING); res.headers().set(Names.CONTENT_LENGTH, ((ByteBufHolder) res).content().readableBytes()); out.add(ReferenceCountUtil.retain(res)); } else { - // As a chunked response - res.headers().remove(Names.CONTENT_LENGTH); - res.headers().set(Names.TRANSFER_ENCODING, Values.CHUNKED); out.add(res); + // Pass through all following contents. state = State.PASS_THROUGH; } break;
HttpContentEncoder should not remove Content-Length when acting as a passthrough.
netty_netty
train
java
2541c64a4428849248b8dcf879c559a29747cd54
diff --git a/lib/softlayer/ProductItemCategory.rb b/lib/softlayer/ProductItemCategory.rb index <HASH>..<HASH> 100644 --- a/lib/softlayer/ProductItemCategory.rb +++ b/lib/softlayer/ProductItemCategory.rb @@ -14,7 +14,7 @@ module SoftLayer # DEPRECATION WARNING: The following configuration option keys have been deprecated and # will be removed with the next major version: capacityRestrictionMaximum, capacityRestrictionMinimum, # capacityRestrictionType, hourlyRecurringFee, laborFee, oneTimeFee, recurringFee, requiredCoreCount, setupFee - class ProductConfigurationOption < Struct.new(:capacity, :capacityRestrictionMaximum, :capicity_restriction_maximum, + class ProductConfigurationOption < Struct.new(:capacity, :capacityRestrictionMaximum, :capacity_restriction_maximum, :capacityRestrictionMinimum, :capacity_restriction_minimum, :capacityRestrictionType, :capacity_restriction_type, :description, :hourlyRecurringFee, :hourly_recurring_fee, :laborFee, :labor_fee, :oneTimeFee, :one_time_fee, :price_id, :recurringFee, :recurring_fee, :requiredCoreCount, :required_core_count, :setupFee, :setup_fee, :units)
Fixed a spelling error in a compatibility symbol
softlayer_softlayer-ruby
train
rb
d33c4e2f7f7a363821c1cd908cab8fe9de23edc6
diff --git a/lib/resource/detail.js b/lib/resource/detail.js index <HASH>..<HASH> 100644 --- a/lib/resource/detail.js +++ b/lib/resource/detail.js @@ -109,7 +109,7 @@ var MyResource = new Class({ if( err ){ err.req = bundle.req; err.res = bundle.res; - return that.emit( 'err', err ); + return that.emit( 'error', err ); } if( !that.options.returnData ){
Fix bad error event from patch_detail Should emit error event, not err
node-tastypie_tastypie
train
js
0b703d4bc1dad74dbdd6cbc4d714a90bbf3b0866
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -181,15 +181,6 @@ gulp.task("lint", () => { .pipe(jshint.reporter("default")); }); -gulp.task("webserver", () => { - gulp.src("publish/") - .pipe(webserver({ - port: 8000, - livereload: true, - directoryListing: true - })); -}); - gulp.task("clean-jsdoc", (done) => { return del([ "publish/jsdoc/" ], done); }); @@ -212,6 +203,15 @@ gulp.task("build-demo", [ "clean-demo", "copy-demo" ], () => { return bower({ cwd: 'publish/demo/' }); }); +gulp.task("webserver", [ "build-demo", "jsdoc" ], () => { + gulp.src("publish/") + .pipe(webserver({ + port: 8000, + livereload: true, + directoryListing: true + })); +}); + gulp.task("deploy", [ "build-demo", "jsdoc" ], () => { return gulp.src('publish/**/*') .pipe(ghPages());
chore(gulp): kick "build-demo" and "jsdoc" task before starting "webserver" task
takuyaa_kuromoji.js
train
js
1f7754997656745a7ec71cf1ba8b7c6e18d85457
diff --git a/master/buildbot/test/util/db.py b/master/buildbot/test/util/db.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/util/db.py +++ b/master/buildbot/test/util/db.py @@ -79,9 +79,7 @@ class RealDatabaseMixin(object): self.__want_pool = want_pool memory = 'sqlite://' - self.db_url = os.environ.get('BUILDBOT_TEST_DB_URL', - ### XXX TEMPORARY until sqlalchemification is complete - 'sqlite:///%s' % (os.path.abspath('test.db'))) + self.db_url = os.environ.get('BUILDBOT_TEST_DB_URL', memory) self.__using_memory_db = (self.db_url == memory) self.db_engine = enginestrategy.create_engine(self.db_url,
use in-memory database for testing
buildbot_buildbot
train
py
7953222d7935ce224e48b02f9ba559e7b4347850
diff --git a/widgets/TbGroupButtonColumn.php b/widgets/TbGroupButtonColumn.php index <HASH>..<HASH> 100644 --- a/widgets/TbGroupButtonColumn.php +++ b/widgets/TbGroupButtonColumn.php @@ -40,7 +40,15 @@ class TbGroupButtonColumn extends CButtonColumn else if (!preg_match('/[^A-z\-]btn[^A-z\-]/', $options['class'])) $options['class'] = 'btn '.$options['class']; - echo CHtml::link($label, $url, $options); + if (isset($button['icon'])) + { + if (strpos($button['icon'], 'icon') === false) + $button['icon'] = 'icon-'.implode(' icon-', explode(' ', $button['icon'])); + + echo CHtml::link('<i class="'.$button['icon'].'"></i>', $url, $options); + } + else + echo CHtml::link($label, $url, $options); } /**
Enable buttons with icons instead of text
clevertech_YiiBooster
train
php
4366988d5e643a9b286b969a914402b19969038e
diff --git a/dbussy.py b/dbussy.py index <HASH>..<HASH> 100644 --- a/dbussy.py +++ b/dbussy.py @@ -3433,7 +3433,7 @@ class _MsgAiter : #end _MsgAiter -class Server : +class Server(TaskKeeper) : "wrapper around a DBusServer object. Do not instantiate directly; use" \ " the listen method.\n" \ "\n" \ @@ -3443,11 +3443,12 @@ class Server : " use Connection.open() to connect to you on that address." # <https://dbus.freedesktop.org/doc/api/html/group__DBusServer.html> + # Doesn’t really need services of TaskKeeper for now, but might be + # useful in future + __slots__ = \ ( - "__weakref__", "_dbobj", - "loop", "_new_connections", "_await_new_connections", "max_new_connections", @@ -3472,8 +3473,8 @@ class Server : self = celf._instances.get(_dbobj) if self == None : self = super().__new__(celf) + super()._init(self) self._dbobj = _dbobj - self.loop = None self._new_connections = None self._await_new_connections = None self.max_new_connections = None
make Server also a subclass of TaskKeeper -- may be useful in future
ldo_dbussy
train
py
33b289cc8703b74f6d17014cccf5fd69bb5c4f4a
diff --git a/lib/active_remote/typecasting/boolean_typecaster.rb b/lib/active_remote/typecasting/boolean_typecaster.rb index <HASH>..<HASH> 100644 --- a/lib/active_remote/typecasting/boolean_typecaster.rb +++ b/lib/active_remote/typecasting/boolean_typecaster.rb @@ -1,9 +1,12 @@ module ActiveRemote module Typecasting class BooleanTypecaster - FALSE_VALUES = ["n", "N", "no", "No", "NO", "false", "False", "FALSE", "off", "Off", "OFF", "f", "F"] + BOOL_VALUES = [true, false].freeze + FALSE_VALUES = ["n", "N", "no", "No", "NO", "false", "False", "FALSE", "off", "Off", "OFF", "f", "F"] def self.call(value) + return value if BOOL_VALUES.include?(value) + case value when *FALSE_VALUES then false when Numeric, /^\-?[0-9]/ then !value.to_f.zero?
accomodate booleans in the boolean typecaster
liveh2o_active_remote
train
rb
19f4361768ff99d562ce6ab8080f3fa6e7e89d58
diff --git a/CHANGES b/CHANGES index <HASH>..<HASH> 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,12 @@ Statsd Changelog ================ +Version 2.1.1 +------------- + +- Fix issue with timers used as decorators. + + Version 2.1 ----------- diff --git a/statsd/client.py b/statsd/client.py index <HASH>..<HASH> 100644 --- a/statsd/client.py +++ b/statsd/client.py @@ -33,6 +33,8 @@ class Timer(object): self.stop() def start(self): + self.ms = None + self._sent = False self._start_time = time.time() return self diff --git a/statsd/tests.py b/statsd/tests.py index <HASH>..<HASH> 100644 --- a/statsd/tests.py +++ b/statsd/tests.py @@ -226,9 +226,12 @@ def test_timer_decorator(): pass bar() - _timer_check(sc, 1, 'bar', 'ms') + # Make sure the decorator works more than once: + bar() + _timer_check(sc, 2, 'bar', 'ms') + def test_timer_capture(): """You can capture the output of StatsClient.timer."""
Fix timers used as decorators.
jsocol_pystatsd
train
CHANGES,py,py
0e05f704f36271603a6051ebcc77ab7ac43be361
diff --git a/pkg/util/trace.go b/pkg/util/trace.go index <HASH>..<HASH> 100644 --- a/pkg/util/trace.go +++ b/pkg/util/trace.go @@ -32,15 +32,19 @@ type traceStep struct { type Trace struct { name string startTime time.Time - steps []*traceStep + steps []traceStep } func NewTrace(name string) *Trace { - return &Trace{name, time.Now(), make([]*traceStep, 0)} + return &Trace{name, time.Now(), nil} } func (t *Trace) Step(msg string) { - t.steps = append(t.steps, &traceStep{time.Now(), msg}) + if t.steps == nil { + // traces almost always have less than 6 steps, do this to avoid more than a single allocation + t.steps = make([]traceStep, 0, 6) + } + t.steps = append(t.steps, traceStep{time.Now(), msg}) } func (t *Trace) Log() {
Trace.Step() performs an unnecessary ref Allocates more objects than necessary.
kubernetes_kubernetes
train
go
308644f33c9a41495c8a82de6f7154e964178c5e
diff --git a/lib/deployml/project.rb b/lib/deployml/project.rb index <HASH>..<HASH> 100644 --- a/lib/deployml/project.rb +++ b/lib/deployml/project.rb @@ -57,6 +57,9 @@ module DeploYML # @option config [String, Hash] :dest # The destination URI to upload the project to. # + # @option config [String, Array<String>] :exclude + # File-path pattern or list of patterns to exclude from deployment. + # # @option config [Boolean] :debug # Specifies whether to enable debugging. # @@ -82,9 +85,17 @@ module DeploYML raise(InvalidConfig,":dest option must contain either a Hash or a String",caller) end + @exclude = Set[] + + case options[:exclude] + when Array + @exclude += options[:exclude] + when String + @exclude << options[:exclude] + end + @debug = config[:debug] @local_copy = File.join(Dir.pwd,LOCAL_COPY) - @exclude = Set[] extend SCMS[@scm]
Added the :exclude option to Project.new.
postmodern_deployml
train
rb
31a66e0424b51c51b319cdb6c35814669f8e7d9d
diff --git a/admin/code/AdminRootController.php b/admin/code/AdminRootController.php index <HASH>..<HASH> 100644 --- a/admin/code/AdminRootController.php +++ b/admin/code/AdminRootController.php @@ -89,5 +89,7 @@ class AdminRootController extends Controller { } } } + + return $this->httpError(404, 'Not found'); } }
MINOR Returning at least some error feedback when admin/* route isn't found (fixes #<I>)
silverstripe_silverstripe-framework
train
php
61c3950ea7b387646e7d22d86dc3c1590e7d50bf
diff --git a/lib/right_develop/utility/git.rb b/lib/right_develop/utility/git.rb index <HASH>..<HASH> 100644 --- a/lib/right_develop/utility/git.rb +++ b/lib/right_develop/utility/git.rb @@ -56,9 +56,9 @@ module RightDevelop::Utility::Git true end - # msysgit on Windows exits zero even when checkout|reset fails so we need to - # scan the output for error or fatal messages. it does no harm to do the same - # on Linux even though the exit code works properly there. + # msysgit on Windows exits zero even when checkout|reset|fetch fails so we + # need to scan the output for error or fatal messages. it does no harm to do + # the same on Linux even though the exit code works properly there. # # @param [String|Array] args to execute # @@ -192,8 +192,8 @@ module RightDevelop::Utility::Git # # @return [TrueClass] always true def fetch_all - spit_output('fetch') - spit_output('fetch --tags') # need a separate call to fetch tags + vet_output('fetch') + vet_output('fetch --tags') # need a separate call to fetch tags true end
acu<I> vetted fetch output because it exits nonzero with errors when it fails to connect to github
rightscale_right_develop
train
rb