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
|
|---|---|---|---|---|---|
bf97b9d36204f3566b3ad0ff833e400e13470e79
|
diff --git a/test/Redmine/Tests/Api/IssueTest.php b/test/Redmine/Tests/Api/IssueTest.php
index <HASH>..<HASH> 100644
--- a/test/Redmine/Tests/Api/IssueTest.php
+++ b/test/Redmine/Tests/Api/IssueTest.php
@@ -150,6 +150,39 @@ class IssueTest extends \PHPUnit_Framework_TestCase
}
/**
+ * Test show().
+ *
+ * @covers ::show
+ * @test
+ */
+ public function testShowImplodesIncludeParametersCorrectly()
+ {
+ // Test values
+ $parameters = array('include' => array('parameter1', 'parameter2'));
+ $getResponse = array('API Response');
+
+ // Create the used mock objects
+ $client = $this->getMockBuilder('Redmine\Client')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $client->expects($this->once())
+ ->method('get')
+ ->with(
+ $this->logicalAnd(
+ $this->stringStartsWith('/issues/5.json'),
+ $this->stringContains(urlencode('parameter1,parameter2'))
+ )
+ )
+ ->willReturn($getResponse);
+
+ // Create the object under test
+ $api = new Issue($client);
+
+ // Perform the tests
+ $this->assertSame($getResponse, $api->show(5, $parameters));
+ }
+
+ /**
* Test remove().
*
* @covers ::delete
|
Added Test for correct imploding of include parameters in issue::show
|
kbsali_php-redmine-api
|
train
|
php
|
9c8903abac5a42b8edd5f19a2e50b8d9f0d9788f
|
diff --git a/src/ErrorHandler/ErrorCatcher.php b/src/ErrorHandler/ErrorCatcher.php
index <HASH>..<HASH> 100644
--- a/src/ErrorHandler/ErrorCatcher.php
+++ b/src/ErrorHandler/ErrorCatcher.php
@@ -113,7 +113,7 @@ final class ErrorCatcher implements MiddlewareInterface
private function getContentType(ServerRequestInterface $request): string
{
try {
- foreach (HeaderHelper::getSortedAcceptTypes($request->getHeader('accept')) as $header) {
+ foreach (HeaderHelper::getSortedAcceptTypes($request->getHeader(Header::ACCEPT)) as $header) {
if (array_key_exists($header, $this->renderers)) {
return $header;
}
|
Use header constant in ErrorCatcher
|
yiisoft_yii-web
|
train
|
php
|
d54c2506338c6d44b09b89da3d7d53026b8dc749
|
diff --git a/subprojects/sonar-update-center/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/PluginManifest.java b/subprojects/sonar-update-center/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/PluginManifest.java
index <HASH>..<HASH> 100644
--- a/subprojects/sonar-update-center/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/PluginManifest.java
+++ b/subprojects/sonar-update-center/sonar-update-center-common/src/main/java/org/sonar/updatecenter/common/PluginManifest.java
@@ -50,7 +50,7 @@ public final class PluginManifest {
public static final String DEPENDENCIES = "Plugin-Dependencies";
public static final String HOMEPAGE = "Plugin-Homepage";
public static final String TERMS_CONDITIONS_URL = "Plugin-TermsConditionsUrl";
- public static final String BUILD_DATE = "Build-Date";
+ public static final String BUILD_DATE = "Plugin-BuildDate";
public static final String ISSUE_TRACKER_URL = "Plugin-IssueTrackerUrl";
/**
|
SONAR-<I> Sonar startup crashes during use of Update Center if manifest uses wrong date format
|
SonarSource_sonarqube
|
train
|
java
|
65bf33fa72fc8ece0fdc86ebd9c9eb8b27e4d9f6
|
diff --git a/springloaded/src/main/java/org/springsource/loaded/agent/SpringLoadedPreProcessor.java b/springloaded/src/main/java/org/springsource/loaded/agent/SpringLoadedPreProcessor.java
index <HASH>..<HASH> 100644
--- a/springloaded/src/main/java/org/springsource/loaded/agent/SpringLoadedPreProcessor.java
+++ b/springloaded/src/main/java/org/springsource/loaded/agent/SpringLoadedPreProcessor.java
@@ -525,7 +525,7 @@ public class SpringLoadedPreProcessor implements Constants {
} else {
try {
CodeSource codeSource = protectionDomain.getCodeSource();
- if (codeSource.getLocation() == null) {
+ if (codeSource == null || codeSource.getLocation() == null) {
if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.WARNING)) {
log.warning("null codesource for " + slashedClassName);
}
|
Check for null codeSource before attempting to access
codeSource.getLocation()
|
spring-projects_spring-loaded
|
train
|
java
|
d19921ff5db30f41aca63b40dd482a092ae31831
|
diff --git a/lib/rest-ftp-daemon/notification.rb b/lib/rest-ftp-daemon/notification.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-ftp-daemon/notification.rb
+++ b/lib/rest-ftp-daemon/notification.rb
@@ -32,7 +32,7 @@ module RestFtpDaemon
# Params
body = {
- id: params[:id],
+ id: params[:id].to_s,
signal: params[:signal],
error: params[:error],
host: Settings['host'].to_s,
|
last minute demo fix: Job.id as a string for notifications
|
bmedici_rest-ftp-daemon
|
train
|
rb
|
6c47048912df028bc51288f7ebed6f74fdd9cef3
|
diff --git a/spacy/tests/tokens/test_tokens_api.py b/spacy/tests/tokens/test_tokens_api.py
index <HASH>..<HASH> 100644
--- a/spacy/tests/tokens/test_tokens_api.py
+++ b/spacy/tests/tokens/test_tokens_api.py
@@ -108,7 +108,7 @@ def test_set_ents(EN):
assert len(tokens.ents) == 0
tokens.ents = [(EN.vocab.strings['PRODUCT'], 2, 4)]
assert len(list(tokens.ents)) == 1
- assert [t.ent_iob for t in tokens] == [2, 2, 3, 1, 2, 2, 2, 2]
+ assert [t.ent_iob for t in tokens] == [0, 0, 3, 1, 0, 0, 0, 0]
ent = tokens.ents[0]
assert ent.label_ == 'PRODUCT'
assert ent.start == 2
|
Fix test, after IOB tweak.
|
explosion_spaCy
|
train
|
py
|
f60fa8b5a7eabe806deb17971d23830471268843
|
diff --git a/lib/bibformat_engine.py b/lib/bibformat_engine.py
index <HASH>..<HASH> 100644
--- a/lib/bibformat_engine.py
+++ b/lib/bibformat_engine.py
@@ -380,7 +380,12 @@ def decide_format_template(bfo, of):
output_format = get_output_format(of)
for rule in output_format['rules']:
- value = bfo.field(rule['field']).strip()#Remove spaces
+ if rule['field'].startswith('00'):
+ # Rule uses controlfield
+ value = bfo.control_field(rule['field']).strip() #Remove spaces
+ else:
+ # Rule uses datafield
+ value = bfo.field(rule['field']).strip() #Remove spaces
pattern = rule['value'].strip() #Remove spaces
match_obj = re.match(pattern, value, re.IGNORECASE)
if match_obj is not None and \
|
BibFormat: controlfield output format rule support
* Support for output format rules that apply on controlfields.
|
inveniosoftware_invenio-formatter
|
train
|
py
|
f9762dd0f401f9429959aee7022a63cb66753c9e
|
diff --git a/src/Cli.php b/src/Cli.php
index <HASH>..<HASH> 100644
--- a/src/Cli.php
+++ b/src/Cli.php
@@ -146,6 +146,11 @@ class Cli
return true;
}
+ // fix for "Undefined constant STDOUT" error
+ if (!\defined('STDOUT')) {
+ return false;
+ }
+
$stream = STDOUT;
if (\DIRECTORY_SEPARATOR === '\\') {
return (\function_exists('sapi_windows_vt100_support')
|
Fixes "Undefined constant STDOUT" error
Similar fix to Symfony's code.
|
php-toolkit_cli-utils
|
train
|
php
|
d698b79c14b1ce315262aa36ae449a7572fb8682
|
diff --git a/lib/active_scaffold/finder.rb b/lib/active_scaffold/finder.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/finder.rb
+++ b/lib/active_scaffold/finder.rb
@@ -31,11 +31,11 @@ module ActiveScaffold
def condition_for_column(column, value, text_search = :full)
like_pattern = like_pattern(text_search)
return unless column and column.search_sql and not value.blank?
- search_ui = column.search_ui || column.column.type
+ search_ui = column.search_ui || column.column.try(:type)
begin
if self.respond_to?("condition_for_#{column.name}_column")
self.send("condition_for_#{column.name}_column", column, value, like_pattern)
- elsif self.respond_to?("condition_for_#{search_ui}_type")
+ elsif search_ui && self.respond_to?("condition_for_#{search_ui}_type")
self.send("condition_for_#{search_ui}_type", column, value, like_pattern)
else
case search_ui
|
Fixed Object#type deprecated warning. This happens when search_ui is not defined and column.column is nil (virtual or association column).
|
activescaffold_active_scaffold
|
train
|
rb
|
92fe5b5decf7f84634a7b91e2589d255965a6daa
|
diff --git a/src/Core/Communicator.php b/src/Core/Communicator.php
index <HASH>..<HASH> 100644
--- a/src/Core/Communicator.php
+++ b/src/Core/Communicator.php
@@ -226,7 +226,7 @@ class Communicator
$response = $request->send();
if ($response->hasErrors()) {
- $this->$errorResponses[] = $response;
+ $this->errorResponses[] = $response;
}
return $response->__toString();
}
|
Resovled phpunit error 1 casued by last commit
|
iP1SMS_ip1-php-sdk
|
train
|
php
|
accfb1eee3a67e92a67210ff7792b1cdf3b7a4f1
|
diff --git a/treeherder/model/models.py b/treeherder/model/models.py
index <HASH>..<HASH> 100644
--- a/treeherder/model/models.py
+++ b/treeherder/model/models.py
@@ -1018,6 +1018,11 @@ class Group(models.Model):
class ClassifiedFailure(models.Model):
+ """
+ Classifies zero or more TextLogErrors as a failure.
+
+ Optionally linked to a bug.
+ """
id = models.BigAutoField(primary_key=True)
text_log_errors = models.ManyToManyField("TextLogError", through='TextLogErrorMatch',
related_name='classified_failures')
|
Document what ClassifiedFailures represent
|
mozilla_treeherder
|
train
|
py
|
538e80af04a59c787398f30cffba099610d81db4
|
diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py
index <HASH>..<HASH> 100644
--- a/salt/netapi/rest_cherrypy/app.py
+++ b/salt/netapi/rest_cherrypy/app.py
@@ -7,7 +7,8 @@ A REST API for Salt
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
-:depends: - CherryPy Python module
+:depends: - CherryPy Python module (strongly recommend 3.2.x versions due to
+ an as yet unknown SSL error).
:optdepends: - ws4py Python module for websockets support.
:configuration: All authentication is done through Salt's :ref:`external auth
<acl-eauth>` system which requires additional configuration not described
|
Added a note about recommended CherryPy versions due to SSL errors
|
saltstack_salt
|
train
|
py
|
e2591d0a50b1387f8e0ba2458cdb98b0bce2ccf1
|
diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -24,7 +24,7 @@ var tests = [
function rollupTestTask(name, file, to) {
return rollup.rollup({
entry: file,
- external: ['assert', 'react', 'enzyme', 'enzyme-adapter-react-16', 'jsdom'],
+ external: ['assert', 'react', 'enzyme', 'enzyme-adapter-react-16', 'jsdom' , 'tslib'],
plugins: [
rollupTypescript({
typescript: typescript,
@@ -37,8 +37,7 @@ function rollupTestTask(name, file, to) {
target: 'es3',
module: 'es6',
jsx: 'react'
- }),
- nodeResolve({ jsnext: true, main: true })
+ })
]
}).then((bundle) => {
bundle.write({
|
Removed node resolve from test task
|
grahammendick_navigation
|
train
|
js
|
8644d0578ea096807e54c370a8ef85d140172b36
|
diff --git a/cache/queue.go b/cache/queue.go
index <HASH>..<HASH> 100644
--- a/cache/queue.go
+++ b/cache/queue.go
@@ -24,11 +24,12 @@ func (v byOrderKey) Less(i, j int) bool { return v[i].orderKey < v[j].orderKey }
func (c *Cache) makeQueue() chan *points.Points {
c.Lock()
writeStrategy := c.writeStrategy
+ prevBuild := c.queueLastBuild
c.Unlock()
- if !c.queueLastBuild.IsZero() {
+ if !prevBuild.IsZero() {
// @TODO: may be max (with atomic cas)
- atomic.StoreUint32(&c.stat.queueWriteoutTime, uint32(time.Since(c.queueLastBuild)/time.Second))
+ atomic.StoreUint32(&c.stat.queueWriteoutTime, uint32(time.Since(prevBuild)/time.Second))
}
start := time.Now()
|
get queueLastBuild inside lock
|
lomik_go-carbon
|
train
|
go
|
466df5342152c87c6e6d8787a27487784bb721a4
|
diff --git a/tldap/base.py b/tldap/base.py
index <HASH>..<HASH> 100644
--- a/tldap/base.py
+++ b/tldap/base.py
@@ -132,8 +132,9 @@ class LDAPmeta(type):
# an attribute in this class has replaced the field
pass
elif field.name in parent_field_names:
- if type(field) != \
- type(parent_field_names[field.name]): # NOQA
+ field_type = type(field)
+ parent_field_type = type(parent_field_names[field.name])
+ if field_type != parent_field_type:
raise tldap.exceptions.FieldError(
'In class %r field %r from parent clashes '
'with field of similar name from base class %r '
|
Trick pep8 into ignoring E<I>.
We really do need to compare types here, the types should be identical.
Change-Id: I<I>d8e<I>b1b7be<I>b<I>a<I>c<I>fecac
|
Karaage-Cluster_python-tldap
|
train
|
py
|
73a1f84080795cab22ea9510b050cce7b918cf54
|
diff --git a/lib/agent.js b/lib/agent.js
index <HASH>..<HASH> 100644
--- a/lib/agent.js
+++ b/lib/agent.js
@@ -1,7 +1,9 @@
-// Packages
+// Native
const {parse} = require('url')
const http = require('http')
const https = require('https')
+
+// Packages
const fetch = require('node-fetch')
/**
|
Fix `Native` and `Packages` comment structure (#<I>)
|
zeit_now-cli
|
train
|
js
|
0ea74934e78d633872f1f8a5684ac4c3696d888b
|
diff --git a/xml-parser.class.php b/xml-parser.class.php
index <HASH>..<HASH> 100644
--- a/xml-parser.class.php
+++ b/xml-parser.class.php
@@ -44,9 +44,24 @@ class XMLParser {
return isset($xml) ? $xml : null; // isset() essentially to make editor happy.
}
+ public static function objectToArray($std) {
+ if (is_object($std)) {
+ $std = get_object_vars($std);
+ }
+ if (is_array($std)) {
+ return array_map(['self','objectToArray'], $std);
+ }
+ else {
+ return $std;
+ }
+ }
+
private static function _validateEncodeData ($data)
{
- if (is_object($data)) {
+ if(is_object($data)){ // Try conversion
+ $data = self::objectToArray($data);
+ }
+ if (is_object($data)) { // If it's still an object throw exception
throw new InvalidArgumentException(
"Invalid data type supplied for XMLParser::encode"
);
@@ -121,4 +136,4 @@ class XMLParser {
return json_decode(json_encode($xml),false);
}
-}
+}
\ No newline at end of file
|
Added stdClass / stdObject support
|
jtrumbull_xml-parser
|
train
|
php
|
39f051c194c42dc4b6a11f5a24a4280eb43e456f
|
diff --git a/examples/basic/flatarrow.py b/examples/basic/flatarrow.py
index <HASH>..<HASH> 100644
--- a/examples/basic/flatarrow.py
+++ b/examples/basic/flatarrow.py
@@ -7,7 +7,7 @@ for i in range(10):
s, c = sin(i), cos(i)
l1 = [[sin(x)+c, -cos(x)+s, x] for x in arange(0,3, 0.1)]
l2 = [[sin(x)+c+0.1, -cos(x)+s + x/15, x] for x in arange(0,3, 0.1)]
-
+
FlatArrow(l1, l2, c=i, tipSize=1, tipWidth=1)
show(collection(), viewup="z", axes=1, bg="w")
|
Removed trailing spaces in examples/basic/flatarrow.py
|
marcomusy_vtkplotter
|
train
|
py
|
1b88f2b7ff69be0bd17406136da5cd0e5526c418
|
diff --git a/phonopy/interface/vasp.py b/phonopy/interface/vasp.py
index <HASH>..<HASH> 100644
--- a/phonopy/interface/vasp.py
+++ b/phonopy/interface/vasp.py
@@ -564,7 +564,7 @@ class Vasprun(object):
if self._is_version528():
return self._parse_by_expat(VasprunWrapper(self._filename))
else:
- return self._parse_by_expat(self._filename)
+ return self._parse_by_expat(open(self._filename))
def _parse_by_expat(self, filename):
vasprun = VasprunxmlExpat(filename)
@@ -580,10 +580,10 @@ class Vasprun(object):
return False
class VasprunxmlExpat(object):
- def __init__(self, filename):
+ def __init__(self, file):
import xml.parsers.expat
- self._filename = filename
+ self._file = file
self._is_forces = False
self._is_stress = False
@@ -620,7 +620,7 @@ class VasprunxmlExpat(object):
def parse(self):
try:
- self._p.ParseFile(open(self._filename))
+ self._p.ParseFile(self._file)
except:
return False
else:
|
Minor update for vasp <I> and expat
|
atztogo_phonopy
|
train
|
py
|
aa3374c36502250f16395081bd9af23971bec392
|
diff --git a/spec/views/wobauth/roles/index.html.erb_spec.rb b/spec/views/wobauth/roles/index.html.erb_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/views/wobauth/roles/index.html.erb_spec.rb
+++ b/spec/views/wobauth/roles/index.html.erb_spec.rb
@@ -1,19 +1,16 @@
require 'rails_helper'
-RSpec.describe "roles/index", type: :view do
+RSpec.describe "wobauth/roles/index", type: :view do
before(:each) do
assign(:roles, [
- Role.create!(
- :name => "Name"
- ),
- Role.create!(
- :name => "Name"
- )
+ FactoryBot.create(:role, name: "XYZ"),
+ FactoryBot.create(:role, name: "ABC"),
])
end
it "renders a list of roles" do
render
- assert_select "tr>td", :text => "Name".to_s, :count => 2
+ assert_select "tr>td", :text => "XYZ".to_s, :count => 1
+ assert_select "tr>td", :text => "ABC".to_s, :count => 1
end
end
|
rewrite, but url_helper doesn't work
|
swobspace_wobauth
|
train
|
rb
|
cf3edc9f4f3ccda17d1c5c18f6ad540410cba319
|
diff --git a/src/Klein/Klein.php b/src/Klein/Klein.php
index <HASH>..<HASH> 100644
--- a/src/Klein/Klein.php
+++ b/src/Klein/Klein.php
@@ -748,19 +748,24 @@ class Klein
*/
private function validateRegularExpression($regex)
{
- $handled = false;
-
- $error_handler = function ($errno, $errstr) use ($handled) {
- $handled = true;
-
- throw new RegularExpressionCompilationException($errstr, preg_last_error());
- };
+ $error_string = null;
// Set an error handler temporarily
- set_error_handler($error_handler, E_NOTICE | E_WARNING);
+ set_error_handler(
+ function ($errno, $errstr) use (&$error_string) {
+ $error_string = $errstr;
+ },
+ E_NOTICE | E_WARNING
+ );
- if (false === preg_match($regex, null) && true !== $handled) {
- $error_handler(null, null);
+ if (false === preg_match($regex, null) || !empty($error_string)) {
+ // Remove our temporary error handler
+ restore_error_handler();
+
+ throw new RegularExpressionCompilationException(
+ $error_string,
+ preg_last_error()
+ );
}
// Remove our temporary error handler
|
Making sure to restore the error handler correctly
|
klein_klein.php
|
train
|
php
|
4b63fee0b4953b5162b826e451a61e3fcd189ca7
|
diff --git a/MAVProxy/modules/lib/wxsettings.py b/MAVProxy/modules/lib/wxsettings.py
index <HASH>..<HASH> 100644
--- a/MAVProxy/modules/lib/wxsettings.py
+++ b/MAVProxy/modules/lib/wxsettings.py
@@ -59,7 +59,7 @@ if __name__ == "__main__":
print("Changing %s to %s" % (setting.name, setting.value))
# test the settings
- import mp_settings, time
+ from MAVProxy.modules.lib import mp_settings, time
from mp_settings import MPSetting
settings = mp_settings.MPSettings(
[ MPSetting('link', int, 1, tab='TabOne'),
|
lib: wxsettings conversion to py3
|
ArduPilot_MAVProxy
|
train
|
py
|
bd38a2ae21c99cc73dad72ee43d9776603cb925f
|
diff --git a/src/js/plugin/dendrogram.js b/src/js/plugin/dendrogram.js
index <HASH>..<HASH> 100644
--- a/src/js/plugin/dendrogram.js
+++ b/src/js/plugin/dendrogram.js
@@ -365,7 +365,10 @@
});
nodeUpdate.select("circle")
- .attr("r", this.options.nodesize);
+ .attr("r", this.options.nodesize)
+ .style("fill", function (d) {
+ return (d.collapsed ? that.options.collapsedNodeColor : that.options.nodeColor)(d);
+ });
nodeUpdate.select("text")
.text(function (d) {
|
On update, transition node colors as well.
|
Kitware_tangelo
|
train
|
js
|
fa18883227cf43050fa31ef8bf0fbf67e2282913
|
diff --git a/spec/unit/pops/benchmark_spec.rb b/spec/unit/pops/benchmark_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/pops/benchmark_spec.rb
+++ b/spec/unit/pops/benchmark_spec.rb
@@ -31,7 +31,6 @@ $a = "interpolate ${foo} and stuff"
class MyJSonSerializer < RGen::Serializer::JsonSerializer
def attributeValue(value, a)
x = super
- require 'debugger'; debugger
puts "#{a.eType} value: <<#{value}>> serialize: <<#{x}>>"
x
end
@@ -93,7 +92,6 @@ $a = "interpolate ${foo} and stuff"
end
it "rgenjson", :profile => true do
- require 'debugger'; debugger
parser = Puppet::Pops::Parser::EvaluatingParser.new()
model = parser.parse_string(code).current
dumped = json_dump(model)
|
(maint) Remove calls to debugger in performance / serialization tests
|
puppetlabs_puppet
|
train
|
rb
|
ee1c41c6a7bd3c1241199ef310860e0684b75769
|
diff --git a/Bridge/Symfony/Serializer/Normalizer/SaleNormalizer.php b/Bridge/Symfony/Serializer/Normalizer/SaleNormalizer.php
index <HASH>..<HASH> 100644
--- a/Bridge/Symfony/Serializer/Normalizer/SaleNormalizer.php
+++ b/Bridge/Symfony/Serializer/Normalizer/SaleNormalizer.php
@@ -16,22 +16,6 @@ use Ekyna\Component\Resource\Serializer\AbstractResourceNormalizer;
class SaleNormalizer extends AbstractResourceNormalizer
{
/**
- * @var Formatter
- */
- protected $formatter;
-
-
- /**
- * Constructor.
- *
- * @param Formatter $formatter
- */
- public function __construct(Formatter $formatter)
- {
- $this->formatter = $formatter;
- }
-
- /**
* @inheritdoc
*/
public function normalize($sale, $format = null, array $context = [])
|
[Commerce] Remove formatter from sale normalizer.
|
ekyna_Commerce
|
train
|
php
|
360c1a8a363b125e581565136c41d825f26f0dca
|
diff --git a/dns_check/check.py b/dns_check/check.py
index <HASH>..<HASH> 100644
--- a/dns_check/check.py
+++ b/dns_check/check.py
@@ -57,11 +57,11 @@ class DNSCheck(NetworkCheck):
# If a specific DNS server was defined use it, else use the system default
nameserver = instance.get('nameserver')
- nameserver_port = instance.get('port')
+ nameserver_port = instance.get('nameserver_port')
if nameserver is not None:
resolver.nameservers = [nameserver]
if nameserver_port is not None:
- resolver.port = [nameserver_port]
+ resolver.port = nameserver_port
timeout = float(instance.get('timeout', self.default_timeout))
resolver.lifetime = timeout
|
[dns] fixing broken port changes. (#<I>)
|
DataDog_integrations-core
|
train
|
py
|
e727854203f47bef55869ac0c4a0f921dec85dce
|
diff --git a/vivarium/test_util.py b/vivarium/test_util.py
index <HASH>..<HASH> 100644
--- a/vivarium/test_util.py
+++ b/vivarium/test_util.py
@@ -43,7 +43,7 @@ def pump_simulation(simulation, time_step_days=None, duration=None, iterations=N
if isinstance(duration, numbers.Number):
duration = pd.Timedelta(days=duration)
time_step = pd.Timedelta(days=config.simulation_parameters.time_step)
- iterations = int(duration / time_step)
+ iterations = int(duration / time_step) + 1
if run_from_ipython():
for _ in log_progress(range(iterations), name='Step'):
|
Fixed off by one error in pump simulation
|
ihmeuw_vivarium
|
train
|
py
|
41add49925679b803796d0dc523f5136a3e2b1b3
|
diff --git a/test/integration/client/api-tests.js b/test/integration/client/api-tests.js
index <HASH>..<HASH> 100644
--- a/test/integration/client/api-tests.js
+++ b/test/integration/client/api-tests.js
@@ -6,7 +6,7 @@ var log = function() {
//console.log.apply(console, arguments);
}
-var sink = new helper.Sink(4, 10000, function() {
+var sink = new helper.Sink(5, 10000, function() {
log("ending connection pool: %s", connectionString);
pg.end(connectionString);
});
@@ -92,3 +92,19 @@ test("query errors are handled and do not bubble if callback is provded", functi
}))
}))
})
+
+test('callback is fired once and only once', function() {
+ pg.connect(connectionString, assert.calls(function(err, client) {
+ assert.isNull(err);
+ client.query("CREATE TEMP TABLE boom(name varchar(10))");
+ var callCount = 0;
+ client.query([
+ "INSERT INTO boom(name) VALUES('hai')",
+ "INSERT INTO boom(name) VALUES('boom')",
+ "INSERT INTO boom(name) VALUES('zoom')",
+ ].join(";"), function(err, callback) {
+ assert.equal(callCount++, 0, "Call count should be 0. More means this callback fired more than once.");
+ sink.add();
+ })
+ }))
+})
|
failing test for multiple calls of callback when multiple commands are executed
|
brianc_node-postgres
|
train
|
js
|
7bc54e15175a68c1d51caa97bf0ef76786a1a86e
|
diff --git a/lib/OpenLayers/Control/Navigation.js b/lib/OpenLayers/Control/Navigation.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Control/Navigation.js
+++ b/lib/OpenLayers/Control/Navigation.js
@@ -261,8 +261,11 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
* deltaZ - {Integer}
*/
wheelChange: function(evt, deltaZ) {
+ if (!this.map.fractionalZoom) {
+ deltaZ = Math.round(deltaZ);
+ }
var currentZoom = this.map.getZoom();
- var newZoom = this.map.getZoom() + Math.round(deltaZ);
+ var newZoom = this.map.getZoom() + deltaZ;
newZoom = Math.max(newZoom, 0);
newZoom = Math.min(newZoom, this.map.getNumZoomLevels());
if (newZoom === currentZoom) {
|
Don't round wheel change zoom for maps with fractional zoom
|
openlayers_openlayers
|
train
|
js
|
8a8877234e6a1b6419850343260ac55261451f90
|
diff --git a/autopep8.py b/autopep8.py
index <HASH>..<HASH> 100755
--- a/autopep8.py
+++ b/autopep8.py
@@ -556,9 +556,7 @@ class FixPEP8(object):
' ' * num_indent + target.lstrip())
def fix_e125(self, result):
- """ Fix badly indented continuation lines when they don't distinguish
- from the next logical line. """
-
+ """Fix indentation undistinguish from the next logical line."""
num_indent = int(result['info'].split()[1])
line_index = result['line'] - 1
target = self.source[line_index]
@@ -572,10 +570,12 @@ class FixPEP8(object):
spaces_to_add = num_indent - len(_get_indentation(target))
indent = len(_get_indentation(target))
i = line_index
+ modified_lines = []
while len(_get_indentation(self.source[i])) >= indent:
self.source[i] = ' ' * spaces_to_add + self.source[i]
+ modified_lines.append(1 + line_index) # Line indexed at 1.
i -= 1
- return list(range(line_index, i, -1))
+ return modified_lines
def fix_e201(self, result):
"""Remove extraneous whitespace."""
|
Return modified lines correctly
Lines are indexed at 1.
|
hhatto_autopep8
|
train
|
py
|
215e63b4b32c5217193bbd3c5ddcedfa9d54badb
|
diff --git a/code/pages/WikiPage.php b/code/pages/WikiPage.php
index <HASH>..<HASH> 100644
--- a/code/pages/WikiPage.php
+++ b/code/pages/WikiPage.php
@@ -258,12 +258,23 @@ class WikiPage extends Page
include_once SIMPLEWIKI_DIR.'/thirdparty/htmlpurifier-4.0.0-lite/library/HTMLPurifier.auto.php';
$purifier = new HTMLPurifier();
$content = $purifier->purify($content);
+ $content = preg_replace_callback('/\%5B(.*?)\%5D/', array($this, 'reformatShortcodes'), $content);
}
return $content;
}
/**
+ * Reformats shortcodes after being run through htmlpurifier
+ *
+ * @param array $matches
+ */
+ public function reformatShortcodes($matches) {
+ $val = urldecode($matches[1]);
+ return '['.$val.']';
+ }
+
+ /**
* Get the root of the wiki that this wiki page exists in
*
* @return WikiPage
|
BUGFIX: Convert purified shortcodes back to what they once were
|
nyeholt_silverstripe-simplewiki
|
train
|
php
|
ddc14249b9f2b8964948cdef3af9b85c1c999166
|
diff --git a/hamster/reports.py b/hamster/reports.py
index <HASH>..<HASH> 100644
--- a/hamster/reports.py
+++ b/hamster/reports.py
@@ -18,6 +18,7 @@
# along with Project Hamster. If not, see <http://www.gnu.org/licenses/>.
from hamster import stuff
import os
+import datetime as dt
def simple(facts, start_date, end_date):
if start_date.year != end_date.year:
|
Added missing datetime's import to fix an issue with dt.date.today() on simple report
svn path=/trunk/; revision=<I>
|
projecthamster_hamster
|
train
|
py
|
8dc9ab388a3c4954f76818640e01ab0b21976d35
|
diff --git a/src/components/View/View.js b/src/components/View/View.js
index <HASH>..<HASH> 100644
--- a/src/components/View/View.js
+++ b/src/components/View/View.js
@@ -99,9 +99,19 @@ export default class View extends Component {
})}
key={panel.key || panel.props.id || `panel-header-${i}`}
>
- <div className="View__header-left">{panel.props.header.left}</div>
- <div className="View__header-title">{panel.props.header.title}</div>
- <div className="View__header-right">{panel.props.header.right}</div>
+ {panel.props.header.left && (
+ <div className="View__header-left">
+ {panel.props.header.left}
+ </div>
+ )}
+ <div className="View__header-title">
+ {panel.props.header.title}
+ </div>
+ {panel.props.header.right && (
+ <div className="View__header-right">
+ {panel.props.header.right}
+ </div>
+ )}
</div>
))}
</div>
|
Don't show aside in panel header if it isn't exists
|
VKCOM_VKUI
|
train
|
js
|
a7e4fe8dbc3fc8d3bec5294cf68c69febb9194eb
|
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -627,10 +627,7 @@ module Puppet
:factsync => [false,
"Whether facts should be synced with the central server."],
:factsignore => [".svn CVS",
- "What files to ignore when pulling down facts."]
- )
-
- setdefaults :reports,
+ "What files to ignore when pulling down facts."],
:reportdir => {:default => "$vardir/reports",
:mode => 0750,
:owner => "service",
@@ -640,6 +637,7 @@ module Puppet
subdirectory."},
:reporturl => ["http://localhost:3000/reports",
"The URL used by the http reports processor to send reports"]
+ )
setdefaults(:tagmail,
:tagmap => ["$confdir/tagmail.conf",
|
[#<I>] Do not create a reports settings block
Puts reportdir and reporturl back in the "main" block because this makes
tests break for reasons I don't understand.
|
puppetlabs_puppet
|
train
|
rb
|
d53ed426e117bb269d579987d5f45d4b2a29f59f
|
diff --git a/lib/nydp/builtin.rb b/lib/nydp/builtin.rb
index <HASH>..<HASH> 100644
--- a/lib/nydp/builtin.rb
+++ b/lib/nydp/builtin.rb
@@ -5,8 +5,10 @@ module Nydp::Builtin
module Base
def invoke vm, args
builtin_invoke vm, args
+ rescue Nydp::Error => ne
+ raise ne
rescue Exception => e
- new_msg = "Called #{self.inspect}\nwith args #{args}\nraised\n#{Nydp.indent_text e.message}"
+ new_msg = "Called #{self.inspect}\nwith args #{args.inspect}\nraised\n#{Nydp.indent_text e.message}"
raise $!, new_msg, $!.backtrace
end
diff --git a/lib/nydp/builtin/error.rb b/lib/nydp/builtin/error.rb
index <HASH>..<HASH> 100644
--- a/lib/nydp/builtin/error.rb
+++ b/lib/nydp/builtin/error.rb
@@ -3,7 +3,7 @@ class Nydp::Builtin::Error
# override #invoke on nydp/builtin/base because
# we don't want to inherit error handling
- def invoke vm, args
+ def builtin_invoke vm, args
raise Nydp::Error.new(args.inspect)
end
end
|
builtins: special handling for Nydp::Error, no longer need to special-case builtin/error
|
conanite_nydp
|
train
|
rb,rb
|
1f9d7b8540198d6f39dbfb1936480303e2a71f41
|
diff --git a/src/Service.php b/src/Service.php
index <HASH>..<HASH> 100644
--- a/src/Service.php
+++ b/src/Service.php
@@ -58,14 +58,14 @@ final class Service
$server = $useSsl ? self::ADCOPY_API_SECURE_SERVER : self::ADCOPY_API_SERVER;
$errorpart = $error ? ';error=1' : '';
- return '<script type="text/javascript" src="' . $server . '/papi/challenge.script?k=' . $this->_pubkey . $errorpart . '"></script>
-
+ return <<<EOS
+<script type="text/javascript" src="{$server}/papi/challenge.script?k={$this->_pubkey}{$errorpart}"></script>
<noscript>
- <iframe src="' . $server . '/papi/challenge.noscript?k=' . $this->_pubkey . $errorpart
- . '" height="300" width="500" frameborder="0"></iframe><br/>
+ <iframe src="{$server}/papi/challenge.noscript?k={$this->_pubkey}{$errorpart}" height="300" width="500" frameborder="0"></iframe><br/>
<textarea name="adcopy_challenge" rows="3" cols="40"></textarea>
<input type="hidden" name="adcopy_response" value="manual_challenge"/>
-</noscript>';
+</noscript>
+EOS;
}
/**
|
Use heredoc rather than concatenated strings to simplify syntax.
|
traderinteractive_solvemedia-client-php
|
train
|
php
|
2ac4067a639856a6035c3bd00aab132c9714b52d
|
diff --git a/src/event.js b/src/event.js
index <HASH>..<HASH> 100644
--- a/src/event.js
+++ b/src/event.js
@@ -661,7 +661,7 @@ var withinElement = function( event ) {
// Chrome does something similar, the parentNode property
// can be accessed but is null.
- if ( parent !== document && !parent.parentNode ) {
+ if ( parent && parent !== document && !parent.parentNode ) {
return;
}
// Traverse up the tree
diff --git a/test/unit/event.js b/test/unit/event.js
index <HASH>..<HASH> 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -683,6 +683,20 @@ test("hover()", function() {
equals( times, 4, "hover handlers fired" );
});
+test("mouseover triggers mouseenter", function() {
+ expect(1);
+
+ var count = 0,
+ elem = jQuery("<a />");
+ elem.mouseenter(function () {
+ count++;
+ });
+ elem.trigger('mouseover');
+ equals(count, 1, "make sure mouseover triggers a mouseenter" );
+
+ elem.remove();
+});
+
test("trigger() shortcuts", function() {
expect(6);
|
Fixes #<I>. Make sure parent is not null before crawling into its lap, so mouseenter is triggered on a mouseover event.
|
jquery_jquery
|
train
|
js,js
|
d245d410bdb473513ab77e921d6963d5d7891c8c
|
diff --git a/java/src/com/google/template/soy/jbcsrc/ExpressionCompiler.java b/java/src/com/google/template/soy/jbcsrc/ExpressionCompiler.java
index <HASH>..<HASH> 100644
--- a/java/src/com/google/template/soy/jbcsrc/ExpressionCompiler.java
+++ b/java/src/com/google/template/soy/jbcsrc/ExpressionCompiler.java
@@ -449,11 +449,11 @@ final class ExpressionCompiler {
itemVar.initializer().gen(adapter); // Object a = a_list.get(a_i);
- if (visitedFilter != null) {
- visitedFilter.gen(adapter);
- BytecodeUtils.constant(false).gen(adapter);
- adapter.ifICmp(Opcodes.IFEQ, loopContinue); // if (!filter.test(a)) continue;
- }
+ // if (visitedFilter != null) {
+ // visitedFilter.gen(adapter);
+ // BytecodeUtils.constant(false).gen(adapter);
+ // adapter.ifICmp(Opcodes.IFEQ, loopContinue); // if (!filter.test(a)) continue;
+ // }
resultVar.local().gen(adapter);
visitedMap.gen(adapter);
|
Comment-out filter expr logic in ExpressionCompiler for jbcsrc, since this is giving errors in [] for LineNumberTest. We decided to fix in a follow-up.
GITHUB_BREAKING_CHANGES=NA
-------------
Created by MOE: <URL>
|
google_closure-templates
|
train
|
java
|
ae2d1487fae8f5b08c5057257e4725c8ece42a2f
|
diff --git a/middleman-core/lib/middleman-core/util.rb b/middleman-core/lib/middleman-core/util.rb
index <HASH>..<HASH> 100644
--- a/middleman-core/lib/middleman-core/util.rb
+++ b/middleman-core/lib/middleman-core/util.rb
@@ -122,7 +122,7 @@ module Middleman
Hamster::Set.new(res)
when Hamster::Vector, Hamster::Set, Hamster::SortedSet
obj.map { |element| recursively_enhance(element) }
- when ::TrueClass, ::FalseClass, ::Fixnum, ::Symbol, ::NilClass
+ when ::TrueClass, ::FalseClass, ::Fixnum, ::Symbol, ::NilClass, ::Float
obj
else
obj.dup.freeze
|
Update util.rb
line <I>, Float type is also not something that can be dup'ed, similar to Fixnum and friends
|
middleman_middleman
|
train
|
rb
|
68b31b673fa72c9accd12ebf8dd4713c3e8f590f
|
diff --git a/sling_test.go b/sling_test.go
index <HASH>..<HASH> 100644
--- a/sling_test.go
+++ b/sling_test.go
@@ -345,7 +345,7 @@ func TestBodySetter(t *testing.T) {
t.Errorf("expected nil, got %v", err)
}
if body != c.expected {
- t.Errorf("expected %v, got %v", c.expected, sling.Body)
+ t.Errorf("expected %v, got %v", c.expected, body)
}
}
}
|
Fix a test printf format which is an error on Go tip
|
dghubble_sling
|
train
|
go
|
bd24077a50d7dca22159da474502ffd4c307ea6f
|
diff --git a/pystache/template.py b/pystache/template.py
index <HASH>..<HASH> 100644
--- a/pystache/template.py
+++ b/pystache/template.py
@@ -75,20 +75,19 @@ class Template(object):
captures['whitespace'] = ''
# TODO: Process the remaining tag types.
- print captures['name']
- fetch = lambda view: unicode(view.get(captures['name']))
+ fetch = lambda view: view.get(captures['name'])
+
if captures['tag'] == '!':
pass
elif captures['tag'] == '=':
- print '"', captures['name'], '"'
self.otag, self.ctag = captures['name'].split()
self._compile_regexps()
elif captures['tag'] in ['{', '&']:
- buffer.append(fetch)
+ buffer.append(lambda view: unicode(fetch(view)))
elif captures['tag'] == '':
- buffer.append(lambda view: cgi.escape(fetch(view), True))
+ buffer.append(lambda view: cgi.escape(unicode(fetch(view)), True))
else:
- print 'Error!'
+ raise
return pos
|
Cleaning up the fetch routine a bit. Also deleting a bit
of unintended diagnostic code.
|
defunkt_pystache
|
train
|
py
|
9c115f69a583a306e51a2856b70272170057255d
|
diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -5,7 +5,7 @@ module.exports = {
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
- filename: 'bundle.js',
+ filename: 'tenderkeys.min.js',
library: 'TenderKeys'
}
};
\ No newline at end of file
|
update webpack config - update file name
|
gallactic_gallactickeys
|
train
|
js
|
71ddd8e018f27adf8943ae95f3fc8ca787ec6e6c
|
diff --git a/options.js b/options.js
index <HASH>..<HASH> 100644
--- a/options.js
+++ b/options.js
@@ -46,9 +46,13 @@ module.exports = function (argv, packageOpts, files, cwd, repo) {
listItemIndent: '1'
},
pluginPrefix: 'remark',
+ // "Whether to write successfully processed files"
output: argv.fix,
+ // "Whether to write the processed file to streamOut"
out: false,
+ // "Call back with an unsuccessful (1) code on warnings as well as errors"
frail: true,
+ // "Do not report successful files"
quiet: true
}
}
|
Add comments to unified-engine options
|
vweevers_hallmark
|
train
|
js
|
ed4a00e46f2344320a22f07febe5aec4075cb3fb
|
diff --git a/commands/server.go b/commands/server.go
index <HASH>..<HASH> 100644
--- a/commands/server.go
+++ b/commands/server.go
@@ -186,7 +186,9 @@ func server(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
- language.Set("baseURL", baseURL)
+ if isMultiHost {
+ language.Set("baseURL", baseURL)
+ }
if i == 0 {
c.Set("baseURL", baseURL)
}
|
commands: Fix baseURL server regression for multilingual sites
This was introduced in <I>f<I>e<I>d<I>a<I>a7edbaae<I>aa a couple of days ago, and demonstrates that we really need better tests for the server/commands package.
Fixes #<I>
|
gohugoio_hugo
|
train
|
go
|
8cb07251b03147cbd281d325eb65e0d4dca82f98
|
diff --git a/web/mux.go b/web/mux.go
index <HASH>..<HASH> 100644
--- a/web/mux.go
+++ b/web/mux.go
@@ -220,6 +220,6 @@ func (m *Mux) NotFound(handler interface{}) {
// after all the routes have been added, and will be called automatically for
// you (at some performance cost on the first request) if you do not call it
// explicitly.
-func (rt *router) Compile() {
- rt.compile()
+func (m *Mux) Compile() {
+ m.rt.compile()
}
|
Fix public API
f<I>e<I>bb<I>a<I>c9ed<I>d<I>fd5b<I> accidentally removed
web.Mux.Compile from the public API. This restores it.
|
zenazn_goji
|
train
|
go
|
eb0e554787895f1a11cda0a7489c8074a6308126
|
diff --git a/render/template.go b/render/template.go
index <HASH>..<HASH> 100644
--- a/render/template.go
+++ b/render/template.go
@@ -3,6 +3,7 @@ package render
import (
"html/template"
"io"
+ "log"
"os"
"path/filepath"
"sort"
@@ -67,7 +68,8 @@ func (s templateRenderer) exec(name string, data Data) (template.HTML, error) {
for _, ext := range s.exts(name) {
te, ok := s.TemplateEngines[ext]
if !ok {
- return "", errors.Errorf("could not find a template engine for %s", ext)
+ log.Printf("could not find a template engine for %s\n", ext)
+ continue
}
body, err = te(body, data, helpers)
if err != nil {
|
log a warning instead of returning an error for missing template engine
|
gobuffalo_buffalo
|
train
|
go
|
96c8084945fa0ce642a4fb9fa9bd013c17594e37
|
diff --git a/pandas/tests/test_multilevel.py b/pandas/tests/test_multilevel.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/test_multilevel.py
+++ b/pandas/tests/test_multilevel.py
@@ -2263,6 +2263,7 @@ Thur,Lunch,Yes,51.51,17"""
def test_repeat(self):
# GH 9361
+ # fixed by # GH 7891
m_idx = pd.MultiIndex.from_tuples([(1, 2), (3, 4),
(5, 6), (7, 8)])
data = ['a', 'b', 'c', 'd']
|
update test comments to reference #<I>
|
pandas-dev_pandas
|
train
|
py
|
009b022c17e2393e2866566762e9821382e0a26d
|
diff --git a/structr-core/src/main/java/org/structr/common/RelType.java b/structr-core/src/main/java/org/structr/common/RelType.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/common/RelType.java
+++ b/structr-core/src/main/java/org/structr/common/RelType.java
@@ -31,6 +31,6 @@ public enum RelType implements RelationshipType {
OWNS,
IS_AT,
PROPERTY_ACCESS,
- CHILDREN
+ CONTAINS
}
diff --git a/structr-core/src/main/java/org/structr/core/entity/AbstractUser.java b/structr-core/src/main/java/org/structr/core/entity/AbstractUser.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/core/entity/AbstractUser.java
+++ b/structr-core/src/main/java/org/structr/core/entity/AbstractUser.java
@@ -95,7 +95,7 @@ public abstract class AbstractUser extends Person implements Principal {
public List<Principal> getParents() {
List<Principal> parents = new LinkedList<Principal>();
- Iterable<AbstractRelationship> parentRels = getIncomingRelationships(RelType.CHILDREN);
+ Iterable<AbstractRelationship> parentRels = getIncomingRelationships(RelType.CONTAINS);
for (AbstractRelationship rel : parentRels) {
|
fixed relationship type for groups containing users
|
structr_structr
|
train
|
java,java
|
3c38cef9346ec787c360e888898baddbbd03c737
|
diff --git a/example/idp2/idp_user.py b/example/idp2/idp_user.py
index <HASH>..<HASH> 100644
--- a/example/idp2/idp_user.py
+++ b/example/idp2/idp_user.py
@@ -68,7 +68,7 @@ USERS = {
"ou": "IT",
"initials": "P",
#"schacHomeOrganization": "example.com",
- "email": "roland@example.com",
+ "mail": "roland@example.com",
"displayName": "P. Roland Hedberg",
"labeledURL": "http://www.example.com/rohe My homepage",
"norEduPersonNIN": "SE197001012222"
|
Corrected attribute name: email -> mail.
|
IdentityPython_pysaml2
|
train
|
py
|
04688ce685c80809e57c3046783e3e8250739b33
|
diff --git a/python/thunder/rdds/series.py b/python/thunder/rdds/series.py
index <HASH>..<HASH> 100644
--- a/python/thunder/rdds/series.py
+++ b/python/thunder/rdds/series.py
@@ -191,11 +191,7 @@ class Series(Data):
perc = 20
basefunc = lambda x: percentile(x, perc)
- def func(y):
- baseline = basefunc(y)
- return (y - baseline) / (baseline + 0.1)
-
- return self.apply(func)
+ return self.apply(lambda y: (y - basefunc(y)) / (basefunc(y) + 0.1))
def center(self, axis=0):
""" Center series data by subtracting the mean
|
Simplify normalize call to avoid function def
|
thunder-project_thunder
|
train
|
py
|
1bb959b455cb69c03b045ac5666319aebf24f2c3
|
diff --git a/jooby/src/main/java/io/jooby/Value.java b/jooby/src/main/java/io/jooby/Value.java
index <HASH>..<HASH> 100644
--- a/jooby/src/main/java/io/jooby/Value.java
+++ b/jooby/src/main/java/io/jooby/Value.java
@@ -237,7 +237,7 @@ public interface Value extends Iterable<Value> {
*
* @return Convert this value to String (if possible) or <code>null</code> when missing.
*/
- @Nonnull default String valueOrNull() {
+ @Nullable default String valueOrNull() {
return value((String) null);
}
|
Make valueOrNull nullable
The method Value.valueOrNull() is marked as NonNull, this fixes that and marks it as Nullable
|
jooby-project_jooby
|
train
|
java
|
80c3cb0a19ad7f41f4ab2d2008cdcd92b12633b4
|
diff --git a/packages/material-ui/src/PaginationItem/PaginationItem.js b/packages/material-ui/src/PaginationItem/PaginationItem.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/PaginationItem/PaginationItem.js
+++ b/packages/material-ui/src/PaginationItem/PaginationItem.js
@@ -253,10 +253,15 @@ const PaginationItem = React.forwardRef(function PaginationItem(props, ref) {
return type === 'start-ellipsis' || type === 'end-ellipsis' ? (
<div
ref={ref}
- className={clsx(classes.root, classes.ellipsis, {
- [classes.disabled]: disabled,
- [classes[`size${capitalize(size)}`]]: size !== 'medium',
- })}
+ className={clsx(
+ classes.root,
+ classes.ellipsis,
+ {
+ [classes.disabled]: disabled,
+ [classes[`size${capitalize(size)}`]]: size !== 'medium',
+ },
+ className,
+ )}
>
…
</div>
|
[Pagination] Fix className forwarding when type is ellipsis (#<I>)
|
mui-org_material-ui
|
train
|
js
|
db9ac817f553edd66669cd67284ae368b75358b8
|
diff --git a/lib/classifier-reborn/bayes.rb b/lib/classifier-reborn/bayes.rb
index <HASH>..<HASH> 100644
--- a/lib/classifier-reborn/bayes.rb
+++ b/lib/classifier-reborn/bayes.rb
@@ -12,7 +12,7 @@ module ClassifierReborn
def initialize(*args)
@categories = Hash.new
options = { language: 'en' }
- args.each { |arg|
+ args.flatten.each { |arg|
if arg.kind_of?(Hash)
options.merge!(arg)
else
|
Update bayes.rb
Added ability to handle and array of classifications to the constructor.
|
jekyll_classifier-reborn
|
train
|
rb
|
6c75dd0aef1be11ba4dc174fc5de7c46fe5f46ad
|
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/connection/BackendConnection.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/connection/BackendConnection.java
index <HASH>..<HASH> 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/connection/BackendConnection.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/connection/BackendConnection.java
@@ -162,8 +162,10 @@ public final class BackendConnection implements AutoCloseable {
* @param autoCommit auto commit
*/
public void setAutoCommit(final boolean autoCommit) {
+ if (!autoCommit) {
+ status = ConnectionStatus.TRANSACTION;
+ }
cachedConnections.clear();
- status = ConnectionStatus.TRANSACTION;
recordMethodInvocation(Connection.class, "setAutoCommit", new Class[]{boolean.class}, new Object[]{autoCommit});
}
|
#<I> Only change status to TRANSACTION while setAutoCommit was false.
|
apache_incubator-shardingsphere
|
train
|
java
|
d71b21ca89f0013d27ef042983ebd2f6fe86f5af
|
diff --git a/lib/topologies/replset.js b/lib/topologies/replset.js
index <HASH>..<HASH> 100644
--- a/lib/topologies/replset.js
+++ b/lib/topologies/replset.js
@@ -1022,7 +1022,6 @@ ReplSet.prototype.destroy = function(options) {
// Clear out all monitoring
for (var i = 0; i < this.intervalIds.length; i++) {
this.intervalIds[i].stop();
- this.intervalIds[i].stop();
}
// Reset list of intervalIds
|
chore(topology): removing double timeout clear
This was accidentally introduced during the following refactor:
cd<I>d<I>f<I>ad<I>c6a<I>ffcfa<I>d1e7d3a2
|
mongodb-js_mongodb-core
|
train
|
js
|
77d76a69ba31cb6d5a9174561a435a89f9afa1d5
|
diff --git a/builtin/providers/aws/resource_aws_directory_service_directory.go b/builtin/providers/aws/resource_aws_directory_service_directory.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_directory_service_directory.go
+++ b/builtin/providers/aws/resource_aws_directory_service_directory.go
@@ -336,7 +336,7 @@ func resourceAwsDirectoryServiceDirectoryCreate(d *schema.ResourceData, meta int
d.Id(), *ds.Stage)
return ds, *ds.Stage, nil
},
- Timeout: 30 * time.Minute,
+ Timeout: 45 * time.Minute,
}
if _, err := stateConf.WaitForState(); err != nil {
return fmt.Errorf(
|
provider/aws: Bump Directory Service creation timeout to <I>m
|
hashicorp_terraform
|
train
|
go
|
690001ed2a42d2aa89ecbf63a48b0f972c22806c
|
diff --git a/conductor-support/src/main/java/com/bluelinelabs/conductor/support/ControllerPagerAdapter.java b/conductor-support/src/main/java/com/bluelinelabs/conductor/support/ControllerPagerAdapter.java
index <HASH>..<HASH> 100644
--- a/conductor-support/src/main/java/com/bluelinelabs/conductor/support/ControllerPagerAdapter.java
+++ b/conductor-support/src/main/java/com/bluelinelabs/conductor/support/ControllerPagerAdapter.java
@@ -53,12 +53,17 @@ public abstract class ControllerPagerAdapter extends PagerAdapter {
}
}
+ final Controller controller;
if (!router.hasRootController()) {
- Controller controller = getItem(position);
+ controller = getItem(position);
router.setRoot(RouterTransaction.with(controller).tag(name));
- visiblePageIds.put(position, controller.getInstanceId());
} else {
router.rebindIfNeeded();
+ controller = router.getControllerWithTag(name);
+ }
+
+ if (controller != null) {
+ visiblePageIds.put(position, controller.getInstanceId());
}
return router.getControllerWithTag(name);
@@ -139,4 +144,4 @@ public abstract class ControllerPagerAdapter extends PagerAdapter {
return viewId + ":" + id;
}
-}
\ No newline at end of file
+}
|
Fixes issue when retrieving an existing controller from a ControllerPagerAdapter (#<I>)
|
bluelinelabs_Conductor
|
train
|
java
|
00154043618be26fba01c44a890abae81a9c15a4
|
diff --git a/vendor/refinerycms/core/lib/refinery/crud.rb b/vendor/refinerycms/core/lib/refinery/crud.rb
index <HASH>..<HASH> 100644
--- a/vendor/refinerycms/core/lib/refinery/crud.rb
+++ b/vendor/refinerycms/core/lib/refinery/crud.rb
@@ -275,6 +275,17 @@ module Refinery
)
end
+
+ module_eval %(
+ def self.sortable?
+ #{options[:sortable].to_s}
+ end
+
+ def self.searchable?
+ #{options[:searchable].to_s}
+ end
+ )
+
end
|
add helper methods to expose some of the options in crud. This allows the admin views to dynamically hide or show the search box or reorder link depending on what options you set with crud
|
refinery_refinerycms
|
train
|
rb
|
6d045a8f73c3b05db03fcae99597bed54ecb4d67
|
diff --git a/src/Testing/Concerns/MakesHttpRequests.php b/src/Testing/Concerns/MakesHttpRequests.php
index <HASH>..<HASH> 100644
--- a/src/Testing/Concerns/MakesHttpRequests.php
+++ b/src/Testing/Concerns/MakesHttpRequests.php
@@ -242,11 +242,13 @@ trait MakesHttpRequests
public function seeJson(array $data = null, $negate = false)
{
if (is_null($data)) {
- PHPUnit::assertArraySubset(
- null, json_decode($this->getContent(), true), false, "JSON was not returned from [{$this->currentUri}]."
- );
+ $decodedResponse = json_decode($this->response->getContent(), true);
- return $this;
+ if (is_null($decodedResponse) || $decodedResponse === false) {
+ PHPUnit::fail(
+ "JSON was not returned from [{$this->currentUri}]."
+ );
+ }
}
return $this->seeJsonContains($data, $negate);
|
This is a bit of a mistery.
1. I cannot find anything related to the original `PHPUnit\Framework\Assert::assertJson()`
2. This mainly aim to check if response is actually JSON.
|
laravel_lumen-framework
|
train
|
php
|
d377a92a5d0906b7501f96805a4591c837e670aa
|
diff --git a/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/AbstractCanalAdapterWorker.java b/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/AbstractCanalAdapterWorker.java
index <HASH>..<HASH> 100644
--- a/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/AbstractCanalAdapterWorker.java
+++ b/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/loader/AbstractCanalAdapterWorker.java
@@ -201,7 +201,11 @@ public abstract class AbstractCanalAdapterWorker {
List<Dml> dmlsBatch = new ArrayList<>();
for (Dml dml : dmls) {
dmlsBatch.add(dml);
- len += dml.getData().size();
+ if (dml.getData() == null || dml.getData().isEmpty()) {
+ len += 1;
+ } else {
+ len += dml.getData().size();
+ }
if (len >= canalClientConfig.getSyncBatchSize()) {
adapter.sync(dmlsBatch);
dmlsBatch.clear();
|
fixed issue #<I>, NPE
|
alibaba_canal
|
train
|
java
|
81bbae1ad39c49a9bd3b0a2f0b447f50c9356f4a
|
diff --git a/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/RowBatcherTest.java b/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/RowBatcherTest.java
index <HASH>..<HASH> 100644
--- a/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/RowBatcherTest.java
+++ b/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/RowBatcherTest.java
@@ -182,6 +182,12 @@ public class RowBatcherTest {
runJsonRowsTest(jsonBatcher(1));
}
@Test
+ public void testJsonRows1ThreadForDB() throws Exception {
+ runJsonRowsTest(jsonBatcher(
+ Common.newClient("java-unittest").newDataMovementManager(),
+ 1));
+ }
+ @Test
public void testJsonRows3Threads() throws Exception {
runJsonRowsTest(jsonBatcher(3));
}
@@ -224,6 +230,9 @@ public class RowBatcherTest {
/* TODO: style tests
*/
private RowBatcher<JsonNode> jsonBatcher(int threads) {
+ return jsonBatcher(moveMgr, threads);
+ }
+ private RowBatcher<JsonNode> jsonBatcher(DataMovementManager moveMgr, int threads) {
return moveMgr.newRowBatcher(new JacksonHandle())
.withBatchSize(30)
.withThreadCount(threads);
|
Unit test to verify database-specific client with row batcher
|
marklogic_java-client-api
|
train
|
java
|
39125f4bf0d483157ce79a300903b88fe7db3965
|
diff --git a/generator/index.js b/generator/index.js
index <HASH>..<HASH> 100644
--- a/generator/index.js
+++ b/generator/index.js
@@ -50,6 +50,12 @@ module.exports = (api, options = {}) => {
'let mainWindow: any'
)
fs.writeFileSync(api.resolve('./src/background.ts'), background)
+ if (api.hasPlugin('router')) {
+ console.log('\n')
+ require('@vue/cli-shared-utils/lib/logger').warn(
+ 'It is detected that you are using Vue Router. If you are using history mode, you must push the default route when the root component is loaded. Learn more at http://shorturl.at/lsBEH.'
+ )
+ }
}
})
|
[skip ci] generator: warn about history mode if router is installed
|
nklayman_vue-cli-plugin-electron-builder
|
train
|
js
|
a239b6709f399417f9e0d9ee2c4190b7896830e3
|
diff --git a/src/Storefront/Pagelet/Checkout/AjaxCart/CheckoutAjaxCartPageletLoadedEvent.php b/src/Storefront/Pagelet/Checkout/AjaxCart/CheckoutAjaxCartPageletLoadedEvent.php
index <HASH>..<HASH> 100644
--- a/src/Storefront/Pagelet/Checkout/AjaxCart/CheckoutAjaxCartPageletLoadedEvent.php
+++ b/src/Storefront/Pagelet/Checkout/AjaxCart/CheckoutAjaxCartPageletLoadedEvent.php
@@ -9,7 +9,7 @@ use Symfony\Component\HttpFoundation\Request;
class CheckoutAjaxCartPageletLoadedEvent extends NestedEvent
{
- public const NAME = 'checkout-info.pagelet.loaded';
+ public const NAME = 'checkout-ajax-cart.pagelet.loaded';
/**
* @var CheckoutAjaxCartPagelet
|
NTR - Fix doubled event names
|
shopware_platform
|
train
|
php
|
8dbbcb8a115603889084320bb45de39aea559c0d
|
diff --git a/src/pydocstyle/cli.py b/src/pydocstyle/cli.py
index <HASH>..<HASH> 100644
--- a/src/pydocstyle/cli.py
+++ b/src/pydocstyle/cli.py
@@ -55,7 +55,7 @@ def run_pydocstyle(use_pep257=False):
count = 0
for error in errors:
- sys.stderr.write('%s\n' % error)
+ sys.stdout.write('%s\n' % error)
count += 1
if count == 0:
exit_code = ReturnCode.no_violations_found
diff --git a/src/pydocstyle/parser.py b/src/pydocstyle/parser.py
index <HASH>..<HASH> 100644
--- a/src/pydocstyle/parser.py
+++ b/src/pydocstyle/parser.py
@@ -380,8 +380,8 @@ class Parser(object):
if self.current.value not in '([':
raise AllError('Could not evaluate contents of __all__. ')
if self.current.value == '[':
- sys.stderr.write(
- "{} WARNING: __all__ is defined as a list, this means "
+ sys.stdout.write(
+ "{0} WARNING: __all__ is defined as a list, this means "
"pydocstyle cannot reliably detect contents of the __all__ "
"variable, because it can be mutated. Change __all__ to be "
"an (immutable) tuple, to remove this warning. Note, "
|
changed stderr to stdout
|
PyCQA_pydocstyle
|
train
|
py,py
|
007e743a21c24d1667a19a51d9ba88257010d082
|
diff --git a/config/projects/chefdk.rb b/config/projects/chefdk.rb
index <HASH>..<HASH> 100644
--- a/config/projects/chefdk.rb
+++ b/config/projects/chefdk.rb
@@ -66,7 +66,7 @@ override :ruby, version: "2.1.4"
override :'ruby-windows', version: "2.0.0-p451"
######
override :rubygems, version: "2.4.4"
-override :'test-kitchen', version: "v121-dep-fix"
+override :'test-kitchen', version: "v1.3.0"
override :yajl, version: "1.2.1"
override :zlib, version: "1.2.8"
|
Bump test-kitchen to <I>
|
chef_chef
|
train
|
rb
|
e4cae200f4a55a86774ba98a3182d4c9fb7b0436
|
diff --git a/lib/devise.rb b/lib/devise.rb
index <HASH>..<HASH> 100644
--- a/lib/devise.rb
+++ b/lib/devise.rb
@@ -378,8 +378,7 @@ module Devise
# constant-time comparison algorithm to prevent timing attacks
def self.secure_compare(a, b)
- return false unless a.present? && b.present?
- return false unless a.bytesize == b.bytesize
+ return false if a.blank? || b.blank? || a.bytesize != b.bytesize
l = a.unpack "C#{a.bytesize}"
res = 0
diff --git a/test/devise_test.rb b/test/devise_test.rb
index <HASH>..<HASH> 100644
--- a/test/devise_test.rb
+++ b/test/devise_test.rb
@@ -62,4 +62,14 @@ class DeviseTest < ActiveSupport::TestCase
assert_nothing_raised(Exception) { Devise.add_module(:authenticatable_again, :model => 'devise/model/authenticatable') }
assert defined?(Devise::Models::AuthenticatableAgain)
end
+
+ test 'should complain when comparing empty or different sized passes' do
+ [nil, ""].each do |empty|
+ assert_not Devise.secure_compare(empty, "something")
+ assert_not Devise.secure_compare("something", empty)
+ assert_not Devise.secure_compare(empty, empty)
+ end
+ assert_not Devise.secure_compare("size_1", "size_four")
+ end
+
end
|
simplifying comparisons (avoind too much negatives) and adding unit test cases
|
plataformatec_devise
|
train
|
rb,rb
|
b512fa62cc237be3ca6dc7b5b31ca7714d1eee0f
|
diff --git a/spec/mangopay/client_spec.rb b/spec/mangopay/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mangopay/client_spec.rb
+++ b/spec/mangopay/client_spec.rb
@@ -96,14 +96,14 @@ describe MangoPay::Client do
trns = MangoPay::Client.fetch_wallet_transactions('fees', 'EUR')
expect(trns).to be_kind_of(Array)
expect(trns).not_to be_empty
- expect((trns.map {|m| m['DebitedWalletId']}).uniq).to eq(['FEES_EUR'])
+ #expect((trns.map {|m| m['DebitedWalletId']}).uniq).to eq(['FEES_EUR'])
end
it 'fetches transactions of one of client wallets by funds type (credit) and currency' do
trns = MangoPay::Client.fetch_wallet_transactions('credit', 'EUR')
expect(trns).to be_kind_of(Array)
expect(trns).not_to be_empty
- expect((trns.map {|m| m['CreditedWalletId']}).uniq).to eq(['CREDIT_EUR'])
+ #expect((trns.map {|m| m['CreditedWalletId']}).uniq).to eq(['CREDIT_EUR'])
end
end
|
Remove non reliable tests
Because their outcome depends entirely on the having the right data in the right fields on the API side :-/
|
Mangopay_mangopay2-ruby-sdk
|
train
|
rb
|
1844babce474d113d635a8e90351af9382cfb0de
|
diff --git a/packages/tooltip/src/Tooltip.js b/packages/tooltip/src/Tooltip.js
index <HASH>..<HASH> 100644
--- a/packages/tooltip/src/Tooltip.js
+++ b/packages/tooltip/src/Tooltip.js
@@ -80,5 +80,10 @@ Tooltip.propTypes = {
/** When provided, it overrides the flyout's open state */
open: PropTypes.bool,
/** Whether flyout should open when the target is hovered over */
- openOnHover: PropTypes.bool
+ openOnHover: PropTypes.bool,
+ /**
+ * If openOnHover is true, this prop will determine the delay
+ * from when mouseEnter begins until the Tooltip visually opens
+ */
+ openOnHoverDelay: PropTypes.number
};
|
feat: Add openOnHoverDelay prop
|
Autodesk_hig
|
train
|
js
|
e03bd74a58a240f642bafefb7b156e8308dccb39
|
diff --git a/source/decode.js b/source/decode.js
index <HASH>..<HASH> 100644
--- a/source/decode.js
+++ b/source/decode.js
@@ -129,8 +129,8 @@ var Decode = (function() {
, int
;
- str = str.slice( 0, endIdx )
- int = str.replace(/i/, '').replace(/e/, '');
+ str = str.slice( 0, endIdx );
+ int = str.match( /\d+/ );
var result = parseInt( int );
|
changed logic in getInteger for extracting desired part of the string
|
benjreinhart_bencode-js
|
train
|
js
|
ff68d6995358c355664032de203e6f3f3ad849ec
|
diff --git a/lib/proteus/kit.rb b/lib/proteus/kit.rb
index <HASH>..<HASH> 100644
--- a/lib/proteus/kit.rb
+++ b/lib/proteus/kit.rb
@@ -17,8 +17,12 @@ module Proteus
if system "git ls-remote #{url(kit_name)} #{repo_name} > /dev/null 2>&1"
puts "Starting a new proteus-#{kit_name} project in #{repo_name}"
system "git clone #{url(kit_name)}#{' ' + repo_name} && "\
- "rm -rf #{repo_name}/.git && "\
- "git init #{repo_name}"
+ "cd #{repo_name} && "\
+ "rm -rf .git && "\
+ "git init && "\
+ "git add . && "\
+ "git commit -am 'New proteus-#{kit_name} project' && "\
+ "cd -"
else
puts "A thoughtbot repo doesn't exist with that name"
end
|
Make a first commit for the user
|
thoughtbot_proteus
|
train
|
rb
|
a5d9f9a9f839aa10438d7022c675d0feea3db581
|
diff --git a/lib/cli/init-deployment.js b/lib/cli/init-deployment.js
index <HASH>..<HASH> 100644
--- a/lib/cli/init-deployment.js
+++ b/lib/cli/init-deployment.js
@@ -129,7 +129,7 @@ module.exports = function (argv) {
start: 'node server.js'
},
dependencies: {
- 'anvil-connect': '0.1.0'
+ 'anvil-connect': '0.1.1'
}
}),
|
bump anvil-connect version in cli generated package.json prior to release
|
anvilresearch_connect
|
train
|
js
|
0b48416927f7f4152e7a8a9dfbc6da820463211a
|
diff --git a/packages/generator/app/templates/postcss.config.js b/packages/generator/app/templates/postcss.config.js
index <HASH>..<HASH> 100644
--- a/packages/generator/app/templates/postcss.config.js
+++ b/packages/generator/app/templates/postcss.config.js
@@ -1,5 +1,6 @@
module.exports = ctx => ({
plugins: [
+ require('postcss-modules-values-replace')({}),
require('postcss-cssnext')({
features: {
calc: {
|
RG-<I> return 'postcss-modules-values-replace' plugin back to generator since we still use "unit"
|
JetBrains_ring-ui
|
train
|
js
|
6fc62ced1ae0d659bead59e2f2dc9d88e68f1b87
|
diff --git a/timepiece/views.py b/timepiece/views.py
index <HASH>..<HASH> 100644
--- a/timepiece/views.py
+++ b/timepiece/views.py
@@ -1112,17 +1112,9 @@ def payroll_summary(request, form, from_date, to_date, status, activity):
).order_by('user__last_name')
for rp in rps:
rp.user.summary = rp.summary(from_date, to_date)
- cals = []
- date = from_date - relativedelta(months=1)
- end_date = from_date + relativedelta(months=1)
- html_cal = calendar.HTMLCalendar(calendar.SUNDAY)
- while date < end_date:
- cals.append(html_cal.formatmonth(date.year, date.month))
- date += relativedelta(months=1)
return {
'form': form,
'all_weeks': all_weeks,
- 'cals': cals,
'periods': rps,
'to_date': to_date,
'from_date': from_date,
|
[#<I>] Removed uneeded cal code in payroll report
|
caktus_django-timepiece
|
train
|
py
|
92302895549800d9d8384b2cc77f9b5bb4dc1fd1
|
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -2232,6 +2232,7 @@ require 'puppet/type/symlink'
require 'puppet/type/user'
require 'puppet/type/tidy'
require 'puppet/type/parsedtype'
-require 'puppet/type/yumrepo'
+#This needs some more work before it is ready for primetime
+#require 'puppet/type/yumrepo'
# $Id$
|
Disable yumrepo type since it won't work with the FC5 repo files
git-svn-id: <URL>
|
puppetlabs_puppet
|
train
|
rb
|
21413d9df2365678e8e0314dd4050b55545cef7c
|
diff --git a/py/h2o.py b/py/h2o.py
index <HASH>..<HASH> 100644
--- a/py/h2o.py
+++ b/py/h2o.py
@@ -520,7 +520,8 @@ def check_sandbox_for_errors(sandbox_ignore_errors=False):
# don't detect these class loader info messags as errors
#[Loaded java.lang.Error from /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar]
foundBad = regex1.search(line) and not (
- ('error rate' in line) or ('[Loaded ' in line) or ('[WARN]' in line))
+ ('error rate' in line) or ('[Loaded ' in line) or
+ ('[WARN]' in line) or ('CalcSquareErrorsTasks' in line))
if (printing==0 and foundBad):
printing = 1
|
Log line containg reference to the class CalcSquareErrorsTasks causes
false test fail.
|
h2oai_h2o-2
|
train
|
py
|
9a21dd6de77f2e6a955c321c7708ebbedbbee019
|
diff --git a/morpfw/crud/app.py b/morpfw/crud/app.py
index <HASH>..<HASH> 100644
--- a/morpfw/crud/app.py
+++ b/morpfw/crud/app.py
@@ -128,6 +128,12 @@ class App(JsonSchemaApp, signals.SignalApp):
def get_statemachine(self, context):
raise NotImplementedError
+ @reg.dispatch_method(reg.match_class("model"))
+ def get_statemachine_factory(self, model):
+ return None
+
+
+
@reg.dispatch_method(reg.match_instance("model", lambda self, context: context))
def get_searchprovider(self, context):
raise NotImplementedError
diff --git a/morpfw/crud/component.py b/morpfw/crud/component.py
index <HASH>..<HASH> 100644
--- a/morpfw/crud/component.py
+++ b/morpfw/crud/component.py
@@ -162,6 +162,13 @@ class StateMachineAction(dectate.Action):
def perform(self, obj, app_class):
app_class.get_statemachine.register(reg.methodify(obj), model=self.model)
+ def factory(model):
+ return obj
+
+ app_class.get_statemachine_factory.register(
+ reg.methodify(factory), model=self.model
+ )
+
class SearchProviderAction(dectate.Action):
|
allow querying for statemachine factory for model
|
morpframework_morpfw
|
train
|
py,py
|
2eab5d74377427a30b2a4ff2e1bc14d1c1b38387
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -70,7 +70,7 @@ module.exports = function(entry, opts) {
if (ev === 'change' || ev === 'add')
emitter.reload(file)
})
- .on('update', function(file) {
+ .on('pending', function(file) {
//bundle.js changes
emitter.reload(file)
})
diff --git a/lib/budo.js b/lib/budo.js
index <HASH>..<HASH> 100644
--- a/lib/budo.js
+++ b/lib/budo.js
@@ -167,6 +167,7 @@ module.exports = function() {
server.update(contents)
emitter.emit('update', serveAs, contents)
})
+ .on('pending', emitter.emit.bind(emitter, 'pending'))
.on('error', emitter.emit.bind(emitter, 'error'))
}
|
for faster UX, trigger reload on pending
|
mattdesl_budo
|
train
|
js,js
|
f4ed787ddcc2ecd6399b99183c8bf2656e3e661a
|
diff --git a/src/Entity/Abstraction/AbstractEntity.php b/src/Entity/Abstraction/AbstractEntity.php
index <HASH>..<HASH> 100644
--- a/src/Entity/Abstraction/AbstractEntity.php
+++ b/src/Entity/Abstraction/AbstractEntity.php
@@ -386,7 +386,13 @@ abstract class AbstractEntity implements EntityInterface, SortableInterface
public function toArray($recursive = true)
{
if (!$recursive) {
- return $this->properties;
+ $copy = array();
+
+ foreach ($this->properties as $key => $value) {
+ $copy[$key] = $this->$key;
+ }
+
+ return $copy;
}
return $this->convert(new PhpArray());
|
Ensure property values go though the get method before exporting
|
codeblanche_Entity
|
train
|
php
|
f4b762b4e322bc7d6a4c448b63c4a7765222b7f4
|
diff --git a/build/extract-css.js b/build/extract-css.js
index <HASH>..<HASH> 100644
--- a/build/extract-css.js
+++ b/build/extract-css.js
@@ -11,7 +11,7 @@ files.forEach((file) => {
sass.render({
file: `./src/css/${file}.scss`,
outputStyle: 'compressed',
- importer: tildeImporter,
+ importer: tildeImporter(),
}, function(err, result) {
if (err) {
console.log(chalk.red('error!', err));
|
fix(css): fix utilities and reset build
this file previously used `node-sass-tilde-importer`, which was
passed in like `importer: tildeImporter`.
during the winter release, that package was replaced with
`node-sass-package-importer` which must be invoked like
this `importer: tildeImporter()`
|
rei_rei-cedar
|
train
|
js
|
fb67e519914a546a5ebeb55d14548e14a135cd62
|
diff --git a/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java b/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java
index <HASH>..<HASH> 100644
--- a/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java
+++ b/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java
@@ -34,7 +34,7 @@ import org.infinispan.server.core.InterceptorChain;
* @author Galder Zamarreño
* @since 4.0
*/
-class TextCommandHandler implements CommandHandler {
+public class TextCommandHandler implements CommandHandler {
final Cache cache;
final InterceptorChain chain;
|
[ISPN-<I>] (Build memcached server module) Fix compilation issue.
|
infinispan_infinispan
|
train
|
java
|
7b113a63af4542ea90eef8e766ee8b57c4ede0d7
|
diff --git a/src/toil/fileStores/abstractFileStore.py b/src/toil/fileStores/abstractFileStore.py
index <HASH>..<HASH> 100644
--- a/src/toil/fileStores/abstractFileStore.py
+++ b/src/toil/fileStores/abstractFileStore.py
@@ -303,7 +303,7 @@ class AbstractFileStore(with_metaclass(ABCMeta, object)):
if size is None:
# It fell off
# Someone is mixing FileStore and JobStore file APIs, or serializing FileIDs as strings.
- size = self.jobStore.getGlobalFileSize(fileStoreID)
+ size = self.jobStore.getFileSize(fileStoreID)
return size
|
Actually call the implemented size polling method (#<I>)
|
DataBiosphere_toil
|
train
|
py
|
6063d4a6a2ce1ed6c450fcda128ba081122a8f7e
|
diff --git a/config/software/bookshelf.rb b/config/software/bookshelf.rb
index <HASH>..<HASH> 100644
--- a/config/software/bookshelf.rb
+++ b/config/software/bookshelf.rb
@@ -20,8 +20,7 @@ version "master"
dependencies ["erlang", "rebar", "rsync"]
-# TODO: use the public git:// uri once this repo is public
-source :git => "git@github.com:opscode/bookshelf.git"
+source :git => "git://github.com/opscode/bookshelf.git"
relative_path "bookshelf"
|
update bookshelf software definition to use public git uri
|
chef_chef
|
train
|
rb
|
8a149c25897c76f33d345b473e0942ccc89c7a6d
|
diff --git a/ioc_writer/ioc_api.py b/ioc_writer/ioc_api.py
index <HASH>..<HASH> 100644
--- a/ioc_writer/ioc_api.py
+++ b/ioc_writer/ioc_api.py
@@ -632,6 +632,14 @@ class IOC():
'''
return write_ioc(self.root, output_dir)
+ def write_ioc_to_string(self):
+ '''
+ Writes the IOC to a string.
+
+ output: returns a string, which is the XML representation of the IOC.
+ '''
+ return write_ioc_string(self.root)
+
def make_Indicator_node(operator, id = None):
'''
This makes a Indicator node element. These allow the construction of a
|
Add a wrapper to the write_ioc_string function to the IOC class
|
mandiant_ioc_writer
|
train
|
py
|
9b582affbdcf15f4945c7cdf50ad5215cf164fed
|
diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
+++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
@@ -660,7 +660,13 @@ module ActiveRecord
def insert_fixture(fixture, table_name) #:nodoc:
super
- klass = fixture.class_name.constantize rescue nil
+ if ActiveRecord::Base.pluralize_table_names
+ klass = table_name.singularize.camelize
+ else
+ klass = table_name.camelize
+ end
+
+ klass = klass.constantize rescue nil
if klass.respond_to?(:ancestors) && klass.ancestors.include?(ActiveRecord::Base)
write_lobs(table_name, klass, fixture)
end
|
derive the AR class name from the table name
|
rsim_oracle-enhanced
|
train
|
rb
|
233b12fbecbd1ddc93643e33154b9860b94a8eb9
|
diff --git a/comparison/src/test/java/io/wcm/caravan/hal/comparison/impl/properties/PropertyDiffDetectorTest.java b/comparison/src/test/java/io/wcm/caravan/hal/comparison/impl/properties/PropertyDiffDetectorTest.java
index <HASH>..<HASH> 100644
--- a/comparison/src/test/java/io/wcm/caravan/hal/comparison/impl/properties/PropertyDiffDetectorTest.java
+++ b/comparison/src/test/java/io/wcm/caravan/hal/comparison/impl/properties/PropertyDiffDetectorTest.java
@@ -84,6 +84,7 @@ public class PropertyDiffDetectorTest {
List<HalDifference> diffs = processor.process(context, expected, actual);
assertThat(diffs, hasSize(1));
assertEquals("/", diffs.get(0).getHalContext().toString());
+ assertEquals("", diffs.get(0).getHalContext().getLastRelation());
assertEquals(asString(expected), diffs.get(0).getExpectedJson());
assertEquals(asString(actual), diffs.get(0).getActualJson());
}
|
verify that HalResourceContet#getLastRelation can be called for the entry point resource
|
wcm-io-caravan_caravan-hal
|
train
|
java
|
16ed209afda30ceb9783c2c42e6761a97f354174
|
diff --git a/examples/with-razzle/src/index.js b/examples/with-razzle/src/index.js
index <HASH>..<HASH> 100644
--- a/examples/with-razzle/src/index.js
+++ b/examples/with-razzle/src/index.js
@@ -2,14 +2,17 @@ import http from 'http'
import app from './server'
const server = http.createServer(app.render)
+const PORT = process.env.PORT || 3000
let currentApp = app
-server.listen(process.env.PORT || 3000, error => {
- if (error) {
- console.log(error)
- }
+server.listen(PORT, error => {
+ if (error) console.log(error)
+ require('child_process').exec(`${
+ process.platform == 'darwin' ? 'open' : process.platform == 'win32' ? 'start' : 'xdg-open'
+ } http://localhost:${PORT}`)
+
console.log('🚀 started')
})
@@ -23,4 +26,4 @@ if (module.hot) {
server.on('request', newApp.render)
currentApp = newApp
})
-}
\ No newline at end of file
+}
|
Open in the browser when initialized
closes #<I>
|
alidcastano_rogue.js
|
train
|
js
|
94196064978299538be0068c5af94ed72d159abe
|
diff --git a/src/renderSchema.js b/src/renderSchema.js
index <HASH>..<HASH> 100644
--- a/src/renderSchema.js
+++ b/src/renderSchema.js
@@ -7,15 +7,20 @@ const marked = require('marked')
// an HTML tag. So in some places (like descriptions of the types themselves) we
// just output the raw description. In other places, like table cells, we need
// to output pre-rendered Markdown, otherwise GitHub won't interpret it.
-marked.setOptions({
- breaks: false
-})
+marked.setOptions({ gfm: true })
function markdown (markup) {
- return marked(markup || '')
- .replace(/<\/p>\s*<p>/g, '<br><br>')
- .replace(/<\/?p>/g, '')
+ let output = marked(markup || '')
+ // Join lines, unless the next line starts with a tag.
+ .replace(/\n(?!<)/g, ' ')
+ // Wrap after 80 characters.
+ .replace(/([^\n]{80,}?) /g, '$1\n')
.trim()
+ // If there's only one paragraph, unwrap it.
+ if (output.lastIndexOf('<p>') === 0 && output.endsWith('</p>')) {
+ output = output.slice(3, -4)
+ }
+ return output
}
function sortBy (arr, property) {
|
Update Markdown rendering to look better on GitHub (#2)
|
exogen_graphql-markdown
|
train
|
js
|
f4fa9ec44c3541481f9a42618f4541c8f88acc06
|
diff --git a/packages/material-ui/src/FilledInput/FilledInput.js b/packages/material-ui/src/FilledInput/FilledInput.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/FilledInput/FilledInput.js
+++ b/packages/material-ui/src/FilledInput/FilledInput.js
@@ -77,7 +77,7 @@ export const styles = theme => {
borderBottom: `1px solid ${theme.palette.text.primary}`,
},
'&$disabled:before': {
- borderBottom: `1px dotted ${bottomLineColor}`,
+ borderBottomStyle: 'dotted',
},
},
/* Styles applied to the root element if the component is focused. */
|
[FilledInput] Simplify border overrides (#<I>)
Simple fix for #<I>. Just changed the disable css style to only specify the border bottom style, instead of the entire border property. This will make overrides a little simpler.
Thanks!
Closes #<I>.
|
mui-org_material-ui
|
train
|
js
|
91f7c626935c5930ee871bfb3124070d58bd2ebf
|
diff --git a/lib/mongodb/db.js b/lib/mongodb/db.js
index <HASH>..<HASH> 100644
--- a/lib/mongodb/db.js
+++ b/lib/mongodb/db.js
@@ -895,7 +895,8 @@ Db.prototype.command = function(selector, options, callback) {
// Ensure only commands who support read Prefrences are exeuted otherwise override and use Primary
if(readPreference != false) {
if(selector['group'] || selector['aggregate'] || selector['collStats'] || selector['dbStats']
- || selector['count'] || selector['distinct'] || selector['geoNear'] || selector['geoSearch'] || selector['geoWalk']
+ || selector['count'] || selector['distinct'] || selector['geoNear'] || selector['geoSearch']
+ || selector['geoWalk'] || selector['text']
|| (selector['mapreduce'] && selector.out == 'inline')) {
// Set the read preference
cursor.setReadPreference(readPreference);
|
Added support for text command to use read preference #<I>
|
mongodb_node-mongodb-native
|
train
|
js
|
a37d1b70a57c7e67d908afc18466ef380ac01855
|
diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/machine.rb
+++ b/lib/vagrant/machine.rb
@@ -6,7 +6,6 @@ module Vagrant
# API for querying the state and making state changes to the machine, which
# is backed by any sort of provider (VirtualBox, VMware, etc.).
class Machine
- autoload :Client, "vagrant/machine/client"
autoload :Thick, "vagrant/machine/thick"
autoload :Thin, "vagrant/machine/thin"
|
Remove client autoload since it does not exist here
|
hashicorp_vagrant
|
train
|
rb
|
9e368b04307c51a440ba5aad0e9bbe5a9bb8134a
|
diff --git a/lib/cql/version.rb b/lib/cql/version.rb
index <HASH>..<HASH> 100644
--- a/lib/cql/version.rb
+++ b/lib/cql/version.rb
@@ -1,3 +1,3 @@
module CQL
- VERSION = '1.0.0'
+ VERSION = '1.0.1'
end
|
Version bump.
Incrementing the gem version to <I> in preparation for the upcoming
release.
|
enkessler_cql
|
train
|
rb
|
f5ce04dc14321ca9559e98394fb4faee7b563700
|
diff --git a/dist/brewser.js b/dist/brewser.js
index <HASH>..<HASH> 100644
--- a/dist/brewser.js
+++ b/dist/brewser.js
@@ -2,7 +2,7 @@
'use strict';
- if(window.BREWSER) {
+ if(global.BREWSER || typeof window === 'undefined') {
return;
}
|
support for isomorphic commonjs import
ran into this issue when ES6-importing this node module during meteor <I> beta testing
|
robertpataki_brewser
|
train
|
js
|
6bb086d7452f07d7de4a431d54882e5ca0df0f41
|
diff --git a/lib/podio/middleware/error_response.rb b/lib/podio/middleware/error_response.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/middleware/error_response.rb
+++ b/lib/podio/middleware/error_response.rb
@@ -12,10 +12,10 @@ module Podio
if finished_env[:body]['error_description'] =~ /expired_token/
raise Error::TokenExpired, finished_env[:body].inspect
else
- raise Error::AuthorizationError, finished_env[:body].inspect
+ raise Error::AuthorizationError, finished_env[:body]
end
when 403
- raise Error::AuthorizationError, finished_env[:body].inspect
+ raise Error::AuthorizationError, finished_env[:body]
when 404
raise Error::NotFoundError, "#{finished_env[:method].to_s.upcase} #{finished_env[:url]}"
when 410
|
Changed so error message on Auth erros from the API is passed along as a hash, rather than as a string
|
podio_podio-rb
|
train
|
rb
|
1317562435c398c4d462db7d1ea5e019229dc992
|
diff --git a/tlsobs/main.go b/tlsobs/main.go
index <HASH>..<HASH> 100644
--- a/tlsobs/main.go
+++ b/tlsobs/main.go
@@ -127,6 +127,7 @@ getresults:
fmt.Printf("\n")
if !results.Has_tls {
fmt.Printf("%s does not support SSL/TLS\n", target)
+ exitCode = 5
} else {
if *printRaw {
fmt.Printf("%s\n", body)
|
Exit with non zero code when target doesn't support TLS
|
mozilla_tls-observatory
|
train
|
go
|
a40ef46aa89135bd907823a9291a13fef5f96487
|
diff --git a/framework/core/src/Core/Handlers/Commands/UploadAvatarCommandHandler.php b/framework/core/src/Core/Handlers/Commands/UploadAvatarCommandHandler.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Core/Handlers/Commands/UploadAvatarCommandHandler.php
+++ b/framework/core/src/Core/Handlers/Commands/UploadAvatarCommandHandler.php
@@ -47,7 +47,9 @@ class UploadAvatarCommandHandler
'target' => $this->uploadDir,
]);
- // @todo delete old avatar
+ if ($mount->has($file = "target://$user->avatar_path")) {
+ $mount->delete($file);
+ }
$user->changeAvatarPath($uploadName);
|
Delete previous avatar when uploading a new one
|
flarum_core
|
train
|
php
|
624663e5eee7c3eab26c5dbafe0043d9e25cebb4
|
diff --git a/lib/gym/manager.rb b/lib/gym/manager.rb
index <HASH>..<HASH> 100644
--- a/lib/gym/manager.rb
+++ b/lib/gym/manager.rb
@@ -17,7 +17,8 @@ module Gym
rows << ["Workspace", config[:workspace]] if config[:workspace]
rows << ["Scheme", config[:scheme]] if config[:scheme]
rows << ["Configuration", config[:configuration]] if config[:configuration]
- rows << ["Xcode path", Gym.xcode_path]
+ rows << ["Platform", Gym.project.ios?? "iOS" : "Mac"]
+ rows << ["Xcode Path", Gym.xcode_path.gsub("/Contents/Developer", "")]
puts ""
puts Terminal::Table.new(
|
Added platform information to the summar & improved xcode path output
|
fastlane_fastlane
|
train
|
rb
|
5fbb2d6909113dca4ac28d80df65b87b60516917
|
diff --git a/lib/connect-mongo.js b/lib/connect-mongo.js
index <HASH>..<HASH> 100755
--- a/lib/connect-mongo.js
+++ b/lib/connect-mongo.js
@@ -146,9 +146,13 @@ module.exports = function(connect) {
break;
case 'interval':
- setInterval(function () {
+ self.timer = setInterval(function () {
self.collection.remove({ expires: { $lt: new Date() } }, { w: 0 });
}, options.autoRemoveInterval * 1000 * 60);
+ // node <0.8 compatibility
+ if (typeof self.timer.unref === 'function') {
+ self.timer.unref();
+ }
changeState('connected');
break;
|
Exposing timer as self.timer. Added timer.unref()
|
jdesboeufs_connect-mongo
|
train
|
js
|
2aab46ca4ae95c6c5ec8d28b3b39b768f034c179
|
diff --git a/charmhelpers/core/hookenv.py b/charmhelpers/core/hookenv.py
index <HASH>..<HASH> 100644
--- a/charmhelpers/core/hookenv.py
+++ b/charmhelpers/core/hookenv.py
@@ -67,7 +67,7 @@ def cached(func):
@wraps(func)
def wrapper(*args, **kwargs):
global cache
- key = str((func, args, kwargs))
+ key = json.dumps((str(func), args, kwargs), sort_keys=True)
try:
return cache[key]
except KeyError:
|
Ensure keys in cashed func args are sorted (#<I>)
Fixes #<I>
Supersedes #<I>
|
juju_charm-helpers
|
train
|
py
|
7111866dd884f9acdbac66ab7bd8779cd4823553
|
diff --git a/lib/modules/core/index.js b/lib/modules/core/index.js
index <HASH>..<HASH> 100644
--- a/lib/modules/core/index.js
+++ b/lib/modules/core/index.js
@@ -45,6 +45,7 @@ Archiver.prototype._abort = function() {
this._state.aborted = true;
this._queue.kill();
this._statQueue.kill();
+ this.end();
};
Archiver.prototype._append = function(filepath, data) {
|
core: end internal streams on abort.
|
archiverjs_node-archiver
|
train
|
js
|
b783bf29c28f0e8356ca9e3fa2dd44032d2c670e
|
diff --git a/includes/session.php b/includes/session.php
index <HASH>..<HASH> 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -72,6 +72,7 @@ define('WT_REGEX_UNSAFE', '[\x00-\xFF]*'); // Use with care and apply addition
define('WT_UTF8_BOM', "\xEF\xBB\xBF"); // U+FEFF
define('WT_UTF8_MALE', "\xE2\x99\x82"); // U+2642
define('WT_UTF8_FEMALE', "\xE2\x99\x80"); // U+2640
+define('WT_UTF8_NO_SEX', "\xE2\x9A\xAA"); // U+26AA
// UTF8 control codes affecting the BiDirectional algorithm (see http://www.unicode.org/reports/tr9/)
define('WT_UTF8_LRM', "\xE2\x80\x8E"); // U+200E (Left to Right mark: zero-width character with LTR directionality)
|
Add UTF8 symbol for "No sex", to complement the male/female symbols
|
fisharebest_webtrees
|
train
|
php
|
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.