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 |
|---|---|---|---|---|---|
a8d75d218187ee7b97cf2285c23ae9f8c5f6f4a6 | diff --git a/tests/VObject/Component/VAvailabilityTest.php b/tests/VObject/Component/VAvailabilityTest.php
index <HASH>..<HASH> 100644
--- a/tests/VObject/Component/VAvailabilityTest.php
+++ b/tests/VObject/Component/VAvailabilityTest.php
@@ -284,6 +284,42 @@ VCAL
}
}
+ function testRFCxxxSection3_2() {
+
+ $this->assertEquals(
+ 'BUSY',
+ Reader::read($this->templateAvailable(array(
+ 'BUSYTYPE:BUSY'
+ )))
+ ->VAVAILABILITY
+ ->AVAILABLE
+ ->BUSYTYPE
+ ->getValue()
+ );
+
+ $this->assertEquals(
+ 'BUSY-UNAVAILABLE',
+ Reader::read($this->templateAvailable(array(
+ 'BUSYTYPE:BUSY-UNAVAILABLE'
+ )))
+ ->VAVAILABILITY
+ ->AVAILABLE
+ ->BUSYTYPE
+ ->getValue()
+ );
+
+ $this->assertEquals(
+ 'BUSY-TENTATIVE',
+ Reader::read($this->templateAvailable(array(
+ 'BUSYTYPE:BUSY-TENTATIVE'
+ )))
+ ->VAVAILABILITY
+ ->AVAILABLE
+ ->BUSYTYPE
+ ->getValue()
+ );
+
+ }
protected function assertIsValid(VObject\Document $document) { | Add tests for Section <I> of draft…-availability…. | sabre-io_vobject | train | php |
24906a2c78c6e1b23a150e773b30d67c0d753356 | diff --git a/test/unit/test_file_logger.js b/test/unit/test_file_logger.js
index <HASH>..<HASH> 100644
--- a/test/unit/test_file_logger.js
+++ b/test/unit/test_file_logger.js
@@ -32,6 +32,10 @@ function makeLogger(parent, levels) {
return logger;
}
+after(function () {
+ fs.unlinkSync('test.log');
+});
+
var stub = require('./auto_release_stub').make();
describe('File Logger', function () { | after running the file logger tests, get rid of the test.log file. | elastic_elasticsearch-js | train | js |
0f1ee486fc37975bee179ee6ff2c71b64ea1eb3c | diff --git a/src/regexp.js b/src/regexp.js
index <HASH>..<HASH> 100644
--- a/src/regexp.js
+++ b/src/regexp.js
@@ -1,5 +1,5 @@
/**
- * @file Regular Expession helper
+ * @file Regular Expression helper
* @since 0.2.1
*/
/*#ifndef(UMD)*/ | Documentation (#<I>) | ArnaudBuchholz_gpf-js | train | js |
3df8d6b0be09106bdad4c90cfd7ba82b73a0f904 | diff --git a/law/target/file.py b/law/target/file.py
index <HASH>..<HASH> 100644
--- a/law/target/file.py
+++ b/law/target/file.py
@@ -18,7 +18,7 @@ import luigi
import luigi.task
from law.target.base import Target
-from law.util import colored
+from law.util import colored, create_hash
class FileSystem(luigi.target.FileSystem):
@@ -26,8 +26,8 @@ class FileSystem(luigi.target.FileSystem):
def __repr__(self):
return "{}({})".format(self.__class__.__name__, hex(id(self)))
- def hash(self, path, l=8):
- return str(abs(hash(self.__class__.__name__ + self.abspath(path))))[-l:]
+ def hash(self, path, l=10):
+ return create_hash(self.__class__.__name__ + self.abspath(path))
def dirname(self, path):
return os.path.dirname(path) if path != "/" else None
@@ -35,7 +35,7 @@ class FileSystem(luigi.target.FileSystem):
def basename(self, path):
return os.path.basename(path) if path != "/" else "/"
- def unique_basename(self, path, l=8):
+ def unique_basename(self, path, l=10):
return self.hash(path, l=l) + "_" + self.basename(path)
def ext(self, path, n=1): | Refine file target hashing. | riga_law | train | py |
09e9d2c046f0c5cf59b0514c14ce9894ae712289 | diff --git a/src/Dialog.js b/src/Dialog.js
index <HASH>..<HASH> 100644
--- a/src/Dialog.js
+++ b/src/Dialog.js
@@ -177,7 +177,7 @@ OO.ui.Dialog.prototype.getActionProcess = function ( action ) {
* @inheritdoc
*
* @param {Object} [data] Dialog opening data
- * @param {jQuery|string|Function|null} [data.label] Dialog label, omit to use #static-label
+ * @param {jQuery|string|Function|null} [data.title] Dialog title, omit to use #static-title
* @param {Object[]} [data.actions] List of OO.ui.ActionWidget configuration options for each
* action item, omit to use #static-actions
*/ | Fix documentation lies about dialog labels
They don't exist. They're called titles.
Change-Id: Ie8dd5f<I>d<I>d<I>d<I>d<I>df | wikimedia_oojs-ui | train | js |
fcf57ab11ca4d1f962cd23c3a5f9313898097eef | diff --git a/src/io/apiCurlIO.php b/src/io/apiCurlIO.php
index <HASH>..<HASH> 100644
--- a/src/io/apiCurlIO.php
+++ b/src/io/apiCurlIO.php
@@ -231,7 +231,7 @@ class apiCurlIO implements apiIO {
// Force the payload to match the content-type asserted in the header.
if ($contentType == self::FORM_URLENCODED && is_array($postBody)) {
- $postBody = http_build_query($postBody);
+ $postBody = http_build_query($postBody, '', '&');
$request->setPostBody($postBody);
} | [fix issue <I>] On some builds of PHP, http_build_query defaults to the delimiter "&" instead of "&".
This change will force the delimiter as "&" to avoid inconsistencies for consistent behavior across versions of PHP5.
Thank you ivandtoit for discovering this issue, and helping reproducing the issue.
git-svn-id: <URL> | evert_google-api-php-client | train | php |
33a4fcb1c6330f0899f20ccac5c956e60cdae9fe | diff --git a/examples/models/transform_jitter.py b/examples/models/transform_jitter.py
index <HASH>..<HASH> 100644
--- a/examples/models/transform_jitter.py
+++ b/examples/models/transform_jitter.py
@@ -96,6 +96,6 @@ distribution_callback.args['button'] = enable_button
title = Paragraph(text='Jitter Parameters')
spacer = Paragraph(text=' ')
-output_file("transforms.html", title="Example Transforms")
+output_file("transform_jitter.html", title="Example Transforms")
show(hplot(p, vplot(enable_button, spacer, title, spacer, center_slider, width_slider, distribution_dropdown))) | Set the filename correctly so the Travis CI will not error out. | bokeh_bokeh | train | py |
627ee74e4420e105c1f4b582afbe23265c264d20 | diff --git a/lib/parsers.js b/lib/parsers.js
index <HASH>..<HASH> 100644
--- a/lib/parsers.js
+++ b/lib/parsers.js
@@ -291,7 +291,7 @@ exports.parseColor = function parseColor(val) {
if (res) {
var defaultHex = val.substr(1);
var hex = val.substr(1);
- if ([3, 4].indexOf(defaultHex.length) > -1) {
+ if (hex.length === 3 || hex.length === 4) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
if (defaultHex.length === 4) { | Use explicit comparison to hex length | jsakas_CSSStyleDeclaration | train | js |
542bbd638de777ca27a16459b3f927b5c176dc07 | diff --git a/lib/arjdbc/postgresql/adapter.rb b/lib/arjdbc/postgresql/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/postgresql/adapter.rb
+++ b/lib/arjdbc/postgresql/adapter.rb
@@ -1172,7 +1172,7 @@ module ArJdbc
end
def truncate(table_name, name = nil)
- exec_query "TRUNCATE TABLE #{quote_table_name(table_name)}", name, []
+ execute "TRUNCATE TABLE #{quote_table_name(table_name)}", name
end
def index_name_exists?(table_name, index_name, default) | blindly ported truncate from AR ... shall use execute since exec_query assumes a result | jruby_activerecord-jdbc-adapter | train | rb |
951212e957eca3ad76fe5ea8ecc8005ec144d09e | diff --git a/lib/fog/cloudstack/models/compute/servers.rb b/lib/fog/cloudstack/models/compute/servers.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/cloudstack/models/compute/servers.rb
+++ b/lib/fog/cloudstack/models/compute/servers.rb
@@ -9,8 +9,9 @@ module Fog
model Fog::Compute::Cloudstack::Server
- def all
- data = service.list_virtual_machines["listvirtualmachinesresponse"]["virtualmachine"] || []
+ def all(attributes={})
+ response = service.list_virtual_machines(attributes)
+ data = response["listvirtualmachinesresponse"]["virtualmachine"] || []
load(data)
end | [cloudstack] servers collection, add attributes to :all method | fog_fog | train | rb |
f4d6498477d206c5fd78c9d813df70604b6e24a1 | diff --git a/src/scene.js b/src/scene.js
index <HASH>..<HASH> 100755
--- a/src/scene.js
+++ b/src/scene.js
@@ -988,12 +988,16 @@ Scene.prototype.setSourceMax = function () {
// Normalize some settings that may not have been explicitly specified in the scene definition
Scene.prototype.preProcessSceneConfig = function () {
// Pre-process styles
- for (var rule of Utils.recurseValues(this.config.layers)) {
- if (rule.style) {
- // Styles are visible by default
- if (rule.style.visible !== false) {
- rule.style.visible = true;
- }
+ // Ensure top-level layers have visible and order properties
+ for (let rule of Utils.values(this.config.layers)) {
+ rule.style = rule.style || {};
+
+ if (rule.style.visible == null) {
+ rule.style.visible = true;
+ }
+
+ if (rule.style.order == null) {
+ rule.style.order = 0;
}
}
@@ -1002,7 +1006,7 @@ Scene.prototype.preProcessSceneConfig = function () {
if (this.config.camera) {
this.config.cameras.default = this.config.camera;
}
- var camera_names = Object.keys(this.config.cameras);
+ let camera_names = Object.keys(this.config.cameras);
if (camera_names.length === 0) {
this.config.cameras.default = { active: true }; | style layers: ensure top-level visible and order props | tangrams_tangram | train | js |
f175538a73bf02b2ad0253c53d8c82f2d77eb63e | diff --git a/hamster/storage.py b/hamster/storage.py
index <HASH>..<HASH> 100644
--- a/hamster/storage.py
+++ b/hamster/storage.py
@@ -51,9 +51,9 @@ class Storage(object):
def remove_fact(self, fact_id):
fact = self.get_fact(fact_id)
- result = self.__remove_fact(fact_id)
- self.dispatch('day_updated', fact['start_time'])
- return result
+ if fact:
+ self.__remove_fact(fact_id)
+ self.dispatch('day_updated', fact['start_time'])
def get_sorted_activities(self):
return self.__get_sorted_activities() | check if there is fact to remove before trying to get rid of it
svn path=/trunk/; revision=<I> | projecthamster_hamster | train | py |
21b85c639cf6e2a40c1574a7035f279cc96edd21 | diff --git a/lib/nexpose/report_template.rb b/lib/nexpose/report_template.rb
index <HASH>..<HASH> 100644
--- a/lib/nexpose/report_template.rb
+++ b/lib/nexpose/report_template.rb
@@ -27,7 +27,7 @@ module Nexpose
# @param [String] template_id Unique identifier of the report template to remove.
#
def delete_report_template(template_id)
- AJAX.delete(self, "/data/report/templates/#{template_id}")
+ AJAX.delete(self, "/data/report/templates/#{URI.escape(template_id)}")
end
end | URI.escape a report template ID.
Report template IDs are not numeric and can contain characters which
cannot be passed without escaping through the URI. | rapid7_nexpose-client | train | rb |
6c9d839a33854f85af2c6fb3fc5039587f1d5704 | diff --git a/mindmaps-test/src/test/java/io/mindmaps/IntegrationUtils.java b/mindmaps-test/src/test/java/io/mindmaps/IntegrationUtils.java
index <HASH>..<HASH> 100644
--- a/mindmaps-test/src/test/java/io/mindmaps/IntegrationUtils.java
+++ b/mindmaps-test/src/test/java/io/mindmaps/IntegrationUtils.java
@@ -23,6 +23,7 @@ import ch.qos.logback.classic.Logger;
import io.mindmaps.engine.MindmapsEngineServer;
import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
import org.javatuples.Pair;
+import spark.Spark;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -39,13 +40,18 @@ public class IntegrationUtils {
}
public static void startTestEngine() throws Exception {
+ Spark.stop();
+ Thread.sleep(5000);
+
if (ENGINE_ON.compareAndSet(false, true)) {
hideLogs();
EmbeddedCassandraServerHelper.startEmbeddedCassandra("cassandra-embedded.yaml");
- MindmapsEngineServer.start();
hideLogs();
- sleep(5000);
+ Thread.sleep(5000);
}
+
+ MindmapsEngineServer.start();
+ sleep(5000);
}
public static Pair<MindmapsGraph, String> graphWithNewKeyspace() { | Restarting Engine on Integration Tests (#<I>) | graknlabs_grakn | train | java |
8e21884722aa264ca858502081d37476853a9a34 | diff --git a/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java b/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java
index <HASH>..<HASH> 100644
--- a/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java
+++ b/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java
@@ -48,7 +48,7 @@ public class AmpProjectPackagingTask
private final String id;
- public AmpProjectPackagingTask( Resource[] webResource, File moduleProperties)
+ public AmpProjectPackagingTask( Resource[] webResources, File moduleProperties)
{
if ( webResources != null )
{ | Issue #<I> - reproduced issue with Maven AMP Plugin <I> and <I> . Applied patch attached to issue and retested.
git-svn-id: <URL> | Alfresco_alfresco-sdk | train | java |
971a855036a6c1cedf197a4cced3cdca5f43137b | diff --git a/src/Gestalt/Configuration.php b/src/Gestalt/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/Gestalt/Configuration.php
+++ b/src/Gestalt/Configuration.php
@@ -45,9 +45,9 @@ class Configuration extends Observable implements ArrayAccess
public static function load($loader)
{
if ($loader instanceof Closure) {
- return new self($loader());
+ return new static($loader());
} elseif ($loader instanceof LoaderInterface) {
- return new self($loader->load());
+ return new static($loader->load());
}
} | Use late static binding on load method. | samrap_gestalt | train | php |
048ed8fa86330ddf4fe934ab0a29bf995ddc0217 | diff --git a/transforms/resample.go b/transforms/resample.go
index <HASH>..<HASH> 100644
--- a/transforms/resample.go
+++ b/transforms/resample.go
@@ -13,6 +13,9 @@ func Resample(buf *audio.PCMBuffer, fs float64) error {
if buf == nil || buf.Format == nil {
return audio.ErrInvalidBuffer
}
+ if buf.Format.SampleRate == int(fs) {
+ return nil
+ }
buf.SwitchPrimaryType(audio.Float)
// downsample | transforms: noop resampling if the target fs is similar to current | mattetti_audio | train | go |
e07721d2394786037224aad21de427f8857ee362 | diff --git a/scriptabit/__init__.py b/scriptabit/__init__.py
index <HASH>..<HASH> 100644
--- a/scriptabit/__init__.py
+++ b/scriptabit/__init__.py
@@ -18,6 +18,7 @@ from .scriptabit import start_cli
from .task import Task, Difficulty, CharacterAttribute
from .task_mapping import TaskMapping
from .task_service import TaskService
+from .task_sync import TaskSync
from .utility_functions import UtilityFunctions
diff --git a/scriptabit/tests/test_task_mapping.py b/scriptabit/tests/test_task_mapping.py
index <HASH>..<HASH> 100644
--- a/scriptabit/tests/test_task_mapping.py
+++ b/scriptabit/tests/test_task_mapping.py
@@ -22,12 +22,11 @@ from scriptabit import Task, TaskMapping
class TestTaskMapping(object):
- @classmethod
- def setup_class(cls):
- cls.tm = TaskMapping()
- cls.src = Task(id='1')
- cls.dst = Task(id='a')
- cls.missing = Task(id='blah')
+ def setup(self):
+ self.tm = TaskMapping()
+ self.src = Task(id='1')
+ self.dst = Task(id='a')
+ self.missing = Task(id='blah')
def test_persist_task_mapping(self):
expected = TaskMapping() | fixed some class methods in tests, added stubs for task sync code | DC23_scriptabit | train | py,py |
a4f6e1dc807fddb9d148ec1191ae3b5cd2f26e6c | diff --git a/packages/@vue/cli-service/ui.js b/packages/@vue/cli-service/ui.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/cli-service/ui.js
+++ b/packages/@vue/cli-service/ui.js
@@ -1,3 +1,5 @@
+/* eslint-disable vue-libs/no-async-functions */
+
module.exports = api => {
const { setSharedData, getSharedData } = api.namespace('webpack-dashboard-') | fix(ui): eslint disaled rule | vuejs_vue-cli | train | js |
4d3a9feb47171182579594e39d38bb219edd9384 | diff --git a/pykwalify/rule.py b/pykwalify/rule.py
index <HASH>..<HASH> 100644
--- a/pykwalify/rule.py
+++ b/pykwalify/rule.py
@@ -82,7 +82,7 @@ class Rule(object):
"enum": self.initEnumValue,
"assert": self.initAssertValue,
"range": self.initRangeValue,
- "length": self.initRangeValue,
+ "length": self.initLengthValue,
"ident": self.initIdentValue,
"unique": self.initUniqueValue,
"allowempty": self.initAllowEmptyMap, | Fixed typo in previous code refactoring | Grokzen_pykwalify | train | py |
559a39ee62835fc8d8aac1ed3f6d94b65106d865 | diff --git a/jquery.flot.js b/jquery.flot.js
index <HASH>..<HASH> 100644
--- a/jquery.flot.js
+++ b/jquery.flot.js
@@ -745,10 +745,17 @@
$(c).appendTo(placeholder);
- if (!c.getContext) // excanvas hack
- c = window.G_vmlCanvasManager.initElement(c);
+ // If HTML5 Canvas isn't available, fall back to Excanvas
- var cctx = c.getContext("2d");
+ if (!c.getContext) {
+ if (window.G_vmlCanvasManager) {
+ c = window.G_vmlCanvasManager.initElement(c);
+ } else {
+ throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");
+ }
+ }
+
+ var cctx = c.getContext("2d");
// Increase the canvas density based on the display's pixel ratio; basically
// giving the canvas more pixels without increasing the size of its element, | Throw a nice exception when Excanvas is missing. | ni-kismet_engineering-flot | train | js |
107c742ab0cb627c53a92fc4c6d4174de20fd689 | diff --git a/spec/hutch/worker_spec.rb b/spec/hutch/worker_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/hutch/worker_spec.rb
+++ b/spec/hutch/worker_spec.rb
@@ -75,10 +75,10 @@ describe Hutch::Worker do
worker.handle_message(consumer, delivery_info, properties, payload)
end
end
+
context "when the payload is not valid json" do
let(:payload) { "Not Valid JSON" }
-
it 'logs the error' do
Hutch::Config[:error_handlers].each do |backend|
backend.should_receive(:handle) | Updated style per hmarr | gocardless_hutch | train | rb |
4f51dcb589bf2f242a3663b75ee51deb3d518a98 | diff --git a/lib/jsonapi/resource.rb b/lib/jsonapi/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/jsonapi/resource.rb
+++ b/lib/jsonapi/resource.rb
@@ -486,7 +486,7 @@ module JSONAPI
records
end
- def apply_sort(records, order_options, options = {})
+ def apply_sort(records, order_options, _options = {})
if order_options.any?
records.order(order_options)
else | rename options to _options for consistency | cerebris_jsonapi-resources | train | rb |
d63c57094557ded83f2ebb9f41a7565cec41415d | diff --git a/lib/rails-api/public_exceptions.rb b/lib/rails-api/public_exceptions.rb
index <HASH>..<HASH> 100644
--- a/lib/rails-api/public_exceptions.rb
+++ b/lib/rails-api/public_exceptions.rb
@@ -42,7 +42,7 @@ module Rails
if found || File.exist?(path)
body = File.read(path)
- [status, {'Content-Type' => "text/html; charset=#{Response.default_charset}", 'Content-Length' => body.bytesize.to_s}, [body]]
+ [status, {'Content-Type' => "text/html; charset=#{ActionDispatch::Response.default_charset}", 'Content-Length' => body.bytesize.to_s}, [body]]
else
[404, { "X-Cascade" => "pass" }, []]
end | Fully qualify constant in public exceptions for html format | rails-api_rails-api | train | rb |
455b3b50a28c9718b9005e96050da6a0931d958e | diff --git a/dimod/binary_quadratic_model.py b/dimod/binary_quadratic_model.py
index <HASH>..<HASH> 100644
--- a/dimod/binary_quadratic_model.py
+++ b/dimod/binary_quadratic_model.py
@@ -1854,7 +1854,7 @@ class BinaryQuadraticModel(abc.Sized, abc.Container, abc.Iterable):
BinaryQuadraticModel({1: 1, 2: 2, 3: 3, 4: 4}, {(1, 2): 12, (1, 3): 13, (1, 4): 14, (2, 3): 23, (3, 4): 34, (2, 4): 24}, 0.0, Vartype.SPIN)
"""
- if not isinstance(h, abc.Mapping):
+ if isinstance(h, abc.Sequence):
h = dict(enumerate(h))
return cls(h, J, offset, Vartype.SPIN) | Accept iterators in BQM.from_ising | dwavesystems_dimod | train | py |
ca8693be64bc29801194375d0886c6a65c5f45e0 | diff --git a/code/libraries/joomlatools/component/koowa/dispatcher/behavior/decoratable.php b/code/libraries/joomlatools/component/koowa/dispatcher/behavior/decoratable.php
index <HASH>..<HASH> 100644
--- a/code/libraries/joomlatools/component/koowa/dispatcher/behavior/decoratable.php
+++ b/code/libraries/joomlatools/component/koowa/dispatcher/behavior/decoratable.php
@@ -103,7 +103,7 @@ class ComKoowaDispatcherBehaviorDecoratable extends KControllerBehaviorAbstract
}
//Set the cache state
- JFactory::getApplication()->allowCache($context->getRequest()->isCacheable());
+ //JFactory::getApplication()->allowCache($context->getRequest()->isCacheable());
//Do not flush the response
return false; | #<I> - isCacheable() doesn't exist yet. | joomlatools_joomlatools-framework | train | php |
a7585c136e4bb1a2747e3f517af3b4288201cef5 | diff --git a/Elements/Fieldset/NestedFieldset.php b/Elements/Fieldset/NestedFieldset.php
index <HASH>..<HASH> 100755
--- a/Elements/Fieldset/NestedFieldset.php
+++ b/Elements/Fieldset/NestedFieldset.php
@@ -30,8 +30,10 @@ class NestedFieldset extends AbstractFieldset implements FieldsetInterface
$this->getChildren()->forAll(function (ElementInterface $child) use ($data, $accessor) {
if (null !== $propertyPath = $child->getPropertyPath(true)) {
- $value = $accessor->getValue($data, $propertyPath);
- $child->setValue($value);
+ if ($accessor->isReadable($data, $propertyPath)) {
+ $value = $accessor->getValue($data, $propertyPath);
+ $child->setValue($value);
+ }
}
});
} | Factory fixes, fixed repositories, tests, entities | WellCommerce_Form | train | php |
a86e06a21691432d4b0bb8d1339c1378f83d5160 | diff --git a/lib/compiler.js b/lib/compiler.js
index <HASH>..<HASH> 100644
--- a/lib/compiler.js
+++ b/lib/compiler.js
@@ -441,6 +441,8 @@ PEG.Compiler = {
var source = this.formatCode(
"(function(){",
+ " /* Generated by PEG.js (http://pegjs.majda.cz/). */",
+ " ",
" var result = {",
" _startRule: ${startRule|string},",
" ",
diff --git a/lib/metagrammar.js b/lib/metagrammar.js
index <HASH>..<HASH> 100644
--- a/lib/metagrammar.js
+++ b/lib/metagrammar.js
@@ -1,4 +1,6 @@
PEG.grammarParser = (function(){
+ /* Generated by PEG.js (http://pegjs.majda.cz/). */
+
var result = {
_startRule: "grammar", | Add "Generated by ..." message to the generated parsers. | pegjs_pegjs | train | js,js |
b0f4322abb656c787554eb6f709ba39a7c69290a | diff --git a/backend/cloud_inquisitor/plugins/commands/accounts.py b/backend/cloud_inquisitor/plugins/commands/accounts.py
index <HASH>..<HASH> 100644
--- a/backend/cloud_inquisitor/plugins/commands/accounts.py
+++ b/backend/cloud_inquisitor/plugins/commands/accounts.py
@@ -69,7 +69,8 @@ class DeleteAccount(BaseCommand):
if acct:
cfm = 'Are you absolutely sure you wish to delete the account named {}'.format(acct.account_name)
if confirm(cfm):
- acct.delete()
+ db.session.delete(acct)
+ db.session.commit()
self.log.info('Account {0} has been deleted'.format(kwargs['account_name']))
else:
self.log.info('Failed to verify account name, not deleting') | To fix #<I> - Accounts cant be deleted | RiotGames_cloud-inquisitor | train | py |
674299a184851b308b8010b676f5c12166c22ffa | diff --git a/test/ocsp_test.go b/test/ocsp_test.go
index <HASH>..<HASH> 100644
--- a/test/ocsp_test.go
+++ b/test/ocsp_test.go
@@ -130,6 +130,8 @@ func TestOCSPAlwaysMustStapleAndShutdown(t *testing.T) {
if err != nats.ErrNoServers {
t.Errorf("Expected connection refused")
}
+ // Verify that the server finishes shutdown
+ srv.WaitForShutdown()
}
func TestOCSPMustStapleShutdown(t *testing.T) { | Wait for complete server shutdown in a test | nats-io_gnatsd | train | go |
4e35586f224c7fe2d8a24c676b07e0bdab4ed579 | diff --git a/aws/resource_aws_launch_template_test.go b/aws/resource_aws_launch_template_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_launch_template_test.go
+++ b/aws/resource_aws_launch_template_test.go
@@ -1405,7 +1405,7 @@ resource "aws_launch_template" "test" {
}
}
}
-`, rName)
+`, rName) //lintignore:AWSAT002
}
func testAccAWSLaunchTemplateConfig_tagsUpdate(rName string) string { | Ignore hardcoded AMI because not actually used | terraform-providers_terraform-provider-aws | train | go |
71f5044c2c51cdd3fe55d2910e09d6378f06c30d | diff --git a/rollbar/__init__.py b/rollbar/__init__.py
index <HASH>..<HASH> 100644
--- a/rollbar/__init__.py
+++ b/rollbar/__init__.py
@@ -1129,8 +1129,13 @@ def _extract_wsgi_headers(items):
def _build_django_request_data(request):
+ try:
+ url = request.get_raw_uri()
+ except AttributeError:
+ url = request.build_absolute_uri()
+
request_data = {
- 'url': request.get_raw_uri(),
+ 'url': url,
'method': request.method,
'GET': dict(request.GET),
'POST': dict(request.POST), | added support for django <I> & <I> in _build_django_request_data (#<I>) | rollbar_pyrollbar | train | py |
adba1017340097cd8585bbf537aa968943e49632 | diff --git a/test/test_site.rb b/test/test_site.rb
index <HASH>..<HASH> 100644
--- a/test/test_site.rb
+++ b/test/test_site.rb
@@ -154,8 +154,8 @@ class TestSite < Test::Unit::TestCase
excludes = %w[README TODO]
files = %w[index.html site.css .htaccess]
- @site.exclude = excludes
- assert_equal files, @site.filter_entries(excludes + files)
+ @site.exclude = excludes + ["exclude*"]
+ assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])
end
should "not filter entries within include" do
@@ -163,7 +163,7 @@ class TestSite < Test::Unit::TestCase
files = %w[index.html _index.html .htaccess includeA]
@site.include = includes
- assert_equal files, @site.filter_entries(files + ["includeA"])
+ assert_equal files, @site.filter_entries(files)
end
context 'error handling' do | update test for include,exclude glob support | jekyll_jekyll | train | rb |
1aa1044fdcadcc9b331c9bdde2f0b44e6d873e76 | diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -1475,10 +1475,7 @@ function count_login_failures($mode, $username, $lastlogin) {
* @param mixed $object The data to be printed
*/
function print_object($object) {
-
- echo '<pre>';
- print_r($object);
- echo '</pre>';
+ echo '<pre>'.htmlspecialchars(print_r($object,true)).'</pre>';
} | MDL-<I> Changed print_object to escape html | moodle_moodle | train | php |
dde59800e1945816bb844d3027650a889f8f85a9 | 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
@@ -73,22 +73,13 @@ end
-# Helper to display spec descriptions.
-description_builder = -> hash do
- if g = hash[:example_group]
- "#{description_builder.call(g)} #{hash[:description_args].first}"
- else
- hash[:description_args].first
- end
-end
-
stdout = Logger.new(STDOUT)
RSpec.configure do |config|
config.around do |spec|
# Figure out which spec is about to run, for logging purposes.
data = spec.metadata
- desc = description_builder.call(data)
+ desc = data[:full_description]
line = "rspec #{data[:file_path]}:#{data[:line_number]}"
# Optionally log to STDOUT which spec is about to run. This is noisy, but | Fix deprecation warning with new RSpec. | chanks_que | train | rb |
0e3cd141eea2da944deb1e407b2dba21cb4db767 | diff --git a/presto-main/src/main/java/com/facebook/presto/transaction/InMemoryTransactionManager.java b/presto-main/src/main/java/com/facebook/presto/transaction/InMemoryTransactionManager.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/transaction/InMemoryTransactionManager.java
+++ b/presto-main/src/main/java/com/facebook/presto/transaction/InMemoryTransactionManager.java
@@ -584,12 +584,13 @@ public class InMemoryTransactionManager
private synchronized ListenableFuture<?> abortInternal()
{
// the callbacks in statement performed on another thread so are safe
- return nonCancellationPropagating(Futures.allAsList(Stream.concat(
+ List<ListenableFuture<?>> abortFutures = Stream.concat(
functionNamespaceTransactions.values().stream()
.map(transactionMetadata -> finishingExecutor.submit(() -> safeAbort(transactionMetadata))),
connectorIdToMetadata.values().stream()
.map(connection -> finishingExecutor.submit(() -> safeAbort(connection))))
- .collect(toList())));
+ .collect(toList());
+ return nonCancellationPropagating(Futures.allAsList(abortFutures));
}
private static void safeAbort(ConnectorTransactionMetadata connection) | Fix incompatible types error on jdk 9 and <I> | prestodb_presto | train | java |
0884c9fb2676591cdd6332f61447bc3685263708 | diff --git a/bct/algorithms/distance.py b/bct/algorithms/distance.py
index <HASH>..<HASH> 100644
--- a/bct/algorithms/distance.py
+++ b/bct/algorithms/distance.py
@@ -685,7 +685,7 @@ def findwalks(CIJ):
return Wq, twalk, wlq
-def reachdist(CIJ):
+def reachdist(CIJ, ensure_binary=True):
'''
The binary reachability matrix describes reachability between all pairs
of nodes. An entry (u,v)=1 means that there exists a path from node u
@@ -700,6 +700,10 @@ def reachdist(CIJ):
----------
CIJ : NxN np.ndarray
binary directed/undirected connection matrix
+ ensure_binary : bool
+ Binarizes input. Defaults to true. No user who is not testing
+ something will ever want to not use this, use distance_wei instead for
+ unweighted matrices.
Returns
-------
@@ -722,6 +726,9 @@ def reachdist(CIJ):
R, D, powr = reachdist2(CIJ, CIJpwr, R, D, n, powr, col, row)
return R, D, powr
+ if ensure_binary:
+ CIJ = binarize(CIJ)
+
R = CIJ.copy()
D = CIJ.copy()
powr = 2 | uncommited changes to distance functions | aestrivex_bctpy | train | py |
af365f778e4a44d7bbbf1e5c77c266fd2889cec9 | diff --git a/rewind/server/test/test_rewind.py b/rewind/server/test/test_rewind.py
index <HASH>..<HASH> 100644
--- a/rewind/server/test/test_rewind.py
+++ b/rewind/server/test/test_rewind.py
@@ -17,6 +17,7 @@
"""Test overall Rewind execution."""
from __future__ import print_function
import contextlib
+import re
import shutil
import sys
import tempfile
@@ -24,7 +25,6 @@ import threading
import time
import unittest
import uuid
-import re
import zmq | Sorting imports in alphabetical order | JensRantil_rewind | train | py |
e09de09277f29fd7a604c574ee9cc222d3676e32 | diff --git a/views/cypress/tests/search-advanced.spec.js b/views/cypress/tests/search-advanced.spec.js
index <HASH>..<HASH> 100644
--- a/views/cypress/tests/search-advanced.spec.js
+++ b/views/cypress/tests/search-advanced.spec.js
@@ -122,4 +122,4 @@
cy.getSettled(selectorsTAO.search.modal.closeButton)
.click();
});
-});
\ No newline at end of file
+}); | chore: add new line at eof | oat-sa_extension-tao-item | train | js |
a8ca0184c3ba9f31ff3996cfd7e6a8af867b15e7 | diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php
index <HASH>..<HASH> 100755
--- a/code/model/UserDefinedForm.php
+++ b/code/model/UserDefinedForm.php
@@ -548,7 +548,7 @@ class UserDefinedForm_Controller extends Page_Controller {
foreach($this->Fields() as $field) {
$messages[$field->Name] = $field->getErrorMessage()->HTML();
- if($field->Required && $field->CustomRules()->Count() == 0) {
+ if($field->Required) {
$rules[$field->Name] = array_merge(array('required' => true), $field->getValidation());
$required->addRequiredField($field->Name);
}
@@ -570,7 +570,7 @@ class UserDefinedForm_Controller extends Page_Controller {
(function($) {
$(document).ready(function() {
$("#Form_Form").validate({
- ignore: [':hidden'],
+ ignore: ':hidden'`,
errorClass: "required",
errorPlacement: function(error, element) {
if(element.is(":radio")) { | FIX: validate required fields even with rules. (Fixes #<I>) | silverstripe_silverstripe-userforms | train | php |
14d017a03119d70dd30231a6eebf3389108e49b5 | diff --git a/lib/shopify_api/cli.rb b/lib/shopify_api/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/shopify_api/cli.rb
+++ b/lib/shopify_api/cli.rb
@@ -51,7 +51,7 @@ module ShopifyAPI
file = config_file(connection)
if File.exist?(file)
if ENV['EDITOR'].present?
- `#{ENV['EDITOR']} #{file}`
+ system(ENV['EDITOR'], file)
else
puts "Please set an editor in the EDITOR environment variable"
end | Allow command line editor to output to terminal on edit task.
Executing a command with backticks redirects the output to return
it as a string, but this prevents editors like vim from showing the
file being edited. | Shopify_shopify_api | train | rb |
e1a4a15eabe79d1b1e1422d9b00c58cd5e3cc540 | diff --git a/src/LogglyBulkLogger.php b/src/LogglyBulkLogger.php
index <HASH>..<HASH> 100644
--- a/src/LogglyBulkLogger.php
+++ b/src/LogglyBulkLogger.php
@@ -99,7 +99,7 @@ final class LogglyBulkLogger extends AbstractLogglyLogger
'Content-Type' => 'application/json',
'Content-Length' => strlen($data),
],
- '1.1'
+ $data
);
}
}
diff --git a/src/LogglyLogger.php b/src/LogglyLogger.php
index <HASH>..<HASH> 100644
--- a/src/LogglyLogger.php
+++ b/src/LogglyLogger.php
@@ -41,7 +41,7 @@ final class LogglyLogger extends AbstractLogglyLogger
'Content-Type' => 'application/json',
'Content-Length' => strlen($data),
],
- '1.1'
+ $data
);
}
} | Send the logs to Loggly
The initial refactoring contained a bug that would send the HTTP version to logly, not the log lines it is supposed to. | WyriHaximus_reactphp-psr-3-loggly | train | php,php |
4e49a5a172e790a46bf3522dcdf4a234d7a1f34a | diff --git a/tests/SimpleThings/Tests/EntityAudit/FunctionalTest.php b/tests/SimpleThings/Tests/EntityAudit/FunctionalTest.php
index <HASH>..<HASH> 100755
--- a/tests/SimpleThings/Tests/EntityAudit/FunctionalTest.php
+++ b/tests/SimpleThings/Tests/EntityAudit/FunctionalTest.php
@@ -227,7 +227,7 @@ class ArticleAudit
/** @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue */
private $id;
- /** @ORM\Column(type="string") */
+ /** @ORM\Column(type="string", name="my_title_column") */
private $title;
/** @ORM\Column(type="text") */ | Update tests/SimpleThings/Tests/EntityAudit/FunctionalTest.php
Fails with own column name | simplethings_EntityAuditBundle | train | php |
7a8d795574475fa358d925a6a745ad2edd86b0dc | diff --git a/src/BolOpenApi/Factory/ModelFactory.php b/src/BolOpenApi/Factory/ModelFactory.php
index <HASH>..<HASH> 100644
--- a/src/BolOpenApi/Factory/ModelFactory.php
+++ b/src/BolOpenApi/Factory/ModelFactory.php
@@ -198,6 +198,11 @@ class ModelFactory
public function createOffers(\SimpleXMLElement $xmlElement)
{
$offers = new Offers();
+
+ if (!isset($xmlElement) || $xmlElement->count() <= 0) {
+ return $offers;
+ }
+
foreach ($xmlElement->children() as $child) {
if ($child->getName() == 'Offer') {
$offers->addOffer($this->createOffer($child)); | Fixed issue with warning Node no longer exists when offers are not present in the offer node | netvlies_bol-openapi-php-sdk | train | php |
3a9e476904601996d80f942605ea8afe0adf75e4 | diff --git a/godbf/dbfio.go b/godbf/dbfio.go
index <HASH>..<HASH> 100644
--- a/godbf/dbfio.go
+++ b/godbf/dbfio.go
@@ -114,7 +114,7 @@ func deriveFieldName(s []byte, dt *DbfTable, offset int) (string, error) {
return "", errors.New(msg)
}
- fieldName := dt.encoder.ConvertString(string(nameBytes[:endOfFieldIndex]))
+ fieldName := dt.decoder.ConvertString(string(nameBytes[:endOfFieldIndex]))
return fieldName, nil
} | Fixing to use decoder for string conversion for field names. | LindsayBradford_go-dbf | train | go |
2ce33d8673e324db933a0cc19fc583f00e361ff8 | diff --git a/macaroonbakery/tests/test_bakery.py b/macaroonbakery/tests/test_bakery.py
index <HASH>..<HASH> 100644
--- a/macaroonbakery/tests/test_bakery.py
+++ b/macaroonbakery/tests/test_bakery.py
@@ -145,6 +145,16 @@ def discharge_401(url, request):
}
+@urlmatch(path='.*/visit')
+def visit_200(url, request):
+ return {
+ 'status_code': 200,
+ 'content': {
+ 'interactive': '/visit'
+ }
+ }
+
+
@urlmatch(path='.*/wait')
def wait_after_401(url, request):
if request.url != 'http://example.com/wait':
@@ -239,7 +249,8 @@ class TestBakery(TestCase):
def kind(self):
return 'unknown'
client = httpbakery.Client(interaction_methods=[UnknownInteractor()])
- with HTTMock(first_407_then_200), HTTMock(discharge_401):
+ with HTTMock(first_407_then_200), HTTMock(discharge_401),\
+ HTTMock(visit_200):
with self.assertRaises(httpbakery.InteractionError) as exc:
requests.get(
ID_PATH, | Improve mock setup for <I>-then-unknown test
`test_<I>_then_unknown_interaction_methods` causes the client to fetch
the possible methods supported by the discharger (because it's told that
it only supports a non-window method). This is currently unmocked,
which causes the client to actually contact `<URL>, but this seems to be the only failure at the moment. | go-macaroon-bakery_py-macaroon-bakery | train | py |
34ab3c175d4f0f5858f51241f22724ff596c1990 | diff --git a/salt/modules/junos.py b/salt/modules/junos.py
index <HASH>..<HASH> 100644
--- a/salt/modules/junos.py
+++ b/salt/modules/junos.py
@@ -296,8 +296,9 @@ def rpc(cmd=None, dest=None, **kwargs):
return ret
format_ = op.pop("format", "xml")
- # when called from state, dest becomes part of op via __pub_arg
- dest = dest or op.pop("dest", None)
+ # dest becomes part of op via __pub_arg if not None
+ # rpc commands objecting to dest as part of op
+ op.pop("dest", dest)
if cmd in ["get-config", "get_config"]:
filter_reply = None | Add backin the dest changes for rpc due to an updated master branch | saltstack_salt | train | py |
cad41cd1b583fce59799da6131df2cbe3270f2a8 | diff --git a/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java b/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java
+++ b/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java
@@ -38,10 +38,12 @@ public class HamcrestHelpers {
* @param <T> new expression type
* @param selector the selector to apply
* @param predicate the next Hamcrest matcher to apply
+ * @param shim to capture the runtime type of the Function's input, we make the compiler insert an array that holds the right type
* @return the composed matcher
*/
- public static <O, T> Matcher<O> property(Function<? super O, ? extends T> selector, Matcher<? super T> predicate) {
- return new TypeSafeMatcher<O>() {
+ @SafeVarargs
+ public static <O, T> Matcher<O> property(Function<? super O, ? extends T> selector, Matcher<? super T> predicate, O... shim) {
+ return new TypeSafeMatcher<O>(shim.getClass().getComponentType()) {
@Override
public boolean matchesSafely(O original) {
return predicate.matches(selector.apply(original)); | Add shim to get the runtime type of input for lambdas | Shredder121_gh-event-api | train | java |
c62f597757a14cc820d8d3fe198ab58202448c45 | diff --git a/tests/integration/states/test_host.py b/tests/integration/states/test_host.py
index <HASH>..<HASH> 100644
--- a/tests/integration/states/test_host.py
+++ b/tests/integration/states/test_host.py
@@ -1,10 +1,7 @@
-# -*- coding: utf-8 -*-
"""
tests for host state
"""
-from __future__ import absolute_import, print_function, unicode_literals
-
import logging
import os
import shutil
@@ -40,7 +37,7 @@ class HostTest(ModuleCase, SaltReturnAssertsMixin):
def setUp(self):
shutil.copyfile(os.path.join(RUNTIME_VARS.FILES, "hosts"), self.hosts_file)
self.addCleanup(self.__clear_hosts)
- super(HostTest, self).setUp()
+ super().setUp()
@slowTest
def test_present(self):
@@ -53,4 +50,4 @@ class HostTest(ModuleCase, SaltReturnAssertsMixin):
self.assertSaltTrueReturn(ret)
with salt.utils.files.fopen(self.hosts_file) as fp_:
output = salt.utils.stringutils.to_unicode(fp_.read())
- self.assertIn("{0}\t\t{1}".format(ip, name), output)
+ self.assertIn("{}\t\t{}".format(ip, name), output) | Drop Py2 and six on tests/integration/states/test_host.py | saltstack_salt | train | py |
27a7fc12d7bc09e3ef1e46c6188cd809a84bcff8 | diff --git a/trionyx/forms/layout.py b/trionyx/forms/layout.py
index <HASH>..<HASH> 100644
--- a/trionyx/forms/layout.py
+++ b/trionyx/forms/layout.py
@@ -127,6 +127,8 @@ class DateTimePicker(Field):
"""Init DateTimePicker"""
if not self.format:
self.format = get_datetime_input_format()
+ if 'format' in kwargs:
+ self.format = kwargs.get('format')
if not self.locale:
self.locale = get_current_locale() | [BUGFIX] Form Datetimepicker format is not set in __init__ | krukas_Trionyx | train | py |
c99cbd67d38ca724c17f702cec9375a54183343d | diff --git a/src/Email/Persistence/EmailType.php b/src/Email/Persistence/EmailType.php
index <HASH>..<HASH> 100644
--- a/src/Email/Persistence/EmailType.php
+++ b/src/Email/Persistence/EmailType.php
@@ -73,6 +73,14 @@ class EmailType extends Type
/**
* {@inheritdoc}
*/
+ public function requiresSQLCommentHint(AbstractPlatform $platform)
+ {
+ return !parent::requiresSQLCommentHint($platform);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function getName()
{
return self::EMAIL; | Fix `EmailType`: tell Doctrine to add a SQL comment hint.
This prevents Doctrine to think the field is not updated and avoid it tries to update it each time. | Aerendir_PHPValueObjects | train | php |
e208f376d63af090fcd4562fe5b622d24e46ea0f | diff --git a/src/Sulu/Bundle/ContactBundle/Resources/public/js/controller/account/list.js b/src/Sulu/Bundle/ContactBundle/Resources/public/js/controller/account/list.js
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/ContactBundle/Resources/public/js/controller/account/list.js
+++ b/src/Sulu/Bundle/ContactBundle/Resources/public/js/controller/account/list.js
@@ -51,7 +51,24 @@ define([
var account = new Account({id: id});
account.destroy();
});
+
+ this.initOperationsRight();
+
}.bind(this));
+ },
+
+ initOperationsRight: function(){
+
+ var $operationsRight = $('#headerbar-mid-right');
+ $operationsRight.empty();
+ $operationsRight.append(this.template.button('#contacts/companies/add','Add...'));
+ },
+
+ template: {
+ button: function(url, name){
+
+ return '<a class="btn" href="'+url+'" target="_top" title="Add">'+name+'</a>';
+ }
}
});
});
\ No newline at end of file | added Add-Button for accounts/companies | sulu_sulu | train | js |
76edeb13237779d1eedf5342ef0165239168cd2c | diff --git a/dev_tools/bash_scripts_test.py b/dev_tools/bash_scripts_test.py
index <HASH>..<HASH> 100644
--- a/dev_tools/bash_scripts_test.py
+++ b/dev_tools/bash_scripts_test.py
@@ -18,7 +18,7 @@ from typing import TYPE_CHECKING, Iterable
from dev_tools import shell_tools
if TYPE_CHECKING:
- import _pytest
+ import _pytest.tmpdir
def only_on_posix(func): | Better import for sometimes failing mypy test (#<I>)
Would get:
dev_tools/bash_scripts_test.py:<I>: error: Name
'_pytest.tmpdir.TempdirFactory' is not defined
This fixes it. Don't know why it sometimes works on
some configurations. | quantumlib_Cirq | train | py |
cb833555953bc4afa881df64288c8a912e5e24aa | diff --git a/Kwf/Component/View/Helper/IncludeCode.php b/Kwf/Component/View/Helper/IncludeCode.php
index <HASH>..<HASH> 100644
--- a/Kwf/Component/View/Helper/IncludeCode.php
+++ b/Kwf/Component/View/Helper/IncludeCode.php
@@ -74,9 +74,11 @@ class Kwf_Component_View_Helper_IncludeCode extends Kwf_Component_View_Helper_Ab
//see http://nexxar.wordpress.com/2010/10/07/speeding-up-jquery-ready-on-ie/
$ret .= "\n";
+ $ret .= "<!--[if lt IE 9]><!-->\n";
$ret .= "<script type=\"text/javascript\">\n";
- $ret .= " if (Ext2 && Ext2.isIE8 && jQuery) jQuery.ready();\n";
+ $ret .= " jQuery.ready();\n";
$ret .= "</script>\n";
+ $ret .= "<!--<![endif]-->\n";
}
return $ret; | no ext2 dependency in frontend | koala-framework_koala-framework | train | php |
e91083a516d1204d124a284d01a01fa0c201ec8b | diff --git a/xbbg/__init__.py b/xbbg/__init__.py
index <HASH>..<HASH> 100644
--- a/xbbg/__init__.py
+++ b/xbbg/__init__.py
@@ -1,3 +1,3 @@
"""Bloomberg data toolkit for humans"""
-__version__ = '0.2.6'
+__version__ = '0.2.7' | version <I> - optimized logging of missing queries | alpha-xone_xbbg | train | py |
55ed3b398ed53d843db12b26ebc80d59cf6af681 | diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index <HASH>..<HASH> 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -9,6 +9,15 @@ module Kms
new_kms_user_session_path
end
+ # You need to override respond to eliminate recall
+ def respond
+ if http_auth?
+ http_auth
+ else
+ redirect
+ end
+ end
+
end
end | need to have this according to guide from devise | apiqcms_kms | train | rb |
29009fdc346f172d0e4b91e2550d398b07892b86 | diff --git a/watchtower/standalone.go b/watchtower/standalone.go
index <HASH>..<HASH> 100644
--- a/watchtower/standalone.go
+++ b/watchtower/standalone.go
@@ -78,13 +78,14 @@ func New(cfg *Config) (*Standalone, error) {
// Initialize the server with its required resources.
server, err := wtserver.New(&wtserver.Config{
- ChainHash: cfg.ChainHash,
- DB: cfg.DB,
- NodePrivKey: cfg.NodePrivKey,
- Listeners: listeners,
- ReadTimeout: cfg.ReadTimeout,
- WriteTimeout: cfg.WriteTimeout,
- NewAddress: cfg.NewAddress,
+ ChainHash: cfg.ChainHash,
+ DB: cfg.DB,
+ NodePrivKey: cfg.NodePrivKey,
+ Listeners: listeners,
+ ReadTimeout: cfg.ReadTimeout,
+ WriteTimeout: cfg.WriteTimeout,
+ NewAddress: cfg.NewAddress,
+ DisableReward: true,
})
if err != nil {
return nil, err | watchtower/standalone: disable reward towers | lightningnetwork_lnd | train | go |
8b9aa065ea739c2303f129b93cd32c6560531ca6 | diff --git a/lib/drizzlepac/tweakback.py b/lib/drizzlepac/tweakback.py
index <HASH>..<HASH> 100644
--- a/lib/drizzlepac/tweakback.py
+++ b/lib/drizzlepac/tweakback.py
@@ -194,8 +194,8 @@ def tweakback(drzfile, input=None, origwcs = None,
crderr2 = 0.0
del scihdr
### Step 2: Generate footprints for each WCS
- final_fp = final_wcs.calcFootprint()
- orig_fp = orig_wcs.calcFootprint()
+ final_fp = final_wcs.calc_footprint()
+ orig_fp = orig_wcs.calc_footprint()
### Step 3: Create pixel positions in final WCS for each footprint
final_xy_fp = final_wcs.wcs_world2pix(final_fp, 1) | Update to tweakback to get it to work with the updated interface to calc_footprint in stwcs.
git-svn-id: <URL> | spacetelescope_drizzlepac | train | py |
90715d7a8d250bb229c18e6937e49b4614b8d61d | diff --git a/mnet/lib.php b/mnet/lib.php
index <HASH>..<HASH> 100644
--- a/mnet/lib.php
+++ b/mnet/lib.php
@@ -100,6 +100,19 @@ function mnet_get_public_key($uri, $application=null) {
}
$res = xmlrpc_decode(curl_exec($ch));
+
+ // check for curl errors
+ $curlerrno = curl_errno($ch);
+ if ($curlerrno!=0) {
+ debugging("Request for $uri failed with curl error $curlerrno");
+ }
+
+ // check HTTP error code
+ $info = curl_getinfo($ch);
+ if (!empty($info['http_code']) and ($info['http_code'] != 200)) {
+ debugging("Request for $uri failed with HTTP code ".$info['http_code']);
+ }
+
curl_close($ch);
if (!is_array($res)) { // ! error
@@ -115,8 +128,17 @@ function mnet_get_public_key($uri, $application=null) {
mnet_set_public_key($uri, $public_certificate);
return $public_certificate;
}
+ else {
+ debugging("Request for $uri returned public key for different URI - $host");
+ }
+ }
+ else {
+ debugging("Request for $uri returned empty response");
}
}
+ else {
+ debugging( "Request for $uri returned unexpected result");
+ }
return false;
} | MDL-<I>
Added some debugging messages, if anything fails.
Merged from STABLE_<I> | moodle_moodle | train | php |
99911937c53145112b142dd155461a75bb279c93 | diff --git a/lib/queues.js b/lib/queues.js
index <HASH>..<HASH> 100644
--- a/lib/queues.js
+++ b/lib/queues.js
@@ -25,7 +25,7 @@ exports._createSourceQueue = function(component) {
.task('concat')
.task('jslint')
.task('template', {
- templateFile: '../templates/moduletemplate.handlebars', // use build spec
+ templateFile: path.resolve(__dirname + '/../templates/moduletemplate.handlebars'), // use build spec
model: {
yuivar : 'Y',
component : component_name, | Fixed one of the relative paths to a template which would cancel the template task. | mosen_ybuild | train | js |
e0296b0b55bca96163a2fd8bee65344b8b70d0fc | diff --git a/src/components/dialog/Dialog.js b/src/components/dialog/Dialog.js
index <HASH>..<HASH> 100644
--- a/src/components/dialog/Dialog.js
+++ b/src/components/dialog/Dialog.js
@@ -384,7 +384,7 @@ export class Dialog extends Component {
this.bindDocumentResizeListeners();
}
- if (this.props.closeOnEscape && this.props.closable) {
+ if (this.props.closable) {
this.bindDocumentKeyDownListener();
}
}
@@ -436,7 +436,7 @@ export class Dialog extends Component {
let paramLength = params.length;
let dialogId = params[paramLength - 1] ? params[paramLength - 1].id : undefined;
- if (dialogId === this.state.id) {
+ if (dialogId === this.state.id && this.props.closeOnEscape) {
let dialog = document.getElementById(dialogId);
if (event.which === 27) { | Fixed #<I> - Dialog: pressing escape in a nested dialog closes the parent dialog | primefaces_primereact | train | js |
8825236456b69b454cfc9809ac2846dd7d5153da | diff --git a/src/utils/utils.js b/src/utils/utils.js
index <HASH>..<HASH> 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -35,12 +35,7 @@ Utils.addBaseURL = function (url, base) {
}
if (relative) {
- let path = base_info.href.match(/([^\#]+)/); // strip hash
- path = (path && path.length > 1) ? path[0] : '';
-
- path = base_info.href.match(/([^\?]+)/); // strip query string
- path = (path && path.length > 1) ? path[0] : '';
-
+ let path = Utils.pathForURL(base_info.href);
url = path + url;
}
else {
@@ -61,6 +56,16 @@ Utils.addBaseURL = function (url, base) {
Utils.pathForURL = function (url) {
if (typeof url === 'string' && url.search(/^(data|blob):/) === -1) {
+ let qs = url.indexOf('?');
+ if (qs > -1) {
+ url = url.substr(0, qs);
+ }
+
+ let hash = url.indexOf('#');
+ if (hash > -1) {
+ url = url.substr(0, hash);
+ }
+
return url.substr(0, url.lastIndexOf('/') + 1) || '';
}
return ''; | consolidate URL path logic (and fix yet another path case) | tangrams_tangram | train | js |
ce3581c51d705c457e576f9caae75fd237655802 | diff --git a/code/SiteTreeSubsites.php b/code/SiteTreeSubsites.php
index <HASH>..<HASH> 100644
--- a/code/SiteTreeSubsites.php
+++ b/code/SiteTreeSubsites.php
@@ -227,7 +227,15 @@ class SiteTreeSubsites extends SiteTreeDecorator {
}
function alternateSiteConfig() {
- return DataObject::get_one('SiteConfig', 'SubsiteID = ' . $this->owner->SubsiteID);
+ $sc = DataObject::get_one('SiteConfig', 'SubsiteID = ' . $this->owner->SubsiteID);
+ if(!$sc) {
+ $sc = new SiteConfig();
+ $sc->SubsiteID = $this->owner->SubsiteID;
+ $sc->Title = 'Your Site Name';
+ $sc->Tagline = 'your tagline here';
+ $sc->write();
+ }
+ return $sc;
}
/** | BUGFIX: If the site config for a subsite is missing, create it. (from r<I>) (from r<I>) | silverstripe_silverstripe-subsites | train | php |
54ea4bf7357d82a7cd63195dabcee883d56aa5ab | diff --git a/openpnm/models/geometry/pore_size.py b/openpnm/models/geometry/pore_size.py
index <HASH>..<HASH> 100644
--- a/openpnm/models/geometry/pore_size.py
+++ b/openpnm/models/geometry/pore_size.py
@@ -101,6 +101,9 @@ def largest_sphere(target, fixed_diameter='pore.fixed_diameter', iters=5):
_np.minimum.at(Dadd, P12[:, 0], Lt)
_np.minimum.at(Dadd, P12[:, 1], Lt)
D += Dadd
+ if _np.any(D < 0):
+ _logger.info('Negative pore diameters found! Neighboring pores are ' +
+ 'larger than the pore spacing.')
return D[network.pores(target.name)] | not sure why it failed on travis...passes locally | PMEAL_OpenPNM | train | py |
87048a09988757204b138e0767bf216f512cadad | diff --git a/vraptor-core/src/main/java/br/com/caelum/vraptor/view/DefaultLogicResult.java b/vraptor-core/src/main/java/br/com/caelum/vraptor/view/DefaultLogicResult.java
index <HASH>..<HASH> 100644
--- a/vraptor-core/src/main/java/br/com/caelum/vraptor/view/DefaultLogicResult.java
+++ b/vraptor-core/src/main/java/br/com/caelum/vraptor/view/DefaultLogicResult.java
@@ -46,6 +46,8 @@ import br.com.caelum.vraptor.proxy.Proxifier;
import br.com.caelum.vraptor.proxy.ProxyInvocationException;
import br.com.caelum.vraptor.proxy.SuperMethod;
+import com.google.common.base.Throwables;
+
/**
* The default implementation of LogicResult.<br>
* Uses cglib to provide proxies for client side redirect (url creation).
@@ -116,9 +118,7 @@ public class DefaultLogicResult implements LogicResult {
}
return null;
} catch (InvocationTargetException e) {
- if (e.getCause() instanceof RuntimeException) {
- throw (RuntimeException) e.getCause();
- }
+ Throwables.propagateIfPossible(e.getCause());
throw new ProxyInvocationException(e);
} catch (Exception e) {
throw new ProxyInvocationException(e); | Using Guava to propagate exception instead of ifs | caelum_vraptor4 | train | java |
e38ff86c33fe4c612d2b29bceae4ab9118ff48e9 | diff --git a/salt/client.py b/salt/client.py
index <HASH>..<HASH> 100644
--- a/salt/client.py
+++ b/salt/client.py
@@ -177,6 +177,7 @@ class LocalClient(object):
continue
if comps[0] not in grains:
minions.remove(id_)
+ continue
if isinstance(grains[comps[0]], list):
# We are matching a single component to a single list member
found = False | Should fix #<I>, please let me know | saltstack_salt | train | py |
4dd49908d00d2044e4112769fcdf1abce878462f | diff --git a/spring-social-core/src/main/java/org/springframework/social/support/BufferingClientHttpRequest.java b/spring-social-core/src/main/java/org/springframework/social/support/BufferingClientHttpRequest.java
index <HASH>..<HASH> 100644
--- a/spring-social-core/src/main/java/org/springframework/social/support/BufferingClientHttpRequest.java
+++ b/spring-social-core/src/main/java/org/springframework/social/support/BufferingClientHttpRequest.java
@@ -21,7 +21,6 @@ import java.net.URI;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
-import org.springframework.http.client.AbstractBufferingClientHttpRequest;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.util.Assert; | Fixed dependency that was breaking Spring <I> compatibility | spring-projects_spring-social | train | java |
e7fc654d3073562b163e1a97a0f6115895400892 | diff --git a/src/Illuminate/Foundation/Validation/ValidatesRequests.php b/src/Illuminate/Foundation/Validation/ValidatesRequests.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Validation/ValidatesRequests.php
+++ b/src/Illuminate/Foundation/Validation/ValidatesRequests.php
@@ -18,6 +18,22 @@ trait ValidatesRequests
protected $validatesRequestErrorBag;
/**
+ * Run the validation routine against the given validator.
+ *
+ * @param \Illuminate\Contracts\Validation\Validator $validator
+ * @param \Illuminate\Http\Request|null $request
+ * @return void
+ */
+ public function validateWith($validator, Request $request = null)
+ {
+ $request = $request ?: app('request');
+
+ if ($validator->fails()) {
+ $this->throwValidationException($request, $validation);
+ }
+ }
+
+ /**
* Validate the given request with the given rules.
*
* @param \Illuminate\Http\Request $request | Allow validation short-cut with existing validator.
This allows you to pass a full validator instance and get the same
logic as the ->validate() method. If no request is given we can resolve
the latest request out of the IoC container. | laravel_framework | train | php |
2ebf341eedcd6fe461a075bee71b12ca920d0bb1 | diff --git a/test/k8sT/Services.go b/test/k8sT/Services.go
index <HASH>..<HASH> 100644
--- a/test/k8sT/Services.go
+++ b/test/k8sT/Services.go
@@ -1990,7 +1990,7 @@ Secondary Interface %s :: IPv4: (%s, %s), IPv6: (%s, %s)`, helpers.DualStackSupp
deploymentManager.DeleteCilium()
})
- It("with the host firewall and externalTrafficPolicy=Local", func() {
+ SkipItIf(func() bool { return helpers.SkipQuarantined() && helpers.SkipK8sVersions("1.14.x") }, "with the host firewall and externalTrafficPolicy=Local", func() {
options := map[string]string{
"hostFirewall": "true",
}
@@ -2005,7 +2005,7 @@ Secondary Interface %s :: IPv4: (%s, %s), IPv6: (%s, %s)`, helpers.DualStackSupp
testExternalTrafficPolicyLocal()
})
- It("with externalTrafficPolicy=Local", func() {
+ SkipItIf(func() bool { return helpers.SkipQuarantined() && helpers.SkipK8sVersions("1.14.x") }, "with externalTrafficPolicy=Local", func() {
DeployCiliumAndDNS(kubectl, ciliumFilename)
testExternalTrafficPolicyLocal()
}) | test: quarantine failing NodePort tests on <I> | cilium_cilium | train | go |
bafb572b701129cabde8e6b07b22a86b2c41a2f1 | diff --git a/lib/vagrant/hosts/bsd.rb b/lib/vagrant/hosts/bsd.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/hosts/bsd.rb
+++ b/lib/vagrant/hosts/bsd.rb
@@ -42,7 +42,7 @@ module Vagrant
if $?.to_i == 0
# Use sed to just strip out the block of code which was inserted
# by Vagrant
- system("sudo sed -e '/^# VAGRANT-BEGIN: #{env.vm.uuid}/,/^# VAGRANT-END: #{env.vm.uuid}/ d' -i bak /etc/exports")
+ system("sudo sed -e '/^# VAGRANT-BEGIN: #{env.vm.uuid}/,/^# VAGRANT-END: #{env.vm.uuid}/ d' -ibak /etc/exports")
end
end
end | More permissive sed call on BSD hosts to prevent errors when cleaning nfs
Gnu sed -i option doesn't support a space between the option and the
backup extension.
On BSD hosts running GNU sed (for instance OSX with Macports), it cleaning
nfs shares couldn't happen. | hashicorp_vagrant | train | rb |
8b09e21a27f9c74b4872ec7a6ca0c7cc95774805 | diff --git a/views/js/picManager/picManager.js b/views/js/picManager/picManager.js
index <HASH>..<HASH> 100644
--- a/views/js/picManager/picManager.js
+++ b/views/js/picManager/picManager.js
@@ -87,7 +87,7 @@ define([
function initStudentToolManager($container, $itemPanel, item) {
var $placeholder;
//get list of all info controls available
- icRegistry.loadCreators().then(function (allInfoControls) {
+ icRegistry.loadCreators().then(allInfoControls => {
//get item body container
//editor panel..
var $itemBody = $itemPanel.find('.qti-itemBody');
@@ -100,7 +100,7 @@ define([
$managerPanel,
i = 0;
- _.each(allInfoControls, function (creator) {
+ _.each(allInfoControls, creator => {
var name = creator.getTypeIdentifier(),
manifest = icRegistry.get(name),
controlExists = _.indexOf(alreadySet, name) > -1,
@@ -157,7 +157,7 @@ define([
//init event listeners:
var $checkBoxes = $('[data-role="pic-manager"]').find('input:checkbox');
- $checkBoxes.on('change.picmanager', function (e) {
+ $checkBoxes.on('change.picmanager', function onChangePicManager(e) {
e.stopPropagation();
// install toolbar if required | Replace callbacks to arrow functions | oat-sa_extension-tao-itemqti-pic | train | js |
b97375fc29a88f896e14f45a34c263a4948c9ad9 | diff --git a/pkg/beam/examples/beamsh/beamsh.go b/pkg/beam/examples/beamsh/beamsh.go
index <HASH>..<HASH> 100644
--- a/pkg/beam/examples/beamsh/beamsh.go
+++ b/pkg/beam/examples/beamsh/beamsh.go
@@ -242,7 +242,7 @@ func Handlers() (*beam.UnixConn, error) {
}
func GetHandler(name string) Handler {
- if name == "log" {
+ if name == "logger" {
return func(args []string, in beam.Receiver, out beam.Sender) {
var tasks sync.WaitGroup
stdout, err := beam.SendPipe(out, data.Empty().Set("cmd", "log", "stdout").Set("fromcmd", args...).Bytes()) | beam/examples/beamsh: rename 'log' to 'logger' to avoid conflict with stdout/stderr
Docker-DCO-<I>- | moby_moby | train | go |
2e13e3df7698cd06091cfa946b5764e7044a7269 | diff --git a/src/BugsnagServiceProvider.php b/src/BugsnagServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/BugsnagServiceProvider.php
+++ b/src/BugsnagServiceProvider.php
@@ -12,6 +12,7 @@ use Bugsnag\Configuration;
use Bugsnag\PsrLogger\BugsnagLogger;
use Bugsnag\PsrLogger\MultiLogger as BaseMultiLogger;
use Bugsnag\Report;
+use DateTime;
use Illuminate\Auth\GenericUser;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
@@ -27,7 +28,6 @@ use Laravel\Lumen\Application as LumenApplication;
use Monolog\Handler\PsrHandler;
use Monolog\Logger;
use ReflectionClass;
-use DateTime;
class BugsnagServiceProvider extends ServiceProvider
{
@@ -416,8 +416,8 @@ class BugsnagServiceProvider extends ServiceProvider
if (preg_match('/(\d+\.\d+\.\d+)/', $version, $versionMatches)) {
$version = $versionMatches[0];
}
- return [ ($this->app instanceof LumenApplication ? 'lumen' : 'laravel' ) => $version ];
+ return [($this->app instanceof LumenApplication ? 'lumen' : 'laravel') => $version];
}
/** | Apply fixes from StyleCI (#<I>) | bugsnag_bugsnag-laravel | train | php |
56728ec1ac4231419617b76f3887c3a5446e2b4e | diff --git a/lib/boson/runners/console_runner.rb b/lib/boson/runners/console_runner.rb
index <HASH>..<HASH> 100644
--- a/lib/boson/runners/console_runner.rb
+++ b/lib/boson/runners/console_runner.rb
@@ -28,6 +28,8 @@ module Boson
return
end
ARGV.replace ['-f']
+ $progname = $0
+ alias $0 $progname
Kernel.load $0 = repl
end | workaround frozen $0 to get --console working in ruby >= <I> | cldwalker_boson | train | rb |
89131070e1e0bf440a508d95833b57977f655e72 | diff --git a/raiden/smart_contracts/tests/test_ncc.py b/raiden/smart_contracts/tests/test_ncc.py
index <HASH>..<HASH> 100644
--- a/raiden/smart_contracts/tests/test_ncc.py
+++ b/raiden/smart_contracts/tests/test_ncc.py
@@ -83,5 +83,5 @@ def test_ncc():
a1, d1, a2, d2 = c.addrAndDep()
assert a1 == tester.a0.encode('hex')
assert a2 == tester.a1.encode('hex')
- # assert d1 == 30 # failing until we can use deposit in the tests
- # assert d2 == 20 # failing until we can use deposit in the tests
+ assert d1 == 30
+ assert d2 == 0 | adding test for issue #<I> | raiden-network_raiden | train | py |
95bac1fb52738b10d41654400ce5eaa6166c10b1 | diff --git a/tests/WidgetTest/IsTest.php b/tests/WidgetTest/IsTest.php
index <HASH>..<HASH> 100644
--- a/tests/WidgetTest/IsTest.php
+++ b/tests/WidgetTest/IsTest.php
@@ -182,19 +182,6 @@ class IsTest extends TestCase
$this->isIn('apple', 'not array');
}
- public function testIsEndsWith()
- {
- $this->assertTrue($this->isEndsWith('abc', 'c'));
-
- $this->assertFalse($this->isEndsWith('abc', ''));
-
- $this->assertFalse($this->isEndsWith('abc', 'b'));
-
- $this->assertTrue($this->isEndsWith('ABC', 'c'));
-
- $this->assertFalse($this->isEndsWith('ABC', 'c', true));
- }
-
public function testIsStartsWith()
{
$this->assertTrue($this->isStartsWith('abc', 'a')); | removed isEndsWith tests in IsTest file | twinh_wei | train | php |
ec05c944edc7d6f69833cb032490ac33c62ff043 | diff --git a/src/feat/agencies/net/messaging.py b/src/feat/agencies/net/messaging.py
index <HASH>..<HASH> 100644
--- a/src/feat/agencies/net/messaging.py
+++ b/src/feat/agencies/net/messaging.py
@@ -379,6 +379,11 @@ class Channel(log.Logger, log.LogProxy, StateMachineMixin):
content.properties['delivery mode'] = 1 # non-persistent
self.log('Publishing msg=%s, shard=%s, key=%s', message, shard, key)
+ if shard is None:
+ self.error('Tried to sent message to exchange=None. This would '
+ 'mess up the whole txamqp library state, therefore '
+ 'this message is ignored')
+ return defer.succeed(None)
d = self.channel.basic_publish(exchange=shard, content=content,
routing_key=key, immediate=False)
d.addCallback(defer.drop_param, self.channel.tx_commit) | Secure network messaging from sending messages to shard=None | f3at_feat | train | py |
9da0ac2d904f257c84a3174a3b1cf6b67bf8eafd | diff --git a/src/server/queue/index.js b/src/server/queue/index.js
index <HASH>..<HASH> 100644
--- a/src/server/queue/index.js
+++ b/src/server/queue/index.js
@@ -94,7 +94,7 @@ class Queues {
];
if (data.name) args.unshift(data.name)
- return queue.add.apply(queue, data);
+ return queue.add.apply(queue, args);
}
}
} | fix: pass the expected arguments to BullQueue#add | bee-queue_arena | train | js |
c5e3c19afc2c5b88ff2149debe18144bf6a6c987 | diff --git a/sprinter/environment.py b/sprinter/environment.py
index <HASH>..<HASH> 100644
--- a/sprinter/environment.py
+++ b/sprinter/environment.py
@@ -79,11 +79,11 @@ class Environment(object):
@warmup
def install(self):
""" Install the environment """
+ if not self.directory.new:
+ self.logger.info("Namespace %s already exists!" % self.namespace)
+ self.source = self.config.set_source(Manifest(self.directory.manifest_path))
+ return self.update()
try:
- if not self.directory.new:
- self.logger.info("Namespace %s already exists!" % self.namespace)
- self.source = self.config.set_source(Manifest(self.directory.manifest_path))
- return self.update()
self.logger.info("Installing environment %s..." % self.namespace)
self.directory.initialize()
self._specialize_contexts() | failed updates won't blow stuff away | toumorokoshi_sprinter | train | py |
2d40183d17a36384331db3b3d5d2e24b8188b2ab | diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindRefComparison.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindRefComparison.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/detect/FindRefComparison.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/FindRefComparison.java
@@ -569,7 +569,7 @@ public class FindRefComparison implements Detector, ExtendedTypes {
if (field != null) {
// If the field is final, we'll assume that the String value
// is static.
- if (field.isFinal() && field.isFinal()) {
+ if (field.isFinal()) {
pushValue(staticStringTypeInstance);
} else {
pushValue(type); | Update FindRefComparison.java
This expression looks redundant; is it sensible to remove? | spotbugs_spotbugs | train | java |
30d007c927cc53c9fe7089ca8053b3ffa6ef92e4 | diff --git a/bibliopixel/animation/animation.py b/bibliopixel/animation/animation.py
index <HASH>..<HASH> 100644
--- a/bibliopixel/animation/animation.py
+++ b/bibliopixel/animation/animation.py
@@ -159,8 +159,7 @@ class Animation(object):
else:
self.state = self.runner.compute_state(self.cur_step, self.state)
- @contextlib.contextmanager
- def _run_context(self, clean_layout=True):
+ def _pre_run(self):
self.state = STATE.running
self.runner.run_start_time = self.project.time()
self.threading.stop_event.clear()
@@ -170,8 +169,13 @@ class Animation(object):
self._check_delay()
self.preclear and self.layout.all_off()
+
self.pre_run()
+ @contextlib.contextmanager
+ def _run_context(self, clean_layout=True):
+ self._pre_run()
+
try:
yield
finally: | New animation._pre_run() method | ManiacalLabs_BiblioPixel | train | py |
cd9d81096ca5783503467b06dfd9f58e7d4a8f2b | diff --git a/lib/redis_failover/client.rb b/lib/redis_failover/client.rb
index <HASH>..<HASH> 100644
--- a/lib/redis_failover/client.rb
+++ b/lib/redis_failover/client.rb
@@ -36,6 +36,12 @@ module RedisFailover
end
end
+ def call(command, &block)
+ method = command[0]
+ args = command[1..-1]
+ dispatch(method, *args, &block)
+ end
+
# Creates a new failover redis client.
#
# @param [Hash] options the options used to initialize the client instance
diff --git a/spec/client_spec.rb b/spec/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/client_spec.rb
+++ b/spec/client_spec.rb
@@ -66,6 +66,13 @@ module RedisFailover
end
end
+ describe '#call' do
+ it 'should dispatch :call messages to correct method' do
+ client.should_receive(:dispatch).with(:foo, *['key'])
+ client.call([:foo, 'key'])
+ end
+ end
+
context 'with :master_only false' do
it 'routes read operations to a slave' do
called = false | Define 'call' method on client to enable use with redis-store | ryanlecompte_redis_failover | train | rb,rb |
611bf5580dec271f2ea64ecb3095c4bcc46590c3 | diff --git a/nodeshot/core/base/choices.py b/nodeshot/core/base/choices.py
index <HASH>..<HASH> 100755
--- a/nodeshot/core/base/choices.py
+++ b/nodeshot/core/base/choices.py
@@ -1,4 +1,5 @@
from django.utils.translation import ugettext_lazy as _
+from django.conf import settings
NODE_STATUS = (
(-1, _('archived')),
@@ -158,12 +159,9 @@ ETHERNET_STANDARDS = (
('10/100/1000', '10/100/1000 Gigabit Ethernet'),
)
-ACCESS_LEVELS = (
- ('public', _('public')),
- ('1', _('registered')),
- ('2', _('community')),
- ('private', _('private')),
-)
+ACCESS_LEVELS = [('public', _('public'))]
+ACCESS_LEVELS += [group for group in settings.NODESHOT['CHOICES']['ACCESS_LEVELS']]
+ACCESS_LEVELS += [('private', _('private'))]
IP_PROTOCOLS = (
('ipv4', 'ipv4'), | Changed ACCESS_LEVELS so that they will be calculated depending on settings.py | ninuxorg_nodeshot | train | py |
43b4d0d06cc1bdbfa7bdc37571959dacffdeb2b9 | diff --git a/modules/orionode/lib/sites.js b/modules/orionode/lib/sites.js
index <HASH>..<HASH> 100644
--- a/modules/orionode/lib/sites.js
+++ b/modules/orionode/lib/sites.js
@@ -73,7 +73,8 @@ function virtualHost(vhost, req, res, next) {
if (options.configParams["orion.single.user"]) {
path = mPath.join(options.workspaceDir, mapping.Target, relative);
} else {
- path = mPath.join(options.workspaceDir, username.substring(0, 2), username, "OrionContent", mapping.Target, relative);
+ var file = fileUtil.getFile(req, mapping.Target);
+ path = mPath.join(file.path, relative);
}
if (fs.existsSync(path) && fs.lstatSync(path).isFile()) {
res.sendFile(path); | Bug <I> - self-hosting is broken in orion.eclipse.org | eclipse_orion.client | train | js |
0ed67ff97749361d9df501ac243c7aafbf9c4fcc | diff --git a/src/Adldap/Classes/AdldapBase.php b/src/Adldap/Classes/AdldapBase.php
index <HASH>..<HASH> 100644
--- a/src/Adldap/Classes/AdldapBase.php
+++ b/src/Adldap/Classes/AdldapBase.php
@@ -39,4 +39,14 @@ class AdldapBase
if($connection) $this->connection = $connection;
}
+
+ /**
+ * Returns the current Adldap instance.
+ *
+ * @return Adldap
+ */
+ public function getAdldap()
+ {
+ return $this->adldap;
+ }
} | Added getAdldap method on AdldapBase class | Adldap2_Adldap2 | train | php |
de2452a6c3e58b7b4d8234c3d0bceac2987435eb | diff --git a/core/src/main/java/org/infinispan/stream/impl/ClusterStreamManagerImpl.java b/core/src/main/java/org/infinispan/stream/impl/ClusterStreamManagerImpl.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/stream/impl/ClusterStreamManagerImpl.java
+++ b/core/src/main/java/org/infinispan/stream/impl/ClusterStreamManagerImpl.java
@@ -510,10 +510,13 @@ public class ClusterStreamManagerImpl<K> implements ClusterStreamManager<K> {
if (n <= 0) {
throw new IllegalArgumentException("request amount must be greater than 0");
}
- long batchAmount = requestedAmount.addAndGet(n);
+ requestedAmount.addAndGet(n);
// If there is no pending request we can submit a new one
if (!pendingRequest.getAndSet(true)) {
- sendRequest(batchAmount);
+ // We can only send the batch amount after we have confirmed that we will send the request
+ // otherwise we could request too much since this requestedAmount is not decremented until
+ // all entries have been sent via onNext. However the amount is decremented before updating pendingRequest
+ sendRequest(requestedAmount.get());
}
} | ISPN-<I> ClusterStreamManagerImpl Subscription can request too many
remote entries
* Only acquire batch amount after we know we can send requests | infinispan_infinispan | train | java |
2cd11a7c563d48378b5ce69454d26aaf04f617aa | diff --git a/core/cas-server-core-configuration/src/main/java/org/apereo/cas/configuration/support/Beans.java b/core/cas-server-core-configuration/src/main/java/org/apereo/cas/configuration/support/Beans.java
index <HASH>..<HASH> 100644
--- a/core/cas-server-core-configuration/src/main/java/org/apereo/cas/configuration/support/Beans.java
+++ b/core/cas-server-core-configuration/src/main/java/org/apereo/cas/configuration/support/Beans.java
@@ -181,7 +181,7 @@ public final class Beans {
final Map<String, List<Object>> pdirMap = new HashMap<>();
p.getAttributes().entrySet().forEach(entry -> {
final String[] vals = org.springframework.util.StringUtils.commaDelimitedListToStringArray(entry.getValue());
- pdirMap.put(entry.getKey(), Lists.newArrayList((String[]) vals));
+ pdirMap.put(entry.getKey(), Lists.newArrayList((Object[]) vals));
});
dao.setBackingMap(pdirMap);
return dao; | fix castinng issue to remove javac warning | apereo_cas | train | java |
9d9e23cc44f67f784714e5d1823dcdccd0baa12c | diff --git a/agent/proxycfg/manager.go b/agent/proxycfg/manager.go
index <HASH>..<HASH> 100644
--- a/agent/proxycfg/manager.go
+++ b/agent/proxycfg/manager.go
@@ -188,7 +188,7 @@ func (m *Manager) ensureProxyServiceLocked(ns *structs.NodeService, token string
}
// Set the necessary dependencies
- state.logger = m.Logger
+ state.logger = m.Logger.With("service_id", sid.String())
state.cache = m.Cache
state.source = m.Source
state.dnsConfig = m.DNSConfig | Add service id context to the proxycfg logger
This is especially useful when multiple proxies are all querying the
same Consul agent. | hashicorp_consul | train | go |
9d25c1a2a9378495cf6fb3a50484cc6c376f9a6f | diff --git a/src/Content.php b/src/Content.php
index <HASH>..<HASH> 100644
--- a/src/Content.php
+++ b/src/Content.php
@@ -466,13 +466,9 @@ class Content implements \ArrayAccess
if (!empty($values['taxonomy'])) {
foreach ($values['taxonomy'] as $taxonomytype => $value) {
- if (!is_array($value)) {
- $value = explode(",", $value);
- }
-
if (isset($values['taxonomy-order'][$taxonomytype])) {
foreach ($value as $k => $v) {
- $value[$k] = $v . "#" . $values['taxonomy-order'][$taxonomytype];
+ $value[$k] = $v . '#' . $values['taxonomy-order'][$taxonomytype];
}
} | Taxonomy post vakues are always arrays now | bolt_bolt | train | php |
154abbb5aa0a2464d1ee7f46baa083d4893bfd85 | diff --git a/spec/agent_spec.rb b/spec/agent_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/agent_spec.rb
+++ b/spec/agent_spec.rb
@@ -156,9 +156,12 @@ describe Instrumental::Agent, "enabled" do
@agent.increment('fork_reconnect_test', 1, 3) # triggers reconnect
end
wait
+ @agent.increment('fork_reconnect_test', 1, 4) # triggers reconnect
+ wait
@server.connect_count.should == 2
@server.commands.should include("increment fork_reconnect_test 1 2")
@server.commands.should include("increment fork_reconnect_test 1 3")
+ @server.commands.should include("increment fork_reconnect_test 1 4")
end
it "should never let an exception reach the user" do | Testing that original parent can still send commands. | Instrumental_instrumental_agent-ruby | train | rb |
3106e023169315f88c74f9ce3a39cc56b78aaa9f | diff --git a/host/analysis/analyze_raw_data.py b/host/analysis/analyze_raw_data.py
index <HASH>..<HASH> 100644
--- a/host/analysis/analyze_raw_data.py
+++ b/host/analysis/analyze_raw_data.py
@@ -148,7 +148,7 @@ class AnalyzeRawData(object):
self.create_cluster_table = False
self.create_cluster_size_hist = False
self.create_cluster_tot_hist = False
- self._n_injection = 100
+ self.n_injections = 100
self.n_bcid = 16
self.max_tot_value = 13 | MAINT: use property to set the number of injections | SiLab-Bonn_pyBAR | train | py |
cc69394562597fd4358bdc8c3105068dd5ffcb21 | diff --git a/src/Bkwld/Decoy/Models/Encoding.php b/src/Bkwld/Decoy/Models/Encoding.php
index <HASH>..<HASH> 100644
--- a/src/Bkwld/Decoy/Models/Encoding.php
+++ b/src/Bkwld/Decoy/Models/Encoding.php
@@ -3,7 +3,7 @@
// Dependencies
use Config;
use Request;
-use HtmlObject\Element;
+use HtmlObject\Element as HtmlElement;
use Bkwld\Library\Utils\File;
/**
@@ -210,7 +210,7 @@ class Encoding extends Base {
$sources = json_decode($sources);
// Start the tag
- $tag = Element::video();
+ $tag = HtmlElement::video();
$tag->value('Your browser does not support the video tag. You should <a href="http://whatbrowser.org/">consider updating</a>.');
// Loop through the outputs and add them as sources
@@ -221,7 +221,7 @@ class Encoding extends Base {
if (!in_array($type, $types)) continue;
// Make the source
- $source = Element::source()->src($src);
+ $source = HtmlElement::source()->src($src);
if ($type == 'playlist') $source->type('application/x-mpegurl');
else $source->type('video/'.$type); | Fixing classname collision with Element | BKWLD_decoy | train | php |
81208aae90a6d1d1bb5e2af9dd49f7e0b9805000 | diff --git a/library/src/main/java/ibt/ortc/extensibility/OrtcClient.java b/library/src/main/java/ibt/ortc/extensibility/OrtcClient.java
index <HASH>..<HASH> 100755
--- a/library/src/main/java/ibt/ortc/extensibility/OrtcClient.java
+++ b/library/src/main/java/ibt/ortc/extensibility/OrtcClient.java
@@ -1390,8 +1390,8 @@ public abstract class OrtcClient {
&& args.length == 1 ? args[0] : null);
onConnected.run(sender);
- startHeartBeatInterval();
}
+ startHeartBeatInterval();
}
}
@@ -1474,8 +1474,8 @@ public abstract class OrtcClient {
OrtcClient sender = (OrtcClient) (args != null && args.length == 1 ? args[0]
: null);
onReconnected.run(sender);
- startHeartBeatInterval();
}
+ startHeartBeatInterval();
}
private void raiseOnReconnecting(Object... args) { | Calling startHeartBeatInterval even if the onConnected and onReconnected callbacks are not implemented. | realtime-framework_RealtimeMessaging-Android | train | java |
dbd38cc516523e1f9bf4a7a89b95d665e56376c0 | diff --git a/src/services/DebugServer.js b/src/services/DebugServer.js
index <HASH>..<HASH> 100644
--- a/src/services/DebugServer.js
+++ b/src/services/DebugServer.js
@@ -44,7 +44,7 @@ module.exports = class DebugServer {
}
if (this._connection) {
if (address === this._connection.address) {
- return this._connection.open(webSocket, serverId);
+ return this._connection.open(webSocket, sessionId);
}
if (sessionId < this._connection.sessionId) {
return webSocket.close(OUTDATED_CONNECTION_CLOSURE);
@@ -104,6 +104,9 @@ module.exports = class DebugServer {
}
_onDisconnect(connection) {
+ if (this._printStateTimer !== -1) {
+ clearTimeout(this._printStateTimer);
+ }
this._printStateTimer = setTimeout(() => {
this._printStateTimer = -1;
this._printClientState(connection.device, STATE_DISCONNECTED); | Fix wrong session ID and unexpected disconnect log
A connection could close and open in a short timespan, leading to the
disconnect callback being called multiple times. This sometimes resulted
into an outdated timeout handler being unexpectedly executed after a
successful connection, leading to a "disconnected" message being printed
to the console, although a connection was already open.
Change-Id: I<I>a4e5dea<I>defb<I>fd<I>cff<I>e<I>a8fa9 | eclipsesource_tabris-js-cli | train | js |
17c50e92054956245875e52a6efcb1f577f4faad | diff --git a/src/editor/config/config.js b/src/editor/config/config.js
index <HASH>..<HASH> 100644
--- a/src/editor/config/config.js
+++ b/src/editor/config/config.js
@@ -40,7 +40,7 @@ define(function () {
width: '100%',
// CSS that could only be seen (for instance, inside the code viewer)
- protectedCss: '*{box-sizing: border-box;}body{margin:0;height:auto;background-color:#fff}#wrapper{min-height:100%; overflow:auto}',
+ protectedCss: '',
// CSS for the iframe which containing the canvas, useful if you need to custom something inside
// (eg. the style of the selected component) | Clean protectedCss in config file | artf_grapesjs | train | js |
5e6a8813c81acf5ca9fb8c9dcff8bc24132b0ece | diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/environments/production.rb
+++ b/spec/dummy/config/environments/production.rb
@@ -68,7 +68,7 @@ Rails.application.configure do
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
- config.i18n.fallbacks = true
+ config.i18n.fallbacks = [I18n.default_locale]
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify | Back required configurations in config/environments/production.rb. | gomo_dynamic_scaffold | train | rb |
e21f2f03e69230f4a39c1299e40406d39266b53c | diff --git a/tests/Analyse/Callback/Iterate/ThroughMethodsTest.php b/tests/Analyse/Callback/Iterate/ThroughMethodsTest.php
index <HASH>..<HASH> 100644
--- a/tests/Analyse/Callback/Iterate/ThroughMethodsTest.php
+++ b/tests/Analyse/Callback/Iterate/ThroughMethodsTest.php
@@ -34,7 +34,7 @@
namespace Tests\Analyse\Callback\Iterate;
-use Brainworxx\Krexx\Analyse\Callback\Iterate\ThroughMethodAnalysis;
+use Brainworxx\Krexx\Analyse\Callback\Iterate\ThroughMeta;
use Brainworxx\Krexx\Analyse\Callback\Iterate\ThroughMethods;
use Brainworxx\Krexx\Analyse\ConstInterface;
use Brainworxx\Krexx\Analyse\Model;
@@ -142,7 +142,7 @@ class ThroughMethodsTest extends AbstractTest
$renderNothing = new RenderNothing(Krexx::$pool);
Krexx::$pool->render = $renderNothing;
// Overwrite the callback.
- Krexx::$pool->rewrite[ThroughMethodAnalysis::class] = CallbackNothing::class;
+ Krexx::$pool->rewrite[ThroughMeta::class] = CallbackNothing::class;
// Run the test.
$this->throughMethods | Removed a depracation from the unit tests | brainworxx_kreXX | train | php |
b33949bf59a320023582fcba915c279cb95182cc | diff --git a/web/concrete/src/User/User.php b/web/concrete/src/User/User.php
index <HASH>..<HASH> 100644
--- a/web/concrete/src/User/User.php
+++ b/web/concrete/src/User/User.php
@@ -62,7 +62,7 @@ class User extends Object
*
* @return User
*/
- public function loginByUserID($uID)
+ public static function loginByUserID($uID)
{
return self::getByUserID($uID, true);
} | Make User::loginByUserID static
It's only called statically
Former-commit-id: 5b<I>e6b0ee8b<I>ef<I>ae2b<I>b<I>c<I>
Former-commit-id: <I>f<I>c<I>d<I>a<I>b<I>ab<I>e<I>e1a<I>c4f | concrete5_concrete5 | train | php |
0cad6708ce70d326d6e455dcc518703059b731f0 | diff --git a/virtualbox/library_ext/guest_session.py b/virtualbox/library_ext/guest_session.py
index <HASH>..<HASH> 100644
--- a/virtualbox/library_ext/guest_session.py
+++ b/virtualbox/library_ext/guest_session.py
@@ -43,10 +43,10 @@ class IGuestSession(library.IGuestSession):
"""
def read_out(process, flags, stdout, stderr):
if library.ProcessCreateFlag.wait_for_std_err in flags:
- e = process.read(2, 65000, 0)
+ e = str(process.read(2, 65000, 0))
stderr.append(e)
if library.ProcessCreateFlag.wait_for_std_out in flags:
- o = process.read(1, 65000, 0)
+ o = str(process.read(1, 65000, 0))
stdout.append(o)
process = self.process_create_ex(command, arguments, environment,
@@ -70,3 +70,8 @@ class IGuestSession(library.IGuestSession):
# make sure we have read the remainder of the out
read_out(process, flags, stdout, stderr)
return process, "".join(stdout), "".join(stderr)
+
+ def makedirs(self, path, mode=0x777):
+ """Super-mkdir: create a leaf directory and all intermediate ones."""
+ self.directory_create(path, mode, [library.DirectoryCreateFlag.parents])
+ | added makedirs and fixed windows compatability issue with execute... ready from stream was a buffer not a str | sethmlarson_virtualbox-python | train | py |
6c56029046cffecf8d2b0e6094507fbee0c0daa2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -115,6 +115,9 @@ def get_extensions():
'nvcc': nvcc_flags,
}
+ if sys.platform == 'win32':
+ define_macros += [('torchvision_EXPORTS', None)]
+
sources = [os.path.join(extensions_dir, s) for s in sources]
include_dirs = [extensions_dir] | Enable symbol annotations for Windows (#<I>) | pytorch_vision | train | py |
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.