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
|
---|---|---|---|---|---|
f34d4e2600398742b1c1cc5f9a9004d63886f17b
|
diff --git a/lib/jquery.gridList.js b/lib/jquery.gridList.js
index <HASH>..<HASH> 100644
--- a/lib/jquery.gridList.js
+++ b/lib/jquery.gridList.js
@@ -268,6 +268,12 @@
}
this.each(function() {
instance = $(this).data('_gridList');
+ // The plugin call be called with no method on an existing GridList
+ // instance to re-initialize it
+ if (instance && !method) {
+ instance.destroy();
+ instance = null;
+ }
if (!instance) {
instance = new DraggableGridList(this, options);
$(this).data('_gridList', instance);
|
Allow re-initialization of a GridList instance
|
hootsuite_grid
|
train
|
js
|
6256d50d51525e9442d6cdd68245aedd3e8d9e98
|
diff --git a/seneca-log-filter.js b/seneca-log-filter.js
index <HASH>..<HASH> 100644
--- a/seneca-log-filter.js
+++ b/seneca-log-filter.js
@@ -19,14 +19,14 @@ function logfilter (options) {
return function filter (data) {
if (calculatedLevels.indexOf(data.level) !== -1) {
- let ret = _.clone(data)
+ let cloned = _.clone(data)
if (options['omit-metadata']) {
- ret = _.omit(ret, ['seneca', 'level', 'when'])
+ cloned = _.omit(cloned, ['seneca', 'level', 'when'])
}
if (options.omit && _.isArray(options.omit)) {
- ret = _.omit(ret, options.omit)
+ cloned = _.omit(cloned, options.omit)
}
- return ret
+ return cloned
}
return null
}
|
Changed ret to cloned.
|
senecajs_seneca-log-filter
|
train
|
js
|
027cae3bd0ead2849930875c790dee6755c3d382
|
diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java
index <HASH>..<HASH> 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java
@@ -149,9 +149,7 @@ public class SmackReactor {
long releaseTimeEpoch = System.currentTimeMillis() + unit.toMillis(delay);
Date releaseTimeDate = new Date(releaseTimeEpoch);
ScheduledAction scheduledAction = new ScheduledAction(runnable, releaseTimeDate, this);
- synchronized (scheduledActions) {
- scheduledActions.add(scheduledAction);
- }
+ scheduledActions.add(scheduledAction);
return scheduledAction;
}
|
Remove unnecessary synchronization in SmackReater.schedule()
The DelayQueue 'scheduledActions' is already thread-safe.
|
igniterealtime_Smack
|
train
|
java
|
ca2537c16481550f879c91224a57b6412a0fa851
|
diff --git a/scout/server/blueprints/variants/views.py b/scout/server/blueprints/variants/views.py
index <HASH>..<HASH> 100644
--- a/scout/server/blueprints/variants/views.py
+++ b/scout/server/blueprints/variants/views.py
@@ -474,8 +474,11 @@ def cancer_variants(institute_id, case_name):
if(request.method == "POST"):
form = CancerFiltersForm(request.form)
+ page = int(request.form.get('page', 1))
else:
form = CancerFiltersForm(request.args)
+ page = int(request.args.get('page', 1))
+
available_panels = case_obj.get('panels', []) + [
{'panel_name': 'hpo', 'display_name': 'HPO'}]
@@ -484,7 +487,7 @@ def cancer_variants(institute_id, case_name):
for panel in available_panels]
form.gene_panels.choices = panel_choices
- page = int(request.args.get('page', 1))
+
variant_type = request.args.get('variant_type', 'clinical')
data = controllers.cancer_variants(store, institute_id, case_name, form, page=page)
return dict(variant_type=variant_type, **data)
|
..and handle page from POST..
|
Clinical-Genomics_scout
|
train
|
py
|
e0c2b6ab28cd1aa50d32d8f7a380e7adfeb8e0ee
|
diff --git a/lib/yard.rb b/lib/yard.rb
index <HASH>..<HASH> 100644
--- a/lib/yard.rb
+++ b/lib/yard.rb
@@ -49,7 +49,7 @@ end
$LOAD_PATH.push('.') if RUBY_VERSION >= '1.9.2'
# Keep track of Ruby version for compatibility code
-RUBY19, RUBY18 = *(RUBY_VERSION >= "1.9" ? [true, false] : [false, true])
+RUBY19, RUBY18 = *(RUBY_VERSION >= "1.9.1" ? [true, false] : [false, true])
# Load Ruby core extension classes
Dir.glob(File.join(YARD::ROOT, 'yard', 'core_ext', '*')).each do |file|
|
Don't treat <I> as a true "<I>"
Closes gh-<I>
|
lsegal_yard
|
train
|
rb
|
bcf89eab8a1be37673be346b4a820a626f5b925e
|
diff --git a/tweepy/streaming.py b/tweepy/streaming.py
index <HASH>..<HASH> 100644
--- a/tweepy/streaming.py
+++ b/tweepy/streaming.py
@@ -386,6 +386,11 @@ class Stream(BaseStream):
threaded : bool
Whether or not to use a thread to run the stream
+ Raises
+ ------
+ TweepyException
+ When the stream is already connected
+
Returns
-------
threading.Thread | None
|
Add Raises section to Stream.sample documentation
|
tweepy_tweepy
|
train
|
py
|
ed0e428f836d814b112c5d2c924d7c5d80989d04
|
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -99,7 +99,15 @@ var next = [
var nonStandardAttributes = [].concat(legacy, custom, next)
// Some SVG properties:
-var nonStandardSVGAttributes = ['paint-order', 'vector-effect']
+var nonStandardSVGAttributes = [
+ 'paint-order',
+ 'vector-effect',
+
+ // https://github.com/wooorm/svg-element-attributes/commit/dcc7643
+ 'hatchContentUnits',
+ 'hatchUnits',
+ 'pitch'
+]
test('schema', function(t) {
t.deepEqual(information.html.property.className, {
|
Fix tests to support recently removed SVG values
|
wooorm_property-information
|
train
|
js
|
a380941b576fbbb55b9d117495e408efcf81a0ff
|
diff --git a/Connectors/MySqlConnector.php b/Connectors/MySqlConnector.php
index <HASH>..<HASH> 100755
--- a/Connectors/MySqlConnector.php
+++ b/Connectors/MySqlConnector.php
@@ -36,6 +36,16 @@ class MySqlConnector extends Connector implements ConnectorInterface {
$connection->prepare($names)->execute();
+ // Next, we will check to see if a timezone has been specified in this config
+ // and if it has we will issue a statement to modify the timezone with the
+ // database. Setting this DB timezone is an optional configuration item.
+ if (isset($config['timezone']))
+ {
+ $connection->prepare(
+ 'set time_zone="'.$config['timezone'].'"'
+ )->execute();
+ }
+
// If the "strict" option has been configured for the connection we'll enable
// strict mode on all of these tables. This enforces some extra rules when
// using the MySQL database system and is a quicker way to enforce them.
|
Set the timezone if it is set for MySQL.
|
illuminate_database
|
train
|
php
|
69071404b865bb7e4dbd28dbd1357d904c0a1e74
|
diff --git a/visidata/sheets.py b/visidata/sheets.py
index <HASH>..<HASH> 100644
--- a/visidata/sheets.py
+++ b/visidata/sheets.py
@@ -942,7 +942,7 @@ class IndexSheet(Sheet):
precious = False
columns = [
- ColumnAttr('name'),
+ Column('name', getter=lambda c,r: r.names[-1], setter=lambda c,r,v: setitem(r.names, -1, v)),
ColumnAttr('rows', 'nRows', type=int, width=9),
ColumnAttr('cols', 'nCols', type=int),
ColumnAttr('keys', 'keyColNames'),
|
[indexsheet] subsheet name is last element of Sheet.names
|
saulpw_visidata
|
train
|
py
|
e20a0d053376ad6a6735dc96731d09265ff846e5
|
diff --git a/alignak/macroresolver.py b/alignak/macroresolver.py
index <HASH>..<HASH> 100644
--- a/alignak/macroresolver.py
+++ b/alignak/macroresolver.py
@@ -185,10 +185,10 @@ class MacroResolver(Borg):
return unicode(value())
else:
return unicode(value)
- except AttributeError, exp:
+ except AttributeError:
# Return no value
return ''
- except UnicodeError, exp:
+ except UnicodeError:
if isinstance(value, str):
return unicode(value, 'utf8', errors='ignore')
else:
|
Enh: - Pylint W<I> in macroresolver.py
|
Alignak-monitoring_alignak
|
train
|
py
|
1cbd734ed3c245baf67e6928e62b4aa1e91affa3
|
diff --git a/worker/symantecDistrust/symantecDistrust.go b/worker/symantecDistrust/symantecDistrust.go
index <HASH>..<HASH> 100644
--- a/worker/symantecDistrust/symantecDistrust.go
+++ b/worker/symantecDistrust/symantecDistrust.go
@@ -218,7 +218,7 @@ func evalPaths(paths certificate.Paths) (distrust bool, reasons []string) {
} else {
// when the parent is a root that is not blacklisted, but it isn't trusted by mozilla,
// then flag the chain as distrusted anyway
- if parent.Cert.CA && len(parent.Parents) == 0 && !parent.Cert.ValidationInfo["mozilla"].IsValid {
+ if parent.Cert.CA && len(parent.Parents) == 0 && !parent.Cert.ValidationInfo["Mozilla"].IsValid {
reasons = append(reasons, fmt.Sprintf("path uses a root not trusted by Mozilla: %s (id=%d)", parent.Cert.Subject.String(), parent.Cert.ID))
} else {
distrust = false
|
It's Mozilla, with a capital M. Show some respect!
|
mozilla_tls-observatory
|
train
|
go
|
205213897520408092ac5d65be5c0f979aad129e
|
diff --git a/tests/library/CM/Clockwork/ManagerTest.php b/tests/library/CM/Clockwork/ManagerTest.php
index <HASH>..<HASH> 100644
--- a/tests/library/CM/Clockwork/ManagerTest.php
+++ b/tests/library/CM/Clockwork/ManagerTest.php
@@ -55,7 +55,7 @@ class CM_Clockwork_ManagerTest extends CMTest_TestCase {
public function testShouldRunFixedTimeMode() {
$timeZone = CM_Bootloader::getInstance()->getTimeZone();
- $currently = null;
+ $currently = new DateTime('midnight', new DateTimeZone('UTC'));
$lastRuntime = null;
$storageClass = $this->mockClass('CM_Clockwork_Storage_Memory');
$storageClass->mockMethod('getLastRuntime')->set(function () use (&$lastRuntime) {
|
assign correct datetime object to current time holder-variable in tests
|
cargomedia_cm
|
train
|
php
|
db91601c7ad50f0db45eb817be74651acdb82f50
|
diff --git a/tests/example_project/tests/test_newman/test_articles.py b/tests/example_project/tests/test_newman/test_articles.py
index <HASH>..<HASH> 100644
--- a/tests/example_project/tests/test_newman/test_articles.py
+++ b/tests/example_project/tests/test_newman/test_articles.py
@@ -18,7 +18,7 @@ class TestArticleBasics(NewmanTestCase):
# fill the form
data = {
- 'title' : u'马 experiment',
+ 'title' : u'马 žš experiment',
'upper_title' : u'vyšší',
'description' : u'Article description',
'slug' : 'title',
|
Add some Czech character to test, too
|
ella_ella
|
train
|
py
|
8d9b7ccc56aa19ef77b9b4eacc1123f908c74571
|
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
@@ -36,11 +36,13 @@ RSpec.configure do |config|
config.filter_run_excluding broken: broken_filter
config.expect_with :rspec do |expectations|
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect # Disable `should`
end
config.mock_with :rspec do |mocks|
mocks.syntax = :expect # Disable `should_receive` and `stub`
+ mocks.verify_partial_doubles = true
end
end
|
Enable RSpec settings that will default in RSpec 4
|
rubocop-hq_rubocop
|
train
|
rb
|
9b2cbeba18a9ec428eb037fc50aa8e2e29088bd4
|
diff --git a/nodeconductor/iaas/serializers.py b/nodeconductor/iaas/serializers.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/iaas/serializers.py
+++ b/nodeconductor/iaas/serializers.py
@@ -175,13 +175,18 @@ class NestedSecurityGroupRuleSerializer(serializers.ModelSerializer):
class SecurityGroupSerializer(serializers.HyperlinkedModelSerializer):
+ state = MappedChoiceField(
+ choices=[(v, k) for k, v in core_models.SynchronizationStates.CHOICES],
+ choice_mappings={v: k for k, v in core_models.SynchronizationStates.CHOICES},
+ read_only=True,
+ )
rules = NestedSecurityGroupRuleSerializer(many=True)
cloud_project_membership = NestedCloudProjectMembershipSerializer(
queryset=models.CloudProjectMembership.objects.all())
class Meta(object):
model = models.SecurityGroup
- fields = ('url', 'uuid', 'name', 'description', 'rules', 'cloud_project_membership')
+ fields = ('url', 'uuid', 'state', 'name', 'description', 'rules', 'cloud_project_membership')
read_only_fields = ('url', 'uuid')
extra_kwargs = {
'url': {'lookup_field': 'uuid'},
|
Add state field to serializer (itacloud-<I>)
|
opennode_waldur-core
|
train
|
py
|
b359d14f4c14febe96cea20d1061cd1cf24e64ec
|
diff --git a/persephone/config.py b/persephone/config.py
index <HASH>..<HASH> 100644
--- a/persephone/config.py
+++ b/persephone/config.py
@@ -1,4 +1,13 @@
-""" Configuration for some variables that may be system dependent. """
+""" Configuration for some variables that may be system dependent.
+
+Supply a settings.ini file to override values. The format of the file will
+have the following sections
+
+[PATHS]
+CORPORA_BASE_PATH = /my/path/to/corpora
+TARGET = /path/to/preprocessed/data
+EXPERIMENTS = /path/to/experiment/output
+"""
import configparser
import os
|
Put info about config into docstring
|
persephone-tools_persephone
|
train
|
py
|
bc177a8c777d9b3c2a5c6369b0212a7e3863bbc2
|
diff --git a/src/Jigsaw.php b/src/Jigsaw.php
index <HASH>..<HASH> 100644
--- a/src/Jigsaw.php
+++ b/src/Jigsaw.php
@@ -47,6 +47,11 @@ class Jigsaw
$this->app->events->fire($event, $this);
}
+ public function getSiteData()
+ {
+ return $this->siteData;
+ }
+
public function getEnvironment()
{
return $this->env;
@@ -71,7 +76,8 @@ class Jigsaw
public function setConfig($key, $value)
{
- data_set($this->siteData->page, $key, $value);
+ $this->siteData->set($key, $value);
+ $this->siteData->page->set($key, $value);
}
public function getSourcePath()
|
Set both top-level SiteData and 'page' when calling setConfig in Jigsaw
|
tightenco_jigsaw
|
train
|
php
|
6e61af3667de9e1a0cfbfb0b2c8a962429550a90
|
diff --git a/werkzeug/testsuite/urls.py b/werkzeug/testsuite/urls.py
index <HASH>..<HASH> 100644
--- a/werkzeug/testsuite/urls.py
+++ b/werkzeug/testsuite/urls.py
@@ -47,6 +47,12 @@ class URLsTestCase(WerkzeugTestCase):
x = urls.url_decode(b'%C3%9Ch=H%C3%A4nsel', decode_keys=True)
self.assert_strict_equal(x[u'Üh'], u'Hänsel')
+ def test_url_bytes_decoding(self):
+ x = urls.url_decode(b'foo=42&bar=23&uni=H%C3%A4nsel', charset=None)
+ self.assert_strict_equal(x[b'foo'], b'42')
+ self.assert_strict_equal(x[b'bar'], b'23')
+ self.assert_strict_equal(x[b'uni'], 'Hänsel'.encode('utf-8'))
+
def test_streamed_url_decoding(self):
item1 = u'a' * 100000
item2 = u'b' * 400
|
Added testcase for url_decode without character set
|
pallets_werkzeug
|
train
|
py
|
ab42cf7234407308ab26d3883ae34fc7a34e2961
|
diff --git a/pyecore/ecore.py b/pyecore/ecore.py
index <HASH>..<HASH> 100644
--- a/pyecore/ecore.py
+++ b/pyecore/ecore.py
@@ -567,9 +567,9 @@ EClass.eStructuralFeatures = EReference('eStructuralFeatures',
EStructuralFeature,
upper=-1, containment=True)
EClass._eAttributes = EReference('eAttributes', EAttribute, upper=-1,
- derived=True)
+ derived=True)
EClass._eReferences = EReference('eReferences', EReference, upper=-1,
- derived=True)
+ derived=True)
EClass.eSuperTypes = EReference('eSuperTypes', EClass, upper=-1)
EStructuralFeature.eContainingClass = \
@@ -607,3 +607,6 @@ Core._promote(EReference)
# We compute all the Metaclasses from the current module (EPackage-alike)
eClassifiers = Core.compute_eclass(__name__)
+__btypes = [EString, EBoolean, EInteger, EStringToStringMapEntry]
+__basic_types = {v.name: v for v in __btypes}
+eClassifiers.update(__basic_types)
|
Fix merge issues in ecore.py
|
pyecore_pyecore
|
train
|
py
|
5b1ae5018bbdd2796283d833aa3d532444440e03
|
diff --git a/lib/dive.js b/lib/dive.js
index <HASH>..<HASH> 100644
--- a/lib/dive.js
+++ b/lib/dive.js
@@ -98,7 +98,7 @@
// That means that the surface pressure on mars is roughly 166 times weaker than
// the surface pressure on Earth. Given that Mars's gravity is roughly 3.724m/s2.
// Which means if you had fresh water on Mars (380kg/m3 accounting for density)
- // the weight density of water on mars would be 3724 N/m3. Given 600 Pascals = 600 N/m2.
+ // the weight density of water on mars would be 1415.12 N/m3. Given 600 Pascals = 600 N/m2.
// You could dive (if fresh water existed on mars to a reasonanly depth), to reach the level
// of pressure that you would experience typically at 10 meters here on Earth you would have to
// dive up to 35.191361896 meters or about 115.457 feet.
|
Forgot to update newtons/m3 weight density calc for mars related to fresh water
|
nyxtom_dive
|
train
|
js
|
28d04b0ad41a529466b0a77066e52053641f3caf
|
diff --git a/src/you_get/common.py b/src/you_get/common.py
index <HASH>..<HASH> 100755
--- a/src/you_get/common.py
+++ b/src/you_get/common.py
@@ -540,8 +540,8 @@ def url_save_chunked(url, filepath, bar, refer = None, is_part = False, faker =
os.rename(temp_filepath, filepath)
class SimpleProgressBar:
- bar_size = term.get_terminal_size()[1] - 42
- bar = '{0:>5}% ({1:>5}/{2:<5}MB) ├{3:─<' + str(bar_size) + '}┤[{4}/{5}] {6}'
+ # minus the size of all statically known size in self.bar
+ bar_size = term.get_terminal_size()[1] - 38
def __init__(self, total_size, total_pieces = 1):
self.displayed = False
@@ -552,6 +552,10 @@ class SimpleProgressBar:
self.speed = ''
self.last_updated = time.time()
+ total_pieces_len = len(str(total_pieces))
+ self.bar = '{0:>5}%% ({1:>5}/{2:<5}MB) ├{3:─<%s}┤[{4:>%s}/{5:>%s}] {6}' % (
+ self.bar_size - 2*total_pieces_len, total_pieces_len, total_pieces_len)
+
def update(self):
self.displayed = True
bar_size = self.bar_size
|
[bar] dynamically calculate bar size
or it'll may be too short or too long as 'total_pieces' changes
old one has problems with <URL>
|
soimort_you-get
|
train
|
py
|
f667f8d45a912bf2ff6a4c02b3b4ed1508a8c420
|
diff --git a/lib/parslet/slice.rb b/lib/parslet/slice.rb
index <HASH>..<HASH> 100644
--- a/lib/parslet/slice.rb
+++ b/lib/parslet/slice.rb
@@ -105,6 +105,6 @@ class Parslet::Slice
# Prints the slice as <code>"string"@offset</code>.
def inspect
- str.inspect << "@#{offset}"
+ str.inspect + "@#{offset}"
end
end
|
Use + instead of << in Slice#inspect
Makes it run on Opal, which doesn't support mutable strings.
|
kschiess_parslet
|
train
|
rb
|
c48cebdcaf9565a477c0c5225685bb49ddd6d9b5
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,7 +1,7 @@
'use strict';
var assert = require('assert');
-var URI = require('URIjs');
+var URI = require('urijs');
var _ = require('lodash');
var jsonCompat = require('json-schema-compatibility');
var traverse = require('traverse');
|
Switch from 'URIjs' to 'urijs' lib. part 2
|
APIs-guru_raml-to-swagger
|
train
|
js
|
f5478d9263e9aa036a09199be7a5fe0644e02031
|
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -254,8 +254,6 @@ module ActiveSupport
# on the object.
def make_lambda(filter)
case filter
- when Array
- filter.map {|f| _compile_options(f)}
when Symbol
lambda { |target, value, &blk|
target.send filter, &blk
|
make_lambda is never called with an Array
|
rails_rails
|
train
|
rb
|
d9d8029783c9643af4b29fdb65b9995f59cf3199
|
diff --git a/test/acceptance/box_test.rb b/test/acceptance/box_test.rb
index <HASH>..<HASH> 100644
--- a/test/acceptance/box_test.rb
+++ b/test/acceptance/box_test.rb
@@ -20,14 +20,25 @@ class BoxTest < AcceptanceTest
assert(results.stdout.read =~ /^foo$/, "Box should exist after it is added")
end
- should "give a helpful error message if the file doesn't exist" do
- # Add a box which doesn't exist
+ should "give an error if the file doesn't exist" do
results = execute("vagrant", "box", "add", "foo", "/tmp/nope/nope/nope/nonono.box")
assert(!results.success?, "Box add should fail.")
assert(results.stdout.read =~ /^The specified path to a file doesn't exist.$/,
"This should show an error message about the file not existing.")
end
+ should "give an error if the file is not a valid box" do
+ invalid = @environment.workdir.join("nope.txt")
+ invalid.open("w+") do |f|
+ f.write("INVALID!")
+ end
+
+ results = execute("vagrant", "box", "add", "foo", invalid.to_s)
+ assert(!results.success?, "Box add should fail.")
+ assert(results.stdout.read =~ /^The box file you're attempting to add is invalid./,
+ "should show an error message")
+ end
+
should "add a box from an HTTP server" do
# TODO: Spin up an HTTP server to serve a file, add and test.
skip("Need to setup HTTP server functionality")
|
Test that adding an invalid box results in an error
|
hashicorp_vagrant
|
train
|
rb
|
9618def229e32e80f126d1782e29f411077a056b
|
diff --git a/src/Krystal/Cache/Tests/ArraySignatureTest.php b/src/Krystal/Cache/Tests/ArraySignatureTest.php
index <HASH>..<HASH> 100644
--- a/src/Krystal/Cache/Tests/ArraySignatureTest.php
+++ b/src/Krystal/Cache/Tests/ArraySignatureTest.php
@@ -6,5 +6,21 @@ use Krystal\Cache\FileEngine\ArraySignature;
class ArraySignatureTest extends \PHPUnit_Framework_TestCase
{
-
+ public function testCanDetectChange()
+ {
+ $initial = array(
+ 'name' => 'Dave',
+ 'age' => 24
+ );
+
+ $updated = array(
+ 'name' => 'Dave',
+ 'age' => 25
+ );
+
+ $singature = new ArraySignature();
+ $singature->setData($initial);
+
+ $this->assertTrue($singature->hasChanged($updated));
+ }
}
|
Added test case for ArraySignature
|
krystal-framework_krystal.framework
|
train
|
php
|
26544df4441ef7fef4900ec631bd2f1326e9b0f1
|
diff --git a/pyxcli/__init__.py b/pyxcli/__init__.py
index <HASH>..<HASH> 100644
--- a/pyxcli/__init__.py
+++ b/pyxcli/__init__.py
@@ -22,7 +22,7 @@ IBM XCLI Client Module
XCLI_DEFAULT_LOGGER = "xcli"
XCLI_DEFAULT_PORT = 7778
-version_tuple = (1, 2, 0)
+version_tuple = (1, 2, 1)
def get_version_string():
|
Develop (#<I>)
update version number to <I>
|
IBM_pyxcli
|
train
|
py
|
7d844bb938783105c48aa9f4a34663f7d4190c32
|
diff --git a/codec/decode.go b/codec/decode.go
index <HASH>..<HASH> 100644
--- a/codec/decode.go
+++ b/codec/decode.go
@@ -205,7 +205,7 @@ func NewDecoderBytes(in []byte, h Handle) *Decoder {
// Note that a pointer to a nil interface is not a nil pointer.
// If you do not know what type of stream it is, pass in a pointer to a nil interface.
// We will decode and store a value in that nil interface.
-//
+//
// Sample usages:
// // Decoding into a non-nil typed value
// var f float32
@@ -215,7 +215,12 @@ func NewDecoderBytes(in []byte, h Handle) *Decoder {
// var v interface{}
// dec := codec.NewDecoder(r, handle)
// err = dec.Decode(&v)
-//
+//
+// When decoding into a nil interface{}, we will decode into an appropriate value based
+// on the contents of the stream. Numbers are decoded as float64, int64 or uint64. Other values
+// are decoded appropriately (e.g. bool), and configurations exist on the Handle to override
+// defaults (e.g. for MapType, SliceType and how to decode raw bytes).
+//
// There are some special rules when decoding into containers (slice/array/map/struct).
// Decode will typically use the stream contents to UPDATE the container.
// - This means that for a struct or map, we just update matching fields or keys.
|
codec: updated docs to say that numbers and floats are decoded into nil interfaces as int<I>/uint<I>/float<I>.
|
ugorji_go
|
train
|
go
|
2ff8ed2e967138c4d1c9c8145de702bb95baff54
|
diff --git a/tests/HttpResponseTest.php b/tests/HttpResponseTest.php
index <HASH>..<HASH> 100644
--- a/tests/HttpResponseTest.php
+++ b/tests/HttpResponseTest.php
@@ -58,4 +58,18 @@ class HttpResponseTest extends \PHPUnit_Framework_TestCase {
$this->assertSame($headers['Connection'], $httpResponse->getHeader('Connection'));
$this->assertSame($headers['Server'], $httpResponse->getHeader('Server'));
}
+
+ public function testBodyIsRejectedForNonBodyCodesInConstructor()
+ {
+ $this->setExpectedException('\LogicException');
+ new HttpResponse('test', array(), HttpCode::NO_CONTENT);
+ }
+
+ public function testBodyIsRejectedForNonBodyCodesInSetBody()
+ {
+ $httpResponse = new HttpResponse(null, array(), HttpCode::NO_CONTENT);
+
+ $this->setExpectedException('\LogicException');
+ $httpResponse->setBody('test');
+ }
}
|
Added test for denying body on non-body codes in HttpResponse.
|
kiler129_CherryHttp
|
train
|
php
|
31a009874d213c890041ebd3ae20f8115a5ab237
|
diff --git a/angular-bind-html-compile.js b/angular-bind-html-compile.js
index <HASH>..<HASH> 100644
--- a/angular-bind-html-compile.js
+++ b/angular-bind-html-compile.js
@@ -1,9 +1,9 @@
(function (angular) {
'use strict';
- var module = angular.module('angular-bind-html-compile', []);
+ var mod = angular.module('angular-bind-html-compile', []);
- module.directive('bindHtmlCompile', ['$compile', function ($compile) {
+ mod.directive('bindHtmlCompile', ['$compile', function ($compile) {
return {
restrict: 'A',
link: function (scope, element, attrs) {
@@ -24,4 +24,8 @@
}
};
}]);
+
+ if (module && module.exports) {
+ module.exports = mod.name;
+ }
}(window.angular));
|
Added module.exports to main script
|
incuna_angular-bind-html-compile
|
train
|
js
|
81dedf11d2098e4b98082b25e7d9d9ea59dbaa52
|
diff --git a/lib/manager.js b/lib/manager.js
index <HASH>..<HASH> 100644
--- a/lib/manager.js
+++ b/lib/manager.js
@@ -196,9 +196,9 @@ Manager.prototype.disabled = function (key) {
Manager.prototype.configure = function (env, fn) {
if ('function' == typeof env) {
- env();
+ env.call(this);
} else if (env == process.env.NODE_ENV) {
- fn();
+ fn.call(this);
}
return this;
|
Fixed; keep scope for `Manager#configure`.
|
socketio_socket.io
|
train
|
js
|
822b54401ec8c20546e0bba3563c54f1f4ca1b88
|
diff --git a/services/language_translation/v2.js b/services/language_translation/v2.js
index <HASH>..<HASH> 100644
--- a/services/language_translation/v2.js
+++ b/services/language_translation/v2.js
@@ -112,7 +112,9 @@ module.exports = function (RED) {
text: 'requesting training'
});
- temp.open('myprefix', function (err, info) {
+ temp.open({
+ suffix: '.xml'
+ }, function (err, info) {
if (!err) {
fs.write(info.fd, msg.payload);
var params = {};
|
file extension to xml (for tmx)
|
watson-developer-cloud_node-red-node-watson
|
train
|
js
|
8f7967acd0efcbf9d1483ac33cf26a27baaf4e74
|
diff --git a/lib/output/generatePages.js b/lib/output/generatePages.js
index <HASH>..<HASH> 100644
--- a/lib/output/generatePages.js
+++ b/lib/output/generatePages.js
@@ -25,6 +25,10 @@ function generatePages(generator, output) {
return generatePage(out, page)
.then(function(resultPage) {
return generator.onPage(out, resultPage);
+ })
+ .fail(function(err) {
+ logger.error.ln('error while generating page "' + file.getPath() + '":');
+ throw err;
});
}, output);
}
|
Log page causing error when a bug occurs during generation
|
GitbookIO_gitbook
|
train
|
js
|
c8cc21c04a201eefd2e42153a522c1e9e0abe2d0
|
diff --git a/src/MB_Toolbox_cURL.php b/src/MB_Toolbox_cURL.php
index <HASH>..<HASH> 100644
--- a/src/MB_Toolbox_cURL.php
+++ b/src/MB_Toolbox_cURL.php
@@ -4,6 +4,8 @@
*/
namespace DoSomething\MB_Toolbox;
+
+use DoSomething\MB_Toolbox\MB_ToolboxL;
use DoSomething\MBStatTracker\StatHat;
class MB_Toolbox_cURL
@@ -20,6 +22,12 @@ class MB_Toolbox_cURL
protected $mbConfig;
/**
+ * General tools for the Message Broker system.
+ * @var object $mbToolbox
+ */
+ private $mbToolbox;
+
+ /**
* Setting from external service to track activity - StatHat.
*
* @var object
@@ -52,6 +60,7 @@ class MB_Toolbox_cURL
$this->mbConfig = MB_Configuration::getInstance();
$this->statHat = $this->mbConfig->getProperty('statHat');
+ $this->mbToolbox = new MB_Toolbox();
}
/**
@@ -183,7 +192,7 @@ class MB_Toolbox_cURL
// https://www.dosomething.org/api/v1/auth/login
$curlUrl .= self::DRUPAL_API . '/auth/login';
- $auth = $this->curlPOST($curlUrl, $post);
+ $auth = $this->mbToolbox->curlPOST($curlUrl, $post);
if ($auth[1] == 200) {
$auth = $auth[0];
|
Support POST methods still in MB_Toolbox()
|
DoSomething_mb-toolbox
|
train
|
php
|
cd00076cadf4a9fdb09e0f24b2a5c70c46bfcec3
|
diff --git a/server/webapp/WEB-INF/rails.new/app/assets/new_javascripts/models/validatable_mixin.js b/server/webapp/WEB-INF/rails.new/app/assets/new_javascripts/models/validatable_mixin.js
index <HASH>..<HASH> 100644
--- a/server/webapp/WEB-INF/rails.new/app/assets/new_javascripts/models/validatable_mixin.js
+++ b/server/webapp/WEB-INF/rails.new/app/assets/new_javascripts/models/validatable_mixin.js
@@ -60,7 +60,7 @@ define(['lodash', 'string-plus', 'mithril', 'models/errors', 'models/model_mixin
}
if (!entity[attr]().match(options.format)) {
- entity.errors().add(attr, options.message || (s.humanize(attribute) + ' format is in valid'));
+ entity.errors().add(attr, options.message || (s.humanize(attr) + ' format is in valid'));
}
};
};
|
Fix a typo with a variable name
|
gocd_gocd
|
train
|
js
|
7bd0e6017bbab820ad2f6c67863bde2cb22a13c3
|
diff --git a/test/extended/prometheus/prometheus.go b/test/extended/prometheus/prometheus.go
index <HASH>..<HASH> 100644
--- a/test/extended/prometheus/prometheus.go
+++ b/test/extended/prometheus/prometheus.go
@@ -213,7 +213,7 @@ var _ = g.Describe("[Feature:Prometheus][Conformance] Prometheus", func() {
tests := map[string][]metricTest{
// should be checking there is no more than 1 alerts firing.
// Checking for specific alert is done in "should have a Watchdog alert in firing state".
- `sum(ALERTS{alertstate="firing"})`: {metricTest{greaterThanEqual: false, value: 2}},
+ `ALERTS{alertstate="firing"}`: {metricTest{greaterThanEqual: false, value: 2}},
}
runQueries(tests, oc, ns, execPod.Name, url, bearerToken)
})
|
Make the metric more readable when fails
|
openshift_origin
|
train
|
go
|
d33012c4547f279449926e21e6ef35e6d0561d14
|
diff --git a/src/Model/BlogController.php b/src/Model/BlogController.php
index <HASH>..<HASH> 100644
--- a/src/Model/BlogController.php
+++ b/src/Model/BlogController.php
@@ -107,7 +107,7 @@ class BlogController extends PageController
*/
public function rss()
{
- $this->blogPosts = $this->getBlogPosts();
+ $this->blogPosts = $this->getBlogPosts()->limit($this->PostsPerPage);
$rss = new RSSFeed($this->blogPosts, $this->Link(), $this->Title, $this->MetaDescription);
|
Add limit to rss (PostsPerPage)
|
axllent_silverstripe-weblog
|
train
|
php
|
937f53b0b272c83796c5231baaa0e824209a31f4
|
diff --git a/src/geshi/vbscript.php b/src/geshi/vbscript.php
index <HASH>..<HASH> 100644
--- a/src/geshi/vbscript.php
+++ b/src/geshi/vbscript.php
@@ -88,7 +88,7 @@ $language_data = array (
),
),
'SYMBOLS' => array(
- '-', '&', '*', '/', '\\', '^', '+', '<', '<=', '<>', '=', '=', '>', '>=',
+ '-', '&', '*', '/', '\\', '^', '+', '<', '<=', '<>', '=', '>', '>='
),
'CASE_SENSITIVE' => array(
GESHI_COMMENTS => false,
@@ -144,7 +144,7 @@ $language_data = array (
),
'PARSER_CONTROL' => array(
'ENABLE_FLAGS' => array(
- 'BRACKETS' => GESHI_NEVER,
+ 'BRACKETS' => GESHI_NEVER
)
)
);
|
fix: Some minor fixups for VBScript
|
GeSHi_geshi-1.0
|
train
|
php
|
6f2969b399e8e90a9e39a6760a1cae7a5f220bae
|
diff --git a/command/v7/shared/app_stager_test.go b/command/v7/shared/app_stager_test.go
index <HASH>..<HASH> 100644
--- a/command/v7/shared/app_stager_test.go
+++ b/command/v7/shared/app_stager_test.go
@@ -253,7 +253,8 @@ var _ = Describe("app stager", func() {
})
It("displays that it's restarting the app", func() {
- user, _ := fakeConfig.CurrentUser()
+ user, err := fakeConfig.CurrentUser()
+ Expect(err).NotTo(HaveOccurred())
Expect(testUI.Out).To(Say(`Restarting app %s in org %s / space %s as %s\.\.\.`, app.Name, organization.Name, space.Name, user.Name))
})
|
Check error in test to appease linter
|
cloudfoundry_cli
|
train
|
go
|
947e5dc18f997092ebc1b738b6adeff045bce24b
|
diff --git a/ariba/mapping.py b/ariba/mapping.py
index <HASH>..<HASH> 100644
--- a/ariba/mapping.py
+++ b/ariba/mapping.py
@@ -1,5 +1,6 @@
import os
import sys
+from distutils.version import LooseVersion
import pysam
import pyfastaq
from ariba import common
@@ -82,7 +83,7 @@ def run_bowtie2(
'-2', reads_rev,
]
- if bowtie2_version == '2.3.1':
+ if LooseVersion(bowtie2_version) >= LooseVersion('2.3.1'):
map_cmd.append('--score-min G,1,10')
if remove_both_unmapped:
|
Change mapping options bor bowtie <I> and later
|
sanger-pathogens_ariba
|
train
|
py
|
dd7984f279c1e72da2e3b80cde0943edc5452eac
|
diff --git a/lib/api.js b/lib/api.js
index <HASH>..<HASH> 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -86,6 +86,11 @@ function NodeCG(bundle, socket) {
* @param {mixed} [data] The data to send.
*/
NodeCG.prototype.sendMessage = function (messageName, data, callback) {
+ if (typeof callback === 'undefined' && typeof data === 'function') {
+ callback = data;
+ data = null;
+ }
+
this.sendMessageToBundle(messageName, this.bundleName, data, callback);
};
diff --git a/test/extensionApi.js b/test/extensionApi.js
index <HASH>..<HASH> 100644
--- a/test/extensionApi.js
+++ b/test/extensionApi.js
@@ -23,6 +23,11 @@ describe('extension api', function() {
cb();
});
e.apis.dashboard.sendMessage('clientToServer', done);
+
+ // Give Zombie a chance to process socket.io events
+ // What the actual fuck why is this only SOMETIMES necessary??????
+ // I'm so mad what the heck
+ e.browsers.dashboard.wait({duration: 100});
});
it('can send messages', function(done) {
|
[replicants] i'm actually mad :angry:
|
nodecg_nodecg
|
train
|
js,js
|
a0474d9907957db436bbaaf5c190c4aefa1e193b
|
diff --git a/src/loaders/OBJLoader2.js b/src/loaders/OBJLoader2.js
index <HASH>..<HASH> 100644
--- a/src/loaders/OBJLoader2.js
+++ b/src/loaders/OBJLoader2.js
@@ -1354,7 +1354,7 @@ THREE.OBJLoader2 = (function () {
var onError = function ( event ) {
var output = 'Error occurred while downloading "' + resource.url + '"';
- this.logger.logError( output + ': ' + event );
+ scope.logger.logError( output + ': ' + event );
throw output;
};
|
Fixed wrong scope in case of error in loadMtl
|
kaisalmen_WWOBJLoader
|
train
|
js
|
82faf6cbb283c33fda42df4debcada88365c8297
|
diff --git a/onyx-database/src/com/onyx/fetch/impl/PartitionIndexScanner.java b/onyx-database/src/com/onyx/fetch/impl/PartitionIndexScanner.java
index <HASH>..<HASH> 100644
--- a/onyx-database/src/com/onyx/fetch/impl/PartitionIndexScanner.java
+++ b/onyx-database/src/com/onyx/fetch/impl/PartitionIndexScanner.java
@@ -120,12 +120,12 @@ public class PartitionIndexScanner extends IndexScanner implements TableScanner
if(query.isTerminated())
return returnValue;
- indexController.findAll(idValue).forEach(o -> references.add(o));
+ partitionIndexController.findAll(idValue).forEach(o -> references.add(o));
}
}
else
{
- indexController.findAll(criteria.getValue()).forEach(o -> references.add(o));
+ partitionIndexController.findAll(criteria.getValue()).forEach(o -> references.add(o));
}
references.stream().forEach(val->
|
Fix for indexes sitting in different partition
|
OnyxDevTools_onyx-database-parent
|
train
|
java
|
781cb8e463da273951c37462e84baac9aa85ec6b
|
diff --git a/seleniumbase/core/mysql.py b/seleniumbase/core/mysql.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/core/mysql.py
+++ b/seleniumbase/core/mysql.py
@@ -23,7 +23,7 @@ class DatabaseManager():
db_user = settings.DB_USERNAME
db_pass = settings.DB_PASSWORD
db_schema = settings.DB_SCHEMA
- if sb_config.settings_file:
+ if hasattr(sb_config, "settings_file") and sb_config.settings_file:
override = settings_parser.set_settings(sb_config.settings_file)
if "DB_HOST" in override.keys():
db_server = override['DB_HOST']
|
Better error-handling with custom settings parsing
|
seleniumbase_SeleniumBase
|
train
|
py
|
fad335c38d40c522122e527bc7dc8eb1965580fb
|
diff --git a/src/DrupalExtension/Context/ScreenShotContext.php b/src/DrupalExtension/Context/ScreenShotContext.php
index <HASH>..<HASH> 100644
--- a/src/DrupalExtension/Context/ScreenShotContext.php
+++ b/src/DrupalExtension/Context/ScreenShotContext.php
@@ -96,7 +96,7 @@ class ScreenShotContext extends RawMinkContext {
* @AfterStep
*/
public function takeScreenshotAfterFailedStep(AfterStepScope $event) {
- if ($event->getTestResult()->isPassed()) {
+ if ($event->getTestResult()->getResultCode() !== TestResult::FAILED) {
// Not a failed step.
return;
}
|
Take screenshot after step failed: only if test result is failed.
|
nuvoleweb_drupal-behat
|
train
|
php
|
16c3cced33dabb6a7854be96b8b31c5f3430ac06
|
diff --git a/spec/mongo/cursor_spec.rb b/spec/mongo/cursor_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/mongo/cursor_spec.rb
+++ b/spec/mongo/cursor_spec.rb
@@ -1,6 +1,10 @@
require 'spec_helper'
describe Mongo::Cursor do
+ let(:authorized_collection) do
+ authorized_client['cursor_spec_collection']
+ end
+
before do
authorized_collection.drop
end
|
Fix the intermittent failure in cursor spec #<I>
|
mongodb_mongo-ruby-driver
|
train
|
rb
|
126f33815ee94163fb79eb76c0e67ae74a8a31ea
|
diff --git a/android/src/com/google/zxing/client/android/AmbientLightManager.java b/android/src/com/google/zxing/client/android/AmbientLightManager.java
index <HASH>..<HASH> 100644
--- a/android/src/com/google/zxing/client/android/AmbientLightManager.java
+++ b/android/src/com/google/zxing/client/android/AmbientLightManager.java
@@ -34,8 +34,8 @@ import com.google.zxing.client.android.camera.FrontLightMode;
*/
final class AmbientLightManager implements SensorEventListener {
- private static final float TOO_DARK_LUX = 90.0f;
- private static final float BRIGHT_ENOUGH_LUX = 225.0f;
+ private static final float TOO_DARK_LUX = 45.0f;
+ private static final float BRIGHT_ENOUGH_LUX = 450.0f;
private final Context context;
private CameraManager cameraManager;
|
Make light thresholds less sensitive to avoid rapid on/off on some devices
git-svn-id: <URL>
|
zxing_zxing
|
train
|
java
|
d72d2b7d31a00f96d11fc1b793a1ae56e5445145
|
diff --git a/lib/webmock/request_stub.rb b/lib/webmock/request_stub.rb
index <HASH>..<HASH> 100644
--- a/lib/webmock/request_stub.rb
+++ b/lib/webmock/request_stub.rb
@@ -22,6 +22,7 @@ module WebMock
end
self
end
+ alias_method :and_return, :to_return
def to_rack(app, options={})
@responses_sequences << ResponsesSequence.new([RackResponse.new(app)])
@@ -33,11 +34,13 @@ module WebMock
})
self
end
+ alias_method :and_raise, :to_raise
def to_timeout
@responses_sequences << ResponsesSequence.new([ResponseFactory.response_for(:should_timeout => true)])
self
end
+ alias_method :and_timeout, :to_timeout
def response
if @responses_sequences.empty?
|
Allow RSpec like syntax
This PR allows a more intuitive approach when using RSpec.
Since double and mock in RSpec already permit a `.and_return` syntax,
mimic this behaviour in webmock for easier reading and integration.
|
bblimke_webmock
|
train
|
rb
|
8f3c7fe27853beead95415c534549f35391aa64f
|
diff --git a/test/test_framework.go b/test/test_framework.go
index <HASH>..<HASH> 100644
--- a/test/test_framework.go
+++ b/test/test_framework.go
@@ -117,13 +117,13 @@ func newServer(t *t, opts ...options) server {
}
priv := "cat /tmp/sshkey | " + base64
privKey, err := exec.Command("bash", "-c", priv).Output()
- if err != nil {
+ if err != nil || len(privKey) = 0 {
panic(string(privKey))
}
pub := "cat /tmp/sshkey.pub | " + base64
pubKey, err := exec.Command("bash", "-c", pub).Output()
- if err != nil {
+ if err != nil || len(pubKey) = 0 {
panic(string(pubKey))
}
cmd = exec.Command("docker", "run", "--name", fname,
|
test: error if no jwt keys present in jwt tests
|
micro_micro
|
train
|
go
|
0d1a9832d7e3502c63007fc6ec34a306da4f77aa
|
diff --git a/anyvcs/svn.py b/anyvcs/svn.py
index <HASH>..<HASH> 100644
--- a/anyvcs/svn.py
+++ b/anyvcs/svn.py
@@ -175,9 +175,13 @@ class SvnRepo(VCSRepo):
return (rev, '/' + head)
def canonical_rev(self, rev):
+ try:
+ types = (str, unicode)
+ except NameError:
+ types = str
if isinstance(rev, int):
return rev
- elif isinstance(rev, (str, unicode)) and rev.isdigit():
+ elif isinstance(rev, types) and rev.isdigit():
return int(rev)
else:
rev, prefix = self._maprev(rev)
|
fix reference to unicode in SvnRepo.canonical_rev
Python 3 deprecates the need for 'unicode' so this causes a NameError when
it is referred to.
|
ScottDuckworth_python-anyvcs
|
train
|
py
|
c1c02e61583e2ec682dacb4e6ffee9ee75901979
|
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
@@ -118,9 +118,7 @@ end
def test_oauth_credentials
{
app_key: test_trello_app_key,
- app_secret: test_trello_app_secret,
- oauth_token: test_trello_oauth_token,
- oauth_secret: test_trello_oauth_secret
+ oauth_token: test_trello_oauth_token
}
end
|
only app key and oauth token needed for oauth credentials
|
rossta_tacokit.rb
|
train
|
rb
|
cc8ecb6ff561517e8dea75d81c0303345f1d6301
|
diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java
index <HASH>..<HASH> 100644
--- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java
+++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EnvironmentEndpointTests.java
@@ -19,6 +19,7 @@ package org.springframework.boot.actuate.endpoint;
import java.util.Collections;
import java.util.Map;
+import org.junit.After;
import org.junit.Test;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -45,6 +46,12 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests<EnvironmentE
super(Config.class, EnvironmentEndpoint.class, "env", true, "endpoints.env");
}
+ @Override
+ @After
+ public void close() {
+ System.clearProperty("VCAP_SERVICES");
+ }
+
@Test
public void invoke() throws Exception {
assertThat(getEndpointBean().invoke()).isNotEmpty();
|
Clear VCAP_APPLICATION after tests
So that other CF tests do not fail.
|
spring-projects_spring-boot
|
train
|
java
|
439dec8131368bccbab5ee9c8eaf0f310ffa855e
|
diff --git a/src/server/pkg/sync/sync.go b/src/server/pkg/sync/sync.go
index <HASH>..<HASH> 100644
--- a/src/server/pkg/sync/sync.go
+++ b/src/server/pkg/sync/sync.go
@@ -16,8 +16,11 @@ import (
// Puller as a struct for managing a Pull operation.
type Puller struct {
- errCh chan error
- pipes map[string]bool
+ // errCh contains an error from the pipe goros
+ errCh chan error
+ // pipes is a set containing all pipes that are currently blocking
+ pipes map[string]bool
+ // pipesMu is a mutex to synchronize access to pipes
pipesMu sync.Mutex
}
|
Adds comments for Puller struct.
|
pachyderm_pachyderm
|
train
|
go
|
b45c8c1506405dd1afe35f1a617866f05624cf95
|
diff --git a/lib/alephant/storage.rb b/lib/alephant/storage.rb
index <HASH>..<HASH> 100644
--- a/lib/alephant/storage.rb
+++ b/lib/alephant/storage.rb
@@ -95,9 +95,18 @@ module Alephant
}
end
+ def override_host_path?
+ ENV['AWS_S3_HOST_OVERRIDE'] == 'true'
+ end
+
+
def client
options = {}
options[:endpoint] = ENV['AWS_S3_ENDPOINT'] if ENV['AWS_S3_ENDPOINT']
+ if override_host_path?
+ options[:disable_host_prefix_injection] = true
+ options[:force_path_style] = true
+ end
@client ||= ::Aws::S3::Client.new(options)
end
end
|
Added an env variable directive to override default hostname path for the s3 bucket
|
BBC-News_alephant-storage
|
train
|
rb
|
5d466c13e1c98a6fc893b43d257d2b966ea4ac00
|
diff --git a/bcbio/rnaseq/sailfish.py b/bcbio/rnaseq/sailfish.py
index <HASH>..<HASH> 100644
--- a/bcbio/rnaseq/sailfish.py
+++ b/bcbio/rnaseq/sailfish.py
@@ -56,11 +56,12 @@ def sailfish(fq1, fq2, sailfish_dir, gtf_file, ref_file, strandedness, data):
def sailfish_index(gtf_file, ref_file, data):
sailfish = config_utils.get_program("sailfish", data["config"])
+ num_cores = dd.get_num_cores(data)
gtf_fa_dirty = _gtf_to_fasta(gtf_file, ref_file, data)
gtf_fa = _clean_gtf_fa(gtf_fa_dirty, data)
tmpdir = dd.get_tmp_dir(data)
out_dir = tempfile.mkdtemp(prefix="sailfish_index", dir=tmpdir)
- cmd = "{sailfish} index -t {gtf_fa} -o {out_dir} -k 25"
+ cmd = "{sailfish} index -p {num_cores} -t {gtf_fa} -o {out_dir} -k 25"
message = "Creating sailfish index for {gtf_fa}."
do.run(cmd.format(**locals()), message.format(**locals()), None)
return out_dir
|
Index sailfish in parallel.
Closes #<I>.
|
bcbio_bcbio-nextgen
|
train
|
py
|
6103a1f56f9bb76ab2b5b399080d870bc79ec19d
|
diff --git a/src/load/index.js b/src/load/index.js
index <HASH>..<HASH> 100644
--- a/src/load/index.js
+++ b/src/load/index.js
@@ -1,6 +1,8 @@
import load from './load.module';
/**
+ * This function is deprecated and you should try to migrate to using parse.
+ * This function will fetch the whole file in order to parse it!
* The load function takes a url to a geotiff or geotiff file as an input
* and returns a promise. The promise resolves as a georaster, which
* can be used as input in other geoblaze methods, such as identify, sum,
|
added deprecation warning to load
|
GeoTIFF_geoblaze
|
train
|
js
|
e47ff83ef45a52f8e365aa5c97405e563db2021a
|
diff --git a/src/frontend/org/voltcore/utils/InstanceId.java b/src/frontend/org/voltcore/utils/InstanceId.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltcore/utils/InstanceId.java
+++ b/src/frontend/org/voltcore/utils/InstanceId.java
@@ -51,7 +51,8 @@ public class InstanceId
return m_timestamp;
}
- public long getHash()
+ @Override
+ public int hashCode()
{
ByteBuffer buf = ByteBuffer.allocate(12);
buf.putLong(m_timestamp);
@@ -70,7 +71,7 @@ public class InstanceId
}
md.update(buf);
byte[] digest = md.digest();
- return ByteBuffer.wrap(digest).getLong();
+ return ByteBuffer.wrap(digest).getInt();
}
public JSONObject serializeToJSONObject() throws JSONException
|
Findbugs: need a hashcode for InstanceId
|
VoltDB_voltdb
|
train
|
java
|
4ad33958d841cb6518864763f9029f713d57066e
|
diff --git a/tests/test_sql.php b/tests/test_sql.php
index <HASH>..<HASH> 100644
--- a/tests/test_sql.php
+++ b/tests/test_sql.php
@@ -46,7 +46,7 @@ SQL::each('SELECT id FROM users',function($row) use (&$cc) {
$cc += $row->id;
});
-test($cc == 3,'SQL','Each, row callback.');
+test($cc == 10,'SQL','Each, row callback.');
test(SQL::update('users',[
|
[TEST] Absolute path 2
|
caffeina-core_core
|
train
|
php
|
2dbfee70feaf33ce7697587c33527fc21ca51da2
|
diff --git a/lib/apple_tv_converter/command_line.rb b/lib/apple_tv_converter/command_line.rb
index <HASH>..<HASH> 100644
--- a/lib/apple_tv_converter/command_line.rb
+++ b/lib/apple_tv_converter/command_line.rb
@@ -12,7 +12,8 @@ module AppleTvConverter
converter = AppleTvConverter::MediaConverter.new(options)
- media_objects.each do |media|
+ media_objects.each_with_index do |media, index|
+ puts "---[ Processing file #{index + 1} of #{media_objects.length}: #{File.basename(media.original_filename)} ]----------------"
converter.process_media media
end
rescue ArgumentError => e
|
Added progress information to the command line utility
|
gokuu_apple-tv-converter
|
train
|
rb
|
7082a1ac0f409938900f717eeda50ff14ddd9bcf
|
diff --git a/gandi/cli/commands/vm.py b/gandi/cli/commands/vm.py
index <HASH>..<HASH> 100644
--- a/gandi/cli/commands/vm.py
+++ b/gandi/cli/commands/vm.py
@@ -140,7 +140,6 @@ def delete(gandi, background, force, resource):
"""
output_keys = ['id', 'type', 'step']
- iaas_list = gandi.iaas.list()
possible_resources = gandi.iaas.resource_list()
for item in resource:
if item not in possible_resources:
@@ -157,6 +156,7 @@ def delete(gandi, background, force, resource):
if not proceed:
return
+ iaas_list = gandi.iaas.list()
stop_opers = []
for item in resource:
vm = next((vm for (index, vm) in enumerate(iaas_list)
|
vm: avoid listing vm too early
when deleting a vm we may fail in possible_resources or in confirmation.
we only need the complete vm list afterwards
|
Gandi_gandi.cli
|
train
|
py
|
dcf32f91a6e664df530d42fa0d652695091d7a35
|
diff --git a/heartbeat/heartbeat.py b/heartbeat/heartbeat.py
index <HASH>..<HASH> 100644
--- a/heartbeat/heartbeat.py
+++ b/heartbeat/heartbeat.py
@@ -63,7 +63,7 @@ class Heartbeat(object):
so Node A can verify that Node B has a specified file.
"""
- def __init__(self, filepath):
+ def __init__(self, filepath, secret=None):
# Check if the file exists
""" Initialization method
@@ -76,6 +76,8 @@ class Heartbeat(object):
else:
raise HeartbeatError("%s not found" % filepath)
+ self.secret = secret
+
# Challenges is a list of 2-tuples (seed, hash_response)
self.challenges = []
|
Add support for a secret attribute and constructor kwarg
|
StorjOld_heartbeat
|
train
|
py
|
8b9b149d5412dd3c775caf4fc3df39ebad90184f
|
diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go
index <HASH>..<HASH> 100644
--- a/swarm/api/http/server.go
+++ b/swarm/api/http/server.go
@@ -129,7 +129,7 @@ func NewServer(api *api.API, corsString string) *Server {
})
mux.Handle("/bzz-immutable:/", methodHandler{
"GET": Adapt(
- http.HandlerFunc(server.HandleGet),
+ http.HandlerFunc(server.HandleBzzGet),
defaultMiddlewares...,
),
})
diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go
index <HASH>..<HASH> 100644
--- a/swarm/api/http/server_test.go
+++ b/swarm/api/http/server_test.go
@@ -672,7 +672,7 @@ func testBzzGetPath(encrypted bool, t *testing.T) {
nonhashresponses := []string{
`cannot resolve name: no DNS to resolve name: "name"`,
- `cannot resolve nonhash: immutable address not a content hash: "nonhash"`,
+ `cannot resolve nonhash: no DNS to resolve name: "nonhash"`,
`cannot resolve nonhash: no DNS to resolve name: "nonhash"`,
`cannot resolve nonhash: no DNS to resolve name: "nonhash"`,
`cannot resolve nonhash: no DNS to resolve name: "nonhash"`,
|
swarm/api/http: bzz-immutable wrong handler bug (#<I>)
|
ethereum_go-ethereum
|
train
|
go,go
|
7299a7c6f0a25d68f1e2e0ca6ab80584b432edeb
|
diff --git a/src/main/java/org/jsoup/nodes/Element.java b/src/main/java/org/jsoup/nodes/Element.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jsoup/nodes/Element.java
+++ b/src/main/java/org/jsoup/nodes/Element.java
@@ -508,9 +508,7 @@ public class Element extends Node {
}
/**
- <b>Beta:</b> find Elements that match the supplied XPath expression.
- <p>(This functionality is currently in beta and is subject to change. Feedback on the API is requested and
- welcomed!)</p>
+ Find Elements that match the supplied XPath expression.
<p>By default, XPath 1.0 expressions are supported. If you would to use XPath 2.0 or higher, you can provide an
alternate XPathFactory implementation:</p>
<ol>
@@ -530,7 +528,7 @@ public class Element extends Node {
}
/**
- <b>Beta:</b> find Nodes that match the supplied XPath expression.
+ Find Nodes that match the supplied XPath expression.
<p>For example, to select TextNodes under {@code p} elements: </p>
<pre>List<TextNode> textNodes = doc.selectXpath("//body//p//text()", TextNode.class);</pre>
<p>Note that in the jsoup DOM, Attribute objects are not Nodes. To directly select attribute values, do something
|
Moved xpath support out of beta
|
jhy_jsoup
|
train
|
java
|
aa3066cba9985d54bd085d40d4952ec794fd4ac7
|
diff --git a/src/Error/ExceptionTrap.php b/src/Error/ExceptionTrap.php
index <HASH>..<HASH> 100644
--- a/src/Error/ExceptionTrap.php
+++ b/src/Error/ExceptionTrap.php
@@ -341,7 +341,6 @@ class ExceptionTrap
*/
public function logException(Throwable $exception, ?ServerRequestInterface $request = null): void
{
- $logger = $this->logger();
$shouldLog = true;
foreach ($this->_config['skipLog'] as $class) {
if ($exception instanceof $class) {
@@ -350,7 +349,7 @@ class ExceptionTrap
}
}
if ($shouldLog) {
- $logger->log($exception, $request);
+ $this->logger()->log($exception, $request);
}
$this->dispatchEvent('Exception.beforeRender', ['exception' => $exception]);
}
|
Delay creation of error logger.
|
cakephp_cakephp
|
train
|
php
|
394d6fb808f665d441b1bbe4f28bad1ed04b5767
|
diff --git a/src/Connections/Dbo.php b/src/Connections/Dbo.php
index <HASH>..<HASH> 100644
--- a/src/Connections/Dbo.php
+++ b/src/Connections/Dbo.php
@@ -164,7 +164,8 @@
elseif ($queryType == "INSERT" && $return === true && $single === true)
{
$id = $this->connection->lastInsertId();
- $table = substr($SQL, 12, strpos($SQL, " ", 12) - 12);
+ $cleaned = str_replace("\n", " ", $SQL); // Todo: use better system of determining table name
+ $table = substr($cleaned, 12, strpos($cleaned, " ", 12) - 12);
$index = $this->query("SHOW INDEX FROM `" . $this->config->database() . "`." . $table . " WHERE `Key_name` = 'PRIMARY'", array(), true); // possible security issue here as the statement ?cant? be prepared
$key = $index['Column_name'];
|
Update table name selection to not require a trailing space
|
irwtdvoys_bolt-core
|
train
|
php
|
078aed5269465de1b6b8f697a717d47a6eede18b
|
diff --git a/lib/clock.js b/lib/clock.js
index <HASH>..<HASH> 100644
--- a/lib/clock.js
+++ b/lib/clock.js
@@ -187,9 +187,6 @@ Clock.prototype.min = function(v) {
if (!arguments.length) {
return this.valid.min();
}
- if (v) {
- v.minute = coerceMinutes(v.minute);
- }
this.valid.min(v);
this.markInvalid(this.selected.hour, true);
return this;
@@ -199,9 +196,6 @@ Clock.prototype.max = function(v) {
if (!arguments.length) {
return this.valid.max();
}
- if (v) {
- v.minute = coerceMinutes(v.minute);
- }
this.valid.max(v);
this.markInvalid(this.selected.hour, true);
return this;
|
Stop coercing min and max values
We should only coerce minutes for values that we intend to select
|
pirxpilot_clock
|
train
|
js
|
ec1349d90cf04d318f546e441afc3aaa8ee003ce
|
diff --git a/lib/rspotify/user.rb b/lib/rspotify/user.rb
index <HASH>..<HASH> 100644
--- a/lib/rspotify/user.rb
+++ b/lib/rspotify/user.rb
@@ -116,7 +116,12 @@ module RSpotify
# playlists.first.class #=> RSpotify::Playlist
# playlists.first.name #=> "Movie Soundtrack Masterpieces"
def playlists(limit: 20, offset: 0)
- json = RSpotify.auth_get("users/#{@id}/playlists?limit=#{limit}&offset=#{offset}")
+ url = "users/#{@id}/playlists?limit=#{limit}&offset=#{offset}"
+ if @credentials.present?
+ json = User.oauth_get(@id, url)
+ else
+ json = RSpotify.auth_get(url)
+ end
json['items'].map { |i| Playlist.new i }
end
|
User#playlists support for private playlists
|
guilhermesad_rspotify
|
train
|
rb
|
847143cd60986c6558167a8ad28a778b09330a7c
|
diff --git a/gocd/server.py b/gocd/server.py
index <HASH>..<HASH> 100644
--- a/gocd/server.py
+++ b/gocd/server.py
@@ -21,9 +21,11 @@ class Server(object):
return Pipeline(self, name)
def _add_basic_auth(self):
- auth_handler = urllib2.HTTPBasicAuthHandler()
+ auth_handler = urllib2.HTTPBasicAuthHandler(
+ urllib2.HTTPPasswordMgrWithDefaultRealm()
+ )
auth_handler.add_password(
- realm='Cruise', # This seems to be hard coded.
+ realm=None,
uri=self.host,
user=self.user,
passwd=self.password,
|
Remove hard coded realm and assume any is fine
|
gaqzi_py-gocd
|
train
|
py
|
739204b819e11bd98a1335a2369238fdb65f9bb9
|
diff --git a/harness/reflect.go b/harness/reflect.go
index <HASH>..<HASH> 100644
--- a/harness/reflect.go
+++ b/harness/reflect.go
@@ -4,7 +4,6 @@ package harness
// It catalogs the controllers, their methods, and their arguments.
import (
- "github.com/revel/revel"
"go/ast"
"go/build"
"go/parser"
@@ -14,6 +13,8 @@ import (
"os"
"path/filepath"
"strings"
+
+ "github.com/revel/revel"
)
// SourceInfo is the top-level struct containing all extracted information
@@ -720,8 +721,7 @@ func NewTypeExpr(pkgName string, expr ast.Expr) TypeExpr {
e := NewTypeExpr(pkgName, t.Elt)
return TypeExpr{"[]" + e.Expr, e.PkgName, e.pkgIndex + 2, e.Valid}
default:
- log.Println("Failed to generate name for field.")
- ast.Print(nil, expr)
+ log.Println("Failed to generate name for field. Make sure the field name is valid.")
}
return TypeExpr{Valid: false}
}
|
Fix #<I>
Removed log statement that causes a lot of unncessary output
|
revel_revel
|
train
|
go
|
bc77895124417970dcee97fd8b040bce57016831
|
diff --git a/pycent.py b/pycent.py
index <HASH>..<HASH> 100644
--- a/pycent.py
+++ b/pycent.py
@@ -24,6 +24,8 @@ class pycent:
1.0
"""
+ percent = float(percent)
+ whole = float(whole)
return (percent * whole) / 100
def percentage(self, part: FloatIn, whole: FloatIn, resolution: int=None):
|
Converts to float rather than assuming user inputted float
|
flashmeow_pycent
|
train
|
py
|
b188b33c2907f9c5110101b89e7b490c7417f293
|
diff --git a/db/migrate/11_update_url_and_redirect_url_value.rb b/db/migrate/11_update_url_and_redirect_url_value.rb
index <HASH>..<HASH> 100644
--- a/db/migrate/11_update_url_and_redirect_url_value.rb
+++ b/db/migrate/11_update_url_and_redirect_url_value.rb
@@ -19,7 +19,6 @@ class UpdateUrlAndRedirectUrlValue < ActiveRecord::Migration
@redirect_pages.each do |redirect_page|
redirect_url = redirect_page.url
redirect_page.update_attributes(
- :url => nil,
:redirect_url => redirect_url
) if redirect_page
end
|
do not clear url in redirect pages
|
brandleadership_kuhsaft
|
train
|
rb
|
1498a4691926e7d91aad001d24a083ec05de13d8
|
diff --git a/components/base/base-int/src/main/java/org/torquebox/services/deployers/ServicesDeployer.java b/components/base/base-int/src/main/java/org/torquebox/services/deployers/ServicesDeployer.java
index <HASH>..<HASH> 100644
--- a/components/base/base-int/src/main/java/org/torquebox/services/deployers/ServicesDeployer.java
+++ b/components/base/base-int/src/main/java/org/torquebox/services/deployers/ServicesDeployer.java
@@ -93,7 +93,7 @@ public class ServicesDeployer extends AbstractDeployer {
protected PoolMetaData createRuntimePool(DeploymentUnit unit, int max) {
PoolMetaData pool = AttachmentUtils.getAttachment( unit, POOL_NAME, PoolMetaData.class );
- ;
+
if (pool == null && max > 0) {
pool = new PoolMetaData( POOL_NAME, 1, max );
log.info( "Configured Ruby runtime pool for services: " + pool );
|
Remove empty statement (hanging semicolon) from ServicesDeployer
|
torquebox_torquebox
|
train
|
java
|
6a138caa8a4d0b6aea130e96490b1a88ab0ff24e
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,6 @@ REQUIRES = [
'pyarrow>=0.14.1,<1.0',
'google-cloud-bigquery>=1.19.0,<2.0',
'geojson>=2.5.0,<3.0',
- 'matplotlib>=2.0.2',
# 'Rtree>=0.8.3,<1.0'
]
|
Remove matplotlib as a dep
|
CartoDB_cartoframes
|
train
|
py
|
439b9b840f5896b5521b0ff1200d7bd97aebd2ba
|
diff --git a/src/hamster/widgets/facttree.py b/src/hamster/widgets/facttree.py
index <HASH>..<HASH> 100644
--- a/src/hamster/widgets/facttree.py
+++ b/src/hamster/widgets/facttree.py
@@ -78,7 +78,7 @@ class FactTree(gtk.TreeView):
self.connect("row-activated", self._on_row_activated)
self.connect("button-release-event", self._on_button_release_event)
- self.connect("key-press-event", self._on_key_pressed)
+ self.connect("key-release-event", self._on_key_released)
self.connect("configure-event", lambda *args: self.columns_autosize())
self.show()
@@ -269,10 +269,9 @@ class FactTree(gtk.TreeView):
return True
- def _on_key_pressed(self, tree, event):
- # capture ctrl+e and pretend that user click on edit
- if (event.keyval == gtk.keysyms.e \
- and event.state & gtk.gdk.CONTROL_MASK):
+ def _on_key_released(self, tree, event):
+ # capture e keypress and pretend that user click on edit
+ if (event.keyval == gtk.keysyms.e):
self.emit("edit-clicked", self.get_selected_fact())
return True
|
listen on any "e" keypress, not just ctrl+e one. also listen on key release not press to avoid the dropdown on popup
|
projecthamster_hamster
|
train
|
py
|
40a7a833e4c4b8247885c998cd26d739baedb2fa
|
diff --git a/lib/staticTransform.js b/lib/staticTransform.js
index <HASH>..<HASH> 100644
--- a/lib/staticTransform.js
+++ b/lib/staticTransform.js
@@ -1,4 +1,4 @@
-/*jshint node:true strict:false*/
+/*jshint node:true strict:false sub:true*/
// Dependencies
var parse = require('../node_modules/connect/lib/utils').parseUrl,
fs = require('fs'),
@@ -95,7 +95,7 @@ module.exports = function (options) {
writeOut(200, res, out, headers, options);
});
});
- })
+ });
}
};
};
@@ -112,4 +112,4 @@ function writeOut(code, res, out, headers, options) {
} else {
res.end();
}
-};
+}
|
Updated lib/staticTransform.js to pass JSHint.
|
knpwrs_connect-static-transform
|
train
|
js
|
d00ff7cb58f7c68d70e1342b1b6971c8991c5c08
|
diff --git a/agent/proxy/manager.go b/agent/proxy/manager.go
index <HASH>..<HASH> 100644
--- a/agent/proxy/manager.go
+++ b/agent/proxy/manager.go
@@ -335,13 +335,6 @@ func (m *Manager) newProxy(mp *local.ManagedProxy) (Proxy, error) {
return nil, fmt.Errorf("internal error: nil *local.ManagedProxy or Proxy field")
}
- // Attempt to create the log directory now that we have a proxy
- if m.LogDir != "" {
- if err := os.MkdirAll(m.LogDir, 0700); err != nil {
- m.Logger.Printf("[ERROR] agent/proxy: failed to create log directory: %s", err)
- }
- }
-
p := mp.Proxy
switch p.ExecMode {
case structs.ProxyExecModeDaemon:
|
agent/proxy: don't create the directory in newProxy
|
hashicorp_consul
|
train
|
go
|
f95efffc2568adc76f8d2de02f9b4b1d92337fb7
|
diff --git a/lib/temple/engine.rb b/lib/temple/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/temple/engine.rb
+++ b/lib/temple/engine.rb
@@ -64,7 +64,7 @@ module Temple
filter.new(ImmutableHash.new(local_options, filtered_options))
when UnboundMethod
filter = filter.bind(self)
- filter.arity == 0 ? filter.call : filter
+ filter.arity == 1 ? filter : filter.call
else
filter
end
diff --git a/lib/temple/mixins/engine_dsl.rb b/lib/temple/mixins/engine_dsl.rb
index <HASH>..<HASH> 100644
--- a/lib/temple/mixins/engine_dsl.rb
+++ b/lib/temple/mixins/engine_dsl.rb
@@ -87,7 +87,7 @@ module Temple
end
def wildcard(name, &block)
- raise(ArgumentError, 'Block must have arity 0') unless block.arity == 0
+ raise(ArgumentError, 'Block must have arity 0') unless block.arity <= 0
chain << [name, define_chain_method("WILDCARD #{name}", block)]
chain_modified!
end
|
fix arity checks for wildcards
|
judofyr_temple
|
train
|
rb,rb
|
ca095a5059550bf070078c68b382151d4a8f93e7
|
diff --git a/lib/scorpio/schema_object_base.rb b/lib/scorpio/schema_object_base.rb
index <HASH>..<HASH> 100644
--- a/lib/scorpio/schema_object_base.rb
+++ b/lib/scorpio/schema_object_base.rb
@@ -15,13 +15,13 @@ module Scorpio
attr_reader :object
def fully_validate
- ::JSON::Validator.fully_validate(module_schema_node.document, object.content, fragment: module_schema_node.fragment)
+ module_schema.fully_validate(object)
end
def validate
- ::JSON::Validator.validate(module_schema_node.document, object.content, fragment: module_schema_node.fragment)
+ module_schema.validate(object)
end
def validate!
- ::JSON::Validator.validate!(module_schema_node.document, object.content, fragment: module_schema_node.fragment)
+ module_schema.validate!(object)
end
end
|
SchemaObjectBase#validate and friends delegate to the schema's helpers
|
notEthan_jsi
|
train
|
rb
|
8e3bc00025f3b9934e529efd0c4d6a66a98444be
|
diff --git a/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java b/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java
+++ b/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java
@@ -22,8 +22,8 @@ public class KeyboardUtil {
this.decorView = act.getWindow().getDecorView();
this.contentView = contentView;
- //only required on newer android versions. it was working on API level 10
- if (Build.VERSION.SDK_INT > 10) {
+ //only required on newer android versions. it was working on API level 19
+ if (Build.VERSION.SDK_INT >= 19) {
decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener);
}
}
|
* the KeyboardUtil is only required for api >= <I>
|
mikepenz_MaterialDrawer
|
train
|
java
|
b398e2b1b0b1e423c6b217a0fd07ade113c062d6
|
diff --git a/testing/stubs.go b/testing/stubs.go
index <HASH>..<HASH> 100644
--- a/testing/stubs.go
+++ b/testing/stubs.go
@@ -106,6 +106,8 @@ func TestDecisionInterceptor(testID string, stubbedWorkflows, stubbedShortWorkfl
}
case swf.DecisionTypeScheduleActivityTask:
d.ScheduleActivityTaskDecisionAttributes.TaskList = &swf.TaskList{Name: S(*d.ScheduleActivityTaskDecisionAttributes.TaskList.Name + testID)}
+ case swf.DecisionTypeContinueAsNewWorkflowExecution:
+ d.ContinueAsNewWorkflowExecutionDecisionAttributes.TaskList = &swf.TaskList{Name: S(testID)}
}
}
},
|
swap in the test task list in test decision interceptor handling of continuations
|
sclasen_swfsm
|
train
|
go
|
4b0466a5b3d9160863872159cd8ba12526f9ef4a
|
diff --git a/src/Api/Api.php b/src/Api/Api.php
index <HASH>..<HASH> 100644
--- a/src/Api/Api.php
+++ b/src/Api/Api.php
@@ -189,7 +189,9 @@ abstract class Api implements ApiInterface
$request = $request->withHeader('Idempotency-Key', $idempotencykey);
}
- $request = $request->withHeader('Stripe-Account', $config->getAccountId());
+ if ($accountId = $config->getAccountId()) {
+ $request = $request->withHeader('Stripe-Account', $accountId);
+ }
$request = $request->withHeader('Stripe-Version', $config->getApiVersion());
|
fix: Issue with account id being invalid without being set.
Fixes: #<I>
|
cartalyst_stripe
|
train
|
php
|
eff09ef450aae6751ce45dcbce117d46fdb4f944
|
diff --git a/test/mocha/testUtils.js b/test/mocha/testUtils.js
index <HASH>..<HASH> 100644
--- a/test/mocha/testUtils.js
+++ b/test/mocha/testUtils.js
@@ -13,16 +13,15 @@
define([
"api",
"chai",
- "sinon-chai",
- "underscore"
+ "sinon-chai"
],
-function(FauxtonAPI,chai, sinonChai) {
+function(FauxtonAPI, chai, sinonChai) {
chai.use(sinonChai);
var ViewSandbox = function () {
this.initialize();
};
-
+
_.extend(ViewSandbox.prototype, {
initialize: function () {
this.$el = $('<div style="display:none"></div>').appendTo('body');
|
Cleanup: testUtils.js - underscore is not needed
|
apache_couchdb-fauxton
|
train
|
js
|
cdc8797eac1d0a8608566795fe91e9c2d9758499
|
diff --git a/src/commands/view/ComponentExit.js b/src/commands/view/ComponentExit.js
index <HASH>..<HASH> 100644
--- a/src/commands/view/ComponentExit.js
+++ b/src/commands/view/ComponentExit.js
@@ -1,6 +1,6 @@
module.exports = {
- run(ed) {
- if (!ed.Canvas.hasFocus()) return;
+ run(ed, snd, opts = {}) {
+ if (!ed.Canvas.hasFocus() && !opts.force) return;
const toSelect = [];
ed.getSelectedAll().forEach(component => {
diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js
index <HASH>..<HASH> 100644
--- a/src/dom_components/model/Component.js
+++ b/src/dom_components/model/Component.js
@@ -611,7 +611,7 @@ const Component = Backbone.Model.extend(Styleable).extend(
if (model.collection) {
tb.push({
attributes: { class: 'fa fa-arrow-up' },
- command: 'core:component-exit'
+ command: ed => ed.runCommand('core:component-exit', { force: 1 })
});
}
if (model.get('draggable')) {
|
Force component exit command in the toolbar
|
artf_grapesjs
|
train
|
js,js
|
642e5f8b076729b0a3f69be05c0907d31d595d41
|
diff --git a/modules/metarefresh/hooks/hook_cron.php b/modules/metarefresh/hooks/hook_cron.php
index <HASH>..<HASH> 100644
--- a/modules/metarefresh/hooks/hook_cron.php
+++ b/modules/metarefresh/hooks/hook_cron.php
@@ -13,9 +13,14 @@ function metarefresh_hook_cron(&$croninfo) {
try {
$config = SimpleSAML_Configuration::getInstance();
- $mconfig = SimpleSAML_Configuration::getConfig('config-metarefresh.php');
+ try {
+ $mconfig = SimpleSAML_Configuration::getConfig('config-metarefresh.php');
+ } catch (Exception $e) {
+ SimpleSAML_Logger::info('cron [metarefresh]: Could not open configuration file for module - skipping.');
+ return;
+ }
- $sets = $mconfig->getConfigList('sets');
+ $sets = $mconfig->getConfigList('sets', array());
foreach ($sets AS $setkey => $set) {
// Only process sets where cron matches the current cron tag.
|
metarefresh: Avoid warning from cron when missing configuration file.
|
simplesamlphp_saml2
|
train
|
php
|
b7f74f1e42fa14b99815b64171805723fcc1d13c
|
diff --git a/tchannel/tornado/tchannel.py b/tchannel/tornado/tchannel.py
index <HASH>..<HASH> 100644
--- a/tchannel/tornado/tchannel.py
+++ b/tchannel/tornado/tchannel.py
@@ -464,7 +464,7 @@ class TChannel(object):
else:
scheme = "raw"
scheme = scheme.lower()
- if scheme == 'thrift':
+ if scheme in ('thrift', b'thrift'):
decorator = partial(self._register_thrift, endpoint, **kwargs)
else:
decorator = partial(
|
Allowing bytestrings in schema
|
uber_tchannel-python
|
train
|
py
|
0a5534506023e6f1d19698daf3e424c52836b30a
|
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1410,8 +1410,22 @@ describe('Page', function() {
expect(await page.evaluate(() => 'ontouchstart' in window)).toBe(false);
await page.setViewport(iPhone.viewport);
expect(await page.evaluate(() => 'ontouchstart' in window)).toBe(true);
+ expect(await page.evaluate(dispatchTouch)).toBe('Recieved touch');
await page.setViewport({width: 100, height: 100});
expect(await page.evaluate(() => 'ontouchstart' in window)).toBe(false);
+
+ function dispatchTouch() {
+ let fulfill;
+ let promise = new Promise(x => fulfill = x);
+ window.ontouchstart = function(e) {
+ fulfill('Recieved touch');
+ };
+ window.dispatchEvent(new Event('touchstart'));
+
+ fulfill('Did not recieve touch');
+
+ return promise;
+ }
}));
it('should support landscape emulation', SX(async function() {
await page.goto(PREFIX + '/mobile.html');
|
Test touch emulation more completely (#<I>)
|
GoogleChrome_puppeteer
|
train
|
js
|
7e7f0a5ef3b70a5f79ab7534228769a197035efc
|
diff --git a/packages/ember-routing/lib/system/router.js b/packages/ember-routing/lib/system/router.js
index <HASH>..<HASH> 100644
--- a/packages/ember-routing/lib/system/router.js
+++ b/packages/ember-routing/lib/system/router.js
@@ -119,8 +119,6 @@ const EmberRouter = EmberObject.extend(Evented, {
let owner = getOwner(this);
let router = this;
- options.enableLoadingSubstates = !!moduleBasedResolver;
-
options.resolveRouteMap = function(name) {
return owner._lookupFactory('route-map:' + name);
};
|
Router.map variable declared twice with same value
Minor, just noticed this while getting ready to send another PR to improve `Router.map`
|
emberjs_ember.js
|
train
|
js
|
e1a35bb2679c7118da605c2d820544cfb84ddc9d
|
diff --git a/host.go b/host.go
index <HASH>..<HASH> 100644
--- a/host.go
+++ b/host.go
@@ -643,12 +643,14 @@ func (h *Host) Kill() error {
}
func (h *Host) Restart() error {
- if err := h.Stop(); err != nil {
- return err
- }
+ if h.MachineInState(state.Running)() {
+ if err := h.Stop(); err != nil {
+ return err
+ }
- if err := utils.WaitFor(h.MachineInState(state.Stopped)); err != nil {
- return err
+ if err := utils.WaitFor(h.MachineInState(state.Stopped)); err != nil {
+ return err
+ }
}
if err := h.Start(); err != nil {
|
vbox: fix issue where could not restart a stopped instance
|
docker_machine
|
train
|
go
|
cafb3fc58525e24ee2d2af1c5fa5c77deaa1485b
|
diff --git a/src/renderer.js b/src/renderer.js
index <HASH>..<HASH> 100644
--- a/src/renderer.js
+++ b/src/renderer.js
@@ -49,7 +49,8 @@ vgl.renderer = function() {
m_y = 0,
m_width = 0,
m_height = 0,
- m_resizable = true;
+ m_resizable = true,
+ m_resetScene = true;
m_camera.addChild(m_sceneRoot);
@@ -164,6 +165,11 @@ vgl.renderer = function() {
renSt = new vgl.renderState();
children = m_sceneRoot.children();
+ if (children.length > 0 && m_resetScene) {
+ this.resetCamera();
+ m_resetScene = false;
+ }
+
for ( i = 0; i < children.length; ++i) {
actor = children[i];
actor.computeBounds();
@@ -411,6 +417,11 @@ vgl.renderer = function() {
this.removeActor = function(actor) {
if (m_sceneRoot.children().indexOf(actor) !== -1) {
m_sceneRoot.removeChild(actor);
+
+ if (m_sceneRoot.children().length === 0) {
+ m_resetScene = true;
+ }
+
this.modified();
return true;
}
|
Reset camera when a first drawble is added or last drawable is removed
|
OpenGeoscience_vgl
|
train
|
js
|
9d707017b12a7569fc960a862db6c91082a1d319
|
diff --git a/core/src/main/java/lucee/runtime/exp/DatabaseException.java b/core/src/main/java/lucee/runtime/exp/DatabaseException.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/lucee/runtime/exp/DatabaseException.java
+++ b/core/src/main/java/lucee/runtime/exp/DatabaseException.java
@@ -49,7 +49,7 @@ public final class DatabaseException extends PageExceptionImpl {
set(sqle);
set(dc);
- initCause( sqle.getCause() );
+ initCause( sqle );
}
public DatabaseException(String message, String detail, SQL sql, DatasourceConnection dc) {
|
Update pull per Micha's recommendation
|
lucee_Lucee
|
train
|
java
|
f26f766afa141b5b0175f2c1d7af3929e3957a5a
|
diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -103,13 +103,14 @@ gulp.task('release-clean', async () => {
});
gulp.task('release-copy', ['build', 'release-clean'], () => (
- gulp.src('build/**')
+ gulp.src(['build/**', 'README.md', 'LICENSE'])
.pipe(gulp.dest('release'))
));
gulp.task('release', ['release-copy'], async () => {
const packageInfo = JSON.parse(await fs.readFile('package.json'));
delete packageInfo.scripts;
+ delete packageInfo.jest;
const version = await getVersionFromTag();
if (version) {
packageInfo.version = version;
|
update release script to add README to package (#<I>)
|
ringcentral_ringcentral-js-widgets
|
train
|
js
|
d6dee81274f7c94cc971ef6360762abc0f3756a5
|
diff --git a/upload/install/controller/upgrade/upgrade_8.php b/upload/install/controller/upgrade/upgrade_8.php
index <HASH>..<HASH> 100644
--- a/upload/install/controller/upgrade/upgrade_8.php
+++ b/upload/install/controller/upgrade/upgrade_8.php
@@ -202,6 +202,16 @@ class Upgrade8 extends \Opencart\System\Engine\Controller {
if ($query->num_rows) {
$this->db->query("UPDATE `" . DB_PREFIX . "api` SET `name` = `username` WHERE `username` IS NULL or `username` = ''");
}
+
+ // Cart - Subscriptions
+ $query = $this->db->query("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . DB_DATABASE . "' AND TABLE_NAME = '" . DB_PREFIX . "cart' AND COLUMN_NAME = 'subscription_plan_id'");
+
+ if (!$query->num_rows) {
+ $this->db->query("TRUNCATE TABLE `" . DB_PREFIX . "cart`");
+
+ $this->db->query("ALTER TABLE `" . DB_PREFIX . "cart` DROP COLUMN `recurring_id`");
+ $this->db->query("ALTER TABLE `" . DB_PREFIX . "cart` ADD COLUMN `subscription_plan_id`");
+ }
// Drop Fields
$remove = [];
|
Added cart subscription_plan_id lookup
|
opencart_opencart
|
train
|
php
|
ab6b35be5efbc26837b0d6fb2de0795a40cd1461
|
diff --git a/Grid/Grid.php b/Grid/Grid.php
index <HASH>..<HASH> 100644
--- a/Grid/Grid.php
+++ b/Grid/Grid.php
@@ -670,7 +670,7 @@ class Grid
protected function set($key, $data)
{
// Only the filters values are removed from the session
- if (key_exists($key, $this->sessionData) && is_array($data) && $data['from'] === '') {
+ if (key_exists($key, $this->sessionData) && isset($data['from']) && $data['from'] === '') {
unset($this->sessionData[$key]);
} elseif ($data !== null) {
$this->sessionData[$key] = $data;
|
Fix bug - Write data to the session when a null operator is selected
|
APY_APYDataGridBundle
|
train
|
php
|
34b1e89cdce4a4551020330bfe1a50881b684f8e
|
diff --git a/bin/PCoA.py b/bin/PCoA.py
index <HASH>..<HASH> 100755
--- a/bin/PCoA.py
+++ b/bin/PCoA.py
@@ -1,11 +1,4 @@
-#!usr/bin/env python
-"""
-Author: Akshay Paropkari
-
-Abstract: Python file for personal testing and debugging.
-"""
#!/usr/bin/env python
-# coding: utf-8
import argparse
from collections import OrderedDict
import itertools
|
Updated PCoA .py
Removed irrelevant information from final script.
|
smdabdoub_phylotoast
|
train
|
py
|
d338dea3425dabfaaec1566690aa98e9e7d2db7e
|
diff --git a/src/Http/Response/ProblemResponse.php b/src/Http/Response/ProblemResponse.php
index <HASH>..<HASH> 100644
--- a/src/Http/Response/ProblemResponse.php
+++ b/src/Http/Response/ProblemResponse.php
@@ -44,7 +44,7 @@ class ProblemResponse extends AbstractResponse
$body->title = substr($this->statusCode, 4);
$this->body = json_encode($body);
- if ($body === null) {
+ if ($this->body === null) {
$error = json_last_error_msg();
throw new RuntimeException("JSON encoding has failed ({$error})");
|
Fix a bug when errors in ProblemResponse body encoding was not caught correctly
|
Lou117_core
|
train
|
php
|
356fbb04f1b12a97f77886ae297000d10c69c532
|
diff --git a/src/js/client/ajaxCapable.js b/src/js/client/ajaxCapable.js
index <HASH>..<HASH> 100644
--- a/src/js/client/ajaxCapable.js
+++ b/src/js/client/ajaxCapable.js
@@ -27,6 +27,8 @@ For the second use case, you can start with the `templateFormControl` component.
If you need to do both (or each multiple times), you should create a parent component that uses as many individual
`templateRequestAndRender` and `templateFormControl` components as needed.
+TODO: Reconcile this with the larger migration to dataSources.
+
*/
/* global fluid, jQuery */
(function ($) {
|
GPII-<I>: Added a note about the long-term need to convert to a data source.
|
GPII_gpii-handlebars
|
train
|
js
|
b2c24763babce537a154dc9870b81029f1abf6dc
|
diff --git a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java
+++ b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java
@@ -1,5 +1,5 @@
//
-// $Id: SpotSceneDirector.java,v 1.25 2003/03/31 22:54:09 mdb Exp $
+// $Id: SpotSceneDirector.java,v 1.26 2003/04/03 22:16:51 mdb Exp $
package com.threerings.whirled.spot.client;
@@ -301,6 +301,9 @@ public class SpotSceneDirector extends BasicDirector
return;
}
+ Log.info("Cluster change? " +
+ (_clobj == null ? -1 : _clobj.getOid()) + " -> " + cloid);
+
// clear out any old cluster object
clearCluster();
|
Logging to help debug repeated subscription to cluster objects.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
|
threerings_narya
|
train
|
java
|
b40b3eb0d5f4aea51ea020a05fc41c5393cef60f
|
diff --git a/provider/openstack/legacy_networking.go b/provider/openstack/legacy_networking.go
index <HASH>..<HASH> 100644
--- a/provider/openstack/legacy_networking.go
+++ b/provider/openstack/legacy_networking.go
@@ -70,7 +70,9 @@ func (n *LegacyNovaNetworking) ResolveNetwork(name string, external bool) (strin
return "", err
}
for _, network := range networks {
- if network.Label == name {
+ // Assuming a positive match on "" makes this behave the same as the
+ // server-side filtering in Neutron networking.
+ if name == "" || network.Label == name {
networkIds = append(networkIds, network.Id)
}
}
|
Forces positive match on "" for Nova network resolution.
|
juju_juju
|
train
|
go
|
2a8c3cd52ddf7aa2fdf842dbb3cadc95a294743f
|
diff --git a/librosa/core/time_frequency.py b/librosa/core/time_frequency.py
index <HASH>..<HASH> 100644
--- a/librosa/core/time_frequency.py
+++ b/librosa/core/time_frequency.py
@@ -756,7 +756,7 @@ def octs_to_hz(octs, A440=440.0):
def fft_frequencies(sr=22050, n_fft=2048):
- '''Alternative implementation of `np.fft.fftfreqs`
+ '''Alternative implementation of `np.fft.fftfreq`
Parameters
----------
|
Fix a typo in time_frequency.py
Can't find a `np.fft.fftfreqs` function - maybe this should be `np.fft.fftfreq`?
|
librosa_librosa
|
train
|
py
|
91e34682585ed5e76860dc097066c2073d7cc787
|
diff --git a/src/programs/Migrate.php b/src/programs/Migrate.php
index <HASH>..<HASH> 100644
--- a/src/programs/Migrate.php
+++ b/src/programs/Migrate.php
@@ -326,8 +326,6 @@ class Migrate implements iCommand
self::largeHttpGetRequestsToFile(self::$remoteUrl . $uri . '?license=' . self::$license, $importManifestFilePath);
- Background::executeAndCheckStatus("[[ \"$( cat '$importManifestFilePath' | grep -o 'Dump completed' | wc -l )\" == *\"1\"* ]] && exit 0 || exit 16");
-
self::showStatus(++$done, $manifestLineCount);
$manifestArray[$uri] = $importManifestFilePath;
@@ -583,6 +581,8 @@ class Migrate implements iCommand
if (self::$MySQLDataDump) {
+ Background::executeAndCheckStatus("[[ \"$( cat '$file' | grep -o 'Dump completed' | wc -l )\" == *\"1\"* ]] && exit 0 || exit 16");
+
ColorCode::colorCode("Doing an update to Mysql, do not exit!!!\nfile://$file",
iColorCode::BACKGROUND_YELLOW);
|
updating migrations to only check for dump complete count in sql
|
RichardTMiles_CarbonPHP
|
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.