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
e1d0a26b86c18870389afd7704744584d9604f7c
diff --git a/geomdl/construct.py b/geomdl/construct.py index <HASH>..<HASH> 100644 --- a/geomdl/construct.py +++ b/geomdl/construct.py @@ -20,7 +20,7 @@ def construct_surface(*args, **kwargs): :rtype: NURBS.Surface """ # Get keyword arguments - degree_v = kwargs.get('degree_v', 2) + degree_v = kwargs.get('degree', 2) size_v = len(args) if size_v < 2: @@ -58,7 +58,7 @@ def construct_volume(*args, **kwargs): :rtype: NURBS.Volume """ # Get keyword arguments - degree_w = kwargs.get('degree_w', 2) + degree_w = kwargs.get('degree', 2) size_w = len(args) if size_w < 2:
Rename keyword argument for surface and volume constructors
orbingol_NURBS-Python
train
py
2603e0984c6bcc1475a164b000f1057110553433
diff --git a/state/tracker_test.go b/state/tracker_test.go index <HASH>..<HASH> 100644 --- a/state/tracker_test.go +++ b/state/tracker_test.go @@ -357,3 +357,31 @@ func TestSTIsOn(t *testing.T) { } m.CheckNothingWritten(t) } + +func TestSTAssociate(t *testing.T) { + l, m := logging.NewMock() + l.SetLogLevel(logging.Debug) + st := NewTracker("mynick", l) + + nick1 := st.NewNick("test1") + chan1 := st.NewChannel("#test1") + + st.Associate(chan1, nick1) + m.CheckNothingWritten(t) + if !st.IsOn("#test1", "test1") { + t.Errorf("test1 was not associated with #test1.") + } + + // Test error cases + st.Associate(nil, nick1) + m.CheckWrittenAtLevel(t, logging.Error, + "StateTracker.Associate(): passed nil values :-(") + + st.Associate(chan1, nil) + m.CheckWrittenAtLevel(t, logging.Error, + "StateTracker.Associate(): passed nil values :-(") + + st.Associate(chan1, nick1) + m.CheckWrittenAtLevel(t, logging.Warn, + "StateTracker.Associate(): test1 already on #test1.") +}
Test nick <-> channel association.
fluffle_goirc
train
go
3fa89c32e1b454d8ffe199a637d1e12b85d46f56
diff --git a/NavigationReactNative/sample/web/Motion.js b/NavigationReactNative/sample/web/Motion.js index <HASH>..<HASH> 100644 --- a/NavigationReactNative/sample/web/Motion.js +++ b/NavigationReactNative/sample/web/Motion.js @@ -28,7 +28,7 @@ class Motion extends React.Component { .map(item => { var end = !dataByKey[item.key] ? leave(item.data) : update(item.data); var equal = this.areEqual(item.end, end); - var rest = item.progress === 1; + var rest = equal ? item.progress === 1 : false; var progress = equal ? Math.max(Math.min(item.progress + ((tick - item.tick) / 500), 1), 0) : 0; var interpolators = equal ? item.interpolators : this.getInterpolators(item.style, end); var style = this.interpolateStyle(interpolators, end, progress);
Reset rest if target changed The left items were instantly removed because rest was set to true
grahammendick_navigation
train
js
73378a50d39b23f6889a38d1c6956bd66eb9baec
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -82,7 +82,9 @@ describe('pathCompleteExtname', function () { // --- - it('should retrieve simple file extensions', function () { + it('should retrieve file extensions with two dots', function () { + assert.equal(pathCompleteExtname('jquery.min.js'), '.min.js'); + assert.equal(pathCompleteExtname('package.tar.gz'), '.tar.gz'); }); });
Added tests for file extensions with two dots
ruyadorno_path-complete-extname
train
js
61837e4f47c045a135f8f084ffbdbb78813e99e7
diff --git a/salt/modules/defaults.py b/salt/modules/defaults.py index <HASH>..<HASH> 100644 --- a/salt/modules/defaults.py +++ b/salt/modules/defaults.py @@ -118,7 +118,7 @@ def get(key, default=''): defaults = _load(pillar_name, defaults_path) - value = __salt__['pillar.get']("%s:%s" % (pillar_name, key), None) + value = __salt__['pillar.get']('{0}:{1}'.format(pillar_name, key), None) if value is None: value = salt.utils.traverse_dict(defaults, key, None)
Using .format to build the pillar key as requested
saltstack_salt
train
py
66f22627347b2e1cffbb66f4ec448f2ed0cacfe9
diff --git a/src/Response.php b/src/Response.php index <HASH>..<HASH> 100644 --- a/src/Response.php +++ b/src/Response.php @@ -45,7 +45,7 @@ class Response * * @var int */ - public $status = HttpResponse::HTTP_OK; + public $status; /** * If should enable zlib compression when appropriate @@ -64,8 +64,10 @@ class Response */ public function output() { - if (empty($this->body)) { - $this->status = HttpResponse::HTTP_NO_CONTENT; + if ($this->status === null) { + $this->status = (empty($this->body)) + ? HttpResponse::HTTP_NO_CONTENT + : HttpResponse::HTTP_OK; } if ($this->request_method === 'HEAD'
Update Response $status does not have a default value, but has as fallback if unset on output()
aryelgois_medools-router
train
php
717f00a2bcbef8348bc3e48a787f00553c3d5b67
diff --git a/Library/ArgInfoDefinition.php b/Library/ArgInfoDefinition.php index <HASH>..<HASH> 100644 --- a/Library/ArgInfoDefinition.php +++ b/Library/ArgInfoDefinition.php @@ -1,7 +1,5 @@ <?php -declare(strict_types=1); - /** * This file is part of the Zephir. * @@ -11,11 +9,10 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ +declare(strict_types=1); + namespace Zephir; -/** - * Zephir\ArgInfoDefinition. - */ class ArgInfoDefinition { /** @@ -65,14 +62,14 @@ class ArgInfoDefinition * @param ClassMethod $functionLike * @param CodePrinter $codePrinter * @param CompilationContext $compilationContext - * @param false $returnByRef + * @param bool $returnByRef */ public function __construct( $name, ClassMethod $functionLike, CodePrinter $codePrinter, CompilationContext $compilationContext, - $returnByRef = false + bool $returnByRef = false ) { $this->functionLike = $functionLike; $this->codePrinter = $codePrinter;
#<I> - Minor code refactor
phalcon_zephir
train
php
8bb395b1fdbbac8712acbee6ea4de79e67bfbefb
diff --git a/src/Arrays/Iterator.php b/src/Arrays/Iterator.php index <HASH>..<HASH> 100644 --- a/src/Arrays/Iterator.php +++ b/src/Arrays/Iterator.php @@ -80,8 +80,8 @@ class Iterator extends RecursiveArrayIterator */ public function getChildren() { - if ($this->hasChildren()) return $this->current(); - + if ($this->hasChildren()) return $this->current()->getIterator(); + throw new InvalidArgumentException('Current item not an array!'); } } \ No newline at end of file
The getChildren method should really return another iterator.
phpgearbox_arrays
train
php
6003e827540f3e7324dcf8326770dd7cb95a8e28
diff --git a/scripts/get-latest-platform-tests.js b/scripts/get-latest-platform-tests.js index <HASH>..<HASH> 100644 --- a/scripts/get-latest-platform-tests.js +++ b/scripts/get-latest-platform-tests.js @@ -1,5 +1,9 @@ "use strict"; +if (process.env.NO_UPDATE) { + process.exit(0); +} + const path = require("path"); const fs = require("fs"); const request = require("request");
Provide an env variable to disable update of test script
jsdom_whatwg-url
train
js
ead538ea1b5a11c979d8632276b05a36859dbd76
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -35,11 +35,11 @@ describe('when only headers was sent', function () { before(function (done) { server = http.createServer(function (request, res) { + res.writeHead(200, {'content-type':'text/plain'}); + res.write('waited'); setTimeout(function() { - res.writeHead(200, {'content-type':'text/plain'}); - res.write('waited'); res.end(); - }, 200); + }, 1000); }); server.listen(8081, function (err) { @@ -61,6 +61,6 @@ describe('when only headers was sent', function () { } }); - timeout(req, 400); + timeout(req, 200); }); });
Fixed tests on <I> and iojs
floatdrop_timed-out
train
js
ebcd1787db42ed2376bea5aebc8e0a418dffdab3
diff --git a/agent/config/builder.go b/agent/config/builder.go index <HASH>..<HASH> 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -387,7 +387,7 @@ func (b *Builder) Build() (rt RuntimeConfig, err error) { return RuntimeConfig{}, fmt.Errorf("No %s address found", addrtyp) } if len(advertiseAddrs) > 1 { - return RuntimeConfig{}, fmt.Errorf("Multiple %s addresses found. Please configure one", addrtyp) + return RuntimeConfig{}, fmt.Errorf("Multiple %s addresses found. Please configure one with 'bind' and/or 'advertise'.", addrtyp) } advertiseAddr = advertiseAddrs[0] }
Adds more info about how to fix the private IP error. Closes #<I>
hashicorp_consul
train
go
5c54cb723ddba8a71a8156182a0187302ea46669
diff --git a/classes/Flatfile/Core.php b/classes/Flatfile/Core.php index <HASH>..<HASH> 100644 --- a/classes/Flatfile/Core.php +++ b/classes/Flatfile/Core.php @@ -325,19 +325,20 @@ class Flatfile_Core { // Match on property, terms and other stuffs // TODO + // Natural sort ordering + natsort($this->_files); + + // Ordering files + if ($this->_order === 'desc') + { + $this->_files = array_reverse($this->_files, TRUE); + } + // if ($multiple === TRUE) if ($multiple === TRUE OR $this->_query) { // Loading multiple Flatfile $result = array(); - // Natural sort ordering - natsort($this->_files); - - // Ordering files - if ($this->_order === 'desc') - { - $this->_files = array_reverse($this->_files, TRUE); - } // Each md file is load in array and returned foreach ($this->_files as $slug => $file)
Enable sorting for a sinlge entry also
ziopod_Flatfile
train
php
abc7e86aa8e3ff5a791a871e5bfac2137e141cf1
diff --git a/spec/lock_jar/maven_spec.rb b/spec/lock_jar/maven_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lock_jar/maven_spec.rb +++ b/spec/lock_jar/maven_spec.rb @@ -4,6 +4,11 @@ require 'lib/lock_jar/maven' require 'naether' describe LockJar::Maven do + before do + # Bootstrap Naether + Naether::Bootstrap.bootstrap_local_repo + end + context "Class" do it "should get pom version" do LockJar::Maven.pom_version( "spec/pom.xml" ).should eql( "3" )
ensure naether is bootstrapped for the tests
mguymon_lock_jar
train
rb
3ee7e6bbcb0a52ccc36a31dd3bae7f140fd37fde
diff --git a/lib/ts_routes/version.rb b/lib/ts_routes/version.rb index <HASH>..<HASH> 100644 --- a/lib/ts_routes/version.rb +++ b/lib/ts_routes/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module TsRoutes - VERSION = "1.0.2" + VERSION = "1.0.3" end
Bump up version to <I>
bitjourney_ts_routes-rails
train
rb
0c0d938d48c1fe150f4514491e89d1baabbb2244
diff --git a/sprd/util/ProductUtil.js b/sprd/util/ProductUtil.js index <HASH>..<HASH> 100644 --- a/sprd/util/ProductUtil.js +++ b/sprd/util/ProductUtil.js @@ -18,7 +18,13 @@ define(["underscore", "sprd/util/ArrayUtil", "js/core/List", "sprd/model/Product }, getPossiblePrintTypesForDesignOnProduct: function (design, product) { - return this.getPossiblePrintTypesForDesignOnPrintArea(design, product.$.view.getDefaultPrintArea(), product.$.appearance.$.id); + var defaultPrintArea = product.$.view.getDefaultPrintArea(); + + if (!defaultPrintArea) { + return []; + } + + return this.getPossiblePrintTypesForDesignOnPrintArea(design, defaultPrintArea, product.$.appearance.$.id); },
fixed exception, if view doesn't have a print area
spreadshirt_rAppid.js-sprd
train
js
87de6d7beec0d51cb97c0e7d7fcc656e844218ca
diff --git a/dev/idangerous.swiper.js b/dev/idangerous.swiper.js index <HASH>..<HASH> 100644 --- a/dev/idangerous.swiper.js +++ b/dev/idangerous.swiper.js @@ -1107,7 +1107,8 @@ var Swiper = function (selector, params) { if(!isTouchEvent) { // Added check for input element since we are getting a mousedown event even on some touch devices. - if (!(params.releaseFormElements && event.srcElement.tagName.toLowerCase() === 'input')) { + target = event.srcElement || event.target; + if (!(params.releaseFormElements && target.tagName.toLowerCase() === 'input')) { if (event.preventDefault) event.preventDefault(); else event.returnValue = false; }
Firefox can't handle event.srcElement, added fallback to event.target
nolimits4web_swiper
train
js
1c6f544a11f989f16a44d94ade38651d852b8653
diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index <HASH>..<HASH> 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -671,6 +671,17 @@ class TestParquetPyArrow(Base): df = pd.DataFrame({"a": pd.date_range("2017-01-01", freq="1n", periods=10)}) check_round_trip(df, pa, write_kwargs={"version": "2.0"}) + @td.skip_if_no("pyarrow", min_version="0.17") + def test_filter_row_groups(self, pa): + # https://github.com/pandas-dev/pandas/issues/26551 + df = pd.DataFrame({"a": list(range(0, 3))}) + with tm.ensure_clean() as path: + df.to_parquet(path, pa) + result = read_parquet( + path, pa, filters=[("a", "==", 0)], use_legacy_dataset=False + ) + assert len(result) == 1 + class TestParquetFastParquet(Base): @td.skip_if_no("fastparquet", min_version="0.3.2")
TST: ensure read_parquet filter argument is correctly passed though (pyarrow engine) (#<I>)
pandas-dev_pandas
train
py
6745aa5a3c395db4aaea5944cf6c6ea1e03b5858
diff --git a/commons/src/main/java/com/stratio/streaming/commons/kafka/service/TopicService.java b/commons/src/main/java/com/stratio/streaming/commons/kafka/service/TopicService.java index <HASH>..<HASH> 100644 --- a/commons/src/main/java/com/stratio/streaming/commons/kafka/service/TopicService.java +++ b/commons/src/main/java/com/stratio/streaming/commons/kafka/service/TopicService.java @@ -15,7 +15,9 @@ */ package com.stratio.streaming.commons.kafka.service; -public interface TopicService { +import java.io.Closeable; + +public interface TopicService extends Closeable { void createTopicIfNotExist(String topic, int replicationFactor, int partitions);
added new nethods to IStratioStreamingApi trait: withServerConfig, init, and close.
Stratio_Decision
train
java
329fb1bf2ae365a8f84a9adada2100073805084e
diff --git a/lib/media-stream.js b/lib/media-stream.js index <HASH>..<HASH> 100644 --- a/lib/media-stream.js +++ b/lib/media-stream.js @@ -14,6 +14,8 @@ function MediaStream (media, opts) { if (!(self instanceof MediaStream)) return new MediaStream(media, opts) stream.Writable.call(self, opts) + if (!MediaSource) throw new Error('web browser lacks MediaSource support') + self.media = media opts = opts || {} opts.type = opts.type || 'video/webm; codecs="vorbis,vp8"'
detect browsers that lack MediaSource support
webtorrent_webtorrent
train
js
be103b0ec8e4659d423a122cc01aa21e852b3257
diff --git a/lxd/db/instances.go b/lxd/db/instances.go index <HASH>..<HASH> 100644 --- a/lxd/db/instances.go +++ b/lxd/db/instances.go @@ -98,7 +98,7 @@ type Instance struct { ExpiryDate time.Time } -// InstanceFilter can be used to filter results yielded by InstanceList. +// InstanceFilter specifies potential query parameter fields. type InstanceFilter struct { Project string Name string @@ -726,12 +726,22 @@ SELECT storage_pools.name FROM storage_pools func (c *Cluster) DeleteInstance(project, name string) error { if strings.Contains(name, shared.SnapshotDelimiter) { parts := strings.SplitN(name, shared.SnapshotDelimiter, 2) + filter := InstanceSnapshotFilter{ + Project: project, + Instance: parts[0], + Name: parts[1], + } return c.Transaction(func(tx *ClusterTx) error { - return tx.DeleteInstanceSnapshot(project, parts[0], parts[1]) + return tx.DeleteInstanceSnapshot(filter) }) } + + filter := InstanceFilter{ + Project: project, + Name: name, + } return c.Transaction(func(tx *ClusterTx) error { - return tx.DeleteInstance(project, name) + return tx.DeleteInstance(filter) }) }
lxd/db/instances: use Filter as parameter for delete
lxc_lxd
train
go
c5e5d0bff699795fd0462d00a31cd6920172659e
diff --git a/inc/class-filters.php b/inc/class-filters.php index <HASH>..<HASH> 100644 --- a/inc/class-filters.php +++ b/inc/class-filters.php @@ -81,6 +81,9 @@ class CareLib_Filters { // Default excerpt more. add_filter( 'excerpt_more', array( $this, 'excerpt_more' ), 5 ); + // Add an itemprop of "image" to WordPress attachment images. + add_filter( 'wp_get_attachment_image_attributes', array( $this, 'attachment_image_itemprop' ) ); + // Modifies the arguments and output of wp_link_pages(). add_filter( 'wp_link_pages_args', array( $this, 'link_pages_args' ), 5 ); add_filter( 'wp_link_pages_link', array( $this, 'link_pages_link' ), 5 ); @@ -114,6 +117,18 @@ class CareLib_Filters { } /** + * Add an image itemprop to attachment images. + * + * @since 0.2.0 + * @param array $attr Existing attributes. + * @return array Amended attributes. + */ + public function attachment_image_itemprop( $attr ) { + $attr['itemprop'] = 'image'; + return $attr; + } + + /** * Wraps the output of `wp_link_pages()` with `<p class="page-links">` if * it's simply wrapped in a `<p>` tag. *
Filter attachment image to include an image item prop This could maybe go in attributes.php but since it’s filtering a default WP function it probably should go here… I think?
cipherdevgroup_carelib
train
php
85369e3a315697be7e167f303d44f6b69d46c8ee
diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index <HASH>..<HASH> 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -70,10 +70,10 @@ class Inception3(nn.Module): def forward(self, x): if self.transform_input: - x = x.clone() - x[:, 0] = x[:, 0] * (0.229 / 0.5) + (0.485 - 0.5) / 0.5 - x[:, 1] = x[:, 1] * (0.224 / 0.5) + (0.456 - 0.5) / 0.5 - x[:, 2] = x[:, 2] * (0.225 / 0.5) + (0.406 - 0.5) / 0.5 + x_ch0 = torch.unsqueeze(x[:, 0], 1) * (0.229 / 0.5) + (0.485 - 0.5) / 0.5 + x_ch1 = torch.unsqueeze(x[:, 1], 1) * (0.224 / 0.5) + (0.456 - 0.5) / 0.5 + x_ch2 = torch.unsqueeze(x[:, 2], 1) * (0.225 / 0.5) + (0.406 - 0.5) / 0.5 + x = torch.cat((x_ch0, x_ch1, x_ch2), 1) # 299 x 299 x 3 x = self.Conv2d_1a_3x3(x) # 149 x 149 x 32
Fix inception v3 input transform for trace & onnx (#<I>) * Fix inception v3 input transform for trace & onnx * Input transform are in-place updates, which produce issues for tracing and exporting to onnx. * nit
pytorch_vision
train
py
d5adbf6531733705c983e4c759c8c1be000825e3
diff --git a/dev/tools/build-docs.js b/dev/tools/build-docs.js index <HASH>..<HASH> 100644 --- a/dev/tools/build-docs.js +++ b/dev/tools/build-docs.js @@ -93,7 +93,7 @@ var apiClasses2 = [ {tag:"objectid", path:"./node_modules/bson/lib/bson/objectid.js"}, {tag:"binary", path:"./node_modules/bson/lib/bson/binary.js"}, {tag:"code", path:"./node_modules/bson/lib/bson/code.js"}, - {tag:"code", path:"./node_modules/bson/lib/bson/db_ref.js"}, + {tag:"db_ref", path:"./node_modules/bson/lib/bson/db_ref.js"}, {tag:"double", path:"./node_modules/bson/lib/bson/double.js"}, {tag:"minkey", path:"./node_modules/bson/lib/bson/min_key.js"}, {tag:"maxkey", path:"./node_modules/bson/lib/bson/max_key.js"},
Fixed docs generator to include Code
mongodb_node-mongodb-native
train
js
67ff2b8b254974446bbb11b6b195c2dbfb4cbdc8
diff --git a/py/selenium/webdriver/remote/remote_connection.py b/py/selenium/webdriver/remote/remote_connection.py index <HASH>..<HASH> 100644 --- a/py/selenium/webdriver/remote/remote_connection.py +++ b/py/selenium/webdriver/remote/remote_connection.py @@ -424,11 +424,11 @@ class RemoteConnection(object): data = resp.read() try: - if 399 < statuscode < 500: - return {'status': statuscode, 'value': data} if 300 <= statuscode < 304: return self._request('GET', resp.getheader('location')) body = data.decode('utf-8').replace('\x00', '').strip() + if 399 < statuscode < 500: + return {'status': statuscode, 'value': body} content_type = [] if resp.getheader('Content-Type') is not None: content_type = resp.getheader('Content-Type').split(';')
if remote end returns a <I> level response status code, for python3 we need to decode the string so it doesn't fail later on when creating the exception to raise Fixes Issue #<I>
SeleniumHQ_selenium
train
py
b0f2eee597a56aa8e58c7349fd941c5a24fe5256
diff --git a/src/js/core/icon.js b/src/js/core/icon.js index <HASH>..<HASH> 100644 --- a/src/js/core/icon.js +++ b/src/js/core/icon.js @@ -48,7 +48,9 @@ const Icon = { props: ['icon'], - data: {include: []}, + data: { + include: ['focusable'] + }, isIcon: true, diff --git a/src/js/core/svg.js b/src/js/core/svg.js index <HASH>..<HASH> 100644 --- a/src/js/core/svg.js +++ b/src/js/core/svg.js @@ -14,6 +14,7 @@ export default { ratio: Number, 'class': String, strokeAnimation: Boolean, + focusable: Boolean, attributes: 'list' }, @@ -21,7 +22,8 @@ export default { ratio: 1, include: ['style', 'class'], 'class': '', - strokeAnimation: false + strokeAnimation: false, + focusable: 'false' }, connected() {
fix(icon): make SVG icons non-focusable in IE
uikit_uikit
train
js,js
ee9a20ca7cdb4e4db234a54e67d82f79c223e602
diff --git a/indra/tools/model_checker.py b/indra/tools/model_checker.py index <HASH>..<HASH> 100644 --- a/indra/tools/model_checker.py +++ b/indra/tools/model_checker.py @@ -400,7 +400,7 @@ def _find_sources_with_paths(im, target, sources, polarity): yield path for predecessor, sign in _get_signed_predecessors(im, node, node_sign): # Only add predecessors to the path if it's not already in the - # path + # path--prevents loops if (predecessor, sign) in path: continue # Otherwise, the new path is a copy of the old one plus the new @@ -529,7 +529,7 @@ def _get_signed_predecessors(im, node, polarity): predecessors = im.predecessors_iter for pred in predecessors(node): pred_edge = im.get_edge(pred, node) - yield (pred, _get_edge_sign(pred_edge) * polarity) + yield (pred.name, _get_edge_sign(pred_edge) * polarity) def _get_edge_sign(edge):
Paths should contain strings, not nodes
sorgerlab_indra
train
py
1de8dda10a6711130929b752f95a133959e8f116
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='django-tinycontent', version=tinycontent.__version__, description="A Django app for managing re-usable blocks of tiny content.", - long_description=open('README.md').read(), + long_description=open('README.rst').read(), author='Dominic Rodger', author_email='[email protected]', url='http://github.com/dominicrodger/django-tinycontent',
Oops - switched to RST file
dominicrodger_django-tinycontent
train
py
eadb981a4e7074672095a41481d052661466d720
diff --git a/lib/functions.js b/lib/functions.js index <HASH>..<HASH> 100644 --- a/lib/functions.js +++ b/lib/functions.js @@ -25,7 +25,7 @@ internals.pick = function () { internals.include = function (o) { if (!o || !(o instanceof Object)) throw new Error('Pick must have params (arguments)'); - return _.merge(this._joi, o); + return _.merge({}, this._joi, o); }; internals.withRequired = function () {
[hotfix] change include function to don't permanently change _joi object
mibrito_joi-sequelize
train
js
edf9f7c4d9a95d0368c61d9a610e3af5e992f299
diff --git a/src/jobTree/test/batchSystems/abstractBatchSystemTest.py b/src/jobTree/test/batchSystems/abstractBatchSystemTest.py index <HASH>..<HASH> 100644 --- a/src/jobTree/test/batchSystems/abstractBatchSystemTest.py +++ b/src/jobTree/test/batchSystems/abstractBatchSystemTest.py @@ -158,6 +158,8 @@ class hidden: time.sleep(0.1) # pass updates too quickly (~24e6 iter/sec), which is why I'm using time.sleep(0.1): + def tearDown(self): + self.batchSystem.shutdown() @classmethod def tearDownClass(cls): @@ -189,7 +191,7 @@ class MesosBatchSystemTest(hidden.AbstractBatchSystemTest): self.slave.join() self.master.popen.kill() self.master.join() - self.batchSystem.shutDown() + self.batchSystem.shutdown() class MesosThread(threading.Thread): __metaclass__ = ABCMeta
Added batchSystem.shutdown to teardown() method which neatly joins all threads at the culmination of each test. Changed naming convention in mesos: shutDown() -> shutdown()
DataBiosphere_toil
train
py
2fd01f127881a9e9ca1e6208fad71a5c8ba05c6e
diff --git a/models/rpc.go b/models/rpc.go index <HASH>..<HASH> 100644 --- a/models/rpc.go +++ b/models/rpc.go @@ -71,6 +71,10 @@ func SetupServer(lobbyId uint, info ServerRecord, lobbyType LobbyType, league st } func VerifyInfo(info ServerRecord) error { + if config.Constants.ServerMockUp { + return nil + } + return Pauling.Call("Pauling.VerifyInfo", &info, &Args{}) }
Don't call Pauling if ServerMockUp is true.
TF2Stadium_Helen
train
go
a7935da1fdfbfab9c4dd8941ec557a5a5e5a58b1
diff --git a/lib/stack_master/commands/apply.rb b/lib/stack_master/commands/apply.rb index <HASH>..<HASH> 100644 --- a/lib/stack_master/commands/apply.rb +++ b/lib/stack_master/commands/apply.rb @@ -6,8 +6,8 @@ module StackMaster def initialize(config, region, stack_name) @config = config - @region = region - @stack_name = stack_name + @region = region.gsub('_', '-') + @stack_name = stack_name.gsub('_', '-') end def perform diff --git a/spec/stack_master/commands/apply_spec.rb b/spec/stack_master/commands/apply_spec.rb index <HASH>..<HASH> 100644 --- a/spec/stack_master/commands/apply_spec.rb +++ b/spec/stack_master/commands/apply_spec.rb @@ -1,7 +1,7 @@ RSpec.describe StackMaster::Commands::Apply do let(:cf) { instance_double(Aws::CloudFormation::Client) } let(:region) { 'us-east-1' } - let(:stack_name) { 'myapp_vpc' } + let(:stack_name) { 'myapp-vpc' } let(:config) { double(find_stack: stack_definition) } let(:stack_definition) { StackMaster::Config::StackDefinition.new( region: 'us_east_1',
Ensure we replace underscores with hyphens
envato_stack_master
train
rb,rb
2590cd64348893478a1bfa89e56fcc34ec81d2eb
diff --git a/list.go b/list.go index <HASH>..<HASH> 100644 --- a/list.go +++ b/list.go @@ -85,6 +85,19 @@ func (l *List) GetCurrentItem() int { return l.currentItem } +// RemoveItem removes the item with the given index (starting at 0) from the +// list. Does nothing if the index is out of range. +func (l *List) RemoveItem(index int) *List { + if index < 0 || index >= len(l.items) { + return l + } + l.items = append(l.items[:index], l.items[index+1:]...) + if l.currentItem >= len(l.items) { + l.currentItem = len(l.items) - 1 + } + return l +} + // SetMainTextColor sets the color of the items' main text. func (l *List) SetMainTextColor(color tcell.Color) *List { l.mainTextColor = color @@ -127,7 +140,7 @@ func (l *List) ShowSecondaryText(show bool) *List { // // This function is also called when the first item is added or when // SetCurrentItem() is called. -func (l *List) SetChangedFunc(handler func(int, string, string, rune)) *List { +func (l *List) SetChangedFunc(handler func(index int, mainText string, secondaryText string, shortcut rune)) *List { l.changed = handler return l }
Added RemoveItem() function to List. Resolves #<I>
rivo_tview
train
go
68224655233a59ed899ff6627b9a0bdc18cf4044
diff --git a/commons/src/main/java/org/axway/grapes/commons/datamodel/ArtifactQuery.java b/commons/src/main/java/org/axway/grapes/commons/datamodel/ArtifactQuery.java index <HASH>..<HASH> 100644 --- a/commons/src/main/java/org/axway/grapes/commons/datamodel/ArtifactQuery.java +++ b/commons/src/main/java/org/axway/grapes/commons/datamodel/ArtifactQuery.java @@ -8,14 +8,31 @@ public class ArtifactQuery { private String sha256; private String type; private String location; - + + @Override + public String toString() { + return "ArtifactQuery{" + + "user='" + user + '\'' + + ", stage=" + stage + + ", name='" + name + '\'' + + ", sha256='" + sha256 + '\'' + + ", type='" + type + '\'' + + ", location='" + location + '\'' + + '}'; + } + public ArtifactQuery(String user, int stage, String name, String sha256, String type, String location) { this.user = user; this.stage = stage; this.name = name; this.sha256 = sha256; this.type = type; + this.location = location; + + if(this.location == null || location.trim().isEmpty()) { + this.location = "N/A"; + } } public String getUser() { return user;
ECDDEV-<I> Updating the model class
Axway_Grapes
train
java
3355c1528dc17476a091873ea95a3b5565455069
diff --git a/builtin/providers/aws/import_aws_elb_test.go b/builtin/providers/aws/import_aws_elb_test.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/import_aws_elb_test.go +++ b/builtin/providers/aws/import_aws_elb_test.go @@ -7,7 +7,7 @@ import ( ) func TestAccAWSELB_importBasic(t *testing.T) { - resourceName := "aws_subnet.bar" + resourceName := "aws_elb.bar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) },
provider/aws: Fix typo in ELB import test (#<I>)
hashicorp_terraform
train
go
922ca45a600f25dfe683d98180649242be0ef0e6
diff --git a/src/main/java/org/browsermob/core/har/HarLog.java b/src/main/java/org/browsermob/core/har/HarLog.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/browsermob/core/har/HarLog.java +++ b/src/main/java/org/browsermob/core/har/HarLog.java @@ -7,7 +7,7 @@ import java.util.concurrent.CopyOnWriteArrayList; @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) public class HarLog { - private String version = "1.1"; + private String version = "1.2"; private HarNameVersion creator; private HarNameVersion browser; private List<HarPage> pages = new CopyOnWriteArrayList<HarPage>();
Fixes issue #<I>: the version of the HAR spec we're using is indeed <I> :)
webmetrics_browsermob-proxy
train
java
9b9dad3ccef535bf8ac37ca005accbdceb0aba82
diff --git a/src/Testing/FactoryBuilder.php b/src/Testing/FactoryBuilder.php index <HASH>..<HASH> 100644 --- a/src/Testing/FactoryBuilder.php +++ b/src/Testing/FactoryBuilder.php @@ -140,7 +140,7 @@ class FactoryBuilder protected function makeInstance(array $attributes = []) { if (!isset($this->definitions[$this->class][$this->name])) { - throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}]."); + throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."); } $definition = call_user_func($this->definitions[$this->class][$this->name], $this->faker, $attributes);
Include class name inside factory not found error (#<I>) Mimics Laravel's original way of doing it and helps find what needs to be implemented.
laravel-doctrine_orm
train
php
dcf734ab51e05495c08e3e4d30cdf8a38efd4000
diff --git a/src/transports/websocket.js b/src/transports/websocket.js index <HASH>..<HASH> 100644 --- a/src/transports/websocket.js +++ b/src/transports/websocket.js @@ -28,6 +28,8 @@ module.exports = class Connection extends EventEmitter { this.debugOut('writeLine() socket=' + (this.socket ? 'yes' : 'no') + ' connected=' + this.connected); if (this.socket && this.connected) { this.socket.send(line, cb); + } else { + setTimeout(cb, 0); } }
Fire write callback in websocket when not connect
kiwiirc_irc-framework
train
js
419f6a7d88825acbcce3a891ebaf1ced963e02e8
diff --git a/src/Models/UserModel.php b/src/Models/UserModel.php index <HASH>..<HASH> 100644 --- a/src/Models/UserModel.php +++ b/src/Models/UserModel.php @@ -375,12 +375,4 @@ class UserModel extends AbstractModel return $this->client->put(self::$endpoint . '/' . $userId . '/status', $requestOptions); } - /** - * @return \Psr\Http\Message\ResponseInterface - */ - public function getUserStatusesById() - { - return $this->client->get(self::$endpoint . '/' . '/status/ids'); - } - }
Get users statuses by Id does not exist. Waiting for upstream fix : mattermost.atlassian.net/browse/PLT-<I>
gnello_php-mattermost-driver
train
php
b1c76ea5a0e1b61dd148df850f56867fe7aebd77
diff --git a/code/CMSMenu.php b/code/CMSMenu.php index <HASH>..<HASH> 100644 --- a/code/CMSMenu.php +++ b/code/CMSMenu.php @@ -431,7 +431,7 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider $ownerModule = ClassLoader::instance()->getManifest()->getOwnerModule($cmsClass); $entities["{$cmsClass}.MENUTITLE"] = [ 'default' => $defaultTitle, - 'module' => $ownerModule + 'module' => $ownerModule->getShortName() ]; } return $entities;
Update usage of getOwnerModule()
silverstripe_silverstripe-admin
train
php
238b671c59e285c80f7ca26614b611a5af066a57
diff --git a/src/Api/Tree/Get.php b/src/Api/Tree/Get.php index <HASH>..<HASH> 100644 --- a/src/Api/Tree/Get.php +++ b/src/Api/Tree/Get.php @@ -184,7 +184,8 @@ class Get } /* root customer */ - if (is_null($rootCustId)) { + $isLiveMode = !$this->hlpCfg->getApiAuthenticationEnabledDevMode(); + if (is_null($rootCustId) || $isLiveMode) { $rootCustId = $this->authenticator->getCurrentCustomerId(); } if (is_null($onDate)) {
MOBI-<I> - DCP API: force authorization in production mode
praxigento_mobi_mod_downline
train
php
664adde0811d7ac9002a842c2efcbb90c117c78a
diff --git a/lib/collectionspace/client/version.rb b/lib/collectionspace/client/version.rb index <HASH>..<HASH> 100644 --- a/lib/collectionspace/client/version.rb +++ b/lib/collectionspace/client/version.rb @@ -2,6 +2,6 @@ module CollectionSpace class Client - VERSION = '0.13.4' + VERSION = '0.14.0' end end
Bump collectionspace-client to <I>
lyrasis_collectionspace-client
train
rb
6c9529fab26e7afe10a14851bca6f8eeb7a0eac3
diff --git a/holoviews/core/ndmapping.py b/holoviews/core/ndmapping.py index <HASH>..<HASH> 100644 --- a/holoviews/core/ndmapping.py +++ b/holoviews/core/ndmapping.py @@ -2,7 +2,7 @@ Supplies MultiDimensionalMapping and NdMapping which are multi-dimensional map types. The former class only allows indexing whereas the latter also enables slicing over multiple dimension ranges. -""" +s""" from collections import Sequence from itertools import cycle @@ -164,8 +164,8 @@ class MultiDimensionalMapping(Dimensioned): valid_vals = [] for dim, val in valid_vals: + if self._cached_index_values[dim] == 'initial': self._cached_index_values[dim] = [] vals = self._cached_index_values[dim] - if vals == 'initial': self._cached_index_values[dim] = [] if not self._instantiated and self.get_dimension(dim).values == 'initial': if val not in vals: self._cached_index_values[dim].append(val)
Fixed bug in initializing NdMapping types with initial ordering
pyviz_holoviews
train
py
cb674fb1cb5d861582baa89b230e6e31dab11be3
diff --git a/salt/states/pkgrepo.py b/salt/states/pkgrepo.py index <HASH>..<HASH> 100644 --- a/salt/states/pkgrepo.py +++ b/salt/states/pkgrepo.py @@ -343,7 +343,7 @@ def managed(name, ppa=None, **kwargs): if disabled is not None \ else salt.utils.is_true(enabled) - elif __grains__['os_family'] in ('NILinuxRT',): + elif __grains__['os_family'] in ('NILinuxRT', 'Poky'): # opkg is the pkg virtual kwargs['enabled'] = not salt.utils.is_true(disabled) \ if disabled is not None \
Enable opkg as pkgrepo handler on Poky
saltstack_salt
train
py
301913fbe4c3a06ac57f76ff90c49f766d5a32c7
diff --git a/src/util/uniques.js b/src/util/uniques.js index <HASH>..<HASH> 100644 --- a/src/util/uniques.js +++ b/src/util/uniques.js @@ -11,7 +11,7 @@ d3plus.util.uniques = function( data , value ) { , nest = d3.nest() .key(function(d) { - if (typeof value === "string") { + if (d && typeof value === "string") { if ( !type && typeof d[value] !== "undefined" ) type = typeof d[value] return d[value] }
fixed bug with util.uniques when trying to get a value from undefined
alexandersimoes_d3plus
train
js
fbbce577bf90044fc650245642dda83083269198
diff --git a/src/main/java/nl/hsac/fitnesse/fixture/slim/HttpTest.java b/src/main/java/nl/hsac/fitnesse/fixture/slim/HttpTest.java index <HASH>..<HASH> 100644 --- a/src/main/java/nl/hsac/fitnesse/fixture/slim/HttpTest.java +++ b/src/main/java/nl/hsac/fitnesse/fixture/slim/HttpTest.java @@ -105,7 +105,7 @@ public class HttpTest extends SlimFixture { /** * Sends HTTP POST template with current values to service endpoint. - * @param serviceUrl service endpoint to send XML to. + * @param serviceUrl service endpoint to send request to. * @return true if call could be made and response did not indicate error. */ public boolean postTemplateTo(String serviceUrl) { @@ -172,8 +172,8 @@ public class HttpTest extends SlimFixture { } /** - * Sends HTTP GET to service endpoint to retrieve XML. - * @param serviceUrl service endpoint to send XML to. + * Sends HTTP GET to service endpoint to retrieve content. + * @param serviceUrl service endpoint to get content from. * @return true if call could be made and response did not indicate error. */ public boolean getFrom(String serviceUrl) {
Fix comment, this class is not always for XML
fhoeben_hsac-fitnesse-fixtures
train
java
13b31d6f9dbc86b800b9c9db256a3af5bd496b4e
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2975,6 +2975,9 @@ function delete_user($user) { // now do a final accesslib cleanup - removes all role assingments in user context and context itself delete_context(CONTEXT_USER, $user->id); + require_once($CFG->dirroot.'/tag/lib.php'); + tag_set('user', $user->id, array()); + // workaround for bulk deletes of users with the same email address $delname = addslashes("$user->email.".time()); while (record_exists('user', 'username', $delname)) { // no need to use mnethostid here
MDL-<I> - Remove linked tags when deleting users. (merge from <I>)
moodle_moodle
train
php
bab6abf0ee583d490c616917aef30b0905ae3f6a
diff --git a/src/main/java/org/softee/management/samples/MessageProcesingApplication.java b/src/main/java/org/softee/management/samples/MessageProcesingApplication.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/softee/management/samples/MessageProcesingApplication.java +++ b/src/main/java/org/softee/management/samples/MessageProcesingApplication.java @@ -15,7 +15,7 @@ import org.softee.time.StopWatch; * * @author [email protected] */ -public class MessageProcesingApplication implements Runnable { +public class MessageProcesingApplication { private static final int PROCESSING_TIME_MILLIS = 1000; private MessagingMBean monitor; @@ -29,11 +29,7 @@ public class MessageProcesingApplication implements Runnable { } } - private MessageProcesingApplication() { - } - - @Override public void run() { try { monitor = new DemoMessagingMBean();
Made the code marginally more Java SE 5 kosher
javabits_pojo-mbean
train
java
7665fa7e8943c14d917b517c18d494a6e1e5ac6f
diff --git a/src/main/java/com/googlecode/lanterna/gui2/dialogs/TextInputDialog.java b/src/main/java/com/googlecode/lanterna/gui2/dialogs/TextInputDialog.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/gui2/dialogs/TextInputDialog.java +++ b/src/main/java/com/googlecode/lanterna/gui2/dialogs/TextInputDialog.java @@ -4,7 +4,8 @@ import com.googlecode.lanterna.TerminalSize; import com.googlecode.lanterna.gui2.*; /** - * Created by martin on 05/06/15. + * TextInputDialog is a modal text input dialog that prompts the user to enter a text string. The class supports + * validation and password masking. The builder class to help setup TextInputDialogs is TextInputDialogBuilder. */ public class TextInputDialog extends DialogWindow { @@ -51,8 +52,8 @@ public class TextInputDialog extends DialogWindow { .setRightMarginSize(1)); if(description != null) { mainPanel.addComponent(new Label(description)); - mainPanel.addComponent(new EmptySpace(TerminalSize.ONE)); } + mainPanel.addComponent(new EmptySpace(TerminalSize.ONE)); textBox.setLayoutData( GridLayout.createLayoutData( GridLayout.Alignment.FILL,
Add a bit more space even if there's no description
mabe02_lanterna
train
java
7047c51018fb4a6c64a5ceb1a79cd84761733444
diff --git a/Lib/SmsHandler/PsWinComPost.php b/Lib/SmsHandler/PsWinComPost.php index <HASH>..<HASH> 100644 --- a/Lib/SmsHandler/PsWinComPost.php +++ b/Lib/SmsHandler/PsWinComPost.php @@ -74,6 +74,11 @@ EOMSG; // Make it one. if (!is_array($receivers)) $receivers = array($receivers); + + // First, they default to latin 1 + $message = iconv("UTF-8", "ISO-8859-1", $message); + // Make the message xml-safe: + $message = htmlspecialchars($message, ENT_XML1, 'ISO-8859-1'); foreach ($receivers as $number) { if (strlen((string)$number) == $this->national_number_lenght) $number = $this->default_country_prefix . $number;
Make the popst method a bit more character-safe. (It was crap, now tested with norwegian æøå and handling their default latin1)
thomasez_BisonLabSakonninBundle
train
php
f95b9ec5211351e648ebb2b22fa28631d1838680
diff --git a/lib/rory/request_parameter_logger.rb b/lib/rory/request_parameter_logger.rb index <HASH>..<HASH> 100644 --- a/lib/rory/request_parameter_logger.rb +++ b/lib/rory/request_parameter_logger.rb @@ -3,7 +3,7 @@ require_relative 'parameter_filter' module Rory class RequestParameterLogger - def initialize(app, logger=nil, filters=[:password, :tin, :ssn, :social_security_number, :file_attachment]) + def initialize(app, logger=nil, filters=[:password]) @app = app @logger = logger @filters = filters
Removes some default fields to filter on
screamingmuse_rory
train
rb
37fe48928e4d4b254791eb8034c20baabe06a483
diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb index <HASH>..<HASH> 100644 --- a/lib/action_cable/channel/base.rb +++ b/lib/action_cable/channel/base.rb @@ -76,7 +76,7 @@ module ActionCable # class ChatChannel < ApplicationCable::Channel # def subscribed # @room = Chat::Room[params[:room_number]] - # reject! unless current_user.can_access?(@room) + # reject unless current_user.can_access?(@room) # end # end # @@ -198,7 +198,7 @@ module ActionCable @subscription_confirmation_sent end - def reject! + def reject @reject_subscription = true end diff --git a/test/channel/rejection_test.rb b/test/channel/rejection_test.rb index <HASH>..<HASH> 100644 --- a/test/channel/rejection_test.rb +++ b/test/channel/rejection_test.rb @@ -5,7 +5,7 @@ require 'stubs/room' class ActionCable::Channel::RejectionTest < ActiveSupport::TestCase class SecretChannel < ActionCable::Channel::Base def subscribed - reject! if params[:id] > 0 + reject if params[:id] > 0 end end
Rename Subscription#reject! to Subscription#reject as there's only one version of the method
rails_rails
train
rb,rb
c9faaeb8430283b32dd2b5e2359c270875695390
diff --git a/selector.go b/selector.go index <HASH>..<HASH> 100644 --- a/selector.go +++ b/selector.go @@ -466,10 +466,13 @@ func siblingSelector(s1, s2 Selector, adjacent bool) Selector { } if adjacent { - if n.PrevSibling == nil { - return false + for n = n.PrevSibling; n != nil; n = n.PrevSibling { + if n.Type == html.TextNode || n.Type == html.CommentNode { + continue + } + return s1(n) } - return s1(n.PrevSibling) + return false } // Walk backwards looking for element that matches s1 diff --git a/selector_test.go b/selector_test.go index <HASH>..<HASH> 100644 --- a/selector_test.go +++ b/selector_test.go @@ -321,7 +321,9 @@ var selectorTests = []selectorTest{ }, }, { - `<p id="1"><p id="2"></p><address></address><p id="3">`, + `<p id="1"></p> + <!--comment--> + <p id="2"></p><address></address><p id="3">`, `p + p`, []string{ `<p id="2">`,
fix: adjacent sibling selector should ignore text node and comment node
andybalholm_cascadia
train
go,go
dbe8dae4e6116bba43284b6787e89b624b8e6bb0
diff --git a/src/Structure/Structure.php b/src/Structure/Structure.php index <HASH>..<HASH> 100644 --- a/src/Structure/Structure.php +++ b/src/Structure/Structure.php @@ -117,7 +117,7 @@ abstract class Structure { public static function ArrayS($format = null, $data = null, $countStrict = true, $null = false) { $array = new ArrayS(); $array->setFormat($format); - $array->setData($data = null); + $array->setData($data); $array->setCountStrict($countStrict); $array->setNull($null); return $array;
Corrected unwanted "= null"
3nr1c_structure
train
php
9f7e418e505b463c16e8b52597dbafc7e6e8be2f
diff --git a/local_settings/settings.py b/local_settings/settings.py index <HASH>..<HASH> 100644 --- a/local_settings/settings.py +++ b/local_settings/settings.py @@ -60,11 +60,9 @@ class Settings(dict): """ def __init__(self, *args, **kwargs): + # Call our update() instead of super().__init__() so that our + # __setitem__() will be used. self.update(*args, **kwargs) - super(Settings, self).__init__(*args, **kwargs) - for k, v in self.items(): - if isinstance(v, Mapping): - super(Settings, self).__setitem__(k, Settings(v)) def __setitem__(self, name, value): if isinstance(value, Mapping):
Simplify Settings constructor It was doing a bunch of redundant stuff.
PSU-OIT-ARC_django-local-settings
train
py
db64f2f0eccba09310d6a875a51996703dd7037f
diff --git a/doc/mongo_extensions.py b/doc/mongo_extensions.py index <HASH>..<HASH> 100644 --- a/doc/mongo_extensions.py +++ b/doc/mongo_extensions.py @@ -29,7 +29,7 @@ class mongoref(nodes.reference): def visit_mongodoc_node(self, node): - self.visit_admonition(node, "seealso") + self.visit_admonition(node) def depart_mongodoc_node(self, node):
Fix error when building docs.
mongodb_motor
train
py
d03d2ae47eb05c0f79c12db13fc572d21ebb202c
diff --git a/optoanalysis/setup.py b/optoanalysis/setup.py index <HASH>..<HASH> 100644 --- a/optoanalysis/setup.py +++ b/optoanalysis/setup.py @@ -15,7 +15,7 @@ with open(os.path.join(mypackage_root_dir, 'optoanalysis/VERSION')) as version_f version = version_file.read().strip() extensions = [Extension( - name="optoanalysis.sde_solver.solve", + name="solve", sources=["optoanalysis/sde_solver/solve.pyx"], include_dirs=[numpy.get_include()], )
added working solution, had to change name in extension so that it builds the shared object file and puts it in the root package directory when installed
AshleySetter_optoanalysis
train
py
34fa8757f11463dbbeef7caf6f344294f50c0ac5
diff --git a/jquery.popupoverlay.js b/jquery.popupoverlay.js index <HASH>..<HASH> 100644 --- a/jquery.popupoverlay.js +++ b/jquery.popupoverlay.js @@ -513,9 +513,13 @@ } } - // Re-enable scrolling of background layer + // Re-enable scrolling of background layer, if needed if (options.scrolllock) { setTimeout(function() { + if ($.grep(visiblePopupsArray, function(eid) { return $("#"+eid).data('popupoptions').scrolllock }).length) { + // Some "scolllock=true" popup is currently visible, leave scrolling disabled + return; + } $body.css({ overflow: 'visible', 'margin-right': bodymarginright @@ -532,9 +536,13 @@ $wrapper.hide(); } - // Re-enable scrolling of background layer + // Re-enable scrolling of background layer, if needed if (options.scrolllock) { setTimeout(function() { + if ($.grep(visiblePopupsArray, function(eid) { return $("#"+eid).data('popupoptions').scrolllock }).length) { + // Some "scrolllock=true" popup is currently visible, leave scrolling disabled + return; + } $body.css({ overflow: 'visible', 'margin-right': bodymarginright
Properly support nested "scrolllock=true" popups
vast-engineering_jquery-popup-overlay
train
js
f556e8002b4dfdc5744dd3d60b89f4ed953fccba
diff --git a/lib/active_hash/base.rb b/lib/active_hash/base.rb index <HASH>..<HASH> 100644 --- a/lib/active_hash/base.rb +++ b/lib/active_hash/base.rb @@ -302,7 +302,7 @@ module ActiveHash end def define_getter_method(field, default_value) - unless has_instance_method?(field) + unless instance_methods.include?(field.to_sym) define_method(field) do attributes[field].nil? ? default_value : attributes[field] end @@ -312,8 +312,8 @@ module ActiveHash private :define_getter_method def define_setter_method(field) - method_name = "#{field}=" - unless has_instance_method?(method_name) + method_name = :"#{field}=" + unless instance_methods.include?(method_name) define_method(method_name) do |new_val| attributes[field] = new_val end @@ -324,7 +324,7 @@ module ActiveHash def define_interrogator_method(field) method_name = :"#{field}?" - unless has_instance_method?(method_name) + unless instance_methods.include?(method_name) define_method(method_name) do send(field).present? end @@ -406,12 +406,6 @@ module ActiveHash private :mark_clean - def has_instance_method?(name) - instance_methods.map { |method| method.to_sym }.include?(name) - end - - private :has_instance_method? - def has_singleton_method?(name) singleton_methods.map { |method| method.to_sym }.include?(name) end
silence warning that happens because has_instance_method? bug somehow has_insance_method? returned false after define_method was called leading to duplicate method definitions and warnings instead of fixing this mystery bug I'm just removing the obsolte method
zilkey_active_hash
train
rb
b4a0d4c9cac0d0970d2938297bb13096497b08f1
diff --git a/src/Clarify/Search.php b/src/Clarify/Search.php index <HASH>..<HASH> 100644 --- a/src/Clarify/Search.php +++ b/src/Clarify/Search.php @@ -26,11 +26,11 @@ class Search extends Client $request->getQuery()->set($key, $value); } - $response = $this->process($request); + $this->process($request); - $this->detail = $response->json(); + $this->detail = $this->response->json(); - return $response->json(); + return $this->detail; } public function hasMorePages()
making sure the data is being captured to be reused
Clarify_clarify-php
train
php
15f482fbb7b1b98b48545f6e5ab3986859c38e55
diff --git a/watchman/main.py b/watchman/main.py index <HASH>..<HASH> 100644 --- a/watchman/main.py +++ b/watchman/main.py @@ -15,13 +15,11 @@ def check(): child_dirs = _get_subdirectories(current_working_directory) for child in child_dirs: try: - change_dir = '%s/%s' % (current_working_directory, child) - cd(change_dir); current_branch = hg('branch') - + current_branch = hg('branch', '-R', './%s' % child) output = '%-25s is on branch: %s' % (child, current_branch) + print(output, end='') - print(output, end=''); cd('..') # print and step back one dir - except Exception: + except Exception as e: continue
Remove change dir commands and now it sends directly.
alephmelo_watchman
train
py
51bde1963a71f31ff1779fa4cafa2169a6e21cc1
diff --git a/lib/GameLoader.js b/lib/GameLoader.js index <HASH>..<HASH> 100644 --- a/lib/GameLoader.js +++ b/lib/GameLoader.js @@ -890,12 +890,17 @@ GameLoader.prototype.buildWaitRoomConf = function(directory, gameName, level) { waitRoomSettingsFile = directory + 'waitroom/waitroom.settings.js'; if (!fs.existsSync(waitRoomSettingsFile)) { + /////////////////////////////////////////////////////// + // Experimental code for levels without waitroom conf. this.doErr('GameLoader.buildWaitRoomConf: file waitroom.settings ' + 'not found', { game: gameName, level: level, - log: 'warn' - }); + log: 'warn', + throwIt: !level // Experimental: was always true. + }); + // Important! The main waitRoom has not been loaded yet, so levels + // cannot copy settings from there. return; }
allowing no waitroom in levels: will cause an error for now if trying to move to a level. need further work
nodeGame_nodegame-server
train
js
effa0279ce6da26fd7ddbf47175b287868009707
diff --git a/packages/webpack-cli/lib/webpack-cli.js b/packages/webpack-cli/lib/webpack-cli.js index <HASH>..<HASH> 100644 --- a/packages/webpack-cli/lib/webpack-cli.js +++ b/packages/webpack-cli/lib/webpack-cli.js @@ -1337,7 +1337,7 @@ class WebpackCLI { } else { const { interpret } = this.utils; - // Order defines the priority, in increasing order + // Order defines the priority, in decreasing order const defaultConfigFiles = ['webpack.config', '.webpack/webpack.config', '.webpack/webpackfile'] .map((filename) => // Since .cjs is not available on interpret side add it manually to default config extension list
fix: comment on config resolution priority (#<I>)
webpack_webpack-cli
train
js
8ab301b9b3ce9db42c0cc3cd768f91e3a91863bf
diff --git a/angr/state_plugins/symbolic_memory.py b/angr/state_plugins/symbolic_memory.py index <HASH>..<HASH> 100644 --- a/angr/state_plugins/symbolic_memory.py +++ b/angr/state_plugins/symbolic_memory.py @@ -981,8 +981,8 @@ class SimSymbolicMemory(SimMemory): #pylint:disable=abstract-method # CGC binaries zero-fill the memory for any allocated region # Reference: (https://github.com/CyberGrandChallenge/libcgc/blob/master/allocate.md) return self.state.se.BVV(0, bits) - elif options.SPECIAL_MEMORY_FILL in self.state.options: - return self.state._special_memory_filler(name, bits) + elif options.SPECIAL_MEMORY_FILL in self.state.options and self.state._special_memory_filler is not None: + return self.state._special_memory_filler(name, bits, self.state) else: kwargs = { } if options.UNDER_CONSTRAINED_SYMEXEC in self.state.options:
make _special_memory_filler state aware
angr_angr
train
py
aa11acc0e9b346e78c174ae708043ab76f352aa4
diff --git a/anom/transaction.py b/anom/transaction.py index <HASH>..<HASH> 100644 --- a/anom/transaction.py +++ b/anom/transaction.py @@ -89,9 +89,8 @@ def transactional(*, adapter=None, retries=3, propagation=Transaction.Propagatio retries(int, optional): The number of times to retry the transaction if it couldn't be committed. propagation(Transaction.Propagation, optional): The propagation - strategy to use. By default, transactions are Transactions are - nested, but you can force certain transactions to always run - independently. + strategy to use. By default, transactions are nested, but you + can force certain transactions to always run independently. Raises: anom.RetriesExceeded: When the decorator runbs out of retries
doc: fix docstring for @transactional
Bogdanp_anom-py
train
py
96474da364ab405e0c15e47d541010c5049d90d3
diff --git a/scoop/launch/__init__.py b/scoop/launch/__init__.py index <HASH>..<HASH> 100644 --- a/scoop/launch/__init__.py +++ b/scoop/launch/__init__.py @@ -84,8 +84,9 @@ class Host(object): # TODO: do we really want to set PYTHONPATH='' if not defined?? c.extend(["export", "PYTHONPATH={0}:$PYTHONPATH".format(worker.pythonPath), '&&']) - # Try to go into the directory. If not (headless worker), it's not important - c.extend(['cd', worker.path, '&&']) + # Try to go into the directory. If headless worker, it's not important + if worker.executable: + c.extend(['cd', worker.path, "&&"]) return c def _WorkerCommand_bootstrap(self, worker):
* Fixed a bug when starting in could mode on heterogeneous systems.
soravux_scoop
train
py
50756c5192d8331e0a91101f26536f3e3f9ebac2
diff --git a/holoviews/core/spaces.py b/holoviews/core/spaces.py index <HASH>..<HASH> 100644 --- a/holoviews/core/spaces.py +++ b/holoviews/core/spaces.py @@ -14,6 +14,7 @@ from .layout import Layout, AdjointLayout, NdLayout from .ndmapping import UniformNdMapping, NdMapping, item_check from .overlay import Overlay, CompositeOverlay, NdOverlay, Overlayable from .options import Store, StoreOptions +from ..streams import Stream class HoloMap(UniformNdMapping, Overlayable): """ @@ -584,6 +585,11 @@ class DynamicMap(HoloMap): del params['sampled'] super(DynamicMap, self).__init__(initial_items, callback=callback, **params) + invalid = [s for s in self.streams if not isinstance(s, Stream)] + if invalid: + msg = ('The supplied streams list contains objects that ' + 'are not Stream instances: {objs}') + raise TypeError(msg.format(objs = ', '.join('%r' % el for el in invalid))) self._posarg_keys = util.validate_dynamic_argspec(self.callback.argspec, self.kdims,
Added validation of objects supplied in DynamicMap streams list
pyviz_holoviews
train
py
439b878cb61a9157dc2cf83aa8a4ddae7c845a75
diff --git a/lib/Less/Node/Url.php b/lib/Less/Node/Url.php index <HASH>..<HASH> 100755 --- a/lib/Less/Node/Url.php +++ b/lib/Less/Node/Url.php @@ -22,6 +22,16 @@ class Url { $val = $this->value->compile($ctx); + // Add the base path if the URL is relative + if( is_string($val->value) && !preg_match('/^(?:[a-z-]+:|\/)/',$val->value) ){ + $rootpath = $this->rootpath; + if ( !$val->quote ){ + $rootpath = preg_replace('/[\(\)\'"\s]/', '\\$1', $rootpath ); + } + $val->value = $rootpath . $val->value; + } + + return new \Less\Node\URL($val, $this->rootpath); } diff --git a/lib/Less/Parser.php b/lib/Less/Parser.php index <HASH>..<HASH> 100755 --- a/lib/Less/Parser.php +++ b/lib/Less/Parser.php @@ -539,7 +539,7 @@ class Parser { return new \Less\Node\Url((isset($value->value) || $value instanceof \Less\Node\Variable) - ? $value : new \Less\Node\Anonymous($value), ''); + ? $value : new \Less\Node\Anonymous($value), $this->env->rootpath); }
When adding a path onto an unquoted url, escape characters that require it
oyejorge_less.php
train
php,php
0de01567a39b5837a5a31c3b1ec6a417ec9becb9
diff --git a/goon.go b/goon.go index <HASH>..<HASH> 100644 --- a/goon.go +++ b/goon.go @@ -107,9 +107,7 @@ func (g *Goon) extractKeys(src interface{}, putRequest bool) ([]*datastore.Key, // is incomplete. func (g *Goon) Key(src interface{}) *datastore.Key { if k, err := g.KeyError(src); err == nil { - if !k.Incomplete() { - return k - } + return k } return nil } diff --git a/goon_test.go b/goon_test.go index <HASH>..<HASH> 100644 --- a/goon_test.go +++ b/goon_test.go @@ -44,8 +44,8 @@ func TestGoon(t *testing.T) { if k, err := n.KeyError(noid); err == nil && !k.Incomplete() { t.Error("expected incomplete on noid") } - if n.Key(noid) != nil { - t.Error("expected to not find a key") + if n.Key(noid) == nil { + t.Error("expected to find a key") } var keyTests = []keyTest{
Incomplete keys aren't errors
mjibson_goon
train
go,go
0024fc2228ac4c223fccb3696b170e3c23f74084
diff --git a/src/Illuminate/Mail/Mailable.php b/src/Illuminate/Mail/Mailable.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Mail/Mailable.php +++ b/src/Illuminate/Mail/Mailable.php @@ -289,7 +289,7 @@ class Mailable implements MailableContract */ public function from($address, $name = null) { - $this->setAddress($address, $name, 'from'); + return $this->setAddress($address, $name, 'from'); } /**
Add missing return statement (#<I>)
laravel_framework
train
php
27c715017d5540c8c8688df4b3d437b8fd637ce7
diff --git a/eZ/Publish/Core/Repository/RoleService.php b/eZ/Publish/Core/Repository/RoleService.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Repository/RoleService.php +++ b/eZ/Publish/Core/Repository/RoleService.php @@ -783,13 +783,14 @@ class RoleService implements RoleServiceInterface protected function buildPersistenceRoleObject( APIRoleCreateStruct $roleCreateStruct ) { $policiesToCreate = array(); - if ( !empty( $roleCreateStruct->getPolicies() ) ) + $policyCreateStructs = $roleCreateStruct->getPolicies(); + if ( !empty( $policyCreateStructs ) ) { - foreach ( $roleCreateStruct->getPolicies() as $policy ) + foreach ( $policyCreateStructs as $policyCreateStruct ) { - $policiesToCreate[] = $this->buildPersistencePolicyObject( $policy->module, - $policy->function, - $policy->limitations ); + $policiesToCreate[] = $this->buildPersistencePolicyObject( $policyCreateStruct->module, + $policyCreateStruct->function, + $policyCreateStruct->getLimitations() ); } }
Additional fix to role service implementation due to new role structs
ezsystems_ezpublish-kernel
train
php
2e3db498ff86e0417f3dfff0f62a9f8a1be4dc55
diff --git a/lib/openscap/xccdf/session.rb b/lib/openscap/xccdf/session.rb index <HASH>..<HASH> 100644 --- a/lib/openscap/xccdf/session.rb +++ b/lib/openscap/xccdf/session.rb @@ -9,11 +9,8 @@ # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. # -require 'ffi' - module OpenSCAP module Xccdf - extend FFI::Library class Session def initialize(input_filename)
OpenSCAP::Xccdf doesn't need to extend FFI::Library
OpenSCAP_ruby-openscap
train
rb
f926c431c6a9efd45c21ddcb0dc7d6544c4bd8f4
diff --git a/src/scripts/dashboard/dashboard.jobs.store.js b/src/scripts/dashboard/dashboard.jobs.store.js index <HASH>..<HASH> 100644 --- a/src/scripts/dashboard/dashboard.jobs.store.js +++ b/src/scripts/dashboard/dashboard.jobs.store.js @@ -84,7 +84,7 @@ let DashboardJobStore = Reflux.createStore({ for (let app of res.body.availableApps) {app.value = app.label;} this.update({apps: res.body.availableApps, appsLoading: false}); this.sort('analysis.created', '+', res.body.jobs, true); - }, isPublic, isSignedOut); + }, isPublic); }); },
Don't pass unused argument to getJobs.
OpenNeuroOrg_openneuro
train
js
6c08c271e7698adff60f5fb3ba82461dded39586
diff --git a/samples/blueprint/filter/src/main/java/org/ops4j/pax/wicket/samples/blueprint/filter/internal/SampleFilterFactory.java b/samples/blueprint/filter/src/main/java/org/ops4j/pax/wicket/samples/blueprint/filter/internal/SampleFilterFactory.java index <HASH>..<HASH> 100644 --- a/samples/blueprint/filter/src/main/java/org/ops4j/pax/wicket/samples/blueprint/filter/internal/SampleFilterFactory.java +++ b/samples/blueprint/filter/src/main/java/org/ops4j/pax/wicket/samples/blueprint/filter/internal/SampleFilterFactory.java @@ -22,16 +22,6 @@ import org.ops4j.pax.wicket.api.FilterFactory; public class SampleFilterFactory implements FilterFactory { - public int compareTo(FilterFactory o) { - if (o.getPriority() < 1) { - return 1; - } - if (o.getPriority() > 1) { - return -1; - } - return 0; - } - public Integer getPriority() { return 1; }
Adjust for changes made by PAXWICKET-<I>
ops4j_org.ops4j.pax.wicket
train
java
06026b3dec2d3cf7576f8d4e74c7da64abd11e9e
diff --git a/lib/couch_potato/railtie.rb b/lib/couch_potato/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/couch_potato/railtie.rb +++ b/lib/couch_potato/railtie.rb @@ -6,8 +6,8 @@ module CouchPotato CouchPotato::Config.database_name = YAML::load(File.read(Rails.root.join('config/couchdb.yml')))[Rails.env] end - if Rails.version >= '3' - class Railtie < Rails::Railtie + if defined?(::Rails::Railtie) + class Railtie < ::Rails::Railtie railtie_name :couch_potato config.after_initialize do |app|
more robust check for ::Rails::Railtie
langalex_couch_potato
train
rb
2197e1676d415391a08d7e466622050451ecd058
diff --git a/lxd/storage/drivers/interface.go b/lxd/storage/drivers/interface.go index <HASH>..<HASH> 100644 --- a/lxd/storage/drivers/interface.go +++ b/lxd/storage/drivers/interface.go @@ -57,9 +57,8 @@ type Driver interface { SetVolumeQuota(vol Volume, size string, op *operations.Operation) error GetVolumeDiskPath(vol Volume) (string, error) - // MountVolume mounts a storage volume, returns true if we caused a new mount, false if - // already mounted. - MountVolume(vol Volume, op *operations.Operation) (bool, error) + // MountVolume mounts a storage volume (if not mounted) and increments reference counter. + MountVolume(vol Volume, op *operations.Operation) error // MountVolumeSnapshot mounts a storage volume snapshot as readonly, returns true if we // caused a new mount, false if already mounted.
lxd/storage/drivers/interface: Removes "our mount" bool return value from MountVolume Ref counting keeps track of whether an unmount should proceed or not, so no need for indicating to caller whether they need to unmount or not.
lxc_lxd
train
go
f92751ec24b36e4a6fcc63a2457523ef7e9f0798
diff --git a/src/Command/GenerateCommand.php b/src/Command/GenerateCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/GenerateCommand.php +++ b/src/Command/GenerateCommand.php @@ -18,6 +18,7 @@ class GenerateCommand extends ProxyCommand $this->command = new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(); $this->command->setMigrationConfiguration($migrationConfig); $this->command->setName(self::getCommandName()); + $this->command->setAliases(['make:migration']); $class = new \ReflectionClass($this->command); $property = $class->getProperty('_template'); diff --git a/src/Command/MigrateCommand.php b/src/Command/MigrateCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/MigrateCommand.php +++ b/src/Command/MigrateCommand.php @@ -18,6 +18,7 @@ class MigrateCommand extends ProxyCommand $this->command = new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(); $this->command->setMigrationConfiguration($migrationConfig); $this->command->setName(self::getCommandName()); + $this->command->setAliases(['migrate']); parent::__construct(null); }
command aliases (to be swapped)
ixocreate_database-package
train
php,php
d4d31e70ca26325290db7499995a92a2e4305531
diff --git a/will/acl.py b/will/acl.py index <HASH>..<HASH> 100644 --- a/will/acl.py +++ b/will/acl.py @@ -22,7 +22,7 @@ def get_acl_members(acl): def is_acl_allowed(nick, acl): if not getattr(settings, "ACL", None): - logging.warn( + logging.warning( "%s was just allowed to perform actions in %s because no ACL settings exist. This can be a security risk." % ( nick, acl,
warn is deprecated, change to warning in logging module
skoczen_will
train
py
32935f5aac4264a74d21d6220385d51fa9b43519
diff --git a/packages/openneuro-server/graphql/schema.js b/packages/openneuro-server/graphql/schema.js index <HASH>..<HASH> 100644 --- a/packages/openneuro-server/graphql/schema.js +++ b/packages/openneuro-server/graphql/schema.js @@ -263,6 +263,8 @@ const typeDefs = ` analytics: Analytic # Dataset README readme: String @cacheControl(maxAge: 31536000, scope: PUBLIC) + # The git hash associated with this snapshot + hexsha: String } # Contents of dataset_description.json
Add 'hexsha' field to Snapshot API
OpenNeuroOrg_openneuro
train
js
bbc2f18c8336de9aaedefb60f305de1631095ae5
diff --git a/lib/ngoverrides.js b/lib/ngoverrides.js index <HASH>..<HASH> 100644 --- a/lib/ngoverrides.js +++ b/lib/ngoverrides.js @@ -432,7 +432,7 @@ function registerModule(context) { if (isJSONP) { // Assume everything up to the opening paren is the callback name resStr = resStr.replace(/^[^(]+\(/, '') - .replace(/\);?$/, ''); + .replace(/\)\s*;?\s*$/, ''); } // Call the callback before endRequest, to give the // callback a chance to push more requests into the queue
Allow for trailing whitespace in JSON-P response
saymedia_angularjs-server
train
js
3507898caab576d0047557487d6377bf43205f3b
diff --git a/src/Asserts/ReflectionAsserts.php b/src/Asserts/ReflectionAsserts.php index <HASH>..<HASH> 100644 --- a/src/Asserts/ReflectionAsserts.php +++ b/src/Asserts/ReflectionAsserts.php @@ -4,6 +4,18 @@ namespace Illuminated\Testing\Asserts; trait ReflectionAsserts { + protected function assertSubclassOf($class, $parent) + { + $message = "Failed asserting that class `{$class}` is subclass of `{$parent}`."; + $this->assertTrue(is_subclass_of($class, $parent), $message); + } + + protected function assertNotSubclassOf($class, $parent) + { + $message = "Failed asserting that class `{$class}` is not subclass of `{$parent}`."; + $this->assertFalse(is_subclass_of($class, $parent), $message); + } + protected function assertTraitUsed($class, $trait) { $message = "Failed asserting that class `{$class}` is using trait `{$trait}`.";
ITT: New reflection asserts added.
dmitry-ivanov_laravel-testing-tools
train
php
2a35a9191a87b010c6325092c66371ce808ab04e
diff --git a/src/cttvApi.js b/src/cttvApi.js index <HASH>..<HASH> 100644 --- a/src/cttvApi.js +++ b/src/cttvApi.js @@ -219,7 +219,7 @@ var cttvApi = function () { }; _.url.target = function (obj) { - return config.prefix + config.version + "/" + prefixTarget + obj.target_id; + return config.prefix + config.version + "/" + prefixTarget + parseUrlParams(obj); }; _.url.disease = function (obj) {
target endpoint can have other params
opentargets_RestApiJs
train
js
ec5f18b41eef00d65ca2d321c2a4b8e1451be573
diff --git a/lib/middleware/body_size_limiter.js b/lib/middleware/body_size_limiter.js index <HASH>..<HASH> 100644 --- a/lib/middleware/body_size_limiter.js +++ b/lib/middleware/body_size_limiter.js @@ -40,7 +40,11 @@ exports.attach = function attachBodySizeLimiter(options) { log.msg('Denying client for too large content length', {content_length: cl, max: maxSize}); res.writeHead(413, {Connection: 'close'}); res.end(); - req.transport.close(); + + if (req.transport) { + req.transport.close(); + } + return; } } @@ -56,7 +60,11 @@ exports.attach = function attachBodySizeLimiter(options) { log.msg('Denying client for body too large', {content_length: bodyLen, max: maxSize}); res.writeHead(413, {Connection: 'close'}); res.end(); - req.transport.close(); + + if (req.transport) { + req.transport.close(); + } + oversize = true; } });
Only call close on transport if transport is available. (it's only available in node < <I>)
racker_node-rackspace-shared-middleware
train
js
e1e299bcd7939779e2ca9442dd0f42f2a207c96d
diff --git a/eZ/Publish/API/Repository/Tests/ContentTypeServiceTest.php b/eZ/Publish/API/Repository/Tests/ContentTypeServiceTest.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Tests/ContentTypeServiceTest.php +++ b/eZ/Publish/API/Repository/Tests/ContentTypeServiceTest.php @@ -2161,7 +2161,14 @@ class ContentTypeServiceTest extends BaseTest */ public function testLoadContentTypeByRemoteIdThrowsNotFoundException() { - $this->markTestIncomplete( "Test for ContentTypeService::loadContentTypeByRemoteId() is not implemented." ); + $repository = $this->getRepository(); + + /* BEGIN: Use Case */ + $contentTypeService = $repository->getContentTypeService(); + + // This call will fail with a NotFoundException + $contentTypeService->loadContentTypeByRemoteId( 'not-exists' ); + /* END: Use Case */ } /**
Implemented error condition on load by remote ID.
ezsystems_ezpublish-kernel
train
php
d1b6584d1d396dff1a2d202c212d9baec7267f23
diff --git a/google/google.go b/google/google.go index <HASH>..<HASH> 100644 --- a/google/google.go +++ b/google/google.go @@ -179,13 +179,13 @@ func (g *GoogleCloud) getTopic(ctx context.Context, name string) (*pubsub.Topic, var err error t := g.client.Topic(name) - ok, err := t.Exists(ctx) + ok, err := t.Exists(context.Background()) if err != nil { return nil, err } if !ok { - t, err = g.client.CreateTopic(ctx, name) + t, err = g.client.CreateTopic(context.Background(), name) if err != nil { return nil, err }
Use new context for publish to async operations work outside of rpc's
lileio_pubsub
train
go
3f3e96d2a32c198849fd3a21f9c1e3943972b06b
diff --git a/builtin/credential/okta/cli.go b/builtin/credential/okta/cli.go index <HASH>..<HASH> 100644 --- a/builtin/credential/okta/cli.go +++ b/builtin/credential/okta/cli.go @@ -38,6 +38,15 @@ func (h *CLIHandler) Auth(c *api.Client, m map[string]string) (*api.Secret, erro "password": password, } + mfa_method, ok := m["method"] + if ok { + data["method"] = mfa_method + } + mfa_passcode, ok := m["passcode"] + if ok { + data["passcode"] = mfa_passcode + } + path := fmt.Sprintf("auth/%s/login/%s", mount, username) secret, err := c.Logical().Write(path, data) if err != nil {
Add the ability to pass in mfa parameters when authenticating via the… (#<I>)
hashicorp_vault
train
go
5a621a6f694838f2ff1749c1beff28d7d8f24dbd
diff --git a/lib/discordrb/events/roles.rb b/lib/discordrb/events/roles.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/events/roles.rb +++ b/lib/discordrb/events/roles.rb @@ -68,33 +68,8 @@ module Discordrb::Events end # Event raised when a role updates on a server - class ServerRoleUpdateEvent < Event - attr_reader :role, :server - - def initialize(data, bot) - @server = bot.server(data['guild_id'].to_i) - return unless @server - - role_id = data['role']['id'].to_i - @role = @server.roles.find { |r| r.id == role_id } - end - end + class ServerRoleUpdateEvent < ServerRoleCreateEvent; end # Event handler for ServerRoleUpdateEvent - class ServerRoleUpdateEventHandler < EventHandler - def matches?(event) - # Check for the proper event type - return false unless event.is_a? ServerRoleUpdateEvent - - [ - matches_all(@attributes[:name], event.name) do |a, e| - a == if a.is_a? String - e.to_s - else - e - end - end - ].reduce(true, &:&) - end - end + class ServerRoleUpdateEventHandler < ServerRoleCreateEventHandler; end end
Make ServerRoleUpdateEvent simply inherit from ServerRoleCreate event as both do exactly the same thing
meew0_discordrb
train
rb
3580ee22b5b30f67a5621b1e9333640f64f54d78
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( include_package_data = True, # Package dependencies. - install_requires = ['setuptools', 'simplejson'], + install_requires = ['simplejson'], # Metadata for PyPI. author = 'Ryan McGrath',
Don't need to include `setuptools`, heh.
ryanmcgrath_twython
train
py
671fc908adcc127c59cecf861f39eacd0a2c1ea1
diff --git a/intranet/settings/base.py b/intranet/settings/base.py index <HASH>..<HASH> 100644 --- a/intranet/settings/base.py +++ b/intranet/settings/base.py @@ -114,7 +114,7 @@ MIDDLEWARE_CLASSES = ( "intranet.middleware.ldap_db.CheckLDAPBindMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "intranet.middleware.ajax.AjaxNotAuthenticatedMiddleWare", - # "intranet.middleware.templates.AdminSelectizeLoadingIndicatorMiddleware", + "intranet.middleware.templates.AdminSelectizeLoadingIndicatorMiddleware", ) ROOT_URLCONF = "intranet.urls"
Re-enable selectize middleware
tjcsl_ion
train
py
dc73c916fc4a864ac6c9f15b521931fb884360f2
diff --git a/framework/helpers/base/ArrayHelper.php b/framework/helpers/base/ArrayHelper.php index <HASH>..<HASH> 100644 --- a/framework/helpers/base/ArrayHelper.php +++ b/framework/helpers/base/ArrayHelper.php @@ -272,7 +272,7 @@ class ArrayHelper foreach ($keys as $i => $key) { $flag = $sortFlag[$i]; $cs = $caseSensitive[$i]; - if (!$cs && ($flag === SORT_STRING || $flag === SORT_NATURAL)) { + if (!$cs && ($flag === SORT_STRING)) { if (defined('SORT_FLAG_CASE')) { $flag = $flag | SORT_FLAG_CASE; $args[] = static::getColumn($array, $key);
Fix unsupported flag in php <I>.x environment [ArrayHelper::multisort]
yiisoft_yii2-debug
train
php
a436435d0f71870dabf5c7a71aa0dfaa8ad9dcb3
diff --git a/lib/instrumentation/span.js b/lib/instrumentation/span.js index <HASH>..<HASH> 100644 --- a/lib/instrumentation/span.js +++ b/lib/instrumentation/span.js @@ -122,10 +122,9 @@ Span.prototype._encode = function (cb) { timestamp: self.timestamp, duration: self.duration(), context: undefined, - stacktrace: undefined + stacktrace: frames } - if (frames) payload.stacktrace = frames if (self._db || self._tags) { payload.context = { db: self._db || undefined,
refactor: improve span payload encoding (#<I>)
elastic_apm-agent-nodejs
train
js
9d20675bcd054cf1effbf63213951e36a0f3fe5b
diff --git a/lib/qu/backend/mongo.rb b/lib/qu/backend/mongo.rb index <HASH>..<HASH> 100644 --- a/lib/qu/backend/mongo.rb +++ b/lib/qu/backend/mongo.rb @@ -21,7 +21,8 @@ module Qu def connection @connection ||= begin - uri = URI.parse(ENV['MONGOHQ_URL'].to_s) + host_uri = (ENV['MONGOHQ_URL'] || ENV['MONGOLAB_URI']).to_s + uri = URI.parse(host_uri) database = uri.path.empty? ? 'qu' : uri.path[1..-1] options = {} if uri.password
Add mongolab environment variable to mongo backend
bkeepers_qu
train
rb
460d02972b60ba473ef8f10b037111b38b52258b
diff --git a/dramatiq/message.py b/dramatiq/message.py index <HASH>..<HASH> 100644 --- a/dramatiq/message.py +++ b/dramatiq/message.py @@ -48,9 +48,9 @@ class Message(namedtuple("Message", ( """Create a copy of this message. """ updated_options = attributes.pop("options", {}) - options = attributes["options"] = self.options.copy() + options = self.options.copy() options.update(updated_options) - return self._replace(**attributes) + return self._replace(**attributes, options=options) def __str__(self): params = ", ".join(repr(arg) for arg in self.args)
revert: make Message.copy work under Python <I> This reverts commit <I>d<I>e5f<I>f<I>cd8c<I>a1de<I>a<I>.
Bogdanp_dramatiq
train
py
dc7cfb603f39bedc2528d9d627a7b1b423107930
diff --git a/src/webpack.js b/src/webpack.js index <HASH>..<HASH> 100644 --- a/src/webpack.js +++ b/src/webpack.js @@ -3,7 +3,6 @@ * @flow */ -import invariant from 'invariant'; import {renderToString} from './index'; import { findConfig, @@ -22,4 +21,4 @@ module.exports = function reactdown(source: string): string { parseConfigFromQuery(this.query) ); return renderToString(source, config).code; -} +};
style(webpack): lint errors
andreypopp_reactdown
train
js
0a1b1d5cd00e17f13a010c18b1dcc0d8a20c8e60
diff --git a/src/benchsuite/rest/app.py b/src/benchsuite/rest/app.py index <HASH>..<HASH> 100644 --- a/src/benchsuite/rest/app.py +++ b/src/benchsuite/rest/app.py @@ -20,11 +20,13 @@ import logging import signal import sys +import json from flask import Flask +from flask_restplus import Swagger from benchsuite.rest.apiv1 import blueprint as blueprint1 - +from benchsuite.rest.apiv1 import api as apiv1 app = Flask(__name__) @@ -41,6 +43,14 @@ def on_exit(sig, func=None): sys.exit(1) +def dump_swagger_specs(): + app.config['SERVER_NAME'] = 'example.org:80' + with app.app_context(): + print() + with open('swagger-apiv1.json', 'w') as outfile: + json.dump(Swagger(apiv1).as_dict(), outfile) + + if __name__ == '__main__': set_exit_handler(on_exit) @@ -48,6 +58,12 @@ if __name__ == '__main__': level=logging.DEBUG, stream=sys.stdout) + if len(sys.argv) > 1 and sys.argv[1] == '--dump-specs': + dump_swagger_specs() + sys.exit(0) + + + print('Using internal server. Not use this in production!!!') app.run(debug=True)
added function to dump swagger api specs
benchmarking-suite_benchsuite-rest
train
py
b06068f9f63105789427fe17f81df8b484f05614
diff --git a/lib/Pagon/App.php b/lib/Pagon/App.php index <HASH>..<HASH> 100644 --- a/lib/Pagon/App.php +++ b/lib/Pagon/App.php @@ -55,7 +55,7 @@ class App extends EventEmitter 'route' => array(), 'buffer' => true, 'timezone' => 'UTC', - 'charset' => 'UTF-8' + 'charset' => 'UTF-8', ); /** @@ -470,6 +470,9 @@ class App extends EventEmitter } } + // Default set app + $data['_'] = $this; + // Create view $view = new View($path, $data + $this->locals, $options + array( 'dir' => $this->config['views']
Set app to view variable "_"
hfcorriez_pagon
train
php
21bbf18fc69170cd2a84f16d12b3735d113b0c89
diff --git a/circuit/circuit.py b/circuit/circuit.py index <HASH>..<HASH> 100644 --- a/circuit/circuit.py +++ b/circuit/circuit.py @@ -678,10 +678,10 @@ class circuit(): if outputs is None or len(outputs) == 0: return 0 else: - return 1 + max([ # pylint: disable=R1728 + return 1 + max( __subtrees_max_depth(g.outputs) for g in outputs - ]) + ) return __subtrees_max_depth(circuit_inputs)
Resolve Pylint-R<I>: pass generator to `max(`
lapets_circuit
train
py
674c8f5b8f710d6133c7f1b0175e77f32ac2b11f
diff --git a/test/Specs.js b/test/Specs.js index <HASH>..<HASH> 100644 --- a/test/Specs.js +++ b/test/Specs.js @@ -1,4 +1,4 @@ -var convertor = require('../index'), +var convertor = require('../chncrs'), expect = require('expect.js'); describe('ProjectionTransform', function () { it('convert coordinates from gcj02 to bd09ll',function() {
update Specs to chncrs.js
fuzhenn_chinese_coordinate_conversion
train
js
9006d304f4654dc0954b27b4edb2e603f89acc61
diff --git a/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb b/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +++ b/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb @@ -26,6 +26,7 @@ module Fastlane url_params << "scale=#{params[:scale]}" url_params << "launchUrl=#{params[:launch_url]}" if params[:launch_url] url_params << "language=#{params[:language]}" if params[:language] + url_params << "osVersion=#{params[:os_version]}" if params[:os_version] return link + "?" + url_params.join("&") end @@ -97,6 +98,11 @@ module Fastlane env_name: "APPETIZE_VIEWING_URL_GENERATOR_LAUNCH_URL", description: "Specify a deep link to open when your app is launched", is_string: true, + optional: true), + FastlaneCore::ConfigItem.new(key: :os_version, + env_name: "APPETIZE_VIEWING_URL_GENERATOR_OS_VERSION", + description: "The operating system version on which to run your app, e.g. 10.3, 8.0", + is_string: true, optional: true) ] end
Add support for OS version in Appetize options (#<I>)
fastlane_fastlane
train
rb
993e9b428095fd523f272402f8dd1c88432d956d
diff --git a/lib/art-decomp/fsm.rb b/lib/art-decomp/fsm.rb index <HASH>..<HASH> 100644 --- a/lib/art-decomp/fsm.rb +++ b/lib/art-decomp/fsm.rb @@ -42,13 +42,11 @@ module ArtDecomp class FSM end def beta_x ins - return Blanket[B[*[email protected]]] if ins.empty? - ins.map { |i| Blanket.from_array @inputs[i] }.inject :* + beta @inputs, ins end def beta_y ins - return Blanket[B[*[email protected]]] if ins.empty? - ins.map { |i| Blanket.from_array @outputs[i] }.inject :* + beta @outputs, ins end alias eql? == @@ -128,6 +126,11 @@ module ArtDecomp class FSM private + def beta column, ins + return Blanket[B[*[email protected]]] if ins.empty? + ins.map { |i| Blanket.from_array column[i] }.inject :* + end + def encoding column, rows encs = rows.bits.map { |row| column[row] }.uniq - [DontCare] case encs.size
factor out FSM#beta
chastell_art-decomp
train
rb
d2d25ce9be67d32b61bb21ce062e20d1b1a95cfb
diff --git a/sniffy-core/src/main/java/io/sniffy/LegacySpy.java b/sniffy-core/src/main/java/io/sniffy/LegacySpy.java index <HASH>..<HASH> 100644 --- a/sniffy-core/src/main/java/io/sniffy/LegacySpy.java +++ b/sniffy-core/src/main/java/io/sniffy/LegacySpy.java @@ -5,7 +5,6 @@ import io.sniffy.sql.SqlStatement; import io.sniffy.sql.SqlStats; import io.sniffy.sql.StatementMetaData; -import java.lang.ref.WeakReference; import java.util.Map; import static io.sniffy.Threads.CURRENT;
Avoid unused imports such as 'java.lang.ref.WeakReference'
sniffy_sniffy
train
java