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
|
---|---|---|---|---|---|
c5e1cc51b99bcc9226145c00c6589b7035c2e3a1
|
diff --git a/lib/tus/storage/s3.rb b/lib/tus/storage/s3.rb
index <HASH>..<HASH> 100644
--- a/lib/tus/storage/s3.rb
+++ b/lib/tus/storage/s3.rb
@@ -101,13 +101,6 @@ module Tus
end
def patch_file(uid, io, info = {})
- tus_info = Tus::Info.new(info)
- last_chunk = (tus_info.length && io.size == tus_info.remaining_length)
-
- if io.size < MIN_PART_SIZE && !last_chunk
- raise Tus::Error, "Chunk size cannot be smaller than 5MB"
- end
-
upload_id = info["multipart_id"]
part_number = info["multipart_parts"].count + 1
|
Don't validate minimum chunk size in S3 storage
This functionality requires additional knowledge about the tus protocol
(e.g. that "Upload-Length" can be absent when "Upload-Defer-Length" is
used), and it's not necessary because the S3 service will already raise
the appropriate error when you try to complete a multipart upload when
chunks have less than 5MB.
|
janko_tus-ruby-server
|
train
|
rb
|
8c5bdb8d31edc6719ad3a7f1c4a69570640bf606
|
diff --git a/serverless-plugin/index.js b/serverless-plugin/index.js
index <HASH>..<HASH> 100644
--- a/serverless-plugin/index.js
+++ b/serverless-plugin/index.js
@@ -35,6 +35,10 @@ class ServerlessPlugin {
'before:package:createDeploymentArtifacts': this.buildHandlers.bind(this),
'after:package:createDeploymentArtifacts': this.cleanupHandlers.bind(this),
+ // deploy function
+ 'before:deploy:function:packageFunction': this.buildHandlers.bind(this),
+ 'after:deploy:function:packageFunction': this.cleanupHandlers.bind(this),
+
// invoke local
'before:invoke:local:invoke': this.buildHandlersLocal.bind(this),
'after:invoke:local:invoke': this.cleanupHandlers.bind(this),
|
Add support for 'sls deploy function'
|
seek-oss_serverless-haskell
|
train
|
js
|
22408ddcc3507c64cafe990f8497a638bfcca6bd
|
diff --git a/src/components/vive-controls.js b/src/components/vive-controls.js
index <HASH>..<HASH> 100644
--- a/src/components/vive-controls.js
+++ b/src/components/vive-controls.js
@@ -122,7 +122,6 @@ module.exports.Component = registerComponent('vive-controls', {
idPrefix: GAMEPAD_ID_PREFIX,
// Hand IDs: 0 = right, 1 = left, 2 = anything else.
controller: data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2,
- hand: data.hand,
orientationOffset: data.orientationOffset
});
|
Use index to detect vive controlles since handennnes is not always available and determined at runtime (fix #<I>)
|
aframevr_aframe
|
train
|
js
|
42c9eab810dbc56868c0b71b6aada8e30cd293a8
|
diff --git a/app/Http/RequestHandlers/UpgradeWizardStep.php b/app/Http/RequestHandlers/UpgradeWizardStep.php
index <HASH>..<HASH> 100644
--- a/app/Http/RequestHandlers/UpgradeWizardStep.php
+++ b/app/Http/RequestHandlers/UpgradeWizardStep.php
@@ -209,7 +209,9 @@ class UpgradeWizardStep implements RequestHandlerInterface
$changes = DB::table('change')->where('status', '=', 'pending')->exists();
if ($changes) {
- throw new HttpServerErrorException(I18N::translate('You should accept or reject all pending changes before upgrading.'));
+ return response(view('components/alert-danger', [
+ 'alert' => I18N::translate('You should accept or reject all pending changes before upgrading.'),
+ ]), StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR);
}
return response(view('components/alert-success', [
|
Fix: #<I> - layout error when changes exist during upgrade
|
fisharebest_webtrees
|
train
|
php
|
aa18e2f830441b58590f2a4e19c55588fd2e4227
|
diff --git a/src/utils.js b/src/utils.js
index <HASH>..<HASH> 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -327,10 +327,20 @@ export const InternalUtils = {
* Dynamically import "Node.js" modules.
* (`eval` is used to prevent bundlers from including the module,
* e.g., [webpack/webpack#8826](https://github.com/webpack/webpack/issues/8826))
- * @param {string} name Name.
- * @returns {Object} Module.
+ * @type {Function}
*/
- // eslint-disable-next-line no-eval
- nodeRequire: name => eval('require')(name)
+ get nodeRequire() {
+ const _nodeRequire = InternalUtils.isNode
+ // eslint-disable-next-line no-eval
+ ? eval('require')
+ : () => {};
+
+ Object.defineProperty(this, 'nodeRequire', {
+ enumerable: true,
+ value: _nodeRequire
+ });
+
+ return this.nodeRequire;
+ }
};
|
Obtain the "require" method only once
|
hectorm_otpauth
|
train
|
js
|
70d9400b86a67b2a219e38135fd353bc4fa521d2
|
diff --git a/lib/rworkflow/flow.rb b/lib/rworkflow/flow.rb
index <HASH>..<HASH> 100644
--- a/lib/rworkflow/flow.rb
+++ b/lib/rworkflow/flow.rb
@@ -87,7 +87,7 @@ module Rworkflow
end
def get_counters
- counters= @storage.get(:counters)
+ counters = @storage.get(:counters)
if counters.present?
counters = begin
YAML.load(counters)
diff --git a/lib/rworkflow/lifecycle.rb b/lib/rworkflow/lifecycle.rb
index <HASH>..<HASH> 100644
--- a/lib/rworkflow/lifecycle.rb
+++ b/lib/rworkflow/lifecycle.rb
@@ -44,6 +44,14 @@ module Rworkflow
return self
end
+ def rename_state(old_state_name, new_state_name)
+ old_state = @states[old_state_name]
+ @states[new_state_name] = old_state
+ @states.delete(old_state)
+
+ @initial = new_state_name if @initial == old_state_name
+ end
+
def to_h
return {
initial: @initial,
|
added rename_state to lifecycle
|
barcoo_rworkflow
|
train
|
rb,rb
|
2008d7e3823f665731eb78aa11154aa7e1825bc1
|
diff --git a/src/Request/uapi-request.js b/src/Request/uapi-request.js
index <HASH>..<HASH> 100644
--- a/src/Request/uapi-request.js
+++ b/src/Request/uapi-request.js
@@ -1,5 +1,4 @@
import handlebars from 'handlebars';
-import _ from 'lodash';
import fs from 'fs';
import request from 'request';
import Promise from 'promise';
@@ -55,12 +54,12 @@ module.exports = function (service, auth, reqType, rootObject,
resolve(reqType);
};
- const prepareRequest = function (data) {
+ const prepareRequest = function (template) {
// adding target branch param from auth variable and render xml
params.TargetBranch = auth.targetBranch;
params.Username = auth.username;
params.pcc = auth.pcc;
- const renderedObj = handlebars.render(data.toString(), params);
+ const renderedObj = template(params);
return renderedObj;
};
@@ -142,6 +141,8 @@ module.exports = function (service, auth, reqType, rootObject,
return new Promise(validateInput)
.then(readFile)
+ .then(buffer => buffer.toString())
+ .then(handlebars.compile)
.then(prepareRequest)
.then(sendRequest)
.then(parseResponse)
|
Fixed handlebars in uapi-request
|
Travelport-Ukraine_uapi-json
|
train
|
js
|
d2e82fdc3a3eab6a2d1cddae5229c2f6faf6f2a7
|
diff --git a/packages/cli/src/index.js b/packages/cli/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/cli/src/index.js
+++ b/packages/cli/src/index.js
@@ -430,12 +430,16 @@ const main = async () => {
return result;
}
+ if (result.teamId) {
+ // SSO login, so set the current scope to the appropriate Team
+ client.config.currentTeam = result.teamId;
+ } else {
+ delete client.config.currentTeam;
+ }
+
// When `result` is a string it's the user's authentication token.
// It needs to be saved to the configuration file.
- client.authConfig.token = result;
-
- // New user, so we can't keep the team
- delete client.config.currentTeam;
+ client.authConfig.token = result.token;
configFiles.writeToAuthConfigFile(client.authConfig);
configFiles.writeToConfigFile(client.config);
|
[cli] Fix in-flight re-login when there are no existing credentials (#<I>)
|
zeit_now-cli
|
train
|
js
|
c4c0013fac207818729f4d46a9b4300d89e72ba7
|
diff --git a/lib/test/assert.js b/lib/test/assert.js
index <HASH>..<HASH> 100644
--- a/lib/test/assert.js
+++ b/lib/test/assert.js
@@ -99,12 +99,15 @@ exports.log = function(message) {
exports.checkCalled = function(func, scope) {
var currentTest = exports.currentTest;
var todo = function() {
- var reply = func.apply(scope, arguments);
- currentTest.outstanding = currentTest.outstanding.filter(function(job) {
- return job != todo;
- });
- currentTest.checkFinish();
- return reply;
+ try {
+ return func.apply(scope, arguments);
+ }
+ finally {
+ currentTest.outstanding = currentTest.outstanding.filter(function(job) {
+ return job !== todo;
+ });
+ currentTest.checkFinish();
+ }
};
currentTest.outstanding.push(todo);
return todo;
|
asyncout-<I>: Test tweak - finally > variable
It's better to put the test function call in a try {} finally {} block
than store the return value, tidy-up and return because it's more
resilient to failure, and clearer.
|
joewalker_gcli
|
train
|
js
|
c7c13e3a7391f6d6e5eff6c7c270d662aeaa694f
|
diff --git a/lib/omnibus/packagers/installbuilder.rb b/lib/omnibus/packagers/installbuilder.rb
index <HASH>..<HASH> 100644
--- a/lib/omnibus/packagers/installbuilder.rb
+++ b/lib/omnibus/packagers/installbuilder.rb
@@ -1,5 +1,5 @@
#
-# Copyright 2014-2019 Chef Software, Inc.
+# 2020 © PTC Inc. 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.
|
DF - updating copyright to PTC's based
Base on feedback on pull request:
Add Installbuilder packager(installbuilder) #<I>
From Tim Smith
|
chef_omnibus
|
train
|
rb
|
19328ea7041bb2bb5a7f09db6bcd38fec23f5b29
|
diff --git a/entity/index.js b/entity/index.js
index <HASH>..<HASH> 100644
--- a/entity/index.js
+++ b/entity/index.js
@@ -188,7 +188,7 @@ EntityGenerator.prototype.askForFields = function askForFields() {
},
{
value: 'enum',
- name: 'enum'
+ name: 'Enumeration (Java enum type)'
}
],
default: 0
@@ -432,6 +432,10 @@ EntityGenerator.prototype.askForFields = function askForFields() {
fieldInJavaBeanMethod = _s.capitalize(props.fieldName);
}
+ if (props.fieldIsEnum) {
+ props.fieldType = _s.capitalize(props.fieldType);
+ }
+
var field = {fieldId: this.fieldId,
fieldName: props.fieldName,
fieldType: props.fieldType,
|
Wording, checked that the class name begins with an uppercase
|
jhipster_generator-jhipster
|
train
|
js
|
64dad297086c50ad366aa87cf4dd3a48a94ebae2
|
diff --git a/app/resonant-laboratory/views/overlays/DatasetLibrary/UploadView.js b/app/resonant-laboratory/views/overlays/DatasetLibrary/UploadView.js
index <HASH>..<HASH> 100644
--- a/app/resonant-laboratory/views/overlays/DatasetLibrary/UploadView.js
+++ b/app/resonant-laboratory/views/overlays/DatasetLibrary/UploadView.js
@@ -24,16 +24,22 @@ let UploadView = girder.views.UploadWidget.extend({
this.listenTo(this, 'g:uploadFinished', () => {
this.finishUpload();
});
+ this.enableUploadButton = false;
},
render: function () {
girder.views.UploadWidget.prototype.render.apply(this, arguments);
// For now, only support uploading one file at a time
this.$el.find('#g-files').prop('multiple', false);
+ this.setUploadEnabled();
},
setUploadEnabled: function (state) {
// Override girder's function so that we actually set the button as really
// disabled, not just attaching a 'disabled' class
+ if (state === undefined) {
+ state = this.enableUploadButton;
+ }
+ this.enableUploadButton = state;
this.$el.find('.g-start-upload').prop('disabled', !state);
},
validateFiles: function () {
|
Disable the upload button on the initial render
|
Kitware_candela
|
train
|
js
|
e7157d3ce29a169fc93bdc8822befe9c0a6dd9e0
|
diff --git a/src/Behat/Mink/Behat/Context/MinkContext.php b/src/Behat/Mink/Behat/Context/MinkContext.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Mink/Behat/Context/MinkContext.php
+++ b/src/Behat/Mink/Behat/Context/MinkContext.php
@@ -248,7 +248,10 @@ class MinkContext extends BehatContext implements TranslatedContextInterface
public function assertPageAddress($page)
{
$expected = parse_url($this->locatePath($page), PHP_URL_PATH);
- $actual = parse_url($this->getSession()->getCurrentUrl(), PHP_URL_PATH);
+ $expected = preg_replace('/^\/[^\.\/]+\.php/', '', $expected);
+
+ $actual = parse_url($this->getSession()->getCurrentUrl(), PHP_URL_PATH);
+ $actual = preg_replace('/^\/[^\.\/]+\.php/', '', $actual);
try {
assertEquals($expected, $actual);
|
remove script name from url paths before assertion
|
minkphp_Mink
|
train
|
php
|
37523ebc044fca7946c56596bd6911871ff42244
|
diff --git a/test/rally_api_spec_helper.rb b/test/rally_api_spec_helper.rb
index <HASH>..<HASH> 100644
--- a/test/rally_api_spec_helper.rb
+++ b/test/rally_api_spec_helper.rb
@@ -102,4 +102,7 @@ end
RSpec.configure do |c|
c.include(RallyConfigLoader)
+ c.tty = true
+ c.color = true
+ c.formatter = :documentation
end
\ No newline at end of file
|
S<I>- colorize and format test output
|
RallyTools_RallyRestToolkitForRuby
|
train
|
rb
|
1927039a7168d04a21dc8c986f935e538c387084
|
diff --git a/lib/ronin/platform/extension.rb b/lib/ronin/platform/extension.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/platform/extension.rb
+++ b/lib/ronin/platform/extension.rb
@@ -143,14 +143,14 @@ module Ronin
# Calls the setup blocks of the extension. If a _block_ is given, it
# will be passed the extension after it has been setup.
#
- # ext.perform_setup
+ # ext.setup!
# # => #<Ronin::Platform::Extension: ...>
#
- # ext.perform_setup do |ext|
+ # ext.setup! do |ext|
# puts "Extension #{ext} has been setup..."
# end
#
- def perform_setup(&block)
+ def setup!(&block)
unless @setup
@setup_blocks.each do |setup_block|
setup_block.call(self) if setup_block
@@ -176,14 +176,14 @@ module Ronin
# Run the teardown blocks of the extension. If a _block_ is given,
# it will be passed the extension before it has been tore down.
#
- # ext.perform_teardown
+ # ext.teardown!
# # => #<Ronin::Platform::Extension: ...>
#
- # ext.perform_teardown do |ext|
+ # ext.teardown! do |ext|
# puts "Extension #{ext} is being tore down..."
# end
#
- def perform_teardown(&block)
+ def teardown!(&block)
block.call(self) if block
unless @toredown
@@ -215,11 +215,11 @@ module Ronin
# end
#
def run(&block)
- perform_setup
+ setup!
block.call(self) if block
- perform_teardown
+ teardown!
return self
end
|
Renamed perform_setup and perform_teardown to setup! and teardown!, respectively.
|
ronin-ruby_ronin
|
train
|
rb
|
4cdb864d8120929efee4c7a7e316c85384780b8c
|
diff --git a/agreement.rb b/agreement.rb
index <HASH>..<HASH> 100644
--- a/agreement.rb
+++ b/agreement.rb
@@ -4,11 +4,12 @@ require 'ticket_sharing/json_support'
module TicketSharing
class Agreement
- attr_accessor :direction, :remote_url
+ attr_accessor :direction, :remote_url, :status
def initialize(attrs = {})
self.direction = attrs['direction'] if attrs['direction']
self.remote_url = attrs['remote_url'] if attrs['remote_url']
+ self.status = attrs['status'] if attrs['status']
end
def self.parse(json)
|
Passing the agreement status in the sharing API.
|
zendesk_ticket_sharing
|
train
|
rb
|
add55a9448af44c1f96c5b66589e0e0ec96dc6a6
|
diff --git a/test/unit/voldemort/store/stats/StatsTest.java b/test/unit/voldemort/store/stats/StatsTest.java
index <HASH>..<HASH> 100644
--- a/test/unit/voldemort/store/stats/StatsTest.java
+++ b/test/unit/voldemort/store/stats/StatsTest.java
@@ -125,7 +125,7 @@ public class StatsTest {
Time mockTime = mock(Time.class);
when(mockTime.getMilliseconds()).thenReturn(startTime);
- RequestCounter rc = new RequestCounter(resetDurationMs, mockTime);
+ RequestCounter rc = new RequestCounter("tests.StatsTest.statsShowSpuriousValues", resetDurationMs, mockTime);
// Add some new stats and verify they were calculated correctly
rc.addRequest(100 * NS_PER_MS, 0, 1000, 100, 1);
|
Fixed a test in StatsTest to use the new RequestCounter API.
|
voldemort_voldemort
|
train
|
java
|
7de514c8cd4de43c1efd6fcef86cddc3e98a44dd
|
diff --git a/opentrons/instruments/pipette.py b/opentrons/instruments/pipette.py
index <HASH>..<HASH> 100644
--- a/opentrons/instruments/pipette.py
+++ b/opentrons/instruments/pipette.py
@@ -860,9 +860,10 @@ class Pipette(Instrument):
tip_plunge = 6
- for _ in range(3):
- self.robot.move_head(z=tip_plunge, mode='relative')
- self.robot.move_head(z=-tip_plunge, mode='relative')
+ self.robot.move_head(z=tip_plunge, mode='relative')
+ self.robot.move_head(z=-tip_plunge - 1, mode='relative')
+ self.robot.move_head(z=tip_plunge + 1, mode='relative')
+ self.robot.move_head(z=-tip_plunge, mode='relative')
_description = "Picking up tip from {0}".format(
(humanize_location(location) if location else '<In Place>')
|
adding extra 1mm to pick_up_tip to help make seal
|
Opentrons_opentrons
|
train
|
py
|
81413a68fc7278f073da36daee2b043c6d40f35c
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ sql = ['sqlalchemy>=1.2.0b3, <1.2.99', 'sqlalchemy-migrate>=0.11, <0.11.99']
postgres = ['psycopg2>=2.7, <2.7.99'] + sql
redshift = ['sqlalchemy-redshift>=0.7, <0.7.99'] + sql
redis = ['redis>=2.10, <2.10.99']
-s3 = ['boto3>=1.4, <1.6.99', 'python-dateutil>=2.1, <2.7.0']
+s3 = ['boto3>=1.4, <1.7.99', 'python-dateutil>=2.1, <2.7.0']
smart_open = ['smart-open>=1.5, <1.5.99'] + s3
geoip = ['geoip2']
@@ -80,7 +80,7 @@ setup(
'jupyter>=1.0, <1.0.99',
'jupyter-core>=4.4.0, <4.4.99',
'numpy>=1.14, <1.14.99',
- 'pandas>=0.20, <0.22.99',
+ 'pandas>=0.20, <0.23.99, !=0.22.0',
'python-dateutil>=2.1, <2.7.0',
'python-dotenv>=0.6, <0.7.99',
'six>=1.10, <1.11.99',
|
accept new versions of boto and pandas
|
instacart_lore
|
train
|
py
|
469d1f09ab7906885eab953245b12490b68898ba
|
diff --git a/spikeinterface/MultiRecordingExtractor.py b/spikeinterface/MultiRecordingExtractor.py
index <HASH>..<HASH> 100644
--- a/spikeinterface/MultiRecordingExtractor.py
+++ b/spikeinterface/MultiRecordingExtractor.py
@@ -80,6 +80,9 @@ class MultiRecordingExtractor(RecordingExtractor):
)
return np.concatenate(list,axis=1)
+ def getChannelIds(self):
+ return list(range(self._num_channels))
+
def getNumChannels(self):
return self._num_channels
diff --git a/spikeinterface/SubRecordingExtractor.py b/spikeinterface/SubRecordingExtractor.py
index <HASH>..<HASH> 100644
--- a/spikeinterface/SubRecordingExtractor.py
+++ b/spikeinterface/SubRecordingExtractor.py
@@ -30,6 +30,9 @@ class SubRecordingExtractor(RecordingExtractor):
ef=self._start_frame+end_frame
return self._parent_recording.getTraces(start_frame=sf,end_frame=ef,channel_ids=ch_ids)
+ def getChannelIds(self):
+ return self._channel_ids
+
def getNumChannels(self):
return len(self._channel_ids)
|
multi and sub recording getchannel id
|
SpikeInterface_spikeextractors
|
train
|
py,py
|
908869290e76920343c3a71d27483c88f6518f61
|
diff --git a/forms/gridfield/GridFieldConfig.php b/forms/gridfield/GridFieldConfig.php
index <HASH>..<HASH> 100644
--- a/forms/gridfield/GridFieldConfig.php
+++ b/forms/gridfield/GridFieldConfig.php
@@ -223,7 +223,7 @@ class GridFieldConfig_RelationEditor extends GridFieldConfig {
$this->addComponent($filter = new GridFieldFilterHeader());
$this->addComponent(new GridFieldDataColumns());
$this->addComponent(new GridFieldEditButton());
- $this->addComponent(new GridFieldDeleteAction());
+ $this->addComponent(new GridFieldDeleteAction(true));
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
$this->addComponent(new GridFieldDetailForm());
|
FIX <I> Regression: GridFieldConfig_RelationEditor: Removing relation deletes data object
|
silverstripe_silverstripe-framework
|
train
|
php
|
a4aa5efba357d8aa4de5cbb433401c18c26dafb9
|
diff --git a/lib/https/index.js b/lib/https/index.js
index <HASH>..<HASH> 100644
--- a/lib/https/index.js
+++ b/lib/https/index.js
@@ -928,7 +928,11 @@ module.exports = function(socket, next, isWebPort) {
}
if (useSNI) {
useSNI = false;
- useNoSNIServer();
+ try {
+ useNoSNIServer();
+ } catch (e) {
+ next(chunk);
+ }
} else {
next(chunk);
}
|
refactor: catch possible exceptions
|
avwo_whistle
|
train
|
js
|
eb5fcd06277a548dd0758dbb3eb97f31cd2c7513
|
diff --git a/ELiDE/__main__.py b/ELiDE/__main__.py
index <HASH>..<HASH> 100644
--- a/ELiDE/__main__.py
+++ b/ELiDE/__main__.py
@@ -12,6 +12,7 @@ parser = argparse.ArgumentParser(
parser.add_argument('-w', '--world')
parser.add_argument('-c', '--code')
parser.add_argument('-l', '--language')
+parser.add_argument('-d', '--debug', action='store_true')
parser.add_argument('maindotpy')
@@ -39,6 +40,9 @@ def lise():
app = ELiDEApp(
cli_args=cli_args
)
+ if getattr(parsed, 'debug'):
+ import pdb
+ pdb.set_trace()
app.run()
if __name__ == '__main__':
|
for easier debugging when I want to launch the module like python -m ELiDE
|
LogicalDash_LiSE
|
train
|
py
|
fb68c23e4d3ece358e2dfce598745b32b28700e7
|
diff --git a/app/controllers/alchemy/messages_controller.rb b/app/controllers/alchemy/messages_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/alchemy/messages_controller.rb
+++ b/app/controllers/alchemy/messages_controller.rb
@@ -99,12 +99,12 @@ module Alchemy
end
def redirect_to_success_page
+ flash[:notice] = _t(:success, :scope => 'contactform.messages')
if @element.ingredient("success_page")
urlname = @element.ingredient("success_page")
elsif mailer_config['forward_to_page'] && mailer_config['mail_success_page']
urlname = Page.find_by_urlname(mailer_config['mail_success_page']).urlname
else
- flash[:notice] = _t(:success, :scope => 'contactform.messages')
urlname = Page.language_root_for(session[:language_id]).urlname
end
redirect_to show_page_path(:urlname => urlname, :lang => multi_language? ? session[:language_code] : nil)
|
Always set a flash notice after sending message.
|
AlchemyCMS_alchemy_cms
|
train
|
rb
|
8da11c7c8e4262a4502383c8256b0d78b5f6808c
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,8 +21,8 @@ module.exports = function (allowWrapper) {
return;
}
- // skip stdio
- if (isStdIO(h)) {
+ // skip stdio and pipe between worker and master
+ if (isStdIO(h) || isWorkerPipe(h)) {
return;
}
@@ -101,6 +101,12 @@ function isStdIO (obj) {
return false;
}
+function isWorkerPipe (obj) {
+ if (obj.constructor.name === 'Pipe' && process.channel === obj) {
+ return true;
+ }
+}
+
function wrapCallbackFirst (mod, name) {
var orig = mod[name];
|
fix: Ignore pipe between worker and master
This is a node's internal object which needs not to be exposed
|
keymetrics_event-loop-inspector
|
train
|
js
|
b2acbc7a7ee0814b14b0c95ecf1e6fa07d42e3be
|
diff --git a/src/Encoder/Handlers/ReplyInterpreter.php b/src/Encoder/Handlers/ReplyInterpreter.php
index <HASH>..<HASH> 100644
--- a/src/Encoder/Handlers/ReplyInterpreter.php
+++ b/src/Encoder/Handlers/ReplyInterpreter.php
@@ -78,7 +78,9 @@ class ReplyInterpreter implements ReplyInterpreterInterface
break;
case 2:
assert('$previous !== null');
- $this->addLinkToData($reply, $current, $previous);
+ if ($this->isLinkInFieldSet($current, $previous) === true) {
+ $this->addLinkToData($reply, $current, $previous);
+ }
if ($isAddResToIncluded === true) {
$this->addToIncluded($reply, $current);
}
|
Add support relation field sets in 'data' section
|
neomerx_json-api
|
train
|
php
|
bb2dce7890ba14136c9ddede04e929cf45982d7b
|
diff --git a/isort/isort.py b/isort/isort.py
index <HASH>..<HASH> 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -198,7 +198,7 @@ class SortImports(object):
return
elif line.startswith('import '):
return "straight"
- elif line.startswith('from ') and "import" in line:
+ elif line.startswith('from '):
return "from"
def _at_end(self):
|
Fix issue <I>: deal with imports that start with 'from' and have import statement on another line
|
timothycrosley_isort
|
train
|
py
|
b68e3b81cc94a8bb309d70ee2c3a3d3b133d66d4
|
diff --git a/lib/init.js b/lib/init.js
index <HASH>..<HASH> 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -27,7 +27,7 @@ module.exports = function init() {
name: 'mcode',
message: 'Enter Company Code'
}, {
- default: options.filename || 'archive',
+ default: options.filename || process.cwd().split(path.sep).pop(),
name: 'filename',
message: 'Enter the name of the .interactive file'
}]).then(function (answers) {
|
default to the directory name of the interactive
|
mediafly_mfly-interactive
|
train
|
js
|
457bf00ce4e3b54d3e4a274da30b52e64bf37612
|
diff --git a/app/assets/javascripts/dashboards/dashboards.js b/app/assets/javascripts/dashboards/dashboards.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/dashboards/dashboards.js
+++ b/app/assets/javascripts/dashboards/dashboards.js
@@ -83,9 +83,17 @@ $(document).ready(function() {
};
var reloadDashboard = function() {
- lockDashboard();
+ var initialDashboardLockedStatus = isDashboardLocked();
+ if (!initialDashboardLockedStatus) {
+ lockDashboard();
+ }
+
dashboardGrid.destroy();
initializeDashboard();
+
+ if (!initialDashboardLockedStatus) {
+ unlockDashboard();
+ }
};
if (dashboard.length > 0){
@@ -205,9 +213,13 @@ $(document).ready(function() {
toggleDashboardLock.data('locked', true);
};
+ function isDashboardLocked() {
+ "use strict";
+ return Boolean(toggleDashboardLock.data('locked'));
+ }
+
toggleDashboardLock.on('click', function() {
- var locked = Boolean(toggleDashboardLock.data('locked'));
- if (locked) {
+ if (isDashboardLocked()) {
unlockDashboard();
} else {
lockDashboard();
|
Reset dashboard lock status after resizing
|
Graylog2_graylog2-server
|
train
|
js
|
b84c20176fe617ff31fb9ed9a95ce8041f2daf7d
|
diff --git a/loam/tools.py b/loam/tools.py
index <HASH>..<HASH> 100644
--- a/loam/tools.py
+++ b/loam/tools.py
@@ -93,5 +93,7 @@ def config_cmd_handler(conf, config='config'):
if conf[config].create or conf[config].update:
conf.create_config_(conf[config].update)
if conf[config].edit:
+ if not conf.config_file_.is_file():
+ conf.create_config_(conf[config].update)
call(shlex.split('{} {}'.format(conf[config].editor,
conf.config_file_)))
|
config_cmd_handler creates file if needed to edit
|
amorison_loam
|
train
|
py
|
28e5eaa3250ac685ef15d49f01deeb2a99c22024
|
diff --git a/salt/states/pkg.py b/salt/states/pkg.py
index <HASH>..<HASH> 100644
--- a/salt/states/pkg.py
+++ b/salt/states/pkg.py
@@ -1808,12 +1808,10 @@ def uptodate(name, refresh=False, **kwargs):
if updated.get('result') is False:
ret.update(updated)
- elif updated or {} == updated:
+ else:
ret['changes'] = updated
ret['comment'] = 'Upgrade successful.'
ret['result'] = True
- else:
- ret['comment'] = 'Upgrade failed.'
return ret
|
Simplify setting success when there are no pkg updates.
|
saltstack_salt
|
train
|
py
|
dad40b202325afdbea88e4f7f762c67996838c0b
|
diff --git a/plugin/src/main/java/org/wildfly/plugin/server/StartMojo.java b/plugin/src/main/java/org/wildfly/plugin/server/StartMojo.java
index <HASH>..<HASH> 100644
--- a/plugin/src/main/java/org/wildfly/plugin/server/StartMojo.java
+++ b/plugin/src/main/java/org/wildfly/plugin/server/StartMojo.java
@@ -331,6 +331,11 @@ public class StartMojo extends AbstractServerConnection {
commandBuilder.addServerArguments(serverArgs);
}
+ final Path javaHomePath = (this.javaHome == null ? Paths.get(System.getProperty("java.home")) : Paths.get(this.javaHome));
+ if (Environment.isModularJvm(javaHomePath)) {
+ commandBuilder.addJavaOptions(Environment.getModularJvmArguments());
+ }
+
// Print some server information
final Log log = getLog();
log.info("JAVA_HOME : " + commandBuilder.getJavaHome());
@@ -374,6 +379,7 @@ public class StartMojo extends AbstractServerConnection {
// Workaround for WFCORE-4121
if (Environment.isModularJvm(javaHome)) {
commandBuilder.addHostControllerJavaOptions(Environment.getModularJvmArguments());
+ commandBuilder.addProcessControllerJavaOptions(Environment.getModularJvmArguments());
}
// Print some server information
|
WFMP-<I> Added Modular Jvm Arguments to standalone and process controller
|
wildfly_wildfly-maven-plugin
|
train
|
java
|
f1cefe1caf1a748b3c0a66877cb493642e220a22
|
diff --git a/upload/catalog/controller/checkout/cart.php b/upload/catalog/controller/checkout/cart.php
index <HASH>..<HASH> 100644
--- a/upload/catalog/controller/checkout/cart.php
+++ b/upload/catalog/controller/checkout/cart.php
@@ -292,7 +292,7 @@ class ControllerCheckoutCart extends Controller {
$product_info = $this->model_catalog_product->getProduct($product_id);
if ($product_info) {
- if (isset($this->request->post['quantity'])) {
+ if (isset($this->request->post['quantity']) && ((int)$this->request->post['quantity'] >= $product_info['minimum'])) {
$quantity = (int)$this->request->post['quantity'];
} else {
$quantity = $product_info['minimum'] ? $product_info['minimum'] : 1;
@@ -473,4 +473,4 @@ class ControllerCheckoutCart extends Controller {
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
-}
\ No newline at end of file
+}
|
Update cart.php
See <URL> function in cart's controller doesn't follow minimum requirements for product (thekrotek)
|
opencart_opencart
|
train
|
php
|
6a9551046635b7ede66e9c0a435875849b1be973
|
diff --git a/tests/library/CM/Site/SiteFactoryTest.php b/tests/library/CM/Site/SiteFactoryTest.php
index <HASH>..<HASH> 100644
--- a/tests/library/CM/Site/SiteFactoryTest.php
+++ b/tests/library/CM/Site/SiteFactoryTest.php
@@ -16,10 +16,7 @@ class CM_Site_SiteFactoryTest extends CMTest_TestCase {
}
ksort($unsorted);
- $start = microtime(true);
$siteFactory = new CM_Site_SiteFactory($unsorted);
- $end = microtime(true);
- printf('testSiteListSorted sorting duration: %sms', round(($end - $start) * 1000, 2));
$reflection = new ReflectionClass($siteFactory);
$property = $reflection->getProperty('_siteList');
|
Remove exec time measurement in CM_Site_SiteFactoryTest
|
cargomedia_cm
|
train
|
php
|
00f860719d20c270ad3dea561c8a7b3bec89a5f3
|
diff --git a/src/Validation/ExactLengthClientSide.php b/src/Validation/ExactLengthClientSide.php
index <HASH>..<HASH> 100644
--- a/src/Validation/ExactLengthClientSide.php
+++ b/src/Validation/ExactLengthClientSide.php
@@ -18,21 +18,21 @@
namespace Rhubarb\Leaf\Validation;
-use Rhubarb\Stem\Models\Validation\EqualTo;
+use Rhubarb\Stem\Models\Validation\ExactLength;
-class EqualToClientSide extends EqualTo
+class ExactLengthClientSide extends ExactLength
{
use ClientSideValidation;
protected function getValidationSettings()
{
return [
- "equalTo" => $this->equalTo
+ "exactLength" => $this->exactLength
];
}
- public static function cloneFromModelValidation(EqualTo $validation)
+ public static function cloneFromModelValidation(ExactLength $validation)
{
- return new EqualToClientSide($validation->name, $validation->equalTo);
+ return new ExactLengthClientSide($validation->name, $validation->exactLength);
}
}
\ No newline at end of file
|
Didnt recognise the change I had made correctly
|
RhubarbPHP_Module.Leaf
|
train
|
php
|
a52fdba5d10f7c5ee7e0a266ca979c40a685cf97
|
diff --git a/conn.go b/conn.go
index <HASH>..<HASH> 100644
--- a/conn.go
+++ b/conn.go
@@ -204,7 +204,8 @@ func (cn *conn) Prepare(q string) (_ driver.Stmt, err error) {
return st, err
}
-func (cn *conn) Close() error {
+func (cn *conn) Close() (err error) {
+ defer errRecover(&err)
cn.send(newWriteBuf('X'))
return cn.c.Close()
|
Recover from a panic closing the socket.
|
bmizerany_pq
|
train
|
go
|
3b732f02d3dab5c0ac306d83b3d4a2a598297bd5
|
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
@@ -1,4 +1,5 @@
require "bundler/setup"
+require "async/rspec"
require "shodanz"
RSpec.configure do |config|
|
Update spec_helper.rb
Note: need to figure out how to use this properly...
|
picatz_shodanz
|
train
|
rb
|
544bdbbbe3e0888271447ab4509db10176f48a02
|
diff --git a/src/Sulu/Bundle/SecurityBundle/Resources/public/js/components/roles/main.js b/src/Sulu/Bundle/SecurityBundle/Resources/public/js/components/roles/main.js
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/SecurityBundle/Resources/public/js/components/roles/main.js
+++ b/src/Sulu/Bundle/SecurityBundle/Resources/public/js/components/roles/main.js
@@ -74,7 +74,13 @@ define([
this.role.set(data);
this.role.save(null, {
success: function(data) {
- this.sandbox.emit('sulu.role.saved', data.id);
+
+ if(!this.options.id){
+ this.sandbox.emit('sulu.router.navigate', 'settings/roles/edit:' + data.id + '/details');
+ } else {
+ this.sandbox.emit('sulu.role.saved', data.id);
+ }
+
}.bind(this),
error: function() {
this.sandbox.emit('sulu.dialog.error.show', 'An error occured during saving the role!');
|
fixed missing rerouting after save
|
sulu_sulu
|
train
|
js
|
c070d424eb6224b50b24d4621e1bdbf5b3c31307
|
diff --git a/.adiorc.js b/.adiorc.js
index <HASH>..<HASH> 100644
--- a/.adiorc.js
+++ b/.adiorc.js
@@ -34,7 +34,8 @@ module.exports = {
ignore: {
src: ["path", "os", "fs", "util", "events", "crypto", "aws-sdk"],
dependencies: ["@babel/runtime"],
- devDependencies: true
+ devDependencies: true,
+ peerDependencies: true
},
ignoreDirs: ["node_modules/", "dist/", "build/"],
packages: [
|
refactor: ignore all peer dependencies in adio
|
Webiny_webiny-js
|
train
|
js
|
f4c12b8ec74217c048d75da701bc5a632c9d1e4a
|
diff --git a/physical/consul/consul.go b/physical/consul/consul.go
index <HASH>..<HASH> 100644
--- a/physical/consul/consul.go
+++ b/physical/consul/consul.go
@@ -241,7 +241,14 @@ func NewConsulBackend(conf map[string]string, logger log.Logger) (physical.Backe
}
func setupTLSConfig(conf map[string]string) (*tls.Config, error) {
- serverName := strings.Split(conf["address"], ":")
+ serverName, _, err := net.SplitHostPort(conf["address"])
+ switch {
+ case err == nil:
+ case strings.Contains(err.Error(), "missing port"):
+ serverName = conf["address"]
+ default:
+ return nil, err
+ }
insecureSkipVerify := false
if _, ok := conf["tls_skip_verify"]; ok {
@@ -262,7 +269,7 @@ func setupTLSConfig(conf map[string]string) (*tls.Config, error) {
tlsClientConfig := &tls.Config{
MinVersion: tlsMinVersion,
InsecureSkipVerify: insecureSkipVerify,
- ServerName: serverName[0],
+ ServerName: serverName,
}
_, okCert := conf["tls_cert_file"]
|
Use net.SplitHostPort on Consul address (#<I>)
|
hashicorp_vault
|
train
|
go
|
e7a8e1ad52f7b849f46450a03e92e5ab2d437ac1
|
diff --git a/umap/umap_.py b/umap/umap_.py
index <HASH>..<HASH> 100644
--- a/umap/umap_.py
+++ b/umap/umap_.py
@@ -806,6 +806,8 @@ def optimize_layout(
grad_coeff /= (0.001 + dist_squared) * (
a * pow(dist_squared, b) + 1
)
+ elif j == k:
+ continue
else:
grad_coeff = 0.0
|
Fix for issue #<I> -- don't negative sample yourself
|
lmcinnes_umap
|
train
|
py
|
0e3a3cbbaa4d7b533dba25e74041b3f5b369641b
|
diff --git a/pygccxml/parser/declarations_cache.py b/pygccxml/parser/declarations_cache.py
index <HASH>..<HASH> 100644
--- a/pygccxml/parser/declarations_cache.py
+++ b/pygccxml/parser/declarations_cache.py
@@ -189,7 +189,7 @@ class file_cache_t(cache_base_t):
"The %s cache file is not compatible with this version " +
"of pygccxml. Please regenerate it.") % name
raise RuntimeError(msg)
- if utils.xml_generator is None:
+ if not utils.xml_generator:
# Set the xml_generator to the one read in the cache file
utils.xml_generator = xml_generator
elif utils.xml_generator != xml_generator:
|
Fix file cache reopening
This was broken as the default for the xml generator
was changed from None to an empty string.
See 7df<I>f<I>a<I>a<I>d<I>a<I>c2b1c
|
gccxml_pygccxml
|
train
|
py
|
fd4b5ce95004ef14b470b0d06938b6e60f469471
|
diff --git a/lib/imagetastic/configurable.rb b/lib/imagetastic/configurable.rb
index <HASH>..<HASH> 100644
--- a/lib/imagetastic/configurable.rb
+++ b/lib/imagetastic/configurable.rb
@@ -9,6 +9,13 @@ module Imagetastic
klass.class_eval do
include Configurable::InstanceMethods
extend Configurable::ClassMethods
+
+ # This isn't included in InstanceMethods because we need access to 'klass'
+ define_method :configuration_hash do
+ @configuration_hash ||= klass.default_configuration.dup
+ end
+ private :configuration_hash
+
end
end
@@ -29,12 +36,6 @@ module Imagetastic
def configuration
configuration_hash.dup
end
-
- private
-
- def configuration_hash
- @configuration_hash ||= self.class.default_configuration.dup
- end
end
diff --git a/spec/imagetastic/configurable_spec.rb b/spec/imagetastic/configurable_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/imagetastic/configurable_spec.rb
+++ b/spec/imagetastic/configurable_spec.rb
@@ -118,4 +118,16 @@ describe Imagetastic::Configurable do
end
end
+ describe "using in the singleton class" do
+ it "should work" do
+ class OneOff
+ class << self
+ include Imagetastic::Configurable
+ configurable_attr :food, 'bread'
+ end
+ end
+ OneOff.food.should == 'bread'
+ end
+ end
+
end
\ No newline at end of file
|
Made configurable module work for Classes/Modules (didn't previously)
|
markevans_dragonfly
|
train
|
rb,rb
|
2f5a26c505e4e4ec781bf4490d9aa2784899e780
|
diff --git a/proto/table_unmarshal.go b/proto/table_unmarshal.go
index <HASH>..<HASH> 100644
--- a/proto/table_unmarshal.go
+++ b/proto/table_unmarshal.go
@@ -1948,7 +1948,7 @@ func encodeVarint(b []byte, x uint64) []byte {
// If there is an error, it returns 0,0.
func decodeVarint(b []byte) (uint64, int) {
var x, y uint64
- if len(b) <= 0 {
+ if len(b) == 0 {
goto bad
}
x = uint64(b[0])
|
proto: replace len(b)<=0 with len(b)==0 (#<I>)
len never returns negative values, so len(b)==0 states
requirements in a more clear way with less "uncertainty".
|
golang_protobuf
|
train
|
go
|
eb07aa44295bdf3ed65bd1fa9541285c906e7d87
|
diff --git a/firenado/session.py b/firenado/session.py
index <HASH>..<HASH> 100644
--- a/firenado/session.py
+++ b/firenado/session.py
@@ -145,10 +145,10 @@ class SessionEnginedMixin(object):
class Session(object):
- def __init__(self, engine, data={}, id=None):
+ def __init__(self, engine, data=None, sess_id=None):
self.__engine = engine
- self.id = id
- self.__data = data
+ self.id = sess_id
+ self.__data = {} if data in None else data
self.__destroyed = False
self.__changed = False
|
Data will be defined as dict if the default value is none.
This is to address landscape error on the code.
Refs: #<I>
|
candango_firenado
|
train
|
py
|
6ad13472aff5470b112f22bbb7fa2b63afab32cc
|
diff --git a/test/instrumentation/modules/pg/pg.js b/test/instrumentation/modules/pg/pg.js
index <HASH>..<HASH> 100644
--- a/test/instrumentation/modules/pg/pg.js
+++ b/test/instrumentation/modules/pg/pg.js
@@ -99,7 +99,7 @@ factories.forEach(function (f) {
setTimeout(function () {
trans.end()
agent._instrumentation._queue._flush()
- }, 100)
+ }, 150)
})
})
})
|
test: increase chance that Travis CI tests pass
|
opbeat_opbeat-node
|
train
|
js
|
94697f3e3fe4faffcd9fe65fb3201e3f1e60e442
|
diff --git a/src/java/com/threerings/media/FrameManager.java b/src/java/com/threerings/media/FrameManager.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/media/FrameManager.java
+++ b/src/java/com/threerings/media/FrameManager.java
@@ -1,5 +1,5 @@
//
-// $Id: FrameManager.java,v 1.39 2003/04/30 06:42:50 mdb Exp $
+// $Id: FrameManager.java,v 1.40 2003/05/02 15:09:57 mdb Exp $
package com.threerings.media;
@@ -681,7 +681,12 @@ public abstract class FrameManager
start = _timer.getElapsedMillis();
}
try {
- Thread.sleep(_sleepGranularity.getValue());
+ int sleepGran = _sleepGranularity.getValue();
+ if (sleepGran > 0) {
+ Thread.sleep(sleepGran);
+ } else {
+ Thread.yield();
+ }
} catch (InterruptedException ie) {
Log.warning("Ticker thread interrupted.");
}
|
If our sleep granularity is zero, yield rather than call sleep() which
would do nothing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
|
threerings_narya
|
train
|
java
|
72e98086b994d6be7601707f0292f2aedfa694e9
|
diff --git a/cli/action.go b/cli/action.go
index <HASH>..<HASH> 100644
--- a/cli/action.go
+++ b/cli/action.go
@@ -282,5 +282,7 @@ func (a *action) showTabularHelp(t *table) {
row{
strings.Replace(a.path, "/", " ", -1),
strings.Join(oDesc, " "),
- strings.Join(aDesc, " ")})
+ strings.Join(aDesc, " "),
+ a.description,
+ })
}
|
show description of actions in short table mode
|
dynport_dgtk
|
train
|
go
|
5107d3c63b17094af1878f2bf44b056f93d88429
|
diff --git a/lib/active_record/turntable/mixer.rb b/lib/active_record/turntable/mixer.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/turntable/mixer.rb
+++ b/lib/active_record/turntable/mixer.rb
@@ -198,6 +198,9 @@ module ActiveRecord::Turntable
shards_with_query,
method, query, *args, &block)
else
+ if raise_on_not_specified_shard_update?
+ raise CannotSpecifyShardError, "[Performance Notice] PLEASE FIX: #{tree.to_sql}"
+ end
Fader::UpdateShardsMergeResult.new(@proxy,
shards_with_query,
method, query, *args, &block)
@@ -222,5 +225,9 @@ module ActiveRecord::Turntable
def raise_on_not_specified_shard_query?
ActiveRecord::Base.turntable_config[:raise_on_not_specified_shard_query]
end
+
+ def raise_on_not_specified_shard_update?
+ ActiveRecord::Base.turntable_config[:raise_on_not_specified_shard_update]
+ end
end
end
|
Add raise_on_not_specified_shard_update option for finding update performance problem
|
drecom_activerecord-turntable
|
train
|
rb
|
aecde861427d4ceb1d1d3159bf77dceca695e619
|
diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Clicker.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Clicker.java
index <HASH>..<HASH> 100644
--- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Clicker.java
+++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Clicker.java
@@ -75,7 +75,8 @@ class Clicker {
public void clickOnScreen(float x, float y) {
boolean successfull = false;
int retry = 0;
-
+ SecurityException ex = null;
+
while(!successfull && retry < 10) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
@@ -89,12 +90,13 @@ class Clicker {
successfull = true;
sleeper.sleep(MINISLEEP);
}catch(SecurityException e){
+ ex = e;
activityUtils.hideSoftKeyboard(null, true);
retry++;
}
}
if(!successfull) {
- Assert.assertTrue("Click can not be completed!", false);
+ Assert.assertTrue("Click at ("+x+", "+y+") can not be completed! ("+(ex != null ? ex.getClass().getName()+": "+ex.getMessage() : "null")+")", false);
}
}
|
Add some more helpful information to the assertion failure in Clicker.clickOnScreen(float,float).
Include the computed (x, y) coordinates of the faile click, plus the name and message of any SecurityException encountered.
|
RobotiumTech_robotium
|
train
|
java
|
d3cb61c534721453ae39dcb9b0b45b5cbf6c6984
|
diff --git a/spec/requests/sessions_spec.rb b/spec/requests/sessions_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/requests/sessions_spec.rb
+++ b/spec/requests/sessions_spec.rb
@@ -1,22 +1,28 @@
require 'spec_helper'
describe "sessions" do
- it "can log if password provided is valid" do
- log_in
+ context "logged in user" do
+ before(:each) do
+ log_in
+ end
+
+ it "can log out" do
+ visit admin_path
+ click_link "Log out"
+ end
end
- it "won't log if bad credentials are provided" do
- user = Factory(:user)
- visit admin_login_path
- fill_in "email", with: user.email
- fill_in "Password", with: "whatever"
- click_button "Log in"
- page.should have_content("Invalid email or password")
- end
+ context "NOT logged in user" do
+ it "can log if password provided is valid" do
+ log_in
+ end
- it "can log out" do
- log_in
- user = Factory(:user)
- visit admin_path
- click_link "Log out"
- end
+ it "won't log if bad credentials are provided" do
+ user = Factory(:user)
+ visit admin_login_path
+ fill_in "email", with: user.email
+ fill_in "Password", with: "whatever"
+ click_button "Log in"
+ page.should have_content("Invalid email or password")
+ end
+ end
end
\ No newline at end of file
|
Refactored a bit session's specs
|
jipiboily_monologue
|
train
|
rb
|
6e02746ad6056275e5d5907e67b76b64ea803d52
|
diff --git a/lib/Gitlab/Api/Issues.php b/lib/Gitlab/Api/Issues.php
index <HASH>..<HASH> 100644
--- a/lib/Gitlab/Api/Issues.php
+++ b/lib/Gitlab/Api/Issues.php
@@ -379,6 +379,10 @@ class Issues extends AbstractApi
->setAllowedValues('sort', ['asc', 'desc'])
;
$resolver->setDefined('search');
+ $resolver->setDefined('created_after');
+ $resolver->setDefined('created_before');
+ $resolver->setDefined('updated_after');
+ $resolver->setDefined('updated_before');
$resolver->setDefined('assignee_id')
->setAllowedTypes('assignee_id', 'integer')
;
|
Updated Issues to support updated_after (#<I>)
Now Issue can resolve more option as listed in the documentation created_after, created_before, updated_after, updated_before
|
m4tthumphrey_php-gitlab-api
|
train
|
php
|
d215d9d785f8abc45aadfcf5f03285fa858eb89b
|
diff --git a/plugins/providers/virtualbox/cap/cleanup_disks.rb b/plugins/providers/virtualbox/cap/cleanup_disks.rb
index <HASH>..<HASH> 100644
--- a/plugins/providers/virtualbox/cap/cleanup_disks.rb
+++ b/plugins/providers/virtualbox/cap/cleanup_disks.rb
@@ -54,14 +54,14 @@ module VagrantPlugins
LOGGER.warn("Found disk not in Vagrantfile config: '#{d["name"]}'. Removing disk from guest #{machine.name}")
disk_info = get_port_and_device(vm_info, d["uuid"])
- # TODO: add proper vagrant error here with values
+ machine.ui.warn("Disk '#{d["name"]}' no longer exists in Vagrant config. Removing and closing medium from guest...", prefix: true)
+
if disk_info.empty?
- raise Error, "could not determine device and port to remove disk"
+ LOGGER.warn("Disk '#{d["name"]}' not attached to guest, but still exists.")
+ else
+ machine.provider.driver.remove_disk(disk_info[:port], disk_info[:device])
end
- machine.ui.warn("Disk '#{d["name"]}' no longer exists in Vagrant config. Removing and closing medium from guest...", prefix: true)
-
- machine.provider.driver.remove_disk(disk_info[:port], disk_info[:device])
machine.provider.driver.close_medium(d["uuid"])
end
end
|
Only log warning when cleaning up disks
If a disk exists but isn't attached to a guest, don't attempt to remove
disk from guest.
|
hashicorp_vagrant
|
train
|
rb
|
70ce69aa431c28482b1a98d7dfc27299c31b6a97
|
diff --git a/sample-project/upload.php b/sample-project/upload.php
index <HASH>..<HASH> 100644
--- a/sample-project/upload.php
+++ b/sample-project/upload.php
@@ -46,7 +46,7 @@ try {
<p>Would you like to <a href="../sample-project">upload more</a>?</p>
</div>
<div class="hinted">
- <a href="<?php echo $file->getUrl(); ?>" target="_blank"><img src="<?php print $file->getResizedUrl(); ?>" /></a>
+ <a href="<?php echo $file->getUrl(); ?>" target="_blank"><img src="<?php print $file->resize(400, 400)->getUrl(); ?>" /></a>
</div>
</li>
</ul>
|
upload.php example updated for new operation methods
|
uploadcare_uploadcare-php
|
train
|
php
|
0fb3907771c5902d3f8d584bee0b43d2bf0e1dbf
|
diff --git a/addons/events/src/components/Panel.js b/addons/events/src/components/Panel.js
index <HASH>..<HASH> 100644
--- a/addons/events/src/components/Panel.js
+++ b/addons/events/src/components/Panel.js
@@ -66,7 +66,7 @@ export default class Events extends Component {
const { events } = this.state;
return (
<div style={styles.wrapper}>
- {events.map(event => <Event key={event.id} {...event} onEmit={this.onEmit} />)}
+ {events.map(event => <Event key={event.name} {...event} onEmit={this.onEmit} />)}
</div>
);
}
|
Events addon: fix React keys warning
|
storybooks_storybook
|
train
|
js
|
2ac03d9c485720bd4bf3d67c7c8e47d1172a8f4b
|
diff --git a/src/holodeck/command.py b/src/holodeck/command.py
index <HASH>..<HASH> 100644
--- a/src/holodeck/command.py
+++ b/src/holodeck/command.py
@@ -83,7 +83,7 @@ class Command:
A number or list of numbers to add to the parameters.
"""
- if isinstance(number, list) or isinstance(number, tuple):
+ if isinstance(number, list) or isinstance(number, tuple) or isinstance(number, np.ndarray):
for x in number:
self.add_number_parameters(x)
return
|
added isinstance(number, np.ndarray)
|
BYU-PCCL_holodeck
|
train
|
py
|
36a62c8329715088f4e1dbd389a0c2249257f0ee
|
diff --git a/core/string.rb b/core/string.rb
index <HASH>..<HASH> 100644
--- a/core/string.rb
+++ b/core/string.rb
@@ -363,7 +363,7 @@ class String
alias slice []
def split(pattern = $; || ' ', limit = undefined)
- `this.split(#{pattern == ' ' ? strip : self}, limit)`
+ `this.split(pattern === ' ' ? strip : this, limit)`
end
def squeeze(*sets)
diff --git a/lib/opal/parser.rb b/lib/opal/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/opal/parser.rb
+++ b/lib/opal/parser.rb
@@ -1098,7 +1098,7 @@ module Opal
if String === p
p.to_s
elsif p.first == :evstr
- process p.last, :expression
+ process p.last, :statement
elsif p.first == :str
p.last.to_s
else
|
Make ruby code inside x-str generate as statements
Before inline ruby code within javascript was generated as an
expression, but it will now be generated as a statement. This means
that language features such as yield, next and break will not break
when written inside javascript code.
|
opal_opal
|
train
|
rb,rb
|
96b502e6e06d1edfe4bcc3e2fbe5431866fb2870
|
diff --git a/dynamic_rest/pagination.py b/dynamic_rest/pagination.py
index <HASH>..<HASH> 100644
--- a/dynamic_rest/pagination.py
+++ b/dynamic_rest/pagination.py
@@ -7,6 +7,7 @@ class DynamicPageNumberPagination(PageNumberPagination):
page_size_query_param = dynamic_settings.get('PAGE_SIZE_QUERY_PARAM', 'per_page')
page_query_param = dynamic_settings.get('PAGE_QUERY_PARAM', 'page')
max_page_size = dynamic_settings.get('MAX_PAGE_SIZE', None)
+ page_size = dynamic_settings.get('DEFAULT_PAGE_SIZE', 500)
def get_page_metadata(self):
# returns total_results, total_pages, page, per_page
|
add default page_size (paignation doesn't work without it)
|
AltSchool_dynamic-rest
|
train
|
py
|
6231cba4f80887ef7bd63bb40c94c2163aeb2df6
|
diff --git a/holoviews/element/raster.py b/holoviews/element/raster.py
index <HASH>..<HASH> 100644
--- a/holoviews/element/raster.py
+++ b/holoviews/element/raster.py
@@ -59,7 +59,7 @@ class Raster(Element2D):
elif len(slices) > (2 + self.depth):
raise Exception("Can only slice %d dimensions" % 2 + self.depth)
elif len(slices) == 3 and slices[-1] not in [self.vdims[0].name, slice(None)]:
- raise Exception("Raster only has single channel %r" % self.vdims[0].name)
+ raise Exception("%r is the only selectable value dimension" % self.vdims[0].name)
slc_types = [isinstance(sl, slice) for sl in slices[:2]]
data = self.data.__getitem__(slices[:2][::-1])
|
Value dimension selection error in Raster now consistent with Histogram
|
pyviz_holoviews
|
train
|
py
|
4f2a828073dd63be35c776b6eb770e5da301363a
|
diff --git a/src/TestFramework/AbstractTestFrameworkAdapter.php b/src/TestFramework/AbstractTestFrameworkAdapter.php
index <HASH>..<HASH> 100644
--- a/src/TestFramework/AbstractTestFrameworkAdapter.php
+++ b/src/TestFramework/AbstractTestFrameworkAdapter.php
@@ -198,7 +198,7 @@ abstract class AbstractTestFrameworkAdapter
$process->mustRun();
- $version = null;
+ $version = 'unknown';
try {
$version = $this->versionParser->parse($process->getOutput());
diff --git a/tests/Console/E2ETest.php b/tests/Console/E2ETest.php
index <HASH>..<HASH> 100644
--- a/tests/Console/E2ETest.php
+++ b/tests/Console/E2ETest.php
@@ -67,6 +67,10 @@ final class E2ETest extends TestCase
protected function setUp(): void
{
+ if (\PHP_SAPI === 'phpdbg') {
+ $this->markTestSkipped('Running this test on PHPDBG causes failures on Travis, see https://github.com/infection/infection/pull/622.');
+ }
+
// Without overcommit this test fails with `proc_open(): fork failed - Cannot allocate memory`
if (strpos(PHP_OS, 'Linux') === 0 &&
is_readable('/proc/sys/vm/overcommit_memory') &&
|
Skip E2E tests when for phpdbg due to many strange failures on Travis
New empty classes and tests with `assertSame(1, 1)` lead to weird timeout errors on Travis with `phpdbg`.
From @krakjoe:
> phpdbg has bugs that may also be effecting you and are stopping me from even doing a full run locally, there's some problem with too many open file handles, class not found and such, this all seems to be connected to this issue
|
infection_infection
|
train
|
php,php
|
c04645d3af0a2816af26eb0cd4725b6a8456c685
|
diff --git a/src/ManiaLib/Manialink/Layouts/LineRightToLeft.php b/src/ManiaLib/Manialink/Layouts/LineRightToLeft.php
index <HASH>..<HASH> 100644
--- a/src/ManiaLib/Manialink/Layouts/LineRightToLeft.php
+++ b/src/ManiaLib/Manialink/Layouts/LineRightToLeft.php
@@ -5,7 +5,7 @@ namespace ManiaLib\Manialink\Layouts;
class LineRightToLeft extends AbstractLayout
{
protected $init = false;
-
+
function preFilter(\ManiaLib\Manialink\Elements\Base $node)
{
if (!$this->init && $this->getParent())
@@ -13,7 +13,8 @@ class LineRightToLeft extends AbstractLayout
$this->xIndex = $this->getParent()->getSizenX();
$this->init = true;
}
- $this->xIndex -= $node->getRealSizenX() + $this->marginWidth;
+ $marginWidth = $this->xIndex == $this->getParent()->getSizenX() ? 0 : $this->marginWidth;
+ $this->xIndex -= $node->getRealSizenX() + $marginWidth;
}
function postFilter(\ManiaLib\Manialink\Elements\Base $node)
|
Removed margin applied to the first element
|
maniaplanet_manialib-manialink
|
train
|
php
|
8d4d0ee0bcbd5986e5bc21e48b9c967665ee2e21
|
diff --git a/framework/yii/caching/RedisCache.php b/framework/yii/caching/RedisCache.php
index <HASH>..<HASH> 100644
--- a/framework/yii/caching/RedisCache.php
+++ b/framework/yii/caching/RedisCache.php
@@ -10,7 +10,7 @@ namespace yii\caching;
use yii\redis\Connection;
/**
- * RedisCache implements a cache application component based on [redis](http://redis.io/).
+ * RedisCache implements a cache application component based on [redis](http://redis.io/) version 2.6 or higher.
*
* RedisCache needs to be configured with [[hostname]], [[port]] and [[database]] of the server
* to connect to. By default RedisCache assumes there is a redis server running on localhost at
|
Update RedisCache.php
added version information
|
yiisoft_yii2-debug
|
train
|
php
|
bec5e29849f1e9c73e7e3667107ab2bcb2244796
|
diff --git a/core-bundle/contao/library/Contao/DcaExtractor.php b/core-bundle/contao/library/Contao/DcaExtractor.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/library/Contao/DcaExtractor.php
+++ b/core-bundle/contao/library/Contao/DcaExtractor.php
@@ -313,6 +313,12 @@ class DcaExtractor extends \Controller
*/
protected function createExtract()
{
+ // Load the default language file (see #7202)
+ if (empty($GLOBALS['TL_LANG']['MSC']))
+ {
+ System::loadLanguageFile('default');
+ }
+
// Load the data container
if (!isset($GLOBALS['loadDataContainer'][$this->strTable]))
{
|
[Core] Make sure the default language file is loaded in the DCA extractor (see #<I>)
|
contao_contao
|
train
|
php
|
13c0f0e435396120eb13af57bee782106706dfe8
|
diff --git a/dragonpy/components/cpu6809.py b/dragonpy/components/cpu6809.py
index <HASH>..<HASH> 100755
--- a/dragonpy/components/cpu6809.py
+++ b/dragonpy/components/cpu6809.py
@@ -239,7 +239,7 @@ class CPU(object):
####
def reset(self):
-# log.info("$%x CPU reset:" % self.program_counter)
+ log.info("%04x| CPU reset:", self.program_counter.get())
self.last_op_address = 0
@@ -263,9 +263,11 @@ class CPU(object):
# log.debug("\tset PC to $%x" % self.cfg.RESET_VECTOR)
# self.program_counter = self.cfg.RESET_VECTOR
-# log.info("\tread word from $%x" % self.cfg.RESET_VECTOR)
+ log.info("\tread reset vector from $%04x", self.RESET_VECTOR)
ea = self.memory.read_word(self.RESET_VECTOR)
-# log.info("\tset PC to $%x" % (ea))
+ log.info("\tset PC to $%04x" % ea)
+ if ea == 0x0000:
+ log.critical("Reset vector is $%04x ??? ROM loading in the right place?!?", ea)
self.program_counter.set(ea)
####
|
display more info if e.g. the ROM loaded into a wrong area
|
6809_MC6809
|
train
|
py
|
6e400e9b95715c47db9a52500885f9ff1ae9143d
|
diff --git a/contracts/tests/test_raidenchannels.py b/contracts/tests/test_raidenchannels.py
index <HASH>..<HASH> 100644
--- a/contracts/tests/test_raidenchannels.py
+++ b/contracts/tests/test_raidenchannels.py
@@ -183,7 +183,7 @@ def test_version(web3, contract, channels_contract):
contract.transact({'from': A}).setLatestVersionAddress(other_contract.address)
contract.transact({'from': Owner}).setLatestVersionAddress(other_contract.address)
- assert contract.call().getLatestVersionAddress() == other_contract.address
+ assert contract.call().latest_version_address() == other_contract.address
def test_channel_223_create(web3, chain, contract, channels_contract):
|
Fix contract tests for latest_version_address
|
raiden-network_microraiden
|
train
|
py
|
5cf2319e66bad5e0ff2bdc3f37c6d9075c3a37ae
|
diff --git a/lib/nssocket.js b/lib/nssocket.js
index <HASH>..<HASH> 100644
--- a/lib/nssocket.js
+++ b/lib/nssocket.js
@@ -425,7 +425,6 @@ NsSocket.prototype._onData = function _onData(message) {
try {
parsed = JSON.parse(message);
data = parsed.pop();
- this.emit(['data'].concat(parsed), data)
}
catch (err) {
//
@@ -433,6 +432,7 @@ NsSocket.prototype._onData = function _onData(message) {
// received.
//
}
+ this.emit(['data'].concat(parsed), data);
};
//
|
[fix] Don't swallow exceptions in event handlers
Putting `emit` in `try` block was invalid here - that's where event
handlers get executed.
Fixes #7.
|
foreverjs_nssocket
|
train
|
js
|
ac42f7c14c9da6efb92e38270c9cc44879913ee1
|
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
+++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
@@ -688,6 +688,8 @@ public abstract class NanoHTTPD {
} catch (ResponseException re) {
Response r = new Response(re.getStatus(), MIME_PLAINTEXT, re.getMessage());
r.send(outputStream);
+ } finally {
+ tempFileManager.clear();
}
}
@@ -782,7 +784,6 @@ public abstract class NanoHTTPD {
}
} finally {
safeClose(randomAccessFile);
- tempFileManager.clear();
safeClose(in);
}
}
|
Moving temp file clearing back to HTTPSession.execute()
|
NanoHttpd_nanohttpd
|
train
|
java
|
ef08c74f7a31c7c330f414d9d4df2375d9626f11
|
diff --git a/update_checker.py b/update_checker.py
index <HASH>..<HASH> 100644
--- a/update_checker.py
+++ b/update_checker.py
@@ -15,7 +15,7 @@ from datetime import datetime
from functools import wraps
from tempfile import gettempdir
-__version__ = '0.12'
+__version__ = '0.13'
def cache_results(function):
|
Bump to <I>.
|
bboe_update_checker
|
train
|
py
|
37aa8bb9fd09f79d91cfcaefd8d35eabed12b1fb
|
diff --git a/src/Fixer/Basic/BracesFixer.php b/src/Fixer/Basic/BracesFixer.php
index <HASH>..<HASH> 100644
--- a/src/Fixer/Basic/BracesFixer.php
+++ b/src/Fixer/Basic/BracesFixer.php
@@ -220,14 +220,6 @@ class Foo {
continue;
}
- // do not change import of functions
- if (
- $token->isGivenKind(T_FUNCTION)
- && $tokens[$tokens->getPrevMeaningfulToken($index)]->isGivenKind(T_USE)
- ) {
- continue;
- }
-
if ($token->isGivenKind($classyAndFunctionTokens)) {
$startBraceIndex = $tokens->getNextTokenOfKind($index, array(';', '{'));
$startBraceToken = $tokens[$startBraceIndex];
|
BracesFixer - cleanup code after introducing CT::T_FUNCTION_IMPORT
|
FriendsOfPHP_PHP-CS-Fixer
|
train
|
php
|
65f35c8a6e37785988c753f4328e9c27d5c6974b
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -66,6 +66,7 @@ module.exports = {
files: ['jquery.js'],
});
+ let emberSourceDistPath = path.join(__dirname, '..', 'dist');
var emberFiles = [
'ember-runtime.js',
'ember-template-compiler.js',
@@ -81,12 +82,12 @@ module.exports = {
return flat.concat(jsAndMap);
}, [])
.filter(function(file) {
- var fullPath = path.join(__dirname, '..', 'dist', file);
+ var fullPath = path.join(emberSourceDistPath, file);
return fs.existsSync(fullPath);
});
- var ember = new Funnel(__dirname + '../dist', {
+ var ember = new Funnel(emberSourceDistPath, {
destDir: 'ember',
files: emberFiles,
});
|
Fix paths for ember-source addon.
The refactor to move `index.js` -> `lib/index.js` left this in a broken
state (the paths are incorrect and therefore the funnel threw an error
at build time).
|
emberjs_ember.js
|
train
|
js
|
8bbd8ca532bb3c4df4c65fcba53712aded488c48
|
diff --git a/pycbc/pnutils.py b/pycbc/pnutils.py
index <HASH>..<HASH> 100644
--- a/pycbc/pnutils.py
+++ b/pycbc/pnutils.py
@@ -99,6 +99,20 @@ def eta_mass1_to_mass2(eta, mass1, return_mass_heavier=False):
else:
return roots[roots.argmax()]
+
+def mchirp_q_to_mass1_mass2(mchirp, q):
+ """ This function takes a value of mchirp and the mass ratio
+ mass1/mass2 and returns the two component masses.
+
+ The map from q to eta is
+
+ eta = (mass1*mass2)/(mass1+mass2)**2 = (q)/(1+q)**2
+
+ Then we can map from (mchirp,eta) to (mass1,mass2).
+ """
+ eta = q / (1+q)**2
+ return mchirp_eta_to_mass1_mass2(mchirp, eta)
+
def A0(f_lower):
"""used in calculating chirp times: see Cokelaer, arxiv.org:0706.4437
appendix 1, also lalinspiral/python/sbank/tau0tau3.py
|
Add mchirp q to mass1 mass2 function. (#<I>)
* Add mchirp q to mass1 mass2 function.
* Make two spaces.
|
gwastro_pycbc
|
train
|
py
|
7b2597eec446f38a8d16704d6b89de14d26f147d
|
diff --git a/wayback-core/src/test/java/org/archive/io/warc/TestWARCRecordInfo.java b/wayback-core/src/test/java/org/archive/io/warc/TestWARCRecordInfo.java
index <HASH>..<HASH> 100644
--- a/wayback-core/src/test/java/org/archive/io/warc/TestWARCRecordInfo.java
+++ b/wayback-core/src/test/java/org/archive/io/warc/TestWARCRecordInfo.java
@@ -233,6 +233,7 @@ public class TestWARCRecordInfo extends WARCRecordInfo implements WARCConstants,
bw.write("HTTP/1.0 200 OK" + CRLF);
bw.write("Content-Length: " + len + CRLF);
bw.write("Content-Type: " + ctype + CRLF);
+ bw.write("Content-Encoding: gzip");
bw.write(CRLF);
bw.flush();
bw.close();
|
FIX: Fix unit test, need to add Content-Encoding: gzip to revisit header resource test, as the payload is also gzip encoded
|
iipc_openwayback
|
train
|
java
|
a08311755c2f6807ec3a2d99a2b2a7c0f732bd9d
|
diff --git a/src/main/java/io/github/classgraph/ClassGraphClassLoader.java b/src/main/java/io/github/classgraph/ClassGraphClassLoader.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/github/classgraph/ClassGraphClassLoader.java
+++ b/src/main/java/io/github/classgraph/ClassGraphClassLoader.java
@@ -52,7 +52,7 @@ class ClassGraphClassLoader extends ClassLoader {
@Override
protected Class<?> findClass(final String className)
- throws ClassNotFoundException, LinkageError, ExceptionInInitializerError, SecurityException {
+ throws ClassNotFoundException, LinkageError, SecurityException {
// Get ClassInfo for named class
final ClassInfo classInfo = scanResult.getClassInfo(className);
if (classInfo != null) {
|
There is a more general exception, 'java.lang.LinkageError', in the throws list already.
|
classgraph_classgraph
|
train
|
java
|
4ae036055da646b0f43a91739c310fe6fc18c3af
|
diff --git a/tests/unit/modules/zypper_test.py b/tests/unit/modules/zypper_test.py
index <HASH>..<HASH> 100644
--- a/tests/unit/modules/zypper_test.py
+++ b/tests/unit/modules/zypper_test.py
@@ -371,8 +371,6 @@ class ZypperTestCase(TestCase):
with patch('salt.modules.zypper.list_pkgs', MagicMock(side_effect=[{"vim": "1.1"}, {"vim": "1.1"}])):
ret = zypper.upgrade(dist_upgrade=True, dryrun=True, fromrepo=["Dummy", "Dummy2"], novendorchange=True)
- self.assertTrue(ret['result'])
- self.assertDictEqual(ret['changes'], {})
zypper_mock.assert_any_call('dist-upgrade', '--auto-agree-with-licenses', '--dry-run', '--from', "Dummy", '--from', 'Dummy2', '--no-allow-vendor-change')
zypper_mock.assert_any_call('dist-upgrade', '--auto-agree-with-licenses', '--dry-run', '--from', "Dummy", '--from', 'Dummy2', '--no-allow-vendor-change', '--debug-solver')
|
Fix unit test for Zypper dist-upgrade in Carbon
|
saltstack_salt
|
train
|
py
|
c21301965ad56f3d207fac9cd8784d6e5e49bff3
|
diff --git a/go/kbfs/libkbfs/disk_limits_unix.go b/go/kbfs/libkbfs/disk_limits_unix.go
index <HASH>..<HASH> 100644
--- a/go/kbfs/libkbfs/disk_limits_unix.go
+++ b/go/kbfs/libkbfs/disk_limits_unix.go
@@ -8,17 +8,21 @@ package libkbfs
import (
"math"
+ "syscall"
"github.com/pkg/errors"
- "golang.org/x/sys/unix"
)
// getDiskLimits gets the disk limits for the logical disk containing
// the given path.
func getDiskLimits(path string) (
availableBytes, totalBytes, availableFiles, totalFiles uint64, err error) {
- var stat unix.Statfs_t
- err = unix.Statfs(path, &stat)
+ // Notably we are using syscall rather than golang.org/x/sys/unix here.
+ // The latter is broken on iOS with go1.11.8 (and likely earlier versions)
+ // and always gives us 0 as available storage space. go1.12.3 is known to
+ // work fine with sys/unix.
+ var stat syscall.Statfs_t
+ err = syscall.Statfs(path, &stat)
if err != nil {
return 0, 0, 0, 0, errors.WithStack(err)
}
|
use syscall instead of sys/unix (#<I>)
* use syscall instead of sys/unix
* clarify in comment suggested by strib
|
keybase_client
|
train
|
go
|
f6cdb188bde964342c297352771382f860b83ce8
|
diff --git a/packages/metascraper-media-provider/src/get-media/provider/generic.js b/packages/metascraper-media-provider/src/get-media/provider/generic.js
index <HASH>..<HASH> 100644
--- a/packages/metascraper-media-provider/src/get-media/provider/generic.js
+++ b/packages/metascraper-media-provider/src/get-media/provider/generic.js
@@ -39,10 +39,10 @@ module.exports = ({ tunnel, onError, userAgent, cacheDir }) => {
try {
data = await getInfo(url, flags)
} catch (rawError) {
- const err = youtubedlError({ rawError, url, flags })
- debug('getInfo:err', err.message)
- onError(err, url)
- if (err.unsupportedUrl) return data
+ const error = youtubedlError({ rawError, url, flags })
+ debug('getInfo:error', error.message)
+ onError(error, url)
+ if (error.unsupportedUrl) return data
if (!tunnel) return data
retry.incr()
}
|
refactor: rename err into error
|
microlinkhq_metascraper
|
train
|
js
|
7566f1bdca92f6b0f6792dd5e611ed45be50ea0c
|
diff --git a/nudibranch/diff_render.py b/nudibranch/diff_render.py
index <HASH>..<HASH> 100644
--- a/nudibranch/diff_render.py
+++ b/nudibranch/diff_render.py
@@ -267,13 +267,25 @@ class HTMLDiff(difflib.HtmlDiff):
retval += self.TENTATIVE_SCORE_BLOCK.format(total, "%.2f" % percentage)
return retval
+ def is_legend_needed(self):
+ for diff in self._all_diffs():
+ if diff.should_show_table():
+ return True
+ return False
+
+ def legend_html(self):
+ if self.is_legend_needed():
+ return "<hr>{0}<hr>".format(self._legend)
+ else:
+ return "<hr>"
+
def make_whole_file(self):
tables = [self._diff_html[diff]
for diff in self._all_diffs()
if self._has_diff(diff)]
return self._file_template % dict(
summary=self.make_summary(),
- legend="<hr>{0}<hr>".format(self._legend) if tables else "",
+ legend=self.legend_html(),
table='<hr>\n'.join(tables))
def _line_wrapper(self, diffs):
|
The legend is now only output if diff tables are produced,
as opposed to merely with incorrect tests
|
ucsb-cs_submit
|
train
|
py
|
0ac7adc1023f39ebe1fd5e86f77817a348f61125
|
diff --git a/js/cobinhood.js b/js/cobinhood.js
index <HASH>..<HASH> 100644
--- a/js/cobinhood.js
+++ b/js/cobinhood.js
@@ -451,7 +451,7 @@ module.exports = class cobinhood extends Exchange {
'trading_pair_id': market['id'],
'type': type, // market, limit, stop, stop_limit
'side': side,
- 'size': this.amountToPrecision (symbol, amount),
+ 'size': this.amountToString (symbol, amount),
};
if (type !== 'market')
request['price'] = this.priceToPrecision (symbol, price);
|
add restored amountToString in cobinhood fix #<I>
|
ccxt_ccxt
|
train
|
js
|
6edc9228a71ee0221f20e0bf1e148daf40091463
|
diff --git a/kwonly_args/__init__.py b/kwonly_args/__init__.py
index <HASH>..<HASH> 100644
--- a/kwonly_args/__init__.py
+++ b/kwonly_args/__init__.py
@@ -28,7 +28,7 @@ __all__ = ['first_kwonly_arg', 'KWONLY_REQUIRED', 'FIRST_DEFAULT_ARG', 'kwonly_d
# case increase only version_info[2].
# version_info[2]: Increase in case of bugfixes. Also use this if you added new features
# without modifying the behavior of the previously existing ones.
-version_info = (1, 0, 8)
+version_info = (1, 0, 9)
__version__ = '.'.join(str(n) for n in version_info)
__author__ = 'István Pásztor'
__license__ = 'MIT'
|
bumping version to <I>
|
pasztorpisti_kwonly-args
|
train
|
py
|
20ee80c499aebba1c0b1b8a1ce58b14d05362852
|
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
@@ -39,5 +39,9 @@ module Minitest
def real_file_sandbox_path
File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_sandbox'))
end
+
+ def teardown
+ refute FakeFS.activated?
+ end
end
end
|
fail fast when activated is left in a bad state
|
fakefs_fakefs
|
train
|
rb
|
4550e795ee01ddbfda5b6c909f46d9f506b66533
|
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/ternAssist.js
@@ -498,6 +498,7 @@ define([
});
});
}
+ return [];
});
} else {
return that.astManager.getAST(editorContext).then(function(ast) {
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/occurrences.js
@@ -750,6 +750,7 @@ define([
return findOccurrences(ast, ctxt);
});
}
+ return [];
});
});
}
|
[nobug] - When outside of HTML blocks tooling needs to return API specified emtpy array, not undefined
|
eclipse_orion.client
|
train
|
js,js
|
4a68339c700fa4b202b4012ca90d4e1181fc6810
|
diff --git a/release.js b/release.js
index <HASH>..<HASH> 100644
--- a/release.js
+++ b/release.js
@@ -214,8 +214,8 @@
pushCmds.push(
comment('push to bower (master and tag) and publish to npm'),
'cd ' + options.cwd,
- 'git push -q origin master',
- fill('git push -q origin v{{newVersion}}'),
+ 'git push -q',
+ 'git push -q --tags',
'npm publish',
'cd ..'
);
@@ -243,7 +243,7 @@
pushCmds.push(
comment('push the site'),
'cd ' + options.cwd,
- 'git push -q origin master',
+ 'git push',
'cd ..'
);
}
@@ -256,7 +256,7 @@
'node -e "' + stringifyFunction(buildCommand) + '"',
'git add package.json',
fill('git commit -m "update version number in package.json to {{newVersion}}"'),
- 'git push origin master'
+ 'git push'
);
function buildCommand () {
require('fs').writeFileSync('package.json', JSON.stringify(getUpdatedJson(), null, 2));
|
update(build): simplifies push commands in release script
|
angular_material
|
train
|
js
|
fa454b5950af23dd6b24312dc7e771eb9ec432fa
|
diff --git a/socketIO_client/__init__.py b/socketIO_client/__init__.py
index <HASH>..<HASH> 100644
--- a/socketIO_client/__init__.py
+++ b/socketIO_client/__init__.py
@@ -222,7 +222,12 @@ class SocketIO(object):
@property
def connected(self):
- return self.__transport.connected
+ try:
+ transport = self.__transport
+ except AttributeError:
+ return False
+ else:
+ return transport.connected
@property
def _transport(self):
|
Catch AttributeError in client connected check
If the client has never connected, there will be no __transport attribute.
|
invisibleroads_socketIO-client
|
train
|
py
|
860d4c54a905b55d8342e539062ca16780e5fb82
|
diff --git a/f90nml/namelist.py b/f90nml/namelist.py
index <HASH>..<HASH> 100644
--- a/f90nml/namelist.py
+++ b/f90nml/namelist.py
@@ -185,12 +185,12 @@ class Namelist(OrderedDict):
# Uppercase
@property
def uppercase(self):
- """Return True if names are displayed in upper case."""
+ """Print group and variable names in uppercase."""
return self._uppercase
@uppercase.setter
def uppercase(self, value):
- """Validate and set the upper case flag."""
+ """Validate and set the uppercase flag."""
if not isinstance(value, bool):
raise TypeError('uppercase attribute must be a logical type.')
self._uppercase = value
@@ -198,7 +198,11 @@ class Namelist(OrderedDict):
# Float format
@property
def floatformat(self):
- """Return the current floating point format code."""
+ """Set the namelist floating point format.
+
+ The property sets the format string for floating point numbers,
+ following the format expected by the Python ``format()`` function.
+ """
return self._floatformat
@floatformat.setter
|
Doc: Final docstring update (for now)
|
marshallward_f90nml
|
train
|
py
|
766d8ddb0e608621916cf9bc63afb8aca9d24275
|
diff --git a/integration-tests/src/test/java/tachyon/master/ServiceSocketBindIntegrationTest.java b/integration-tests/src/test/java/tachyon/master/ServiceSocketBindIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/integration-tests/src/test/java/tachyon/master/ServiceSocketBindIntegrationTest.java
+++ b/integration-tests/src/test/java/tachyon/master/ServiceSocketBindIntegrationTest.java
@@ -57,7 +57,7 @@ public class ServiceSocketBindIntegrationTest {
mExecutorService.shutdown();
}
- private final void startCluster(String bindHost) throws Exception {
+ private void startCluster(String bindHost) throws Exception {
TachyonConf tachyonConf = new TachyonConf();
for (ServiceType service : ServiceType.values()) {
tachyonConf.set(service.getBindHostKey(), bindHost);
|
removed reduntant final for private methods
|
Alluxio_alluxio
|
train
|
java
|
c73c50d5c1293f03016b70e03e267199fe41d66e
|
diff --git a/www/javascript/swat-disclosure.js b/www/javascript/swat-disclosure.js
index <HASH>..<HASH> 100644
--- a/www/javascript/swat-disclosure.js
+++ b/www/javascript/swat-disclosure.js
@@ -5,7 +5,6 @@ function SwatDisclosure(id)
// get initial state
if (this.div.className == 'swat-disclosure-container-opened') {
- alert('test');
this.opened = true;
} else {
this.opened = false;
|
Removed 'test' alert
svn commit r<I>
|
silverorange_swat
|
train
|
js
|
4d11441944b3a996499f3e1464449a6f1d49a1ba
|
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -481,7 +481,7 @@ class Puppet::Parser::Scope
#
# @param [String] name the variable name to lookup
#
- # @return Object the value of the variable, or nil if it's not found
+ # @return Object the value of the variable, or if not found; nil if `strict_variables` is false, and thrown :undefined_variable otherwise
#
# @api public
def lookupvar(name, options = EMPTY_HASH)
|
(PUP-<I>) Update documentation for Scope#lookupvar for non found var
This updates the yard docs for Scope#lookupvar with information that
it will throw :undefined_variable if `strict_variables` is turned on.
|
puppetlabs_puppet
|
train
|
rb
|
e6a88699ce41bc787659f4953933cd4dd098d04a
|
diff --git a/code/DocumentationService.php b/code/DocumentationService.php
index <HASH>..<HASH> 100644
--- a/code/DocumentationService.php
+++ b/code/DocumentationService.php
@@ -249,6 +249,7 @@ class DocumentationService {
* @param bool $major is this a major release
*/
public static function register($module, $path, $version = '', $title = false, $major = false) {
+ if(!file_exists($path)) throw new InvalidArgumentException(sprintf('Path "%s" doesn\'t exist', $path));
// add the module to the registered array
if(!isset(self::$registered_modules[$module])) {
|
MINOR Throwing exception when path is not found
|
silverstripe_silverstripe-docsviewer
|
train
|
php
|
989d689c2077753dedc5a563bd86ebe56f0f2812
|
diff --git a/cohorts/variant_filters.py b/cohorts/variant_filters.py
index <HASH>..<HASH> 100644
--- a/cohorts/variant_filters.py
+++ b/cohorts/variant_filters.py
@@ -57,6 +57,9 @@ def variant_string_to_variant(variant_str, reference="grch37"):
def load_ensembl_coverage(cohort, coverage_path, min_depth=30):
"""
Load in Pageant CoverageDepth results with Ensembl loci.
+
+ coverage_path is a path to Pageant CoverageDepth output directory, with
+ one subdirectory per patient and a `cdf.csv` file inside each patient subdir.
"""
columns = [
"NormalDepth",
@@ -80,7 +83,7 @@ def load_ensembl_coverage(cohort, coverage_path, min_depth=30):
path.join(coverage_path, patient.id, "cdf.csv"),
names=columns)
# pylint: disable=no-member
- # pylint gets confused by read_csvpylint
+ # pylint gets confused by read_csv
patient_ensembl_loci_df = patient_ensembl_loci_df[(
(patient_ensembl_loci_df.NormalDepth == min_depth) &
(patient_ensembl_loci_df.TumorDepth == min_depth))]
|
Update pylint and comment
|
hammerlab_cohorts
|
train
|
py
|
f1e14d0cb2a7a7cb574428df4a9b561b413af8bc
|
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestEncoder.java
index <HASH>..<HASH> 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestEncoder.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestEncoder.java
@@ -56,11 +56,11 @@ public class HttpRequestEncoder extends HttpObjectEncoder<HttpRequest> {
// See https://github.com/netty/netty/issues/2732
int index = uri.indexOf(QUESTION_MARK, start);
if (index == -1) {
- if (uri.lastIndexOf(SLASH) <= start) {
+ if (uri.lastIndexOf(SLASH) < start) {
needSlash = true;
}
} else {
- if (uri.lastIndexOf(SLASH, index) <= start) {
+ if (uri.lastIndexOf(SLASH, index) < start) {
uriCharSequence = new StringBuilder(uri).insert(index, SLASH);
}
}
|
Only add / to uri if really needed.
Motivation:
We not need to include the start index in the check. See <URL>
|
netty_netty
|
train
|
java
|
fae1b2e83a5e9a24e0fb38e247c7d17a25a099b6
|
diff --git a/tests/Extension/Issue1134Test.php b/tests/Extension/Issue1134Test.php
index <HASH>..<HASH> 100644
--- a/tests/Extension/Issue1134Test.php
+++ b/tests/Extension/Issue1134Test.php
@@ -26,7 +26,7 @@ final class Issue1134Test extends TestCase
/**
* @throws ReflectionException
*/
- public function testIssue914(): void
+ public function testIssue914ReflectionParamDefaultValueShouldReturnTrue(): void
{
$ref = new ReflectionClass(Issue1134::class);
$constructor = $ref->getConstructor();
|
#<I> - Rename test case method
|
phalcon_zephir
|
train
|
php
|
914dd8627d579439c9c50e8a4dde2387a84dec2f
|
diff --git a/xmlnuke-php5/src/Xmlnuke/Core/Cache/ShmopCacheEngine.class.php b/xmlnuke-php5/src/Xmlnuke/Core/Cache/ShmopCacheEngine.class.php
index <HASH>..<HASH> 100644
--- a/xmlnuke-php5/src/Xmlnuke/Core/Cache/ShmopCacheEngine.class.php
+++ b/xmlnuke-php5/src/Xmlnuke/Core/Cache/ShmopCacheEngine.class.php
@@ -36,7 +36,21 @@ use Xmlnuke\Core\Classes\BaseSingleton;
use Xmlnuke\Core\Engine\Context;
use Xmlnuke\Util\LogWrapper;
-
+/**
+ * Caching based on Unix Share Memory
+ *
+ * # ipcs -m
+ * List all segments used
+ *
+ * # ipcs -lm
+ * ------ Shared Memory Limits --------
+ * max number of segments = 4096 <--- this is SHMMNI
+ * max seg size (kbytes) = 67108864 <--- this is SHMMAX
+ * max total shared memory (kbytes) = 17179869184<- this is SHMALL
+ * min seg size (bytes) = 1
+ *
+ *
+ */
class ShmopCacheEngine extends BaseSingleton implements ICacheEngine
{
const DEFAULT_PERMISSION = "0700";
|
Updated ShmopCacheEngine comments
|
byjg_xmlnuke
|
train
|
php
|
0edb61fbfae6ecd22fe80a59a937901b9701eb70
|
diff --git a/alot/helper.py b/alot/helper.py
index <HASH>..<HASH> 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -17,6 +17,7 @@ from twisted.internet.protocol import ProcessProtocol
from twisted.internet.defer import Deferred
import StringIO
import logging
+import tempfile
def safely_get(clb, E, on_error=''):
@@ -396,3 +397,17 @@ def humanize_size(size):
if size / factor < 1024:
return format_string % (float(size) / factor)
return format_string % (size / factor)
+
+
+def parse_mailcap_nametemplate(tmplate='%s'):
+ """this returns a prefix and suffix to be used
+ in the tempfile module for a given mailcap nametemplate string"""
+ nt_list = tmplate.split('%s')
+ template_prefix = ''
+ template_suffix = ''
+ if len(nt_list) == 2:
+ template_suffix = nt_list[1]
+ template_prefix = nt_list[0]
+ else:
+ template_suffix = tmplate
+ return (template_prefix, template_suffix)
|
add helper.parse_mailcap_nametemplate
that splits a nametemplate string as given in the mailcap
sensibly into prefix and suffix
|
pazz_alot
|
train
|
py
|
0f191e2dd26168ee5ecdc52f6fa7614b4293b1da
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -155,20 +155,18 @@ var toMultiServerAddress = exports.toMultiServerAddress = function (addr) {
var isAddress = exports.isAddress = function (data) {
var host, port, id
if(isObject(data)) {
- id = data.key
- host = data.host
- port = data.port
+ id = data.key; host = data.host; port = data.port
}
else if(!isString(data)) return false
else if(isMultiServerAddress(data)) return true
else {
var parts = data.split(':')
- var id = parts.pop(), port = parts.pop(), host = parts.join(':')
- return (
- isFeedId(id) && isPort(+port)
- && isHost(host)
- )
+ id = parts.pop(); port = parts.pop(); host = parts.join(':')
}
+ return (
+ isFeedId(id) && isPort(+port)
+ && isHost(host)
+ )
}
//This is somewhat fragile, because maybe non-shs protocols get added...
@@ -335,3 +333,7 @@ exports.extract =
+
+
+
+
|
allow `isAddress({key, host, port})` which is used by scuttlebot/plugins/gossip/init - removing this was a breaking change, with unfortunately no test coverage
|
ssbc_ssb-ref
|
train
|
js
|
b51956a9a7659accd83f2c84249f758c063661de
|
diff --git a/core/src/main/java/org/mapfish/print/config/ConfigurationException.java b/core/src/main/java/org/mapfish/print/config/ConfigurationException.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/mapfish/print/config/ConfigurationException.java
+++ b/core/src/main/java/org/mapfish/print/config/ConfigurationException.java
@@ -4,7 +4,12 @@ package org.mapfish.print.config;
* Represents an error made in the config.yaml file.
*/
public class ConfigurationException extends RuntimeException {
- private Configuration configuration;
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5693438899003802581L;
+
/**
* Constructor.
@@ -25,13 +30,4 @@ public class ConfigurationException extends RuntimeException {
public ConfigurationException(final String message, final Throwable cause) {
super(message, cause);
}
-
-
- public final Configuration getConfiguration() {
- return this.configuration;
- }
-
- public final void setConfiguration(final Configuration configuration) {
- this.configuration = configuration;
- }
}
|
SonarCube issues.
* ConfigurationException: Remove unused field.
|
mapfish_mapfish-print
|
train
|
java
|
9044ee921e1ec67eda74a748a7ac2ca378895ea1
|
diff --git a/src/middleware/dialogManager.js b/src/middleware/dialogManager.js
index <HASH>..<HASH> 100644
--- a/src/middleware/dialogManager.js
+++ b/src/middleware/dialogManager.js
@@ -137,20 +137,20 @@ Dialog.prototype._continueDialog = function (context, next) {
var intentFilter = dialog.steps[sessionDialog.step];
if (typeof intentFilter == "function") {
+ // Dialog step has no intent filter, invoke dialogFunc
dialogFunc = intentFilter;
intentFilter = null;
+ } else if (intentFilter && !intentFilter.includes(context[BOT.Intent]) && !intentFilter.includes('*')) {
+ // No matching intent for current dialog step, see if we should start another dialog
+ return this._matchBeginDialog(context, next);
} else {
+ // Match with current dialog step intent filter, advance and invoke dialogFunc
sessionDialog.step++;
dialogFunc = dialog.steps[sessionDialog.step];
}
sessionDialog.step++;
- if (intentFilter && !intentFilter.includes(context[BOT.Intent]) && !intentFilter.includes('*')) {
- context[BOT.Session][BOT.CurrentDialog] = null;
- return this._matchBeginDialog(context, next);
- }
-
return dialogFunc(context, next);
}
|
don't exit the current dialog just because no match was found in the current dialog step
|
iopa-io_iopa-bot
|
train
|
js
|
071791b8de4f4c2a6d251800c05d238213d9db82
|
diff --git a/simuvex/s_cc.py b/simuvex/s_cc.py
index <HASH>..<HASH> 100644
--- a/simuvex/s_cc.py
+++ b/simuvex/s_cc.py
@@ -57,7 +57,7 @@ class SimCC(object):
e = state.BVV(expr, state.arch.bits)
elif type(expr) in (str,):
e = state.BVV(expr)
- elif not isinstance(expr, (claripy.A, SimActionObject)):
+ elif not isinstance(expr, (claripy.Base, SimActionObject)):
raise SimCCError("can't set argument of type %s" % type(expr))
else:
e = expr
|
make SimCC work with typedast
|
angr_angr
|
train
|
py
|
7f44a928d2a69fcbf4609b93470c1bd8a8b035a6
|
diff --git a/allennlp/common/registrable.py b/allennlp/common/registrable.py
index <HASH>..<HASH> 100644
--- a/allennlp/common/registrable.py
+++ b/allennlp/common/registrable.py
@@ -48,9 +48,9 @@ class Registrable(FromParams):
Parameters
----------
- name: ``str``
+ name : ``str``
The name to register the class under.
- exist_ok: ``bool`, optional (default=False)
+ exist_ok : ``bool``, optional (default=False)
If True, overwrites any existing models registered under ``name``. Else,
throws an error if a model is already registered under ``name``.
"""
|
Fixup to a single docstring. (#<I>)
|
allenai_allennlp
|
train
|
py
|
a44c9d5c01c4d56ecb5d419e74cd1f00e91d99f7
|
diff --git a/test/watchCases/parsing/switching-harmony/0/index.js b/test/watchCases/parsing/switching-harmony/0/index.js
index <HASH>..<HASH> 100644
--- a/test/watchCases/parsing/switching-harmony/0/index.js
+++ b/test/watchCases/parsing/switching-harmony/0/index.js
@@ -11,11 +11,11 @@ it("should flag modules correctly", function() {
require("./hh").default.should.be.eql("hh" + WATCH_STEP);
require("./cc").should.be.eql("cc" + WATCH_STEP);
switch(WATCH_STEP) {
- case 0:
+ case "0":
require("./hc").default.should.be.eql("hc0");
require("./ch").should.be.eql("ch0");
break;
- case 1:
+ case "1":
require("./hc").should.be.eql("hc1");
require("./ch").default.should.be.eql("ch1");
break;
|
WATCH_STEP is a string
|
webpack_webpack
|
train
|
js
|
a846705ee85218c317f52d04458fc5eee2ce4f80
|
diff --git a/client/getobject.go b/client/getobject.go
index <HASH>..<HASH> 100644
--- a/client/getobject.go
+++ b/client/getobject.go
@@ -46,7 +46,7 @@ func (obj *GetObject) Content() ([]byte, error) {
if obj == nil {
return nil, nil
}
- if len(obj.Blob) == 0 {
+ if len(obj.Blob) > 0 || obj.Location == "" {
return obj.Blob, nil
}
resp, err := http.Get(obj.Location)
|
lets return something if there is seomthign... ugh
|
jpfielding_gorets
|
train
|
go
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.