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
ea0811c18e0c8fc9fc30bac6c71179e6b46cb15c
diff --git a/lib/user_stream/version.rb b/lib/user_stream/version.rb index <HASH>..<HASH> 100644 --- a/lib/user_stream/version.rb +++ b/lib/user_stream/version.rb @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- module UserStream - VERSION = "0.1.2" + VERSION = "1.0.0" end
Version bump to <I>.
mitukiii_userstream
train
rb
f8d67df6c8766ea3935667946d329d4c15d2d4c2
diff --git a/channel.go b/channel.go index <HASH>..<HASH> 100644 --- a/channel.go +++ b/channel.go @@ -569,9 +569,9 @@ acknowledgments from the consumers. This option is ignored when consumers are started with noAck. When global is true, these Qos settings apply to all existing and future -consumers on all channels on the same connection. When false, the Qos -settings will apply to all existing -and future consumers on this channel. +consumers on all channels on the same connection. When false, the Qos settings +will apply to all existing and future consumers on this channel. RabbitMQ does +not implement the global flag. To get round-robin behavior between consumers consuming from the same queue on different connections, set the prefetch count to 1, and the next available
Document that RabbitMQ does not support basic.qos#global Closes #<I>
streadway_amqp
train
go
78717146b3e2fdd157f3fa97c16bd386f3987d17
diff --git a/src/widgets/koolphp/Table.tpl.php b/src/widgets/koolphp/Table.tpl.php index <HASH>..<HASH> 100644 --- a/src/widgets/koolphp/Table.tpl.php +++ b/src/widgets/koolphp/Table.tpl.php @@ -78,7 +78,7 @@ <?php $footerValue = ""; $method = strtolower(Utility::get($meta["columns"][$cKey], "footer")); - if( in_array($method, array("sum","avg","min","max","mode")) ) { + if( in_array($method, array("count","sum","avg","min","max","mode")) ) { $footerValue = Table::formatValue($this->dataStore->$method($cKey), $meta["columns"][$cKey]); } $footerText = Utility::get($meta["columns"][$cKey],"footerText");
The footer doesn't show the "count" of a column in view of table widget.
koolphp_koolreport
train
php
2de03c82dd77cc64ee8fa446add3998f80c8fd4b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -22,19 +22,21 @@ module.exports = function(knex, options) { var queries = []; var watchQuery = function(query) { - var start = process.hrtime(); - query.on('end', function() { - var diff = process.hrtime(start); - var ms = diff[0] * 1e3 + diff[1] * 1e-6; - query.duration = ms.toFixed(3); - queries.push(query); - }); + query._startTime = process.hrtime(); + }; + + var recordQuery = function(query) { + var diff = process.hrtime(query._startTime); + var ms = diff[0] * 1e3 + diff[1] * 1e-6; + query.duration = ms.toFixed(3); + queries.push(query); }; var logQuery = colored(function() { res.removeListener('finish', logQuery); res.removeListener('close', logQuery); knex.client.removeListener('query', watchQuery); + knex.client.removeListener('end', recordQuery); queries.forEach(function(query) { var color = chalk.gray; @@ -47,6 +49,7 @@ module.exports = function(knex, options) { }); knex.client.on('query', watchQuery); + knex.client.on('end', recordQuery); res.on('finish', logQuery); res.on('close', logQuery);
More changes related to what could be incorporated into Knex.
wbyoung_knex-logger
train
js
1ce1854ac2ae4868454ca258c6daf2e12c658bbc
diff --git a/spec/ajax/helpers_spec.rb b/spec/ajax/helpers_spec.rb index <HASH>..<HASH> 100644 --- a/spec/ajax/helpers_spec.rb +++ b/spec/ajax/helpers_spec.rb @@ -18,6 +18,7 @@ context 'Ajax::UrlHelpers' do it "should handle special characters" do Ajax.hashed_url_from_traditional('/beyoncé').should == '/#/beyonc%C3%A9' + Ajax.hashed_url_from_traditional('/red hot').should == '/#/red%20hot' end DOMAINS.each do |domain| @@ -35,6 +36,7 @@ context 'Ajax::UrlHelpers' do it "should handle special characters" do Ajax.hashed_url_from_fragment('/#/beyoncé').should == '/#/beyonc%C3%A9' + Ajax.hashed_url_from_fragment('/#/red hot').should == '/#/red%20hot' end it "should handle no fragment" do @@ -102,6 +104,7 @@ context 'Ajax::UrlHelpers' do it "should handle no fragment" do Ajax.traditional_url_from_fragment('/Beyonce#/beyoncé').should == '/beyonc%C3%A9' + Ajax.traditional_url_from_fragment('/#/red hot').should == '/red%20hot' end it "should handle special characters" do
=added more tests to check for spaces
kjvarga_ajax
train
rb
a8315cbad45ae5ac75672fc7a46f5a34b2544d6b
diff --git a/src/sap.ui.core/src/sap/ui/model/odata/v2/ODataListBinding.js b/src/sap.ui.core/src/sap/ui/model/odata/v2/ODataListBinding.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/model/odata/v2/ODataListBinding.js +++ b/src/sap.ui.core/src/sap/ui/model/odata/v2/ODataListBinding.js @@ -68,11 +68,8 @@ sap.ui.define(['jquery.sap.global', 'sap/ui/core/format/DateFormat', 'sap/ui/mod this.bLengthFinal = true; this.bDataAvailable = true; } else { - // call getLength when metadata is already loaded or don't do anything - // if the the metadata gets loaded it will call a refresh on all bindings - if (this.oModel.getServiceMetadata()) { - this.resetData(); - } + //initial reset + this.resetData(); } },
[FIX] v2.ODataListBinding: initial reset error - as metadata is loaded async, the initial reset does not happen, so some internal properties are not initialized correctly. Change-Id: I<I>a2c<I>c<I>bb6aee<I>b<I>e<I>a1bd8affd0b0
SAP_openui5
train
js
b823871d77d79b5d5b8159d615bfcc104c8ea18c
diff --git a/lib/global/base.rb b/lib/global/base.rb index <HASH>..<HASH> 100644 --- a/lib/global/base.rb +++ b/lib/global/base.rb @@ -11,7 +11,7 @@ module Global extend self - attr_writer :environment, :config_directory, :namespace, :except, :only + attr_writer :environment, :config_directory, :namespace, :except, :only, :whitelist_classes def configure yield self @@ -46,6 +46,10 @@ module Global @only ||= [] end + def whitelist_classes + @whitelist_classes ||= [] + end + def generate_js(options = {}) current_namespace = options[:namespace] || namespace @@ -83,7 +87,8 @@ module Global def load_yml_file(file) YAML.safe_load( ERB.new(IO.read(file)).result, - [Date, Time, DateTime, Symbol], [], true + [Date, Time, DateTime, Symbol].concat(whitelist_classes), + [], true ) end
Added whitelist_classes functionality in order to be able to whitelist your own classes
railsware_global
train
rb
b4cac1b090dec02a7ab6f3391d798ad051990c13
diff --git a/test/basic.js b/test/basic.js index <HASH>..<HASH> 100644 --- a/test/basic.js +++ b/test/basic.js @@ -420,6 +420,19 @@ function createDisableSymlinkDereferencingTest (opts) { } } +test('camelCase de-kebab-cases known parameters', (t) => { + let opts = { + 'abc-def': true, + 'electron-version': '1.6.0' + } + common.camelCase(opts, false) + t.equal('1.6.0', opts.electronVersion, 'camelCased known property exists') + t.equal(undefined, opts['electron-version'], 'kebab-cased known property does not exist') + t.equal(undefined, opts.abcDef, 'camelCased unknown property does not exist') + t.equal(true, opts['abc-def'], 'kebab-cased unknown property exists') + t.end() +}) + test('validateListFromOptions does not take non-Array/String values', (t) => { t.notOk(targets.validateListFromOptions({digits: 64}, {'64': true, '65': true}, 'digits') instanceof Array, 'should not be an Array')
Add test for the camelCase function
electron-userland_electron-packager
train
js
7a30966cc7933b043a7480732a459a3a78d0f986
diff --git a/src/Matrix.php b/src/Matrix.php index <HASH>..<HASH> 100644 --- a/src/Matrix.php +++ b/src/Matrix.php @@ -287,11 +287,6 @@ class Matrix implements ArrayAccess throw new MatrixException('Determinants can only be called on square matrices: ' . print_r($this->internal, true)); } - // Base case for a 1 by 1 matrix - if ($this->getRowCount() === 1) { - return $this->get(0, 0); - } - return $this->getLUDecomp()->determinant(); }
Get rid of optimization for an edge case that will almost never happen.
mcordingley_LinearAlgebra
train
php
270f3fc1b134812b643ba5a68c3b2d65893692fa
diff --git a/src/Vimeo/Vimeo.php b/src/Vimeo/Vimeo.php index <HASH>..<HASH> 100644 --- a/src/Vimeo/Vimeo.php +++ b/src/Vimeo/Vimeo.php @@ -393,6 +393,7 @@ class Vimeo $curl_opts[CURLOPT_HTTPHEADER][] = 'Content-Range: bytes ' . $server_at . '-' . $size . '/' . $size; fseek($file, $server_at); // Put the FP at the point where the server is. + $this->_request($url, $curl_opts); //Send what we can. $progress_check = $this->_request($url, $curl_opts_check_progress); // Check on what the server has. // Figure out how much is on the server. @@ -402,11 +403,12 @@ class Vimeo // Complete the upload on the server. $completion = $this->request($ticket['body']['complete_uri'], array(), 'DELETE'); - + // Validate that we got back 201 Created $status = (int) $completion['status']; if ($status != 201) { - throw new VimeoUploadException('Error completing the upload.'); + $error = !empty($completion['body']['error']) ? '[' . $completion['body']['error'] . ']' : ''; + throw new VimeoUploadException('Error completing the upload.'. $error); } // Furnish the location for the new clip in the API via the Location header.
Reinstate upload request. Append error message to VimeoUploadException.
vimeo_vimeo.php
train
php
fafaa9ae32e8cb11f08a736b1555fdc351c3ca48
diff --git a/lib/fleetctl/command.rb b/lib/fleetctl/command.rb index <HASH>..<HASH> 100644 --- a/lib/fleetctl/command.rb +++ b/lib/fleetctl/command.rb @@ -27,7 +27,7 @@ module Fleet def prefix # TODO: figure out a better way to avoid auth issues - "eval `ssh-agent -s`; ssh-add >/dev/null 2>&1;" + "eval `ssh-agent -s` >/dev/null 2>&1; ssh-add >/dev/null 2>&1;" end def global_options diff --git a/lib/fleetctl/version.rb b/lib/fleetctl/version.rb index <HASH>..<HASH> 100644 --- a/lib/fleetctl/version.rb +++ b/lib/fleetctl/version.rb @@ -1,3 +1,3 @@ module Fleetctl - VERSION = "0.0.2" + VERSION = "0.0.3" end
piped stdout and stderr of running ssh-agent to /dev/null
cloudspace_ruby-fleetctl
train
rb,rb
b6b81ccce1cc51bdb8a4c288ac7c227f1f7e51a7
diff --git a/umis/umis.py b/umis/umis.py index <HASH>..<HASH> 100644 --- a/umis/umis.py +++ b/umis/umis.py @@ -125,9 +125,11 @@ def transformer(chunk, read1_regex, read2_regex, paired): @click.option('--minevidence', required=False, default=1.0, type=float) @click.option('--cb_histogram', default=None) @click.option('--cb_cutoff', default=0) +@click.option('--cb_cutoff', default=0) +@click.option('--no_scale_evidence', default=False, is_flag=True) # @profile def tagcount(sam, out, genemap, output_evidence_table, positional, minevidence, - cb_histogram, cb_cutoff): + cb_histogram, cb_cutoff, no_scale_evidence): ''' Count up evidence for tagged molecules ''' from pysam import AlignmentFile @@ -191,7 +193,10 @@ def tagcount(sam, out, genemap, output_evidence_table, positional, minevidence, e_tuple = tuple_template.format(CB, target_name, aln.pos, MB) # Scale evidence by number of hits - evidence[e_tuple] += weigh_evidence(aln.tags) + if no_scale_evidence: + evidence[e_tuple] += 1.0 + else: + evidence[e_tuple] += weigh_evidence(aln.tags) kept += 1 tally_time = time.time() - start_tally
Add option to turn off scaling of evidence with number of hits.
vals_umis
train
py
ac5ac5f8ada90e3b41b998bd715497be4109b3ab
diff --git a/kconfiglib.py b/kconfiglib.py index <HASH>..<HASH> 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -6343,11 +6343,11 @@ _REL_TO_STR = { GREATER_EQUAL: ">=", } -_INIT_SRCTREE_NOTE = """ +_INIT_SRCTREE_NOTE = """\ NOTE: Starting with Kconfiglib 10.0.0, the Kconfig filename passed to Kconfig.__init__() is looked up relative to $srctree (which is set to '{}') instead of relative to the working directory. Previously, $srctree only applied to files being source'd within Kconfig files. This change makes running scripts out-of-tree work seamlessly, with no special coding required. Sorry for the backwards compatibility break! -"""[1:] +"""
Simplify _INIT_SRCTREE_NOTE definition
ulfalizer_Kconfiglib
train
py
f209e312e22cac647e5029d87dbbd437e91456d1
diff --git a/schedula/utils/base.py b/schedula/utils/base.py index <HASH>..<HASH> 100644 --- a/schedula/utils/base.py +++ b/schedula/utils/base.py @@ -70,7 +70,7 @@ class Base(object): format=NONE, engine=NONE, encoding=NONE, graph_attr=NONE, node_attr=NONE, edge_attr=NONE, body=NONE, node_styles=NONE, node_data=NONE, node_function=NONE, edge_data=NONE, max_lines=NONE, - max_width=NONE, directory=None, sites=None): + max_width=NONE, directory=None, sites=None, index=False): """ Plots the Dispatcher with a graph in the DOT language with Graphviz. @@ -211,9 +211,9 @@ class Base(object): if view: directory = directory or tempfile.mkdtemp() if sites is None: - sitemap.render(directory=directory, view=True) + sitemap.render(directory=directory, view=True, index=index) else: - sites.add(sitemap.site(root_path=directory, view=True)) + sites.add(sitemap.site(directory, view=True, index=index)) return sitemap def get_node(self, *node_ids, node_attr=NONE):
feat(base): Add index option to plot.
vinci1it2000_schedula
train
py
6392e765ac85e42f370ac51f659f694bcfe9336d
diff --git a/client/request.go b/client/request.go index <HASH>..<HASH> 100644 --- a/client/request.go +++ b/client/request.go @@ -50,15 +50,6 @@ func (cli *Client) postRaw(ctx context.Context, path string, query url.Values, b return cli.sendRequest(ctx, "POST", path, query, body, headers) } -// put sends an http request to the docker API using the method PUT. -func (cli *Client) put(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (serverResponse, error) { - body, headers, err := encodeBody(obj, headers) - if err != nil { - return serverResponse{}, err - } - return cli.sendRequest(ctx, "PUT", path, query, body, headers) -} - // putRaw sends an http request to the docker API using the method PUT. func (cli *Client) putRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (serverResponse, error) { return cli.sendRequest(ctx, "PUT", path, query, body, headers)
client: remove put() Apparently it is not used anywhere
moby_moby
train
go
28aca474d48b6acdbe8c7861d9347e27c65fafd9
diff --git a/actionpack/lib/action_dispatch/middleware/debug_view.rb b/actionpack/lib/action_dispatch/middleware/debug_view.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_view.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_view.rb @@ -58,11 +58,9 @@ module ActionDispatch end def params_valid? - begin - @request.parameters - rescue ActionController::BadRequest - false - end + @request.parameters + rescue ActionController::BadRequest + false end end end
Auto-correct `Style/RedundantBegin` offence This offenced code is introduced from forward ported #<I>, since looks like 6-0-stable branch isn't checked by CodeClimate.
rails_rails
train
rb
410534173841fcb3e43bab8be86a7f266a72be51
diff --git a/domain.go b/domain.go index <HASH>..<HASH> 100644 --- a/domain.go +++ b/domain.go @@ -16,7 +16,6 @@ func UpdateRoutes(newRoutes []Route) { // if im given a page for the route // do not populate the proxies. dom.Page = []byte(route.Page) - continue } for _, url := range route.URLs { prox := &Proxy{URL: url}
remove a typo that caused the system to ignore anything that had a page in it
nanobox-io_nanobox-router
train
go
9a6efe66de16275f4990a57eed1230575ed77f13
diff --git a/src/EventsClient.js b/src/EventsClient.js index <HASH>..<HASH> 100644 --- a/src/EventsClient.js +++ b/src/EventsClient.js @@ -4,7 +4,7 @@ import debug from './debug'; export default class EventsClient { SEND_INTERVAL = 5; QUEUE_SIZE = 10000; - clientVersion = 'NodeJsClient/0.6.5'; + clientVersion = 'NodeJsClient/0.6.6'; queue = []; overLimit = false; @@ -50,7 +50,6 @@ export default class EventsClient { } sendQueue() { - console.log('Sent ' + this.queue.length ); if(this.queue.length === 0) return; let sendQueue = this.queue; this.queue = []; diff --git a/src/PollingClient.js b/src/PollingClient.js index <HASH>..<HASH> 100644 --- a/src/PollingClient.js +++ b/src/PollingClient.js @@ -4,7 +4,7 @@ import debug from './debug'; export default class PollingClient{ DEFAULT_TIMEOUT = 5 * 1000; DEFAULT_INTERVAL = 10 * 1000; - clientVersion = 'NodeJsClient/0.6.5'; + clientVersion = 'NodeJsClient/0.6.6'; constructor(url, config, callback){ this.url = url;
<I> Removed Verbose Log
featureflow_featureflow-node-sdk
train
js,js
19cd5f76c0d3918e5f46544585c78262816e7412
diff --git a/tests/utils/itutils.go b/tests/utils/itutils.go index <HASH>..<HASH> 100644 --- a/tests/utils/itutils.go +++ b/tests/utils/itutils.go @@ -90,7 +90,7 @@ func doCurl(url string) ([]byte, error) { defer response.Body.Close() body, err := ioutil.ReadAll(response.Body) - if !strings.Contains(string(body), "Powered by Deis") { + if !strings.Contains(string(body), "Powered by") { return nil, fmt.Errorf("App not started (%d)\nBody: (%s)", response.StatusCode, string(body)) }
fix(tests): check for immovable response "Deis" in "Powered by Deis" is configured by an environment variable called $POWERED_BY. We should not be checking for Deis, as it can be defined as something else.
deis_deis
train
go
0cf678e9cdfe69dc37c6ef13eac9c6574c74919b
diff --git a/src/main/java/org/organicdesign/fp/collections/RrbTree.java b/src/main/java/org/organicdesign/fp/collections/RrbTree.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/organicdesign/fp/collections/RrbTree.java +++ b/src/main/java/org/organicdesign/fp/collections/RrbTree.java @@ -973,7 +973,7 @@ involves changing more nodes than maybe necessary. private static final int HALF_STRICT_NODE_LENGTH = STRICT_NODE_LENGTH >> 1; - // (MIN_NODE_LENGTH + MAX_NODE_LENGTH) / 2 should equal STRICT_NODE_LENGTH so that they have the + // (MIN_NODE_LENGTH + MAX_NODE_LENGTH) / 2 should equal STRICT_NODE_LENGTH so that they have roughly the // same average node size to make the index interpolation easier. private static final int MIN_NODE_LENGTH = (STRICT_NODE_LENGTH+1) * 2 / 3; // Always check if less-than this. Never if less-than-or-equal. Cormen adds a -1 here and tests
Fixed comment for issue #<I>
GlenKPeterson_Paguro
train
java
d4211ba22551f16792640ffafe23e257db43776e
diff --git a/packages/dna-core/src/lib/proxy.js b/packages/dna-core/src/lib/proxy.js index <HASH>..<HASH> 100644 --- a/packages/dna-core/src/lib/proxy.js +++ b/packages/dna-core/src/lib/proxy.js @@ -50,13 +50,11 @@ function proxyProto(proto, proxy) { } export function proxy(Component) { - if (!(Component.prototype instanceof HTMLElement)) { - Component.prototype = Object.create( - Component.prototype, - reduce(DOM_PROXY, (prototype, proxy) => - proxyProto(prototype, proxy), {} - ) - ); - } + Component.prototype = Object.create( + Component.prototype, + reduce(DOM_PROXY, (prototype, proxy) => + proxyProto(prototype, proxy), {} + ) + ); return Component; }
refactor: remove prototype control in proxy method
chialab_dna
train
js
c7f3906d03c606b0d5f04b545128b0994ef49a49
diff --git a/Geometry/point.py b/Geometry/point.py index <HASH>..<HASH> 100644 --- a/Geometry/point.py +++ b/Geometry/point.py @@ -190,13 +190,13 @@ class Point(object): origin = cls(origin) - t = 2.0 * math.pi * random.random() + t = (2.0 * math.pi) * random.random() r = random.random() * random.random() if r > 1: r = 2 - r - x = int(radius * r * math.cos(t) + origin.x) - y = int(radius * r * math.sin(t) + origin.y) + x = int(((radius * r) * math.cos(t)) + origin.x) + y = int(((radius * r) * math.sin(t)) + origin.y) return cls(x,y)
randomLocation sometimes misses the mark for origins != (0,0)
JnyJny_Geometry
train
py
1d2f65f0f0fb642c335de089c2594100df1b1034
diff --git a/resource/meta.go b/resource/meta.go index <HASH>..<HASH> 100644 --- a/resource/meta.go +++ b/resource/meta.go @@ -370,10 +370,9 @@ func setupSetter(meta *Meta, fieldName string, record interface{}) { foreignVersionField := indirectValue.FieldByName(foreignVersionName) oldPrimaryKeys := utils.ToArray(foreignKeyField.Interface()) - // If field struct has version - // ManagerID convert to ManagerVersionName. and get field value of it. - // then construct ID+VersionName and compare with primarykey - if fieldHasVersion && len(oldPrimaryKeys) != 0 { + // If field struct has version and it defined XXVersionName foreignKey field + // then construct ID+VersionName and compare with composite primarykey + if fieldHasVersion && len(oldPrimaryKeys) != 0 && foreignVersionField.IsValid() { oldPrimaryKeys[0] = GenCompositePrimaryKey(oldPrimaryKeys[0], foreignVersionField.String()) }
Check foreignVersionField presence before construct composite old primaryKey. So it can work properly for other types of multiple foreign keys.
qor_qor
train
go
5f26d403f3f595bb0cbf0462b317d1648491e5ff
diff --git a/lib/bolt/apply_result.rb b/lib/bolt/apply_result.rb index <HASH>..<HASH> 100644 --- a/lib/bolt/apply_result.rb +++ b/lib/bolt/apply_result.rb @@ -57,7 +57,7 @@ module Bolt msg = "Report result contains an '_output' key. Catalog application may have printed extraneous output to stdout: #{result['_output']}" # rubocop:enable Layout/LineLength else - msg = "Report did not contain all expected keys missing: #{missing_keys.join(' ,')}" + msg = "Report did not contain all expected keys missing: #{missing_keys.join(', ')}" end { 'msg' => msg,
(maint) Fix formatting for missing keys in apply report This commit updates the missing keys error for an ApplyResult to format the list of missing keys with the correct separator. !no-release-note
puppetlabs_bolt
train
rb
ac3d81c764cbee1b75ca7f3423293a24bb0f9216
diff --git a/nl/reminders.php b/nl/reminders.php index <HASH>..<HASH> 100644 --- a/nl/reminders.php +++ b/nl/reminders.php @@ -21,6 +21,6 @@ return array( "sent" => "Wachtwoord herinnering verzonden!", - "reset" => "Password has been reset!", + "reset" => "Wachtwoord is veranderd!", );
Update reminders.php Added missing translation
caouecs_Laravel-lang
train
php
4c505ad4cc3eb616503c2ab3d5f11e07949072bb
diff --git a/lib/fake_web/registry.rb b/lib/fake_web/registry.rb index <HASH>..<HASH> 100644 --- a/lib/fake_web/registry.rb +++ b/lib/fake_web/registry.rb @@ -17,7 +17,7 @@ module FakeWeb def register_uri(method, uri, options) case uri - when String + when URI, String uri_map[normalize_uri(uri)][method] = [*[options]].flatten.collect do |option| FakeWeb::Responder.new(method, uri, option, option[:times]) end
Fix that registration should still support URIs (caught by tests added in a<I>f<I>e<I>df<I>b3ebf9a<I>ca<I>af<I>f<I>)
chrisk_fakeweb
train
rb
ab7e53fb6f0c7f5b08bc1d1cbf745311971b185c
diff --git a/code/UserDefinedForm.php b/code/UserDefinedForm.php index <HASH>..<HASH> 100755 --- a/code/UserDefinedForm.php +++ b/code/UserDefinedForm.php @@ -407,7 +407,7 @@ class UserDefinedForm_Controller extends Page_Controller { // set the values passed by the url to the field $request = $this->getRequest(); - $value = $request->getVar($field->name); + $value = Convert::raw2att($request->getVar($field->name)); if(isset($value)) $field->value = $value; $fields->push($field);
MINOR - Added escaping for values passed by url params
silverstripe_silverstripe-userforms
train
php
94f8582a67b04d21d281592f175d8173885db506
diff --git a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java +++ b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java @@ -302,6 +302,7 @@ final class S3ProxyHandler extends AbstractHandler { "Conflict"); return; } + response.setStatus(HttpServletResponse.SC_NO_CONTENT); } private void handleBlobList(HttpServletRequest request,
Emit HTTP <I> on successful bucket delete Found with Ceph s3-tests. References #5.
gaul_s3proxy
train
java
1b21ff2525472ecc96f6f114c700e4c8b3783c59
diff --git a/tests/acceptance/seller/ServerCest.php b/tests/acceptance/seller/ServerCest.php index <HASH>..<HASH> 100644 --- a/tests/acceptance/seller/ServerCest.php +++ b/tests/acceptance/seller/ServerCest.php @@ -38,18 +38,12 @@ class ServerCest Input::asAdvancedSearch($I, 'Name'), Input::asAdvancedSearch($I, 'Internal note'), Input::asAdvancedSearch($I, 'Order'), - Input::asAdvancedSearch($I, 'DC'), Input::asAdvancedSearch($I, 'IP'), Select2::asAdvancedSearch($I, 'Client'), Select2::asAdvancedSearch($I, 'Reseller'), Input::asAdvancedSearch($I, 'HW summary'), Select2::asAdvancedSearch($I, 'Type'), Select2::asAdvancedSearch($I, 'Status'), - Input::asAdvancedSearch($I, 'Switch'), - Input::asAdvancedSearch($I, 'KVM'), - Input::asAdvancedSearch($I, 'APC'), - Input::asAdvancedSearch($I, 'Rack'), - Input::asAdvancedSearch($I, 'MAC'), Input::asAdvancedSearch($I, 'Tariff'), Dropdown::asAdvancedSearch($I, 'Is wizzarded'), ]);
Updated seller/ServerCest according to the current access control
hiqdev_hipanel-module-server
train
php
29eb3b75671b4a47b981fa082598ed1143dcaecc
diff --git a/src/UuidBinaryOrderedTimeType.php b/src/UuidBinaryOrderedTimeType.php index <HASH>..<HASH> 100644 --- a/src/UuidBinaryOrderedTimeType.php +++ b/src/UuidBinaryOrderedTimeType.php @@ -22,7 +22,7 @@ class UuidBinaryOrderedTimeType extends Type * @var string */ const NAME = 'uuid_binary_ordered_time'; - + /** * @var string */ @@ -133,7 +133,7 @@ class UuidBinaryOrderedTimeType extends Type * * @return null|UuidFactory */ - private function getUuidFactory() + protected function getUuidFactory() { if (null === $this->factory) { $this->factory = new UuidFactory(); @@ -142,7 +142,7 @@ class UuidBinaryOrderedTimeType extends Type return $this->factory; } - private function getCodec() + protected function getCodec() { if (null === $this->codec) { $this->codec = new OrderedTimeCodec(
getUuidFactory and getCodec as protected methods
ramsey_uuid-doctrine
train
php
b67ce987e34d8a5010c745022f24e889b8872187
diff --git a/lib/arjdbc/mssql/limit_helpers.rb b/lib/arjdbc/mssql/limit_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/mssql/limit_helpers.rb +++ b/lib/arjdbc/mssql/limit_helpers.rb @@ -12,6 +12,14 @@ module ::ArJdbc end end + def get_primary_key(sql) + if sql =~ /.*\.(.*)/i + $1 + else + 'id' + end + end + module SqlServer2000ReplaceLimitOffset module_function def replace_limit_offset!(sql, limit, offset, order) @@ -31,7 +39,7 @@ module ::ArJdbc rest = rest_of_query[/FROM/i=~ rest_of_query.. -1] #need the table name for avoiding amiguity table_name = LimitHelpers.get_table_name(sql) - primary_key = order[/(\w*id\w*)/i] || "id" + primary_key = LimitHelpers.get_primary_key(order) #I am not sure this will cover all bases. but all the tests pass if order[/ORDER/].nil? new_order = "ORDER BY #{order}, #{table_name}.#{primary_key}" if order.index("#{table_name}.#{primary_key}").nil?
add get primary key helper get non-standard primary keys get failing test to pass
jruby_activerecord-jdbc-adapter
train
rb
84867db0e9a12a4b4ba9f621848c6d6693dd09e9
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,5 +33,9 @@ RSpec.configure do |config| end ActiveRecordObject.reset DatamapperObject.reset + + XapianDb.setup do |config| + config.adapter :generic + end end end
set generic adapter as default for specs
gernotkogler_xapian_db
train
rb
ca8daa1bd37cc447c9d2e7bc7ae0dd35d3ad88f2
diff --git a/astrobase/checkplotlist.py b/astrobase/checkplotlist.py index <HASH>..<HASH> 100644 --- a/astrobase/checkplotlist.py +++ b/astrobase/checkplotlist.py @@ -102,6 +102,9 @@ def main(args=None): sys.exit(2) checkplotbasedir = args[2] + + print('arglen = %s' % len(args)) + if len(args) == 4: fileglob = args[3] else:
added file glob option to checkplotlist
waqasbhatti_astrobase
train
py
e80c00fc67da6e0ca96642b86789a82f96368bbe
diff --git a/library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java b/library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java +++ b/library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java @@ -595,13 +595,13 @@ public class DownloadLaunchRunnable implements Runnable, ProcessCallback { } private void realDownloadWithMultiConnectionFromResume(final int connectionCount, - final List<ConnectionModel> connectionModelList) + List<ConnectionModel> modelList) throws InterruptedException { - if (connectionCount <= 1 || connectionModelList.size() != connectionCount) { + if (connectionCount <= 1 || modelList.size() != connectionCount) { throw new IllegalArgumentException(); } - fetchWithMultipleConnection(connectionModelList, model.getTotal()); + fetchWithMultipleConnection(modelList, model.getTotal()); } private void realDownloadWithMultiConnectionFromBeginning(final long totalLength,
chore: fix stylecheck failed on download-launch-runnable
lingochamp_FileDownloader
train
java
9186d97586379d254870043d0a670bc22cb2b477
diff --git a/compiler/quilt/tools/command.py b/compiler/quilt/tools/command.py index <HASH>..<HASH> 100644 --- a/compiler/quilt/tools/command.py +++ b/compiler/quilt/tools/command.py @@ -1330,7 +1330,11 @@ def load(pkginfo, hash=None): """ functional interface to "from quilt.data.USER import PKG" """ - return _load(pkginfo, hash)[0] + node, pkgroot, info = _load(pkginfo, hash) + for subnode_name in info.subpath: + node = node[subnode_name] + + return node def export(package, output_path='.', force=False, symlinks=False): """Export package file data.
Allow subpath loads by using `PackageInfo.subpath` to traverse the tree (#<I>)
quiltdata_quilt
train
py
3b83bb450ecc71d7bbe98811705bdc25d3d23c27
diff --git a/lib/middleware.js b/lib/middleware.js index <HASH>..<HASH> 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -40,7 +40,9 @@ var middleware = function (logging){ yield next; } catch (e) { - logging.error({"message": e}); + if (!e.status || e.status.toString().match(/^5\d\d$/)) { + logging.error({"message": e}); + } throw e; } logging.perform({
now if error.status is set and errror.status is not 5xx, do not print the error log since it is a simple NOT FOUND error
larkjs_lark-log
train
js
882d91c1b7e3e6580424c670a7a167ee2fb71651
diff --git a/lib/fog/hp/models/network/network.rb b/lib/fog/hp/models/network/network.rb index <HASH>..<HASH> 100644 --- a/lib/fog/hp/models/network/network.rb +++ b/lib/fog/hp/models/network/network.rb @@ -21,6 +21,10 @@ module Fog true end + def ready? + self.status == 'ACTIVE' + end + def save identity ? update : create end
[hp|network] Add a ready? method to the network model.
fog_fog
train
rb
a9d62327050f13ec0da165c55bf092fcbf64107c
diff --git a/Parsedown.php b/Parsedown.php index <HASH>..<HASH> 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -432,7 +432,7 @@ class Parsedown } } - # li + # li if ($deindented_line[0] <= '9' and $deindented_line >= '0' and preg_match('/^([ ]*)\d+[.][ ](.*)/', $line, $matches)) { @@ -483,7 +483,7 @@ class Parsedown $elements []= $element; - array_shift($elements); + unset($elements[0]); # # ~ @@ -491,7 +491,7 @@ class Parsedown $markup = ''; - foreach ($elements as $index => $element) + foreach ($elements as $element) { switch ($element['type']) { @@ -501,7 +501,7 @@ class Parsedown $text = preg_replace('/[ ]{2}\n/', '<br />'."\n", $text); - if ($context === 'li' and $index === 0) + if ($context === 'li' and $markup === '') { if (isset($element['interrupted'])) {
array_shift » unset to simplify code base and improve performance
erusev_parsedown
train
php
2af95e5c2ce3117072c685d3fc1f5f2d4f5fbd58
diff --git a/src/sortable.js b/src/sortable.js index <HASH>..<HASH> 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -324,7 +324,7 @@ angular.module('ui.sortable', []) // the value will be overwritten with the old value if(!ui.item.sortable.received) { ui.item.sortable.dropindex = getItemIndex(ui.item); - var droptarget = ui.item.closest('[ui-sortable]'); + var droptarget = ui.item.closest('[ui-sortable], [data-ui-sortable], [x-ui-sortable]'); ui.item.sortable.droptarget = droptarget; ui.item.sortable.droptargetList = ui.item.parent();
fix(sortable): restore support for data-ui-sortable declaration
angular-ui_ui-sortable
train
js
97936fb37157570f0d3b16829142471b07d7ec81
diff --git a/serenata_toolbox/chamber_of_deputies/reimbursements_cleaner.py b/serenata_toolbox/chamber_of_deputies/reimbursements_cleaner.py index <HASH>..<HASH> 100644 --- a/serenata_toolbox/chamber_of_deputies/reimbursements_cleaner.py +++ b/serenata_toolbox/chamber_of_deputies/reimbursements_cleaner.py @@ -130,8 +130,8 @@ class ReimbursementsCleaner: def aggregate_multiple_payments(self): self.data = pd.concat([ self._house_payments(), - self._non_house_payments(), - ]) + self._non_house_payments() + ], sort=False) def save(self): file_path = os.path.join(self.path, f'reimbursements-{self.year}.csv')
Add sort argument to Pandas concat Following a warning regarding new behavior: In a future version of pandas pandas.concat() will no longer sort the non-concatenation axis when it is not already aligned.
okfn-brasil_serenata-toolbox
train
py
20de21df07131276d56c145ddf1662abd8a476ad
diff --git a/tests/jenkins.py b/tests/jenkins.py index <HASH>..<HASH> 100644 --- a/tests/jenkins.py +++ b/tests/jenkins.py @@ -44,7 +44,7 @@ def run(platform, provider, commit, clean): htag = hashlib.md5(str(random.randint(1, 100000000))).hexdigest()[:6] vm_name = 'ZZZ-{0}-{1}'.format(platform, htag) cmd = ('salt-cloud -l debug --script-args "-D -n git {0}" ' - '--start-action "-t 1800 state.sls testrun ' + '--start-action "state.sls testrun ' 'pillar=\'{{git_commit: {0}}}\' --no-color" -p {1}_{2} {3}'.format( commit, provider, platform, vm_name) )
`salt-call` does not support `timeout`
saltstack_salt
train
py
23f871e5ce1c9e02b17186b81351fd3b982d6ca5
diff --git a/lib/pkgcloud/azure/compute/client/index.js b/lib/pkgcloud/azure/compute/client/index.js index <HASH>..<HASH> 100644 --- a/lib/pkgcloud/azure/compute/client/index.js +++ b/lib/pkgcloud/azure/compute/client/index.js @@ -37,8 +37,12 @@ var Client = exports.Client = function (options) { // The https agent is used by request for authenticating TLS/SSL https calls if (this.protocol === 'https://') { - this.before.push(function(req, options) { - req.agent = new https.Agent({host: this.serversUrl, key: options.key, cert: options.cert}); + this.before.push(function (req) { + req.agent = new https.Agent({ + host: this.serversUrl, + key: options.key, + cert: options.cert + }); }); } };
[fix] Use `options` passed to constructor, not `before`
pkgcloud_pkgcloud
train
js
3d2e1bc92750d06e5c147c2a7e6113ca76cc92dc
diff --git a/features/redshift/step_definitions/redshift.js b/features/redshift/step_definitions/redshift.js index <HASH>..<HASH> 100644 --- a/features/redshift/step_definitions/redshift.js +++ b/features/redshift/step_definitions/redshift.js @@ -26,14 +26,13 @@ module.exports = function() { }); this.Given(/^I describe Redshift cluster security groups$/, function(callback) { - this.request(null, 'describeClusterSecurityGroups', {}, callback); + var params = {ClusterSecurityGroupName: this.clusterGroupName}; + this.request(null, 'describeClusterSecurityGroups', params, callback); }); this.Then(/^the Redshift cluster security group should be in the list$/, function(callback) { - var groupName = this.clusterGroupName; - this.assert.contains(this.data.ClusterSecurityGroups, function(item) { - return item.ClusterSecurityGroupName === groupName; - }); + var item = this.data.ClusterSecurityGroups[0]; + this.assert.equal(item.ClusterSecurityGroupName, this.clusterGroupName); callback(); });
Update Redshift test to only describe one cluster security group
aws_aws-sdk-js
train
js
fede6cd063b2a8f8a2f96648fa654a14f4c54e08
diff --git a/tests/record_test.py b/tests/record_test.py index <HASH>..<HASH> 100644 --- a/tests/record_test.py +++ b/tests/record_test.py @@ -271,8 +271,8 @@ def test_nested_create_serialize(): node = Node(applications=[Application(name=u'myapp', image=u'myimage'), Application(name=u'b', image=u'c')]) - node2 = Node.create({'applications': [{'name': u'myapp', 'image': u'myimage'}, - {'name': u'b', 'image': u'c'}]}) + node2 = Node.create({u'applications': [{u'name': u'myapp', u'image': u'myimage'}, + {u'name': u'b', u'image': u'c'}]}) assert node == node2
Fix test failing due to Py <I> unicode incompatibility
tobgu_pyrsistent
train
py
6a74eebcbdc563223bda14993d1cbac14cd9c130
diff --git a/Minimal-J/src/main/java/ch/openech/mj/db/AbstractTable.java b/Minimal-J/src/main/java/ch/openech/mj/db/AbstractTable.java index <HASH>..<HASH> 100644 --- a/Minimal-J/src/main/java/ch/openech/mj/db/AbstractTable.java +++ b/Minimal-J/src/main/java/ch/openech/mj/db/AbstractTable.java @@ -188,7 +188,7 @@ public abstract class AbstractTable<T> { } private void initializeIndexes() throws SQLException { - for (Index index : indexes) { + for (Index<T> index : indexes) { index.initialize(); } } @@ -221,7 +221,7 @@ public abstract class AbstractTable<T> { insertStatement.close(); selectMaxIdStatement.close(); clearStatement.close(); - for (Index index : indexes) { + for (Index<T> index : indexes) { index.closeStatements(); } } @@ -509,9 +509,7 @@ public abstract class AbstractTable<T> { while (true) { for (Map.Entry<String, PropertyInterface> entry : columns.entrySet()) { String columnFieldPath = entry.getValue().getFieldPath(); - System.out.println("Try: " + columnFieldPath); if (columnFieldPath.equals(fieldPath)) { - System.out.println("Found!"); return entry; } }
AbstractTable: removed some debug code
BrunoEberhard_minimal-j
train
java
a272d72f6e835139ab465e5c6ec93031c9fb6faa
diff --git a/salt/states/locale.py b/salt/states/locale.py index <HASH>..<HASH> 100644 --- a/salt/states/locale.py +++ b/salt/states/locale.py @@ -6,7 +6,7 @@ The locale can be managed for the system: .. code-block:: yaml - us: + en_US.UTF-8: locale.system '''
Change example to actually use a valid locale
saltstack_salt
train
py
b131596d9beebfab4025397b5347985edf5630f9
diff --git a/lib/spork/run_strategy.rb b/lib/spork/run_strategy.rb index <HASH>..<HASH> 100644 --- a/lib/spork/run_strategy.rb +++ b/lib/spork/run_strategy.rb @@ -28,7 +28,11 @@ class Spork::RunStrategy protected def self.factory(test_framework) - Spork::RunStrategy::Forking.new(test_framework) + if Spork::RunStrategy::Forking.available? + Spork::RunStrategy::Forking.new(test_framework) + else + Spork::RunStrategy::Magazine.new(test_framework) + end end def self.inherited(subclass)
Use magazine strategy if forking not available. TODO: add check for JRuby. It will NOT work with magazine.
sporkrb_spork
train
rb
1770fab206cc9ff6ddd8fee3f421d2b7a865964f
diff --git a/forms/gridfield/GridField.php b/forms/gridfield/GridField.php index <HASH>..<HASH> 100644 --- a/forms/gridfield/GridField.php +++ b/forms/gridfield/GridField.php @@ -840,7 +840,8 @@ class GridField_FormAction extends FormAction { 'args' => $this->args, ); - $id = substr(md5(serialize($state)), 0, 8); + // Ensure $id doesn't contain only numeric characters + $id = 'gf_'.substr(md5(serialize($state)), 0, 8); Session::set($id, $state); $actionData['StateID'] = $id;
BUG Fix gridfield generating invalid session keys
silverstripe_silverstripe-framework
train
php
abad6b4151106c766a42f3ddb34095a1a38a78bf
diff --git a/test_utilities/src/d1_test/instance_generator/access_policy.py b/test_utilities/src/d1_test/instance_generator/access_policy.py index <HASH>..<HASH> 100644 --- a/test_utilities/src/d1_test/instance_generator/access_policy.py +++ b/test_utilities/src/d1_test/instance_generator/access_policy.py @@ -91,11 +91,15 @@ def random_subject_list_with_permission_labels( return subjects -def random_subject_list(min_len=1, max_len=10, group_chance=0.1): +def random_subject_list(min_len=1, max_len=10, fixed_len=None, symbolic_chance=0.1, group_chance=0.1): + """Return a list of random subjects. + Subjects are regular, on the form ``subj_xx``, group subjects on form + ``subj_xx_group`` or one of the ``public``, ``verifiedUser`` or + ``authenticatedUser`` symbolic subjects. + """ return [ - 'subj_{}{}'.format( - d1_test.instance_generator.random_data.random_lower_ascii(), - '_group' if random.random() <= group_chance else '', + d1_test.instance_generator.random_data.random_regular_or_symbolic_subj( + min_len, max_len, fixed_len, symbolic_chance, group_chance ) for _ in range(random.randint(min_len, max_len)) ]
Randomly include symbolic subjects when generating test subject strings
DataONEorg_d1_python
train
py
97f69ec54f71857b992395704a04eb7583e8d18a
diff --git a/django_cms_tools/filer_tools/management/commands/replace_broken.py b/django_cms_tools/filer_tools/management/commands/replace_broken.py index <HASH>..<HASH> 100644 --- a/django_cms_tools/filer_tools/management/commands/replace_broken.py +++ b/django_cms_tools/filer_tools/management/commands/replace_broken.py @@ -32,10 +32,11 @@ class Command(BaseCommand): def handle(self, *args, **options): self.verbosity = int(options.get('verbosity')) - # e.g.: Parler models needs activated translations: - language_code = settings.LANGUAGE_CODE - self.stdout.write("activate %r translations." % language_code) - translation.activate(language_code) + if settings.USE_I18N: + # e.g.: Parler models needs activated translations: + language_code = settings.LANGUAGE_CODE + self.stdout.write("activate %r translations." % language_code) + translation.activate(language_code) self.stdout.write("settings.FILER_IMAGE_MODEL: %r" % settings.FILER_IMAGE_MODEL)
activate translations only if USE_I<I>N is True
jedie_django-cms-tools
train
py
e5427ea5204c1d00cf1cc79a96c3efe92f1cc5a9
diff --git a/src/js/components/Tabs/Tabs.js b/src/js/components/Tabs/Tabs.js index <HASH>..<HASH> 100644 --- a/src/js/components/Tabs/Tabs.js +++ b/src/js/components/Tabs/Tabs.js @@ -20,6 +20,7 @@ const Tabs = forwardRef( flex, justify = 'center', messages = { tabContents: 'Tab Contents' }, + responsive = true, ...rest }, ref, @@ -82,6 +83,7 @@ const Tabs = forwardRef( as={Box} role="tablist" flex={flex} + responsive={responsive} {...rest} background={theme.tabs.background} >
Fixed Tabs to be more responsive (#<I>) * changed styledtabs to box * added responsive to tabs * updated yarn lock * updated snapshot * organized imports
grommet_grommet
train
js
a1b33c7c1e0d13a714faca8a02d65f39c6a69a1d
diff --git a/hawtio-embedded/src/main/java/io/hawt/embedded/Main.java b/hawtio-embedded/src/main/java/io/hawt/embedded/Main.java index <HASH>..<HASH> 100644 --- a/hawtio-embedded/src/main/java/io/hawt/embedded/Main.java +++ b/hawtio-embedded/src/main/java/io/hawt/embedded/Main.java @@ -90,7 +90,7 @@ public class Main { webapp.setExtraClasspath(options.getExtraClassPath()); // lets set a temporary directory so jetty doesn't bork if some process zaps /tmp/* - String homeDir = System.getProperty("user.home", ".") + "/.hawtio"; + String homeDir = System.getProperty("user.home", ".") + System.getProperty("hawtio.dirname", "/.hawtio"); String tempDirPath = homeDir + "/tmp"; File tempDir = new File(tempDirPath); tempDir.mkdirs();
#<I> - made hawtio home dirname configurable via sys prop
hawtio_hawtio
train
java
f073f76170f63b9f0d0d02aebcb2707b15e0b97c
diff --git a/src/GitHub_Updater/Base.php b/src/GitHub_Updater/Base.php index <HASH>..<HASH> 100644 --- a/src/GitHub_Updater/Base.php +++ b/src/GitHub_Updater/Base.php @@ -596,12 +596,16 @@ class Base { $wp_filesystem->move( $source, $new_source ); if ( 'github-updater' === $slug ) { - $this->delete_all_transients(); + add_action( 'upgrader_process_complete', array( &$this, 'upgrader_process_complete'), 15 ); } - + return trailingslashit( $new_source ); } + public function upgrader_process_complete() { + $this->delete_all_transients(); + } + /** * Delete $source when updating from GitLab Release Asset. *
delete transients in upgrader_process_complete for GHU updates
afragen_github-updater
train
php
cd1beac7ff7ab6c34d491e2de2f9eb7689679a03
diff --git a/src/petl/test/test_util.py b/src/petl/test/test_util.py index <HASH>..<HASH> 100644 --- a/src/petl/test/test_util.py +++ b/src/petl/test/test_util.py @@ -21,7 +21,10 @@ def test_header(): actual = header(table) expect = ('foo', 'bar') eq_(expect, actual) - + table = (['foo', 'bar'], ['a', 1], ['b', 2]) + actual = header(table) + eq_(expect, actual) + def test_fieldnames(): table = (('foo', 'bar'), ('a', 1), ('b', 2)) diff --git a/src/petl/util.py b/src/petl/util.py index <HASH>..<HASH> 100644 --- a/src/petl/util.py +++ b/src/petl/util.py @@ -65,7 +65,7 @@ def header(table): """ it = iter(table) - return it.next() + return tuple(it.next()) def fieldnames(table):
closes #<I> by ensuring header() always returns a tuple
petl-developers_petl
train
py,py
ffb2d7fd241aa53b9b9d7defb17d5e4d70be889d
diff --git a/pandocxnos/core.py b/pandocxnos/core.py index <HASH>..<HASH> 100644 --- a/pandocxnos/core.py +++ b/pandocxnos/core.py @@ -1122,10 +1122,10 @@ def insert_secnos_factory(f): if key == name: # Only insert if attributes are attached. Images always have - # attributes for pandoc >= 1.16. + # attributes for pandoc >= 1.16. Same for Spans. assert len(value) <= n+1 if (name == 'Image' and len(value) == 3) or name == 'Div' or \ - len(value) == n+1: + name == 'Span' or len(value) == n+1: # Make sure value[0] represents attributes assert isinstance(value[0][0], STRTYPES) assert isinstance(value[0][1], list) @@ -1152,11 +1152,11 @@ def delete_secnos_factory(f): """Deletes section numbers from elements attributes.""" # Only delete if attributes are attached. Images always have - # attributes for pandoc >= 1.16. + # attributes for pandoc >= 1.16. Same for Spans. if key == name: assert len(value) <= n+1 if (name == 'Image' and len(value) == 3) or name == 'Div' or \ - len(value) == n+1: + name == 'Span' or len(value) == n+1: # Make sure value[0] represents attributes assert isinstance(value[0][0], STRTYPES)
support insertion and deletion of secnos for Span elements required for pandoc-theoremnos
tomduck_pandoc-xnos
train
py
4a6432e041d714d6f011778bdcc6ad24aeff2dc6
diff --git a/lib/rfd.rb b/lib/rfd.rb index <HASH>..<HASH> 100644 --- a/lib/rfd.rb +++ b/lib/rfd.rb @@ -38,7 +38,7 @@ module Rfd end def D - File.delete current_item.path + FileUtils.rm_rf current_item.path ls end
D should be able to rm directories as well
amatsuda_rfd
train
rb
68a34bc222af586c75daa5166c937f3f26cfefac
diff --git a/datasette/utils.py b/datasette/utils.py index <HASH>..<HASH> 100644 --- a/datasette/utils.py +++ b/datasette/utils.py @@ -244,7 +244,7 @@ def temporary_heroku_directory(files, name, metadata, extra_options, branch, tem if metadata_content: open('metadata.json', 'w').write(json.dumps(metadata_content, indent=2)) - open('runtime.txt', 'w').write('python-3.6.2') + open('runtime.txt', 'w').write('python-3.6.3') if branch: install_from = 'https://github.com/simonw/datasette/archive/{branch}.zip'.format(
Deploy to Heroku with Python <I> Heroku deploys are currently showing the following warning: The latest version of Python 3 is python-<I> (you are using python-<I>, which is unsupported). We recommend upgrading by specifying the latest version (python-<I>).
simonw_datasette
train
py
240b041fcce5a9dde8a937772a906428eb8a431a
diff --git a/code/model/ShopMember.php b/code/model/ShopMember.php index <HASH>..<HASH> 100644 --- a/code/model/ShopMember.php +++ b/code/model/ShopMember.php @@ -56,7 +56,7 @@ class ShopMember extends DataObjectDecorator { } $existingmember = self::get_by_identifier($data[Member::get_unique_identifier_field()]); if($existingmember && $existingmember->exists()){ - if(Member::currentUserID() != $existingUniqueMember->ID) { + if(Member::currentUserID() != $existingmember->ID) { return false; } }
BUG: fixed typo in ShopMember create_or_merge function
silvershop_silvershop-core
train
php
9c7e64a91ea226387de55c4a89ce9cf0107e2e53
diff --git a/datadotworld/datadotworld.py b/datadotworld/datadotworld.py index <HASH>..<HASH> 100644 --- a/datadotworld/datadotworld.py +++ b/datadotworld/datadotworld.py @@ -22,7 +22,7 @@ from __future__ import absolute_import import shutil from datetime import datetime from os import path -from warnings import warn +from warnings import warn, filterwarnings import numbers import requests @@ -186,6 +186,8 @@ class DataDotWorld(object): move_cache_dir_to_backup_dir(backup_dir, cache_dir) descriptor_file = self.api_client.download_datapackage(dataset_key, cache_dir) else: + filterwarnings('always', + message='You are using an outdated copy') warn('You are using an outdated copy of {}. ' 'If you wish to use the latest version, call this ' 'function with the argument '
Add filter to always show warnings of invalidated dataset (#<I>) * Add warning filter to always show warnings of invalidated dataset * Always show warning entry that matches message
datadotworld_data.world-py
train
py
33091e2c115fdbb7f5a66f231df2e1e04cc52c53
diff --git a/src/draw/steps.js b/src/draw/steps.js index <HASH>..<HASH> 100644 --- a/src/draw/steps.js +++ b/src/draw/steps.js @@ -279,12 +279,13 @@ d3plus.draw.steps = function(vars) { } return vars.color.key && vars.color.type == "number" && - vars.data.value && vars.color.key != vars.id.key && - (vars.color.changed || vars.data.changed || vars.depth.changed || - (vars.time.fixed.value && - (vars.time.solo.changed || vars.time.mute.changed) - ) - ) + vars.id.nesting.indexOf(vars.color.key) < 0 && + vars.data.value && vars.color.key != vars.id.key && + (vars.color.changed || vars.data.changed || vars.depth.changed || + (vars.time.fixed.value && + (vars.time.solo.changed || vars.time.mute.changed) + ) + ) }, "function": d3plus.data.color,
fixed bug where coloring by an integer ID would result in a color scale rather than boxes
alexandersimoes_d3plus
train
js
9938fa26dd1cf9cb68e62863313c0f6b4b923ed4
diff --git a/helpers/tools.php b/helpers/tools.php index <HASH>..<HASH> 100644 --- a/helpers/tools.php +++ b/helpers/tools.php @@ -100,6 +100,36 @@ if (!function_exists('returnBytes')) { // -------------------------------------------------------------------------- +if (!function_exists('maxUploadSize')) { + + /** + * Returns the configured maximum upload size for this system by inspecting + * upload_max_filesize and post_max_size, if available. + * @param boolean $bFormat Whether to format the string using formatBytes + * @return integer|string + */ + function maxUploadSize($bFormat = true) + { + if (function_exists('ini_get')) { + + $aMaxSizes = array( + returnBytes(ini_get('upload_max_filesize')), + returnBytes(ini_get('post_max_size')) + ); + + $iMaxSize = min($aMaxSizes); + + return $bFormat ? formatBytes($iMaxSize) : $iMaxSize; + + } else { + + return null; + } + } +} + +// -------------------------------------------------------------------------- + if (!function_exists('stringToBoolean')) { /**
Added helper for working out the maximum upload size available to the system
nails_common
train
php
b2755454a2e302addef360da0fe59d5fff874e67
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import sys -from setuptools import setup +from setuptools import setup, find_packages from distutils.extension import Extension import numpy import versioneer @@ -30,20 +30,8 @@ setup( ], }, install_requires=requires + more_requires, - packages=[ - 'scanpy', - 'scanpy.tools', - 'scanpy.compat', - 'scanpy.examples', - 'scanpy.preprocess', - 'scanpy.classes', - 'scanpy.sim_models', - 'scanpy.cython', - ], + packages=find_packages(exclude=['scripts', 'scripts.*']), include_dirs=[numpy.get_include()], - # cmdclass={ - # 'build_ext': build_ext, - # }, cmdclass=versioneer.get_cmdclass({'build_ext': build_ext}), ext_modules=[ Extension("scanpy.cython.utils_cy",
use find_packages to avoid errors (such as the preprocess → preprocessing rename)
theislab_scanpy
train
py
8fd8297ff75e314ce15f165b9ac7324fda2540d6
diff --git a/src/Arvici/Heart/Http/Response.php b/src/Arvici/Heart/Http/Response.php index <HASH>..<HASH> 100644 --- a/src/Arvici/Heart/Http/Response.php +++ b/src/Arvici/Heart/Http/Response.php @@ -187,6 +187,7 @@ class Response */ public function json($object, $pretty = false) { + $this->header('Content-Type', 'application/json'); return $this->body(json_encode($object, $pretty ? JSON_PRETTY_PRINT : 0)); } diff --git a/tests/app/App/Config/Template.php b/tests/app/App/Config/Template.php index <HASH>..<HASH> 100644 --- a/tests/app/App/Config/Template.php +++ b/tests/app/App/Config/Template.php @@ -51,6 +51,11 @@ Configuration::define('template', function() { View::bodyPlaceholder(), View::body('testContent'), View::template('testFooter') + ], + 'test-basicrender' => [ + View::template('testHeader'), + View::bodyPlaceholder(), + View::template('testFooter') ] ], ];
Small fix in response json encoder.
arvici_framework
train
php,php
931a6aba363e9ef70c8dec368d332a279e6bbfd9
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -112,10 +112,10 @@ module ActiveRecord end def preload_hash(association) - association.each do |parent, child| - Preloader.new(records, parent, preload_scope).run + association.flat_map { |parent, child| + preload_one parent Preloader.new(records.map { |record| record.send(parent) }.flatten, child).run - end + } end # Not all records have the same class, so group then preload group on the reflection
lhs preload is always a single preload, so just preload one
rails_rails
train
rb
e48c732ac6d100dfd671917e50fc77ca4a0b2330
diff --git a/scope/__init__.py b/scope/__init__.py index <HASH>..<HASH> 100644 --- a/scope/__init__.py +++ b/scope/__init__.py @@ -3,7 +3,7 @@ """ Spectral Comparison and Parameter Evaluation """ __author__ = "Andy Casey <arc@ast.cam.ac.uk>" -__version__ = "0.08" +__version__ = "0.081" __all__ = ["config", "Model", "specutils", "Spectrum", "utils"] diff --git a/scope/analysis.py b/scope/analysis.py index <HASH>..<HASH> 100644 --- a/scope/analysis.py +++ b/scope/analysis.py @@ -444,7 +444,7 @@ def solve(observed_spectra, model, initial_guess=None): # Blobs contain all the sampled parameters and likelihoods sampled = np.array(sampler.blobs).reshape((-1, len(model.dimensions) + 1)) - sampled = sampled[-int(model.configuration["solver"]["walkers"] * model.configuration["solver"]["sample"]):] + sampled = sampled[-int(model.configuration["solver"]["walkers"] * model.configuration["solver"]["sample"] * 0.5):] sampled_theta, sampled_log_likelihood = sampled[:, :-1], sampled[:, -1] # Get the maximum estimate
assume first half of sampling post-burn in is junk
andycasey_sick
train
py,py
11e6d4519a3c7d8b64ab2e1b4c05bb5626fa9ae8
diff --git a/python/mxnet/contrib/amp/lists/symbol.py b/python/mxnet/contrib/amp/lists/symbol.py index <HASH>..<HASH> 100644 --- a/python/mxnet/contrib/amp/lists/symbol.py +++ b/python/mxnet/contrib/amp/lists/symbol.py @@ -340,7 +340,6 @@ FP16_FP32_FUNCS = [ 'take', 'tanh', 'tile', - 'topk', 'transpose', 'trunc', 'uniform', @@ -463,6 +462,7 @@ FP32_FUNCS = [ '_sparse_norm', '_sparse_rsqrt', 'argsort', + 'topk', # Neural network 'SoftmaxOutput',
[AMP] Move topk from FP<I>_FP<I>_FUNCS to FP<I>_FUNCS (#<I>)
apache_incubator-mxnet
train
py
67f355a622ceef6fc2d58598bf32bfcb96d615d9
diff --git a/lib/rakuten_web_service/books/genre.rb b/lib/rakuten_web_service/books/genre.rb index <HASH>..<HASH> 100644 --- a/lib/rakuten_web_service/books/genre.rb +++ b/lib/rakuten_web_service/books/genre.rb @@ -47,6 +47,10 @@ module RakutenWebService repository[id] = genre end + def children + return @params['children'] + end + private def self.repository @repository ||= {} diff --git a/spec/rakuten_web_service/books/genre_spec.rb b/spec/rakuten_web_service/books/genre_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rakuten_web_service/books/genre_spec.rb +++ b/spec/rakuten_web_service/books/genre_spec.rb @@ -84,4 +84,17 @@ describe RWS::Books::Genre do RWS::Books::Genre.root end end + + describe '#children' do + before do + @genre = RWS::Books::Genre.search(:booksGenreId => genre_id).first + end + + specify 'are Books::Genre objects' do + expect(@genre.children).to be_all { |child| child.is_a? RWS::Books::Genre } + expect(@genre.children).to be_all do |child| + expected_json['children'].is_any? { |c| c['booksGenreId'] == child['booksGenreId'] } + end + end + end end
RWS::Books::Genre#children returns Genre objects under the genre
rakuten-ws_rws-ruby-sdk
train
rb,rb
1f07cd21e12368ef4e858a712a93539c6d67deff
diff --git a/lib/protocol/SFTP.js b/lib/protocol/SFTP.js index <HASH>..<HASH> 100644 --- a/lib/protocol/SFTP.js +++ b/lib/protocol/SFTP.js @@ -2259,7 +2259,7 @@ function readAttrs(biOpt) { function sendOrBuffer(sftp, payload) { const ret = tryWritePayload(sftp, payload); if (ret !== undefined) { - sftp._buffer.push(payload); + sftp._buffer.push(ret); return false; } return true;
SFTP: fix incorrect outgoing data buffering
mscdex_ssh2
train
js
245ea19f9de24b145d2e1d02a48d9debec3b2892
diff --git a/src/views/hub/options.php b/src/views/hub/options.php index <HASH>..<HASH> 100644 --- a/src/views/hub/options.php +++ b/src/views/hub/options.php @@ -6,6 +6,7 @@ use hipanel\helpers\Url; +use hipanel\modules\server\widgets\combo\ServerCombo; use hipanel\widgets\PasswordInput; use yii\bootstrap\ActiveForm; use yii\bootstrap\Html; @@ -34,8 +35,10 @@ $this->params['breadcrumbs'][] = $this->title; </div> <div class="col-md-4"> <?= $form->field($model, 'ports_num') ?> - <?= $form->field($model, 'traf_server_id') ?> - <?= $form->field($model, 'vlan_server_id') ?> + <?= $form->field($model, 'traf_server_id')->widget(ServerCombo::class, [ + 'pluginOptions' => [], + ]) ?> + <?= $form->field($model, 'vlan_server_id')->widget(ServerCombo::class) ?> <?= $form->field($model, 'community') ?> </div> <div class="col-md-4">
Added ServerCombo to optison form in Hub
hiqdev_hipanel-module-server
train
php
f73707589f12b7ce38c2400b31798f280121a87a
diff --git a/js/bitfinex.js b/js/bitfinex.js index <HASH>..<HASH> 100644 --- a/js/bitfinex.js +++ b/js/bitfinex.js @@ -503,10 +503,14 @@ module.exports = class bitfinex extends Exchange { } let query = this.omit (params, this.extractParams (path)); let url = this.urls['api'] + request; - if (api == 'public') { - if (Object.keys (query).length) - url += '?' + this.urlencode (query); - } else { + if ((api == 'public') || (path == 'orders/hist')) { + if (Object.keys (query).length) { + let suffix = '?' + this.urlencode (query); + url += suffix; + request += suffix; + } + } + if (api == 'private') { let nonce = this.nonce (); query = this.extend ({ 'nonce': nonce.toString (),
fixed bitfinex fetch_closed_order limit
ccxt_ccxt
train
js
e764d867c0a8ac47748113e8453923749765798e
diff --git a/sprd/view/svg/ConfigurationViewerClass.js b/sprd/view/svg/ConfigurationViewerClass.js index <HASH>..<HASH> 100644 --- a/sprd/view/svg/ConfigurationViewerClass.js +++ b/sprd/view/svg/ConfigurationViewerClass.js @@ -353,7 +353,7 @@ define(['js/svg/SvgElement', 'sprd/entity/TextConfiguration', 'sprd/entity/Desig }.on(["productViewer", "change:selectedConfiguration"]), isScalable: function() { - return this.isSelectedConfiguration() && this.get("configuration.printType.isScalable()"); + return this.isSelectedConfiguration() && this.get("configuration.isScalable()"); }.on(["productViewer", "change:selectedConfiguration"]) });
use isScalable from Configuration to determinate scaleibilty on configuration
spreadshirt_rAppid.js-sprd
train
js
debb5384ab241759b6f5a31814c187c551457ba2
diff --git a/devassistant/cli/cli_runner.py b/devassistant/cli/cli_runner.py index <HASH>..<HASH> 100644 --- a/devassistant/cli/cli_runner.py +++ b/devassistant/cli/cli_runner.py @@ -26,4 +26,4 @@ class CliRunner(object): pr.run() except exceptions.ExecutionException as ex: # error is already logged, just catch it and silently exit here - pass + sys.exit(1)
Return non-zero exit code on assistant failure. Fixes #<I>
devassistant_devassistant
train
py
9053caac3f26f2b3792dfea7b7cfcaf884c84558
diff --git a/blocks.js b/blocks.js index <HASH>..<HASH> 100644 --- a/blocks.js +++ b/blocks.js @@ -176,7 +176,8 @@ module.exports = function (file, block_size, cache) { }, /** * Writes a buffer directly to a position in the file. - * This wraps `file.write()` and removes the block cache. + * This wraps `file.write()` and removes the block cache after the file + * write finishes to avoid having the item re-cached during the write. * * @param {buffer} buf - the data to write to the file * @param {number} pos - position in the file to write the buffer @@ -184,8 +185,10 @@ module.exports = function (file, block_size, cache) { */ write: (buf, pos, cb) => { const i = Math.floor(pos/block_size) - cache.remove(i) - file.write(buf, pos, cb) + file.write(buf, pos, (err) => { + cache.remove(i) + cb(err) + }) }, //we arn't specifically clearing the buffers, //but they should get updated anyway.
Clear cache *after* file write is finished
flumedb_aligned-block-file
train
js
f0c628a9895ddeb0daa11098d870be086805b383
diff --git a/spec/controllers/spree/adyen_redirect_controller_spec.rb b/spec/controllers/spree/adyen_redirect_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/spree/adyen_redirect_controller_spec.rb +++ b/spec/controllers/spree/adyen_redirect_controller_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Spree::AdyenRedirectController, type: :controller do ) end - let!(:store) { Spree::Store.default } + let!(:store) { create :store } let!(:gateway) { create :hpp_gateway } before do
Create store in spec This was a work around to a bad spree factory that was automatically creating stores, which has now been patched.
StemboltHQ_solidus-adyen
train
rb
f1859429270723fd3ddb16ac51f32998c58acbaa
diff --git a/src/javascripts/ng-admin/Crud/delete/DeleteController.js b/src/javascripts/ng-admin/Crud/delete/DeleteController.js index <HASH>..<HASH> 100644 --- a/src/javascripts/ng-admin/Crud/delete/DeleteController.js +++ b/src/javascripts/ng-admin/Crud/delete/DeleteController.js @@ -26,7 +26,7 @@ define(function () { $window = this.$window; this.WriteQueries.deleteOne(this.view, this.entityId).then(function () { - $window.history.back(); + this.back(); notification.log('Element successfully deleted.', { addnCls: 'humane-flatty-success' }); }.bind(this), function (response) { // @TODO: share this method when splitting controllers @@ -40,9 +40,7 @@ define(function () { }; DeleteController.prototype.back = function () { - var $window = this.$window; - - $window.history.back(); + this.$window.history.back(); }; DeleteController.prototype.destroy = function () {
Fixes from jpetitcolas's comments
marmelab_ng-admin
train
js
32c8e6d7c1249f2c904844ca23b7a537cbd40059
diff --git a/lib/sensu-plugin/utils.rb b/lib/sensu-plugin/utils.rb index <HASH>..<HASH> 100644 --- a/lib/sensu-plugin/utils.rb +++ b/lib/sensu-plugin/utils.rb @@ -115,7 +115,11 @@ module Sensu unknown("Non-OK response from API query: #{get_uri(query_path)}") end data = JSON.parse(response.body) + # when the data is empty, we have hit the end break if data.empty? + # If API lacks pagination support, it will + # return same data on subsequent iterations + break if results.any? { |r| r == data } results << data offset += limit end
update paginated_get method to avoid blocking infinitely on older API versions
sensu-plugins_sensu-plugin
train
rb
8138b6b2ac1fe7be6f15319b3c726b84aaa182a5
diff --git a/spec/unit/form_builder_spec.rb b/spec/unit/form_builder_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/form_builder_spec.rb +++ b/spec/unit/form_builder_spec.rb @@ -563,8 +563,11 @@ describe ActiveAdmin::FormBuilder do describe "with allow destroy" do context "with an existing post" do let :body do + s = self build_form({url: '/categories'}, Category.new) do |f| - allow(f.object.posts.build).to receive(:new_record?).and_return(false) + s.instance_exec do + allow(f.object.posts.build).to receive(:new_record?).and_return(false) + end f.has_many :posts, allow_destroy: true do |p| p.input :title end
RSpec methods are no longer available globally
activeadmin_activeadmin
train
rb
3978d439e32113b2f09ac538f52ab3509bc5451b
diff --git a/tests/test_api.py b/tests/test_api.py index <HASH>..<HASH> 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -266,7 +266,7 @@ class TweepyAPITests(TweepyTestCase): def testcreatedestroyblock(self): self.api.create_block('twitter') self.api.destroy_block('twitter') - self.api.create_friendship('twitter') # restore + self.api.create_friendship('twitter') # restore @tape.use_cassette('testblocks.json') def testblocks(self): @@ -385,7 +385,7 @@ class TweepyAPITests(TweepyTestCase): # Test various API functions using Austin, TX, USA self.assertEqual(self.api.geo_id(id='1ffd3558f2e98349').full_name, 'Dogpatch, San Francisco') self.assertTrue(place_name_in_list('Austin, TX', - self.api.reverse_geocode(lat=30.2673701685, long= -97.7426147461))) # Austin, TX, USA + self.api.reverse_geocode(lat=30.2673701685, long= -97.7426147461))) # Austin, TX, USA @tape.use_cassette('testsupportedlanguages.json') def testsupportedlanguages(self):
Standardize inline comment spacing in API tests
tweepy_tweepy
train
py
59f781c62c9289f5d46560462928e3914af1e965
diff --git a/cobra/core/model.py b/cobra/core/model.py index <HASH>..<HASH> 100644 --- a/cobra/core/model.py +++ b/cobra/core/model.py @@ -334,6 +334,12 @@ class Model(Object): # First check whether the metabolites exist in the model metabolite_list = [x for x in metabolite_list if x.id not in self.metabolites] + + bad_ids = [m for m in metabolite_list + if not isinstance(m.id, string_types) or len(m.id) < 1] + if len(bad_ids) != 0: + raise ValueError('invalid identifiers in {}'.format(repr(bad_ids))) + for x in metabolite_list: x._model = self self.metabolites += metabolite_list diff --git a/cobra/test/test_model.py b/cobra/test/test_model.py index <HASH>..<HASH> 100644 --- a/cobra/test/test_model.py +++ b/cobra/test/test_model.py @@ -118,6 +118,8 @@ class TestReactions: benchmark(add_remove_metabolite) def test_add_metabolite(self, model): + with pytest.raises(ValueError): + model.add_metabolites(Metabolite()) with model: with model: reaction = model.reactions.get_by_id("PGI")
fix: check valid metabolite id Ensure that metabolites to add have valid identifiers. Failure to do so triggers confusing errors when populating solver.
opencobra_cobrapy
train
py,py
a560d9f7c22ea23a1e2c8e5eaa042324242eb5fc
diff --git a/gkeepapi/__init__.py b/gkeepapi/__init__.py index <HASH>..<HASH> 100644 --- a/gkeepapi/__init__.py +++ b/gkeepapi/__init__.py @@ -3,7 +3,7 @@ .. moduleauthor:: Kai <z@kwi.li> """ -__version__ = '0.11.14' +__version__ = '0.11.15' import logging import re diff --git a/gkeepapi/node.py b/gkeepapi/node.py index <HASH>..<HASH> 100644 --- a/gkeepapi/node.py +++ b/gkeepapi/node.py @@ -619,7 +619,8 @@ class NodeTimestamps(Element): def _load(self, raw): super(NodeTimestamps, self)._load(raw) - self._created = self.str_to_dt(raw['created']) + if 'created' in raw: + self._created = self.str_to_dt(raw['created']) self._deleted = self.str_to_dt(raw['deleted']) \ if 'deleted' in raw else None self._trashed = self.str_to_dt(raw['trashed']) \
Issue #<I>: Allow for missing created timestamp
kiwiz_gkeepapi
train
py,py
e4ce4e88f82457a714a473db059c56ebda1500c4
diff --git a/lib/ircb.js b/lib/ircb.js index <HASH>..<HASH> 100644 --- a/lib/ircb.js +++ b/lib/ircb.js @@ -224,10 +224,10 @@ IRCb.prototype.names = function (channel, cb) { }); }; -IRCb.prototype.whois = function (nickname, cb) { +IRCb.prototype.whois = function (nick, cb) { var self = this; - self.write('WHOIS ' + nickname, function (err) { + self.write('WHOIS ' + nick, function (err) { if (err) { return cb(err); } @@ -237,8 +237,10 @@ IRCb.prototype.whois = function (nickname, cb) { return cb(err); } - cb(null, whois); - self.removeListener('whois', onWhois); + if (nick === whois.nick) { + cb(null, whois); + self.removeListener('whois', onWhois); + } }); }); };
[fix] Filter by nickname to avoid confusing replies
mmalecki_ircb
train
js
95fbad663544d385b71bf46a224c47718fccce29
diff --git a/pages/subscribers.js b/pages/subscribers.js index <HASH>..<HASH> 100644 --- a/pages/subscribers.js +++ b/pages/subscribers.js @@ -6,6 +6,7 @@ import commonMenu from '@shopgate/pwa-common/subscriptions/menu'; import commonRouter from '@shopgate/pwa-common/subscriptions/router'; // PWA Common Commerce import commerceCart from '@shopgate/pwa-common-commerce/cart/subscriptions'; +import commerceCheckout from '@shopgate/pwa-common-commerce/checkout/subscriptions'; import commerceFavorites from '@shopgate/pwa-common-commerce/favorites/subscriptions'; import commerceFilter from '@shopgate/pwa-common-commerce/filter/subscriptions'; import commerceProduct from '@shopgate/pwa-common-commerce/product/subscriptions'; @@ -55,6 +56,7 @@ const subscriptions = [ trackingDeeplinkPush, // Common Commerce subscribers. commerceCart, + commerceCheckout, commerceFavorites, commerceFilter, commerceProduct,
PWA-<I>: Changed checkout success event to be processed via an own stream. Clear expiration times on all ordered products by dispatching checkout success action within the new subscription.
shopgate_pwa
train
js
fe625f1d862dec7560ce082b07f2a0c34a13476a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ setup( "Operating System :: OS Independent", "Topic :: Software Development" ], + zip_safe=False, packages=[ 'userlog', ],
Sets zip_safe=False in the setup.py file.
muccg_django-useraudit
train
py
bd6d1ad974c9329940dc55f54c77fe9c2b77490a
diff --git a/src/virtual.js b/src/virtual.js index <HASH>..<HASH> 100644 --- a/src/virtual.js +++ b/src/virtual.js @@ -75,6 +75,14 @@ export default class Virtual { updateParam (key, value) { if (this.param && (key in this.param)) { + // if uniqueIds reducing, find out deleted id and remove from size map + if (key === 'uniqueIds' && (value.length < this.param[key].length)) { + this.sizes.forEach((v, key) => { + if (!value.includes(key)) { + this.sizes.delete(key) + } + }) + } this.param[key] = value } }
Delete size map when items reducing
tangbc_vue-virtual-scroll-list
train
js
df9d5177f59ee6164aeca0947ef4d2b61a055f66
diff --git a/lib/salt/page.rb b/lib/salt/page.rb index <HASH>..<HASH> 100644 --- a/lib/salt/page.rb +++ b/lib/salt/page.rb @@ -17,8 +17,9 @@ module Salt end end - def render - Site.instance.render_template(@layout, @contents, self) + def render(context = {}) + context[:this] = self + Site.instance.render_template(@layout, @contents, context) end def output_file(extension = nil) @@ -26,15 +27,15 @@ module Salt end def output_path(parent_path) + return parent_path if @path.nil? File.join(parent_path, File.dirname(@path).gsub(Site.instance.path(:pages), '')) end - def write(path, extension = nil) - contents = self.render + def write(path, context = {}, extension = nil) + contents = self.render(context) output_path = self.output_path(path) FileUtils.mkdir_p(output_path) unless Dir.exists?(output_path) - full_path = File.join(output_path, self.output_file(extension)) if @path && File.exists?(full_path)
Updated render and write to take a context hash. Updated output_path to work if no @path is set.
waferbaby_dimples
train
rb
aa499f38baa5b38002cf1b9504dbd080f2245243
diff --git a/app/scripts/configs/tracks-info.js b/app/scripts/configs/tracks-info.js index <HASH>..<HASH> 100644 --- a/app/scripts/configs/tracks-info.js +++ b/app/scripts/configs/tracks-info.js @@ -604,7 +604,8 @@ export const TRACKS_INFO = [ 'rectangleDomainFillColor', 'rectangleDomainStrokeColor', 'rectangleDomainOpacity', - 'minSquareSize' + 'rectanlgeMinSize', + 'polygonMinBoundingSize', ], defaultOptions: { projecton: 'mercator', @@ -615,7 +616,8 @@ export const TRACKS_INFO = [ rectangleDomainFillColor: 'grey', rectangleDomainStrokeColor: 'black', rectangleDomainOpacity: 0.6, - minSquareSize: 'none', + rectanlgeMinSize: 1, + polygonMinBoundingSize: 4 }, },
Adjust and add an option for geoJson track
higlass_higlass
train
js
bb13db2d23ef14507a3266fc64c3ae579c7b3c70
diff --git a/lib/gclitest/suite.js b/lib/gclitest/suite.js index <HASH>..<HASH> 100644 --- a/lib/gclitest/suite.js +++ b/lib/gclitest/suite.js @@ -22,5 +22,7 @@ define(function(require, exports, module) { examiner.addSuite('gclitest/testJs', require('gclitest/testJs')); examiner.run(); + console.log('Completed test suite'); + // examiner.log(); }); diff --git a/lib/test/examiner.js b/lib/test/examiner.js index <HASH>..<HASH> 100644 --- a/lib/test/examiner.js +++ b/lib/test/examiner.js @@ -92,6 +92,19 @@ examiner.toRemote = function() { }; /** + * Output a test summary to console.log + */ +examiner.log = function() { + var remote = this.toRemote(); + remote.suites.forEach(function(suite) { + console.log(suite.name); + suite.tests.forEach(function(test) { + console.log('- ' + test.name, test.status.name, test.message || ''); + }); + }); +}; + +/** * Used by assert to record a failure against the current test */ examiner.recordError = function(message) {
Bug <I> (tests): Additional logging When tests are run from the cli you want a summary
joewalker_gcli
train
js,js
2d32c822ac0dd2eeb8c995c96e5552548c7c84a1
diff --git a/src/_legacy.js b/src/_legacy.js index <HASH>..<HASH> 100644 --- a/src/_legacy.js +++ b/src/_legacy.js @@ -16,20 +16,6 @@ }; } - if ( !Element.prototype.contains ) { - Element.prototype.contains = function ( el ) { - while ( el.parentNode ) { - if ( el.parentNode === this ) { - return true; - } - - el = el.parentNode; - } - - return false; - }; - } - if ( !String.prototype.trim ) { String.prototype.trim = function () { return this.replace(/^\s+/, '').replace(/\s+$/, '');
removed newly redundant element.contains shim
ractivejs_ractive
train
js
725f01668dcff8543eb44bbcb094d96073dc7763
diff --git a/src/client/pfs.go b/src/client/pfs.go index <HASH>..<HASH> 100644 --- a/src/client/pfs.go +++ b/src/client/pfs.go @@ -597,6 +597,26 @@ func (c APIClient) ListFileFast(repoName string, commitID string, path string, f return fileInfos.FileInfo, nil } +type WalkFn func(*pfs.FileInfo) error + +func (c APIClient) Walk(repoName string, commitID string, path string, fromCommitID string, fullFile bool, shard *pfs.Shard, walkFn WalkFn) error { + fileInfos, err := c.ListFileFast(repoName, commitID, path, fromCommitID, fullFile, shard) + if err != nil { + return err + } + for _, fileInfo := range fileInfos { + if err := walkFn(fileInfo); err != nil { + return err + } + if fileInfo.FileType == pfs.FileType_FILE_TYPE_DIR { + if err := c.Walk(repoName, commitID, fileInfo.Path, fromCommitID, fullFile, shard, walkFn); err != nil { + return err + } + } + } + return nil +} + // DeleteFile deletes a file from a Commit. // DeleteFile leaves a tombstone in the Commit, assuming the file isn't written // to later attempting to get the file from the finished commit will result in
Adds a Walk function to pfs client.
pachyderm_pachyderm
train
go
55c8741e423e3a24282e88d3ea452351ba818092
diff --git a/peer.go b/peer.go index <HASH>..<HASH> 100644 --- a/peer.go +++ b/peer.go @@ -314,7 +314,6 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error { p.server.cc.signer, p.server.witnessBeacon, dbChan, ) if err != nil { - lnChan.Stop() return err }
peer: don't stop nil channel
lightningnetwork_lnd
train
go
efd0573b55194da054cc860c45c106abfd7fe9ee
diff --git a/tools/git-remove-branches-script.py b/tools/git-remove-branches-script.py index <HASH>..<HASH> 100755 --- a/tools/git-remove-branches-script.py +++ b/tools/git-remove-branches-script.py @@ -289,7 +289,8 @@ if __name__ == "__main__": format_string = DELIMITER.join([gitshowmap[key] for key in sorted(gitshowmap)]) #Iterate over it and get a bunch of commit information using git log - print "branch_names is %s" % branch_names + print "##branch_names is %s" % branch_names + branch_infos = [] for b in branch_names: if b.find("/refs/tags/") != -1:
update to fix delete branches in different repos (#<I>)
VoltDB_voltdb
train
py
6218667f4b2dc75fdfa3404afce4ad9ad88170f2
diff --git a/yaswfp/swfparser.py b/yaswfp/swfparser.py index <HASH>..<HASH> 100644 --- a/yaswfp/swfparser.py +++ b/yaswfp/swfparser.py @@ -442,12 +442,13 @@ class SWFParser: color = self._get_struct_rgba else: raise ValueError("unknown version: {}".format(version)) - obj.ColorTableRGB = [color() for _ in range(obj.BitmapColorTableSize + 1)] + obj.ColorTableRGB = [ + color() for _ in range(obj.BitmapColorTableSize + 1)] obj.ColormapPixelData = self._get_raw_bytes(-len(BitmapData)) elif obj.BitmapFormat in (4, 5): obj.BitmapPixelData = BitmapData else: - raise ValueError("unknown BitmapFormat: {}".format(obj.BitmapFormat)) + raise ValueError("BitmapFormat: {}".format(obj.BitmapFormat)) finally: self._src = _src
fix flake8 E<I> line too long
facundobatista_yaswfp
train
py
a7a21aab088a757b0871c5bc10fc660496bbd71c
diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index <HASH>..<HASH> 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -233,18 +233,8 @@ $(function () { return; } const clsItem = $(this).closest('.item'); - let show; - if (clsItem.hasClass('toggle-manual-show')) { - show = false; - } else if (clsItem.hasClass('toggle-manual-hide')) { - show = true; - } else { - clsItem.find('.member-list li').each(function (i, v) { - show = $(v).is(':hidden'); - return !show; - }); - } - search.manualToggle(clsItem, !!show); + const show = !clsItem.hasClass('toggle-manual-show'); + search.manualToggle(clsItem, show); }); // Auto resizing on navigation
Fix toggle state when there are no hidden members
openlayers_openlayers
train
js
0115590f1a5c6ee743712c19460a2047d6c5e7b3
diff --git a/maven-plugin/src/main/java/net/revelc/code/formatter/AbstractCacheableFormatter.java b/maven-plugin/src/main/java/net/revelc/code/formatter/AbstractCacheableFormatter.java index <HASH>..<HASH> 100755 --- a/maven-plugin/src/main/java/net/revelc/code/formatter/AbstractCacheableFormatter.java +++ b/maven-plugin/src/main/java/net/revelc/code/formatter/AbstractCacheableFormatter.java @@ -45,7 +45,7 @@ public abstract class AbstractCacheableFormatter { public Result formatFile(File file, LineEnding ending, boolean dryRun) { try { - this.log.debug("Processing file: " + file); + this.log.debug("Processing file: " + file + " with line ending: " + ending); String code = FileUtils.fileRead(file, this.encoding.name()); String formattedCode = doFormat(code, ending);
[ci] Add line ending being used to process file logging
revelc_formatter-maven-plugin
train
java
0e74ffe34529620a058a9e738cc8cd36e75eade7
diff --git a/src/font/bitmapfont.js b/src/font/bitmapfont.js index <HASH>..<HASH> 100644 --- a/src/font/bitmapfont.js +++ b/src/font/bitmapfont.js @@ -200,7 +200,8 @@ renderer.drawImage(this.fontImage, glyph.src.x, glyph.src.y, glyph.width, glyph.height, - ~~x, ~~(y + glyph.offset.y * this.fontScale.y), + ~~(x + glyph.offset.x), + ~~(y + glyph.offset.y * this.fontScale.y), glyph.width * this.fontScale.x, glyph.height * this.fontScale.y); x += (glyph.xadvance + kerning) * this.fontScale.x; lastGlyph = glyph;
[#<I>][<I>] is this not supposed to be used ? @agmcleod does not really change anything in terms of rendering, but looks like it was missing
melonjs_melonJS
train
js
81589c5b22d79c1a5f70a631b29d8759b971f3ae
diff --git a/src/test/java/integration/ImageTest.java b/src/test/java/integration/ImageTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/integration/ImageTest.java +++ b/src/test/java/integration/ImageTest.java @@ -4,8 +4,10 @@ import org.junit.Before; import org.junit.Test; import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.WebDriverRunner.isHtmlUnit; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeFalse; public class ImageTest extends IntegrationTest { @Before @@ -15,6 +17,8 @@ public class ImageTest extends IntegrationTest { @Test public void userCanCheckIfImageIsLoadedCorrectly() { + assumeFalse(isHtmlUnit()); + assertTrue($("#valid-image img").isImage()); assertFalse($("#invalid-image img").isImage()); }
image check does not work in htmlunit
selenide_selenide
train
java
76e4b13882de51fb22ddc632e7ad955a7c646b26
diff --git a/mingus/midi/pyfluidsynth.py b/mingus/midi/pyfluidsynth.py index <HASH>..<HASH> 100644 --- a/mingus/midi/pyfluidsynth.py +++ b/mingus/midi/pyfluidsynth.py @@ -29,12 +29,17 @@ from __future__ import absolute_import from ctypes import * from ctypes.util import find_library - +import os import six +if hasattr(os, 'add_dll_directory'): + os.add_dll_directory(os.getcwd()) + lib = ( find_library("fluidsynth") or find_library("libfluidsynth") + or find_library('libfluidsynth-3') + or find_library('libfluidsynth-2') or find_library("libfluidsynth-1") ) if lib is None:
Adding new code to match with recent changes in FluidSynth library
bspaans_python-mingus
train
py
ca5346e0d9fd9bfea725b2e28535e7d254af5098
diff --git a/public/js/vendor/jquery.radio.js b/public/js/vendor/jquery.radio.js index <HASH>..<HASH> 100644 --- a/public/js/vendor/jquery.radio.js +++ b/public/js/vendor/jquery.radio.js @@ -16,7 +16,15 @@ return $els.filter(':checked').val(); } else { $.each($els, function() { - $(this).attr('checked', $(this).attr('value') === value); + var checked = ($(this).attr('value') === value); + // The attribute should be set or unset... + if (checked) { + this.setAttribute('checked', 'checked'); + } else { + this.removeAttribute('checked'); + } + // And also the property + this.checked = checked; }); } };
jquery radio <I>, corrects a bug in snippet widgets
apostrophecms_apostrophe
train
js
45ea3596f17b2d07a7c790442d5c356b0eda690f
diff --git a/bin/hydra.js b/bin/hydra.js index <HASH>..<HASH> 100755 --- a/bin/hydra.js +++ b/bin/hydra.js @@ -39,7 +39,7 @@ if (! hydraConfig.plugins) var hydra = new Hydra(); hydraConfig.plugins.forEach(function(pluginDef) { - var plugin = hydra.loadPlugin(pluginDef.name); + var plugin = hydra.loadPlugin(pluginDef.name, pluginDef.config); var pluginObject = summonHydraBodyParts(plugin.module.getBodyParts(plugin.config)); pluginObject.name = pluginDef.name;
Pass around the plugin configuration from the hydra conf
robohydra_robohydra
train
js
fae95bbecd04f27b21f5d18f423c6cf3e508fbe8
diff --git a/docs/gensidebar.py b/docs/gensidebar.py index <HASH>..<HASH> 100644 --- a/docs/gensidebar.py +++ b/docs/gensidebar.py @@ -43,7 +43,7 @@ def generate_sidebar(conf, conf_api): elif not do_gen: return else: - args = desc, 'http://robotpy.readthedocs.io/en/%s/%s.html' % (version, link) + args = desc, 'https://robotpy.readthedocs.io/en/%s/%s.html' % (version, link) lines.append(' %s <%s>' % args) @@ -51,7 +51,7 @@ def generate_sidebar(conf, conf_api): if project != conf_api: if do_gen: args = desc, project, version - lines.append(' %s API <http://robotpy.readthedocs.io/projects/%s/en/%s/api.html>' % args) + lines.append(' %s API <https://robotpy.readthedocs.io/projects/%s/en/%s/api.html>' % args) else: lines.append(' %s API <api>' % desc) @@ -74,6 +74,7 @@ def generate_sidebar(conf, conf_api): write_api('utilities', 'Utilities') write_api('pyfrc', 'PyFRC') write_api('ctre', 'CTRE Libraries') + write_api('navx', 'NavX Library') endl() toctree('Additional Info')
Update doc sidebar to include NavX + https
robotpy_pyfrc
train
py