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
|
---|---|---|---|---|---|
991e770d13fdf4b5abe94fa88afe1e4256950944 | diff --git a/client/sources/common/interpreter.py b/client/sources/common/interpreter.py
index <HASH>..<HASH> 100644
--- a/client/sources/common/interpreter.py
+++ b/client/sources/common/interpreter.py
@@ -65,6 +65,7 @@ class CodeCase(models.Case):
interact -- function; handles user interaction during the unlocking
phase.
"""
+ print(self.setup.strip())
try:
for line in self.lines:
if isinstance(line, str) and line: | Print setup code in unlocking:qa | okpy_ok-client | train | py |
0c96c4b88e2af881be0187f9f6c3db64d0a7a5c3 | diff --git a/zipkin-collector/scribe/src/main/java/zipkin/collector/scribe/ScribeCollector.java b/zipkin-collector/scribe/src/main/java/zipkin/collector/scribe/ScribeCollector.java
index <HASH>..<HASH> 100644
--- a/zipkin-collector/scribe/src/main/java/zipkin/collector/scribe/ScribeCollector.java
+++ b/zipkin-collector/scribe/src/main/java/zipkin/collector/scribe/ScribeCollector.java
@@ -42,7 +42,7 @@ public final class ScribeCollector implements CollectorComponent {
/** Configuration including defaults needed to receive spans from a Scribe category. */
public static final class Builder implements CollectorComponent.Builder {
Collector.Builder delegate = Collector.builder(ScribeCollector.class);
- CollectorMetrics metrics;
+ CollectorMetrics metrics = CollectorMetrics.NOOP_METRICS;
String category = "zipkin";
int port = 9410; | Defaults ScribeCollector to NOOP_METRICS | apache_incubator-zipkin | train | java |
4a049e5c788fc38e3aa0df34a140519bc0b03af9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -69,11 +69,11 @@ License
GPLv3.
''',
- author='Jacob Tomlinson',
- author_email='[email protected]',
- maintainer='Jacob Tomlinson',
- maintainer_email='[email protected]',
- url='https://github.com/jacobtomlinson/datapoint-python',
+ author='Jacob Tomlinson, Emlyn Price',
+ author_email='[email protected]',
+ maintainer='Emlyn Price',
+ maintainer_email='[email protected]',
+ url='https://github.com/ejep/datapoint-python',
license='GPLv3',
packages=['datapoint', 'datapoint.regions'],
classifiers=[ | Update author and maintainer details in `setup.py` | jacobtomlinson_datapoint-python | train | py |
1d47fe37cc91214eafd868a9e76bad5f0cd4f1cc | diff --git a/lyricfetch/tests/test_scraping.py b/lyricfetch/tests/test_scraping.py
index <HASH>..<HASH> 100644
--- a/lyricfetch/tests/test_scraping.py
+++ b/lyricfetch/tests/test_scraping.py
@@ -35,9 +35,9 @@ def check_site_available(site, secure=False):
try:
get_url(url, parser='raw')
- except (HTTPError, RemoteDisconnected) as error:
+ except HTTPError as error:
return False
- except URLError as error:
+ except (URLError, RemoteDisconnected) as error:
if secure:
print(type(error), error)
return False | Catch remotedisconnected in the same level as urlerrors | ocaballeror_LyricFetch | train | py |
a2485a7416a19ffb9fdc7fb0f5214e7dd9dda6b0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -130,6 +130,8 @@ setup(
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Systems Administration :: Authentication/Directory"],
ext_modules = [ | Claim we support Python <I> and <I> | mongodb-labs_winkerberos | train | py |
0fe79328e19b17eb5858797dae94363692fca20b | diff --git a/browser/subsuite.js b/browser/subsuite.js
index <HASH>..<HASH> 100644
--- a/browser/subsuite.js
+++ b/browser/subsuite.js
@@ -26,7 +26,7 @@ function SubSuite(url, parentScope) {
WCT.SubSuite = SubSuite;
// SubSuites get a pretty generous load timeout by default.
-SubSuite.loadTimeout = 5000;
+SubSuite.loadTimeout = 10000;
// We can't maintain properties on iframe elements in Firefox/Safari/???, so we
// track subSuites by URL.
@@ -91,6 +91,7 @@ SubSuite.prototype.run = function(done) {
* @param {*} error The error that occured, if any.
*/
SubSuite.prototype.loaded = function(error) {
+ WCT.util.debug('SubSuite#loaded', this.url, error);
if (this.timeoutId) {
clearTimeout(this.timeoutId);
} | Bump the load timeout for subsuites | Polymer_web-component-tester | train | js |
bd782e69415d46a3f0b65ebfc3de6ef98bcabead | diff --git a/router.go b/router.go
index <HASH>..<HASH> 100644
--- a/router.go
+++ b/router.go
@@ -320,6 +320,11 @@ func (router *Router) Reverse(action string, argValues map[string]string) *Actio
controllerName, methodName := actionSplit[0], actionSplit[1]
for _, route := range router.Routes {
+ // Skip 404s
+ if route.Action == "404" {
+ continue
+ }
+
// Check that the action matches or is a wildcard.
controllerWildcard := route.ControllerName[0] == ':'
methodWildcard := route.MethodName[0] == ':' | Have Reverse Router skip <I>s | revel_revel | train | go |
d654fa277afc9ef2dabf1f69832a708038f50b1f | diff --git a/tower_cli/resources/workflow.py b/tower_cli/resources/workflow.py
index <HASH>..<HASH> 100644
--- a/tower_cli/resources/workflow.py
+++ b/tower_cli/resources/workflow.py
@@ -156,7 +156,7 @@ class Resource(models.SurveyResource):
endpoint = '/workflow_job_templates/'
unified_job_type = '/workflow_jobs/'
dependencies = ['organization']
- related = ['survey_spec', 'workflow_nodes', 'labels']
+ related = ['survey_spec', 'workflow_nodes', 'schedules', 'labels']
workflow_node_types = ['success_nodes', 'failure_nodes', 'always_nodes']
name = models.Field(unique=True) | take care of schedules on workflow templates | ansible_tower-cli | train | py |
51c3f6bb88192db00b303faaae2ef41d80235fe2 | diff --git a/app/models/effective/array_datatable_tool.rb b/app/models/effective/array_datatable_tool.rb
index <HASH>..<HASH> 100644
--- a/app/models/effective/array_datatable_tool.rb
+++ b/app/models/effective/array_datatable_tool.rb
@@ -43,7 +43,7 @@ module Effective
search_term = search_term.downcase
collection.select! do |row|
- value = row[table_column[:index]].downcase
+ value = row[table_column[:index]].to_s.downcase
if table_column[:filter][:type] == :select && table_column[:filter][:fuzzy] != true
value == search_term | Call to_s before down casing | code-and-effect_effective_datatables | train | rb |
56a6d8de9fffcf068c368fdfe1dad2f6f173bb56 | diff --git a/src/Entities/Orders/OrderItem.php b/src/Entities/Orders/OrderItem.php
index <HASH>..<HASH> 100644
--- a/src/Entities/Orders/OrderItem.php
+++ b/src/Entities/Orders/OrderItem.php
@@ -71,11 +71,11 @@ class OrderItem
$price = $this->getItemPrice();
foreach ($this->getOptions() as $option) {
- $price = bcadd($price, $option->getPrice(), 4);
+ $price = bcadd($price, $option->getPrice(), 2);
}
foreach ($this->getExtras() as $extra) {
- $price = bcadd($price, $extra->getPrice(), 4);
+ $price = bcadd($price, $extra->getPrice(), 2);
}
return round($price, 2); | Should only be working with 2 decimals | ordercloud_ordercloud-php | train | php |
ece518e1b0c928bc4f7706a3a719623a8ec49d34 | diff --git a/tests/App/Model/Table/NationalCitiesTable.php b/tests/App/Model/Table/NationalCitiesTable.php
index <HASH>..<HASH> 100644
--- a/tests/App/Model/Table/NationalCitiesTable.php
+++ b/tests/App/Model/Table/NationalCitiesTable.php
@@ -1,10 +1,22 @@
<?php
namespace CrudJsonApi\Test\App\Model\Table;
+use Cake\Validation\Validator;
+
class NationalCitiesTable extends \Cake\ORM\Table
{
public function initialize(array $config)
{
$this->belongsTo('Countries');
}
+
+ // prevent unintentionally creating hasMany records
+ public function validationDefault(Validator $validator)
+ {
+ $validator
+ ->requirePresence('name', 'create')
+ ->notEmpty('name');
+
+ return $validator;
+ }
} | Require name field on create to prevent unintentional record creation | FriendsOfCake_crud-json-api | train | php |
a56e5adf0da3032dd830bc5babce1d0794e8e00c | diff --git a/blaze-ee-utils/src/main/java/com/blazebit/persistence/FetchUtils.java b/blaze-ee-utils/src/main/java/com/blazebit/persistence/FetchUtils.java
index <HASH>..<HASH> 100644
--- a/blaze-ee-utils/src/main/java/com/blazebit/persistence/FetchUtils.java
+++ b/blaze-ee-utils/src/main/java/com/blazebit/persistence/FetchUtils.java
@@ -166,10 +166,12 @@ public class FetchUtils {
// Parseable types do not need to be fetched, so also sub
// properties would not have to be fetched
- if (FormatUtils.isParseableType(fieldClass)
+ // Christian Beikov 14.09.13:
+ // Added check for collection and map types since fieldClass evaluates to V if the field is of type Map<K, V>
+ if (!fieldCollectionType && !fieldMapType && (FormatUtils.isParseableType(fieldClass)
|| Blob.class.equals(fieldClass)
|| Clob.class.equals(fieldClass)
- || new byte[0].getClass().equals(fieldClass)) {
+ || new byte[0].getClass().equals(fieldClass))) {
log.info(new StringBuilder("Field with name ")
.append(propertyName)
.append(" of class ") | Little fix in FetchUtils | Blazebit_blaze-utils | train | java |
5f190c9772fe47b0700a7626837a3563916f70db | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -23,7 +23,7 @@ sys.path.insert(0, os.path.abspath(os.path.join('..', 'source')))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
+needs_sphinx = '1.4'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | Documentation: Set minimal version for sphinx | DLR-RM_RAFCON | train | py |
66128092b28fc145c74f22ee19946d20cd79ba73 | diff --git a/packages/gio-load/index.js b/packages/gio-load/index.js
index <HASH>..<HASH> 100644
--- a/packages/gio-load/index.js
+++ b/packages/gio-load/index.js
@@ -1,7 +1,10 @@
'use strict';
let geotiff = require('geotiff');
-let fetch = require('node-fetch');
+
+let in_browser = typeof window !== 'undefined';
+
+if (!in_browser) var fetch = require('node-fetch');
let cache = require('../gio-cache/index');
@@ -14,9 +17,9 @@ module.exports = (url_or_file) => (
resolve(cache[url]);
} else {
fetch(url).then(
- response => response.buffer(),
+ response => in_browser ? response.arrayBuffer() : response.buffer(),
error => {
- let domain = new URL(input_url).host;
+ let domain = new URL(url).host;
console.error(
`Gio could not get the file from ${domain}.
This is often because a website's security prevents cross domain requests.
@@ -25,7 +28,7 @@ module.exports = (url_or_file) => (
}
).then(b => {
if (b) {
- let array_buffer = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
+ let array_buffer = in_browser ? b : b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
let tiff = geotiff.parse(array_buffer);
cache[url] = tiff;
resolve(tiff); | changed fetch in gio-load to use in browser version if available, to access native arraybuffer | GeoTIFF_geoblaze | train | js |
be6deb7f62079a25ef23ee62206f0f10b6f11133 | diff --git a/examples/kvsimple/kvsimple_test.go b/examples/kvsimple/kvsimple_test.go
index <HASH>..<HASH> 100644
--- a/examples/kvsimple/kvsimple_test.go
+++ b/examples/kvsimple/kvsimple_test.go
@@ -3,6 +3,7 @@ package kvsimple
import (
zmq "github.com/pebbe/zmq3"
+ "os"
"testing"
)
@@ -56,4 +57,8 @@ func TestKvmsg(t *testing.T) {
t.Error("Expected \"key\", got \"" + key + "\"")
}
kvmsg.Store(kvmap)
+
+ input.Close()
+ output.Close()
+ os.Remove("kvmsg_selftest.ipc")
} | Example: kvsimple_test: clean-up | pebbe_zmq3 | train | go |
14af59b98036aae39922af21f87c3eefeae65685 | diff --git a/lib/ProMotion/table/extensions/longpressable.rb b/lib/ProMotion/table/extensions/longpressable.rb
index <HASH>..<HASH> 100644
--- a/lib/ProMotion/table/extensions/longpressable.rb
+++ b/lib/ProMotion/table/extensions/longpressable.rb
@@ -17,7 +17,8 @@ module ProMotion
gesture_point = gesture.locationInView(table_view)
index_path = table_view.indexPathForRowAtPoint(gesture_point)
data_cell = self.promotion_table_data.cell(index_path: index_path)
- trigger_action(data_cell[:long_press_action], data_cell[:arguments]) if data_cell[:long_press_action]
+ data_cell[:arguments] ||= {}
+ trigger_action(data_cell[:long_press_action], data_cell[:arguments].merge({index_path: index_path})) if data_cell[:long_press_action]
end
end
end | Adds index_path argument to long press actions as well. | infinitered_ProMotion | train | rb |
278c2031fb4529c577c74b18938a0ae38d32226e | diff --git a/__tests__/flattenColorPalette.test.js b/__tests__/flattenColorPalette.test.js
index <HASH>..<HASH> 100644
--- a/__tests__/flattenColorPalette.test.js
+++ b/__tests__/flattenColorPalette.test.js
@@ -75,3 +75,7 @@ test('it flattens deeply nested color objects', () => {
'button-primary-focus-variant': 'orange',
})
})
+
+test('it handles empty objects', () => {
+ expect(flattenColorPalette({})).toEqual({})
+})
diff --git a/src/util/flattenColorPalette.js b/src/util/flattenColorPalette.js
index <HASH>..<HASH> 100644
--- a/src/util/flattenColorPalette.js
+++ b/src/util/flattenColorPalette.js
@@ -1,5 +1,6 @@
const flattenColorPalette = (colors) =>
Object.assign(
+ {},
...Object.entries(colors).flatMap(([color, values]) =>
typeof values == 'object'
? Object.entries(flattenColorPalette(values)).map(([number, hex]) => ({ | Fix bug where color palette could not be empty | tailwindcss_tailwindcss | train | js,js |
617bdfa21f96df97f4e552a43465d8dfc07e50b4 | diff --git a/dpxdt/server/operations.py b/dpxdt/server/operations.py
index <HASH>..<HASH> 100644
--- a/dpxdt/server/operations.py
+++ b/dpxdt/server/operations.py
@@ -43,11 +43,13 @@ def _get_versioned_hash_key(key):
versioned_key = '%s_version' % key
version = int(time.time())
if not cache.add(versioned_key, version):
- version = cache.get(versioned_key)
- if version is None:
+ val = cache.get(versioned_key)
+ if val is None:
logging.error(
'Fetching cached version for %r returned None, using %d',
versioned_key, version)
+ else:
+ version = val
return '%s:%d' % (key, version) | Set value stored in cache as version, otherwise use default | bslatkin_dpxdt | train | py |
9f1181714f2f4892ec97f8c514df8d7aff4f7d81 | diff --git a/src/Model.php b/src/Model.php
index <HASH>..<HASH> 100644
--- a/src/Model.php
+++ b/src/Model.php
@@ -183,7 +183,7 @@ abstract class Model implements Cacheable, \Serializable {
if ( $val instanceof Model ) {
$val = $val->get_pk();
- } else if ( $val instanceof \DateTimeInterface ) {
+ } else if ( $val instanceof \DateTime ) {
$val = $val->format( 'Y-m-d H:i:s' );
} else if ( isset( $val->ID ) ) {
$val = $val->ID; | DateTimeInterface is a php <I> feature, remove it infavor of just DateTime | iron-bound-designs_IronBound-DB | train | php |
cd6f4b6b3a47a4e667744dcb4824b33f1af6b04b | diff --git a/api.js b/api.js
index <HASH>..<HASH> 100755
--- a/api.js
+++ b/api.js
@@ -140,6 +140,7 @@ var createActionHero = function(){
initializerMethods.forEach(function(method){
if(typeof orderedInitializers[method] != "function"){
orderedInitializers[method] = function(next){
+ api.log("running custom initalizer: " + method);
actionHero[method](api, next)
};
} | logging for cutom init files | actionhero_actionhero | train | js |
a46c4a85c337ab0aac6815a77837c3ea47dd026c | diff --git a/salt/cloud/exceptions.py b/salt/cloud/exceptions.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/exceptions.py
+++ b/salt/cloud/exceptions.py
@@ -57,4 +57,3 @@ class SaltCloudPasswordError(SaltCloudException):
'''
Raise when virtual terminal password input failed
'''
- | Missed one lint | saltstack_salt | train | py |
808783c1e0cdc03a2c518403942504613f908ee8 | diff --git a/library/CM/Model/Abstract.php b/library/CM/Model/Abstract.php
index <HASH>..<HASH> 100644
--- a/library/CM/Model/Abstract.php
+++ b/library/CM/Model/Abstract.php
@@ -507,15 +507,25 @@ abstract class CM_Model_Abstract extends CM_Class_Abstract
/**
* @param array|null $data
* @return static
+ * @throws Exception
*/
final public static function createStatic(array $data = null) {
- if ($data === null) {
- $data = array();
+ $transaction = new Transaction();
+ try {
+ if ($data === null) {
+ $data = [];
+ }
+ $model = static::_createStatic($data);
+ $transaction->addRollback(function() use ($model) {
+ $model->delete();
+ });
+ $model->_changeContainingCacheables();
+ $model->_onCreate();
+ return $model;
+ } catch (Exception $e) {
+ $transaction->rollback();
+ throw $e;
}
- $model = static::_createStatic($data);
- $model->_changeContainingCacheables();
- $model->_onCreate();
- return $model;
}
/** | Add Transaction for Model::createStatic | cargomedia_cm | train | php |
8196051d9b0ea3bff9e91beda1d46134262d65e3 | diff --git a/lxd/device/nictype/nictype.go b/lxd/device/nictype/nictype.go
index <HASH>..<HASH> 100644
--- a/lxd/device/nictype/nictype.go
+++ b/lxd/device/nictype/nictype.go
@@ -32,6 +32,8 @@ func NICType(s *state.State, d deviceConfig.Device) (string, error) {
nicType = "macvlan"
case "sriov":
nicType = "sriov"
+ case "ovn":
+ nicType = "ovn"
default:
return "", fmt.Errorf("Unrecognised NIC network type for network %q", d["network"])
} | lxd/device/nictype: Adds ovn support | lxc_lxd | train | go |
304bdb3b441468a546abb9479c84e99a564694e6 | diff --git a/src/Codeception/Module/Phalcon1.php b/src/Codeception/Module/Phalcon1.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Module/Phalcon1.php
+++ b/src/Codeception/Module/Phalcon1.php
@@ -208,14 +208,9 @@ class Phalcon1 extends \Codeception\Util\Framework implements \Codeception\Util\
}
$this->debugSection($model, json_encode($record));
- $reflectedProperty = new \ReflectionProperty($record, 'id');
-
- if($reflectedProperty->isProtected() || $reflectedProperty->isPrivate()) {
- return $record->getId();
- }
- else {
- return $record->id;
- }
+ $reflectedProperty = new \ReflectionProperty(get_class($record), 'id');
+ $reflectedProperty->setAccessible(true);
+ return $reflectedProperty->getValue($record);
}
/** | haveRecord return id regardless to accessibility | Codeception_base | train | php |
17e16e57598fa0b4cca3274e9f5b016baedf5ea5 | diff --git a/examples/vector/main.go b/examples/vector/main.go
index <HASH>..<HASH> 100644
--- a/examples/vector/main.go
+++ b/examples/vector/main.go
@@ -175,7 +175,7 @@ func update(screen *ebiten.Image) error {
drawEbitenLogo(screen, 20, 90)
drawWave(screen, counter)
- ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f", ebiten.CurrentTPS()))
+ ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f\nFPS: %0.2f", ebiten.CurrentTPS(), ebiten.CurrentFPS()))
return nil
} | examples/vector: Add FPS | hajimehoshi_ebiten | train | go |
da46e063881581aac4cc2d1966f732d862d957fb | diff --git a/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/util/NodeIterator.java b/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/util/NodeIterator.java
index <HASH>..<HASH> 100644
--- a/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/util/NodeIterator.java
+++ b/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/util/NodeIterator.java
@@ -23,6 +23,10 @@ public class NodeIterator extends UnmodifiableIterator<INode> implements BidiIte
private INode lastReturned;
public NodeIterator(INode startWith) {
+ if (startWith == null) {
+ throw new NullPointerException();
+ }
+
this.startWith = startWith;
} | [#<I>] Prevent infinite loop with NodeIterator.
Throw NullPointerException if null is passed to NodeIterator constructor
to prevent iterator state where hasNext() and hasPrevious() always
return true, but getNext() and getPrevious() always return null. | eclipse_xtext-core | train | java |
c0803d021f34d62843a51c17984bac72bf1e9182 | diff --git a/message.go b/message.go
index <HASH>..<HASH> 100644
--- a/message.go
+++ b/message.go
@@ -457,7 +457,7 @@ type MessageApplication struct {
// MessageReference contains reference data sent with crossposted messages
type MessageReference struct {
MessageID string `json:"message_id"`
- ChannelID string `json:"channel_id"`
+ ChannelID string `json:"channel_id,omitempty"`
GuildID string `json:"guild_id,omitempty"`
} | Add omitempty to channel_id in MessageReference struct (#<I>) | bwmarrin_discordgo | train | go |
bfb3be9b84ab7d3e336dc7b9daa96c2f1f20ef4c | diff --git a/hamster/preferences.py b/hamster/preferences.py
index <HASH>..<HASH> 100755
--- a/hamster/preferences.py
+++ b/hamster/preferences.py
@@ -322,7 +322,7 @@ class PreferencesEditor:
id = storage.add_category(new_text.decode("utf-8"))
model[path][0] = id
else:
- storage.update_category(id, new_text)
+ storage.update_category(id, new_text.decode("utf-8"))
model[path][1] = new_text | while hunting for one utf-8 bug, caught another, hehe | projecthamster_hamster | train | py |
103a997d3f004676676c6b9d55672e58877abb2c | diff --git a/packages/util/browser.js b/packages/util/browser.js
index <HASH>..<HASH> 100644
--- a/packages/util/browser.js
+++ b/packages/util/browser.js
@@ -113,18 +113,33 @@ $.onEvent = function(el, name, f) {
f = bind.apply(GLOBAL, Array.prototype.slice.call(arguments, 2));
}
+ var handler = f;
+
el = $.id(el);
if(el.addEventListener) {
- el.addEventListener(name, f, false);
+ el.addEventListener(name, handler, false);
} else {
- el.attachEvent('on' + name, function(e) {
+ handler = function(e) {
var evt = e || window.event;
// TODO: normalize the event object
f(evt);
- });
+ };
+
+ el.attachEvent('on' + name, handler);
}
+
+ return bind($, 'removeEvent', el, name, handler);
};
+$.removeEvent = function(el, name, f) {
+ el = $.id(el);
+ if (el.addEventListener) {
+ el.removeEventListener(name, f, false);
+ } else {
+ el.detachEvent('on' + name, f);
+ }
+}
+
$.stopEvent = function(e) {
e.cancelBubble = true;
if(e.stopPropagation) e.stopPropagation(); | $.onEvent returns a function to disconnect the event | gameclosure_js.io | train | js |
7e525f5d9b8fe58135aaf688acb88a95b346bbf3 | diff --git a/cherrypy/process/plugins.py b/cherrypy/process/plugins.py
index <HASH>..<HASH> 100644
--- a/cherrypy/process/plugins.py
+++ b/cherrypy/process/plugins.py
@@ -460,7 +460,7 @@ class BackgroundTask(SetDaemonProperty, threading.Thread):
it won't delay stopping the whole process.
"""
- def __init__(self, interval, function, args=[], kwargs={}, bus=None, daemon=True):
+ def __init__(self, interval, function, args=[], kwargs={}, bus=None):
threading.Thread.__init__(self)
self.interval = interval
self.function = function
@@ -468,10 +468,6 @@ class BackgroundTask(SetDaemonProperty, threading.Thread):
self.kwargs = kwargs
self.running = False
self.bus = bus
- if daemon is not None:
- self.daemon = daemon
- else:
- self.daemon = current_thread().daemon
# default to daemonic
self.daemon = True | Remove changes I would have expected to have been removed in the merge. | cherrypy_cheroot | train | py |
05eec9c93ece7016a09ef8f6cba25f5629ce0bd0 | diff --git a/rails_event_store_active_record/spec/spec_helper.rb b/rails_event_store_active_record/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/rails_event_store_active_record/spec/spec_helper.rb
+++ b/rails_event_store_active_record/spec/spec_helper.rb
@@ -1,6 +1,6 @@
require 'rails_event_store_active_record'
-ENV['DATABASE_URL'] ||= "postgres://localhost/rails_event_store_active_record?pool=5"
+ENV['DATABASE_URL'] ||= "sqlite3:db.sqlite3"
ENV['RAILS_VERSION'] ||= '5.1.4'
MigrationCode = File.read(File.expand_path('../../lib/rails_event_store_active_record/generators/templates/migration_template.rb', __FILE__) ) | One development dependency less.
- we do have to check supported database engines and we do it on CI (Travis)
- we allow passing DATABASE_URL env var to explicitly select particular
database engine
With this change we use sqlite (installed from gem) as a default engine.
It does not require any further configuration and should run OOTB for
perfect first-time contributor experience. | RailsEventStore_rails_event_store | train | rb |
bd57e867657469b97bd29913478b7fcb082cfb4d | diff --git a/packages/vaex-core/vaex/groupby.py b/packages/vaex-core/vaex/groupby.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-core/vaex/groupby.py
+++ b/packages/vaex-core/vaex/groupby.py
@@ -170,7 +170,8 @@ class GroupByBase(object):
grids[column_name] = values
if isinstance(aggregate, vaex.agg.AggregatorDescriptorBasic)\
and aggregate.name == 'AggCount'\
- and aggregate.expression == "*":
+ and aggregate.expression == "*"\
+ and (aggregate.selection is None or aggregate.selection is False):
self.counts = values
for item in actions: | fix(core): wrong count was reused when using selection, introduced in #<I> | vaexio_vaex | train | py |
a6f19c909b6b01589d166d79f788d370bf672b6e | diff --git a/hbmqtt/broker.py b/hbmqtt/broker.py
index <HASH>..<HASH> 100644
--- a/hbmqtt/broker.py
+++ b/hbmqtt/broker.py
@@ -618,7 +618,6 @@ class Broker:
except Exception as e:
self.logger.error(e)
- @asyncio.coroutine
def check_connect(self, connect: ConnectPacket):
if connect.payload.client_id is None:
raise BrokerException('[[MQTT-3.1.3-3]] : Client identifier must be present' ) | remove coroutine declaration for check_connect | beerfactory_hbmqtt | train | py |
89125a835cc298d0bc98804f44d073d622ffcb0a | diff --git a/src/app/rocket/impl/ei/component/prop/file/conf/FileEiPropConfigurator.php b/src/app/rocket/impl/ei/component/prop/file/conf/FileEiPropConfigurator.php
index <HASH>..<HASH> 100644
--- a/src/app/rocket/impl/ei/component/prop/file/conf/FileEiPropConfigurator.php
+++ b/src/app/rocket/impl/ei/component/prop/file/conf/FileEiPropConfigurator.php
@@ -33,12 +33,13 @@ use n2n\persistence\meta\structure\Column;
use n2n\impl\web\dispatch\mag\model\EnumMag;
use n2n\io\managed\img\ImageDimension;
use n2n\util\config\LenientAttributeReader;
-use rocket\impl\ei\component\prop\file\command\MultiUploadEiCommand;
use n2n\impl\web\dispatch\mag\model\group\TogglerMag;
use rocket\ei\manage\generic\UnknownScalarEiPropertyException;
use rocket\ei\util\spec\EiuEngine;
use rocket\ei\EiPropPath;
use n2n\util\config\AttributesException;
+use rocket\impl\ei\component\prop\file\command\MultiUploadEiCommand;
+use rocket\impl\ei\component\prop\file\command\controller\MultiUploadEiController;
class FileEiPropConfigurator extends AdaptableEiPropConfigurator {
const ATTR_CHECK_IMAGE_MEMORY_KEY = 'checkImageResourceMemory'; | Update FileEiPropConfigurator.php | n2n_rocket | train | php |
e7e1bf87f39d47e993c16e78a7d8eeece3cc822f | diff --git a/core/src/main/java/hudson/triggers/SCMTrigger.java b/core/src/main/java/hudson/triggers/SCMTrigger.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/triggers/SCMTrigger.java
+++ b/core/src/main/java/hudson/triggers/SCMTrigger.java
@@ -128,11 +128,6 @@ public class SCMTrigger extends Trigger<Item> {
* @since 1.375
*/
public void run(Action[] additionalActions) {
- if (Jenkins.getInstance().isQuietingDown()) {
- LOGGER.log(INFO, "Skipping polling for {0} since Jenkins is in quiet mode", job.getFullName());
- return;
- }
-
DescriptorImpl d = getDescriptor();
LOGGER.fine("Scheduling a polling for "+job); | [FIXED JENKINS-<I>] Do not skip polling while quieting down | jenkinsci_jenkins | train | java |
e864d560795c5ead0e7124b9cf6a83f8bd7413e0 | diff --git a/lib/webrat/core/matchers/have_selector.rb b/lib/webrat/core/matchers/have_selector.rb
index <HASH>..<HASH> 100644
--- a/lib/webrat/core/matchers/have_selector.rb
+++ b/lib/webrat/core/matchers/have_selector.rb
@@ -38,14 +38,14 @@ module Webrat
# the supplied selector
def assert_have_selector(expected)
hs = HaveSelector.new(expected)
- raise Test::Unit::AssertionFailedError.new(hs.failure_message) unless hs.matches?(response_body)
+ assert hs.matches?(response_body), hs.failure_message
end
# Asserts that the body of the response
# does not contain the supplied string or regepx
def assert_have_no_selector(expected)
hs = HaveSelector.new(expected)
- raise Test::Unit::AssertionFailedError.new(hs.negative_failure_message) if hs.matches?(response_body)
+ assert !hs.matches?(response_body), hs.negative_failure_message
end
end | make asserts count for have_selector | brynary_webrat | train | rb |
74fe141b73c495afeb059b92903f8a7f9227c0d5 | diff --git a/fs/test.py b/fs/test.py
index <HASH>..<HASH> 100644
--- a/fs/test.py
+++ b/fs/test.py
@@ -1494,6 +1494,10 @@ class FSTestCases(object):
with self.fs.open("foo", "rb") as f:
data = f.read()
self.assertEqual(data, b"bar")
+
+ # upload to non-existing path (/foo/bar)
+ with self.assertRaises(errors.ResourceNotFound):
+ self.fs.upload("/foo/bar/baz", bytes_file)
def test_upload_chunk_size(self):
test_data = b"bar" * 128 | Assert fs.upload raises ResourceNotFound | PyFilesystem_pyfilesystem2 | train | py |
0244ab4004bf2d0d5bf28f64b2b8a07994d61674 | diff --git a/Classes/Controller/WizardController.php b/Classes/Controller/WizardController.php
index <HASH>..<HASH> 100755
--- a/Classes/Controller/WizardController.php
+++ b/Classes/Controller/WizardController.php
@@ -220,7 +220,7 @@ class WizardController extends ActionController
* @throws Exception
* @noinspection PhpUnused
*/
- public function checkFieldKey(ServerRequest $request, Response $response): Response
+ public function checkFieldKey(ServerRequest $request): Response
{
$queryParams = $request->getQueryParams();
$fieldKey = $queryParams['key'];
@@ -246,7 +246,7 @@ class WizardController extends ActionController
* @throws Exception
* @noinspection PhpUnused
*/
- public function checkElementKey(ServerRequest $request, Response $response = null): Response
+ public function checkElementKey(ServerRequest $request): Response
{
$elementKey = $request->getQueryParams()['key']; | [BUGFIX] Remove deprecated second argument for backend routes
The second argument for backend routes has been deprecated since v9.
See: <URL> | Gernott_mask | train | php |
6c369e20b80dcd3c56d32c2696a2184225f1ee07 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -34,6 +34,6 @@ elixir(function(mix) {
.copy('node_modules/admin-lte/dist/img','public/img')
.copy('node_modules/admin-lte/plugins','public/plugins')
.copy('node_modules/icheck/skins/square/blue.png','public/css')
- .copy('node_modules/icheck/skins/square/bluex2.png','public/css')
+ .copy('node_modules/icheck/skins/square/[email protected]','public/css')
.webpack('app.js');
}); | Solved error with bluex2 icon | acacha_adminlte-laravel | train | js |
f1b5640323c9fd420b85198be5177894ab569a46 | diff --git a/src/jsonapi.js b/src/jsonapi.js
index <HASH>..<HASH> 100644
--- a/src/jsonapi.js
+++ b/src/jsonapi.js
@@ -46,21 +46,23 @@ function resource({document, model, included}) {
const data = document[key]
const relationshipModel = model.associations[key].target
if (_.isArray(data)) {
- relationships[key] = _.map(data, document => {
- const id = getId({
- document,
- model: relationshipModel
- })
- included[id] = resource({
- document,
- model: relationshipModel,
- included
- })
- return resourceIdentifier({
- document,
- model: relationshipModel
+ relationships[key] = {
+ data: _.map(data, document => {
+ const id = getId({
+ document,
+ model: relationshipModel
+ })
+ included[id] = resource({
+ document,
+ model: relationshipModel,
+ included
+ })
+ return resourceIdentifier({
+ document,
+ model: relationshipModel
+ })
})
- })
+ }
} else {
const id = getId({
document: data,
@@ -71,10 +73,12 @@ function resource({document, model, included}) {
model: relationshipModel,
included
})
- return resourceIdentifier({
- document: data,
- model: relationshipModel
- })
+ relationships[key] = {
+ data: resourceIdentifier({
+ document: data,
+ model: relationshipModel
+ })
+ }
}
}) | fix: single fetch did not return any results | netiam_contrib-rest | train | js |
4d8f07c4f83437fc0a4b51104cf3e3c389f308d1 | diff --git a/upup/pkg/fi/cloudup/new_cluster.go b/upup/pkg/fi/cloudup/new_cluster.go
index <HASH>..<HASH> 100644
--- a/upup/pkg/fi/cloudup/new_cluster.go
+++ b/upup/pkg/fi/cloudup/new_cluster.go
@@ -856,9 +856,10 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
continue
}
subnet := api.ClusterSubnetSpec{
- Name: "utility-" + s.Name,
- Zone: s.Zone,
- Type: api.SubnetTypeUtility,
+ Name: "utility-" + s.Name,
+ Zone: s.Zone,
+ Type: api.SubnetTypeUtility,
+ Region: s.Region,
}
if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok {
subnet.ProviderID = subnetID | Fix GCE cluster creation with private topology
This was later failing api validation with:
`spec.subnets[1].region: Required value: region must be specified for GCE subnets`
So now we copy the region value from the equivalent non-utility subnet when creating utility subnets. | kubernetes_kops | train | go |
6e22100ce09be2746b7f43ea50f866caa69ede0d | diff --git a/host/cli/collect-debug-info.go b/host/cli/collect-debug-info.go
index <HASH>..<HASH> 100644
--- a/host/cli/collect-debug-info.go
+++ b/host/cli/collect-debug-info.go
@@ -138,6 +138,9 @@ func captureJobs(gist *Gist, env bool, lines int) error {
for _, job := range jobs {
var name string
+ if system, ok := job.Job.Metadata["flynn-system-app"]; !ok || system != "true" {
+ continue // Skip non-system applications
+ }
if app, ok := job.Job.Metadata["flynn-controller.app_name"]; ok {
name += app + "-"
} | host/cli: Only collect system app logs | flynn_flynn | train | go |
13017a5fa6ce7b77915b62fc39f6621b6f9db956 | diff --git a/lib/turbine.rb b/lib/turbine.rb
index <HASH>..<HASH> 100644
--- a/lib/turbine.rb
+++ b/lib/turbine.rb
@@ -1,6 +1,7 @@
require 'set'
# On with the library...
+require_relative 'turbine/properties'
require_relative 'turbine/edge'
require_relative 'turbine/errors'
require_relative 'turbine/graph' | Properties module needs to be required first.
... otherwise Edge doesn't load. | quintel_turbine | train | rb |
84d1cdab5949a56ca80a514bbf13e5615feee2cc | diff --git a/lib/excon/socket.rb b/lib/excon/socket.rb
index <HASH>..<HASH> 100644
--- a/lib/excon/socket.rb
+++ b/lib/excon/socket.rb
@@ -101,12 +101,12 @@ module Excon
addrinfo = ::Socket.getaddrinfo(*args)
addrinfo.each do |_, port, _, ip, a_family, s_type|
- @remote_ip = ip
-
# already succeeded on previous addrinfo
if @socket
break
end
+
+ @remote_ip = ip
# nonblocking connect
begin | FIX: set remote ip to the actual ip we connected | excon_excon | train | rb |
ae5ec727d9a130f656bc0581b71579fbe5530901 | diff --git a/fsm.go b/fsm.go
index <HASH>..<HASH> 100644
--- a/fsm.go
+++ b/fsm.go
@@ -296,7 +296,7 @@ func (f *FSM) Tick(decisionTask *PollForDecisionTaskResponse) []Decision {
e := errorEvents[i]
anOutcome, err := f.panicSafeDecide(f.errorState, context, e, outcome.data)
if err != nil {
- f.log("at=error error=error-handling-decision-execution-error err=%q state=%s next-state=%", err, f.errorState.Name, outcome.state)
+ f.log("at=error error=error-handling-decision-execution-error err=%q state=%s next-state=%s", err, f.errorState.Name, outcome.state)
//we wont get here if panics are allowed
return append(outcome.decisions, f.captureDecisionError(execution, i, errorEvents, outcome.state, outcome.data, err)...)
} | missing verb in fmt directive | sclasen_swf4go | train | go |
73472dddc108914ddfe2d888c7ce103f38905d14 | diff --git a/flubber/loop.py b/flubber/loop.py
index <HASH>..<HASH> 100644
--- a/flubber/loop.py
+++ b/flubber/loop.py
@@ -282,9 +282,6 @@ class EventLoop(object):
raise RuntimeError('event loop was not started, run() needs to be called first')
current = get_current()
assert current is not self.tasklet, 'Cannot switch to MAIN from MAIN'
- switch_out = getattr(current, 'switch_out', None)
- if switch_out is not None:
- switch_out()
try:
if self.tasklet.parent is not current:
current.parent = self.tasklet | Removed switch_out hack / feature | saghul_evergreen | train | py |
a1ff9942017ca3a113701f8bf0eccc42ad72094a | diff --git a/tests/test_optics.py b/tests/test_optics.py
index <HASH>..<HASH> 100644
--- a/tests/test_optics.py
+++ b/tests/test_optics.py
@@ -86,6 +86,11 @@ def test_cannot_set_with_fold():
b.IterableFold().set([1, 2, 3], 4)
+def test_cannot_re_with_fold():
+ with pytest.raises(TypeError):
+ b.IterableFold().re()
+
+
def test_composition_of_fold_and_setter_is_invalid():
with pytest.raises(RuntimeError):
b.IterableFold() & b.ForkedSetter() | test that you cannot re a non-review | ingolemo_python-lenses | train | py |
2db55218603ef8927eef83e79c184cedcbd73ef6 | diff --git a/resources/config/default.php b/resources/config/default.php
index <HASH>..<HASH> 100644
--- a/resources/config/default.php
+++ b/resources/config/default.php
@@ -251,7 +251,7 @@ return function (CM_Config_Node $config) {
$config->services['logger-handler-newrelic'] = [
'class' => 'CMService_NewRelic_Log_Handler',
'arguments' => [
- 'minLevel' => CM_Log_Logger::WARNING,
+ 'minLevel' => CM_Log_Logger::ERROR,
],
]; | Set minLevel for NewRelic log handler to ERROR | cargomedia_cm | train | php |
76d52cb9e4b19e7eeb1c0db3eec3e3502d1e4c3d | diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php
index <HASH>..<HASH> 100644
--- a/src/Analyser/NodeScopeResolver.php
+++ b/src/Analyser/NodeScopeResolver.php
@@ -345,10 +345,6 @@ class NodeScopeResolver
foreach ($stmt->props as $prop) {
$this->processStmtNode($prop, $scope, $nodeCallback);
}
-
- if ($stmt->type !== null) {
- $nodeCallback($stmt->type, $scope);
- }
} elseif ($stmt instanceof Node\Stmt\PropertyProperty) {
if ($stmt->default !== null) {
$this->processExprNode($stmt->default, $scope, $nodeCallback, 1); | Do not analyze Property type yet (it's for PHP <I>+) | phpstan_phpstan | train | php |
a73e0838c6643255cc0e925e2c145216e6efca58 | diff --git a/vdom/core.py b/vdom/core.py
index <HASH>..<HASH> 100644
--- a/vdom/core.py
+++ b/vdom/core.py
@@ -247,7 +247,7 @@ class VDOM(object):
return out.getvalue()
- def _repr_mimebundle_(self, include, exclude, **kwargs):
+ def _repr_mimebundle_(self, include=None, exclude=None, **kwargs):
return {'application/vdom.v1+json': self.to_dict(), 'text/plain': self.to_html()}
@classmethod | Make it so include and exclude are optional arguments (consitent with IPython's _repr_mimebundle_ | nteract_vdom | train | py |
5a52855c1da2cb4716587bf0223c6d20eddaf00a | diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/rails.rb
+++ b/lib/puppet/rails.rb
@@ -41,7 +41,7 @@ module Puppet::Rails
args = {:adapter => Puppet[:dbadapter]}
case Puppet[:dbadapter]
when "sqlite3":
- args[:database] = Puppet[:dblocation]
+ args[:dbfile] = Puppet[:dblocation]
when "mysql":
args[:host] = Puppet[:dbserver] | Fix up a problem with initialising an sqlite3 data store, presumably only with older versions of Rails
git-svn-id: <URL> | puppetlabs_puppet | train | rb |
5eae46d8bd3c4cc3531e32814fe487acc97820e4 | diff --git a/components/serverless-apollo-service/serverless.js b/components/serverless-apollo-service/serverless.js
index <HASH>..<HASH> 100644
--- a/components/serverless-apollo-service/serverless.js
+++ b/components/serverless-apollo-service/serverless.js
@@ -1,13 +1,13 @@
const { join } = require("path");
const fs = require("fs-extra");
-const { transform } = require("@babel/core");
const prettier = require("prettier");
-const { Component } = require("@serverless/core");
const webpack = require("webpack");
const execa = require("execa");
-const { trackComponent } = require("@webiny/tracking");
const loadJson = require("load-json-file");
const writeJson = require("write-json-file");
+const { transform } = require("@babel/core");
+const { Component } = require("@serverless/core");
+const { trackComponent } = require("@webiny/tracking");
const defaultDependencies = ["date-fns", "mongodb", "@webiny/api", "@webiny/api-security", "babel-loader"];
@@ -30,7 +30,7 @@ class ApolloService extends Component {
plugins = [],
env = {},
database,
- memory = 128,
+ memory = 512,
timeout = 10,
description,
endpointTypes = ["REGIONAL"], | fix: increase default memory to <I> | Webiny_webiny-js | train | js |
617f64adc5acb4a8a02a6f1898b36dcace8ba518 | diff --git a/modules/ve/ui/widgets/ve.ui.ButtonWidget.js b/modules/ve/ui/widgets/ve.ui.ButtonWidget.js
index <HASH>..<HASH> 100644
--- a/modules/ve/ui/widgets/ve.ui.ButtonWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.ButtonWidget.js
@@ -45,10 +45,6 @@ ve.mixinClass( ve.ui.ButtonWidget, ve.ui.LabeledWidget );
* @event click
*/
-/* Static Properties */
-
-ve.ui.ButtonWidget.static.tagName = 'div';
-
/* Methods */
/** | Removed static "overrides", which were only setting defaults
The default widget element type is already 'div', no need to override that.
Change-Id: Ief6ee9a7a2e<I>ea<I>a5d8e<I>ab<I>dacf | wikimedia_oojs-ui | train | js |
84eb2aba6581ee3b54345b7c0e92c1380496709d | diff --git a/lib/appsignal/version.rb b/lib/appsignal/version.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/version.rb
+++ b/lib/appsignal/version.rb
@@ -1,3 +1,3 @@
module Appsignal
- VERSION = '0.9.0.alpha.1'
+ VERSION = '0.9.0.beta.1'
end | Bump to <I>.beta<I> [ci skip] | appsignal_appsignal-ruby | train | rb |
a0e9d1c99eb72086cb9cc5311371b751dfa51fe6 | diff --git a/supertable/resources/js/MatrixInputAlt.js b/supertable/resources/js/MatrixInputAlt.js
index <HASH>..<HASH> 100644
--- a/supertable/resources/js/MatrixInputAlt.js
+++ b/supertable/resources/js/MatrixInputAlt.js
@@ -43,7 +43,7 @@ Craft.MatrixInputAlt = Garnish.Base.extend(
this.$addBlockBtnGroupBtns = this.$addBlockBtnGroup.children('.btn');
this.$addBlockMenuBtn = this.$addBlockBtnContainer.children('.menubtn');
- this.setNewBlockBtn();
+ $(window).on('load', $.proxy(this.setNewBlockBtn, this));
this.blockTypesByHandle = {}; | Set the new block buttons on window load | verbb_super-table | train | js |
6ff9a7cad722274ec3efa54cf49f754382ede791 | diff --git a/lib/ffi-glib/main_loop.rb b/lib/ffi-glib/main_loop.rb
index <HASH>..<HASH> 100644
--- a/lib/ffi-glib/main_loop.rb
+++ b/lib/ffi-glib/main_loop.rb
@@ -32,7 +32,12 @@ module GLib
setup_instance_method "run_with_thread_enabler"
def run_with_thread_enabler
- ThreadEnabler.instance.setup_idle_handler
+ case RUBY_ENGINE
+ when 'jruby'
+ when 'rbx'
+ else # 'ruby' most likely
+ ThreadEnabler.instance.setup_idle_handler
+ end
run_without_thread_enabler
end | Don't set up idle handler when not needed
JRuby and Rubinius do a fine job keeping threads running while the main
thread is off in C-land, so a separate idle handler is not needed there. | mvz_gir_ffi | train | rb |
30d65bca4896a38e0e8a9e0b3cb0b9d458454ef2 | diff --git a/tests/scripts/thread-cert/net_crypto.py b/tests/scripts/thread-cert/net_crypto.py
index <HASH>..<HASH> 100755
--- a/tests/scripts/thread-cert/net_crypto.py
+++ b/tests/scripts/thread-cert/net_crypto.py
@@ -33,8 +33,6 @@ import struct
from binascii import hexlify
-from Crypto.Cipher import AES
-
class CryptoEngine:
""" Class responsible for encryption and decryption of data. """
@@ -64,6 +62,8 @@ class CryptoEngine:
"""
key, nonce, auth_data = self._crypto_material_creator.create_key_and_nonce_and_authenticated_data(message_info)
+ from Crypto.Cipher import AES
+
cipher = AES.new(key, AES.MODE_CCM, nonce, mac_len=self.mic_length)
cipher.update(auth_data)
@@ -83,6 +83,8 @@ class CryptoEngine:
"""
key, nonce, auth_data = self._crypto_material_creator.create_key_and_nonce_and_authenticated_data(message_info)
+ from Crypto.Cipher import AES
+
cipher = AES.new(key, AES.MODE_CCM, nonce, mac_len=self.mic_length)
cipher.update(auth_data) | [thread-cert] import `Crypto` on demand (#<I>)
This commit imports `Crypto` module only when it's used.
This helps thread-cert tests that do not use message factory to run
without having to install `Crypto` module. | openthread_openthread | train | py |
c270a6f37828f42411b3c9bae73067f9813b44d0 | diff --git a/lib/liquid/tags/echo.rb b/lib/liquid/tags/echo.rb
index <HASH>..<HASH> 100644
--- a/lib/liquid/tags/echo.rb
+++ b/lib/liquid/tags/echo.rb
@@ -12,6 +12,8 @@ module Liquid
# {% echo user | link %}
#
class Echo < Tag
+ attr_reader :variable
+
def initialize(tag_name, markup, parse_context)
super
@variable = Variable.new(markup, parse_context)
@@ -20,6 +22,12 @@ module Liquid
def render(context)
@variable.render_to_output_buffer(context, +'')
end
+
+ class ParseTreeVisitor < Liquid::ParseTreeVisitor
+ def children
+ [@node.variable]
+ end
+ end
end
Template.register_tag('echo', Echo)
diff --git a/test/unit/parse_tree_visitor_test.rb b/test/unit/parse_tree_visitor_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/parse_tree_visitor_test.rb
+++ b/test/unit/parse_tree_visitor_test.rb
@@ -26,6 +26,13 @@ class ParseTreeVisitorTest < Minitest::Test
)
end
+ def test_echo
+ assert_equal(
+ ["test"],
+ visit(%({% echo test %}))
+ )
+ end
+
def test_if_condition
assert_equal(
["test"], | Add ParseTreeVisitor to Echo tag
This fixes theme-check#<I>, wherein variables used in echo tags are not
considered used by the linter. It is because our visitor doesn't see the
:variable_lookup's in the echo tag since the children array is empty.
But this array is empty because it is swallowed by the @variable. | Shopify_liquid | train | rb,rb |
8b133f95e5fbb10b50604cd305fb94f24e7234cd | diff --git a/lib/twitter.rb b/lib/twitter.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter.rb
+++ b/lib/twitter.rb
@@ -7,7 +7,7 @@ require "yajl"
module Twitter
include HTTParty
API_VERSION = "1".freeze
- format :json
+ # format :json # EVIDENTLY NOT NEEDED
class TwitterError < StandardError
attr_reader :data | Commenting out indicator to HTTParty to parse response. Responses are already being fed through YAJL it seems. This looks to be redundant | sferik_twitter | train | rb |
b44164c59e3a4d91d4012f9b1d62f52e0160a298 | diff --git a/src/Operation/Find.php b/src/Operation/Find.php
index <HASH>..<HASH> 100644
--- a/src/Operation/Find.php
+++ b/src/Operation/Find.php
@@ -218,11 +218,11 @@ class Find implements Executable
$modifiers = empty($this->options['modifiers']) ? [] : (array) $this->options['modifiers'];
if (isset($this->options['comment'])) {
- $modifiers['$comment'] = $options['comment'];
+ $modifiers['$comment'] = $this->options['comment'];
}
if (isset($this->options['maxTimeMS'])) {
- $modifiers['$maxTimeMS'] = $options['maxTimeMS'];
+ $modifiers['$maxTimeMS'] = $this->options['maxTimeMS'];
}
if ( ! empty($modifiers)) { | PHPLIB-<I>: Fix merging of comment and maxTimeMS options
Previously, the values were set to an empty value, which causes exceptions within the driver. | mongodb_mongo-php-library | train | php |
a04767d77c342ff398cd7ff710b170ae321e558f | 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
@@ -60,7 +60,7 @@ module ActionDispatch
end
class Mapping #:nodoc:
- IGNORE_OPTIONS = [:to, :as, :via, :on, :constraints, :defaults, :only, :except, :anchor, :shallow, :shallow_path, :shallow_prefix, :format]
+ IGNORE_OPTIONS = [:to, :as, :via, :on, :constraints, :defaults, :only, :except, :anchor, :shallow, :shallow_path, :shallow_prefix]
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
attr_reader :scope, :options, :requirements, :conditions, :defaults
@@ -75,7 +75,7 @@ module ActionDispatch
@default_controller = options[:controller] || scope[:controller]
@default_action = options[:action] || scope[:action]
- formatted = options[:format]
+ formatted = options.delete :format
path = normalize_path! path, formatted
ast = path_ast path | shorten up IGNORE_OPTIONS
since we are now passing the format value around, we can remove it from
the options hash, which means we don't need to consult as many values
from IGNORE_OPTIONS | rails_rails | train | rb |
1b186eab2e414dc87aa04f56f15deebc067a1d28 | diff --git a/Bundle/WidgetMapBundle/Entity/WidgetMap.php b/Bundle/WidgetMapBundle/Entity/WidgetMap.php
index <HASH>..<HASH> 100644
--- a/Bundle/WidgetMapBundle/Entity/WidgetMap.php
+++ b/Bundle/WidgetMapBundle/Entity/WidgetMap.php
@@ -279,7 +279,7 @@ class WidgetMap
public function hasChild($position)
{
foreach ($this->getChildren() as $child) {
- if ($child->getPosition() === $position) {
+ if ($child && $child->getPosition() === $position) {
return true;
}
}
@@ -294,7 +294,7 @@ class WidgetMap
{
$child = null;
foreach ($this->children as $_child) {
- if ($_child->getPosition() == $position) {
+ if ($_child && $_child->getPosition() == $position) {
$child = $_child;
}
}
@@ -309,7 +309,7 @@ class WidgetMap
{
$childs = [];
foreach ($this->children as $_child) {
- if ($_child->getPosition() == $position) {
+ if ($_child && $_child->getPosition() == $position) {
$childs[] = $_child;
}
} | check if child is not null | Victoire_victoire | train | php |
af954872c19d588f8b1911fb1939626a120d7500 | diff --git a/src/Util/Http.php b/src/Util/Http.php
index <HASH>..<HASH> 100644
--- a/src/Util/Http.php
+++ b/src/Util/Http.php
@@ -125,6 +125,8 @@ final class Http
{
$queryStrings = array();
foreach ($parameters as $parameterName => $parameterValue) {
+ $parameterName = urlencode($parameterName);
+
if (is_array($parameterValue)) {
foreach ($parameterValue as $eachValue) {
$eachValue = urlencode($eachValue);
diff --git a/tests/Util/HttpTest.php b/tests/Util/HttpTest.php
index <HASH>..<HASH> 100644
--- a/tests/Util/HttpTest.php
+++ b/tests/Util/HttpTest.php
@@ -138,7 +138,7 @@ EOT;
*/
public function buildQueryString_complexValues()
{
- $this->assertSame('abc=1%242%283&abc=4%295%2A6', H::buildQueryString(array('abc' => array('1$2(3', '4)5*6'))));
+ $this->assertSame('a+b+c=1%242%283&a+b+c=4%295%2A6', H::buildQueryString(array('a b c' => array('1$2(3', '4)5*6'))));
}
/** | Urlencode parameter names.
Parameter names need to be urlencoded as well or else they could make
things fail. | traderinteractive_util-php | train | php,php |
e47d190ae781a40652a4f08a3e7c45d37a468f1b | diff --git a/sparta.go b/sparta.go
index <HASH>..<HASH> 100644
--- a/sparta.go
+++ b/sparta.go
@@ -115,8 +115,13 @@ var CommonIAMStatements = map[string][]iamPolicyStatement{
Action: []string{"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"},
- Effect: "Allow",
- Resource: gocf.String("arn:aws:logs:*:*:*"),
+ Effect: "Allow",
+ Resource: gocf.Join("",
+ gocf.String("arn:aws:logs:"),
+ gocf.Ref("AWS::Region"),
+ gocf.String(":"),
+ gocf.Ref("AWS::AccountId"),
+ gocf.String("*")),
},
iamPolicyStatement{
Action: []string{"cloudwatch:PutMetricData"}, | Scope CloudWatch Logs ARN for lambda function log access | mweagle_Sparta | train | go |
eab9be6323758e58918a1d3034877d74311b830b | diff --git a/src/Profile.php b/src/Profile.php
index <HASH>..<HASH> 100644
--- a/src/Profile.php
+++ b/src/Profile.php
@@ -8,6 +8,7 @@ use Drutiny\Report\Format;
use Symfony\Component\Yaml\Yaml;
class Profile {
+ use \Drutiny\Sandbox\ReportingPeriodTrait;
/**
* Title of the Profile. | Extend profile to utilise reporting period | drutiny_drutiny | train | php |
3c7d8ab20f9c716652e92065767a5a44ffb21c13 | diff --git a/src/util/scroll.js b/src/util/scroll.js
index <HASH>..<HASH> 100644
--- a/src/util/scroll.js
+++ b/src/util/scroll.js
@@ -8,7 +8,8 @@ const positionStore = Object.create(null)
export function setupScroll () {
// Fix for #1585 for Firefox
- window.history.replaceState({ key: getStateKey() }, '')
+ // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
+ window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, ''))
window.addEventListener('popstate', e => {
saveScrollPosition()
if (e.state && e.state.key) { | fix: workaround replaceState bug in Safari (#<I>)
Fix #<I>
<!--
Please make sure to read the Pull Request Guidelines:
<URL> | vuejs_vue-router | train | js |
c75cf7fe157d9a2a26710f9942d2215c9be41571 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -419,7 +419,7 @@ NwBuilder.prototype.mergeAppFiles = function () {
// zip just copy the app.nw
copiedFiles.push(Utils.copyFile(
self.getZipFile(name),
- path.resolve(platform.releasePath, self.options.appName+'.app', 'Contents', 'Resources', 'nw.icns')
+ path.resolve(platform.releasePath, self.options.appName+'.app', 'Contents', 'Resources', 'app.nw')
));
}
} else { | Fix for Mac building typo
See #<I> | nwjs-community_nw-builder | train | js |
99a480d5fe0aa19c9d10e37f5535492144291f7d | diff --git a/pymysql/tests/test_connection.py b/pymysql/tests/test_connection.py
index <HASH>..<HASH> 100644
--- a/pymysql/tests/test_connection.py
+++ b/pymysql/tests/test_connection.py
@@ -66,7 +66,9 @@ class TestConnection(base.PyMySQLTestCase):
time.sleep(2)
with self.assertRaises(pymysql.OperationalError) as cm:
cur.execute("SELECT 1+1")
- self.assertEquals(cm.exception.args[0], 2006)
+ # error occures while reading, not writing because of socket buffer.
+ #self.assertEquals(cm.exception.args[0], 2006)
+ self.assertIn(cm.exception.args[0], (2006, 2013))
if __name__ == "__main__": | Allow <I> error when server closes connection. | PyMySQL_PyMySQL | train | py |
511e9bcebabc23f2f19cfa0942d8d60cfd3bd955 | diff --git a/lib/markety/lead_record.rb b/lib/markety/lead_record.rb
index <HASH>..<HASH> 100644
--- a/lib/markety/lead_record.rb
+++ b/lib/markety/lead_record.rb
@@ -13,11 +13,19 @@ module Markety
# hydrates an instance from a savon hash returned form the marketo API
def self.from_hash(savon_hash)
lead_record = LeadRecord.new(savon_hash[:email], savon_hash[:id].to_i)
-
- savon_hash[:lead_attribute_list][:attribute].each do |attribute|
- lead_record.set_attribute(attribute[:attr_name], attribute[:attr_value], attribute[:attr_type])
- end
-
+
+ unless savon_hash[:lead_attribute_list].nil?
+ if savon_hash[:lead_attribute_list][:attribute].kind_of? Hash
+ attributes = [savon_hash[:lead_attribute_list][:attribute]]
+ else
+ attributes = savon_hash[:lead_attribute_list][:attribute]
+ end
+
+ attributes.each do |attribute|
+ lead_record.set_attribute(attribute[:attr_name], attribute[:attr_value], attribute[:attr_type])
+ end
+ end
+
lead_record
end
@@ -62,4 +70,4 @@ module Markety
@idnum == other.idnum
end
end
-end
\ No newline at end of file
+end | Properly handle responses for leads with less than two attributes. Fixes #2 | davidsantoso_markety | train | rb |
ebefbbe05162af7fa7502fc0e921b973fa9d7f0f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ except:
Make sure pypandoc is installed.
"""
-version = '0.2.9'
+version = '0.2.10'
setup(
name="funcserver",
version=version, | fixes #<I>, bumped version | deep-compute_funcserver | train | py |
af0624c391ed84bca78e3556279f58bc8834cf26 | diff --git a/src/org/mozilla/javascript/optimizer/OptTransformer.java b/src/org/mozilla/javascript/optimizer/OptTransformer.java
index <HASH>..<HASH> 100644
--- a/src/org/mozilla/javascript/optimizer/OptTransformer.java
+++ b/src/org/mozilla/javascript/optimizer/OptTransformer.java
@@ -179,7 +179,8 @@ class OptTransformer extends NodeTransformer {
OptFunctionNode ofn;
ofn = (OptFunctionNode)possibleDirectCalls.get(targetName);
if (ofn != null
- && argCount == ofn.fnode.getParamCount())
+ && argCount == ofn.fnode.getParamCount()
+ && !ofn.fnode.requiresActivation())
{
// Refuse to directCall any function with more
// than 32 parameters - prevent code explosion | Apply direct call optimization only for functions that do not need activation. | mozilla_rhino | train | java |
b28fb2bb3547ce89f6a5cfe23c5445d1aa29d52b | diff --git a/retry/retry.go b/retry/retry.go
index <HASH>..<HASH> 100644
--- a/retry/retry.go
+++ b/retry/retry.go
@@ -191,9 +191,13 @@ func (s *serverStreamingRetryingStream) RecvMsg(m interface{}) error {
callCtx := perCallContext(s.parentCtx, s.callOpts, attempt)
newStream, err := s.reestablishStreamAndResendBuffer(callCtx)
if err != nil {
- // TODO(mwitkow): Maybe dial and transport errors should be retriable?
+ // Retry dial and transport errors of establishing stream as grpc doesn't retry.
+ if isRetriable(err, s.callOpts) {
+ continue
+ }
return err
}
+
s.setStream(newStream)
attemptRetry, lastErr = s.receiveMsgAndIndicateRetry(m)
//fmt.Printf("Received message and indicate: %v %v\n", attemptRetry, lastErr) | Retry dial and connection errors for grpc stream. (#<I>) | grpc-ecosystem_go-grpc-middleware | train | go |
55f75e1c418dbe1d180cef8976a5a19b39e35a96 | diff --git a/infoblox/session.py b/infoblox/session.py
index <HASH>..<HASH> 100644
--- a/infoblox/session.py
+++ b/infoblox/session.py
@@ -6,7 +6,12 @@ import json
import logging
import requests
import urllib
-import urlparse
+
+try:
+ import urlparse
+except ImportError:
+ import urllib.parse as urlparse
+
LOGGER = logging.getLogger(__name__) | Conditionally import urlparse for Py3 support | gmr_infoblox | train | py |
2d54ce11ecaabd41488faf4df49b5dee169f84bb | diff --git a/lib/WebSocketConnection.js b/lib/WebSocketConnection.js
index <HASH>..<HASH> 100644
--- a/lib/WebSocketConnection.js
+++ b/lib/WebSocketConnection.js
@@ -335,7 +335,7 @@ extend(WebSocketConnection.prototype, {
console.error((new Date()) + " " + logCloseError);
}
else {
- console.log("Remote peer " + this.remoteAddress + " requested disconnect");
+ console.log((new Date()) + "Remote peer " + this.remoteAddress + " requested disconnect");
}
this.sendCloseFrame(WebSocketConnection.CLOSE_REASON_NORMAL);
this.socket.end(); | Adding datestamp to an existing logging call | theturtle32_WebSocket-Node | train | js |
9c83aa75a72d1811830521d8fb2810acbf554a06 | diff --git a/spec/requests/basic/list/rails_admin_basic_list_spec.rb b/spec/requests/basic/list/rails_admin_basic_list_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/requests/basic/list/rails_admin_basic_list_spec.rb
+++ b/spec/requests/basic/list/rails_admin_basic_list_spec.rb
@@ -30,7 +30,8 @@ describe "RailsAdmin Basic List" do
response.body.should contain(/CREATED AT\n\s*UPDATED AT\n\s*/)
end
- it "should show column headers" do
+ pending "should show column headers" do
+ # We now have little icons too small to have big text headers.
response.body.should contain(/EDIT\n\s*DELETE\n\s*/)
end
end | Make now out-of-date spec pending. | sferik_rails_admin | train | rb |
09cb41b0647e338daeb6c6ad63d8884d0dc6675c | diff --git a/js/kucoin.js b/js/kucoin.js
index <HASH>..<HASH> 100644
--- a/js/kucoin.js
+++ b/js/kucoin.js
@@ -175,15 +175,15 @@ module.exports = class kucoin extends Exchange {
});
}
- milliseconds () {
- return super.milliseconds () - this.options['timeDifference'];
+ nonce () {
+ return this.milliseconds () - this.options['timeDifference'];
}
async loadTimeDifference () {
const before = this.milliseconds ();
const response = await this.publicGetOpenTick ();
const after = this.milliseconds ();
- this.options['timeDifference'] = parseInt ((before + after) / 2 - response['timestamp']);
+ this.options['timeDifference'] = parseInt ((this.sum (before, after) / 2) - response['timestamp']);
return this.options['timeDifference'];
}
@@ -755,7 +755,7 @@ module.exports = class kucoin extends Exchange {
if (api === 'private') {
this.checkRequiredCredentials ();
// their nonce is always a calibrated synched milliseconds-timestamp
- let nonce = this.milliseconds ();
+ let nonce = this.nonce ();
let queryString = '';
nonce = nonce.toString ();
if (Object.keys (query).length) { | renamed milliseconds to nonce for kucoin to avoid local parsing issues #<I> | ccxt_ccxt | train | js |
bc9adb2a822e0fd36c60fb7e09fd16e526132090 | diff --git a/jsonrpcserver/request.py b/jsonrpcserver/request.py
index <HASH>..<HASH> 100644
--- a/jsonrpcserver/request.py
+++ b/jsonrpcserver/request.py
@@ -186,7 +186,8 @@ class Request(object):
# Convert camelCase to underscore
if config.convert_camel_case:
self.method_name = _convert_camel_case(self.method_name)
- self.kwargs = _convert_camel_case_keys(self.kwargs)
+ if self.kwargs:
+ self.kwargs = _convert_camel_case_keys(self.kwargs)
self.response = None
def call(self, methods): | Now `convert_camel_case` works fine with array params | bcb_jsonrpcserver | train | py |
195b3c25b87313afb0c0e12c2ee5e06cc83467b6 | diff --git a/lxd/fsmonitor/drivers/driver_fanotify.go b/lxd/fsmonitor/drivers/driver_fanotify.go
index <HASH>..<HASH> 100644
--- a/lxd/fsmonitor/drivers/driver_fanotify.go
+++ b/lxd/fsmonitor/drivers/driver_fanotify.go
@@ -143,7 +143,10 @@ func (d *fanotify) getEvents(mountFd int) {
fd, err := unix.OpenByHandleAt(mountFd, fh, 0)
if err != nil {
- d.logger.Error("Failed to open file", log.Ctx{"err": err})
+ errno := err.(unix.Errno)
+ if errno != unix.ESTALE {
+ d.logger.Error("Failed to open file", log.Ctx{"err": err})
+ }
continue
}
unix.CloseOnExec(fd) | lxd/fsmonitor/drivers: Ignore stale file handle errors. | lxc_lxd | train | go |
1af072c21095ef849d8130ba0eeacde38bfaf13b | diff --git a/library/CM/CacheLocal.php b/library/CM/CacheLocal.php
index <HASH>..<HASH> 100644
--- a/library/CM/CacheLocal.php
+++ b/library/CM/CacheLocal.php
@@ -2,11 +2,11 @@
class CM_CacheLocal extends CM_Cache_Apc {
- public static function cleanLanguages() {
- self::flush();
- }
-
protected function _delete($key) {
throw new CM_Exception_NotAllowed('Cannot delete keys on local cache');
}
+
+ public static function cleanLanguages() {
+ self::flush();
+ }
} | Coding style
- Moved static method under non-static one in CM_CacheLocal | cargomedia_cm | train | php |
32dc3e221e364daf0e1638747857590aad1fc302 | diff --git a/sample/src/about/about.js b/sample/src/about/about.js
index <HASH>..<HASH> 100644
--- a/sample/src/about/about.js
+++ b/sample/src/about/about.js
@@ -21,7 +21,7 @@ export class About {
attached() {
// let bridge = System.get(System.normalizeSync('aurelia-materialize-bridge'));
// this.version = bridge.version;
- this.version = '0.20.6';
+ this.version = '0.21.0';
}
onSelectionChanged(e) { | chore(sample): bump darn version in about -.- | aurelia-ui-toolkits_aurelia-materialize-bridge | train | js |
174464210f43d085eb248566b10279f86dd68e94 | diff --git a/lib/linux_admin/yum.rb b/lib/linux_admin/yum.rb
index <HASH>..<HASH> 100644
--- a/lib/linux_admin/yum.rb
+++ b/lib/linux_admin/yum.rb
@@ -66,10 +66,9 @@ class LinuxAdmin
out = run!(cmd, :params => params).output
- items = out.split("\n")
- items.each_with_object({}) do |i, versions|
- name, version = i.split(" ", 2)
- versions[name.strip] = version.strip
+ out.split("\n").each_with_object({}) do |i, versions|
+ name, version = i.split(" ", 2)
+ versions[name.strip] = version.strip
end
end | Reduce unnecessary extra line and variable, align = signs | ManageIQ_linux_admin | train | rb |
74cc4cfb778ddd80afb8b6b2146089367f784379 | diff --git a/binding.go b/binding.go
index <HASH>..<HASH> 100644
--- a/binding.go
+++ b/binding.go
@@ -38,6 +38,7 @@ type Binding struct {
NoTemplate bool `json:"no_template"`
Optional bool `json:"optional"`
OnError BindingErrorAction `json:"on_error"`
+ SkipInheritHeaders bool `json:"skip_inherit_headers"`
server *Server
}
@@ -118,13 +119,22 @@ func (self *Binding) Evaluate(req *http.Request, header *TemplateHeader, data ma
bindingReq.URL.RawQuery = qs.Encode()
+ // if specified, have the binding request inherit the headers from the initiating request
+ if !self.SkipInheritHeaders {
+ for k, _ := range req.Header {
+ v := req.Header.Get(k)
+ log.Debugf(" binding %q: inherit %v=%v", self.Name, k, v)
+ bindingReq.Header.Set(k, v)
+ }
+ }
+
// add headers to request
for k, v := range self.Headers {
if !self.NoTemplate {
v = self.Eval(v, data, funcs)
}
- log.Debugf(" binding %q: header %v=%v", self.Name, k, v)
+ log.Debugf(" binding %q: header %v=%v", self.Name, k, v)
bindingReq.Header.Set(k, v)
} | Adding request header inheritance to bindings | ghetzel_diecast | train | go |
1a3ba10881a752c185778210a4fe93c707821dbb | diff --git a/go/chat/server.go b/go/chat/server.go
index <HASH>..<HASH> 100644
--- a/go/chat/server.go
+++ b/go/chat/server.go
@@ -4010,7 +4010,7 @@ func (h *Server) ForwardMessageConvSearch(ctx context.Context, term string) (res
return res, err
}
username := h.G().GetEnv().GetUsername().String()
- allConvs, err := h.G().InboxSource.Search(ctx, uid, term, 100, types.InboxSourceSearchEmptyModeAll)
+ allConvs, err := h.G().InboxSource.Search(ctx, uid, term, 100, types.InboxSourceSearchEmptyModeAllBySendCtime)
if err != nil {
return res, err
} | sort msg fwd options by send ctime (#<I>) | keybase_client | train | go |
9b2306514fd214f7ec7b7b83d019db64bb6ef928 | diff --git a/structr-core/src/main/java/org/structr/schema/action/Actions.java b/structr-core/src/main/java/org/structr/schema/action/Actions.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/schema/action/Actions.java
+++ b/structr-core/src/main/java/org/structr/schema/action/Actions.java
@@ -41,7 +41,6 @@ import org.structr.core.script.Scripting;
public class Actions {
private static final Logger logger = Logger.getLogger(Actions.class.getName());
- private static final ThreadLocalInt recursionDetection = new ThreadLocalInt();
public static final String NOTIFICATION_LOGIN = "onStructrLogin";
public static final String NOTIFICATION_LOGOUT = "onStructrLogout";
@@ -140,17 +139,6 @@ public class Actions {
public static Object call(final String key, final Map<String, Object> parameters) throws FrameworkException {
- final Integer depth = recursionDetection.get();
- if (depth > 100) {
-
- logger.log(Level.WARNING, "Deep recursion (>100 levels) detected, aborting.");
- return null;
-
- } else {
-
- recursionDetection.set(depth + 1);
- }
-
final SecurityContext superUserContext = SecurityContext.getSuperUserInstance();
final App app = StructrApp.getInstance(superUserContext); | Removed infinite recursion detection in new call() builtin method. | structr_structr | train | java |
fac6ef3c7fb08b2a6a07cf3124c5e72a76a9b879 | diff --git a/saltcloud/clouds/linode.py b/saltcloud/clouds/linode.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/linode.py
+++ b/saltcloud/clouds/linode.py
@@ -145,6 +145,10 @@ def create(vm_):
else:
log.error('Failed to start Salt on Cloud VM {0}'.format(vm_['name']))
+ ret = {}
log.info('Created Cloud VM {0} with the following values:'.format(vm_['name']))
for key, val in data.__dict__.items():
+ ret[key] = val
log.info(' {0}: {1}'.format(key, val))
+
+ return ret | Let linode driver use salt outputter | saltstack_salt | train | py |
f4a0a95f9ad46a1f67e490b4f9a7fc1478159de1 | diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py
index <HASH>..<HASH> 100644
--- a/salt/utils/schedule.py
+++ b/salt/utils/schedule.py
@@ -265,11 +265,11 @@ class Schedule(object):
salt.syspaths.CONFIG_DIR,
'minion.d',
'_schedule.conf')
- with salt.utils.fopen(schedule_conf, 'w+') as fp_:
- try:
+ try:
+ with salt.utils.fopen(schedule_conf, 'w+') as fp_:
fp_.write(yaml.dump({'schedule': self.opts['schedule']}))
- except (IOError, OSError):
- log.error('Failed to persist the updated schedule')
+ except (IOError, OSError):
+ log.error('Failed to persist the updated schedule')
def delete_job(self, name, where=None):
''' | Wrap opening _schedule.conf file in the try..except
Otherwise tracebacks if the file does not exist. | saltstack_salt | train | py |
03ae832717a6cb3ace6247b215b40f258e29d9b2 | diff --git a/lib/collection/request-auth/hawk.js b/lib/collection/request-auth/hawk.js
index <HASH>..<HASH> 100644
--- a/lib/collection/request-auth/hawk.js
+++ b/lib/collection/request-auth/hawk.js
@@ -33,6 +33,10 @@ module.exports = {
return request; // Nothing to do if no parameters are present.
}
+ params.nonce = params.nonce || _.randomString(6);
+ // the hawk library will generate a correct one if this is NaN.
+ params.timestamp = _.parseInt(params.timestamp);
+
request.removeHeader('Authorization', { ignoreCase: true });
result = this.sign({
credentials: {
@@ -40,7 +44,8 @@ module.exports = {
key: params.authKey,
algorithm: params.algorithm
},
- nonce: params.nonce || _.randomString(6),
+ nonce: params.nonce,
+ timestamp: params.timestamp,
ext: params.extraData,
app: params.app,
dlg: params.delegation, | ensure that the helper params are mutated, so they can be shown on the UI | postmanlabs_postman-collection | train | js |
58eef51444b9feb6dd70a7b613e04c5d47f9f686 | diff --git a/lib/ffi/bit_masks/bit_mask.rb b/lib/ffi/bit_masks/bit_mask.rb
index <HASH>..<HASH> 100644
--- a/lib/ffi/bit_masks/bit_mask.rb
+++ b/lib/ffi/bit_masks/bit_mask.rb
@@ -182,6 +182,9 @@ module FFI
return flags
end
+ def reference_required?
+ false
+ end
end
end
end | Provide #reference_required?, needed for JRuby
Without this definition, DataConverter's default implementation is used,
which requires the object to be a module. Since each BitField is an
instance of the BitField class, this check fails. | postmodern_ffi-bit_masks | train | rb |
98e805d555d354891b24d8fd1116cd6767105de5 | diff --git a/lib/wice/helpers/wice_grid_view_helpers.rb b/lib/wice/helpers/wice_grid_view_helpers.rb
index <HASH>..<HASH> 100755
--- a/lib/wice/helpers/wice_grid_view_helpers.rb
+++ b/lib/wice/helpers/wice_grid_view_helpers.rb
@@ -494,15 +494,17 @@ module Wice
grid.output_buffer << '</div>'
+
+
if Rails.env.development?
- grid.output_buffer << javascript_tag(%/ window.onload = function(){ \n/ +
+ grid.output_buffer << javascript_tag(%/ $(document).ready(function(){ \n/ +
%$ if (typeof(WiceGridProcessor) == "undefined"){\n$ +
%$ alert("wice_grid.js not loaded, WiceGrid cannot proceed!\\n" +\n$ +
%$ "Make sure that you have loaded wice_grid.js.\\n" +\n$ +
%$ "Add line\\n//= require wice_grid.js\\n" +\n$ +
%$ "to app/assets/javascripts/application.js")\n$ +
%$ }\n$ +
- %$ } $)
+ %$ }) $)
end
grid.output_buffer | replaced window.onload by .ready() | leikind_wice_grid | train | rb |
1c50dd28ae42a31d6b558dab06207b9f40a62b6d | diff --git a/salt/state.py b/salt/state.py
index <HASH>..<HASH> 100644
--- a/salt/state.py
+++ b/salt/state.py
@@ -2133,6 +2133,9 @@ class State(object):
'''
Check to see if this low chunk has been paused
'''
+ if not self.jid:
+ # Can't pause on salt-ssh since we can't track continuous state
+ return
pause_path = os.path.join(self.opts[u'cachedir'], 'state_pause', self.jid)
start = time.time()
if os.path.isfile(pause_path): | don't allow pause on salt-ssh | saltstack_salt | train | py |
59201d92f5c5e44b8a6b19fab60fd80495e705cb | diff --git a/src/main/java/org/jsoup/nodes/Element.java b/src/main/java/org/jsoup/nodes/Element.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jsoup/nodes/Element.java
+++ b/src/main/java/org/jsoup/nodes/Element.java
@@ -1284,14 +1284,7 @@ public class Element extends Node {
*/
public String wholeText() {
final StringBuilder accum = StringUtil.borrowBuilder();
- NodeTraversor.traverse(new NodeVisitor() {
- public void head(Node node, int depth) {
- appendWholeText(node, accum);
- }
-
- public void tail(Node node, int depth) {}
- }, this);
-
+ NodeTraversor.traverse((node, depth) -> appendWholeText(node, accum), this);
return StringUtil.releaseBuilder(accum);
} | Simplify traverse to lambda | jhy_jsoup | train | java |
23f2fc6dac964bf502c4eca4163e43285f278e75 | diff --git a/lib/AbstractObject.php b/lib/AbstractObject.php
index <HASH>..<HASH> 100644
--- a/lib/AbstractObject.php
+++ b/lib/AbstractObject.php
@@ -302,10 +302,10 @@ abstract class AbstractObject
);
}
*/
- if (!$class->short_name) {
+ if (!isset($class->short_name)) {
$class->short_name = str_replace('\\', '_', strtolower(get_class($class)));
}
- if (!$class->app) {
+ if (!isset($class->app)) {
$class->app = $this->app;
$class->api = $this->app; // compatibility with ATK 4.2 and lower
} | properly check for $short_name and $app existance in added object | atk4_atk4 | train | php |
f8c9692355f29e1d2ebcff52d3780040c281adcd | diff --git a/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java b/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java
+++ b/src/main/java/net/dv8tion/jda/core/managers/ChannelManagerUpdatable.java
@@ -310,7 +310,8 @@ public class ChannelManagerUpdatable
return name.shouldUpdate()
|| (topic != null && topic.shouldUpdate())
|| (userLimit != null && userLimit.shouldUpdate())
- || (bitrate != null && bitrate.shouldUpdate());
+ || (bitrate != null && bitrate.shouldUpdate())
+ || (nsfw != null && nsfw.shouldUpdate());
}
protected void checkPermission(Permission perm) | Fixed nsfw setting in channel manager | DV8FromTheWorld_JDA | train | java |
d60a324909799cf6c625fdba18852b9f5bf368e0 | diff --git a/mordred/task_panels.py b/mordred/task_panels.py
index <HASH>..<HASH> 100644
--- a/mordred/task_panels.py
+++ b/mordred/task_panels.py
@@ -63,7 +63,7 @@ class TaskPanels(Task):
def __kibiter_version(self):
""" Get the kibiter vesion """
- config_url = '/.kibana/config/_search'
+ config_url = '.kibana/config/_search'
es_url = self.conf['es_enrichment']['url']
url = urljoin(es_url + "/", config_url)
r = requests.get(url)
@@ -82,7 +82,7 @@ class TaskPanels(Task):
logger.info("Configuring Kibiter %s for default index %s and time frame %s",
kibiter_version, kibiter_default_index, kibiter_time_from)
- config_url = '/.kibana/config/' + kibiter_version
+ config_url = '.kibana/config/' + kibiter_version
kibiter_config = {
"defaultIndex": kibiter_default_index,
"timepicker:timeDefaults": | Fix wrong URL when trying to set up defaul time frame and index pattern | chaoss_grimoirelab-sirmordred | train | py |
ba79d570fda6170cd985f7a3555ea3fc7f92dc19 | diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/matcher/JsonStructRequestMatcher.java b/moco-core/src/main/java/com/github/dreamhead/moco/matcher/JsonStructRequestMatcher.java
index <HASH>..<HASH> 100644
--- a/moco-core/src/main/java/com/github/dreamhead/moco/matcher/JsonStructRequestMatcher.java
+++ b/moco-core/src/main/java/com/github/dreamhead/moco/matcher/JsonStructRequestMatcher.java
@@ -38,12 +38,12 @@ public final class JsonStructRequestMatcher extends JsonRequestMatcher {
}
if (actual.isArray() && expected.isArray()) {
- if (actual.isEmpty()) {
+ if (actual.isEmpty() || expected.isEmpty()) {
return true;
}
- JsonNode templateNode = actual.get(0);
- return Streams.stream(expected)
- .allMatch(node -> doMatch(templateNode, node));
+ JsonNode templateNode = expected.get(0);
+ return Streams.stream(actual)
+ .allMatch(node -> doMatch(node, templateNode));
}
if (actual.isBinary() && expected.isBinary()) { | fixed wrong array match in json struct request matcher | dreamhead_moco | train | java |
8e8430f3270efb2b2aab156dd3533d6a00ea86a3 | diff --git a/client/html/src/Client/Html/Basket/Standard/Default.php b/client/html/src/Client/Html/Basket/Standard/Default.php
index <HASH>..<HASH> 100644
--- a/client/html/src/Client/Html/Basket/Standard/Default.php
+++ b/client/html/src/Client/Html/Basket/Standard/Default.php
@@ -332,7 +332,7 @@ class Client_Html_Basket_Standard_Default
break;
- default:
+ case 'edit':
$products = (array) $view->param( 'b-prod', array() ); | Removes "edit" as default basket action to allow deleting coupon codes without error notification | Arcavias_arcavias-core | train | php |
e9cc22c48026e8d6c76a637d9cb594973801e184 | diff --git a/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java b/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java
+++ b/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java
@@ -426,8 +426,8 @@ public class ProxyServlet extends HttpServlet {
for (Header header : proxyResponse.getAllHeaders()) {
if (hopByHopHeaders.containsHeader(header.getName()))
continue;
- if (header.getName().equals(org.apache.http.cookie.SM.SET_COOKIE) ||
- header.getName().equals(org.apache.http.cookie.SM.SET_COOKIE2)) {
+ if (header.getName().equalsIgnoreCase(org.apache.http.cookie.SM.SET_COOKIE) ||
+ header.getName().equalsIgnoreCase(org.apache.http.cookie.SM.SET_COOKIE2)) {
copyProxyCookie(servletRequest, servletResponse, header);
} else {
servletResponse.addHeader(header.getName(), header.getValue()); | Small bug: response cookie header detection should be case-insensitive | mitre_HTTP-Proxy-Servlet | train | java |
a8170129fcb637609f3c4652be939dc5c99dd691 | diff --git a/lib/ayl/railtie.rb b/lib/ayl/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/ayl/railtie.rb
+++ b/lib/ayl/railtie.rb
@@ -6,8 +6,11 @@ module Ayl
HOOKS = [ :after_update, :after_create, :after_save ]
initializer "Ayl::Railtie.extend" do
+ # Want the ayl_send/opts at the instance level
ActiveRecord::Base.send :include, Extensions
+ # Want the instance-level stuff there.
ActiveRecord::Base.send :include, InstanceExtensions
+ # Want the ayl_send/opts at the class level as well
ActiveRecord::Base.send :extend, Extensions
end
@@ -52,6 +55,9 @@ module Ayl
# What this means is that the block will be executed after
# the model has been save/created.
#
+ # So, the self.class target for the ayl_send is because we
+ # need to call the ayl_send method at the singleton level.
+ #
send(hook) { |o| self.class.ayl_send(ahook, o) }
# This is for the worker's benefit | Added some documentation to the railtie class. | j0hnds_ayl | train | rb |
f86457fe934c7c54472d10ea59f0f157aec87fd8 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -16,8 +16,8 @@ import sys
import os
import shlex
-__version__ = '0.4.14'
-__doc_version__ = '2'
+__version__ = '0.4.15'
+__doc_version__ = '1'
#__branch__ = 'master'
#__doc_product_version__ = '0.4'
#__product__ = 'Datawire Connect'
diff --git a/quarkc/_metadata.py b/quarkc/_metadata.py
index <HASH>..<HASH> 100644
--- a/quarkc/_metadata.py
+++ b/quarkc/_metadata.py
@@ -20,7 +20,7 @@ __all__ = [
]
__title__ = 'datawire-quark'
-__version__ = '0.4.14'
+__version__ = '0.4.15'
__summary__ = "Quark: an IDL for high level (micro)service interfaces"
__uri__ = "http://datawire.github.io/quark/" | Changed version to datawire-quark, <I> (doc 1). | datawire_quark | train | py,py |
d37ed65f42baa6a46e0f04fa048889a8ad0626a9 | diff --git a/build.go b/build.go
index <HASH>..<HASH> 100644
--- a/build.go
+++ b/build.go
@@ -327,6 +327,7 @@ func buildDeb() {
{src: "man/syncthing-security.7", dst: "deb/usr/share/man/man7/syncthing-security.7", perm: 0644},
{src: "man/syncthing-versioning.7", dst: "deb/usr/share/man/man7/syncthing-versioning.7", perm: 0644},
{src: "etc/linux-systemd/system/[email protected]", dst: "deb/lib/systemd/system/[email protected]", perm: 0644},
+ {src: "etc/linux-systemd/system/syncthing-resume.service", dst: "deb/lib/systemd/system/syncthing-resume.service", perm: 0644},
{src: "etc/linux-systemd/user/syncthing.service", dst: "deb/usr/lib/systemd/user/syncthing.service", perm: 0644},
} | Include syncthing-resume systemd service in Debian package | syncthing_syncthing | train | go |
Subsets and Splits