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 |
|---|---|---|---|---|---|
5e2956ef1fb4015c5e442c60271d6ae79fd3ffb7 | diff --git a/lib/models/candle/audit_gaps.js b/lib/models/candle/audit_gaps.js
index <HASH>..<HASH> 100644
--- a/lib/models/candle/audit_gaps.js
+++ b/lib/models/candle/audit_gaps.js
@@ -7,7 +7,7 @@ module.exports = ({ getInRange }) => (doc, { start, end }) => {
const candles = getInRange(doc, { start, end })
if (candles.length < 2) {
- return gaps
+ return { gaps, candles }
}
const width = TIME_FRAME_WIDTHS[tf]
@@ -22,5 +22,5 @@ module.exports = ({ getInRange }) => (doc, { start, end }) => {
}
}
- return gaps
+ return { gaps, candles }
} | (refactor) return gap indexes & candles from auditGaps | bitfinexcom_bfx-hf-models | train | js |
d578ba1c3e951cc480feefb92aab437bc5e58acf | diff --git a/test/unit/UnitTestCase.php b/test/unit/UnitTestCase.php
index <HASH>..<HASH> 100644
--- a/test/unit/UnitTestCase.php
+++ b/test/unit/UnitTestCase.php
@@ -14,22 +14,5 @@ namespace PMG\Queue;
abstract class UnitTestCase extends \PHPUnit\Framework\TestCase
{
- protected function skipIfPhp7()
- {
- if (self::isPhp7()) {
- $this->markTestSkipped(sprintf('PHP < 7.X is required, have %s', PHP_VERSION));
- }
- }
-
- protected function skipIfPhp5()
- {
- if (!self::isPhp7()) {
- $this->markTestSkipped(sprintf('PHP 7.X is required, have %s', PHP_VERSION));
- }
- }
-
- protected static function isPhp7()
- {
- return PHP_VERSION_ID >= 70000;
- }
+ // noop
} | Remove the skipIf* Functions
No longer used! | AgencyPMG_Queue | train | php |
e586517e6b880e72ee883c0dcbb6bb9030240748 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,9 +4,9 @@ monkeyhex.py is a small library to assist users of the python shell who work in
Monkeyhex, as the name suggests, monkeypatches the system displayhook as well as the pprint and pdb modules to format integers as hex. To use it, just import the library and all future results will be formatted. To view a result in decimal again, put the expression in a print statement.
'''
-from distutils.core import setup
+from setuptools import setup
setup(name='monkeyhex',
- version='1.7',
+ version='1.7.1',
py_modules=['monkeyhex'],
description='Monkeypatch the python interpreter and debugger to print integer results in hex',
long_description=long_description, | switch to setuptools; tick again for good measure | rhelmot_monkeyhex | train | py |
fa787927e0ae589adce31224d37a734c69b2fc3f | diff --git a/androguard/core/bytecodes/apk.py b/androguard/core/bytecodes/apk.py
index <HASH>..<HASH> 100644
--- a/androguard/core/bytecodes/apk.py
+++ b/androguard/core/bytecodes/apk.py
@@ -1974,7 +1974,7 @@ class ARSCParser(object):
def put_ate_value(self, result, ate, config):
if ate.is_complex():
complex_array = []
- result.append(config, complex_array)
+ result.append((config, complex_array))
for _, item in ate.item.items:
self.put_item_value(complex_array, item, config, complex_=True)
else: | [apk] ARSCParser.ResourceResolver: fix handling of complex resources. | androguard_androguard | train | py |
5b0364b2770b5b86132074d6358f24a52246a49c | diff --git a/shared/api/storage_pool_volume.go b/shared/api/storage_pool_volume.go
index <HASH>..<HASH> 100644
--- a/shared/api/storage_pool_volume.go
+++ b/shared/api/storage_pool_volume.go
@@ -185,6 +185,12 @@ type StorageVolumeSource struct {
// API extension: storage_api_volume_snapshots
VolumeOnly bool `json:"volume_only" yaml:"volume_only"`
+ // Whether existing destination volume should be refreshed
+ // Example: false
+ //
+ // API extension: custom_volume_refresh
+ Refresh bool `json:"refresh" yaml:"refresh"`
+
// Source project name
// Example: foo
// | shared/api: Add Refresh to StorageVolumeSource | lxc_lxd | train | go |
a4c718d66f173cc0775d7bab7c92a850c9e53079 | diff --git a/src/MediaEmbed/Data/stubs.php b/src/MediaEmbed/Data/stubs.php
index <HASH>..<HASH> 100644
--- a/src/MediaEmbed/Data/stubs.php
+++ b/src/MediaEmbed/Data/stubs.php
@@ -47,7 +47,10 @@ $stubs = array(
array(
'name' => 'Dailymotion',
'website' => 'http://www.dailymotion.com',
- 'url-match' => 'http://(?:www\.)?dailymotion\.(?:com|alice\.it)/(?:(?:[^"]*?)?video|swf)/([a-z0-9]{1,18})',
+ 'url-match' => array(
+ 'http://dai\.ly/([a-z0-9]{1,})',
+ 'http://(?:www\.)?dailymotion\.(?:com|alice\.it)/(?:(?:[^"]*?)?video|swf)/([a-z0-9]{1,18})',
+ ),
'embed-src' => 'http://www.dailymotion.com/swf/$2&related=0',
'embed-width' => '420',
'embed-height' => '339', | Added support for Dailymotion short urls | dereuromark_media-embed | train | php |
e1c598a1c3d26c6915a43d6ead5c5fe3e260daad | diff --git a/green/output.py b/green/output.py
index <HASH>..<HASH> 100644
--- a/green/output.py
+++ b/green/output.py
@@ -46,12 +46,6 @@ class Colors:
else:
self.termcolor = termcolor
- # Windows needs an extra library to translate ANSI colors into Windows
- # terminal colors.
- if self.termcolor and (platform.system() == 'Windows'): # pragma: no cover
- import colorama
- colorama.init()
-
self._restoreColor() | Since we're using colorama's wrapped stream directly, we don't need the global init. | CleanCut_green | train | py |
e9b028704de05564913491f1fd347b790dee3cee | diff --git a/internal/report/source_test.go b/internal/report/source_test.go
index <HASH>..<HASH> 100644
--- a/internal/report/source_test.go
+++ b/internal/report/source_test.go
@@ -47,7 +47,7 @@ func TestWebList(t *testing.T) {
}
output := buf.String()
- for _, expect := range []string{"func busyLoop", "callq.*mapassign"} {
+ for _, expect := range []string{"func busyLoop", "call.*mapassign"} {
if match, _ := regexp.MatchString(expect, output); !match {
t.Errorf("weblist output does not contain '%s':\n%s", expect, output)
} | Update mapassign regex to match both call variants (#<I>)
Different versions of `objdump` output `call` or `callq`.
Both work fine for the purposes of the test.
Fixes #<I> | google_pprof | train | go |
50bdfea028723cc1bedd4de199a82dbea47a4da6 | diff --git a/js/currencycom.js b/js/currencycom.js
index <HASH>..<HASH> 100644
--- a/js/currencycom.js
+++ b/js/currencycom.js
@@ -177,13 +177,6 @@ module.exports = class currencycom extends Exchange {
return this.options['timeDifference'];
}
- parsePrecision (precision) {
- if (precision === undefined) {
- return undefined;
- }
- return '1e' + Precise.stringNeg (precision);
- }
-
async fetchMarkets (params = {}) {
const response = await this.publicGetExchangeInfo (params);
// | currencycom parsePrecision is in the base class | ccxt_ccxt | train | js |
78c76da05d410264360d5abaf9e44d0ba1aff8c6 | diff --git a/tests/support/mixins.py b/tests/support/mixins.py
index <HASH>..<HASH> 100644
--- a/tests/support/mixins.py
+++ b/tests/support/mixins.py
@@ -651,12 +651,8 @@ def _fetch_events(q):
queue_item.task_done()
atexit.register(_clean_queue)
- a_config = AdaptedConfigurationTestCaseMixin()
- event = salt.utils.event.get_event(
- 'minion',
- sock_dir=a_config.get_config('minion')['sock_dir'],
- opts=a_config.get_config('minion'),
- )
+ opts = RUNTIME_VARS.RUNTIME_CONFIGS['minion']
+ event = salt.utils.event.get_event('minion', sock_dir=opts['sock_dir'], opts=opts)
while True:
try:
events = event.get_event(full=False) | Revert part of <I>c since it is not a fix | saltstack_salt | train | py |
965b93a1967a10283f3cee1c31e22d1bd5aaec99 | diff --git a/lib/dugway/theme.rb b/lib/dugway/theme.rb
index <HASH>..<HASH> 100644
--- a/lib/dugway/theme.rb
+++ b/lib/dugway/theme.rb
@@ -114,7 +114,7 @@ module Dugway
file_path = File.join(source_dir, file_name)
if File.exist?(file_path)
- File.read(file_path)
+ File.read(file_path).encode('utf-8')
else
nil
end | Ensure all source files are UTF-8 | bigcartel_dugway | train | rb |
0a90a86bbb157b2a8b52393e87cccfca8cd32788 | diff --git a/h2o-py/tests/_utils.py b/h2o-py/tests/_utils.py
index <HASH>..<HASH> 100644
--- a/h2o-py/tests/_utils.py
+++ b/h2o-py/tests/_utils.py
@@ -1,7 +1,7 @@
import fnmatch
-import imp
import importlib
import os
+import re
import sys
@@ -64,12 +64,15 @@ def load_module(name, dir_path, no_conflict=True):
spec.loader.exec_module(module)
return module
except AttributeError: # Py2
+ import imp
spec = imp.find_module(name, [dir_path])
return imp.load_module(name, *spec)
def load_utilities(test_file=None):
- ff = file_filter(include="**/_*.py", exclude="**/__init__.py")
+ utils_pat = re.compile(r".*/_\w+\.py$")
+ ff = file_filter(include=(lambda p: utils_pat.match(p)),
+ exclude="*/__init__.py")
recursive = False
folders = []
if test_file is None: | replace lenient glob-like pattern with more specific regexp to load test utility modules | h2oai_h2o-3 | train | py |
634c095e4f61460a4e379f43f4e046b177874874 | diff --git a/modules/__tests__/Router-test.js b/modules/__tests__/Router-test.js
index <HASH>..<HASH> 100644
--- a/modules/__tests__/Router-test.js
+++ b/modules/__tests__/Router-test.js
@@ -190,6 +190,33 @@ describe('Router', function () {
});
});
+ it('handles forward slashes', function(done) {
+ // https://github.com/rackt/react-router/issues/1865
+ class Parent extends React.Component {
+ render() {
+ return <div>{this.props.children} </div>
+ }
+ }
+
+ class Child extends React.Component {
+ render() {
+ const {params} = this.props
+ return <h1>{params.name}</h1>
+ }
+ }
+
+ React.render((
+ <Router history={createHistory('/apple%2Fbanana')}>
+ <Route component={Parent}>
+ <Route path='/:name' component={Child} />
+ </Route>
+ </Router>
+ ), node, function () {
+ expect(node.textContent.trim()).toEqual('apple/banana');
+ done();
+ });
+ });
+
});
}); | added forward slash test in param name
closes #<I> | taion_rrtr | train | js |
65e754fdb93067453c4a647506efbd08981b86c8 | diff --git a/angr/simos/simos.py b/angr/simos/simos.py
index <HASH>..<HASH> 100644
--- a/angr/simos/simos.py
+++ b/angr/simos/simos.py
@@ -41,7 +41,7 @@ class SimOS(object):
self.project.hook(self.return_deadend, P['stubs']['CallReturn']())
self.unresolvable_target = self.project.loader.extern_object.allocate()
- self.project.hook(self.unresolvable_target, P['stubs']['UnresolvableTarget'])
+ self.project.hook(self.unresolvable_target, P['stubs']['UnresolvableTarget']())
def irelative_resolver(resolver_addr):
# autohooking runs before this does, might have provided this already | Don't hook with a class fish jeez! | angr_angr | train | py |
30b148c8d481f5d0b08aa15540b4f685776c58bc | diff --git a/command/alloc_exec.go b/command/alloc_exec.go
index <HASH>..<HASH> 100644
--- a/command/alloc_exec.go
+++ b/command/alloc_exec.go
@@ -265,6 +265,11 @@ func (l *AllocExecCommand) execImpl(client *api.Client, alloc *api.Allocation, t
stdin = escapingio.NewReader(stdin, escapeChar[0], func(c byte) bool {
switch c {
case '.':
+ // need to restore tty state so error reporting here
+ // gets emitted at beginning of line
+ outCleanup()
+ inCleanup()
+
stderr.Write([]byte("\nConnection closed\n"))
cancelFn()
return true
@@ -272,7 +277,6 @@ func (l *AllocExecCommand) execImpl(client *api.Client, alloc *api.Allocation, t
return false
}
})
-
}
} | Restore tty start before emitting errors
Otherwise, the error message appears indented unexpectedly. | hashicorp_nomad | train | go |
fe7a3a913ae074c7fd9e64423ea5128dc88b635c | diff --git a/core/src/main/java/com/linecorp/armeria/client/HttpResponseDecoder.java b/core/src/main/java/com/linecorp/armeria/client/HttpResponseDecoder.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/linecorp/armeria/client/HttpResponseDecoder.java
+++ b/core/src/main/java/com/linecorp/armeria/client/HttpResponseDecoder.java
@@ -286,8 +286,18 @@ abstract class HttpResponseDecoder {
if (cancelTimeout()) {
actionOnTimeoutCancelled.accept(cause);
} else {
- if (cause != null && !Exceptions.isExpected(cause)) {
- logger.warn("Unexpected exception:", cause);
+ if (cause != null && logger.isWarnEnabled() && !Exceptions.isExpected(cause)) {
+ final StringBuilder logMsg = new StringBuilder("Unexpected exception while closing");
+ if (request != null) {
+ final String authority = request.authority();
+ if (authority != null) {
+ logMsg.append(" a request to ").append(authority);
+ }
+ }
+ if (cause instanceof ResponseTimeoutException) {
+ logMsg.append(" after ").append(responseTimeoutMillis).append("ms");
+ }
+ logger.warn(logMsg.toString(), cause);
}
} | Explain Response timeout (#<I>)
Motivation:
We're observing a cryptic warn :
Unexpected exception:
and the cause has no trace:
com.linecorp.armeria.client.ResponseTimeoutException: null
Modifications:
- Add which host failed
- Add timeout value
.. to the warning log message.
Result:
Less cryptic error message. | line_armeria | train | java |
51da5c87757e0e4b4685f0c8b839da7c66b0eaa2 | diff --git a/cmd2.py b/cmd2.py
index <HASH>..<HASH> 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1887,6 +1887,13 @@ class Cmd(cmd.Cmd):
# Get all tokens through the one being completed
tokens = tokens_for_completion(line, begidx, endidx, preserve_quotes=True)
+ # Either had a parsing error or are trying to complete the command token
+ # The latter can happen if default_to_shell is True and parseline() allowed
+ # assumed something like " or ' was a command.
+ if tokens is None or len(tokens) == 1:
+ self.completion_matches = []
+ return None
+
# Get the status of quotes in the token being completed
completion_token = tokens[-1] | Added an extra parsing check | python-cmd2_cmd2 | train | py |
1ff6b3da03c0bc6139144f3a23663673c8acdc8d | diff --git a/lib/ruboty.rb b/lib/ruboty.rb
index <HASH>..<HASH> 100644
--- a/lib/ruboty.rb
+++ b/lib/ruboty.rb
@@ -25,7 +25,7 @@ module Ruboty
memoize :handlers
def actions
- handlers.map(&:actions).flatten.sort_by(&:all?)
+ handlers.map(&:actions).flatten.sort_by { |action| action.all? ? 1 : 0 }
end
end
end | Booleans can't be compared
>> [true,false].sort
ArgumentError: comparison of TrueClass with false failed
>> [false,false].sort
=> [false,false] | r7kamura_ruboty | train | rb |
b93e466083a3306b382993cdbbb76b309cccf1f0 | diff --git a/js/cobinhood.js b/js/cobinhood.js
index <HASH>..<HASH> 100644
--- a/js/cobinhood.js
+++ b/js/cobinhood.js
@@ -622,7 +622,7 @@ module.exports = class cobinhood extends Exchange {
};
}
- async withdraw (code, amount, address, params = {}) {
+ async withdraw (code, amount, address, tag = undefined, params = {}) {
await this.loadMarkets ();
let currency = this.currency (code);
let response = await this.privatePostWalletWithdrawals (this.extend ({ | cobinhood withdraw() signature unified fix #<I> | ccxt_ccxt | train | js |
84cf263497e57118a7aca6c4cadf304fc7ac0c4f | diff --git a/account/dashboards.widgets.js b/account/dashboards.widgets.js
index <HASH>..<HASH> 100644
--- a/account/dashboards.widgets.js
+++ b/account/dashboards.widgets.js
@@ -98,11 +98,17 @@ class Widgets {
* @param {JSON} data
* @return {Promise}
*/
- sendData(dashboard_id, widget_id, data) {
+ sendData(dashboard_id, widget_id, data, bypassBucket) {
const url = `${config.api_url}/data/${dashboard_id}/${widget_id}`;
const method = 'POST';
- const options = Object.assign({}, this.default_options, {url, method, data});
+ const options = Object.assign({}, this.default_options, {
+ url,
+ method,
+ data,
+ paramsSerializer,
+ params: { bypass_bucket: bypassBucket || false }
+ });
return request(options);
} | feat: added bypassbucket method | tago-io_tago-sdk-js | train | js |
a181d1732f41b85960c6ae7a9c0ce83441784757 | diff --git a/lib/baton/channel.rb b/lib/baton/channel.rb
index <HASH>..<HASH> 100644
--- a/lib/baton/channel.rb
+++ b/lib/baton/channel.rb
@@ -31,6 +31,7 @@ module Baton
# Attach callbacks for error handling
@connection.on_tcp_connection_loss(&method(:handle_tcp_failure))
+ @connection.on_skipped_heartbeats(&method(:handle_tcp_failure))
@channel.on_error(&method(:handle_channel_exception))
end | Reconnect if we get a skipped heartbeat | digital-science_baton | train | rb |
20ca56ec5953d2cbc05f3fb11e230be369bbde33 | diff --git a/lib/emitter.js b/lib/emitter.js
index <HASH>..<HASH> 100644
--- a/lib/emitter.js
+++ b/lib/emitter.js
@@ -70,7 +70,7 @@ Emitter.parseURI = function(options)
break;
case 'ws:':
- options.websocket = true;
+ options.ws = true;
options.host = parsed.hostname;
options.port = parsed.port;
break;
@@ -101,7 +101,7 @@ Emitter.prototype.connect = function connect()
if (this.options.udp)
this.client = new UDPStream(this.options);
- else if (this.options.websocket)
+ else if (this.options.ws)
this.client = new WSStream(this.options);
else
this.client = net.connect(this.options); | renamed websocket to ws | numbat-metrics_numbat-emitter | train | js |
dd495a20a99a52aab0d882b0d41a36e1ad9e4807 | diff --git a/libraries/lithium/data/source/http/adapter/CouchDb.php b/libraries/lithium/data/source/http/adapter/CouchDb.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/data/source/http/adapter/CouchDb.php
+++ b/libraries/lithium/data/source/http/adapter/CouchDb.php
@@ -44,6 +44,9 @@ class CouchDb extends \lithium\data\source\Http {
/**
* Deconstruct
*
+ * Ensures that the server connection is closed and resources are freed when the adapter
+ * instance is destroyed.
+ *
* @return void
*/
public function __destruct() {
@@ -125,12 +128,14 @@ class CouchDb extends \lithium\data\source\Http {
}
/**
- * name
+ * Quotes identifiers.
+ *
+ * CouchDb does not need identifiers quoted, so this method simply returns the identifier.
*
- * @param string $name
- * @return string
+ * @param string $name The identifier to quote.
+ * @return string The quoted identifier.
*/
- public function name($name) {
+ public function name($name) {
return $name;
} | Fixing whitespace and adding to dockblocks | UnionOfRAD_framework | train | php |
c978e52f76a22e0843ca56c7546a327fcd0a0ac5 | diff --git a/fpbox/funcs.py b/fpbox/funcs.py
index <HASH>..<HASH> 100644
--- a/fpbox/funcs.py
+++ b/fpbox/funcs.py
@@ -137,4 +137,4 @@ def c(f, g):
def compose(fs):
"""Function composition over a list of functions"""
- return reduce(c, reversed(fs))
+ return reduce(c, fs) | (De-)reversed composed | AN3223_fpbox | train | py |
c3f7a467186d2b0b70bd69c52778b4ac1ae26033 | diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java b/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java
index <HASH>..<HASH> 100644
--- a/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java
+++ b/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java
@@ -47,7 +47,8 @@ public abstract class PagedList<E> implements List<E> {
* @param page the {@link Page} object.
*/
public PagedList(Page<E> page) {
- items = page.getItems();
+ this();
+ items.addAll(page.getItems());
nextPageLink = page.getNextPageLink();
currentPage = page;
} | Fixing UnsupportedOperation exception in PagedList | Azure_autorest-clientruntime-for-java | train | java |
491f488f5ac4e50abfbd1a434971e41e48aa2f15 | diff --git a/activesupport/lib/active_support/deprecation/reporting.rb b/activesupport/lib/active_support/deprecation/reporting.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/deprecation/reporting.rb
+++ b/activesupport/lib/active_support/deprecation/reporting.rb
@@ -83,7 +83,7 @@ module ActiveSupport
rails_gem_root = File.expand_path("../../../../..", __FILE__) + "/"
offending_line = callstack.find { |frame|
- !frame.absolute_path.start_with?(rails_gem_root)
+ frame.absolute_path && !frame.absolute_path.start_with?(rails_gem_root)
} || callstack.first
[offending_line.path, offending_line.lineno, offending_line.label]
end | Fix deprecation message when frame doesn't have absolute_path
When a frame is an eval block without filename argument there is no
absolute_path so the previous implementation would fail because `nil`
doesn't responds to `start_with?`. | rails_rails | train | rb |
cc654b39475d3e094c1c7f7094755d17109f7487 | diff --git a/asana/client.py b/asana/client.py
index <HASH>..<HASH> 100644
--- a/asana/client.py
+++ b/asana/client.py
@@ -270,6 +270,18 @@ class Client(object):
}
@classmethod
+ def basic_auth(Klass, apiKey):
+ """DEPRECATED: this is only present for backwards-compatibility.
+
+ This will be removed in the future; for new apps, prefer the
+ `access_token` method.
+
+ Construct an Asana Client using a Personal Access Token as if it
+ were an old (removed) Asana API Key.
+ """
+ return Klass(auth=requests.auth.HTTPBasicAuth(apiKey, ''))
+
+ @classmethod
def access_token(Klass, accessToken):
"""Construct an Asana Client with a Personal Access Token"""
return Klass( | Added back in the basic_auth function | Asana_python-asana | train | py |
789556d7d9aed3f9addfaff185b6172dccf16dca | diff --git a/cookies.py b/cookies.py
index <HASH>..<HASH> 100644
--- a/cookies.py
+++ b/cookies.py
@@ -2,7 +2,7 @@
"cookies.py"
-import os, copy
+import os, copy, urllib
import itertools
import string, re
@@ -66,7 +66,7 @@ class cookie( dict ):
def getRequestHeader( self ):
"returns the cookie as can be used in an HTTP Request"
- return '='.join( ( self['name'], self['value'] ) )
+ return '='.join( ( self['name'], urllib.quote( self['value'] ) ) )
def isSecure( self ):
return eval( string.capwords( self.get( 'secure', 'False' ) ) )
\ No newline at end of file | Apparently, cookies are supposed to be quoted strings. In the past, this wasn't an issue, but when I started generating strings with spaces and other characters in them, they need to be quoted.
Does this mean I should unquote the cookies when they come in? | jaraco_jaraco.util | train | py |
612465b4be86bb9f28c34bf7f8efe3d62b307309 | diff --git a/inputs/text-area/text-area.js b/inputs/text-area/text-area.js
index <HASH>..<HASH> 100644
--- a/inputs/text-area/text-area.js
+++ b/inputs/text-area/text-area.js
@@ -87,6 +87,10 @@ export class TextArea extends React.Component {
};
render() {
+ const isElementBiggerThanMinRowCount =
+ this.state.textareaRowCount > TextArea.MIN_ROW_COUNT;
+ const isContentBiggerThanMinRowCount =
+ this.state.contentRowCount > TextArea.MIN_ROW_COUNT;
return (
<Constraints.Horizontal constraint={this.props.horizontalConstraint}>
<Collapsible isDefaultClosed={this.props.isDefaultClosed}>
@@ -123,9 +127,8 @@ export class TextArea extends React.Component {
{...filterDataAttributes(this.props)}
/>
{((!this.props.isDefaultClosed &&
- (this.state.textareaRowCount > TextArea.MIN_ROW_COUNT ||
- !isOpen)) ||
- this.state.contentRowCount > TextArea.MIN_ROW_COUNT) && (
+ (isElementBiggerThanMinRowCount || !isOpen)) ||
+ isContentBiggerThanMinRowCount) && (
<FlatButton
onClick={toggle}
type="primary" | fix(text-area): extract assertions to variables | commercetools_ui-kit | train | js |
5477b01aa0da469fa440d673b17129c4da3fd139 | diff --git a/engine/models/Living.js b/engine/models/Living.js
index <HASH>..<HASH> 100644
--- a/engine/models/Living.js
+++ b/engine/models/Living.js
@@ -86,7 +86,7 @@ Living = new Class({
lines.push(this.genderize('%You %are carrying ', obsv)+
this.listItems().conjoin()+'.');
}
- if (lines.length==0) return "%You have nothing.";
+ if (lines.length==0) lines.push("%You have nothing.");
return lines;
},
diff --git a/engine/models/World.js b/engine/models/World.js
index <HASH>..<HASH> 100644
--- a/engine/models/World.js
+++ b/engine/models/World.js
@@ -116,7 +116,7 @@ World = new Class({
if (!this.items[path]) {
var file = this.itemPath+path;
this.loadFile(file, function(e,item) {
- item.path = path;
+ item.implement({'path':path});
that.items[path] = item;
}, {'sync':true});
}
@@ -131,6 +131,7 @@ World = new Class({
var that = this;
if (!this.npcs[path]) {
this.loadFile(file, function(e,item) {
+ item.implement({'path':path});
that.npcs[path] = item;
}, {'sync':true});
} | Fixed the item path bug for hopefully the last time. | Yuffster_discord-engine | train | js,js |
a0eb28eaf33210d017b50e918111c962978f5fe4 | diff --git a/pyontutils/ttlser.py b/pyontutils/ttlser.py
index <HASH>..<HASH> 100644
--- a/pyontutils/ttlser.py
+++ b/pyontutils/ttlser.py
@@ -83,6 +83,7 @@ class CustomTurtleSerializer(TurtleSerializer):
SKOS.related,
DC.description,
RDFS.subClassOf,
+ RDFS.subPropertyOf,
OWL.intersectionOf,
OWL.unionOf,
OWL.disjointWith,
@@ -373,5 +374,5 @@ class CustomTurtleSerializer(TurtleSerializer):
self.endDocument()
stream.write(u"\n".encode('ascii'))
- stream.write((u"### Serialized using the nifstd custom serializer v1.0.6\n").encode('ascii'))
+ stream.write((u"### Serialized using the nifstd custom serializer v1.0.7\n").encode('ascii')) | ttlser added RDFS.subPropertyOf to predicateOrder -> version bump to <I> | tgbugs_pyontutils | train | py |
b88cc8156cc044a2d834e61df241c8de1b996b48 | diff --git a/discord/state.py b/discord/state.py
index <HASH>..<HASH> 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -208,7 +208,6 @@ class ConnectionState:
if len(self._private_channels) > 128:
_, to_remove = self._private_channels.popitem(last=False)
- print(to_remove)
if isinstance(to_remove, DMChannel):
self._private_channels_by_user.pop(to_remove.recipient.id, None) | Accidentally left a print statement. | Rapptz_discord.py | train | py |
2f89755bd4a6a4cfc5eb9c3e044094c6fc998df9 | diff --git a/src/monitorActions.js b/src/monitorActions.js
index <HASH>..<HASH> 100644
--- a/src/monitorActions.js
+++ b/src/monitorActions.js
@@ -5,6 +5,7 @@ import { setValue } from './utils';
export const isMonitorAction = (store) => store.__isRemotedevAction === true;
export const dispatchMonitorAction = (store, devTools) => {
+ let intermValue;
const initValue = mobx.toJS(store);
devTools.init(initValue);
@@ -15,6 +16,14 @@ export const dispatchMonitorAction = (store, devTools) => {
setValue(store, initValue);
devTools.init(initValue);
return;
+ case 'COMMIT':
+ intermValue = mobx.toJS(store);
+ devTools.init(intermValue);
+ return;
+ case 'ROLLBACK':
+ setValue(store, intermValue);
+ devTools.init(intermValue);
+ return;
case 'JUMP_TO_STATE':
setValue(store, parse(message.state));
return; | Implement COMMIT and ROLLBACK actions | zalmoxisus_mobx-remotedev | train | js |
cf4e91c12ff4fdc67bfa2dba84e836e9d9b2077f | diff --git a/runtime/dev.js b/runtime/dev.js
index <HASH>..<HASH> 100644
--- a/runtime/dev.js
+++ b/runtime/dev.js
@@ -74,6 +74,13 @@
if (delegate) {
try {
var info = delegate.generator[method](arg);
+
+ // Delegate generator ran and handled its own exceptions so
+ // regardless of what the method was, we continue as if it is
+ // "next" with an undefined arg.
+ method = "next";
+ arg = void 0;
+
} catch (uncaught) {
context.delegate = null;
@@ -81,6 +88,7 @@
// overhead of an extra function call.
method = "throw";
arg = uncaught;
+
continue;
} | Handle .throw method in delegate generator. Fix #<I>. | facebook_regenerator | train | js |
84a66c28f4e25b7ec8e519dce79f3d1e57dd9331 | diff --git a/lib/console-reporter.js b/lib/console-reporter.js
index <HASH>..<HASH> 100644
--- a/lib/console-reporter.js
+++ b/lib/console-reporter.js
@@ -222,13 +222,13 @@ ConsoleReporter.prototype.printReport = function printReport(report, opts) {
let result = [];
for(const metricName of sortedAlphabetically) {
- if (report.counters?.[metricName]) {
+ if (typeof report.counters?.[metricName] !== 'undefined') {
result = result.concat(printCounters([metricName], report));
}
- if (report.summaries?.[metricName]) {
+ if (typeof report.summaries?.[metricName] !== 'undefined') {
result = result.concat(printSummaries([metricName], report));
}
- if (report.rates?.[metricName]) {
+ if (typeof report.rates?.[metricName] !== 'undefined') {
result = result.concat(printRates([metricName], report));
}
} | fix(console-reporter): handle metrics with value of zero | artilleryio_artillery | train | js |
a705802ae1f90cb0dee947cb40428de09236b59c | diff --git a/lib/NormalModuleFactory.js b/lib/NormalModuleFactory.js
index <HASH>..<HASH> 100644
--- a/lib/NormalModuleFactory.js
+++ b/lib/NormalModuleFactory.js
@@ -54,6 +54,9 @@ NormalModuleFactory.prototype.create = function(context, dependency, callback) {
if(err) return callback(err);
var loaders = results[0];
resource = results[1];
+
+ if(resource === false) return callback(); // ignored
+
var userRequest = loaders.concat([resource]).join("!");
if(noPrePostAutoLoaders) | allow to ignore a file by browser field
fixes #<I> | webpack_webpack | train | js |
ab2f97226c38ad36eb79d8a661befef4c5a6ce19 | diff --git a/lib/reactive-ruby/isomorphic_helpers.rb b/lib/reactive-ruby/isomorphic_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/reactive-ruby/isomorphic_helpers.rb
+++ b/lib/reactive-ruby/isomorphic_helpers.rb
@@ -6,19 +6,12 @@ module React
if RUBY_ENGINE != 'opal'
def self.load_context(ctx, controller, name = nil)
- puts "************************** React Server Context Initialized #{name} *********************************************"
@context = Context.new("#{controller.object_id}-#{Time.now.to_i}", ctx, controller, name)
end
else
def self.load_context(unique_id = nil, name = nil)
# can be called on the client to force re-initialization for testing purposes
if !unique_id || !@context || @context.unique_id != unique_id
- if on_opal_server?
- message = "************************ React Prerendering Context Initialized #{name} ***********************"
- else
- message = "************************ React Browser Context Initialized ****************************"
- end
- log(message)
@context = Context.new(unique_id)
end
@context | kill puts logging. closes #<I> | zetachang_react.rb | train | rb |
15d5c91fdb0eb8c5dc14f7edb7bab75ce75e662b | diff --git a/src/de/mrapp/android/preference/PreferenceActivity.java b/src/de/mrapp/android/preference/PreferenceActivity.java
index <HASH>..<HASH> 100644
--- a/src/de/mrapp/android/preference/PreferenceActivity.java
+++ b/src/de/mrapp/android/preference/PreferenceActivity.java
@@ -375,10 +375,15 @@ public abstract class PreferenceActivity extends Activity implements
* devices with a large screen.
*
* @return The color of the shadow, which is drawn besides the navigation,
- * an {@link Integer} value
+ * as an {@link Integer} value or -1, if the device has a small
+ * screen
*/
public final int getShadowColor() {
- return shadowColor;
+ if (isSplitScreen()) {
+ return shadowColor;
+ } else {
+ return -1;
+ }
}
/** | The method getShadowColor() does now return -1 on devices with a small screen. | michael-rapp_AndroidPreferenceActivity | train | java |
36ba92f5bc30cdcddfc9a7c2f174cb5c958188bb | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,7 +47,7 @@ master_doc = 'index'
# General information about the project.
project = u'Agile UI'
-copyright = u'2016-2017, Agile Toolkit'
+copyright = u'2016-2019, Agile Toolkit'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the | Update copyright to <I> | atk4_ui | train | py |
539c97e7ab15afae9678b6c3877b7baebab8fbd6 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -35,7 +35,6 @@ var postprocess = R.memoize(function(symbols) {
var toDecimalRaw = R.curryN(4, function(b, symbols, base, n) {
return R.pipe(
toString,
- splitWithoutSep,
R.reverse,
R.map(indexOfSymbol(symbols)),
R.addIndex(R.map)(posNotation.mapper(b, base)), | refactor: remove superfluous step | javiercejudo_base-conversion-to-dec | train | js |
ce5d8e711793848de32799f90fc7f190440c7dc8 | diff --git a/gulp/tasks/watch.js b/gulp/tasks/watch.js
index <HASH>..<HASH> 100644
--- a/gulp/tasks/watch.js
+++ b/gulp/tasks/watch.js
@@ -63,4 +63,4 @@ gulp.task("watch-noserve", cb => {
watchTask(cb);
});
-gulp.task("watch", [html, javascript, less, staticContent, watchTask]);
\ No newline at end of file
+gulp.task("watch", ["html", "javascript", "less", "staticContent", watchTask]);
\ No newline at end of file | Tasks needs to be named - not referenced :) | Cratis_JavaScript.Pipeline | train | js |
9f80cc9652fd597be8764665a0ee4d0172930273 | diff --git a/nameko/__init__.py b/nameko/__init__.py
index <HASH>..<HASH> 100644
--- a/nameko/__init__.py
+++ b/nameko/__init__.py
@@ -1,5 +0,0 @@
-from __future__ import absolute_import
-import logging
-
-root_logger = logging.getLogger()
-root_logger.setLevel(logging.INFO) | removing logger setupgit st | nameko_nameko | train | py |
90e6f142e4e1c9e4f45fe054de7f22ce4c78d876 | diff --git a/source/rafcon/gui/utils/comparison.py b/source/rafcon/gui/utils/comparison.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/utils/comparison.py
+++ b/source/rafcon/gui/utils/comparison.py
@@ -11,9 +11,9 @@ def compare_variables(tree_model, iter1, iter2, user_data=None):
path1 = tree_model.get_path(iter1)[0]
path2 = tree_model.get_path(iter2)[0]
# get key of first variable
- name1 = tree_model[path1][0][0]
+ name1 = tree_model[path1][0]
# get key of second variable
- name2 = tree_model[path2][0][0]
+ name2 = tree_model[path2][0]
name1_as_bits = ' '.join(format(ord(x), 'b') for x in name1)
name2_as_bits = ' '.join(format(ord(x), 'b') for x in name2)
if name1_as_bits == name2_as_bits: | fix cata port comparison
in data port list store | DLR-RM_RAFCON | train | py |
2aa45429730671e40f6e1eca02ab4761ba361b20 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -33,8 +33,8 @@ setup(
long_description=read('README.rst'),
packages=find_packages(exclude='tests'),
install_requires=[
- 'mock==1.0.1',
- 'six==1.9.0',
+ 'mock~=1.0.1',
+ 'six>=1.9.0',
'requests',
],
license='MIT', | fix: Use ranges for dependencies | relekang_rmoq | train | py |
6a5eaea83543b17e1b19b565a5631f53e45ae2bd | diff --git a/zipline/gens/tradesimulation.py b/zipline/gens/tradesimulation.py
index <HASH>..<HASH> 100644
--- a/zipline/gens/tradesimulation.py
+++ b/zipline/gens/tradesimulation.py
@@ -223,7 +223,7 @@ class AlgorithmSimulator(object):
elif event.type == DATASOURCE_TYPE.SPLIT:
self.algo.blotter.process_split(event)
- if not self.algo.instant_fill:
+ if not instant_fill:
self.process_event(event)
else:
events_to_be_processed.append(event) | MAINT: Use local variable with same value | quantopian_zipline | train | py |
c80baece7bc54fd42b988545746fc9765a18b57b | diff --git a/basic_cms/tests/test_api.py b/basic_cms/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/basic_cms/tests/test_api.py
+++ b/basic_cms/tests/test_api.py
@@ -31,8 +31,8 @@ class CMSPagesApiTests(TestCase):
self.assertEqual(response.status_code, 404)
response = self.client.get(reverse('basic_cms_api', args=['terms']), data)
self.assertEqual(response.status_code, 200)
- # self.assertJSONEqual(self.original_json_data, response.content)
- self.assertEqual(self.original_json_data, response.data)
+ self.assertJSONEqual(self.original_json_data, response.content)
+ self.assertEqual(self.original_json_data, response.content)
response = self.client.get(reverse('basic_cms_api', args=['terms']))
self.assertEqual(response.status_code, 200) | python <I> support #3 | ArabellaTech_django-basic-cms | train | py |
0d254227fb3b5cab1660f8c01625fcb0aeacb5f9 | diff --git a/classes/Boom/Controller/Asset.php b/classes/Boom/Controller/Asset.php
index <HASH>..<HASH> 100644
--- a/classes/Boom/Controller/Asset.php
+++ b/classes/Boom/Controller/Asset.php
@@ -48,7 +48,7 @@ abstract class Boom_Controller_Asset extends Boom_Controller
public function action_embed()
{
- $this->response->body(HTML::image('asset/view/'.$this->asset->id.'/400'));
+ $this->response->body(HTML::anchor('asset/view/'.$this->asset->id, "Download {$this->asset->title}"));
}
/**
diff --git a/classes/Boom/Controller/Asset/Image.php b/classes/Boom/Controller/Asset/Image.php
index <HASH>..<HASH> 100644
--- a/classes/Boom/Controller/Asset/Image.php
+++ b/classes/Boom/Controller/Asset/Image.php
@@ -108,6 +108,11 @@ class Boom_Controller_Asset_Image extends Controller_Asset
->body(file_get_contents($filename));
}
+ public function action_embed()
+ {
+ $this->response->body(HTML::image('asset/view/'.$this->asset->id.'/400'));
+ }
+
/**
* Show a thumbnail of the asset.
* For images a thumbnail is just showing an image with different dimensions. | Fix for embedding non-image assets in text | boomcms_boom-core | train | php,php |
2d9d847d81bf4522eeb8513baef7b1ad649fd7af | diff --git a/lib/icims/job.rb b/lib/icims/job.rb
index <HASH>..<HASH> 100644
--- a/lib/icims/job.rb
+++ b/lib/icims/job.rb
@@ -23,13 +23,13 @@ module ICIMS
fetch_records(ids, fields)
end
- def approved portal_ids=[]
+ def approved portal_ids: [], fields: []
portal_ids = ICIMS.portal_ids unless portal_ids.any?
portal_ids.map do |id|
search([
{ name: "job.folder", value: ['D31001'], operator: "=" },
{ name: "job.postedto", value: [id], operator: "=" }
- ])
+ ], fields: fields)
end.flatten
end | Added fields to ICIMS::Job.approved | mathieugagne_icims | train | rb |
986adf2bbe366516eb8811312ba008cc421dd884 | diff --git a/fusesoc/main.py b/fusesoc/main.py
index <HASH>..<HASH> 100644
--- a/fusesoc/main.py
+++ b/fusesoc/main.py
@@ -156,7 +156,7 @@ def add_library(cm, args):
name = args.name
library['sync-uri'] = vars(args)['sync-uri']
if args.location:
- library['location'] = args.location
+ library['location'] = os.path.abspath(args.location)
if args.no_auto_sync:
library['auto-sync'] = False | Use absolute path for location in library add | olofk_fusesoc | train | py |
635b3d0fec8d275d2e31237cc5f81461c86edfd7 | diff --git a/packages/conventional-github-releaser/index.js b/packages/conventional-github-releaser/index.js
index <HASH>..<HASH> 100644
--- a/packages/conventional-github-releaser/index.js
+++ b/packages/conventional-github-releaser/index.js
@@ -40,7 +40,7 @@ function conventionalGithubReleaser(auth, changelogOpts, context, gitRawCommitsO
writerOpts = changelogArgs[4];
changelogOpts = merge({
- transform: through.obj(function(chunk, enc, cb) {
+ transform: function(chunk, cb) {
if (typeof chunk.gitTags === 'string') {
var match = /tag:\s*(.+?)[,\)]/gi.exec(chunk.gitTags);
if (match) {
@@ -53,7 +53,7 @@ function conventionalGithubReleaser(auth, changelogOpts, context, gitRawCommitsO
}
cb(null, chunk);
- }),
+ },
releaseCount: 1
}, changelogOpts); | fix(transform): use new syntax of conventional-changelog@<I> | conventional-changelog_releaser-tools | train | js |
5245493277a262e0fb8d477b866f9d3f849d5506 | diff --git a/rlp/sedes/binary.py b/rlp/sedes/binary.py
index <HASH>..<HASH> 100644
--- a/rlp/sedes/binary.py
+++ b/rlp/sedes/binary.py
@@ -16,9 +16,9 @@ class Binary(object):
self.allow_empty = allow_empty
@classmethod
- def fixed_length(cls, l):
+ def fixed_length(cls, l, allow_empty=False):
"""Create a sedes for binary data with exactly `l` bytes."""
- return cls(l, l)
+ return cls(l, l, allow_empty=allow_empty)
def is_valid_length(self, l):
return any((self.min_length <= l <= self.max_length,
diff --git a/rlp/sedes/lists.py b/rlp/sedes/lists.py
index <HASH>..<HASH> 100644
--- a/rlp/sedes/lists.py
+++ b/rlp/sedes/lists.py
@@ -80,7 +80,7 @@ class Serializable(object):
:param \*args: initial values for the first attributes defined via
:attr:`fields`
:param \*\*kwargs: initial values for all attributes not initialized via
- positional arguments
+ positional arguments
"""
fields = tuple() | Added allow_empty option for fixed_length binary | ethereum_pyrlp | train | py,py |
e7e7e508f09d7ff3c3ce003eb7acab5168494f6f | diff --git a/concrete/src/Page/Collection/Version/Version.php b/concrete/src/Page/Collection/Version/Version.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Page/Collection/Version/Version.php
+++ b/concrete/src/Page/Collection/Version/Version.php
@@ -447,14 +447,11 @@ class Version extends Object implements PermissionObjectInterface, AttributeObje
$db->executeQuery($q2, $v2);
// next, we rescan our collection paths for the particular collection, but only if this isn't a generated collection
- // I don't know why but this just isn't reliable. It might be a race condition with the cached page objects?
- /*
- * if ((($oldHandle != $newHandle) || $oldHandle == '') && (!$c->isGeneratedCollection())) {
- */
+ if ((($oldHandle != $newHandle) || $oldHandle == '') && (!$c->isGeneratedCollection())) {
- $c->rescanCollectionPath();
+ $c->rescanCollectionPath();
- // }
+ }
// check for related version edits. This only gets applied when we edit global areas.
$r = $db->executeQuery('select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array( | Rescan collection paths only if the collection handle is updated | concrete5_concrete5 | train | php |
873da93f8b18dae9cf2d97ea8f3b1fecb88b1a0b | diff --git a/doc/generator/parseFile.js b/doc/generator/parseFile.js
index <HASH>..<HASH> 100644
--- a/doc/generator/parseFile.js
+++ b/doc/generator/parseFile.js
@@ -399,10 +399,10 @@ oo.initClass(_Parser);
var _parseTagTypes = dox.parseTagTypes;
dox.parseTagTypes = function(str, tag) {
if (/\{\w+(\/\w+)+([.#]\w+)*\}/.exec(str)) {
- str = str.replace('/', '_SEP_');
+ str = str.replace(/\//g, '_SEP_');
var types = _parseTagTypes(str, tag);
for (var i = 0; i < types.length; i++) {
- types[i] = types[i].replace('_SEP_', '/');
+ types[i] = types[i].replace(/_SEP_/g, '/');
}
} else {
return _parseTagTypes(str, tag); | Fix in jsdoc type parser workaround. | substance_substance | train | js |
0ee6325412760e453a5a136bede25916fa9c71f7 | diff --git a/cilium-net-daemon/daemon/endpoint_test.go b/cilium-net-daemon/daemon/endpoint_test.go
index <HASH>..<HASH> 100644
--- a/cilium-net-daemon/daemon/endpoint_test.go
+++ b/cilium-net-daemon/daemon/endpoint_test.go
@@ -26,3 +26,11 @@ func (s *DaemonSuite) TestIsValidID(c *C) {
c.Assert(isValidID("0x12"), Equals, false)
c.Assert(isValidID("./../../../etc"), Equals, false)
}
+
+func (s *DaemonSuite) TestGoArray2C(c *C) {
+ c.Assert(goArray2C([]byte{0, 0x01, 0x02, 0x03}), Equals, "{ 0x0, 0x1, 0x2, 0x3 }")
+ c.Assert(goArray2C([]byte{0, 0xFF, 0xFF, 0xFF}), Equals, "{ 0x0, 0xff, 0xff, 0xff }")
+ c.Assert(goArray2C([]byte{0xa, 0xbc, 0xde, 0xf1}), Equals, "{ 0xa, 0xbc, 0xde, 0xf1 }")
+ c.Assert(goArray2C([]byte{0}), Equals, "{ 0x0 }")
+ c.Assert(goArray2C([]byte{}), Equals, "{ }")
+} | Added Test to goArray2C | cilium_cilium | train | go |
583ead6aaff4abf5d6822646911704ba5078e679 | diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js
index <HASH>..<HASH> 100644
--- a/src/tabs/tabs.js
+++ b/src/tabs/tabs.js
@@ -1,4 +1,5 @@
import { customAttribute, bindable, bindingMode, inject } from 'aurelia-framework';
+import { fireMaterializeEvent } from '../common/events'
@customAttribute('md-tabs')
@inject(Element)
@@ -8,8 +9,19 @@ export class MdTabs {
}
attached() {
$(this.element).tabs();
+ // $('li a', this.element).on('click', this.fireTabSelectedEvent);
+ this.element.querySelectorAll('li a').forEach(a => {
+ a.addEventListener('click', this.fireTabSelectedEvent);
+ });
}
detached() {
// no destroy handler in tabs
+ this.element.querySelectorAll('li a').forEach(a => {
+ a.removeEventListener('click', this.fireTabSelectedEvent);
+ });
+ }
+ fireTabSelectedEvent() {
+ let href = $('li a').attr('href');
+ fireMaterializeEvent(this.element, 'tabSelected', href);
}
} | feat(tabs): tried to implement tabSelected event | aurelia-ui-toolkits_aurelia-materialize-bridge | train | js |
b4a439db535483b1dcf7819d79fa0058bfeab2a1 | diff --git a/src/main/java/org/redisson/connection/ClusterPartition.java b/src/main/java/org/redisson/connection/ClusterPartition.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/redisson/connection/ClusterPartition.java
+++ b/src/main/java/org/redisson/connection/ClusterPartition.java
@@ -1,3 +1,18 @@
+/**
+ * Copyright 2014 Nikita Koksharov, Nickolay Borbit
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.redisson.connection;
import java.util.ArrayList; | header for mvn compilation added | redisson_redisson | train | java |
e8f8cbb58032409b0db87fb8a96cc3cc6b293820 | diff --git a/contract_variable_quantity/tests/test_contract_variable_quantity.py b/contract_variable_quantity/tests/test_contract_variable_quantity.py
index <HASH>..<HASH> 100644
--- a/contract_variable_quantity/tests/test_contract_variable_quantity.py
+++ b/contract_variable_quantity/tests/test_contract_variable_quantity.py
@@ -54,7 +54,7 @@ class TestContractVariableQuantity(common.SavepointCase):
self.formula.code = "user.id"
def test_check_variable_quantity(self):
- self.contract._create_invoice(self.contract)
+ self.contract._create_invoice()
invoice = self.env['account.invoice'].search(
[('contract_id', '=', self.contract.id)])
self.assertEqual(invoice.invoice_line_ids[0].quantity, 12) | [IMP] contract: Add past receipt type. Fix yearly. Add month last day | OCA_contract | train | py |
4e5f395c65726bd68b11e46e49aebba7741b6056 | diff --git a/micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java b/micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java
index <HASH>..<HASH> 100644
--- a/micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java
+++ b/micrometer-core/src/main/java/io/micrometer/core/aop/TimedAspect.java
@@ -21,6 +21,7 @@ import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.Timer;
+import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.lang.NonNullApi;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@@ -54,6 +55,10 @@ public class TimedAspect {
private final MeterRegistry registry;
private final Function<ProceedingJoinPoint, Iterable<Tag>> tagsBasedOnJoinPoint;
+ public TimedAspect() {
+ this(Metrics.globalRegistry);
+ }
+
public TimedAspect(MeterRegistry registry) {
this(registry, pjp ->
Tags.of("class", pjp.getStaticPart().getSignature().getDeclaringTypeName(), | Add an empty constructor to TimedAspect (#<I>)
Having an empty constructor available on TimedAspect would make it easier to use load time weaving via aspectj.
This uses the static global registry (Metrics.globalRegistry) to achieve this. | micrometer-metrics_micrometer | train | java |
58b09a52b641925391680fe37af6fca033e11937 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -44,8 +44,7 @@ Spinner.prototype.start = function() {
var hasPos = self.text.indexOf('%s') > -1;
this.id = setInterval(function() {
var msg = hasPos ? self.text.replace('%s', self.chars[current]) : self.chars[current] + ' ' + self.text;
- process.stdout.clearLine();
- process.stdout.cursorTo(0);
+ clearLine();
process.stdout.write(msg);
current = ++current % self.chars.length;
}, this.delay);
@@ -59,8 +58,11 @@ Spinner.prototype.setSpinnerString = function(str) {
this.chars = mapToSpinner(str, this.spinners).split('');
};
-Spinner.prototype.stop = function() {
+Spinner.prototype.stop = function(clear) {
clearInterval(this.id);
+ if (clear) {
+ clearLine();
+ }
};
// Helpers
@@ -83,4 +85,9 @@ function mapToSpinner(value, spinners) {
return Spinner.spinners[value];
}
+function clearLine() {
+ process.stdout.clearLine();
+ process.stdout.cursorTo(0);
+}
+
exports.Spinner = Spinner;
\ No newline at end of file | Added back option to clean the line on `stop()` | helloIAmPau_node-spinner | train | js |
1a216edae6aedba32d720e09ddfe7775dbec0ace | diff --git a/rake-tasks/ruby.rb b/rake-tasks/ruby.rb
index <HASH>..<HASH> 100644
--- a/rake-tasks/ruby.rb
+++ b/rake-tasks/ruby.rb
@@ -71,8 +71,11 @@ begin
s.add_dependency "json_pure"
s.add_dependency "ffi"
- s.add_development_dependency "rspec"
- s.add_development_dependency "rack"
+
+ if s.respond_to? :add_development_dependency
+ s.add_development_dependency "rspec"
+ s.add_development_dependency "rack"
+ end
s.require_paths = [] | JariBakken: Make sure the rakefile works with older rubygems versions.
r<I> | SeleniumHQ_selenium | train | rb |
b891704b4eb3bb0c5547a82d107ff988c3687494 | diff --git a/spyderlib/widgets/externalshell/monitor.py b/spyderlib/widgets/externalshell/monitor.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/externalshell/monitor.py
+++ b/spyderlib/widgets/externalshell/monitor.py
@@ -7,9 +7,10 @@
# remote views for all consoles...!
import os
-import threading
import socket
import struct
+import thread
+import threading
# Local imports
from spyderlib.utils.misc import fix_reference_name
@@ -160,6 +161,7 @@ class Monitor(threading.Thread):
"getenv": self.getenv,
"setenv": self.setenv,
"isdefined": self.isdefined,
+ "thread": thread,
"toggle_inputhook_flag": self.toggle_inputhook_flag,
"set_monitor_timeout": self.set_timeout,
"set_monitor_auto_refresh": self.set_auto_refresh, | All Consoles: Fix keyboard interruption (which was broken since revision <I>fd<I>a)
Update Issue <I>
Status: Started | spyder-ide_spyder | train | py |
bb67aa8dcb8efdc35aafb33f251879a8e727a47a | diff --git a/lib/http_content_type/checker.rb b/lib/http_content_type/checker.rb
index <HASH>..<HASH> 100644
--- a/lib/http_content_type/checker.rb
+++ b/lib/http_content_type/checker.rb
@@ -14,6 +14,10 @@ module HttpContentType
@options = DEFAULT_OPTIONS.merge(opts)
end
+ def error?
+ !_head[:error].nil?
+ end
+
def found?
_head[:found]
end
diff --git a/spec/lib/http_content_type/checker_spec.rb b/spec/lib/http_content_type/checker_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/http_content_type/checker_spec.rb
+++ b/spec/lib/http_content_type/checker_spec.rb
@@ -28,6 +28,23 @@ describe HttpContentType::Checker do
end
end
+ describe '#error?' do
+ context 'asset do not return an error' do
+ before { checker.stub(:_head).and_return({ found: false, error: nil }) }
+
+ it 'return false' do
+ checker.should_not be_error
+ end
+ end
+
+ context 'asset returns an error' do
+ before { checker.stub(:_head).and_return({ found: false, error: true }) }
+
+ it 'return true' do
+ checker.should be_error
+ end
+ end
+ end
describe '#found?' do
context 'asset is not found' do | New `#error?` method to check if the request on the asset failed for any reason | jilion_http_content_type | train | rb,rb |
d6eadce169c5e9eb1cae7fa0efe793ed01bfebcf | diff --git a/www/src/py_complex.js b/www/src/py_complex.js
index <HASH>..<HASH> 100644
--- a/www/src/py_complex.js
+++ b/www/src/py_complex.js
@@ -149,7 +149,6 @@ $ComplexDict.__ior__=$ComplexDict.__or__
// operations
var $op_func = function(self,other){
- console.log('complex -',self,other)
if(isinstance(other,complex)) return complex(self.real-other.real,self.imag-other.imag)
if (isinstance(other,_b_.int)) return complex($B.sub(self.real,other.valueOf()),self.imag)
if(isinstance(other,_b_.float)) return complex(self.real - other.value, self.imag) | Remove trace in py_complex.js | brython-dev_brython | train | js |
f25cffd24e3413b1b7ca0c24262eafd5f41d4645 | diff --git a/pkg/stores/sqlstore/accounts.go b/pkg/stores/sqlstore/accounts.go
index <HASH>..<HASH> 100644
--- a/pkg/stores/sqlstore/accounts.go
+++ b/pkg/stores/sqlstore/accounts.go
@@ -114,7 +114,10 @@ func GetAccountByToken(query *m.GetAccountByTokenQuery) error {
var err error
var account m.Account
- has, err := x.Where("token=?", query.Token).Get(&account)
+ sess := x.Join("INNER", "token", "token.account_id = account.id")
+ sess.Omit("token.id", "token.account_id", "token.name", "token.token",
+ "token.role", "token.updated", "token.created")
+ has, err := sess.Where("token.token=?", query.Token).Get(&account)
if err != nil {
return err | fix getAccountByToken query. | grafana_grafana | train | go |
96a5c2f46a0747384d567c799b2d69c01539dc8d | diff --git a/lib/fog/core/collection.rb b/lib/fog/core/collection.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/core/collection.rb
+++ b/lib/fog/core/collection.rb
@@ -94,7 +94,9 @@ module Fog
end
def new(attributes = {})
- raise ArgumentError, "Initialization parameters must be an attributes hash, got #{attributes.inspect}" unless attributes.respond_to? :merge
+ unless attributes.is_a?(Hash)
+ raise(ArgumentError.new("Initialization parameters must be an attributes hash, got #{attributes.inspect}"))
+ end
model.new(
attributes.merge(
:collection => self, | [core] making collection.new error more idiomatic | fog_fog | train | rb |
f3c0e9047fc87eabc4b770b138e1674034563f45 | diff --git a/lib/zyps.rb b/lib/zyps.rb
index <HASH>..<HASH> 100644
--- a/lib/zyps.rb
+++ b/lib/zyps.rb
@@ -21,7 +21,7 @@ require 'observer'
# Ruby 1.9 compatibility - bind Enumerable::Enumerator to stdlib Enumerator
module Enumerable
- Enumerator = Enumerator
+ Enumerator = Enumerator unless defined? Enumerable::Enumerator
end
module Zyps | Fix warning about changing constant under <I> | jaymcgavren_zyps | train | rb |
18ccf45840cf259db18ddbd3c35342a6edd37d87 | diff --git a/lib/twitter/client/local_trends.rb b/lib/twitter/client/local_trends.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter/client/local_trends.rb
+++ b/lib/twitter/client/local_trends.rb
@@ -24,7 +24,7 @@ module Twitter
# @formats :json, :xml
# @authenticated false
# @rate_limited true
- # @param woeid [Integer] The {http://developer.yahoo.com/geo/geoplanet Yahoo! Where On Earth ID} of the location to return trending information for. Global information is available by using 1 as the WOEID.
+ # @param woeid [Integer] The {http://developer.yahoo.com/geo/geoplanet Yahoo! Where On Earth ID} of the location to return trending information for. WOEIDs can be retrieved by calling {Twitter::Client::LocalTrends#trend_locations}. Global information is available by using 1 as the WOEID.
# @param options [Hash] A customizable set of options.
# @return [Array]
# @see http://dev.twitter.com/doc/get/trends/:woeid | Clarify how to get WOEIDs | sferik_twitter | train | rb |
3e0952e33dd80b4007839549a44ae82aa2d57f1d | diff --git a/src/TestCase.php b/src/TestCase.php
index <HASH>..<HASH> 100644
--- a/src/TestCase.php
+++ b/src/TestCase.php
@@ -14,6 +14,8 @@ abstract class TestCase extends LumenTestCase
Concerns\InteractsWithAuthentication,
Concerns\MocksApplicationServices;
+ static protected $appPath;
+
/**
* Setup the test environment.
*
@@ -22,7 +24,6 @@ abstract class TestCase extends LumenTestCase
public function setUp()
{
parent::setUp();
- $this->refreshApplication();
$this->appendTraits();
}
@@ -43,7 +44,7 @@ abstract class TestCase extends LumenTestCase
*/
public function createApplication()
{
- return require base_path('bootstrap/app.php');
+ return require $this->getAppPath();
}
/**
@@ -60,5 +61,17 @@ abstract class TestCase extends LumenTestCase
}
}
+ /**
+ * Get the path of lumen application.
+ *
+ * @return string
+ */
+ protected function getAppPath()
+ {
+ if (is_null(static::$appPath)) {
+ return static::$appPath = base_path('bootstrap/app.php');
+ }
+ return static::$appPath;
+ }
} | fix extra flush method in lumen <I> | albertcht_lumen-testing | train | php |
401cc9235f76537ff17c4274866c6cb9edaf0c12 | diff --git a/test/unit/Repo/Entity/Quantity/Def/Sale_Test.php b/test/unit/Repo/Entity/Quantity/Def/Sale_Test.php
index <HASH>..<HASH> 100644
--- a/test/unit/Repo/Entity/Quantity/Def/Sale_Test.php
+++ b/test/unit/Repo/Entity/Quantity/Def/Sale_Test.php
@@ -6,7 +6,7 @@ namespace Praxigento\Warehouse\Repo\Entity\Quantity\Def;
include_once(__DIR__ . '/../../../../phpunit_bootstrap.php');
-class Item_UnitTest extends \Praxigento\Core\Test\BaseCase\Repo\Entity
+class Sale_UnitTest extends \Praxigento\Core\Test\BaseCase\Repo\Entity
{
/** @var \Mockery\MockInterface */
private $mManObj;
@@ -44,9 +44,6 @@ class Item_UnitTest extends \Praxigento\Core\Test\BaseCase\Repo\Entity
/** === Test Data === */
$ID = 32;
/** === Mock object itself === */
- $this->mResource
- ->shouldReceive('getConnection')->once()
- ->andReturn($this->mConn);
$this->obj = \Mockery::mock(Sale::class . '[get]', $this->objArgs);
/** === Setup Mocks === */
// $rows = $this->get($where); | MOBI-<I> - Refresh bonus base structure | praxigento_mobi_mod_warehouse | train | php |
1e68137f2869175825867ce6eef8a0527882b991 | diff --git a/src/Pingpong/Modules/Publishing/AssetPublisher.php b/src/Pingpong/Modules/Publishing/AssetPublisher.php
index <HASH>..<HASH> 100644
--- a/src/Pingpong/Modules/Publishing/AssetPublisher.php
+++ b/src/Pingpong/Modules/Publishing/AssetPublisher.php
@@ -19,7 +19,9 @@ class AssetPublisher extends Publisher {
*/
public function getSourcePath()
{
- return $this->getModule()->getExtraPath('Assets');
+ return $this->getModule()->getExtraPath(
+ $this->repository->config('paths.generator.assets')
+ );
}
}
\ No newline at end of file | Fix #<I>: Publishing Assets From A Custom Directory | pingpong-labs_sky | train | php |
dd02c96755ba3c803ba4598bd9be1825e5c6b57a | diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupRunnable.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupRunnable.java
index <HASH>..<HASH> 100644
--- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupRunnable.java
+++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupRunnable.java
@@ -112,12 +112,12 @@ public class RollupRunnable implements Runnable {
AstyanaxReader.getUnitString(singleRollupReadContext.getLocator()),
singleRollupReadContext.getRollupGranularity().name(),
singleRollupReadContext.getRange().getStart()));
- } catch (Throwable th) {
+ } catch (Exception e) {
log.error("Rollup failed; Locator: {}, Source Granularity: {}, For period: {}", new Object[] {
singleRollupReadContext.getLocator(),
singleRollupReadContext.getRange().toString(),
srcGran.name(),
- th});
+ e});
} finally {
executionContext.decrementReadCounter();
timerContext.stop(); | Catch on Exception instead of Throwable
`Throwable` has 2 subclasses: `Exception` and `Error`. According to the
java docs, quote:
An Error is a subclass of Throwable that indicates serious problems
that a reasonable application should not try to catch.
<URL> | rackerlabs_blueflood | train | java |
32ec32ed2697512af27c3100175b4df54c141df1 | diff --git a/examples/simple-activity-worker.js b/examples/simple-activity-worker.js
index <HASH>..<HASH> 100644
--- a/examples/simple-activity-worker.js
+++ b/examples/simple-activity-worker.js
@@ -13,7 +13,7 @@ var activityPoller = new swf.ActivityPoller({
activityPoller.on('activityTask', function(task) {
console.log("Received new activity task !");
- var output = task.input;
+ var output = task.config.input;
task.respondCompleted(output, function (err) { | task input is available from task.config.input | neyric_aws-swf | train | js |
dd1d9cd514531d1f63615c878710fccfbda7c262 | diff --git a/flattened_serializers.go b/flattened_serializers.go
index <HASH>..<HASH> 100644
--- a/flattened_serializers.go
+++ b/flattened_serializers.go
@@ -156,6 +156,20 @@ func (sers *flattened_serializers) recurse_table(cur *dota.ProtoFlattenedSeriali
// normal
case "m_vecLadderNormal":
prop.Field.Encoder = "normal"
+
+ // fixed
+ case "m_bItemWhiteList":
+ fallthrough
+ case "m_iPlayerIDsInControl":
+ fallthrough
+ case "m_ulTeamBaseLogo":
+ fallthrough
+ case "m_ulTeamBannerLogo":
+ fallthrough
+ case "m_CustomHealthbarColor":
+ fallthrough
+ case "m_bWorldTreeState":
+ prop.Field.Encoder = "fixed64"
}
} | Add fixed<I> for a number of types | dotabuff_manta | train | go |
c72e59437cfb21b34ad34ca850ee35b63bafcbc5 | diff --git a/src/main/java-core/net/sf/xmlunit/util/Convert.java b/src/main/java-core/net/sf/xmlunit/util/Convert.java
index <HASH>..<HASH> 100644
--- a/src/main/java-core/net/sf/xmlunit/util/Convert.java
+++ b/src/main/java-core/net/sf/xmlunit/util/Convert.java
@@ -17,9 +17,9 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
import java.util.Map;
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
@@ -97,7 +97,7 @@ public final class Convert {
if (uri == null) {
throw new IllegalArgumentException("uri must not be null");
}
- Collection<String> c = new HashSet<String>();
+ Collection<String> c = new LinkedHashSet<String>();
boolean done = false;
if (XMLConstants.XML_NS_URI.equals(uri)) {
c.add(XMLConstants.XML_NS_PREFIX); | preserve order of initial Map in getPrefixes if there was one in the first place
git-svn-id: <URL> | xmlunit_xmlunit | train | java |
bdf635f57b61b2d27b249a3b07d4e462a157128b | diff --git a/src/main/java/fr/wseduc/webutils/data/ZLib.java b/src/main/java/fr/wseduc/webutils/data/ZLib.java
index <HASH>..<HASH> 100644
--- a/src/main/java/fr/wseduc/webutils/data/ZLib.java
+++ b/src/main/java/fr/wseduc/webutils/data/ZLib.java
@@ -56,9 +56,14 @@ public class ZLib {
byte[] buffer = new byte[1024];
while (!inflater.finished()) {
int count = inflater.inflate(buffer);
- outputStream.write(buffer, 0, count);
+ if (count > 0) {
+ outputStream.write(buffer, 0, count);
+ } else {
+ break;
+ }
}
outputStream.close();
+ inflater.end();
return outputStream.toByteArray();
} | defensive programming in Zlib Inflater | opendigitaleducation_web-utils | train | java |
29cefcd15e75760196eca9dd4bee09838f27a245 | diff --git a/sunspot_rails/lib/sunspot/rails/searchable.rb b/sunspot_rails/lib/sunspot/rails/searchable.rb
index <HASH>..<HASH> 100644
--- a/sunspot_rails/lib/sunspot/rails/searchable.rb
+++ b/sunspot_rails/lib/sunspot/rails/searchable.rb
@@ -246,7 +246,7 @@ module Sunspot #:nodoc:
find_in_batch_options = {
:include => options[:include],
:batch_size => options[:batch_size],
- :start => options[:first_id]
+ :start => options[:start]
}
progress_bar = options[:progress_bar]
if options[:batch_size] | Propagate :first_id option to find_in_batches, before was always nil | sunspot_sunspot | train | rb |
4c7e52ac905e71156c44924cd32cb7459ca0761a | diff --git a/src/DivideIQ.php b/src/DivideIQ.php
index <HASH>..<HASH> 100644
--- a/src/DivideIQ.php
+++ b/src/DivideIQ.php
@@ -289,11 +289,14 @@ class DivideIQ implements \JsonSerializable
// Check if the error is indeed a "TokenExpired" error,
// as expected.
- if ($body->answer != 'TokenExpired') {
+ if ($body->answer == 'TokenExpired') {
// Token is expired; refreshing unsuccessful.
$success = false;
} else {
- // Unexpected error. Pass it up the stack.
+ // Unexpected error. Pass it up the stack. This
+ // might be a "TokenEmpty" error, but that would
+ // still be unexpected, because the token value was
+ // checked beforehand.
throw $e;
}
} else { | Fixes #5: error handling of TokenExpired and TokenEmpty during refreshing | DivideBV_PHPDivideIQ | train | php |
ee2674834bc9d0008e6c2b686f45c9b62e41e3c2 | diff --git a/lib/file_list.js b/lib/file_list.js
index <HASH>..<HASH> 100644
--- a/lib/file_list.js
+++ b/lib/file_list.js
@@ -53,6 +53,7 @@ Url.prototype.toString = File.prototype.toString = function () {
var GLOB_OPTS = {
// globDebug: true,
+ follow: true,
cwd: '/'
} | fix(file_list): follow symlinks
Changing to the latest version of the glob module means that
karma no longer follows symlinks to find files to serve.
Setting foillow:true in the glob options enables this
behaviour again. | karma-runner_karma | train | js |
aae0cd58582f0fb886407d2fe0475940e7cfc987 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -28,7 +28,6 @@ class MuiDownshift extends Component {
loading,
menuHeight,
menuItemCount,
- onStateChange, // called in `handleStateChange` above
...props
} = this.props; | Pass "onStateChange" down to Downshift now that it is only overridden within mui-downshift | techniq_mui-downshift | train | js |
bc6336317ca6ae47e09e262800e588a3094d8974 | diff --git a/src/lib/keys.js b/src/lib/keys.js
index <HASH>..<HASH> 100644
--- a/src/lib/keys.js
+++ b/src/lib/keys.js
@@ -1,5 +1,3 @@
-import 'core-js/es/symbol';
-
// TODO: Need better, more complete, and more methodical key definitions
const Keys = { | Remove core-js import
`Symbol` is now part of ECMAScript and core-js is not included by default in babel 7 builds.
By removing the explicit import, developers can use their own transpile process - if `Symbol` does not exist in their version of javascript, they'll get an error about that. | glortho_react-keydown | train | js |
55b8b675e4813c55542ea6875bf21c599cd8a4d7 | diff --git a/docs/src/modules/components/MarkdownLinks.js b/docs/src/modules/components/MarkdownLinks.js
index <HASH>..<HASH> 100644
--- a/docs/src/modules/components/MarkdownLinks.js
+++ b/docs/src/modules/components/MarkdownLinks.js
@@ -28,11 +28,18 @@ export async function handleEvent(event, as) {
document.body.focus();
}
+/**
+ * @param {MouseEvent} event
+ */
function handleClick(event) {
- const activeElement = document.activeElement;
+ let activeElement = event.target;
+ while (activeElement?.nodeType === Node.ELEMENT_NODE && activeElement.nodeName !== 'A') {
+ activeElement = activeElement.parentElement;
+ }
// Ignore non link clicks
if (
+ activeElement === null ||
activeElement.nodeName !== 'A' ||
activeElement.getAttribute('target') === '_blank' ||
activeElement.getAttribute('data-no-link') === 'true' ||
@@ -41,7 +48,7 @@ function handleClick(event) {
return;
}
- handleEvent(event, document.activeElement.getAttribute('href'));
+ handleEvent(event, activeElement.getAttribute('href'));
}
let bound = false; | [docs] Fix links being opened when dismissing context menus (#<I>) | mui-org_material-ui | train | js |
0c72a2cddd73423cabd79ffe0fb1b73b6a331cab | diff --git a/angular-drag-and-drop-lists.js b/angular-drag-and-drop-lists.js
index <HASH>..<HASH> 100644
--- a/angular-drag-and-drop-lists.js
+++ b/angular-drag-and-drop-lists.js
@@ -221,6 +221,18 @@ angular.module('dndLists', [])
var externalSources = attr.dndExternalSources && scope.$eval(attr.dndExternalSources);
/**
+ * The dragenter is triggered prior to the dragover and to allow
+ * a drop the event handler must preventDefault().
+ */
+ element.on('dragenter', function (event) {
+ event = event.originalEvent || event;
+
+ if (!isDropAllowed(event)) return true;
+
+ event.preventDefault();
+ });
+
+ /**
* The dragover event is triggered "every few hundred milliseconds" while an element
* is being dragged over our list, or over an child element.
*/ | just the changes needed to make mobile dnd polyfill work for easy merging on PR | marceljuenemann_angular-drag-and-drop-lists | train | js |
957a4f1093505a66635d64ec824ddac7dbac45e5 | diff --git a/src/IpTools.php b/src/IpTools.php
index <HASH>..<HASH> 100644
--- a/src/IpTools.php
+++ b/src/IpTools.php
@@ -65,17 +65,15 @@ class IpTools
*/
public function validIpv4($ip, $strict = true)
{
+ $flags = FILTER_FLAG_IPV4;
if ($strict) {
$flags = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE;
- } else {
- $flags = FILTER_FLAG_IPV4;
}
if (filter_var($ip, FILTER_VALIDATE_IP, array('flags' => $flags)) !== false) {
return true;
- } else {
- return false;
}
+ return false;
}
/**
@@ -88,17 +86,16 @@ class IpTools
*/
public function validIpv6($ip, $strict = true)
{
+ $flags = FILTER_FLAG_IPV6;
if ($strict) {
$flags = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE;
- } else {
- $flags = FILTER_FLAG_IPV6;
}
if (filter_var($ip, FILTER_VALIDATE_IP, array('flags' => $flags)) !== false) {
return true;
- } else {
- return false;
}
+
+ return false;
}
/** | Trying to get rid of some conditions to reach better test results | phpWhois_phpWhois | train | php |
1a55c0599cedbde560441934b9af106f032cb86c | diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php
index <HASH>..<HASH> 100644
--- a/code/forms/GridFieldSortableRows.php
+++ b/code/forms/GridFieldSortableRows.php
@@ -163,7 +163,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
if (!$many_many) {
$sng=singleton($gridField->getModelClass());
$fieldType=$sng->db($this->sortColumn);
- if(!$fieldType || !($fieldType=='Int' || is_subclass_of('Int', $fieldType))) {
+ if(!$fieldType || !(strtolower($fieldType) == 'int' || is_subclass_of('Int', $fieldType))) {
if(is_array($fieldType)) {
user_error('Sort column '.$this->sortColumn.' could not be found in '.$gridField->getModelClass().'\'s ancestry', E_USER_ERROR);
}else {
@@ -571,4 +571,4 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
}
}
}
-?>
+?>
\ No newline at end of file | Fixing bug "must be an Int, column is of type int" | UndefinedOffset_SortableGridField | train | php |
a2c0172858d465dbbe920c656252c02417d6bed1 | diff --git a/javaobj/core.py b/javaobj/core.py
index <HASH>..<HASH> 100644
--- a/javaobj/core.py
+++ b/javaobj/core.py
@@ -906,6 +906,9 @@ class JavaObjectUnmarshaller(JavaObjectConstants):
and classdesc.flags & self.SC_WRITE_METHOD
or classdesc.flags & self.SC_EXTERNALIZABLE
and classdesc.flags & self.SC_BLOCK_DATA
+ or classdesc.superclass is not None
+ and classdesc.superclass.flags & self.SC_SERIALIZABLE
+ and classdesc.superclass.flags & self.SC_WRITE_METHOD
):
# objectAnnotation
log_debug( | Read annotations if superclass dictates that | tcalmant_python-javaobj | train | py |
273e9ab9956558373e54926a993b83da41f5f2dc | diff --git a/tests/test_connection.py b/tests/test_connection.py
index <HASH>..<HASH> 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -62,13 +62,15 @@ async def test_getinfo(conn):
assert data in (pg, sqlite, mysql)
-@pytest.mark.parametrize('db', ['sqlite'])
+@pytest.mark.parametrize('db', ['mysql'])
@pytest.mark.run_loop
async def test_output_conversion(conn, table):
def convert(value):
- # `value` will be a string. We'll simply add an X at the
+ # value will be a string. We'll simply add an X at the
# beginning at the end.
- return 'X' + value + 'X'
+ if isinstance(value, str):
+ return 'X' + value + 'X'
+ return b'X' + value + b'X'
await conn.add_output_converter(pyodbc.SQL_VARCHAR, convert)
cur = await conn.cursor()
@@ -77,7 +79,7 @@ async def test_output_conversion(conn, table):
await cur.execute("SELECT v FROM t1 WHERE n=3;")
(value,) = await cur.fetchone()
- assert value == 'X123.45X'
+ assert value in (b'X123.45X', 'X123.45X')
# Now clear the conversions and try again. There should be
# no Xs this time. | update test to work with new pyodbc | aio-libs_aioodbc | train | py |
5f79f941fdfc93fcebcfefe9db762ea16b9a4074 | diff --git a/tests/Html/HtmlStringTest.php b/tests/Html/HtmlStringTest.php
index <HASH>..<HASH> 100644
--- a/tests/Html/HtmlStringTest.php
+++ b/tests/Html/HtmlStringTest.php
@@ -20,15 +20,18 @@ class HtmlStringTest extends TestCase
* @var HtmlString
*/
private $instance;
-
-
+
+ /**
+ * @var string
+ */
private $message;
public function setUp()
{
parent::setUp();
$this->message = "A message send on chat";
- $driver = $this->createMock(Embera::class);
+ $driver = $this->getMockBuilder(Embera::class)
+ ->getMock();
$driver->method('autoEmbed')
->willReturn($this->message);
$this->instance = new HtmlString($this->message, $driver);
@@ -49,12 +52,12 @@ class HtmlStringTest extends TestCase
{
$this->assertInstanceOf(Htmlable::class, $this->instance);
}
-
+
public function testHasEmberaDriver()
{
$this->assertInstanceOf(Embera::class, $this->instance->getDriver());
}
-
+
public function testToHtmlIsString()
{
$this->assertEquals($this->message, $this->instance->toHtml()); | Used getMockBuilder for compatibility with older versions of PHPUnit | nahid_talk | train | php |
2fb9adb512b1fc1dc08e7100366b1fedd7bf8253 | diff --git a/src/ossos/core/ossos/astrom.py b/src/ossos/core/ossos/astrom.py
index <HASH>..<HASH> 100644
--- a/src/ossos/core/ossos/astrom.py
+++ b/src/ossos/core/ossos/astrom.py
@@ -219,14 +219,14 @@ class AstromParser(object):
The file contents extracted into a data structure for programmatic
access.
"""
- filehandle = storage.open_vos_or_local(filename, "r")
+ filehandle = storage.open_vos_or_local(filename, "rb")
assert filehandle is not None, "Failed to open file {} ".format(filename)
- filestr = filehandle.read()
+ filestr = filehandle.read().decode('utf-8')
filehandle.close()
assert filestr is not None, "File contents are None"
- observations = self._parse_observation_list(filestr)
+ observations = self._parse_observation_list(str(filestr))
self._parse_observation_headers(filestr, observations)
@@ -1098,6 +1098,9 @@ class Observation(object):
try:
self._header = storage.get_mopheader(self.expnum, self.ccdnum, self.ftype, self.fk)
except Exception as ex:
+ etype, value, tb = mih.exception
+ import traceback
+ traceback.print_tb(tb, file=sys.stdout)
logger.error(str(ex))
self._header = self.astheader
return self._header | Open files in binary mode and decode into ascii, for consistancy with VOSpace behaviour | OSSOS_MOP | train | py |
d9de12d8ed788bca01a853c6a155e45a2e756c16 | diff --git a/nl/validation.php b/nl/validation.php
index <HASH>..<HASH> 100644
--- a/nl/validation.php
+++ b/nl/validation.php
@@ -60,7 +60,7 @@ return [
'regex' => ':attribute formaat is ongeldig.',
'required' => ':attribute is verplicht.',
'required_if' => ':attribute is verplicht indien :other gelijk is aan :value.',
- 'required_unless' => ':attribute is verplicht tenzij :other voorkomt in :values.',
+ 'required_unless' => ':attribute is verplicht tenzij :other gelijk is aan :values.',
'required_with' => ':attribute is verplicht i.c.m. :values',
'required_with_all' => ':attribute is verplicht i.c.m. :values',
'required_without' => ':attribute is verplicht als :values niet ingevuld is.', | Changed confusing Dutch phrasing for required_unless
The Dutch phrase is confusing, it will say:
``admin password is verplicht tenzij rol voorkomt in admin, moderator``
(``admin password is required unless role occurs in admin, moderator``)
Whereas this makes more sense:
``admin password is verplicht tenzij rol gelijk is aan admin, moderator``
(``admin password is required unless role is equal to admin, moderator``) | caouecs_Laravel-lang | train | php |
5ae7e4f3010c5e6bcd8565c75a17737e87e545ac | diff --git a/source/rafcon/mvc/controllers/state_overview.py b/source/rafcon/mvc/controllers/state_overview.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/mvc/controllers/state_overview.py
+++ b/source/rafcon/mvc/controllers/state_overview.py
@@ -176,10 +176,13 @@ class StateOverviewController(ExtendedController, Model):
logger.debug("Change type of State '{0}' from {1} to {2}".format(state_name,
type(self.model.state),
target_class))
- if self.model.state.is_root_state:
- self.model.state.parent.change_root_state_type(target_class)
- else:
- self.model.state.parent.change_state_type(self.model.state, target_class)
+ try:
+ if self.model.state.is_root_state:
+ self.model.state.parent.change_root_state_type(target_class)
+ else:
+ self.model.state.parent.change_state_type(self.model.state, target_class)
+ except Exception as e:
+ logger.error("An error occurred while changing the state type: {0}".format(e))
else:
logger.debug("DON'T Change type of State '{0}' from {1} to {2}".format(self.model.state.name, | Catch exception when changing state type in state overview | DLR-RM_RAFCON | train | py |
ff2f93a773e9d2991acfe07c0a171ad5037e13be | diff --git a/backtrader/writer.py b/backtrader/writer.py
index <HASH>..<HASH> 100644
--- a/backtrader/writer.py
+++ b/backtrader/writer.py
@@ -171,7 +171,7 @@ class WriterFile(WriterBase):
if recurse:
kline += '- '
- kline += key + ':'
+ kline += str(key) + ':'
try:
sclass = issubclass(val, LineSeries) | Addresses #<I> - writer fails with analyzers that have keys which are not strings | backtrader_backtrader | train | py |
4ca535ef5a20e4d8d4cb7f4a8de9b0cbf1321d1f | diff --git a/plenum/common/util.py b/plenum/common/util.py
index <HASH>..<HASH> 100644
--- a/plenum/common/util.py
+++ b/plenum/common/util.py
@@ -21,6 +21,7 @@ from typing import TypeVar, Iterable, Mapping, Set, Sequence, Any, Dict, \
import base58
import libnacl.secret
+from libnacl import randombytes_uniform
import psutil
from jsonpickle import encode, decode
from six import iteritems, string_types
@@ -54,7 +55,10 @@ def randomString(size: int = 20,
chars = list(chars)
def randomChar():
- return random.choice(chars)
+ # DONOT use random.choice its as PRNG not secure enough for our needs
+ # return random.choice(chars)
+ rn = randombytes_uniform(len(chars))
+ return chars[rn]
return ''.join(randomChar() for _ in range(size)) | Use secure random number generator for randomString()
Current usage of random.choice() is not secure so replaced that with
libsodium provided randombytes_uniform() which is secure and also
available on all platforms where libsodium is available | hyperledger_indy-plenum | train | py |
da921671f6c44a1041bdaf6891263569c6f6f1ce | diff --git a/src/main/java/com/github/davidcarboni/restolino/api/Api.java b/src/main/java/com/github/davidcarboni/restolino/api/Api.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/davidcarboni/restolino/api/Api.java
+++ b/src/main/java/com/github/davidcarboni/restolino/api/Api.java
@@ -2,6 +2,7 @@ package com.github.davidcarboni.restolino.api;
import java.io.IOException;
import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
@@ -413,7 +414,9 @@ public class Api {
// Chances are the exception we've actually caught is the reflection
// one from Method.invoke(...)
- Throwable caught = t.getCause();
+ Throwable caught = t;
+ if (InvocationTargetException.class.isAssignableFrom(t.getClass()))
+ caught = t.getCause();
handleError(request, response, requestHandler, caught);
} | Experimenting with more subtle error handling. | davidcarboni_restolino | train | java |
3bb1509f41535e424b2a8f1a6d869e1ff7d366bb | diff --git a/tests/modules/qemu/test_qemu_vm.py b/tests/modules/qemu/test_qemu_vm.py
index <HASH>..<HASH> 100644
--- a/tests/modules/qemu/test_qemu_vm.py
+++ b/tests/modules/qemu/test_qemu_vm.py
@@ -382,10 +382,3 @@ def test_options(vm):
vm.options = "-usb"
assert vm.options == "-usb"
assert vm.kvm is False
-
-
-def test_options_kvm(vm):
- vm.kvm = False
- vm.options = "-usb -enable-kvm"
- assert vm.options == "-usb"
- assert vm.kvm is True | Fix the tests after the removal of the KVM flag from VM | GNS3_gns3-server | train | py |
db1474a05baf6ee21d729c25c13134259867c768 | diff --git a/lib/entity-base.js b/lib/entity-base.js
index <HASH>..<HASH> 100644
--- a/lib/entity-base.js
+++ b/lib/entity-base.js
@@ -60,14 +60,14 @@ Entity.prototype._normalizeError = function(err) {
var error = new appError.Validation(err);
switch(err.code) {
case 11000:
- var items = err.err.match(/key error index:\s(.+)\.(\w+)\.\$([\w\_]+)\s/);
+ var items = err.errmsg.match(/key error index:\s(.+)\.(\w+)\.\$([\w\_]+)\s/);
// error.db = items[1];
// error.collection = items[2];
error.index = items[3];
error.message = 'Duplicate record found';
// now cleanup the error object
- delete error.err;
+ delete error.errmsg;
delete error.code;
delete error.n;
delete error.connectionId; | update err path for mongoose 4.x | thanpolas_nodeON-base | train | js |
5dc7de43ffaffc5b34e0418fa8b9ad16ee138ee2 | diff --git a/storage_pool.go b/storage_pool.go
index <HASH>..<HASH> 100644
--- a/storage_pool.go
+++ b/storage_pool.go
@@ -55,6 +55,11 @@ type StoragePoolTarget struct {
type StoragePoolSourceFormat struct {
Type string `xml:"type,attr"`
}
+
+type StoragePoolSourceProtocol struct {
+ Version string `xml:"ver,attr"`
+}
+
type StoragePoolSourceHost struct {
Name string `xml:"name,attr"`
Port string `xml:"port,attr,omitempty"`
@@ -133,6 +138,7 @@ type StoragePoolSource struct {
Vendor *StoragePoolSourceVendor `xml:"vendor"`
Product *StoragePoolSourceProduct `xml:"product"`
Format *StoragePoolSourceFormat `xml:"format"`
+ Protocol *StoragePoolSourceProtocol `xml:"protocol"`
Adapter *StoragePoolSourceAdapter `xml:"adapter"`
Initiator *StoragePoolSourceInitiator `xml:"initiator"`
} | Add support for storage pool source protocol version | libvirt_libvirt-go-xml | train | go |
890332a5e7e7f94a45c402faa0a7adb55ea1343a | diff --git a/lib/wed/wed_init.js b/lib/wed/wed_init.js
index <HASH>..<HASH> 100644
--- a/lib/wed/wed_init.js
+++ b/lib/wed/wed_init.js
@@ -977,6 +977,10 @@ wed's generic help. The link by default will open in a new tab.</p>");
// initialized, which may take a bit.
var me = this;
this._saver.whenCondition("initialized", function () {
+ // We could be destroyed while waiting...
+ if (me._destroyed)
+ return;
+
me._setCondition("initialized", {editor: me});
});
} | Don't emit an event if the editor is destroyed. | mangalam-research_wed | train | js |
15423cab41ce69fc7ce7a32f37367e0a0d74b4e9 | diff --git a/app/src/Bolt/Composer/CommandRunner.php b/app/src/Bolt/Composer/CommandRunner.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Composer/CommandRunner.php
+++ b/app/src/Bolt/Composer/CommandRunner.php
@@ -40,7 +40,9 @@ class CommandRunner
public function installed()
{
$response = $this->execute("show -i");
- $response = implode("<br>", $response);
+ print_r($response); exit;
+ $response = implode("<br><br>", $response);
+ $response = str_replace("\t","<br>", $response);
return $response;
} | # This is a combination of 2 commits.
# The first commit's message is:
formatting
# The 2nd commit message will be skipped:
# formatting | bolt_bolt | train | php |
a9c3d84ae0767feb2e2e2be8993cd2169271e63e | diff --git a/equality_matchers.go b/equality_matchers.go
index <HASH>..<HASH> 100644
--- a/equality_matchers.go
+++ b/equality_matchers.go
@@ -48,6 +48,15 @@ func isUnsignedInteger(v reflect.Value) bool {
return false
}
+func isFloat(v reflect.Value) bool {
+ switch v.Kind() {
+ case reflect.Float32, reflect.Float64:
+ return true
+ }
+
+ return false
+}
+
func checkAgainstInt(e int64, v reflect.Value) (res MatchResult, err string) {
res = MATCH_FALSE
@@ -62,6 +71,11 @@ func checkAgainstInt(e int64, v reflect.Value) (res MatchResult, err string) {
res = MATCH_TRUE
}
+ case isFloat(v):
+ if (float64(e) == v.Float()) {
+ res = MATCH_TRUE
+ }
+
default:
res = MATCH_UNDEFINED
err = "which is not numeric" | Added support for floats. | jacobsa_oglematchers | train | go |
a37462afcfa8bfe0402f4eefbf4c13491cce1693 | diff --git a/lib/cinch/base.rb b/lib/cinch/base.rb
index <HASH>..<HASH> 100644
--- a/lib/cinch/base.rb
+++ b/lib/cinch/base.rb
@@ -76,15 +76,6 @@ module Cinch
# Default listeners
on(:ping) {|m| @irc.pong(m.text) }
- on(433) do |m|
- @options.nick += @options.nick_suffix
- @irc.nick @options.nick
- end
-
- if @options.respond_to?(:channels)
- on("004") { @options.channels.each {|c| @irc.join(c) } }
- end
-
on(:ctcp, :version) {|m| m.ctcp_reply "Cinch IRC Bot Building Framework v#{Cinch::VERSION}"}
end
@@ -236,6 +227,16 @@ module Cinch
# Run run run
def run
+ # Configure some runtime listeners
+ on(433) do |m|
+ @options.nick += @options.nick_suffix
+ @irc.nick @options.nick
+ end
+
+ if @options.respond_to?(:channels)
+ on("004") { @options.channels.each {|c| @irc.join(c) } }
+ end
+
@irc.connect options.server, options.port
@irc.pass options.password if options.password
@irc.nick options.nick | moved runtime listener configuration from #initialize to #run. Fixes bug
pointed out by cardioid | cinchrb_cinch | train | rb |
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.