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
|
---|---|---|---|---|---|
d72aedb34625b0f0be1eedc9045919b911a62476 | diff --git a/closures.js b/closures.js
index <HASH>..<HASH> 100644
--- a/closures.js
+++ b/closures.js
@@ -30,7 +30,6 @@ module.exports = function (async, opts) {
)
: timeout
)
- if(timeout !== 0 && timer.unref) timer.unref()
}
return self = {
writing: false,
@@ -55,3 +54,4 @@ but the tests are pretty good.
*/
+
diff --git a/proto.js b/proto.js
index <HASH>..<HASH> 100644
--- a/proto.js
+++ b/proto.js
@@ -33,9 +33,6 @@ Single.prototype._timeout = function (delay) {
this._options.max - (Date.now() - this._ts)
) : delay
)
-
- if(delay !== 0)
- this._timer.unref && this._timer.unref()
}
Single.prototype._written = function () {
@@ -72,3 +69,6 @@ and it's a different distinction from private/public.
_cb is an update.
*/
+
+
+ | remove unref timers, so that a write will happen before the process exits | dominictarr_async-single | train | js,js |
e759b388e3c2e51dab88092f910486028dd67351 | diff --git a/src/samples/java/ex/UTAO_Sample.java b/src/samples/java/ex/UTAO_Sample.java
index <HASH>..<HASH> 100755
--- a/src/samples/java/ex/UTAO_Sample.java
+++ b/src/samples/java/ex/UTAO_Sample.java
@@ -265,3 +265,22 @@ class GitHubIssue109 {
Object findByUuid(String uuid);
}
}
+
+class GitHubIssue261 {
+ @Test
+ public void fpCallingAnAssert() {
+ AssertHelper261 expect = new AssertHelper261Impl();
+ expect.assertNotSeen();
+ }
+}
+
+interface AssertHelper261 {
+ void assertNotSeen();
+}
+
+class AssertHelper261Impl implements AssertHelper261 {
+
+ @Override
+ public void assertNotSeen() {
+ }
+} | add UTAO fp as described by #<I> | mebigfatguy_fb-contrib | train | java |
abb6800d48a29244d22b0f5b2b0d5639d74f4e34 | diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/DBAL/Driver/PDOConnection.php
+++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php
@@ -38,7 +38,10 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
public function exec($statement)
{
try {
- return parent::exec($statement);
+ $result = parent::exec($statement);
+ assert($result !== false);
+
+ return $result;
} catch (\PDOException $exception) {
throw new PDOException($exception);
} | PDO APIs need additional assertions due to the existing error suppression mode | doctrine_dbal | train | php |
0440851baf2588dc83d60885c40211f24f7423f6 | diff --git a/examples/get_user_rooms.php b/examples/get_user_rooms.php
index <HASH>..<HASH> 100644
--- a/examples/get_user_rooms.php
+++ b/examples/get_user_rooms.php
@@ -8,4 +8,3 @@ $chatkit = new Chatkit\Chatkit([
]);
print_r($chatkit->getUserRooms([ 'user_id' => 'ham' ]));
- | Remove extra blank line at bottom of getUserRooms example | pusher_chatkit-server-php | train | php |
619ef7e9e78d01e638aceef32799d8a5ea196adb | diff --git a/Nextras/Application/UI/SecuredLinksControlTrait.php b/Nextras/Application/UI/SecuredLinksControlTrait.php
index <HASH>..<HASH> 100644
--- a/Nextras/Application/UI/SecuredLinksControlTrait.php
+++ b/Nextras/Application/UI/SecuredLinksControlTrait.php
@@ -65,7 +65,7 @@ trait SecuredLinksControlTrait
parent::signalReceived($signal);
- if ($secured) {
+ if ($secured && !$this->getPresenter()->isAjax()) {
throw new \LogicException("Secured signal '$signal' did not redirect. Possible csrf-token reveal by http referer header.");
}
} | Fixed secured signals in ajax. (It doesn't require redirect now) | nextras_secured-links | train | php |
9618271d3f89631c548b41f6dee7504486660253 | diff --git a/src/js/components/Video.js b/src/js/components/Video.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Video.js
+++ b/src/js/components/Video.js
@@ -311,7 +311,11 @@ export default class Video extends Component {
return (
<div className={classes.join(' ')} onMouseMove={this._onMouseMove}>
- <video ref="video" poster={this.props.poster} autoPlay={this.props.autoPlay ? 'autoplay' : false}>
+ <video ref="video"
+ poster={this.props.poster}
+ autoPlay={this.props.autoPlay ? 'autoplay' : false}
+ loop={this.props.loop ? 'loop' : false}
+ muted={this.props.muted ? 'muted' : false}>
{this.props.children}
</video>
{this.props.showControls ? this._renderControls() : undefined}
@@ -337,10 +341,14 @@ Video.propTypes = {
onClick: PropTypes.func,
allowFullScreen: PropTypes.bool,
autoPlay: PropTypes.bool,
- showControls: PropTypes.bool
+ showControls: PropTypes.bool,
+ muted: PropTypes.bool,
+ loop: PropTypes.bool
};
Video.defaultProps = {
autoPlay: false,
- showControls: true
+ showControls: true,
+ muted: false,
+ loop: false
}; | Added muted and loop flags as props for Video component. | grommet_grommet | train | js |
6145229e084833714216a69edb25f7c636335119 | diff --git a/src/Super_Admin_Command.php b/src/Super_Admin_Command.php
index <HASH>..<HASH> 100644
--- a/src/Super_Admin_Command.php
+++ b/src/Super_Admin_Command.php
@@ -194,13 +194,6 @@ class Super_Admin_Command extends WP_CLI_Command {
private static function get_admins() {
// We don't use get_super_admins() because we don't want to mess with the global
- $site_admins = get_site_option( 'site_admins', array('admin') );
-
- // If there are no super admins, return empty array to prevent problems further in the code
- if ( ! $site_admins ) {
- $site_admins = array();
- }
-
- return $site_admins;
+ return (array) get_site_option( 'site_admins', array('admin') );
}
} | Change the if clause to a casting for more simple approach | wp-cli_super-admin-command | train | php |
47dd0c93889677978e287467490d72f5f4658ae7 | diff --git a/lib/clone-schema.js b/lib/clone-schema.js
index <HASH>..<HASH> 100644
--- a/lib/clone-schema.js
+++ b/lib/clone-schema.js
@@ -9,6 +9,8 @@ module.exports = function (schema) {
var clonedPath = {};
clonedPath[key] = path.options;
+ clonedPath[key].unique = false;
+
clonedSchema.add(clonedPath);
});
diff --git a/lib/strategies/collection.js b/lib/strategies/collection.js
index <HASH>..<HASH> 100644
--- a/lib/strategies/collection.js
+++ b/lib/strategies/collection.js
@@ -16,14 +16,6 @@ module.exports = function(schema, options) {
refVersion : Number
});
- //remove uniqueness from the versionedSchema, fix for issue #3
- versionedSchema.eachPath(function (property, propertyConfig) {
- propertyConfig.options.unique = false;
- if (propertyConfig._index && propertyConfig._index.unique) {
- propertyConfig._index.unique = false;
- }
- });
-
// Add reference to model to original schema
schema.statics.VersionedModel = mongoose.model(options.collection, versionedSchema); | Pulls turning off unique indices to clone-schema | saintedlama_mongoose-version | train | js,js |
a42731274d342de4dad8b61281ddc48f47361b17 | diff --git a/blimpy/io/base_reader.py b/blimpy/io/base_reader.py
index <HASH>..<HASH> 100644
--- a/blimpy/io/base_reader.py
+++ b/blimpy/io/base_reader.py
@@ -216,7 +216,7 @@ class Reader(object):
self._setup_chans()
#create freq array
- i_vals = np.arange(self.chan_start_idx, self.chan_stop_idx)
+ i_vals = np.arange(self.chan_start_idx, self.chan_stop_idx + 1)
freqs = self.header['foff'] * i_vals + f0
return freqs
@@ -279,4 +279,4 @@ class Reader(object):
if selection_size_bytes > self.MAX_DATA_ARRAY_SIZE:
return True
else:
- return False
\ No newline at end of file
+ return False | Issue #<I>
Function populate_freqs when calculating the i_vals array, numpy.arange was not given the correct "stop" index value.
See <URL> | UCBerkeleySETI_blimpy | train | py |
e54ef20065470a98d066bf259011b8b252f3d4ab | diff --git a/polysquarelinter/linter.py b/polysquarelinter/linter.py
index <HASH>..<HASH> 100644
--- a/polysquarelinter/linter.py
+++ b/polysquarelinter/linter.py
@@ -37,13 +37,13 @@ from jobstamps import jobstamp
import parmap
+import polysquarelinter.valid_words_dictionary as valid_words_dictionary_helper
+
from polysquarelinter.spelling import (Dictionary,
SpellcheckError,
spellcheck_region,
spellcheckable_and_shadow_contents,
technical_words_from_shadow_contents,)
-import polysquarelinter.valid_words_dictionary as valid_words_dictionary_helper
-
try:
from Queue import Queue
except ImportError: | linter: Adjust importer order to satisfy I<I> | polysquare_polysquare-generic-file-linter | train | py |
bea41e1700077c772fd89db26f817977969c5ac3 | diff --git a/listing-bundle/src/Resources/contao/ModuleListing.php b/listing-bundle/src/Resources/contao/ModuleListing.php
index <HASH>..<HASH> 100644
--- a/listing-bundle/src/Resources/contao/ModuleListing.php
+++ b/listing-bundle/src/Resources/contao/ModuleListing.php
@@ -304,7 +304,7 @@ class ModuleListing extends Module
/**
* Template variables
*/
- $this->Template->action = ampersand($this->Environment->request);
+ $this->Template->action = $this->getIndexFreeRequest();
$this->Template->details = strlen($this->list_info) ? true : false;
$this->Template->search_label = specialchars($GLOBALS['TL_LANG']['MSC']['search']);
$this->Template->per_page_label = specialchars($GLOBALS['TL_LANG']['MSC']['list_perPage']); | [Listing] The front end cache only worked with rewritten URLs (#<I>) | contao_contao | train | php |
2b5fb0fcb6d912b0e7b3190d4cd886f42d9b84ae | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -38,7 +38,7 @@ setup(
'seaborn',
'nanoplotter>=0.30.1',
'nanoget>=1.4.0',
- 'nanomath>=0.17.0'
+ 'nanomath>=0.18.1'
],
package_data={'NanoPlot': []},
package_dir={'nanoplot': 'nanoplot'}, | make dependent on latest nanomath, which contains a bug fix | wdecoster_NanoPlot | train | py |
490fa6dc4885e728ab10dfa92f9fe622cd2d4ca2 | diff --git a/quaternion.js b/quaternion.js
index <HASH>..<HASH> 100644
--- a/quaternion.js
+++ b/quaternion.js
@@ -493,9 +493,28 @@
parse(P, w, x, y, z);
+ // maybe check for NaN's here?
return Math.abs(P['w'] - this['w']) < EPSILON && Math.abs(P['x'] - this['x']) < EPSILON && Math.abs(P['y'] - this['y']) < EPSILON && Math.abs(P['z'] - this['z']) < EPSILON;
},
/**
+ * Checks if all parts of a quaternion are finite
+ *
+ * @returns {boolean}
+ */
+ 'isFinite': function() {
+
+ return isFinite(this['w']) && isFinite(this['x']) && isFinite(this['y']) && isFinite(this['z']);
+ },
+ /**
+ * Checks if any of the parts of the quaternion is not a number
+ *
+ * @returns {boolean}
+ */
+ 'isNaN': function() {
+
+ return isNaN(this['w']) || isNaN(this['x']) || isNaN(this['y']) || isNaN(this['z']);
+ },
+ /**
* Gets the Quaternion as a well formatted string
*
* @returns {string} | Added misc functions isNaN and isFinite | infusion_Quaternion.js | train | js |
83db3d2f684f26f2117c1e212f9d33172f2d75d4 | diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index <HASH>..<HASH> 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -3031,7 +3031,7 @@ a..b, a:b, a:, ..b items by indices (inclusive)
# get the output out of the buffer
output = membuf.read()
# and add the regex-escaped output to the transcript
- transcript += output.replace('/', '\/')
+ transcript += output.replace('/', r'\/')
# Restore stdout to its original state
self.stdout = saved_self_stdout
diff --git a/cmd2/transcript.py b/cmd2/transcript.py
index <HASH>..<HASH> 100644
--- a/cmd2/transcript.py
+++ b/cmd2/transcript.py
@@ -106,7 +106,7 @@ class Cmd2TestCase(unittest.TestCase):
self.assertTrue(re.match(expected, result, re.MULTILINE | re.DOTALL), message)
def _transform_transcript_expected(self, s: str) -> str:
- """Parse the string with slashed regexes into a valid regex.
+ r"""Parse the string with slashed regexes into a valid regex.
Given a string like: | This just fixes a couple minor lint warnings related to raw strings and escapes | python-cmd2_cmd2 | train | py,py |
2ad9228a20acde793ce0c9eff7233b28ef710094 | diff --git a/lib/stylesheet/css_style_sheet.rb b/lib/stylesheet/css_style_sheet.rb
index <HASH>..<HASH> 100644
--- a/lib/stylesheet/css_style_sheet.rb
+++ b/lib/stylesheet/css_style_sheet.rb
@@ -106,6 +106,7 @@ module Stylesheet
end
def request_content
+ return "" if inline_css?
raise InvalidLocationError unless location && location.valid?
request.get(location.href)
end
diff --git a/spec/css_style_sheet_spec.rb b/spec/css_style_sheet_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/css_style_sheet_spec.rb
+++ b/spec/css_style_sheet_spec.rb
@@ -137,6 +137,14 @@ describe CssStyleSheet do
}.not_to raise_error
end
+ it "doesn't fetch for nil inline styles" do
+ sheet = CssStyleSheet.new(content: nil)
+
+ expect {
+ sheet.css_rules.map {|r| r.content }
+ }.not_to raise_error
+ end
+
end
describe "#css_rules" do | don't fetch content for nil inline styles | devrieda_stylesheet | train | rb,rb |
04a12b025b9298278d1042a4bbc71182aff159ad | diff --git a/lib/middleware/ai.js b/lib/middleware/ai.js
index <HASH>..<HASH> 100644
--- a/lib/middleware/ai.js
+++ b/lib/middleware/ai.js
@@ -199,13 +199,13 @@ module.exports = function(http) {
// Set up some options
img
- .filter('Triangle')
+ // .filter('Triangle')
// Not sure if these work in GM, but they are IM options
- .define('filter:support=2')
- .define('jpeg:fancy-upsampling=off')
- .unsharp(0.25, 0.25, 8, 0.065)
+ // .define('filter:support=2')
+ // .define('jpeg:fancy-upsampling=off')
+ // .unsharp(0.25, 0.25, 8, 0.065)
// .colors(136)
- .dither(false)
+ // .dither(false)
// .colorspace('sRGB')
.out('-background', bg || (mimetype == 'image/png' ? 'transparent' : 'white')); | removing filters, causes blurryness | SandJS_http | train | js |
03048410bb1ae987602c483ebaef370c9e6722b7 | diff --git a/ui/QuerySelect.js b/ui/QuerySelect.js
index <HASH>..<HASH> 100644
--- a/ui/QuerySelect.js
+++ b/ui/QuerySelect.js
@@ -20,7 +20,6 @@ export default class QuerySelect extends Component {
$$(Input, { placeholder })
.ref('input')
.on('focus', this._onFocus)
- .on('blur', this._onBlur)
.on('input', this._onInput)
)
return el
@@ -44,12 +43,6 @@ export default class QuerySelect extends Component {
this._query()
}
- _onBlur (event) {
- // console.log('QuerySelect._onBlur()')
- domHelpers.stop(event)
- this._hideOptions()
- }
-
async _query () {
const { query } = this.props
const queryString = this.refs.input.val() | Remove QuerySelect.onBlur().
Popover does auto-closing. | substance_substance | train | js |
44c14aa986b2de1d922bcb9fe60246ff6f4befca | diff --git a/lib/linux_admin/network_interface.rb b/lib/linux_admin/network_interface.rb
index <HASH>..<HASH> 100644
--- a/lib/linux_admin/network_interface.rb
+++ b/lib/linux_admin/network_interface.rb
@@ -51,8 +51,10 @@ module LinuxAdmin
@network_conf[:mac] = parse_ip_output(ip_output, %r{link/ether}, 1)
- ip_route_res = Common.run!(Common.cmd("ip"), :params => ["route"])
- @network_conf[:gateway4] = parse_ip_output(ip_route_res.output, /^default/, 2) if ip_route_res.success?
+ [4, 6].each do |version|
+ ip_route_res = Common.run!(Common.cmd("ip"), :params => ["-#{version}", "route"])
+ @network_conf["gateway#{version}".to_sym] = parse_ip_output(ip_route_res.output, /^default/, 2) if ip_route_res.success?
+ end
true
rescue AwesomeSpawn::CommandResultError => e
raise NetworkInterfaceError.new(e.message, e.result) | Start parsing ipv6 gateway | ManageIQ_linux_admin | train | rb |
966c9d6e2494dc7ad9330d632b9e51739ee214be | diff --git a/src/ActionSheet.js b/src/ActionSheet.js
index <HASH>..<HASH> 100644
--- a/src/ActionSheet.js
+++ b/src/ActionSheet.js
@@ -268,7 +268,7 @@ class ActionSheet extends Component {
const pointerEvents = (actionSheetState === ACTION_SHEET_OPENED) ? 'auto' : 'none';
const hidden = actionSheetState === ACTION_SHEET_CLOSED && styles.hidden;
- const contentPosition = (position === 'top')
+ const actionSheetPosition = (position === 'top')
? { top: INITIAL_TOP_POSITION }
: { bottom: INITIAL_BOTTOM_POSITION };
@@ -286,7 +286,7 @@ class ActionSheet extends Component {
pointerEvents={pointerEvents}
/>
<Animated.View
- style={[styles.contentContainer, contentPosition, animations]}
+ style={[styles.contentContainer, actionSheetPosition, animations]}
>
<ScrollView style={[styles.scrollView, scrollView]}>
{this.renderItems()} | code refactoring - better naming conversion | jacklam718_react-native-action-sheet-component | train | js |
4ec49172a4a28a24d3c9479aa4117644637dc80d | diff --git a/src/animation/Clip.js b/src/animation/Clip.js
index <HASH>..<HASH> 100644
--- a/src/animation/Clip.js
+++ b/src/animation/Clip.js
@@ -72,7 +72,6 @@ define(
// 重新开始周期
// 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
return 'restart';
-
}
// 动画完成将这个控制器标识为待删除
@@ -87,6 +86,8 @@ define(
var time = new Date().getTime();
var remainder = (time - this._startTime) % this._life;
this._startTime = new Date().getTime() - remainder + this.gap;
+
+ this._needsRemove = false;
},
fire : function(eventType, arg) {
for (var i = 0, len = this._targetPool.length; i < len; i++) {
diff --git a/src/tool/area.js b/src/tool/area.js
index <HASH>..<HASH> 100644
--- a/src/tool/area.js
+++ b/src/tool/area.js
@@ -852,7 +852,10 @@ define(
isInsideCircle: isInsideCircle,
isInsideLine: isInsideLine,
isInsideRect: isInsideRect,
- isInsideBrokenLine: isInsideBrokenLine
+ isInsideBrokenLine: isInsideBrokenLine,
+
+ isInsideCubicStroke: isInsideCubicStroke,
+ isInsideQuadraticStroke: isInsideQuadraticStroke
};
}
); | 暴露 isInsideCubicStroke 和 isInsideQuadraticStroke | ecomfe_zrender | train | js,js |
87349c3068f5b2a42a6a46f539fa79529637a26c | diff --git a/littlechef/chef.py b/littlechef/chef.py
index <HASH>..<HASH> 100644
--- a/littlechef/chef.py
+++ b/littlechef/chef.py
@@ -147,7 +147,7 @@ def _synchronize_node(configfile, node):
if env.gateway:
ssh_key_file = '.ssh/'+os.path.basename(' '.join(env.ssh_config.lookup(env.host_string)['identityfile']))
extra_opts=""
- ssh_opts+=" "+env.gateway+" ssh -i "+ssh_key_file
+ ssh_opts+=" "+env.gateway+" ssh -o StrictHostKeyChecking=no -i "+ssh_key_file
rsync_project(
env.node_work_path, | Disable strict host key checking for last hop nodes. | tobami_littlechef | train | py |
862ffcf92eeb4f95a7f2fc6e264be9b38eae8e8b | diff --git a/code/DebugBarRequestFilter.php b/code/DebugBarRequestFilter.php
index <HASH>..<HASH> 100644
--- a/code/DebugBarRequestFilter.php
+++ b/code/DebugBarRequestFilter.php
@@ -63,10 +63,10 @@ class DebugBarRequestFilter implements \RequestFilter
}
// Always enable in admin because everything is mostly loaded through ajax
if (DebugBar::config()->ajax || DebugBar::IsAdminUrl()) {
- $headers = json_decode(rawurldecode($debugbar->getDataAsHeaders()));
+ $headers = $debugbar->getDataAsHeaders();;
// Prevent throwing js errors in case header size is too large
- if (!empty($headers['error'])) {
+ if (is_array($headers)) {
$debugbar->sendDataInHeaders();
}
} | actually, $headers could be a string or an array | lekoala_silverstripe-debugbar | train | php |
0dd608e5e85a9157e1b6060111acea4f5e1b73a9 | diff --git a/pkg/endpoint/endpoint.go b/pkg/endpoint/endpoint.go
index <HASH>..<HASH> 100644
--- a/pkg/endpoint/endpoint.go
+++ b/pkg/endpoint/endpoint.go
@@ -993,9 +993,10 @@ func (e *Endpoint) LogStatusOK(typ StatusType, msg string) {
func (e *Endpoint) logStatusLocked(typ StatusType, code StatusCode, msg string) {
sts := &statusLogMsg{
Status: Status{
- Code: code,
- Msg: msg,
- Type: typ,
+ Code: code,
+ Msg: msg,
+ Type: typ,
+ State: e.state,
},
Timestamp: time.Now().UTC(),
}
diff --git a/pkg/endpoint/status.go b/pkg/endpoint/status.go
index <HASH>..<HASH> 100644
--- a/pkg/endpoint/status.go
+++ b/pkg/endpoint/status.go
@@ -40,9 +40,10 @@ const (
)
type Status struct {
- Code StatusCode `json:"code"`
- Msg string `json:"msg"`
- Type StatusType `json:"status-type"`
+ Code StatusCode `json:"code"`
+ Msg string `json:"msg"`
+ Type StatusType `json:"status-type"`
+ State string `json:"state"`
}
func (sc StatusCode) ColorString() string { | endpoint: Store endpoint state in status log
We now store the state of the endpoint when we store a status log. This
can be later exported via the API and used to understand the lifecycle of an
endpoint. | cilium_cilium | train | go,go |
1eb20ea3faeb66b18c4c9300b4a6c8c3190ca6ce | diff --git a/presto-blackhole/src/main/java/com/facebook/presto/plugin/blackhole/BlackHoleMetadata.java b/presto-blackhole/src/main/java/com/facebook/presto/plugin/blackhole/BlackHoleMetadata.java
index <HASH>..<HASH> 100644
--- a/presto-blackhole/src/main/java/com/facebook/presto/plugin/blackhole/BlackHoleMetadata.java
+++ b/presto-blackhole/src/main/java/com/facebook/presto/plugin/blackhole/BlackHoleMetadata.java
@@ -78,8 +78,9 @@ public class BlackHoleMetadata
@Override
public List<SchemaTableName> listTables(ConnectorSession session, String schemaNameOrNull)
{
- checkArgument(schemaNameOrNull == null || schemaNameOrNull.equals(SCHEMA_NAME),
- "Only '%s' schema is supported", SCHEMA_NAME);
+ if (schemaNameOrNull != null && !schemaNameOrNull.equals(SCHEMA_NAME)) {
+ return ImmutableList.of();
+ }
return tables.values().stream()
.map(BlackHoleTableHandle::toSchemaTableName)
.collect(toList()); | Fix listing tables in blackhole connector
Listing tables in a non-existent schema should not be an error. | prestodb_presto | train | java |
a51bee705a12a0d1c83c0f53efca78a88a8326ec | diff --git a/svtyper/version.py b/svtyper/version.py
index <HASH>..<HASH> 100644
--- a/svtyper/version.py
+++ b/svtyper/version.py
@@ -1,2 +1,2 @@
__author__ = "Colby Chiang ([email protected])"
-__version__ = "v0.3.0"
+__version__ = "v0.3.1" | + update to <I>
- after code review with @ernfrid | hall-lab_svtyper | train | py |
72b0a6396d1d381bddd593eb5a1148a90360ed9b | diff --git a/ViewErrorBag.php b/ViewErrorBag.php
index <HASH>..<HASH> 100644
--- a/ViewErrorBag.php
+++ b/ViewErrorBag.php
@@ -10,6 +10,17 @@ class ViewErrorBag implements Countable {
* @var array
*/
protected $bags = [];
+
+ /**
+ * Checks if a MessageBag exists.
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function hasBag($key = "default")
+ {
+ return isset($this->bags[$key]);
+ }
/**
* Get a MessageBag instance from the bags. | Add method hasBag to ViewErrorBag
When redirecting withErrors($validator) the edit form can show individual messages. But to show a generic message, something like: please check the red marked field below I don't know anything else but to flash a extra variable. This method would remedy that. Now I could check: $errors->hasBag() to see if the form is a redirect from a post with a errors message bag or a first get for input. | illuminate_support | train | php |
75d57553da2cf2762c00fbc078888689cf964fb0 | diff --git a/update-badges.js b/update-badges.js
index <HASH>..<HASH> 100644
--- a/update-badges.js
+++ b/update-badges.js
@@ -28,7 +28,7 @@ let newRstExchangeTable = rstExchangeTableLines.map (line => {
//-----------------------------------------------------------------------------
-function updateExchangeCountInBadge (fileName) {
+function updateExchangeCount (fileName) {
log.bright.cyan ('Updating exchange count →', fileName.yellow) | minor fix in update-badges.js | ccxt_ccxt | train | js |
8f7d549c824c681515850000acbb16b7f45b5406 | diff --git a/pyvista/plotting/plotting.py b/pyvista/plotting/plotting.py
index <HASH>..<HASH> 100644
--- a/pyvista/plotting/plotting.py
+++ b/pyvista/plotting/plotting.py
@@ -3226,7 +3226,6 @@ class BasePlotter(PickingHelper, WidgetHelper):
If an actor of this name already exists in the rendering window, it
will be replaced by the new actor.
-
shape_color : string or 3 item list, optional. Color of points (if visible).
Either a string, rgb list, or hex color string. For example: | fix docstring (#<I>) | vtkiorg_vtki | train | py |
48d50f8879bbd1fc19490fc9ac544a263d9ff544 | diff --git a/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/EntityManagerFactory.php b/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/EntityManagerFactory.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/EntityManagerFactory.php
+++ b/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/EntityManagerFactory.php
@@ -119,7 +119,7 @@ class EntityManagerFactory
$proxyDirectory = Files::concatenatePaths([$this->environment->getPathToTemporaryDirectory(), 'Doctrine/Proxies']);
Files::createDirectoryRecursively($proxyDirectory);
$config->setProxyDir($proxyDirectory);
- $config->setProxyNamespace(Proxies::class);
+ $config->setProxyNamespace('TYPO3\Flow\Persistence\Doctrine\Proxies');
$config->setAutoGenerateProxyClasses(false);
// Set default host to 127.0.0.1 if there is no host configured but a dbname | TASK: Use string for "virtual" namespace name
This reverts the use of the ::class constant for the ORM proxy
namespace configuration, since that is not "real" and is not
even a "class" but just a "namespace prefix". | neos_flow-development-collection | train | php |
5b2258b082d91b127935ab9bf422861a351d2fe2 | diff --git a/lib/npm.js b/lib/npm.js
index <HASH>..<HASH> 100644
--- a/lib/npm.js
+++ b/lib/npm.js
@@ -66,6 +66,10 @@ function changelog(packageName, cb) {
function(err, data) {
var i;
if (data && data.changes) {
+ if (data.changes[0].date > Versions[0].date) {
+ Versions.unshift({ version: 'Upcoming', date: data.changes[0].date});
+ }
+
data.changes.forEach(function(change){
//log('change', change);
if (change) { | support upcoming features that are in github but not yet in npm. | dylang_changelog | train | js |
ec30fda95b0dba35ff68b636d6f98b776acfb71a | diff --git a/configuration-lib/src/main/java/com/cisco/oss/foundation/configuration/CentralConfigurationUtil.java b/configuration-lib/src/main/java/com/cisco/oss/foundation/configuration/CentralConfigurationUtil.java
index <HASH>..<HASH> 100644
--- a/configuration-lib/src/main/java/com/cisco/oss/foundation/configuration/CentralConfigurationUtil.java
+++ b/configuration-lib/src/main/java/com/cisco/oss/foundation/configuration/CentralConfigurationUtil.java
@@ -243,6 +243,7 @@ public enum CentralConfigurationUtil {
properties.setProperty("service.configurationLib." + numOfServers + ".port", port);
numOfServers++;
}
+ properties.setProperty("service.configurationLib.http.exposeStatisticsToMonitor", "false");
return properties;
} | disable http client monitoring in the special http client used to fetch configuration remotely | foundation-runtime_configuration | train | java |
9c753d5af1795191b24239582a649691bec1085f | diff --git a/bakery/views/dates.py b/bakery/views/dates.py
index <HASH>..<HASH> 100644
--- a/bakery/views/dates.py
+++ b/bakery/views/dates.py
@@ -77,8 +77,9 @@ class BuildableYearArchiveView(YearArchiveView, BuildableMixin):
"""
Return the year from the database in the format expected by the URL.
"""
+ year = super(BuildableYearArchiveView, self).get_year()
fmt = self.get_year_format()
- return date(int(self.year), 1, 1).strftime(fmt)
+ return date(int(year), 1, 1).strftime(fmt)
def get_url(self):
""" | Fixed get_year on the year archive view | datadesk_django-bakery | train | py |
35137ecdcdacce0d9b4715cec7d0705fd337c357 | diff --git a/middleware.go b/middleware.go
index <HASH>..<HASH> 100644
--- a/middleware.go
+++ b/middleware.go
@@ -66,23 +66,6 @@ func (ms *MiddlewareStack) Use(mw ...MiddlewareFunc) {
/*
a.Middleware.Skip(Authorization, HomeHandler, LoginHandler, RegistrationHandler)
*/
-// NOTE: When skipping Resource handlers, you need to first declare your
-// resource handler as a type of buffalo.Resource for the Skip function to
-// properly recognize and match it.
-/*
- // Works:
- var cr Resource
- cr = &carsResource{&buffaloBaseResource{}}
- g = a.Resource("/cars", cr)
- g.Use(SomeMiddleware)
- g.Middleware.Skip(SomeMiddleware, cr.Show)
-
- // Doesn't Work:
- cr := &carsResource{&buffaloBaseResource{}}
- g = a.Resource("/cars", cr)
- g.Use(SomeMiddleware)
- g.Middleware.Skip(SomeMiddleware, cr.Show)
-*/
func (ms *MiddlewareStack) Skip(mw MiddlewareFunc, handlers ...Handler) {
for _, h := range handlers {
key := funcKey(mw, h) | removed out of date middleware skipping docs | gobuffalo_buffalo | train | go |
771658dbb87628c2254ea56c58dba5d132a295a0 | diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go
index <HASH>..<HASH> 100644
--- a/drivers/overlay/overlay.go
+++ b/drivers/overlay/overlay.go
@@ -239,6 +239,8 @@ func parseOptions(options []string) (*overlayOptions, error) {
}
key = strings.ToLower(key)
switch key {
+ case ".override_kernel_check", "overlay.override_kernel_check", "overlay2.override_kernel_check":
+ logrus.Warnf("overlay: override_kernel_check option was specified, but is no longer necessary")
case ".mountopt", "overlay.mountopt", "overlay2.mountopt":
o.mountOptions = val
case ".size", "overlay.size", "overlay2.size":
diff --git a/store.go b/store.go
index <HASH>..<HASH> 100644
--- a/store.go
+++ b/store.go
@@ -566,10 +566,10 @@ func GetStore(options StoreOptions) (Store, error) {
}
if options.GraphRoot == "" {
- return nil, ErrIncompleteOptions
+ return nil, errors.Wrap(ErrIncompleteOptions, "no storage root specified")
}
if options.RunRoot == "" {
- return nil, ErrIncompleteOptions
+ return nil, errors.Wrap(ErrIncompleteOptions, "no storage runroot specified")
}
if err := os.MkdirAll(options.RunRoot, 0700); err != nil && !os.IsExist(err) { | Make use of overlay.override_kernel_check a warning instead of an error
When we removed all traces of override_kernel_check, we created a
situation where older configuration files would suddenly start causing
us to emit an error at startup. Soften that to a warning, for now at
least. | containers_storage | train | go,go |
1f507518b8c6928985ddb8d6b2e611c7403c0fb9 | diff --git a/devices/tuya.js b/devices/tuya.js
index <HASH>..<HASH> 100644
--- a/devices/tuya.js
+++ b/devices/tuya.js
@@ -158,6 +158,7 @@ module.exports = [
{modelID: 'TS0601', manufacturerName: '_TZE200_ebwgzdqq'},
{modelID: 'TS0601', manufacturerName: '_TZE200_9i9dt8is'},
{modelID: 'TS0601', manufacturerName: '_TZE200_dfxkcots'},
+ {modelID: 'TS0601', manufacturerName: '_TZE200_swaamsoy'},
],
model: 'TS0601_dimmer',
vendor: 'TuYa', | Add _TZE<I>_swaamsoy to TS<I>_dimmer (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
1aed2d1b173e03646a5c79c82e4be052c08e86cc | diff --git a/lib/faraday.rb b/lib/faraday.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday.rb
+++ b/lib/faraday.rb
@@ -181,7 +181,12 @@ module Faraday
end
def middleware_mutex(&block)
- (@middleware_mutex ||= Mutex.new).synchronize(&block)
+ @middleware_mutex ||= Mutex.new
+ if @middleware_mutex.locked?
+ block.call
+ else
+ @middleware_mutex.synchronize(&block)
+ end
end
def fetch_middleware(key) | Don't let nested mutex deadlock the thread. | lostisland_faraday | train | rb |
4473f9738a7186c673677d9aaa686606e1ac0efd | diff --git a/chromedp_test.go b/chromedp_test.go
index <HASH>..<HASH> 100644
--- a/chromedp_test.go
+++ b/chromedp_test.go
@@ -25,7 +25,6 @@ import (
"github.com/chromedp/cdproto/network"
"github.com/chromedp/cdproto/page"
"github.com/chromedp/cdproto/runtime"
- cdpruntime "github.com/chromedp/cdproto/runtime"
"github.com/chromedp/cdproto/target"
)
@@ -136,7 +135,7 @@ func testAllocateSeparate(tb testing.TB) (context.Context, context.CancelFunc) {
}
ListenBrowser(ctx, func(ev interface{}) {
switch ev := ev.(type) {
- case *cdpruntime.EventExceptionThrown:
+ case *runtime.EventExceptionThrown:
tb.Errorf("%+v\n", ev.ExceptionDetails)
}
})
@@ -423,7 +422,7 @@ func TestLargeEventCount(t *testing.T) {
// without making the test too slow.
first := true
ListenTarget(ctx, func(ev interface{}) {
- if _, ok := ev.(*cdpruntime.EventConsoleAPICalled); ok && first {
+ if _, ok := ev.(*runtime.EventConsoleAPICalled); ok && first {
time.Sleep(50 * time.Millisecond)
first = false
} | address ST<I>: package is being imported more than once
issue found by staticcheck (<URL>) | chromedp_chromedp | train | go |
108300c93984aabc8322776a1936a35280053ac9 | diff --git a/http_check/datadog_checks/http_check/http_check.py b/http_check/datadog_checks/http_check/http_check.py
index <HASH>..<HASH> 100644
--- a/http_check/datadog_checks/http_check/http_check.py
+++ b/http_check/datadog_checks/http_check/http_check.py
@@ -74,6 +74,10 @@ class HTTPCheck(NetworkCheck):
# Store tags in a temporary list so that we don't modify the global tags data structure
tags_list = list(tags)
+ url = instance.get('url', None)
+ if url is not None:
+ url = ensure_unicode(url)
+ tags_list.append('url:{}'.format(url))
instance_name = ensure_unicode(self.normalize(instance['name']))
tags_list.append("instance:{}".format(instance_name))
service_checks = [] | Add url as tag (#<I>)
* Append URL as tag even if sc aren't reporting
* Add url tag after list initialisation | DataDog_integrations-core | train | py |
e59b29396e533b7f3ed9f33f22be5255980c6ea1 | diff --git a/lib/engineyard/repo.rb b/lib/engineyard/repo.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard/repo.rb
+++ b/lib/engineyard/repo.rb
@@ -91,7 +91,7 @@ deploy-time operations. Commit this file to fix this warning.
def remotes
ensure_repository!
- @remotes ||= `git remote -v`.scan(/\t[^\s]+\s/).map { |c| c.strip }
+ @remotes ||= `git remote -v`.scan(/\t[^\s]+\s/).map { |c| c.strip }.uniq
end
def fail_on_no_remotes! | unique the remotes, they git duplicated | engineyard_engineyard | train | rb |
aeeb94e04f41a4632e566139d51f075a6938d4da | diff --git a/src/utils/clean-cid.js b/src/utils/clean-cid.js
index <HASH>..<HASH> 100644
--- a/src/utils/clean-cid.js
+++ b/src/utils/clean-cid.js
@@ -7,6 +7,9 @@ module.exports = function (cid) {
if (Buffer.isBuffer(cid)) {
cid = bs58.encode(cid)
}
+ if (CID.isCID(cid)) {
+ cid = cid.toBaseEncodedString()
+ }
if (typeof cid !== 'string') {
throw new Error('unexpected cid type: ' + typeof cid)
} | feat: add ability to files.cat with a cid instance
License: MIT | ipfs_js-ipfs | train | js |
bb83a84e066581bc0fdd3ff929cacdfc640a57b9 | diff --git a/lib/puppet/version.rb b/lib/puppet/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/version.rb
+++ b/lib/puppet/version.rb
@@ -7,7 +7,7 @@
module Puppet
- PUPPETVERSION = '3.6.0'
+ PUPPETVERSION = '3.6.1'
##
# version is a public API method intended to always provide a fast and | (packaging) Update PUPPETVERSION to <I> | puppetlabs_puppet | train | rb |
286bcf5178885f6e8c46bc590532940752049ac8 | diff --git a/build/jquery.datetimepicker.full.js b/build/jquery.datetimepicker.full.js
index <HASH>..<HASH> 100644
--- a/build/jquery.datetimepicker.full.js
+++ b/build/jquery.datetimepicker.full.js
@@ -217,7 +217,11 @@ var DateFormatter;
break;
}
}
- if (vDateFlag === true && out.year && out.month && out.day) {
+ if (vDateFlag === true) {
+ // Set month and day to 1 if they are null
+ out.month = out.month || 1;
+ out.day = out.day || 1;
+
out.date = new Date(out.year, out.month - 1, out.day, out.hour, out.min, out.sec, 0);
} else {
if (vTimeFlag !== true) { | Insert sensible defaults (1) for out.month and out.day if parsing with format string didn't set them
See issue #<I> | xdan_datetimepicker | train | js |
c0f9212a3ffc93695f65a6a37df8f30764ec957d | diff --git a/lib/utorrent.js b/lib/utorrent.js
index <HASH>..<HASH> 100644
--- a/lib/utorrent.js
+++ b/lib/utorrent.js
@@ -43,7 +43,7 @@ var uTorrentClient = module.exports = function(host, port) {
// Callback used when we call the makeCall() method for first time with a saved token. As the token may have expired, we need to check this and retry with new token if an error occurs.
var retryCallback = function(err, data) {
if(err && err instanceof TokenError) {
- this.fetchToken(function(err) {
+ self.fetchToken(function(err) {
if(err) { callback(err); return; }
self.makeCall(action, params, callback); | Use self instead of this. Fix #5 | leeroybrun_node-utorrent-api | train | js |
89a740b66edb887dfeab788300af5c1317212f35 | diff --git a/doge/core.py b/doge/core.py
index <HASH>..<HASH> 100755
--- a/doge/core.py
+++ b/doge/core.py
@@ -367,7 +367,7 @@ def main():
shibe.setup()
shibe.print_doge()
- except UnicodeEncodeError:
+ except (UnicodeEncodeError, UnicodeDecodeError):
# Some kind of unicode error happened. This is usually because the
# users system does not have a proper locale set up. Try to be helpful
# and figure out what could have gone wrong. | wow also unicode decode error catch | thiderman_doge | train | py |
eefe78d9fa14b83c2e32fa447176c9ec372cbf74 | diff --git a/Debug/TraceableProcessor.php b/Debug/TraceableProcessor.php
index <HASH>..<HASH> 100644
--- a/Debug/TraceableProcessor.php
+++ b/Debug/TraceableProcessor.php
@@ -29,6 +29,14 @@ class TraceableProcessor implements ProcessorInterface
}
/**
+ * @return ProcessorInterface
+ */
+ public function getProcessor()
+ {
+ return $this->processor;
+ }
+
+ /**
* {@inheritdoc}
*/
public function process(ContextInterface $context) | BAP-<I>: Config options should be returned only on demand | oroinc_OroChainProcessorComponent | train | php |
2518aa20ef0f68afc3ef98f565b61fdee9d4b6a8 | diff --git a/src/resources/assets/react/components/HCForm.js b/src/resources/assets/react/components/HCForm.js
index <HASH>..<HASH> 100644
--- a/src/resources/assets/react/components/HCForm.js
+++ b/src/resources/assets/react/components/HCForm.js
@@ -92,13 +92,13 @@ export default class HCForm extends Component {
this.refs[key].setMultiLanguageValue(item['language_code'], item[keySequence[1]]);
});
}
- else if (value) {
+ else if (value !== null && value !== undefined) {
this.refs[key].setValue(value);
}
}
}
- else if (value) {
+ else if (value !== null && value !== undefined) {
this.refs[key].setValue(value);
} | Improved data setting when value is equal to 0 | honey-comb_core | train | js |
d79a1dc1439efbacc9ce8c77ddd522ba9f32cc8f | diff --git a/eZ/Publish/Core/Persistence/InMemory/Backend.php b/eZ/Publish/Core/Persistence/InMemory/Backend.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Persistence/InMemory/Backend.php
+++ b/eZ/Publish/Core/Persistence/InMemory/Backend.php
@@ -509,6 +509,17 @@ class Backend
$value->$propertyName = $propertyValue;
}
}
+ else if ( $type === "Content\\UrlAlias" && $prop === "id" )
+ {
+ // id should be <parent>-<hash>, but as there is no property for link in VO and we need it in handler,
+ // returning everything here
+ // Note: before returning in handler id must be overwritten with <parent>-<hash>
+ $value = array(
+ "id" => $data["id"],
+ "parent" => $data["parent"],
+ "link" => $data["link"],
+ );
+ }
else
{
$value = $data[$prop]; | Updated: special case for mapping data to UrlAlias->id | ezsystems_ezpublish-kernel | train | php |
acad748d2cbf7140eb174add5e7811bc46ac2fb6 | diff --git a/scripts/app.js b/scripts/app.js
index <HASH>..<HASH> 100644
--- a/scripts/app.js
+++ b/scripts/app.js
@@ -12,7 +12,6 @@ var generateData = require('./generate_data');
var App = React.createClass({
getInitialState() {
- var that = this;
var countries = {
'de': 'Germany',
'fi': 'Finland',
@@ -55,20 +54,20 @@ var App = React.createClass({
formatter: (active) => active && <span>✓</span>,
},
{
- cell: (i) => {
+ cell: ((i) => {
var remove = () => {
// this could go through flux etc.
- delete that.state.data[i];
+ this.state.data.splice(i, 1);
- that.setState({
- data: that.state.data
+ this.setState({
+ data: this.state.data
});
};
return <span>
- <span onClick={remove} style={{cursor: 'pointer'}}>✗</span>
+ <span onClick={remove.bind(this)} style={{cursor: 'pointer'}}>✗</span>
</span>;
- },
+ }).bind(this),
}
]
}; | Tidy up row deletion
It is better to use splice here (avoids empties in array) and pass
`this` through `bind`. | reactabular_reactabular | train | js |
4775b223d35dc896534b6b767b026977722c6e5a | diff --git a/src/components/Picklist/index.js b/src/components/Picklist/index.js
index <HASH>..<HASH> 100644
--- a/src/components/Picklist/index.js
+++ b/src/components/Picklist/index.js
@@ -76,6 +76,7 @@ class Picklist extends Component {
this.outsideClick.startListening(this.containerRef.current, (_, event) => {
if (this.eventTarget !== event.target) {
this.closeMenu();
+ this.handleBlur();
}
});
this.windowScrolling.startListening(this.handleWindowScroll);
@@ -153,6 +154,8 @@ class Picklist extends Component {
}
handleBlur() {
+ const { isOpen } = this.state;
+ if (isOpen) return;
const { onBlur, value } = this.props;
const eventValue = value || null;
onBlur(eventValue); | fix: `onBlur` event on Picklist fires on click (#<I>)
* fix: `onBlur` event on Picklist fires on click
* fix: fire onBlur event on outside click | 90milesbridge_react-rainbow | train | js |
5a19670d4e1bd2a1fcc9d425b8aa795d07feea45 | diff --git a/auth/rest.go b/auth/rest.go
index <HASH>..<HASH> 100644
--- a/auth/rest.go
+++ b/auth/rest.go
@@ -23,6 +23,10 @@ var (
ErrBadRestToken = errors.New("Could not extract auth token from REST request header")
)
+func BuildRestToken() string {
+ return AuthToken()
+}
+
func ExtractRestToken(header string) (string, error) {
// The expected header value is "Bearer JWT_ToKen"
header = strings.TrimSpace(header)
diff --git a/container/cc_api_proxy.go b/container/cc_api_proxy.go
index <HASH>..<HASH> 100644
--- a/container/cc_api_proxy.go
+++ b/container/cc_api_proxy.go
@@ -42,7 +42,7 @@ func newServicedApiProxy() *servicedApiProxy {
director := func(req *http.Request) {
req.URL.Scheme = "https"
req.URL.Host = "localhost:" + strconv.Itoa(ccApiPort)
- token := auth.AuthToken() // TODO Sign token
+ token := auth.BuildRestToken()
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token))
}
tlsConfig := &tls.Config{InsecureSkipVerify: true} | Get ready to sign the token for rest calls | control-center_serviced | train | go,go |
dc9ac40e2d0ddba385ea34f36219336216d5bb1d | diff --git a/src/bosh/platform/net/default_network_resolver_test.go b/src/bosh/platform/net/default_network_resolver_test.go
index <HASH>..<HASH> 100644
--- a/src/bosh/platform/net/default_network_resolver_test.go
+++ b/src/bosh/platform/net/default_network_resolver_test.go
@@ -36,6 +36,9 @@ var _ = Describe("defaultNetworkResolver", func() {
ifaceName = "en0"
} else if _, err := gonet.InterfaceByName("eth0"); err == nil {
ifaceName = "eth0"
+ // Travis CI uses venet0 as primary network interface
+ } else if _, err := gonet.InterfaceByName("venet0"); err == nil {
+ ifaceName = "venet0"
} else {
panic("Not sure which interface name to use: en0 and eth0 are not found")
} | Include venet0 as possible network interface for happy Travis builds | cloudfoundry_bosh-agent | train | go |
cd562b179478c5dbccef816ce1e0b0cd9610c1d7 | diff --git a/client-vendor/after-body/jquery.clickFeedback/jquery.clickFeedback.js b/client-vendor/after-body/jquery.clickFeedback/jquery.clickFeedback.js
index <HASH>..<HASH> 100644
--- a/client-vendor/after-body/jquery.clickFeedback/jquery.clickFeedback.js
+++ b/client-vendor/after-body/jquery.clickFeedback/jquery.clickFeedback.js
@@ -4,7 +4,7 @@
*/
(function($) {
- document.addEventListener('click', function(event) {
+ document.addEventListener('mousedown', function(event) {
var $elem = $(event.target).closest('.clickFeedback');
if ($elem.length) { | Replace click with mousedown in clickFeedback. | cargomedia_cm | train | js |
621599f8e29a7b3710e00444f1eb7ae14850788a | diff --git a/alot/ui.py b/alot/ui.py
index <HASH>..<HASH> 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -190,7 +190,6 @@ class UI(object):
Use a :class:`commands.globals.ExitCommand` for a clean shutdown.
"""
reactor.stop()
- raise urwid.ExitMainLoop()
def buffer_open(self, buf):
"""register and focus new :class:`~alot.buffers.Buffer`.""" | don't raise ExitMainLoop exception to exit
apparently, it suffices to stop the twisted
reactor when using TwistedEventLoop.
issue #<I> | pazz_alot | train | py |
60b042cba219ecbc0705cde100b587ff23d41b53 | diff --git a/src/Generators/Queries/PaginateAllQueryGenerator.php b/src/Generators/Queries/PaginateAllQueryGenerator.php
index <HASH>..<HASH> 100644
--- a/src/Generators/Queries/PaginateAllQueryGenerator.php
+++ b/src/Generators/Queries/PaginateAllQueryGenerator.php
@@ -73,8 +73,8 @@ class PaginateAllQueryGenerator
$inputType = sprintf("input %s {%s}", $inputTypeName, implode($arguments, " "));
$inputTypeArgument = sprintf('(input: %s)', $inputTypeName);
- $allQuery = sprintf(' %1$s%2$s: [%3$s]! @all(model: "%3$s")', strtolower($typeName), $inputTypeArgument, $returnType);
- $paginatedQuery = sprintf(' %1$sPaginated%2$s: [%3$s]! @paginate(model: "%3$s")', strtolower($typeName), $inputTypeArgument, $returnType);
+ $allQuery = sprintf(' %1$s%2$s: [%3$s]! @all(model: "%3$s", flatten: true)', strtolower($typeName), $inputTypeArgument, $returnType);
+ $paginatedQuery = sprintf(' %1$sPaginated%2$s: [%3$s]! @paginate(model: "%3$s", flatten: true)', strtolower($typeName), $inputTypeArgument, $returnType);
return new QueriesWithInput([$allQuery, $paginatedQuery], $inputType);
} | Flatten @paginate and @all queries
sadly, not yet supported by Lighthouse. Support ticket <URL> | deInternetJongens_Lighthouse-Utils | train | php |
af1087d0c4b79735b9a3983702d5f8b08a087ff8 | diff --git a/fritzconnection/tests/test_fritzconnection.py b/fritzconnection/tests/test_fritzconnection.py
index <HASH>..<HASH> 100644
--- a/fritzconnection/tests/test_fritzconnection.py
+++ b/fritzconnection/tests/test_fritzconnection.py
@@ -126,7 +126,16 @@ def test_write_api_to_cache(file_name, cache_format, datadir):
# 2. save the api data
cache_filename = f"x_tmp_cache_{file_name}"
cache_file = Path(cache_filename)
- cache_file.unlink(missing_ok=True) # in case of artefacts
+
+# TODO: (potentially)
+# code for Python >= 3.8:
+# cache_file.unlink(missing_ok=True) # in case of artefacts
+# code for Python < 3.8:
+ try:
+ cache_file.unlink()
+ except FileNotFoundError:
+ pass # ignore
+
FritzConnection._write_api_to_cache(mock, cache_filename, cache_format)
assert cache_file.exists() is True
# 3. read the api data to another mock | python <I>, <I> compatibility issue solved | kbr_fritzconnection | train | py |
b606078e9312e7dbb461bbbfc50e322471cdb63c | diff --git a/version/version.go b/version/version.go
index <HASH>..<HASH> 100644
--- a/version/version.go
+++ b/version/version.go
@@ -15,6 +15,6 @@
package version
var (
- Version = "2.0.0-rc.2"
+ Version = "2.0.0"
InternalVersion = "2"
) | version: bump to <I> | etcd-io_etcd | train | go |
a098a95d778fccfc1e823e9d2e136be3f10f1205 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -161,7 +161,7 @@ class RpcBlockTracker extends AsyncEventEmitter {
async _initSubscription() {
this._provider.on('data', this._handleNewBlockNotification)
- result = await pify(this._provider.sendAsync || this._provider.send)({
+ let result = await pify(this._provider.sendAsync || this._provider.send)({
jsonrpc: '2.0',
id: new Date().getTime(),
method: 'eth_subscribe', | Turns out defining variables is important. | MetaMask_eth-block-tracker | train | js |
2ef3021842706d90e515b515b436b16f429fe002 | diff --git a/shoebot/grammar/grammar.py b/shoebot/grammar/grammar.py
index <HASH>..<HASH> 100644
--- a/shoebot/grammar/grammar.py
+++ b/shoebot/grammar/grammar.py
@@ -69,11 +69,15 @@ class Grammar(object):
if iterations:
if iteration < iterations:
return True
+ elif len(self._namespace) > 0:
+ # Vars have been added in script
+ return True
elif iterations is None:
if self._dynamic:
return True
else:
return False
+ return True
if not self._dynamic:
### TODO... gtk window needs to run in another thread, that will keep
### going until explicitly closed | If user adds vars in script then it will run in loop until quit.
Makes sliders in color_example3 work. | shoebot_shoebot | train | py |
4c5c0c67f9179feb3ca19591d2fb589b77d19189 | diff --git a/Command/ImportTranslationsCommand.php b/Command/ImportTranslationsCommand.php
index <HASH>..<HASH> 100644
--- a/Command/ImportTranslationsCommand.php
+++ b/Command/ImportTranslationsCommand.php
@@ -155,9 +155,9 @@ class ImportTranslationsCommand extends ContainerAwareCommand
protected function importComponentTranslationFiles(array $locales, array $domains)
{
$classes = array(
- 'Symfony\Component\Validator\Validator' => '/Resources/translations',
+ 'Symfony\Component\Validator\Validation' => '/Resources/translations',
'Symfony\Component\Form\Form' => '/Resources/translations',
- 'Symfony\Component\Security\Core\Exception\AuthenticationException' => '/../../Resources/translations',
+ 'Symfony\Component\Security\Core\Exception\AuthenticationException' => '/../Resources/translations',
);
$dirs = array(); | Support for Symfony 3
Note that this commit keep the compatibility with Symfony > <I> | lexik_LexikTranslationBundle | train | php |
975f92b793fcf1f52512dc1335ce30d6c41031d4 | diff --git a/pac4j-core/src/main/java/org/pac4j/core/exception/MultipleAccountsFoundException.java b/pac4j-core/src/main/java/org/pac4j/core/exception/MultipleAccountsFoundException.java
index <HASH>..<HASH> 100644
--- a/pac4j-core/src/main/java/org/pac4j/core/exception/MultipleAccountsFoundException.java
+++ b/pac4j-core/src/main/java/org/pac4j/core/exception/MultipleAccountsFoundException.java
@@ -6,7 +6,7 @@ package org.pac4j.core.exception;
* @author Jerome Leleu
* @since 1.8.0
*/
-public class MultipleAccountsFoundException extends CredentialsException {
+public class MultipleAccountsFoundException extends TechnicalException {
private static final long serialVersionUID = 1430582289490541876L; | Multiple accounts are an abnormal situation -> TechnicalException | pac4j_pac4j | train | java |
dc148b4ecf59e6aa78dcd162a1cccd9ae5b1cf57 | diff --git a/src/cs50/sql.py b/src/cs50/sql.py
index <HASH>..<HASH> 100644
--- a/src/cs50/sql.py
+++ b/src/cs50/sql.py
@@ -1,4 +1,5 @@
import datetime
+import decimal
import importlib
import logging
import re
@@ -31,7 +32,6 @@ class SQL(object):
"""
Execute a SQL statement.
"""
-
class UserDefinedType(sqlalchemy.TypeDecorator):
"""
Add support for expandable values, a la https://bitbucket.org/zzzeek/sqlalchemy/issues/3953/expanding-parameter.
@@ -123,8 +123,14 @@ class SQL(object):
# if SELECT (or INSERT with RETURNING), return result set as list of dict objects
if re.search(r"^\s*SELECT", statement, re.I):
- rows = result.fetchall()
- return [dict(row) for row in rows]
+
+ # coerce any decimal.Decimal objects to float objects
+ rows = [dict(row) for row in result.fetchall()]
+ for row in rows:
+ for column in row:
+ if isinstance(row[column], decimal.Decimal):
+ row[column] = float(row[column])
+ return rows
# if INSERT, return primary key value for a newly inserted row
elif re.search(r"^\s*INSERT", statement, re.I): | coercing decimal.Decimal objects to float objects for PostgreSQL | cs50_python-cs50 | train | py |
cb24bc33408c07199e3907dba3d260777ebe52d7 | diff --git a/examples/scribuntoRemoteDebug.js b/examples/scribuntoRemoteDebug.js
index <HASH>..<HASH> 100644
--- a/examples/scribuntoRemoteDebug.js
+++ b/examples/scribuntoRemoteDebug.js
@@ -1,4 +1,4 @@
-var bot = require( 'nodemw' ),
+var Bot = require( 'nodemw' ),
readline = require( 'readline' ),
fs = require( 'fs' ),
rl = readline.createInterface( { | Fix unused and undefined vars | macbre_nodemw | train | js |
42ff239634f154ac5277d94c85ffd5fdc5dbce03 | diff --git a/bundle/Resources/public/js/app.js b/bundle/Resources/public/js/app.js
index <HASH>..<HASH> 100644
--- a/bundle/Resources/public/js/app.js
+++ b/bundle/Resources/public/js/app.js
@@ -298,7 +298,8 @@ $(document).ready(function () {
function LayoutsBox(el) {
this.$el = $(el);
this.csrf = $('meta[name=ngbm-admin-csrf-token]').attr('content');
- this.basePath = $('meta[name=ngbm-admin-base-path]').attr('content') + 'layouts/';
+ this.basePath = $('meta[name=ngbm-admin-base-path]').attr('content');
+ this.basePath += this.basePath.charAt(this.basePath.length - 1) !== '/' ? '/layouts/' : 'layouts/';
this.$content = this.$el.find('.layouts-box-content');
this.$loader = this.$el.find('.layout-loading');
this.fetchedLayouts = false; | fix ngbm-base-path - check for / at the end | netgen_NetgenAdminUIBundle | train | js |
d5587b8b117661391c5cad63ebe655aa10946e53 | diff --git a/angr/analyses/disassembly.py b/angr/analyses/disassembly.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/disassembly.py
+++ b/angr/analyses/disassembly.py
@@ -572,9 +572,8 @@ class Disassembly(Analysis):
self._func_cache = {}
if function is not None:
- blocks = function.graph.nodes()
# sort them by address, put hooks before nonhooks
- blocks.sort(key=lambda node: (node.addr, not node.is_hook))
+ blocks = sorted(function.graph.nodes(), key=lambda node: (node.addr, not node.is_hook))
for block in blocks:
self.parse_block(block) | Disassembly: Fix for NetworkX 2. | angr_angr | train | py |
8c45271bf9b9ddfaff27f2160ca1338db353b26c | diff --git a/flask_security/script.py b/flask_security/script.py
index <HASH>..<HASH> 100644
--- a/flask_security/script.py
+++ b/flask_security/script.py
@@ -100,7 +100,7 @@ class AddRoleCommand(_RoleCommand):
class RemoveRoleCommand(_RoleCommand):
- """Add a role to a user"""
+ """Remove a role from a user"""
@commit
def run(self, user_identifier, role_name): | Fix RemoveRoleCommand docstring | mattupstate_flask-security | train | py |
b2d35de40733a7590eca87451c638fb652d8f46c | diff --git a/index.ios.js b/index.ios.js
index <HASH>..<HASH> 100644
--- a/index.ios.js
+++ b/index.ios.js
@@ -50,7 +50,7 @@ exports.getContact = function (){
page.presentModalViewControllerAnimated(controller, true);
});
};
-exports.fetchContactsByName = function(searchPredicate){
+exports.getContactsByName = function(searchPredicate){
return new Promise(function (resolve, reject){
var store = new CNContactStore(),
error, | Update index.ios.js
Rename fetchContactsByName to getContactsByName.
Rename fetchAllContacts to getAllContacts. | firescript_nativescript-contacts | train | js |
1dddb66a1ec5dd558551c685351c4f610999ea56 | diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -108,7 +108,7 @@ class BotBase(GroupMixin):
self._help_command = None
self.description = inspect.cleandoc(description) if description else ''
self.owner_id = options.get('owner_id')
- self.owner_ids = options.get('owner_ids', {})
+ self.owner_ids = options.get('owner_ids', set())
if self.owner_id and self.owner_ids:
raise TypeError('Both owner_id and owner_ids are set.') | [commands] default Bot.owner_ids to a set
This appears to be a typo, as everywhere else, owner_ids is set to a set. | Rapptz_discord.py | train | py |
19e6d7e882c31ed85a931c1d4d9a4a428c7c1073 | diff --git a/test/snp/template_test.rb b/test/snp/template_test.rb
index <HASH>..<HASH> 100644
--- a/test/snp/template_test.rb
+++ b/test/snp/template_test.rb
@@ -8,5 +8,13 @@ describe Snp::Template do
template.resolve('template.erb').must_equal File.expand_path('~/.snp_templates/template.erb')
end
+
+ it 'uses SNP_PATH environment variable if it is set' do
+ ENV['SNP_PATH'] = '/snp:/etc/snp'
+ File.stubs(:exists?).returns(true)
+
+ template = Snp::Template.new
+ template.resolve('template.erb').must_equal '/snp/template.erb'
+ end
end
end | Assert that SNP_PATH is used if set. | rmascarenhas_snp | train | rb |
28465fd196d5a9b522b3f77e7f73180f516c652e | diff --git a/lib/monadic/maybe.rb b/lib/monadic/maybe.rb
index <HASH>..<HASH> 100644
--- a/lib/monadic/maybe.rb
+++ b/lib/monadic/maybe.rb
@@ -2,12 +2,12 @@ module Monadic
# @api private helps treating `Maybe` like Either in Scala
module ScalaStuff
def map(proc = nil, &block)
- return Maybe(@value.map(&block)) if @value.is_a?(Enumerable)
+ return Maybe(@value.map(&block)) if @value.is_a?(::Enumerable)
return Maybe((proc || block).call(@value))
end
def select(proc = nil, &block)
- return Maybe(@value.select(&block)) if @value.is_a?(Enumerable)
+ return Maybe(@value.select(&block)) if @value.is_a?(::Enumerable)
return Nothing unless (proc || block).call(@value)
return self
end | Make sure ::Enumerable is used | pzol_monadic | train | rb |
3f8955504f2cb920e0015d4bc367948f13472bf0 | diff --git a/lib/veritas/relation.rb b/lib/veritas/relation.rb
index <HASH>..<HASH> 100644
--- a/lib/veritas/relation.rb
+++ b/lib/veritas/relation.rb
@@ -122,11 +122,11 @@ module Veritas
def eql?(other)
instance_of?(other.class) &&
header.eql?(other.header) &&
- to_set.eql?(project_relation(other).to_set)
+ to_set == project_relation(other).to_set
end
def hash
- header.hash ^ to_set.hash
+ header.hash ^ to_a.hash
end
private
diff --git a/spec/unit/veritas/relation/hash_spec.rb b/spec/unit/veritas/relation/hash_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/veritas/relation/hash_spec.rb
+++ b/spec/unit/veritas/relation/hash_spec.rb
@@ -9,5 +9,5 @@ describe 'Veritas::Relation#hash' do
it { should be_kind_of(Integer) }
- it { should == @relation.header.hash ^ [].hash }
+ it { should == @relation.header.hash ^ @relation.to_a.hash }
end | Fixed failing specs in <I>
* This is due to differences in Set#eql? and Set#hash on <I> and
below, which are caused by broken behaviour in the corresponding
Hash methods.
A ticket was raised with the backports project in case it is possible
to fix this, so this commit can be reverted:
<URL> | dkubb_axiom | train | rb,rb |
b83bb0766586643058594ad1281ee33418c3de31 | diff --git a/test/integration_test.rb b/test/integration_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration_test.rb
+++ b/test/integration_test.rb
@@ -81,6 +81,6 @@ class IntegrationTest < Test::Unit::TestCase
it 'does not generate warnings' do
assert_raise(OpenURI::HTTPError) { server.get '/' }
server.get '/app_file'
- assert_empty server.warnings
+ assert_equal [], server.warnings
end
end
\ No newline at end of file | there is no assert_equal on <I> | sinatra_sinatra | train | rb |
a029c3da0d00e2de260fd586a2db309c11f112ed | diff --git a/nunaliit2-js/src/main/js/nunaliit2/n2.mapAndControls.js b/nunaliit2-js/src/main/js/nunaliit2/n2.mapAndControls.js
index <HASH>..<HASH> 100644
--- a/nunaliit2-js/src/main/js/nunaliit2/n2.mapAndControls.js
+++ b/nunaliit2-js/src/main/js/nunaliit2/n2.mapAndControls.js
@@ -5606,7 +5606,6 @@ var MapAndControls = $n2.Class({
};
// Prepare features to be added to layer
- var featuresToAdd = [];
state.added.forEach(function(f){
if( mustReproject ){
var geom = f.geometry; | nunaliit2-js: Fix issue where map layer from model is not redrawn
correctly when filter is changed. | GCRC_nunaliit | train | js |
2f56d4260d67d5ba7529b06dbbb9b005d0b6d2bd | diff --git a/hardware/opentrons_hardware/hardware_control/constants.py b/hardware/opentrons_hardware/hardware_control/constants.py
index <HASH>..<HASH> 100644
--- a/hardware/opentrons_hardware/hardware_control/constants.py
+++ b/hardware/opentrons_hardware/hardware_control/constants.py
@@ -2,5 +2,5 @@
from typing_extensions import Final
-interrupts_per_sec: Final = 170000
+interrupts_per_sec: Final = 100000
"""The number of motor interrupts per second.""" | refactor(CAN): <I>khz is the frequency of the interrupt. And the frequency of the interrupt is <I>khz. (#<I>) | Opentrons_opentrons | train | py |
8021e315b970c207c26cbd39e4705acad29a2c9d | diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/routes.rb
+++ b/spec/dummy/config/routes.rb
@@ -1,4 +1,6 @@
Rails.application.routes.draw do
mount CrowdblogCore::Engine => '/admin'
+
+ root to: 'crowdblog_core/posts#index'
end | Add default route for dummy app | crowdint_crowdblog | train | rb |
3d6fdc07555dc0b1393849288f2bb0b2ea1bb936 | diff --git a/zipline/utils/events.py b/zipline/utils/events.py
index <HASH>..<HASH> 100644
--- a/zipline/utils/events.py
+++ b/zipline/utils/events.py
@@ -412,7 +412,7 @@ class TradingDayOfWeekRule(six.with_metaclass(ABCMeta, StatelessRule)):
# calculate the list of periods that match the given criteria
return self.cal.schedule.groupby(
pd.Grouper(freq="W")
- ).nth(self.td_delta).index
+ ).nth(int(self.td_delta)).index
def should_trigger(self, dt):
# is this market minute's period in the list of execution periods?
@@ -456,7 +456,7 @@ class TradingDayOfMonthRule(six.with_metaclass(ABCMeta, StatelessRule)):
# calculate the list of periods that match the given criteria
return self.cal.schedule.groupby(
pd.Grouper(freq="M")
- ).nth(self.td_delta).index
+ ).nth(int(self.td_delta)).index
class NthTradingDayOfMonth(TradingDayOfMonthRule): | Make sure we are passing ints to nth. | quantopian_zipline | train | py |
5f304a7336145dcc5a98fde2e4734ff82743c1ae | diff --git a/spec/rdkafka/producer/client_spec.rb b/spec/rdkafka/producer/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rdkafka/producer/client_spec.rb
+++ b/spec/rdkafka/producer/client_spec.rb
@@ -42,13 +42,13 @@ describe Rdkafka::Producer::Client do
it "polls the native with default 250ms timeout" do
polling_loop_expects do
- expect(Rdkafka::Bindings).to receive(:rd_kafka_poll).with(instance_of(FFI::Pointer), 250)
+ expect(Rdkafka::Bindings).to receive(:rd_kafka_poll).with(instance_of(FFI::Pointer), 250).at_least(:once)
end
end
it "check the out queue of native client" do
polling_loop_expects do
- expect(Rdkafka::Bindings).to receive(:rd_kafka_outq_len).with(native)
+ expect(Rdkafka::Bindings).to receive(:rd_kafka_outq_len).with(native).at_least(:once)
end
end
end | Loosen stub in a spec | appsignal_rdkafka-ruby | train | rb |
d2e15d1df0366bf5d8adcecba292667a89d20821 | diff --git a/src/Webiny/Component/StdLib/StdObject/ArrayObject/ValidatorTrait.php b/src/Webiny/Component/StdLib/StdObject/ArrayObject/ValidatorTrait.php
index <HASH>..<HASH> 100755
--- a/src/Webiny/Component/StdLib/StdObject/ArrayObject/ValidatorTrait.php
+++ b/src/Webiny/Component/StdLib/StdObject/ArrayObject/ValidatorTrait.php
@@ -55,6 +55,22 @@ trait ValidatorTrait
}
/**
+ * Check if all given keys exist in the array
+ *
+ * @param array $keys
+ *
+ * @return bool
+ */
+ public function keysExist($keys = []){
+ foreach($keys as $key){
+ if(!$this->keyExists($key)){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
* Checks if $key exists in current array as index. If it exists, true is returned.
* If the $key doesn't exist, $default is returned.
* This method supports nested keys access: 'level1.level2.level3' | keysExist() method to check array for presence of multiple keys at once. | Webiny_Framework | train | php |
9d2e6aa85a93e56113157a2cb9ef729b497b54d6 | diff --git a/src/Http/Routes/Squads/Routes.php b/src/Http/Routes/Squads/Routes.php
index <HASH>..<HASH> 100644
--- a/src/Http/Routes/Squads/Routes.php
+++ b/src/Http/Routes/Squads/Routes.php
@@ -56,7 +56,7 @@ Route::prefix('/{squad}')
// update a squad
Route::put('/')
->name('squads.update')
- ->uses('SquadsController@udpate')
+ ->uses('SquadsController@update')
->middleware('can:squads.edit,squad');
// remove a squad | fix(squads): address a typo in update route | eveseat_web | train | php |
479d38ba02f553550c6cd2b7133a1a140a361080 | diff --git a/plumbing/transport/ssh/common.go b/plumbing/transport/ssh/common.go
index <HASH>..<HASH> 100644
--- a/plumbing/transport/ssh/common.go
+++ b/plumbing/transport/ssh/common.go
@@ -4,11 +4,13 @@ package ssh
import (
"fmt"
"reflect"
+ "strconv"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/plumbing/transport/internal/common"
"golang.org/x/crypto/ssh"
+ "github.com/kevinburke/ssh_config"
)
// DefaultClient is the default SSH client.
@@ -122,7 +124,20 @@ func (c *command) connect() error {
func (c *command) getHostWithPort() string {
host := c.endpoint.Host
+
+ configHost := ssh_config.Get(host, "Hostname")
+ if (configHost != "") {
+ host = configHost
+ }
+
port := c.endpoint.Port
+ configPort := ssh_config.Get(host, "Port")
+ if (configPort != "") {
+ i, err := strconv.Atoi(configPort)
+ if err != nil {
+ port = i
+ }
+ }
if port <= 0 {
port = DefaultPort
} | check .ssh/config for host and port overrides; fixes #<I> | src-d_go-git | train | go |
a3ddc0b6fb5a2c14b941a0e6682cde76355416e5 | diff --git a/public/javascript/pump/model.js b/public/javascript/pump/model.js
index <HASH>..<HASH> 100644
--- a/public/javascript/pump/model.js
+++ b/public/javascript/pump/model.js
@@ -551,13 +551,18 @@
if (nl || pl) {
var ndone = false,
- pdone = false;
+ nerror = false,
+ pdone = false,
+ perror = false;
stream.getAllNext(function(err) {
+ ndone = true;
if (err) {
- callback(err);
+ nerror = true;
+ if (!perror) {
+ callback(err);
+ }
} else {
- ndone = true;
if (pdone) {
callback(null);
}
@@ -565,10 +570,13 @@
});
stream.getAllPrev(function(err) {
+ pdone = true;
if (err) {
- callback(err);
+ perror = true;
+ if (!nerror) {
+ callback(err);
+ }
} else {
- pdone = true;
if (ndone) {
callback(null);
} | check for errors in getallnext/prev | pump-io_pump.io | train | js |
97ad1a9b087e35e37b00f5331048ae90e6f458cc | diff --git a/src/Rocketeer/RocketeerServiceProvider.php b/src/Rocketeer/RocketeerServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/RocketeerServiceProvider.php
+++ b/src/Rocketeer/RocketeerServiceProvider.php
@@ -359,7 +359,7 @@ class RocketeerServiceProvider extends ServiceProvider
}
// Else include its contents
- else {
+ elseif (is_dir($file)) {
$folder = glob($file.'/*.php');
foreach ($folder as $file) {
include $file; | Check if dir exists before glob()
I get an Invalid argument supplied for foreach() exception otherwise (on 1 system, other system works fine) (on develop this time) | rocketeers_rocketeer | train | php |
da3dc703ff48f8c7d48b0a33c13e375e2bafd581 | diff --git a/test/support/glfw_window_stub.rb b/test/support/glfw_window_stub.rb
index <HASH>..<HASH> 100644
--- a/test/support/glfw_window_stub.rb
+++ b/test/support/glfw_window_stub.rb
@@ -6,7 +6,7 @@ module Mittsu
attr_accessor :key_press_handler, :key_release_handler, :key_repeat_handler, :char_input_handler, :cursor_pos_handler, :mouse_button_press_handler, :mouse_button_release_handler, :scroll_handler, :framebuffer_size_handler
def initialize(width, height, title, antialias)
- @width, @height, @title @antialias = width, height, title, antialias
+ @width, @height, @title, @antialias = width, height, title, antialias
end
def run | Missed a test file update | jellymann_mittsu | train | rb |
e9fc4891c40558cf02d806aa1b9c916e484afcf2 | diff --git a/lib/babble.js b/lib/babble.js
index <HASH>..<HASH> 100644
--- a/lib/babble.js
+++ b/lib/babble.js
@@ -232,7 +232,7 @@ exports.babblify = function (actor, params) {
// attach receive function to the babbler
var receiveName = params && params.receive || 'receive';
- var receiveOriginal = actor[receiveName] || null;
+ var receiveOriginal = actor.hasOwnProperty(receiveName) ? actor[receiveName] : null;
if (receiveOriginal) {
actor[receiveName] = function (from, message) {
babbler._receive(message);
@@ -283,7 +283,7 @@ exports.unbabblify = function (actor) {
delete actor.listenOnce;
delete actor[__babbler__.receiveName];
- // restore any original receive method
+ // restore any original receiveOriginal method
if (__babbler__.receiveOriginal) {
actor[__babbler__.receiveName] = __babbler__.receiveOriginal;
} | Fixed restoring `receive` method | enmasseio_babble | train | js |
240b009010e47206bd11381e197d060c3578c685 | diff --git a/hug/_version.py b/hug/_version.py
index <HASH>..<HASH> 100644
--- a/hug/_version.py
+++ b/hug/_version.py
@@ -27,4 +27,4 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
OTHER DEALINGS IN THE SOFTWARE.
"""
-current = "0.0.6"
+current = "0.0.8"
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ except (IOError, ImportError, OSError, RuntimeError):
readme = ''
setup(name='hug',
- version='0.0.7',
+ version='0.0.8',
description='A Python framework that makes developing APIs as simple as possible, but no simpler.',
long_description=readme,
author='Timothy Crosley', | Bump release to <I> | hugapi_hug | train | py,py |
cb057292155f0a0af2cf089c147a1849855e0908 | diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100755
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -8438,16 +8438,6 @@
return FS_Logger::get_logger( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id );
}
- /**
- * @param $id
- * @param bool $load_options
- * @param bool $prefix_slug
- *
- * @return FS_Option_Manager
- */
- function get_options_manager( $id, $load_options = false, $prefix_slug = true ) {
- return FS_Option_Manager::get_manager( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id, $load_options );
- }
/* Security
------------------------------------------------------------------------------------------------------------------*/ | [cleanup] Removed an unused method. | Freemius_wordpress-sdk | train | php |
cf2cb775f71c3a1dc73fad0f1704b86853382c10 | diff --git a/lib/readingtime/version.rb b/lib/readingtime/version.rb
index <HASH>..<HASH> 100644
--- a/lib/readingtime/version.rb
+++ b/lib/readingtime/version.rb
@@ -1,3 +1,3 @@
module Readingtime
- VERSION = "0.0.5"
+ VERSION = "0.1.0"
end | VERSION <I>
reading_time can now accept options | garethrees_readingtime | train | rb |
f9335c35a97c4f912524a651bb81448f8490a204 | diff --git a/testsuite.py b/testsuite.py
index <HASH>..<HASH> 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -233,8 +233,6 @@ def run_selftests():
verify_string_bad(r""" "foo """)
verify_string_bad(r""" 'foo """)
- # TODO: Kmodifiable gone, test assignable
-
print("Testing expression evaluation") | Remove outdated TODO comment
Tests for .assignable have been added. | ulfalizer_Kconfiglib | train | py |
24875345b9901c06932ae0c285323888cae70360 | diff --git a/thinc/about.py b/thinc/about.py
index <HASH>..<HASH> 100644
--- a/thinc/about.py
+++ b/thinc/about.py
@@ -1,2 +1,2 @@
-__version__ = "8.0.0.dev0"
+__version__ = "8.0.0.dev1"
__release__ = True | Set version to <I>.dev1 | explosion_thinc | train | py |
75b1831d62c18e8a334d61f62f6e1f359e60a8f2 | diff --git a/bcbio/pipeline/config_loader.py b/bcbio/pipeline/config_loader.py
index <HASH>..<HASH> 100644
--- a/bcbio/pipeline/config_loader.py
+++ b/bcbio/pipeline/config_loader.py
@@ -36,26 +36,17 @@ def load_config(config_file):
"""
with open(config_file) as in_handle:
config = yaml.load(in_handle)
-
- for field, setting in config.items():
- try:
- config[field] = expand_path(setting)
- except AttributeError:
- pass
-
- try:
- for sub_field, sub_setting in config[field].items():
- config[field][sub_field] = expand_path(sub_setting)
- except AttributeError:
- pass
+ for field, setting in config.items():
+ config[field] = expand_path(setting)
+ for sub_field, sub_setting in config[field].items():
+ config[field][sub_field] = expand_path(sub_setting)
return config
def expand_path(path):
""" Combines os.path.expandvars with replacing ~ with $HOME.
"""
try:
- new_path = os.path.expandvars(path.replace("~", "$HOME"))
- return new_path
+ return os.path.expandvars(path.replace("~", "$HOME"))
except AttributeError:
- raise AttributeError("Not a path string")
\ No newline at end of file
+ return path | Catch and deal with non-string attribute error in a single location | bcbio_bcbio-nextgen | train | py |
07d6287e8e7d9a9b2eba8a63eb1b1984cbc467da | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -77,7 +77,7 @@ setup(name='crc32c',
author='The ICRAR DIA Team',
url='https://github.com/ICRAR/crc32c',
author_email='[email protected]',
- version='1.5',
+ version='1.6',
license="LGPLv2.1+",
description='A python package exposing the Intel SSE4.2 CRC32C instruction',
long_description=long_description, | crc<I>c <I>
This new version brings build fixes for non-intel platforms (patch by
Jeremy Lainé), new supported values for the CRC<I>C_SW_MODE environment
variable, and build support for the Intel compiler. | ICRAR_crc32c | train | py |
da71b0ac923fa6332d62cd06c37c6c855aa5d0a7 | diff --git a/aaf2/cfb.py b/aaf2/cfb.py
index <HASH>..<HASH> 100644
--- a/aaf2/cfb.py
+++ b/aaf2/cfb.py
@@ -1135,8 +1135,12 @@ class CompoundFileBinary(object):
sector_type = fat_sector_types.get(sid, sid)
if not isinstance(sector_type, int):
+ continue
+ # some files write zero difat instead of FREESECT
+ if sid <= 0:
continue
+
fat_sectors.append(sid)
# len(fat_sectors),self.fat_sector_count | fix files were difat is zero instead of FREESECT | markreidvfx_pyaaf2 | train | py |
eade5ec175c38459815086b9def130752e24b699 | diff --git a/leveldb/table/reader.go b/leveldb/table/reader.go
index <HASH>..<HASH> 100644
--- a/leveldb/table/reader.go
+++ b/leveldb/table/reader.go
@@ -581,6 +581,7 @@ func (r *Reader) readRawBlock(bh blockHandle, verifyChecksum bool) ([]byte, erro
case blockTypeSnappyCompression:
decLen, err := snappy.DecodedLen(data[:bh.length])
if err != nil {
+ r.bpool.Put(data)
return nil, r.newErrCorruptedBH(bh, err.Error())
}
decData := r.bpool.Get(decLen) | Fix readRawBlock: a forgotten BufferPool Put (#<I>) | syndtr_goleveldb | train | go |
2f417a04f464ef7b253d7239bc7333a56620ea25 | diff --git a/src/storage/get-id-from-url.js b/src/storage/get-id-from-url.js
index <HASH>..<HASH> 100644
--- a/src/storage/get-id-from-url.js
+++ b/src/storage/get-id-from-url.js
@@ -2,22 +2,23 @@ import configs from '../core/configs.js'
// constants
var URL_TO_ID_CACHE = {}
-var IS_URL = new RegExp(
- '^(http(s?))\\:\\/\\/(' +
- configs.storageDomain +
- '|' +
- configs.storageDomainNoCdn +
- ')'
-)
// main
export default function getStorageIdFromUrl(url) {
// check cache
if (URL_TO_ID_CACHE[url]) return URL_TO_ID_CACHE[url]
+ var isStorageRegexp = new RegExp(
+ '^(http(s?))\\:\\/\\/(' +
+ configs.storageDomain +
+ '|' +
+ configs.storageDomainNoCdn +
+ ')'
+ )
+
// check if url is valid url
- if (IS_URL.test(url)) {
- var storageId = url.replace(IS_URL, '')
+ if (isStorageRegexp.test(url)) {
+ var storageId = url.replace(isStorageRegexp, '')
// add to cache
URL_TO_ID_CACHE[url] = storageId
return storageId | create regexp on runtine (as config might change on runtime) | archilogic-com_3dio-js | train | js |
0492ab795506db4a5f21aaaa0c42264e061fa733 | diff --git a/code/editor/FieldEditor.php b/code/editor/FieldEditor.php
index <HASH>..<HASH> 100755
--- a/code/editor/FieldEditor.php
+++ b/code/editor/FieldEditor.php
@@ -26,8 +26,8 @@ class FieldEditor extends FormField {
}
function Fields() {
- Requirements::css(SAPPHIRE_DIR . "/css/FieldEditor.css");
- Requirements::javascript(SAPPHIRE_DIR . "/javascript/FieldEditor.js");
+ Requirements::css("userform/css/FieldEditor.css");
+ Requirements::javascript("userform/javascript/FieldEditor.js");
$relationName = $this->name; | BUGFIX: wrong path to javascript and stylesheet | silverstripe_silverstripe-userforms | train | php |
432cc930198775b0cb2b54df0ca5a14a9cedce09 | diff --git a/client/daemon.go b/client/daemon.go
index <HASH>..<HASH> 100644
--- a/client/daemon.go
+++ b/client/daemon.go
@@ -18,7 +18,7 @@ var (
},
cli.StringFlag{
Name: "log",
- Usage: "specific output log file, otherwise output to stderr by default",
+ Usage: "specific output log file, otherwise output to stdout by default",
},
cli.StringFlag{
Name: "root",
diff --git a/daemon/daemon.go b/daemon/daemon.go
index <HASH>..<HASH> 100644
--- a/daemon/daemon.go
+++ b/daemon/daemon.go
@@ -202,7 +202,7 @@ func daemonEnvironmentSetup(c *cli.Context) error {
logrus.SetFormatter(&logrus.JSONFormatter{})
logrus.SetOutput(logFile)
} else {
- logrus.SetOutput(os.Stderr)
+ logrus.SetOutput(os.Stdout)
}
return nil | daemon: Update default log output to stdout rather than stderr
client log still remain at stderr, since we won't want it to interfere with
return result. | rancher_convoy | train | go,go |
c7980b5ee08d7dc374e969bbb62fb95d07a44b90 | diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -101,11 +101,21 @@ module Minitest
end
end
end
+
+ class JSISpecReporter < Minitest::Reporters::SpecReporter
+ def record_print_status(test)
+ test_name = test.name.gsub(/^test_: /, 'test:')
+ print pad_test(test_name)
+ print_colored_status(test)
+ print(" (#{format_duration(test.time, sigfig: 2)})") unless test.time.nil?
+ puts
+ end
+ end
end
mkreporters = {
'spec' => -> {
- Minitest::Reporters::SpecReporter.new
+ Minitest::JSISpecReporter.new
},
'default' => -> {
Minitest::Reporters::DefaultReporter.new( | test helper Spec Reporter prints record status with format_duration, 2 sigfigs | notEthan_jsi | train | rb |
02829292efa4fc0a8a93713f3ec2959841ec6ee0 | diff --git a/src/get.js b/src/get.js
index <HASH>..<HASH> 100644
--- a/src/get.js
+++ b/src/get.js
@@ -40,7 +40,7 @@ class Get {
}
const obj = {};
- obj.rowkey = hbaseRowData.row.toString();
+ obj.rowkey = hbaseRowData.row ? hbaseRowData.row.toString() : null;
_.each(hbaseRowData.columnValues, colVal => {
const family = colVal.family.toString();
const qualName = colVal.qualifier.toString(); | in case row was not found didn't handle null row key | exposebox_node-thrift2-hbase | train | js |
88adbbd86c508df1220b4b0075c85fab643fe495 | diff --git a/lib/coverage-instrumenter.js b/lib/coverage-instrumenter.js
index <HASH>..<HASH> 100644
--- a/lib/coverage-instrumenter.js
+++ b/lib/coverage-instrumenter.js
@@ -97,7 +97,11 @@ CoverageInstrumenter.prototype.processString = function(content, relativePath) {
relativePath = fixPath(relativePath, this._appName, this._appRoot, this._templateExtensions);
- return instrumenter.instrumentSync(content, relativePath);
+ try {
+ return instrumenter.instrumentSync(content, relativePath);
+ } catch (e) {
+ console.error('Unable to cover:', relativePath, '. Try setting useBabelInstrumenter to true. \n', e.stack);
+ }
};
module.exports = CoverageInstrumenter; | Try catch around instrumenter. So it spits out a clearer error | kategengler_ember-cli-code-coverage | train | js |
96233555a7406c17f5b6f09b86e2bfc68ac75bef | diff --git a/tests/Sulu/Component/Content/Mapper/ContentMapperTest.php b/tests/Sulu/Component/Content/Mapper/ContentMapperTest.php
index <HASH>..<HASH> 100644
--- a/tests/Sulu/Component/Content/Mapper/ContentMapperTest.php
+++ b/tests/Sulu/Component/Content/Mapper/ContentMapperTest.php
@@ -56,8 +56,13 @@ class ContentMapperTest extends \PHPUnit_Framework_TestCase
$this->session->save();
$cmf = $this->session->getRootNode()->addNode('cmf');
- $cmf->addNode('routes');
- $cmf->addNode('contents');
+ $cmf->addMixin('mix:referenceable');
+
+ $routes = $cmf->addNode('routes');
+ $routes->addMixin('mix:referenceable');
+
+ $contents = $cmf->addNode('contents');
+ $contents->addMixin('mix:referenceable');
$this->session->save();
} | changed added referenceable to base nodes | sulu_sulu | train | php |
ac2155752e4c3651dfebf2ba6a337aa6e4bade5f | diff --git a/src/js/remote.js b/src/js/remote.js
index <HASH>..<HASH> 100644
--- a/src/js/remote.js
+++ b/src/js/remote.js
@@ -385,15 +385,14 @@ Remote.prototype._connect_start = function () {
self._connect_retry();
};
-
- // Node's ws module doesn't pass arguments to onmessage.
- ws.on('message', function (json, flags) {
- self._connect_message(ws, json, flags);
- });
+
+ ws.onmessage = function (json) {
+ self._connect_message(ws, json.data);
+ };
};
// It is possible for messages to be dispatched after the connection is closed.
-Remote.prototype._connect_message = function (ws, json, flags) {
+Remote.prototype._connect_message = function (ws, json) {
var message = JSON.parse(json);
var unexpected = false;
var request; | Change from ws.on('message') to ws.onmessage for browser compat. | ChainSQL_chainsql-lib | train | js |
Subsets and Splits