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
|
---|---|---|---|---|---|
2d41092e8637e5625f88aa4685380fbf8ea9e6a0
|
diff --git a/lib/jslint/utils.rb b/lib/jslint/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/jslint/utils.rb
+++ b/lib/jslint/utils.rb
@@ -34,7 +34,7 @@ module JSLint
end
def paths_from_command_line(field)
- argument = ENV[field]
+ argument = ENV[field] || ENV[field.upcase]
argument && argument.split(/,/)
end
|
accept paths/exclude_paths on command line also in uppercase
|
mackuba_jslint_on_rails
|
train
|
rb
|
427e29328ba56eea68df2e72801c19995b4ab994
|
diff --git a/core/WidgetsList.php b/core/WidgetsList.php
index <HASH>..<HASH> 100644
--- a/core/WidgetsList.php
+++ b/core/WidgetsList.php
@@ -81,7 +81,7 @@ class WidgetsList extends Singleton
$v = array_merge($widgets[$category], $v);
}
- $widgets[$category] = $v;
+ $widgets[$category] = array_values($v);
}
$cache->save($cacheId, $widgets);
|
Fix bug in widget list remove where the JSON object becomes array
|
matomo-org_matomo
|
train
|
php
|
cd5d3dd644d9561245948284e29b35917222e409
|
diff --git a/src/jsep.js b/src/jsep.js
index <HASH>..<HASH> 100644
--- a/src/jsep.js
+++ b/src/jsep.js
@@ -751,7 +751,8 @@ export class Jsep {
}
}
}
- else if (args.length !== separator_count) {
+ else if (args.length !== separator_count && separator_count !== 0) {
+ // NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments
this.throwError('Expected comma');
}
else {
diff --git a/test/jsep.test.js b/test/jsep.test.js
index <HASH>..<HASH> 100644
--- a/test/jsep.test.js
+++ b/test/jsep.test.js
@@ -27,6 +27,9 @@ import {testParser, testOpExpression, esprimaComparisonTest} from './test_utils.
testParser('\'a\'.toString()', {}, assert);
testParser('[1].length', {}, assert);
testParser(';', {}, assert);
+ // allow all spaces or all commas to separate arguments
+ testParser('check(a, b, c, d)', {}, assert);
+ testParser('check(a b c d)', {}, assert);
});
QUnit.test('Arrays', function (assert) {
|
Allow either all spaces or all commas between arguments to a function call. Keeping spaces for backward compatibility
|
soney_jsep
|
train
|
js,js
|
f7b3f5292d015dcdc3a8c12555c308a37391de9c
|
diff --git a/nba_py/player.py b/nba_py/player.py
index <HASH>..<HASH> 100644
--- a/nba_py/player.py
+++ b/nba_py/player.py
@@ -7,7 +7,7 @@ class PlayerNotFoundException(Exception):
def get_player(first_name,
- last_name,
+ last_name = None,
season=CURRENT_SEASON,
only_current=0,
just_id=True):
@@ -17,7 +17,7 @@ def get_player(first_name,
Args:
:first_name: First name of the player
- :last_name: Last name of the player
+ :last_name: Last name of the player (this is None is the player only has first name [Nene])
:only_current: Only wants the current list of players
:just_id: Only wants the id of the player
@@ -27,7 +27,10 @@ def get_player(first_name,
Raises:
:PlayerNotFoundException::
"""
- name = '{}, {}'.format(last_name, first_name).lower()
+ if last_name == None:
+ name = first_name.lower()
+ else:
+ name = '{}, {}'.format(last_name, first_name).lower()
pl = PlayerList(season=season, only_current=only_current).info()
hdr = 'DISPLAY_LAST_COMMA_FIRST'
if HAS_PANDAS:
|
get_player now accepts players without lastname
for my boy Nene
|
seemethere_nba_py
|
train
|
py
|
b641fa939a862fee9bce0c678c6c75a709ab1b19
|
diff --git a/moneywagon/crypto_data.py b/moneywagon/crypto_data.py
index <HASH>..<HASH> 100644
--- a/moneywagon/crypto_data.py
+++ b/moneywagon/crypto_data.py
@@ -29,7 +29,7 @@ crypto_data = {
BitpayInsight, Blockonomics, NeoCrypto
],
'single_transaction': [
- BitpayInsight, Blockr, BitGo, BlockCypher, BlockExplorerCom, BlockChainInfo,
+ BitpayInsight, Blockr, BitGo, BlockCypher, BlockExplorerCom,
NeoCrypto, ChainSo,
],
'push_tx': [
diff --git a/moneywagon/services.py b/moneywagon/services.py
index <HASH>..<HASH> 100644
--- a/moneywagon/services.py
+++ b/moneywagon/services.py
@@ -587,7 +587,8 @@ class ChainSo(Service):
ins = [
{
'address': x['address'],
- 'amount': currency_to_protocol(x['value'])
+ 'amount': currency_to_protocol(x['value']),
+ 'txid': x['from_output']['txid'],
} for x in r['inputs']
]
|
added txid to inputs for chainso single transaction, removed blockchain.info from single tx because it doesn't return txid for inputs
|
priestc_moneywagon
|
train
|
py,py
|
c9b940922b7d91ef46571abc6dc406297688916b
|
diff --git a/packages/ooth-local/src/index.js b/packages/ooth-local/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/ooth-local/src/index.js
+++ b/packages/ooth-local/src/index.js
@@ -34,6 +34,7 @@ module.exports = function({
registerMethod,
registerUniqueField,
registerProfileField,
+ getProfile,
getUserByUniqueField,
getUserById,
getUserByFields,
@@ -104,9 +105,11 @@ module.exports = function({
updateUser(req.user._id, {
username
}).then(() => {
-
+ return getUserById(req.user._id)
+ }).then(user => {
return res.send({
- message: 'Username updated.'
+ message: 'Username updated.',
+ user: getProfile(user)
})
})
})
@@ -210,7 +213,8 @@ module.exports = function({
verified: true,
verificationToken: null
}).then(() => {
-
+ return getUserById(user._id)
+ }).then(user => {
if (onVerify) {
onVerify({
_id: user._id,
@@ -219,7 +223,8 @@ module.exports = function({
}
return res.send({
- message: 'Email verified'
+ message: 'Email verified',
+ user: getProfile(user)
})
})
}).catch(e => {
|
ooth local return profile after profile change
|
nmaro_ooth
|
train
|
js
|
ab9c5edef8a2eb79a3ad577bdca0bc660fa829af
|
diff --git a/src/Zicht/Bundle/MenuBundle/DependencyInjection/ZichtMenuExtension.php b/src/Zicht/Bundle/MenuBundle/DependencyInjection/ZichtMenuExtension.php
index <HASH>..<HASH> 100644
--- a/src/Zicht/Bundle/MenuBundle/DependencyInjection/ZichtMenuExtension.php
+++ b/src/Zicht/Bundle/MenuBundle/DependencyInjection/ZichtMenuExtension.php
@@ -41,8 +41,10 @@ class ZichtMenuExtension extends Extension
$container->setParameter('twig.form.resources', $formResources);
$container->getDefinition('zicht_menu.provider.database_menu_provider')->replaceArgument(0, new Reference($config['builder_service']));
- $container->removeDefinition('zicht_menu.menu_builder');
- $container->setAlias('zicht_menu.menu_builder', $config['builder_service']);
+ if ($config['builder_service'] !== 'zicht_menu.menu_builder') {
+ $container->removeDefinition('zicht_menu.menu_builder');
+ $container->setAlias('zicht_menu.menu_builder', $config['builder_service']);
+ }
// knp menu ^2:
if (interface_exists('Knp\Menu\Matcher\Voter\VoterInterface')) {
|
default config (no builder_service) was broken
|
zicht_menu-bundle
|
train
|
php
|
af66df7c1128e326e6e430e9e7b88b1effbdaa56
|
diff --git a/salt/modules/network.py b/salt/modules/network.py
index <HASH>..<HASH> 100644
--- a/salt/modules/network.py
+++ b/salt/modules/network.py
@@ -647,7 +647,11 @@ def arp():
comps = line.split()
if len(comps) < 4:
continue
- if not __grains__['kernel'] == 'OpenBSD':
+ if __grains__['kernel'] == 'SunOS':
+ if ':' not in comps[-1]:
+ continue
+ ret[comps[-1]] = comps[1]
+ elif not __grains__['kernel'] == 'OpenBSD':
ret[comps[3]] = comps[1].strip('(').strip(')')
else:
if comps[0] == 'Host' or comps[1] == '(incomplete)':
|
fix up arp for sunos
|
saltstack_salt
|
train
|
py
|
5bae3ebb13ad87c1c7cece1f441880a202135ea3
|
diff --git a/src/bindings/html/view.js b/src/bindings/html/view.js
index <HASH>..<HASH> 100644
--- a/src/bindings/html/view.js
+++ b/src/bindings/html/view.js
@@ -86,7 +86,8 @@ function init(view, client) {
}
function onMutations(mutations) {
- return this.resolvedLanguages().then(
+ return this._interactive.then(
+ client => client.method('resolvedLanguages')).then(
langs => translateMutations(this, langs, mutations));
}
|
Bug <I> (hotfix) - Remove resolvedLanguages from onMutations
|
l20n_l20n.js
|
train
|
js
|
c6a06f94634749c79d05a0df77167ccdb7a38642
|
diff --git a/python/test/communicator/test_all_reduce.py b/python/test/communicator/test_all_reduce.py
index <HASH>..<HASH> 100644
--- a/python/test/communicator/test_all_reduce.py
+++ b/python/test/communicator/test_all_reduce.py
@@ -53,7 +53,7 @@ def test_all_reduce(seed, inplace, division, comm_nccl_opts):
num_layers = 20
rng = np.random.RandomState(seed)
for l in range(num_layers):
- x_data = np.clip(rng.rand(3, 4), -1e-5, 2.*1e3)
+ x_data = rng.rand(3, 4)
x_data_list.append(x_data)
x = nn.Variable(x_data.shape)
x.d = x_data * (device_id + 1)
|
Delete np.clip.
|
sony_nnabla
|
train
|
py
|
75f2eaaf449a26ee9d223bdbaf0e7c7e8a671200
|
diff --git a/lib/repl.php b/lib/repl.php
index <HASH>..<HASH> 100644
--- a/lib/repl.php
+++ b/lib/repl.php
@@ -1,5 +1,5 @@
<?php
-require_once('/Users/historium/pharen/lang.php');
+require_once('C:\pharen\lang.php');
use Pharen\Lexical as Lexical;
Lexical::$scopes['repl'] = array();
require_once("path.php");
|
Compile repl.phn and path.phn files before starting the REPL.
|
Scriptor_pharen
|
train
|
php
|
768b014ffe7b3c9559f4fbc52f2efa82676c43e6
|
diff --git a/conu/apidefs/container.py b/conu/apidefs/container.py
index <HASH>..<HASH> 100644
--- a/conu/apidefs/container.py
+++ b/conu/apidefs/container.py
@@ -69,6 +69,19 @@ class Container(object):
@contextmanager
def http_client(self, host=None, port=None):
+ """
+ allow requests in context -- e.g.:
+
+ .. code-block:: none
+
+ with container.http_client(port="80", ...) as c:
+ assert c.get("/api/...")
+
+
+ :param host: str, if None, set self.get_IPv4s()[0]
+ :param port: str or int, if None, set to self.get_ports()[0]
+ :return: instance of :class:`conu.utils.http_client.HttpClient`
+ """
host = host or self.get_IPv4s()[0]
port = port or self.get_ports()[0]
|
Add docs for http_client
|
user-cont_conu
|
train
|
py
|
d86dc2be762bc5f6fc7822c6ba14ff5fd995c63b
|
diff --git a/salt/modules/linux_lvm.py b/salt/modules/linux_lvm.py
index <HASH>..<HASH> 100644
--- a/salt/modules/linux_lvm.py
+++ b/salt/modules/linux_lvm.py
@@ -252,7 +252,7 @@ def pvremove(devices, override=True):
'''
cmd = ['pvremove', '-y']
for device in devices.split(','):
- if __salt__['lvm.pvdisplay'](device):
+ if pvdisplay(device):
cmd.append(device)
elif not override:
raise CommandExecutionError('{0} is not a physical volume'.format(device))
|
No need of back-referral within the same module
|
saltstack_salt
|
train
|
py
|
13168e659465df26e66df61f100e9d701ee88061
|
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/cache/strategy/local_cache.rb
+++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/object/duplicable'
+require 'active_support/inflector/methods active_support/core_ext/string/inflections'
module ActiveSupport
module Cache
|
requires active_support/inflector/methods active_support/core_ext/string/inflections in local_cache.rb because it uses underscore
|
rails_rails
|
train
|
rb
|
0bb4128cb5f5f61c644e64b0de8e3aa64419bf9a
|
diff --git a/src/main/java/org/fest/assertions/api/AbstractAssert.java b/src/main/java/org/fest/assertions/api/AbstractAssert.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fest/assertions/api/AbstractAssert.java
+++ b/src/main/java/org/fest/assertions/api/AbstractAssert.java
@@ -54,6 +54,9 @@ public abstract class AbstractAssert<S extends AbstractAssert<S, A>, A> implemen
protected final A actual;
protected final S myself;
+ // we prefer not to use Class<? extends S> selfType because it would force inherited
+ // constructor to cast with a compiler warning
+ // let's keep compiler warning internal to fest (when we can) and not expose them to our end users.
@SuppressWarnings("unchecked")
protected AbstractAssert(A actual, Class<?> selfType) {
myself = (S) selfType.cast(this);
|
Add comment to explain why AbstractAssert has a class<?> arg instead of Class<? extends S> selfType
|
alexruiz_fest-assert-2.x
|
train
|
java
|
0240af19aae8183a154bac395c7efb02703806af
|
diff --git a/src/cal-heatmap.js b/src/cal-heatmap.js
index <HASH>..<HASH> 100755
--- a/src/cal-heatmap.js
+++ b/src/cal-heatmap.js
@@ -2735,7 +2735,7 @@ CalHeatMap.prototype = {
.attr("width", 0)
.attr("height", 0)
.remove()
- .call(callback)
+ .each("end", function() { if (typeof callback === "function") { callback(); } })
;
return null;
@@ -2797,8 +2797,7 @@ CalHeatMap.prototype = {
continue;
}
- // The DOM Level 2 CSS wa
- // y
+ // The DOM Level 2 CSS way
/* jshint maxdepth: false */
if ("getComputedStyle" in window) {
var cs = getComputedStyle(dom, null);
|
Trigger the destroy callback argument only at the end of the animation, and only it it's a callable
|
wa0x6e_cal-heatmap
|
train
|
js
|
84e72b55e0a99c82ef54df02f1026ea408fa6948
|
diff --git a/collector/main.go b/collector/main.go
index <HASH>..<HASH> 100644
--- a/collector/main.go
+++ b/collector/main.go
@@ -59,6 +59,8 @@ func main() {
fatal(err)
}
defer db.Session.Close()
+ fmt.Printf("connected to MongoDB server at %s.\n", connString)
+ fmt.Printf("Using the database %q.\n\n", dbName)
if !dry {
handler := MessageHandler{}
|
collector: display to which database collector is connected
|
tsuru_tsuru
|
train
|
go
|
c69c09bcfc23e32a3b6ed9101966cc8b1959ff9e
|
diff --git a/lib/engine.go b/lib/engine.go
index <HASH>..<HASH> 100644
--- a/lib/engine.go
+++ b/lib/engine.go
@@ -171,6 +171,11 @@ loop:
for {
select {
case now := <-ticker.C:
+ // Don't tick at all if the engine is paused.
+ if !e.Status.Running.Bool {
+ continue
+ }
+
// Track time deltas to ensure smooth interpolation even in the face of latency.
timeDelta := now.Sub(lastTick)
e.Status.AtTime.Int64 += int64(timeDelta)
|
[fix] Engine: Don't tick during pauses
|
loadimpact_k6
|
train
|
go
|
b8e1bf986bbc28f29b34f707eb74ce3c45765fd9
|
diff --git a/library/CM/Site/Abstract.php b/library/CM/Site/Abstract.php
index <HASH>..<HASH> 100644
--- a/library/CM/Site/Abstract.php
+++ b/library/CM/Site/Abstract.php
@@ -97,9 +97,28 @@ abstract class CM_Site_Abstract extends CM_Class_Abstract implements CM_ArrayCon
}
/**
+ * @return string
+ * @throws CM_Exception_Invalid
+ */
+ public function getHost() {
+ $siteHost = parse_url($this->getUrl(), PHP_URL_HOST);
+ if (false === $siteHost) {
+ throw new CM_Exception_Invalid('Cannot detect host from `' . $this->getUrl() . '`.');
+ }
+ return $siteHost;
+ }
+
+ /**
* @param CM_Response_Page $response
*/
public function preprocessPageResponse(CM_Response_Page $response) {
+ $site = $response->getSite();
+ $request = $response->getRequest();
+ if ($site->getHost() !== $request->getHeader('host')) {
+ $path = CM_Util::link($request->getPath(), $request->getQuery());
+ $response->redirectUrl($response->getRender()->getUrl($path, null, $site));
+ return;
+ }
}
/**
|
Add preprocessPageResponse to verify request domain with site domain
|
cargomedia_cm
|
train
|
php
|
cc574a703e708e73d1c9deeeae8074378692f7bc
|
diff --git a/src/modules/Tab/TabPane.js b/src/modules/Tab/TabPane.js
index <HASH>..<HASH> 100644
--- a/src/modules/Tab/TabPane.js
+++ b/src/modules/Tab/TabPane.js
@@ -32,7 +32,7 @@ function TabPane(props) {
}
return (
- <ElementType {...calculatedDefaultProps} {...rest} className={classes} loading={loading}>
+ <ElementType {...calculatedDefaultProps} {...rest} className={classes}>
{children}
</ElementType>
)
|
fix(TabPane): remove extra loading prop (#<I>)
|
Semantic-Org_Semantic-UI-React
|
train
|
js
|
2c40a72345ef9866392b3c23d9769d50fb3e05dc
|
diff --git a/widgets/TbDropdown.php b/widgets/TbDropdown.php
index <HASH>..<HASH> 100644
--- a/widgets/TbDropdown.php
+++ b/widgets/TbDropdown.php
@@ -50,7 +50,7 @@ class TbDropdown extends TbBaseMenu
if (!isset($item['linkOptions']))
$item['linkOptions'] = array();
- if (isset($item['items']) && !empty($item['items']))
+ if (isset($item['items']) && !empty($item['items']) && empty($item['url']))
$item['url'] = '#';
$item['linkOptions']['tabindex'] = -1;
|
Fix for issue #<I>
The rewriting here is wrong, if the URL on the item itself is already set we do not want to cripple it.
We can have active parent menu items, you know.:)
|
clevertech_YiiBooster
|
train
|
php
|
6e4a3b348a30d6225a1c698cb01020adae931296
|
diff --git a/xmantissa/tdbview.py b/xmantissa/tdbview.py
index <HASH>..<HASH> 100644
--- a/xmantissa/tdbview.py
+++ b/xmantissa/tdbview.py
@@ -68,7 +68,7 @@ class ActionsColumnView(ColumnViewBase):
handler %= (action.actionID, idx)
stan = tags.a(href='#', onclick=handler)[stan]
else:
- stan = linkstan[stan]
+ stan = linkstan
tag[stan]
|
add a bunch of CC toggle actions
|
twisted_mantissa
|
train
|
py
|
3b59b5eaee01f9b520d81e3299d296dfb0dbec38
|
diff --git a/lib/reveal-ck/slides_html_builder.rb b/lib/reveal-ck/slides_html_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/reveal-ck/slides_html_builder.rb
+++ b/lib/reveal-ck/slides_html_builder.rb
@@ -12,7 +12,8 @@ module RevealCK
def initialize(args)
@input_file = args[:input_file]
@presentation = args[:presentation]
- raise 'either :input_file or :presentation are required' unless @input_file || @presentation
+ missing_info = 'either :input_file or :presentation are required'
+ raise missing_info unless @input_file || @presentation
end
def render
|
[cane] Tweaks for line length
|
jedcn_reveal-ck
|
train
|
rb
|
90302f34bef573693148ded836b8f05b9b9a2876
|
diff --git a/ck/kernel.py b/ck/kernel.py
index <HASH>..<HASH> 100644
--- a/ck/kernel.py
+++ b/ck/kernel.py
@@ -847,13 +847,15 @@ def get_version(i):
"""
+ import copy
+
s=''
- x=cfg['version']
+ x=copy.deepcopy(cfg['version'])
for q in x:
if s!='': s+='.'
- s+=q
+ s+=str(q)
return {'return':0, 'version':x, 'version_str':s}
|
fixing small bug with version detection (needed to check modules compatibility)
|
ctuning_ck
|
train
|
py
|
23dd4ab2ca9321a7f57aa09c1dee041eaf1667c9
|
diff --git a/modules/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java b/modules/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java
index <HASH>..<HASH> 100644
--- a/modules/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java
+++ b/modules/core/src/main/java/org/projectodd/wunderboss/WunderBoss.java
@@ -1,5 +1,7 @@
package org.projectodd.wunderboss;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
import org.jboss.logging.Logger;
import java.util.HashMap;
@@ -80,6 +82,14 @@ public class WunderBoss {
return component;
}
+ public Logger getLogger(String name) {
+ return Logger.getLogger(name);
+ }
+
+ public void setLogLevel(String level) {
+ LogManager.getRootLogger().setLevel(Level.toLevel(level));
+ }
+
private Map<String, Language> languages = new HashMap<>();
private Map<String, Component> components = new HashMap<>();
|
Let users configure container logging levels and grab loggers
|
projectodd_wunderboss-release
|
train
|
java
|
93dca704fb4a04fcfab3181b0f02edd2b4d3b9bf
|
diff --git a/tests/model/VirtualPageTest.php b/tests/model/VirtualPageTest.php
index <HASH>..<HASH> 100644
--- a/tests/model/VirtualPageTest.php
+++ b/tests/model/VirtualPageTest.php
@@ -9,6 +9,10 @@ class VirtualPageTest extends SapphireTest {
'VirtualPageTest_VirtualPageSub',
);
+ protected $illegalExtensions = array(
+ 'SiteTree' => array('SiteTreeSubsites', 'Translatable')
+ );
+
protected $requiredExtensions = array(
'SiteTree' => array('VirtualPageTest_PageExtension')
);
|
Fixing test failures introduced by Translatable and SiteTreeSubsites
Same fix as e<I>abc6, except it applies to VirtualPageTest.
|
silverstripe_silverstripe-siteconfig
|
train
|
php
|
392008c4f5907d15dfd87434944be3842ef175e1
|
diff --git a/Logger.js b/Logger.js
index <HASH>..<HASH> 100644
--- a/Logger.js
+++ b/Logger.js
@@ -8,6 +8,7 @@ module.exports = std.Class(function() {
}
this._init = function(opts) {
+ if (typeof opts == 'string') { opts = { name:opts } }
opts = std.extend(opts, defaults)
this._name = opts.name
this._emailQueue = []
|
Allow for passing in a simple string as the name of a logger
|
marcuswestin_std.js
|
train
|
js
|
5ebada7526994452fbb71481a064b0832a02b575
|
diff --git a/src/foundation/src/Http/Datatables/Extensions.php b/src/foundation/src/Http/Datatables/Extensions.php
index <HASH>..<HASH> 100644
--- a/src/foundation/src/Http/Datatables/Extensions.php
+++ b/src/foundation/src/Http/Datatables/Extensions.php
@@ -296,6 +296,12 @@ class Extensions extends DataTable
}
}
+ $installerPath = storage_path('extension-operation.txt');
+
+ if( file_exists($installerPath) && ! is_writable($installerPath)) {
+ $invalidPermissionsPaths[] = $installerPath;
+ }
+
return $invalidPermissionsPaths;
}
diff --git a/src/foundation/src/Support/Providers/Traits/RouteProviderTrait.php b/src/foundation/src/Support/Providers/Traits/RouteProviderTrait.php
index <HASH>..<HASH> 100644
--- a/src/foundation/src/Support/Providers/Traits/RouteProviderTrait.php
+++ b/src/foundation/src/Support/Providers/Traits/RouteProviderTrait.php
@@ -62,7 +62,6 @@ trait RouteProviderTrait
return;
}
-
if (!$this->isPathIncluded($path)) {
$foundation = $this->app->make('antares.app');
$namespace = $namespace ?: $this->namespace;
|
FIX: extensions permission for file validation
|
antaresproject_core
|
train
|
php,php
|
08f1a078f7ae4899908b01522bd82949b8dab44c
|
diff --git a/SingularityUI/webpack.config.js b/SingularityUI/webpack.config.js
index <HASH>..<HASH> 100644
--- a/SingularityUI/webpack.config.js
+++ b/SingularityUI/webpack.config.js
@@ -67,6 +67,9 @@ module.exports = {
warnings: false
}
}),
+ new webpack.DefinePlugin({
+ 'process.env.NODE_ENV': '"production"'
+ }),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
]
};
|
set NODE_ENV to production
|
HubSpot_Singularity
|
train
|
js
|
42b5ae8df143fd9fee1a82ce0084fb4074678885
|
diff --git a/source/Application/Model/VariantHandler.php b/source/Application/Model/VariantHandler.php
index <HASH>..<HASH> 100644
--- a/source/Application/Model/VariantHandler.php
+++ b/source/Application/Model/VariantHandler.php
@@ -331,7 +331,7 @@ class VariantHandler extends \oxSuperCfg
$blActive = ($sActVariantId === $oVariant->getId()) ? true : false;
for ($i = 0; $i < $iVarSelCnt; $i++) {
$sName = isset($aNames[$i]) ? trim($aNames[$i]) : false;
- if ($sName !== '') {
+ if ($sName !== '' && $sName !== false) {
$sHash = md5($sName);
// filling up filter
|
<I> Show variants with 0 as title
Related #<I>
|
OXID-eSales_oxideshop_ce
|
train
|
php
|
fcc22023f651666581926f639667c20f45a08142
|
diff --git a/sharq/queue.py b/sharq/queue.py
index <HASH>..<HASH> 100644
--- a/sharq/queue.py
+++ b/sharq/queue.py
@@ -449,10 +449,10 @@ class SharQ(object):
def ping(self):
"""
- To check the availability of redis. If redis is down ping will throw exception
- :return: True
+ To check the availability of redis. If redis is down get will throw exception
+ :return: value or None
"""
- return self._r.ping()
+ return self._r.get('sharq:deepstatus:{}'.format(self._key_prefix))
def clear_queue(self, queue_type=None, queue_id=None, purge_all=False):
"""clear the all entries in queue with particular queue_id
|
use redis get command instead of ping
|
plivo_sharq
|
train
|
py
|
c4b3379a922313f0ea73d99dcf16de58bfb560c8
|
diff --git a/go/chat/inboxsource_test.go b/go/chat/inboxsource_test.go
index <HASH>..<HASH> 100644
--- a/go/chat/inboxsource_test.go
+++ b/go/chat/inboxsource_test.go
@@ -277,6 +277,8 @@ func TestInboxSourceLocalOnly(t *testing.T) {
}
func TestInboxChatBlockingAlsoUserBlocks(t *testing.T) {
+ t.Skip()
+
ctc := makeChatTestContext(t, "TestInboxBlocking", 3)
defer ctc.cleanup()
users := ctc.users()
diff --git a/go/teams/audit_test.go b/go/teams/audit_test.go
index <HASH>..<HASH> 100644
--- a/go/teams/audit_test.go
+++ b/go/teams/audit_test.go
@@ -238,6 +238,8 @@ func (c CorruptingMerkleClient) LookupLeafAtSeqnoForAudit(m libkb.MetaContext, l
var _ libkb.MerkleClientInterface = CorruptingMerkleClient{}
func TestAuditFailsIfDataIsInconsistent(t *testing.T) {
+ t.Skip()
+
fus, tcs, cleanup := setupNTests(t, 2)
defer cleanup()
|
Skip tests to fix CI
Two tests are currently broken:
- TestInboxChatBlockingAlsoUserBlocks
- TestAuditFailsIfDataIsInconsistent
|
keybase_client
|
train
|
go,go
|
c4f2b26116bbf5f3dbbe4dcd1ee0a306de7e99d1
|
diff --git a/h5p-default-storage.class.php b/h5p-default-storage.class.php
index <HASH>..<HASH> 100644
--- a/h5p-default-storage.class.php
+++ b/h5p-default-storage.class.php
@@ -372,7 +372,7 @@ class H5PDefaultStorage implements \H5PFileStorage {
return NULL;
}
- if ($contentId === NULL || $contentId === 0) {
+ if ($contentId === NULL || $contentId == 0) {
$target = $this->getEditorPath();
}
else {
|
Make sure contentId are handled when passed as strings
|
h5p_h5p-php-library
|
train
|
php
|
d9c8816428c1ec8bb41e91982b60c832463fbf74
|
diff --git a/lib/podoff.rb b/lib/podoff.rb
index <HASH>..<HASH> 100644
--- a/lib/podoff.rb
+++ b/lib/podoff.rb
@@ -498,12 +498,10 @@ module Podoff
def bt(x, y, text)
- # TODO escape parentheses
-
@content.write "\n" if @content.size > 0
@content.write "BT "
@content.write @font if @font
- @content.write "#{x} #{y} Td (#{text}) Tj"
+ @content.write "#{x} #{y} Td (#{escape(text)}) Tj"
@content.write " ET"
end
@@ -511,6 +509,13 @@ module Podoff
@content.string
end
+
+ protected
+
+ def escape(s)
+
+ s.gsub(/\(/, '\(').gsub(/\)/, '\)')
+ end
end
end
diff --git a/spec/stream_spec.rb b/spec/stream_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/stream_spec.rb
+++ b/spec/stream_spec.rb
@@ -38,7 +38,13 @@ BT /ZapfDingbats 21 Tf 10 50 Td (zapfesque) Tj ET
expect(st.to_s).to eq('BT 10 20 Td (hello world) Tj ET')
end
- it 'escapes the text'
+ it 'escapes the text' do
+
+ st = Podoff::Stream.new
+ st.bt(10, 20, 'hello()world')
+
+ expect(st.to_s).to eq('BT 10 20 Td (hello\(\)world) Tj ET')
+ end
end
end
|
let Stream#bt escape its text
|
jmettraux_podoff
|
train
|
rb,rb
|
1efc04d2f9bb671571017168ff1f51b0e1fe851d
|
diff --git a/src/artist.py b/src/artist.py
index <HASH>..<HASH> 100644
--- a/src/artist.py
+++ b/src/artist.py
@@ -6,7 +6,7 @@ class Artist(Entity):
wraps the artist entity type as described at http://developer.musicmetric.com/timeseries.html
all timeseries are attributes of the form self.<type>_<source>, which sets a dict if there's data
"""
- summary_attrs = ("class", "name", "id", "description", "musicbrainz", "previous_rank", "rank")
+ summary_attrs = ("name", "id", "description", "musicbrainz", "previous_rank", "rank")
def __init__(self, artistUUID, **kwargs):
"""
creates an artist instance. UUID required(or equivelant 3rd party id with prefix,
|
'class' is a keyword, and throws errors, redundant with entity_id for now
|
musicmetric_mmpy
|
train
|
py
|
43294d664b8e6b0108ec9b586ea2357f8e68f770
|
diff --git a/commands/System/download.js b/commands/System/download.js
index <HASH>..<HASH> 100644
--- a/commands/System/download.js
+++ b/commands/System/download.js
@@ -85,9 +85,9 @@ exports.run = async (client, msg, [link, piece, folder = "Downloaded"]) => {
exports.conf = {
enabled: true,
- runIn: ["text"],
+ runIn: ["text", "dm", "group"],
aliases: [],
- permLevel: 5,
+ permLevel: 10,
botPerms: [],
requiredFuncs: [],
};
|
Update download per kyra (#<I>)
|
dirigeants_komada
|
train
|
js
|
13a7336a5969de6fce00f06054280749816bf33d
|
diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -91,7 +91,8 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'default'
+#html_theme = 'default'
+html_theme = 'rtd'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -99,7 +100,7 @@ html_theme = 'default'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
+html_theme_path = ['themes']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
|
output docs with readthedocs theme
|
pycontribs_python-crowd
|
train
|
py
|
12a8be2d346ec223365825439b1c4a3beebb2443
|
diff --git a/fusesoc/edatools/verilator.py b/fusesoc/edatools/verilator.py
index <HASH>..<HASH> 100644
--- a/fusesoc/edatools/verilator.py
+++ b/fusesoc/edatools/verilator.py
@@ -83,11 +83,15 @@ class Verilator(Simulator):
with open(os.path.join(self.work_root, 'Makefile'), 'w') as makefile:
makefile.write(MAKEFILE_TEMPLATE)
+ if 'verilator_options' in self.tool_options:
+ verilator_options = ' '.join(self.tool_options['verilator_options'])
+ else:
+ verilator_options = ''
with open(os.path.join(self.work_root, 'config.mk'), 'w') as config_mk:
config_mk.write(CONFIG_MK_TEMPLATE.format(
top_module = self.toplevel,
vc_file = self.verilator_file,
- verilator_options = ' '.join(self.tool_options['verilator_options'])))
+ verilator_options = verilator_options))
def build_main(self):
logger.info("Building simulation model")
|
Fix verilator crash when verilator_options is not defined
|
olofk_fusesoc
|
train
|
py
|
50b9ab98ef38874058ddaebe425cde0b5abbe8c5
|
diff --git a/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java b/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java
index <HASH>..<HASH> 100644
--- a/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java
+++ b/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java
@@ -1961,7 +1961,7 @@ public class HeapCache<K, V>
/**
* Number of maximum loader threads, depending on the CPUs.
*/
- public int loaderThreadCountCpuFactor = 2;
+ public int loaderThreadCountCpuFactor = 1;
public StandardCommonMetricsFactory commonMetricsFactory = new StandardCommonMetricsFactory();
|
reduce max loader threads to 1 per CPU
|
cache2k_cache2k
|
train
|
java
|
41c7b5bf36e6d1d3759271333fce96065803b73f
|
diff --git a/compliance_checker/cf/util.py b/compliance_checker/cf/util.py
index <HASH>..<HASH> 100644
--- a/compliance_checker/cf/util.py
+++ b/compliance_checker/cf/util.py
@@ -212,7 +212,7 @@ class NCGraph:
def get_dimension(self, dim):
if dim in self.reference_map:
return self.reference_map[dim]
- NCGraph(self.ds, dim, self.ds.dimensions[dim], self.reference_variables, self.reference_map)
+ return NCGraph(self.ds, dim, self.ds.dimensions[dim], self.reference_variables, self.reference_map)
def get_coordinate(self, coord):
if coord not in self.ds.variables:
|
NCGraph's get_dimension should return the new NCGraph
|
ioos_compliance-checker
|
train
|
py
|
e69c65c61e25336adfe1d76bd92c496909c84d10
|
diff --git a/react_src/actuators.js b/react_src/actuators.js
index <HASH>..<HASH> 100644
--- a/react_src/actuators.js
+++ b/react_src/actuators.js
@@ -59,7 +59,7 @@ var ContinuousActuator = React.createClass({
return(
<div className="continuousActuator">
<form onSubmit={this.handleSubmit} >
- <input type="text" ref="value" />
+ <input type="text" maxlength="3" size="3" ref="value" />
{ !this.state.loading ? <input type="submit" value="Override" /> : <label>Loading...</label> }
</form>
</div>
|
adjust size of text box for continuous input
|
SoftwareDefinedBuildings_XBOS
|
train
|
js
|
96dc46d39e6f5d75456262265a6cf2b8bbb06986
|
diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js
+++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js
@@ -25,10 +25,10 @@ export const styles = (theme) => {
minHeight: 64,
},
'&$focused': {
- backgroundColor: theme.palette.grey[300],
+ backgroundColor: theme.palette.action.focus,
},
'&$disabled': {
- opacity: 0.38,
+ opacity: theme.palette.action.disabledOpacity,
},
},
/* Pseudo-class applied to the root element, children wrapper element and `IconButton` component if `expanded={true}`. */
|
[ExpansionPanel] Increase contrast for focus state (#<I>)
|
mui-org_material-ui
|
train
|
js
|
a1767f286992ef314b4fe942b0847c5092708c20
|
diff --git a/hamster/charting.py b/hamster/charting.py
index <HASH>..<HASH> 100644
--- a/hamster/charting.py
+++ b/hamster/charting.py
@@ -120,8 +120,7 @@ class Integrator(object):
if there is any action needed. returns velocity, which is synonym from
delta. Use it to determine when animation is done (experiment to find
value that fits you!"""
- if self.targeting:
- self.force += self.attraction * (self.target_value - self.current_value)
+ self.force += self.attraction * (self.target_value - self.current_value)
self.accel = self.force / self.mass
self.vel = (self.vel + self.accel) * self.damping
|
woops, one variable too much - it's getting late!
svn path=/trunk/; revision=<I>
|
projecthamster_hamster
|
train
|
py
|
57dff122bfa11c55b6ba49ab9198e4f7f0963831
|
diff --git a/impact_functions/flood/flood_building_impact.py b/impact_functions/flood/flood_building_impact.py
index <HASH>..<HASH> 100644
--- a/impact_functions/flood/flood_building_impact.py
+++ b/impact_functions/flood/flood_building_impact.py
@@ -96,10 +96,19 @@ class FloodBuildingImpactFunction(FunctionProvider):
caption += ('Bangunan perlu ditutup ketika banjir '
'lebih dari %.1f m' % threshold)
+ # Create style
+ style_classes = [dict(label=_('Dibuka'), min=0, max=90,
+ colour='#1EFC7C', opacity=1),
+ dict(label=_('Ditutup'), min=90, max=100,
+ colour='#F31A1C', opacity=1)]
+ style_info = dict(target_field=self.target_field,
+ style_classes=style_classes)
+
# Create vector layer and return
V = Vector(data=building_impact,
projection=E.get_projection(),
geometry=coordinates,
name='Estimated buildings affected',
- keywords={'caption': caption})
+ keywords={'caption': caption},
+ style_info=style_info)
return V
|
Implemented style_info in flood building impact function
|
inasafe_inasafe
|
train
|
py
|
0699379212d8ea8ba5e12525d917da0a259648e8
|
diff --git a/astrobase/periodbase/kbls.py b/astrobase/periodbase/kbls.py
index <HASH>..<HASH> 100644
--- a/astrobase/periodbase/kbls.py
+++ b/astrobase/periodbase/kbls.py
@@ -1422,7 +1422,9 @@ def bls_stats_singleperiod(times, mags, errs, period,
magsarefluxes=magsarefluxes,
sigclip=None)
- if not blsres or 'blsresult' not in blsres:
+ if (not blsres or
+ 'blsresult' not in blsres or
+ blsres['blsresult'] is None):
LOGERROR("BLS failed during a period-search "
"performed around the input best period: %.6f. "
"Can't continue. " % period)
|
kbls: check for missing blsresult keys if BLS fails, #<I>
|
waqasbhatti_astrobase
|
train
|
py
|
5236da73d20b0d9a5b09fed07ce0ee04773c16f2
|
diff --git a/compiler/prelude/goroutines.go b/compiler/prelude/goroutines.go
index <HASH>..<HASH> 100644
--- a/compiler/prelude/goroutines.go
+++ b/compiler/prelude/goroutines.go
@@ -20,15 +20,24 @@ var $callDeferred = function(deferred, jsErr) {
$jumpToDefer = false;
throw jsErr;
}
+ if (jsErr) {
+ var newErr = null;
+ try {
+ $deferFrames.push(deferred);
+ $panic(new $packages["github.com/gopherjs/gopherjs/js"].Error.Ptr(jsErr));
+ } catch (err) {
+ newErr = err;
+ }
+ $deferFrames.pop();
+ $callDeferred(deferred, newErr);
+ return;
+ }
$stackDepthOffset--;
var outerPanicStackDepth = $panicStackDepth;
var outerPanicValue = $panicValue;
var localPanicValue = $curGoroutine.panicStack.pop();
- if (jsErr) {
- localPanicValue = new $packages["github.com/gopherjs/gopherjs/js"].Error.Ptr(jsErr);
- }
if (localPanicValue !== undefined) {
$panicStackDepth = $getStackDepth();
$panicValue = localPanicValue;
|
fixed handling of JS errors (#<I>)
|
gopherjs_gopherjs
|
train
|
go
|
78f92900437b44f8b1b4294872fd1008677cb5b1
|
diff --git a/closure/goog/cssom/cssom.js b/closure/goog/cssom/cssom.js
index <HASH>..<HASH> 100644
--- a/closure/goog/cssom/cssom.js
+++ b/closure/goog/cssom/cssom.js
@@ -352,11 +352,11 @@ goog.cssom.removeCssRule = function(cssStyleSheet, index) {
* @return {!Element} The newly created STYLE element.
*/
goog.cssom.addCssText = function(cssText, opt_domHelper) {
- var document =
- opt_domHelper ? opt_domHelper.getDocument() : goog.dom.getDocument();
- var cssNode = document.createElement(goog.dom.TagName.STYLE);
+ var domHelper = opt_domHelper || goog.dom.getDomHelper();
+ var document = domHelper.getDocument();
+ var cssNode = domHelper.createElement(goog.dom.TagName.STYLE);
cssNode.type = 'text/css';
- var head = goog.dom.getElementsByTagName(goog.dom.TagName.HEAD, document)[0];
+ var head = domHelper.getElementsByTagName(goog.dom.TagName.HEAD)[0];
head.appendChild(cssNode);
if (cssNode.styleSheet) {
// IE.
|
Prepare for goog.dom.TagName type change, take 2.
To improve the type precision of created or accessed elements, the type of goog.dom.TagName members is going to change from string to object instance in cl/<I>. This CL prepares for that and changes all document.createElement(goog.dom.TagName) calls to goog.dom.createElement.
RELNOTES: n/a
-------------
Created by MOE: <URL>
|
google_closure-library
|
train
|
js
|
c55bcf7541cda135cae9b6645c383b6e70594b3b
|
diff --git a/Resources/Public/pz2-client.js b/Resources/Public/pz2-client.js
index <HASH>..<HASH> 100644
--- a/Resources/Public/pz2-client.js
+++ b/Resources/Public/pz2-client.js
@@ -527,16 +527,17 @@ function displayLists (list) {
function dateForRecord (record) {
var dateArray = record['md-date'];
if (dateArray) {
- var dateString = record['md-date'][0];
+ var dateString = dateArray[0];
if (dateString) {
var yearsArray = dateString.split('-');
- var date = new Date(yearsArray[yearsArray.length - 1]);
+ var lastYear = yearsArray[yearsArray.length - 1];
+ var date = new Date(lastYear, 1, 1);
}
}
// Records without a date are treated as very old.
// Except when they are Guide Links which are treated as coming from the future.
- if (date == undefined) {
+ if (!date) {
if (record['location'][0]['@id'].search('ssgfi') != -1) {
date = new Date(2500,1,1);
}
|
pazpar2 JS: better date handling
* Correctly initialise Date object
* Safari and Chrome's JS engines seem to differ in behaviour (returning undefined vs Invalid Date) when dealing with a wrongly initialiased Date
|
subugoe_typo3-pazpar2
|
train
|
js
|
af55038f894cf268868dca038f81b3be50149ed7
|
diff --git a/tests/test_hunter.py b/tests/test_hunter.py
index <HASH>..<HASH> 100644
--- a/tests/test_hunter.py
+++ b/tests/test_hunter.py
@@ -2,6 +2,7 @@ from __future__ import print_function
import inspect
import os
+import platform
import subprocess
import sys
@@ -505,7 +506,7 @@ def test_predicate_when():
def test_proper_backend():
- if os.environ.get('PUREPYTHONHUNTER'):
+ if os.environ.get('PUREPYTHONHUNTER') or platform.python_implementation() == 'PyPy':
assert 'hunter.tracer.Tracer' in repr(hunter.Tracer)
else:
assert 'hunter._tracer.Tracer' in repr(hunter.Tracer)
|
Expect purepython on pypy.
|
ionelmc_python-hunter
|
train
|
py
|
0da1513cbafde8c6ff36dfc125c3b6f7baa0361f
|
diff --git a/registry/cache_test.go b/registry/cache_test.go
index <HASH>..<HASH> 100644
--- a/registry/cache_test.go
+++ b/registry/cache_test.go
@@ -19,19 +19,24 @@ var (
memcachedIPs = flag.String("memcached-ips", "127.0.0.1:11211", "space-separated host:port values for memcached to connect to")
)
+type stoppableMemcacheClient struct {
+ *memcache.Client
+}
+
+func (s *stoppableMemcacheClient) Stop() {}
+
// Setup sets up stuff for testing
-func Setup(t *testing.T) *memcache.Client {
+func Setup(t *testing.T) MemcacheClient {
fmt.Printf("Memcache IPs: %v\n", strings.Fields(*memcachedIPs))
mc := memcache.New(strings.Fields(*memcachedIPs)...)
if err := mc.FlushAll(); err != nil {
t.Fatal(err)
}
- return mc
+ return &stoppableMemcacheClient{mc}
}
// Cleanup cleans up after a test
-func Cleanup(t *testing.T) {
-}
+func Cleanup(t *testing.T) {}
type MockBackend struct {
tags func(repository string) ([]string, error)
|
Update registry/cache_test.go for new interface
|
weaveworks_flux
|
train
|
go
|
44067a9b45a7f169f19db10307cc5bba8ac186cb
|
diff --git a/lib/lis/messages/patient.rb b/lib/lis/messages/patient.rb
index <HASH>..<HASH> 100644
--- a/lib/lis/messages/patient.rb
+++ b/lib/lis/messages/patient.rb
@@ -14,7 +14,7 @@ module LIS::Message
def initialize(sequence_number, patient_id, last_name = "", first_name = "")
self.sequence_number = sequence_number
- self.laboratory_assigned_patient_id = patient_id
+ self.practice_assigned_patient_id = patient_id
self.name = [last_name, first_name].join("^")
end
diff --git a/test/messages/test_patients.rb b/test/messages/test_patients.rb
index <HASH>..<HASH> 100644
--- a/test/messages/test_patients.rb
+++ b/test/messages/test_patients.rb
@@ -4,9 +4,7 @@ class TestPatientMessages < Test::Unit::TestCase
context "order message" do
should "have sane defaults" do
@message = LIS::Message::Patient.new(1, 101, "Riker", "Al")
- assert_equal "P|1||101||Riker^Al||||||||", @message.to_message
+ assert_equal "P|1|101|||Riker^Al||||||||", @message.to_message
end
end
end
-
-
|
use patient_id as "practice_assigned_patient_id" in LIS messages
|
levinalex_lis
|
train
|
rb,rb
|
1f4fd69bf33023c060e0a394dfeac688b9bfa65b
|
diff --git a/src/MetaModels/DcGeneral/Events/Table/MetaModels/Subscriber.php b/src/MetaModels/DcGeneral/Events/Table/MetaModels/Subscriber.php
index <HASH>..<HASH> 100644
--- a/src/MetaModels/DcGeneral/Events/Table/MetaModels/Subscriber.php
+++ b/src/MetaModels/DcGeneral/Events/Table/MetaModels/Subscriber.php
@@ -393,6 +393,14 @@ class Subscriber extends BaseSubscriber
)
)
->execute();
+ $database
+ ->prepare(
+ sprintf(
+ 'DELETE FROM tl_metamodel_dca_sortgroup WHERE pid IN (%s)',
+ implode(',', $idList)
+ )
+ )
+ ->execute();
}
// Delete the input screens.
|
Delete obsolete entries from sort/group table when deleting a MetaModel.
|
MetaModels_core
|
train
|
php
|
ec503132570a251132eaf95b4ce5c6c9c878cf27
|
diff --git a/ucms_group/src/EventDispatcher/GroupContextSubscriber.php b/ucms_group/src/EventDispatcher/GroupContextSubscriber.php
index <HASH>..<HASH> 100644
--- a/ucms_group/src/EventDispatcher/GroupContextSubscriber.php
+++ b/ucms_group/src/EventDispatcher/GroupContextSubscriber.php
@@ -237,6 +237,8 @@ class GroupContextSubscriber implements EventSubscriberInterface
NodeAccess::REALM_GROUP,
NodeAccess::REALM_GROUP_READONLY,
NodeAccess::REALM_READONLY,
+ // Disallow non-group/non-site/non-global nodes to be seen
+ NodeAccess::REALM_OTHER,
] as $realm) {
$event->removeWholeRealm($realm);
}
|
group: group member should not see outside nodes
|
makinacorpus_drupal-ucms
|
train
|
php
|
e2a7c98f57d8dd472a4feca385ee28fa9590b8ce
|
diff --git a/safe/impact_functions/earthquake/itb_earthquake_fatality_model.py b/safe/impact_functions/earthquake/itb_earthquake_fatality_model.py
index <HASH>..<HASH> 100644
--- a/safe/impact_functions/earthquake/itb_earthquake_fatality_model.py
+++ b/safe/impact_functions/earthquake/itb_earthquake_fatality_model.py
@@ -32,7 +32,7 @@ class ITBFatalityFunction(FunctionProvider):
In this study, the same functional form as Allen (2009) is adopted
to express fatality rate as a function of intensity (see Eq. 10 in the
report). The Matlab built-in function (fminsearch) for Nelder-Mead
- algorithm is used to estimate the model parameters. The objective
+ algorithm was used to estimate the model parameters. The objective
function (L2G norm) that is minimised during the optimisation is the
same as the one used by Jaiswal et al. (2010).
@@ -68,6 +68,9 @@ class ITBFatalityFunction(FunctionProvider):
- consistency between selected GMPEs with those in use by BMKG.
These issues will be addressed by ITB team in the final report.
+ Note: Because of these caveats, decisions should not be made solely on
+ the information presented here and should always be verified by ground
+ truthing and other reliable information sources.
:author Hadi Ghasemi
:rating 3
|
Updated caveats for ITB eq fatality model.
|
inasafe_inasafe
|
train
|
py
|
9d38a2044642f5c33284b3e35f275e53d2c475d1
|
diff --git a/salt/defaults/events.py b/salt/defaults/events.py
index <HASH>..<HASH> 100644
--- a/salt/defaults/events.py
+++ b/salt/defaults/events.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
Event constants used by listeners and servers, to be imported elsewhere in Salt code.
|
Drop Py2 and six on salt/defaults/events.py
|
saltstack_salt
|
train
|
py
|
d941cc8c3c282ecefb66120de73a5a0775967ada
|
diff --git a/app/controllers/doorkeeper/application_controller.rb b/app/controllers/doorkeeper/application_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/doorkeeper/application_controller.rb
+++ b/app/controllers/doorkeeper/application_controller.rb
@@ -5,7 +5,7 @@ module Doorkeeper
def parse_client_info_from_basic_auth
auth_header = request.env['HTTP_AUTHORIZATION']
return unless auth_header && auth_header =~ /^Basic (.*)/m
- client_info = ActiveSupport::Base64.decode64($1).split(/:/, 2)
+ client_info = Base64.decode64($1).split(/:/, 2)
client_id = client_info[0]
client_secret = client_info[1]
return if client_id.nil? || client_secret.nil?
diff --git a/spec/support/helpers/url_helper.rb b/spec/support/helpers/url_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/support/helpers/url_helper.rb
+++ b/spec/support/helpers/url_helper.rb
@@ -36,7 +36,7 @@ module UrlHelper
end
def basic_auth_header_for_client(client)
- "Basic #{ActiveSupport::Base64.encode64("#{client.uid}:#{client.secret}")}"
+ "Basic #{Base64.encode64("#{client.uid}:#{client.secret}")}"
end
end
|
ActiveSupport::Base<I> is deprecated. This was causing a test case to fail.
|
doorkeeper-gem_doorkeeper
|
train
|
rb,rb
|
1cfeaed42b0cfaa24fb167d9764f6dcb4bd16e14
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -345,8 +345,9 @@ function DiscordClient(options) {
if (!self.servers[serverID].members) self.servers[serverID].members = {};
members.map(function(user) {
- self.servers[serverID].members[user.user.id] = user;
+ self.servers[serverID].members[user.user.id] = new Member(user);
});
+
break;
}
if (message.t) return emit(message);
|
Switching to new Member prototype
For getting offline members.
|
izy521_discord.io
|
train
|
js
|
3d51b92648a898784209b5088898bab66133a919
|
diff --git a/physical/etcd/etcd3.go b/physical/etcd/etcd3.go
index <HASH>..<HASH> 100644
--- a/physical/etcd/etcd3.go
+++ b/physical/etcd/etcd3.go
@@ -267,6 +267,21 @@ func (c *EtcdLock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error) {
return nil, EtcdLockHeldError
}
+ select {
+ case _, ok := <-c.etcdSession.Done():
+ if !ok {
+ // The session's done channel is closed, so the session is over,
+ // and we need a new one
+ session, err := concurrency.NewSession(c.etcd, concurrency.WithTTL(etcd3LockTimeoutInSeconds))
+ if err != nil {
+ return nil, err
+ }
+ c.etcdSession = session
+ c.etcdMu = concurrency.NewMutex(session, c.prefix)
+ }
+ default:
+ }
+
ctx, cancel := context.WithCancel(context.Background())
go func() {
<-stopCh
|
vault: recover from standby losing etcd lease (#<I>) (#<I>)
This change makes these errors transient instead of permanent:
[ERROR] core: failed to acquire lock: error=etcdserver: requested lease not found
After this change, there can still be one of these errors when a
standby vault that lost its lease tries to become leader, but on the
next lock acquisition attempt a new session will be created. With this
new session, the standby will be able to become the leader.
|
hashicorp_vault
|
train
|
go
|
b2528e2e204fc41e8c2346ccf4ff291d5ad3265f
|
diff --git a/devices/ledvance.js b/devices/ledvance.js
index <HASH>..<HASH> 100644
--- a/devices/ledvance.js
+++ b/devices/ledvance.js
@@ -1,5 +1,6 @@
const ota = require('../lib/ota');
const extend = require('../lib/extend');
+const reporting = require('../lib/reporting');
module.exports = [
{
@@ -9,6 +10,11 @@ module.exports = [
description: 'Smart Zigbee outdoor plug',
extend: extend.switch(),
ota: ota.ledvance,
+ configure: async (device, coordinatorEndpoint, logger) => {
+ const endpoint = device.getEndpoint(1);
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
+ await reporting.onOff(endpoint);
+ },
},
{
zigbeeModel: ['Panel TW Z3'],
|
Fix AC<I>/AC<I> not reporting state when controlled physically. <URL>
|
Koenkk_zigbee-shepherd-converters
|
train
|
js
|
b61a84d145200ba4f827783de21de73039623a3c
|
diff --git a/test/reporting_tests/cli_tests.py b/test/reporting_tests/cli_tests.py
index <HASH>..<HASH> 100644
--- a/test/reporting_tests/cli_tests.py
+++ b/test/reporting_tests/cli_tests.py
@@ -435,7 +435,7 @@ class WhenMakingANameHumanReadable(object):
def because_we_make_the_string_readable(self):
self.reporter = reporting.shared.make_readable(self.input)
- def it_should_return_a_string_with_appropriate_spaces(self, example):
+ def it_should_return_a_string_with_appropriate_spaces(self):
self.reporter.should.equal(self.expected)
|
Update cli_tests.py
|
benjamin-hodgson_Contexts
|
train
|
py
|
969db2a31316141b7db54871f7d42f2a2e3fe581
|
diff --git a/src/classes/wrapper/svn-cli/resource.php b/src/classes/wrapper/svn-cli/resource.php
index <HASH>..<HASH> 100644
--- a/src/classes/wrapper/svn-cli/resource.php
+++ b/src/classes/wrapper/svn-cli/resource.php
@@ -125,7 +125,7 @@ abstract class vcsSvnCliResource extends vcsResource implements vcsVersioned, vc
// Fecth for specified version, if set
if ( $this->currentVersion !== null )
{
- $process->argument( '-r0:' . $this->currentVersion );
+ $process->argument( '-r1:' . $this->currentVersion );
}
// Execute logr command
|
# Fetch version log starting by version 1 instead of 0.
|
Arbitracker_VCSWrapper
|
train
|
php
|
4c1384dae947a7571a65c89bfd91b9b3c5ff51a9
|
diff --git a/src/Clinner/Command/Base.php b/src/Clinner/Command/Base.php
index <HASH>..<HASH> 100644
--- a/src/Clinner/Command/Base.php
+++ b/src/Clinner/Command/Base.php
@@ -141,4 +141,14 @@ abstract class Base implements CommandInterface
{
return $this->_args->getAll();
}
+
+ /**
+ * Get the string representation for this command.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getName();
+ }
}
\ No newline at end of file
diff --git a/src/Clinner/Command/Command.php b/src/Clinner/Command/Command.php
index <HASH>..<HASH> 100644
--- a/src/Clinner/Command/Command.php
+++ b/src/Clinner/Command/Command.php
@@ -3,7 +3,6 @@
namespace Clinner\Command;
use Clinner\Command\Base;
-use Clinner\ValueHolder;
/**
|
Cleaned up Commands a little bit.
|
ncuesta_Clinner
|
train
|
php,php
|
27fd4a66c713c32f12196957a6849e11babcb43c
|
diff --git a/dpxdt/tools/run_server.py b/dpxdt/tools/run_server.py
index <HASH>..<HASH> 100755
--- a/dpxdt/tools/run_server.py
+++ b/dpxdt/tools/run_server.py
@@ -107,7 +107,8 @@ def main(block=True):
server.app.run(
debug=FLAGS.reload_code,
host=FLAGS.host,
- port=FLAGS.port)
+ port=FLAGS.port,
+ threaded=server.utils.is_production())
elif FLAGS.enable_queue_workers:
coordinator.join()
else:
|
Run multithreaded server when in production
|
bslatkin_dpxdt
|
train
|
py
|
4fe4dbaf3390c56a91cc7cd4401654f1931d4b32
|
diff --git a/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/ImplicitUiFragment.java b/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/ImplicitUiFragment.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/ImplicitUiFragment.java
+++ b/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/ImplicitUiFragment.java
@@ -81,6 +81,9 @@ public class ImplicitUiFragment extends AbstractGeneratorFragment {
.addTypeToType("org.eclipse.xtext.ui.core.builder.ILanguageBuilder",
"org.eclipse.xtext.ui.core.builder.impl.SimpleProjectLanguageBuilder")
+ // editor notification
+ .addTypeToType("org.eclipse.xtext.ui.core.editor.model.XtextDocumentProvider",
+ "org.eclipse.xtext.ui.core.editor.model.ResourceAwareXtextDocumentProvider")
.getBindings();
}
|
Restored functionality that will notify a document about changes in a referenced resource
|
eclipse_xtext-extras
|
train
|
java
|
51539e1d88d5910570c7c783db6869a9f6da0959
|
diff --git a/vision/google/cloud/vision/image.py b/vision/google/cloud/vision/image.py
index <HASH>..<HASH> 100644
--- a/vision/google/cloud/vision/image.py
+++ b/vision/google/cloud/vision/image.py
@@ -217,13 +217,12 @@ class Image(object):
def _entity_from_response_type(feature_type, results):
"""Convert a JSON result to an entity type based on the feature."""
-
- detected_objects = []
feature_key = _REVERSE_TYPES[feature_type]
annotations = results.get(feature_key, ())
if not annotations:
return []
+ detected_objects = []
if feature_type == _FACE_DETECTION:
detected_objects.extend(
Face.from_api_repr(face) for face in annotations)
|
Move detected_objects below early return.
|
googleapis_google-cloud-python
|
train
|
py
|
9c054da15f32b1c9dc61be64a7d93c6724eef6eb
|
diff --git a/examples/sql/sparksql.js b/examples/sql/sparksql.js
index <HASH>..<HASH> 100644
--- a/examples/sql/sparksql.js
+++ b/examples/sql/sparksql.js
@@ -44,9 +44,9 @@ fields.push(DataTypes.createStructField("age", DataTypes.IntegerType, true));
var schema = DataTypes.createStructType(fields);
// Convert records of the RDD (people) to Rows.
-var rowRDD = people.map(function(person){
+var rowRDD = people.map(function(person, RowFactory){
return RowFactory.create([person.name, person.age]);
-});
+}, [RowFactory]);
//Apply the schema to the RDD.
|
Updated example to pass RowFactory as bound arg to lambda
|
EclairJS_eclairjs
|
train
|
js
|
882f7c4d37e34c7f8a755e6e51ba1f49dcbdb8c8
|
diff --git a/resttest.py b/resttest.py
index <HASH>..<HASH> 100644
--- a/resttest.py
+++ b/resttest.py
@@ -552,7 +552,8 @@ def configure_curl(mytest, test_config = TestConfig()):
curl.setopt(pycurl.POSTFIELDSIZE, len(mytest.body)) # Required for some servers
elif mytest.method == u'PUT':
curl.setopt(HTTP_METHODS[u'PUT'], 1)
- curl.setopt(pycurl.INFILESIZE, len(mytest.body)) # Required for some servers
+ if mytest.body is not None:
+ curl.setopt(pycurl.INFILESIZE, len(mytest.body)) # Required for some servers
elif mytest.method == u'DELETE':
curl.setopt(curl.CUSTOMREQUEST,'DELETE')
|
Fixed PUT to only set body if a body is available
|
svanoort_pyresttest
|
train
|
py
|
0af7967eddb5f5871954b51e50f48a468c044dd3
|
diff --git a/spec/integration/pg_search_spec.rb b/spec/integration/pg_search_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/pg_search_spec.rb
+++ b/spec/integration/pg_search_spec.rb
@@ -16,7 +16,7 @@ describe "an Active Record model which includes PgSearch" do
describe ".pg_search_scope" do
it "builds a chainable scope" do
ModelWithPgSearch.pg_search_scope "matching_query", :against => []
- scope = ModelWithPgSearch.scoped({}).matching_query("foo").scoped({})
+ scope = ModelWithPgSearch.where("1 = 1").matching_query("foo").where("1 = 1")
scope.should be_an ActiveRecord::Relation
end
@@ -660,7 +660,7 @@ describe "an Active Record model which includes PgSearch" do
it "should refer to the tsvector column in the query unambiguously" do
expect {
- ModelWithTsvector.joins(:another_models).search_by_content_with_tsvector("test").all
+ ModelWithTsvector.joins(:another_models).search_by_content_with_tsvector("test").to_a
}.not_to raise_exception
end
end
|
Address Rails 4 deprecations in pg_search_spec.rb
|
Casecommons_pg_search
|
train
|
rb
|
2b76a5882a6b1886d01eae28810d3b698dd36b19
|
diff --git a/scripts/tools/CsvReconfigure.php b/scripts/tools/CsvReconfigure.php
index <HASH>..<HASH> 100644
--- a/scripts/tools/CsvReconfigure.php
+++ b/scripts/tools/CsvReconfigure.php
@@ -44,7 +44,7 @@ use oat\oatbox\action\Action;
* Parameter 8: (optional) The input CSV escape character (default is "\").
*
*/
-class RemoveCsvRowsByPattern implements Action
+class CsvReconfigure implements Action
{
public function __invoke($params)
{
@@ -96,7 +96,7 @@ class RemoveCsvRowsByPattern implements Action
while ($sourceData = fgetcsv($sourceFp, 0, $inputDelimiter, $inputEnclosure, $inputEscapeChar)) {
- fputcsv($destinationFp, $outputDelimiter, $outputEnclosure, $outputEscapeChar);
+ fputcsv($destinationFp, $sourceData, $outputDelimiter, $outputEnclosure, $outputEscapeChar);
$rowCount++;
}
|
fputcsv issue.
|
oat-sa_tao-core
|
train
|
php
|
757e1f163b3bf8308b20bc99181eea562ceb5133
|
diff --git a/goassets/goassets/template.go b/goassets/goassets/template.go
index <HASH>..<HASH> 100644
--- a/goassets/goassets/template.go
+++ b/goassets/goassets/template.go
@@ -153,7 +153,7 @@ func (a *assetFile) Read(p []byte) (n int, e error) {
}
func init() {
- builtAt, _ = time.Parse(time.RFC3339Nano, "{{ .BuiltAt }}")
+ builtAt = time.Now()
env_name := fmt.Sprintf("GOASSETS_PATH")
path := os.Getenv(env_name)
if path != "" {
|
use time.Now() for builtTime
|
dynport_dgtk
|
train
|
go
|
c70ceccceb9a6ceabffc38771bbe2f68bb106cf6
|
diff --git a/go/chat/utils/utils.go b/go/chat/utils/utils.go
index <HASH>..<HASH> 100644
--- a/go/chat/utils/utils.go
+++ b/go/chat/utils/utils.go
@@ -240,3 +240,12 @@ func VisibleChatConversationStatuses() []chat1.ConversationStatus {
chat1.ConversationStatus_FAVORITE,
}
}
+
+func IsVisibleChatConversationStatus(status chat1.ConversationStatus) bool {
+ for _, s := range VisibleChatConversationStatuses() {
+ if status == s {
+ return true
+ }
+ }
+ return false
+}
|
add back the accidentally deleted IsVisibleChatConversationStatus function
|
keybase_client
|
train
|
go
|
ff09867c8601ebfae930225b20c3380606923c79
|
diff --git a/examples/imagick.php b/examples/imagick.php
index <HASH>..<HASH> 100644
--- a/examples/imagick.php
+++ b/examples/imagick.php
@@ -21,7 +21,6 @@ $options = new QROptions([
'outputType' => QRCode::OUTPUT_IMAGICK,
'eccLevel' => QRCode::ECC_L,
'scale' => 5,
- 'imageBase64' => false,
'moduleValues' => [
// finder
1536 => '#A71111', // dark (true)
|
:octocat: the imagick module doesn't support base<I> output
|
chillerlan_php-qrcode
|
train
|
php
|
f970f3e1fc812413dc52e2dee325fcda28958612
|
diff --git a/themes/webtrees/theme.php b/themes/webtrees/theme.php
index <HASH>..<HASH> 100644
--- a/themes/webtrees/theme.php
+++ b/themes/webtrees/theme.php
@@ -148,7 +148,7 @@ $WT_IMAGES=array(
'rarrow'=>WT_THEME_DIR.'images/rarrow.gif',
'rarrow2'=>WT_THEME_DIR.'images/rarrow2.gif',
'rdarrow'=>WT_THEME_DIR.'images/rdarrow.gif',
- 'remove'=>WT_THEME_DIR.'images/remove.gif',
+ 'remove'=>WT_THEME_DIR.'images/delete.png',
'spacer'=>WT_THEME_DIR.'images/spacer.gif',
'uarrow'=>WT_THEME_DIR.'images/uarrow.gif',
'uarrow2'=>WT_THEME_DIR.'images/uarrow2.gif',
|
Change the image used for "remove". I will talk to Rob about finding something usable for the other themes.
|
fisharebest_webtrees
|
train
|
php
|
12f9f58c8b389b65415dc6c274b94fb9a5c9a354
|
diff --git a/spec/session/selenium_session_spec.rb b/spec/session/selenium_session_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/session/selenium_session_spec.rb
+++ b/spec/session/selenium_session_spec.rb
@@ -18,8 +18,8 @@ describe Capybara::Session do
end
end
- # it_should_behave_like "session"
+ it_should_behave_like "session"
it_should_behave_like "session with javascript support"
- # it_should_behave_like "session without headers support"
+ it_should_behave_like "session without headers support"
end
end
|
Put the accidently commented out specs back in.
Thanks alovak!
|
teamcapybara_capybara
|
train
|
rb
|
29743e1d63353008d53276cce6db962c636d6c39
|
diff --git a/src/Chart.Core.js b/src/Chart.Core.js
index <HASH>..<HASH> 100755
--- a/src/Chart.Core.js
+++ b/src/Chart.Core.js
@@ -329,6 +329,13 @@
return x > 0 ? 1 : -1;
}
},
+ log10 = helpers.log10 = function(x) {
+ if (Math.log10) {
+ return Math.log10(x)
+ } else {
+ return Math.log(x) / Math.LN10;
+ }
+ },
cap = helpers.cap = function(valueToCap, maxValue, minValue) {
if (isNumber(maxValue)) {
if (valueToCap > maxValue) {
@@ -484,7 +491,7 @@
},
// Implementation of the nice number algorithm used in determining where axis labels will go
niceNum = helpers.niceNum = function(range, round) {
- var exponent = Math.floor(Math.log10(range));
+ var exponent = Math.floor(helpers.log10(range));
var fraction = range / Math.pow(10, exponent);
var niceFraction;
|
Use a polyfill when Math.log<I> does not exist
|
chartjs_Chart.js
|
train
|
js
|
e03f711a1fc07d30ce6b9400af8162ebf6e532b7
|
diff --git a/openquake/risklib/scientific.py b/openquake/risklib/scientific.py
index <HASH>..<HASH> 100644
--- a/openquake/risklib/scientific.py
+++ b/openquake/risklib/scientific.py
@@ -128,7 +128,9 @@ class VulnerabilityFunction(object):
"corresponding coeff. of variation > 0.0")
raise ValueError(msg)
if distribution == 'BT':
- if lr > 1:
+ if lr == 0: # possible with cov == 0
+ pass
+ elif lr > 1:
raise ValueError('The meanLRs must be <= 1, got %s' % lr)
elif cov ** 2 > 1 / lr - 1:
# see https://github.com/gem/oq-engine/issues/4841
|
Small check on loss ratios in VulnerabilityFunction
|
gem_oq-engine
|
train
|
py
|
dca3d90b5477a304fa130f5cc90ea59e3968ce6f
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,11 @@
-from ez_setup import use_setuptools
-use_setuptools()
+try:
+ # Try using ez_setup to install setuptools if not already installed.
+ from ez_setup import use_setuptools
+ use_setuptools()
+except ImportError:
+ # Ignore import error and assume Python 3 which already has setuptools.
+ pass
+
from setuptools import setup, find_packages
classifiers = ['Development Status :: 4 - Beta',
@@ -12,7 +18,7 @@ classifiers = ['Development Status :: 4 - Beta',
'Topic :: System :: Hardware']
setup(name = 'Adafruit_ADXL345',
- version = '1.0.0',
+ version = '1.0.1',
author = 'Tony DiCola',
author_email = '[email protected]',
description = 'Python code to use the ADXL345 triple-axis accelerometer over I2C with a Raspberry Pi or BeagleBone Black.',
|
Fix python 3 pip install issue with ez_setup relative import.
|
adafruit_Adafruit_Python_ADXL345
|
train
|
py
|
b0761c98ab3165b0a3f10b2418454f2b2b633d21
|
diff --git a/lib/RandomLib/Generator.php b/lib/RandomLib/Generator.php
index <HASH>..<HASH> 100755
--- a/lib/RandomLib/Generator.php
+++ b/lib/RandomLib/Generator.php
@@ -117,7 +117,7 @@ class Generator {
*/
$mask = 0x7fffffffffffffff;
} else {
- $mask = (int) ((1 << $bits) - 1);
+ $mask = (int) (pow(2, $bits) - 1);
}
/**
|
Fix generation issue with <I> bit clients and large numbers/strings
|
ircmaxell_RandomLib
|
train
|
php
|
fa0d8e90aff5065f0283088d0b507a0155c3a337
|
diff --git a/src/lory.js b/src/lory.js
index <HASH>..<HASH> 100644
--- a/src/lory.js
+++ b/src/lory.js
@@ -272,6 +272,11 @@ var lory = function (slider, opts) {
options = mergeOptions(opts, defaults);
+ frame = slider.getElementsByClassName(options.classNameFrame)[0];
+ slideContainer = frame.getElementsByClassName(options.classNameSlideContainer)[0];
+ prevCtrl = slider.getElementsByClassName(options.classNamePrevCtrl)[0];
+ nextCtrl = slider.getElementsByClassName(options.classNameNextCtrl)[0];
+
position = {
x: slideContainer.offsetLeft,
y: slideContainer.offsetTop
|
Added declaration of DOM elements in setup function.
Changed from querySelector() to getElementsByClassName() for improved speed.
|
loryjs_lory
|
train
|
js
|
ce5f313704ee7287e9569d892eab956bbbdf9353
|
diff --git a/docs/source/index.blade.php b/docs/source/index.blade.php
index <HASH>..<HASH> 100644
--- a/docs/source/index.blade.php
+++ b/docs/source/index.blade.php
@@ -7,6 +7,11 @@
<meta name="twitter:description" content="A utility-first CSS framework for rapidly building custom user interfaces.">
<meta name="twitter:image" content="https://tailwindcss.com/img/launch-card-optimized.png">
<meta name="twitter:creator" content="@tailwindcss">
+<meta property="og:url" content="https://tailwindcss.com/" />
+<meta property="og:type" content="article" />
+<meta property="og:title" content="Tailwind CSS" />
+<meta property="og:description" content="A utility-first CSS framework for rapidly building custom user interfaces." />
+<meta property="og:image" content="https://tailwindcss.com/img/twitter-card.png" />
@endsection
@section('body')
|
Add Facebook Metag Tags to homepage as well
|
tailwindcss_tailwindcss
|
train
|
php
|
d12340050b91ad4574fe906b8ac90fb8f9e52c92
|
diff --git a/lib/http.js b/lib/http.js
index <HASH>..<HASH> 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -677,7 +677,7 @@ Agent.prototype.request = function request(options, callback) {
options.port = options.port || 443;
options.path = options.path || '/';
- if (options.protocol === 'http:') {
+ if (!options.plain && options.protocol === 'http:') {
this._log.error('Trying to negotiate client request with Upgrade from HTTP/1.1');
throw new Error('HTTP1.1 -> HTTP2 upgrade is not yet supported.');
}
|
HTTP: do not care about URL scheme when connection over plain TCP.
|
molnarg_node-http2-protocol
|
train
|
js
|
b6a31bf804eec8486ee154c2dc251f32e2622cb8
|
diff --git a/src/Wrapper/FixerWrapper/DocBlockWrapper.php b/src/Wrapper/FixerWrapper/DocBlockWrapper.php
index <HASH>..<HASH> 100644
--- a/src/Wrapper/FixerWrapper/DocBlockWrapper.php
+++ b/src/Wrapper/FixerWrapper/DocBlockWrapper.php
@@ -11,6 +11,7 @@ use phpDocumentor\Reflection\DocBlock as PhpDocumentorDocBlock;
use phpDocumentor\Reflection\DocBlock\Serializer;
use phpDocumentor\Reflection\DocBlock\Tags\Param;
use phpDocumentor\Reflection\DocBlock\Tags\Return_;
+use phpDocumentor\Reflection\FqsenResolver;
use phpDocumentor\Reflection\Types\Array_;
use phpDocumentor\Reflection\Types\Compound;
use Symplify\BetterReflectionDocBlock\CleanDocBlockFactory;
@@ -59,7 +60,7 @@ final class DocBlockWrapper
$this->tokens = $tokens;
$this->position = $position;
- $this->phpDocumentorDocBlock = (new CleanDocBlockFactory())->create($content);
+ $this->phpDocumentorDocBlock = (new CleanDocBlockFactory(new FqsenResolver()))->create($content);
$this->originalContent = $content;
}
|
move FqsenResolver to deps
|
Symplify_TokenRunner
|
train
|
php
|
1eeb36cba853fe752f739a0d93f3bbf93e3f8598
|
diff --git a/src/components/ExecuteButton.js b/src/components/ExecuteButton.js
index <HASH>..<HASH> 100644
--- a/src/components/ExecuteButton.js
+++ b/src/components/ExecuteButton.js
@@ -71,7 +71,7 @@ export class ExecuteButton extends React.Component {
const pathJSX = this.props.isRunning ?
<path d="M 10 10 L 23 10 L 23 23 L 10 23 z" /> :
- <path d="M 11 9 L 24 16 L 11 23 z" />;
+ <path d="M 11 9 L 24 16 L 11 23 z" />;
return (
<div className="execute-button-wrap">
|
Fix lint errror in ExecuteButton.js
Travis is currently complaining about this ([example build](<URL>)).
|
graphql_graphiql
|
train
|
js
|
57a6626929f0e47b2de5fd58040d413ee34dc676
|
diff --git a/examples/text-classification/run_glue.py b/examples/text-classification/run_glue.py
index <HASH>..<HASH> 100644
--- a/examples/text-classification/run_glue.py
+++ b/examples/text-classification/run_glue.py
@@ -289,7 +289,7 @@ def main():
f"model labels: {list(sorted(label_name_to_id.keys()))}, dataset labels: {list(sorted(label_list))}."
"\nIgnoring the model labels as a result.",
)
- elif data_args.task_name is None:
+ elif data_args.task_name is None and not is_regression:
label_to_id = {v: i for i, v in enumerate(label_list)}
def preprocess_function(examples):
|
[examples/text-classification] Fix a bug for using one's own dataset of a regression task (#<I>)
|
huggingface_pytorch-pretrained-BERT
|
train
|
py
|
616c2f7d0220f58dcd89265728ffc3598ff850c8
|
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index <HASH>..<HASH> 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -297,6 +297,8 @@ Ohai.plugin(:Platform) do
"xenserver"
when "cumulus-linux"
"cumulus"
+ when "nexus"
+ "nexus_centos"
else
id
end
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -109,6 +109,10 @@ describe Ohai::System, "Linux plugin platform" do
expect(plugin.platform_id_remap("cumulus-linux")).to eq("cumulus")
end
+ it "returns nexus_centos for nexus os-release id" do
+ expect(plugin.platform_id_remap("nexus")).to eq("nexus_centos")
+ end
+
it "does not transformation for any other platform" do
expect(plugin.platform_id_remap("ubuntu")).to eq("ubuntu")
end
|
Remap nexus -> nexus_centos to match our previous name
This is wrong, but it's what we've been doing for a while
|
chef_ohai
|
train
|
rb,rb
|
99179785260473680370a13acb011f4354989ba4
|
diff --git a/org/postgresql/Connection.java b/org/postgresql/Connection.java
index <HASH>..<HASH> 100644
--- a/org/postgresql/Connection.java
+++ b/org/postgresql/Connection.java
@@ -262,6 +262,14 @@ public abstract class Connection
// otherwise it's hardcoded to 'SQL_ASCII'.
// If the backend doesn't know about multibyte we can't assume anything about the encoding
// used, so we denote this with 'UNKNOWN'.
+ //Note: begining with 7.2 we should be using pg_client_encoding() which
+ //is new in 7.2. However it isn't easy to conditionally call this new
+ //function, since we don't yet have the information as to what server
+ //version we are talking to. Thus we will continue to call
+ //getdatabaseencoding() until we drop support for 7.1 and older versions
+ //or until someone comes up with a conditional way to run one or
+ //the other function depending on server version that doesn't require
+ //two round trips to the server per connection
final String encodingQuery =
"case when pg_encoding_to_char(1) = 'SQL_ASCII' then 'UNKNOWN' else getdatabaseencoding() end";
|
Added some additional comments in the code
|
pgjdbc_pgjdbc
|
train
|
java
|
b9a96d0a9e6ccbfb135280ab8291d1f70852cae5
|
diff --git a/xchart/src/main/java/org/knowm/xchart/BitmapEncoder.java b/xchart/src/main/java/org/knowm/xchart/BitmapEncoder.java
index <HASH>..<HASH> 100644
--- a/xchart/src/main/java/org/knowm/xchart/BitmapEncoder.java
+++ b/xchart/src/main/java/org/knowm/xchart/BitmapEncoder.java
@@ -65,7 +65,7 @@ public final class BitmapEncoder {
public static <T extends Chart<?, ?>> void saveBitmap(
T chart, String fileName, BitmapFormat bitmapFormat) throws IOException {
- try (OutputStream out = new FileOutputStream(addFileExtension(fileName, bitmapFormat)); ) {
+ try (OutputStream out = new FileOutputStream(addFileExtension(fileName, bitmapFormat))) {
saveBitmap(chart, out, bitmapFormat);
}
}
@@ -265,7 +265,7 @@ public final class BitmapEncoder {
byte[] imageInBytes;
- try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ) {
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
ImageIO.write(bufferedImage, bitmapFormat.toString().toLowerCase(), baos);
baos.flush();
imageInBytes = baos.toByteArray();
|
Minor, removing extra semicolon
|
knowm_XChart
|
train
|
java
|
678c1909b626b7acfe636bfac478ee0d4e5953b1
|
diff --git a/provider/azure/config.go b/provider/azure/config.go
index <HASH>..<HASH> 100644
--- a/provider/azure/config.go
+++ b/provider/azure/config.go
@@ -148,7 +148,7 @@ const boilerplateYAML = `azure:
# images, or any other stream available on simplestreams. Leave blank for
# released images.
# image-stream: ""
- default-series: precise
+ # default-series: precise
`
func (prov azureEnvironProvider) BoilerplateConfig() string {
|
provider/azure: default-series in a comment
Put the default-series in a comment, like
all the other defaults.
|
juju_juju
|
train
|
go
|
e9f12516afa22ce7b29e559307b6dae1e6e558ca
|
diff --git a/Exception/ApiException.php b/Exception/ApiException.php
index <HASH>..<HASH> 100644
--- a/Exception/ApiException.php
+++ b/Exception/ApiException.php
@@ -35,6 +35,15 @@ class ApiException extends \RuntimeException
const INVALID_FINANCE_NUMBER = 351;
/**
+ * Логин используется на Яндексе другим пользователем.
+ */
+ const LOGIN_DUPLICATE = 252;
+ /**
+ * Указанный логин занят.
+ */
+ const LOGIN_CREATING_ERROR = 253;
+
+ /**
* Внутренняя ошибка сервера
*/
const INTERNAL_ERROR = 500;
|
Added constants for error codes, <I> and <I>
|
biplane_yandex-direct
|
train
|
php
|
c453f7c48b7af57b6de5477aed76e26320f4504e
|
diff --git a/lib/svtplay_dl/utils/__init__.py b/lib/svtplay_dl/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/utils/__init__.py
+++ b/lib/svtplay_dl/utils/__init__.py
@@ -138,6 +138,8 @@ def filenamify(title):
# Drop any non ascii letters/digits
title = re.sub(r'[^a-zA-Z0-9 -.]', '', title)
+ # Remove " and '
+ title = re.sub('[\"\']', '', title)
# Drop any leading/trailing whitespace that may have appeared
title = title.strip()
# Lowercase
|
filenamify: remove “ and ‘
fix #<I>
|
spaam_svtplay-dl
|
train
|
py
|
c10a88280d1a22f96867098f3130d8a5d70686f8
|
diff --git a/gexec/build.go b/gexec/build.go
index <HASH>..<HASH> 100644
--- a/gexec/build.go
+++ b/gexec/build.go
@@ -6,7 +6,9 @@ import (
"io/ioutil"
"os"
"os/exec"
+ "path"
"path/filepath"
+ "runtime"
)
var tmpDir string
@@ -34,7 +36,10 @@ func BuildIn(gopath string, packagePath string, args ...string) (compiledPath st
return "", errors.New("$GOPATH not provided when building " + packagePath)
}
- executable := filepath.Join(tmpDir, filepath.Base(packagePath))
+ executable := filepath.Join(tmpDir, path.Base(packagePath))
+ if runtime.GOOS == "windows" {
+ executable = executable + ".exe"
+ }
cmdArgs := append([]string{"build"}, args...)
cmdArgs = append(cmdArgs, "-o", executable, packagePath)
|
Make gexec.Build work on windows
- Determine executable path from import path using
path.Base, not filepath.Base
- Append .exe to executable name on windows
|
onsi_gomega
|
train
|
go
|
771b40c6960233e5fff6608f5646bec4405cb899
|
diff --git a/renku/core/models/provenance/activities.py b/renku/core/models/provenance/activities.py
index <HASH>..<HASH> 100644
--- a/renku/core/models/provenance/activities.py
+++ b/renku/core/models/provenance/activities.py
@@ -278,6 +278,7 @@ class Activity(CommitMixin):
def __attrs_post_init__(self):
"""Sets ``generated`` default value if it's not set already."""
+ super().__attrs_post_init__()
if not self.generated:
self.generated = self.default_generated()
|
fix: initialize Activity with Commit post-init
closes #<I>
|
SwissDataScienceCenter_renku-python
|
train
|
py
|
40dd80155df34d636b158d9eaa06e8a6c1bc49e6
|
diff --git a/lib/heroku/command/ps.rb b/lib/heroku/command/ps.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/command/ps.rb
+++ b/lib/heroku/command/ps.rb
@@ -321,12 +321,12 @@ class Heroku::Command::Ps < Heroku::Command::Base
def display_dyno_type_and_costs(formation)
annotated = formation.sort_by{|d| d['type']}.map do |dyno|
- cost = COSTS[dyno["size"]] * dyno["quantity"]
+ cost = COSTS[dyno["size"]]
{
'dyno' => dyno['type'],
'type' => dyno['size'].rjust(4),
'qty' => dyno['quantity'].to_s.rjust(3),
- 'cost/mo' => cost.to_s.rjust(7)
+ 'cost/mo' => cost ? (cost * dyno["quantity"]).to_s.rjust(7) : ''
}
end
|
fix ps scaling pricing display for unknown types
|
heroku_legacy-cli
|
train
|
rb
|
95bb380e163cf83644b3dd2f8dbad4e05fbc0838
|
diff --git a/pychatjs/server/connections.py b/pychatjs/server/connections.py
index <HASH>..<HASH> 100644
--- a/pychatjs/server/connections.py
+++ b/pychatjs/server/connections.py
@@ -1,7 +1,6 @@
import logging
from pychatjs.server.room import Room
-rooms = [Room('Darkness')]
class ChatConnection(object):
diff --git a/pychatjs/server/parser.py b/pychatjs/server/parser.py
index <HASH>..<HASH> 100644
--- a/pychatjs/server/parser.py
+++ b/pychatjs/server/parser.py
@@ -1,7 +1,7 @@
import logging
from pychatjs.server.protocol import *
-
+from pychatjs.server.server import rooms
class Parser(object):
diff --git a/pychatjs/server/server.py b/pychatjs/server/server.py
index <HASH>..<HASH> 100644
--- a/pychatjs/server/server.py
+++ b/pychatjs/server/server.py
@@ -13,6 +13,7 @@ import logging
from pychatjs.server.connections import ChatConnection
from pychatjs.server.parser import Parser
+rooms = [Room('Darkness')]
usernames = ['Shauna', 'Tomuel', 'Darkok']
|
fixing rooms to allow multiple new-rooms
|
eeue56_PyChat.js
|
train
|
py,py,py
|
6bb0ca28a77c2c3d371e00ce1931f1f0e02ff01d
|
diff --git a/p2p/protocol/internal/circuitv1-deprecated/relay.go b/p2p/protocol/internal/circuitv1-deprecated/relay.go
index <HASH>..<HASH> 100644
--- a/p2p/protocol/internal/circuitv1-deprecated/relay.go
+++ b/p2p/protocol/internal/circuitv1-deprecated/relay.go
@@ -16,8 +16,10 @@ import (
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-libp2p-core/transport"
- logging "github.com/ipfs/go-log"
pool "github.com/libp2p/go-buffer-pool"
+
+ logging "github.com/ipfs/go-log/v2"
+
ma "github.com/multiformats/go-multiaddr"
)
|
chore: update go-log to v2 (#<I>)
|
libp2p_go-libp2p
|
train
|
go
|
63f5925d60163d8975b840c5e66de5b7a2096b4a
|
diff --git a/lib/uaa/util.rb b/lib/uaa/util.rb
index <HASH>..<HASH> 100644
--- a/lib/uaa/util.rb
+++ b/lib/uaa/util.rb
@@ -224,7 +224,7 @@ class Util
if sink || !@default_logger
@default_logger = Logger.new(sink || $stdout)
level = :info unless level
- @default_logger.formatter = Proc.new { |severity, time, pname, msg| puts msg }
+ @default_logger.formatter = Proc.new { |severity, time, pname, msg| msg }
end
@default_logger.level = Logger::Severity.const_get(level.to_s.upcase) if level
@default_logger
|
Don't puts inside the logger formatter [#<I>]
The puts inside the logger formatter made it so that the logger output was spit out to STDOUT, even if you set the logging device to something else (like STDERR).
|
cloudfoundry_cf-uaa-lib
|
train
|
rb
|
e9c607753f35d933f4908e3f0a61577c525a97f5
|
diff --git a/lib/active_scaffold/data_structures/column.rb b/lib/active_scaffold/data_structures/column.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/data_structures/column.rb
+++ b/lib/active_scaffold/data_structures/column.rb
@@ -251,7 +251,7 @@ module ActiveScaffold::DataStructures
# default all the configurable variables
self.css_class = ''
- self.required = false
+ self.required = active_record_class.validators_on(self.name).map(&:class).include? ActiveModel::Validations::PresenceValidator
self.sort = true
self.search_sql = true
|
set required flag for column if presence_validator is set in model
|
activescaffold_active_scaffold
|
train
|
rb
|
de7b76592205f444f32625cc160e33ffa1f3d94c
|
diff --git a/satpy/resample.py b/satpy/resample.py
index <HASH>..<HASH> 100644
--- a/satpy/resample.py
+++ b/satpy/resample.py
@@ -856,7 +856,7 @@ class BilinearResampler(BaseResampler):
filename = self._create_cache_filename(cache_dir,
prefix='bil_lut-',
**kwargs)
- self.resampler.load_bil_info(filename)
+ self.resampler.load_resampling_info(filename)
else:
raise IOError
@@ -870,7 +870,7 @@ class BilinearResampler(BaseResampler):
if os.path.exists(filename):
_move_existing_caches(cache_dir, filename)
LOG.info('Saving BIL neighbour info to %s', filename)
- self.resampler.save_bil_info(filename)
+ self.resampler.save_resampling_info(filename)
def compute(self, data, fill_value=None, **kwargs):
"""Resample the given data using bilinear interpolation."""
|
Rename resampler cache loading and saving methods
|
pytroll_satpy
|
train
|
py
|
1b1d6f688345923c21fd5b08d4892ee0d09434d9
|
diff --git a/player_windows.go b/player_windows.go
index <HASH>..<HASH> 100644
--- a/player_windows.go
+++ b/player_windows.go
@@ -91,7 +91,7 @@ func newPlayer(sampleRate, channelNum, bytesPerSample, bufferSizeInBytes int) (*
return nil, fmt.Errorf("oto: waveOutOpen error: %d", err)
}
maxBufferSize := max(bufferSizeInBytes, bufferSize)
- numHeader := maxBufferSize / bufferSize
+ numHeader := max(maxBufferSize / bufferSize, 8)
p := &player{
out: w,
buffer: []byte{},
|
Header num should be at least 8 to keep compatibility
|
hajimehoshi_oto
|
train
|
go
|
6d6709b0df05cccfd44bd68cea9fb30c4b6bd41f
|
diff --git a/asymmetric_jwt_auth/models.py b/asymmetric_jwt_auth/models.py
index <HASH>..<HASH> 100644
--- a/asymmetric_jwt_auth/models.py
+++ b/asymmetric_jwt_auth/models.py
@@ -1,11 +1,21 @@
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
+from django.core.exceptions import ValidationError
+from cryptography.hazmat.primitives.serialization import load_ssh_public_key
+from cryptography.hazmat.backends import default_backend
+
+
+def validate_public_key(value):
+ try:
+ load_ssh_public_key(value.encode('utf-8'), default_backend())
+ except Exception as e:
+ raise ValidationError('Public key is invalid: %s' % e)
class PublicKey(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='public_keys')
- key = models.TextField(help_text="The user's RSA public key")
+ key = models.TextField(help_text="The user's RSA public key", validators=[validate_public_key])
comment = models.CharField(max_length=100, help_text="Comment describing this key", blank=True)
def save(self, *args, **kwargs):
|
Validate a public key before saving it
|
crgwbr_asymmetric-jwt-auth
|
train
|
py
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.