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
|
---|---|---|---|---|---|
2d104582c0676390fca94172efaa58ff3b819eb1 | diff --git a/src/Console/Commands/CrudGeneratorCommand.php b/src/Console/Commands/CrudGeneratorCommand.php
index <HASH>..<HASH> 100644
--- a/src/Console/Commands/CrudGeneratorCommand.php
+++ b/src/Console/Commands/CrudGeneratorCommand.php
@@ -56,7 +56,7 @@ class CrudGeneratorCommand extends Command
$this->info("List of tables: ".print_r($tables, true));
foreach ($tables as $t) {
- if(str_contains($t, $prefix))
+ if($prefix == '' || str_contains($t, $prefix))
$tablenames[] = strtolower(substr($t, strlen($prefix)));
//else
//$tablenames[] = strtolower($t); | Fix preventing creating crud for all tables with no prefix | kEpEx_laravel-crud-generator | train | php |
47d7a0ad60d38eac38e80503919cf69f5dce7262 | diff --git a/lib/dill/matchers.rb b/lib/dill/matchers.rb
index <HASH>..<HASH> 100644
--- a/lib/dill/matchers.rb
+++ b/lib/dill/matchers.rb
@@ -1,7 +1,11 @@
require 'rspec/matchers'
RSpec::Matchers.define :see do |widget_name, *args|
- match do |role|
- role.see?(widget_name, *args)
+ match do |role|
+ begin
+ eventually { role.see?(widget_name, *args) }
+ rescue Dill::Checkpoint::ConditionNotMet
+ false
+ end
end
end | [matchers] Let #see wait. | mojotech_capybara-ui | train | rb |
5366505630f2dd611b409f373ff82e00d5ce0617 | diff --git a/lib/conf/cli.js b/lib/conf/cli.js
index <HASH>..<HASH> 100755
--- a/lib/conf/cli.js
+++ b/lib/conf/cli.js
@@ -191,8 +191,10 @@ var show_gui_and_exit = function () {
else if (os_name == 'linux')
gui_path = gui_path + '.py';
else {
- args = [gui_path.replace('prey-config', 'PreyConfig.app/Contents/MacOS/prey-config.rb')]
- gui_path = '/usr/bin/ruby';
+ // args = [gui_path.replace('prey-config', 'PreyConfig.app/Contents/MacOS/prey-config.rb')]
+ // gui_path = '/usr/bin/ruby';
+ args = [gui_path.replace('prey-config', 'PreyConfig.app')];
+ gui_path = '/usr/bin/open';
}
helpers.run_detached(gui_path, args); | Use OSX's open command to fire up PreyConfig. | prey_prey-node-client | train | js |
cb1997081a873e59cf4f2e55d19246cb244a2a60 | diff --git a/oauthlib/oauth1/rfc5849/__init__.py b/oauthlib/oauth1/rfc5849/__init__.py
index <HASH>..<HASH> 100644
--- a/oauthlib/oauth1/rfc5849/__init__.py
+++ b/oauthlib/oauth1/rfc5849/__init__.py
@@ -270,7 +270,7 @@ class Server(object):
verifier=verifier)
client_signature = oauth_client.get_oauth_signature(uri,
- body=body, headers=headers)
+ http_method=http_method, body=body, headers=headers)
# FIXME: use near constant time string compare to avoid timing attacks
return client_signature == request_signature | Pass through the request method to the client when generating signature. | oauthlib_oauthlib | train | py |
ec5ee8668f162b6770ecdfbb3f0650e23938bc7e | diff --git a/src/nlu.js b/src/nlu.js
index <HASH>..<HASH> 100644
--- a/src/nlu.js
+++ b/src/nlu.js
@@ -133,7 +133,7 @@ class Nlu {
}
const qnaResult = await this.computeWithQna(sentence);
logger.debug('compute: qnaResult', qnaResult);
- return qnaResult.intents.length > 0 ? qnaResult : { intents: [], entities: [] };
+ return qnaResult.intents.length > 0 ? qnaResult : { intents: [], entities: classifierResult.entities };
}
return this.computeWithClassifier(sentence);
} | Fix empty entities when qna after | Botfuel_botfuel-dialog | train | js |
4c9f01f42e6051894569d1b80618433defda5760 | diff --git a/mmtf/api/mmtf_writer.py b/mmtf/api/mmtf_writer.py
index <HASH>..<HASH> 100644
--- a/mmtf/api/mmtf_writer.py
+++ b/mmtf/api/mmtf_writer.py
@@ -209,7 +209,7 @@ class MMTFEncoder(TemplateEncoder):
def encode_data(self):
"""Encode the data back into a dict."""
output_data = {}
- output_data[b"groupTypeList"] = encode_array(self.group_type_list, 2, 0)
+ output_data[b"groupTypeList"] = encode_array(self.group_type_list, 4, 0)
output_data[b"xCoordList"] = encode_array(self.x_coord_list, 10, 1000)
output_data[b"yCoordList"] = encode_array(self.y_coord_list, 10, 1000)
output_data[b"zCoordList"] = encode_array(self.z_coord_list, 10, 1000) | Fixed a bug in the writing of MMTF files | rcsb_mmtf-python | train | py |
7e2e7ea08d4e6750001e4d3a9c8a57a0b9b73063 | diff --git a/src/main/java/org/minimalj/security/Authorization.java b/src/main/java/org/minimalj/security/Authorization.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/minimalj/security/Authorization.java
+++ b/src/main/java/org/minimalj/security/Authorization.java
@@ -20,15 +20,9 @@ public abstract class Authorization {
private static ThreadLocal<Serializable> securityToken = new ThreadLocal<>();
private Map<UUID, Subject> userByToken = new HashMap<>();
- private static boolean active = true;
-
private static InheritableThreadLocal<Authorization> current = new InheritableThreadLocal<Authorization>() {
@Override
protected Authorization initialValue() {
- if (!active) {
- return null;
- }
-
String authorizationClassName = System.getProperty("MjAuthorization");
if (!StringUtils.isBlank(authorizationClassName)) {
try {
@@ -51,7 +45,6 @@ public abstract class Authorization {
return new JaasAuthorization(jaasConfiguration);
}
- active = false;
return null;
}
};
@@ -68,8 +61,7 @@ public abstract class Authorization {
}
public static boolean isActive() {
- getCurrent();
- return active;
+ return getCurrent() != null;
}
public static boolean isAllowed(Transaction<?> transaction) { | Authorization: active flag is not needed anymore | BrunoEberhard_minimal-j | train | java |
2d6761839c5ffa4f553efee272fa5e297c2dfa02 | diff --git a/websocketproxy.go b/websocketproxy.go
index <HASH>..<HASH> 100644
--- a/websocketproxy.go
+++ b/websocketproxy.go
@@ -56,15 +56,18 @@ func NewProxy(target *url.URL) *WebsocketProxy {
return &WebsocketProxy{Backend: backend}
}
-func (w *WebsocketProxy) CloseNotify() {
-}
-
// ServeHTTP implements the http.Handler that proxies WebSocket connections.
func (w *WebsocketProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
+ if w.Backend == nil {
+ log.Println("websocketproxy: backend function is not defined")
+ http.Error(rw, "internal server error (code: 1)", http.StatusInternalServerError)
+ return
+ }
+
backendURL := w.Backend(req)
if backendURL == nil {
log.Println("websocketproxy: backend URL is nil")
- http.Error(rw, "internal server error", http.StatusInternalServerError)
+ http.Error(rw, "internal server error (code: 2)", http.StatusInternalServerError)
return
} | websocketproxy: also test the nilness of backend function | koding_websocketproxy | train | go |
bc6500d19ac77f6f60885f747bc734e6fa4e2ddf | diff --git a/src/ChrisKonnertz/OpenGraph/OpenGraph.php b/src/ChrisKonnertz/OpenGraph/OpenGraph.php
index <HASH>..<HASH> 100644
--- a/src/ChrisKonnertz/OpenGraph/OpenGraph.php
+++ b/src/ChrisKonnertz/OpenGraph/OpenGraph.php
@@ -173,7 +173,7 @@ class OpenGraph
* @param bool $prefixed Add the "og"-prefix?
* @return OpenGraph
*/
- public function attributesstring (
+ public function attributes (
string $tagName,
array $attributes = [],
array $valid = [], | Fixed: attributesstring to attributes
I have changed function names due to this error,
<URL> | chriskonnertz_open-graph | train | php |
b6651c72c73920a9b91c3c7713c0f50029dac033 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -442,7 +442,7 @@ module.exports = function(grunt) {
grunt.registerTask('docs', ['http','generate-docs', 'yuidoc']);
grunt.registerTask('github-pages', ['copy:github-pages', 'clean:github-pages']);
grunt.registerTask('zip', ['compress', 'copy:F2-examples', 'clean:F2-examples']);
- grunt.registerTask('js', ['test', 'concat:dist', 'concat:no-third-party', 'uglify:dist', 'sourcemap', 'copy:f2ToRoot']);
+ grunt.registerTask('js', ['concat:dist', 'concat:no-third-party', 'uglify:dist', 'sourcemap', 'copy:f2ToRoot','test']);
grunt.registerTask('sourcemap', ['uglify:sourcemap', 'fix-sourcemap']);
grunt.registerTask('packages', [
'concat:no-jquery-or-bootstrap', | has this always been this way? test should be last | OpenF2_F2 | train | js |
a15b1f085ed33bfa467fddc86d70ee353832b870 | diff --git a/packages/rum/src/apm-base.js b/packages/rum/src/apm-base.js
index <HASH>..<HASH> 100644
--- a/packages/rum/src/apm-base.js
+++ b/packages/rum/src/apm-base.js
@@ -23,8 +23,11 @@
*
*/
-import { getInstrumentationFlags } from '@elastic/apm-rum-core'
-import { PAGE_LOAD, ERROR } from '@elastic/apm-rum-core'
+import {
+ getInstrumentationFlags,
+ PAGE_LOAD,
+ ERROR
+} from '@elastic/apm-rum-core'
class ApmBase {
constructor(serviceFactory, disable) { | chore(rum): merge duplicate import statementments in apm base (#<I>) | elastic_apm-agent-rum-js | train | js |
16f428e283733b1ffc284c8c3ebeb19c7bd15d0d | diff --git a/Connector/ZimbraConnector.php b/Connector/ZimbraConnector.php
index <HASH>..<HASH> 100644
--- a/Connector/ZimbraConnector.php
+++ b/Connector/ZimbraConnector.php
@@ -776,7 +776,7 @@ class ZimbraConnector
{
$this->delegateAuth($account);
- $response = $this->request('GetFolder', array(), array(
+ $response = $this->request('GetFolders', array(), array(
'folder' => array(
'@attributes' => array(
'l' => $folderId | GetTag and GetFolder should be GetTags and GetFolders | synaq_SynaqZasaBundle | train | php |
285deb5b8abcb38dbf00ef7850d594687f5afa4e | diff --git a/test/helpers/add-to-html-methods.js b/test/helpers/add-to-html-methods.js
index <HASH>..<HASH> 100644
--- a/test/helpers/add-to-html-methods.js
+++ b/test/helpers/add-to-html-methods.js
@@ -23,7 +23,7 @@ Node.prototype.toHTML = function (leftAncestorInputPosition = ZERO_POINT, leftAn
let changeEnd = !this.isChangeStart ? ' <<' : ''
let inputPosition = traverse(leftAncestorInputPosition, this.inputLeftExtent)
let outputPosition = traverse(leftAncestorOutputPosition, this.outputLeftExtent)
- s += '<td colspan="2">' + changeEnd + formatPoint(inputPosition) + ' / ' + formatPoint(outputPosition) + ' {' + JSON.stringify(this.changeText) + '} ' + changeStart + '</td>'
+ s += '<td colspan="2">' + ' {' + JSON.stringify(this.changeText) + '} ' + changeEnd + formatPoint(inputPosition) + ' / ' + formatPoint(outputPosition) + changeStart + '</td>'
s += '</tr>'
if (this.left || this.right) { | Print text first for more intuitive tree HTML | atom_superstring | train | js |
b8651672c156596c7081c1ed7c5fb7c96a0d73bf | diff --git a/allpairspy/allpairs.py b/allpairspy/allpairs.py
index <HASH>..<HASH> 100644
--- a/allpairspy/allpairs.py
+++ b/allpairspy/allpairs.py
@@ -126,7 +126,7 @@ class AllPairs(object):
while -1 < i < len(self.__working_item_array):
if direction == 1:
# move forward
- self.resort_working_array(chosen_values_arr[:i], i)
+ self.__resort_working_array(chosen_values_arr[:i], i)
indexes[i] = 0
elif direction == 0 or direction == -1:
# scan current array or go back
@@ -164,7 +164,7 @@ class AllPairs(object):
# replace returned array elements with real values and return it
return self.__get_values_array(chosen_values_arr)
- def resort_working_array(self, chosen_values_arr, num):
+ def __resort_working_array(self, chosen_values_arr, num):
for item in self.__working_item_array[num]:
data_node = self.__pairs.get_node_info(item) | Change a public method to a private method that not called from outside | thombashi_allpairspy | train | py |
8d1ab4dc890c7ff3567989a758677a6c02118a53 | diff --git a/lib/mactag/builder.rb b/lib/mactag/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/mactag/builder.rb
+++ b/lib/mactag/builder.rb
@@ -37,7 +37,7 @@ module Mactag
end
if @builder.gems?
- system "cd #{Rails.root} && #{Mactag::Config.binary} #{@builder.files.join(' ')}"
+ system "cd #{Rails.root} && #{Mactag::Config.binary} #{builder.files.join(' ')}"
puts "Successfully generated TAGS file"
else
@@ -55,5 +55,9 @@ module Mactag
def self.gem_home_exists?
File.directory?(Mactag::Config.gem_home)
end
+
+ def self.builder
+ @builder
+ end
end
end
diff --git a/spec/mactag/builder_spec.rb b/spec/mactag/builder_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mactag/builder_spec.rb
+++ b/spec/mactag/builder_spec.rb
@@ -105,4 +105,11 @@ describe Mactag::Builder do
Mactag::Builder.gem_home_exists?.should be_false
end
end
+
+ describe '#builder' do
+ it 'should return builder instance' do
+ Mactag::Builder.generate {}
+ Mactag::Builder.builder.should == Mactag::Builder.instance_variable_get('@builder')
+ end
+ end
end | Added method that return builder. | rejeep_mactag | train | rb,rb |
ecb455823bc05c973d59bcfb4a77fa1673327a3f | diff --git a/demo/app.js b/demo/app.js
index <HASH>..<HASH> 100644
--- a/demo/app.js
+++ b/demo/app.js
@@ -11,7 +11,6 @@
};
$scope.froalaAction = function(action){
- console.log('froalaAction', action);
$scope.options.froala(action);
};
diff --git a/src/angular-froala.js b/src/angular-froala.js
index <HASH>..<HASH> 100644
--- a/src/angular-froala.js
+++ b/src/angular-froala.js
@@ -13,6 +13,10 @@ angular.module('froala', []).
froala : '='
},
link: function(scope, element, attrs, ngModel) {
+ if(!(element instanceof jQuery)){
+ throw "Froala requires jQuery, are you loading it before Angular?";
+ }
+
var defaultOptions = {};
var contentChangedCallback;
var options = angular.extend(defaultOptions, froalaConfig, scope.froala); | check that jQuery is loaded before initializing froala | froala_angular-froala | train | js,js |
f355ee4b708008ca0aa171e45662c0cab8dbc118 | diff --git a/hearthstone/cardxml.py b/hearthstone/cardxml.py
index <HASH>..<HASH> 100644
--- a/hearthstone/cardxml.py
+++ b/hearthstone/cardxml.py
@@ -198,10 +198,18 @@ class CardXML(object):
return bool(self.tags.get(GameTag.Collectible, False))
@property
+ def battlecry(self):
+ return bool(self.tags.get(GameTag.BATTLECRY, False))
+
+ @property
def deathrattle(self):
return bool(self.tags.get(GameTag.DEATHRATTLE, False))
@property
+ def divine_shield(self):
+ return bool(self.tags.get(GameTag.DIVINE_SHIELD, False))
+
+ @property
def double_spelldamage_bonus(self):
return bool(self.tags.get(GameTag.RECEIVES_DOUBLE_SPELLDAMAGE_BONUS, False))
@@ -238,6 +246,10 @@ class CardXML(object):
return bool(self.tags.get(GameTag.SECRET, False))
@property
+ def taunt(self):
+ return bool(self.tags.get(GameTag.TAUNT, False))
+
+ @property
def spare_part(self):
return bool(self.tags.get(GameTag.SPARE_PART, False)) | cardxml: Implement battlecry, divine_shield and taunt properties | HearthSim_python-hearthstone | train | py |
39a7d178f1b5008c0a0766c16e0b77b895b85c61 | diff --git a/lib/mauth/client.rb b/lib/mauth/client.rb
index <HASH>..<HASH> 100644
--- a/lib/mauth/client.rb
+++ b/lib/mauth/client.rb
@@ -144,8 +144,6 @@ module MAuth
class ConfigurationError < StandardError; end
MWS_TOKEN = 'MWS'.freeze
- MWSV2_TOKEN = 'MWSV2'.freeze
- AUTH_HEADER_DELIMITER = ';'.freeze
# new client with the given App UUID and public key. config may include the following (all
# config keys may be strings or symbols): | move constants into v2 file | mdsol_mauth-client-ruby | train | rb |
d71251edfe98a25d33e835c1aa339042ac5b823d | diff --git a/manifest_test.go b/manifest_test.go
index <HASH>..<HASH> 100644
--- a/manifest_test.go
+++ b/manifest_test.go
@@ -315,7 +315,7 @@ func expectedResourceList(root string, resources []dresource) ([]Resource, error
absPath = "/" + absPath
}
uidStr := strconv.Itoa(r.uid)
- gidStr := strconv.Itoa(r.uid)
+ gidStr := strconv.Itoa(r.gid)
switch r.kind {
case rfile:
f := ®ularFile{ | Fix test fixture gid
If uid == gid tests will pass, but fail if that is not the case. | containerd_continuity | train | go |
297b95e5924d103c405b2ddc524ceb77acbbc432 | diff --git a/app/initializers/setup-sanitizers.js b/app/initializers/setup-sanitizers.js
index <HASH>..<HASH> 100644
--- a/app/initializers/setup-sanitizers.js
+++ b/app/initializers/setup-sanitizers.js
@@ -4,6 +4,11 @@ export default {
name: 'ember-sanitize-setup-sanitizers',
initialize: function(container) {
- container.registerOptionsForType('sanitizer', { instantiate: false });
+ if (container.registerOptionsForType) {
+ container.registerOptionsForType('sanitizer', { instantiate: false });
+ } else {
+ // Ember < 2
+ container.optionsForType('sanitizer', { instantiate: false });
+ }
}
}; | use correct container method for <I> | minutebase_ember-sanitize | train | js |
364378d84a8eb9f1f4c41bea010ab093475f86ed | diff --git a/public/js/front/formhelper.js b/public/js/front/formhelper.js
index <HASH>..<HASH> 100755
--- a/public/js/front/formhelper.js
+++ b/public/js/front/formhelper.js
@@ -243,18 +243,9 @@ Garp.apply(Garp.FormHelper, {
changeYear: true
};
// Look for data-attributes to customize config
- /*
- var attrs = this.attributes;
- console.dir(attrs);
- for (var i in attrs) {
- if (i.indexOf('data-datepicker-') !== 0) {
- continue;
- }
- i = i.replace(/^data-datepicker-/, '');
- datepickerConfig[i] = data[i];
- console.log('setting datepicker config: ', i, data[i]);
+ if ($this.data('datepicker-default-date')) {
+ datepickerConfig.defaultDate = $this.data('datepicker-default-date');
}
- */
$this.datepicker(datepickerConfig);
});
}, | Allow configuration of defaultDate from form | grrr-amsterdam_garp3 | train | js |
c1e67c1ef4cb4e69b2c5d91d7591514956d69628 | diff --git a/src/main/java/org/threeten/extra/chrono/PaxDate.java b/src/main/java/org/threeten/extra/chrono/PaxDate.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/threeten/extra/chrono/PaxDate.java
+++ b/src/main/java/org/threeten/extra/chrono/PaxDate.java
@@ -587,7 +587,7 @@ public final class PaxDate extends AbstractDate implements ChronoLocalDate, Seri
*/
@Override
long getProlepticMonth() {
- return getProlepticYear() * MONTHS_IN_YEAR + getLeapYearsBefore(getProlepticYear()) + getMonth() - 1;
+ return ((long) getProlepticYear()) * MONTHS_IN_YEAR + getLeapYearsBefore(getProlepticYear()) + getMonth() - 1;
}
/** | Add cast to protect from overflow. | ThreeTen_threeten-extra | train | java |
cfa374368ab0875bf72726779c64c702da153f7a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -14,14 +14,14 @@ var Key = require('./key');
var CachingWriter = {};
-CachingWriter.init = function(inputTrees, options) {
+CachingWriter.init = function(inputTrees, _options) {
this._lastKeys = [];
this._shouldBeIgnoredCache = Object.create(null);
this._destDir = path.resolve(path.join('tmp', 'caching-writer-dest-dir_' + generateRandomString(6) + '.tmp'));
this.debug = debugGenerator('broccoli-caching-writer:' + (this.description || this.constructor.name));
- options = options || {};
+ var options = _options || {};
for (var key in options) {
if (options.hasOwnProperty(key)) { | don't re-write argument vars | ember-cli_broccoli-caching-writer | train | js |
776b7a206650b99b22488942002f8beabb906b45 | diff --git a/tofu/data/_mesh.py b/tofu/data/_mesh.py
index <HASH>..<HASH> 100644
--- a/tofu/data/_mesh.py
+++ b/tofu/data/_mesh.py
@@ -527,7 +527,7 @@ class Mesh2DRect(DataCollection):
operator=None,
geometry=None,
isotropic=None,
- method=None,
+ algo=None,
sparse=None,
chain=None,
positive=None,
@@ -549,7 +549,7 @@ class Mesh2DRect(DataCollection):
operator=operator,
geometry=geometry,
isotropic=isotropic,
- method=method,
+ algo=algo,
sparse=sparse,
chain=chain,
positive=positive, | [#<I>] method renamed algo (method can be used by scipy) | ToFuProject_tofu | train | py |
bbc10afedac1f9ea35d510211a5ec59296573cd5 | diff --git a/src/vs/workbench/contrib/webview/browser/pre/main.js b/src/vs/workbench/contrib/webview/browser/pre/main.js
index <HASH>..<HASH> 100644
--- a/src/vs/workbench/contrib/webview/browser/pre/main.js
+++ b/src/vs/workbench/contrib/webview/browser/pre/main.js
@@ -994,13 +994,18 @@ onDomReady(() => {
if (!target) {
return;
}
+
+ // Reset selection so we start search after current find result
+ const selection = target.contentWindow.getSelection();
+ selection.collapse(selection.anchorNode);
+
const didFind = (/** @type {any} */ (target.contentWindow)).find(
data.value,
- false,
+ /* caseSensitive*/ false,
/* backwards*/ data.previous,
/* wrapAround*/ true,
- false,
- /*aSearchInFrames*/ true,
+ /* wholeWord */ false,
+ /* searchInFrames*/ false,
false);
hostMessaging.postMessage('did-find', didFind);
}); | Improving ux for search in webviews on web | Microsoft_vscode | train | js |
5a15dc78f3a5ffaf6a3a08adaae5dfc603ba2c53 | diff --git a/lib/MtgDbClient/card.rb b/lib/MtgDbClient/card.rb
index <HASH>..<HASH> 100644
--- a/lib/MtgDbClient/card.rb
+++ b/lib/MtgDbClient/card.rb
@@ -29,7 +29,7 @@ module MtgDbClient
self.promo = response["promo"]
self.rulings = response["rulings"].map{|r| Ruling.new(r)}
self.formats = response["formats"].map{|f| Format.new(f)}
- self.released_at = Date.parse(response["releasedAt"])
+ self.released_at = Date.parse(response["releasedAt"]) unless response["releasedAt"].nil?
end
def image_low | handle possible null value at response["releasedAt"], see issue #1 | chasepark_MtgDbClient | train | rb |
79057de99c164b5b5fa96692f65eff9af96809fd | diff --git a/app/controllers/devise/password_expired_controller.rb b/app/controllers/devise/password_expired_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/devise/password_expired_controller.rb
+++ b/app/controllers/devise/password_expired_controller.rb
@@ -1,6 +1,6 @@
class Devise::PasswordExpiredController < DeviseController
skip_before_filter :handle_password_change
- before_action :skip_password_change, only: [:show, :update]
+ before_filter :skip_password_change, only: [:show, :update]
prepend_before_filter :authenticate_scope!, :only => [:show, :update]
def show | change before_action to before_filter | phatworx_devise_security_extension | train | rb |
c2a4d936d4e06886a32ca0d68574125a0d3ac040 | diff --git a/google/storeutils/get.go b/google/storeutils/get.go
index <HASH>..<HASH> 100644
--- a/google/storeutils/get.go
+++ b/google/storeutils/get.go
@@ -12,8 +12,12 @@ import (
// GetObject Gets a single object's bytes based on bucket and name parameters
func GetObject(gc *storage.Client, bucket, name string) (*bytes.Buffer, error) {
+ return GetObjectWithContext(context.Background(), gc, bucket, name)
+}
- rc, err := gc.Bucket(bucket).Object(name).NewReader(context.Background())
+// GetObject Gets a single object's bytes based on bucket and name parameters
+func GetObjectWithContext(ctx context.Context, gc *storage.Client, bucket, name string) (*bytes.Buffer, error) {
+ rc, err := gc.Bucket(bucket).Object(name).NewReader(ctx)
if err != nil {
if err == storage.ErrObjectNotExist {
return nil, cloudstorage.ErrObjectNotFound | Add option to pass in context to getobject | lytics_cloudstorage | train | go |
9a5fd7620fb422510dde3a2e212059fa11a05c1c | diff --git a/test/test_post.rb b/test/test_post.rb
index <HASH>..<HASH> 100644
--- a/test/test_post.rb
+++ b/test/test_post.rb
@@ -5,6 +5,8 @@ $LOAD_PATH.unshift(__dir__)
require 'helper'
describe 'Post' do
+ before { test_site.scan_files }
+
subject do
filename = '2015-01-01-a-post.markdown'
path = File.join(test_site.source_paths[:posts], filename)
@@ -13,11 +15,11 @@ describe 'Post' do
it 'parses its YAML frontmatter' do
subject.title.must_equal('My first post')
- subject.categories.sort.must_equal(%w[a b c])
+ subject.categories.sort.must_equal(%w[green red])
end
it 'renders its contents' do
- expected_output = render_template('post')
+ expected_output = read_fixture('posts/2015-01-01-a-post')
subject.render.must_equal(expected_output)
end | Switch to calling read_fixture, rename the categories, and have the test site scan its files. | waferbaby_dimples | train | rb |
6352c8a08602438fb8f1b08ecf41d7f8c3d422ad | diff --git a/monero_serialize/xmrrpc.py b/monero_serialize/xmrrpc.py
index <HASH>..<HASH> 100644
--- a/monero_serialize/xmrrpc.py
+++ b/monero_serialize/xmrrpc.py
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
'''
XMR RPC serialization
+WARNING: Not finished yet
{json, binary} <-> portable_storage <-> object
@@ -21,7 +22,7 @@ Mainly related to:
/contrib/epee/include/storages/portable_storage_to_bin.h
/contrib/epee/include/storages/portable_storage_to_json.h
-...Not finished yet...
+WARNING: Not finished yet
''' | xmrrpc: not finished yet warning | ph4r05_monero-serialize | train | py |
afcfb7350e382c498a475890a9b0643e9a0e3fb7 | diff --git a/perceval/backends/puppet/puppetforge.py b/perceval/backends/puppet/puppetforge.py
index <HASH>..<HASH> 100644
--- a/perceval/backends/puppet/puppetforge.py
+++ b/perceval/backends/puppet/puppetforge.py
@@ -349,7 +349,7 @@ class PuppetForgeCommand(BackendCommand):
def setup_cmd_parser(cls):
"""Returns the Puppet Forge argument parser."""
- parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
+ parser = BackendCommandArgumentParser(cls.BACKEND,
from_date=True,
archive=True)
diff --git a/tests/test_puppetforge.py b/tests/test_puppetforge.py
index <HASH>..<HASH> 100644
--- a/tests/test_puppetforge.py
+++ b/tests/test_puppetforge.py
@@ -493,7 +493,7 @@ class TestPuppetForgeCommand(unittest.TestCase):
parser = PuppetForgeCommand.setup_cmd_parser()
self.assertIsInstance(parser, BackendCommandArgumentParser)
- self.assertEqual(parser._categories, PuppetForge.CATEGORIES)
+ self.assertEqual(parser._backend, PuppetForge)
args = ['--max-items', '5',
'--tag', 'test', | [backend] Change signature BackendCommandArgumentParser
This code changes the signature of the class `BackendCommandArgumentParser`,
which now accepts as first parameter the backend object instead
its categories. This change is needed to simplify accessing other backend
attributes, beyond the categories.
Puppetforge backend and corresponding tests have been updated. | chaoss_grimoirelab-perceval-puppet | train | py,py |
8e31f2b61e915871c3678cac736953b3c5a4f198 | diff --git a/Module.php b/Module.php
index <HASH>..<HASH> 100644
--- a/Module.php
+++ b/Module.php
@@ -2,16 +2,16 @@
namespace ZfcUserDoctrineORM;
-use Zend\Module\Manager,
- Zend\Module\Consumer\AutoloaderProvider,
+use Zend\ModuleManager\ModuleManager,
+ Zend\ModuleManager\Feature\AutoloaderProviderInterface,
ZfcUserDoctrineORM\Event\ResolveTargetEntityListener,
ZfcUser\Module as ZfcUser,
Doctrine\ORM\Events,
Zend\EventManager\StaticEventManager;
-class Module implements AutoloaderProvider
+class Module implements AutoloaderProviderInterface
{
- public function init(Manager $moduleManager)
+ public function init(ModuleManager $moduleManager)
{
$events = StaticEventManager::getInstance();
$events->attach('bootstrap', 'bootstrap', array($this, 'attachDoctrineEvents'), 100); | Updated Module.php for zf2 b4 compliance. | ZF-Commons_ZfcUserDoctrineORM | train | php |
f3ac24456018fed6625214fca6746daa9f70de9d | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -21,14 +21,15 @@ function header (stream) {
var m
if(!(m = /\n/.exec(soFar))) return
var meta = JSON.parse(soFar.substring(0, m.index))
- soFar = soFar.substring(m.index)
+ //+ 1 to get past the newline
+ soFar = soFar.substring(m.index + 1)
stream.emit = emit
stream.meta = meta
stream.emit('header', meta)
//check that the stream is still readable,
//it may have been ended during the 'header'
//event.
- if(soFar != '' && stream.readable)
+ if('' !== soFar && stream.readable)
stream.emit('data', soFar)
} | don\'t emit \'\' as data | dominictarr_header-stream | train | js |
6b08984a9aa31f0b1b5362543c61ac14d6f6c60c | diff --git a/src/main/java/net/kuujo/vertigo/context/WorkerContext.java b/src/main/java/net/kuujo/vertigo/context/WorkerContext.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/kuujo/vertigo/context/WorkerContext.java
+++ b/src/main/java/net/kuujo/vertigo/context/WorkerContext.java
@@ -91,7 +91,10 @@ public class WorkerContext implements Context {
* A JSON configuration.
*/
public JsonObject config() {
- JsonObject config = getComponentContext().getDefinition().config();
+ if (parent == null) {
+ return new JsonObject();
+ }
+ JsonObject config = parent.getDefinition().config();
if (config == null) {
config = new JsonObject();
} | Support empty WorkerContext instances for other language support. | kuujo_vertigo | train | java |
953403acef7b7e28afb5c4346590ade0a61f6342 | diff --git a/bucketcache/__init__.py b/bucketcache/__init__.py
index <HASH>..<HASH> 100644
--- a/bucketcache/__init__.py
+++ b/bucketcache/__init__.py
@@ -12,6 +12,6 @@ __all__ = (backends.__all__ + buckets.__all__ + config.__all__ +
exceptions.__all__ + keymakers.__all__ + utilities.__all__)
__author__ = 'Frazer McLean <[email protected]>'
-__version__ = '0.11.0'
+__version__ = '0.11.1'
__license__ = 'MIT'
__description__ = 'Versatile persisent file cache.' | Bumped version number to <I> | RazerM_bucketcache | train | py |
563ad5030ccd911346fae14dde646c0baf4fb3d0 | diff --git a/lib/features/popup-menu/PopupMenu.js b/lib/features/popup-menu/PopupMenu.js
index <HASH>..<HASH> 100644
--- a/lib/features/popup-menu/PopupMenu.js
+++ b/lib/features/popup-menu/PopupMenu.js
@@ -308,7 +308,7 @@ PopupMenu.prototype._createEntries = function(entries, container) {
self._createEntry(entry, entriesContainer);
});
- domClasses(entriesContainer).add('dropdown-menu');
+ domClasses(entriesContainer).add('popup-dropdown-menu');
container.appendChild(entriesContainer);
};
@@ -364,7 +364,7 @@ PopupMenu.prototype._createEntry = function(entry, container) {
if(entry.content.entries) {
// create a nested menu
label.textContent = entry.content.label;
- entryClasses.add('dropdown');
+ entryClasses.add('popup-dropdown');
this._createEntries(entry.content.entries, entryContainer);
} else {
// create a normal entry | refact(popup): prefix dropdown class names with popup-
Related to CAM-<I> | bpmn-io_table-js | train | js |
8fe0ca5b230b00b717800fedcfc93471dc94a0cc | diff --git a/Manager/InstallationManager.php b/Manager/InstallationManager.php
index <HASH>..<HASH> 100644
--- a/Manager/InstallationManager.php
+++ b/Manager/InstallationManager.php
@@ -154,7 +154,7 @@ class InstallationManager
$ds = DIRECTORY_SEPARATOR;
$om = $this->container->get('doctrine.orm.entity_manager');
$entity = $om->getRepository('ClarolineCoreBundle:Bundle')
- ->findOneByName($bundle->getName());
+ ->findOneByName($bundle->getClarolineName());
if (!$entity) {
$entity = new Bundle(); | [InstallationBundle] Update InstallationManager.php | claroline_Distribution | train | php |
67d7676e0e2d8695fd93d3ab0184289b5d7fecbe | diff --git a/test/e2e/cluster_size_autoscaling.go b/test/e2e/cluster_size_autoscaling.go
index <HASH>..<HASH> 100644
--- a/test/e2e/cluster_size_autoscaling.go
+++ b/test/e2e/cluster_size_autoscaling.go
@@ -28,7 +28,7 @@ import (
)
const (
- scaleTimeout = 2 * time.Minute
+ scaleTimeout = 5 * time.Minute
)
var _ = framework.KubeDescribe("Cluster size autoscaling [Feature:ClusterSizeAutoscaling] [Slow]", func() { | Increase cluster resize timeout in e2e tests from 2 min to 5 min | kubernetes_kubernetes | train | go |
9912a8c550b637d30a8bda01c0fed6a8d2715d76 | diff --git a/xclim/indices/_anuclim.py b/xclim/indices/_anuclim.py
index <HASH>..<HASH> 100644
--- a/xclim/indices/_anuclim.py
+++ b/xclim/indices/_anuclim.py
@@ -486,11 +486,9 @@ def prcptot(pr: xarray.DataArray, input_freq: str = None, freq: str = "YS"):
Parameters
----------
pr : xarray.DataArray
- Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar
-
+ Total precipitation flux [mm d-1], [mm week-1], [mm month-1] or similar.
input_freq : str
- Input data time frequency - One of 'daily', 'weekly' or 'monthly'
-
+ Input data time frequency - One of 'daily', 'weekly' or 'monthly'.
freq : str
Resampling frequency; Defaults to "YS". | Update xclim/indices/_anuclim.py | Ouranosinc_xclim | train | py |
f01e0fe4f79fc2ae35e32d70c06dd95d504ebcf1 | diff --git a/src/Factory/Invoice.php b/src/Factory/Invoice.php
index <HASH>..<HASH> 100644
--- a/src/Factory/Invoice.php
+++ b/src/Factory/Invoice.php
@@ -506,6 +506,9 @@ class Invoice
} elseif ($mKey instanceof \stdClass) {
$this->oCallbackData = new CallbackData($mKey);
} else {
+ if ($this->oCallbackData === null) {
+ $this->oCallbackData = new \stdClass();
+ }
$this->oCallbackData->{$mKey} = $mValue;
}
diff --git a/src/Factory/Invoice/Item.php b/src/Factory/Invoice/Item.php
index <HASH>..<HASH> 100644
--- a/src/Factory/Invoice/Item.php
+++ b/src/Factory/Invoice/Item.php
@@ -289,6 +289,9 @@ class Item
} elseif ($mKey instanceof \stdClass) {
$this->oCallbackData = new CallbackData($mKey);
} else {
+ if ($this->oCallbackData === null) {
+ $this->oCallbackData = new \stdClass();
+ }
$this->oCallbackData->{$mKey} = $mValue;
} | Prevents phpe rror when passing in key/values to invoice and invoice item factories setCallbackData methods | nails_module-invoice | train | php,php |
3e3f9ec26d5728e48b250c3dbc6af1a51942d9f6 | diff --git a/java/client/src/org/openqa/selenium/support/ui/FluentWait.java b/java/client/src/org/openqa/selenium/support/ui/FluentWait.java
index <HASH>..<HASH> 100644
--- a/java/client/src/org/openqa/selenium/support/ui/FluentWait.java
+++ b/java/client/src/org/openqa/selenium/support/ui/FluentWait.java
@@ -67,7 +67,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
*/
public class FluentWait<T> implements Wait<T> {
- public static Duration FIVE_HUNDRED_MILLIS = new Duration(500, MILLISECONDS);
+ public static final Duration FIVE_HUNDRED_MILLIS = new Duration(500, MILLISECONDS);
private final T input;
private final Clock clock; | java: Adding final modifier for a constant | SeleniumHQ_selenium | train | java |
3d3e12ac571b95c767c5bbf2d0ef9938894acc0c | diff --git a/spec/lib/sapience/appender/datadog_spec.rb b/spec/lib/sapience/appender/datadog_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/sapience/appender/datadog_spec.rb
+++ b/spec/lib/sapience/appender/datadog_spec.rb
@@ -164,4 +164,13 @@ describe Sapience::Appender::Datadog do
end
end
+ describe "#histogram" do
+ let(:metric_amount) { 444 }
+
+ it "calls timing" do
+ expect(statsd).to receive(:histogram).with(metric, metric_amount)
+ subject.histogram(metric, metric_amount)
+ end
+ end
+
end | Add tests for Statsd histogram method | reevoo_sapience-rb | train | rb |
ed2d4b715bec8aeee3bf46361541b378afa79ab5 | diff --git a/odl/operator/operator.py b/odl/operator/operator.py
index <HASH>..<HASH> 100644
--- a/odl/operator/operator.py
+++ b/odl/operator/operator.py
@@ -963,6 +963,8 @@ class Operator(object):
else:
return NotImplemented
+ __div__ = __truediv__
+
def __neg__(self):
"""Return ``-self``."""
return -1 * self | ENH: add __div__ to operators, allows division by scalars in python 2 | odlgroup_odl | train | py |
9d96d4486d090642a4e6a27badf434eeb8e2e5d9 | diff --git a/lib/Scan.js b/lib/Scan.js
index <HASH>..<HASH> 100644
--- a/lib/Scan.js
+++ b/lib/Scan.js
@@ -65,7 +65,7 @@ Scan.prototype.exec = function (next) {
function scanByRawFilter() {
var deferred = Q.defer();
var dbClient = Model.$__.base.documentClient();
- var AWSSet = dbClient.createSet([1, 2, 3]).constructor;
+ var DynamoDBSet = dbClient.createSet([1, 2, 3]).constructor;
dbClient.scan(scanReq, function(err, data) {
if (err) {
@@ -78,7 +78,7 @@ Scan.prototype.exec = function (next) {
var model;
Object.keys(item).forEach(function (prop) {
- if (item.hasOwnProperty(prop) && item[prop] instanceof AWSSet) {
+ if (item[prop] instanceof DynamoDBSet) {
item[prop] = item[prop].values;
}
}); | Removed redundant hasOwnProperty call. Renamed variable for better clarity. | dynamoosejs_dynamoose | train | js |
a017ea48029f250450700be58f13b2ed85bec13f | diff --git a/tests/unit/errorBag.js b/tests/unit/errorBag.js
index <HASH>..<HASH> 100644
--- a/tests/unit/errorBag.js
+++ b/tests/unit/errorBag.js
@@ -356,11 +356,11 @@ test('groups errors by field name', () => {
});
expect(errors.collect(null, undefined, false)).toEqual({
email: [
- { field: 'email', msg: 'The email is invalid', scope: null, rule: 'rule1' },
- { field: 'email', msg: 'The email is shorter than 3 chars.', scope: null, rule: 'rule1' },
+ { field: 'email', msg: 'The email is invalid', scope: null, rule: 'rule1', vmId: null },
+ { field: 'email', msg: 'The email is shorter than 3 chars.', scope: null, rule: 'rule1', vmId: null },
],
name: [
- { field: 'name', msg: 'The name is invalid', scope: null, rule: 'rule1' },
+ { field: 'name', msg: 'The name is invalid', scope: null, rule: 'rule1', vmId: null },
]
});
}); | tests: fix test case with vmId being injected into the errorbag | baianat_vee-validate | train | js |
cf39a2de40b0ea21e415bdfe6ba2c47c2c5eae95 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -3025,6 +3025,14 @@ const devices = [
supports: 'on/off, brightness, color temperature, color',
},
{
+ zigbeeModel: ['GL-B-007ZS'],
+ model: 'GL-B-007ZS',
+ vendor: 'Gledopto',
+ description: 'Smart+ 6W E27 RGB / CCT LED bulb',
+ extend: gledopto.light,
+ supports: 'on/off, brightness, color temperature, color',
+ },
+ {
zigbeeModel: ['GL-B-008Z'],
model: 'GL-B-008Z',
vendor: 'Gledopto', | GLEDOPTO GL-B-<I>ZS Bulb (#<I>)
Support for this bulb | Koenkk_zigbee-shepherd-converters | train | js |
a299347de34c7fdf866fa1f60d489540d05f9e0b | diff --git a/plugins/Goals/API.php b/plugins/Goals/API.php
index <HASH>..<HASH> 100644
--- a/plugins/Goals/API.php
+++ b/plugins/Goals/API.php
@@ -192,7 +192,7 @@ class API extends \Piwik\Plugin\API
WHERE idsite = ?
AND idgoal = ?",
array($idSite, $idGoal));
- Db::deleteAllRows(Common::prefixTable("log_conversion"), "WHERE idgoal = ?", "idvisit", 100000, array($idGoal));
+ Db::deleteAllRows(Common::prefixTable("log_conversion"), "WHERE idgoal = ? AND idsite = ?", "idvisit", 100000, array($idGoal, $idSite));
Cache::regenerateCacheWebsiteAttributes($idSite);
} | Goal delete fix
Disallow to delete all conversions for given idgoal (across all websites) after goal (soft)delete. | matomo-org_matomo | train | php |
038658c1effb31c4edcde92da0e18f82d6de9a35 | diff --git a/packages/vuetifyjs.com/build/webpack.base.config.js b/packages/vuetifyjs.com/build/webpack.base.config.js
index <HASH>..<HASH> 100755
--- a/packages/vuetifyjs.com/build/webpack.base.config.js
+++ b/packages/vuetifyjs.com/build/webpack.base.config.js
@@ -24,7 +24,8 @@ module.exports = {
alias: {
'@': path.resolve(__dirname, '../'),
'vue$': 'vue/dist/vue.common.js'
- }
+ },
+ symlinks: false
},
module: {
noParse: /es6-promise\.js$/, // avoid webpack shimming process | don't let webpack resolve symlinks
allows linked packages to have their own babel configs | vuetifyjs_vuetify | train | js |
94d8dedd0bd3717a6acc379166552e42b66f046f | diff --git a/library/Services/ShopInstaller/ShopInstaller.php b/library/Services/ShopInstaller/ShopInstaller.php
index <HASH>..<HASH> 100644
--- a/library/Services/ShopInstaller/ShopInstaller.php
+++ b/library/Services/ShopInstaller/ShopInstaller.php
@@ -128,7 +128,7 @@ class ShopInstaller implements ShopServiceInterface
$vendorDir = $testConfig->getVendorDirectory();
CliExecutor::executeCommand("{$vendorDir}/bin/oe-eshop-facts oe-eshop-db_migrate");
- CliExecutor::executeCommand("{$vendorDir}/bin/oe-eshop-facts oe-eshop-db_views_regenerate");
+ CliExecutor::executeCommand("{$vendorDir}/bin/oe-eshop-db_views_regenerate");
}
/** | ESDEV-<I> Use different script to generate views
The new script is operating system independent. | OXID-eSales_testing_library | train | php |
052bdbe305c19c8c34e6c2484e306ffec89e51a0 | diff --git a/chef/spec/unit/mixin/find_preferred_file_spec.rb b/chef/spec/unit/mixin/find_preferred_file_spec.rb
index <HASH>..<HASH> 100644
--- a/chef/spec/unit/mixin/find_preferred_file_spec.rb
+++ b/chef/spec/unit/mixin/find_preferred_file_spec.rb
@@ -69,6 +69,17 @@ describe Chef::Mixin::FindPreferredFile do
args = %w{no_cookbook_id no_filetype mods/deflate.conf.erb nohost.example.com noplatform noversion}
@finder.find_preferred_file(*args).should == "/srv/chef/cookbooks/apache2/templates/default/mods/deflate.conf.erb"
end
+
+ it "finds the default file with brackets" do
+ file_name = "file-with-[brackets]"
+ expected_file_path = "/srv/chef/cookbooks/apache2/templates/default/#{file_name}"
+ hsh = default_file_hash.merge({
+ expected_file_path => expected_file_path
+ })
+ @finder.stub!(:load_cookbook_files).and_return(hsh)
+ args = %w{no_cookbook_id no_filetype} + [ file_name ] + %w{nohost.example.com noplatform noversion}
+ @finder.find_preferred_file(*args).should == expected_file_path
+ end
it "prefers a platform specific file to the default" do
@default_file_list << "/srv/chef/cookbooks/apache2/templates/ubuntu/mods/deflate.conf.erb" | [CHEF-<I>] New spec for - Filenames with brackets need regular expression escaping | chef_chef | train | rb |
0e311abf19dd5d233c8cdef78d47085801beaced | diff --git a/mempool/reactor_test.go b/mempool/reactor_test.go
index <HASH>..<HASH> 100644
--- a/mempool/reactor_test.go
+++ b/mempool/reactor_test.go
@@ -76,6 +76,11 @@ func TestReactorNoBroadcastToSender(t *testing.T) {
}
}
}()
+ for _, r := range reactors {
+ for _, peer := range r.Switch.Peers().List() {
+ peer.Set(types.PeerStateKey, peerState{1})
+ }
+ }
const peerID = 1
checkTxs(t, reactors[0].mempool, numTxs, peerID) | mempool/reactor: fix reactor broadcast test (#<I>)
found out this issue when trying to decouple mempool reactor with its
underlying clist implementation.
according to its comment, the test `TestReactorNoBroadcastToSender` is
intended to make sure that a peer shouldn't send tx back to its origin.
however, the current test forgot to init peer state key, thus the code
will get stuck at waiting for peer to catch up state *instead of* skipping
sending tx back:
<URL> | tendermint_tendermint | train | go |
7f83cf5192c408200a3c24608fc0358ed1e32d64 | diff --git a/src/Classifier.php b/src/Classifier.php
index <HASH>..<HASH> 100644
--- a/src/Classifier.php
+++ b/src/Classifier.php
@@ -68,7 +68,13 @@ class Classifier
throw new Exception("Classifier {$classifier} does not implement ".ClassifierContract::class.'.');
}
- if ($c->satisfies($class)) {
+ // Wrap the `satisfies` method call in the `resuce` helper to
+ // catch possible thrown Exceptions
+ $satisfied = rescue(function() use ($c, $class) {
+ return $c->satisfies($class);
+ }, false);
+
+ if ($satisfied) {
return $c->getName();
}
} | Wrap satisfies call within rescue helper | stefanzweifel_laravel-stats | train | php |
662b99528218ba7b86d45652438404012f8c4b07 | diff --git a/lib/arel/engines/sql/relations/table.rb b/lib/arel/engines/sql/relations/table.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/engines/sql/relations/table.rb
+++ b/lib/arel/engines/sql/relations/table.rb
@@ -20,10 +20,16 @@ module Arel
if @engine.connection
begin
require "arel/engines/sql/compilers/#{@engine.adapter_name.downcase}_compiler"
- @@tables ||= engine.tables
rescue LoadError
- raise "#{@engine.adapter_name} is not supported by Arel."
+ begin
+ # try to load an externally defined compiler, in case this adapter has defined the compiler on its own.
+ require "#{@engine.adapter_name.downcase}/arel_compiler"
+ rescue LoadError
+ raise "#{@engine.adapter_name} is not supported by Arel."
+ end
end
+
+ @@tables ||= engine.tables
end
end | Allow externally defined AR adapters to define their own compiler. | rails_rails | train | rb |
2cd49a48aa685d34a4d3d19cdbe72967161a0476 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,6 +21,10 @@ ENCODING = "utf8"
pkg_info = {}
+def need_pytest():
+ return set(["pytest", "test", "ptr"]).intersection(sys.argv)
+
+
with open(os.path.join(MODULE_NAME, "__version__.py")) as f:
exec(f.read(), pkg_info)
@@ -33,8 +37,7 @@ with open(os.path.join(REQUIREMENT_DIR, "requirements.txt")) as f:
with open(os.path.join(REQUIREMENT_DIR, "test_requirements.txt")) as f:
tests_requires = [line.strip() for line in f if line.strip()]
-needs_pytest = set(["pytest", "test", "ptr"]).intersection(sys.argv)
-pytest_runner = ["pytest-runner"] if needs_pytest else []
+pytest_runner = ["pytest-runner"] if need_pytest() else []
setuptools.setup(
name=MODULE_NAME, | Extract a function that gets pytest-runner requirement | thombashi_sqliteschema | train | py |
93bccf36ba10a264841bab77f109b1b1915b2ca7 | diff --git a/Docs/WebFrontend/Geocode.js b/Docs/WebFrontend/Geocode.js
index <HASH>..<HASH> 100644
--- a/Docs/WebFrontend/Geocode.js
+++ b/Docs/WebFrontend/Geocode.js
@@ -50,7 +50,7 @@ function geocodeAddress(tf){
freeform = document.getElementById('tfEndSearch').value;
}
- if(freeform.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*,\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
+ if(freeform.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
var marker;
if(tf == 'start'){
@@ -61,7 +61,7 @@ function geocodeAddress(tf){
isEndPointSet = true;
marker = 'end';
}
- var coord = freeform.split(",");
+ var coord = freeform.split(/[,;]/);
lonlat = new OpenLayers.LonLat(coord[1],coord[0]);
setMarkerAndZoom(marker, lonlat);
return; | support coordinates as start/end point: also accept semicolon as separator | Project-OSRM_osrm-backend | train | js |
70302dfbe65670cafffbefcb19a40ac6ee40178d | diff --git a/lib/lifx/transport/tcp.rb b/lib/lifx/transport/tcp.rb
index <HASH>..<HASH> 100644
--- a/lib/lifx/transport/tcp.rb
+++ b/lib/lifx/transport/tcp.rb
@@ -6,9 +6,6 @@ module LIFX
def initialize(host, port)
super
connect
- at_exit do
- close
- end
end
def connected? | Probably not the best method at this stage | LIFX_lifx-gem | train | rb |
d67ef12aa784f795d4add909a16a1659a6c3da7a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ except ImportError:
long_description = 'A pedigree parser.'
setup(name="ped_parser",
- version="1.4",
+ version="1.5",
description="A ped file parser.",
author="Mans Magnusson",
author_email="[email protected]", | Bumped version to <I> | moonso_ped_parser | train | py |
9686d46c6b789894fd8a3922b4edbdc7e6ff1af8 | diff --git a/src/main/java/sklearn/preprocessing/FunctionTransformer.java b/src/main/java/sklearn/preprocessing/FunctionTransformer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/sklearn/preprocessing/FunctionTransformer.java
+++ b/src/main/java/sklearn/preprocessing/FunctionTransformer.java
@@ -117,7 +117,9 @@ public class FunctionTransformer extends Transformer {
case "cosh":
case "expm1":
case "hypot":
- case "ln1p":
+ return PMMLUtil.createApply("x-" + name, fieldRef);
+ case "log1p":
+ return PMMLUtil.createApply("x-ln1p", fieldRef);
case "rint":
case "sin":
case "sinh": | Fixed the name of a Numpy universal function. Fixes #<I> | jpmml_jpmml-sklearn | train | java |
010a7b6092b78e31c55e7ef28d7d6025bfc559b8 | diff --git a/lib/jazzy/sourcekitten.rb b/lib/jazzy/sourcekitten.rb
index <HASH>..<HASH> 100644
--- a/lib/jazzy/sourcekitten.rb
+++ b/lib/jazzy/sourcekitten.rb
@@ -47,7 +47,6 @@ module Jazzy
def self.run_sourcekitten(arguments)
bin_path = Pathname(__FILE__).parent + 'sourcekitten/sourcekitten'
command = "#{bin_path} #{(arguments).join(' ')}"
- p command
output = `#{command}`
raise 'Running sourcekitten failed: ' + output unless $?.success?
output | [SourceKitten] Don't print command | realm_jazzy | train | rb |
1e793a8c9f2728d6d695bf372e04d13b96f435b7 | diff --git a/lxd/device/device_utils_network.go b/lxd/device/device_utils_network.go
index <HASH>..<HASH> 100644
--- a/lxd/device/device_utils_network.go
+++ b/lxd/device/device_utils_network.go
@@ -1,8 +1,6 @@
package device
import (
- "crypto/rand"
- "encoding/hex"
"fmt"
"io/ioutil"
"strconv"
@@ -210,21 +208,6 @@ func networkRestorePhysicalNic(hostName string, volatile map[string]string) erro
return nil
}
-// networkRandomDevName returns a random device name with prefix.
-// If the random string combined with the prefix exceeds 13 characters then empty string is returned.
-// This is to ensure we support buggy dhclient applications: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858580
-func networkRandomDevName(prefix string) string {
- // Return a new random veth device name
- randBytes := make([]byte, 4)
- rand.Read(randBytes)
- iface := prefix + hex.EncodeToString(randBytes)
- if len(iface) > 13 {
- return ""
- }
-
- return iface
-}
-
// networkCreateVethPair creates and configures a veth pair. It will set the hwaddr and mtu settings
// in the supplied config to the newly created peer interface. If mtu is not specified, but parent
// is supplied in config, then the MTU of the new peer interface will inherit the parent MTU. | lxd/device/device/utils/network: Removes networkRandomDevName
Moving to network package. | lxc_lxd | train | go |
a47254be2c82a692aa375976018a81c2df34f577 | diff --git a/conn.go b/conn.go
index <HASH>..<HASH> 100644
--- a/conn.go
+++ b/conn.go
@@ -499,9 +499,7 @@ func (conn *Conn) sendReply(dest string, serial uint32, values ...interface{}) {
// The caller has to make sure that ch is sufficiently buffered; if a message
// arrives when a write to c is not possible, it is discarded.
//
-// Multiple of these channels can be registered at the same time. Passing a
-// channel that already is registered will remove it from the list of the
-// registered channels.
+// Multiple of these channels can be registered at the same time.
//
// These channels are "overwritten" by Eavesdrop; i.e., if there currently is a
// channel for eavesdropped messages, this channel receives all signals, and
@@ -512,6 +510,17 @@ func (conn *Conn) Signal(ch chan<- *Signal) {
conn.signalsLck.Unlock()
}
+// RemoveSignal removes the given channel from the list of the registered channels.
+func (conn *Conn) RemoveSignal(ch chan<- *Signal) {
+ conn.signalsLck.Lock()
+ for i, c := range conn.signals {
+ if c == ch {
+ conn.signals = append(conn.signals[:i], conn.signals[i+1:]...)
+ }
+ }
+ conn.signalsLck.Unlock()
+}
+
// SupportsUnixFDs returns whether the underlying transport supports passing of
// unix file descriptors. If this is false, method calls containing unix file
// descriptors will return an error and emitted signals containing them will | conn: add RemoveSignal method to *Conn
this loops over all conn.signals and removes all that match the
given signal.
Possible fix for #<I> | godbus_dbus | train | go |
eb5fb831dfbcc0ce864ac955c29ba83c9d888a82 | diff --git a/project/library/CM/Action/Abstract.php b/project/library/CM/Action/Abstract.php
index <HASH>..<HASH> 100644
--- a/project/library/CM/Action/Abstract.php
+++ b/project/library/CM/Action/Abstract.php
@@ -276,4 +276,30 @@ abstract class CM_Action_Abstract extends CM_Class_Abstract implements CM_ArrayC
CM_Mysql::insert(TBL_CM_ACTION, array('verb', 'type', 'createStamp', 'count', 'interval'), $insert);
}
}
+
+ /**
+ * @return string
+ * @throws CM_Exception_Invalid
+ */
+ public function getVerbName() {
+ $actionVerbs = self::_getConfig()->verbs;
+ if (!array_key_exists($this->getVerb(), $actionVerbs)) {
+ throw new CM_Exception_Invalid('The specified Action does not exist!');
+ }
+ return $actionVerbs[$this->getVerb()];
+ }
+
+ /**
+ * @return string
+ */
+ public function getName() {
+ return str_replace($this->_getNamespace() . '_Action_', '', $this->_getClassName());
+ }
+
+ /**
+ * @return string
+ */
+ public function getLabel() {
+ return $this->getName() . ' ' . $this->getVerbName();
+ }
} | t<I>: New methods for events naming | cargomedia_cm | train | php |
8872d37e16d5e051d9c16eff614b0af54b1b284b | diff --git a/src/Feature.php b/src/Feature.php
index <HASH>..<HASH> 100644
--- a/src/Feature.php
+++ b/src/Feature.php
@@ -1,6 +1,6 @@
<?php
/**
- *
+ *
*/
namespace Opensoft\Rollout;
@@ -183,7 +183,7 @@ class Feature
*/
private function isUserInPercentage(RolloutUserInterface $user)
{
- return crc32($user->getRolloutIdentifier()) % 100 < $this->percentage;
+ return abs(crc32($user->getRolloutIdentifier()) % 100) < $this->percentage;
}
/**
@@ -210,4 +210,4 @@ class Feature
return false;
}
-}
+} | [fix] fix for Feature::isUserInPercentage() method
The CRC<I> % <I> returns negative numbers that are *always* lower than
percentage. | opensoft_rollout | train | php |
d07a3a695cfc0f72d8cb063bafb058a9cafce92e | diff --git a/Migrations/DatabaseMigrationRepository.php b/Migrations/DatabaseMigrationRepository.php
index <HASH>..<HASH> 100755
--- a/Migrations/DatabaseMigrationRepository.php
+++ b/Migrations/DatabaseMigrationRepository.php
@@ -135,9 +135,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface {
{
$schema = $this->getConnection()->getSchemaBuilder();
- $prefix = $this->getConnection()->getTablePrefix();
-
- return $schema->hasTable($prefix.$this->table);
+ return $schema->hasTable($this->table);
}
/** | Fix bug in migration table builder. | illuminate_database | train | php |
ac433ef5958a983d2f4553eb28f8687a93a3cf11 | diff --git a/lib/rails-action-args/vm_args.rb b/lib/rails-action-args/vm_args.rb
index <HASH>..<HASH> 100644
--- a/lib/rails-action-args/vm_args.rb
+++ b/lib/rails-action-args/vm_args.rb
@@ -1,7 +1,9 @@
begin
require "methopara"
-rescue
- puts "make sure you have methora http://github.com/genki/methopara installed if you want to use action args on Ruby 1.9"
+rescue LoadError
+ unless RUBY_VERSION >= "1.9.2"
+ puts "make sure you have methopara (http://github.com/genki/methopara) installed if you want to use action args with Ruby < 1.9.2"
+ end
end
module GetArgs | Make vm_args ruby <I> friendly
Starting with <I>, we don't need methopara any more | adelcambre_rails-action-args | train | rb |
0bb736c39b1dfec1aaa2b3bdd14d6ba85b7fb43d | diff --git a/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarController.java b/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarController.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarController.java
+++ b/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarController.java
@@ -203,10 +203,9 @@ class CompactCalendarController {
List<CalendarDayEvent> uniqCalendarDayEvents = events.get(key);
if(uniqCalendarDayEvents == null){
uniqCalendarDayEvents = new ArrayList<>();
- }else{
- if(!uniqCalendarDayEvents.contains(event)){
- uniqCalendarDayEvents.add(event);
- }
+ }
+ if(!uniqCalendarDayEvents.contains(event)){
+ uniqCalendarDayEvents.add(event);
}
events.put(key, uniqCalendarDayEvents);
} | Fixed big where first event was not being added | SundeepK_CompactCalendarView | train | java |
74178401c348fb9eaec351951cf62ea43f3fb37c | diff --git a/warehouse/views.py b/warehouse/views.py
index <HASH>..<HASH> 100644
--- a/warehouse/views.py
+++ b/warehouse/views.py
@@ -452,6 +452,9 @@ def session_notifications(request):
renderer="includes/sidebar-sponsor-logo.html",
uses_session=False,
has_translations=False,
+ decorator=[
+ cache_control(30), # 30 seconds
+ ],
)
def sidebar_sponsor_logo(request):
return {} | Add cache_control to sidebar logo (#<I>) | pypa_warehouse | train | py |
c31cc0ad8304cd4cdb79f8893b77b5392f281708 | diff --git a/cmsplugin_cascade/bootstrap3/gallery.py b/cmsplugin_cascade/bootstrap3/gallery.py
index <HASH>..<HASH> 100644
--- a/cmsplugin_cascade/bootstrap3/gallery.py
+++ b/cmsplugin_cascade/bootstrap3/gallery.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+
from django.forms import widgets, ModelChoiceField, CharField
from django.forms.models import ModelForm
from django.db.models.fields.related import ManyToOneRel
@@ -65,7 +66,7 @@ class GalleryPluginInline(StackedInline):
model = InlineCascadeElement
raw_id_fields = ('image_file',)
form = GalleryImageForm
- extra = 0
+ extra = 1
class BootstrapGalleryPlugin(CascadePluginBase): | We need at least one extra Gallery Plugin | jrief_djangocms-cascade | train | py |
f519af38bde3b16177d87b73c0890b3986f87a52 | diff --git a/tests/TwigJs/Tests/FullIntegrationTest.php b/tests/TwigJs/Tests/FullIntegrationTest.php
index <HASH>..<HASH> 100644
--- a/tests/TwigJs/Tests/FullIntegrationTest.php
+++ b/tests/TwigJs/Tests/FullIntegrationTest.php
@@ -86,7 +86,7 @@ class FullIntegrationTest extends PHPUnit_Framework_TestCase
return $tests;
}
- private function loadTest($file)
+ public function loadTest($file)
{
$test = file_get_contents($file); | Fix another test suite fatal error to unblock the Travis build | schmittjoh_twig.js | train | php |
51ae34c4e778e838c669218be70b6fb7af45cf56 | diff --git a/serf/serf.go b/serf/serf.go
index <HASH>..<HASH> 100644
--- a/serf/serf.go
+++ b/serf/serf.go
@@ -190,13 +190,18 @@ func (s *Serf) Leave() error {
panic("Leave after Shutdown")
}
- s.memberLock.RLock()
- defer s.memberLock.RUnlock()
+ // Construct the message for the graceful leave
+ msg := messageLeave{Node: s.config.NodeName}
+
+ // Process the leave locally
+ s.handleNodeLeaveIntent(&msg)
// If we have more than one member (more than ourself), then we need
// to broadcast that we intend to gracefully leave.
+ s.memberLock.RLock()
+ defer s.memberLock.RUnlock()
+
if len(s.members) > 1 {
- msg := messageLeave{Node: s.config.NodeName}
notifyCh := make(chan struct{})
if err := s.broadcast(messageLeaveType, msg.Node, &msg, notifyCh); err != nil {
return err | serf: process leave locally right away | hashicorp_serf | train | go |
364bc6a83cf083dd45df78c129e56a8dbe0459f9 | diff --git a/openid/consumer/discover.py b/openid/consumer/discover.py
index <HASH>..<HASH> 100644
--- a/openid/consumer/discover.py
+++ b/openid/consumer/discover.py
@@ -61,10 +61,14 @@ class OpenIDServiceEndpoint(object):
return OPENID_1_0_MESSAGE_NS
def supportsType(self, type_uri):
- """Does this endpoint support this type?"""
- return ((type_uri == OPENID_2_0_TYPE and
- OPENID_IDP_2_0_TYPE in self.type_uris) or
- self.usesExtension(type_uri))
+ """Does this endpoint support this type?
+
+ I consider C{/server} endpoints to implicitly support C{/signon}.
+ """
+ return (
+ (type_uri in self.type_uris) or
+ (type_uri == OPENID_2_0_TYPE and self.isOPIdentifier())
+ )
def compatibilityMode(self):
return self.preferredNamespace() != OPENID_2_0_MESSAGE_NS | [project @ consumer.discover.OpenIDServiceEndpoint.supportsType: clarification] | openid_python-openid | train | py |
565cb4a6de3ccdef8034f19b60142d6efe44b8f0 | diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Support/Str.php
+++ b/src/Illuminate/Support/Str.php
@@ -123,7 +123,7 @@ class Str {
{
if (mb_strlen($value) <= $limit) return $value;
- return mb_substr($value, 0, $limit, 'UTF-8').$end;
+ return rtrim(mb_substr($value, 0, $limit, 'UTF-8')).$end;
}
/** | Update Str.php
Added rtrim() to remove whitespace between the truncated string and the $end string which is appended. | laravel_framework | train | php |
497c85c17c744ee7d4dca09aa7de385e0cfe1cb4 | diff --git a/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java b/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
+++ b/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
@@ -621,9 +621,6 @@ public class WithMavenStepExecution extends AbstractStepExecutionImpl {
throw new AbortException("No such computer " + node);
}
- if (computer.isOffline()) {
- throw new AbortException(node + " is offline");
- }
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Computer: {0}", computer.getName());
try { | Don't check if computer is online. | jenkinsci_pipeline-maven-plugin | train | java |
b190fcde688a72bc3156d4a2fd83e90c5f7066e0 | diff --git a/spyderlib/plugins/__init__.py b/spyderlib/plugins/__init__.py
index <HASH>..<HASH> 100644
--- a/spyderlib/plugins/__init__.py
+++ b/spyderlib/plugins/__init__.py
@@ -32,7 +32,7 @@ from spyderlib.qt.QtGui import (QDockWidget, QWidget, QShortcut, QCursor,
# Local imports
from spyderlib.utils.qthelpers import create_action, toggle_actions
from spyderlib.config.base import _
-from spyderlib.config.gui import get_font
+from spyderlib.config.gui import get_color_scheme, get_font
from spyderlib.config.main import CONF
from spyderlib.config.user import NoDefault
from spyderlib.plugins.configdialog import SpyderConfigPage
@@ -516,7 +516,11 @@ class SpyderPluginMixin(object):
if name not in names:
name = names[0]
self.set_option('color_scheme_name', name)
-
+
+ def get_color_scheme(self):
+ """Get current color scheme"""
+ return get_color_scheme(CONF.get('color_schemes', 'selected'))
+
def create_toggle_view_action(self):
"""Associate a toggle view action with each plugin"""
title = self.get_plugin_title() | Add a method to get the current color scheme to SpyderPluginMixin | spyder-ide_spyder | train | py |
22c84a3879da4cb3b54a9ef65d257ad2938cc142 | diff --git a/test/unit/index.js b/test/unit/index.js
index <HASH>..<HASH> 100644
--- a/test/unit/index.js
+++ b/test/unit/index.js
@@ -14,6 +14,12 @@ describe('StorageService', function() {
expect(record).to.be.an.instanceof(RecordService);
expect(record.getType()).to.equal('Cat');
});
+ it('should create records with ids', function() {
+ var storage = new StorageService(mockStorageProvider);
+ var record = storage.createRecord('Cat', '1');
+ expect(record).to.be.an.instanceof(RecordService);
+ expect(record.getType()).to.equal('Cat');
+ });
it('should create collections', function() {
var storage = new StorageService(mockStorageProvider);
var collection = storage.createCollection('Cat'); | test(StorageService): case new record with id | castle-dev_le-storage-service | train | js |
ba7d268fbd7b74ceb5d298ceeaa4b8fb6c54c6ec | diff --git a/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/VariantAnnotationCommandExecutor.java b/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/VariantAnnotationCommandExecutor.java
index <HASH>..<HASH> 100644
--- a/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/VariantAnnotationCommandExecutor.java
+++ b/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/VariantAnnotationCommandExecutor.java
@@ -558,7 +558,8 @@ public class VariantAnnotationCommandExecutor extends CommandExecutor {
// Use cache
- queryOptions.put("useCache", variantAnnotationCommandOptions.noCache ? "false" : "true");
+// queryOptions.put("useCache", variantAnnotationCommandOptions.noCache ? "false" : "true");
+ queryOptions.put("useCache", !variantAnnotationCommandOptions.noCache);
// input file
if (variantAnnotationCommandOptions.input != null) { | feature/vacache: minor bug fixed at VarianAnnotationCommandExecutor | opencb_cellbase | train | java |
23511d8265808618b7f60794f9659cf11776740d | diff --git a/holoviews/plotting/mpl/renderer.py b/holoviews/plotting/mpl/renderer.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/mpl/renderer.py
+++ b/holoviews/plotting/mpl/renderer.py
@@ -5,12 +5,13 @@ from tempfile import NamedTemporaryFile
from ...core import HoloMap, AdjointLayout
-from ...core.options import Store
+from ...core.options import Store, StoreOptions
from ...core.io import Exporter
from .plot import MPLPlot
from .. import MIME_TYPES
+from matplotlib import pyplot as plt
from matplotlib import animation
import matplotlib.tight_bbox as tight_bbox
from matplotlib.transforms import Bbox, TransformedBbox, Affine2D | Fixed missing imports required by MPLPlotRenderer | pyviz_holoviews | train | py |
83ff18c44924825f3cb5fd0837015de5cbf2ecc5 | diff --git a/src/Printer.php b/src/Printer.php
index <HASH>..<HASH> 100644
--- a/src/Printer.php
+++ b/src/Printer.php
@@ -52,7 +52,7 @@ class Printer extends \PHPUnit_TextUI_ResultPrinter
}
/**
- * @param string $progress Result of the Test Case => . F S I
+ * @param string $progress Result of the Test Case => . F S I R
* @throws Exception\InvalidArgumentException
*/
private function printTestCaseStatus($progress)
@@ -71,6 +71,9 @@ class Printer extends \PHPUnit_TextUI_ResultPrinter
case 'S':
echo "\033[01;31m" . mb_convert_encoding("\x27\x16", 'UTF-8', 'UTF-16BE') . "\033[0m";
return;
+ case 'R':
+ echo "\033[01;31m" . mb_convert_encoding("\x27\x12", 'UTF-8', 'UTF-16BE') . "\033[0m";
+ return;
default:
throw new InvalidArgumentException(sprintf(
'Can not print status for "%s" in %s', | Added display case for Risky Tests | zf2timo_PHPUnitPrettyResultPrinter | train | php |
bdf4bc8f3aeaf05028e3233f38e941cd415fe103 | diff --git a/lib/gcloud/datastore/errors.rb b/lib/gcloud/datastore/errors.rb
index <HASH>..<HASH> 100644
--- a/lib/gcloud/datastore/errors.rb
+++ b/lib/gcloud/datastore/errors.rb
@@ -32,27 +32,6 @@ module Gcloud
end
##
- # # ApiError
- #
- # Raised when an API call is not successful.
- class ApiError < Gcloud::Datastore::Error
- ##
- # The API method of the failed HTTP request.
- attr_reader :method
-
- ##
- # The response object of the failed HTTP request.
- attr_reader :response
-
- # @private
- def initialize method, response = nil
- super("API call to #{method} was not successful")
- @method = method
- @response = response
- end
- end
-
- ##
# # PropertyError
#
# Raised when a property is not correct. | Remove Datastore ApiError
This error is no longer needed since the GRPC errors are handled differently. | googleapis_google-cloud-ruby | train | rb |
82a5244cc079d3ef1d29a3620dcf7fe8493f7e67 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -73,6 +73,7 @@ var startPlayback = function(pos) {
player.playedQueue.push(player.queue[0]);
+ player.playbackPosition = null;
player.playbackStart = null;
player.queue[0] = null;
player.songEndTimeout = null;
@@ -250,6 +251,7 @@ var removeFromQueue = function(pos, cnt) {
if(pos <= 0) {
// now playing was deleted
+ player.playbackPosition = null;
player.playbackStart = null;
clearTimeout(player.songEndTimeout);
player.songEndTimeout = null;
diff --git a/plugins/rest.js b/plugins/rest.js
index <HASH>..<HASH> 100644
--- a/plugins/rest.js
+++ b/plugins/rest.js
@@ -69,6 +69,8 @@ rest.init = function(_player, callback, errCallback) {
break;
}
+ player.playbackPosition = null;
+ player.playbackStart = null;
clearTimeout(player.songEndTimeout);
player.songEndTimeout = null;
player.onQueueModify(); | set playbackPosition and playbackStart to null at song end | FruitieX_nodeplayer | train | js,js |
b57548a836b8db05dd467c42017645d34b198726 | diff --git a/lib/flowlink_data/objectbase.rb b/lib/flowlink_data/objectbase.rb
index <HASH>..<HASH> 100644
--- a/lib/flowlink_data/objectbase.rb
+++ b/lib/flowlink_data/objectbase.rb
@@ -40,7 +40,7 @@ module Flowlink
Hash[f_methods.map { |f| [f.method_name.to_s, send(*f.to_a)] }]
end
- alias_method to_message to_hash
+ alias to_message to_hash
def self.fields
# A list of fields that the object should have. | alias_method -> alias. alias_method wasn't working | aokpower_flowlink_data | train | rb |
842e101196337cf140d06a5b3c20d4a455d63c29 | diff --git a/java/src/com/google/template/soy/AbstractSoyCompiler.java b/java/src/com/google/template/soy/AbstractSoyCompiler.java
index <HASH>..<HASH> 100644
--- a/java/src/com/google/template/soy/AbstractSoyCompiler.java
+++ b/java/src/com/google/template/soy/AbstractSoyCompiler.java
@@ -15,7 +15,6 @@
*/
package com.google.template.soy;
-
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
@@ -158,6 +157,15 @@ public abstract class AbstractSoyCompiler {
private List<File> cssSummaries = new ArrayList<>();
@Option(
+ name = "--cssMetadata",
+ aliases = "--cssMetadata",
+ usage =
+ "List of css metadata files used to check strict deps against css dependencies and css()"
+ + " calls. This will eventually replace --cssSummaries",
+ handler = SoyCmdLineParser.FileListOptionHandler.class)
+ private List<File> cssMetadata = new ArrayList<>();
+
+ @Option(
name = "--enableExperimentalFeatures",
usage =
"Enable experimental features that are not generally available. " | Add the ability to read in CssMetadata protos from []. When they are passed in (the build wiring doesn't exist yet), it takes over what cssRegistry is supposed to do, but otherwise does the same thing functionally. Verifying css() calls is next
GITHUB_BREAKING_CHANGES=n/a
-------------
Created by MOE: <URL> | google_closure-templates | train | java |
7c2b592e74b4920279c777ac128f607901357ecd | diff --git a/lib/cql/version.rb b/lib/cql/version.rb
index <HASH>..<HASH> 100644
--- a/lib/cql/version.rb
+++ b/lib/cql/version.rb
@@ -1,3 +1,3 @@
module CQL
- VERSION = '1.3.0'
+ VERSION = '1.4.0'
end | Version bump.
Increased the gem version to <I> in preparation for the upcoming
release. | enkessler_cql | train | rb |
488986c5d47bdac413e590d8fb96dd86242d69ec | diff --git a/suds/cache.py b/suds/cache.py
index <HASH>..<HASH> 100644
--- a/suds/cache.py
+++ b/suds/cache.py
@@ -167,16 +167,6 @@ class FileCache(Cache):
log.debug(id, exc_info=1)
return data
- def setlocation(self, location):
- """
- Set the cached file location (folder).
-
- @param location: The cached file folder.
- @type location: str
-
- """
- self.location = location
-
def _getf(self, id):
"""Open a cached file with the given id for reading."""
try: | remove FileCache.setlocation()
This method was never used inside suds and if used externally would have caused
the cache to use a specific folder but without making sure that the data already
stored in it has been prepared for the correct suds version, as done when
passing a location parameter to the FileCache constructor. | ovnicraft_suds2 | train | py |
5cf2868b92e2f31a20823960d0680e09f0300495 | diff --git a/Kwf/Acl.php b/Kwf/Acl.php
index <HASH>..<HASH> 100644
--- a/Kwf/Acl.php
+++ b/Kwf/Acl.php
@@ -291,6 +291,8 @@ class Kwf_Acl extends Zend_Acl
*/
public function loadKwcResources()
{
+ if (!Kwf_Registry::get('db')) return; //if we don't have a db configured yet skip kwc resources. required to be able to build assets without db
+
if ($this->_kwcResourcesLoaded) return;
$this->_kwcResourcesLoaded = true; | if we don't have a db configured yet skip kwc resources
required to be able to build assets without db | koala-framework_koala-framework | train | php |
0b706f311606e8407105cc1146422d8ba5ea5452 | diff --git a/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java b/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
+++ b/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
@@ -373,6 +373,18 @@ public class Drawer {
}
/**
+ * sets the gravity for this drawer.
+ *
+ * @param gravity the gravity which is defined for the drawer
+ */
+ public void setGravity(int gravity) {
+ DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) getSlider().getLayoutParams();
+ params.gravity = gravity;
+ getSlider().setLayoutParams(params);
+ mDrawerBuilder.mDrawerGravity = gravity;
+ }
+
+ /**
* calculates the position of an drawerItem. searching by it's identifier
*
* @param drawerItem | * add new method to update the gravity of the drawer programatically
* FIX #<I> | mikepenz_MaterialDrawer | train | java |
f826f0fe3aa776ac296cfeef4785f5031552caca | diff --git a/aioworkers/cli.py b/aioworkers/cli.py
index <HASH>..<HASH> 100644
--- a/aioworkers/cli.py
+++ b/aioworkers/cli.py
@@ -66,6 +66,7 @@ def main(*config_files, args=None, config_dirs=(),
context.config.search_dirs.extend(config_dirs)
plugins = plugin.search_plugins()
+ plugins.extend(plugin.search_plugins(*commands, force=True))
for i in plugins:
i.add_arguments(parser) | Force search plugins from cli.main param | aioworkers_aioworkers | train | py |
a9b853c8996b50479f4655f9f66cf0e4e93796ec | diff --git a/lib/protocol/READ_WRITE_MULTIPLE_REGISTERS.js b/lib/protocol/READ_WRITE_MULTIPLE_REGISTERS.js
index <HASH>..<HASH> 100644
--- a/lib/protocol/READ_WRITE_MULTIPLE_REGISTERS.js
+++ b/lib/protocol/READ_WRITE_MULTIPLE_REGISTERS.js
@@ -1,7 +1,7 @@
var Helpers = require("../Helpers");
var Buff = require("../Buffer");
-exports.code = 0x10;
+exports.code = 0x17;
exports.buildRequest = function (read_address, read_quantity, write_address, values) {
var buffer = Buff.alloc(9 + (values.length * 2)); | fixes function code for read-write-multiple-registers :( | node-modbus_pdu | train | js |
41f2367ab533b5e46b78d3ff808151227dcaad5a | diff --git a/web/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php b/web/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php
index <HASH>..<HASH> 100644
--- a/web/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php
+++ b/web/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php
@@ -74,8 +74,8 @@ class Concrete5_Controller_Dashboard_System_BackupRestore_Backup extends Dashboa
if (!is_null($str_fname) && trim($str_fname) != "" && !preg_match('/\.\./',$str_fname)) {
$fullFilename = DIR_FILES_BACKUPS . "/$str_fname";
if(is_file($fullFilename)) {
- @chmod(DIR_FILES_BACKUPS . "/$str_fname", 666);
- @unlink(DIR_FILES_BACKUPS . "/$str_fname");
+ @chmod($fullFilename, 666);
+ @unlink($fullFilename);
if(is_file($fullFilename)) {
$this->error->add(t('Error deleting the file %s.', $str_fname) . ' ' . t('Please check the permissions of the folder %s', DIR_FILES_BACKUPS));
} | Let's simplify the code a bit
Those lines didn't found a way from my head to my hands... ;)
Former-commit-id: 6d5aa<I>b<I>af<I>ea<I>cede8e9fc5e | concrete5_concrete5 | train | php |
27e26d97aa6b4f77fdc09cf7e89e8966f93d6ec3 | diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php
index <HASH>..<HASH> 100644
--- a/system/Debug/Exceptions.php
+++ b/system/Debug/Exceptions.php
@@ -461,7 +461,7 @@ class Exceptions
$source = array_splice($source, $start, $lines, true);
// Used to format the line number in the source
- $format = '% ' . strlen(sprintf('%sd', $start + $lines));
+ $format = '% ' . strlen(sprintf('%s', $start + $lines)) . 'd';
$out = '';
// Because the highlighting may have an uneven number | [ci skip] Fix line numbering in Debug/Exceptions | codeigniter4_CodeIgniter4 | train | php |
aed9b9ebcc156d2ebf0eb4e91baea6fb1af5d916 | diff --git a/lib/commands/external.js b/lib/commands/external.js
index <HASH>..<HASH> 100644
--- a/lib/commands/external.js
+++ b/lib/commands/external.js
@@ -39,7 +39,7 @@ class ExternalCommand {
const commandToBeRun = `${packageManager} ${options.join(' ')}`;
process.cliLogger.error(`The command moved into a separate package: ${chalk.keyword('orange')(name)}\n`);
const question = `Would you like to install ${name}? (That will run ${chalk.green(commandToBeRun)})`;
- const answer = await prompt([
+ const { installConfirm } = await prompt([
{
type: 'confirm',
name: 'installConfirm',
@@ -48,7 +48,7 @@ class ExternalCommand {
choices: ['Yes', 'No', 'Y', 'N', 'y', 'n'],
},
]);
- if (answer.installConfirm === true) {
+ if (installConfirm === true) {
await ExternalCommand.runCommand(commandToBeRun);
return ExternalCommand.validateEnv(name);
} | chore: Minor code refactor adhering to ES6 semantics (#<I>)
* chore: use object destructuring
* chore: remove unwanted explicit boolean check
* chore: use object destructuring assignment
* chore: minor refactor
* chore: revert
* chore: revert
* chore: minor tweak
* chore: revert | webpack_webpack-cli | train | js |
177e0aaebdfb981774cf5d726eb93cc79ea3fb22 | diff --git a/visidata/editor.py b/visidata/editor.py
index <HASH>..<HASH> 100644
--- a/visidata/editor.py
+++ b/visidata/editor.py
@@ -18,7 +18,7 @@ class SuspendCurses:
curses.doupdate()
[email protected]
[email protected]_api
def launchEditor(vd, *args):
editor = os.environ.get('EDITOR') or fail('$EDITOR not set')
args = [editor] + list(args)
@@ -26,7 +26,7 @@ def launchEditor(vd, *args):
return subprocess.call(args)
[email protected]
[email protected]_api
def launchExternalEditor(vd, v, linenum=0):
import tempfile
with tempfile.NamedTemporaryFile() as temp: | [editor-] launchEditor is part of global_api | saulpw_visidata | train | py |
5f636bc466b34de0bc0645be208f030e69499259 | diff --git a/spec/ooor_spec.rb b/spec/ooor_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/ooor_spec.rb
+++ b/spec/ooor_spec.rb
@@ -112,7 +112,7 @@ describe Ooor do
end
it "should load required models on the fly" do
- SaleOrder.find(1).shop_id.should be_kind_of(SaleShop)
+ ProductProduct.find(:first).categ_id.should be_kind_of(ProductCategory)
end
it "should be able to specify the fields to read" do | test fix: no more sale shop model since Odoo <I> | akretion_ooor | train | rb |
f9a02de35f2ce0220e4d33cdfefecea458214b0a | diff --git a/src/Pho/Compiler/Inspector.php b/src/Pho/Compiler/Inspector.php
index <HASH>..<HASH> 100644
--- a/src/Pho/Compiler/Inspector.php
+++ b/src/Pho/Compiler/Inspector.php
@@ -41,34 +41,14 @@ class Inspector
/**
* Documents all available objects and their methods.
+ *
+ * @todo incomplete
*
* @return string
*/
public function document(): string
{
- $locator = new ClassFileLocator($this->folder);
- foreach ($locator as $file) {
- $filename = str_replace($this->folder . DIRECTORY_SEPARATOR, '', $file->getRealPath());
- foreach ($file->getClasses() as $class) {
- $reflector = new \ReflectionClass($class);
- $parent = $reflector->getParentClass()->getName();
- $class_name = $reflector->getShortName();
- switch($parent) {
- case "Pho\Framework\Object":
- break;
- case "Pho\Framework\Actor":
- break;
- case "Pho\Framework\Frame":
- break;
- default:
- $ignored_classes[] = [
- "filename" => $filename,
- "classname" => $class_name
- ];
- break;
- }
- }
- }
+ // this will use an outside library
}
/** | documentor will be handled by an ext lib. but the arch changes are good to merge | phonetworks_pho-compiler | train | php |
af8985d10d7c98f56a42683dc497cef0d8b452c2 | diff --git a/rails/init.rb b/rails/init.rb
index <HASH>..<HASH> 100644
--- a/rails/init.rb
+++ b/rails/init.rb
@@ -1,5 +1,9 @@
-# to_prepare is called before each request in development mode and the first request in production
# See http://groups.google.com/group/mongomapper/browse_thread/thread/68f62e8eda43b43a/4841dba76938290c
+#
+# This is only for development mode. You will still want to clear the identity map before each request in production.
+# See examples/identity_map for more on this.
+#
+# to_prepare is called before each request in development mode and the first request in production.
Rails.configuration.to_prepare do
if Rails.configuration.cache_classes
MongoMapper::Plugins::IdentityMap.clear | Add more notes for rails/init.rb | mongomapper_mongomapper | train | rb |
5742e8bc0e308b23c6257fac03059e43af002aec | diff --git a/tests/supervisors/test_statreload.py b/tests/supervisors/test_statreload.py
index <HASH>..<HASH> 100644
--- a/tests/supervisors/test_statreload.py
+++ b/tests/supervisors/test_statreload.py
@@ -1,6 +1,6 @@
import os
import signal
-import sys
+import time
from pathlib import Path
import pytest
@@ -26,10 +26,6 @@ def test_statreload():
reloader.run()
[email protected](
- sys.platform.startswith("win"),
- reason="Skipping reload test on Windows, due to low mtime resolution.",
-)
def test_should_reload(tmpdir):
update_file = Path(os.path.join(str(tmpdir), "example.py"))
update_file.touch()
@@ -43,6 +39,7 @@ def test_should_reload(tmpdir):
reloader.startup()
assert not reloader.should_restart()
+ time.sleep(0.1)
update_file.touch()
assert reloader.should_restart() | More resiliant reload test (#<I>) | encode_uvicorn | train | py |
ac2ea1796c61120f34697161f0545f03aded41ea | diff --git a/server/sonar-main/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java b/server/sonar-main/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java
index <HASH>..<HASH> 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import org.junit.AfterClass;
+import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.DisableOnDebug;
@@ -70,8 +70,8 @@ public class HazelcastClusterTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
- @AfterClass
- public static void closeHazelcastClients() {
+ @After
+ public void closeHazelcastClients() {
closeAllHazelcastClients();
} | Make HazelcastClusterTest more robust. | SonarSource_sonarqube | train | java |
73a6e2dffcc6df88328e35c7ff27e179900ff92d | diff --git a/irclib.py b/irclib.py
index <HASH>..<HASH> 100644
--- a/irclib.py
+++ b/irclib.py
@@ -1358,7 +1358,7 @@ def parse_nick_modes(mode_string):
Example:
- >>> irclib.parse_nick_modes(\"+ab-c\")
+ >>> parse_nick_modes(\"+ab-c\")
[['+', 'a', None], ['+', 'b', None], ['-', 'c', None]]
"""
@@ -1373,7 +1373,7 @@ def parse_channel_modes(mode_string):
Example:
- >>> irclib.parse_channel_modes(\"+ab-c foo\")
+ >>> parse_channel_modes(\"+ab-c foo\")
[['+', 'a', None], ['+', 'b', 'foo'], ['-', 'c', None]]
""" | Updated doctests to run | jaraco_irc | train | py |
c0cf0526c0752fec5e6e8c3933164c3ecc9e2e58 | diff --git a/application/tests/_ci_phpunit_test/CIPHPUnitTest.php b/application/tests/_ci_phpunit_test/CIPHPUnitTest.php
index <HASH>..<HASH> 100644
--- a/application/tests/_ci_phpunit_test/CIPHPUnitTest.php
+++ b/application/tests/_ci_phpunit_test/CIPHPUnitTest.php
@@ -57,7 +57,13 @@ class CIPHPUnitTest
require_once BASEPATH . 'core/CodeIgniter.php';
} catch (CIPHPUnitTestShow404Exception $e) {
// Catch 404 exception
- ob_end_clean();
+ // if statement below is needed. If there is not, following error
+ // ocurrs when you use `@runInSeparateProcess`
+ // ob_end_clean(): failed to delete buffer. No buffer to deleteF
+ if (ob_get_length() > 0 )
+ {
+ ob_end_clean();
+ }
new CI_Controller();
} | Fix bug that "ob_end_clean(): failed to delete buffer" error occurs when you use @runInSeparateProcess | kenjis_ci-phpunit-test | train | php |
3bccf407da799f5d21805ea8c2e9018dcece6caa | diff --git a/lib/splitters/s3StreamSplitter.js b/lib/splitters/s3StreamSplitter.js
index <HASH>..<HASH> 100644
--- a/lib/splitters/s3StreamSplitter.js
+++ b/lib/splitters/s3StreamSplitter.js
@@ -35,7 +35,7 @@ class s3StreamSplitter extends StreamSplitter {
if (error) {
return this._ctx.parent.emit('error', error)
}
- return this._ctx.parent.emit('log', jsonParser.stringify({ event: 'File Uploaded!', ...data }, this._ctx.parent))
+ return this._ctx.parent.emit('debug', jsonParser.stringify({ event: 'File Uploaded!', ...data }, this._ctx.parent))
})
return _throughStream
diff --git a/lib/transports/s3.js b/lib/transports/s3.js
index <HASH>..<HASH> 100644
--- a/lib/transports/s3.js
+++ b/lib/transports/s3.js
@@ -120,7 +120,7 @@ class s3 extends base {
if (error) {
return this.parent.emit('error', error)
}
- return this.parent.emit('log', jsonParser.stringify({ event: 'File Uploaded!', ...data }, this.parent))
+ return this.parent.emit('debug', jsonParser.stringify({ event: 'File Uploaded!', ...data }, this.parent))
})
this.stream.pipe(_throughStream) | switch upload trace log level to debug | taskrabbit_elasticsearch-dump | train | js,js |
Subsets and Splits