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
|
---|---|---|---|---|---|
3169812f59d106086fbb38da3717547510f7604a | diff --git a/lib/json2angular.js b/lib/json2angular.js
index <HASH>..<HASH> 100644
--- a/lib/json2angular.js
+++ b/lib/json2angular.js
@@ -218,6 +218,10 @@
});
};
+ json2angular.createActionableElement = createActionableElement;
+ json2angular.createActionable = createActionable;
+ json2angular.createState = createState;
+
module.exports = json2angular;
}());
\ No newline at end of file | export functions on json2angular object for testing | SciSpike_yaktor-ui-angular1 | train | js |
a9d181678e1e5779332b276fe2f6b8de193c046b | diff --git a/sksurv/svm/minlip.py b/sksurv/svm/minlip.py
index <HASH>..<HASH> 100644
--- a/sksurv/svm/minlip.py
+++ b/sksurv/svm/minlip.py
@@ -380,7 +380,7 @@ class HingeLossSurvivalSVM(MinlipSurvivalAnalysis):
prob = cvxpy.Problem(obj, constraints)
solver_opts = self._get_options_cvxpy()
- prob.solve(**solver_opts)
+ prob.solve(solver=cvxpy.settings.ECOS, **solver_opts)
coef = a.value.T
sv = numpy.flatnonzero(coef > 1e-5) | Explicitly request ECOS solver for HingeLossSurvivalSVM | sebp_scikit-survival | train | py |
56d8f431ad2d85d6d82c76ccc7b136e4d482a498 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -29,9 +29,9 @@ INSTALL_REQUIRES = [
"pyserial>2.5",
"jsonmerge",
"psutil",
- "mbed-ls==1.4.2",
+ "mbed-ls>=1.4.2,==1.*",
"semver",
- "mbed-flasher==0.8.0",
+ "mbed-flasher==0.9.*",
"six"
]
if sys.version_info.major == "3": | allow mbed-ls version >= <I> (#<I>)
* allow mbed-ls version >= <I>, but restrict to 1.x
* allow mbed-flasher to be <I>.* | ARMmbed_icetea | train | py |
507466395ba5a0367160f7b7b641da22eb2b3be2 | diff --git a/urlfinderlib/urlfinderlib.py b/urlfinderlib/urlfinderlib.py
index <HASH>..<HASH> 100644
--- a/urlfinderlib/urlfinderlib.py
+++ b/urlfinderlib/urlfinderlib.py
@@ -400,7 +400,7 @@ def find_urls(thing, base_url=None, mimetype=None, log=False):
if 'urldefense.proofpoint.com/v2/url' in url:
try:
query_u=parse_qs(urlparse(url).query)['u'][0]
- decoded_url = query_u.replace('-3A', ':').replace('_', '/')
+ decoded_url = query_u.replace('-3A', ':').replace('_', '/').replace('-2D', '-')
if is_valid(decoded_url):
valid_urls.append(decoded_url)
except: | Decodes more Proofpoint URLs | IntegralDefense_urlfinderlib | train | py |
2a40571118090d04ee7900ce91c93167f2b39778 | diff --git a/lib/application.js b/lib/application.js
index <HASH>..<HASH> 100644
--- a/lib/application.js
+++ b/lib/application.js
@@ -12,6 +12,7 @@ var connect = require('connect')
, Router = require('./router')
, methods = Router.methods.concat('del', 'all')
, middleware = require('./middleware')
+ , debug = require('debug')('express:application')
, View = require('./view')
, url = require('url')
, utils = connect.utils
@@ -72,6 +73,7 @@ app.defaultConfiguration = function(){
// default settings
this.set('env', process.env.NODE_ENV || 'development');
+ debug('booting in %s mode', this.get('env'));
// implicit middleware
this.use(connect.query());
@@ -175,6 +177,7 @@ app.use = function(route, fn){
};
}
+ debug('use %s %s', route, fn.name || 'unnamed');
connect.proto.use.call(this, route, fn);
// mounted an app | Added DEBUG=express:application support | expressjs_express | train | js |
4d51f5e9af985c8172947e1600bcc9345210c822 | diff --git a/xapian_backend.py b/xapian_backend.py
index <HASH>..<HASH> 100755
--- a/xapian_backend.py
+++ b/xapian_backend.py
@@ -1068,27 +1068,17 @@ class XapianSearchQuery(BaseSearchQuery):
"""
return xapian.Query('')
- def _filter_contains(self, term, field_name, field_type, is_not):
+ def _filter_contains(self, sentence, field_name, field_type, is_not):
"""
- Private method that returns a xapian.Query that searches for `term`
- in a specified `field`.
-
- Required arguments:
- ``term`` -- The term to search for
- ``field`` -- The field to search
- ``is_not`` -- Invert the search results
-
- Returns:
- A xapian.Query
+ Splits the sentence in terms and join them with OR,
+ using stemmed and un-stemmed.
"""
- if ' ' in term:
- return self._filter_exact(term, field_name, field_type, is_not)
+ query = self._or_query(sentence.split(), field_name, field_type)
+
+ if is_not:
+ return xapian.Query(xapian.Query.OP_AND_NOT, self._all_query(), query)
else:
- query = self._term_query(term, field_name, field_type)
- if is_not:
- return xapian.Query(xapian.Query.OP_AND_NOT, self._all_query(), query)
- else:
- return query
+ return query
def _filter_in(self, term_list, field_name, field_type, is_not):
""" | Fixed #<I> - queries are now consistent with Haystack 2.X.
Refactored _filter_contains query constructor. | notanumber_xapian-haystack | train | py |
1da8df91cfad40017ce99e6aeb30dd22f36f8241 | diff --git a/src/events/handlers.js b/src/events/handlers.js
index <HASH>..<HASH> 100644
--- a/src/events/handlers.js
+++ b/src/events/handlers.js
@@ -95,7 +95,7 @@ export default {
When the keydown event is fired, we determine which function should be run
based on what was passed in.
--------------------------------------------------------------------------*/
- keydown: function(){
+ keydown: function( event ){
AmplitudeEventHelpers.runKeyEvent( event.which );
}, | Fix key bindings on Firefox
Add missing event argument to keydown event handler callback. This makes
key bindings work on Firefox. Without this, pressing a key produces a
"ReferenceError: event is not defined" error. | 521dimensions_amplitudejs | train | js |
f015dae0f58787dece123b3c456dc4f8d9071891 | diff --git a/fmn/lib/defaults.py b/fmn/lib/defaults.py
index <HASH>..<HASH> 100644
--- a/fmn/lib/defaults.py
+++ b/fmn/lib/defaults.py
@@ -244,15 +244,6 @@ def create_defaults_for(session, user, only_for=None, detail_values=None):
pref = fmn.lib.models.Preference.create(
session, user, context, detail_value=value)
- # Add a special filter that looks for mentions like @ralph
- filt = fmn.lib.models.Filter.create(
- session, "Mentions of my @username")
- pattern = '[!-~ ]*[^\w@]@%s[^\w@][!-~ ]*' % nick
- filt.add_rule(session, valid_paths,
- "fmn.rules:regex_filter", pattern=pattern)
- pref.add_filter(session, filt, notify=True)
- # END @username filter
-
# Add a filter that looks for packages of this user
filt = fmn.lib.models.Filter.create(
session, "Events on packages that I own") | Remove regex usage from the defaults. | fedora-infra_fmn.lib | train | py |
559b17c4ee9122bd0ac9637765f9a4af8d0114ea | diff --git a/core/xml.js b/core/xml.js
index <HASH>..<HASH> 100644
--- a/core/xml.js
+++ b/core/xml.js
@@ -639,7 +639,7 @@ Blockly.Xml.domToVariables = function(xmlVariables, workspace) {
var type = xmlChild.getAttribute('type');
var id = xmlChild.getAttribute('id');
var isLocal = xmlChild.getAttribute('islocal') == 'true';
- var isCloud = xmlChild.getAttribute('isCloud') == 'true';
+ var isCloud = xmlChild.getAttribute('iscloud') == 'true';
var name = xmlChild.textContent;
if (typeof(type) === undefined || type === null) { | Fix importing cloud vars from xml. | LLK_scratch-blocks | train | js |
ce2846415587955434ce3d7d9867c2898eb19db6 | diff --git a/angr/state_plugins/view.py b/angr/state_plugins/view.py
index <HASH>..<HASH> 100644
--- a/angr/state_plugins/view.py
+++ b/angr/state_plugins/view.py
@@ -54,10 +54,11 @@ class SimRegNameView(SimStatePlugin):
inspect = True
disable_actions = False
- # When simulating a Java Archive, which interacts with native libraries,
- # we need to update the instruction pointer flag, which toggles between
- # the native and the Java view on the state.
- if isinstance(self.state.project.arch, ArchSoot) and \
+ # When we execute a Java Archive that interacts with native libraries,
+ # we need to update the instruction pointer flag (which toggles between
+ # the native and the Java view on the state).
+ if self.state.project is not None and \
+ isinstance(self.state.project.arch, ArchSoot) and \
k == 'ip' and \
self.state.project.simos.is_javavm_with_jni_support:
self.state.ip_is_soot_addr = True if isinstance(v, SootAddressDescriptor) else False | Handle states with an unset project property | angr_angr | train | py |
fb2f0d6d0775e341f39ce161efbb920c0684514a | diff --git a/gdax/public_client.py b/gdax/public_client.py
index <HASH>..<HASH> 100644
--- a/gdax/public_client.py
+++ b/gdax/public_client.py
@@ -157,7 +157,7 @@ class PublicClient(object):
params['limit'] = limit
r = requests.get(url, params=params)
- r.raise_for_status()
+ # r.raise_for_status()
result.extend(r.json())
@@ -167,8 +167,8 @@ class PublicClient(object):
if limit <= 0:
return result
- # ensure that we don't get rate-limited/blocked
- time.sleep(0.4)
+ # TODO: need a way to ensure that we don't get rate-limited/blocked
+ # time.sleep(0.4)
return self.get_product_trades(product_id=product_id, after=r.headers['cb-after'], limit=limit, result=result)
return result | remove raise and comment out time.sleep | danpaquin_coinbasepro-python | train | py |
8ff1350f72017c247174c5516d6ba7fea03ad8ff | diff --git a/BAC0/__init__.py b/BAC0/__init__.py
index <HASH>..<HASH> 100644
--- a/BAC0/__init__.py
+++ b/BAC0/__init__.py
@@ -40,7 +40,7 @@ try:
#
import os
- if os.path.isfile("./.env"):
+ if os.path.isfile("{}/.env".format(os.getcwd())):
from dotenv import load_dotenv
load_dotenv() | Loading env in curretn working directory...will it work ? | ChristianTremblay_BAC0 | train | py |
3e4bfd4f077c57826d62d18ab7565c1758c77dac | diff --git a/config/environments/production.rb b/config/environments/production.rb
index <HASH>..<HASH> 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -32,4 +32,5 @@ Rails.application.configure do
config.logstasher.logger_path =
"#{Rails.root}/log/logstash_#{Rails.env}.json"
config.logstasher.source = 'logstasher'
+ config.logstasher.logger = ActiveSupport::Logger.new STDOUT
end | Change logging to stdout (#<I>) | ministryofjustice_peoplefinder | train | rb |
7300c826413495943ebe85eeed5693380add3844 | diff --git a/pypeerassets/kutil.py b/pypeerassets/kutil.py
index <HASH>..<HASH> 100644
--- a/pypeerassets/kutil.py
+++ b/pypeerassets/kutil.py
@@ -59,13 +59,13 @@ class Kutil:
'''generate an address from pubkey'''
if not compressed:
- keyhash = unhexlify(mykey._pubkeyhash + hexlify(
- new('ripemd160', sha256(mykey._pubkey).digest()).
+ keyhash = unhexlify(self._pubkeyhash + hexlify(
+ new('ripemd160', sha256(self._pubkey).digest()).
digest())
)
else:
- keyhash = unhexlify(mykey._pubkeyhash + hexlify(
- new('ripemd160', sha256(mykey._pubkey_compressed + b'01').digest()).
+ keyhash = unhexlify(self._pubkeyhash + hexlify(
+ new('ripemd160', sha256(self._pubkey_compressed + b'01').digest()).
digest())
) | Fix instance reference to self
Maintain consistency of instance reference. | PeerAssets_pypeerassets | train | py |
fd47ad1b14df0f0a9faf06a50e61c9141aee2236 | diff --git a/openfisca_core/legislationsxml.py b/openfisca_core/legislationsxml.py
index <HASH>..<HASH> 100644
--- a/openfisca_core/legislationsxml.py
+++ b/openfisca_core/legislationsxml.py
@@ -113,7 +113,7 @@ def translate_xml_element_to_json_item(xml_element):
end_line_number = getattr(xml_element, "end_line_number", None)
if start_line_number is not None:
json_element['start_line_number'] = start_line_number
- if end_line_number is not None:
+ if end_line_number is not None and end_line_number != start_line_number:
json_element['end_line_number'] = end_line_number
json_element.update(xml_element.attrib)
for xml_child in xml_element: | legislationsxml: set end line number only if different from start line number | openfisca_openfisca-core | train | py |
407762d9342fa8b2ce99e01a3631a93bde2bbfbf | diff --git a/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Csv.php b/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Csv.php
index <HASH>..<HASH> 100755
--- a/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Csv.php
+++ b/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Eparcel/Export/Csv.php
@@ -26,7 +26,9 @@ extends Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Abstract
$eparcel = new Doghouse_Australia_Eparcel();
foreach ($orders as $order) {
- $order = Mage::getModel('sales/order')->load($order);
+ if(!($order instanceof Mage_Sales_Model_Order)) {
+ $order = Mage::getModel('sales/order')->load($order);
+ }
if ( ! $order->getShippingCarrier() instanceof Fontis_Australia_Model_Shipping_Carrier_Eparcel ) {
throw new Fontis_Australia_Model_Shipping_Carrier_Eparcel_Export_Exception( | Allow preloaded orders
Function says it allows preloaded orders, but not the case.
Running the the load method requires a value, not an object.
Fixed functionality so it checks the $order variable before loading again. | fontis_fontis_australia | train | php |
eb1cc4f08e736144f6baec396fa383b20bd03495 | diff --git a/lib/toto.rb b/lib/toto.rb
index <HASH>..<HASH> 100644
--- a/lib/toto.rb
+++ b/lib/toto.rb
@@ -200,12 +200,11 @@ module Toto
end
def summary length = nil
- length ||= (config = @config[:summary]).is_a?(Hash) ? config[:max] : config
-
+ config = @config[:summary]
sum = if self[:body] =~ config[:delim]
self[:body].split(config[:delim]).first
else
- self[:body].match(/(.{1,#{length}}.*?)(\n|\Z)/m).to_s
+ self[:body].match(/(.{1,#{length || config[:length]}}.*?)(\n|\Z)/m).to_s
end
markdown(sum.length == self[:body].length ? sum : sum.strip.sub(/\.\Z/, '…'))
end
diff --git a/test/toto_test.rb b/test/toto_test.rb
index <HASH>..<HASH> 100644
--- a/test/toto_test.rb
+++ b/test/toto_test.rb
@@ -83,7 +83,7 @@ context Toto do
setup do
@config[:markdown] = true
@config[:date] = lambda {|t| "the time is #{t.strftime("%Y/%m/%d %H:%M")}" }
- @config[:summary] = 50
+ @config[:summary] = {:length => 50}
end
context "with the bare essentials" do | :summary config *has* to be a hash for now, we dont need the added complexity | cloudhead_toto | train | rb,rb |
8898bf497432f0b6b947e3961e56c366b99c2649 | diff --git a/plugins/TestRunner/TravisYml/Generator.php b/plugins/TestRunner/TravisYml/Generator.php
index <HASH>..<HASH> 100644
--- a/plugins/TestRunner/TravisYml/Generator.php
+++ b/plugins/TestRunner/TravisYml/Generator.php
@@ -40,7 +40,7 @@ abstract class Generator
{
$this->options = $options;
if (class_exists('\Piwik\Container\StaticContainer')) {
- $this->logger = \Piwik\Container\StaticContainer::get('Psr\Log\LoggerInterface');
+ $this->logger = \Piwik\Container\StaticContainer::getContainer()->get('Psr\Log\LoggerInterface');
}
$this->view = new TravisYmlView(); | Remove use of StaticContainer::get() in generate:travis-yml command for tests against older builds. | matomo-org_matomo | train | php |
2d8836b915790915cc567c9276df441712736a19 | diff --git a/src/scripts/user/user.store.js b/src/scripts/user/user.store.js
index <HASH>..<HASH> 100644
--- a/src/scripts/user/user.store.js
+++ b/src/scripts/user/user.store.js
@@ -98,8 +98,12 @@ let UserStore = Reflux.createStore({
hello('google').api('/me').then((profile) => {
this.update({google: profile});
crn.verifyUser((err, res) => {
- window.localStorage.scitranUser = JSON.stringify(res.body);
- this.update({scitran: res.body});
+ if (res.body.code === 200) {
+ window.localStorage.scitranUser = JSON.stringify(res.body);
+ this.update({scitran: res.body});
+ } else {
+ this.signOut();
+ }
});
}, () => {
this.setInitialState(); | Signout users when account can't be found | OpenNeuroOrg_openneuro | train | js |
c54c4cb215f5b825926bf41bafd847bee096ff0b | diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/converter.py
+++ b/discord/ext/commands/converter.py
@@ -818,6 +818,10 @@ class Greedy(List[T]):
def __init__(self, *, converter: T):
self.converter = converter
+ def __repr__(self):
+ converter = getattr(self.converter, '__name__', repr(self.converter))
+ return f'Greedy[{converter}]'
+
def __class_getitem__(cls, params: Union[Tuple[T], T]) -> Greedy[T]:
if not isinstance(params, tuple):
params = (params,) | [commands] Fix repr for Greedy | Rapptz_discord.py | train | py |
e8f592d53ddfb97bf9091db228010086c28450cc | diff --git a/src/SxBootstrap/Service/BootstrapResolver.php b/src/SxBootstrap/Service/BootstrapResolver.php
index <HASH>..<HASH> 100644
--- a/src/SxBootstrap/Service/BootstrapResolver.php
+++ b/src/SxBootstrap/Service/BootstrapResolver.php
@@ -122,7 +122,11 @@ class BootstrapResolver implements
protected function getPluginNames($makefile)
{
$mkdata = file_get_contents($makefile);
- preg_match('/bootstrap\:\s?\n(\n|.)*?((cat\s)(?P<files>.*?))\s>/i', $mkdata, $matches);
+
+ preg_match(
+ '/bootstrap(\:|\/js\/\*\.js: js\/\*\.js)\s?\n(\n|.)*?((cat\s)(?P<files>.*?))\s>/i',
+ $mkdata, $matches
+ );
return array_map(function($value) {
return preg_replace('/(js\/bootstrap-([\w_-]+)\.js)/', '\2', $value); | Read Makefile format changed in bootstrap <I> | SpoonX_SxBootstrap | train | php |
9db14a2d1b0524bbb4ad719336fb4e69ddbde331 | diff --git a/ibis/bigquery/compiler.py b/ibis/bigquery/compiler.py
index <HASH>..<HASH> 100644
--- a/ibis/bigquery/compiler.py
+++ b/ibis/bigquery/compiler.py
@@ -406,6 +406,7 @@ _operation_registry.update({
ops.DateAdd: _timestamp_op('DATE_ADD', {'D', 'W', 'M', 'Q', 'Y'}),
ops.DateSub: _timestamp_op('DATE_SUB', {'D', 'W', 'M', 'Q', 'Y'}),
+ ops.TimestampNow: fixed_arity('CURRENT_TIMESTAMP', 0),
})
_invalid_operations = {
diff --git a/ibis/bigquery/tests/test_compiler.py b/ibis/bigquery/tests/test_compiler.py
index <HASH>..<HASH> 100644
--- a/ibis/bigquery/tests/test_compiler.py
+++ b/ibis/bigquery/tests/test_compiler.py
@@ -501,3 +501,10 @@ def test_extract_temporal_from_timestamp(kind):
SELECT {}(`ts`) AS `tmp`
FROM t""".format(kind.upper())
assert result == expected
+
+
+def test_now():
+ expr = ibis.now()
+ result = ibis.bigquery.compile(expr)
+ expected = 'SELECT CURRENT_TIMESTAMP() AS `tmp`'
+ assert result == expected | BUG: BigQuery doesn't have a NOW() function
Closes #<I> | ibis-project_ibis | train | py,py |
4f547a0b94192a4cbad21398fc55ee342947d418 | diff --git a/lib/stripe/callbacks.rb b/lib/stripe/callbacks.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe/callbacks.rb
+++ b/lib/stripe/callbacks.rb
@@ -47,6 +47,7 @@ module Stripe
callback 'invoice.created'
callback 'invoice.finalized'
callback 'invoice.marked_uncollectible'
+ callback 'invoice.payment_action_required'
callback 'invoice.payment_failed'
callback 'invoice.payment_succeeded'
callback 'invoice.sent' | adding callback for invoice.payment_action_required | tansengming_stripe-rails | train | rb |
f9a5130f2bbaef62c9eedd790ea9bfdcedde7ab7 | diff --git a/mtp_common/build_tasks/tasks.py b/mtp_common/build_tasks/tasks.py
index <HASH>..<HASH> 100644
--- a/mtp_common/build_tasks/tasks.py
+++ b/mtp_common/build_tasks/tasks.py
@@ -114,7 +114,7 @@ def test(context: Context, test_labels=None, functional_tests=False, accessibili
if webdriver:
os.environ['WEBDRIVER'] = webdriver
test_labels = (test_labels or '').split()
- return context.management_command('test', args=test_labels, interactive=False)
+ return context.management_command('test', *test_labels, interactive=False)
@tasks.register(hidden=True) | Fix call to run django test management command | ministryofjustice_money-to-prisoners-common | train | py |
f3e8bfb4e3a9a61f1d9a5bb7ffcca79fcde964db | diff --git a/js/zb.js b/js/zb.js
index <HASH>..<HASH> 100644
--- a/js/zb.js
+++ b/js/zb.js
@@ -1414,6 +1414,9 @@ module.exports = class zb extends Exchange {
}
async cancelOrder (id, symbol = undefined, params = {}) {
+ if (symbol === undefined) {
+ throw new ArgumentsRequired (this.id + ' cancelOrder() requires a symbol argument');
+ }
await this.loadMarkets ();
const market = this.market (symbol);
const swap = market['swap']; | Added ArgumentsRequired check for symbol | ccxt_ccxt | train | js |
1145eb123d191aebd688aeb7ba32842b221605c2 | diff --git a/test/lib/rules/disallow-positionalparams-extend.js b/test/lib/rules/disallow-positionalparams-extend.js
index <HASH>..<HASH> 100644
--- a/test/lib/rules/disallow-positionalparams-extend.js
+++ b/test/lib/rules/disallow-positionalparams-extend.js
@@ -28,9 +28,9 @@ describe('lib/rules/disallow-positionalparams-extend', function () {
it: 'should not report reopened class',
code: function() {
var Thing = Ember.Component.extend();
- //Thing.reopenClass({
- // positionalParams: [ 'a', 'b' ]
- //});
+ Thing.reopenClass({
+ positionalParams: [ 'a', 'b' ]
+ });
}
}, {
it: 'should report deprecated use', | Uncomment class reopening in test | minichate_jscs-ember-deprecations | train | js |
9798d0f4b74ec277a9635486324e750a7f82d61f | diff --git a/src/directives/snapscroll.js b/src/directives/snapscroll.js
index <HASH>..<HASH> 100644
--- a/src/directives/snapscroll.js
+++ b/src/directives/snapscroll.js
@@ -191,10 +191,22 @@
});
};
+ function getSnapIndex(scrollTop) {
+ var snapIndex = -1,
+ snaps = element.children(),
+ lastSnapHeight;
+ while (scrollTop > 0) {
+ scrollTop -= lastSnapHeight = snaps[++snapIndex].offsetHeight;
+ }
+ if ((lastSnapHeight / 2) >= -scrollTop) {
+ snapIndex += 1;
+ }
+ return snapIndex;
+ }
+
onScroll = function () {
var snap = function () {
- var top = element[0].scrollTop,
- newSnapIndex = Math.round(top / scope.snapHeight);
+ var newSnapIndex = getSnapIndex(element[0].scrollTop);
if (scope.snapIndex === newSnapIndex) {
snapTo(newSnapIndex);
} else { | Calcuate new snapIndex from the combined heights of snaps
Add algorithm for figuring out the new snap index after a manual
scroll, that does not depend on the snapHeight. Now snapHeight is
surely not needed anymore.
Ref #<I> | joelmukuthu_angular-snapscroll | train | js |
c9c88549f2b7f34cf142d53f752b9563bc231587 | diff --git a/rabbiteasy-core/src/test/java/com/zanox/rabbiteasy/consumer/ConsumerContainerIT.java b/rabbiteasy-core/src/test/java/com/zanox/rabbiteasy/consumer/ConsumerContainerIT.java
index <HASH>..<HASH> 100644
--- a/rabbiteasy-core/src/test/java/com/zanox/rabbiteasy/consumer/ConsumerContainerIT.java
+++ b/rabbiteasy-core/src/test/java/com/zanox/rabbiteasy/consumer/ConsumerContainerIT.java
@@ -71,7 +71,7 @@ public class ConsumerContainerIT {
LOGGER.debug("Connection closed");
Thread.sleep(SingleConnectionFactory.CONNECTION_ESTABLISH_INTERVAL_IN_MS * 3);
connectionFactory.setHost(brokerSetup.getHost());
- Thread.sleep(SingleConnectionFactory.CONNECTION_ESTABLISH_INTERVAL_IN_MS * 2);
+ Thread.sleep(SingleConnectionFactory.CONNECTION_ESTABLISH_INTERVAL_IN_MS * 10);
LOGGER.debug("Performing assert");
activeConsumerCount = consumerContainer.getActiveConsumers().size();
Assert.assertEquals(1, activeConsumerCount); | Added logging to debug test. | awin_rabbiteasy | train | java |
ce6332ce71d6598de08d46aecfe6e09c8b2e78bf | diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private $requestStackSize = 0;
private $resetServices = false;
- const VERSION = '4.3.6';
- const VERSION_ID = 40306;
+ const VERSION = '4.3.7-DEV';
+ const VERSION_ID = 40307;
const MAJOR_VERSION = 4;
const MINOR_VERSION = 3;
- const RELEASE_VERSION = 6;
- const EXTRA_VERSION = '';
+ const RELEASE_VERSION = 7;
+ const EXTRA_VERSION = 'DEV';
const END_OF_MAINTENANCE = '01/2020';
const END_OF_LIFE = '07/2020'; | bumped Symfony version to <I> | symfony_symfony | train | php |
8e61e35748d16f2c4f5a45802a64426616c81edc | diff --git a/owncloud/test/test.py b/owncloud/test/test.py
index <HASH>..<HASH> 100644
--- a/owncloud/test/test.py
+++ b/owncloud/test/test.py
@@ -791,12 +791,29 @@ class TestUserAndGroupActions(unittest.TestCase):
self.not_existing_group = Config['not_existing_group']
self.test_group = Config['test_group']
self.share2user = Config['owncloud_share2user']
+ try:
+ self.client.create_user(self.share2user, 'share')
+ except:
+ pass
+ try:
+ self.client.create_group(self.test_group)
+ except:
+ pass
def tearDown(self):
for group in self.groups_to_create:
self.assertTrue(self.client.delete_group(group))
self.assertTrue(self.client.remove_user_from_group(self.share2user,self.test_group))
+ try:
+ self.client.delete_user(self.share2user)
+ except:
+ pass
+
+ try:
+ self.client.delete_group(self.test_group)
+ except:
+ pass
self.client.logout() | autocreate test user and group
share2user and test_group is created automatically for TestUserAndGroupActions | owncloud_pyocclient | train | py |
5b9a2e40986e5324867918b250482d018bf16ebe | diff --git a/closure/goog/array/array.js b/closure/goog/array/array.js
index <HASH>..<HASH> 100644
--- a/closure/goog/array/array.js
+++ b/closure/goog/array/array.js
@@ -143,14 +143,14 @@ goog.array.lastIndexOf = goog.array.ARRAY_PROTOTYPE_.lastIndexOf ?
*
* @param {goog.array.ArrayLike} arr Array or array like object over
* which to iterate.
- * @param {Function} f The function to call for every element. This function
- * takes 3 arguments (the element, the index and the array). The return
- * value is ignored. The function is called only for indexes of the array
- * which have assigned values; it is not called for indexes which have
- * been deleted or which have never been assigned values.
- *
- * @param {Object=} opt_obj The object to be used as the value of 'this'
+ * @param {?function(this: T, ...)} f The function to call for every element.
+ * This function takes 3 arguments (the element, the index and the array).
+ * The return value is ignored. The function is called only for indexes of
+ * the array which have assigned values; it is not called for indexes which
+ * have been deleted or which have never been assigned values.
+ * @param {T=} opt_obj The object to be used as the value of 'this'
* within f.
+ * @template T
*/
goog.array.forEach = goog.array.ARRAY_PROTOTYPE_.forEach ?
function(arr, f, opt_obj) { | Add function literal undefined this argument checking to
goog.array.forEach.
R=nicksantos
DELTA=<I> (3 added, 1 deleted, 6 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-library | train | js |
e8e532e806b0d537900be1cfdcf8d0262e1e10cd | diff --git a/tests/unit/modules/test_file.py b/tests/unit/modules/test_file.py
index <HASH>..<HASH> 100644
--- a/tests/unit/modules/test_file.py
+++ b/tests/unit/modules/test_file.py
@@ -3259,7 +3259,9 @@ class FileBasicsTestCase(TestCase, LoaderModuleMockMixin):
},
):
expected_call = call(
- "http://t.est.com/http/file1", decode_body=False, method="HEAD",
+ "http://t.est.com/http/file1",
+ decode_body=False,
+ method="HEAD",
)
with patch(
"salt.utils.http.query", MagicMock(return_value={}) | running pre-commit black manually. | saltstack_salt | train | py |
43a920ddfe7566e86838db1bc23781107a9c936f | diff --git a/symphony/lib/toolkit/class.fieldmanager.php b/symphony/lib/toolkit/class.fieldmanager.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/toolkit/class.fieldmanager.php
+++ b/symphony/lib/toolkit/class.fieldmanager.php
@@ -209,7 +209,7 @@
. $where
. ($id ? " AND t1.`id` = '{$id}' LIMIT 1" : " ORDER BY t1.`{$sortfield}` {$order}");
- if(!$fields = Symphony::Database()->fetch($sql)) return null;
+ if(!$fields = Symphony::Database()->fetch($sql)) return ($returnSingle ? null : array());
foreach($fields as $f){ | Fixed `FileManager->fetch()` to return `null` only if `$returnSingle` is true, and `array()` otherwise. This fixes errors in code like: `foreach ($section->fetchFields(subsectionmanager) as $field)` - it allows to omit checking of returned value every time it is used :). | symphonycms_symphony-2 | train | php |
d270a19711f9da5539f0619346ea4716441577ff | diff --git a/src/Uri.php b/src/Uri.php
index <HASH>..<HASH> 100644
--- a/src/Uri.php
+++ b/src/Uri.php
@@ -434,15 +434,15 @@ class Uri {
}
/**
- * Is the specified URI string resolvable against the current URI instance?
+ * Test whether the specified value is a valid URI.
*/
- public static function isResolvable($toResolve) {
- if (!(is_string($toResolve) || method_exists($toResolve, '__toString'))) {
+ public static function isValid($uri) {
+ if (!(is_string($uri) || method_exists($uri, '__toString'))) {
return false;
}
try {
- (new Uri($toResolve));
+ (new Uri($uri));
} catch (\DomainException $e) {
return false;
} | Rename Uri::isResolvable to Uri::isValid
Any URI is resolvable against the current URI if it's a valid URI. | amphp_uri | train | php |
0ff2eeaf4c8a4405f5bfa89e390f40f027e34196 | diff --git a/imutils/face_utils/helpers.py b/imutils/face_utils/helpers.py
index <HASH>..<HASH> 100644
--- a/imutils/face_utils/helpers.py
+++ b/imutils/face_utils/helpers.py
@@ -31,7 +31,7 @@ def shape_to_np(shape, dtype="int"):
# initialize the list of (x, y)-coordinates
coords = np.zeros((shape.num_parts, 2), dtype=dtype)
- # loop over the 68 facial landmarks and convert them
+ # loop over all facial landmarks and convert them
# to a 2-tuple of (x, y)-coordinates
for i in range(0, shape.num_parts):
coords[i] = (shape.part(i).x, shape.part(i).y) | Uppdated comment to reflect the change from a fixed number of landmarks to an arbitrary number. | jrosebr1_imutils | train | py |
0d9540b6f7840e1ca52d05e11200f204ea23aa2e | diff --git a/shared/react-native/android/app/src/main/java/io/keybase/ossifrage/modules/KeybaseEngine.java b/shared/react-native/android/app/src/main/java/io/keybase/ossifrage/modules/KeybaseEngine.java
index <HASH>..<HASH> 100644
--- a/shared/react-native/android/app/src/main/java/io/keybase/ossifrage/modules/KeybaseEngine.java
+++ b/shared/react-native/android/app/src/main/java/io/keybase/ossifrage/modules/KeybaseEngine.java
@@ -86,7 +86,11 @@ public class KeybaseEngine extends ReactContextBaseJavaModule implements Killabl
public void destroy(){
try {
executor.shutdownNow();
- executor.awaitTermination(30, TimeUnit.SECONDS);
+ // We often hit this timeout during app resume, e.g. hit the back
+ // button to go to home screen and then tap Keybase app icon again.
+ if (!executor.awaitTermination(3, TimeUnit.SECONDS)) {
+ Log.w(NAME, "Executor pool didn't shut down cleanly");
+ }
executor = null;
} catch (Exception e) {
e.printStackTrace(); | Lower engine resume timeout (#<I>) | keybase_client | train | java |
ef9fb75719efcde7e190a894445160de6d259d3a | diff --git a/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSessionManager.java b/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSessionManager.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSessionManager.java
+++ b/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSessionManager.java
@@ -740,6 +740,7 @@ public class MemcachedBackupSessionManager extends ManagerBase implements Lifecy
}
final MemcachedBackupSession session = _transcoderService.deserialize( (byte[]) obj, getContainer().getRealm(), this );
+ session.setSticky( _sticky );
session.setLastAccessedTimeInternal( validityInfo.getLastAccessedTime() );
session.setThisAccessedTimeInternal( validityInfo.getThisAccessedTime() );
@@ -860,6 +861,7 @@ public class MemcachedBackupSessionManager extends ManagerBase implements Lifecy
else {
result = _transcoderService.deserialize( (byte[]) object, getContainer().getRealm(), this );
}
+ result.setSticky( _sticky );
if ( !_sticky ) {
_lockingStrategy.onAfterLoadFromMemcached( result, lockStatus );
} | Fix issue #<I>: Background expiration update for session that was loaded from memcached fails | magro_memcached-session-manager | train | java |
90a743175bf175e13f0f6df9008e6c49f0b75060 | diff --git a/lib/beaker-rspec/spec_helper.rb b/lib/beaker-rspec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/beaker-rspec/spec_helper.rb
+++ b/lib/beaker-rspec/spec_helper.rb
@@ -47,6 +47,11 @@ RSpec.configure do |c|
c.validate
c.configure
+ trap "SIGINT" do
+ c.cleanup
+ exit!(1)
+ end
+
# Destroy nodes if no preserve hosts
c.after :suite do
case options[:destroy] | (BKR-<I>) Cleanup and quit on ctrl-c | puppetlabs_beaker-rspec | train | rb |
5d4f90de47391964a5464b01ca43f8ee5d10638a | diff --git a/lib/namespace.js b/lib/namespace.js
index <HASH>..<HASH> 100644
--- a/lib/namespace.js
+++ b/lib/namespace.js
@@ -114,14 +114,17 @@ Namespace.prototype.run = function(socket, fn){
};
/**
- * Targets a room.
+ * Targets a room when emitting.
*
- * @api private
+ * @param {String} name
+ * @return {Namespace} self
+ * @api public
*/
Namespace.prototype.to =
-Namespace.prototype.in = function(fn){
- this.rooms.push(fn);
+Namespace.prototype.in = function(name){
+ this.rooms = this.rooms || [];
+ if (!~this.rooms.indexOf(name)) this.rooms.push(name);
return this;
}; | namespace: make `in` able to track multiple rooms | socketio_socket.io | train | js |
a5df14c1661bbb1484f42ecf2b49dd0acdc82696 | diff --git a/lxd/backup/backup_config.go b/lxd/backup/backup_config.go
index <HASH>..<HASH> 100644
--- a/lxd/backup/backup_config.go
+++ b/lxd/backup/backup_config.go
@@ -15,7 +15,7 @@ import (
// Config represents the config of a backup that can be stored in a backup.yaml file (or embedded in index.yaml).
type Config struct {
- Container *api.Instance `yaml:"container,omitempty"`
+ Container *api.Instance `yaml:"container,omitempty"` // Used by VM backups too.
Snapshots []*api.InstanceSnapshot `yaml:"snapshots,omitempty"`
Pool *api.StoragePool `yaml:"pool,omitempty"`
Volume *api.StorageVolume `yaml:"volume,omitempty"` | lxd/backup/backup/config: Adds comment to Container field explaining that VM backups use this too | lxc_lxd | train | go |
f80865025d437307cfafcbce63e65159fe645e21 | diff --git a/pyatv/const.py b/pyatv/const.py
index <HASH>..<HASH> 100644
--- a/pyatv/const.py
+++ b/pyatv/const.py
@@ -2,7 +2,7 @@
MAJOR_VERSION = 0
MINOR_VERSION = 3
-PATCH_VERSION = 1
+PATCH_VERSION = '2.dev1'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) | Bump to next dev <I>.dev1 | postlund_pyatv | train | py |
1caf3031df9f323360a277f0c45c74a807e59fcd | diff --git a/lru.go b/lru.go
index <HASH>..<HASH> 100644
--- a/lru.go
+++ b/lru.go
@@ -47,12 +47,14 @@ func (c *Cache) Purge() {
c.lock.Lock()
defer c.lock.Unlock()
- e := c.evictList.Back()
- for e != nil {
- n := e.Prev()
- c.removeElement(e)
- e = n
+ if c.onEvicted != nil {
+ for k, v := range c.items {
+ c.onEvicted(k, v.Value)
+ }
}
+
+ c.evictList = list.New()
+ c.items = make(map[interface{}]*list.Element, c.size)
}
// Add adds a value to the cache. | Call the evict function, then reset the cache.
Rather than removing each item individually, simply call the
evict function for each item, then reset the internal state. This
more closely matches the original behaviour from before the
introduction of the onEvicted function. | hashicorp_golang-lru | train | go |
63ac63417b2173ba232527bb5659d31e75eabf15 | diff --git a/capnslog/journald_formatter.go b/capnslog/journald_formatter.go
index <HASH>..<HASH> 100644
--- a/capnslog/journald_formatter.go
+++ b/capnslog/journald_formatter.go
@@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"os"
+ "path/filepath"
"github.com/coreos/go-systemd/journal"
)
@@ -55,7 +56,8 @@ func (j *journaldFormatter) Format(pkg string, l LogLevel, _ int, entries ...int
}
msg := fmt.Sprint(entries...)
tags := map[string]string{
- "PACKAGE": pkg,
+ "PACKAGE": pkg,
+ "SYSLOG_IDENTIFIER": filepath.Base(os.Args[0]),
}
err := journal.Send(msg, pri, tags)
if err != nil { | capnslog: set SYSLOG_IDENTIFIER for journal
Fixes #<I>. I think it's reasonable to just set this by default rather
than needing to expose it to users.
References:
<URL> | coreos_pkg | train | go |
be650ffc614454e157a15b29841f7f7f8b237e04 | diff --git a/src/babel/transformation/templates/helper-create-decorated-object.js b/src/babel/transformation/templates/helper-create-decorated-object.js
index <HASH>..<HASH> 100644
--- a/src/babel/transformation/templates/helper-create-decorated-object.js
+++ b/src/babel/transformation/templates/helper-create-decorated-object.js
@@ -26,7 +26,7 @@
}
}
- descriptor.value = descriptor.initializer();
+ descriptor.value = descriptor.initializer.call(target);
Object.defineProperty(target, key, descriptor);
}
diff --git a/src/babel/transformation/templates/helper-define-decorated-property-descriptor.js b/src/babel/transformation/templates/helper-define-decorated-property-descriptor.js
index <HASH>..<HASH> 100644
--- a/src/babel/transformation/templates/helper-define-decorated-property-descriptor.js
+++ b/src/babel/transformation/templates/helper-define-decorated-property-descriptor.js
@@ -6,7 +6,7 @@
for (var _key in _descriptor) descriptor[_key] = _descriptor[_key];
// initialize it
- descriptor.value = descriptor.initializer();
+ descriptor.value = descriptor.initializer.call(target);
Object.defineProperty(target, key, descriptor);
}) | call decorator initializers with the proper context - #<I> - thanks @monsanto | babel_babel | train | js,js |
3b0038093a65c9b584580fc11306a16c3bdeca1b | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -229,6 +229,7 @@ type server struct {
// do not need to be protected for concurrent access.
txIndex *indexers.TxIndex
addrIndex *indexers.AddrIndex
+ cbfIndex *indexers.CBFIndex
}
// serverPeer extends the peer to maintain state shared by the server and
@@ -2236,6 +2237,11 @@ func newServer(listenAddrs []string, db database.DB, chainParams *chaincfg.Param
s.addrIndex = indexers.NewAddrIndex(db, chainParams)
indexes = append(indexes, s.addrIndex)
}
+ if !cfg.NoCBFilters {
+ indxLog.Info("CBF index is enabled")
+ s.cbfIndex = indexers.NewCBFIndex(db)
+ indexes = append(indexes, s.cbfIndex)
+ }
// Create an index manager if any of the optional indexes are enabled.
var indexManager blockchain.IndexManager | Hook CBF indexer to server code | btcsuite_btcd | train | go |
4bd1d8f3e346c06f0251c4117ba0f6ef5c72d07a | diff --git a/scapy/arch/__init__.py b/scapy/arch/__init__.py
index <HASH>..<HASH> 100644
--- a/scapy/arch/__init__.py
+++ b/scapy/arch/__init__.py
@@ -56,9 +56,9 @@ if LINUX:
from scapy.arch.linux import * # noqa F403
elif BSD:
from scapy.arch.unix import read_routes, read_routes6, in6_getifaddr # noqa: F401, E501
-
- if not conf.use_pcap or conf.use_dnet:
- from scapy.arch.bpf.core import * # noqa F403
+ from scapy.arch.bpf.core import * # noqa F403
+ if not (conf.use_pcap or conf.use_dnet):
+ # Native
from scapy.arch.bpf.supersocket import * # noqa F403
conf.use_bpf = True
elif SOLARIS: | Fix BPF/OSX conf.use_dnet detection | secdev_scapy | train | py |
51c75e1e5eb95da215b72b6a6cbcd4bd57faf5a2 | diff --git a/pkg/api/install/install.go b/pkg/api/install/install.go
index <HASH>..<HASH> 100644
--- a/pkg/api/install/install.go
+++ b/pkg/api/install/install.go
@@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets"
+ "k8s.io/kubernetes/pkg/watch/versioned"
)
const importPrefix = "k8s.io/kubernetes/pkg/api"
@@ -233,6 +234,17 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
case *v1.Endpoints:
return true, v1.Convert_api_Endpoints_To_v1_Endpoints(a, b, s)
}
+
+ case *versioned.Event:
+ switch b := objB.(type) {
+ case *versioned.InternalEvent:
+ return true, versioned.Convert_versioned_Event_to_versioned_InternalEvent(a, b, s)
+ }
+ case *versioned.InternalEvent:
+ switch b := objB.(type) {
+ case *versioned.Event:
+ return true, versioned.Convert_versioned_InternalEvent_to_versioned_Event(a, b, s)
+ }
}
return false, nil
}) | Avoid a reflect.Value.call in watch streaming | kubernetes_kubernetes | train | go |
196bba3fda1a595b168b5b3a21f59bef652441d8 | diff --git a/src/main.js b/src/main.js
index <HASH>..<HASH> 100644
--- a/src/main.js
+++ b/src/main.js
@@ -225,8 +225,8 @@ Formsy.Form = React.createClass({
ajax[this.props.method || 'post'](this.props.url, this.model, this.props.contentType || options.contentType || 'json', headers)
.then(function (response) {
- this.onSuccess(response);
- this.onSubmitted();
+ this.props.onSuccess(response);
+ this.props.onSubmitted();
}.bind(this))
.catch(this.failSubmit);
}, | Call onSuccess and onSubmitted from props after AJAX response | formsy_formsy-react | train | js |
cfcfccb6c78490ed368fa08d7ee84418ac4706a6 | diff --git a/setuptools/version.py b/setuptools/version.py
index <HASH>..<HASH> 100644
--- a/setuptools/version.py
+++ b/setuptools/version.py
@@ -1 +1 @@
-__version__ = '19.1'
+__version__ = '19.2' | Bumped to <I> in preparation for next release. | pypa_setuptools | train | py |
cee7fdcc295c9f9c27b57631a02526fc369ef98c | diff --git a/lib/sprockets/processing.rb b/lib/sprockets/processing.rb
index <HASH>..<HASH> 100644
--- a/lib/sprockets/processing.rb
+++ b/lib/sprockets/processing.rb
@@ -180,7 +180,7 @@ module Sprockets
when NilClass
# noop
when Hash
- data = result[:data]
+ data = result[:data] if result.key?(:data)
metadata = metadata.merge(result)
metadata.delete(:data)
when String
diff --git a/test/sprockets_test.rb b/test/sprockets_test.rb
index <HASH>..<HASH> 100644
--- a/test/sprockets_test.rb
+++ b/test/sprockets_test.rb
@@ -90,8 +90,7 @@ Sprockets.register_transformer 'application/javascript', 'text/html', JS2HTMLIMP
Sprockets.register_bundle_reducer 'text/css', :selector_count, :+
Sprockets.register_postprocessor 'text/css', proc { |input|
- { data: input[:data],
- selector_count: input[:data].scan(/\{/).size }
+ { selector_count: input[:data].scan(/\{/).size }
} | Allow no-op data for metadata only transforms | rails_sprockets | train | rb,rb |
fe2dedcf684655b1ca759070c09f44cce138009e | diff --git a/src/connections.js b/src/connections.js
index <HASH>..<HASH> 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -69,6 +69,6 @@ export default (auth_token) => {
})
return this
- },
+ }
})
}
diff --git a/src/pipes.js b/src/pipes.js
index <HASH>..<HASH> 100644
--- a/src/pipes.js
+++ b/src/pipes.js
@@ -69,6 +69,6 @@ export default (auth_token) => {
})
return this
- },
+ }
})
} | Removed trailing slashes. | flexiodata_flexio-sdk-js | train | js,js |
ddf829e017e2fb37cfb9f975e69d73f27a5528d2 | diff --git a/activerecord/lib/active_record/store.rb b/activerecord/lib/active_record/store.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/store.rb
+++ b/activerecord/lib/active_record/store.rb
@@ -17,8 +17,8 @@ module ActiveRecord
# You can set custom coder to encode/decode your serialized attributes to/from different formats.
# JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+.
#
- # NOTE: If you are using PostgreSQL specific columns like +hstore+ or +json+ there is no need for
- # the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store].
+ # NOTE: If you are using structured database data types (eg. PostgreSQL +hstore+/+json+, or MySQL 5.7+
+ # +json+) there is no need for the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store].
# Simply use {.store_accessor}[rdoc-ref:ClassMethods#store_accessor] instead to generate
# the accessor methods. Be aware that these columns use a string keyed hash and do not allow access
# using a symbol. | Add MySQL JSON reference to ActiveRecord::Store documentation
The current documentation explicitly mentions only PostgreSQL (hstore/json)
for use with `.store_accessor`, making it somewhat confusing what to choose on
a MySQL <I>+ setup (which introduced a json data type). | rails_rails | train | rb |
1602d1b7557b684995d60073e9b2011cf5e19c63 | diff --git a/efopen/newrelic_executor.py b/efopen/newrelic_executor.py
index <HASH>..<HASH> 100644
--- a/efopen/newrelic_executor.py
+++ b/efopen/newrelic_executor.py
@@ -256,8 +256,12 @@ class NewRelicAlerts(object):
self.replace_symbols_in_condition(policy)
# Configure Opsgenie notifications for services running in the production account
- if self.context.env in ["prod", "global.ellation", "mgmt.ellation"]:
- self.add_policy_to_opsgenie_channel(policy, opsgenie_team)
+ try:
+ prod_account = EFConfig.ENV_ACCOUNT_MAP['prod']
+ if self.context.env in ["prod", "global.{}".format(prod_account), "mgmt.{}".format(prod_account)]:
+ self.add_policy_to_opsgenie_channel(policy, opsgenie_team)
+ except KeyError:
+ pass
# Infra alert conditions
policy = self.override_infra_alert_condition_values(policy, service_alert_overrides) | Opsgenie prod only (#<I>)
* only page teams for ellation account services
* remove account names from code | crunchyroll_ef-open | train | py |
001794bf58e16a362fead68f08003ea2fcda265f | diff --git a/src/classes/class-wp-url-util.php b/src/classes/class-wp-url-util.php
index <HASH>..<HASH> 100644
--- a/src/classes/class-wp-url-util.php
+++ b/src/classes/class-wp-url-util.php
@@ -44,10 +44,10 @@ class WP_Url_Util {
function convert_path_to_url( $absolute_path ) {
// Remove WordPress installation path from file path.
- $file_base = str_replace( $_SERVER[ 'DOCUMENT_ROOT' ], '', $absolute_path );
+ $file_base = str_replace( ABSPATH, '', $absolute_path );
// Add site url to file base.
- $file_url = site_url() . $file_base;
+ $file_url = trailingslashit( site_url() ) . $file_base;
return $file_url;
@@ -62,10 +62,10 @@ class WP_Url_Util {
function convert_url_to_path( $file_url ) {
// Remove WordPress site url from file url.
- $file_base = str_replace( site_url(), '', $file_url );
+ $file_base = str_replace( trailingslashit( site_url() ), '', $file_url );
// Add WordPress installation path to file base.
- $absolute_path = $_SERVER[ 'DOCUMENT_ROOT' ] . $file_base;
+ $absolute_path = ABSPATH . $file_base;
return $absolute_path; | Changes `$_SERVER[ 'DOCUMENT_ROOT' ]` to `ABSPATH`. | manovotny_wp-url-util | train | php |
334f8803da6c56079fc2eb44f30acdd2bdc6f495 | diff --git a/server/src/main/java/org/jboss/as/server/deployment/Phase.java b/server/src/main/java/org/jboss/as/server/deployment/Phase.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/jboss/as/server/deployment/Phase.java
+++ b/server/src/main/java/org/jboss/as/server/deployment/Phase.java
@@ -361,7 +361,8 @@ public enum Phase {
public static final int INSTALL_WS_DEPLOYMENT_ASPECTS = 0x0710;
// IMPORTANT: WS integration installs deployment aspects dynamically
// so consider INSTALL 0x0710 - 0x07FF reserved for WS subsystem!
- public static final int INSTALL_RA_DEPLOYMENT = 0x0800;
+ public static final int INSTALL_RA_NATIVE = 0x0800;
+ public static final int INSTALL_RA_DEPLOYMENT = 0x0801;
public static final int INSTALL_SERVICE_DEPLOYMENT = 0x0900;
public static final int INSTALL_POJO_DEPLOYMENT = 0x0A00;
public static final int INSTALL_RA_XML_DEPLOYMENT = 0x0B00; | [AS7-<I>] Unable to load native libraries
was: 7c<I>eb<I>f4d<I>e3c<I>ad<I>a<I>fb<I> | wildfly_wildfly-core | train | java |
6398d43c36c4339e3b41b8b60e4451765124f95a | diff --git a/src/Validator.php b/src/Validator.php
index <HASH>..<HASH> 100644
--- a/src/Validator.php
+++ b/src/Validator.php
@@ -16,7 +16,10 @@ abstract class Validator
public function getName()
{
$class = explode('\\', get_called_class());
- return strtolower(array_pop($class));
+ $class = strtolower(array_pop($class));
+
+ // remove 'validator' suffix
+ return substr($class, 0, -9);
}
abstract public function validateField(Document $document, $fieldName, array $params); | bug with naming of validator in erroros array. Remove suffix 'validator' | sokil_php-mongo | train | php |
040ac1e9705b3a3ba7b38de5b9ffdfd58502658f | diff --git a/src/S3StreamWrapper/S3StreamWrapper.php b/src/S3StreamWrapper/S3StreamWrapper.php
index <HASH>..<HASH> 100644
--- a/src/S3StreamWrapper/S3StreamWrapper.php
+++ b/src/S3StreamWrapper/S3StreamWrapper.php
@@ -133,7 +133,7 @@ class S3StreamWrapper
);
if (strlen($parsed['path']) > 0) {
- $this->dir_list_options['Prefix'] = $parsed['path'];
+ $this->dir_list_options['Prefix'] = rtrim($parsed['path'], $this->getSeparator()) . $this->getSeparator();
}
$this->dir_list_has_more = true;
@@ -147,7 +147,11 @@ class S3StreamWrapper
public function dir_readdir()
{
if (is_array($this->dir_list) && count($this->dir_list) > 0) {
- return array_shift($this->dir_list);
+ $item = array_shift($this->dir_list);
+ if(isset($this->dir_list_options["Prefix"])) {
+ $item = str_replace($this->dir_list_options["Prefix"], "", $item);
+ }
+ return $item;
}
if ($this->dir_list_has_more) { | Listing dirs now does not include full path for compatiblity with FileSystemIterator | gwkunze_S3StreamWrapper | train | php |
34c094f27360ca546d8d4565ade85f69c1364f9c | diff --git a/fs/fstesting/read_only_tests.go b/fs/fstesting/read_only_tests.go
index <HASH>..<HASH> 100644
--- a/fs/fstesting/read_only_tests.go
+++ b/fs/fstesting/read_only_tests.go
@@ -1,7 +1,11 @@
// Copyright 2015 Google Inc. All Rights Reserved.
// Author: [email protected] (Aaron Jacobs)
//
-// Tests registered by RegisterFSTests.
+// A collection of tests for a file system where we do not attempt to write to
+// the file system at all. Rather we set up contents in a GCS bucket out of
+// band, wait for them to be available, and then read them via the file system.
+//
+// These tests are registered by RegisterFSTests.
package fstesting | Added a better description to read_only_tests.go. | jacobsa_timeutil | train | go |
3a88502453e110cd2cab651e8cfee136857dab46 | diff --git a/aws/resource_aws_amplify_app_test.go b/aws/resource_aws_amplify_app_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_amplify_app_test.go
+++ b/aws/resource_aws_amplify_app_test.go
@@ -40,6 +40,7 @@ func TestAccAWSAmplifyApp_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "environment_variables.#", "0"),
resource.TestCheckResourceAttr(resourceName, "enable_branch_auto_build", "false"),
resource.TestCheckResourceAttr(resourceName, "iam_service_role_arn", ""),
+ resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
),
},
{ | Ensure that the number of tags is 0 | terraform-providers_terraform-provider-aws | train | go |
cfd3e75cc0a1218583c641d8271a7e5ff313b35b | diff --git a/ariba/reference_data.py b/ariba/reference_data.py
index <HASH>..<HASH> 100644
--- a/ariba/reference_data.py
+++ b/ariba/reference_data.py
@@ -8,7 +8,7 @@ from ariba import sequence_metadata, cdhit
class Error (Exception): pass
-rename_sub_regex = re.compile(r'''[:!@,-]''')
+rename_sub_regex = re.compile(r'''[':!@,-]''')
class ReferenceData: | Add comma to list of chars to replace | sanger-pathogens_ariba | train | py |
34e110f7dea2d336067c271f6ebe18d91c31da01 | diff --git a/gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb b/gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb
index <HASH>..<HASH> 100644
--- a/gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb
+++ b/gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb
@@ -76,6 +76,19 @@ module Aws
# Aws::S3::Resource.new.buckets.map(&:name)
# #=> ['my-bucket']
#
+ # ## Dynamic Stubbing
+ #
+ # In addition to creating static stubs, it's also possible to generate
+ # stubs dynamically based on the parameters with which operations were
+ # called, by passing a `Proc` object:
+ #
+ # s3 = Aws::S3::Resource.new(stub_responses: true)
+ # s3.client.stub_responses(:put_object, -> (context) {
+ # s3.client.stub_responses(:get_object, content_type: context.params[:content_type])
+ # })
+ #
+ # The yielded object is an instance of {Seahorse::Client::RequestContext}.
+ #
# ## Stubbing Errors
#
# When stubbing is enabled, the SDK will default to generate | Port over dynamic stubbing example from v2 | aws_aws-sdk-ruby | train | rb |
2020ad8cfc0ffc6a9bc43df50ad021155abce0c2 | diff --git a/lib/io.js b/lib/io.js
index <HASH>..<HASH> 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -10,7 +10,7 @@ this.io = {
version: '0.1.1',
setPath: function(path){
- this.path = /\/$/.test(path) ? path : path + '/';
+ this.path = /\/$/.test(path) ? path : path + '/';
// this is temporary until we get a fix for injecting Flash WebSocket javascript files dynamically,
// as io.js shouldn't be aware of specific transports.
diff --git a/lib/transports/flashsocket.js b/lib/transports/flashsocket.js
index <HASH>..<HASH> 100644
--- a/lib/transports/flashsocket.js
+++ b/lib/transports/flashsocket.js
@@ -16,12 +16,14 @@ io.Transport.flashsocket = io.Transport.websocket.extend({
this.base.connect();
return;
}
- return this.__super__();
+ return this.__super__();
}
});
io.Transport.flashsocket.check = function(){
+ if (!('path' in io)) throw new Error('The `flashsocket` transport requires that you call io.setPath() with the path to the socket.io client dir.');
+
if ('navigator' in window && navigator.plugins){
return !! navigator.plugins['Shockwave Flash'].description;
} | Warning for flashsocket for devs that forget to call io.setPath | tsjing_socket.io-client | train | js,js |
55a020796a0d0a1d618675763ff4c3afe2019306 | diff --git a/box.go b/box.go
index <HASH>..<HASH> 100644
--- a/box.go
+++ b/box.go
@@ -86,7 +86,7 @@ type WalkFunc func(string, File) error
func (b Box) Walk(wf WalkFunc) error {
if data[b.Path] == nil {
return filepath.Walk(b.Path, func(path string, info os.FileInfo, err error) error {
- if info.IsDir() {
+ if info == nil || info.IsDir() {
return nil
}
f, err := os.Open(path) | fixed a small bug where info could be nil | gobuffalo_packr | train | go |
9b0d6f5b1d0d7a81515ecbfdcd0d23b39825368c | diff --git a/spec/acceptance/httpclient/httpclient_spec.rb b/spec/acceptance/httpclient/httpclient_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/httpclient/httpclient_spec.rb
+++ b/spec/acceptance/httpclient/httpclient_spec.rb
@@ -114,7 +114,13 @@ describe "HTTPClient" do
end
http_request(:get, webmock_server_url, :client => client, :headers => { "Cookie" => "bar=; foo=" })
- http_request(:get, webmock_server_url, :client => client, :headers => { "Cookie" => "bar=; foo=" })
+
+ if defined? HTTP::CookieJar
+ http_request(:get, webmock_server_url, :client => client, :headers => { "Cookie" => "bar=; foo=" })
+ else
+ # If http-cookie is not present, then the cookie headers will saved between requests
+ http_request(:get, webmock_server_url, :client => client)
+ end
expect(request_signatures.size).to eq(2)
# Verify the request signatures were identical as needed by this example | branch in httpclient spec if http-cookie is loaded
as of <I> httpclient uses http-cookie, causing a hack in
the httpclient spec to only work if http-cookie is not present
<URL> | bblimke_webmock | train | rb |
e5ba78a78b89f775ff998a7f633ccec46e9aa8c8 | diff --git a/fastlane_core/lib/fastlane_core/version.rb b/fastlane_core/lib/fastlane_core/version.rb
index <HASH>..<HASH> 100644
--- a/fastlane_core/lib/fastlane_core/version.rb
+++ b/fastlane_core/lib/fastlane_core/version.rb
@@ -1,3 +1,3 @@
module FastlaneCore
- VERSION = "0.42.1".freeze
+ VERSION = "0.43.0".freeze
end | [fastlane_core] Version bump | fastlane_fastlane | train | rb |
67480a5d142177cd3baa5dd7a3dbd0844fda28f6 | diff --git a/libkbfs/tlf_edit_history.go b/libkbfs/tlf_edit_history.go
index <HASH>..<HASH> 100644
--- a/libkbfs/tlf_edit_history.go
+++ b/libkbfs/tlf_edit_history.go
@@ -209,9 +209,19 @@ outer:
break
}
- // If a chain exists for the file, ignore this create.
- if _, ok := chains.byOriginal[ptr]; ok {
- continue
+ // If a chain exists with sync ops for the file,
+ // ignore this create.
+ if fileChain, ok := chains.byOriginal[ptr]; ok {
+ syncOpFound := false
+ for _, fileOp := range fileChain.ops {
+ if _, ok := fileOp.(*syncOp); ok {
+ syncOpFound = true
+ break
+ }
+ }
+ if syncOpFound {
+ continue
+ }
}
writer := op.getWriterInfo().uid | tlf_edit_history: don't always favor file chains
Sometimes a file chain will only have setAttrs, and we still need to
use the create op to make an edit notification for it. | keybase_client | train | go |
b0130de6e12b32a9659e14dfed35a82d31686166 | diff --git a/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java b/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java
+++ b/src/main/java/org/deepsymmetry/beatlink/data/WaveformPreviewComponent.java
@@ -260,12 +260,12 @@ public class WaveformPreviewComponent extends JComponent {
}
// Also refresh where the specific marker was moved from and/or to.
- if (oldState != null) {
+ if (oldState != null && (newState == null || newState.position != oldState.position)) {
final int left = Math.max(0, Math.min(width, millisecondsToX(oldState.position) - 6));
final int right = Math.max(0, Math.min(width, millisecondsToX(oldState.position) + 6));
delegatingRepaint(left, 0, right - left, getHeight());
}
- if (newState != null) {
+ if (newState != null && (oldState == null || newState.position != oldState.position)) {
final int left = Math.max(0, Math.min(width, millisecondsToX(newState.position) - 6));
final int right = Math.max(0, Math.min(width, millisecondsToX(newState.position) + 6));
delegatingRepaint(left, 0, right - left, getHeight()); | Don't repaint if position hasn't actually changed. | Deep-Symmetry_beat-link | train | java |
8cf09264d147db3d797d43d9d57b9af1465cfd80 | diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/BaseTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/BaseTest.java
index <HASH>..<HASH> 100755
--- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/BaseTest.java
+++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/BaseTest.java
@@ -48,7 +48,7 @@ public abstract class BaseTest<T extends ODatabase> {
}
}
- if (url.startsWith("memory:") ) {
+ if (url.startsWith("memory:") && !url.startsWith("remote")) {
final ODatabaseDocumentTx db = new ODatabaseDocumentTx(url);
if (!db.exists())
db.create().close(); | add check for remote file clean in tests module | orientechnologies_orientdb | train | java |
bf0766fb3c5e2667dc8bd0e3fbbab21fff73fb58 | diff --git a/profile/extensions/gp.py b/profile/extensions/gp.py
index <HASH>..<HASH> 100644
--- a/profile/extensions/gp.py
+++ b/profile/extensions/gp.py
@@ -1,6 +1,6 @@
__authors__ = ['Thorin Tabor', 'Chet Birger']
__copyright__ = 'Copyright 2015, Broad Institute'
-__version__ = '1.0.3'
+__version__ = '1.0.5'
__status__ = 'Production'
""" GenePattern Python Client
@@ -36,6 +36,7 @@ class GPServer(object):
self.username = username
self.password = password
self.auth_header = None
+ self.last_job = None
# Handle Basic Auth differences in Python 2 vs. Python 3
if sys.version_info.major == 2:
@@ -135,6 +136,7 @@ class GPServer(object):
data = json.loads(response.read().decode('utf-8'))
job = GPJob(self, data['jobId'])
job.get_info()
+ self.last_job = job # Set the last job
if wait_until_done:
job.wait_until_done()
return job | Updating GenePattern Python client to version <I> | genepattern_genepattern-notebook | train | py |
fe49f2f235e78a5625f52e8637e8941f8c4066b1 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -37,10 +37,10 @@ exports.extend = function(app, options) {
var allowUpload = false;
- if (typeof options.uploadPath == 'function') {
- allowUpload = !!options.uploadPath(req.url);
- } else if (typeof options.uploadPath == 'object' && typeof options.uploadPath.test == 'function') {
- allowUpload = !!options.uploadPath.test(req.url);
+ if (typeof options.allowedPath == 'function') {
+ allowUpload = !!options.allowedPath(req.url);
+ } else if (typeof options.allowedPath == 'object' && typeof options.allowedPath.test == 'function') {
+ allowUpload = !!options.allowedPath.test(req.url);
} else {
allowUpload = true;
} | Renamed uploadPath to allowedPath | yahoo_express-busboy | train | js |
ec828d12672bf129f6760f784b05f57dc5fad532 | diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py
index <HASH>..<HASH> 100644
--- a/pycm/pycm_obj.py
+++ b/pycm/pycm_obj.py
@@ -182,8 +182,8 @@ class ConfusionMatrix():
self.IS = statistic_result["IS"]
self.CEN = statistic_result["CEN"]
self.MCEN = statistic_result["MCEN"]
+ self.AUC = statistic_result["AUC"]
self.Overall_J = self.overall_stat["Overall_J"]
- self.AUC = self.overall_stat["AUC"]
self.SOA1 = self.overall_stat["Strength_Of_Agreement(Landis and Koch)"]
self.SOA2 = self.overall_stat["Strength_Of_Agreement(Fleiss)"]
self.SOA3 = self.overall_stat["Strength_Of_Agreement(Altman)"] | fix : minor edit in AUC in object #<I> | sepandhaghighi_pycm | train | py |
682bb4c0b493d8c85d9eb47b2728f0dbc505f5ca | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -58,7 +58,9 @@ module.exports = function (center, time, resolution, maxspeed, unit, network, do
[
targets.features[i].geometry.coordinates[1], targets.features[i].geometry.coordinates[0]
]
- ]
+ ],
+ alternateRoute: false,
+ printInstructions: false
};
osrm.route(query, function(err, res){ | Skip alternate route & instructions to improve performances | mapbox_osrm-isochrone | train | js |
abe3ae4819f803c6bff003b62269637314964e54 | diff --git a/dist/milsymbol.js b/dist/milsymbol.js
index <HASH>..<HASH> 100644
--- a/dist/milsymbol.js
+++ b/dist/milsymbol.js
@@ -2046,7 +2046,7 @@ var milsymbol = function(){
for (var i in MS._markerParts){
var m = MS._markerParts[i].call(this);
g += m.g;
- this.bbox = MS.bboxMax(this.bbox,m.bbox);
+ if (m.bbox)this.bbox = MS.bboxMax(this.bbox,m.bbox);
}
var width = this.bbox.width() + (this.strokeWidth*2); //Adding the stoke width as margins | added check for undefined bbox
Got a problem with this in a project, this is a quick fix. | spatialillusions_milsymbol | train | js |
611d7b6c2b4b7c0312c4da55891d1af35d2ea142 | diff --git a/state/logs.go b/state/logs.go
index <HASH>..<HASH> 100644
--- a/state/logs.go
+++ b/state/logs.go
@@ -249,7 +249,7 @@ func (t *logTailer) processCollection() error {
}
}
- iter := query.Sort("t", "_id").Iter()
+ iter := query.Sort("e", "t").Iter()
doc := new(logDoc)
for iter.Next(doc) {
select { | Handle bug #<I> by changing the Sort() for debug-log | juju_juju | train | go |
96a8d9f37b39937f6201debd15a24b86b55af0c1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,6 @@ A base class for building web scrapers for statistical data.\
packages=['statscraper'],
zip_safe=False,
install_requires=[
- "hashlib",
"pandas",
],
test_suite='nose.collector', | remove hashlib, now built in | jplusplus_statscraper | train | py |
5a6d4cdcc129e93536e78b2ad28deb14e3988630 | diff --git a/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/VerifyMojo.java b/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/VerifyMojo.java
index <HASH>..<HASH> 100644
--- a/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/VerifyMojo.java
+++ b/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/VerifyMojo.java
@@ -94,7 +94,7 @@ public class VerifyMojo extends AbstractVerifyMojo
verifyAttachmentAuthors(errors, xdoc.getAttachmentAuthors());
// Verification 3: Check for orphans, except for Main.WebHome since it's the topmost document
- if (StringUtils.isEmpty(xdoc.getParent()) && xdoc.getReference().equals("Main.WebHome")) {
+ if (StringUtils.isEmpty(xdoc.getParent()) && !xdoc.getReference().equals("Main.WebHome")) {
errors.add("Parent must not be empty");
} | XWIKI-<I>: Add support for nested spaces in XAR export/import/format
* fix mistake in previous commit | xwiki_xwiki-commons | train | java |
3710fe4d4e2180af51d3ed4c64758af044444eba | diff --git a/lib/heroku/rollbar.rb b/lib/heroku/rollbar.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/rollbar.rb
+++ b/lib/heroku/rollbar.rb
@@ -6,7 +6,7 @@ module Rollbar
payload = json_encode(build_payload(e))
response = Excon.post('https://api.rollbar.com/api/1/item/', :body => payload)
response = json_decode(response.body)
- raise response if response["err"] != 0
+ raise response.to_s if response["err"] != 0
response["result"]["uuid"]
rescue => e
$stderr.puts "Error submitting error." | fix raising of rollbar errors to show the http response | heroku_legacy-cli | train | rb |
fd39f878274d4ad7403aaab6a523768eeb6ebdc4 | diff --git a/src/bbn/User/Permissions.php b/src/bbn/User/Permissions.php
index <HASH>..<HASH> 100644
--- a/src/bbn/User/Permissions.php
+++ b/src/bbn/User/Permissions.php
@@ -97,6 +97,15 @@ class Permissions extends bbn\Models\Cls\Basic
);
$path = substr($path, strlen($plugin['url']));
}
+ elseif ($plugin['name']) {
+ $root = $this->opt->fromCode(
+ $plugin['name'],
+ 'plugins',
+ 'permissions',
+ BBN_APPUI
+ );
+ }
+ break;
}
}
} | Finished to fix permission (amen) | nabab_bbn | train | php |
f2f5ca0f5617677a9fa3d1f45c5fafcd207997b5 | diff --git a/tests/test_wal_transfer.py b/tests/test_wal_transfer.py
index <HASH>..<HASH> 100644
--- a/tests/test_wal_transfer.py
+++ b/tests/test_wal_transfer.py
@@ -21,7 +21,7 @@ class FakeWalSegment(object):
self._uploaded = False
def mark_done(self):
- if self._mark_done_explosive is not False:
+ if self._mark_done_explosive:
raise self._mark_done_explosive
self._marked = True | Make conditional less wordy
Per Maciek Sakrejda's review. | wal-e_wal-e | train | py |
1b0de8f08e9dc0d7f6952aa9a1ff49c1ee4c099b | diff --git a/src/components/FilterEnhancer.js b/src/components/FilterEnhancer.js
index <HASH>..<HASH> 100644
--- a/src/components/FilterEnhancer.js
+++ b/src/components/FilterEnhancer.js
@@ -1,9 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
-import getContext from 'recompose/getContext';
-import mapProps from 'recompose/mapProps';
import compose from 'recompose/compose';
-
+import mapProps from 'recompose/mapProps';
+import getContext from 'recompose/getContext';
import { combineHandlers } from '../utils/compositionUtils';
const EnhancedFilter = OriginalComponent => compose( | Align FilterEnhancer with other enhancers | GriddleGriddle_Griddle | train | js |
8c58a8d56d223d7fee61d30f5ee2dfbd7d1993c7 | diff --git a/packages/react/src/components/TimePicker/TimePicker.js b/packages/react/src/components/TimePicker/TimePicker.js
index <HASH>..<HASH> 100644
--- a/packages/react/src/components/TimePicker/TimePicker.js
+++ b/packages/react/src/components/TimePicker/TimePicker.js
@@ -223,10 +223,10 @@ export default class TimePicker extends Component {
{...timePickerInputProps}
data-invalid={invalid ? invalid : undefined}
/>
- {error}
</div>
{children}
</div>
+ {error}
</div>
);
} | fix(TimePicker): reposition validation message (#<I>) | carbon-design-system_carbon-components | train | js |
c437767ae2cd66e7119668128f9e1cd1681cf026 | diff --git a/master/buildbot/status/web/console.py b/master/buildbot/status/web/console.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/status/web/console.py
+++ b/master/buildbot/status/web/console.py
@@ -164,10 +164,10 @@ class ConsoleStatusResource(HtmlResource):
return allChanges
@defer.inlineCallbacks
- def getAllChanges(self, request, status, debugInfo):
+ def getAllChanges(self, request, status, numChanges, debugInfo):
master = request.site.buildbot_service.master
- chdicts = yield master.db.changes.getRecentChanges(25)
+ chdicts = yield master.db.changes.getRecentChanges(numChanges)
# convert those to Change instances
allChanges = yield defer.gatherResults([
@@ -646,7 +646,7 @@ class ConsoleStatusResource(HtmlResource):
# Get all changes we can find. This is a DB operation, so it must use
# a deferred.
- d = self.getAllChanges(request, status, debugInfo)
+ d = self.getAllChanges(request, status, numRevs, debugInfo)
def got_changes(allChanges):
debugInfo["source_all"] = len(allChanges) | console: remove limit of <I> changesets requested from db. | buildbot_buildbot | train | py |
6a8003c76e08d4df592093bef17a2da5222df4e9 | diff --git a/irc3/plugins/fifo.py b/irc3/plugins/fifo.py
index <HASH>..<HASH> 100644
--- a/irc3/plugins/fifo.py
+++ b/irc3/plugins/fifo.py
@@ -85,7 +85,7 @@ class Fifo(object):
def create_fifo(self, channel):
if channel is None:
- path = os.path.join(self.runpath, 'raw')
+ path = os.path.join(self.runpath, ':raw')
else:
path = os.path.join(self.runpath, channel.strip('#&+'))
if not os.path.exists(path):
@@ -94,7 +94,7 @@ class Fifo(object):
fd = os.fdopen(fileno)
meth = partial(self.watch_fd, channel, fd)
self.context.create_task(meth())
- self.log.debug("%s's fifo is %s %r", channel or 'raw', path, fd)
+ self.log.debug("%s's fifo is %s %r", channel or ':raw', path, fd)
return meth
@irc3.event(irc3.rfc.JOIN) | rename raw to :raw to avoid conflict with #raw | gawel_irc3 | train | py |
94be0be4d498e0929069fa92e0308b5b0ca8c147 | diff --git a/drivers/java/src/main/java/com/rethinkdb/net/Connection.java b/drivers/java/src/main/java/com/rethinkdb/net/Connection.java
index <HASH>..<HASH> 100644
--- a/drivers/java/src/main/java/com/rethinkdb/net/Connection.java
+++ b/drivers/java/src/main/java/com/rethinkdb/net/Connection.java
@@ -141,7 +141,8 @@ public class Connection {
while (true) {
// validate socket is open
if (!isOpen()) {
- log.error("Response Pump: The socket is not open, exiting.");
+ awaiterException = new IOException("The socket is closed, exiting response pump.");
+ this.close();
break;
}
@@ -154,7 +155,6 @@ public class Connection {
}
} catch (IOException e) {
awaiterException = e;
- // shutdown
this.close();
break;
} | Fixes resource leak in Java driver. Fixes #<I> | rethinkdb_rethinkdb | train | java |
9cbec73bc870ddac30d12531927dfa08742ada27 | diff --git a/src/main/java/org/primefaces/component/fileupload/FileUploadChunkDecoder.java b/src/main/java/org/primefaces/component/fileupload/FileUploadChunkDecoder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/component/fileupload/FileUploadChunkDecoder.java
+++ b/src/main/java/org/primefaces/component/fileupload/FileUploadChunkDecoder.java
@@ -45,7 +45,7 @@ public interface FileUploadChunkDecoder<T extends HttpServletRequest> {
default String getUploadDirectory(T request) {
// Servlet 2.5 compatibility, equivalent to ServletContext.TMP_DIR
- File tmpDir = (File)request.getServletContext().getAttribute("javax.servlet.context.tempdir");
+ File tmpDir = (File) request.getServletContext().getAttribute("javax.servlet.context.tempdir");
if (tmpDir == null) {
tmpDir = new File(System.getenv("java.io.tmpdir"));
} | Fix #<I>: FileUpload: support chunking and resume | primefaces_primefaces | train | java |
67f25748ccdd54be4dfd537ff4b99e10188d46c5 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -58,7 +58,13 @@ module.exports = function (remoteApi, localApi, serializer) {
if(!hasSource(name))
return stream.write(null, new Error('no source:'+name))
- pullWeird.sink(stream) (local[name].apply(local, data.args))
+ var source, sink = pullWeird.sink(stream)
+ try {
+ source = local[name].apply(local, data.args)
+ } catch (err) {
+ return sink(pull.error(err))
+ }
+ sink(source)
}
}
}) | cb errors when constructing streams | ssbc_muxrpc | train | js |
7bfb60d3d913f5915f735c09bc7e5006ab0deb92 | diff --git a/src/core/domhelper.js b/src/core/domhelper.js
index <HASH>..<HASH> 100644
--- a/src/core/domhelper.js
+++ b/src/core/domhelper.js
@@ -228,7 +228,7 @@ webfont.DomHelper.prototype.insertNullFontStyle = function(fontDescription) {
"@font-face{" +
"font-family:'" + fontFamily + "';" +
"src:url(data:application/x-font-woff;base64,) format('woff')," +
- "url(data:font/truetype;base64,) format('truetype');" +
+ "url(data:font/opentype;base64,) format('truetype');" +
weightAndStyle +
"}"); | Chrome console complains about font/truetype MIME type
Use font/opentype instead, which doesn't cause complaints. | typekit_webfontloader | train | js |
97c6e620e7ce9ef0bd9aa7c5a5eab8c81ba7302b | diff --git a/benchexec/tablegenerator/textable.py b/benchexec/tablegenerator/textable.py
index <HASH>..<HASH> 100644
--- a/benchexec/tablegenerator/textable.py
+++ b/benchexec/tablegenerator/textable.py
@@ -282,3 +282,7 @@ def _column_statistic_to_latex_command(
yield command.set_command_value(
column.format_value(value=v, format_target="raw")
)
+ if column.source_unit:
+ yield command.set_command_part("stat_type", "sourceUnit").set_command_value(
+ column.source_unit
+ ) | Added sourceUnit to latex output | sosy-lab_benchexec | train | py |
6d4560cffe87cdd2fc5d0515d99a9009c4f70870 | diff --git a/aioredis/pool.py b/aioredis/pool.py
index <HASH>..<HASH> 100644
--- a/aioredis/pool.py
+++ b/aioredis/pool.py
@@ -227,7 +227,7 @@ class RedisPool:
self._pool.append(conn)
finally:
self._acquiring -= 1
- # connection may be closed at yeild point
+ # connection may be closed at yield point
self._drop_closed()
if self.freesize:
return
@@ -239,7 +239,7 @@ class RedisPool:
self._pool.append(conn)
finally:
self._acquiring -= 1
- # connection may be closed at yeild point
+ # connection may be closed at yield point
self._drop_closed()
def _create_new_connection(self): | fix typo in comment: "yeild" | aio-libs_aioredis | train | py |
24535bf87d8caa3aa2905422e87cb16fb7fd727c | diff --git a/pptx/shapes/table.py b/pptx/shapes/table.py
index <HASH>..<HASH> 100644
--- a/pptx/shapes/table.py
+++ b/pptx/shapes/table.py
@@ -281,14 +281,14 @@ class _Column(object):
def __init__(self, gridCol, table):
super(_Column, self).__init__()
- self.__gridCol = gridCol
- self.__table = table
+ self._gridCol = gridCol
+ self._table = table
def _get_width(self):
"""
Return width of column in EMU
"""
- return int(self.__gridCol.get('w'))
+ return int(self._gridCol.get('w'))
def _set_width(self, width):
"""
@@ -297,8 +297,8 @@ class _Column(object):
if not isinstance(width, int) or width < 0:
msg = "column width must be positive integer"
raise ValueError(msg)
- self.__gridCol.set('w', str(width))
- self.__table._notify_width_changed()
+ self._gridCol.set('w', str(width))
+ self._table._notify_width_changed()
#: Read-write integer width of this column in English Metric Units (EMU).
width = property(_get_width, _set_width) | reorg: _Column leading dunderscores to single | scanny_python-pptx | train | py |
c20825749b853498b4d42fa6648089cdfd5fc1cd | diff --git a/examples/platformer/js/entities/entities.js b/examples/platformer/js/entities/entities.js
index <HASH>..<HASH> 100644
--- a/examples/platformer/js/entities/entities.js
+++ b/examples/platformer/js/entities/entities.js
@@ -238,6 +238,9 @@ game.PathEnemyEntity = me.Entity.extend({
settings.width = settings.framewidth;
settings.height = settings.frameheight;
+ // erase the default shape definition
+ settings.shapes = undefined;
+
// call the super constructor
this._super(me.Entity, 'init', [x, y , settings]); | [#<I>] fixed the platformer example
well this is one example where we need a proper way to not use the given
default shape, as the way I did it for now is not super clean. Shall we
use `noDefaultShape` here as well ? | melonjs_melonJS | train | js |
df1dab8ea52be9bd5e52f72acdf084800afc5658 | diff --git a/join/__init__.py b/join/__init__.py
index <HASH>..<HASH> 100644
--- a/join/__init__.py
+++ b/join/__init__.py
@@ -4,4 +4,4 @@ from ._core import join, merge, group
from ._join_funcs import tuple_join
from ._join_funcs import union_join
-__version__ = '0.0.2'
+__version__ = '0.1.1'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,13 +10,13 @@ with open('LICENSE.txt') as license_file:
setup(name='join',
packages=['join'],
- version='0.0.2',
+ version='0.1.1',
description='SQL-style joins for iterables.',
long_description=long_description,
license=license,
author='Stuart Owen',
author_email='[email protected]',
url='https://github.com/StuartAxelOwen/join',
- download_url='https://github.com/StuartAxelOwen/join/archive/0.0.2.zip',
+ download_url='https://github.com/StuartAxelOwen/join/archive/0.1.zip',
keywords=['join', 'joins', 'merge', 'merges', 'list join', 'iterable join'],
) | Update package number for `group` addition | soaxelbrooke_join | train | py,py |
79adb9b2f9923c058da26f08d8229033fcbf36bd | diff --git a/lib/rule.js b/lib/rule.js
index <HASH>..<HASH> 100644
--- a/lib/rule.js
+++ b/lib/rule.js
@@ -195,6 +195,6 @@ Rule.prototype.exec = function(event)
})
})
- ps.stdout.on('data', self.logger.info);
+ ps.stdout.on('data', self.logger.debug);
ps.stderr.on('data', self.logger.error);
}; | send stdout to logger.debug
It’s not really INFO level. | ceejbot_jthoober | train | js |
64eac0bad23eac8e94b493726d9e17255a5d4f4c | diff --git a/transform.js b/transform.js
index <HASH>..<HASH> 100644
--- a/transform.js
+++ b/transform.js
@@ -3,10 +3,13 @@ var getTransformMatrix = require('./lib/getTransformMatrix');
module.exports = function( item, data ) {
var transform = getTransformMatrix(data);
+ var cssValue;
+ var perspective;
if( transform ) {
-
- var cssValue = 'matrix3d(' + Array.prototype.join.call( transform, ',' ) + ')';
+
+ perspective = -1 / transform[ 11 ];
+ cssValue = 'perspective(' + perspective + 'px) matrix3d(' + Array.prototype.join.call( transform, ',' ) + ')';
item.style.transform = cssValue;
item.style.webkitTransform = cssValue; | Swapped perspective to be applied again | Jam3_f1-dom | train | js |
73514414ffe0da2b9261e49ea3c848ab58cf3a6c | diff --git a/src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java b/src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java
+++ b/src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java
@@ -91,7 +91,7 @@ public class EcrExtendedAuth {
}
CloseableHttpClient createClient() {
- return HttpClients.createDefault();
+ return HttpClients.custom().useSystemProperties().build();
}
private JSONObject executeRequest(CloseableHttpClient client, HttpPost request) throws IOException, MojoExecutionException { | Enable usage of system properties for HttpClient
This allows using Extended Authentication behind a proxy, as it advices
the HttpClient to use the JVM's standard system properties for
proxies (<URL>). | fabric8io_docker-maven-plugin | train | java |
fb2467334bc75e16c0f76d6a5b0ec7dc55b4f3b7 | diff --git a/src/Service/Relationships.php b/src/Service/Relationships.php
index <HASH>..<HASH> 100644
--- a/src/Service/Relationships.php
+++ b/src/Service/Relationships.php
@@ -274,6 +274,12 @@ class Relationships implements InputConfiguringInterface
case 'mongodump':
case 'mongoexport':
case 'mongorestore':
+ if (isset($database['url'])) {
+ if ($command === 'mongo') {
+ return $database['url'];
+ }
+ return sprintf('--uri %s', OsUtil::escapePosixShellArg($database['url']));
+ }
$args = sprintf(
'--username %s --password %s --host %s --port %d',
OsUtil::escapePosixShellArg($database['username']), | Fix shell arguments for multi-instance mongo commands | platformsh_platformsh-cli | train | php |
45734fb71ef64a00d8a06258f4b3bc06e73fb143 | diff --git a/Core/Repository/Propel/AlSeoRepositoryPropel.php b/Core/Repository/Propel/AlSeoRepositoryPropel.php
index <HASH>..<HASH> 100644
--- a/Core/Repository/Propel/AlSeoRepositoryPropel.php
+++ b/Core/Repository/Propel/AlSeoRepositoryPropel.php
@@ -87,7 +87,9 @@ class AlSeoRepositoryPropel extends Base\AlPropelRepository implements SeoReposi
throw new \InvalidArgumentException('The permalink must be a string. The seo attribute cannot be retrieved');
}
- return AlSeoQuery::create()
+ return AlSeoQuery::create('a')
+ ->joinWith('a.AlPage')
+ ->joinWith('a.AlLanguage')
->filterByPermalink($permalink)
->filterByToDelete(0)
->findOne(); | fromPermalink method is fetched with pages and languages | redkite-labs_RedKiteCmsBundle | train | php |
88bbb8c1ae64f52ac526bb87100fc9d772d3850e | diff --git a/src/ol/layer/Heatmap.js b/src/ol/layer/Heatmap.js
index <HASH>..<HASH> 100644
--- a/src/ol/layer/Heatmap.js
+++ b/src/ol/layer/Heatmap.js
@@ -4,6 +4,7 @@
import {getChangeEventType} from '../Object.js';
import {createCanvasContext2D} from '../dom.js';
import VectorLayer from './Vector.js';
+import {clamp} from '../math.js';
import {assign} from '../obj.js';
import WebGLPointsLayerRenderer from '../renderer/webgl/PointsLayer.js';
@@ -180,7 +181,10 @@ class Heatmap extends VectorLayer {
attributes: [
{
name: 'weight',
- callback: this.weightFunction_
+ callback: function(feature) {
+ const weight = this.weightFunction_(feature);
+ return weight !== undefined ? clamp(weight, 0, 1) : 1;
+ }.bind(this)
}
],
vertexShader: ` | Clamp the weight value between 0 and 1 | openlayers_openlayers | train | js |
61dda7900d7fd13d046fb656801ba00ba1d04093 | diff --git a/salt/runners/lxc.py b/salt/runners/lxc.py
index <HASH>..<HASH> 100644
--- a/salt/runners/lxc.py
+++ b/salt/runners/lxc.py
@@ -12,6 +12,7 @@ import time
import os
import copy
import logging
+from six import string_types
# Import Salt libs
from salt.utils.odict import OrderedDict | runners.lxc: basestring => six.string_types
************* Module salt.runners.lxc
salt/runners/lxc.py:<I>: [W<I>(basestring-builtin), init] basestring built-in referenced | saltstack_salt | train | py |
2b7bbb422a62754ed15c92a9209a50ce70ebe7d7 | diff --git a/lib/deppack/modules.js b/lib/deppack/modules.js
index <HASH>..<HASH> 100644
--- a/lib/deppack/modules.js
+++ b/lib/deppack/modules.js
@@ -143,7 +143,7 @@ const getNewHeader = (moduleName, source, filePath) => {
if (filePath.indexOf('.json') === -1) {
const fbModuleName = generateFileBasedModuleName(filePath);
- const fbAlias = shims.shouldIncludeFileBasedAlias(moduleName) ?
+ const fbAlias = isMain(filePath) ?
aliasDef(fbModuleName, moduleName) :
'';
diff --git a/lib/deppack/resolve.js b/lib/deppack/resolve.js
index <HASH>..<HASH> 100644
--- a/lib/deppack/resolve.js
+++ b/lib/deppack/resolve.js
@@ -15,7 +15,7 @@ const addToModMap = mod => {
modMap[name] = mod;
};
-const noPackage = x => mediator.packages[x] === null;
+const noPackage = x => mediator.packages[x] == null;
const buildModMap = () => {
if (modMap) return Promise.resolve(); | Include file-based aliases for main files | brunch_brunch | train | js,js |
Subsets and Splits