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
|
---|---|---|---|---|---|
daf5a98cf666f2f525cf72efb9d8511f8acfc573 | diff --git a/h2o-core/src/test/java/water/TestUtil.java b/h2o-core/src/test/java/water/TestUtil.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/test/java/water/TestUtil.java
+++ b/h2o-core/src/test/java/water/TestUtil.java
@@ -12,6 +12,7 @@ import org.junit.runners.model.Statement;
import org.junit.runner.Description;
import water.fvec.*;
import water.parser.ParseDataset;
+import water.util.FrameUtils;
import water.util.Log;
import water.util.Timer;
import water.parser.ValueString;
@@ -185,6 +186,7 @@ public class TestUtil extends Iced {
}
public static Frame frame(double[]... rows) { return frame(null,rows); }
public static Frame frame(String[] names, double[]... rows) { return frame(Key.make(),names,rows); }
+ public static Frame frame(String name, Vec vec) { Frame f = new Frame(); f.add(name, vec); return f; }
// Shortcuts for initializing constant arrays
public static String[] ar (String ...a) { return a; } | Add factory method for Frame from named Vec. | h2oai_h2o-3 | train | java |
e8dbe06605c28c9a94e94afff2d96ab736b9dc3d | diff --git a/Neos.Neos/Tests/Functional/Fusion/Cache/ContentCacheFlusherTest.php b/Neos.Neos/Tests/Functional/Fusion/Cache/ContentCacheFlusherTest.php
index <HASH>..<HASH> 100644
--- a/Neos.Neos/Tests/Functional/Fusion/Cache/ContentCacheFlusherTest.php
+++ b/Neos.Neos/Tests/Functional/Fusion/Cache/ContentCacheFlusherTest.php
@@ -1,5 +1,4 @@
<?php
-
namespace Neos\Neos\Tests\Functional\Fusion\Cache;
/*
@@ -54,9 +53,6 @@ class ContentCacheFlusherTest extends FunctionalTestCase
*/
protected $nodeDataRepository;
- /**
- *
- */
public function setUp()/* The :void return type declaration that should be here would cause a BC issue */
{
parent::setUp();
@@ -79,9 +75,6 @@ class ContentCacheFlusherTest extends FunctionalTestCase
$this->persistenceManager->clearState();
}
- /**
- *
- */
public function flushingANodeWillResolveAllWorkspacesToFlush()
{
// Add more workspaces | BUGFIX: Remove empty comments | neos_neos-development-collection | train | php |
b0c730d27843ca974ec494298bd08c82b58d3e99 | diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb
index <HASH>..<HASH> 100644
--- a/test/test_kramdown.rb
+++ b/test/test_kramdown.rb
@@ -14,6 +14,7 @@ class TestKramdown < JekyllUnitTest
'auto_ids' => false,
'footnote_nr' => 1,
+ 'syntax_highlighter' => 'rouge',
'syntax_highlighter_opts' => {
'bold_every' => 8, 'css' => :class
} | kramdown: fix state leakage (#<I>) in test
fixes #<I> | jekyll_jekyll | train | rb |
f7877adf17f543fb049fa27a3dffd55fc85c0768 | diff --git a/lib/ztk/rake/docs.rb b/lib/ztk/rake/docs.rb
index <HASH>..<HASH> 100644
--- a/lib/ztk/rake/docs.rb
+++ b/lib/ztk/rake/docs.rb
@@ -41,7 +41,7 @@ namespace :docs do
Dir.chdir(DOC_PATH) do
system(%(git add -Av))
- system(%(git commit -m"#{commit_message.join}"))
+ system(%(git commit -S -m"#{commit_message.join}"))
system(%(git push origin gh-pages))
end
end | start gpg signing our document commits | zpatten_ztk | train | rb |
415746a1bb2079a9e5bb58cc84627badba9e61fb | diff --git a/lib/dew/commands/deploy.rb b/lib/dew/commands/deploy.rb
index <HASH>..<HASH> 100755
--- a/lib/dew/commands/deploy.rb
+++ b/lib/dew/commands/deploy.rb
@@ -45,6 +45,7 @@ class DeployCommand < Clamp::Command
end
env = Environment.get(environment_name)
+ raise "Unknown environment #{environment_name}" unless env
db_managed = false | Bail with error if environment unrecognized when deploying | playup_dew | train | rb |
3868b7719ef2910a213674078ca60528a6dab413 | diff --git a/components/dashboards-web-component/src/utils/Theme.js b/components/dashboards-web-component/src/utils/Theme.js
index <HASH>..<HASH> 100644
--- a/components/dashboards-web-component/src/utils/Theme.js
+++ b/components/dashboards-web-component/src/utils/Theme.js
@@ -62,7 +62,7 @@ export const lightTheme = getMuiTheme(lightBaseTheme,
trackOffColor: Colors.grey500,
thumbOffColor: Colors.grey700,
},
- },
+ }
);
export default darkTheme; | Remove unnecessary comma in Theme. | wso2_carbon-dashboards | train | js |
2aa2a1db545316ec520645867f756924d882d663 | diff --git a/utp.go b/utp.go
index <HASH>..<HASH> 100644
--- a/utp.go
+++ b/utp.go
@@ -1021,6 +1021,9 @@ func (c *Conn) ackSkipped(seqNr uint16) {
return
}
send.acksSkipped++
+ if send.resend == nil {
+ return
+ }
switch send.acksSkipped {
case 3, 60:
ackSkippedResends.Add(1) | Don't resend packet when ack is skipped if it's already acked | anacrolix_utp | train | go |
8acd1afd9238a2463f78c2660a9b0a5f4e0f9ab6 | diff --git a/dist/select.js b/dist/select.js
index <HASH>..<HASH> 100644
--- a/dist/select.js
+++ b/dist/select.js
@@ -394,7 +394,7 @@ uis.controller('uiSelectCtrl',
$scope.$uisSource = Object.keys(originalSource($scope)).map(function(v){
var result = {};
result[ctrl.parserResult.keyName] = v;
- result.value = $scope.peopleObj[v];
+ result.value = $scope[ctrl.parserResult.sourceName][v];
return result;
});
}; | remove hardcoded $scope.peopleObj | angular-ui_ui-select | train | js |
8255256b171a4eb6082878a68d90305c4bbd7ee7 | diff --git a/spam_lists/structures.py b/spam_lists/structures.py
index <HASH>..<HASH> 100644
--- a/spam_lists/structures.py
+++ b/spam_lists/structures.py
@@ -142,6 +142,12 @@ class Hostname(name.Name):
class IPAddress(object):
+ ''' A class of objects representing IP address values.
+
+ The instances are used as values tested by clients of
+ IP-address-listing services or as items stored by objects
+ representing such IP address lists.
+ '''
reverse_domain = None
@property
def relative_domain(self): | Add docstring to IPAddress class | piotr-rusin_spam-lists | train | py |
7721eb88c8a0e3f6bfcc4adabbed1802b57612e7 | diff --git a/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/NavigationViewModel.java b/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/NavigationViewModel.java
index <HASH>..<HASH> 100644
--- a/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/NavigationViewModel.java
+++ b/libnavigation-ui/src/main/java/com/mapbox/navigation/ui/NavigationViewModel.java
@@ -465,8 +465,7 @@ public class NavigationViewModel extends AndroidViewModel {
}
}
- private void updateReplayEngine(DirectionsRoute route) {
- locationEngineConductor.updateSimulatedRoute(route);
+ private void updateReplayEngine(DirectionsRoute route) { locationEngineConductor.updateSimulatedRoute(route);
}
private void endNavigation() { | [ui] register location observer fix | mapbox_mapbox-navigation-android | train | java |
b46535f93ecb06a8eb6bf5b43e4ac046182aaace | diff --git a/packages/extract-svg-sprite-webpack-plugin/lib/utils/replacement-generator.js b/packages/extract-svg-sprite-webpack-plugin/lib/utils/replacement-generator.js
index <HASH>..<HASH> 100644
--- a/packages/extract-svg-sprite-webpack-plugin/lib/utils/replacement-generator.js
+++ b/packages/extract-svg-sprite-webpack-plugin/lib/utils/replacement-generator.js
@@ -42,14 +42,14 @@ class ReplacementGenerator {
* @return {Replacement}
*/
static symbolUrl(symbol, config) {
- const { filename, emit, spriteType, sriteConfig } = config;
+ const { filename, emit, spriteType, spriteConfig } = config;
let replaceTo;
if (!filename || !emit) {
replaceTo = `#${symbol.id}`;
} else {
replaceTo = spriteType === mixer.StackSprite.TYPE
- ? `${filename}#${symbol.id}${sriteConfig.usageIdSuffix}`
+ ? `${filename}#${symbol.id}${spriteConfig.usageIdSuffix}`
: filename;
} | fix: typo (#<I>) | JetBrains_svg-mixer | train | js |
41036c8cfcf9d96b6b7293ff526a8f7acca98851 | diff --git a/grunt/connect-middleware/sources.js b/grunt/connect-middleware/sources.js
index <HASH>..<HASH> 100644
--- a/grunt/connect-middleware/sources.js
+++ b/grunt/connect-middleware/sources.js
@@ -59,9 +59,10 @@ const
"/src/sources.json?map": response => {
response.setHeader("Content-Type", "application/json");
cachedUglifyResult = null; // Reset cache
- return response.end(JSON.stringify([{
+ response.end(JSON.stringify([{
"name": "sources"
}]));
+ return Promise.resolve();
},
"/src/sources.js": response => { | Fixing harmless error (#<I>) | ArnaudBuchholz_gpf-js | train | js |
b3ca083023842f2b7bb440476405a9a2508b4aaf | diff --git a/code/FontAwesomeIconPickerField.php b/code/FontAwesomeIconPickerField.php
index <HASH>..<HASH> 100644
--- a/code/FontAwesomeIconPickerField.php
+++ b/code/FontAwesomeIconPickerField.php
@@ -17,6 +17,7 @@ class FontAwesomeIconPickerField extends TextField {
Requirements::css('//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css');
Requirements::css('//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');
Requirements::css(FONTAWESOMEICONPICKER_DIR . '/code/thirdparty/fontawesome-iconpicker-1.0.0/dist/css/fontawesome-iconpicker.min.css');
+ Requirements::customCSS('* { box-sizing: content-box; }');
Requirements::set_force_js_to_bottom(true);
Requirements::javascript(FONTAWESOMEICONPICKER_DIR . '/code/thirdparty/fontawesome-iconpicker-1.0.0/dist/js/fontawesome-iconpicker.js'); | change fontawesome picker styling from border-box to content-box | dljoseph_silverstripe-fontawesome-iconpickerfield | train | php |
940b1b146f7c97fe7dbf66e490f9bb667a3c6176 | diff --git a/lib/exonio/financial.rb b/lib/exonio/financial.rb
index <HASH>..<HASH> 100644
--- a/lib/exonio/financial.rb
+++ b/lib/exonio/financial.rb
@@ -135,7 +135,7 @@ module Exonio
begin
temp = newton_iter(guess, nper, pmt, pv, fv, end_or_beginning)
- next_guess = guess - temp
+ next_guess = (guess - temp).round(20)
diff = (next_guess - guess).abs
close = diff < tolerancy
guess = next_guess
diff --git a/spec/financial_spec.rb b/spec/financial_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/financial_spec.rb
+++ b/spec/financial_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
+require 'bigdecimal'
describe Exonio::Financial do
describe '#fv' do
@@ -166,5 +167,16 @@ describe Exonio::Financial do
expect(results).to eq(0.07265012823626603)
end
+
+ context 'with large decimal scale' do
+ let(:pmt) { BigDecimal.new("351.622169863986539264256777349669281495") }
+ let(:pv) { BigDecimal.new("-3061.762000011") }
+
+ it 'computes rate' do
+ results = Exonio.rate(nper, pmt, pv) * 100
+
+ expect(results.round(2)).to eq(5.32)
+ end
+ end
end
end | fix infinite loop with bigscale on RATE method | noverde_exonio | train | rb,rb |
03af7085a19c79245963975bd15421bd96cde095 | diff --git a/Resources/public/js/resource/manager.js b/Resources/public/js/resource/manager.js
index <HASH>..<HASH> 100644
--- a/Resources/public/js/resource/manager.js
+++ b/Resources/public/js/resource/manager.js
@@ -769,10 +769,11 @@
'create': function (event) {
this.create(event.action, event.data, event.nodeId);
},
- 'delete': function () {
+ 'delete': function (event) {
var ids = [];
- $('.node-thumbnail input[type=checkbox]:checked').each(function () {
- ids.push($($(this).parents('.node-thumbnail').get(0)).attr('id'));
+
+ $(event.ids).each(function (index) {
+ ids.push(event.ids[index]);
});
if (ids.length >= 1) { | [CoreBundle] Fixing res manager delete menu option. | claroline_Distribution | train | js |
15501ffde0b6eb04b35dc5e562159adbf52058d3 | diff --git a/src/Hal/Report/Html/template/index.php b/src/Hal/Report/Html/template/index.php
index <HASH>..<HASH> 100644
--- a/src/Hal/Report/Html/template/index.php
+++ b/src/Hal/Report/Html/template/index.php
@@ -141,7 +141,10 @@
<td><?php echo $package->name; ?></td>
<td><?php echo $package->required; ?></td>
<td><?php echo $package->latest; ?></td>
- <td><?php echo implode(', ', $package->license); ?></td>
+ <td><?php foreach($package->license as $license) { ?>
+ <a target="_blank" href="https://spdx.org/licenses/<?php echo $license;?>.html"><?php echo $license;?></a>
+ <?php }; ?>
+ </td>
</tr>
<?php } ?>
</tbody> | added link to spdx license in composer report | phpmetrics_PhpMetrics | train | php |
c9731b2c2a4ac68d9f895e7513c014744629e406 | diff --git a/hugolib/page.go b/hugolib/page.go
index <HASH>..<HASH> 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -1506,8 +1506,8 @@ func (p *Page) copy() *Page {
}
func (p *Page) Now() time.Time {
- // Delete in Hugo 0.21
- helpers.Deprecated("Page", "Now", "Use now (the template func)", true)
+ // Delete in Hugo 0.22
+ helpers.Deprecated("Page", "Now", "Use now (the template func)", false)
return time.Now()
} | hugolib: Delay deletion of Page.Now()
Looking at the state of the themes, it will be too painful to log ERROR now. | gohugoio_hugo | train | go |
78cb8411ee533efd7ea499b10dcc9f839d2ebcf1 | diff --git a/src/main/java/com/tascape/qa/th/AbstractTestResource.java b/src/main/java/com/tascape/qa/th/AbstractTestResource.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/tascape/qa/th/AbstractTestResource.java
+++ b/src/main/java/com/tascape/qa/th/AbstractTestResource.java
@@ -36,10 +36,11 @@ public abstract class AbstractTestResource {
public File saveAsTextFile(String filePrefix, CharSequence data) throws IOException {
Path path = this.getLogPath();
- if (!path.toFile().mkdirs()) {
- throw new IOException("Cannot create test log directory " + path);
+ File p = path.toFile();
+ if (!p.exists() && !p.mkdirs()) {
+ throw new IOException("Cannot create test log directory " + p);
}
- File f = File.createTempFile(filePrefix, ".txt", path.toFile());
+ File f = File.createTempFile(filePrefix, ".txt", p);
FileUtils.write(f, data);
LOG.debug("Save data into file {}", f.getAbsolutePath());
return f; | fix a problem of creating log dir | wanglinsong_testharness | train | java |
66d88c9193668a4d207d4b3a0ff792393a48e44b | diff --git a/tests/test_write.py b/tests/test_write.py
index <HASH>..<HASH> 100644
--- a/tests/test_write.py
+++ b/tests/test_write.py
@@ -27,15 +27,13 @@
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from os.path import join
-
import pytest
import uproot
def test_strings(tmp_path):
ROOT = pytest.importorskip("ROOT")
- filename = join(tmp_path, 'example.root')
+ filename = tmp_path/'example.root'
with uproot.recreate(filename) as f:
f['hello'] = 'world' | Fix use of paths in Python <I> | scikit-hep_uproot | train | py |
953f2750b3c9fcf5587d22215b188bece87784ba | diff --git a/elasticsearch-api/utils/thor/generate_source.rb b/elasticsearch-api/utils/thor/generate_source.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-api/utils/thor/generate_source.rb
+++ b/elasticsearch-api/utils/thor/generate_source.rb
@@ -161,6 +161,7 @@ module Elasticsearch
def __parse_path(path)
path.gsub(/^\//, '')
+ .gsub(/\/$/, '')
.gsub('{', '#{Elasticsearch::API::Utils.__listify(_')
.gsub('}', ')}')
end | [API] Generator: remove trailing / from paths | elastic_elasticsearch-ruby | train | rb |
fe6fa03e992d574cbf61821d18b8187408fc42da | diff --git a/src/main/java/org/dita/dost/util/FileUtils.java b/src/main/java/org/dita/dost/util/FileUtils.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/dita/dost/util/FileUtils.java
+++ b/src/main/java/org/dita/dost/util/FileUtils.java
@@ -12,7 +12,6 @@ import static org.apache.commons.io.FilenameUtils.*;
import static org.dita.dost.util.Constants.*;
import java.io.File;
-import java.io.IOException;
import java.net.URI;
import java.util.*;
@@ -185,7 +184,7 @@ public final class FileUtils {
* @return relative path
*/
public static File getRelativePath(final File basePath, final File refPath) {
- return new File(getRelativePath(basePath.getPath(), refPath.getPath(), File.separator));
+ return basePath.toPath().getParent().relativize(refPath.toPath()).toFile();
}
/** | Use NIO Path for file path processing instead of custom code | dita-ot_dita-ot | train | java |
e432ddd424434c9cdd7210ec1337c3ecd451c84a | diff --git a/gsh/stdin.py b/gsh/stdin.py
index <HASH>..<HASH> 100644
--- a/gsh/stdin.py
+++ b/gsh/stdin.py
@@ -173,6 +173,10 @@ class pipe_notification_reader(asyncore.file_dispatcher):
else:
self._do(c)
+ def writable(self):
+ """That's a reader"""
+ return False
+
# All the words that have been typed in gsh. Used by the completion mechanism.
history_words = set() | Strange that we could get away without that. | innogames_polysh | train | py |
7388558371302b4b643b5f8236d2e4835d218daa | diff --git a/lib/util/token.js b/lib/util/token.js
index <HASH>..<HASH> 100644
--- a/lib/util/token.js
+++ b/lib/util/token.js
@@ -74,7 +74,7 @@ function removeInBetween(startToken, endToken, check){
remove(startToken);
}
}
- else if (startToken.type === check) {
+ else if (startToken.type === check || startToken.value === check) {
remove(startToken);
}
startToken = startToken.next;
@@ -91,7 +91,7 @@ function findInBetween(startToken, endToken, check){
found = startToken;
}
}
- else if (startToken.type === check) {
+ else if (startToken.type === check || startToken.value === check) {
found = startToken;
}
startToken = startToken.next;
@@ -118,7 +118,7 @@ function removeAdjacentBefore(token, check){
prev = prev.prev;
}
} else {
- while (prev && prev.type === check) {
+ while (prev && (prev.type === check || prev.value === check)) {
remove(prev);
prev = prev.prev;
}
@@ -135,7 +135,7 @@ function removeAdjacentAfter(token, check){
next = next.next;
}
} else {
- while (next && next.type === check) {
+ while (next && (next.type === check || next.value === check)) {
remove(next);
next = next.next;
} | improve token helpers to accept token.value instead of callback. closes #<I> | millermedeiros_esformatter | train | js |
cfe051797c6f94a5d53bcd2e262af31bf1a82db3 | diff --git a/tests/CallableResolverTest.php b/tests/CallableResolverTest.php
index <HASH>..<HASH> 100644
--- a/tests/CallableResolverTest.php
+++ b/tests/CallableResolverTest.php
@@ -13,7 +13,9 @@ use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Container\ContainerInterface;
use Slim\CallableResolver;
+use Slim\Interfaces\ErrorRendererInterface;
use Slim\Tests\Mocks\CallableTest;
+use Slim\Tests\Mocks\ErrorRendererTest;
use Slim\Tests\Mocks\InvokableTest;
use Slim\Tests\Mocks\RequestHandlerTest;
@@ -158,6 +160,16 @@ class CallableResolverTest extends TestCase
$this->assertEquals('custom', $callable[1]);
}
+ public function testObjErrorRendererClass()
+ {
+ $obj = new ErrorRendererTest();
+ $resolver = $this->getCallableResolver();
+ $callable = $resolver->resolve($obj);
+
+ $this->assertIsCallable($callable);
+ $this->assertInstanceOf(ErrorRendererInterface::class, $callable[0]);
+ }
+
/**
* @expectedException \RuntimeException
*/ | Add test case if the object to be resolved is an instance of an error renderer | slimphp_Slim | train | php |
126c425496832d81dcccd1e7668e32918a8ad0e5 | diff --git a/lib/jets/spec_helpers/controllers.rb b/lib/jets/spec_helpers/controllers.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/spec_helpers/controllers.rb
+++ b/lib/jets/spec_helpers/controllers.rb
@@ -2,12 +2,11 @@ module Jets::SpecHelpers
module Controllers
include Jets::Router::Helpers # must be at the top because response is overridden later
- attr_reader :request, :response
-
- def initialize(*)
- super
- @request = Request.new(:get, '/', {}, Params.new)
- @response = nil # will be set after http_call
+ attr_reader :response
+ # Note: caching it like this instead of within the initialize results in the headers not being cached
+ # See: https://community.rubyonjets.com/t/is-jets-spechelpers-controllers-request-being-cached/244/2
+ def request
+ @request ||= Request.new(:get, '/', {}, Params.new)
end
rest_methods = %w[get post put patch delete] | spec helpers: dont cache requeset headers between specs | tongueroo_jets | train | rb |
8445943d74a1f2f0d96354486f2bcc8287e0e8c9 | diff --git a/src/model.js b/src/model.js
index <HASH>..<HASH> 100644
--- a/src/model.js
+++ b/src/model.js
@@ -105,7 +105,9 @@ export function add (model, key, field) {
* @returns {Model} - the updated model.
*/
export function remove (model, key, field) {
- // TODO: bug - verify that the field is there to remove in the first place
+ if (get(model, key).filter(f => f._id === field._id).length === 0) {
+ return model
+ }
return createModel(
model.subject,
model.fields.set(
diff --git a/test/model.spec.js b/test/model.spec.js
index <HASH>..<HASH> 100644
--- a/test/model.spec.js
+++ b/test/model.spec.js
@@ -96,6 +96,11 @@ describe('Model', () => {
expect(Model.get(updatedModel, 'phone')).toEqual([secondPhone])
})
+ it('can not remove fields which do not belong to the model', () => {
+ const notOwnedPhone = phone('tel:444-444-4444')
+ expect(Model.remove(model, 'phone', phone)).toEqual(model)
+ })
+
it('can change the value of contained fields', () => {
const firstPhone = Model.get(model, 'phone')[0]
const secondPhone = Model.get(model, 'phone')[1] | Don't remove un-owned fields from a model | dan-f_modelld | train | js,js |
4ebb37610b0b98633921f0db9faca044614f6633 | diff --git a/test/d3-funnel/d3-funnel.js b/test/d3-funnel/d3-funnel.js
index <HASH>..<HASH> 100644
--- a/test/d3-funnel/d3-funnel.js
+++ b/test/d3-funnel/d3-funnel.js
@@ -372,9 +372,9 @@ describe('D3Funnel', () => {
const paths = d3.selectAll('#funnel path');
- const quadraticPaths = paths.filter(() =>
- d3.select(this).attr('d').indexOf('Q') > -1
- );
+ const quadraticPaths = paths.filter(function () { // eslint-disable-line func-names
+ return d3.select(this).attr('d').indexOf('Q') > -1;
+ });
assert.equal(paths[0].length, quadraticPaths[0].length);
}); | Prevent lexical binding of `this` in chart.curve.enabled test | jakezatecky_d3-funnel | train | js |
0c7c92864f95441e5a828df7a5665f3cb11b2716 | diff --git a/lib/node_modules/@stdlib/repl/lib/context/math/constants.js b/lib/node_modules/@stdlib/repl/lib/context/math/constants.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/repl/lib/context/math/constants.js
+++ b/lib/node_modules/@stdlib/repl/lib/context/math/constants.js
@@ -18,6 +18,7 @@ NS.EPS = require( '@stdlib/math/constants/float64-eps' );
NS.EULERGAMMA = require( '@stdlib/math/constants/float64-eulergamma' );
NS.FLOAT64_EXPONENT_BIAS = require( '@stdlib/math/constants/float64-exponent-bias' );
NS.GLAISHER = require( '@stdlib/math/constants/float64-glaisher-kinkelin' );
+NS.HALF_LN2 = require( '@stdlib/math/constants/float64-half-ln2' );
NS.LN_SQRT_TWO_PI = require( '@stdlib/math/constants/float64-ln-sqrt-two-pi' );
NS.LN2 = require( '@stdlib/math/constants/float64-ln2' );
NS.FLOAT64_MAX = require( '@stdlib/math/constants/float64-max' ); | Add HALF_LN2 to REPL context | stdlib-js_stdlib | train | js |
299cd811bb412554d3ca94fe273b7e76cda8a205 | diff --git a/src/Naderman/Composer/AWS/AwsPlugin.php b/src/Naderman/Composer/AWS/AwsPlugin.php
index <HASH>..<HASH> 100644
--- a/src/Naderman/Composer/AWS/AwsPlugin.php
+++ b/src/Naderman/Composer/AWS/AwsPlugin.php
@@ -28,16 +28,12 @@ class AwsPlugin implements PluginInterface, EventSubscriberInterface
protected $composer;
protected $io;
- public function __construct(Composer $composer, IOInterface $io)
+ public function activate(Composer $composer, IOInterface $io)
{
$this->composer = $composer;
$this->io = $io;
}
- public function activate()
- {
- }
-
public static function getSubscribedEvents()
{
return array( | The composer plugin interface was changed to pass args to activate | naderman_composer-aws | train | php |
6504d4f7005c99ea4064068f3d712322a064b97a | diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index <HASH>..<HASH> 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -316,6 +316,28 @@ test(".ajax() - headers" , function() {
});
+test(".ajax() - Accept header" , function() {
+
+ expect( 1 );
+
+ stop();
+
+ jQuery.ajax(url("data/headers.php?keys=accept"), {
+ headers: {
+ Accept: "very wrong accept value"
+ },
+ beforeSend: function( xhr ) {
+ xhr.setRequestHeader( "Accept", "*/*" );
+ },
+ success: function( data ) {
+ strictEqual( data , "accept: */*\n" , "Test Accept header is set to last value provided" );
+ start();
+ },
+ error: function(){ ok(false, "error"); }
+ });
+
+});
+
test(".ajax() - contentType" , function() {
expect( 2 ); | Fixes #<I>. Added a unit test to control that, since the ajax rewrite, setting the Accept header actually replaced the previous value and didn't append to it (tested in Safari <I> for which the problem was specifically reported). | jquery_jquery | train | js |
2e8c1b5b3a5239d8c45f6f0256794f4a51dd298d | diff --git a/src/main/java/rx/internal/operators/OperatorMerge.java b/src/main/java/rx/internal/operators/OperatorMerge.java
index <HASH>..<HASH> 100644
--- a/src/main/java/rx/internal/operators/OperatorMerge.java
+++ b/src/main/java/rx/internal/operators/OperatorMerge.java
@@ -72,9 +72,6 @@ public class OperatorMerge<T> implements Operator<T, Observable<? extends T>> {
* I'd love to have contributions that improve this class, but keep in mind the performance and GC pressure.
* The benchmarks I use are in the JMH OperatorMergePerf class. GC memory pressure is tested using Java Flight Recorder
* to track object allocation.
- *
- * TODO There is still a known concurrency bug somewhere either in this class, in SubscriptionIndexedRingBuffer or their relationship.
- * See https://github.com/ReactiveX/RxJava/issues/1420 for more information on this.
*/
public OperatorMerge() { | Remove Comment
This comment is no longer correct. <I> was resolved. | ReactiveX_RxJava | train | java |
737c1ce5262f1ce337cb672dfe814c0606e446a3 | diff --git a/js/btcmarkets.js b/js/btcmarkets.js
index <HASH>..<HASH> 100644
--- a/js/btcmarkets.js
+++ b/js/btcmarkets.js
@@ -332,7 +332,7 @@ module.exports = class btcmarkets extends Exchange {
return this.parseOrder (order);
}
- async prepareHistoryRequest (market, since = undefined, limit = undefined) {
+ prepareHistoryRequest (market, since = undefined, limit = undefined) {
let request = this.ordered ({
'currency': market['quote'],
'instrument': market['base'], | BTCMarkets: Fix fetchOrders, fetchOpenOrders, fetchMyTrades
`prepareHistoryRequest` is declared as `async` function, but used synchronously, which makes `fetchOrders`, `fetchOpenOrders`, `fetchMyTrades` fail. Removing `async` fixes the error. | ccxt_ccxt | train | js |
451ec7c0f7bd7a799d81916b329eab6e328cf6ab | diff --git a/app/code/community/Aoe/Scheduler/Model/Observer.php b/app/code/community/Aoe/Scheduler/Model/Observer.php
index <HASH>..<HASH> 100755
--- a/app/code/community/Aoe/Scheduler/Model/Observer.php
+++ b/app/code/community/Aoe/Scheduler/Model/Observer.php
@@ -78,8 +78,8 @@ class Aoe_Scheduler_Model_Observer /* extends Mage_Cron_Model_Observer */
do {
$reason = ($repetition == 0) ? Aoe_Scheduler_Model_Schedule::REASON_ALWAYS : Aoe_Scheduler_Model_Schedule::REASON_REPEAT;
$schedule = $scheduleManager->getScheduleForAlwaysJob($job->getJobCode(), $reason);
- $schedule->setRepetition($repetition); // this is not persisted, but can be access from within the callback
if ($schedule !== false) {
+ $schedule->setRepetition($repetition); // this is not persisted, but can be access from within the callback
$schedule->process();
}
$repetition++; | Move setRepetition method call into condition check | AOEpeople_Aoe_Scheduler | train | php |
7074d2fd392b8e7568141ad2057e942fc5c5201c | diff --git a/pkg/controller/daemon/daemoncontroller.go b/pkg/controller/daemon/daemoncontroller.go
index <HASH>..<HASH> 100644
--- a/pkg/controller/daemon/daemoncontroller.go
+++ b/pkg/controller/daemon/daemoncontroller.go
@@ -480,7 +480,10 @@ func (dsc *DaemonSetsController) manage(ds *extensions.DaemonSet) error {
for i := range daemonPods {
pod := daemonPods[i]
if pod.Status.Phase == v1.PodFailed {
- glog.V(2).Infof("Found failed daemon pod %s/%s on node %s, will try to kill it", pod.Namespace, node.Name, pod.Name)
+ msg := fmt.Sprintf("Found failed daemon pod %s/%s on node %s, will try to kill it", pod.Namespace, node.Name, pod.Name)
+ glog.V(2).Infof(msg)
+ // Emit an event so that it's discoverable to users.
+ dsc.eventRecorder.Eventf(ds, v1.EventTypeWarning, "FailedDaemonPod", msg)
podsToDelete = append(podsToDelete, pod.Name)
failedPodsObserved++
} else { | Emit events on 'Failed' daemon pods | kubernetes_kubernetes | train | go |
d420937be4ed2889ff8f15ceba0dc01b8b09a0a4 | diff --git a/pysnmp/proto/proxy/rfc2576.py b/pysnmp/proto/proxy/rfc2576.py
index <HASH>..<HASH> 100644
--- a/pysnmp/proto/proxy/rfc2576.py
+++ b/pysnmp/proto/proxy/rfc2576.py
@@ -283,14 +283,7 @@ def v2ToV1(v2Pdu, origV1Pdu=None):
# Translate Var-Binds
for oid, v2Val in v2VarBinds:
- # 2.1.1.11
- if v2Val.tagSet == v2c.IpAddress.tagSet:
- v1Val = v1.NetworkAddress().setComponentByPosition(
- 0, __v2ToV1ValueMap[v2Val.tagSet].clone(v2Val)
- )
- else:
- v1Val = __v2ToV1ValueMap[v2Val.tagSet].clone(v2Val)
- v1VarBinds.append((oid, v1Val))
+ v1VarBinds.append((oid, __v2ToV1ValueMap[v2Val.tagSet].clone(v2Val)))
if rfc3411.notificationClassPDUs.has_key(pduType):
v1.apiTrapPDU.setVarBinds(v1Pdu, v1VarBinds) | fix to IpAddress translation to match it with setVarBinds() API | etingof_pysnmp | train | py |
7de7c7a497478998d5adc1567a0e71f79b835f14 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "jekyll"
require "jekyll-seo-tag"
-require "html/proofer"
+require "html-proofer"
ENV["JEKYLL_LOG_LEVEL"] = "error" | require html-proofer, not html/proofer | jekyll_jekyll-seo-tag | train | rb |
13fe4283c2fc4eb90758a3e29a9778480c731b7c | diff --git a/fluids/particle_size_distribution.py b/fluids/particle_size_distribution.py
index <HASH>..<HASH> 100644
--- a/fluids/particle_size_distribution.py
+++ b/fluids/particle_size_distribution.py
@@ -1491,7 +1491,7 @@ class ParticleSizeDistributionContinuous(object):
--------
>>> psd = PSDLognormal(s=0.5, d_characteristic=5E-6, order=3)
>>> psd.fractions_discrete([1e-6, 1e-5, 1e-4, 1e-3])
- [0.000643471012913, 0.916528009985, 0.0828285179619, 1.039798247504e-09]
+ [0.00064347101291, 0.916528009985, 0.0828285179619, 1.039798e-09]
'''
cdfs = [self.cdf(d, n=n) for d in ds]
return [cdfs[0]] + diff(cdfs) | Another CI fix for appveyor | CalebBell_fluids | train | py |
2cdb3cff65f530b534a64f7779fb177e6dcec332 | diff --git a/core/Spirit.php b/core/Spirit.php
index <HASH>..<HASH> 100644
--- a/core/Spirit.php
+++ b/core/Spirit.php
@@ -16,7 +16,7 @@ class Spirit
const LOG_ERROR = 'ERROR';
protected static $instance = null;
- protected static $useColoredTerminalOutput = true;
+ protected static $useColoredTerminalOutput = false;
/**
* @return bool | Version <I>
Console Color Output Support Switch inside Spirit
Take it as off as default | sinri_enoch | train | php |
778ffbfb823672a5158529511bccd2957614bde3 | diff --git a/h2o-algos/src/main/java/hex/schemas/SharedTreeV3.java b/h2o-algos/src/main/java/hex/schemas/SharedTreeV3.java
index <HASH>..<HASH> 100755
--- a/h2o-algos/src/main/java/hex/schemas/SharedTreeV3.java
+++ b/h2o-algos/src/main/java/hex/schemas/SharedTreeV3.java
@@ -40,7 +40,7 @@ public class SharedTreeV3<B extends SharedTree, S extends SharedTreeV3<B,S,P>, P
/**
* The maximum number (top K) of predictions to use for hit ratio computation (for multi-class only, 0 to disable)
*/
- @API(help = "Max. number (top K) of predictions to use for hit ratio computation (for multi-class only, 0 to disable)", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = true)
+ @API(help = "Max. number (top K) of predictions to use for hit ratio computation (for multi-class only, 0 to disable)", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = false)
public int max_hit_ratio_k;
@API(help="Number of trees.", gridable = true) | No longer let max_hit_ratio_k be gridable - it's not a hyper-parameter. | h2oai_h2o-3 | train | java |
7539d454f26d4e7dc6b6564aac057cdff34c54f6 | diff --git a/components/pager/pager.js b/components/pager/pager.js
index <HASH>..<HASH> 100644
--- a/components/pager/pager.js
+++ b/components/pager/pager.js
@@ -10,8 +10,7 @@
/* eslint-disable react/jsx-no-literals */
/* eslint-disable no-magic-numbers */
-import React, {PropTypes} from 'react';
-import RingComponent from '../ring-component/ring-component';
+import React, {PureComponent, PropTypes} from 'react';
import Button from '../button/button';
import ButtonGroup from '../button-group/button-group';
import ButtonToolbar from '../button-toolbar/button-toolbar';
@@ -20,7 +19,7 @@ import classNames from 'classnames';
import '../link/link.scss';
import style from './pager.css';
-export default class Pager extends RingComponent {
+export default class Pager extends PureComponent {
static propTypes = {
total: PropTypes.number.isRequired,
current: PropTypes.number.isRequired, | ring-pager as a PureComponent
Former-commit-id: <I>e<I>e9b<I>b<I>b<I>a<I>e<I>b | JetBrains_ring-ui | train | js |
007c77b388914565714b59012e1dbc3c9f70489c | diff --git a/js/okex.js b/js/okex.js
index <HASH>..<HASH> 100644
--- a/js/okex.js
+++ b/js/okex.js
@@ -1107,7 +1107,7 @@ module.exports = class okex extends Exchange {
const symbol = ticker['symbol'];
result[symbol] = ticker;
}
- return result;
+ return this.filterByArray (result, 'symbol', symbols);
}
async fetchTickers (symbols = undefined, params = {}) { | okex fetchTicker filter by symbols fix #<I> | ccxt_ccxt | train | js |
be1af5b770fa1f053e51c9d292edcc450bf0f02c | diff --git a/mod/lesson/report.php b/mod/lesson/report.php
index <HASH>..<HASH> 100644
--- a/mod/lesson/report.php
+++ b/mod/lesson/report.php
@@ -32,6 +32,13 @@
ORDER BY u.lastname")) {
$nothingtodisplay = true;
}
+
+// make sure people are where they should be
+ require_login($course->id, false);
+
+ if (!isteacher($course->id)) {
+ error("Must be teacher to view Reports");
+ }
/// Process any form data before fetching attempts, grades and times
if ($form = data_submitted()) {
@@ -90,13 +97,6 @@
$times = array();
}
-// make sure people are where they should be
- require_login($course->id, false);
-
- if (!isteacher($course->id)) {
- error("Must be teacher to view Reports");
- }
-
/// Print the page header
$strlessons = get_string('modulenameplural', 'lesson'); | Moved the require login and isteacher checks to infront of the form data processing | moodle_moodle | train | php |
1b1e5afb163de9b07992dff21dc9a2ddb0053216 | diff --git a/pyinfra/api/util.py b/pyinfra/api/util.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/util.py
+++ b/pyinfra/api/util.py
@@ -189,7 +189,7 @@ def get_file_sha1(filename):
# Otherwise, assume a filename and open it up
else:
- file_io = open(filename)
+ file_io = open(filename, 'rb')
# Ensure we're at the start of the file
file_io.seek(0)
@@ -198,7 +198,7 @@ def get_file_sha1(filename):
hasher = sha1()
while len(buff) > 0:
- hasher.update(buff.encode())
+ hasher.update(buff)
buff = file_io.read(BLOCKSIZE)
return hasher.hexdigest()
diff --git a/pyinfra/modules/files.py b/pyinfra/modules/files.py
index <HASH>..<HASH> 100644
--- a/pyinfra/modules/files.py
+++ b/pyinfra/modules/files.py
@@ -279,7 +279,7 @@ def put(
if add_deploy_dir and state.deploy_dir:
local_filename = path.join(state.deploy_dir, local_filename)
- local_file = open(local_filename)
+ local_file = open(local_filename, 'rb')
mode = ensure_mode_int(mode)
remote_file = host.fact.file(remote_filename) | Basic binary file support: needs tests and further verification. | Fizzadar_pyinfra | train | py,py |
08b6a4eb41b80d669b0131d55952caddf7407249 | diff --git a/lib/websearch_webinterface.py b/lib/websearch_webinterface.py
index <HASH>..<HASH> 100644
--- a/lib/websearch_webinterface.py
+++ b/lib/websearch_webinterface.py
@@ -1291,8 +1291,7 @@ def display_collection(req, c, aas, verbose, ln):
req.content_type = "text/html"
req.send_http_header()
# deduce collection id:
- c = get_coll_normalised_name(c)
- colID = get_colID(c)
+ colID = get_colID(get_coll_normalised_name(c))
if type(colID) is not int:
page_body = '<p>' + (_("Sorry, collection %s does not seem to exist.") % ('<strong>' + str(c) + '</strong>')) + '</p>'
page_body = '<p>' + (_("You may want to start browsing from %s.") % ('<a href="' + CFG_SITE_URL + '?ln=' + ln + '">' + get_coll_i18nname(CFG_SITE_NAME, ln) + '</a>')) + '</p>' | WebSearch: fix collection display normalisation
* When displaying collection page for a collection that does not
exist, the original name should be preserved for the error message
display. This fixes problems introduced as part of the collection
name normalisation call <I>cc<I>cba<I>b<I>e1be5f5a8d<I>f9b. | inveniosoftware_invenio-records | train | py |
bdb84093dc4a8ff13b7f2ab78275985da0cc5197 | diff --git a/Entity/ContactClient.php b/Entity/ContactClient.php
index <HASH>..<HASH> 100644
--- a/Entity/ContactClient.php
+++ b/Entity/ContactClient.php
@@ -121,6 +121,16 @@ class ContactClient extends FormEntity
private $schedule_exclusions;
/**
+ * ContactClient constructor.
+ */
+ public function __construct()
+ {
+ if (!$this->type) {
+ $this->type = 'api';
+ }
+ }
+
+ /**
* @param ClassMetadata $metadata
*/
public static function loadValidatorMetadata(ClassMetadata $metadata) | Use 'API' as the default type for a new client. | TheDMSGroup_mautic-contact-client | train | php |
bf57f0c1eb87d93ce17ea37a7cbd4d577f9ad2bb | diff --git a/src/node_modules/base/collection.js b/src/node_modules/base/collection.js
index <HASH>..<HASH> 100644
--- a/src/node_modules/base/collection.js
+++ b/src/node_modules/base/collection.js
@@ -1,6 +1,13 @@
var Base = require('ampersand-filtered-subcollection')
var lodashMixin = require('ampersand-collection-lodash-mixin')
-module.exports = Base.extend(
+var Collection = Base.extend(
lodashMixin
)
+
+// don't sort yo
+Collection.prototype._sortModels = function (models) {
+ return models
+}
+
+module.exports = Collection | don't sort, it's slow | holodex_app | train | js |
7207e18484a539232d806435cb1e55c9320f0b41 | diff --git a/lib/generators/sail/install/install_generator.rb b/lib/generators/sail/install/install_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/sail/install/install_generator.rb
+++ b/lib/generators/sail/install/install_generator.rb
@@ -34,7 +34,7 @@ module Sail
end
def migration_version
- "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if Rails.version.start_with?("5")
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if Rails.version >= "5.0.0"
end
end
end
diff --git a/lib/generators/sail/update/update_generator.rb b/lib/generators/sail/update/update_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/generators/sail/update/update_generator.rb
+++ b/lib/generators/sail/update/update_generator.rb
@@ -46,7 +46,7 @@ module Sail
end
def migration_version
- "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if Rails.version.start_with?("5")
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if Rails.version >= "5.0.0"
end
end
end | Fix migration class inheritance for generators (#<I>) | vinistock_sail | train | rb,rb |
d88d03f373ed4e52979690ebb1cf976f4d03f7e9 | diff --git a/lxd/storage/drivers/driver_btrfs_utils.go b/lxd/storage/drivers/driver_btrfs_utils.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/drivers/driver_btrfs_utils.go
+++ b/lxd/storage/drivers/driver_btrfs_utils.go
@@ -156,6 +156,12 @@ func (d *btrfs) deleteSubvolume(rootPath string, recursion bool) error {
return errors.Wrapf(err, "Failed setting subvolume writable %q", rootPath)
}
+ // Attempt to delete the root subvol itself (short path).
+ err = destroy(rootPath)
+ if err == nil {
+ return nil
+ }
+
// Delete subsubvols.
if recursion {
// Get the subvolumes list. | lxd/storage/btrfs: Add volume delete shortcut
Most people don't have nested subvolumes and recursively deleting
subvolumes can be time consuming and has additional restrictions on path
traversal that's caused issues to some users.
Closes #<I> | lxc_lxd | train | go |
13c71a91dab3cec83a61319869327960579775ce | diff --git a/blackfridaytext.go b/blackfridaytext.go
index <HASH>..<HASH> 100644
--- a/blackfridaytext.go
+++ b/blackfridaytext.go
@@ -54,15 +54,18 @@ var ansiEscape = ansiEscapeCodes{
}
func GetWidth() int {
- tty, err := os.OpenFile("/dev/tty", os.O_RDWR, 0600)
- if err != nil {
+ var tty *os.File
+ var err error
+ if tty, err = os.OpenFile("/dev/tty", os.O_RDWR, 0600); err != nil {
tty = os.Stdout
+ } else {
+ defer tty.Close()
}
- width, _, err := terminal.GetSize(int(tty.Fd()))
- if err != nil {
+ if width, _, err := terminal.GetSize(int(tty.Fd())); err != nil {
return 79
+ } else {
+ return width - 1
}
- return width - 1
}
// MarkdownToText parses the markdown text using the Blackfriday Markdown | Fixed a silly fd leak | gholt_blackfridaytext | train | go |
64d03be47af9d82fe51a688f624cafd1a6a5e736 | diff --git a/influxdb/tests/test_line_protocol.py b/influxdb/tests/test_line_protocol.py
index <HASH>..<HASH> 100644
--- a/influxdb/tests/test_line_protocol.py
+++ b/influxdb/tests/test_line_protocol.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
import sys
if sys.version_info < (2, 7):
@@ -55,3 +56,23 @@ class TestLineProtocol(unittest.TestCase):
line_protocol.make_lines(data),
'm1 multi_line="line1\\nline1\\nline3"\n'
)
+
+ def test_make_lines_unicode(self):
+ data = {
+ "tags": {
+ "unicode_tag": "\'Привет!\'" # Hello! in Russian
+ },
+ "points": [
+ {
+ "measurement": "test",
+ "fields": {
+ "unicode_val": "Привет!", # Hello! in Russian
+ }
+ }
+ ]
+ }
+
+ self.assertEqual(
+ line_protocol.make_lines(data),
+ 'test,unicode_tag=\'Привет!\' unicode_val="Привет!"\n'
+ ) | tests: add unicode test for line_protocol.make_line.
I'm discovered problems, while try to write data,
with tags in unicode. | influxdata_influxdb-python | train | py |
ec57ba4b2976137db83f41de95eeed78c7123ee4 | diff --git a/grimoire_elk/enriched/enrich.py b/grimoire_elk/enriched/enrich.py
index <HASH>..<HASH> 100644
--- a/grimoire_elk/enriched/enrich.py
+++ b/grimoire_elk/enriched/enrich.py
@@ -935,7 +935,8 @@ class Enrich(ElasticItems):
# Create alias if output index exists (index is always created from scratch, so
# alias need to be created each time)
- if out_conn.exists() and not out_conn.exists_alias(out_index, ONION_ALIAS):
+ if out_conn.exists() and not out_conn.exists_alias(out_index, ONION_ALIAS) \
+ and not self.elastic.alias_in_use(ONION_ALIAS):
logger.info(log_prefix + " Creating alias: %s", ONION_ALIAS)
out_conn.create_alias(ONION_ALIAS) | [enrich] Prevent adding ONION alias if already in use
This code prevents to add the alias `all_onion` to an index if the alias
is already used on other indexes. | chaoss_grimoirelab-elk | train | py |
66f2cbc84a6be4f8edf524477ae12fb762bfdd83 | diff --git a/aws/resource_aws_instance.go b/aws/resource_aws_instance.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_instance.go
+++ b/aws/resource_aws_instance.go
@@ -128,7 +128,8 @@ func resourceAwsInstance() *schema.Resource {
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
// Sometimes the EC2 API responds with the equivalent, empty SHA1 sum
// echo -n "" | shasum
- if old == "da39a3ee5e6b4b0d3255bfef95601890afd80709" && new == "" {
+ if (old == "da39a3ee5e6b4b0d3255bfef95601890afd80709" && new == "") ||
+ (old == "" && new == "da39a3ee5e6b4b0d3255bfef95601890afd80709") {
return true
}
return false | resource/aws_instance: Ignore change of user_data from omission to empty | terraform-providers_terraform-provider-aws | train | go |
4109bbaf37eaf6a010b6f061a07b6175657644e7 | diff --git a/pyramid_webassets/tests/test_webassets.py b/pyramid_webassets/tests/test_webassets.py
index <HASH>..<HASH> 100644
--- a/pyramid_webassets/tests/test_webassets.py
+++ b/pyramid_webassets/tests/test_webassets.py
@@ -715,7 +715,7 @@ class TestBaseUrlBehavior(object):
automatic_view, manual_view = self.view_actions[static_view]
- if not ':' in base_dir:
+ if ':' not in base_dir:
base_dir = os.path.join(self.temp.tempdir, base_dir)
self.request = testing.DummyRequest() | fix bad "not in" in tests | sontek_pyramid_webassets | train | py |
c0088fdd35fb0538081f5e307ce2741f77a9a132 | diff --git a/examples/Lambda.py b/examples/Lambda.py
index <HASH>..<HASH> 100644
--- a/examples/Lambda.py
+++ b/examples/Lambda.py
@@ -113,7 +113,7 @@ LambdaExecutionRole = t.add_resource(Role(
AssumeRolePolicyDocument={
"Version": "2012-10-17",
"Statement": [{
- "Action": [ "sts:AssumeRole" ],
+ "Action": ["sts:AssumeRole"],
"Effect": "Allow",
"Principal": {
"Service": ["lambda.amazonaws.com"] | Fix pycodestyle issues with examples/Lambda.py | cloudtools_troposphere | train | py |
4b7e3a78baa392492753d47d73a8a42198e9f239 | diff --git a/app/libraries/Utilities/CustomTemplate.php b/app/libraries/Utilities/CustomTemplate.php
index <HASH>..<HASH> 100644
--- a/app/libraries/Utilities/CustomTemplate.php
+++ b/app/libraries/Utilities/CustomTemplate.php
@@ -72,11 +72,11 @@ class CustomTemplate
* @param int $post_id
*
* @since 0.6.0
- * @access private
+ * @access public
*
* @return string
*/
- private function slug(int $post_id = null): string
+ public function slug(int $post_id = null): string
{
return (string)\get_page_template_slug($post_id);
}
@@ -87,11 +87,11 @@ class CustomTemplate
* @param array $type
*
* @since 0.6.0
- * @access private
+ * @access public
*
* @return bool
*/
- private function is(array $type): bool
+ public function is(array $type): bool
{
return $this->utilities->page->is('page_template', $type);
} | Change visibility for `is()` and `slug()` of custom templates utility
They are handy methods that can be used by a child theme. | GrottoPress_jentil | train | php |
f2ab6c8761ad4dfca8a4560582d831497948fccd | diff --git a/lib/phoenx/gem_version.rb b/lib/phoenx/gem_version.rb
index <HASH>..<HASH> 100755
--- a/lib/phoenx/gem_version.rb
+++ b/lib/phoenx/gem_version.rb
@@ -1,5 +1,5 @@
module Phoenx
- VERSION = "0.1.0".freeze unless defined? Phoenx::VERSION
+ VERSION = "0.1.1".freeze unless defined? Phoenx::VERSION
end
\ No newline at end of file | Bumped version to <I> | jensmeder_Phoenx | train | rb |
b8d23754c6d89b8e5c9d4bfe3bee6a91e4a29075 | diff --git a/app/Http/Controllers/GedcomFileController.php b/app/Http/Controllers/GedcomFileController.php
index <HASH>..<HASH> 100644
--- a/app/Http/Controllers/GedcomFileController.php
+++ b/app/Http/Controllers/GedcomFileController.php
@@ -188,6 +188,7 @@ class GedcomFileController extends AbstractBaseController
default:
return $this->viewResponse('admin/import-fail', [
'error' => I18N::translate('Error: converting GEDCOM files from %s encoding to UTF-8 encoding not currently supported.', $charset),
+ 'tree' => $tree,
]);
}
$first_time = false; | Error when importing tree with invalid encoding | fisharebest_webtrees | train | php |
b8a860d2e3d99f91e8628946abd13b25a277d28a | diff --git a/test/api.js b/test/api.js
index <HASH>..<HASH> 100644
--- a/test/api.js
+++ b/test/api.js
@@ -66,7 +66,7 @@ describe('Graphs', function () {
var g = new GDS({ url: APIURL, username: USERNAME, password: PASSWORD });
- g.graphs().add(function (err, data) {
+ g.graphs().create(function (err, data) {
should(err).equal(null);
data.should.be.an.Object;
data.dbUrl.should.be.a.String;
@@ -86,7 +86,7 @@ describe('Graphs', function () {
.reply(201, { graphId: 'foo', dbUrl: 'https://example.com/user/foo' });
var g = new GDS({ url: APIURL, username: USERNAME, password: PASSWORD });
- g.graphs().add(function (err, data) {
+ g.graphs().create(function (err, data) {
should(err).equal(null);
g.graphs().delete(function (err, data) {
should(err).equal(null); | fix _graphs tests after method rename | ibm-watson-data-lab_--deprecated--nodejs-graph | train | js |
cf209774e96ac7f9c94b65afd44cd7905a2e85a0 | diff --git a/src/App.php b/src/App.php
index <HASH>..<HASH> 100644
--- a/src/App.php
+++ b/src/App.php
@@ -200,12 +200,16 @@ class App extends BaseApplication
$uri = $input->getParameterOption(['--uri', '-l']);
- /*Checking if the URI has http of not in begenning*/
- if ($uri && !preg_match('/^(http|https):\/\//', $uri)) {
- $uri = sprintf(
- 'http://%s',
- $uri
- );
+ if (!$uri) {
+ // When uri is empty it's impossible to view logged
+ // messages because of InvalidArguemntException.
+ $uri = 'http://default';
+ } elseif (!preg_match('/^(http|https):\/\//', $uri)) {
+ // Make sure uri starts with a protocol.
+ $uri = sprintf(
+ 'http://%s',
+ $uri
+ );
}
$env = $input->getParameterOption(['--env', '-e'], getenv('DRUPAL_ENV') ?: 'prod'); | #<I> Default value for uri option. Without it it's impossible to view messages logged during command execution in Reports UI (InvalidArgumentException). (#<I>) | hechoendrupal_drupal-console | train | php |
ba8ec0cff46b06e8f54bac3db298bc0a3187f97b | diff --git a/murmurhash/about.py b/murmurhash/about.py
index <HASH>..<HASH> 100644
--- a/murmurhash/about.py
+++ b/murmurhash/about.py
@@ -1,5 +1,5 @@
__title__ = "murmurhash"
-__version__ = "1.0.7"
+__version__ = "1.0.8"
__summary__ = "Cython bindings for MurmurHash"
__uri__ = "https://github.com/explosion/murmurhash"
__author__ = "Explosion" | Set version to <I> (#<I>) | explosion_murmurhash | train | py |
f5ac0c3907fc144e26792522c6e935727c77e084 | diff --git a/lib/zertico/version.rb b/lib/zertico/version.rb
index <HASH>..<HASH> 100644
--- a/lib/zertico/version.rb
+++ b/lib/zertico/version.rb
@@ -1,3 +1,3 @@
module Zertico
- VERSION = '2.0.0.alpha.2'
+ VERSION = '2.0.0.alpha.3'
end
\ No newline at end of file | Bumping version to <I>.alpha<I> [ci skip] | zertico_zertico | train | rb |
f5fa877b0b5950fad32211de98f72ebdddc6b63a | diff --git a/platform/android/build/android_tools.rb b/platform/android/build/android_tools.rb
index <HASH>..<HASH> 100644
--- a/platform/android/build/android_tools.rb
+++ b/platform/android/build/android_tools.rb
@@ -857,7 +857,7 @@ def start_emulator(cmd)
# wait while emulator appears in adb device list
30.times do
- sleep 1
+ sleep 5
out = Jake.run4("#{$adb} devices")
lines = out.chomp.split("\n");
return if lines.length > 1 | travis: emulator can start really slow | rhomobile_rhodes | train | rb |
601ca5515569aa239d610d05ae0fc66b30ca491d | diff --git a/sphinxcontrib/openapi/openapi30.py b/sphinxcontrib/openapi/openapi30.py
index <HASH>..<HASH> 100644
--- a/sphinxcontrib/openapi/openapi30.py
+++ b/sphinxcontrib/openapi/openapi30.py
@@ -267,16 +267,16 @@ def _httpresource(endpoint, method, properties, render_examples,
if render_request:
request_content = properties.get('requestBody', {}).get('content', {})
if request_content:
- req_properties = json.dumps(request_content['application/json']
- ['schema']['properties'], indent=2, separators=(',', ':')
- )
+ schema = request_content['application/json']['schema']
+ req_properties = json.dumps(schema['properties'], indent=2,
+ separators=(',', ':'))
yield '{indent}**Request body:**'.format(**locals())
yield ''
yield '{indent}.. sourcecode:: http'.format(**locals())
yield ''
yield '{indent}{indent}POST /customers HTTP/1.1'.format(**locals())
yield '{indent}{indent}Host: example.com'.format(**locals())
- yield '{indent}{indent}Content-Type: application/json'\
+ yield '{indent}{indent}Content-Type: application/json' \
.format(**locals())
yield ''
for line in req_properties.splitlines(): | Request Body: E<I> continuation line under-indented for visual indent. | sphinx-contrib_openapi | train | py |
cdb3be58e9214151f1bbba328574b8a9a7136bdb | diff --git a/bcbio/install.py b/bcbio/install.py
index <HASH>..<HASH> 100644
--- a/bcbio/install.py
+++ b/bcbio/install.py
@@ -782,7 +782,7 @@ def add_subparser(subparsers):
action="append", default=[], type=_check_toolplus)
parser.add_argument("--datatarget", help="Data to install. Allows customization or install of extra data.",
action="append", default=[],
- choices=["variation", "rnaseq", "smallrna", "gemini", "vep", "dbnsfp", "dbscsnv", "battenberg", "kraken", "ericscript", "gnomad"])
+ choices=["variation", "rnaseq", "smallrna", "gemini", "vep", "dbnsfp", "dbscsnv", "battenberg", "kraken", "ericscript", "gnomad", "topmed"])
parser.add_argument("--genomes", help="Genomes to download",
action="append", default=[], choices=SUPPORTED_GENOMES)
parser.add_argument("--aligners", help="Aligner indexes to download", | Add TOPMEd as a data target. | bcbio_bcbio-nextgen | train | py |
680b1ca97b00d874fd416b71ef395499e3666424 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,14 +1,13 @@
from setuptools import setup, find_packages
import airflow
-# To generate install_requires from requirements.txt
-# from pip.req import parse_requirements
-# reqs = (str(ir.req) for ir in parse_requirements('requirements.txt'))
+# Kept manually in sync with airflow.__version__
+version = '0.2.1'
setup(
name='airflow',
description='Programmatically author, schedule and monitor data pipelines',
- version=airflow.__version__,
+ version=version,
packages=find_packages(),
include_package_data=True,
zip_safe=False,
@@ -45,6 +44,5 @@ setup(
author_email='[email protected]',
url='https://github.com/mistercrunch/Airflow',
download_url=(
- 'https://github.com/mistercrunch/Airflow/tarball/' +
- airflow.__version__),
+ 'https://github.com/mistercrunch/Airflow/tarball/' + version),
) | Importing airflow in setup.py wan't a good idea, rolling back | apache_airflow | train | py |
e8985b3588f726a182c73462953e290fa03c3a61 | diff --git a/lib/link.js b/lib/link.js
index <HASH>..<HASH> 100644
--- a/lib/link.js
+++ b/lib/link.js
@@ -1,4 +1,4 @@
-import React, { Component, Children } from 'react'
+import React, { Component, Children, PropTypes } from 'react'
import Router from './router'
export default class Link extends Component {
@@ -7,6 +7,13 @@ export default class Link extends Component {
this.linkClicked = this.linkClicked.bind(this)
}
+ static propTypes = {
+ children: PropTypes.oneOfType([
+ PropTypes.string,
+ PropTypes.element
+ ]).isRequired
+ }
+
linkClicked (e) {
if (e.target.nodeName === 'A' &&
(e.metaKey || e.ctrlKey || e.shiftKey || (e.nativeEvent && e.nativeEvent.which === 2))) { | Add warning for multiple children in Link (#<I>)
* Add warning for multiple children in Link
* Add space after if
* Use proptype validation | zeit_next.js | train | js |
b7dcea70b9fb1cecc316dc16ddaa06d9d0fe9fc9 | diff --git a/Twig/Menu.php b/Twig/Menu.php
index <HASH>..<HASH> 100755
--- a/Twig/Menu.php
+++ b/Twig/Menu.php
@@ -88,12 +88,12 @@ class Menu extends \Twig_Extension {
}
}
- if (!in_array($sClassName, $this->aClassesLoaded)) {
+ if (!in_array($menu, $this->aClassesLoaded)) {
/**
* @var AbstractMenu $oMenu
*/
$oMenu = new $sClassName($this->router, $this->autorizationChecker, $this->aNamespaces);
- $this->aClassesLoaded[] = $sClassName;
+ $this->aClassesLoaded[] = $menu;
if ($oMenu->getUrl() != $routeActuelle) {
$sContenu .= $oMenu->getLink();
} | Issue #3:
Correction bug doublon menu | gosyl_common-bundle | train | php |
f13d953f4381659ab74d2ee2191a5fbcbb6d75e0 | diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java
index <HASH>..<HASH> 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java
@@ -56,7 +56,7 @@ public final class ConfigurationAsyncClient {
private static final String ETAG_ANY = "*";
private final String serviceEndpoint;
private final ConfigurationService service;
- private final String apiVersion = ConfigurationServiceVersion.getLatest().getVersion();
+ private final String apiVersion;
/**
* Creates a ConfigurationAsyncClient that sends requests to the configuration service at {@code serviceEndpoint}.
@@ -68,6 +68,7 @@ public final class ConfigurationAsyncClient {
ConfigurationAsyncClient(String serviceEndpoint, HttpPipeline pipeline, ConfigurationServiceVersion version) {
this.service = RestProxy.create(ConfigurationService.class, pipeline);
this.serviceEndpoint = serviceEndpoint;
+ this.apiVersion = version.getVersion();
}
/** | Use service version provided in constructor (#<I>) | Azure_azure-sdk-for-java | train | java |
bea50bdaa8adbf48adb3ce94f08d573057f490b2 | diff --git a/src/Object/Product/Product.php b/src/Object/Product/Product.php
index <HASH>..<HASH> 100644
--- a/src/Object/Product/Product.php
+++ b/src/Object/Product/Product.php
@@ -971,7 +971,7 @@ class Product extends AbstractObject implements
*
* @return bool
*/
- protected function isValid()
+ public function isValid()
{
$validator = new ValidationHelper($this);
try { | Change isValid to be public | Nosto_nosto-php-sdk | train | php |
b49259f47c277949383892b720ad5e58982b536c | diff --git a/spring-social-twitter/src/main/java/org/springframework/social/twitter/connect/TwitterServiceApiAdapter.java b/spring-social-twitter/src/main/java/org/springframework/social/twitter/connect/TwitterServiceApiAdapter.java
index <HASH>..<HASH> 100644
--- a/spring-social-twitter/src/main/java/org/springframework/social/twitter/connect/TwitterServiceApiAdapter.java
+++ b/spring-social-twitter/src/main/java/org/springframework/social/twitter/connect/TwitterServiceApiAdapter.java
@@ -16,8 +16,8 @@
package org.springframework.social.twitter.connect;
import org.springframework.social.BadCredentialsException;
+import org.springframework.social.connect.ServiceApiAdapter;
import org.springframework.social.connect.ServiceProviderUser;
-import org.springframework.social.connect.spi.ServiceApiAdapter;
import org.springframework.social.twitter.TwitterApi;
import org.springframework.social.twitter.types.TwitterProfile; | moved service api adapter to root package to avoid tangle | spring-projects_spring-social-twitter | train | java |
6f6370c3de241a78a1a2b192735fd8b5d5356b6e | diff --git a/lib/valanga/music_search.rb b/lib/valanga/music_search.rb
index <HASH>..<HASH> 100644
--- a/lib/valanga/music_search.rb
+++ b/lib/valanga/music_search.rb
@@ -20,8 +20,8 @@ module Valanga
end
def search(music_name)
- if url = pages[music_name]
- return create_music(url)
+ if music_id = pages[music_name]
+ return create_music(info_url(music_id))
end
page_sessions do |session|
@@ -32,7 +32,7 @@ module Valanga
pages[music_name] = music_id(session)
- return create_music(info_url(src))
+ return create_music(info_url(pages[music_name]))
rescue Capybara::ElementNotFound
# if link is not found, go next page.
end
@@ -66,8 +66,8 @@ module Valanga
end
end
- def info_url(src)
- "http://p.eagate.573.jp/game/reflec/groovin/p/music/#{src}"
+ def info_url(music_id)
+ "http://p.eagate.573.jp/game/reflec/groovin/p/music/m_info.html?id=#{music_id}"
end
def music_url(page: nil, sorttype: nil, sort: nil) | `#info_url` receive `music_id` and build url | mgi166_valanga | train | rb |
d34cecc66811df8b73e930174a3c09b856305c85 | diff --git a/packer/new_stuff.go b/packer/new_stuff.go
index <HASH>..<HASH> 100644
--- a/packer/new_stuff.go
+++ b/packer/new_stuff.go
@@ -9,7 +9,8 @@ type GetBuildsOptions struct {
}
type BuildGetter interface {
- // GetBuilds return all possible builds for a config. It also starts them.
+ // GetBuilds return all possible builds for a config. It also starts all
+ // builders.
// TODO(azr): rename to builder starter ?
GetBuilds(GetBuildsOptions) ([]Build, hcl.Diagnostics)
}
@@ -19,15 +20,20 @@ type FixConfigMode int
const (
Stdout FixConfigMode = iota
+ // Inplace fixes your files on the spot.
Inplace
+ // Diff shows a full diff.
Diff
+ // SimpleOutput will simply print what the config should be; it will only
+ // work when a single file is passed.
+ SimpleOutput
)
type FixConfigOptions struct {
DiffOnly bool
}
-type OtherInterfaceyMacOtherInterfaceFace interface {
+type ConfigFixer interface {
// FixConfig will output the config in a fixed manner.
FixConfig(FixConfigOptions) hcl.Diagnostics
} | Update new_stuff.go | hashicorp_packer | train | go |
fad284402cdea7bd0a7a2123970e83b9fe1516a5 | diff --git a/lib/heroku/pg_resolver.rb b/lib/heroku/pg_resolver.rb
index <HASH>..<HASH> 100644
--- a/lib/heroku/pg_resolver.rb
+++ b/lib/heroku/pg_resolver.rb
@@ -36,7 +36,7 @@ module PGResolver
end
resolver = Resolver.new(db_id, config_vars)
- display resolver.message
+ display(resolver.message) if resolver.message
abort_with_database_list(db_id) unless resolver.url
return resolver
@@ -67,10 +67,6 @@ module PGResolver
end
end
- def display(message='', newline=true)
- super if message
- end
-
class Resolver
include PGResolver
attr_reader :url, :db_id | cleanup pg resolver message printing for consistency | heroku_legacy-cli | train | rb |
3bfa4766565af42cb92dbd28b2f7f8bcdbb7ac68 | diff --git a/Query/Builder.php b/Query/Builder.php
index <HASH>..<HASH> 100755
--- a/Query/Builder.php
+++ b/Query/Builder.php
@@ -947,7 +947,7 @@ class Builder {
*/
public function offset($value)
{
- $this->offset = $value > 0 ? $value : 0;
+ $this->offset = max(0, $value);
return $this;
} | Use max() instead of ternary in DB offset. | illuminate_database | train | php |
30e6e55f6a67b9de8c83f0a66d2178908486bd63 | diff --git a/Lib/ufo2ft/outlineCompiler.py b/Lib/ufo2ft/outlineCompiler.py
index <HASH>..<HASH> 100644
--- a/Lib/ufo2ft/outlineCompiler.py
+++ b/Lib/ufo2ft/outlineCompiler.py
@@ -1474,7 +1474,16 @@ class OutlineTTFCompiler(BaseOutlineCompiler, InstructionCompiler):
hmtx = self.otf.get("hmtx")
ttGlyphs = self.getCompiledGlyphs()
- for name in self.glyphOrder:
+ # Sort the glyphs so that simple glyphs are compiled first, and composite
+ # glyphs are compiled later. Otherwise the glyph hashes may not be ready
+ # to calculate when a base glyph of a composite glyph is not in the font yet.
+ compilation_order = [
+ name
+ for _, name in sorted(
+ [(int(ttGlyphs[name].isComposite()), name) for name in self.glyphOrder]
+ )
+ ]
+ for name in compilation_order:
ttGlyph = ttGlyphs[name]
if ttGlyph.isComposite() and hmtx is not None and self.autoUseMyMetrics:
self.autoUseMyMetrics(ttGlyph, name, hmtx) | Compile simple glyphs first to avoid missing base glyphs in composites | googlefonts_ufo2ft | train | py |
b66e6bf903484f2652665957e72e12f1b0088433 | diff --git a/src/Assetic/Filter/Yui/BaseCompressorFilter.php b/src/Assetic/Filter/Yui/BaseCompressorFilter.php
index <HASH>..<HASH> 100644
--- a/src/Assetic/Filter/Yui/BaseCompressorFilter.php
+++ b/src/Assetic/Filter/Yui/BaseCompressorFilter.php
@@ -80,7 +80,7 @@ abstract class BaseCompressorFilter implements FilterInterface
// input and output files
$tempDir = realpath(sys_get_temp_dir());
- $hash = substr(sha1(time().rand(11111, 99999)), 0, 7);
+ $hash = substr(sha1(microtime().rand(11111, 99999)), 0, 7);
$input = $tempDir.DIRECTORY_SEPARATOR.$hash.'.'.$type;
$output = $tempDir.DIRECTORY_SEPARATOR.$hash.'-min.'.$type;
file_put_contents($input, $content); | Ensure uniqueness of temporary files created by the compressor filter. Fixed #<I> | kriswallsmith_assetic | train | php |
8d8a20c3c088a1adcae55c3aeb292eb0f6b3d262 | diff --git a/scapy/arch/__init__.py b/scapy/arch/__init__.py
index <HASH>..<HASH> 100644
--- a/scapy/arch/__init__.py
+++ b/scapy/arch/__init__.py
@@ -28,7 +28,8 @@ except ImportError:
def str2mac(s):
- return ("%02x:"*6)[:-1] % tuple(map(ord, s))
+ #return ("%02x:"*6)[:-1] % tuple(map(ord, s))
+ return ("%02x:"*6)[:-1] % tuple(s)
diff --git a/scapy/sendrecv.py b/scapy/sendrecv.py
index <HASH>..<HASH> 100644
--- a/scapy/sendrecv.py
+++ b/scapy/sendrecv.py
@@ -145,7 +145,7 @@ def sndrcv(pks, pkt, timeout = None, inter = 0, verbose=None, chainCC=0, retry=0
if r.answers(hlst[i]):
ans.append((hlst[i],r))
if verbose > 1:
- os.write(1, "*")
+ os.write(1, b"*")
ok = 1
if not multi:
del(hlst[i]) | Fixed setting src mac address | phaethon_kamene | train | py,py |
544e6ef5b99f7d706be8edd833fdca5324d633e9 | diff --git a/Utilities/Clock.php b/Utilities/Clock.php
index <HASH>..<HASH> 100644
--- a/Utilities/Clock.php
+++ b/Utilities/Clock.php
@@ -6,6 +6,7 @@
namespace Ouzo\Utilities;
use DateTime;
+use DateTimeZone;
/**
* Class Clock
@@ -186,4 +187,10 @@ class Clock
{
return $this->getTimestamp() < $other->getTimestamp();
}
+
+ public function setTimezone($timezone)
+ {
+ $this->dateTime->setTimezone(new DateTimeZone($timezone));
+ return $this;
+ }
} | Added setTimezone to Clock. | letsdrink_ouzo-goodies | train | php |
5bcdf5435833d605e42cfdff9bfcc2a5804bf8cd | diff --git a/src/main/java/org/mythtv/services/api/frontend/impl/FrontendTemplate.java b/src/main/java/org/mythtv/services/api/frontend/impl/FrontendTemplate.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mythtv/services/api/frontend/impl/FrontendTemplate.java
+++ b/src/main/java/org/mythtv/services/api/frontend/impl/FrontendTemplate.java
@@ -187,7 +187,6 @@ public class FrontendTemplate extends AbstractFrontendOperations implements Fron
if(useBookmark) parameters.add( "UseBookmark", "1");
URI uri = buildUri( frontedApiUrlBase + "/Frontend/PlayVideo", parameters );
- Log.d(TAG, uri.toString());
ResponseEntity<Bool> responseEntity = restOperations.exchange(
uri, | removed Log reference from code. Log is specific to Android and this
library is intended not to be tied to android specifically. | MythTV-Clients_MythTV-Service-API | train | java |
57bedaeeeafca352053227aba91f7677381e0902 | diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php
index <HASH>..<HASH> 100644
--- a/lib/outputcomponents.php
+++ b/lib/outputcomponents.php
@@ -2342,9 +2342,13 @@ class custom_menu extends custom_menu_item {
if (preg_match('/^(\-*)/', $line, $match) && $lastchild != null && $lastdepth !== null) {
$depth = strlen($match[1]);
if ($depth < $lastdepth) {
- if ($lastdepth > 1) {
- $depth = $lastdepth - 1;
- $lastchild = $lastchild->get_parent()->get_parent()->add($bits[0], $bits[1], $bits[2], $bits[3]);
+ $difference = $lastdepth - $depth;
+ if ($lastdepth > 1 && $lastdepth != $difference) {
+ $tempchild = $lastchild->get_parent();
+ for ($i =0; $i < $difference; $i++) {
+ $tempchild = $tempchild->get_parent();
+ }
+ $lastchild = $tempchild->add($bits[0], $bits[1], $bits[2], $bits[3]);
} else {
$depth = 0;
$lastchild = new custom_menu_item($bits[0], $bits[1], $bits[2], $bits[3]); | output-custommenu MDL-<I> Fixed up the processing of the custom menu removing the hard-coded single step down | moodle_moodle | train | php |
e1ae90c12b7ac6bb5e09dc11e64dbd8aa09f0dd9 | diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go
index <HASH>..<HASH> 100644
--- a/cmd/web-handlers.go
+++ b/cmd/web-handlers.go
@@ -471,7 +471,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
AccountName: claims.Subject,
Action: iampolicy.ListBucketAction,
BucketName: args.BucketName,
- ConditionValues: getConditionValues(r, "", ""),
+ ConditionValues: getConditionValues(r, "", claims.Subject),
IsOwner: owner,
})
@@ -479,7 +479,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r
AccountName: claims.Subject,
Action: iampolicy.PutObjectAction,
BucketName: args.BucketName,
- ConditionValues: getConditionValues(r, "", ""),
+ ConditionValues: getConditionValues(r, "", claims.Subject),
IsOwner: owner,
ObjectName: args.Prefix + "/",
}) | Make sure to pass the right username for correct ConditionValues (#<I>)
Without passing proper username value would result in AccessDenied
errors when policies with `{aws:username}` substitutions are used.
Fixes #<I> | minio_minio | train | go |
7e8c3b0c3aad7847b7b7d919c2e0909360bd5abf | diff --git a/loggers.go b/loggers.go
index <HASH>..<HASH> 100644
--- a/loggers.go
+++ b/loggers.go
@@ -13,7 +13,11 @@ type IoLogger struct {
}
func (l *IoLogger) Log(data Data) error {
- _, err := l.stream.Write(l.BuildLog(data))
+ return l.Write(l.BuildLog(data))
+}
+
+func (l *IoLogger) Write(data []byte) err {
+ _, err := l.stream.Write(data)
return err
} | expose how an IoLogger writes to the stream | technoweenie_grohl | train | go |
7e3f1b234ddd9d87d0a9aac86ff2ee773d4c6cf6 | diff --git a/search/actions/getSearchResults.js b/search/actions/getSearchResults.js
index <HASH>..<HASH> 100644
--- a/search/actions/getSearchResults.js
+++ b/search/actions/getSearchResults.js
@@ -6,6 +6,7 @@
*/
import { ITEMS_PER_LOAD } from '@shopgate/pwa-common/constants/DisplayOptions';
+import { getSortOrder } from '@shopgate/pwa-common/selectors/history';
import getProducts from '../../product/actions/getProducts';
import requestSearchResults from '../action-creators/requestSearchResults';
import receiveSearchResults from '../action-creators/receiveSearchResults';
@@ -26,12 +27,15 @@ const getSearchResults = (offset = 0) => (dispatch, getState) => {
return;
}
+ const sort = getSortOrder(state);
+
const promise = dispatch(
getProducts({
params: {
searchPhrase,
offset,
limit,
+ sort,
},
onBeforeDispatch: () => {
// Dispatch the request action before the related pipeline request is executed. | CON-<I>: fixed missing sort order in product search pipeline requests | shopgate_pwa | train | js |
1a5f24794f68ffa6c3bdcd70924601e148f0fab7 | diff --git a/src/Select.js b/src/Select.js
index <HASH>..<HASH> 100644
--- a/src/Select.js
+++ b/src/Select.js
@@ -537,7 +537,7 @@ const Select = React.createClass({
if (options && options.length) {
let Option = this.props.optionComponent;
let renderLabel = this.props.optionRenderer || this.getOptionLabel;
- return options.map(option => {
+ return options.map((option, i) => {
let isSelected = valueArray && valueArray.indexOf(option) > -1;
let isFocused = option === focusedOption;
let optionRef = isFocused ? 'focused' : null;
@@ -552,7 +552,7 @@ const Select = React.createClass({
className={optionClass}
isDisabled={option.disabled}
isFocused={isFocused}
- key={'option-' + option[this.props.valueKey]}
+ key={`option-${i}-${option[this.props.valueKey]}`}
onSelect={this.selectValue}
onFocus={this.focusOption}
option={option} | Prevent duplicate react keys when multiple options have the same value
Ref #<I> | HubSpot_react-select-plus | train | js |
8a28328a2e0119bd8fc50cb310a55bca8dc32c30 | diff --git a/etc/MelisDemoCms/src/MelisDemoCms/Controller/MelisSetupPostDownloadController.php b/etc/MelisDemoCms/src/MelisDemoCms/Controller/MelisSetupPostDownloadController.php
index <HASH>..<HASH> 100755
--- a/etc/MelisDemoCms/src/MelisDemoCms/Controller/MelisSetupPostDownloadController.php
+++ b/etc/MelisDemoCms/src/MelisDemoCms/Controller/MelisSetupPostDownloadController.php
@@ -205,7 +205,7 @@ class MelisSetupPostDownloadController extends AbstractActionController implemen
$setupSrv = $this->getServiceLocator()->get('SetupDemoCmsService');
- $setupSrv->setupSite($siteData);
+ //$setupSrv->setupSite($siteData); -- caused to duplicate site entry 02-15-19
$setupSrv->setup(getenv('MELIS_PLATFORM'), $siteLabel);
//$setupSrv->setupSiteDomain($scheme, $domain); | fixed error duplicate site-entry during installation | melisplatform_melis-installer | train | php |
d268432de353a352a18d3e10154bb093fe8e1434 | diff --git a/tests/CommandBus/SimpleCommandBusTest.php b/tests/CommandBus/SimpleCommandBusTest.php
index <HASH>..<HASH> 100644
--- a/tests/CommandBus/SimpleCommandBusTest.php
+++ b/tests/CommandBus/SimpleCommandBusTest.php
@@ -47,13 +47,10 @@ class SimpleCommandBusTest extends \PHPUnit_Framework_TestCase
* @test
* @expectedException \HelloFresh\Engine\CommandBus\Exception\MissingHandlerException
*/
- public function itLosesMessageWhenThereIsNoHandlers()
+ public function itFailsWhenThereIsNoHandlers()
{
$command = new TestCommand("hey");
$this->commandBus->execute($command);
-
- $handler = new TestHandler();
- $this->assertSame(0, $handler->getCounter());
}
/**
@@ -66,7 +63,6 @@ class SimpleCommandBusTest extends \PHPUnit_Framework_TestCase
$handler = new TestHandler();
$this->locator->addHandler($command, $handler);
- $this->commandBus->execute($command);
}
/** | Minor SimpleCommandBus test improvement.
- Renamed method to be more accurate
- Removed unneeded execute call | hellofresh_engine | train | php |
1cd9d6850d9b03152b975c72fc521bb15d68ef1e | diff --git a/lib/tocer/rake/tasks.rb b/lib/tocer/rake/tasks.rb
index <HASH>..<HASH> 100644
--- a/lib/tocer/rake/tasks.rb
+++ b/lib/tocer/rake/tasks.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "rake"
+require "tocer"
module Tocer
module Rake | Fixed rake task requirements.
Necessary for dependent gems/projects to load these tasks and not hit
runtime issues with gem dependencies not loaded (i.e. `Runner` and
other objects). | bkuhlmann_tocer | train | rb |
4a094d885939539690898803acca10128647720e | diff --git a/pythonforandroid/recipes/hostpython3/__init__.py b/pythonforandroid/recipes/hostpython3/__init__.py
index <HASH>..<HASH> 100644
--- a/pythonforandroid/recipes/hostpython3/__init__.py
+++ b/pythonforandroid/recipes/hostpython3/__init__.py
@@ -6,7 +6,7 @@ import sh
class Hostpython3Recipe(Recipe):
- version = '3.7.0'
+ version = '3.7.1'
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
name = 'hostpython3'
diff --git a/pythonforandroid/recipes/python3/__init__.py b/pythonforandroid/recipes/python3/__init__.py
index <HASH>..<HASH> 100644
--- a/pythonforandroid/recipes/python3/__init__.py
+++ b/pythonforandroid/recipes/python3/__init__.py
@@ -11,7 +11,7 @@ import sh
class Python3Recipe(TargetPythonRecipe):
- version = '3.7.0'
+ version = '3.7.1'
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
name = 'python3' | Updated python3 recipe target version to <I> | kivy_python-for-android | train | py,py |
8da345b0fc212c1cc224c54026536856b6bdd210 | diff --git a/lib/podio/models/app_store_share.rb b/lib/podio/models/app_store_share.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/app_store_share.rb
+++ b/lib/podio/models/app_store_share.rb
@@ -12,18 +12,17 @@ class Podio::AppStoreShare < ActivePodio::Base
property :integration, :string
property :categories, :hash
property :org, :hash
- property :author, :hash
property :author_apps, :integer
property :author_packs, :integer
property :icon, :string
property :icon_id, :integer
- property :comments, :array
property :ratings, :hash
property :user_rating, :array
- property :screenshots, :array
property :video, :string
has_many :children, :class => 'AppStoreShare'
+ has_many :screenshots, :class => 'FileAttachment'
+ has_many :comments, :class => 'Comment'
has_one :author, :class => 'ByLine'
alias_method :id, :share_id
@@ -83,6 +82,10 @@ class Podio::AppStoreShare < ActivePodio::Base
response.status
end
+
+ def find_all_by_reference(ref_type, ref_id)
+ list Podio.connection.get("/app_store/#{ref_type}/#{ref_id}/").body
+ end
end
end | Added find_all_by_reference method to AppStoreShare model | podio_podio-rb | train | rb |
caa0341d1f089e20f8edd3634bd2c304ab62c54c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
from setuptools import setup, find_packages
setup(
name = "pyapi-gitlab",
- version = "6.1-2",
+ version = "6.1-4",
packages = find_packages(),
install_requires = ['requests', 'markdown'],
# metadata for upload to PyPI | upped pypi version to <I>-4 | pyapi-gitlab_pyapi-gitlab | train | py |
32ca39d854bfafe8b1c8a10b76bb78e8c1f32087 | diff --git a/config/environments/development.rb b/config/environments/development.rb
index <HASH>..<HASH> 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -27,6 +27,8 @@ Cortex::Application.configure do
# number of complex assets.
config.assets.debug = true
+ config.cache_store = :redis_store, 'redis://localhost:6379/0/cache'
+
if ENV['S3_BUCKET_NAME'].to_s != ''
config.paperclip_defaults = {
:storage => :s3, | Use Redis caching in dev | cortex-cms_cortex | train | rb |
526cc0b4f4715261e851809eaa1d70700f9c1f0c | diff --git a/prototypes/examples/ipnbdoctest.py b/prototypes/examples/ipnbdoctest.py
index <HASH>..<HASH> 100755
--- a/prototypes/examples/ipnbdoctest.py
+++ b/prototypes/examples/ipnbdoctest.py
@@ -273,7 +273,7 @@ def test_notebook(nb, generate_png_diffs=True):
sys.stdout.write('S')
continue
- skip_test_match = re.match(r'#\s*Skip\s+Doctest', cell.input, re.IGNORECASE)
+ skip_test_match = re.match(r'#\s*skip\s+doctest', cell.input.lower())
if skip_test_match:
sys.stdout.write('S')
continue | removed re.IGNORECASE | theosysbio_means | train | py |
e653e95c9534c6608ec8caa68d9aaebefa50720d | diff --git a/lib/sgr.js b/lib/sgr.js
index <HASH>..<HASH> 100644
--- a/lib/sgr.js
+++ b/lib/sgr.js
@@ -43,14 +43,10 @@ sgr.mods = mods;
, onlyKey = require('es5-ext/object/first-key')
, uniq = require('es5-ext/array/#/uniq.js');
- sgr.toModPair = function (mod) {
- return mod[onlyKey(mod)];
- };
-
var openers = {}, closers = {};
forEach(mods, function (mod) {
- var modPair = sgr.toModPair(mod);
+ var modPair = mod[onlyKey(mod)];
openers[modPair[0]] = modPair;
closers[modPair[1]] = modPair; | get rid of modPair fn. | medikoo_cli-color | train | js |
2e8604042cc45f898b8c0e80601ce24af7ca9373 | diff --git a/java/client/test/org/openqa/selenium/CookieImplementationTest.java b/java/client/test/org/openqa/selenium/CookieImplementationTest.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/CookieImplementationTest.java
+++ b/java/client/test/org/openqa/selenium/CookieImplementationTest.java
@@ -212,7 +212,7 @@ public class CookieImplementationTest extends JUnit4TestBase {
}
@Test
- @Ignore(CHROME)
+ @NotYetImplemented(CHROME)
public void testCannotGetCookiesWithPathDifferingOnlyInCase() {
String cookieName = "fish";
Cookie cookie = new Cookie.Builder(cookieName, "cod").path("/Common/animals").build();
@@ -236,7 +236,7 @@ public class CookieImplementationTest extends JUnit4TestBase {
}
@Test
- @Ignore(CHROME)
+ @NotYetImplemented(CHROME)
public void testShouldBeAbleToAddToADomainWhichIsRelatedToTheCurrentDomain() {
String cookieName = "name";
assertCookieIsNotPresentWithName(cookieName);
@@ -425,7 +425,7 @@ public class CookieImplementationTest extends JUnit4TestBase {
}
@Test
- @Ignore(CHROME)
+ @NotYetImplemented(CHROME)
@Ignore(SAFARI)
public void testRetainsHttpOnlyFlag() {
Cookie addedCookie = | [java] Changing @Ignore to @NotYetImplemented for some non-destructive failures | SeleniumHQ_selenium | train | java |
54692ce8db573b4e43cd75957a34489760ccf7c3 | diff --git a/lib/generamba/code_generation/content_generator.rb b/lib/generamba/code_generation/content_generator.rb
index <HASH>..<HASH> 100755
--- a/lib/generamba/code_generation/content_generator.rb
+++ b/lib/generamba/code_generation/content_generator.rb
@@ -22,7 +22,9 @@ module Generamba
'name' => code_module.name,
'file_name' => file_name,
'description' => code_module.description,
- 'project_name' => code_module.project_name
+ 'project_name' => code_module.project_name,
+ 'project_targets' => code_module.project_targets,
+ 'test_targets' => code_module.test_targets
}
developer = { | Added info about project and test targets to content generator (Issue #<I>) | strongself_Generamba | train | rb |
1056f6af24e8c69930cf8c38458dbcfed71592c8 | diff --git a/wafer/static/js/edit_schedule.js b/wafer/static/js/edit_schedule.js
index <HASH>..<HASH> 100644
--- a/wafer/static/js/edit_schedule.js
+++ b/wafer/static/js/edit_schedule.js
@@ -75,6 +75,21 @@
var newItem = document.querySelectorAll('[id=scheduleItemnull]')[0];
newItem.id = 'scheduleItem' + scheduleItemId;
+
+ // Add a close button, since we've deleted it if one
+ // existed, and we're not going back through the template
+ var closeButton = document.createElement("BUTTON");
+ closeButton.id = "delete" + scheduleItemId;
+ closeButton.setAttribute("data-id", scheduleItemId);
+ closeButton.classList.add("close");
+ closeButton.setAttribute("aria-label", "Close");
+ var buttonSpan = document.createElement("span");
+ buttonSpan.setAttribute("aria-hidden", true);
+ buttonSpan.innerHTML = "×";
+
+ closeButton.appendChild(buttonSpan);
+ closeButton.addEventListener('click', handleClickDelete, false);
+ newItem.insertBefore(closeButton, newItem.childNodes[0]);
} | Plug a close button back onto newly dropped items in the schedule | CTPUG_wafer | train | js |
a637f8f53d1f94649cb3506f8e9a5c55508cfd1d | diff --git a/lib/locabulary.rb b/lib/locabulary.rb
index <HASH>..<HASH> 100644
--- a/lib/locabulary.rb
+++ b/lib/locabulary.rb
@@ -3,7 +3,7 @@ require 'json'
# @since 0.1.0
module Locabulary
- VERSION='0.1.4'.freeze
+ VERSION='0.1.5'.freeze
DATA_DIRECTORY = File.expand_path("../../data/", __FILE__).freeze
class RuntimeError < ::RuntimeError | Bumping to version <I> | ndlib_locabulary | train | rb |
3071bb157733a3d4c3c111967c1061a9ae1df7a9 | diff --git a/guacamole/src/main/frontend/src/app/rest/services/patchService.js b/guacamole/src/main/frontend/src/app/rest/services/patchService.js
index <HASH>..<HASH> 100644
--- a/guacamole/src/main/frontend/src/app/rest/services/patchService.js
+++ b/guacamole/src/main/frontend/src/app/rest/services/patchService.js
@@ -25,17 +25,16 @@ angular.module('rest').factory('patchService', ['$injector',
// Required services
var requestService = $injector.get('requestService');
- var authenticationService = $injector.get('authenticationService');
var cacheService = $injector.get('cacheService');
var service = {};
-
+
/**
* Makes a request to the REST API to get the list of patches, returning
* a promise that provides the array of all applicable patches if
* successful. Each patch is a string of raw HTML with meta information
* describing the patch operation stored within meta tags.
- *
+ *
* @returns {Promise.<String[]>}
* A promise which will resolve with an array of HTML patches upon
* success.
@@ -43,14 +42,14 @@ angular.module('rest').factory('patchService', ['$injector',
service.getPatches = function getPatches() {
// Retrieve all applicable HTML patches
- return authenticationService.request({
+ return requestService({
cache : cacheService.patches,
method : 'GET',
url : 'api/patches'
});
};
-
+
return service;
}]); | GUACAMOLE-<I>: Stop including the auth token when making requests to the /api/patches endpoint. | glyptodon_guacamole-client | train | js |
847872cc24922645c2ca3fb687934ba31da7d766 | diff --git a/store.go b/store.go
index <HASH>..<HASH> 100644
--- a/store.go
+++ b/store.go
@@ -368,7 +368,7 @@ func (i *itemLoc) read(o *Store, withValue bool) (err error) {
if loc.isEmpty() {
return nil
}
- b := make([]byte, loc.Length)
+ b := make([]byte, loc.Length) // TODO: Read less when not withValue.
if _, err := o.file.ReadAt(b, loc.Offset); err != nil {
return err
} | TODO comment on withValue optimization. | steveyen_gkvlite | train | go |
0d82a8c18cfab1488bd6ca805adb5be7f995abe1 | diff --git a/aa_composer.js b/aa_composer.js
index <HASH>..<HASH> 100644
--- a/aa_composer.js
+++ b/aa_composer.js
@@ -853,6 +853,8 @@ function handleTrigger(conn, batch, trigger, stateVars, arrDefinition, address,
}
function handleSuccessfulEmptyResponseUnit() {
+ if (!objStateUpdate)
+ return bounce("no state changes");
executeStateUpdateFormula(null, function (err) {
if (err) {
error_message = undefined; // remove error message like 'no messages after filtering'
@@ -1016,11 +1018,8 @@ function handleTrigger(conn, batch, trigger, stateVars, arrDefinition, address,
if (err)
return bounce(err);
var messages = template.messages;
- if (!messages) {
- error_message = 'no messages';
- console.log(error_message);
- return finish(null);
- }
+ if (!messages)
+ return bounce('no messages');
// this will also filter out the special message that performs the state changes
messages = messages.filter(function (message) { return ('payload' in message && (message.app !== 'payment' || 'outputs' in message.payload)); });
if (messages.length === 0) { // eat the received coins and send no response, state changes are still performed | bounce when there would be no messages and no state changes | byteball_ocore | train | js |
Subsets and Splits