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
|
---|---|---|---|---|---|
6d4a7c87ca6b4f2141fca1bbca9fca9abc7efcbd | diff --git a/Generator/EntityTypeBase.php b/Generator/EntityTypeBase.php
index <HASH>..<HASH> 100644
--- a/Generator/EntityTypeBase.php
+++ b/Generator/EntityTypeBase.php
@@ -280,6 +280,8 @@ abstract class EntityTypeBase extends PHPClassFile {
* property.
* - 'component_type': (optional) The component type to use. Defaults to
* EntityHandler.
+ * - 'handler_properties': (optional) An array of property names and values
+ * to be set verbatim on the requested component.
* - 'base_class': The base class for handlers of this type.
* - 'mode': Defines how the core entity system handles an entity not
* defining a handler of this type. One of:
@@ -424,6 +426,10 @@ abstract class EntityTypeBase extends PHPClassFile {
$this->makeShortHandlerClassName($key, $handler_type_info),
],
];
+
+ if (isset($handler_type_info['handler_properties'])) {
+ $components[$data_key] += $handler_type_info['handler_properties'];
+ }
}
// Atrocious hack! | Added option for entity handler type definition to set further properties on the requested handler class component. | drupal-code-builder_drupal-code-builder | train | php |
dd75c49664917124e07e016f79ff4968566ffd04 | diff --git a/examples/swiss_roll.py b/examples/swiss_roll.py
index <HASH>..<HASH> 100644
--- a/examples/swiss_roll.py
+++ b/examples/swiss_roll.py
@@ -5,7 +5,7 @@ from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import pairwise_distances
from time import time
-from graphs.generators.swiss_roll import swiss_roll
+from graphs.datasets.swiss_roll import swiss_roll
from graphs.construction import (
neighbor_graph, b_matching, gabriel_graph,
relative_neighborhood_graph, manifold_spanning_graph, | Fixing import path
[ci skip] | all-umass_graphs | train | py |
1b4f87f75eb715a66952c6621e31112b442ec907 | diff --git a/src/parsetree.js b/src/parsetree.js
index <HASH>..<HASH> 100644
--- a/src/parsetree.js
+++ b/src/parsetree.js
@@ -2140,7 +2140,15 @@ module.exports = {
isTraceryExpr: isTraceryExpr,
isProbExpr: isProbExpr,
isEvalVar: isEvalVar,
+
isChoiceExpr: isChoiceExpr,
+ isProposeExpr: isProposeExpr,
+ isAcceptExpr: isAcceptExpr,
+ isRejectExpr: isRejectExpr,
+ choiceExprProposeRhs: choiceExprProposeRhs,
+ choiceExprAcceptRhs: choiceExprAcceptRhs,
+ choiceExprRejectRhs: choiceExprRejectRhs,
+
makeSugaredName: makeSugaredName,
makeRhsText: makeRhsText,
makeRhsTree: makeRhsTree, | exposed some internals for handling &choice clauses | ihh_bracery | train | js |
1d515606f24e9d62b8321be0f2421c45ad483a62 | diff --git a/lib/inspectors/data.js b/lib/inspectors/data.js
index <HASH>..<HASH> 100644
--- a/lib/inspectors/data.js
+++ b/lib/inspectors/data.js
@@ -221,10 +221,9 @@ module.exports = function(req, res, next) {
if (reqDelay > 0) {
return setTimeout(function() {
res.destroy();
- next();
}, reqDelay);
}
- res.destroy();
+ return res.destroy();
}
next();
}; | feat: allow to abort request | avwo_whistle | train | js |
8c980857e8d0cd82d90a296c024988cb3b05fda3 | diff --git a/lib/lit/adapters/redis_storage.rb b/lib/lit/adapters/redis_storage.rb
index <HASH>..<HASH> 100644
--- a/lib/lit/adapters/redis_storage.rb
+++ b/lib/lit/adapters/redis_storage.rb
@@ -32,6 +32,12 @@ module Lit
Lit.redis.exists(_prefixed_key(key))
end
+ def sort
+ Lit.redis.keys.sort.map do |k|
+ [k, self.[](k)]
+ end
+ end
+
private
def _prefixed_key(key="")
prefix = "lit:" | sort for redis storage - added to support lit:export task (returns array of [k,v]) | prograils_lit | train | rb |
e88bda7454ea5dbe84dd42d1a5501fefbb8d6f00 | diff --git a/navigation/src/main/java/com/graphhopper/navigation/DistanceUtils.java b/navigation/src/main/java/com/graphhopper/navigation/DistanceUtils.java
index <HASH>..<HASH> 100644
--- a/navigation/src/main/java/com/graphhopper/navigation/DistanceUtils.java
+++ b/navigation/src/main/java/com/graphhopper/navigation/DistanceUtils.java
@@ -23,7 +23,7 @@ public class DistanceUtils {
static float meterToMiles = 0.00062137f;
static float meterToKilometer = 0.001f;
- enum Unit {
+ public enum Unit {
METRIC,
IMPERIAL
} | Set Unit public (#<I>) | graphhopper_graphhopper | train | java |
af8e6bd5750d8630d4ac5ae70efede90940cd207 | diff --git a/AlphaTwirl/EventReader/Collector.py b/AlphaTwirl/EventReader/Collector.py
index <HASH>..<HASH> 100755
--- a/AlphaTwirl/EventReader/Collector.py
+++ b/AlphaTwirl/EventReader/Collector.py
@@ -21,7 +21,7 @@ class Collector(object):
def __init__(self, resultsCombinationMethod, deliveryMethod):
self.resultsCombinationMethod = resultsCombinationMethod
- self.deliveryMethod = deliveryMethod
+ self.deliveryMethod = deliveryMethod if deliveryMethod is not None else NullDeliveryMethod()
self._datasetReaderPairs = [ ]
@@ -34,3 +34,7 @@ class Collector(object):
return results
##__________________________________________________________________||
+class NullDeliveryMethod(object):
+ def deliver(self, results): pass
+
+##__________________________________________________________________|| | add NullDeliveryMethod and use it in Collector | alphatwirl_alphatwirl | train | py |
0b987042bf611330609304a22465d0f30f026076 | diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -224,19 +224,11 @@ module ActionDispatch
end
def default_controller
- if @options[:controller]
- @options[:controller]
- elsif @scope[:controller]
- @scope[:controller]
- end
+ @options[:controller] || @scope[:controller]
end
def default_action
- if @options[:action]
- @options[:action]
- elsif @scope[:action]
- @scope[:action]
- end
+ @options[:action] || @scope[:action]
end
end | simplify conditionals by assuming hash values will never be `false` | rails_rails | train | rb |
a775025e37a789739d2349deb0ead2c0cebbc305 | diff --git a/python_translate/loaders.py b/python_translate/loaders.py
index <HASH>..<HASH> 100644
--- a/python_translate/loaders.py
+++ b/python_translate/loaders.py
@@ -86,7 +86,7 @@ class FileMixin(object):
self.assert_valid_path(path)
- with open(path, 'r') as file:
+ with open(path, 'r', encoding='utf-8') as file:
contents = file.read()
return contents
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name="python-translate",
- version="1.0.13",
+ version="1.0.14",
author="Adam Zieliński",
author_email="[email protected]",
packages=find_packages(), | Default encoding for file loader | adamziel_python_translate | train | py,py |
4a24202090cababa0b530c753512b871cadb2d39 | diff --git a/Routing/RestRouteCollection.php b/Routing/RestRouteCollection.php
index <HASH>..<HASH> 100644
--- a/Routing/RestRouteCollection.php
+++ b/Routing/RestRouteCollection.php
@@ -62,7 +62,10 @@ class RestRouteCollection extends RouteCollection
public function setDefaultFormat($format)
{
foreach (parent::all() as $route) {
- $route->setDefault('_format', $format);
+ // Set default format only if not set already (could be defined in annotation)
+ if(!$route->getDefault('_format')) {
+ $route->setDefault('_format', $format);
+ }
}
} | Setting default format in RestRouteCollection.php only if not set already
This change allows annotations set default format which won't be overriden in RestRouteLoader::load() | FriendsOfSymfony_FOSRestBundle | train | php |
d43f6e840314ebc6251c0a44d2acd65d303eec38 | diff --git a/admin/Controller/Login.php b/admin/Controller/Login.php
index <HASH>..<HASH> 100644
--- a/admin/Controller/Login.php
+++ b/admin/Controller/Login.php
@@ -24,8 +24,7 @@ class Login_Controller extends core\Controller implements Logout_Required
if (!$this->form->errors()
&& !($error = $this->user->login($this->form))
) {
- $acl = $this->user->acl;
- if ($acl->using('monad')->can($acl::READ)) {
+ if ($this->user->loggedIn()) {
if ($redir = $this->http->getRedir()) {
$redir = urldecode($redir);
if ($redir != $this->http->getSelf()) { | this check is now deprecated and part of the user model | monomelodies_monad | train | php |
285585084f25cda29c45ca6304f1b2d34d2611d7 | diff --git a/filesystems/tests/common.py b/filesystems/tests/common.py
index <HASH>..<HASH> 100644
--- a/filesystems/tests/common.py
+++ b/filesystems/tests/common.py
@@ -996,7 +996,7 @@ class TestFS(object):
fs.link(source=zero.descendant("1"), to=one)
fs.create_directory(path=two)
fs.create_directory(path=two.descendant("3"))
- self.assertEqual(fs.list_directory(two), s("3"))
+ self.assertEqual(set(fs.list_directory(two)), {"3"})
def test_list_file(self):
fs = self.FS() | Whoops, this is just an iterable. | Julian_Filesystems | train | py |
2bff94eb0ac09dc0dbcaf1a957d889fbaf9f4573 | diff --git a/webroot/js/helper.js b/webroot/js/helper.js
index <HASH>..<HASH> 100644
--- a/webroot/js/helper.js
+++ b/webroot/js/helper.js
@@ -962,7 +962,7 @@ foodcoopshop.Helper = {
var progressBarHtml = '<div class="progress">';
progressBarHtml += '<div class="progress-bar bg-success" style="width:0%;"></div>';
- progressBarHtml += '<div class="progress-bar bg-white" style="width:100%;"></div>';
+ progressBarHtml += '<div class="progress-bar bg-white" style="background-color:#fff;width:100%;"></div>';
progressBarHtml += '</div>';
$('#flashMessage.success').append(progressBarHtml);
@@ -979,7 +979,7 @@ foodcoopshop.Helper = {
duration: duration,
easing: 'linear',
}
- );
+ );
$('#flashMessage.success .progress-bar.bg-white')
.animate({
'width': '0%',
@@ -988,7 +988,7 @@ foodcoopshop.Helper = {
duration: duration,
easing: 'linear',
}
- );
+ );
setTimeout(function() {
$('#flashMessage.success a.closer').trigger('click'); | keep white bg color even if css is packed | foodcoopshop_foodcoopshop | train | js |
dd98a55e3eeaa039f8ad7afafa5677195e7754a8 | diff --git a/tftp_test.go b/tftp_test.go
index <HASH>..<HASH> 100644
--- a/tftp_test.go
+++ b/tftp_test.go
@@ -99,6 +99,15 @@ func TestNearBlockLength(t *testing.T) {
}
}
+func TestBlockWrapsAround(t *testing.T) {
+ s, c := makeTestServer()
+ defer s.Shutdown()
+ n := 65535 * 512
+ for i := n - 2; i < n+2; i++ {
+ testSendReceive(t, c, int64(i))
+ }
+}
+
func TestRandomLength(t *testing.T) {
s, c := makeTestServer()
defer s.Shutdown() | test with large object so block number wraps around | pin_tftp | train | go |
2e0d2f7318fbba424f89fda142444f140bbb49d8 | diff --git a/src/Handler/Pdo.php b/src/Handler/Pdo.php
index <HASH>..<HASH> 100644
--- a/src/Handler/Pdo.php
+++ b/src/Handler/Pdo.php
@@ -3,6 +3,7 @@
namespace Monolyth\Cesession\Handler;
use Monolyth\Cesession\Handler;
+use PDOException;
class Pdo implements Handler
{
@@ -69,8 +70,13 @@ class Pdo implements Handler
return (bool)$update->rowCount();
} else {
$delete->execute(compact('id'));
- $create->execute($values);
- return ($affectedRows = $create->rowCount()) && $affectedRows;
+ try {
+ $create->execute($values);
+ return ($affectedRows = $create->rowCount()) && $affectedRows;
+ } catch (PDOException $e) {
+ $update->execute($values);
+ return (bool)$update->rowCount();
+ }
}
} | this had a race condition where actually the session might be inserted already by another process just in between | monolyth-php_cesession | train | php |
16c7d9ed23be70a9f298ad7856a876ed404efe34 | diff --git a/src/Message/SecureXMLResponse.php b/src/Message/SecureXMLResponse.php
index <HASH>..<HASH> 100644
--- a/src/Message/SecureXMLResponse.php
+++ b/src/Message/SecureXMLResponse.php
@@ -71,4 +71,15 @@ class SecureXMLResponse extends AbstractResponse
? (string) $this->data->Payment->TxnList->Txn->txnID
: null;
}
+
+ /**
+ * @return string|null Settlement date when the funds will be settled into the
+ * merchants account.
+ */
+ public function getSettlementDate()
+ {
+ return $this->hasTransaction()
+ ? (string) $this->data->Payment->TxnList->Txn->settlementDate
+ : null;
+ }
} | Return the settlement date as part of the response | thephpleague_omnipay-securepay | train | php |
95bdfc08bf6bc03cf0258d8b45beba1d40983bf6 | diff --git a/src/com/omrlnr/jreddit/submissions/Submission.java b/src/com/omrlnr/jreddit/submissions/Submission.java
index <HASH>..<HASH> 100644
--- a/src/com/omrlnr/jreddit/submissions/Submission.java
+++ b/src/com/omrlnr/jreddit/submissions/Submission.java
@@ -55,7 +55,7 @@ public class Submission extends Thing {
setAuthor(Utils.toString(obj.get("author")));
setTitle(Utils.toString(obj.get("title")));
setNSFW(Boolean.parseBoolean(Utils.toString(obj.get("over_18"))));
- setCreatedUTC(Long.parseLong(Utils.toString(obj.get("created_utc"))));
+ setCreatedUTC(Double.parseDouble(Utils.toString(obj.get("created_utc"))));
setDownVotes(Integer.parseInt(Utils.toString(obj.get("downs"))));
setName(Utils.toString(obj.get("name")));
setScore(Integer.parseInt(Utils.toString(obj.get("score")))); | UTC Time is represented by a double | jReddit_jReddit | train | java |
1e03a72d9536c65ceb881df6f405398c3e36df76 | diff --git a/src/SoapClient.php b/src/SoapClient.php
index <HASH>..<HASH> 100644
--- a/src/SoapClient.php
+++ b/src/SoapClient.php
@@ -209,9 +209,9 @@ class SoapClient extends InternalSoapClient
return $this->lastRequest;
}
- public function __getLastResponse(): ?string
+ public function __getLastResponse(): string
{
- return $this->lastResponse;
+ return (string)$this->lastResponse;
}
public function setTimeout($milliseconds): void | *edit - SoapClient:__getLastResponse - better to stay in parent compatibility - return just string ... even if public lastResponse can be null | filipsedivy_PHP-EET | train | php |
ea07a44fe0f9e71c5ca17bfeec2f5863eaa019aa | diff --git a/lib/searchkick/query.rb b/lib/searchkick/query.rb
index <HASH>..<HASH> 100644
--- a/lib/searchkick/query.rb
+++ b/lib/searchkick/query.rb
@@ -25,7 +25,7 @@ module Searchkick
term = term.to_s
if options[:emoji]
- term = EmojiParser.parse_unicode(term) { |e| " #{e.name} " }.strip
+ term = EmojiParser.parse_unicode(term) { |e| " #{e.name.tr('_', ' ')} " }.strip
end
@klass = klass
diff --git a/test/match_test.rb b/test/match_test.rb
index <HASH>..<HASH> 100644
--- a/test/match_test.rb
+++ b/test/match_test.rb
@@ -254,6 +254,7 @@ class MatchTest < Minitest::Test
def test_emoji_multiple
store_names ["Ice Cream Cake"]
assert_search "🍨🍰", ["Ice Cream Cake"], emoji: true
+ assert_search "🍨🍰", ["Ice Cream Cake"], emoji: true, misspellings: false
end
# operator | Split emoji token names into words (#<I>) | ankane_searchkick | train | rb,rb |
2305b50ec0bce0d669cf1122576d1612113648fe | diff --git a/src/Exception/MoneyMismatchException.php b/src/Exception/MoneyMismatchException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/MoneyMismatchException.php
+++ b/src/Exception/MoneyMismatchException.php
@@ -12,6 +12,16 @@ use Brick\Money\Currency;
class MoneyMismatchException extends MoneyException
{
/**
+ * MoneyMismatchException constructor.
+ *
+ * @param string $message
+ */
+ private function __construct(string $message)
+ {
+ parent::__construct($message);
+ }
+
+ /**
* @param Currency $expected
* @param Currency $actual
*
diff --git a/src/Exception/UnknownCurrencyException.php b/src/Exception/UnknownCurrencyException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/UnknownCurrencyException.php
+++ b/src/Exception/UnknownCurrencyException.php
@@ -10,6 +10,16 @@ namespace Brick\Money\Exception;
class UnknownCurrencyException extends MoneyException
{
/**
+ * UnknownCurrencyException constructor.
+ *
+ * @param string $message
+ */
+ private function __construct(string $message)
+ {
+ parent::__construct($message);
+ }
+
+ /**
* @param string|int $currencyCode
*
* @return UnknownCurrencyException | Use private constructors in exceptions | brick_money | train | php,php |
60a7160d477c59c9d855ca824c62e655592131f6 | diff --git a/src/main/java/org/firmata4j/firmata/FirmataDevice.java b/src/main/java/org/firmata4j/firmata/FirmataDevice.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/firmata4j/firmata/FirmataDevice.java
+++ b/src/main/java/org/firmata4j/firmata/FirmataDevice.java
@@ -378,7 +378,7 @@ public class FirmataDevice implements IODevice {
* may then safely sit in the host's much larger serial
* input buffer until it is dealt with by onPinStateReceive
*/
- Thread.sleep(10);
+ Thread.sleep(100);
}
} catch (IOException ex) {
LOGGER.error(String.format("Error requesting state of pin %d", pin.getIndex()), ex); | fix(firmata-device): increase dalay when sending pin state requests
Arduino Mega gets input buffer overflown with initial pin state requests
Fixes #<I> | kurbatov_firmata4j | train | java |
064d8bc1d6e3f73c334b535c01422f17987011e2 | diff --git a/js/bitfinex.js b/js/bitfinex.js
index <HASH>..<HASH> 100644
--- a/js/bitfinex.js
+++ b/js/bitfinex.js
@@ -328,8 +328,8 @@ module.exports = class bitfinex extends Exchange {
},
'broad': {
'This API key does not have permission': PermissionDenied, // authenticated but not authorized
- 'Invalid order: not enough exchange balance for ': InsufficientFunds, // when buying cost is greater than the available quote currency
- 'Invalid order: minimum size for ': InvalidOrder, // when amount below limits.amount.min
+ 'not enough exchange balance for ': InsufficientFunds, // when buying cost is greater than the available quote currency
+ 'minimum size for ': InvalidOrder, // when amount below limits.amount.min
'Invalid order': InvalidOrder, // ?
'The available balance is only': InsufficientFunds, // {"status":"error","message":"Cannot withdraw 1.0027 ETH from your exchange wallet. The available balance is only 0.0 ETH. If you have limit orders, open positions, unused or active margin funding, this will decrease your available balance. To increase it, you can cancel limit orders or reduce/close your positions.","withdrawal_id":0,"fees":"0.0027"}
}, | bitfinex exceptions minor edits for PHP | ccxt_ccxt | train | js |
5fe5de34d18ca13181bc7db41446c45edca3ff39 | diff --git a/mtools/util/logevent.py b/mtools/util/logevent.py
index <HASH>..<HASH> 100644
--- a/mtools/util/logevent.py
+++ b/mtools/util/logevent.py
@@ -556,6 +556,8 @@ class LogEvent(object):
self._datetime_calculated = True
self._datetime = doc[u'ts']
+ if self._datetime.tzinfo == None:
+ self._datetime = self._datetime.replace(tzinfo=tzutc())
self._datetime_format = None
self._reformat_timestamp('ctime', force=True)
diff --git a/mtools/util/profile_collection.py b/mtools/util/profile_collection.py
index <HASH>..<HASH> 100644
--- a/mtools/util/profile_collection.py
+++ b/mtools/util/profile_collection.py
@@ -1,5 +1,6 @@
from mtools.util.logevent import LogEvent
from mtools.util.input_source import InputSource
+from dateutil.tz import tzutc
try:
try:
@@ -93,7 +94,12 @@ class ProfileCollection(InputSource):
last = self.coll_handle.find_one(None, sort=[ ("ts", DESCENDING) ])
self._start = first['ts']
+ if self._start.tzinfo == None:
+ self._start = self._start.replace(tzinfo=tzutc())
+
self._end = last['ts']
+ if self._end.tzinfo == None:
+ self._end = self._end.replace(tzinfo=tzutc())
return True | hotfix, system.profile was not timezone-aware yet. | rueckstiess_mtools | train | py,py |
d2b32bd3ead32f95a3594eb67afedf52b101d52a | diff --git a/libraries/lithium/storage/session/adapter/Cookie.php b/libraries/lithium/storage/session/adapter/Cookie.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/storage/session/adapter/Cookie.php
+++ b/libraries/lithium/storage/session/adapter/Cookie.php
@@ -124,11 +124,12 @@ class Cookie extends \lithium\core\Object {
$result = (isset($_COOKIE[$config['name']])) ? $_COOKIE[$config['name']] : array();
foreach ($key as $k) {
- if (isset($result[$k])) {
- $result = $result[$k];
+ if (!isset($result[$k])) {
+ return null;
}
+ $result = $result[$k];
}
- return ($result !== array()) ? $result : null;
+ return $result;
}
if (isset($_COOKIE[$config['name']][$key])) {
return $_COOKIE[$config['name']][$key]; | Fixing bug in `Cookie::read()` with non-existent nested keys. | UnionOfRAD_framework | train | php |
2a96ed6d999ccb100b105e33ca0810baaf5deac0 | diff --git a/react-native/react/reducers/tracker.js b/react-native/react/reducers/tracker.js
index <HASH>..<HASH> 100644
--- a/react-native/react/reducers/tracker.js
+++ b/react-native/react/reducers/tracker.js
@@ -143,7 +143,7 @@ function updateUserState (rootState: State, trackerState: TrackerState, action:
case Constants.markActiveIdentifyUi:
const serverActive = action.payload && !!action.payload.active || false
// The server wasn't active and now it is, we reset closed state
- const closed = (showAllTrackers && !rootState.serverActive && serverActive) ? false : trackerState.closed
+ const closed = (showAllTrackers && !trackerState.serverActive && serverActive) ? false : trackerState.closed
return {
serverActive,
closed | serverActive is in tracker state | keybase_client | train | js |
77686370bfe36333c044423a73758cd8c925ae13 | diff --git a/src/ResizeSensor.js b/src/ResizeSensor.js
index <HASH>..<HASH> 100755
--- a/src/ResizeSensor.js
+++ b/src/ResizeSensor.js
@@ -6,6 +6,9 @@
;
(function() {
+ // Only used for the dirty checking, so the event callback count is limted to max 1 call per fps per sensor.
+ // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
+ // would generate too many unnecessary events.
var requestAnimationFrame = window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame || | Add info about requestAnimationFrame | marcj_css-element-queries | train | js |
041dbf87cf893731fe1620ad62bc94046b3a9a83 | diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -183,7 +183,6 @@ const webpackConfig = {
global: 'window',
} ),
new webpack.NormalModuleReplacementPlugin( /^path$/, 'path-browserify' ),
- new webpack.NormalModuleReplacementPlugin( /^(json3|jsonify)$/, 'lib/shims/json' ),
new webpack.IgnorePlugin( /^props$/ ),
new CopyWebpackPlugin( [
{ from: 'node_modules/flag-icon-css/flags/4x3', to: 'images/flags' }, | Removing shim that causes happychat socket connection to fail firing event handlers (#<I>) | Automattic_wp-calypso | train | js |
4d20d89a270b5cc5b4b0753c3ff26426ce668505 | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -66,7 +66,7 @@ var Collision = {
/**
* Display hover tooltips on the matched elements.
- * @param {(Object|string)} opts The options object to use for the plugin, or
+ * @param {(Object|string)=} opts The options object to use for the plugin, or
* the name of a method to invoke on the first matched element.
* @param {*=} [arg] Argument for an invoked method (optional).
* @return {jQuery} jQuery object for the matched selectors. | Fixed powerTip() annotation to show opts as optional. | stevenbenner_jquery-powertip | train | js |
7c9742ed0ce4f45ef233ff444e98cb4b596ef6e9 | diff --git a/cpuinfo/cpuinfo.py b/cpuinfo/cpuinfo.py
index <HASH>..<HASH> 100644
--- a/cpuinfo/cpuinfo.py
+++ b/cpuinfo/cpuinfo.py
@@ -568,6 +568,7 @@ class CPUID(object):
'extended_family' : extended_family
}
+ # https://en.wikipedia.org/wiki/CPUID#EAX.3D80000000h:_Get_Highest_Extended_Function_Supported
def get_max_extension_support(self):
# Check for extension support
max_extension_support = self._run_asm(
@@ -816,6 +817,7 @@ class CPUID(object):
return processor_brand
+ # https://en.wikipedia.org/wiki/CPUID#EAX.3D80000006h:_Extended_L2_Cache_Features
def get_cache(self, max_extension_support):
cache_info = {} | Added more links to CPUID documentation | workhorsy_py-cpuinfo | train | py |
16abc82d3f6aed2aaa356f2cec4e0a3db0ad0495 | diff --git a/napd/nap.py b/napd/nap.py
index <HASH>..<HASH> 100644
--- a/napd/nap.py
+++ b/napd/nap.py
@@ -907,9 +907,9 @@ class Nap:
'contains',
'contains_equals',
'contained_within',
- 'contained_within_equals') and self._get_afi(query['val2']) == 4:
+ 'contained_within_equals'):
- where = " family(%(col_prefix)sprefix) = 4 AND ip4r(CASE WHEN family(prefix) = 4 THEN prefix ELSE NULL END) %(operator)s %%s " % {
+ where = " iprange(prefix) %(operator)s %%s " % {
'col_prefix': col_prefix,
'operator': _operation_map[query['operator']]
} | Migrate ip4r to iprange
Remove ugly ip4r kludge and replace with the general iprange operator to
support both fast IPv4 and IPv6 searches.
Fixes #6. | SpriteLink_NIPAP | train | py |
2a1233e4ea55a04072bc8c410367622b3dd0d1a6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,7 @@ setup_params = dict(
long_description=open('README.rst').read(),
setup_requires=[
'hgtools',
- 'pytest-runner>=1.1,<3.0dev',
+ 'pytest-runner>=2.1',
],
tests_require=[
'pymongo', | Bump pytest runner | yougov_pmxbot | train | py |
560fc52dca280b85fe7c935c7f2d5f65237db098 | diff --git a/lib/behat/behat_field_manager.php b/lib/behat/behat_field_manager.php
index <HASH>..<HASH> 100644
--- a/lib/behat/behat_field_manager.php
+++ b/lib/behat/behat_field_manager.php
@@ -54,10 +54,15 @@ class behat_field_manager {
try {
// The DOM node.
$fieldnode = $context->find_field($label);
- } catch (ElementNotFoundException $e) {
+ } catch (ElementNotFoundException $fieldexception) {
// Looking for labels that points to filemanagers.
- $fieldnode = $context->find_filemanager($label);
+ try {
+ $fieldnode = $context->find_filemanager($label);
+ } catch (ElementNotFoundException $filemanagerexception) {
+ // We want the generic 'field' exception.
+ throw $fieldexception;
+ }
}
// The behat field manager. | MDL-<I> behat: Replace wrongly triggered not found exception | moodle_moodle | train | php |
2f6843b55b058a719b76933afccae39f3030525c | diff --git a/gwpy/signal/qtransform.py b/gwpy/signal/qtransform.py
index <HASH>..<HASH> 100644
--- a/gwpy/signal/qtransform.py
+++ b/gwpy/signal/qtransform.py
@@ -27,7 +27,6 @@ from __future__ import division
import warnings
from math import (log, ceil, pi, isinf, exp)
-from more_itertools import unique_everseen
from six import string_types
from six.moves import xrange
@@ -243,8 +242,9 @@ class QPlane(QBase):
Yields a `QTile` at each frequency
"""
+ from ..cli.cliproduct import unique
# for each frequency, yield a QTile
- for freq in unique_everseen(self._iter_frequencies()):
+ for freq in unique(self._iter_frequencies()):
yield QTile(self.q, freq, self.duration, self.sampling,
mismatch=self.mismatch)
@@ -269,7 +269,8 @@ class QPlane(QBase):
:type: `numpy.ndarray`
"""
- return numpy.array(list(unique_everseen(self._iter_frequencies())))
+ from ..cli.cliproduct import unique
+ return numpy.array(list(unique(self._iter_frequencies())))
@property
def farray(self): | Use native utils rather than third-party ones | gwpy_gwpy | train | py |
bda5bdefe5c629354345fb3a851c169af6a25c41 | diff --git a/conan/packager.py b/conan/packager.py
index <HASH>..<HASH> 100644
--- a/conan/packager.py
+++ b/conan/packager.py
@@ -12,7 +12,7 @@ from six import iteritems
class ConanMultiPackager(object):
""" Help to generate common builds (setting's combinations), adjust the environment,
- and run conan test command in docker containers"""
+ and run conan test_package command in docker containers"""
default_gcc_versions = ["4.6", "4.8", "4.9", "5.2", "5.3"]
default_visual_versions = ["10", "12", "14"]
default_visual_runtimes = ["MT", "MD", "MTd", "MDd"]
@@ -408,7 +408,7 @@ class ConanMultiPackager(object):
settings = " ".join(['-s %s="%s"' % (key, value) for key, value in iteritems(settings)])
options = " ".join(['-o %s="%s"' % (key, value) for key, value in iteritems(options)])
- command = "conan test . %s %s %s" % (settings, options, self.args)
+ command = "conan test_package . %s %s %s" % (settings, options, self.args)
if precommand:
command = '%s && %s' % (precommand, command) | Changed deprecated conan test to conan test_package | conan-io_conan-package-tools | train | py |
20bbf08af2bb8bb515a2723624da34817b7bd63c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -25,13 +25,13 @@ setup(name='ding0',
url='https://github.com/openego/ding0',
license='GNU GPLv3',
packages=find_packages(),
- install_requires=['networkx >= 1.11, <= 1.11',
+ install_requires=['networkx >= 1.11, < 2.0',
'geopy >= 1.11.0, <= 1.11.0',
'pandas >= 0.20.3, <= 0.20.3',
'pyproj >= 1.9.5.1, <= 1.9.5.1',
'sqlalchemy >= 1.0.11, <= 1.2.0',
'geoalchemy2 >= 0.2.6, <= 0.4.1',
- 'matplotlib >= 1.5.3, <= 1.5.3',
+ 'matplotlib >= 1.5.3, <= 2.0.2',
'egoio>=0.4.5',
'shapely >= 1.5.12, <= 1.6.3',
'pypsa >= 0.11.0, <= 0.11.0', | update networkx and matplotlib versions in setup.py, #<I> | openego_ding0 | train | py |
04e05088ff73f1579a9012046ba98cfb89dc538e | diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/util/downloader.rb
+++ b/lib/vagrant/util/downloader.rb
@@ -101,13 +101,6 @@ module Vagrant
progress_data << data
while true
- # If we have a full amount of column data (two "\r") then
- # we report new progress reports. Otherwise, just keep
- # accumulating.
- match = progress_regexp.match(progress_data)
-
- break if !match
-
# If the download has been redirected and we are no longer downloading
# from the original host, notify the user that the target host has
# changed from the source.
@@ -129,9 +122,24 @@ module Vagrant
break
end
- data = match[1].to_s
- stop = progress_data.index(data) + data.length
- progress_data.slice!(0, stop)
+ # If we have a full amount of column data (two "\r") then
+ # we report new progress reports. Otherwise, just keep
+ # accumulating.
+ match = nil
+ check_match = true
+
+ while check_match
+ check_match = progress_regexp.match(progress_data)
+ if check_match
+ data = check_match[1].to_s
+ stop = progress_data.index(data) + data.length
+ progress_data.slice!(0, stop)
+
+ match = check_match
+ end
+ end
+
+ break if !match
# Ignore the first \r and split by whitespace to grab the columns
columns = data.strip.split(/\s+/) | Check location first. Grab final progress when multiple entries listed. | hashicorp_vagrant | train | rb |
7e45261162994d64b8558de5193ea97105c32b8e | diff --git a/alerta/shell.py b/alerta/shell.py
index <HASH>..<HASH> 100644
--- a/alerta/shell.py
+++ b/alerta/shell.py
@@ -485,6 +485,9 @@ class AlertaShell(object):
def run(self):
+ root.setLevel(logging.ERROR)
+ LOG.setLevel(logging.ERROR)
+
config_file = os.environ.get('ALERTA_CONF_FILE') or OPTIONS['config_file']
config = ConfigParser.RawConfigParser(defaults=OPTIONS)
@@ -964,9 +967,6 @@ class AlertaShell(object):
root.setLevel(logging.DEBUG)
LOG.setLevel(logging.DEBUG)
LOG.debug("Alerta cli version: %s", __version__)
- else:
- root.setLevel(logging.ERROR)
- LOG.setLevel(logging.ERROR)
cli.set_api(url=args.endpoint, key=args.key) | reduce log noise to stdout | alerta_python-alerta-client | train | py |
3451c79c6ac012a3dda29fdca36234a5bfe0966f | diff --git a/octodns/provider/dnsimple.py b/octodns/provider/dnsimple.py
index <HASH>..<HASH> 100644
--- a/octodns/provider/dnsimple.py
+++ b/octodns/provider/dnsimple.py
@@ -51,8 +51,8 @@ class DnsimpleClient(object):
resp.raise_for_status()
return resp
- def domain(self, name):
- path = '/domains/{}'.format(name)
+ def zone(self, name):
+ path = '/zones/{}'.format(name)
return self._request('GET', path).json()
def domain_create(self, name):
@@ -442,7 +442,7 @@ class DnsimpleProvider(BaseProvider):
domain_name = desired.name[:-1]
try:
- self._client.domain(domain_name)
+ self._client.zone(domain_name)
except DnsimpleClientNotFound:
self.log.debug('_apply: no matching zone, creating domain')
self._client.domain_create(domain_name) | Change DNSimple's Provider to query zones instead domains
A quick summary of a problem with have with DNSimple provider:
Let's suppose that I have the following config:
zones:
<I>.in-addr.arpa.:
sources:
- config
targets:
- dnsimple
Even if a customer has this Reverse zone configured in DNSimple, this
fails with:
<I> Bad Request for url: <URL> | github_octodns | train | py |
12cf59c3802a842437357198ab8a4c57331943ba | diff --git a/lib/cms_scanner/web_site.rb b/lib/cms_scanner/web_site.rb
index <HASH>..<HASH> 100644
--- a/lib/cms_scanner/web_site.rb
+++ b/lib/cms_scanner/web_site.rb
@@ -29,7 +29,7 @@ module CMSScanner
def url(path = nil)
return @uri.to_s unless path
- @uri.join(Addressable::URI.encode(path)).to_s
+ @uri.join(Addressable::URI.encode(path).gsub('#', '%23')).to_s
end
attr_writer :homepage_res
diff --git a/spec/lib/web_site_spec.rb b/spec/lib/web_site_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/web_site_spec.rb
+++ b/spec/lib/web_site_spec.rb
@@ -51,7 +51,7 @@ describe CMSScanner::WebSite do
it 'encodes the path' do
expect(web_site.url('f ile.txt')).to eql "#{url}/f%20ile.txt"
expect(web_site.url('s/a%.txt')).to eql "#{url}/s/a%25.txt"
- expect(web_site.url('#file.txt#')).to eql "#{url}/#file.txt%23"
+ expect(web_site.url('#file.txt#')).to eql "#{url}/%23file.txt%23"
end
context 'when relative path' do | Encodes # chars in URLs, it's not a web browser :D | wpscanteam_CMSScanner | train | rb,rb |
0ed00b3b7f6fbf164789b80b54f339020798b6aa | diff --git a/course/user.php b/course/user.php
index <HASH>..<HASH> 100644
--- a/course/user.php
+++ b/course/user.php
@@ -9,7 +9,7 @@
require_variable($id); // course id
require_variable($user); // user id
- optional_variable($mode, "outline");
+ optional_variable($mode, "todaylogs");
require_login(); | Change default logs to be "today's logs" | moodle_moodle | train | php |
1db9bfe92f48b6ff0c6594b2b030c4a840081eb2 | diff --git a/test/com/zwitserloot/cmdreader/TestCmdReader.java b/test/com/zwitserloot/cmdreader/TestCmdReader.java
index <HASH>..<HASH> 100644
--- a/test/com/zwitserloot/cmdreader/TestCmdReader.java
+++ b/test/com/zwitserloot/cmdreader/TestCmdReader.java
@@ -82,7 +82,6 @@ public class TestCmdReader {
private boolean val4;
}
- @SuppressWarnings("unused")
private static class CmdArgs4 {
@ExcludesGroup
private boolean bar1; | [trivial] fixes a SuppressWarnings. | rzwitserloot_com.zwitserloot.cmdreader | train | java |
d31b4f2f5924aec17015052ed8e3e9bdad278cdf | diff --git a/src/authentication.js b/src/authentication.js
index <HASH>..<HASH> 100644
--- a/src/authentication.js
+++ b/src/authentication.js
@@ -225,12 +225,15 @@ export class Authentication {
redirect(redirectUrl, defaultRedirectUrl) {
// stupid rule to keep it BC
if (redirectUrl === true) {
- LogManager.getLogger('authentication').warn('DEPRECATED: Setting redirectUrl === true to actually *not redirect* is deprecated. Set redirectUrl === false instead.');
+ LogManager.getLogger('authentication').warn('DEPRECATED: Setting redirectUrl === true to actually *not redirect* is deprecated. Set redirectUrl === 0 instead.');
return;
}
- // explicit false means don't redirect
+ // stupid rule to keep it BC
if (redirectUrl === false) {
- LogManager.getLogger('authentication').warn('BREAKING CHANGE: redirectUrl === false means "Do not redirect" now! Set redirectUrl to undefined or null to use the defaultRedirectUrl if so desired.');
+ LogManager.getLogger('authentication').warn('BREAKING CHANGE: Setting redirectUrl === false to actually *do redirect* is deprecated. Set redirectUrl to undefined or null to use the defaultRedirectUrl if so desired.');
+ }
+ // BC hack. explicit 0 means don't redirect. false will be added later and 0 deprecated
+ if (redirectUrl === 0) {
return;
}
if (typeof redirectUrl === 'string') { | chore(authentication): BC hack. use redirectUri === 0 to not redirect | SpoonX_aurelia-authentication | train | js |
3fccbaa34c108658cb7ab0d8c67f5c7cdfee9499 | diff --git a/share/js/apps.js b/share/js/apps.js
index <HASH>..<HASH> 100644
--- a/share/js/apps.js
+++ b/share/js/apps.js
@@ -97,6 +97,7 @@
'Dancer': { cats: { 1: 18 }, headers: { 'X-Powered-By': /Perl Dancer/, 'Server': /Perl Dancer/ }, implies: [ 'Perl' ] },
'Danneo CMS': { cats: { 1: 1 }, meta: { 'generator': /Danneo/i } },
'DataLife Engine': { cats: { 1: 1 }, meta: { 'generator': /DataLife Engine/i } },
+ 'David Webbox': { cats: { 1: 28 }, headers: { 'Server': /David-WebBox/i } },
'Debian': { cats: { 1: 28 }, headers: { 'Server': /Debian/i, 'X-Powered-By': /(Debian|dotdeb|etch|lenny|squeeze|wheezy)/i } },
'DedeCMS': { cats: { 1: 1 }, env: /^Dede/, script: /dedeajax/ },
'Demandware': { cats: { 1: 6 }, html: /<[^>]+demandware.edgesuite/, env: /^dwAnalytics/ }, | Added David.Webbox by Tobit.Software | AliasIO_Wappalyzer | train | js |
66623a8c5f2b682932f83e03c3665bbb3909998e | diff --git a/openhtf/plugs/usb/adb_protocol.py b/openhtf/plugs/usb/adb_protocol.py
index <HASH>..<HASH> 100644
--- a/openhtf/plugs/usb/adb_protocol.py
+++ b/openhtf/plugs/usb/adb_protocol.py
@@ -873,7 +873,7 @@ class AdbConnection(object):
if msg.arg0 != cls.AUTH_TOKEN:
raise usb_exceptions.AdbProtocolError('Bad AUTH response: %s', msg)
- signed_token = rsa_key.sign(ADB_BANNER)
+ signed_token = rsa_key.sign(msg.data)
adb_transport.write_message(
adb_message.AdbMessage(
command='AUTH', arg0=cls.AUTH_SIGNATURE, arg1=0,
@@ -888,7 +888,8 @@ class AdbConnection(object):
adb_transport.write_message(
adb_message.AdbMessage(
command='AUTH', arg0=cls.AUTH_RSAPUBLICKEY, arg1=0,
- data=rsa_keys[0].get_public_key() + '\0'))
+ data=rsa_keys[0].get_public_key() + '\0'),
+ timeout)
try:
msg = adb_transport.read_until(
('CNXN',), timeouts.PolledTimeout.from_millis(auth_timeout_ms)) | Send signed data token for AUTH response (#<I>) | google_openhtf | train | py |
1f125d05499f76b9829fcaa5ac090353481e05c0 | diff --git a/src/WebinoDev/Test/DomTrait.php b/src/WebinoDev/Test/DomTrait.php
index <HASH>..<HASH> 100644
--- a/src/WebinoDev/Test/DomTrait.php
+++ b/src/WebinoDev/Test/DomTrait.php
@@ -38,13 +38,18 @@ trait DomTrait
* Create DOM document from XML source
*
* @param string $xml
+ * @param string $namespace
* @return DOMDocument
*/
- protected function createXmlDom($xml)
+ protected function createXmlDom($xml, $namespacePrefix = null)
{
$dom = new DOMDocument;
$dom->loadXML($xml);
$dom->xpath = new DOMXPath($dom);
+
+ $namespacePrefix
+ and $dom->xpath->registerNamespace($namespacePrefix, $dom->lookupNamespaceUri($dom->namespaceURI));
+
return $dom;
}
} | Updated DomTrait, added XML namespace prefix support | webino_WebinoDev | train | php |
7a79bd6fd4e6ccb7bdc3a859c666a1a9496a8f91 | diff --git a/src/main/java/water/parser/DParseTask.java b/src/main/java/water/parser/DParseTask.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/parser/DParseTask.java
+++ b/src/main/java/water/parser/DParseTask.java
@@ -87,26 +87,26 @@ public final class DParseTask extends MRTask {
final int _chunkIndex;
final int _chunkOffset;
final int _numRows;
- AutoBuffer _ab;
+ AutoBuffer _abs;
/** Allocates the stream for the chunk. Streams should only be allocated
* right before the record will be used and should be stored immediately
* after that.
*/
public AutoBuffer initialize() {
- assert _ab == null;
- return (_ab = new AutoBuffer(_numRows * _rowsize));
+ assert _abs == null;
+ return (_abs = new AutoBuffer(_numRows * _rowsize));
}
/** Stores the stream to its chunk using the atomic union. After the data
* from the stream is stored, its memory is freed up.
*/
public void store() {
- assert _ab.eof();
+ assert _abs.eof();
Key k = ValueArray.getChunkKey(_chunkIndex, _job.dest());
AtomicUnion u = new AtomicUnion(_ab.bufClose(),_chunkOffset);
alsoBlockFor(u.fork(k));
- _ab = null; // free mem
+ _abs = null; // free mem
}
// You are not expected to create record streams yourself, use the | Rename _ab to _abs to avoid shadowing a prior _ab | h2oai_h2o-2 | train | java |
dfc2608c8b8276f178af6c8960b475c240e1eb46 | diff --git a/src/Charcoal/Admin/Widget/FormGroup/StructureFormGroup.php b/src/Charcoal/Admin/Widget/FormGroup/StructureFormGroup.php
index <HASH>..<HASH> 100644
--- a/src/Charcoal/Admin/Widget/FormGroup/StructureFormGroup.php
+++ b/src/Charcoal/Admin/Widget/FormGroup/StructureFormGroup.php
@@ -127,12 +127,18 @@ class StructureFormGroup extends FormGroupWidget
if ($formGroup instanceof self) {
$prop = $formGroup->storageProperty();
$val = $formGroup->obj()->propertyValue($prop->ident());
+
$this->obj = $prop->structureVal($val);
+ if ($this->obj === null) {
+ $this->obj = clone $prop->structureProto();
+ }
} elseif ($this->form() instanceof ObjectContainerInterface) {
$this->obj = $this->form()->obj();
- } else {
+ }
+
+ if ($this->obj === null) {
throw new RuntimeException(sprintf(
- 'The %1$s widget has no data model.',
+ 'The [%1$s] widget has no data model.',
static::CLASS
));
} | Fixed nested structure widgets
With locomotivemtl/charcoal-property#<I>e<I>a | locomotivemtl_charcoal-admin | train | php |
9c31674c1255e34ea24ae3b01b8cbce724c3ba07 | diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py
index <HASH>..<HASH> 100644
--- a/salt/modules/cmdmod.py
+++ b/salt/modules/cmdmod.py
@@ -1223,14 +1223,16 @@ def exec_code(lang, code, cwd=None):
def run_chroot(root, cmd):
'''
- Chroot into a directory and run a cmd, this routines calls cmd.run_all
- wrapped in `chroot` with dev and proc mounted in the chroot
+ .. versionadded:: Helium
+
+ This function runs :mod:`cmd.run_all <salt.modules.cmdmod.run_all>` wrapped
+ within a chroot, with dev and proc mounted in the chroot
CLI Example:
.. code-block:: bash
- salt '*' cmd.chroot_run /var/lib/lxc/container_name/rootfs 'sh /tmp/bootstrap.sh'
+ salt '*' cmd.run_chroot /var/lib/lxc/container_name/rootfs 'sh /tmp/bootstrap.sh'
'''
__salt__['mount.mount'](
os.path.join(root, 'dev'), | Fix cmd.run_chroot docstring
The CLI example was wrongly referring to it as cmd.chroot_run. This
commit also adds a versionadded directive. | saltstack_salt | train | py |
cb05dea2142d0521f21258c8641f8746af3b1a74 | diff --git a/poco/drivers/android/utils/installation.py b/poco/drivers/android/utils/installation.py
index <HASH>..<HASH> 100644
--- a/poco/drivers/android/utils/installation.py
+++ b/poco/drivers/android/utils/installation.py
@@ -29,6 +29,7 @@ def install(adb_client, localpath, force_reinstall=False):
force_reinstall))
if installed_version is not None:
force_reinstall = True
+ uninstall(adb_client, package_name)
if hasattr(adb_client, 'install_app'):
adb_client.install_app(localpath, force_reinstall)
else: | uninstall apk before update pocoservice.apk
(cherry picked from commit <I>a<I>d6ea<I>ef<I>a0f<I>acb<I>ae0dfcefe) | AirtestProject_Poco | train | py |
624855ec767f35c5852bf14cc1171b3e44b759e6 | diff --git a/lib/gym/error_handler.rb b/lib/gym/error_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/gym/error_handler.rb
+++ b/lib/gym/error_handler.rb
@@ -47,6 +47,23 @@ module Gym
when /single\-bundle/
print "Your project does not contain a single–bundle application or contains multiple products"
print "Please read the documentation provided by Apple: https://developer.apple.com/library/ios/technotes/tn2215/_index.html"
+ when /no signing identity matches '(.*)'/
+ print "Could not find code signing identity '#{$1}'"
+ print "Make sure the name of the code signing identity is correct"
+ print "and it matches a locally installed code signing identity"
+ print "You can pass the name of the code signing identity using the"
+ print "`codesigning_identity` option"
+ when /no provisioning profile matches '(.*)'/
+ print "Could not find provisioning profile with the name '#{$1}'"
+ print "Make sure the name of the provisioning profile is correct"
+ print "and it matches a locally installed profile"
+ print "You can pass the name of the provisioning profile using the"
+ print "`--provisioning_profile_name` option"
+ when /mismatch between specified provisioning profile and signing identity/
+ print "Mismatch between provisioning profile and code signing identity"
+ print "This means, the specified provisioning profile was not created using"
+ print "the specified certificate."
+ print "Run cert and sigh before gym to make sure to have all signing resources ready"
end
raise "Error packaging up the application" | Added error handling for packing up the application | fastlane_fastlane | train | rb |
73b36bca842972fc5741d30e4b15287aaac4f770 | diff --git a/mod/lesson/action/continue.php b/mod/lesson/action/continue.php
index <HASH>..<HASH> 100644
--- a/mod/lesson/action/continue.php
+++ b/mod/lesson/action/continue.php
@@ -91,7 +91,7 @@
$noanswer = true;
break;
}
- $useranswer = stripslashes(clean_param($useranswer, PARAM_RAW));
+ $useranswer = s(stripslashes(clean_param($useranswer, PARAM_RAW)));
$userresponse = addslashes($useranswer);
if (!$answers = get_records("lesson_answers", "pageid", $pageid, "id")) {
print_error("Continue: No answers found"); | MDL-<I> - do input sanitization early, so as to not mess up display later (merge from <I>) | moodle_moodle | train | php |
f05f15d68f0cdab736802cfe3ad5b7b95c8cc7a2 | diff --git a/lib/coveralls/configuration.rb b/lib/coveralls/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/coveralls/configuration.rb
+++ b/lib/coveralls/configuration.rb
@@ -11,7 +11,8 @@ module Coveralls
yml = self.yaml_config
if yml
config[:configuration] = yml
- config[:repo_token] = yml['repo_token'] || yml['repo_secret_token']
+ config[:repo_token] = yml['repo_token'] || yml['repo_secret_token'] ||
+ ENV['COVERALLS_REPO_TOKEN']
end
if ENV['TRAVIS']
config[:service_job_id] = ENV['TRAVIS_JOB_ID'] | added ENV['COVERALLS_REPO_TOKEN'] for secure token support on travis | lemurheavy_coveralls-ruby | train | rb |
c25b77012a03665e1d118ccfafae803249183eae | diff --git a/lib/modules/apostrophe-schemas/index.js b/lib/modules/apostrophe-schemas/index.js
index <HASH>..<HASH> 100644
--- a/lib/modules/apostrophe-schemas/index.js
+++ b/lib/modules/apostrophe-schemas/index.js
@@ -200,7 +200,7 @@ module.exports = {
if (!field.group) {
field.group = { name: 'default', label: 'info' };
}
- if (groups.length == 0 || groups[currentGroup].name !== field.group.name) {
+ if (groups.length == 0 || (groups[currentGroup].name !== field.group.name && !field.contextual)) {
groups.push({
type: 'group',
name: field.group.name, | fixes bug where contextual fields such as trash were causing info schema tab to display without any fields | apostrophecms_apostrophe | train | js |
f7f7d0812309164cd4c7b7fa5ef05b9841d5fc2f | diff --git a/src/AsyncHttpConnector.php b/src/AsyncHttpConnector.php
index <HASH>..<HASH> 100644
--- a/src/AsyncHttpConnector.php
+++ b/src/AsyncHttpConnector.php
@@ -5,6 +5,8 @@ namespace ScriptFUSION\Porter\Net\Http;
use Amp\Artax\DefaultClient;
use Amp\Artax\Response;
+use Amp\Artax\SocketException;
+use Amp\Artax\TimeoutException;
use Amp\Promise;
use ScriptFUSION\Porter\Connector\AsyncConnector;
use ScriptFUSION\Porter\Connector\ConnectionContext;
@@ -31,8 +33,14 @@ class AsyncHttpConnector implements AsyncConnector, ConnectorOptions
$client->setOptions($this->getOptions()->extractArtaxOptions());
return $context->retry(static function () use ($client, $source) {
- /** @var Response $response */
- $response = yield $client->request($source);
+ try {
+ /** @var Response $response */
+ $response = yield $client->request($source);
+ } catch (TimeoutException | SocketException $exception) {
+ // Convert exception to recoverable exception.
+ throw new HttpConnectionException($exception->getMessage(), $exception->getCode(), $exception);
+ }
+
$body = yield $response->getBody();
return HttpResponse::fromArtaxResponse($response, $body); | Changed TimeoutException to recoverable exception type. | Porter-connectors_HttpConnector | train | php |
a36ed2016ceb9db0c3d47df266b29047d3a406da | diff --git a/Generator/HookImplementation.php b/Generator/HookImplementation.php
index <HASH>..<HASH> 100644
--- a/Generator/HookImplementation.php
+++ b/Generator/HookImplementation.php
@@ -15,23 +15,6 @@ namespace DrupalCodeBuilder\Generator;
class HookImplementation extends PHPFunction {
/**
- * The unique name of this generator.
- *
- * A generator's name is used as the key in the $components array.
- *
- * A HookImplementation generator should use as its name the full hook name,
- * e.g., 'hook_menu'.
- */
- public $name;
-
- /**
- * The data for this hook, from the ReportHookData task.
- *
- * @see getHookDeclarations() for format.
- */
- protected $hook_info;
-
- /**
* Constructor.
*
* @param $component_name | Removed superfluous class properties. | drupal-code-builder_drupal-code-builder | train | php |
ec6bc3e659585f8a42328f023205baf70ce93957 | diff --git a/test/comment-directives.js b/test/comment-directives.js
index <HASH>..<HASH> 100644
--- a/test/comment-directives.js
+++ b/test/comment-directives.js
@@ -27,6 +27,16 @@ describe('Linter', function() {
assert.equal(report.errorCount, 1);
});
+ it('should disable only one compiler error using multiline comment', function () {
+ const report = linter.processStr(`
+ /* solhint-disable-next-line */
+ pragma solidity ^0.4.4;
+ pragma solidity 0.3.4;
+ `);
+
+ assert.equal(report.errorCount, 1);
+ });
+
it('should disable only compiler version error', function () {
const report = linter.processStr(`
// solhint-disable compiler-gt-0_4
@@ -63,5 +73,15 @@ describe('Linter', function() {
assert.ok(report.reports[0].message.includes('fixed'));
});
+ it('should disable all errors', function () {
+ const report = linter.processStr(`
+ /* solhint-disable */
+ pragma solidity ^0.4.4;
+ pragma solidity 0.3.4;
+ `);
+
+ assert.equal(report.errorCount, 0);
+ });
+
});
});
\ No newline at end of file | <I>-implement-possibilities-to-disable-validation-using-comments | protofire_solhint | train | js |
76defc6f9ddd45d1a52b341e4cb255514d89dd92 | diff --git a/initca/initca.go b/initca/initca.go
index <HASH>..<HASH> 100644
--- a/initca/initca.go
+++ b/initca/initca.go
@@ -116,7 +116,7 @@ func NewFromSigner(req *csr.CertificateRequest, priv crypto.Signer) (cert, csrPE
var sigAlgo x509.SignatureAlgorithm
switch pub := priv.Public().(type) {
- case *rsa.PrivateKey:
+ case *rsa.PublicKey:
bitLength := pub.N.BitLen()
switch {
case bitLength >= 4096:
@@ -128,7 +128,7 @@ func NewFromSigner(req *csr.CertificateRequest, priv crypto.Signer) (cert, csrPE
default:
sigAlgo = x509.SHA1WithRSA
}
- case *ecdsa.PrivateKey:
+ case *ecdsa.PublicKey:
switch pub.Curve {
case elliptic.P521():
sigAlgo = x509.ECDSAWithSHA512 | Switch types from PrivateKey -> PublicKey in initca | cloudflare_cfssl | train | go |
19939b12e8376aca4dee262a1d393f7c4df59c41 | diff --git a/presto-main/src/main/java/com/facebook/presto/server/testing/TestingPrestoServer.java b/presto-main/src/main/java/com/facebook/presto/server/testing/TestingPrestoServer.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/server/testing/TestingPrestoServer.java
+++ b/presto-main/src/main/java/com/facebook/presto/server/testing/TestingPrestoServer.java
@@ -172,8 +172,8 @@ public class TestingPrestoServer
.put("task.default-concurrency", "4")
.put("task.max-worker-threads", "4")
.put("exchange.client-threads", "4")
- .put("scheduler.http-client.http2.enabled", "true")
- .put("exchange.http-client.http2.enabled", "true")
+ .put("scheduler.http-client.http2.enabled", "false")
+ .put("exchange.http-client.http2.enabled", "false")
.put("analyzer.experimental-syntax-enabled", "true");
if (!properties.containsKey("query.max-memory-per-node")) { | Disable HTTP/2 client for tests
Enabling this breaks the tests when run with many threads. | prestodb_presto | train | java |
2ea7876c2510a7d4a609561648c34edea0aeb8d5 | diff --git a/test/data/testrunner.js b/test/data/testrunner.js
index <HASH>..<HASH> 100644
--- a/test/data/testrunner.js
+++ b/test/data/testrunner.js
@@ -317,8 +317,8 @@ var Globals = (function() {
};
QUnit.done(function() {
- // Remove out own fixtures outside #qunit-fixture
- jQuery( "#nothiddendiv, #loadediframe, #dl" ).remove();
+ // Remove our own fixtures outside #qunit-fixture
+ jQuery("#qunit ~ *").remove();
});
// jQuery-specific QUnit.reset | Fix #<I>: better test fixture cleanup. Close gh-<I>. | jquery_jquery | train | js |
dd87c68e30704bab8746f65920d04614807a16f5 | diff --git a/lib/eztemplate/classes/eztemplatefileresource.php b/lib/eztemplate/classes/eztemplatefileresource.php
index <HASH>..<HASH> 100644
--- a/lib/eztemplate/classes/eztemplatefileresource.php
+++ b/lib/eztemplate/classes/eztemplatefileresource.php
@@ -269,10 +269,13 @@ class eZTemplateFileResource
}
if ( eZTemplate::isDebugEnabled() )
eZDebug::writeNotice( "$path, $charset" );
- $codec =& eZTextCodec::instance( $charset );
- eZDebug::accumulatorStart( 'templage_resource_conversion', 'template_total', 'String conversion in template resource' );
- $text = $codec->convertString( $text );
- eZDebug::accumulatorStop( 'templage_resource_conversion', 'template_total', 'String conversion in template resource' );
+ $codec =& eZTextCodec::instance( $charset, false, false );
+ if ( $codec )
+ {
+ eZDebug::accumulatorStart( 'templage_resource_conversion', 'template_total', 'String conversion in template resource' );
+ $text = $codec->convertString( $text );
+ eZDebug::accumulatorStop( 'templage_resource_conversion', 'template_total', 'String conversion in template resource' );
+ }
$result = true;
if ( eZTemplate::isDebugEnabled() )
{ | - Made sure the template file resource only initializes the text codec
when it is actually required, this reduces several function calls.
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I> | ezsystems_ezpublish-legacy | train | php |
d5b430b796f3b795c95ffbac54cbac4714206763 | diff --git a/tests/test_issues.py b/tests/test_issues.py
index <HASH>..<HASH> 100644
--- a/tests/test_issues.py
+++ b/tests/test_issues.py
@@ -40,6 +40,24 @@ class IssuesTests(unittest.TestCase):
d.parse_docs(txt)
self.assertTrue(d.get_raw_docs() == expected)
+ def testIssue19(self):
+ txt = '''"""
+
+ :raises ValueError: on incorrect JSON
+ :raises requests.exceptions.HTTPError: on response error from server
+ """'''
+ expected = ''' """
+
+
+
+ :raises ValueError: on incorrect JSON
+ :raises requests.exceptions.HTTPError: on response error from server
+
+ """'''
+ docs = ds.DocString('def test():', quotes='"""')
+ docs.parse_docs(txt)
+ self.assertTrue(docs.get_raw_docs() == expected)
+
def main():
unittest.main() | Add test for issue <I> | dadadel_pyment | train | py |
ab2a999ec8eecffba1e883cfe5c81c891fb499ed | diff --git a/src/client.js b/src/client.js
index <HASH>..<HASH> 100644
--- a/src/client.js
+++ b/src/client.js
@@ -197,6 +197,11 @@ IrcClient.prototype.raw = function(input) {
} else {
args = Array.prototype.slice.call(arguments, 0);
}
+
+ args = args.filter(function(item) {
+ return (typeof item === 'number' || typeof item === 'string');
+ });
+
console.log('raw()', args);
if (args[args.length - 1].indexOf(' ') > -1) { | IrcClient.raw() to only send strings and numbers | kiwiirc_irc-framework | train | js |
dc614060fcb26e33285772e0fc0d0a11195983b7 | diff --git a/lib/meta.js b/lib/meta.js
index <HASH>..<HASH> 100644
--- a/lib/meta.js
+++ b/lib/meta.js
@@ -1022,7 +1022,35 @@ function Meta() {
// (eventually we will also parse typescript definitions)
var predefined = [
'Object',
+ 'String',
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-8.5
+ 'Number',
+ 'Infinity',
+
+ // https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8
+ 'JSON',
+ 'Boolean',
+ 'Date',
+ 'Array',
+ 'Function',
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-15.11.1
+ 'Error',
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.25
+ 'parseInt',
'Math',
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-15.10
+ 'RegExp',
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.1
+ 'escape',
+
+ // http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.2
+ 'unescape',
+
'eval',
'Window',
'console', | String, Number, Infinity, JSON, Boolean, Date, Array, Function, Error,
parseInt, Math, RegExp, escape, unescape | metascript_metascript | train | js |
5c427bcd3784e62c4e94b6b2b906d09149de0674 | diff --git a/app/controllers/ems/ems_controller.rb b/app/controllers/ems/ems_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/ems/ems_controller.rb
+++ b/app/controllers/ems/ems_controller.rb
@@ -3,6 +3,11 @@ module Ems
skip_authorization_check :only => [:index]
def index
+ # Workaround for active admin routing problem.
+ # see:
+ # http://stackoverflow.com/questions/10684566/mountable-engine-routing-with-active-admin-on-rails
+ # @todo find a nicer solution for this problem.
+ render :layout => 'ems/application'
end
end | adding activeadmin ems workaround | thebeansgroup_ems | train | rb |
e37288263dcc6cadf096c3ba9dd9afc9c5d54ce6 | diff --git a/spyderlib/widgets/mixins.py b/spyderlib/widgets/mixins.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/mixins.py
+++ b/spyderlib/widgets/mixins.py
@@ -281,7 +281,8 @@ class BaseEditMixin(object):
"""
cursor = self.__select_text(position_from, position_to)
text = to_text_string(cursor.selectedText())
- if text:
+ all_text = position_from == 'sof' and position_to == 'eof'
+ if text and not all_text:
while text.endswith("\n"):
text = text[:-1]
while text.endswith(u("\u2029")): | Editor: Don't remove last eol when using the get_text method if we get the whole file contents
- This avoids making Spyder erase the last eol in PY3 | spyder-ide_spyder | train | py |
4d263987f17dfbddf640f5c2457fe0d2625be6a9 | diff --git a/lib/mtgox/version.rb b/lib/mtgox/version.rb
index <HASH>..<HASH> 100644
--- a/lib/mtgox/version.rb
+++ b/lib/mtgox/version.rb
@@ -13,7 +13,7 @@ module MtGox
# @return [Integer]
def self.patch
- 1
+ 2
end
# @return [String, NilClass] | Bump gem version to <I> | sferik_mtgox | train | rb |
dae17bf8058151dc2cb5e8b128a8521d9dd56c88 | diff --git a/classes/BannerHelper.php b/classes/BannerHelper.php
index <HASH>..<HASH> 100644
--- a/classes/BannerHelper.php
+++ b/classes/BannerHelper.php
@@ -1804,11 +1804,11 @@ class BannerHelper extends \Frontend
*/
protected function setStatViewUpdate()
{
- if ($this->bannerCheckBot() == true)
+ if ($this->bannerCheckBot() === true)
{
return; //Bot gefunden, wird nicht gezaehlt
}
- if ($this->checkUserAgent() == true)
+ if ($this->checkUserAgent() === true)
{
return ; //User Agent Filterung
} | Fixed #<I>, Boolean should be compared strictly | BugBuster1701_banner | train | php |
569f0b3eb23d444401d00eab9f7863da8e19cb4a | diff --git a/test/test_chat_client.py b/test/test_chat_client.py
index <HASH>..<HASH> 100644
--- a/test/test_chat_client.py
+++ b/test/test_chat_client.py
@@ -105,8 +105,8 @@ def ircclient2thread(request, ircclient2):
t.setDaemon(True)
def fin():
- #ircclient2.shutdown()
- #t.join()
+ ircclient2.shutdown()
+ t.join()
pass
request.addfinalizer(fin) | Enable shutdown of ircclient2 in test | Pytwitcher_pytwitcherapi | train | py |
55f5c3bb4f61ee359af125c1d1e5acc2085738d4 | diff --git a/ceph/cephfs/cephfs-provisioner.go b/ceph/cephfs/cephfs-provisioner.go
index <HASH>..<HASH> 100644
--- a/ceph/cephfs/cephfs-provisioner.go
+++ b/ceph/cephfs/cephfs-provisioner.go
@@ -120,7 +120,7 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per
var share, user string
if deterministicNames {
share = fmt.Sprintf(options.PVC.Name)
- user = fmt.Sprintf("k8s.%s", options.PVC.Name)
+ user = fmt.Sprintf("k8s.%s.%s", options.PVC.Namespace, options.PVC.Name)
} else {
// create random share name
share = fmt.Sprintf("kubernetes-dynamic-pvc-%s", uuid.NewUUID())
@@ -137,6 +137,9 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per
"CEPH_AUTH_ID=" + adminID,
"CEPH_AUTH_KEY=" + adminSecret,
"CEPH_VOLUME_ROOT=" + pvcRoot}
+ if deterministicNames {
+ cmd.Env = append(cmd.Env, "CEPH_VOLUME_GROUP="+options.PVC.Namespace)
+ }
output, cmdErr := cmd.CombinedOutput()
if cmdErr != nil { | ceph/cephfs/cephfs-provisioner.go: When deterministicNames is enabled, add PVC namespace to Ceph client name, and pass the namespace as CEPH_VOLUME_GROUP env to cephfs_provisioner.py | kubernetes-incubator_external-storage | train | go |
017df40b335a97e447b3821b1acbb3bc7120c180 | diff --git a/guacamole/src/main/webapp/app/rest/services/tunnelService.js b/guacamole/src/main/webapp/app/rest/services/tunnelService.js
index <HASH>..<HASH> 100644
--- a/guacamole/src/main/webapp/app/rest/services/tunnelService.js
+++ b/guacamole/src/main/webapp/app/rest/services/tunnelService.js
@@ -224,7 +224,9 @@ angular.module('rest').factory('tunnelService', ['$injector',
// ends, in the browser does NOT fire the "load" event for downloads
stream.onend = function downloadComplete() {
$window.setTimeout(function cleanupIframe() {
- document.body.removeChild(iframe);
+ if (iframe.parentElement) {
+ document.body.removeChild(iframe);
+ }
}, DOWNLOAD_CLEANUP_WAIT);
}; | GUACAMOLE-<I>: Only remove download iframe if it's still attached to the DOM. | glyptodon_guacamole-client | train | js |
233579431e78257dc16979fe1fadb938faf6ea87 | diff --git a/django_productline/tasks.py b/django_productline/tasks.py
index <HASH>..<HASH> 100644
--- a/django_productline/tasks.py
+++ b/django_productline/tasks.py
@@ -92,14 +92,13 @@ def export_data_dir():
"""
from django_productline import utils
from django.conf import settings
+ import time
tasks.create_export_dir()
print('*** Exporting DATA_DIR')
- number_of_exports = len([name for name in os.listdir(settings.EXPORT_DIR)])
-
filename = '{number}.zip'.format(
- number=number_of_exports+1
+ number=time.time()
)
target_path = os.path.join(settings.EXPORT_DIR, filename)
utils.zipdir(settings.PRODUCT_CONTEXT.DATA_DIR, target_path, wrapdir='__data__') | use posix seconds instead of numbering for export archives | henzk_django-productline | train | py |
6eeec7c270ed07c04f7323321816e38364cc3ee5 | diff --git a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Dotenv/Tests/DotenvTest.php
+++ b/src/Symfony/Component/Dotenv/Tests/DotenvTest.php
@@ -320,9 +320,12 @@ class DotenvTest extends TestCase
putenv('Foo=Bar');
$dotenv = new Dotenv(true);
- $values = $dotenv->parse('Foo=${Foo}');
- $this->assertSame('Bar', $values['Foo']);
- putenv('Foo');
+ try {
+ $values = $dotenv->parse('Foo=${Foo}');
+ $this->assertSame('Bar', $values['Foo']);
+ } finally {
+ putenv('Foo');
+ }
}
} | Fixed test added in #<I> | symfony_symfony | train | php |
6804932ea757bd0460dbee2aa0ba7c9b3699e270 | diff --git a/django_extensions/management/commands/show_urls.py b/django_extensions/management/commands/show_urls.py
index <HASH>..<HASH> 100644
--- a/django_extensions/management/commands/show_urls.py
+++ b/django_extensions/management/commands/show_urls.py
@@ -143,7 +143,7 @@ class Command(BaseCommand):
views = [row.split(',') for row in views]
widths = [len(max(columns, key=len)) for columns in zip(*views)]
views = [
- ' '.join('{0:<{1}}'.format(cdata, width) for width, cdata in zip(widths, row))
+ ' '.join('{0:<{1}}'.format(cdata, width) for width, cdata in zip(widths, row))
for row in views
]
elif format_style == 'table': | show_urls -f aligned: 3 spaces between columns | django-extensions_django-extensions | train | py |
e75a3677fd30fbdf2de8218150b8d85ed87b1e37 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -16,6 +16,7 @@
// "resendPacketDelay": 150, // optional: delay between packages if light did not receive a packet (for setting methods with callback)
// "resendMaxTimes": 3, // optional: resend packages x times if light did not receive a packet (for setting methods with callback)
// "debug": false // optional: logs all messages in console if turned on
+// "address": '0.0.0.0' // optional: specify which ipv4 address to bind to
// }
// ],
//
@@ -125,7 +126,8 @@ class LifxLanPlatform {
lightOfflineTolerance: this.config.lightOfflineTolerance || 5,
messageHandlerTimeout: this.config.messageHandlerTimeout || 45000,
resendMaxTimes: this.config.resendMaxTimes || 4,
- resendPacketDelay: this.config.resendPacketDelay || 150
+ resendPacketDelay: this.config.resendPacketDelay || 150,
+ address: this.config.address || '0.0.0.0'
});
}.bind(this));
} | pass address from config into node-lifx app
This allows multiple different clients to listen on specific ipv4 addresses, allowing different processes to control the lifx bulbs. | devbobo_homebridge-lifx-lan | train | js |
befbd5769318b7323100f2beec1677f90d4c2a3e | diff --git a/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java b/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java
index <HASH>..<HASH> 100644
--- a/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java
+++ b/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java
@@ -175,7 +175,7 @@ public class LivecoinAdapters {
remainingQuantity,
new CurrencyPair(ccyA, ccyB),
map.get("id").toString(),
- DateUtils.fromUnixTime(Long.valueOf(map.get("issueTime").toString())),
+ DateUtils.fromUnixTime(Double.valueOf(map.get("issueTime").toString()).longValue()),
new BigDecimal(map.get("price").toString()),
null,
null, | can now parse exponential notation | knowm_XChange | train | java |
589c51f1cfd0c057c8f85025beb4e7e91755baa8 | diff --git a/rawdisk/plugins/filesystems/ntfs/mft.py b/rawdisk/plugins/filesystems/ntfs/mft.py
index <HASH>..<HASH> 100644
--- a/rawdisk/plugins/filesystems/ntfs/mft.py
+++ b/rawdisk/plugins/filesystems/ntfs/mft.py
@@ -54,7 +54,8 @@ class MftTable(object):
self._entries = {}
def get_entry(self, entry_id):
- """Get mft entry by index
+ """Get mft entry by index. If entry is not already loaded it will load \
+ it from file specified during :class:`MftTable` initialization.
Returns:
MftEntry: initialized :class:`~.mft_entry.MftEntry`.
@@ -78,6 +79,12 @@ class MftTable(object):
return entry
def preload_entries(self, count):
+ """Loads specified number of MFT entries
+
+ Args:
+ count (int): Number of entries to preload.
+
+ """
for n in range(0, count):
self.get_entry(n) | Additional docstrings to MftTable | dariusbakunas_rawdisk | train | py |
6bf1229fb4dcf507d80dac9ddab94285c5774b84 | diff --git a/vncdotool/pyDes.py b/vncdotool/pyDes.py
index <HASH>..<HASH> 100644
--- a/vncdotool/pyDes.py
+++ b/vncdotool/pyDes.py
@@ -24,6 +24,7 @@
# * Santiago Palladino for providing the PKCS5 padding technique.
# * Shaya for correcting the PAD_PKCS5 triple des CBC errors.
#
+# flake8: noqa
"""A pure python implementation of the DES and TRIPLE DES encryption algorithms.
Class initialization | pyDes: add noqa, external sourced file | sibson_vncdotool | train | py |
ada78066fdbccffb1da092a2470211fa252b3c99 | diff --git a/actionpack/lib/action_dispatch/middleware/request_id.rb b/actionpack/lib/action_dispatch/middleware/request_id.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/middleware/request_id.rb
+++ b/actionpack/lib/action_dispatch/middleware/request_id.rb
@@ -33,7 +33,7 @@ module ActionDispatch
end
def internal_request_id
- SecureRandom.uuid
+ SecureRandom.hex(16)
end
end
end
diff --git a/actionpack/test/dispatch/request_id_test.rb b/actionpack/test/dispatch/request_id_test.rb
index <HASH>..<HASH> 100644
--- a/actionpack/test/dispatch/request_id_test.rb
+++ b/actionpack/test/dispatch/request_id_test.rb
@@ -14,7 +14,7 @@ class RequestIdTest < ActiveSupport::TestCase
end
test "generating a request id when none is supplied" do
- assert_match /\w+-\w+-\w+-\w+-\w+/, stub_request.uuid
+ assert_match /\w+/, stub_request.uuid
end
private | Blah, SecureRandom#uuid is not supported in <I> -- cant wait for Rails <I> to drop compatibility with <I>.x | rails_rails | train | rb,rb |
c7899a990784c1356440137ecef00f3659e0371c | diff --git a/src/Model.php b/src/Model.php
index <HASH>..<HASH> 100644
--- a/src/Model.php
+++ b/src/Model.php
@@ -286,22 +286,24 @@ abstract class Model implements \JsonSerializable
return false;
}
+ $is_fresh = $this->data === null;
+
$data = $this->changes;
- $data = static::validate($data, true);
+ $data = static::validate($data, $is_fresh);
$old_primary_key = $this->getPrimaryKey();
- $update_manager = $this->data !== null && !empty(array_intersect(
+ $update_manager = !$is_fresh && !empty(array_intersect(
array_keys($data),
static::PRIMARY_KEY
));
$database = self::getDatabase();
- $stmt = ($this->data === null)
+ $stmt = ($is_fresh)
? $database->insert(static::TABLE, static::dataCleanup($data))
: $database->update(static::TABLE, $data, $old_primary_key);
if ($stmt->errorCode() == '00000') {
- if ($this->data === null) {
+ if ($is_fresh) {
/*
* It is prefered to load back because the Database may apply
* default values or alter some columns. Also, it updates | Fix save()
It was trying to validate() all columns everytime,
which should happens only if it is a fresh model. | aryelgois_Medools | train | php |
c162064ded1a724aa4fca9b425403d3f1ffb21bd | diff --git a/visidata/vdtui/editline.py b/visidata/vdtui/editline.py
index <HASH>..<HASH> 100644
--- a/visidata/vdtui/editline.py
+++ b/visidata/vdtui/editline.py
@@ -158,7 +158,7 @@ def editline(scr, y, x, w, i=0, attr=curses.A_NORMAL, value='', fillchar=' ', tr
elif ch == '^U': v = v[i:]; i = 0 # clear to beginning
elif ch == '^V': v = splice(v, i, until_get_wch()); i += 1 # literal character
elif ch == '^W': j = rfind_nonword(v, 0, i-1); v = v[:j+1] + v[i:]; i = j+1 # erase word
- elif ch == '^Z': v = suspend()
+ elif ch == '^Z': suspend()
elif history and ch == 'KEY_UP': v, i = history_state.up(v, i)
elif history and ch == 'KEY_DOWN': v, i = history_state.down(v, i)
elif ch.startswith('KEY_'): pass | [editline] suspend in editline resumes in editline | saulpw_visidata | train | py |
75906c75368dfe276b44fc114faf77979338c2ee | diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java
index <HASH>..<HASH> 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectStep.java
@@ -125,6 +125,6 @@ public final class SelectStep<S, E> extends MapStep<S, Map<String, E>> implement
@Override
public Scope recommendNextScope() {
- return this.scope.opposite();
+ return Scope.local;
}
} | SelectStep should always recommend Scope.local while SelectOneStep should always recommend Scope.global. | apache_tinkerpop | train | java |
871b3f119fc992e93dd4e3c52fdfb277ef5d6fd7 | diff --git a/src/EloquentViewableServiceProvider.php b/src/EloquentViewableServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/EloquentViewableServiceProvider.php
+++ b/src/EloquentViewableServiceProvider.php
@@ -15,7 +15,6 @@ namespace CyrildeWit\EloquentViewable;
use Illuminate\Support\ServiceProvider;
use Jaybizzle\CrawlerDetect\CrawlerDetect;
-use CyrildeWit\EloquentViewable\ViewableService;
use CyrildeWit\EloquentViewable\Contracts\CrawlerDetector;
use CyrildeWit\EloquentViewable\Contracts\View as ViewContract;
use CyrildeWit\EloquentViewable\Contracts\ViewableService as ViewableServiceContract;
diff --git a/src/Viewable.php b/src/Viewable.php
index <HASH>..<HASH> 100644
--- a/src/Viewable.php
+++ b/src/Viewable.php
@@ -14,7 +14,6 @@ declare(strict_types=1);
namespace CyrildeWit\EloquentViewable;
use Illuminate\Database\Eloquent\Builder;
-use CyrildeWit\EloquentViewable\ViewableService;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use CyrildeWit\EloquentViewable\Contracts\View as ViewContract; | style: apply fixes from StyleCI (#<I>) | cyrildewit_eloquent-viewable | train | php,php |
516a70a62d3381536f26485d416d85450963ebb5 | diff --git a/core/app/models/comable/order_item.rb b/core/app/models/comable/order_item.rb
index <HASH>..<HASH> 100644
--- a/core/app/models/comable/order_item.rb
+++ b/core/app/models/comable/order_item.rb
@@ -25,14 +25,6 @@ module Comable
# Nothing to do
end
- def unstock
- decrement_stock
- end
-
- def restock
- increment_stock
- end
-
# TODO: カート投入時との差額表示
def copy_attributes
self.attributes = current_attributes
@@ -98,24 +90,6 @@ module Comable
errors.add :quantity, Comable.t('errors.messages.out_of_stock', name: stock.name_with_sku)
end
- def stock_with_clean_quantity
- quantity_will = stock.quantity
- stock.quantity = stock.quantity_was if stock.quantity_was
- yield stock
- ensure
- stock.quantity = quantity_will
- end
-
- def decrement_stock
- stock.lock!
- stock.quantity -= quantity
- end
-
- def increment_stock
- stock.lock!
- stock.quantity += quantity
- end
-
def current_attributes
{
name: variant.name, | Remove unused methods to restock/unstock | appirits_comable | train | rb |
2aa7b0750185ebaf6c997473951d716d99817640 | diff --git a/lib/Scan.js b/lib/Scan.js
index <HASH>..<HASH> 100644
--- a/lib/Scan.js
+++ b/lib/Scan.js
@@ -65,6 +65,8 @@ Scan.prototype.exec = function (next) {
function scanByRawFilter() {
var deferred = Q.defer();
var dbClient = Model.$__.base.documentClient();
+ var AWSSet = dbClient.createSet([1, 2, 3]).constructor;
+
dbClient.scan(scanReq, function(err, data) {
if (err) {
return deferred.reject(err);
@@ -73,7 +75,15 @@ Scan.prototype.exec = function (next) {
return deferred.resolve([]);
}
return deferred.resolve(data.Items.map(function (item) {
- var model = new Model(item);
+ var model;
+
+ Object.keys(item).forEach(function (prop) {
+ if (item.hasOwnProperty(prop) && item[prop] instanceof AWSSet) {
+ item[prop] = item[prop].values;
+ }
+ });
+
+ model = new Model(item);
model.$__.isNew = false;
debug('scan parsed model', model);
return model; | When DocumentClient is used to perform a "RawAWSFilter" the returned items nows have any values of type DynamoDBSet unpacked to normal Array's to keep consistency with default scan behaviour. | dynamoosejs_dynamoose | train | js |
f36280600f8680fe9ae313d09db663195b615bc0 | diff --git a/maint/scripts/custom_fixers/fix_unicode_literal.py b/maint/scripts/custom_fixers/fix_unicode_literal.py
index <HASH>..<HASH> 100644
--- a/maint/scripts/custom_fixers/fix_unicode_literal.py
+++ b/maint/scripts/custom_fixers/fix_unicode_literal.py
@@ -1,18 +1,19 @@
-import re
-from lib2to3.pgen2 import token
from lib2to3 import fixer_base
-from lib2to3.fixer_util import Name, Call
-
-_literal_re = re.compile(r"[uU][rR]?[\'\"]")
+from lib2to3.fixer_util import String
class FixUnicodeLiteral(fixer_base.BaseFix):
BM_compatible = True
- PATTERN = """STRING"""
+ PATTERN = """
+ power< 'u'
+ trailer<
+ '('
+ arg=any
+ ')'
+ >
+ >
+ """
def transform(self, node, results):
- if node.type == token.STRING and _literal_re.match(node.value):
- new = node.clone()
- new.value = new.value[1:]
- new.prefix = ''
- node.replace(Call(Name(u'u', prefix=node.prefix), [new]))
+ arg = results["arg"]
+ node.replace(String('u'+arg.value, prefix=node.prefix)) | Invert fix_unicode_literal to switch back to real literals. | tornadoweb_tornado | train | py |
2c1627b5004f0f15875a5a0e20963f5716d4989d | diff --git a/addon/components/mdl-button.js b/addon/components/mdl-button.js
index <HASH>..<HASH> 100644
--- a/addon/components/mdl-button.js
+++ b/addon/components/mdl-button.js
@@ -20,7 +20,8 @@ export default BaseComponent.extend(RippleSupport, ClickActionSupport, {
_isIconMode: computed('icon', 'isFloating', function() {
return !this.get('isFloating') && this.get('icon');
}),
- attributeBindings: ['disabled', 'for'],
+ attributeBindings: ['disabled', 'for', 'type:buttonType'],
+ buttonType: 'button',
classNameBindings: [
'isMiniFab:mdl-button--mini-fab',
'isAccent:mdl-button--accent', | Fixes #<I> - allow customization of mdl-button type | mike-north_ember-material-lite | train | js |
18541b80ea1a7e2d6a73bf58e40bac53b97b02fd | diff --git a/openid_provider/lib/utils/params.py b/openid_provider/lib/utils/params.py
index <HASH>..<HASH> 100644
--- a/openid_provider/lib/utils/params.py
+++ b/openid_provider/lib/utils/params.py
@@ -1,7 +1,7 @@
class Params(object):
- '''
+ '''
The purpose of this class is for accesing params via dot notation.
'''
pass
\ No newline at end of file | Change tabs with spaces. Sorry. | juanifioren_django-oidc-provider | train | py |
66321eaf37ba1b9a791a52a1b614dbd70bed15a5 | diff --git a/src/server/pkg/obj/amazon_client.go b/src/server/pkg/obj/amazon_client.go
index <HASH>..<HASH> 100644
--- a/src/server/pkg/obj/amazon_client.go
+++ b/src/server/pkg/obj/amazon_client.go
@@ -428,6 +428,9 @@ func newWriter(ctx context.Context, client *amazonClient, name string) *amazonWr
Key: aws.String(name),
ContentEncoding: aws.String("application/octet-stream"),
})
+ if err != nil {
+ w.pipe.CloseWithError(err)
+ }
w.errChan <- err
}()
return w | Close pipe with error when streaming read errors | pachyderm_pachyderm | train | go |
b83a39bd865e82710cf465068187671af6d04441 | diff --git a/features/support/vagrant_helpers.rb b/features/support/vagrant_helpers.rb
index <HASH>..<HASH> 100644
--- a/features/support/vagrant_helpers.rb
+++ b/features/support/vagrant_helpers.rb
@@ -30,6 +30,12 @@ module VagrantHelpers
return [stdout, stderr] if status.success?
raise VagrantSSHCommandError, status
end
+
+ def puts(message)
+ # Attach log messages to the current cucumber feature (`log`),
+ # or simply puts to the console (`super`) if we are outside of cucumber.
+ respond_to?(:log) ? log(message) : super(message)
+ end
end
World(VagrantHelpers) | Fix cucumber `puts` deprecation warnings (#<I>)
Cucumber has deprecated `puts` in favor of `log` for logging messages to
the current cucumber formatter. In our case we actually want it both
ways: we want to log messages using the cucumber formatter when cucumber
is running, but use `Kernel#puts` otherwise.
So, use `respond_to?` to see if cucumber's `log` is available, and if
not, fall back to `puts`. | capistrano_capistrano | train | rb |
8db484dcac2b5cc2f3f3b7c7fd1d9f90080cab7e | diff --git a/raiden/raiden_service.py b/raiden/raiden_service.py
index <HASH>..<HASH> 100644
--- a/raiden/raiden_service.py
+++ b/raiden/raiden_service.py
@@ -26,6 +26,7 @@ from raiden.constants import (
RoutingMode,
)
from raiden.exceptions import (
+ BrokenPreconditionError,
InvalidAddress,
InvalidDBData,
InvalidSecret,
@@ -750,7 +751,7 @@ class RaidenService(Runnable):
log.error(str(e))
except InvalidDBData:
raise
- except RaidenUnrecoverableError as e:
+ except (RaidenUnrecoverableError, BrokenPreconditionError) as e:
log_unrecoverable = (
self.config["environment_type"] == Environment.PRODUCTION
and not self.config["unrecoverable_error_should_crash"] | Handle BrokenPrecondition exception in production mode | raiden-network_raiden | train | py |
59b87cc0b3bcfff821482310da51dae00271a6c9 | diff --git a/src/Sculpin/Tests/Functional/GenerateFromMarkdownTest.php b/src/Sculpin/Tests/Functional/GenerateFromMarkdownTest.php
index <HASH>..<HASH> 100644
--- a/src/Sculpin/Tests/Functional/GenerateFromMarkdownTest.php
+++ b/src/Sculpin/Tests/Functional/GenerateFromMarkdownTest.php
@@ -157,7 +157,10 @@ EOT;
"Expected generated file to have a single .header element."
);
- $this->assertStringContainsString($expectedHeader, $pageHeaderEl->text()); // I don't get it. This should be failing.
+ $this->assertStringContainsString(
+ $expectedHeader,
+ $pageHeaderEl->text()
+ );
$process->stop(0);
}
@@ -197,7 +200,10 @@ EOF
$this->executeSculpin('generate');
$actualOutput = $this->executeOutput;
- $this->assertStringContainsString('Skipping empty or unknown file: _posts/hello_world' . PHP_EOL, $actualOutput);
+ $this->assertStringContainsString(
+ 'Skipping empty or unknown file: _posts/hello_world' . PHP_EOL,
+ $actualOutput
+ );
$this->assertStringContainsString('Skipping empty or unknown file: _posts/hello_world2', $actualOutput);
$this->assertStringNotContainsString('Skipping empty or unknown file: _posts/hello_world3.md', $actualOutput); | Fix some line length warnings in tests
- This is a result of PHPUnit 9 switching to assertStringContainsString
- Sebastian is the best, go sponsor him: <URL> | sculpin_sculpin | train | php |
de5e5e2265a45f63de23ab6531986ddab4bda132 | diff --git a/h2o-core/src/main/java/water/Job.java b/h2o-core/src/main/java/water/Job.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/Job.java
+++ b/h2o-core/src/main/java/water/Job.java
@@ -83,7 +83,8 @@ public class Job<T extends Keyed> extends Keyed {
* @return true if job is still running else returns false. */
public static boolean isRunning(Key job_key) {
Value j = DKV.get(job_key);
- return j == null ? false : ((Job)j.get()).isRunning();
+ assert (j != null) : "Job not in DKV!";
+ return ((Job)j.get()).isRunning();
}
/** Current runtime; zero if not started */ | Assert that the job is in DKV. | h2oai_h2o-3 | train | java |
7aa5a5f4e5a03f5cd0935d73a64ec92566e7be41 | diff --git a/church/utils.py b/church/utils.py
index <HASH>..<HASH> 100644
--- a/church/utils.py
+++ b/church/utils.py
@@ -65,7 +65,6 @@ def pull(filename, locale='en'):
Open file and get content from file. Memorize result using lru_cache.
pull - is internal function, please do not use this function outside
the module 'church'.
-<<<<<<< HEAD
+------------------------------+--------------+
| Locale Code | Folder |
@@ -94,27 +93,6 @@ def pull(filename, locale='en'):
:param filename: The name of file.
:param locale: Locale.
:returns: The content of the file.
-=======
- Args:
- filename: The name of file.
- locale: Locale
-
- locale code folder
- _________________________________________
- da - Danish (data/da)
- de - German (data/de)
- en - English (data/en)
- ru - Russian (data/ru)
- fr - French (data/fr)
- es - Spanish (data/es)
- it - Italian (data/it)
- pt - Portuguese (data/pt)
- no - Norwegian (data/no)
- sv - Swedish (data/sv)
- pt-br - Brazilian Portuguese (data/pt-br)
-
- :return: The content of the file.
->>>>>>> upstream/master
"""
if locale not in SUPPORTED_LOCALES:
raise UnsupportedLocale("Locale %s does not supported" % locale) | Remove remnants from #<I> (#<I>) | lk-geimfari_mimesis | train | py |
5a6fb67f60737c0f6e84df6b560d42e198e4decd | diff --git a/jss/tools.py b/jss/tools.py
index <HASH>..<HASH> 100644
--- a/jss/tools.py
+++ b/jss/tools.py
@@ -22,6 +22,9 @@ Helper functions for python-jss.
import os
+PKG_TYPES = [".PKG", ".DMG", ".ZIP"]
+
+
def is_osx():
"""Convenience function for testing OS version."""
result = True if os.uname()[0] == "Darwin" else False
@@ -32,3 +35,23 @@ def is_linux():
"""Convenience function for testing OS version."""
result = True if os.uname()[0] == "Linux" else False
return result
+
+def is_package(filename):
+ """Return True if filename is a package type.
+
+ Args:
+ filename: String filename with no path.
+ """
+ return os.path.splitext(filename)[1].upper() in PKG_TYPES
+
+
+def is_script(filename):
+ """Return True if a filename is NOT a package.
+
+ Because there are so many script types, it's easier to see if
+ the file is a package than to see if it is a script.
+
+ Args:
+ filename: String filename with no path.
+ """
+ return not is_package(filename) | Move is_package and is_script from distribution_points to tools. | jssimporter_python-jss | train | py |
a0f311259b7af78fc1b2a889adf1904c8e5665fc | diff --git a/lib/cancan/model_adapters/active_record_5_adapter.rb b/lib/cancan/model_adapters/active_record_5_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/cancan/model_adapters/active_record_5_adapter.rb
+++ b/lib/cancan/model_adapters/active_record_5_adapter.rb
@@ -22,21 +22,9 @@ module CanCan
private
- # As of rails 4, `includes()` no longer causes active record to
- # look inside the where clause to decide to outer join tables
- # you're using in the where. Instead, `references()` is required
- # in addition to `includes()` to force the outer join.
def build_relation(*where_conditions)
relation = @model_class.where(*where_conditions)
-
- if joins.present?
- relation = if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new('5.2.0')
- relation.left_joins(joins).distinct
- else
- relation.includes(joins).references(joins)
- end
- end
-
+ relation = relation.left_joins(joins).distinct if joins.present?
relation
end | No need to check for the version number since left_joins is available since Rails <I> | CanCanCommunity_cancancan | train | rb |
720fdc90fe60aa0f137db5ba25ad4fd9aeebc90a | diff --git a/gcloud/datastore/key.py b/gcloud/datastore/key.py
index <HASH>..<HASH> 100644
--- a/gcloud/datastore/key.py
+++ b/gcloud/datastore/key.py
@@ -24,7 +24,9 @@ class Key(object):
:type dataset_id: string
:param dataset: The dataset ID assigned by back-end for the key.
- Leave as None for newly-created keys.
+ Application code should leave this field None;
+ expected to be set only by
+ :func:`gcloud.datastore.helprs.key_from_protobuf`.
"""
self._path = path or [{'kind': ''}]
self._namespace = namespace | Document that app code should not pass 'dataset_id' to 'Key.__init__'.
Only the 'helpers.key_from_protobuf' factory should pass it.
Fixes #<I>. | googleapis_google-cloud-python | train | py |
8e3e4c3651c35acbde65ba614f4d80ec568009bd | diff --git a/cmd/gomtree/main.go b/cmd/gomtree/main.go
index <HASH>..<HASH> 100644
--- a/cmd/gomtree/main.go
+++ b/cmd/gomtree/main.go
@@ -223,12 +223,12 @@ func main() {
fmt.Printf("%s missing\n", missingpath)
}
}
- } else {
- log.Println("neither validating or creating a manifest. Please provide additional arguments")
- isErr = true
- defer os.Exit(1)
- return
}
+ } else {
+ log.Println("neither validating or creating a manifest. Please provide additional arguments")
+ isErr = true
+ defer os.Exit(1)
+ return
}
} | cmd: gomtree no arguments
my tar_stream_tar_time PR accidentally put the functionality
for when gomtree has no arguments inside an unreachable block. | vbatts_go-mtree | train | go |
d528949547748fc68e85cae9483066436680924b | diff --git a/pkg/registry/pod/storage.go b/pkg/registry/pod/storage.go
index <HASH>..<HASH> 100644
--- a/pkg/registry/pod/storage.go
+++ b/pkg/registry/pod/storage.go
@@ -108,7 +108,10 @@ func (rs *RegistryStorage) List(selector labels.Selector) (interface{}, error) {
pods, err := rs.registry.ListPods(selector)
if err == nil {
for i := range pods.Items {
- rs.fillPodInfo(&pods.Items[i])
+ pod := &pods.Items[i]
+ rs.fillPodInfo(pod)
+ pod.CurrentState.Status = getPodStatus(pod)
+ pod.CurrentState.HostIP = getInstanceIP(rs.cloudProvider, pod.CurrentState.Host)
}
}
return pods, err | Fix pod status error with List method. | kubernetes_kubernetes | train | go |
54e952bda4cb7d641678e439dfad309f4d066a86 | diff --git a/recipe/common.php b/recipe/common.php
index <HASH>..<HASH> 100644
--- a/recipe/common.php
+++ b/recipe/common.php
@@ -194,7 +194,7 @@ task('deploy:vendors', function () {
if (commandExist('composer')) {
$composer = 'composer';
} else {
- run("cd {release_path} && curl -s http://getcomposer.org/installer | php");
+ run("cd {release_path} && curl -sS https://getcomposer.org/installer | php");
$composer = 'php composer.phar';
} | Fix for change to composer installer behind ssl | deployphp_deployer | train | php |
212587fa2a8e2cfb9cfce07ef042cbb411671004 | diff --git a/packages/cli/src/commands/server/runServer.js b/packages/cli/src/commands/server/runServer.js
index <HASH>..<HASH> 100644
--- a/packages/cli/src/commands/server/runServer.js
+++ b/packages/cli/src/commands/server/runServer.js
@@ -48,7 +48,6 @@ async function runServer(argv: Array<string>, ctx: ConfigT, args: Args) {
port: args.port,
resetCache: args.resetCache,
watchFolders: args.watchFolders,
- projectRoot: ctx.root,
sourceExts: args.sourceExts,
reporter,
});
diff --git a/packages/cli/src/tools/loadMetroConfig.js b/packages/cli/src/tools/loadMetroConfig.js
index <HASH>..<HASH> 100644
--- a/packages/cli/src/tools/loadMetroConfig.js
+++ b/packages/cli/src/tools/loadMetroConfig.js
@@ -71,7 +71,6 @@ export const getDefaultConfig = (ctx: ConfigT) => {
export type ConfigOptionsT = {|
maxWorkers?: number,
port?: number,
- projectRoot?: string,
resetCache?: boolean,
watchFolders?: string[],
sourceExts?: string[], | fix: don't set `projetRoot` for Metro (#<I>) | react-native-community_cli | train | js,js |
Subsets and Splits