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
509f05507968034f9b775e6325ec2f033d1159a7
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -423,7 +423,6 @@ let currentParser = null let currentBufferRef = null let currentBufferSize = 16384 let currentBufferPtr = llhttp.exports.malloc(currentBufferSize) -let currentBufferView = new Uint8Array(llhttp.exports.memory.buffer, currentBufferPtr, currentBufferSize) const TIMEOUT_HEADERS = 1 const TIMEOUT_BODY = 2 @@ -506,11 +505,10 @@ class Parser { llhttp.exports.free(currentBufferPtr) currentBufferSize = Math.ceil(data.length / 4096) * 4096 currentBufferPtr = llhttp.exports.malloc(currentBufferSize) - currentBufferView = new Uint8Array(llhttp.exports.memory.buffer, currentBufferPtr, currentBufferSize) } // TODO (perf): Can we avoid this copy somehow? - currentBufferView.set(data) + new Uint8Array(llhttp.exports.memory.buffer, currentBufferPtr, currentBufferSize).set(data) // Call `execute` on the wasm parser. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
fix: detached buffer error (#<I>) Somehow the error "Cannot perform %TypedArray%.prototype.set on a detached ArrayBuffer" occurs when using a saved buffer view.
mcollina_undici
train
js
c3e8052ea7f7931b19ee64148bcec6b1627c748b
diff --git a/db.php b/db.php index <HASH>..<HASH> 100644 --- a/db.php +++ b/db.php @@ -189,7 +189,7 @@ class Db { ,$table ,implodei(',',self::escape(array_keys($params))) ,rtrim(str_repeat('?,',count($params)),',') - ,implodei('=?,',self::escape(array_keys($params))) + ,implodei('=?,',self::escape(array_keys($params))).'=?' ); $this->run($stmt,array_merge(array_values($params),array_values($params))); return $this->lastInsertId();
new account management structure with db structure added brand management added tax class management added tax rule management added currency management move src. to func.d which is the proper name restructured form helpers added FormCheckbox helper
nullivex_lib-db
train
php
dae309ee30820a2675f8527742b213324335cccc
diff --git a/test/jetstream_test.go b/test/jetstream_test.go index <HASH>..<HASH> 100644 --- a/test/jetstream_test.go +++ b/test/jetstream_test.go @@ -2156,6 +2156,14 @@ func TestJetStreamPullConsumerRemoveInterest(t *testing.T) { // This is using new style request mechanism. so drop the connection itself to get rid of interest. nc.Close() + // Wait for client cleanup + checkFor(t, 200*time.Millisecond, 10*time.Millisecond, func() error { + if n := s.NumClients(); err != nil || n != 0 { + return fmt.Errorf("Still have %d clients", n) + } + return nil + }) + nc = clientConnectToServer(t, s) defer nc.Close() // Send a message
Fix flapper, wait for no clients
nats-io_gnatsd
train
go
444c05ff59fe95e018e3ea820161c322f7572f05
diff --git a/packages/components/bolt-trigger/__tests__/trigger.e2e.js b/packages/components/bolt-trigger/__tests__/trigger.e2e.js index <HASH>..<HASH> 100644 --- a/packages/components/bolt-trigger/__tests__/trigger.e2e.js +++ b/packages/components/bolt-trigger/__tests__/trigger.e2e.js @@ -13,6 +13,7 @@ module.exports = { `${testingUrl}/pattern-lab/patterns/02-components-trigger-30-trigger-advanced-usage/02-components-trigger-30-trigger-advanced-usage.html`, ) .waitForElementVisible('bolt-trigger[on-click="show"]', 2000) + .pause(1000) .click('bolt-trigger[on-click="show"]') .pause(1000) .execute(
test: try waiting for lazy images to load
bolt-design-system_bolt
train
js
4437d2c6752cfc1b39221dc95fa78221c471d5bd
diff --git a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java b/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java index <HASH>..<HASH> 100644 --- a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java +++ b/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java @@ -1193,13 +1193,13 @@ public abstract class IPAddress extends Address implements IPAddressSegmentSerie IntFunction<T[]> arrayProducer) { T result = null; if(container.isPrefixed()) { - if(container.isPrefixBlock()) { + if(container.isSinglePrefixBlock()) { result = container; } - } else if(checkEqual && contained.isPrefixed() && container.equals(contained) && contained.isPrefixBlock()) { + } else if(checkEqual && contained.isPrefixed() && container.equals(contained) && contained.isSinglePrefixBlock()) { result = contained; } else { - result = prefixAdder.apply(container);//returns null if cannot be a prefix block + result = prefixAdder.apply(container); // returns null if cannot be a prefix block } if(result != null) { T resultArray[] = arrayProducer.apply(1);
spanner should break up set when supplied a set of blocks
seancfoley_IPAddress
train
java
c309d6be19b30a5082613e8c64595f44097d539d
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -10,6 +10,7 @@ attempts = 0 begin ActiveRecord::Base.establish_connection({ adapter: "mysql2", + username: "root", database: "github_ds_test", }) ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS `key_values`") @@ -20,6 +21,7 @@ rescue raise if attempts >= 1 ActiveRecord::Base.establish_connection({ adapter: "mysql2", + username: "root", }) ActiveRecord::Base.connection.execute("CREATE DATABASE `github_ds_test`") attempts += 1
Add username to ar connection I noticed some denied errors when missing this.
github_github-ds
train
rb
043d118d5224f8d84cc927ae98b17b5b401216c3
diff --git a/modules/pprof/app/controllers/pprof.go b/modules/pprof/app/controllers/pprof.go index <HASH>..<HASH> 100644 --- a/modules/pprof/app/controllers/pprof.go +++ b/modules/pprof/app/controllers/pprof.go @@ -10,13 +10,6 @@ type Pprof struct { *revel.Controller } -const ( - index = 0 - profile = 1 - symbol = 2 - cmdline = 3 -) - // The PprofHandler type makes it easy to call the net/http/pprof handler methods // since they all have the same method signature type PprofHandler func(http.ResponseWriter, *http.Request)
Removed pprof constants
revel_revel
train
go
3341d933ba482b6549df9d28dcbce2016e9f6429
diff --git a/salt/modules/event.py b/salt/modules/event.py index <HASH>..<HASH> 100644 --- a/salt/modules/event.py +++ b/salt/modules/event.py @@ -12,18 +12,14 @@ def fire_master(data, tag): ''' Fire an event off on the master server ''' - serial = salt.payload.Serial(__opts__) - context = zmq.Context() - socket = context.socket(zmq.REQ) - socket.connect(__opts__['master_uri']) load = {'id': __opts__['id'], 'tag': tag, 'data': data, 'cmd': '_minion_event'} auth = salt.crypt.SAuth(__opts__) - payload = {'enc': 'aes'} - payload['load'] = auth.crypticle.dumps(load) - auth = salt.crypt.SAuth(__opts__) - socket.send(serial.dumps(payload)) - socket.recv() + sreq = salt.payload.SREQ(__opts__['master_uri']) + try: + sreq.send('aes', auth.crypticle.dumps(load)) + except: + pass return True
use new sreq in event system
saltstack_salt
train
py
1523c372134c4eebd535589acd22bf3405414fcd
diff --git a/src/mixins/input.js b/src/mixins/input.js index <HASH>..<HASH> 100644 --- a/src/mixins/input.js +++ b/src/mixins/input.js @@ -136,7 +136,9 @@ export default { data = Object.assign({}, { 'class': this.inputGroupClasses, attrs: { - tabindex: this.internalTabIndex || this.tabindex + tabindex: this.disabled + ? -1 + : this.internalTabIndex || this.tabindex }, on: { focus: this.groupFocus,
removed ability to tab to form components when they are disabled
vuetifyjs_vuetify
train
js
69c8b6b3d1a14535e02ccdc49f85bfbfc9e71b08
diff --git a/actioncable/lib/action_cable/connection/authorization.rb b/actioncable/lib/action_cable/connection/authorization.rb index <HASH>..<HASH> 100644 --- a/actioncable/lib/action_cable/connection/authorization.rb +++ b/actioncable/lib/action_cable/connection/authorization.rb @@ -5,7 +5,7 @@ module ActionCable module Authorization class UnauthorizedError < StandardError; end - # Closes the WebSocket connection if it is open and returns a 404 "File not Found" response. + # Closes the WebSocket connection if it is open and returns an "unauthorized" reason. def reject_unauthorized_connection logger.error "An unauthorized connection attempt was rejected" raise UnauthorizedError
Correct the description for reject_unauthorized_connection
rails_rails
train
rb
1a52a7747f8e3fc97ad1ab81f08837bf83a8825f
diff --git a/uncommitted/__init__.py b/uncommitted/__init__.py index <HASH>..<HASH> 100644 --- a/uncommitted/__init__.py +++ b/uncommitted/__init__.py @@ -68,6 +68,11 @@ contribute additional detection and scanning routines. Changelog --------- +**1.5** (2013 Oct 29) + +- Fix Subversion support under Python 3. +- Add Subversion to the test suite. + **1.4** (2013 Oct 5) - Made ``-w`` the default, not ``-l``. @@ -95,4 +100,4 @@ Changelog """ -__version__ = '1.4' +__version__ = '1.5'
Bump to <I> and add changelog entry
brandon-rhodes_uncommitted
train
py
8ffa919fc83ef42f0dcdfeb345a63ee9f66d0f04
diff --git a/src/FormBlueprint.php b/src/FormBlueprint.php index <HASH>..<HASH> 100644 --- a/src/FormBlueprint.php +++ b/src/FormBlueprint.php @@ -159,11 +159,38 @@ class FormBlueprint implements FormBlueprintInterface */ public function remove($name) { - unset($this->fields[$name]); + if (strpos($name, '[') !== false) { + $names = $this->explodeFieldNameArray($name); + + $first = array_shift($names); + + if (!isset($this->fields[$first])) { + return $this; + } + + $parent =& $this->recursiveFindParent($this->fields[$first], $names); + + $field = array_pop($names); + + unset($parent['fields'][$field]); + } else { + unset($this->fields[$name]); + } return $this; } + private function &recursiveFindParent(&$field, $name) + { + array_shift($name); + + if (count($name) === 0) { + return $field; + } + + return $this->recursiveFindParent($field, $name); + } + /** * {@inheritdoc} */
FormBlueprint::remove now works recursively
andyvenus_form
train
php
35771144b4b306e9be6b8ba49c11d219f8e6d306
diff --git a/src/net/bootsfaces/component/Button.java b/src/net/bootsfaces/component/Button.java index <HASH>..<HASH> 100644 --- a/src/net/bootsfaces/component/Button.java +++ b/src/net/bootsfaces/component/Button.java @@ -32,6 +32,7 @@ import static net.bootsfaces.render.A.DISABLED; import static net.bootsfaces.render.A.FRAGMENT; import static net.bootsfaces.render.A.ICON; import static net.bootsfaces.render.A.ICON_ALIGN; +import static net.bootsfaces.render.A.ICONAWESOME; import static net.bootsfaces.render.A.LOOK; import static net.bootsfaces.render.A.RIGHT; import static net.bootsfaces.render.A.SIZE; @@ -137,7 +138,7 @@ public class Button extends HtmlOutcomeTargetButton { renderPassThruAttributes(context, this, ALLBUTTON_ATTRS); String icon = asString(attrs.get(ICON)); - String faicon = A.asString(attrs.get(A.ICONAWESOME)); + String faicon = A.asString(attrs.get(ICONAWESOME)); boolean fa=false; //flag to indicate wether the selected icon set is Font Awesome or not. if(faicon != null) { icon=faicon; fa=true; } if (icon != null) {
Add Font Awesome support to Button and CommandButton.
TheCoder4eu_BootsFaces-OSP
train
java
591a0c62dc652ccfc21480c604cf1cf1829242d3
diff --git a/test-support/page-object.js b/test-support/page-object.js index <HASH>..<HASH> 100644 --- a/test-support/page-object.js +++ b/test-support/page-object.js @@ -61,6 +61,7 @@ export default { notHasClass, selectable, text, + triggerable, value, visitable };
Export triggerable property in test-support
san650_ember-cli-page-object
train
js
cfd44e5337906de5ca853f2c98faa9d5c82b0115
diff --git a/lib/decorators/data-connect.js b/lib/decorators/data-connect.js index <HASH>..<HASH> 100644 --- a/lib/decorators/data-connect.js +++ b/lib/decorators/data-connect.js @@ -109,6 +109,12 @@ export default function dataConnect (...args) { }; } + shouldComponentUpdate (nextProps, nextState) { + const notLoading = !this.state.loading; + const finishedLoading = this.state.loading && !nextState.loading; + return notLoading || finishedLoading; + } + componentWillUnmount () { this.context.store.dispatch(removeConnector(this.CONNECTOR_ID)); }
fix re render on setting loading state by preventing updates while loading #9
relax_relate
train
js
d4e4daff938a55a0f05c1116f4b17a897a13138b
diff --git a/src/main/java/com/maxmind/geoip/LookupService.java b/src/main/java/com/maxmind/geoip/LookupService.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/maxmind/geoip/LookupService.java +++ b/src/main/java/com/maxmind/geoip/LookupService.java @@ -403,6 +403,20 @@ public class LookupService { } /** + * @return The list of all known country names + */ + public String[] getAllCountryNames() { + return countryName; + } + + /** + * @return The list of all known country codes + */ + public String[] getAllCountryCodes() { + return countryCode; + } + + /** * Returns the country the IP address is in. * * @param ipAddress
Added accessors to the list of all country names and codes
maxmind_geoip-api-java
train
java
3bd9929cc69671681a147e8f9f011d4bf80393dd
diff --git a/resources/skins/smokygrey/Render.php b/resources/skins/smokygrey/Render.php index <HASH>..<HASH> 100644 --- a/resources/skins/smokygrey/Render.php +++ b/resources/skins/smokygrey/Render.php @@ -103,7 +103,7 @@ class Render extends \Brainworxx\Krexx\View\Render $template = str_replace('{additional}', $model->getAdditional(), $template); // There is not much need for a connector to an empty name. - if (empty($model->getName()) && $model->getName() != 0) { + if ($model->getName() == '' && $model->getName() != 0) { $template = str_replace('{connector1}', '', $template); $template = str_replace('{connector2}', '', $template); } else {
Fixed finding for php <I>
brainworxx_kreXX
train
php
ee512b62dd73935b08631e69af6eee74edb49a2a
diff --git a/pysher/connection.py b/pysher/connection.py index <HASH>..<HASH> 100755 --- a/pysher/connection.py +++ b/pysher/connection.py @@ -125,7 +125,7 @@ class Connection(Thread): self.socket.keep_running = True self.socket.run_forever(**self.socket_kwargs) - def _on_open(self, wp): + def _on_open(self, *args): self.logger.info("Connection: Connection opened") # Send a ping right away to inform that the connection is alive. If you @@ -134,12 +134,13 @@ class Connection(Thread): self.send_ping() self._start_timers() - def _on_error(self, wp, error): - self.logger.info("Connection: Error - %s" % error) + def _on_error(self, *args): + self.logger.info("Connection: Error - %s" % args[-1]) self.state = "failed" self.needs_reconnect = True - def _on_message(self, wp, message): + def _on_message(self, *args): + message = args[-1] self.logger.info("Connection: Message - %s" % message) # Stop our timeout timer, since we got some data
Updated methods to support new version of websocket-client library and keep compatibility with older versions
nlsdfnbch_Pysher
train
py
cc72298e1229aad5d7239e3e15a27c2505936892
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js +++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/eslint/validator.js @@ -93,9 +93,10 @@ define([ } catch (e) { error = e; } - problems = problems.concat(extractParseErrors(ast)); + var parseErrors = extractParseErrors(ast); + problems = problems.concat(parseErrors); problems = problems.map(toProblem); - if (error) { + if (error && !parseErrors.length) { // Warn about ESLint failure problems.push({ start: 0,
[Bug <I>] only reveal internal ESLint error when there's no parse errors to show
eclipse_orion.client
train
js
5cf1bf29e3324a6cc1e40c01c4529b28ca0b47a5
diff --git a/test/op.js b/test/op.js index <HASH>..<HASH> 100644 --- a/test/op.js +++ b/test/op.js @@ -44,6 +44,10 @@ test('double operators', function (t) { parse('beep\\&&boop||byte'), [ 'beep&', { op: '&' }, 'boop', { op: '||' }, 'byte' ] ); + t.same( + parse('beep;;boop|&byte'), + [ 'beep', { op: ';;' }, 'boop', { op: '|&' }, 'byte' ] + ); t.end(); });
another double-char op test just to be sure
substack_node-shell-quote
train
js
8b943fb1c3f178363b0322ce63a606064965bab7
diff --git a/src/reducer/admin/resource/list/ids.js b/src/reducer/admin/resource/list/ids.js index <HASH>..<HASH> 100644 --- a/src/reducer/admin/resource/list/ids.js +++ b/src/reducer/admin/resource/list/ids.js @@ -14,9 +14,9 @@ export default resource => ( case CRUD_GET_LIST_SUCCESS: return payload.data.map(record => record.id); case CRUD_DELETE_SUCCESS: { - const index = previousState.findIndex( - el => el == requestPayload.id - ); // eslint-disable-line eqeqeq + const index = previousState + .map(el => el == requestPayload.id) // eslint-disable-line eqeqeq + .indexOf(true); if (index === -1) { return previousState; }
Fix delete reducer on IE<I> Closes #<I>
marmelab_react-admin
train
js
da3802dbaeafc84018e23c2400027ec73a45051c
diff --git a/question/type/shortanswer/edit_shortanswer_form.php b/question/type/shortanswer/edit_shortanswer_form.php index <HASH>..<HASH> 100644 --- a/question/type/shortanswer/edit_shortanswer_form.php +++ b/question/type/shortanswer/edit_shortanswer_form.php @@ -76,7 +76,7 @@ class question_edit_shortanswer_form extends question_edit_form { $maxgrade = false; foreach ($answers as $key => $answer) { $trimmedanswer = trim($answer); - if (!empty($trimmedanswer)){ + if ($trimmedanswer !== ''){ $answercount++; if ($data['fraction'][$key] == 1) { $maxgrade = true;
MDL-<I> - Short Answer questions will not allow 0 as the sole answer. Merged from MOODLE_<I>_STABLE.
moodle_moodle
train
php
f9751c0a908e500d904e2ec5963424093b1b1aa7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ from setuptools import setup import os import sys +import codecs from progression import __version__ @@ -18,7 +19,7 @@ version = __version__ __this__ = os.path.abspath(os.path.dirname(__file__)) # Get the long description from the relevant file -with open(os.path.join(__this__, 'README.rst')) as f: +with codecs.open(os.path.join(__this__, 'README.rst'), encoding='utf-8') as f: long_description = f.read() if __name__ == "__main__":
do include encoding when opening README.rst via codecs as suggested by #1 (fixes #1)
cimatosa_progression
train
py
ff38aa6a5b2639f81eb137bdb906f3d8fecd1776
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100755 --- a/src/index.js +++ b/src/index.js @@ -153,14 +153,11 @@ const idyll = (inputPath, opts, cb) => { const getComponents = (ast) => { const ignoreNames = ['var', 'data', 'meta', 'derived']; - // component node names begin with capital letters const componentNodes = getNodesByName(s => !ignoreNames.includes(s), ast); return componentNodes.reduce( (acc, node) => { const name = changeCase.paramCase(node[0]); - const props = node[1]; - const children = node[2] || []; if (!acc[name]) { if (inputConfig.components[name]) {
Remove outdated comment and unused props
idyll-lang_idyll
train
js
40d0a31684cb3f7a7323d43965a8cebfa75164ef
diff --git a/lib/defaults.js b/lib/defaults.js index <HASH>..<HASH> 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -49,5 +49,6 @@ module.exports = , autoCacheClean: false , development: true , version: require('../package.json').version + , detectGlobals: true } diff --git a/lib/transform/globals.js b/lib/transform/globals.js index <HASH>..<HASH> 100644 --- a/lib/transform/globals.js +++ b/lib/transform/globals.js @@ -9,6 +9,8 @@ var processEnvPattern = /\bprocess\.env\b/ , __dirnamePattern = /\b__dirname\b/ module.exports = function (config) { + if(!config.detectGlobals) return through.obj() + return through.obj(function(file, enc, next) { if(file.isNull()) { this.push(file)
config.detectGlobals is now configurable
damianbaar_re-define
train
js,js
1c57d46b6f42269e01d44eee06684174511ef94e
diff --git a/project_generator/tools/tool.py b/project_generator/tools/tool.py index <HASH>..<HASH> 100644 --- a/project_generator/tools/tool.py +++ b/project_generator/tools/tool.py @@ -109,7 +109,7 @@ class Exporter(object): def _expand_data(self, old_data, new_data, group): """ data expansion - uvision needs filename and path separately. """ - for file in sum(old_data.values(), []): + for file in old_data: if file: extension = file.split(".")[-1].lower() if extension in self.file_types.keys(): @@ -145,7 +145,8 @@ class Exporter(object): group = 'Sources' else: group = k - self._expand_data(data[attribute], expanded_data, group) + if group in data[attribute].keys(): + self._expand_data(data[attribute][group], expanded_data, group) for k, v in data['include_files'].items(): if k == None: group = 'Includes'
Only pass in what you need to _expand_data
project-generator_project_generator
train
py
fde324f811e31adc04ad30eead0cc8c80d375bc0
diff --git a/src/syncronizer/index.js b/src/syncronizer/index.js index <HASH>..<HASH> 100644 --- a/src/syncronizer/index.js +++ b/src/syncronizer/index.js @@ -139,7 +139,7 @@ class Syncronizer { return function (callback) { Q.spawn(function* () { var result = yield this.dockerRemote.loadImage(outputPath, imageId); - iProgress(1); + iProgress && iProgress(1); callback(null, result); }.bind(this)); }.bind(this);
Check iProgress before use it
azukiapp-labs_docker-registry-downloader
train
js
1c4f1c191b3d8297f069cc482ee3e5483d4cd1ea
diff --git a/cf/trace/trace_test.go b/cf/trace/trace_test.go index <HASH>..<HASH> 100644 --- a/cf/trace/trace_test.go +++ b/cf/trace/trace_test.go @@ -125,7 +125,7 @@ grant_type=password&password=[PRIVATE DATA HIDDEN]&scope=&username=mgehard%2Bcli Expect(Sanitize(request)).To(Equal(expected)) }) - It("hides paswords in the JSON-formatted request body", func() { + It("hides passwords in the JSON-formatted request body", func() { request := ` REQUEST: [2014-03-07T10:53:36-08:00] PUT /Users/user-guid-goes-here/password HTTP/1.1 @@ -143,12 +143,12 @@ PUT /Users/user-guid-goes-here/password HTTP/1.1 Expect(Sanitize(request)).To(Equal(expected)) }) - It("hides pasword containing \" in the JSON-formatted request body", func() { + It("hides password containing \" in the JSON-formatted request body", func() { request := ` REQUEST: [2014-03-07T10:53:36-08:00] PUT /Users/user-guid-goes-here/password HTTP/1.1 -{"password":"stanleys"PasswordIsCool","oldPassword":"stanleypassword!"} +{"password":"stanleys\"PasswordIsCool","oldPassword":"stanleypassword!"} ` expected := `
typo fixed json test for password containing double quote is now standard
cloudfoundry_cli
train
go
2e997410f28efe8106fc606d21cb655be1b05dee
diff --git a/future.go b/future.go index <HASH>..<HASH> 100644 --- a/future.go +++ b/future.go @@ -84,9 +84,10 @@ func (e errorFuture) Index() uint64 { // deferError can be embedded to allow a future // to provide an error in the future. type deferError struct { - err error - errCh chan error - responded bool + err error + errCh chan error + responded bool + ShutdownCh chan struct{} } func (d *deferError) init() { @@ -103,7 +104,11 @@ func (d *deferError) Error() error { if d.errCh == nil { panic("waiting for response on nil channel") } - d.err = <-d.errCh + select { + case d.err = <-d.errCh: + case <-d.ShutdownCh: + d.err = ErrRaftShutdown + } return d.err } diff --git a/snapshot.go b/snapshot.go index <HASH>..<HASH> 100644 --- a/snapshot.go +++ b/snapshot.go @@ -146,6 +146,7 @@ func (r *Raft) takeSnapshot() (string, error) { // We have to use the future here to safely get this information since // it is owned by the main thread. configReq := &configurationsFuture{} + configReq.ShutdownCh = r.shutdownCh configReq.init() select { case r.configurationsCh <- configReq:
futures can react to shutdown (#<I>)
hashicorp_raft
train
go,go
42218a4a7ee42b76f8f5ec00561dd9ea657f14f1
diff --git a/test/ci_compression.js b/test/ci_compression.js index <HASH>..<HASH> 100644 --- a/test/ci_compression.js +++ b/test/ci_compression.js @@ -1,4 +1,4 @@ -// Copyright © 2017 IBM Corp. All rights reserved. +// Copyright © 2017, 2018 IBM Corp. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ const u = require('./citestutils.js'); const p = u.p(params, {compression: true}); it('should backup animaldb to a compressed file', function(done) { - // Allow up to 60 s for backup and restore of animaldb - u.setTimeout(this, 40); + // Allow up to 60 s for backup of animaldb + u.setTimeout(this, 60); const compressedBackup = `./${this.fileName}`; const output = fs.createWriteStream(compressedBackup); output.on('open', function() { @@ -59,7 +59,7 @@ const u = require('./citestutils.js'); it('should backup and restore largedb2g via a compressed file #slower', function(done) { // Takes ~ 25 min using CLI, but sometimes over an hour with API - u.setTimeout(this, 90 * 60); + u.setTimeout(this, 180 * 60); const compressedBackup = `./${this.fileName}`; params.compression = true; u.testBackupAndRestoreViaFile(p, 'largedb2g', compressedBackup, this.dbName, done);
Updated compression test timeouts Fixed comment and adjusted timeout to match for backup to compressed file. Doubled timeout on 2 GB compression test because it has been timing out in the API mode on the slow docker executors.
cloudant_couchbackup
train
js
a32a183662d0d4329705dcb595b7e8b1c579fccb
diff --git a/src/js/BrowserUtils.js b/src/js/BrowserUtils.js index <HASH>..<HASH> 100644 --- a/src/js/BrowserUtils.js +++ b/src/js/BrowserUtils.js @@ -1,5 +1,12 @@ goog.provide('axs.browserUtils'); +/** + * Use Firefox matcher when Webkit is not supported. + * @constructor + * @param {Node} node + * @param {String} selector + * @returns {Boolean} + */ axs.browserUtils.matchSelector = function(node, selector) { if(node.webkitMatchesSelector){ return node.webkitMatchesSelector(selector);
Adding jsdoc comments.
GoogleChrome_accessibility-developer-tools
train
js
2ea4e93342d61e933c0fbdef30ed5eb5cdbc4fd0
diff --git a/safe/engine/interpolation.py b/safe/engine/interpolation.py index <HASH>..<HASH> 100644 --- a/safe/engine/interpolation.py +++ b/safe/engine/interpolation.py @@ -94,7 +94,7 @@ def assign_hazard_values_to_exposure_data(hazard, exposure, # Make sure attribute name can be stored in a shapefile if attribute_name is not None and len(attribute_name) > 10: - msg = ('Specfied attribute name "%s"\ + msg = ('Specified attribute name "%s"\ has length = %i. ' 'To fit into a shapefile it must be at most 10 characters ' 'long. How about naming it "%s"?' % (attribute_name, @@ -402,6 +402,8 @@ def interpolate_raster_vector_points(source, target, N = len(target) if attribute_name is None: attribute_name = source.get_name() + # FIXME (Ole): Launder for shape files + attribute_name = str(attribute_name[:10]) try: values = interpolate_raster(longitudes, latitudes, A,
Added explicit laundering of attribute_name for shapefiles (grrr)
inasafe_inasafe
train
py
931daa6ac425edbbce49fec5b2d37079e43bbafb
diff --git a/pkg/oc/bootstrap/docker/openshift/ansible.go b/pkg/oc/bootstrap/docker/openshift/ansible.go index <HASH>..<HASH> 100644 --- a/pkg/oc/bootstrap/docker/openshift/ansible.go +++ b/pkg/oc/bootstrap/docker/openshift/ansible.go @@ -51,6 +51,9 @@ openshift_metrics_hawkular_hostname={{.HawkularHostName}} [nodes] {{.MasterIP}} + +[etcd] +{{.MasterIP}} ` const defaultLoggingInventory = ` @@ -82,6 +85,9 @@ openshift_logging_kibana_hostname={{.KibanaHostName}} [nodes] {{.MasterIP}} + +[etcd] +{{.MasterIP}} ` type ansibleLoggingInventoryParams struct {
fixes #<I>. Add etcd section to inventory for 'oc cluster up'
openshift_origin
train
go
1e5c274f59c0fe1764bea6bf778d11d0c0fc0b4f
diff --git a/activerecord/test/cases/forbidden_attributes_protection_test.rb b/activerecord/test/cases/forbidden_attributes_protection_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/forbidden_attributes_protection_test.rb +++ b/activerecord/test/cases/forbidden_attributes_protection_test.rb @@ -1,7 +1,11 @@ require 'cases/helper' require 'active_support/core_ext/hash/indifferent_access' -require 'models/person' + require 'models/company' +require 'models/person' +require 'models/ship' +require 'models/ship_part' +require 'models/treasure' class ProtectedParams attr_accessor :permitted
Fix more test failures caused by #<I>
rails_rails
train
rb
3548ed7d31bde74076dd2cf9aab77e2916c8dbec
diff --git a/srp/_pysrp.py b/srp/_pysrp.py index <HASH>..<HASH> 100644 --- a/srp/_pysrp.py +++ b/srp/_pysrp.py @@ -202,7 +202,9 @@ def HNxorg( hash_class, N, g ): def gen_x( hash_class, salt, username, password ): - return H( hash_class, salt, H( hash_class, username.encode() + six.b(':') + password.encode() ) ) + username = username.encode() if hasattr(username, 'encode') else username + password = password.encode() if hasattr(password, 'encode') else password + return H( hash_class, salt, H( hash_class, username + six.b(':') + password ) ) @@ -220,9 +222,10 @@ def create_salted_verification_key( username, password, hash_alg=SHA1, ng_type=N def calculate_M( hash_class, N, g, I, s, A, B, K ): + I = I.encode() if hasattr(I, 'encode') else I h = hash_class() h.update( HNxorg( hash_class, N, g ) ) - h.update( hash_class(I.encode()).digest() ) + h.update( hash_class(I).digest() ) h.update( long_to_bytes(s) ) h.update( long_to_bytes(A) ) h.update( long_to_bytes(B) )
Fix _pysrp encoding as well
cocagne_pysrp
train
py
de9f3de9190df3aced30ac4bd961c9ad141e3ae9
diff --git a/model/DOMImporter.js b/model/DOMImporter.js index <HASH>..<HASH> 100644 --- a/model/DOMImporter.js +++ b/model/DOMImporter.js @@ -596,6 +596,10 @@ DOMImporter.State.Prototype = function() { this.contexts.pop(); }; + this.getCurrentElementContext = function() { + return last(this.contexts); + }; + }; oo.initClass(DOMImporter.State);
Added a helper to DOMImporter.state to get current element context.
substance_substance
train
js
cec5d7a12a279a2049486d7cc3086f73fe11a3c1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -47,6 +47,9 @@ module.exports = { needsPolyfill = true; } }); + } else { + debug(`target browsers was not found. including polyfill as a fallback.`); + needsPolyfill = true; } if (needsPolyfill) {
If targets.browsers is not found included the polyfill
thoov_ember-weakmap
train
js
a7e726cd56dc075ca8d43d5c8ed033502a74fb05
diff --git a/bcbio/srna/sample.py b/bcbio/srna/sample.py index <HASH>..<HASH> 100644 --- a/bcbio/srna/sample.py +++ b/bcbio/srna/sample.py @@ -170,8 +170,9 @@ def _align(infile, ref, out_file, data): if not razers3: logger.info("razers3 is not installed, skipping BAM file creation") return None - with file_transaction(data, out_file) as tx_out: - do.run(cmd.format(**locals()), "Running razers3 against hairpins with %s" % infile) + if not file_exists(out_file): + with file_transaction(data, out_file) as tx_out: + do.run(cmd.format(**locals()), "Running razers3 against hairpins with %s" % infile) return out_file def _miraligner(fastq_file, out_file, species, db_folder, config):
sRNA:skipt razer3 when it's done.
bcbio_bcbio-nextgen
train
py
eabf7e154c09ec897b47d4ee51c9dad642835250
diff --git a/lib/validation.js b/lib/validation.js index <HASH>..<HASH> 100644 --- a/lib/validation.js +++ b/lib/validation.js @@ -176,11 +176,23 @@ module.exports.process = function (validationModel, req, options) { keys.splice(index, 1); } }); - if (options.forbidUndefinedVariables === true) { - keys.forEach(function(key) { - addError(_createError(realScope, key, { name: "undefinedVariable" })); - }); - } + if (options.forbidUndefinedVariables === true) { + keys.forEach(function(key) { + var invalid = true; + + // check if key exist in some other scope in the validationModel + _.each(validationModel, function (validationModelScope) { + if (key in validationModelScope) { + invalid = false; + } + }); + + // flag key as undefined if it didn't show up in another scope + if (invalid) { + addError(_createError(realScope, key, { name: "undefinedVariable" })); + } + }); + } } }); return errors;
Fix bug with forbidUndefinedVariables (#<I>) The forbidUndefinedVariables check wrongly flagged keys that existed in other scopes as undefined, this fix checks for the key in the other scopes of the validationModel before flagging it as undefined.
z0mt3c_node-restify-validation
train
js
890d3a25c425ad28b9f0679f2ac70802223c9dc5
diff --git a/packages/d3fc-webgl/src/buffers/constantAttribute.js b/packages/d3fc-webgl/src/buffers/constantAttribute.js index <HASH>..<HASH> 100644 --- a/packages/d3fc-webgl/src/buffers/constantAttribute.js +++ b/packages/d3fc-webgl/src/buffers/constantAttribute.js @@ -1,9 +1,9 @@ import baseAttributeBuilder from './baseAttribute'; import { rebind } from '@d3fc/d3fc-rebind'; -export default () => { +export default initialValue => { const base = baseAttributeBuilder().divisor(1); - let value = null; + let value = initialValue; const constantAttribute = programBuilder => { base(programBuilder);
feat: support initialValue for constantAttribute
d3fc_d3fc
train
js
d5303324a00332d15e5ef349bc9f419d5c3ee292
diff --git a/src/main/java/com/semanticcms/news/view/NewsView.java b/src/main/java/com/semanticcms/news/view/NewsView.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/semanticcms/news/view/NewsView.java +++ b/src/main/java/com/semanticcms/news/view/NewsView.java @@ -50,7 +50,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.jsp.SkipPageException; import org.joda.time.ReadableInstant; -public class NewsView extends View { +public final class NewsView extends View { public static final String NAME = "news"; @@ -68,7 +68,9 @@ public class NewsView extends View { } } - private NewsView() {} + private NewsView() { + // Do nothing + } @Override public Group getGroup() {
Reviewed all empty blocks of code per SonarCloud code analysis 1) Removed unnecessary public constructors 2) Deprecated public constructors that must remain for implementation but are not intended for direct use 3) Classes with private constructors set either final (if has instances) or abstract (for no instances) 4) Commented "Do nothing" where implementation required but does nothing
aoindustries_semanticcms-news-view
train
java
9a9165cc3002bec70db306eb2b2b238aae7c5e8c
diff --git a/resources/volume/volume.go b/resources/volume/volume.go index <HASH>..<HASH> 100644 --- a/resources/volume/volume.go +++ b/resources/volume/volume.go @@ -157,11 +157,12 @@ func (rp ResourcePlans) RollbackChangesOnNode(node *types.Node, indices ...int) // Dispense . func (rp ResourcePlans) Dispense(opts resourcetypes.DispenseOptions, r *types.ResourceMeta) (*types.ResourceMeta, error) { + r.VolumeRequest = rp.request + r.VolumeLimit = rp.limit if len(rp.plan) == 0 { return r, nil } - r.VolumeRequest = rp.request r.VolumePlanRequest = rp.plan[opts.Node.Name][opts.Index] // if there are existing ones, ensure new volumes are compatible @@ -181,7 +182,6 @@ func (rp ResourcePlans) Dispense(opts resourcetypes.DispenseOptions, r *types.Re } // fix plans while limit > request - r.VolumeLimit = rp.limit r.VolumePlanLimit = types.VolumePlan{} for i := range rp.request { request, limit := rp.request[i], rp.limit[i]
bugfix: dispense hard volume (#<I>)
projecteru2_core
train
go
cbe94bcbb27847500587cb037cd0bcd3fd5acec0
diff --git a/src/test/java/net/openhft/chronicle/map/EventListenerTestWithTCPSocketReplication.java b/src/test/java/net/openhft/chronicle/map/EventListenerTestWithTCPSocketReplication.java index <HASH>..<HASH> 100644 --- a/src/test/java/net/openhft/chronicle/map/EventListenerTestWithTCPSocketReplication.java +++ b/src/test/java/net/openhft/chronicle/map/EventListenerTestWithTCPSocketReplication.java @@ -130,6 +130,7 @@ public class EventListenerTestWithTCPSocketReplication { } + @Test public void testAddedOriginalValueToBeOverWritten() throws IOException, InterruptedException {
HCOLL-<I> - added missing tests
OpenHFT_Chronicle-Map
train
java
651490f9614de677b770fdadb58b0afaa5b6ac30
diff --git a/app/lib/webpack/ssr/plugin.webserver-assets.js b/app/lib/webpack/ssr/plugin.webserver-assets.js index <HASH>..<HASH> 100644 --- a/app/lib/webpack/ssr/plugin.webserver-assets.js +++ b/app/lib/webpack/ssr/plugin.webserver-assets.js @@ -59,10 +59,6 @@ module.exports = class WebserverAssetsPlugin { quasar: { ssr: true } } - if (this.cfg.store) { - pkg.dependencies.vuex = cliDeps.vuex - } - if (this.cfg.ssr.extendPackageJson) { this.cfg.ssr.extendPackageJson(pkg) }
fix(app): removed vuex from ssr package.json (#<I>)
quasarframework_quasar
train
js
51810e925e5fc495822fbddda8202f70a6e4a3f3
diff --git a/etreeutils/namespace.go b/etreeutils/namespace.go index <HASH>..<HASH> 100644 --- a/etreeutils/namespace.go +++ b/etreeutils/namespace.go @@ -164,7 +164,7 @@ func detachWithNamespaces(ctx NSContext, el *etree.Element) (*etree.Element, err }) } else { attrs = append(attrs, etree.Attr{ - Key: prefix, + Key: xmlnsPrefix, Value: namespace, }) }
Fix a bug in namespaced selection
russellhaering_goxmldsig
train
go
ad19b5eadd129383bba6dcebf201f99441d66a60
diff --git a/validator/testcases/javascript/predefinedentities.py b/validator/testcases/javascript/predefinedentities.py index <HASH>..<HASH> 100644 --- a/validator/testcases/javascript/predefinedentities.py +++ b/validator/testcases/javascript/predefinedentities.py @@ -642,7 +642,7 @@ DANGEROUS_EVAL = { 'err_id': ('javascript', 'dangerous_global', 'eval'), 'description': ('Evaluation of strings as code can lead to security ' 'vulnerabilities and performance issues, even in the ' - 'most innocuous of circumstances. Please avoid using ', + 'most innocuous of circumstances. Please avoid using ' '`eval` and the `Function` constructor when at all ' 'possible.', 'Alternatives are available for most use cases. See '
Remove newline in eval warning (no bug)
mozilla_amo-validator
train
py
459e0378b709697dccd7156274e0c6c469565708
diff --git a/salt/modules/disk.py b/salt/modules/disk.py index <HASH>..<HASH> 100644 --- a/salt/modules/disk.py +++ b/salt/modules/disk.py @@ -639,7 +639,7 @@ def _iostat_fbsd(interval, count, disks): continue elif not len(dev_header): dev_header = line.split()[1:] - while True: + while line is not False: line = next(ret, False) if not line or not line[0].isalnum(): break @@ -695,7 +695,7 @@ def _iostat_linux(interval, count, disks): elif line.startswith('Device:'): if not len(dev_header): dev_header = tuple(line.split()[1:]) - while True: + while line is not False: line = next(ret, False) if not line or not line[0].isalnum(): break
Add additional check to doubly surely prevent infinite loops.
saltstack_salt
train
py
ff50df9798441936c4db56d774fc93926ee32f19
diff --git a/lib/active_merchant/connection.rb b/lib/active_merchant/connection.rb index <HASH>..<HASH> 100644 --- a/lib/active_merchant/connection.rb +++ b/lib/active_merchant/connection.rb @@ -65,10 +65,10 @@ module ActiveMerchant end def request(method, body, headers = {}) - headers['connection'] ||= 'close' - request_start = Process.clock_gettime(Process::CLOCK_MONOTONIC) + headers['connection'] ||= 'close' + retry_exceptions(:max_retries => max_retries, :logger => logger, :tag => tag) do begin info "connection_http_method=#{method.to_s.upcase} connection_uri=#{endpoint}", tag
Set connection request start time at method start - Move the recording of the request start time to the beginning of `Connection#request`. This ensures that everything is instrumented and assigns the variable used in the `ensure` block as soon as possible before any possible exceptions.
activemerchant_active_merchant
train
rb
cb27fb14de1814c09037257d03250e049b29ad1d
diff --git a/Exedra/Http/UploadedFile.php b/Exedra/Http/UploadedFile.php index <HASH>..<HASH> 100644 --- a/Exedra/Http/UploadedFile.php +++ b/Exedra/Http/UploadedFile.php @@ -80,7 +80,7 @@ class UploadedFile $normalizedFiles = array(); foreach(array_keys($file['tmp_name']) as $key) - $normalizedFiles[$key] = static::normalizeFile(array( + $normalizedFiles[$key] = static::normalizeFilesTree(array( 'tmp_name' => $file['tmp_name'][$key], 'name' => $file['name'][$key], 'type' => $file['type'][$key],
Fix Http\UploadedFile unknown method call
Rosengate_exedra
train
php
19c47947b22dc0a09c9ac0a2a8ed30a7b2cbdbc3
diff --git a/lib/gcloud/storage/file/verifier.rb b/lib/gcloud/storage/file/verifier.rb index <HASH>..<HASH> 100644 --- a/lib/gcloud/storage/file/verifier.rb +++ b/lib/gcloud/storage/file/verifier.rb @@ -52,13 +52,13 @@ module Gcloud def self.md5_for local_file ::File.open(Pathname(local_file).to_path, "rb") do |f| - ::Digest::MD5.base64digest f.read + ::Digest::MD5.file(f).base64digest end end def self.crc32c_for local_file ::File.open(Pathname(local_file).to_path, "rb") do |f| - ::Digest::CRC32c.base64digest f.read + ::Digest::CRC32c.file(f).base64digest end end end
Avoid reading files into memory Don't read files into memory when generating digests. [fixes #<I>]
googleapis_google-cloud-ruby
train
rb
4a3bc3383fb6a01cfbaf5ec654bfc2a1c21d54e8
diff --git a/airflow/utils.py b/airflow/utils.py index <HASH>..<HASH> 100644 --- a/airflow/utils.py +++ b/airflow/utils.py @@ -618,11 +618,19 @@ class timeout(object): raise AirflowTaskTimeout(self.error_message) def __enter__(self): - signal.signal(signal.SIGALRM, self.handle_timeout) - signal.alarm(self.seconds) + try: + signal.signal(signal.SIGALRM, self.handle_timeout) + signal.alarm(self.seconds) + except ValueError as e: + logging.warning("timeout can't be used in the current context") + logging.exception(e) def __exit__(self, type, value, traceback): - signal.alarm(0) + try: + signal.alarm(0) + except ValueError as e: + logging.warning("timeout can't be used in the current context") + logging.exception(e) def is_container(obj):
Fixing 'signal only works in main thread' error with timeouts
apache_airflow
train
py
ae72ae01191cd1e3cff0a5e9cc8a9cd1ee081b32
diff --git a/includes/mb/class.lmsensors.inc.php b/includes/mb/class.lmsensors.inc.php index <HASH>..<HASH> 100644 --- a/includes/mb/class.lmsensors.inc.php +++ b/includes/mb/class.lmsensors.inc.php @@ -381,7 +381,7 @@ class LMSensors extends Sensors } $data = array(); preg_match("/^(.+):\s*([^\-\+\d\s].+)$/", $line, $data); - if ((count($data)>2) && ($data[1]!=="Adapter")) { + if ((count($data)>2) && ($data[1]!=="Adapter") && !preg_match("/^FAULT/", $data[2])) { $dev = new SensorDevice(); $dev->setName($data[1].$sname); if (preg_match("/(.*\s*)ALARM\s*$/", $data[2], $aldata)) {
!preg_match("/^FAULT/"
phpsysinfo_phpsysinfo
train
php
12d5766fba776dd211d8c637b82ed763c9f7ef9c
diff --git a/tests/unit/collection/InternalCollectionTest.php b/tests/unit/collection/InternalCollectionTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/collection/InternalCollectionTest.php +++ b/tests/unit/collection/InternalCollectionTest.php @@ -10,21 +10,8 @@ use Illuminate\Support\Collection; * * @author Alin Eugen Deac <aedart@gmail.com> */ -class InternalCollectionTest extends \Codeception\TestCase\Test +class InternalCollectionTest extends CollectionTestCase { - /** - * @var \UnitTester - */ - protected $tester; - - protected function _before() - { - } - - protected function _after() - { - } - /********************************************************************************* * Helpers ********************************************************************************/
Now extending the new CollectionTestCase class
aedart_util
train
php
00f2e7cc6525c14fcdb962f14929158f0adb0888
diff --git a/cmd/fluxctl/await.go b/cmd/fluxctl/await.go index <HASH>..<HASH> 100644 --- a/cmd/fluxctl/await.go +++ b/cmd/fluxctl/await.go @@ -85,10 +85,11 @@ func backoff(initialDelay, factor, maxFactor, timeout time.Duration, f func() (b if ok || err != nil { return err } - // If we will have time to try again, sleep - if time.Now().UTC().Add(delay).Before(finish) { - time.Sleep(delay) + // If we don't have time to try again, stop + if time.Now().UTC().Add(delay).After(finish) { + break } + time.Sleep(delay) } return ErrTimeout }
Break in backoff if time-to-timeout < delay
weaveworks_flux
train
go
b1ffa1a3d5395f0620ef363f58bf3a41fbbd7398
diff --git a/ryu/ofproto/ofproto_v1_3.py b/ryu/ofproto/ofproto_v1_3.py index <HASH>..<HASH> 100644 --- a/ryu/ofproto/ofproto_v1_3.py +++ b/ryu/ofproto/ofproto_v1_3.py @@ -229,8 +229,8 @@ OFPIEH_UNSEQ = 1 << 8 # Unexpected sequencing encountered. # ofp_oxm_experimenter_header OFP_OXM_EXPERIMENTER_HEADER_PACK_STR = '!II' OFP_OXM_EXPERIMENTER_HEADER_SIZE = 8 -assert (calcsize(OFP_OXM_EXPERIMENTER_HEADER_PACK_STR) + - OFP_OXM_EXPERIMENTER_HEADER_SIZE) == OFP_OXM_EXPERIMENTER_HEADER_SIZE +assert (calcsize(OFP_OXM_EXPERIMENTER_HEADER_PACK_STR) == + OFP_OXM_EXPERIMENTER_HEADER_SIZE) # enum ofp_instruction_type OFPID_GOTO_TABLE = 1 # Setup the next table in the lookup pipeline.
of<I>: fix OFP_OXM_EXPERIMENTER_HEADER_SIZE assert File "/Users/fujita/git/ryu/ryu/ofproto/ofproto_v1_3.py", line <I>, in <module> OFP_OXM_EXPERIMENTER_HEADER_SIZE) == OFP_OXM_EXPERIMENTER_HEADER_SIZE
osrg_ryu
train
py
67f6c01ced9f00a7e9ab07836d561bf154e4684c
diff --git a/lib/Packager/Packager.js b/lib/Packager/Packager.js index <HASH>..<HASH> 100644 --- a/lib/Packager/Packager.js +++ b/lib/Packager/Packager.js @@ -156,4 +156,5 @@ proto.buildLibrary = function (opts) { }).catch(function (e) { utils.fatal(e); }); + return this; }; \ No newline at end of file
ENYO-<I>: enyo-dev: Library builds failing due to Packager not returning object
enyojs_enyo-dev
train
js
f5f859c93befc6c0da8d28fff006c685e30b29e8
diff --git a/src/main/php/net/stubbles/lang/errorhandler/AbstractExceptionHandler.php b/src/main/php/net/stubbles/lang/errorhandler/AbstractExceptionHandler.php index <HASH>..<HASH> 100644 --- a/src/main/php/net/stubbles/lang/errorhandler/AbstractExceptionHandler.php +++ b/src/main/php/net/stubbles/lang/errorhandler/AbstractExceptionHandler.php @@ -67,17 +67,6 @@ abstract class AbstractExceptionHandler extends BaseObject implements ExceptionH } /** - * enables exception logging - * - * @return net\stubbles\lang\errorhandler\AbstractExceptionHandler - */ - public function enableLogging() - { - $this->loggingEnabled = true; - return $this; - } - - /** * disables exception logging * * @return net\stubbles\lang\errorhandler\AbstractExceptionHandler
remove method, logging is enabled by default
stubbles_stubbles-ioc
train
php
f961964f8f543b699374e5f6aa8f3d3cce79805a
diff --git a/troposphere/elasticache.py b/troposphere/elasticache.py index <HASH>..<HASH> 100644 --- a/troposphere/elasticache.py +++ b/troposphere/elasticache.py @@ -106,11 +106,11 @@ class ReplicationGroup(AWSObject): 'AuthToken': (basestring, False), 'AutoMinorVersionUpgrade': (boolean, False), 'AutomaticFailoverEnabled': (boolean, False), - 'CacheNodeType': (basestring, True), + 'CacheNodeType': (basestring, False), 'CacheParameterGroupName': (basestring, False), 'CacheSecurityGroupNames': ([basestring], False), 'CacheSubnetGroupName': (basestring, False), - 'Engine': (basestring, True), + 'Engine': (basestring, False), 'EngineVersion': (basestring, False), 'NodeGroupConfiguration': (list, False), 'NotificationTopicArn': (basestring, False),
Remove validation for ElastiCache::ReplicationGroup some properties (#<I>) PrimaryClusterId has exclusivity needs with other properties. As such CacheNodeType and Engine cannot be required at a property level.
cloudtools_troposphere
train
py
5c85df90d55d4e1a9ebb3306e7764699ea30c360
diff --git a/util/rbac/rbac.go b/util/rbac/rbac.go index <HASH>..<HASH> 100644 --- a/util/rbac/rbac.go +++ b/util/rbac/rbac.go @@ -470,6 +470,12 @@ func loadPolicyLine(line string, model model.Model) error { key := tokens[0] sec := key[:1] + if _, ok := model[sec]; !ok { + return fmt.Errorf("invalid RBAC policy: %s", line) + } + if _, ok := model[sec][key]; !ok { + return fmt.Errorf("invalid RBAC policy: %s", line) + } model[sec][key].Policy = append(model[sec][key].Policy, tokens[1:]) return nil }
fix: Fix a possible crash when parsing RBAC (#<I>)
argoproj_argo-cd
train
go
cdf24a2311e0fb6bbe832c9612be0597d2a66191
diff --git a/store/tree.go b/store/tree.go index <HASH>..<HASH> 100644 --- a/store/tree.go +++ b/store/tree.go @@ -293,13 +293,13 @@ func FileInfoFromHeader(hdr *tar.Header) *fileInfo { Devmajor: hdr.Devmajor, Devminor: hdr.Devminor, } - keys := make([]string, len(hdr.Xattrs)) + keys := make([]string, 0, len(hdr.Xattrs)) for k := range hdr.Xattrs { keys = append(keys, k) } sort.Strings(keys) - xattrs := make([]xattr, 0) + xattrs := make([]xattr, 0, len(keys)) for _, k := range keys { xattrs = append(xattrs, xattr{Name: k, Value: hdr.Xattrs[k]}) } @@ -373,10 +373,7 @@ func buildWalker(root string, aw specaci.ArchiveWriter) filepath.WalkFunc { r = nil } - if err := aw.AddFile(hdr, r); err != nil { - return err - } - return nil + return aw.AddFile(hdr, r) } }
store/tree.go: fix multiple things 1. fix slice make, capacity instead of length 2. preallocate slice with capacity to avoid slice growth with append 3. simplify return type
rkt_rkt
train
go
e840e7093785fb4af791091d634e33ea70c71c22
diff --git a/lib/open_xml/package.rb b/lib/open_xml/package.rb index <HASH>..<HASH> 100644 --- a/lib/open_xml/package.rb +++ b/lib/open_xml/package.rb @@ -87,6 +87,7 @@ module OpenXml file.write to_stream.string end end + alias :save :write_to def to_stream Zip::OutputStream.write_buffer do |io|
[skip] Made `Package#save` an alias for `Package#write_to` (1m)
openxml_openxml-package
train
rb
4b6c81cc312f42426f5f0179f2bd45797f88bdaf
diff --git a/rules/react.js b/rules/react.js index <HASH>..<HASH> 100644 --- a/rules/react.js +++ b/rules/react.js @@ -58,7 +58,7 @@ module.exports = { "react/jsx-closing-bracket-location": [ "warn", { "location": "after-props" } ], // Validate closing bracket location in JSX "react/jsx-curly-spacing": [ "error", "always" ], // Enforce or disallow spaces inside of curly braces in JSX attributes "react/jsx-equals-spacing": [ "error", "never" ], // Enforce or disallow spaces around equal signs in JSX attributes (fixable) - "react/jsx-filename-extension": "off", // Restrict file extensions that may contain JSX + "react/jsx-filename-extension": [ "error", { "extensions": [ ".js" ] } ], // Restrict file extensions that may contain JSX "react/jsx-first-prop-new-line": "off", // Enforce position of the first prop in JSX "react/jsx-handler-names": [ "off", { "eventHandlerPrefix": "handle", "eventHandlerPropPrefix": "on" } ], // Enforce event handler naming conventions in JSX "react/jsx-indent": [ "error", "tab" ], // Validate JSX indentation
Added rule to enforce js extension for react components
LeanKit-Labs_eslint-config-leankit
train
js
68e79c96386fe452aa750d89860c1a32324292ca
diff --git a/lib/marty/engine.rb b/lib/marty/engine.rb index <HASH>..<HASH> 100644 --- a/lib/marty/engine.rb +++ b/lib/marty/engine.rb @@ -2,9 +2,11 @@ module Marty class Engine < ::Rails::Engine isolate_namespace Marty - config.autoload_paths << File.expand_path("../../../lib", __FILE__) - config.autoload_paths << File.expand_path("../../../components", __FILE__) - config.autoload_paths << File.expand_path("../../../other", __FILE__) + # eager load paths in favor of autoload paths + config.eager_load_paths += ['lib', 'other'].map do + |dir| + File.expand_path("../../../#{dir}", __FILE__) + end # generators add rspec tests config.generators do |g|
switch to eager_load_paths
arman000_marty
train
rb
934ffd0731af3b411692dda5ca491fc60c7f7b2d
diff --git a/lib/express/pages/show-exceptions.js b/lib/express/pages/show-exceptions.js index <HASH>..<HASH> 100644 --- a/lib/express/pages/show-exceptions.js +++ b/lib/express/pages/show-exceptions.js @@ -62,15 +62,15 @@ exports.render = function(request, e) { </table> \n\ <h3>Params</h3> \n\ <table id="route-params"> \n\ - ' + hash(request.params) + ' \n\ + ' + hash(request.params.path) + ' \n\ </table> \n\ <h3>GET</h3> \n\ <table id="get-params"> \n\ - ' + hash(request.url.params) + ' \n\ + ' + hash(request.params.get) + ' \n\ </table> \n\ <h3>POST</h3> \n\ <table id="post-params"> \n\ - ' + hash(request.url.post) + ' \n\ + ' + hash(request.params.post) + ' \n\ </table> \n\ </div> \n\ </body> \n\
Fixed params in show-exception page
expressjs_express
train
js
33a83f14bcc40071ce6d118b88a94236d1c5fb42
diff --git a/lib/stack.js b/lib/stack.js index <HASH>..<HASH> 100644 --- a/lib/stack.js +++ b/lib/stack.js @@ -263,16 +263,22 @@ Stack.prototype.run = function(name, region, revision, user, finalCallback) { }); startTime = misc.getUnixTimestamp(); - self.module[taskName](self, baton, args, function onEnd() { - var args = arguments; + self.module[taskName](self, baton, args, function onEnd(err) { + var args = arguments, logObj; endTime = misc.getUnixTimestamp(); - baton.log.infof('task ${task} finished', { + logObj = { task: taskName, start_time: startTime, end_time: endTime, took: (endTime - startTime) - }); + }; + + if (err) { + logObj.err = err; + } + + baton.log.infof('task ${task} finished', logObj); callback.apply(self, args); });
if a task passes error to the callback, log it.
racker_dreadnot
train
js
3a6013de9a1c63f7ac3985cee8639fb570e70f00
diff --git a/app/models/alchemy/element.rb b/app/models/alchemy/element.rb index <HASH>..<HASH> 100644 --- a/app/models/alchemy/element.rb +++ b/app/models/alchemy/element.rb @@ -219,7 +219,6 @@ module Alchemy return true if page.nil? unless touchable_pages.include? page touchable_pages << page - save end end
Do not save element while storing touchable page This removes an unnecessary query while rendering elements.
AlchemyCMS_alchemy_cms
train
rb
d3ca14947416ea35cbe4540afe7a0a08cbfb14d8
diff --git a/src/core/Node.js b/src/core/Node.js index <HASH>..<HASH> 100644 --- a/src/core/Node.js +++ b/src/core/Node.js @@ -88,8 +88,8 @@ let Node = Mixin(Base => { return self }, - updated(oldProps, newProps, modifiedProps) { - Super(this).updated(oldProps, newProps, modifiedProps) + updated(oldProps, modifiedProps) { + Super(this).updated(oldProps, modifiedProps) if (modifiedProps.visible) { this._elementOperations.shouldRender(this.visible)
fix: forgot to update Node.updated parameters based on last commit
trusktr_infamous
train
js
bd58f00b59843480fd87311fbae620cf5f6360bb
diff --git a/src/authentication.js b/src/authentication.js index <HASH>..<HASH> 100644 --- a/src/authentication.js +++ b/src/authentication.js @@ -8,7 +8,10 @@ export class Authentication { constructor(storage, config) { this.storage = storage; this.config = config.current; - this.tokenName = this.config.tokenPrefix ? this.config.tokenPrefix + '_' + this.config.tokenName : this.config.tokenName; + } + + get tokenName() { + return this.config.tokenPrefix ? this.config.tokenPrefix + '_' + this.config.tokenName : this.config.tokenName; } getLoginRoute() {
fix(authentication): use current tokenName
SpoonX_aurelia-authentication
train
js
cab567274691e0f39e88d49eb503efbe58d5042c
diff --git a/lib/puppet/type/group.rb b/lib/puppet/type/group.rb index <HASH>..<HASH> 100755 --- a/lib/puppet/type/group.rb +++ b/lib/puppet/type/group.rb @@ -1,6 +1,7 @@ require 'etc' require 'facter' +require 'puppet/property/keyvalue' module Puppet newtype(:group) do
(Maint) Fix uninitialized constant. err: Could not apply complete catalog: Could not autoload group: uninitialized constant Puppet::Property::KeyValue Encountered this while generating certificate requests via Puppet Strings/Faces, which doesn't load the full Puppet stack by default. Paired-With: Matt Robinson
puppetlabs_puppet
train
rb
3f77262230a7040c261281d807442600dc920c7b
diff --git a/rabbithole_test.go b/rabbithole_test.go index <HASH>..<HASH> 100644 --- a/rabbithole_test.go +++ b/rabbithole_test.go @@ -521,7 +521,7 @@ var _ = Describe("Rabbithole", func() { Context("PUT /users/{name}", func() { It("updates the user", func() { - info := UserSettings{Password: "s3krE7", Tags: "management policymaker"} + info := UserSettings{Password: "s3krE7", Tags: "policymaker, management"} resp, err := rmqc.PutUser("rabbithole", info) Ω(err).Should(BeNil()) Ω(resp.Status).Should(Equal("204 No Content")) @@ -530,7 +530,7 @@ var _ = Describe("Rabbithole", func() { Ω(err).Should(BeNil()) Ω(u.PasswordHash).ShouldNot(BeNil()) - Ω(u.Tags).Should(Equal("management policymaker")) + Ω(u.Tags).Should(Equal("policymaker,management")) }) })
Tags must be comma-separated
michaelklishin_rabbit-hole
train
go
e628ab0ffe004fe808c0bbcbfc7ae289fb07e995
diff --git a/src/B2Backblaze/B2Response.php b/src/B2Backblaze/B2Response.php index <HASH>..<HASH> 100644 --- a/src/B2Backblaze/B2Response.php +++ b/src/B2Backblaze/B2Response.php @@ -83,7 +83,16 @@ class B2Response */ public function getHeaders() { - return $this->response->getHeaders(); + $headers = $this->response->getHeaders(); + $result = array(); + if(!is_array($headers)) { + return $result; + } + foreach ($headers as $part) { + $middle=explode(": ",$part,2); + $result[trim($middle[0])] = trim($middle[1]); + } + return $result; } /**
Parse all headers to array before return it in B2Response
kamilZ_B2Backblaze
train
php
68891c767a5d34d17c2b1b68689d23e950835b5e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with codecs_open('README.rst', encoding='utf-8') as f: setup(name='grapheme', - version='0.4.0', + version='0.5.0', description=u"Unicode grapheme helpers", long_description=long_description, keywords='',
updated version number in setup.py
alvinlindstam_grapheme
train
py
90b6034ef9bbfb299914bc876f736f7478796484
diff --git a/jobsupervisor/windows_job_supervisor_test.go b/jobsupervisor/windows_job_supervisor_test.go index <HASH>..<HASH> 100644 --- a/jobsupervisor/windows_job_supervisor_test.go +++ b/jobsupervisor/windows_job_supervisor_test.go @@ -1,3 +1,5 @@ +// +build windows + package jobsupervisor_test import ( @@ -52,7 +54,7 @@ func testWindowsConfigs(jobName string) (WindowsProcessConfig, bool) { return conf, ok } -var _ = FDescribe("WindowsJobSupervisor", func() { +var _ = Describe("WindowsJobSupervisor", func() { Context("add jobs and control services", func() { BeforeEach(func() { if runtime.GOOS != "windows" {
Add windows build flag to job supervisor tests
cloudfoundry_bosh-agent
train
go
66d77f17ccb6e4dfb48a6604ccb060ee1217fe07
diff --git a/reflectx/reflect.go b/reflectx/reflect.go index <HASH>..<HASH> 100644 --- a/reflectx/reflect.go +++ b/reflectx/reflect.go @@ -168,7 +168,7 @@ type Kinder interface { func mustBe(v Kinder, expected reflect.Kind) { k := v.Kind() if k != expected { - panic(&reflect.ValueError{methodName(), k}) + panic(&reflect.ValueError{Method: methodName(), Kind: k}) } }
add keys to fields for reflect.ValueError struct literal in reflectx, fixes #<I>, build issues on app engine
jmoiron_sqlx
train
go
fb981de522a6fbaf013d092f332e679f955fb87e
diff --git a/lib/paratrooper/notifier.rb b/lib/paratrooper/notifier.rb index <HASH>..<HASH> 100644 --- a/lib/paratrooper/notifier.rb +++ b/lib/paratrooper/notifier.rb @@ -1,9 +1,19 @@ module Paratrooper + + # Public: Shell object with methods to be overridden by other notifiers + # + # All notifiers should inherit from this class + # class Notifier def notify(step_name, options = {}) self.send(step_name, options) end + # + # To create your own notifier override the following methods. + # + + def setup(options = {}); end def activate_maintenance_mode(options = {}); end def deactivate_maintenance_mode(options = {}); end def update_repo_tag(options = {}); end @@ -11,7 +21,6 @@ module Paratrooper def run_migrations(options = {}); end def app_restart(options = {}); end def warm_instance(options = {}); end - def setup(options = {}); end def teardown(options = {}); end end end
Documentation around Notifier To inform Custom notifier creators which methods are available to override
mattpolito_paratrooper
train
rb
2dfd0089efbac70cb72eb49a695b97a46ddf31c9
diff --git a/python/examples/hypertools_demo-align_tests.py b/python/examples/hypertools_demo-align_tests.py index <HASH>..<HASH> 100644 --- a/python/examples/hypertools_demo-align_tests.py +++ b/python/examples/hypertools_demo-align_tests.py @@ -5,6 +5,17 @@ import numpy as np data = sio.loadmat('test_data.mat') data1 = data['spiral'] data2 = data['randwalk'] -hyp.plot([data1,data2]) +hyp.plot([data1, data2]) -hyp.plot(hyp.align([data1,data2])) +hyp.plot(hyp.align([data1, data2])) + +# A random rotation matrix +rot = np.array([[-0.89433495, -0.44719485, -0.01348182], + [-0.43426149, 0.87492975, -0.21427761], + [-0.10761949, 0.18578133, 0.97667976]]) +# creating new spiral with some noise +data_rot = np.dot(data1, rot) + np.random.randn(data1.shape[0], data1.shape[1])*0.05 +# before hyperalignment +hyp.plot([data1, data_rot]) +# After hyperalignment +hyp.plot(hyp.align([data1, data_rot]))
ENH: Updated example with spiral dataset that are misaligned before hyperalignment and were aligned after hyperalignment.
ContextLab_hypertools
train
py
f3db8a1117b016da322ddcca2d40af2b50753cd0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -185,19 +185,6 @@ module.exports = function(configObject) { args[1] = new_context(args[1]) args[2] = new_callback(args[2]) - var safetyHandler = (err) => { - //console.log("WOLF:CalledSafetyHandler"); - generateLog(err, () => {}) - } - process.on('beforeExit', safetyHandler) - process.on('uncaughtException', function(err) { - //console.log("WOLF:UncaughtException") - safetyHandler(err) - process.nextTick(function() { - process.removeListener('beforeExit', safetyHandler) - }) - }) - try { return func.apply(emitter, args) }
Remove safety handler - persisted through runs
iopipe_iopipe-js-core
train
js
c6e1ec1b02efef835997589c4fdb1201bf37a100
diff --git a/lib/valr.rb b/lib/valr.rb index <HASH>..<HASH> 100644 --- a/lib/valr.rb +++ b/lib/valr.rb @@ -8,6 +8,13 @@ class Valr to_list(first_lines(log_messages(repo_path))) end + # Get the full changelog including metadata. + # @param [String] repo_path Path of repository + # @return [String] changelog + def full_changelog(repo_path) + "#{last_sha1(repo_path)}\n\n#{changelog(repo_path)}" + end + private # Array to markdown list @@ -37,4 +44,10 @@ class Valr walker.reset messages end + + # Get the last sha1 of a git repository + def last_sha1(repo_path) + repo = Rugged::Repository.new repo_path + repo.head.target_id + end end
[#2] Add sha1 of last commit in full changelog
eunomie_valr
train
rb
e440c8d6e02c53fd055af85c981c6c743006cf70
diff --git a/lib/config/config.js b/lib/config/config.js index <HASH>..<HASH> 100644 --- a/lib/config/config.js +++ b/lib/config/config.js @@ -10,6 +10,7 @@ const chokidar = require('chokidar'); const glob = require('glob'); const yamlOrJson = require('js-yaml'); const eventBus = require('../eventBus'); + class Config { constructor () { this.gatewayConfig = null; @@ -64,8 +65,8 @@ class Config { } loadModels () { - glob.sync(path.resolve(process.env.EG_CONFIG_DIR, 'models', '*.js')).forEach(module => { - const name = path.basename(module).split('.')[0]; + glob.sync(path.resolve(process.env.EG_CONFIG_DIR, 'models', '*.json')).forEach(module => { + const name = path.basename(module, '.json'); this.models[name] = require(module); }); }
Load models as json files
ExpressGateway_express-gateway
train
js
9893cf1b8bd523b328c4206cc77ae4fc4da63016
diff --git a/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/impl/json/JsonMetadata.java b/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/impl/json/JsonMetadata.java index <HASH>..<HASH> 100644 --- a/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/impl/json/JsonMetadata.java +++ b/db/rdb/src/main/java/it/unibz/inf/ontop/dbschema/impl/json/JsonMetadata.java @@ -112,8 +112,7 @@ public class JsonMetadata extends JsonOpenObject { } public static RelationID deserializeRelationID(QuotedIDFactory idFactory, List<String> o) { - ImmutableList<String> c = ImmutableList.copyOf(o).reverse(); - return idFactory.createRelationID(c.toArray(new String[0])); + return idFactory.createRelationID(o.toArray(new String[0])); } public static List<String> serializeAttributeList(Stream<Attribute> attributes) {
Bugfix: order in the JSON relation names reversed.
ontop_ontop
train
java
5e1c221befb32ad819f2f5ed2f02238f964f8836
diff --git a/lib/mobvious/strategies/url.rb b/lib/mobvious/strategies/url.rb index <HASH>..<HASH> 100644 --- a/lib/mobvious/strategies/url.rb +++ b/lib/mobvious/strategies/url.rb @@ -11,7 +11,7 @@ module Mobvious # A hash containing regular expressions mapped to symbols. The regular expression # is evaluated against the whole URL of the request (including `http://`). If matching, # the corresponding symbol is returned as the device type. - def initialize(rules = MOBILE_PATH_RULE) + def initialize(rules = MOBILE_PATH_RULES) @rules = rules end diff --git a/spec/mobvious/strategies/url_spec.rb b/spec/mobvious/strategies/url_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mobvious/strategies/url_spec.rb +++ b/spec/mobvious/strategies/url_spec.rb @@ -13,7 +13,7 @@ class URLSpec < MiniTest::Spec 'PATH_INFO' => '/some_path' }) @request = Rack::Request.new(@env) - @strategy = URL.new(URL::MOBILE_PATH_RULES) + @strategy = URL.new end it "returns the right device type when matching rule found" do
typo in url matcher and spec to catch it
jistr_mobvious
train
rb,rb
7733532d6c6a69e449325437fc7e36de0a0a4335
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup( name='just-another-settings', - version='0.0.1', + version='0.0.2', packages=['just_another_settings'], url='https://github.com/andreyrusanov/just-another-settings', license='MIT',
New release because of pypi issues
andreyrusanov_just-another-settings
train
py
92fd667e9a1566ecb0fdbd8aea2439705b7a807b
diff --git a/cobra/flux_analysis/summary.py b/cobra/flux_analysis/summary.py index <HASH>..<HASH> 100644 --- a/cobra/flux_analysis/summary.py +++ b/cobra/flux_analysis/summary.py @@ -136,14 +136,14 @@ def model_summary(model, threshold=1E-8, fva=None, floatfmt='.3g', lambda x: format_long_string(x.name.id, 15), 1) # Build a dictionary of metabolite production from the boundary reactions - # collect rxn.x before fva which invalidates previous solver state + # collect rxn.flux before fva which invalidates previous solver state boundary_reactions = model.exchanges metabolite_fluxes = {} for rxn in boundary_reactions: for met, stoich in iteritems(rxn.metabolites): metabolite_fluxes[met] = { 'id': format_long_string(met.id, 15), - 'flux': stoich * rxn.x} + 'flux': stoich * rxn.flux} # Calculate FVA results if requested if fva:
refactor: remove rxn.x call in summary (#<I>)
opencobra_cobrapy
train
py
62d363abb093b14d92de9f0b6cf92df97b4ab565
diff --git a/lib/Fresque.php b/lib/Fresque.php index <HASH>..<HASH> 100644 --- a/lib/Fresque.php +++ b/lib/Fresque.php @@ -398,7 +398,7 @@ class Fresque ' COUNT=' . $this->runtime['Default']['workers'] . ' LOGHANDLER=' . escapeshellarg($this->runtime['Log']['handler']) . ' LOGHANDLERTARGET=' . escapeshellarg($this->runtime['Log']['target']) . - ' php ./resque.php'; + ' php .' . (file_exists('./bin/resque') ? './bin/resque' : './resque.php'); $cmd .= ' >> '. escapeshellarg($this->runtime['Log']['filename']).' 2>&1" >/dev/null 2>&1 &'; $workersCountBefore = \Resque::Redis()->scard('workers');
Search for resque bin file in bin folder To keep backward compatibility with old php-resque
wa0x6e_Fresque
train
php
6f4684f6184ac49b1a320b0cfaf11fd426885126
diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php @@ -45,6 +45,7 @@ abstract class KernelTestCase extends TestCase { static::ensureKernelShutdown(); static::$kernel = null; + static::$booted = false; } /**
Set booted flag to false when test kernel is unset
symfony_symfony
train
php
cce376c999af0f35a940235dc56602120aa8462a
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -416,15 +416,8 @@ module ActiveSupport # Procs:: A proc to call with the object. # Objects:: An object with a <tt>before_foo</tt> method on it to call. # - # All of these objects are compiled into methods and handled - # the same after this point: - # - # Symbols:: Already methods. - # Strings:: class_eval'd into methods. - # Procs:: using define_method compiled into methods. - # Objects:: - # a method is created that calls the before_foo method - # on the object. + # All of these objects are converted into a lambda and handled + # the same after this point. def make_lambda(filter) case filter when Symbol
:fire: these are lambdas now [ci skip] This has changed since around 2b<I>d6
rails_rails
train
rb
78b3312a36937d535befec253dedd7021e0475bb
diff --git a/src/jquery.csv.js b/src/jquery.csv.js index <HASH>..<HASH> 100755 --- a/src/jquery.csv.js +++ b/src/jquery.csv.js @@ -656,7 +656,7 @@ RegExp.escape= function(s) { end: options.end, state: { rowNum: 1, - colNum: 1, + colNum: 1 } };
Fixed bug <I> that was causing issues in IE jquery.csv.js * removed a trailing comma withing an object literal
mageddo_javascript-csv
train
js
4bcfe058b0034766ae7d6dbb7cc3dc48c1712dca
diff --git a/lib/plugins/json_body_parser.js b/lib/plugins/json_body_parser.js index <HASH>..<HASH> 100644 --- a/lib/plugins/json_body_parser.js +++ b/lib/plugins/json_body_parser.js @@ -43,7 +43,7 @@ function jsonBodyParser(options) { if (Array.isArray(params)) { req.params = params; } else if (typeof (params) === 'object' && params !== null) { - Object.keys(params || {}).forEach(function (k) { + Object.keys(params).forEach(function (k) { var p = req.params[k]; if (p && !override) return (false); @@ -51,7 +51,7 @@ function jsonBodyParser(options) { return (true); }); } else { - req.params = params; + req.params = params || req.params; } } else { req._body = req.body;
Don't replace query params when req.body is null
restify_plugins
train
js
3cc556f44eb291d81991919fc7f32e9703854797
diff --git a/lib/rest-graph.rb b/lib/rest-graph.rb index <HASH>..<HASH> 100644 --- a/lib/rest-graph.rb +++ b/lib/rest-graph.rb @@ -225,10 +225,23 @@ class RestGraph < RestGraphStruct "#{str.tr('-_', '+/')}==".unpack('m').first } self.data = self.class.json_decode(json) if - secret && OpenSSL::HMAC.digest('sha256', secret, json_encoded) == sig + secret && hmac_digest(secret, json_encoded) == sig rescue ParseError end + # fallback to ruby gem if sha256 isn't available in system openssl lib + + def hmac_digest key, data + begin + digest = OpenSSL::Digest::Digest.new('sha256') + return OpenSSL::HMAC.digest(digest, key, data) + rescue + require 'hmac-sha2' + return HMAC::SHA256.digest(key, data) + end + end + +
Fallback to ruby-hmac gem in case system openssl lib doesn't support SHA<I> (OSX <I>)
godfat_rest-core
train
rb
10b8a33b555bf649cd4e1858e76f0e0d3b8a778f
diff --git a/src/config.js b/src/config.js index <HASH>..<HASH> 100644 --- a/src/config.js +++ b/src/config.js @@ -1,4 +1,3 @@ -import { logger } from './logger'; let config = {}; const setConf = function(cnf) {
<I> Updated config handling, removed a logger
knsv_mermaid
train
js
4c5ba633e4ee86479091010f033d5e7072dae260
diff --git a/tests/test_config.py b/tests/test_config.py index <HASH>..<HASH> 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -4,11 +4,15 @@ from nose.tools import assert_raises from flask import Flask, Module from flaskext.assets import Environment, Bundle -from webassets.updater import BaseUpdater +try: + from webassets.updater import BaseUpdater +except ImportError: + BaseUpdater = None # older webassets versions (<=0.5) -class MooUpdater(BaseUpdater): - id = 'MOO' +if BaseUpdater: + class MooUpdater(BaseUpdater): + id = 'MOO' class TestConfigAppBound:
Make sure tests still run with webassets <= <I>.
miracle2k_flask-assets
train
py
dc3f3d6018eeb14d11c7e829dee2fa09f1e84458
diff --git a/cycy/parser/lexer.py b/cycy/parser/lexer.py index <HASH>..<HASH> 100644 --- a/cycy/parser/lexer.py +++ b/cycy/parser/lexer.py @@ -49,7 +49,7 @@ RULES = [ lg = LexerGenerator() lg.add("ASM", "__asm__") lg.add("ASM", "asm") -lg.add("FLOAT_LITERAL", "\d+.\d+") +lg.add("FLOAT_LITERAL", "\d+\.\d+") lg.add("INTEGER_LITERAL", "\d+") lg.add("CHAR_LITERAL", "'\\\\?.'") lg.add("STRING_LITERAL", "\".*\"")
fix bug in lexer that was always giving us Doubles
Magnetic_cycy
train
py
ba2c43fe0c88466eff1a07e9f990744d146d43d3
diff --git a/tests/dumper_tests.py b/tests/dumper_tests.py index <HASH>..<HASH> 100644 --- a/tests/dumper_tests.py +++ b/tests/dumper_tests.py @@ -357,9 +357,9 @@ def test_data_types_json(): { 'comment': 's:A binary blob', 'value': 'b:text/plain'}, { 'comment': 's:A quantity', - 'value': 'n:500 miles'}, + 'value': 'n:500.000000 miles'}, { 'comment': 's:A quantity without unit', - 'value': 'n:500'}, + 'value': 'n:500.000000'}, { 'comment': 's:A coordinate', 'value': 'c:-27.472500,153.003000'}, { 'comment': 's:A URI',
dumper tests: Correct formatting of numeric constant
vrtsystems_hszinc
train
py
86eca74e193b75126f64f9056ca228ba816d4467
diff --git a/src/pyctools/core/frame.py b/src/pyctools/core/frame.py index <HASH>..<HASH> 100644 --- a/src/pyctools/core/frame.py +++ b/src/pyctools/core/frame.py @@ -278,7 +278,14 @@ class Metadata(object): # container already exists break else: - md.set_xmp_tag_struct(container, GExiv2.StructureType.BAG) + type_ = md.get_tag_type(container) + if type_ == 'XmpBag': + type_ = GExiv2.StructureType.BAG + elif type_ == 'XmpSeq': + type_ = GExiv2.StructureType.SEQ + else: + type_ = GExiv2.StructureType.ALT + md.set_xmp_tag_struct(container, type_) if md.get_tag_type(tag) in ('XmpBag', 'XmpSeq'): md.set_tag_multiple(tag, value) else:
Create XMP containers of the right type
jim-easterbrook_pyctools
train
py
8fcfe00dd47476024115f3108fc6e14cacf9e773
diff --git a/spaceship/lib/spaceship/portal/portal_client.rb b/spaceship/lib/spaceship/portal/portal_client.rb index <HASH>..<HASH> 100644 --- a/spaceship/lib/spaceship/portal/portal_client.rb +++ b/spaceship/lib/spaceship/portal/portal_client.rb @@ -155,6 +155,11 @@ module Spaceship end def create_app!(type, name, bundle_id, mac: false) + # We moved the ensure_csrf to the top of this method + # as we got some users with issues around creating new apps + # https://github.com/fastlane/fastlane/issues/5813 + ensure_csrf + ident_params = case type.to_sym when :explicit { @@ -178,7 +183,6 @@ module Spaceship params.merge!(ident_params) - ensure_csrf r = request(:post, "account/#{platform_slug(mac)}/identifiers/addAppId.action", params) parse_response(r, 'appId') end
[spaceship] Change order of ensure_csrf_token (#<I>) * [spaceship] Change order of ensure_csrf_token Maybe by calling `self.team` before calling `ensure_csrf` it doesn't work for everyone * Add link to GH issue
fastlane_fastlane
train
rb
a35775fcedc7b58235cb93f0368662e5e0ce8507
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/rule-filters.js b/sonar-server/src/main/webapp/javascripts/navigator/filters/rule-filters.js index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/javascripts/navigator/filters/rule-filters.js +++ b/sonar-server/src/main/webapp/javascripts/navigator/filters/rule-filters.js @@ -10,7 +10,7 @@ define(['backbone', 'navigator/filters/base-filters', 'navigator/filters/ajax-se parse: function(r) { this.more = r.more; return r.results.map(function(r) { - return { id: r.key, text: r.name }; + return { id: r.key, text: r.name, category: r.language }; }); }
SONAR-<I> Show language in the rule criterion select list
SonarSource_sonarqube
train
js
3f808661ce1e44a28602715cccfad096332b9d03
diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index <HASH>..<HASH> 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -2798,7 +2798,7 @@ func parseStringToDuration(durationString string) (time.Duration, error) { } else if duration, err := time.ParseDuration(durationString); err == nil { suspendDuration = duration } else { - return 0, fmt.Errorf("unable to parse %s as a duration", durationString) + return 0, fmt.Errorf("unable to parse %s as a duration: %w", durationString, err) } return suspendDuration, nil }
chore: Surface parse duration error in operator (#<I>)
argoproj_argo
train
go
82082600e23b7c6be17b9143bc41c6fb92399bcc
diff --git a/flowcraft/generator/inspect.py b/flowcraft/generator/inspect.py index <HASH>..<HASH> 100644 --- a/flowcraft/generator/inspect.py +++ b/flowcraft/generator/inspect.py @@ -1531,7 +1531,9 @@ class NextflowInspector: # Get name of the pipeline from the log file with open(self.log_file) as fh: header = fh.readline() - pipeline_path = re.match(".*nextflow run ([^\s]+).*", header).group(1) + + # Regex supports absolute paths and relative paths + pipeline_path = re.match(".*\s([/\w/]*\w*.nf).*", header).group(1) # Get hash from the entire pipeline file pipeline_hash = hashlib.md5()
fix flowcraft broadcast nf file path retrieval.
assemblerflow_flowcraft
train
py
8ccb5133a64388a108c8912107c0d215f1290ad8
diff --git a/Minimal-J/src/main/java/org/minimalj/model/properties/FieldProperty.java b/Minimal-J/src/main/java/org/minimalj/model/properties/FieldProperty.java index <HASH>..<HASH> 100644 --- a/Minimal-J/src/main/java/org/minimalj/model/properties/FieldProperty.java +++ b/Minimal-J/src/main/java/org/minimalj/model/properties/FieldProperty.java @@ -6,7 +6,6 @@ import java.lang.reflect.Type; import java.util.List; import java.util.logging.Logger; -import org.minimalj.backend.db.EmptyObjects; import org.minimalj.model.PropertyInterface; import org.minimalj.util.CloneHelper; import org.minimalj.util.FieldUtils; @@ -54,13 +53,12 @@ public class FieldProperty implements PropertyInterface { } } else { if (value == null) { - value = EmptyObjects.getEmptyObject(field.getType()); + throw new IllegalArgumentException("Field " + field.getName() + " is final and cannot be set to null"); } CloneHelper.deepCopy(value, finalObject); } } } catch (Exception e) { - e.printStackTrace(); throw new RuntimeException(e); } }
FieldProperty: Don't allow to set null to a final field. Don't pretend it's possible be copy the empty object - this only leads to deferred problems.
BrunoEberhard_minimal-j
train
java
ac33f42c858d492f723b4b78d64515424597a260
diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index <HASH>..<HASH> 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -27,7 +27,7 @@ numversion = (1, 6, 0) version = '.'.join([str(num) for num in numversion]) install_requires = [ - 'astroid >= 1.3.6', + 'astroid >= 1.5.0,<1.6.0', 'six', ]
Pin astroid to the current in-dev version.
PyCQA_pylint
train
py