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
|
---|---|---|---|---|---|
34fdf1f3bb7940bc190ba87524db6061508145de
|
diff --git a/lib/discordrb/events/channels.rb b/lib/discordrb/events/channels.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/events/channels.rb
+++ b/lib/discordrb/events/channels.rb
@@ -6,6 +6,9 @@ require 'discordrb/data'
module Discordrb::Events
# Raised when a channel is created
class ChannelCreateEvent < Event
+ # @return [Channel] the channel in question.
+ attr_reader :channel
+
attr_reader :type, :topic, :position, :name, :id, :server
def initialize(data, bot)
|
Add a reader for the ChannelCreateEvent channel
|
meew0_discordrb
|
train
|
rb
|
8efd9deb3217f38b21c9a79890c12148107fe28f
|
diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php
index <HASH>..<HASH> 100644
--- a/mod/assignment/lib.php
+++ b/mod/assignment/lib.php
@@ -321,6 +321,17 @@ class assignment_base {
echo '</div>';
echo '</tr>';
+ if ($this->type == 'uploadsingle') { //@TODO: move to overload view_feedback method in the class or is uploadsingle merging into upload?
+ $responsefiles = $this->print_responsefiles($submission->userid, true);
+ if (!empty($responsefiles)) {
+ echo '<tr>';
+ echo '<td class="left side"> </td>';
+ echo '<td class="content">';
+ echo $responsefiles;
+ echo '</tr>';
+ }
+ }
+
echo '</table>';
}
|
assignment MDL-<I> fixed upload single not displaying response file to student.
|
moodle_moodle
|
train
|
php
|
11bae7774d3ee2748d65c269f4c2b9851627df47
|
diff --git a/tests/Query/AggregateValueTestCase.php b/tests/Query/AggregateValueTestCase.php
index <HASH>..<HASH> 100644
--- a/tests/Query/AggregateValueTestCase.php
+++ b/tests/Query/AggregateValueTestCase.php
@@ -53,7 +53,7 @@ class Doctrine_Query_AggregateValue_TestCase extends Doctrine_UnitTestCase
$users->save();
}
- /**
+
public function testRecordSupportsValueMapping()
{
$record = new User();
@@ -124,7 +124,7 @@ class Doctrine_Query_AggregateValue_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($users[0]->count, 2);
$this->assertEqual($users[1]->count, 2);
}
- */
+
public function testAggregateValueMappingSupportsLeftJoins()
{
$q = new Doctrine_Query();
|
Uncommented some Aggregate test cases that now work
|
doctrine_annotations
|
train
|
php
|
06042292f0bd1c6596c896c7a1233b8c61f643a0
|
diff --git a/s2/latlng.go b/s2/latlng.go
index <HASH>..<HASH> 100644
--- a/s2/latlng.go
+++ b/s2/latlng.go
@@ -12,6 +12,7 @@ type LatLng struct {
Lat, Lng s1.Angle
}
+// LatLngFromDegrees returns a LatLng for the coordinates given in degrees.
func LatLngFromDegrees(lat, lng float64) LatLng {
return LatLng{s1.Angle(lat) * s1.Degree, s1.Angle(lng) * s1.Degree}
}
|
Add a comment to LatLngFromDegrees.
|
golang_geo
|
train
|
go
|
a0214c6db6e9c4bea9c12d027b81ed4473c347b9
|
diff --git a/tests/test_fs.py b/tests/test_fs.py
index <HASH>..<HASH> 100644
--- a/tests/test_fs.py
+++ b/tests/test_fs.py
@@ -11,18 +11,18 @@ from m2bk import fs
@raises(TypeError)
-def test_make_file_nonstr():
+def test_make_tarball_nonstr():
# _make_tarfile with non-string src_dir
- fs.make_file(123)
+ fs.make_tarball(123)
-def test_make_file():
+def test_make_tarball():
# whether the file name return is the expected
out_dir = "data"
out_file = out_dir + ".tar.gz"
#eq_(mongo._make_tarfile(out_dir), out_file)
# whether the expected file exists
- fs.make_file(out_dir)
+ fs.make_tarball(out_dir)
ok_(open(out_file), msg="Could not open expected output file")
os.remove(out_file)
|
Corrected tests for fs.make_tarball
|
axltxl_m2bk
|
train
|
py
|
1dda53437bb330c04b092d851dbd77acd4a2e42c
|
diff --git a/condoor/version.py b/condoor/version.py
index <HASH>..<HASH> 100644
--- a/condoor/version.py
+++ b/condoor/version.py
@@ -1,3 +1,3 @@
"""Version information."""
-__version__ = '1.0.0a5'
+__version__ = '1.0.0a6'
|
Bumped version number to <I>a6
|
kstaniek_condoor
|
train
|
py
|
562f95d59d838811f92430db457fd879df686806
|
diff --git a/lib/poise_python/python_providers/base.rb b/lib/poise_python/python_providers/base.rb
index <HASH>..<HASH> 100644
--- a/lib/poise_python/python_providers/base.rb
+++ b/lib/poise_python/python_providers/base.rb
@@ -40,6 +40,8 @@ module PoisePython
def action_install
notifying_block do
install_python
+ end
+ notifying_block do
install_pip
install_setuptools
install_virtualenv
|
Split the install process.
This is needed specifically for the `-m venv` check, because we need
Python to actually be installed by that point.
|
poise_poise-python
|
train
|
rb
|
778dd3d8965222255a3e3462555cd93c55a417f1
|
diff --git a/lib/Message/HeaderConverter.php b/lib/Message/HeaderConverter.php
index <HASH>..<HASH> 100644
--- a/lib/Message/HeaderConverter.php
+++ b/lib/Message/HeaderConverter.php
@@ -22,7 +22,7 @@ namespace Buzz\Message;
class HeaderConverter
{
/**
- * Convert from Buzz style headers to PSR style.
+ * Convert from PSR style headers to Buzz style.
*/
public static function toBuzzHeaders(array $headers): array
{
@@ -42,7 +42,7 @@ class HeaderConverter
}
/**
- * Convert from PSR style headers to Buzz style.
+ * Convert from Buzz style headers to PSR style.
*/
public static function toPsrHeaders(array $headers): array
{
|
moves comments to the correct methods (#<I>)
|
kriswallsmith_Buzz
|
train
|
php
|
64bda000ad46b24d5e6af19cec7bbaaf78b4f075
|
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -36,7 +36,7 @@ class Updater extends \common_ext_ExtensionUpdater
$currentVersion = $initialVersion;
- if ($this->isLessThan('2.8')) {
+ if ($this->isBetween('0','2.8')) {
$this->setVersion('2.8');
}
|
swich isLessThan to isBetween in update
|
oat-sa_extension-tao-devtools
|
train
|
php
|
ab03562280fabe0ef5901255f7e522450fd8b997
|
diff --git a/test/types/BigInt-type.spec.js b/test/types/BigInt-type.spec.js
index <HASH>..<HASH> 100644
--- a/test/types/BigInt-type.spec.js
+++ b/test/types/BigInt-type.spec.js
@@ -1,4 +1,11 @@
/* global expect, BigInt */
+
+// Bogus test to prevent jest from failing with "Your test suite must contain at least one test"
+// on node.js 9 and below, which don't have BigInt support:
+it('should be registered as a type', function() {
+ expect(expect.getType('BigInt'), 'to be truthy');
+});
+
if (typeof BigInt === 'function') {
describe('BigInt type', () => {
it('should consider an instance equal to itself', () => {
|
Bogus test to prevent jest from failing
... with "Your test suite must contain at least one test" on node.js 9
and below, which don't have BigInt support
|
unexpectedjs_unexpected
|
train
|
js
|
60a9b6233e4057b805365e79e6142ab0b29b10a6
|
diff --git a/safe/impact_functions/generic/classified_polygon_people/test/test_classified_polygon_people.py b/safe/impact_functions/generic/classified_polygon_people/test/test_classified_polygon_people.py
index <HASH>..<HASH> 100644
--- a/safe/impact_functions/generic/classified_polygon_people/test/test_classified_polygon_people.py
+++ b/safe/impact_functions/generic/classified_polygon_people/test/test_classified_polygon_people.py
@@ -86,12 +86,12 @@ class TestClassifiedPolygonPeopleFunction(unittest.TestCase):
}
self.assertEqual(features, expected_features)
expected_impact_summary = [
- '**High Hazard Zone**, 4,600------',
- '**Medium Hazard Zone**, 65,700------',
+ '**High Hazard Zone**, 7,300------',
+ '**Medium Hazard Zone**, 72,900------',
'**Low Hazard Zone**, 11,500------',
- '**Total affected people**, 81,600------',
+ '**Total affected people**, 91,600------',
'**Unaffected people**, 17,300------',
- '**Total people**, 98,900---'
+ '**Total people**, 109,000---'
]
for row in expected_impact_summary:
self.assertIn(row, function.impact_summary().to_text())
|
Update expected result in test for #<I>
|
inasafe_inasafe
|
train
|
py
|
a44a1675e44adb8b720fdfe41ab85896739cfd1a
|
diff --git a/lib/processors/elasticsearch_index_selector.js b/lib/processors/elasticsearch_index_selector.js
index <HASH>..<HASH> 100644
--- a/lib/processors/elasticsearch_index_selector.js
+++ b/lib/processors/elasticsearch_index_selector.js
@@ -172,8 +172,8 @@ function schema(){
upsert_fields: {
doc: 'if you are updating the documents, you can specify fields to update here (it should be an array ' +
'containing all the field names you want), it defaults to sending the entire document',
- default: '',
- format: 'optional_String'
+ default: [],
+ format: Array
}
};
}
|
upsert_fields should be an array in the schema
|
terascope_teraslice
|
train
|
js
|
e97c29b0ea783413eea5ea6ec08825868e03f20a
|
diff --git a/src/View/Factory.php b/src/View/Factory.php
index <HASH>..<HASH> 100644
--- a/src/View/Factory.php
+++ b/src/View/Factory.php
@@ -835,18 +835,16 @@ class Factory
*/
protected function findViewFile($view, $domain, $template = null)
{
- $viewPath = str_replace('/', DS, "Views/$view");
-
if (! is_null($template)) {
- $basePath = $this->getTemplatePath($template) .DS .'Override';
+ // Try to find the View file on the override locations.
+ $basePath = $this->getTemplatePath($template) .DS .'Override' .DS;
if ($domain != 'App') {
- $basePath .= DS .'Modules' .DS .$domain;
+ $basePath .= 'Modules' .DS .$domain .DS;
}
- $path = $basePath .DS .$viewPath;
+ $path = $basePath .str_replace('/', DS, "Views/$view");
- // Try to find the View file on the override locations.
try {
return $this->finder->find($path);
}
@@ -856,6 +854,7 @@ class Factory
}
// Try to find the View file on the base locations.
+ $viewPath = str_replace('/', DS, "Views/$view");
if ($domain == 'App') {
$path = APPPATH .$viewPath;
|
Improve Nova\View\Factory
|
nova-framework_system
|
train
|
php
|
4133e7f1c9300819fa599249428b46e7b53906b1
|
diff --git a/lib/genspec/generator_example_group.rb b/lib/genspec/generator_example_group.rb
index <HASH>..<HASH> 100644
--- a/lib/genspec/generator_example_group.rb
+++ b/lib/genspec/generator_example_group.rb
@@ -128,6 +128,7 @@ module GenSpec
end
end
+ alias before_generation within_source_root
alias with_arguments with_args
alias generator_arguments generator_args
|
Alias #within_source_root as #before_generation for convenience
|
sinisterchipmunk_genspec
|
train
|
rb
|
b72261b9a0c9e45c730eff86fae594428f6f932a
|
diff --git a/setuptools/tests/test_upload_docs.py b/setuptools/tests/test_upload_docs.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/test_upload_docs.py
+++ b/setuptools/tests/test_upload_docs.py
@@ -40,8 +40,10 @@ def sample_project(tmpdir_cwd):
class TestUploadDocsTest:
def test_create_zipfile(self):
- # Test to make sure zipfile creation handles common cases.
- # This explicitly includes a folder containing an empty folder.
+ """
+ Ensure zipfile creation handles common cases, including a folder
+ containing an empty folder.
+ """
dist = Distribution()
|
Replace comment with clearer docstring.
|
pypa_setuptools
|
train
|
py
|
e795b497ac21fb1b5d86ecdda0d9240ba47ae7c9
|
diff --git a/Query/Builder.php b/Query/Builder.php
index <HASH>..<HASH> 100755
--- a/Query/Builder.php
+++ b/Query/Builder.php
@@ -2049,7 +2049,7 @@ class Builder
$property = $this->unions ? 'unionLimit' : 'limit';
if ($value >= 0) {
- $this->$property = $value;
+ $this->$property = ! is_null($value) ? (int) $value : null;
}
return $this;
|
[7.x] Cast limits to int (#<I>)
* wip
* [6.x] Fixes Query Builder to only cast integer when given other than `null` (#<I>)
* Add failing tests
|
illuminate_database
|
train
|
php
|
5abd1c76c30915c6d0fb6922676925b98b1c9ea4
|
diff --git a/test/test.rb b/test/test.rb
index <HASH>..<HASH> 100644
--- a/test/test.rb
+++ b/test/test.rb
@@ -679,7 +679,7 @@ _buf = String.new;begin; (__erubi_stack ||= []) << _buf; _buf = String.new; __er
';
_buf.to_s
END2
-["burgers", "salads"]
+#{ list.to_s }
END3
end
|
Simplify test in attempt to get <I> passing
|
jeremyevans_erubi
|
train
|
rb
|
6875adad7e77f14d6d71afd631d4657830a214bf
|
diff --git a/src/main/java/com/box/sdk/BoxAPIConnection.java b/src/main/java/com/box/sdk/BoxAPIConnection.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/box/sdk/BoxAPIConnection.java
+++ b/src/main/java/com/box/sdk/BoxAPIConnection.java
@@ -272,7 +272,7 @@ public class BoxAPIConnection {
JsonObject jsonObject = JsonObject.readFrom(json);
this.accessToken = jsonObject.get("access_token").asString();
- this.refreshToken = jsonObject.get("refresh_token").asString();
+ this.setRefreshToken(jsonObject.get("refresh_token").asString());
this.expires = jsonObject.get("expires_in").asLong() * 1000;
}
}
|
Fix lastRefresh timestamp not being updated
|
box_box-java-sdk
|
train
|
java
|
f6c9bb4e83abcb6a2b062be99a7f315ad4c27edf
|
diff --git a/lib/ronin/object_context.rb b/lib/ronin/object_context.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/object_context.rb
+++ b/lib/ronin/object_context.rb
@@ -35,9 +35,9 @@ module Ronin
def self.included(base)
base.class_eval do
+ include Model
include Context
include Parameters
- include Model
# The Path to the object context
property :object_path, String, :key => true
|
Apparently the ordering of the included modules matters.
* Fixed a bug where Parameters#initialize wasn't being called.
|
ronin-ruby_ronin
|
train
|
rb
|
ce2a711c17d6961490c665cd17e2dc00431f6093
|
diff --git a/lib/bowline/base.rb b/lib/bowline/base.rb
index <HASH>..<HASH> 100644
--- a/lib/bowline/base.rb
+++ b/lib/bowline/base.rb
@@ -72,6 +72,10 @@ module Bowline
@element = element
end
+ def trigger(event, data = nil)
+ self.element.trigger(event, data)
+ end
+
def js
self.class.js
end
diff --git a/lib/bowline/initializer.rb b/lib/bowline/initializer.rb
index <HASH>..<HASH> 100644
--- a/lib/bowline/initializer.rb
+++ b/lib/bowline/initializer.rb
@@ -460,8 +460,8 @@ module Bowline
def default_framework_paths
[
- File.join(root_path, 'vendor', 'bowline'),
- File.join(root_path, 'vendor', 'rails', 'activesupport', 'lib')
+ File.join(root_path, 'vendor', 'bowline', 'lib'),
+ File.join(root_path, 'vendor', 'rails', 'activesupport', 'lib')
]
end
|
Add trigger to base, edit framework load paths"
|
maccman_bowline
|
train
|
rb,rb
|
cac8331022c96e5b4faa54b1585714f2dcfe95b8
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -16,7 +16,7 @@ function expand(str) {
if (!m || /\$$/.test(m.pre)) return [str];
var isNumericSequence = /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/.test(m.body);
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](\.\.\d+)?$/.test(m.body);
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](\.\.-?\d+)?$/.test(m.body);
var isSequence = isNumericSequence || isAlphaSequence;
var isOptions = /^(.*,)+(.+)?$/.test(m.body);
if (!isSequence && !isOptions) return [str];
|
Allow negative inc's in alpha sequences
|
juliangruber_brace-expansion
|
train
|
js
|
68cdb263b81299e2b0472becc536dab289fa0433
|
diff --git a/spec/puppet-syntax/manifests_spec.rb b/spec/puppet-syntax/manifests_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/puppet-syntax/manifests_spec.rb
+++ b/spec/puppet-syntax/manifests_spec.rb
@@ -78,6 +78,17 @@ describe PuppetSyntax::Manifests do
expect(output[1]).to match(/Deprecation notice:/)
end
end
+ elsif Puppet::Util::Package.versioncmp(Puppet.version, '3.5') >= 0
+ context 'on puppet 3.5 and 3.6' do
+ it 'should return deprecation notices as warnings' do
+ files = fixture_manifests('deprecation_notice.pp')
+ output, has_errors = subject.check(files)
+
+ expect(has_errors).to eq(false)
+ expect(output.size).to eq(1)
+ expect(output[0]).to match(/The use of 'import' is deprecated/)
+ end
+ end
elsif Puppet::Util::Package.versioncmp(Puppet.version, '3.5') < 0
context 'on puppet < 3.5' do
it 'should not print deprecation notices' do
|
Add a test for puppet <I> and <I>
|
voxpupuli_puppet-syntax
|
train
|
rb
|
b7779f3d76a0533b4b88893bcafd53881946ec7a
|
diff --git a/slave/core.py b/slave/core.py
index <HASH>..<HASH> 100644
--- a/slave/core.py
+++ b/slave/core.py
@@ -330,10 +330,11 @@ class InstrumentBase(object):
class CommandSequence(slave.misc.ForwardSequence):
"""A sequence forwarding item access to the query and write methods."""
- def __init__(self, iterable):
+ def __init__(self, iterable, transport):
+ self._transport = transport
super(CommandSequence, self).__init__(
iterable,
- get=lambda i: i.query(),
- set=lambda i, v: i.write(v)
+ get=lambda i: i.query(self._transport),
+ set=lambda i, v: i.write(self._transport, v)
)
|
Fixed CommandSequence to work with transport injection.
|
p3trus_slave
|
train
|
py
|
03f321fef5789e8f7f159fa8cf5002357e92d5be
|
diff --git a/src/Cache/CacheServiceProvider.php b/src/Cache/CacheServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Cache/CacheServiceProvider.php
+++ b/src/Cache/CacheServiceProvider.php
@@ -53,7 +53,14 @@ class CacheServiceProvider extends ServiceProvider
$this->app['cache.store'] = function($app)
{
- return $app['cache']->storage(!$app['config']->get('caching') ? 'none' : $app['config']->get('cache_handler'));
+ $handler = !$app['config']->get('caching') ? 'none' : $app['config']->get('cache_handler');
+
+ if ($app->isAdmin())
+ {
+ $handler = 'none';
+ }
+
+ return $app['cache']->storage($handler);
};
}
}
|
Disable caching for admin side. Ideally, this should be controlled by config override.
|
hubzero_framework
|
train
|
php
|
e1fbfa350e4956d0aabf508a266258d38f2aea5c
|
diff --git a/lib/fastlane/actions/get_ipa_info_plist_value.rb b/lib/fastlane/actions/get_ipa_info_plist_value.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/get_ipa_info_plist_value.rb
+++ b/lib/fastlane/actions/get_ipa_info_plist_value.rb
@@ -8,7 +8,8 @@ module Fastlane
def self.run(params)
ipa = File.expand_path(params[:ipa])
key = params[:key]
- value = sh("/usr/libexec/PlistBuddy -c Print:#{key}: /dev/stdin <<< `unzip -p #{ipa} Payload/*.app/Info.plist`").strip
+ plist = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(ipa)
+ value = plist[key]
Actions.lane_context[SharedValues::GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE] = value
|
Using FastlaneCore::IpaFileAnalyser.fetch_info_plist_file instead of shell commands to read Plist from the .ipa
|
fastlane_fastlane
|
train
|
rb
|
a7215fc88de862a18e8f4ff34cfbf081084ae73c
|
diff --git a/test/moment/format.js b/test/moment/format.js
index <HASH>..<HASH> 100644
--- a/test/moment/format.js
+++ b/test/moment/format.js
@@ -145,9 +145,13 @@ exports.format = {
test.expect(supportsJson ? 2 : 1);
test.equal(date.toJSON(), "2012-10-09T20:30:40.678Z", "should output ISO8601 on moment.fn.toJSON");
- test.equal(JSON.stringify({
- date : date
- }), '{"date":"2012-10-09T20:30:40.678Z"}', "should output ISO8601 on JSON.stringify");
+
+ if (supportsJson) {
+ test.equal(JSON.stringify({
+ date : date
+ }), '{"date":"2012-10-09T20:30:40.678Z"}', "should output ISO8601 on JSON.stringify");
+ }
+
test.done();
},
|
Don't test JSON.stringify if it doesn't exist #<I>
|
moment_moment
|
train
|
js
|
818fcfd180fcd0a2ab0c2df2fcdf4caf353a334c
|
diff --git a/components/icon/generate-exports.js b/components/icon/generate-exports.js
index <HASH>..<HASH> 100644
--- a/components/icon/generate-exports.js
+++ b/components/icon/generate-exports.js
@@ -1,6 +1,6 @@
const fs = require('fs');
-const path = require('path').posix;
+const path = require('path');
const glob = require('glob');
const changeCase = require('change-case');
@@ -11,7 +11,7 @@ const generate = (packageName, output, suffix = 'Icon') => {
// TODO: add deduplication instead
filter(filename => !/apple-mask-icon\.svg$/.test(filename)).
map(filename => ({
- importPath: path.join(packageName, filename).replace(/\\/g, '/'),
+ importPath: path.posix.join(packageName, filename),
// eslint-disable-next-line no-magic-numbers
name: changeCase.camelCase(path.basename(filename).slice(0, -4), null, true)
}));
|
RG-<I> Use path.posix only for import name [publish]
|
JetBrains_ring-ui
|
train
|
js
|
ffec129cc513dd15cf1ff494222f44e3b56e3ab7
|
diff --git a/src/Component/CsvExport.php b/src/Component/CsvExport.php
index <HASH>..<HASH> 100644
--- a/src/Component/CsvExport.php
+++ b/src/Component/CsvExport.php
@@ -154,7 +154,12 @@ class CsvExport extends Part
protected function escapeString($str)
{
- return str_replace('"', '\'', strip_tags(html_entity_decode($str)));
+ $str = html_entity_decode($str);
+ $str = strip_tags($str);
+ $str = str_replace('"', '\'', $str);
+ $str = preg_replace('/\s+/', ' ', $str);
+ $str = trim($str);
+ return $str;
}
/**
|
Removing double spaces and new lines from CSV
Need do some string cleanup.
Remove >1 spaces and all new lines, trailing spaces.
To avoid incorrect display in Excel/Calc columns after html code stripping.
OO Calc: <URL>
|
view-components_grids
|
train
|
php
|
9ca194a70ad576aee445da77d12e7177990f23e2
|
diff --git a/elasticsearch_async/transport.py b/elasticsearch_async/transport.py
index <HASH>..<HASH> 100644
--- a/elasticsearch_async/transport.py
+++ b/elasticsearch_async/transport.py
@@ -95,7 +95,7 @@ class AsyncTransport(Transport):
# close those connections that are not in use any more
for c in orig_connections:
if c not in self.connection_pool.connections:
- c.close()
+ yield from c.close()
@asyncio.coroutine
def main_loop(self, method, url, params, body, ignore=(), timeout=None):
|
Actually wait for the connections to close
Thanks @asvetlov
|
elastic_elasticsearch-py-async
|
train
|
py
|
705ac099ce05b097efdeb39d60bd8f9db218ae92
|
diff --git a/scenarios/dindind_execute.py b/scenarios/dindind_execute.py
index <HASH>..<HASH> 100755
--- a/scenarios/dindind_execute.py
+++ b/scenarios/dindind_execute.py
@@ -36,6 +36,7 @@ def main(envs, cmd):
"""Make important mounts r-shared, then run script and verify it exits 0."""
check("mount", "--make-rshared", "/lib/modules")
check("mount", "--make-rshared", "/sys")
+ check("mount", "--make-rshared", "/")
for env in envs:
key, val = env.split('=', 1)
|
Make / rshared in dindind scenario
|
kubernetes_test-infra
|
train
|
py
|
4e6b54ade608a5c03e14c3e9c5164a7c8c955985
|
diff --git a/Kwf/Component/Cache/Mysql.php b/Kwf/Component/Cache/Mysql.php
index <HASH>..<HASH> 100644
--- a/Kwf/Component/Cache/Mysql.php
+++ b/Kwf/Component/Cache/Mysql.php
@@ -149,7 +149,7 @@ class Kwf_Component_Cache_Mysql extends Kwf_Component_Cache
protected static function _getCacheId($componentId, $renderer, $type, $value)
{
- return "cc-$componentId/$renderer/$type/$value";
+ return "cc_".str_replace('-', '__', $componentId)."_{$renderer}_{$type}_{$value}";
}
public static function getCacheId($componentId, $renderer, $type, $value)
|
why o why can't we just any string as cache id
|
koala-framework_koala-framework
|
train
|
php
|
ffe0af8629897fbff54725e6317f481a4022470c
|
diff --git a/pkg/model/context.go b/pkg/model/context.go
index <HASH>..<HASH> 100644
--- a/pkg/model/context.go
+++ b/pkg/model/context.go
@@ -44,8 +44,6 @@ const (
clusterAutoscalerNodeTemplateTaint = "k8s.io/cluster-autoscaler/node-template/taint/"
)
-var UseLegacyELBName = featureflag.New("UseLegacyELBName", featureflag.Bool(false))
-
// KopsModelContext is the kops model
type KopsModelContext struct {
iam.IAMModelContext
@@ -60,16 +58,6 @@ type KopsModelContext struct {
func (m *KopsModelContext) GetELBName32(prefix string) string {
c := m.Cluster.ObjectMeta.Name
- if UseLegacyELBName.Enabled() {
- tokens := strings.Split(c, ".")
- s := fmt.Sprintf("%s-%s", prefix, tokens[0])
- if len(s) > 32 {
- s = s[:32]
- }
- klog.Infof("UseLegacyELBName feature-flag is set; built legacy name %q", s)
- return s
- }
-
// The LoadBalancerName is exposed publicly as the DNS name for the load balancer.
// So this will likely become visible in a CNAME record - this is potentially some
// information leakage.
|
Remove support for using legacy ELB name
|
kubernetes_kops
|
train
|
go
|
a32b635d5eca43dd8a645f3b9bc46cc584d07328
|
diff --git a/js/jquery.tooltipster.js b/js/jquery.tooltipster.js
index <HASH>..<HASH> 100644
--- a/js/jquery.tooltipster.js
+++ b/js/jquery.tooltipster.js
@@ -278,11 +278,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
pointerEvents = self.options.interactive ? 'pointer-events: auto;' : '';
// build the base of our tooltip
- self.$tooltip = $('<div class="tooltipster-base '+ animation + ' ' + themeClass +'" style="'+ fixedWidth +' '+ maxWidth +' '+ pointerEvents +' '+ animationSpeed +'"><div class="tooltipster-content"></div></div>');
+ self.$tooltip = $('<div class="tooltipster-base '+ animation + ' ' + themeClass +'" style="'+ fixedWidth +' '+ maxWidth +' '+ pointerEvents +' '+ animationSpeed +'"></div>');
+ var $cont = $('<div class="tooltipster-content"></div>');
+
+ if(typeof self.content === 'string') $cont.text(self.content);
+ else $cont.append(self.content);
+
self.$tooltip
- .children()
- .append(self.content)
- .end()
+ .append($cont)
.appendTo('body');
// do all the crazy calculations and positioning
|
Title attributes are now treated as strings as they should be, not HTML
|
iamceege_tooltipster
|
train
|
js
|
d866c97e4b82124435a04d914b7c9e5d422b49a2
|
diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -37,9 +37,9 @@ const JHIPSTER_DOCUMENTATION_URL = 'https://jhipster.github.io';
const JHIPSTER_DOCUMENTATION_ARCHIVE_PATH = '/documentation-archive/';
const constants = {
- QUESTIONS: 14, // maximum possible number of questions
+ QUESTIONS: 15, // maximum possible number of questions
CLIENT_QUESTIONS: 4,
- SERVER_QUESTIONS: 10,
+ SERVER_QUESTIONS: 15,
INTERPOLATE_REGEX: /<%:([\s\S]+?)%>/g, // so that tags in templates do not get mistreated as _ templates
DOCKER_DIR: MAIN_DIR + 'docker/',
|
Increment the total number of questions
|
jhipster_generator-jhipster
|
train
|
js
|
f1a600deb1f4723c91f8207dacd86cba5663be06
|
diff --git a/atmosphere-packages/angular-typescript-compiler/index.js b/atmosphere-packages/angular-typescript-compiler/index.js
index <HASH>..<HASH> 100644
--- a/atmosphere-packages/angular-typescript-compiler/index.js
+++ b/atmosphere-packages/angular-typescript-compiler/index.js
@@ -280,8 +280,22 @@ export class AngularTsCompiler {
console.timeEnd(`[${prefix}]: TypeScript Files Compilation`);
if (this.isRollup && !mainCodePath.includes('node_modules')) {
console.time(`[${prefix}]: Rollup`);
+
+ let namedExports = null;
+ const namedExportsPath = path.join(basePath, 'named-exports.json');
+ if (fs.existsSync(namedExportsPath)) {
+ try {
+ namedExports = JSON.parse(fs.readFileSync(namedExportsPath));
+ } catch (e) {
+ console.error(
+ 'Error: named-exports.json does not contain valid JSON'
+ );
+ console.error(e);
+ }
+ }
+
const bundle = rollup(codeMap, mainCode, mainCodePath,
- null, null, forWeb);
+ null, namedExports, forWeb);
if (bundle) {
// Look for a ts-file in the client or server
// folder to add generated bundle.
|
Add support for namedExports when using Rollup (#<I>)
|
Urigo_angular-meteor
|
train
|
js
|
9733b718f083bf0d82ea0c75d957b81301ea8666
|
diff --git a/test/drag/drag.js b/test/drag/drag.js
index <HASH>..<HASH> 100644
--- a/test/drag/drag.js
+++ b/test/drag/drag.js
@@ -1,4 +1,4 @@
-steal("../../browser/jquery", "jquerypp/index.js", function($){
+steal("jquerypp/index.js", function($){
window.jQuery = $;
var hoveredOnce = false;
|
Fix the funcunit-syn integration “Drag To” test
Dragging & dropping works because of jQuery++, so its version of jQuery had to be referenced instead of the `browser/jquery` import.
|
bitovi_funcunit
|
train
|
js
|
1283cfd77f01a4b75dbad186990014ed24292fa5
|
diff --git a/rejected/process.py b/rejected/process.py
index <HASH>..<HASH> 100644
--- a/rejected/process.py
+++ b/rejected/process.py
@@ -703,7 +703,8 @@ class Process(multiprocessing.Process, state.State):
# Setup the Sentry client
if raven and 'sentry_dsn' in cfg:
- self.sentry_client = raven.Client(cfg['sentry_dsn'])
+ options = {'tags': {'consumer_type': consumer_name}}
+ self.sentry_client = raven.Client(cfg['sentry_dsn'], **options)
# Setup the stats counter instance
self.stats = stats.Stats(self.name, consumer_name, cfg['statsd'] or {})
|
Tag consumer in Sentry exceptions.
|
gmr_rejected
|
train
|
py
|
5497943e2c6115d272b10e031dfd1385d6d429cf
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -48,9 +48,9 @@ copyright = u'2014, Richard Hattersley'
# built documents.
#
# The short X.Y version.
-version = '0.1.0'
+version = '0.3.0'
# The full version, including alpha/beta/rc tags.
-release = '0.1.0'
+release = '0.3.0-0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
|
Update version number in docs.
|
rhattersley_pyepsg
|
train
|
py
|
7956818357ccb8a276920e0501293cf310e63167
|
diff --git a/src/libs/extensions/core/AModel.php b/src/libs/extensions/core/AModel.php
index <HASH>..<HASH> 100644
--- a/src/libs/extensions/core/AModel.php
+++ b/src/libs/extensions/core/AModel.php
@@ -1,13 +1,12 @@
<?php
+namespace extensions\core;
+
/**
* This's an abstract model class. For functionality demonstration only.
* @todo Realize the interface and business logic.
* @author coon.
*/
-
-namespace extensions\core;
-
abstract class AModel {
// Put your code here.
}
|
The phpDoc was corrected.
|
selikhovleonid_nadir
|
train
|
php
|
25e31e5f2690610d9e5a3e61e1bf3acf9afae749
|
diff --git a/packages/@uppy/provider-views/src/index.js b/packages/@uppy/provider-views/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/@uppy/provider-views/src/index.js
+++ b/packages/@uppy/provider-views/src/index.js
@@ -81,6 +81,7 @@ module.exports = class ProviderView {
}
_updateFilesAndFolders (res, files, folders) {
+ this.nextPagePath = res.nextPagePath
res.items.forEach((item) => {
if (item.isFolder) {
folders.push(item)
@@ -128,7 +129,6 @@ module.exports = class ProviderView {
}
this.username = this.username ? this.username : res.username
- this.nextPagePath = res.nextPagePath
this._updateFilesAndFolders(res, files, folders)
this.plugin.setPluginState({ directories: updatedDirectories })
},
@@ -463,7 +463,7 @@ module.exports = class ProviderView {
handleScroll (e) {
const scrollPos = e.target.scrollHeight - (e.target.scrollTop + e.target.offsetHeight)
- const path = this.nextPagePath ? this.nextPagePath : null
+ const path = this.nextPagePath || null
if (scrollPos < 50 && path && !this._isHandlingScroll) {
this.provider.list(path)
|
fix: update instagram nextPagePath after every fetch
|
transloadit_uppy
|
train
|
js
|
1462a22443e9fb2a8f7c3f60b909a3168284bc72
|
diff --git a/tests/Library/test_config.inc.php b/tests/Library/test_config.inc.php
index <HASH>..<HASH> 100644
--- a/tests/Library/test_config.inc.php
+++ b/tests/Library/test_config.inc.php
@@ -59,6 +59,7 @@ require_once OX_BASE_PATH . 'core/oxfunctions.php';
$oConfigFile = new OxConfigFile(OX_BASE_PATH . "config.inc.php");
OxRegistry::set("OxConfigFile", $oConfigFile);
if ($sTestType == 'acceptance') {
+ oxRegistry::set("oxConfig", new oxConfig());
oxRegistry::set("oxConfig", oxNew('oxConfig'));
} else {
oxRegistry::set("oxConfig", new oxConfig());
|
ESDEV-<I> Change test_config
Set oxconfig to oxregistry, to solve loop issue.
(cherry picked from commit db2c<I>d)
|
OXID-eSales_oxideshop_ce
|
train
|
php
|
aae36c2f3e6129720483a176000bf1da9f6c0ffa
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -35,7 +35,7 @@ class I18n::TestCase < TEST_CASE
I18n.backend = nil
I18n.default_separator = nil
I18n.enforce_available_locales = true
- I18n.fallbacks = nil
+ I18n.fallbacks = nil if I18n.respond_to?(:fallbacks=)
super
end
|
Only attempt to set fallbacks= in tests if method is defined
|
ruby-i18n_i18n
|
train
|
rb
|
a5ccf0bde0e3cac5a157e93025dadaff5fd1c446
|
diff --git a/aikif/web_app/page_agents.py b/aikif/web_app/page_agents.py
index <HASH>..<HASH> 100644
--- a/aikif/web_app/page_agents.py
+++ b/aikif/web_app/page_agents.py
@@ -10,7 +10,7 @@ print(root_fldr)
def get_page():
txt = ''
txt += load_agent_list(os.path.join(root_fldr,"data"))
- txt += web.build_edit_form('Agents', '001', ['Agent Name', 'Program Location', 'params'])
+ txt += web.build_edit_form('Agents', '001', ['Agent Name', 'Program Location', 'params'], '/agents')
return txt
|
page_agents web interface passes return page as param
|
acutesoftware_AIKIF
|
train
|
py
|
b1fffe7b2673f5aaad72304d999f4a55b2cc2edc
|
diff --git a/airflow/api_connexion/endpoints/task_instance_endpoint.py b/airflow/api_connexion/endpoints/task_instance_endpoint.py
index <HASH>..<HASH> 100644
--- a/airflow/api_connexion/endpoints/task_instance_endpoint.py
+++ b/airflow/api_connexion/endpoints/task_instance_endpoint.py
@@ -326,7 +326,9 @@ def post_set_task_instances_state(*, dag_id: str, session: Session = NEW_SESSION
detail=f"Task instance not found for task {task_id!r} on execution_date {execution_date}"
)
- if run_id and not session.query(TI).get({'task_id': task_id, 'dag_id': dag_id, 'run_id': run_id}):
+ if run_id and not session.query(TI).get(
+ {'task_id': task_id, 'dag_id': dag_id, 'run_id': run_id, 'map_index': -1}
+ ):
error_message = f"Task instance not found for task {task_id!r} on DAG run with ID {run_id!r}"
raise NotFound(detail=error_message)
|
Fix failing main (#<I>)
When I merged #<I> the jobs ran successfully but it's now failing in main.
This PR fixes it
|
apache_airflow
|
train
|
py
|
7270f9a26bb57206962267ca8814a65471f9c994
|
diff --git a/server/src/main/java/org/openscoring/server/Main.java b/server/src/main/java/org/openscoring/server/Main.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/openscoring/server/Main.java
+++ b/server/src/main/java/org/openscoring/server/Main.java
@@ -60,10 +60,10 @@ public class Main {
private String contextPath = "/openscoring";
@Parameter (
- names = {"--deploy-dir"},
+ names = {"--model-dir"},
description = "Model auto-deployment directory"
)
- private File deployDir = null;
+ private File modelDir = null;
@Parameter (
names = {"--console-war"},
@@ -167,13 +167,13 @@ public class Main {
DirectoryDeployer deployer = null;
- if(this.deployDir != null){
+ if(this.modelDir != null){
- if(!this.deployDir.isDirectory()){
- throw new IOException(this.deployDir.getAbsolutePath() + " is not a directory");
+ if(!this.modelDir.isDirectory()){
+ throw new IOException(this.modelDir.getAbsolutePath() + " is not a directory");
}
- deployer = new DirectoryDeployer(modelRegistry, this.deployDir.toPath());
+ deployer = new DirectoryDeployer(modelRegistry, this.modelDir.toPath());
}
server.start();
|
Renamed a command-line option
|
openscoring_openscoring
|
train
|
java
|
939aa7e289f61ee48cc1bb3517f07f9b878a9985
|
diff --git a/builder/vmware/iso/builder_test.go b/builder/vmware/iso/builder_test.go
index <HASH>..<HASH> 100644
--- a/builder/vmware/iso/builder_test.go
+++ b/builder/vmware/iso/builder_test.go
@@ -169,6 +169,20 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
}
// Good
+ config["remote_type"] = ""
+ config["remote_host"] = ""
+ config["remote_password"] = ""
+ config["remote_private_key_file"] = ""
+ b = Builder{}
+ warns, err = b.Prepare(config)
+ if len(warns) > 0 {
+ t.Fatalf("bad: %#v", warns)
+ }
+ if err != nil {
+ t.Fatalf("should not have error: %s", err)
+ }
+
+ // Good
config["remote_type"] = "esx5"
config["remote_host"] = "foobar.example.com"
config["remote_password"] = "supersecret"
|
Add test: We shouldn't error when main remote options are unset
|
hashicorp_packer
|
train
|
go
|
f1f47a020e4b4fa3fc23959a3c163631f4fe8ae0
|
diff --git a/tests/Localization/EnTest.php b/tests/Localization/EnTest.php
index <HASH>..<HASH> 100644
--- a/tests/Localization/EnTest.php
+++ b/tests/Localization/EnTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Tests\Carbon;
+namespace Tests\Localization;
use Carbon\Carbon;
use Tests\AbstractTestCase;
diff --git a/tests/Localization/KmTest.php b/tests/Localization/KmTest.php
index <HASH>..<HASH> 100644
--- a/tests/Localization/KmTest.php
+++ b/tests/Localization/KmTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Tests\Carbon;
+namespace Tests\Localization;
use Carbon\Carbon;
use Tests\AbstractTestCase;
diff --git a/tests/Localization/UzTest.php b/tests/Localization/UzTest.php
index <HASH>..<HASH> 100644
--- a/tests/Localization/UzTest.php
+++ b/tests/Localization/UzTest.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Tests\Carbon;
+namespace Tests\Localization;
use Carbon\Carbon;
use Tests\AbstractTestCase;
|
Fixed namespaces of a few tests
|
briannesbitt_Carbon
|
train
|
php,php,php
|
50b502ad319caf1d08024144aefea846dffe1ed8
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -182,8 +182,9 @@ Discovery.prototype._onanswer = function (answer, port, host) {
if (PORT.test(data.announce)) {
var announce = Number(data.announce) || port
this.emit('peer', id, {port: announce, host: host})
- this._domainStore.add(id, announce, host)
- this._push(id, announce, host)
+ if (this._domainStore.add(id, announce, host)) {
+ this._push(id, announce, host)
+ }
}
if (PORT.test(data.unannounce)) {
diff --git a/store.js b/store.js
index <HASH>..<HASH> 100644
--- a/store.js
+++ b/store.js
@@ -72,7 +72,8 @@ Store.prototype.add = function (name, port, host) {
}
var prev = entry.byAddr.get(peer.address)
- if (!prev) {
+ var old = !!prev
+ if (!old) {
prev = peer
set.add(entry.values, peer)
entry.byAddr.set(peer.address, peer)
@@ -80,7 +81,7 @@ Store.prototype.add = function (name, port, host) {
}
if (this.ttl) prev._modified = Date.now()
- return peer
+ return !old
}
Store.prototype.evict = function () {
|
only push out updates if entry is new
|
mafintosh_dns-discovery
|
train
|
js,js
|
7723add308e26aceae0611845f20314f7d35b24f
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
-readme = open('README.rst').read()
+readme = open('README.rst', encoding='utf8', errors='ignore').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
setup(
|
Fix for Python 3 and Django 2.x, commit more changed files.
|
weijia_djangoautoconf
|
train
|
py
|
7fb8bb63f444afe5f478154f72fb836f9d3fc074
|
diff --git a/pymongo/__init__.py b/pymongo/__init__.py
index <HASH>..<HASH> 100644
--- a/pymongo/__init__.py
+++ b/pymongo/__init__.py
@@ -33,7 +33,7 @@ SLOW_ONLY = 1
ALL = 2
"""Profile all operations."""
-version = "1.1.1+"
+version = "1.1.2"
"""Current version of PyMongo."""
Connection = PyMongo_Connection
diff --git a/pymongo/message.py b/pymongo/message.py
index <HASH>..<HASH> 100644
--- a/pymongo/message.py
+++ b/pymongo/message.py
@@ -19,7 +19,7 @@ MongoDB.
.. note:: This module is for internal use and is generally not needed by
application developers.
-.. versionadded:: 1.1.1+
+.. versionadded:: 1.1.2
"""
import threading
|
BUMP <I> faster insert speed (message creation happens in C now), use random number for request_id, fix some race conditions with AutoReconnect exceptions
|
mongodb_mongo-python-driver
|
train
|
py,py
|
59bb41c5a3052d633d3f84701abbc2cabc5699d8
|
diff --git a/code/extensions/CustomSiteConfig.php b/code/extensions/CustomSiteConfig.php
index <HASH>..<HASH> 100644
--- a/code/extensions/CustomSiteConfig.php
+++ b/code/extensions/CustomSiteConfig.php
@@ -27,6 +27,11 @@ class CustomSiteConfig extends DataExtension {
}
function updateCMSFields(FieldList $fields) {
+ // subsite theme setting is managed in SubsiteAdmin instead
+ if(Subsite::currentSubsiteID()) {
+ $fields->removeByName('Theme');
+ }
+
$fields->addFieldToTab('Root.Main', $gaCode = new TextField('GACode', 'Google Analytics account'));
$gaCode->setRightTitle('Account number to be used all across the site (in the format <strong>UA-XXXXX-X</strong>)');
|
Don't show theme dropdown in Settings when on a subsite
It's managed in SubsiteAdmin instead.
|
silverstripe_cwp
|
train
|
php
|
d612edd6251f0e41f57245acf7c8bd10ed2411a8
|
diff --git a/src/FrontendIntegration/HybridList.php b/src/FrontendIntegration/HybridList.php
index <HASH>..<HASH> 100644
--- a/src/FrontendIntegration/HybridList.php
+++ b/src/FrontendIntegration/HybridList.php
@@ -76,12 +76,14 @@ class HybridList extends MetaModelHybrid
foreach ($objItemRenderer->getFilterSettings()->getParameters() as $name) {
if ($filterUrl->hasSlug($name)) {
$result[$name] = $filterUrl->getSlug($name);
+ } elseif ($filterUrl->hasGet($name)) {
+ $result[$name] = $filterUrl->getGet($name);
}
// DAMN Contao - we have to "mark" the keys in the Input class as used as we get an 404 otherwise.
Input::get($name);
}
- return $filterUrl->getSlugParameters();
+ return $result;
}
/**
|
Also read parameters from "get" section
Before only slugs were read
|
MetaModels_core
|
train
|
php
|
8f1ffec72ffd6fa5147fd937480e163d17914f8b
|
diff --git a/tests/python/twitter/pants/base/test_parse_context.py b/tests/python/twitter/pants/base/test_parse_context.py
index <HASH>..<HASH> 100644
--- a/tests/python/twitter/pants/base/test_parse_context.py
+++ b/tests/python/twitter/pants/base/test_parse_context.py
@@ -16,7 +16,6 @@
import os
import pytest
-import unittest
from textwrap import dedent
@@ -25,9 +24,11 @@ from twitter.common.dirutil import safe_mkdir
from twitter.pants.base.address import Address
from twitter.pants.base.build_file import BuildFile
+from twitter.pants.base_build_root_test import BaseBuildRootTest
from twitter.pants.base.parse_context import ParseContext
from twitter.pants.base.target import Target
+
def create_buildfile(root_dir, relpath, name='BUILD', content=''):
path = os.path.join(root_dir, relpath)
safe_mkdir(path)
@@ -37,7 +38,7 @@ def create_buildfile(root_dir, relpath, name='BUILD', content=''):
return BuildFile(root_dir, relpath)
-class ParseContextTest(unittest.TestCase):
+class ParseContextTest(BaseBuildRootTest):
def test_locate(self):
with pytest.raises(ParseContext.ContextError):
ParseContext.locate()
|
Fixup bad merge, ParseContextTest needs to extend BaseBuildRootTest to properly handle config loading.
(sapling split of <I>e7eb5ba<I>ee<I>e<I>eda3fa<I>bc<I>e1e)
|
pantsbuild_pants
|
train
|
py
|
a43c1ebbfc7808f3202e2a7213bbbb26802bf7dc
|
diff --git a/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java b/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
+++ b/src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
@@ -397,7 +397,7 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface, Lo
tupleFields.add(colSchema);
valSchema = new ResourceFieldSchema();
- validator = validators.get(cdef.getName());
+ validator = validators.get(ByteBuffer.wrap(cdef.getName()));
if (validator == null)
validator = marshallers.get(1);
valSchema.setName("value");
|
fix bad validator lookup
patch by dbrosius; reviewed by jbellis for CASSANDRA-<I>
|
Stratio_stratio-cassandra
|
train
|
java
|
9962766b43d297f756507ba4bba40372b5cf80fa
|
diff --git a/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php b/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php
+++ b/src/Graviton/RestBundle/Routing/Loader/ActionUtils.php
@@ -16,7 +16,7 @@ use Symfony\Component\Routing\Route;
*/
class ActionUtils
{
- const ID_PATTERN = '[a-zA-Z0-9\-_\/]+';
+ const ID_PATTERN = '[a-zA-Z0-9\-_\/\+]+';
/**
* Get route for GET requests
|
add "+" to allowed characters in id parameter as we have a fixture (and unit-test) demonstrating the possibility we can serve that in /core/config
|
libgraviton_graviton
|
train
|
php
|
07c295aa746daf633305f36470e89762a4eab1f0
|
diff --git a/lib/suspenders/app_builder.rb b/lib/suspenders/app_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/suspenders/app_builder.rb
+++ b/lib/suspenders/app_builder.rb
@@ -142,14 +142,19 @@ module Suspenders
def enable_rack_canonical_host
config = <<-RUBY
-if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
+
+ if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
end
config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST")
RUBY
- configure_environment "production", config
+ inject_into_file(
+ "config/environments/production.rb",
+ config,
+ after: "Rails.application.configure do",
+ )
end
def enable_rack_deflater
|
APPLICATION_HOST bug fix in production environment
`ENV["APPLICATION_HOST"]` is used before it's defined in the production
environment.
By using `inject_into_file` instead of `configure_environment` we can
control the order of the steps.
[fixes #<I>]
|
thoughtbot_suspenders
|
train
|
rb
|
f01e1c865f35bd6578a2c0ef5b2d530538588ecb
|
diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go
index <HASH>..<HASH> 100644
--- a/integration-cli/docker_cli_run_unix_test.go
+++ b/integration-cli/docker_cli_run_unix_test.go
@@ -983,7 +983,7 @@ func (s *DockerSuite) TestRunPidsLimit(c *check.C) {
}
func (s *DockerSuite) TestRunPrivilegedAllowedDevices(c *check.C) {
- testRequires(c, DaemonIsLinux)
+ testRequires(c, DaemonIsLinux, NotUserNamespace)
file := "/sys/fs/cgroup/devices/devices.list"
out, _ := dockerCmd(c, "run", "--privileged", "busybox", "cat", file)
|
Disable privileged test from in user namespace
|
moby_moby
|
train
|
go
|
7a83e79d56deed259dfc68af446b5984d4c9c3d3
|
diff --git a/gym/lib/gym/runner.rb b/gym/lib/gym/runner.rb
index <HASH>..<HASH> 100644
--- a/gym/lib/gym/runner.rb
+++ b/gym/lib/gym/runner.rb
@@ -13,7 +13,7 @@ module Gym
end
verify_archive
- FileUtils.mkdir_p(Gym.config[:output_directory])
+ FileUtils.mkdir_p(File.expand_path(Gym.config[:output_directory]))
if Gym.project.ios? || Gym.project.tvos?
fix_generic_archive # See https://github.com/fastlane/fastlane/pull/4325
|
Fix not to create ~ directory in current directory (#<I>)
|
fastlane_fastlane
|
train
|
rb
|
b5ef75a5f4b39b8edad0f3819aa2a699b273a94c
|
diff --git a/lib/jitsu/package.js b/lib/jitsu/package.js
index <HASH>..<HASH> 100644
--- a/lib/jitsu/package.js
+++ b/lib/jitsu/package.js
@@ -445,7 +445,7 @@ package.updateTarball = function (version, pkg, existing, firstSnapshot, callbac
emitter.on('end', function() {
// fix for bar that sometimes hangs at 99%
- if(bar && !bar.complete) {
+ if(bar) {
bar.tick(bar.total - bar.curr);
}
|
Force progress bar to show <I>% after upload ends
|
nodejitsu_jitsu
|
train
|
js
|
d09f115af68e71ff54c451d3900d5b36523245de
|
diff --git a/lib/unsplash/version.rb b/lib/unsplash/version.rb
index <HASH>..<HASH> 100644
--- a/lib/unsplash/version.rb
+++ b/lib/unsplash/version.rb
@@ -1,4 +1,4 @@
module Unsplash # :nodoc:
# :nodoc:
- VERSION = "1.5.3"
+ VERSION = "1.5.4"
end
|
Bump to <I>.
|
unsplash_unsplash_rb
|
train
|
rb
|
b92f898f874554c212b26280ffed58fb2b7191c1
|
diff --git a/src/Nocarrier/HalXmlRenderer.php b/src/Nocarrier/HalXmlRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Nocarrier/HalXmlRenderer.php
+++ b/src/Nocarrier/HalXmlRenderer.php
@@ -99,10 +99,10 @@ class HalXmlRenderer implements HalRenderer
if (substr($key, 0, 1) === '@') {
$element->addAttribute(substr($key, 1), $value);
} else {
- $element->addChild($key, $value);
+ $element->addChild($key, htmlentities($value));
}
} else {
- $element->addChild($parent, $value);
+ $element->addChild($parent, htmlentities($value));
}
}
}
|
Encoded the value when adding child nodes in the XmlRenderer
|
blongden_hal
|
train
|
php
|
8c9a71ba5afeae15b298145a21a9b85b40d1b57b
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -99,7 +99,7 @@ module.exports = {
!optionalFeatures.isFeatureEnabled('template-only-glimmer-components')
) {
message.push(
- `* The template-only-glimmer-components optional feature should be enabled under Octane, run \`ember feature:enabled template-only-glimmer-components\` to enable it`
+ `* The template-only-glimmer-components optional feature should be enabled under Octane, run \`ember feature:enable template-only-glimmer-components\` to enable it`
);
}
|
[BUGFIX release] Fix incorrect error message for octane features.
The correct command is `ember feature:enable` :sob: :weary:
|
emberjs_ember.js
|
train
|
js
|
d5ee89bd9bd532ad293cdc3092e1085061c69a03
|
diff --git a/host/analysis/analyze_raw_data.py b/host/analysis/analyze_raw_data.py
index <HASH>..<HASH> 100644
--- a/host/analysis/analyze_raw_data.py
+++ b/host/analysis/analyze_raw_data.py
@@ -461,9 +461,9 @@ class AnalyzeRawData(object):
nEventIndex = self.interpreter.get_n_meta_data_event()
if (meta_data_size == nEventIndex):
if self.interpreter.meta_table_v2:
- description = data_struct.MetaInfoEventTableV2().columns
+ description = data_struct.MetaInfoEventTableV2().columns.copy()
else:
- description = data_struct.MetaInfoEventTable().columns
+ description = data_struct.MetaInfoEventTable().columns.copy()
last_pos = len(description)
if (self.scan_parameters != None): # add additional column with the scan parameter
for scan_par_name in self.scan_parameters.dtype.names:
|
BUG: table description is very special. If you do not use a copy of a table description you are not able to get the original description if you change it. It is stored outside of the scope!
|
SiLab-Bonn_pyBAR
|
train
|
py
|
64d74db8ae69f3dc37feb09df54e53ba0458edb7
|
diff --git a/gson/src/main/java/com/google/gson/annotations/SerializedName.java b/gson/src/main/java/com/google/gson/annotations/SerializedName.java
index <HASH>..<HASH> 100644
--- a/gson/src/main/java/com/google/gson/annotations/SerializedName.java
+++ b/gson/src/main/java/com/google/gson/annotations/SerializedName.java
@@ -64,7 +64,7 @@ import java.lang.annotation.Target;
* @author Joel Leitch
*/
@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.METHOD})
public @interface SerializedName {
/**
|
Add METHOD target for use with AutoValue's abstract property methods
|
google_gson
|
train
|
java
|
dc29d27660863a2035c78b3ef0115e5e6595b6d4
|
diff --git a/lib/rest-ftp-daemon/workers/transfer.rb b/lib/rest-ftp-daemon/workers/transfer.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-ftp-daemon/workers/transfer.rb
+++ b/lib/rest-ftp-daemon/workers/transfer.rb
@@ -10,7 +10,8 @@ module RestFtpDaemon
config_section :transfer
# Timeout and retry config
- @timeout = @config[:timeout] || nil
+ return "invalid timeout" unless @config[:timeout].to_i > 0
+ @timeout = @config[:timeout]
# Retry config
# @retry = (Conf.at(:retry) rescue {})
@@ -24,6 +25,8 @@ module RestFtpDaemon
pool: @pool,
timeout: @timeout
}
+
+ return false
end
def worker_after
@@ -83,12 +86,12 @@ module RestFtpDaemon
job.wid = Thread.current.thread_variable_get :wid
# Prepare job config
- # job.config = @config
- job.endpoints = (Conf.at(:endpoints) rescue {})
+ job.endpoints = @config[:endpoints] rescue {})
+ job.config = @config[:config] rescue {})
# Processs this job protected by a timeout
Timeout.timeout(@timeout, RestFtpDaemon::JobTimeout) do
- job.process(@config)
+ job.process
end
# Processing done
|
transfer worker: pass endpoints and config to Job
|
bmedici_rest-ftp-daemon
|
train
|
rb
|
5d3a3571534105bee5b4537b9a4d635dae19d73e
|
diff --git a/lxd/apparmor/network_forkdns.go b/lxd/apparmor/network_forkdns.go
index <HASH>..<HASH> 100644
--- a/lxd/apparmor/network_forkdns.go
+++ b/lxd/apparmor/network_forkdns.go
@@ -7,6 +7,7 @@ import (
"text/template"
"github.com/lxc/lxd/lxd/state"
+ "github.com/lxc/lxd/lxd/util"
"github.com/lxc/lxd/shared"
)
@@ -26,6 +27,7 @@ profile "{{ .name }}" flags=(attach_disconnected,mediate_deleted) {
{{ .varPath }}/networks/{{ .networkName }}/forkdns.servers/servers.conf r,
# Needed for lxd fork commands
+ {{ .exePath }} mr,
@{PROC}/@{pid}/cmdline r,
{{ .rootPath }}/{etc,lib,usr/lib}/os-release r,
@@ -68,6 +70,7 @@ func forkdnsProfile(state *state.State, n network) (string, error) {
"rootPath": rootPath,
"snap": shared.InSnap(),
"libraryPath": strings.Split(os.Getenv("LD_LIBRARY_PATH"), ":"),
+ "exePath": util.GetExecPath(),
})
if err != nil {
return "", err
|
lxd/apparmor/forkdns: Allow reading/mapping the binary
|
lxc_lxd
|
train
|
go
|
88a1b153db2848101e73236a2bf16d59c299353b
|
diff --git a/logdissect/__init__.py b/logdissect/__init__.py
index <HASH>..<HASH> 100644
--- a/logdissect/__init__.py
+++ b/logdissect/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '1.3'
+__version__ = '1.3.1-dev'
__author__ = 'Dan Persons <[email protected]>'
__license__ = 'MIT License'
__github__ = 'https://github.com/dogoncouch/logdissect'
|
Update version: <I>-dev
|
dogoncouch_logdissect
|
train
|
py
|
8d29c372bb85a68024a454e76d6bedcc77ee6906
|
diff --git a/src/entity/entity.js b/src/entity/entity.js
index <HASH>..<HASH> 100644
--- a/src/entity/entity.js
+++ b/src/entity/entity.js
@@ -762,7 +762,9 @@
// going up, collision with ceiling
else if (collision.y < 0) {
if (!prop.isPlatform && !prop.isLadder && !prop.isTopLadder) {
- this.falling = true;
+ if (this.gravity) {
+ this.falling = true;
+ }
// cancel the y velocity
this.vel.y = 0;
}
|
[#<I>] Disable ObjectEntity falling flag when there is no gravity.
- Thanks @Deathspike for #<I>
|
melonjs_melonJS
|
train
|
js
|
188da6b00ab2055cb391c89995b342d7c9303749
|
diff --git a/lib/cube_solver/two_cycle_solver.rb b/lib/cube_solver/two_cycle_solver.rb
index <HASH>..<HASH> 100644
--- a/lib/cube_solver/two_cycle_solver.rb
+++ b/lib/cube_solver/two_cycle_solver.rb
@@ -17,20 +17,19 @@ module CubeSolver
def solve!
@solution ||= begin
- solution = permutation_solution
- solution << orientation_solution
+ solution = []
+ solution << solution_for(:permutation)
+ solution << solution_for(:orientation)
solution.flatten
end
end
private
- def permutation_solution
- [:edge, :corner].map { |type| permutation_solution_for type }
- end
-
- def orientation_solution
- [:edge, :corner].map { |type| orientation_solution_for type }
+ def solution_for(step)
+ [:edge, :corner].map do |cubie_type|
+ send "#{step}_solution_for", cubie_type
+ end
end
def permutation_solution_for(cubie)
|
DRY up TwoCycle orientation/permutation solution
|
chrishunt_rubiks-cube
|
train
|
rb
|
525550e9f4321d02a16cd5900bb2e1c3b597269e
|
diff --git a/test/utils.py b/test/utils.py
index <HASH>..<HASH> 100644
--- a/test/utils.py
+++ b/test/utils.py
@@ -4,6 +4,7 @@
import os
import sys
from os.path import join, dirname, abspath
+import codecs
from logilab.common.testlib import TestCase
from astroid import MANAGER
@@ -14,7 +15,8 @@ def _astroid_wrapper(func, modname):
def _sorted_file(path):
- lines = [line.strip() for line in open(path).readlines()
+ # we don't care about the actual encoding, but python3 forces us to pick one
+ lines = [line.strip() for line in codecs.open(path, encoding='latin1').readlines()
if (line.find('squeleton generated by ') == -1 and
not line.startswith('__revision__ = "$Id:'))]
lines = [line for line in lines if line]
|
test/utils: use codecs.open instead of plain open for python3 compat
We don't really care about the encoding here, just want something that
won't explode on non-ascii.
|
PyCQA_pylint
|
train
|
py
|
388f1957ee007d4b056031c4a2e2adc106e12f6e
|
diff --git a/library/Garp/Service/Amazon/Ses.php b/library/Garp/Service/Amazon/Ses.php
index <HASH>..<HASH> 100755
--- a/library/Garp/Service/Amazon/Ses.php
+++ b/library/Garp/Service/Amazon/Ses.php
@@ -333,12 +333,10 @@ class Garp_Service_Amazon_Ses extends Zend_Service_Amazon_Abstract
*/
public function verifyEmailAddress($email)
{
- $response = $this->_makeRequest(
- [
- 'Action' => 'VerifyEmailAddress',
- 'EmailAddress' => $email,
- ]
- );
+ $this->client->VerifyEmailIdentity([
+ 'EmailAddress' => $email
+ ]);
+
return true;
}
|
Use AWS PHP SDK for verifyEmailAddress
verifyEmailAddress is deprecated and replace by verifyEmailIdentity
|
grrr-amsterdam_garp3
|
train
|
php
|
d9d977755eec7682f27dc7e5a40e8062d946849f
|
diff --git a/spec/database_cleaner/active_record/truncation_spec.rb b/spec/database_cleaner/active_record/truncation_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/database_cleaner/active_record/truncation_spec.rb
+++ b/spec/database_cleaner/active_record/truncation_spec.rb
@@ -47,15 +47,6 @@ RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
expect(count).to eq 2
end
- it "should not truncate ar_internal_metadata on Rails 5" do
- allow(::ActiveRecord::Base).to receive(:internal_metadata_table_name).and_return('ar_internal_metadata')
- stub_const("::ActiveRecord::VERSION::MAJOR", 5)
- expect(connection)
- .not_to receive(:truncate_table)
- .with(::ActiveRecord::Base.internal_metadata_table_name)
- subject.clean
- end
-
it "should only truncate the tables specified in the :only option when provided" do
expect { described_class.new(only: ['agents']).clean }
.to change { [User.count, Agent.count] }
|
Delete spec
Pretty difficult to write an ActiveRecord 5 spec when the project is
running ActiveRecord 3. DatabaseCleaner::ActiveRecord::Base#exclusion_condition
wasn't previously tested anyways. ¯\_(ツ)_/¯
|
DatabaseCleaner_database_cleaner
|
train
|
rb
|
58f9204f7207a8c4d08118145b8fee8f5b332fd5
|
diff --git a/colorlog/colorlog.py b/colorlog/colorlog.py
index <HASH>..<HASH> 100644
--- a/colorlog/colorlog.py
+++ b/colorlog/colorlog.py
@@ -147,6 +147,9 @@ class ColoredFormatter(logging.Formatter):
def _blank_escape_codes(self):
"""Return True if we should be prevented from printing escape codes."""
+ if "NO_COLOR" in os.environ:
+ return True
+
if self.stream is not None and not self.stream.isatty():
return True
|
Support NO_COLOR environment variable, fixing #<I>
|
borntyping_python-colorlog
|
train
|
py
|
8521d6a66af59aa11f2da90db9cc24f3974928ed
|
diff --git a/src/org/zaproxy/zap/ZAP.java b/src/org/zaproxy/zap/ZAP.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/ZAP.java
+++ b/src/org/zaproxy/zap/ZAP.java
@@ -690,25 +690,6 @@ public class ZAP {
initMac();
}
- // Warn users of dev builds that by default add-ons wont be available
- OptionsParamView viewParams = Model.getSingleton().getOptionsParam()
- .getViewParam();
- if (Constant.isDevBuild() && viewParams.isShowDevWarning()) {
- // This is deliberately not i18n'ed - its only shown in dev mode and
- // is expected to change soon
- view.showWarningDontPromptDialog("DEV BUILD WARNING!\n\n"
- + "ZAP add-ons are no longer held in source control due to space issues.\n\n"
- + "This means that by default a significant part of ZAP functionality\n"
- + "(including the active and passive scan rules) will no longer be available.\n\n"
- + "To get access to add-ons you will need to build and deploy them.\n\n"
- + "When 2.4.0 is released then you will also be able to download them from the\n"
- + "ZAP Marketplace.\n"
- + "We hope to have other alternatives available before too long!\n");
- if (view.isDontPromptLastDialogChosen()) {
- viewParams.setShowDevWarning(false);
- }
- }
-
}
private void runDaemon() throws Exception {
|
Removed dev warning - add-ons are now available once again the marketplace :)
|
zaproxy_zaproxy
|
train
|
java
|
e70d19ebfada321366004c4e667e972cf1284463
|
diff --git a/model/DocumentSession.js b/model/DocumentSession.js
index <HASH>..<HASH> 100644
--- a/model/DocumentSession.js
+++ b/model/DocumentSession.js
@@ -142,8 +142,8 @@ DocumentSession.Prototype = function() {
if (change) {
this.selection = change.after.selection;
this.isTransacting = false;
- this._commit(change, info);
this._selectionHasChanged = true;
+ this._commit(change, info);
return change;
} else {
this.isTransacting = false;
|
Fix: making sure selection:changed is triggered.
|
substance_substance
|
train
|
js
|
d10f104ad3befbb5675e4d26ceadc11b2cfb3c6c
|
diff --git a/lib/simple_form/action_view_extensions/builder.rb b/lib/simple_form/action_view_extensions/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/simple_form/action_view_extensions/builder.rb
+++ b/lib/simple_form/action_view_extensions/builder.rb
@@ -135,7 +135,7 @@ module SimpleForm
def render_collection(attribute, collection, value_method, text_method, options={}, html_options={}) #:nodoc:
collection_wrapper_tag = options[:collection_wrapper_tag] || SimpleForm.collection_wrapper_tag
- item_wrapper_tag = options[:item_wrapper_tag] || SimpleForm.item_wrapper_tag
+ item_wrapper_tag = (defined? options[:item_wrapper_tag]) ? options[:item_wrapper_tag] : SimpleForm.item_wrapper_tag
rendered_collection = collection.map do |item|
value = value_for_collection(item, value_method)
|
Added logic to allow for collections to receive a false value on item_collection_tag
|
plataformatec_simple_form
|
train
|
rb
|
b6aebdafb9f15dfd05c058ddebc041e2f00e7a88
|
diff --git a/lib/smart_proxy_dynflow_core/settings.rb b/lib/smart_proxy_dynflow_core/settings.rb
index <HASH>..<HASH> 100644
--- a/lib/smart_proxy_dynflow_core/settings.rb
+++ b/lib/smart_proxy_dynflow_core/settings.rb
@@ -71,7 +71,7 @@ module SmartProxyDynflowCore
end
def self.load_from_proxy(plugin)
- settings = plugin[:class].settings.to_h
+ settings = plugin.settings.to_h
PROXY_SETTINGS.each do |key|
SETTINGS[key] = Proxy::SETTINGS[key]
end
|
Fixes #<I> - Fix loading settings from smart-proxy
|
theforeman_smart_proxy_dynflow
|
train
|
rb
|
05aeaf36513464183f4971c12ae6452f54e4806c
|
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb
index <HASH>..<HASH> 100644
--- a/lib/sinatra/base.rb
+++ b/lib/sinatra/base.rb
@@ -998,6 +998,7 @@ class Rack::Builder
def Sinatra(file, base=Sinatra::Default)
Sinatra.new(base) {
expanded = File.expand_path(file)
+ self.class_eval { set :app_file, expanded }
self.class_eval(File.read(expanded), expanded) }
end
end
|
set :app_file when using builder sugar
|
sinatra_sinatra
|
train
|
rb
|
7d17eaa328d69914534692b8284d63042ecd9201
|
diff --git a/spec/by_star/by_direction_spec.rb b/spec/by_star/by_direction_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/by_star/by_direction_spec.rb
+++ b/spec/by_star/by_direction_spec.rb
@@ -58,7 +58,7 @@ end
describe "previous and next" do
let(:current_post) { Post.find_by_text("post 1") }
- let(:current_event) { Event.find_by_name("Mum's Birthday!") }
+ let(:current_event) { Event.find_by_name("Mum's birthday!") }
context "previous" do
it "can find the previous post" do
|
birthday in db 'seeds' is a lowercase b
|
radar_by_star
|
train
|
rb
|
342e9a7b2cb8d3d3ed657a695b7aaa546672f132
|
diff --git a/lib/haml/template/plugin.rb b/lib/haml/template/plugin.rb
index <HASH>..<HASH> 100644
--- a/lib/haml/template/plugin.rb
+++ b/lib/haml/template/plugin.rb
@@ -45,7 +45,7 @@ module Haml
Haml::Util.has?(:instance_method, ActionView::OutputBuffer, :append_if_string=)
module Precompiler
def push_silent_with_haml_block_deprecation(text, can_suppress = false)
- unless can_suppress && block_opened? &&
+ unless can_suppress && block_opened? && !mid_block_keyword?("- #{text}") &&
text =~ ActionView::Template::Handlers::Erubis::BLOCK_EXPR
return push_silent_without_haml_block_deprecation(text, can_suppress)
end
|
[Haml] Don't check for strings returned by ends with block methods.
|
sass_ruby-sass
|
train
|
rb
|
b0248be35c02c9c07039b7bc0e40a0daec1d6561
|
diff --git a/src/jquery.sidebar.js b/src/jquery.sidebar.js
index <HASH>..<HASH> 100644
--- a/src/jquery.sidebar.js
+++ b/src/jquery.sidebar.js
@@ -84,7 +84,9 @@
this.on("sidebar:open", function() {
var properties = {};
properties[settings.side] = settings.range[1];
- self.animate(properties, settings.speed, function() {
+ settings.closed = null;
+ self.stop().animate(properties, settings.speed, function() {
+ settings.closed = false;
self.trigger("sidebar:opened");
});
});
@@ -97,7 +99,9 @@
this.on("sidebar:close", function(callback) {
var properties = {};
properties[settings.side] = settings.range[0];
- self.animate(properties, settings.speed, function() {
+ settings.closed = null;
+ self.stop().animate(properties, settings.speed, function() {
+ settings.closed = true;
self.trigger("sidebar:closed");
});
});
@@ -112,7 +116,6 @@
} else {
self.trigger("sidebar:close");
}
- settings.closed = !settings.closed;
});
return this;
|
Set closed property on open/close. Stop animations before animating.
|
jillix_jQuery-sidebar
|
train
|
js
|
84548caf1343ba40e29d57fe6c2dbcbba1094096
|
diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -15,7 +15,7 @@ module.exports = {
loaders: [
{
test: /\.jsx?$/,
- exclude: /node_modules/,
+ exclude: /node_modules\/(?!(?:(?:me\.common\.js)|(?:me\.common\.jsx))(?!\/node_modules))/,
loader: "babel-loader",
query: {
presets: [
|
Use babel to load me.* dependencies.
|
randytarampi_me
|
train
|
js
|
7f8b087c231846a9f83ad57cdfedfe4484dc0a3d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -49,7 +49,6 @@ setup(
author_email='[email protected]',
url='https://github.com/jonhadfield/python-hosts',
download_url='https://github.com/jonhadfield/python-hosts/tarball/{0}'.format(version),
- install_requires=['win_inet_pton==1.0.1'],
description='A hosts file manager library written in python',
long_description='A hosts file manager library written in python',
packages=['python_hosts'],
|
Remove unused win_inet_pton dependency
It is no longer used since <URL>
|
jonhadfield_python-hosts
|
train
|
py
|
157cc658bf4612e1a70cf71c9949b562966dab05
|
diff --git a/RTEditor/src/main/java/com/onegravity/rteditor/utils/Helper.java b/RTEditor/src/main/java/com/onegravity/rteditor/utils/Helper.java
index <HASH>..<HASH> 100644
--- a/RTEditor/src/main/java/com/onegravity/rteditor/utils/Helper.java
+++ b/RTEditor/src/main/java/com/onegravity/rteditor/utils/Helper.java
@@ -43,6 +43,9 @@ public abstract class Helper {
private static float sDensity = Float.MAX_VALUE;
private static float sDensity4Fonts = Float.MAX_VALUE;
+ private static final int LEADING_MARGIN = 28;
+ private static int sLeadingMarging = -1;
+
public static void closeQuietly(Closeable closeable) {
IOUtils.closeQuietly(closeable);
}
@@ -95,6 +98,14 @@ public abstract class Helper {
return config.fontScale;
}
+ public static int getLeadingMarging() {
+ if (sLeadingMarging == -1) {
+ float density = Helper.getDisplayDensity();
+ sLeadingMarging = Math.round(LEADING_MARGIN * density);
+ }
+ return sLeadingMarging;
+ }
+
/**
* This method encodes the query part of an url
* @param url an url (e.g. http://www.1gravity.com?query=üö)
|
Add the missing getLeadingMargin method to the Helper class
|
1gravity_Android-RTEditor
|
train
|
java
|
4ee37f46f8543e9909acea0e89e4a53ad3740691
|
diff --git a/tests/PHPUnit/Plugins/SEOTest.php b/tests/PHPUnit/Plugins/SEOTest.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/Plugins/SEOTest.php
+++ b/tests/PHPUnit/Plugins/SEOTest.php
@@ -38,7 +38,12 @@ class SEOTest extends PHPUnit_Framework_TestCase
*/
public function test_API()
{
- $dataTable = Piwik_SEO_API::getInstance()->getRank('http://www.microsoft.com/');
+ try {
+ $dataTable = Piwik_SEO_API::getInstance()->getRank('http://www.microsoft.com/');
+ } catch(Exception $e) {
+ echo "SKIPPEd";
+ $this->markTestSkipped('A SEO http request failed, Skipping this test for now. Error was: '.$e->getMessage());
+ }
$renderer = Piwik_DataTable_Renderer::factory('php');
$renderer->setSerialize(false);
$ranks = $renderer->render($dataTable);
|
Marking SEO test as skipped if one http request fails,
This will prevent random build failures such as <URL>
|
matomo-org_matomo
|
train
|
php
|
f22441ff6e16868c30f9fc7c7b2f5eb62825f261
|
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb
index <HASH>..<HASH> 100644
--- a/actionview/lib/action_view/digestor.rb
+++ b/actionview/lib/action_view/digestor.rb
@@ -9,9 +9,10 @@ module ActionView
class << self
# Supported options:
#
- # * <tt>name</tt> - Template name
- # * <tt>finder</tt> - An instance of <tt>ActionView::LookupContext</tt>
- # * <tt>dependencies</tt> - An array of dependent views
+ # * <tt>name</tt> - Template name
+ # * <tt>format</tt> - Template format
+ # * <tt>finder</tt> - An instance of <tt>ActionView::LookupContext</tt>
+ # * <tt>dependencies</tt> - An array of dependent views
def digest(name:, format:, finder:, dependencies: nil)
if dependencies.nil? || dependencies.empty?
cache_key = "#{name}.#{format}"
|
Update comment for ActionView::Digestor.digest [ci skip]
|
rails_rails
|
train
|
rb
|
e61c5ca518ad1841b8303f31a59bf2a1ca0e02d6
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,7 @@ PACKAGE = 'kdtree'
MODULES = (
PACKAGE,
+ 'bounded_priority_queue',
)
AUTHOR_EMAIL = metadata['author']
|
Add ``bounded_priority_queue`` to package, fix #<I>
|
stefankoegl_kdtree
|
train
|
py
|
70abcfc6306ac4de7d0b2c438bb0c63ecab45a1c
|
diff --git a/psamm/command.py b/psamm/command.py
index <HASH>..<HASH> 100644
--- a/psamm/command.py
+++ b/psamm/command.py
@@ -582,6 +582,9 @@ def main_sbml(command_class=None, args=None):
parser = argparse.ArgumentParser(description=title)
parser.add_argument('model', metavar='file', help='SBML file')
+ parser.add_argument('--merge-compounds', action='store_true',
+ help=('Merge identical compounds occuring in various'
+ ' compartments.'))
parser.add_argument(
'-V', '--version', action='version',
version='%(prog)s ' + package_version)
@@ -620,6 +623,8 @@ def main_sbml(command_class=None, args=None):
with context.open('r') as f:
model = sbml.SBMLReader(f, context=context).create_model()
sbml.convert_sbml_model(model)
+ if parsed_args.merge_compounds:
+ sbml.merge_equivalent_compounds(model)
# Instantiate command with model and run
command = parsed_args.command(model, parsed_args)
|
command: Allow merging compounds with option in SBML command
|
zhanglab_psamm
|
train
|
py
|
7f9ca3eab3bbeaefe228b33299e8d80c1e20a19a
|
diff --git a/test/stdin.js b/test/stdin.js
index <HASH>..<HASH> 100644
--- a/test/stdin.js
+++ b/test/stdin.js
@@ -80,3 +80,15 @@ ok 1 - this is fine
s.threw(new Error('oops'))
})
+
+t.test('doting parent', t => {
+ const EE = require('events').EventEmitter
+ const parent = new EE()
+ const tapStream = new MP()
+ parent.on('stdin', child => {
+ t.equal(child, s)
+ t.end()
+ })
+ const s = new Stdin({tapStream, parent})
+ s.main(() => {})
+})
|
test parent emitting event in stdin.js
|
tapjs_node-tap
|
train
|
js
|
d3cddde526931bcdcb4ffcd42c9c45318541581c
|
diff --git a/lib/ll.rb b/lib/ll.rb
index <HASH>..<HASH> 100644
--- a/lib/ll.rb
+++ b/lib/ll.rb
@@ -19,4 +19,3 @@ require_relative 'll/parser_error'
require_relative 'll/compiler'
require_relative 'll/generator'
require_relative 'll/ast/node'
-require_relative 'll/bootstrap/parser'
|
Removed require of the bootstrap parser.
|
YorickPeterse_ruby-ll
|
train
|
rb
|
bd48b4a76b20e99bfee1c0c7dbdaea4ae38d6782
|
diff --git a/libdokan/fso.go b/libdokan/fso.go
index <HASH>..<HASH> 100644
--- a/libdokan/fso.go
+++ b/libdokan/fso.go
@@ -33,7 +33,7 @@ func (f *FSO) SetFileTime(ctx context.Context, fi *dokan.FileInfo, creation time
return f.folder.fs.config.KBFSOps().SetMtime(ctx, f.node, &lastWrite)
}
- return dokan.ErrNotSupported
+ return nil
}
type refcount struct {
|
libdokan: Not setting any times in SetFileTime is valid
|
keybase_client
|
train
|
go
|
0deb7001bb77f5a17c83a1b5066d2c2583d2a95f
|
diff --git a/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java b/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java
+++ b/plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/ui/generator/contentAssist/JavaBasedContentAssistFragment.java
@@ -81,6 +81,9 @@ public class JavaBasedContentAssistFragment extends AbstractGeneratorFragment {
super.generate(grammar, ctx);
}
+ /**
+ * @since 2.3
+ */
public static String getClassName(EObject eObject) {
return eObject.eClass().getName();
}
|
[api] added since tag to new created method
|
eclipse_xtext-extras
|
train
|
java
|
1eae82c71cefa253aa0986b8f170ffc815469c4c
|
diff --git a/tests/test_credentials.py b/tests/test_credentials.py
index <HASH>..<HASH> 100644
--- a/tests/test_credentials.py
+++ b/tests/test_credentials.py
@@ -33,9 +33,9 @@ class TestCredentials(object):
keyring.set_keyring(TestKeyring())
result = credentials.password_get('user')
if six.PY3:
- assert result == 'password from TestKeyring'
- else:
assert result == b'password from TestKeyring'
+ else:
+ assert result == 'password from TestKeyring'
def test_pull_env_credential(self):
keyring.set_keyring(TestKeyring())
@@ -47,6 +47,6 @@ class TestCredentials(object):
assert result[0] == 'global:prodpass'
assert 'TestKeyring' in result[1]
if six.PY3:
- assert result[1] == 'password from TestKeyring'
- else:
assert result[1] == b'password from TestKeyring'
+ else:
+ assert result[1] == 'password from TestKeyring'
|
Finally fixing python3 issue
|
major_supernova
|
train
|
py
|
5342cde0313a4f0ab07370cc34557f097d06aac5
|
diff --git a/pyrtl/inputoutput.py b/pyrtl/inputoutput.py
index <HASH>..<HASH> 100644
--- a/pyrtl/inputoutput.py
+++ b/pyrtl/inputoutput.py
@@ -679,17 +679,16 @@ def block_to_graphviz_string(block=None, namer=graphviz_default_namer, split_sta
return rstring
-def output_to_svg(file, block=None):
+def output_to_svg(file, block=None, split_state=True):
""" Output the block as an SVG to the open file. """
- print(block_to_svg(block), file=file)
+ print(block_to_svg(block, split_state), file=file)
-def block_to_svg(block=None):
+def block_to_svg(block=None, split_state=True):
""" Return an SVG for the block. """
- block = working_block(block)
try:
from graphviz import Source
- return Source(block_to_graphviz_string())._repr_svg_()
+ return Source(block_to_graphviz_string(block, split_state=split_state))._repr_svg_()
except ImportError:
raise PyrtlError('need graphviz installed (try "pip install graphviz")')
|
Exposing split_state option for SVG output, like previously done for trivialgraph
|
UCSBarchlab_PyRTL
|
train
|
py
|
34f1033aa4687a082c0720d78f9feb31f51ffa2e
|
diff --git a/lib/supermodel/redis.rb b/lib/supermodel/redis.rb
index <HASH>..<HASH> 100644
--- a/lib/supermodel/redis.rb
+++ b/lib/supermodel/redis.rb
@@ -10,10 +10,24 @@ module SuperModel
@indexes += indexes.map(&:to_s)
end
+ def indexes=(indexes)
+ @indexes = indexes
+ end
+
def serialize(*attributes)
@serialize ||= []
@serialize += attributes.map(&:to_s)
- end
+ end
+
+ def serialize=(attributes)
+ @serialize = attributes
+ end
+
+ def inherited(child) #:nodoc:
+ super(child)
+ child.indexes = indexes
+ child.serialize = serialize
+ end
def redis_key(*args)
args.unshift(self.name.downcase)
|
copy indexes and serialized columns to inherited children
|
maccman_supermodel
|
train
|
rb
|
5b362249fd9e51acb68bc5e5fd9bdd5689481d0d
|
diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java
index <HASH>..<HASH> 100644
--- a/src/main/java/pl/project13/maven/git/JGitProvider.java
+++ b/src/main/java/pl/project13/maven/git/JGitProvider.java
@@ -43,6 +43,7 @@ import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
+import org.eclipse.jgit.storage.file.WindowCacheConfig;
public class JGitProvider extends GitDataProvider {
@@ -209,6 +210,16 @@ public class JGitProvider extends GitDataProvider {
if (revWalk != null) {
revWalk.dispose();
}
+ // http://www.programcreek.com/java-api-examples/index.php?api=org.eclipse.jgit.storage.file.WindowCacheConfig
+ // Example 3
+ if( git != null ) {
+ git.close();
+ // git.close() is not enough with jGit on Windows
+ // remove the references from packFile by initializing cache used in the repository
+ // fixing lock issues on Windows when repository has pack files
+ WindowCacheConfig config = new WindowCacheConfig();
+ config.install();
+ }
}
@VisibleForTesting String getGitDescribe(@NotNull Repository repository) throws GitCommitIdExecutionException {
|
Fixing jGit lock issue on Windows
now the sandbox repositories will be cleanup successfully when tear down
|
git-commit-id_maven-git-commit-id-plugin
|
train
|
java
|
934116eaade8805ee35e9e065455a1bb76939255
|
diff --git a/app/lib/app-extension/Extension.js b/app/lib/app-extension/Extension.js
index <HASH>..<HASH> 100644
--- a/app/lib/app-extension/Extension.js
+++ b/app/lib/app-extension/Extension.js
@@ -125,7 +125,7 @@ module.exports = class Extension {
isInstalled () {
try {
- require.resolve(this.packageName, {
+ require.resolve(this.packageName + '/src/index', {
paths: [ appPaths.appDir ]
})
}
|
refactor(app): check AE install status by accessing index file directly (#<I>)
This avoids to use "main" field of package.json for AE purposes, allowing devs to use it for their needs
|
quasarframework_quasar
|
train
|
js
|
1ff76f1d762455bf3ea1b2d61d17884fb0b44660
|
diff --git a/scripts/stackstorm.js b/scripts/stackstorm.js
index <HASH>..<HASH> 100644
--- a/scripts/stackstorm.js
+++ b/scripts/stackstorm.js
@@ -91,10 +91,7 @@ var ERROR_MESSAGES = [
"I'm sorry, Dave. I'm afraid I can't do that. (%s)"
];
-var TWOFACTOR_MESSAGE = "This action requires two-factor auth! Authenticate with Duo Security:\n" +
- "```\n" +
- "%s 2fa %s\n" +
- "```";
+var TWOFACTOR_MESSAGE = "This action requires two-factor auth! Waiting for your confirmation.";
module.exports = function(robot) {
@@ -282,7 +279,13 @@ module.exports = function(robot) {
action_alias.extra.security.twofactor !== undefined) {
var twofactor_id = uuid.v4();
robot.logger.debug('Requested an action that requires 2FA. Guid: ' + twofactor_id);
- msg.send(util.format(TWOFACTOR_MESSAGE, robot.alias, twofactor_id));
+ msg.send(TWOFACTOR_MESSAGE);
+ api.executions.create({
+ 'action': env.HUBOT_2FA,
+ 'parameters': {
+ 'uuid': twofactor_id
+ }
+ });
twofactor[twofactor_id] = {
'msg': msg,
'payload': payload
|
Create the 2fa-check execution straight away
|
StackStorm_hubot-stackstorm
|
train
|
js
|
a3a6ca540ce0f4f81717087aa229b16486b03fe4
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -24,9 +24,6 @@ function Storage (chunkLength, opts) {
if (!Array.isArray(opts.files)) {
throw new Error('`files` option must be an array')
}
- if (opts.length != null || opts.path != null) {
- throw new Error('`files` option cannot be used with `path` or `length` options')
- }
self.files = opts.files.slice(0).map(function (file, i, files) {
if (file.path == null) throw new Error('File is missing `path` property')
if (file.length == null) throw new Error('File is missing `length` property')
@@ -41,7 +38,9 @@ function Storage (chunkLength, opts) {
return file
})
self.length = self.files.reduce(function (sum, file) { return sum + file.length }, 0)
-
+ if (opts.length != null && opts.length !== self.length) {
+ throw new Error('total `files` length is not equal to explicit `length` option')
+ }
} else {
var len = Number(opts.length) || Infinity
self.files = [{
|
total `files` length must be equal to explicit `length` option
|
feross_fs-chunk-store
|
train
|
js
|
d469703300765eb6171cd441b6b61e9f84825769
|
diff --git a/lang/fr/admin.php b/lang/fr/admin.php
index <HASH>..<HASH> 100755
--- a/lang/fr/admin.php
+++ b/lang/fr/admin.php
@@ -2,7 +2,7 @@
$string['adminseesallevents'] = 'Les administrateurs voient tous les �v�nements';
$string['adminseesownevents'] = 'Les administrateurs sont comme tous les autres utilisateurs';
-$string['backgroundcolour'] = 'Couleur de fond';
+$string['backgroundcolour'] = 'Couleur transparente';
$string['badwordsconfig'] = 'Taper ici votre liste de mots � censurer, s�par�s par des virgules';
$string['badwordslist'] = 'Liste des mots � censurer';
$string['blockinstances'] = 'Instances';
|
Background colour should read Transparent Colour. Bug #<I>
|
moodle_moodle
|
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.