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 |
|---|---|---|---|---|---|
174c77f4814f6f2816cdb4a39cfd37402a0c684a | diff --git a/aws/resource_aws_backup_vault_policy_test.go b/aws/resource_aws_backup_vault_policy_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_backup_vault_policy_test.go
+++ b/aws/resource_aws_backup_vault_policy_test.go
@@ -78,6 +78,7 @@ func TestAccAwsBackupVaultPolicy_basic(t *testing.T) {
resourceName := "aws_backup_vault_policy.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) },
+ ErrorCheck: testAccErrorCheck(t, backup.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsBackupVaultPolicyDestroy,
Steps: []resource.TestStep{
@@ -111,6 +112,7 @@ func TestAccAwsBackupVaultPolicy_disappears(t *testing.T) {
resourceName := "aws_backup_vault_policy.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) },
+ ErrorCheck: testAccErrorCheck(t, backup.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsBackupVaultPolicyDestroy,
Steps: []resource.TestStep{ | tests/r/backup_vault_policy: Add ErrorCheck | terraform-providers_terraform-provider-aws | train | go |
219da7cd3092950c7136307a36f591d064918ac0 | diff --git a/scripts/release/independent/plugins/github/publish.js b/scripts/release/independent/plugins/github/publish.js
index <HASH>..<HASH> 100644
--- a/scripts/release/independent/plugins/github/publish.js
+++ b/scripts/release/independent/plugins/github/publish.js
@@ -47,6 +47,8 @@ module.exports = (pluginConfig = {}) => {
target_commitish: config.branch
};
+ logger.log("RELEASE NOTES\n%s\n", release.body);
+
if (config.preview) {
logger.log("GitHub release data:\n%s", JSON.stringify(release, null, 2));
logger.log("Tagger:\n%s", JSON.stringify(tagger, null, 2));
diff --git a/scripts/release/packages/plugins/github/publish.js b/scripts/release/packages/plugins/github/publish.js
index <HASH>..<HASH> 100644
--- a/scripts/release/packages/plugins/github/publish.js
+++ b/scripts/release/packages/plugins/github/publish.js
@@ -27,6 +27,8 @@ module.exports = (pluginConfig = {}) => {
target_commitish: config.branch
};
+ logger.log("RELEASE NOTES\n%s\n", release.body);
+
let tagger = null;
// Get current user to construct proper tagger data. | release: print release notes in raw markdown. | Webiny_webiny-js | train | js,js |
7f93c4f1f468c6aa0ac9af9343af73bd925e8652 | diff --git a/SwatDB/SwatDBDataObject.php b/SwatDB/SwatDBDataObject.php
index <HASH>..<HASH> 100644
--- a/SwatDB/SwatDBDataObject.php
+++ b/SwatDB/SwatDBDataObject.php
@@ -242,14 +242,6 @@ class SwatDBDataObject extends SwatObject
}
// }}}
- // {{{ protected function hasSubDataObject()
-
- protected function hasSubDataObject($name)
- {
- return array_key_exists($name, $this->sub_data_objects);
- }
-
- // }}}
// {{{ protected function setInternalValue()
protected function setInternalValue($name, $value)
@@ -447,6 +439,13 @@ class SwatDBDataObject extends SwatObject
public function save() {
$this->checkDB();
$this->saveInternal();
+
+ foreach ($this->sub_data_objects as $name => $object) {
+ $saver_method = 'save'.$name;
+
+ if (method_exists($this, $saver_method))
+ call_user_func(array($this, $saver_method));
+ }
}
// }}} | Remove hasSubDataObject() method.
Make saving subdataobjects parallel to loading subdataobjects.
svn commit r<I> | silverorange_swat | train | php |
1e370823b903edcfe45be302f4cbb857bc257759 | diff --git a/app/models/renalware/pathology/view_current_observation_results.rb b/app/models/renalware/pathology/view_current_observation_results.rb
index <HASH>..<HASH> 100644
--- a/app/models/renalware/pathology/view_current_observation_results.rb
+++ b/app/models/renalware/pathology/view_current_observation_results.rb
@@ -24,11 +24,12 @@ module Renalware
end
def sort_results(results)
- @descriptions
- .map do |description|
- results.detect {|result| result.description_code == description.code }
- end
- .compact
+ @descriptions.map { |description| find_result_for_description(results, description) }
+ .compact
+ end
+
+ def find_result_for_description(results, description)
+ results.detect {|result| result.description_code == description.code }
end
def present(results) | Extract intention revealing method
Clean up formatting of method | airslie_renalware-core | train | rb |
c95535c61e1cec04b2f0dfca92c00400642af2f4 | diff --git a/police_api/version.py b/police_api/version.py
index <HASH>..<HASH> 100644
--- a/police_api/version.py
+++ b/police_api/version.py
@@ -1 +1 @@
-__version__ = '1.0.2'
+__version__ = '1.0.3dev' | The next version will be <I> | rkhleics_police-api-client-python | train | py |
91ca6d7bf1acdc214c3d101c9d41a3367a9b9237 | diff --git a/lib/frame_output_stream.js b/lib/frame_output_stream.js
index <HASH>..<HASH> 100644
--- a/lib/frame_output_stream.js
+++ b/lib/frame_output_stream.js
@@ -17,6 +17,8 @@ function FrameOutputStream(destination){
destination.on("close", finish);
destination.on("finish", finish);
+ destination.on("drain", service.bind(null, this));
+
this._frame = null;
this._queue = [];
} | Service the frame output stream on drain event | gdaws_node-stomp | train | js |
b12b8346fc213e8dd1600e2067dcd2f68c45b66d | diff --git a/views/js/qtiCreator/widgets/interactions/helpers/answerState.js b/views/js/qtiCreator/widgets/interactions/helpers/answerState.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCreator/widgets/interactions/helpers/answerState.js
+++ b/views/js/qtiCreator/widgets/interactions/helpers/answerState.js
@@ -79,12 +79,8 @@ define([
editMapping = (_.indexOf(['MAP_RESPONSE', 'MAP_RESPONSE_POINT'], template) >= 0),
defineCorrect = answerStateHelper.defineCorrect(response);
- if(!template){
- if(rp.processingType === 'custom'){
- template = 'CUSTOM';
- }else{
- throw 'invalid response template';
- }
+ if(!template || rp.processingType === 'custom'){
+ template = 'CUSTOM';
}
widget.$responseForm.html(responseFormTpl({ | fixed condition for custom rp detection durint initResponseForm() | oat-sa_extension-tao-itemqti | train | js |
922b82e9da14127f0e4cc6c4c341c03b0c9af6dd | diff --git a/packages/teraslice-cli/cmds/assets/load.js b/packages/teraslice-cli/cmds/assets/load.js
index <HASH>..<HASH> 100644
--- a/packages/teraslice-cli/cmds/assets/load.js
+++ b/packages/teraslice-cli/cmds/assets/load.js
@@ -17,7 +17,7 @@ exports.builder = (yargs) => {
cli().args('assets', 'load', yargs);
yargs.option('a', {
alias: 'arch',
- describe: 'The node version of the Teraslice cluster, like: `x32`, `x64`.'
+ describe: 'TThe architecture of the Teraslice cluster, like: `x32`, `x64`.'
+ ' Determined automatically on newer Teraslice releases.'
});
yargs.option('n', { | Update packages/teraslice-cli/cmds/assets/load.js | terascope_teraslice | train | js |
5e49df7035eebb3464718ebc77dcf1c8363bc127 | diff --git a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php
index <HASH>..<HASH> 100644
--- a/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php
+++ b/modules/social_features/social_event/modules/social_event_invite/src/SocialEventInviteBulkHelper.php
@@ -157,7 +157,7 @@ class SocialEventInviteBulkHelper {
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
- public function bulkInviteUsersEmails(array $users, $nid, array &$context) {
+ public static function bulkInviteUsersEmails(array $users, $nid, array &$context) {
$results = [];
foreach ($users as $user) { | Issue #<I> by ronaldtebrake: we call this function statically so lets make it static | goalgorilla_open_social | train | php |
52b4692be9f621629bfade4ec1e2769c0fcaba83 | diff --git a/nameko/testing/pytest.py b/nameko/testing/pytest.py
index <HASH>..<HASH> 100644
--- a/nameko/testing/pytest.py
+++ b/nameko/testing/pytest.py
@@ -322,7 +322,7 @@ def web_config(empty_config):
port = find_free_port()
cfg = empty_config
- cfg[WEB_SERVER_CONFIG_KEY] = str(port)
+ cfg[WEB_SERVER_CONFIG_KEY] = "127.0.0.1:{}".format(port)
return cfg | try explictly binding to <I> | nameko_nameko | train | py |
db3d641e19a6db2587983c44f0fb30cf84fad076 | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -4312,7 +4312,7 @@ window.CodeMirror = (function() {
if (!order) return f(from, to, "ltr");
for (var i = 0; i < order.length; ++i) {
var part = order[i];
- if (part.from < to && part.to > from)
+ if (part.from < to && part.to > from || from == to && part.to == from)
f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");
}
} | Fix bug in iterateBidiSections
When the from and to arguments were equal and the line had an order, it
would never call the callback.
Issue #<I> | codemirror_CodeMirror | train | js |
885953567ba13d0232ee7d7103cbfa88dc8a6ca0 | diff --git a/phoxy.js b/phoxy.js
index <HASH>..<HASH> 100755
--- a/phoxy.js
+++ b/phoxy.js
@@ -88,7 +88,11 @@ var phoxy =
{ // called as phoxy rpc
func = function()
{
- phoxy.ApiRequest(ejs, replace_callback);
+ phoxy.AJAX(ejs, function(data, callback)
+ {
+ data.result = id;
+ phoxy.ApiAnswer(data, callback);
+ }, [replace_callback]);
};
}
} | Make DeferRender work correctly when request php directly | phoxy_phoxy | train | js |
dca75d6d71236cd6579a3a429f74b4f503dd3e82 | diff --git a/openquake/engine/calculators/hazard/general.py b/openquake/engine/calculators/hazard/general.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/calculators/hazard/general.py
+++ b/openquake/engine/calculators/hazard/general.py
@@ -495,10 +495,12 @@ class BaseHazardCalculator(base.Calculator):
yield task_args
n += 1
+ if self.__class__.__name__ == 'DisaggHazardCalculator': # kludge
+ return # the tasks management is different in the calculator
+ # this should be managed in a saner way
+
# sanity check to protect against future changes of the distribution
num_tasks = models.JobStats.objects.get(oq_job=self.job.id).num_tasks
- if num_tasks != n:
- import pdb; pdb.set_trace()
assert num_tasks == n, 'Expected %d tasks, got %d' % (num_tasks, n)
def _get_realizations(self): | Added a sanity check to make sure that the stored num_tasks is correct | gem_oq-engine | train | py |
b026b08e0414d85409ad2875202983a3aaa96f64 | diff --git a/src/Utils.php b/src/Utils.php
index <HASH>..<HASH> 100644
--- a/src/Utils.php
+++ b/src/Utils.php
@@ -154,7 +154,7 @@ class Utils {
$extension_root = FALSE;
for ($i = 1; $i <= 5; $i++) {
$info_file = $directory . '/' . basename($directory) . '.info';
- if (file_exists($info_file) || file_exists($info_file . '.yml')) {
+ if ((file_exists($info_file) && basename($directory) !== 'drush') || file_exists($info_file . '.yml')) {
$extension_root = $directory;
break;
} | Merge pull request #<I> from weitzman/patch-5
Avoid recognizing drush.info file | Chi-teck_drupal-code-generator | train | php |
000eed05d39fea663581a16b607a6b8be9c54333 | diff --git a/progressbar/__about__.py b/progressbar/__about__.py
index <HASH>..<HASH> 100644
--- a/progressbar/__about__.py
+++ b/progressbar/__about__.py
@@ -19,7 +19,7 @@ A Python Progressbar library to provide visual (yet text based) progress to
long running operations.
'''.strip().split())
__email__ = 'wolph@wol.ph'
-__version__ = '3.35.0'
+__version__ = '3.35.1'
__license__ = 'BSD'
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
__url__ = 'https://github.com/WoLpH/python-progressbar' | Incrementing version to <I> | WoLpH_python-progressbar | train | py |
fafbfff4ce1eb1ddebc4ba4c46c3664c025cdb81 | diff --git a/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java b/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java
index <HASH>..<HASH> 100644
--- a/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java
+++ b/BaragonService/src/main/java/com/hubspot/baragon/service/worker/BaragonRequestWorker.java
@@ -83,7 +83,7 @@ public class BaragonRequestWorker implements Runnable {
case PENDING:
final Map<String, String> conflicts = requestManager.getBasePathConflicts(request);
- if (!conflicts.isEmpty()) {
+ if (!conflicts.isEmpty() && !(request.getAction().or(RequestAction.UPDATE) == RequestAction.DELETE)) {
requestManager.setRequestMessage(request.getLoadBalancerRequestId(), String.format("Invalid request due to base path conflicts: %s", conflicts));
return InternalRequestStates.INVALID_REQUEST_NOOP;
}
@@ -102,7 +102,9 @@ public class BaragonRequestWorker implements Runnable {
}
}
- requestManager.lockBasePaths(request);
+ if (!(request.getAction().or(RequestAction.UPDATE) == RequestAction.DELETE)) {
+ requestManager.lockBasePaths(request);
+ }
return InternalRequestStates.SEND_APPLY_REQUESTS; | don't require lock for a delete | HubSpot_Baragon | train | java |
d8a9244d533daebba3840138d9fbb262d3bc7870 | diff --git a/tests/Kwc/FavouritesSelenium/SeleniumTest.php b/tests/Kwc/FavouritesSelenium/SeleniumTest.php
index <HASH>..<HASH> 100644
--- a/tests/Kwc/FavouritesSelenium/SeleniumTest.php
+++ b/tests/Kwc/FavouritesSelenium/SeleniumTest.php
@@ -38,6 +38,7 @@ class Kwc_FavouritesSelenium_SeleniumTest extends Kwf_Test_SeleniumTestCase
// click on fav-icon to favourise
$this->click("css=.switchLink > a");
+ sleep(1);
$this->assertText('css=.kwcFavouritesPageComponentFavouritesCount', '3');
//reload to check if persistent
@@ -46,6 +47,7 @@ class Kwc_FavouritesSelenium_SeleniumTest extends Kwf_Test_SeleniumTestCase
// click on fav-icon to defavourise
$this->click("css=.switchLink > a");
+ sleep(1);
$this->assertText('css=.kwcFavouritesPageComponentFavouritesCount', '2');
//reload to check if persistent | Add sleep to wait for javascript finished
Till now it asserted before javascript was finished | koala-framework_koala-framework | train | php |
d3fcabbc947467724bb9754b5abb4c0489dde2dd | diff --git a/bin/iTol.py b/bin/iTol.py
index <HASH>..<HASH> 100755
--- a/bin/iTol.py
+++ b/bin/iTol.py
@@ -136,7 +136,7 @@ def main():
# calculate analysis results
categories = None
- if args.map_categories is not None:
+ if args.map_categories is not None and args.analysis_metric != "raw":
categories = args.map_categories.split(",")
# set transform if --stabilize_variance is specfied | Fixes bug in iTol.py when calculating raw abundance
If a user sets the analysis metric to "raw" and also specifies a category (-c) then the abundance calculation per OTU is split between the groups instead of being calculated across all samples.
The fix simply ignores the -c option if the analysis metric is set to raw. | smdabdoub_phylotoast | train | py |
72baf5f6dd66788508044371f5ad8e3c15f08950 | diff --git a/packages/embark-api-client/src/index.js b/packages/embark-api-client/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/embark-api-client/src/index.js
+++ b/packages/embark-api-client/src/index.js
@@ -41,20 +41,14 @@ function request(type, path, params = {}) {
}
function get() {
- console.dir("== get");
- console.dir(...arguments);
return request('get', ...arguments);
}
function post() {
- console.dir("== post");
- console.dir(...arguments);
return request('post', ...arguments);
}
function destroy() {
- console.dir("== destroy");
- console.dir(...arguments);
return request('delete', ...arguments);
} | refactor(@embark/api-client): remove console.dir statements used during development | embark-framework_embark | train | js |
05d11ec45fd15e48e4c7fead84d32117ca0f33e3 | diff --git a/compiled/computed/filtered-query.js b/compiled/computed/filtered-query.js
index <HASH>..<HASH> 100644
--- a/compiled/computed/filtered-query.js
+++ b/compiled/computed/filtered-query.js
@@ -10,7 +10,7 @@ module.exports = function () {
var result = {};
for (var key in this.query) {
- if (this.query[key] !== '') {
+ if (this.query[key] !== '' && this.filterable(key)) {
result[key] = this.query[key];
}
}
diff --git a/lib/computed/filtered-query.js b/lib/computed/filtered-query.js
index <HASH>..<HASH> 100644
--- a/lib/computed/filtered-query.js
+++ b/lib/computed/filtered-query.js
@@ -3,15 +3,15 @@ module.exports = function() {
if (typeof this.query!=='object' || this.opts.sendEmptyFilters) {
return this.query;
}
-
+
var result = {};
for (var key in this.query) {
- if (this.query[key]!=='') {
+ if (this.query[key]!=='' && this.filterable(key)) {
result[key] = this.query[key];
}
}
return result;
-}
\ No newline at end of file
+} | remove non-filterable columns from query (#<I>) | matfish2_vue-tables-2 | train | js,js |
b62adc3743f6692742dce5f72464926bd2aea5b2 | diff --git a/MY_Model.php b/MY_Model.php
index <HASH>..<HASH> 100644
--- a/MY_Model.php
+++ b/MY_Model.php
@@ -235,7 +235,8 @@ class MY_Model extends CI_Model {
$this->db->where($this->schema['_id']['field'], $id);
$this->db->limit(1);
$row = $this->db->get()->row_array();
- $this->Row($row);
+ if ($row)
+ $this->Row($row);
return $this->SetCache('get', $id, $row);
}
@@ -256,7 +257,8 @@ class MY_Model extends CI_Model {
$this->db->where($param, $value);
$this->db->limit(1);
$row = $this->db->get()->row_array();
- $this->Row($row);
+ if ($row)
+ $this->Row($row);
return $this->SetCache('getby', $cacheid, $row);
} | BUGFIX: Get() and GetBy() no longer get upset if nothing matches | hash-bang_Joyst | train | php |
17c5b17619e9891ec0cdddc51352c92d8f8befe5 | diff --git a/lib/ibandit/iban.rb b/lib/ibandit/iban.rb
index <HASH>..<HASH> 100644
--- a/lib/ibandit/iban.rb
+++ b/lib/ibandit/iban.rb
@@ -20,7 +20,7 @@ module Ibandit
def to_s(format = :compact)
case format
- when :compact then iban
+ when :compact then iban.to_s
when :formatted then formatted
else raise ArgumentError, "invalid format '#{format}'"
end
@@ -215,7 +215,7 @@ module Ibandit
end
def formatted
- iban.gsub(/(.{4})/, '\1 ').strip
+ iban.to_s.gsub(/(.{4})/, '\1 ').strip
end
end
end
diff --git a/spec/ibandit/iban_spec.rb b/spec/ibandit/iban_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/ibandit/iban_spec.rb
+++ b/spec/ibandit/iban_spec.rb
@@ -91,6 +91,12 @@ describe Ibandit::IBAN do
end
specify { expect { iban.to_s(:russian) }.to raise_error ArgumentError }
+
+ context 'with the IBAN is nil' do
+ let(:arg) { { country_code: 'GB' } }
+ its(:to_s) { is_expected.to_not be_nil }
+ specify { expect(iban.to_s(:formatted)).to be_empty }
+ end
end
############### | Don't ever return nil from IBAN#to_s, even if IBAN#iban is nil | gocardless_ibandit | train | rb,rb |
90a3d8588046b6117bcb8448620f74ec91cc0fab | diff --git a/redis/pool.go b/redis/pool.go
index <HASH>..<HASH> 100644
--- a/redis/pool.go
+++ b/redis/pool.go
@@ -381,21 +381,17 @@ func (p *Pool) waitVacantConn(ctx context.Context) (waited time.Duration, err er
start = time.Now()
}
- if ctx == nil {
- <-p.ch
- } else {
+ select {
+ case <-p.ch:
+ // Additionally check that context hasn't expired while we were waiting,
+ // because `select` picks a random `case` if several of them are "ready".
select {
- case <-p.ch:
- // Additionally check that context hasn't expired while we were waiting,
- // because `select` picks a random `case` if several of them are "ready".
- select {
- case <-ctx.Done():
- return 0, ctx.Err()
- default:
- }
case <-ctx.Done():
return 0, ctx.Err()
+ default:
}
+ case <-ctx.Done():
+ return 0, ctx.Err()
}
if wait { | chore: Remove unneeded ctx == nil check (#<I>)
Remove an check for ctx being nil which is no longer possible. | gomodule_redigo | train | go |
2c0513e3321540ab87c04832bd852cb32e0558b7 | diff --git a/tests/integration/test_main.py b/tests/integration/test_main.py
index <HASH>..<HASH> 100644
--- a/tests/integration/test_main.py
+++ b/tests/integration/test_main.py
@@ -656,4 +656,3 @@ class Test_Main(GitRepoMainTestCase):
def test_z_noop(self):
self.main_noop('guyzmo/git-repo', 1)
- | 🚧 configuration loop can now configure custom services | guyzmo_git-repo | train | py |
7d74f07bb908c23519a80af67592d6ef0af42f10 | diff --git a/packages/neos-ui-editors/src/Editors/Range/index.js b/packages/neos-ui-editors/src/Editors/Range/index.js
index <HASH>..<HASH> 100755
--- a/packages/neos-ui-editors/src/Editors/Range/index.js
+++ b/packages/neos-ui-editors/src/Editors/Range/index.js
@@ -36,14 +36,6 @@ class RangeEditor extends PureComponent {
}
};
- state = {
- value: 0
- };
-
- componentDidMount() {
- this.setState({value: this.props.value});
- }
-
handleChange = event => {
const {options} = this.props;
const {target} = event;
@@ -55,7 +47,6 @@ class RangeEditor extends PureComponent {
value = Math.min(options.max, Math.max(options.min, value));
- this.setState({value});
this.props.commit(value);
this.forceUpdate();
@@ -69,7 +60,7 @@ class RangeEditor extends PureComponent {
render() {
const options = {...this.constructor.defaultProps.options, ...this.props.options};
- const {value} = this.state;
+ const { value } = this.props;
return (
<div className={style.rangeEditor + (options.disabled ? ' ' + style.rangeEditorDisabled : '')}> | Fix: Reflect the old value if discard button is pressed | neos_neos-ui | train | js |
e87c5bc2d91e1794daff02598aadd46c9fb18ffa | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -194,7 +194,13 @@ class ServerlessIotLocal {
const client = mqtt.connect(`ws://localhost:${httpPort}/mqqt`)
client.on('error', console.error)
+
+ const connectMonitor = setInterval(() => {
+ this.log(`still haven't connected to local Iot broker!`)
+ }, 5000).unref()
+
client.on('connect', () => {
+ clearInterval(connectMonitor)
this.log('connected to local Iot broker')
for (let topicMatcher in topicsToFunctionsMap) {
client.subscribe(topicMatcher) | feat: monitor initial connection to broker, log if unable to connect | tradle_serverless-iot-local | train | js |
70804b73c182ce0dbf21d1e33ac5f720a0ddb5e0 | diff --git a/api-put-object-streaming.go b/api-put-object-streaming.go
index <HASH>..<HASH> 100644
--- a/api-put-object-streaming.go
+++ b/api-put-object-streaming.go
@@ -171,7 +171,7 @@ func (c *Client) putObjectMultipartStreamFromReadAt(ctx context.Context, bucketN
}
n, rerr := readFull(io.NewSectionReader(reader, readOffset, partSize), partsBuf[w-1][:partSize])
- if rerr != nil && rerr != io.ErrUnexpectedEOF && err != io.EOF {
+ if rerr != nil && rerr != io.ErrUnexpectedEOF && rerr != io.EOF {
uploadedPartsCh <- uploadedPartRes{
Error: rerr,
} | fix cond expression referring wrong error variable (#<I>) | minio_minio-go | train | go |
018eeed2807b6f8fac299b804a93f6db007832e3 | diff --git a/xbmcswift2/xbmcmixin.py b/xbmcswift2/xbmcmixin.py
index <HASH>..<HASH> 100644
--- a/xbmcswift2/xbmcmixin.py
+++ b/xbmcswift2/xbmcmixin.py
@@ -144,7 +144,7 @@ class XBMCMixin(object):
ret = xbmcgui.Dialog().select('A storage file is corrupted. It'
' is recommended to clear it.',
choices)
- if choices[ret] == 'Clear storage':
+ if ret == 0:
os.remove(filename)
storage = TimedStorage(filename, file_format, TTL)
else: | Fix #<I>. Handle cancelling of clear storage dialog | jbeluch_xbmcswift2 | train | py |
dfedc0c64cbf9dfc861d7e0ff5a1803b4015f834 | diff --git a/config/webpack-config.js b/config/webpack-config.js
index <HASH>..<HASH> 100644
--- a/config/webpack-config.js
+++ b/config/webpack-config.js
@@ -13,14 +13,6 @@ const COMMON_BUNDLE_NAME = 'common.js';
Runs code through Babel and uses global supported browser list. */
const COMMON_MODULE_CONFIG = {
rules: [ {
- test: /\.js$/,
- exclude: {
- test: /node_modules/,
-
- /* The below regex will capture all node modules that start with `cf`
- or atomic-component. Regex test: https://regex101.com/r/zizz3V/1/. */
- exclude: /node_modules\/(?:cf.+|atomic-component)/
- },
use: {
loader: 'babel-loader?cacheDirectory=true',
options: { | Remove test and exclude from webpack-config | cfpb_capital-framework | train | js |
b49a7ddce18a35a39fd5b3f6003d4a02cbd09b0e | diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -479,7 +479,6 @@ module ActionController
@request.session["flash"].sweep
@controller.request = @request
- @controller.params.merge!(parameters)
build_request_uri(action, parameters)
@controller.class.class_eval { include Testing }
@controller.recycle! | We dont need to merge in the parameters as thats all being reset by the rack headers (and its causing problems for Strong Parameters attempt of wrapping request.parameters because it will change in testing) | rails_rails | train | rb |
d0ac709b70784dbf58f309e2b3250ae385abdf30 | diff --git a/src/Psalm/Internal/Type/AssertionReconciler.php b/src/Psalm/Internal/Type/AssertionReconciler.php
index <HASH>..<HASH> 100644
--- a/src/Psalm/Internal/Type/AssertionReconciler.php
+++ b/src/Psalm/Internal/Type/AssertionReconciler.php
@@ -2435,7 +2435,14 @@ class AssertionReconciler extends \Psalm\Type\Reconciler
$existing_type_part->type_params
);
}
- } elseif ($atomic_comparison_results->type_coerced) {
+ } elseif (TypeAnalyzer::isAtomicContainedBy(
+ $codebase,
+ $existing_type_part,
+ $new_type_part,
+ true,
+ false,
+ null
+ )) {
$has_local_match = true;
$matching_atomic_types[] = $existing_type_part;
} | Use more robust, if slower, mechanism that’s intersection-safe | vimeo_psalm | train | php |
c9ec828d4c5430f04769fbd5acba0a1374fa2ce9 | diff --git a/lib/rb1drv/onedrive_dir.rb b/lib/rb1drv/onedrive_dir.rb
index <HASH>..<HASH> 100644
--- a/lib/rb1drv/onedrive_dir.rb
+++ b/lib/rb1drv/onedrive_dir.rb
@@ -15,7 +15,7 @@ module Rb1drv
# @return [Array<OneDriveDir,OneDriveFile>] directories and files whose parent is current directory
def children
return [] if child_count <= 0
- @cached_children ||= @od.request("#{api_path}/children")['value'].map do |child|
+ @cached_children ||= @od.request("#{api_path}/children?$top=1000")['value'].map do |child|
OneDriveItem.smart_new(@od, child)
end
end | Return at most <I> children | msg7086_rb1drv | train | rb |
80251e3bbca65f6c04b35d8ed0a1e527e6e136f6 | diff --git a/src/obj.js b/src/obj.js
index <HASH>..<HASH> 100644
--- a/src/obj.js
+++ b/src/obj.js
@@ -77,12 +77,12 @@ void function (root) { var __old, obj
if (typeof exports == 'undefined') {
if (!root.black) root.black = { }
- __old = root.obj.obj
- obj = root.obj.obj = { }
+ __old = root.black.obj
+ obj = root.black..obj = { }
///// Method obj.make_local ////////////////////////////////////////////
obj.make_local = function() {
- root.obj = __old
+ root.black.obj = __old
return obj }}
else
obj = exports | fixes exporting to platforms without commonjs modules support. | sorellabs_black | train | js |
02b43c619343e7551ce816c23f451fd7a5b36a5f | diff --git a/spec/unit/delegate_spec.rb b/spec/unit/delegate_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/delegate_spec.rb
+++ b/spec/unit/delegate_spec.rb
@@ -27,6 +27,24 @@ describe "PM::Delegate" do
end
+ it "should return the registered push notification types as an array" do
+ @subject.registered_push_notifications.should == []
+ bits = 0
+ types = []
+ { badge: UIRemoteNotificationTypeBadge,
+ sound: UIRemoteNotificationTypeSound,
+ alert: UIRemoteNotificationTypeAlert,
+ newsstand: UIRemoteNotificationTypeNewsstandContentAvailability }.each do |symbol, bit|
+ UIApplication.sharedApplication.stub!(:enabledRemoteNotificationTypes, return: bit)
+ @subject.registered_push_notifications.should == [symbol]
+
+ bits |= bit
+ types << symbol
+ UIApplication.sharedApplication.stub!(:enabledRemoteNotificationTypes, return: bits)
+ @subject.registered_push_notifications.should == types
+ end
+ end
+
it "should return false for was_launched if the app is currently active on screen" do
@subject.mock!(:on_push_notification) do |notification, was_launched|
was_launched.should.be.false | Add a test for DelegateNotifications#registered_push_notifications | infinitered_ProMotion | train | rb |
57788c8a467b4e3ae3225e008522009a1ef3bb77 | diff --git a/lib/auto_html.rb b/lib/auto_html.rb
index <HASH>..<HASH> 100644
--- a/lib/auto_html.rb
+++ b/lib/auto_html.rb
@@ -1,7 +1,5 @@
require File.join(File.dirname(__FILE__), 'filter')
require File.join(File.dirname(__FILE__), 'builder')
-require 'rubygems'
-require 'active_support'
module AutoHtml
def self.add_filter(name, &block)
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,3 +1,6 @@
+require 'rubygems'
+require 'active_support'
+
require File.dirname(__FILE__) + '/../lib/auto_html'
require File.dirname(__FILE__) + '/../lib/auto_html_for' | Moved requiring rubygems & active_support to spec_helper | dejan_auto_html | train | rb,rb |
a50b6c176d1daf0ec4f600a6838352f6e04eb45b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@ long_description = ''.join(long_description)
setup(
name='luigi',
- version='1.0.15',
+ version='1.0.16',
description='Workflow mgmgt + task scheduling + dependency resolution',
long_description=long_description,
author='Erik Bernhardsson', | bumped version to <I> | spotify_luigi | train | py |
59b2546c2dd119ded4c41e43404c3ad669db4485 | diff --git a/components/query-assist/query-assist.test.js b/components/query-assist/query-assist.test.js
index <HASH>..<HASH> 100644
--- a/components/query-assist/query-assist.test.js
+++ b/components/query-assist/query-assist.test.js
@@ -251,22 +251,22 @@ describe('Query Assist', () => {
});
- // it('should render nothing on empty query', function () {
- // this.renderQueryAssist({
- // query: ''
- // });
- //
- // this.queryAssist.input.textContent.should.be.empty;
- // });
-
- it('should render nothing on falsy query', function () {
+ it('should render nothing on empty query', function () {
this.renderQueryAssist({
- query: null
+ query: ''
});
this.queryAssist.input.textContent.should.be.empty;
});
+ // it('should render nothing on falsy query', function () {
+ // this.renderQueryAssist({
+ // query: null
+ // });
+ //
+ // this.queryAssist.input.textContent.should.be.empty;
+ // });
+
it('Shouldnt make duplicate requests for styleRanges on initiating if query is provided', function () {
this.renderQueryAssist(); | RING-UI-CR-<I> merge master. Mute some tests to make build pass
Former-commit-id: <I>b0f<I>d2f<I>b<I>f9f<I>c3eb3de<I>d8b6b | JetBrains_ring-ui | train | js |
e67d0d5db88dfd52e4cf01a9a175f18db27b66d0 | diff --git a/benchbuild/source/base.py b/benchbuild/source/base.py
index <HASH>..<HASH> 100644
--- a/benchbuild/source/base.py
+++ b/benchbuild/source/base.py
@@ -230,9 +230,8 @@ def primary(*sources: ISource) -> ISource:
If you define a new project and rely on the existence of a 'main'
source code repository, make sure to define it as the first one.
"""
- del sources
-
- return source
+ (head, *_) = sources
+ return head
def product(*sources: ISource) -> NestedVariants:
diff --git a/tests/test_project.py b/tests/test_project.py
index <HASH>..<HASH> 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -145,9 +145,9 @@ def describe_project():
).name == 'VersionSource_0'
def source_must_contain_elements(): # pylint: disable=unused-variable
- with pytest.raises(TypeError) as excinfo:
+ with pytest.raises(ValueError) as excinfo:
DummyPrjEmptySource()
- assert "primary()" in str(excinfo)
+ assert "not enough values to unpack" in str(excinfo)
def describe_filters(): | project/source: rais valueerror, if not enough arguments are provided in varargs | PolyJIT_benchbuild | train | py,py |
b9ad9bc5a6c1cbc9c54dc00ee874bf0be5b51008 | diff --git a/spec/models/active_record/active_record_relation_methods_spec.rb b/spec/models/active_record/active_record_relation_methods_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/models/active_record/active_record_relation_methods_spec.rb
+++ b/spec/models/active_record/active_record_relation_methods_spec.rb
@@ -51,9 +51,9 @@ if defined? ActiveRecord
end
end
- context "when count receives options" do
- it "should return a distinct set by column for rails < 4.1" do
- if ActiveRecord::VERSION::STRING < "4.1.0"
+ if ActiveRecord::VERSION::STRING < '4.1.0'
+ context 'when count receives options' do
+ it 'should return a distinct set by column for rails < 4.1' do
User.page(1).count(:name, :distinct => true).should == 4
end
end | Skip the whole test when the version doesn't match
from @eitoball's comment: <URL> | kaminari_kaminari | train | rb |
3d68d06ac70cddb3521f912a5c06fb3e4f10c47f | diff --git a/command/agent/check_test.go b/command/agent/check_test.go
index <HASH>..<HASH> 100644
--- a/command/agent/check_test.go
+++ b/command/agent/check_test.go
@@ -585,6 +585,7 @@ func TestDockerCheckWhenExecInfoFails(t *testing.T) {
}
func TestDockerCheckDefaultToSh(t *testing.T) {
+ os.Setenv("SHELL", "")
mock := &MockNotify{
state: make(map[string]string),
updates: make(map[string]int), | Forcing the Env variable to empty while testing the default shell logic | hashicorp_consul | train | go |
2fb332e7bd87765f9c294ad6c99f7325ad909102 | diff --git a/wallace/networks.py b/wallace/networks.py
index <HASH>..<HASH> 100644
--- a/wallace/networks.py
+++ b/wallace/networks.py
@@ -16,6 +16,7 @@ class Network(object):
return self.db.query(Agent)\
.order_by(Agent.creation_time)\
.filter(Agent.status != "failed")\
+ .filter(Agent.status != "dead")\
.all()
@property | Don't include dead nodes in network.agents | berkeley-cocosci_Wallace | train | py |
c5d5996e7f74654231878528e5f116e55b11ca56 | diff --git a/src/PatternLab/InstallerUtil.php b/src/PatternLab/InstallerUtil.php
index <HASH>..<HASH> 100644
--- a/src/PatternLab/InstallerUtil.php
+++ b/src/PatternLab/InstallerUtil.php
@@ -36,6 +36,11 @@ class InstallerUtil {
$source = self::removeDots(key($fileItem));
$destination = self::removeDots($fileItem[$source]);
+ // make sure the destination base exists
+ if (!is_dir($destinationBase)) {
+ mkdir($destinationBase);
+ }
+
// depending on the source handle things differently. mirror if it ends in /*
if (($source == "*") && ($destination == "*")) {
if (!self::pathExists($packageName,$destinationBase."/")) { | if a destination base doesn't exist create it | pattern-lab_patternlab-php-core | train | php |
da2b7cd97a73191d9bd219718e8e5d9370ef12df | diff --git a/MANIFEST.in b/MANIFEST.in
index <HASH>..<HASH> 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -24,4 +24,4 @@ graft mishmash/web
graft mishmash/alembic
recursive-include mishmash *.ini
-prune etc
+prune docker
diff --git a/mishmash/__about__.py b/mishmash/__about__.py
index <HASH>..<HASH> 100644
--- a/mishmash/__about__.py
+++ b/mishmash/__about__.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from collections import namedtuple
-__version__ = "0.2.0-b5"
+__version__ = "0.2-b5"
__release_name__ = ""
__years__ = "2013-2017"
diff --git a/mishmash/commands/info.py b/mishmash/commands/info.py
index <HASH>..<HASH> 100644
--- a/mishmash/commands/info.py
+++ b/mishmash/commands/info.py
@@ -5,7 +5,6 @@ from pyfiglet import figlet_format
from sqlalchemy.exc import ProgrammingError, OperationalError
# FIXME: replace thise console utils with nicfit.console
from eyed3.utils.console import printError
-from eyed3.utils.console import cprint, cformat
from .. import version
from ..core import Command
from ..orm import Track, Artist, Album, Meta, Tag, Library, NULL_LIB_ID | fix: manifest file updates for docker | nicfit_MishMash | train | in,py,py |
dfe487459beb283d42bac5dff90fa4fde82d4b50 | diff --git a/lib/mess/renderer.js b/lib/mess/renderer.js
index <HASH>..<HASH> 100644
--- a/lib/mess/renderer.js
+++ b/lib/mess/renderer.js
@@ -219,28 +219,6 @@ mess.Renderer = function Renderer(env) {
);
},
- /**
- * Split definitions into sub-lists of definitions
- * containing rules pertaining to only one
- * symbolizer each
- */
- // splitBySymbolizer: function(definitions) {
- // var splitTime = +new Date;
- // var bySymbolizer = {};
- // for (var i = 0; i < definitions.length; i++) {
- // definitions[i].symbolizers().forEach(function(sym) {
- // var index = sym + (definitions[i].attachment ? '/' + definitions[i].attachment : '');
- // if(!bySymbolizer[index]) {
- // bySymbolizer[index] = [];
- // }
- // bySymbolizer[index].push(
- // definitions[i].filterSymbolizer(sym));
- // });
- // }
- // if (env.debug) console.warn('Splitting symbolizers: ' + ((new Date - splitTime)) + 'ms');
- // return bySymbolizer;
- // },
-
findSymbolizers: function(definitions) {
var symbolizers = {};
for (var i = 0; i < definitions.length; i++) { | another function we don't need anymore | mapbox_carto | train | js |
4ba9e93f3d87b8ce8e5aab1ad734c54e5e9d2c22 | diff --git a/lib/cb/models/cb_talent_network.rb b/lib/cb/models/cb_talent_network.rb
index <HASH>..<HASH> 100644
--- a/lib/cb/models/cb_talent_network.rb
+++ b/lib/cb/models/cb_talent_network.rb
@@ -20,7 +20,7 @@ module Cb
@form_value = args['Form'] || ''
@option_display_type = args['OptionDisplayType'] || ''
@order = args['Order'] || ''
- @required = args['Required'] || ''
+ @required = args['Required'].to_s || ''
@options = Array.new
if args.has_key?('Options')
args['Options'].each do |option_values| | to_s for required on talent network join questions | careerbuilder_ruby-cb-api | train | rb |
730ff55386d57927829f4458d02cf490e46af421 | diff --git a/lib/socializer/engine.rb b/lib/socializer/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/socializer/engine.rb
+++ b/lib/socializer/engine.rb
@@ -24,10 +24,10 @@ module Socializer
initializer "webpacker.proxy" do |app|
insert_middleware = begin
- Socializer.webpacker.config.dev_server.present?
- rescue StandardError
- nil
- end
+ Socializer.webpacker.config.dev_server.present?
+ rescue StandardError
+ nil
+ end
next unless insert_middleware
app.middleware.insert_before( | Layout/RescueEnsureAlignment and Layout/BeginEndAlignment | socializer_socializer | train | rb |
41b94b5fe92c510bdaaf76a60e0a4527d61fea77 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -29,7 +29,7 @@ const tapJunit = () => {
const sanitizeString = (str) => {
if (str) {
- return str.replace(/\W/g, '').trim();
+ return str.replace(/[^\w-_]/g, '').trim();
}
return str; | Relax string sanitation rules to include - and _ | dhershman1_tap-junit | train | js |
e818860af87cad796699e27f8dfb4ff6fc9354e8 | diff --git a/h2o-py/h2o/model/autoencoder.py b/h2o-py/h2o/model/autoencoder.py
index <HASH>..<HASH> 100644
--- a/h2o-py/h2o/model/autoencoder.py
+++ b/h2o-py/h2o/model/autoencoder.py
@@ -13,13 +13,14 @@ class H2OAutoEncoderModel(ModelBase):
def __init__(self, dest_key, model_json):
super(H2OAutoEncoderModel, self).__init__(dest_key, model_json,H2OAutoEncoderModelMetrics)
- def anomaly(self,test_data):
+ def anomaly(self,test_data,per_feature=False):
"""
Obtain the reconstruction error for the input test_data.
:param test_data: The dataset upon which the reconstruction error is computed.
+ :param per_feature: Whether to return the square reconstruction error per feature. Otherwise, return the mean square error.
:return: Return the reconstruction error.
"""
if not test_data: raise ValueError("Must specify test data")
- j = H2OConnection.post_json("Predictions/models/" + self._id + "/frames/" + test_data._id, reconstruction_error=True)
+ j = H2OConnection.post_json("Predictions/models/" + self._id + "/frames/" + test_data._id, reconstruction_error=True, reconstruction_error_per_feature=per_feature)
return h2o.get_frame(j["model_metrics"][0]["predictions"]["frame_id"]["name"])
\ No newline at end of file | PUBDEV-<I>: Add extra argument to get per-feature reconstruction error for
anomaly detection from Python. | h2oai_h2o-3 | train | py |
bc3e1f97db0a2cf97c76eb4151976d5896b8ec76 | diff --git a/src/Yosymfony/Silex/ConfigServiceProvider/ConfigServiceProvider.php b/src/Yosymfony/Silex/ConfigServiceProvider/ConfigServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Yosymfony/Silex/ConfigServiceProvider/ConfigServiceProvider.php
+++ b/src/Yosymfony/Silex/ConfigServiceProvider/ConfigServiceProvider.php
@@ -39,10 +39,13 @@ class ConfigServiceProvider implements ServiceProviderInterface
public function register(Application $app)
{
- $app['configuration'] = $app->share(function(){
+ $app['configuration.custom_loaders'] = $this->customLoaders;
+ $app['configuration.directories'] = $this->configDirectories;
+
+ $app['configuration'] = $app->share(function($app){
- $locator = new FileLocator($this->configDirectories);
- $loaders = count($this->customLoaders) > 0 ? $this->customLoaders : array(
+ $locator = new FileLocator($app['configuration.directories']);
+ $loaders = count($app['configuration.custom_loaders']) > 0 ? $app['configuration.custom_loaders'] : array(
new Loaders\TomlLoader($locator),
new Loaders\YamlLoader($locator),
); | Fixed "Using $this when not in object context" | yosymfony_ConfigServiceProvider | train | php |
7c553284a1964921786ae4eee7269ca226b6067c | diff --git a/frame_test.go b/frame_test.go
index <HASH>..<HASH> 100644
--- a/frame_test.go
+++ b/frame_test.go
@@ -28,13 +28,12 @@ func TestFuzzBugs(t *testing.T) {
var bw bytes.Buffer
r := bytes.NewReader(test)
-
- head, err := readHeader(r, make([]byte, 8))
+ head, err := readHeader(r, make([]byte, 9))
if err != nil {
continue
}
- framer := newFramer(r, &bw, nil, 2)
+ framer := newFramer(r, &bw, nil, byte(head.version))
err = framer.readFrame(&head)
if err != nil {
continue
diff --git a/fuzz.go b/fuzz.go
index <HASH>..<HASH> 100644
--- a/fuzz.go
+++ b/fuzz.go
@@ -14,7 +14,7 @@ func Fuzz(data []byte) int {
return 0
}
- framer := newFramer(r, &bw, nil, 3)
+ framer := newFramer(r, &bw, nil, byte(head.version))
err = framer.readFrame(&head)
if err != nil {
return 0 | use the version from the read header version when parsing the frames for fuzzing | gocql_gocql | train | go,go |
23804f666fba4cd3852e337debb3ba39520cff9b | diff --git a/contrib/externs/chrome_extensions.js b/contrib/externs/chrome_extensions.js
index <HASH>..<HASH> 100644
--- a/contrib/externs/chrome_extensions.js
+++ b/contrib/externs/chrome_extensions.js
@@ -2330,7 +2330,7 @@ chrome.bookmarks = {};
/**
* @typedef {?{
- * pareintId: (string|undefined),
+ * parentId: (string|undefined),
* index: (number|undefined),
* url: (string|undefined),
* title: (string|undefined)
@@ -2341,6 +2341,17 @@ chrome.bookmarks.CreateDetails;
/**
+ * @typedef {?{
+ * query: (string|undefined),
+ * url: (string|undefined),
+ * title: (string|undefined)
+ * }}
+ * @see https://developer.chrome.com/extensions/bookmarks#method-search
+ */
+chrome.bookmarks.SearchDetails;
+
+
+/**
* @param {(string|Array.<string>)} idOrIdList
* @param {function(Array.<BookmarkTreeNode>): void} callback The
* callback function which accepts an array of BookmarkTreeNode.
@@ -2385,7 +2396,7 @@ chrome.bookmarks.getSubTree = function(id, callback) {};
/**
- * @param {string} query
+ * @param {string|!chrome.bookmarks.SearchDetails} query
* @param {function(Array.<BookmarkTreeNode>): void} callback
* @return {Array.<BookmarkTreeNode>}
*/ | Fixed chrome.bookmarks.search to allow query as an Object, see <URL> | google_closure-compiler | train | js |
2142860baeae751b10f23f430fb5aeab32873ee9 | diff --git a/lib/stc/Files.php b/lib/stc/Files.php
index <HASH>..<HASH> 100644
--- a/lib/stc/Files.php
+++ b/lib/stc/Files.php
@@ -29,10 +29,12 @@ class Files
foreach($files as $file) {
if (preg_match($pattern, $file, $match)) {
- $this->files[] = $data_loader->load(
+ $f = $data_loader->load(
$data_folder . $this->data_path,
$file
);
+ $f['file'] = $file;
+ $this->files[] = $f;
}
}
} | added filename key in file data. | diasbruno_stc | train | php |
0772383e3d361ce734b715397dd2cb4ba6501743 | diff --git a/src/u.ie9.js b/src/u.ie9.js
index <HASH>..<HASH> 100644
--- a/src/u.ie9.js
+++ b/src/u.ie9.js
@@ -7,7 +7,7 @@
* wait for body to be available
* insert function call at beginning of list to execute it before any other registered function
*/
- u._defInit.unshift(function () {
+ u(function () {
/**
@@ -73,7 +73,7 @@
};
}
-
+
}); | fix issue with IE 9 fixes not being loaded | iamso_u.js | train | js |
4d44f1ed47ee0c0c43174f84a34dfa6f75d18b2c | diff --git a/src/main/java/water/Jobs.java b/src/main/java/water/Jobs.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/Jobs.java
+++ b/src/main/java/water/Jobs.java
@@ -129,10 +129,9 @@ public abstract class Jobs {
public static void remove(final Key key) {
DKV.remove(key);
new TAtomic<List>() {
- @Override
- public List alloc() {
- return new List();
- }
+ transient Key _progress;
+ @Override public List alloc() { return new List(); }
+ @Override public void onSuccess() { UKV.remove(_progress); }
@Override
public List atomic(List old) {
@@ -151,7 +150,7 @@ public abstract class Jobs {
if( i != index )
old._jobs[n++] = jobs[i];
else
- UKV.remove(jobs[i]._progress);
+ _progress = jobs[i]._progress; // Save for key remove on success
}
}
return old; | Do not attempt a KV side-effect in a single-Key Atomic | h2oai_h2o-2 | train | java |
6210b9e746bbf45bdb3205061cf31303043be65a | diff --git a/internal/config/config.go b/internal/config/config.go
index <HASH>..<HASH> 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -380,10 +380,9 @@ func convertV5V6(cfg *Configuration) {
// Doesn't affect the config itself, but uses config migrations to identify
// the migration point.
for _, folder := range Wrap("", *cfg).Folders() {
- err := folder.CreateMarker()
- if err != nil {
- panic(err)
- }
+ // Best attempt, if it fails, it fails, the user will have to fix
+ // it up manually, as the repo will not get started.
+ folder.CreateMarker()
}
cfg.Version = 6 | Best attempt when creating a folder marker (fixes #<I>) | syncthing_syncthing | train | go |
4771788710ad3de279ead1ac0e47c239d68fed21 | diff --git a/Entity/MailChimpNewsletter.php b/Entity/MailChimpNewsletter.php
index <HASH>..<HASH> 100755
--- a/Entity/MailChimpNewsletter.php
+++ b/Entity/MailChimpNewsletter.php
@@ -42,17 +42,17 @@ class MailChimpNewsletter extends Meta
protected $webId;
/**
- * @ORM\Column(type="string", length=255, nullable=false, unique=true)
+ * @ORM\Column(type="string", length=255, nullable=false)
*/
protected $listId;
/**
- * @ORM\Column(type="integer", nullable=false, unique=true)
+ * @ORM\Column(type="integer", nullable=false)
*/
protected $folderId;
/**
- * @ORM\Column(type="integer", nullable=false, unique=true)
+ * @ORM\Column(type="integer", nullable=false)
*/
protected $templateId; | CE-<I> Basic MailChimp integration | CampaignChain_operation-mailchimp | train | php |
358c0895173bb1382389cf0bb776bab0933fd503 | diff --git a/src/collector.js b/src/collector.js
index <HASH>..<HASH> 100644
--- a/src/collector.js
+++ b/src/collector.js
@@ -20,6 +20,7 @@ function getHostname(configUrl) {
return url.parse(configUrl).hostname;
}
const supportedRegions = [
+ 'ap-northeast-1',
'ap-southeast-2',
'eu-west-1',
'us-east-2', | Added support for ap-northeast-1 collector (#<I>)
* Added support for ap-northeast-1 collector
* Fixed Syntax Error | iopipe_iopipe-js-core | train | js |
1fb0e43005c4c49f989eb01382a1dae4a08c775f | diff --git a/mod/data/rate.php b/mod/data/rate.php
index <HASH>..<HASH> 100755
--- a/mod/data/rate.php
+++ b/mod/data/rate.php
@@ -17,6 +17,8 @@ if (!$course = $DB->get_record('course', array('id'=>$data->course))) {
if (!$cm = get_coursemodule_from_instance('data', $data->id)) {
print_error('invalidcoursemodule');
+} else {
+ $data->cmidnumber = $cm->id; //MDL-12961
}
require_login($course, false, $cm); | NOBUG: Fix notice (and something more?). Like MDL-<I> but in data module; merged from <I>_STABLE | moodle_moodle | train | php |
66a892b60e0467ccd90aef92715136ed30199f0b | diff --git a/compiler/js/generator.py b/compiler/js/generator.py
index <HASH>..<HASH> 100644
--- a/compiler/js/generator.py
+++ b/compiler/js/generator.py
@@ -196,7 +196,7 @@ class generator(object):
if safe_name.endswith(".js"):
safe_name = safe_name[:-3]
safe_name = escape_package(safe_name.replace('/', '.'))
- code = "//=====[import %s]=====================\n\n" %name + code
+ code = "//=====[import %s]=====================\n\n" %name + code.decode('utf-8')
r.append("_globals.%s = %s()" %(safe_name, self.wrap(code, name == "core.core"))) #hack: core.core use _globals as its exports
return "\n".join(r) | allow non-ascii in included js | pureqml_qmlcore | train | py |
c94765611ff00ca743bf2a72493c5c64781f0b1b | diff --git a/src/main/java/black/door/json/JsonHasher.java b/src/main/java/black/door/json/JsonHasher.java
index <HASH>..<HASH> 100644
--- a/src/main/java/black/door/json/JsonHasher.java
+++ b/src/main/java/black/door/json/JsonHasher.java
@@ -78,6 +78,8 @@ public class JsonHasher {
}
protected static CharSequence canonicalize(Object obj){
+ if(obj == null)
+ return "null";
if(obj instanceof Map)
return canonicalize((Map) obj);
if(obj instanceof Collection) | Fixed bug where null objects would not be handled.
close #<I> | blackdoor_blackdoor | train | java |
6a75694e284bd3a7774ec730e1a2fef8bc8dbae1 | diff --git a/src/com/connectsdk/service/CastService.java b/src/com/connectsdk/service/CastService.java
index <HASH>..<HASH> 100644
--- a/src/com/connectsdk/service/CastService.java
+++ b/src/com/connectsdk/service/CastService.java
@@ -108,6 +108,11 @@ public class CastService extends DeviceService implements MediaPlayer, MediaCont
.build();
}
+ @Override
+ public String getServiceName() {
+ return ID;
+ }
+
public static JSONObject discoveryParameters() {
JSONObject params = new JSONObject(); | Add getServiceName() for CastService since the serviceId does
not get populated consistently. | ConnectSDK_Connect-SDK-Android | train | java |
26c53fd108d1a6a4325a6bdf095d5e001bad7d83 | diff --git a/lib/em/varnish_log/connection.rb b/lib/em/varnish_log/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/em/varnish_log/connection.rb
+++ b/lib/em/varnish_log/connection.rb
@@ -17,12 +17,6 @@ module EM
class Connection
class << self
attr_reader :channel
-
- def start(channel)
- @channel = channel
-
- EM.connect('localhost', 12345, self)
- end
end
def initialize(channel) | Garbage collect some leftovers from the old API.
This should have been done with <I>feab9f<I>d<I>eb<I>b5c3ad<I>c8. | andreacampi_varnish-rb | train | rb |
96fc0d043e4c1f545ceb435e2d614161e23442d7 | diff --git a/cypress/integration/rendering/classDiagram.spec.js b/cypress/integration/rendering/classDiagram.spec.js
index <HASH>..<HASH> 100644
--- a/cypress/integration/rendering/classDiagram.spec.js
+++ b/cypress/integration/rendering/classDiagram.spec.js
@@ -14,6 +14,8 @@ describe('Class diagram', () => {
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
+ Class12 <|.. Class08
+ Class11 ..>Class12
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
@@ -29,7 +31,7 @@ describe('Class diagram', () => {
test()
}
`,
- {}
+ {logLevel : 1}
);
cy.get('svg');
}); | #<I> Added cypress test for dash line (dependecy) rendering | knsv_mermaid | train | js |
3466570922e1e62eff30221bdc50681d9b8d03be | diff --git a/clickoutside.directive.js b/clickoutside.directive.js
index <HASH>..<HASH> 100644
--- a/clickoutside.directive.js
+++ b/clickoutside.directive.js
@@ -18,7 +18,7 @@
}
// assign the document click handler to a variable so we can un-register it when the directive is destroyed
- var clickHandler = $document.on('click', function(e) {
+ $document.on('click', function(e) {
var i = 0,
element;
@@ -36,7 +36,7 @@
// loop through the elements id's and classnames looking for exceptions
for (i = 0; i < l; i++) {
// check for id's or classes, but only if they exist in the first place
- if ((id !== undefined && id.indexOf(classList[i]) > -1) || (classNames.length && classNames.indexOf(classList[i]) > -1)) {
+ if ((id !== undefined && id.indexOf(classList[i]) > -1) || (classNames && classNames.indexOf(classList[i]) > -1)) {
// now let's exit out as it is an element that has been defined as being ignored for clicking outside
return;
}
@@ -51,7 +51,7 @@
// when the scope is destroyed, clean up the documents click handler as we don't want it hanging around
$scope.$on('$destroy', function() {
- clickHandler();
+ $document.off('click');
});
}
}; | Fixed deregistering of click handler, check for classNames
Removed the check for classNames length, instead just check for it's existence. Fixed the way click handler deregisters itself. | IamAdamJowett_angular-click-outside | train | js |
a71f570752d5ecdc19afd4bb5262c767e0e4a257 | diff --git a/qiskit/_quantumprogram.py b/qiskit/_quantumprogram.py
index <HASH>..<HASH> 100644
--- a/qiskit/_quantumprogram.py
+++ b/qiskit/_quantumprogram.py
@@ -25,6 +25,7 @@ import copy
# use the external IBMQuantumExperience Library
from IBMQuantumExperience.IBMQuantumExperience import IBMQuantumExperience
+from IBMQuantumExperience.IBMQuantumExperience import RegisterSizeError
# Stable Modules
from . import QuantumRegister
@@ -1026,6 +1027,8 @@ class QuantumProgram(object):
try:
output = self.__api.run_job(jobs, backend, shots=shots,
max_credits=max_credits, seed=seed)
+ except RegisterSizeError:
+ raise
except Exception as ex:
raise ConnectionError("Error trying to run the jobs online: {}"
.format(ex))
@@ -1033,7 +1036,7 @@ class QuantumProgram(object):
raise ResultError(output['error'])
if 'id' not in output:
raise ResultError('unexpected job results: {}'.format(output))
-
+
qobj_result = self._wait_for_job(output['id'], wait=wait,
timeout=timeout, silent=silent)
else: | We want to explicity capture and re-throw RegisterSizeError from (#<I>)
IBMQuantumExperience API. | Qiskit_qiskit-terra | train | py |
6aa10cdd0b4b6629094c53608f302c129a8b193d | diff --git a/lib/mess/tree/reference.js b/lib/mess/tree/reference.js
index <HASH>..<HASH> 100644
--- a/lib/mess/tree/reference.js
+++ b/lib/mess/tree/reference.js
@@ -422,6 +422,14 @@ tree.Reference = {
'default-value': 'false',
'default-meaning': 'do not allow overlap'
},
+ 'placement': {
+ 'css': 'point-placement',
+ 'type': [
+ 'centroid',
+ 'interior'
+ ],
+ 'default-value': 'centroid'
+ },
'meta-output': {
'css': 'point-meta-output',
'type': 'string',
@@ -543,7 +551,9 @@ tree.Reference = {
'css': 'text-placement',
'type': [
'point',
- 'line'
+ 'line',
+ 'vertex',
+ 'interior'
],
'default-value': 'point'
}, | update reference.js with new interior placement option in mapnik for point and text symbolizers | mapbox_carto | train | js |
51084667683f2378d953a67c803a9aaa8239924b | diff --git a/src/SALib/analyze/sobol.py b/src/SALib/analyze/sobol.py
index <HASH>..<HASH> 100644
--- a/src/SALib/analyze/sobol.py
+++ b/src/SALib/analyze/sobol.py
@@ -136,8 +136,7 @@ def analyze(problem, Y, calc_second_order=True, num_resamples=100,
res = S.to_df()
for df in res:
print(df.to_string())
-
- # print_indices(S, problem, calc_second_order)
+
return S
@@ -311,8 +310,13 @@ def to_df(self):
'''Conversion method to Pandas DataFrame. To be attached to ResultDict.
Returns
- ========
+ --------
List : of Pandas DataFrames in order of Total, First, Second
+
+ Example
+ -------
+ >>> Si = sobol.analyze(problem, Y, print_to_console=True)
+ >>> total_Si, first_Si, second_Si = Si.to_df()
'''
total, first, (idx, second) = Si_to_pandas_dict(self)
names = self.problem['names'] | Update doc for Sobol related methods | SALib_SALib | train | py |
be4d12bad8e23c41139affa979b5036a13446c64 | diff --git a/src/CardTable.php b/src/CardTable.php
index <HASH>..<HASH> 100644
--- a/src/CardTable.php
+++ b/src/CardTable.php
@@ -29,9 +29,13 @@ class CardTable extends Table
$model->assertIsLoaded();
+ if ($columns === null) {
+ $columns = array_keys($model->getFields('visible'));
+ }
+
$data = [];
foreach ($model->get() as $key => $value) {
- if ($columns === null || in_array($key, $columns, true)) {
+ if (in_array($key, $columns, true)) {
$data[] = [
'id' => $key,
'field' => $model->getField($key)->getCaption(), | Fix visible flag in CardTable (#<I>) | atk4_ui | train | php |
b8313ea28a7919c8e5e0f949a69c5a8b04bf4ea3 | diff --git a/flange/dbengine.py b/flange/dbengine.py
index <HASH>..<HASH> 100644
--- a/flange/dbengine.py
+++ b/flange/dbengine.py
@@ -16,7 +16,7 @@ dbengine_schema = {
}
def dbengine_create_func(config):
- url_format_string = "{:s}://{:s}:{:s}@{:s}:{:s}/{:s}?charset=utf8"
+ url_format_string = "{:s}://{:s}:{:s}@{:s}:{:s}/{:s}?"
engine = create_engine(url_format_string.format(
config['driver'],
config['user'], | postgres didn't like the charset param that was hard-coded in url | flashashen_flange | train | py |
be40f9ece3da48880fcbfb625dc60c8885ec4805 | diff --git a/src/app/Commands/UpgradeFileManager.php b/src/app/Commands/UpgradeFileManager.php
index <HASH>..<HASH> 100644
--- a/src/app/Commands/UpgradeFileManager.php
+++ b/src/app/Commands/UpgradeFileManager.php
@@ -11,6 +11,7 @@ use LaravelEnso\AvatarManager\app\Models\Avatar;
use LaravelEnso\DataImport\app\Models\DataImport;
use LaravelEnso\DataImport\app\Models\ImportTemplate;
use LaravelEnso\DocumentsManager\app\Models\Document;
+use LaravelEnso\PermissionManager\app\Models\Permission;
class UpgradeFileManager extends Command
{
@@ -72,6 +73,12 @@ class UpgradeFileManager extends Command
Schema::table('avatars', function (Blueprint $table) {
$table->dropColumn(['saved_name', 'original_name']);
});
+
+ Permission::whereName('core.avatars.destroy')
+ ->update([
+ 'name' => 'core.avatars.update',
+ 'description' => 'Generate avatar',
+ ]);
}
private function upgradeDataImports() | adds permission renaming in upgrade command | laravel-enso_Core | train | php |
3c5703630c507bab5714d7b936aa1984951f4bb4 | diff --git a/lib/handlebars.js b/lib/handlebars.js
index <HASH>..<HASH> 100644
--- a/lib/handlebars.js
+++ b/lib/handlebars.js
@@ -191,6 +191,16 @@ var Handlebars = {
}
return out;
+ },
+
+ handleInvertedSection: function(lookup, context, fn) {
+ var out = "";
+ if(Handlebars.isFunction(lookup) && Handlebars.isEmpty(lookup())) {
+ out = out + fn(context);
+ } else if (Handlebars.isEmpty(lookup)) {
+ out = out + fn(context);
+ }
+ return out;
}
}
@@ -308,8 +318,7 @@ Handlebars.Compiler.prototype = {
var fnId = "fn" + this.pointer.toString();
this.fn += "var " + fnId + " = function(context) {" + result + "}; ";
this.fn += "lookup = " + this.lookupFor(mustache) + "; ";
- this.fn += "if(Handlebars.isFunction(lookup) && Handlebars.isEmpty(lookup())) out = out + " + fnId + "(context);";
- this.fn += "else if (Handlebars.isEmpty(lookup)) out = out + " + fnId + "(context);";
+ this.fn += "out = out + Handlebars.handleInvertedSection(lookup, context, " + fnId + ");"
this.openBlock = false;
this.inverted = false; | Got handleInvertedSection written up. | wycats_handlebars.js | train | js |
19fd575e42e651d0242aebf385f95c127a8c135d | diff --git a/arquillian/daemon/api/src/main/java/org/wildfly/swarm/arquillian/daemon/server/Server.java b/arquillian/daemon/api/src/main/java/org/wildfly/swarm/arquillian/daemon/server/Server.java
index <HASH>..<HASH> 100644
--- a/arquillian/daemon/api/src/main/java/org/wildfly/swarm/arquillian/daemon/server/Server.java
+++ b/arquillian/daemon/api/src/main/java/org/wildfly/swarm/arquillian/daemon/server/Server.java
@@ -152,7 +152,8 @@ public class Server {
this.shutdownService = Executors.newSingleThreadExecutor();
if (log.isLoggable(Level.INFO)) {
- log.info("Server started on " + boundAddress.getHostName() + ":" + boundAddress.getPort());
+ log.info("Arquillian Daemon server started on " + boundAddress.getHostName() + ":" +
+ boundAddress.getPort());
}
} | Be clearer in the log about what is starting. | wildfly-swarm-archive_ARCHIVE-wildfly-swarm | train | java |
cb1c15837105a4175463ada580bdf620cc4c4c5c | diff --git a/test_duct.py b/test_duct.py
index <HASH>..<HASH> 100644
--- a/test_duct.py
+++ b/test_duct.py
@@ -163,12 +163,10 @@ def test_cwd():
# because on OSX there's a symlink in there.
tmpdir = os.path.realpath(tempfile.mkdtemp())
another = os.path.realpath(tempfile.mkdtemp())
- assert tmpdir == pwd().read(cwd=tmpdir)
- assert tmpdir == pwd(cwd=tmpdir).read(cwd=another)
+ assert tmpdir == pwd().cwd(tmpdir).read()
+ assert tmpdir == pwd().cwd(tmpdir).cwd(another).read()
if has_pathlib:
- assert tmpdir == pwd().read(cwd=Path(tmpdir))
- assert (tmpdir == pwd(cwd=Path(tmpdir))
- .read(cwd='/something/else'))
+ assert tmpdir == pwd().cwd(Path(tmpdir)).read()
def test_env(): | [rusty rewrite] more tests | oconnor663_duct.py | train | py |
862f29c6a2c5b03622c40b67c1a19839495b44c9 | diff --git a/invoiceregistry.go b/invoiceregistry.go
index <HASH>..<HASH> 100644
--- a/invoiceregistry.go
+++ b/invoiceregistry.go
@@ -190,7 +190,7 @@ type invoiceSubscription struct {
id uint32
}
-// Cancel unregisteres the invoiceSubscription, freeing any previoulsy allocate
+// Cancel unregisters the invoiceSubscription, freeing any previously allocate
// resources.
func (i *invoiceSubscription) Cancel() {
i.inv.clientMtx.Lock()
@@ -205,6 +205,7 @@ func (i *invoiceRegistry) SubscribeNotifications() *invoiceSubscription {
client := &invoiceSubscription{
NewInvoices: make(chan *channeldb.Invoice),
SettledInvoices: make(chan *channeldb.Invoice),
+ inv: i,
}
i.clientMtx.Lock() | invoices: properly set pointer in invoiceSubscription to fix panic | lightningnetwork_lnd | train | go |
37b8cd5a4d38106b05507208ce20ae7864c289ea | diff --git a/src/main/java/com/conveyal/gtfs/model/Pattern.java b/src/main/java/com/conveyal/gtfs/model/Pattern.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/conveyal/gtfs/model/Pattern.java
+++ b/src/main/java/com/conveyal/gtfs/model/Pattern.java
@@ -21,7 +21,6 @@ public class Pattern implements Serializable {
public double[] segmentFraction;
public List<String> orderedStops;
public List<String> associatedTrips;
- public Set<String> associatedRoutes;
public LineString geometry;
public String name;
public String route_id;
@@ -39,13 +38,7 @@ public class Pattern implements Serializable {
// Assign associated trips to value of tripsForStopPattern
this.associatedTrips = trips;
- this.associatedRoutes = new HashSet<>();
- this.associatedTrips.forEach((id) -> {
- this.associatedRoutes.add(feed.trips.get(id).route_id);
- });
-// for (String tripId : this.associatedTrips){
-// this.associatedRoutes.add(feed.trips.get(tripId).route);
-// }
+
// Get geometry for first trip in list of associated trips
String trip_id = associatedTrips.get(0);
Trip trip; | remove associatedRoutes (to align with r5 Pattern model) | conveyal_gtfs-lib | train | java |
e63e4c28d70974ba35e1f8820457480f5396d5f6 | diff --git a/src/menu/menuitem.js b/src/menu/menuitem.js
index <HASH>..<HASH> 100644
--- a/src/menu/menuitem.js
+++ b/src/menu/menuitem.js
@@ -126,7 +126,7 @@ export class Dialog {
}
focus(form) {
- let input = form.querySelector("input")
+ let input = form.querySelector("input, textarea")
if (input) input.focus()
} | Allow autofocus textareas in menu dialogs | ProseMirror_prosemirror-markdown | train | js |
e852b71dfb9f563b03a6c3c23c7e71c90e28a2ff | diff --git a/Result/DocumentIterator.php b/Result/DocumentIterator.php
index <HASH>..<HASH> 100644
--- a/Result/DocumentIterator.php
+++ b/Result/DocumentIterator.php
@@ -38,6 +38,22 @@ class DocumentIterator extends AbstractResultsIterator
}
/**
+ * Returns aggregations.
+ *
+ * @return array
+ */
+ public function getAggregations()
+ {
+ $aggregations = array();
+
+ foreach ($this->aggregations as $key => $aggregation) {
+ $aggregations[$key] = $this->getAggregation($key);
+ }
+
+ return $aggregations;
+ }
+
+ /**
* Get a specific aggregation by name. It fetches from the top level only.
*
* @param string $name | getAggregations in DocumentIterator
allow to get all Aggregations from DocumentIterator | ongr-io_ElasticsearchBundle | train | php |
1ea5edac396012e745d2fa3a013d2154a7f9fe35 | diff --git a/src/Menu.php b/src/Menu.php
index <HASH>..<HASH> 100644
--- a/src/Menu.php
+++ b/src/Menu.php
@@ -60,7 +60,11 @@ class Menu extends BaseMenu
$requestHost = request()->getHost();
$requestPath = request()->path();
- return $this->setActive(function (Link $link) use ($requestHost, $requestPath) {
+ $this->manipulate(function (Menu $menu) {
+ $menu->setActiveFromRequest();
+ });
+
+ $this->setActive(function (Link $link) use ($requestHost, $requestPath) {
$parsed = parse_url($link->url());
@@ -79,6 +83,8 @@ class Menu extends BaseMenu
return strpos($requestPath, $path) === 0;
});
+
+ return $this;
}
/** | setActiveFromRequest now works recursively | spatie_laravel-menu | train | php |
3a7a7247537f31d9617aab01ce303dbbac303994 | diff --git a/cmd/difference.go b/cmd/difference.go
index <HASH>..<HASH> 100644
--- a/cmd/difference.go
+++ b/cmd/difference.go
@@ -26,6 +26,7 @@ import (
// golang does not support flat keys for path matching, find does
"github.com/minio/mc/pkg/probe"
+ "github.com/minio/minio-go/v7"
"golang.org/x/text/unicode/norm"
)
@@ -335,12 +336,20 @@ func difference(ctx context.Context, sourceClnt, targetClnt Client, isMetadata b
err := differenceInternal(ctx, sourceClnt, targetClnt, isMetadata, isRecursive, returnSimilar, dirOpt, diffCh)
if err != nil {
// handle this specifically for filesystem related errors.
- switch err.ToGoError().(type) {
+ switch v := err.ToGoError().(type) {
case PathNotFound, PathInsufficientPermission:
diffCh <- diffMessage{
Error: err,
}
return
+ case minio.ErrorResponse:
+ switch v.Code {
+ case "NoSuchBucket", "NoSuchKey":
+ diffCh <- diffMessage{
+ Error: err,
+ }
+ return
+ }
}
errorIf(err, "Unable to list comparison retrying..")
} | error out when bucket not found with proper exitcode (#<I>)
fixes #<I> | minio_mc | train | go |
cad02040ea4ecad4744da52197c464505320c49a | diff --git a/bee.go b/bee.go
index <HASH>..<HASH> 100644
--- a/bee.go
+++ b/bee.go
@@ -37,10 +37,10 @@ type Command struct {
UsageLine string
// Short is the short description shown in the 'go help' output.
- Short string
+ Short template.HTML
// Long is the long message shown in the 'go help <this-command>' output.
- Long string
+ Long template.HTML
// Flag is a set of flags specific to this command.
Flag flag.FlagSet
@@ -62,7 +62,7 @@ func (c *Command) Name() string {
func (c *Command) Usage() {
fmt.Fprintf(os.Stderr, "usage: %s\n\n", c.UsageLine)
- fmt.Fprintf(os.Stderr, "%s\n", strings.TrimSpace(c.Long))
+ fmt.Fprintf(os.Stderr, "%s\n", strings.TrimSpace(string(c.Long)))
os.Exit(2)
}
@@ -150,7 +150,9 @@ func usage() {
func tmpl(w io.Writer, text string, data interface{}) {
t := template.New("top")
- t.Funcs(template.FuncMap{"trim": strings.TrimSpace})
+ t.Funcs(template.FuncMap{"trim": func(s template.HTML) template.HTML {
+ return template.HTML(strings.TrimSpace(string(s)))
+ }})
template.Must(t.Parse(text))
if err := t.Execute(w, data); err != nil {
panic(err) | don't convert '&' to '&' in `bee` and `bee help version`. | beego_bee | train | go |
f264d640e386b701654037cdb3975a6d79dd1e1c | diff --git a/lib/txdb/downloader.rb b/lib/txdb/downloader.rb
index <HASH>..<HASH> 100644
--- a/lib/txdb/downloader.rb
+++ b/lib/txdb/downloader.rb
@@ -6,6 +6,10 @@ module Txdb
def download(database, locale)
new(database).download(locale)
end
+
+ def download_all(database)
+ new(database).download_all
+ end
end
attr_reader :database
@@ -14,6 +18,15 @@ module Txdb
@database = database
end
+ def download_all
+ database.tables.each do |table|
+ locales.each do |locale|
+ next if locale == table.source_lang
+ download_table(table, locale)
+ end
+ end
+ end
+
def download(locale)
database.tables.each do |table|
download_table(table, locale)
@@ -54,5 +67,11 @@ module Txdb
Txgh::TxResource.from_api_response(project_slug, resource_hash)
end
end
+
+ def locales
+ @locales ||= database.transifex_api
+ .get_languages(database.transifex_project.project_slug)
+ .map { |locale| locale['language_code'] }
+ end
end
end | Adding download_all option to downloader | lumoslabs_txdb | train | rb |
621ec69bf223e84011a3921e649ec5260b7acc12 | diff --git a/oandapyV20/definitions/__init__.py b/oandapyV20/definitions/__init__.py
index <HASH>..<HASH> 100644
--- a/oandapyV20/definitions/__init__.py
+++ b/oandapyV20/definitions/__init__.py
@@ -7,6 +7,7 @@ representing a specific group of definitions instead of a dictionary.
"""
import sys
from importlib import import_module
+import six
dyndoc = """Definition representation of {cls}
@@ -39,7 +40,7 @@ def make_definition_classes(mod):
M = import_module(PTH)
for cls, cldef in M.definitions.items():
- orig, fiV = cldef.items()[0]
+ orig, fiV = next(six.iteritems(cldef))
fiK = orig.replace('-', '_')
# create the docstring dynamically
clsdoc = dyndoc.format(cls=cls, | six added for python 3.x / <I> compatibility | hootnot_oanda-api-v20 | train | py |
ee5e64bee11a46b0c870b3a80083bf344353ce49 | diff --git a/src/js/navbar.js b/src/js/navbar.js
index <HASH>..<HASH> 100644
--- a/src/js/navbar.js
+++ b/src/js/navbar.js
@@ -48,6 +48,7 @@
if (brand !== null) {
navbar_inner.append("a")
.style("margin-left", "auto")
+ .classed("brand", true)
.attr("href", s.attr("data-tangelo-brand-href"))
.text(brand);
} | Fixing problem with navbar branding. | Kitware_tangelo | train | js |
ef7208b381ca598f29c11ea1579fde16bf7ac5ad | diff --git a/src/Provider/Push/Serverless/Generator.php b/src/Provider/Push/Serverless/Generator.php
index <HASH>..<HASH> 100644
--- a/src/Provider/Push/Serverless/Generator.php
+++ b/src/Provider/Push/Serverless/Generator.php
@@ -100,7 +100,7 @@ class Generator implements GeneratorInterface
];
$file = $basePath . '/serverless.yaml';
- $bytes = file_put_contents($file, Yaml::dump($yaml));
+ $bytes = file_put_contents($file, Yaml::dump($yaml, 8));
yield 'Wrote serverless.yaml ' . $bytes . ' bytes';
}
@@ -135,7 +135,8 @@ class Generator implements GeneratorInterface
routes.path
FROM fusio_routes_method method
INNER JOIN fusio_routes routes
- ON routes.id = method.route_id';
+ ON routes.id = method.route_id
+ ORDER BY method.id DESC';
return $this->connection->fetchAll($sql);
} | inline yaml at level 8 and order methods by id desc | apioo_fusio-impl | train | php |
35a4ec2e2cbcd3bd3cb92b3c1b2db9a1b88c5ad3 | diff --git a/djstripe/models.py b/djstripe/models.py
index <HASH>..<HASH> 100644
--- a/djstripe/models.py
+++ b/djstripe/models.py
@@ -514,7 +514,7 @@ class Customer(StripeObject):
self.send_invoice()
subscription_made.send(sender=self, plan=plan, stripe_response=resp)
- def charge(self, amount, currency="usd", description=None, send_receipt=False):
+ def charge(self, amount, currency="usd", description=None, send_receipt=True):
"""
This method expects `amount` to be a Decimal type representing a
dollar amount. It will be converted to cents so any decimals beyond | charge method now defaults to send_receipt=True, to keep same old behavior | dj-stripe_dj-stripe | train | py |
9f7699dffb04ee591ab6028a8f14ccc915a7c6a7 | diff --git a/cdm/src/main/java/ucar/nc2/stream/NcStreamDataCol.java b/cdm/src/main/java/ucar/nc2/stream/NcStreamDataCol.java
index <HASH>..<HASH> 100644
--- a/cdm/src/main/java/ucar/nc2/stream/NcStreamDataCol.java
+++ b/cdm/src/main/java/ucar/nc2/stream/NcStreamDataCol.java
@@ -124,7 +124,9 @@ public class NcStreamDataCol {
IndexIterator iter = data.getIndexIterator();
while (iter.hasNext()) {
ByteBuffer bb = (ByteBuffer) iter.next();
- builder.addOpaquedata(ByteString.copyFrom(bb));
+
+ // Need to use duplicate so that internal state of bb isn't affected
+ builder.addOpaquedata(ByteString.copyFrom(bb.duplicate()));
}
} else {
throw new IllegalStateException("Unknown class for OPAQUE =" + data.getClass().getName()); | NCSTREAM: Fix getting opaque data multiple times.
Combination of caching data in ByteBuffers and copying from them was
creating problems (since bytebuffers track an internal position marker).
Use a duplicate (shallow copy) of the ByteBuffer. | Unidata_thredds | train | java |
f0ed352b52b28b833126d45599ce2e973961949b | diff --git a/src/main/java/com/axellience/vuegwt/jsr69/component/ComponentJsTypeGenerator.java b/src/main/java/com/axellience/vuegwt/jsr69/component/ComponentJsTypeGenerator.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/axellience/vuegwt/jsr69/component/ComponentJsTypeGenerator.java
+++ b/src/main/java/com/axellience/vuegwt/jsr69/component/ComponentJsTypeGenerator.java
@@ -433,9 +433,16 @@ public class ComponentJsTypeGenerator
private void createCreatedHook(TypeElement component, MethodSpec.Builder optionsBuilder,
Builder componentJsTypeBuilder, ComponentInjectedDependenciesBuilder dependenciesBuilder)
{
+ componentJsTypeBuilder.addField(boolean.class, "hasRunCreated", Modifier.PRIVATE);
+
MethodSpec.Builder createdMethodBuilder =
MethodSpec.methodBuilder("vuegwt$created").addModifiers(Modifier.PUBLIC);
+ // Avoid infinite recursion in case calling the Java constructor calls Vue.js constructor
+ // This can happen when extending an existing JS component
+ createdMethodBuilder.addStatement("if (hasRunCreated) return");
+ createdMethodBuilder.addStatement("hasRunCreated = true");
+
injectDependencies(component, dependenciesBuilder, createdMethodBuilder);
callConstructor(component, dependenciesBuilder, createdMethodBuilder); | Fix an issue with infinite recursion when extending a JS component | VueGWT_vue-gwt | train | java |
0601da20f0d303b3098f61f495e0e96a89c35632 | diff --git a/src/Route.php b/src/Route.php
index <HASH>..<HASH> 100644
--- a/src/Route.php
+++ b/src/Route.php
@@ -291,11 +291,11 @@ class Route extends AbstractSpec
protected function isFullMatch($path, array $server)
{
return $this->isRoutableMatch()
- && $this->isRegexMatch($path)
- && $this->isServerMatch($server)
&& $this->isSecureMatch($server)
+ && $this->isRegexMatch($path)
&& $this->isMethodMatch($server)
&& $this->isAcceptMatch($server)
+ && $this->isServerMatch($server)
&& $this->isCustomMatch($server);
} | change order of matches so they are outside-first-inside-last | auraphp_Aura.Router | train | php |
2d2a5518521a45dd41e20bc6ffbbd89f027b8e11 | diff --git a/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java b/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java
index <HASH>..<HASH> 100644
--- a/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java
+++ b/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java
@@ -98,11 +98,14 @@ abstract class AbstractCommandBuilder<T extends AbstractCommandBuilder<T>> imple
*
* @return the builder
*
- * @throws java.lang.IllegalArgumentException if the path is invalid or {@code null}
+ * @throws java.lang.IllegalArgumentException if the path is {@code null}
*/
public T addModuleDir(final String moduleDir) {
+ if (moduleDir == null) {
+ throw LauncherMessages.MESSAGES.nullParam("moduleDir");
+ }
// Validate the path
- final Path path = validateAndNormalizeDir(moduleDir, false);
+ final Path path = Paths.get(moduleDir).normalize();
modulesDirs.add(path.toString());
return getThis();
} | [WFCORE-<I>] Allow module paths to be added regardless if they are valid directories or not. | wildfly_wildfly-core | train | java |
baca6cdd88ecfeac8a1d4faaccfa274a631cf142 | diff --git a/Collection.php b/Collection.php
index <HASH>..<HASH> 100755
--- a/Collection.php
+++ b/Collection.php
@@ -344,7 +344,7 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator
foreach ($this->items as $item)
{
- $itemValue = is_object($item) ? $item->{$value} : $item[$value];
+ $itemValue = $this->getListValue($item, $value);
// If the key is "null", we will just append the value to the array and keep
// looping. Otherwise we will key the array using the value of the key we
@@ -355,7 +355,7 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator
}
else
{
- $itemKey = is_object($item) ? $item->{$key} : $item[$key];
+ $itemKey = $this->getListValue($item, $key);
$results[$itemKey] = $itemValue;
}
@@ -365,6 +365,18 @@ class Collection implements ArrayAccess, ArrayableInterface, Countable, Iterator
}
/**
+ * Get the value of a list item object.
+ *
+ * @param mixed $item
+ * @param mixed $key
+ * @return mixed
+ */
+ protected function getListValue($item, $key)
+ {
+ return is_object($item) ? object_get($item, $key) : $item[$key];
+ }
+
+ /**
* Concatenate values of a given key as a string.
*
* @param string $value | Allow object_get in collection->lists. | illuminate_support | train | php |
9ce741088c8a62e2af4a1fe4be7d940cfbdb9680 | diff --git a/common/vr/common/paths.py b/common/vr/common/paths.py
index <HASH>..<HASH> 100644
--- a/common/vr/common/paths.py
+++ b/common/vr/common/paths.py
@@ -11,7 +11,7 @@ RELEASES_ROOT = '/apps/releases'
def get_container_path(settings):
- return os.path.join(get_proc_path(settings), 'root')
+ return os.path.join(get_proc_path(settings), 'rootfs')
def get_container_name(settings):
@@ -46,10 +46,16 @@ def get_buildfile_path(settings):
return os.path.join(BUILDS_ROOT, base)
+# FIXME: We should be more explicit about which attributes are allowed and
+# required here. Maybe a namedtuple?
class ProcData(object):
"""
Given a dict on init, set attributes on self for each dict key/value.
"""
def __init__(self, dct):
for k, v in dct.items():
+ # Work around earlier versions of proc.yaml that used a different
+ # key for proc_name'
+ if k == 'proc':
+ k = 'proc_name'
setattr(self, k, v) | support uptesting both old and new style containers | yougov_vr.common | train | py |
c62c868fbaa95bb41049b59fde95924757983136 | diff --git a/src/test/java/com/urbanairship/datacube/EmbeddedClusterTestAbstract.java b/src/test/java/com/urbanairship/datacube/EmbeddedClusterTestAbstract.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/urbanairship/datacube/EmbeddedClusterTestAbstract.java
+++ b/src/test/java/com/urbanairship/datacube/EmbeddedClusterTestAbstract.java
@@ -30,6 +30,10 @@ public class EmbeddedClusterTestAbstract {
protected synchronized static HBaseTestingUtility getTestUtil() throws Exception {
if(hbaseTestUtil == null) {
hbaseTestUtil = new HBaseTestingUtility();
+
+ // Workaround for HBASE-5711
+ hbaseTestUtil.getConfiguration().set("dfs.datanode.data.dir.perm", "775");
+
hbaseTestUtil.startMiniCluster();
// HBaseTestingUtility will NPE unless we set this | Fix test init failure due to data dir perms, workaround for HBASE-<I> | urbanairship_datacube | train | java |
98446ca9ee0590a15a9f74a05315ebfb75d873f6 | diff --git a/src/Ifsnop/Mysqldump/Mysqldump.php b/src/Ifsnop/Mysqldump/Mysqldump.php
index <HASH>..<HASH> 100644
--- a/src/Ifsnop/Mysqldump/Mysqldump.php
+++ b/src/Ifsnop/Mysqldump/Mysqldump.php
@@ -43,7 +43,8 @@ class Mysqldump
// List of available connection strings.
const UTF8 = 'utf8';
const UTF8MB4 = 'utf8mb4';
-
+ const BINARY = 'binary';
+
/**
* Database username.
* @var string | add binary constant
Add binary constant as possible choice for default-character-set | ifsnop_mysqldump-php | train | php |
af20a66bab91adf22bdf7323463ff27c7241cd78 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -71,7 +71,7 @@ try: # Python 3
# and item[2] is source file.
except ImportError: # Python 2
- from distutils.command.build_py import build_py
+ from numpy.distutils.command.build_py import build_py
DEBUG = False | Use the numpy version of build_py | pydata_numexpr | train | py |
22d90d6dc24afaacd06104a1842c2bf2b6e7e4e3 | diff --git a/lib/monologue/version.rb b/lib/monologue/version.rb
index <HASH>..<HASH> 100644
--- a/lib/monologue/version.rb
+++ b/lib/monologue/version.rb
@@ -1,3 +1,3 @@
module Monologue
- VERSION = "0.1.1.beta"
+ VERSION = "0.2.0.beta"
end | this is version <I>.beta | jipiboily_monologue | train | rb |
720128fde3315656e037228bebf180eb5eb45bf7 | diff --git a/packages/blueprint/lib/action.js b/packages/blueprint/lib/action.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint/lib/action.js
+++ b/packages/blueprint/lib/action.js
@@ -20,6 +20,15 @@ const BlueprintObject = require ('./object');
* @class Action
*
* The base class for all actions.
+ *
+ * _About the events_:
+ *
+ * The event API for the actions is different from the traditional Events API where
+ * the events correspond to objects on this class. Because you cannot gain access to
+ * an Action instance (i.e., it is kept internally), the Events correspond to the
+ * application. This is equivalent to saying the Action supports the ApplicationMessaging
+ * events. We do not use the ApplicationMessaging mixin, however, because we can gain
+ * access to the application object via the `controller` property.
*/
module.exports = BlueprintObject.extend ({
/**
@@ -48,4 +57,28 @@ module.exports = BlueprintObject.extend ({
/// The hosting controller for the action.
controller: null,
+
+ /// @{ Events
+
+ emit () {
+ return this.controller.app.emit (...arguments);
+ },
+
+ on () {
+ return this.controller.app.on (...arguments);
+ },
+
+ once () {
+ return this.controller.app.once (...arguments);
+ },
+
+ hasListeners (ev) {
+ return this.controller.app.hasListeners (ev);
+ },
+
+ getListeners (ev) {
+ return this.controller.app.getListeners (ev);
+ }
+
+ /// @}
}); | Added the Events api to the Action | onehilltech_blueprint | train | js |
70040bd2c1e28655a4b2e7f3295860d59d01328a | diff --git a/.rollup.full.js b/.rollup.full.js
index <HASH>..<HASH> 100644
--- a/.rollup.full.js
+++ b/.rollup.full.js
@@ -9,5 +9,5 @@ export default {
globals: function(id) { return id.replace(/-/g, "_"); },
moduleId: "d3plus-text",
moduleName: "d3plus_text",
- plugins: [json(), deps({"jsnext": true}), buble()]
+ plugins: [json(), deps({"jsnext": true}), buble({exclude: "node_modules/d3-*/**"})]
}; | excludes d3 modules from buble | d3plus_d3plus-text | train | js |
5716b06edd2adc5e3323a339a69889fdf3146fd6 | diff --git a/salt/output/nested.py b/salt/output/nested.py
index <HASH>..<HASH> 100644
--- a/salt/output/nested.py
+++ b/salt/output/nested.py
@@ -1,5 +1,5 @@
'''
-Recursively display nested data, this is the default outputter.
+Recursively display nested data, this is the default outputter.
'''
# Import salt libs
@@ -22,7 +22,7 @@ class NestDisplay(object):
prefix,
ret,
self.colors['ENDC'])
- elif isinstance(ret, int):
+ elif isinstance(ret, (int, float)):
out += '{0}{1}{2}{3}{4}\n'.format(
self.colors['YELLOW'],
' ' * indent, | Fix bug in nested outputter when displaying floats
Just a simple fix for a bug that was keeping floating-point numbers from
showing up in the new nested outputter. | saltstack_salt | train | py |
cbd201e1e4abe950a9c662476abe59091d5894a4 | diff --git a/conf/servernode.js b/conf/servernode.js
index <HASH>..<HASH> 100644
--- a/conf/servernode.js
+++ b/conf/servernode.js
@@ -39,7 +39,7 @@ function configure(servernode) {
enabled: true,
// The title to be displayed in the top bar.
- title: "nodeGame v" + servernode.version + " Showcase",
+ title: "nodeGame v" + servernode.nodeGameVersion + " Showcase",
// The name of logo file. Empty no logo. Default: "nodegame_logo.png".
logo: "nodegame_logo.png",
diff --git a/lib/ServerNode.js b/lib/ServerNode.js
index <HASH>..<HASH> 100644
--- a/lib/ServerNode.js
+++ b/lib/ServerNode.js
@@ -77,6 +77,17 @@ function ServerNode(opts) {
this.version = require(this.rootDir + '/package.json').version;
/**
+ * ### ServerNode.nodeGameVersion
+ *
+ * The official release version of nodeGame
+ *
+ * This includes all other modules, and it is passed by the launcher.
+ *
+ * Default: ServerNode.version
+ */
+ this.nodeGameVersion = opts.nodeGameVersion || this.version;
+
+ /**
* ### ServerNode.defaultConfDir
*
* The directory from which the default configuration files are located | nodegame version in ServerNode and in homepage | nodeGame_nodegame-server | train | js,js |
ec4b53a973eeab86333ff8c28f7638a0588bf86b | diff --git a/src/com/google/bitcoin/core/PeerGroup.java b/src/com/google/bitcoin/core/PeerGroup.java
index <HASH>..<HASH> 100644
--- a/src/com/google/bitcoin/core/PeerGroup.java
+++ b/src/com/google/bitcoin/core/PeerGroup.java
@@ -375,6 +375,10 @@ public class PeerGroup {
Thread t = new Thread(group, r,
namePrefix + threadNumber.getAndIncrement(),
0);
+ // Lower the priority of the peer threads. This is to avoid competing with UI threads created by the API
+ // user when doing lots of work, like downloading the block chain. We select a priority level one lower
+ // than the parent thread, or the minimum.
+ t.setPriority(Math.max(Thread.MIN_PRIORITY, group.getMaxPriority() - 1));
t.setDaemon(true);
return t;
} | Lower priority for peer threads to avoid competing with UI threads. Resolves issue <I>. | bitcoinj_bitcoinj | train | java |
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.