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 |
|---|---|---|---|---|---|
8b4c22b66a72348db86e5feec03fd5c47539247f | diff --git a/app/models/foreman_fog_proxmox/proxmox.rb b/app/models/foreman_fog_proxmox/proxmox.rb
index <HASH>..<HASH> 100644
--- a/app/models/foreman_fog_proxmox/proxmox.rb
+++ b/app/models/foreman_fog_proxmox/proxmox.rb
@@ -107,7 +107,7 @@ module ForemanFogProxmox
def host_compute_attrs(host)
super.tap do |attrs|
ostype = host.compute_attributes['config_attributes']['ostype']
- host.compute_attributes['config_attributes']['hostname'] = host.name if host.compute_attributes['type'] == 'lxc'
+ host.compute_attributes['config_attributes'].store('hostname',host.name) if host.compute_attributes['type'] == 'lxc'
raise Foreman::Exception.new(N_("Operating system family %{type} is not consistent with %{ostype}") % { type: host.operatingsystem.type, ostype: ostype }) unless compute_os_types(host).include?(ostype)
end
end | Add host name to vm.hostname when vm is container | theforeman_foreman_fog_proxmox | train | rb |
f62f1da15b8fdb7857a54c899aa6712508f11df7 | diff --git a/nodeshot/networking/net/models/choices.py b/nodeshot/networking/net/models/choices.py
index <HASH>..<HASH> 100755
--- a/nodeshot/networking/net/models/choices.py
+++ b/nodeshot/networking/net/models/choices.py
@@ -16,7 +16,14 @@ ROUTING_PROTOCOLS = (
DEVICE_TYPES = {
'radio device': 'radio',
+ 'adsl': 'ADSL',
+ 'cam': 'cam',
+ 'phone': 'phone',
+ 'cloudy': 'cloudy',
'server': 'server',
+ 'confine': 'confine',
+ 'nat': 'nat',
+ 'generic': 'generic',
'router': 'router',
'switch managed': 'switch',
'sensor': 'sensor',
@@ -135,4 +142,4 @@ DUPLEX_CHOICES = (
IP_PROTOCOLS = (
('ipv4', 'ipv4'),
('ipv6', 'ipv6')
-)
\ No newline at end of file
+) | Added new types to DEVICE_TYPES: generic, nat, confine, ADSL, phone, cloudy, cam. | ninuxorg_nodeshot | train | py |
5a8d2291237221bf632602e5255c00492cd40ef9 | diff --git a/test/result.test.js b/test/result.test.js
index <HASH>..<HASH> 100644
--- a/test/result.test.js
+++ b/test/result.test.js
@@ -40,3 +40,19 @@ test('#time', function() {
new Result(tests).time.should.eq(21);
});
+
+test('#merge', function() {
+ var passed = new Test('test', noop);
+ passed.time = 10;
+
+ var failed = new Test('test', noop);
+ failed.time = 10;
+ failed.fail();
+
+ var result = new Result([ passed ]).merge(new Result([ failed ]));
+
+ result.time.should.eq(20);
+ result.tests.should.eql([ passed, failed ]);
+ result.failed.should.eql([ failed ]);
+ result.passed.should.eql([ passed ]);
+}); | Add tests for Result#merge | vesln_hydro | train | js |
79aa5936e7ac11decb3c3b8679c46a3de7c758f2 | diff --git a/lib/rjb.rb b/lib/rjb.rb
index <HASH>..<HASH> 100644
--- a/lib/rjb.rb
+++ b/lib/rjb.rb
@@ -20,3 +20,34 @@ end
require 'rjbcore'
+module Rjb
+ @@org_import = instance_method(:import)
+ def import(s)
+ o = @@org_import.bind(self).call(s)
+ o.instance_eval do
+ @user_initialize = nil
+ @org_new ||= method(:new)
+ @org_new_with_sig ||= method(:new_with_sig)
+ def new_with_sig(*args)
+ prepare_proxy(@org_new_with_sig(*args))
+ end
+ def new(*args)
+ prepare_proxy(@org_new.call(*args))
+ end
+ def class_eval(&proc)
+ @user_initialize = proc
+ end
+ private
+ def prepare_proxy(pxy)
+ pxy.instance_eval do
+ def include(*mod)
+ extend *mod
+ end
+ end
+ pxy.instance_eval &@user_initialize if @user_initialize
+ pxy
+ end
+ end
+ o
+ end
+end | add class_eval method for RJB's psuedo class. | arton_rjb | train | rb |
6ecddd83886023d52a0773a6e63c32f862357ae1 | diff --git a/cmd/syncthing/perfstats_unix.go b/cmd/syncthing/perfstats_unix.go
index <HASH>..<HASH> 100644
--- a/cmd/syncthing/perfstats_unix.go
+++ b/cmd/syncthing/perfstats_unix.go
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
-// +build !windows
+// +build !solaris,!windows
package main | Don't fail build on Solaris | syncthing_syncthing | train | go |
498984afd664742b4115c2210b23543fb3384786 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='prettyparse',
- version='1.0.0',
+ version='1.1.0',
py_modules=['prettyparse'],
author='Matthew Scholefield',
author_email='matthew331199@gmail.com', | Increment version to <I> | MatthewScholefield_prettyparse | train | py |
2281477a193294551967fbee55c8d466e27d0d6f | diff --git a/src/Message.php b/src/Message.php
index <HASH>..<HASH> 100644
--- a/src/Message.php
+++ b/src/Message.php
@@ -214,7 +214,7 @@ class Message extends Object
return null;
}
- return \Yii::$app->request->getAbsoluteUrl();
+ return \Yii::$app->getRequest()->getAbsoluteUrl();
}
/** | Change magic property usage to its accessor | sergeymakinen_yii2-log-message | train | php |
f67031b8f71bf44b67a9c9ca8da5007ca372bd74 | diff --git a/acl/Tests/internals.Test.php b/acl/Tests/internals.Test.php
index <HASH>..<HASH> 100644
--- a/acl/Tests/internals.Test.php
+++ b/acl/Tests/internals.Test.php
@@ -107,6 +107,10 @@ class testInternals extends \PHPUnit_Framework_TestCase
array(
array('1111', '0000'),
'11110000'
+ ),
+ array(
+ array('11110', '11000', '11100'),
+ '1111000'
)
);
} | modified: acl/Tests/internals.Test.php | s9e_TextFormatter | train | php |
60c88a7c5ff6b22a814f41a86cc906d11661adb2 | diff --git a/lib/algoProperties.js b/lib/algoProperties.js
index <HASH>..<HASH> 100644
--- a/lib/algoProperties.js
+++ b/lib/algoProperties.js
@@ -80,6 +80,13 @@ var algos = module.exports = global.algos = {
}
}
},
+ c11: {
+ hash: function(){
+ return function(){
+ return multiHashing.c11.apply(this, arguments);
+ }
+ }
+ },
x11: {
hash: function(){
return function(){ | Add Support for CHC Algo (#<I>) | zone117x_node-stratum-pool | train | js |
425369da1e6d8460bd634d639acf36c9fa8e2a3a | diff --git a/lib/clone.js b/lib/clone.js
index <HASH>..<HASH> 100644
--- a/lib/clone.js
+++ b/lib/clone.js
@@ -1,3 +1,5 @@
+'use strict'
+
const fs = require('fs')
, log = require('./log')
, path = require('path')
diff --git a/lib/jail.js b/lib/jail.js
index <HASH>..<HASH> 100644
--- a/lib/jail.js
+++ b/lib/jail.js
@@ -1,3 +1,5 @@
+'use strict'
+
/* eslint no-console: 0 */
const log = require('./log')
diff --git a/lib/watch/assets.js b/lib/watch/assets.js
index <HASH>..<HASH> 100644
--- a/lib/watch/assets.js
+++ b/lib/watch/assets.js
@@ -1,4 +1,4 @@
-'use'
+'use strict'
const js = require('./js')
, ui = require('../ui') | Fix node 4.x issues (use strict) | porsager_wright | train | js,js,js |
aab3a5b89d2eff77ef40f134c9776e76d42bceb5 | diff --git a/core/test/unit/api/v2/utils/validators/input/tags_spec.js b/core/test/unit/api/v2/utils/validators/input/tags_spec.js
index <HASH>..<HASH> 100644
--- a/core/test/unit/api/v2/utils/validators/input/tags_spec.js
+++ b/core/test/unit/api/v2/utils/validators/input/tags_spec.js
@@ -136,9 +136,9 @@ describe('Unit: v2/utils/validators/input/tags', function () {
describe('field formats', function () {
const fieldMap = {
name: [123, new Date(), ',starts-with-coma', '', _.repeat('a', 192), null],
- slug: [123, new Date(), _.repeat('a', 192), null],
- description: [123, new Date(), _.repeat('a', 500)],
- feature_image: [123, new Date(), 'abc'],
+ slug: [123, new Date(), _.repeat('a', 192)],
+ description: [123, new Date(), _.repeat('a', 501)],
+ feature_image: [123, new Date(), 'not uri'],
visibility: [123, new Date(), 'abc', null],
meta_title: [123, new Date(), _.repeat('a', 301)],
meta_description: [123, new Date(), _.repeat('a', 501)] | Fixed tests related to tags validations
no issue | TryGhost_Ghost | train | js |
32ded5720cc67b74b7dc39908d87fd915ea1e35f | diff --git a/v2/call_option.go b/v2/call_option.go
index <HASH>..<HASH> 100644
--- a/v2/call_option.go
+++ b/v2/call_option.go
@@ -173,6 +173,21 @@ func (o grpcOpt) Resolve(s *CallSettings) {
s.GRPC = o
}
+type pathOpt struct {
+ p string
+}
+
+func (p pathOpt) Resolve(s *CallSettings) {
+ s.Path = p.p
+}
+
+// WithPath applies a Path override to the HTTP-based APICall.
+//
+// This is for internal use only.
+func WithPath(p string) CallOption {
+ return &pathOpt{p: p}
+}
+
// WithGRPCOptions allows passing gRPC call options during client creation.
func WithGRPCOptions(opt ...grpc.CallOption) CallOption {
return grpcOpt(append([]grpc.CallOption(nil), opt...))
@@ -186,4 +201,7 @@ type CallSettings struct {
// CallOptions to be forwarded to GRPC.
GRPC []grpc.CallOption
+
+ // Path is an HTTP override for an APICall.
+ Path string
} | feat(v2): add WithPath override support (#<I>) | googleapis_gax-go | train | go |
ff6b7f13c5066aa74097c2a01c9d836096adfb07 | diff --git a/SentryTarget.php b/SentryTarget.php
index <HASH>..<HASH> 100644
--- a/SentryTarget.php
+++ b/SentryTarget.php
@@ -33,12 +33,17 @@ class SentryTarget extends Target
* @var \Raven_Client
*/
protected $client;
-
- public function init()
+
+ /**
+ * {@inheritdoc}
+ */
+ public function collect($messages, $final)
{
- parent::init();
-
- $this->client = new \Raven_Client($this->dsn, $this->clientOptions);
+ if (!isset($this->client)) {
+ $this->client = new \Raven_Client($this->dsn, $this->clientOptions);
+ }
+
+ parent::collect($messages, $final);
}
/**
@@ -106,4 +111,4 @@ class SentryTarget extends Target
return isset($levels[$level]) ? $levels[$level] : 'error';
}
-}
\ No newline at end of file
+} | Update SentryTarget.php
Moved creating Ravel_Client to the try catch block | notamedia_yii2-sentry | train | php |
7b09f38f739f486a692096c35236c7eef094e933 | diff --git a/snapshot.go b/snapshot.go
index <HASH>..<HASH> 100644
--- a/snapshot.go
+++ b/snapshot.go
@@ -228,6 +228,11 @@ func (r *Raft) compactLogs(snapIdx uint64) error {
// after the snapshot to be removed.
maxLog := min(snapIdx, lastLogIdx-r.conf.TrailingLogs)
+ if minLog > maxLog {
+ r.logger.Info("no logs to truncate")
+ return nil
+ }
+
r.logger.Info("compacting logs", "from", minLog, "to", maxLog)
// Compact the logs | issue<I> Snapshot can attempt to delete a negative range from log (#<I>)
* issue<I> Snapshot can attempt to delete a negative range from log
* issue <I> change it to strict inequality | hashicorp_raft | train | go |
2c50b0a36ca42ae02591598656295378f2a57d11 | diff --git a/addon/utils/clamp.js b/addon/utils/clamp.js
index <HASH>..<HASH> 100644
--- a/addon/utils/clamp.js
+++ b/addon/utils/clamp.js
@@ -10,7 +10,7 @@
* @param {String} cssClass - A CSS class applied to the last line instead of inline CSS.
*/
-var measure,
+let measure,
text,
lineWidth,
pos,
@@ -31,7 +31,7 @@ var measure,
ctn;
function appendNodeAndQueueToElement(element, node, queue) {
- var queueLength = queue && queue.length,
+ let queueLength = queue && queue.length,
i,
aNode,
bNode; | Move two `var` to `let` | ember-truncate_ember-truncate | train | js |
7e694a7a15d0eea33950fac9d0de526432ba2bbc | diff --git a/hijack/urls.py b/hijack/urls.py
index <HASH>..<HASH> 100644
--- a/hijack/urls.py
+++ b/hijack/urls.py
@@ -21,7 +21,7 @@ if not hijacking_user_attributes or 'email' in hijacking_user_attributes:
name='login_with_email', ), )
if not hijacking_user_attributes or 'username' in hijacking_user_attributes:
urlpatterns += patterns('hijack.views',
- url(r'^username/(?P<username>\w+)/$',
+ url(r'^username/(?P<username>.*)/$',
view='login_with_username',
name='login_with_username', ), )
if not hijacking_user_attributes or 'user_id' in hijacking_user_attributes: | allow email usernames in login_with_username | arteria_django-hijack | train | py |
ec3734da495f024d961f6494f8496768ffc2da91 | diff --git a/visidata/undo.py b/visidata/undo.py
index <HASH>..<HASH> 100644
--- a/visidata/undo.py
+++ b/visidata/undo.py
@@ -23,7 +23,7 @@ def undo(vd, sheet):
vd.fail("options.undo not enabled")
# don't allow undo of first command on a sheet, which is always the command that created the sheet.
- for cmdlogrow in sheet.cmdlog_sheet.rows[1::-1]:
+ for cmdlogrow in sheet.cmdlog_sheet.rows[:0:-1]:
if cmdlogrow.undofuncs:
for undofunc, args, kwargs, in cmdlogrow.undofuncs:
undofunc(*args, **kwargs) | [undo-] refix (again) skip first cmdlog entry | saulpw_visidata | train | py |
13312128b32e5f74bcb9c72169cdee710a611999 | diff --git a/packages/plugins/mocha-tests/src/lib/index.js b/packages/plugins/mocha-tests/src/lib/index.js
index <HASH>..<HASH> 100644
--- a/packages/plugins/mocha-tests/src/lib/index.js
+++ b/packages/plugins/mocha-tests/src/lib/index.js
@@ -75,6 +75,18 @@ class MochaTestRunner {
next();
});
},
+
+ (next) => {
+ this.web3.eth.getAccounts((err, accts) => {
+ if (err) {
+ return next(err);
+ }
+ accounts = accts;
+ this.web3.eth.defaultAccount = accts[0];
+ global.web3.eth.defaultAccount = accts[0];
+ next();
+ });
+ },
(next) => {
// Remove contracts that are not in the configs
const realContracts = {};
@@ -117,16 +129,12 @@ class MochaTestRunner {
if (!compiledContracts[contract.className]) {
compiledContracts[contract.className] = {};
}
+ instance.options.from = accounts[0];
+ instance.options.gas = 900000;
Object.setPrototypeOf(compiledContracts[contract.className], instance);
}
next();
- },
- (next) => {
- this.web3.eth.getAccounts((err, accts) => {
- accounts = accts;
- next(err);
- });
}
], (err) => {
// Reset the gas accumulator so that we don't show deployment gas on the | fix(@embark/mocha-tests): set accounts correctly on each contracts | embark-framework_embark | train | js |
e2397c68343ae623d76eb5025049ef04b7589fd0 | diff --git a/src/clients/RestClient.js b/src/clients/RestClient.js
index <HASH>..<HASH> 100644
--- a/src/clients/RestClient.js
+++ b/src/clients/RestClient.js
@@ -50,11 +50,6 @@ const normalizeQueryParams = (params) => {
};
export const createRestClient = ({ baseUrl = BaseUrls.production, timeout = 0 } = {}) => {
- const client = axios.create({
- baseURL: baseUrl,
- timeout
- });
-
return (path, method = 'get', params, auth) => {
const headers = {
Accept: 'application/json'
@@ -64,7 +59,7 @@ export const createRestClient = ({ baseUrl = BaseUrls.production, timeout = 0 }
}
const query = (method === 'get' && params) ? qs.stringify(normalizeQueryParams(params), { addQueryPrefix: true }) : '';
- const url = `${baseUrl}${path}${query}`
+ const url = `${baseUrl}${path}${query}`;
const request = {
method, | eslint happiness. | wix_wix-restaurants-js-sdk | train | js |
361e919a03614d65626ff330582edd08a4df9866 | diff --git a/test/test.number.js b/test/test.number.js
index <HASH>..<HASH> 100644
--- a/test/test.number.js
+++ b/test/test.number.js
@@ -6,6 +6,9 @@
var // Expectation library:
chai = require( 'chai' ),
+ // Validate a value is NaN:
+ isnan = require( 'validate.io-nan' ),
+
// Module to be tested:
mean = require( './../lib/number.js' );
@@ -31,4 +34,9 @@ describe( 'number mean', function tests() {
assert.closeTo( mean( 8 ), 10.02651, 1e-5 );
});
+ it( 'should return `NaN` for non-positive `sigma` parameters', function test() {
+ assert.isTrue( isnan( mean( -1 ) ) );
+ assert.isTrue( isnan( mean( 0 ) ) );
+ });
+
}); | [FIX] missing test for non-positive sigma added | distributions-io_rayleigh-mean | train | js |
c6b6a2e7941ed89b832a6f963f6714f6870daf26 | diff --git a/lib/BasicAuth.php b/lib/BasicAuth.php
index <HASH>..<HASH> 100644
--- a/lib/BasicAuth.php
+++ b/lib/BasicAuth.php
@@ -276,7 +276,7 @@ class BasicAuth extends AbstractController {
$this->debug("initializating authentication page");
//if(!$_GET['page'])$this->api->page=$this->api->getConfig('auth/login_page','Index');
- $p=$this->add('Page',null,null,array('empty'));
+ $p=$this->add('View',null,null,array('empty'));
try{
$p->template->loadTemplate('login');
$this->form=$this->createForm($p,'Login'); | Fixed authbox to use view rather than page | atk4_atk4 | train | php |
422a74ee9690ddaa996472bc702b6f5e5e28a316 | diff --git a/src/conditionals.js b/src/conditionals.js
index <HASH>..<HASH> 100644
--- a/src/conditionals.js
+++ b/src/conditionals.js
@@ -48,9 +48,5 @@ const CONDITIONALS = module.exports = {
} else {
return req.method === method;
}
- },
-
- authScope: function(_req, _scope) {
- return false;
}
}; | There's not auth middleware yet, so removing that conditional | ExpressGateway_express-gateway | train | js |
b6e153a31a7a14d24a9304fab78d5fa72e31595c | diff --git a/src/Mouf/MoufCache.php b/src/Mouf/MoufCache.php
index <HASH>..<HASH> 100644
--- a/src/Mouf/MoufCache.php
+++ b/src/Mouf/MoufCache.php
@@ -226,6 +226,7 @@ class MoufCache {
foreach ($files as $filename) {
unlink($filename);
}
+ return;
}
apc_clear_cache('user'); | Fixing code cache purge without APC | thecodingmachine_mouf | train | php |
ce45fc2eec103af5876723b167fb660da6af3a58 | diff --git a/src/main/java/io/reactivex/rxjava3/core/Single.java b/src/main/java/io/reactivex/rxjava3/core/Single.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/reactivex/rxjava3/core/Single.java
+++ b/src/main/java/io/reactivex/rxjava3/core/Single.java
@@ -4735,7 +4735,7 @@ public abstract class Single<@NonNull T> implements SingleSource<T> {
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
- public final Disposable subscribe(@NonNull BiConsumer<? super T, ? super Throwable> onCallback) {
+ public final Disposable subscribe(@NonNull BiConsumer<@Nullable ? super T, @Nullable ? super Throwable> onCallback) {
Objects.requireNonNull(onCallback, "onCallback is null");
BiConsumerSingleObserver<T> observer = new BiConsumerSingleObserver<>(onCallback); | Fix missing nullability on Single.subscribe(BiConsumer) (#<I>) | ReactiveX_RxJava | train | java |
5e1dee9efadcb271428bb49a23bbcb19041dd2be | diff --git a/plugs/message/html/render/about.js b/plugs/message/html/render/about.js
index <HASH>..<HASH> 100644
--- a/plugs/message/html/render/about.js
+++ b/plugs/message/html/render/about.js
@@ -90,7 +90,17 @@ exports.create = function (api) {
if (msg.value.content.type !== 'about') return
if (!ref.isFeed(msg.value.content.about)) return
var c = msg.value.content
- if (!c || (!c.description && !c.image && !c.name)) return
+ if (!c || (!c.description && !isBlobLink(c.image) && !c.name)) return
return true
}
}
+
+function isBlobLink (link) {
+ if (link && typeof link.link === 'string') {
+ link = link.link
+ }
+ var parsed = ref.parseLink(link)
+ if (parsed && ref.isBlob(parsed.link)) {
+ return true
+ }
+}
\ No newline at end of file | don't render about messages with non-blob images | ssbc_patchwork | train | js |
98ad234a240dd21c7317550587f31d578feea40b | diff --git a/src/jquery.fancytree.js b/src/jquery.fancytree.js
index <HASH>..<HASH> 100644
--- a/src/jquery.fancytree.js
+++ b/src/jquery.fancytree.js
@@ -1073,6 +1073,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{
if( p === otherNode ){
return true;
}
+ if( p === p.parent ) { $.error("Recursive parent link: " + p); }
p = p.parent;
}
return false; | Add check for endless recursions | mar10_fancytree | train | js |
fad223bb26bc5fbfdcd9f543ffa488fb73d74193 | diff --git a/packages/crafty-preset-jest/src/index.js b/packages/crafty-preset-jest/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/crafty-preset-jest/src/index.js
+++ b/packages/crafty-preset-jest/src/index.js
@@ -46,9 +46,9 @@ function normalizeJestOptions(crafty, input, cli) {
preset.jest(crafty, options);
});
- // Support all extensions that can be transformed for test files extensions
+ // Support all extensions that can be transformed for test files extensions, except for json
if (!options.hasOwnProperty("testRegex")) {
- const extensions = options.moduleFileExtensions.join("|");
+ const extensions = options.moduleFileExtensions.filter(extension => extension !== 'json').join("|");
options.testRegex = `(/__tests__/.*|(\\.|/)(test|spec))\\.(${extensions})$`;
} | Remove .json as a test file extension | swissquote_crafty | train | js |
127f77964e862b323b51f81052fe1c10edbafe8e | diff --git a/examples/markdown/app.js b/examples/markdown/app.js
index <HASH>..<HASH> 100644
--- a/examples/markdown/app.js
+++ b/examples/markdown/app.js
@@ -2,14 +2,14 @@
// Expose modules in ./support for demo purposes
require.paths.unshift(__dirname + '/../../support');
-// $ npm install markdown
+// $ npm install node-markdown
/**
* Module dependencies.
*/
var express = require('../../lib/express')
- , md = require('markdown').markdown;
+ , md = require('node-markdown').Markdown;
var app = express.createServer();
@@ -19,7 +19,7 @@ var app = express.createServer();
app.register('.md', {
compile: function(str, options){
- var html = md.toHTML(str);
+ var html = md(str);
return function(locals){
return html.replace(/\{([^}]+)\}/g, function(_, name){
return locals[name]; | Updated markdown example to latest version of node-markdown and modified the compile method. | expressjs_express | train | js |
8864c666f5b26efa65fd8860ccddd41d2bfb0510 | diff --git a/tensorflow_datasets/video/bair_robot_pushing.py b/tensorflow_datasets/video/bair_robot_pushing.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/video/bair_robot_pushing.py
+++ b/tensorflow_datasets/video/bair_robot_pushing.py
@@ -98,7 +98,6 @@ class BairRobotPushingSmall(tfds.core.GeneratorBasedBuilder):
}),
]
- @tfds.core.drop_key_if_not_s3
def _generate_examples(self, filedir):
logging.info("Reading data from %s.", filedir)
files = tf.io.gfile.listdir(filedir) | Delete decorator on bair_robot_pushing dataset | tensorflow_datasets | train | py |
7369802567e0a808fdf74f83e33283d3d1018c56 | diff --git a/teslajsonpy/__version__.py b/teslajsonpy/__version__.py
index <HASH>..<HASH> 100644
--- a/teslajsonpy/__version__.py
+++ b/teslajsonpy/__version__.py
@@ -6,4 +6,4 @@ For more details about this api, please refer to the documentation at
https://github.com/zabuldon/teslajsonpy
"""
-__version__ = "0.8.0"
+__version__ = "0.8.1" | <I>
Automatically generated by python-semantic-release | zabuldon_teslajsonpy | train | py |
78680f055f4259e31f0b4989a5695604108d9fdd | diff --git a/tcex/bin/lib.py b/tcex/bin/lib.py
index <HASH>..<HASH> 100644
--- a/tcex/bin/lib.py
+++ b/tcex/bin/lib.py
@@ -112,8 +112,9 @@ class Lib(Bin):
def _create_lib_latest(self):
"""Create the lib_latest symlink for App Builder."""
- # TODO: Update this method to copy latest lib directory on Windows.
- if platform.system() != 'Windows':
+ if platform.system() == 'Windows':
+ shutil.copytree('lib_{}'.format(self.latest_version), self.static_lib_dir)
+ else:
if os.path.islink(self.static_lib_dir):
os.unlink(self.static_lib_dir)
os.symlink('lib_{}'.format(self.latest_version), self.static_lib_dir) | Added support for Windows
Windows requires administrator or a specific local security policy to create a symlink. This commit copies the lib_3.X to lib_latest so that tclib and tcpackage work correctly for Windows. | ThreatConnect-Inc_tcex | train | py |
1fcc5ecfd48d20d9886e98c86945f140ea896457 | diff --git a/demands/service.py b/demands/service.py
index <HASH>..<HASH> 100644
--- a/demands/service.py
+++ b/demands/service.py
@@ -28,10 +28,7 @@ class Request(object):
arguments['cookies'] = self.cookies
arguments['headers'] = self.headers
arguments['auth'] = self.auth
-
- if self.url.startswith('https'):
- arguments['verify'] = self.verify
-
+ arguments['verify'] = self.verify
return arguments
def authenticate(self, username, password):
@@ -112,7 +109,12 @@ class HTTPService(object):
"""
base = self.config.get('url')
url = '/'.join([base.rstrip('/'), path.lstrip('/')])
- verify = self.config.get('verify_ssl', True)
+
+ # Verify precedence
+ # HTTP (False) < HTTPS (True) < HTTPService config < call argument
+ verify = True if url.startswith('https') else False
+ verify = self.config.get('verify_ssl', verify)
+ verify = kwargs.pop('verify', verify)
request = Request(url, method, verify=verify, **kwargs) | Refactor how "verify" is set | yola_demands | train | py |
d8de69b50ab2e2e0eca4a750dd8eaf58da96fec6 | diff --git a/lib/watir-webdriver/version.rb b/lib/watir-webdriver/version.rb
index <HASH>..<HASH> 100644
--- a/lib/watir-webdriver/version.rb
+++ b/lib/watir-webdriver/version.rb
@@ -1,3 +1,3 @@
module Watir
- VERSION = "0.3.0"
+ VERSION = "0.3.1.dev"
end | Bump gem version to <I>.dev | watir_watir | train | rb |
39aef6a545db9a65103f4e35dd138b23967f1691 | diff --git a/src/lettersidc/metadata.js b/src/lettersidc/metadata.js
index <HASH>..<HASH> 100644
--- a/src/lettersidc/metadata.js
+++ b/src/lettersidc/metadata.js
@@ -321,9 +321,9 @@ export function metadata(ms, metadata, mapping) {
"NA----"
].indexOf(functionid) > -1
) {
- if (this.metadata.STD2525) {
+ if (metadata.STD2525) {
metadata.fill = false;
- if (metadata.functionid == "WD----") {
+ if (functionid == "WD----") {
metadata.fill = true;
}
if ( | Fix sea mines in <I>B <I>C and APP6-B | spatialillusions_milsymbol | train | js |
17327aeeeee707fc4e7e3ac29b90fac15f7828ff | diff --git a/test/marko-v3-test.js b/test/marko-v3-test.js
index <HASH>..<HASH> 100644
--- a/test/marko-v3-test.js
+++ b/test/marko-v3-test.js
@@ -13,7 +13,7 @@ if (!fs.existsSync(path.join(__dirname, 'marko-v3/node_modules/marko'))) {
}
-describe('marko-prettyprint' , function() {
+describe('marko-prettyprint (marko v3)' , function() {
var autoTestDir = path.join(__dirname, 'marko-v3/autotest'); | Fixed label for marko v3 tests | marko-js_marko-prettyprint | train | js |
7947cd77e4dcd73eb0816a1da5ef3902666ba47a | diff --git a/src/ajax.js b/src/ajax.js
index <HASH>..<HASH> 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -345,7 +345,7 @@ jQuery.extend({
// Dereference transport for early garbage collection
// (no matter how long the jXHR transport will be used
- transport = 0;
+ transport = undefined;
// Set readyState
jXHR.readyState = status ? 4 : 0; | Use undefined instead of 0 to deference transport for clarity. | jquery_jquery | train | js |
7bea2da1846ca5ce5124e231b352d1d4a4af3e66 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,8 @@ setup(name='pyemir',
'console_scripts': ['numina = numina.user:main'],
},
test_suite="nose.collector",
- requires=['setuptools', 'numpy', 'pyfits', 'scipy', 'sphinx', 'nose', 'pyxdg', 'simplejson'],
+ test_requires=['nose'],
+ requires=['setuptools', 'numpy', 'pyfits', 'scipy', 'sphinx', 'pyxdg', 'simplejson'],
classifiers=[
"Programming Language :: Python",
'Development Status :: 3 - Alpha', | nose package moved from requires to test_requires | guaix-ucm_pyemir | train | py |
e194684c0c3d97e0050382ab62eaa855583feeb3 | diff --git a/spec/sprinkle/verify_spec.rb b/spec/sprinkle/verify_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/sprinkle/verify_spec.rb
+++ b/spec/sprinkle/verify_spec.rb
@@ -82,7 +82,7 @@ describe Sprinkle::Verify do
end
it 'should test the process list to find a process' do
- @verification.commands.should include("ps aux | grep 'httpd' | grep -v grep")
+ @verification.commands.should include("ps -C httpd")
end
it 'should check if ruby can include a, b, c' do | [FIX] Verify spec after ps -C update | sprinkle-tool_sprinkle | train | rb |
6ba04d0697084a7a25b06bd7d76cbf74b4556f19 | diff --git a/public/js/chrome/navigation.js b/public/js/chrome/navigation.js
index <HASH>..<HASH> 100644
--- a/public/js/chrome/navigation.js
+++ b/public/js/chrome/navigation.js
@@ -332,7 +332,8 @@ $('#lostpass').click(function (e) {
jsbin.settings.includejs = jsbin.settings.includejs === undefined ? true : jsbin.settings.includejs;
-if (sessionStorage.runnerPending) {
+// ignore for embed as there might be a lot of embeds on the page
+if (!jsbin.embed && sessionStorage.runnerPending) {
$document.trigger('tip', {
content: 'It looks like your last session may have crashed, so I\'ve disabled "Auto-run JS" for you',
type: 'error'
diff --git a/public/js/render/live.js b/public/js/render/live.js
index <HASH>..<HASH> 100644
--- a/public/js/render/live.js
+++ b/public/js/render/live.js
@@ -141,6 +141,10 @@ var renderer = (function () {
// specific change to handle reveal embedding
try {
if (event.data.indexOf('slide:') === 0 || event.data === 'jsbin:refresh') {
+ // reset the state of the panel visibility
+ jsbin.panels.allEditors(function (p) {
+ p.visible = false;
+ });
jsbin.panels.restore();
return;
} | Fixed #<I>
The panels were being asked to restore, but they thought they were visible already, so we reset before restoring. | jsbin_jsbin | train | js,js |
b62ccb82eb2b0cbcbeba054dac1f1d6181bb0676 | diff --git a/test/helpers/wrappers.go b/test/helpers/wrappers.go
index <HASH>..<HASH> 100644
--- a/test/helpers/wrappers.go
+++ b/test/helpers/wrappers.go
@@ -49,6 +49,14 @@ func CurlFail(endpoint string) string {
CurlConnectTimeout, endpoint)
}
+// CurlWithHTTPCode retunrs the string representation of the curl command which
+// only outputs the HTTP code returned by its execution against the specified
+// endpoint.
+func CurlWithHTTPCode(endpoint string) string {
+ return fmt.Sprintf(`curl -s --output /dev/stderr -w '%%{http_code}' --connect-timeout %d XGET %s`,
+ CurlConnectTimeout, endpoint)
+}
+
// Netperf returns the string representing the netperf command to use when testing
// connectivity between endpoints.
func Netperf(endpoint string, perfTest PerfTest) string { | test/helpers: add CurlWithHTTPCode helper function
Add function which gets HTTP return code from curl. | cilium_cilium | train | go |
80b85411f119b8626a948cd311debb1be8b75195 | diff --git a/packages/util/browserdetect.js b/packages/util/browserdetect.js
index <HASH>..<HASH> 100644
--- a/packages/util/browserdetect.js
+++ b/packages/util/browserdetect.js
@@ -103,10 +103,10 @@ exports.BrowserDetect = new function() {
}
this.browser = searchString(dataBrowser) || "unknown";
- this.version = searchVersion(navigator.userAgent)
- || searchVersion(navigator.appVersion)
+ this.version = searchVersion(navigator.userAgent || '')
+ || searchVersion(navigator.appVersion || '')
|| "unknown";
this.OS = searchString(dataOS) || "unknown";
this.isWebKit = RegExp(" AppleWebKit/").test(navigator.userAgent);
this['is'+this.browser] = this.version;
-};
\ No newline at end of file
+}; | Fix navigator.userAgent and appVersion undefined
In rare cases, navigator.userAgent and navigator.appVersion are
undefined. Browser detect attempts to return 'unknown' when these are
not provided, but an error was thrown when these were undefined. | gameclosure_js.io | train | js |
48c3379f5e215f026699125f128f61cd04a40862 | diff --git a/lib/libusb/transfer.rb b/lib/libusb/transfer.rb
index <HASH>..<HASH> 100644
--- a/lib/libusb/transfer.rb
+++ b/lib/libusb/transfer.rb
@@ -47,6 +47,7 @@ module LIBUSB
@buffer = nil
@completion_flag = Context::CompletionFlag.new
@allow_device_memory = false
+ @dev_handle = nil
args.each{|k,v| send("#{k}=", v) }
end
private :initialize | Avoid warning about uninitialzed variable @dev_handle
... in Transfer#ensure_enough_buffer | larskanis_libusb | train | rb |
e6e53a4741d0480666bebefad473d3fab8afe1af | diff --git a/lib/data_mapper/relation_registry/builder.rb b/lib/data_mapper/relation_registry/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/data_mapper/relation_registry/builder.rb
+++ b/lib/data_mapper/relation_registry/builder.rb
@@ -139,8 +139,7 @@ module DataMapper
# @api private
def build_node(name, relation)
unless relations[name]
- node = relations.build_node(name, relation)
- relations.add_node(node)
+ relations.new_node(name, relation)
end
relations[name] | Simplify RelationRegistry::Builder#build_node a little | rom-rb_rom | train | rb |
eced59dc9a1763f7d0bb29df5c7c2ad64601166c | diff --git a/src/Resource/Async/Repository.php b/src/Resource/Async/Repository.php
index <HASH>..<HASH> 100644
--- a/src/Resource/Async/Repository.php
+++ b/src/Resource/Async/Repository.php
@@ -42,4 +42,15 @@ class Repository extends BaseRepository
return $this->getTransport()->getHydrator()->hydrate('Commit', $build);
});
}
+
+ public function caches(): ObservableInterface
+ {
+ return Promise::toObservable(
+ $this->getTransport()->request('repos/' . $this->slug() . '/caches')
+ )->flatMap(function ($response) {
+ return Observable::fromArray($response['caches']);
+ })->map(function ($cache) {
+ return $this->getTransport()->getHydrator()->hydrate('Cache', $cache);
+ });
+ }
} | Fetch caches async | php-api-clients_client-services | train | php |
1c5099c07b72f36a51c3deb681f96fcf08b2064a | 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
@@ -29,6 +29,13 @@ end
# Configure rspec options
RSpec.configure do |config|
+
+ # Explicitly allow the old `object.should` syntax. We disallow the new
+ # `expect(object)` syntax for now to enforce consistency.
+ config.expect_with :rspec do |c|
+ c.syntax = :should
+ end
+
config.mock_framework = :mocha
config.include(ConnectionHelpers) | Specify which matcher syntax to use
Since we're using `should` syntax, we need to explicitly enable it to
avoid deprecation warnings in rspec <I>. | yellow5_foreigner-matcher | train | rb |
d445cf352b020563ef4f88c4420a71e9576d374e | diff --git a/lib/node_modules/@stdlib/repl/lib/namespace/b.js b/lib/node_modules/@stdlib/repl/lib/namespace/b.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/repl/lib/namespace/b.js
+++ b/lib/node_modules/@stdlib/repl/lib/namespace/b.js
@@ -995,6 +995,14 @@ ns.push({
});
ns.push({
+ 'alias': 'base.dist.binomial.stdev',
+ 'path': '@stdlib/math/base/dist/binomial/stdev',
+ 'value': require( '@stdlib/math/base/dist/binomial/stdev' ),
+ 'type': 'Function',
+ 'related': []
+});
+
+ns.push({
'alias': 'base.dist.binomial.variance',
'path': '@stdlib/math/base/dist/binomial/variance',
'value': require( '@stdlib/math/base/dist/binomial/variance' ), | Add binomial stdev to REPL | stdlib-js_stdlib | train | js |
a92aaa95260ac1f01a93cddb6850ad0b6ba06113 | diff --git a/eli5/xgboost.py b/eli5/xgboost.py
index <HASH>..<HASH> 100644
--- a/eli5/xgboost.py
+++ b/eli5/xgboost.py
@@ -155,10 +155,10 @@ def explain_prediction_xgboost(
proba = None
else:
if n_targets == 1:
- p = prediction[0]
+ p, = prediction
proba = np.array([1 - p, p])
else:
- proba = prediction[0]
+ proba, = prediction
else:
proba = predict_proba(xgb, X)
n_targets = _xgb_n_targets(xgb) | unpack like in get_proba from sklearn | TeamHG-Memex_eli5 | train | py |
dcb4d2ff86f85ef44b1088840852a2b45b2d3662 | diff --git a/lib/bullet/rack.rb b/lib/bullet/rack.rb
index <HASH>..<HASH> 100644
--- a/lib/bullet/rack.rb
+++ b/lib/bullet/rack.rb
@@ -111,7 +111,7 @@ module Bullet
# Make footer work for XHR requests by appending data to the footer
def xhr_script
- File.read("#{File.expand_path(File.dirname(__FILE__))}/bullet_xhr.js")
+ File.read("#{__dir__}/bullet_xhr.js")
end
end
end | Auto corrected by following Ruby Style/Dir | flyerhzm_bullet | train | rb |
64f31e95b2283388979489ace6bdc52ad0ed5c57 | diff --git a/lib/epub/cfi.rb b/lib/epub/cfi.rb
index <HASH>..<HASH> 100644
--- a/lib/epub/cfi.rb
+++ b/lib/epub/cfi.rb
@@ -16,7 +16,7 @@ module EPUB
class Path
attr_reader :step, :local_path
- def initialize(step, local_path=nil)
+ def initialize(step, local_path)
@step, @local_path = step, local_path
@string_cache = @fragment_cache = nil
end | Make local_path argument for CFI::Path.new required | KitaitiMakoto_epub-parser | train | rb |
a9b87c9ad3cc1516869884530853c339a394dc52 | diff --git a/nni/algorithms/nas/pytorch/darts/trainer.py b/nni/algorithms/nas/pytorch/darts/trainer.py
index <HASH>..<HASH> 100644
--- a/nni/algorithms/nas/pytorch/darts/trainer.py
+++ b/nni/algorithms/nas/pytorch/darts/trainer.py
@@ -210,5 +210,5 @@ class DartsTrainer(Trainer):
dalphas.append(torch.autograd.grad(loss, self.mutator.parameters()))
dalpha_pos, dalpha_neg = dalphas # dalpha { L_trn(w+) }, # dalpha { L_trn(w-) }
- hessian = [(p - n) / 2. * eps for p, n in zip(dalpha_pos, dalpha_neg)]
+ hessian = [(p - n) / (2. * eps) for p, n in zip(dalpha_pos, dalpha_neg)]
return hessian | Bug-fixed for _compute_hessian in Pytorch NAS Darts (#<I>) | Microsoft_nni | train | py |
4780f7d8eaea2af367f5e72430c71d76f50bfeb9 | diff --git a/spyderlib/rope_patch.py b/spyderlib/rope_patch.py
index <HASH>..<HASH> 100644
--- a/spyderlib/rope_patch.py
+++ b/spyderlib/rope_patch.py
@@ -193,9 +193,7 @@ def apply():
return doc
def _get_single_function_docstring(self, pyfunction):
- signature = self._get_function_signature(pyfunction)
docs = pyfunction.get_doc()
- docs = self._trim_docstring(pyfunction.get_doc(), indents=0)
+ docs = self._trim_docstring(docs, indents=0)
return docs
- return signature + ':\n\n' + docs
codeassist.PyDocExtractor = PatchedPyDocExtractor | Rope patch: Eliminate unnecessary double return on a function
Update Issue <I>
Status: Fixed
- Thanks to Sergey Satskiy for noticing it. | spyder-ide_spyder | train | py |
83b2bc1160e9b5fb5820a3c1b3a9ea0463289749 | diff --git a/lib/ruboto/commands/base.rb b/lib/ruboto/commands/base.rb
index <HASH>..<HASH> 100644
--- a/lib/ruboto/commands/base.rb
+++ b/lib/ruboto/commands/base.rb
@@ -500,11 +500,13 @@ module Ruboto
if params['version'].value
puts version
else
- puts %Q{
- Ruboto -- Ruby for Android #{version}
- Execute `ruboto gen app --help` for instructions on how to generate a fresh Ruby-enabled Android app
- Execute `ruboto --help` for other options
- }
+ puts <<EOF
+
+ Ruboto -- Ruby for Android #{version}
+ Execute `ruboto gen app --help` for instructions on how to generate a fresh Ruboto app
+ Execute `ruboto --help` for other options
+
+EOF
end
end
end | Removed unnecessary indent in usage message and made i slightly shorter to fit on an <I> character shell window. | ruboto_ruboto | train | rb |
c4f8b83b818cb7fad89dd46ba3d4745e3bea7f93 | diff --git a/producer.go b/producer.go
index <HASH>..<HASH> 100644
--- a/producer.go
+++ b/producer.go
@@ -176,7 +176,7 @@ func (w *Producer) Stop() {
w.guard.Unlock()
return
}
- w.log(LogLevelInfo, "stopping")
+ w.log(LogLevelInfo, "(%s) stopping", w.addr)
close(w.exitChan)
w.close()
w.guard.Unlock()
@@ -296,7 +296,7 @@ func (w *Producer) connect() error {
}
state := atomic.LoadInt32(&w.state)
- switch {
+ switch {
case state == StateConnected:
return nil
case state != StateInit:
@@ -363,7 +363,7 @@ func (w *Producer) router() {
exit:
w.transactionCleanup()
w.wg.Done()
- w.log(LogLevelInfo, "exiting router")
+ w.log(LogLevelInfo, "(%s) exiting router", w.conn.String())
}
func (w *Producer) popTransaction(frameType int32, data []byte) { | producer: fix shutdown logs to be uniform with others | nsqio_go-nsq | train | go |
4ccba7b25af22b59ef88660758cae55626a97ebe | diff --git a/common/errors/multierror.go b/common/errors/multierror.go
index <HASH>..<HASH> 100644
--- a/common/errors/multierror.go
+++ b/common/errors/multierror.go
@@ -88,9 +88,11 @@ type LazyMultiError struct {
// Assign semantically assigns the error to the given index in the MultiError.
// If the error is nil, no action is taken. Otherwise the MultiError is
// allocated to its full size (if not already), and the error assigned into it.
-func (e *LazyMultiError) Assign(i int, err error) {
+//
+// It returns true iff err != nil.
+func (e *LazyMultiError) Assign(i int, err error) bool {
if err == nil {
- return
+ return false
}
e.Lock()
defer e.Unlock()
@@ -98,6 +100,7 @@ func (e *LazyMultiError) Assign(i int, err error) {
e.me = make(MultiError, e.Size)
}
e.me[i] = err
+ return true
}
// Get returns the MultiError, or nil, if no non-nil error was Assign'd. | Make LazyMultiError.Assign return bool.
This allows lme.Assign to be easily incorporated into conditional
statements which need to determine if err was nil or not.
R=<EMAIL>, <EMAIL>, <EMAIL>
BUG=
Review URL: <URL> | luci_luci-go | train | go |
9863e2a435c6162ce5b90b38cfb47dfaad96dcd4 | diff --git a/patch-gl.js b/patch-gl.js
index <HASH>..<HASH> 100644
--- a/patch-gl.js
+++ b/patch-gl.js
@@ -61,7 +61,7 @@ function patch (gl) {
if (name === 'oes_texture_float_linear') return {}
if (name === 'oes_texture_half_float') {
return {
- HALF_FLOAT_OES: isBrowser ? 0x8D61 : gl.HALF_FLOAT
+ HALF_FLOAT_OES: gl.HALF_FLOAT
}
}
if (name === 'oes_texture_half_float_linear') return {} | Remove browser check in HalfFloat extension for Pex | pex-gl_pex-gl | train | js |
3d93e39edbb400a176a4e4b3f83d29e37eb888f5 | diff --git a/lib/swaggerUI.js b/lib/swaggerUI.js
index <HASH>..<HASH> 100644
--- a/lib/swaggerUI.js
+++ b/lib/swaggerUI.js
@@ -3,8 +3,9 @@
var P = require('bluebird');
var fs = P.promisifyAll(require('fs'));
var path = require('path');
+// swagger-ui helpfully exports the absolute path of its dist directory
+var docRoot = require('swagger-ui').dist + '/';
-var docRoot = __dirname + '/../node_modules/swagger-ui/dist/';
function staticServe (restbase, req) {
// Expand any relative paths for security
var filePath = req.query.path.replace(/\.\.\//g, ''); | Use swagger-ui's dist path export
This makes the docs work in setups (like prod) where the node_modules checkout
is not inside the restbase repository. | wikimedia_restbase | train | js |
5507adadf1406cb5f8ced70ed22e469036de9433 | diff --git a/core/server/data/import/utils.js b/core/server/data/import/utils.js
index <HASH>..<HASH> 100644
--- a/core/server/data/import/utils.js
+++ b/core/server/data/import/utils.js
@@ -108,17 +108,17 @@ utils = {
preProcessPostTags: function preProcessPostTags(tableData) {
var postTags,
- postsWithTags = {};
+ postsWithTags = new Map();
postTags = tableData.posts_tags;
_.each(postTags, function (postTag) {
- if (!postsWithTags.hasOwnProperty(postTag.post_id)) {
- postsWithTags[postTag.post_id] = [];
+ if (!postsWithTags.get(postTag.post_id)) {
+ postsWithTags.set(postTag.post_id, []);
}
- postsWithTags[postTag.post_id].push(postTag.tag_id);
+ postsWithTags.get(postTag.post_id).push(postTag.tag_id);
});
- _.each(postsWithTags, function (tagIds, postId) {
+ postsWithTags.forEach(function (tagIds, postId) {
var post, tags;
post = _.find(tableData.posts, function (post) {
return post.id === postId; | Import from LTS blogs now properly adds tags to posts. (#<I>)
closes #<I>
- Importer now uses Javascript's Map instead of the normal object to ensure that tags are properly associated with their corresponding posts. | TryGhost_Ghost | train | js |
dee1c23ef6faafc01e63d93c0fb92c0557670d48 | diff --git a/app-servers/FlashPolicy.php b/app-servers/FlashPolicy.php
index <HASH>..<HASH> 100644
--- a/app-servers/FlashPolicy.php
+++ b/app-servers/FlashPolicy.php
@@ -22,6 +22,14 @@ class FlashPolicy extends AsyncServer
$this->bindSockets(Daemon::$settings['mod'.$this->modname.'listen'],Daemon::$settings['mod'.$this->modname.'listenport']);
}
}
+ /* @method update
+ @description Called when worker is going to update configuration.
+ @return void
+ */
+ public function update()
+ {
+ $this->policyData = file_get_contents(Daemon::$settings['mod'.$this->modname.'file']);
+ }
/* @method onReady
@description Called when the worker is ready to go.
@return void
@@ -30,7 +38,7 @@ class FlashPolicy extends AsyncServer
{
if (Daemon::$settings['mod'.$this->modname.'enable'])
{
- $this->policyData = file_get_contents(Daemon::$settings['mod'.$this->modname.'file']);
+ $this->update();
$this->enableSocketEvents();
}
} | Added update-handler for FlashPolicy.php | kakserpom_phpdaemon | train | php |
d128ec5b6ee8d09a34bc471e3bd54dd78723d686 | diff --git a/lib/fluent/command/binlog_reader.rb b/lib/fluent/command/binlog_reader.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/command/binlog_reader.rb
+++ b/lib/fluent/command/binlog_reader.rb
@@ -168,7 +168,7 @@ module BinlogReaderCommand
i = 1
Fluent::MessagePackFactory.unpacker(io).each do |(time, record)|
print @formatter.format(@path, time, record) # path is used for tag
- break if i == @options[:count] && @options[:count] != -1
+ break if @options[:count] && i == @options[:count]
i += 1
end
end
@@ -196,7 +196,7 @@ module BinlogReaderCommand
class Cat < Head
DEFAULT_CAT_OPTIONS = {
- count: -1
+ count: nil # Overwrite DEFAULT_HEAD_OPTIONS[:count]
}
def default_options | Use nil instead of -1 to check the number of lines to display | fluent_fluentd | train | rb |
ce72fe5f34755506c6246fba7f24fb14900ba9b9 | diff --git a/lib/grably/jobs/sync.rb b/lib/grably/jobs/sync.rb
index <HASH>..<HASH> 100644
--- a/lib/grably/jobs/sync.rb
+++ b/lib/grably/jobs/sync.rb
@@ -79,7 +79,7 @@ module Grably # :nodoc:
def setup_ssh_opts
@host = @dst
- @dst = job_dir('files')
+ @dst = job_dir('files') + '/' # This will cause to sync internal file structure
@host.match(SSH_HOST) do |m|
@ssh_pass = m[2] | Fix sync path in SyncJob | vizor-games_grably | train | rb |
ee57d38059c0136d3315aa9851977ad1837fe11d | diff --git a/filesystem/main.go b/filesystem/main.go
index <HASH>..<HASH> 100644
--- a/filesystem/main.go
+++ b/filesystem/main.go
@@ -4,8 +4,6 @@ import (
"io"
"os"
"time"
-
- "github.com/goatcms/goat-core/app"
)
const (
@@ -76,6 +74,4 @@ type File interface {
MIME() string
Name() string
CreateTime() time.Time
-
- DeferOn(scope app.EventScope, eventID int)
} | remove defer (bugfix: cycle problem ) | goatcms_goatcore | train | go |
7816f0204e8e1014df7428bc2f030f209caff6b7 | diff --git a/lib/peddler/operation.rb b/lib/peddler/operation.rb
index <HASH>..<HASH> 100644
--- a/lib/peddler/operation.rb
+++ b/lib/peddler/operation.rb
@@ -28,7 +28,7 @@ module Peddler
if val.respond_to?(:iso8601)
val = val.iso8601
elsif val.is_a?(Struct)
- val = val.to_h
+ val = val.to_h if val.respond_to?(:to_h)
end
if val.is_a?(Hash) | JRuby and MRI <I> don't implement Struct#to_h | hakanensari_peddler | train | rb |
59955c774444b5f5d57157535d8b386e81b689c0 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -42,6 +42,18 @@ salt fileserver. Here's an example:
- group: users
- mode: 644
+The ``source`` parameter can also specify a file in another Salt environment.
+In this example ``foo.conf`` in the ``dev`` environment will be used instead.
+
+.. code-block:: yaml
+
+ /etc/foo.conf:
+ file.managed:
+ - source:
+ - salt://foo.conf?env=dev
+ - user: foo
+ - group: users
+ - mode: 644
Directories can be managed via the ``directory`` function. This function can
create and enforce the permissions on a directory. A directory statement will | Document source file in a different environment | saltstack_salt | train | py |
2ca735ffb3e48e87320cc4f1c213e9692b9fcae3 | diff --git a/publish.js b/publish.js
index <HASH>..<HASH> 100644
--- a/publish.js
+++ b/publish.js
@@ -9,7 +9,7 @@ module.exports = function() {
var js_dependencies =[
'bower_components/jquery/dist/jquery.js',
- 'bower_components/jquery-ui/ui/jquery-ui.js'
+ 'bower_components/jquery-ui/jquery-ui.js'
];
var css_dependencies = [ | build: copy jquery-ui correctly.
the path of jquery-ui.js in bower was changed. | angular-ui_ui-sortable | train | js |
696255bca9b8ead9d033cc46144c002062b2d885 | diff --git a/scripts/experiments/run_ace2.py b/scripts/experiments/run_ace2.py
index <HASH>..<HASH> 100755
--- a/scripts/experiments/run_ace2.py
+++ b/scripts/experiments/run_ace2.py
@@ -362,9 +362,9 @@ class SrlExpParamsRunner(ExpParamsRunner):
root = RootStage()
train = get_annotation_as_train(ace05_bn_nw)
if self.expname == "ace-pm13":
- evls = [eval_types13,
- #eval_pm13 + ReExpParams(entityTypeRepl="NONE"),
- eval_pm13 + ReExpParams(entityTypeRepl="BROWN"),
+ evls = [#eval_types13,
+ eval_pm13 + ReExpParams(entityTypeRepl="NONE"),
+ #eval_pm13 + ReExpParams(entityTypeRepl="BROWN"),
] # eval_ng14, eval_types7]:
else:
evls = [eval_types36] | Adding PM<I> with NONE repl | mgormley_pacaya | train | py |
3c6fc5a9896075cd169c2f5bb58dc2dbd481c863 | diff --git a/src/Ranges.php b/src/Ranges.php
index <HASH>..<HASH> 100644
--- a/src/Ranges.php
+++ b/src/Ranges.php
@@ -51,16 +51,7 @@ class Ranges
{
return function ($value) use ($allowedValues)
{
- if (is_object($value))
- {
- foreach ($allowedValues as $allowedValue)
- if (is_a($value, $allowedValue))
- return true;
-
- return false;
- }
-
- return in_array(gettype($value), $allowedValues);
+ return in_array(gettype($value), $allowedValues, true);
};
} | Simplify Ranges::enum() some | Yoshi2889_validation-closures | train | php |
b5cff17f77d702b72c0193102eb6610929d0d377 | diff --git a/salt/modules/service.py b/salt/modules/service.py
index <HASH>..<HASH> 100644
--- a/salt/modules/service.py
+++ b/salt/modules/service.py
@@ -41,6 +41,7 @@ def __virtual__():
'elementary OS',
'McAfee OS Server',
'Raspbian',
+ 'SUSE',
))
if __grains__.get('os') in disable:
return (False, 'Your OS is on the disabled list') | service: SUSE is not based on sysvinit anymore
(cherry picked from commit dd1ec<I>bb<I>c<I>db9a<I>c4c<I>a<I>ef) | saltstack_salt | train | py |
f802416163317782463e91d713d64f72ea4a2006 | diff --git a/api/server/sdk/rest_gateway.go b/api/server/sdk/rest_gateway.go
index <HASH>..<HASH> 100644
--- a/api/server/sdk/rest_gateway.go
+++ b/api/server/sdk/rest_gateway.go
@@ -153,6 +153,7 @@ func (s *sdkRestGateway) restServerSetupHandlers() (http.Handler, error) {
api.RegisterOpenStorageRoleHandler,
api.RegisterOpenStoragePolicyHandler,
api.RegisterOpenStorageDiagsHandler,
+ api.RegisterOpenStorageBucketHandler,
}
// REST Gateway extensions
diff --git a/cmd/osd/main.go b/cmd/osd/main.go
index <HASH>..<HASH> 100644
--- a/cmd/osd/main.go
+++ b/cmd/osd/main.go
@@ -560,6 +560,10 @@ func start(c *cli.Context) error {
if err != nil {
return fmt.Errorf("Failed to start SDK server for driver %s: %v", d, err)
}
+
+ // Set the fake bucket driver handler on SDK server
+ sdkServer.UseBucketDrivers(fakeDriver)
+
sdkServer.Start()
} | Register bucket server on rest gateway and update handler on sdk server. | libopenstorage_openstorage | train | go,go |
8618c4963edf383a4b50d18cd1118f3c3b8e0d34 | diff --git a/alignak/scheduler.py b/alignak/scheduler.py
index <HASH>..<HASH> 100644
--- a/alignak/scheduler.py
+++ b/alignak/scheduler.py
@@ -1412,6 +1412,10 @@ class Scheduler(object): # pylint: disable=R0902
for down in data['downtimes']:
if down['uuid'] not in item.downtimes:
down['ref'] = item.uuid
+ # case comment_id has comment dict instead uuid
+ if 'uuid' in down['comment_id']:
+ data['comments'].append(down['comment_id'])
+ down['comment_id'] = down['comment_id']['uuid']
item.add_downtime(Downtime(down))
if item.acknowledgement is not None:
item.acknowledgement = Acknowledge(item.acknowledgement) | Fix comment_id in downtime, related with retention restoration. closes #<I> | Alignak-monitoring_alignak | train | py |
1cd8543b12c31ecf1e140c866d2615cd6ccaa09f | diff --git a/src/Google/Client.php b/src/Google/Client.php
index <HASH>..<HASH> 100644
--- a/src/Google/Client.php
+++ b/src/Google/Client.php
@@ -250,7 +250,7 @@ class Google_Client
// The response is json encoded, so could be the string null.
// It is arguable whether this check should be here or lower
// in the library.
- return (null == $token || 'null' == $token) ? null : $token;
+ return (null == $token || 'null' == $token || '[]' == $token) ? null : $token;
}
/**
diff --git a/tests/general/ApiClientTest.php b/tests/general/ApiClientTest.php
index <HASH>..<HASH> 100644
--- a/tests/general/ApiClientTest.php
+++ b/tests/general/ApiClientTest.php
@@ -48,6 +48,12 @@ class ApiClientTest extends BaseTest {
$this->assertEquals("", $scopes);
}
+ public function testNoAuthIsNull() {
+ $client = new Google_Client();
+
+ $this->assertNull($client->getAccessToken());
+ }
+
public function testPrepareService() {
$client = new Google_Client();
$client->setScopes(array("scope1", "scope2")); | Ensure that empty array is stripped in getAccessToken
This maintains the previous behaviour where an uninitialised access token
would return null. | googleapis_google-api-php-client | train | php,php |
1701579e0827317d8888c2254a17b5786b6b5246 | diff --git a/distutils/version.py b/distutils/version.py
index <HASH>..<HASH> 100644
--- a/distutils/version.py
+++ b/distutils/version.py
@@ -27,6 +27,8 @@ Every version number class implements the following interface:
"""
import re
+import warnings
+
class Version:
"""Abstract base class for version numbering classes. Just provides
@@ -36,6 +38,12 @@ class Version:
"""
def __init__ (self, vstring=None):
+ warnings.warn(
+ "distutils Version classes are deprecated. "
+ "Use packaging.version instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
if vstring:
self.parse(vstring) | Mark Version classes as deprecated. | pypa_setuptools | train | py |
e229566287a9325ba951b379b858518f8998f976 | diff --git a/html5lib/constants.py b/html5lib/constants.py
index <HASH>..<HASH> 100644
--- a/html5lib/constants.py
+++ b/html5lib/constants.py
@@ -308,7 +308,15 @@ scopingElements = frozenset((
(namespaces["html"], "table"),
(namespaces["html"], "td"),
(namespaces["html"], "th"),
- (namespaces["svg"], "foreignObject")
+ (namespaces["mathml"], "mi"),
+ (namespaces["mathml"], "mo"),
+ (namespaces["mathml"], "mn"),
+ (namespaces["mathml"], "ms"),
+ (namespaces["mathml"], "mtext"),
+ (namespaces["mathml"], "annotation-xml"),
+ (namespaces["svg"], "foreignObject"),
+ (namespaces["svg"], "desc"),
+ (namespaces["svg"], "title"),
))
formattingElements = frozenset(( | Add mathml and svg elements to scoping elements | html5lib_html5lib-python | train | py |
acf543b31df4aca3834276bce2c5f935addfa400 | diff --git a/src/Procedure/FindOrCreate.php b/src/Procedure/FindOrCreate.php
index <HASH>..<HASH> 100644
--- a/src/Procedure/FindOrCreate.php
+++ b/src/Procedure/FindOrCreate.php
@@ -66,8 +66,9 @@ class FindOrCreate extends Procedure
$key[$format[$field]['name']] = $result['tuple'][$field];
}
return [
- 'key' => $key,
'created' => !!$result['created'],
+ 'key' => $key,
+ 'tuple' => $result['tuple'],
];
}
diff --git a/src/Repository.php b/src/Repository.php
index <HASH>..<HASH> 100644
--- a/src/Repository.php
+++ b/src/Repository.php
@@ -119,7 +119,7 @@ class Repository
// it was set using find one method
$this->flushCache();
- $instance = $this->findOrFail($result['key']);
+ $instance = $this->getInstance($result['tuple']);
if ($result['created']) {
if (method_exists($instance, 'beforeCreate')) {
$instance->beforeCreate(); | find or create tuple pass | tarantool-php_mapper | train | php,php |
1ae578e9d6bf68d0d59a99f9f1ea4d6727783192 | diff --git a/lib/connectors/client.js b/lib/connectors/client.js
index <HASH>..<HASH> 100644
--- a/lib/connectors/client.js
+++ b/lib/connectors/client.js
@@ -10,9 +10,6 @@ function ClientConnector(phantom, appUrl) {
var errorFired = false;
var pageOpenedCallbackFired = false;
- phantom._phantom.stdout.pipe(process.stdout);
- phantom._phantom.stderr.pipe(process.stdout);
-
//load the phantom page
var pageOpened = false;
var page; | remove unwanted stdouts | arunoda_laika | train | js |
c60f61d36a25e32bedcfb7bf053e3e71ed3c2332 | diff --git a/src/LarametricsModelServiceProvider.php b/src/LarametricsModelServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/LarametricsModelServiceProvider.php
+++ b/src/LarametricsModelServiceProvider.php
@@ -62,7 +62,7 @@ class LarametricsModelServiceProvider extends ServiceProvider {
'model_id' => $event->getAttributes()['id'],
'method' => $method,
'original' => $method === 'created' ? json_encode($event->getAttributes()) : json_encode($event->getOriginal()),
- 'changes' => $method === 'updated' ? json_encode($event->getChanges()) : '{}'
+ 'changes' => $method === 'updated' ? json_encode($event->getDirty()) : '{}'
]);
$notifications = LarametricsNotification::where('action', 'model_' . $method)
@@ -82,4 +82,4 @@ class LarametricsModelServiceProvider extends ServiceProvider {
});
}
-}
\ No newline at end of file
+} | Using getDirty() instead of getChanges()
This will allow support for older Laravel versions and still produce the same exact results. | aschmelyun_larametrics | train | php |
8d2fc2757fb2a024adcd97f3f35526ecaeedac71 | diff --git a/tests/testmock.py b/tests/testmock.py
index <HASH>..<HASH> 100644
--- a/tests/testmock.py
+++ b/tests/testmock.py
@@ -770,6 +770,23 @@ class MockTest(unittest2.TestCase):
+ def test_subclassing(self):
+ class Subclass(Mock):
+ pass
+
+ mock = Subclass()
+ self.assertIsInstance(mock.foo, Subclass)
+ self.assertIsInstance(mock(), Subclass)
+
+ class Subclass(Mock):
+ def _get_child_mock(self, **kwargs):
+ return Mock(**kwargs)
+
+ mock = Subclass()
+ self.assertNotIsInstance(mock.foo, Subclass)
+ self.assertNotIsInstance(mock(), Subclass)
+
+
"""
* repr should use new name (so new name should default to name if not None)
* reset_mock should clear mock_calls (including children) | Test for overriding _get_child_mock in subclasses | testing-cabal_mock | train | py |
b053d815d878c3e6eafa2c7e156090dce26e91a0 | diff --git a/wrappers/pyrichdem/setup.py b/wrappers/pyrichdem/setup.py
index <HASH>..<HASH> 100644
--- a/wrappers/pyrichdem/setup.py
+++ b/wrappers/pyrichdem/setup.py
@@ -11,7 +11,7 @@ ext_modules = [
glob.glob('src/*.cpp'),
include_dirs = ['lib/'],
language = 'c++',
- extra_compile_args = ['-std=c++11','-O3','-fvisibility=hidden'],
+ extra_compile_args = ['-std=c++11','-O3','-fvisibility=hidden', '-flto'],
define_macros = [
('DOCTEST_CONFIG_DISABLE', None ),
('RICHDEM_COMPILE_TIME', RICHDEM_COMPILE_TIME) | Compiled with -flto | r-barnes_richdem | train | py |
2ebc913c9bf9d44cb075f5be73264bf7f25a9a54 | diff --git a/src/Stagehand/TestRunner/Process/TestRunner.php b/src/Stagehand/TestRunner/Process/TestRunner.php
index <HASH>..<HASH> 100644
--- a/src/Stagehand/TestRunner/Process/TestRunner.php
+++ b/src/Stagehand/TestRunner/Process/TestRunner.php
@@ -57,12 +57,6 @@ use Stagehand\TestRunner\Util\OutputBuffering;
class TestRunner implements TestRunnerInterface
{
/**
- * @var boolean $result
- * @since Property available since Release 2.18.0
- */
- protected $result;
-
- /**
* @var \Stagehand\TestRunner\Util\OutputBuffering
* @since Property available since Release 3.0.0
*/
@@ -103,7 +97,7 @@ class TestRunner implements TestRunnerInterface
public function run()
{
$this->outputBuffering->clearOutputHandlers();
- $this->result = $this->runner->run($this->collector->collect());
+ $this->runner->run($this->collector->collect());
if ($this->runner->shouldNotify()) {
$notification = $this->runner->getNotification();
if (is_null($notification)) { | [Process] removed TestRunner::$result | piece_stagehand-testrunner | train | php |
0849c179a1e55145f3f42ecdf68c173e3b12ecab | diff --git a/lib/guard/jasmine/runner.rb b/lib/guard/jasmine/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/guard/jasmine/runner.rb
+++ b/lib/guard/jasmine/runner.rb
@@ -232,7 +232,7 @@ module Guard
# @param [Number] level the indention level
#
def report_specdoc_suite(suite, passed, options, level = 0)
- Formatter.suite_name((' ' * level) + suite['description']) if contains_failed_spec?(suite)
+ Formatter.suite_name((' ' * level) + suite['description']) if passed || options[:focus] && contains_failed_spec?(suite)
suite['specs'].each do |spec|
if spec['passed'] | Show success suite name when passed of focus. | guard_guard-jasmine | train | rb |
a37294dabeaea37df65a3178aed723a13cbb2cc9 | diff --git a/test/DoCommandTest.py b/test/DoCommandTest.py
index <HASH>..<HASH> 100644
--- a/test/DoCommandTest.py
+++ b/test/DoCommandTest.py
@@ -85,6 +85,7 @@ class DoCommandTest(CommandTest.CommandTest):
prompt_shown = False
def prompt(p_prompt):
+ global prompt_shown
prompt_shown = True
command = DoCommand.DoCommand(["-f", "1"], self.todolist, self.out, self.error, prompt)
@@ -98,6 +99,7 @@ class DoCommandTest(CommandTest.CommandTest):
prompt_shown = False
def prompt(p_prompt):
+ global prompt_shown
prompt_shown = True
command = DoCommand.DoCommand(["--force", "1"], self.todolist, self.out, self.error, prompt) | Assign to the variable in the outer scope. | bram85_topydo | train | py |
17776dc4a471470a7df76a77ab3a01e6d4d68ec4 | diff --git a/examples/plot_functional_brain_networks.py b/examples/plot_functional_brain_networks.py
index <HASH>..<HASH> 100644
--- a/examples/plot_functional_brain_networks.py
+++ b/examples/plot_functional_brain_networks.py
@@ -21,6 +21,7 @@ from nilearn import datasets, plotting, input_data
import sys
sys.path.append('..')
+sys.path.append('../inverse_covariance')
from inverse_covariance import (
QuicGraphLasso,
QuicGraphLassoCV, | Added parent directory of pyquic | skggm_skggm | train | py |
4df8fcc252a499c75a7fbb42084c561cb5ab7ee9 | diff --git a/src/SegmentServiceProvider.php b/src/SegmentServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/SegmentServiceProvider.php
+++ b/src/SegmentServiceProvider.php
@@ -3,6 +3,7 @@
namespace CachetHQ\Segment;
use Illuminate\Support\ServiceProvider;
+use Segment;
class SegmentServiceProvider extends ServiceProvider
{
@@ -13,7 +14,13 @@ class SegmentServiceProvider extends ServiceProvider
*/
public function boot()
{
- //
+ $this->package('cachethq/segment');
+
+ /**
+ * Load the Segment.io configuration.
+ */
+ $writeKey = $this->app->config->get('segment::config.write_key');
+ Segment::init($writeKey);
}
/**
@@ -25,4 +32,14 @@ class SegmentServiceProvider extends ServiceProvider
{
//
}
+
+ /**
+ * Get the services provided by the provider.
+ *
+ * @return array
+ */
+ public function provides()
+ {
+ return array();
+ }
} | Call Segment::init from the service provider | GrahamDeprecated_Laravel-Segment | train | php |
85e979994b017d6bcdb250b0336f10f0d70fd531 | diff --git a/chainlet_unittests/test_chainlet/test_funclink.py b/chainlet_unittests/test_chainlet/test_funclink.py
index <HASH>..<HASH> 100644
--- a/chainlet_unittests/test_chainlet/test_funclink.py
+++ b/chainlet_unittests/test_chainlet/test_funclink.py
@@ -81,11 +81,13 @@ class TestFunctionLink(unittest.TestCase):
# slave is preserved
self.assertEqual(native.slave(), copy.copy(native).slave())
self.assertEqual(native.slave(), copy.deepcopy(native).slave())
- self.assertEqual(native.slave(), pickle.loads(pickle.dumps(native)).slave())
# chainlet is preserved
self._subtest_cloned_result(native, copy.copy(native))
self._subtest_cloned_result(native, copy.deepcopy(native))
- self._subtest_cloned_result(native, pickle.loads(pickle.dumps(native)))
+ for proto in range(pickle.HIGHEST_PROTOCOL):
+ with self.subTest(case, pickle_protocol=proto):
+ self.assertEqual(native.slave(), pickle.loads(pickle.dumps(native, proto)).slave())
+ self._subtest_cloned_result(native, pickle.loads(pickle.dumps(native, proto)))
def _subtest_cloned_result(self, original, clone):
self.assertIsNot(original, clone) | added FunctionLink pickle test for different protocols | maxfischer2781_chainlet | train | py |
7d5cc4c28bfcadaaf351ccf6f46410a6991cb98f | diff --git a/src/Lemonblast/Cbor4Php/Tests/CborTest.php b/src/Lemonblast/Cbor4Php/Tests/CborTest.php
index <HASH>..<HASH> 100644
--- a/src/Lemonblast/Cbor4Php/Tests/CborTest.php
+++ b/src/Lemonblast/Cbor4Php/Tests/CborTest.php
@@ -1,10 +1,6 @@
<?php namespace Lemonblast\Cbor4Php\Test;
use Lemonblast\Cbor4Php\Cbor;
-use Lemonblast\Cbor4Php\Enums\AdditionalType;
-use Lemonblast\Cbor4Php\Enums\MajorType;
-use Lemonblast\Cbor4Php\Enums\PackFormat;
-use Lemonblast\Cbor4Php\Enums\Max;
const CBOR_EXCEPTION = 'Lemonblast\Cbor4Php\CborException';
@@ -350,7 +346,7 @@ class CborTest extends \PHPUnit_Framework_TestCase
// Test if only tags are passed and no real value after
$this->setExpectedException(CBOR_EXCEPTION);
- $decoded = Cbor::decode(pack('C*', 0b11000011));
+ Cbor::decode(pack('C*', 0b11000011));
}
function testDecodeWithExtraByte() | Removed unused imports/variables in tests | Lemonblast_Cbor4Php | train | php |
49360739b19f2fd6eca9da33f87549756340ce9a | diff --git a/tests/POTests/QueryBuilder/SelectTest.php b/tests/POTests/QueryBuilder/SelectTest.php
index <HASH>..<HASH> 100644
--- a/tests/POTests/QueryBuilder/SelectTest.php
+++ b/tests/POTests/QueryBuilder/SelectTest.php
@@ -63,7 +63,7 @@ class SelectTest extends PHPUnit_Framework_TestCase
/**
* @test
*/
- public function itInitializesWithTheCorrectJoinsStatement()
+ public function itInitializesWithTheCorrectJoinsClause()
{
$this->assertInstanceOf('PO\QueryBuilder\JoinClause', $this->o->getJoins());
}
diff --git a/tests/POTests/QueryBuilder/UpdateTest.php b/tests/POTests/QueryBuilder/UpdateTest.php
index <HASH>..<HASH> 100644
--- a/tests/POTests/QueryBuilder/UpdateTest.php
+++ b/tests/POTests/QueryBuilder/UpdateTest.php
@@ -63,7 +63,7 @@ class UpdateTest extends PHPUnit_Framework_TestCase
/**
* @test
*/
- public function itInitializesWithTheCorrectJoinsStatement()
+ public function itInitializesWithTheCorrectJoinsClause()
{
$this->assertInstanceOf('PO\QueryBuilder\JoinClause', $this->o->getJoins());
} | Removed forgotten 'Statement' | mjacobus_php-query-builder | train | php,php |
73cc2992a701398c2e06ed138974569c8a1a4c64 | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1107,6 +1107,7 @@ window.CodeMirror = (function() {
}
removeChildrenAndAdd(display.measure, measureText);
var height = measureText.offsetHeight / 50;
+ display.measure.removeChild(measureText);
if (height > 3) display.cachedTextHeight = height;
removeChildren(display.measure);
return height || 1; | Fix IE problem with clearing parentNode relationships on innerHTML = "" | codemirror_CodeMirror | train | js |
0b6477a7cef311e1a98a475bdd6281499f03641f | diff --git a/tests/test_cli_config.py b/tests/test_cli_config.py
index <HASH>..<HASH> 100644
--- a/tests/test_cli_config.py
+++ b/tests/test_cli_config.py
@@ -143,3 +143,18 @@ jupyter:
```
""",
)
+
+
+def test_cli_config_on_windows_issue_629(tmpdir):
+ cfg_file = tmpdir.join("jupytext.yml")
+ cfg_file.write(
+ """default_jupytext_formats: "notebooks///ipynb,scripts///py:percent"
+default_notebook_metadata_filter: "jupytext"
+"""
+ )
+
+ tmpdir.mkdir("scripts").join("test.py").write("# %%\n 1+1\n")
+
+ jupytext(["--sync", str(tmpdir.join("scripts").join("*.py"))])
+
+ assert tmpdir.join("notebooks").join("test.ipynb").exists() | Reproduce #<I> with a test | mwouts_jupytext | train | py |
93463a049794303a007ef51c6437e6acd6272fd4 | diff --git a/src/EoC/Adapter/AbstractAdapter.php b/src/EoC/Adapter/AbstractAdapter.php
index <HASH>..<HASH> 100644
--- a/src/EoC/Adapter/AbstractAdapter.php
+++ b/src/EoC/Adapter/AbstractAdapter.php
@@ -92,7 +92,7 @@ abstract class AbstractAdapter implements IClientAdapter {
* response.
* @param[in] Request $request The Request object.
* @param[in] IChunkHook $chunkHook (optional) A class instance that implements the IChunkHook interface.
- * @retval Response
+ * @retval EoC::Message::Response
*/
abstract public function send(Request $request, Hook\IChunkHook $chunkHook = NULL); | return EoC::Message::Response | dedalozzo_eoc-client | train | php |
f3b63538af818c3129cda2df6a1ccb286804d39d | diff --git a/activestorage/app/models/active_storage/blob.rb b/activestorage/app/models/active_storage/blob.rb
index <HASH>..<HASH> 100644
--- a/activestorage/app/models/active_storage/blob.rb
+++ b/activestorage/app/models/active_storage/blob.rb
@@ -250,7 +250,7 @@ class ActiveStorage::Blob < ActiveRecord::Base
service.delete_prefixed("variants/#{key}/") if image?
end
- # Deletes the file on the service and then destroys the blob record. This is the recommended way to dispose of unwanted
+ # Destroys the blob record and then deletes the file on the service. This is the recommended way to dispose of unwanted
# blobs. Note, though, that deleting the file off the service will initiate an HTTP connection to the service, which may
# be slow or prevented, so you should not use this method inside a transaction or in callbacks. Use #purge_later instead.
def purge | Fix actions order in the comment
The order of performed actions changed in <I>ecaa<I>b but the comment
stayed the same. | rails_rails | train | rb |
6371888b69a32a4fc1aa12f662356d51231faa5d | diff --git a/quickutils/src/quickutils/core/util/math/math.java b/quickutils/src/quickutils/core/util/math/math.java
index <HASH>..<HASH> 100644
--- a/quickutils/src/quickutils/core/util/math/math.java
+++ b/quickutils/src/quickutils/core/util/math/math.java
@@ -1,7 +1,9 @@
package quickutils.core.util.math;
import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
import java.util.List;
+import java.util.Locale;
import java.util.Random;
import quickutils.core.QuickUtils;
@@ -36,7 +38,7 @@ public class math {
formater += "#";
}
- DecimalFormat twoDForm = new DecimalFormat("#." + formater);
+ DecimalFormat twoDForm = new DecimalFormat("#." + formater, new DecimalFormatSymbols(Locale.US));
return Double.valueOf(twoDForm.format(toBeRounded));
} | Added locale to the Double formating in Round method | cesarferreira_AndroidQuickUtils | train | java |
c0ff18d0d08f073bc5d0c8ba7dd94e64bc34e5ed | diff --git a/test/lib/register.js b/test/lib/register.js
index <HASH>..<HASH> 100644
--- a/test/lib/register.js
+++ b/test/lib/register.js
@@ -17,6 +17,8 @@ describe('Register', function() {
socket: socket,
client: xmpp,
trackId: function(id, callback) {
+ if (typeof id !== 'object')
+ throw new Error('Stanza protection ID not added')
this.callback = callback
},
makeCallback: function(error, data) { | Insist that a stanza is provided to trackId | xmpp-ftw_xmpp-ftw-register | train | js |
2b35b3206eb7a19f27a2f3db1670dab2496af855 | diff --git a/src/Sulu/Bundle/CoreBundle/Build/NodeOrderBuilder.php b/src/Sulu/Bundle/CoreBundle/Build/NodeOrderBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/CoreBundle/Build/NodeOrderBuilder.php
+++ b/src/Sulu/Bundle/CoreBundle/Build/NodeOrderBuilder.php
@@ -56,7 +56,7 @@ class NodeOrderBuilder implements BuilderInterface
*/
public function getName()
{
- return 'node-order';
+ return 'node_order';
}
/** | changed name of the node_order builder because of yml restrictions | sulu_sulu | train | php |
3b76457a05dd6998e03d72ba7d0700baf86c20ea | diff --git a/calculus.py b/calculus.py
index <HASH>..<HASH> 100644
--- a/calculus.py
+++ b/calculus.py
@@ -379,10 +379,10 @@ def spline_evaluation(f, t, t_out=None, axis=None, spline_degree=3,
except ValueError:
axis = None
if axis is None or f.shape[axis] != n:
- raise ValueError(
- "Input function values `f` [shape {0}] should have at least one axis with ".format(f.shape)
- + "the same length as input `t` [{1}].".format(n)
- )
+ raise ValueError((
+ "Input function values `f` [shape {0}] should have at least one "
+ "axis with the same length as input `t` [{1}], or bad axis input."
+ ).format(f.shape, n))
shape = list(f.shape)
if definite_integral_bounds is not None:
shape[axis] = 1 # We'll keep this axis for now (set to length 1) for uniform treatment, and remove it before returning | String format bug in ValueError in spline_evaluation, more info. (#<I>) | moble_quaternion | train | py |
5f0b7796cbd8a749c21ba43f331a8c291a2ad288 | diff --git a/raiden/app.py b/raiden/app.py
index <HASH>..<HASH> 100644
--- a/raiden/app.py
+++ b/raiden/app.py
@@ -95,7 +95,7 @@ class App: # pylint: disable=too-few-public-methods
log.warning(
'Older versions of the database exist in '
f'{db_base_path}. Since a newer breaking version is introduced, '
- 'it is advised that you leave all token networks before upgrading and ',
+ 'it is advised that you leave all token networks before upgrading and '
'then proceed with the upgrade.',
) | Fix crash on raiden startup
[no ci integration] | raiden-network_raiden | train | py |
594263474c8f4279c1b0cefa6b51a3c0ebb71448 | diff --git a/spec/rollbar/plugins/delayed_job_spec.rb b/spec/rollbar/plugins/delayed_job_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rollbar/plugins/delayed_job_spec.rb
+++ b/spec/rollbar/plugins/delayed_job_spec.rb
@@ -32,6 +32,19 @@ describe Rollbar::Delayed, :reconfigure_notifier => true do
FailingJob.new.delay.do_job_please!(:foo, :bar)
end
+
+ it 'adds the job data' do
+ payload = nil
+
+ ::Rollbar::Item.any_instance.stub(:dump) do |item|
+ payload = item.payload
+ nil
+ end
+
+ FailingJob.new.delay.do_job_please!(:foo, :bar)
+
+ expect(payload['data'][:request]["handler"]).to include({:args=>[:foo, :bar], :method_name=>:do_job_please!})
+ end
end
context 'with failed deserialization' do | test: verify job data is added correctly | rollbar_rollbar-gem | train | rb |
b7ed1b982358bc85b7d1e5790edcacbf97fb01fe | diff --git a/lib/dm-core/adapters/data_objects_adapter.rb b/lib/dm-core/adapters/data_objects_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-core/adapters/data_objects_adapter.rb
+++ b/lib/dm-core/adapters/data_objects_adapter.rb
@@ -545,7 +545,16 @@ module DataMapper
true
end
- # TODO: move to dm-more/dm-transactions
+ ##
+ # Produces a fresh transaction primitive for this Adapter
+ #
+ # Used by DataMapper::Transaction to perform its various tasks.
+ #
+ # @return [Object]
+ # a new Object that responds to :close, :begin, :commit,
+ # :rollback, :rollback_prepared and :prepare
+ #
+ # TODO: move to dm-more/dm-transaction (if possible)
def transaction_primitive
DataObjects::Transaction.create_for_uri(@uri)
end
@@ -755,20 +764,6 @@ module DataMapper
!current_transaction.nil?
end
- ##
- # Produces a fresh transaction primitive for this Adapter
- #
- # Used by DataMapper::Transaction to perform its various tasks.
- #
- # @return [Object]
- # a new Object that responds to :close, :begin, :commit,
- # :rollback, :rollback_prepared and :prepare
- #
- # TODO: move to dm-more/dm-transaction (if possible)
- def transaction_primitive
- raise NotImplementedError
- end
-
private
def transactions(thread) | Removed stub transaction_primitive from DO Adapter | datamapper_dm-core | train | rb |
dbb00bd3616bb23e3219cc43fab6c9063d8aec5c | diff --git a/discord/message.py b/discord/message.py
index <HASH>..<HASH> 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -974,7 +974,7 @@ class PartialMessage(Hashable):
# pinned exists on PartialMessage for duck typing purposes
self.pinned = False
- async def add_reaction(self, emoji: EmojiInputType, /) -> None:
+ async def add_reaction(self, emoji: Union[EmojiInputType, Reaction], /) -> None:
"""|coro|
Adds a reaction to the message. | Add Reaction into typehint of add_reaction() | Rapptz_discord.py | train | py |
5a9a27a334aa7f6a69744619ce4a42a2d09e574a | diff --git a/docker/reference/reference.go b/docker/reference/reference.go
index <HASH>..<HASH> 100644
--- a/docker/reference/reference.go
+++ b/docker/reference/reference.go
@@ -32,7 +32,7 @@ func XParseNamed(s string) (distreference.Named, error) {
if err != nil {
return nil, errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", s)
}
- r, err := distreference.ParseNormalizedNamed(named.Name())
+ r, err := distreference.WithName(named.Name())
if err != nil {
return nil, err
} | Do not normalize the input string twice in reference.XParseNamed
We have _just_ normalized it, no need to do it again.
(distreference.WithName does no checking; we could also call
distreference.ParseNamed which does, but that does the checking by
calling ParseNormalizedNamed anyway, again. We will eliminate this soon
anyway…) | containers_image | train | go |
517d805be9fb6e598baf5dffc665b199d78c7e8f | diff --git a/test/integration-spec.js b/test/integration-spec.js
index <HASH>..<HASH> 100644
--- a/test/integration-spec.js
+++ b/test/integration-spec.js
@@ -28,6 +28,7 @@ describe('selenium-webdriver', function() {
args: webdriver.args
});
server.start().then(function(url) {
+console.log('selenium server started.');
var driver = new seleniumWebdriver.Builder()
.usingServer(url)
.withCapabilities(seleniumWebdriver.Capabilities.phantomjs())
diff --git a/test/unit-spec.js b/test/unit-spec.js
index <HASH>..<HASH> 100644
--- a/test/unit-spec.js
+++ b/test/unit-spec.js
@@ -9,6 +9,7 @@ describe('webdriver', function() {
describe('phantomjs property', function() {
it('provides information where to find "phantomjs"', function() {
+console.log('not reached by travis');
expect(webdriverModule.getWebdriverEnv().phantomjs).toEqual({
version: phantomjs.version,
path: phantomjs.path, | Add some console.logs for travis | uxebu_webdrvr | train | js,js |
25ad03e393ac3571cf10e61d084152b59f1c8b1c | diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py
index <HASH>..<HASH> 100644
--- a/dbusmock/mockobject.py
+++ b/dbusmock/mockobject.py
@@ -313,7 +313,7 @@ class DBusMockObject(dbus.service.Object):
paths to DBusMockObject instances.
For keeping state across method calls, you are free to use normal
- Python members of the "self" object, which will be persistant for
+ Python members of the "self" object, which will be persistent for
the whole mock's life time. E. g. you can have a method with
"self.my_state = True", and another method that returns it with
"ret = self.my_state". | Correct spelling mistake (#<I>) | martinpitt_python-dbusmock | train | py |
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.