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 |
|---|---|---|---|---|---|
47f7ea4a935a6a9ef760c88609523bafbafa5d18 | diff --git a/Listener/TranslationListener.php b/Listener/TranslationListener.php
index <HASH>..<HASH> 100644
--- a/Listener/TranslationListener.php
+++ b/Listener/TranslationListener.php
@@ -35,9 +35,9 @@ class TranslationListener extends BaseTranslationListener
*/
public function onKernelRequest(GetResponseEvent $event)
{
- $session = $event->getRequest()->getSession();
- if (null !== $session) {
- $this->setTranslatableLocale($session->getLocale());
+ $request = $event->getRequest();
+ if (null !== $request) {
+ $this->setTranslatableLocale($request->getLocale());
}
}
} | adapted TranslationListener to symfony's locale movement from session to request | stof_StofDoctrineExtensionsBundle | train | php |
144feb809ce3d461aab0dfd85242dc2fe62f5271 | diff --git a/porespy/export/__funcs__.py b/porespy/export/__funcs__.py
index <HASH>..<HASH> 100644
--- a/porespy/export/__funcs__.py
+++ b/porespy/export/__funcs__.py
@@ -54,10 +54,10 @@ def to_vtk(im, path='./voxvtk', divide=False, downsample=False, voxel_size=1, vo
elif downsample == True:
im = spim.interpolation.zoom(im, zoom=0.5, order=0)
bp.imageToVTK(path, cellData={'im': np.ascontiguousarray(im)},
- spacing=(vs, vs, vs))
+ spacing=(2*vs, 2*vs, 2*vs))
else:
bp.imageToVTK(path, cellData={'im': np.ascontiguousarray(im)},
- spacing=(2*vs, 2*vs, 2*vs))
+ spacing=(vs, vs, vs))
def to_palabos(im, filename, solid=0):
r""" | fixed spacing issue in vtk export | PMEAL_porespy | train | py |
2ec6c7ff031630d14f1f884d014eb6d854ac562a | diff --git a/kernel/content/copy.php b/kernel/content/copy.php
index <HASH>..<HASH> 100644
--- a/kernel/content/copy.php
+++ b/kernel/content/copy.php
@@ -145,7 +145,6 @@ function browse( &$Module, &$object )
{
$ignoreNodesSelect[] = $element['node_id'];
$ignoreNodesClick[] = $element['node_id'];
- $ignoreNodesSelect[] = $element['parent_node_id'];
}
$ignoreNodesSelect = array_unique( $ignoreNodesSelect );
$ignoreNodesClick = array_unique( $ignoreNodesClick ); | - Fixed bug: unable to put a copy of object into the same location.
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I> | ezsystems_ezpublish-legacy | train | php |
d026bb7c963f992e378ade5e0586242f506c62c7 | diff --git a/lib/puppet/provider/package/pkgutil.rb b/lib/puppet/provider/package/pkgutil.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider/package/pkgutil.rb
+++ b/lib/puppet/provider/package/pkgutil.rb
@@ -37,6 +37,9 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
command = ["-c"]
if hash[:justme]
+ # The --single option speeds up the execution, because it queries
+ # the package managament system for one package only.
+ command << ["--single"]
command << hash[:justme]
end | pkgutil provider: Using the --single option which speeds up execution. | puppetlabs_puppet | train | rb |
480ff91e59c6f5c21e03c5d767dd32f2c3325ad7 | diff --git a/packages/cozy-client/src/CozyClient.js b/packages/cozy-client/src/CozyClient.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-client/src/CozyClient.js
+++ b/packages/cozy-client/src/CozyClient.js
@@ -278,8 +278,7 @@ export default class CozyClient {
const definitions = pickBy(
mapValues(assocByName, assoc =>
this.queryDocumentAssociation(document, assoc)
- ),
- x => x
+ )
)
const requests = mapValues(definitions, definition => | refactor: pickBy's default predicate is identity | cozy_cozy-client | train | js |
60e6dff02cecf2703da30da2fe2b4575a9505178 | diff --git a/tarbell/settings.py b/tarbell/settings.py
index <HASH>..<HASH> 100644
--- a/tarbell/settings.py
+++ b/tarbell/settings.py
@@ -51,5 +51,5 @@ class Settings:
Save settings.
"""
with open(self.path, "w") as f:
- self.config["project_templates"] = filter(lambda template: template.get("url"), self.config["project_templates"])
+ self.config["project_templates"] = list(filter(lambda template: template.get("url"), self.config["project_templates"]))
yaml.dump(self.config, f, default_flow_style=False) | Account for `filter` returning an iterable in Py3
Turns out PyYAML doesn't serialize a `filter` iterable so well. | tarbell-project_tarbell | train | py |
0f58958144416fd21f7bf26f0bb1cc5b3715a2f7 | diff --git a/aws/structure.go b/aws/structure.go
index <HASH>..<HASH> 100644
--- a/aws/structure.go
+++ b/aws/structure.go
@@ -1206,7 +1206,7 @@ func expandESClusterConfig(m map[string]interface{}) *elasticsearch.Elasticsearc
}
if v, ok := m["zone_awareness_count"]; ok {
- config.ZoneAwarenessConfig.AvailabilityZoneCount = aws.Int64(v.(int64))
+ config.ZoneAwarenessConfig = &elasticsearch.ZoneAwarenessConfig{AvailabilityZoneCount: aws.Int64(int64(v.(int)))}
}
return &config | assign a ZoneAwarenessConfig struct to the ZAC parameter with AZ Count | terraform-providers_terraform-provider-aws | train | go |
7f84fb7716855d0a02a1f6720ad2b4e3a168bae2 | diff --git a/src/main/java/com/google/cloud/genomics/utils/GenomicsUtils.java b/src/main/java/com/google/cloud/genomics/utils/GenomicsUtils.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/google/cloud/genomics/utils/GenomicsUtils.java
+++ b/src/main/java/com/google/cloud/genomics/utils/GenomicsUtils.java
@@ -90,10 +90,14 @@ public class GenomicsUtils {
public static List<CoverageBucket> getCoverageBuckets(String readGroupSetId, GenomicsFactory.OfflineAuth auth)
throws IOException, GeneralSecurityException {
Genomics genomics = auth.getGenomics(auth.getDefaultFactory());
- // Not using a Paginator here because requests of this form return one result per
- // reference name, so therefore many fewer than the default page size.
ListCoverageBucketsResponse response =
genomics.readgroupsets().coveragebuckets().list(readGroupSetId).execute();
+ // Requests of this form return one result per reference name, so therefore many fewer than
+ // the default page size, but verify that the assumption holds true.
+ if(null != response.getNextPageToken()) {
+ throw new IllegalArgumentException("Read group set " + readGroupSetId
+ + " has more Coverage Buckets than the default page size for the CoverageBuckets list operation.");
+ }
return response.getCoverageBuckets();
} | Validate coverage bucket response size assumption. | googlegenomics_utils-java | train | java |
0bdf328dd27694763b2beb7fe12083aae8330b31 | diff --git a/lib/html-to-text.js b/lib/html-to-text.js
index <HASH>..<HASH> 100644
--- a/lib/html-to-text.js
+++ b/lib/html-to-text.js
@@ -56,7 +56,7 @@ function filterBody(dom, options) {
if ((splitTag.classes.every(function (val) { return documentClasses.indexOf(val) >= 0 })) &&
(splitTag.ids.every(function (val) { return documentIds.indexOf(val) >= 0 }))) {
- result = elem.children;
+ result = [elem];
return;
}
} | Return the base element rather than the base element's children so that fancy table layouts work as expected. | werk85_node-html-to-text | train | js |
951cb08aa52a0048f95ec77d76ca2c9af955cb02 | diff --git a/src/samples/java/ex/COM_Sample.java b/src/samples/java/ex/COM_Sample.java
index <HASH>..<HASH> 100755
--- a/src/samples/java/ex/COM_Sample.java
+++ b/src/samples/java/ex/COM_Sample.java
@@ -1,5 +1,6 @@
package ex;
+import java.io.ByteArrayOutputStream;
import java.util.HashSet;
import java.util.Set;
@@ -57,6 +58,14 @@ public class COM_Sample {
}
}
+class OS357 extends ByteArrayOutputStream {
+
+ @Override
+ public void close() {
+ // removes throws clause
+ }
+}
+
interface Inf {
void m1(); | add sample of COM where throws clause is removed for #<I> | mebigfatguy_fb-contrib | train | java |
630f51e24eea9a3ba3f80cd7e80e60d4d581a7e1 | diff --git a/docker_daemon/check.py b/docker_daemon/check.py
index <HASH>..<HASH> 100644
--- a/docker_daemon/check.py
+++ b/docker_daemon/check.py
@@ -686,6 +686,8 @@ class DockerDaemon(AgentCheck):
cgroup_stat_file_failures += 1
if cgroup_stat_file_failures >= len(CGROUP_METRICS):
self.warning("Couldn't find the cgroup files. Skipping the CGROUP_METRICS for now.")
+ except IOError as e:
+ self.log.debug("Cannot read cgroup file, container likely raced to finish : %s", e)
else:
stats = self._parse_cgroup_file(stat_file)
if stats: | catch exception when container exits in the middle of a check run | DataDog_integrations-core | train | py |
e202aecf10dc19f49da7c66c67c04ccb96bde45d | diff --git a/src/shared/js/ch.Popover.js b/src/shared/js/ch.Popover.js
index <HASH>..<HASH> 100644
--- a/src/shared/js/ch.Popover.js
+++ b/src/shared/js/ch.Popover.js
@@ -401,6 +401,7 @@
timeOut,
events;
+
function hide(event) {
if (event.target !== that._el && event.target !== that.$container[0]) {
that.hide(); | #<I> Move private functions inside the closable scope. | mercadolibre_chico | train | js |
9dde9fdf3212e865d5dadbad99014645f76a2fe4 | diff --git a/src/gimpy/graph.py b/src/gimpy/graph.py
index <HASH>..<HASH> 100755
--- a/src/gimpy/graph.py
+++ b/src/gimpy/graph.py
@@ -1138,7 +1138,7 @@ class Graph(object):
neighbor_node.set_attr('depth', -priority)
else:
distance = self.get_node(current).get_attr('distance') + 1
- if (algo == 'UnweightedSPT' or algo == 'BFS' and
+ if ((algo == 'UnweightedSPT' or algo == 'BFS') and
neighbor_node.get_attr('distance') is not None):
return
neighbor_node.set_attr('distance', distance) | Fixing small bug in preflow push | coin-or_GiMPy | train | py |
59feb003412950e7872872870979d3b4629bf986 | diff --git a/packages/@ember/-internals/glimmer/tests/integration/custom-modifier-manager-test.js b/packages/@ember/-internals/glimmer/tests/integration/custom-modifier-manager-test.js
index <HASH>..<HASH> 100644
--- a/packages/@ember/-internals/glimmer/tests/integration/custom-modifier-manager-test.js
+++ b/packages/@ember/-internals/glimmer/tests/integration/custom-modifier-manager-test.js
@@ -178,3 +178,38 @@ moduleFor(
}
}
);
+
+moduleFor(
+ 'Rendering test: non-interactive custom modifiers',
+ class extends RenderingTestCase {
+ getBootOptions() {
+ return { isInteractive: false };
+ }
+
+ [`@test doesn't trigger lifecycle hooks when non-interactive`](assert) {
+ let ModifierClass = setModifierManager(
+ owner => {
+ return new CustomModifierManager(owner);
+ },
+ EmberObject.extend({
+ didInsertElement() {
+ assert.ok(false);
+ },
+ didUpdate() {
+ assert.ok(false);
+ },
+ willDestroyElement() {
+ assert.ok(false);
+ },
+ })
+ );
+
+ this.registerModifier('foo-bar', ModifierClass);
+
+ this.render('<h1 {{foo-bar baz}}>hello world</h1>');
+ runTask(() => this.context.set('baz', 'Hello'));
+
+ this.assertHTML('<h1>hello world</h1>');
+ }
+ }
+); | Add test for non-interactive custom modifier lifecycle hooks
(cherry picked from commit ff<I>cf<I>a<I>c<I>f<I>cef2d<I>d<I>) | emberjs_ember.js | train | js |
214d32b73b9fc9362bbb62e3e80671081f42e1d4 | diff --git a/src/marshalers.php b/src/marshalers.php
index <HASH>..<HASH> 100644
--- a/src/marshalers.php
+++ b/src/marshalers.php
@@ -123,7 +123,7 @@ function map($marshaler)
*/
function collection($acc, $marshalers)
{
- return function($data) use ($acc, $marshalers, $skip_null) {
+ return function($data) use ($acc, $marshalers) {
list($get, $has) = $acc;
$marshaled = [];
foreach ($marshalers as $key => $marshaler) { | fixing minor bug in collection marshaler | krakphp_marshal | train | php |
ed9d3e9fae6a71a6d3f2045e8ea093cfc370adb5 | diff --git a/src/Renderers/ErrorPopupRenderer.php b/src/Renderers/ErrorPopupRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Renderers/ErrorPopupRenderer.php
+++ b/src/Renderers/ErrorPopupRenderer.php
@@ -45,7 +45,7 @@ class ErrorPopupRenderer
if ($title)
echo "<h3>$title</h3>";
echo "<div>" . ucfirst (ErrorHandler::processMessage ($exception->getMessage ())) . "</div>";
- if (isset ($exception->info)) echo "<div class='__info'>$exception->info</div>";
+ if (!empty ($exception->info)) echo "<div class='__info'>$exception->info</div>";
?>
</div>
<div class="error-location"> | FIX: show error info pane only when text is not empty | php-kit_php-web-console | train | php |
d5e8011d1bb2e2d7346ab56dc2081b4b22f9b2b2 | diff --git a/app/models/alchemy/picture.rb b/app/models/alchemy/picture.rb
index <HASH>..<HASH> 100644
--- a/app/models/alchemy/picture.rb
+++ b/app/models/alchemy/picture.rb
@@ -36,7 +36,7 @@ module Alchemy
end
def self.last_upload
- last_picture = Picture.order('created_at DESC').first
+ last_picture = Picture.last
return Picture.scoped unless last_picture
Picture.where(:upload_hash => last_picture.upload_hash)
end | Fix for last_upload scope.
This hopefully fixes an issue with finding the last picture in mysql databases. | AlchemyCMS_alchemy_cms | train | rb |
222908263bcd640352b8aef89dd7054d46b27fe8 | diff --git a/metpy/calc/tests/test_indices.py b/metpy/calc/tests/test_indices.py
index <HASH>..<HASH> 100644
--- a/metpy/calc/tests/test_indices.py
+++ b/metpy/calc/tests/test_indices.py
@@ -13,7 +13,7 @@ from metpy.calc import (bulk_shear, bunkers_storm_motion, mean_pressure_weighted
from metpy.deprecation import MetpyDeprecationWarning
from metpy.io import get_upper_air_data
from metpy.io.upperair import UseSampleData
-from metpy.testing import assert_almost_equal, assert_array_equal
+from metpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
from metpy.units import concatenate, units
warnings.simplefilter('ignore', MetpyDeprecationWarning)
@@ -49,7 +49,7 @@ def test_precipitable_water_bound_error():
-86.5, -88.1]) * units.degC
pw = precipitable_water(dewpoint, pressure)
truth = 89.86955998646951 * units('millimeters')
- assert_array_equal(pw, truth)
+ assert_array_almost_equal(pw, truth)
def test_mean_pressure_weighted(): | Updates precipitable water test to use assert_array_almost_equal to account for machine precision | Unidata_MetPy | train | py |
41e09d1f8ade491bcb98d0c216423cc9e51f74e8 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/cache/OCachePointer.java b/core/src/main/java/com/orientechnologies/orient/core/storage/cache/OCachePointer.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/com/orientechnologies/orient/core/storage/cache/OCachePointer.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/storage/cache/OCachePointer.java
@@ -247,10 +247,8 @@ public class OCachePointer {
protected void finalize() throws Throwable {
super.finalize();
- if (referrersCount.get() > 0 && buffer != null) {
- OLogManager.instance().error(this, "OCachePointer.finalize: leak");
+ if (referrersCount.get() > 0 && buffer != null)
bufferPool.release(buffer);
- }
}
@Override | leaks debugging "reverted" | orientechnologies_orientdb | train | java |
87e606627c7d2c04e51cfc71918967bc8c749ff4 | diff --git a/spec/webview-spec.js b/spec/webview-spec.js
index <HASH>..<HASH> 100644
--- a/spec/webview-spec.js
+++ b/spec/webview-spec.js
@@ -524,7 +524,7 @@ describe('<webview> tag', function () {
webview.addEventListener('page-favicon-updated', function (e) {
assert.equal(e.favicons.length, 2)
if (process.platform === 'win32') {
- assert(/^file:\/\/\/[a-zA-Z]:\/favicon.png$/i.test(e.favicons[0]))
+ assert(/^file:\/\/\/[A-Z]:\/favicon.png$/i.test(e.favicons[0]))
} else {
assert.equal(e.favicons[0], 'file:///favicon.png')
} | Smaller regex now that it's case insensitive | electron_electron | train | js |
575454fbcac51a7b0d381b517164ac4a4d661f14 | diff --git a/pymc/gp/gp.py b/pymc/gp/gp.py
index <HASH>..<HASH> 100644
--- a/pymc/gp/gp.py
+++ b/pymc/gp/gp.py
@@ -246,7 +246,7 @@ class TP(Latent):
.. math::
- f(X) \sim \mathcal{TP}\left( \mu(X), k(X, X'), \\nu \\right)
+ f(X) \sim \mathcal{TP}\left( \mu(X), k(X, X'), \nu \right)
Parameters | Fixing student-T process doc-string | pymc-devs_pymc | train | py |
af1e8a790a62e7f2e0e82b15643d5db02b1b402c | diff --git a/module/__init__.py b/module/__init__.py
index <HASH>..<HASH> 100644
--- a/module/__init__.py
+++ b/module/__init__.py
@@ -524,7 +524,9 @@ class Connection(object):
def send_request(self, flags, xcb_parts, xcb_req):
self.invalid()
- return C.xcb_send_request(self._conn, flags, xcb_parts, xcb_req)
+ ret = C.xcb_send_request(self._conn, flags, xcb_parts, xcb_req)
+ self.invalid()
+ return ret
# More backwards compatibility | Always die immediately when a request fails | tych0_xcffib | train | py |
033b9a1ce2dfcda4ba8d229490542ef580840a6e | diff --git a/lib/epub/publication/fixed_layout.rb b/lib/epub/publication/fixed_layout.rb
index <HASH>..<HASH> 100644
--- a/lib/epub/publication/fixed_layout.rb
+++ b/lib/epub/publication/fixed_layout.rb
@@ -33,21 +33,21 @@ module EPUB
alias_method "#{property}=", "rendition_#{property}="
method_name_base = value.gsub('-', '_')
- method_name = "#{method_name_base}="
- define_method method_name do |new_value|
+ setter_name = "#{method_name_base}="
+ define_method setter_name do |new_value|
new_prop = new_value ? value : values.find {|l| l != value}
__send__ "rendition_#{property}=", new_prop
end
- method_name = "make_#{method_name_base}"
- define_method method_name do
+ maker_name = "make_#{method_name_base}"
+ define_method maker_name do
__send__ "rendition_#{property}=", value
end
destructive_method_name = "#{method_name_base}!"
- alias_method destructive_method_name, method_name
+ alias_method destructive_method_name, maker_name
- method_name = "#{method_name_base}?"
- define_method method_name do
+ predicate_name = "#{method_name_base}?"
+ define_method predicate_name do
__send__("rendition_#{property}") == value
end
end | Modify some variable names for readability | KitaitiMakoto_epub-parser | train | rb |
28dbe7e8c14c3ad68860a4d6fc2bb45b4841eb9a | diff --git a/lib/active_merchant/billing/gateways/authorize_net.rb b/lib/active_merchant/billing/gateways/authorize_net.rb
index <HASH>..<HASH> 100644
--- a/lib/active_merchant/billing/gateways/authorize_net.rb
+++ b/lib/active_merchant/billing/gateways/authorize_net.rb
@@ -340,7 +340,7 @@ module ActiveMerchant #:nodoc:
xml.settingValue("true")
end
end
- if options[:disable_partial_auth] == true
+ if options[:disable_partial_auth]
xml.setting do
xml.settingName("allowPartialAuth")
xml.settingValue("false") | Authorize.net: Truthiness for disable_partial_auth | activemerchant_active_merchant | train | rb |
1c0b0b6e4e7446b789170282d19b2e44bcc0d22e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,5 +20,6 @@ setup(
],
keywords = 'postgresql database bindings sql',
packages = find_packages(exclude = ['build', 'dist']),
+ package_data = {'': ['README.md', 'requirements.txt']},
install_requires = open("requirements.txt").readlines(),
)
\ No newline at end of file | Including README and requirements.txt with module install | mikeshultz_rawl | train | py |
09a896d375dd7925584c00956ee0a99f55bafd47 | diff --git a/lib/netsuite/records/base_ref_list.rb b/lib/netsuite/records/base_ref_list.rb
index <HASH>..<HASH> 100644
--- a/lib/netsuite/records/base_ref_list.rb
+++ b/lib/netsuite/records/base_ref_list.rb
@@ -2,31 +2,15 @@
module NetSuite
module Records
- class BaseRefList
- include Support::Fields
+ class BaseRefList < Support::Sublist
include Support::Actions
include Namespaces::PlatformCore
actions :get_select_value
- fields :base_ref
+ sublist :base_ref, RecordRef
- def initialize(attrs = {})
- initialize_from_attributes_hash(attrs)
- end
-
- def base_ref=(refs)
- case refs
- when Hash
- self.base_ref << RecordRef.new(refs)
- when Array
- refs.each { |ref| self.base_ref << RecordRef.new(ref) }
- end
- end
-
- def base_ref
- @base_ref ||= []
- end
+ alias :base_refs :base_ref
end
end | Refactor BaseRefList to use Support::Sublist | NetSweet_netsuite | train | rb |
6296f2f359e8f9fe67336e90d615066d05d98660 | diff --git a/bin/transformTests.js b/bin/transformTests.js
index <HASH>..<HASH> 100755
--- a/bin/transformTests.js
+++ b/bin/transformTests.js
@@ -243,7 +243,7 @@ MockTTM.prototype.ProcessTestFile = function(opts) {
var token = JSON.parse(line);
if (token.constructor !== String) { // cast object to token type
console.assert(defines[token.type] !== undefined, "Incorrect type [" + token.type + "] specified in test file\n");
- token.prototype = token.constructor = defines[token.type];
+ Object.setPrototypeOf(token, defines[token.type].prototype);
}
var s = process.hrtime();
var res;
@@ -367,7 +367,7 @@ MockTTM.prototype.ProcessWikitextFile = function(tokenTransformer, opts) {
var token = JSON.parse(line);
if (token.constructor !== String) { // cast object to token type
console.assert(defines[token.type] !== undefined, "Incorrect type [" + token.type + "] specified in test file\n");
- token.prototype = token.constructor = defines[token.type];
+ Object.setPrototypeOf(token, defines[token.type].prototype);
}
var s = process.hrtime();
var res; | Set the prototype of the token appropriately
It's probably a better idea to reconstruct the token but this will at
least get the desired methods in the chain.
Change-Id: I<I>dcad<I>f6c7df<I>e<I>fcbe<I>a0e<I> | wikimedia_parsoid | train | js |
e1a88e8bf7af7cf9f5e75bf778de54edb889d54e | diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py
index <HASH>..<HASH> 100644
--- a/salt/states/saltmod.py
+++ b/salt/states/saltmod.py
@@ -647,6 +647,16 @@ def runner(name, **kwargs):
'Unable to fire args event due to missing __orchestration_jid__'
)
jid = None
+
+ if __opts__.get('test', False):
+ ret = {
+ 'name': name,
+ 'result': True,
+ 'changes': {},
+ 'comment': "Runner function '{0}' would be executed.".format(name)
+ }
+ return ret
+
out = __salt__['saltutil.runner'](name,
__orchestration_jid__=jid,
__env__=__env__,
@@ -704,6 +714,12 @@ def wheel(name, **kwargs):
'Unable to fire args event due to missing __orchestration_jid__'
)
jid = None
+
+ if __opts__.get('test', False):
+ ret['result'] = True,
+ ret['comment'] = "Wheel function '{0}' would be executed.".format(name)
+ return ret
+
out = __salt__['saltutil.wheel'](name,
__orchestration_jid__=jid,
__env__=__env__, | Allowing test=True to be passed for salt.runner and salt.wheel when used with orchestration | saltstack_salt | train | py |
2a344149357353931d1997ed83339e1c22a93c02 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -44,7 +44,7 @@ import numpy as np
def read(fname):
import codecs
with codecs.open('README.md', 'r', 'utf-8') as f:
- print(f.read())
+ return f.read()
def read_to_rst(fname):
try: | [codecs] to read file | SheffieldML_GPy | train | py |
395af08b53b2a2cda95617c3d29d3ac46f705120 | diff --git a/source/net/fortuna/ical4j/model/property/DtEnd.java b/source/net/fortuna/ical4j/model/property/DtEnd.java
index <HASH>..<HASH> 100644
--- a/source/net/fortuna/ical4j/model/property/DtEnd.java
+++ b/source/net/fortuna/ical4j/model/property/DtEnd.java
@@ -122,6 +122,17 @@ public class DtEnd extends DateProperty {
}
/**
+ * Creates a new instance initialised with the parsed value.
+ * @param value the DTEND value string to parse
+ * @throws ParseException where the specified string is not a valid
+ * DTEND value representation
+ */
+ public DtEnd(final String value) throws ParseException {
+ super(DTEND);
+ setValue(value);
+ }
+
+ /**
* @param aList
* a list of parameters for this component
* @param aValue | Added constructor for consistency with DtStart | ical4j_ical4j | train | java |
de257bece45e4db3ddda762ae117011c5e3fa380 | diff --git a/src/Events/Transaction.php b/src/Events/Transaction.php
index <HASH>..<HASH> 100644
--- a/src/Events/Transaction.php
+++ b/src/Events/Transaction.php
@@ -3,7 +3,6 @@
namespace PhilKra\Events;
use PhilKra\Helper\Timer;
-use PhilKra\Helper\DistributedTracing;
/**
* | removed use DistributedTracing in Events\Transaction | philkra_elastic-apm-php-agent | train | php |
22703d8d8c9261068f9b0118ff6e52543ca71276 | diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -380,7 +380,7 @@ var (
},
}
- pendingClientMessages = make(chan *clientMessage)
+ pendingClientMessages = make(chan *clientMessage, 128*1024)
)
func acquireClientMessage(request interface{}) *clientMessage { | Buffer client messages pending for release | valyala_gorpc | train | go |
971d50de63872a626d320b90d46b84597882d04e | diff --git a/src/main/java/de/thetaphi/forbiddenapis/Checker.java b/src/main/java/de/thetaphi/forbiddenapis/Checker.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/thetaphi/forbiddenapis/Checker.java
+++ b/src/main/java/de/thetaphi/forbiddenapis/Checker.java
@@ -384,10 +384,12 @@ public abstract class Checker implements RelatedClassLookup {
return forbiddenMethods.isEmpty() && forbiddenClasses.isEmpty() && forbiddenFields.isEmpty() && (!internalRuntimeForbidden);
}
+ /** Adds the given annotation class for suppressing errors. */
public final void addSuppressAnnotation(Class<? extends Annotation> anno) {
suppressAnnotations.add(Type.getDescriptor(anno));
}
+ /** Adds suppressing annotation name in binary form (dotted). The class name is not checked. */
public final void addSuppressAnnotation(String annoName) throws ParseException {
final Type type = Type.getObjectType(annoName.replace('.', '/'));
if (type.getSort() != Type.OBJECT) { | Issue #<I>: Add javadocs | policeman-tools_forbidden-apis | train | java |
e48e7a3579c27af0f378397b661df1602306d165 | diff --git a/netjsonconfig/backends/openvpn/schema.py b/netjsonconfig/backends/openvpn/schema.py
index <HASH>..<HASH> 100644
--- a/netjsonconfig/backends/openvpn/schema.py
+++ b/netjsonconfig/backends/openvpn/schema.py
@@ -366,6 +366,14 @@ schema = {
"default": "udp",
"options": {"enum_titles": ["UDP", "TCP"]}
},
+ "nobind": {
+ "title": "nobind",
+ "description": "ports are dynamically selected",
+ "type": "boolean",
+ "default": True,
+ "format": "checkbox",
+ "propertyOrder": 4,
+ },
"remote": {
"title": "remote",
"type": "array",
@@ -398,14 +406,6 @@ schema = {
}
}
},
- "nobind": {
- "title": "nobind",
- "description": "ports are dynamically selected",
- "type": "boolean",
- "default": True,
- "format": "checkbox",
- "propertyOrder": 6,
- },
"port": {
"description": "Use specific local port, ignored if nobind is enabled",
}, | [openvpn] Moved nobind option up of few positions | openwisp_netjsonconfig | train | py |
53b82dd959174f307322e0b084c7b34295b49883 | diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration_spec.rb
+++ b/spec/integration_spec.rb
@@ -170,23 +170,22 @@ describe Rehab do
# an file_provider is anything that responds to "call"
# it should return the contents of the file
-
- it "renders partials" do
+ it "renders partials using a file provider" do
src = <<-EOF
# include my_partial.html
<p>content</p>
EOF
- file = ->(ignore) {
- <<-EOF
+ file = double("File Provider", call: <<-EOF
<p>{{ message }}</p>
EOF
- }
+ )
out = <<-EOF
<p>Hello World!</p>
<p>content</p>
EOF
+ expect( file ).to receive(:call).with('my_partial.html')
expect(template(src, {file_provider: file})).to eq out
end | Make specs better document the file provider contract | skuester_rehab | train | rb |
d49e5e470080bd649ddbe65d43c810c75a45894c | diff --git a/src/pouch.replicate.js b/src/pouch.replicate.js
index <HASH>..<HASH> 100644
--- a/src/pouch.replicate.js
+++ b/src/pouch.replicate.js
@@ -6,7 +6,7 @@
var results = [];
var completed = false;
var pending = 0;
- var last_seq = 0;
+ var last_seq = checkpoint;
var continuous = opts.continuous || false;
var result = {
ok: true,
@@ -104,4 +104,4 @@
return replicateRet;
};
-}).call(this);
\ No newline at end of file
+}).call(this); | initialize last_seq with fetch result | pouchdb_pouchdb | train | js |
3c178940be7e40afdc328c36370502c4b4a09108 | diff --git a/ruby_event_store/spec/in_memory_repository_spec.rb b/ruby_event_store/spec/in_memory_repository_spec.rb
index <HASH>..<HASH> 100644
--- a/ruby_event_store/spec/in_memory_repository_spec.rb
+++ b/ruby_event_store/spec/in_memory_repository_spec.rb
@@ -5,9 +5,9 @@ module RubyEventStore
RSpec.describe InMemoryRepository do
# There is no way to use in-memory adapter in a
# lock-free, unlimited concurrency way
- let(:test_race_conditions_any) { false }
-
- let(:test_race_conditions_auto) { true }
+ let(:test_race_conditions_any) { false }
+ let(:test_race_conditions_auto) { true }
+ let(:test_expected_version_auto) { true }
it_behaves_like :event_repository, InMemoryRepository
@@ -20,4 +20,4 @@ module RubyEventStore
def additional_limited_concurrency_for_auto_check
end
end
-end
\ No newline at end of file
+end | Missing flag for in-memory repository | RailsEventStore_rails_event_store | train | rb |
487de4a05dedea98597490da3dbde27493f40cbf | diff --git a/lib/handlers/ReactNative.js b/lib/handlers/ReactNative.js
index <HASH>..<HASH> 100644
--- a/lib/handlers/ReactNative.js
+++ b/lib/handlers/ReactNative.js
@@ -66,6 +66,16 @@ class Handler extends EnhancedEventEmitter
try { this._pc.close(); }
catch (error) {}
}
+
+ remoteClosed()
+ {
+ logger.debug('remoteClosed()');
+
+ this._transportReady = false;
+
+ if (this._transportUpdated)
+ this._transportUpdated = false;
+ }
}
class SendHandler extends Handler | Add missing remoteClosed() method to lib/handlers/ReactNative.js | versatica_mediasoup-client | train | js |
f626aaf1a37b767e9cab2e166f28d2cc920c1818 | diff --git a/mockery/generator.go b/mockery/generator.go
index <HASH>..<HASH> 100644
--- a/mockery/generator.go
+++ b/mockery/generator.go
@@ -249,10 +249,6 @@ func (g *Generator) GeneratePrologueNote(note string) {
}
}
-func (g *Generator) GenerateInterfaceAssertion() {
- g.printf("\nvar _ %s = (*%s)(nil)", g.renderType(g.iface.NamedType), g.mockName())
-}
-
// ErrNotInterface is returned when the given type is not an interface
// type.
var ErrNotInterface = errors.New("expression not an interface")
diff --git a/mockery/walker.go b/mockery/walker.go
index <HASH>..<HASH> 100644
--- a/mockery/walker.go
+++ b/mockery/walker.go
@@ -119,8 +119,6 @@ func (this *GeneratorVisitor) VisitWalk(iface *Interface) error {
return err
}
- gen.GenerateInterfaceAssertion()
-
err = gen.Write(out)
if err != nil {
return err | Remove interface assertion
Fixes #<I> | vektra_mockery | train | go,go |
779ff34d4d6a4c51e94aee1145e193f2402ddb56 | diff --git a/resource_aws_ami.go b/resource_aws_ami.go
index <HASH>..<HASH> 100644
--- a/resource_aws_ami.go
+++ b/resource_aws_ami.go
@@ -18,8 +18,8 @@ import (
)
const (
- AWSAMIRetryTimeout = 20 * time.Minute
- AWSAMIDeleteRetryTimeout = 20 * time.Minute
+ AWSAMIRetryTimeout = 40 * time.Minute
+ AWSAMIDeleteRetryTimeout = 90 * time.Minute
AWSAMIRetryDelay = 5 * time.Second
AWSAMIRetryMinTimeout = 3 * time.Second
) | provider/aws: Increase AMI retry timeouts (#<I>) | terraform-providers_terraform-provider-aws | train | go |
820bf1e2d1d3ce16d4cbe3f90d82c484eaf32832 | diff --git a/lib/active_remote/version.rb b/lib/active_remote/version.rb
index <HASH>..<HASH> 100644
--- a/lib/active_remote/version.rb
+++ b/lib/active_remote/version.rb
@@ -1,3 +1,3 @@
module ActiveRemote
- VERSION = "1.1.4"
+ VERSION = "1.2.0.dev`"
end | Bumped version to <I>.dev so we don't get confused. | liveh2o_active_remote | train | rb |
aabfebe71ded6ccc2fd72708fa14843df8c24cab | diff --git a/src/Illuminate/View/Concerns/ManagesComponents.php b/src/Illuminate/View/Concerns/ManagesComponents.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/View/Concerns/ManagesComponents.php
+++ b/src/Illuminate/View/Concerns/ManagesComponents.php
@@ -88,7 +88,7 @@ trait ManagesComponents
*/
public function slot($name, $content = null)
{
- if ($content !== null) {
+ if (count(func_get_args()) == 2) {
$this->slots[$this->currentComponent()][$name] = $content;
} else {
if (ob_start()) { | fix an issue with slots when content passed is equal to null (#<I>) | laravel_framework | train | php |
04d85a92017d66f301ea6ddcc02de904cde9ae77 | diff --git a/project/library/CM/FormField/TreeSelect.php b/project/library/CM/FormField/TreeSelect.php
index <HASH>..<HASH> 100755
--- a/project/library/CM/FormField/TreeSelect.php
+++ b/project/library/CM/FormField/TreeSelect.php
@@ -15,7 +15,9 @@ class CM_FormField_TreeSelect extends CM_FormField_Abstract {
}
public function validate($userInput, CM_Response_Abstract $response) {
- //TODO: Validation
+ if (!$this->_tree->findNodeById($userInput)) {
+ throw new CM_Exception_FormFieldValidation('Invalid value');
+ }
return $userInput;
} | t<I>: Validation added | cargomedia_cm | train | php |
4d773ed2550a9cd86b0897952a7bf68bfb7bf280 | diff --git a/lib/dm-migrations/version.rb b/lib/dm-migrations/version.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-migrations/version.rb
+++ b/lib/dm-migrations/version.rb
@@ -1,5 +1,5 @@
module DataMapper
class Migration
- VERSION = "0.9.3"
+ VERSION = "0.9.4"
end
end
\ No newline at end of file
diff --git a/lib/migration.rb b/lib/migration.rb
index <HASH>..<HASH> 100644
--- a/lib/migration.rb
+++ b/lib/migration.rb
@@ -1,5 +1,5 @@
require 'rubygems'
-gem 'dm-core', '=0.9.3'
+gem 'dm-core', '=0.9.4'
require 'dm-core'
require 'benchmark'
require File.dirname(__FILE__) + '/sql'
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
@@ -11,7 +11,7 @@ def load_driver(name, default_uri)
lib = "do_#{name}"
begin
- gem lib, '=0.9.3'
+ gem lib, '=0.9.4'
require lib
DataMapper.setup(name, default_uri)
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name] | Updated Rakefile's CLEAN_GLOBS. Version Bump. | datamapper_dm-migrations | train | rb,rb,rb |
3fbce106c09b073eb7aa950e23019a75f5d3cfaf | diff --git a/slave/buildslave/commands/mtn.py b/slave/buildslave/commands/mtn.py
index <HASH>..<HASH> 100644
--- a/slave/buildslave/commands/mtn.py
+++ b/slave/buildslave/commands/mtn.py
@@ -182,4 +182,4 @@ class Monotone(SourceBaseCommand):
d = c.start()
d.addCallback(self._abandonOnFailure)
d.addCallback(_parse)
-
+ return d | Return the deferred from Mtn.parseGotRevision
Without this, any error in parseGotRevision is silently dropped. | buildbot_buildbot | train | py |
25ca9656680c593c377aa41aa1ffe9092500e4ea | diff --git a/spec/database_rewinder_spec.rb b/spec/database_rewinder_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/database_rewinder_spec.rb
+++ b/spec/database_rewinder_spec.rb
@@ -61,7 +61,7 @@ describe DatabaseRewinder do
context 'Database accepts more than one dots in an object notation(exp: SQLServer)' do
context 'full joined' do
- let(:sql) { 'INSERT INTO server.database.schema.foos ("name") VALUES (?)' }
+ let(:sql) { 'INSERT INTO server.database.schema.foos ("name") VALUES (?)' }
its(:inserted_tables) { should == ['foos'] }
end
context 'missing one' do | Indent :arrow_right: :arrow_right: | amatsuda_database_rewinder | train | rb |
2b5ff48b4e2823e851ed397888c5c5d58358e440 | diff --git a/rets/__init__.py b/rets/__init__.py
index <HASH>..<HASH> 100644
--- a/rets/__init__.py
+++ b/rets/__init__.py
@@ -1,7 +1,7 @@
from .session import Session
__title__ = 'rets'
-__version__ = '0.0.8'
+__version__ = '0.0.9'
__author__ = 'REfindly'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 REfindly' | pushing <I> because of the minor stuff | refindlyllc_rets | train | py |
e5bba43c1b12a5612b2351efafddc800307f827f | diff --git a/src/Message/Response.php b/src/Message/Response.php
index <HASH>..<HASH> 100644
--- a/src/Message/Response.php
+++ b/src/Message/Response.php
@@ -11,6 +11,7 @@
namespace Bee4\Transport\Message;
+use Bee4\Transport\Handle\ExecutionInfos;
use Bee4\Transport\Exception\RuntimeException;
use Bee4\Transport\Message\Request\AbstractRequest;
@@ -29,6 +30,12 @@ class Response extends AbstractMessage
protected $request;
/**
+ * The execution details which helped to build the request
+ * @var ExecutionInfos
+ */
+ protected $infos;
+
+ /**
* HTTP Status code
* @var integer
*/
@@ -70,6 +77,25 @@ class Response extends AbstractMessage
}
/**
+ * Set the execution infos
+ * @param ExecutionInfos $infos
+ * @return Response
+ */
+ public function setExecutionInfos(ExecutionInfos $infos)
+ {
+ $this->infos = $infos;
+ return $this;
+ }
+
+ /**
+ * @return ExecutionInfos
+ */
+ public function getExecutionInfos()
+ {
+ return $this->infos;
+ }
+
+ /**
* @param int $code
* @return Response
*/ | Store executions infos in Response object
Help to access execution data more easily after result. | bee4_transport | train | php |
449375576908956d4ea6c0764faa39eadf676c26 | diff --git a/lib/reporters/doc.js b/lib/reporters/doc.js
index <HASH>..<HASH> 100644
--- a/lib/reporters/doc.js
+++ b/lib/reporters/doc.js
@@ -49,7 +49,7 @@ function Doc(runner) {
runner.on('pass', function(test){
console.log('%s<dt>%s</dt>', indent(), test.title);
- var code = strip(test.fn.toString());
+ var code = clean(test.fn.toString());
console.log('%s<dd><pre><code>%s</code></pre></dd>', indent(), code);
});
@@ -59,11 +59,19 @@ function Doc(runner) {
}
/**
- * Strip the function definition from `str`.
+ * Strip the function definition from `str`,
+ * and re-indent for pre whitespace.
*/
-function strip(str) {
- return str
- .replace(/^function *\(.*\) *{\s*/, '')
+function clean(str) {
+ str = str
+ .replace(/^function *\(.*\) *{/, '')
.replace(/\s+\}$/, '');
+
+ var spaces = str.match(/^\n?( *)/)[1].length
+ , re = new RegExp('^ {' + spaces + '}', 'gm');
+
+ str = str.replace(re, '');
+
+ return str;
}
\ No newline at end of file | Fixed: strip leading indentation from doc for pre tags | mochajs_mocha | train | js |
fef52f3c77c71e315b37b3f3d42bde33cd5d01fb | diff --git a/lib/sensu/api.rb b/lib/sensu/api.rb
index <HASH>..<HASH> 100644
--- a/lib/sensu/api.rb
+++ b/lib/sensu/api.rb
@@ -47,6 +47,7 @@ module Sensu
end
end
on_reactor_run
+ self
end
def start_server | [thin] have bootstrap() return self | sensu_sensu | train | rb |
1a7a263675114f7715b75be6836128184b376799 | diff --git a/openquake/risk/classical_psha_based.py b/openquake/risk/classical_psha_based.py
index <HASH>..<HASH> 100644
--- a/openquake/risk/classical_psha_based.py
+++ b/openquake/risk/classical_psha_based.py
@@ -190,7 +190,7 @@ def _compute_pes_from_imls(hazard_curve, imls):
:type imls: list
"""
- return array([hazard_curve.ordinate_for(iml) for iml in imls])
+ return hazard_curve.ordinate_for(imls)
def _convert_pes_to_pos(hazard_curve, imls): | using ordinate_for on all imls in a single pass | gem_oq-engine | train | py |
f2e90c8db61a34cc7ff008ab85b05200087d045e | diff --git a/lib/Resolver.js b/lib/Resolver.js
index <HASH>..<HASH> 100644
--- a/lib/Resolver.js
+++ b/lib/Resolver.js
@@ -104,6 +104,7 @@ Resolver.prototype.isDirectory = function isDirectory(path) {
var absoluteWinRegExp = /^[A-Z]:[\\\/]/i;
var absoluteNixRegExp = /^\//i;
Resolver.prototype.join = function join(path, request) {
+ if(request == "") return this.normalize(path);
if(absoluteWinRegExp.test(request)) return this.normalize(request.replace(/\//g, "\\"));
if(absoluteNixRegExp.test(request)) return this.normalize(request);
if(path == "/") return this.normalize(path + request); | fixed obsolute / at end | webpack_enhanced-resolve | train | js |
e29a8e165c94ecb9c8f580b78040c3de058a5811 | diff --git a/src/main/com/mongodb/gridfs/GridFSFile.java b/src/main/com/mongodb/gridfs/GridFSFile.java
index <HASH>..<HASH> 100644
--- a/src/main/com/mongodb/gridfs/GridFSFile.java
+++ b/src/main/com/mongodb/gridfs/GridFSFile.java
@@ -90,6 +90,9 @@ public abstract class GridFSFile implements DBObject {
return _uploadDate;
}
+ /**
+ * note: to set aliases, call put( "aliases" , List<String> )
+ */
public List<String> getAliases(){
return (List<String>)_metadata.get( "aliases" );
} | added a comment about aliases | mongodb_mongo-java-driver | train | java |
69307ddcc8ed6bb48a89992b49b07cf6ee2f11f4 | diff --git a/lib/prompts/rawlist.js b/lib/prompts/rawlist.js
index <HASH>..<HASH> 100644
--- a/lib/prompts/rawlist.js
+++ b/lib/prompts/rawlist.js
@@ -149,15 +149,13 @@ Prompt.prototype.onSubmit = function( input ) {
*/
Prompt.prototype.onKeypress = function( s, key ) {
- var input = this.rl.line.length ? Number(this.rl.line) : 1;
- var index = input - 1;
+ var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0;
if ( this.opt.choices[index] ) {
this.selected = index;
} else {
this.selected = undefined;
}
- this.down().clean(1).render();
- this.write( this.rl.line );
+ this.down().clean(1).render().write( this.rl.line );
}; | reduce length of rawlist onKeypress method | kaelzhang_node-asks | train | js |
80940abaf5770dfec40d6e51feb286f9a1f29aac | diff --git a/src/nwmatcher.js b/src/nwmatcher.js
index <HASH>..<HASH> 100644
--- a/src/nwmatcher.js
+++ b/src/nwmatcher.js
@@ -874,7 +874,9 @@ NW.Dom = (function(global) {
if (snap && !snap.isExpired) {
if (snap.Results[selector] &&
snap.Roots[selector] == from) {
- return snap.Results[selector];
+ return callback ?
+ concat(data, snap.Results[selector], callback) :
+ snap.Results[selector];
}
} else {
// temporarily pause caching while we are getting hammered with dom mutations (jdalton)
@@ -898,6 +900,17 @@ NW.Dom = (function(global) {
// this block can be safely removed, it is a speed booster on big pages
// and still maintain the mandatory "document ordered" result set
+ if (simpleSelector.test(selector)) {
+ switch (selector.charAt(0)) {
+ case '.': data = concat(data, byClass(selector.slice(1), from), callback);
+ case '#': data = concat(data, [ byId(selector.slice(1), from) ], callback);
+ default: data = concat(data, byTag(selector, from), callback);
+ }
+ snap.Roots[selector] = from;
+ snap.Results[selector] = data;
+ return data;
+ }
+
// commas separators are treated
// sequentially to maintain order
if (selector.indexOf(',') < 0) { | invoke provided callbacks also when returning cached results, use a faster resolver for simple selectors in client_api | dperini_nwmatcher | train | js |
c841988a371cc04b4c0269e981dc542b768b847b | diff --git a/Entity/Cursus.php b/Entity/Cursus.php
index <HASH>..<HASH> 100644
--- a/Entity/Cursus.php
+++ b/Entity/Cursus.php
@@ -78,6 +78,7 @@ class Cursus
/**
* @ORM\Column(type="json_array", nullable=true)
+ * @Groups({"api"})
*/
protected $details; | [CursusBundle] Add details to serialization | claroline_Distribution | train | php |
4360d4f8cb91985f247c92e53768bfa4cde0fb61 | diff --git a/lib/alchemy/mount_point.rb b/lib/alchemy/mount_point.rb
index <HASH>..<HASH> 100644
--- a/lib/alchemy/mount_point.rb
+++ b/lib/alchemy/mount_point.rb
@@ -1,10 +1,16 @@
module Alchemy
# Returns alchemys mount point in current rails app.
- def self.mount_point
+ # Pass false to not return a leading slash on empty mount point.
+ def self.mount_point(remove_leading_slash_if_blank = true)
alchemy_routes = Rails.application.routes.named_routes[:alchemy]
raise "Alchemy not mounted! Please mount Alchemy::Engine in your config/routes.rb file." if alchemy_routes.nil?
- alchemy_routes.path.spec.to_s.gsub(/^\/$/, '')
+ mount_point = alchemy_routes.path.spec.to_s
+ if remove_leading_slash_if_blank && mount_point == "/"
+ mount_point.gsub(/^\/$/, '')
+ else
+ mount_point
+ end
end
-end
\ No newline at end of file
+end | Adding remove_leading_slash_if_blank option to Alchemy.mount_point. | AlchemyCMS_alchemy_cms | train | rb |
cbf7a7b2045ce3b42cffd4c8d7c94f77847e6e54 | diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100755
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -244,6 +244,17 @@ class Updater extends \common_ext_ExtensionUpdater
$this->setVersion('10.3.0');
}
- $this->skip('10.3.0', '10.5.3');
+ $this->skip('10.3.0', '10.5.2');
+
+ if ($this->isVersion('10.5.2')) {
+ $ltiUserService = $this->getServiceManager()->get(LtiUserService::SERVICE_ID);
+
+ if ($ltiUserService->hasOption(LtiUserService::OPTION_FACTORY_LTI_USER)) {
+ $ltiUserService->setOption(LtiUserService::OPTION_FACTORY_LTI_USER, LtiUserFactoryService::SERVICE_ID);
+ $this->getServiceManager()->register(LtiUserService::SERVICE_ID, $ltiUserService);
+ }
+ $this->setVersion('10.5.3');
+ }
+
}
} | Added re-setting the config in updater. | oat-sa_extension-tao-lti | train | php |
747ebe87c816b072b225743074483637ba1d0235 | diff --git a/raiden/ui/cli.py b/raiden/ui/cli.py
index <HASH>..<HASH> 100644
--- a/raiden/ui/cli.py
+++ b/raiden/ui/cli.py
@@ -175,10 +175,7 @@ OPTIONS = [
),
click.option(
'--console',
- help=(
- 'Start with or without the command line interface. Default is to '
- 'start with the CLI disabled'
- ),
+ help='Start the interactive raiden console',
is_flag=True
),
click.option(
@@ -555,7 +552,7 @@ def version(short, **kwargs):
@click.option(
'--debug',
is_flag=True,
- help='Drop into pdb on errors (default: False).'
+ help='Drop into pdb on errors.'
)
@click.pass_context
def smoketest(ctx, debug, **kwargs): | Better help text for some args | raiden-network_raiden | train | py |
f161a280b64757f293ee23f3abf77f2d6195bb6d | diff --git a/tests/spec/LoadQueueSpec.js b/tests/spec/LoadQueueSpec.js
index <HASH>..<HASH> 100644
--- a/tests/spec/LoadQueueSpec.js
+++ b/tests/spec/LoadQueueSpec.js
@@ -402,4 +402,27 @@ describe("PreloadJS.LoadQueue", function () {
});
});
+ it("stopOnError should suppress events", function (done) {
+ var _this = this;
+
+ var func = {
+ complete: function () {
+
+ }
+ };
+
+ spyOn(func, 'complete');
+
+ setTimeout(function () {
+ expect(func.complete).not.toHaveBeenCalled();
+ done();
+ }, 750);
+
+ this.queue.addEventListener("complete", func.complete);
+ this.queue.stopOnError = true;
+ this.queue.setMaxConnections(2);
+ this.queue.loadManifest(['static/manifest.json', "FileWill404.html", "static/grant.xml", "static/grant.json"], true);
+
+ });
+
}); | Added test for stopOnError | CreateJS_PreloadJS | train | js |
1c864a7a3130442d4d3d07babb4351ac3365ff41 | diff --git a/lojix/text_model/src/main/com/thesett/text/impl/model/TextTableImpl.java b/lojix/text_model/src/main/com/thesett/text/impl/model/TextTableImpl.java
index <HASH>..<HASH> 100644
--- a/lojix/text_model/src/main/com/thesett/text/impl/model/TextTableImpl.java
+++ b/lojix/text_model/src/main/com/thesett/text/impl/model/TextTableImpl.java
@@ -174,7 +174,9 @@ public class TextTableImpl implements TextTableModel
/** {@inheritDoc} */
public int getMaxColumnSize(int col)
{
- return maxColumnSizes.get(col);
+ Integer result = maxColumnSizes.get(col);
+
+ return (result == null) ? 0 : result;
}
/** {@inheritDoc} */
@@ -228,7 +230,7 @@ public class TextTableImpl implements TextTableModel
/** {@inheritDoc} */
public Map<String, String> withCellLabels()
{
- return null;
+ return new CellLabelView();
}
/** | Returning zero fo max size of uninitialized columns. | rupertlssmith_lojix | train | java |
36f49ca5a54cb7ee2108be6bea52ac5bdb533270 | diff --git a/src/NafIndex.js b/src/NafIndex.js
index <HASH>..<HASH> 100644
--- a/src/NafIndex.js
+++ b/src/NafIndex.js
@@ -14,7 +14,7 @@ naf.options = options;
naf.utils = utils;
naf.log = new NafLogger();
naf.schemas = new Schemas();
-naf.version = "0.6.1";
+naf.version = "0.7.1";
naf.adapters = new AdapterFactory();
var entities = new NetworkEntities(); | Update NafIndex.js | networked-aframe_networked-aframe | train | js |
563941e3750cff38b25231a6b2ed254a1682e2d1 | diff --git a/packages/styled-components/src/utils/classNameUsageCheckInjector.js b/packages/styled-components/src/utils/classNameUsageCheckInjector.js
index <HASH>..<HASH> 100644
--- a/packages/styled-components/src/utils/classNameUsageCheckInjector.js
+++ b/packages/styled-components/src/utils/classNameUsageCheckInjector.js
@@ -28,7 +28,7 @@ export default (target: Object) => {
didWarnAboutClassNameUsage.add(forwardTarget);
const classNames = elementClassName
- .replace(/ +/g, ' ')
+ .replace(/\s+/g, ' ')
.trim()
.split(' ');
// eslint-disable-next-line react/no-find-dom-node | #<I> forgot to replace \n to '' in className (#<I>) | styled-components_styled-components | train | js |
dcb01741f29aa29762fe6fb8d5cc585567bdfb5d | diff --git a/source/internals/tasks.js b/source/internals/tasks.js
index <HASH>..<HASH> 100644
--- a/source/internals/tasks.js
+++ b/source/internals/tasks.js
@@ -51,18 +51,23 @@ const tasks = {
},
yarnCacheClean: {
name: 'yarn cache clean (if yarn is installed)',
- command: 'yarn cache clean || true',
+ command: 'test -f yarn.lock && yarn cache clean || true',
args: []
},
yarnInstall: {
name: 'yarn install (if yarn is installed)',
- command: 'yarn install || true',
+ command: 'test -f yarn.lock && yarn install || true',
args: []
},
npmCacheVerify: {
name: 'npm cache verify',
command: 'npm',
args: ['cache', 'verify']
+ },
+ npmInstall: {
+ name: 'npm ci',
+ command: 'package-lock.json && npm ci || true',
+ args: []
}
};
@@ -74,7 +79,8 @@ const autoTasks = [
tasks.wipeTempCaches,
tasks.wipeNodeModules,
tasks.yarnCacheClean,
- tasks.npmCacheVerify
+ tasks.npmCacheVerify,
+ tasks.npmInstall
];
module.exports = { | Update tasks.js
Added `npm ci` task and respect yarn | pmadruga_react-native-clean-project | train | js |
2e3b94857bdecb58e768c5e8c8b6522ab2a0cc30 | diff --git a/scripts/install.js b/scripts/install.js
index <HASH>..<HASH> 100755
--- a/scripts/install.js
+++ b/scripts/install.js
@@ -165,6 +165,7 @@ if (process.env.SENTRYCLI_LOCAL_CDNURL) {
const contents = fs.readFileSync(path.join(__dirname, '../js/__mocks__/sentry-cli'));
response.writeHead(200, {
'Content-Type': 'application/octet-stream',
+ 'Content-Encoding': 'gzip',
'Content-Length': String(contents.byteLength),
});
response.end(contents); | fix: Add gzip header to mocked CDN server | getsentry_sentry-cli | train | js |
08bf48796d5061f2586df83f21855c95df038be9 | diff --git a/kubespawner/reflector.py b/kubespawner/reflector.py
index <HASH>..<HASH> 100644
--- a/kubespawner/reflector.py
+++ b/kubespawner/reflector.py
@@ -158,12 +158,7 @@ class ResourceReflector(LoggingConfigurable):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- # Load kubernetes config here, since this is a Singleton and
- # so this __init__ will be run way before anything else gets run.
- try:
- config.load_incluster_config()
- except config.ConfigException:
- config.load_kube_config()
+ # client configuration for kubernetes has already taken place
self.api = shared_client(self.api_group_name)
# FIXME: Protect against malicious labels? | Move global kubernetes client config logic to spawner.py
Previously reflector.py was the first to call self.api = shared_client
that is not the case any longer, spawner.py calls it just before
kicking off reflector.py code. In my opinion, putting the global
config logic in spawner.py is more intuitive and clear than
in reflector.py, especially with new traitlet config options set
on the spawner.KubeSpawner object. | jupyterhub_kubespawner | train | py |
8d485b27450345a6aa3a7f2ed49451b1afc1d7f0 | diff --git a/lib/podio/models/contract.rb b/lib/podio/models/contract.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/contract.rb
+++ b/lib/podio/models/contract.rb
@@ -19,6 +19,8 @@ class Podio::Contract < ActivePodio::Base
property :next_period_end, :datetime, :convert_timezone => false
property :invoice_interval, :integer
property :invoicing_mode, :string
+ property :ended_reason, :string
+ property :ended_comment, :string
has_one :org, :class => 'Organization'
has_one :user, :class => 'User' | Added ended info properties to Contract model | podio_podio-rb | train | rb |
449abcacdc11885346fdaacb7a12a794213d9153 | diff --git a/cmd/ls.go b/cmd/ls.go
index <HASH>..<HASH> 100644
--- a/cmd/ls.go
+++ b/cmd/ls.go
@@ -16,7 +16,7 @@ func init() {
Name: "ls",
ArgsUsage: "[cpath]",
Usage: "Explore all objects your account has access to",
- Category: "CONTEXT",
+ Category: "SECRETS",
Flags: []cli.Flag{
orgFlag("Use this organization.", false),
projectFlag("Use this project.", false), | Change section of help that ls displays under | manifoldco_torus-cli | train | go |
a998afcb3ca3c84274da5d1d45863db22ad9022b | diff --git a/lib/scss_lint/linter.rb b/lib/scss_lint/linter.rb
index <HASH>..<HASH> 100644
--- a/lib/scss_lint/linter.rb
+++ b/lib/scss_lint/linter.rb
@@ -68,7 +68,7 @@ module SCSSLint
actual_line = source_position.line - 1
actual_offset = source_position.offset + offset - 1
- engine.lines[actual_line][actual_offset]
+ engine.lines.size > actual_line && engine.lines[actual_line][actual_offset]
end
# Extracts the original source code given a range. | Harden #character_at against invalid source ranges | sds_scss-lint | train | rb |
7b31f182bcbce016c914989879efc936c8ee8bb2 | diff --git a/ui/Component.js b/ui/Component.js
index <HASH>..<HASH> 100644
--- a/ui/Component.js
+++ b/ui/Component.js
@@ -464,10 +464,13 @@ Component.Prototype = function ComponentPrototype() {
var needRerender = this.shouldRerender(newProps, this.getState());
this.willReceiveProps(newProps);
this._setProps(newProps);
- this.didReceiveProps();
if (needRerender) {
this.rerender();
}
+ // Important to call this after rerender, so within the hook you can interact
+ // with the updated DOM. However we still observe that sometimes the DOM is
+ // not ready at that point.
+ this.didReceiveProps();
};
/** | Call didReceiveProps after the rerender. | substance_substance | train | js |
d6a0d98c62ccd18e2ae6679a3c1f8bae0847c7bc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,6 @@ setup(name=packageName,
packages=find_packages() + ['twisted.plugins'],
test_suite=packageName + ".test",
- setup_requires=['tox'],
cmdclass={'test': Tox},
zip_safe=True, | setup_requires + coffee shop wifi == bad | crypto101_merlyn | train | py |
0e52a63603860cdc2bb8c28b4607d405ae1e6bf9 | diff --git a/checks.py b/checks.py
index <HASH>..<HASH> 100644
--- a/checks.py
+++ b/checks.py
@@ -424,7 +424,9 @@ def check_main_entries_in_the_name_table(fb, font, fullpath):
FAMILY_WITH_SPACES_EXCEPTIONS = {'VT323': 'VT323',
'PressStart2P': 'Press Start 2P',
'AmaticSC': 'Amatic SC',
- 'AmaticaSC': 'Amatica SC'}
+ 'AmaticaSC': 'Amatica SC',
+ 'PatrickHandSC': 'Patrick Hand SC',
+ 'CormorantSC': 'Cormorant SC'}
if value in FAMILY_WITH_SPACES_EXCEPTIONS.keys():
return FAMILY_WITH_SPACES_EXCEPTIONS[value]
result = '' | add a few more exceptions to name table rules, such as:
Cormorant SC, Amatica SC, etc...
(issue #<I>) | googlefonts_fontbakery | train | py |
76f6c4e0a2485cb495a90a81d9b96bd0a33dae00 | diff --git a/treeherder/model/models.py b/treeherder/model/models.py
index <HASH>..<HASH> 100644
--- a/treeherder/model/models.py
+++ b/treeherder/model/models.py
@@ -815,8 +815,9 @@ class JobNote(models.Model):
return
for bug_number in add_bugs:
- classification, _ = text_log_error.set_classification("ManualDetector",
- bug_number=bug_number)
+ classification, _ = ClassifiedFailure.objects.get_or_create(bug_number=bug_number)
+ classification, _ = text_log_error.set_classification("ManualDetector", classification)
+
if len(add_bugs) == 1 and not existing_bugs:
text_log_error.mark_best_classification_verified(classification)
@@ -1193,13 +1194,9 @@ class TextLogError(models.Model):
.first())
@transaction.atomic
- def set_classification(self, matcher_name, classification=None, bug_number=None):
+ def set_classification(self, matcher_name, classification):
if classification is None:
- if bug_number:
- classification, _ = ClassifiedFailure.objects.get_or_create(
- bug_number=bug_number)
- else:
- classification = ClassifiedFailure.objects.create()
+ classification = ClassifiedFailure.objects.create()
match = TextLogErrorMatch.objects.create(
text_log_error=self, | Create ClassifiedFailures from bugs only where necessary
Since ClassifiedFailures are only created from a bug number in one place
we can make set_classification more specific by pulling that
functionality out to where the bug numbers are handled. | mozilla_treeherder | train | py |
3ddebbb64d21435d8c6fa1996ffba8274c43eb9f | diff --git a/client/lxd_cluster.go b/client/lxd_cluster.go
index <HASH>..<HASH> 100644
--- a/client/lxd_cluster.go
+++ b/client/lxd_cluster.go
@@ -55,7 +55,7 @@ func (r *ProtocolLXD) DeleteClusterMember(name string, force bool) error {
params += "?force=1"
}
- _, err := r.queryStruct("DELETE", fmt.Sprintf("/cluster/members/%s%s", name, params), nil, "", nil)
+ _, _, err := r.query("DELETE", fmt.Sprintf("/cluster/members/%s%s", name, params), nil, "")
if err != nil {
return err
} | client/lxd/cluster: No reason to use queryStruct in DeleteClusterMember | lxc_lxd | train | go |
a38164863d04e58070396d38db8925116f843941 | diff --git a/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/htmlcleaner/XWikiDOMSerializer.java b/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/htmlcleaner/XWikiDOMSerializer.java
index <HASH>..<HASH> 100644
--- a/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/htmlcleaner/XWikiDOMSerializer.java
+++ b/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/htmlcleaner/XWikiDOMSerializer.java
@@ -136,7 +136,7 @@ public class XWikiDOMSerializer
// While the qualified name is "HTML" for some DocTypes, we want the actual document root name to be "html".
// See bug #116
//
- if (qualifiedName.equals("HTML")) {
+ if ("HTML".equals(qualifiedName)) {
qualifiedName = HTML_TAG_NAME;
}
document = impl.createDocument(rootNode.getNamespaceURIOnPath(""), qualifiedName, documentType); | [Misc] Move the "HTML" string literal on the left side of string comparison | xwiki_xwiki-commons | train | java |
d183fffa287da20b476b44dde605fde16d2af9c4 | diff --git a/spec/aws/signers/version_4_spec.rb b/spec/aws/signers/version_4_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/aws/signers/version_4_spec.rb
+++ b/spec/aws/signers/version_4_spec.rb
@@ -25,7 +25,9 @@ module Aws
let(:signer) { Version4.new(credentials, service_name, region) }
let(:sign) { signer.sign(http_request) }
let(:http_request) do
- Seahorse::Client::Http::Request.new(endpoint: endpoint)
+ req = Seahorse::Client::Http::Request.new(endpoint: endpoint)
+ req.headers.delete('User-Agent')
+ req
end
context '#sign' do | Removing the user-agent from the sigv4 spec headers.
The default user-agent now contains a Seahorse::VERSION which changes
over time. To prevent the tests from breaking with each update of
Seahorse, I opted to delete them from the headers hash instead. | aws_aws-sdk-ruby | train | rb |
7f93dcf95ce7228844a1f6d8969eea2164052e5c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ setup(
package_dir={'': 'src'},
install_requires=[
"pyop >= 3.0.1",
- "pysaml2",
+ "pysaml2 >= 5.0.0",
"pycryptodomex",
"requests",
"PyYAML", | Set minimum pysaml2 version
PySAML2 had a recent vulnerability report. Setting the minimum version
to the fixed release will make sure we always get a safe version.
See, CVE-<I>-<I> on XML Signature Wrapping (XSW) vulnerability. | IdentityPython_SATOSA | train | py |
4423722cab651ae4af99e42f9edb51d2cadda9f8 | diff --git a/tests/utils/tasks/test_check_task.py b/tests/utils/tasks/test_check_task.py
index <HASH>..<HASH> 100644
--- a/tests/utils/tasks/test_check_task.py
+++ b/tests/utils/tasks/test_check_task.py
@@ -18,7 +18,7 @@ def test_utils_retry_task(mock_requests_get, mock_check_task):
mock_check_task.side_effect = ValueError
with pytest.raises(SpinnakerTaskInconclusiveError):
check_task(taskid, timeout=2, wait=1)
- assert mock_check_task.call_count == 2
+ assert mock_check_task.call_count == 2
@mock.patch('foremast.utils.tasks.requests') | tests: Asserts outside the exception context | foremast_foremast | train | py |
e1b0b67f51be906fc036047eb44e17fe22d2e89d | diff --git a/runtests.py b/runtests.py
index <HASH>..<HASH> 100644
--- a/runtests.py
+++ b/runtests.py
@@ -24,10 +24,11 @@ def runtests():
"threads",
"events",
"managers",
+ "farnswiki",
"workshift",
"elections",
"rooms",
- ])
+ ])
sys.exit(bool(failures))
if __name__ == "__main__": | Added farnswiki to list of modules | knagra_farnsworth | train | py |
6ecf2b378393db88259cc609cb7a6270b5c6aa88 | diff --git a/runtests.py b/runtests.py
index <HASH>..<HASH> 100755
--- a/runtests.py
+++ b/runtests.py
@@ -23,7 +23,11 @@ def run_django_tests():
from django.conf import settings
if not settings.configured:
settings.configure(
- DATABASE_ENGINE='sqlite3',
+ DATABASES={
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ },
+ },
SITE_ID=1,
INSTALLED_APPS=[
'django.contrib.auth',
@@ -40,11 +44,12 @@ def run_django_tests():
settings.MICAWBER_PROVIDERS = providers
settings.MICAWBER_TEMPLATE_EXTENSIONS = extensions
- from django.test.simple import run_tests
+ from django.test.simple import DjangoTestSuiteRunner
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)
- return run_tests(['mcdjango_tests'], verbosity=1, interactive=True)
-
+ return DjangoTestSuiteRunner(
+ verbosity=1, interactive=True).run_tests(['mcdjango_tests'])
+
def runtests(*test_args):
print "Running micawber tests" | Update runtests.py for Django <I> compatibility. | coleifer_micawber | train | py |
29aa4e2fc0a4f0c43e5fcdeb6fa489109fe25d25 | diff --git a/webpack.js b/webpack.js
index <HASH>..<HASH> 100644
--- a/webpack.js
+++ b/webpack.js
@@ -57,11 +57,16 @@ module.exports = function makeConfig(config) {
delete cfg.jquery;
}
+ const babelPolyfillEntry = 'babel-polyfill';
const webpackEntry = 'webpack-hot-middleware/client';
- const entry = _.isArray(cfg.entry) ? [webpackEntry].concat(cfg.entry) : [
- webpackEntry,
- _.isString(cfg.entry) ? cfg.entry : './src/index',
- ];
+ const appEntry = () => {
+ if (_.isArray(cfg.entry)) {
+ return cfg.entry;
+ }
+ return _.isString(cfg.entry) ? cfg.entry : './src/index';
+ };
+ const entry = [babelPolyfillEntry, webpackEntry].concat(appEntry());
+
if (cfg.entry) {
delete cfg.entry;
} | add babel-polyfill to entry points | reactbits_devpack | train | js |
4ff880290378f264429c8b758acd0d451340c1fc | diff --git a/Sniffs/PHP/RemovedExtensionsSniff.php b/Sniffs/PHP/RemovedExtensionsSniff.php
index <HASH>..<HASH> 100644
--- a/Sniffs/PHP/RemovedExtensionsSniff.php
+++ b/Sniffs/PHP/RemovedExtensionsSniff.php
@@ -382,13 +382,17 @@ class PHPCompatibility_Sniffs_PHP_RemovedExtensionsSniff extends PHPCompatibilit
if (strpos(strtolower($tokens[$stackPtr]['content']), strtolower($extension)) === 0) {
$error = '';
$isErrored = false;
+ $isDeprecated = false;
foreach ($versionList as $version => $status) {
if ($version != 'alternative') {
if ($status == -1 || $status == 0) {
if ($this->supportsAbove($version)) {
switch ($status) {
case -1:
- $error .= 'deprecated since PHP ' . $version . ' and ';
+ if($isDeprecated === false ) {
+ $error .= 'deprecated since PHP ' . $version . ' and ';
+ $isDeprecated = true;
+ }
break;
case 0:
$isErrored = true; | Fix duplicate deprecated message.
If an extension was deprecated for a number of version, the message would say for instance _"Extension 'mysql_' is *deprecated since PHP <I> and deprecated since PHP <I>* and removed since PHP <I> - use mysqli instead."_
This PR removes the duplication of the deprecation notice from the message. | PHPCompatibility_PHPCompatibility | train | php |
f51f5577cc06b530983a84b10084e69427c002cc | diff --git a/core/src/main/java/hudson/model/UpdateSite.java b/core/src/main/java/hudson/model/UpdateSite.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/model/UpdateSite.java
+++ b/core/src/main/java/hudson/model/UpdateSite.java
@@ -1049,11 +1049,12 @@ public class UpdateSite {
/**
* Returns true if the plugin and its dependencies are fully compatible with the current installation
- * This is set to restricted for now, since it is only being used by Jenkins UI at the moment.
+ * This is set to restricted for now, since it is only being used by Jenkins UI or Restful API at the moment.
*
* @since 2.175
*/
@Restricted(NoExternalUse.class)
+ @Exported
public boolean isCompatible() {
return isCompatible(new PluginManager.MetadataCache());
}
@@ -1136,7 +1137,7 @@ public class UpdateSite {
return deps;
}
-
+
public boolean isForNewerHudson() {
try {
return requiredCore!=null && new VersionNumber(requiredCore).isNewerThan( | Export whether plugin update is compatible (#<I>)
* Export if plugin update is compatible
* Remove the erorr usage of Exported annoation
* Remove unclear export annotation | jenkinsci_jenkins | train | java |
a6a4b7451449af43ba4358e467c87f3b2baf0a62 | diff --git a/spec/standalone_migrations_spec.rb b/spec/standalone_migrations_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/standalone_migrations_spec.rb
+++ b/spec/standalone_migrations_spec.rb
@@ -87,6 +87,7 @@ end
end
before do
+ StandaloneMigrations::Configurator.instance_variable_set(:@env_config, nil)
`rm -rf spec/tmp` if File.exist?('spec/tmp')
`mkdir spec/tmp`
write_rakefile
@@ -98,6 +99,9 @@ development:
test:
adapter: sqlite3
database: db/test.sql
+production:
+ adapter: sqlite3
+ database: db/production.sql
TXT
end
@@ -121,7 +125,7 @@ test:
describe 'callbacks' do
it 'runs the callbacks' do
- expect(StandaloneMigrations::Tasks).to receive(:configure)
+ expect(StandaloneMigrations::Tasks).to receive(:configure).and_call_original
connection_established = false
expect(ActiveRecord::Base).to receive(:establish_connection) do | Unset class level config var in specs and allow configure to rerun to
pick up production config block | thuss_standalone-migrations | train | rb |
b16cd0afa3ef0a8dbb130ce29ecd9a9ea6696d37 | diff --git a/tests/test_content.py b/tests/test_content.py
index <HASH>..<HASH> 100644
--- a/tests/test_content.py
+++ b/tests/test_content.py
@@ -271,7 +271,7 @@ class MockTestEndpoint(object):
self.td_error = td_error
self.found_tiers = []
- def _tier_test(self, err, xpi):
+ def _tier_test(self, err, xpi, name):
"A simulated test case for tier errors"
print "Generating subpackage tier error..."
self.found_tiers.append(err.tier)
diff --git a/validator/testcases/content.py b/validator/testcases/content.py
index <HASH>..<HASH> 100644
--- a/validator/testcases/content.py
+++ b/validator/testcases/content.py
@@ -146,7 +146,7 @@ def test_packed_packages(err, xpi_package=None):
# There are no expected types for packages within a multi-
# item package.
- testendpoint_validator.test_package(err, name)
+ testendpoint_validator.test_package(err, package, name)
package.close()
err.pop_state() | Fix for content problem caused by merge. FML. | mozilla_amo-validator | train | py,py |
175af98593cde718da6fb83a1878b23667489dd9 | diff --git a/system/modules/generalDriver/DcGeneral/DataDefinition/AbstractConditionChain.php b/system/modules/generalDriver/DcGeneral/DataDefinition/AbstractConditionChain.php
index <HASH>..<HASH> 100644
--- a/system/modules/generalDriver/DcGeneral/DataDefinition/AbstractConditionChain.php
+++ b/system/modules/generalDriver/DcGeneral/DataDefinition/AbstractConditionChain.php
@@ -141,9 +141,11 @@ abstract class AbstractConditionChain implements ConditionChainInterface
public function __clone()
{
$conditions = array();
- foreach ($conditions as $index => $condition)
+ foreach ($this->conditions as $condition)
{
- $conditions[$index] = clone $condition;
+ $bobaFett = clone $condition;
+
+ $conditions[spl_object_hash($bobaFett)] = $bobaFett;
}
$this->conditions = $conditions;
} | Bugfix: correctly clone sub conditions in condition chains. | contao-community-alliance_dc-general | train | php |
acd620fa49110421e15166cbe92a3814e32ac93b | diff --git a/docs/scripts/phenomic.browser.js b/docs/scripts/phenomic.browser.js
index <HASH>..<HASH> 100644
--- a/docs/scripts/phenomic.browser.js
+++ b/docs/scripts/phenomic.browser.js
@@ -10,7 +10,7 @@ import store from "../src/store.js"
import phenomicClient from "phenomic/lib/client"
phenomicClient({ metadata, routes, store })
-// md files processed via phenomic-loader to JSON && generate collection
+// md files processed via phenomic-loader to JSON & generate collection
let mdContext = require.context("../content", true, /\.md$/)
mdContext.keys().forEach(mdContext)
@@ -25,6 +25,7 @@ if (module.hot) {
mdContext.keys().forEach(requireUpdate)
})
+ // hot load app
module.hot.accept(
[ "../src/metadata.js", "../src/routes.js", "../src/store.js" ],
() => phenomicClient({ metadata, routes, store }) | Sync comment of docs/phenomic.browser with base theme | phenomic_phenomic | train | js |
55feeb019caa5ee8af028134a6fc6c6cd237d1a9 | diff --git a/nion/swift/FacadeQueued.py b/nion/swift/FacadeQueued.py
index <HASH>..<HASH> 100644
--- a/nion/swift/FacadeQueued.py
+++ b/nion/swift/FacadeQueued.py
@@ -2,6 +2,7 @@ import threading
all_classes = {
+ "API",
"Application",
"DataGroup",
"DataItem", | Fix Facade method calls on API. | nion-software_nionswift | train | py |
fea6f5d8ed2526e2c7b72e4618d3529757401698 | diff --git a/shared/base/collection.js b/shared/base/collection.js
index <HASH>..<HASH> 100644
--- a/shared/base/collection.js
+++ b/shared/base/collection.js
@@ -12,6 +12,8 @@ if (!isServer) {
var BaseCollection = Super.extend({
model: BaseModel,
+ params: undefined,
+ meta: undefined,
/**
* Provide the ability to set default params for every 'fetch' call. | creating undefined attribuets for params and meta. this is a performance tweak that effects every instance of a collection. | rendrjs_rendr | train | js |
10826dc17c91f77e00ab0a78b5e9aa9c464666df | diff --git a/apollo-api-impl/src/main/java/com/spotify/apollo/request/TrackedOngoingRequestImpl.java b/apollo-api-impl/src/main/java/com/spotify/apollo/request/TrackedOngoingRequestImpl.java
index <HASH>..<HASH> 100644
--- a/apollo-api-impl/src/main/java/com/spotify/apollo/request/TrackedOngoingRequestImpl.java
+++ b/apollo-api-impl/src/main/java/com/spotify/apollo/request/TrackedOngoingRequestImpl.java
@@ -45,10 +45,7 @@ class TrackedOngoingRequestImpl
if (removed) {
super.reply(message);
}
- // TODO: how to log this?
-// else {
-// logRequest("DROPPED");
-// }
+
return removed;
}
} | remove comment about logging dropped requests
It's the job of the delegate OngoingRequest implementation to log in an
appropriate way when the message is dropped | spotify_apollo | train | java |
615a78a06b9aaa55f65b817e872e3e453c666c11 | diff --git a/source/BrowserAgentInfosByDanielGP.php b/source/BrowserAgentInfosByDanielGP.php
index <HASH>..<HASH> 100644
--- a/source/BrowserAgentInfosByDanielGP.php
+++ b/source/BrowserAgentInfosByDanielGP.php
@@ -157,7 +157,7 @@ trait BrowserAgentInfosByDanielGP
$userAgent = $_SERVER['HTTP_USER_AGENT'];
}
$dd = new \DeviceDetector\DeviceDetector($userAgent);
- $dd->setCache(new \Doctrine\Common\Cache\PhpFileCache(ini_get('upload_tmp_dir') . 'DoctrineCache/'));
+ $dd->setCache(new \Doctrine\Common\Cache\PhpFileCache('../tmp/DoctrineCache/'));
$dd->discardBotInformation();
$dd->parse();
if ($dd->isBot()) { | local temporary folder for Doctrine Cache to be able to use it in shared hosting environments | danielgp_common-lib | train | php |
b5c33e1c8c662eb9a6fe780d855bfcb6a98c1769 | diff --git a/pkg/kubectl/resource_printer.go b/pkg/kubectl/resource_printer.go
index <HASH>..<HASH> 100644
--- a/pkg/kubectl/resource_printer.go
+++ b/pkg/kubectl/resource_printer.go
@@ -109,6 +109,9 @@ func NewVersionedPrinter(printer ResourcePrinter, convertor runtime.ObjectConver
// PrintObj implements ResourcePrinter
func (p *VersionedPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
+ if len(p.version) == 0 {
+ return fmt.Errorf("no version specified, object cannot be converted")
+ }
converted, err := p.convertor.ConvertToVersion(obj, p.version)
if err != nil {
return err | Prevent internal conversion in the printer directly (as per implicit contract) | kubernetes_kubernetes | train | go |
7954b9eac0a36b136bb3001a039d0a1af3688602 | diff --git a/source/class/qx/tool/cli/commands/Compile.js b/source/class/qx/tool/cli/commands/Compile.js
index <HASH>..<HASH> 100644
--- a/source/class/qx/tool/cli/commands/Compile.js
+++ b/source/class/qx/tool/cli/commands/Compile.js
@@ -43,6 +43,10 @@ qx.Class.define("qx.tool.cli.commands.Compile", {
requiresArg: true,
type: "string"
},
+ "output-path-prefix": {
+ describe: "Sets a prefix for the output path of the target - used to compile a version into a non-standard directory",
+ type: "string"
+ },
"download": {
alias: "d",
describe: "Whether to automatically download missing libraries",
@@ -642,6 +646,9 @@ qx.Class.define("qx.tool.cli.commands.Compile", {
}
var outputPath = targetConfig.outputPath;
+ if (this.argv.outputPathPrefix) {
+ outputPath = path.join(this.argv.outputPathPrefix, outputPath);
+ }
if (!outputPath) {
throw new qx.tool.utils.Utils.UserError("Missing output-path for target " + targetConfig.type);
} | adds `--output-path-prefix` to `qx compile` (needed for deployment) (#<I>)
* adds `--output-path-prefix` to `qx compile` (needed for deployment)
* lint
Thanks @johnspackman ! | qooxdoo_qooxdoo-compiler | train | js |
36cbf2c87bfdeb5f8e84421fa2c20e5b206cc118 | diff --git a/condorpy/htcondor_object_base.py b/condorpy/htcondor_object_base.py
index <HASH>..<HASH> 100644
--- a/condorpy/htcondor_object_base.py
+++ b/condorpy/htcondor_object_base.py
@@ -56,7 +56,7 @@ class HTCondorObjectBase(object):
@property
def num_jobs(self):
- return 0
+ return 1
@property
def scheduler(self): | Default num_jobs to 1 instead of 0. | tethysplatform_condorpy | train | py |
2b11aa1ed5ad33b196a692717b599dc8e428d6ac | diff --git a/charmhelpers/contrib/network/ip.py b/charmhelpers/contrib/network/ip.py
index <HASH>..<HASH> 100644
--- a/charmhelpers/contrib/network/ip.py
+++ b/charmhelpers/contrib/network/ip.py
@@ -405,10 +405,10 @@ def is_ip(address):
Returns True if address is a valid IP address.
"""
try:
- # Test to see if already an IPv4 address
- socket.inet_aton(address)
+ # Test to see if already an IPv4/IPv6 address
+ address = netaddr.IPAddress(address)
return True
- except socket.error:
+ except netaddr.AddrFormatError:
return False
diff --git a/tests/contrib/network/test_ip.py b/tests/contrib/network/test_ip.py
index <HASH>..<HASH> 100644
--- a/tests/contrib/network/test_ip.py
+++ b/tests/contrib/network/test_ip.py
@@ -590,6 +590,7 @@ class IPTest(unittest.TestCase):
def test_is_ip(self):
self.assertTrue(net_ip.is_ip('10.0.0.1'))
+ self.assertTrue(net_ip.is_ip('2001:db8:1:0:2918:3444:852:5b8a'))
self.assertFalse(net_ip.is_ip('www.ubuntu.com'))
@patch('charmhelpers.contrib.network.ip.apt_install') | Ensure is_ip detects IPv4 and IPv6 addresses
Switch underlying implementation to use netaddr to detect both
types of IP address, rather than inet_aton which only supports
IPv4. | juju_charm-helpers | train | py,py |
735fcbd32d404423bfbce055ea875e07401724f8 | diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -839,8 +839,9 @@ cache(function(data, match, sendBadge, request) {
}
}
}
-
- badgeText = unstableVersion;
+
+ var vdata = versionColor(unstableVersion);
+ badgeText = vdata.version;
badgeColor = 'orange';
}
break; | Packagist unstable version display & cleanup
Part of #<I> | badges_shields | train | js |
c0af060e8e58da7dfb204eb41433a38016f50389 | diff --git a/gwpy/plotter/timeseries.py b/gwpy/plotter/timeseries.py
index <HASH>..<HASH> 100644
--- a/gwpy/plotter/timeseries.py
+++ b/gwpy/plotter/timeseries.py
@@ -451,14 +451,12 @@ class TimeSeriesPlot(Plot):
"'bottom'.")
segax = divider.append_axes(location, height, pad=pad,
axes_class=SegmentAxes, sharex=ax)
- segax.set_xscale(ax.get_xscale())
+ segax.set_xlim(*ax.get_xlim())
+ segax.set_xlabel(ax.get_xlabel())
+ ax.set_xlabel("")
- # plot segments and set axes properties
+ # plot segments
segax.plot(segments, **plotargs)
segax.grid(b=False, which='both', axis='y')
segax.autoscale(axis='y', tight=True)
- # set ticks and label
- segax.set_xlabel(ax.get_xlabel())
- ax.set_xlabel("")
- segax.set_xlim(*ax.get_xlim())
return segax | TimeSeriesPlot.add_state_segments: simplified segax scaling
new axes inherits scaling and limits from the original data axes, so we don't need to set_epoch or set_xscale | gwpy_gwpy | train | py |
e0574b180bc87097b9e944a29ab9b44f8a0eda51 | diff --git a/src/peltak/commands/test.py b/src/peltak/commands/test.py
index <HASH>..<HASH> 100644
--- a/src/peltak/commands/test.py
+++ b/src/peltak/commands/test.py
@@ -9,11 +9,6 @@ from . import cli, click
@cli.command()
@click.argument('tests_type', metavar='<type>', type=str, default='default')
@click.option(
- '--no-sugar',
- is_flag=True,
- help="Disable py-test sugar."
-)
-@click.option(
'-v', '--verbose',
count=True,
help=("Be verbose. Can specify multiple times for more verbosity. This "
@@ -48,8 +43,7 @@ from . import cli, click
"will be enabled.")
)
def test(
- tests_type, no_sugar, verbose, junit, no_locals,
- no_coverage, plugins, allow_empty
+ tests_type, verbose, junit, no_locals, no_coverage, plugins, allow_empty
):
""" Run tests against the current python version.
@@ -138,9 +132,6 @@ def test(
elif django_settings is not None:
args += ['--ds {}'.format(django_settings)]
- if no_sugar:
- args += ['-p no:sugar']
-
if verbose >= 1:
args += ['-v']
if verbose >= 2: | Remove —no-sugar option
The same can be achieved with —plugins=-sugar | novopl_peltak | train | py |
ffd309b17ccd01716cb979a2efc6a0401c0a0cd4 | diff --git a/src/Pool.php b/src/Pool.php
index <HASH>..<HASH> 100644
--- a/src/Pool.php
+++ b/src/Pool.php
@@ -50,9 +50,6 @@ class Pool implements PromisorInterface
$opts = [];
}
- // Add a delay by default to ensure resolving on future tick.
- $opts['delay'] = true;
-
$iterable = \GuzzleHttp\Promise\iter_for($requests);
$requests = function () use ($iterable, $client, $opts) {
foreach ($iterable as $rfn) { | Delay of true is no longer necessary | guzzle_guzzle | train | php |
b6e257b5753202a1cedacb1e1309474d8e4ee6db | diff --git a/Kwc/Directories/List/ViewMap/MarkersController.php b/Kwc/Directories/List/ViewMap/MarkersController.php
index <HASH>..<HASH> 100644
--- a/Kwc/Directories/List/ViewMap/MarkersController.php
+++ b/Kwc/Directories/List/ViewMap/MarkersController.php
@@ -76,4 +76,9 @@ class Kwc_Directories_List_ViewMap_MarkersController extends Kwf_Controller_Acti
protected function _validateSessionToken()
{
}
+
+ protected function _isAllowedComponent()
+ {
+ return true;
+ }
} | MapView: Controller has to be public for frontend | koala-framework_koala-framework | 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.