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 |
|---|---|---|---|---|---|
7f550982b928c9ffb4924fbacd359e5db818b5fa | diff --git a/spyder_notebook/notebookplugin.py b/spyder_notebook/notebookplugin.py
index <HASH>..<HASH> 100644
--- a/spyder_notebook/notebookplugin.py
+++ b/spyder_notebook/notebookplugin.py
@@ -23,7 +23,7 @@ import nbformat
# Spyder imports
from spyder.config.base import _
from spyder.utils import icon_manager as ima
-from spyder.utils.qthelpers import create_action
+from spyder.utils.qthelpers import create_action, create_toolbutton
from spyder.widgets.tabs import Tabs
from spyder.plugins import SpyderPluginWidget
from spyder.py3compat import to_text_string
@@ -57,7 +57,13 @@ class NotebookPlugin(SpyderPluginWidget):
self.initialize_plugin()
layout = QVBoxLayout()
- self.tabwidget = Tabs(self, self.menu_actions)
+ new_notebook_btn = create_toolbutton(self,
+ icon=ima.icon('project_expanded'),
+ tip=_('Open a new notebook'),
+ triggered=self.create_new_client)
+ corner_widgets = {Qt.TopRightCorner: [new_notebook_btn]}
+ self.tabwidget = Tabs(self, actions=self.menu_actions,
+ corner_widgets=corner_widgets)
if hasattr(self.tabwidget, 'setDocumentMode') \
and not sys.platform == 'darwin':
# Don't set document mode to true on OSX because it generates | Added button to open new notebooks. | spyder-ide_spyder-notebook | train | py |
73f3a17fb0a411fd203a1a0c4eb17515c7f4935b | diff --git a/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java b/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java
+++ b/core/src/main/java/com/digitalpebble/stormcrawler/filtering/depth/MaxDepthFilter.java
@@ -49,6 +49,7 @@ public class MaxDepthFilter implements URLFilter {
maxDepth = -1;
LOG.warn("maxDepth parameter not found");
}
+ LOG.info("maxDepth set to {}", maxDepth);
}
@Override
@@ -67,12 +68,13 @@ public class MaxDepthFilter implements URLFilter {
return url;
}
- private String filter(int depth, int max, String url) {
+ private String filter(final int depth, final int max, final String url) {
// deactivate the outlink no matter what the depth is
if (max == 0) {
return null;
}
if (depth >= max) {
+ LOG.info("filtered out {} - depth {} >= {}", url, depth, maxDepth);
return null;
}
return url; | minor - addnig more logs to depth filter | DigitalPebble_storm-crawler | train | java |
bd964c999f83009e4c1dbe606cfc325fd0176c23 | diff --git a/Generator/Tests.php b/Generator/Tests.php
index <HASH>..<HASH> 100644
--- a/Generator/Tests.php
+++ b/Generator/Tests.php
@@ -35,7 +35,7 @@ class Tests extends PHPFile {
$test_file_name = $module_root_name . "Test.php";
// The key is arbitrary (at least so far!).
- $files['module.test'] = array(
+ $files['%module.test'] = array(
'path' => 'src/Tests',
'filename' => $test_file_name,
'body' => $this->file_contents(),
diff --git a/Generator/Tests7.php b/Generator/Tests7.php
index <HASH>..<HASH> 100644
--- a/Generator/Tests7.php
+++ b/Generator/Tests7.php
@@ -21,8 +21,8 @@ class Tests7 extends Tests {
$module_root_name = $this->base_component->component_data['root_name'];
// Change the file location for D7.
- $files['module.test']['path'] = 'tests';
- $files['module.test']['filename'] = "$module_root_name.test";
+ $files['%module.test']['path'] = 'tests';
+ $files['%module.test']['filename'] = "%module.test";
return $files;
} | Changed key in file info array for Tests component to follow de facto pattern. | drupal-code-builder_drupal-code-builder | train | php,php |
be1c01355fedba4ce0545ca58a3ce4a614278de6 | diff --git a/src/Http/Controllers/UserController.php b/src/Http/Controllers/UserController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/UserController.php
+++ b/src/Http/Controllers/UserController.php
@@ -34,16 +34,15 @@ class UserController
*/
public function login($userId, $guard = null)
{
- $model = $this->modelForGuard(
- $guard = $guard ?: config('auth.defaults.guard')
- );
+ $userProvider = Auth::getProvider();
if (str_contains($userId, '@')) {
- $user = (new $model)->where('email', $userId)->first();
+ $user = $userProvider->retrieveByCredentials(['email' => $userId]);
} else {
- $user = (new $model)->find($userId);
+ $user = $userProvider->retrieveById($userId);
}
+ $guard = $guard ?: config('auth.defaults.guard');
Auth::guard($guard)->login($user);
} | Use configured UserProvider instead of Eloquent to retrieve user instance | laravel_dusk | train | php |
1fcc260dbd39073b2769541e2b8604e26a5009ce | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -356,5 +356,8 @@ setup(name='jpy',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
]) | Update supported Python versions in setup.py | bcdev_jpy | train | py |
924f8b2ae6c5222687421e7243bff3eba39c1142 | diff --git a/src/state.js b/src/state.js
index <HASH>..<HASH> 100644
--- a/src/state.js
+++ b/src/state.js
@@ -161,7 +161,9 @@ function run(state) {
return state.runChain(SETUP);
}
}).then(function() {
- if (refer.stage) return refer.runChain(CLOSE);
+ if (refer.stage && !samePathname) {
+ return refer.runChain(CLOSE);
+ }
});
}).then(function() {
if (samePathname) { | Do not run close when pathname is the same | kapouer_window-page | train | js |
3683f23f50dfe433cf4963e74b426471e6e63cc4 | diff --git a/lib/db.js b/lib/db.js
index <HASH>..<HASH> 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -49,8 +49,8 @@ function updateIndexes(entry, callback)
db.indexes.updated.set(torrent.infoHash, torrent.updated);
if (torrent.files) torrent.files.forEach(function(x) {
getHashes(x).forEach(function(hash) {
- ( (maxSeeders > cfg.minSeedToIndex) ? db.indexes.meta.insert : db.indexes.meta.delete)
- .bind(db.indexes.meta)(hash, torrent.infoHash);
+ db.indexes.meta.delete(hash, torrent.infoHash); // always ensure there are no duplicates
+ if (maxSeeders > cfg.minSeedToIndex) db.indexes.meta.insert(hash, torrent.infoHash);
});
});
callback && callback(); | DB: fix bug with double-indexing torrents | jaruba_multipass-torrent | train | js |
56c5bec9085cf58b9994bd3e38975790161f0004 | diff --git a/internal/gamepaddb/gamepaddb.go b/internal/gamepaddb/gamepaddb.go
index <HASH>..<HASH> 100644
--- a/internal/gamepaddb/gamepaddb.go
+++ b/internal/gamepaddb/gamepaddb.go
@@ -14,7 +14,10 @@
// gamecontrollerdb.txt is downloaded at https://github.com/gabomdq/SDL_GameControllerDB.
-//go:generate curl --location --remote-name https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
+// To update the database file, run:
+//
+// curl --location --remote-name https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
+
//go:generate file2byteslice -package gamepaddb -input=./gamecontrollerdb.txt -output=./gamecontrollerdb.txt.go -var=gamecontrollerdbTxt
package gamepaddb | internal/gamepaddb: Do not fetch the database file on go:generate
This is too aggressive and sometimes risky to update the database
file always when go-generate is executed. | hajimehoshi_ebiten | train | go |
7b80c2f4db226d6fa3a7f3dfa59277da1d642f91 | diff --git a/tornado/httpserver.py b/tornado/httpserver.py
index <HASH>..<HASH> 100644
--- a/tornado/httpserver.py
+++ b/tornado/httpserver.py
@@ -26,6 +26,7 @@ import logging
import os
import socket
import time
+import urllib
import urlparse
try:
@@ -398,7 +399,8 @@ class HTTPRequest(object):
self._finish_time = None
scheme, netloc, path, query, fragment = urlparse.urlsplit(uri)
- self.path = path
+ self.raw_path = path
+ self.path = urllib.unquote(path)
self.query = query
arguments = cgi.parse_qs(query)
self.arguments = {} | Parse percent escapes in the path component of the uri, to be more
consistent with our handling of query parameters (especially important
when capturing groups are used in the URLSpec regex).
This change is slightly backwards-incompatible: applications that have
already added an unquote() call on arguments to RequestHandler.get/post
or use percent escapes in URLSpec patterns will need to remove them. | tornadoweb_tornado | train | py |
ebcd4894d71cc3da750173531dc411b4293018aa | diff --git a/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java b/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java
index <HASH>..<HASH> 100644
--- a/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java
+++ b/tika/src/main/java/fr/pilato/elasticsearch/crawler/fs/tika/TikaInstance.java
@@ -93,14 +93,13 @@ public class TikaInstance {
logger.debug("But Tesseract is not installed so we won't run OCR.");
pdfParser.setOcrStrategy("no_ocr");
}
- defaultParser = new DefaultParser();
+ defaultParser = new DefaultParser(
+ MediaTypeRegistry.getDefaultRegistry(),
+ new ServiceLoader(),
+ Collections.singletonList(PDFParser.class));
}
- Parser PARSERS[] = new Parser[2];
- PARSERS[0] = defaultParser;
- PARSERS[1] = pdfParser;
-
- parser = new AutoDetectParser(PARSERS);
+ parser = new AutoDetectParser(defaultParser, pdfParser);
}
} | Exclude the PDFParser from the DefaultParser
After [a discussion](<URL>) with @tballison, I realized that I did not exclude the PDFParser from the DefaultParser while I'm using a custom AutoDetectParser which is using the DefaultParser and the PDFParser.
This change removes the PDFParser from the DefaultParser. | dadoonet_fscrawler | train | java |
67b244e704b48b47f06d6617660ffccad73dc4b4 | diff --git a/holoviews/core/data.py b/holoviews/core/data.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/data.py
+++ b/holoviews/core/data.py
@@ -621,8 +621,6 @@ class DFColumns(DataColumns):
element_kwargs = dict(util.get_param_values(columns),
kdims=element_dims)
element_kwargs.update(kwargs)
- names = [d.name for d in columns.dimensions()
- if d not in dimensions]
map_data = [(k, group_type(v, **element_kwargs))
for k, v in columns.data.groupby(dimensions)]
with item_check(False), sorted_context(False): | Removed unused variable definition in DFColumns.groupby | pyviz_holoviews | train | py |
86c468de58e1f90e38e6f6df3d65ce1aaf78f13d | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -112,7 +112,7 @@ function getGroupMemberUids(groupRecipients, callback) {
return callback(err);
}
async.map(groups, function(group, next) {
- Groups.getMembers(group, next);
+ Groups.getMembers(group, 0, -1, next);
}, function(err, results) {
if (err) {
return callback(err); | getMembers takes start end now | julianlam_nodebb-plugin-mentions | train | js |
8ef8321b3176966d8be5c73e4adcbb136b4b9b7e | diff --git a/rqalpha/main.py b/rqalpha/main.py
index <HASH>..<HASH> 100644
--- a/rqalpha/main.py
+++ b/rqalpha/main.py
@@ -335,10 +335,10 @@ def _exception_handler(e):
user_system_log.error(e.error)
if not is_user_exc(e.error.exc_val):
code = const.EXIT_CODE.EXIT_INTERNAL_ERROR
- system_log.exception(_(u"strategy execute exception"))
+ system_log.error(_(u"strategy execute exception"), exc=e)
else:
code = const.EXIT_CODE.EXIT_USER_ERROR
- user_detail_log.exception(_(u"strategy execute exception"))
+ user_detail_log.error(_(u"strategy execute exception"), exc=e)
return code | fix exc_info is replace when trigger __repr__ | ricequant_rqalpha | train | py |
7ecb75ace4750571e541a4d7c50cd66b38afec9c | diff --git a/ldapdomaindump/__init__.py b/ldapdomaindump/__init__.py
index <HASH>..<HASH> 100644
--- a/ldapdomaindump/__init__.py
+++ b/ldapdomaindump/__init__.py
@@ -457,7 +457,7 @@ class reportWriter(object):
if attr is None:
return outflags
for flag, val in iteritems(flags_def):
- if attr.value & val:
+ if attr.value != None and attr.value & val:
outflags.append(flag)
return outflags | #<I> Skip flags whose attribute values are of None | dirkjanm_ldapdomaindump | train | py |
e46d1815558467a6a5bf974b9c3bf83f346ee236 | diff --git a/src/SectionField/Generator/EntityGenerator.php b/src/SectionField/Generator/EntityGenerator.php
index <HASH>..<HASH> 100644
--- a/src/SectionField/Generator/EntityGenerator.php
+++ b/src/SectionField/Generator/EntityGenerator.php
@@ -224,6 +224,8 @@ class EntityGenerator extends Generator implements GeneratorInterface
}
}
+ unset($info);
+
usort($this->prePersistInfo, function($a, $b) {
return
$a['config'][self::GENERATE_FOR]['prePersistOrder'] <=> | Fix issue where referenced variable causes issues
<URL> | dionsnoeijen_sexy-field-entity | train | php |
030c1ff65d580771e978de1c27594f89313e2467 | diff --git a/Generator/Module.php b/Generator/Module.php
index <HASH>..<HASH> 100644
--- a/Generator/Module.php
+++ b/Generator/Module.php
@@ -338,9 +338,6 @@ class Module extends RootComponent {
// Modules always have a .info file.
$components['info'] = 'Info';
- // TODO: this should only be on D7 and lower.
- $components['%module.module'] = 'ModuleCodeFile';
-
return $components;
}
diff --git a/Generator/Module7.php b/Generator/Module7.php
index <HASH>..<HASH> 100644
--- a/Generator/Module7.php
+++ b/Generator/Module7.php
@@ -24,4 +24,16 @@ class Module7 extends Module {
return $component_data_definition;
}
+ /**
+ * {@inheritdoc}
+ */
+ protected function requiredComponents() {
+ $components = parent::requiredComponents();
+
+ // On D7 and lower, modules need a .module file, even if empty.
+ $components['%module.module'] = 'ModuleCodeFile';
+
+ return $components;
+ }
+
} | Fixed empty .module being generated on D8. | drupal-code-builder_drupal-code-builder | train | php,php |
26f5820c95d51163f068a30c9c934a351a256fa2 | diff --git a/examples/CustomArrows.js b/examples/CustomArrows.js
index <HASH>..<HASH> 100644
--- a/examples/CustomArrows.js
+++ b/examples/CustomArrows.js
@@ -4,14 +4,26 @@ import Slider from '../src/slider'
var SampleNextArrow = createReactClass({
render: function() {
- return <div {...this.props} style={{display: 'block', background: 'red'}}></div>;
+ const {className, style, onClick} = this.props
+ return (
+ <div
+ className={className}
+ style={{...style, display: 'block', background: 'red'}}
+ onClick={onClick}
+ ></div>
+ );
}
});
var SamplePrevArrow = createReactClass({
render: function() {
+ const {className, style, onClick} = this.props
return (
- <div {...this.props} style={{display: 'block', background: 'red'}}></div>
+ <div
+ className={className}
+ style={{...style, display: 'block', background: 'green'}}
+ onClick={onClick}
+ ></div>
);
}
});
@@ -40,4 +52,4 @@ export default class CustomArrows extends Component {
</div>
);
}
-}
\ No newline at end of file
+} | Fix an issue with custom arrows example | akiran_react-slick | train | js |
b6aad353477fdb2e355d10bf252e28805a90f90e | diff --git a/blockstack/lib/rpc.py b/blockstack/lib/rpc.py
index <HASH>..<HASH> 100644
--- a/blockstack/lib/rpc.py
+++ b/blockstack/lib/rpc.py
@@ -587,10 +587,6 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
if 'zonefile' in name_rec:
zonefile_txt = base64.b64decode(name_rec['zonefile'])
- res = decode_name_zonefile(name, zonefile_txt)
- if res is None:
- log.error("Failed to parse zone file for {}".format(name))
- zonefile_txt = {'error': 'Non-standard zone file'}
ret = {}
@@ -604,7 +600,7 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
ret = {
'status': 'registered_subdomain',
'zonefile': zonefile_txt,
- 'zonefile_hash': name_rec['zonefile_hash'],
+ 'zonefile_hash': name_rec['value_hash'],
'address': name_rec['address'],
'blockchain': 'bitcoin',
'last_txid': name_rec['txid'], | don't even try to decode the zone file on GET /v1/names. It's not necessary. | blockstack_blockstack-core | train | py |
65c19125fd8c697fc5ef26b1cd381b49fb4d99cd | diff --git a/src/api.js b/src/api.js
index <HASH>..<HASH> 100644
--- a/src/api.js
+++ b/src/api.js
@@ -155,12 +155,8 @@ API.get = function(cfg, name, inheriting) {
API.set = function(cfg, name, value, parentName) {
var api = cfg._fn,
subname = parentName+(name.charAt(0)==='.'?'':'.')+name;
- // always bind functions to the cfg
- if (typeof value === "function") {
- value = value.bind(cfg);
- if (API.get(cfg, 'debug')) {
- value = API.debug(subname, value);
- }
+ if (typeof value === "function" && API.get(cfg, 'debug')) {
+ value = API.debug(subname, value);
}
if (name.charAt(0) === '.') {
api[name.substring(1)] = value;
@@ -217,8 +213,9 @@ API.combine = function(pval, val) {
API.combineFn = function(pfn, fn) {
return function combined(res) {
- //TODO: reconsider whether falsey return values should be respected
- return fn(pfn(res) || res) || res;
+ var ret = pfn.call(this, res);
+ ret = fn.call(this, ret === undefined ? res : ret);
+ return ret === undefined ? res : ret;
};
}; | respect falsey values (except undefined) | esha_posterior | train | js |
68ec3b6dcd2806ad0d78f3e3cadc279ecd9e0136 | diff --git a/examples/qidle/qidle.py b/examples/qidle/qidle.py
index <HASH>..<HASH> 100644
--- a/examples/qidle/qidle.py
+++ b/examples/qidle/qidle.py
@@ -1,13 +1,13 @@
#! /usr/bin/python3
# -*- coding: utf-8 -*-
+import logging
import sys
+filename = None
+if sys.platform == 'win32':
+ filename = 'qidle.log'
+logging.basicConfig(level=logging.INFO, filename=filename)
from qidle import main
-import logging
if __name__ == '__main__':
- filename = None
- if sys.platform == 'win32':
- filename = 'qidle.log'
- logging.basicConfig(level=logging.INFO, filename=filename)
main() | QIdle: setup logging before importing pyqode
so that the qt api log appears | pyQode_pyqode.python | train | py |
705ad28816826430217e4071803d28d48caf6d4a | diff --git a/javascript/atoms/html5/html5_browser.js b/javascript/atoms/html5/html5_browser.js
index <HASH>..<HASH> 100644
--- a/javascript/atoms/html5/html5_browser.js
+++ b/javascript/atoms/html5/html5_browser.js
@@ -129,7 +129,7 @@ bot.html5.isSupported = function(api, opt_window) {
// supports this.
// Geolocation doesn't respond on Safari5 on Windows, see:
// https://discussions.apple.com/thread/3547900
- if (bot.html5.IS_FF_3_OR_4_ || bot.html5.IS_SAFARI5_WINDOWS_) {
+ if (goog.userAgent.GECKO || bot.html5.IS_SAFARI5_WINDOWS_) {
return false;
}
return goog.isDefAndNotNull(win.navigator) && | SimonStewart: Ignore geo tests for all versions of Firefox until we know how to enable them without prompting the user.
r<I> | SeleniumHQ_selenium | train | js |
456a435c335f3c65669fa7af4335a30cb157d62d | diff --git a/marrow/schema/compat.py b/marrow/schema/compat.py
index <HASH>..<HASH> 100644
--- a/marrow/schema/compat.py
+++ b/marrow/schema/compat.py
@@ -2,10 +2,15 @@
import sys
-if sys.version_info > (3, ): # pragma: no cover
+py2 = sys.version_info < (3, )
+py3 = sys.version_info > (3, )
+
+if py3: # pragma: no cover
unicode = str
str = bytes
else: # pragma: no cover
+ unicode = unicode
+ str = str
range = xrange
try: # pragma: no cover | Added simple boolean helpers and added missing builtins. | marrow_schema | train | py |
b7988cf09160a33f6c696d32ff6500f473a85150 | diff --git a/algoliasearch/index_iterator.go b/algoliasearch/index_iterator.go
index <HASH>..<HASH> 100644
--- a/algoliasearch/index_iterator.go
+++ b/algoliasearch/index_iterator.go
@@ -28,7 +28,6 @@ func (it *indexIterator) Next() (res Map, err error) {
// Abort if the user call `Next()` on a IndexIterator that has been
// initialized without being able to load the first page.
if len(it.page.Hits) == 0 {
- //err = errors.New("No more hits")
err = NoMoreHitsErr
return
}
@@ -38,7 +37,6 @@ func (it *indexIterator) Next() (res Map, err error) {
// been returned.
if it.pos == len(it.page.Hits) {
if it.cursor == "" {
- //err = errors.New("No more hits")
err = NoMoreHitsErr
} else {
err = it.loadNextPage()
@@ -64,7 +62,6 @@ func (it *indexIterator) loadNextPage() (err error) {
// Return an error if the newly loaded pages contains no results
if len(it.page.Hits) == 0 {
- //err = errors.New("No more hits")
err = NoMoreHitsErr
return
} | refactor: Remove commented dead code | algolia_algoliasearch-client-go | train | go |
93ed1d6b0a6c8ce97bb733afb14fc5bc3e62900e | diff --git a/spec/network/tcp_spec.rb b/spec/network/tcp_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/network/tcp_spec.rb
+++ b/spec/network/tcp_spec.rb
@@ -113,13 +113,13 @@ describe Network::TCP do
end
describe "#tcp_banner" do
- let(:host) { 'smtp.gmail.com' }
- let(:port) { 25 }
+ let(:host) { 'smtp.gmail.com' }
+ let(:port) { 25 }
let(:local_port) { 1024 + rand(65535 - 1024) }
let(:expected_banner) { /^220 mx\.google\.com ESMTP/ }
- it "should read the service banner" do
+ it "should return the read service banner" do
banner = subject.tcp_banner(host,port)
banner.should =~ expected_banner
@@ -140,6 +140,25 @@ describe Network::TCP do
banner.should =~ expected_banner
end
+
+ context "when no banner could be read" do
+ let(:bad_host) { 'localhost' }
+ let(:bad_port) { 1337 }
+
+ it "should return nil" do
+ subject.tcp_banner(bad_host,bad_port).should == nil
+ end
+
+ it "should not yield anything" do
+ yielded = false
+
+ subject.tcp_banner(bad_host,bad_port) do |banner|
+ yielded = true
+ end
+
+ yielded.should == false
+ end
+ end
end
describe "#tcp_send" do | Add specs for when no banner could be read. | ronin-ruby_ronin-support | train | rb |
48ab23d6ee02056bac9accbc2e1cef9c4fc0981a | diff --git a/models/classes/runner/QtiRunnerServiceContext.php b/models/classes/runner/QtiRunnerServiceContext.php
index <HASH>..<HASH> 100644
--- a/models/classes/runner/QtiRunnerServiceContext.php
+++ b/models/classes/runner/QtiRunnerServiceContext.php
@@ -143,11 +143,6 @@ class QtiRunnerServiceContext extends RunnerServiceContext
*/
public function init()
{
- // code borrowed from the previous implementation, maybe obsolete...
- /** @var SessionStateService $sessionStateService */
- $sessionStateService = $this->getServiceManager()->get(SessionStateService::SERVICE_ID);
- $sessionStateService->resumeSession($this->getTestSession());
-
$this->retrieveItemIndex();
} | Do not resume paused session on runner actions | oat-sa_extension-tao-testqti | train | php |
e3b149293afaabf1de6df195e79518378d2b073f | diff --git a/lib/hamlit/attribute_builder.rb b/lib/hamlit/attribute_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/hamlit/attribute_builder.rb
+++ b/lib/hamlit/attribute_builder.rb
@@ -80,7 +80,12 @@ module Hamlit::AttributeBuilder
def build_data_attribute(key, escape_attrs, quote, *hashes)
attrs = []
- hash = flatten_attributes(key => hashes.first)
+ if hashes.size > 1 && hashes.all? { |h| h.is_a?(Hash) }
+ data_value = merge_all_attrs(hashes)
+ else
+ data_value = hashes.last
+ end
+ hash = flatten_attributes(key => data_value)
hash.sort_by(&:first).each do |key, value|
case value | Deal with multiple data attrs correctly | haml_haml | train | rb |
c5f42fb2e5b444fba9ede2cedba2c713b1b9dee0 | diff --git a/lxd/device/disk.go b/lxd/device/disk.go
index <HASH>..<HASH> 100644
--- a/lxd/device/disk.go
+++ b/lxd/device/disk.go
@@ -69,7 +69,7 @@ type diskSourceNotFoundError struct {
}
func (e diskSourceNotFoundError) Error() string {
- return e.msg
+ return fmt.Sprintf("%s: %v", e.msg, e.err)
}
func (e diskSourceNotFoundError) Unwrap() error { | lxd/device/disk: Included wrapped error in diskSourceNotFoundError | lxc_lxd | train | go |
37c751726dd66a5d32167768e44a53b2daf0d620 | diff --git a/tests/test_stemmers.py b/tests/test_stemmers.py
index <HASH>..<HASH> 100644
--- a/tests/test_stemmers.py
+++ b/tests/test_stemmers.py
@@ -44,3 +44,10 @@ def test_slovak_stemmer():
assert type(actual) is type(expected)
assert expected.__dict__ == actual.__dict__
+
+
+def test_greek_stemmer():
+ greek_stemmer = Stemmer("greek")
+ # The first assert covers the empty stem case.
+ assert "οτ" == greek_stemmer("όταν")
+ assert "εργαζ" == greek_stemmer("εργαζόμενος") | Add test that reproduces the empty stem bug in the greek stemmer | miso-belica_sumy | train | py |
11803a1811cb7b3cc892bd69d68a6de16d59db2b | diff --git a/pachyderm/generic_config.py b/pachyderm/generic_config.py
index <HASH>..<HASH> 100644
--- a/pachyderm/generic_config.py
+++ b/pachyderm/generic_config.py
@@ -350,7 +350,6 @@ def unrollNestedDict(d, keys = None):
As an example, consider the input:
- ```
>>> d = {
... "a1" : {
... "b" : {
@@ -372,7 +371,6 @@ def unrollNestedDict(d, keys = None):
>>> next(unroll) == (["a1", "b", "c12"], "obj2")
...
>>> next(unroll) == (["a2", "b", "c3"], "obj3") # Last result.
- ```
Args:
d (dict): Analysis dictionary to unroll (flatten) | Fix docs formatting
It wasn't displaying correctly due to the mix of md and rst | raymondEhlers_pachyderm | train | py |
2e88dfa4062e777c9dec28cfbb8258250dbba3eb | diff --git a/libnetwork/controller.go b/libnetwork/controller.go
index <HASH>..<HASH> 100644
--- a/libnetwork/controller.go
+++ b/libnetwork/controller.go
@@ -801,7 +801,7 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
// If not a stub, then we already have a complete sandbox.
if !s.isStub {
c.Unlock()
- return nil, types.BadRequestErrorf("container %s is already present: %v", containerID, s)
+ return nil, types.ForbiddenErrorf("container %s is already present: %v", containerID, s)
}
// We already have a stub sandbox from the
@@ -836,7 +836,7 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
c.Lock()
if sb.ingress && c.ingressSandbox != nil {
c.Unlock()
- return nil, fmt.Errorf("ingress sandbox already present")
+ return nil, types.ForbiddenErrorf("ingress sandbox already present")
}
if sb.ingress { | Return proper error types on sandbox creation | moby_moby | train | go |
230d3012688dcca4920d61457cb7573db5923d30 | diff --git a/tests/conftest.py b/tests/conftest.py
index <HASH>..<HASH> 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -70,7 +70,7 @@ def spoof(tmpdir_factory, **kwargs):
"""
env = os.environ.copy()
slug = '-'.join(v.replace('.py', '') for v in sorted(kwargs.values()))
- spoofer_base = Path(tmpdir_factory.mktemp('spoofers'))
+ spoofer_base = Path(str(tmpdir_factory.mktemp('spoofers')))
tmpdir = spoofer_base / slug
tmpdir.mkdir(parents=True) | conftest: py<I> path issue | jbarlow83_OCRmyPDF | train | py |
a66eba47250a14ac3f254673acd9aff8a3b118f0 | diff --git a/provision/provisiontest/fake_provisioner.go b/provision/provisiontest/fake_provisioner.go
index <HASH>..<HASH> 100644
--- a/provision/provisiontest/fake_provisioner.go
+++ b/provision/provisiontest/fake_provisioner.go
@@ -53,6 +53,7 @@ func NewFakeApp(name, platform string, units int) *FakeApp {
platform: platform,
units: make([]provision.Unit, units),
instances: make(map[string][]bind.ServiceInstance),
+ Processes: map[string]string{"web": fmt.Sprintf("%s %s.sh", platform, name)},
}
namefmt := "%s-%d"
for i := 0; i < units; i++ { | provision/provisiontest: adding default processes to a fake app | tsuru_tsuru | train | go |
53094e4db590db0f208789f539927af850984aef | diff --git a/scserver.js b/scserver.js
index <HASH>..<HASH> 100644
--- a/scserver.js
+++ b/scserver.js
@@ -877,7 +877,10 @@ SCServer.prototype._passThroughHandshakeSCMiddleware = function (options, cb) {
statusCode = 4008;
}
if (err) {
- if (err === true) {
+ if (err.statusCode != null) {
+ statusCode = err.statusCode;
+ }
+ if (err === true || err.silent) {
err = new SilentMiddlewareBlockedError('Action was silently blocked by ' + self.MIDDLEWARE_HANDSHAKE_SC + ' middleware', self.MIDDLEWARE_HANDSHAKE_SC);
} else if (self.middlewareEmitWarnings) {
self.emit('warning', err); | Add support for custom disconnect status code in handshake middleware when using async function | SocketCluster_socketcluster-server | train | js |
98813d45e4b191eca4812fe81b61b80155a90473 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -63,7 +63,7 @@ module.exports = function dnsmonctor(cfg, cb) {
function(err, oldrecords) { if (err) return cb(err);
// If the old ones aren't the same as the new ones
- if (!equal(records,JSON.parse(oldrecords))) {
+ if (!(oldrecords && equal(records,JSON.parse(oldrecords)))) {
// Mark this domain as processing
db.eval(hshd,2,'processing_domains','querying_domains', | Handle processing of first-time records | stuartpb_aname-poll | train | js |
85bb16a835804cf25e4e9f4c04694d75ff8b2d70 | diff --git a/torchvision/datasets/cifar.py b/torchvision/datasets/cifar.py
index <HASH>..<HASH> 100644
--- a/torchvision/datasets/cifar.py
+++ b/torchvision/datasets/cifar.py
@@ -128,9 +128,9 @@ class CIFAR10(data.Dataset):
def __len__(self):
if self.train:
- return 50000
+ return len(self.train_data)
else:
- return 10000
+ return len(self.test_data)
def _check_integrity(self):
root = self.root | Cifar also returns real data length (#<I>) | pytorch_vision | train | py |
b6504bfa42c9732823cd5ac367481531ba857370 | diff --git a/cpt/__init__.py b/cpt/__init__.py
index <HASH>..<HASH> 100644
--- a/cpt/__init__.py
+++ b/cpt/__init__.py
@@ -1,5 +1,5 @@
-__version__ = '0.32.0-dev'
+__version__ = '0.31.0'
NEWEST_CONAN_SUPPORTED = "1.22.000" | Bump CPT version to <I> | conan-io_conan-package-tools | train | py |
58f843e986a83e1d9d08ecbbe53d02b3ee97c89b | diff --git a/mbuild/bond.py b/mbuild/bond.py
index <HASH>..<HASH> 100755
--- a/mbuild/bond.py
+++ b/mbuild/bond.py
@@ -46,18 +46,10 @@ class Bond(object):
def atom1(self):
return self._atom1
- @atom1.setter
- def atom1(self, v):
- raise TypeError # what's going on here?
-
@property
def atom2(self):
return self._atom2
- @atom2.setter
- def atom2(self, v):
- raise TypeError
-
def ancestors(self):
"""Generate all ancestors of the Compound recursively. | bond's atom1 and atom2 properties are read-only | mosdef-hub_mbuild | train | py |
645416e3678b965077da431c1fada8b4c5d9281c | diff --git a/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java b/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java
index <HASH>..<HASH> 100644
--- a/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java
+++ b/plugin/geomajas-plugin-rasterizing/rasterizing/src/main/java/org/geomajas/plugin/rasterizing/RasterizingController.java
@@ -41,14 +41,10 @@ public class RasterizingController {
@Autowired
private ConfigurationService configurationService;
- @RequestMapping(value = "/rasterizing/{layerId}/{key}.{format}", method = RequestMethod.GET)
+ @RequestMapping(value = "/rasterizing/{layerId}/{key}.png", method = RequestMethod.GET)
public void getWms(@PathVariable String layerId, @PathVariable String key,
HttpServletResponse response) throws Exception {
-// // Search for the WMS layer:
-// String layer = parseLayer(request);
-// String key = parseKey(request);
-
try {
PipelineContext context = pipelineService.createContext();
context.put(RasterizingPipelineCode.IMAGE_ID_KEY, key); | RAST-3 always png, remove commented code | geomajas_geomajas-project-client-gwt2 | train | java |
fb2fd3e29e4f57aa95dcced1ede5546cc17254e9 | diff --git a/src/Controller/Component/PostTypesComponent.php b/src/Controller/Component/PostTypesComponent.php
index <HASH>..<HASH> 100644
--- a/src/Controller/Component/PostTypesComponent.php
+++ b/src/Controller/Component/PostTypesComponent.php
@@ -127,8 +127,8 @@ class PostTypesComponent extends Component
'name' => ucfirst(Inflector::slug(pluginSplit($model)[1])),
'alias' => ucfirst(Inflector::humanize(pluginSplit($model)[1])),
'aliasLc' => lcfirst(Inflector::humanize(pluginSplit($model)[1])),
- 'singluarAlias' => ucfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
- 'singluarAliasLc' => lcfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
+ 'singularAlias' => ucfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
+ 'singularAliasLc' => lcfirst(Inflector::singularize(Inflector::humanize(pluginSplit($model)[1]))),
'description' => null,
'actions' => [
'index' => true, | Typo in singularAlias | cakemanager_cakephp-cakeadmin | train | php |
e891864892e60e578444997495bb63a7bafc6e20 | diff --git a/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java b/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java
+++ b/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/internal/hpel/HpelBaseTraceService.java
@@ -119,8 +119,14 @@ public class HpelBaseTraceService extends BaseTraceService {
//but the results of this call are not actually used anywhere (for traces), so it can be disabled for now
//String traceDetail = formatter.traceLogFormat(logRecord, id, formattedMsg, formattedVerboseMsg);
invokeTraceRouters(routedTrace);
- if (traceSource != null) {
- traceSource.publish(routedTrace, id);
+ try {
+ if (!(counterForTraceSource.incrementCount() > 2)) {
+ if (traceSource != null) {
+ traceSource.publish(routedTrace, id);
+ }
+ }
+ } finally {
+ counterForTraceRouter.decrementCount();
}
trWriter.repositoryPublish(logRecord);
} | Add recursion counters to avoid infinite loop in trace for hpelbts | OpenLiberty_open-liberty | train | java |
d7b359c93f4fbafe6511ba8195e537a6eed7f756 | diff --git a/timeside/server/models.py b/timeside/server/models.py
index <HASH>..<HASH> 100644
--- a/timeside/server/models.py
+++ b/timeside/server/models.py
@@ -209,6 +209,7 @@ class UUID(models.Model):
created = True
return obj, created
+
@classmethod
def get_first(cls, **kwargs):
"""
@@ -580,13 +581,6 @@ class Item(Titled, UUID, Dated, Shareable):
# item.lock_setter(True)
- if not self.hdf5:
- hdf5_file = str(experience.uuid) + '.hdf5'
- self.hdf5 = os.path.join(
- result_path, hdf5_file
- ).replace(settings.MEDIA_ROOT, '')
- self.save()
-
pipe.run()
def set_results_from_processor(proc, preset=None):
@@ -1098,6 +1092,11 @@ class AnalysisTrack(Titled, UUID, Dated, Shareable):
blank=False,
on_delete=models.CASCADE
)
+ color = models.CharField(
+ _('RVB color'),
+ max_length=6,
+ blank=True
+ )
class Meta:
verbose_name = _('Analysis Track') | [server] avoid hdf5 storage in Item | Parisson_TimeSide | train | py |
c2f09e3f00e5e3d87418fb13138406d23f38bfee | diff --git a/tests/ConfigServiceProviderTest.php b/tests/ConfigServiceProviderTest.php
index <HASH>..<HASH> 100644
--- a/tests/ConfigServiceProviderTest.php
+++ b/tests/ConfigServiceProviderTest.php
@@ -95,10 +95,12 @@ class ConfigServiceProviderTest extends TestCase
{
$root = realpath(__DIR__ . '/..');
+ putenv('APP_ENV=true');
putenv('DATABASE_URL=mysql://localhost:3306');
putenv('ROOT_PATH=%ROOT_PATH%');
$this->createFile('env.json', null, json_encode([
+ 'debug' => '%env(bool:APP_ENV)%',
'db.dsn' => '%env(string:DATABASE_URL)%',
'root.path' => '%env(string:ROOT_PATH)%',
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR));
@@ -109,6 +111,7 @@ class ConfigServiceProviderTest extends TestCase
['ROOT_PATH' => $root]
));
+ self::assertTrue($app['debug']);
self::assertSame('mysql://localhost:3306', $app['db.dsn']);
self::assertSame($root, $app['root.path']);
} | Testing resolve of non string environment vars | misantron_silex-config-provider | train | php |
2b088362d47517edd5abbbfbbec85fd5245cfa78 | diff --git a/src/errors/command-format.js b/src/errors/command-format.js
index <HASH>..<HASH> 100644
--- a/src/errors/command-format.js
+++ b/src/errors/command-format.js
@@ -10,11 +10,11 @@ class CommandFormatError extends FriendlyError {
*/
constructor(msg) {
super(
- `Invalid command format. Use ${msg.anyUsage(
- `help ${msg.command.name}`,
+ `Invalid command format. Please use the proper format, ${msg.usage(
+ msg.command.format,
msg.guild ? undefined : null,
msg.guild ? undefined : null
- )} for information.`
+ )}.`
);
this.name = 'CommandFormatError';
} | Make CommandFormatError more descriptive | discordjs_Commando | train | js |
ed6dd5ade6e7303ef2bfdcbf9b2beb05deafb9b5 | diff --git a/cast_test.go b/cast_test.go
index <HASH>..<HASH> 100644
--- a/cast_test.go
+++ b/cast_test.go
@@ -53,7 +53,7 @@ func TestToBool(t *testing.T) {
assert.Equal(t, ToBool("F"), false)
assert.Equal(t, ToBool(false), false)
assert.Equal(t, ToBool("foo"), false)
-
+
assert.Equal(t, ToBool("true"), true)
assert.Equal(t, ToBool("TRUE"), true)
assert.Equal(t, ToBool("True"), true)
@@ -61,4 +61,5 @@ func TestToBool(t *testing.T) {
assert.Equal(t, ToBool("T"), true)
assert.Equal(t, ToBool(1), true)
assert.Equal(t, ToBool(true), true)
+ assert.Equal(t, ToBool(-1), true)
}
diff --git a/caste.go b/caste.go
index <HASH>..<HASH> 100644
--- a/caste.go
+++ b/caste.go
@@ -41,7 +41,7 @@ func ToBoolE(i interface{}) (bool, error) {
case nil:
return false, nil
case int:
- if i.(int) > 0 {
+ if i.(int) != 0 {
return true, nil
}
return false, nil | Updated to return bool false only for zero | spf13_cast | train | go,go |
7ed70e9f06e80dae0527e52ceae13da42401bf36 | diff --git a/symphony/lib/toolkit/fields/field.taglist.php b/symphony/lib/toolkit/fields/field.taglist.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/toolkit/fields/field.taglist.php
+++ b/symphony/lib/toolkit/fields/field.taglist.php
@@ -91,7 +91,7 @@ class FieldTagList extends Field implements ExportableField, ImportableField
public function fetchAssociatedEntryCount($value)
{
- $value = array_map(trim, array_map([$this, 'cleanValue'], explode(',', $value)));
+ $value = array_map('trim', array_map([$this, 'cleanValue'], explode(',', $value)));
return (int)Symphony::Database()
->select() | Make sure array_map does not create warnings
In PHP7, passing a global function results in passing a undefined
constant, which is then turned into a string, which then works with
array_map.
It is best to remove this and directly pass a string or a lambda.
Fixes #<I>
Picked from 4d<I>a<I>
Picked from abf<I> | symphonycms_symphony-2 | train | php |
05eccfa5fcaaae3e5141b3d7defaaaecf5cd8b4f | diff --git a/pyinfra/facts/apt.py b/pyinfra/facts/apt.py
index <HASH>..<HASH> 100644
--- a/pyinfra/facts/apt.py
+++ b/pyinfra/facts/apt.py
@@ -95,7 +95,7 @@ class DebPackage(FactBase):
_regexes = {
'name': r'^Package: ([a-zA-Z0-9\-]+)$',
- 'version': r'^Version: ([0-9\.\-]+)$',
+ 'version': r'^Version: ([0-9\:\.\-]+)$',
}
def command(self, name):
diff --git a/pyinfra/modules/apt.py b/pyinfra/modules/apt.py
index <HASH>..<HASH> 100644
--- a/pyinfra/modules/apt.py
+++ b/pyinfra/modules/apt.py
@@ -162,7 +162,7 @@ def deb(state, host, source, present=True, force=False):
if (
info['name'] in current_packages
- and info['version'] in current_packages[info['name']]
+ and info.get('version') in current_packages[info['name']]
):
exists = True | Add : to apt regex versioning search and don't fail with no version
Some versions include colons and these were ignored by the regex
If no version was found then the the module would fail- by doing get
this is avoided | Fizzadar_pyinfra | train | py,py |
81eed3daf6d4e9f3bd2ad8e62cb46999def3c23c | diff --git a/test/status_builder_test.rb b/test/status_builder_test.rb
index <HASH>..<HASH> 100644
--- a/test/status_builder_test.rb
+++ b/test/status_builder_test.rb
@@ -268,6 +268,24 @@ def test_rev_history_status_merge_commit_bypass_remote_branch
end
end
+def test_status_works_on_bare_repository
+ src = empty_test_dir("rim_info")
+ RIM.git_session(src) do |s|
+ test_git_setup(s, src)
+ end
+ d = empty_test_dir("rim_info_bare")
+ RIM.git_session(d) do |s|
+ s.execute("git clone --bare file://#{src} .")
+ rs = RIM::StatusBuilder.new.rev_status(s, "mod1")
+ assert_equal s.rev_sha1("mod1"), rs.git_rev
+ assert_equal [], rs.parents
+ assert_equal 1, rs.modules.size
+ assert rs.modules.all?{|m| !m.dirty?}
+ assert_equal "ssh://gerrit-test/mod1", rs.modules.find{|m| m.dir == "mod1"}.rim_info.remote_url
+ end
+
+end
+
def teardown
# clean up test dirs created during last test
remove_test_dirs | Added test for status on bare repository. | esrlabs_esr-rim | train | rb |
803247b03eb29787d094837fb73a4962c16f190c | diff --git a/screamshot/utils.py b/screamshot/utils.py
index <HASH>..<HASH> 100644
--- a/screamshot/utils.py
+++ b/screamshot/utils.py
@@ -13,7 +13,7 @@ except ImportError:
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.core.urlresolvers import reverse
from django.core.validators import URLValidator
-from io import StringIO
+from io import BytesIO
from django.template.loader import render_to_string
from django.conf import settings
@@ -339,7 +339,7 @@ def render_template(template_name, context, format='png',
file object of the result.
"""
# output stream, as required by casperjs_capture
- stream = StringIO()
+ stream = BytesIO()
out_f = None
# the suffix=.html is a hack for phantomjs which *will*
# complain about not being able to open source file
@@ -359,7 +359,7 @@ def render_template(template_name, context, format='png',
static_url,
'file://%s' % settings.STATIC_ROOT
)
- render_file.write(template_content)
+ render_file.write(template_content.encode('utf-8'))
# this is so that the temporary file actually gets filled
# with the result.
render_file.seek(0) | Fixes for rendering templates (library-usage):
- use BytesIO instead of StringIO (python was complaining about bytes)
- encode the middleware template to utf-8 | makinacorpus_django-screamshot | train | py |
fbbf55ca620722ce8221be11feff7829321d8148 | diff --git a/src/ImageShortcodeHandler.php b/src/ImageShortcodeHandler.php
index <HASH>..<HASH> 100644
--- a/src/ImageShortcodeHandler.php
+++ b/src/ImageShortcodeHandler.php
@@ -72,7 +72,10 @@ class ImageShortcodeHandler
$density = (int)$density;
$resized = $record->ResizedImage((int)ceil($width * $density), (int)ceil($height * $density));
// Output in the format "assets/foo.jpg 1x"
- $srcsetSources[] = $resized->getURL() . " {$density}x";
+ $resizedUrl = $resized->getURL();
+ if ($resizedUrl) {
+ $srcsetSources[] = $resizedUrl . " {$density}x";
+ }
}
} | FIX: Prevent fatal errors when assets are missing | bigfork_htmleditorsrcset | train | php |
fe40374ed6e704b0bfe715f491fdada195a302fb | diff --git a/dpark/pymesos/scheduler.py b/dpark/pymesos/scheduler.py
index <HASH>..<HASH> 100644
--- a/dpark/pymesos/scheduler.py
+++ b/dpark/pymesos/scheduler.py
@@ -59,6 +59,7 @@ class MesosSchedulerDriver(Process):
@async # called by detector
def onNewMasterDetectedMessage(self, pid):
self.master = UPID(pid)
+ self.connected = False
self.register()
@async # called by detector | fix re-register to master after failover | douban_dpark | train | py |
18551bb4e81765c4af31c4944ec65306b88cfb66 | diff --git a/src/models/elements.model.mongodb.js b/src/models/elements.model.mongodb.js
index <HASH>..<HASH> 100644
--- a/src/models/elements.model.mongodb.js
+++ b/src/models/elements.model.mongodb.js
@@ -6,6 +6,8 @@ module.exports = function (forecast, element, app, options) {
options.Model.ensureIndex({ forecastTime: 1 }, { expireAfterSeconds: element.interval || forecast.interval })
// To perform geo queries on tiles
options.Model.ensureIndex({ geometry: '2dsphere' })
+ // To perform $exists requests
+ options.Model.ensureIndex({ geometry: 1 })
options.Model.ensureIndex({ x: 1, y: 1 })
options.Model.ensureIndex({ forecastTime: 1, geometry: 1 })
} | Added standard index on element geometry to increase performances | weacast_weacast-core | train | js |
1de7393d6c5ab0587423c415b393b72ec5a17dad | diff --git a/src/DatabaseQuery.php b/src/DatabaseQuery.php
index <HASH>..<HASH> 100644
--- a/src/DatabaseQuery.php
+++ b/src/DatabaseQuery.php
@@ -1419,7 +1419,7 @@ abstract class DatabaseQuery
* @param mixed $conditions A string or array of WHERE conditions.
* @param string $innerGlue The glue by which to join the conditions. Defaults to AND.
*
- * @return DatabaseQuery Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/
@@ -1444,7 +1444,7 @@ abstract class DatabaseQuery
* @param mixed $conditions A string or array of WHERE conditions.
* @param string $glue The glue by which to join the conditions. Defaults to AND.
*
- * @return DatabaseQuery Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/
@@ -1463,7 +1463,7 @@ abstract class DatabaseQuery
* @param mixed $conditions A string or array of WHERE conditions.
* @param string $glue The glue by which to join the conditions. Defaults to OR.
*
- * @return DatabaseQuery Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/
diff --git a/src/Query/QueryElement.php b/src/Query/QueryElement.php
index <HASH>..<HASH> 100644
--- a/src/Query/QueryElement.php
+++ b/src/Query/QueryElement.php
@@ -116,7 +116,7 @@ class QueryElement
*
* @param string $name Name of the element.
*
- * @return QueryElement Returns this object to allow chaining.
+ * @return $this
*
* @since 1.3.0
*/ | Update doc blocks to match other changes | joomla-framework_database | train | php,php |
e1dd73ac2f11bcbc6717ae3fc0e8e501ce12f081 | diff --git a/fuse.py b/fuse.py
index <HASH>..<HASH> 100644
--- a/fuse.py
+++ b/fuse.py
@@ -383,7 +383,9 @@ def time_of_timespec(ts):
def set_st_attrs(st, attrs):
for key, val in attrs.items():
if key in ('st_atime', 'st_mtime', 'st_ctime', 'st_birthtime'):
- timespec = getattr(st, key + 'spec')
+ timespec = getattr(st, key + 'spec', None)
+ if timespec is None:
+ continue
timespec.tv_sec = int(val)
timespec.tv_nsec = int((val - timespec.tv_sec) * 10 ** 9)
elif hasattr(st, key): | Ignore input time field if it doesn't exist on stat | fusepy_fusepy | train | py |
ccf86fefcf2b2178733c99c9a9a873098f7c95c9 | diff --git a/ClosureCompiler.js b/ClosureCompiler.js
index <HASH>..<HASH> 100644
--- a/ClosureCompiler.js
+++ b/ClosureCompiler.js
@@ -156,7 +156,10 @@
delete options["js"];
delete options["js_output_file"];
- var args = '-client -jar "'+__dirname+'/compiler/compiler.jar"'; // -d32 does not work on 64bit
+ // -XX:+TieredCompilation speeds up compilation for Java 1.7.
+ // Previous -d32 was for Java 1.6 only.
+ // Compiler now requires Java 1.7 and this flag does not need detection.
+ var args = '-XX:+TieredCompilation -jar "'+__dirname+'/compiler/compiler.jar"';
// Source files
if (!(files instanceof Array)) { | Speed up compiler compilation for Java <I>
Manually tested on Mac, Win, Linux platforms. | dcodeIO_ClosureCompiler.js | train | js |
b008d6958464739935ffd941247d136655098f4a | diff --git a/packages/d3fc-data-join/src/dataJoin.js b/packages/d3fc-data-join/src/dataJoin.js
index <HASH>..<HASH> 100644
--- a/packages/d3fc-data-join/src/dataJoin.js
+++ b/packages/d3fc-data-join/src/dataJoin.js
@@ -23,9 +23,8 @@ export default (element, className) => {
const dataJoin = function(container, data) {
data = data || ((d) => d);
- const selector = className == null ? element : `${element}.${className}`;
- const selected = container.selectAll(selector)
- .filter((d, i, nodes) => nodes[i].parentNode === container.node());
+ const selected = container.selectAll((d, i, nodes) => nodes[i].children)
+ .filter(className == null ? element : `${element}.${className}`);
let update = selected.data(data, key);
// N.B. insert() is used to create new elements, rather than append(). insert() behaves in a special manner | refactor: improve performance of child-only selector
Select children then post-filter to matching selector rather than select all matching descendents then post-filter to children. | d3fc_d3fc | train | js |
4cdb94613303d5b5e20a94b6468e181df044bebc | diff --git a/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js b/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js
index <HASH>..<HASH> 100644
--- a/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js
+++ b/webapps/webapp/src/main/webapp/app/tasklist/services/EngineApi.js
@@ -16,7 +16,7 @@ ngDefine('tasklist.services', [
var forms = $resource(Uri.appUri("engine://engine/:engine/:context/:id/:action"), { id: "@id" } , {
startForm : { method: 'GET', params : { context: "process-definition", action: 'startForm' }},
- taskForm : { method: 'GET', params : { context: "task" }}
+ taskForm : { method: 'GET', params : { context: "task", action: 'form' }}
});
this.taskList.getForm = function(data, fn) { | fix(tasklist): resolve task form using correct uri
Related to CAM-<I> | camunda_camunda-bpm-platform | train | js |
943454fbc46b6a43dfd2c3e44100207e673e5af6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,15 +5,16 @@ See LICENSE at the top-level of this distribution for more information
or write to emin.martinian@gmail.com for more information.
"""
-from setuptools import setup, find_packages
from os import path
+from setuptools import setup, find_packages
+
def get_readme():
'Get the long description from the README file'
here = path.abspath(path.dirname(__file__))
- with open(path.join(here, 'README.md'), encoding='utf-8') as f:
- result = f.read()
+ with open(path.join(here, 'README.md'), encoding='utf-8') as my_fd:
+ result = my_fd.read()
return result
setup(
@@ -30,7 +31,7 @@ setup(
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
],
- keywords='comment management',
+ keywords='comment management',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=find_packages(exclude=['contrib', 'docs', 'tests']), | Cleaned up pylint warnings | emin63_eyap | train | py |
576512cd2b677bcee2f33002ac3a1a39855f995f | diff --git a/pages/models.py b/pages/models.py
index <HASH>..<HASH> 100644
--- a/pages/models.py
+++ b/pages/models.py
@@ -144,6 +144,8 @@ if settings.PAGE_PERMISSION:
def get_page_id_list(cls, user):
"""Give a list of page where the user as rights or the string "All" if
the user has all rights."""
+ if user.is_superuser:
+ return 'All'
id_list = []
perms = PagePermission.objects.filter(user=user)
for perm in perms: | The admin user can now do everything : PagePermission is ignored for him
git-svn-id: <URL> | batiste_django-page-cms | train | py |
768baa116ac2a0636dbd64022e67d9a6559f65d5 | diff --git a/tests/utils.py b/tests/utils.py
index <HASH>..<HASH> 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -7,6 +7,7 @@ from collections import Mapping
from urllib.parse import urlparse
import redis
+from hestia.auth import AuthenticationTypes
from mock import patch
from rest_framework import status
@@ -97,7 +98,11 @@ class BaseClient(Client):
class EphemeralClient(BaseClient):
- def __init__(self, token, authentication_type='EphemeralToken', service=None, **defaults):
+ def __init__(self,
+ token,
+ authentication_type=AuthenticationTypes.EPHEMERAL_TOKEN,
+ service=None,
+ **defaults):
super().__init__(**defaults)
self.service = service or settings.EPHEMERAL_SERVICES.RUNNER
self.authorization_header = '{} {}'.format(authentication_type, token) | Update ephemeral client | polyaxon_polyaxon | train | py |
d15920c2994ca96ca861b0f444d5dafbb50a5fd8 | diff --git a/src/cornerstone/seoAssessor.js b/src/cornerstone/seoAssessor.js
index <HASH>..<HASH> 100644
--- a/src/cornerstone/seoAssessor.js
+++ b/src/cornerstone/seoAssessor.js
@@ -66,7 +66,6 @@ const CornerstoneSEOAssessor = function( i18n, options ) {
recommendedMinimum: 900,
slightlyBelowMinimum: 400,
belowMinimum: 300,
- farBelowMinimum: 0,
scores: {
belowMinimum: -20, | Remove the passing of a non-existing config value | Yoast_YoastSEO.js | train | js |
ddf2a604d1a9cfb30b89fdfb33f47ac56ba5e930 | diff --git a/sanic/request.py b/sanic/request.py
index <HASH>..<HASH> 100644
--- a/sanic/request.py
+++ b/sanic/request.py
@@ -312,11 +312,11 @@ def parse_multipart_form(body, boundary):
if field_name:
post_data = form_part[line_index:-4]
if file_name:
- file = File(type=content_type, name=file_name, body=post_data)
+ form_file = File(type=content_type, name=file_name, body=post_data)
if field_name in files:
- files[field_name].append(file)
+ files[field_name].append(form_file)
else:
- files[field_name] = [file]
+ files[field_name] = [form_file]
else:
value = post_data.decode(content_charset)
if field_name in fields: | changed 'file' variable to 'form_file' to prevent overwriting the reserved word | huge-success_sanic | train | py |
48d9cc36742ff3dfb52841b76c98a753c96036f2 | diff --git a/salt/runners/vault.py b/salt/runners/vault.py
index <HASH>..<HASH> 100644
--- a/salt/runners/vault.py
+++ b/salt/runners/vault.py
@@ -55,6 +55,9 @@ def generate_token(minion_id, signature, impersonated_by_master=False):
'num_uses': 1,
'metadata': audit_data
}
+
+ if payload['policies'] == []:
+ return {'error': 'No policies matched minion'}
log.trace('Sending token creation request to Vault')
response = requests.post(url, headers=headers, json=payload) | Fix bug with vault runner creating token on empty policy | saltstack_salt | train | py |
846d2cf60418f34cade79aa5ab8149d4af08f970 | diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -1480,6 +1480,14 @@ WSP._serializeToken = function ( state, token ) {
if (! dropContent || ! state.dropContent ) {
var newTrailingNLCount = 0;
+
+ // FIXME: figure out where the non-string res comes from
+ if (res !== '' && res.constructor !== String) {
+ console.err("res was not a string!");
+ console.trace();
+ res = '';
+ }
+
if (res !== '') {
// Strip leading or trailing newlines from the returned string
var match = res.match( /^((?:\r?\n)*)((?:.*?|[\r\n]+[^\r\n])*?)((?:\r?\n)*)$/ ), | Work around a serializer crash exposed by rt tests
Change-Id: I<I>e5cd3d<I>cb<I>c6a4c<I>b<I> | wikimedia_parsoid | train | js |
e634a0ab40bbbfd003b9310b5d148b0632c601ca | diff --git a/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java b/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java
+++ b/src/main/java/org/eobjects/datacleaner/widgets/table/DCTable.java
@@ -181,22 +181,27 @@ public class DCTable extends JXTable implements MouseListener {
return result;
}
+ @Override
public void mouseClicked(MouseEvent e) {
forwardMouseEvent(e);
}
+ @Override
public void mouseEntered(MouseEvent e) {
// forwardMouseEvent(e);
}
+ @Override
public void mouseExited(MouseEvent e) {
// forwardMouseEvent(e);
}
+ @Override
public void mousePressed(MouseEvent e) {
forwardMouseEvent(e);
}
+ @Override
public void mouseReleased(MouseEvent e) {
boolean forwarded = forwardMouseEvent(e);
if (!forwarded) { | Added @Override's to mouselistener methods on DCTable. | datacleaner_DataCleaner | train | java |
7bd092309cb5375f87be959b351339fe96f7d070 | diff --git a/lib/tower_cli/models/base.py b/lib/tower_cli/models/base.py
index <HASH>..<HASH> 100644
--- a/lib/tower_cli/models/base.py
+++ b/lib/tower_cli/models/base.py
@@ -210,7 +210,7 @@ class BaseResource(six.with_metaclass(ResourceMeta)):
code = six.get_function_code(method)
if 'pk' in code.co_varnames:
click.argument('pk', nargs=1, required=False,
- type=int)(cmd)
+ type=int, metavar='[ID]')(cmd)
# Done; return the command.
return cmd | Change [PK] in autodoc to [ID]. | ansible_tower-cli | train | py |
ca968fcff6fba9958a2ae87511eb209e2bcdc6fc | diff --git a/svc/server.go b/svc/server.go
index <HASH>..<HASH> 100644
--- a/svc/server.go
+++ b/svc/server.go
@@ -43,8 +43,8 @@ func NewServer(h http.Handler, opts ...NewServerOpt) *http.Server {
// RunServer handles the biolerplate of starting an http server and handling
// signals gracefully.
-func RunServer(srv *http.Server) {
- idleConnsClosed := make(chan struct{})
+func RunServer(srv *http.Server, shutdownFuncs ...func()) {
+ done := make(chan struct{})
go func() {
// Handle SIGINT and SIGTERM.
@@ -62,7 +62,12 @@ func RunServer(srv *http.Server) {
// Error from closing listeners, or context timeout:
fmt.Printf("HTTP server Shutdown: %v\n", err)
}
- close(idleConnsClosed)
+ // Run shutdown functions
+ for _, sf := range shutdownFuncs {
+ sf()
+ }
+
+ close(done)
}()
fmt.Printf("HTTP server listening on address: \"%s\"\n", srv.Addr)
@@ -72,5 +77,5 @@ func RunServer(srv *http.Server) {
os.Exit(1)
}
- <-idleConnsClosed
+ <-done
} | Add ability to pass shutdown functions to svc.RunServer | remind101_pkg | train | go |
a094b1a2b50cd4acf20bfe66851e6a1e6b7ec6fd | diff --git a/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java b/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java
index <HASH>..<HASH> 100644
--- a/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java
+++ b/controller/src/main/java/org/jboss/as/controller/ServiceVerificationHelper.java
@@ -166,9 +166,11 @@ class ServiceVerificationHelper extends AbstractServiceListener<Object> implemen
}
private static void reportImmediateDependants(List<String> problemList, ModelNode failureDescription) {
- ModelNode problemListNode = failureDescription.get(ControllerLogger.ROOT_LOGGER.servicesMissingDependencies());
- for (String problem: problemList) {
- problemListNode.add(problem);
+ if (!problemList.isEmpty()) {
+ ModelNode problemListNode = failureDescription.get(ControllerLogger.ROOT_LOGGER.servicesMissingDependencies());
+ for (String problem : problemList) {
+ problemListNode.add(problem);
+ }
}
} | [WFCORE-<I>]: Unneeded part of failure-description is printed in CLI for Elytron subsystem.
If the list is empty don't report it. | wildfly_wildfly-core | train | java |
a31e5a359203a7e0032adfe3448afd1c2f5504cd | diff --git a/tests/for-server/test-functionOps.js b/tests/for-server/test-functionOps.js
index <HASH>..<HASH> 100644
--- a/tests/for-server/test-functionOps.js
+++ b/tests/for-server/test-functionOps.js
@@ -9,7 +9,7 @@
import {assert, expect} from 'chai';
import {apply} from '../../src/function/apply';
import {call} from '../../src/function/call';
-import {flip, flipN, until} from '../../src/function/function';
+import {flip, flipN, until, id} from '../../src/function/function';
import {log, add, subtract, length, expectFalse, expectTrue, expectEqual, expectFunction} from './helpers';
// These variables get set at the top IIFE in the browser.
// ~~~ /STRIP ~~~
@@ -104,4 +104,14 @@ describe ('Function Operators', function () {
});
});
+ describe ('#id', function () {
+ it ('should be a function', function () {
+ expectFunction(id);
+ });
+ it ('should return whatever you give it', function () {
+ expectEqual(id(1), 1);
+ expectEqual(id(undefined), undefined);
+ });
+ });
+
}); | Added tests for 'id'. | functional-jslib_fjl | train | js |
242ebb41b688fc35f0476cb370e79f988494f789 | diff --git a/lib/utils/job-utils/ipmitool.js b/lib/utils/job-utils/ipmitool.js
index <HASH>..<HASH> 100755
--- a/lib/utils/job-utils/ipmitool.js
+++ b/lib/utils/job-utils/ipmitool.js
@@ -32,12 +32,15 @@ function ipmitoolFactory(Promise) {
" at /usr/bin/ipmitool");
return;
}
+
+ var options = { timeout: 60000 };
if (host && user && password && command) {
//var cmd = child_process.exec('/usr/bin/ipmitool -I
// lanplus -U '+user+' -H '+host+' -P '+password+" "+command
child_process.exec( // jshint ignore:line
'/usr/bin/ipmitool -U '+user+
' -H '+host+' -P '+password+" " + command,
+ options,
function(error, stdout, stderr) {
if (error) {
error.stderr = stderr;
@@ -49,6 +52,7 @@ function ipmitoolFactory(Promise) {
} else {
if (!host && command) {
child_process.exec('/usr/bin/ipmitool ' + command, // jshint ignore:line
+ options,
function(error, stdout, stderr) {
if (error) {
error.stderr = stderr; | Added timeout value for ipmitool child process | RackHD_on-tasks | train | js |
edfda8bb301620820d707e48c4ac48fe8a7d1016 | diff --git a/salt/states/virtualenv.py b/salt/states/virtualenv.py
index <HASH>..<HASH> 100644
--- a/salt/states/virtualenv.py
+++ b/salt/states/virtualenv.py
@@ -7,7 +7,7 @@ import os
logger = logging.getLogger(__name__)
-def manage(name,
+def managed(name,
venv_bin='virtualenv',
requirements='',
no_site_packages=False,
@@ -133,3 +133,5 @@ def manage(name,
ret['result'] = True
return ret
+
+manage = managed | Rename virtualenv.manage to managed for consistency with file.managed | saltstack_salt | train | py |
4941692c311ded695585ac4859c13cafa11e5b7e | diff --git a/upload/system/library/cache.php b/upload/system/library/cache.php
index <HASH>..<HASH> 100644
--- a/upload/system/library/cache.php
+++ b/upload/system/library/cache.php
@@ -33,7 +33,7 @@ class Cache {
fwrite($handle, serialize($value));
- close($handle);
+ fclose($handle);
}
public function delete($key) {
@@ -48,4 +48,4 @@ class Cache {
}
}
}
-?>
\ No newline at end of file
+?> | Update upload/system/library/cache.php
close($handle); changed to fclose($handle); | opencart_opencart | train | php |
ad7ec27216bff8fe218c0c1ed0ac533181887ae9 | diff --git a/config.go b/config.go
index <HASH>..<HASH> 100644
--- a/config.go
+++ b/config.go
@@ -31,6 +31,7 @@ type Config struct {
AsyncConnect bool
MarshalAsJSON bool
SubSecondPrecision bool
+ RequestAck bool
}
// FluentConfig converts data to fluent.Config.
@@ -49,5 +50,6 @@ func (c Config) FluentConfig() fluent.Config {
Async: c.AsyncConnect,
MarshalAsJSON: c.MarshalAsJSON,
SubSecondPrecision: c.SubSecondPrecision,
+ RequestAck: c.RequestAck,
}
} | Add RequestAck to config (#<I>) | evalphobia_logrus_fluent | train | go |
c8fd4d016f4d5946110d67f730e4badbde32ffe3 | diff --git a/lib/queue/job.js b/lib/queue/job.js
index <HASH>..<HASH> 100644
--- a/lib/queue/job.js
+++ b/lib/queue/job.js
@@ -160,7 +160,10 @@ exports.rangeByType = function( type, state, from, to, order, fn ) {
*/
exports.get = function( id, jobType, fn ) {
- if (typeof jobType === 'function' && !fn) fn = jobType;
+ if (typeof jobType === 'function' && !fn) {
+ fn = jobType;
+ jobType = '';
+ }
var client = redis.client()
, job = new Job; | Set jobType to empty string if it wasn't supplied as the function parameter | Automattic_kue | train | js |
8d222e2bc31d99e9d1f441425d1a256e8639144e | diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js
@@ -409,7 +409,9 @@ define("orion/editor/contentAssist", ['i18n!orion/editor/nls/messages', 'orion/k
self.position();
}
};
- document.addEventListener("scroll", this.scrollListener);
+ if (document.addEventListener) {
+ document.addEventListener("scroll", this.scrollListener);
+ }
}
ContentAssistWidget.prototype = /** @lends orion.editor.ContentAssistWidget.prototype */ {
/** @private */ | addEventListener is not available on IE8 | eclipse_orion.client | train | js |
544c85851edda8f07db4367e7cf3a77c45e16767 | diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-pe/version.rb
+++ b/lib/beaker-pe/version.rb
@@ -3,7 +3,7 @@ module Beaker
module PE
module Version
- STRING = '1.16.0'
+ STRING = '1.17.0'
end
end | (GEM) update beaker-pe version to <I> | puppetlabs_beaker-pe | train | rb |
6971398da6cab2b3590094f06e9a76a430b24b5e | diff --git a/lib/github_api.rb b/lib/github_api.rb
index <HASH>..<HASH> 100644
--- a/lib/github_api.rb
+++ b/lib/github_api.rb
@@ -53,6 +53,7 @@ module Github
:Users => 'users',
:CoreExt => 'core_ext',
:MimeType => 'mime_type',
- :Authorization => 'authorization'
+ :Authorization => 'authorization',
+ :Authorizations => 'authorizations'
end # Github | Register authorizations api with github module. | piotrmurach_github | train | rb |
7f7c0ee5db35746533ff305632745355ce9dedbd | diff --git a/lib/Widget/DbCache.php b/lib/Widget/DbCache.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/DbCache.php
+++ b/lib/Widget/DbCache.php
@@ -7,7 +7,6 @@
*/
namespace Widget;
-use Widget\Exception;
use Widget\Stdlib\AbstractCache;
/**
diff --git a/lib/Widget/Validator/AbstractValidator.php b/lib/Widget/Validator/AbstractValidator.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/Validator/AbstractValidator.php
+++ b/lib/Widget/Validator/AbstractValidator.php
@@ -9,7 +9,6 @@
namespace Widget\Validator;
use Widget\AbstractWidget;
-use Widget\Exception\UnexpectedValueException;
/**
* The base class of validator
diff --git a/lib/Widget/Validator/File.php b/lib/Widget/Validator/File.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/Validator/File.php
+++ b/lib/Widget/Validator/File.php
@@ -8,8 +8,6 @@
namespace Widget\Validator;
-use Widget\Exception;
-
/**
* Check if the input is valid file
* | removed extra use Widget\Exception code | twinh_wei | train | php,php,php |
76cc77a227f39abedc0b15d69fc73808cc24c629 | diff --git a/EnvVarProcessor/KeyEnvVarProcessor.php b/EnvVarProcessor/KeyEnvVarProcessor.php
index <HASH>..<HASH> 100644
--- a/EnvVarProcessor/KeyEnvVarProcessor.php
+++ b/EnvVarProcessor/KeyEnvVarProcessor.php
@@ -38,7 +38,7 @@ final class KeyEnvVarProcessor implements EnvVarProcessorInterface
public static function getProvidedTypes()
{
return [
- 'jwk' => 'string',
+ 'jwk' => 'string',
'jwkset' => 'string',
];
} | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | web-token_jwt-bundle | train | php |
2e86b72cadd2ac68b183d88e50a8d003a6d9fe5c | diff --git a/tests/test_phase1.py b/tests/test_phase1.py
index <HASH>..<HASH> 100644
--- a/tests/test_phase1.py
+++ b/tests/test_phase1.py
@@ -58,3 +58,8 @@ class TestPhase1(fake_filesystem_unittest.TestCase):
self.fs.create_file('/a', contents="include { file myVar }")
with self.assertRaises(TypeError):
phase1.load('/a')
+
+ def test_step_path(self):
+ self.fs.create_file('/a/b/c.trask', contents="set {}")
+ result = phase1.load('/a/b/c.trask')
+ self.assertEqual(result[0].path, '/a/b')
diff --git a/trask/phase1.py b/trask/phase1.py
index <HASH>..<HASH> 100644
--- a/trask/phase1.py
+++ b/trask/phase1.py
@@ -61,7 +61,7 @@ def expand_includes(step, path):
new_path = os.path.abspath(os.path.join(dirname, rel_path))
return load(new_path)
else:
- step.path = path
+ step.path = os.path.dirname(path)
return [step] | Fix step path again and add a test | nicholasbishop_trask | train | py,py |
4aeb1853984a5f7f87b9ad1564e703762b7228e4 | diff --git a/spec/helpers/package-helper-spec.rb b/spec/helpers/package-helper-spec.rb
index <HASH>..<HASH> 100644
--- a/spec/helpers/package-helper-spec.rb
+++ b/spec/helpers/package-helper-spec.rb
@@ -34,8 +34,8 @@ module BoxGrinder
it "should package deliverables" do
File.should_receive(:exists?).with('destination/package.tgz').and_return(false)
File.should_receive(:expand_path).with('a/dir').and_return('a/dir/expanded')
- FileUtils.should_receive(:ln_s).with("'a/dir/expanded'", "'destination/package'")
- FileUtils.should_receive(:rm).with("'destination/package'")
+ FileUtils.should_receive(:ln_s).with('a/dir/expanded', 'destination/package')
+ FileUtils.should_receive(:rm).with('destination/package')
@exec_helper.should_receive(:execute).with("tar -C 'destination' -hcvzf 'destination/package.tgz' 'package'") | Fixed test for PakageHelper | boxgrinder_boxgrinder-build | train | rb |
4749e2bf542ad3d21f8ad3569344aee9208bd95b | diff --git a/install/migrations/2.4.1.php b/install/migrations/2.4.1.php
index <HASH>..<HASH> 100644
--- a/install/migrations/2.4.1.php
+++ b/install/migrations/2.4.1.php
@@ -5,7 +5,7 @@
static $publish_filtering_disabled = false;
static function getVersion(){
- return '2.4.1';
+ return '2.4.1beta1';
}
static function getReleaseNotes(){ | Set version to <I>beta1 | symphonycms_symphony-2 | train | php |
f07f09fadae7d27129eb52b4e23a7670e407a24e | diff --git a/lib/oktakit/client.rb b/lib/oktakit/client.rb
index <HASH>..<HASH> 100644
--- a/lib/oktakit/client.rb
+++ b/lib/oktakit/client.rb
@@ -31,12 +31,17 @@ module Oktakit
builder.adapter Faraday.default_adapter
end
- def initialize(token:, organization: nil, api_endpoint: nil)
+ def initialize(token: nil, access_token: nil, organization: nil, api_endpoint: nil)
if organization.nil? && api_endpoint.nil?
raise ArgumentError, "Please provide either the organization or the api_endpoint argument"
end
+ if token.blank? && access_token.blank?
+ raise ArgumentError, "Please provide either the token or the access_token argument"
+ end
+
@token = token
+ @access_token = access_token
@organization = organization
@api_endpoint = api_endpoint
end
@@ -182,7 +187,8 @@ module Oktakit
http.headers[:accept] = 'application/json'
http.headers[:content_type] = 'application/json'
http.headers[:user_agent] = "Oktakit v#{Oktakit::VERSION}"
- http.authorization 'SSWS ', @token
+ http.authorization 'SSWS ', @token if @token
+ http.authorization :Bearer, @access_token if @access_token
end
end
@@ -195,7 +201,7 @@ module Oktakit
def absolute_to_relative_url(next_ref)
return unless next_ref
-
+
next_ref.href.sub(api_endpoint, '')
end
end | Ability to use OAuth <I> access token instead of
just the API token | Shopify_oktakit | train | rb |
5478ace04ae45c841372d51e929047b7db7c6c68 | diff --git a/law/sandbox/base.py b/law/sandbox/base.py
index <HASH>..<HASH> 100644
--- a/law/sandbox/base.py
+++ b/law/sandbox/base.py
@@ -286,8 +286,6 @@ class SandboxTask(Task):
def __getattribute__(self, attr, proxy=True):
if proxy:
- if attr == "deps" and self.sandboxed:
- return lambda: []
if attr == "run" and not self.sandboxed:
return self.sandbox_proxy.run
elif attr == "inputs" and _sandbox_stagein_dir and self.sandboxed: | Fix sandboxing dependencies. | riga_law | train | py |
0ffc20384e80f829b1dc9ba40a1671c5291a4934 | diff --git a/unixfs/data.pb.go b/unixfs/data.pb.go
index <HASH>..<HASH> 100644
--- a/unixfs/data.pb.go
+++ b/unixfs/data.pb.go
@@ -13,7 +13,7 @@ It has these top-level messages:
*/
package unixfs
-import proto "code.google.com/p/goprotobuf/proto"
+import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
import math "math"
// Reference imports to suppress errors if they are not otherwise used. | make vendor is your friend
cc @whyrusleeping | ipfs_go-ipfs | train | go |
31fc2d8787cdaa847f4a814c6853fc826da43bf0 | diff --git a/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js b/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js
index <HASH>..<HASH> 100644
--- a/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js
+++ b/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js
@@ -250,7 +250,11 @@ angular.module('client').directive('guacFileBrowser', [function guacFileBrowser(
// Refresh file browser when any upload completes
$scope.$on('guacUploadComplete', function uploadComplete(event, filename) {
- ManagedFilesystem.refresh($scope.filesystem, $scope.filesystem.currentDirectory);
+
+ // Refresh filesystem, if it exists
+ if ($scope.filesystem)
+ ManagedFilesystem.refresh($scope.filesystem, $scope.filesystem.currentDirectory);
+
});
}] | GUAC-<I>: Verify existence of filesystem before refreshing. | glyptodon_guacamole-client | train | js |
a02ab4f6c3aef11c991baad777a8e357ccfa3f4a | diff --git a/lib/minify.js b/lib/minify.js
index <HASH>..<HASH> 100644
--- a/lib/minify.js
+++ b/lib/minify.js
@@ -3,7 +3,7 @@ var pkg = require( './packages' );
module.exports = {
'application/javascript' : function( file, content ) {
try {
- return pkg.ugy.minify( file );
+ return pkg.ugy.minify( file ).code;
} // in these case a create file has been triggered when the file is saved but not valid
catch ( e ) { // todo: should we check if the file is in a valid state, period, before re-writing it?
console.log( e ); | update uglify-js version | constantology_catn8 | train | js |
a1c5bf61d7b244ac382afd3b55ce249bc0dcd937 | diff --git a/connection/commands.js b/connection/commands.js
index <HASH>..<HASH> 100644
--- a/connection/commands.js
+++ b/connection/commands.js
@@ -315,7 +315,8 @@ GetMore.prototype.toBin = function() {
/**************************************************************
* KILLCURSOR
**************************************************************/
-var KillCursor = function(bson, cursorIds) {
+var KillCursor = function(bson, ns, cursorIds) {
+ this.ns = ns;
this.requestId = _requestId++;
this.cursorIds = cursorIds;
}; | refactor(kill-cursor): include ns with KillCursor for upconverting
NODE-<I> | mongodb_node-mongodb-native | train | js |
31efa022dfbd1c87ad18d74bbdafe1666034ed35 | diff --git a/lib/Cake/Utility/ClassRegistry.php b/lib/Cake/Utility/ClassRegistry.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Utility/ClassRegistry.php
+++ b/lib/Cake/Utility/ClassRegistry.php
@@ -137,7 +137,9 @@ class ClassRegistry {
if (class_exists($class)) {
${$class} = new $class($settings);
- ${$class} = (${$class} instanceof Model) ? ${$class} : null;
+ if ($strict) {
+ ${$class} = (${$class} instanceof Model) ? ${$class} : null;
+ }
}
if (!isset(${$class})) {
if ($strict) { | Adding a backwards compatible check to ClassRegistry::init() so it is still able to return classes that are not instance of Model | cakephp_cakephp | train | php |
8693dca9a0a7dca10382426ff61af4106b498090 | diff --git a/question/format/hotpot/format.php b/question/format/hotpot/format.php
index <HASH>..<HASH> 100644
--- a/question/format/hotpot/format.php
+++ b/question/format/hotpot/format.php
@@ -48,7 +48,9 @@ class qformat_hotpot extends qformat_default {
// get import file name
global $params;
- if (isset($params) && !empty($params->choosefile)) {
+ if (! empty($this->realfilename)) {
+ $filename = $this->realfilename;
+ } else if (isset($params) && !empty($params->choosefile)) {
// course file (Moodle >=1.6+)
$filename = $params->choosefile;
} else { | MDL-<I>: fix setting of absolute urls for images in subfolders of course files | moodle_moodle | train | php |
6b5341fc57d0edad7e9a89c6212e47561eedfb58 | diff --git a/tests/OpenGraphTests.php b/tests/OpenGraphTests.php
index <HASH>..<HASH> 100644
--- a/tests/OpenGraphTests.php
+++ b/tests/OpenGraphTests.php
@@ -6,7 +6,10 @@ if (!class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}
-class OpenGraphTest extends PHPUnit_Framework_TestCase
+/**
+ * Class OpenGraphTest for tests with PHPUnit.
+ */
+class OpenGraphTest extends PHPUnit_Framework_TestCase \PHPUnit\Framework\TestCase
{
/** | Updated class for PHPUnit 6 | chriskonnertz_open-graph | train | php |
9f363e48469bfe55f25bc0c80c3fd5cfed0a145c | diff --git a/lib/dependor/class_name_resolver.rb b/lib/dependor/class_name_resolver.rb
index <HASH>..<HASH> 100644
--- a/lib/dependor/class_name_resolver.rb
+++ b/lib/dependor/class_name_resolver.rb
@@ -8,7 +8,7 @@ module Dependor
def for_name(name)
class_name = camelize(name)
- modules = search_modules.concat([Object])
+ modules = search_modules + [Object]
klass = nil
modules.each do |mod|
diff --git a/spec/dependor/class_name_resolver_spec.rb b/spec/dependor/class_name_resolver_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/dependor/class_name_resolver_spec.rb
+++ b/spec/dependor/class_name_resolver_spec.rb
@@ -40,4 +40,11 @@ describe Dependor::ClassNameResolver do
resolver.for_name(:foo_bar_baz_2).should == FooBarBaz2
end
+
+ it "doesnt have Object in search modules after calling for_name" do
+ resolver = Dependor::ClassNameResolver.new([])
+
+ resolver.for_name(:something)
+ resolver.search_modules.should_not include(Object)
+ end
end | remove multiple addition of Object inside ClassNameResolver search modules | psyho_dependor | train | rb,rb |
d284ae84c76552d510188631a7d174de76dd9f0d | diff --git a/genson/generator.py b/genson/generator.py
index <HASH>..<HASH> 100644
--- a/genson/generator.py
+++ b/genson/generator.py
@@ -107,7 +107,9 @@ class Schema(object):
schema['required'] = self._get_required()
elif 'array' in self._type:
- schema['items'] = self._get_items(recurse)
+ items = self._get_items(recurse)
+ if items:
+ schema['items'] = items
return schema
diff --git a/test/test_gen_single.py b/test/test_gen_single.py
index <HASH>..<HASH> 100644
--- a/test/test_gen_single.py
+++ b/test/test_gen_single.py
@@ -38,7 +38,7 @@ class TestArray(unittest.TestCase):
def test_empty(self):
s = Schema().add_object([])
self.assertEqual(s.to_dict(),
- {"type": "array", "items": []})
+ {"type": "array"})
def test_monotype(self):
s = Schema().add_object(["spam", "spam", "spam", "egg", "spam"]) | Emit valid schema when arrays in sample objects are empty.
Fixes a bug where an empty `items` array is specified in the schema
when the "training" objects all contain empty arrays. In other words,
the schema contains `{"type": "array", "items": []}`. The empty array
in the `items` entry is not valid.
The fix was to not emit the `items` entry if the array is empty. | wolverdude_GenSON | train | py,py |
e45b1efd0a82d3e8a11787ef3cf71f46c7eb461c | diff --git a/test/actions/status.js b/test/actions/status.js
index <HASH>..<HASH> 100644
--- a/test/actions/status.js
+++ b/test/actions/status.js
@@ -12,6 +12,11 @@ describe('Action: status', function(){
});
});
+ before((done) => {
+ // time for serer to settle for health check
+ setTimeout(done, 4000);
+ });
+
after(function(done){
actionhero.stop(function(){
done();
@@ -21,7 +26,6 @@ describe('Action: status', function(){
var firstNumber = null;
it('returns node status', function(done){
api.specHelper.runAction('status', function(response){
- response.nodeStatus.should.equal('Node Healthy');
response.problems.length.should.equal(0);
response.id.should.equal('test-server');
done(); | time for serer to settle for health check | actionhero_actionhero | train | js |
268fb6f8c4146f926af1e62454297217591f382f | diff --git a/lib/metacrunch/elasticsearch/reader.rb b/lib/metacrunch/elasticsearch/reader.rb
index <HASH>..<HASH> 100644
--- a/lib/metacrunch/elasticsearch/reader.rb
+++ b/lib/metacrunch/elasticsearch/reader.rb
@@ -45,11 +45,8 @@ module Metacrunch
end
def count
- body = @body.dup
- body.delete(:fields)
-
client.count({
- body: body,
+ body: { query: @body[:query] },
index: @uri.index,
type: @uri.type
})["count"] | Use only the query part for count. | ubpb_metacrunch-elasticsearch | train | rb |
8ecde0f37b80178bb1603581fb0965d1eb490844 | diff --git a/request/request.go b/request/request.go
index <HASH>..<HASH> 100644
--- a/request/request.go
+++ b/request/request.go
@@ -338,6 +338,8 @@ func (r *Request) Clear() {
r.port = ""
r.localPort = ""
r.family = 0
+ r.size = 0
+ r.do = false
}
// Match checks if the reply matches the qname and qtype from the request, it returns | [request] Also clear `do` and `size` (#<I>)
Those 2 attriburtes were not cleared as part of `Clear()` call. | coredns_coredns | train | go |
ec6eb38c64aadd6860c402cc0894c77b82b1a65d | diff --git a/src/css.js b/src/css.js
index <HASH>..<HASH> 100644
--- a/src/css.js
+++ b/src/css.js
@@ -173,6 +173,7 @@ jQuery.extend({
"fontWeight": true,
"lineHeight": true,
"opacity": true,
+ "order": true,
"orphans": true,
"widows": true,
"zIndex": true,
diff --git a/test/unit/css.js b/test/unit/css.js
index <HASH>..<HASH> 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -111,7 +111,7 @@ test("css(String|Hash)", function() {
});
test("css() explicit and relative values", function() {
- expect(29);
+ expect( 30 );
var $elem = jQuery("#nothiddendiv");
$elem.css({ "width": 1, "height": 1, "paddingLeft": "1px", "opacity": 1 });
@@ -196,6 +196,9 @@ test("css() explicit and relative values", function() {
$elem.css( "opacity", "+=0.5" );
equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
+
+ $elem.css( "order", 2 );
+ equal( $elem.css("order"), "2", "2 on order" );
});
test("css(String, Object)", function() { | Fixes #<I>: don't append px to CSS order value. Close gh-<I>. | jquery_jquery | train | js,js |
96ea7a62918424f946d0fb41946ee8701e420b36 | diff --git a/salt/renderers/pyobjects.py b/salt/renderers/pyobjects.py
index <HASH>..<HASH> 100644
--- a/salt/renderers/pyobjects.py
+++ b/salt/renderers/pyobjects.py
@@ -263,7 +263,7 @@ from __future__ import absolute_import
import logging
import re
-from six import exec_
+from salt.utils.six import exec_
from salt.loader import _create_loader
from salt.fileclient import get_file_client | Replaced module six in file /salt/renderers/pyobjects.py | saltstack_salt | train | py |
a210ce84f23b90b55c1f6989595ed02cc6417248 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -242,6 +242,7 @@ function writeStreamToFs(opts, stream) {
walker.on('end', function () {
stream.emit('end');
+ stream.emit('finish');
});
} | emit 'finish' event on end (compatibility with Gulp@^<I> | zont_gulp-bower | train | js |
af812a98447e2c7fd819b0c68baad2c3a8ab6f1b | diff --git a/src/mg/Ding/HttpSession/HttpSession.php b/src/mg/Ding/HttpSession/HttpSession.php
index <HASH>..<HASH> 100644
--- a/src/mg/Ding/HttpSession/HttpSession.php
+++ b/src/mg/Ding/HttpSession/HttpSession.php
@@ -68,7 +68,6 @@ class HttpSession
*/
public function getAttribute($name)
{
- global $_SESSION;
if (isset($_SESSION[$name])) {
return $_SESSION[$name];
}
@@ -85,7 +84,6 @@ class HttpSession
*/
public function setAttribute($name, $value)
{
- global $_SESSION;
$_SESSION[$name] = $value;
} | Closes #<I> removed global keyword for $_SESSION | marcelog_Ding | train | php |
e776fa0185887e19d080602deb93484e2533e396 | diff --git a/winrm/command.go b/winrm/command.go
index <HASH>..<HASH> 100644
--- a/winrm/command.go
+++ b/winrm/command.go
@@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"io"
+ "strings"
)
type commandWriter struct {
@@ -105,6 +106,11 @@ func (command *Command) slurpAllOutput() (finished bool, err error) {
response, err := command.client.sendRequest(request)
if err != nil {
+ if strings.Contains(err.Error(), "OperationTimeout") {
+ // Operation timeout because there was no command output
+ return
+ }
+
command.Stderr.write.CloseWithError(err)
command.Stdout.write.CloseWithError(err)
return true, err | Fix an issue where no output for <I> seconds would throw an error | masterzen_winrm | train | go |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.