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 |
|---|---|---|---|---|---|
941227458857d0bbe9dfddf739d1c844eb7f5eae | diff --git a/lib/active_record/postgresql_extensions/version.rb b/lib/active_record/postgresql_extensions/version.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/postgresql_extensions/version.rb
+++ b/lib/active_record/postgresql_extensions/version.rb
@@ -1,7 +1,7 @@
module ActiveRecord
module PostgreSQLExtensions
- VERSION = "0.0.13.dev"
+ VERSION = "0.1.0"
end
end | Bump to version <I>. | dark-panda_activerecord-postgresql-extensions | train | rb |
741755deb348b0274a850f727365ea9d42517f57 | diff --git a/src/Http/Controllers/Api/KeyController.php b/src/Http/Controllers/Api/KeyController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/Api/KeyController.php
+++ b/src/Http/Controllers/Api/KeyController.php
@@ -98,28 +98,23 @@ class KeyController extends Controller
// Get or create the API Key
$api_key = ApiKeyModel::firstOrCreate([
- 'key_id' => $request->input('key_id')
+ 'key_id' => $request->input('key_id'),
]);
// Set the current user as the owner of the key
// and enable it.
$api_key->fill([
- 'v_code' => $request->input('v_code'),
+ 'v_code' => $request->input('v_code'),
'user_id' => auth()->user()->id,
'enabled' => true,
]);
$api_key->save();
- // Get a fresh instance of the API Key so that
- // we can have a fully populated JobContainer
- // instance to send to the queue.
- $api_key = ApiKeyModel::find(
- $request->input('key_id'));
-
+ // Prepare the JonContainer for the update job
$job->scope = 'Key';
$job->api = 'Scheduler';
- $job->owner_id = $request->input('key_id');
+ $job->owner_id = $api_key->key_id;
$job->eve_api_key = $api_key;
// Queue the update Job | Remove unnecessary re-fetch of model data | eveseat_web | train | php |
4442b3f2df05f8e51e6047569603c1b130e8118a | diff --git a/digitalocean/v2/digitalocean/droplets.go b/digitalocean/v2/digitalocean/droplets.go
index <HASH>..<HASH> 100644
--- a/digitalocean/v2/digitalocean/droplets.go
+++ b/digitalocean/v2/digitalocean/droplets.go
@@ -59,6 +59,7 @@ type CreateDroplet struct {
Backups bool `json:"backups,omitempty"`
IPv6 bool `json:"ipv6,omitempty"`
PrivateNetworking bool `json:"private_networking,omitempty"`
+ UserData string `json:"user_data,omitempty"`
}
func (c *CreateDroplet) Execute(client *Client) (*DropletResponse, error) { | add mapping for Userdata when creating droplets | dynport_gocloud | train | go |
1b50171bd56b40ed0bbbdc3e9b5d2beea927221b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ except Exception as e:
tests_require = [
'coverage==4.2b1',
'flake8==2.5.4',
- 'hypothesis==3.4.0',
+ 'hypothesis==3.4.1',
'hypothesis-pytest==0.19.0',
'py==1.4.31',
'pydocstyle==1.0.0', | update to latest hypothesis (<I>) | jab_bidict | train | py |
003089e2e299033d094ae26b90b08d5b5402d25b | diff --git a/src/tweenjs/Tween.js b/src/tweenjs/Tween.js
index <HASH>..<HASH> 100644
--- a/src/tweenjs/Tween.js
+++ b/src/tweenjs/Tween.js
@@ -876,6 +876,7 @@ this.createjs = this.createjs||{};
for (i = 0, l = plugins.length; i < l; i++) {
if ((oldValue = plugins[i].init(this, n, oldValue)) === Tween.IGNORE) {
(ignored = ignored || {})[n] = true;
+ delete(stepProps[n]);
break;
};
} | Fix for returning IGNORE in plugin.init | CreateJS_TweenJS | train | js |
a7bca9d872ee3dad060fec5b7a12b047eb42eda9 | diff --git a/src/services/datasourceshelper.js b/src/services/datasourceshelper.js
index <HASH>..<HASH> 100644
--- a/src/services/datasourceshelper.js
+++ b/src/services/datasourceshelper.js
@@ -119,7 +119,7 @@ ngeo.DataSourcesHelper = class {
goog.asserts.assert(
featureType.complexType[0].name === element.type);
- const complexContent = featureType.complexType[0].complexContent;
+ const complexContent = featureType['complexType'][0]['complexContent'];
const attributes = new ngeo.format.WFSAttribute().read(complexContent);
// Set the attributes in the data source | Filter - Fix unwanted renaming in min. build | camptocamp_ngeo | train | js |
9af83dcb04728ac7df64a3f3fa8a18407936dcfc | diff --git a/source/Components/ORM/Selector.php b/source/Components/ORM/Selector.php
index <HASH>..<HASH> 100644
--- a/source/Components/ORM/Selector.php
+++ b/source/Components/ORM/Selector.php
@@ -161,6 +161,8 @@ class Selector extends AbstractSelectQuery
* Include relation or relation chain into select query to be used for filtering purposes. Relation
* data will be joined using INNER method which will skip parent records without associated child.
*
+ * Attention, with() method WILL NOT load relation data, it will only make it accessible in query.
+ *
* By default all joined tables will be aliases under their relation name, sub relations will
* include name of their parent. You can specify your own alias using "alias" option.
*
@@ -253,7 +255,6 @@ class Selector extends AbstractSelectQuery
* ]);
*
* Attention, you will not be able to correctly paginate in this case.
- * You can easily combine with() and load() methods together.
*
* //Load all users with approved comments and pre-load all their comments
* User::find()->with('comments')->where('comments.approved', true)
@@ -277,6 +278,7 @@ class Selector extends AbstractSelectQuery
* User::find()->with('comments', ['alias' => 'comm'])->where('comm.approved', true)
* ->load('comments', ['using' => 'comm']);
*
+ * @see with()
* @param string $relation
* @param array $options
* @return static | with() and load() method comments. | spiral_security | train | php |
b3a50fc0917c352cd6651bc6dc610b477bfc1b78 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -269,6 +269,9 @@ class build_ext(dftbuild_ext):
if self.use_cpp_0x:
ext.extra_compile_args += ['-std=c++0x']
ext.define_macros += [('PYTANGO_HAS_UNIQUE_PTR', '1')]
+ ext.extra_compile_args += ['-Wno-unused-variable',
+ '-Wno-deprecated-declarations',
+ '-Wno-maybe-uninitialized']
dftbuild_ext.build_extension(self, ext) | Hide compilation warnings from boost and 0MQ | tango-controls_pytango | train | py |
f27d831d3bc4f3088b586dca726f75c561b0fab3 | diff --git a/lib/yap/shell/prompt.rb b/lib/yap/shell/prompt.rb
index <HASH>..<HASH> 100644
--- a/lib/yap/shell/prompt.rb
+++ b/lib/yap/shell/prompt.rb
@@ -32,7 +32,7 @@ module Yap::Shell
end
end
- def redraw_left_prompt(text)
+ def redraw_prompt(text)
@text = text
end
@@ -106,7 +106,8 @@ module Yap::Shell
@renderer = PromptRenderer.new(text:prompt.text)
@events = []
- @prompt.on(:left_text_update){ |text| @events << [:redraw_left_prompt, text] }
+ @prompt.on(:immediate_text_update){ |text| @renderer.redraw_prompt text }
+ @prompt.on(:text_update){ |text| @events << [:redraw_prompt, text] }
@prompt.on(:right_text_update){ |text| @events << [:redraw_right_prompt, text] }
@thr = Thread.new do
@@ -153,6 +154,7 @@ module Yap::Shell
def update
if @blk
@text = @blk.call
+ emit :immediate_text_update, text
end
self
end | When a Prompt#update is called immediately redraw the (left) prompt.
This is to support the REPL initiating an update after a command is executed. | zdennis_yap-shell-core | train | rb |
c01c3556a86fa410051874dcdaa7966ac97f654b | diff --git a/drivers/python2/rethinkdb/net.py b/drivers/python2/rethinkdb/net.py
index <HASH>..<HASH> 100644
--- a/drivers/python2/rethinkdb/net.py
+++ b/drivers/python2/rethinkdb/net.py
@@ -109,7 +109,7 @@ class QueryError(StandardError):
max_line_length = 80
min_line_length = 40
while start < len(query_str):
- if len(query_str) < max_line_length - len(prefix):
+ if len(query_str) - start < max_line_length - len(prefix):
count = len(query_str)
else:
# Try to put the next line break on a space, but only if the | Fix minor glitch in pretty-printing algorithm. | rethinkdb_rethinkdb | train | py |
a94e33b99a8330c90c56128e430ffc55c507d304 | diff --git a/tests/functional/WebDriverActionsTest.php b/tests/functional/WebDriverActionsTest.php
index <HASH>..<HASH> 100644
--- a/tests/functional/WebDriverActionsTest.php
+++ b/tests/functional/WebDriverActionsTest.php
@@ -140,6 +140,7 @@ class WebDriverActionsTest extends WebDriverTestCase
* @covers ::__construct
* @covers ::dragAndDrop
* @covers ::perform
+ * @group exclude-saucelabs
*/
public function testShouldDragAndDrop()
{ | Exclude unstable drag and drop test on SauceLabs | facebook_php-webdriver | train | php |
c679f7a75f56d6d920d4bce4936862bed7fab480 | diff --git a/spark/components/accordions/react/SprkAccordionItem.js b/spark/components/accordions/react/SprkAccordionItem.js
index <HASH>..<HASH> 100644
--- a/spark/components/accordions/react/SprkAccordionItem.js
+++ b/spark/components/accordions/react/SprkAccordionItem.js
@@ -98,23 +98,23 @@ SprkAccordionItem.defaultProps = {
};
SprkAccordionItem.propTypes = {
- // Content for the item
+ /** Content for the item */
children: PropTypes.node,
- // Value for the data-analytics attribute on the accordion trigger
+ /** Value for the data-analytics attribute on the accordion trigger */
analyticsString: PropTypes.string,
- // The item heading
+ /** The item heading */
heading: PropTypes.string.isRequired,
- // Additional classes for the heading
+ /** Additional classes for the heading */
headingAddClasses: PropTypes.string,
- // Additional classes for the item
+ /** Additional classes for the item */
additionalClasses: PropTypes.string,
- // The data-id value for the accordion item
+ /** The data-id value for the accordion item */
idString: PropTypes.string,
- // Used to specify whether the item should be open by default
+ /** Used to specify whether the item should be open by default */
isDefaultOpen: PropTypes.bool,
- // Additional classes for the toggle icon
+ /** Additional classes for the toggle icon */
iconAddClasses: PropTypes.string,
- // Additional classes for the toggle content
+ /** Additional classes for the toggle content */
contentAddClasses: PropTypes.string,
}; | Update comments for SprkAccordionItem | sparkdesignsystem_spark-design-system | train | js |
c7fcd85eca86279b8c67d4eb7c47b6e3277440aa | diff --git a/cloud_browser/cloud/rackspace.py b/cloud_browser/cloud/rackspace.py
index <HASH>..<HASH> 100644
--- a/cloud_browser/cloud/rackspace.py
+++ b/cloud_browser/cloud/rackspace.py
@@ -259,7 +259,7 @@ class RackspaceConnection(base.CloudConnection):
kwargs['servicenet'] = True
if self.authurl:
- kwargs['authurl'] = authurl
+ kwargs['authurl'] = self.authurl
return cloudfiles.get_connection(**kwargs) # pylint: disable=W0142 | Corrected typo to use self.authurl in get_connection | ryan-roemer_django-cloud-browser | train | py |
d4c77f165d31cb0d57b223c028a076ebc0d7bafb | diff --git a/src/ansi_to_html.js b/src/ansi_to_html.js
index <HASH>..<HASH> 100644
--- a/src/ansi_to_html.js
+++ b/src/ansi_to_html.js
@@ -376,10 +376,18 @@ function tokenize(text, options, callback) {
var results1 = [];
var length = text.length;
+ outer:
while (length > 0) {
for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) {
handler = tokens[i];
process(handler, i);
+
+ if (text.length !== length) {
+ // We matched a token and removed it from the text. We need to
+ // start matching *all* tokens against the new text.
+ length = text.length;
+ continue outer;
+ }
}
if (text.length === length) { | Fixes #<I> - Restart token matching after a token is found and removed | rburns_ansi-to-html | train | js |
864bcbbbc7d5a78f5e7de11f16194e75a2cd27a4 | diff --git a/wptools/fetch.py b/wptools/fetch.py
index <HASH>..<HASH> 100644
--- a/wptools/fetch.py
+++ b/wptools/fetch.py
@@ -120,10 +120,7 @@ class WPToolsFetch(object):
if not self.silent:
print(self.status_line(), file=sys.stderr)
- try:
- return self.curl_perform(crl)
- except pycurl.error as detail:
- raise RuntimeError("pycurl error %d %s" % (detail[0], detail[1]))
+ return self.curl_perform(crl)
def curl_perform(self, crl):
""" | allow pycurl exceptions for now | siznax_wptools | train | py |
6d97e1207fcc4726579470eaafa544c0ee3a8bf7 | diff --git a/lib/not_native_gem_checker.rb b/lib/not_native_gem_checker.rb
index <HASH>..<HASH> 100644
--- a/lib/not_native_gem_checker.rb
+++ b/lib/not_native_gem_checker.rb
@@ -6,10 +6,21 @@ require 'gem_checker'
class NotNativeGemChecker < GemChecker
def NotNativeGemChecker.check?(gem)
result = nil
- gem_uri = "#{gem.gems_url}/#{gem.name}-#{gem.version}.gem"
+ gem_uri = URI.parse("#{gem.gems_url}/#{gem.name}-#{gem.version}.gem" )
+ uri_debug = gem_uri.clone
+ uri_debug.password = "********" if uri_debug.password
+ Utils::log_debug "download #{@name} from #{uri_debug}"
begin
- source = open(gem_uri, Gem.binary_mode) do |io|
- result = Gem::Format.from_io io
+ if gem_uri.user && gem_uri.password
+ source = open(gem_uri.scheme + "://" + gem_uri.host + "/" + gem_uri.path,
+ Gem.binary_mode,
+ :http_basic_authentication=>[gem_uri.user, gem_uri.password]) do |io|
+ result = Gem::Format.from_io io
+ end
+ else
+ source = open(gem_uri, Gem.binary_mode) do |io|
+ result = Gem::Format.from_io io
+ end
end
rescue IOError
#bug on open-uri:137 on closing strings | add support for http authentication to not native gem checker | jordimassaguerpla_gems-status | train | rb |
cd804c058a237c0510e700390ee38c60dba07810 | diff --git a/salmonella/static/salmonella/js/salmonella.js b/salmonella/static/salmonella/js/salmonella.js
index <HASH>..<HASH> 100644
--- a/salmonella/static/salmonella/js/salmonella.js
+++ b/salmonella/static/salmonella/js/salmonella.js
@@ -84,7 +84,7 @@ function dismissRelatedLookupPopup(win, chosenId) {
});
// Fire the event to update the solmonella fields on loads
- django.jQuery(".vManyToManyRawIdAdminField").trigger('change');
- django.jQuery(".vForeignKeyRawIdAdminField").trigger('change');
+ $(".vManyToManyRawIdAdminField").trigger('change');
+ $(".vForeignKeyRawIdAdminField").trigger('change');
});
})(django.jQuery); | Use either $ or django.jQuery but not mixed. | lincolnloop_django-dynamic-raw-id | train | js |
b33717a4b12cadc0e6fd9176055572cc3581ab2d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,14 @@ import itertools
import subprocess
import setuptools
+# bug: http://bugs.python.org/issue1222585
+# workaround: http://stackoverflow.com/questions/8106258
+from distutils.sysconfig import get_config_var
+_UNWANTED_OPTS = frozenset(['-Wstrict-prototypes'])
+os.environ['OPT'] = ' '.join(
+ _ for _ in get_config_var('OPT').strip().split() if _ not in _UNWANTED_OPTS
+)
+
from distutils.core import setup, Extension
from distutils.command.build import build
from distutils.command.clean import clean | added workaround for the strict-prototypes warning | crs4_pydoop | train | py |
09ffebd8a13e67913a2a79c730952494dac528ec | diff --git a/tests/src/rules/no-unresolved.js b/tests/src/rules/no-unresolved.js
index <HASH>..<HASH> 100644
--- a/tests/src/rules/no-unresolved.js
+++ b/tests/src/rules/no-unresolved.js
@@ -69,6 +69,21 @@ ruleTester.run('no-unresolved', rule, {
test({ code: 'require(["./does-not-exist"])'
, options: [{ amd: true }]}),
test({ code: 'define(["./does-not-exist"], function (bar) {})' }),
+
+ // stress tests
+ test({ code: 'require("./does-not-exist", "another arg")'
+ , options: [{ commonjs: true, amd: true }]}),
+ test({ code: 'proxyquire("./does-not-exist")'
+ , options: [{ commonjs: true, amd: true }]}),
+ test({ code: '(function() {})("./does-not-exist")'
+ , options: [{ commonjs: true, amd: true }]}),
+ test({ code: 'define([0, foo], function (bar) {})'
+ , options: [{ amd: true }]}),
+ test({ code: 'require(0)'
+ , options: [{ commonjs: true }]}),
+ test({ code: 'require(foo)'
+ , options: [{ commonjs: true }]}),
+
],
invalid: [ | testing no-unresolved edge cases | benmosher_eslint-plugin-import | train | js |
7f51d96c38deb36b0b9e0a97fe7adbadfeed0ce0 | diff --git a/router.go b/router.go
index <HASH>..<HASH> 100644
--- a/router.go
+++ b/router.go
@@ -5,7 +5,6 @@
package goserv
import (
- "fmt"
"net/http"
)
@@ -101,15 +100,13 @@ func (r *Router) UseFunc(funcs ...func(ResponseWriter, *Request)) *Router {
}
func (r *Router) Mount(prefix string, router *Router) *Router {
- path := fmt.Sprintf("%s%s", r.path, prefix)
-
var err error
- router.pathComponents, err = parsePrefixPath(path)
+ router.pathComponents, err = parsePrefixPath(prefix)
if err != nil {
panic(err)
}
- router.path = path
+ router.path = r.path + prefix
return r.addHandler(router)
} | Fix nested routers not matched | gotschmarcel_goserv | train | go |
f0d01453d9a4e163428530cf24ebf194c62dd1d6 | diff --git a/openpnm/utils/Workspace.py b/openpnm/utils/Workspace.py
index <HASH>..<HASH> 100644
--- a/openpnm/utils/Workspace.py
+++ b/openpnm/utils/Workspace.py
@@ -53,7 +53,8 @@ class Workspace(dict):
if name is None:
name = self._gen_name()
if name in self.keys():
- raise Exception("A project named " + name + " already exists")
+ if id(self.__instance__[name]) != id(project):
+ raise Exception("A project named " + name + " already exists")
if project in self.values():
self.pop(project.name, None)
if not isinstance(project, openpnm.utils.Project): | BUG: fixed a bug where calling proj.name = proj.name raised an exception
Calling proj.name = proj.name clearly doesn't do anything, but at least it should work! | PMEAL_OpenPNM | train | py |
ed8f0820aa87eb14b4bcaabe7f4795e2047ee605 | diff --git a/wal_e/worker/pg/wal_transfer.py b/wal_e/worker/pg/wal_transfer.py
index <HASH>..<HASH> 100644
--- a/wal_e/worker/pg/wal_transfer.py
+++ b/wal_e/worker/pg/wal_transfer.py
@@ -87,7 +87,7 @@ class WalTransferGroup(object):
self.transferer = transferer
# Synchronization and tasks
- self.wait_change = queue.Queue(maxsize=0)
+ self.wait_change = queue.Queue()
self.expect = 0
self.closed = False | Update wal_transfer.py
Modified queue to avoid spammy deprecation warnings that make it past --terse.
/usr/lib/python<I>/site-packages/wal_e/worker/pg/wal_transfer.py:<I>: DeprecationWarning: Queue(0) now equivalent to Queue(None); if you want a channel, use Channel | wal-e_wal-e | train | py |
e8551237ce2a9df180307d30b095f50e11f9bccd | diff --git a/napalm/exceptions.py b/napalm/exceptions.py
index <HASH>..<HASH> 100644
--- a/napalm/exceptions.py
+++ b/napalm/exceptions.py
@@ -16,4 +16,7 @@ class ReplaceConfigException(Exception):
pass
class MergeConfigException(Exception):
- pass
\ No newline at end of file
+ pass
+
+class SessionLockedException(Exception):
+ pass | Added new exception to indicate that a session is already locked | napalm-automation_napalm-base | train | py |
3d46e85dfc3c920b290cf2c90e09157f01cd6ab2 | diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/service/svtplay.py
+++ b/lib/svtplay_dl/service/svtplay.py
@@ -98,7 +98,7 @@ class Svtplay(Service, MetadataThumbMixin):
if "subtitleReferences" in janson:
for i in janson["subtitleReferences"]:
if i["format"] == "webvtt" and "url" in i:
- yield subtitle(copy.copy(self.config), "wrst", i["url"], output=self.output)
+ yield subtitle(copy.copy(self.config), "wrst", i["url"], "sv", output=self.output)
if "videoReferences" in janson:
if len(janson["videoReferences"]) == 0: | svtplay: add the language to the subtitle. | spaam_svtplay-dl | train | py |
2ab1551d823258d60b93d47e613f26e70ca794f3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -186,7 +186,7 @@ groups.Groups = function(options, callback) {
permissions = options.permissions;
} else {
// Base permissions list
- permissions = [ { value: 'guest', label: 'Guest' }, { value: 'edit', label: 'Editor' }, { value: 'admin', label: 'Admin: All' } ];
+ permissions = [ { value: 'guest', label: 'Guest' }, { value: 'edit', label: 'Editor' }, { value: 'admin', label: 'Admin: All' }, { value: 'edit-file', label: 'Edit: Files' } ];
// Type-specific admin permissions
var instanceTypes = self._pages.getAllInstanceTypeNames();
_.each(instanceTypes, function(type) { | "edit files" is now a separate permission that can be added to groups. This makes sense for situations where we want editable profiles etc. but not for everyone | apostrophecms-legacy_apostrophe-groups | train | js |
d4d7b2338bb39445a781cb7a1b48aed8f5da1e70 | diff --git a/js/evol.colorpicker.js b/js/evol.colorpicker.js
index <HASH>..<HASH> 100644
--- a/js/evol.colorpicker.js
+++ b/js/evol.colorpicker.js
@@ -31,7 +31,10 @@ $.widget( "evol.colorpicker", {
.after('<div class="evo-colorind'+this._ie+'"></div>')
.on('focus', function(){
that.showPalette();
- })
+ }).next().on('click', function(evt){
+ evt.stopPropagation();
+ that.showPalette();
+ })
break;
}
this._color=null;
@@ -229,13 +232,18 @@ $.widget( "evol.colorpicker", {
},
destroy: function() {
+ $(document.body).off('.colorpicker');
if(this._palette){
this._palette.off('mouseover click', 'td');
+ if(this._isPopup){
+ this._palette.remove();
+ }
this._palette=this._cTxt=null;
}
if(this._isPopup){
- this.element.unwrap().off()
- .next().remove();
+ this.element
+ .next().off('click').remove()
+ .end().off('focus').unwrap();
}
this.element.empty();
$.Widget.prototype.destroy.call(this); | Allow for clicking on color indicator + better destroy method | evoluteur_colorpicker | train | js |
31e2151ba307d4441222ecf73541a8ca32b81bc9 | diff --git a/core/src/main/java/io/undertow/protocols/http2/HpackDecoder.java b/core/src/main/java/io/undertow/protocols/http2/HpackDecoder.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/undertow/protocols/http2/HpackDecoder.java
+++ b/core/src/main/java/io/undertow/protocols/http2/HpackDecoder.java
@@ -220,7 +220,7 @@ public class HpackDecoder {
byte data = buffer.get(buffer.position());
int length = Hpack.decodeInteger(buffer, 7);
- if (buffer.remaining() < length) {
+ if (buffer.remaining() < length || length == -1) {
return null;
}
boolean huffman = (data & 0b10000000) != 0; | UNDERTOW-<I> HTTP/2 HPack does not correctly deal with header value length if the read breaks the data in the middle of the encoded length | undertow-io_undertow | train | java |
bfbfa46dc05cfd13c84bae54dd8b2ad8fe423488 | diff --git a/control/control_test.go b/control/control_test.go
index <HASH>..<HASH> 100644
--- a/control/control_test.go
+++ b/control/control_test.go
@@ -318,7 +318,7 @@ func TestSubscribeMetric(t *testing.T) {
c.metricCatalog = mtrc
cd := cdata.NewNode()
Convey("does not return errors when metricCatalog.Subscribe() does not return an error", t, func() {
- cd.AddItem("key", &ctypes.ConfigValueStr{"value"})
+ cd.AddItem("key", &ctypes.ConfigValueStr{Value: "value"})
mtrc.e = 1
_, err := c.SubscribeMetric([]string{""}, -1, cd)
So(err, ShouldBeNil)
@@ -331,7 +331,7 @@ func TestSubscribeMetric(t *testing.T) {
})
Convey("returns errors when processing fails", t, func() {
cd := cdata.NewNode()
- cd.AddItem("fail", &ctypes.ConfigValueStr{"value"})
+ cd.AddItem("fail", &ctypes.ConfigValueStr{Value: "value"})
mtrc.e = 1
_, errs := c.SubscribeMetric([]string{""}, -1, cd)
So(len(errs.Errors()), ShouldEqual, 1) | get rid of 'unkeyed composite literal' warning from govet | intelsdi-x_snap | train | go |
cf969aac2749ccdd2f3b8bcf58a8ed8016800661 | diff --git a/location_provider_integration_test.go b/location_provider_integration_test.go
index <HASH>..<HASH> 100644
--- a/location_provider_integration_test.go
+++ b/location_provider_integration_test.go
@@ -7,13 +7,12 @@ import (
func TestLocationProviderViaFramework(t *testing.T) {
assert := Setup(t)
- mockT := &mockTestingT{t: t}
buffer := &bytes.Buffer{}
logger := &errorLoggerImpl{writer: buffer}
- mockAssert := setupImpl(mockT, logger)
+ mockAssert := setupImpl(&testing.T{}, logger)
mockAssert.ThatBool(false).IsTrue()
assert.ThatString(buffer.String()).IsEqualTo(
"\n--- FAIL: TestLocationProviderViaFramework\n" +
- "\tlocation_provider_integration_test.go:14\n" +
+ "\tlocation_provider_integration_test.go:13\n" +
"\t\tExpected <true>, but was <false>.\n")
} | removed mockT as we don't really care about it | assertgo_assert | train | go |
aa223114f071dd34dc62367e8df12f33875e69ee | diff --git a/newsletter-bundle/contao/ModuleSubscribe.php b/newsletter-bundle/contao/ModuleSubscribe.php
index <HASH>..<HASH> 100644
--- a/newsletter-bundle/contao/ModuleSubscribe.php
+++ b/newsletter-bundle/contao/ModuleSubscribe.php
@@ -163,7 +163,7 @@ class ModuleSubscribe extends \Module
$this->Template = new \FrontendTemplate('mod_newsletter');
// Check the token
- $objRecipient = \NewsletterRecipientsModel::findBy('token', $this->Input->get('token'));
+ $objRecipient = \NewsletterRecipientsModel::findByToken($this->Input->get('token'));
if ($objRecipient === null)
{ | [Newsletter] Added a magic method to the `Model` and `Model_Collection` classes | contao_contao | train | php |
78b4b396c8413e4b6e6c32317611d0fead72d09b | diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index <HASH>..<HASH> 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -2904,7 +2904,14 @@ func (vm *qemu) Exec(req api.InstanceExecPost, stdin *os.File, stdout *os.File,
return nil, err
}
- revert.Add(func() { termios.Restore(int(stdin.Fd()), oldttystate) })
+ revert.Add(func() {
+ termios.Restore(int(stdin.Fd()), oldttystate)
+
+ // Write a reset escape sequence to the console to cancel any ongoing reads to the handle
+ // and then close it.
+ stdout.Write([]byte("\x1bc"))
+ stdout.Close()
+ })
}
dataDone := make(chan bool) | lxd/instance/drivers/driver/qemu: Fix go routine leak and hanging lxc clients
Ensure that websocket mirror process ends when client terminal exits. | lxc_lxd | train | go |
21ac9cb5fc34fa4e308cff91589441a7845e9157 | diff --git a/src/FileAdder/FileAdder.php b/src/FileAdder/FileAdder.php
index <HASH>..<HASH> 100644
--- a/src/FileAdder/FileAdder.php
+++ b/src/FileAdder/FileAdder.php
@@ -235,15 +235,15 @@ class FileAdder
}
/**
- * Set additional custom remote headers.
+ * Add additional custom remote headers.
*
* @param array $customRemoteHeaders
*
* @return $this
*/
- public function setCustomRemoteHeaders(array $customRemoteHeaders)
+ public function addCustomRemoteHeaders(array $customRemoteHeaders)
{
- $this->filesystem->setCustomRemoteHeaders($customRemoteHeaders);
+ $this->filesystem->addCustomRemoteHeaders($customRemoteHeaders);
return $this;
}
diff --git a/src/Filesystem.php b/src/Filesystem.php
index <HASH>..<HASH> 100644
--- a/src/Filesystem.php
+++ b/src/Filesystem.php
@@ -70,11 +70,11 @@ class Filesystem
}
/**
- * Set custom remote headers on runtime.
+ * Add custom remote headers on runtime.
*
* @param array $customRemoteHeaders
*/
- public function setCustomRemoteHeaders(array $customRemoteHeaders)
+ public function addCustomRemoteHeaders(array $customRemoteHeaders)
{
$this->customRemoteHeaders = $customRemoteHeaders;
} | rename `setCustomRemoteHeaders` to `addCustomRemoteHeaders` | spatie_laravel-medialibrary | train | php,php |
9566d2dbb4c9e79e2314b7468e6263d080832306 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -114,6 +114,41 @@ Uber.prototype = {
get(this.getAuthToken(), u, callback);
},
+ /**
+ * getHistory Get the currently logged in user history
+ *
+ * @param Function A callback function which takes two paramenters
+ */
+ getHistory: function(callback) {
+ if (typeof callback === 'undefined') {
+ } else {
+ var u = url+((this.version == "v1") ? "v1.1" : this.version)+"/history",
+ tokenData = this.getAuthToken();
+ if (tokenData.type != "bearer") {
+ throw new Error("Invalid token type. Must use a token of type bearer.");
+ }
+ get(tokenData, u, callback);
+ }
+ },
+
+ /**
+ * getMe Get the currently logged in user profile.
+ *
+ * @param Function A callback function which takes two parameters
+ */
+ getMe: function(callback) {
+ if (typeof callback === 'undefined') {
+ throw new Error("Callback function undefined");
+ } else {
+ var u = url+this.version+"/me",
+ tokenData = this.getAuthToken();
+ if (tokenData.type != "bearer") {
+ throw new Error("Invalid token type. Must use a token of type bearer.");
+ }
+ get(tokenData, u, callback);
+ }
+ },
+
setBearerToken: function(token) {
this.bearer_token = token; | Updating to add user profile and user history functionality | nathanpdaniel_uber-api | train | js |
745939ccde0a353715c11e2fd6213adc4caf7cca | diff --git a/presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java b/presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java
+++ b/presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java
@@ -136,7 +136,7 @@ public class StateMachine<T>
* Sets the state if the current state satisfies the specified predicate.
* If the new state does not {@code .equals()} the current state, listeners and waiters will be notified.
*
- * @return the old state
+ * @return true if the state is set
*/
public boolean setIf(T newState, Predicate<T> predicate)
{
@@ -168,7 +168,7 @@ public class StateMachine<T>
* Sets the state if the current state {@code .equals()} the specified expected state.
* If the new state does not {@code .equals()} the current state, listeners and waiters will be notified.
*
- * @return the old state
+ * @return true if the state is set
*/
public boolean compareAndSet(T expectedState, T newState)
{ | Minor fix in javadoc for StateMachine | prestodb_presto | train | java |
b9c9672659d5b6b6df1bd98cf1b0b4e2871620cc | diff --git a/lib/sinatra.rb b/lib/sinatra.rb
index <HASH>..<HASH> 100644
--- a/lib/sinatra.rb
+++ b/lib/sinatra.rb
@@ -204,15 +204,15 @@ module Sinatra
attr_reader :events, :layouts, :default_options
def self.default_options
- @@default_options = {
+ @@default_options ||= {
:run => true,
:port => 4567,
- :environment => :development
+ :env => :development
}
end
def default_options
- @@default_options
+ self.class.default_options
end
def initialize | FIX: maintain default_options through resets | sinatra_sinatra | train | rb |
72780e7737e333b0018959be75021fb8950deeb0 | diff --git a/discord/message.py b/discord/message.py
index <HASH>..<HASH> 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -181,6 +181,7 @@ class Message:
def __init__(self, *, state, channel, data):
self._state = state
self.id = int(data['id'])
+ self.webhook_id = utils._get_as_snowflake(data, 'webhook_id')
self.reactions = [Reaction(message=self, data=d) for d in data.get('reactions', [])]
self._update(channel, data) | Actually expose Message.webhook_id. | Rapptz_discord.py | train | py |
037a059a40cebe993623a15ff55d08050e0e5a93 | diff --git a/test.rb b/test.rb
index <HASH>..<HASH> 100644
--- a/test.rb
+++ b/test.rb
@@ -24,4 +24,4 @@ if board.has_lists?
else
list = List.create(name: "Getting Shit done", board_id: board.id)
end
-Card.create(name: "test from ruby-trello", description: "Just a desc", list_id: list.id)
+Card.create(name: "test from ruby-trello", desc: "Just a desc", list_id: list.id) | s/description/desc | jeremytregunna_ruby-trello | train | rb |
aa33fb3d9ee0f1a438728a30dfff9dfadd67a623 | diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/plugin.py
+++ b/spyder/plugins/editor/plugin.py
@@ -1653,13 +1653,13 @@ class Editor(SpyderPluginWidget):
"""Update recent file menu"""
recent_files = []
for fname in self.recent_files:
- if self.is_file_opened(fname) is None and osp.isfile(fname):
+ if osp.isfile(fname):
recent_files.append(fname)
self.recent_file_menu.clear()
if recent_files:
for fname in recent_files:
action = create_action(self, fname,
- icon=ima.icon('FileIcon'),
+ icon=ima.get_icon_by_extension(fname, scale_factor=1.0),
triggered=self.load)
action.setData(to_qvariant(fname))
self.recent_file_menu.addAction(action) | Display extension type icons and create entry as file is opened in Recent Files menu | spyder-ide_spyder | train | py |
6a2797b9dd6ea40f132930113d5927e07e1dd5b0 | diff --git a/src/EvaluatorHandlers.js b/src/EvaluatorHandlers.js
index <HASH>..<HASH> 100644
--- a/src/EvaluatorHandlers.js
+++ b/src/EvaluatorHandlers.js
@@ -256,9 +256,22 @@ function *evaluateClassExpression(e, n, s) {
break;
}
}
+
+ let sc;
+ if ( n.superClass ) {
+ sc = yield * e.branch(n.superClass, s);
+ }
+
if ( !clazz ) {
clazz = new ObjectValue(e.realm);
- clazz.call = function*() { return Value.undef; };
+ if ( n.superClass ) {
+ clazz.call = function*(thiz, args, scope, extra) {
+ yield * sc.call(thiz, args, scope, extra);
+ return Value.undef;
+ }
+ } else {
+ clazz.call = function*() { return Value.undef; };
+ }
} | Add correct default constructor for derived classes. | codecombat_esper.js | train | js |
61a83fd569648c062dc80a877bc3b2f8e57314e4 | diff --git a/lib/flatware/cucumber/formatter.rb b/lib/flatware/cucumber/formatter.rb
index <HASH>..<HASH> 100644
--- a/lib/flatware/cucumber/formatter.rb
+++ b/lib/flatware/cucumber/formatter.rb
@@ -58,6 +58,10 @@ module Flatware
@in_a_step = ! @in_examples
end
+ def after_table_row(table_row)
+ exception(table_row.exception, :failed) if table_row.exception
+ end
+
def before_step(*)
@in_a_step = true
end
diff --git a/lib/flatware/scenario_decorator.rb b/lib/flatware/scenario_decorator.rb
index <HASH>..<HASH> 100644
--- a/lib/flatware/scenario_decorator.rb
+++ b/lib/flatware/scenario_decorator.rb
@@ -1,3 +1,4 @@
+require 'forwardable'
module Flatware
class ScenarioDecorator
extend Forwardable | Cleanup: work around missing formatter callbacks
Cucumber doesn't call the exception hook when an exception is raised in
an after hook in a scenario outline. I tried to fix it and gave up. | briandunn_flatware | train | rb,rb |
4bebf622b455c14d327ce57af81149250c37bac6 | diff --git a/php/commands/rewrite.php b/php/commands/rewrite.php
index <HASH>..<HASH> 100644
--- a/php/commands/rewrite.php
+++ b/php/commands/rewrite.php
@@ -218,5 +218,5 @@ class Rewrite_Command extends WP_CLI_Command {
}
}
-WP_CLI:: add_command( 'rewrite', 'Rewrite_Command' );
+WP_CLI::add_command( 'rewrite', 'Rewrite_Command' ); | Remove whitespace on rewrite command | wp-cli_export-command | train | php |
71f246e52d4ea60615954da2017641e0374b897e | diff --git a/lib/main.js b/lib/main.js
index <HASH>..<HASH> 100755
--- a/lib/main.js
+++ b/lib/main.js
@@ -59,7 +59,8 @@ var SquashRunAsRouter = require('./router/squash-run-as-router.js');
}
})();
-var shinyVersionString = 'Shiny Server v' + SHINY_SERVER_VERSION;
+var serverName = 'Shiny Server';
+var shinyVersionString = `${serverName} v` + SHINY_SERVER_VERSION;
var nodeVersionString = 'Node.js ' + process.version;
var versionString = shinyVersionString + ' (' + nodeVersionString + ')';
@@ -155,6 +156,11 @@ var sockjsHandler = function(req, res){
}
var app = express();
+app.disable('x-powered-by');
+app.use((req, res, next) => {
+ res.setHeader('X-Powered-By', serverName);
+ next();
+})
app.use(function(req, res, next) {
if (useCompression)
compressionMiddleware(req, res, next); | X-Powered-By now reports Shiny Server | rstudio_shiny-server | train | js |
6e9301e210f5655e3c8541efc773ca83b420349e | diff --git a/shared/actions/chat/inbox.js b/shared/actions/chat/inbox.js
index <HASH>..<HASH> 100644
--- a/shared/actions/chat/inbox.js
+++ b/shared/actions/chat/inbox.js
@@ -295,9 +295,11 @@ function _conversationLocalToInboxState (c: ?ChatTypes.ConversationLocal): ?Cons
const toShow = List(c.maxMessages || [])
.filter(m => m.valid && m.state === ChatTypes.LocalMessageUnboxedState.valid)
.map((m: any) => ({body: m.valid.messageBody, time: m.valid.serverHeader.ctime}))
- .filter(m => m.body.messageType === ChatTypes.CommonMessageType.text ||
- m.body.messageType === ChatTypes.CommonMessageType.attachment ||
- m.body.messageType === ChatTypes.CommonMessageType.edit)
+ .filter(m => [
+ ChatTypes.CommonMessageType.attachment,
+ ChatTypes.CommonMessageType.edit,
+ ChatTypes.CommonMessageType.text,
+ ].includes(m.body.messageType))
.sort((a, b) => b.time - a.time)
.map((message: {time: number, body: ?ChatTypes.MessageBody}) => ({
snippet: Constants.makeSnippet(message.body), | Use Array.includes() | keybase_client | train | js |
1e048a7a5ddbc5d551135aa78dffdb309f5ac32c | diff --git a/installation-bundle/src/Translation/LanguageResolver.php b/installation-bundle/src/Translation/LanguageResolver.php
index <HASH>..<HASH> 100644
--- a/installation-bundle/src/Translation/LanguageResolver.php
+++ b/installation-bundle/src/Translation/LanguageResolver.php
@@ -69,7 +69,7 @@ class LanguageResolver
// The implementation differs from the original implementation and also works with .jp browsers
preg_match_all(
- '/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
+ '/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.\d+))?/i',
$this->requestStack->getCurrentRequest()->headers->get('accept-language'),
$accepted
); | [Installation] Run the PhpStorm code inspector. | contao_contao | train | php |
bfa11c24735c507f1007b1629c975d01ab64ccf9 | diff --git a/src/main/java/btrplace/plan/SolverException.java b/src/main/java/btrplace/plan/SolverException.java
index <HASH>..<HASH> 100644
--- a/src/main/java/btrplace/plan/SolverException.java
+++ b/src/main/java/btrplace/plan/SolverException.java
@@ -41,7 +41,7 @@ public class SolverException extends Exception {
}
/**
- * Get the model at the source of the exception
+ * Get the model at the source of the exception.
*
* @return a Model
*/ | an exception for error messages when solving a model | btrplace_scheduler | train | java |
60c70e9024b933e724c8c3d96a486636f85a2335 | diff --git a/kubetest/main.go b/kubetest/main.go
index <HASH>..<HASH> 100644
--- a/kubetest/main.go
+++ b/kubetest/main.go
@@ -17,6 +17,7 @@ limitations under the License.
package main
import (
+ "context"
"encoding/json"
"errors"
"flag"
@@ -724,7 +725,10 @@ func prepareGcp(o *options) error {
log.Printf("provider %v, will acquire project type %v from boskos", o.provider, resType)
- p, err := boskos.Acquire(resType, "free", "busy")
+ // let's retry 5min to get next avaibale resource
+ ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
+ defer cancel()
+ p, err := boskos.AcquireWait(ctx, resType, "free", "busy")
if err != nil {
return fmt.Errorf("--provider=%s boskos failed to acquire project: %v", o.provider, err)
} | make kubetest retry for 5min upon no available resource | kubernetes_test-infra | train | go |
ca1e2b500f6f9fa6a845c7a82a554b688047a301 | diff --git a/source/tryCatch.js b/source/tryCatch.js
index <HASH>..<HASH> 100644
--- a/source/tryCatch.js
+++ b/source/tryCatch.js
@@ -23,6 +23,7 @@ import _curry2 from './internal/_curry2';
* R.tryCatch(R.prop('x'), R.F)({x: true}); //=> true
* R.tryCatch(() => { throw 'foo'}, R.always('catched'))('bar') // => 'catched'
* R.tryCatch(R.times(R.identity), R.always([]))('s') // => []
+ * R.tryCatch(() => { throw 'this is not a valid value'}, (err, value)=>({error : err, value }))('bar') // => {'error': 'this is not a valid value', 'value': 'bar'}
*/
var tryCatch = _curry2(function _tryCatch(tryer, catcher) {
return _arity(tryer.length, function() { | add an example which covers error and value (#<I>)
* add an example which covers error and value
* fix singlequote | ramda_ramda | train | js |
b3cbcde993c13e615fcabb05987d1c7042292630 | diff --git a/api.go b/api.go
index <HASH>..<HASH> 100644
--- a/api.go
+++ b/api.go
@@ -25,6 +25,7 @@ import (
"net/url"
"regexp"
"strconv"
+ "time"
)
const (
@@ -35,12 +36,14 @@ const (
type MandrillAPI struct {
Key string
Transport http.RoundTripper
+ Timeout time.Duration
endpoint string
}
type ChimpAPI struct {
Key string
Transport http.RoundTripper
+ Timeout time.Duration
endpoint string
}
@@ -82,6 +85,9 @@ func runChimp(api *ChimpAPI, path string, parameters interface{}) ([]byte, error
log.Printf("Request URL:%s", requestUrl)
}
client := &http.Client{Transport: api.Transport}
+ if api.Timeout > 0 {
+ client.Timeout = api.Timeout
+ }
resp, err := client.Post(requestUrl, "application/json", bytes.NewBuffer(b))
if err != nil {
return nil, err
@@ -117,6 +123,9 @@ func runMandrill(api *MandrillAPI, path string, parameters map[string]interface{
log.Printf("Request URL:%s", requestUrl)
}
client := &http.Client{Transport: api.Transport}
+ if api.Timeout > 0 {
+ client.Timeout = api.Timeout
+ }
resp, err := client.Post(requestUrl, "application/json", bytes.NewBuffer(b))
if err != nil {
return nil, err | Added Timeout option to api structs | mattbaird_gochimp | train | go |
dad15fc7c9c49b1409b88787bd02155e293d25a7 | diff --git a/indra/databases/ndex_client.py b/indra/databases/ndex_client.py
index <HASH>..<HASH> 100644
--- a/indra/databases/ndex_client.py
+++ b/indra/databases/ndex_client.py
@@ -7,8 +7,6 @@ import requests
import logging
import ndex2.client
from ndex2.niceCXNetwork import NiceCXNetwork
-#import ndex
-#import ndex.client
logger = logging.getLogger('ndex_client')
@@ -174,7 +172,6 @@ def update_network(cx_str, network_id, ndex_cred):
def set_style(network_id, ndex_cred):
# Update network style
- # import ndex.beta.toolbox as toolbox
template_uuid = "ea4ea3b7-6903-11e7-961c-0ac135e8bacf"
server = 'http://public.ndexbio.org'
@@ -185,13 +182,10 @@ def set_style(network_id, ndex_cred):
password=password,
uuid=network_id)
- source_network = NiceCXNetwork(
- username=username,
- password=password,
- uuid=network_id)
+ source_network = NiceCXNetwork(username=username,
+ password=password,
+ uuid=network_id)
- # toolbox.apply_template(source_network, template_uuid, server=server,
- # username=username, password=password)
source_network.apply_template(server, template_uuid)
source_network.update_to(network_id, server=server, username=username, | Small changes in updating ndex client | sorgerlab_indra | train | py |
9d9c808280f02a456e86dec008c60c1075feee01 | diff --git a/lib/create-espower-visitor.js b/lib/create-espower-visitor.js
index <HASH>..<HASH> 100644
--- a/lib/create-espower-visitor.js
+++ b/lib/create-espower-visitor.js
@@ -10,14 +10,12 @@ var BabelAssertionVisitor = require('./babel-assertion-visitor');
var babelTemplate = require('babel-template');
var helperTemplate = babelTemplate([
'(function () {',
- ' var events = [];',
+ ' var captured = [];',
' function _capt (value, espath) {',
- ' events.push({value: value, espath: espath});',
+ ' captured.push({value: value, espath: espath});',
' return value;',
' }',
' function _expr (value, args) {',
- ' var captured = events;',
- ' events = [];',
' var source = {',
' content: args.content,',
' filepath: args.filepath,', | refactor(babel-plugin-espower): simplify closure usage in capture helper
since closure is created for each assertion argument | power-assert-js_babel-plugin-espower | train | js |
917a32ed19d53251f18039de393015dec4d7eaf2 | diff --git a/pyhomematic/devicetypes/helper.py b/pyhomematic/devicetypes/helper.py
index <HASH>..<HASH> 100644
--- a/pyhomematic/devicetypes/helper.py
+++ b/pyhomematic/devicetypes/helper.py
@@ -21,7 +21,7 @@ class HelperSabotageIP(HMDevice):
super().__init__(device_description, proxy, resolveparamsets)
# init metadata
- self.ATTRIBUTENODE.update({"SABOTAGE": self.ELEMENT})
+ self.ATTRIBUTENODE.update({"SABOTAGE": [0]})
def sabotage(self, channel=None):
"""Returns True if the devicecase has been opened.""" | All HmIP devices have the SABOTAGE DP on channel 0 (MAINTENANCE)
Source:
<URL> | danielperna84_pyhomematic | train | py |
468238392c3ba082090757d4cf90e57a1453d22c | diff --git a/web/concrete/tools/permissions/access_entity.php b/web/concrete/tools/permissions/access_entity.php
index <HASH>..<HASH> 100644
--- a/web/concrete/tools/permissions/access_entity.php
+++ b/web/concrete/tools/permissions/access_entity.php
@@ -62,7 +62,7 @@ if ($_POST['task'] == 'save_permissions') {
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
- <i class="icon-plus-sign" /> <?=t('Select')?>
+ <i class="icon-plus-sign"></i> <?=t('Select')?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu"> | Fix closing <i> tag
It's not self-closing
Former-commit-id: a6fdcdca6d<I>d1c7e<I>e6f0b4ceab3d<I> | concrete5_concrete5 | train | php |
2a24f07ad60339e9504674912cf176d553bbfee8 | diff --git a/app/controllers/discovery_rules_controller.rb b/app/controllers/discovery_rules_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/discovery_rules_controller.rb
+++ b/app/controllers/discovery_rules_controller.rb
@@ -8,7 +8,7 @@ class DiscoveryRulesController < ApplicationController
def index
base = resource_base.search_for(params[:search], :order => (params[:order]))
- @discovery_rules = base.paginate(:page => params[:page]).includes(:hostgroup)
+ @discovery_rules = base.paginate(:page => params[:page], :per_page => params[:per_page]).includes(:hostgroup)
end
def new | Fixes #<I> - [Discovery rules]Fix the pagination
By default <I> items must be displayed on the current page but if you have say <I> items and
want to show only 5 on page, then the pagination does not work correctly.
This patch makes sure that correct number of rows are displayed per page. | theforeman_foreman_discovery | train | rb |
5ac1a6cdc7b1fcc6190a8c5a43c794a563a02775 | diff --git a/andes/io/matpower.py b/andes/io/matpower.py
index <HASH>..<HASH> 100644
--- a/andes/io/matpower.py
+++ b/andes/io/matpower.py
@@ -199,8 +199,8 @@ def read(system, file):
# 0 1 2 3 4 5 6 7 8 9
# status angmin angmax Pf Qf Pt Qt
# 10 11 12 13 14 15 16
- fbus = data[0]
- tbus = data[1]
+ fbus = int(data[0])
+ tbus = int(data[1])
r = data[2]
x = data[3]
b = data[4] | Convert bus idx of lines to integers. | cuihantao_andes | train | py |
518186054aee2bb04fa43f0f09ee76c568cdf795 | diff --git a/modules/Page/resources/views/index.blade.php b/modules/Page/resources/views/index.blade.php
index <HASH>..<HASH> 100644
--- a/modules/Page/resources/views/index.blade.php
+++ b/modules/Page/resources/views/index.blade.php
@@ -95,7 +95,7 @@
<td>Magnus Vike</td>
<td>2018-02-01</td>
<td class="has-text-right">
- <a href="#" class="button is-primary is-small">
+ <a href="{{ route('page.edit') }}#" class="button is-primary is-small">
<span class="icon is-small">
<i class="far fa-edit"></i>
</span>
@@ -115,13 +115,12 @@
<hr>
<!-- Bulk operations -->
- <label class="label">With selected:</label>
-
+ <label class="label is-hidden">Select what to do with selected items</label>
<div class="field">
<div class="control has-icons-left">
<div class="select">
<select>
- <option selected>Select from the list</option>
+ <option selected>What to do with selected?</option>
<option>Publish</option>
<option>Depublish</option>
<option>Delete</option> | UI fixes feedback from jenny | frostnode_frostnode-cms | train | php |
8b683d8a1c15bc3438d8f3af713d2296ae6cc9ef | diff --git a/fastlane/lib/fastlane/actions/modify_services.rb b/fastlane/lib/fastlane/actions/modify_services.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/modify_services.rb
+++ b/fastlane/lib/fastlane/actions/modify_services.rb
@@ -44,6 +44,7 @@ module Fastlane
def self.services_mapping
{
+ access_wifi: 'access_wifi',
app_group: 'app_group',
apple_pay: 'apple_pay',
associated_domains: 'associated_domains',
diff --git a/produce/lib/produce/developer_center.rb b/produce/lib/produce/developer_center.rb
index <HASH>..<HASH> 100644
--- a/produce/lib/produce/developer_center.rb
+++ b/produce/lib/produce/developer_center.rb
@@ -12,6 +12,7 @@ module Produce
SERVICE_CLOUDKIT = "cloudkit"
ALLOWED_SERVICES = {
+ access_wifi: [SERVICE_ON, SERVICE_OFF],
app_group: [SERVICE_ON, SERVICE_OFF],
apple_pay: [SERVICE_ON, SERVICE_OFF],
associated_domains: [SERVICE_ON, SERVICE_OFF], | <I> - Adding access_wifi param to modify_serviecs & produce (#<I>) | fastlane_fastlane | train | rb,rb |
26d6f5ce4e77d0170b8f8a53e168913c0eafea1a | diff --git a/lib/Doctrine/ORM/Query/AST/Node.php b/lib/Doctrine/ORM/Query/AST/Node.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Query/AST/Node.php
+++ b/lib/Doctrine/ORM/Query/AST/Node.php
@@ -37,7 +37,9 @@ abstract class Node
* Implementation is not mandatory for all nodes.
*
* @param $walker
+ *
* @return string
+ *
* @throws ASTException
*/
public function dispatch($walker) | Fixed coding standard issue, as per @stof's request. | doctrine_orm | train | php |
b7b1e492070e708c99b605817c94e7bdba50d1ef | diff --git a/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/messaging/router/RouterActor.java b/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/messaging/router/RouterActor.java
index <HASH>..<HASH> 100644
--- a/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/messaging/router/RouterActor.java
+++ b/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/messaging/router/RouterActor.java
@@ -239,6 +239,10 @@ public class RouterActor extends ModuleActor {
state = state.changeOutReceiveDate(maxReceiveDate);
isChanged = true;
}
+ if (state.isLoaded() != isEnded) {
+ state = state.changeIsLoaded(isEnded);
+ isChanged = true;
+ }
if (isChanged) {
conversationStates.addOrUpdateItem(state);
} | fix(core): Fixing isLoaded flag in chat | actorapp_actor-platform | train | java |
ce90d69bb75c2d0ff2869458cb61721b00be90af | diff --git a/library/client.js b/library/client.js
index <HASH>..<HASH> 100644
--- a/library/client.js
+++ b/library/client.js
@@ -112,7 +112,7 @@ var client = function client(options) {
Request('http://registry.npmjs.org/twitch-irc/latest', function (err, res, body) {
if (!err && res.statusCode == 200) {
if (versionCompare(JSON.parse(body).version, Package.version) >= 1) {
- console.log('[\x1b[33m!\x1b[39m] A new update is available for twitch-irc: \x1b[32m' + JSON.parse(body).version + '\x1b[39m \x1b[90m(current: ' + Package.version + ')\x1b[39m');
+ console.log('\x1b[36m?\x1b[97m new update available for twitch-irc: \x1b[32m' + JSON.parse(body).version + '\x1b[39m \x1b[90m(current: ' + Package.version + ')\x1b[39m');
}
}
}); | Changed colors for the update checker. | twitch-irc_twitch-irc | train | js |
04f6b5e66ee330b6a9b381b3a5a1c562d17838ca | diff --git a/copy.go b/copy.go
index <HASH>..<HASH> 100644
--- a/copy.go
+++ b/copy.go
@@ -9,11 +9,6 @@ import (
"github.com/getlantern/errors"
)
-const (
- ioTimeout = "i/o timeout"
- ioTimeoutLength = 11
-)
-
var (
copyTimeout = 1 * time.Second
)
@@ -79,11 +74,6 @@ func doCopy(dst net.Conn, src net.Conn, buf []byte, errCh chan error, stop *uint
}
func isTimeout(err error) bool {
- es := err.Error()
- esl := len(es)
- if esl >= ioTimeoutLength && es[esl-ioTimeoutLength:] == ioTimeout {
- return true
- }
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
return true
}
diff --git a/timeout_bench_test.go b/timeout_bench_test.go
index <HASH>..<HASH> 100644
--- a/timeout_bench_test.go
+++ b/timeout_bench_test.go
@@ -9,6 +9,11 @@ import (
"testing"
)
+const (
+ ioTimeout = "i/o timeout"
+ ioTimeoutLength = 11
+)
+
type timeouterror struct {
} | Removed fast path io timeout check | getlantern_netx | train | go,go |
a82ab66fc1dbfa841c59439b1efe8e2a990b6014 | diff --git a/lib/Compilation.js b/lib/Compilation.js
index <HASH>..<HASH> 100644
--- a/lib/Compilation.js
+++ b/lib/Compilation.js
@@ -2261,7 +2261,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
affectedModules.add(referencingModule);
}
const memCache = new WeakTupleMap();
- const cache = moduleMemCacheCache.get(module);
+ const cache = moduleMemCacheCache.get(referencingModule);
cache.memCache = memCache;
moduleMemCaches.set(referencingModule, memCache);
} | fix accidentically shared mem caches | webpack_webpack | train | js |
94e2aea6d64afda561f00b1dcc331dc2114efe71 | diff --git a/scdl/__init__.py b/scdl/__init__.py
index <HASH>..<HASH> 100644
--- a/scdl/__init__.py
+++ b/scdl/__init__.py
@@ -2,4 +2,4 @@
"""Python Soundcloud Music Downloader."""
-__version__ = "v2.3.0"
\ No newline at end of file
+__version__ = "v2.3.1"
\ No newline at end of file
diff --git a/scdl/scdl.py b/scdl/scdl.py
index <HASH>..<HASH> 100755
--- a/scdl/scdl.py
+++ b/scdl/scdl.py
@@ -565,12 +565,14 @@ def download_hls(client: SoundCloud, track: BasicTrack, title: str, playlist_inf
url = get_track_m3u8(client, track, aac)
filename_path = os.path.abspath(filename)
- p = subprocess.run(
+ p = subprocess.Popen(
["ffmpeg", "-i", url, "-c", "copy", filename_path, "-loglevel", "error"],
- capture_output=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE
)
- if p.stderr:
- logger.error(p.stderr.decode("utf-8"))
+ stdout, stderr = p.communicate()
+ if stderr:
+ logger.error(stderr.decode("utf-8"))
return (filename, False) | Add support for Python <I> | flyingrub_scdl | train | py,py |
d906ee2d59f2a689ce4f0ac6f42b84506d932f44 | diff --git a/lib/ruote/part/storage_participant.rb b/lib/ruote/part/storage_participant.rb
index <HASH>..<HASH> 100644
--- a/lib/ruote/part/storage_participant.rb
+++ b/lib/ruote/part/storage_participant.rb
@@ -31,7 +31,24 @@ module Ruote
# A participant that stores the workitem in the same storage used by the
# engine and the worker(s).
#
- # Does not thread by default.
+ # part = engine.register_participant 'alfred', Ruote::StorageParticipant
+ #
+ # # ... a bit later
+ #
+ # puts "workitems still open : "
+ # part.each do |workitem|
+ # puts "#{workitem.fei.wfid} - #{workitem.fields['params']['task']}"
+ # end
+ #
+ # # ... when done with a workitem
+ #
+ # part.reply(workitem)
+ # # this will remove the workitem from the storage and hand it back
+ # # to the engine
+ #
+ # Does not thread by default (the engine will not spawn a dedicated thread
+ # to handle the delivery to this participant, the workitem will get stored
+ # via the main engine thread an basta).
#
class StorageParticipant | more rdoc for Ruote::StorageParticipant | jmettraux_ruote | train | rb |
fd8060c58c6d635ee638a5cd4d0b3f561027e2e4 | diff --git a/tests/pytests/unit/modules/test_aix_status.py b/tests/pytests/unit/modules/test_aix_status.py
index <HASH>..<HASH> 100644
--- a/tests/pytests/unit/modules/test_aix_status.py
+++ b/tests/pytests/unit/modules/test_aix_status.py
@@ -1,14 +1,10 @@
import logging
import sys
+import pytest
import salt.modules.status as status
from tests.support.mock import MagicMock, patch
-try:
- import pytest
-except ImportError:
- pytest = None
-
log = logging.getLogger(__name__) | After reviewer comments, removed try/except around import pytest | saltstack_salt | train | py |
e9ea79213f3abfde29d91abdfa9381fe4c56edf5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name = 'pylutron',
- version = '0.2.1',
+ version = '0.2.2',
license = 'MIT',
description = 'Python library for Lutron RadioRA 2',
author = 'Dima Zavin', | Update version for PyPi to <I> | thecynic_pylutron | train | py |
b2d17cbe8359dc86d303275208abc594024fed40 | diff --git a/pycbc/workflow/cbc_workflow.py b/pycbc/workflow/cbc_workflow.py
index <HASH>..<HASH> 100644
--- a/pycbc/workflow/cbc_workflow.py
+++ b/pycbc/workflow/cbc_workflow.py
@@ -0,0 +1,11 @@
+from pycbc.workflow import Workflow, Node, File
+
+
+class AhopeWorkflow(Workflow):
+ pass
+
+class AhopeNode(Node):
+ pass
+
+class AhopeFile(File):
+ pass | stuff out the classes we want to define | gwastro_pycbc | train | py |
cedbab96e0fe2e843478932f54ba6849e6b55ea9 | diff --git a/stripy-src/tests/test_routines.py b/stripy-src/tests/test_routines.py
index <HASH>..<HASH> 100644
--- a/stripy-src/tests/test_routines.py
+++ b/stripy-src/tests/test_routines.py
@@ -7,7 +7,7 @@ from time import time
# global variables
permute = False
max_refinements = 2
-npoints = 100000
+npoints = 10000
def time_routine(routine, *args):
@@ -66,7 +66,7 @@ def test_spherical_triangulation():
lat = np.arccos(2.*np.random.random(100) - 1.) - np.pi/2
# stri = stripy.sTriangulation(lons, lats)
- stri = stripy.spherical_meshes.octahedral_mesh(include_face_points=True, refinement_levels=6)
+ stri = stripy.spherical_meshes.octahedral_mesh(include_face_points=True, refinement_levels=3)
stri = stripy.sTriangulation(stri.lons, stri.lats)
return(stri, stri.lons, stri.lats, lon, lat) | Speaking of fine-grained - fewer points helps | underworldcode_stripy | train | py |
17d3671601c9469208bbab65568e0383c5cd45cd | diff --git a/command/meta.go b/command/meta.go
index <HASH>..<HASH> 100644
--- a/command/meta.go
+++ b/command/meta.go
@@ -120,6 +120,9 @@ func (m *Meta) FlagSet(n string, fs FlagSetFlags) *flag.FlagSet {
f.Var((*kvflag.Flag)(&m.flagVars), "var", "")
f.Var((*kvflag.FlagJSON)(&m.flagVars), "var-file", "")
}
+ if len(m.flagVars) == 0 {
+ m.flagVars = make(map[string]string)
+ }
// Create an io.Writer that writes to our Ui properly for errors.
// This is kind of a hack, but it does the job. Basically: create | make sure that flagVars is not a nil map | hashicorp_packer | train | go |
b391035b797aa34b41dadfc41fa77f07ccc11457 | diff --git a/inginious/frontend/pages/lti.py b/inginious/frontend/pages/lti.py
index <HASH>..<HASH> 100644
--- a/inginious/frontend/pages/lti.py
+++ b/inginious/frontend/pages/lti.py
@@ -86,7 +86,7 @@ class LTIBindPage(INGIniousAuthPage):
data["task"][0],
data["consumer_key"],
user_profile.get("ltibindings", {}).get(data["task"][0], {}).get(data["consumer_key"], ""))
- return self.template_helper.get_renderer().lti_bind(False, cookieless_session["data"]["session_id"],
+ return self.template_helper.get_renderer().lti_bind(False, cookieless_session["session_id"],
data, _("Your account is already bound with this context."))
return self.template_helper.get_renderer().lti_bind(True, cookieless_session["session_id"], data, "") | Fix key error during lti binding | UCL-INGI_INGInious | train | py |
de23293486bb678fda62c7ca38ed001669d1d227 | diff --git a/releaser/releaser.go b/releaser/releaser.go
index <HASH>..<HASH> 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -245,7 +245,12 @@ func (r *ReleaseHandler) release(releaseNotesFile string) error {
return nil
}
- cmd := exec.Command("goreleaser", "--rm-dist", "--release-notes", releaseNotesFile, "--skip-publish="+fmt.Sprint(r.skipPublish))
+ args := []string{"--rm-dist", "--release-notes", releaseNotesFile}
+ if r.skipPublish {
+ args = append(args, "--skip-publish")
+ }
+
+ cmd := exec.Command("goreleaser", args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run() | releaser: Work around a Goreleaser bug
Closes #<I> | gohugoio_hugo | train | go |
492787759894326081dd25b282807fb7ff2077af | diff --git a/src/Sylius/Component/Promotion/Model/Promotion.php b/src/Sylius/Component/Promotion/Model/Promotion.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Component/Promotion/Model/Promotion.php
+++ b/src/Sylius/Component/Promotion/Model/Promotion.php
@@ -454,7 +454,7 @@ class Promotion implements PromotionInterface
/**
* {@inheritdoc}
*/
- public function setDeletedAt(\DateTime $deletedAt)
+ public function setDeletedAt(\DateTime $deletedAt = null)
{
$this->deletedAt = $deletedAt;
}
diff --git a/src/Sylius/Component/Promotion/Model/PromotionInterface.php b/src/Sylius/Component/Promotion/Model/PromotionInterface.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Component/Promotion/Model/PromotionInterface.php
+++ b/src/Sylius/Component/Promotion/Model/PromotionInterface.php
@@ -12,12 +12,13 @@
namespace Sylius\Component\Promotion\Model;
use Doctrine\Common\Collections\Collection;
+use Sylius\Component\Resource\Model\SoftDeletableInterface;
use Sylius\Component\Resource\Model\TimestampableInterface;
/**
* @author Saša Stamenković <umpirsky@gmail.com>
*/
-interface PromotionInterface extends TimestampableInterface
+interface PromotionInterface extends SoftDeletableInterface, TimestampableInterface
{
/**
* @return mixed | Fix issue when promotion couldn't be "restored" | Sylius_Sylius | train | php,php |
63bb414f5174754f3c54a9423c4afe5a2ab5efc0 | diff --git a/src/jquery.vide.js b/src/jquery.vide.js
index <HASH>..<HASH> 100644
--- a/src/jquery.vide.js
+++ b/src/jquery.vide.js
@@ -311,9 +311,13 @@
})
// Resize a video, when it's loaded
- .on('canplaythrough.' + PLUGIN_NAME, function() {
- vide.$video.css('visibility', 'visible');
+ .one('canplaythrough.' + PLUGIN_NAME, function() {
vide.resize();
+ })
+
+ // Make it visible, when it's already playing
+ .one('playing.' + PLUGIN_NAME, function() {
+ vide.$video.css('visibility', 'visible');
vide.$wrapper.css('background-image', 'none');
}); | Fix #<I>: Disappearing of the background image in Android 5 | vodkabears_Vide | train | js |
c973e8b31911f1e936239b316ea4775573c452ca | diff --git a/numexpr/necompiler.py b/numexpr/necompiler.py
index <HASH>..<HASH> 100644
--- a/numexpr/necompiler.py
+++ b/numexpr/necompiler.py
@@ -63,6 +63,8 @@ vml_functions = [
"conjugate",
"arctan2",
"fmod",
+ "ceil",
+ "floor"
]
# Final addtions for Python 3 (mainly for PyTables needs) | Use VML functions for ceil and floor | pydata_numexpr | train | py |
6be39b4fcc55ceaf9241e9749937cd58b6d0d614 | diff --git a/addok/textutils/fr_FR.py b/addok/textutils/fr_FR.py
index <HASH>..<HASH> 100644
--- a/addok/textutils/fr_FR.py
+++ b/addok/textutils/fr_FR.py
@@ -20,18 +20,6 @@ TYPES_REGEX = '|'.join(
)
-def split_address(q):
- m = re.search(
- "^(?P<type>" + TYPES_REGEX + ")"
- "[a-z ']+(?P<name>[\wçàèéuâêôîûöüïäë '\-]+)", q)
- return m.groupdict() if m else {}
-
-
-def split_housenumber(q):
- m = re.search("^(?P<number>[\d]+)/?(?P<ordinal>([^\d]+|[\d]{1}))?", q)
- return m.groupdict() if m else {}
-
-
def _clean_query(q):
q = re.sub('c(e|é)dex ?[\d]*', '', q, flags=re.IGNORECASE)
q = re.sub('bp ?[\d]*', '', q, flags=re.IGNORECASE) | Remove unused split_address and split_housenumber functions | addok_addok | train | py |
4ea9e14b7b2b677c7ee738ef76857c7d0af7520e | diff --git a/sshClient.go b/sshClient.go
index <HASH>..<HASH> 100644
--- a/sshClient.go
+++ b/sshClient.go
@@ -145,7 +145,7 @@ func CopyRemoteFileToLocal(client *ssh.Client, remoteFilePath string, remoteFile
// Confirm to the remote host that we have received the command line
writer.Write(successfulByte)
// Now we want to start receiving the file itself from the remote machine
- fileContents := make([]byte, 100)
+ fileContents := make([]byte, 1)
var file *os.File
if localFileName == "" {
file = createNewFile(localFilePath + "/" + fileName) | Read 1 byte at a time for performance reasons | kkirsche_go-scp | train | go |
6d7aa3e35472040800711ebf2553bfa8489d1249 | diff --git a/rocketbelt/components/tabcordions/rocketbelt.tabcordions.js b/rocketbelt/components/tabcordions/rocketbelt.tabcordions.js
index <HASH>..<HASH> 100644
--- a/rocketbelt/components/tabcordions/rocketbelt.tabcordions.js
+++ b/rocketbelt/components/tabcordions/rocketbelt.tabcordions.js
@@ -47,7 +47,16 @@
// Click support
$navlist.on('click', '.tabcordion_nav-item .tabcordion_nav-trigger', function () {
+
+ var currentTarget = $navlist.find('.tabcordion_nav-item.is-active .tabcordion_nav-trigger')[0];
+ if (currentTarget != $(this)[0]) {
+ var eventData = {'previousTarget': currentTarget, 'newTarget': $(this)[0]};
+ var event = new CustomEvent('rb.tabcordion.tabChanged', {detail: eventData});
+ $(this)[0].dispatchEvent(event);
+ }
+
setActiveAndInactive(this, $navlist);
+
});
}); | Fire event on tabcordion click. | Pier1_rocketbelt | train | js |
d6d34fae98903e3dbf114b0ac866546034fb164a | diff --git a/test_tube/hpc.py b/test_tube/hpc.py
index <HASH>..<HASH> 100644
--- a/test_tube/hpc.py
+++ b/test_tube/hpc.py
@@ -155,8 +155,7 @@ class SlurmCluster(AbstractCluster):
# whenever this script is called by slurm, it's an actual experiment, so start it
if self.is_from_slurm_object:
- results = self.__run_experiment(train_function)
- return results
+ self.__run_experiment(train_function)
# generate hopt trials
trials = self.hyperparam_optimizer.generate_trials(nb_trials)
@@ -251,7 +250,11 @@ class SlurmCluster(AbstractCluster):
# This prints the type, value, and stack trace of the
# current exception being handled.
traceback.print_exc()
- os._exit(1)
+ threading.Timer(30, self.kill).start()
+
+
+ def kill(self):
+ os._exit(1)
def __call_old_slurm_cmd(self, original_slurm_cmd_script_path, exp_i, copy_current=True):
""" | fixing no except in hpc crash | williamFalcon_test-tube | train | py |
022d02e346c387374579c4a641ab9d1dde985c9a | diff --git a/lib/procodile/instance.rb b/lib/procodile/instance.rb
index <HASH>..<HASH> 100644
--- a/lib/procodile/instance.rb
+++ b/lib/procodile/instance.rb
@@ -190,6 +190,7 @@ module Procodile
pid_from_file = self.pid_from_file
if pid_from_file && pid_from_file != @pid
@pid = pid_from_file
+ @started_at = File.mtime(self.pid_file_path)
Procodile.log(@process.log_color, description, "PID file changed. Updated pid to #{@pid}")
true
else | updated the stated timestamp when updating from a pid file | adamcooke_procodile | train | rb |
1aaead35a897d0c2ba2b48a354095ddb1166b004 | diff --git a/features/support/worlds/pathology/global_algorithm.rb b/features/support/worlds/pathology/global_algorithm.rb
index <HASH>..<HASH> 100644
--- a/features/support/worlds/pathology/global_algorithm.rb
+++ b/features/support/worlds/pathology/global_algorithm.rb
@@ -19,9 +19,20 @@ module World
Renalware::Pathology::Requests::DrugCategory.find_by(name: params["id"]).id
end
+ rule_set_type = params.fetch(
+ "rule_set_type",
+ "Renalware::Pathology::Requests::GlobalRuleSet"
+ )
+
+ rule_set =
+ if rule_set_type = "Renalware::Pathology::Requests::GlobalRuleSet"
+ rule_set_type.constantize.new(id: params["rule_set_id"])
+ elsif rule_set_type = "Renalware::Pathology::Requests::HighRiskRuleSet"
+ rule_set_type.constantize.new
+ end
+
Renalware::Pathology::Requests::GlobalRule.create!(
- rule_set_id: params["rule_set_id"],
- rule_set_type: "Renalware::Pathology::Requests::GlobalRuleSet",
+ rule_set: rule_set,
type: "Renalware::Pathology::Requests::GlobalRule::#{params['type']}",
param_id: param_id,
param_comparison_operator: params["operator"], | create_global_rule world method accepts the rule_set_type as a param | airslie_renalware-core | train | rb |
b8dc8576ec2e3745e1caecfaf5d2353788245a63 | diff --git a/lib/vmc/cli/app.rb b/lib/vmc/cli/app.rb
index <HASH>..<HASH> 100644
--- a/lib/vmc/cli/app.rb
+++ b/lib/vmc/cli/app.rb
@@ -411,7 +411,7 @@ module VMC
ask("Memory Limit", :choices => MEM_CHOICES,
:default => human_size(default * 1024 * 1024, 0))
}
- input :restart, :default => true,
+ input :restart, :type => :boolean, :default => true,
:desc => "Restart app after updating?"
def scale(input)
name = input[:name]
@@ -673,7 +673,7 @@ module VMC
:desc => "Environment variable name"
input :value, :argument => :optional,
:desc => "Environment variable value"
- input :restart, :default => true,
+ input :restart, :type => :boolean, :default => true,
:desc => "Restart app after updating?"
def set_env(input)
appname = input[:name]
@@ -715,7 +715,7 @@ module VMC
:desc => "Application to remove the variable from"
input :var, :argument => true,
:desc => "Environment variable name"
- input :restart, :default => true,
+ input :restart, :type => :boolean, :default => true,
:desc => "Restart app after updating?"
def delete_env(input)
appname = input[:name] | make sure --restart flag is boolean
Change-Id: I<I>e3b8f4c<I>ff<I>bfaecea<I>c1 | cloudfoundry-attic_cf | train | rb |
84beee5ea0fe1227ed6b33434b18bc182c9b34c6 | diff --git a/lib/mongoid.rb b/lib/mongoid.rb
index <HASH>..<HASH> 100644
--- a/lib/mongoid.rb
+++ b/lib/mongoid.rb
@@ -22,7 +22,7 @@ require "rubygems"
gem "activesupport", "2.3.4"
gem "mongodb-mongo", "0.14.1"
-gem "hashrocket-validatable", "1.7.4"
+gem "durran-validatable", "1.7.5"
require "validatable"
require "active_support/callbacks" | Switching to durran-validatable | mongodb_mongoid | train | rb |
1d77d4d797c7ae4fd37d9bf8140e92fd3a17206d | diff --git a/src/main/java/water/fvec/Frame.java b/src/main/java/water/fvec/Frame.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/fvec/Frame.java
+++ b/src/main/java/water/fvec/Frame.java
@@ -184,12 +184,11 @@ public class Frame extends Lockable<Frame> {
// Return a new Frame compatible with 'this' and a copy of 'f's data otherwise.
public Frame makeCompatible( Frame f) {
// Small data frames are always "compatible"
- if( anyVec()==null || // No dest columns
- numRows() <= 1e4 ) // Or it is small
+ if( anyVec()==null) // Or it is small
return f; // Then must be compatible
// Same VectorGroup is also compatible
if( f.anyVec() == null ||
- f.anyVec().group().equals(anyVec().group()) )
+ f.anyVec().group().equals(anyVec().group()) && Arrays.equals(f.anyVec()._espc,anyVec()._espc))
return f;
// Ok, here make some new Vecs with compatible layout
Key k = Key.make(); | Bugfix in makeCompatible call on a frame:
1) do not skip the call if small (there was a bail if <1e4)
2) also check _espc when checking for compatibility (only tested vector group which is not enough) | h2oai_h2o-2 | train | java |
558a7b198423c9922abe724bd3754cde70d2562c | diff --git a/SpiffWorkflow/bpmn2/BpmnWorkflow.py b/SpiffWorkflow/bpmn2/BpmnWorkflow.py
index <HASH>..<HASH> 100644
--- a/SpiffWorkflow/bpmn2/BpmnWorkflow.py
+++ b/SpiffWorkflow/bpmn2/BpmnWorkflow.py
@@ -148,10 +148,14 @@ class BpmnCondition(Operator):
class BpmnScriptEngine(object):
def evaluate(self, task, expression):
- if isinstance(expression, basestring):
- return task.get_attribute(expression, None)
- else:
+ if isinstance(expression, Operator):
return expression._matches(task)
+ else:
+ return self._eval(task, expression, **task.get_attributes())
+
+ def _eval(self, task, expression, **kwargs):
+ locals().update(kwargs)
+ return eval(expression)
def execute(self, task, script):
exec script | Make evaluation of expressions more useful. | knipknap_SpiffWorkflow | train | py |
e20cea7773969222c6f4ec73da9fa5650b8064dd | diff --git a/cmd/jujud/agent/util_test.go b/cmd/jujud/agent/util_test.go
index <HASH>..<HASH> 100644
--- a/cmd/jujud/agent/util_test.go
+++ b/cmd/jujud/agent/util_test.go
@@ -32,9 +32,7 @@ var (
"storage-provisioner", "firewaller", "unit-assigner",
"service-scaler", "instance-poller", "charm-revision-updater",
"metric-worker", "state-cleaner", "status-history-pruner",
- // Note absence of migration-master worker, which currently
- // errors out repeatedly (when not migrating) and so never
- // shows up.
+ "migration-master",
}
deadModelWorkers = []string{
"environ-tracker", "undertaker", | /jujud/agent: Expect migration-master to run now in tests
With recent fixes the migration-master no longer continually restarts. | juju_juju | train | go |
9aa9ea7346b9fc2754b9d1be7410f4038aaf2051 | diff --git a/middleware.go b/middleware.go
index <HASH>..<HASH> 100644
--- a/middleware.go
+++ b/middleware.go
@@ -34,9 +34,10 @@ func NewCustomMiddleware(level logrus.Level, formatter logrus.Formatter, name st
func (l *Middleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
start := time.Now()
l.Logger.WithFields(logrus.Fields{
- "method": r.Method,
- "request": r.RequestURI,
- "remote": r.RemoteAddr,
+ "method": r.Method,
+ "request": r.RequestURI,
+ "request_id": r.Header.Get("X-Request-Id"),
+ "remote": r.RemoteAddr,
}).Info("started handling request")
next(rw, r)
@@ -47,6 +48,7 @@ func (l *Middleware) ServeHTTP(rw http.ResponseWriter, r *http.Request, next htt
"status": res.Status(),
"method": r.Method,
"request": r.RequestURI,
+ "request_id": r.Header.Get("X-Request-Id"),
"remote": r.RemoteAddr,
"text_status": http.StatusText(res.Status()),
"took": latency, | Add x-request-id field | meatballhat_negroni-logrus | train | go |
c2232b33b062fedd1af346e130780f97ff51591c | diff --git a/master/buildbot/process/buildstep.py b/master/buildbot/process/buildstep.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/process/buildstep.py
+++ b/master/buildbot/process/buildstep.py
@@ -460,9 +460,13 @@ class BuildStep(object, properties.PropertiesMixin):
'useProgress',
'doStepIf',
'hideStepIf',
+ 'description',
+ 'descriptionDone',
]
name = "generic"
+ description = None
+ descriptionDone = None
locks = []
progressMetrics = () # 'time' is implicit
useProgress = True # set to False if step is really unpredictable
@@ -492,6 +496,10 @@ class BuildStep(object, properties.PropertiesMixin):
return self
def describe(self, done=False):
+ if self.descriptionDone and done:
+ return self.descriptionDone
+ elif self.description:
+ return self.description
return [self.name]
def setBuild(self, build): | buildstep.py: Add support for description{,Done}
Add support for attributes description and descriptionDone in the
BuildStep class. This means that any subclass of BuildStep will also
support these attributes as well. This was not previously the case. | buildbot_buildbot | train | py |
b06616f841043fbcd8e8a6ff691c1b683050dec0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -217,7 +217,11 @@ scripts = glob.glob('src/python/tools/*.py')
setup(
name = 'atomistica',
- version = '0.1',
+ version = '0.3.2',
+ description = 'Atomistica is a library of interatomic potentials that is compatible with ASE and LAMMPS',
+ maintainer = 'Lars Pastewka',
+ maintainer_email = 'lars.pastewka@kit.edu',
+ license = 'GPLv3',
packages = [
'atomistica'
], | Python: Updated version information and added description, maintainer, and license. | Atomistica_atomistica | train | py |
b1d8c28c7359de130dbff5d4b0407f9fb865469d | diff --git a/packages/ember-routing/lib/system/router.js b/packages/ember-routing/lib/system/router.js
index <HASH>..<HASH> 100644
--- a/packages/ember-routing/lib/system/router.js
+++ b/packages/ember-routing/lib/system/router.js
@@ -6,7 +6,7 @@
var Router = requireModule("router");
var get = Ember.get, set = Ember.set, classify = Ember.String.classify;
-var DefaultView = Ember.View.extend(Ember._Metamorph);
+var DefaultView = Ember._MetamorphView;
require("ember-routing/system/dsl"); | Micro change, Ember._MetamorphView already exists, lets just re-use? | emberjs_ember.js | train | js |
647fdd8229bc94c9cc8c7cf655496d0de258272a | diff --git a/source/rafcon/gui/controllers/library_tree.py b/source/rafcon/gui/controllers/library_tree.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/controllers/library_tree.py
+++ b/source/rafcon/gui/controllers/library_tree.py
@@ -295,7 +295,8 @@ class LibraryTreeController(ExtendedController):
def open_run_button_clicked(self, widget):
from rafcon.core.singleton import state_machine_execution_engine
state_machine = self.open_library_as_state_machine()
- state_machine_execution_engine.start(state_machine.state_machine_id)
+ if state_machine:
+ state_machine_execution_engine.start(state_machine.state_machine_id)
def open_library_as_state_machine(self):
import rafcon.gui.helpers.state_machine as gui_helper_state_machine
@@ -305,7 +306,8 @@ class LibraryTreeController(ExtendedController):
logger.debug("Opening library as state-machine from path '{0}'".format(physical_library_path))
state_machine = gui_helper_state_machine.open_state_machine(physical_library_path)
- global_runtime_config.update_recently_opened_state_machines_with(state_machine)
+ if state_machine:
+ global_runtime_config.update_recently_opened_state_machines_with(state_machine)
return state_machine
def get_menu_item_text(self, menu_item): | fix(library_tree): Make more fail safe
Handle cases where no state machine is returned | DLR-RM_RAFCON | train | py |
d118db07abdaafa26debd553d00e41ca060acf86 | diff --git a/lib/celluloid/timers.rb b/lib/celluloid/timers.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/timers.rb
+++ b/lib/celluloid/timers.rb
@@ -73,7 +73,7 @@ module Celluloid
# The timer system is guaranteed (at least by the specs) to be this precise
# during normal operation. Long blocking calls within actors will delay the
# firing of timers
- QUANTUM = 0.02
+ QUANTUM = 0.05
attr_reader :interval, :time, :recurring | Increase time quantum to prevent sporadic spec failures | celluloid_celluloid | train | rb |
b72fdbe194401f1be21f8ad7b6e3f784a0ad197d | diff --git a/lib/did_you_mean/spell_checkers/name_error_checkers.rb b/lib/did_you_mean/spell_checkers/name_error_checkers.rb
index <HASH>..<HASH> 100644
--- a/lib/did_you_mean/spell_checkers/name_error_checkers.rb
+++ b/lib/did_you_mean/spell_checkers/name_error_checkers.rb
@@ -2,12 +2,8 @@ require 'did_you_mean/spell_checkers/name_error_checkers/class_name_checker'
require 'did_you_mean/spell_checkers/name_error_checkers/variable_name_checker'
module DidYouMean
- module NameErrorCheckers
- def self.included(*)
- raise "Do not include this module since it overrides Class.new method."
- end
-
- def self.new(exception)
+ class << (NameErrorCheckers = Object.new)
+ def new(exception)
case exception.original_message
when /uninitialized constant/
ClassNameChecker | prohibit including `NameErrorCheckers`
`included` is called after the module has been included, and not called when `Object#extend`. | yuki24_did_you_mean | train | rb |
c78e1fd6488a97b313c6961c7784e93b26109829 | diff --git a/wily/__init__.py b/wily/__init__.py
index <HASH>..<HASH> 100644
--- a/wily/__init__.py
+++ b/wily/__init__.py
@@ -7,7 +7,7 @@ import colorlog
import datetime
-__version__ = "1.5.0b2"
+__version__ = "1.5.0b3"
_handler = colorlog.StreamHandler()
_handler.setFormatter(colorlog.ColoredFormatter("%(log_color)s%(message)s")) | bump to <I>b3 | tonybaloney_wily | train | py |
68bb7802e59096de4161b4addf5c48e2e7d2aaae | diff --git a/src/Auth/DatabaseUserProvider.php b/src/Auth/DatabaseUserProvider.php
index <HASH>..<HASH> 100644
--- a/src/Auth/DatabaseUserProvider.php
+++ b/src/Auth/DatabaseUserProvider.php
@@ -91,10 +91,12 @@ class DatabaseUserProvider extends UserProvider
*/
public function retrieveByCredentials(array $credentials)
{
+ $user = null;
+
try {
$user = Resolver::byCredentials($credentials);
} catch (BindException $e) {
- if (!$this->isFallingBack()) {
+ if (! $this->isFallingBack()) {
throw $e;
}
} | Ensure variable exists and always make sure to triple check all PR's :sweat_smile:
#<I> | Adldap2_Adldap2-Laravel | train | php |
bd6266f7f7091ea22b3316cec252219929baff33 | diff --git a/tests/test_backend.py b/tests/test_backend.py
index <HASH>..<HASH> 100644
--- a/tests/test_backend.py
+++ b/tests/test_backend.py
@@ -91,7 +91,9 @@ def test_invalidate_cache(get_cluster_info):
backend.get('key1', 'val')
except Exception:
pass
- backend._local._client = None
+ # invalidate cached client
+ container = getattr(backend, '_local', backend)
+ container._client = None
try:
backend.get('key1', 'val')
except Exception: | fix tests for django<I> support | gusdan_django-elasticache | train | py |
cb47a28c10e1865744cbe5d20173e537dd6e21f4 | diff --git a/packages/@vue/eslint-config-airbnb/index.js b/packages/@vue/eslint-config-airbnb/index.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/eslint-config-airbnb/index.js
+++ b/packages/@vue/eslint-config-airbnb/index.js
@@ -23,6 +23,14 @@ module.exports = {
jsx: 'never',
ts: 'never',
tsx: 'never'
+ }],
+ 'no-param-reassign': ['error', {
+ props: true,
+ ignorePropertyModificationsFor: [
+ 'state', // for vuex state
+ 'acc', // for reduce accumulators
+ 'e' // for e.returnvalue
+ ]
}]
}
} | fix: airbnb lint should not warn on vuex state mutation (#<I>)
close #<I> | vuejs_vue-cli | train | js |
55e06d23410910a9ad534f113e576d08c4533224 | diff --git a/v1/client.go b/v1/client.go
index <HASH>..<HASH> 100644
--- a/v1/client.go
+++ b/v1/client.go
@@ -74,9 +74,14 @@ func NewClient(urlString string) (*Client, error) {
return nil, err
}
+ token := os.Getenv("ATLAS_TOKEN")
+ if token != "" {
+ log.Printf("[DEBUG] using ATLAS_TOKEN (%s)", maskString(token))
+ }
+
client := &Client{
URL: parsedURL,
- Token: os.Getenv("ATLAS_TOKEN"),
+ Token: token,
}
if err := client.init(); err != nil { | Log when the token is used from the environment | hashicorp_atlas-go | train | go |
b58a7f0b208737c0496d5999082263494e2a36da | diff --git a/bitstream_test.go b/bitstream_test.go
index <HASH>..<HASH> 100644
--- a/bitstream_test.go
+++ b/bitstream_test.go
@@ -28,6 +28,6 @@ func TestStream(t *testing.T) {
s := buf.String()
if s != "hello" {
- t.Error("got s=%s expected 'hello'", s)
+ t.Error("expected 'hello', got=", s)
}
} | t.Error() doesn't need a format string (go vet) | dgryski_go-bitstream | train | go |
ad666224c56429ff4b5360bd8caad599e37dd5ed | diff --git a/lib/infer.js b/lib/infer.js
index <HASH>..<HASH> 100644
--- a/lib/infer.js
+++ b/lib/infer.js
@@ -257,7 +257,7 @@
this.self.propagate(fn.self, this.self == cx.topScope ? WG_GLOBAL_THIS : weight);
if (!fn.computeRet)
fn.retval.propagate(this.retval, weight);
- else if ((this.computed = (this.computed || 0) + 1) < 5)
+ else
fn.computeRet(this.self, this.args, this.argNodes).propagate(this.retval, weight);
},
typeHint: function() { | Remove unnecessary kludge in IsCallee | ternjs_tern | train | js |
5f7e16d8094cc0b66ef16aab9186bc0c34cd8daf | diff --git a/client/deis.py b/client/deis.py
index <HASH>..<HASH> 100755
--- a/client/deis.py
+++ b/client/deis.py
@@ -66,7 +66,7 @@ from docopt import DocoptExit
import requests
import yaml
-__version__ = '0.9.0'
+__version__ = '0.10.0'
locale.setlocale(locale.LC_ALL, '')
diff --git a/client/setup.py b/client/setup.py
index <HASH>..<HASH> 100755
--- a/client/setup.py
+++ b/client/setup.py
@@ -28,7 +28,7 @@ else:
setup(name='deis',
- version='0.9.0',
+ version='0.10.0',
license=APACHE_LICENSE,
description='Command-line Client for Deis, the open PaaS',
author='OpDemand',
diff --git a/controller/deis/__init__.py b/controller/deis/__init__.py
index <HASH>..<HASH> 100644
--- a/controller/deis/__init__.py
+++ b/controller/deis/__init__.py
@@ -9,4 +9,4 @@ from __future__ import absolute_import
from .celery import app # noqa
-__version__ = '0.9.0'
+__version__ = '0.10.0' | Switch master to <I>. | deis_deis | train | py,py,py |
095e79b043810498b053f67ea35c004258579118 | diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js
index <HASH>..<HASH> 100644
--- a/lib/browser/api/web-contents.js
+++ b/lib/browser/api/web-contents.js
@@ -115,8 +115,8 @@ const asyncWebFrameMethods = function (requestId, method, callback, ...args) {
this.send('ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD', requestId, method, args)
ipcMain.once(`ELECTRON_INTERNAL_BROWSER_ASYNC_WEB_FRAME_RESPONSE_${requestId}`, function (event, error, result) {
if (error == null) {
- if (callback != null) callback(result)
resolve(result)
+ if (typeof callback === 'function') callback(result)
} else {
reject(error)
} | Ensure the callback is a function when executing JS | electron_electron | train | js |
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.