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
7ec23ffd702bdff09429ebf2b6ee80ef9c0b566b
diff --git a/spec/page_spec.js b/spec/page_spec.js index <HASH>..<HASH> 100644 --- a/spec/page_spec.js +++ b/spec/page_spec.js @@ -5,7 +5,9 @@ describe("page", function () { var source = require('../lib/source')(separator); - var process_file = function (process, name) { return process(partials[name]) }; + var process_file = function (process, file, params) { + return process(partials[file], params); + }; var page = require('../lib/page')({ source: source,
Add params argument to handle passing of data to a partial
cambridge-healthcare_grunt-stencil
train
js
3dc1f3da7377e5a5cf55ad0e30abeb309232a80e
diff --git a/tests/test_json_posts.php b/tests/test_json_posts.php index <HASH>..<HASH> 100644 --- a/tests/test_json_posts.php +++ b/tests/test_json_posts.php @@ -123,6 +123,8 @@ class WP_Test_JSON_Posts extends WP_UnitTestCase { $this->assertEquals( $data['name'], $edited_post->post_name ); $this->assertEquals( $data['status'], $edited_post->post_status ); $this->assertEquals( $data['author'], $edited_post->post_author ); + + $this->check_get_post_response( $response, $this->post_obj, 'edit' ); }
Added response test for edit context of edit_post endpoint.
WP-API_WP-API
train
php
b2d3054ddc10c4467dadc9870b8516b23d66f6f5
diff --git a/topology-graph.js b/topology-graph.js index <HASH>..<HASH> 100644 --- a/topology-graph.js +++ b/topology-graph.js @@ -203,8 +203,8 @@ } function resized() { - if (!timeout) - timeout = window.setTimeout(adjust, 50); + window.clearTimeout(timeout); + timeout = window.setTimeout(adjust, 150); } window.addEventListener('resize', resized);
Only relayout graph when resize operation is done or paused The resizing jerks quite a bit (which is unsolved) so at least mitigate by doing it less often.
kubernetes-ui_topology-graph
train
js
8cee846a5602b42417494326245d805cd68f293f
diff --git a/vault/external_tests/misc/kvv2_upgrade_test.go b/vault/external_tests/misc/kvv2_upgrade_test.go index <HASH>..<HASH> 100644 --- a/vault/external_tests/misc/kvv2_upgrade_test.go +++ b/vault/external_tests/misc/kvv2_upgrade_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/helper/testhelpers" vaulthttp "github.com/hashicorp/vault/http" - "github.com/hashicorp/vault/logical" - "github.com/hashicorp/vault/physical" + "github.com/hashicorp/vault/sdk/logical" + "github.com/hashicorp/vault/sdk/physical" "github.com/hashicorp/vault/vault" "github.com/kr/pretty" )
Fixed wrong imports in test after refactoring (#<I>)
hashicorp_vault
train
go
03d97cb2776496726f95a793499133e278c71211
diff --git a/TYPO3.Neos/Classes/TYPO3/Neos/Routing/FrontendNodeRoutePartHandler.php b/TYPO3.Neos/Classes/TYPO3/Neos/Routing/FrontendNodeRoutePartHandler.php index <HASH>..<HASH> 100644 --- a/TYPO3.Neos/Classes/TYPO3/Neos/Routing/FrontendNodeRoutePartHandler.php +++ b/TYPO3.Neos/Classes/TYPO3/Neos/Routing/FrontendNodeRoutePartHandler.php @@ -613,7 +613,7 @@ class FrontendNodeRoutePartHandler extends DynamicRoutePart implements FrontendN $uriSegment .= $preset['uriSegment'] . '_'; } - if ($allDimensionPresetsAreDefault && $currentNodeIsSiteNode) { + if ($this->supportEmptySegmentForDimensions && $allDimensionPresetsAreDefault && $currentNodeIsSiteNode) { return '/'; } else { return ltrim(trim($uriSegment, '_') . '/', '/');
BUGFIX: Valid URLs with `supportEmptySegmentForDimensions` Makes sure that generated URLs observe the setting. Fixes: #<I>
neos_neos-development-collection
train
php
bb8f8b71f45446780449a730a741cc952a9f8578
diff --git a/src/bitbangio.py b/src/bitbangio.py index <HASH>..<HASH> 100755 --- a/src/bitbangio.py +++ b/src/bitbangio.py @@ -16,6 +16,11 @@ class I2C(Lockable): # TODO: This one is a bit questionable: if agnostic.board_id == ap_board.PYBOARD: raise NotImplementedError("No software I2C on {}".format(agnostic.board_id)) + elif agnostic.detector.board.any_embedded_linux: + # TODO: Attempt to load this library automatically + raise NotImplementedError( + "For bitbangio on Linux, please use Adafruit_CircuitPython_BitbangIO" + ) self.init(scl, sda, frequency) def init(self, scl, sda, frequency): @@ -63,6 +68,11 @@ class I2C(Lockable): # TODO untested, as actually busio.SPI was on tasklist https://github.com/adafruit/Adafruit_Micropython_Blinka/issues/2 :( class SPI(Lockable): def __init__(self, clock, MOSI=None, MISO=None): + if agnostic.detector.board.any_embedded_linux: + # TODO: Attempt to load this library automatically + raise NotImplementedError( + "For bitbangio on Linux, please use Adafruit_CircuitPython_BitbangIO" + ) from machine import SPI self._spi = SPI(-1)
Display message to linux user to use new Bitbang Library for now
adafruit_Adafruit_Blinka
train
py
65960d7be6ce6f46569d5576d427b8ef1694ea2f
diff --git a/fluent.js b/fluent.js index <HASH>..<HASH> 100644 --- a/fluent.js +++ b/fluent.js @@ -22,10 +22,13 @@ function floc(target){ return new Floc(instance); } +var returnsSelf = 'addClass removeClass append prepend'.split(' '); + for(var key in doc){ if(typeof doc[key] === 'function'){ floc[key] = doc[key]; flocProto[key] = (function(key){ + var instance = this; // This is also extremely dodgy and fast return function(a,b,c,d,e,f){ var result = doc[key](this, a,b,c,d,e,f); @@ -33,6 +36,9 @@ for(var key in doc){ if(result !== doc && isList(result)){ return floc(result); } + if(returnsSelf.indexOf(key) >=0){ + return instance; + } return result; }; }(key)); @@ -60,4 +66,14 @@ flocProto.off = function(events, target, callback){ return this; }; +flocProto.addClass = function(className){ + doc.addClass(this, className); + return this; +}; + +flocProto.removeClass = function(className){ + doc.removeClass(this, className); + return this; +}; + module.exports = floc; \ No newline at end of file
Fixed self-returning functions in fluent api
KoryNunn_doc
train
js
bb705842d796aa3a37ae9bb391df39bbec55805a
diff --git a/builder/tmpl.go b/builder/tmpl.go index <HASH>..<HASH> 100644 --- a/builder/tmpl.go +++ b/builder/tmpl.go @@ -1,6 +1,8 @@ package builder -var tmpl = `package {{.Name}} +var tmpl = `// Code generated by github.com/gobuffalo/packr. DO NOT EDIT + +package {{.Name}} import "github.com/gobuffalo/packr"
Add code generation comment to top of generated files By convention, a comment at the top of a file which matches this regular expression: '^// Code generated .* DO NOT EDIT$' indicates that a file is generated, and so it can be treated differently by linters, code review tools, etc. This convention was established in <URL>
gobuffalo_packr
train
go
dda5020aa3023656d4507283d8ad0da3d7b39698
diff --git a/lib/dm-core/adapters/data_objects_adapter.rb b/lib/dm-core/adapters/data_objects_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/adapters/data_objects_adapter.rb +++ b/lib/dm-core/adapters/data_objects_adapter.rb @@ -175,9 +175,6 @@ module DataMapper def update(attributes, collection) query = collection.query - # TODO: if the query contains any links, a limit or an offset - # use a subselect to get the rows to be updated - properties = [] bind_values = [] @@ -206,10 +203,6 @@ module DataMapper # @api semipublic def delete(collection) query = collection.query - - # TODO: if the query contains any links, a limit or an offset - # use a subselect to get the rows to be deleted - statement, bind_values = delete_statement(query) execute(statement, *bind_values).affected_rows end
Removed comments about subqueries that are no longer valid
datamapper_dm-core
train
rb
2cbe6cdfd816eab82a697ae9d3620d2d9c897d0e
diff --git a/build.go b/build.go index <HASH>..<HASH> 100644 --- a/build.go +++ b/build.go @@ -210,7 +210,7 @@ func createPackage(options linuxPackageOptions) { // copy sample ini file to /etc/grafana runPrint("cp", "conf/sample.ini", filepath.Join(packageRoot, options.configFilePath)) // copy sample ldap toml config file to /etc/grafana/ldap.toml - runPrint("cp", "conf/sample.ini", filepath.Join(packageRoot, ldapFilePath)) + runPrint("cp", "conf/sample.ini", filepath.Join(packageRoot, options.ldapFilePath)) args := []string{ "-s", "dir",
fix(build): fixed issue in build.go
grafana_grafana
train
go
e307c3b47d92140409274661acda379a4da75690
diff --git a/flask2postman.py b/flask2postman.py index <HASH>..<HASH> 100644 --- a/flask2postman.py +++ b/flask2postman.py @@ -140,6 +140,8 @@ def main(): help="the base of every URL (default: {{base_url}})") parser.add_argument("-a", "--all", action="store_true", help="also generate OPTIONS/HEAD methods") + parser.add_argument("-i", "--indent", action="store_true", + help="indent the output") args = parser.parse_args() logging.disable(logging.CRITICAL) @@ -164,7 +166,12 @@ def main(): route.description = trim(endpoint.__doc__) collection.add_route(route) - print(json.dumps(collection.to_dict())) + if args.indent: + json = json.dumps(collection.to_dict(), indent=4, sort_keys=True) + else: + json = json.dumps(collection.to_dict()) + + print(json) if __name__ == "__main__":
Add an option to indent the output
numberly_flask2postman
train
py
f88e5f6056459daa469b8acaf3ffc095db89c35a
diff --git a/salt/modules/network.py b/salt/modules/network.py index <HASH>..<HASH> 100644 --- a/salt/modules/network.py +++ b/salt/modules/network.py @@ -1832,7 +1832,6 @@ def default_route(family=None): ret = [] for route in _routes: if family: - def_route_family = default_route[family] if route["destination"] in default_route[family]: if __grains__["kernel"] == "SunOS" and route["addr_family"] != family: continue
Remove unused debug variable as per review comments
saltstack_salt
train
py
4e4b933e73c467207d47a9aa96d5691430a0d954
diff --git a/twitter4j-core/src/main/java/twitter4j/TwitterStream.java b/twitter4j-core/src/main/java/twitter4j/TwitterStream.java index <HASH>..<HASH> 100644 --- a/twitter4j-core/src/main/java/twitter4j/TwitterStream.java +++ b/twitter4j-core/src/main/java/twitter4j/TwitterStream.java @@ -660,6 +660,8 @@ public final class TwitterStream extends TwitterOAuthSupportBaseImpl { logger.warn(e.getMessage()); } } + } catch (Exception e) { + logger.warn("Unhandled exception during stream processing: " + e); } } }
Be more resilient to exceptions thrown during stream processing.
Twitter4J_Twitter4J
train
java
3846d25bb0d8f956522012dc72def9b95df7a3a4
diff --git a/src/sftp-ws/client/SFTPv3.js b/src/sftp-ws/client/SFTPv3.js index <HASH>..<HASH> 100644 --- a/src/sftp-ws/client/SFTPv3.js +++ b/src/sftp-ws/client/SFTPv3.js @@ -669,7 +669,15 @@ SFTP.prototype.readdir = function(where, cb) { buf.writeUInt32BE(handlelen, p, true); where.copy(buf, p += 4); - return this._send(buf, cb); + return this._send(buf, function(err, list) { + if (err || list === false) + return cb(err, list); + for (var i = list.length - 1; i >= 0; --i) { + if (list[i].filename === '.' || list[i].filename === '..') + list.splice(i, 1); + } + cb(err, list); + }); }; SFTP.prototype.fstat = function(handle, cb) {
SFTPv3: strip out '.' and '..' from readdir list This matches behavior of node's fs.readdir()
lukaaash_sftp-ws
train
js
1a90fb746595d3238cd3d59915c14c0cd5d9fad7
diff --git a/salt/modules/glance.py b/salt/modules/glance.py index <HASH>..<HASH> 100644 --- a/salt/modules/glance.py +++ b/salt/modules/glance.py @@ -130,9 +130,12 @@ def _auth(profile=None, api_version=2, **connection_args): g_endpoint_url = g_endpoint_url['internalurl'].strip('v'+str(api_version)) if admin_token and api_version != 1 and not password: + # If we had a password we could just + # ignore the admin-token and move on... raise SaltInvocationError('Only can use keystone admin token ' + 'with Glance API v1') - elif api_version <= 2: + elif password: + # Can't use the admin-token anyway kwargs = {'username': user, 'password': password, 'tenant_id': tenant_id, @@ -144,10 +147,12 @@ def _auth(profile=None, api_version=2, **connection_args): # this ensures it's only passed in when defined if insecure: kwargs['insecure'] = True - else: + elif api_version == 1 and admin_token: kwargs = {'token': admin_token, 'auth_url': auth_url, 'endpoint_url': g_endpoint_url} + else: + raise SaltInvocationError('No credentials to authenticate with.') if HAS_KEYSTONE: log.debug('Calling keystoneclient.v2_0.client.Client(' +
fix authentication when keystone.token is defined
saltstack_salt
train
py
5ad57ec5a5e58440655f872389f58613e6c3c067
diff --git a/src/main/java/com/github/parboiled1/grappa/buffers/CharSequenceInputBuffer.java b/src/main/java/com/github/parboiled1/grappa/buffers/CharSequenceInputBuffer.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/parboiled1/grappa/buffers/CharSequenceInputBuffer.java +++ b/src/main/java/com/github/parboiled1/grappa/buffers/CharSequenceInputBuffer.java @@ -132,4 +132,10 @@ public final class CharSequenceInputBuffer { return Futures.getUnchecked(lineCounter).getNrLines(); } + + @Override + public int length() + { + return charSequence.length(); + } } diff --git a/src/main/java/com/github/parboiled1/grappa/buffers/InputBuffer.java b/src/main/java/com/github/parboiled1/grappa/buffers/InputBuffer.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/parboiled1/grappa/buffers/InputBuffer.java +++ b/src/main/java/com/github/parboiled1/grappa/buffers/InputBuffer.java @@ -91,4 +91,6 @@ public interface InputBuffer * @return number of lines in the input buffer. */ int getLineCount(); + + int length(); }
Add a .length() method to InputBuffer Will allow in the long run to rework the "end of input" matcher. and to get rid of EOI.
fge_grappa
train
java,java
0190b0cb2333d6fe9e00773c8a3b451f8e4b7451
diff --git a/classes/Swift/AWSTransport.php b/classes/Swift/AWSTransport.php index <HASH>..<HASH> 100644 --- a/classes/Swift/AWSTransport.php +++ b/classes/Swift/AWSTransport.php @@ -84,9 +84,11 @@ } protected function _debug ( $message ) { - if( false === $this->debug ) { return; } - if( true === $this->debug ) { error_log( $message ); } - else { call_user_func( $this->debug, $message ); } + if ( true === $this->debug ) { + error_log( $message ); + } elseif ( is_callable($this->debug) ) { + call_user_func( $this->debug, $message ); + } } /**
Check if debug function is_callable before execution. Cases where configuration variables do not evaulate to true/false result in errors when Swift attempts to call that value as a function.
jmhobbs_Swiftmailer-Transport--AWS-SES
train
php
11aa4f0d14dfcde3cbcfbf4433041d92e2aa4214
diff --git a/app/models/glue/pulp/errata.rb b/app/models/glue/pulp/errata.rb index <HASH>..<HASH> 100644 --- a/app/models/glue/pulp/errata.rb +++ b/app/models/glue/pulp/errata.rb @@ -155,10 +155,14 @@ class Glue::Pulp::Errata def product_ids product_ids = [] - self.repoids.each{ |repoid| - repo = Repository.where(:pulp_id => repoid)[0] - product_ids << repo.product.id - } + self.repoids.each do |repoid| + # there is a problem, that Pulp in versino <= 0.0.265-1 doesn't remove + # repo frmo errata when deleting repository. Therefore there might be a + # situation that repo is not in Pulp anymore, see BZ 790356 + if repo = Repository.where(:pulp_id => repoid)[0] + product_ids << repo.product.id + end + end product_ids.uniq end
<I> - Count on the fact that repo in errata might be deleted Handling a problem described also in <I>.
Katello_katello
train
rb
47b9ac64ab88fff12b6003fd9e13eb6712bd20b6
diff --git a/src/main/java/com/visenze/visearch/ResizeSettings.java b/src/main/java/com/visenze/visearch/ResizeSettings.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/visenze/visearch/ResizeSettings.java +++ b/src/main/java/com/visenze/visearch/ResizeSettings.java @@ -7,7 +7,7 @@ public class ResizeSettings { public static ResizeSettings HIGH = new ResizeSettings(1024, 1024, 0.985f); - public static float DELTA = 0.000001f; + private static float DELTA = 0.000001f; private int width; private int height;
Reduce visibility for delta in ResizeSettings
visenze_visearch-sdk-java
train
java
1fd8644ffecf19f8b16fbd35d706b2ee5bc67efa
diff --git a/thjs.js b/thjs.js index <HASH>..<HASH> 100644 --- a/thjs.js +++ b/thjs.js @@ -1032,6 +1032,7 @@ function raw(type, arg, callback) if(!hn.chans[chan.id]) return debug("dropping receive packet to dead channel",chan.id,packet.js) // if err'd or ended, delete ourselves if(packet.js.err || packet.js.end) chan.fail(); + else chan.opened = true; chan.recvAt = Date.now(); chan.last = packet.sender; chan.callback(packet.js.err||packet.js.end, packet, chan); @@ -1158,6 +1159,7 @@ function channel(type, arg, callback) // in errored state, only/always reply with the error and drop if(chan.errored) return chan.send(chan.errored); chan.recvAt = Date.now(); + chan.opened = true; chan.last = packet.sender; // process any valid newer incoming ack/miss
add little convenience flag to channels for apps
telehash_e3x-js
train
js
f18541e05ec19e7bd854f8d667a19f039a130de5
diff --git a/tests/TestCase/Integration/JsonApi/SearchIntegrationTest.php b/tests/TestCase/Integration/JsonApi/SearchIntegrationTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Integration/JsonApi/SearchIntegrationTest.php +++ b/tests/TestCase/Integration/JsonApi/SearchIntegrationTest.php @@ -13,13 +13,14 @@ class SearchIntegrationTest extends JsonApiBaseTestCase public function viewProvider() { return [ - // assert single-field searches + // assert single-field searches (case sensitive for now or + // Postgres CI tests will fail) 'single field full search-key' => [ - '/countries?filter=netherlands', + '/countries?filter=Netherlands', 'search_single_field.json', ], 'single field partial search-key' => [ - '/countries?filter=nether', + '/countries?filter=Nether', 'search_single_field.json', ] ];
Do a Case Sensitive search to prevent Travis Postgres tests from failing
FriendsOfCake_crud-json-api
train
php
e8cd6853ba5cd47c53073af5bc9c17f88457bed4
diff --git a/rimraf.js b/rimraf.js index <HASH>..<HASH> 100644 --- a/rimraf.js +++ b/rimraf.js @@ -350,10 +350,13 @@ function rmkidsSync (p, options) { var retries = isWindows ? 100 : 1 var i = 0 do { + var threw = true try { - return options.rmdirSync(p, options) + var ret = options.rmdirSync(p, options) + threw = false + return ret } finally { - if (++i < retries) + if (++i < retries && threw) continue } } while (true)
only run rmdirSync 'retries' times when it throws
isaacs_rimraf
train
js
172376b323f75391805ffe95704d0f1130257b17
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -113,7 +113,7 @@ } if (!invokedByParse){ - carryFiller = filler; + carryFiller = filler.length === 1 ? filler[0] : filler; filler = []; }
made rolled return change non-breaking rolled will either be an array of what was rolled or with compound rolls that have a parser-invoked component, an array of arrays
troygoode_node-roll
train
js
099b174e0463cd2c9c2bdfce8a454a75768eb63b
diff --git a/classes/model/page.php b/classes/model/page.php index <HASH>..<HASH> 100755 --- a/classes/model/page.php +++ b/classes/model/page.php @@ -249,7 +249,7 @@ class Model_Page extends ORM_Versioned { */ public function delete() { - foreach( $this->mptt->descendants() as $p ) + foreach( $this->mptt->children() as $p ) { $p->page->delete(); }
Fixed a bug in the page::delete() method
boomcms_boom-core
train
php
ffa8fc37bfd455054ecc72ca278081d1a505ed9b
diff --git a/svg-android/src/com/applantation/android/svg/SVGParser.java b/svg-android/src/com/applantation/android/svg/SVGParser.java index <HASH>..<HASH> 100644 --- a/svg-android/src/com/applantation/android/svg/SVGParser.java +++ b/svg-android/src/com/applantation/android/svg/SVGParser.java @@ -1560,7 +1560,13 @@ public class SVGParser { if (localName.equals("svg")) { int width = (int) Math.ceil(getFloatAttr("width", atts)); int height = (int) Math.ceil(getFloatAttr("height", atts)); + NumberParse viewbox = getNumberParseAttr("viewBox", atts); canvas = picture.beginRecording(width, height); + if (viewbox != null && viewbox.numbers != null && viewbox.numbers.size() == 4) { + float sx = width / (viewbox.numbers.get(2) - viewbox.numbers.get(0)) ; + float sy = height / (viewbox.numbers.get(3) - viewbox.numbers.get(1)); + canvas.scale(sx, sy); + } } else if (localName.equals("defs")) { inDefsElement = true; } else if (localName.equals("linearGradient")) {
SVG: reenable viewbox scaling (old traffic lights are visible again)
mapsforge_mapsforge
train
java
18ac7b6d343f0d69cb0aae36d760cb319391b93b
diff --git a/src/js/modules/rangy-util.js b/src/js/modules/rangy-util.js index <HASH>..<HASH> 100644 --- a/src/js/modules/rangy-util.js +++ b/src/js/modules/rangy-util.js @@ -69,17 +69,15 @@ rangy.createModule("Util", function(api, module) { */ rangeProto.setStartAndEnd = function() { var args = arguments; + this.setStart(args[0], args[1]); switch (args.length) { case 2: - this.setStart(args[0], args[1]); this.collapse(true); break; case 3: - this.setStart(args[0], args[1]); this.setEnd(args[0], args[2]); break; case 4: - this.setStart(args[0], args[1]); this.setEnd(args[2], args[3]); break; }
Tidied setStartAndEnd() method
timdown_rangy
train
js
ba438410709bbff27d461b7beec88797f74c1b59
diff --git a/src/components/button/component.js b/src/components/button/component.js index <HASH>..<HASH> 100644 --- a/src/components/button/component.js +++ b/src/components/button/component.js @@ -594,6 +594,32 @@ if (Button.isChild()) { awaitPopupBridgeOpener(); + let debounce = false; + let renderTo = Checkout.renderTo; + + Checkout.renderTo = function(win, props) : ?Promise<Object> { + + if (debounce) { + $logger.warn('button_mutliple_click_debounce'); + return; + } + + debounce = true; + + for (let methodName of [ 'onAuthorize', 'onCancel', 'onClose' ]) { + let original = props[methodName]; + props[methodName] = function() : mixed { + debounce = false; + if (original) { + return original.apply(this, arguments); + } + }; + } + + return renderTo.apply(this, arguments); + }; + + if (window.xprops.validate) { let enabled = true; @@ -608,11 +634,11 @@ if (Button.isChild()) { } }); - let renderTo = Checkout.renderTo; + let renderTo2 = Checkout.renderTo; Checkout.renderTo = function() : ?Promise<Object> { if (enabled) { - return renderTo.apply(this, arguments); + return renderTo2.apply(this, arguments); } }; }
Do not allow button clicks while the Checkout component is open
paypal_paypal-checkout-components
train
js
18127d9ab3012d27b38480e3f63d9fb073b9e23f
diff --git a/Siel/Acumulus/OpenCart/Helpers/Registry.php b/Siel/Acumulus/OpenCart/Helpers/Registry.php index <HASH>..<HASH> 100644 --- a/Siel/Acumulus/OpenCart/Helpers/Registry.php +++ b/Siel/Acumulus/OpenCart/Helpers/Registry.php @@ -62,7 +62,7 @@ class Registry * * @param \Registry $registry */ - public function __construct(\Registry $registry) + protected function __construct(\Registry $registry) { $this->registry = $registry; $this->orderModel = null;
Singleton design pattern: make constructor protected.
SIELOnline_libAcumulus
train
php
40d5e9a4fdf620160b4924364c18e34a4f433c1b
diff --git a/salt/states/git.py b/salt/states/git.py index <HASH>..<HASH> 100644 --- a/salt/states/git.py +++ b/salt/states/git.py @@ -627,7 +627,7 @@ def latest(name, elif fast_forward is True: merge_action = 'fast-forwarded' else: - merge_action = None + merge_action = 'updated' if local_branch is None: # No local branch, no upstream tracking branch
Fix test=True reporting when action is dependent on fetch
saltstack_salt
train
py
1f5d26b7d377701187e319c761a13ab25448d503
diff --git a/discord/voice_client.py b/discord/voice_client.py index <HASH>..<HASH> 100644 --- a/discord/voice_client.py +++ b/discord/voice_client.py @@ -482,7 +482,7 @@ class VoiceClient: Parameters ---------- sample_rate : int - Sets the sample rate of the OpusEncoder. + Sets the sample rate of the OpusEncoder. The unit is in Hz. channels : int Sets the number of channels for the OpusEncoder. 2 for stereo, 1 for mono. @@ -528,7 +528,7 @@ class VoiceClient: +---------------------+-----------------------------------------------------+ The stream must have the same sampling rate as the encoder and the same - number of channels. The defaults are 48000 Mhz and 2 channels. You + number of channels. The defaults are 48000 Hz and 2 channels. You could change the encoder options by using :meth:`encoder_options` but this must be called **before** this function.
Unit correction in voice docstrings.
Rapptz_discord.py
train
py
11e1ae7656283babdbbe671b550beb81826887dd
diff --git a/tests/test_suds.py b/tests/test_suds.py index <HASH>..<HASH> 100644 --- a/tests/test_suds.py +++ b/tests/test_suds.py @@ -1948,7 +1948,7 @@ def _assert_dynamic_type(anObject, typename): assert anObject.__class__.__name__ == typename -def _client_from_wsdl(wsdl_content): +def _client_from_wsdl(wsdl_content, *args, **kwargs): """ Constructs a non-caching suds Client based on the given WSDL content. @@ -1973,7 +1973,8 @@ def _client_from_wsdl(wsdl_content): # implementation. testFileId = "whatchamacallit" suds.store.DocumentStore.store[testFileId] = wsdl_content - return suds.client.Client("suds://" + testFileId, cache=None) + kwargs["cache"] = None + return suds.client.Client("suds://" + testFileId, *args, **kwargs) def _construct_SOAP_request(client, operation_name, *args, **kwargs):
Added support for passing additional test client construction parameters.
ovnicraft_suds2
train
py
041f6304effebb6c2c7088005c6dd04ca7c754f4
diff --git a/lib/visitor/compiler.js b/lib/visitor/compiler.js index <HASH>..<HASH> 100644 --- a/lib/visitor/compiler.js +++ b/lib/visitor/compiler.js @@ -479,7 +479,7 @@ Compiler.prototype.compileSelectors = function(arr){ Compiler.prototype.debugInfo = function(node){ - var path = fs.realpathSync(node.filename) + var path = node.filename == 'stdin' ? 'stdin' : fs.realpathSync(node.filename) , line = node.nodes ? node.nodes[0].lineno : node.lineno; if (this.linenos){
Fixed crash when using --line-numbers or --firebug and stdin together This is a fix for issue #<I> which caused stylus to crash when using --line-numbers or firebug and stein at the same time. This was caused by trying to call fs.realpathSync with a bogus file named stdin. <URL>
stylus_stylus
train
js
1de8938d0c7ec469a26a8b36406b2afa36486d60
diff --git a/src/org/jgroups/blocks/RpcDispatcher.java b/src/org/jgroups/blocks/RpcDispatcher.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/blocks/RpcDispatcher.java +++ b/src/org/jgroups/blocks/RpcDispatcher.java @@ -1,4 +1,4 @@ -// $Id: RpcDispatcher.java,v 1.23 2006/06/15 23:39:56 belaban Exp $ +// $Id: RpcDispatcher.java,v 1.24 2006/07/26 11:14:49 belaban Exp $ package org.jgroups.blocks; @@ -89,6 +89,10 @@ public class RpcDispatcher extends MessageDispatcher implements ChannelListener public Object getServerObject() {return server_obj;} + public void setServerObject(Object server_obj) { + this.server_obj=server_obj; + } + public MethodLookup getMethodLookup() { return method_lookup; }
added setter for server_obj (<URL>)
belaban_JGroups
train
java
bcfa8436e84cd3d289660c3b70aa62b1d61a8620
diff --git a/src/geo/leaflet/torque.js b/src/geo/leaflet/torque.js index <HASH>..<HASH> 100644 --- a/src/geo/leaflet/torque.js +++ b/src/geo/leaflet/torque.js @@ -45,6 +45,7 @@ var LeafLetTorqueLayer = L.TorqueLayer.extend({ named_map: layerModel.get('named_map'), auth_token: layerModel.get('auth_token'), no_cdn: layerModel.get('no_cdn'), + dynamic_cdn: layerModel.get('dynamic_cdn'), instanciateCallback: function() { var cartocss = layerModel.get('cartocss') || layerModel.get('tile_style');
added dynamic cdn option for torque
CartoDB_carto.js
train
js
128cdb9112389f18d864dd2cb11bc584a0af55da
diff --git a/tests/test.py b/tests/test.py index <HASH>..<HASH> 100644 --- a/tests/test.py +++ b/tests/test.py @@ -125,7 +125,6 @@ class DockerClientTest(unittest.TestCase): fake_request.assert_called_with('unix://var/run/docker.sock/v1.4/containers/ps', params={ - 'only_ids': 0, 'all': 1, 'since': None, 'limit': -1,
fixed test list_containers to account for upstream changes
docker_docker-py
train
py
30b0ab4a0b4e87153c0b787cc40283fc204b556e
diff --git a/src/components/VSelect/index.js b/src/components/VSelect/index.js index <HASH>..<HASH> 100644 --- a/src/components/VSelect/index.js +++ b/src/components/VSelect/index.js @@ -28,6 +28,8 @@ const wrapper = { } if (props.autocomplete || props.combobox || props.tags) { + data.attrs.combobox = props.combobox + data.attrs.tags = props.tags return h(VAutocomplete, data, children) } else { return h(VSelect, data, children)
fix(VAutocomplete): pass correct props in through the VSelect wrapper
vuetifyjs_vuetify
train
js
4f04f77ac8828bc91e134961840781ff06cc8f4d
diff --git a/lib/toml.rb b/lib/toml.rb index <HASH>..<HASH> 100644 --- a/lib/toml.rb +++ b/lib/toml.rb @@ -1,10 +1,6 @@ $:.unshift(File.dirname(__FILE__)) require 'time' -# lmao unescaping -require 'syck/encoding' -require 'yaml' - require 'parslet' require 'toml/key' @@ -14,7 +10,7 @@ require 'toml/transformer' require 'toml/parser' module TOML - VERSION = '0.0.1' + VERSION = '0.0.2' def self.load(content) Parser.new(content).parsed
Remove yaml/syck
jm_toml
train
rb
f1f19e644afe2f31cc947f1b953329adda5a35bb
diff --git a/tests/unit/components/sl-date-range-picker-test.js b/tests/unit/components/sl-date-range-picker-test.js index <HASH>..<HASH> 100755 --- a/tests/unit/components/sl-date-range-picker-test.js +++ b/tests/unit/components/sl-date-range-picker-test.js @@ -38,7 +38,8 @@ test( 'Change focus to end date input upon start date change', function( assert 'End date input was given focus on start date change' ); - this.$( '.sl-date-picker' ).remove(); + $( '.datepicker' ).remove(); + daterangeEndDate.trigger.restore(); }); test( 'Earliest end date is the based on min date and start date', function( assert ) {
fixed lingering datepicker in sl-date-range-picker test
softlayer_sl-ember-components
train
js
2f2904af6cd859faabb07ee19792e2790de41da4
diff --git a/actor-sdk/sdk-core/runtime/runtime-js/src/main/java/im/actor/runtime/js/websocket/WebSocketConnection.java b/actor-sdk/sdk-core/runtime/runtime-js/src/main/java/im/actor/runtime/js/websocket/WebSocketConnection.java index <HASH>..<HASH> 100644 --- a/actor-sdk/sdk-core/runtime/runtime-js/src/main/java/im/actor/runtime/js/websocket/WebSocketConnection.java +++ b/actor-sdk/sdk-core/runtime/runtime-js/src/main/java/im/actor/runtime/js/websocket/WebSocketConnection.java @@ -115,7 +115,7 @@ public class WebSocketConnection extends AsyncConnection { * @param url */ private native JavaScriptObject createJSWebSocket(final String url, final WebSocketConnection webSocket) /*-{ - var jsWebSocket = new WebSocket(url, ['binary']); + var jsWebSocket = new WebSocket(url); jsWebSocket.binaryType = "arraybuffer" jsWebSocket.onopen = function () {
fix(js): Fixing web socket initialization
actorapp_actor-platform
train
java
58669371e7a2e996fd87b9b5a8d90e55ea401776
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -25,6 +25,24 @@ def relevance(): relevance = db.get_relevance() print repr(relevance) +def upload(): + s = get_session() + acct = Account('admin', s) + resp = acct.create_project('api-create-test-2') + if resp is not None: + print 'error: %s' % resp + return + db = Database('admin/api-create-test-2', 'api-create-test-2', s) + docs = [{'text': 'Examples are a great source of inspiration', + 'title': 'example-1'}, + {'text': 'W3C specifications are habitually in BNF', + 'title': 'example-2'}, + {'text': 'W3C specifications are inscrutible', + 'title': 'example-3'}, + ] + resp = db.upload_documents(docs) + print repr(resp) + if __name__ == '__main__': dbs = main() print repr(dbs)
Implementing a database creation and document upload test
LuminosoInsight_luminoso-api-client-python
train
py
22489634a2da95c16e75b0c80731c0d3975d5f3f
diff --git a/example/app.js b/example/app.js index <HASH>..<HASH> 100644 --- a/example/app.js +++ b/example/app.js @@ -1,7 +1,7 @@ var feathers = require('feathers'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'); -var mongooseService = require('../lib').service; +var mongooseService = require('../lib'); // Require your models var Todo = require('./models/todo');
updating in example how a service is required
feathersjs-ecosystem_feathers-mongoose
train
js
3d4fe11de6c3efdf31a543bea4aed2d496eda975
diff --git a/memcache/memcache.go b/memcache/memcache.go index <HASH>..<HASH> 100644 --- a/memcache/memcache.go +++ b/memcache/memcache.go @@ -527,7 +527,7 @@ func (c *Client) sendConnCommand(cn *conn, key string, cmd command, item *Item, } if kl > 0 { // Key itself - buf.Write(stobs(key)) + buf.WriteString(key) } if _, err = cn.nc.Write(buf.Bytes()); err != nil { return err
Use WriteString() to write the key to the buf
rainycape_memcache
train
go
a8b8300fa50b27b13b343e6f80ed72bf9cc8e421
diff --git a/app/controllers/user_sessions_controller.rb b/app/controllers/user_sessions_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/user_sessions_controller.rb +++ b/app/controllers/user_sessions_controller.rb @@ -68,6 +68,7 @@ class UserSessionsController < ApplicationController # set the current user in the thread-local variable (before notification) User.current = current_user + self.current_organization = User.current.allowed_organizations.first # notice the user notice _("Login Successful") #redirect_to account_url
Made the login page choose the first 'accessible org' as users org
Katello_katello
train
rb
a98adb103ce809443885b4182b072877fe158250
diff --git a/lib/p2ruby/connection.rb b/lib/p2ruby/connection.rb index <HASH>..<HASH> 100644 --- a/lib/p2ruby/connection.rb +++ b/lib/p2ruby/connection.rb @@ -152,8 +152,18 @@ module P2 end # method UI4 Connect2 - # �������� ���������� ���������� ���������� � ��������. ������� � ���������� � ������ Connection#Connect. - # BSTR conn_str [IN] + # �������� ���������� ���������� ���������� � ��������. + # ������� � ���������� � ������ Connection#Connect. + # !!!!!!!!! Can be used for LRPC transport instead of TCP/IP: + # ------------------------------------- + # ����� HRESULT Connect2([in] BSTR connStr, [out,retval] ULONG *errClass). + # � connStr �������� ��������� ��������. + # ��� ����������� ������: *"APPNAME=superRobot;LRPCQ_PORT=4001"*, + # ��� ������ "APPNAME=superRobot;HOST=127.0.0.1;PORT=4001". + # �������� ������ ������ Connect. Properties AppName, Host, Port, Password + # � ����� ������� �� ������������. �������� � ������ 1.10.x + # + # BSTR conn_str [IN] def Connect2(conn_str) @ole._invoke(18, [conn_str], [VT_BSTR]) end
VCL/Privod source files reorganized
arvicco_p2ruby
train
rb
b33f9157c4625a9642803dcf1dfa37807493552e
diff --git a/src/Field/Field.php b/src/Field/Field.php index <HASH>..<HASH> 100644 --- a/src/Field/Field.php +++ b/src/Field/Field.php @@ -63,5 +63,4 @@ class Field extends AbstractField implements TypeInterface return $output; } - }
Applied fixes from StyleCI (#2)
marcmascarell_formality
train
php
df9cb92224e9382f921d85db3949663bf0f8bf6a
diff --git a/lib/middleware.js b/lib/middleware.js index <HASH>..<HASH> 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -113,7 +113,7 @@ module.exports = less.middleware = function(source, options){ render: { compress: 'auto', yuicompress: false, - importPaths: [] + paths: [] }, storeCss: function(pathname, css, req, next) { mkdirp(path.dirname(pathname), 511 /* 0777 */, function(err){
fixed wrongly named default paths key in render options
emberfeather_less.js-middleware
train
js
1ea34481c16cfca84c3cbce8bf80493b18db6d8b
diff --git a/test/fragments/test_putint.rb b/test/fragments/test_putint.rb index <HASH>..<HASH> 100644 --- a/test/fragments/test_putint.rb +++ b/test/fragments/test_putint.rb @@ -5,6 +5,11 @@ class TestPutint < MiniTest::Test def test_putint @string_input = <<HERE +class Integer + int putint() + return 1 + end +end class Object int main() 42.putint()
define putting dummy to fix test
ruby-x_rubyx
train
rb
f0cf1f9373c04a55aade57f19690e47cd755f43d
diff --git a/fuel/converters/cifar100.py b/fuel/converters/cifar100.py index <HASH>..<HASH> 100644 --- a/fuel/converters/cifar100.py +++ b/fuel/converters/cifar100.py @@ -4,7 +4,7 @@ import tarfile import h5py import numpy import six -from six.moves import range, cPickle +from six.moves import cPickle from fuel.converters.base import fill_hdf5_file, check_exists @@ -84,6 +84,7 @@ def convert_cifar100(directory, output_file): def fill_subparser(subparser): """Sets up a subparser to convert the CIFAR100 dataset files. + Parameters ---------- subparser : :class:`argparse.ArgumentParser`
Fixed more PEP8 formatting issues.
mila-iqia_fuel
train
py
48202a6e0b8a97225dfa5f5ed027e5eb5dcb2551
diff --git a/src/ossos/core/ossos/gui/models/workload.py b/src/ossos/core/ossos/gui/models/workload.py index <HASH>..<HASH> 100644 --- a/src/ossos/core/ossos/gui/models/workload.py +++ b/src/ossos/core/ossos/gui/models/workload.py @@ -619,7 +619,7 @@ class WorkUnitProvider(object): version = basenames[basename] version = len(str(version)) > 0 and ".{}".format(version) or version filenames.append("{}{}{}".format(basename, version, self.taskid)) - print basename, basenames[basename], filenames[-1] + # print basename, basenames[basename], filenames[-1] return filenames def select_potential_file(self, potential_files):
Removed unneeded printout of directory listing matches when running track.
OSSOS_MOP
train
py
c7fb61120e1af77841753e19fa0e30fe6df17dd7
diff --git a/_config.php b/_config.php index <HASH>..<HASH> 100644 --- a/_config.php +++ b/_config.php @@ -38,12 +38,6 @@ ShortcodeParser::get('default')->register('embed', array('Oembed', 'handle_short $_ENV['TMPDIR'] = TEMP_FOLDER; // for *nix $_ENV['TMP'] = TEMP_FOLDER; // for Windows -$aggregatecachedir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'aggregate_cache'; -if (!is_dir($aggregatecachedir)) mkdir($aggregatecachedir); - -SS_Cache::add_backend('aggregatestore', 'File', array('cache_dir' => $aggregatecachedir)); -SS_Cache::pick_backend('aggregatestore', 'aggregate', 1000); - SS_Cache::set_cache_lifetime('GDBackend_Manipulations', null, 100); // If you don't want to see deprecation errors for the new APIs, change this to 3.2.0-dev.
Removing redundant aggregatestore cache config (#<I>)
silverstripe_silverstripe-framework
train
php
46401588656f165959d5361466aaef66af6ab9da
diff --git a/autograd/convenience_wrappers.py b/autograd/convenience_wrappers.py index <HASH>..<HASH> 100644 --- a/autograd/convenience_wrappers.py +++ b/autograd/convenience_wrappers.py @@ -1,4 +1,7 @@ """Convenience functions built on top of `grad`.""" +import itertools as it + +import autograd.numpy as np from autograd.core import grad, getval def grad_and_aux(fun, argnum=0):
Added missing imports to convenience_wrappers
HIPS_autograd
train
py
ad38f741abebd81b56a4120a766e0d8f6e22584d
diff --git a/libraries/lithium/tests/cases/data/model/DocumentTest.php b/libraries/lithium/tests/cases/data/model/DocumentTest.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/tests/cases/data/model/DocumentTest.php +++ b/libraries/lithium/tests/cases/data/model/DocumentTest.php @@ -16,9 +16,7 @@ class DocumentPost extends \lithium\data\Model { switch ($type) { case 'first' : { return new Document(array('items' => - array( - array('id' => 2, 'name' => 'Two', 'content' => 'Lorem ipsum two') - ) + array('id' => 2, 'name' => 'Two', 'content' => 'Lorem ipsum two') )); } case 'all': @@ -70,7 +68,7 @@ class DocumentTest extends \lithium\test\Unit { $document = DocumentPost::find('first'); $expected = array('id' => 2, 'name' => 'Two', 'content' => 'Lorem ipsum two'); - $result = $document->current(); + $result = $document->data(); $this->assertEqual($expected, $result); }
fixed items syntax for find('first') to pass all existing tests
UnionOfRAD_framework
train
php
c5ce69466d7381536f87a11946028b1be5390e7f
diff --git a/plugin/init_npm.js b/plugin/init_npm.js index <HASH>..<HASH> 100644 --- a/plugin/init_npm.js +++ b/plugin/init_npm.js @@ -29,12 +29,6 @@ if(canProceed() && !fs.existsSync(npmContainerDir)) { // add new container as a package echo.sync("\nnpm-container", ">>", ".meteor/packages"); - - console.log(); - console.log("-> npm support has been initialized."); - console.log("-> please start your app again."); - console.log(); - process.exit(0); } // check whether is this `meteor test-packages` or not
Removed process.exit call There's no need for the build process to stop after making the npm-container directory. Meteor will automatically restart the build when it detects the addition to .meteor/packages. I've tested that the declared npm modules in package.json are brought in when running `meteor` in development and `meteor build` for production
meteorhacks_npm
train
js
db1d93321efa2f44a756561bd1cefec8ec830a35
diff --git a/lib/query.js b/lib/query.js index <HASH>..<HASH> 100644 --- a/lib/query.js +++ b/lib/query.js @@ -3,7 +3,7 @@ module.exports = function (target) { let fileTypeSet = new Set(['json', 'csv', 'tsv']), fileType = target.substring(target.lastIndexOf('.') + 1).toLowerCase(), - headerline = fileType !== 'json' ? '--headerline' : ''; + headerline = fileType !== 'json' ? '--headerline' : '--jsonArray'; if (!fileTypeSet.has(fileType)) { throw new Error('Invalid file type'); diff --git a/test/specs/querySpec.js b/test/specs/querySpec.js index <HASH>..<HASH> 100644 --- a/test/specs/querySpec.js +++ b/test/specs/querySpec.js @@ -38,6 +38,7 @@ describe('query', function () { returnValue.should.contain(`--collection ${configMock.config.collection}`); returnValue.should.contain('--type json'); returnValue.should.not.contain('--headerline'); + returnValue.should.contain('--jsonArray'); returnValue.should.contain(`--file ${fakeJson}`); }); });
bug/4 Query string for JSON data should be using "--jsonArray" flag ./lib/query.js - when fileType is "json", headerline will be replaced with "--jsonArray" and included in query string ./test/specs/querySpec.js - added test to confirm "--jsonArray" flag is correctly added.
otterthecat_mongonaut
train
js,js
350bbedf5db2a7c1d67f19b99cb3644a4a51fce9
diff --git a/sharpy/client.py b/sharpy/client.py index <HASH>..<HASH> 100644 --- a/sharpy/client.py +++ b/sharpy/client.py @@ -1,6 +1,5 @@ from urllib import urlencode -from elementtree.ElementTree import XML import httplib2 from sharpy.exceptions import CheddarError, AccessDenied, BadRequest, NotFound, PreconditionFailed, CheddarFailure, NaughtyGateway, UnprocessableEntity diff --git a/sharpy/parsers.py b/sharpy/parsers.py index <HASH>..<HASH> 100644 --- a/sharpy/parsers.py +++ b/sharpy/parsers.py @@ -1,4 +1,8 @@ -from elementtree.ElementTree import XML +try: + from lxml.etree import XML +except ImportError: + print "couldn't import LXML" + from elementtree.ElementTree import XML def parse_error(xml_str): error = {}
Added the ability to use lxml if it's available and to fall back to elementtree if lxml is not available.
SeanOC_sharpy
train
py,py
e7813ac74e37f47234f4fcfe032d21a0a180ca23
diff --git a/core/src/main/java/io/fabric8/maven/core/util/ProcessUtil.java b/core/src/main/java/io/fabric8/maven/core/util/ProcessUtil.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/fabric8/maven/core/util/ProcessUtil.java +++ b/core/src/main/java/io/fabric8/maven/core/util/ProcessUtil.java @@ -18,17 +18,17 @@ package io.fabric8.maven.core.util; import io.fabric8.maven.docker.util.Logger; import io.fabric8.utils.Function; import io.fabric8.utils.Strings; -import jdk.nashorn.internal.runtime.regexp.joni.Config; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import static io.fabric8.maven.docker.util.EnvUtil.isWindows; -import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; /** * A helper class for running external processes
removed dodgy imports IDEA added!
fabric8io_fabric8-maven-plugin
train
java
03b4095f9de08af16db9698f15161b5a13a42286
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -653,12 +653,20 @@ def linkcode_resolve(domain, info): try: fn = inspect.getsourcefile(inspect.unwrap(obj)) except TypeError: - fn = None + try: # property + fn = inspect.getsourcefile(inspect.unwrap(obj.fget)) + except (AttributeError, TypeError): + fn = None if not fn: return None try: source, lineno = inspect.getsourcelines(obj) + except TypeError: + try: # property + source, lineno = inspect.getsourcelines(obj.fget) + except (AttributeError, TypeError): + lineno = None except OSError: lineno = None
DOC: add source link to properties (#<I>)
pandas-dev_pandas
train
py
aa697743829d24e72310ab7167ddb3f1540a436e
diff --git a/rails_event_store-rspec/spec/rails_event_store/rspec/be_event_spec.rb b/rails_event_store-rspec/spec/rails_event_store/rspec/be_event_spec.rb index <HASH>..<HASH> 100644 --- a/rails_event_store-rspec/spec/rails_event_store/rspec/be_event_spec.rb +++ b/rails_event_store-rspec/spec/rails_event_store/rspec/be_event_spec.rb @@ -144,6 +144,12 @@ Data diff: specify do expect(FooEvent.new(metadata: { baz: 99 })).not_to matcher(FooEvent).with_metadata({ baz: kind_of(String) }) end + + specify do + expect(FooEvent.new(data: { foo: "bar" }, metadata: { timestamp: Time.now })) + .to(matcher(FooEvent).with_data(foo: "bar") + .and(matcher(FooEvent).with_metadata(timestamp: kind_of(Time)))) + end end end end
Test for mixing and matching built-in and BeEvent matchers.
RailsEventStore_rails_event_store
train
rb
e04a02df069b3f4163f71baf7e23d1c496ae01cd
diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go b/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go index <HASH>..<HASH> 100644 --- a/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go +++ b/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go @@ -2226,7 +2226,11 @@ func (kl *Kubelet) GetKubeletContainerLogs(podFullName, containerName string, lo return fmt.Errorf("unable to get logs for container %q in pod %q namespace %q: unable to find pod", containerName, name, namespace) } - podStatus, found := kl.statusManager.GetPodStatus(pod.UID) + podUID := pod.UID + if mirrorPod, ok := kl.podManager.GetMirrorPodByPod(pod); ok { + podUID = mirrorPod.UID + } + podStatus, found := kl.statusManager.GetPodStatus(podUID) if !found { return fmt.Errorf("failed to get status for pod %q in namespace %q", name, namespace) }
UPSTREAM: <I>: Mirror pods don't show logs
openshift_origin
train
go
03a9a5b018e958ac9ab8ca6a8d8366273b0adad1
diff --git a/src/Readdle/Database/FQDB.php b/src/Readdle/Database/FQDB.php index <HASH>..<HASH> 100644 --- a/src/Readdle/Database/FQDB.php +++ b/src/Readdle/Database/FQDB.php @@ -163,7 +163,7 @@ final class FQDB implements \Serializable * executes REPLACE query with placeholders in 2nd param * @param string $query * @param array $params - * @return string affected rows count + * @return integer affected rows count */ public function replace($query, $params = array()) { @@ -313,7 +313,7 @@ final class FQDB implements \Serializable * @param string $query * @param array $options * @param callable $callback - * @return true + * @return boolean */ public function queryTableCallback($query, $options = [], $callback) { @@ -458,7 +458,7 @@ final class FQDB implements \Serializable * Find WHERE IN statements and converts sqlQueryString and $options * to format needed for WHERE IN statement run * - * @param $sqlQueryString + * @param string $sqlQueryString * @param $options placeholders values * @return array queryString options */ @@ -614,6 +614,9 @@ final class FQDB implements \Serializable } + /** + * @param callable $func + */ private function _callable($func) { if (is_callable($func)) { return $func;
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
readdle_fqdb
train
php
4ee9a160dd0313b4972fcae7a398d3b23a99127e
diff --git a/Godeps/_workspace/src/github.com/tendermint/tendermint/types/node.go b/Godeps/_workspace/src/github.com/tendermint/tendermint/types/node.go index <HASH>..<HASH> 100644 --- a/Godeps/_workspace/src/github.com/tendermint/tendermint/types/node.go +++ b/Godeps/_workspace/src/github.com/tendermint/tendermint/types/node.go @@ -60,7 +60,7 @@ func (ni *NodeInfo) CompatibleWith(no *NodeInfo) error { // nodes must share a common genesis root if !bytes.Equal(ni.Genesis, no.Genesis) { - return fmt.Errorf("Peer has a different genesis root. Got %v, expected %v", no.Genesis, ni.Genesis) + return fmt.Errorf("Peer has a different genesis root. Got %X, expected %X", no.Genesis, ni.Genesis) } return nil
use hex to log bytes
hyperledger_burrow
train
go
a1edeacf6079544beb5f4641414cb63db60431ad
diff --git a/tests/__main__.py b/tests/__main__.py index <HASH>..<HASH> 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -28,6 +28,7 @@ if sys.version_info.minor > 5: from .test_dataloader import * from .test_datadumper import * from .test_dumpload import * + from .test_exceptions import * if sys.version_info.minor >= 7: from .test_dataclass import * if sys.version_info.minor >= 8: @@ -35,7 +36,7 @@ if sys.version_info.minor >= 8: from .test_typeddict import * from .test_legacytuples_dataloader import * from .test_typechecks import * -from .test_exceptions import * + # Run tests for the attr plugin only if it is loaded try:
Run the new test only from python<I> It uses a new syntax and I don't want to use the horrible <I> one. I doubt it will be an issue.
ltworf_typedload
train
py
90c46e896de13064d3c8d5b36e0cbf1a68cccd9b
diff --git a/pkg/chartutil/values.go b/pkg/chartutil/values.go index <HASH>..<HASH> 100644 --- a/pkg/chartutil/values.go +++ b/pkg/chartutil/values.go @@ -94,12 +94,18 @@ func tableLookup(v Values, simple string) (Values, error) { if !ok { return v, ErrNoTable } - //vv, ok := v2.(map[string]interface{}) - vv, ok := v2.(Values) - if !ok { - return vv, ErrNoTable + if vv, ok := v2.(map[string]interface{}); ok { + return vv, nil + } + + // This catches a case where a value is of type Values, but doesn't (for some + // reason) match the map[string]interface{}. This has been observed in the + // wild, and might be a result of a nil map of type Values. + if vv, ok := v2.(Values); ok { + return vv, nil } - return vv, nil + + return map[string]interface{}{}, ErrNoTable } // ReadValues will parse YAML byte data into a Values.
fix(chartutil): fix Table() method to test Values This makes the Table() method more flexible than the original version. It allows either a map[string]interface{} or a chartutil.Values to be treated as a table.
helm_helm
train
go
5fa389014a3ce40534703c8a5731c8a9a955058a
diff --git a/flink-streaming-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBase.java b/flink-streaming-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBase.java index <HASH>..<HASH> 100644 --- a/flink-streaming-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBase.java +++ b/flink-streaming-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBase.java @@ -42,7 +42,7 @@ public abstract class CassandraSinkBase<IN, V> extends RichSinkFunction<IN> { protected transient Cluster cluster; protected transient Session session; - protected transient final AtomicReference<Throwable> exception = new AtomicReference<>(); + protected transient AtomicReference<Throwable> exception; protected transient FutureCallback<V> callback; private final ClusterBuilder builder; @@ -56,6 +56,7 @@ public abstract class CassandraSinkBase<IN, V> extends RichSinkFunction<IN> { @Override public void open(Configuration configuration) { + this.exception = new AtomicReference<>(); this.callback = new FutureCallback<V>() { @Override public void onSuccess(V ignored) {
[hotfix] [cassandra] Fix CassandraSinkBase serialization issue
apache_flink
train
java
a6188ad98eae928bdd93a4f484730b58b125d8f1
diff --git a/lib/application.js b/lib/application.js index <HASH>..<HASH> 100644 --- a/lib/application.js +++ b/lib/application.js @@ -324,6 +324,13 @@ Application.prototype.initialize = function() { */ Application.prototype.routeRequest = function(req, res) { + + // Prevent malformed HTTP Requests + if (req.url[0] != '/') { + res.writeHead(400, {Connection: 'close'}); + res.end(''); + return; + } var urlData = parseUrl(req.url), url = urlData.pathname,
Don't allow invalid HTTP Requests
derdesign_protos
train
js
d06ed98cd87a20145b572124a670a457f92c3dc0
diff --git a/napalm/nxos/nxos.py b/napalm/nxos/nxos.py index <HASH>..<HASH> 100644 --- a/napalm/nxos/nxos.py +++ b/napalm/nxos/nxos.py @@ -800,7 +800,9 @@ class NXOSDriver(NXOSDriverBase): show_version = self._send_command("show version") facts["model"] = show_version.get("chassis_id", "") facts["hostname"] = show_version.get("host_name", "") - facts["os_version"] = show_version.get("sys_ver_str", "") + facts["os_version"] = show_version.get( + "sys_ver_str", show_version.get("rr_sys_ver", "") + ) uptime_days = show_version.get("kern_uptm_days", 0) uptime_hours = show_version.get("kern_uptm_hrs", 0)
#<I> Use new dictionary key to fetch OS version (#<I>) Some Cisco Nexus equipment doesn’t have `sys_ver_str`, but has `rr_sys_ver` instead. Use this as a backup.
napalm-automation_napalm
train
py
200c141737440d55039780f5bd205e1e81bf20fe
diff --git a/datafilters/decorators.py b/datafilters/decorators.py index <HASH>..<HASH> 100644 --- a/datafilters/decorators.py +++ b/datafilters/decorators.py @@ -28,7 +28,7 @@ def filter_powered(filterform_cls, queryset_name='object_list', pass_params=Fals runtime_context=kwargs) # Perform actual filtering - queryset = filterform.filter(queryset) + queryset = filterform.filter(queryset).distinct() if add_count: context[queryset_name + '_count'] = queryset.count()
Add distinct() in filter_powered decorator
freevoid_django-datafilters
train
py
99b5395de2e50f4176327dcb1b64bd102202d73f
diff --git a/src/apps/chart.js b/src/apps/chart.js index <HASH>..<HASH> 100644 --- a/src/apps/chart.js +++ b/src/apps/chart.js @@ -249,7 +249,7 @@ d3plus.apps.chart.draw = function(vars) { else { var text = vars.format(d,vars[axis].key); } - + d3.select(this) .style("font-size",vars.style.ticks.font.size) .style("fill",vars.style.ticks.font.color) @@ -409,7 +409,7 @@ d3plus.apps.chart.draw = function(vars) { vars.graph.offset = 0 yaxis.call(vars.y_axis) .selectAll("line") - .call(tick_style,"x") + .call(tick_style,"y") vars.graph.margin.left += vars.graph.offset vars.graph.width -= vars.graph.offset @@ -451,7 +451,8 @@ d3plus.apps.chart.draw = function(vars) { }) // Update Y Axis - yaxis.call(vars.y_axis) + yaxis.transition().duration(vars.style.timing.transitions) + .call(vars.y_axis.scale(vars.y_scale)) yaxis.selectAll("line").transition().duration(vars.style.timing.transitions) .call(tick_style,"y")
fixed y-axis tick positioning on update
alexandersimoes_d3plus
train
js
b859194e84fcc8147a5dc1acda32ba6e58caee11
diff --git a/src/ORM.js b/src/ORM.js index <HASH>..<HASH> 100644 --- a/src/ORM.js +++ b/src/ORM.js @@ -64,6 +64,10 @@ export class ORM { */ register(...models) { models.forEach((model) => { + if (model.modelName === undefined) { + throw new Error('A model was passed that doesn\'t have a modelName set'); + } + model.invalidateClassCache(); this.registerManyToManyModelsFor(model); diff --git a/src/test/unit/ORM.js b/src/test/unit/ORM.js index <HASH>..<HASH> 100644 --- a/src/test/unit/ORM.js +++ b/src/test/unit/ORM.js @@ -51,6 +51,14 @@ describe('ORM', () => { orm.register(A, B); expect(() => orm.getModelClasses()).toThrowError(/field/); }); + + it('correctly throws an error when a model does not have a modelName property', () => { + class A extends Model {} + const orm = new ORM(); + expect(() => orm.register(A)).toThrowError( + "A model was passed that doesn't have a modelName set" + ); + }); }); describe('simple orm', () => {
Throwing an error when no modelName is set in register (#<I>) Adding tests to expect an error to be thrown
redux-orm_redux-orm
train
js,js
18070b690f42b75432c702e6a2c7eccf8b46c25d
diff --git a/lib/jss/api_connection.rb b/lib/jss/api_connection.rb index <HASH>..<HASH> 100644 --- a/lib/jss/api_connection.rb +++ b/lib/jss/api_connection.rb @@ -269,6 +269,17 @@ module JSS @connected = false end # disconnect + + def raise_conflict_error(exception) + exception.http_body =~ %r{<p>Error:(.*)</p>} + conflict_reason = $1 + if conflict_reason + raise JSS::ConflictError, conflict_reason + else + raise exception + end + end + ### Get an arbitrary JSS resource ### ### The first argument is the resource to get (the part of the API url @@ -309,6 +320,8 @@ module JSS ### send the data @last_http_response = @cnx[rsrc].put(xml, content_type: 'text/xml') + rescue RestClient::Conflict => exception + raise_conflict_error(exception) end ### Create a new JSS resource @@ -327,6 +340,8 @@ module JSS ### send the data @last_http_response = @cnx[rsrc].post xml, content_type: 'text/xml', accept: :json + rescue RestClient::Conflict => exception + raise_conflict_error(exception) end # post_rsrc ### Delete a resource from the JSS
catch <I>Conflict errors and report what caused them in the error message.
PixarAnimationStudios_ruby-jss
train
rb
4c880f590f282f3ebaae4ad730d18e083e9d7b19
diff --git a/client/signup/config/flows-pure.js b/client/signup/config/flows-pure.js index <HASH>..<HASH> 100644 --- a/client/signup/config/flows-pure.js +++ b/client/signup/config/flows-pure.js @@ -259,6 +259,7 @@ export function generateFlows( { description: 'WordPress.com Connect signup flow', lastModified: '2017-08-24', disallowResume: true, // don't allow resume so we don't clear query params when we go back in the history + showRecaptcha: true, }; } @@ -368,6 +369,7 @@ export function generateFlows( { lastModified: '2018-11-14', disallowResume: true, autoContinue: true, + showRecaptcha: true, }; flows[ 'plan-no-domain' ] = {
Add showRecaptch for wpcc and crowdsignal flows (#<I>)
Automattic_wp-calypso
train
js
5f6699ac3d3bd8a8b5d792489908fd917f01feae
diff --git a/cloudmesh/common/util.py b/cloudmesh/common/util.py index <HASH>..<HASH> 100644 --- a/cloudmesh/common/util.py +++ b/cloudmesh/common/util.py @@ -163,14 +163,14 @@ def str_banner(txt=None, c="#", debug=True): :param c: the character used instead of c :type c: character """ - str = "" + line = "" if debug: - str += "\n" - str += "# " + 70 * c + line += "\n" + line += "# " + 70 * c if txt is not None: - str += "# " + txt - str += "# " + 70 * c - return str + line += "# " + txt + line += "# " + 70 * c + return line # noinspection PyPep8Naming
chg:usr: replace str with line to avoid buildin conflict
cloudmesh_cloudmesh-common
train
py
aea9ff89f23f5ff9ad179ea63770462f55dd2515
diff --git a/pypet/tests/integration/merge_test.py b/pypet/tests/integration/merge_test.py index <HASH>..<HASH> 100644 --- a/pypet/tests/integration/merge_test.py +++ b/pypet/tests/integration/merge_test.py @@ -226,15 +226,15 @@ class MergeTest(TrajectoryComparator): self.filenames = [make_temp_dir(os.path.join('experiments', 'tests', 'HDF5', - 'merge2.hdf5')), + 'slow_merge2.hdf5')), make_temp_dir(os.path.join('experiments', 'tests', 'HDF5', - 'merge3.hdf5')), + 'slow_merge3.hdf5')), make_temp_dir(os.path.join('experiments', 'tests', 'HDF5', - 'merge4.hdf5'))] + 'slow_merge4.hdf5'))] self.merge_basic_only_adding_more_trials(True, slow_merge=True) def test_merge_basic_within_same_file_only_adding_more_trials_copy_nodes_test_backup(self):
FIX: fixed test battery to avoid deleting of used files;
SmokinCaterpillar_pypet
train
py
a441418b1d2cf87ada0e4b195361b7120107dd9e
diff --git a/lazyconf/lazyconf.py b/lazyconf/lazyconf.py index <HASH>..<HASH> 100644 --- a/lazyconf/lazyconf.py +++ b/lazyconf/lazyconf.py @@ -172,30 +172,6 @@ class Lazyconf(): print(green('Saved data to file: ' + f)) ### Prompt/Deprompt functions ### - def prompt_db_engine(self, p): - for key, engine in self.db_engines.iteritems(): - if p == engine: - return key - return '' - - def deprompt_db_engine(self, p): - engine = self.db_engines[p] - if len(engine) > 0: - return engine - return None - - def prompt_cache_backend(self, p): - for key, backend in self.cache_backends.iteritems(): - if p == backend: - return key - return '' - - def deprompt_cache_backend(self, p): - engine = self.cache_backends[p] - if len(engine) > 0: - return engine - return None - def prompt_bool(self, p): if p is True: return 'y'
Removed old prompt functions now handled by lists
fmd_lazyconf
train
py
441713897ef5604e8105379f45ebb982ab2c9a75
diff --git a/fixtures/fixtures.go b/fixtures/fixtures.go index <HASH>..<HASH> 100644 --- a/fixtures/fixtures.go +++ b/fixtures/fixtures.go @@ -264,20 +264,34 @@ func (g Fixtures) Exclude(tag string) Fixtures { return r } -type Suite struct{} - -func (s *Suite) SetUpSuite(c *check.C) { +// Init set the correct path to be able to access to the fixtures files +func Init() { RootFolder = filepath.Join( build.Default.GOPATH, "src", "gopkg.in/src-d/go-git.v4", "fixtures", ) } -func (s *Suite) TearDownSuite(c *check.C) { +// Clean cleans all the temporal files created +func Clean() error { for f := range folders { err := os.RemoveAll(f) - c.Assert(err, check.IsNil) + if err != nil { + return err + } delete(folders, f) } + + return nil +} + +type Suite struct{} + +func (s *Suite) SetUpSuite(c *check.C) { + Init() +} + +func (s *Suite) TearDownSuite(c *check.C) { + c.Assert(Clean(), check.IsNil) }
fixtures: initialize fixtures into separated methods (#<I>) To be able to use fixtures with other test frameworks than go-check, we created two methods, one to set fixtures path correctly, and another to remove all the temporal data created when testing.
src-d_go-git
train
go
fd4f7901bbae9bb4d8f42318107109050e9ae331
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -67,11 +67,13 @@ if isWindows or isMac: cmake_build = 'external/lensfun/cmake_build' install_dir = os.path.join(cmake_build, 'install') - include_dirs += ['external/stdint', - os.path.join(install_dir, 'include')] + include_dirs += [os.path.join(install_dir, 'include')] library_dirs += [os.path.join(install_dir, 'lib')] else: use_pkg_config() + +if isWindows: + include_dirs += ['external/stdint'] # this must be after use_pkg_config()! include_dirs += [numpy.get_include()]
don't include stdint header for Mac builds
letmaik_lensfunpy
train
py
9c640847fd95e87255e9ca39b61b449b2ed3675c
diff --git a/lib/cucumber/configuration.rb b/lib/cucumber/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber/configuration.rb +++ b/lib/cucumber/configuration.rb @@ -4,9 +4,17 @@ module Cucumber new end + def initialize(options = {}) + @options = options + end + + def dry_run? + @options[:dry_run] + end + def options - warn("#options is deprecated. Please use the configuration object instead") - {} + warn("#options is deprecated. Please use the configuration object instead. #{caller[1]}") + @options end end end \ No newline at end of file diff --git a/lib/cucumber/step_mother.rb b/lib/cucumber/step_mother.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber/step_mother.rb +++ b/lib/cucumber/step_mother.rb @@ -20,7 +20,7 @@ module Cucumber def initialize(configuration = Configuration.default) @current_scenario = nil - @configuration = configuration + @configuration = parse_configuration(configuration) end def options=(options) @@ -225,5 +225,11 @@ module Cucumber def log Cucumber.logger end + + def parse_configuration(configuration) + return configuration if configuration.is_a?(Configuration) + return Configuration.new(configuration) if configuration.is_a?(Hash) + raise(ArgumentError, "Unknown configuration: #{configuration.inspect}") + end end end
Making specs pass: get StepMother to accept a Hash or a Configuration object in her constructor
cucumber_cucumber-ruby
train
rb,rb
4f2a3d3af3b344fdd40cd0f147d97089dd637dff
diff --git a/src/invoice2data/input/tesseract.py b/src/invoice2data/input/tesseract.py index <HASH>..<HASH> 100644 --- a/src/invoice2data/input/tesseract.py +++ b/src/invoice2data/input/tesseract.py @@ -25,7 +25,7 @@ def to_text(path): raise EnvironmentError('imagemagick not installed.') # convert = "convert -density 350 %s -depth 8 tiff:-" % (path) - convert = ['convert', '-density', '350', path, '-depth', '8', 'png:-'] + convert = ['convert', '-density', '350', path, '-depth', '8', '-alpha', 'off', 'png:-'] p1 = subprocess.Popen(convert, stdout=subprocess.PIPE) tess = ['tesseract', 'stdin', 'stdout']
allow reading of text with background by tesseract (#<I>)
invoice-x_invoice2data
train
py
7e2d6c0043e076f41091cc849d082aee1ccd30b6
diff --git a/src/Symfony/Components/DependencyInjection/BuilderConfiguration.php b/src/Symfony/Components/DependencyInjection/BuilderConfiguration.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Components/DependencyInjection/BuilderConfiguration.php +++ b/src/Symfony/Components/DependencyInjection/BuilderConfiguration.php @@ -158,6 +158,37 @@ class BuilderConfiguration } /** + * Returns true if a service alias exists. + * + * @param string $alias The alias + * + * @return Boolean true if the alias exists, false otherwise + */ + public function hasAlias($alias) + { + return array_key_exists($alias, $this->aliases); + } + + /** + * Gets the service id for a given alias. + * + * @param string $alias The alias + * + * @return string The aliased id + * + * @throws \InvalidArgumentException if the service alias does not exist + */ + public function getAlias($alias) + { + if (!$this->hasAlias($alias)) + { + throw new \InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $alias)); + } + + return $this->aliases[$alias]; + } + + /** * Sets a definition. * * @param string $id The identifier
[DependencyInjection] added some missing accessors
symfony_symfony
train
php
ab5bb2fb3a123c294765d2643d6e738c75ba9639
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -64,7 +64,7 @@ release = '0.0' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = [] +exclude_patterns = ['build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None
Added the build directory to list of exclusion patterns since it's a subdirectory in the Sphinx source directory.
vecnet_vecnet.openmalaria
train
py
777a6a012d5d1a049329b70a8911c67552d7d729
diff --git a/src/functions.php b/src/functions.php index <HASH>..<HASH> 100644 --- a/src/functions.php +++ b/src/functions.php @@ -220,7 +220,7 @@ function unwrap($promises) function all($promises, $recursive = false) { $results = []; - $promise = each( + $promise = \GuzzleHttp\Promise\each( $promises, function ($value, $idx) use (&$results) { $results[$idx] = $value; @@ -268,7 +268,7 @@ function some($count, $promises) $results = []; $rejections = []; - return each( + return \GuzzleHttp\Promise\each( $promises, function ($value, $idx, PromiseInterface $p) use (&$results, $count) { if ($p->getState() !== PromiseInterface::PENDING) { @@ -324,7 +324,7 @@ function settle($promises) { $results = []; - return each( + return \GuzzleHttp\Promise\each( $promises, function ($value, $idx) use (&$results) { $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
help code analysers not confuse each function with the deprecated php global one
guzzle_promises
train
php
7631202155628981a0bb8d0def7167324715ace5
diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -896,10 +896,10 @@ EOF; $this->parser->parse($yaml); + restore_error_handler(); + $this->assertCount(1, $deprecations); $this->assertContains('Using a colon in the unquoted mapping value "bar: baz" in line 1 is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', $deprecations[0]); - - restore_error_handler(); } public function testColonInMappingValueExceptionNotTriggeredByColonInComment()
[Yaml] always restore the error handler in tests The error handler must be restored even when assertions failed.
symfony_symfony
train
php
643b7899ff0bc59eb695fb6402368f6e29107ca3
diff --git a/locales/sw/auth.php b/locales/sw/auth.php index <HASH>..<HASH> 100644 --- a/locales/sw/auth.php +++ b/locales/sw/auth.php @@ -14,5 +14,5 @@ return [ 'failed' => 'Hii hati tambulishi hailingani na rekodi zetu.', 'password' => 'Nenosiri lililotolewa si sahihi.', - 'throttle' => 'Majaribio mengi sana ya kuingia. Tafadhali jaribu tena katika sekunde :sekunde.', + 'throttle' => 'Majaribio mengi sana ya kuingia. Tafadhali jaribu tena katika sekunde :seconds.', ];
Update auth.php I have updated the translation, for the placeholders
caouecs_Laravel-lang
train
php
353a0e728f28c658fd41eab5dd7f820c11a8546b
diff --git a/lib/search-index/index.js b/lib/search-index/index.js index <HASH>..<HASH> 100644 --- a/lib/search-index/index.js +++ b/lib/search-index/index.js @@ -24,7 +24,7 @@ exports.init = function(options) { stats = fs.existsSync(home); // Is it a directory? - if (!stats.isDirectory()) { + if (!stats || !stats.isDirectory()) { fs.mkdirSync(home); }
make sure stats is not falsy
fergiemcdowall_search-index
train
js
54797c584207257ca7bc720ad3fc2c168dd79df9
diff --git a/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-summary.js b/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-summary.js index <HASH>..<HASH> 100644 --- a/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-summary.js +++ b/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-summary.js @@ -39,6 +39,10 @@ export default function WPCheckoutOrderSummary( { const taxLineItem = getTaxLineItem( responseCart ); const totalLineItem = getTotalLineItem( responseCart ); + const hasRenewalInCart = responseCart.products.some( + ( product ) => product.extra.purchaseType === 'renewal' + ); + const isCartUpdating = FormStatus.VALIDATING === formStatus; const plan = responseCart.products.find( ( product ) => isPlan( product ) ); @@ -62,7 +66,7 @@ export default function WPCheckoutOrderSummary( { nextDomainIsFree={ nextDomainIsFree } /> ) } - { ! isCartUpdating && hasMonthlyPlan && ( + { ! isCartUpdating && hasMonthlyPlan && ! hasRenewalInCart && ( <SwitchToAnnualPlan plan={ plan } onChangePlanLength={ onChangePlanLength } /> ) } </CheckoutSummaryFeatures>
Don't show "switch to annual plan" link for monthly renewals (#<I>)
Automattic_wp-calypso
train
js
d8f06ada52a8201369b520ef39d9206442ed256b
diff --git a/src/selectors/index.js b/src/selectors/index.js index <HASH>..<HASH> 100644 --- a/src/selectors/index.js +++ b/src/selectors/index.js @@ -411,7 +411,7 @@ export const getFailedImports = createSelector( const burnHash = get(tx, 'meta.metronome.export.currentBurnHash', null) const wasImportRequested = - activeAddressData.transactions.findIndex( + (activeAddressData.transactions || []).findIndex( transaction => get(transaction, 'meta.metronome.importRequest.burnHash', null) === burnHash
Fix crash when one of enabled chains has no transactions
autonomoussoftware_metronome-wallet-ui-logic
train
js
aecf1d50833e0148347975c9cdc640d7f089fda1
diff --git a/openjscad.js b/openjscad.js index <HASH>..<HASH> 100644 --- a/openjscad.js +++ b/openjscad.js @@ -1055,6 +1055,7 @@ OpenJsCad.Processor.prototype = { { this.worker = OpenJsCad.parseJsCadScriptASync(this.script, paramValues, this.options, function(err, obj) { that.processing = false; + that.worker.terminate(); that.worker = null; if(err) {
terminate unused workers - they make later workers queue in firefox if count ><I>
jscad_csg.js
train
js
a4f07b08141ac79d620187d43997e0ab5c60c379
diff --git a/resources/lang/sq-AL/cachet.php b/resources/lang/sq-AL/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/sq-AL/cachet.php +++ b/resources/lang/sq-AL/cachet.php @@ -117,9 +117,18 @@ return [ ], ], + // Meta descriptions + 'meta' => [ + 'description' => [ + 'incident' => 'Details and updates about the :name incident that occurred on :date', + 'schedule' => 'Details about the scheduled maintenance period :name starting :startDate', + 'subscribe' => 'Subscribe to :app in order to receive updates of incidents and scheduled maintenance periods', + 'overview' => 'Stay up to date with the latest service updates from :app.', + ], + ], + // Other 'home' => 'Home', - 'description' => 'Stay up to date with the latest service updates from :app.', 'powered_by' => 'Powered by <a href="https://cachethq.io" class="links">Cachet</a>.', 'timezone' => 'Times are shown in :timezone.', 'about_this_site' => 'About This Site',
New translations cachet.php (Albanian)
CachetHQ_Cachet
train
php
e793ff895387da1b8c1ad1aa38a99348fae96bcf
diff --git a/tornado/testing.py b/tornado/testing.py index <HASH>..<HASH> 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -656,7 +656,9 @@ def main(**kwargs): This test runner is essentially equivalent to `unittest.main` from the standard library, but adds support for tornado-style option - parsing and log formatting. + parsing and log formatting. It is *not* necessary to use this + `main` function to run tests using `AsyncTestCase`; these tests + are self-contained and can run with any test runner. The easiest way to run a test is via the command line::
testing: Clarify docs of testing.main()
tornadoweb_tornado
train
py
cfc6232d55167f0ff0168fc3261d513c048b3996
diff --git a/ofblockmeshdicthelper/__init__.py b/ofblockmeshdicthelper/__init__.py index <HASH>..<HASH> 100644 --- a/ofblockmeshdicthelper/__init__.py +++ b/ofblockmeshdicthelper/__init__.py @@ -259,7 +259,7 @@ class ArcEdge(object): """ index = ' '.join(str(vertices[vn].index) for vn in self.vnames) vcom = ' '.join(self.vnames) # for comment - return 'arc {0:s} ({1.x:f} {1.y:f} {1.z:f}) '\ + return 'arc {0:s} ({1.x:18.15g} {1.y:18.15g} {1.z:18.15g}) '\ '// {2:s} ({3:s})'.format( index, self.interVertex, self.name, vcom)
Corrected format in ArcEdge. Now the interVertex is written with more accuracy. Otherwise it can give error in planar faces for wedge
takaakiaoki_ofblockmeshdicthelper
train
py
e1796b9e96d3873f8e236d6636286477b57cf925
diff --git a/java/messaging/messaging-common/src/main/java/io/joynr/arbitration/ArbitrationStrategyFunction.java b/java/messaging/messaging-common/src/main/java/io/joynr/arbitration/ArbitrationStrategyFunction.java index <HASH>..<HASH> 100644 --- a/java/messaging/messaging-common/src/main/java/io/joynr/arbitration/ArbitrationStrategyFunction.java +++ b/java/messaging/messaging-common/src/main/java/io/joynr/arbitration/ArbitrationStrategyFunction.java @@ -53,8 +53,8 @@ public abstract class ArbitrationStrategyFunction { * arbitration result. A value of <code>null</code> or an empty collection * are used to indicate that there was no match. */ - abstract Set<DiscoveryEntryWithMetaInfo> select(Map<String, String> parameters, - Collection<DiscoveryEntryWithMetaInfo> capabilities); + protected abstract Set<DiscoveryEntryWithMetaInfo> select(Map<String, String> parameters, + Collection<DiscoveryEntryWithMetaInfo> capabilities); @CheckForNull protected CustomParameter findQosParameter(DiscoveryEntry discoveryEntry, String parameterName) {
[Java] fix abstract class ArbitrationStrategyFunction to allow custom ArbitrationStrategyFunction in packages different from io.joynr.arbitration Change-Id: Ic3d<I>fc<I>a4b2e7c<I>de<I>de
bmwcarit_joynr
train
java
a1fb83a3aae7e8cd093ae8c160cc99a5e73cc1b5
diff --git a/src/ScnSocialAuth/Options/ModuleOptions.php b/src/ScnSocialAuth/Options/ModuleOptions.php index <HASH>..<HASH> 100644 --- a/src/ScnSocialAuth/Options/ModuleOptions.php +++ b/src/ScnSocialAuth/Options/ModuleOptions.php @@ -274,7 +274,7 @@ class ModuleOptions extends AbstractOptions /** * @var boolean */ - protected $debugMode = true; + protected $debugMode = false; /** * @var boolean
#<I> Debug configuration for Hybrid_Auth
SocalNick_ScnSocialAuth
train
php
91cc3cdb7505a95cc1fd574ea83e338a0563ca55
diff --git a/src/Result.php b/src/Result.php index <HASH>..<HASH> 100644 --- a/src/Result.php +++ b/src/Result.php @@ -102,10 +102,13 @@ class Result extends ResultInterface return; } + if ($style === Sql::FETCH_RAW) { + return $data; + } + $row = []; foreach ($data as $key => $val) { - $val = rtrim($val); if ($style === Sql::FETCH_ASSOC) { diff --git a/src/Sql.php b/src/Sql.php index <HASH>..<HASH> 100644 --- a/src/Sql.php +++ b/src/Sql.php @@ -22,6 +22,7 @@ class Sql const FETCH_ROW = 108; # Return rows as an enumerated array (using column numbers) const FETCH_ASSOC = 109; # Return rows as an associative array (using field names) const FETCH_GENERATOR = 110; # Return a generator of the first 1 or 2 columns + const FETCH_RAW = 111; # Return the raw row from the database without performing cleanup protected $connected; # An internal boolean flag to indicate whether we are connected to the server yet protected $options; # An array of all the options this object was created with
Added a new fetch style of raw This is to replace public calls to _fetch() which should be an internal method
duncan3dc_sql-class
train
php,php
898ab57d65473fd8ee14997986e3ce7c505a9da4
diff --git a/backlash/utils.py b/backlash/utils.py index <HASH>..<HASH> 100644 --- a/backlash/utils.py +++ b/backlash/utils.py @@ -21,6 +21,11 @@ def escape(s, quote=False): return s.__html__() if not isinstance(s, (text_type, binary_type)): s = text_type(s) + if isinstance(s, binary_type): + try: + s.decode('ascii') + except: + s = s.decode('utf-8', 'replace') s = s.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;') if quote: s = s.replace('"', "&quot;") @@ -34,4 +39,4 @@ def gen_salt(length): class RequestContext(dict): def __getattr__(self, attr): - return self[attr] \ No newline at end of file + return self[attr]
This should fix issue with utf8 exceptions
TurboGears_backlash
train
py
19e9c26bf5e5441c59d5d57be74c380f28757cdd
diff --git a/cmp/compare.go b/cmp/compare.go index <HASH>..<HASH> 100644 --- a/cmp/compare.go +++ b/cmp/compare.go @@ -491,6 +491,9 @@ func (s *state) compareStruct(vx, vy reflect.Value, t reflect.Type) { step.idx = i step.unexported = !isExported(step.name) if step.unexported { + if step.name == "_" { + continue + } // Defer checking of unexported fields until later to give an // Ignore a chance to ignore the field. if !vax.IsValid() || !vay.IsValid() { diff --git a/cmp/compare_test.go b/cmp/compare_test.go index <HASH>..<HASH> 100644 --- a/cmp/compare_test.go +++ b/cmp/compare_test.go @@ -465,6 +465,10 @@ root[0]["hr"]: root[1]["hr"]: -: int(63) +: float64(63)`, + }, { + label: label, + x: struct{ _ string }{}, + y: struct{ _ string }{}, }} }
Always ignore _ fields (#<I>) The _ field in Go is special in that it cannot be read from or written to. Thus, skip it by default. It is pointless to require the user to use cmpopts.IgnoreUnexported just for the _ field.
google_go-cmp
train
go,go
58816dd24981a78909bf63c821088c5099c2024b
diff --git a/js/plugins.js b/js/plugins.js index <HASH>..<HASH> 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -6,16 +6,15 @@ window.log = function(){ log.history.push(arguments); if(this.console) { arguments.callee = arguments.callee.caller; - if(typeof console.log === 'object'){ - Function.prototype.apply.call(console.log, console, Array.prototype.slice.call(arguments)) - } else { - console.log.apply(console, Array.prototype.slice.call(arguments)); - } + var newarr = [].slice.call(arguments); + (typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr)); } }; + // make it safe to use console.log always (function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try {console.log();return window.console;}catch(err){return window.console={};}})()); // place any jQuery/helper plugins in here, instead of separate, slower script files. +
golf down the size of @kirbysayshi's log() improvement. ref #<I>. I steal log's apply method instead of reaching all the way into Function.prototype.apply.. timesaver and bytesaver. just really ugly. And then a nasty ( omg ? ternary : action); as a statement. But hey.. sometimes you feel like a nut. kirby, plz code review this. :p tested in Chrome <I>.
h5bp_html5-boilerplate
train
js
5afdab4f089decc28bf5a5efaba655e773337857
diff --git a/test/function.combinators.js b/test/function.combinators.js index <HASH>..<HASH> 100644 --- a/test/function.combinators.js +++ b/test/function.combinators.js @@ -53,6 +53,16 @@ $(document).ready(function() { equal(obj.numIsNotPositive(), false, 'should function as a method combinator'); }); + test('splat', function() { + var sumArgs = function () { + return _.reduce(arguments, function (a, b) { return a + b; }, 0); + }; + + var sumArray = _.splat(sumArgs); + + equal(sumArray([1, 2, 3]), 6, 'should return a function that takes array elements as the arguments for the original function'); + }); + test("unsplat", function() { var echo = _.unsplat(function (args) { return args; }), echo2 = _.unsplat(function (first, rest) { return [first, rest]; }),
Added unit test for _.splat
documentcloud_underscore-contrib
train
js
c874e38b38d6597d5da5a957d6a11da8eecf9616
diff --git a/Util/Data.php b/Util/Data.php index <HASH>..<HASH> 100755 --- a/Util/Data.php +++ b/Util/Data.php @@ -125,7 +125,7 @@ class Data $this->milestonesData .= '},'; } - return null; + return rtrim($this->milestonesData, ','); } public function getMilestonesMarkings($campaign){
#CE-<I> put back milestone data
CampaignChain_report-analytics-metrics-per-activity
train
php
5f433585c20f68d429af34abb1b7499fcd9866a3
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 @@ -35,6 +35,8 @@ class Less_Parser{ 'sourceMapWriteTo' => null, 'sourceMapURL' => null, + 'indentation' => ' ', + 'plugins' => array(), );
Added indentation option THis adds the option to set (overrule) the indentation. By default it will indent with 2 spaces. You can now make the output use 4 spaces, or tabs, like: [code]$less = new Less_Parser(array('indentation' => "\t"));[/code]
oyejorge_less.php
train
php
1cbe3de2a2c6e125eb13daf086ac0d968934c09e
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 @@ -14,7 +14,7 @@ def _mk_client(): ''' Create a file client and add it to the context ''' - if not 'cp.fileclient' in __context__: + if 'cp.fileclient' not in __context__: __context__['cp.fileclient'] = \ salt.fileclient.get_file_client(__opts__)
Fix PEP8 E<I> - test for membership should be "not in"
saltstack_salt
train
py